/// <summary> /// Apply a addition to an actor /// </summary> /// <param name="actor">Actor which the addition should be applied to</param> /// <param name="addition">Addition to be applied</param> public static void ApplyAddition(Actor actor, Addition addition) { if (actor.BattleStatus.Additions.ContainsKey(addition.Name)) { Addition oldaddition = actor.BattleStatus.Additions[addition.Name]; if (oldaddition.Activated) { oldaddition.AdditionEnd(); } if (addition.IfActivate) { addition.AdditionStart(); addition.StartTime = DateTime.Now; addition.Activated = true; } actor.BattleStatus.Additions.Remove(addition.Name); actor.BattleStatus.Additions.Add(addition.Name, addition); } else { if (addition.IfActivate) { addition.AdditionStart(); addition.StartTime = DateTime.Now; addition.Activated = true; } actor.BattleStatus.Additions.Add(addition.Name, addition); } }
/// <summary> /// Apply a addition to an actor /// </summary> /// <param name="actor">Actor which the addition should be applied to</param> /// <param name="addition">Addition to be applied</param> public static void ApplyAddition(Actor actor, Addition addition) { if (actor.BattleStatus.Additions.ContainsKey(addition.Name)) { Addition oldaddition = actor.BattleStatus.Additions[addition.Name]; if (oldaddition.Activated) oldaddition.AdditionEnd(); if (addition.IfActivate) { addition.AdditionStart(); addition.StartTime = DateTime.Now; addition.Activated = true; } actor.BattleStatus.Additions.Remove(addition.Name); actor.BattleStatus.Additions.Add(addition.Name, addition); } else { if (addition.IfActivate) { addition.AdditionStart(); addition.StartTime = DateTime.Now; addition.Activated = true; } actor.BattleStatus.Additions.Add(addition.Name, addition); } }