Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ modded class SCR_CharacterDamageManagerComponent : SCR_DamageManagerComponent
m_ACE_Medical_LastStruckPhysicalHitZone = struckPhysicalHitZone;
}

//-----------------------------------------------------------------------------------------------------------
override void Kill(notnull Instigator instigator)
{
if (s_ACE_Medical_Core_Settings.m_bPlayerCannotDie)
{
SCR_ECharacterControlType controlType = SCR_CharacterHelper.GetCharacterControlType(GetOwner());
if (controlType != SCR_ECharacterControlType.AI && controlType != SCR_ECharacterControlType.POSSESSED_AI)
return;
}

super.Kill(instigator);
}

//-----------------------------------------------------------------------------------------------------------
protected override void OnDamageStateChanged(EDamageState newState, EDamageState previousDamageState, bool isJIP)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ class ACE_Medical_Core_Settings : ACE_ModSettings

[Attribute(defvalue: "0.33", desc: "Can only apply epinephrine when patient has at least this health (ignored in advanced medication).", uiwidget: UIWidgets.Slider, params: "0 1")]
float m_fMinHealthScaledForEpinephrine;

[Attribute(defvalue: "false", desc: "Whether players can never die")]
bool m_bPlayerCannotDie;
}
2 changes: 2 additions & 0 deletions docs/src/content/docs/components/medical.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Summary of settings that can be modified in the server config:
| `m_fDefaultResilienceRegenScale` | Type: `float`**<br />Range: 0 to ∞<br />Default: `0.3` | Default resilience regeneration scale. The default regeneration rate (5 HP/s) will be multiplied by this factor. |
| `m_fResilienceDamageScale` | Type: `float`**<br />Range: 0 to ∞<br />Default: `1.0` | Resilience damage scale. All incoming damage to the resilience hitzone will be multiplied by this factor. Lower values make characters less likely to fall unconscious. |
| `m_fMinHealthScaledForEpinephrine` | Type: `float`**<br />Range: 0 to 1<br />Default: `0.33` | Can only apply epinephrine when patient has at least this health (ignored in advanced medication). |
| `m_bPlayerCannotDie` | Type: `bool`*<br />Default: `false` | Whether players can never die |
| `m_bBleedOutForPlayersEnabled` | Type: `bool`*<br />Default: `true` | Whether players can bleed out |
| `m_fBleedingRateScale` | Type: `float`**<br />Default: `1.0` | Character bleeding rate multiplier |
| `m_fMaxTotalBleedingRate` | Type: `float`**<br />Default: `-1.0` | Maximum possibe bleeding rate in ml/s (Negative value means unlimited) |
Expand Down Expand Up @@ -97,6 +98,7 @@ Template for the `missionHeader` in a server config:
"m_fDefaultResilienceRegenScale": 0.3,
"m_fResilienceDamageScale": 1.0,
"m_fMinHealthScaledForEpinephrine": 0.33,
"m_bPlayerCannotDie": 0,
"m_bBleedOutForPlayersEnabled": 1,
"m_fBleedingRateScale": 1.0,
"m_fMaxTotalBleedingRate": -1.0,
Expand Down