summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjc_gargma <jc_gargma@iserlohn-fortress.net>2023-11-22 13:46:37 -0800
committerjc_gargma <jc_gargma@iserlohn-fortress.net>2023-11-22 13:46:37 -0800
commit4305251a12a8a601c1677396ed69b1194b0f2b7d (patch)
tree60e330ddb0783ac3cc079a9fadbfce59958cab25
parentFix invalid itemgroup for island prison. (diff)
downloadcataclysm-bn-4305251a12a8a601c1677396ed69b1194b0f2b7d.tar.xz
Backport fam fixes and more power armor changes.
-rw-r--r--PKGBUILD17
-rw-r--r--backport-03-2_fix-bugfixes-Fix-light-and-helmet-power-helms-having.patch36
-rw-r--r--backport-03-3_feat-balance-HEAVY_WEAPON_SUPPORT-flag-for-large-mut.patch283
-rw-r--r--backport-04_fix-farm-mapgen-3715.patch78
4 files changed, 411 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 5db9af2..b2d8b7e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,7 +20,7 @@ _pkgname=Cataclysm-BN-cbn
pkgver=0.4
#pkgver=202310040030
#_pkgver=2023-10-04-0030
-pkgrel=7
+pkgrel=9
pkgdesc="A post-apocalyptic roguelike."
#url="http://cataclysmrl.blogspot.com/"
#url="http://www.cataclysm.glyphgryph.com/"
@@ -40,6 +40,9 @@ source=("$pkgname-$pkgver.tar.gz::https://github.com/cataclysmbnteam/Cataclysm-B
"backport-01_fix-content-NON_FOULING-flag-not-working-due-to-typo.patch"
"backport-02_fix-mass_grave-map-extras-3680.patch"
"backport-03_feat-balance-power-armor-updates-3625.patch"
+ "backport-03-2_fix-bugfixes-Fix-light-and-helmet-power-helms-having.patch"
+ "backport-03-3_feat-balance-HEAVY_WEAPON_SUPPORT-flag-for-large-mut.patch"
+ "backport-04_fix-farm-mapgen-3715.patch"
"revert-01_removed-traits.patch"
"revert-02_revert-book-revamp.patch"
@@ -168,6 +171,9 @@ b2sums=('4d47457c12a539ed6fa1c5b1351f473e43aecfe1e4f2aafd37e7068fc166d95c7f72980
'54d896d8f9273ecb8b8643cf560fdad652c52db9733ebebd6944fd9a112ebdcbfa237d90251abcb2a71c9eb3433297bf8c3febaddc055bed6ad47daf898e163b'
'f49e5fc7f275de2ed80380c169e22d7dd966d147f7a65d86f958172b25baf3da1aa5eaed0b6ad36756a4ca0ddd467d1e85d8abc6298756582c2d2e7ba45fc4e5'
'c7d5c65d71f87439ffece8f230257c03b066f90a9b94194a21a3d7a59057d12e2fbf4378d485623c635d3e077ab864a6e90b1173c899e31004c5315d6a2145fe'
+ '20e5409086ab1927df3eab494d804d31d0544cd5444c166b760f7a7d574ea2975ad74d4d974d2e263f557f6a1e9757422dfee95b08f39db94a916372e1a1a2b1'
+ 'fd7a7e216e3adda177a19747b5275a7222238c939e0d815e555665adbae18665db46e04691b95022aba14cf133110607dc10f6baf7540517314ebeb1b6bf2d69'
+ 'd48d017ccf864d9cfd30051cc3bd94ca53c9a5982cc2d65ece9da487e3c6fcded2b83f95062227d8e778085aa578bfd0ab3c7f5cde095a5def3f7e52973bc5d1'
'fdef1f81084e7b08203b8464f37a00e2efc8b11d423c6e6b82e612392d91047160d2bc472b63c836ebc48adee0b4f2b3434c3e07eed5876275b234e69d7f6b9c'
'c2d6d7f74ada2ef54079fdf3759d9875552e2894dc8b753435acc692e705a9b297674eddb4e5a01a9269a84be7a82a8fef7e5762724b4d0f065976e877a05b00'
'e417a1786fbafb685099431f7f9926201ab80636bf3812da67acc341c7ef2b6a3853734d5b8b1bc355acbd5c0bedefb0401f8854aa5cb00032550afc8a7b9ebe'
@@ -215,7 +221,7 @@ b2sums=('4d47457c12a539ed6fa1c5b1351f473e43aecfe1e4f2aafd37e7068fc166d95c7f72980
'75877d9c6090a4e75529b1840f875ef04941a643c2c3b0c2e2a605c0d43d6b7ac23abf7f0316885441b8310f8a39339f2e12c7763b2d9875ee772949e6dcfcaa'
'761938b9d05430a72ff1102671d963e44d647ddb63b9a6e78979f365c6cd1e98b6a3763a4b9667ca75fbf23ee3812b4f09838061e8ba101d89d6f4dbd1104dc0'
'bc5e233c9c5b7f799a126d51d672ad510ff4f6f75a573ea8b8e994d6be07375c0b4997acef16dacad555a7f36907a361f6cc4076b97d66c4c567dc9e707bc37e'
- '07d181c9814348b2a985a574c8b9498d894f9283529c9bca2a1da7d6ef6333b46894e627fb0c7282e630e3d4c8671039f52ad29fe82a44dfbd27287226d19b51'
+ '863676b5168dc2a63ad89a5c9de6f52b65a681954c7a646c2e9a9ca4decad871ab6674df7b8e6d4fa08e90ec0696771a2c5afce358e5e9b729adbd2fc7360aef'
'6478e17056a909a6674721d496047e5b3abe2deaf355d4a90461daf702281f5c21acc5e4ccee394917f07e6f2065daf9405384061d80cc2e528ddd3369765b98'
'93be2ff64a3217f92b369c067121683083859c7e939535e55f11818dc346d4862a50faa371315ad28ab54c9778c749d7684e8a7d68a18f774be3c2fe7891bd62'
'246a189a0002e755bbed91257c324d0f34bab724f38a31bad1d5eb8bc5b126ecb3a0af8f69a6d0f5f084930c670d2747942beabab0b684f7f66a13044dec394a'
@@ -260,7 +266,7 @@ b2sums=('4d47457c12a539ed6fa1c5b1351f473e43aecfe1e4f2aafd37e7068fc166d95c7f72980
'a5e8bca3ccec2990098e8cf1c504ce6bec03cecef03b0450a4396d5b1e0ffc4e91592f40c3e389eea74fc53114cce0f2c1d2237a779e5ec7e6c12b2863d6c731'
'dd5aeab5755c68ce7c72a76369b982e8ccabcd103acb46bb992ce96719db36338f8e0b5105b4627659f90ea9a4d8b9b21e2cd734cd08e723c45bcd54209b02be'
'5247f058961ef5f366774a1dbc80cb2c158d9c1eee18e4523470fe84ec40a7237cd1687d64cffad7e2ac8f572f85da456024119b656295756672e4ae4214dbbe'
- '52471f5a0b696961fda2198fd4b6dc406565da24519e39256093167c99ceb57673d5f1cb9810528357e597144796c4e07471fbc653ffd135b97fb48877628458'
+ '08323e5a95bc755bec6cc7103f82cdad798e1040d04564c26ad3d1b66252afb950f8c92e444bec638ff01b5f592e374948092f2e890b9b031729f9dda774f8cc'
'a56efdaae0344726debf5b74846edce8df7aa2357fbc7a05a3d369d1f457b02934a0d0ce2330072e03f1ac901e06e333c9393f795c761f8440307e7649ed5596'
'22cb1ef62d955d4a734434563a278057f91f32c948966d4ba606158c11d86bb3491b06387a5f5eae3640c2210a7ea7dde06f8553c50f4d5144349623434b68e3'
'b9309da09b165fb57e83f84e3584d2479bd3336ed86e181e5df2d27daa92bd55d03d7f3fc226f03696af5f0f32d8e0e7ecd26ae7e50eed0200d0b0feaad07efb')
@@ -314,6 +320,11 @@ prepare() {
# Backport the power armor rebalance
patch -Np1 --no-backup-if-mismatch -i "$srcdir"/backport-03_feat-balance-power-armor-updates-3625.patch
+ patch -Np1 --no-backup-if-mismatch -i "$srcdir"/backport-03-2_fix-bugfixes-Fix-light-and-helmet-power-helms-having.patch
+ patch -Np1 --no-backup-if-mismatch -i "$srcdir"/backport-03-3_feat-balance-HEAVY_WEAPON_SUPPORT-flag-for-large-mut.patch
+
+ # Backport some farm fixes
+ patch -Np1 --no-backup-if-mismatch -i "$srcdir"/backport-04_fix-farm-mapgen-3715.patch
# # # Reverts
diff --git a/backport-03-2_fix-bugfixes-Fix-light-and-helmet-power-helms-having.patch b/backport-03-2_fix-bugfixes-Fix-light-and-helmet-power-helms-having.patch
new file mode 100644
index 0000000..7d6195e
--- /dev/null
+++ b/backport-03-2_fix-bugfixes-Fix-light-and-helmet-power-helms-having.patch
@@ -0,0 +1,36 @@
+From a77aebb2b4f8ced3ea79d177300a96889a5706b1 Mon Sep 17 00:00:00 2001
+From: Chaosvolt <chaosvolt@users.noreply.github.com>
+Date: Mon, 20 Nov 2023 01:13:17 -0600
+Subject: [PATCH] fix(bugfixes): Fix light and helmet power helms having each
+ other's power draw (#3726)
+
+fix(bugfixes): Fix light and helmet power helms having each other's power consumption values
+---
+ data/json/items/armor/power_armor.json | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/data/json/items/armor/power_armor.json b/data/json/items/armor/power_armor.json
+index f428456bc2f..87a44cef65c 100644
+--- a/data/json/items/armor/power_armor.json
++++ b/data/json/items/armor/power_armor.json
+@@ -318,7 +318,7 @@
+ "name": { "str": "heavy power armor helmet (active)", "str_pl": "heavy power armor helmets (active)" },
+ "description": "An extremely heavy-duty fully enclosed combat helmet for hazardous environments, this was designed to fit with a powered exoskeleton. In the field, soldiers reported that the protection was not worth the awkward size and limited visuals. The environmental controls function best with direct-skin contact.",
+ "extend": { "flags": [ "WATCH", "THERMOMETER", "CLIMATE_CONTROL", "TRADER_AVOID" ] },
+- "power_draw": 250000,
++ "power_draw": 750000,
+ "qualities": [ [ "GLARE", 2 ] ],
+ "revert_to": "power_armor_helmet_heavy",
+ "use_action": {
+@@ -373,7 +373,7 @@
+ "name": { "str": "light power armor helmet (active)", "str_pl": "light power armor helmets (active)" },
+ "description": "This full-enclosure helmet was designed based on commercial diving equipment, in response to complaints that earlier designs were impossible to use in combat. While still a little more restrictive than regular combat headgear - and frustrating should your nose itch - this one received far better reviews from soldiers. Sadly, civilization ended before they could roll out in significant numbers. The environmental controls function best with direct-skin contact.",
+ "extend": { "flags": [ "WATCH", "THERMOMETER", "CLIMATE_CONTROL", "TRADER_AVOID" ] },
+- "power_draw": 750000,
++ "power_draw": 250000,
+ "qualities": [ [ "GLARE", 1 ] ],
+ "revert_to": "power_armor_helmet_light",
+ "use_action": {
+--
+2.42.0
+
diff --git a/backport-03-3_feat-balance-HEAVY_WEAPON_SUPPORT-flag-for-large-mut.patch b/backport-03-3_feat-balance-HEAVY_WEAPON_SUPPORT-flag-for-large-mut.patch
new file mode 100644
index 0000000..3d84533
--- /dev/null
+++ b/backport-03-3_feat-balance-HEAVY_WEAPON_SUPPORT-flag-for-large-mut.patch
@@ -0,0 +1,283 @@
+From 70662ffd3884216bea10ecf804af0f8fc05d188c Mon Sep 17 00:00:00 2001
+From: Chaosvolt <chaosvolt@users.noreply.github.com>
+Date: Tue, 21 Nov 2023 07:24:44 -0600
+Subject: [PATCH] feat(balance): `HEAVY_WEAPON_SUPPORT` flag for large mutation
+ and power armors (#3691)
+
+* feat(balance): Active power armor supports heavy weapons
+
+* Update crt_toolarmor.json
+
+* style(autofix.ci): automated formatting
+
+* Huge > Power Armor
+
+You are huge! That means you have huge guts!
+
+* Update ranged.cpp
+
+* Updates per feedback
+
+1. Renamed flag per Coolthulhu's suggestion.
+2. Also removed some test messages I left in by mistake.
+
+* style(autofix.ci): automated formatting
+
+* Ideas/fixes per feedback
+
+* Rename function per suggestion
+
+Co-Authored-By: scarf <greenscarf005@gmail.com>
+
+---------
+
+Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
+Co-authored-by: scarf <greenscarf005@gmail.com>
+---
+ data/json/flags.json | 8 ++-
+ data/json/items/armor/power_armor.json | 6 +--
+ .../CRT_EXPANSION/items/crt_toolarmor.json | 5 +-
+ .../docs/en/mod/json/reference/json_flags.md | 5 +-
+ src/flag.cpp | 1 +
+ src/flag.h | 1 +
+ src/ranged.cpp | 52 +++++++++----------
+ 7 files changed, 44 insertions(+), 34 deletions(-)
+
+diff --git a/data/json/flags.json b/data/json/flags.json
+index b121cbb023f..9764c0c4049 100644
+--- a/data/json/flags.json
++++ b/data/json/flags.json
+@@ -1573,7 +1573,7 @@
+ "id": "MOUNTED_GUN",
+ "type": "json_flag",
+ "context": [ ],
+- "info": "This weapon is <bad>too unwieldy</bad> to fire on its own and <info>must be mounted</info> on a vehicle or furniture (window, table, mound of dirt, etc.) before use, <info>Large or Huge</info> mutants can fire from the hip with <bad>reduced accuracy.</bad>"
++ "info": "This weapon <bad>can only be fired if mounted</bad> on a vehicle or furniture (window, table, mound of dirt, etc.) to fire, <info>Large or Huge</info> mutants or those with active <info>Power Armor</info> can fire from the hip with <bad>reduced accuracy.</bad>"
+ },
+ {
+ "id": "MYCUS_OK",
+@@ -2037,6 +2037,12 @@
+ "type": "json_flag",
+ "context": [ ]
+ },
++ {
++ "id": "HEAVY_WEAPON_SUPPORT",
++ "type": "json_flag",
++ "context": [ ],
++ "info": "This equipment <good>allows you to fire</good> unwieldy weapons without requiring support from mountable terrain, as a <info>Large or Huge</info> mutant could, at the expense of <bad>reduced accuracy.</bad>"
++ },
+ {
+ "id": "FIRE_TWOHAND",
+ "type": "json_flag",
+diff --git a/data/json/items/armor/power_armor.json b/data/json/items/armor/power_armor.json
+index 87a44cef65c..56f212aa303 100644
+--- a/data/json/items/armor/power_armor.json
++++ b/data/json/items/armor/power_armor.json
+@@ -91,7 +91,7 @@
+ "type": "TOOL_ARMOR",
+ "name": { "str": "power armor (active)", "str_pl": "suits of power armor (active)" },
+ "description": "These were the second wave of military combat exoskeleton, and got a lot of media attention, with popular Navy commercials featuring them heavily. It consists of a muscle-boosting exoskeleton frame with overlayed segmented alloy plating. Despite advancements over the original bulky 'tank suits', the wearer still cannot easily fit through narrow spaces, or sit down comfortably (and it ruins upholstery). There is an integrated chemical resistant bodyglove that precludes wearing other clothing. It is currently turned on, activate it to turn it off.",
+- "extend": { "flags": [ "CLIMATE_CONTROL", "TRADER_AVOID" ] },
++ "extend": { "flags": [ "CLIMATE_CONTROL", "HEAVY_WEAPON_SUPPORT", "TRADER_AVOID" ] },
+ "power_draw": 1500000,
+ "revert_to": "power_armor_basic",
+ "use_action": {
+@@ -150,7 +150,7 @@
+ "type": "TOOL_ARMOR",
+ "name": { "str": "heavy power armor (active)", "str_pl": "suits of heavy power armor (active)" },
+ "description": "Colloquially known as a 'tank suit' in the media, these bulky exoskeletons, covered in thick segmented armor plates, were tested in military service a few years back and determined to be too heavy and expensive for regular use. Now that it's in your hands, though, you have a massive suit of power armor capable of resisting almost any small arms fire and most other forms of attack. On the other hand, it doubles your effective weight, and it's almost impossible not to bump into things. There is an integrated chemical resistant bodyglove that precludes wearing other clothing. It is currently turned on, activate it to turn it off.",
+- "extend": { "flags": [ "CLIMATE_CONTROL", "TRADER_AVOID" ] },
++ "extend": { "flags": [ "CLIMATE_CONTROL", "HEAVY_WEAPON_SUPPORT", "TRADER_AVOID" ] },
+ "power_draw": 2250000,
+ "revert_to": "power_armor_heavy",
+ "use_action": {
+@@ -207,7 +207,7 @@
+ "type": "TOOL_ARMOR",
+ "name": { "str": "light power armor (active)", "str_pl": "suits of light power armor (active)" },
+ "description": "The final iteration of military power armor before the fall of civilization, this type - a powered exoskeleton with high-tech segmented plating - was designed for actual widespread combat use and was seen on the front lines during the last days of the cataclysm. Like the heavier suits, it is resistant to most modern weaponry, but it is light and maneuverable, and can fit into normal vehicles and doorways without fuss, a huge advantage over predecessors. Unfortunately, the world ended before it could roll out in significant numbers. There is an integrated chemical resistant bodyglove that precludes wearing other clothing. It is currently turned on, activate it to turn it off.",
+- "extend": { "flags": [ "CLIMATE_CONTROL", "TRADER_AVOID" ] },
++ "extend": { "flags": [ "CLIMATE_CONTROL", "HEAVY_WEAPON_SUPPORT", "TRADER_AVOID" ] },
+ "power_draw": 750000,
+ "revert_to": "power_armor_light",
+ "use_action": {
+diff --git a/data/mods/CRT_EXPANSION/items/crt_toolarmor.json b/data/mods/CRT_EXPANSION/items/crt_toolarmor.json
+index 708f79d1548..7ea7d2375a2 100644
+--- a/data/mods/CRT_EXPANSION/items/crt_toolarmor.json
++++ b/data/mods/CRT_EXPANSION/items/crt_toolarmor.json
+@@ -117,7 +117,7 @@
+ "type": "TOOL_ARMOR",
+ "category": "armor",
+ "name": { "str": "C.R.I.T. EM vest (off)", "str_pl": "C.R.I.T. EM vests (off)" },
+- "description": "The C.R.I.T. Spec Ops Enhanced Movement vest is embedded with high-tech filaments and reactive servos which protects its wearer and assists in movement at the cost high power usage. It is commonly worn by C.R.I.T. Spec Ops for its ease of use and manuverability. Turn it on for suit mode, extra protection and movement.",
++ "description": "The C.R.I.T. Spec Ops Enhanced Movement vest is embedded with high-tech filaments and reactive servos which protects its wearer and assists in movement at the cost high of power usage. It is commonly worn by C.R.I.T. Spec Ops for its ease of use and maneuverability. Turn it on for suit mode, extra protection and movement.",
+ "weight": "10 kg",
+ "volume": "6250 ml",
+ "price": 7000000,
+@@ -214,7 +214,8 @@
+ "TRADER_AVOID",
+ "USE_UPS",
+ "NO_UNLOAD",
+- "OUTER"
++ "OUTER",
++ "HEAVY_WEAPON_SUPPORT"
+ ]
+ },
+ {
+diff --git a/doc/src/content/docs/en/mod/json/reference/json_flags.md b/doc/src/content/docs/en/mod/json/reference/json_flags.md
+index 39531a105ac..76131e01d11 100644
+--- a/doc/src/content/docs/en/mod/json/reference/json_flags.md
++++ b/doc/src/content/docs/en/mod/json/reference/json_flags.md
+@@ -761,12 +761,15 @@ List of known flags, used in both `terrain.json` and `furniture.json`.
+ - `DISABLE_SIGHTS` Prevents use of the base weapon sights
+ - `FIRE_100` Uses 100 shots per firing.
+ - `FIRE_50` Uses 50 shots per firing.
++- `HEAVY_WEAPON_SUPPORT` Wearing this will let you hip-fire heavy weapons without needing terrain
++ support, like Large or Huge mutants can.
+ - `FIRE_TWOHAND` Gun can only be fired if player has two free hands.
+ - `IRREMOVABLE` Makes so that the gunmod cannot be removed.
+ - `MECH_BAT` This is an exotic battery designed to power military mechs.
+ - `MOUNTED_GUN` Gun can only be used on terrain / furniture with the "MOUNTABLE" flag, if you're a
+ normal human. If you're an oversized mutant (Inconveniently Large, Large, Freakishly Huge, Huge),
+- you can fire it regularly in exchange for dispersion and recoil penalties.
++ you can fire it regularly in exchange for dispersion and recoil penalties. Wearing something with
++ the `HEAVY_WEAPON_SUPPORT` flag also works.
+ - `NEVER_JAMS` Never malfunctions.
+ - `NO_UNLOAD` Cannot be unloaded.
+ - `PRIMITIVE_RANGED_WEAPON` Allows using non-gunsmith tools to repair it (but not reinforce).
+diff --git a/src/flag.cpp b/src/flag.cpp
+index 89506e69860..ecac40cd714 100644
+--- a/src/flag.cpp
++++ b/src/flag.cpp
+@@ -117,6 +117,7 @@ const flag_id flag_FIREWOOD( "FIREWOOD" );
+ const flag_id flag_FIRE_100( "FIRE_100" );
+ const flag_id flag_FIRE_20( "FIRE_20" );
+ const flag_id flag_FIRE_50( "FIRE_50" );
++const flag_id flag_HEAVY_WEAPON_SUPPORT( "HEAVY_WEAPON_SUPPORT" );
+ const flag_id flag_FIRE_TWOHAND( "FIRE_TWOHAND" );
+ const flag_id flag_FISH_GOOD( "FISH_GOOD" );
+ const flag_id flag_FISH_POOR( "FISH_POOR" );
+diff --git a/src/flag.h b/src/flag.h
+index 7441a3742c9..4c244badf71 100644
+--- a/src/flag.h
++++ b/src/flag.h
+@@ -119,6 +119,7 @@ extern const flag_id flag_FIREWOOD;
+ extern const flag_id flag_FIRE_100;
+ extern const flag_id flag_FIRE_20;
+ extern const flag_id flag_FIRE_50;
++extern const flag_id flag_HEAVY_WEAPON_SUPPORT;
+ extern const flag_id flag_FIRE_TWOHAND;
+ extern const flag_id flag_FISH_GOOD;
+ extern const flag_id flag_FISH_POOR;
+diff --git a/src/ranged.cpp b/src/ranged.cpp
+index ecdfa6384ea..0b933e99187 100644
+--- a/src/ranged.cpp
++++ b/src/ranged.cpp
+@@ -140,9 +140,6 @@ static const bionic_id bio_railgun( "bio_railgun" );
+ static const bionic_id bio_targeting( "bio_targeting" );
+ static const bionic_id bio_ups( "bio_ups" );
+
+-
+-static const std::string flag_MOUNTABLE( "MOUNTABLE" );
+-
+ static const trait_id trait_PYROMANIA( "PYROMANIA" );
+ static const trait_id trait_NORANGEDCRIT( "NO_RANGED_CRIT" );
+
+@@ -151,7 +148,7 @@ static constexpr int AIF_DURATION_LIMIT = 10;
+
+ static projectile make_gun_projectile( const item &gun );
+ static void cycle_action( item &weap, const tripoint &pos );
+-bool can_use_bipod( const map &m, const tripoint &pos );
++bool can_use_heavy_weapon( const Character &who, const map &m, const tripoint &pos );
+ dispersion_sources calculate_dispersion( const map &m, const Character &who, const item &gun,
+ int at_recoil, bool burst );
+
+@@ -776,8 +773,12 @@ void npc::pretend_fire( npc *source, int shots, item &gun )
+ }
+ }
+
+-bool can_use_bipod( const map &m, const tripoint &pos )
++bool can_use_heavy_weapon( const Character &who, const map &m, const tripoint &pos )
+ {
++ if( who.is_mounted() && who.mounted_creature->has_flag( MF_RIDEABLE_MECH ) ) {
++ return true;
++ }
++
+ // usage of any attached bipod is dependent upon terrain
+ if( m.has_flag_ter_or_furn( "MOUNTABLE", pos ) ) {
+ return true;
+@@ -793,7 +794,7 @@ bool can_use_bipod( const map &m, const tripoint &pos )
+ dispersion_sources calculate_dispersion( const map &m, const Character &who, const item &gun,
+ int at_recoil, bool burst )
+ {
+- bool bipod = can_use_bipod( m, who.pos() );
++ bool bipod = can_use_heavy_weapon( who, m, who.pos() );
+
+ int gun_recoil = gun.gun_recoil( bipod );
+ int eff_recoil = at_recoil + ( burst ? ranged::burst_penalty( who, gun, gun_recoil ) : 0 );
+@@ -939,15 +940,18 @@ int ranged::fire_gun( Character &who, const tripoint &target, int max_shots, ite
+ // Reset aim for bows and other reload-and-shoot weapons.
+ who.recoil = MAX_RECOIL;
+ } else {
++ // Hack alert: nearly every other use of can_use_heavy_weapon uses const character, except this one and gunmode_checks_weapon.
++ const Character &shooter = who;
+ // Now actually apply recoil for the future shots
+ // But only for one shot, because bursts kinda suck
+- int gun_recoil = gun.gun_recoil( can_use_bipod( here, who.pos() ) );
++ int gun_recoil = gun.gun_recoil( can_use_heavy_weapon( shooter, here, shooter.pos() ) );
+
+- // If user is currently able to fire a mounted gun freely, penalize recoil based on size class.
+- if( gun.has_flag( flag_MOUNTED_GUN ) && !can_use_bipod( here, who.pos() ) ) {
+- if( who.get_size() == MS_HUGE ) {
++ // If user is currently able to fire a mounted gun freely, penalize dispersion
++ // HEAVY_WEAPON_SUPPORT flag has highest penalty, Large mutants lower penalty, no penalty for Huge mutants.
++ if( gun.has_flag( flag_MOUNTED_GUN ) && !can_use_heavy_weapon( shooter, here, shooter.pos() ) ) {
++ if( who.get_size() == MS_LARGE ) {
+ gun_recoil = gun_recoil * 2;
+- } else {
++ } else if( who.worn_with_flag( flag_HEAVY_WEAPON_SUPPORT ) && ( who.get_size() <= MS_MEDIUM ) ) {
+ gun_recoil = gun_recoil * 3;
+ }
+ }
+@@ -1943,12 +1947,13 @@ dispersion_sources ranged::get_weapon_dispersion( const Character &who, const it
+ dispersion.add_multiplier( 4 );
+ }
+
+- // If user is currently able to fire a mounted gun freely, penalize dispersion based on size class.
+- if( obj.has_flag( flag_MOUNTED_GUN ) && !can_use_bipod( get_map(), who.pos() ) ) {
+- if( who.get_size() == MS_HUGE ) {
+- dispersion.add_multiplier( 2 );
+- } else {
+- dispersion.add_multiplier( 3 );
++ // If user is currently able to fire a mounted gun freely, penalize dispersion
++ // HEAVY_WEAPON_SUPPORT flag has highest penalty, Large mutants lower penalty, no penalty for Huge mutants.
++ if( obj.has_flag( flag_MOUNTED_GUN ) && !can_use_heavy_weapon( who, get_map(), who.pos() ) ) {
++ if( who.get_size() == MS_LARGE ) {
++ dispersion.add_range( 500 );
++ } else if( who.worn_with_flag( flag_HEAVY_WEAPON_SUPPORT ) && ( who.get_size() <= MS_MEDIUM ) ) {
++ dispersion.add_range( 1000 );
+ }
+ }
+
+@@ -3772,16 +3777,9 @@ bool ranged::gunmode_checks_weapon( avatar &you, const map &m, std::vector<std::
+ }
+
+ if( gmode->has_flag( flag_MOUNTED_GUN ) ) {
+-
+- bool mech_mount = false;
+- if( you.is_mounted() && you.mounted_creature->has_flag( MF_RIDEABLE_MECH ) ) {
+- mech_mount = true;
+- }
+-
+- const bool v_mountable = static_cast<bool>( m.veh_at( you.pos() ).part_with_feature( "MOUNTABLE",
+- true ) );
+- bool t_mountable = m.has_flag_ter_or_furn( flag_MOUNTABLE, you.pos() );
+- if( !mech_mount && !t_mountable && !v_mountable && !( you.get_size() > MS_MEDIUM ) ) {
++ const Character &shooter = you;
++ if( !can_use_heavy_weapon( shooter, m, shooter.pos() ) && !( you.get_size() > MS_MEDIUM ) &&
++ !you.worn_with_flag( flag_HEAVY_WEAPON_SUPPORT ) ) {
+ messages.push_back( string_format(
+ _( "You must stand near acceptable terrain or furniture to fire the %s. A table, a mound of dirt, a broken window, etc." ),
+ gmode->tname() ) );
+--
+2.42.0
+
diff --git a/backport-04_fix-farm-mapgen-3715.patch b/backport-04_fix-farm-mapgen-3715.patch
new file mode 100644
index 0000000..c737051
--- /dev/null
+++ b/backport-04_fix-farm-mapgen-3715.patch
@@ -0,0 +1,78 @@
+From 13714f68ef41c8e2cd43d6bf203065c27fbc2810 Mon Sep 17 00:00:00 2001
+From: 0Monet <146018959+0Monet@users.noreply.github.com>
+Date: Sun, 19 Nov 2023 00:22:30 +0100
+Subject: [PATCH] fix: farm mapgen (#3715)
+
+* fix_farm_mapgen
+
+* style(autofix.ci): automated formatting
+
+---------
+
+Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
+---
+ data/json/mapgen/farm.json | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/data/json/mapgen/farm.json b/data/json/mapgen/farm.json
+index eca907206c1..1c3952dbb8e 100644
+--- a/data/json/mapgen/farm.json
++++ b/data/json/mapgen/farm.json
+@@ -24,7 +24,7 @@
+ " #__2___________2__# #_1__1_# -6..........H.- F DDDDDDDDDDDDDDDD F ",
+ " #__2___________2__# #______# -u...----+----- F F ",
+ " #332___________233# #______# --+---kh......- F DDDDDDDDDDDDDDDD F ",
+- " #_____________1___# #_1__1_# -...-.........w F F ",
++ " #_____________1___# #_1__1_# -b..-.........w F F ",
+ " W_________________W #______# -b..+......BB.- F DDDDDDDDDDDDDDDD F ",
+ " W_________________W #____ll# -.ST-.....dBBd- F F ",
+ " #lll__________O___# ###++### --w------w----- F DDDDDDDDDDDDDDDD F ",
+@@ -80,7 +80,6 @@
+ "F F ",
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF "
+ ],
+- "place_items": [ ],
+ "place_item": [
+ { "item": "straw_pile", "x": [ 3, 5 ], "y": [ 5, 7 ], "amount": [ 0, 8 ] },
+ { "item": "cattlefodder", "x": [ 3, 5 ], "y": [ 5, 7 ], "amount": [ 0, 4 ] },
+@@ -90,11 +89,10 @@
+ { "item": "cattlefodder", "x": [ 19, 19 ], "y": [ 10, 15 ], "amount": [ 2, 7 ] }
+ ],
+ "place_monsters": [
+- { "monster": "GROUP_ZOMBIE", "x": [ 4, 4 ], "y": [ 14, 14 ], "repeat": [ 1, 6 ], "density": 0.2 },
++ { "monster": "GROUP_ZOMBIE", "x": [ 9, 11 ], "y": [ 12, 14 ], "repeat": [ 1, 6 ], "density": 0.2 },
+ { "monster": "GROUP_DOMESTIC", "x": [ 10, 12 ], "y": [ 15, 17 ], "repeat": [ 1, 2 ], "density": 0.2 }
+ ],
+ "sealed_item": { "D": { "item": { "item": "seed_corn" }, "furniture": "f_plant_seedling" } },
+- "place_nested": [ { "chunks": [ [ "NC_FARMER_spawn", 10 ], [ "null", 90 ] ], "x": 23, "y": 3 } ],
+ "palettes": [ "farm" ]
+ }
+ },
+@@ -123,7 +121,7 @@
+ "#_1__1_# -6...........m-",
+ "#__Q___# -u...----+-----",
+ "#______# --+---mm....mm-",
+- "#_1__1_# -...-.........w",
++ "#_1__1_# -b..-.........w",
+ "#______# -b..+......BB.-",
+ "#____ll# -.ST-mm...dBBd-",
+ "###++### --w------w-----",
+@@ -131,6 +129,7 @@
+ " ",
+ "FFFFFFFFFFFFFFFFFFFFFFFF"
+ ],
++ "terrain": { "Q": "t_dirtfloor" },
+ "items": {
+ ".": { "item": "trash", "chance": 20 },
+ "B": [
+@@ -164,6 +163,7 @@
+ "u": [ { "item": "kitchen", "chance": 70 }, { "item": "cannedfood", "chance": 40 }, { "item": "softdrugs", "chance": 40 } ],
+ "Q": { "item": "farming_tools", "chance": 15 }
+ },
++ "place_nested": [ { "chunks": [ [ "NC_FARMER_spawn", 10 ], [ "null", 90 ] ], "x": 17, "y": 13 } ],
+ "palettes": [ "farm" ]
+ }
+ },
+--
+2.42.0
+