コード例 #1
0
ファイル: SkillHandler.cs プロジェクト: xxlio109/Saga
 /// <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);
     }
 }
コード例 #2
0
ファイル: SkillHandler.cs プロジェクト: Willyham/SagaRO2
 /// <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);
     }
 }