Files
Aurora.3/code/game/objects/structures/fireaxe_cabinet.dm
T
7d058fc613 Jukebox TGUI update, Earphones autoplay, sound keys refactor (#21630)
V2 of [previous music playing
PR](https://github.com/Aurorastation/Aurora.3/pull/21466). TLDR no
longer uses the connect_range component for implementation because it
turned out a bit too inflexible for overlapping music players.

Removes a NanoUI template for the [TGUI
update](https://github.com/Aurorastation/Aurora.3/pull/21046).

New changelog:
  - refactor: "Ported Jukebox's NanoUI interface to TGUI."
- refactor: "Ported Jukebox audio playing functionality to a component."
- refactor: "Sound keys refactored from singletons to datums, along with
larger breakout of sound.dm to allow for easier SFX updates in future."
  - code_imp: "Expanded track datums to include track lengths."
- code_imp: "Reorganized music file folders for more intuitive access."
  - rscadd: "Earphone status feedback text now includes track length."
  - rscadd: "Added autoplay functionality to earphones."
- bugfix: "Fixed earphones' 'Previous Song' verb not sending you to the
end of the playlist when used while the first track is selected."
- bugfix: "Fixed gain adjustment for 'Konyang-1' (-23 dB -> standard
-9.8 dB)."
- bugfix: "Fixed y-offset of audioconsole-running overlay animation to
line up with the actual screen."

---------

Co-authored-by: VMSolidus <evilexecutive@gmail.com>
2026-01-22 16:54:40 +00:00

171 lines
4.1 KiB
Plaintext

/obj/structure/fireaxecabinet
name = "fire axe cabinet"
desc = "A fire axe cabinet. There is small label that reads \"FOR EMERGENCY USE ONLY\" along with details for safe use of the axe on the side of it. As if."
icon = 'icons/obj/wallmounts.dmi'
icon_state = "fireaxe"
anchored = TRUE
density = FALSE
req_access = null
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
var/damage_threshold = 10 // Damage needed to break the glass.
var/open
var/unlocked
var/shattered
var/obj/item/material/twohanded/fireaxe/fireaxe
/obj/structure/fireaxecabinet/north
dir = NORTH
pixel_y = 24
/obj/structure/fireaxecabinet/east
dir = EAST
pixel_x = 19
/obj/structure/fireaxecabinet/west
dir = WEST
pixel_x = -19
/obj/structure/fireaxecabinet/south
dir = SOUTH
pixel_y = -20
/obj/structure/fireaxecabinet/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type)
user.do_attack_animation(src)
playsound(user, 'sound/effects/glass_hit.ogg', 50, 1)
visible_message(SPAN_WARNING("\The [user] [attack_verb] \the [src]!"))
if(damage_threshold >= damage)
to_chat(user, SPAN_WARNING("Your strike is deflected by the reinforced glass!"))
return
if(shattered)
return
shattered = TRUE
unlocked = TRUE
open = TRUE
playsound(user, SFX_BREAK_GLASS, 100, 1)
update_icon()
/obj/structure/fireaxecabinet/update_icon()
ClearOverlays()
if(fireaxe)
AddOverlays("axe")
if(shattered)
AddOverlays("glass4")
if(unlocked)
AddOverlays("unlocked")
else
AddOverlays("locked")
if(open)
AddOverlays("glass_raised")
else
AddOverlays("glass")
/obj/structure/fireaxecabinet/New()
..()
fireaxe = new(src)
update_icon()
/obj/structure/fireaxecabinet/Initialize(mapload)
. = ..()
if(!mapload)
set_pixel_offsets()
/obj/structure/fireaxecabinet/set_pixel_offsets()
pixel_x = ((src.dir & (NORTH|SOUTH)) ? 0 : (src.dir == EAST ? 19 : -(19)))
pixel_y = ((src.dir & (NORTH|SOUTH)) ? (src.dir == NORTH ? 24 : -(20)) : 0)
/obj/structure/fireaxecabinet/attack_ai(var/mob/user)
if(!ai_can_interact(user))
return
toggle_lock(user)
/obj/structure/fireaxecabinet/attack_hand(var/mob/user)
if(!unlocked)
to_chat(user, SPAN_NOTICE("\The [src] is locked."))
return
toggle_open(user)
/obj/structure/fireaxecabinet/mouse_drop_dragged(atom/over, mob/user, src_location, over_location, params)
if(over == user)
var/mob/mob_dropped_over = over
if(!istype(mob_dropped_over))
return
if(!open)
to_chat(mob_dropped_over, SPAN_NOTICE("\The [src] is closed."))
return
if(!fireaxe)
to_chat(mob_dropped_over, SPAN_NOTICE("\The [src] is empty."))
return
fireaxe.forceMove(get_turf(mob_dropped_over))
mob_dropped_over.put_in_hands(fireaxe)
fireaxe = null
update_icon()
return
/obj/structure/fireaxecabinet/Destroy()
if(fireaxe)
fireaxe.forceMove(get_turf(src))
fireaxe = null
return ..()
/obj/structure/fireaxecabinet/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.ismultitool())
toggle_lock(user)
return
if(istype(attacking_item, /obj/item/material/twohanded/fireaxe))
if(open)
if(fireaxe)
to_chat(user, SPAN_ALERT("There is already \a [fireaxe] inside \the [src]."))
else if(user.unEquip(attacking_item))
attacking_item.forceMove(src)
fireaxe = attacking_item
to_chat(user, SPAN_NOTICE("You place \the [fireaxe] into \the [src]."))
update_icon()
return
if(attacking_item.force)
user.setClickCooldown(10)
attack_generic(user, attacking_item.force, "bashes")
return
return ..()
/obj/structure/fireaxecabinet/proc/toggle_open(var/mob/user)
if(shattered)
open = TRUE
unlocked = TRUE
else
user.setClickCooldown(10)
open = !open
to_chat(user, SPAN_NOTICE("You [open ? "open" : "close"] \the [src]."))
update_icon()
/obj/structure/fireaxecabinet/proc/toggle_lock(var/mob/user)
if(open)
return
if(shattered)
open = TRUE
unlocked = TRUE
else
user.setClickCooldown(10)
to_chat(user, SPAN_NOTICE("You begin [unlocked ? "enabling" : "disabling"] \the [src]'s maglock."))
if(!do_after(user, 20))
return
if(shattered)
return
unlocked = !unlocked
to_chat(user, SPAN_NOTICE("You [unlocked ? "disable" : "enable"] the maglock."))
update_icon()