Ported AGM_Explosives to ace.

Marked locations where Scheduled Delay Execution will probably need to be used.
This commit is contained in:
Garth L-H de Wet 2015-01-12 11:48:26 +02:00
parent 877fef16be
commit 5e67de4d66
69 changed files with 1565 additions and 1609 deletions

View File

@ -1,84 +0,0 @@
class CfgAmmo {
// All explosive based Ammo classes. Theses are all listed in case they are required.
class Default;
class TimeBombCore:Default {
AGM_DefuseTime = 5;
};
/*
class BoundingMineCore:TimeBombCore;
class BoundingMineBase:BoundingMineCore;
class APERSBoundingMine_Range_Ammo:BoundingMineBase;
class MineCore: TimeBombCore;
class MineBase:MineCore;
class APERSMine_Range_Ammo:MineBase;
class ATMine_Range_Ammo:MineBase;
class UnderwaterMine_Range_Ammo:MineBase;
class UnderwaterMineAB_Range_Ammo:UnderwaterMine_Range_Ammo;
class UnderwaterMinePDM_Range_Ammo:UnderwaterMine_Range_Ammo;
class DirectionalBombCore:TimeBombCore;
class DirectionalBombBase:DirectionalBombCore;
class APERSTripMine_Wire_Ammo:DirectionalBombBase;
class SLAMDirectionalMine_Wire_Ammo:DirectionalBombBase;
class PipeBombCore: TimeBombCore;
class PipeBombBase:PipeBombCore;
*/
class DirectionalBombBase;
class ClaymoreDirectionalMine_Remote_Ammo:DirectionalBombBase{
AGM_Explosive = "ClaymoreDirectionalMine_Remote_Ammo_Scripted";
soundActivation[] = {"",0,0,0};
soundDeactivation[] = {"",0,0,0};
};
//class ClaymoreDirectionalMine_Remote_Ammo_Scripted:ClaymoreDirectionalMine_Remote_Ammo;
class SLAMDirectionalMine_Wire_Ammo:DirectionalBombBase{
indirectHitRange = 20;
AGM_explodeOnDefuse = 1;
};
class SLAMDirectionalMine_Command_Ammo:SLAMDirectionalMine_Wire_Ammo {
mineTrigger = "RemoteTrigger";
AGM_explodeOnDefuse = 0;
};
class SLAMDirectionalMine_Timer_Ammo:SLAMDirectionalMine_Wire_Ammo {
mineTrigger = "TimeTrigger";
AGM_explodeOnDefuse = 0;
};
class SLAMDirectionalMine_Magnetic_Ammo:SLAMDirectionalMine_Wire_Ammo {
mineTrigger = "MagneticTrigger";
};
class PipeBombBase;
class DemoCharge_Remote_Ammo:PipeBombBase{
AGM_Explosive = "DemoCharge_Remote_Ammo_Scripted";
soundActivation[] = {"",0,0,0};
soundDeactivation[] = {"",0,0,0};
hit = 500;
indirectHit = 500;
indirectHitRange = 7;
};
//class DemoCharge_Remote_Ammo_Scripted:DemoCharge_Remote_Ammo;
class SatchelCharge_Remote_Ammo:PipeBombBase{
AGM_Explosive = "SatchelCharge_Remote_Ammo_Scripted";
soundActivation[] = {"",0,0,0};
soundDeactivation[] = {"",0,0,0};
};
/*class SatchelCharge_Remote_Ammo_Scripted:SatchelCharge_Remote_Ammo;
class IEDLandBig_Remote_Ammo:PipeBombBase{
triggerWhenDestroyed = 1;
};
class IEDLandSmall_Remote_Ammo:PipeBombBase{
triggerWhenDestroyed = 1;
};
class IEDUrbanBig_Remote_Ammo:PipeBombBase{
triggerWhenDestroyed = 1;
};
class IEDUrbanSmall_Remote_Ammo:PipeBombBase{
triggerWhenDestroyed = 1;
};*/
};

View File

@ -1,155 +0,0 @@
class CfgMagazines {
class CA_Magazine;
class ATMine_Range_Mag:CA_Magazine{
AGM_Placeable = 1;
useAction = 0;
AGM_SetupObject = "AGM_Explosives_Place_ATMine"; // CfgVehicle class for setup object.
AGM_DelayTime = 2.5;
class AGM_Triggers {
AGM_Triggers[] = {"PressurePlate"};
class PressurePlate {
digDistance = 0.1;
};
};
};
class APERSBoundingMine_Range_Mag:ATMine_Range_Mag{
AGM_SetupObject = "AGM_Explosives_Place_APERSBoundingMine";
class AGM_Triggers {
AGM_Triggers[] = {"PressurePlate"};
class PressurePlate {
digDistance = 0.075;
};
};
};
class APERSMine_Range_Mag:ATMine_Range_Mag{
AGM_SetupObject = "AGM_Explosives_Place_APERSMine";
class AGM_Triggers {
AGM_Triggers[] = {"PressurePlate"};
class PressurePlate {
digDistance = 0.05;
};
};
};
class APERSTripMine_Wire_Mag:ATMine_Range_Mag{
AGM_SetupObject = "AGM_Explosives_Place_APERSTripwireMine";
class AGM_Triggers {
AGM_Triggers[] = {"Tripwire"};
class Tripwire;
};
};
class ClaymoreDirectionalMine_Remote_Mag:CA_Magazine{
AGM_Placeable = 1;
useAction = 0;
AGM_SetupObject = "AGM_Explosives_Place_Claymore"; // CfgVehicle class for setup object.
AGM_DelayTime = 1.5;
class AGM_Triggers {
AGM_Triggers[] = {"Command"};
class Command {
FuseTime = 0.5;
};
};
};
class SatchelCharge_Remote_Mag:CA_Magazine{
AGM_Placeable = 1;
useAction = 0;
AGM_SetupObject = "AGM_Explosives_Place_SatchelCharge"; // CfgVehicle class for setup object.
AGM_DelayTime = 1;
class AGM_Triggers {
AGM_Triggers[] = {"Timer","Command", "MK16_Transmitter", "DeadmanSwitch"};
class Timer {
FuseTime = 0.5;
};
class Command {
FuseTime = 0.5;
};
class MK16_Transmitter:Command{};
class DeadmanSwitch:Command{};
};
};
class DemoCharge_Remote_Mag:SatchelCharge_Remote_Mag{
AGM_SetupObject = "AGM_Explosives_Place_DemoCharge"; // CfgVehicle class for setup object.
model = "\A3\Weapons_F\explosives\c4_charge_small_d";
};
class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag{
AGM_SetupObject = "AGM_Explosives_Place_SLAM";
class AGM_Triggers {
AGM_Triggers[] = {"IRSensor","PressurePlate","Timer","Command"};
class PressurePlate{
displayName = $STR_AGM_Explosives_SLAME_Magnetic;
digDistance = 0;
ammo = "SLAMDirectionalMine_Magnetic_Ammo";
pitch = 90;
};
class IRSensor{
displayName = $STR_AGM_Explosives_SLAME_IRSensor;
};
class Timer {
ammo = "SLAMDirectionalMine_Timer_Ammo";
};
class Command {
ammo = "SLAMDirectionalMine_Command_Ammo";
fuseTime = 0.5;
};
};
};
};
class CfgAGM_Triggers {
/* onPlace parameters:
0: OBJECT - unit placing
1: OBJECT - Placed explosive
2: STRING - Magazine classname
3: ARRAY - vars
Last Index: CfgAGM_Triggers config of trigger type.
onSetup parameters:
0: STRING - Magazine Classname
*/
class Command {
displayName = $STR_AGM_Explosives_clacker_displayName;
picture = "\AGM_Explosives\Data\UI\Clacker.paa";
onPlace = "_this call AGM_Explosives_fnc_AddClacker;false";
requires[] = {"AGM_Clacker"};
};
class MK16_Transmitter:Command {
displayName = $STR_AGM_Explosives_MK16_displayName;
picture = "\AGM_Explosives\Data\UI\MK16_Reciever_ca.paa";
requires[] = {"AGM_M26_Clacker"};
};
class DeadManSwitch:Command {
displayName = $STR_AGM_Explosives_DeadManSwitch_displayName;
picture = "\AGM_Explosives\Data\UI\DeadmanSwitch.paa";
requires[] = {"AGM_DeadManSwitch"};
};
class PressurePlate {
displayName = $STR_AGM_Explosives_PressurePlate;
picture = "AGM_Explosives\data\UI\Pressure_plate.paa";
onPlace = "_dist=GetNumber(ConfigFile >> 'CfgMagazines' >> (_this select 2) >> 'AGM_Triggers' >> 'PressurePlate' >> 'digDistance');_ex=_this select 1;_ex setPosATL ((getPosATL _ex) vectorDiff ((VectorUp _ex) vectorCrossProduct [0,0,_dist]));false";
};
class IRSensor {
displayName = $STR_AGM_Explosives_IRSensor;
picture = "AGM_Explosives\data\UI\Pressure_plate.paa";
onPlace = "false";
};
class Timer {
displayName = $STR_AGM_Explosives_timerName;
picture = "AGM_Explosives\data\UI\Timer.paa";
onPlace = "[_this select 1, (_this select 3) select 0] call AGM_Explosives_fnc_startTimer;false";
onSetup = "_this call AGM_Explosives_fnc_openTimerSetUI;true";
};
class Tripwire {
displayName = $STR_AGM_Explosives_TripWire;
picture = "AGM_Explosives\data\UI\Tripwire.paa";
onPlace = "false";
};
};
class CfgMineTriggers {
class RangeTrigger;
class MagneticTrigger: RangeTrigger {
mineMagnetic = 1;
mineTriggerRange = 1;
};
};

View File

@ -1,65 +0,0 @@
//class thingX;
class Items_base_F;
class AGM_Explosives_Place: Items_base_F {
author = "AGM";
_generalMacro = "AGM_Explosives_Place";
displayName = "Multi-meter";
mapSize = 0.2;
icon = "iconObject_1x2";
model = "\A3\Structures_F\Items\Tools\MultiMeter_F.p3d";
scope = 2;
scopeCurator = 1;
vehicleClass = "Cargo";
AGM_offset[] = {0,0,0};
};
class AGM_Explosives_Place_DemoCharge:AGM_Explosives_Place {
displayName = "Demo Charge";
model = "\A3\Weapons_F\explosives\c4_charge_small_d";
};
class AGM_Explosives_Place_APERSBoundingMine:AGM_Explosives_Place {
displayName = "APERS Bounding Mine";
model = "\A3\Weapons_F\explosives\mine_AP_bouncing";
};
class AGM_Explosives_Place_APERSMine:AGM_Explosives_Place {
displayName = "APERS Mine";
model = "\A3\Weapons_F\explosives\mine_ap";
};
class AGM_Explosives_Place_APERSTripwireMine:AGM_Explosives_Place {
displayName = "APERS Tripwire Mine";
model = "\A3\Weapons_F\explosives\mine_AP_tripwire";
AGM_offset[] = {1,0,0};
};
class AGM_Explosives_Place_ATMine:AGM_Explosives_Place {
displayName = "AT Mine";
model = "\A3\Weapons_f\Explosives\mine_at";
};
class AGM_Explosives_Place_Claymore:AGM_Explosives_Place {
displayName = "Claymore";
model = "\A3\Weapons_F\explosives\mine_AP_miniclaymore";
};
class AGM_Explosives_Place_SatchelCharge:AGM_Explosives_Place {
displayName = "Satchel Charge";
model = "\A3\Weapons_F\Explosives\satchel";
};
class AGM_Explosives_Place_SLAM:AGM_Explosives_Place {
displayName = "SLAM";
model = "\A3\Weapons_F\Explosives\mine_SLAM_directional";
};
/*
class AGM_Explosives_Place_NavalMine:AGM_Explosives_Place {
displayName = "Naval Mine";
model = "\A3\Weapons_F\explosives\mine_naval";
};
class AGM_Explosives_Place_NavalABMine:AGM_Explosives_Place {
displayName = "Naval Mine";
model = "\A3\Weapons_F\explosives\mine_naval2";
};
class AGM_Explosives_Place_NavalPDMMine:AGM_Explosives_Place {
displayName = "Naval Mine";
model = "\A3\Weapons_F\explosives\mine_naval3";
};*/

View File

@ -1,55 +0,0 @@
class CfgWeapons {
class AGM_ItemCore;
class InventoryItem_Base_f;
class AGM_ExplosiveItem: InventoryItem_Base_f {
allowedSlots[] = {801,701,901};
//type = 201;
};
class AGM_Clacker: AGM_ItemCore {
scope = 2;
displayName = $STR_AGM_Explosives_clacker_displayName;
descriptionShort = $STR_AGM_Explosives_clacker_description;
picture = "\AGM_Explosives\Data\UI\Clacker.paa";
model = "\A3\weapons_F\ammo\mag_univ.p3d";
AGM_range = 250;
AGM_Detonator = 1;
class ItemInfo: AGM_ExplosiveItem {
mass = 3;
uniformModel = "\A3\weapons_F\ammo\mag_univ.p3d";
};
};
class AGM_M26_Clacker: AGM_Clacker {
displayName = $STR_AGM_Explosives_M26_displayName;
picture = "\AGM_Explosives\Data\UI\MK26_Transmitter_ca.paa";
AGM_range = 5000;
};
class AGM_DefusalKit: AGM_ItemCore {
scope = 2;
displayName = $STR_AGM_Explosives_DefusalKit_displayName;
descriptionShort = $STR_AGM_Explosives_DefusalKit_description;
picture = "\AGM_Explosives\Data\UI\pliers.paa";
model = "\A3\Structures_F\Items\Tools\Pliers_F.p3d";
class ItemInfo: AGM_ExplosiveItem {
mass = 5;
uniformModel = "\A3\Structures_F\Items\Tools\Pliers_F.p3d";
};
};
class AGM_DeadManSwitch: AGM_ItemCore {
scope = 2;
displayName = $STR_AGM_Explosives_DeadManSwitch_displayName;
descriptionShort = $STR_AGM_Explosives_DeadManSwitch_description;
picture = "\AGM_Explosives\Data\UI\DeadmanSwitch.paa";
model = "\A3\weapons_F\ammo\mag_univ.p3d";
AGM_range = 100;
AGM_Detonator = 1;
class ItemInfo: AGM_ExplosiveItem {
mass = 2;
uniformModel = "\A3\weapons_F\ammo\mag_univ.p3d";
};
};
};

View File

@ -1,74 +0,0 @@
#define GUI_GRID_X (0)
#define GUI_GRID_Y (0)
#define GUI_GRID_W (0.025)
#define GUI_GRID_H (0.04)
#define ST_CENTER 0x02
class RscText;
class RscButton;
#define X_OFFSET 0.25
class RscXSliderH;
class IGUIBack;
class Rsc_AGM_Timer_Slider:RscXSliderH{
x = 0.4;
y = 0.2;
w = 0.3;
h = "1*((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
colorBackground[] = {0,0,0,0.5};
};
class RscAGM_SelectTimeUI
{
idd = 8854;
movingEnable = 0;
class controls {
class back:IGUIBack {
x = X_OFFSET;
y = 0;
w = 0.5;
h = 0.2;
colorBackground[] = {0, 0, 0, 0.5};
};
class header: RscText{
idc = 8870;
x = X_OFFSET + 0.005;
y = 0.005;
w = 0.49;
h = 0.05;
style = ST_CENTER;
text = "";
};
class slider: Rsc_AGM_Timer_Slider {
idc = 8845;
x = X_OFFSET + 0.005;
y = 0.06;
w = 0.49;
h = 0.025;
onSliderPosChanged = "private ['_mins', '_secs'];_mins = floor((_this select 1)/60);_secs=floor((_this select 1) - (_mins*60));ctrlSetText [8870, format[localize 'STR_AGM_Explosives_TimerMenu',_mins, _secs]];";
};
class cancelBtn: RscButton {
idc = 8855;
x = X_OFFSET + 0.005;
w = 0.15;
h = 0.1;
y = 0.09;
style = ST_CENTER;
text = $STR_AGM_Explosives_Cancel;
action = "closeDialog 0;";
};
class approveBtn: RscButton {
idc = 8860;
x = X_OFFSET + 0.345;
y = 0.09;
h = 0.1;
w = 0.15;
style = ST_CENTER;
text = $STR_AGM_Explosives_SetTime;
action = "closeDialog 0;";
};
};
};

View File

@ -1,46 +0,0 @@
class Module_F;
class AGM_ModuleExplosive: Module_F {
author = "AGM Team";
category = "AGM";
displayName = "Explosive System";
function = "AGM_Explosives_fnc_module";
scope = 2;
isGlobal = 1;
icon = "\AGM_Explosives\UI\IconExplosives_ca.paa";
class Arguments {
class RequireSpecialist {
displayName = "Require specialists?";
//description = "Require explosive specialists to plant/disable explosives? Default: No";
// The above distinction is commented out due to the explanation in fn_SetupExplosive.sqf
description = "Require explosive specialists to disable explosives? Default: No";
typeName = "BOOL";
class values {
class Yes {
name = "Yes";
value = 1;
};
class No {
default = 1;
name = "No";
value = 0;
};
};
};
class PunishNonSpecialists {
displayName = "Punish non-specialists?";
description = "Increase the time it takes to complete actions for non-specialists? Default: Yes";
typeName = "BOOL";
class values {
class Yes {
default = 1;
name = "Yes";
value = 1;
};
class No {
name = "No";
value = 0;
};
};
};
};
};

View File

