diff --git a/code/game/objects/items/shrapnel.dm b/code/game/objects/items/shrapnel.dm index c07bc780c91..9b024cfbb97 100644 --- a/code/game/objects/items/shrapnel.dm +++ b/code/game/objects/items/shrapnel.dm @@ -31,6 +31,7 @@ shrapnel_type = /obj/item/shrapnel ricochet_incidence_leeway = 60 hit_prone_targets = TRUE + ignore_range_hit_prone_targets = TRUE sharpness = SHARP_EDGED wound_bonus = 30 embedding = list(embed_chance=70, ignore_throwspeed_threshold=TRUE, fall_chance=1) @@ -73,6 +74,7 @@ /obj/projectile/bullet/pellet/stingball/on_ricochet(atom/A) hit_prone_targets = TRUE // ducking will save you from the first wave, but not the rebounds + ignore_range_hit_prone_targets = TRUE /obj/projectile/bullet/pellet/stingball/mega name = "megastingball pellet" diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 8bc358b4387..877326fd985 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -1,6 +1,7 @@ #define MOVES_HITSCAN -1 //Not actually hitscan but close as we get without actual hitscan. #define MUZZLE_EFFECT_PIXEL_INCREMENT 17 //How many pixels to move the muzzle flash up so your character doesn't look like they're shitting out lasers. +#define MAX_RANGE_HIT_PRONE_TARGETS 10 //How far do the projectile hits the prone mob /obj/projectile name = "projectile" @@ -191,8 +192,10 @@ var/shrapnel_type ///If we have a shrapnel_type defined, these embedding stats will be passed to the spawned shrapnel type, which will roll for embedding on the target var/list/embedding - ///If TRUE, hit mobs even if they're on the floor and not our target + ///If TRUE, hit mobs, even if they are lying on the floor and are not our target within MAX_RANGE_HIT_PRONE_TARGETS tiles var/hit_prone_targets = FALSE + ///if TRUE, ignores the range of MAX_RANGE_HIT_PRONE_TARGETS tiles of hit_prone_targets + var/ignore_range_hit_prone_targets = FALSE ///For what kind of brute wounds we're rolling for, if we're doing such a thing. Lasers obviously don't care since they do burn instead. var/sharpness = NONE ///How much we want to drop damage per tile as it travels through the air @@ -621,13 +624,15 @@ return FALSE if(HAS_TRAIT(living_target, TRAIT_IMMOBILIZED) && HAS_TRAIT(living_target, TRAIT_FLOORED) && HAS_TRAIT(living_target, TRAIT_HANDS_BLOCKED)) return FALSE - if(!hit_prone_targets) + if(hit_prone_targets) var/mob/living/buckled_to = living_target.lowest_buckled_mob() - if(!buckled_to.density) // Will just be us if we're not buckled to another mob - return FALSE - if(living_target.body_position != LYING_DOWN) + if((decayedRange - range) <= MAX_RANGE_HIT_PRONE_TARGETS) // after MAX_RANGE_HIT_PRONE_TARGETS tiles, auto-aim hit for mobs on the floor turns off return TRUE - return TRUE + if(ignore_range_hit_prone_targets) // doesn't apply to projectiles that must hit the target in combat mode or something else, no matter what + return TRUE + if(buckled_to.density) // Will just be us if we're not buckled to another mob + return TRUE + return FALSE /** * Scan if we should hit something and hit it if we need to @@ -1177,6 +1182,7 @@ #undef MOVES_HITSCAN #undef MUZZLE_EFFECT_PIXEL_INCREMENT +#undef MAX_RANGE_HIT_PRONE_TARGETS /// Fire a projectile from this atom at another atom /atom/proc/fire_projectile(projectile_type, atom/target, sound, firer, list/ignore_targets = list()) diff --git a/code/modules/projectiles/projectile/bullets/sniper.dm b/code/modules/projectiles/projectile/bullets/sniper.dm index 4425b20eeed..6118d90644d 100644 --- a/code/modules/projectiles/projectile/bullets/sniper.dm +++ b/code/modules/projectiles/projectile/bullets/sniper.dm @@ -9,6 +9,7 @@ dismemberment = 50 catastropic_dismemberment = TRUE armour_penetration = 50 + ignore_range_hit_prone_targets = TRUE ///Determines object damage. var/object_damage = 80 ///Determines how much additional damage the round does to mechs.