2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2021-10-26 12:09:45 +00:00
|
|
|
/*
|
2023-08-16 23:18:01 +00:00
|
|
|
* Author: tcvm, veteran29
|
2021-10-26 12:09:45 +00:00
|
|
|
* Handles burning reactions of an unit, like screaming or throwing the weapons away due to pain.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
2021-11-09 02:48:54 +00:00
|
|
|
* 1: Should unit throw its current weapon <BOOL>
|
2021-10-26 12:09:45 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2021-11-09 02:48:54 +00:00
|
|
|
params ["_unit", ["_throwWeapon", true]];
|
2021-10-26 12:09:45 +00:00
|
|
|
|
|
|
|
if (
|
2021-11-09 02:48:54 +00:00
|
|
|
_throwWeapon
|
|
|
|
&& {GVAR(dropWeapon) > 0}
|
2021-12-18 23:15:32 +00:00
|
|
|
&& {_unit in _unit && {(currentWeapon _unit) isNotEqualTo ""}}
|
2023-09-09 06:24:41 +00:00
|
|
|
&& {!isPlayer _unit || GVAR(dropWeapon) >= 2}
|
2021-10-26 12:09:45 +00:00
|
|
|
) then {
|
2023-09-09 06:17:24 +00:00
|
|
|
[_unit] call EFUNC(common,throwWeapon);
|
2021-10-26 12:09:45 +00:00
|
|
|
};
|
|
|
|
|
2021-11-09 02:48:54 +00:00
|
|
|
if (_unit isKindOf "CAManBase") then {
|
|
|
|
private _soundID = floor (1 + random 15);
|
|
|
|
private _sound = format [QGVAR(scream_%1), _soundID];
|
|
|
|
[QGVAR(playScream), [_sound, _unit]] call CBA_fnc_globalEvent;
|
|
|
|
};
|