From dacbe162289a12fd678e4ae1fc60e4e482b30b3e Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Sun, 19 Mar 2017 17:00:40 -0400 Subject: [PATCH] Fixes some RCD stuff --- code/game/objects/structures/grille.dm | 47 +++++++++++++------------- code/game/objects/structures/window.dm | 29 ++++++++-------- code/game/turfs/simulated/floor.dm | 2 +- 3 files changed, 38 insertions(+), 40 deletions(-) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 2edb2d97279..478b3273b29 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -18,6 +18,29 @@ var/grille_type = null var/broken_type = /obj/structure/grille/broken +/obj/structure/grille/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) + switch(the_rcd.mode) + if(RCD_DECONSTRUCT) + return list("mode" = RCD_DECONSTRUCT, "delay" = 20, "cost" = 5) + if(RCD_WINDOWGRILLE) + return list("mode" = RCD_WINDOWGRILLE, "delay" = 40, "cost" = 10) + return FALSE + +/obj/structure/grille/rcd_act(mob/user, var/obj/item/weapon/rcd/the_rcd, passed_mode) + switch(passed_mode) + if(RCD_DECONSTRUCT) + to_chat(user, "You deconstruct the grille.") + qdel(src) + return TRUE + if(RCD_WINDOWGRILLE) + if(locate(/obj/structure/window) in loc) + return FALSE + to_chat(user, "You construct the window.") + var/obj/structure/window/WD = new the_rcd.window_type(loc) + WD.anchored = TRUE + return TRUE + return FALSE + /obj/structure/grille/ratvar_act() if(broken) new /obj/structure/grille/ratvar/broken(src.loc) @@ -256,27 +279,3 @@ rods_broken = 0 grille_type = /obj/structure/grille/ratvar broken_type = null - -/turf/open/floor/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) - switch(the_rcd.mode) - if(RCD_DECONSTRUCT) - return list("mode" = RCD_DECONSTRUCT, "delay" = 20, "cost" = 5) - if(RCD_WINDOWGRILLE) - return list("mode" = RCD_WINDOWGRILLE, "delay" = 40, "cost" = 10) - return FALSE - - -/obj/structure/grille/rcd_act(mob/user, var/obj/item/weapon/rcd/the_rcd, passed_mode) - switch(passed_mode) - if(RCD_DECONSTRUCT) - to_chat(user, "You deconstruct the grille.") - qdel(src) - return TRUE - if(RCD_WINDOWGRILLE) - if(locate(/obj/structure/window) in loc) - return FALSE - to_chat(user, "You construct the window.") - var/obj/structure/window/WD = new the_rcd.window_type(loc) - WD.anchored = TRUE - return TRUE - return FALSE \ No newline at end of file diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index aed13287c11..da89134e063 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -57,6 +57,20 @@ if(rods) debris += new /obj/item/stack/rods(src, rods) +/obj/structure/window/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) + switch(the_rcd.mode) + if(RCD_DECONSTRUCT) + return list("mode" = RCD_DECONSTRUCT, "delay" = 20, "cost" = 5) + return FALSE + +/obj/structure/window/rcd_act(mob/user, var/obj/item/weapon/rcd/the_rcd) + switch(the_rcd.mode) + if(RCD_DECONSTRUCT) + to_chat(user, "You deconstruct the window.") + qdel(src) + return TRUE + return FALSE + /obj/structure/window/narsie_act() add_atom_colour(NARSIE_WINDOW_COLOUR, FIXED_COLOUR_PRIORITY) for(var/obj/item/weapon/shard/shard in debris) @@ -560,18 +574,3 @@ /obj/structure/window/reinforced/clockwork/fulltile/unanchored anchored = FALSE - - -/turf/open/floor/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) - switch(the_rcd.mode) - if(RCD_DECONSTRUCT) - return list("mode" = RCD_DECONSTRUCT, "delay" = 20, "cost" = 5) - return FALSE - -/obj/structure/window/rcd_act(mob/user, var/obj/item/weapon/rcd/the_rcd) - switch(the_rcd.mode) - if(RCD_DECONSTRUCT) - to_chat(user, "You deconstruct the window.") - qdel(src) - return TRUE - return FALSE diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 1bff630e7dc..8a81e2b6d0f 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -219,7 +219,7 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3"," ChangeTurf(/turf/closed/wall) return TRUE if(RCD_AIRLOCK) - if(locate(/obj/machinery/door/airlock) in loc) + if(locate(/obj/machinery/door/airlock) in src) return FALSE to_chat(user, "You build an airlock.") var/obj/machinery/door/airlock/A = new the_rcd.airlock_type(src)