ACE3/addons/medical_ui/functions/fnc_effectHeartBeat.sqf

33 lines
803 B
Plaintext
Raw Normal View History

2017-01-29 19:24:16 +00:00
/*
* Author: BaerMitUmlaut
* Handles the hear beat sound.
*
* Arguments:
* None
*
* Return Value:
* None
*/
#include "script_component.hpp"
2017-01-29 20:11:27 +00:00
private _heartRate = ACE_player getVariable [QEGVAR(medical,heartRate), DEFAULT_HEART_RATE];
if (_heartRate == 0) exitWith {GVAR(heartBeatEffectRunning) = false;};
2017-01-29 20:20:55 +00:00
private _waitTime = 60 / _heartRate;
2017-01-29 19:24:16 +00:00
switch (true) do {
case (_heartRate > 160): {
playSound SND_HEARBEAT_FAST;
[DFUNC(effectHeartBeat), [], _waitTime] call CBA_fnc_waitAndExecute;
};
case (_heartRate < 60): {
playSound SND_HEARBEAT_SLOW;
[DFUNC(effectHeartBeat), [], _waitTime] call CBA_fnc_waitAndExecute;
2017-01-29 19:24:16 +00:00
};
default {
TRACE_1("Ending heart beat effect",_heartRate);
GVAR(heartBeatEffectRunning) = false;
2017-01-29 19:24:16 +00:00
};
};