Skip to content

Commit

Permalink
revert: bring aoe shotshell again (#4950)
Browse files Browse the repository at this point in the history
* revert: aoe shotgun attacks

reverts commit  b3377c9

* fix: mark as const member function

* refactor: use structured binding declaration
  • Loading branch information
scarf005 authored Jan 13, 2025
1 parent 96c24bc commit af3b299
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 20 deletions.
4 changes: 3 additions & 1 deletion data/json/items/ammo/20x66mm.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@
"type": "AMMO",
"name": { "str": "20x66mm buckshot" },
"//": "2.5x the Generic Rate of $1/shot",
"description": "20x66mm caseless shotgun rounds, buckshot type. Proprietary ammunition for Rivtech shotguns. Being caseless rounds, these cannot be disassembled or reloaded."
"description": "20x66mm caseless shotgun rounds, buckshot type. Proprietary ammunition for Rivtech shotguns. Being caseless rounds, these cannot be disassembled or reloaded.",
"range": 0,
"shape": [ "cone", { "half_angle": 15, "length": 12 } ]
},
{
"id": "20x66_slug",
Expand Down
12 changes: 8 additions & 4 deletions data/json/items/ammo/40x46mm.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"name": { "str": "40x46mm M576 buckshot" },
"description": "A 40x46mm buckshot load, designed for use in thick vegetation or room clearing.",
"weight": "120 g",
"range": 12,
"range": 0,
"shape": [ "cone", { "half_angle": 15, "length": 12 } ],
"damage": { "damage_type": "bullet", "amount": 120 },
"recoil": 1000,
"casing": "40x46mm_m199_casing",
Expand All @@ -77,7 +78,8 @@
"name": { "str": "improvised 40x46mm buckshot" },
"description": "An improvised 40x46mm buckshot load somewhat resembling M576. Aside from using the M118 casing normally used by HEDP shells, it performs as well as buckshot loads using the intended M199 casing.",
"weight": "120 g",
"range": 10,
"range": 0,
"shape": [ "cone", { "half_angle": 15, "length": 12 } ],
"damage": { "damage_type": "bullet", "amount": 120 },
"recoil": 1000,
"casing": "40x46mm_m118_casing",
Expand Down Expand Up @@ -116,7 +118,8 @@
"name": { "str": "improvised 40x46mm flechette" },
"description": "An improvised 40x46mm flechette load containing 70 steel darts. Aside from using the M118 casing normally used by HEDP shells, it performs as well as flechette shells using the M199 casing.",
"weight": "120 g",
"range": 10,
"range": 0,
"shape": [ "cone", { "half_angle": 15, "length": 12 } ],
"//": "Balanced as AP.",
"damage": { "damage_type": "bullet", "amount": 84, "armor_penetration": 72 },
"recoil": 1000,
Expand All @@ -130,7 +133,8 @@
"name": { "str": "improvised 40x46mm flechette" },
"description": "An improvised 40x46mm flechette load containing 70 steel darts, loaded into the M199 casing used by M576 buckshot shells.",
"weight": "120 g",
"range": 10,
"range": 0,
"shape": [ "cone", { "half_angle": 15, "length": 12 } ],
"//": "Balanced as AP.",
"damage": { "damage_type": "bullet", "amount": 84, "armor_penetration": 72 },
"recoil": 1000,
Expand Down
6 changes: 4 additions & 2 deletions data/json/items/ammo/40x53mm.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"description": "40x53mm canister shot loaded with 17 grain flechettes.",
"weight": "340 g",
"//": "Balanced as AP.",
"range": 10,
"range": 0,
"shape": [ "cone", { "half_angle": 15, "length": 10 } ],
"damage": { "damage_type": "bullet", "amount": 91, "armor_penetration": 78 },
"recoil": 1000,
"casing": "40x53mm_m169_casing",
Expand All @@ -52,7 +53,8 @@
"name": { "str": "improvised 40x53mm buckshot" },
"description": "An improvised 40x53mm buckshot load somewhat resembling M576.",
"weight": "340 g",
"range": 10,
"range": 0,
"shape": [ "cone", { "half_angle": 15, "length": 10 } ],
"damage": { "damage_type": "bullet", "amount": 130 },
"recoil": 1200,
"casing": "40x53mm_m169_casing",
Expand Down
5 changes: 3 additions & 2 deletions data/json/items/ammo/410shot.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
"stack_size": 20,
"ammo_type": "410shot",
"casing": "410shot_hull",
"range": 20,
"damage": { "damage_type": "bullet", "amount": 53 },
"range": 0,
"shape": [ "cone", { "half_angle": 10, "length": 12 } ],
"damage": { "damage_type": "bullet", "amount": 30 },
"recoil": 1350,
"loudness": 90,
"effects": [ "COOKOFF", "SHOT" ]
Expand Down
5 changes: 3 additions & 2 deletions data/json/items/ammo/flintlock.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
"count": 30,
"stack_size": 10,
"ammo_type": "flintlockshot",
"range": 8,
"damage": { "damage_type": "bullet", "amount": 60, "armor_multiplier": 2 },
"range": 0,
"shape": [ "cone", { "half_angle": 10, "length": 12 } ],
"damage": { "damage_type": "bullet", "amount": 63 },
"dispersion": 20,
"recoil": 1500,
"loudness": 90,
Expand Down
4 changes: 3 additions & 1 deletion data/json/items/ammo/shot.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@
"copy-from": "shot_abstract",
"type": "AMMO",
"name": { "str": "00 shot" },
"description": "A shell filled with metal pellets. Extremely damaging, plus the spread makes it very accurate at short range. Favored by SWAT forces."
"description": "A shell filled with metal pellets. Extremely damaging, plus the spread makes it very accurate at short range. Favored by SWAT forces.",
"range": 0,
"shape": [ "cone", { "half_angle": 10, "length": 12 } ]
},
{
"id": "shot_beanbag",
Expand Down
10 changes: 6 additions & 4 deletions data/json/items/handloaded_bullets.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
"weight": "2 g",
"bashing": 1,
"ammo_type": "blunderbuss",
"damage": { "damage_type": "bullet", "amount": 55, "armor_multiplier": 3 },
"range": 6,
"damage": { "damage_type": "bullet", "amount": 55, "armor_multiplier": 1.5 },
"range": 0,
"shape": [ "cone", { "half_angle": 18, "length": 10 } ],
"dispersion": 1000,
"recoil": 780,
"effects": [ "COOKOFF", "SHOT", "RECYCLED" ]
Expand All @@ -55,8 +56,9 @@
"bashing": 1,
"ammo_type": "blunderbuss",
"//": "Balanced as standard FMJ to allow lower damage but more penetration over shot.",
"damage": { "damage_type": "bullet", "amount": 44, "armor_penetration": 24, "armor_multiplier": 2 },
"range": 10,
"damage": { "damage_type": "bullet", "amount": 44, "armor_penetration": 24, "armor_multiplier": 1.5 },
"range": 0,
"shape": [ "cone", { "half_angle": 10, "length": 12 } ],
"dispersion": 1000,
"recoil": 840,
"effects": [ "COOKOFF", "SHOT", "RECYCLED" ]
Expand Down
2 changes: 1 addition & 1 deletion src/projectile.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct projectile {
void set_custom_explosion( const explosion_data &ex );
void unset_custom_explosion();

const std::set<ammo_effect_str_id> &get_ammo_effects() {
const std::set<ammo_effect_str_id> &get_ammo_effects() const {
return proj_effects;
}

Expand Down
6 changes: 3 additions & 3 deletions src/ranged_aoe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ void execute_shaped_attack( const shape &sh, const projectile &proj, Creature &a

// Here and not above because we want the animation first
// Terrain will be shown damaged, but having it in unknown state would complicate timing the animation
for( const std::pair<const tripoint, double> &pr : final_coverage ) {
Creature *critter = g->critter_at( pr.first );
for( const auto &[point, coverage] : final_coverage ) {
Creature *critter = g->critter_at( point );
if( critter != nullptr ) {
dealt_projectile_attack atk;
atk.end_point = pr.first;
atk.end_point = point;
atk.hit_critter = critter;
atk.proj = proj;
atk.missed_by = rng_float( 0.15, 0.45 );
Expand Down

0 comments on commit af3b299

Please sign in to comment.