Adds flatboxes, boxes that fit beneath tiles (#87229)

## About The Pull Request

This box type has a maximum of 3 slots, and can be hidden beneath
floortiles. It can be crafted by *jump emoting ontop of a regular, empty
box.


https://github.com/user-attachments/assets/d7ab52ec-2b47-4ab4-b2af-05ce00b0ae4b



https://github.com/user-attachments/assets/30dd5de3-1f4d-4cb4-8d9c-8625379e76bf

## Why It's Good For The Game
Hiding beneath tiles is a fun, yet not broken method of stowing
contraband. The toiletbasin or moisturizer trap remains a better option,
so I want to open up the space between the floorboards as quick
alternative for stowing or making cache drop-offs.

Smuggle satchels have a lot more going for them than their ability to be
hidden beneath tiles, so I don't feel like this is intruding on their
turf.
This commit is contained in:
fleur
2024-11-03 23:47:37 -06:00
committed by GitHub
parent 3f50f5eac6
commit 4bfe9a71b6
5 changed files with 45 additions and 1 deletions
+14 -1
View File
@@ -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)
@@ -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)
+8
View File
@@ -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)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

+1
View File
@@ -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"