ACE3/addons/hearing/functions/fnc_earRinging.sqf

39 lines
908 B
Plaintext
Raw Normal View History

/*
2015-06-13 15:16:18 +00:00
* Author: KoffeinFlummi, commy2, Rocko, Rommel, Ruthberg
* Ear ringing PFH
*
* Arguments:
2015-06-13 15:16:18 +00:00
* 0: unit <OBJECT>
2015-03-15 21:40:47 +00:00
* 1: strength of ear ringing (Number between 0 and 1) <NUMBER>
*
* Return Value:
2015-03-15 21:40:47 +00:00
* None
*
* Example:
2015-06-13 15:16:18 +00:00
* [_unit, _strength] call ace_hearing_fnc_earRinging
2015-03-15 21:40:47 +00:00
*
* Public: No
*/
2015-01-14 01:41:53 +00:00
#include "script_component.hpp"
2015-06-13 15:16:18 +00:00
PARAMS_2(_unit,_strength);
2015-07-11 02:01:32 +00:00
if (_unit != ACE_player) exitWith {};
2015-06-13 15:16:18 +00:00
if (_strength < 0.05) exitWith {};
2015-07-13 19:01:41 +00:00
if (!isNull curatorCamera) exitWith {};
2015-01-13 04:17:52 +00:00
if (_unit getVariable ["ACE_hasEarPlugsin", false]) then {
2015-03-15 21:40:47 +00:00
_strength = _strength / 4;
};
2015-07-01 19:21:09 +00:00
//headgear hearing protection
if(headgear _unit != "") then {
private ["_protection"];
_protection = (getNumber (configFile >> "CfgWeapons" >> (headgear _unit) >> QGVAR(protection))) min 1;
if(_protection > 0) then {
_strength = _strength * (1 - _protection);
};
};
2015-07-11 02:01:32 +00:00
GVAR(deafnessDV) = GVAR(deafnessDV) + _strength;