mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
params, cleanup
This commit is contained in:
parent
4d8a9ae890
commit
fc6cd34d33
@ -15,8 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
//When getting knocked out in medical, trigger deadman explosives:
|
||||||
|
//Event is global, only run on server (ref: ace_medical_fnc_setUnconscious)
|
||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
//Event is global, only run on server (ref: ace_medical_fnc_setUnconscious)
|
|
||||||
["medical_onUnconscious", {
|
["medical_onUnconscious", {
|
||||||
params ["_unit", "_isUnconscious"];
|
params ["_unit", "_isUnconscious"];
|
||||||
if (!_isUnconscious) exitWith {};
|
if (!_isUnconscious) exitWith {};
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
EXPLODE_4_PVT(_this,_unit,_explosive,_magazineClass,_extra);
|
params ["_unit", "_explosive", "_magazineClass", "_extra"];
|
||||||
|
TRACE_4("params",_unit,_explosive,_magazineClass,_extra);
|
||||||
|
|
||||||
private["_config", "_detonators", "_hasRequired", "_requiredItems", "_code", "_count", "_codeSet"];
|
private["_config", "_detonators", "_hasRequired", "_requiredItems", "_code", "_count", "_codeSet"];
|
||||||
|
|
||||||
|
@ -17,8 +17,12 @@
|
|||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_unit", "_explosive", "_magazineClass"];
|
||||||
|
TRACE_3("params",_unit,_explosive,_magazineClass);
|
||||||
|
|
||||||
private ["_clacker", "_config", "_requiredItems", "_hasRequired", "_detonators"];
|
private ["_clacker", "_config", "_requiredItems", "_hasRequired", "_detonators"];
|
||||||
EXPLODE_3_PVT(_this,_unit,_explosive,_magazineClass);
|
|
||||||
// Config is the last item in the list of passed in items.
|
// Config is the last item in the list of passed in items.
|
||||||
_config = (_this select 3) select (count (_this select 3) - 1);
|
_config = (_this select 3) select (count (_this select 3) - 1);
|
||||||
|
|
||||||
|
@ -15,10 +15,13 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_unit", "_detonator"];
|
||||||
|
TRACE_2("params",_unit,_detonator);
|
||||||
|
|
||||||
private ["_result", "_item", "_children", "_range", "_required"];
|
private ["_result", "_item", "_children", "_range", "_required"];
|
||||||
|
|
||||||
EXPLODE_2_PVT(_this,_unit,_detonator);
|
_range = getNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range");
|
||||||
_range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range");
|
|
||||||
|
|
||||||
_result = [_unit] call FUNC(getPlacedExplosives);
|
_result = [_unit] call FUNC(getPlacedExplosives);
|
||||||
_children = [];
|
_children = [];
|
||||||
@ -44,6 +47,6 @@ _children = [];
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} foreach _result;
|
} forEach _result;
|
||||||
|
|
||||||
_children
|
_children
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Garth 'L-H' de Wet and CAA-Picard
|
* Author: Garth 'L-H' de Wet and CAA-Picard
|
||||||
*
|
* Adds sub actions for all explosive magazines (from insertChildren)
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Unit <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
@ -11,9 +11,11 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
private ["_mags", "_item", "_index", "_children", "_itemCount", "_list"];
|
|
||||||
|
|
||||||
EXPLODE_1_PVT(_this,_unit);
|
params ["_unit"];
|
||||||
|
TRACE_1("params",_unit);
|
||||||
|
|
||||||
|
private ["_mags", "_item", "_index", "_children", "_itemCount", "_list"];
|
||||||
|
|
||||||
_mags = magazines _unit;
|
_mags = magazines _unit;
|
||||||
_list = [];
|
_list = [];
|
||||||
@ -41,7 +43,7 @@ _children = [];
|
|||||||
[
|
[
|
||||||
[
|
[
|
||||||
format ["Explosive_%1", _forEachIndex],
|
format ["Explosive_%1", _forEachIndex],
|
||||||
format [_name + " (%1)", _itemCount select _foreachIndex],
|
format [_name + " (%1)", _itemCount select _forEachIndex],
|
||||||
getText(_x >> "picture"),
|
getText(_x >> "picture"),
|
||||||
{_this call FUNC(setupExplosive);},
|
{_this call FUNC(setupExplosive);},
|
||||||
{true},
|
{true},
|
||||||
@ -51,6 +53,6 @@ _children = [];
|
|||||||
[],
|
[],
|
||||||
_unit
|
_unit
|
||||||
];
|
];
|
||||||
} foreach _list;
|
} forEach _list;
|
||||||
|
|
||||||
_children
|
_children
|
||||||
|
@ -15,13 +15,16 @@
|
|||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_name", "_code"];
|
||||||
|
TRACE_2("params",_name,_code);
|
||||||
|
|
||||||
private ["_speedDial", "_found"];
|
private ["_speedDial", "_found"];
|
||||||
|
|
||||||
_speedDial = ace_player getVariable [QGVAR(SpeedDial), []];
|
_speedDial = ace_player getVariable [QGVAR(SpeedDial), []];
|
||||||
_found = false;
|
_found = false;
|
||||||
|
|
||||||
EXPLODE_2_PVT(_this,_name,_code);
|
if ((_code) == "") exitWith {
|
||||||
|
|
||||||
if ((_code) == "") ExitWith {
|
|
||||||
[_name] call FUNC(removeFromSpeedDial);
|
[_name] call FUNC(removeFromSpeedDial);
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
@ -29,7 +32,7 @@ if ((_code) == "") ExitWith {
|
|||||||
_speedDial set [_foreachindex, _this];
|
_speedDial set [_foreachindex, _this];
|
||||||
_found = true;
|
_found = true;
|
||||||
};
|
};
|
||||||
} foreach _speedDial;
|
} forEach _speedDial;
|
||||||
if (!_found) then {
|
if (!_found) then {
|
||||||
_speedDial pushBack _this;
|
_speedDial pushBack _this;
|
||||||
};
|
};
|
||||||
|
@ -14,8 +14,12 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
private ["_unit", "_children", "_config", "_detonators"];
|
|
||||||
_unit = _this select 0;
|
params ["_unit"];
|
||||||
|
TRACE_1("params",_unit);
|
||||||
|
|
||||||
|
private ["_children", "_config", "_detonators"];
|
||||||
|
|
||||||
_detonators = [_unit] call FUNC(getDetonators);
|
_detonators = [_unit] call FUNC(getDetonators);
|
||||||
_children = [];
|
_children = [];
|
||||||
{
|
{
|
||||||
@ -34,6 +38,6 @@ _children = [];
|
|||||||
[],
|
[],
|
||||||
ACE_Player
|
ACE_Player
|
||||||
];
|
];
|
||||||
} foreach _detonators;
|
} forEach _detonators;
|
||||||
|
|
||||||
_children
|
_children
|
||||||
|
@ -15,8 +15,11 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_magazine", "_explosive"];
|
||||||
|
TRACE_2("params",_magazine,_explosive);
|
||||||
|
|
||||||
private ["_hasRequiredItems","_triggerTypes", "_children", "_detonators", "_required", "_magTriggers", "_isAttached"];
|
private ["_hasRequiredItems","_triggerTypes", "_children", "_detonators", "_required", "_magTriggers", "_isAttached"];
|
||||||
EXPLODE_2_PVT(_this,_magazine,_explosive);
|
|
||||||
|
|
||||||
_isAttached = !isNull (attachedTo _explosive);
|
_isAttached = !isNull (attachedTo _explosive);
|
||||||
_detonators = [ACE_player] call FUNC(getDetonators);
|
_detonators = [ACE_player] call FUNC(getDetonators);
|
||||||
@ -51,6 +54,6 @@ _children = [];
|
|||||||
ACE_Player
|
ACE_Player
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
} foreach _triggerTypes;
|
} forEach _triggerTypes;
|
||||||
|
|
||||||
_children
|
_children
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Unit <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
|
* 0: Target <OBJECT>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Able to defuse <BOOL>
|
* Able to defuse <BOOL>
|
||||||
@ -14,8 +15,12 @@
|
|||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_unit", "_target"];
|
||||||
|
TRACE_2("params",_unit,_target);
|
||||||
|
|
||||||
private ["_isSpecialist"];
|
private ["_isSpecialist"];
|
||||||
EXPLODE_2_PVT(_this,_unit,_target);
|
|
||||||
if (isNull(_target getVariable [QGVAR(Explosive),objNull])) exitWith {
|
if (isNull(_target getVariable [QGVAR(Explosive),objNull])) exitWith {
|
||||||
deleteVehicle _target;
|
deleteVehicle _target;
|
||||||
false
|
false
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
private "_unit";
|
|
||||||
_unit = _this select 0;
|
|
||||||
|
|
||||||
[_unit] call FUNC(hasPlacedExplosives) and {count ([_unit] call FUNC(getDetonators)) > 0}
|
params ["_unit"];
|
||||||
|
|
||||||
|
([_unit] call FUNC(hasPlacedExplosives)) && {(count ([_unit] call FUNC(getDetonators))) > 0}
|
||||||
|
@ -15,9 +15,12 @@
|
|||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
EXPLODE_2_PVT(_this,_unit,_explosive);
|
|
||||||
|
|
||||||
if (GVAR(ExplodeOnDefuse) && (random 1.0) < getNumber(ConfigFile >> "CfgAmmo" >> typeOf _explosive >> "ACE_explodeOnDefuse")) exitWith {
|
params ["_unit", "_explosive"];
|
||||||
|
TRACE_2("params",_unit,_explosive);
|
||||||
|
|
||||||
|
if (GVAR(ExplodeOnDefuse) && {(random 1.0) < (getNumber (ConfigFile >> "CfgAmmo" >> typeOf _explosive >> "ACE_explodeOnDefuse"))}) exitWith {
|
||||||
|
TRACE_1("exploding on defuse",_explosive);
|
||||||
[_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive);
|
[_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,12 +19,16 @@
|
|||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
private ["_result", "_ignoreRange", "_helpers", "_pos"];
|
|
||||||
EXPLODE_3_PVT(_this,_unit,_range,_item);
|
params ["_unit", "_range", "_item"];
|
||||||
|
TRACE_3("params",_unit,_range,_item);
|
||||||
|
|
||||||
|
private ["_result", "_ignoreRange", "_pos"];
|
||||||
|
|
||||||
_ignoreRange = (_range == -1);
|
_ignoreRange = (_range == -1);
|
||||||
_result = true;
|
_result = true;
|
||||||
|
|
||||||
if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {false};
|
if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {TRACE_1("out of range",_range); false};
|
||||||
|
|
||||||
if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then {
|
if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then {
|
||||||
private ["_exp", "_previousExp"];
|
private ["_exp", "_previousExp"];
|
||||||
@ -40,11 +44,11 @@ if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhe
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
[{
|
[{
|
||||||
private ["_explosive"];
|
params ["_explosive"];
|
||||||
_explosive = _this;
|
TRACE_1("exploding",_explosive);
|
||||||
if (!isNull _explosive) then {
|
if (!isNull _explosive) then {
|
||||||
_explosive setDamage 1;
|
_explosive setDamage 1;
|
||||||
};
|
};
|
||||||
}, _item select 0, _item select 1, 0] call EFUNC(common,waitAndExecute);
|
}, [_item select 0], (_item select 1)] call EFUNC(common,waitAndExecute);
|
||||||
|
|
||||||
_result
|
_result
|
||||||
|
@ -15,8 +15,12 @@
|
|||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_unit", "_code"];
|
||||||
|
TRACE_2("params",_unit,_code);
|
||||||
|
|
||||||
private ["_arr", "_ran", "_i"];
|
private ["_arr", "_ran", "_i"];
|
||||||
EXPLODE_2_PVT(_this,_unit,_code);
|
|
||||||
if (_unit getVariable [QGVAR(Dialing),false]) exitWith {};
|
if (_unit getVariable [QGVAR(Dialing),false]) exitWith {};
|
||||||
if !(alive _unit) exitWith {};
|
if !(alive _unit) exitWith {};
|
||||||
_unit setVariable [QGVAR(Dialing), true, true];
|
_unit setVariable [QGVAR(Dialing), true, true];
|
||||||
@ -36,7 +40,7 @@ if (_unit == ace_player) then {
|
|||||||
[{
|
[{
|
||||||
playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75];
|
playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75];
|
||||||
(_this select 0) setVariable [QGVAR(Dialing), false, true];
|
(_this select 0) setVariable [QGVAR(Dialing), false, true];
|
||||||
}, [_unit,_explosive select 0], 0.25 * (count _arr - 4), 0] call EFUNC(common,waitAndExecute);
|
}, [_unit,_explosive select 0], 0.25 * (count _arr - 4)] call EFUNC(common,waitAndExecute);
|
||||||
[_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2)] call FUNC(startTimer);
|
[_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2)] call FUNC(startTimer);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -17,7 +17,10 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
EXPLODE_4_PVT(_this select 0,_unit,_i,_arr,_code);
|
|
||||||
|
params ["_args", "_pfID"];
|
||||||
|
_args params ["_unit", "_i", "_arr", "_code"];
|
||||||
|
|
||||||
if ((_i mod 4) == 0) then {
|
if ((_i mod 4) == 0) then {
|
||||||
playSound3D [QUOTE(PATHTO_R(Data\Audio\DialTone.wss)), objNull, false, (_unit modelToWorldVisual [0,0.2,2]), 15,1,2.5];
|
playSound3D [QUOTE(PATHTO_R(Data\Audio\DialTone.wss)), objNull, false, (_unit modelToWorldVisual [0,0.2,2]), 15,1,2.5];
|
||||||
};
|
};
|
||||||
@ -27,7 +30,7 @@ private "_explosive";
|
|||||||
_explosive = [_code] call FUNC(getSpeedDialExplosive);
|
_explosive = [_code] call FUNC(getSpeedDialExplosive);
|
||||||
|
|
||||||
if (_i >= (count _arr + 2)) then {
|
if (_i >= (count _arr + 2)) then {
|
||||||
[_this select 1] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
[_pfID] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
||||||
if ((count _explosive) > 0) then {
|
if ((count _explosive) > 0) then {
|
||||||
[_unit, -1, [_explosive select 0, _explosive select 2]] call FUNC(detonateExplosive);
|
[_unit, -1, [_explosive select 0, _explosive select 2]] call FUNC(detonateExplosive);
|
||||||
};
|
};
|
||||||
@ -41,4 +44,4 @@ if (_i == (count _arr)) then {
|
|||||||
playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_explosive select 0),3.16228,1,75];
|
playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_explosive select 0),3.16228,1,75];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
(_this select 0) set [1, _i + 1];
|
_args set [1, _i + 1];
|
||||||
|
@ -16,8 +16,11 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
// IGNORE_PRIVATE_WARNING(_detonators);
|
// IGNORE_PRIVATE_WARNING(_detonators);
|
||||||
|
|
||||||
private ["_unit", "_items", "_result", "_config"];
|
params ["_unit"];
|
||||||
_unit = _this select 0;
|
TRACE_1("params",_unit);
|
||||||
|
|
||||||
|
private ["_items", "_result", "_config"];
|
||||||
|
|
||||||
_items = (items _unit);
|
_items = (items _unit);
|
||||||
_result = [];
|
_result = [];
|
||||||
|
|
||||||
|
@ -18,8 +18,11 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
// IGNORE_PRIVATE_WARNING(_allExplosives,_deadmanExplosives);
|
// IGNORE_PRIVATE_WARNING(_allExplosives,_deadmanExplosives);
|
||||||
|
|
||||||
private ["_unit", "_clackerList", "_adjustedList", "_list", "_filter"];
|
params ["_unit"];
|
||||||
_unit = _this select 0;
|
TRACE_1("params",_unit);
|
||||||
|
|
||||||
|
private ["_clackerList", "_adjustedList", "_list", "_filter"];
|
||||||
|
|
||||||
_filter = nil;
|
_filter = nil;
|
||||||
if (count _this > 1) then {
|
if (count _this > 1) then {
|
||||||
_filter = ConfigFile >> "ACE_Triggers" >> (_this select 1);
|
_filter = ConfigFile >> "ACE_Triggers" >> (_this select 1);
|
||||||
@ -30,14 +33,14 @@ _clackerList = _unit getVariable [QGVAR(Clackers), []];
|
|||||||
_list = [];
|
_list = [];
|
||||||
{
|
{
|
||||||
if (isNull (_x select 0)) then {
|
if (isNull (_x select 0)) then {
|
||||||
_clackerList set [_foreachIndex, "X"];
|
_clackerList set [_forEachIndex, "X"];
|
||||||
_adjustedList = true;
|
_adjustedList = true;
|
||||||
} else {
|
} else {
|
||||||
if (isNil "_filter" || {(ConfigFile >> "ACE_Triggers" >> (_x select 4)) == _filter}) then {
|
if (isNil "_filter" || {(ConfigFile >> "ACE_Triggers" >> (_x select 4)) == _filter}) then {
|
||||||
_list pushBack _x;
|
_list pushBack _x;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} foreach _clackerList;
|
} forEach _clackerList;
|
||||||
if (_adjustedList) then {
|
if (_adjustedList) then {
|
||||||
_clackerList = _clackerList - ["X"];
|
_clackerList = _clackerList - ["X"];
|
||||||
if (count _clackerList == 0) then {
|
if (count _clackerList == 0) then {
|
||||||
|
@ -14,8 +14,12 @@
|
|||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
EXPLODE_1_PVT(_this,_code);
|
|
||||||
|
params ["_code"];
|
||||||
|
TRACE_1("params",_code);
|
||||||
|
|
||||||
private ["_explosive"];
|
private ["_explosive"];
|
||||||
|
|
||||||
if (isNil QGVAR(CellphoneIEDs)) exitWith {[]};
|
if (isNil QGVAR(CellphoneIEDs)) exitWith {[]};
|
||||||
_explosive = [];
|
_explosive = [];
|
||||||
{
|
{
|
||||||
@ -24,4 +28,5 @@ _explosive = [];
|
|||||||
};
|
};
|
||||||
false
|
false
|
||||||
} count GVAR(CellphoneIEDs);
|
} count GVAR(CellphoneIEDs);
|
||||||
|
|
||||||
_explosive
|
_explosive
|
||||||
|
@ -9,16 +9,18 @@
|
|||||||
* The unit has explosives <BOOL>
|
* The unit has explosives <BOOL>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* _hasExplosives = [player] call ACE_Explosives_fnc_hasExplosives;
|
* hasExplosives = [player] call ACE_Explosives_fnc_hasExplosives;
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
// IGNORE_PRIVATE_WARNING(_hasExplosives);
|
|
||||||
|
|
||||||
private ["_unit", "_result", "_magazines"];
|
params ["_unit"];
|
||||||
|
TRACE_1("params",_unit);
|
||||||
|
|
||||||
|
private ["_result", "_magazines"];
|
||||||
|
|
||||||
_result = false;
|
_result = false;
|
||||||
_unit = _this select 0;
|
|
||||||
_magazines = magazines _unit;
|
_magazines = magazines _unit;
|
||||||
{
|
{
|
||||||
if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> "ACE_Placeable") == 1) exitWith {
|
if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> "ACE_Placeable") == 1) exitWith {
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_1(_interactionType);
|
params ["_interactionType"];
|
||||||
|
TRACE_1("params",_interactionType);
|
||||||
|
|
||||||
//Ignore self-interaction menu
|
//Ignore self-interaction menu
|
||||||
if (_interactionType != 0) exitWith {};
|
if (_interactionType != 0) exitWith {};
|
||||||
@ -26,8 +27,8 @@ if ((vehicle ACE_player) != ACE_player) exitWith {};
|
|||||||
if (!("ACE_DefusalKit" in (items ACE_player))) exitWith {};
|
if (!("ACE_DefusalKit" in (items ACE_player))) exitWith {};
|
||||||
|
|
||||||
[{
|
[{
|
||||||
PARAMS_2(_args,_pfID);
|
params ["_args", "_pfID"];
|
||||||
EXPLODE_3_PVT(_args,_setPosition,_addedDefuseHelpers,_minesHelped);
|
_args params ["_setPosition", "_addedDefuseHelpers", "_minesHelped"];
|
||||||
|
|
||||||
if (!EGVAR(interact_menu,keyDown)) then {
|
if (!EGVAR(interact_menu,keyDown)) then {
|
||||||
TRACE_1("Cleaning Defuse Helpers",(count _addedDefuseHelpers));
|
TRACE_1("Cleaning Defuse Helpers",(count _addedDefuseHelpers));
|
||||||
|
@ -14,20 +14,13 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if !(isServer) exitWith {};
|
if !(isServer) exitWith {};
|
||||||
|
|
||||||
private["_activated", "_logic"];
|
params ["_logic"];
|
||||||
|
|
||||||
_logic = _this select 0;
|
[_logic, QGVAR(RequireSpecialist), "RequireSpecialist"] call EFUNC(Common,readSettingFromModule);
|
||||||
_activated = _this select 2;
|
[_logic, QGVAR(PunishNonSpecialists),"PunishNonSpecialists"] call EFUNC(Common,readSettingFromModule);
|
||||||
|
[_logic, QGVAR(ExplodeOnDefuse),"ExplodeOnDefuse"] call EFUNC(Common,readSettingFromModule);
|
||||||
if !(_activated) exitWith {};
|
|
||||||
|
|
||||||
[_logic, QGVAR(RequireSpecialist), "RequireSpecialist"]
|
|
||||||
call EFUNC(Common,readSettingFromModule);
|
|
||||||
[_logic, QGVAR(PunishNonSpecialists),"PunishNonSpecialists"]
|
|
||||||
call EFUNC(Common,readSettingFromModule);
|
|
||||||
[_logic, QGVAR(ExplodeOnDefuse),"ExplodeOnDefuse"]
|
|
||||||
call EFUNC(Common,readSettingFromModule);
|
|
||||||
|
|
||||||
diag_log text "[ACE]: Explosive Module Initialized.";
|
diag_log text "[ACE]: Explosive Module Initialized.";
|
||||||
|
@ -15,11 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_1(_unit); //Extended_Killed_EventHandlers runs only where _unit is local
|
//NOTE: Extended_Killed_EventHandlers runs only where _unit is local
|
||||||
|
params ["_unit"];
|
||||||
|
TRACE_1("params",_unit);
|
||||||
|
|
||||||
private ["_deadman"];
|
private ["_deadman"];
|
||||||
|
|
||||||
_deadman = [_unit, "DeadManSwitch"] call FUNC(getPlacedExplosives);
|
_deadman = [_unit, "DeadManSwitch"] call FUNC(getPlacedExplosives);
|
||||||
{
|
{
|
||||||
[_unit, -1, _x, true] call FUNC(detonateExplosive);
|
[_unit, -1, _x, true] call FUNC(detonateExplosive);
|
||||||
} foreach _deadman;
|
} forEach _deadman;
|
||||||
|
@ -17,8 +17,11 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_receiver", "_giver", "_item"];
|
||||||
|
TRACE_3("params",_receiver,_giver,_item);
|
||||||
|
|
||||||
private ["_config", "_detonators"];
|
private ["_config", "_detonators"];
|
||||||
PARAMS_3(_receiver,_giver,_item);
|
|
||||||
|
|
||||||
if (_receiver != ace_player) exitWith {};
|
if (_receiver != ace_player) exitWith {};
|
||||||
|
|
||||||
|
@ -15,7 +15,10 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
EXPLODE_2_PVT(_this,_explosive,_mag);
|
|
||||||
|
params ["_explosive", "_mag"];
|
||||||
|
TRACE_2("params",_explosive,_mag);
|
||||||
|
|
||||||
createDialog "RscACE_SelectTimeUI";
|
createDialog "RscACE_SelectTimeUI";
|
||||||
sliderSetRange [8845, 5, 900]; // 5seconds - 15minutes
|
sliderSetRange [8845, 5, 900]; // 5seconds - 15minutes
|
||||||
sliderSetPosition [8845, 30];
|
sliderSetPosition [8845, 30];
|
||||||
|
@ -21,9 +21,11 @@
|
|||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
private ["_ammo", "_explosive", "_attachedTo", "_expPos", "_magazineTrigger"];
|
|
||||||
EXPLODE_6_PVT(_this,_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars);
|
params ["_unit", "_pos", "_dir", "_magazineClass", "_triggerConfig", "_triggerSpecificVars", ["_setupPlaceholderObject", objNull]];
|
||||||
DEFAULT_PARAM(6,_setupPlaceholderObject,objNull);
|
TRACE_7("params",_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars,_setupPlaceholderObject);
|
||||||
|
|
||||||
|
private ["_ammo", "_explosive", "_attachedTo", "_magazineTrigger"];
|
||||||
|
|
||||||
_unit playActionNow "PutDown";
|
_unit playActionNow "PutDown";
|
||||||
|
|
||||||
|
@ -14,13 +14,15 @@
|
|||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private "_speedDial";
|
private "_speedDial";
|
||||||
|
|
||||||
_speedDial = ace_player getVariable [QGVAR(SpeedDial), []];
|
_speedDial = ace_player getVariable [QGVAR(SpeedDial), []];
|
||||||
if (count _speedDial == 0) exitWith {};
|
if (count _speedDial == 0) exitWith {};
|
||||||
{
|
{
|
||||||
if ((_x select 0) == (_this select 0)) exitWith {
|
if ((_x select 0) == (_this select 0)) exitWith {
|
||||||
_speedDial set [_foreachIndex, "x"];
|
_speedDial set [_forEachIndex, "x"];
|
||||||
_speedDial = _speedDial - ["x"];
|
_speedDial = _speedDial - ["x"];
|
||||||
ace_player setVariable [QGVAR(SpeedDial),_speedDial];
|
ace_player setVariable [QGVAR(SpeedDial),_speedDial];
|
||||||
};
|
};
|
||||||
} foreach _speedDial;
|
} forEach _speedDial;
|
||||||
|
@ -16,9 +16,12 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_explosive", "_magazine", "_trigger"];
|
||||||
|
TRACE_3("params",_explosive,_magazine,_trigger);
|
||||||
|
|
||||||
private ["_config"];
|
private ["_config"];
|
||||||
|
|
||||||
EXPLODE_3_PVT(_this,_explosive,_magazine,_trigger);
|
|
||||||
_config = ConfigFile >> "ACE_Triggers" >> _trigger;
|
_config = ConfigFile >> "ACE_Triggers" >> _trigger;
|
||||||
|
|
||||||
// If the onSetup function returns true, it is handled elsewhere
|
// If the onSetup function returns true, it is handled elsewhere
|
||||||
|
@ -17,7 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
EXPLODE_3_PVT(_this,_explosive,_direction,_pitch);
|
params ["_explosive", "_direction", "_pitch"];
|
||||||
|
TRACE_3("params",_explosive,_direction,_pitch);
|
||||||
|
|
||||||
if (isNull (attachedTo _explosive)) then {
|
if (isNull (attachedTo _explosive)) then {
|
||||||
_explosive setDir _direction;
|
_explosive setDir _direction;
|
||||||
|
@ -15,7 +15,9 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_speedDial", "_amount"];
|
private ["_speedDial", "_amount"];
|
||||||
|
|
||||||
_speedDial = ace_player getVariable [QGVAR(SpeedDial), []];
|
_speedDial = ace_player getVariable [QGVAR(SpeedDial), []];
|
||||||
if (count _speedDial == 0) exitWith {};
|
if (count _speedDial == 0) exitWith {};
|
||||||
_amount = if((_this select 0))then{1}else{-1};
|
_amount = if((_this select 0))then{1}else{-1};
|
||||||
|
@ -21,7 +21,8 @@
|
|||||||
#define PLACE_RANGE_MAX 1
|
#define PLACE_RANGE_MAX 1
|
||||||
#define PLACE_RANGE_MIN 0.025
|
#define PLACE_RANGE_MIN 0.025
|
||||||
|
|
||||||
PARAMS_3(_vehicle,_unit,_magClassname);
|
params ["_vehicle", "_unit", "_magClassname"];
|
||||||
|
TRACE_3("params",_vehicle,_unit,_magClassname);
|
||||||
|
|
||||||
private["_isAttachable", "_setupObjectClass", "_supportedTriggers", "_p3dModel"];
|
private["_isAttachable", "_setupObjectClass", "_supportedTriggers", "_p3dModel"];
|
||||||
|
|
||||||
@ -58,8 +59,8 @@ GVAR(TweakedAngle) = 0;
|
|||||||
[{
|
[{
|
||||||
BEGIN_COUNTER(pfeh);
|
BEGIN_COUNTER(pfeh);
|
||||||
|
|
||||||
PARAMS_2(_args,_pfID);
|
params ["_args", "_pfID"];
|
||||||
EXPLODE_4_PVT(_args,_unit,_magClassname,_setupObjectClass,_isAttachable);
|
_args params ["_unit", "_magClassname", "_setupObjectClass", "_isAttachable"];
|
||||||
|
|
||||||
private["_angle", "_attachVehicle", "_badPosition", "_basePosASL", "_cameraAngle", "_distanceFromBase", "_expSetupVehicle", "_index", "_intersectsWith", "_lookDirVector", "_max", "_min", "_modelDir", "_modelOffset", "_modelUp", "_placeAngle", "_realDistance", "_return", "_screenPos", "_testBase", "_testPos", "_testPositionIsValid", "_virtualPosASL"];
|
private["_angle", "_attachVehicle", "_badPosition", "_basePosASL", "_cameraAngle", "_distanceFromBase", "_expSetupVehicle", "_index", "_intersectsWith", "_lookDirVector", "_max", "_min", "_modelDir", "_modelOffset", "_modelUp", "_placeAngle", "_realDistance", "_return", "_screenPos", "_testBase", "_testPos", "_testPositionIsValid", "_virtualPosASL"];
|
||||||
|
|
||||||
|
@ -15,14 +15,17 @@
|
|||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
EXPLODE_2_PVT(_this,_unit,_target);
|
|
||||||
|
params ["_unit", "_target"];
|
||||||
|
TRACE_2("params",_unit,_target);
|
||||||
|
|
||||||
private["_actionToPlay", "_defuseTime", "_isEOD"];
|
private["_actionToPlay", "_defuseTime", "_isEOD"];
|
||||||
|
|
||||||
_target = attachedTo (_target);
|
_target = attachedTo (_target);
|
||||||
|
|
||||||
_fnc_DefuseTime = {
|
_fnc_DefuseTime = {
|
||||||
EXPLODE_2_PVT(_this,_specialist,_target);
|
params ["_specialist", "_target"];
|
||||||
|
TRACE_2("defuseTime",_specialist,_target);
|
||||||
private ["_defuseTime"];
|
private ["_defuseTime"];
|
||||||
_defuseTime = 5;
|
_defuseTime = 5;
|
||||||
if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime")) then {
|
if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime")) then {
|
||||||
@ -48,11 +51,12 @@ if (ACE_player != _unit) then {
|
|||||||
_unit disableAI "TARGET";
|
_unit disableAI "TARGET";
|
||||||
_defuseTime = [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime;
|
_defuseTime = [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime;
|
||||||
[{
|
[{
|
||||||
PARAMS_2(_unit,_target);
|
params ["_unit", "_target"];
|
||||||
|
TRACE_2("defuse finished",_unit,_target);
|
||||||
[_unit, _target] call FUNC(defuseExplosive);
|
[_unit, _target] call FUNC(defuseExplosive);
|
||||||
_unit enableAI "MOVE";
|
_unit enableAI "MOVE";
|
||||||
_unit enableAI "TARGET";
|
_unit enableAI "TARGET";
|
||||||
}, [_unit, _target], _defuseTime, 0] call EFUNC(common,waitAndExecute);
|
}, [_unit, _target], _defuseTime] call EFUNC(common,waitAndExecute);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
_unit playActionNow _actionToPlay;
|
_unit playActionNow _actionToPlay;
|
||||||
|
@ -16,12 +16,13 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
EXPLODE_2_PVT(_this,_explosive,_delay);
|
params ["_explosive", "_delay"];
|
||||||
|
TRACE_2("params",_explosive,_delay);
|
||||||
|
|
||||||
[{
|
[{
|
||||||
private ["_explosive"];
|
params ["_explosive"];
|
||||||
_explosive = _this;
|
TRACE_1("Explosive Going Boom",_explosive);
|
||||||
if (!isNull _explosive) then {
|
if (!isNull _explosive) then {
|
||||||
[_explosive, -1, [_explosive, 0]] call FUNC(detonateExplosive);
|
[_explosive, -1, [_explosive, 0]] call FUNC(detonateExplosive);
|
||||||
};
|
};
|
||||||
}, _explosive, _delay, 0] call EFUNC(common,waitAndExecute);
|
}, [_explosive], _delay] call EFUNC(common,waitAndExecute);
|
||||||
|
@ -15,10 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_magazineClassname"];
|
||||||
|
TRACE_1("params",_magazineClassname);
|
||||||
|
|
||||||
private["_result", "_config", "_count", "_index"];
|
private["_result", "_config", "_count", "_index"];
|
||||||
|
|
||||||
_result = [];
|
_result = [];
|
||||||
_config = getArray (ConfigFile >> "CfgMagazines" >> (_this select 0) >> "ACE_Triggers" >> "SupportedTriggers");
|
_config = getArray (ConfigFile >> "CfgMagazines" >> _magazineClassname >> "ACE_Triggers" >> "SupportedTriggers");
|
||||||
_count = count _config;
|
_count = count _config;
|
||||||
|
|
||||||
for "_index" from 0 to (_count - 1) do {
|
for "_index" from 0 to (_count - 1) do {
|
||||||
|
Loading…
Reference in New Issue
Block a user