summaryrefslogtreecommitdiffstats
path: root/src/Entities/Pawn.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-06-13 09:49:42 +0200
committerarchshift <admin@archshift.com>2014-06-17 20:39:21 +0200
commit045ae2ef2c0d72b4902fa5151aad095823da9300 (patch)
treeb07e3bb81f725b6546272c3d6d2d7edaec46299e /src/Entities/Pawn.cpp
parentPawn: renamed HandleEntityEffects to HandleEntityEffect (diff)
downloadcuberite-045ae2ef2c0d72b4902fa5151aad095823da9300.tar
cuberite-045ae2ef2c0d72b4902fa5151aad095823da9300.tar.gz
cuberite-045ae2ef2c0d72b4902fa5151aad095823da9300.tar.bz2
cuberite-045ae2ef2c0d72b4902fa5151aad095823da9300.tar.lz
cuberite-045ae2ef2c0d72b4902fa5151aad095823da9300.tar.xz
cuberite-045ae2ef2c0d72b4902fa5151aad095823da9300.tar.zst
cuberite-045ae2ef2c0d72b4902fa5151aad095823da9300.zip
Diffstat (limited to 'src/Entities/Pawn.cpp')
-rw-r--r--src/Entities/Pawn.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index 67b6fe4db..186e7df2a 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -114,14 +114,14 @@ void cPawn::HandleEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect
case cEntityEffect::effInstantHealth:
{
// Base heal = 6, doubles for every increase in intensity
- Heal(6 * std::pow(2, a_Effect.GetIntensity()) * a_Effect.GetDistanceModifier());
+ Heal((int)(6 * std::pow(2.0, a_Effect.GetIntensity()) * a_Effect.GetDistanceModifier()));
return;
}
case cEntityEffect::effInstantDamage:
{
// Base damage = 6, doubles for every increase in intensity
- int damage = 6 * std::pow(2, a_Effect.GetIntensity());
- TakeDamage(dtPotionOfHarming, a_Effect.GetUser(), damage * a_Effect.GetDistanceModifier(), 0);
+ int damage = (int)(6 * std::pow(2.0, a_Effect.GetIntensity()) * a_Effect.GetDistanceModifier());
+ TakeDamage(dtPotionOfHarming, a_Effect.GetUser(), damage, 0);
return;
}
case cEntityEffect::effStrength:
@@ -132,7 +132,7 @@ void cPawn::HandleEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect
case cEntityEffect::effWeakness:
{
// Damage reduction = 0.5 damage, multiplied by potion level (Weakness II = 1 damage)
- //double dmg_reduc = 0.5 * (a_Effect.GetIntensity() + 1);
+ // double dmg_reduc = 0.5 * (a_Effect.GetIntensity() + 1);
// TODO: Implement me!
// TODO: Weakened villager zombies can be turned back to villagers with the god apple
@@ -143,6 +143,7 @@ void cPawn::HandleEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect
// Regen frequency = 50 ticks, divided by potion level (Regen II = 25 ticks)
int frequency = std::floor(50.0 / (double)(a_Effect.GetIntensity() + 1));
+ // TODO: The counter needs to be specific to one cPawn, make it a member variable.
static short counter = 0;
if (++counter >= frequency)
{
@@ -157,6 +158,7 @@ void cPawn::HandleEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect
// Poison frequency = 25 ticks, divided by potion level (Poison II = 12 ticks)
int frequency = std::floor(25.0 / (double)(a_Effect.GetIntensity() + 1));
+ // TODO: The counter needs to be specific to one cPawn, make it a member variable.
static short counter = 0;
if (++counter >= frequency)
{
@@ -175,6 +177,7 @@ void cPawn::HandleEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect
// Poison frequency = 40 ticks, divided by effect level (Wither II = 20 ticks)
int frequency = std::floor(25.0 / (double)(a_Effect.GetIntensity() + 1));
+ // TODO: The counter needs to be specific to one cPawn, make it a member variable.
static short counter = 0;
if (++counter >= frequency)
{