Auto-aim in combat mode at mobs on the floor is disabled after 10 tiles. (#83270)

## About The Pull Request
As stated in the title, auto-aiming at prone targets is disabled after
the projectile passed more than 10 tiles (the limit of vision of an
ordinary spaceman is 9 tiles). Within 10 tiles, shooting in combat mode
remains unchanged. This also does not apply to sniper rifles.
Here's a preview of how it works:


https://github.com/tgstation/tgstation/assets/126676387/d62fbb03-9f63-4a73-a32a-62b4d11e4515
## Why It's Good For The Game
The main problem of shooting in combat mode is shooting in busy
corridors. Often, you are unwilling to become a participant in the
security's pursuit of the antagonist, and receive unintended
projectiles. You will be lucky if the projectile turns out to be
non-lethal, but if it is a laser, you can get a second-degree burn or
even a catastrophic one from just one shot. (depending on which laser
was fired and where you were hit), which is not very pleasant. To stay
unharmed and simplify the work of security, it is logical to lie down on
the floor.
This will not revive the lie-down meta to dodge projectiles, because
within sight of the spaceman and even a little further, lying targets
will still be hit by projectiles. And if you decide to lie down during
the chase to dodge the projectiles, then the pursuers will quickly catch
up with you and shoot you in combat mode.
## Changelog
🆑
balance: Auto-aim in combat mode at mobs on the floor is disabled after
the projectile passes 10 tiles.
/🆑

---------

Co-authored-by: paganiy <leunscrupuloustrolle@gmail.com>
This commit is contained in:
paganiy
2024-05-22 13:31:42 +01:00
committed by GitHub
co-authored by paganiy
parent 29e84bca18
commit c3ff3e06c3
3 changed files with 15 additions and 6 deletions
+12 -6
View File
@@ -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())
@@ -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.