Alt-click lock toggle functionality, APC SFX upgrade (#21310)

Updated objects whose behavior when an ID was used on them was strictly
toggling lock/unlock status to use Alt-click functionality, with
associated pop-up messages for the clicking player. Mechanics hints for
all affected objects updated.

Fixed APC sprite's status lights for each power channel (general messy
alignment).

Updated APC sprite's lock status light to be brighter/clearer for better
visual feedback of lock status.

Added a lot of nice clicky beepy sounds to APCs. They all came from here
on TG, and they seem oooooold so I wasn't able to find credit. [So,
credit to TG for sounds/machines/terminal sounds until we track down an
actual
name!](https://github.com/tgstation/tgstation/tree/master/sound/machines/terminal)

Updated dmdocs as I passed by them.
This commit is contained in:
Batrachophreno
2025-10-03 15:56:32 +00:00
committed by GitHub
parent 41dedf13aa
commit f06bdc8b3c
34 changed files with 387 additions and 201 deletions
+28 -15
View File
@@ -155,15 +155,20 @@
req_access = list(ACCESS_ENGINE)
var/health = 100
var/active = FALSE
var/malfunction = FALSE //Malfunction causes parts of the shield to slowly dissapate
// Malfunction causes parts of the shield to slowly dissapate
var/malfunction = FALSE
var/list/deployed_shields = list()
var/list/regenerating = list()
var/is_open = FALSE //Whether or not the wires are exposed
panel_open = FALSE
var/locked = FALSE
var/check_delay = 60 //periodically recheck if we need to rebuild a shield
use_power = POWER_USE_OFF
idle_power_usage = 0
/obj/machinery/shieldgen/mechanics_hints(mob/user, distance, is_adjacent)
. += ..()
. += "ALT-click the [src] to lock or unlock it (if you have the appropriate ID access)."
/obj/machinery/shieldgen/Destroy()
collapse_shields()
return ..()
@@ -289,7 +294,7 @@
if(locked)
to_chat(user, SPAN_WARNING("The machine is locked!"))
return
if(is_open)
if(panel_open)
to_chat(user, SPAN_WARNING("The panel must be closed before operating this machine."))
return
@@ -317,14 +322,14 @@
/obj/machinery/shieldgen/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.isscrewdriver())
attacking_item.play_tool_sound(get_turf(src), 50)
if(is_open)
if(panel_open)
to_chat(user, SPAN_NOTICE("You close the panel."))
is_open = FALSE
panel_open = FALSE
else
to_chat(user, SPAN_NOTICE("You open the panel and expose the wiring."))
is_open = TRUE
panel_open = TRUE
else if(attacking_item.iscoil() && malfunction && is_open)
else if(attacking_item.iscoil() && malfunction && panel_open)
var/obj/item/stack/cable_coil/coil = attacking_item
to_chat(user, SPAN_NOTICE("You begin to replace the wires."))
//if(do_after(user, min(60, round( ((maxhealth/health)*10)+(malfunction*10) ))) //Take longer to repair heavier damage
@@ -352,17 +357,25 @@
to_chat(user, SPAN_NOTICE("You secure the [src] to the floor!"))
anchored = TRUE
else if(attacking_item.GetID())
if(src.allowed(user))
src.locked = !src.locked
to_chat(user, "The controls are now [src.locked ? "locked." : "unlocked."]")
else
to_chat(user, SPAN_WARNING("Access denied."))
else
..()
/obj/machinery/shieldgen/AltClick(mob/user)
if(Adjacent(user))
add_fingerprint(user)
if(allowed(user))
locked = !locked
if(locked)
playsound(src, 'sound/machines/terminal/terminal_button03.ogg', 35, FALSE)
else
playsound(src, 'sound/machines/terminal/terminal_button01.ogg', 35, FALSE)
balloon_alert(user, locked ? "locked" : "unlocked")
else
to_chat(user, SPAN_WARNING("Access denied."))
playsound(src, 'sound/machines/terminal/terminal_error.ogg', 25, FALSE)
balloon_alert(user, "access denied!")
return
/obj/machinery/shieldgen/update_icon()
if(active && !(stat & NOPOWER))
+16 -5
View File
@@ -23,7 +23,12 @@
///How much power is drawn from powernet. Increase this to allow the generator to sustain longer shields, at the cost of more power draw.
var/power_draw = 30 KILO WATTS
var/max_stored_power = 50 KILO WATTS
use_power = POWER_USE_OFF //Draws directly from power net. Does not use APC power.
/// Draws directly from power net. Does not use APC power.
use_power = POWER_USE_OFF
/obj/machinery/shieldwallgen/mechanics_hints(mob/user, distance, is_adjacent)
. += ..()
. += "ALT-click the [src] to lock or unlock it (if you have the appropriate ID access)."
/obj/machinery/shieldwallgen/update_icon()
if(power_state >= POWER_STARTING)
@@ -156,17 +161,23 @@
var/self_msg = wrenched ? "You secure the external reinforcing bolts to the floor." : "You unsecure the external reinforcing bolts."
user.visible_message(others_msg, SPAN_NOTICE(self_msg), SPAN_NOTICE("You hear a ratcheting noise."))
return
return ..()
if(attacking_item.GetID())
/obj/machinery/shieldwallgen/AltClick(mob/user)
if(Adjacent(user))
add_fingerprint(user)
if(allowed(user))
locked = !locked
var/msg = "The controls are now [locked ? "locked" : "unlocked"]."
to_chat(user, SPAN_NOTICE(msg))
if(locked)
playsound(src, 'sound/machines/terminal/terminal_button03.ogg', 35, FALSE)
else
playsound(src, 'sound/machines/terminal/terminal_button01.ogg', 35, FALSE)
balloon_alert(user, locked ? "locked" : "unlocked")
else
to_chat(user, SPAN_WARNING("Access denied."))
playsound(src, 'sound/machines/terminal/terminal_error.ogg', 25, FALSE)
balloon_alert(user, "access denied!")
return
return ..()
/obj/machinery/shieldwallgen/proc/alldir_cleanup()
for(var/dir in list(NORTH, SOUTH, EAST, WEST))