62 if (!MonstersIniFile.
ReadFile(
"monsters.ini"))
64 LOGWARNING(
"%s: Cannot read monsters.ini file, monster attributes not available", __FUNCTION__);
68 for (
int i =
static_cast<int>(MonstersIniFile.
GetNumKeys()); i >= 0; i--)
90 std::list<sAttributesStruct>::const_iterator itr;
93 if (itr->m_Name.compare(a_Name) == 0)
98 a_Monster->
SetAttackRate (
static_cast<float>(itr->m_AttackRate));
99 a_Monster->
SetMaxHealth (
static_cast<float>(itr->m_MaxHealth));
void LOGWARNING(std::string_view a_Format, const Args &... args)
void SetIsFireproof(bool a_IsFireproof)
Sets whether the entity is fireproof.
void SetMaxHealth(float a_MaxHealth)
Sets the maximum value for the health.
AString GetKeyName(const int keyID) const
bool ReadFile(const AString &a_FileName, bool a_AllowExampleRedirect=true)
Reads the contents of the specified ini file If the file doesn't exist and a_AllowExampleRedirect is ...
int GetValueI(const AString &keyname, const AString &valuename, const int defValue=0) const
bool GetValueB(const AString &keyname, const AString &valuename, const bool defValue=false) const
int GetNumKeys(void) const
Returns number of keys currently in the ini.
double GetValueF(const AString &keyname, const AString &valuename, const double defValue=0) const
void SetBurnsInDaylight(bool a_BurnsInDaylight)
void SetAttackRate(double a_AttackRate)
void SetAttackDamage(int a_AttackDamage)
void SetAttackRange(double a_AttackRange)
void SetSightDistance(int a_SightDistance)
std::list< sAttributesStruct > AttributesList
sMonsterConfigState * m_pState
void AssignAttributes(cMonster *a_Monster, const AString &a_Name)