Fixes some shell box issues (#27166)

* Fixes some shell box issues

* Contra review

* Renaming
This commit is contained in:
DGamerL
2024-10-23 17:44:21 +00:00
committed by GitHub
parent b7f0987101
commit 766816954d
3 changed files with 24 additions and 5 deletions
@@ -712,6 +712,22 @@
/// What shell do we fill the box with
var/shell_type
/obj/item/storage/fancy/shell/fancy_storage_examine(mob/user)
. = list()
if(!length(contents))
. += "There are no shells in the box."
return
var/list/shell_list = list() // Associated list of all shells in the box
for(var/obj/item/ammo_casing/shotgun/shell as anything in contents)
shell_list[shell.name] += 1
for(var/thing as anything in shell_list)
if(shell_list[thing] == 1)
. += "There is one [thing] in the box."
else
. += "There are [shell_list[thing]] [thing]s in the box."
/obj/item/storage/fancy/shell/update_icon_state()
icon_state = "open"
@@ -778,7 +794,7 @@
/obj/item/storage/fancy/shell/holy
name = "ammunition box (Holy Water darts)"
desc = "A small box capable of holding seven shotgun shells."
icon_state = "hshell_box"
icon_state = "holybox"
shell_type = /obj/item/ammo_casing/shotgun/holy
////////////////
@@ -23,6 +23,10 @@
/obj/item/storage/fancy/examine(mob/user)
. = ..()
. += fancy_storage_examine(user)
/obj/item/storage/fancy/proc/fancy_storage_examine(mob/user)
. = list()
if(in_range(user, src))
var/len = LAZYLEN(contents)
if(len <= 0)