Fix Infinite PP for opponents

This commit is contained in:
JappaWakka 2023-03-23 12:06:17 +01:00
parent 734ab3f4e9
commit b2f6c98f8e
2 changed files with 14 additions and 5 deletions

View File

@ -428,7 +428,7 @@
Dim OppAttackChoice As Integer = Core.Random.Next(0, AvailableAttacks.Count) Dim OppAttackChoice As Integer = Core.Random.Next(0, AvailableAttacks.Count)
Dim Ready As Boolean = False Dim Ready As Boolean = False
While Ready = False While Ready = False
If BattleScreen.OppPokemon.Attacks(OppAttackChoice).Disabled > 0 OrElse BattleScreen.FieldEffects.OppTaunt > 0 AndAlso BattleScreen.OppPokemon.Attacks(OppAttackChoice).Category = Attack.Categories.Status Then If BattleScreen.OppPokemon.Attacks(OppAttackChoice).Disabled > 0 OrElse BattleScreen.FieldEffects.OppTaunt > 0 AndAlso BattleScreen.OppPokemon.Attacks(OppAttackChoice).Category = Attack.Categories.Status Or BattleScreen.OppPokemon.Attacks(OppAttackChoice).CurrentPP <= 0 Then
AvailableAttacks.Remove(OppAttackChoice) AvailableAttacks.Remove(OppAttackChoice)
If AvailableAttacks.Count > 0 Then If AvailableAttacks.Count > 0 Then
OppAttackChoice = AvailableAttacks(Core.Random.Next(0, AvailableAttacks.Count)) OppAttackChoice = AvailableAttacks(Core.Random.Next(0, AvailableAttacks.Count))

View File

@ -53,13 +53,22 @@
Me.UseAccEvasion = False Me.UseAccEvasion = False
'#End '#End
End Sub End Sub
Public Overrides Function DeductPP(ByVal own As Boolean, ByVal BattleScreen As BattleScreen) As Boolean
Return False
End Function
Public Overrides Sub MoveSelected(own As Boolean, BattleScreen As BattleScreen) Public Overrides Sub MoveSelected(own As Boolean, BattleScreen As BattleScreen)
Dim p As Pokemon = BattleScreen.OwnPokemon Dim p As Pokemon = BattleScreen.OwnPokemon
If own = False Then If own = True Then
p = BattleScreen.OppPokemon BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " has no usable attacks left!"))
End If
End Sub
Public Overrides Sub PreAttack(own As Boolean, BattleScreen As BattleScreen)
Dim p As Pokemon = BattleScreen.OppPokemon
If own = False Then
BattleScreen.Battle.ChangeCameraAngle(1, False, BattleScreen)
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " has no usable attacks left!"))
End If End If
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " has no usable attacks left!"))
End Sub End Sub
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen)