Skip to content

Commit

Permalink
Merge pull request #15 from the-dev-bin/delay-enemy-actions
Browse files Browse the repository at this point in the history
Add 1s delay before enemies act
  • Loading branch information
Nezteb authored Jul 31, 2024
2 parents f5eacfa + 0a4c42f commit ddd58f3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions godot/scenes/combat_arena/combat_arena.gd
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ func _on_end_turn_button_pressed():
ingredient.action.process_action(player_node, enemy_nodes, currently_targeted_enemy)
ingredient_pouch.add_blocks_to_trash(cauldron.get_ingredients())
cauldron.clear_board()
ingredient_pouch.clear_hand()
ingredient_pouch.draw_hand()

# 1 second delay between ending turn and enemies acting
await get_tree().create_timer(1).timeout
for enemy_spawn in get_alive_enemies():
# again, should eventually take into account all enemies
var enemy = enemy_spawn.get_enemy_node()
Expand All @@ -88,8 +93,6 @@ func _on_end_turn_button_pressed():

action.process_action(player_node, alive_enemies , action_entry.params, enemy)
enemy.update_intent()
ingredient_pouch.clear_hand()
ingredient_pouch.draw_hand()

if get_alive_enemies().size() <= 0:
end_battle()
Expand Down

0 comments on commit ddd58f3

Please sign in to comment.