mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 12:08:55 +01:00
Computer and machine construction qol (#92323)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user