summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Server/Plugins/APIDump/APIDesc.lua21
-rw-r--r--Server/monsters.ini2
-rw-r--r--src/Mobs/Monster.h4
-rw-r--r--src/Mobs/Skeleton.cpp1
-rw-r--r--src/Mobs/Zombie.cpp1
-rw-r--r--src/MonsterConfig.cpp27
6 files changed, 40 insertions, 16 deletions
diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua
index b6a4ec81e..193a58285 100644
--- a/Server/Plugins/APIDump/APIDesc.lua
+++ b/Server/Plugins/APIDump/APIDesc.lua
@@ -8771,6 +8771,16 @@ a_Player:OpenWindow(Window);
]],
Functions =
{
+ BurnsInDaylight =
+ {
+ Returns =
+ {
+ {
+ Type = "boolean",
+ },
+ },
+ Notes = "Returns whether the mob burns in daylight.",
+ },
CanBeLeashed =
{
Returns =
@@ -8990,6 +9000,17 @@ a_Player:OpenWindow(Window);
},
Notes = "Sets the age of the monster",
},
+ SetBurnsInDaylight =
+ {
+ Params =
+ {
+ {
+ Name = "BurnsInDaylight",
+ Type = "boolean",
+ },
+ },
+ Notes = "Sets whether the mob burns in daylight. Only evaluated at next burn-decision tick",
+ },
SetCanBeLeashed =
{
Params =
diff --git a/Server/monsters.ini b/Server/monsters.ini
index 2c8950a0c..ea6b68fba 100644
--- a/Server/monsters.ini
+++ b/Server/monsters.ini
@@ -147,6 +147,7 @@ AttackRange=15.0
AttackRate=1
MaxHealth=20
SightDistance=40.0
+BurnsInDaylight=1
[Slime]
AttackDamage=4.0
@@ -203,6 +204,7 @@ AttackRange=2.0
AttackRate=1
MaxHealth=20
SightDistance=25.0
+BurnsInDaylight=1
[ZombiePigman]
AttackDamage=7.0
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index d6b02caac..11d49b82e 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -136,8 +136,8 @@ public:
void SetCanPickUpLoot(bool a_CanPickUpLoot) { m_CanPickUpLoot = a_CanPickUpLoot; }
void ResetAttackCooldown();
- /** Sets whether the mob burns in daylight. Only evaluated at next burn-decision tick */
- void SetBurnsInDaylight(bool a_BurnsInDaylight) { m_BurnsInDaylight = a_BurnsInDaylight; }
+ void SetBurnsInDaylight(bool a_BurnsInDaylight) { m_BurnsInDaylight = a_BurnsInDaylight; } // tolua_export
+ bool BurnsInDaylight() const { return m_BurnsInDaylight; } // tolua_export
double GetRelativeWalkSpeed(void) const { return m_RelativeWalkSpeed; } // tolua_export
void SetRelativeWalkSpeed(double a_WalkSpeed) { m_RelativeWalkSpeed = a_WalkSpeed; } // tolua_export
diff --git a/src/Mobs/Skeleton.cpp b/src/Mobs/Skeleton.cpp
index 2a8ca3ddb..4b8b1ab6a 100644
--- a/src/Mobs/Skeleton.cpp
+++ b/src/Mobs/Skeleton.cpp
@@ -13,7 +13,6 @@ cSkeleton::cSkeleton(bool IsWither) :
super("Skeleton", mtSkeleton, "entity.skeleton.hurt", "entity.skeleton.death", 0.6, 1.8),
m_bIsWither(IsWither)
{
- SetBurnsInDaylight(true);
}
diff --git a/src/Mobs/Zombie.cpp b/src/Mobs/Zombie.cpp
index 882e98bf1..511efb1af 100644
--- a/src/Mobs/Zombie.cpp
+++ b/src/Mobs/Zombie.cpp
@@ -14,7 +14,6 @@ cZombie::cZombie(bool a_IsVillagerZombie) :
m_IsVillagerZombie(a_IsVillagerZombie),
m_IsConverting(false)
{
- SetBurnsInDaylight(true);
}
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[]