mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Jiggle Crate Items (#35822)
* Jiggle Crate Items * Avoid double definition
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user