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

View File

@ -65,13 +65,13 @@
p = BattleScreen.OppPokemon p = BattleScreen.OppPokemon
End If 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!")) BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " got scared away!"))
If BattleScreen.IsPVPBattle = True Or BattleScreen.IsTrainerBattle = True Or BattleScreen.IsRemoteBattle = True Then If BattleScreen.IsPVPBattle = True Or BattleScreen.IsTrainerBattle = True Or BattleScreen.IsRemoteBattle = True Then
'trainer battle 'trainer battle
If own = True Then If own = True Then
If BattleScreen.Trainer.CountUseablePokemon > 1 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 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) i = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.Count - 1)
End While End While
@ -92,16 +92,7 @@
End If End If
Else Else
'wild battle 'wild battle
BattleScreen.BattleQuery.Add(New EndBattleQueryObject(False))
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
End If End If
Else Else
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!")) BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))