mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +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
@@ -34,6 +34,15 @@
|
||||
var/datum/port/input/south
|
||||
var/datum/port/input/west
|
||||
|
||||
// Done like this so that travelling diagonally is more simple
|
||||
COOLDOWN_DECLARE(north_delay)
|
||||
COOLDOWN_DECLARE(east_delay)
|
||||
COOLDOWN_DECLARE(south_delay)
|
||||
COOLDOWN_DECLARE(west_delay)
|
||||
|
||||
/// Delay between each movement
|
||||
var/move_delay = COMP_CLOCK_DELAY
|
||||
|
||||
/obj/item/circuit_component/bot_circuit/Initialize()
|
||||
. = ..()
|
||||
north = add_input_port("Move North", PORT_TYPE_SIGNAL)
|
||||
@@ -52,14 +61,18 @@
|
||||
|
||||
var/direction
|
||||
|
||||
if(COMPONENT_TRIGGERED_BY(north, port))
|
||||
if(COMPONENT_TRIGGERED_BY(north, port) && COOLDOWN_FINISHED(src, north_delay))
|
||||
direction = NORTH
|
||||
else if(COMPONENT_TRIGGERED_BY(east, port))
|
||||
COOLDOWN_START(src, north_delay, move_delay)
|
||||
else if(COMPONENT_TRIGGERED_BY(east, port) && COOLDOWN_FINISHED(src, east_delay))
|
||||
direction = EAST
|
||||
else if(COMPONENT_TRIGGERED_BY(south, port))
|
||||
COOLDOWN_START(src, east_delay, move_delay)
|
||||
else if(COMPONENT_TRIGGERED_BY(south, port) && COOLDOWN_FINISHED(src, south_delay))
|
||||
direction = SOUTH
|
||||
else if(COMPONENT_TRIGGERED_BY(west, port))
|
||||
COOLDOWN_START(src, south_delay, move_delay)
|
||||
else if(COMPONENT_TRIGGERED_BY(west, port) && COOLDOWN_FINISHED(src, west_delay))
|
||||
direction = WEST
|
||||
COOLDOWN_START(src, west_delay, move_delay)
|
||||
|
||||
if(!direction)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user