Files
Bubberstation/code/modules/wiremod/shell/bot.dm
MrMelbert 6fea9d999d Small playsound audit, particularly involving portal sounds (#83893)
## About The Pull Request

I was looking at sounds (as you do) and I noticed this


![image](https://github.com/tgstation/tgstation/assets/51863163/25b298ca-31ac-48a0-9f86-c65a8becd532)

These sounds don't exist

We have `portal_open_1`, not `portal_open1`. 
This wasn't caught on compile because they used `""` and not `''`.

So I went through and audited a bunch of playsound uses that don't use
`''`. Only one error, fortunately

Likewise there was a ton of places running `get_sfx` pointlessly
(because `playsound` does it for you) so I clened that up.

However while auditing the portal stuff I noticed a few oddities, so I
cleaned it up a bit.

Also also I added the portal sounds to the wormholes event and gave it a
free ™️ optimization because it was an in-world loop

## Changelog

🆑 Melbert
sound: Portals made by portal guns now make sounds as expected
sound: Wormholes from the wormhole event now make sounds when formed
/🆑
2024-06-13 23:47:37 -06:00

49 lines
1.4 KiB
Plaintext

/**
* # Bot
*
* Immobile (but not dense) shells that can interact with world.
*/
/obj/structure/bot
name = "bot"
icon = 'icons/obj/science/circuits.dmi'
icon_state = "setup_medium_box"
density = FALSE
light_system = OVERLAY_LIGHT
light_on = FALSE
/obj/structure/bot/Initialize(mapload)
. = ..()
AddComponent( \
/datum/component/shell, \
unremovable_circuit_components = list(new /obj/item/circuit_component/bot), \
capacity = SHELL_CAPACITY_LARGE, \
shell_flags = SHELL_FLAG_USB_PORT, \
)
/obj/item/circuit_component/bot
display_name = "Bot"
desc = "Triggers when someone interacts with the bot."
/// Called when attack_hand is called on the shell.
var/datum/port/output/signal
/// The user who used the bot
var/datum/port/output/entity
/obj/item/circuit_component/bot/populate_ports()
entity = add_output_port("User", PORT_TYPE_USER)
signal = add_output_port("Signal", PORT_TYPE_SIGNAL)
/obj/item/circuit_component/bot/register_shell(atom/movable/shell)
RegisterSignal(shell, COMSIG_ATOM_ATTACK_HAND, PROC_REF(on_attack_hand))
/obj/item/circuit_component/bot/unregister_shell(atom/movable/shell)
UnregisterSignal(shell, COMSIG_ATOM_ATTACK_HAND)
/obj/item/circuit_component/bot/proc/on_attack_hand(atom/source, mob/user)
SIGNAL_HANDLER
source.balloon_alert(user, "pushed button")
playsound(source, SFX_TERMINAL_TYPE, 25, FALSE)
entity.set_output(user)
signal.set_output(COMPONENT_SIGNAL)