Finally bots can die. Player to. And another fixes.
This commit is contained in:
@ -204,18 +204,20 @@ public class NPC : Agent, ICharacter
|
||||
_condition.GiveHealth(-Mathf.RoundToInt(damage * (1 - _condition.ArmourPoints * 0.5f)));
|
||||
_condition.GiveArmour(-Mathf.RoundToInt(Mathf.Sqrt(damage) * 5));
|
||||
OnDamageReceived?.Invoke(damage, GetCharacter.Team);
|
||||
|
||||
if (_condition.HealthPoints < 0)
|
||||
if (_condition.HealthPoints < 1)
|
||||
{
|
||||
OnDeathEvent?.Invoke(true);
|
||||
MapManager.AddDeathAttributeToPoints(_moveController.PointStartID, _moveController.PointEndID,
|
||||
_moveController.DistanceToGo, _moveController.RemainingDistance);
|
||||
var pos = gameObject.transform.position;
|
||||
var id = _moveController.PointStartID;
|
||||
CharacterFactory.Instance.ReSpawn(this, ref pos, ref id);
|
||||
Die();
|
||||
}
|
||||
}
|
||||
|
||||
private void Die()
|
||||
{
|
||||
OnDeathEvent?.Invoke(true);
|
||||
MapManager.AddDeathAttributeToPoints(_moveController.PointStartID, _moveController.PointEndID,
|
||||
_moveController.DistanceToGo, _moveController.RemainingDistance);
|
||||
CharacterFactory.Instance.ReSpawn(this, gameObject);
|
||||
}
|
||||
|
||||
public void ResetCharacter()
|
||||
{
|
||||
_condition.Reset();
|
||||
|
Reference in New Issue
Block a user