Ejemplo n.º 1
0
 public void Activate()
 {
     if (IsReplacing)
     {
         gameManager.unitManager.player.SwapSkill(id, NewSkill);
         gameManager.EndReplacing();
     }
     else
     {
         if (isItem)
         {
             if (player.unitManager.Turn == UnitManager.Turns.Player)
             {
                 //Use item
                 player.UseItem(itemId);
             }
         }
         else
         {
             if (player.unitManager.Turn == UnitManager.Turns.Player && player.CheckCost(skillCost, costType))
             {
                 SkillStats skill = player.unitManager.GetSkill(itemId);
                 if (skill.SkillType == Constants.SkillTypes.Break)
                 {
                     if (player.GetStatus() != skill.StatusType)
                     {
                         return;
                     }
                 }
                 //Use skill
                 player.unitManager.PrepareSkill(skill);
             }
         }
     }
     UpdateDisplay();
 }