Files
Bubberstation/code/game/objects/structures/steps.dm
Jacquerel 7146a6bb10 Platforms (#91559)
## About The Pull Request


![image](https://github.com/user-attachments/assets/32a5f39a-59b8-46c3-8418-1a089379d6a4)

This PR adds "platforms" to the game, a port of the window frames from
the Wallening branch but with no windows attached.
You can craft them with two stacks of many kinds of materials.
Functionally they're basically just tables for standing on and act as a
decorative tool allowing you to make raised areas like stages.
Largely as far as I can tell I _think_ these were sprited by @Krysonism
although it's a little hard to check if there's any that were done by
someone else.

You can walk directly from tables to platforms (and crates) and vice
versa. You can also tableslam people onto them.

This PR also comes with "steps" (AKA small stairs)
You can use steps to walk onto platforms (or tables, or crates) without
needing to do the climbing action first.

![dreamseeker_umhbakZ4lE](https://github.com/user-attachments/assets/675e815b-8901-49d2-81b1-64ef7a56cd31)
If you try to run through them the wrong way you will trip.
Right now they only come in "Iron" flavour. Maybe one day someone will
sprite some wooden ones, or other varieties.

Basically the intention is to use them to build a little stage or altar
or maze or something. They don't have a lot of non-decorative purpose.

Don't be alarmed by the touched files list. It's mostly sprites and
there's barely even any code in this PR. It's almost entirely elements
and boilerplate.

## Why It's Good For The Game

Mappers keep asking me to add these.
Salvages some sprites from the Wallening project which we can still use.
You can make a really really big multitile pizza.

## Changelog

🆑 Jacquerel, Smartkar, sprites by Kryson
add: Added "platforms", or "half-walls" which are a kind of decorative
block similar to tables which you can walk around on.
add: You can walk freely between tables, platforms, and crates that
happen to be near tables or platforms.
add: You can construct iron steps to traverse tables and platforms
without needing to climb on, but try not to trip over them.
/🆑

---------

Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
2025-07-11 07:21:02 +00:00

59 lines
2.1 KiB
Plaintext

/// Short stairs you can use to climb tables quickly
/obj/structure/steps
name = "steps"
desc = "A small set of steps you can use to reach high shelves or climb onto platforms, just watch your ankles."
icon = 'icons/obj/small_stairs.dmi'
icon_state = "iron"
anchored = TRUE
move_resist = INFINITY
/obj/structure/steps/Initialize(mapload)
. = ..()
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_enter),
)
AddElement(/datum/element/connect_loc, loc_connections)
AddComponent(/datum/component/climb_walkable)
AddComponent(/datum/component/simple_rotation)
register_context()
/obj/structure/steps/add_context(atom/source, list/context, obj/item/held_item, mob/user)
. = ..()
if(!held_item)
return NONE
if(held_item.tool_behaviour == TOOL_WRENCH)
context[SCREENTIP_CONTEXT_LMB] = anchored ? "Unsecure" : "Secure"
return CONTEXTUAL_SCREENTIP_SET
if(held_item.tool_behaviour == TOOL_SCREWDRIVER)
context[SCREENTIP_CONTEXT_LMB] = "Deconstruct"
return CONTEXTUAL_SCREENTIP_SET
/obj/structure/steps/wrench_act(mob/living/user, obj/item/tool)
default_unfasten_wrench(user, tool)
return ITEM_INTERACT_SUCCESS
/obj/structure/steps/screwdriver_act(mob/living/user, obj/item/tool)
to_chat(user, span_notice("You start disassembling [src]..."))
if(tool.use_tool(src, user, 2 SECONDS, volume=50))
deconstruct(TRUE)
return ITEM_INTERACT_SUCCESS
/obj/structure/steps/atom_deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/iron(drop_location(), 2)
/// Watch your ankles
/obj/structure/steps/proc/on_enter(turf/our_turf, mob/living/arrived, turf/old_loc, list/atom/old_locs)
SIGNAL_HANDLER
if (!isliving(arrived) || !isturf(old_loc) || !our_turf.Adjacent(old_loc) || !has_gravity(src) || HAS_TRAIT(arrived, TRAIT_MOB_ELEVATED) || (arrived.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) || arrived.move_intent != MOVE_INTENT_RUN)
return
var/entered_dir = get_dir(our_turf, old_loc)
if (entered_dir == dir)
arrived.Knockdown(1 SECONDS)
to_chat(arrived, span_warning("You tripped over \the [src]!"))
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/steps, 0)