mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-23 22:05:36 +02:00
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)
|
Public Sub SendInNewTrainerPokemon(ByVal index As Integer)
|
||||||
Dim i As Integer = index
|
Dim i As Integer = index
|
||||||
|
|
||||||
If i = -1 Then
|
If i = -1 Then
|
||||||
i = Core.Random.Next(0, Trainer.Pokemons.Count)
|
If IsPvPBattle Then
|
||||||
While Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted Or OppPokemonIndex = i Or Trainer.Pokemons(i).HP <= 0
|
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)
|
i += 1
|
||||||
End While
|
End While
|
||||||
End If
|
|
||||||
|
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
|
OppPokemonIndex = i
|
||||||
OppPokemon = Trainer.Pokemons(i)
|
OppPokemon = Trainer.Pokemons(i)
|
||||||
@ -1489,4 +1497,4 @@ nextIndex:
|
|||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
End Namespace
|
End Namespace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user