mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-11 17:35:05 +00:00
* Added circuit component UI details, added multiplexer and allowed inserting components directly into shells. (#59635) Adds the multiplexer circuit component - en.wikipedia.org/wiki/Multiplexer Circuit components can now be directly inserted into shells rather than having to take the integrated circuit out. Special information can be accessed from components now through the "Info" button besides the eject button on a component. * Added circuit component UI details, added multiplexer and allowed inserting components directly into shells. Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
36 lines
915 B
Plaintext
36 lines
915 B
Plaintext
/**
|
|
* # Pull Component
|
|
*
|
|
* Tells the shell to start pulling on a designated atom. Only works on movable shells.
|
|
*/
|
|
/obj/item/circuit_component/pull
|
|
display_name = "Start Pulling"
|
|
display_desc = "A component that can force the shell to pull entities. Only works for drone shells."
|
|
|
|
/// Frequency input
|
|
var/datum/port/input/target
|
|
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL
|
|
|
|
/obj/item/circuit_component/pull/Initialize()
|
|
. = ..()
|
|
target = add_input_port("Target", PORT_TYPE_ATOM)
|
|
|
|
/obj/item/circuit_component/pull/Destroy()
|
|
target = null
|
|
return ..()
|
|
|
|
/obj/item/circuit_component/pull/input_received(datum/port/input/port)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
|
|
var/atom/target_atom = target.input_value
|
|
if(!target_atom)
|
|
return
|
|
|
|
var/mob/shell = parent.shell
|
|
if(!istype(shell) || get_dist(shell, target_atom) > 1 || shell.z != target_atom.z)
|
|
return
|
|
|
|
shell.start_pulling(target_atom)
|