Пример #1
0
 void StartRound()
 {
     battle.NextPhase();
     if (battle.phase == 3)
     {
         Deactivate();
         gameTurn.EndTurn();
     }
     else
     {
         battlePredictions = new BattlePredictions(battle.GetAttacker().GetCurrentStats(), battle.GetDefender().GetCurrentStats());
         if (battle.away is Player)
         {
         }
         else
         {
             if (battle.attacking)
             {
                 battle.SetDefensiveAction((Battle.Action)Mathf.Floor(UnityEngine.Random.value * 3) + 4);
             }
             else
             {
                 battle.SetOffensiveAction((Battle.Action)Mathf.Floor(UnityEngine.Random.value * 3));
             }
         }
         SetupButtons();
     }
 }
Пример #2
0
 public void Deactivate()
 {
     if (active)
     {
         thisObj.SetActive(false);
         defend.onClick.RemoveAllListeners();
         counter.onClick.RemoveAllListeners();
         magicDefend.onClick.RemoveAllListeners();
         surrender.onClick.RemoveAllListeners();
         attack.onClick.RemoveAllListeners();
         empoweredAttack.onClick.RemoveAllListeners();
         magic.onClick.RemoveAllListeners();
         item.onClick.RemoveAllListeners();
         offenseOptions.SetActive(false);
         defenseOptions.SetActive(false);
         offenseOptions.transform.position = homeButtons;
         defenseOptions.transform.position = awayButtons;
         battlePredictions = null;
         stats.SetActive(false);
         battle = null;
         battleAnimations.Deactivate();
         active = false;
     }
 }