diff options
Diffstat (limited to 'src/MonsterConfig.cpp')
-rw-r--r-- | src/MonsterConfig.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/MonsterConfig.cpp b/src/MonsterConfig.cpp index 271a72a7f..2ee7e7393 100644 --- a/src/MonsterConfig.cpp +++ b/src/MonsterConfig.cpp @@ -17,6 +17,8 @@ struct cMonsterConfig::sAttributesStruct double m_AttackRange; double m_AttackRate; double m_MaxHealth; + double m_BaseWalkSpeed; + double m_BaseRunSpeed; bool m_IsFireproof; bool m_BurnsInDaylight; }; @@ -71,10 +73,12 @@ void cMonsterConfig::Initialize() AString Name = MonstersIniFile.GetKeyName(i); Attributes.m_Name = Name; Attributes.m_AttackDamage = MonstersIniFile.GetValueI(Name, "AttackDamage", 0); - Attributes.m_AttackRange = MonstersIniFile.GetValueF(Name, "AttackRange", 0); + Attributes.m_AttackRange = MonstersIniFile.GetValueI(Name, "AttackRange", 0); Attributes.m_SightDistance = MonstersIniFile.GetValueI(Name, "SightDistance", 0); Attributes.m_AttackRate = MonstersIniFile.GetValueF(Name, "AttackRate", 0); Attributes.m_MaxHealth = MonstersIniFile.GetValueF(Name, "MaxHealth", 1); + Attributes.m_BaseWalkSpeed = MonstersIniFile.GetValueF(Name, "WalkSpeed", 1); + Attributes.m_BaseRunSpeed = MonstersIniFile.GetValueF(Name, "RunSpeed", Attributes.m_BaseWalkSpeed); Attributes.m_IsFireproof = MonstersIniFile.GetValueB(Name, "IsFireproof", false); Attributes.m_BurnsInDaylight = MonstersIniFile.GetValueB(Name, "BurnsInDaylight", false); m_pState->AttributesList.push_front(Attributes); @@ -97,6 +101,8 @@ void cMonsterConfig::AssignAttributes(cMonster * a_Monster, const AString & a_Na a_Monster->SetSightDistance (itr->m_SightDistance); a_Monster->SetAttackRate (static_cast<float>(itr->m_AttackRate)); a_Monster->SetMaxHealth (static_cast<float>(itr->m_MaxHealth)); + a_Monster->SetBaseWalkSpeed (itr->m_BaseWalkSpeed); + a_Monster->SetBaseRunSpeed (itr->m_BaseRunSpeed); a_Monster->SetIsFireproof (itr->m_IsFireproof); a_Monster->SetBurnsInDaylight(itr->m_BurnsInDaylight); return; @@ -107,4 +113,3 @@ void cMonsterConfig::AssignAttributes(cMonster * a_Monster, const AString & a_Na - |