Skip to content

Commit

Permalink
PHARMA - Add IV epinephrine with stronger effects then autoinjector e…
Browse files Browse the repository at this point in the history
…pi (#568)

**When merged this pull request will:**
- Add IV Epinephrine

### 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}`.

---------

Co-authored-by: mazinskihenry <[email protected]>
  • Loading branch information
Cplhardcore and mazinskihenry authored Aug 8, 2024
1 parent ea69902 commit 8b76d63
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 1 deletion.
13 changes: 13 additions & 0 deletions addons/pharma/ACE_Medical_Treatment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ class ACE_ADDON(Medical_Treatment) {
alphaFactor = 0.15;
onOverDose = "";
};
class EpinephrineIV {
painReduce = 0;
hrIncreaseLow[] = {15, 30};
hrIncreaseNormal[] = {10, 50};
hrIncreaseHigh[] = {15, 40};
timeInSystem = 120;
timeTillMaxEffect = 10;
maxDose = 4;
maxDoseDeviation = 2;
incompatibleMedication[] = {};
alphaFactor = 0.3;
onOverDose = "";
};
class Morphine {
painReduce = 0.8;
hrIncreaseLow[] = {-10, -20};
Expand Down
11 changes: 11 additions & 0 deletions addons/pharma/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,17 @@ class ACE_Medical_Treatment_Actions {
callbackSuccess = QFUNC(medication);
sounds[] = {};
};
class EpinephrineIV: EACA {
displayName = CSTRING(Take_Epi);
displayNameProgress = CSTRING(Using);
allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"};
allowSelfTreatment = 1;
medicRequired = QGVAR(medLvl_EpinephrineIV);
treatmentTime = QGVAR(treatmentTime_EpinephrineIV);
items[] = {"kat_epinephrineIV"};
callbackSuccess = QFUNC(medication);
sounds[] = {};
};
class Dialysis: BasicBandage {
displayName = CSTRING(Dialysis_DisplayName);
displayNameProgress = CSTRING(Dialysis_DisplayNameProgress);
Expand Down
11 changes: 11 additions & 0 deletions addons/pharma/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,17 @@ class CfgWeapons {
mass = 0.2;
};
};
class kat_epinephrineIV: ACE_ItemCore {
scope = 2;
displayName = CSTRING(EpinephrineIV_displayName);
picture = QPATHTOF(ui\icon_EpinephrineIV.paa);
model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d";
descriptionShort = CSTRING(EpinephrineIV_DescShort);
ACE_isMedicalItem = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 0.2;
};
};
class kat_coag_sense: ACE_ItemCore {
scope = 2;
author = "Miss Heda";
Expand Down
19 changes: 19 additions & 0 deletions addons/pharma/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,25 @@ PREP_RECOMPILE_END;
true
] call CBA_Settings_fnc_init;

// EpinephrineIV Settings Category
[
QGVAR(medLvl_EpinephrineIV),
"LIST",
[LLSTRING(medLvl_EpinephrineIV)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_EpinephrineIV)],
[[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0],
true
] call CBA_Settings_fnc_init;

[
QGVAR(treatmentTime_EpinephrineIV),
"SLIDER",
[LLSTRING(treatmentTime_EpinephrineIV)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_EpinephrineIV)],
[0.1, 10, 7, 1],
true
] call CBA_Settings_fnc_init;

// Norepinephrine Settings Category
[
QGVAR(medLvl_Norepinephrine),
Expand Down
3 changes: 2 additions & 1 deletion addons/pharma/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class CfgPatches {
"kat_nalbuphine",
"kat_flumazenil",
"kat_lorazepam",
"kat_etomidate"
"kat_etomidate",
"kat_epinephrineIV"
};
magazines[] = { };
requiredAddons[] = {
Expand Down
8 changes: 8 additions & 0 deletions addons/pharma/functions/fnc_medicationLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ if !(ACEGVAR(medical_treatment,advancedMedication)) exitWith {

[_patient, -0.15] call FUNC(alphaAction);
};
case "EpinephrineIV": {
private _sedated = _patient getVariable [QEGVAR(surgery,sedated), false];
if !(_sedated) then {
[QACEGVAR(medical,WakeUp), _patient] call CBA_fnc_localEvent;
};

[_patient, -0.30] call FUNC(alphaAction);
};
};
};
TRACE_1("Running treatmentMedicationLocal with Advanced configuration for",_patient);
Expand Down
16 changes: 16 additions & 0 deletions addons/pharma/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3569,5 +3569,21 @@
<English>The time it takes for EACA to close a stich a wound</English>
<Japanese>EACAが創傷を縫合するのに掛かる時間</Japanese>
</Key>
<Key ID="STR_KAT_Pharma_SubCategory_EpinephrineIV">
<English>IV Epinephrine Settings</English>
<Japanese>EACAが創傷を縫合するのに掛かる時間</Japanese>
</Key>
<Key ID="STR_KAT_Pharma_medLvl_EpinephrineIV">
<English>Medical level required for IV Epinephrine</English>
</Key>
<Key ID="STR_KAT_Pharma_treatmentTime_EpinephrineIV">
<English>Treatment time for IV Epinephrine</English>
</Key>
<Key ID="STR_KAT_Pharma_EpinephrineIV_DescShort">
<English>IV Epinephrine</English>
</Key>
<Key ID="STR_KAT_Pharma_EpinephrineIV_displayName">
<English>IV Epinephrine</English>
</Key>
</Package>
</Project>
Binary file added addons/pharma/ui/icon_EpinephrineIV.paa
Binary file not shown.

0 comments on commit 8b76d63

Please sign in to comment.