diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 04ef074a995..c3ec0cf18dc 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -583,6 +583,7 @@ GLOBAL_LIST_INIT(global_huds, list( var/atom/movable/screen/ammo/ammo_hud = new ammo_hud_list[G] = ammo_hud ammo_hud.screen_loc = ammo_hud.ammo_screen_loc_list[length(ammo_hud_list)] + ammo_hud.our_gun = WEAKREF(G) ammo_hud.add_hud(user, G) ammo_hud.update_hud(user, G) @@ -591,6 +592,7 @@ GLOBAL_LIST_INIT(global_huds, list( var/atom/movable/screen/ammo/ammo_hud = ammo_hud_list[G] if(isnull(ammo_hud)) return + ammo_hud.our_gun = null ammo_hud.remove_hud(user, G) qdel(ammo_hud) ammo_hud_list -= G diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 437d98841f8..8142c6c68ce 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -1009,6 +1009,21 @@ screen_loc = ui_ammo_hud1 var/warned = FALSE var/static/list/ammo_screen_loc_list = list(ui_ammo_hud1, ui_ammo_hud2, ui_ammo_hud3 ,ui_ammo_hud4) + var/datum/weakref/our_gun + +/atom/movable/screen/ammo/Click() + var/mob/user = usr + if(!user.checkClickCooldown()) + return TRUE + if(user.stat || user.paralysis || user.stunned || user.weakened) + return TRUE + if(istype(user.loc,/obj/mecha)) // stops inventory actions in a mech + return TRUE + var/obj/item/gun/gun = our_gun.resolve() + if(!gun) + return TRUE + gun.switch_firemodes(user) + return TRUE /atom/movable/screen/ammo/proc/add_hud(var/mob/living/user, var/obj/item/gun/G) diff --git a/code/modules/examine/descriptions/weapons.dm b/code/modules/examine/descriptions/weapons.dm index e1c2ebf0eff..383a7a8bab4 100644 --- a/code/modules/examine/descriptions/weapons.dm +++ b/code/modules/examine/descriptions/weapons.dm @@ -24,7 +24,8 @@ /obj/item/gun/energy/gun description_info = "This is an energy weapon. To fire the weapon, ensure your intent is *not* set to 'help', have your gun mode set to 'fire', \ then click where you want to fire. Most energy weapons can fire through windows harmlessly. To switch between stun and lethal, click the weapon \ - in your hand. To recharge this weapon, use a weapon recharger." + in your hand. To recharge this weapon, use a weapon recharger. \ + If the gun has multiple firemodes, you can cycle through them by clicking the ammo HUD in the top right of your screen." /obj/item/gun/energy/gun/taser description_info = "This is an energy weapon. To fire the weapon, ensure your intent is *not* set to 'help', have your gun mode set to 'fire', \ @@ -37,7 +38,8 @@ /obj/item/gun/energy/gun/nuclear description_info = "This is an energy weapon. To fire the weapon, ensure your intent is *not* set to 'help', have your gun mode set to 'fire', \ then click where you want to fire. Most energy weapons can fire through windows harmlessly. To switch between stun and lethal, click the weapon \ - in your hand. Unlike most weapons, this weapon recharges itself." + in your hand or by clicking the ammo HUD in the top right of your screen. \ + Unlike most weapons, this weapon recharges itself." /obj/item/gun/energy/captain description_info = "This is an energy weapon. To fire the weapon, ensure your intent is *not* set to 'help', have your gun mode set to 'fire', \ @@ -51,7 +53,8 @@ /obj/item/gun/projectile description_info = "This is a ballistic weapon. To fire the weapon, ensure your intent is *not* set to 'help', have your gun mode set to 'fire', \ then click where you want to fire. To reload, click the weapon in your hand to unload (if needed), then add the appropriate ammo. The description \ - will tell you what caliber you need." + will tell you what caliber you need. \ + If the gun has multiple firemodes, you can cycle through them by clicking the ammo HUD in the top right of your screen." /obj/item/gun/energy/chameleon description_info = null //The chameleon gun adopts the description_info of the weapon it is impersonating as, to make meta-ing harder. diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index 671f629b63e..618f10e354b 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -149,7 +149,6 @@ if(.) return TRUE var/turf/T = get_turf(user) - var/outdoors = T.is_outdoors() if(do_after(user, 1.5 SECONDS, target = user) && !QDELETED(src)) new /obj/structure/extraction_point(get_turf(user)) qdel(src)