diff --git a/code/modules/projectiles/guns/smartgun.dm b/code/modules/projectiles/guns/smartgun.dm index 43fabbfd01..3e5e3718f5 100644 --- a/code/modules/projectiles/guns/smartgun.dm +++ b/code/modules/projectiles/guns/smartgun.dm @@ -34,14 +34,11 @@ ammo = /datum/ammo/bullet/smartgun actions_types = list( /datum/action/item_action/smartgun/toggle_accuracy_improvement, - /datum/action/item_action/smartgun/toggle_ammo_type, - ///datum/action/item_action/smartgun/toggle_auto_fire, + ///datum/action/item_action/smartgun/toggle_auto_fire, /datum/action/item_action/smartgun/toggle_lethal_mode, ///datum/action/item_action/smartgun/toggle_motion_detector, - /datum/action/item_action/smartgun/toggle_recoil_compensation, + ///datum/action/item_action/smartgun/toggle_recoil_compensation, ) - var/datum/ammo/ammo_primary = /datum/ammo/bullet/smartgun //Toggled ammo type - var/datum/ammo/ammo_secondary = /datum/ammo/bullet/smartgun/armor_piercing //Toggled ammo type var/iff_enabled = TRUE //Begin with the safety on. var/secondary_toggled = 0 //which ammo we use var/recoil_compensation = 0 @@ -74,16 +71,12 @@ /obj/item/weapon/gun/smartgun/Initialize(mapload, ...) - ammo_primary = GLOB.ammo_list[ammo_primary] //Gun initialize calls replace_ammo() so we need to set these first. - ammo_secondary = GLOB.ammo_list[ammo_secondary] MD = new(src) battery = new /obj/item/smartgun_battery(src) . = ..() update_icon() /obj/item/weapon/gun/smartgun/Destroy() - ammo_primary = null - ammo_secondary = null QDEL_NULL(MD) QDEL_NULL(battery) . = ..() @@ -344,20 +337,15 @@ secondary_toggled = !secondary_toggled to_chat(user, "[icon2html(src, usr)] You changed \the [src]'s ammo preparation procedures. You now fire [secondary_toggled ? "armor shredding rounds" : "highly precise rounds"].") playsound(loc,'sound/machines/click.ogg', 25, 1) - ammo = secondary_toggled ? ammo_secondary : ammo_primary - var/datum/action/item_action/smartgun/toggle_ammo_type/TAT = locate(/datum/action/item_action/smartgun/toggle_ammo_type) in actions - TAT.update_icon() + /obj/item/weapon/gun/smartgun/replace_ammo() ..() - ammo = secondary_toggled ? ammo_secondary : ammo_primary /obj/item/weapon/gun/smartgun/proc/toggle_lethal_mode(mob/user) to_chat(user, "[icon2html(src, usr)] You [iff_enabled? "disable" : "enable"] \the [src]'s fire restriction. You will [iff_enabled ? "harm anyone in your way" : "target through IFF"].") playsound(loc,'sound/machines/click.ogg', 25, 1) iff_enabled = !iff_enabled - ammo = ammo_primary - secondary_toggled = FALSE if(iff_enabled) add_bullet_trait(BULLET_TRAIT_ENTRY_ID("iff", /datum/element/bullet_trait_iff)) drain += 10 @@ -674,8 +662,6 @@ desc = "The actual firearm in the 4-piece M56D Smartgun System. If you have this, you're about to bring some serious pain to anyone in your way.\nYou may toggle firing restrictions by using a special action.\nAlt-click it to open the feed cover and allow for reloading." current_mag = /obj/item/ammo_magazine/smartgun/dirty ammo = /obj/item/ammo_magazine/smartgun/dirty - ammo_primary = /datum/ammo/bullet/smartgun/dirty//Toggled ammo type - ammo_secondary = /datum/ammo/bullet/smartgun/dirty/armor_piercing///Toggled ammo type flags_gun_features = GUN_WY_RESTRICTED|GUN_SPECIALIST|GUN_WIELDED_FIRING_ONLY /obj/item/weapon/gun/smartgun/dirty/Initialize(mapload, ...) @@ -749,8 +735,6 @@ desc = "The actual firearm in the 2-piece L56A2 Smartgun System. This Variant is used by the Three World Empires Royal Marines Commando units.\nYou may toggle firing restrictions by using a special action.\nAlt-click it to open the feed cover and allow for reloading." current_mag = /obj/item/ammo_magazine/smartgun/holo_targetting ammo = /obj/item/ammo_magazine/smartgun/holo_targetting - ammo_primary = /datum/ammo/bullet/smartgun/holo_target //Toggled ammo type - ammo_secondary = /datum/ammo/bullet/smartgun/holo_target/ap ///Toggled ammo type flags_gun_features = GUN_SPECIALIST|GUN_WIELDED_FIRING_ONLY icon = 'icons/obj/items/weapons/guns/guns_by_faction/twe_guns.dmi' icon_state = "magsg"