From 858ae650e2167d6a4ee6f9ef0d1c79c6948aa3f0 Mon Sep 17 00:00:00 2001
From: Gristlebee <56049844+Gristlebee@users.noreply.github.com>
Date: Wed, 19 Jun 2024 06:03:02 +0300
Subject: [PATCH] [MIRROR] Energy/Laser guns display their charge and how many
shots they have left on examine
---
code/modules/projectiles/guns/energy.dm | 30 +++++++++++++++----------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index 705789b3484a..122690fabf29 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -129,19 +129,19 @@
/obj/item/gun/energy/proc/insert_cell(mob/user, obj/item/stock_parts/cell/gun/C)
if(small_gun && !istype(C, /obj/item/stock_parts/cell/gun/mini))
- to_chat(user, "\The [C] doesn't seem to fit into \the [src]...")
+ to_chat(user, span_warning("\The [C] doesn't seem to fit into \the [src]..."))
return FALSE
if(!big_gun && istype(C, /obj/item/stock_parts/cell/gun/large))
- to_chat(user, "\The [C] doesn't seem to fit into \the [src]...")
+ to_chat(user, span_warning("\The [C] doesn't seem to fit into \the [src]..."))
return FALSE
if(user.transferItemToLoc(C, src))
cell = C
- to_chat(user, "You load the [C] into \the [src].")
+ to_chat(user, span_notice("You load the [C] into \the [src]."))
playsound(src, load_sound, sound_volume, load_sound_vary)
update_appearance()
return TRUE
else
- to_chat(user, "You cannot seem to get \the [src] out of your hands!")
+ to_chat(user, span_warning("You cannot seem to get \the [src] out of your hands!"))
return FALSE
/obj/item/gun/energy/proc/eject_cell(mob/user, obj/item/stock_parts/cell/gun/tac_load = null)
@@ -150,16 +150,16 @@
var/obj/item/stock_parts/cell/gun/old_cell = cell
old_cell.update_appearance()
cell = null
- to_chat(user, "You pull the cell out of \the [src].")
+ to_chat(user, span_notice("You pull the cell out of \the [src]."))
update_appearance()
if(tac_load && tac_reloads)
if(do_after(user, tactical_reload_delay, TRUE, src))
if(insert_cell(user, tac_load))
- to_chat(user, "You perform a tactical reload on \the [src].")
+ to_chat(user, span_notice("You perform a tactical reload on \the [src]."))
else
- to_chat(user, "You dropped the old cell, but the new one doesn't fit. How embarassing.")
+ to_chat(user, span_warning("You dropped the old cell, but the new one doesn't fit. How embarassing."))
else
- to_chat(user, "Your reload was interupted!")
+ to_chat(user, span_warning("Your reload was interupted!"))
return
user.put_in_hands(old_cell)
@@ -230,7 +230,7 @@
fire_sound = shot.fire_sound
fire_delay = shot.delay
if (shot.select_name)
- to_chat(user, "[src] is now set to [shot.select_name].")
+ to_chat(user, span_notice("[src] is now set to [shot.select_name]."))
chambered = null
playsound(user, 'sound/weapons/gun/general/selector.ogg', 100, TRUE)
recharge_newshot(TRUE)
@@ -308,13 +308,13 @@
if(!BB)
. = ""
else if(BB.nodamage || !BB.damage || BB.damage_type == STAMINA)
- user.visible_message("[user] tries to light [user.p_their()] [A.name] with [src], but it doesn't do anything. Dumbass.")
+ user.visible_message(span_danger("[user] tries to light [user.p_their()] [A.name] with [src], but it doesn't do anything. Dumbass."))
playsound(user, E.fire_sound, 50, TRUE)
playsound(user, BB.hitsound_non_living, 50, TRUE)
cell.use(E.e_cost)
. = ""
else if(BB.damage_type != BURN)
- user.visible_message("[user] tries to light [user.p_their()] [A.name] with [src], but only succeeds in utterly destroying it. Dumbass.")
+ user.visible_message(span_danger("[user] tries to light [user.p_their()] [A.name] with [src], but only succeeds in utterly destroying it. Dumbass."))
playsound(user, E.fire_sound, 50, TRUE)
playsound(user, BB.hitsound_non_living, 50, TRUE)
cell.use(E.e_cost)
@@ -324,10 +324,16 @@
playsound(user, E.fire_sound, 50, TRUE)
playsound(user, BB.hitsound_non_living, 50, TRUE)
cell.use(E.e_cost)
- . = "[user] casually lights their [A.name] with [src]. Damn."
+ . = span_danger("[user] casually lights their [A.name] with [src]. Damn.")
/obj/item/gun/energy/examine(mob/user)
. = ..()
+ var/obj/item/ammo_casing/energy/shot = ammo_type[select]
if(ammo_type.len > 1)
. += "You can switch firemodes by pressing the unqiue action key. By default, this is space"
+ if(cell)
+ . += "\The [name]'s cell has [cell.percent()]% charge remaining."
+ . += "\The [name] has [round(cell.charge/shot.e_cost)] shots remaining on [shot.select_name] mode."
+ else
+ . += span_notice("\The [name] doesn't seem to have a cell!")