Exemplo n.º 1
0
 // This is called when a player hits the "End Turn" button:
 public static void ChangeTurn(playerTypes type)
 {
     if (type == playerTypes.AI)
     {
         if (allowIncreasingEnergy)
         {
             V_PlayerHandler.AddEnergy(iEnergy);
         }
         // Draw 1 free card if Hand Zone is'nt full:
         if (handZone.transform.childCount < 4)
         {
             V_PlayerHandler player = GameObject.FindGameObjectWithTag("PlayerHandler").GetComponent <V_PlayerHandler> ();
             player.DrawOneCard();
         }
         //
         allowIncreasingEnergy = true;
         playerTurn            = playerTypes.Us;
         V_GameManager gm = GameObject.FindGameObjectWithTag("GameController").GetComponent <V_GameManager> ();
         gm.endTurnBTN.SetActive(true);
         gm.DrawBTN.SetActive(true);
         GameObject[] obj = GameObject.FindGameObjectsWithTag("PlayerOwned");
         foreach (GameObject o in obj)
         {
             o.GetComponent <V_CardActions> ().isUsed = false;
         }
     }
     else if (type == playerTypes.Us)
     {
         if (allowIncreasingEnergy)
         {
             V_AI.EffectAddEnergy(iEnergy);
         }
         allowIncreasingEnergy = true;
         playerTurn            = playerTypes.AI;
         GameObject[] obj = GameObject.FindGameObjectsWithTag("AIOwned");
         foreach (GameObject o in obj)
         {
             o.GetComponent <V_CardActions> ().isUsed = false;
         }
     }
     turn++;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Add increase the energy of the AI!
 /// </summary>
 /// <param name="value">Value.</param>
 public static void EffectAddEnergy(int value)
 {
     V_AI.EffectAddEnergy(value);
 }