diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index c0708cd02c..ac72e4c14e 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -22,6 +22,7 @@ class ACE_Medical_Actions { animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; + litter[] = {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}; }; class Morphine: Bandage { displayName = "$STR_ACE_Medical_Inject_Morphine"; @@ -30,6 +31,7 @@ class ACE_Medical_Actions { items[] = {"ACE_morphine"}; callbackSuccess = QUOTE(DFUNC(treatmentBasic_morphine)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = {}; }; class Epinephrine: Bandage { displayName = "$STR_ACE_Medical_Inject_Epinephrine"; @@ -39,6 +41,7 @@ class ACE_Medical_Actions { items[] = {"ACE_epinephrine"}; callbackSuccess = QUOTE(DFUNC(treatmentBasic_epipen)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = {}; }; class BloodIV: Bandage { displayName = "$STR_ACE_Medical_Transfuse_Blood"; @@ -48,6 +51,7 @@ class ACE_Medical_Actions { items[] = {{"ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250"}}; callbackSuccess = QUOTE(DFUNC(treatmentBasic_bloodbag)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = {}; }; class Tourniquet: Bandage { displayName = "$STR_ACE_Medical_Apply_Tourniquet"; @@ -56,6 +60,7 @@ class ACE_Medical_Actions { treatmentTime = 6; callbackSuccess = QUOTE(DFUNC(treatmentTourniquet)); condition = QUOTE(!([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo))); + litter[] = {}; }; class BodyBag: Bandage { displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag"; @@ -70,6 +75,7 @@ class ACE_Medical_Actions { callbackProgress = ""; animationPatient = ""; itemConsumed = 0; + litter[] = {}; }; class PersonalAidKit: Bandage { displayName = ""; @@ -81,6 +87,7 @@ class ACE_Medical_Actions { callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal)); itemConsumed = 0; animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = {"ACE_MedicalLitter_gloves", {"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}, {"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}; }; }; @@ -107,6 +114,7 @@ class ACE_Medical_Actions { animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; + litter[] = {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}; }; class PackingBandage: fieldDressing { items[] = {"ACE_packingBandage"}; @@ -124,6 +132,7 @@ class ACE_Medical_Actions { treatmentTime = 6; callbackSuccess = QUOTE(DFUNC(treatmentTourniquet)); condition = QUOTE(!([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo))); + litter[] = {}; }; class Morphine: fieldDressing { displayName = "$STR_ACE_Medical_Inject_Morphine"; @@ -132,16 +141,19 @@ class ACE_Medical_Actions { treatmentTime = 3; callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_medication)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = {}; }; class Atropine: Morphine { displayName = "$STR_ACE_Medical_Inject_Atropine"; displayNameProgress = "$STR_ACE_Medical_Injecting_Atropine"; items[] = {"ACE_atropine"}; + litter[] = {}; }; class Epinephrine: Morphine { displayName = "$STR_ACE_Medical_Inject_Epinephrine"; displayNameProgress = "$STR_ACE_Medical_Injecting_Epinephrine"; items[] = {"ACE_epinephrine"}; + litter[] = {}; }; class BloodIV: fieldDressing { displayName = "$STR_ACE_Medical_Transfuse_Blood"; @@ -151,6 +163,7 @@ class ACE_Medical_Actions { treatmentTime = 7; callbackSuccess = QUOTE(DFUNC(treatmentIV)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = {}; }; class BloodIV_500: BloodIV { items[] = {"ACE_bloodIV_500"}; @@ -192,6 +205,7 @@ class ACE_Medical_Actions { callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_surgicalKit)); itemConsumed = 0; animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = {"ACE_MedicalLitter_gloves"}; }; class PersonalAidKit: fieldDressing { displayName = ""; @@ -203,6 +217,7 @@ class ACE_Medical_Actions { callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal)); itemConsumed = 0; animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = {"ACE_MedicalLitter_gloves", {"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}, {"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}; }; class CheckPulse: fieldDressing { displayName = ""; @@ -217,6 +232,7 @@ class ACE_Medical_Actions { animationPatient = ""; animationCaller = ""; // TODO itemConsumed = 0; + litter[] = {}; }; class CheckBloodPressure: CheckPulse { callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure)); @@ -243,6 +259,7 @@ class ACE_Medical_Actions { animationPatient = ""; animationCaller = ""; // TODO itemConsumed = 0; + litter[] = {}; }; class BodyBag: fieldDressing { displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag"; @@ -257,6 +274,7 @@ class ACE_Medical_Actions { callbackProgress = ""; animationPatient = ""; itemConsumed = 0; + litter[] = {}; }; }; }; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 2db4377910..58dd27a08c 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -1689,6 +1689,29 @@ class CfgVehicles { icon = ""; displayName = $STR_ACE_MEDICAL_BODYBAG_DISPLAY; }; + + // Medical litter classes + class Thing; + class ACE_MedicalLitterBase: Thing { + scope = 1; + displayName = " "; + destrType = "DestructNo"; + model = QUOTE(PATHTOF(data\littergeneric.p3d)); + }; + class ACE_MedicalLitter_bandage1: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\littergeneric_bandages1.p3d)); + }; + class ACE_MedicalLitter_bandage2: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\littergeneric_bandages2.p3d)); + }; + class ACE_MedicalLitter_bandage3: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\littergeneric_bandages3.p3d)); + }; + class ACE_MedicalLitter_gloves: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\littergeneric_gloves.p3d)); + }; + + class Item_Base_F; class ACE_fieldDressingItem: Item_Base_F { scope = 2; diff --git a/addons/medical/CfgWeapons.hpp b/addons/medical/CfgWeapons.hpp index d0b1b786ed..670cfcb34c 100644 --- a/addons/medical/CfgWeapons.hpp +++ b/addons/medical/CfgWeapons.hpp @@ -25,7 +25,7 @@ class CfgWeapons { class ACE_ItemCore; class ACE_fieldDressing: ACE_ItemCore { scope = 2; - model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d"; + model = QUOTE(PATHTOF(data\bandage.p3d)); picture = QUOTE(PATHTOF(ui\items\fieldDressing.paa)); displayName = $STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY; descriptionShort = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_SHORT; diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 08c26b2164..c51fecc608 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -23,6 +23,7 @@ PREP(canAccessMedicalEquipment); PREP(canTreat); PREP(canTreatCached); PREP(canCarry); +PREP(createLitter); PREP(determineIfFatal); PREP(getBloodLoss); PREP(getBloodPressure); diff --git a/addons/medical/data/ace_gloves_ca.paa b/addons/medical/data/ace_gloves_ca.paa new file mode 100644 index 0000000000..0873d7fbf4 Binary files /dev/null and b/addons/medical/data/ace_gloves_ca.paa differ diff --git a/addons/medical/data/ace_littergeneric1_co.paa b/addons/medical/data/ace_littergeneric1_co.paa new file mode 100644 index 0000000000..c2c4c25cbb Binary files /dev/null and b/addons/medical/data/ace_littergeneric1_co.paa differ diff --git a/addons/medical/data/littergeneric.p3d b/addons/medical/data/littergeneric.p3d new file mode 100644 index 0000000000..4170dd5a41 Binary files /dev/null and b/addons/medical/data/littergeneric.p3d differ diff --git a/addons/medical/data/littergeneric_bandages1.p3d b/addons/medical/data/littergeneric_bandages1.p3d new file mode 100644 index 0000000000..bdbc447178 Binary files /dev/null and b/addons/medical/data/littergeneric_bandages1.p3d differ diff --git a/addons/medical/data/littergeneric_bandages2.p3d b/addons/medical/data/littergeneric_bandages2.p3d new file mode 100644 index 0000000000..7b48675370 Binary files /dev/null and b/addons/medical/data/littergeneric_bandages2.p3d differ diff --git a/addons/medical/data/littergeneric_bandages3.p3d b/addons/medical/data/littergeneric_bandages3.p3d new file mode 100644 index 0000000000..7b48675370 Binary files /dev/null and b/addons/medical/data/littergeneric_bandages3.p3d differ diff --git a/addons/medical/data/littergeneric_gloves.p3d b/addons/medical/data/littergeneric_gloves.p3d new file mode 100644 index 0000000000..269742c802 Binary files /dev/null and b/addons/medical/data/littergeneric_gloves.p3d differ diff --git a/addons/medical/functions/fnc_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf new file mode 100644 index 0000000000..90b0429287 --- /dev/null +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -0,0 +1,58 @@ +/* + * Author: Glowbal + * Spawns litter for the treatment action on the ground around the target + * + * Arguments: + * 0: The target + * 1: The treatment classname + * + * Return Value: + * + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_target", "_className", "_config", "_litter", "_createLitter", "_litterObject", "_position", "_createdLitter"]; +_target = _this select 0; +_className = _this select 1; + +_config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className); +if (GVAR(level) >= 2) then { + _config = (configFile >> "ACE_Medical_Actions" >> "Advanced" >> _className); +}; +if !(isClass _config) exitwith {false}; + + +if !(isArray (_config >> "litter")) exitwith {}; +_litter = getArray (_config >> "litter"); + +_createLitter = { + _position = getPos (_this select 0); + _litterClass = _this select 1; + _litterObject = createVehicle [_litterClass, _position, [], 0, "NONE"]; + _litterObject setPos [(_position select 0) + random 0.5, (_position select 1) + random 1.2, _position select 2]; + _litterObject setDir (random 360); + _litterObject; +}; + +_createdLitter = []; +{ + if (typeName _x == "ARRAY") then { + { + if (typeName _x == "STRING") exitwith { + _createdLitter pushback ([_target, _x] call _createLitter); + }; + }foreach _x; + }; + if (typeName _x == "STRING") then { + _createdLitter pushback ([_target, _x] call _createLitter); + }; +}foreach _litter; + +[{ + { + deleteVehicle _x; + }foreach (_this select 0); +}, [_createdLitter], 1800, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index ead98fe327..50fa69d335 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -50,3 +50,5 @@ if (isNil _callback) then { }; _args call _callback; + +[_target, _className] call FUNC(createLitter); diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index 2ff7eff8df..235eef8c73 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -44,3 +44,5 @@ if (isNil _callback) then { }; _args call _callback; + +[_target, _className] call FUNC(createLitter);