Feature/1754 kill player on body parts missing (#2014)

* Moved the uplink creation code to the PresetSuspicion.Start method to ensure uplink created when we give the traitor role
Moved the starting TC balance to cvars

* Added isVital flag for body parts
Automatically killing creature if last vital body part removed
Marked head as vital part
This commit is contained in:
creadth
2020-09-03 21:35:39 +03:00
committed by GitHub
parent 5f79d3e31d
commit b8bf100277
7 changed files with 50 additions and 38 deletions

View File

@@ -367,17 +367,20 @@ namespace Content.Shared.GameObjects.Components.Damage
protected virtual void OnHealthChanged(HealthChangedEventArgs e)
{
if (DeadThreshold != -1 && TotalDamage > DeadThreshold)
if (CurrentDamageState != DamageState.Dead)
{
CurrentDamageState = DamageState.Dead;
}
else if (CriticalThreshold != -1 && TotalDamage > CriticalThreshold)
{
CurrentDamageState = DamageState.Critical;
}
else
{
CurrentDamageState = DamageState.Alive;
if (DeadThreshold != -1 && TotalDamage > DeadThreshold)
{
CurrentDamageState = DamageState.Dead;
}
else if (CriticalThreshold != -1 && TotalDamage > CriticalThreshold)
{
CurrentDamageState = DamageState.Critical;
}
else
{
CurrentDamageState = DamageState.Alive;
}
}
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, e);