/// <summary> /// Returns null if no effect with the given conf is found in the active effects. /// Returns the matching effect otherwise. /// </summary> internal EffectOverTime GetEffectOfType(EffectOverTimeConf a_effectConf) { foreach (EffectOverTime each in _effects) { if (each.conf == a_effectConf) { return(each); } } return(null); }
internal virtual EffectOverTimeReport Destroy() { EffectOverTimeInfos effectInfos = new EffectOverTimeInfos(); effectInfos.effectOverTime = this; effectInfos.trigger = EEffectOverTimeTrigger.Destroy; List <AEffectReport> effectsReport = new List <AEffectReport>(); foreach (EffectWrapper each in effects) { if (each.isRevertOnDestroy) { effectInfos.doesStack = each.doesStack; effectInfos.perStackModifier = each.perStackModifier; effectInfos.isRevertOnDestroy = each.isRevertOnDestroy; each.effect.effectInfos = effectInfos; effectsReport.Add(each.effect.Revert(target)); } } EffectOverTimeReport report = new EffectOverTimeReport(); report.effectInfos = effectInfos; report.target = target; report.attackInfos = attackInfos; report.effects = effectsReport; report.effect = conf; report.trigger = EEffectOverTimeTrigger.Destroy; attackInfos = null; target = null; conf = null; return(report); }