Skip to content

Commit

Permalink
allows you to hop between the ships landing zones
Browse files Browse the repository at this point in the history
  • Loading branch information
harryob committed Mar 1, 2024
1 parent d74f8c0 commit 162f5a1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 39 deletions.
75 changes: 38 additions & 37 deletions code/modules/shuttle/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,13 @@
/obj/structure/machinery/computer/shuttle/ert/proc/get_landing_zones()
. = list()
for(var/obj/docking_port/stationary/emergency_response/dock in SSshuttle.stationary)
if(!dock.is_external)
. += list(dock)
if(!is_mainship_level(dock.z))
continue

if(dock.is_external)
continue

. += list(dock)

/obj/structure/machinery/computer/shuttle/ert/proc/launch_home()
if(spooling)
Expand Down Expand Up @@ -265,49 +270,45 @@
if(ert.mode == SHUTTLE_CALL || ert.mode == SHUTTLE_RECALL)
return TRUE
ert.control_doors("unlock", external_only = TRUE)
if("move")
if(ert.mode != SHUTTLE_IDLE)
to_chat(usr, SPAN_WARNING("You can't move to a new destination whilst in transit."))
return TRUE
var/dockId = params["target"]
var/list/local_data = ui_data(usr)
var/found = FALSE
playsound(loc, get_sfx("terminal_button"), KEYBOARD_SOUND_VOLUME, 1)
for(var/destination in local_data["destinations"])
if(destination["id"] == dockId)
found = TRUE
break
if(!found)
log_admin("[key_name(usr)] may be attempting a href dock exploit on [src] with target location \"[dockId]\"")
to_chat(usr, SPAN_WARNING("The [dockId] dock is not available at this time."))
return
var/obj/docking_port/stationary/dock = SSshuttle.getDock(dockId)
var/dock_reserved = FALSE
for(var/obj/docking_port/mobile/other_shuttle in SSshuttle.mobile)
if(dock == other_shuttle.destination)
dock_reserved = TRUE
break
if(dock_reserved)
to_chat(usr, SPAN_WARNING("\The [dock] is currently in use."))
return TRUE
SSshuttle.moveShuttle(ert.id, dock.id, TRUE)
to_chat(usr, SPAN_NOTICE("You begin the launch sequence to [dock]."))
return TRUE
if("launch_home")
if(!must_launch_home)
return

if(must_launch_home)
if(action == "launch_home")
if(ert.mode != SHUTTLE_IDLE)
to_chat(ui.user, SPAN_WARNING("Unable to return home."))
balloon_alert(ui.user, "can't go home!")
return

launch_home()

return

if(action != "move")
return

if(ert.mode != SHUTTLE_IDLE)
to_chat(usr, SPAN_WARNING("You can't move to a new destination whilst in transit."))
return TRUE
var/dockId = params["target"]
var/list/local_data = ui_data(usr)
var/found = FALSE
playsound(loc, get_sfx("terminal_button"), KEYBOARD_SOUND_VOLUME, 1)
for(var/destination in local_data["destinations"])
if(destination["id"] == dockId)
found = TRUE
break
if(!found)
log_admin("[key_name(usr)] may be attempting a href dock exploit on [src] with target location \"[dockId]\"")
to_chat(usr, SPAN_WARNING("The [dockId] dock is not available at this time."))
return
var/obj/docking_port/stationary/dock = SSshuttle.getDock(dockId)
var/dock_reserved = FALSE
for(var/obj/docking_port/mobile/other_shuttle in SSshuttle.mobile)
if(dock == other_shuttle.destination)
dock_reserved = TRUE
break
if(dock_reserved)
to_chat(usr, SPAN_WARNING("\The [dock] is currently in use."))
return TRUE
SSshuttle.moveShuttle(ert.id, dock.id, TRUE)
to_chat(usr, SPAN_NOTICE("You begin the launch sequence to [dock]."))
return TRUE

/obj/structure/machinery/computer/shuttle/ert/attack_hand(mob/user)
. = ..(user)
if(.)
Expand Down
9 changes: 7 additions & 2 deletions tgui/packages/tgui/interfaces/NavigationShuttle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,12 @@ const DestinationOptions = (props) => {
const { data, act } = useBackend<NavigationProps>();

if (data.must_launch_home) {
return <LaunchHome />;
return (
<>
<LaunchHome />
<DestionationSelection />
</>
);
} else {
return <DestionationSelection />;
}
Expand All @@ -304,7 +309,7 @@ const RenderScreen = (props) => {
export const NavigationShuttle = (props) => {
const { data } = useBackend<NavigationProps>();
return (
<Window theme="crtgreen" height={500} width={700}>
<Window theme="crtgreen" height={505} width={700}>
<Window.Content className="NavigationMenu">
{data.is_disabled === 1 && <DisabledScreen />}
{data.is_disabled === 0 && <RenderScreen />}
Expand Down

0 comments on commit 162f5a1

Please sign in to comment.