mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 23:17:02 +01:00
Fixes some shell box issues (#27166)
* Fixes some shell box issues * Contra review * Renaming
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user