Fix roar not ending wild battle

Made ability suction cups prevent Roar from hitting
This commit is contained in:
JappaWakka 2023-01-27 17:43:02 +01:00
parent 7d300c93d5
commit a15414bf24
1 changed files with 3 additions and 12 deletions

View File

@ -65,13 +65,13 @@
p = BattleScreen.OppPokemon
End If
If BattleCalculation.CanSwitch(BattleScreen, Not own) = True Then
If BattleCalculation.CanSwitch(BattleScreen, Not own) = True AndAlso p.Ability.Name.ToLower() <> "suction cups" Then
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " got scared away!"))
If BattleScreen.IsPVPBattle = True Or BattleScreen.IsTrainerBattle = True Or BattleScreen.IsRemoteBattle = True Then
'trainer battle
If own = True Then
If BattleScreen.Trainer.CountUseablePokemon > 1 Then
Dim i As Integer = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count)
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 - 1)
End While
@ -92,16 +92,7 @@
End If
Else
'wild battle
If own = True Then
BattleScreen.BattleQuery.Add(New EndBattleQueryObject(False))
Else
If Core.Player.CountFightablePokemon > 1 Then
BattleScreen.Battle.SwitchOutOwn(BattleScreen, -1, -1)
Else
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
End If
End If
BattleScreen.BattleQuery.Add(New EndBattleQueryObject(False))
End If
Else
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))