Jiggle Crate Items (#35822)

* Jiggle Crate Items

* Avoid double definition
This commit is contained in:
Kurfursten
2024-01-24 12:48:39 -06:00
committed by GitHub
parent 5bc9468b6c
commit fc361b2097

View File

@@ -16,6 +16,12 @@
var/sound_effect_open = 'sound/machines/click.ogg'
var/sound_effect_close = 'sound/machines/click.ogg'
/obj/structure/closet/crate/proc/jiggle(var/obj/item/I)
var/jx = I.w_class == W_CLASS_TINY ? 7 : 3
var/jy = I.w_class == W_CLASS_TINY ? 3 : 1
I.pixel_x = rand(-jx,jx)
I.pixel_y = rand(-jy,jy)
/obj/structure/closet/crate/basic
has_lock_type = /obj/structure/closet/crate/secure/basic
@@ -441,6 +447,10 @@
return 0
playsound(src, sound_effect_open, 15, 1, -3)
for(var/obj/item/I in contents)
if(I.w_class <= W_CLASS_SMALL)
jiggle(I)
dump_contents()
icon_state = icon_opened