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

Pharma - Add EACA clear trauma setting #515

Merged
Merged
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
9 changes: 9 additions & 0 deletions addons/pharma/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,15 @@ PREP_RECOMPILE_END;
true
] call CBA_Settings_fnc_init;

[
QGVAR(eacaClearTrauma),
"CHECKBOX",
[LLSTRING(SETTING_EACA_Trauma), LLSTRING(SETTING_EACA_Trauma_DESC)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_EACA)],
[false],
true
] call CBA_Settings_fnc_init;

//Ketamine Settings Category
[
QGVAR(medLvl_Ketamine),
Expand Down
22 changes: 12 additions & 10 deletions addons/pharma/functions/fnc_treatmentAdvanced_EACALocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,19 @@ if (_IVactual > 1) then {
_bandagedWounds set [_targetBodyPart, _bandagedWoundsOnPart];

_patient setVariable [VAR_BANDAGED_WOUNDS, _bandagedWounds, true];

private _partIndex = ALL_BODY_PARTS find _targetBodyPart;
private _bodyPartDamage = _patient getVariable [QACEGVAR(medical,bodyPartDamage), []];
private _damage = (_bodyPartDamage select _partIndex) - (_damageOf * _amountOf);
if (_damage < 0.05) then {
_bodyPartDamage set [_partIndex, 0];
} else {
_bodyPartDamage set [_partIndex, _damage];
};
_patient setVariable [QACEGVAR(medical,bodyPartDamage), _bodyPartDamage, true];

if (GVAR(eacaClearTrauma)) then {
private _partIndex = ALL_BODY_PARTS find _targetBodyPart;
private _bodyPartDamage = _patient getVariable [QACEGVAR(medical,bodyPartDamage), []];
private _damage = (_bodyPartDamage select _partIndex) - (_damageOf * _amountOf);
if (_damage < 0.05) then {
_bodyPartDamage set [_partIndex, 0];
} else {
_bodyPartDamage set [_partIndex, _damage];
};
_patient setVariable [QACEGVAR(medical,bodyPartDamage), _bodyPartDamage, true];
};

_exit = false;
};
} forEach ALL_BODY_PARTS_PRIORITY;
Expand Down
6 changes: 6 additions & 0 deletions addons/pharma/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3217,5 +3217,11 @@
<Finnish>Salli tiettyjen lääkkeiden muuttaa kestävyyttä (vanilja/edistynyt väsymys) sivuvaikutuksena</Finnish>
<Russian>Позволяют определенным лекарствам изменять выносливость (ваниль/повышенная утомляемость) в качестве побочного эффекта</Russian>
</Key>
<Key ID="STR_KAT_Pharma_SETTING_EACA_Trauma">
<English>EACA Clears Trauma</English>
</Key>
<Key ID="STR_KAT_Pharma_SETTING_EACA_Trauma_Desc">
<English>Allows Trauma to be cleared by EACA in addition to stitching</English>
</Key>
</Package>
</Project>
Loading