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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user