mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Allow construction of grilles on lattices (#17906)
This commit is contained in:
@@ -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), \
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
deconstruct()
|
||||
|
||||
/obj/structure/grille/screwdriver_act(mob/user, obj/item/I)
|
||||
if(!(istype(loc, /turf/simulated) || anchored))
|
||||
if(!(anchored || istype(loc, /turf/simulated) || locate(/obj/structure/lattice) in get_turf(src)))
|
||||
return
|
||||
. = TRUE
|
||||
if(shock(user, 90))
|
||||
@@ -154,8 +154,11 @@
|
||||
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
|
||||
return
|
||||
anchored = !anchored
|
||||
var/support = locate(/obj/structure/lattice) in get_turf(src)
|
||||
if(!support)
|
||||
support = get_turf(src)
|
||||
user.visible_message("<span class='notice'>[user] [anchored ? "fastens" : "unfastens"] [src].</span>", \
|
||||
"<span class='notice'>You [anchored ? "fasten [src] to" : "unfasten [src] from"] the floor.</span>")
|
||||
"<span class='notice'>You [anchored ? "fasten [src] to" : "unfasten [src] from"] \the [support].</span>")
|
||||
|
||||
/obj/structure/grille/proc/build_window(obj/item/stack/sheet/S, mob/user)
|
||||
var/dir_to_set = SOUTHWEST
|
||||
|
||||
Reference in New Issue
Block a user