From 1aaf21987ee55f5069c89f51db0d087a6bafa3dc Mon Sep 17 00:00:00 2001 From: ivanmixo Date: Fri, 1 Nov 2024 23:02:00 +0100 Subject: [PATCH 1/2] Adds a status effect to try to mitigate sniper stacking --- code/__DEFINES/conflict.dm | 4 +- code/__DEFINES/status_effects.dm | 2 + code/_globalvars/bitfields.dm | 5 +- code/datums/status_effects/debuffs.dm | 4 ++ code/modules/mob/living/status_procs.dm | 12 ++-- .../projectiles/ammo_types/ags_ammo.dm | 2 +- .../projectiles/ammo_types/energy_ammo.dm | 10 ++-- .../projectiles/ammo_types/heavy_ammo.dm | 2 +- .../projectiles/ammo_types/mech_ammo.dm | 4 +- .../projectiles/ammo_types/rifle_ammo.dm | 6 +- .../projectiles/ammo_types/rocket_ammo.dm | 58 +++++++++---------- .../projectiles/ammo_types/sniper_ammo.dm | 12 ++-- .../projectiles/ammo_types/tx54_ammo.dm | 4 +- .../ammo_types/xenos/energy_xenoammo.dm | 2 +- code/modules/projectiles/projectile.dm | 17 +++++- 15 files changed, 87 insertions(+), 57 deletions(-) diff --git a/code/__DEFINES/conflict.dm b/code/__DEFINES/conflict.dm index df144c3007344..82b9afac523d5 100644 --- a/code/__DEFINES/conflict.dm +++ b/code/__DEFINES/conflict.dm @@ -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 @@ -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 diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index 64fb57c8ba1af..78d4d6a15d0ec 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -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 // diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index a4386432b0da5..0f14abaf827b7 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -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, @@ -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, diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 7b89a51b59884..9b551bf64f289 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -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" diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 11ec9b77c9c4a..410f28cd1b954 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -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 @@ -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) @@ -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) @@ -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) diff --git a/code/modules/projectiles/ammo_types/ags_ammo.dm b/code/modules/projectiles/ammo_types/ags_ammo.dm index ded3d07fbf8b5..75b5c7ebedf46 100644 --- a/code/modules/projectiles/ammo_types/ags_ammo.dm +++ b/code/modules/projectiles/ammo_types/ags_ammo.dm @@ -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 diff --git a/code/modules/projectiles/ammo_types/energy_ammo.dm b/code/modules/projectiles/ammo_types/energy_ammo.dm index 7d3f0846a57ec..c0f3f946b0761 100644 --- a/code/modules/projectiles/ammo_types/energy_ammo.dm +++ b/code/modules/projectiles/ammo_types/energy_ammo.dm @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/code/modules/projectiles/ammo_types/heavy_ammo.dm b/code/modules/projectiles/ammo_types/heavy_ammo.dm index 7b944a31ba677..2d92dc0879d57 100644 --- a/code/modules/projectiles/ammo_types/heavy_ammo.dm +++ b/code/modules/projectiles/ammo_types/heavy_ammo.dm @@ -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 diff --git a/code/modules/projectiles/ammo_types/mech_ammo.dm b/code/modules/projectiles/ammo_types/mech_ammo.dm index f9dfb1261aaa5..05e6ce2a92ca0 100644 --- a/code/modules/projectiles/ammo_types/mech_ammo.dm +++ b/code/modules/projectiles/ammo_types/mech_ammo.dm @@ -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 @@ -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 diff --git a/code/modules/projectiles/ammo_types/rifle_ammo.dm b/code/modules/projectiles/ammo_types/rifle_ammo.dm index 48d3eeb16c357..86c5e8267c80a 100644 --- a/code/modules/projectiles/ammo_types/rifle_ammo.dm +++ b/code/modules/projectiles/ammo_types/rifle_ammo.dm @@ -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 @@ -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 @@ -132,7 +133,7 @@ name = "light marksman bullet" hud_state = "hivelo" hud_state_empty = "hivelo_empty" - ammo_behavior_flags = AMMO_BALLISTIC + ammo_behavior_flags = AMMO_BALLISTIC|AMMO_SNIPER penetration = 15 damage = 32.5 sundering = 1.25 @@ -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 diff --git a/code/modules/projectiles/ammo_types/rocket_ammo.dm b/code/modules/projectiles/ammo_types/rocket_ammo.dm index dffc3766391ea..589e983e918f3 100644 --- a/code/modules/projectiles/ammo_types/rocket_ammo.dm +++ b/code/modules/projectiles/ammo_types/rocket_ammo.dm @@ -11,7 +11,7 @@ hud_state_empty = "rocket_empty" 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 shell_speed = 2 @@ -51,7 +51,7 @@ /datum/ammo/rocket/he/unguided damage = 100 - ammo_behavior_flags = AMMO_SNIPER // We want this one to specifically go over onscreen range. + ammo_behavior_flags = AMMO_BETTER_COVER_RNG // We want this one to specifically go over onscreen range. /datum/ammo/rocket/he/unguided/drop_nade(turf/T) explosion(T, 0, 7, 0, 0, 2) @@ -71,7 +71,7 @@ /datum/ammo/rocket/ltb name = "cannon round" icon_state = "ltb" - ammo_behavior_flags = AMMO_SNIPER + ammo_behavior_flags = AMMO_BETTER_COVER_RNG accurate_range = 15 max_range = 40 penetration = 50 @@ -96,7 +96,7 @@ icon_state = "heavyrr" hud_state = "bigshell_he" hud_state_empty = "shell_empty" - ammo_behavior_flags = AMMO_SNIPER|AMMO_TARGET_TURF + ammo_behavior_flags = AMMO_BETTER_COVER_RNG|AMMO_TARGET_TURF damage = 100 penetration = 200 max_range = 30 @@ -109,7 +109,7 @@ /datum/ammo/rocket/heavy_isg/unguided hud_state = "bigshell_he_unguided" - ammo_behavior_flags = AMMO_SNIPER + ammo_behavior_flags = AMMO_BETTER_COVER_RNG /datum/ammo/bullet/heavy_isg_apfds name = "8.8cm APFDS round" @@ -136,7 +136,7 @@ name = "white phosphorous rocket" icon_state = "rocket_wp" hud_state = "rocket_fire" - ammo_behavior_flags = AMMO_SNIPER|AMMO_INCENDIARY|AMMO_TARGET_TURF + ammo_behavior_flags = AMMO_BETTER_COVER_RNG|AMMO_INCENDIARY|AMMO_TARGET_TURF armor_type = FIRE damage_type = BURN accuracy_var_low = 7 @@ -157,7 +157,7 @@ /datum/ammo/rocket/wp/quad name = "thermobaric rocket" hud_state = "rocket_thermobaric" - ammo_behavior_flags = AMMO_SNIPER + ammo_behavior_flags = AMMO_BETTER_COVER_RNG damage = 40 penetration = 25 max_range = 30 @@ -182,13 +182,13 @@ name = "white phosphorous RPG" hud_state = "rpg_fire" icon_state = "rpg_incendiary" - ammo_behavior_flags = AMMO_SNIPER + ammo_behavior_flags = AMMO_BETTER_COVER_RNG effect_radius = 5 /datum/ammo/rocket/wp/quad/ds name = "super thermobaric rocket" hud_state = "rocket_thermobaric" - ammo_behavior_flags = AMMO_SNIPER + ammo_behavior_flags = AMMO_BETTER_COVER_RNG damage = 200 penetration = 75 max_range = 30 @@ -196,7 +196,7 @@ /datum/ammo/rocket/wp/unguided damage = 100 - ammo_behavior_flags = AMMO_SNIPER|AMMO_INCENDIARY + ammo_behavior_flags = AMMO_BETTER_COVER_RNG|AMMO_INCENDIARY effect_radius = 5 /datum/ammo/rocket/recoilless @@ -204,7 +204,7 @@ icon_state = "recoilless_rifle_he" hud_state = "shell_he" hud_state_empty = "shell_empty" - ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_SNIPER + ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_BETTER_COVER_RNG armor_type = BOMB damage_falloff = 0 shell_speed = 2 @@ -221,7 +221,7 @@ name = "HEAT shell" icon_state = "recoilless_rifle_heat" hud_state = "shell_heat" - ammo_behavior_flags = AMMO_SNIPER + ammo_behavior_flags = AMMO_BETTER_COVER_RNG damage = 200 penetration = 100 sundering = 0 @@ -233,7 +233,7 @@ name = "HEAM shell" accuracy = -10 //Not designed for anti human use scatter = 16 - ammo_behavior_flags = AMMO_SNIPER|AMMO_UNWIELDY + ammo_behavior_flags = AMMO_BETTER_COVER_RNG|AMMO_UNWIELDY /datum/ammo/rocket/recoilless/heat/mech/on_hit_obj(obj/target_obj, obj/projectile/proj) drop_nade(get_turf(target_obj)) @@ -247,7 +247,7 @@ name = "light explosive shell" icon_state = "recoilless_rifle_le" hud_state = "shell_le" - ammo_behavior_flags = AMMO_SNIPER //We want this to specifically go farther than onscreen range. + ammo_behavior_flags = AMMO_BETTER_COVER_RNG //We want this to specifically go farther than onscreen range. accurate_range = 15 max_range = 20 damage = 75 @@ -261,7 +261,7 @@ name = "low velocity chemical shell" icon_state = "recoilless_rifle_smoke" hud_state = "shell_le" - ammo_behavior_flags = AMMO_SNIPER + ammo_behavior_flags = AMMO_BETTER_COVER_RNG accurate_range = 21 max_range = 21 damage = 10 @@ -301,7 +301,7 @@ name = "low impact explosive shell" icon_state = "recoilless_rifle_le" hud_state = "shell_le" - ammo_behavior_flags = AMMO_SNIPER //We want this to specifically go farther than onscreen range. + ammo_behavior_flags = AMMO_BETTER_COVER_RNG //We want this to specifically go farther than onscreen range. accurate_range = 15 max_range = 20 damage = 75 @@ -322,7 +322,7 @@ name = "high explosive RPG" icon_state = "rpg_he" hud_state = "rpg_he" - ammo_behavior_flags = AMMO_SNIPER + ammo_behavior_flags = AMMO_BETTER_COVER_RNG accurate_range = 15 max_range = 20 damage = 80 @@ -336,7 +336,7 @@ name = "low impact RPG" icon_state = "rpg_le" hud_state = "rpg_le" - ammo_behavior_flags = AMMO_SNIPER + ammo_behavior_flags = AMMO_BETTER_COVER_RNG accurate_range = 15 damage = 60 penetration = 10 @@ -362,7 +362,7 @@ sundering = 0 accuracy = -10 //Not designed for anti human use scatter = 7 - ammo_behavior_flags = AMMO_SNIPER|AMMO_UNWIELDY + ammo_behavior_flags = AMMO_BETTER_COVER_RNG|AMMO_UNWIELDY /datum/ammo/rocket/som/heat/on_hit_obj(obj/target_obj, obj/projectile/proj) drop_nade(get_turf(target_obj)) @@ -412,7 +412,7 @@ icon_state = "atgun" hud_state = "shell_heat" hud_state_empty = "shell_empty" - ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_SNIPER|AMMO_PASS_THROUGH_TURF + ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_BETTER_COVER_RNG|AMMO_PASS_THROUGH_TURF shell_speed = 2 damage = 90 penetration = 30 @@ -452,7 +452,7 @@ /datum/ammo/rocket/atgun_shell/he name = "low velocity high explosive shell" hud_state = "shell_he" - ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_SNIPER + ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_BETTER_COVER_RNG damage = 50 penetration = 50 sundering = 35 @@ -466,7 +466,7 @@ /datum/ammo/rocket/atgun_shell/beehive name = "beehive shell" hud_state = "shell_le" - ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_SNIPER + ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_BETTER_COVER_RNG shell_speed = 3 damage = 30 penetration = 30 @@ -503,7 +503,7 @@ /datum/ammo/rocket/atgun_shell/beehive/incend name = "napalm shell" hud_state = "shell_heat" - ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_SNIPER + ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_BETTER_COVER_RNG shell_speed = 3 bonus_projectiles_type = /datum/ammo/bullet/atgun_spread/incendiary @@ -511,7 +511,7 @@ name = "8.8cm APFDS round" icon_state = "apfds" hud_state = "bigshell_apfds" - ammo_behavior_flags = AMMO_BALLISTIC|AMMO_SNIPER|AMMO_PASS_THROUGH_TURF|AMMO_PASS_THROUGH_MOVABLE + ammo_behavior_flags = AMMO_BALLISTIC|AMMO_BETTER_COVER_RNG|AMMO_PASS_THROUGH_TURF|AMMO_PASS_THROUGH_MOVABLE damage = 300 penetration = 75 shell_speed = 4 @@ -540,7 +540,7 @@ damage = 0 penetration = 0 max_range = 20 - ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_SNIPER|AMMO_SPECIAL_PROCESS + ammo_behavior_flags = AMMO_TARGET_TURF|AMMO_BETTER_COVER_RNG|AMMO_SPECIAL_PROCESS shell_speed = 0.3 ///If the projectile is pointing at the target with a variance of this number, we don't readjust the angle var/angle_precision = 5 @@ -568,7 +568,7 @@ icon_state = "tank_coilgun" hud_state = "rocket_ap" hud_state_empty = "rocket_empty" - ammo_behavior_flags = AMMO_SNIPER + ammo_behavior_flags = AMMO_BETTER_COVER_RNG armor_type = BULLET damage_falloff = 2 shell_speed = 3 @@ -602,7 +602,7 @@ damage = 450 penetration = 70 sundering = 20 - ammo_behavior_flags = AMMO_SNIPER|AMMO_PASS_THROUGH_MOB + ammo_behavior_flags = AMMO_BETTER_COVER_RNG|AMMO_PASS_THROUGH_MOB /datum/ammo/rocket/coilgun/high/drop_nade(turf/T) explosion(T, 1, 4, 5, 6, 2) @@ -618,7 +618,7 @@ name = "Low Velocity HEAT shell" icon_state = "recoilless_rifle_heat" hud_state = "shell_heat" - ammo_behavior_flags = AMMO_SNIPER + ammo_behavior_flags = AMMO_BETTER_COVER_RNG shell_speed = 1 damage = 180 penetration = 100 @@ -632,7 +632,7 @@ damage = 50 penetration = 100 sundering = 10 - ammo_behavior_flags = AMMO_SNIPER // We want this to specifically go over onscreen range. + ammo_behavior_flags = AMMO_BETTER_COVER_RNG // We want this to specifically go over onscreen range. shell_speed = 1 /datum/ammo/rocket/icc_lowvel_high_explosive/drop_nade(turf/T) diff --git a/code/modules/projectiles/ammo_types/sniper_ammo.dm b/code/modules/projectiles/ammo_types/sniper_ammo.dm index 06913cbd9b518..3ada2feda5a13 100644 --- a/code/modules/projectiles/ammo_types/sniper_ammo.dm +++ b/code/modules/projectiles/ammo_types/sniper_ammo.dm @@ -9,7 +9,7 @@ hud_state = "sniper" hud_state_empty = "sniper_empty" damage_falloff = 0 - ammo_behavior_flags = AMMO_BALLISTIC|AMMO_SNIPER + ammo_behavior_flags = AMMO_BALLISTIC|AMMO_BETTER_COVER_RNG|AMMO_SNIPER accurate_range_min = 7 shell_speed = 4 accurate_range = 30 @@ -23,7 +23,7 @@ hud_state = "sniper_fire" accuracy = 0 damage_type = BURN - ammo_behavior_flags = AMMO_BALLISTIC|AMMO_INCENDIARY|AMMO_SNIPER + ammo_behavior_flags = AMMO_BALLISTIC|AMMO_INCENDIARY|AMMO_BETTER_COVER_RNG|AMMO_SNIPER accuracy_var_high = 7 max_range = 20 damage = 70 @@ -81,7 +81,7 @@ /datum/ammo/bullet/sniper/pfc name = "high caliber rifle bullet" hud_state = "sniper_heavy" - ammo_behavior_flags = AMMO_BALLISTIC|AMMO_SNIPER + ammo_behavior_flags = AMMO_BALLISTIC|AMMO_BETTER_COVER_RNG|AMMO_SNIPER damage = 80 penetration = 30 sundering = 7.5 @@ -90,7 +90,7 @@ /datum/ammo/bullet/sniper/pfc/flak name = "high caliber flak rifle bullet" hud_state = "sniper_heavy_flak" - ammo_behavior_flags = AMMO_BALLISTIC|AMMO_SNIPER + ammo_behavior_flags = AMMO_BALLISTIC|AMMO_BETTER_COVER_RNG|AMMO_SNIPER damage = 40 penetration = 10 sundering = 10 @@ -103,7 +103,7 @@ /datum/ammo/bullet/sniper/auto name = "low velocity high caliber rifle bullet" hud_state = "sniper_auto" - ammo_behavior_flags = AMMO_BALLISTIC|AMMO_SNIPER + ammo_behavior_flags = AMMO_BALLISTIC|AMMO_BETTER_COVER_RNG|AMMO_SNIPER damage = 50 penetration = 30 sundering = 2 @@ -112,7 +112,7 @@ /datum/ammo/bullet/sniper/clf_heavyrifle name = "high velocity incendiary sniper bullet" handful_icon_state = "ptrs" - ammo_behavior_flags = AMMO_BALLISTIC|AMMO_INCENDIARY|AMMO_SNIPER + ammo_behavior_flags = AMMO_BALLISTIC|AMMO_INCENDIARY|AMMO_BETTER_COVER_RNG|AMMO_SNIPER hud_state = "sniper_fire" accurate_range_min = 4 shell_speed = 5 diff --git a/code/modules/projectiles/ammo_types/tx54_ammo.dm b/code/modules/projectiles/ammo_types/tx54_ammo.dm index ca70a6c96d91b..a5a0690797d4b 100644 --- a/code/modules/projectiles/ammo_types/tx54_ammo.dm +++ b/code/modules/projectiles/ammo_types/tx54_ammo.dm @@ -13,7 +13,7 @@ handful_amount = 3 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 @@ -235,7 +235,7 @@ icon_state = "cannister_shot" damage = 30 penetration = 0 - ammo_behavior_flags = AMMO_SNIPER + ammo_behavior_flags = AMMO_BETTER_COVER_RNG damage_falloff = 0.5 max_range = 3 projectile_greyscale_colors = "#4f0303" diff --git a/code/modules/projectiles/ammo_types/xenos/energy_xenoammo.dm b/code/modules/projectiles/ammo_types/xenos/energy_xenoammo.dm index 63c353cffb4c2..d1e6b8e2db724 100644 --- a/code/modules/projectiles/ammo_types/xenos/energy_xenoammo.dm +++ b/code/modules/projectiles/ammo_types/xenos/energy_xenoammo.dm @@ -15,7 +15,7 @@ /datum/ammo/energy/xeno/psy_blast name = "psychic blast" - ammo_behavior_flags = AMMO_XENO|AMMO_TARGET_TURF|AMMO_SNIPER|AMMO_ENERGY|AMMO_HITSCAN|AMMO_SKIPS_ALIENS + ammo_behavior_flags = AMMO_XENO|AMMO_TARGET_TURF|AMMO_BETTER_COVER_RNG|AMMO_ENERGY|AMMO_HITSCAN|AMMO_SKIPS_ALIENS damage = 35 penetration = 10 sundering = 1 diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 0cf252e2a9685..9f8d524380cdd 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -678,7 +678,7 @@ So if we are on the 32th absolute pixel coordinate we are on tile 1, but if we a return FALSE //No effect now, but we save the reference to check on exiting the tile. if (uncrossing) return FALSE //you don't hit the cade from behind. - if(proj.ammo.ammo_behavior_flags & AMMO_SNIPER || proj.iff_signal) //sniper and IFF rounds are better at getting past cover + if(proj.ammo.ammo_behavior_flags & AMMO_BETTER_COVER_RNG || proj.iff_signal) //sniper and IFF rounds are better at getting past cover hit_chance *= 0.8 ///50% better protection when shooting from outside accurate range. if(proj.distance_travelled > proj.ammo.accurate_range) @@ -844,6 +844,21 @@ So if we are on the 32th absolute pixel coordinate we are on tile 1, but if we a return FALSE if(proj.ammo.ammo_behavior_flags & AMMO_SKIPS_ALIENS) return FALSE + if(proj.ammo.ammo_behavior_flags & AMMO_SNIPER) + var/datum/status_effect/incapacitating/recently_sniped/sniped = is_recently_sniped() + var/obj/item/weapon/gun/shooter = proj.shot_from + + if(!isgun(proj.shot_from)) + stack_trace("Got a non-gun projectile source while trying to apply sniper status effect! Source: [proj.shot_from]") + return ..() + + if(sniped) + proj.damage = proj.damage * 0.1 + ///The -1 is because we don't want to take away damage from guns firing on cooldown + sniped.duration = max(world.time + shooter.fire_delay - 1, sniped.duration) + return ..() + + apply_status_effect(STATUS_EFFECT_SNIPED, shooter.fire_delay) return ..() ///visual and audio feedback for hits From 3bb96b9efe764451b9a796adcdccb4fee5703bd2 Mon Sep 17 00:00:00 2001 From: ivanmixo Date: Fri, 1 Nov 2024 23:23:58 +0100 Subject: [PATCH 2/2] T64 doesn't have aim mode, so shouldn't be a problem --- code/modules/projectiles/ammo_types/rifle_ammo.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/projectiles/ammo_types/rifle_ammo.dm b/code/modules/projectiles/ammo_types/rifle_ammo.dm index 86c5e8267c80a..30ceede51ccc9 100644 --- a/code/modules/projectiles/ammo_types/rifle_ammo.dm +++ b/code/modules/projectiles/ammo_types/rifle_ammo.dm @@ -133,7 +133,7 @@ name = "light marksman bullet" hud_state = "hivelo" hud_state_empty = "hivelo_empty" - ammo_behavior_flags = AMMO_BALLISTIC|AMMO_SNIPER + ammo_behavior_flags = AMMO_BALLISTIC penetration = 15 damage = 32.5 sundering = 1.25