@ -1,300 +0,0 @@
class CfgPatches {
class AGM_Explosives {
units[] = {};
weapons[] = {"AGM_Clacker", "AGM_DefusalKit", "AGM_M26_Clacker", "AGM_DeadManSwitch"};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core, AGM_Interaction};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"Garth 'L-H' de Wet"};
authorUrl = "https://github.com/corruptedheart/";
};
};
class CfgFunctions {
class AGM_Explosives {
class Explosives {
file="AGM_Explosives\functions";
class AddClacker;
class CanDefuse;
class DefuseExplosive;
class DetonateExplosive;
class HandleScrollWheel;
class hasExplosives;
class hasPlacedExplosives;
class getDetonators;
class getPlacedExplosives;
class initialise{postInit=1;};
//class JammerInit;
class openDetonateUI;
class openPlaceUI;
class openTransmitterUI;
class openTimerSetUI;
class openTriggerSelectionUI;
class Place_Approve;
class Place_Cancel;
class PlaceExplosive;
class SelectTrigger;
class SetupExplosive;
class SetPos;
class StartDefuse;
class StartTimer;
class TriggerType;
};
};
};
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
};
#define MACRO_DETONATEACTION class AGM_SelfActions { \
class AGM_Explosives { \
displayName = $STR_AGM_Explosives_Menu;\
condition = "true";\
statement = "";\
exceptions[] = {"AGM_Interaction_isNotSwimming"}; \
showDisabled = 1;\
priority = 4;\
icon = "AGM_Explosives\UI\Icon_Explosive_ca.paa"; \
subMenu[] = {"AGM_Explosives", 1};\
hotkey = "X";\
class AGM_Detonate {\
displayName = $STR_AGM_Explosives_Detonate;\
condition = "[_player] call AGM_Explosives_fnc_hasPlacedExplosives and {count ([_player] call AGM_Explosives_fnc_getDetonators) > 0}";\
statement = "[_player] call AGM_Explosives_fnc_openTransmitterUI;";\
exceptions[] = {"AGM_Interaction_isNotSwimming"}; \
icon = "AGM_Explosives\UI\Icon_Explosive_ca.paa"; \
showDisabled = 1;\
priority = 2;\
hotkey = "T";\
};\
};\
};
class CfgVehicles {
class Man;
class CAManBase: Man {
class AGM_SelfActions {
class AGM_Explosives {
displayName = $STR_AGM_Explosives_Menu;
condition = "!(_player getVariable ['AGM_PlantingExplosive', false])";
statement = "";
exceptions[] = {"AGM_Interaction_isNotSwimming"}; \
showDisabled = 1;
priority = 4;
icon = "AGM_Explosives\UI\Icon_Explosive_ca.paa";
subMenu[] = {"AGM_Explosives", 1};
hotkey = "X";
//Sub-menu items
class AGM_Detonate {
displayName = $STR_AGM_Explosives_Detonate;
condition = "[_player] call AGM_Explosives_fnc_hasPlacedExplosives and {count ([_player] call AGM_Explosives_fnc_getDetonators) > 0}";
statement = "[_player] call AGM_Explosives_fnc_openTransmitterUI;";
exceptions[] = {"AGM_Interaction_isNotSwimming"}; \
showDisabled = 1;
icon = "AGM_Explosives\UI\Icon_Explosive_ca.paa";
priority = 2;
hotkey = "T";
};
class AGM_Place {
displayName = $STR_AGM_Explosives_Place;
condition = "(vehicle _player == _player) and {[_player] call AGM_Explosives_fnc_hasExplosives}";
statement = "[_player] call AGM_Explosives_fnc_openPlaceUI;";
exceptions[] = {"AGM_Interaction_isNotSwimming"}; \
showDisabled = 1;
icon = "AGM_Explosives\UI\Place_Explosive_ca.paa";
priority = 1;
hotkey = "P";
};
class AGM_Defuse {
displayName = $STR_AGM_Explosives_Defuse;
condition = "[_player] call AGM_Explosives_fnc_CanDefuse";
statement = "[_player, AGM_Interaction_Target] call AGM_Explosives_fnc_StartDefuse;";
exceptions[] = {"AGM_Interaction_isNotSwimming"}; \
showDisabled = 0;
icon = "AGM_Explosives\UI\defuse_ca.paa";
priority = 0.8;
hotkey = "F";
};
};
};
};
#include "CfgVehicles.hpp"
class NATO_Box_Base;
class EAST_Box_Base;
class IND_Box_Base;
class FIA_Box_Base_F;
class Box_NATO_Support_F;
class Box_NATO_AmmoOrd_F: NATO_Box_Base {
class TransportItems {
MACRO_ADDITEM(AGM_Clacker,12)
MACRO_ADDITEM(AGM_M26_Clacker,6)
MACRO_ADDITEM(AGM_DefusalKit,12)
};
};
class Box_East_AmmoOrd_F: EAST_Box_Base {
class TransportItems {
MACRO_ADDITEM(AGM_Clacker,12)
MACRO_ADDITEM(AGM_M26_Clacker,6)
MACRO_ADDITEM(AGM_DefusalKit,12)
};
};
class Box_IND_AmmoOrd_F: IND_Box_Base {
class TransportItems {
MACRO_ADDITEM(AGM_Clacker,12)
MACRO_ADDITEM(AGM_M26_Clacker,6)
MACRO_ADDITEM(AGM_DefusalKit,12)
MACRO_ADDITEM(AGM_Deadmanswitch,2)
};
};
class Box_FIA_Ammo_F: FIA_Box_Base_F {
class TransportItems {
MACRO_ADDITEM(AGM_Clacker,2)
MACRO_ADDITEM(AGM_M26_Clacker,2)
MACRO_ADDITEM(AGM_DefusalKit,2)
MACRO_ADDITEM(AGM_Deadmanswitch,1)
};
};
class AGM_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(AGM_Clacker,12)
MACRO_ADDITEM(AGM_M26_Clacker,6)
MACRO_ADDITEM(AGM_DefusalKit,12)
MACRO_ADDITEM(AGM_Deadmanswitch,6)
};
};
class B_Kitbag_rgr;
class B_Kitbag_rgr_Exp: B_Kitbag_rgr {
class TransportItems {
class _xx_ToolKit { // xXToOlKiT420mLgXx
count = 0;
};
};
};
class B_Carryall_ocamo;
class B_Carryall_ocamo_Exp: B_Carryall_ocamo {
class TransportItems {
class _xx_ToolKit {
count = 0;
};
};
};
class B_Carryall_oucamo;
class B_Carryall_oucamo_Exp: B_Carryall_oucamo {
class TransportItems {
class _xx_ToolKit {
count = 0;
};
};
};
class B_Carryall_oli;
class G_Carryall_Exp: B_Carryall_oli {
class TransportItems {
class _xx_ToolKit {
count = 0;
};
};
};
class I_Carryall_oli_Exp: B_Carryall_oli {
class TransportItems {
class _xx_ToolKit {
count = 0;
};
};
};
#include "Module.hpp"
// Add AGM_Clacker and AGM_DefusalKit to every explosive unit.
#define MACRO_ADDMINEKIT \
items[] = {"FirstAidKit", "AGM_Clacker", "AGM_DefusalKit"}; \
respawnitems[] = {"FirstAidKit", "AGM_Clacker", "AGM_DefusalKit"};
class B_Soldier_base_F; class B_soldier_exp_F:B_Soldier_base_F {MACRO_ADDMINEKIT};
class B_Soldier_03_f; class B_engineer_F:B_Soldier_03_f {MACRO_ADDMINEKIT};
class B_Soldier_diver_base_F; class B_diver_exp_F:B_Soldier_diver_base_F {MACRO_ADDMINEKIT};
class B_Soldier_recon_base; class B_recon_exp_F:B_Soldier_recon_base {MACRO_ADDMINEKIT};
class B_CTRG_soldier_engineer_exp_F:B_Soldier_base_F {MACRO_ADDMINEKIT};
class I_G_Soldier_base_F; class I_G_engineer_F:I_G_Soldier_base_F {MACRO_ADDMINEKIT};
class I_G_Soldier_exp_F:I_G_Soldier_base_F {MACRO_ADDMINEKIT};
class B_G_engineer_F:I_G_engineer_F {MACRO_ADDMINEKIT};
class O_G_engineer_F:I_G_engineer_F {MACRO_ADDMINEKIT};
class B_G_Soldier_exp_F:I_G_Soldier_exp_F {MACRO_ADDMINEKIT};
class O_G_Soldier_exp_F:I_G_Soldier_exp_F {MACRO_ADDMINEKIT};
class I_Soldier_02_F; class I_Soldier_exp_F:I_Soldier_02_F {MACRO_ADDMINEKIT};
class I_Soldier_base_F; class I_engineer_F:I_Soldier_base_F {MACRO_ADDMINEKIT};
class I_Soldier_diver_base_F; class I_diver_exp_F:I_Soldier_diver_base_F {MACRO_ADDMINEKIT};
class O_Soldier_base_F; class O_soldier_exp_F:O_Soldier_base_F {MACRO_ADDMINEKIT};
class O_engineer_F:O_Soldier_base_F {MACRO_ADDMINEKIT};
class O_Soldier_diver_base_F; class O_diver_exp_F:O_Soldier_diver_base_F {MACRO_ADDMINEKIT};
class O_Soldier_recon_base; class O_recon_exp_F:O_Soldier_recon_base {MACRO_ADDMINEKIT};
class O_Soldier_Urban_base; class O_soldierU_exp_F:O_Soldier_Urban_base {MACRO_ADDMINEKIT};
class O_engineer_U_F:O_Soldier_Urban_base {MACRO_ADDMINEKIT};
class B_Protagonist_VR_F:B_Soldier_base_F {MACRO_ADDMINEKIT};
class O_Protagonist_VR_F:O_Soldier_base_F {MACRO_ADDMINEKIT};
class I_Protagonist_VR_F:I_Soldier_base_F {MACRO_ADDMINEKIT};
class B_Soldier_F; class b_soldier_universal_f:B_Soldier_F {MACRO_ADDMINEKIT};
class B_G_Soldier_F; class b_g_soldier_universal_f:B_G_Soldier_F {MACRO_ADDMINEKIT};
class O_Soldier_F; class o_soldier_universal_f:O_Soldier_F {MACRO_ADDMINEKIT};
class O_G_Soldier_F; class o_g_soldier_universal_f:O_G_Soldier_F {MACRO_ADDMINEKIT};
class I_soldier_F; class i_soldier_universal_f:I_soldier_F {MACRO_ADDMINEKIT};
class I_G_Soldier_F; class i_g_soldier_universal_f:I_G_Soldier_F {MACRO_ADDMINEKIT};
// Add AGM_Clacker to snipers and spotters for setting off Claymores
#define MACRO_ADDCLAYMOREKIT \
items[] = {"FirstAidKit","AGM_Clacker"}; \
respawnitems[] = {"FirstAidKit","AGM_Clacker"};
class B_Soldier_sniper_base_F;
class B_sniper_F: B_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
class B_spotter_F: B_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
class I_Soldier_sniper_base_F;
class I_Sniper_F: I_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
class I_Spotter_F: I_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
class O_Soldier_sniper_base_F;
class O_sniper_F: O_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
class O_spotter_F: O_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
};
#include "CfgAmmo.hpp"
#include "CfgMagazines.hpp"
#include "CfgWeapons.hpp"
#include "ExplosivesUI.hpp"
class CfgActions {
class None;
class Deactivate:None {
show = 0;
};
class DeactivateMine:None {
show = 0;
};
};
class AGM_Parameters_Boolean {
// Boolean Parameters (0/1)
AGM_Explosives_RequireSpecialist = 0;
AGM_Explosives_PunishNonSpecialists = 1;
};

View File

@ -1,25 +0,0 @@
/*
Name: AGM_Explosives_fnc_HandleScrollWheel
Author(s):
L-H
Description:
Handles rotating of Explosives
Parameters:
Number: Scroll amount
Returns:
Boolean: Handled or not.
Example:
1.2 call AGM_Explosives_fnc_HandleScrollWheel;
*/
private ["_obj"];
if (isNull(AGM_Explosives_Setup) || {AGM_Modifier == 0} || !AGM_Explosives_pfeh_running) exitWith {false};
AGM_Explosives_Setup setDir ((getDir AGM_Explosives_Setup) + (_this*5));
AGM_Explosives_TweakedAngle = AGM_Explosives_TweakedAngle + _this*5;
true

View File

@ -1,42 +0,0 @@
/*
Name: AGM_Explosives_fnc_JammerInit
Author(s):
Garth de Wet (LH)
Description:
Parameters:
0:OBJECT - unit carrying
1:OBJECT - Jammer
Returns:
Nothing
Example:
[player,JammerObject] call AGM_Explosives_fnc_JammerInit;
*/
if (isClass (configFile >> "CfgVehicles" >> (typeof (_this select 1))) and {getNumber(configFile >> "CfgVehicles" >> (typeof (_this select 1)) >> "AGM_JammerRange") > 0}) then {
private ["_found"];
_found = false;
{
if ((_x select 2) == (_this select 1)) exitWith {
_x set [0, (_this select 0)];
_found = true;
};
} count AGM_Explosives_Jammers;
if !(_found) then {
AGM_Explosives_Jammers pushBack [(_this select 0), getNumber(configFile >> "CfgVehicles" >> (typeof (_this select 1)) >> "AGM_JammerRange"),(_this select 1)];
};
publicVariable "AGM_Explosives_Jammers";
private "_check";
_check = (_this select 1) getVariable "AGM_JammerCharge";
if (isNil "_check") then {
(_this select 1) setVariable ["AGM_JammerCharge", getNumber(configFile >> "CfgVehicles" >> (typeof (_this select 1)) >> "AGM_JammerMaxCharge"), true];
};
_check = (_this select 1) getVariable "AGM_JammerEnabled";
if (isNil "_check") then {
(_this select 1) setVariable ["AGM_JammerEnabled", false, true];
};
};

View File

@ -1,106 +0,0 @@
/*
Name: AGM_Explosives_fnc_Place_Approve
Author(s):
Garth de Wet (LH)
Description:
Approves placement of the explosive, releases the placement object for it to settle in a location suitable for the explosive to be created.
Parameters:
Nothing
Returns:
Nothing
Example:
call AGM_Explosives_fnc_Place_Approve;
*/
if (AGM_Explosives_pfeh_running) then {
["AGM_Explosives_Placement","OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
AGM_Explosives_pfeh_running = false;
};
private ["_mag", "_setup", "_player"];
_setup = AGM_Explosives_Setup;
AGM_Explosives_Setup = objNull;
[AGM_Explosives_placer, "AGM_Explosives", false] call AGM_Core_fnc_setForceWalkStatus;
AGM_Explosives_placer = objNull;
_player = AGM_player;
[_player, "DefaultAction", _player getVariable ["AGM_Explosive_Place", -1]] call AGM_Core_fnc_removeActionEventHandler;
[_player, "MenuBack", _player getVariable ["AGM_Explosive_Cancel", -1]] call AGM_Core_fnc_removeActionEventHandler;
call AGM_Interaction_fnc_hideMouseHint;
if ((_setup getVariable ["AGM_Class", ""]) != "") then {
_dir = (getDir _setup);
if (_dir > 180) then {
_dir = _dir - 180;
} else {
_dir = 180 + _dir;
};
_setup setVariable ["AGM_Dir", _dir];
_player setVariable ["AGM_PlantingExplosive", true];
_setup addEventHandler ["EpeContactStart", {
if (!((_this select 0) getVariable ["AGM_Handled", false])) then {
private ["_player", "_pos", "_attachTo"];
_player = AGM_player;
_pos = getPosATL (_this select 0);
(_this select 0) enableSimulationGlobal false;
if (surfaceIsWater _pos) then {
_pos = getPosASL (_this select 0);
(_this select 0) setPosASL _pos;
}else{
(_this select 0) setPosATL _pos;
};
(_this select 0) setVariable ["AGM_Handled", true];
_player setVariable ["AGM_PlantingExplosive", false];
_attachTo = objNull;
if (!isNull (_this select 1) && {(_this select 1) isKindOf "AllVehicles"}) then {
_attachTo = (_this select 1);
};
[(_this select 0),_attachTo, _pos] spawn {
private ["_mag", "_setup", "_dir", "_player"];
_setup = _this select 0;
_player = AGM_player;
_mag = _setup getVariable ["AGM_Class", ""];
_dir = _setup getVariable ["AGM_Dir", 0];
sleep getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "AGM_DelayTime");
_explosive = [_player, _this select 2, _dir, _mag, _setup getVariable "AGM_Trigger", [_setup getVariable "AGM_Timer"], isNull (_this select 1)] call AGM_Explosives_fnc_PlaceExplosive;
deleteVehicle _setup;
if (!isNull(_explosive)) then {
_player RemoveMagazine _mag;
sleep 0.2;
if (!isNull (_this select 1)) then {
_explosive attachTo [(_this select 1)];
_dir = _dir - (getDir (_this select 1));
[[_explosive, _dir, 0], "AGM_Explosives_fnc_setPos"] call AGM_Core_fnc_execRemoteFnc;
};
};
};
};
}];
_setup enableSimulationGlobal true;
_player playActionNow "MedicOther";
[_setup] spawn {
private ["_setup", "_player"];
_setup = _this select 0;
_player = AGM_player;
sleep 5;
if (!isNull _setup) then {
private ["_mag", "_dir", "_delayTime"];
_mag = _setup getVariable ["AGM_Class", ""];
_dir = _setup getVariable ["AGM_Dir", 0];
_delayTime = (getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "AGM_DelayTime")) - 5;
if (_delayTime > 0) then {
sleep _delayTime;
};
if (!isNull _setup) then {
[_player, GetPosATL _setup, _dir, _mag, _setup getVariable "AGM_Trigger", [_setup getVariable "AGM_Timer"], true] call AGM_Explosives_fnc_PlaceExplosive;
deleteVehicle _setup;
_player RemoveMagazine _mag;
_player setVariable ["AGM_PlantingExplosive", false];
};
};
};
}else{
deleteVehicle _setup;
};

