Skip to content

Commit

Permalink
massCompat - Add custom HV 40x53mm HE and HEDP grenades (#585)
Browse files Browse the repository at this point in the history
* Adding HV 40mm HEDP round and updating drag on

* added hdep to massCompat

* added magazineWells to vehicle weapons and checking via attributeLoad

* Fixed missing space between colon and inheriting classname

* Update time to live and airfriction to better match max distance

* removed local function and used compatibleMagazines instead
  • Loading branch information
lambdatiger authored Nov 13, 2024
1 parent efb4bff commit ad546b0
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 3 deletions.
52 changes: 51 additions & 1 deletion addons/massCompat/CfgAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,54 @@ class CfgAmmo {
CREATE_LARGE_AMMO(50_bmg);
CREATE_LARGE_AMMO(127x108);
CREATE_LARGE_AMMO(127x108_slap);
};

// Updating 40x53mm HV grenades (Mk19)
class G_40mm_HE;
class AMMO(40x53mm_HE_M384): G_40mm_HE {
airFriction = -0.00045;
aiAmmoUsageFlags = "64 + 128";
displayNameshort = "M384 HE";
displayName = "M384 40x53mm HE";
ACEGVAR(frag,charge) = 54.5;
ACEGVAR(frag,metal) = 205;
ACEGVAR(frag,gurney_c) = 2769; // comp A-5
ACEGVAR(frag,fragCount) = 1050; // based on Rheinmetal comparison of new AB round
ACEGVAR(frag,classes)[] = {QACEGVAR(frag,tiny_HD), QACEGVAR(frag,small_HD), QACEGVAR(frag,small_HD)};
maxSpeed = 250;
typicalSpeed = 240;
timeToLive = 25;
};

class G_40mm_HEDP;
class AMMO(40x53mm_HEDP_M430A1): G_40mm_HEDP { // based on NDC M430A1 HEDP
airFriction = -0.00045;
aiAmmoUsageFlags = "64 + 128 + 512";
cost = 12;
displayNameshort = "M430A1 HEDP";
displayName = "M430A1 40x53mm HEDP";
ACEGVAR(frag,gurney_c) = 2769; // comp A-5
ACEGVAR(frag,fragCount) = 750; // based on Rheinmetal comparison of new AB round
ACEGVAR(frag,classes)[] = {QACEGVAR(frag,tiny_HD), QACEGVAR(frag,tiny_HD), QACEGVAR(frag,small_HD)};
// Damage
hit = 80; // reduce to match HEDP
maxSpeed = 250;
typicalSpeed = 241;
timeToLive = 25;
// Penetrator
deleteParentWhenTriggered = 0;
submunitionAmmo = QAMMO(40x53mm_HEDP_M430A1_penetrator);
submunitionDirectionType = "SubmunitionModelDirection";
submunitionInitialOffset[] = {0, 0, -0.2};
submunitionInitSpeed = 1000;
submunitionParentSpeedCoef = 0;
triggerOnImpact = 1;
};
class ammo_Penetrator_Base;
class AMMO(40x53mm_HEDP_M430A1_penetrator): ammo_Penetrator_Base {
hit = 80; // a guess
caliber = 5.067; // 76mm steel
submunitionAmmo = ""; // override RHS spalling
submunitionConeType[] = {};
timeToLive = 0.1;
};
};
8 changes: 8 additions & 0 deletions addons/massCompat/CfgMagazineWells.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,12 @@ class CfgMagazineWells {
MAGAZINE_WELL_MAG(65x39,20)
};
};
class MAGWELL(HV_40x53mm) {
MAGWELL(magzineWell)[] = {
QMAGAZINE_CLASS(96Rnd_40mm_MK19_M430A1_HEDP),
QMAGAZINE_CLASS(48Rnd_40mm_MK19_M430A1_HEDP),
QMAGAZINE_CLASS(96Rnd_40mm_MK19_M384_HE),
QMAGAZINE_CLASS(48Rnd_40mm_MK19_M384_HE)
};
};
};
23 changes: 23 additions & 0 deletions addons/massCompat/CfgMagazines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,27 @@ class CfgMagazines {

class 100Rnd_762x54_Box_Tracer_Red: potato_box_762x54_100rnd_tracer_Red { scope = 1; };
class 100Rnd_762x54_Box_Tracer_Yellow: potato_box_762x54_100rnd_tracer_Yellow { scope = 1; };

// HV 40x53mm grenade launcher
class 200Rnd_40mm_G_belt;
class MAGAZINE_CLASS(96Rnd_40mm_MK19_M430A1_HEDP): 200Rnd_40mm_G_belt {
ammo = QAMMO(40x53mm_HEDP_M430A1);
count = 96;
displayNameshort = "40x53mm HEDP";
displayName = "M430A1 40x53mm HEDP";
initSpeed = 241;
};
class MAGAZINE_CLASS(48Rnd_40mm_MK19_M430A1_HEDP): MAGAZINE_CLASS(96Rnd_40mm_MK19_M430A1_HEDP) {
count = 48;
};
class MAGAZINE_CLASS(96Rnd_40mm_MK19_M384_HE): 200Rnd_40mm_G_belt {
ammo = QAMMO(40x53mm_HE_M384);
count = 96;
displayNameshort = "40x53mm HE";
displayName = "M384 40x53mm HE";
initSpeed = 241;
};
class MAGAZINE_CLASS(48Rnd_40mm_MK19_M384_HE): MAGAZINE_CLASS(96Rnd_40mm_MK19_M384_HE) {
count = 48;
};
};
6 changes: 5 additions & 1 deletion addons/massCompat/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class CfgWeapons {
};

