mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-12 10:53:57 +00:00
32 lines
829 B
Plaintext
32 lines
829 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"
|
|
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/input_received(datum/port/input/port)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
|
|
var/atom/target_atom = target.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)
|