Exemple #1
0
 public void DeathUpdate(MonsterBody mb)
 {
     text.gameObject.SetActive(true);
     monsters.Remove(mb);
     text.text = mb.monster_name + " has been eliminated! " + lose_phrases[Random.Range(0, lose_phrases.Count)];
     if (monsters.Count == 1)
     {
         Win(mb);
     }
     else if (monsters.Count == 0)
     {
         Draw();
     }
 }
Exemple #2
0
    // Start is called before the first frame update
    void Start()
    {
        MonsterBody mb = GetComponent <MonsterBody>();

        cost += mb.health;
        cost += mb.armor;
        cost += mb.move_speed / 2;

        cost += GetComponentsInChildren <Gun>().Length *GUN_COST;
        cost += GetComponentsInChildren <Shield>().Length *SHIELD_COST;
        cost += GetComponentsInChildren <Sword>().Length *SWORD_COST;

        if (cost > cost_limit)
        {
            print("TOO COSTLY");
            Destroy(gameObject);
        }
    }
Exemple #3
0
 public void Win(MonsterBody mb)
 {
     rematch.gameObject.SetActive(true);
     text.text = mb.monster_name + " wins! " + win_phrases[Random.Range(0, win_phrases.Count)];
 }