Skip to content

Commit

Permalink
Add Separate Treatment Times for Exceeding Required Skill level (#10696)
Browse files Browse the repository at this point in the history
* Added: Separate Settings for Skilled medical actions

* Update addons/medical_treatment/functions/fnc_treatment.sqf

Co-authored-by: PabstMirror <[email protected]>

* Update addons/medical_treatment/stringtable.xml

Co-authored-by: Jouni Järvinen <[email protected]>

* Update addons/medical_treatment/stringtable.xml

Co-authored-by: Jouni Järvinen <[email protected]>

* Update addons/medical_treatment/stringtable.xml

Co-authored-by: Jouni Järvinen <[email protected]>

* Update addons/medical_treatment/stringtable.xml

Co-authored-by: Jouni Järvinen <[email protected]>

* Update addons/medical_treatment/stringtable.xml

Co-authored-by: Mike-MF <[email protected]>

* Update addons/medical_treatment/stringtable.xml

Co-authored-by: Mike-MF <[email protected]>

* Update addons/medical_treatment/stringtable.xml

Co-authored-by: Mike-MF <[email protected]>

* Update addons/medical_treatment/stringtable.xml

Co-authored-by: Mike-MF <[email protected]>

* Update addons/medical_treatment/functions/fnc_treatment.sqf

Co-authored-by: PabstMirror <[email protected]>

* whitespace

* Update addons/fire/compat_medical_engine/ACE_Medical_Treatment_Actions.hpp

Co-authored-by: PabstMirror <[email protected]>

* Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp

Co-authored-by: PabstMirror <[email protected]>

* Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp

Co-authored-by: PabstMirror <[email protected]>

* Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp

Co-authored-by: PabstMirror <[email protected]>

* Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp

Co-authored-by: PabstMirror <[email protected]>

* Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp

Co-authored-by: PabstMirror <[email protected]>

* Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp

Co-authored-by: PabstMirror <[email protected]>

* Apply suggestions from code review

Co-authored-by: PabstMirror <[email protected]>

* Define skilled as above the required medic level

---------

Co-authored-by: PabstMirror <[email protected]>
Co-authored-by: Jouni Järvinen <[email protected]>
Co-authored-by: Mike-MF <[email protected]>
Co-authored-by: Grim <[email protected]>
  • Loading branch information
5 people authored Feb 4, 2025
1 parent 6b8b967 commit 5054bbc
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 4 deletions.
5 changes: 4 additions & 1 deletion addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class GVAR(actions) {
treatmentLocations = TREATMENT_LOCATIONS_ALL;

treatmentTime = QFUNC(getBandageTime);
treatmentTimeSelfCoef = 1; // todo: this isn't used anywhere, remove?

callbackStart = "";
callbackProgress = "";
Expand Down Expand Up @@ -80,6 +79,7 @@ class GVAR(actions) {
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
items[] = {"ACE_tourniquet"};
treatmentTime = QGVAR(treatmentTimeTourniquet);
treatmentTimeTrained = QGVAR(treatmentTimeTrainedTourniquet);
condition = QUOTE(!([ARR_2(_patient,_bodyPart)] call FUNC(hasTourniquetAppliedTo)));
callbackSuccess = QFUNC(tourniquet);
litter[] = {};
Expand All @@ -105,6 +105,7 @@ class GVAR(actions) {
items[] = {"ACE_splint"};
treatmentLocations = QGVAR(locationSplint);
treatmentTime = QGVAR(treatmentTimeSplint);
treatmentTimeTrained = QGVAR(treatmentTimeTrainedSplint);
callbackSuccess = QFUNC(splint);
condition = QFUNC(canSplint);
litter[] = {
Expand All @@ -124,6 +125,7 @@ class GVAR(actions) {
treatmentLocations = QGVAR(locationMorphine);
condition = "";
treatmentTime = QGVAR(treatmentTimeAutoinjector);
treatmentTimeTrained = QGVAR(treatmentTimeTrainedAutoinjector);
callbackSuccess = QFUNC(medication);
animationMedic = "AinvPknlMstpSnonWnonDnon_medic1";
sounds[] = {{QPATHTO_R(sounds\Inject.ogg),1,1,50}};
Expand Down Expand Up @@ -170,6 +172,7 @@ class GVAR(actions) {
category = "advanced";
medicRequired = QGVAR(medicIV);
treatmentTime = QGVAR(treatmentTimeIV);
treatmentTimeTrained = QGVAR(treatmentTimeTrainedIV);
items[] = {"ACE_bloodIV"};
treatmentLocations = QGVAR(locationIV);
condition = "";
Expand Down
8 changes: 5 additions & 3 deletions addons/medical_treatment/functions/fnc_treatment.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ if !(_this call FUNC(canTreat)) exitWith {false};
private _config = configFile >> QGVAR(actions) >> _classname;

// Get treatment time from config, exit if treatment time is zero
private _treatmentTime = if (isText (_config >> "treatmentTime")) then {
GET_FUNCTION(_treatmentTime,_config >> "treatmentTime");
private _medicRequiredLevel = GET_NUMBER_ENTRY(_config >> "medicRequired");
private _treatmentTimeConfig = ["treatmentTime", "treatmentTimeTrained"] select (([_medic, (_medicRequiredLevel + 1)] call FUNC(isMedic)) && {!isNull (_config >> "treatmentTimeTrained")});
private _treatmentTime = if (isText (_config >> _treatmentTimeConfig)) then {
GET_FUNCTION(_treatmentTime,_config >> _treatmentTimeConfig);

if (_treatmentTime isEqualType {}) then {
_treatmentTime = call _treatmentTime;
};

_treatmentTime
} else {
getNumber (_config >> "treatmentTime");
getNumber (_config >> _treatmentTimeConfig);
};

if (_treatmentTime == 0) exitWith {false};
Expand Down
36 changes: 36 additions & 0 deletions addons/medical_treatment/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@
true
] call CBA_fnc_addSetting;

[
QGVAR(treatmentTimeTrainedAutoinjector),
"SLIDER",
[LSTRING(TreatmentTimeTrainedAutoinjector_DisplayName), LSTRING(TreatmentTimeTrainedAutoinjector_Description)],
LSTRING(Category),
[0.1, 60, 5, 1],
true
] call CBA_fnc_addSetting;

[
QGVAR(treatmentTimeTourniquet),
"SLIDER",
Expand All @@ -118,6 +127,15 @@
true
] call CBA_fnc_addSetting;

[
QGVAR(treatmentTimeTrainedTourniquet),
"SLIDER",
[LSTRING(TreatmentTimeTrainedTourniquet_DisplayName), LSTRING(TreatmentTimeTrainedTourniquet_Description)],
LSTRING(Category),
[0.1, 60, 7, 1],
true
] call CBA_fnc_addSetting;

[
QGVAR(treatmentTimeSplint),
"SLIDER",
Expand All @@ -127,6 +145,15 @@
true
] call CBA_fnc_addSetting;

[
QGVAR(treatmentTimeTrainedSplint),
"SLIDER",
[LSTRING(TreatmentTimeTrainedSplint_DisplayName), LSTRING(TreatmentTimeTrainedSplint_Description)],
LSTRING(Category),
[0.1, 60, 7, 1],
true
] call CBA_fnc_addSetting;

[
QGVAR(treatmentTimeBodyBag),
"SLIDER",
Expand Down Expand Up @@ -344,6 +371,15 @@
true
] call CBA_fnc_addSetting;

[
QGVAR(treatmentTimeTrainedIV),
"SLIDER",
[LSTRING(TreatmentTimeTrainedIV_DisplayName), LSTRING(TreatmentTimeTrainedIV_Description)],
LSTRING(Category),
[0.1, 60, 12, 1],
true
] call CBA_fnc_addSetting;

[
QGVAR(cprSuccessChanceMin),
"SLIDER",
Expand Down
24 changes: 24 additions & 0 deletions addons/medical_treatment/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4499,6 +4499,12 @@
<Japanese>自動注射器の所要時間</Japanese>
<Chinesesimp>自动注射器治疗时间</Chinesesimp>
</Key>
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedAutoinjector_Description">
<English>Time, in seconds, required for a unit exceeding required training level to administer medication using an autoinjector.</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedAutoinjector_DisplayName">
<English>Skilled Autoinjector Treatment Time</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeBodyBag_Description">
<English>Time, in seconds, required to put a patient in a body bag.</English>
<French>Définit le temps nécessaire à la mise en housse d'un corps (en secondes).</French>
Expand Down Expand Up @@ -4625,6 +4631,12 @@
<Japanese>点滴の所要時間</Japanese>
<Chinesesimp>静脉输液袋治疗时间</Chinesesimp>
</Key>
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedIV_Description">
<English>Time, in seconds, required for a unit exceeding required training level to administer an IV bag.</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedIV_DisplayName">
<English>Skilled IV Bag Treatment Time</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeSplint_Description">
<English>Time, in seconds, required to apply a splint.</English>
<French>Définit le temps nécessaire à l'application d'une attelle (en secondes).</French>
Expand All @@ -4651,6 +4663,12 @@
<Japanese>添え木の所要時間</Japanese>
<Chinesesimp>夹板治疗时间</Chinesesimp>
</Key>
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedSplint_Description">
<English>Time, in seconds, required for a unit exceeding required training level to apply a splint.</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedSplint_DisplayName">
<English>Skilled Splint Treatment Time</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTourniquet_Description">
<English>Time, in seconds, required to apply/remove a tourniquet.</English>
<French>Définit le temps nécessaire à l'application ou au retrait d'un garrot (en secondes).</French>
Expand All @@ -4677,6 +4695,12 @@
<Japanese>止血帯の所要時間</Japanese>
<Chinesesimp>止血带治疗时间</Chinesesimp>
</Key>
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedTourniquet_Description">
<English>Time, in seconds, required for a unit exceeding required training level to apply or remove a tourniquet.</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedTourniquet_DisplayName">
<English>Skilled Tourniquet Treatment Time</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_TriageCard_NoEntry">
<English>No entries on this triage card.</English>
<Czech>Žádné záznamy na tomto štítku</Czech>
Expand Down

0 comments on commit 5054bbc

Please sign in to comment.