diff --git a/code/datums/elements/undertile.dm b/code/datums/elements/undertile.dm index 229b292b31a..54c4ebab6cd 100644 --- a/code/datums/elements/undertile.dm +++ b/code/datums/elements/undertile.dm @@ -16,8 +16,10 @@ var/use_alpha ///We will switch between anchored and unanchored. for stuff like satchels that shouldn't be pullable under tiles but are otherwise unanchored var/use_anchor + ///Will hiding the object tilt the tile it is beneath? + var/tilt_tile -/datum/element/undertile/Attach(datum/target, invisibility_trait, invisibility_level = INVISIBILITY_MAXIMUM, tile_overlay, use_alpha = TRUE, use_anchor = FALSE) +/datum/element/undertile/Attach(datum/target, invisibility_trait, invisibility_level = INVISIBILITY_MAXIMUM, tile_overlay, use_alpha = TRUE, use_anchor = FALSE, tilt_tile = FALSE) . = ..() if(!ismovable(target)) @@ -30,6 +32,7 @@ src.tile_overlay = tile_overlay src.use_alpha = use_alpha src.use_anchor = use_anchor + src.tilt_tile = tilt_tile ///called when a tile has been covered or uncovered /datum/element/undertile/proc/hide(atom/movable/source, underfloor_accessibility) @@ -55,6 +58,11 @@ if(tile_overlay) T.add_overlay(tile_overlay) + if(tilt_tile) + T.transform = T.transform.Turn(2) + T.layer = (T.layer + 0.1) // prettier + T.appearance_flags |= PIXEL_SCALE + if(use_anchor) source.set_anchored(TRUE) @@ -76,6 +84,11 @@ if(tile_overlay) T.overlays -= tile_overlay + if(tilt_tile) + T.transform = matrix() + T.layer = initial(T.layer) + T.appearance_flags &= PIXEL_SCALE + if(use_alpha) source.alpha = initial(source.alpha) diff --git a/code/game/objects/items/storage/boxes/flat_boxes.dm b/code/game/objects/items/storage/boxes/flat_boxes.dm new file mode 100644 index 00000000000..b9544c0e548 --- /dev/null +++ b/code/game/objects/items/storage/boxes/flat_boxes.dm @@ -0,0 +1,22 @@ +/obj/item/storage/box/flat + name = "flat box" + desc = "A cardboard box folded in a manner that is optimal for concealment, rather than for stowing your belongings." + icon_state = "flat" + illustration = null + +/obj/item/storage/box/flat/Initialize(mapload) + . = ..() + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE, INVISIBILITY_OBSERVER, use_anchor = TRUE, tilt_tile = TRUE) + atom_storage.max_slots = 3 + +/obj/item/storage/box/proc/flatten_box() + if(istype(loc, /obj/item/storage) || type != /obj/item/storage/box || contents.len) + return + + var/obj/flat_box = new /obj/item/storage/box/flat(drop_location()) + playsound(src, 'sound/items/handling/materials/cardboard_drop.ogg', 50, TRUE) + + flat_box.pixel_x = pixel_x + flat_box.pixel_y = pixel_y + + qdel(src) diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index 4f3687d1c9a..28b5575108d 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -155,6 +155,14 @@ /datum/emote/jump/run_emote(mob/user, params, type_override, intentional) . = ..() + jump_animation(user) + + if(!isliving(user)) + return + for(var/obj/item/storage/box/squeeze_box in get_turf(user)) + squeeze_box.flatten_box() + +/datum/emote/jump/proc/jump_animation(mob/user) var/original_transform = user.transform animate(user, transform = user.transform.Translate(0, 4), time = 0.1 SECONDS, flags = ANIMATION_PARALLEL) animate(transform = original_transform, time = 0.1 SECONDS) diff --git a/icons/obj/storage/box.dmi b/icons/obj/storage/box.dmi index 79f7eff2a67..aeb337b5981 100644 Binary files a/icons/obj/storage/box.dmi and b/icons/obj/storage/box.dmi differ diff --git a/tgstation.dme b/tgstation.dme index c69248d5d6f..302a434c9e6 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2674,6 +2674,7 @@ #include "code\game\objects\items\storage\boxes\cargo_boxes.dm" #include "code\game\objects\items\storage\boxes\clothes_boxes.dm" #include "code\game\objects\items\storage\boxes\engineering_boxes.dm" +#include "code\game\objects\items\storage\boxes\flat_boxes.dm" #include "code\game\objects\items\storage\boxes\food_boxes.dm" #include "code\game\objects\items\storage\boxes\implant_boxes.dm" #include "code\game\objects\items\storage\boxes\job_boxes.dm"