diff --git a/RussStation.dme b/RussStation.dme index 1e0f509..f6cf443 100644 --- a/RussStation.dme +++ b/RussStation.dme @@ -2840,6 +2840,7 @@ #include "interface\stylesheet.dm" #include "interface\skin.dmf" #include "russstation\code\game\objects\items\storage\boxes.dm" +#include "russstation\code\game\objects\items\storage\storage.dm" #include "russstation\code\modules\clothing\clothing.dm" #include "russstation\code\modules\food_and_drinks\food\snacks_meat.dm" #include "russstation\code\modules\food_and_drinks\recipes\processor_recipes.dm" diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index b2482cd..bcdc913 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -125,7 +125,7 @@ if (can_hold_list != null) can_hold = typecacheof(can_hold_list) - if (cant_hold_list != null) + if (cant_hold_list != null) cant_hold = typecacheof(cant_hold_list) /datum/component/storage/proc/generate_hold_desc(can_hold_list) @@ -390,6 +390,9 @@ M.client.screen |= real_location.contents M.active_storage = src LAZYOR(is_using, M) + if(istype(real_location, /obj/item/storage)) //Russtation - Clown's self-closing box. + var/obj/item/storage/S = real_location + S.on_open(M) return TRUE /datum/component/storage/proc/hide_from(mob/M) @@ -402,6 +405,9 @@ if(M.active_storage == src) M.active_storage = null LAZYREMOVE(is_using, M) + if(istype(real_location, /obj/item/storage)) //Russtation - Clown's self-closing box. + var/obj/item/storage/S = real_location + S.on_close(M) return TRUE /datum/component/storage/proc/close(mob/M) diff --git a/code/modules/jobs/job_types/clown.dm b/code/modules/jobs/job_types/clown.dm index 60cdd0e..b566149 100644 --- a/code/modules/jobs/job_types/clown.dm +++ b/code/modules/jobs/job_types/clown.dm @@ -46,7 +46,7 @@ satchel = /obj/item/storage/backpack/clown duffelbag = /obj/item/storage/backpack/duffelbag/clown //strangely has a duffel - box = /obj/item/storage/box/hug/survival + box = /obj/item/storage/box/useless //Russstation - Clown's very useful box. chameleon_extras = /obj/item/stamp/clown diff --git a/russstation/code/game/objects/items/storage/boxes.dm b/russstation/code/game/objects/items/storage/boxes.dm index e81a6f8..0f8ee25 100644 --- a/russstation/code/game/objects/items/storage/boxes.dm +++ b/russstation/code/game/objects/items/storage/boxes.dm @@ -18,4 +18,37 @@ new /obj/item/reagent_containers/food/snacks/carpmeat(src) new /obj/item/reagent_containers/food/snacks/meat/slab/xeno(src) new /obj/item/reagent_containers/food/snacks/meat/slab/corgi(src) - new /obj/item/reagent_containers/food/snacks/meatball(src) \ No newline at end of file + new /obj/item/reagent_containers/food/snacks/meatball(src) + +/obj/item/storage/box/useless + name = "extremely useful box" + desc = "It's just an ordinary box." + icon = 'russstation/icons/obj/storage.dmi' + icon_state = "uselessbox" + item_state = "syringe_kit" + lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' + illustration = null + +/obj/item/storage/box/useless/PopulateContents() + new /obj/item/clothing/mask/breath(src) + new /obj/item/tank/internals/emergency_oxygen(src) + new /obj/item/reagent_containers/hypospray/medipen(src) + +/obj/item/storage/box/useless/on_open(var/mob/M) + if(isliving(M)) //Prevents ghosts from triggering the box to close. + flick("uselessbox_close",src) + addtimer(CALLBACK(src, .proc/close), 8)//As soon as you open the box, it snaps shut + +/obj/item/storage/box/useless/proc/close() //Snap shut + icon_state = initial(icon_state) + var/datum/component/storage/our_storage = GetComponent(/datum/component/storage) + visible_message("[src] snaps shut!") + playsound(src, 'sound/effects/snap.ogg', 50, TRUE) + if(isliving(loc)) + var/mob/living/M = loc + our_storage.hide_from(M) + to_chat(M, "[src] snaps shut on your fingers!") + M.adjustStaminaLoss(2) + sleep(2) //Sleeps that are this small have negligible performance impact + playsound(src, 'sound/items/bikehorn.ogg', 100, TRUE) \ No newline at end of file diff --git a/russstation/code/game/objects/items/storage/storage.dm b/russstation/code/game/objects/items/storage/storage.dm new file mode 100644 index 0000000..9630831 --- /dev/null +++ b/russstation/code/game/objects/items/storage/storage.dm @@ -0,0 +1,5 @@ +/obj/item/storage/proc/on_open(var/mob/M) //Helper proc called when a box is opened, and closed + return + +/obj/item/storage/proc/on_close(var/mob/M) + return \ No newline at end of file diff --git a/russstation/icons/obj/storage.dmi b/russstation/icons/obj/storage.dmi new file mode 100644 index 0000000..c756caa Binary files /dev/null and b/russstation/icons/obj/storage.dmi differ