Fixed PvP Random Switch in after fainting

It's now supposed to switch into the first available pokemon.
PvE battles remain unchanged.
This commit is contained in:
Capt_Segis 2016-09-16 19:54:40 -05:00 committed by GitHub
parent 35007f893f
commit 70742e3637
1 changed files with 15 additions and 7 deletions

View File

@ -1075,13 +1075,21 @@ nextIndex:
Public Sub SendInNewTrainerPokemon(ByVal index As Integer)
Dim i As Integer = index
If i = -1 Then
i = Core.Random.Next(0, Trainer.Pokemons.Count)
While Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted Or OppPokemonIndex = i Or Trainer.Pokemons(i).HP <= 0
i = Core.Random.Next(0, Trainer.Pokemons.Count)
End While
End If
If IsPvPBattle Then
While Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse OppPokemonIndex = i OrElse Trainer.Pokemons(i).HP <= 0
i += 1
End While
Else
i = Core.Random.Next(0, Trainer.Pokemons.count)
While Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse OppPokemonIndex = i OrElse Trainer.Pokemons(i).HP <= 0
i = Core.Random.Next(0, Trainer.Pokemons.count)
End While
End If
End If
OppPokemonIndex = i
OppPokemon = Trainer.Pokemons(i)
@ -1489,4 +1497,4 @@ nextIndex:
End Class
End Namespace
End Namespace