From 76b968aee34f73b2fb33ab69aa2b5fcbd62d0e2d Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 11 Jun 2021 00:49:44 +0200 Subject: [PATCH] [MIRROR] Makes it so the matchbox's matches visibly empty from the sprite when you take matches out (#6230) * Makes it so the matchbox's matches visibly empty from the sprite when you take matches out (#59575) * 4 fucking sprites * forgot to make it call parent * uses base_icon_state Co-authored-by: TemporalOroboros * adds base_icon_state variable to matches * base_icon_state fix Co-authored-by: TemporalOroboros * Makes it so the matchbox's matches visibly empty from the sprite when you take matches out Co-authored-by: Wallemations <66052067+Wallemations@users.noreply.github.com> Co-authored-by: TemporalOroboros --- code/game/objects/items/storage/boxes.dm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index 1db29fdbe00..708e256f8a6 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -713,6 +713,7 @@ drop_sound = 'sound/items/handling/matchbox_drop.ogg' pickup_sound = 'sound/items/handling/matchbox_pickup.ogg' custom_price = PAYCHECK_ASSISTANT * 0.4 + base_icon_state = "matchbox" /obj/item/storage/box/matches/ComponentInitialize() . = ..() @@ -727,6 +728,18 @@ if(istype(W, /obj/item/match)) W.matchignite() +/obj/item/storage/box/matches/update_icon_state() + . = ..() + switch(length(contents)) + if(10) + icon_state = base_icon_state + if(5 to 9) + icon_state = "[base_icon_state]_almostfull" + if(1 to 4) + icon_state = "[base_icon_state]_almostempty" + if(0) + icon_state = "[base_icon_state]_e" + /obj/item/storage/box/lights name = "box of replacement bulbs" icon = 'icons/obj/storage.dmi'