From 601e8d8f6f748e4258e90cf2f5169fd5592e52ed Mon Sep 17 00:00:00 2001 From: Maximal08 <73069825+Maximal08@users.noreply.github.com> Date: Thu, 31 Jul 2025 22:43:09 +0500 Subject: [PATCH] Computer and machine construction qol (#92323) --- .../items/stacks/sheets/sheet_types.dm | 35 +++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index e90cef6fe99..bcff3b23e3b 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -198,7 +198,9 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ /obj/item/stack/sheet/iron/examine(mob/user) . = ..() - . += span_notice("You can build a wall girder (unanchored) by right clicking on an empty floor.") + . += span_notice("Right click on floor to build:") + . += span_notice("- Unanchored wall girder") + . += span_notice("- Computer or Machine frame (with circuitboard)") /obj/item/stack/sheet/iron/narsie_act() new /obj/item/stack/sheet/runed_metal(loc, amount) @@ -262,19 +264,40 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ if(build_on.is_blocked_turf()) user.balloon_alert(user, "something is blocking the tile!") return ITEM_INTERACT_BLOCKING - if(get_amount() < 2) - user.balloon_alert(user, "not enough material!") + + var/frame_path = null + var/cost = 2 // Default girder cost + var/time = 4 SECONDS //Default girder build time + var/obj/item/circuitboard/held_board = locate() in user.held_items + if(!isnull(held_board)) + if(istype(held_board, /obj/item/circuitboard/machine)) + frame_path = /obj/structure/frame/machine + else + frame_path = /obj/structure/frame/computer + for(var/datum/stack_recipe/recipe in GLOB.metal_recipes) + if(recipe.result_type == frame_path) + time = recipe.time + cost = recipe.req_amount + break + if(get_amount() < cost) + user.balloon_alert(user, "need [cost] metal sheets!") return ITEM_INTERACT_BLOCKING var/skill_modifier = user.mind.get_skill_modifier(/datum/skill/construction, SKILL_SPEED_MODIFIER) //SKYRAT EDIT: Construction Skill - if(!do_after(user, 4 SECONDS * skill_modifier, build_on)) + if(!do_after(user, time * skill_modifier, build_on)) return ITEM_INTERACT_BLOCKING if(build_on.is_blocked_turf()) user.balloon_alert(user, "something is blocking the tile!") return ITEM_INTERACT_BLOCKING - if(!use(2)) + if(!use(cost)) user.balloon_alert(user, "not enough material!") return ITEM_INTERACT_BLOCKING - new/obj/structure/girder/displaced(build_on) + if(frame_path) + var/obj/structure/frame/constructed_frame = new frame_path(build_on) + constructed_frame.setDir(REVERSE_DIR(user.dir)) //to align computer frame with player direction + user.balloon_alert(user, "frame created") + else + new/obj/structure/girder/displaced(build_on) + user.balloon_alert(user, "girder created") user.mind.adjust_experience(/datum/skill/construction, 5) //SKYRAT EDIT: Construction Skill return ITEM_INTERACT_SUCCESS