mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
USB Cables -- Connect circuits to computers/machines (#59345)
* Initial commit * Sprites, finishing work * More ways to detach from circuitboards * Clear TODOs, give bots a button * Fix qdel loop * Designs * It's the bots that have them * Grammar fix * Feedback for connecting to circuit directly * Add USB cable design to basic circuitry * Better naming * Feedback * Fix for new code * COMSIG_CIRCUIT_ADD_COMPONENT_MANUALLY * span procs
This commit is contained in:
@@ -14,5 +14,35 @@
|
||||
|
||||
/obj/structure/bot/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/shell, null, SHELL_CAPACITY_LARGE)
|
||||
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"
|
||||
|
||||
/// Called when attack_hand is called on the shell.
|
||||
var/datum/port/output/signal
|
||||
|
||||
/obj/item/circuit_component/bot/Initialize()
|
||||
. = ..()
|
||||
signal = add_output_port("Signal", PORT_TYPE_SIGNAL)
|
||||
|
||||
/obj/item/circuit_component/bot/Destroy()
|
||||
signal = null
|
||||
return ..()
|
||||
|
||||
/obj/item/circuit_component/bot/register_shell(atom/movable/shell)
|
||||
RegisterSignal(shell, COMSIG_ATOM_ATTACK_HAND, .proc/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, get_sfx("terminal_type"), 25, FALSE)
|
||||
signal.set_output(COMPONENT_SIGNAL)
|
||||
|
||||
Reference in New Issue
Block a user