mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-21 12:56:10 +01:00
7d058fc613
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>
66 lines
1.8 KiB
Plaintext
66 lines
1.8 KiB
Plaintext
/obj/item/umbrella
|
|
name = "umbrella"
|
|
desc = "A perfect tool to protect you from the elements."
|
|
icon = 'icons/obj/item/umbrellas.dmi'
|
|
icon_state = "umbrella_yellow_closed"
|
|
contained_sprite = TRUE
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
matter = list(MATERIAL_PLASTIC = 1000)
|
|
force = 5
|
|
sharp = TRUE
|
|
hitsound = 'sound/weapons/bladeslice.ogg'
|
|
attack_verb = list("pokes", "stabs")
|
|
/// If the umbrella is open or not.
|
|
var/is_open = FALSE
|
|
/// Colour of the umbrella. Must be one present in the dmi.
|
|
var/umbrella_color
|
|
|
|
/obj/item/umbrella/Initialize(mapload, ...)
|
|
. = ..()
|
|
if(!umbrella_color)
|
|
umbrella_color = pick("black", "red", "yellow", "green")
|
|
icon_state = "umbrella_[umbrella_color]"
|
|
item_state = icon_state + "_closed"
|
|
update_icon()
|
|
|
|
/obj/item/umbrella/attack_self(mob/user)
|
|
. = ..()
|
|
if(!user.incapacitated())
|
|
if(!is_open)
|
|
to_chat(user, SPAN_NOTICE("You unfurl \the [src]."))
|
|
item_state = "umbrella_[umbrella_color]_open"
|
|
w_class = WEIGHT_CLASS_BULKY
|
|
is_open = TRUE
|
|
force = 1
|
|
sharp = FALSE
|
|
attack_verb = list("taps")
|
|
hitsound = SFX_PUNCH_MISS
|
|
else
|
|
to_chat(user, SPAN_NOTICE("You close up \the [src]."))
|
|
item_state = "umbrella_[umbrella_color]_closed"
|
|
w_class = initial(w_class)
|
|
is_open = FALSE
|
|
force = initial(force)
|
|
sharp = initial(sharp)
|
|
attack_verb = initial(attack_verb)
|
|
hitsound = initial(hitsound)
|
|
|
|
/obj/item/umbrella/gives_weather_protection()
|
|
return is_open ? TRUE : FALSE
|
|
|
|
/obj/item/umbrella/red
|
|
umbrella_color = "red"
|
|
icon_state = "umbrella_red_closed"
|
|
|
|
/obj/item/umbrella/black
|
|
umbrella_color = "black"
|
|
icon_state = "umbrella_black_closed"
|
|
|
|
/obj/item/umbrella/yellow
|
|
umbrella_color = "yellow"
|
|
icon_state = "umbrella_yellow_closed"
|
|
|
|
/obj/item/umbrella/green
|
|
umbrella_color = "green"
|
|
icon_state = "umbrella_green_closed"
|