diff --git a/code/datums/ammo/bullet/special_ammo.dm b/code/datums/ammo/bullet/special_ammo.dm index 97c1bf5735f9..46473d84c0a7 100644 --- a/code/datums/ammo/bullet/special_ammo.dm +++ b/code/datums/ammo/bullet/special_ammo.dm @@ -24,6 +24,20 @@ penetration = ARMOR_PENETRATION_TIER_8 damage_armor_punch = 1 +/datum/ammo/bullet/smartgun/holo_target + name = "holo-targeting smartgun bullet" + damage = 15 + /// inflicts this many holo stacks per bullet hit + var/holo_stacks = 15 + /// modifies the default cap limit of 100 by this amount + var/bonus_damage_cap_increase = 0 + /// multiplies the default drain of 5 holo stacks per second by this amount + var/stack_loss_multiplier = 1 + +/datum/ammo/bullet/smartgun/holo_target/on_hit_mob(mob/hit_mob, obj/projectile/bullet) + . = ..() + hit_mob.AddComponent(/datum/component/bonus_damage_stack, holo_stacks, world.time, bonus_damage_cap_increase, stack_loss_multiplier) + /datum/ammo/bullet/smartgun/dirty name = "irradiated smartgun bullet" debilitate = list(0,0,0,3,0,0,0,1) @@ -43,21 +57,12 @@ penetration = ARMOR_PENETRATION_TIER_7 damage_armor_punch = 3 -/datum/ammo/bullet/smartgun/holo_target //Royal marines smartgun bullet has only diff between regular ammo is this one does holostacks +/datum/ammo/bullet/smartgun/holo_target/rmc //Royal marines smartgun bullet has only diff between regular ammo is this one does holostacks name = "holo-targeting smartgun bullet" damage = 30 - /// inflicts this many holo stacks per bullet hit - var/holo_stacks = 15 - /// modifies the default cap limit of 100 by this amount - var/bonus_damage_cap_increase = 0 - /// multiplies the default drain of 5 holo stacks per second by this amount - var/stack_loss_multiplier = 1 -/datum/ammo/bullet/smartgun/holo_target/on_hit_mob(mob/hit_mob, obj/projectile/bullet) - . = ..() - hit_mob.AddComponent(/datum/component/bonus_damage_stack, holo_stacks, world.time, bonus_damage_cap_increase, stack_loss_multiplier) -/datum/ammo/bullet/smartgun/holo_target/ap +/datum/ammo/bullet/smartgun/holo_target/rmc/ap name = "armor-piercing smartgun bullet" icon_state = "bullet" diff --git a/code/modules/projectiles/guns/smartgun.dm b/code/modules/projectiles/guns/smartgun.dm index 7c628463b1ef..41380df65065 100644 --- a/code/modules/projectiles/guns/smartgun.dm +++ b/code/modules/projectiles/guns/smartgun.dm @@ -36,8 +36,9 @@ ) 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/datum/ammo/ammo_tertiary = /datum/ammo/bullet/smartgun/holo_target //Toggled ammo type var/iff_enabled = TRUE //Begin with the safety on. - var/secondary_toggled = 0 //which ammo we use + var/ammo_selection = /datum/ammo/bullet/smartgun //which ammo we use var/recoil_compensation = 0 var/accuracy_improvement = 0 var/auto_fire = 0 @@ -70,6 +71,7 @@ /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] + ammo_tertiary = GLOB.ammo_list[ammo_tertiary] MD = new(src) battery = new /obj/item/smartgun_battery(src) . = ..() @@ -78,6 +80,7 @@ /obj/item/weapon/gun/smartgun/Destroy() ammo_primary = null ammo_secondary = null + ammo_tertiary = null QDEL_NULL(MD) QDEL_NULL(battery) . = ..() @@ -301,8 +304,10 @@ /datum/action/item_action/smartgun/toggle_ammo_type/proc/update_icon() var/obj/item/weapon/gun/smartgun/G = holder_item - if(G.secondary_toggled) + if(ammo_secondary) action_icon_state = "ammo_swap_ap" + else if(ammo_tertiary) + action_icon_state = "ammo_swap_holo" else action_icon_state = "ammo_swap_normal" button.overlays.Cut() @@ -337,24 +342,31 @@ if(!iff_enabled) to_chat(user, "[icon2html(src, usr)] Can't switch ammunition type when \the [src]'s fire restriction is disabled.") return - 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"].") - balloon_alert(user, "firing [secondary_toggled ? "armor shredding" : "highly precise"]") - 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() + if(ammo_secondary) + to_chat(user, "[icon2html(src, usr)] You changed \the [src]'s ammo preparation procedures. You now fire holo-targeting rounds.") + ammo_selection = ammo_tertiary + else if(ammo_tertiary) + to_chat(user, "[icon2html(src, usr)] You changed \the [src]'s ammo preparation procedures. You now fire highly precise rounds.") + ammo_selection = ammo_primary + else + to_chat(user, "[icon2html(src, usr)] You changed \the [src]'s ammo preparation procedures. You now fire armor shredding rounds.") + ammo_selection = ammo_secondary /obj/item/weapon/gun/smartgun/replace_ammo() ..() - ammo = secondary_toggled ? ammo_secondary : ammo_primary + if(ammo_secondary) + ammo_selection = ammo_secondary + else if(ammo_tertiary) + ammo_selection = ammo_tertiary + else + ammo_selection = 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 + ammo_selection = FALSE if(iff_enabled) add_bullet_trait(BULLET_TRAIT_ENTRY_ID("iff", /datum/element/bullet_trait_iff)) drain += 10 @@ -745,9 +757,9 @@ name = "\improper L56A2 smartgun" 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 + ammo = /obj/item/ammo_magazine/smartgun/holo_targetting/rmc + ammo_primary = /datum/ammo/bullet/smartgun/holo_target/rmc //Toggled ammo type + ammo_secondary = /datum/ammo/bullet/smartgun/holo_target/rmc/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" diff --git a/code/modules/projectiles/magazines/specialist.dm b/code/modules/projectiles/magazines/specialist.dm index 547d231e1c69..e3656d91ef30 100644 --- a/code/modules/projectiles/magazines/specialist.dm +++ b/code/modules/projectiles/magazines/specialist.dm @@ -107,11 +107,11 @@ default_ammo = /datum/ammo/bullet/smartgun/dirty gun_type = /obj/item/weapon/gun/smartgun/dirty -/obj/item/ammo_magazine/smartgun/holo_targetting +/obj/item/ammo_magazine/smartgun/holo_targetting/rmc name = "holotargetting smartgun drum" desc = "Holotargetting rounds for use in the royal marines commando L56A2 smartgun." icon_state = "m56_drum" - default_ammo = /datum/ammo/bullet/smartgun/holo_target + default_ammo = /datum/ammo/bullet/smartgun/holo_target/rmc gun_type = /obj/item/weapon/gun/smartgun/rmc //------------------------------------------------------- //Flare gun. Close enough? diff --git a/icons/mob/hud/actions.dmi b/icons/mob/hud/actions.dmi index 3c3e6dd9de3d..559fbb5573e3 100644 Binary files a/icons/mob/hud/actions.dmi and b/icons/mob/hud/actions.dmi differ