From 766816954d8cb3c655f6f9ad659417874c53d670 Mon Sep 17 00:00:00 2001 From: DGamerL <108773801+DGamerL@users.noreply.github.com> Date: Wed, 23 Oct 2024 19:44:21 +0200 Subject: [PATCH] Fixes some shell box issues (#27166) * Fixes some shell box issues * Contra review * Renaming --- .../objects/items/weapons/storage/boxes.dm | 18 +++++++++++++++++- .../objects/items/weapons/storage/fancy.dm | 4 ++++ .../projectiles/ammunition/ammo_casings.dm | 7 +++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index cb423ae1cad..7cc4a1f8f83 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -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 //////////////// diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm index 4d81698c757..a376cf0bf0a 100644 --- a/code/game/objects/items/weapons/storage/fancy.dm +++ b/code/game/objects/items/weapons/storage/fancy.dm @@ -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) diff --git a/code/modules/projectiles/ammunition/ammo_casings.dm b/code/modules/projectiles/ammunition/ammo_casings.dm index 20d383224e1..d35ae82d962 100644 --- a/code/modules/projectiles/ammunition/ammo_casings.dm +++ b/code/modules/projectiles/ammunition/ammo_casings.dm @@ -178,7 +178,7 @@ variance = 25 /obj/item/ammo_casing/shotgun/rubbershot - name = "rubber shot" + name = "rubbershot shell" desc = "A 12 gauge shell filled with densely-packed rubber balls, used to incapacitate crowds from a distance." icon_state = "cshell" projectile_type = /obj/item/projectile/bullet/pellet/rubber @@ -186,7 +186,6 @@ variance = 35 materials = list(MAT_METAL=4000) - /obj/item/ammo_casing/shotgun/beanbag name = "beanbag slug" desc = "A 12 gauge shell loaded with a beanbag slug for less-lethal takedowns." @@ -298,7 +297,7 @@ reagents.add_reagent("sodium_thiopental", 6) /obj/item/ammo_casing/shotgun/tranquilizer - name = "tranquilizer darts" + name = "tranquilizer dart" desc = "A 12 gauge dart shell loaded with powerful tranquilizers." icon_state = "nshell" projectile_type = /obj/item/projectile/bullet/dart/syringe/tranquilizer @@ -307,7 +306,7 @@ materials = list(MAT_METAL=250) /obj/item/ammo_casing/shotgun/holy - name = "holy water darts" + name = "holy water dart" desc = "A 12 gauge dart shell loaded with holy water." icon_state = "hshell" projectile_type = /obj/item/projectile/bullet/dart/syringe/holy