mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-29 06:58:30 +01:00
Polaris Sync
This commit is contained in:
@@ -42,16 +42,30 @@
|
||||
if(!istype(docking_controller))
|
||||
world << "<span class='danger'>warning: shuttle with docking tag [docking_controller_tag] could not find it's controller!</span>"
|
||||
|
||||
// Return false to abort a jump, before the 'warmup' phase.
|
||||
/datum/shuttle/proc/pre_warmup_checks()
|
||||
return TRUE
|
||||
|
||||
// Ditto, but for afterwards.
|
||||
/datum/shuttle/proc/post_warmup_checks()
|
||||
return TRUE
|
||||
|
||||
/datum/shuttle/proc/short_jump(var/area/origin,var/area/destination)
|
||||
if(moving_status != SHUTTLE_IDLE)
|
||||
return
|
||||
|
||||
if(!pre_warmup_checks())
|
||||
return
|
||||
|
||||
moving_status = SHUTTLE_WARMUP
|
||||
spawn(warmup_time*10)
|
||||
|
||||
make_sounds(origin, HYPERSPACE_WARMUP)
|
||||
sleep(5 SECONDS) // so the sound finishes.
|
||||
|
||||
if(!post_warmup_checks())
|
||||
moving_status = SHUTTLE_IDLE
|
||||
|
||||
if (moving_status == SHUTTLE_IDLE)
|
||||
make_sounds(origin, HYPERSPACE_END)
|
||||
return //someone cancelled the launch
|
||||
@@ -66,6 +80,9 @@
|
||||
if(moving_status != SHUTTLE_IDLE)
|
||||
return
|
||||
|
||||
if(!pre_warmup_checks())
|
||||
return
|
||||
|
||||
//it would be cool to play a sound here
|
||||
moving_status = SHUTTLE_WARMUP
|
||||
spawn(warmup_time*10)
|
||||
@@ -73,6 +90,9 @@
|
||||
make_sounds(departing, HYPERSPACE_WARMUP)
|
||||
sleep(5 SECONDS) // so the sound finishes.
|
||||
|
||||
if(!post_warmup_checks())
|
||||
moving_status = SHUTTLE_IDLE
|
||||
|
||||
if (moving_status == SHUTTLE_IDLE)
|
||||
make_sounds(departing, HYPERSPACE_END)
|
||||
return //someone cancelled the launch
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
// The new arrivals shuttle.
|
||||
/datum/shuttle/ferry/arrivals
|
||||
name = "Arrivals"
|
||||
location = 1
|
||||
warmup_time = 25 // Warmup takes 5 seconds, so 30 total.
|
||||
always_process = TRUE
|
||||
var/launch_delay = 3
|
||||
|
||||
area_offsite = /area/shuttle/arrival/pre_game // not really 'pre game' but this area is already defined and unused
|
||||
area_station = /area/shuttle/arrival/station
|
||||
docking_controller_tag = "arrivals_shuttle"
|
||||
dock_target_station = "arrivals_dock"
|
||||
|
||||
// For debugging.
|
||||
/obj/machinery/computer/shuttle_control/arrivals
|
||||
name = "shuttle control console"
|
||||
req_access = list(access_cent_general)
|
||||
shuttle_tag = "Arrivals"
|
||||
|
||||
// Unlike most shuttles, the arrivals shuttle is completely automated, so we need to put some additional code here.
|
||||
|
||||
|
||||
// This proc checks if anyone is on the shuttle.
|
||||
/datum/shuttle/ferry/arrivals/proc/check_for_passengers(area/A)
|
||||
for(var/mob/living/L in A)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
// This is to stop the shuttle if someone tries to stow away when its leaving.
|
||||
/datum/shuttle/ferry/arrivals/post_warmup_checks()
|
||||
if(!location) // If we're at station.
|
||||
if(check_for_passengers(area_station))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/shuttle/ferry/arrivals/process()
|
||||
if(process_state == IDLE_STATE)
|
||||
|
||||
if(location) // If we're off-station (space).
|
||||
if(check_for_passengers(area_offsite)) // No point arriving with an empty shuttle.
|
||||
warmup_time = initial(warmup_time)
|
||||
launch()
|
||||
message_passengers(area_offsite, "Arriving at [using_map.station_name] in thirty seconds...")
|
||||
spawn(10 SECONDS)
|
||||
message_passengers(area_offsite, "Arriving at [using_map.station_name] in twenty seconds.")
|
||||
spawn(10 SECONDS)
|
||||
message_passengers(area_offsite, "Arriving at [using_map.station_name] in ten seconds. Please buckle up.")
|
||||
|
||||
else // We are at the station.
|
||||
if(!check_for_passengers(area_station)) // Don't leave with anyone.
|
||||
if(launch_delay) // Give some time to get on the docks so people don't get trapped inbetween the dock airlocks.
|
||||
launch_delay--
|
||||
else
|
||||
launch_delay = initial(launch_delay)
|
||||
warmup_time = 0 // Gotta go fast.
|
||||
launch()
|
||||
|
||||
..() // Do everything else
|
||||
|
||||
/datum/shuttle/ferry/arrivals/proc/message_passengers(area/A, var/message)
|
||||
for(var/mob/M in A)
|
||||
to_chat(M, message)
|
||||
|
||||
/*
|
||||
/datum/shuttle/ferry/arrivals/current_dock_target()
|
||||
if(location) // If we're off station.
|
||||
return null // Nothing to dock to in space.
|
||||
return ..()
|
||||
*/
|
||||
@@ -4,6 +4,7 @@
|
||||
var/location = 0 //0 = at area_station, 1 = at area_offsite
|
||||
var/direction = 0 //0 = going to station, 1 = going to offsite.
|
||||
var/process_state = IDLE_STATE
|
||||
var/always_process = FALSE
|
||||
|
||||
var/in_use = null //tells the controller whether this shuttle needs processing
|
||||
|
||||
|
||||
Reference in New Issue
Block a user