Skip to content

Commit

Permalink
Pharma - Improve - Coagulation improvements and a fix for phenyl auto…
Browse files Browse the repository at this point in the history
…injector (#575)

**When merged this pull request will:**
- increase the clotting cost and decrease factor effectiveness 
- Update the amount of default factors and the amount of factors to
remove per wound
- fix phenyl autoinjector saying "injecting morphine"

### IMPORTANT

- [Development Guidelines](https://ace3.acemod.org/wiki/development/)
are read, understood and applied.
- Title of this PR uses our standard template `Component -
Add|Fix|Improve|Change|Make|Remove {changes}`.
  • Loading branch information
Cplhardcore authored Aug 5, 2024
1 parent 866c6b2 commit 110ce9d
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 100 deletions.
1 change: 1 addition & 0 deletions addons/pharma/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class ACE_Medical_Treatment_Actions {
};
class PhenylephrineAuto: Morphine {
displayName = CSTRING(Take_Phenyl_Auto);
displayNameProgress = CSTRING(Using);
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
allowSelfTreatment = 1;
items[] = {"kat_phenylephrineAuto"};
Expand Down
4 changes: 2 additions & 2 deletions addons/pharma/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ PREP_RECOMPILE_END;
"SLIDER",
[LLSTRING(SETTING_Coagulation_FactorCount), LLSTRING(SETTING_Coagulation_FactorCount_DESC)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_Coagulation)],
[0, 100, 15, 0],
[0, 100, 30, 0],
true
] call CBA_Settings_fnc_init;

Expand All @@ -790,7 +790,7 @@ PREP_RECOMPILE_END;
"SLIDER",
[LLSTRING(SETTING_coagulation_Factor_Limit), LLSTRING(SETTING_coagulation_Factor_Limit_DESC)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_Coagulation)],
[1, 200, 30, 0],
[1, 200, 60, 0],
true
] call CBA_Settings_fnc_init;

