Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
/** * # Speech Component * * Sends a message. Requires a shell. */ /obj/item/circuit_component/pathfind display_name = "Pathfinder" display_desc = "Calcualtes a path, returns a list of entities. Each entity is the next step in the path. Can be used with the direction component to move." circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL var/datum/port/input/target_X var/datum/port/input/target_Y var/datum/port/output/output var/datum/port/output/on_fail /obj/item/circuit_component/pathfind/Initialize() . = ..() target_X = add_input_port("X", PORT_TYPE_NUMBER, FALSE) target_Y = add_input_port("Y", PORT_TYPE_NUMBER, FALSE) output = add_output_port("Output", PORT_TYPE_LIST) on_fail = add_output_port("Failed", PORT_TYPE_SIGNAL) /obj/item/circuit_component/pathfind/Destroy() target_X = null target_Y = null output = null on_fail = null return ..() /obj/item/circuit_component/pathfind/input_received(datum/port/input/port) . = ..() if(.) return if(isnull(target_X)) return if(isnull(target_Y)) return var/atom/movable/shell = parent.shell var/turf/currentpos = get_turf(shell) var/turf/destination = locate(target_X, target_Y, currentpos.z) var/list/path = get_path_to(shell, destination) if(!length(path)) on_fail.set_output(COMPONENT_SIGNAL) return else output.set_output(path)
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)