mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Fixes tram duplicate/unlabelled tram announcements, reduces range (#96606)
This commit is contained in:
@@ -183,6 +183,8 @@ PROCESSING_SUBSYSTEM_DEF(transport)
|
||||
transport_controller.dispatch_transport()
|
||||
return
|
||||
else
|
||||
playsound(transport_controller.nav_beacon, 'sound/machines/tram/door_chime.ogg', 45, vary = FALSE, extrarange = MEDIUM_RANGE_SOUND_EXTRARANGE)
|
||||
stoplag(1.4 SECONDS)
|
||||
transport_controller.set_status_code(DOORS_READY, FALSE)
|
||||
transport_controller.cycle_doors(CYCLE_CLOSED)
|
||||
|
||||
|
||||
@@ -65,6 +65,9 @@
|
||||
///previous trams that have been destroyed
|
||||
var/list/tram_history
|
||||
|
||||
///cooldown on tram announcement system
|
||||
COOLDOWN_DECLARE(announce_cooldown)
|
||||
|
||||
/datum/tram_mfg_info
|
||||
///serial number of this tram (what round ID it first appeared in)
|
||||
var/serial_number
|
||||
@@ -349,11 +352,23 @@
|
||||
else
|
||||
recovery_activate_count = max(recovery_activate_count - 1, 0)
|
||||
|
||||
if(travel_remaining < 39 && (COOLDOWN_FINISHED(src, announce_cooldown)))
|
||||
make_announcement("The next station is: [destination_platform].")
|
||||
COOLDOWN_START(src, announce_cooldown, 4 SECONDS)
|
||||
|
||||
scheduled_move = world.time + internal_movement_delay
|
||||
|
||||
/datum/transport_controller/linear/tram/proc/set_tram_speed(new_speed)
|
||||
internal_movement_delay = round(clamp(50 / new_speed, 0.5, 5), 0.1)
|
||||
|
||||
/datum/transport_controller/linear/tram/proc/make_announcement(broadcast)
|
||||
if(SStts.tts_enabled)
|
||||
nav_beacon.voice = SStts.tram_voice
|
||||
else
|
||||
playsound(nav_beacon, 'sound/machines/tram/info_chime.ogg', 100, vary = FALSE, extrarange = SILENCED_SOUND_EXTRARANGE, falloff_exponent = 1.4)
|
||||
|
||||
nav_beacon.say(broadcast)
|
||||
|
||||
/**
|
||||
* Tram stops normally, performs post-trip actions and updates the tram registration.
|
||||
*/
|
||||
@@ -362,35 +377,13 @@
|
||||
log_transport("TC: [specific_transport_id] trip completed. Info: nav_pos ([nav_beacon.x], [nav_beacon.y], [nav_beacon.z]) idle_pos ([destination_platform.x], [destination_platform.y], [destination_platform.z]).")
|
||||
nav_beacon.tram_loop.stop()
|
||||
addtimer(CALLBACK(src, PROC_REF(unlock_controls)), 2 SECONDS)
|
||||
addtimer(CALLBACK(src, PROC_REF(platform_arrival_jingle)), 2.5 SECONDS)
|
||||
if((controller_status & SYSTEM_FAULT) && (nav_beacon.loc == destination_platform.loc)) //position matches between controller and tram, we're back on track
|
||||
set_status_code(SYSTEM_FAULT, FALSE)
|
||||
playsound(paired_cabinet, 'sound/machines/synth/synth_yes.ogg', 40, vary = FALSE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
paired_cabinet.say("Controller reset.")
|
||||
log_transport("TC: [specific_transport_id] position data successfully reset.")
|
||||
idle_platform = destination_platform
|
||||
var/our_channel = SSsounds.random_available_channel()
|
||||
var/sound/jingle = sound(
|
||||
idle_platform.arrival_sound,
|
||||
FALSE,
|
||||
0,
|
||||
our_channel,
|
||||
60
|
||||
)
|
||||
var/list/hearers = playsound(idle_platform, jingle, 50, FALSE, 0, extrarange= 10, ignore_walls = TRUE)
|
||||
new /datum/threed_sound(
|
||||
new_parent = idle_platform,
|
||||
new_sound = jingle,
|
||||
current_listeners = hearers,
|
||||
can_add_new_listeners = FALSE,
|
||||
volume = 60,
|
||||
sound_range = SOUND_RANGE + 7,
|
||||
sound_length = 12 SECONDS,
|
||||
channel = our_channel,
|
||||
preference_volume = null,
|
||||
preference_signal = null,
|
||||
falloff_exponent = SOUND_FALLOFF_EXPONENT,
|
||||
falloff_distance = 5
|
||||
)
|
||||
|
||||
tram_registration.distance_travelled += (travel_trip_length - travel_remaining)
|
||||
travel_trip_length = 0
|
||||
@@ -738,6 +731,32 @@
|
||||
|
||||
return FALSE
|
||||
|
||||
/// Plays the arrival jingle associated with the platform
|
||||
/datum/transport_controller/linear/tram/proc/platform_arrival_jingle()
|
||||
var/our_channel = SSsounds.random_available_channel()
|
||||
var/sound/jingle = sound(
|
||||
idle_platform.arrival_sound,
|
||||
FALSE,
|
||||
0,
|
||||
our_channel,
|
||||
60
|
||||
)
|
||||
var/list/hearers = playsound(idle_platform, jingle, 60, FALSE, 0, extrarange = 7)
|
||||
new /datum/threed_sound(
|
||||
new_parent = idle_platform,
|
||||
new_sound = jingle,
|
||||
current_listeners = hearers,
|
||||
can_add_new_listeners = FALSE,
|
||||
volume = 60,
|
||||
sound_range = SOUND_RANGE - 3,
|
||||
sound_length = 3 SECONDS,
|
||||
channel = our_channel,
|
||||
preference_volume = /datum/preference/numeric/volume/sound_instruments,
|
||||
preference_signal = null,
|
||||
falloff_exponent = SOUND_FALLOFF_EXPONENT,
|
||||
falloff_distance = 5
|
||||
)
|
||||
|
||||
/**
|
||||
* Moves the tram when hit by an immovable rod
|
||||
*
|
||||
|
||||
@@ -237,22 +237,19 @@
|
||||
if(tram)
|
||||
if(SStts.tts_enabled)
|
||||
tram.nav_beacon.voice = SStts.tram_voice
|
||||
switch(response_code)
|
||||
if(REQUEST_SUCCESS)
|
||||
tram.nav_beacon.say("The next stop is: [response_info]")
|
||||
|
||||
if(REQUEST_FAIL)
|
||||
if(!LAZYFIND(relevant, src))
|
||||
if(response_code == REQUEST_FAIL)
|
||||
if(!LAZYFIND(relevant, src))
|
||||
return
|
||||
|
||||
switch(response_info)
|
||||
if(NOT_IN_SERVICE)
|
||||
tram.nav_beacon.say("The tram is not in service. Please contact the nearest engineer.")
|
||||
if(INVALID_PLATFORM)
|
||||
tram.nav_beacon.say("Configuration error. Please contact the nearest engineer.")
|
||||
if(INTERNAL_ERROR)
|
||||
tram.nav_beacon.say("Tram controller error. Please contact the nearest engineer or crew member with telecommunications access to reset the controller.")
|
||||
else
|
||||
return
|
||||
|
||||
switch(response_info)
|
||||
if(NOT_IN_SERVICE)
|
||||
tram.nav_beacon.say("The tram is not in service. Please contact the nearest engineer.")
|
||||
if(INVALID_PLATFORM)
|
||||
tram.nav_beacon.say("Configuration error. Please contact the nearest engineer.")
|
||||
if(INTERNAL_ERROR)
|
||||
tram.nav_beacon.say("Tram controller error. Please contact the nearest engineer or crew member with telecommunications access to reset the controller.")
|
||||
else
|
||||
return
|
||||
|
||||
MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/tram_controls, 32)
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
try_to_close(forced = BYPASS_DOOR_CHECKS)
|
||||
return
|
||||
|
||||
if(retry_counter == 1)
|
||||
playsound(src, 'sound/machines/chime.ogg', 40, vary = FALSE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
if(retry_counter > 1)
|
||||
playsound(src, 'sound/machines/tram/door_chime.ogg', 40, vary = FALSE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
|
||||
addtimer(CALLBACK(src, PROC_REF(verify_status)), (2.7 SECONDS))
|
||||
try_to_close()
|
||||
|
||||
@@ -46,24 +46,24 @@
|
||||
specific_transport_id = TRAMSTATION_LINE_1
|
||||
|
||||
/obj/effect/landmark/transport/nav_beacon/tram/nav/tramstation/main
|
||||
name = TRAMSTATION_LINE_1
|
||||
name = "tram announcement system"
|
||||
specific_transport_id = TRAM_NAV_BEACONS
|
||||
dir = WEST
|
||||
|
||||
/obj/effect/landmark/transport/nav_beacon/tram/platform/tramstation/west
|
||||
name = "Arrivals Station"
|
||||
name = "Arrivals"
|
||||
platform_code = TRAMSTATION_WEST
|
||||
tgui_icons = list("Arrivals" = "plane-arrival", "Command" = "bullhorn", "Security" = "gavel")
|
||||
arrival_sound = 'sound/machines/tram/arrivals_line_processed.ogg'
|
||||
|
||||
/obj/effect/landmark/transport/nav_beacon/tram/platform/tramstation/central
|
||||
name = "Medical Station"
|
||||
name = "Medical"
|
||||
platform_code = TRAMSTATION_CENTRAL
|
||||
tgui_icons = list("Service" = "cocktail", "Medical" = "plus", "Engineering" = "wrench")
|
||||
arrival_sound = 'sound/machines/tram/medical_line_processed.ogg'
|
||||
|
||||
/obj/effect/landmark/transport/nav_beacon/tram/platform/tramstation/east
|
||||
name = "Escape Station"
|
||||
name = "Escape"
|
||||
platform_code = TRAMSTATION_EAST
|
||||
tgui_icons = list("Departures" = "plane-departure", "Cargo" = "box", "Science" = "flask")
|
||||
arrival_sound = 'sound/machines/tram/escape_line_processed.ogg'
|
||||
@@ -87,28 +87,28 @@
|
||||
dir = WEST
|
||||
|
||||
/obj/effect/landmark/transport/nav_beacon/tram/platform/birdshot/sec_wing
|
||||
name = "Security Station"
|
||||
name = "Security"
|
||||
specific_transport_id = BIRDSHOT_LINE_1
|
||||
platform_code = BIRDSHOT_SECURITY_WING
|
||||
tgui_icons = list("Security" = "gavel")
|
||||
arrival_sound = 'sound/machines/tram/medical_line_processed.ogg'
|
||||
|
||||
/obj/effect/landmark/transport/nav_beacon/tram/platform/birdshot/prison_wing
|
||||
name = "Prison Station"
|
||||
name = "Prison"
|
||||
specific_transport_id = BIRDSHOT_LINE_1
|
||||
platform_code = BIRDSHOT_PRISON_WING
|
||||
tgui_icons = list("Prison" = "box")
|
||||
arrival_sound = 'sound/machines/tram/other_line_processed.ogg'
|
||||
|
||||
/obj/effect/landmark/transport/nav_beacon/tram/platform/birdshot/maint_left
|
||||
name = "Escape Station"
|
||||
name = "Escape"
|
||||
specific_transport_id = BIRDSHOT_LINE_2
|
||||
platform_code = BIRDSHOT_MAINTENANCE_LEFT
|
||||
tgui_icons = list("Port Platform" = "plane-departure")
|
||||
arrival_sound = 'sound/machines/tram/escape_line_processed.ogg'
|
||||
|
||||
/obj/effect/landmark/transport/nav_beacon/tram/platform/birdshot/maint_right
|
||||
name = "Arrivals Station"
|
||||
name = "Arrivals"
|
||||
specific_transport_id = BIRDSHOT_LINE_2
|
||||
platform_code = BRIDSHOT_MAINTENANCE_RIGHT
|
||||
tgui_icons = list("Starboard Platform" = "plane-arrival")
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user