Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The clown's box is now 1000% more useful #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RussStation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 7 additions & 1 deletion code/datums/components/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/clown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
35 changes: 34 additions & 1 deletion russstation/code/game/objects/items/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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("<span class='boldannounce'>[src] snaps shut!</span>")
playsound(src, 'sound/effects/snap.ogg', 50, TRUE)
if(isliving(loc))
var/mob/living/M = loc
our_storage.hide_from(M)
to_chat(M, "<span class='warning'>[src] snaps shut on your fingers!</span>")
M.adjustStaminaLoss(2)
sleep(2) //Sleeps that are this small have negligible performance impact
playsound(src, 'sound/items/bikehorn.ogg', 100, TRUE)
5 changes: 5 additions & 0 deletions russstation/code/game/objects/items/storage/storage.dm
Original file line number Diff line number Diff line change
@@ -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
Binary file added russstation/icons/obj/storage.dmi
Binary file not shown.