| 53 | |
| 54 | |
| 55 | void cMonsterConfig::Initialize() |
| 56 | { |
| 57 | cIniFile MonstersIniFile; |
| 58 | |
| 59 | if (!MonstersIniFile.ReadFile("monsters.ini")) |
| 60 | { |
| 61 | LOGWARNING("%s: Cannot read monsters.ini file, monster attributes not available", __FUNCTION__); |
| 62 | return; |
| 63 | } |
| 64 | |
| 65 | for (int i = (int)MonstersIniFile.GetNumKeys(); i >= 0; i--) |
| 66 | { |
| 67 | sAttributesStruct Attributes; |
| 68 | AString Name = MonstersIniFile.GetKeyName(i); |
| 69 | Attributes.m_Name = Name; |
| 70 | Attributes.m_AttackDamage = MonstersIniFile.GetValueI(Name, "AttackDamage", 0); |
| 71 | Attributes.m_AttackRange = MonstersIniFile.GetValueI(Name, "AttackRange", 0); |
| 72 | Attributes.m_SightDistance = MonstersIniFile.GetValueI(Name, "SightDistance", 0); |
| 73 | Attributes.m_AttackRate = MonstersIniFile.GetValueF(Name, "AttackRate", 0); |
| 74 | Attributes.m_MaxHealth = MonstersIniFile.GetValueI(Name, "MaxHealth", 1); |
| 75 | m_pState->AttributesList.push_front(Attributes); |
| 76 | } // for i - SplitList[] |
| 77 | } |
| 78 | |
| 79 | |
| 80 |
nothing calls this directly
no test coverage detected