diff --git a/data/json/items/ammo/20x66mm.json b/data/json/items/ammo/20x66mm.json index 92699d15dfef..fef2121bebae 100644 --- a/data/json/items/ammo/20x66mm.json +++ b/data/json/items/ammo/20x66mm.json @@ -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", diff --git a/data/json/items/ammo/40x46mm.json b/data/json/items/ammo/40x46mm.json index 80ab851834db..1246e4572f02 100644 --- a/data/json/items/ammo/40x46mm.json +++ b/data/json/items/ammo/40x46mm.json @@ -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", @@ -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", @@ -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, @@ -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, diff --git a/data/json/items/ammo/40x53mm.json b/data/json/items/ammo/40x53mm.json index 21567ef40bbe..eaa065f0ffa3 100644 --- a/data/json/items/ammo/40x53mm.json +++ b/data/json/items/ammo/40x53mm.json @@ -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", @@ -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", diff --git a/data/json/items/ammo/410shot.json b/data/json/items/ammo/410shot.json index 69bc748c7d1a..9927cf5d91c7 100644 --- a/data/json/items/ammo/410shot.json +++ b/data/json/items/ammo/410shot.json @@ -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" ] diff --git a/data/json/items/ammo/flintlock.json b/data/json/items/ammo/flintlock.json index 391a3ae0d037..725775c12096 100644 --- a/data/json/items/ammo/flintlock.json +++ b/data/json/items/ammo/flintlock.json @@ -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, diff --git a/data/json/items/ammo/shot.json b/data/json/items/ammo/shot.json index 5dd6d2b69c71..957415a5996a 100644 --- a/data/json/items/ammo/shot.json +++ b/data/json/items/ammo/shot.json @@ -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", diff --git a/data/json/items/handloaded_bullets.json b/data/json/items/handloaded_bullets.json index 39cb32833056..d00b963ff890 100644 --- a/data/json/items/handloaded_bullets.json +++ b/data/json/items/handloaded_bullets.json @@ -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" ] @@ -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" ] diff --git a/src/projectile.h b/src/projectile.h index 3ab3f2ee617f..4f542b4efbea 100644 --- a/src/projectile.h +++ b/src/projectile.h @@ -39,7 +39,7 @@ struct projectile { void set_custom_explosion( const explosion_data &ex ); void unset_custom_explosion(); - const std::set &get_ammo_effects() { + const std::set &get_ammo_effects() const { return proj_effects; } diff --git a/src/ranged_aoe.cpp b/src/ranged_aoe.cpp index 1f67e08f08dc..176e95189a07 100644 --- a/src/ranged_aoe.cpp +++ b/src/ranged_aoe.cpp @@ -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 &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 );