[MIRROR] makes reebe more than steam vent + brass skewer + pressure sensor + matrix simulator 2k18 by adding adjacency checks and some other things (#5256)

* makes reebe more than steam vent + brass skewer + pressure sensor + matrix simulator 2k18 by adding adjacency checks and some other things (#34888)

* traps patch

* flags!

* makes reebe more than steam vent + brass skewer + pressure sensor + matrix simulator 2k18 by adding adjacency checks and some other things
This commit is contained in:
CitadelStationBot
2018-02-05 00:57:31 -06:00
committed by Poojawa
parent b872c7c728
commit 584fc7151b
6 changed files with 25 additions and 7 deletions
@@ -377,8 +377,8 @@ GLOBAL_LIST_INIT(brass_recipes, list ( \
new/datum/stack_recipe("sender - lever", /obj/structure/destructible/clockwork/trap/trigger/lever, 1, time = 10, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("sender - repeater", /obj/structure/destructible/clockwork/trap/trigger/repeater, 2, time = 20, one_per_turf = TRUE, on_floor = TRUE), \
null,
new/datum/stack_recipe("receiver - brass skewer", /obj/structure/destructible/clockwork/trap/brass_skewer, 2, time = 20, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("receiver - steam vent", /obj/structure/destructible/clockwork/trap/steam_vent, 3, time = 30, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("receiver - brass skewer", /obj/structure/destructible/clockwork/trap/brass_skewer, 2, time = 20, one_per_turf = TRUE, on_floor = TRUE, placement_checks = STACK_CHECK_ADJACENT), \
new/datum/stack_recipe("receiver - steam vent", /obj/structure/destructible/clockwork/trap/steam_vent, 3, time = 30, one_per_turf = TRUE, on_floor = TRUE, placement_checks = STACK_CHECK_CARDINALS), \
))
/obj/item/stack/tile/brass
+16 -2
View File
@@ -232,6 +232,19 @@
if(R.on_floor && !isfloorturf(usr.loc))
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed on the floor!</span>")
return 0
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)
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 0
if(STACK_CHECK_ADJACENT)
if(locate(R.result_type) in range(1, usr))
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed at least one tile away from others of its type!</span>")
return 0
return 1
/obj/item/stack/proc/use(used, transfer = FALSE) // return 0 = borked; return 1 = had enough
@@ -360,8 +373,9 @@
var/one_per_turf = FALSE
var/on_floor = FALSE
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)
/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
@@ -371,7 +385,7 @@
src.one_per_turf = one_per_turf
src.on_floor = on_floor
src.window_checks = window_checks
src.placement_checks = placement_checks
/*
* Recipe list datum
*/