Files
CHOMPStation2/code/modules/shuttles/shuttle_console_multi.dm
Leshana 4d9cc39664 Make shuttle control consoles constructable.
- Adds circuit boards for shuttle consoles. (Ferry, Multi, and Overmap).
- Deconstructing a console saves the linked shuttle tag in the board for when it is re-constructed.  New boards start blank but will auto-link if you build the console on a shuttle.
- Boards know what type of shuttle they can control and will only auto-link with a shuttle if it is the appropriate type.

Note: By default the only mapped-in shuttle consoles that are deconstrutable are overmap and multi shuttle consoles.   For any others, consoles built mid-game will be deconstrutable but the mapped-in ones will not.  That way the arrival, escape, supply ferry shuttles etc won't be messed with unless the mapper specifically chooses to override and make them that way.
2020-04-11 19:54:03 -04:00

36 lines
1.7 KiB
Plaintext

/obj/machinery/computer/shuttle_control/multi
circuit = /obj/item/weapon/circuitboard/shuttle_console/multi
ui_template = "shuttle_control_console_multi.tmpl"
/obj/machinery/computer/shuttle_control/multi/get_ui_data(var/datum/shuttle/autodock/multi/shuttle)
. = ..()
if(istype(shuttle))
. += list(
"destination_name" = shuttle.next_location ? shuttle.next_location.name : "No destination set.",
"can_pick" = shuttle.moving_status == SHUTTLE_IDLE,
"can_cloak" = shuttle.can_cloak ? 1 : 0,
"cloaked" = shuttle.cloaked ? 1 : 0,
"legit" = shuttle.legit ? 1 : 0,
// "engines_charging" = ((shuttle.last_move + (shuttle.cooldown SECONDS)) > world.time), // Replaced by longer warmup_time
)
/obj/machinery/computer/shuttle_control/multi/handle_topic_href(var/datum/shuttle/autodock/multi/shuttle, var/list/href_list)
if((. = ..()) != null)
return
if(href_list["pick"])
var/dest_key = input("Choose shuttle destination", "Shuttle Destination") as null|anything in shuttle.get_destinations()
if(dest_key && CanInteract(usr, global.default_state))
shuttle.set_destination(dest_key, usr)
return TOPIC_REFRESH
if(href_list["toggle_cloaked"])
if(!shuttle.can_cloak)
return TOPIC_HANDLED
shuttle.cloaked = !shuttle.cloaked
if(shuttle.legit)
to_chat(usr, "<span class='notice'>Ship ATC inhibitor systems have been [(shuttle.cloaked ? "activated. The station will not" : "deactivated. The station will")] be notified of our arrival.</span>")
else
to_chat(usr, "<span class='warning'>Ship stealth systems have been [(shuttle.cloaked ? "activated. The station will not" : "deactivated. The station will")] be warned of our arrival.</span>")
return TOPIC_REFRESH