ACE3/addons/medical_ui/functions/fnc_effectHeartBeat.sqf

30 lines
639 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];
2017-01-29 19:24:16 +00:00
private _waitTime = 60 / _heartRate;
if (_heartRate == 0) exitWith {};
if (CBA_missionTime - GVAR(lastHeartBeatSound) > _waitTime) then {
GVAR(lastHeartBeatSound) = CBA_missionTime;
switch (true) do {
case (_heartRate > 160): {
playSound SND_HEARBEAT_FAST;
};
case (_heartRate < 60): {
playSound SND_HEARBEAT_SLOW;
};
};
};