mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Replace execRemoteFnc in ace_medical
This commit is contained in:
parent
c456e1a631
commit
88eae19646
@ -476,6 +476,8 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
|
|||||||
};
|
};
|
||||||
}] call FUNC(addEventhandler);
|
}] call FUNC(addEventhandler);
|
||||||
|
|
||||||
|
["useItem", DFUNC(useItem)] call FUNC(addEventHandler);
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
// Add various canInteractWith conditions
|
// Add various canInteractWith conditions
|
||||||
|
@ -12,7 +12,23 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"];
|
|||||||
|
|
||||||
//Treatment EventHandlers:
|
//Treatment EventHandlers:
|
||||||
["medical_advMedication", FUNC(treatmentAdvanced_medicationLocal)] call EFUNC(common,addEventHandler);
|
["medical_advMedication", FUNC(treatmentAdvanced_medicationLocal)] call EFUNC(common,addEventHandler);
|
||||||
|
["actionCheckBloodPressureLocal", DFUNC(actionCheckBloodPressureLocal)] call EFUNC(common,addEventHandler);
|
||||||
|
["actionCheckPulseLocal", DFUNC(actionCheckPulseLocal)] call EFUNC(common,addEventHandler);
|
||||||
|
["addToInjuredCollection", DFUNC(addToInjuredCollection)] call EFUNC(common,addEventHandler);
|
||||||
|
["addToMedicalLog", DFUNC(addToLog)] call EFUNC(common,addEventHandler);
|
||||||
|
["addToTriageList", DFUNC(addToTriageList)] call EFUNC(common,addEventHandler);
|
||||||
|
["setDead", DFUNC(setDead)] call EFUNC(common,addEventHandler);
|
||||||
|
["setHitPointDamage", DFUNC(setHitPointDamage)] call EFUNC(common,addEventHandler);
|
||||||
|
["setUnconscious", DFUNC(setUnconscious)] call EFUNC(common,addEventHandler);
|
||||||
|
["treatmentAdvanced_bandageLocal", DFUNC(treatmentAdvanced_bandageLocal)] call EFUNC(common,addEventHandler);
|
||||||
|
["treatmentAdvanced_CPRLocal", DFUNC(treatmentAdvanced_CPRLocal)] call EFUNC(common,addEventHandler);
|
||||||
|
["treatmentAdvanced_fullHealLocal", DFUNC(treatmentAdvanced_fullHealLocal)] call EFUNC(common,addEventHandler);
|
||||||
|
["treatmentAdvanced_medicationLocal", DFUNC(treatmentAdvanced_medicationLocal)] call EFUNC(common,addEventHandler);
|
||||||
|
["treatmentBasic_bandageLocal", DFUNC(treatmentBasic_bandageLocal)] call EFUNC(common,addEventHandler);
|
||||||
|
["treatmentBasic_bloodbagLocal", DFUNC(treatmentBasic_bloodbagLocal)] call EFUNC(common,addEventHandler);
|
||||||
|
["treatmentBasic_morphineLocal", DFUNC(treatmentBasic_morphineLocal)] call EFUNC(common,addEventHandler);
|
||||||
|
["treatmentIVLocal", DFUNC(treatmentIVLocal)] call EFUNC(common,addEventHandler);
|
||||||
|
["treatmentTourniquetLocal", DFUNC(treatmentTourniquetLocal)] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
["medical_onUnconscious", {
|
["medical_onUnconscious", {
|
||||||
params ["_unit", "_status"];
|
params ["_unit", "_status"];
|
||||||
|
@ -15,4 +15,8 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_caller", "_target", "_selectionName"];
|
params ["_caller", "_target", "_selectionName"];
|
||||||
[[_caller, _target, _selectionName], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
if (local _target) then {
|
||||||
|
["actionCheckBloodPressureLocal", [_caller, _target, _selectionName]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["actionCheckBloodPressureLocal", _target, [_caller, _target, _selectionName]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
|
@ -15,5 +15,8 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_caller","_target", "_selectionName"];
|
params ["_caller","_target", "_selectionName"];
|
||||||
[[_caller, _target, _selectionName], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
if (local _target) then {
|
||||||
|
["actionCheckPulseLocal", [_caller, _target, _selectionName]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["actionCheckPulseLocal", _target, [_caller, _target, _selectionName]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
|
@ -18,7 +18,7 @@ params ["_unit", ["_force", false]];
|
|||||||
if ([_unit] call FUNC(hasMedicalEnabled) || _force) then {
|
if ([_unit] call FUNC(hasMedicalEnabled) || _force) then {
|
||||||
|
|
||||||
if !(local _unit) exitWith {
|
if !(local _unit) exitWith {
|
||||||
[[_unit, _force], QUOTE(DFUNC(addToInjuredCollection)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
["addToInjuredCollection", _unit, [_unit, _force]] call EFUNC(common,targetEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((_unit getVariable[QGVAR(addedToUnitLoop),false] || !alive _unit) && !_force) exitWith{};
|
if ((_unit getVariable[QGVAR(addedToUnitLoop),false] || !alive _unit) && !_force) exitWith{};
|
||||||
|
@ -20,7 +20,7 @@ private ["_moment", "_logVarName", "_log","_newLog", "_logs"];
|
|||||||
params ["_unit", "_type", "_message", "_arguments"];
|
params ["_unit", "_type", "_message", "_arguments"];
|
||||||
|
|
||||||
if (!local _unit) exitWith {
|
if (!local _unit) exitWith {
|
||||||
[_this, QFUNC(addToLog), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
["addToMedicalLog", _unit, _this] call EFUNC(common,targetEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
date params ["", "", "", "_hour", "_minute"];
|
date params ["", "", "", "_hour", "_minute"];
|
||||||
|
@ -18,7 +18,7 @@ private ["_log", "_inList", "_amount"];
|
|||||||
params ["_unit", "_newItem"];
|
params ["_unit", "_newItem"];
|
||||||
|
|
||||||
if (!local _unit) exitWith {
|
if (!local _unit) exitWith {
|
||||||
[_this, QUOTE(DFUNC(addToTriageCard)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
["addToTriageList", _unit, _this] call EFUNC(common,targetEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
_log = _unit getVariable [QGVAR(triageCard), []];
|
_log = _unit getVariable [QGVAR(triageCard), []];
|
||||||
|
@ -20,7 +20,7 @@ params ["_unit", ["_force", false], ["_delaySetDamage", false]];
|
|||||||
|
|
||||||
if ((!alive _unit) || {_unit getVariable ["ACE_isDead", false]}) exitWith {true};
|
if ((!alive _unit) || {_unit getVariable ["ACE_isDead", false]}) exitWith {true};
|
||||||
if (!local _unit) exitwith {
|
if (!local _unit) exitwith {
|
||||||
[[_unit, _force], QUOTE(DFUNC(setDead)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
["setDead", _unit, [_unit, _force]] call EFUNC(common,targetEvent);
|
||||||
false;
|
false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ params ["_unit", "_selection", "_damage", ["_disabled", false]];
|
|||||||
|
|
||||||
// Unit isn't local, give function to machine where it is.
|
// Unit isn't local, give function to machine where it is.
|
||||||
if !(local _unit) exitWith {
|
if !(local _unit) exitWith {
|
||||||
[_this, QUOTE(DFUNC(setHitPointDamage)), _unit] call EFUNC(common,execRemoteFnc);
|
["setHitPointDamage", _unit, _this] call EFUNC(common,targetEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Check if overall damage adjustment is disabled
|
// Check if overall damage adjustment is disabled
|
||||||
|
@ -39,7 +39,7 @@ if !(_set) exitWith {
|
|||||||
if !(!(isNull _unit) && {(_unit isKindOf "CAManBase") && ([_unit] call EFUNC(common,isAwake))}) exitWith{};
|
if !(!(isNull _unit) && {(_unit isKindOf "CAManBase") && ([_unit] call EFUNC(common,isAwake))}) exitWith{};
|
||||||
|
|
||||||
if (!local _unit) exitWith {
|
if (!local _unit) exitWith {
|
||||||
[[_unit, _set, _minWaitingTime, _force], QUOTE(DFUNC(setUnconscious)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
["setUnconscious", _unit, [_unit, _set, _minWaitingTime, _force]] call EFUNC(common,targetEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
_unit setVariable ["ACE_isUnconscious", true, true];
|
_unit setVariable ["ACE_isUnconscious", true, true];
|
||||||
|
@ -19,6 +19,10 @@
|
|||||||
params ["_caller", "_target", "_selectionName", "_className", "_items"];
|
params ["_caller", "_target", "_selectionName", "_className", "_items"];
|
||||||
|
|
||||||
if (alive _target && {(_target getVariable [QGVAR(inCardiacArrest), false] || _target getVariable [QGVAR(inReviveState), false])}) then {
|
if (alive _target && {(_target getVariable [QGVAR(inCardiacArrest), false] || _target getVariable [QGVAR(inReviveState), false])}) then {
|
||||||
[[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_CPRLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
if (local _target) then {
|
||||||
|
["treatmentAdvanced_CPRLocal", [_caller, _target]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["treatmentAdvanced_CPRLocal", _target, [_caller, _target]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
true;
|
true;
|
||||||
|
@ -26,7 +26,12 @@ if !([_target] call FUNC(hasMedicalEnabled)) exitWith {
|
|||||||
_this call FUNC(treatmentBasic_bandage);
|
_this call FUNC(treatmentBasic_bandage);
|
||||||
};
|
};
|
||||||
|
|
||||||
[[_target, _className, _selectionName, _specificSpot], QUOTE(DFUNC(treatmentAdvanced_bandageLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
if (local _target) then {
|
||||||
|
["treatmentAdvanced_bandageLocal", [_target, _className, _selectionName, _specificSpot]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["treatmentAdvanced_bandageLocal", _target, [_target, _className, _selectionName, _specificSpot]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
|
|
||||||
/* {
|
/* {
|
||||||
if (_x != "") then {
|
if (_x != "") then {
|
||||||
[_target, _x] call FUNC(addToTriageCard);
|
[_target, _x] call FUNC(addToTriageCard);
|
||||||
|
@ -12,7 +12,10 @@
|
|||||||
|
|
||||||
params ["_caller", "_target", "_selectionName", "_className", "_items"];
|
params ["_caller", "_target", "_selectionName", "_className", "_items"];
|
||||||
|
|
||||||
// TODO replace by event system
|
if (local _target) then {
|
||||||
[[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_fullHealLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
["treatmentAdvanced_fullHealLocal", [_caller, _target]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["treatmentAdvanced_fullHealLocal", _target, [_caller, _target]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
|
|
||||||
true;
|
true;
|
||||||
|
@ -20,4 +20,8 @@
|
|||||||
private ["_hitSelections", "_hitPoints", "_point", "_damage"];
|
private ["_hitSelections", "_hitPoints", "_point", "_damage"];
|
||||||
params ["_caller", "_target", "_selection", "_className"];
|
params ["_caller", "_target", "_selection", "_className"];
|
||||||
|
|
||||||
[[_target, _selection], QUOTE(DFUNC(treatmentBasic_bandageLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
if (local _target) then {
|
||||||
|
["treatmentBasic_bandageLocal", [_target, _selection]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["treatmentBasic_bandageLocal", _target, [_target, _selection]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
|
@ -18,4 +18,8 @@
|
|||||||
|
|
||||||
params ["_caller", "_target", "_treatmentClassname"];
|
params ["_caller", "_target", "_treatmentClassname"];
|
||||||
|
|
||||||
[[_target, _treatmentClassname], QUOTE(DFUNC(treatmentBasic_bloodbagLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
if (local _target) then {
|
||||||
|
["treatmentBasic_bloodbagLocal", [_target, _treatmentClassname]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["treatmentBasic_bloodbagLocal", _target, [_target, _treatmentClassname]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
|
@ -19,4 +19,8 @@
|
|||||||
|
|
||||||
params ["_caller", "_target"];
|
params ["_caller", "_target"];
|
||||||
|
|
||||||
[[_target], QUOTE(DFUNC(treatmentBasic_morphineLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
if (local _target) then {
|
||||||
|
["treatmentBasic_morphineLocal", [_target]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["treatmentBasic_morphineLocal", _target, [_target]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
|
@ -22,7 +22,12 @@ params ["_caller", "_target", "_selectionName", "_className", "_items"];
|
|||||||
if (count _items == 0) exitWith {false};
|
if (count _items == 0) exitWith {false};
|
||||||
|
|
||||||
_removeItem = _items select 0;
|
_removeItem = _items select 0;
|
||||||
[[_target, _className], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
if (local _target) then {
|
||||||
|
["treatmentIVLocal", [_target, _className]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["treatmentIVLocal", _target, [_target, _className]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
|
|
||||||
[_target, _removeItem] call FUNC(addToTriageCard);
|
[_target, _removeItem] call FUNC(addToTriageCard);
|
||||||
[_target, "activity", LSTRING(Activity_gaveIV), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
|
[_target, "activity", LSTRING(Activity_gaveIV), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
|
||||||
[_target, "activity_view", LSTRING(Activity_gaveIV), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
|
[_target, "activity_view", LSTRING(Activity_gaveIV), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
|
||||||
|
@ -40,7 +40,11 @@ if ((_tourniquets select _part) > 0) exitWith {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_removeItem = _items select 0;
|
_removeItem = _items select 0;
|
||||||
[[_target, _removeItem, _selectionName], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
if (local _target) then {
|
||||||
|
["treatmentTourniquetLocal", [_target, _removeItem, _selectionName]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["treatmentTourniquetLocal", _target, [_target, _removeItem, _selectionName]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
|
|
||||||
[_target, _removeItem] call FUNC(addToTriageCard);
|
[_target, _removeItem] call FUNC(addToTriageCard);
|
||||||
[_target, "activity", LSTRING(Activity_appliedTourniquet), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
|
[_target, "activity", LSTRING(Activity_appliedTourniquet), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
|
||||||
|
@ -24,12 +24,20 @@ if (isNil QGVAR(setting_allowSharedEquipment)) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitWith {
|
if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitWith {
|
||||||
[[_patient, _item], QUOTE(EFUNC(common,useItem)), _patient] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
if (local _patient) then {
|
||||||
|
["useItem", [_patient, _item]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["useItem", _patient, [_patient, _item]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
[true, _patient];
|
[true, _patient];
|
||||||
};
|
};
|
||||||
|
|
||||||
if ([_medic, _item] call EFUNC(common,hasItem)) exitWith {
|
if ([_medic, _item] call EFUNC(common,hasItem)) exitWith {
|
||||||
[[_medic, _item], QUOTE(EFUNC(common,useItem)), _medic] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
if (local _medic) then {
|
||||||
|
["useItem", [_medic, _item]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["useItem", _medic, [_medic, _item]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
[true, _medic];
|
[true, _medic];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -39,7 +47,11 @@ if ([vehicle _medic] call FUNC(isMedicalVehicle) && {vehicle _medic != _medic})
|
|||||||
{
|
{
|
||||||
if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitWith {
|
if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitWith {
|
||||||
_return = [true, _x];
|
_return = [true, _x];
|
||||||
[[_x, _item], QUOTE(EFUNC(common,useItem)), _x] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
if (local _x) then {
|
||||||
|
["useItem", [_x, _item]] call EFUNC(common,localEvent);
|
||||||
|
} else {
|
||||||
|
["useItem", _x, [_x, _item]] call EFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
} forEach _crew;
|
} forEach _crew;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user