View File

@ -1,34 +0,0 @@
/*
Name: AGM_Explosives_fnc_Place_Cancel
Author(s):
Garth de Wet (LH)
Description:
Cancels placement of the explosive
Parameters:
Nothing
Returns:
Nothing
Example:
call AGM_Explosives_fnc_Place_Cancel;
*/
if (AGM_Explosives_pfeh_running) then {
["AGM_Explosives_Placement","OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
AGM_Explosives_pfeh_running = false;
};
if (!isNull (AGM_Explosives_Setup)) then {
deleteVehicle AGM_Explosives_Setup;
};
AGM_Explosives_Setup = objNull;
if (isNil {AGM_Explosives_placer}) then {
AGM_Explosives_placer = objNull;
};
[AGM_Explosives_placer, "AGM_Explosives", false] call AGM_Core_fnc_setForceWalkStatus;
AGM_Explosives_placer = objNull;
call AGM_Interaction_fnc_hideMouseHint;
[AGM_player, "DefaultAction", AGM_player getVariable ["AGM_Explosive_Place", -1]] call AGM_Core_fnc_removeActionEventHandler;
[AGM_player, "MenuBack", AGM_player getVariable ["AGM_Explosive_Cancel", -1]] call AGM_Core_fnc_removeActionEventHandler;

View File

@ -1,65 +0,0 @@
/*
Name: AGM_Explosives_fnc_SetupExplosive
Author(s):
Garth de Wet (LH)
Description:
Starts the setup process for the passed explosive.
Parameters:
0: OBJECT - Unit placing explosive.
1: STRING - Classname of explosive to place. (CfgMagazine class)
2: Config - Trigger Config
3: NUMBER - (optional) timer
Returns:
Nothing
Example:
[player, "SatchelCharge_Remote_Mag", "Command"] call AGM_Explosives_fnc_SetupExplosive;
*/
_this spawn {
private ["_unit", "_class", "_config", "_timer"];
_unit = _this select 0;
_class = _this select 1;
_config = _this select 2;
_timer = _this select 3;
AGM_Explosives_placer = _unit;
// Commented out due to the fact there is a distinction between who can deactivate mines and who can plant them in standard configs.
// Would require custom config entries (AGM_ExplosiveSpecialist/AGM_Specialist) which excludes custom mods.
//if (AGM_Explosives_RequireSpecialist && {!([_unit] call AGM_Core_fnc_isEOD)}) exitWith {};
if (isNil "_config") then {
_config = getArray(ConfigFile >> "CfgMagazines" >> _class >> "AGM_Triggers" >> "AGM_Triggers") select 0;
};
AGM_Explosives_Setup = getText(ConfigFile >> "CfgMagazines" >> _class >> "AGM_SetupObject") createVehicleLocal [0,0,-10000];
AGM_Explosives_Setup enableSimulationGlobal false;
AGM_Explosives_Setup setVariable ["AGM_Class", _class];
AGM_Explosives_Setup setVariable ["AGM_Trigger", _config];
//AGM_Explosives_Setup setVariable ["AGM_Offset", GetArray(ConfigFile >> "CfgVehicles" >> typeof AGM_Explosives_Setup >> "AGM_Offset")];
if (!isNil "_timer") then {
AGM_Explosives_Setup setVariable ["AGM_Timer", _timer];
};
[_unit, "AGM_Explosives", true] call AGM_Core_fnc_setForceWalkStatus;
AGM_Explosives_TweakedAngle = 180;
["AGM_Explosives_Placement","OnEachFrame", {
private "_player";
_player = AGM_player;
if (AGM_Explosives_placer != _player) exitWith {
call AGM_Explosives_fnc_Place_Cancel;
};
AGM_Explosives_pfeh_running = true;
_pos = (ASLtoATL eyePos _player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]);
//_pos = _pos vectorAdd ((VectorDir AGM_Explosives_setup) vectorCrossProduct (AGM_Explosives_setup getVariable ["AGM_Offset", [0,0,0]]));
AGM_Explosives_Setup setPosATL _pos;
if (AGM_Modifier == 0) then {
AGM_Explosives_Setup setDir (AGM_Explosives_TweakedAngle + getDir _player);
};
}] call BIS_fnc_addStackedEventHandler;
[localize "STR_AGM_Explosives_PlaceAction", localize "STR_AGM_Explosives_CancelAction",localize "STR_AGM_Explosives_ScrollAction"] call AGM_Interaction_fnc_showMouseHint;
_unit setVariable ["AGM_Explosive_Place", [_unit, "DefaultAction", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, {call AGM_Explosives_fnc_Place_Approve;}] call AGM_Core_fnc_AddActionEventHandler];
_unit setVariable ["AGM_Explosive_Cancel", [_unit, "MenuBack", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, {call AGM_Explosives_fnc_Place_Cancel;}] call AGM_Core_fnc_AddActionEventHandler];
};

View File

@ -1,65 +0,0 @@
/*
Name: AGM_Explosives_fnc_StartDefuse
Author: Garth de Wet (LH)
Description:
Starts defusing an explosive
Parameters:
0: OBJECT - Unit to defuse explosive
1: OBJECT - Target explosive
Returns:
Nothing
Example:
[player, AGM_Interaction_Target] call AGM_Explosives_fnc_StartDefuse;
*/
private ["_unit","_target"];
_unit = _this select 0;
_target = _this select 1;
// [_specialist, _target] call _fnc_DefuseTime;
_fnc_DefuseTime = {
_target = _this select 1;
_defuseTime = 5;
if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "AGM_DefuseTime")) then {
_defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "AGM_DefuseTime");
};
if (!(_this select 0) && {AGM_Explosives_PunishNonSpecialists}) then {
_defuseTime = _defuseTime * 1.5;
};
_defuseTime
};
_actionToPlay = "MedicOther";
if (STANCE _unit == "Prone") then {
_actionToPlay = "PutDown";
};
if (AGM_player != _unit) then {
// If the unit is a player, call the function on the player.
if (isPlayer _unit) then {
[[_unit, _target], "AGM_Explosives_fnc_StartDefuse", _unit] call AGM_Core_fnc_execRemoteFnc;
} else {
[_unit, _target, [[_unit] call AGM_Core_fnc_isEOD, _target] call _fnc_DefuseTime] spawn {
(_this select 0) playActionNow _actionToPlay;
(_this select 0) disableAI "MOVE";
(_this select 0) disableAI "TARGET";
sleep (_this select 2);
[(_this select 0), (_this select 1)] call AGM_Explosives_fnc_DefuseExplosive;
(_this select 0) enableAI "MOVE";
(_this select 0) enableAI "TARGET";
};
};
} else {
_unit playActionNow _actionToPlay;
if (AGM_Explosives_RequireSpecialist) then {
if ([_unit] call AGM_Core_fnc_isEOD) then {
[[true, _target] call _fnc_DefuseTime, [_unit,_target], "AGM_Explosives_fnc_DefuseExplosive", localize "STR_AGM_Explosives_DefusingExplosive"] call AGM_Core_fnc_progressBar;
};
} else {
[[([_unit] call AGM_Core_fnc_isEOD), _target] call _fnc_DefuseTime, [_unit,_target], "AGM_Explosives_fnc_DefuseExplosive", localize "STR_AGM_Explosives_DefusingExplosive"] call AGM_Core_fnc_progressBar;
};
};

View File

@ -1,73 +0,0 @@
/*
Name: AGM_Explosives_fnc_Initialise
Author(s):
Garth de Wet (LH)
Description:
Initialises explosive behaviour.
Parameters:
None
Returns:
None
Example:
None
*/
if !(hasInterface) exitWith {};
AGM_Explosives_PlacedCount = 0;
AGM_Explosives_Setup = objNull;
AGM_Explosives_pfeh_running = false;
AGM_Explosives_null = [] spawn {
waitUntil {sleep 0.356;!isNull(player)};
[{(_this select 0) call AGM_Explosives_fnc_HandleScrollWheel;}] call AGM_Core_fnc_addScrollWheelEventHandler;
player addEventHandler ["Respawn", {
[(_this select 0)] call AGM_Explosives_fnc_initialiseUnit;
}];
player addEventHandler ["Killed", {
private "_deadman";
call AGM_Explosives_fnc_Place_Cancel;
_deadman = [(_this select 0), "DeadManSwitch"] call AGM_Explosives_fnc_getPlacedExplosives;
{
[(_this select 0), -1, _x, true] call AGM_Explosives_fnc_DetonateExplosive;
} count _deadman;
}];
player addEventHandler ["Take", {
private ["_item", "_getter", "_giver", "_config"];
_item = _this select 2;
_getter = _this select 0;
_giver = _this select 1;
_config = ConfigFile >> "CfgWeapons" >> _item;
if (isClass _config && {getNumber(_config >> "AGM_Detonator") == 1}) then {
private ["_clackerItems"];
_clackerItems = _giver getVariable ["AGM_Clacker", []];
_getter SetVariable ["AGM_Clacker", (_getter getVariable ["AGM_Clacker", []]) + _clackerItems, true];
_detonators = [_giver] call AGM_Explosives_fnc_getDetonators;
if (count _detonators == 0) then {
_giver setVariable ["AGM_Clacker", nil, true];
};
};
}];
player addEventHandler ["Put", {
private ["_item", "_getter", "_giver", "_config"];
_item = _this select 2;
_getter = _this select 1;
_giver = _this select 0;
_config = ConfigFile >> "CfgWeapons" >> _item;
if (isClass _config && {getNumber(_config >> "AGM_Detonator") == 1}) then {
private ["_clackerItems"];
_clackerItems = _giver getVariable ["AGM_Clacker", []];
_getter SetVariable ["AGM_Clacker", (_getter getVariable ["AGM_Clacker", []]) + _clackerItems, true];
_detonators = [_giver] call AGM_Explosives_fnc_getDetonators;
if (count _detonators == 0) then {
_giver setVariable ["AGM_Clacker", nil, true];
};
};
}];
};

View File

@ -1,26 +0,0 @@
/*
Name: AGM_Explosives_fnc_isSpecialist
Author: Garth de Wet (LH)
Description:
Checks whether the passed unit is an explosive specialist.
Either through config entry: "canDeactivateMines"
or
unit setVariable ["AGM_isEOD", true]
Parameters:
OBJECT - Unit to check if is a specialist
Returns:
BOOLEAN
Example:
_isSpecialist = player call AGM_Explosives_fnc_isSpecialist;
*/
private "_isSpecialist";
_isSpecialist = _this getVariable "AGM_isEOD";
if (isNil "_isSpecialist") then {
_isSpecialist = getNumber(ConfigFile >> "CfgVehicles" >> typeof _this >> "canDeactivateMines") == 1;
};
_isSpecialist

View File

@ -1,27 +0,0 @@
/*
Name: AGM_Explosives_fnc_module
Author: Garth de Wet (LH)
Description:
Initialises the explosives module
Parameters:
Things
Returns:
Nothing
Example:
*/
if !(isServer) exitWith {};
_logic = _this select 0;
_activated = _this select 2;
if !(_activated) exitWith {};
[_logic, "AGM_Explosives_RequireSpecialist", "RequireSpecialist" ] call AGM_Core_fnc_readBooleanParameterFromModule;
[_logic, "AGM_Explosives_PunishNonSpecialists", "PunishNonSpecialists" ] call AGM_Core_fnc_readBooleanParameterFromModule;
diag_log text "[AGM]: Explosive Module Initialized.";

View File

@ -1,61 +0,0 @@
/*
Name: AGM_Explosives_fnc_openDetonateUI
Author: Garth de Wet (LH)
Description:
Opens the UI for explosive detonation selection
Parameters:
0: OBJECT - unit
0: STRING - Classname of detonator
Returns:
Nothing
Example:
[player, "AGM_M26_Clacker"] call AGM_Explosives_fnc_openDetonateUI;
*/
private ["_unit","_result", "_item"];
call AGM_Interaction_fnc_hideMenu;
_unit = _this select 0;
_detonator = _this select 1;
_range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "AGM_Range");
_result = [_unit] call AGM_Explosives_fnc_getPlacedExplosives;
_actions = [localize "STR_AGM_Explosives_DetonateMenu", localize "STR_AGM_Explosives_Detonate"] call AGM_Interaction_fnc_prepareSelectMenu;
_count = 0;
{
if (!isNull(_x select 0)) then {
_required = getArray (ConfigFile >> "CfgAGM_Triggers" >> (_x select 4) >> "requires");
if (_detonator in _required) then {
_item = ConfigFile >> "CfgMagazines" >> (_x select 3);
_actions = [
_actions,
_x select 2,
getText(_item >> "picture"),
[_foreachIndex, _range]
] call AGM_Interaction_fnc_AddSelectableItem;
_count = _count + 1;
};
};
} foreach _result;
if (_count > 0) then {
[
_actions,
{
[
AGM_player,
[_this select 1] call AGM_Core_fnc_toNumber,
(AGM_player getVariable ["AGM_Clacker", []]) select ([_this select 0] call AGM_Core_fnc_toNumber),
false
] call AGM_Explosives_fnc_DetonateExplosive;
call AGM_Interaction_fnc_hideMenu;
},
{[AGM_player] call AGM_Explosives_fnc_openTransmitterUI;}
] call AGM_Interaction_fnc_openSelectMenu;
}else{
call AGM_Interaction_fnc_hideMenu;
[AGM_player] call AGM_Explosives_fnc_openTransmitterUI;
[localize "STR_AGM_Explosives_NoExplosivesAvailable"] call AGM_Core_fnc_displayTextStructured;
};

View File

@ -1,27 +0,0 @@
/*
Name: AGM_Explosives_fnc_openTimerSetUI
Author: Garth de Wet (LH)
Description:
Opens the UI for timer setting of an explosive
Parameters:
0: String - Magazine
Returns:
Nothing
Example:
[player] call AGM_Explosives_fnc_openTimerSetUI;
*/
private ["_mag"];
_mag = _this select 0;
createDialog "RscAGM_SelectTimeUI";
sliderSetRange [8845, 5, 900]; // 5seconds - 15minutes
sliderSetPosition [8845, 30];
buttonSetAction [8860, format["[AGM_player, '%1', 'Timer', floor(sliderPosition 8845)] call AGM_Explosives_fnc_SetupExplosive;closeDialog 0;", _mag]];
buttonSetAction [8855, format["['%1'] call AGM_Explosives_fnc_openTriggerSelectionUI;", _mag]];
ctrlSetText [8870, format[localize "STR_AGM_Explosives_TimerMenu",0, 30]];

View File

@ -1,51 +0,0 @@
/*
Name: AGM_Explosives_fnc_openTransmitterUI
Author: Garth de Wet (LH)
Description:
Opens the UI for selecting the transmitter
Parameters:
0: OBJECT - Unit
Returns:
Nothing
Example:
[player] call AGM_Explosives_fnc_openTransmitterUI;
*/
private ["_items", "_unit", "_count", "_actions", "_config"];
_unit = _this select 0;
_items = (items _unit);
_actions = [localize "STR_AGM_Explosives_TriggerMenu", localize "STR_AGM_Explosives_SelectTrigger"] call AGM_Interaction_fnc_prepareSelectMenu;
_detonators = [_unit] call AGM_Explosives_fnc_getDetonators;
{
_config = ConfigFile >> "CfgWeapons" >> _x;
_actions = [
_actions,
getText(_config >> "displayName"),
getText(_config >> "picture"),
_x
] call AGM_Interaction_fnc_AddSelectableItem;
} count _detonators;
if (count _detonators == 0) then {
call AGM_Interaction_fnc_hideMenu;
"AGM_Explosives" call AGM_Interaction_fnc_openMenuSelf;
[format[localize "STR_AGM_Explosives_NoTriggersAvailable", "player"]] call AGM_Core_fnc_displayTextStructured;
}else{
[
_actions,
{
[AGM_player, _this] call AGM_Explosives_fnc_openDetonateUI;
},
{
call AGM_Interaction_fnc_hideMenu;
if !(profileNamespace getVariable ["AGM_Interaction_AutoCloseMenu", false]) then {
"AGM_Explosives" call AGM_Interaction_fnc_openMenuSelf;
};
}
] call AGM_Interaction_fnc_openSelectMenu;
};

View File

