Files
Bubberstation/code/game/objects/items/botpad_remote.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

59 lines
2.0 KiB
Plaintext

/obj/item/botpad_remote
name = "Bot pad controller"
desc = "Use this device to control the connected bot pad."
desc_controls = "Left-click for launch, right-click for recall."
icon = 'icons/obj/devices/remote.dmi'
icon_state = "botpad_controller"
w_class = WEIGHT_CLASS_SMALL
// ID of the remote, used for linking up
var/id = "botlauncher"
var/obj/machinery/botpad/connected_botpad
/obj/item/botpad_remote/Destroy()
if(connected_botpad)
connected_botpad.connected_remote = null
connected_botpad = null
return ..()
/obj/item/botpad_remote/attack_self(mob/living/user)
playsound(src, SFX_TERMINAL_TYPE, 25, FALSE)
try_launch(user)
return
/obj/item/botpad_remote/attack_self_secondary(mob/living/user)
playsound(src, SFX_TERMINAL_TYPE, 25, FALSE)
if(connected_botpad)
connected_botpad.recall(user)
return
user?.balloon_alert(user, "no connected pad!")
return
/obj/item/botpad_remote/multitool_act(mob/living/user, obj/item/tool)
if(!multitool_check_buffer(user, tool))
return
var/obj/item/multitool/multitool = tool
if(istype(multitool.buffer, /obj/machinery/botpad))
var/obj/machinery/botpad/buffered_remote = multitool.buffer
if(buffered_remote == connected_botpad)
to_chat(user, span_warning("Controller cannot connect to its own botpad!"))
else if(!connected_botpad && istype(buffered_remote, /obj/machinery/botpad))
connected_botpad = buffered_remote
connected_botpad.connected_remote = src
connected_botpad.id = id
multitool.set_buffer(null)
to_chat(user, span_notice("You connect the controller to the pad with data from the [multitool.name]'s buffer."))
else
to_chat(user, span_warning("Unable to upload!"))
/obj/item/botpad_remote/proc/try_launch(mob/living/user)
if(!connected_botpad)
user?.balloon_alert(user, "no connected pad!")
return
if(connected_botpad.panel_open)
user?.balloon_alert(user, "close the panel!")
return
if(!(locate(/mob/living) in get_turf(connected_botpad)))
user?.balloon_alert(user, "no bots detected on the pad!")
return
connected_botpad.launch(user)