Skip to content

Commit

Permalink
Makes Elevator Emergency Stop Non-Silent, Fix Panel Stop Button Appea…
Browse files Browse the repository at this point in the history
…rance (#385)
  • Loading branch information
RimiNosha authored Nov 28, 2023
1 parent 5cf2c47 commit fa38505
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
6 changes: 3 additions & 3 deletions _maps/RandomRuins/SpaceRuins/hilbertresearchfacility.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@
/turf/open/floor/mineral/titanium/tiled/white,
/area/ruin/space/has_grav/powered/hilbertresearchfacility)
"kP" = (
/obj/machinery/button/elevator/speaker{
/obj/machinery/button/elevator{
id = "hilbert";
pixel_y = 4
},
Expand Down Expand Up @@ -2136,7 +2136,7 @@
dir = 8
},
/obj/structure/table/reinforced/rglass,
/obj/machinery/button/elevator/speaker{
/obj/machinery/button/elevator{
id = "right_part_hilbert";
pixel_y = 4
},
Expand All @@ -2153,7 +2153,7 @@
dir = 1
},
/obj/structure/sign/departments/cargo/directional/north,
/obj/machinery/button/elevator/speaker{
/obj/machinery/button/elevator{
id = "hilbert";
pixel_y = 4
},
Expand Down
6 changes: 3 additions & 3 deletions _maps/map_files/tramstation/tramstation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@
/turf/open/floor/iron/grimy,
/area/station/hallway/secondary/entry)
"aMD" = (
/obj/machinery/button/elevator/speaker{
/obj/machinery/button/elevator{
id = "tram"
},
/turf/closed/wall,
Expand Down Expand Up @@ -26475,7 +26475,7 @@
/turf/open/floor/iron,
/area/station/hallway/secondary/entry)
"jEO" = (
/obj/machinery/button/elevator/speaker{
/obj/machinery/button/elevator{
id = "tram"
},
/turf/closed/wall,
Expand Down Expand Up @@ -37541,7 +37541,7 @@
/turf/open/floor/iron,
/area/station/engineering/atmospherics_engine)
"nwQ" = (
/obj/machinery/button/elevator/speaker{
/obj/machinery/button/elevator{
id = "tram"
},
/turf/closed/wall,
Expand Down
7 changes: 7 additions & 0 deletions code/datums/industrial_lift/lift_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
/// Whether we are currently managing a roof
var/managing_roof = FALSE

/// A list of elevator panels to notify when lift is e-stopped.
var/list/controller_machines = list()

/datum/lift_controller/process(delta_time)
if(next_action_time > world.time)
return
Expand Down Expand Up @@ -269,6 +272,9 @@
intentionally_halted = !intentionally_halted
if(intentionally_halted)
SetHalted(TRUE)
for(var/atom/movable/speaker as anything in controller_machines)
speaker.say("The elevator has been emergency stopped!")
playsound(speaker, 'sound/machines/warning-buzzer.ogg', 75)
else
next_action_time = world.time + 1 SECONDS

Expand Down Expand Up @@ -339,6 +345,7 @@
if(halted)
travel_progress = 0
loop_sound.stop()
playsound(GetSoundTurf(), )
else
loop_sound.start()
if(!current_wp)
Expand Down
25 changes: 10 additions & 15 deletions code/game/objects/structures/industrial_lift_structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@
. += mutable_appearance(icon, display_icon)
. += emissive_appearance(icon, display_icon)


/obj/item/assembly/control/elevator
name = "elevator controller"
desc = "A small device used to call elevators to the current floor."
var/has_speaker = FALSE

/obj/item/assembly/control/elevator/activate()
if(cooldown)
Expand All @@ -60,31 +58,22 @@
if(!stop_wp)
return
if(controller.called_waypoints[stop_wp])
if(has_speaker)
say("The [controller.name] is already called to this location.")
say("The [controller.name] is already called to this location.")
return
if(!controller.destination_wp && controller.current_wp == stop_wp)
if(has_speaker)
say("The [controller.name] is already here. Please board the [controller.name] and select a destination.")
say("The [controller.name] is already here. Please board the [controller.name] and select a destination.")
return
playsound(my_turf, 'sound/lifts/elevator_ding.ogg', 60)
if(has_speaker)
say("The [controller.name] has been called to [stop_wp.name]. Please wait for its arrival.")
say("The [controller.name] has been called to [stop_wp.name]. Please wait for its arrival.")
controller.CallWaypoint(stop_wp)

/obj/item/assembly/control/elevator/speaker
has_speaker = TRUE

/obj/machinery/button/elevator
name = "elevator button"
desc = "Go back. Go back. Go back. Can you operate the elevator."
icon_state = "launcher"
skin = "launcher"
device_type = /obj/item/assembly/control/elevator

/obj/machinery/button/elevator/speaker
device_type = /obj/item/assembly/control/elevator/speaker

/obj/structure/elevator_control_panel
icon = 'icons/obj/structures/elevator_control.dmi'
icon_state = "elevator_control"
Expand Down Expand Up @@ -119,6 +108,7 @@
if(linked_controller)
name = "[linked_controller.name] control panel"
desc = "A panel which interfaces with \the [linked_controller.name] controls."
linked_controller.controller_machines |= src

/obj/structure/elevator_control_panel/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
Expand All @@ -140,7 +130,7 @@
var/datum/lift_waypoint/stop_wp = i
floors += list(list("id" = stop_wp.waypoint_id, "is_active" = !!queued_stops[stop_wp] || stop_wp.position.z == z, "name" = stop_wp.name))

data += list("floors" = floors, "is_stopped" = linked_controller.halted)
data += list("floors" = floors, "is_stopped" = linked_controller.intentionally_halted)
return data

/obj/structure/elevator_control_panel/ui_act(action, params)
Expand Down Expand Up @@ -168,3 +158,8 @@
playsound(src, SFX_TERMINAL_TYPE, 50)
ui_interact(usr)
return TRUE

/obj/structure/elevator_control_panel/Destroy()
if(linked_controller)
linked_controller.controller_machines -= src
return ..()
5 changes: 5 additions & 0 deletions tools/UpdatePaths/Artea/385_remove_speaker_buttons.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#comment Replaces speaker buttons with... speaker buttons.
https://github.com/Artea-Station/Artea-Station-Server/pull/385

/obj/item/assembly/control/elevator/speaker : /obj/item/assembly/control/elevator{@OLD}
/obj/machinery/button/elevator/speaker : /obj/machinery/button/elevator{@OLD}

0 comments on commit fa38505

Please sign in to comment.