@ -0,0 +1,48 @@
class CfgACE_Triggers {
/* onPlace parameters:
0: OBJECT - unit placing
1: OBJECT - Placed explosive
2: STRING - Magazine classname
3: ARRAY - vars
Last Index: CfgACE_Triggers config of trigger type.
onSetup parameters:
0: STRING - Magazine Classname
*/
class Command {
displayName = $STR_ACE_Explosives_clacker_displayName;
picture = "\ACE_Explosives\Data\UI\Clacker.paa";
onPlace = QUOTE( _this call FUNC(AddClacker);false );
requires[] = {"ACE_Clacker"};
};
class MK16_Transmitter:Command {
displayName = $STR_ACE_Explosives_MK16_displayName;
picture = "\ACE_Explosives\Data\UI\MK16_Reciever_ca.paa";
requires[] = {"ACE_M26_Clacker"};
};
class DeadManSwitch:Command {
displayName = $STR_ACE_Explosives_DeadManSwitch_displayName;
picture = "\ACE_Explosives\Data\UI\DeadmanSwitch.paa";
requires[] = {"ACE_DeadManSwitch"};
};
class PressurePlate {
displayName = $STR_ACE_Explosives_PressurePlate;
picture = "ACE_Explosives\data\UI\PressurePlate.paa";
onPlace = "_dist=GetNumber(ConfigFile >> 'CfgMagazines' >> (_this select 2) >> 'ACE_Triggers' >> 'PressurePlate' >> 'digDistance');_ex=_this select 1;_ex setPosATL ((getPosATL _ex) vectorDiff ((VectorUp _ex) vectorCrossProduct [0,0,_dist]));false";
};
class IRSensor {
displayName = $STR_ACE_Explosives_IRSensor;
picture = "ACE_Explosives\data\UI\PressurePlate.paa";
onPlace = "false";
};
class Timer {
displayName = $STR_ACE_Explosives_timerName;
picture = "ACE_Explosives\data\UI\Timer.paa";
onPlace = QUOTE( [_this select 1, (_this select 3) select 0] call FUNC(startTimer);false );
onSetup = QUOTE( _this call FUNC(openTimerSetUI);true );
};
class Tripwire {
displayName = $STR_ACE_Explosives_TripWire;
picture = "ACE_Explosives\data\UI\Tripwire.paa";
onPlace = "false";
};
};

View File

@ -0,0 +1,86 @@
class CfgAmmo {
// All explosive based Ammo classes. These are all listed in case they become required.
class Default;
class TimeBombCore:Default {
ACE_DefuseTime = 5;
};
/*
class BoundingMineCore:TimeBombCore;
class BoundingMineBase:BoundingMineCore;
class APERSBoundingMine_Range_Ammo:BoundingMineBase;
class MineCore: TimeBombCore;
class MineBase:MineCore;
class APERSMine_Range_Ammo:MineBase;
class ATMine_Range_Ammo:MineBase;
class UnderwaterMine_Range_Ammo:MineBase;
class UnderwaterMineAB_Range_Ammo:UnderwaterMine_Range_Ammo;
class UnderwaterMinePDM_Range_Ammo:UnderwaterMine_Range_Ammo;
class DirectionalBombCore:TimeBombCore;
class DirectionalBombBase:DirectionalBombCore;
class APERSTripMine_Wire_Ammo:DirectionalBombBase;
class SLAMDirectionalMine_Wire_Ammo:DirectionalBombBase;
class PipeBombCore: TimeBombCore;
class PipeBombBase:PipeBombCore;
*/
class DirectionalBombBase;
class ClaymoreDirectionalMine_Remote_Ammo:DirectionalBombBase{
ACE_Explosive = "ClaymoreDirectionalMine_Remote_Ammo_Scripted";
soundActivation[] = {"",0,0,0};
soundDeactivation[] = {"",0,0,0};
};
//class ClaymoreDirectionalMine_Remote_Ammo_Scripted:ClaymoreDirectionalMine_Remote_Ammo;
class SLAMDirectionalMine_Wire_Ammo:DirectionalBombBase{
indirectHitRange = 20;
ACE_explodeOnDefuse = 1;
};
class SLAMDirectionalMine_Command_Ammo:SLAMDirectionalMine_Wire_Ammo {
mineTrigger = "RemoteTrigger";
ACE_explodeOnDefuse = 0;
};
class SLAMDirectionalMine_Timer_Ammo:SLAMDirectionalMine_Wire_Ammo {
mineTrigger = "TimeTrigger";
ACE_explodeOnDefuse = 0;
};
class SLAMDirectionalMine_Magnetic_Ammo:SLAMDirectionalMine_Wire_Ammo {
mineTrigger = "MagneticTrigger";
};
class PipeBombBase;
class DemoCharge_Remote_Ammo:PipeBombBase{
ACE_Explosive = "DemoCharge_Remote_Ammo_Scripted";
soundActivation[] = {"",0,0,0};
soundDeactivation[] = {"",0,0,0};
hit = 500;
indirectHit = 500;
indirectHitRange = 7;
};
class SatchelCharge_Remote_Ammo:PipeBombBase{
ACE_Explosive = "SatchelCharge_Remote_Ammo_Scripted";
soundActivation[] = {"",0,0,0};
soundDeactivation[] = {"",0,0,0};
};
/*
class DemoCharge_Remote_Ammo_Scripted:DemoCharge_Remote_Ammo;
class SatchelCharge_Remote_Ammo_Scripted:SatchelCharge_Remote_Ammo;
TODO: Configure IEDs to use the system.
class IEDLandBig_Remote_Ammo:PipeBombBase{
triggerWhenDestroyed = 1;
};
class IEDLandSmall_Remote_Ammo:PipeBombBase{
triggerWhenDestroyed = 1;
};
class IEDUrbanBig_Remote_Ammo:PipeBombBase{
triggerWhenDestroyed = 1;
};
class IEDUrbanSmall_Remote_Ammo:PipeBombBase{
triggerWhenDestroyed = 1;
};*/
};

View File

@ -0,0 +1,20 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_preInit.sqf) );
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_postInit.sqf) );
};
};
/*
TODO: Move the addEventHandlers out of PostInit into here or separate eventHandlers,
to enable them on all units, so unit switching works for explosives properly.
class Extended_Init_EventHandlers {
class CAManBase {
init = "";
}
}
*/

View File

@ -0,0 +1,44 @@
class Module_F;
class ACE_ModuleExplosive: Module_F {
author = "ACE Team";
category = "ACE";
displayName = "Explosive System";
function = QUOTE( FUNC(module) );
scope = 2;
isGlobal = 1;
icon = "\ACE_Explosives\UI\IconExplosives_ca.paa";
class Arguments {
class RequireSpecialist {
displayName = "Require specialists?";
description = "Require explosive specialists to disable explosives? Default: No";
typeName = "BOOL";
class values {
class Yes {
name = "Yes";
value = 1;
};
class No {
default = 1;
name = "No";
value = 0;
};
};
};
class PunishNonSpecialists {
displayName = "Punish non-specialists?";
description = "Increase the time it takes to complete actions for non-specialists? Default: Yes";
typeName = "BOOL";
class values {
class Yes {
default = 1;
name = "Yes";
value = 1;
};
class No {
name = "No";
value = 0;
};
};
};
};
};

View File

@ -0,0 +1,248 @@
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
};
class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_SelfActions {
class GVAR(Explosives) {
displayName = $STR_ACE_Explosives_Menu;
condition = QUOTE( !(_player getVariable [QGVAR(PlantingExplosive), false]) );
statement = "";
exceptions[] = {"ACE_Interaction_isNotSwimming"}; \
showDisabled = 1;
priority = 4;
icon = "ACE_Explosives\UI\Explosives_Menu_ca.paa";
subMenu[] = {"ACE_Explosives", 1};
hotkey = "X";
//Sub-menu items
class ACE_Detonate {
displayName = $STR_ACE_Explosives_Detonate;
condition = QUOTE( [_player] call FUNC(hasPlacedExplosives) AND ) and {count ([_player] call FUNC(getDetonators)) > 0} );
statement = QUOTE( [_player] call FUNC(openTransmitterUI); );
exceptions[] = {"ACE_Interaction_isNotSwimming"}; \
showDisabled = 1;
icon = "ACE_Explosives\UI\Explosives_Menu_ca.paa";
priority = 2;
hotkey = "T";
};
class ACE_Place {
displayName = $STR_ACE_Explosives_Place;
condition = QUOTE( (vehicle _player == _player) and {[_player] call FUNC(hasExplosives)} );
statement = QUOTE( [_player] call FUNC(openPlaceUI); );
exceptions[] = {"ACE_Interaction_isNotSwimming"}; \
showDisabled = 1;
icon = "ACE_Explosives\UI\Place_Explosive_ca.paa";
priority = 1;
hotkey = "P";
};
class ACE_Defuse {
displayName = $STR_ACE_Explosives_Defuse;
condition = QUOTE( [_player] call FUNC(canDefuse) );
statement = QUOTE( [_player, EGVAR(Interaction, Target)] call FUNC(startDefuse); );
exceptions[] = {"ACE_Interaction_isNotSwimming"}; \
showDisabled = 0;
icon = "ACE_Explosives\UI\Defuse_ca.paa";
priority = 0.8;
hotkey = "F";
};
};
};
};
class Items_base_F;
class ACE_Explosives_Place: Items_base_F {
author = "ACE";
_generalMacro = "ACE_Explosives_Place";
displayName = "Multi-meter";
mapSize = 0.2;
icon = "iconObject_1x2";
model = "\A3\Structures_F\Items\Tools\MultiMeter_F.p3d";
scope = 2;
scopeCurator = 1;
vehicleClass = "Cargo";
ACE_offset[] = {0,0,0};
};
class ACE_Explosives_Place_DemoCharge:ACE_Explosives_Place {
displayName = "Demo Charge";
model = "\A3\Weapons_F\explosives\c4_charge_small_d";
};
class ACE_Explosives_Place_APERSBoundingMine:ACE_Explosives_Place {
displayName = "APERS Bounding Mine";
model = "\A3\Weapons_F\explosives\mine_AP_bouncing";
};
class ACE_Explosives_Place_APERSMine:ACE_Explosives_Place {
displayName = "APERS Mine";
model = "\A3\Weapons_F\explosives\mine_ap";
};
class ACE_Explosives_Place_APERSTripwireMine:ACE_Explosives_Place {
displayName = "APERS Tripwire Mine";
model = "\A3\Weapons_F\explosives\mine_AP_tripwire";
ACE_offset[] = {1,0,0};
};
class ACE_Explosives_Place_ATMine:ACE_Explosives_Place {
displayName = "AT Mine";
model = "\A3\Weapons_f\Explosives\mine_at";
};
class ACE_Explosives_Place_Claymore:ACE_Explosives_Place {
displayName = "Claymore";
model = "\A3\Weapons_F\explosives\mine_AP_miniclaymore";
};
class ACE_Explosives_Place_SatchelCharge:ACE_Explosives_Place {
displayName = "Satchel Charge";
model = "\A3\Weapons_F\Explosives\satchel";
};
class ACE_Explosives_Place_SLAM:ACE_Explosives_Place {
displayName = "SLAM";
model = "\A3\Weapons_F\Explosives\mine_SLAM_directional";
};
class NATO_Box_Base;
class EAST_Box_Base;
class IND_Box_Base;
class FIA_Box_Base_F;
class Box_NATO_Support_F;
class Box_NATO_AmmoOrd_F: NATO_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_Clacker,12)
MACRO_ADDITEM(ACE_M26_Clacker,6)
MACRO_ADDITEM(ACE_DefusalKit,12)
};
};
class Box_East_AmmoOrd_F: EAST_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_Clacker,12)
MACRO_ADDITEM(ACE_M26_Clacker,6)
MACRO_ADDITEM(ACE_DefusalKit,12)
};
};
class Box_IND_AmmoOrd_F: IND_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_Clacker,12)
MACRO_ADDITEM(ACE_M26_Clacker,6)
MACRO_ADDITEM(ACE_DefusalKit,12)
MACRO_ADDITEM(ACE_Deadmanswitch,2)
};
};
class Box_FIA_Ammo_F: FIA_Box_Base_F {
class TransportItems {
MACRO_ADDITEM(ACE_Clacker,2)
MACRO_ADDITEM(ACE_M26_Clacker,2)
MACRO_ADDITEM(ACE_DefusalKit,2)
MACRO_ADDITEM(ACE_Deadmanswitch,1)
};
};
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(ACE_Clacker,12)
MACRO_ADDITEM(ACE_M26_Clacker,6)
MACRO_ADDITEM(ACE_DefusalKit,12)
MACRO_ADDITEM(ACE_Deadmanswitch,6)
};
};
class B_Kitbag_rgr;
class B_Kitbag_rgr_Exp: B_Kitbag_rgr {
class TransportItems {
class _xx_ToolKit { // xXToOlKiT420mLgXx
count = 0;
};
};
};
class B_Carryall_ocamo;
class B_Carryall_ocamo_Exp: B_Carryall_ocamo {
class TransportItems {
class _xx_ToolKit {
count = 0;
};
};
};
class B_Carryall_oucamo;
class B_Carryall_oucamo_Exp: B_Carryall_oucamo {
class TransportItems {
class _xx_ToolKit {
count = 0;
};
};
};
class B_Carryall_oli;
class G_Carryall_Exp: B_Carryall_oli {
class TransportItems {
class _xx_ToolKit {
count = 0;
};
};
};
class I_Carryall_oli_Exp: B_Carryall_oli {
class TransportItems {
class _xx_ToolKit {
count = 0;
};
};
};
#include "CfgModule.hpp"
// Add ACE_Clacker and ACE_DefusalKit to every explosive unit.
#define MACRO_ADDMINEKIT \
items[] = {"FirstAidKit", "ACE_Clacker", "ACE_DefusalKit"}; \
respawnitems[] = {"FirstAidKit", "ACE_Clacker", "ACE_DefusalKit"};
class B_Soldier_base_F; class B_soldier_exp_F:B_Soldier_base_F {MACRO_ADDMINEKIT};
class B_Soldier_03_f; class B_engineer_F:B_Soldier_03_f {MACRO_ADDMINEKIT};
class B_Soldier_diver_base_F; class B_diver_exp_F:B_Soldier_diver_base_F {MACRO_ADDMINEKIT};
class B_Soldier_recon_base; class B_recon_exp_F:B_Soldier_recon_base {MACRO_ADDMINEKIT};
class B_CTRG_soldier_engineer_exp_F:B_Soldier_base_F {MACRO_ADDMINEKIT};
class I_G_Soldier_base_F; class I_G_engineer_F:I_G_Soldier_base_F {MACRO_ADDMINEKIT};
class I_G_Soldier_exp_F:I_G_Soldier_base_F {MACRO_ADDMINEKIT};
class B_G_engineer_F:I_G_engineer_F {MACRO_ADDMINEKIT};
class O_G_engineer_F:I_G_engineer_F {MACRO_ADDMINEKIT};
class B_G_Soldier_exp_F:I_G_Soldier_exp_F {MACRO_ADDMINEKIT};
class O_G_Soldier_exp_F:I_G_Soldier_exp_F {MACRO_ADDMINEKIT};
class I_Soldier_02_F; class I_Soldier_exp_F:I_Soldier_02_F {MACRO_ADDMINEKIT};
class I_Soldier_base_F; class I_engineer_F:I_Soldier_base_F {MACRO_ADDMINEKIT};
class I_Soldier_diver_base_F; class I_diver_exp_F:I_Soldier_diver_base_F {MACRO_ADDMINEKIT};
class O_Soldier_base_F; class O_soldier_exp_F:O_Soldier_base_F {MACRO_ADDMINEKIT};
class O_engineer_F:O_Soldier_base_F {MACRO_ADDMINEKIT};
class O_Soldier_diver_base_F; class O_diver_exp_F:O_Soldier_diver_base_F {MACRO_ADDMINEKIT};
class O_Soldier_recon_base; class O_recon_exp_F:O_Soldier_recon_base {MACRO_ADDMINEKIT};
class O_Soldier_Urban_base; class O_soldierU_exp_F:O_Soldier_Urban_base {MACRO_ADDMINEKIT};
class O_engineer_U_F:O_Soldier_Urban_base {MACRO_ADDMINEKIT};
class B_Protagonist_VR_F:B_Soldier_base_F {MACRO_ADDMINEKIT};
class O_Protagonist_VR_F:O_Soldier_base_F {MACRO_ADDMINEKIT};
class I_Protagonist_VR_F:I_Soldier_base_F {MACRO_ADDMINEKIT};
class B_Soldier_F; class b_soldier_universal_f:B_Soldier_F {MACRO_ADDMINEKIT};
class B_G_Soldier_F; class b_g_soldier_universal_f:B_G_Soldier_F {MACRO_ADDMINEKIT};
class O_Soldier_F; class o_soldier_universal_f:O_Soldier_F {MACRO_ADDMINEKIT};
class O_G_Soldier_F; class o_g_soldier_universal_f:O_G_Soldier_F {MACRO_ADDMINEKIT};
class I_soldier_F; class i_soldier_universal_f:I_soldier_F {MACRO_ADDMINEKIT};
class I_G_Soldier_F; class i_g_soldier_universal_f:I_G_Soldier_F {MACRO_ADDMINEKIT};
// Add ACE_Clacker to snipers and spotters for setting off Claymores
#define MACRO_ADDCLAYMOREKIT \
items[] = {"FirstAidKit","ACE_Clacker"}; \
respawnitems[] = {"FirstAidKit","ACE_Clacker"};
class B_Soldier_sniper_base_F;
class B_sniper_F: B_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
class B_spotter_F: B_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
class I_Soldier_sniper_base_F;
class I_Sniper_F: I_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
class I_Spotter_F: I_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
class O_Soldier_sniper_base_F;
class O_sniper_F: O_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
class O_spotter_F: O_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
};

View File

