summaryrefslogtreecommitdiffstats
path: root/src/MonsterConfig.cpp
diff options
context:
space:
mode:
authorMuhammad Kaisar Arkhan <accounts@yukiisbo.red>2018-09-24 22:32:47 +0200
committerAlexander Harkness <me@bearbin.net>2018-09-24 22:32:47 +0200
commit73689024f0b480afb84eeb898b3c429237359cab (patch)
treea9565258f6881f0691f398dd25f9dc75850c44e2 /src/MonsterConfig.cpp
parentForce all headers other than "Globals.h" to be included with relative paths (#4269) (diff)
downloadcuberite-73689024f0b480afb84eeb898b3c429237359cab.tar
cuberite-73689024f0b480afb84eeb898b3c429237359cab.tar.gz
cuberite-73689024f0b480afb84eeb898b3c429237359cab.tar.bz2
cuberite-73689024f0b480afb84eeb898b3c429237359cab.tar.lz
cuberite-73689024f0b480afb84eeb898b3c429237359cab.tar.xz
cuberite-73689024f0b480afb84eeb898b3c429237359cab.tar.zst
cuberite-73689024f0b480afb84eeb898b3c429237359cab.zip
Diffstat (limited to '')
-rw-r--r--src/MonsterConfig.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/MonsterConfig.cpp b/src/MonsterConfig.cpp
index 28132607e..6d1e2c235 100644
--- a/src/MonsterConfig.cpp
+++ b/src/MonsterConfig.cpp
@@ -18,6 +18,7 @@ struct cMonsterConfig::sAttributesStruct
double m_AttackRate;
int m_MaxHealth;
bool m_IsFireproof;
+ bool m_BurnsInDaylight;
};
@@ -69,12 +70,13 @@ void cMonsterConfig::Initialize()
sAttributesStruct Attributes;
AString Name = MonstersIniFile.GetKeyName(i);
Attributes.m_Name = Name;
- Attributes.m_AttackDamage = MonstersIniFile.GetValueI(Name, "AttackDamage", 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.GetValueI(Name, "MaxHealth", 1);
- Attributes.m_IsFireproof = MonstersIniFile.GetValueB(Name, "IsFireproof", false);
+ Attributes.m_AttackDamage = MonstersIniFile.GetValueI(Name, "AttackDamage", 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.GetValueI(Name, "MaxHealth", 1);
+ Attributes.m_IsFireproof = MonstersIniFile.GetValueB(Name, "IsFireproof", false);
+ Attributes.m_BurnsInDaylight = MonstersIniFile.GetValueB(Name, "BurnsInDaylight", false);
m_pState->AttributesList.push_front(Attributes);
} // for i - SplitList[]
}
@@ -90,12 +92,13 @@ void cMonsterConfig::AssignAttributes(cMonster * a_Monster, const AString & a_Na
{
if (itr->m_Name.compare(a_Name) == 0)
{
- a_Monster->SetAttackDamage (itr->m_AttackDamage);
- a_Monster->SetAttackRange (itr->m_AttackRange);
- a_Monster->SetSightDistance(itr->m_SightDistance);
- a_Monster->SetAttackRate (static_cast<float>(itr->m_AttackRate));
- a_Monster->SetMaxHealth (itr->m_MaxHealth);
- a_Monster->SetIsFireproof (itr->m_IsFireproof);
+ a_Monster->SetAttackDamage (itr->m_AttackDamage);
+ a_Monster->SetAttackRange (itr->m_AttackRange);
+ a_Monster->SetSightDistance (itr->m_SightDistance);
+ a_Monster->SetAttackRate (static_cast<float>(itr->m_AttackRate));
+ a_Monster->SetMaxHealth (itr->m_MaxHealth);
+ a_Monster->SetIsFireproof (itr->m_IsFireproof);
+ a_Monster->SetBurnsInDaylight(itr->m_BurnsInDaylight);
return;
}
} // for itr - m_pState->AttributesList[]