From ecb8a3144331a709384d43dbb707fc7848d1c122 Mon Sep 17 00:00:00 2001 From: Ron Date: Mon, 12 Jun 2017 16:14:15 -0400 Subject: [PATCH] Tweaks the transformer (#2692) Does some tweaking and fixing to the transformer. Fixes #2634 Fixes #2635 --- code/game/machinery/transformer.dm | 28 +++++++++++++++++--------- code/game/objects/items/weapons/RTF.dm | 3 +-- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index ac8ee11d23b..b3f2f9c09e0 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -13,7 +13,16 @@ /obj/machinery/transformer/Initialize() // On us . = ..() - new /obj/machinery/conveyor(loc, WEST, 1) // this doesnt need to check for a location because it is under the machine so its assumed there is one + if(loc) + MakeConveyor() + else + addtimer(CALLBACK(src, .proc/MakeConveyor), 5) + +/obj/machinery/transformer/proc/MakeConveyor() + if (!loc) + PROCLOG_WEIRD("Trying to spawn conveyor in null space.") + return + new /obj/machinery/conveyor(loc, WEST, 1) var/turf/T = get_turf(src) if(T)// Spawn Conveyour Belts //East @@ -25,7 +34,7 @@ var/turf/west = get_step(src, WEST) if(istype(west, /turf/simulated/floor)) new /obj/machinery/conveyor(west, WEST, 1) - + /obj/machinery/transformer/Bumped(var/atom/movable/AM) // HasEntered didn't like people lying down. if(ishuman(AM)) @@ -47,13 +56,14 @@ use_power(6000) // Use a lot of power. visible_message("The machine makes a series of loud sounds as it starts to replace [H]'s organs and limbs with robotic parts!") H <<"You feel a horrible pain as the machine you entered starts to rip you apart and replace your limbs and organs!" - sleep(600) // takes some time so they aren't just instaconverted - H <<" You lose consciousness for a brief moment before waking up with a whole new body..." - H.Robotize() - playsound(src.loc, 'sound/machines/ping.ogg', 50, 0) - canuse = 0 - sleep(120) // cooldown - canuse = 1 + sleep(30) + if(H.loc == src.loc) + H <<" You lose consciousness for a brief moment before waking up with a whole new body..." + H.Robotize() + playsound(src.loc, 'sound/machines/ping.ogg', 50, 0) + canuse = 0 + sleep(120) // cooldown + canuse = 1 else playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0) visible_message("The machine displays an error message reading it is still making the required parts.") diff --git a/code/game/objects/items/weapons/RTF.dm b/code/game/objects/items/weapons/RTF.dm index f204e256f99..31c828aa5c8 100644 --- a/code/game/objects/items/weapons/RTF.dm +++ b/code/game/objects/items/weapons/RTF.dm @@ -28,10 +28,9 @@ var/malftransformermade = 0 playsound(src.loc, 'sound/machines/click.ogg', 10, 1) var/used_energy = 100 - var/obj/product = new /obj/machinery/transformer - user << "Fabricating machine..." if(do_after(user, 30 SECONDS, act_target = src)) + var/obj/product = new /obj/machinery/transformer malftransformermade = 1 product.loc = get_turf(A)