@ -0,0 +1,55 @@
class CfgWeapons {
class ACE_ItemCore;
class InventoryItem_Base_f;
class ACE_ExplosiveItem: InventoryItem_Base_f {
allowedSlots[] = {801,701,901};
//type = 201;
};
class ACE_Clacker: ACE_ItemCore {
scope = 2;
displayName = $STR_ACE_Explosives_clacker_displayName;
descriptionShort = $STR_ACE_Explosives_clacker_description;
picture = "\ACE_Explosives\Data\UI\Clacker.paa";
model = "\A3\weapons_F\ammo\mag_univ.p3d";
ACE_Range = 250;
ACE_Detonator = 1;
class ItemInfo: ACE_ExplosiveItem {
mass = 3;
uniformModel = "\A3\weapons_F\ammo\mag_univ.p3d";
};
};
class ACE_M26_Clacker: ACE_Clacker {
displayName = $STR_ACE_Explosives_M26_displayName;
picture = "\ACE_Explosives\Data\UI\MK26_Transmitter_ca.paa";
ACE_Range = 5000;
};
class ACE_DefusalKit: ACE_ItemCore {
scope = 2;
displayName = $STR_ACE_Explosives_DefusalKit_displayName;
descriptionShort = $STR_ACE_Explosives_DefusalKit_description;
picture = "\ACE_Explosives\Data\UI\Pliers.paa";
model = "\A3\Structures_F\Items\Tools\Pliers_F.p3d";
class ItemInfo: ACE_ExplosiveItem {
mass = 5;
uniformModel = "\A3\Structures_F\Items\Tools\Pliers_F.p3d";
};
};
class ACE_DeadManSwitch: ACE_ItemCore {
scope = 2;
displayName = $STR_ACE_Explosives_DeadManSwitch_displayName;
descriptionShort = $STR_ACE_Explosives_DeadManSwitch_description;
picture = "\ACE_Explosives\Data\UI\DeadmanSwitch.paa";
model = "\A3\weapons_F\ammo\mag_univ.p3d";
ACE_Range = 100;
ACE_Detonator = 1;
class ItemInfo: ACE_ExplosiveItem {
mass = 2;
uniformModel = "\A3\weapons_F\ammo\mag_univ.p3d";
};
};
};

View File

@ -0,0 +1,98 @@
class CfgMagazines {
class CA_Magazine;
class ATMine_Range_Mag:CA_Magazine{
ACE_Placeable = 1;
useAction = 0;
ACE_SetupObject = "ACE_Explosives_Place_ATMine"; // CfgVehicle class for setup object.
ACE_DelayTime = 2.5;
class ACE_Triggers {
SupportedTriggers[] = {"PressurePlate"};
class PressurePlate {
digDistance = 0.1;
};
};
};
class APERSBoundingMine_Range_Mag:ATMine_Range_Mag{
ACE_SetupObject = "ACE_Explosives_Place_APERSBoundingMine";
class ACE_Triggers {
SupportedTriggers[] = {"PressurePlate"};
class PressurePlate {
digDistance = 0.075;
};
};
};
class APERSMine_Range_Mag:ATMine_Range_Mag{
ACE_SetupObject = "ACE_Explosives_Place_APERSMine";
class ACE_Triggers {
SupportedTriggers[] = {"PressurePlate"};
class PressurePlate {
digDistance = 0.05;
};
};
};
class APERSTripMine_Wire_Mag:ATMine_Range_Mag{
ACE_SetupObject = "ACE_Explosives_Place_APERSTripwireMine";
class ACE_Triggers {
SupportedTriggers[] = {"Tripwire"};
class Tripwire;
};
};
class ClaymoreDirectionalMine_Remote_Mag:CA_Magazine{
ACE_Placeable = 1;
useAction = 0;
ACE_SetupObject = "ACE_Explosives_Place_Claymore";
ACE_DelayTime = 1.5;
class ACE_Triggers {
SupportedTriggers[] = {"Command"};
class Command {
FuseTime = 0.5;
};
};
};
class SatchelCharge_Remote_Mag:CA_Magazine{
ACE_Placeable = 1;
useAction = 0;
ACE_SetupObject = "ACE_Explosives_Place_SatchelCharge";
ACE_DelayTime = 1;
class ACE_Triggers {
SupportedTriggers[] = {"Timer","Command", "MK16_Transmitter", "DeadmanSwitch"};
class Timer {
FuseTime = 0.5;
};
class Command {
FuseTime = 0.5;
};
class MK16_Transmitter:Command{};
class DeadmanSwitch:Command{};
};
};
class DemoCharge_Remote_Mag:SatchelCharge_Remote_Mag{
ACE_SetupObject = "ACE_Explosives_Place_DemoCharge";
model = "\A3\Weapons_F\explosives\c4_charge_small_d";
};
class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag{
ACE_SetupObject = "ACE_Explosives_Place_SLAM";
class ACE_Triggers {
SupportedTriggers[] = {"IRSensor","PressurePlate","Timer","Command"};
class PressurePlate{
displayName = $STR_ACE_Explosives_SLAME_Magnetic;
digDistance = 0;
ammo = "SLAMDirectionalMine_Magnetic_Ammo";
pitch = 90;
};
class IRSensor{
displayName = $STR_ACE_Explosives_SLAME_IRSensor;
};
class Timer {
ammo = "SLAMDirectionalMine_Timer_Ammo";
};
class Command {
ammo = "SLAMDirectionalMine_Command_Ammo";
fuseTime = 0.5;
};
};
};
};

View File

@ -0,0 +1,74 @@
#define GUI_GRID_X (0)
#define GUI_GRID_Y (0)
#define GUI_GRID_W (0.025)
#define GUI_GRID_H (0.04)
#define ST_CENTER 0x02
class RscText;
class RscButton;
#define X_OFFSET 0.25
class RscXSliderH;
class IGUIBack;
class Rsc_ACE_Timer_Slider:RscXSliderH{
x = 0.4;
y = 0.2;
w = 0.3;
h = "1*((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
colorBackground[] = {0,0,0,0.5};
};
class RscACE_SelectTimeUI
{
idd = 8854;
movingEnable = 0;
class controls {
class back:IGUIBack {
x = X_OFFSET;
y = 0;
w = 0.5;
h = 0.2;
colorBackground[] = {0, 0, 0, 0.5};
};
class header: RscText{
idc = 8870;
x = X_OFFSET + 0.005;
y = 0.005;
w = 0.49;
h = 0.05;
style = ST_CENTER;
text = "";
};
class slider: Rsc_ACE_Timer_Slider {
idc = 8845;
x = X_OFFSET + 0.005;
y = 0.06;
w = 0.49;
h = 0.025;
onSliderPosChanged = "private ['_mins', '_secs'];_mins = floor((_this select 1)/60);_secs=floor((_this select 1) - (_mins*60));ctrlSetText [8870, format[localize 'STR_ACE_Explosives_TimerMenu',_mins, _secs]];";
};
class cancelBtn: RscButton {
idc = 8855;
x = X_OFFSET + 0.005;
w = 0.15;
h = 0.1;
y = 0.09;
style = ST_CENTER;
text = $STR_ACE_Explosives_Cancel;
action = "closeDialog 0;";
};
class approveBtn: RscButton {
idc = 8860;
x = X_OFFSET + 0.345;
y = 0.09;
h = 0.1;
w = 0.15;
style = ST_CENTER;
text = $STR_ACE_Explosives_SetTime;
action = "closeDialog 0;";
};
};
};

View File

@ -0,0 +1,69 @@
/*
Name: XEH_postInit.sqf
Author(s):
Garth de Wet (LH)
Description:
Initialises explosive behaviour.
Parameters:
None
Returns:
None
Example:
None
*/
#include "script_component.hpp"
if !(hasInterface) exitWith {};
GVAR(PlacedCount) = 0;
GVAR(Setup) = objNull;
GVAR(pfeh_running) = false;
[{(_this select 0) call FUNC(handleScrollWheel);}] call FUNC(Core,addScrollWheelEventHandler);
player addEventHandler ["Killed", {
private "_deadman";
call FUNC(place_Cancel);
_deadman = [(_this select 0), "DeadManSwitch"] call FUNC(getPlacedExplosives);
{
[(_this select 0), -1, _x, true] call FUNC(detonateExplosive);
} count _deadman;
}];
player addEventHandler ["Take", {
private ["_item", "_getter", "_giver", "_config"];
_item = _this select 2;
_getter = _this select 0;
_giver = _this select 1;
_config = ConfigFile >> "CfgWeapons" >> _item;
if (isClass _config && {getNumber(_config >> "AGM_Detonator") == 1}) then {
private ["_clackerItems"];
_clackerItems = _giver getVariable [QGVAR(Clackers), []];
_getter SetVariable [QGVAR(Clackers), (_getter getVariable [QGVAR(Clackers), []]) + _clackerItems, true];
_detonators = [_giver] call FUNC(getDetonators);
if (count _detonators == 0) then {
_giver setVariable [QGVAR(Clackers), nil, true];
};
};
}];
player addEventHandler ["Put", {
private ["_item", "_getter", "_giver", "_config"];
_item = _this select 2;
_getter = _this select 1;
_giver = _this select 0;
_config = ConfigFile >> "CfgWeapons" >> _item;
if (isClass _config && {getNumber(_config >> "AGM_Detonator") == 1}) then {
private ["_clackerItems"];
_clackerItems = _giver getVariable [QGVAR(Clackers), []];
_getter SetVariable [QGVAR(Clackers), (_getter getVariable [QGVAR(Clackers), []]) + _clackerItems, true];
_detonators = [_giver] call FUNC(getDetonators);
if (count _detonators == 0) then {
_giver setVariable [QGVAR(Clackers), nil, true];
};
};
}];

View File

@ -0,0 +1,50 @@
/*
Name: XEH_preInit.sqf
Author(s):
Garth de Wet (LH)
Description:
Prepares the functions
Parameters:
None
Returns:
None
Example:
None
*/
#include "script_component.hpp"
PREP(addClacker);
PREP(canDefuse);
PREP(defuseExplosive);
PREP(detonateExplosive);
PREP(handleScrollWheel);
PREP(hasExplosives);
PREP(hasPlacedExplosives);
PREP(getDetonators);
PREP(getPlacedExplosives);
PREP(openDetonateUI);
PREP(openPlaceUI);
PREP(openTransmitterUI);
PREP(openTimerSetUI);
PREP(openTriggerSelectionUI);
PREP(place_Approve);
PREP(place_Cancel);
PREP(placeExplosive);
PREP(selectTrigger);
PREP(setupExplosive);
PREP(setPosition);
PREP(startDefuse);
PREP(startTimer);
PREP(triggerType);

View File

@ -0,0 +1,47 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {"ACE_Clacker", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_DeadManSwitch"};
requiredVersion = 0.60;
requiredAddons[] = {ace_core, ace_interaction};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"Garth 'L-H' de Wet"};
authorUrl = "http://garth.snakebiteink.co.za/";
};
};
#include "CfgEventHandlers.hpp"
#include "CfgAmmo.hpp"
#include "CfgMagazines.hpp"
#include "CfgWeapons.hpp"
#include "CfgVehicles.hpp"
#include "ExplosivesUI.hpp"
class CfgActions {
class None;
class Deactivate:None {
show = 0;
};
class DeactivateMine:None {
show = 0;
};
};
class CfgMineTriggers {
class RangeTrigger;
class MagneticTrigger: RangeTrigger {
mineMagnetic = 1;
mineTriggerRange = 1;
};
};
class ACE_Parameters_Boolean {
GVAR(RequireSpecialist) = 0;
GVAR(PunishNonSpecialists) = 1;
};

View File

