mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Enable treatmnet actions
This commit is contained in:
parent
9263cb0f7d
commit
1c1e47c039
@ -10,6 +10,12 @@ class Extended_PreInit_EventHandlers {
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Init_EventHandlers {
|
||||
class CAManBase {
|
||||
class ADDON {
|
||||
|
@ -21,3 +21,12 @@ PREP(setHitPointDamage);
|
||||
PREP(setStructuralDamage);
|
||||
PREP(stateEvent);
|
||||
PREP(stateMachine);
|
||||
|
||||
// PREP(hasMedicalEnabled);
|
||||
|
||||
PREP(handleStateDefault);
|
||||
PREP(handleStateInjured);
|
||||
PREP(handleStateUnconscious);
|
||||
PREP(handleUnitVitals);
|
||||
PREP(handleMedications);
|
||||
// PREP(handleStateRevive);
|
||||
|
@ -5,13 +5,13 @@ GVAR(heartBeatSounds_Fast) = ["ACE_heartbeat_fast_1", "ACE_heartbeat_fast_2", "A
|
||||
GVAR(heartBeatSounds_Normal) = ["ACE_heartbeat_norm_1", "ACE_heartbeat_norm_2"];
|
||||
GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"];
|
||||
|
||||
|
||||
call FUNC(stateMachine);
|
||||
|
||||
//Handle Deleting Bodies and creating litter on Server:
|
||||
if (isServer) then {
|
||||
["ace_placedInBodyBag", FUNC(serverRemoveBody)] call CBA_fnc_addEventHandler;
|
||||
};
|
||||
[QGVAR(createLitterServer), FUNC(handleCreateLitter)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(createLitterServer), FUNC(handleCreateLitter)] call CBA_fnc_addEventHandler;
|
||||
|
||||
["ace_unconscious", {
|
||||
params ["_unit", "_status"];
|
||||
|
@ -8,12 +8,13 @@ class CfgPatches {
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author = ECSTRING(common,ACETeam);
|
||||
authors[] = {""};
|
||||
authors[] = {"Glowbal", "KoffeinFlummi"};
|
||||
url = ECSTRING(main,URL);
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "ACE_Settings.hpp"
|
||||
#include "ACE_Medical_Injuries.hpp"
|
||||
#include "ACE_Medical_StateMachine.hpp"
|
||||
|
||||
|
@ -1,4 +1,26 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* [Description]
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Argument Name <TYPE>
|
||||
*
|
||||
* Return Value:
|
||||
* Return Name <TYPE>
|
||||
*
|
||||
* Example:
|
||||
* ["example"] call ace_[module]_fnc_[functionName]
|
||||
*
|
||||
* Public: [Yes/No]
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit", "_stateMachine"];
|
||||
|
||||
params ["_unit"];
|
||||
// TODO check if this unit is being monitored by the state machine
|
||||
if (_unit in GVAR(monitoredUnitsList)) exitWith {}; // already monitored
|
||||
private _defaultState = _stateMachine getVariable "Default";
|
||||
if (!isNil "_defaultState") then {
|
||||
systemChat format["Assigned default state to: %1. Total monitored: %2", _unit, GVAR(monitoredUnitsList)];
|
||||
_unit setVariable[QGVAR(state), [-1, _defaultState]];
|
||||
GVAR(monitoredUnitsList) pushBack _unit;
|
||||
};
|
||||
|
@ -5,9 +5,16 @@ params ["_stateMachineConfig"];
|
||||
private _getCode = {
|
||||
params ["_config", "_attribute"];
|
||||
private _value = getText (_config >> _attribute);
|
||||
if (isNil {missionNamespace getVariable _value}) exitWith {
|
||||
if (_value == "") then {_value = "true"};
|
||||
systemChat format ["getCode (%1) is returning nil: %3", _attribute, missionnamespace getVariable _value, _value];
|
||||
diag_log format ["getCode (%1) is returning nil: %3", _attribute, missionnamespace getVariable _value, _value];
|
||||
|
||||
compile _value;
|
||||
};
|
||||
missionNamespace getVariable _value;
|
||||
};
|
||||
|
||||
private _stateMachine = call CBA_fnc_createNamespace;
|
||||
|
||||
private _states = [];
|
||||
|
@ -16,6 +16,8 @@ if (!local _unit) exitWith {
|
||||
_unit setVariable [QGVAR(bloodVolume), _unit getVariable [QGVAR(bloodVolume), 100], true];
|
||||
};
|
||||
|
||||
systemChat format["handling state default for unit: %1", _this];
|
||||
|
||||
[_unit, CBA_missionTime - _lastTime] call FUNC(handleUnitVitals);
|
||||
|
||||
private _pain = _unit getVariable [QGVAR(pain), 0];
|
||||
|
@ -50,7 +50,11 @@ if (_bloodVolume < 100) then {
|
||||
};
|
||||
|
||||
TRACE_3("ACE_DEBUG",[_unit] call FUNC(getBloodLoss),_unit getVariable QGVAR(isBleeding),_unit);
|
||||
if (([_unit] call FUNC(getBloodLoss)) > 0) then {
|
||||
private _bloodLoss = [_unit] call FUNC(getBloodLoss);
|
||||
if (_bloodLoss > 0) then {
|
||||
_unit setVariable [QGVAR(bloodloss), _bloodLoss, _syncValues];
|
||||
|
||||
[_unit, "TakenInjury"] call FUNC(stateEvent);
|
||||
if !(_unit getVariable [QGVAR(isBleeding), false]) then {
|
||||
_unit setVariable [QGVAR(isBleeding), true, true];
|
||||
};
|
||||
|
@ -77,8 +77,7 @@ _logs = _unit getVariable [QGVAR(allLogs), []];
|
||||
} forEach _logs;
|
||||
_unit setVariable [QGVAR(allLogs), [], true];
|
||||
|
||||
// TODO move to treatment
|
||||
// items
|
||||
[{
|
||||
_this call FUNC(itemCheck);
|
||||
params ["_unit"];
|
||||
[QGVAR(initialized), [_unit]] call CBA_fnc_localEvent;
|
||||
}, [_unit], 0.5, 0.1] call CBA_fnc_waitAndExecute;
|
||||
|
@ -21,11 +21,12 @@ GVAR(monitoredUnitsListIsSorted) = false;
|
||||
_x params ["_unit"];
|
||||
|
||||
if (!isNull _unit && alive _unit) then {
|
||||
private _unitState = _unit getVariable [QGVAR(state), [CBA_missionTime, DEFAULT_STATE]];
|
||||
private _unitState = _unit getVariable [QGVAR(state), [-1, DEFAULT_STATE]];
|
||||
_unitState params ["_lastTime", "_state"];
|
||||
|
||||
if ((_lastTime + DELAY) > CBA_missionTime) exitWith {_exit = true;};
|
||||
if (CBA_missionTime - _lastTime < DELAY) exitWith { _exit = true; };
|
||||
_state params ["_name", "_handler", "_onEntry", "_onExit", "_transitions"];
|
||||
|
||||
_unitState set [0, CBA_missionTime];
|
||||
|
||||
_unit setvariable [QGVAR(state), _unitState];
|
||||
|
@ -10,6 +10,8 @@ ADDON = false;
|
||||
private _selectionName = EGVAR(medical,SELECTIONS) param [EGVAR(medical,HITPOINTS) find _woundedHitPoint]; // @todo
|
||||
private _typeOfDamage = _ammo call FUNC(getTypeOfDamage);
|
||||
[_unit, _selectionName, _receivedDamage, _ammo, _typeOfDamage] call FUNC(woundsHandler); // TODO also support the sqf variant
|
||||
|
||||
[_unit, EGVAR(medical,STATE_MACHINE)] call EFUNC(medical,addStateHandler);
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
ADDON = true;
|
||||
|
@ -15,8 +15,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private _configBasic = (configFile >> "ACE_Medical_Treatments" >> "Basic");
|
||||
private _configAdvanced = (configFile >> "ACE_Medical_Treatments" >> "Advanced");
|
||||
private _configBasic = (configFile >> "ACE_Medical_Treatment_Actions" >> "Basic");
|
||||
private _configAdvanced = (configFile >> "ACE_Medical_Treatment_Actions" >> "Advanced");
|
||||
|
||||
private _fnc_compileActionsLevel = {
|
||||
params ["_config"];
|
||||
@ -29,6 +29,7 @@ private _fnc_compileActionsLevel = {
|
||||
private _condition = format[QUOTE([ARR_4(ACE_player, GVAR(INTERACTION_TARGET), EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart), '%1')] call DEFUNC(medical_treatment,canTreatCached)), configName _x];
|
||||
private _statement = format[QUOTE([ARR_4(ACE_player, GVAR(INTERACTION_TARGET), EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart), '%1')] call DEFUNC(medical_treatment,treatment)), configName _x];
|
||||
_actions pushBack [_displayName, _category, compile _condition, compile _statement];
|
||||
diag_log format["ACTION: %1", [_displayName, _category, compile _condition, compile _statement]];
|
||||
};
|
||||
nil
|
||||
} count ("true" configClasses _config);
|
||||
|
@ -60,7 +60,7 @@ _damaged = [false, false, false, false, false, false];
|
||||
_selectionBloodLoss = [0, 0, 0, 0, 0, 0];
|
||||
|
||||
_allInjuryTexts = [];
|
||||
if ((EGVAR(medical,level) >= 2) && {([_target] call EFUNC(medical,hasMedicalEnabled))}) then {
|
||||
if ((EGVAR(medical,level) >= 2) ) then { // && {([_target] call EFUNC(medical,hasMedicalEnabled))}
|
||||
_openWounds = _target getVariable [QEGVAR(medical,openWounds), []];
|
||||
private "_amountOf";
|
||||
{
|
||||
|
@ -1,409 +1,4 @@
|
||||
|
||||
class ACE_Medical_Treatments {
|
||||
class Basic {
|
||||
class Bandage {
|
||||
displayName = ECSTRING(medical,Bandage);
|
||||
displayNameProgress = ECSTRING(medical,Bandaging);
|
||||
category = "bandage";
|
||||
treatmentLocations[] = {"All"};
|
||||
allowedSelections[] = {"All"};
|
||||
allowSelfTreatment = 1;
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 5;
|
||||
treatmentTimeSelfCoef = 1;
|
||||
items[] = {{"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_quikclot"}};
|
||||
condition = "";
|
||||
patientStateCondition = 0;
|
||||
itemConsumed = 1;
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_bandage));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "";
|
||||
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
|
||||
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
|
||||
animationCaller = "AinvPknlMstpSlayWrflDnon_medicOther";
|
||||
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
|
||||
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
|
||||
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
|
||||
litter[] = {
|
||||
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
|
||||
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
|
||||
};
|
||||
};
|
||||
class Morphine: Bandage {
|
||||
displayName = ECSTRING(medical,Inject_Morphine);
|
||||
displayNameProgress = ECSTRING(medical,Injecting_Morphine);
|
||||
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
|
||||
allowSelfTreatment = 1;
|
||||
category = "medication";
|
||||
treatmentTime = 2;
|
||||
items[] = {"ACE_morphine"};
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentBasic_morphine));
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} };
|
||||
};
|
||||
class Epinephrine: Bandage {
|
||||
displayName = ECSTRING(medical,Inject_Epinephrine);
|
||||
displayNameProgress = ECSTRING(medical,Injecting_Epinephrine);
|
||||
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
|
||||
allowSelfTreatment = 1;
|
||||
category = "medication";
|
||||
requiredMedic = QEGVAR(medical,medicSetting_basicEpi);
|
||||
treatmentTime = 3;
|
||||
items[] = {"ACE_epinephrine"};
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentBasic_epipen));
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} };
|
||||
treatmentLocations[] = {QGVAR(useLocation_basicEpi)};
|
||||
};
|
||||
class BloodIV: Bandage {
|
||||
displayName = ECSTRING(medical,Transfuse_Blood);
|
||||
displayNameProgress = ECSTRING(medical,Transfusing_Blood);
|
||||
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
|
||||
allowSelfTreatment = 0;
|
||||
category = "advanced";
|
||||
requiredMedic = 1;
|
||||
treatmentTime = 20;
|
||||
items[] = {"ACE_bloodIV"};
|
||||
// callbackSuccess = QUOTE(DFUNC(treatmentBasic_bloodbag));
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentIV));
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
litter[] = {};
|
||||
};
|
||||
class BloodIV_500: BloodIV {
|
||||
category = "advanced";
|
||||
items[] = {"ACE_bloodIV_500"};
|
||||
};
|
||||
class BloodIV_250: BloodIV {
|
||||
category = "advanced";
|
||||
items[] = {"ACE_bloodIV_250"};
|
||||
};
|
||||
class BodyBag: Bandage {
|
||||
displayName = ECSTRING(medical,PlaceInBodyBag);
|
||||
displayNameProgress = ECSTRING(medical,PlacingInBodyBag);
|
||||
category = "advanced";
|
||||
treatmentLocations[] = {"All"};
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 4;
|
||||
items[] = {"ACE_bodyBag"};
|
||||
condition = "!alive (_this select 1);";
|
||||
callbackSuccess = QUOTE(DFUNC(actionPlaceInBodyBag));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "";
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "";
|
||||
itemConsumed = 1;
|
||||
litter[] = {};
|
||||
};
|
||||
class Diagnose: Bandage {
|
||||
displayName = ECSTRING(medical,Actions_Diagnose);
|
||||
displayNameProgress = ECSTRING(medical,Actions_Diagnosing);
|
||||
category = "examine";
|
||||
treatmentLocations[] = {"All"};
|
||||
allowedSelections[] = {"head", "body"};
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 1;
|
||||
items[] = {};
|
||||
callbackSuccess = QUOTE(DFUNC(actionDiagnose));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "";
|
||||
animationPatient = "";
|
||||
animationCaller = ""; // TODO
|
||||
itemConsumed = 0;
|
||||
litter[] = {};
|
||||
};
|
||||
class CPR: Bandage {
|
||||
displayName = ECSTRING(medical,Actions_CPR);
|
||||
displayNameProgress = ECSTRING(medical,Actions_PerformingCPR);
|
||||
category = "advanced";
|
||||
treatmentLocations[] = {"All"};
|
||||
allowedSelections[] = {"body"};
|
||||
allowSelfTreatment = 0;
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 15;
|
||||
items[] = {};
|
||||
condition = QUOTE(!([(_this select 1)] call ace_common_fnc_isAwake) && EGVAR(medical,enableRevive)>0);
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "!([((_this select 0) select 1)] call ace_common_fnc_isAwake)";
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
|
||||
animationCaller = "AinvPknlMstpSlayWnonDnon_medic";
|
||||
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
|
||||
animationCallerSelf = "";
|
||||
animationCallerSelfProne = "";
|
||||
itemConsumed = 0;
|
||||
litter[] = {};
|
||||
};
|
||||
};
|
||||
|
||||
class Advanced {
|
||||
class FieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_FieldDressing);
|
||||
displayNameProgress = ECSTRING(medical,Bandaging);
|
||||
category = "bandage";
|
||||
// Which locations can this treatment action be used? Available: Field, MedicalFacility, MedicalVehicle, All.
|
||||
treatmentLocations[] = {"All"};
|
||||
allowedSelections[] = {"All"};
|
||||
allowSelfTreatment = 1;
|
||||
// What is the level of medical skill required for this treatment action? 0 = all soldiers, 1 = medic, 2 = doctor
|
||||
requiredMedic = 0;
|
||||
// The time it takes for a treatment action to complete. Time is in seconds.
|
||||
treatmentTime = 8;
|
||||
// Item required for the action. Leave empty for no item required.
|
||||
items[] = {"ACE_fieldDressing"};
|
||||
condition = "";
|
||||
patientStateCondition = 0;
|
||||
// Callbacks
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_bandage));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "";
|
||||
itemConsumed = 1;
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
|
||||
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
|
||||
animationCaller = "AinvPknlMstpSlayWrflDnon_medicOther";
|
||||
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
|
||||
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
|
||||
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
|
||||
litter[] = {
|
||||
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
|
||||
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
|
||||
};
|
||||
};
|
||||
class PackingBandage: fieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_PackingBandage);
|
||||
items[] = {"ACE_packingBandage"};
|
||||
litter[] = {
|
||||
{"All", "", {"ACE_MedicalLitter_packingBandage"}},
|
||||
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
|
||||
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
|
||||
};
|
||||
};
|
||||
class ElasticBandage: fieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_ElasticBandage);
|
||||
items[] = {"ACE_elasticBandage"};
|
||||
};
|
||||
class QuikClot: fieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_QuikClot);
|
||||
items[] = {"ACE_quikclot"};
|
||||
litter[] = {
|
||||
{"All", "", {"ACE_MedicalLitter_QuickClot"}},
|
||||
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
|
||||
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
|
||||
};
|
||||
};
|
||||
class Tourniquet: fieldDressing {
|
||||
displayName = ECSTRING(medical,Apply_Tourniquet);
|
||||
displayNameProgress = ECSTRING(medical,Applying_Tourniquet);
|
||||
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
|
||||
items[] = {"ACE_tourniquet"};
|
||||
treatmentTime = 4;
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentTourniquet));
|
||||
condition = QUOTE(!([ARR_2(_this select 1, _this select 2)] call EFUNC(medical,hasTourniquetAppliedTo)));
|
||||
litter[] = {};
|
||||
};
|
||||
class Morphine: fieldDressing {
|
||||
displayName = ECSTRING(medical,Inject_Morphine);
|
||||
displayNameProgress = ECSTRING(medical,Injecting_Morphine);
|
||||
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
|
||||
category = "medication";
|
||||
items[] = {"ACE_morphine"};
|
||||
treatmentTime = 3;
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_medication));
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} };
|
||||
};
|
||||
class Adenosine: Morphine {
|
||||
displayName = ECSTRING(medical,Inject_Adenosine);
|
||||
displayNameProgress = ECSTRING(medical,Injecting_Adenosine);
|
||||
items[] = {"ACE_adenosine"};
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_adenosine"}} };
|
||||
};
|
||||
class Atropine: Morphine {
|
||||
displayName = ECSTRING(medical,Inject_Atropine);
|
||||
displayNameProgress = ECSTRING(medical,Injecting_Atropine);
|
||||
items[] = {"ACE_atropine"};
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_atropine"}} };
|
||||
};
|
||||
class Epinephrine: Morphine {
|
||||
displayName = ECSTRING(medical,Inject_Epinephrine);
|
||||
displayNameProgress = ECSTRING(medical,Injecting_Epinephrine);
|
||||
items[] = {"ACE_epinephrine"};
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} };
|
||||
};
|
||||
class BloodIV: fieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_Blood4_1000);
|
||||
displayNameProgress = ECSTRING(medical,Transfusing_Blood);
|
||||
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
|
||||
allowSelfTreatment = 0;
|
||||
category = "advanced";
|
||||
items[] = {"ACE_bloodIV"};
|
||||
requiredMedic = 1;
|
||||
treatmentTime = 7;
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentIV));
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
litter[] = {};
|
||||
};
|
||||
class BloodIV_500: BloodIV {
|
||||
displayName = ECSTRING(medical,Actions_Blood4_500);
|
||||
items[] = {"ACE_bloodIV_500"};
|
||||
};
|
||||
class BloodIV_250: BloodIV {
|
||||
displayName = ECSTRING(medical,Actions_Blood4_250);
|
||||
items[] = {"ACE_bloodIV_250"};
|
||||
};
|
||||
class PlasmaIV: BloodIV {
|
||||
displayName = ECSTRING(medical,Actions_Plasma4_1000);
|
||||
displayNameProgress = ECSTRING(medical,Transfusing_Plasma);
|
||||
items[] = {"ACE_plasmaIV"};
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
};
|
||||
class PlasmaIV_500: PlasmaIV {
|
||||
displayName = ECSTRING(medical,Actions_Plasma4_500);
|
||||
items[] = {"ACE_plasmaIV_500"};
|
||||
};
|
||||
class PlasmaIV_250: PlasmaIV {
|
||||
displayName = ECSTRING(medical,Actions_Plasma4_250);
|
||||
items[] = {"ACE_plasmaIV_250"};
|
||||
};
|
||||
class SalineIV: BloodIV {
|
||||
displayName = ECSTRING(medical,Actions_Saline4_1000);
|
||||
displayNameProgress = ECSTRING(medical,Transfusing_Saline);
|
||||
items[] = {"ACE_salineIV"};
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
};
|
||||
class SalineIV_500: SalineIV {
|
||||
displayName = ECSTRING(medical,Actions_Saline4_500);
|
||||
items[] = {"ACE_salineIV_500"};
|
||||
};
|
||||
class SalineIV_250: SalineIV {
|
||||
displayName = ECSTRING(medical,Actions_Saline4_250);
|
||||
items[] = {"ACE_salineIV_250"};
|
||||
};
|
||||
class SurgicalKit: fieldDressing {
|
||||
displayName = ECSTRING(medical,Use_SurgicalKit);
|
||||
displayNameProgress = ECSTRING(medical,Stitching);
|
||||
category = "advanced";
|
||||
items[] = {"ACE_surgicalKit"};
|
||||
treatmentLocations[] = {QEGVAR(medical,useLocation_SurgicalKit)};
|
||||
allowSelfTreatment = 0;
|
||||
requiredMedic = QEGVAR(medical,medicSetting_SurgicalKit);
|
||||
patientStateCondition = QEGVAR(medical,useCondition_SurgicalKit);
|
||||
treatmentTime = "(count ((_this select 1) getVariable ['ACE_Medical_bandagedWounds', []]) * 5)";
|
||||
callbackSuccess = "";
|
||||
callbackProgress = QUOTE(DFUNC(treatmentAdvanced_surgicalKit_onProgress));
|
||||
itemConsumed = QEGVAR(medical,consumeItem_SurgicalKit);
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"} }};
|
||||
};
|
||||
class PersonalAidKit: fieldDressing {
|
||||
displayName = ECSTRING(medical,Use_Aid_Kit);
|
||||
displayNameProgress = ECSTRING(medical,TreatmentAction);
|
||||
category = "advanced";
|
||||
items[] = {"ACE_personalAidKit"};
|
||||
treatmentLocations[] = {QEGVAR(medical,useLocation_PAK)};
|
||||
allowSelfTreatment = 0;
|
||||
requiredMedic = QEGVAR(medical,medicSetting_PAK);
|
||||
patientStateCondition = QEGVAR(medical,useCondition_PAK);
|
||||
treatmentTime = QUOTE((_this select 1) call FUNC(treatmentAdvanced_fullHealTreatmentTime));
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal));
|
||||
itemConsumed = QEGVAR(medical,consumeItem_PAK);
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
|
||||
animationCaller = "AinvPknlMstpSlayWnonDnon_medicOther";
|
||||
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
|
||||
animationCallerSelf = "";
|
||||
animationCallerSelfProne = "";
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}},
|
||||
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
|
||||
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
|
||||
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
|
||||
};
|
||||
};
|
||||
class CheckPulse: fieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_CheckPulse);
|
||||
displayNameProgress = ECSTRING(medical,Check_Pulse_Content);
|
||||
category = "examine";
|
||||
treatmentLocations[] = {"All"};
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 2;
|
||||
items[] = {};
|
||||
callbackSuccess = QUOTE(DFUNC(actionCheckPulse));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "";
|
||||
animationPatient = "";
|
||||
animationCaller = ""; // TODO
|
||||
animationCallerProne = "";
|
||||
animationCallerSelfProne = "";
|
||||
itemConsumed = 0;
|
||||
litter[] = {};
|
||||
};
|
||||
class CheckBloodPressure: CheckPulse {
|
||||
displayName = ECSTRING(medical,Actions_CheckBloodPressure);
|
||||
callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure));
|
||||
displayNameProgress = ECSTRING(medical,Check_Bloodpressure_Content);
|
||||
};
|
||||
class CheckResponse: CheckPulse {
|
||||
displayName = ECSTRING(medical,Check_Response);
|
||||
callbackSuccess = QUOTE(DFUNC(actionCheckResponse));
|
||||
displayNameProgress = ECSTRING(medical,Check_Response_Content);
|
||||
allowSelfTreatment = 0;
|
||||
};
|
||||
class RemoveTourniquet: Tourniquet {
|
||||
displayName = ECSTRING(medical,Actions_RemoveTourniquet);
|
||||
items[] = {};
|
||||
treatmentTime = 2.5;
|
||||
callbackSuccess = QUOTE(DFUNC(actionRemoveTourniquet));
|
||||
condition = QUOTE([ARR_2(_this select 1, _this select 2)] call EFUNC(medical,hasTourniquetAppliedTo));
|
||||
displayNameProgress = ECSTRING(medical,RemovingTourniquet);
|
||||
litter[] = {};
|
||||
};
|
||||
class CPR: fieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_CPR);
|
||||
displayNameProgress = ECSTRING(medical,Actions_PerformingCPR);
|
||||
category = "advanced";
|
||||
treatmentLocations[] = {"All"};
|
||||
allowedSelections[] = {"body"};
|
||||
allowSelfTreatment = 0;
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 15;
|
||||
items[] = {};
|
||||
condition = "!([(_this select 1)] call ace_common_fnc_isAwake)";
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "!([((_this select 0) select 1)] call ace_common_fnc_isAwake)";
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
|
||||
animationCaller = "AinvPknlMstpSlayWnonDnon_medic";
|
||||
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
|
||||
animationCallerSelf = "";
|
||||
animationCallerSelfProne = "";
|
||||
itemConsumed = 0;
|
||||
litter[] = {};
|
||||
};
|
||||
class BodyBag: fieldDressing {
|
||||
displayName = ECSTRING(medical,PlaceInBodyBag);
|
||||
displayNameProgress = ECSTRING(medical,PlacingInBodyBag);
|
||||
category = "advanced";
|
||||
treatmentLocations[] = {"All"};
|
||||
allowSelfTreatment = 0;
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 15;
|
||||
items[] = {"ACE_bodyBag"};
|
||||
condition = "!alive (_this select 1);";
|
||||
callbackSuccess = QUOTE(DFUNC(actionPlaceInBodyBag));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "";
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "";
|
||||
itemConsumed = 1;
|
||||
litter[] = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_Medical_Treatment {
|
||||
class Bandaging {
|
||||
// Field dressing is normal average treatment
|
405
addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
Normal file
405
addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
Normal file
@ -0,0 +1,405 @@
|
||||
|
||||
class ACE_Medical_Treatment_Actions {
|
||||
class Basic {
|
||||
class Bandage {
|
||||
displayName = ECSTRING(medical,Bandage);
|
||||
displayNameProgress = ECSTRING(medical,Bandaging);
|
||||
category = "bandage";
|
||||
treatmentLocations[] = {"All"};
|
||||
allowedSelections[] = {"All"};
|
||||
allowSelfTreatment = 1;
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 5;
|
||||
treatmentTimeSelfCoef = 1;
|
||||
items[] = {{"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_quikclot"}};
|
||||
condition = "";
|
||||
patientStateCondition = 0;
|
||||
itemConsumed = 1;
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_bandage));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "";
|
||||
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
|
||||
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
|
||||
animationCaller = "AinvPknlMstpSlayWrflDnon_medicOther";
|
||||
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
|
||||
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
|
||||
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
|
||||
litter[] = {
|
||||
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
|
||||
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
|
||||
};
|
||||
};
|
||||
class Morphine: Bandage {
|
||||
displayName = ECSTRING(medical,Inject_Morphine);
|
||||
displayNameProgress = ECSTRING(medical,Injecting_Morphine);
|
||||
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
|
||||
allowSelfTreatment = 1;
|
||||
category = "medication";
|
||||
treatmentTime = 2;
|
||||
items[] = {"ACE_morphine"};
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentBasic_morphine));
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} };
|
||||
};
|
||||
class Epinephrine: Bandage {
|
||||
displayName = ECSTRING(medical,Inject_Epinephrine);
|
||||
displayNameProgress = ECSTRING(medical,Injecting_Epinephrine);
|
||||
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
|
||||
allowSelfTreatment = 1;
|
||||
category = "medication";
|
||||
requiredMedic = QEGVAR(medical,medicSetting_basicEpi);
|
||||
treatmentTime = 3;
|
||||
items[] = {"ACE_epinephrine"};
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentBasic_epipen));
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} };
|
||||
treatmentLocations[] = {QGVAR(useLocation_basicEpi)};
|
||||
};
|
||||
class BloodIV: Bandage {
|
||||
displayName = ECSTRING(medical,Transfuse_Blood);
|
||||
displayNameProgress = ECSTRING(medical,Transfusing_Blood);
|
||||
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
|
||||
allowSelfTreatment = 0;
|
||||
category = "advanced";
|
||||
requiredMedic = 1;
|
||||
treatmentTime = 20;
|
||||
items[] = {"ACE_bloodIV"};
|
||||
// callbackSuccess = QUOTE(DFUNC(treatmentBasic_bloodbag));
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentIV));
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
litter[] = {};
|
||||
};
|
||||
class BloodIV_500: BloodIV {
|
||||
category = "advanced";
|
||||
items[] = {"ACE_bloodIV_500"};
|
||||
};
|
||||
class BloodIV_250: BloodIV {
|
||||
category = "advanced";
|
||||
items[] = {"ACE_bloodIV_250"};
|
||||
};
|
||||
class BodyBag: Bandage {
|
||||
displayName = ECSTRING(medical,PlaceInBodyBag);
|
||||
displayNameProgress = ECSTRING(medical,PlacingInBodyBag);
|
||||
category = "advanced";
|
||||
treatmentLocations[] = {"All"};
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 4;
|
||||
items[] = {"ACE_bodyBag"};
|
||||
condition = "!alive (_this select 1);";
|
||||
callbackSuccess = QUOTE(DFUNC(actionPlaceInBodyBag));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "";
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "";
|
||||
itemConsumed = 1;
|
||||
litter[] = {};
|
||||
};
|
||||
class Diagnose: Bandage {
|
||||
displayName = ECSTRING(medical,Actions_Diagnose);
|
||||
displayNameProgress = ECSTRING(medical,Actions_Diagnosing);
|
||||
category = "examine";
|
||||
treatmentLocations[] = {"All"};
|
||||
allowedSelections[] = {"head", "body"};
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 1;
|
||||
items[] = {};
|
||||
callbackSuccess = QUOTE(DFUNC(actionDiagnose));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "";
|
||||
animationPatient = "";
|
||||
animationCaller = ""; // TODO
|
||||
itemConsumed = 0;
|
||||
litter[] = {};
|
||||
};
|
||||
class CPR: Bandage {
|
||||
displayName = ECSTRING(medical,Actions_CPR);
|
||||
displayNameProgress = ECSTRING(medical,Actions_PerformingCPR);
|
||||
category = "advanced";
|
||||
treatmentLocations[] = {"All"};
|
||||
allowedSelections[] = {"body"};
|
||||
allowSelfTreatment = 0;
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 15;
|
||||
items[] = {};
|
||||
condition = QUOTE(!([(_this select 1)] call ace_common_fnc_isAwake) && EGVAR(medical,enableRevive)>0);
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "!([((_this select 0) select 1)] call ace_common_fnc_isAwake)";
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
|
||||
animationCaller = "AinvPknlMstpSlayWnonDnon_medic";
|
||||
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
|
||||
animationCallerSelf = "";
|
||||
animationCallerSelfProne = "";
|
||||
itemConsumed = 0;
|
||||
litter[] = {};
|
||||
};
|
||||
};
|
||||
|
||||
class Advanced {
|
||||
class FieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_FieldDressing);
|
||||
displayNameProgress = ECSTRING(medical,Bandaging);
|
||||
category = "bandage";
|
||||
// Which locations can this treatment action be used? Available: Field, MedicalFacility, MedicalVehicle, All.
|
||||
treatmentLocations[] = {"All"};
|
||||
allowedSelections[] = {"All"};
|
||||
allowSelfTreatment = 1;
|
||||
// What is the level of medical skill required for this treatment action? 0 = all soldiers, 1 = medic, 2 = doctor
|
||||
requiredMedic = 0;
|
||||
// The time it takes for a treatment action to complete. Time is in seconds.
|
||||
treatmentTime = 8;
|
||||
// Item required for the action. Leave empty for no item required.
|
||||
items[] = {"ACE_fieldDressing"};
|
||||
condition = "";
|
||||
patientStateCondition = 0;
|
||||
// Callbacks
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_bandage));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "";
|
||||
itemConsumed = 1;
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
|
||||
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
|
||||
animationCaller = "AinvPknlMstpSlayWrflDnon_medicOther";
|
||||
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
|
||||
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
|
||||
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
|
||||
litter[] = {
|
||||
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
|
||||
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
|
||||
};
|
||||
};
|
||||
class PackingBandage: fieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_PackingBandage);
|
||||
items[] = {"ACE_packingBandage"};
|
||||
litter[] = {
|
||||
{"All", "", {"ACE_MedicalLitter_packingBandage"}},
|
||||
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
|
||||
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
|
||||
};
|
||||
};
|
||||
class ElasticBandage: fieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_ElasticBandage);
|
||||
items[] = {"ACE_elasticBandage"};
|
||||
};
|
||||
class QuikClot: fieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_QuikClot);
|
||||
items[] = {"ACE_quikclot"};
|
||||
litter[] = {
|
||||
{"All", "", {"ACE_MedicalLitter_QuickClot"}},
|
||||
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
|
||||
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
|
||||
};
|
||||
};
|
||||
class Tourniquet: fieldDressing {
|
||||
displayName = ECSTRING(medical,Apply_Tourniquet);
|
||||
displayNameProgress = ECSTRING(medical,Applying_Tourniquet);
|
||||
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
|
||||
items[] = {"ACE_tourniquet"};
|
||||
treatmentTime = 4;
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentTourniquet));
|
||||
condition = QUOTE(!([ARR_2(_this select 1, _this select 2)] call EFUNC(medical,hasTourniquetAppliedTo)));
|
||||
litter[] = {};
|
||||
};
|
||||
class Morphine: fieldDressing {
|
||||
displayName = ECSTRING(medical,Inject_Morphine);
|
||||
displayNameProgress = ECSTRING(medical,Injecting_Morphine);
|
||||
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
|
||||
category = "medication";
|
||||
items[] = {"ACE_morphine"};
|
||||
treatmentTime = 3;
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_medication));
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} };
|
||||
};
|
||||
class Adenosine: Morphine {
|
||||
displayName = ECSTRING(medical,Inject_Adenosine);
|
||||
displayNameProgress = ECSTRING(medical,Injecting_Adenosine);
|
||||
items[] = {"ACE_adenosine"};
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_adenosine"}} };
|
||||
};
|
||||
class Atropine: Morphine {
|
||||
displayName = ECSTRING(medical,Inject_Atropine);
|
||||
displayNameProgress = ECSTRING(medical,Injecting_Atropine);
|
||||
items[] = {"ACE_atropine"};
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_atropine"}} };
|
||||
};
|
||||
class Epinephrine: Morphine {
|
||||
displayName = ECSTRING(medical,Inject_Epinephrine);
|
||||
displayNameProgress = ECSTRING(medical,Injecting_Epinephrine);
|
||||
items[] = {"ACE_epinephrine"};
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} };
|
||||
};
|
||||
class BloodIV: fieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_Blood4_1000);
|
||||
displayNameProgress = ECSTRING(medical,Transfusing_Blood);
|
||||
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
|
||||
allowSelfTreatment = 0;
|
||||
category = "advanced";
|
||||
items[] = {"ACE_bloodIV"};
|
||||
requiredMedic = 1;
|
||||
treatmentTime = 7;
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentIV));
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
litter[] = {};
|
||||
};
|
||||
class BloodIV_500: BloodIV {
|
||||
displayName = ECSTRING(medical,Actions_Blood4_500);
|
||||
items[] = {"ACE_bloodIV_500"};
|
||||
};
|
||||
class BloodIV_250: BloodIV {
|
||||
displayName = ECSTRING(medical,Actions_Blood4_250);
|
||||
items[] = {"ACE_bloodIV_250"};
|
||||
};
|
||||
class PlasmaIV: BloodIV {
|
||||
displayName = ECSTRING(medical,Actions_Plasma4_1000);
|
||||
displayNameProgress = ECSTRING(medical,Transfusing_Plasma);
|
||||
items[] = {"ACE_plasmaIV"};
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
};
|
||||
class PlasmaIV_500: PlasmaIV {
|
||||
displayName = ECSTRING(medical,Actions_Plasma4_500);
|
||||
items[] = {"ACE_plasmaIV_500"};
|
||||
};
|
||||
class PlasmaIV_250: PlasmaIV {
|
||||
displayName = ECSTRING(medical,Actions_Plasma4_250);
|
||||
items[] = {"ACE_plasmaIV_250"};
|
||||
};
|
||||
class SalineIV: BloodIV {
|
||||
displayName = ECSTRING(medical,Actions_Saline4_1000);
|
||||
displayNameProgress = ECSTRING(medical,Transfusing_Saline);
|
||||
items[] = {"ACE_salineIV"};
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
};
|
||||
class SalineIV_500: SalineIV {
|
||||
displayName = ECSTRING(medical,Actions_Saline4_500);
|
||||
items[] = {"ACE_salineIV_500"};
|
||||
};
|
||||
class SalineIV_250: SalineIV {
|
||||
displayName = ECSTRING(medical,Actions_Saline4_250);
|
||||
items[] = {"ACE_salineIV_250"};
|
||||
};
|
||||
class SurgicalKit: fieldDressing {
|
||||
displayName = ECSTRING(medical,Use_SurgicalKit);
|
||||
displayNameProgress = ECSTRING(medical,Stitching);
|
||||
category = "advanced";
|
||||
items[] = {"ACE_surgicalKit"};
|
||||
treatmentLocations[] = {QEGVAR(medical,useLocation_SurgicalKit)};
|
||||
allowSelfTreatment = 0;
|
||||
requiredMedic = QEGVAR(medical,medicSetting_SurgicalKit);
|
||||
patientStateCondition = QEGVAR(medical,useCondition_SurgicalKit);
|
||||
treatmentTime = "(count ((_this select 1) getVariable ['ACE_Medical_bandagedWounds', []]) * 5)";
|
||||
callbackSuccess = "";
|
||||
callbackProgress = QUOTE(DFUNC(treatmentAdvanced_surgicalKit_onProgress));
|
||||
itemConsumed = QEGVAR(medical,consumeItem_SurgicalKit);
|
||||
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"} }};
|
||||
};
|
||||
class PersonalAidKit: fieldDressing {
|
||||
displayName = ECSTRING(medical,Use_Aid_Kit);
|
||||
displayNameProgress = ECSTRING(medical,TreatmentAction);
|
||||
category = "advanced";
|
||||
items[] = {"ACE_personalAidKit"};
|
||||
treatmentLocations[] = {QEGVAR(medical,useLocation_PAK)};
|
||||
allowSelfTreatment = 0;
|
||||
requiredMedic = QEGVAR(medical,medicSetting_PAK);
|
||||
patientStateCondition = QEGVAR(medical,useCondition_PAK);
|
||||
treatmentTime = QUOTE((_this select 1) call FUNC(treatmentAdvanced_fullHealTreatmentTime));
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal));
|
||||
itemConsumed = QEGVAR(medical,consumeItem_PAK);
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
|
||||
animationCaller = "AinvPknlMstpSlayWnonDnon_medicOther";
|
||||
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
|
||||
animationCallerSelf = "";
|
||||
animationCallerSelfProne = "";
|
||||
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}},
|
||||
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
|
||||
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
|
||||
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
|
||||
};
|
||||
};
|
||||
class CheckPulse: fieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_CheckPulse);
|
||||
displayNameProgress = ECSTRING(medical,Check_Pulse_Content);
|
||||
category = "examine";
|
||||
treatmentLocations[] = {"All"};
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 2;
|
||||
items[] = {};
|
||||
callbackSuccess = QUOTE(DFUNC(actionCheckPulse));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "";
|
||||
animationPatient = "";
|
||||
animationCaller = ""; // TODO
|
||||
animationCallerProne = "";
|
||||
animationCallerSelfProne = "";
|
||||
itemConsumed = 0;
|
||||
litter[] = {};
|
||||
};
|
||||
class CheckBloodPressure: CheckPulse {
|
||||
displayName = ECSTRING(medical,Actions_CheckBloodPressure);
|
||||
callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure));
|
||||
displayNameProgress = ECSTRING(medical,Check_Bloodpressure_Content);
|
||||
};
|
||||
class CheckResponse: CheckPulse {
|
||||
displayName = ECSTRING(medical,Check_Response);
|
||||
callbackSuccess = QUOTE(DFUNC(actionCheckResponse));
|
||||
displayNameProgress = ECSTRING(medical,Check_Response_Content);
|
||||
allowSelfTreatment = 0;
|
||||
};
|
||||
class RemoveTourniquet: Tourniquet {
|
||||
displayName = ECSTRING(medical,Actions_RemoveTourniquet);
|
||||
items[] = {};
|
||||
treatmentTime = 2.5;
|
||||
callbackSuccess = QUOTE(DFUNC(actionRemoveTourniquet));
|
||||
condition = QUOTE([ARR_2(_this select 1, _this select 2)] call EFUNC(medical,hasTourniquetAppliedTo));
|
||||
displayNameProgress = ECSTRING(medical,RemovingTourniquet);
|
||||
litter[] = {};
|
||||
};
|
||||
class CPR: fieldDressing {
|
||||
displayName = ECSTRING(medical,Actions_CPR);
|
||||
displayNameProgress = ECSTRING(medical,Actions_PerformingCPR);
|
||||
category = "advanced";
|
||||
treatmentLocations[] = {"All"};
|
||||
allowedSelections[] = {"body"};
|
||||
allowSelfTreatment = 0;
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 15;
|
||||
items[] = {};
|
||||
condition = "!([(_this select 1)] call ace_common_fnc_isAwake)";
|
||||
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "!([((_this select 0) select 1)] call ace_common_fnc_isAwake)";
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
|
||||
animationCaller = "AinvPknlMstpSlayWnonDnon_medic";
|
||||
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
|
||||
animationCallerSelf = "";
|
||||
animationCallerSelfProne = "";
|
||||
itemConsumed = 0;
|
||||
litter[] = {};
|
||||
};
|
||||
class BodyBag: fieldDressing {
|
||||
displayName = ECSTRING(medical,PlaceInBodyBag);
|
||||
displayNameProgress = ECSTRING(medical,PlacingInBodyBag);
|
||||
category = "advanced";
|
||||
treatmentLocations[] = {"All"};
|
||||
allowSelfTreatment = 0;
|
||||
requiredMedic = 0;
|
||||
treatmentTime = 15;
|
||||
items[] = {"ACE_bodyBag"};
|
||||
condition = "!alive (_this select 1);";
|
||||
callbackSuccess = QUOTE(DFUNC(actionPlaceInBodyBag));
|
||||
callbackFailure = "";
|
||||
callbackProgress = "";
|
||||
animationPatient = "";
|
||||
animationPatientUnconscious = "";
|
||||
itemConsumed = 1;
|
||||
litter[] = {};
|
||||
};
|
||||
};
|
||||
};
|
@ -9,3 +9,9 @@ class Extended_PreInit_EventHandlers {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
@ -50,3 +50,5 @@ PREP(treatment_failure);
|
||||
PREP(treatment_success);
|
||||
PREP(useItem);
|
||||
PREP(useItems);
|
||||
|
||||
PREP(checkItems);
|
||||
|
7
addons/medical_treatment/XEH_postInit.sqf
Normal file
7
addons/medical_treatment/XEH_postInit.sqf
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
[QEGVAR(medical,initialized), {
|
||||
params ["_unit"];
|
||||
_unit call FUNC(checkItems);
|
||||
}] call CBA_fnc_addEventHandler;
|
@ -15,3 +15,5 @@ class CfgPatches {
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "ACE_Medical_Treatment.hpp"
|
||||
#include "ACE_Medical_Treatment_Actions.hpp"
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 0: The caller <OBJECT>
|
||||
* 1: The target <OBJECT>
|
||||
* 2: Selection name <STRING>
|
||||
* 3: ACE_Medical_Treatments Classname <STRING>
|
||||
* 3: ACE_Medical_Treatment Classname <STRING>
|
||||
*
|
||||
* ReturnValue:
|
||||
* Can Treat <BOOL>
|
||||
@ -23,7 +23,7 @@ params ["_caller", "_target", "_selectionName", "_className"];
|
||||
|
||||
if !(_target isKindOf "CAManBase") exitWith { false };
|
||||
|
||||
private _config = (ConfigFile >> "ACE_Medical_Treatments" >> (["Basic", "Advanced"] select (GVAR(level)>=2)) >> _className);
|
||||
private _config = (ConfigFile >> "ACE_Medical_Treatment" >> (["Basic", "Advanced"] select (GVAR(level)>=2)) >> _className);
|
||||
|
||||
if !(isClass _config) exitwith {false};
|
||||
|
||||
@ -39,7 +39,7 @@ private _medicRequired = if (isNumber (_config >> "requiredMedic")) then {
|
||||
};
|
||||
0;
|
||||
};
|
||||
if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith { false };
|
||||
if !([_caller, _medicRequired] call EFUNC(medical,isMedic)) exitwith { false };
|
||||
|
||||
private _items = getArray (_config >> "items");
|
||||
if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith { false };
|
||||
@ -68,7 +68,7 @@ private _patientStateCondition = if (isText(_config >> "patientStateCondition"))
|
||||
} else {
|
||||
getNumber(_config >> "patientStateCondition")
|
||||
};
|
||||
if (_patientStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false};
|
||||
if (_patientStateCondition == 1 && {!([_target] call EFUNC(medical,isInStableCondition))}) exitwith {false};
|
||||
|
||||
private _locations = getArray (_config >> "treatmentLocations");
|
||||
if ("All" in _locations) exitwith { true };
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 0: The caller <OBJECT>
|
||||
* 1: The target <OBJECT>
|
||||
* 2: Selection name <STRING>
|
||||
* 3: ACE_Medical_Treatments Classname <STRING>
|
||||
* 3: ACE_Medical_Treatment Classname <STRING>
|
||||
*
|
||||
* ReturnValue:
|
||||
* Can Treat <BOOL>
|
||||
|
50
addons/medical_treatment/functions/fnc_checkItems.sqf
Normal file
50
addons/medical_treatment/functions/fnc_checkItems.sqf
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi
|
||||
* Replaces vanilla items with ACE ones.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The unit <OBJECT>
|
||||
*
|
||||
* ReturnValue:
|
||||
* None
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
while {({_x == "FirstAidKit"} count items _unit) > 0} do {
|
||||
_unit removeItem "FirstAidKit";
|
||||
if (GVAR(level) >= 2) then {
|
||||
_unit addItem "ACE_fieldDressing";
|
||||
_unit addItem "ACE_packingBandage";
|
||||
_unit addItem "ACE_morphine";
|
||||
_unit addItem "ACE_tourniquet";
|
||||
} else {
|
||||
_unit addItem "ACE_fieldDressing";
|
||||
_unit addItem "ACE_fieldDressing";
|
||||
_unit addItem "ACE_morphine";
|
||||
};
|
||||
};
|
||||
|
||||
while {({_x == "Medikit"} count items _unit) > 0} do {
|
||||
_unit removeItem "Medikit";
|
||||
if (GVAR(level) >= 2) then {
|
||||
_unit addItemToBackpack "ACE_fieldDressing";
|
||||
_unit addItemToBackpack "ACE_packingBandage";
|
||||
_unit addItemToBackpack "ACE_packingBandage";
|
||||
_unit addItemToBackpack "ACE_epinephrine";
|
||||
_unit addItemToBackpack "ACE_morphine";
|
||||
_unit addItemToBackpack "ACE_salineIV_250";
|
||||
_unit addItemToBackpack "ACE_tourniquet";
|
||||
} else {
|
||||
_unit addItemToBackpack "ACE_epinephrine";
|
||||
_unit addItemToBackpack "ACE_epinephrine";
|
||||
_unit addItemToBackpack "ACE_epinephrine";
|
||||
_unit addItemToBackpack "ACE_epinephrine";
|
||||
_unit addItemToBackpack "ACE_bloodIV";
|
||||
_unit addItemToBackpack "ACE_bloodIV";
|
||||
};
|
||||
};
|
@ -25,9 +25,9 @@ if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exit
|
||||
|
||||
if !(_target isKindOf "CAManBase") exitWith {false};
|
||||
|
||||
private _config = (configFile >> "ACE_Medical_Treatments" >> "Basic" >> _className);
|
||||
private _config = (configFile >> "ACE_Medical_Treatment" >> "Basic" >> _className);
|
||||
if (GVAR(level) >= 2) then {
|
||||
_config = (configFile >> "ACE_Medical_Treatments" >> "Advanced" >> _className);
|
||||
_config = (configFile >> "ACE_Medical_Treatment" >> "Advanced" >> _className);
|
||||
};
|
||||
|
||||
if !(isClass _config) exitwith {false};
|
||||
@ -45,7 +45,7 @@ private _medicRequired = if (isNumber (_config >> "requiredMedic")) then {
|
||||
0;
|
||||
};
|
||||
|
||||
if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false};
|
||||
if !([_caller, _medicRequired] call EFUNC(medical,isMedic)) exitwith {false};
|
||||
|
||||
private _allowedSelections = getArray (_config >> "allowedSelections");
|
||||
if !("All" in _allowedSelections || {(_selectionName in _allowedSelections)}) exitwith {false};
|
||||
@ -77,7 +77,7 @@ private _patientStateCondition = if (isText(_config >> "patientStateCondition"))
|
||||
} else {
|
||||
getNumber(_config >> "patientStateCondition")
|
||||
};
|
||||
if (_patientStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false};
|
||||
if (_patientStateCondition == 1 && {!([_target] call EFUNC(medical,isInStableCondition))}) exitwith {false};
|
||||
|
||||
// Check allowed locations
|
||||
private _locations = getArray (_config >> "treatmentLocations");
|
||||
@ -136,7 +136,7 @@ if (isNil _callbackProgress) then {
|
||||
|
||||
// Patient Animation
|
||||
private _patientAnim = getText (_config >> "animationPatient");
|
||||
if (_target getVariable ["ACE_isUnconscious", false] && GVAR(allowUnconsciousAnimationOnTreatment)) then {
|
||||
if (_target getVariable ["ACE_isUnconscious", false] && EGVAR(medical,allowUnconsciousAnimationOnTreatment)) then {
|
||||
if !(animationState _target in (getArray (_config >> "animationPatientUnconsciousExcludeOn"))) then {
|
||||
_patientAnim = getText (_config >> "animationPatientUnconscious");
|
||||
};
|
||||
|
@ -57,9 +57,9 @@ if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "")
|
||||
} forEach _usersOfItems;
|
||||
|
||||
// Record specific callback
|
||||
private _config = (configFile >> "ACE_Medical_Treatments" >> "Basic" >> _className);
|
||||
private _config = (configFile >> "ACE_Medical_Treatment" >> "Basic" >> _className);
|
||||
if (GVAR(level) >= 2) then {
|
||||
_config = (configFile >> "ACE_Medical_Treatments" >> "Advanced" >> _className);
|
||||
_config = (configFile >> "ACE_Medical_Treatment" >> "Advanced" >> _className);
|
||||
};
|
||||
|
||||
private _callback = getText (_config >> "callbackFailure");
|
||||
|
@ -52,9 +52,9 @@ if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "")
|
||||
};
|
||||
|
||||
// Record specific callback
|
||||
private _config = (configFile >> "ACE_Medical_Treatments" >> "Basic" >> _className);
|
||||
private _config = (configFile >> "ACE_Medical_Treatment" >> "Basic" >> _className);
|
||||
if (GVAR(level) >= 2) then {
|
||||
_config = (configFile >> "ACE_Medical_Treatments" >> "Advanced" >> _className);
|
||||
_config = (configFile >> "ACE_Medical_Treatment" >> "Advanced" >> _className);
|
||||
};
|
||||
|
||||
private _callback = getText (_config >> "callbackSuccess");
|
||||
|
Loading…
Reference in New Issue
Block a user