Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a status effect to try to mitigate sniper stacking #16723

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion code/__DEFINES/conflict.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
///Ammo will pass through windows and has damage reduced by smokes with SMOKE_NERF_BEAM
#define AMMO_ENERGY (1<<3)
///Ammo is more likely to continue past cover such as cades
#define AMMO_SNIPER (1<<4)
#define AMMO_BETTER_COVER_RNG (1<<4)
///Ammo will attempt to add firestacks and ignite a hit mob if it deals any damage. Armor applies, regardless of AMMO_IGNORE_ARMOR
#define AMMO_INCENDIARY (1<<5)
///Ammo type entirely ignores xenos
Expand All @@ -73,6 +73,8 @@
#define AMMO_PASS_THROUGH_MOB (1<<15)
///If the projectile ricochet and miss sound is pitched up
#define AMMO_SOUND_PITCH (1<<16)
///Is this projectile considered sniper ammo, used for the anti sniper stacking status effect
#define AMMO_SNIPER (1<<17)

//Gun defines for gun related thing. More in the projectile folder.
//gun_features_flags
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
#define STATUS_EFFECT_MICROWAVE /datum/status_effect/stacking/microwave
///armor reduction
#define STATUS_EFFECT_SHATTER /datum/status_effect/shatter
///recenly hit by a sniper round
#define STATUS_EFFECT_SNIPED /datum/status_effect/incapacitating/recently_sniped