@ -1,24 +1,25 @@
/*
Name: AGM_Explosives_fnc_AddClacker
Name: ACE_Explosives_fnc_addClacker
Author(s):
Garth de Wet (LH)
Description:
Adds an explosive as a clacker item to the passed unit if the unit has a AGM_Clacker item.
Adds an explosive as a clacker item to the passed unit if the unit has a ACE_Clacker item.
Parameters:
0: OBJECT - unit
1: OBJECT - Explosive
2: STRING - Magazine
3: ARRAY - Extra vars
Returns:
Nothing
Example:
[_unit, _explosive, "SatchelCharge_Remote_Mag", [ConfigFile >> "CfgAGM_Triggers" >> "Command"]] call AGM_Explosives_fnc_AddClacker;
[_unit, _explosive, "SatchelCharge_Remote_Mag", [ConfigFile >> "CfgACE_Triggers" >> "Command"]] call ACE_Explosives_fnc_AddClacker;
*/
#include "script_component.hpp"
private ["_unit", "_explosive", "_clacker", "_config", "_magazineClass", "_requiredItems", "_hasRequired"];
_unit = _this select 0;
_explosive = _this select 1;
@ -28,7 +29,7 @@ _config = (_this select 3) select (count (_this select 3) - 1);
_requiredItems = getArray(_config >> "requires");
_hasRequired = true;
_detonators = [AGM_player] call AGM_Explosives_fnc_getDetonators;
_detonators = [_unit] call FUNC(getDetonators);
{
if !(_x in _detonators) exitWith{
_hasRequired = false;
@ -36,10 +37,11 @@ _detonators = [AGM_player] call AGM_Explosives_fnc_getDetonators;
} count _requiredItems;
if !(_hasRequired) exitWith {};
_config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "AGM_Triggers" >> configName _config;
_config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> configName _config;
_clacker = _unit getVariable ["AGM_Clacker", []];
AGM_Explosives_PlacedCount = AGM_Explosives_PlacedCount + 1;
_clacker pushBack [_explosive, getNumber(_config >> "FuseTime"), format [localize "STR_AGM_Explosives_DetonateCode", AGM_Explosives_PlacedCount], _magazineClass, configName ((_this select 3) select (count (_this select 3) - 1))];
_unit setVariable ["AGM_Clacker", _clacker, true];
_unit sideChat format [localize "STR_AGM_Explosives_DetonateCode", AGM_Explosives_PlacedCount];
_clacker = _unit getVariable [QGVAR(Clackers), []];
GVAR(PlacedCount) = GVAR(PlacedCount) + 1;
_clacker pushBack [_explosive, getNumber(_config >> "FuseTime"), format [localize "STR_ACE_Explosives_DetonateCode",
GVAR(PlacedCount)], _magazineClass, configName ((_this select 3) select (count (_this select 3) - 1))];
_unit setVariable [QGVAR(Clackers), _clacker, true];
_unit sideChat format [localize "STR_ACE_Explosives_DetonateCode", GVAR(PlacedCount)];

View File

@ -1,26 +1,27 @@
/*
Name: AGM_Explosives_fnc_CanDefuse
Name: ACE_Explosives_fnc_canDefuse
Author: Garth de Wet (LH)
Description:
Checks if a unit can defuse an explosive
Parameters:
Parameters:
0: OBJECT - unit
Returns:
Nothing
Example:
[player] call AGM_Explosives_fnc_CanDefuse;
[player] call ACE_Explosives_fnc_CanDefuse;
*/
#include "script_component.hpp"
private "_unit";
_unit = _this select 0;
if (vehicle _unit != _unit || {!("AGM_DefusalKit" in (items _unit))}) exitWith {false};
_isSpecialist = ([_unit] call AGM_Core_fnc_isEOD);
if (vehicle _unit != _unit || {!("ACE_DefusalKit" in (items _unit))}) exitWith {false};
_isSpecialist = [_unit] call EFUNC(Core,isEOD);
if (AGM_Explosives_RequireSpecialist && {!_isSpecialist}) exitWith {false};
if (GVAR(RequireSpecialist) && {!_isSpecialist}) exitWith {false};
_timeBombCore = nearestObject [_unit, "TimeBombCore"];
_mineBase = nearestObject [_unit, "MineBase"];
@ -30,10 +31,10 @@ _distBase = _unit distance _mineBase;
_distance = 10;
if (_distCore < _distBase) then {
_distance = _distCore;
AGM_Interaction_Target = _timeBombCore;
EGVAR(Interaction,Target) = _timeBombCore;
}else{
_distance = _distBase;
AGM_Interaction_Target = _mineBase;
EGVAR(Interaction,Target) = _mineBase;
};
if (isNil "_distance") exitWith {false};
_distance < 4

View File

@ -1,27 +1,28 @@
/*
Name: AGM_Explosives_fnc_DefuseExplosive
Name: ACE_Explosives_fnc_defuseExplosive
Author: Garth de Wet (LH)
Description:
Defuses an Explosive
Parameters:
Parameters:
0: OBJECT - unit
1: OBJECT - Explosive
Returns:
Nothing
Example:
[player, AGM_Interaction_Target] call AGM_Explosives_fnc_DefuseExplosive;
[player, ACE_Interaction_Target] call ACE_Explosives_fnc_defuseExplosive;
*/
#include "script_component.hpp"
private ["_unit", "_explosive"];
_unit = _this select 0;
_explosive = _this select 1;
if (getNumber (ConfigFile >> "CfgAmmo" >> typeof _explosive >> "AGM_explodeOnDefuse") == 1) exitWith {
[_unit, -1, [_explosive, 1], true] call AGM_Explosives_fnc_DetonateExplosive;
if (getNumber (ConfigFile >> "CfgAmmo" >> typeof _explosive >> "ACE_explodeOnDefuse") == 1) exitWith {
[_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive);
};
_unit action ["Deactivate", _unit, _explosive];

View File

@ -1,50 +1,40 @@
/*
Name: AGM_Explosives_fnc_DetonateExplosive
Name: ACE_Explosives_fnc_detonateExplosive
Author(s):
Garth de Wet (LH)
Description:
Detonates a remote Explosive.
Parameters:
0: OBJECT - Unit detonating explosive
1: NUMBER - Max range (-1 to ignore)
2: ARRAY - Explosive
0: OBJECT - Explosive
1: NUMBER - Fuse Time
3: BOOLEAN - Ignore Jammer
Returns:
Nothing
Example:
// Clacker
[player, 100, [Explosive, 1], false] call AGM_Explosives_fnc_DetonateExplosive;
[player, 100, [Explosive, 1]] call ACE_Explosives_fnc_detonateExplosive;
*/
private ["_item","_result", "_ignoreRange", "_ignoreJammer", "_unit", "_range"];
#include "script_component.hpp"
private ["_item","_result", "_ignoreRange", "_unit", "_range"];
_unit = _this select 0;
_range = _this select 1;
_item = _this select 2;
_ignoreRange = (_range == -1);
_ignoreJammer = true;//(_this select 4); // disabled while jammers aren't in place.
_result = true;
if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {false};
if (!_ignoreJammer) then {
{
if (((_x select 2) getVariable ["AGM_JammerEnabled",false]) and {(_x select 0) distance (_item select 0) <= (_x select 1)}) exitWith {
_result = false;
};
} count AGM_Explosives_Jammers;
};
if (!_result) exitWith{};
if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then {
private ["_exp", "_previousExp"];
_previousExp = _item select 0;
_exp = getText (ConfigFile >> "CfgAmmo" >> typeof (_previousExp) >> "AGM_Explosive");
_exp = getText (ConfigFile >> "CfgAmmo" >> typeof (_previousExp) >> "ACE_Explosive");
if (_exp != "") then {
_exp = createVehicle [_exp, [0,0,15001], [], 0, "NONE"];
_exp setDir (getDir _previousExp);

View File

@ -1,21 +1,22 @@
/*
Name: AGM_Explosives_fnc_getDetonators
Name: ACE_Explosives_fnc_getDetonators
Author(s):
Garth de Wet (LH)
Description:
Gets all the detonators of a specific unit
Parameters:
0: OBJECT - Unit to get detonators of
Returns:
ARRAY - Configs of all detonators.
Example:
_detonators = [player] call AGM_Explosives_fnc_getDetonators;
_detonators = [player] call ACE_Explosives_fnc_getDetonators;
*/
#include "script_component.hpp"
private ["_unit", "_items", "_result", "_config"];
_unit = _this select 0;
_items = (items _unit);
@ -23,7 +24,7 @@ _result = [];
{
_config = ConfigFile >> "CfgWeapons" >> _x;
if (getNumber (_config >> "AGM_Detonator") == 1) then {
if (getNumber (_config >> "ACE_Detonator") == 1) then {
_result pushBack _x;
};
} forEach _items;

View File

@ -1,38 +1,39 @@
/*
Name: AGM_Explosives_fnc_getPlacedExplosives
Name: ACE_Explosives_fnc_getPlacedExplosives
Author: Garth de Wet (LH)
Description:
Gets all placed explosives, whether Clacker based or not.
Parameters:
Parameters:
0: OBJECT - unit
1: STRING - (OPTIONAL) Trigger classname for filter.
Returns:
Array: Explosives.
Example:
_allExplosives = [player] call AGM_Explosives_fnc_getPlacedExplosives;
_deadmanExplosives = [player, "DeadManSwitch"] call AGM_Explosives_fnc_getPlacedExplosives;
_allExplosives = [player] call ACE_Explosives_fnc_getPlacedExplosives;
_deadmanExplosives = [player, "DeadManSwitch"] call ACE_Explosives_fnc_getPlacedExplosives;
*/
#include "script_component.hpp"
private ["_unit", "_clackerList", "_adjustedList", "_list", "_filter"];
_unit = _this select 0;
_filter = nil;
if (count _this > 1) then {
_filter = ConfigFile >> "CfgAGM_Triggers" >> (_this select 1);
_filter = ConfigFile >> "CfgACE_Triggers" >> (_this select 1);
};
_clackerList = [];
_adjustedList = false;
_clackerList = _unit getVariable ["AGM_Clacker", []];
_clackerList = _unit getVariable [QGVAR(Clackers), []];
_list = [];
{
if isNull (_x select 0) then {
_clackerList set [_foreachIndex, "X"];
_adjustedList = true;
} else {
if (isNil "_filter" || {(ConfigFile >> "CfgAGM_Triggers" >> (_x select 4)) == _filter}) then {
if (isNil "_filter" || {(ConfigFile >> "CfgACE_Triggers" >> (_x select 4)) == _filter}) then {
_list pushBack _x;
};
};
@ -40,10 +41,10 @@ _list = [];
if (_adjustedList) then {
_clackerList = _clackerList - ["X"];
if (count _clackerList == 0) then {
_unit SetVariable ["AGM_Clacker", nil, true];
_unit SetVariable [QGVAR(Clackers), nil, true];
} else {
_unit SetVariable ["AGM_Clacker", _clackerList, true];
_unit SetVariable [QGVAR(Clackers), _clackerList, true];
};
};
_list
_list

View File

@ -0,0 +1,26 @@
/*
Name: ACE_Explosives_fnc_HandleScrollWheel
Author(s):
L-H
Description:
Handles rotating of Explosives
Parameters:
Number: Scroll amount
Returns:
Boolean: Handled or not.
Example:
1.2 call ACE_Explosives_fnc_HandleScrollWheel;
*/
#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);
GVAR(TweakedAngle) = GVAR(TweakedAngle) + _this;
true

View File

@ -1,26 +1,27 @@
/*
Name: AGM_Explosives_fnc_hasExplosives
Name: ACE_Explosives_fnc_hasExplosives
Author: Garth de Wet (LH)
Description:
Whether the passed unit has any explosives on them.
Parameters:
Parameters:
0: OBJECT - unit
Returns:
BOOLEAN - True if the unit has explosives.
Example:
_hasExplosives = [player] call AGM_Explosives_fnc_hasExplosives;
_hasExplosives = [player] call ACE_Explosives_fnc_hasExplosives;
*/
#include "script_component.hpp"
private ["_unit", "_result", "_magazines"];
_result = false;
_unit = _this select 0;
_magazines = magazines _unit;
{
if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> "AGM_Placeable") == 1) exitWith {
if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> "ACE_Placeable") == 1) exitWith {
_result = true;
};
} count _magazines;

View File

@ -1,18 +1,19 @@
/*
Name: AGM_Explosives_fnc_hasPlacedExplosives
Name: ACE_Explosives_fnc_hasPlacedExplosives
Author: Garth de Wet (LH)
Description:
Whether the passed unit has placed any explosives or has a clacker that was used when explosives were placed.
Parameters:
Parameters:
0: OBJECT - unit
Returns:
BOOLEAN - True if the unit has explosives.
Example:
_hasPLacedExplosives = [player] call AGM_Explosives_fnc_hasPlacedExplosives;
_hasPLacedExplosives = [player] call ACE_Explosives_fnc_hasPlacedExplosives;
*/
(count (_this call AGM_Explosives_fnc_getPlacedExplosives) > 0)
#include "script_component.hpp"
(count (_this call FUNC(getPlacedExplosives)) > 0)

View File

@ -0,0 +1,28 @@
/*
Name: ACE_Explosives_fnc_module
Author: Garth de Wet (LH)
Description:
Initialises the explosives module
Parameters:
Things
Returns:
Nothing
Example:
*/
#include "script_component.hpp"
if !(isServer) exitWith {};
_logic = _this select 0;
_activated = _this select 2;
if !(_activated) exitWith {};
[_logic, QGVAR(RequireSpecialist), "RequireSpecialist" ] call EFUNC(Core,readBooleanParameterFromModule);
[_logic, QGVAR(PunishNonSpecialists), "PunishNonSpecialists" ] call EFUNC(Core,readBooleanParameterFromModule);
diag_log text "[ACE]: Explosive Module Initialized.";

View File

@ -0,0 +1,63 @@
/*
Name: ACE_Explosives_fnc_openDetonateUI
Author: Garth de Wet (LH)
Description:
Opens the UI for explosive detonation selection
Parameters:
0: OBJECT - unit
0: STRING - Classname of detonator
Returns:
Nothing
Example:
[player, "ACE_M26_Clacker"] call ACE_Explosives_fnc_openDetonateUI;
*/
#include "script_component.hpp"
private ["_unit","_result", "_item"];
call EFUNC(Interaction,hideMenu);
_unit = _this select 0;
_detonator = _this select 1;
_range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range");
_result = [_unit] call FUNC(getPlacedExplosives);
_actions = [localize "STR_ACE_Explosives_DetonateMenu", localize "STR_ACE_Explosives_Detonate"]
call EFUNC(Interaction,prepareSelectMenu);
_count = 0;
{
if (!isNull(_x select 0)) then {
_required = getArray (ConfigFile >> "CfgACE_Triggers" >> (_x select 4) >> "requires");
if (_detonator in _required) then {
_item = ConfigFile >> "CfgMagazines" >> (_x select 3);
_actions = [
_actions,
_x select 2,
getText(_item >> "picture"),
[_foreachIndex, _range]
] call EFUNC(Interaction,AddSelectableItem);
_count = _count + 1;
};
};
} foreach _result;
if (_count > 0) then {
[
_actions,
{
[
ACE_player,
[_this select 1] call EFUNC(Core,toNumber),
(ACE_player getVariable [QGVAR(Clackers), []]) select ([_this select 0] call EFUNC(Core,toNumber)),
false
] call FUNC(detonateExplosive);
call EFUNC(Interaction,hideMenu);
},
{[ACE_player] call FUNC(openTransmitterUI);}
] call EFUNC(Interaction,openSelectMenu);
}else{
call EFUNC(Interaction,hideMenu);
[ACE_player] call FUNC(openTransmitterUI);
[localize "STR_ACE_Explosives_NoExplosivesAvailable"] call EFUNC(Core,displayTextStructured);
};

View File

@ -1,30 +1,31 @@
/*
Name: AGM_Explosives_fnc_openPlaceUI
Name: ACE_Explosives_fnc_openPlaceUI
Author: Garth de Wet (LH)
Description:
Opens the UI for explosive placement selection
Parameters:
Parameters:
0: OBJECT - unit
Returns:
Nothing
Example:
[player] call AGM_Explosives_fnc_openPlaceUI;
[player] call ACE_Explosives_fnc_openPlaceUI;
*/
#include "script_component.hpp"
private ["_unit","_mags", "_item", "_index", "_actions"];
_unit = _this select 0;
call AGM_Explosives_fnc_Place_Cancel;
call FUNC(place_Cancel);
_mags = magazines _unit;
_list = [];
_itemCount = [];
{
_item = ConfigFile >> "CfgMagazines" >> _x;
if (getNumber(_item >> "AGM_Placeable") == 1) then {
if (getNumber(_item >> "ACE_Placeable") == 1) then {
_index = _list find _item;
if (_index != -1) then {
_itemCount set [_index, (_itemCount select _index) + 1];
@ -34,25 +35,26 @@ _itemCount = [];
};
};
} forEach _mags;
_actions = [localize "STR_AGM_Explosives_PlaceMenu", localize "STR_AGM_Explosives_Place"] call AGM_Interaction_fnc_prepareSelectMenu;
_actions = [localize "STR_ACE_Explosives_PlaceMenu", localize "STR_ACE_Explosives_Place"]
call EFUNC(Interaction,prepareSelectMenu);
{
_actions = [
_actions,
format [getText(_x >> "displayName") + " (%1)", _itemCount select _foreachIndex],
getText(_x >> "picture"),
configName _x
] call AGM_Interaction_fnc_AddSelectableItem;
] call EFUNC(Interaction,AddSelectableItem);
} foreach _list;
[
_actions,
{
[_this] call AGM_Explosives_fnc_openTriggerSelectionUI;
[_this] call FUNC(openTriggerSelectionUI);
},
{
call AGM_Interaction_fnc_hideMenu;
if !(profileNamespace getVariable ["AGM_Interaction_AutoCloseMenu", false]) then {
"AGM_Explosives" call AGM_Interaction_fnc_openMenuSelf;
call EFUNC(Interaction,hideMenu);
if !(profileNamespace getVariable ["ACE_Interaction_AutoCloseMenu", false]) then {
"ACE_Explosives" call EFUNC(Interaction,openMenuSelf);
};
}
] call AGM_Interaction_fnc_openSelectMenu;
] call EFUNC(Interaction,openSelectMenu);

View File

@ -0,0 +1,28 @@
/*
Name: ACE_Explosives_fnc_openTimerSetUI
Author: Garth de Wet (LH)
Description:
Opens the UI for timer setting of an explosive
Parameters:
0: String - Magazine
Returns:
Nothing
Example:
[player] call ACE_Explosives_fnc_openTimerSetUI;
*/
#include "script_component.hpp"
private ["_mag"];
_mag = _this select 0;
createDialog "RscACE_SelectTimeUI";
sliderSetRange [8845, 5, 900]; // 5seconds - 15minutes
sliderSetPosition [8845, 30];
buttonSetAction [8860, format[QUOTE([ACE_player, '%1', 'Timer', floor(sliderPosition 8845)] call FUNC(setupExplosive);closeDialog 0;), _mag]];
buttonSetAction [8855, format[QUOTE(['%1'] call FUNC(openTriggerSelectionUI);), _mag]];
ctrlSetText [8870, format[localize "STR_ACE_Explosives_TimerMenu",0, 30]];

View File

@ -0,0 +1,53 @@
/*
Name: ACE_Explosives_fnc_openTransmitterUI
Author: Garth de Wet (LH)
Description:
Opens the UI for selecting the transmitter
Parameters:
0: OBJECT - Unit
Returns:
Nothing
Example:
[player] call ACE_Explosives_fnc_openTransmitterUI;
*/
#include "script_component.hpp"
private ["_items", "_unit", "_count", "_actions", "_config"];
_unit = _this select 0;
_items = (items _unit);
_actions = [localize "STR_ACE_Explosives_TriggerMenu", localize "STR_ACE_Explosives_SelectTrigger"]
call EFUNC(Interaction,prepareSelectMenu);
_detonators = [_unit] call FUNC(getDetonators);
{
_config = ConfigFile >> "CfgWeapons" >> _x;
_actions = [
_actions,
getText(_config >> "displayName"),
getText(_config >> "picture"),
_x
] call EFUNC(Interaction,addSelectableItem);
} count _detonators;
if (count _detonators == 0) then {
call EFUNC(Interaction,hideMenu);
"ACE_Explosives" call EFUNC(Interaction,openMenuSelf);
[format[localize "STR_ACE_Explosives_NoTriggersAvailable", "player"]] call EFUNC(Core,displayTextStructured);
}else{
[
_actions,
{
[ACE_player, _this] call FUNC(openDetonateUI);
},
{
call EFUNC(Interaction,hideMenu);
if !(profileNamespace getVariable ["ACE_Interaction_AutoCloseMenu", false]) then {
"ACE_Explosives" call EFUNC(Interaction,openMenuSelf);
};
}
] call EFUNC(Interaction,openSelectMenu);
};

View File

@ -1,27 +1,29 @@
/*
Name: AGM_Explosives_fnc_openTriggerSelectionUI
Name: ACE_Explosives_fnc_openTriggerSelectionUI
Author: Garth de Wet (LH)
Description:
Opens the UI for explosive trigger selection
Parameters:
Parameters:
0: String - explosive magazine
Returns:
Nothing
Example:
[lbData [8866, lbCurSel 8866]] call AGM_Explosives_fnc_openTriggerSelectionUI;
[lbData [8866, lbCurSel 8866]] call ACE_Explosives_fnc_openTriggerSelectionUI;
*/
#include "script_component.hpp"
private ["_magazine", "_hasRequiredItems","_triggerTypes", "_actions", "_detonators", "_required", "_magTriggers"];
_magazine = _this select 0;
_detonators = [AGM_player] call AGM_Explosives_fnc_getDetonators;
_detonators = [ACE_player] call FUNC(getDetonators);
_triggerTypes = [_magazine] call AGM_Explosives_fnc_TriggerType;
_magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "AGM_Triggers";
_actions = [localize "STR_AGM_Explosives_TriggerMenu", localize "STR_AGM_Explosives_SelectTrigger"] call AGM_Interaction_fnc_prepareSelectMenu;
_triggerTypes = [_magazine] call FUNC(triggerType);
_magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers";
_actions = [localize "STR_ACE_Explosives_TriggerMenu", localize "STR_ACE_Explosives_SelectTrigger"]
call EFUNC(Interaction,prepareSelectMenu);
_count = 0;
{
_required = getArray (_x >> "requires");
@ -37,20 +39,21 @@ _count = 0;
if(isText(_magTriggers >> configName _x >> "displayName"))then{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")},
[configName _x, _magazine]
] call AGM_Interaction_fnc_AddSelectableItem;
] call EFUNC(Interaction,addSelectableItem);
_count = _count + 1;
};
} count _triggerTypes;
if (_count == 0) then {
[AGM_player] call AGM_Explosives_fnc_openPlaceUI;
[format[localize "STR_AGM_Explosives_NoTriggersAvailable", getText(configFile >> "CfgMagazines" >> _magazine >> "DisplayName")]] call AGM_Core_fnc_displayTextStructured;
[ACE_player] call FUNC(openPlaceUI);
[format[localize "STR_ACE_Explosives_NoTriggersAvailable",
getText(configFile >> "CfgMagazines" >> _magazine >> "DisplayName")]] call EFUNC(Core,displayTextStructured);
}else{
[
_actions,
{
[_this select 1, _this select 0] call AGM_Explosives_fnc_selectTrigger;
[_this select 1, _this select 0] call FUNC(selectTrigger);
},
{[AGM_player] call AGM_Explosives_fnc_openPlaceUI;}
] call AGM_Interaction_fnc_openSelectMenu;
{[ACE_player] call FUNC(openPlaceUI);}
] call EFUNC(Interaction,openSelectMenu);
};

View File

@ -1,12 +1,12 @@
/*
Name: AGM_Explosives_fnc_PlaceExplosive
Name: ACE_Explosives_fnc_PlaceExplosive
Author(s):
Garth de Wet (LH)
Description:
Places an explosive at the requested position
Parameters:
0: OBJECT - unit
1: POSITION - Position to place explosive
@ -14,13 +14,14 @@
3: STRING - Magazine class
4: Config - Config of trigger
5: ARRAY - variables required for the trigger type
Returns:
OBJECT: Placed explosive
Example:
_explosive = [player, player modelToWorld [0,0.5, 0.1], 134, "SatchelCharge_Remote_Mag", "Command", []] call AGM_Explosives_fnc_PlaceExplosive;
_explosive = [player, player modelToWorld [0,0.5, 0.1], 134, "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_PlaceExplosive;
*/
#include "script_component.hpp"
private ["_pos", "_dir", "_magazineClass", "_ammo", "_triggerSpecificVars", "_unit", "_triggerConfig", "_explosive"];
_unit = _this select 0;
_pos = _this select 1;
@ -34,15 +35,15 @@ if (count _this > 6) then {
};
if (isNil "_triggerConfig") exitWith {
diag_log format ["AGM_Explosives: Error config not passed to PlaceExplosive: %1", _this];
diag_log format ["ACE_Explosives: Error config not passed to PlaceExplosive: %1", _this];
objNull
};
_magazineTrigger = ConfigFile >> "CfgMagazines" >> _magazineClass >> "AGM_Triggers" >> _triggerConfig;
_triggerConfig = ConfigFile >> "CfgAGM_Triggers" >> _triggerConfig;
_magazineTrigger = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> _triggerConfig;
_triggerConfig = ConfigFile >> "CfgACE_Triggers" >> _triggerConfig;
if (isNil "_triggerConfig") exitWith {
diag_log format ["AGM_Explosives: Error config not found in PlaceExplosive: %1", _this];
diag_log format ["ACE_Explosives: Error config not found in PlaceExplosive: %1", _this];
objNull
};
@ -52,8 +53,10 @@ if (isText(_magazineTrigger >> "ammo")) then {
};
_triggerSpecificVars pushBack _triggerConfig;
_explosive = createVehicle [_ammo, _pos, [], 0, "NONE"];
if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_triggerSpecificVars] call compile (getText (_triggerConfig >> "onPlace"))}) exitWith {_explosive};
if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_triggerSpecificVars]
call compile (getText (_triggerConfig >> "onPlace"))}) exitWith {_explosive};
if (_setDir) then {
[[_explosive, _dir, getNumber (_magazineTrigger >> "pitch")], "AGM_Explosives_fnc_setPos"] call AGM_Core_fnc_execRemoteFnc;
[[_explosive, _dir, getNumber (_magazineTrigger >> "pitch")], QUOTE(FUNC(setPosition))]
call EFUNC(Core,execRemoteFnc);
};
_explosive

