private IEnumerator ApplyTimedProtection(Creature target, TimedProtectionContainer container) { TimedProtection protection = container.protection as TimedProtection; float startTime = Time.time + protection.timeToStart; float endTime = Time.time + protection.timeToStart + protection.duration; while (Time.time < startTime) { yield return(null); } protection.Perform(target); while (Time.time <= endTime) { endTime = startTime + container.timeToEnd; yield return(null); } protection.UnregisterEffect(target); }
public override void ResolveReduplication(Creature target, Performable performable) { TimedProtection tp = performable as TimedProtection; this.timeToEnd += tp.duration; }