Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medical - Add a per body part damage cap #10471

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
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
7 changes: 7 additions & 0 deletions addons/medical_damage/functions/fnc_woundsHandlerBase.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ private _bodyPartVisParams = [_unit, false, false, false, false]; // params arra
continue
};

// Check if current body part damage has reached the cap
if (_bodyPartDamage select _bodyPartNToAdd >= EGVAR(medical,partDamageCap)) then {
TRACE_1("damage cap reached for body part",_bodyPart);
continue // Skip further processing for this body part if cap is reached
};


// determine how many wounds to create
private _nWounds = [_damage, _thresholds, true] call FUNC(interpolatePoints);
if (_nWounds < 1) then {
Expand Down
9 changes: 9 additions & 0 deletions addons/medical_damage/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
true
] call CBA_fnc_addSetting;

[
QEGVAR(medical,partDamageCap),
"SLIDER",
[LSTRING(partDamageCap_DisplayName), LSTRING(partDamageCap_Description)],
ELSTRING(medical,Category),
[30, 150, 60, 0],
true
] call CBA_fnc_addSetting;

[
QEGVAR(medical,AIDamageThreshold),
"SLIDER",
Expand Down
6 changes: 6 additions & 0 deletions addons/medical_damage/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,12 @@
<Russian>Порог повреждения конечностей</Russian>
<Japanese>手足のダメージしきい値</Japanese>
</Key>
<Key ID="STR_ACE_Medical_Damage_partDamageCap_Description">
<English>Sets the amount of damage a body part can receive before preventing more wounds from occurring.</English>
</Key>
<Key ID="STR_ACE_Medical_Damage_partDamageCap_DisplayName">
<English>Body Part Damage Cap</English>
</Key>
<Key ID="STR_ACE_Medical_Damage_uselimbDamage_Description">
<English>Controls whether limb damage is taken into account for sum of trauma calculations.</English>
<Russian>Определяет, учитывается ли повреждение конечностей при расчете совокупности травм.</Russian>
Expand Down