mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-24 09:02:27 +00:00
The lifeless live again. Or in this case, what never actually lived here. Ports Baystation12/Baystation12#17460 probably for real this time. What this allows us to do is create shuttles on runtime and make shuttles easier by just making landmarks and a shuttle instead of areas and shuttles. Also allows runtime landmark creation via flares or whatever AND allows shuttles to use different landmarks at will. I removed most of the overmap stuff, I think. It shouldn't be hard to slam it in whenever we need to. Changes: "Shuttle code has been completely reworked." "Shuttles can now be modified to have more than one destination." "Shuttles now have a takeoff sound." "You can now throw mobs against walls to damage them. A lot." "You now need a neckgrab to throw mobs." "BEING UNBUCKLED DURING SHUTTLE LAUNCH IS DANGEROUS! Don't do it." "Adminghosts can now interact with all shuttles."
241 lines
7.5 KiB
Plaintext
241 lines
7.5 KiB
Plaintext
/obj/machinery/computer/shuttle_control/specops
|
|
name = "special operations shuttle console"
|
|
shuttle_tag = "Phoenix Shuttle"
|
|
req_access = list(access_cent_specops)
|
|
|
|
/obj/machinery/computer/shuttle_control/specops/attack_ai(user as mob)
|
|
to_chat(user, "<span class='warning'>Access Denied.</span>")
|
|
return 1
|
|
|
|
/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/device/radio/intercom/announcer
|
|
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/device/radio/intercom(null)//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
|
|
announcer.config(list("Response Team" = 0))
|
|
|
|
/datum/shuttle/autodock/ferry/specops/proc/radio_announce(var/message)
|
|
if(announcer)
|
|
announcer.autosay(message, "Bubble", "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 class='notice'>[current_map.boss_name] will not allow the Special Operations shuttle to launch yet.</span>")
|
|
if (((world.time - reset_time)/10) > 60)
|
|
C.visible_message("<span class='notice'>[-((world.time - reset_time)/10)/60] minutes remain!</span>")
|
|
else
|
|
C.visible_message("<span class='notice'>[-(world.time - reset_time)/10] seconds remain!</span>")
|
|
return
|
|
|
|
C.visible_message("<span class='notice'>The Special Operations shuttle will depart in [(specops_countdown_time/10)] seconds.</span>")
|
|
|
|
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/shuttle_moved()
|
|
. = ..()
|
|
|
|
spawn(20)
|
|
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 class='danger'>You have arrived at [current_map.boss_name]. Operation has ended!</span>")
|
|
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 class='danger'>You have arrived at [current_map.station_name]. Commence operation!</span>")
|
|
|
|
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 class='warning'>Launch sequence aborted.</span>")
|
|
|
|
..()
|
|
|
|
/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 landmarks_list)
|
|
if(L.name == "Marauder Entry")
|
|
spawn_marauder.Add(L)
|
|
for(var/obj/effect/landmark/L in landmarks_list)
|
|
if(L.name == "Marauder Exit")
|
|
var/obj/effect/portal/P = new(L.loc)
|
|
P.invisibility = 101//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()
|
|
|
|
//--Tau Ceti Foreign Legion Shuttle--//
|
|
|
|
/obj/machinery/computer/shuttle_control/legion
|
|
name = "dropship control console"
|
|
req_access = list(access_legion)
|
|
shuttle_tag = "Legion Shuttle"
|
|
|
|
/datum/shuttle/autodock/ferry/legion
|
|
var/dropship_return_delay = 6600
|
|
var/earliest_departure_time = 0
|
|
|
|
/datum/shuttle/autodock/ferry/legion/arrived()
|
|
if(!location)
|
|
earliest_departure_time = world.time + dropship_return_delay
|
|
|
|
/datum/shuttle/autodock/ferry/legion/launch(var/user)
|
|
if(!location && earliest_departure_time > world.time)
|
|
var/obj/machinery/computer/shuttle_control/legion/L = user
|
|
L.visible_message(span("notice","The dropship's skipthrusters will be done recharging in approximately [round((earliest_departure_time - world.time)/600)] minute\s."),null,3)
|
|
return
|
|
else
|
|
..()
|
|
|
|
/obj/machinery/computer/shuttle_control/distress
|
|
name = "shuttle control computer"
|
|
req_access = list(access_distress)
|
|
shuttle_tag = "Distress Shuttle"
|