From 8d0e70ad2f1c272984aa577892895bfcbe145b2c Mon Sep 17 00:00:00 2001 From: Fabio Schick <58027418+mrschick@users.noreply.github.com> Date: Mon, 30 Sep 2024 11:34:25 +0200 Subject: [PATCH] Explosives - Improve AT/SLAM, Frag from Claymore and Bounding Mines (#10105) * Reduce AT Mine Trigger Mass from 7t to 300kg So that it triggers on lighter vehicles, including Wiesel Tankettes. https://en.wikipedia.org/wiki/M15_mine#Specifications * Improve M4 SLAM mine damage towards vehicles * WIP add Claymore Mine Frag and reduce Structure Damage * Fix duplicate class definition * Improve SLAM Bottom-Attack Damage * Reduce APERS+Bounding Mine Damage and add Frag * Reduce Claymore Damage * Orient Editor/Zeus-placed SLAMs pointing upwards * ACE Copies of Ex Ammo with modified Damage * Suggested Comment Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/explosives/CfgAmmo.hpp | 36 +++++++++++++++++++++----- addons/explosives/CfgEventHandlers.hpp | 5 ++++ addons/explosives/CfgMagazines.hpp | 2 +- addons/explosives/CfgVehicles.hpp | 13 +++++++++- addons/explosives/XEH_postInit.sqf | 8 ++++++ addons/explosives/config.cpp | 14 +++++++--- addons/explosives/script_component.hpp | 2 ++ addons/frag/CfgAmmoFragParameters.hpp | 13 +++++++--- 8 files changed, 77 insertions(+), 16 deletions(-) diff --git a/addons/explosives/CfgAmmo.hpp b/addons/explosives/CfgAmmo.hpp index cee1cf99c33..bfe48d8fa9e 100644 --- a/addons/explosives/CfgAmmo.hpp +++ b/addons/explosives/CfgAmmo.hpp @@ -8,20 +8,33 @@ class CfgAmmo { // GVAR(size) = 0; is small size // GVAR(size) = 1; is large size - class DirectionalBombBase; - class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase { + class ClaymoreDirectionalMine_Remote_Ammo; + class ACE_ClaymoreDirectionalMine_Remote_Ammo: ClaymoreDirectionalMine_Remote_Ammo { // Wrapper class to avoid unintentional changes to third-party mods. Ref #10105 GVAR(magazine) = "ClaymoreDirectionalMine_Remote_Mag"; GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0, 0, 0.038}; soundActivation[] = {"", 0, 0, 0}; soundDeactivation[] = {"", 0, 0, 0}; + + // Reduce vanilla damage, so that it doesn't destroy buildings + hit = 10; + indirectHit = 10; }; + class DirectionalBombBase; class APERSTripMine_Wire_Ammo: DirectionalBombBase { GVAR(defuseObjectPosition)[] = {-1.415, 0, 0.12}; GVAR(size) = 0; }; + class APERSBoundingMine_Range_Ammo; + class ACE_APERSBoundingMine_Range_Ammo: APERSBoundingMine_Range_Ammo { + // Reduce vanilla damage, so that it doesn't destroy buildings + hit = 10; + indirectHit = 10; + CraterEffects = "MineCrater"; + }; + class ACE_FlareTripMine_Wire_Ammo: APERSTripMine_Wire_Ammo { SoundSetExplosion[] = {}; defaultMagazine = "ACE_FlareTripMine_Mag"; // Mag that gets dropped after defuse @@ -46,9 +59,16 @@ class CfgAmmo { GVAR(size) = 0; }; + // More sensitive pressure-fuze for the Vanilla AT Mine. + class MineBase; + class ATMine_Range_Ammo: MineBase { + mineTrigger = "ACE_TankTriggerLight"; + }; + // "The SLAM has an anti-tamper feature that is only active in the bottom- and side-attack modes." class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase { indirectHitRange = 20; + explosionAngle = 60; GVAR(explodeOnDefuseChance) = 1; GVAR(magazine) = "SLAMDirectionalMine_Wire_Mag"; GVAR(size) = 0; @@ -64,14 +84,16 @@ class CfgAmmo { class ACE_SLAMDirectionalMine_Magnetic_Ammo: SLAMDirectionalMine_Wire_Ammo { mineTrigger = "ACE_MagneticTrigger"; GVAR(explodeOnDefuseChance) = 1; - explosionAngle = 360; - indirectHitRange = 1; + explosionAngle = 60; + hit = 3000; + indirectHit = 3000; + indirectHitRange = 10; mineInconspicuousness = 25; icon = "iconExplosiveGP"; }; - class PipeBombBase; - class DemoCharge_Remote_Ammo: PipeBombBase { + class DemoCharge_Remote_Ammo; + class ACE_DemoCharge_Remote_Ammo: DemoCharge_Remote_Ammo { GVAR(magazine) = "DemoCharge_Remote_Mag"; GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0.07, 0, 0.055}; @@ -81,6 +103,7 @@ class CfgAmmo { indirectHit = 500; indirectHitRange = 7; }; + class PipeBombBase; class SatchelCharge_Remote_Ammo: PipeBombBase { GVAR(magazine) = "SatchelCharge_Remote_Mag"; GVAR(size) = 0; @@ -157,7 +180,6 @@ class CfgAmmo { GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0, 0, 0.15}; }; - class MineBase; class UnderwaterMine_Range_Ammo: MineBase { GVAR(size) = 1; }; diff --git a/addons/explosives/CfgEventHandlers.hpp b/addons/explosives/CfgEventHandlers.hpp index 3b9e7077284..fe3119a580b 100644 --- a/addons/explosives/CfgEventHandlers.hpp +++ b/addons/explosives/CfgEventHandlers.hpp @@ -44,4 +44,9 @@ class Extended_Init_EventHandlers { class ACE_Explosives_Place_SLAM { ADDON = QUOTE(params ['_mine']; if (local _mine) then {_mine setCenterOfMass [ARR_3(0,-0.035,0.05)]; _mine setMass 5}); }; + class ACE_ModuleMine_SLAMBottomMine { + class ADDON { + init = QUOTE(params ['_mine']; if (local _mine) then { [ARR_2({_this call CALLSTACK(BIS_fnc_setPitchBank)},[ARR_3(_mine,MINE_PITCH_UP,0)])] call CBA_fnc_execNextFrame }); + }; + }; }; diff --git a/addons/explosives/CfgMagazines.hpp b/addons/explosives/CfgMagazines.hpp index 89591f2bd69..71e374be1d5 100644 --- a/addons/explosives/CfgMagazines.hpp +++ b/addons/explosives/CfgMagazines.hpp @@ -87,7 +87,7 @@ class CfgMagazines { displayName = CSTRING(SLAME_Magnetic); digDistance = 0; ammo = "ACE_SLAMDirectionalMine_Magnetic_Ammo"; - pitch = 90; + pitch = MINE_PITCH_UP; }; class IRSensor { displayName = CSTRING(SLAME_IRSensor); diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index 0a67a9a608d..bf3eb1b12bd 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -364,7 +364,6 @@ class CfgVehicles { author = ECSTRING(common,aceteam); ammo = "ACE_SLAMDirectionalMine_Magnetic_Ammo"; displayName = CSTRING(Module_SLAMBottomAttack_DisplayName); - // TODO: Find a way to place the mine laying down instead of standing up }; class APERSTripMine: MineBase {}; @@ -374,6 +373,18 @@ class CfgVehicles { displayName = CSTRING(TripFlare_Name); }; + class Claymore_F: MineBase { + ammo = "ACE_ClaymoreDirectionalMine_Remote_Ammo"; + }; + + class APERSBoundingMine: MineBase { + ammo = "ACE_APERSBoundingMine_Range_Ammo"; + }; + + class DemoCharge_F: MineBase { + ammo = "ACE_DemoCharge_Remote_Ammo"; + }; + class IEDUrbanBig_F; class ACE_IEDUrbanBig_Range: IEDUrbanBig_F { author = ECSTRING(common,aceteam); diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index f47dbbe5bd2..93b194e1e93 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -53,6 +53,14 @@ if (isServer) then { TRACE_1("Knocked Out, Doing Deadman",_unit); [_unit] call FUNC(onIncapacitated); }] call CBA_fnc_addEventHandler; + + // Orient all Editor-placed SLAM (Bottom attack) mines facing upward + { + private _mine = _x; + if (typeOf _mine == "ACE_SLAMDirectionalMine_Magnetic_Ammo") then { + [_mine, MINE_PITCH_UP, 0] call CALLSTACK(BIS_fnc_setPitchBank); + }; + } forEach allMines; }; if (!hasInterface) exitWith {}; diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index db2e48fa8da..00909533ac9 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -54,9 +54,15 @@ class CfgActions { }; class CfgMineTriggers { - class RangeTrigger; - class ACE_MagneticTrigger: RangeTrigger { - mineMagnetic = 1; - mineTriggerRange = 1; + class IRTrigger; + class ACE_MagneticTrigger: IRTrigger { + mineWireEnd[] = {0,0.1,0.5}; + }; + + class TankTriggerMagnetic; + class ACE_TankTriggerLight: TankTriggerMagnetic { + // Reduce mass needed to trigger vanilla AT Mine to realistic levels (https://en.wikipedia.org/wiki/M15_mine#Specifications). + // Will now trigger for any vehicle heavier than the Vanilla ATV (280kg) + mineTriggerMass = 300; // Default: 7000 }; }; diff --git a/addons/explosives/script_component.hpp b/addons/explosives/script_component.hpp index 77ca89d32e5..de27ff45c03 100644 --- a/addons/explosives/script_component.hpp +++ b/addons/explosives/script_component.hpp @@ -34,3 +34,5 @@ #define PLACE_WAITING -1 #define PLACE_CANCEL 0 #define PLACE_APPROVE 1 + +#define MINE_PITCH_UP 90 diff --git a/addons/frag/CfgAmmoFragParameters.hpp b/addons/frag/CfgAmmoFragParameters.hpp index f76231e85c1..588032673d2 100644 --- a/addons/frag/CfgAmmoFragParameters.hpp +++ b/addons/frag/CfgAmmoFragParameters.hpp @@ -242,7 +242,7 @@ class ATMine_Range_Ammo: MineBase { class APERSMine_Range_Ammo: MineBase { // VS-50 GVAR(skip) = 0; - GVAR(force) = 0; + GVAR(force) = 1; GVAR(classes)[] = {QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(small_HD)}; GVAR(metal) = 100; GVAR(charge) = 50; @@ -251,7 +251,7 @@ class APERSMine_Range_Ammo: MineBase { // VS-50 }; class APERSBoundingMine_Range_Ammo: BoundingMineBase { - GVAR(skip) = 1; + GVAR(skip) = 0; GVAR(force) = 0; GVAR(classes)[] = {QGVAR(tiny_HD)}; GVAR(metal) = 80; @@ -336,7 +336,14 @@ class APERSMineDispenser_Mine_Ammo: APERSMine_Range_Ammo { class UXO_deploy_base_f: SubmunitionBase {}; class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase { - GVAR(skip) = 1; + GVAR(skip) = 0; + GVAR(force) = 0; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(small)}; + GVAR(fragCount) = 700; + GVAR(metal) = 700; + GVAR(charge) = 680; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "3/5"; }; class SatchelCharge_Remote_Ammo: PipeBombBase {