mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Random clean ups and explosive can now detonate with their object.
Defuse object doesn't get cleaned up on it's own. But if a player comes near it with interact menu on it will get cleaned up.
This commit is contained in:
parent
7d5555a2e0
commit
452947148a
@ -66,7 +66,7 @@ class CfgVehicles {
|
||||
condition = "true";
|
||||
class ACE_Defuse {
|
||||
displayName = $STR_ACE_Explosives_Defuse;
|
||||
condition = QUOTE([_player] call FUNC(canDefuse));
|
||||
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canDefuse));
|
||||
statement = QUOTE([ARR_2(_player,_target)] call FUNC(startDefuse););
|
||||
exceptions[] = {"isNotSwimming"};
|
||||
showDisabled = 0;
|
||||
|
@ -17,10 +17,8 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_unit", "_explosive", "_clacker", "_config", "_magazineClass", "_requiredItems", "_hasRequired"];
|
||||
_unit = _this select 0;
|
||||
_explosive = _this select 1;
|
||||
_magazineClass = _this select 2;
|
||||
private ["_clacker", "_config", "_requiredItems", "_hasRequired"];
|
||||
EXPLODE_3_PVT(_this,_unit,_explosive,_magazineClass);
|
||||
// Config is the last item in the list of passed in items.
|
||||
_config = (_this select 3) select (count (_this select 3) - 1);
|
||||
|
||||
|
@ -15,10 +15,9 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_unit","_result", "_item", "_children"];
|
||||
private ["_result", "_item", "_children"];
|
||||
call EFUNC(interaction,hideMenu);
|
||||
_unit = _this select 0;
|
||||
_detonator = _this select 1;
|
||||
EXPLODE_2_PVT(_this,_unit,_detonator);
|
||||
_range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range");
|
||||
|
||||
_result = [_unit] call FUNC(getPlacedExplosives);
|
||||
|
@ -15,9 +15,9 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_magazine", "_hasRequiredItems","_triggerTypes", "_children", "_detonators", "_required", "_magTriggers"];
|
||||
_magazine = _this select 0;
|
||||
_explosive = _this select 1;
|
||||
private ["_hasRequiredItems","_triggerTypes", "_children",
|
||||
"_detonators", "_required", "_magTriggers"];
|
||||
EXPLODE_2_PVT(_this,_magazine,_explosive);
|
||||
_detonators = [ACE_player] call FUNC(getDetonators);
|
||||
|
||||
_triggerTypes = [_magazine] call FUNC(triggerType);
|
||||
@ -37,9 +37,11 @@ _children = [];
|
||||
[
|
||||
format ["Trigger_%1", _forEachIndex],
|
||||
if(isText(_magTriggers >> configName _x >> "displayName"))then
|
||||
{getText(_magTriggers >> configName _x >> "displayName")}else{getText(_x >> "displayName")},
|
||||
{getText(_magTriggers >> configName _x >> "displayName")}
|
||||
else{getText(_x >> "displayName")},
|
||||
if(isText(_magTriggers >> configName _x >> "picture"))then
|
||||
{getText(_magTriggers >> configName _x >> "picture")}else{getText(_x >> "picture")},
|
||||
{getText(_magTriggers >> configName _x >> "picture")}
|
||||
else{getText(_x >> "picture")},
|
||||
{(_this select 2) call FUNC(selectTrigger);},
|
||||
{true},
|
||||
{},
|
||||
|
@ -14,8 +14,12 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private "_unit";
|
||||
_unit = _this select 0;
|
||||
private ["_specialist"];
|
||||
EXPLODE_2_PVT(_this,_unit,_target);
|
||||
if (isNull(_target getVariable [QGVAR(Explosive),objNull])) exitWith {
|
||||
deleteVehicle _target;
|
||||
false
|
||||
};
|
||||
if (vehicle _unit != _unit || {!("ACE_DefusalKit" in (items _unit))}) exitWith {false};
|
||||
_isSpecialist = [_unit] call EFUNC(Common,isEOD);
|
||||
|
||||
|
@ -15,18 +15,16 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_unit", "_explosive"];
|
||||
_unit = _this select 0;
|
||||
_explosive = _this select 1;
|
||||
EXPLODE_2_PVT(_this,_unit,_explosive);
|
||||
|
||||
if (getNumber (ConfigFile >> "CfgAmmo" >> typeof _explosive >> "ACE_explodeOnDefuse") == 1) exitWith {
|
||||
[_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive);
|
||||
};
|
||||
|
||||
_helper = (attachedTo _explosive);
|
||||
if (!isNull(_helper)) then {
|
||||
detach _explosive;
|
||||
deleteVehicle _helper;
|
||||
};
|
||||
{
|
||||
detach _x;
|
||||
deleteVehicle _x;
|
||||
false
|
||||
} count (attachedObjects (_explosive));
|
||||
|
||||
_unit action ["Deactivate", _unit, _explosive];
|
||||
|
@ -19,10 +19,8 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_item","_result", "_ignoreRange", "_unit", "_range"];
|
||||
_unit = _this select 0;
|
||||
_range = _this select 1;
|
||||
_item = _this select 2;
|
||||
private ["_result", "_ignoreRange", "_helper"];
|
||||
EXPLODE_3_PVT(_this,_unit,_range,_item);
|
||||
_ignoreRange = (_range == -1);
|
||||
_result = true;
|
||||
|
||||
|
@ -27,7 +27,7 @@ _adjustedList = false;
|
||||
_clackerList = _unit getVariable [QGVAR(Clackers), []];
|
||||
_list = [];
|
||||
{
|
||||
if isNull (_x select 0) then {
|
||||
if (isNull (_x select 0)) then {
|
||||
_clackerList set [_foreachIndex, "X"];
|
||||
_adjustedList = true;
|
||||
} else {
|
||||
|
@ -14,7 +14,6 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_obj"];
|
||||
if (isNull(GVAR(Setup)) || {ACE_Modifier == 0} || !GVAR(pfeh_running)) exitWith {false};
|
||||
_this = _this * 5;
|
||||
GVAR(Setup) setDir ((getDir GVAR(Setup)) + _this);
|
||||
|
@ -12,27 +12,28 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
if (!((_this select 0) getVariable [QGVAR(Handled), false])) then {
|
||||
(_this select 0) setVariable [QGVAR(Handled), true];
|
||||
if (!isNull (_this select 1) && {(_this select 1) isKindOf "AllVehicles"}) then {
|
||||
_player RemoveMagazine _mag;
|
||||
_explosive attachTo [(_this select 1)];
|
||||
_dir = _dir - (getDir (_this select 1));
|
||||
[[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc);
|
||||
} else {
|
||||
[{
|
||||
EXPLODE_2_PVT(_this,_player,_explosive);
|
||||
private ["_pos"];
|
||||
_player setVariable [QGVAR(PlantingExplosive), false];
|
||||
EXPLODE_2_PVT(_this,_explosive,_hitTarget);
|
||||
|
||||
if ((_explosive getVariable [QGVAR(Handled), false])) exitWith {};
|
||||
|
||||
_explosive setVariable [QGVAR(Handled), true];
|
||||
if (!isNull _hitTarget && {_hitTarget isKindOf "AllVehicles"}) then {
|
||||
_explosive attachTo [_hitTarget];
|
||||
private "_dir";
|
||||
_dir = _setup getVariable [QGVAR(Direction), 0];
|
||||
_dir = _dir - (getDir _hitTarget);
|
||||
[[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc);
|
||||
} else {
|
||||
[{
|
||||
EXPLODE_2_PVT(_this,_player,_explosive);
|
||||
private "_pos";
|
||||
_player setVariable [QGVAR(PlantingExplosive), false];
|
||||
if (surfaceIsWater _pos) then {
|
||||
_pos = getPosASL _explosive;
|
||||
_explosive setPosASL _pos;
|
||||
}else{
|
||||
_pos = getPosATL _explosive;
|
||||
//_explosive enableSimulationGlobal false;
|
||||
if (surfaceIsWater _pos) then {
|
||||
_pos = getPosASL _explosive;
|
||||
_explosive setPosASL _pos;
|
||||
}else{
|
||||
_explosive setPosATL _pos;
|
||||
};
|
||||
_player RemoveMagazine _mag;
|
||||
}, [ACE_player, _this select 0], 0.5, 0.1] call EFUNC(common,waitAndExecute);
|
||||
};
|
||||
_explosive setPosATL _pos;
|
||||
};
|
||||
}, [ACE_player, _explosive], 0.5, 0.1] call EFUNC(common,waitAndExecute);
|
||||
};
|
||||
|
@ -21,13 +21,8 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_pos", "_dir", "_magazineClass", "_ammo", "_triggerSpecificVars", "_unit", "_triggerConfig", "_explosive"];
|
||||
_unit = _this select 0;
|
||||
_pos = _this select 1;
|
||||
_dir = _this select 2;
|
||||
_magazineClass = _this select 3;
|
||||
_triggerConfig = _this select 4;
|
||||
_triggerSpecificVars = _this select 5;
|
||||
private ["_ammo", "_explosive"];
|
||||
EXPLODE_6_PVT(_this,_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars);
|
||||
if (count _this > 6) then {
|
||||
deleteVehicle (_this select 6);
|
||||
};
|
||||
@ -55,13 +50,12 @@ _defuseHelper = createVehicle ["ACE_DefuseObject", _pos, [], 0, "NONE"];
|
||||
_defuseHelper setPosATL _pos;
|
||||
|
||||
_explosive = createVehicle [_ammo, _pos, [], 0, "NONE"];
|
||||
_explosive attachTo [_defuseHelper, [0,0,0], ""];
|
||||
_defuseHelper attachTo [_explosive, [0,0,0], ""];
|
||||
_defuseHelper setVariable [QGVAR(Explosive),_explosive,true];
|
||||
|
||||
_expPos = getPosATL _explosive;
|
||||
_defuseHelper enableSimulationGlobal false;
|
||||
_defuseHelper setPosATL (((getPosATL _defuseHelper) vectorAdd (_pos vectorDiff _expPos)));
|
||||
_explosive setPosATL _pos;
|
||||
_dir = (getDir _defuseHelper) - _dir;
|
||||
|
||||
if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_triggerSpecificVars]
|
||||
call compile (getText (_triggerConfig >> "onPlace"))}) exitWith {_explosive};
|
||||
|
@ -43,26 +43,3 @@ _setup addEventHandler ["EpeContactStart", FUNC(onLanded)];
|
||||
_setup enableSimulationGlobal true;
|
||||
_player playActionNow "MedicOther";
|
||||
_player removeMagazine (_setup getVariable [QGVAR(Class), ""]);
|
||||
|
||||
/*
|
||||
[{
|
||||
private ["_setup", "_player"];
|
||||
_setup = _this;
|
||||
_player = ACE_player;
|
||||
_player setVariable [QGVAR(PlantingExplosive), false];
|
||||
if (!isNull _setup) then {
|
||||
private ["_mag", "_dir", "_delayTime"];
|
||||
_mag = _setup getVariable [QGVAR(Class), ""];
|
||||
_dir = _setup getVariable [QGVAR(Direction), 0];
|
||||
// TODO: Might need to handle this at some point?
|
||||
//_delayTime = (getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime")) - 5;
|
||||
//if (_delayTime > 0) then {
|
||||
// sleep _delayTime;
|
||||
//};
|
||||
[_player, GetPosATL _setup, _dir, _mag, _setup getVariable QGVAR(Trigger),
|
||||
[_setup getVariable QGVAR(Timer)], true] call FUNC(placeExplosive);
|
||||
deleteVehicle _setup;
|
||||
_player RemoveMagazine _mag;
|
||||
};
|
||||
}, _setup, 5, 0.5] call EFUNC(common,waitAndExecute);
|
||||
*/
|
||||
|
@ -29,4 +29,4 @@ if (isNil {GVAR(placer)}) then {
|
||||
GVAR(placer) = objNull;
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
[ACE_player, "MenuBack", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
|
@ -16,10 +16,8 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private "_ex";
|
||||
_ex = _this select 0;
|
||||
_ex setDir (_this select 1);
|
||||
if ((_this select 2) != 0) then {
|
||||
[_ex, _this select 2, 0] call CALLSTACK(BIS_fnc_setPitchBank);
|
||||
EXPLODE_3_PVT(_this,_explosive,_direction,_pitch);
|
||||
_explosive setDir _direction;
|
||||
if (_pitch != 0) then {
|
||||
[_explosive, _pitch, 0] call CALLSTACK(BIS_fnc_setPitchBank);
|
||||
};
|
||||
//_ex setVectorUp (surfaceNormal _pos);
|
||||
|
@ -16,9 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
closeDialog 0;
|
||||
private ["_unit", "_class"];
|
||||
_unit = _this select 0;
|
||||
_class = _this select 1;
|
||||
EXPLODE_2_PVT(_this,_unit,_class);
|
||||
GVAR(placer) = _unit;
|
||||
// TODO: check MP performance and MP compatible.
|
||||
GVAR(Setup) = createVehicle [getText(ConfigFile >> "CfgMagazines" >> _class >> "ACE_SetupObject"),[0,0,-10000],[], 0, "NONE"];
|
||||
@ -47,5 +45,5 @@ GVAR(TweakedAngle) = 180;
|
||||
localize "STR_ACE_Explosives_ScrollAction"] call EFUNC(interaction,showMouseHint);
|
||||
_unit setVariable [QGVAR(Place), [_unit, "DefaultAction",
|
||||
{GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Approve);}] call EFUNC(common,AddActionEventHandler)];
|
||||
_unit setVariable [QGVAR(Cancel), [_unit, "MenuBack",
|
||||
_unit setVariable [QGVAR(Cancel), [_unit, "zoomtemp",
|
||||
{GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Cancel);}] call EFUNC(common,AddActionEventHandler)];
|
||||
|
@ -15,18 +15,17 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_unit","_target"];
|
||||
_unit = _this select 0;
|
||||
_target = (attachedObjects (_this select 1)) select 0;
|
||||
EXPLODE_2_PVT(_this,_unit,_target);
|
||||
_target = attachedTo (_target);
|
||||
|
||||
_fnc_DefuseTime = {
|
||||
_target = _this select 1;
|
||||
EXPLODE_2_PVT(_this,_specialist,_target);
|
||||
|
||||
_defuseTime = 5;
|
||||
if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime")) then {
|
||||
_defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime");
|
||||
};
|
||||
if (!(_this select 0) && {GVAR(PunishNonSpecialists)}) then {
|
||||
if (!_specialist && {GVAR(PunishNonSpecialists)}) then {
|
||||
_defuseTime = _defuseTime * 1.5;
|
||||
};
|
||||
_defuseTime
|
||||
|
@ -21,6 +21,6 @@ EXPLODE_2_PVT(_this,_explosive,_delay);
|
||||
[{
|
||||
_explosive = _this;
|
||||
if (!isNull _explosive) then {
|
||||
[_explosive, -1, [_explosive, 0], true] call FUNC(detonateExplosive);
|
||||
[_explosive, -1, [_explosive, 0]] call FUNC(detonateExplosive);
|
||||
};
|
||||
}, _explosive, _delay, 0] call EFUNC(common,waitAndExecute);
|
||||
|
Loading…
Reference in New Issue
Block a user