change ruleset
This commit is contained in:
@@ -8,17 +8,22 @@ func tick(actor: Node, blackboard: Blackboard) -> int:
|
||||
|
||||
if actor.action_points <= 0:
|
||||
return FAILURE
|
||||
|
||||
|
||||
if not actor.is_bot and not actor.is_in_group("Bots"):
|
||||
return FAILURE
|
||||
|
||||
# Execute movement
|
||||
if actor.is_within_movement_range(target_pos):
|
||||
if actor.is_multiplayer_authority():
|
||||
if actor.is_bot:
|
||||
var path = actor.enhanced_gridmap.find_path(
|
||||
Vector2(actor.current_position),
|
||||
Vector2(target_pos)
|
||||
Vector2(target_pos),
|
||||
0,
|
||||
false
|
||||
)
|
||||
if path.size() > 1:
|
||||
path.pop_front()
|
||||
actor.rpc("start_movement_along_path", path)
|
||||
actor.rpc("start_movement_along_path", path, false)
|
||||
actor.action_points -= 1
|
||||
blackboard.set_value("current_action", "moving")
|
||||
return SUCCESS
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extends BeehaveTree
|
||||
# In bot_behavior.gd
|
||||
|
||||
func _ready():
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
@@ -21,4 +21,4 @@ func _ready():
|
||||
# Wait a frame to ensure all nodes are ready
|
||||
await get_tree().process_frame
|
||||
|
||||
enabled = true
|
||||
enabled = parent.is_multiplayer_authority() and parent.is_bot
|
||||
|
||||
Reference in New Issue
Block a user