summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorJaume Aloy <hircine45@gmail.com>2014-08-19 16:08:17 +0200
committerJaume Aloy <hircine45@gmail.com>2014-08-19 16:08:17 +0200
commit1897f678f93bb038fdc4caf1fb2995a28ef8f92e (patch)
tree08feb248f0a51b067fd61192ca10d3272dcd4d90 /src/Entities/Entity.cpp
parentAdded some Enchantments (diff)
downloadcuberite-1897f678f93bb038fdc4caf1fb2995a28ef8f92e.tar
cuberite-1897f678f93bb038fdc4caf1fb2995a28ef8f92e.tar.gz
cuberite-1897f678f93bb038fdc4caf1fb2995a28ef8f92e.tar.bz2
cuberite-1897f678f93bb038fdc4caf1fb2995a28ef8f92e.tar.lz
cuberite-1897f678f93bb038fdc4caf1fb2995a28ef8f92e.tar.xz
cuberite-1897f678f93bb038fdc4caf1fb2995a28ef8f92e.tar.zst
cuberite-1897f678f93bb038fdc4caf1fb2995a28ef8f92e.zip
Diffstat (limited to 'src/Entities/Entity.cpp')
-rw-r--r--src/Entities/Entity.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 398f7703b..05bad3a78 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -316,7 +316,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
// IsOnGround() only is false if the player is moving downwards
// TODO: Better damage increase, and check for enchantments (and use magic critical instead of plain)
-
+ // Thanks to daniel0916
cEnchantments Enchantments = Player->GetEquippedItem().m_Enchantments;
int SharpnessLevel = Enchantments.GetLevel(cEnchantments::enchSharpness);
@@ -372,8 +372,27 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
{
BurnTicks += 4 * (FireAspectLevel - 1);
}
+ if (!IsMob() && !IsSubmerged() && !IsSwimming())
+ {
+ StartBurning(BurnTicks * 20);
+ }
+ else if (IsMob() && !IsSubmerged() && !IsSwimming())
+ {
+ cMonster * Monster = (cMonster *)this;
+ switch (Monster->GetMobType())
+ {
+ case cMonster::mtGhast:
+ case cMonster::mtZombiePigman:
+ case cMonster::mtMagmaCube:
+ {
+
+ break;
+ };
+ default:StartBurning(BurnTicks * 20);
+ }
+ }
- StartBurning(BurnTicks * 20);
+
}
if (!Player->IsOnGround())
@@ -410,7 +429,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
case 2: AdditionalSpeed.Set(8, 0.3, 8); break;
default: break;
}
- AddSpeed(a_TDI.Knockback + AdditionalSpeed);
+ SetSpeed(a_TDI.Knockback + AdditionalSpeed);
}
m_World->BroadcastEntityStatus(*this, esGenericHurt);