Allow construction of grilles on lattices (#17906)

This commit is contained in:
moxian
2022-06-06 21:52:59 +01:00
committed by GitHub
parent 0b3a8c074c
commit 05c431b66a
4 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
GLOBAL_LIST_INIT(rod_recipes, list ( \
new /datum/stack_recipe("grille", /obj/structure/grille, 2, time = 10, one_per_turf = 1, on_floor = 1), \
new /datum/stack_recipe("grille", /obj/structure/grille, 2, time = 10, one_per_turf = 1, on_floor_or_lattice = 1), \
new /datum/stack_recipe("table frame", /obj/structure/table_frame, 2, time = 10, one_per_turf = 1, on_floor = 1), \
null,
new /datum/stack_recipe("railing", /obj/structure/railing, 3, time = 10, one_per_turf = 1, on_floor = 1), \
+4 -1
View File
@@ -210,12 +210,15 @@
if(R.on_floor && !istype(get_turf(src), /turf/simulated))
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed on the floor!</span>")
return FALSE
if(R.on_floor_or_lattice && !(istype(get_turf(src), /turf/simulated) || locate(/obj/structure/lattice) in get_turf(src)))
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed on the floor or lattice!</span>")
return FALSE
if(R.cult_structure)
if(usr.holy_check())
return
if(!is_level_reachable(usr.z))
to_chat(usr, "<span class='warning'>The energies of this place interfere with the metal shaping!</span>")
to_chat(usr, "<span class='warning'>\The energies of this place interfere with the metal shaping!</span>")
return
if(locate(/obj/structure/cult) in get_turf(src))
to_chat(usr, "<span class='warning'>There is a structure here!</span>")
@@ -11,10 +11,11 @@
var/time = 0
var/one_per_turf = 0
var/on_floor = 0
var/on_floor_or_lattice = 0
var/window_checks = FALSE
var/cult_structure = FALSE
/datum/stack_recipe/New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0, window_checks = FALSE, cult_structure = FALSE)
/datum/stack_recipe/New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0, on_floor_or_lattice = 0, window_checks = FALSE, cult_structure = FALSE)
src.title = title
src.result_type = result_type
src.req_amount = req_amount
@@ -23,6 +24,7 @@
src.time = time
src.one_per_turf = one_per_turf
src.on_floor = on_floor
src.on_floor_or_lattice = on_floor_or_lattice
src.window_checks = window_checks
src.cult_structure = cult_structure