mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-10 23:47:08 +01:00
4ecb0bc21c
Repaths obj/machinery to obj/structure/machinery. **Note for reviewers:** the only meaningful changed code exists within **code/game/objects/structures.dm** and **code/game/objects/structures/_machinery.dm**, largely concerning damage procs. With the exception of moving airlock defines to their own file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES. Objects, _categorically_, are largely divided between those you can hold in your hand/inventory and those you can't. Machinery objects are already subtypes of Structures behaviorally, this PR just makes their pathing reflect that, and allows for future work (tool actions, more health/destruction functionality) to be developed without unnecessary code duplication. I have tested this PR by loading up the Horizon and dismantling various machines and structures with tools, shooting guns of various types throughout the ship, and detonating a bunch of explosions throughout the ship.
54 lines
2.3 KiB
Plaintext
54 lines
2.3 KiB
Plaintext
/obj/structure/machinery/computer/shuttle_control/multi
|
|
ui_template = "ShuttleControlConsoleMulti"
|
|
|
|
/obj/structure/machinery/computer/shuttle_control/multi/ui_data(mob/user)
|
|
. = ..()
|
|
|
|
var/datum/shuttle/autodock/multi/shuttle = SSshuttle.shuttles[shuttle_tag]
|
|
if(istype(shuttle))
|
|
. += list(
|
|
"destination_name" = shuttle.next_location? shuttle.next_location.name : "No destination set.",
|
|
"can_pick" = shuttle.moving_status == SHUTTLE_IDLE,
|
|
)
|
|
|
|
/obj/structure/machinery/computer/shuttle_control/multi/handle_topic_href(var/mob/user, var/datum/shuttle/autodock/multi/shuttle, var/action, var/list/params)
|
|
if(action == "pick")
|
|
var/dest_key = tgui_input_list(user, "Choose shuttle destination.", "Shuttle Destination", shuttle.get_destinations())
|
|
if(dest_key && (!use_check(usr) || (isobserver(usr) && check_rights(R_ADMIN, FALSE)) || isstoryteller(usr)))
|
|
shuttle.set_destination(dest_key, usr)
|
|
return TRUE
|
|
|
|
return ..()
|
|
|
|
/obj/structure/machinery/computer/shuttle_control/multi/antag
|
|
ui_template = "ShuttleControlConsoleMultiAntag"
|
|
|
|
/obj/structure/machinery/computer/shuttle_control/multi/antag/ui_data(mob/user)
|
|
. = ..()
|
|
|
|
var/datum/shuttle/autodock/multi/antag/shuttle = SSshuttle.shuttles[shuttle_tag]
|
|
if(istype(shuttle))
|
|
. += list(
|
|
"cloaked" = shuttle.cloaked,
|
|
)
|
|
|
|
/obj/structure/machinery/computer/shuttle_control/multi/antag/handle_topic_href(var/mob/user, var/datum/shuttle/autodock/multi/antag/shuttle, var/action, var/list/params)
|
|
if(action == "toggle_cloaked")
|
|
shuttle.cloaked = !shuttle.cloaked
|
|
return TRUE
|
|
|
|
return ..()
|
|
|
|
/obj/structure/machinery/computer/shuttle_control/multi/can_move(var/datum/shuttle/autodock/shuttle, var/user)
|
|
if(istype(shuttle, /datum/shuttle/autodock/multi/antag))
|
|
var/datum/shuttle/autodock/multi/antag/our_shuttle = shuttle
|
|
if(our_shuttle.returned)
|
|
to_chat(user, SPAN_WARNING("You don't have enough fuel for another trip!"))
|
|
return FALSE
|
|
else if(our_shuttle.next_location == our_shuttle.home_waypoint)
|
|
if(our_shuttle.return_warning_cooldown < world.time)
|
|
our_shuttle.return_warning_cooldown = world.time + 60 SECONDS
|
|
tgui_alert(user, "If you return to base, you won't be able to return to [SSatlas.current_map.station_short]. Launch again if you're sure about this.", "Shuttle Control", list("Acknowledged."))
|
|
return FALSE
|
|
return ..()
|