diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm
index 5bee6f32e4a..f367879cae3 100644
--- a/code/game/objects/structures/displaycase.dm
+++ b/code/game/objects/structures/displaycase.dm
@@ -9,13 +9,22 @@
armor = list(MELEE = 30, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 10, RAD = 0, FIRE = 70, ACID = 100)
max_integrity = 200
integrity_failure = 50
- var/obj/item/showpiece = null
- var/alert = FALSE //Basic display cases have no alarms
+ /// The object stored inside.
+ var/obj/item/showpiece
+ /// If true, this is alarmed and will set off a siren when opened without proper access.
+ var/alert = FALSE
+ /// If this is currently unlocked
var/open = FALSE
+ /// If false, this can never be opened, and the item inside should be inaccessible. Good for showcases.
var/openable = TRUE
+ /// The electronics currently installed in this showpiece.
var/obj/item/airlock_electronics/electronics
- var/start_showpiece_type = null //add type for items on display
- var/list/start_showpieces = list() //Takes sublists in the form of list("type" = /obj/item/bikehorn, "trophy_message" = "henk")
+ /// The type that should be instantiated to fill the showpiece.
+ var/start_showpiece_type
+ /// A list of random items that could possibly fill the case, as well as a flavor message for them.
+ /// Takes sublists in the form of list("type" = /obj/item/bikehorn, "trophy_message" = "henk")
+ var/list/start_showpieces = list()
+ /// A flavor message to show with this item.
var/trophy_message = ""
/obj/structure/displaycase/Initialize(mapload)
@@ -46,18 +55,29 @@
/obj/structure/displaycase/examine(mob/user)
. = ..()
- if(alert)
- . += "Hooked up with an anti-theft system."
- if(emagged)
- . += "The ID lock has been shorted out."
if(showpiece)
- . += "There's [showpiece] inside."
+ . += "There's \a [showpiece] displayed inside."
+ else
+ . += "It's empty."
if(trophy_message)
. += "The plaque reads:\n [trophy_message]"
+ if(!openable)
+ . += "It seems to be sealed shut, there's no way you're getting that open."
+ else
+ if(!open)
+ . += "The ID lock is active, you need to swipe an ID to open it."
+ else if((broken || open) && showpiece)
+ . += "[showpiece] is held in a loose low gravity suspension field. You can take [showpiece] out[broken ? "." : ", or lock [src] with an ID"]."
-/obj/structure/displaycase/proc/dump()
+ if(alert)
+ . += "It is hooked up with an anti-theft system."
+ if(emagged)
+ . += "The ID lock has been shorted out."
+
+/obj/structure/displaycase/proc/dump(mob/user)
if(showpiece)
- showpiece.forceMove(loc)
+ if(!user || !user.put_in_hands(showpiece))
+ showpiece.forceMove(loc)
showpiece = null
/obj/structure/displaycase/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
@@ -109,9 +129,15 @@
. += "glassbox_closed"
/obj/structure/displaycase/attackby(obj/item/I, mob/user, params)
- if(I.GetID() && !broken && openable)
+ if(I.GetID())
+ if(!openable)
+ to_chat(user, "There is no ID scanner, looks like this one is sealed shut.")
+ return
+ if(broken)
+ to_chat(user, "[src] is broken, the ID lock won't do anything.")
+ return
if(allowed(user) || emagged)
- to_chat(user, "You [open ? "close":"open"] [src].")
+ to_chat(user, "You use [I] to [open ? "close" : "open"] [src].")
toggle_lock()
else
to_chat(user, "Access denied.")
@@ -181,17 +207,19 @@
user.changeNext_move(CLICK_CD_MELEE)
if(showpiece && (broken || open))
to_chat(user, "You deactivate the hover field built into the case.")
- dump()
+ dump(user)
add_fingerprint(user)
update_icon(UPDATE_OVERLAYS)
return
- else
- //prevents remote "kicks" with TK
- if(!Adjacent(user))
- return
- user.visible_message("[user] kicks the display case.")
- user.do_attack_animation(src, ATTACK_EFFECT_KICK)
- take_damage(2)
+ if(!open && openable)
+ to_chat(user, "The ID lock is active, you'll need to unlock it first.")
+ return
+ //prevents remote "kicks" with TK
+ if(!Adjacent(user))
+ return
+ user.visible_message("[user] kicks the display case.")
+ user.do_attack_animation(src, ATTACK_EFFECT_KICK)
+ take_damage(2)
/obj/structure/displaycase_chassis
anchored = TRUE
@@ -205,9 +233,9 @@
/obj/structure/displaycase_chassis/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/airlock_electronics))
to_chat(user, "You start installing the electronics into [src]...")
- playsound(loc, I.usesound, 50, 1)
+ playsound(loc, I.usesound, 50, TRUE)
if(do_after(user, 30, target = src))
- var/obj/item/airlock_electronics/new_electronics = I
+ var/obj/item/airlock_electronics/new_electronics = I
if(user.drop_item() && !new_electronics.is_installed)
new_electronics.forceMove(src)
electronics = new_electronics