Skip to content

Commit 5054bbc

Browse files
john681611PabstMirrorrautamiekkaMike-MFLinkIsGrim
authored
Add Separate Treatment Times for Exceeding Required Skill level (#10696)
* Added: Separate Settings for Skilled medical actions * Update addons/medical_treatment/functions/fnc_treatment.sqf Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Update addons/medical_treatment/stringtable.xml Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> * Update addons/medical_treatment/stringtable.xml Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> * Update addons/medical_treatment/stringtable.xml Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> * Update addons/medical_treatment/stringtable.xml Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> * Update addons/medical_treatment/stringtable.xml Co-authored-by: Mike-MF <TyroneMF@hotmail.com> * Update addons/medical_treatment/stringtable.xml Co-authored-by: Mike-MF <TyroneMF@hotmail.com> * Update addons/medical_treatment/stringtable.xml Co-authored-by: Mike-MF <TyroneMF@hotmail.com> * Update addons/medical_treatment/stringtable.xml Co-authored-by: Mike-MF <TyroneMF@hotmail.com> * Update addons/medical_treatment/functions/fnc_treatment.sqf Co-authored-by: PabstMirror <pabstmirror@gmail.com> * whitespace * Update addons/fire/compat_medical_engine/ACE_Medical_Treatment_Actions.hpp Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Apply suggestions from code review Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Define skilled as above the required medic level --------- Co-authored-by: PabstMirror <pabstmirror@gmail.com> Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> Co-authored-by: Mike-MF <TyroneMF@hotmail.com> Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
1 parent 6b8b967 commit 5054bbc

File tree

4 files changed

+69
-4
lines changed

4 files changed

+69
-4
lines changed

addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class GVAR(actions) {
1616
treatmentLocations = TREATMENT_LOCATIONS_ALL;
1717

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

2120
callbackStart = "";
2221
callbackProgress = "";
@@ -80,6 +79,7 @@ class GVAR(actions) {
8079
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
8180
items[] = {"ACE_tourniquet"};
8281
treatmentTime = QGVAR(treatmentTimeTourniquet);
82+
treatmentTimeTrained = QGVAR(treatmentTimeTrainedTourniquet);
8383
condition = QUOTE(!([ARR_2(_patient,_bodyPart)] call FUNC(hasTourniquetAppliedTo)));
8484
callbackSuccess = QFUNC(tourniquet);
8585
litter[] = {};
@@ -105,6 +105,7 @@ class GVAR(actions) {
105105
items[] = {"ACE_splint"};
106106
treatmentLocations = QGVAR(locationSplint);
107107
treatmentTime = QGVAR(treatmentTimeSplint);
108+
treatmentTimeTrained = QGVAR(treatmentTimeTrainedSplint);
108109
callbackSuccess = QFUNC(splint);
109110
condition = QFUNC(canSplint);
110111
litter[] = {
@@ -124,6 +125,7 @@ class GVAR(actions) {
124125
treatmentLocations = QGVAR(locationMorphine);
125126
condition = "";
126127
treatmentTime = QGVAR(treatmentTimeAutoinjector);
128+
treatmentTimeTrained = QGVAR(treatmentTimeTrainedAutoinjector);
127129
callbackSuccess = QFUNC(medication);
128130
animationMedic = "AinvPknlMstpSnonWnonDnon_medic1";
129131
sounds[] = {{QPATHTO_R(sounds\Inject.ogg),1,1,50}};
@@ -170,6 +172,7 @@ class GVAR(actions) {
170172
category = "advanced";
171173
medicRequired = QGVAR(medicIV);
172174
treatmentTime = QGVAR(treatmentTimeIV);
175+
treatmentTimeTrained = QGVAR(treatmentTimeTrainedIV);
173176
items[] = {"ACE_bloodIV"};
174177
treatmentLocations = QGVAR(locationIV);
175178
condition = "";

addons/medical_treatment/functions/fnc_treatment.sqf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@ if !(_this call FUNC(canTreat)) exitWith {false};
3030
private _config = configFile >> QGVAR(actions) >> _classname;
3131

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

3638
if (_treatmentTime isEqualType {}) then {
3739
_treatmentTime = call _treatmentTime;
3840
};
3941

4042
_treatmentTime
4143
} else {
42-
getNumber (_config >> "treatmentTime");
44+
getNumber (_config >> _treatmentTimeConfig);
4345
};
4446

4547
if (_treatmentTime == 0) exitWith {false};

addons/medical_treatment/initSettings.inc.sqf

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@
109109
true
110110
] call CBA_fnc_addSetting;
111111

112+
[
113+
QGVAR(treatmentTimeTrainedAutoinjector),
114+
"SLIDER",
115+
[LSTRING(TreatmentTimeTrainedAutoinjector_DisplayName), LSTRING(TreatmentTimeTrainedAutoinjector_Description)],
116+
LSTRING(Category),
117+
[0.1, 60, 5, 1],
118+
true
119+
] call CBA_fnc_addSetting;
120+
112121
[
113122
QGVAR(treatmentTimeTourniquet),
114123
"SLIDER",
@@ -118,6 +127,15 @@
118127
true
119128
] call CBA_fnc_addSetting;
120129

130+
[
131+
QGVAR(treatmentTimeTrainedTourniquet),
132+
"SLIDER",
133+
[LSTRING(TreatmentTimeTrainedTourniquet_DisplayName), LSTRING(TreatmentTimeTrainedTourniquet_Description)],
134+
LSTRING(Category),
135+
[0.1, 60, 7, 1],
136+
true
137+
] call CBA_fnc_addSetting;
138+
121139
[
122140
QGVAR(treatmentTimeSplint),
123141
"SLIDER",
@@ -127,6 +145,15 @@
127145
true
128146
] call CBA_fnc_addSetting;
129147

148+
[
149+
QGVAR(treatmentTimeTrainedSplint),
150+
"SLIDER",
151+
[LSTRING(TreatmentTimeTrainedSplint_DisplayName), LSTRING(TreatmentTimeTrainedSplint_Description)],
152+
LSTRING(Category),
153+
[0.1, 60, 7, 1],
154+
true
155+
] call CBA_fnc_addSetting;
156+
130157
[
131158
QGVAR(treatmentTimeBodyBag),
132159
"SLIDER",
@@ -344,6 +371,15 @@
344371
true
345372
] call CBA_fnc_addSetting;
346373

374+
[
375+
QGVAR(treatmentTimeTrainedIV),
376+
"SLIDER",
377+
[LSTRING(TreatmentTimeTrainedIV_DisplayName), LSTRING(TreatmentTimeTrainedIV_Description)],
378+
LSTRING(Category),
379+
[0.1, 60, 12, 1],
380+
true
381+
] call CBA_fnc_addSetting;
382+
347383
[
348384
QGVAR(cprSuccessChanceMin),
349385
"SLIDER",

addons/medical_treatment/stringtable.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4499,6 +4499,12 @@
44994499
<Japanese>自動注射器の所要時間</Japanese>
45004500
<Chinesesimp>自动注射器治疗时间</Chinesesimp>
45014501
</Key>
4502+
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedAutoinjector_Description">
4503+
<English>Time, in seconds, required for a unit exceeding required training level to administer medication using an autoinjector.</English>
4504+
</Key>
4505+
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedAutoinjector_DisplayName">
4506+
<English>Skilled Autoinjector Treatment Time</English>
4507+
</Key>
45024508
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeBodyBag_Description">
45034509
<English>Time, in seconds, required to put a patient in a body bag.</English>
45044510
<French>Définit le temps nécessaire à la mise en housse d'un corps (en secondes).</French>
@@ -4625,6 +4631,12 @@
46254631
<Japanese>点滴の所要時間</Japanese>
46264632
<Chinesesimp>静脉输液袋治疗时间</Chinesesimp>
46274633
</Key>
4634+
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedIV_Description">
4635+
<English>Time, in seconds, required for a unit exceeding required training level to administer an IV bag.</English>
4636+
</Key>
4637+
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedIV_DisplayName">
4638+
<English>Skilled IV Bag Treatment Time</English>
4639+
</Key>
46284640
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeSplint_Description">
46294641
<English>Time, in seconds, required to apply a splint.</English>
46304642
<French>Définit le temps nécessaire à l'application d'une attelle (en secondes).</French>
@@ -4651,6 +4663,12 @@
46514663
<Japanese>添え木の所要時間</Japanese>
46524664
<Chinesesimp>夹板治疗时间</Chinesesimp>
46534665
</Key>
4666+
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedSplint_Description">
4667+
<English>Time, in seconds, required for a unit exceeding required training level to apply a splint.</English>
4668+
</Key>
4669+
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedSplint_DisplayName">
4670+
<English>Skilled Splint Treatment Time</English>
4671+
</Key>
46544672
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTourniquet_Description">
46554673
<English>Time, in seconds, required to apply/remove a tourniquet.</English>
46564674
<French>Définit le temps nécessaire à l'application ou au retrait d'un garrot (en secondes).</French>
@@ -4677,6 +4695,12 @@
46774695
<Japanese>止血帯の所要時間</Japanese>
46784696
<Chinesesimp>止血带治疗时间</Chinesesimp>
46794697
</Key>
4698+
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedTourniquet_Description">
4699+
<English>Time, in seconds, required for a unit exceeding required training level to apply or remove a tourniquet.</English>
4700+
</Key>
4701+
<Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTrainedTourniquet_DisplayName">
4702+
<English>Skilled Tourniquet Treatment Time</English>
4703+
</Key>
46804704
<Key ID="STR_ACE_Medical_Treatment_TriageCard_NoEntry">
46814705
<English>No entries on this triage card.</English>
46824706
<Czech>Žádné záznamy na tomto štítku</Czech>

0 commit comments

Comments
 (0)