From 94b7057989f5d422b47fb9786d03df8b97c7c4bd Mon Sep 17 00:00:00 2001 From: warriorstar-orion Date: Fri, 17 May 2024 07:58:36 -0400 Subject: [PATCH] tube stations can be skipped by holding direction key (#25350) * tube stations can be skipped by holding direction key * Update code/game/objects/structures/transit_tubes/station.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: warriorstar-orion * invert/guard clause * add examine text for hints --------- Signed-off-by: warriorstar-orion Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> --- _maps/map_files/stations/boxstation.dmm | 17 ++++--------- _maps/map_files/stations/deltastation.dmm | 7 +----- _maps/map_files/stations/metastation.dmm | 7 +++--- .../structures/transit_tubes/station.dm | 25 ++++++++++++++++++- .../structures/transit_tubes/transit_tube.dm | 17 +------------ 5 files changed, 34 insertions(+), 39 deletions(-) diff --git a/_maps/map_files/stations/boxstation.dmm b/_maps/map_files/stations/boxstation.dmm index 473def6e164..01ace0aec76 100644 --- a/_maps/map_files/stations/boxstation.dmm +++ b/_maps/map_files/stations/boxstation.dmm @@ -52327,12 +52327,6 @@ icon_state = "vault" }, /area/station/engineering/gravitygenerator) -"dCJ" = ( -/obj/structure/transit_tube/cap{ - dir = 8 - }, -/turf/simulated/floor/plating, -/area/station/turret_protected/aisat/interior) "dCM" = ( /obj/structure/disposalpipe/segment{ dir = 4 @@ -57689,10 +57683,12 @@ layer = 4; pixel_y = 32 }, -/obj/structure/transit_tube/station, /obj/structure/transit_tube_pod{ dir = 4 }, +/obj/structure/transit_tube/station/reverse/flipped{ + dir = 1 + }, /turf/simulated/floor/plasteel{ icon_state = "dark" }, @@ -64056,9 +64052,6 @@ name = "north bump"; pixel_y = 24 }, -/obj/structure/transit_tube/cap{ - dir = 4 - }, /turf/simulated/floor/plasteel{ icon_state = "dark" }, @@ -72430,11 +72423,11 @@ /turf/simulated/floor/plasteel, /area/station/supply/storage) "nrh" = ( -/obj/structure/transit_tube/station, /obj/structure/transit_tube_pod{ dir = 8 }, /obj/machinery/atmospherics/pipe/simple/visible/yellow, +/obj/structure/transit_tube/station/reverse, /turf/simulated/floor/plating, /area/station/turret_protected/aisat/interior) "nrD" = ( @@ -131948,7 +131941,7 @@ aab aaa cQp wza -dCJ +dnW dnv dnW diz diff --git a/_maps/map_files/stations/deltastation.dmm b/_maps/map_files/stations/deltastation.dmm index 2c1a42832b3..0d416241c10 100644 --- a/_maps/map_files/stations/deltastation.dmm +++ b/_maps/map_files/stations/deltastation.dmm @@ -87549,9 +87549,6 @@ /area/station/maintenance/starboard) "rjL" = ( /obj/effect/decal/cleanable/dirt, -/obj/structure/transit_tube/cap{ - dir = 8 - }, /obj/item/radio/intercom{ name = "south bump"; pixel_y = -28 @@ -97341,9 +97338,7 @@ /obj/machinery/ai_status_display{ pixel_y = -32 }, -/obj/structure/transit_tube/station{ - dir = 1 - }, +/obj/structure/transit_tube/station/reverse/flipped, /turf/simulated/floor/plasteel{ dir = 8; icon_state = "vault" diff --git a/_maps/map_files/stations/metastation.dmm b/_maps/map_files/stations/metastation.dmm index 44f5f507aea..7380ac46420 100644 --- a/_maps/map_files/stations/metastation.dmm +++ b/_maps/map_files/stations/metastation.dmm @@ -19446,10 +19446,12 @@ /turf/simulated/floor/wood, /area/station/command/office/captain/bedroom) "bsI" = ( -/obj/structure/transit_tube/station, /obj/structure/sign/securearea{ pixel_y = 32 }, +/obj/structure/transit_tube/station/reverse/flipped{ + dir = 1 + }, /turf/simulated/floor/plasteel{ dir = 4; icon_state = "darkbluecorners" @@ -53883,9 +53885,6 @@ }, /area/station/medical/virology) "hkm" = ( -/obj/structure/transit_tube/cap{ - dir = 4 - }, /obj/machinery/status_display{ layer = 4; pixel_y = 32 diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm index 5cff309495b..ddfc3b8fb64 100644 --- a/code/game/objects/structures/transit_tubes/station.dm +++ b/code/game/objects/structures/transit_tubes/station.dm @@ -33,6 +33,11 @@ STOP_PROCESSING(SSobj, src) return ..() +/obj/structure/transit_tube/station/examine(mob/user) + . = ..() + . += "While in transit, hold the directional key matching the pod's direction to skip a station." + . += "While at a station, press a directional key to quickly leave the station in that direction." + /obj/structure/transit_tube/station/init_tube_dirs() // Tube station directions are simply 90 to either side of // the exit. @@ -47,7 +52,19 @@ tube_dirs = list(NORTH, SOUTH) boarding_dir = reverse_direction(dir) -/obj/structure/transit_tube/station/should_stop_pod(pod, from_dir) +/obj/structure/transit_tube/station/should_stop_pod(obj/structure/transit_tube_pod/pod, from_dir) + for(var/atom/atom in pod.contents) + var/client/client = CLIENT_FROM_VAR(atom) + if(!client) + return + + for(var/held_key in client.input_data.keys_held) + if(held_key in client.movement_kb_dirs) + var/held_dir = client.movement_kb_dirs[held_key] + // if they're holding a different direction down, + // stop to let them get out/change direction + return held_dir != from_dir + return TRUE /obj/structure/transit_tube/station/Bumped(mob/living/L) @@ -187,6 +204,9 @@ reverse_launch = TRUE uninstalled_type = /obj/structure/transit_tube_construction/terminus +/obj/structure/transit_tube/station/reverse/should_stop_pod(obj/structure/transit_tube_pod/pod, from_dir) + return TRUE + /obj/structure/transit_tube/station/reverse/init_tube_dirs() tube_dirs = list(turn(dir, -90)) boarding_dir = reverse_direction(dir) @@ -260,6 +280,9 @@ base_icon_state = "terminusdispenser0" uninstalled_type = /obj/structure/transit_tube_construction/terminus/dispenser +/obj/structure/transit_tube/station/dispenser/reverse/should_stop_pod(obj/structure/transit_tube_pod/pod, from_dir) + return TRUE + /obj/structure/transit_tube/station/dispenser/reverse/init_tube_dirs() tube_dirs = list(turn(dir, -90)) boarding_dir = reverse_direction(dir) diff --git a/code/game/objects/structures/transit_tubes/transit_tube.dm b/code/game/objects/structures/transit_tubes/transit_tube.dm index aad4e103818..ad0fbabd901 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube.dm @@ -58,7 +58,7 @@ return // Called to check if a pod should stop upon entering this tube. -/obj/structure/transit_tube/proc/should_stop_pod(pod, from_dir) +/obj/structure/transit_tube/proc/should_stop_pod(obj/structure/transit_tube_pod/pod, from_dir) return FALSE // Called when a pod stops in this tube section. @@ -274,18 +274,3 @@ tube_dirs = list(EAST, NORTHWEST, SOUTHWEST) if(WEST) tube_dirs = list(WEST, SOUTHEAST, NORTHEAST) - - -// cosmetic "cap" for tubes. Note that tubes can't enter this. -/obj/structure/transit_tube/cap - icon_state = "cap" - -/obj/structure/transit_tube/cap/init_tube_dirs() - tube_dirs = list(turn(dir, 180)) // back the way we came - -/obj/structure/transit_tube/cap/has_entrance(from_dir) - return FALSE - -/obj/structure/transit_tube/cap/create_tube_overlay() - // cap sprites already have overlays - return