// Magazine Wells

class arifle_MSBS65_base_F: Rifle_Base_F {
magazineWell[] += { "CBA_65x39_MX" };
};
Expand Down Expand Up @@ -419,4 +419,8 @@ class CfgWeapons {
initSpeed = -1.0;
};

class GMG_F;
class GMG_40mm: GMG_F {
magazineWell[] += {QMAGWELL(HV_40x53mm)};
};
};
4 changes: 4 additions & 0 deletions addons/massCompat/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#define QAMMO_CLASS(type) QUOTE(AMMO_CLASS(type))
#define MAGAZINE_CLASS(type) SCORE_2(potato,type)
#define QMAGAZINE_CLASS(type) QUOTE(MAGAZINE_CLASS(type))
#define AMMO(var1) DOUBLES(PREFIX,var1)
#define QAMMO(var1) QUOTE(AMMO(var1))
#define MAGWELL(var1) DOUBLES(PREFIX,var1)
#define QMAGWELL(var1) QUOTE(MAGWELL(var1))

#define RELOAD_TRACER_REMAINING 4
#define MG_TRACER_EVERY 4
Expand Down
7 changes: 7 additions & 0 deletions addons/miscFixes/patchCUP/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class CfgRecoils {
};
};


class CfgWeapons {
class CUP_arifle_RPK74;
class potato_arifle_RPK: CUP_arifle_RPK74 {
Expand Down Expand Up @@ -138,6 +139,12 @@ class CfgWeapons {
class CUP_lmg_UK59: Rifle_Long_Base_F { // Tones down the horrific standing recoil to a more manageable state. Still stucks, but less now
recoil = QGVAR(recoil_uk59);
};

// 40mm HEDP
class CUP_Vhmg_AGS30_veh;
class CUP_Vgmg_MK19_veh: CUP_Vhmg_AGS30_veh {
magazineWell[] += {"potato_HV_40x53mm"};
};
};

class SlotInfo;
Expand Down
2 changes: 1 addition & 1 deletion addons/setVehicleAmmo/functions/fnc_attributeLoad.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ private _addWeaponSystem = {
{
private _weapon = _x;
private _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles");
private _weaponMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
private _weaponMagazines = compatibleMagazines _weapon;

((GVAR(turretMagsArray) select _index) select 1) pushBack _weaponMagazines;

Expand Down

0 comments on commit ad546b0

Please sign in to comment.