mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fix medical events
This commit is contained in:
parent
fa2cf55156
commit
694503c01b
@ -32,7 +32,7 @@ if (isServer) then {
|
||||
[QGVAR(setSurrendered), {_this call FUNC(setSurrendered)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
//Medical Integration Events
|
||||
[QEGVAR(medical,unconscious), {_this call ACE_Captives_fnc_handleOnUnconscious}] call CBA_fnc_addEventHandler;
|
||||
["ace_unconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call CBA_fnc_addEventHandler;
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
|
@ -22,7 +22,7 @@ class CfgPatches {
|
||||
|
||||
class ACE_newEvents {
|
||||
SettingsInitialized = "ace_settingsInitialized";
|
||||
medical_onUnconscious = QEGVAR(medical,unconscious);
|
||||
medical_onUnconscious = "ace_unconscious";
|
||||
SetSurrendered = QGVAR(setSurrendered);
|
||||
SetHandcuffed = QGVAR(setHandcuffed);
|
||||
MoveOutCaptive = QGVAR(moveOutCaptive);
|
||||
|
@ -21,7 +21,7 @@
|
||||
["ace_setStatusEffect", {_this call FUNC(statusEffect_set)}] call CBA_fnc_addEventHandler;
|
||||
["forceWalk", false, ["ACE_SwitchUnits", "ACE_Attach", "ACE_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_Sandbag", "ACE_refuel", "ACE_rearm", "ACE_dragging"]] call FUNC(statusEffect_addType);
|
||||
["blockSprint", false, []] call FUNC(statusEffect_addType);
|
||||
["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), QEGVAR(medical,unconscious)]] call FUNC(statusEffect_addType);
|
||||
["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType);
|
||||
["blockDamage", false, ["fixCollision"]] call FUNC(statusEffect_addType);
|
||||
["blockEngine", false, ["ACE_Refuel"]] call FUNC(statusEffect_addType);
|
||||
|
||||
|
@ -25,6 +25,6 @@ if (isNil "ACE_maxWeightCarry") then {
|
||||
["ace_playerWeaponChanged", {_this call FUNC(handlePlayerWeaponChanged)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
// handle waking up dragged unit and falling unconscious while dragging
|
||||
[QEGVAR(medical,unconscious), {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
//@todo Captivity?
|
||||
|
@ -18,7 +18,7 @@ class CfgPatches {
|
||||
#include "CfgMovesBasic.hpp"
|
||||
|
||||
class ACE_newEvents {
|
||||
medical_onUnconscious = QEGVAR(medical,unconscious);
|
||||
medical_onUnconscious = "ace_unconscious";
|
||||
playerWeaponChanged = "ace_playerWeaponChanged";
|
||||
playerVehicleChanged = "ace_playerVehicleChanged";
|
||||
playerChanged = "ace_playerChanged";
|
||||
|
@ -22,7 +22,7 @@
|
||||
//When getting knocked out in medical, trigger deadman explosives:
|
||||
//Event is global, only run on server (ref: ace_medical_fnc_setUnconscious)
|
||||
if (isServer) then {
|
||||
[QEGVAR(medical,unconscious), {
|
||||
["ace_unconscious", {
|
||||
params ["_unit", "_isUnconscious"];
|
||||
if (!_isUnconscious) exitWith {};
|
||||
TRACE_1("Knocked Out, Doing Deadman", _unit);
|
||||
|
@ -45,7 +45,7 @@ class CfgMineTriggers {
|
||||
};
|
||||
|
||||
class ACE_newEvents {
|
||||
medical_onUnconscious = QEGVAR(medical,unconscious);
|
||||
medical_onUnconscious = "ace_unconscious";
|
||||
clientRequestsOrientations = QGVAR(clientRequestOrientations);
|
||||
serverSendsOrientations = QGVAR(serverSendOrientations);
|
||||
};
|
||||
|
@ -41,7 +41,7 @@ GVAR(ParsedTextCached) = [];
|
||||
|
||||
|
||||
// Listens for the falling unconscious event, just in case the menu needs to be closed
|
||||
[QEGVAR(medical,unconscious), {
|
||||
["ace_unconscious", {
|
||||
// If no menu is open just quit
|
||||
if (GVAR(openedMenuType) < 0) exitWith {};
|
||||
|
||||
|
@ -9,29 +9,29 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"];
|
||||
["ace_interactMenuClosed", {[objNull, false] call FUNC(displayPatientInformation); }] call CBA_fnc_addEventHandler;
|
||||
|
||||
//Treatment EventHandlers:
|
||||
["ace_actionCheckBloodPressureLocal", DFUNC(actionCheckBloodPressureLocal)] call CBA_fnc_addEventHandler;
|
||||
["ace_actionCheckPulseLocal", DFUNC(actionCheckPulseLocal)] call CBA_fnc_addEventHandler;
|
||||
["ace_addToInjuredCollection", DFUNC(addToInjuredCollection)] call CBA_fnc_addEventHandler;
|
||||
["ace_addToMedicalLog", DFUNC(addToLog)] call CBA_fnc_addEventHandler;
|
||||
["ace_addToTriageCard", DFUNC(addToTriageCard)] call CBA_fnc_addEventHandler;
|
||||
["ace_setDead", DFUNC(setDead)] call CBA_fnc_addEventHandler;
|
||||
["ace_setHitPointDamage", DFUNC(setHitPointDamage)] call CBA_fnc_addEventHandler;
|
||||
["ace_setUnconscious", DFUNC(setUnconscious)] call CBA_fnc_addEventHandler;
|
||||
["ace_treatmentAdvanced_bandageLocal", DFUNC(treatmentAdvanced_bandageLocal)] call CBA_fnc_addEventHandler;
|
||||
["ace_treatmentAdvanced_CPRLocal", DFUNC(treatmentAdvanced_CPRLocal)] call CBA_fnc_addEventHandler;
|
||||
["ace_treatmentAdvanced_fullHealLocal", DFUNC(treatmentAdvanced_fullHealLocal)] call CBA_fnc_addEventHandler;
|
||||
["ace_treatmentAdvanced_medicationLocal", DFUNC(treatmentAdvanced_medicationLocal)] call CBA_fnc_addEventHandler;
|
||||
["ace_treatmentBasic_bandageLocal", DFUNC(treatmentBasic_bandageLocal)] call CBA_fnc_addEventHandler;
|
||||
["ace_treatmentBasic_bloodbagLocal", DFUNC(treatmentBasic_bloodbagLocal)] call CBA_fnc_addEventHandler;
|
||||
["ace_treatmentBasic_morphineLocal", DFUNC(treatmentBasic_morphineLocal)] call CBA_fnc_addEventHandler;
|
||||
["ace_treatmentIVLocal", DFUNC(treatmentIVLocal)] call CBA_fnc_addEventHandler;
|
||||
["ace_treatmentTourniquetLocal", DFUNC(treatmentTourniquetLocal)] call CBA_fnc_addEventHandler;
|
||||
["ace_actionPlaceInBodyBag", FUNC(actionPlaceInBodyBag)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(actionCheckBloodPressureLocal), DFUNC(actionCheckBloodPressureLocal)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(actionCheckPulseLocal), DFUNC(actionCheckPulseLocal)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(addVitalLoop), DFUNC(addVitalLoop)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(addToMedicalLog), DFUNC(addToLog)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(addToTriageCard), DFUNC(addToTriageCard)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(setDead), DFUNC(setDead)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(setHitPointDamage), DFUNC(setHitPointDamage)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(setUnconscious), DFUNC(setUnconscious)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(treatmentAdvanced_bandageLocal), DFUNC(treatmentAdvanced_bandageLocal)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(treatmentAdvanced_CPRLocal), DFUNC(treatmentAdvanced_CPRLocal)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(treatmentAdvanced_fullHealLocal), DFUNC(treatmentAdvanced_fullHealLocal)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(treatmentAdvanced_medicationLocal), DFUNC(treatmentAdvanced_medicationLocal)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(treatmentBasic_bandageLocal), DFUNC(treatmentBasic_bandageLocal)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(treatmentBasic_bloodbagLocal), DFUNC(treatmentBasic_bloodbagLocal)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(treatmentBasic_morphineLocal), DFUNC(treatmentBasic_morphineLocal)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(treatmentIVLocal), DFUNC(treatmentIVLocal)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(treatmentTourniquetLocal), DFUNC(treatmentTourniquetLocal)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(actionPlaceInBodyBag), FUNC(actionPlaceInBodyBag)] call CBA_fnc_addEventHandler;
|
||||
|
||||
//Handle Deleting Bodies on Server:
|
||||
if (isServer) then {[QGVAR(playedInBodyBag), FUNC(serverRemoveBody)] call CBA_fnc_addEventHandler;};
|
||||
if (isServer) then {["ace_playedInBodyBag", FUNC(serverRemoveBody)] call CBA_fnc_addEventHandler;};
|
||||
|
||||
[QGVAR(unconscious), {
|
||||
["ace_unconscious", {
|
||||
params ["_unit", "_status"];
|
||||
if (local _unit) then {
|
||||
if (_status) then {
|
||||
|
@ -7,7 +7,7 @@ params ["_unit"];
|
||||
|
||||
// Reset captive status for respawning unit
|
||||
if (!(_unit getVariable ["ACE_isUnconscious", false])) then {
|
||||
[_unit, "setCaptive", QGVAR(unconscious), false] call EFUNC(common,statusEffect_set);
|
||||
[_unit, "setCaptive", "ace_unconscious", false] call EFUNC(common,statusEffect_set);
|
||||
};
|
||||
|
||||
// Remove maximum unconsciousness time handler
|
||||
|
@ -26,31 +26,30 @@ class CfgPatches {
|
||||
#include "UI\triagecard.hpp"
|
||||
|
||||
class ACE_newEvents {
|
||||
medical_onUnconscious = QGVAR(unconscious);
|
||||
medical_treatmentSuccess = QGVAR(treatmentSuccess);
|
||||
medical_onSetDead = QGVAR(killed);
|
||||
Medical_onEnteredCardiacArrest = QGVAR(enteredCardiacArrest);
|
||||
Medical_onItemAddedToTriageCard = QGVAR(itemAddedToTriageCard);
|
||||
medical_onLogEntryAdded = QGVAR(logEntryAdded);
|
||||
Medical_onHeartRateAdjustmentAdded = QGVAR(addedHeartRateAdjustment);
|
||||
placedInBodyBag = QGVAR(playedInBodyBag);
|
||||
actionPlaceInBodyBag = "ace_actionPlaceInBodyBag";
|
||||
treatmentTourniquetLocal = "ace_treatmentTourniquetLocal";
|
||||
treatmentIVLocal = "ace_treatmentIVLocal";
|
||||
treatmentBasic_morphineLocal = "ace_treatmentBasic_morphineLocal";
|
||||
treatmentBasic_bloodbagLocal = "ace_treatmentBasic_bloodbagLocal";
|
||||
treatmentBasic_bandageLocal = "ace_treatmentBasic_bandageLocal";
|
||||
treatmentAdvanced_medicationLocal = "ace_treatmentAdvanced_medicationLocal";
|
||||
treatmentAdvanced_fullHealLocal = "ace_treatmentAdvanced_fullHealLocal";
|
||||
treatmentAdvanced_CPRLocal = "ace_treatmentAdvanced_CPRLocal";
|
||||
treatmentAdvanced_bandageLocal = "ace_treatmentAdvanced_bandageLocal";
|
||||
setUnconscious = "ace_setUnconscious";
|
||||
setHitPointDamage = "ace_setHitPointDamage";
|
||||
setDead = "ace_setDead";
|
||||
addToTriageCard = "ace_addToTriageCard";
|
||||
addToMedicalLog = "ace_addToMedicalLog";
|
||||
addToInjuredCollection = "ace_addToInjuredCollection";
|
||||
actionCheckPulseLocal = "ace_actionCheckPulseLocal";
|
||||
actionCheckBloodPressureLocal = "ace_actionCheckBloodPressureLocal";
|
||||
addVitalLoop = "ace_addVitalLoop";
|
||||
medical_onUnconscious = "ace_unconscious";
|
||||
medical_treatmentSuccess = "ace_treatmentSuccess";
|
||||
medical_onSetDead = "ace_killed";
|
||||
Medical_onEnteredCardiacArrest = "ace_enteredCardiacArrest";
|
||||
Medical_onItemAddedToTriageCard = "ace_itemAddedToTriageCard";
|
||||
medical_onLogEntryAdded = "ace_medicalLogEntryAdded";
|
||||
Medical_onHeartRateAdjustmentAdded = "ace_addedHeartRateAdjustment";
|
||||
placedInBodyBag = "ace_playedInBodyBag";
|
||||
actionPlaceInBodyBag = QGVAR(actionPlaceInBodyBag);
|
||||
treatmentTourniquetLocal = QGVAR(treatmentTourniquetLocal);
|
||||
treatmentIVLocal = QGVAR(treatmentIVLocal);
|
||||
treatmentBasic_morphineLocal = QGVAR(treatmentBasic_morphineLocal);
|
||||
treatmentBasic_bloodbagLocal = QGVAR(treatmentBasic_bloodbagLocal);
|
||||
treatmentBasic_bandageLocal = QGVAR(treatmentBasic_bandageLocal);
|
||||
treatmentAdvanced_medicationLocal = QGVAR(treatmentAdvanced_medicationLocal);
|
||||
treatmentAdvanced_fullHealLocal = QGVAR(treatmentAdvanced_fullHealLocal);
|
||||
treatmentAdvanced_CPRLocal = QGVAR(treatmentAdvanced_CPRLocal);
|
||||
treatmentAdvanced_bandageLocal = QGVAR(treatmentAdvanced_bandageLocal);
|
||||
setUnconscious = QGVAR(setUnconscious);
|
||||
setHitPointDamage = QGVAR(setHitPointDamage);
|
||||
setDead = QGVAR(setDead);
|
||||
addToTriageCard = QGVAR(addToTriageCard);
|
||||
addToMedicalLog = QGVAR(addToMedicalLog);
|
||||
actionCheckPulseLocal = QGVAR(actionCheckPulseLocal);
|
||||
actionCheckBloodPressureLocal = QGVAR(actionCheckBloodPressureLocal);
|
||||
addVitalLoop = QGVAR(addVitalLoop);
|
||||
};
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
params ["_caller", "_target", "_selectionName"];
|
||||
if (local _target) then {
|
||||
["ace_actionCheckBloodPressureLocal", [_caller, _target, _selectionName]] call CBA_fnc_localEvent;
|
||||
[QGVAR(actionCheckBloodPressureLocal), [_caller, _target, _selectionName]] call CBA_fnc_localEvent;
|
||||
} else {
|
||||
["ace_actionCheckBloodPressureLocal", [_caller, _target, _selectionName], _target] call CBA_fnc_targetEvent;
|
||||
[QGVAR(actionCheckBloodPressureLocal), [_caller, _target, _selectionName], _target] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
params ["_caller","_target", "_selectionName"];
|
||||
if (local _target) then {
|
||||
["ace_actionCheckPulseLocal", [_caller, _target, _selectionName]] call CBA_fnc_localEvent;
|
||||
[QGVAR(actionCheckPulseLocal), [_caller, _target, _selectionName]] call CBA_fnc_localEvent;
|
||||
} else {
|
||||
["ace_actionCheckPulseLocal", [_caller, _target, _selectionName], _target] call CBA_fnc_targetEvent;
|
||||
[QGVAR(actionCheckPulseLocal), [_caller, _target, _selectionName], _target] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
@ -22,7 +22,7 @@ TRACE_2("params",_caller,_target);
|
||||
|
||||
if (!local _target) exitWith {
|
||||
TRACE_1("running where local",local _target);
|
||||
["ace_actionPlaceInBodyBag", [_caller, _target], [_target]] call CBA_fnc_targetEvent;
|
||||
[QGVAR(actionPlaceInBodyBag), [_caller, _target], [_target]] call CBA_fnc_targetEvent;
|
||||
objNull
|
||||
};
|
||||
|
||||
@ -47,6 +47,6 @@ private _bodyBag = createVehicle ["ACE_bodyBagObject", _position, [], 0, ""];
|
||||
_bodyBag setPosASL _position;
|
||||
_bodyBag setDir _direction;
|
||||
|
||||
[QGVAR(playedInBodyBag), [_target, _bodyBag]] call CBA_fnc_globalEvent; //hide and delete body on server
|
||||
["ace_playedInBodyBag", [_target, _bodyBag]] call CBA_fnc_globalEvent; //hide and delete body on server
|
||||
|
||||
_bodyBag
|
||||
|
@ -44,7 +44,7 @@ TRACE_2("meds",_part,_delayedMedications);
|
||||
_x params ["", "", "_medPartNum"];
|
||||
if (_part == _medPartNum) then {
|
||||
TRACE_1("delayed medication call after tourniquet removeal",_x);
|
||||
["ace_treatmentAdvanced_medicationLocal", _x, [_target]] call CBA_fnc_targetEvent;
|
||||
[QGVAR(treatmentAdvanced_medicationLocal), _x, [_target]] call CBA_fnc_targetEvent;
|
||||
_delayedMedications set [_forEachIndex, -1];
|
||||
_updatedArray = true;
|
||||
};
|
||||
|
@ -22,4 +22,4 @@ params [["_unit", objNull, [objNull]], ["_value", 0, [0]], ["_time", 1, [0]], ["
|
||||
_adjustment = _unit getVariable [QGVAR(heartRateAdjustments), []];
|
||||
_adjustment pushBack [_value, _time, _callBack];
|
||||
_unit setVariable [QGVAR(heartRateAdjustments), _adjustment ];
|
||||
[QGVAR(addedHeartRateAdjustment), [_unit, _value, _time]] call CBA_fnc_localEvent;
|
||||
["ace_addedHeartRateAdjustment", [_unit, _value, _time]] call CBA_fnc_localEvent;
|
||||
|
@ -20,7 +20,7 @@ private ["_moment", "_logVarName", "_log","_newLog", "_logs"];
|
||||
params ["_unit", "_type", "_message", "_arguments"];
|
||||
|
||||
if (!local _unit) exitWith {
|
||||
["ace_addToMedicalLog", _this, _unit] call CBA_fnc_targetEvent;
|
||||
[QGVAR(addToMedicalLog), _this, _unit] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
||||
date params ["", "", "", "_hour", "_minute"];
|
||||
@ -43,7 +43,7 @@ if (count _log >= 8) then {
|
||||
_log pushBack [_message, _moment, _type, _arguments];
|
||||
|
||||
_unit setVariable [_logVarName, _log, true];
|
||||
[QGVAR(logEntryAdded), [_unit, _type, _message, _arguments]] call CBA_fnc_localEvent;
|
||||
["ace_medicalLogEntryAdded", [_unit, _type, _message, _arguments]] call CBA_fnc_localEvent;
|
||||
|
||||
_logs = _unit getVariable [QGVAR(allLogs), []];
|
||||
if !(_logVarName in _logs) then {
|
||||
|
@ -18,7 +18,7 @@ private ["_log", "_inList", "_amount"];
|
||||
params ["_unit", "_newItem"];
|
||||
|
||||
if (!local _unit) exitWith {
|
||||
["ace_addToTriageCard", _this, _unit] call CBA_fnc_targetEvent;
|
||||
[QGVAR(addToTriageCard), _this, _unit] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
||||
_log = _unit getVariable [QGVAR(triageCard), []];
|
||||
@ -41,4 +41,4 @@ if (!_inList) then {
|
||||
_log pushBack [_newItem, 1, CBA_missionTime];
|
||||
};
|
||||
_unit setVariable [QGVAR(triageCard), _log, true];
|
||||
[QGVAR(itemAddedToTriageCard), [_unit, _newItem, _amount]] call CBA_fnc_localEvent;
|
||||
["ace_itemAddedToTriageCard", [_unit, _newItem, _amount]] call CBA_fnc_localEvent;
|
||||
|
@ -18,7 +18,7 @@ params ["_unit", ["_force", false]];
|
||||
if !([_unit] call FUNC(hasMedicalEnabled) || _force) exitWith {};
|
||||
|
||||
if !(local _unit) exitWith {
|
||||
["ace_addVitalLoop", [_unit, _force], _unit] call CBA_fnc_targetEvent;
|
||||
[QGVAR(addVitalLoop), [_unit, _force], _unit] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
||||
// Quit if the unit already has a vital loop, or is dead, unless it's forced
|
||||
|
@ -21,7 +21,7 @@ if (_unit getVariable [QGVAR(inCardiacArrest),false]) exitWith {};
|
||||
_unit setVariable [QGVAR(inCardiacArrest), true,true];
|
||||
_unit setVariable [QGVAR(heartRate), 0];
|
||||
|
||||
[QGVAR(enteredCardiacArrest), [_unit]] call CBA_fnc_localEvent;
|
||||
["ace_enteredCardiacArrest", [_unit]] call CBA_fnc_localEvent;
|
||||
|
||||
[_unit, true] call FUNC(setUnconscious);
|
||||
_timeInCardiacArrest = 120 + round(random(600));
|
||||
|
@ -20,7 +20,7 @@ params ["_unit", ["_force", false], ["_delaySetDamage", false]];
|
||||
|
||||
if ((!alive _unit) || {_unit getVariable ["ACE_isDead", false]}) exitWith {true};
|
||||
if (!local _unit) exitwith {
|
||||
["ace_setDead", [_unit, _force], _unit] call CBA_fnc_targetEvent;
|
||||
[QGVAR(setDead), [_unit, _force], _unit] call CBA_fnc_targetEvent;
|
||||
false;
|
||||
};
|
||||
|
||||
@ -51,7 +51,7 @@ if (isPLayer _unit) then {
|
||||
_unit setVariable ["isDeadPlayer", true, true];
|
||||
};
|
||||
|
||||
[QGVAR(killed), [_unit]] call CBA_fnc_localEvent;
|
||||
["ace_killed", [_unit]] call CBA_fnc_localEvent;
|
||||
|
||||
//Delay a frame before killing the unit via scripted damage
|
||||
//to avoid triggering the "Killed" Event twice (and having the wrong killer)
|
||||
|
@ -26,7 +26,7 @@ params ["_unit", "_selection", "_damage", ["_disabled", false]];
|
||||
|
||||
// Unit isn't local, give function to machine where it is.
|
||||
if !(local _unit) exitWith {
|
||||
["ace_setHitPointDamage", _this, _unit] call CBA_fnc_targetEvent;
|
||||
[QGVAR(setHitPointDamage), _this, _unit] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
||||
// 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 (!local _unit) exitWith {
|
||||
["ace_setUnconscious", [_unit, _set, _minWaitingTime, _force], _unit] call CBA_fnc_targetEvent;
|
||||
[QGVAR(setUnconscious), [_unit, _set, _minWaitingTime, _force], _unit] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
||||
_unit setVariable ["ACE_isUnconscious", true, true];
|
||||
@ -96,12 +96,12 @@ if (GVAR(moveUnitsFromGroupOnUnconscious)) then {
|
||||
};
|
||||
// Delay Unconscious so the AI dont instant stop shooting on the unit #3121
|
||||
if (GVAR(delayUnconCaptive) == 0) then {
|
||||
[_unit, "setCaptive", QGVAR(unconscious), true] call EFUNC(common,statusEffect_set);
|
||||
[_unit, "setCaptive", "ace_unconscious", true] call EFUNC(common,statusEffect_set);
|
||||
} else {
|
||||
[{
|
||||
params ["_unit"];
|
||||
if (_unit getVariable ["ACE_isUnconscious", false]) then {
|
||||
[_unit, "setCaptive", QGVAR(unconscious), true] call EFUNC(common,statusEffect_set);
|
||||
[_unit, "setCaptive", "ace_unconscious", true] call EFUNC(common,statusEffect_set);
|
||||
};
|
||||
},[_unit], GVAR(delayUnconCaptive)] call CBA_fnc_waitAndExecute;
|
||||
};
|
||||
@ -122,4 +122,4 @@ _startingTime = CBA_missionTime;
|
||||
// unconscious can't talk
|
||||
[_unit, "isUnconscious"] call EFUNC(common,muteUnit);
|
||||
|
||||
[QGVAR(unconscious), [_unit, true]] call CBA_fnc_globalEvent;
|
||||
["ace_unconscious", [_unit, true]] call CBA_fnc_globalEvent;
|
||||
|
@ -22,9 +22,9 @@ if (alive _target && {(_target getVariable [QGVAR(inCardiacArrest), false] || _t
|
||||
[_target, "activity_view", LSTRING(Activity_cpr), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
|
||||
|
||||
if (local _target) then {
|
||||
["ace_treatmentAdvanced_CPRLocal", [_caller, _target]] call CBA_fnc_localEvent;
|
||||
[QGVAR(treatmentAdvanced_CPRLocal), [_caller, _target]] call CBA_fnc_localEvent;
|
||||
} else {
|
||||
["ace_treatmentAdvanced_CPRLocal", [_caller, _target], _target] call CBA_fnc_targetEvent;
|
||||
[QGVAR(treatmentAdvanced_CPRLocal), [_caller, _target], _target] call CBA_fnc_targetEvent;
|
||||
};
|
||||
};
|
||||
true;
|
||||
|
@ -27,9 +27,9 @@ if !([_target] call FUNC(hasMedicalEnabled)) exitWith {
|
||||
};
|
||||
|
||||
if (local _target) then {
|
||||
["ace_treatmentAdvanced_bandageLocal", [_target, _className, _selectionName, _specificSpot]] call CBA_fnc_localEvent;
|
||||
[QGVAR(treatmentAdvanced_bandageLocal), [_target, _className, _selectionName, _specificSpot]] call CBA_fnc_localEvent;
|
||||
} else {
|
||||
["ace_treatmentAdvanced_bandageLocal", [_target, _className, _selectionName, _specificSpot], _target] call CBA_fnc_targetEvent;
|
||||
[QGVAR(treatmentAdvanced_bandageLocal), [_target, _className, _selectionName, _specificSpot], _target] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
||||
/* {
|
||||
|
@ -13,9 +13,9 @@
|
||||
params ["_caller", "_target", "_selectionName", "_className", "_items"];
|
||||
|
||||
if (local _target) then {
|
||||
["ace_treatmentAdvanced_fullHealLocal", [_caller, _target]] call CBA_fnc_localEvent;
|
||||
[QGVAR(treatmentAdvanced_fullHealLocal), [_caller, _target]] call CBA_fnc_localEvent;
|
||||
} else {
|
||||
["ace_treatmentAdvanced_fullHealLocal", [_caller, _target], _target] call CBA_fnc_targetEvent;
|
||||
[QGVAR(treatmentAdvanced_fullHealLocal), [_caller, _target], _target] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
||||
true;
|
||||
|
@ -22,7 +22,7 @@ TRACE_5("params",_caller,_target,_selectionName,_className,_items);
|
||||
|
||||
private _part = [_selectionName] call FUNC(selectionNameToNumber);
|
||||
|
||||
["ace_treatmentAdvanced_medicationLocal", [_target, _className, _part], [_target]] call CBA_fnc_targetEvent;
|
||||
[QGVAR(treatmentAdvanced_medicationLocal), [_target, _className, _part], [_target]] call CBA_fnc_targetEvent;
|
||||
|
||||
{
|
||||
if (_x != "") then {
|
||||
|
@ -21,7 +21,7 @@ private ["_hitSelections", "_hitPoints", "_point", "_damage"];
|
||||
params ["_caller", "_target", "_selection", "_className"];
|
||||
|
||||
if (local _target) then {
|
||||
["ace_treatmentBasic_bandageLocal", [_target, _selection]] call CBA_fnc_localEvent;
|
||||
[QGVAR(treatmentBasic_bandageLocal), [_target, _selection]] call CBA_fnc_localEvent;
|
||||
} else {
|
||||
["ace_treatmentBasic_bandageLocal", [_target, _selection], _target] call CBA_fnc_targetEvent;
|
||||
[QGVAR(treatmentBasic_bandageLocal), [_target, _selection], _target] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
@ -19,7 +19,7 @@
|
||||
params ["_caller", "_target", "_treatmentClassname"];
|
||||
|
||||
if (local _target) then {
|
||||
["ace_treatmentBasic_bloodbagLocal", [_target, _treatmentClassname]] call CBA_fnc_localEvent;
|
||||
[QGVAR(treatmentBasic_bloodbagLocal), [_target, _treatmentClassname]] call CBA_fnc_localEvent;
|
||||
} else {
|
||||
["ace_treatmentBasic_bloodbagLocal", [_target, _treatmentClassname], _target] call CBA_fnc_targetEvent;
|
||||
[QGVAR(treatmentBasic_bloodbagLocal), [_target, _treatmentClassname], _target] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
@ -20,7 +20,7 @@
|
||||
params ["_caller", "_target"];
|
||||
|
||||
if (local _target) then {
|
||||
["ace_treatmentBasic_morphineLocal", [_target]] call CBA_fnc_localEvent;
|
||||
[QGVAR(treatmentBasic_morphineLocal), [_target]] call CBA_fnc_localEvent;
|
||||
} else {
|
||||
["ace_treatmentBasic_morphineLocal", [_target], _target] call CBA_fnc_targetEvent;
|
||||
[QGVAR(treatmentBasic_morphineLocal), [_target], _target] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
@ -23,9 +23,9 @@ if (count _items == 0) exitWith {false};
|
||||
|
||||
_removeItem = _items select 0;
|
||||
if (local _target) then {
|
||||
["ace_treatmentIVLocal", [_target, _className]] call CBA_fnc_localEvent;
|
||||
[QGVAR(treatmentIVLocal), [_target, _className]] call CBA_fnc_localEvent;
|
||||
} else {
|
||||
["ace_treatmentIVLocal", [_target, _className], _target] call CBA_fnc_targetEvent;
|
||||
[QGVAR(treatmentIVLocal), [_target, _className], _target] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
||||
[_target, _removeItem] call FUNC(addToTriageCard);
|
||||
|
@ -41,9 +41,9 @@ if ((_tourniquets select _part) > 0) exitWith {
|
||||
|
||||
_removeItem = _items select 0;
|
||||
if (local _target) then {
|
||||
["ace_treatmentTourniquetLocal", [_target, _removeItem, _selectionName]] call CBA_fnc_localEvent;
|
||||
[QGVAR(treatmentTourniquetLocal), [_target, _removeItem, _selectionName]] call CBA_fnc_localEvent;
|
||||
} else {
|
||||
["ace_treatmentTourniquetLocal", [_target, _removeItem, _selectionName], _target] call CBA_fnc_targetEvent;
|
||||
[QGVAR(treatmentTourniquetLocal), [_target, _removeItem, _selectionName], _target] call CBA_fnc_targetEvent;
|
||||
};
|
||||
|
||||
[_target, _removeItem] call FUNC(addToTriageCard);
|
||||
|
@ -95,4 +95,4 @@ if (!(_target getVariable [QGVAR(addedToUnitLoop),false])) then {
|
||||
[_target] call FUNC(addVitalLoop);
|
||||
};
|
||||
|
||||
[QGVAR(treatmentSuccess), [_caller, _target, _selectionName, _className]] call CBA_fnc_localEvent;
|
||||
["ace_treatmentSuccess", [_caller, _target, _selectionName, _className]] call CBA_fnc_localEvent;
|
||||
|
@ -33,15 +33,15 @@ if (!alive _unit) exitWith {
|
||||
if (GVAR(moveUnitsFromGroupOnUnconscious)) then {
|
||||
[_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide);
|
||||
};
|
||||
[_unit, "setCaptive", QGVAR(unconscious), false] call EFUNC(common,statusEffect_set);
|
||||
[_unit, "setCaptive", "ace_unconscious", false] call EFUNC(common,statusEffect_set);
|
||||
[_unit, false] call EFUNC(common,disableAI);
|
||||
//_unit setUnitPos _originalPos;
|
||||
_unit setUnconscious false;
|
||||
|
||||
[_unit, "isUnconscious"] call EFUNC(common,unmuteUnit);
|
||||
[QGVAR(unconscious), [_unit, false]] call CBA_fnc_globalEvent;
|
||||
["ace_unconscious", [_unit, false]] call CBA_fnc_globalEvent;
|
||||
|
||||
TRACE_3("ACE_DEBUG_Unconscious_Exit",_unit, (!alive _unit) , QGVAR(unconscious));
|
||||
TRACE_3("ACE_DEBUG_Unconscious_Exit",_unit, (!alive _unit) , "ace_unconscious");
|
||||
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
@ -96,13 +96,13 @@ if !(_unit getVariable ["ACE_isUnconscious",false]) exitWith {
|
||||
};
|
||||
_unit setVariable [QGVAR(vehicleAwakeAnim), nil];
|
||||
|
||||
[QGVAR(unconscious), [_unit, false]] call CBA_fnc_globalEvent;
|
||||
["ace_unconscious", [_unit, false]] call CBA_fnc_globalEvent;
|
||||
// EXIT PFH
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
if (!_hasMovedOut) then {
|
||||
// Reset the unit back to the previous captive state.
|
||||
[_unit, "setCaptive", QGVAR(unconscious), false] call EFUNC(common,statusEffect_set);
|
||||
[_unit, "setCaptive", "ace_unconscious", false] call EFUNC(common,statusEffect_set);
|
||||
|
||||
// Swhich the unit back to its original group
|
||||
//Unconscious units shouldn't be put in another group #527:
|
||||
|
@ -6,8 +6,7 @@ GVAR(MenuPFHID) = -1;
|
||||
GVAR(lastOpenedOn) = -1;
|
||||
GVAR(pendingReopen) = false;
|
||||
|
||||
[QEGVAR(medical,treatmentSuccess), {
|
||||
|
||||
["ace_treatmentSuccess", {
|
||||
if (GVAR(openAfterTreatment) && {GVAR(pendingReopen)}) then {
|
||||
GVAR(pendingReopen) = false;
|
||||
[{
|
||||
@ -16,7 +15,6 @@ GVAR(pendingReopen) = false;
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
|
||||
["ACE3 Common", QGVAR(displayMenuKeyPressed), localize LSTRING(DisplayMenuKey),
|
||||
{
|
||||
private _target = cursorTarget;
|
||||
@ -37,4 +35,3 @@ GVAR(pendingReopen) = false;
|
||||
false
|
||||
},
|
||||
[35, [false, false, false]], false, 0] call CBA_fnc_addKeybind;
|
||||
|
||||
|
@ -19,7 +19,5 @@ class CfgPatches {
|
||||
#include "CfgVehicles.hpp"
|
||||
|
||||
class ACE_newEvents {
|
||||
medical_treatmentSuccess = QEGVAR(medical,treatmentSuccess);
|
||||
Medical_onMenuOpen = QGVAR(opened);
|
||||
displayTextStructured = "ace_displayTextStructured";
|
||||
Medical_onMenuOpen = "ace_medicalMenuOpened";
|
||||
};
|
||||
|
@ -87,4 +87,4 @@ GVAR(MenuPFHID) = [{
|
||||
|
||||
}, 0, [_display]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
[QGVAR(opened), [ACE_player, _target]] call CBA_fnc_localEvent;
|
||||
["ace_medicalMenuOpened", [ACE_player, _target]] call CBA_fnc_localEvent;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
[QEGVAR(medical,unconscious), {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
["ace_playerVehicleChanged", {params ["_unit"]; [_unit] call FUNC(dropAmmo)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
if (isServer) then {
|
||||
|
@ -22,5 +22,5 @@ class CfgPatches {
|
||||
|
||||
class ACE_newEvents {
|
||||
playerVehicleChanged = "ace_playerVehicleChanged";
|
||||
medical_onUnconscious = QEGVAR(medical,unconscious);
|
||||
medical_onUnconscious = "ace_unconscious";
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
[QEGVAR(medical,unconscious), {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
if (isServer) then {
|
||||
addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleDisconnect)}];
|
||||
|
@ -18,7 +18,7 @@ class CfgPatches {
|
||||
#include "CfgVehicles.hpp"
|
||||
|
||||
class ACE_newEvents {
|
||||
medical_onUnconscious = QEGVAR(medical,unconscious);
|
||||
medical_onUnconscious = "ace_unconscious";
|
||||
setFuel = "ace_setFuel";
|
||||
setVectorDirAndUp = "ace_setVectorDirAndUp";
|
||||
displayTextStructured = "ace_displayTextStructured";
|
||||
|
@ -20,6 +20,6 @@ GVAR(deployDirection) = 0;
|
||||
["ace_playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
// handle waking up dragged unit and falling unconscious while dragging
|
||||
[QEGVAR(medical,unconscious), {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
//@todo Captivity?
|
||||
|
@ -18,7 +18,7 @@ class CfgPatches {
|
||||
#include "CfgWeapons.hpp"
|
||||
|
||||
class ACE_newEvents {
|
||||
medical_onUnconscious = QEGVAR(medical,unconscious);
|
||||
medical_onUnconscious = "ace_unconscious";
|
||||
playerVehicleChanged = "ace_playerVehicleChanged";
|
||||
playerInventoryChanged = "ace_playerInventoryChanged";
|
||||
playerChanged = "ace_playerChanged";
|
||||
|
@ -12,6 +12,6 @@ if (!hasInterface) exitWith {};
|
||||
["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(isSitting)}}] call EFUNC(common,addCanInteractWithCondition);
|
||||
|
||||
// Handle interruptions
|
||||
[QEGVAR(medical,unconscious), {_this call DFUNC(handleInterrupt)}] call CBA_fnc_addEventHandler;
|
||||
["ace_unconscious", {_this call DFUNC(handleInterrupt)}] call CBA_fnc_addEventHandler;
|
||||
[QEGVAR(captives,setHandcuffed), {_this call DFUNC(handleInterrupt)}] call CBA_fnc_addEventHandler;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
@ -21,5 +21,5 @@ class CfgPatches {
|
||||
class ACE_newEvents {
|
||||
SettingsInitialized = "ace_settingsInitialized";
|
||||
SetHandcuffed = QEGVAR(captives,setHandcuffed);
|
||||
medical_onUnconscious = QEGVAR(medical,unconscious);
|
||||
medical_onUnconscious = "ace_unconscious";
|
||||
};
|
@ -21,6 +21,6 @@ GVAR(currentAngle) = 0;
|
||||
["ace_playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
// handle falling unconscious
|
||||
[QEGVAR(medical,unconscious), {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
// @todo captivity?
|
||||
|
@ -18,7 +18,7 @@ class CfgPatches {
|
||||
|
||||
class ACE_newEvents {
|
||||
interactMenuOpened = "ace_interactMenuOpened";
|
||||
medical_onUnconscious = QEGVAR(medical,unconscious);
|
||||
medical_onUnconscious = "ace_unconscious";
|
||||
playerVehicleChanged = "ace_playerVehicleChanged";
|
||||
playerChanged = "ace_playerChanged";
|
||||
};
|
||||
|
@ -21,6 +21,6 @@ GVAR(digDirection) = 0;
|
||||
["ace_playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
// handle waking up dragged unit and falling unconscious while dragging
|
||||
[QEGVAR(medical,unconscious), {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
//@todo Captivity?
|
||||
|
@ -18,7 +18,7 @@ class CfgPatches {
|
||||
#include "CfgWeapons.hpp"
|
||||
|
||||
class ACE_newEvents {
|
||||
medical_onUnconscious = QEGVAR(medical,unconscious);
|
||||
medical_onUnconscious = "ace_unconscious";
|
||||
playerVehicleChanged = "ace_playerVehicleChanged";
|
||||
playerInventoryChanged = "ace_playerInventoryChanged";
|
||||
playerChanged = "ace_playerChanged";
|
||||
|
@ -14,6 +14,6 @@ GVAR(height) = 0;
|
||||
["ace_playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
// handle falling unconscious
|
||||
[QEGVAR(medical,unconscious), {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
// @todo captivity?
|
||||
|
@ -18,7 +18,7 @@ class CfgPatches {
|
||||
#include "CfgWeapons.hpp"
|
||||
|
||||
class ACE_newEvents {
|
||||
medical_onUnconscious = QEGVAR(medical,unconscious);
|
||||
medical_onUnconscious = "ace_unconscious";
|
||||
playerVehicleChanged = "ace_playerVehicleChanged";
|
||||
playerChanged = "ace_playerChanged";
|
||||
interactMenuOpened = "ace_interactMenuOpened";
|
||||
|
Loading…
Reference in New Issue
Block a user