Beispiel #1
0
    public void DealDamage()
    {
        bool success = true;

        foreach (PlayerBehaviour player in targets)
        {
            if (player.Name == "Guerreiro" && player.State == PlayerBehaviour.STATE.SPECIAL)
            {
                WarriorBehaviour warrior = (WarriorBehaviour)player;
                warrior.FinishSpecial();
                // Stunning ogres is currently disabled
                //owner.State = EnemyBehaviour.STATE.FROZEN;
                success = false;
                break;
            }
        }
        if (success)
        {
            foreach (PlayerBehaviour player in targets)
            {
                player.TakeDamage(owner.AttackValue);
            }
        }
        owner.AttackObject = null;
        GameObject.Destroy(gameObject);
    }
Beispiel #2
0
 private void OnTriggerEnter2D(Collider2D coll)
 {
     if (coll.gameObject.tag == "Player")
     {
         PlayerBehaviour player = coll.GetComponent <PlayerBehaviour>();
         if (player.Name == "Guerreiro" && player.State == PlayerBehaviour.STATE.SPECIAL)
         {
             WarriorBehaviour warrior = (WarriorBehaviour)player;
             warrior.FinishSpecial();
             // Stunning ogres is currently disabled
             //owner.State = EnemyBehaviour.STATE.FROZEN;
             if (!piercing)
             {
                 owner.AttackObject = null;
                 GameObject.Destroy(gameObject);
             }
         }
         else
         {
             player.TakeDamage(owner.AttackValue);
         }
     }
 }