From a796351020b983d5b9b9b79bd5a7f7eb72a7d28d Mon Sep 17 00:00:00 2001 From: BasilHerb Date: Fri, 22 Nov 2024 10:10:01 +1000 Subject: [PATCH] Harry's requested changes --- code/modules/projectiles/gun.dm | 2 +- code/modules/projectiles/guns/smartgun.dm | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 433a81941a6c..ba20b8578dd2 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -1686,7 +1686,7 @@ not all weapons use normal magazines etc. load_into_chamber() itself is designed projectile_to_fire.shot_from = src - return 1 + return TRUE //This proc calculates scatter and accuracy /obj/item/weapon/gun/proc/apply_bullet_scatter(obj/projectile/projectile_to_fire, mob/user, reflex = 0, dual_wield = 0) diff --git a/code/modules/projectiles/guns/smartgun.dm b/code/modules/projectiles/guns/smartgun.dm index e70a3d13c693..2f4e9459565c 100644 --- a/code/modules/projectiles/guns/smartgun.dm +++ b/code/modules/projectiles/guns/smartgun.dm @@ -39,10 +39,12 @@ var/datum/ammo/ammo_secondary //Toggled ammo type var/datum/ammo/ammo_primary_def = /datum/ammo/bullet/smartgun var/datum/ammo/ammo_secondary_def = /datum/ammo/bullet/smartgun/armor_piercing + //Frontline mode changes the SG to use 2 new bullet types (alt) for each variant of the SG so we can change falloff/damage/range parameters. var/datum/ammo/ammo_primary_alt = /datum/ammo/bullet/smartgun/alt var/datum/ammo/ammo_secondary_alt = /datum/ammo/bullet/smartgun/armor_piercing/alt var/iff_enabled = TRUE //Begin with the safety on. - var/frontline_enabled = FALSE //Begins with 'normal IFF' enabled (shoots through friendly marines, instead of Alt-IFF) + //This controls if frontline mode is enabled roundstart. E.g. var/frontline_enabled = FALSE means the SG starts with frontline mode disabled. + var/frontline_enabled = FALSE var/secondary_toggled = 0 //which ammo we use var/recoil_compensation = 0 var/accuracy_improvement = 0 @@ -301,7 +303,7 @@ /datum/action/item_action/smartgun/toggle_frontline_mode/action_activate() . = ..() var/obj/item/weapon/gun/smartgun/G = holder_item - G.toggle_frontline_mode(usr) + G.toggle_frontline_mode(owner) if(G.frontline_enabled) action_icon_state = "iff_toggle_off" else @@ -353,7 +355,7 @@ //more general procs /obj/item/weapon/gun/smartgun/proc/toggle_frontline_mode(mob/user) - to_chat(user, "[icon2html(src, usr)] You [frontline_enabled? "disable" : "enable"] \the [src]'s frontline mode. You will now [frontline_enabled ? "be able to shoot through friendlies" : "deal increased damage but be unable to shoot through friendlies"].") + to_chat(user, "[icon2html(src, user)] You [frontline_enabled? "disable" : "enable"] [src]'s frontline mode. You will now [frontline_enabled ? "be able to shoot through friendlies" : "deal increased damage but be unable to shoot through friendlies"].") balloon_alert(user, "frontline mode [frontline_enabled ? "disabled" : "enabled"]") playsound(loc,'sound/machines/click.ogg', 25, 1) frontline_enabled = !frontline_enabled @@ -385,7 +387,7 @@ /obj/item/weapon/gun/smartgun/proc/toggle_ammo_type(mob/user) secondary_toggled = !secondary_toggled - to_chat(user, "[icon2html(src, usr)] You changed \the [src]'s ammo preparation procedures. You now fire [secondary_toggled ? "armor piercing rounds" : "highly precise rounds"].") + to_chat(user, "[icon2html(src, user)] You changed [src]'s ammo preparation procedures. You now fire [secondary_toggled ? "armor piercing rounds" : "highly precise rounds"].") balloon_alert(user, "firing [secondary_toggled ? "armor piercing" : "highly precise"]") playsound(loc,'sound/machines/click.ogg', 25, 1) ammo = secondary_toggled ? ammo_secondary : ammo_primary