Skip to content

Commit

Permalink
Harry's requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
BasilHerb committed Nov 22, 2024
1 parent 3fb6ceb commit a796351
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 6 additions & 4 deletions code/modules/projectiles/guns/smartgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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? "<B>disable</b>" : "<B>enable</b>"] \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? "<B>disable</b>" : "<B>enable</b>"] [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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a796351

Please sign in to comment.