2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-12-01 19:54:03 +00:00
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut
|
2017-01-29 19:24:16 +00:00
|
|
|
* Handles any visual effects of medical.
|
|
|
|
* Note: Heart beat sounds run in a different PFH - see fnc_effectHeartBeat.
|
2016-12-01 19:54:03 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2019-10-11 20:00:53 +00:00
|
|
|
* 0: Manual, instant update (optional, default false) <BOOL>
|
2016-12-01 19:54:03 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
2019-03-30 16:07:54 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [] call ace_medical_feedback_fnc_handleEffects
|
|
|
|
*
|
|
|
|
* Public: No
|
2016-12-01 19:54:03 +00:00
|
|
|
*/
|
2019-10-11 20:00:53 +00:00
|
|
|
params [["_manualUpdate", false]];
|
2016-12-01 19:54:03 +00:00
|
|
|
|
2017-02-19 04:11:40 +00:00
|
|
|
if (EGVAR(common,OldIsCamera) || {!alive ACE_player}) exitWith {
|
2016-12-09 18:16:41 +00:00
|
|
|
[false, 0] call FUNC(effectUnconscious);
|
|
|
|
[false] call FUNC(effectPain);
|
|
|
|
[false] call FUNC(effectBloodVolume);
|
2020-02-22 20:42:59 +00:00
|
|
|
[false] call FUNC(effectBloodVolumeIcon);
|
2017-01-17 20:35:53 +00:00
|
|
|
[false] call FUNC(effectBleeding);
|
2016-12-01 19:54:03 +00:00
|
|
|
};
|
|
|
|
|
2017-03-18 16:53:57 +00:00
|
|
|
BEGIN_COUNTER(handleEffects);
|
|
|
|
|
2016-12-01 19:54:03 +00:00
|
|
|
// - Current state info -------------------------------------------------------
|
2017-04-27 17:12:57 +00:00
|
|
|
private _bleedingStrength = GET_BLOOD_LOSS(ACE_player);
|
|
|
|
private _bloodVolume = GET_BLOOD_VOLUME(ACE_player);
|
|
|
|
private _unconscious = IS_UNCONSCIOUS(ACE_player);
|
|
|
|
private _heartRate = GET_HEART_RATE(ACE_player);
|
|
|
|
private _pain = GET_PAIN_PERCEIVED(ACE_player);
|
2016-12-01 19:54:03 +00:00
|
|
|
|
2017-02-19 04:11:40 +00:00
|
|
|
if ((!GVAR(heartBeatEffectRunning)) && {_heartRate != 0} && {(_heartRate > 160) || {_heartRate < 60}}) then {
|
|
|
|
TRACE_1("Starting heart beat effect",_heartRate);
|
|
|
|
GVAR(heartBeatEffectRunning) = true;
|
|
|
|
[] call FUNC(effectHeartBeat);
|
|
|
|
};
|
|
|
|
|
2016-12-01 19:54:03 +00:00
|
|
|
// - Visual effects -----------------------------------------------------------
|
2016-12-09 18:16:41 +00:00
|
|
|
[_unconscious, 2] call FUNC(effectUnconscious);
|
2016-12-09 18:14:12 +00:00
|
|
|
[
|
2020-02-22 20:42:59 +00:00
|
|
|
true,
|
|
|
|
linearConversion [BLOOD_VOLUME_CLASS_2_HEMORRHAGE, BLOOD_VOLUME_CLASS_4_HEMORRHAGE, _bloodVolume, 0, 1, true]
|
2016-12-09 18:14:12 +00:00
|
|
|
] call FUNC(effectBloodVolume);
|
2020-02-22 20:42:59 +00:00
|
|
|
[
|
|
|
|
true,
|
|
|
|
ceil linearConversion [
|
|
|
|
BLOOD_VOLUME_CLASS_2_HEMORRHAGE, BLOOD_VOLUME_CLASS_4_HEMORRHAGE,
|
|
|
|
_bloodVolume,
|
|
|
|
ICON_BLOODVOLUME_IDX_MIN, ICON_BLOODVOLUME_IDX_MAX, true
|
|
|
|
]
|
|
|
|
] call FUNC(effectBloodVolumeIcon);
|
2016-12-09 18:15:44 +00:00
|
|
|
|
2019-10-11 20:00:53 +00:00
|
|
|
[!_unconscious, _pain] call FUNC(effectPain);
|
|
|
|
[!_unconscious, _bleedingStrength, _manualUpdate] call FUNC(effectBleeding);
|
2017-03-18 16:53:57 +00:00
|
|
|
|
2021-10-12 12:16:30 +00:00
|
|
|
// - Tourniquets, fractures and splints indication ---------------------------------------
|
|
|
|
if (GVAR(enableHUDIndicators)) then {
|
|
|
|
[] call FUNC(handleHUDIndicators);
|
|
|
|
};
|
|
|
|
|
2017-03-18 16:53:57 +00:00
|
|
|
END_COUNTER(handleEffects);
|