summaryrefslogtreecommitdiffstats
path: root/src/Entities/Pawn.cpp
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-06-09 06:51:55 +0200
committerarchshift <admin@archshift.com>2014-06-17 20:39:21 +0200
commit814cdca054bec5826b491f6d9d9867ce587d2def (patch)
treef5c452b3433955cf376c1c19a72f242c36ebe688 /src/Entities/Pawn.cpp
parentMonster: added IsUndead(), undead-specific entity effects (diff)
downloadcuberite-814cdca054bec5826b491f6d9d9867ce587d2def.tar
cuberite-814cdca054bec5826b491f6d9d9867ce587d2def.tar.gz
cuberite-814cdca054bec5826b491f6d9d9867ce587d2def.tar.bz2
cuberite-814cdca054bec5826b491f6d9d9867ce587d2def.tar.lz
cuberite-814cdca054bec5826b491f6d9d9867ce587d2def.tar.xz
cuberite-814cdca054bec5826b491f6d9d9867ce587d2def.tar.zst
cuberite-814cdca054bec5826b491f6d9d9867ce587d2def.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Pawn.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index fee595e54..51ffc46b2 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -154,7 +154,7 @@ void cPawn::HandleEntityEffects(cEntityEffect::eType a_EffectType, cEntityEffect
}
case cEntityEffect::effPoison:
{
- // Poison frequency = 25 ticks, divided by potion level (Poison II = 25 ticks)
+ // Poison frequency = 25 ticks, divided by potion level (Poison II = 12 ticks)
int frequency = std::floor(25.0 / (double)(a_Effect.GetIntensity() + 1));
static short counter = 0;
@@ -170,6 +170,20 @@ void cPawn::HandleEntityEffects(cEntityEffect::eType a_EffectType, cEntityEffect
return;
}
+ case cEntityEffect::effWither:
+ {
+ // Poison frequency = 40 ticks, divided by effect level (Wither II = 20 ticks)
+ int frequency = std::floor(25.0 / (double)(a_Effect.GetIntensity() + 1));
+
+ static short counter = 0;
+ if (++counter >= frequency)
+ {
+ TakeDamage(dtWither, a_Effect.GetUser(), 1, 0);
+ counter = 0;
+ }
+ //TODO: "<Player> withered away>
+ return;
+ }
case cEntityEffect::effFireResistance:
{
// TODO: Implement me!