public override void ApplyPerTurnEffects() { foreach (Effect.Effect effect in Effects) { if (effect.PerTurn) { effect.ApplyTo(ModifiedAttributes, BaseAttributes); } if (effect is Effect.ValueEffect) { Effect.ValueEffect valueEffect = (effect as Effect.ValueEffect); if (valueEffect.EffectType == Types.Effect.FastHealing) { int currentHP = GetCurrentHitPoints(); int maxHP = GetEffectiveAttributes().HitPoints; if (currentHP < maxHP) { int damage = maxHP - currentHP; if (damage < valueEffect.Value) { AddHitPointChange(new Heal(damage)); } else { AddHitPointChange(new Heal(valueEffect.Value)); } } } } } }
public override void StartEncounter() { base.StartEncounter(); Effect.TimedEffect flatFooted = new Effect.TimedEffect(Types.Effect.FlatFooted, 1); Effects.Add(flatFooted); if (BaseAttributes.FastHealing > 0) { Effect.ValueEffect fastHealing = new Effect.ValueEffect(Types.Effect.FastHealing, BaseAttributes.FastHealing); Effects.Add(fastHealing); } }