From 73b8be0fef6603b5dd3a101c26a4947669068d5e Mon Sep 17 00:00:00 2001 From: bibo38 Date: Sat, 31 Oct 2015 16:24:45 +0100 Subject: Implemented the FireResistence potion effects. This not only provides fire resistence, but also prevents blaze fireballs. See #2556 --- src/Entities/Pawn.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/Entities/Pawn.cpp') diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp index 2cd0f2f0e..9045f8595 100644 --- a/src/Entities/Pawn.cpp +++ b/src/Entities/Pawn.cpp @@ -61,6 +61,15 @@ void cPawn::KilledBy(TakeDamageInfo & a_TDI) +bool cPawn::IsFireproof(void) const +{ + return super::IsFireproof() || HasEntityEffect(cEntityEffect::effFireResistance); +} + + + + + void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, int a_Duration, short a_Intensity, double a_DistanceModifier) { // Check if the plugins allow the addition: @@ -98,6 +107,15 @@ void cPawn::RemoveEntityEffect(cEntityEffect::eType a_EffectType) +bool cPawn::HasEntityEffect(cEntityEffect::eType a_EffectType) const +{ + return m_EntityEffects.find(a_EffectType) != m_EntityEffects.end(); +} + + + + + void cPawn::ClearEntityEffects() { // Iterate through this entity's applied effects -- cgit v1.2.3