Expand Down
8 changes: 4 additions & 4 deletions addons/pharma/functions/fnc_clotWound.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ private _fnc_clotWound = {
case "Medium": {
_woundClotTime = round ((random (_coagulation_time_medium / 2)) + _coagulation_time_medium / 2);
_bandageToUse = "BloodClotMedium";
_factorCountToRemove = 1.5;
_factorCountToRemove = 2;

if !(missionNamespace getVariable [QGVAR(coagulation_allow_MediumWounds), true]) then { continue; };
};
default {
_woundClotTime = round ((random (_coagulation_time_large / 2)) + _coagulation_time_large / 2);
_bandageToUse = "BloodClotLarge";
_factorCountToRemove = 2;
_factorCountToRemove = 4;

if !(missionNamespace getVariable [QGVAR(coagulation_allow_LargeWounds), true]) then { continue; };
};
Expand All @@ -76,7 +76,7 @@ private _fnc_clotWound = {
[{
params["_unit", "_bodyPart", "_selectionName", "_bandageToUse", "_logString", "_factorCountToRemove"];

private _coagulationFactor = _unit getVariable [QGVAR(coagulationFactor), 15];
private _coagulationFactor = _unit getVariable [QGVAR(coagulationFactor), 30];
private _openWounds = GET_OPEN_WOUNDS(_unit);
private _openWoundsOnPart = _openWounds getOrDefault [_bodyPart, []];
private _woundIndex = _openWoundsOnPart findIf {(_x select 1) > 0 && (_x select 2) > 0};
Expand Down Expand Up @@ -112,7 +112,7 @@ private _fnc_clotWound = {

private _openWounds = _unit getVariable [VAR_OPEN_WOUNDS, createHashmap];
private _pulse = _unit getVariable [VAR_HEART_RATE, 80];
private _coagulationFactor = _unit getVariable [QGVAR(coagulationFactor), 15];
private _coagulationFactor = _unit getVariable [QGVAR(coagulationFactor), 30];
private _countTXA = [_unit, "TXA"] call ACEFUNC(medical_status,getMedicationCount);
private _countEACA = [_unit, "EACA"] call ACEFUNC(medical_status,getMedicationCount);
private _hasWoundToBandageArray = [];
Expand Down
8 changes: 4 additions & 4 deletions addons/pharma/functions/fnc_coagRegen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ if !(GVAR(coagulation)) exitWith {};
if (_unit getVariable [QACEGVAR(medical,bloodVolume), 6.0] < GVAR(coagulation_requireBV)) exitWith {}; // Blood volume check
if ((_pulse < 20) && GVAR(coagulation_requireHR)) exitWith {}; // Has pulse & require setting

private _currentCoagFactors = _unit getVariable [QGVAR(coagulationFactor), 15];
private _savedCoagFactors = _unit getVariable [QGVAR(coagulationSavedFactors), (_unit getVariable [QGVAR(coagulationFactor), 15])];
private _limitRegenCoagFactors = missionNamespace getVariable [QGVAR(coagulation_factor_count), 15];
private _currentCoagFactors = _unit getVariable [QGVAR(coagulationFactor), 30];
private _savedCoagFactors = _unit getVariable [QGVAR(coagulationSavedFactors), (_unit getVariable [QGVAR(coagulationFactor), 30])];
private _limitRegenCoagFactors = missionNamespace getVariable [QGVAR(coagulation_factor_count), 30];
private _cooldownON = _unit getVariable [QGVAR(coagulationRegenCooldown), false];
private _countTXA = [_unit, "TXA"] call ACEFUNC(medical_status,getMedicationCount);
private _countEACA = [_unit, "EACA"] call ACEFUNC(medical_status,getMedicationCount);
Expand All @@ -47,7 +47,7 @@ if !(GVAR(coagulation)) exitWith {};
if (_currentCoagFactors < _savedCoagFactors) exitWith {
[{
params["_unit"];
_unit setVariable [QGVAR(coagulationSavedFactors), _unit getVariable [QGVAR(coagulationFactor), 15], true];
_unit setVariable [QGVAR(coagulationSavedFactors), _unit getVariable [QGVAR(coagulationFactor), 30], true];
},
[_unit], ((missionNamespace getVariable [QGVAR(coagulation_factor_regenerate_time), 150]) / 2)] call CBA_fnc_waitAndExecute; // Block regen PFH instance from happening
};
Expand Down
4 changes: 2 additions & 2 deletions addons/pharma/functions/fnc_fluidLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private _final = (_current + _ph) max 0;
_final min 1500;
_patient setVariable [QGVAR(pH), (_final), true];

private _coagFactorMax = missionNamespace getVariable [QGVAR(coagulation_factor_limit), 30];
private _factor = _patient getVariable [QGVAR(coagulationFactor), 10];
private _coagFactorMax = missionNamespace getVariable [QGVAR(coagulation_factor_limit), 60];
private _factor = _patient getVariable [QGVAR(coagulationFactor), 30];
private _final2 = (_factor + _coagulation) min _coagFactorMax;
_patient setVariable [QGVAR(coagulationFactor), (_final2), true];
2 changes: 1 addition & 1 deletion addons/pharma/functions/fnc_fullHealLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ _patient setVariable [QGVAR(pH), 1500, true];
_patient setVariable [QGVAR(kidneyFail), false, true];
_patient setVariable [QGVAR(kidneyArrest), false, true];
_patient setVariable [QGVAR(kidneyPressure), false, true];
_patient setVariable [QGVAR(coagulationFactor), missionNamespace getVariable [QGVAR(coagulation_factor_count), 15], true];
_patient setVariable [QGVAR(coagulationFactor), missionNamespace getVariable [QGVAR(coagulation_factor_count), 30], true];

/// Clear Stamina & weapon sway
if (ACEGVAR(advanced_fatigue,enabled)) then {
Expand Down
4 changes: 2 additions & 2 deletions addons/pharma/functions/fnc_treatmentAdvanced_CheckCoag.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

params ["_medic", "_patient"];

private _coagFactors = _patient getVariable [QGVAR(coagulationFactor), 15];
private _missionCoagFactors = missionNamespace getVariable [QGVAR(coagulation_factor_count), 15];
private _coagFactors = _patient getVariable [QGVAR(coagulationFactor), 30];
private _missionCoagFactors = missionNamespace getVariable [QGVAR(coagulation_factor_count), 30];
private _slowINR = (_missionCoagFactors / 100) * 75;
private _shighINR = (_missionCoagFactors / 100) * 125;
private _hlowINR = (_missionCoagFactors / 100) * 50;
Expand Down
Loading

0 comments on commit 110ce9d

Please sign in to comment.