View File

@ -0,0 +1,108 @@
/*
Name: ACE_Explosives_fnc_Place_Approve
Author(s):
Garth de Wet (LH)
Description:
Approves placement of the explosive, releases the placement object for it to settle in a location suitable for the explosive to be created.
Parameters:
Nothing
Returns:
Nothing
Example:
call ACE_Explosives_fnc_Place_Approve;
*/
#include "script_component.hpp"
if (GVAR(pfeh_running)) then {
[QGVAR(Placement),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
GVAR(pfeh_running) = false;
};
private ["_mag", "_setup", "_player"];
_setup = GVAR(Setup);
GVAR(Setup) = objNull;
[GVAR(placer), "ACE_Explosives", false] call EFUNC(Core,setForceWalkStatus);
GVAR(placer) = objNull;
_player = ACE_player;
[_player, "DefaultAction", _player getVariable [QGVAR(Place), -1]] call EFUNC(Core,removeActionEventHandler);
[_player, "MenuBack", _player getVariable [QGVAR(Cancel), -1]] call EFUNC(Core,removeActionEventHandler);
call EFUNC(Interaction,hideMouseHint);
if ((_setup getVariable [QGVAR(Class), ""]) != "") then {
_dir = (getDir _setup);
if (_dir > 180) then {
_dir = _dir - 180;
} else {
_dir = 180 + _dir;
};
_setup setVariable [QGVAR(Direction), _dir];
_player setVariable [QGVAR(PlantingExplosive), true];
_setup addEventHandler ["EpeContactStart", {
if (!((_this select 0) getVariable [QGVAR(Handled), false])) then {
private ["_player", "_pos", "_attachTo"];
_player = ACE_player;
_pos = getPosATL (_this select 0);
(_this select 0) enableSimulationGlobal false;
if (surfaceIsWater _pos) then {
_pos = getPosASL (_this select 0);
(_this select 0) setPosASL _pos;
}else{
(_this select 0) setPosATL _pos;
};
(_this select 0) setVariable [QGVAR(Handled), true];
_player setVariable [QGVAR(PlantingExplosive), false];
_attachTo = objNull;
if (!isNull (_this select 1) && {(_this select 1) isKindOf "AllVehicles"}) then {
_attachTo = (_this select 1);
};
[(_this select 0),_attachTo, _pos] spawn { // TODO: Change to scheduled delay execution
private ["_mag", "_setup", "_dir", "_player"];
_setup = _this select 0;
_player = ACE_player;
_mag = _setup getVariable [QGVAR(Class), ""];
_dir = _setup getVariable [QGVAR(Direction), 0];
sleep getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime");
_explosive = [_player, _this select 2, _dir, _mag, _setup getVariable QGVAR(Trigger),
[_setup getVariable QGVAR(Timer)], isNull (_this select 1)] call FUNC(placeExplosive);
deleteVehicle _setup;
if (!isNull(_explosive)) then {
_player RemoveMagazine _mag;
if (!isNull (_this select 1)) then {
_explosive attachTo [(_this select 1)];
_dir = _dir - (getDir (_this select 1));
[[_explosive, _dir, 0], QUOTE(FUNC(setPosition))] call EFUNC(Core,execRemoteFnc);
};
};
};
};
}];
_setup enableSimulationGlobal true;
_player playActionNow "MedicOther";
[_setup] spawn { // TODO: Change to scheduled delay execution
private ["_setup", "_player"];
_setup = _this select 0;
_player = ACE_player;
sleep 5;
if (!isNull _setup) then {
private ["_mag", "_dir", "_delayTime"];
_mag = _setup getVariable [QGVAR(Class), ""];
_dir = _setup getVariable [QGVAR(Direction), 0];
_delayTime = (getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime")) - 5;
if (_delayTime > 0) then {
sleep _delayTime;
};
if (!isNull _setup) then {
[_player, GetPosATL _setup, _dir, _mag, _setup getVariable QGVAR(Trigger),
[_setup getVariable QGVAR(Timer)], true] call FUNC(placeExplosive);
deleteVehicle _setup;
_player RemoveMagazine _mag;
_player setVariable [QGVAR(PlantingExplosive), false];
};
};
};
}else{
deleteVehicle _setup;
};

View File

@ -0,0 +1,35 @@
/*
Name: ACE_Explosives_fnc_Place_Cancel
Author(s):
Garth de Wet (LH)
Description:
Cancels placement of the explosive
Parameters:
Nothing
Returns:
Nothing
Example:
call ACE_Explosives_fnc_Place_Cancel;
*/
#include "script_component.hpp"
if (GVAR(pfeh_running)) then {
[QGVAR(Placement),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
GVAR(pfeh_running) = false;
};
if (!isNull (GVAR(Setup))) then {
deleteVehicle GVAR(Setup);
};
GVAR(Setup) = objNull;
if (isNil {GVAR(placer)}) then {
GVAR(placer) = objNull;
};
[GVAR(placer), "ACE_Explosives", false] call EFUNC(Core,setForceWalkStatus);
GVAR(placer) = objNull;
call EFUNC(Interaction,hideMouseHint);
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Place), -1]] call EFUNC(Core,removeActionEventHandler);
[ACE_player, "MenuBack", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Core,removeActionEventHandler);

View File

@ -1,29 +1,30 @@
/*
Name: AGM_Explosives_fnc_selectTrigger
Name: ACE_Explosives_fnc_selectTrigger
Author: Garth de Wet (LH)
Description:
Selects a trigger for an explosive.
Parameters:
Parameters:
0: String - Magazine
1: String - trigger index in AGM_triggers of magazine class
1: String - trigger index in ACE_triggers of magazine class
Returns:
Nothing
Example:
["SatchelCharge_Remote_Mag","Timer"] call AGM_Explosives_fnc_selectTrigger;
["SatchelCharge_Remote_Mag","Timer"] call ACE_Explosives_fnc_selectTrigger;
*/
#include "script_component.hpp"
private ["_magazine","_trigger"];
closeDialog 0;
_magazine = _this select 0;
_trigger = _this select 1;
_config = ConfigFile >> "CfgAGM_Triggers" >> _trigger;
call AGM_Interaction_fnc_hideMenu;
_config = ConfigFile >> "CfgACE_Triggers" >> _trigger;
call EFUNC(Interaction,hideMenu);
// If the onSetup function returns true, it is handled elsewhere
if (isText(_config >> "onSetup") && {[_magazine] call compile getText (_config >> "onSetup")}) exitWith {};
[AGM_player, _magazine, _trigger] call AGM_Explosives_fnc_SetupExplosive;
[ACE_player, _magazine, _trigger] call FUNC(setupExplosive);

View File

@ -1,23 +1,24 @@
/*
Name: AGM_Explosives_fnc_SetPos
Name: ACE_Explosives_fnc_SetPos
Author(s):
Garth de Wet (LH)
Description:
Sets the Dir and pitch
Parameters:
0: OBJECT - Object
1: NUMBER - Direction
2: NUMBER - Pitch
Returns:
Nothing
Example:
[_explosive, 150, 90] call AGM_Explosives_fnc_SetPos;
[_explosive, 150, 90] call ACE_Explosives_fnc_SetPos;
*/
#include "script_component.hpp"
private "_ex";
_ex=_this select 0;
_ex setDir (_this select 1);

View File

@ -0,0 +1,67 @@
/*
Name: ACE_Explosives_fnc_SetupExplosive
Author(s):
Garth de Wet (LH)
Description:
Starts the setup process for the passed explosive.
Parameters:
0: OBJECT - Unit placing explosive.
1: STRING - Classname of explosive to place. (CfgMagazine class)
2: Config - Trigger Config
3: NUMBER - (optional) timer
Returns:
Nothing
Example:
[player, "SatchelCharge_Remote_Mag", "Command"] call ACE_Explosives_fnc_SetupExplosive;
*/
#include "script_component.hpp"
private ["_unit", "_class", "_config", "_timer"];
_unit = _this select 0;
_class = _this select 1;
_config = _this select 2;
_timer = _this select 3;
GVAR(placer) = _unit;
// Commented out due to the fact there is a distinction between who can deactivate mines and who can plant them in standard configs.
// Would require custom config entries (ACE_ExplosiveSpecialist/ACE_Specialist) which excludes custom mods.
//if (ACE_Explosives_RequireSpecialist && {!([_unit] call ACE_Core_fnc_isEOD)}) exitWith {};
if (isNil "_config") then {
_config = getArray(ConfigFile >> "CfgMagazines" >> _class >> "ACE_Triggers" >> "ACE_Triggers") select 0;
};
GVAR(Setup) = getText(ConfigFile >> "CfgMagazines" >> _class >> "ACE_SetupObject") createVehicleLocal [0,0,-10000];
GVAR(Setup) enableSimulationGlobal false;
GVAR(Setup) setVariable [QGVAR(Class), _class];
GVAR(Setup) setVariable [QGVAR(Trigger), _config];
//GVAR(Setup) setVariable [QGVAR(Offset), GetArray(ConfigFile >> "CfgVehicles" >> typeof GVAR(Setup) >> "ACE_Offset")];
if (!isNil "_timer") then {
GVAR(Setup) setVariable [QGVAR(Timer), _timer];
};
[_unit, "ACE_Explosives", true] call EFUNC(Core,setForceWalkStatus);
GVAR(TweakedAngle) = 180;
[QGVAR(Placement),"OnEachFrame", {
private "_player";
_player = ACE_player;
if (GVAR(placer) != _player) exitWith {
call Func(place_Cancel);
};
GVAR(pfeh_running) = true;
_pos = (ASLtoATL eyePos _player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]);
//_pos = _pos vectorAdd ((VectorDir GVAR(Setup)) vectorCrossProduct (GVAR(Setup) getVariable [QGVAR(Offset), [0,0,0]]));
GVAR(Setup) setPosATL _pos;
if (ACE_Modifier == 0) then {
GVAR(Setup) setDir (GVAR(TweakedAngle) + getDir _player);
};
}] call BIS_fnc_addStackedEventHandler;
[localize "STR_ACE_Explosives_PlaceAction", localize "STR_ACE_Explosives_CancelAction",
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(Core,AddActionEventHandler)];
_unit setVariable [QGVAR(Cancel), [_unit, "MenuBack",
{GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call Func(place_Cancel);}] call EFUNC(Core,AddActionEventHandler)];

View File

@ -0,0 +1,68 @@
/*
Name: ACE_Explosives_fnc_StartDefuse
Author: Garth de Wet (LH)
Description:
Starts defusing an explosive
Parameters:
0: OBJECT - Unit to defuse explosive
1: OBJECT - Target explosive
Returns:
Nothing
Example:
[player, ACE_Interaction_Target] call ACE_Explosives_fnc_StartDefuse;
*/
#include "script_component.hpp"
private ["_unit","_target"];
_unit = _this select 0;
_target = _this select 1;
_fnc_DefuseTime = {
_target = _this select 1;
_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 {
_defuseTime = _defuseTime * 1.5;
};
_defuseTime
};
_actionToPlay = "MedicOther";
if (STANCE _unit == "Prone") then {
_actionToPlay = "PutDown";
};
if (ACE_player != _unit) then {
// If the unit is a player, call the function on the player.
if (isPlayer _unit) then {
[[_unit, _target], QUOTE(FUNC(startDefuse)), _unit] call EFUNC(Core,execRemoteFnc);
} else {
// TODO: use scheduled delay execution
[_unit, _target, [[_unit] call EFUNC(Core,isEOD), _target] call _fnc_DefuseTime] spawn {
(_this select 0) playActionNow _actionToPlay;
(_this select 0) disableAI "MOVE";
(_this select 0) disableAI "TARGET";
sleep (_this select 2);
[(_this select 0), (_this select 1)] call Func(defuseExplosive);
(_this select 0) enableAI "MOVE";
(_this select 0) enableAI "TARGET";
};
};
} else {
_unit playActionNow _actionToPlay;
if (GVAR(RequireSpecialist)) then {
if ([_unit] call EFUNC(Core,isEOD)) then {
[[true, _target] call _fnc_DefuseTime, [_unit,_target],
QUOTE(FUNC(defuseExplosive)), localize "STR_ACE_Explosives_DefusingExplosive"] call EFUNC(Core,progressBar);
};
} else {
[[([_unit] call EFUNC(Core,isEOD)), _target] call _fnc_DefuseTime, [_unit,_target],
QUOTE(FUNC(defuseExplosive)), localize "STR_ACE_Explosives_DefusingExplosive"] call EFUNC(Core,progressBar);
};
};

View File

