mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 17:52:36 +00:00
[MIRROR] Stairs DLC: Buildable stairs, material datum staircases, fall up a staircase [MDB IGNORE] (#16925)
* Stairs DLC: Buildable stairs, material datum staircases, fall up a staircase (#70504) Adds a few new types of stairs, and makes stairs buildable within rounds. Also removes the terminator sprite variation for stairs, because its basically unused and really not needed with plane cube multiz. * Stairs DLC: Buildable stairs, material datum staircases, fall up a staircase Co-authored-by: Paxilmaniac <82386923+Paxilmaniac@users.noreply.github.com>
This commit is contained in:
@@ -31,6 +31,7 @@ SUBSYSTEM_DEF(materials)
|
||||
///List of stackcrafting recipes for materials using rigid recipes
|
||||
var/list/rigid_stack_recipes = list(
|
||||
new /datum/stack_recipe("Carving block", /obj/structure/carving_block, 5, one_per_turf = TRUE, on_solid_ground = TRUE, applies_mats = TRUE),
|
||||
new /datum/stack_recipe("Material Stairs", /obj/structure/stairs/material, 10, time = 10 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, applies_mats = TRUE),
|
||||
)
|
||||
|
||||
///Ran on initialize, populated the materials and materials_by_category dictionaries with their appropiate vars (See these variables for more info)
|
||||
|
||||
@@ -10,6 +10,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
|
||||
new/datum/stack_recipe("tank holder", /obj/structure/tank_holder, 2, time = 5, one_per_turf = TRUE, on_solid_ground = FALSE), \
|
||||
new/datum/stack_recipe("ladder", /obj/structure/ladder/crafted, 15, time = 150, one_per_turf = TRUE, on_solid_ground = FALSE), \
|
||||
new/datum/stack_recipe("catwalk floor tile", /obj/item/stack/tile/catwalk_tile, 1, 4, 20), \
|
||||
new/datum/stack_recipe("stairs frame", /obj/structure/stairs_frame, 10, time = 5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \
|
||||
new/datum/stack_recipe("white cane", /obj/item/cane/white, 3, time = 10, one_per_turf = FALSE), \
|
||||
))
|
||||
//the wrestling ropes recipe is a SKYRAT EDIT
|
||||
|
||||
@@ -148,6 +148,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
|
||||
matter_amount = 4
|
||||
cost = 500
|
||||
source = /datum/robot_energy_storage/iron
|
||||
stairs_type = /obj/structure/stairs
|
||||
|
||||
/obj/item/stack/sheet/iron/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -294,6 +295,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
|
||||
new/datum/stack_recipe("winged wooden chair", /obj/structure/chair/wood/wings, 3, time = 10, one_per_turf = TRUE, on_solid_ground = TRUE), \
|
||||
new/datum/stack_recipe("wooden barricade", /obj/structure/barricade/wooden, 5, time = 50, one_per_turf = TRUE, on_solid_ground = TRUE), \
|
||||
new/datum/stack_recipe("wooden door", /obj/structure/mineral_door/wood, 10, time = 20, one_per_turf = TRUE, on_solid_ground = TRUE), \
|
||||
new/datum/stack_recipe("wooden stairs frame", /obj/structure/stairs_frame/wood, 10, time = 5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \
|
||||
new/datum/stack_recipe("coffin", /obj/structure/closet/crate/coffin, 5, time = 15, one_per_turf = TRUE, on_solid_ground = TRUE), \
|
||||
new/datum/stack_recipe("book case", /obj/structure/bookcase, 4, time = 15, one_per_turf = TRUE, on_solid_ground = TRUE), \
|
||||
new/datum/stack_recipe("drying rack", /obj/machinery/smartfridge/drying_rack, 10, time = 15, one_per_turf = TRUE, on_solid_ground = TRUE), \
|
||||
@@ -342,6 +344,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
|
||||
material_type = /datum/material/wood
|
||||
grind_results = list(/datum/reagent/cellulose = 20) //no lignocellulose or lignin reagents yet,
|
||||
walltype = /turf/closed/wall/mineral/wood
|
||||
stairs_type = /obj/structure/stairs/wood
|
||||
|
||||
/obj/item/stack/sheet/mineral/wood/get_main_recipes()
|
||||
. = ..()
|
||||
|
||||
@@ -53,6 +53,8 @@
|
||||
var/has_unique_girder = FALSE
|
||||
/// What typepath table we create from this stack
|
||||
var/obj/structure/table/tableVariant
|
||||
/// What typepath stairs do we create from this stack
|
||||
var/obj/structure/stairs/stairs_type
|
||||
/// If TRUE, we'll use a radial instead when displaying recipes
|
||||
var/use_radial = FALSE
|
||||
/// If use_radial is TRUE, this is the radius of the radial
|
||||
|
||||
@@ -28,6 +28,16 @@
|
||||
/obj/structure/stairs/west
|
||||
dir = WEST
|
||||
|
||||
/obj/structure/stairs/wood
|
||||
icon_state = "stairs_wood"
|
||||
|
||||
/obj/structure/stairs/stone
|
||||
icon_state = "stairs_stone"
|
||||
|
||||
/obj/structure/stairs/material
|
||||
icon_state = "stairs_material"
|
||||
material_flags = MATERIAL_EFFECTS | MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
|
||||
|
||||
/obj/structure/stairs/Initialize(mapload)
|
||||
GLOB.stairs += src
|
||||
if(force_open_above)
|
||||
@@ -79,10 +89,6 @@
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/obj/structure/stairs/update_icon_state()
|
||||
icon_state = "stairs[isTerminator() ? "_t" : null]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/stairs/proc/stair_ascend(atom/movable/climber)
|
||||
var/turf/checking = get_step_multiz(get_turf(src), UP)
|
||||
if(!istype(checking))
|
||||
@@ -150,3 +156,98 @@
|
||||
if(S.dir == dir)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/stairs_frame
|
||||
name = "stairs frame"
|
||||
desc = "Everything you need to call something a staircase, aside from the stuff you actually step on."
|
||||
icon = 'icons/obj/stairs.dmi'
|
||||
icon_state = "stairs_frame"
|
||||
density = FALSE
|
||||
anchored = FALSE
|
||||
/// What type of stack will this drop on deconstruction?
|
||||
var/frame_stack = /obj/item/stack/rods
|
||||
/// How much of frame_stack should this drop on deconstruction?
|
||||
var/frame_stack_amount = 10
|
||||
|
||||
/obj/structure/stairs_frame/wood
|
||||
name = "wooden stairs frame"
|
||||
desc = "Everything you need to build a staircase, minus the actual stairs, this one is made of wood."
|
||||
frame_stack = /obj/item/stack/sheet/mineral/wood
|
||||
|
||||
/obj/structure/stairs_frame/Initialize(mapload)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/simple_rotation)
|
||||
|
||||
/obj/structure/stairs_frame/examine(mob/living/carbon/human/user)
|
||||
. = ..()
|
||||
if(anchored)
|
||||
. += span_notice("The frame is anchored and can be made into proper stairs with 10 sheets of material.")
|
||||
else
|
||||
. += span_notice("The frame will need to be secured with a wrench before it can be completed.")
|
||||
|
||||
/obj/structure/stairs_frame/wrench_act(mob/living/user, obj/item/used_tool)
|
||||
user.balloon_alert_to_viewers("securing stairs frame", "securing frame")
|
||||
used_tool.play_tool_sound(src)
|
||||
if(!used_tool.use_tool(src, user, 3 SECONDS))
|
||||
return TRUE
|
||||
if(anchored)
|
||||
anchored = FALSE
|
||||
playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
return TRUE
|
||||
anchored = TRUE
|
||||
playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/stairs_frame/wrench_act_secondary(mob/living/user, obj/item/used_tool)
|
||||
to_chat(user, span_notice("You start disassembling [src]..."))
|
||||
used_tool.play_tool_sound(src)
|
||||
if(!used_tool.use_tool(src, user, 3 SECONDS))
|
||||
return TRUE
|
||||
playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
deconstruct(TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/stairs_frame/deconstruct(disassembled = TRUE)
|
||||
new frame_stack(get_turf(src), frame_stack_amount)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/stairs_frame/attackby(obj/item/attacked_by, mob/user, params)
|
||||
if(!isstack(attacked_by))
|
||||
return ..()
|
||||
if(!anchored)
|
||||
user.balloon_alert(user, "secure frame first")
|
||||
return TRUE
|
||||
var/obj/item/stack/material = attacked_by
|
||||
if(material.stairs_type)
|
||||
if(material.get_amount() < 10)
|
||||
to_chat(user, span_warning("You need ten [material.name] sheets to do this!"))
|
||||
return
|
||||
if(locate(/obj/structure/stairs) in loc)
|
||||
to_chat(user, span_warning("There's already stairs built here!"))
|
||||
return
|
||||
to_chat(user, span_notice("You start adding [material] to [src]..."))
|
||||
if(!do_after(user, 10 SECONDS, target = src) || !material.use(10) || (locate(/obj/structure/table) in loc))
|
||||
return
|
||||
make_new_stairs(material.stairs_type)
|
||||
else if(istype(material, /obj/item/stack/sheet))
|
||||
if(material.get_amount() < 10)
|
||||
to_chat(user, span_warning("You need ten sheets to do this!"))
|
||||
return
|
||||
if(locate(/obj/structure/stairs) in loc)
|
||||
to_chat(user, span_warning("There's already stairs built here!"))
|
||||
return
|
||||
to_chat(user, span_notice("You start adding [material] to [src]..."))
|
||||
if(!do_after(user, 10 SECONDS, target = src) || !material.use(10) || (locate(/obj/structure/table) in loc))
|
||||
return
|
||||
var/list/material_list = list()
|
||||
if(material.material_type)
|
||||
material_list[material.material_type] = MINERAL_MATERIAL_AMOUNT * 10
|
||||
make_new_stairs(/obj/structure/stairs/material, material_list)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/stairs_frame/proc/make_new_stairs(stairs_type, custom_materials)
|
||||
var/obj/structure/stairs/new_stairs = new stairs_type(loc)
|
||||
new_stairs.setDir(dir)
|
||||
if(custom_materials)
|
||||
new_stairs.set_custom_materials(custom_materials)
|
||||
qdel(src)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 2.2 KiB |
Reference in New Issue
Block a user