Remove Pokémon if it faints due to poison damage..

with the DeathInsteadOfFaint GameRule set to 1
This commit is contained in:
JappaWakka 2023-02-26 12:38:25 +01:00
parent 4a38a43e1f
commit a371268441
1 changed files with 12 additions and 0 deletions

View File

@ -1903,6 +1903,18 @@
If Core.Player.Pokemons(i).HP <= 0 Then
Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.Fainted
Screen.TextBox.Show(Core.Player.Pokemons(i).GetDisplayName & " Fainted.")
'Remove fainted Pokémon from player's team if the DeathInsteadOfFaint GameRule is activated.
If CBool(GameModeManager.GetGameRuleValue("DeathInsteadOfFaint", "0")) = True Then
For i = 0 To Core.Player.Pokemons.Count - 1
If i <= Core.Player.Pokemons.Count - 1 Then
If Core.Player.Pokemons(i).HP <= 0 Or Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.Fainted Then
Core.Player.Pokemons.RemoveAt(i)
i -= 1
End If
End If
Next
End If
End If
If Core.Player.CountFightablePokemon = 0 Then
Core.SetScreen(New TransitionScreen(Core.CurrentScreen, New BlackOutScreen(Core.CurrentScreen), Color.Black, False))