2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-09-29 20:24:25 +00:00
|
|
|
/*
|
|
|
|
* Author: Garth 'L-H' de Wet, commy2
|
|
|
|
* Handles explosions.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Function is handled? <BOOL>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [bob] call ace_goggles_fnc_handleExplosion
|
|
|
|
*
|
2015-09-29 20:24:25 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_unit"];
|
|
|
|
|
|
|
|
if (_unit != ACE_player) exitWith {true};
|
|
|
|
|
|
|
|
call FUNC(applyDirtEffect);
|
|
|
|
|
|
|
|
if (GETBROKEN) exitWith {true};
|
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _config = configFile >> "CfgGlasses" >> goggles _unit;
|
2015-09-29 20:24:25 +00:00
|
|
|
|
|
|
|
if ((_this select 1) call FUNC(GetExplosionIndex) < getNumber (_config >> "ACE_Resistance")) exitWith {true};
|
|
|
|
|
|
|
|
if !([_unit] call FUNC(isGogglesVisible)) exitWith {
|
2016-05-24 13:13:11 +00:00
|
|
|
["ace_glassesCracked", [_unit]] call CBA_fnc_localEvent;
|
2015-09-29 20:24:25 +00:00
|
|
|
true
|
|
|
|
};
|
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _effects = GETGLASSES(_unit);
|
2015-09-29 20:24:25 +00:00
|
|
|
_effects set [BROKEN, true];
|
|
|
|
|
|
|
|
SETGLASSES(_unit,_effects);
|
|
|
|
|
|
|
|
if (getText (_config >> "ACE_OverlayCracked") != "") then {
|
|
|
|
if (call FUNC(ExternalCamera)) exitWith {};
|
|
|
|
|
|
|
|
if (isNull (GLASSDISPLAY)) then {
|
2023-11-04 20:57:38 +00:00
|
|
|
GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false, false];
|
2015-09-29 20:24:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText (_config >> "ACE_OverlayCracked");
|
|
|
|
};
|
|
|
|
|
2016-05-24 13:13:11 +00:00
|
|
|
["ace_glassesCracked", [_unit]] call CBA_fnc_localEvent;
|
2015-09-29 20:24:25 +00:00
|
|
|
true
|