Exemple #1
0
 /// <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);
     }
 }
Exemple #2
0
 public static void RemoveAddition(Actor actor, Addition addition, bool removeOnly)
 {
     if (actor.BattleStatus.Additions.ContainsKey(addition.Name))
     {
         actor.BattleStatus.Additions.Remove(addition.Name);
         if (addition.Activated && !removeOnly)
         {
             addition.AdditionEnd();
         }
         addition.Activated = false;
     }
 }
Exemple #3
0
 public static void RemoveAddition(Actor actor, Addition addition, bool removeOnly)
 {
     if (actor.BattleStatus.Additions.ContainsKey(addition.Name))
     {
         actor.BattleStatus.Additions.Remove(addition.Name);
         if (addition.Activated && !removeOnly)
         {
             addition.AdditionEnd();
         }
         addition.Activated = false;
     }
 }