mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
Absolute paths for shuttle controller
This commit is contained in:
@@ -45,11 +45,11 @@ datum/shuttle_controller
|
||||
if(istype(A, /area/hallway))
|
||||
A.readyalert()
|
||||
|
||||
proc/shuttlealert(var/X)
|
||||
datum/shuttle_controller/proc/shuttlealert(var/X)
|
||||
alert = X
|
||||
|
||||
|
||||
proc/recall()
|
||||
datum/shuttle_controller/proc/recall()
|
||||
if(direction == 1)
|
||||
var/timeleft = timeleft()
|
||||
if(alert == 0)
|
||||
@@ -72,7 +72,7 @@ datum/shuttle_controller
|
||||
|
||||
// returns the time (in seconds) before shuttle arrival
|
||||
// note if direction = -1, gives a count-up to SHUTTLEARRIVETIME
|
||||
proc/timeleft()
|
||||
datum/shuttle_controller/proc/timeleft()
|
||||
if(online)
|
||||
var/timeleft = round((endtime - world.timeofday)/10 ,1)
|
||||
if(direction == 1 || direction == 2)
|
||||
@@ -83,13 +83,13 @@ datum/shuttle_controller
|
||||
return SHUTTLEARRIVETIME
|
||||
|
||||
// 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
|
||||
timelimit = delay
|
||||
|
||||
// sets the shuttle direction
|
||||
// 1 = towards SS13, -1 = back to centcom
|
||||
proc/setdirection(var/dirn)
|
||||
datum/shuttle_controller/proc/setdirection(var/dirn)
|
||||
if(direction == dirn)
|
||||
return
|
||||
direction = dirn
|
||||
@@ -98,10 +98,9 @@ datum/shuttle_controller
|
||||
endtime = world.timeofday + (SHUTTLEARRIVETIME*10 - ticksleft)
|
||||
return
|
||||
|
||||
proc/process()
|
||||
datum/shuttle_controller/proc/process()
|
||||
|
||||
emergency_shuttle
|
||||
process()
|
||||
datum/shuttle_controller/emergency_shuttle/process()
|
||||
if(!online)
|
||||
return
|
||||
var/timeleft = timeleft()
|
||||
@@ -131,8 +130,7 @@ datum/shuttle_controller
|
||||
|
||||
start_location.move_contents_to(end_location, null, NORTH)
|
||||
|
||||
for(var/obj/machinery/door/unpowered/D in machines)
|
||||
if( get_area(D) == end_location )
|
||||
for(var/obj/machinery/door/unpowered/shuttle/D in end_location)
|
||||
spawn(0)
|
||||
D.locked = 0
|
||||
D.open()
|
||||
@@ -326,6 +324,7 @@ datum/shuttle_controller
|
||||
settimeleft(SHUTTLETRANSITTIME)
|
||||
start_location.move_contents_to(end_location, null, NORTH)
|
||||
|
||||
// Close shuttle doors, lock
|
||||
for(var/obj/machinery/door/unpowered/shuttle/D in end_location)
|
||||
spawn(0)
|
||||
D.close()
|
||||
@@ -436,7 +435,7 @@ datum/shuttle_controller
|
||||
var/direction = SOUTH
|
||||
layer = 2 // TURF_LAYER
|
||||
|
||||
New()
|
||||
/obj/effect/bgstar/New()
|
||||
..()
|
||||
pixel_x += rand(-2,30)
|
||||
pixel_y += rand(-2,30)
|
||||
@@ -446,7 +445,7 @@ datum/shuttle_controller
|
||||
|
||||
speed = rand(2, 5)
|
||||
|
||||
proc/startmove()
|
||||
/obj/effect/bgstar/proc/startmove()
|
||||
|
||||
while(src)
|
||||
sleep(speed)
|
||||
@@ -463,10 +462,10 @@ datum/shuttle_controller
|
||||
var/spawndir = SOUTH
|
||||
var/spawning = 0
|
||||
|
||||
West
|
||||
/obj/effect/starspawner/West
|
||||
spawndir = WEST
|
||||
|
||||
proc/startspawn()
|
||||
/obj/effect/starspawner/proc/startspawn()
|
||||
spawning = 1
|
||||
while(spawning)
|
||||
sleep(rand(2, 30))
|
||||
|
||||
Reference in New Issue
Block a user