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 Damage - Add setting for unconscious chance from pain #8092

Merged
merged 6 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -32,6 +32,6 @@ _bodyPartDamage params ["_headDamage", "_bodyDamage", "_leftArmDamage", "_rightA

private _damageThreshold = GET_DAMAGE_THRESHOLD(_unit);

if ((_headDamage > _damageThreshold / 2) || {_bodyDamage > _damageThreshold} || {(_painLevel >= PAIN_UNCONSCIOUS) && {random 1 < 0.1}}) then {
if ((_headDamage > _damageThreshold / 2) || {_bodyDamage > _damageThreshold} || {(_painLevel >= PAIN_UNCONSCIOUS) && {random 1 < EGVAR(medical,painUnconsciousChance)}}) then {
[QEGVAR(medical,CriticalInjury), _unit] call CBA_fnc_localEvent;
};
9 changes: 9 additions & 0 deletions addons/medical_damage/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,12 @@
[0, 25, 1, 2],
true
] call CBA_settings_fnc_init;

[
QEGVAR(medical,painUnconsciousChance),
"SLIDER",
[LSTRING(PainUnconsciousChance_DisplayName), LSTRING(PainUnconsciousChance_Description)],
ELSTRING(medical,Category),
[0, 1, 0.1, 2, true],
true
] call CBA_settings_fnc_init;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CBA_settings_fnc_init should be replaced with CBA_fnc_addSetting here and above

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say do that in separate PR ACE-wide. All medical still uses the old function.

6 changes: 6 additions & 0 deletions addons/medical_damage/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -687,5 +687,11 @@
<Polish>Ustawia próg obrażeń jakie może otrzymać jednostka przed utratą przytomności. (0 jako ustawienie domyślne misji)</Polish>
<Turkish>Bilinçsiz duruma geçmeden önce bir birimin alabileceği hasar miktarını ayarlar. (Görev varsayılanı için 0)</Turkish>
</Key>
<Key ID="STR_ACE_Medical_Damage_PainUnconsciousChance_DisplayName">
<English>Pain Unconscious Chance</English>
Mike-MF marked this conversation as resolved.
Show resolved Hide resolved
</Key>
<Key ID="STR_ACE_Medical_Damage_PainUnconsciousChance_Description">
<English>The probability of a person falling unconscious when their pain is above the tolerance threshold.</English>
Mike-MF marked this conversation as resolved.
Show resolved Hide resolved
jonpas marked this conversation as resolved.
Show resolved Hide resolved
</Key>
</Package>
</Project>