Skip to content

Explosives - Minor refactor #10805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions addons/explosives/CfgAmmo.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
class CfgAmmo {
// All explosive based Ammo classes. These are all listed in case they become required.

// GVAR(defuseTime) is the defuse time (default of 5 in ACE_Explosives_fnc_StartDefuse)
// GVAR(defuseTime) is the defuse time (default of 5 in ace_explosives_fnc_startDefuse)
// GVAR(size) = 0; is small size
// GVAR(size) = 1; is large size
class ClaymoreDirectionalMine_Remote_Ammo;
Expand Down Expand Up @@ -67,7 +65,7 @@ class CfgAmmo {
GVAR(size) = 0;
};

// More sensitive pressure-fuze for the Vanilla AT Mine.
// More sensitive pressure-fuse for the Vanilla AT Mine
class MineBase;
class ATMine_Range_Ammo: MineBase {
mineTrigger = "ACE_TankTriggerLight";
Expand Down Expand Up @@ -127,8 +125,8 @@ class CfgAmmo {
GVAR(magazine) = "IEDUrbanBig_Remote_Mag";
GVAR(size) = 1;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
GVAR(ringtones)[] = {{QPATHTOF(Data\Audio\Cellphone_Ring.wss), 0.75, 3.16228, 1, 75}};
GVAR(callConnectTime)[] = {1,8};
GVAR(ringtones)[] = {{QPATHTOF(Data\Audio\Cellphone_Ring.wss), 0.75, 3.15, 1, 75}};
GVAR(callConnectTime)[] = {1, 8};
GVAR(detonationTimingOffset) = 0.75;
};
class ACE_IEDUrbanBig_Command_Ammo: IEDUrbanBig_Remote_Ammo {
Expand All @@ -144,8 +142,8 @@ class CfgAmmo {
GVAR(magazine) = "IEDUrbanSmall_Remote_Mag";
GVAR(size) = 0;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
GVAR(ringtones)[] = {{QPATHTOF(Data\Audio\Cellphone_Ring.wss), 0.75, 3.16228, 1, 75}};
GVAR(callConnectTime)[] = {1,8};
GVAR(ringtones)[] = {{QPATHTOF(Data\Audio\Cellphone_Ring.wss), 0.75, 3.15, 1, 75}};
GVAR(callConnectTime)[] = {1, 8};
GVAR(detonationTimingOffset) = 0.75;
};
class ACE_IEDUrbanSmall_Command_Ammo: IEDUrbanSmall_Remote_Ammo {
Expand All @@ -161,8 +159,8 @@ class CfgAmmo {
GVAR(magazine) = "IEDLandBig_Remote_Mag";
GVAR(size) = 1;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
GVAR(ringtones)[] = {{QPATHTOF(Data\Audio\Cellphone_Ring.wss), 0.75, 3.16228, 1, 75}};
GVAR(callConnectTime)[] = {1,8};
GVAR(ringtones)[] = {{QPATHTOF(Data\Audio\Cellphone_Ring.wss), 0.75, 3.15, 1, 75}};
GVAR(callConnectTime)[] = {1, 8};
GVAR(detonationTimingOffset) = 0.75;
};
class ACE_IEDLandBig_Command_Ammo: IEDLandBig_Remote_Ammo {
Expand All @@ -178,8 +176,8 @@ class CfgAmmo {
GVAR(magazine) = "IEDLandSmall_Remote_Mag";
GVAR(size) = 0;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
GVAR(ringtones)[] = {{QPATHTOF(Data\Audio\Cellphone_Ring.wss), 0.75, 3.16228, 1, 75}};
GVAR(callConnectTime)[] = {1,8};
GVAR(ringtones)[] = {{QPATHTOF(Data\Audio\Cellphone_Ring.wss), 0.75, 3.15, 1, 75}};
GVAR(callConnectTime)[] = {1, 8};
GVAR(detonationTimingOffset) = 0.75;
};
class ACE_IEDLandSmall_Command_Ammo: IEDLandSmall_Remote_Ammo {
Expand Down
6 changes: 3 additions & 3 deletions addons/explosives/CfgMagazines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class CfgMagazines {
class ATMine_Range_Mag: CA_Magazine {
useAction = 0;
GVAR(placeable) = 1;
GVAR(setupObject) = "ACE_Explosives_Place_ATMine"; // CfgVehicle class for setup object
GVAR(setupObject) = "ACE_Explosives_Place_ATMine"; // CfgVehicles class for setup object
class ACE_Triggers {
SupportedTriggers[] = {"PressurePlate"};
class PressurePlate {
Expand Down Expand Up @@ -140,7 +140,7 @@ class CfgMagazines {
};
class IEDLandBig_Remote_Mag: IEDUrbanBig_Remote_Mag {
GVAR(setupObject) = "ACE_Explosives_Place_IEDLandBig";
picture = "\A3\Weapons_F\Data\UI\gear_mine_AT_CA.paa"; // Fix inconsistent picture
picture = "\A3\Weapons_F\Data\UI\gear_mine_AT_CA.paa"; // Fix inconsistent picture
class ACE_Triggers: ACE_Triggers {
class Command: Command {
ammo = "ACE_IEDLandBig_Command_Ammo";
Expand All @@ -154,7 +154,7 @@ class CfgMagazines {
};
class IEDUrbanSmall_Remote_Mag: DemoCharge_Remote_Mag {
GVAR(setupObject) = "ACE_Explosives_Place_IEDUrbanSmall";
picture = "\A3\Weapons_F\Data\UI\gear_mine_AP_bouncing_CA.paa"; // Fix inconsistent picture
picture = "\A3\Weapons_F\Data\UI\gear_mine_AP_bouncing_CA.paa"; // Fix inconsistent picture
class ACE_Triggers {
SupportedTriggers[] = {"Command", "DeadmanSwitch", "Cellphone", "PressurePlate"};
class Command {
Expand Down
12 changes: 6 additions & 6 deletions addons/explosives/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ class CfgVehicles {

#include "CfgModule.hpp"

// Add ACE_Clacker and ACE_DefusalKit to every explosive unit.
// 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"};
items[] += {"ACE_Clacker","ACE_DefusalKit"}; \
respawnitems[] += {"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};
Expand Down Expand Up @@ -336,10 +336,10 @@ class CfgVehicles {
class O_V_Soldier_base_F; class O_V_Soldier_Exp_hex_F: O_V_Soldier_base_F {MACRO_ADDMINEKIT};
class O_V_Soldier_Exp_ghex_F: O_V_Soldier_Exp_hex_F {MACRO_ADDMINEKIT};

// Add ACE_Clacker to snipers and spotters for setting off Claymores
// Add ACE_Clacker to snipers and spotters for setting off claymores
#define MACRO_ADDCLAYMOREKIT \
items[] = {"FirstAidKit","ACE_Clacker"}; \
respawnitems[] = {"FirstAidKit","ACE_Clacker"};
items[] += {"ACE_Clacker"}; \
respawnitems[] += {"ACE_Clacker"};

class B_Soldier_sniper_base_F;
class B_sniper_F: B_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT};
Expand Down
28 changes: 14 additions & 14 deletions addons/explosives/ExplosivesUI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.0309375 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = "1";
action = "ctrlSetText [1400,((ctrlText 1400) + '1')];";
action = "ctrlSetText [1400, (ctrlText 1400) + '1'];";
};
class numkey_2: Rsc_ACE_NumKeyButton {
idc = 1601;
Expand All @@ -61,7 +61,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.0309375 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = "2";
action = "ctrlSetText [1400,((ctrlText 1400) + '2')];";
action = "ctrlSetText [1400, (ctrlText 1400) + '2'];";
};
class numkey_3: Rsc_ACE_NumKeyButton {
idc = 1602;
Expand All @@ -70,7 +70,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.0309375 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = "3";
action = "ctrlSetText [1400,((ctrlText 1400) + '3')];";
action = "ctrlSetText [1400, (ctrlText 1400) + '3'];";
};
class numkey_4: Rsc_ACE_NumKeyButton {
idc = 1603;
Expand All @@ -79,7 +79,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.0309375 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = "4";
action = "ctrlSetText [1400,((ctrlText 1400) + '4')];";
action = "ctrlSetText [1400, (ctrlText 1400) + '4'];";
};
class numkey_5: Rsc_ACE_NumKeyButton {
idc = 1604;
Expand All @@ -88,7 +88,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.0309375 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = "5";
action = "ctrlSetText [1400,((ctrlText 1400) + '5')];";
action = "ctrlSetText [1400, (ctrlText 1400) + '5'];";
};
class numkey_6: Rsc_ACE_NumKeyButton {
idc = 1605;
Expand All @@ -97,7 +97,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.0309375 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = "6";
action = "ctrlSetText [1400,((ctrlText 1400) + '6')];";
action = "ctrlSetText [1400, (ctrlText 1400) + '6'];";
};
class numkey_7: Rsc_ACE_NumKeyButton {
idc = 1606;
Expand All @@ -106,7 +106,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.0309375 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = "7";
action = "ctrlSetText [1400,((ctrlText 1400) + '7')];";
action = "ctrlSetText [1400, (ctrlText 1400) + '7'];";
};
class numkey_8: Rsc_ACE_NumKeyButton {
idc = 1607;
Expand All @@ -115,7 +115,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.0309375 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = "8";
action = "ctrlSetText [1400,((ctrlText 1400) + '8')];";
action = "ctrlSetText [1400, (ctrlText 1400) + '8'];";
};
class numkey_9: Rsc_ACE_NumKeyButton {
idc = 1608;
Expand All @@ -124,7 +124,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.0309375 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = "9";
action = "ctrlSetText [1400,((ctrlText 1400) + '9')];";
action = "ctrlSetText [1400, (ctrlText 1400) + '9'];";
};
class numkey_0: Rsc_ACE_NumKeyButton {
idc = 1609;
Expand All @@ -133,7 +133,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.0309375 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = "0";
action = "ctrlSetText [1400,((ctrlText 1400) + '0')];";
action = "ctrlSetText [1400, (ctrlText 1400) + '0'];";
};
class speedDialAdd: Rsc_ACE_NumKeyButton {
idc = 1610;
Expand All @@ -151,7 +151,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.020625 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = CSTRING(Clear);
action = QUOTE(ctrlSetText [ARR_2(1400,'')];[ctrlText 1401] call FUNC(removeFromSpeedDial);ctrlSetText [ARR_2(1401,'')];);
action = QUOTE(ctrlSetText [ARR_2(1400,'')]; (ctrlText 1401) call FUNC(removeFromSpeedDial); ctrlSetText [ARR_2(1401,'')];);
};
class dial: Rsc_ACE_HiddenButton {
idc = 1611;
Expand All @@ -160,7 +160,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.04125 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = CSTRING(Phone_Dial);
action = QUOTE([ARR_2(ace_player,ctrlText 1400)] call FUNC(dialPhone));
action = QUOTE([ARR_2(ACE_player,ctrlText 1400)] call FUNC(dialPhone));
};
class up: Rsc_ACE_HiddenButton {
idc = 1612;
Expand All @@ -169,7 +169,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.020625 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = CSTRING(Phone_Up);
action = QUOTE([true] call FUNC(setSpeedDial));
action = QUOTE(true call FUNC(setSpeedDial));
};
class down: Rsc_ACE_HiddenButton {
idc = 1613;
Expand All @@ -178,7 +178,7 @@ class Rsc_ACE_PhoneInterface {
w = "0.020625 * safeZoneW";
h = "0.033 * safeZoneH";
tooltip = CSTRING(Phone_Down);
action = QUOTE([false] call FUNC(setSpeedDial));
action = QUOTE(false call FUNC(setSpeedDial));
};
class speedDial_Text: RscText {
idc = 1405;
Expand Down
2 changes: 1 addition & 1 deletion addons/explosives/GUI_VirtualAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class RscTitles {
class TheObject {
idc = 800851;
type = 82;
model = "\a3\weapons_f\Ammo\Handgrenade.p3d"; //dummy value, cannot be "" !!!
model = "\a3\weapons_f\Ammo\Handgrenade.p3d"; // dummy value, cannot be "" !!!
scale = 1;
direction[] = {0, 0, 1};
up[] = {0, 1, 0};
Expand Down
19 changes: 9 additions & 10 deletions addons/explosives/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,25 @@ PREP(addExplosiveActions);
PREP(addToSpeedDial);
PREP(addTransmitterActions);
PREP(addTriggerActions);
PREP(allowDefuse);
PREP(cancelPlacement);
PREP(canDefuse);
PREP(canDetonate);
PREP(checkDetonateHandlers);
PREP(connectExplosive);
PREP(cycleActiveTrigger);
PREP(defuseExplosive);
PREP(detonateExplosive);
PREP(detonateExplosiveAll);
PREP(dialPhone);
PREP(dialingPhone);
PREP(dialPhone);
PREP(getDetonators);
PREP(getPlacedExplosives);
PREP(getSpeedDialExplosive);
PREP(handleScrollWheel);
PREP(hasExplosives);
PREP(hasPlacedExplosives);
PREP(interactEH);
PREP(getDetonators);
PREP(getPlacedExplosives);
PREP(getSpeedDialExplosive);
PREP(isAllowedDefuse);
PREP(module);
PREP(onIncapacitated);
PREP(onInventoryChanged);
Expand All @@ -31,14 +33,11 @@ PREP(placeExplosive);
PREP(removeFromSpeedDial);
PREP(scriptedExplosive);
PREP(selectTrigger);
PREP(setupExplosive);
PREP(setPosition);
PREP(setSpeedDial);
PREP(setupExplosive);
PREP(startDefuse);
PREP(startTimer);
PREP(triggerType);
PREP(allowDefuse);
PREP(isAllowedDefuse);
PREP(checkDetonateHandlers);
PREP(woundsHandlerToePopper);
PREP(tripflare_init);
PREP(woundsHandlerToePopper);
Loading