change ruleset

This commit is contained in:
2025-01-31 12:13:03 +08:00
parent 637447c867
commit 6272cd86e8
6 changed files with 113 additions and 298 deletions
+9 -4
View File
@@ -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
+2 -2
View File
@@ -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