Ejemplo n.º 1
0
 /// <summary>
 /// Take the given damage from the given attacker.
 /// This Character will loose life and get stunned or dies if
 /// criteria is met.
 /// @TODO Rework this into using a damage object instead.</summary>
 public void TakeDamage(float damage, Character attacker)
 {
     AddEnemy(attacker);
     Stats._currentLife -= (int)damage;
     if (IsDead)
     {
         attacker.OnKilledEnemy(this);
         ChangeState(_dyingState);
         OnDeath();
         return;
     }
     ChangeState(_attackState);
     OnTakeDamage();
 }