From 806ece8a3f266ff46602c4db10e08aa76ae4e721 Mon Sep 17 00:00:00 2001 From: Anton Simakov <67688115+GuardianDll@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:38:27 +0200 Subject: [PATCH] apply mag_jam_mult to helical and drum magazines --- data/json/items/gun/robofac_gun.json | 4 ++++ data/json/items/magazine/223.json | 6 ++++++ data/json/items/magazine/308.json | 3 +++ data/json/items/magazine/410shot.json | 1 + data/json/items/magazine/45.json | 1 + data/json/items/magazine/762.json | 1 + data/json/items/magazine/8x40mm.json | 2 ++ data/json/items/magazine/9mm.json | 10 ++++++++++ data/json/items/magazine/shot.json | 2 ++ data/mods/Aftershock/items/magazine/7.50mm.json | 1 + data/mods/Xedra_Evolved/items/gun_magazine.json | 2 ++ doc/GAME_BALANCE.md | 3 +++ doc/JSON_INFO.md | 2 +- 13 files changed, 37 insertions(+), 1 deletion(-) diff --git a/data/json/items/gun/robofac_gun.json b/data/json/items/gun/robofac_gun.json index b9569641bb0d7..cfbe9fd6a8959 100644 --- a/data/json/items/gun/robofac_gun.json +++ b/data/json/items/gun/robofac_gun.json @@ -464,6 +464,7 @@ "color": "light_gray", "ammo_type": [ "9mm" ], "reload_time": 160, + "mag_jam_mult": 3, "flags": [ "MAG_COMPACT" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "9mm": 60 } } ] }, @@ -510,6 +511,7 @@ "color": "dark_gray", "ammo_type": [ "shot" ], "reload_time": 130, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "shot": 30 } } ] }, @@ -547,6 +549,7 @@ "color": "light_gray", "ammo_type": [ "308" ], "flags": [ "MAG_BULKY" ], + "mag_jam_mult": 2, "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "308": 50 } } ] }, { @@ -565,6 +568,7 @@ "color": "light_gray", "ammo_type": [ "223" ], "flags": [ "MAG_BULKY" ], + "mag_jam_mult": 2, "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "223": 100 } } ] }, { diff --git a/data/json/items/magazine/223.json b/data/json/items/magazine/223.json index 2c84bf5bbde1a..131b893ffb63f 100644 --- a/data/json/items/magazine/223.json +++ b/data/json/items/magazine/223.json @@ -304,6 +304,7 @@ "color": "light_gray", "ammo_type": [ "223", "300blk" ], "reload_time": 200, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { @@ -358,6 +359,7 @@ "color": "light_gray", "ammo_type": [ "223", "300blk" ], "reload_time": 200, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { @@ -386,6 +388,7 @@ "color": "light_gray", "ammo_type": [ "223", "300blk" ], "reload_time": 200, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { @@ -440,6 +443,7 @@ "color": "light_gray", "ammo_type": [ "223", "300blk" ], "reload_time": 200, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { @@ -466,6 +470,7 @@ "color": "light_gray", "ammo_type": [ "223", "300blk" ], "reload_time": 200, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { @@ -535,6 +540,7 @@ "description": "A bulky 100-round double drum magazine for use with the Steyr AUG assault rifle.", "material": [ "steel", "plastic" ], "ammo_type": [ "223" ], + "mag_jam_mult": 2, "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "223": 100 } } ] }, { diff --git a/data/json/items/magazine/308.json b/data/json/items/magazine/308.json index 7fbf19b811a46..311af735a600d 100644 --- a/data/json/items/magazine/308.json +++ b/data/json/items/magazine/308.json @@ -101,6 +101,7 @@ "color": "light_gray", "ammo_type": [ "308" ], "reload_time": 160, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "308": 50 } } ] }, @@ -233,6 +234,7 @@ "color": "light_gray", "ammo_type": [ "308" ], "reload_time": 160, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "308": 50 } } ] }, @@ -394,6 +396,7 @@ "color": "light_gray", "ammo_type": [ "308" ], "capacity": 50, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "308": 50 } } ] }, diff --git a/data/json/items/magazine/410shot.json b/data/json/items/magazine/410shot.json index 78eb1a46892da..9f44ea673edd1 100644 --- a/data/json/items/magazine/410shot.json +++ b/data/json/items/magazine/410shot.json @@ -33,6 +33,7 @@ "color": "dark_gray", "ammo_type": [ "410shot" ], "reload_time": 130, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "410shot": 30 } } ] } diff --git a/data/json/items/magazine/45.json b/data/json/items/magazine/45.json index a4db584a53f3e..d20f2aeb3209f 100644 --- a/data/json/items/magazine/45.json +++ b/data/json/items/magazine/45.json @@ -101,6 +101,7 @@ "color": "light_gray", "ammo_type": [ "45" ], "reload_time": 150, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "45": 50 } } ] }, diff --git a/data/json/items/magazine/762.json b/data/json/items/magazine/762.json index 82b8a5a967a6b..8c150f7ad9ef1 100644 --- a/data/json/items/magazine/762.json +++ b/data/json/items/magazine/762.json @@ -111,6 +111,7 @@ "color": "light_gray", "ammo_type": [ "762" ], "flags": [ "MAG_BULKY" ], + "mag_jam_mult": 2, "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "762": 75 } } ] }, { diff --git a/data/json/items/magazine/8x40mm.json b/data/json/items/magazine/8x40mm.json index 7ee5e0e04fdaa..5ac8a6d68931d 100644 --- a/data/json/items/magazine/8x40mm.json +++ b/data/json/items/magazine/8x40mm.json @@ -74,6 +74,7 @@ "color": "dark_gray", "ammo_type": [ "8x40mm" ], "reload_time": 60, + "mag_jam_mult": 2, "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "8x40mm": 250 } } ] }, { @@ -124,6 +125,7 @@ "symbol": "#", "color": "dark_gray", "ammo_type": [ "8x40mm" ], + "mag_jam_mult": 2, "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "8x40mm": 500 } } ] }, { diff --git a/data/json/items/magazine/9mm.json b/data/json/items/magazine/9mm.json index a98e675a72001..a4abba130ac8d 100644 --- a/data/json/items/magazine/9mm.json +++ b/data/json/items/magazine/9mm.json @@ -16,6 +16,7 @@ "color": "light_gray", "ammo_type": [ "9mm" ], "reload_time": 160, + "mag_jam_mult": 3, "flags": [ "MAG_COMPACT" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "9mm": 50 } } ] }, @@ -35,6 +36,7 @@ "color": "light_gray", "ammo_type": [ "9mm" ], "reload_time": 160, + "mag_jam_mult": 3, "flags": [ "MAG_COMPACT" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "9mm": 100 } } ] }, @@ -128,6 +130,7 @@ "color": "light_gray", "ammo_type": [ "9mm" ], "flags": [ "MAG_BULKY" ], + "mag_jam_mult": 2, "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "9mm": 50 } } ] }, { @@ -145,6 +148,7 @@ "symbol": "#", "color": "light_gray", "ammo_type": [ "9mm" ], + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "9mm": 100 } } ] }, @@ -313,6 +317,7 @@ "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "9mm": 100 } } ], "ammo_type": [ "9mm" ], "reload_time": 160, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ] }, { @@ -331,6 +336,7 @@ "color": "light_gray", "ammo_type": [ "9mm" ], "reload_time": 160, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "9mm": 50 } } ] }, @@ -495,6 +501,7 @@ "color": "light_gray", "ammo_type": "9mm", "flags": [ "MAG_BULKY" ], + "mag_jam_mult": 2, "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "9mm": 32 } } ] }, { @@ -795,6 +802,7 @@ "color": "light_gray", "ammo_type": [ "9mm" ], "reload_time": 160, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "9mm": 72 } } ] }, @@ -994,6 +1002,7 @@ "color": "light_gray", "ammo_type": [ "9mm" ], "reload_time": 160, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "9mm": 100 } } ] }, @@ -1564,6 +1573,7 @@ "color": "light_gray", "ammo_type": [ "9mm" ], "reload_time": 160, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "9mm": 50 } } ] } diff --git a/data/json/items/magazine/shot.json b/data/json/items/magazine/shot.json index 5754ce81a1c6c..80637ec98d575 100644 --- a/data/json/items/magazine/shot.json +++ b/data/json/items/magazine/shot.json @@ -51,6 +51,7 @@ "color": "dark_gray", "ammo_type": [ "shot" ], "reload_time": 130, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "shot": 20 } } ] }, @@ -356,6 +357,7 @@ "ammo_type": [ "shot" ], "flags": [ "MAG_BULKY" ], "material": [ "lc_steel", "plastic" ], + "mag_jam_mult": 2, "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "shot": 20 } } ] } ] diff --git a/data/mods/Aftershock/items/magazine/7.50mm.json b/data/mods/Aftershock/items/magazine/7.50mm.json index 13e24717ef841..b17a89bc79608 100644 --- a/data/mods/Aftershock/items/magazine/7.50mm.json +++ b/data/mods/Aftershock/items/magazine/7.50mm.json @@ -31,6 +31,7 @@ "color": "light_gray", "ammo_type": [ "afs_7.50mm" ], "reload_time": 200, + "mag_jam_mult": 2, "flags": [ "MAG_BULKY" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "afs_7.50mm": 100 } } ] }, diff --git a/data/mods/Xedra_Evolved/items/gun_magazine.json b/data/mods/Xedra_Evolved/items/gun_magazine.json index e922503dcbf74..157b283778601 100644 --- a/data/mods/Xedra_Evolved/items/gun_magazine.json +++ b/data/mods/Xedra_Evolved/items/gun_magazine.json @@ -48,6 +48,7 @@ "color": "dark_gray", "ammo_type": [ "shot" ], "flags": [ "MAG_BULKY" ], + "mag_jam_mult": 2, "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "shot": 32 } } ] }, { @@ -65,6 +66,7 @@ "color": "dark_gray", "ammo_type": [ "shot" ], "flags": [ "MAG_BULKY" ], + "mag_jam_mult": 2, "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "shot": 64 } } ] } ] diff --git a/doc/GAME_BALANCE.md b/doc/GAME_BALANCE.md index e46c73be3f36d..a24689838a393 100644 --- a/doc/GAME_BALANCE.md +++ b/doc/GAME_BALANCE.md @@ -340,6 +340,9 @@ Increases proportional to capacity and should have a comparable ratio to similar ### Volume Scaled based upon the capacity relative to the `stack_size` of the ammo. For example 223 has a `stack size` of 20 so for 10 and 30 round magazines the volume would be 1 and 2. Extended magazine should always have larger volume than the standard type and for very large drum magazines consider applying an extra penalty. By default most handgun magazines should be volume 1 and most rifle magazines volume 2. Ammo belts should not specify volume as this will be determined from their length. +### Jam multiplier +`mag_jam_mult` field is used to determine how much the magazine is affected by being damaged. Default rate is described in Character::handle_gun_damage(); at this moment it is roughly: 0.000288% for undamaged magazine, 5% for 1 damage (|\), 24% for 2 damage (|.), 96% for 3 damage (\.), and 250% for 4 damage (XX), then this and gun values are summed up and multiplied by 1.8. Rule of thumb: helical mags should have 3, drum mags should have 2, the rest can be tweaked case by case, but mostly doesn't worth emulating it + ### Rarity Overall balance is that pistol magazines are twice as common as rifle magazines and that for guns that spawn with magazines these are always the standard capacity versions. Consider 9x19mm and .223 to be the defaults with everything else more rare. Some locations have more specific balance requirements: diff --git a/doc/JSON_INFO.md b/doc/JSON_INFO.md index 527f9dd943223..8d6cf44b45f91 100644 --- a/doc/JSON_INFO.md +++ b/doc/JSON_INFO.md @@ -3608,7 +3608,7 @@ ammo_effects define what effect the projectile, that you shoot, would have. List "count" : 0, // Default amount of ammo contained by a magazine (set this for ammo belts) "default_ammo": "556", // If specified override the default ammo (optionally set this for ammo belts) "reload_time" : 100, // How long it takes to load each unit of ammo into the magazine -"mag_jam_mult": 1.25 // Multiplier for gun mechanincal malfunctioning from magazine, mostly when it's damaged; Values lesser than 1 reflect better quality of the magazine, that jam less; bigger than 1 result in gun being more prone to malfunction and jam at lesser damage level; zero mag_jam_mult (and zero gun_jam_mult in a gun) would remove any chance for a gun to malfunction. Only works if gun has any fault from gun_mechanical_simple group presented; Jam chances are described in Character::handle_gun_damage(); at this moment it is roughly: 0.000288% for undamaged magazine, 5% for 1 damage (|\), 24% for 2 damage (|.), 96% for 3 damage (\.), and 250% for 4 damage (XX), then this and gun values are summed up and multiplied by 1.8. +"mag_jam_mult": 1.25 // Multiplier for gun mechanincal malfunctioning from magazine, mostly when it's damaged; Values lesser than 1 reflect better quality of the magazine, that jam less; bigger than 1 result in gun being more prone to malfunction and jam at lesser damage level; zero mag_jam_mult (and zero gun_jam_mult in a gun) would remove any chance for a gun to malfunction. Only works if gun has any fault from gun_mechanical_simple group presented; Jam chances are described in Character::handle_gun_damage(); at this moment it is roughly: 0.000288% for undamaged magazine, 5% for 1 damage (|\), 24% for 2 damage (|.), 96% for 3 damage (\.), and 250% for 4 damage (XX), then this and gun values are summed up and multiplied by 1.8. Rule of thumb: helical mags should have 3, drum mags should have 2, the rest can be tweaked case by case, but mostly doesn't worth emulating it "linkage" : "ammolink" // If set one linkage (of given type) is dropped for each unit of ammo consumed (set for disintegrating ammo belts) ```