/////////////
// NEUTRAL //
Expand Down
5 changes: 3 additions & 2 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ GLOBAL_LIST_INIT(bitfields, list(
"AMMO_XENO" = AMMO_XENO,
"AMMO_UNWIELDY" = AMMO_UNWIELDY,
"AMMO_ENERGY" = AMMO_ENERGY,
"AMMO_SNIPER" = AMMO_SNIPER,
"AMMO_BETTER_COVER_RNG" = AMMO_BETTER_COVER_RNG,
"AMMO_INCENDIARY" = AMMO_INCENDIARY,
"AMMO_SKIPS_ALIENS" = AMMO_SKIPS_ALIENS,
"AMMO_BALLISTIC" = AMMO_BALLISTIC,
Expand All @@ -456,7 +456,8 @@ GLOBAL_LIST_INIT(bitfields, list(
"AMMO_PASS_THROUGH_TURF" = AMMO_PASS_THROUGH_TURF,
"AMMO_PASS_THROUGH_MOVABLE" = AMMO_PASS_THROUGH_MOVABLE,
"AMMO_PASS_THROUGH_MOB" = AMMO_PASS_THROUGH_MOB,
"AMMO_SOUND_PITCH" = AMMO_SOUND_PITCH
"AMMO_SOUND_PITCH" = AMMO_SOUND_PITCH,
"AMMO_SNIPER" = AMMO_SNIPER,
),
"attach_features_flags" = list(
"ATTACH_REMOVABLE" = ATTACH_REMOVABLE,
Expand Down
4 changes: 4 additions & 0 deletions code/datums/status_effects/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -922,3 +922,7 @@
// ***************************************
/datum/status_effect/incapacitating/dancer_tagged
id = "dancer_tagged"

// Recently sniped status effect, applied when hit by a sniper round
/datum/status_effect/incapacitating/recently_sniped
id = "sniped"
12 changes: 8 additions & 4 deletions code/modules/mob/living/status_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@

///How many deciseconds remain in our irradiated status effect
/mob/living/proc/amount_irradiated()
var/datum/status_effect/incapacitating/irradiated/irradiated = is_irradiated(FALSE)
var/datum/status_effect/incapacitating/irradiated/irradiated = is_irradiated()
if(irradiated)
return irradiated.duration - world.time
return 0
Expand All @@ -899,7 +899,7 @@
/mob/living/proc/irradiate(amount, ignore_canstun = FALSE) //Can't go below remaining duration
if(status_flags & GODMODE)
return
var/datum/status_effect/incapacitating/irradiated/irradiated = is_irradiated(FALSE)
var/datum/status_effect/incapacitating/irradiated/irradiated = is_irradiated()
if(irradiated)
irradiated.duration = max(world.time + amount, irradiated.duration)
else if(amount > 0)
Expand All @@ -910,7 +910,7 @@
/mob/living/proc/set_radiation(amount, ignore_canstun = FALSE)
if(status_flags & GODMODE)
return
var/datum/status_effect/incapacitating/irradiated/irradiated = is_irradiated(FALSE)
var/datum/status_effect/incapacitating/irradiated/irradiated = is_irradiated()
if(amount <= 0)
if(irradiated)
qdel(irradiated)
Expand All @@ -925,9 +925,13 @@
/mob/living/proc/adjust_radiation(amount, ignore_canstun = FALSE)
if(status_flags & GODMODE)
return
var/datum/status_effect/incapacitating/irradiated/irradiated = is_irradiated(FALSE)
var/datum/status_effect/incapacitating/irradiated/irradiated = is_irradiated()
if(irradiated)
irradiated.duration += amount
else if(amount > 0)
irradiated = apply_status_effect(STATUS_EFFECT_IRRADIATED, amount)
return irradiated

///Returns whether the mob has been recently hit by a sniper round
/mob/living/proc/is_recently_sniped()
return has_status_effect(STATUS_EFFECT_SNIPED)
2 changes: 1 addition & 1 deletion code/modules/projectiles/ammo_types/ags_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
handful_amount = 1
ping = null //no bounce off.
sound_bounce = SFX_ROCKET_BOUNCE
ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_SNIPER
ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_BETTER_COVER_RNG
armor_type = BOMB
damage_falloff = 0.5
shell_speed = 2
Expand Down
10 changes: 5 additions & 5 deletions code/modules/projectiles/ammo_types/energy_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
damage = 60
penetration = 30
accurate_range_min = 5
ammo_behavior_flags = AMMO_ENERGY|AMMO_HITSCAN|AMMO_SNIPER
ammo_behavior_flags = AMMO_ENERGY|AMMO_HITSCAN|AMMO_BETTER_COVER_RNG
sundering = 5
max_range = 40
damage_falloff = 0
Expand All @@ -367,7 +367,7 @@
damage = 40
penetration = 10
accurate_range_min = 5
ammo_behavior_flags = AMMO_ENERGY|AMMO_INCENDIARY|AMMO_HITSCAN|AMMO_SNIPER
ammo_behavior_flags = AMMO_ENERGY|AMMO_INCENDIARY|AMMO_HITSCAN|AMMO_BETTER_COVER_RNG
sundering = 1
hitscan_effect_icon = "u_laser_beam"
bullet_color = COLOR_DISABLER_BLUE
Expand Down Expand Up @@ -402,7 +402,7 @@
hud_state = "laser_disabler"
damage = 100
penetration = 30
ammo_behavior_flags = AMMO_ENERGY|AMMO_HITSCAN|AMMO_SNIPER
ammo_behavior_flags = AMMO_ENERGY|AMMO_HITSCAN|AMMO_BETTER_COVER_RNG
sundering = 1
hitscan_effect_icon = "u_laser_beam"
bonus_projectiles_scatter = 0
Expand Down Expand Up @@ -486,7 +486,7 @@
hitscan_effect_icon = "xray_beam"

/datum/ammo/energy/lasgun/marine/heavy_laser
ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_SNIPER|AMMO_ENERGY|AMMO_HITSCAN|AMMO_INCENDIARY
ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_BETTER_COVER_RNG|AMMO_ENERGY|AMMO_HITSCAN|AMMO_INCENDIARY
hud_state = "laser_overcharge"
damage = 60
penetration = 10
Expand Down Expand Up @@ -750,7 +750,7 @@
hitscan_effect_icon = "particle_lance"
hud_state = "plasma_blast"
hud_state_empty = "battery_empty_flash"
ammo_behavior_flags = AMMO_ENERGY|AMMO_HITSCAN|AMMO_PASS_THROUGH_MOVABLE|AMMO_SNIPER
ammo_behavior_flags = AMMO_ENERGY|AMMO_HITSCAN|AMMO_PASS_THROUGH_MOVABLE|AMMO_BETTER_COVER_RNG
bullet_color = LIGHT_COLOR_PURPLE_PINK
armor_type = ENERGY
max_range = 40
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/ammo_types/heavy_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
damage = 30
penetration = 35
sundering = 1
ammo_behavior_flags = AMMO_BALLISTIC|AMMO_SNIPER
ammo_behavior_flags = AMMO_BALLISTIC|AMMO_BETTER_COVER_RNG
damage_falloff = 1
accurate_range = 7
accuracy = 10
Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/ammo_types/mech_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

/datum/ammo/bullet/sniper/mech
name = "light anti-tank bullet"
ammo_behavior_flags = AMMO_BALLISTIC|AMMO_SNIPER
ammo_behavior_flags = AMMO_BALLISTIC|AMMO_BETTER_COVER_RNG|AMMO_SNIPER
damage = 100
penetration = 35
sundering = 0
Expand Down Expand Up @@ -135,7 +135,7 @@

/datum/ammo/energy/lasgun/marine/mech/lance_strike
name = "particle lance"
ammo_behavior_flags = AMMO_ENERGY|AMMO_SNIPER|AMMO_HITSCAN|AMMO_PASS_THROUGH_MOVABLE|AMMO_PASS_THROUGH_MOB
ammo_behavior_flags = AMMO_ENERGY|AMMO_BETTER_COVER_RNG|AMMO_HITSCAN|AMMO_PASS_THROUGH_MOVABLE|AMMO_PASS_THROUGH_MOB
damage_type = BRUTE
damage = 100
armor_type = MELEE
Expand Down
4 changes: 3 additions & 1 deletion code/modules/projectiles/ammo_types/rifle_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
hud_state = "hivelo"
hud_state_empty = "hivelo_empty"
damage_falloff = 0.5
ammo_behavior_flags = AMMO_BALLISTIC
ammo_behavior_flags = AMMO_BALLISTIC|AMMO_SNIPER
accurate_range = 25
max_range = 40
damage = 65
Expand All @@ -124,6 +124,7 @@
/datum/ammo/bullet/rifle/garand
name = "heavy marksman bullet"
hud_state = "sniper"
ammo_behavior_flags = AMMO_BALLISTIC|AMMO_SNIPER
damage = 75
penetration = 25
sundering = 1.25
Expand All @@ -140,6 +141,7 @@
/datum/ammo/bullet/rifle/icc_confrontationrifle
name = "armor-piercing heavy rifle bullet"
hud_state = "rifle_ap"
ammo_behavior_flags = AMMO_BALLISTIC|AMMO_SNIPER
damage = 50
penetration = 40
sundering = 3.5
Loading
Loading