Exemple #1
0
    // Use this for initialization
    void Start()
    {
        // References:
        player = FindObjectOfType <V_PlayerHandler>();
        ai     = FindObjectOfType <V_AI> ();

        // Initializations:
        initPos = container.localPosition;
    }
 // This is called by the AI:
 public void AI_AttackEnemyPlayer()
 {
     if (aiCurSelected != null)
     {
         // if the card is usable to enemy bases then attack...
         if (aiCurSelected.canBeUsedTo == V_Card.usage.All || aiCurSelected.canBeUsedTo == V_Card.usage.BaseOnly)
         {
             AttackPlayer(aiCurSelected, playerTypes.Player);
             aiCurSelected = null;
             // ...else, restart the action:
         }
         else
         {
             V_AI ai = GameObject.Find("_AI").GetComponent <V_AI> ();
             ai.AITurn();
         }
     }
 }
Exemple #3
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++;
 }
 /// <summary>
 /// Add increase the energy of the AI!
 /// </summary>
 /// <param name="value">Value.</param>
 public static void EffectAddEnergy(int value)
 {
     V_AI.EffectAddEnergy(value);
 }
 /// <summary>
 /// Heal the AI...
 /// </summary>
 /// <param name="value">Value.</param>
 public static void EffectHeal(int value)
 {
     V_AI.EffectHeal(value, shealEffect.gameObject, aiAvatarZone.transform);
 }
 /// <summary>
 /// Send damage to the AI!
 /// </summary>
 /// <param name="value">Value.</param>
 public static void EffectDamage(int value)
 {
     V_AI.EffectDamage(value, sdamageEffect.gameObject, aiAvatarZone.transform);
 }