mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-28 11:02:08 +00:00
* tgui the beginning * binaries and the like * Bring in the last of it * Example radio UI * delete example * NTOS Main Menu, start on manifest, tgui states * tasks.json * gunnery ui pt 1 * okay * fix everything * scss update * oops * manifest gigablast * downloader part 1 * download prt 2 * NTOSDownloader final * mfw committing to_worlds * gunnery console pt2 * i cooked * targeting (finished) * one vueui down * voting ui almost done * MY MIND FEELS LIKE AN ARCH ENEMYYYY * voting ui down * photocopier * ntos config + download fixes * photocopier 2 * refactor define * NTOS client manager + fixes * fax machine final (it also uses toner now) * marching forwards... left behind... * ntnrc part 1 * canister * add quotes * portable pumps pt1 + more backgrounds * oops * finish the portable pump * freezers so I'll keep on pushing forward... you haven't seen the last of me... oooooooh... * doors ui pt1 * finish doors UI (forgive me wildkins it's a bit of shitcode) * vitals monitor, make things use labeled lists, new backgrounds * mais j'envoyé aucun mayday... * maglock pt1 * pour ça je me suis perdu... * infrared * fix that * prox sensor pt1 * prox sensor * signaler (this was actually pretty hard) * atmos control pt1 * atmos control pt1.1 * atmos pt 2 * fuel injector * multitool UI * jammer * list viewer * APC * portgen * targeting console updates + SMES ui * new themes, shield generator * supermatter * Add ore detector and (shitty) NTNet Relay * orderterminal pt1 * orderterminal pt2 * smartfridge * Add (air-)tank GUI update ore detector size * Adds Transfer Valves * Add AtmoScrubber * analyzer pt1 * weapons analyzer pt2 * bodyscanner pt1 * bodyscanner pt2 * fix this shitcode * seed storage * appearance changer * appearance changer final * sleeper pt1 * sleeper * gps * vehicles * chem dispenser * lily request * holopad * tgui modules pt1 * ppanel * damage menu * fixes * im here too now * follow menu, search bars * quikpay * quikpay fixes * circuit printer * ppanel * ppanel updates * pai * turret controls (i want to kill myself) * tweak * remove the boardgame * guntracker * implant tracker * penal mechs come close to me, come close to me * chem codex * pai radio * doorjack * pai directives * signaler removal, sensors * ghost spawner * spawnpoint * fixes * teleporter * one more to the chopping block * account database * remove divider * scanner, atmos * latejoin ui pt1 * latejoin * records pt1 * RECORDS UI DONE * delete interpreter & records * CHAT FUCKING CLIENT * data updates * fix some things * final UI, log * basic nanoui fix * antag panel * remove vueui * atm update * vending update * warrants, cameras * ntmonitor * time comes for all * preserve this legacy * bring that back (oops) * rcon, ui auto update for computer UIs, remove rcon computers * alarm monitoring (a bit broke and also todo: add custom alarm monitoring programs to a few consoles) * A LIKE SUPREME * a * power monitor * lights on * fuck this code, fuck nanoui modules, and fuck nanoui * LEAVE IT OH SO FAR BEHIND * fix alarm monitoring for synths * I SAW IN YOU WHAT LIFE WAS MISSING * comms console * idcard and record updates * turn the light on * arcade * pt2 * news browser * static * crusher * f * COULD I JUST SLEIGH THE GOLD FROM THE BALLS? I'M SO FRUSTRATED OH COULD YOU TELL? IF I HEAR ONE MORE VUEUI OR ONE NANOUI I'M GONNA LOSE IT SO LET ME GOOOOOOOOOOOOOOOOO * codeowners & suit sensors * html ui style removal * make lint happy * tgchat * tgpanels pt1 * THE SOUL LONGS FOR OBLIVION!!!!!!!!!!!!!!!!! * figure out why stat isnt working * goodbye ping * shhh * stat updates * An oath sworn in scors! Omni vortex lies! * final almost edits * fix that * last skin adjustments * resist and disorder * i slowly get up and turn off the noise, already fed up... * pleaseeeeeeeeeeeeeee * THE CREDIT LARP IS NECESSARY * i hold the keys * RISE UP * fix that? * harry's suggestions xoxo * runtime fix pt2 * You are the only thing that I still care about * fix runtimes and cl * whoops * misc fixes * fix that too * adds build workflow * f * Update update_tgui.yml * adds some needed steps * ATM * misc fixes and tweaks * fixes 2 * make newscasters usable and fix use power on freezers * turret control is clearer * remove duplicate * makes some verb tabs work properly * makes verbs work properly for real * sans moi * fixes pt2 * fix the chat unnecessarily reloading * fixes * epic * fixes * fix missing consoles --------- Co-authored-by: John Wildkins <john.wildkins@gmail.com> Co-authored-by: Matt Atlas <liermattia@gmail.com> Co-authored-by: harryob <55142896+harryob@users.noreply.github.com> Co-authored-by: Werner <Arrow768@users.noreply.github.com> Co-authored-by: Geeves <ggrobler447@gmail.com> Co-authored-by: harryob <me@harryob.live>
186 lines
8.0 KiB
Plaintext
186 lines
8.0 KiB
Plaintext
var/datum/controller/subsystem/shuttle/SSshuttle
|
|
|
|
/datum/controller/subsystem/shuttle
|
|
name = "Shuttle"
|
|
wait = 2 SECONDS
|
|
priority = SS_PRIORITY_SHUTTLE
|
|
init_order = SS_INIT_MISC //Should be initialized after all maploading is over and atoms are initialized, to ensure that landmarks have been initialized.
|
|
|
|
var/overmap_halted = FALSE //Whether ships can move on the overmap; used for adminbus.
|
|
var/list/ships = list() //List of all ships.
|
|
var/list/shuttles = list() //maps shuttle tags to shuttle datums, so that they can be looked up.
|
|
var/list/process_shuttles = list() //simple list of shuttles, for processing
|
|
var/list/registered_shuttle_landmarks = list()
|
|
var/last_landmark_registration_time
|
|
var/list/docking_registry = list() //Docking controller tag -> docking controller program, mostly for init purposes.
|
|
var/list/shuttle_areas = list() //All the areas of all shuttles.
|
|
|
|
var/list/lonely_shuttle_computers = list() //shuttle computers that haven't been attached to their shuttles yet
|
|
|
|
var/list/landmarks_awaiting_sector = list() //Stores automatic landmarks that are waiting for a sector to finish loading.
|
|
var/list/landmarks_still_needed = list() //Stores landmark_tags that need to be assigned to the sector (landmark_tag = sector) when registered.
|
|
var/list/shuttles_to_initialize = list() //A queue for shuttles to initialize at the appropriate time.
|
|
var/list/sectors_to_initialize //Used to find all sector objects at the appropriate time.
|
|
var/list/initialized_sectors = list()
|
|
var/list/entry_points_to_initialize = list() //Entrypoints must initialize after the shuttles are done.
|
|
var/list/weapons_to_initialize = list() //Ditto above but for ship guns.
|
|
var/block_queue = TRUE
|
|
|
|
var/tmp/list/working_shuttles
|
|
|
|
/datum/controller/subsystem/shuttle/New()
|
|
NEW_SS_GLOBAL(SSshuttle)
|
|
|
|
/datum/controller/subsystem/shuttle/Initialize()
|
|
last_landmark_registration_time = world.time
|
|
for(var/shuttle_type in subtypesof(/datum/shuttle)) // This accounts for most shuttles, though away maps can queue up more.
|
|
var/datum/shuttle/shuttle = shuttle_type
|
|
if(!(shuttle in current_map.map_shuttles))
|
|
continue
|
|
if(!initial(shuttle.defer_initialisation))
|
|
LAZYDISTINCTADD(shuttles_to_initialize, shuttle_type)
|
|
block_queue = FALSE
|
|
clear_init_queue()
|
|
. = ..()
|
|
|
|
/datum/controller/subsystem/shuttle/fire(resumed = FALSE)
|
|
if (!resumed)
|
|
working_shuttles = process_shuttles.Copy()
|
|
|
|
while(working_shuttles.len)
|
|
var/datum/shuttle/shuttle = working_shuttles[working_shuttles.len]
|
|
working_shuttles.len--
|
|
if(shuttle.process_state && (shuttle.process() == PROCESS_KILL))
|
|
process_shuttles -= shuttle
|
|
|
|
if(TICK_CHECK)
|
|
return
|
|
|
|
/datum/controller/subsystem/shuttle/proc/clear_init_queue()
|
|
if(block_queue)
|
|
return
|
|
initialize_shuttles()
|
|
initialize_sectors()
|
|
initialize_entrypoints()
|
|
initialize_ship_weapons()
|
|
|
|
/datum/controller/subsystem/shuttle/proc/initialize_entrypoints()
|
|
for(var/obj/effect/landmark/entry_point/EP in entry_points_to_initialize)
|
|
var/obj/effect/overmap/visitable/ship/S = EP.get_candidate()
|
|
if(istype(S))
|
|
LAZYADD(S.entry_points, EP)
|
|
entry_points_to_initialize.Cut()
|
|
|
|
/datum/controller/subsystem/shuttle/proc/initialize_ship_weapons()
|
|
for(var/obj/machinery/ship_weapon/SW in weapons_to_initialize)
|
|
SW.sync_linked()
|
|
if(SW.linked)
|
|
LAZYADD(SW.linked.ship_weapons, SW)
|
|
weapons_to_initialize.Cut()
|
|
|
|
/datum/controller/subsystem/shuttle/proc/initialize_shuttles()
|
|
var/list/shuttles_made = list()
|
|
for(var/shuttle_type in shuttles_to_initialize)
|
|
var/shuttle = initialize_shuttle(shuttle_type)
|
|
if(shuttle)
|
|
shuttles_made += shuttle
|
|
hook_up_motherships(shuttles_made)
|
|
shuttles_to_initialize = null
|
|
|
|
/datum/controller/subsystem/shuttle/proc/initialize_sectors()
|
|
for(var/sector in sectors_to_initialize)
|
|
initialize_sector(sector)
|
|
sectors_to_initialize = null
|
|
|
|
/datum/controller/subsystem/shuttle/proc/register_landmark(shuttle_landmark_tag, obj/effect/shuttle_landmark/shuttle_landmark)
|
|
if (registered_shuttle_landmarks[shuttle_landmark_tag])
|
|
CRASH("Attempted to register shuttle landmark with tag [shuttle_landmark_tag], but it is already registered!")
|
|
if (istype(shuttle_landmark))
|
|
registered_shuttle_landmarks[shuttle_landmark_tag] = shuttle_landmark
|
|
last_landmark_registration_time = world.time
|
|
|
|
var/obj/effect/overmap/visitable/O = landmarks_still_needed[shuttle_landmark_tag]
|
|
if(O) //These need to be added to sectors, which we handle.
|
|
try_add_landmark_tag(shuttle_landmark_tag, O)
|
|
landmarks_still_needed -= shuttle_landmark_tag
|
|
else if(istype(shuttle_landmark, /obj/effect/shuttle_landmark/automatic)) //These find their sector automatically
|
|
O = map_sectors["[shuttle_landmark.z]"]
|
|
if(O)
|
|
O.add_landmark(shuttle_landmark, shuttle_landmark.shuttle_restricted)
|
|
else
|
|
landmarks_awaiting_sector += shuttle_landmark
|
|
|
|
/datum/controller/subsystem/shuttle/proc/get_landmark(var/shuttle_landmark_tag)
|
|
return registered_shuttle_landmarks[shuttle_landmark_tag]
|
|
|
|
//Checks if the given sector's landmarks have initialized; if so, registers them with the sector, if not, marks them for assignment after they come in.
|
|
//Also adds automatic landmarks that were waiting on their sector to spawn.
|
|
/datum/controller/subsystem/shuttle/proc/initialize_sector(obj/effect/overmap/visitable/given_sector)
|
|
given_sector.populate_sector_objects() // This is a late init operation that sets up the sector's map_z and does non-overmap-related init tasks.
|
|
|
|
for(var/landmark_tag in given_sector.initial_generic_waypoints)
|
|
if(!try_add_landmark_tag(landmark_tag, given_sector))
|
|
landmarks_still_needed[landmark_tag] = given_sector
|
|
|
|
for(var/shuttle_name in given_sector.initial_restricted_waypoints)
|
|
for(var/landmark_tag in given_sector.initial_restricted_waypoints[shuttle_name])
|
|
if(!try_add_landmark_tag(landmark_tag, given_sector))
|
|
landmarks_still_needed[landmark_tag] = given_sector
|
|
|
|
var/landmarks_to_check = landmarks_awaiting_sector.Copy()
|
|
for(var/thing in landmarks_to_check)
|
|
var/obj/effect/shuttle_landmark/automatic/landmark = thing
|
|
if(landmark.z in given_sector.map_z)
|
|
given_sector.add_landmark(landmark, landmark.shuttle_restricted)
|
|
landmarks_awaiting_sector -= landmark
|
|
|
|
initialized_sectors |= given_sector
|
|
|
|
/datum/controller/subsystem/shuttle/proc/try_add_landmark_tag(landmark_tag, obj/effect/overmap/visitable/given_sector)
|
|
var/obj/effect/shuttle_landmark/landmark = get_landmark(landmark_tag)
|
|
if(!landmark)
|
|
return FALSE
|
|
|
|
if(landmark.landmark_tag in given_sector.initial_generic_waypoints)
|
|
given_sector.add_landmark(landmark)
|
|
. = TRUE
|
|
for(var/shuttle_name in given_sector.initial_restricted_waypoints)
|
|
if(landmark.landmark_tag in given_sector.initial_restricted_waypoints[shuttle_name])
|
|
given_sector.add_landmark(landmark, shuttle_name)
|
|
. = TRUE
|
|
|
|
/datum/controller/subsystem/shuttle/proc/initialize_shuttle(var/shuttle_type)
|
|
var/datum/shuttle/shuttle = shuttle_type
|
|
if(initial(shuttle.category) != shuttle_type)
|
|
shuttle = new shuttle()
|
|
shuttle_areas |= shuttle.shuttle_area
|
|
return shuttle
|
|
|
|
/datum/controller/subsystem/shuttle/proc/hook_up_motherships(shuttles_list)
|
|
for(var/datum/shuttle/S in shuttles_list)
|
|
if(S.mothershuttle && !S.motherdock)
|
|
var/datum/shuttle/mothership = shuttles[S.mothershuttle]
|
|
if(mothership)
|
|
S.motherdock = S.current_location.landmark_tag
|
|
mothership.shuttle_area |= S.shuttle_area
|
|
else
|
|
log_error("Shuttle [S] was unable to find mothership [mothership]!")
|
|
|
|
/datum/controller/subsystem/shuttle/proc/toggle_overmap(new_setting)
|
|
if(overmap_halted == new_setting)
|
|
return
|
|
overmap_halted = !overmap_halted
|
|
for(var/ship in ships)
|
|
var/obj/effect/overmap/visitable/ship/ship_effect = ship
|
|
overmap_halted ? ship_effect.halt() : ship_effect.unhalt()
|
|
|
|
/datum/controller/subsystem/shuttle/stat_entry(msg)
|
|
msg = "Shuttles:[shuttles.len], Ships:[ships.len], L:[registered_shuttle_landmarks.len][overmap_halted ? ", HALT" : ""]"
|
|
return ..()
|
|
|
|
/datum/controller/subsystem/shuttle/proc/ship_by_type(type)
|
|
for (var/obj/effect/overmap/visitable/ship/ship in ships)
|
|
if (ship.type == type)
|
|
return ship
|
|
return null
|