mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-20 15:21:29 +00:00
Reworks shuttles to be more extensible
Kudos to Zuhayr for laying the groundwork for this. Conflicts: code/controllers/master_controller.dm code/modules/shuttles/shuttle.dm
This commit is contained in:
@@ -69,7 +69,7 @@ datum/controller/game_controller/proc/setup()
|
|||||||
if(!garbage)
|
if(!garbage)
|
||||||
garbage = new /datum/controller/garbage_collector()
|
garbage = new /datum/controller/garbage_collector()
|
||||||
|
|
||||||
if(!shuttles) shuttles = new /datum/shuttle_controller()
|
if(!shuttles) setup_shuttles()
|
||||||
|
|
||||||
setup_objects()
|
setup_objects()
|
||||||
setupgenetics()
|
setupgenetics()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ var/global/datum/shuttle_controller/emergency_shuttle/emergency_shuttle
|
|||||||
datum/shuttle_controller/emergency_shuttle
|
datum/shuttle_controller/emergency_shuttle
|
||||||
var/alert = 0 //0 = emergency, 1 = crew cycle
|
var/alert = 0 //0 = emergency, 1 = crew cycle
|
||||||
|
|
||||||
location = 0 //0 = somewhere far away (in spess), 1 = at SS13, 2 = returned from SS13
|
var/location = 0 //0 = somewhere far away (in spess), 1 = at SS13, 2 = returned from SS13
|
||||||
var/online = 0
|
var/online = 0
|
||||||
var/direction = 1 //-1 = going back to central command, 1 = going to SS13, 2 = in transit to centcom (not recalled)
|
var/direction = 1 //-1 = going back to central command, 1 = going to SS13, 2 = in transit to centcom (not recalled)
|
||||||
|
|
||||||
|
|||||||
@@ -170,7 +170,8 @@ var/list/mechtoys = list(
|
|||||||
eta = round(ticksleft/600,1)
|
eta = round(ticksleft/600,1)
|
||||||
else
|
else
|
||||||
eta = 0
|
eta = 0
|
||||||
shuttles.move_shuttle("Supply")
|
var/datum/shuttle/S = shuttles["Supply"]
|
||||||
|
if (istype(S)) S.move()
|
||||||
moving = 0
|
moving = 0
|
||||||
at_station = !at_station
|
at_station = !at_station
|
||||||
|
|
||||||
@@ -505,7 +506,8 @@ var/list/mechtoys = list(
|
|||||||
supply_shuttle.moving = 0
|
supply_shuttle.moving = 0
|
||||||
supply_shuttle.at_station = !supply_shuttle.at_station
|
supply_shuttle.at_station = !supply_shuttle.at_station
|
||||||
|
|
||||||
shuttles.move_shuttle("Supply")
|
var/datum/shuttle/S = shuttles["Supply"]
|
||||||
|
if (istype(S)) S.move()
|
||||||
|
|
||||||
temp = "The supply shuttle has departed.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
temp = "The supply shuttle has departed.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -2047,17 +2047,19 @@
|
|||||||
|
|
||||||
if("moveshuttle")
|
if("moveshuttle")
|
||||||
|
|
||||||
if(!shuttles) return // Something is very wrong, the shuttle controller has not been created.
|
if(!shuttles) return // Something is very wrong, the global shuttle list has not been created.
|
||||||
|
|
||||||
feedback_inc("admin_secrets_fun_used",1)
|
feedback_inc("admin_secrets_fun_used",1)
|
||||||
feedback_add_details("admin_secrets_fun_used","ShA")
|
feedback_add_details("admin_secrets_fun_used","ShA")
|
||||||
|
|
||||||
var/shuttle_tag = input("Which shuttle do you want to call?") as null|anything in shuttles.location
|
var/shuttle_tag = input("Which shuttle do you want to call?") as null|anything in shuttles
|
||||||
|
|
||||||
if(shuttle_tag && !shuttles.moving[shuttle_tag])
|
if(shuttle_tag)
|
||||||
shuttles.jump_shuttle(shuttle_tag)
|
var/datum/shuttle/S = shuttles[shuttle_tag]
|
||||||
message_admins("\blue [key_name_admin(usr)] moved the [shuttle_tag] shuttle", 1)
|
if(istype(S) && S.moving_status == 0)
|
||||||
log_admin("[key_name(usr)] moved the [shuttle_tag] shuttle")
|
S.move()
|
||||||
|
message_admins("\blue [key_name_admin(usr)] moved the [shuttle_tag] shuttle", 1)
|
||||||
|
log_admin("[key_name(usr)] moved the [shuttle_tag] shuttle")
|
||||||
|
|
||||||
if("togglebombcap")
|
if("togglebombcap")
|
||||||
feedback_inc("admin_secrets_fun_used",1)
|
feedback_inc("admin_secrets_fun_used",1)
|
||||||
|
|||||||
@@ -5,153 +5,46 @@
|
|||||||
#define SHUTTLE_WARMUP 1
|
#define SHUTTLE_WARMUP 1
|
||||||
#define SHUTTLE_INTRANSIT 2
|
#define SHUTTLE_INTRANSIT 2
|
||||||
|
|
||||||
var/global/datum/shuttle_controller/shuttles
|
var/global/list/shuttles
|
||||||
|
|
||||||
/datum/shuttle_controller //This isn't really a controller...
|
/datum/shuttle
|
||||||
var/list/location = list()
|
var/location = 0 //0 = at area_station, 1 = at area_offsite
|
||||||
var/list/warmup = list()
|
var/warmup_time = 0
|
||||||
var/list/moving = list()
|
var/moving_status = SHUTTLE_IDLE //prevents people from doing things they shouldn't when the shuttle is in transit
|
||||||
var/list/areas_offsite = list()
|
var/in_use = 0 //prevents people from controlling the shuttle from different consoles at the same time
|
||||||
var/list/areas_station = list()
|
var/area_station
|
||||||
|
var/area_offsite
|
||||||
|
|
||||||
//Shuttles with multiple destinations don't quite behave in the same way as ferries.
|
var/docking_controller = null
|
||||||
var/list/multi_shuttles = list()
|
|
||||||
|
|
||||||
//docking stuff
|
|
||||||
var/list/docking_controller = list()
|
|
||||||
var/list/docking_targets = list()
|
var/list/docking_targets = list()
|
||||||
|
|
||||||
/datum/shuttle_controller/New()
|
/datum/shuttle/proc/short_jump(var/datum/shuttle/shuttle,var/area/origin,var/area/destination)
|
||||||
|
if(moving_status != SHUTTLE_IDLE) return
|
||||||
|
|
||||||
..()
|
moving_status = SHUTTLE_WARMUP
|
||||||
|
spawn(warmup_time*10)
|
||||||
|
move(origin, destination)
|
||||||
|
moving_status = SHUTTLE_IDLE
|
||||||
|
|
||||||
//Supply and escape shuttles.
|
/datum/shuttle/proc/long_jump(var/shuttle_tag,var/area/departing,var/area/destination,var/area/interim,var/travel_time)
|
||||||
location["Supply"] = 1
|
if(moving_status != SHUTTLE_IDLE) return
|
||||||
warmup["Supply"] = 0
|
|
||||||
moving["Supply"] = SHUTTLE_IDLE
|
|
||||||
areas_offsite["Supply"] = locate(/area/supply/dock)
|
|
||||||
areas_station["Supply"] = locate(/area/supply/station)
|
|
||||||
docking_targets["Supply"] = list(null, null)
|
|
||||||
|
|
||||||
// Admin shuttles.
|
moving_status = SHUTTLE_WARMUP
|
||||||
location["Centcom"] = 1
|
|
||||||
warmup["Centcom"] = 0
|
|
||||||
moving["Centcom"] = SHUTTLE_IDLE
|
|
||||||
areas_offsite["Centcom"] = locate(/area/shuttle/transport1/centcom)
|
|
||||||
areas_station["Centcom"] = locate(/area/shuttle/transport1/station)
|
|
||||||
docking_targets["Centcom"] = list(null, null)
|
|
||||||
|
|
||||||
location["Administration"] = 1
|
spawn(warmup_time*10)
|
||||||
warmup["Administration"] = 0
|
move(locate(departing),locate(interim))
|
||||||
moving["Administration"] = SHUTTLE_IDLE
|
|
||||||
areas_offsite["Administration"] = locate(/area/shuttle/administration/centcom)
|
|
||||||
areas_station["Administration"] = locate(/area/shuttle/administration/station)
|
|
||||||
docking_targets["Administration"] = list(null, null)
|
|
||||||
|
|
||||||
location["Alien"] = 0
|
|
||||||
warmup["Alien"] = 0
|
|
||||||
moving["Alien"] = SHUTTLE_IDLE
|
|
||||||
areas_offsite["Alien"] = locate(/area/shuttle/alien/base)
|
|
||||||
areas_station["Alien"] = locate(/area/shuttle/alien/mine)
|
|
||||||
docking_targets["Alien"] = list(null, null)
|
|
||||||
|
|
||||||
// Public shuttles.
|
|
||||||
location["Engineering"] = 1
|
|
||||||
warmup["Engineering"] = 10
|
|
||||||
moving["Engineering"] = SHUTTLE_IDLE
|
|
||||||
areas_offsite["Engineering"] = locate(/area/shuttle/constructionsite/site)
|
|
||||||
areas_station["Engineering"] = locate(/area/shuttle/constructionsite/station)
|
|
||||||
docking_targets["Engineering"] = list(null, null)
|
|
||||||
|
|
||||||
location["Mining"] = 0
|
|
||||||
warmup["Mining"] = 10
|
|
||||||
moving["Mining"] = SHUTTLE_IDLE
|
|
||||||
areas_offsite["Mining"] = locate(/area/shuttle/mining/outpost)
|
|
||||||
areas_station["Mining"] = locate(/area/shuttle/mining/station)
|
|
||||||
docking_targets["Mining"] = list(null, null)
|
|
||||||
|
|
||||||
location["Research"] = 0
|
|
||||||
warmup["Research"] = 10
|
|
||||||
moving["Research"] = SHUTTLE_IDLE
|
|
||||||
areas_offsite["Research"] = locate(/area/shuttle/research/outpost)
|
|
||||||
areas_station["Research"] = locate(/area/shuttle/research/station)
|
|
||||||
docking_targets["Research"] = list("research_dock_airlock", "research_dock_airlock")
|
|
||||||
|
|
||||||
//Vox Shuttle.
|
|
||||||
var/datum/multi_shuttle/VS = new
|
|
||||||
VS.origin = /area/shuttle/vox/station
|
|
||||||
|
|
||||||
VS.destinations = list(
|
|
||||||
"NSS Cyberiad" = /area/vox_station/northwest_solars
|
|
||||||
)
|
|
||||||
|
|
||||||
VS.announcer = "NSV Icarus"
|
|
||||||
VS.arrival_message = "Attention, Exodus, we just tracked a small target bypassing our defensive perimeter. Can't fire on it without hitting the station - you've got incoming visitors, like it or not."
|
|
||||||
VS.departure_message = "Your guests are pulling away, Exodus - moving too fast for us to draw a bead on them. Looks like they're heading out of the system at a rapid clip."
|
|
||||||
VS.interim = /area/vox_station/transit
|
|
||||||
|
|
||||||
multi_shuttles["Vox Skipjack"] = VS
|
|
||||||
location["Vox Skipjack"] = 1
|
|
||||||
warmup["Vox Skipjack"] = 10
|
|
||||||
moving["Vox Skipjack"] = SHUTTLE_IDLE
|
|
||||||
|
|
||||||
//Nuke Ops shuttle.
|
|
||||||
var/datum/multi_shuttle/MS = new
|
|
||||||
MS.origin = /area/syndicate_station/start
|
|
||||||
|
|
||||||
MS.destinations = list(
|
|
||||||
"Northwest of the station" = /area/syndicate_station/northwest,
|
|
||||||
"North of the station" = /area/syndicate_station/north,
|
|
||||||
"Northeast of the station" = /area/syndicate_station/northeast,
|
|
||||||
"Southwest of the station" = /area/syndicate_station/southwest,
|
|
||||||
"South of the station" = /area/syndicate_station/south,
|
|
||||||
"Southeast of the station" = /area/syndicate_station/southeast,
|
|
||||||
"Telecomms Satellite" = /area/syndicate_station/commssat,
|
|
||||||
"Mining Asteroid" = /area/syndicate_station/mining
|
|
||||||
)
|
|
||||||
|
|
||||||
MS.announcer = "NSV Icarus"
|
|
||||||
MS.arrival_message = "Attention, Exodus, you have a large signature approaching the station - looks unarmed to surface scans. We're too far out to intercept - brace for visitors."
|
|
||||||
MS.departure_message = "Your visitors are on their way out of the system, Exodus, burning delta-v like it's nothing. Good riddance."
|
|
||||||
MS.interim = /area/syndicate_station/transit
|
|
||||||
|
|
||||||
multi_shuttles["Syndicate"] = MS
|
|
||||||
location["Syndicate"] = 1
|
|
||||||
warmup["Syndicate"] = 10
|
|
||||||
moving["Syndicate"] = SHUTTLE_IDLE
|
|
||||||
|
|
||||||
|
|
||||||
/datum/shuttle_controller/proc/jump_shuttle(var/shuttle_tag,var/area/origin,var/area/destination)
|
|
||||||
if(moving[shuttle_tag] != SHUTTLE_IDLE) return
|
|
||||||
|
|
||||||
moving[shuttle_tag] = SHUTTLE_WARMUP
|
|
||||||
spawn(warmup[shuttle_tag]*10)
|
|
||||||
move_shuttle(shuttle_tag, origin, destination)
|
|
||||||
moving[shuttle_tag] = SHUTTLE_IDLE
|
|
||||||
|
|
||||||
//This is for shuttles with a timer before arrival such as the vox skipjack and the escape shuttle.
|
|
||||||
/datum/shuttle_controller/proc/jump_shuttle_long(var/shuttle_tag,var/area/departing,var/area/destination,var/area/interim,var/travel_time)
|
|
||||||
if(moving[shuttle_tag] != SHUTTLE_IDLE) return
|
|
||||||
|
|
||||||
moving[shuttle_tag] = SHUTTLE_WARMUP
|
|
||||||
|
|
||||||
spawn(warmup[shuttle_tag]*10)
|
|
||||||
move_shuttle(shuttle_tag,locate(departing),locate(interim))
|
|
||||||
|
|
||||||
sleep(travel_time)
|
sleep(travel_time)
|
||||||
|
|
||||||
move_shuttle(shuttle_tag,locate(interim),locate(destination))
|
move(locate(interim),locate(destination))
|
||||||
|
|
||||||
moving[shuttle_tag] = SHUTTLE_IDLE
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
|
moving_status = SHUTTLE_IDLE
|
||||||
|
|
||||||
//just moves the shuttle from A to B, if it can be moved
|
//just moves the shuttle from A to B, if it can be moved
|
||||||
/datum/shuttle_controller/proc/move_shuttle(var/shuttle_tag,var/area/origin,var/area/destination)
|
/datum/shuttle/proc/move(var/area/origin,var/area/destination)
|
||||||
|
|
||||||
//world << "move_shuttle() called for [shuttle_tag] leaving [origin] en route to [destination]."
|
//world << "move_shuttle() called for [shuttle_tag] leaving [origin] en route to [destination]."
|
||||||
if(!shuttle_tag || isnull(location[shuttle_tag]))
|
if(isnull(location))
|
||||||
return
|
return
|
||||||
|
|
||||||
var/area/area_going_to
|
var/area/area_going_to
|
||||||
@@ -159,16 +52,16 @@ var/global/datum/shuttle_controller/shuttles
|
|||||||
//world << "Using supplied destination [destination]."
|
//world << "Using supplied destination [destination]."
|
||||||
area_going_to = destination
|
area_going_to = destination
|
||||||
else
|
else
|
||||||
//world << "Using controller value [(location[shuttle_tag] == 1 ? areas_station[shuttle_tag] : areas_offsite[shuttle_tag])]."
|
//world << "Using controller value [(cur_location[shuttle_tag] == 1 ? areas_station[shuttle_tag] : areas_offsite[shuttle_tag])]."
|
||||||
area_going_to = (location[shuttle_tag] == 1 ? areas_station[shuttle_tag] : areas_offsite[shuttle_tag])
|
area_going_to = (location == 1 ? area_station : area_offsite)
|
||||||
|
|
||||||
var/area/area_coming_from
|
var/area/area_coming_from
|
||||||
if(origin)
|
if(origin)
|
||||||
//world << "Using supplied origin [origin]."
|
//world << "Using supplied origin [origin]."
|
||||||
area_coming_from = origin
|
area_coming_from = origin
|
||||||
else
|
else
|
||||||
//world << "Using controller value [(location[shuttle_tag] == 1 ? areas_offsite[shuttle_tag] : areas_station[shuttle_tag])]."
|
//world << "Using controller value [(cur_location[shuttle_tag] == 1 ? areas_offsite[shuttle_tag] : areas_station[shuttle_tag])]."
|
||||||
area_coming_from = (location[shuttle_tag] == 1 ? areas_offsite[shuttle_tag] : areas_station[shuttle_tag])
|
area_coming_from = (location == 1 ? area_offsite : area_station)
|
||||||
|
|
||||||
//world << "area_coming_from: [area_coming_from]"
|
//world << "area_coming_from: [area_coming_from]"
|
||||||
//world << "area_going_to: [area_going_to]"
|
//world << "area_going_to: [area_going_to]"
|
||||||
@@ -177,7 +70,7 @@ var/global/datum/shuttle_controller/shuttles
|
|||||||
//world << "cancelling move, shuttle will overlap."
|
//world << "cancelling move, shuttle will overlap."
|
||||||
return
|
return
|
||||||
|
|
||||||
moving[shuttle_tag] = SHUTTLE_INTRANSIT
|
moving_status = SHUTTLE_INTRANSIT
|
||||||
|
|
||||||
var/list/dstturfs = list()
|
var/list/dstturfs = list()
|
||||||
var/throwy = world.maxy
|
var/throwy = world.maxy
|
||||||
@@ -202,7 +95,7 @@ var/global/datum/shuttle_controller/shuttles
|
|||||||
|
|
||||||
area_coming_from.move_contents_to(area_going_to)
|
area_coming_from.move_contents_to(area_going_to)
|
||||||
|
|
||||||
location[shuttle_tag] = !location[shuttle_tag]
|
location = !location //this needs to change.
|
||||||
|
|
||||||
for(var/mob/M in area_going_to)
|
for(var/mob/M in area_going_to)
|
||||||
if(M.client)
|
if(M.client)
|
||||||
@@ -218,3 +111,102 @@ var/global/datum/shuttle_controller/shuttles
|
|||||||
M.Weaken(3)
|
M.Weaken(3)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/proc/setup_shuttles()
|
||||||
|
var/datum/shuttle/shuttle
|
||||||
|
|
||||||
|
//Supply and escape shuttles.
|
||||||
|
shuttle = new/datum/shuttle()
|
||||||
|
shuttle.location = 1
|
||||||
|
shuttle.area_offsite = locate(/area/supply/dock)
|
||||||
|
shuttle.area_station = locate(/area/supply/station)
|
||||||
|
shuttle.docking_targets = list(null, null)
|
||||||
|
shuttles["Supply"] = shuttle
|
||||||
|
|
||||||
|
// Admin shuttles.
|
||||||
|
shuttle = new/datum/shuttle()
|
||||||
|
shuttle.location = 1
|
||||||
|
shuttle.area_offsite = locate(/area/shuttle/transport1/centcom)
|
||||||
|
shuttle.area_station = locate(/area/shuttle/transport1/station)
|
||||||
|
shuttle.docking_targets = list(null, null)
|
||||||
|
shuttles["Centcom"] = shuttle
|
||||||
|
|
||||||
|
shuttle = new/datum/shuttle()
|
||||||
|
shuttle.location = 1
|
||||||
|
shuttle.area_offsite = locate(/area/shuttle/administration/centcom)
|
||||||
|
shuttle.area_station = locate(/area/shuttle/administration/station)
|
||||||
|
shuttle.docking_targets = list(null, null)
|
||||||
|
shuttles["Administration"] = shuttle
|
||||||
|
|
||||||
|
shuttle = new/datum/shuttle()
|
||||||
|
shuttle.area_offsite = locate(/area/shuttle/alien/base)
|
||||||
|
shuttle.area_station = locate(/area/shuttle/alien/mine)
|
||||||
|
shuttle.docking_targets = list(null, null)
|
||||||
|
shuttles["Alien"] = shuttle
|
||||||
|
|
||||||
|
// Public shuttles
|
||||||
|
shuttle = new/datum/shuttle()
|
||||||
|
shuttle.location = 1
|
||||||
|
shuttle.warmup_time = 10
|
||||||
|
shuttle.area_offsite = locate(/area/shuttle/constructionsite/site)
|
||||||
|
shuttle.area_station = locate(/area/shuttle/constructionsite/station)
|
||||||
|
shuttle.docking_targets = list(null, null)
|
||||||
|
shuttles["Engineering"] = shuttle
|
||||||
|
|
||||||
|
shuttle = new/datum/shuttle()
|
||||||
|
shuttle.warmup_time = 10
|
||||||
|
shuttle.area_offsite = locate(/area/shuttle/mining/outpost)
|
||||||
|
shuttle.area_station = locate(/area/shuttle/mining/station)
|
||||||
|
shuttle.docking_targets = list(null, null)
|
||||||
|
shuttles["Mining"] = shuttle
|
||||||
|
|
||||||
|
shuttle = new/datum/shuttle()
|
||||||
|
shuttle.warmup_time = 10
|
||||||
|
shuttle.area_offsite = locate(/area/shuttle/research/outpost)
|
||||||
|
shuttle.area_station = locate(/area/shuttle/research/station)
|
||||||
|
shuttle.docking_targets = list(null, null)
|
||||||
|
shuttles["Research"] = shuttle
|
||||||
|
|
||||||
|
//Vox Shuttle.
|
||||||
|
var/datum/shuttle/multi_shuttle/VS = new/datum/shuttle/multi_shuttle()
|
||||||
|
VS.origin = /area/shuttle/vox/station
|
||||||
|
|
||||||
|
VS.destinations = list(
|
||||||
|
"NSS Cyberiad" = /area/vox_station/northwest_solars
|
||||||
|
)
|
||||||
|
|
||||||
|
VS.announcer = "NSV Icarus"
|
||||||
|
VS.arrival_message = "Attention, Exodus, we just tracked a small target bypassing our defensive perimeter. Can't fire on it without hitting the station - you've got incoming visitors, like it or not."
|
||||||
|
VS.departure_message = "Your guests are pulling away, Exodus - moving too fast for us to draw a bead on them. Looks like they're heading out of the system at a rapid clip."
|
||||||
|
VS.interim = /area/vox_station/transit
|
||||||
|
|
||||||
|
VS.location = 1
|
||||||
|
VS.warmup_time = 10
|
||||||
|
shuttles["Vox Skipjack"] = VS
|
||||||
|
|
||||||
|
//Nuke Ops shuttle.
|
||||||
|
var/datum/shuttle/multi_shuttle/MS = new/datum/shuttle/multi_shuttle()
|
||||||
|
MS.origin = /area/syndicate_station/start
|
||||||
|
|
||||||
|
MS.destinations = list(
|
||||||
|
"Northwest of the station" = /area/syndicate_station/northwest,
|
||||||
|
"North of the station" = /area/syndicate_station/north,
|
||||||
|
"Northeast of the station" = /area/syndicate_station/northeast,
|
||||||
|
"Southwest of the station" = /area/syndicate_station/southwest,
|
||||||
|
"South of the station" = /area/syndicate_station/south,
|
||||||
|
"Southeast of the station" = /area/syndicate_station/southeast,
|
||||||
|
"Telecomms Satellite" = /area/syndicate_station/commssat,
|
||||||
|
"Mining Asteroid" = /area/syndicate_station/mining
|
||||||
|
)
|
||||||
|
|
||||||
|
MS.announcer = "NSV Icarus"
|
||||||
|
MS.arrival_message = "Attention, Exodus, you have a large signature approaching the station - looks unarmed to surface scans. We're too far out to intercept - brace for visitors."
|
||||||
|
MS.departure_message = "Your visitors are on their way out of the system, Exodus, burning delta-v like it's nothing. Good riddance."
|
||||||
|
MS.interim = /area/syndicate_station/transit
|
||||||
|
|
||||||
|
MS.location = 1
|
||||||
|
MS.warmup_time = 10
|
||||||
|
shuttles["Syndicate"] = MS
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
#define STATUS_IDLE
|
||||||
|
#define STATUS_LAUNCH
|
||||||
|
#define STATUS_ARRIVE
|
||||||
|
|
||||||
/obj/machinery/computer/shuttle_control
|
/obj/machinery/computer/shuttle_control
|
||||||
name = "shuttle control console"
|
name = "shuttle control console"
|
||||||
icon = 'icons/obj/computer.dmi'
|
icon = 'icons/obj/computer.dmi'
|
||||||
@@ -7,54 +11,46 @@
|
|||||||
|
|
||||||
//for mapping
|
//for mapping
|
||||||
var/shuttle_tag // Used to coordinate data in shuttle controller.
|
var/shuttle_tag // Used to coordinate data in shuttle controller.
|
||||||
|
var/datum/shuttle/shuttle
|
||||||
var/docking_controller_tag //tag of the controller used to coordinate docking
|
var/docking_controller_tag //tag of the controller used to coordinate docking
|
||||||
|
|
||||||
var/datum/computer/file/embedded_program/docking/docking_controller //the controller itself
|
var/datum/computer/file/embedded_program/docking/docking_controller //the controller itself
|
||||||
var/hacked = 0 // Has been emagged, no access restrictions.
|
var/hacked = 0 // Has been emagged, no access restrictions.
|
||||||
var/wait_for_launch = 0
|
|
||||||
|
|
||||||
/obj/machinery/computer/shuttle_control/initialize()
|
/obj/machinery/computer/shuttle_control/initialize()
|
||||||
|
shuttle = shuttles[shuttle_tag]
|
||||||
|
|
||||||
//search for our controller, if we have one.
|
//search for our controller, if we have one.
|
||||||
if (docking_controller_tag)
|
if (docking_controller_tag)
|
||||||
for (var/obj/machinery/embedded_controller/radio/C in machines) //only radio controllers are supported, for now...
|
for (var/obj/machinery/embedded_controller/radio/C in machines) //only radio controllers are supported, for now...
|
||||||
if (C.id_tag == docking_controller_tag && istype(C.program, /datum/computer/file/embedded_program/docking))
|
if (C.id_tag == docking_controller_tag && istype(C.program, /datum/computer/file/embedded_program/docking))
|
||||||
docking_controller = C.program
|
docking_controller = C.program
|
||||||
|
|
||||||
|
|
||||||
/obj/machinery/computer/shuttle_control/process()
|
/obj/machinery/computer/shuttle_control/process()
|
||||||
|
/*
|
||||||
|
switch (launch_status)
|
||||||
|
|
||||||
if (wait_for_launch)
|
if (wait_for_launch)
|
||||||
if (docking_controller && docking_controller.can_launch())
|
if (docking_controller && docking_controller.can_launch())
|
||||||
shuttles.jump_shuttle(shuttle_tag)
|
shuttles.jump_shuttle(shuttle_tag)
|
||||||
wait_for_launch = 0
|
wait_for_launch = 0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
/obj/machinery/computer/shuttle_control/attack_hand(user as mob)
|
/obj/machinery/computer/shuttle_control/attack_hand(user as mob)
|
||||||
|
|
||||||
if(..(user))
|
if(..(user))
|
||||||
return
|
return
|
||||||
src.add_fingerprint(user)
|
//src.add_fingerprint(user) //shouldn't need fingerprints just for looking at it.
|
||||||
|
|
||||||
//ui_interact()
|
ui_interact(user)
|
||||||
|
|
||||||
var/dat
|
|
||||||
|
|
||||||
dat = "<center>[shuttle_tag] Shuttle Control<hr>"
|
|
||||||
|
|
||||||
if(waiting || shuttles.moving[shuttle_tag])
|
|
||||||
dat += "Location: <font color='red'>Moving</font> <br>"
|
|
||||||
else
|
|
||||||
dat += "Location: [shuttles.location[shuttle_tag] ? "Offsite" : "Station"] <br>"
|
|
||||||
|
|
||||||
dat += "<b><A href='?src=\ref[src];move=[1]'>Send</A></b></center>"
|
|
||||||
|
|
||||||
|
|
||||||
user << browse("[dat]", "window=[shuttle_tag]shuttlecontrol;size=200x150")
|
|
||||||
*/
|
|
||||||
|
|
||||||
/obj/machinery/computer/shuttle_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
/obj/machinery/computer/shuttle_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||||
var/data[0]
|
var/data[0]
|
||||||
|
|
||||||
var/shuttle_state
|
var/shuttle_state
|
||||||
switch(shuttles.moving[shuttle_tag])
|
switch(shuttle.moving_status)
|
||||||
if(SHUTTLE_IDLE) shuttle_state = "idle"
|
if(SHUTTLE_IDLE) shuttle_state = "idle"
|
||||||
if(SHUTTLE_WARMUP) shuttle_state = "warmup"
|
if(SHUTTLE_WARMUP) shuttle_state = "warmup"
|
||||||
if(SHUTTLE_INTRANSIT) shuttle_state = "in_transit"
|
if(SHUTTLE_INTRANSIT) shuttle_state = "in_transit"
|
||||||
@@ -62,7 +58,7 @@
|
|||||||
if (docking_controller)
|
if (docking_controller)
|
||||||
data = list(
|
data = list(
|
||||||
"shuttle_state" = shuttle_state,
|
"shuttle_state" = shuttle_state,
|
||||||
"shuttle_loc" = shuttles.location[shuttle_tag],
|
"shuttle_loc" = shuttle.location,
|
||||||
"has_docking" = 1,
|
"has_docking" = 1,
|
||||||
"docking_status" = docking_controller.get_docking_status(),
|
"docking_status" = docking_controller.get_docking_status(),
|
||||||
"override_enabled" = docking_controller.override_enabled,
|
"override_enabled" = docking_controller.override_enabled,
|
||||||
@@ -70,7 +66,7 @@
|
|||||||
else
|
else
|
||||||
data = list(
|
data = list(
|
||||||
"shuttle_state" = shuttle_state,
|
"shuttle_state" = shuttle_state,
|
||||||
"shuttle_loc" = shuttles.location[shuttle_tag],
|
"shuttle_loc" = shuttle.location,
|
||||||
"has_docking" = 0,
|
"has_docking" = 0,
|
||||||
"docking_status" = null,
|
"docking_status" = null,
|
||||||
"override_enabled" = null,
|
"override_enabled" = null,
|
||||||
@@ -84,6 +80,7 @@
|
|||||||
ui.open()
|
ui.open()
|
||||||
ui.set_auto_update(1)
|
ui.set_auto_update(1)
|
||||||
|
|
||||||
|
//TODO: Canceling launches
|
||||||
/obj/machinery/computer/shuttle_control/Topic(href, href_list)
|
/obj/machinery/computer/shuttle_control/Topic(href, href_list)
|
||||||
if(..())
|
if(..())
|
||||||
return
|
return
|
||||||
@@ -91,9 +88,9 @@
|
|||||||
src.add_fingerprint(usr)
|
src.add_fingerprint(usr)
|
||||||
|
|
||||||
if(href_list["move"])
|
if(href_list["move"])
|
||||||
if (!shuttles.moving[shuttle_tag])
|
if (shuttle.moving_status == SHUTTLE_IDLE)
|
||||||
usr << "\blue [shuttle_tag] Shuttle recieved message and will be sent shortly."
|
usr << "\blue [shuttle_tag] Shuttle recieved message and will be sent shortly."
|
||||||
wait_for_launch = 1
|
shuttle.short_jump()
|
||||||
else
|
else
|
||||||
usr << "\blue [shuttle_tag] Shuttle is already moving."
|
usr << "\blue [shuttle_tag] Shuttle is already moving."
|
||||||
|
|
||||||
@@ -114,10 +111,9 @@
|
|||||||
/proc/setup_shuttle_docks()
|
/proc/setup_shuttle_docks()
|
||||||
var/list/setup_complete = list() //so we dont setup the same shuttle repeatedly
|
var/list/setup_complete = list() //so we dont setup the same shuttle repeatedly
|
||||||
|
|
||||||
for (var/obj/machinery/computer/shuttle_control/S in machines)
|
for (var/obj/machinery/computer/shuttle_control/SC in machines)
|
||||||
var/location = shuttles.location[S.shuttle_tag]
|
var/dock_target = SC.shuttle.docking_targets[SC.shuttle.location+1] //damned byond is 1-indexed - don't forget
|
||||||
var/dock_target = shuttles.docking_targets[S.shuttle_tag][location+1] //damned byond is 1-indexed - don't forget
|
|
||||||
|
|
||||||
if (!(S.shuttle_tag in setup_complete) && S.docking_controller && dock_target)
|
if (!(SC.shuttle_tag in setup_complete) && SC.docking_controller && dock_target)
|
||||||
S.docking_controller.initiate_docking(dock_target)
|
SC.docking_controller.initiate_docking(dock_target)
|
||||||
setup_complete += S.shuttle_tag
|
setup_complete += SC.shuttle_tag
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
//This is a holder for things like the Vox and Nuke shuttle.
|
//This is a holder for things like the Vox and Nuke shuttle.
|
||||||
/datum/multi_shuttle
|
/datum/shuttle/multi_shuttle
|
||||||
|
|
||||||
var/cloaked = 1
|
var/cloaked = 1
|
||||||
var/at_origin = 1
|
var/at_origin = 1
|
||||||
@@ -17,18 +17,18 @@
|
|||||||
var/area/origin
|
var/area/origin
|
||||||
var/return_warning = 0
|
var/return_warning = 0
|
||||||
|
|
||||||
/datum/multi_shuttle/New()
|
/datum/shuttle/multi_shuttle/New()
|
||||||
..()
|
..()
|
||||||
if(origin) last_departed = origin
|
if(origin) last_departed = origin
|
||||||
|
|
||||||
/datum/multi_shuttle/proc/announce_departure()
|
/datum/shuttle/multi_shuttle/proc/announce_departure()
|
||||||
|
|
||||||
if(cloaked || isnull(departure_message))
|
if(cloaked || isnull(departure_message))
|
||||||
return
|
return
|
||||||
|
|
||||||
command_alert(departure_message,(announcer ? announcer : "Central Command"))
|
command_alert(departure_message,(announcer ? announcer : "Central Command"))
|
||||||
|
|
||||||
/datum/multi_shuttle/proc/announce_arrival()
|
/datum/shuttle/multi_shuttle/proc/announce_arrival()
|
||||||
|
|
||||||
if(cloaked || isnull(arrival_message))
|
if(cloaked || isnull(arrival_message))
|
||||||
return
|
return
|
||||||
@@ -44,14 +44,14 @@
|
|||||||
return
|
return
|
||||||
src.add_fingerprint(user)
|
src.add_fingerprint(user)
|
||||||
|
|
||||||
var/datum/multi_shuttle/MS = shuttles.multi_shuttles[shuttle_tag]
|
var/datum/shuttle/multi_shuttle/MS = shuttles[shuttle_tag]
|
||||||
if(!istype(MS)) return
|
if(!istype(MS)) return
|
||||||
|
|
||||||
var/dat
|
var/dat
|
||||||
dat = "<center>[shuttle_tag] Ship Control<hr>"
|
dat = "<center>[shuttle_tag] Ship Control<hr>"
|
||||||
|
|
||||||
|
|
||||||
if(shuttles.moving[shuttle_tag])
|
if(MS.moving_status != SHUTTLE_IDLE)
|
||||||
dat += "Location: <font color='red'>Moving</font> <br>"
|
dat += "Location: <font color='red'>Moving</font> <br>"
|
||||||
else
|
else
|
||||||
var/area/areacheck = get_area(src)
|
var/area/areacheck = get_area(src)
|
||||||
@@ -76,10 +76,10 @@
|
|||||||
usr.set_machine(src)
|
usr.set_machine(src)
|
||||||
src.add_fingerprint(usr)
|
src.add_fingerprint(usr)
|
||||||
|
|
||||||
var/datum/multi_shuttle/MS = shuttles.multi_shuttles[shuttle_tag]
|
var/datum/shuttle/multi_shuttle/MS = shuttles[shuttle_tag]
|
||||||
if(!istype(MS)) return
|
if(!istype(MS)) return
|
||||||
|
|
||||||
if (shuttles.moving[shuttle_tag])
|
if (MS.moving_status != SHUTTLE_IDLE)
|
||||||
usr << "\blue [shuttle_tag] vessel is moving."
|
usr << "\blue [shuttle_tag] vessel is moving."
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -99,21 +99,17 @@
|
|||||||
MS.return_warning = 1
|
MS.return_warning = 1
|
||||||
return
|
return
|
||||||
|
|
||||||
shuttles.jump_shuttle_long(shuttle_tag,MS.last_departed,MS.origin,MS.interim,MS.move_time)
|
MS.long_jump(MS.last_departed,MS.origin,MS.interim,MS.move_time)
|
||||||
MS.last_departed = MS.origin
|
MS.last_departed = MS.origin
|
||||||
MS.at_origin = 1
|
MS.at_origin = 1
|
||||||
|
|
||||||
if(href_list["toggle_cloak"])
|
if(href_list["toggle_cloak"])
|
||||||
|
|
||||||
if(!shuttles.multi_shuttles) return
|
|
||||||
|
|
||||||
MS.cloaked = !MS.cloaked
|
MS.cloaked = !MS.cloaked
|
||||||
usr << "\red Ship stealth systems have been [(MS.cloaked ? "activated. The station will not" : "deactivated. The station will")] be warned of our arrival."
|
usr << "\red Ship stealth systems have been [(MS.cloaked ? "activated. The station will not" : "deactivated. The station will")] be warned of our arrival."
|
||||||
|
|
||||||
if(href_list["move_multi"])
|
if(href_list["move_multi"])
|
||||||
|
|
||||||
if(!shuttles.multi_shuttles) return
|
|
||||||
|
|
||||||
var/choice = input("Select a destination.") as null|anything in MS.destinations
|
var/choice = input("Select a destination.") as null|anything in MS.destinations
|
||||||
if(!choice) return
|
if(!choice) return
|
||||||
|
|
||||||
@@ -124,7 +120,8 @@
|
|||||||
MS.last_departed = MS.origin
|
MS.last_departed = MS.origin
|
||||||
MS.at_origin = 0
|
MS.at_origin = 0
|
||||||
|
|
||||||
shuttles.jump_shuttle_long(shuttle_tag,MS.last_departed,MS.destinations[choice],MS.interim,MS.move_time)
|
|
||||||
|
MS.long_jump(MS.last_departed,MS.destinations[choice],MS.interim,MS.move_time)
|
||||||
MS.last_departed = MS.destinations[choice]
|
MS.last_departed = MS.destinations[choice]
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -132,7 +129,7 @@
|
|||||||
|
|
||||||
MS.announce_departure()
|
MS.announce_departure()
|
||||||
|
|
||||||
shuttles.jump_shuttle(shuttle_tag,locate(MS.last_departed),locate(MS.destinations[choice]))
|
MS.short_jump(locate(MS.last_departed),locate(MS.destinations[choice]))
|
||||||
MS.last_departed = MS.destinations[choice]
|
MS.last_departed = MS.destinations[choice]
|
||||||
|
|
||||||
updateUsrDialog()
|
updateUsrDialog()
|
||||||
Reference in New Issue
Block a user