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:
parent
35007f893f
commit
70742e3637
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue