mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-27 06:54:18 +01:00
Robotics lift extended to third deck (#16864)
* kinda sorta works * mapping mostly * mapping * holy hell it works * lift sounds * mapping * multi/lift type * mappin * code * ui * code * c * remove old lift stuff * weary * Update code/modules/shuttles/shuttle_console_multi_lift.dm Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> * Update code/modules/shuttles/shuttle_console_multi_lift.dm Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> * Update code/modules/shuttles/shuttles_multi_lift.dm Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> * Update code/modules/shuttles/shuttle_console_multi_lift.dm Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> * Update code/modules/shuttles/shuttles_multi_lift.dm Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> * Update code/modules/shuttles/shuttles_multi_lift.dm Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> * Update html/changelogs/DreamySkrell-robotics-lift-1111.yml Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> * emergency stop * Update code/modules/shuttles/shuttles_multi_lift.dm Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> --------- Co-authored-by: DreamySkrell <> Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com>
This commit is contained in:
co-authored by
SleepyGemmy
DreamySkrell <>
parent
273c4539cf
commit
a331591bbe
@@ -46,4 +46,4 @@
|
||||
our_shuttle.return_warning_cooldown = world.time + 60 SECONDS
|
||||
alert(user, "If you return to base, you won't be able to return to [current_map.station_short]. Launch again if you're sure about this.","Shuttle Control","Acknowledged.")
|
||||
return FALSE
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/obj/machinery/computer/shuttle_control/multi/lift
|
||||
name = "lift controller"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "lift"
|
||||
icon_screen = null
|
||||
density = FALSE
|
||||
req_access = null
|
||||
ui_template = "shuttle_control_console_multi_lift.tmpl"
|
||||
|
||||
/obj/machinery/computer/shuttle_control/multi/lift/wall
|
||||
icon_state = "lift_wall"
|
||||
|
||||
/obj/machinery/computer/shuttle_control/multi/lift/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
var/datum/shuttle/autodock/multi/lift/shuttle = SSshuttle.shuttles[shuttle_tag]
|
||||
if(!istype(shuttle))
|
||||
to_chat(user, SPAN_WARNING("Unable to establish link with the shuttle."))
|
||||
return
|
||||
|
||||
var/list/data = get_ui_data(shuttle)
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, ui_template, "[shuttle_tag] Control", 470, 300)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(TRUE)
|
||||
|
||||
/obj/machinery/computer/shuttle_control/multi/lift/get_ui_data(var/datum/shuttle/autodock/multi/lift/shuttle)
|
||||
. = ..()
|
||||
if(istype(shuttle))
|
||||
var/list/destination_keys = list()
|
||||
for(var/key in shuttle.destinations_cache)
|
||||
destination_keys.Add(key)
|
||||
. += list(
|
||||
"destinations" = destination_keys,
|
||||
)
|
||||
|
||||
/obj/machinery/computer/shuttle_control/multi/handle_topic_href(var/datum/shuttle/autodock/multi/lift/shuttle, var/list/href_list)
|
||||
if(href_list["pick"] && href_list["destination"])
|
||||
shuttle.set_destination(href_list["destination"], usr)
|
||||
return TOPIC_REFRESH
|
||||
if(href_list["cancel"])
|
||||
shuttle.final_location = null // no return so parent can handle it
|
||||
..()
|
||||
@@ -0,0 +1,47 @@
|
||||
// multi lift, meaning it goes between stops
|
||||
// if it goes from first stop to the last one
|
||||
// it goes one by one sequentially through the ones in the middle
|
||||
// order of stops is same as defined in destination_tags
|
||||
/datum/shuttle/autodock/multi/lift
|
||||
warmup_time = 3
|
||||
move_time = 2
|
||||
knockdown = FALSE
|
||||
squishes = FALSE
|
||||
ceiling_type = null
|
||||
sound_takeoff = 'sound/effects/lift_heavy_start.ogg'
|
||||
sound_landing = 'sound/effects/lift_heavy_stop.ogg'
|
||||
var/obj/effect/shuttle_landmark/final_location = null
|
||||
|
||||
// final_location must be set and valid
|
||||
// if current and final location are the same, returns current location
|
||||
/datum/shuttle/autodock/multi/lift/proc/get_next_destination_tag()
|
||||
var/current_tag = current_location.landmark_tag
|
||||
var/final_tag = final_location.landmark_tag
|
||||
ASSERT(current_tag in destination_tags)
|
||||
ASSERT(final_tag in destination_tags)
|
||||
var/current_i = destination_tags.Find(current_tag)
|
||||
var/final_i = destination_tags.Find(final_tag)
|
||||
ASSERT(current_i != final_i)
|
||||
if(current_i < final_i)
|
||||
return destination_tags[current_i + 1]
|
||||
else if(current_i > final_i)
|
||||
return destination_tags[current_i - 1]
|
||||
else
|
||||
return destination_tags[current_i]
|
||||
|
||||
/datum/shuttle/autodock/multi/lift/set_destination(var/destination_key, mob/user)
|
||||
final_location = destinations_cache[destination_key]
|
||||
var/next_tag = get_next_destination_tag()
|
||||
next_location = SSshuttle.get_landmark(next_tag)
|
||||
..(next_location.name, user)
|
||||
launch(user)
|
||||
|
||||
/datum/shuttle/autodock/multi/lift/arrived()
|
||||
if(final_location == current_location)
|
||||
final_location = null
|
||||
else
|
||||
var/next_tag = get_next_destination_tag()
|
||||
next_location = SSshuttle.get_landmark(next_tag)
|
||||
set_destination(next_location.name, null)
|
||||
launch(in_use)
|
||||
..()
|
||||
Reference in New Issue
Block a user