Files
VOREStation/code/modules/shuttles/shuttle_specops.dm
T
Cameron Lennox 84dc5535dc var/global/list -> GLOB. conversion (#17928)
* These two are easy

* !!!runlevel_flags

the fact it was global.runlevel_flags.len has me a bit...iffy on this.

* !!!json_cache

Same as above. used global.

* player_list & observer_mob_list

* mechas_list

* this wasn't even used

* surgery_steps

* event_triggers

* landmarks_list

* dead_mob_list

* living_mob_list

* ai_list

* cable_list

* cleanbot_reserved_turfs

* listening_objects

* silicon_mob_list

* human_mob_list

* Update global_lists.dm

* joblist

* mob_list

* Update global_lists.dm

* holomap_markers

* mapping_units

* mapping_beacons

* hair_styles_list

* facial_hair_styles_list

* Update global_lists.dm

* facial_hair_styles_male_list

* facial_hair_styles_female_list

* body_marking_styles_list

* body_marking_nopersist_list

* ear_styles_list

* hair_styles_male_list

* tail_styles_list

* wing_styles_list

* escape_list & rune_list & endgame_exits

these were all really small

* endgame_safespawns

* stool_cache

* emotes_by_key

* random_maps & map_count

* item_tf_spawnpoints

* narsie_list

* active_radio_jammers

* unused

* paikeys

* pai_software_by_key & default_pai_software

* plant_seed_sprites

* magazine_icondata_keys  & magazine_icondata_states

* unused

* ashtray_cache

* light_type_cache

* HOLIDAY!!!

this one was annoying

* faction stuff (red?!)

* Update preferences_factions.dm

* vs edit removal

* backbaglist, pdachoicelist, exclude_jobs

* item_digestion_blacklist, edible_tech, blacklisted_artifact_effect, selectable_footstep, hexNums, syndicate_access

* string_slot_flags and hexdigits->hexNums

* possible_changeling_IDs

* vr_mob_tf_options

* vr_mob_spawner_options

* pipe_colors

* vr_mob_spawner_options

* common_tools

* newscaster_standard_feeds

* Update periodic_news.dm

* changeling_fabricated_clothing

* semirandom_mob_spawner_decisions

* id_card_states

* Update syndicate_ids.dm

* overlay_cache & gear_distributed_to

* more

* radio_channels_by_freq

* Update global_lists.dm

* proper

* default_medbay_channels & default_internal_channels

default_internal_channels is weird as it has a mapbased proc() but that proc is never called...

* valid_ringtones

* move this

* possible_plants

* more

* separate these

moves xeno2chemlist from a hook to a new global list.

* tube_dir_list

* valid_bloodreagents & monitor_states

* Junk

* valid_bloodtypes

* breach_burn_descriptors & burn

* more!!

appliance_available_recipes seems uber cursed, re-look at later

* Appliance code is cursed

* wide_chassis & flying_chassis

* allows_eye_color

* all_tooltip_styles

* direction_table

* gun_choices

* severity_to_string

* old event_viruses

* description_icons

* MOVE_KEY_MAPPINGS

* more more

* pai & robot modules

* Update global_lists.dm

* GEOSAMPLES

Also swaps a .len to LAZYLEN()

* shieldgens

* reagent recipies

* global ammo types

* rad collector

* old file and unused global

* nif_look_messages

* FESH

* nifsoft

* chamelion

* the death of sortAtom

* globulins

* lazylen that

* Update global_lists.dm

* LAZY

* Theese too

* quick fix

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
2025-07-14 20:14:31 +02:00

216 lines
6.6 KiB
Plaintext

/obj/machinery/computer/shuttle_control/specops
name = "special operations shuttle console"
shuttle_tag = "Special Operations"
req_access = list(access_cent_specops)
/obj/machinery/computer/shuttle_control/specops/attack_ai(user as mob)
to_chat(user, span_warning("Access Denied."))
return 1
// Formerly /datum/shuttle/ferry/multidock/specops
/datum/shuttle/autodock/ferry/specops
var/specops_return_delay = 6000 //After moving, the amount of time that must pass before the shuttle may move again
var/specops_countdown_time = 600 //Length of the countdown when moving the shuttle
var/obj/item/radio/intercom/announcer = null
var/reset_time = 0 //the world.time at which the shuttle will be ready to move again.
var/launch_prep = 0
var/cancel_countdown = 0
category = /datum/shuttle/autodock/ferry/specops
/datum/shuttle/autodock/ferry/specops/New()
..()
announcer = new /obj/item/radio/intercom(null)//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
announcer.config(list(CHANNEL_RESPONSE_TEAM = 0))
/datum/shuttle/autodock/ferry/specops/proc/radio_announce(var/message)
if(announcer)
announcer.autosay(message, "A.L.I.C.E.", CHANNEL_RESPONSE_TEAM)
/datum/shuttle/autodock/ferry/specops/launch(var/user)
if (!can_launch())
return
if (istype(user, /obj/machinery/computer))
var/obj/machinery/computer/C = user
if(world.time <= reset_time)
C.visible_message(span_notice("[global.using_map.boss_name] will not allow the Special Operations shuttle to launch yet."))
if (((world.time - reset_time)/10) > 60)
C.visible_message(span_notice("[-((world.time - reset_time)/10)/60] minutes remain!"))
else
C.visible_message(span_notice("[-(world.time - reset_time)/10] seconds remain!"))
return
C.visible_message(span_notice("The Special Operations shuttle will depart in [(specops_countdown_time/10)] seconds."))
if (location) //returning
radio_announce("THE SPECIAL OPERATIONS SHUTTLE IS PREPARING TO RETURN")
else
radio_announce("THE SPECIAL OPERATIONS SHUTTLE IS PREPARING FOR LAUNCH")
sleep_until_launch()
if (location)
var/obj/machinery/light/small/readylight/light = locate() in shuttle_area
if(light) light.set_state(0)
//launch
radio_announce("ALERT: INITIATING LAUNCH SEQUENCE")
..(user)
/datum/shuttle/autodock/ferry/specops/perform_shuttle_move()
..()
spawn(2 SECONDS)
if (!location) //just arrived home
for(var/turf/T in get_area_turfs(shuttle_area))
var/mob/M = locate(/mob) in T
to_chat(M, span_danger("You have arrived at [using_map.boss_name]. Operation has ended!"))
else //just left for the station
launch_mauraders()
for(var/turf/T in get_area_turfs(shuttle_area))
var/mob/M = locate(/mob) in T
to_chat(M, span_danger("You have arrived at [station_name()]. Commence operation!"))
var/obj/machinery/light/small/readylight/light = locate() in T
if(light) light.set_state(1)
/datum/shuttle/autodock/ferry/specops/cancel_launch()
if (!can_cancel())
return
cancel_countdown = 1
radio_announce("ALERT: LAUNCH SEQUENCE ABORTED")
if (istype(in_use, /obj/machinery/computer))
var/obj/machinery/computer/C = in_use
C.visible_message(span_warning("Launch sequence aborted."))
..()
/datum/shuttle/autodock/ferry/specops/can_launch()
if(launch_prep)
return 0
return ..()
//should be fine to allow forcing. process_state only becomes WAIT_LAUNCH after the countdown is over.
///datum/shuttle/autodock/ferry/specops/can_force()
// return 0
/datum/shuttle/autodock/ferry/specops/can_cancel()
if(launch_prep)
return 1
return ..()
/datum/shuttle/autodock/ferry/specops/proc/sleep_until_launch()
var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
var/launch_time = world.time + specops_countdown_time
var/time_until_launch
cancel_countdown = 0
launch_prep = 1
while(!cancel_countdown && (launch_time - world.time) > 0)
var/ticksleft = launch_time - world.time
//if(ticksleft > 1e5)
// launch_time = world.timeofday + 10 // midnight rollover
time_until_launch = (ticksleft / 10)
//All this does is announce the time before launch.
var/rounded_time_left = round(time_until_launch)//Round time so that it will report only once, not in fractions.
if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
radio_announce("ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN")
message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
//Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
sleep(5)
launch_prep = 0
/proc/launch_mauraders()
var/area/centcom/specops/special_ops = locate()//Where is the specops area located?
//Begin Marauder launchpad.
spawn(0)//So it parallel processes it.
for(var/obj/machinery/door/blast/M in special_ops)
switch(M.id)
if("ASSAULT0")
spawn(10)//1 second delay between each.
M.open()
if("ASSAULT1")
spawn(20)
M.open()
if("ASSAULT2")
spawn(30)
M.open()
if("ASSAULT3")
spawn(40)
M.open()
sleep(10)
var/spawn_marauder[] = new()
for(var/obj/effect/landmark/L in GLOB.landmarks_list)
if(L.name == "Marauder Entry")
spawn_marauder.Add(L)
for(var/obj/effect/landmark/L in GLOB.landmarks_list)
if(L.name == "Marauder Exit")
var/obj/effect/portal/P = new(L.loc)
P.invisibility = INVISIBILITY_ABSTRACT //So it is not seen by anyone.
P.failchance = 0//So it has no fail chance when teleporting.
P.target = pick(spawn_marauder)//Where the marauder will arrive.
spawn_marauder.Remove(P.target)
sleep(10)
for(var/obj/machinery/mass_driver/M in special_ops)
switch(M.id)
if("ASSAULT0")
spawn(10)
M.drive()
if("ASSAULT1")
spawn(20)
M.drive()
if("ASSAULT2")
spawn(30)
M.drive()
if("ASSAULT3")
spawn(40)
M.drive()
sleep(50)//Doors remain open for 5 seconds.
for(var/obj/machinery/door/blast/M in special_ops)
switch(M.id)//Doors close at the same time.
if("ASSAULT0")
spawn(0)
M.close()
if("ASSAULT1")
spawn(0)
M.close()
if("ASSAULT2")
spawn(0)
M.close()
if("ASSAULT3")
spawn(0)
M.close()
special_ops.readyreset()//Reset firealarm after the team launched.
//End Marauder launchpad.
/obj/machinery/light/small/readylight
brightness_range = 5
brightness_power = 1
brightness_color = "#DA0205"
var/state = 0
/obj/machinery/light/small/readylight/proc/set_state(var/new_state)
state = new_state
if(state)
brightness_color = "00FF00"
else
brightness_color = initial(brightness_color)
update()