diff --git a/code/controllers/subsystem/materials.dm b/code/controllers/subsystem/materials.dm index 6276cb3af46..121d35b5eec 100644 --- a/code/controllers/subsystem/materials.dm +++ b/code/controllers/subsystem/materials.dm @@ -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) diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index fc3d959bd2f..06aec0dedc9 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -7,6 +7,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), \ )) diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 12d377481f7..14926cc9b1e 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -144,6 +144,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) . = ..() @@ -290,6 +291,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), \ @@ -338,6 +340,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() . = ..() diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 2c04aa46fb0..985fbfb19c5 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -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 diff --git a/code/game/objects/structures/stairs.dm b/code/game/objects/structures/stairs.dm index 40295c09011..7a29bb7efa3 100644 --- a/code/game/objects/structures/stairs.dm +++ b/code/game/objects/structures/stairs.dm @@ -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) diff --git a/icons/obj/stairs.dmi b/icons/obj/stairs.dmi index 5c3f378ced9..9f21f7fe485 100644 Binary files a/icons/obj/stairs.dmi and b/icons/obj/stairs.dmi differ