mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Zeus/Medical - Fix modules for rewrite (#6914)
* Zeus/Medical - Fix modules for rewrite * move wakeup logic to medical_treatment
This commit is contained in:
parent
55a7d53437
commit
9588b13942
@ -14,8 +14,8 @@
|
|||||||
* Success? <BOOLEAN>
|
* Success? <BOOLEAN>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [bob, true] call ace_medical_status__fnc_setUnconscious;
|
* [bob, true] call ace_medical_fnc_setUnconscious;
|
||||||
* [player, true, 5, true] call ace_medical_status_fnc_setUnconscious;
|
* [player, true, 5, true] call ace_medical_fnc_setUnconscious;
|
||||||
*
|
*
|
||||||
* Public: yes
|
* Public: yes
|
||||||
*/
|
*/
|
||||||
|
@ -16,6 +16,17 @@ params ["_target"];
|
|||||||
|
|
||||||
if (!alive _target) exitWith {};
|
if (!alive _target) exitWith {};
|
||||||
|
|
||||||
|
// Treatment conditions would normally limit this to non-unconc units, but treatment event may be called externally (zeus)
|
||||||
|
if (_target getVariable [QEGVAR(medical,inCardiacArrest), false]) then {
|
||||||
|
TRACE_1("exiting cardiac arrest",_target);
|
||||||
|
[QEGVAR(medical,CPRSucceeded), _target] call CBA_fnc_localEvent;
|
||||||
|
};
|
||||||
|
if (_target getVariable ["ACE_isUnconscious",false]) then {
|
||||||
|
TRACE_1("waking up",_target); // wake up first or unconc variables will be reset
|
||||||
|
[QEGVAR(medical,WakeUp), _target] call CBA_fnc_localEvent;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
_target setVariable [VAR_PAIN, 0, true];
|
_target setVariable [VAR_PAIN, 0, true];
|
||||||
_target setVariable [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME, true];
|
_target setVariable [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME, true];
|
||||||
|
|
||||||
|
@ -76,7 +76,9 @@ private _tourniquets = GET_TOURNIQUETS(_unit);
|
|||||||
_tourniquetPain = _tourniquetPain max (CBA_missionTime - _x - 120) * 0.001;
|
_tourniquetPain = _tourniquetPain max (CBA_missionTime - _x - 120) * 0.001;
|
||||||
};
|
};
|
||||||
} forEach _tourniquets;
|
} forEach _tourniquets;
|
||||||
[_unit, _tourniquetPain] call EFUNC(medical_status,adjustPainLevel);
|
if (_tourniquetPain > 0) then {
|
||||||
|
[_unit, _tourniquetPain] call EFUNC(medical_status,adjustPainLevel);
|
||||||
|
};
|
||||||
|
|
||||||
private _heartRate = [_unit, _deltaT, _syncValues] call FUNC(updateHeartRate);
|
private _heartRate = [_unit, _deltaT, _syncValues] call FUNC(updateHeartRate);
|
||||||
[_unit, _deltaT, _syncValues] call FUNC(updatePainSuppress);
|
[_unit, _deltaT, _syncValues] call FUNC(updatePainSuppress);
|
||||||
|
@ -43,8 +43,9 @@ switch (false) do {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Heal validated target
|
// Heal validated target
|
||||||
if (["ace_medical"] call EFUNC(common,isModLoaded) && {EGVAR(medical,level) > 0}) then {
|
if (["ace_medical"] call EFUNC(common,isModLoaded)) then {
|
||||||
[QEGVAR(medical,treatmentAdvanced_fullHealLocal), [_unit, _unit], _unit] call CBA_fnc_targetEvent;
|
TRACE_1("healing with ace_medical",_unit);
|
||||||
|
[QEGVAR(medical_treatment,treatmentFullHealLocal), [_unit], _unit] call CBA_fnc_targetEvent;
|
||||||
} else {
|
} else {
|
||||||
// BI's scripted revive system
|
// BI's scripted revive system
|
||||||
if ((missionNamespace getVariable ["bis_revive_mode", 0]) != 0) then {
|
if ((missionNamespace getVariable ["bis_revive_mode", 0]) != 0) then {
|
||||||
|
@ -37,9 +37,9 @@ if (isNil QEFUNC(medical,setUnconscious)) then {
|
|||||||
if !(alive _unit) then {
|
if !(alive _unit) then {
|
||||||
[LSTRING(OnlyAlive)] call FUNC(showMessage);
|
[LSTRING(OnlyAlive)] call FUNC(showMessage);
|
||||||
} else {
|
} else {
|
||||||
private _conscious = GETVAR(_unit,ACE_isUnconscious,false);
|
private _unconscious = GETVAR(_unit,ACE_isUnconscious,false);
|
||||||
// Function handles locality for me
|
// Function handles locality for me
|
||||||
[_unit, !_conscious, 10e10] call EFUNC(medical,setUnconscious);
|
[_unit, !_unconscious, 10e10] call EFUNC(medical,setUnconscious);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user