Absolute paths for shuttle controller

This commit is contained in:
Kilakk
2013-08-04 00:19:37 -04:00
parent 603fa03826
commit 2eae729426

View File

@@ -45,11 +45,11 @@ datum/shuttle_controller
if(istype(A, /area/hallway)) if(istype(A, /area/hallway))
A.readyalert() A.readyalert()
proc/shuttlealert(var/X) datum/shuttle_controller/proc/shuttlealert(var/X)
alert = X alert = X
proc/recall() datum/shuttle_controller/proc/recall()
if(direction == 1) if(direction == 1)
var/timeleft = timeleft() var/timeleft = timeleft()
if(alert == 0) if(alert == 0)
@@ -72,7 +72,7 @@ datum/shuttle_controller
// returns the time (in seconds) before shuttle arrival // returns the time (in seconds) before shuttle arrival
// note if direction = -1, gives a count-up to SHUTTLEARRIVETIME // note if direction = -1, gives a count-up to SHUTTLEARRIVETIME
proc/timeleft() datum/shuttle_controller/proc/timeleft()
if(online) if(online)
var/timeleft = round((endtime - world.timeofday)/10 ,1) var/timeleft = round((endtime - world.timeofday)/10 ,1)
if(direction == 1 || direction == 2) if(direction == 1 || direction == 2)
@@ -83,13 +83,13 @@ datum/shuttle_controller
return SHUTTLEARRIVETIME return SHUTTLEARRIVETIME
// sets the time left to a given delay (in seconds) // sets the time left to a given delay (in seconds)
proc/settimeleft(var/delay) datum/shuttle_controller/proc/settimeleft(var/delay)
endtime = world.timeofday + delay * 10 endtime = world.timeofday + delay * 10
timelimit = delay timelimit = delay
// sets the shuttle direction // sets the shuttle direction
// 1 = towards SS13, -1 = back to centcom // 1 = towards SS13, -1 = back to centcom
proc/setdirection(var/dirn) datum/shuttle_controller/proc/setdirection(var/dirn)
if(direction == dirn) if(direction == dirn)
return return
direction = dirn direction = dirn
@@ -98,10 +98,9 @@ datum/shuttle_controller
endtime = world.timeofday + (SHUTTLEARRIVETIME*10 - ticksleft) endtime = world.timeofday + (SHUTTLEARRIVETIME*10 - ticksleft)
return return
proc/process() datum/shuttle_controller/proc/process()
emergency_shuttle datum/shuttle_controller/emergency_shuttle/process()
process()
if(!online) if(!online)
return return
var/timeleft = timeleft() var/timeleft = timeleft()
@@ -131,8 +130,7 @@ datum/shuttle_controller
start_location.move_contents_to(end_location, null, NORTH) start_location.move_contents_to(end_location, null, NORTH)
for(var/obj/machinery/door/unpowered/D in machines) for(var/obj/machinery/door/unpowered/shuttle/D in end_location)
if( get_area(D) == end_location )
spawn(0) spawn(0)
D.locked = 0 D.locked = 0
D.open() D.open()
@@ -326,6 +324,7 @@ datum/shuttle_controller
settimeleft(SHUTTLETRANSITTIME) settimeleft(SHUTTLETRANSITTIME)
start_location.move_contents_to(end_location, null, NORTH) start_location.move_contents_to(end_location, null, NORTH)
// Close shuttle doors, lock
for(var/obj/machinery/door/unpowered/shuttle/D in end_location) for(var/obj/machinery/door/unpowered/shuttle/D in end_location)
spawn(0) spawn(0)
D.close() D.close()
@@ -436,7 +435,7 @@ datum/shuttle_controller
var/direction = SOUTH var/direction = SOUTH
layer = 2 // TURF_LAYER layer = 2 // TURF_LAYER
New() /obj/effect/bgstar/New()
..() ..()
pixel_x += rand(-2,30) pixel_x += rand(-2,30)
pixel_y += rand(-2,30) pixel_y += rand(-2,30)
@@ -446,7 +445,7 @@ datum/shuttle_controller
speed = rand(2, 5) speed = rand(2, 5)
proc/startmove() /obj/effect/bgstar/proc/startmove()
while(src) while(src)
sleep(speed) sleep(speed)
@@ -463,10 +462,10 @@ datum/shuttle_controller
var/spawndir = SOUTH var/spawndir = SOUTH
var/spawning = 0 var/spawning = 0
West /obj/effect/starspawner/West
spawndir = WEST spawndir = WEST
proc/startspawn() /obj/effect/starspawner/proc/startspawn()
spawning = 1 spawning = 1
while(spawning) while(spawning)
sleep(rand(2, 30)) sleep(rand(2, 30))