IEnumerator DoT(float ammount, int time, IEffectable target, SOEffect effect) { if (ammount != 0) { bool isHeal = (effect.ID == CONSTANTS.EFFECT_REGEN || effect.ID == CONSTANTS.EFFECT_HEAL); for (int i = 0; i < time; i++) { if (!target.AffectedBy(effect)) { // perhaps they got cured break; } if (isHeal) { // hurting target.Heal(ammount); } else { // healing target.Harm(ammount); } yield return(new WaitForSeconds(1)); } target.RemoveEffect(effect); } }
public bool HealEntity(IEffectable toHeal, float potency) { float value = 20; SOEffect thisEffect = SOEffect.GetByID(CONSTANTS.EFFECT_HEAL); if (applyAffect(thisEffect, toHeal)) { toHeal.Heal(value * potency); } toHeal.RemoveEffect(thisEffect); return(true); }