diff --git a/addons/medical/XEH_PREP.hpp b/addons/medical/XEH_PREP.hpp index 072cb6262c1..82fc144bf2f 100644 --- a/addons/medical/XEH_PREP.hpp +++ b/addons/medical/XEH_PREP.hpp @@ -3,7 +3,10 @@ PREP(adjustPainLevel); PREP(deserializeState); PREP(fullHeal); PREP(getBandagedWounds); +PREP(getBloodLoss); PREP(getOpenWounds); PREP(getStitchedWounds); +PREP(isInjured); +PREP(isInStableCondition); PREP(serializeState); PREP(setUnconscious); diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf new file mode 100644 index 00000000000..427f9b2fda8 --- /dev/null +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -0,0 +1,25 @@ +#include "..\script_component.hpp" +/* + * Author: DartRuffian + * Calculate the total blood loss of a unit. + * + * Arguments: + * 0: Unit <OBJECT> + * + * Return Value: + * Total blood loss of unit (litres/second) <NUMBER> + * + * Example: + * player call ace_medical_fnc_getBloodLoss + * + * Public: Yes + */ + +params [["_unit", objNull, [objNull]]]; + +if (!local _unit) exitWith { + ERROR_1("unit [%1] is not local",_unit); + -1 +}; + +GET_BLOOD_LOSS(_unit) diff --git a/addons/medical/functions/fnc_isInStableCondition.sqf b/addons/medical/functions/fnc_isInStableCondition.sqf new file mode 100644 index 00000000000..d30e7d09854 --- /dev/null +++ b/addons/medical/functions/fnc_isInStableCondition.sqf @@ -0,0 +1,23 @@ +#include "..\script_component.hpp" +/* + * Author: DartRuffian + * Checks if a unit is in stable condition (stable vitals, awake, and not bleeding). + * Unit shouldn't require further treatment if true and not injured. + * + * Arguments: + * 0: Unit <OBJECT> + * + * Return Value: + * Is unit stable <BOOL> + * + * Example: + * player call ace_medical_fnc_isInStableCondition + * + * Public: Yes + */ + +params [["_unit", objNull, [objNull]]]; + +if (!alive _unit) exitWith { false }; + +_unit call EFUNC(medical_status,isInStableCondition) diff --git a/addons/medical/functions/fnc_isInjured.sqf b/addons/medical/functions/fnc_isInjured.sqf new file mode 100644 index 00000000000..25a3aad9518 --- /dev/null +++ b/addons/medical/functions/fnc_isInjured.sqf @@ -0,0 +1,26 @@ +#include "..\script_component.hpp" +/* + * Author: DartRuffian + * Checks if a unit is injured (bleeding, fractured limbs, low blood, etc). + * Unit may still require further treatment even if false. + * + * Arguments: + * 0: Unit <OBJECT> + * + * Return Value: + * Is unit injured <BOOL> + * + * Example: + * player call ace_medical_fnc_isInjured + * + * Public: Yes + */ + +params [["_unit", objNull, [objNull]]]; + +if (!alive _unit) exitWith { false }; + +private _fractures = GET_FRACTURES(_unit); + +((_fractures select HITPOINT_INDEX_LARM) == 1) || {(_fractures select HITPOINT_INDEX_RARM) == 1} || +{_unit call EFUNC(medical_ai,isInjured)}