mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
[MIRROR] More circuit components. Restructures the circuit components folder to be more organised. (#6142)
* More circuit components. Restructures the circuit components folder to be more organised. * Mirror! Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Funce <funce.973@gmail.com>
This commit is contained in:
co-authored by
Watermelon914
Funce
parent
6e52d05e2e
commit
cc5cf407b0
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* # 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"
|
||||
|
||||
/// 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)
|
||||
Reference in New Issue
Block a user