Files
CHOMPStation2/code/game/machinery/transformer.dm
PsiOmega a9ef2b61c0 Wiring Upgrade
Continues the wiring upgrade. Now cameras, airlocks, robots, and air alarms also use the new wire datum system.
Global wiring code is now removed but there are sneaky objects which didn't rely on them such as mulebots and autolathes.

Fixes a few issues from the previous upgrade.
2014-11-04 14:27:46 +01:00

57 lines
1.8 KiB
Plaintext

/obj/machinery/transformer
name = "Automatic Robotic Factory 5000"
desc = "A large metalic machine with an entrance and an exit. A sign on the side reads, 'human go in, robot come out', human must be lying down and alive."
icon = 'icons/obj/recycling.dmi'
icon_state = "separator-AO1"
layer = MOB_LAYER+1 // Overhead
anchored = 1
density = 1
var/transform_dead = 0
var/transform_standing = 0
/obj/machinery/transformer/New()
// On us
..()
new /obj/machinery/conveyor(loc, WEST, 1)
/obj/machinery/transformer/Bumped(var/atom/movable/AM)
// HasEntered didn't like people lying down.
if(ishuman(AM))
// Only humans can enter from the west side, while lying down.
var/move_dir = get_dir(loc, AM.loc)
var/mob/living/carbon/human/H = AM
if((transform_standing || H.lying) && move_dir == EAST)// || move_dir == WEST)
AM.loc = src.loc
transform(AM)
/obj/machinery/transformer/proc/transform(var/mob/living/carbon/human/H)
if(stat & (BROKEN|NOPOWER))
return
if(!transform_dead && H.stat == DEAD)
playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
return
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
use_power(5000) // Use a lot of power.
var/mob/living/silicon/robot = H.Robotize()
robot.SetLockDown()
spawn(50) // So he can't jump out the gate right away.
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
if(robot)
robot.SetLockDown(0)
robot.notify_ai(1)
/obj/machinery/transformer/conveyor/New()
..()
var/turf/T = loc
if(T)
// Spawn Conveyour Belts
//East
var/turf/east = locate(T.x + 1, T.y, T.z)
if(istype(east, /turf/simulated/floor))
new /obj/machinery/conveyor(east, WEST, 1)
// West
var/turf/west = locate(T.x - 1, T.y, T.z)
if(istype(west, /turf/simulated/floor))
new /obj/machinery/conveyor(west, WEST, 1)