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

@@ -152,6 +152,13 @@ namespace Content.Server.Body
[ViewVariables]
public IReadOnlyCollection<IMechanism> Mechanisms => _mechanisms;
/// <summary>
/// Represents if body part is vital for creature.
/// If the last vital body part is removed creature dies
/// </summary>
[ViewVariables]
public bool IsVital { get; private set; }
/// <summary>
/// This method is called by
/// <see cref="IBodyManagerComponent.PreMetabolism"/> before
@@ -451,6 +458,7 @@ namespace Content.Server.Body
RSIPath = data.RSIPath;
RSIState = data.RSIState;
MaxDurability = data.Durability;
IsVital = data.IsVital;
if (!prototypeManager.TryIndex(data.DamageContainerPresetId,
out DamageContainerPrototype damageContainerData))