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 KillEntity(IEffectable toKill, float noop) { SOEffect thisEffect = SOEffect.GetByID(CONSTANTS.EFFECT_DEATH); if (applyAffect(thisEffect, toKill)) { toKill.Harm(toKill.MaxHP); } toKill.RemoveEffect(thisEffect); return(true); }