|
| 1 | +#include "..\script_component.hpp" |
| 2 | +/* |
| 3 | + * Author: PabstMirror |
| 4 | + * Checks for scripted medical activity on a unit |
| 5 | + * |
| 6 | + * Arguments: |
| 7 | + * 0: Unit <OBJECT> |
| 8 | + * |
| 9 | + * Return Value: |
| 10 | + * None |
| 11 | + * |
| 12 | + * Example: |
| 13 | + * [player] call ace_medical_engine_fnc_checkForMedicalActivity |
| 14 | + * |
| 15 | + * Public: No |
| 16 | + */ |
| 17 | +params ["_unit"]; |
| 18 | +TRACE_1("checkForMedicalActivity",_unit); |
| 19 | + |
| 20 | +if (!alive _unit || {!local _unit}) exitWith {}; |
| 21 | +if (IS_MEDICAL_ACTIVITY(_unit)) exitWith {}; |
| 22 | + |
| 23 | +{ |
| 24 | + _x params ["_var", "_default"]; |
| 25 | + if (_unit isNil _var) then { continue }; |
| 26 | + private _current = _unit getVariable [_var, _default]; |
| 27 | + if (_current isNotEqualTo _default) exitWith { |
| 28 | + TRACE_2("unit has non-defaults",_unit,_var); |
| 29 | + [QEGVAR(medical,activateMedical), _unit] call CBA_fnc_localEvent; |
| 30 | + }; |
| 31 | +} forEach [ |
| 32 | + [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME], |
| 33 | + [VAR_HEART_RATE, DEFAULT_HEART_RATE], |
| 34 | + [VAR_BLOOD_PRESS, [80, 120]], |
| 35 | + [VAR_HEMORRHAGE, 0], |
| 36 | + [VAR_PAIN, 0], |
| 37 | + [VAR_PAIN_SUPP, 0], |
| 38 | + [VAR_OPEN_WOUNDS, createHashMap], |
| 39 | + [VAR_BANDAGED_WOUNDS, createHashMap], |
| 40 | + [VAR_STITCHED_WOUNDS, createHashMap], |
| 41 | + [VAR_FRACTURES, DEFAULT_FRACTURE_VALUES], |
| 42 | + [VAR_TOURNIQUET, DEFAULT_TOURNIQUET_VALUES], |
| 43 | + [VAR_MEDICATIONS, []], |
| 44 | + [QEGVAR(medical,occludedMedications), []], |
| 45 | + [QEGVAR(medical,ivBags), []], |
| 46 | + [VAR_BODYPART_DAMAGE, DEFAULT_BODYPART_DAMAGE_VALUES] |
| 47 | +]; |
| 48 | + |
0 commit comments