diff --git a/addons/medical_status/functions/fnc_addHeartRateAdjustment.sqf b/addons/medical_status/functions/fnc_addHeartRateAdjustment.sqf new file mode 100644 index 0000000000..fb546bc202 --- /dev/null +++ b/addons/medical_status/functions/fnc_addHeartRateAdjustment.sqf @@ -0,0 +1,20 @@ +/* + * Author: BaerMitUmlaut + * Adds a heart rate adjustment that will take effect over time. + * + * Arguments: + * 0: The Unit + * 1: Heart rate change + * 2: Time in system for the adjustment to reach its peak + * 3: Duration the adjustment will have an effect + * + * Return Value: + * None + */ +#include "script_component.hpp" +params ["_unit", "_change", "_timeToMaxEffect", "_maxTimeInSystem"]; + +private _adjustments = _unit getVariable [QGVAR(heartRateAdjustments), []]; +// The last number indicates the time the adjustment is already in the system +_adjustments pushBack [_change, _timeToMaxEffect, _maxTimeInSystem, 0]; +_unit setVariable [QGVAR(heartRateAdjustments), _heartRateAdjustments]; diff --git a/addons/medical_status/functions/fnc_getHeartRate.sqf b/addons/medical_status/functions/fnc_getHeartRate.sqf new file mode 100644 index 0000000000..0514b1acd0 --- /dev/null +++ b/addons/medical_status/functions/fnc_getHeartRate.sqf @@ -0,0 +1,14 @@ +/* + * Author: BaerMitUmlaut + * Get the heart rate of a unit. + * + * Arguments: + * 0: The Unit + * + * Return Value: + * Heart Rate + */ +#include "script_component.hpp" +params ["_unit"]; + +_unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE] diff --git a/addons/medical_status/functions/fnc_getPainLevel.sqf b/addons/medical_status/functions/fnc_getPainPerceived.sqf similarity index 84% rename from addons/medical_status/functions/fnc_getPainLevel.sqf rename to addons/medical_status/functions/fnc_getPainPerceived.sqf index 38eb9cbf90..1018276aa3 100644 --- a/addons/medical_status/functions/fnc_getPainLevel.sqf +++ b/addons/medical_status/functions/fnc_getPainPerceived.sqf @@ -1,11 +1,11 @@ /* * Author: Ruthberg - * Get the total pain level of a unit. + * Get the perceived pain level of a unit. * * Arguments: * 0: The Unit * - * ReturnValue: + * Return Value: * Pain level (0 .. 1) * * Public: No diff --git a/addons/medical_status/functions/fnc_getPainTotal.sqf b/addons/medical_status/functions/fnc_getPainTotal.sqf new file mode 100644 index 0000000000..9375eb2590 --- /dev/null +++ b/addons/medical_status/functions/fnc_getPainTotal.sqf @@ -0,0 +1,14 @@ +/* + * Author: BaerMitUmlaut + * Get the total pain level of a unit. + * + * Arguments: + * 0: The Unit + * + * Return Value: + * Pain level (0 .. 1) + */ +#include "script_component.hpp" +params ["_unit"]; + +_unit getVariable [QGVAR(pain), 0] diff --git a/addons/medical_status/functions/fnc_isUnconscious.sqf b/addons/medical_status/functions/fnc_isUnconscious.sqf new file mode 100644 index 0000000000..3e78f025d5 --- /dev/null +++ b/addons/medical_status/functions/fnc_isUnconscious.sqf @@ -0,0 +1,14 @@ +/* + * Author: BaerMitUmlaut + * Check if the unit is unconscious. + * + * Arguments: + * 0: The Unit + * + * Return Value: + * Is unconscious + */ +#include "script_component.hpp" +params ["_unit"]; + +_unit getVariable [QGVAR(isUnconscious), false] diff --git a/addons/medical_status/functions/fnc_setHeartRate.sqf b/addons/medical_status/functions/fnc_setHeartRate.sqf new file mode 100644 index 0000000000..644592cee4 --- /dev/null +++ b/addons/medical_status/functions/fnc_setHeartRate.sqf @@ -0,0 +1,15 @@ +/* + * Author: BaerMitUmlaut + * Sets the heart rate of a unit. + * + * Arguments: + * 0: The Unit + * 1: Heart rate + * + * Return Value: + * None + */ +#include "script_component.hpp" +params ["_unit", "_heartRate"]; + +_unit setVariable [QGVAR(heartRate), _heartRate]; diff --git a/addons/medical_status/functions/fnc_setPainTotal.sqf b/addons/medical_status/functions/fnc_setPainTotal.sqf new file mode 100644 index 0000000000..aca8fe4d79 --- /dev/null +++ b/addons/medical_status/functions/fnc_setPainTotal.sqf @@ -0,0 +1,15 @@ +/* + * Author: BaerMitUmlaut + * Sets the total pain level of a unit. + * + * Arguments: + * 0: The Unit + * 1: Pain level (0..1) + * + * Return Value: + * None + */ +#include "script_component.hpp" +params ["_unit", "_pain"]; + +_unit setVariable [QGVAR(pain), 0 max _pain min 1];