update bot experimental
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
extends ConditionLeaf
|
||||
|
||||
func tick(actor: Node, blackboard: Blackboard) -> int:
|
||||
var main = get_tree().get_root().get_node_or_null("Main")
|
||||
if not main:
|
||||
return FAILURE
|
||||
|
||||
# Always return SUCCESS for bots in non-turn-based mode
|
||||
if actor.is_bot and not main.turn_based_mode:
|
||||
return SUCCESS
|
||||
|
||||
# Update action points in blackboard
|
||||
blackboard.set_value("action_points", actor.action_points)
|
||||
|
||||
# Check if we have enough AP
|
||||
if actor.action_points >= 1:
|
||||
return SUCCESS
|
||||
return FAILURE
|
||||
|
||||
Reference in New Issue
Block a user