From 3ba7822ae0e4b4e1a39eee3051e255c7948769db Mon Sep 17 00:00:00 2001 From: Capt_Segis Date: Sun, 18 Sep 2016 11:52:44 -0500 Subject: [PATCH] Update Whirlwind.vb --- 2.5DHero/2.5DHero/Pokemon/Attacks/Normal/Whirlwind.vb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/2.5DHero/2.5DHero/Pokemon/Attacks/Normal/Whirlwind.vb b/2.5DHero/2.5DHero/Pokemon/Attacks/Normal/Whirlwind.vb index 74a492e97..c33c5204e 100644 --- a/2.5DHero/2.5DHero/Pokemon/Attacks/Normal/Whirlwind.vb +++ b/2.5DHero/2.5DHero/Pokemon/Attacks/Normal/Whirlwind.vb @@ -73,7 +73,11 @@ 'trainer battle If own = True Then If BattleScreen.Trainer.CountUseablePokemon > 1 Then - BattleScreen.Battle.SwitchOutOpp(BattleScreen, -1, "") + Dim i As Integer = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count) + While BattleScreen.Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse BattleScreen.OppPokemonIndex = i OrElse BattleScreen.Trainer.Pokemons(i).HP <= 0 + i = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count) + End While + BattleScreen.Battle.SwitchOutOpp(BattleScreen, i, "") Else BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!")) End If