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

Add Separate Treatment Times for Exceeding Required Skill level #10696

Merged
merged 21 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d7fdc27
Added: Separate Settings for Skilled medical actions
john681611 Jan 29, 2025
102f1e4
Update addons/medical_treatment/functions/fnc_treatment.sqf
john681611 Jan 29, 2025
291c4e9
Update addons/medical_treatment/stringtable.xml
john681611 Jan 29, 2025
137806e
Update addons/medical_treatment/stringtable.xml
john681611 Jan 29, 2025
2c8992f
Update addons/medical_treatment/stringtable.xml
john681611 Jan 29, 2025
ae3eb45
Update addons/medical_treatment/stringtable.xml
john681611 Jan 29, 2025
642647c
Update addons/medical_treatment/stringtable.xml
john681611 Jan 30, 2025
267e98c
Update addons/medical_treatment/stringtable.xml
john681611 Jan 30, 2025
4b15bfc
Update addons/medical_treatment/stringtable.xml
john681611 Jan 30, 2025
3f6e811
Update addons/medical_treatment/stringtable.xml
john681611 Jan 30, 2025
767cd69
Update addons/medical_treatment/functions/fnc_treatment.sqf
john681611 Feb 2, 2025
d9045b9
whitespace
LinkIsGrim Feb 3, 2025
3376f41
Update addons/fire/compat_medical_engine/ACE_Medical_Treatment_Action…
john681611 Feb 3, 2025
e6e9ef0
Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
john681611 Feb 3, 2025
03e7eb9
Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
john681611 Feb 3, 2025
2640b8d
Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
john681611 Feb 3, 2025
034afdc
Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
john681611 Feb 3, 2025
d0c97d4
Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
john681611 Feb 3, 2025
b96f2a9
Update addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
john681611 Feb 3, 2025
bab707d
Apply suggestions from code review
john681611 Feb 3, 2025
d400ac6
Define skilled as above the required medic level
john681611 Feb 3, 2025
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 @@ -10,6 +10,7 @@ class EGVAR(medical_treatment,actions) {
allowSelfTreatment = 1;
medicRequired = 0;
treatmentTime = 5;
treatmentTimeTrained = 5;
john681611 marked this conversation as resolved.
Show resolved Hide resolved
items[] = {};
condition = QFUNC(medical_canPatDown);
callbackSuccess = QFUNC(medical_success);
Expand Down
13 changes: 12 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,7 @@ class GVAR(actions) {
treatmentLocations = TREATMENT_LOCATIONS_ALL;

treatmentTime = QFUNC(getBandageTime);
treatmentTimeSelfCoef = 1; // todo: this isn't used anywhere, remove?
treatmentTimeTrained = QFUNC(getBandageTime);
john681611 marked this conversation as resolved.
Show resolved Hide resolved

callbackStart = "";
callbackProgress = "";
Expand Down Expand Up @@ -80,6 +80,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 +106,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 +126,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 @@ -156,6 +159,7 @@ class GVAR(actions) {
medicRequired = 0;
items[] = {"ACE_painkillers"};
treatmentTime = 4;
treatmentTimeTrained = 4;
john681611 marked this conversation as resolved.
Show resolved Hide resolved
sounds[] = {{QPATHTO_R(sounds\Pills.ogg),1,1,50}};
litter[] = {{"Land_PainKillers_F"}}; // just use BI's model as litter
};
Expand All @@ -170,6 +174,7 @@ class GVAR(actions) {
category = "advanced";
medicRequired = QGVAR(medicIV);
treatmentTime = QGVAR(treatmentTimeIV);
treatmentTimeTrained = QGVAR(treatmentTimeTrainedIV);
items[] = {"ACE_bloodIV"};
treatmentLocations = QGVAR(locationIV);
condition = "";
Expand Down Expand Up @@ -224,6 +229,7 @@ class GVAR(actions) {
allowedSelections[] = {"Head", "Body"};
medicRequired = 0;
treatmentTime = 2.5;
treatmentTimeTrained = 2.5;
john681611 marked this conversation as resolved.
Show resolved Hide resolved
items[] = {};
condition = QUOTE(GVAR(advancedDiagnose) == 0);
callbackSuccess = QFUNC(diagnose);
Expand Down Expand Up @@ -266,6 +272,7 @@ class GVAR(actions) {
allowSelfTreatment = 0;
medicRequired = 0;
treatmentTime = QGVAR(treatmentTimeBodyBag);
treatmentTimeTrained = QGVAR(treatmentTimeBodyBag);
john681611 marked this conversation as resolved.
Show resolved Hide resolved
items[] = {"ACE_bodyBag"};
condition = QFUNC(canPlaceInBodyBag);
callbackSuccess = QFUNC(placeInBodyBag);
Expand All @@ -285,6 +292,7 @@ class GVAR(actions) {
displayNameProgress = CSTRING(DiggingGrave);
icon = QPATHTOEF(medical_gui,ui\grave.paa);
treatmentTime = QGVAR(treatmentTimeGrave);
treatmentTimeTrained = QGVAR(treatmentTimeGrave);
john681611 marked this conversation as resolved.
Show resolved Hide resolved
condition = QFUNC(canDigGrave);
callbackSuccess = QFUNC(placeInGrave);
items[] = {};
Expand All @@ -300,6 +308,7 @@ class GVAR(actions) {
allowSelfTreatment = 0;
medicRequired = 0;
treatmentTime = QGVAR(treatmentTimeCPR);
treatmentTimeTrained = QGVAR(treatmentTimeCPR);
john681611 marked this conversation as resolved.
Show resolved Hide resolved
items[] = {};
condition = QFUNC(canCPR);
callbackSuccess = QFUNC(cprSuccess);
Expand All @@ -323,6 +332,7 @@ class GVAR(actions) {
allowSelfTreatment = QGVAR(allowSelfStitch);
medicRequired = QGVAR(medicSurgicalKit);
treatmentTime = QFUNC(getStitchTime);
treatmentTimeTrained = QFUNC(getStitchTime);
john681611 marked this conversation as resolved.
Show resolved Hide resolved
condition = QFUNC(canStitch);
callbackSuccess = "";
callbackStart = QFUNC(surgicalKitStart);
Expand All @@ -342,6 +352,7 @@ class GVAR(actions) {
allowSelfTreatment = QGVAR(allowSelfPAK);
medicRequired = QGVAR(medicPAK);
treatmentTime = QFUNC(getHealTime);
treatmentTimeTrained = QFUNC(getHealTime);
john681611 marked this conversation as resolved.
Show resolved Hide resolved
callbackSuccess = QFUNC(fullHeal);
consumeItem = QGVAR(consumePAK);
animationMedic = "AinvPknlMstpSlayW[wpn]Dnon_medicOther";
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,18 +30,20 @@ if !(_this call FUNC(canTreat)) exitWith {false};
private _config = configFile >> QGVAR(actions) >> _classname;

// Get treatment time from config, exit if treatment time is zero
Copy link
Contributor

@LinkIsGrim LinkIsGrim Feb 3, 2025

Choose a reason for hiding this comment

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

Personally, I'd rather a unit be considered skilled if it has required medic level for treatment + 1.

Stringtables would need to be changed to reflect this. Up to you, though.

Copy link
Contributor Author

@john681611 john681611 Feb 3, 2025

Choose a reason for hiding this comment

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

I may mess with this idea. But I'd rather the PR as it get in if it's not a simple implementation Turns out it was relatively easy.

private _treatmentTime = if (isText (_config >> "treatmentTime")) then {
GET_FUNCTION(_treatmentTime,_config >> "treatmentTime");
private _treatmentTimeConfig = ["treatmentTime", "treatmentTimeTrained"] select ([_medic] call FUNC(isMedic));
john681611 marked this conversation as resolved.
Show resolved Hide resolved
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);
};


LinkIsGrim marked this conversation as resolved.
Show resolved Hide resolved
if (_treatmentTime == 0) exitWith {false};

// Consume one of the treatment items if needed
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 to administer medication using an autoinjector. For a Meidc or Doctor</English>
john681611 marked this conversation as resolved.
Show resolved Hide resolved
</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 to administer an IV bag. For a Meidc or Doctor</English>
john681611 marked this conversation as resolved.
Show resolved Hide resolved
</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 to apply a splint. For a Meidc or Doctor</English>
john681611 marked this conversation as resolved.
Show resolved Hide resolved
</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 to apply/remove a tourniquet.. For a Meidc or Doctor</English>
john681611 marked this conversation as resolved.
Show resolved Hide resolved
</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