summaryrefslogtreecommitdiffstats
path: root/src/Entities/Pawn.cpp
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-06-08 06:56:01 +0200
committerarchshift <admin@archshift.com>2014-06-17 20:39:20 +0200
commit58f35af6e71f11844b9c6c1d1ebd2d7390439cca (patch)
treeba93d854c83bebfc32f691be795564c975a734cc /src/Entities/Pawn.cpp
parentEntity: only fire critical hit if damage type is physical (diff)
downloadcuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.tar
cuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.tar.gz
cuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.tar.bz2
cuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.tar.lz
cuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.tar.xz
cuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.tar.zst
cuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Pawn.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index 5cf270006..5cd493a06 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -69,7 +69,8 @@ void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect a_E
}
m_EntityEffects[a_EffectType] = a_Effect;
- m_World->BroadcastEntityEffect(*this, a_EffectType, a_Effect.GetIntensity(), a_Effect.m_Ticks);
+ m_World->BroadcastEntityEffect(*this, a_EffectType, a_Effect.GetIntensity(),
+ a_Effect.m_Ticks * a_Effect.GetDistanceModifier());
}
@@ -114,7 +115,7 @@ void cPawn::HandleEntityEffects(cEntityEffect::eType a_EffectType, cEntityEffect
case cEntityEffect::efInstantHealth:
{
// Base heal = 6, doubles for every increase in intensity
- Heal(6 * std::pow(2, a_Effect.GetIntensity()));
+ Heal(6 * std::pow(2, a_Effect.GetIntensity()) * a_Effect.GetDistanceModifier());
// TODO: Harms undead
return;
@@ -123,7 +124,7 @@ void cPawn::HandleEntityEffects(cEntityEffect::eType a_EffectType, cEntityEffect
{
// Base damage = 6, doubles for every increase in intensity
int damage = 6 * std::pow(2, a_Effect.GetIntensity());
- TakeDamage(dtPotionOfHarming, a_Effect.GetUser(), damage, 0);
+ TakeDamage(dtPotionOfHarming, a_Effect.GetUser(), damage * a_Effect.GetDistanceModifier(), 0);
// TODO: Heals undead
return;