mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
108ff4f644
Regex used: \[(.+?),(.+?),(.+?)\]\s+call\s+E?FUNC\((common,)?(target|object)Event\) [$1,$3,$2] call CBA_fnc_targetEvent E?FUNC\((common,)?(server|global|local)Event\) CBA_fnc_$2Event E?FUNC\((common,)?(add|remove)EventHandler\) CBA_fnc_$2EventHandler
51 lines
1.1 KiB
Plaintext
51 lines
1.1 KiB
Plaintext
/*
|
|
* Author: Garth 'L-H' de Wet, commy2
|
|
* Handles explosions.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* Function is handled? <BOOL>
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_unit"];
|
|
|
|
if (_unit != ACE_player) exitWith {true};
|
|
|
|
call FUNC(applyDirtEffect);
|
|
|
|
if (GETBROKEN) exitWith {true};
|
|
|
|
private ["_config", "_effects"];
|
|
|
|
_config = configFile >> "CfgGlasses" >> goggles _unit;
|
|
|
|
if ((_this select 1) call FUNC(GetExplosionIndex) < getNumber (_config >> "ACE_Resistance")) exitWith {true};
|
|
|
|
if !([_unit] call FUNC(isGogglesVisible)) exitWith {
|
|
["GlassesCracked", [_unit]] call CBA_fnc_localEvent;
|
|
true
|
|
};
|
|
|
|
_effects = GETGLASSES(_unit);
|
|
_effects set [BROKEN, true];
|
|
|
|
SETGLASSES(_unit,_effects);
|
|
|
|
if (getText (_config >> "ACE_OverlayCracked") != "") then {
|
|
if (call FUNC(ExternalCamera)) exitWith {};
|
|
|
|
if (isNull (GLASSDISPLAY)) then {
|
|
GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false];
|
|
};
|
|
|
|
(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText (_config >> "ACE_OverlayCracked");
|
|
};
|
|
|
|
["GlassesCracked", [_unit]] call CBA_fnc_localEvent;
|
|
true
|