Finally bots can die. Player to. And another fixes.

This commit is contained in:
2022-05-17 00:21:53 +07:00
parent 06fdfc077c
commit 229c4490c4
15 changed files with 160 additions and 171 deletions

View File

@ -27,8 +27,15 @@ public class Player : MonoBehaviour, ICharacter
Condition.GiveHealth(-Mathf.RoundToInt(damage * (1 - Condition.ArmourPoints * 0.5f)));
Condition.GiveArmour(-Mathf.RoundToInt(Mathf.Sqrt(damage) * 5));
if (Condition.HealthPoints < 0)
OnDeathEvent?.Invoke(true);
if (Condition.HealthPoints < 1)
Die();
}
private void Die()
{
print("dead");
OnDeathEvent?.Invoke(true);
CharacterFactory.Instance.ReSpawn(this, gameObject);
}
public void ResetCharacter()