Esempio n. 1
0
 private void Awake()
 {
     instance = this;
     gameObject.SetActive(false);
     messageQueue = new Queue <string>();
     colorQueue   = new Queue <Color>();
     text         = GetComponent <Text>();
 }
Esempio n. 2
0
 public void AddInventory(EquipmentWrapper e)
 {
     inventory.Add(e);
     strength--;
     agility--;
     constitution--;
     intelligence--;
     if (this == GameState.State.player)
     {
         FlashText.Flash("All Stats: -1", Color.red);
     }
 }
Esempio n. 3
0
 private void HandleFlash()
 {
     if (FlashText.Equals("\u26A1 Off"))
     {
         FlashText = "\u26A1 On";
         IsTorchOn = true;
     }
     else
     {
         FlashText = "\u26A1 Off";
         IsTorchOn = false;
     }
 }
Esempio n. 4
0
 public void RemoveInventory(EquipmentWrapper e)
 {
     if (inventory.Remove(e))
     {
         strength++;
         agility++;
         constitution++;
         intelligence++;
         if (this == GameState.State.player)
         {
             FlashText.Flash("All Stats: +1", Color.green);
         }
     }
 }
Esempio n. 5
0
    IEnumerator BattleStart()
    {
        yield return(new WaitForSeconds(0.1f));

        RefreshStatus(true);
        FlashText.Flash("Fight!", Color.red);
        AudioPlayer.PlayFight();
        yield return(new WaitForSeconds(0.1f));

        battleUI.SetActive(true);
        GameState.State.tournament.gameObject.SetActive(false);
        SwapPopup.Close();
        Inventory.Close();
        Shop.Close();
    }
Esempio n. 6
0
 void SetPlayerAction(EquipmentWrapper e, Equipment.Ability action)
 {
     if (e == null && action == null)
     {
         Inventory.Show(player);
     }
     else
     {
         playerCards.Clear();
         Equipment.Ability playerAction;
         bool remove = false;
         if (action != null)
         {
             playerAction = action;
         }
         else
         {
             remove = !e.NextAction(out playerAction);
         }
         Equipment.Ability enemyAction;
         var ee = enemy.GetAbility(out enemyAction);
         FlashText.Flash(enemyAction.name + "\n\n\n\n" + playerAction.name, Color.white);
         HandleAction(player, enemy, ref playerAction, ref enemyAction, playerAnimation, enemyAnimation);
         HandleAction(enemy, player, ref enemyAction, ref playerAction, enemyAnimation, playerAnimation);
         if (remove)
         {
             FlashText.Flash("Your " + e.equipment.name.ToLower() + " broke!", Color.red);
             player.RemoveEquipment(e);
         }
         if (ee != null)
         {
             enemy.RemoveEquipment(ee);
         }
         if (player.health <= 0 && enemy.health >= player.health)
         {
             StartCoroutine(BattleOver(player));
             return;
         }
         else if (enemy.health <= 0 && player.health > enemy.health)
         {
             StartCoroutine(BattleOver(enemy));
             return;
         }
         reward += 3;
         StartCoroutine(DelayedNextTurn());
     }
 }
Esempio n. 7
0
 public void displayMultiKillGraphic()
 {
     flashText = FindObjectOfType <FlashText> ();
     if (zombiesKilledOnServe == 2)
     {
         flashText.flashDoubleKill();
         AddPoints(200);
         //Debug.Log("DOUBLE KILL");
     }
     else if (zombiesKilledOnServe == 3)
     {
         flashText.flashTripleKill();
         AddPoints(300);
         //Debug.Log("TRIPLE KILL");
     }
     else if (zombiesKilledOnServe == 4)
     {
         flashText.flashQuadroupleKill();
         AddPoints(400);
         //Debug.Log("QUADROUPLE KILL");
     }
 }
Esempio n. 8
0
    void DoDamage(CharacterWrapper c, float amount)
    {
        int rnd = Random.Range(0, c.equipment.Count);

        for (int i = 0; i < c.equipment.Count; i++)
        {
            var e = c.equipment[(rnd + i) % c.equipment.Count];
            if (e.equipment.type == Equipment.Type.armor)
            {
                c.health     -= Mathf.RoundToInt(amount * 0.5f);
                e.durability -= Mathf.RoundToInt(amount * 0.3f);
                if (e.durability <= 0)
                {
                    c.RemoveEquipment(e);
                    if (c == player)
                    {
                        FlashText.Flash("Your " + e.equipment.name.ToLower() + " broke!", Color.red);
                    }
                }
                return;
            }
        }
        c.health -= Mathf.RoundToInt(amount);
    }