Recall sent pokemon at the end of the battle

This commit is contained in:
TheThomaas 2026-10-17 23:28:08 +02:00
parent 250976d170
commit 31c3e232f2

View file

@ -86,12 +86,11 @@ func start_encounter(encounter : BattleEncounter, enemy_pos : Vector3, sent : Se
await presenter.cleanup() await presenter.cleanup()
ui.queue_free() ui.queue_free()
#retour au monde #retour au monde : tous les pokemon sortis rentrent dans leur balle ; l'adversaire du monde reapparait
for node in hidden:
if is_instance_valid(node): node.visible = true
for node in get_tree().get_nodes_in_group(SentPokemon.GROUP): for node in get_tree().get_nodes_in_group(SentPokemon.GROUP):
if node is SentPokemon and node.pokemon != null and node.pokemon.is_fainted(): if node is SentPokemon: node.recall()
node.recall() #un pokemon K.O. est rappele for node in hidden:
if is_instance_valid(node) and !(node is SentPokemon): node.visible = true
if world_actor != null and is_instance_valid(world_actor): if world_actor != null and is_instance_valid(world_actor):
if outcome == Battle.Outcome.PLAYER_WON and encounter.remove_world_actor_on_win: if outcome == Battle.Outcome.PLAYER_WON and encounter.remove_world_actor_on_win: