//Config stuff
#define PRISON_MOVETIME 150 //Time to station is milliseconds.
#define PRISON_STATION_AREATYPE "/area/shuttle/prison/station" //Type of the prison shuttle area for station
#define PRISON_DOCK_AREATYPE "/area/shuttle/prison/prison" //Type of the prison shuttle area for dock
var/prison_shuttle_moving_to_station = 0
var/prison_shuttle_moving_to_prison = 0
var/prison_shuttle_at_station = 0
var/prison_shuttle_can_send = 1
var/prison_shuttle_time = 0
var/prison_shuttle_timeleft = 0
/obj/machinery/computer/prison_shuttle
name = "Prison Shuttle Console"
icon = 'computer.dmi'
icon_state = "shuttle"
req_access = list(access_security)
var/temp = null
var/hacked = 0
var/allowedtocall = 0
var/prison_break = 0
/proc/prison_process()
while(prison_shuttle_time - world.timeofday > 0)
var/ticksleft = prison_shuttle_time - world.timeofday
if(ticksleft > 1e5)
prison_shuttle_time = world.timeofday + 10 // midnight rollover
prison_shuttle_timeleft = (ticksleft / 10)
sleep(5)
prison_shuttle_moving_to_station = 0
prison_shuttle_moving_to_prison = 0
switch(prison_shuttle_at_station)
if(0)
prison_shuttle_at_station = 1
if (prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
if (!prison_can_move())
usr << "\red The prison shuttle is unable to leave."
return
var/area/start_location = locate(/area/shuttle/prison/prison)
var/area/end_location = locate(/area/shuttle/prison/station)
var/list/dstturfs = list()
var/throwy = world.maxy
for(var/turf/T in end_location)
dstturfs += T
if(T.y < throwy)
throwy = T.y
// hey you, get out of the way!
for(var/turf/T in dstturfs)
// find the turf to move things to
var/turf/D = locate(T.x, throwy - 1, 1)
//var/turf/E = get_step(D, SOUTH)
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
if(istype(T, /turf/simulated))
del(T)
start_location.move_contents_to(end_location)
if(1)
prison_shuttle_at_station = 0
if (prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
if (!prison_can_move())
usr << "\red The prison shuttle is unable to leave."
return
var/area/start_location = locate(/area/shuttle/prison/station)
var/area/end_location = locate(/area/shuttle/prison/prison)
var/list/dstturfs = list()
var/throwy = world.maxy
for(var/turf/T in end_location)
dstturfs += T
if(T.y < throwy)
throwy = T.y
// hey you, get out of the way!
for(var/turf/T in dstturfs)
// find the turf to move things to
var/turf/D = locate(T.x, throwy - 1, 1)
//var/turf/E = get_step(D, SOUTH)
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
if(istype(T, /turf/simulated))
del(T)
start_location.move_contents_to(end_location)
/proc/prison_can_move()
if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return 0
else return 1
/obj/machinery/computer/prison_shuttle/attackby(I as obj, user as mob)
return src.attack_hand(user)
/obj/machinery/computer/prison_shuttle/attack_ai(var/mob/user as mob)
return src.attack_hand(user)
/obj/machinery/computer/prison_shuttle/attack_paw(var/mob/user as mob)
return src.attack_hand(user)
/obj/machinery/computer/prison_shuttle/attackby(I as obj, user as mob)
if(istype(I,/obj/item/weapon/card/emag))
user << "\blue Nothing happens."
else
return src.attack_hand(user)
/obj/machinery/computer/prison_shuttle/attack_hand(var/mob/user as mob)
if(!src.allowed(user))
user << "\red Access Denied."
return
if(prison_break)
user << "\red Unable to locate shuttle."
return
if(..())
return
user.machine = src
post_signal("prison")
var/dat
if (src.temp)
dat = src.temp
else
dat += {"
Prison Shuttle