@ -1,29 +1,30 @@
/*
Name: AGM_Explosives_fnc_startTimer
Name: ACE_Explosives_fnc_startTimer
Author(s):
Garth de Wet (LH)
Description:
Starts a timer for an explosive.
Parameters:
0: OBJECT - Explosive
1: NUMBER - time till detonation
Returns:
Nothing
Example:
[_explosive, 10] call AGM_Explosives_fnc_startTimer;
[_explosive, 10] call ACE_Explosives_fnc_startTimer;
*/
_this spawn {
#include "script_component.hpp"
_this spawn { // TODO: use scheduled delay execution
private ["_explosive", "_timer"];
_explosive = _this select 0;
_timer = _this select 1;
sleep _timer;
if (!isNull _explosive) then {
[_explosive, -1, [_explosive, 0], true] call AGM_Explosives_fnc_DetonateExplosive;
[_explosive, -1, [_explosive, 0], true] call FUNC(detonateExplosive);
};
};

View File

@ -1,27 +1,28 @@
/*
Name: AGM_Explosives_fnc_TriggerType
Name: ACE_Explosives_fnc_TriggerType
Author(s):
Garth de Wet (LH)
Description:
Gets the types of triggers associated with the explosive
Parameters:
0: String - Explosive magazine
Returns:
ARRAY
Example:
_supports = ["SatchelCharge_Remote_Mag"] call AGM_Explosives_fnc_TriggerType;
_supports = ["SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_TriggerType;
*/
#include "script_component.hpp"
private "_result";
_result = [];
_config = getArray (ConfigFile >> "CfgMagazines" >> (_this select 0) >> "AGM_Triggers" >> "AGM_Triggers");
_config = getArray (ConfigFile >> "CfgMagazines" >> (_this select 0) >> "ACE_Triggers" >> "SupportedTriggers");
_count = count _config;
for "_index" from 0 to (_count - 1) do {
_result set [_index, ConfigFile >> "CfgAGM_Triggers" >> (_config select _index)];
_result set [_index, ConfigFile >> "CfgACE_Triggers" >> (_config select _index)];
};
_result

View File

@ -0,0 +1,12 @@
#define COMPONENT explosives
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_EXPLOSIVES
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_EXPLOSIVES
#define DEBUG_SETTINGS DEBUG_SETTINGS_EXPLOSIVES
#endif
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-16 -->
<Project name="AGM">
<Project name="ACE">
<Package name="Explosives">
<Key ID="STR_AGM_Explosives_Menu">
<Key ID="STR_ACE_Explosives_Menu">
<English>Explosives &gt;&gt;</English>
<German>Sprengstoffe &gt;&gt;</German>
<Spanish>Explosivos &gt;&gt;</Spanish>
@ -14,7 +14,7 @@
<Portuguese>Explosivos &gt;&gt;</Portuguese>
<Russian>Взрывчатка &gt;&gt;</Russian>
</Key>
<Key ID="STR_AGM_Explosives_Place">
<Key ID="STR_ACE_Explosives_Place">
<English>Place &gt;&gt;</English>
<German>Platzieren &gt;&gt;</German>
<Spanish>Colocar &gt;&gt;</Spanish>
@ -26,7 +26,7 @@
<Portuguese>Colocar &gt;&gt;</Portuguese>
<Russian>Установить &gt;&gt;</Russian>
</Key>
<Key ID="STR_AGM_Explosives_Detonate">
<Key ID="STR_ACE_Explosives_Detonate">
<English>Detonate &gt;&gt;</English>
<German>Zünden &gt;&gt;</German>
<Spanish>Detonar &gt;&gt;</Spanish>
@ -38,7 +38,7 @@
<Portuguese>Detonar &gt;&gt;</Portuguese>
<Russian>Подрыв &gt;&gt;</Russian>
</Key>
<Key ID="STR_AGM_Explosives_DetonateCode">
<Key ID="STR_ACE_Explosives_DetonateCode">
<English>Explosive code: %1</English>
<German>Sprengstoffcode: %1</German>
<Spanish>Código del explosivo: %1</Spanish>
@ -50,7 +50,7 @@
<Portuguese>Código do explosivo: %1</Portuguese>
<Russian>Взрывная код: %1</Russian>
</Key>
<Key ID="STR_AGM_Explosives_PlaceAction">
<Key ID="STR_ACE_Explosives_PlaceAction">
<English>Place</English>
<German>Platzieren</German>
<Spanish>Colocar</Spanish>
@ -62,7 +62,7 @@
<Portuguese>Colocar</Portuguese>
<Russian>Положить</Russian>
</Key>
<Key ID="STR_AGM_Explosives_CancelAction">
<Key ID="STR_ACE_Explosives_CancelAction">
<English>Cancel</English>
<German>Abbrechen</German>
<Spanish>Cancelar</Spanish>
@ -74,7 +74,7 @@
<Portuguese>Cancelar</Portuguese>
<Russian>Отмена</Russian>
</Key>
<Key ID="STR_AGM_Explosives_ScrollAction">
<Key ID="STR_ACE_Explosives_ScrollAction">
<English>+ Modifier, rotates</English>
<German>+ Modifikator, drehen</German>
<Spanish>+ Modificador, girar</Spanish>
@ -86,7 +86,7 @@
<Portuguese>+ Modificador, rotaciona</Portuguese>
<Russian>+ Bращать</Russian>
</Key>
<Key ID="STR_AGM_Explosives_Jammer_TurnOn">
<Key ID="STR_ACE_Explosives_Jammer_TurnOn">
<English>Turn On Thor III</English>
<German>Thor III aktivieren</German>
<Spanish>Encender Thor III</Spanish>
@ -98,7 +98,7 @@
<Portuguese>Ativar Thor III</Portuguese>
<Russian>Активировать Thor III</Russian>
</Key>
<Key ID="STR_AGM_Explosives_Jammer_TurnOff">
<Key ID="STR_ACE_Explosives_Jammer_TurnOff">
<English>Turn Off Thor III</English>
<German>Thor III deaktivieren</German>
<Spanish>Apagar Thor III</Spanish>
@ -110,7 +110,7 @@
<Portuguese>Desativar Thor III</Portuguese>
<Russian>Деактивировать Thor III</Russian>
</Key>
<Key ID="STR_AGM_Explosives_cellphone_displayName">
<Key ID="STR_ACE_Explosives_cellphone_displayName">
<English>Cellphone</English>
<German>Mobiltelefon</German>
<Spanish>Télefono móvil</Spanish>
@ -122,7 +122,7 @@
<Portuguese>Celular</Portuguese>
<Russian>Сотовый телефон</Russian>
</Key>
<Key ID="STR_AGM_Explosives_cellphone_description">
<Key ID="STR_ACE_Explosives_cellphone_description">
<English>Used to remotely trigger explosives</English>
<German>Wird benutzt um Sprengstoffe fernzuzünden</German>
<Spanish>Usado para detonar remotamente explosivos</Spanish>
@ -134,7 +134,7 @@
<Portuguese>Usado para acionar explosivos remotamente</Portuguese>
<Russian>Используется для удаленного запуска взрывчатку</Russian>
</Key>
<Key ID="STR_AGM_Explosives_clacker_displayName">
<Key ID="STR_ACE_Explosives_clacker_displayName">
<English>M57 Firing Device</English>
<German>M57 Zündvorrichtung</German>
<Spanish>Dispositivo de detonación M57</Spanish>
@ -146,7 +146,7 @@
<Portuguese>M57 Dispositivo de Detonação</Portuguese>
<Russian>Взрыватель M57</Russian>
</Key>
<Key ID="STR_AGM_Explosives_clacker_description">
<Key ID="STR_ACE_Explosives_clacker_description">
<English>Used to remotely trigger explosives</English>
<German>Wird benutzt um Sprengstoffe fernzuzünden</German>
<Spanish>Usado para detonar remotamente explosivos</Spanish>
@ -158,7 +158,7 @@
<Portuguese>Usado para acionar explosivos remotamente</Portuguese>
<Russian>Используется для удаленного запуска взрывчатку</Russian>
</Key>
<Key ID="STR_AGM_Explosives_M26_displayName">
<Key ID="STR_ACE_Explosives_M26_displayName">
<English>M26 Firing Device</English>
<German>M26 Zündvorrichtung</German>
<Spanish>Dispositivo de detonación MK26</Spanish>
@ -170,7 +170,7 @@
<Portuguese>M26 Dispositivo de Detonação</Portuguese>
<Russian>Взрыватель M26</Russian>
</Key>
<Key ID="STR_AGM_Explosives_MK16_displayName">
<Key ID="STR_ACE_Explosives_MK16_displayName">
<English>M152 RAMS</English>
<German>M152 RAMS</German>
<Czech>M152 RAMS</Czech>
@ -182,7 +182,7 @@
<Spanish>M152 RAMS</Spanish>
<Italian>M152 RAMS</Italian>
</Key>
<Key ID="STR_AGM_Explosives_DefusalKit_displayName">
<Key ID="STR_ACE_Explosives_DefusalKit_displayName">
<English>Defusal Kit</English>
<German>Entschärfungskit</German>
<Spanish>Kit de desactivación</Spanish>
@ -194,7 +194,7 @@
<Portuguese>Kit de desarme</Portuguese>
<Russian>Разминирование комплект</Russian>
</Key>
<Key ID="STR_AGM_Explosives_DefusalKit_description">
<Key ID="STR_ACE_Explosives_DefusalKit_description">
<English>Allows defusing of explosives</English>
<German>Erlaubt die Entschärfung von Sprengstoffen</German>
<Spanish>Permite desactivar explosivos</Spanish>
@ -206,7 +206,7 @@
<Portuguese>Permite o desarme de explosivos</Portuguese>
<Russian>Allows defusing of explosives</Russian>
</Key>
<Key ID="STR_AGM_Explosives_Phone_AddToSpeedDial">
<Key ID="STR_ACE_Explosives_Phone_AddToSpeedDial">
<English>Add to Speed Dial</English>
<German>Zur Schnellauswahl hinzufügen</German>
<Spanish>Agregar a marcado rápido</Spanish>
@ -218,7 +218,7 @@
<Portuguese>Adicionar à ligação rápida</Portuguese>
<Russian>Добавить в ускоренный набор</Russian>
</Key>
<Key ID="STR_AGM_Explosives_Clear">
<Key ID="STR_ACE_Explosives_Clear">
<English>Clear</English>
<German>Löschen</German>
<Spanish>Borrar</Spanish>
@ -230,7 +230,7 @@
<Portuguese>Limpar</Portuguese>
<Russian>Pассеиваться</Russian>
</Key>
<Key ID="STR_AGM_Explosives_Phone_Dial">
<Key ID="STR_ACE_Explosives_Phone_Dial">
<English>Dial</English>
<German>Wählen</German>
<Spanish>Marcar</Spanish>
@ -242,7 +242,7 @@
<Portuguese>Discar</Portuguese>
<Russian>Hабрать</Russian>
</Key>
<Key ID="STR_AGM_Explosives_Phone_Up">
<Key ID="STR_ACE_Explosives_Phone_Up">
<English>Up</English>
<German>Hoch</German>
<Spanish>Arriba</Spanish>
@ -254,7 +254,7 @@
<Portuguese>Cima</Portuguese>
<Russian>Поднять</Russian>
</Key>
<Key ID="STR_AGM_Explosives_Phone_Down">
<Key ID="STR_ACE_Explosives_Phone_Down">
<English>Down</English>
<German>Runter</German>
<Spanish>Abajo</Spanish>
@ -266,7 +266,7 @@
<Portuguese>Baixo</Portuguese>
<Russian>Опустить</Russian>
</Key>
<Key ID="STR_AGM_Explosives_Cancel">
<Key ID="STR_ACE_Explosives_Cancel">
<English>Cancel</English>
<German>Abbrechen</German>
<Spanish>Cancelar</Spanish>
@ -278,7 +278,7 @@
<Portuguese>Cancelar</Portuguese>
<Russian>Отмена</Russian>
</Key>
<Key ID="STR_AGM_Explosives_DetonateMenu">
<Key ID="STR_ACE_Explosives_DetonateMenu">
<English>Detonate Menu</English>
<German>&quot;Zünden&quot;-Menü</German>
<Spanish>Menú de detonación</Spanish>
@ -290,7 +290,7 @@
<Portuguese>Menu de detonação</Portuguese>
<Russian>Меню Подрыв</Russian>
</Key>
<Key ID="STR_AGM_Explosives_PlaceMenu">
<Key ID="STR_ACE_Explosives_PlaceMenu">
<English>Place Menu</English>
<German>&quot;Platzieren&quot;-Menü</German>
<Spanish>Menú de colocación</Spanish>
@ -302,7 +302,7 @@
<Portuguese>Menu de posicionamento</Portuguese>
<Russian>Меню Установить</Russian>
</Key>
<Key ID="STR_AGM_Explosives_Defuse">
<Key ID="STR_ACE_Explosives_Defuse">
<English>Defuse</English>
<German>Entschärfen</German>
<Spanish>Desactivar</Spanish>
@ -314,7 +314,7 @@
<Portuguese>Desarmar</Portuguese>
<Russian>Обезвредить</Russian>
</Key>
<Key ID="STR_AGM_Explosives_DefusingExplosive">
<Key ID="STR_ACE_Explosives_DefusingExplosive">
<English>Defusing Explosive...</English>
<German>Entschärfe Sprengstoff...</German>
<Spanish>Desactivando explosivo...</Spanish>
@ -326,7 +326,7 @@
<Portuguese>Desarmando Explosivo...</Portuguese>
<Russian>Обезвреживание...</Russian>
</Key>
<Key ID="STR_AGM_Explosives_timerName">
<Key ID="STR_ACE_Explosives_timerName">
<English>Timer</English>
<German>Zeitzünder</German>
<Spanish>Temporizador</Spanish>
@ -338,7 +338,7 @@
<Portuguese>Timer</Portuguese>
<Russian>Временной</Russian>
</Key>
<Key ID="STR_AGM_Explosives_TimerMenu">
<Key ID="STR_ACE_Explosives_TimerMenu">
<English>Time: %1m %2s</English>
<German>Zeit: %1m %2s</German>
<Spanish>Tiempo: %1m %2s</Spanish>
@ -350,7 +350,7 @@
<Portuguese>Tempo: %1m %2s</Portuguese>
<Russian>Tемп: %1m %2c</Russian>
</Key>
<Key ID="STR_AGM_Explosives_SetTime">
<Key ID="STR_ACE_Explosives_SetTime">
<English>Set Time</English>
<German>Zeit einstellen</German>
<Spanish>Configurar tiempo</Spanish>
@ -362,7 +362,7 @@
<Portuguese>Configurar Tempo</Portuguese>
<Russian>Xронометр</Russian>
</Key>
<Key ID="STR_AGM_Explosives_TriggerMenu">
<Key ID="STR_ACE_Explosives_TriggerMenu">
<English>Select a Trigger</English>
<German>Wähle einen Zünder</German>
<Spanish>Seleccionar un disparador</Spanish>
@ -374,7 +374,7 @@
<Portuguese>Selecionar um Gatilho</Portuguese>
<Russian>Выберите</Russian>
</Key>
<Key ID="STR_AGM_Explosives_SelectTrigger">
<Key ID="STR_ACE_Explosives_SelectTrigger">
<English>Select</English>
<German>Wählen</German>
<Spanish>Seleccionar</Spanish>
@ -386,7 +386,7 @@
<Portuguese>Selecionar</Portuguese>
<Russian>Выбрать защелка</Russian>
</Key>
<Key ID="STR_AGM_Explosives_PressurePlate">
<Key ID="STR_ACE_Explosives_PressurePlate">
<English>Pressure Plate</English>
<Polish>Płyta naciskowa</Polish>
<Spanish>Placa de presión</Spanish>
@ -398,7 +398,7 @@
<Portuguese>Placa de pressão</Portuguese>
<Russian>Давление</Russian>
</Key>
<Key ID="STR_AGM_Explosives_TripWire">
<Key ID="STR_ACE_Explosives_TripWire">
<English>Tripwire</English>
<Polish>Linka naciągu</Polish>
<Spanish>Cable trampa</Spanish>
@ -410,7 +410,7 @@
<Portuguese>Linha de tração</Portuguese>
<Russian>Натяжной</Russian>
</Key>
<Key ID="STR_AGM_Explosives_IRSensor">
<Key ID="STR_ACE_Explosives_IRSensor">
<English>IR Sensor</English>
<Polish>Czujnik podczerwieni</Polish>
<Spanish>Sensor IR</Spanish>
@ -422,7 +422,7 @@
<Portuguese>Sensor IV</Portuguese>
<Russian>ИК</Russian>
</Key>
<Key ID="STR_AGM_Explosives_NoTriggersAvailable">
<Key ID="STR_ACE_Explosives_NoTriggersAvailable">
<English>No triggers available for %1</English>
<Polish>Brak dostępnych zapalników dla %1</Polish>
<Spanish>No hay detonadores disponibles para %1</Spanish>
@ -434,7 +434,7 @@
<Portuguese>Nenhum gatilho disponível para %1</Portuguese>
<Russian>Нет защелка доступны для %1</Russian>
</Key>
<Key ID="STR_AGM_Explosives_SLAME_IRSensor">
<Key ID="STR_ACE_Explosives_SLAME_IRSensor">
<English>IR Sensor (Side Attack)</English>
<Polish>Czujnik podczerwieni (wybuch na bok)</Polish>
<Spanish>Sensor IR (ataque lateral)</Spanish>
@ -446,7 +446,7 @@
<Portuguese>Sensor infravermelho (ataque lateral)</Portuguese>
<Russian>ИК (боковая атака)</Russian>
</Key>
<Key ID="STR_AGM_Explosives_SLAME_Magnetic">
<Key ID="STR_ACE_Explosives_SLAME_Magnetic">
<English>Magnetic Influence Sensor (Bottom Attack)</English>
<Polish>Czujnik magnetyczny (wybuch w górę)</Polish>
<Spanish>Sensor IM (ataque inferior)</Spanish>
@ -458,7 +458,7 @@
<Portuguese>Influência magnética (ataque inferior)</Portuguese>
<Russian>Магнитный (дно атака)</Russian>
</Key>
<Key ID="STR_AGM_Explosives_NoExplosivesAvailable">
<Key ID="STR_ACE_Explosives_NoExplosivesAvailable">
<English>No explosives on trigger.</English>
<German>Keine Sprengladungen auf diesem Auslöser.</German>
<Spanish>Ningún explosivo en el detonador.</Spanish>
@ -470,7 +470,7 @@
<Portuguese>Nenhum explosivo no gatilho.</Portuguese>
<Russian>Нет взрывчатки на курок.</Russian>
</Key>
<Key ID="STR_AGM_Explosives_DeadManSwitch_displayName">
<Key ID="STR_ACE_Explosives_DeadManSwitch_displayName">
<English>Dead Man's Switch</English>
<German>Totmannschalter</German>
<French>Mise à feu par relâchement de pression</French>
@ -480,7 +480,7 @@
<Hungarian>Dead Man's Switch</Hungarian>
<Russian>Кнопка мертвеца</Russian>
</Key>
<Key ID="STR_AGM_Explosives_DeadManSwitch_description">
<Key ID="STR_ACE_Explosives_DeadManSwitch_description">
<English>Used to remotely trigger explosives when released.</English>
<German>Zündet Sprengladungen wenn losgelassen.</German>
<French>Déclenche la mise à feu d'un explosif lorsqu'il est libéré.</French>