add emp functionality
This commit is contained in:
45
framework/emp/functions/fn_applyLocalUnitEffects.sqf
Normal file
45
framework/emp/functions/fn_applyLocalUnitEffects.sqf
Normal file
@@ -0,0 +1,45 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
params [["_obj", objNull, [objNull]]];
|
||||
if (isNull _obj) exitWith {};
|
||||
if !(local _obj) exitWith {};
|
||||
|
||||
//handle lights for 'special' objects
|
||||
{
|
||||
params ["_lightClassName", "_hitIndexes"];
|
||||
if ((typeOf _object) isEqualTo _lightClassName) then {
|
||||
{
|
||||
_object setHitIndex [_hitIndex, GVAR(lightHitPointDamageToApply)];
|
||||
} forEach _hitIndexes;
|
||||
};
|
||||
} forEach GVAR(specialLightTypes);
|
||||
|
||||
//set veh light status
|
||||
_obj engineOn false;
|
||||
_obj setCollisionLight false;
|
||||
_obj setPilotLight false;
|
||||
|
||||
//set damage on engines (motor and instruments)
|
||||
_obj setHitPointDamage ["hitEngine", 0.9];
|
||||
_obj setHitPointDamage ["HitAvionics", 0.9];
|
||||
|
||||
//for player units
|
||||
if (isPlayer _obj) then {
|
||||
_obj action ["IRLaserOff", _obj];
|
||||
_obj action ["nvGogglesOff", _obj];
|
||||
_nvgs = hmd _obj;
|
||||
_obj unassignItem _nvgs;
|
||||
_obj removeItem _nvgs;
|
||||
_radio = _obj getSlotItemName 611;
|
||||
_gps = _obj getSlotItemName 612;
|
||||
_obj unassignItem _radio;
|
||||
_obj removeItem _radio;
|
||||
_obj unassignItem _gps;
|
||||
_obj removeItem _gps;
|
||||
_obj unassignItem "ACE_microDAGR";
|
||||
_obj removeItem "ACE_microDAGR";
|
||||
_obj unassignItem "MineDetector";
|
||||
_obj removeItem "MineDetector";
|
||||
};
|
||||
|
||||
true;
|
||||
Reference in New Issue
Block a user