From da5eac806acb8e6ddd4cd2a9a2045fc054634f42 Mon Sep 17 00:00:00 2001 From: NikNakFlak Date: Wed, 29 Jun 2016 23:57:38 -0700 Subject: [PATCH] Fuck Coding --- code/game/objects/structures/showcase.dm | 44 +++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/code/game/objects/structures/showcase.dm b/code/game/objects/structures/showcase.dm index 5468f4b0230..170b709328e 100644 --- a/code/game/objects/structures/showcase.dm +++ b/code/game/objects/structures/showcase.dm @@ -1,3 +1,6 @@ +#define SHOWCASE_CONSTRUCTED 1 +#define SHOWCASE_SCREWDRIVERED 2 + /*Completely generic structures for use by mappers to create fake objects, i.e. display rooms*/ /obj/structure/showcase name = "showcase" @@ -6,6 +9,7 @@ desc = "A stand with the empty body of a cyborg bolted to it." density = 1 anchored = 1 + var/deconstruction_state = SHOWCASE_CONSTRUCTED /obj/structure/showcase/fakeid name = "\improper Centcom identification console" @@ -31,4 +35,42 @@ name = "horrific experiment" desc = "Some sort of pod filled with blood and viscera. You swear you can see it moving..." icon = 'icons/obj/cloning.dmi' - icon_state = "pod_g" \ No newline at end of file + icon_state = "pod_g" + +//Deconstructing +//Showcases can be any sprite, so it makes sense that they can't be constructed. +//However if a player wants to move an existing showcase or remove one, this is for that. + +/obj/structure/showcase/attackby(obj/item/W, mob/user) + if(istype(W, /obj/item/weapon/screwdriver) && !anchored) + if(deconstruction_state == SHOWCASE_SCREWDRIVERED) + user << "You screw the screws back into the showcase." + playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1) + deconstruction_state = SHOWCASE_CONSTRUCTED + else if (deconstruction_state == SHOWCASE_CONSTRUCTED) + user << "You unscrew the screws." + playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1) + deconstruction_state = SHOWCASE_SCREWDRIVERED + + if(istype(W, /obj/item/weapon/crowbar) && deconstruction_state == SHOWCASE_SCREWDRIVERED) + if(do_after(user, 20/W.toolspeed, target = src)) + playsound(loc, 'sound/items/Crowbar.ogg', 100, 1) + user << "You start to crowbar the showcase apart..." + new /obj/item/stack/sheet/metal (get_turf(src), 4) + qdel(src) + + if(deconstruction_state == SHOWCASE_CONSTRUCTED && default_unfasten_wrench(user, W)) + return + +//Feedback is given in examine because showcases can basically have any sprite assigned to them + +/obj/structure/showcase/examine(mob/user) + ..() + + switch(deconstruction_state) + if(SHOWCASE_CONSTRUCTED) + user << "The showcase is fully constructed." + if(SHOWCASE_SCREWDRIVERED) + user << "The showcase has its screws loosened." + else + user << "If you see this, something is wrong." \ No newline at end of file