ACE3/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf

78 lines
2.6 KiB
Plaintext
Raw Normal View History

/*
* Author: Glowbal
* Handles full heal of a patient.
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* Return Value:
* Succesful treatment started <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_caller", "_target"];
2016-12-05 20:34:20 +00:00
if (!alive _target) exitWith {};
2018-05-10 16:44:02 +00:00
SET_PAIN_TOTAL(_target,0);
SET_BLOOD_VOLUME(_target,DEFAULT_BLOOD_VOLUME);
// tourniquets
_target setVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0], true];
_target setVariable [QGVAR(occludedMedications), nil, true];
// wounds and injuries
_target setVariable [QEGVAR(medical,openWounds), [], true];
_target setVariable [QEGVAR(medical,bandagedWounds), [], true];
_target setVariable [QEGVAR(medical,stitchedWounds), [], true];
2017-09-26 22:43:54 +00:00
_target setVariable [QEGVAR(medical_engine,isLimping), false, true];
// vitals
_target setVariable [QEGVAR(medical,heartRate), 80, true];
_target setVariable [QEGVAR(medical,heartRateAdjustments), [], true];
_target setVariable [QEGVAR(medical,bloodPressure), [80, 120], true];
_target setVariable [QEGVAR(medical,peripheralResistance), 100, true];
_target setVariable [QGVAR(peripheralResistanceAdjustments), [], true];
// IVs
_target setVariable [QEGVAR(medical,ivBags), nil, true];
// damage storage
_target setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true];
2016-12-08 10:38:43 +00:00
#ifdef DEBUG_TESTRESULTS
_target setVariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0], true];
2016-12-08 10:38:43 +00:00
#endif
// generic medical admin
_target setVariable [QEGVAR(medical,inCardiacArrest), false, true];
_target setVariable ["ACE_isUnconscious", false, true];
_target setVariable [QEGVAR(medical,hasLostBlood), 0, true];
_target setVariable [QEGVAR(medical,isBleeding), false, true];
_target setVariable [QEGVAR(medical,hasPain), false, true];
_target setVariable [QEGVAR(medical,painSuppress), 0, true];
_target setVariable [QGVAR(painSuppressAdjustments), [], true];
_target setVariable [QGVAR(partialHealCounter), 0, true];
// medication
private _allUsedMedication = _target getVariable [QEGVAR(medical,allUsedMedication), []];
{
_target setVariable [_x select 0, nil];
} forEach _allUsedMedication;
2018-04-11 19:34:32 +00:00
// Reset triage card since medication is all reset
_target setVariable [QEGVAR(medical,triageCard), [], true];
2017-05-14 20:14:22 +00:00
[_target, false] call EFUNC(medical_engine,setLimping);
2016-12-05 20:34:20 +00:00
2016-12-08 10:38:43 +00:00
// Resetting damage
_target setDamage 0;
2016-12-05 20:34:20 +00:00
[QEGVAR(medical,FullHeal), _target] call CBA_fnc_localEvent;
[_target, "activity", ELSTRING(medical,Activity_fullHeal), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", ELSTRING(medical,Activity_fullHeal), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message