Add addons

This commit is contained in:
Joey Yakimowich-Payne 2023-01-03 16:53:53 -07:00
commit 3367bad24f
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
527 changed files with 36197 additions and 0 deletions

View file

@ -0,0 +1,26 @@
## Sequence nodes will attempt to execute all of its children and report
## `SUCCESS` in case all of the children report a `SUCCESS` status code.
## If at least one child reports a `FAILURE` status code, this node will also
## return `FAILURE`. This node will attempt to process all its children every
## single tick, even if one of them is currently `RUNNING` already.
@tool
class_name SequenceComposite extends Composite
@icon("../../icons/sequence.svg")
func tick(actor: Node, blackboard: Blackboard) -> int:
for c in get_children():
var response = c.tick(actor, blackboard)
if c is ConditionLeaf:
blackboard.set_value("last_condition", c)
blackboard.set_value("last_condition_status", response)
if response != SUCCESS:
if response == FAILURE:
# Interrupt any child that was RUNNING before.
interrupt(actor, blackboard)
else: # RUNNING
running_child = c
return response
return SUCCESS