Exemplo n.º 1
0
 public void Damage(int damage)
 {
     damage = _logic.OnDamage(damage);
     Health = Math.Max(0, Health - damage);
     if (!IsAlive())
     {
         _state = State.Die;
     }
 }
Exemplo n.º 2
0
 public void Damage(int damage)
 {
     for (int i = 0; i < Buffs.Count; i++)
     {
         damage = Buffs[i].OnDamage(damage);
     }
     damage = _logic.OnDamage(damage);
     Health = Math.Max(0, Health - damage);
     if (!IsAlive())
     {
         _state = State.Die;
     }
 }
Exemplo n.º 3
0
        public void Damage(int damage)
        {
            damage = _logic.OnDamage(damage);
            Health = Math.Max(0, Health - damage);

            if (IsStunned() && damage >= _removeStunDamage)
            {
                RemoveStun();
            }

            if (!IsAlive())
            {
                _state = State.Die;
                _logic.OnDie();
            }
        }