Skip to content

Commit

Permalink
updating to branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirshbia committed Mar 14, 2024
1 parent 1c3bbb9 commit f26359a
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions code/modules/projectiles/guns/smartgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
. = ..()
Expand Down Expand Up @@ -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? "<B>disable</b>" : "<B>enable</b>"] \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
Expand Down Expand Up @@ -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, ...)
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit f26359a

Please sign in to comment.