[s] Small tweaks and fixes a edgecase with machine construction (#37494)
* Puts back required time for the emitter and field_generator and also removes a certain issue that certain people were causing * Couple of things I missed * I noticed the error with regards to atom and changed to obj like I was trying to originally. Also its fine to build on tables that wasnt the issue with this specific aspect. * Edge windows. We need those. * optimised the checks to be behind a if check for when you are actually needing to make something for the floor... * Corrects a input proc by request * Working is not my strong suit.
This commit is contained in:
committed by
CitadelStationBot
parent
3369c804b2
commit
987cce76ed
@@ -227,26 +227,36 @@
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>You haven't got enough [src] to build \the [R.title]!</span>")
|
||||
return FALSE
|
||||
if(R.window_checks && !valid_window_location(usr.loc, usr.dir))
|
||||
var/turf/T = get_turf(usr)
|
||||
if(R.window_checks && !valid_window_location(T, usr.dir))
|
||||
to_chat(usr, "<span class='warning'>The [R.title] won't fit here!</span>")
|
||||
return FALSE
|
||||
if(R.one_per_turf && (locate(R.result_type) in usr.loc))
|
||||
if(R.one_per_turf && (locate(R.result_type) in T))
|
||||
to_chat(usr, "<span class='warning'>There is another [R.title] here!</span>")
|
||||
return FALSE
|
||||
if(R.on_floor && !isfloorturf(usr.loc))
|
||||
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed on the floor!</span>")
|
||||
return FALSE
|
||||
if(R.on_floor)
|
||||
if(!isfloorturf(T))
|
||||
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed on the floor!</span>")
|
||||
return FALSE
|
||||
for(var/obj/AM in T)
|
||||
if(istype(AM,/obj/structure/grille))
|
||||
continue
|
||||
if(istype(AM,/obj/structure/table))
|
||||
continue
|
||||
if(AM.density)
|
||||
to_chat(usr, "<span class='warning'>Theres a [AM.name] here. You cant make a [R.title] here!</span>")
|
||||
return FALSE
|
||||
if(R.placement_checks)
|
||||
switch(R.placement_checks)
|
||||
if(STACK_CHECK_CARDINALS)
|
||||
var/turf/step
|
||||
for(var/direction in GLOB.cardinals)
|
||||
step = get_step(usr, direction)
|
||||
step = get_step(T, direction)
|
||||
if(locate(R.result_type) in step)
|
||||
to_chat(usr, "<span class='warning'>\The [R.title] must not be built directly adjacent to another!</span>")
|
||||
return FALSE
|
||||
if(STACK_CHECK_ADJACENT)
|
||||
if(locate(R.result_type) in range(1, usr))
|
||||
if(locate(R.result_type) in range(1, T))
|
||||
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed at least one tile away from others of its type!</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
@@ -395,7 +405,9 @@
|
||||
var/window_checks = FALSE
|
||||
var/placement_checks = FALSE
|
||||
|
||||
/datum/stack_recipe/New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = FALSE, on_floor = FALSE, window_checks = FALSE, placement_checks = FALSE)
|
||||
/datum/stack_recipe/New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1,time = 0, one_per_turf = FALSE, on_floor = FALSE, window_checks = FALSE, placement_checks = FALSE )
|
||||
|
||||
|
||||
src.title = title
|
||||
src.result_type = result_type
|
||||
src.req_amount = req_amount
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
if(loaded_tank)
|
||||
to_chat(user, "<span class='warning'>There's already a plasma tank loaded!</span>")
|
||||
return TRUE
|
||||
if(panel_open)
|
||||
if(panel_open)
|
||||
to_chat(user, "<span class='warning'>Close the maintenance panel first!</span>")
|
||||
return TRUE
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
@@ -134,7 +134,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/wrench_act(mob/living/user, obj/item/I)
|
||||
default_unfasten_wrench(user, I, 0)
|
||||
default_unfasten_wrench(user, I)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/screwdriver_act(mob/living/user, obj/item/I)
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
state = EM_UNSECURED
|
||||
|
||||
/obj/machinery/power/emitter/wrench_act(mob/living/user, obj/item/I)
|
||||
default_unfasten_wrench(user, I, 0)
|
||||
default_unfasten_wrench(user, I)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/emitter/welder_act(mob/living/user, obj/item/I)
|
||||
|
||||
@@ -106,7 +106,7 @@ field_generator power level display
|
||||
state = FG_UNSECURED
|
||||
|
||||
/obj/machinery/field/generator/wrench_act(mob/living/user, obj/item/I)
|
||||
default_unfasten_wrench(user, I, 0)
|
||||
default_unfasten_wrench(user, I)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/field/generator/welder_act(mob/living/user, obj/item/I)
|
||||
|
||||
Reference in New Issue
Block a user