Fix Beat Up no damage for wild Pokémon

This commit is contained in:
JappaWakka 2024-03-28 18:58:01 +01:00
parent 67f4a63273
commit 38acb8955b
1 changed files with 10 additions and 6 deletions

View File

@ -53,41 +53,45 @@
End Sub
Public Overrides Function GetTimesToAttack(own As Boolean, BattleScreen As BattleScreen) As Integer
Dim i As Integer = 1
Dim i As Integer = 0
If own = True Then
For Each p As Pokemon In Core.Player.Pokemons
If p.Status = Pokemon.StatusProblems.None Then
If p.Status <> Pokemon.StatusProblems.Fainted Then
i += 1
End If
Next
ElseIf BattleScreen.IsTrainerBattle = True Then
For Each p As Pokemon In BattleScreen.Trainer.Pokemons
If p.Status = Pokemon.StatusProblems.None Then
If p.Status <> Pokemon.StatusProblems.Fainted Then
i += 1
End If
Next
Else
i += 1
End If
i = i-1
Return i
End Function
Public Overrides Function GetBasePower(own As Boolean, BattleScreen As BattleScreen) As Integer
Dim avgTeamBaseAttack As Double = 0.0D
Dim pokemonCounter As Integer = 0
If own Then
If own = True Then
For Each pokemon As Pokemon In Core.Player.Pokemons
If (Not pokemon.IsEgg) AndAlso pokemon.Status <> Pokemon.StatusProblems.Fainted And pokemon.HP > 0 Then
avgTeamBaseAttack += (pokemon.BaseAttack / 10)
pokemonCounter += 1
End If
Next
Else
ElseIf BattleScreen.IsTrainerBattle = True Then
For Each pokemon As Pokemon In BattleScreen.Trainer.Pokemons
If (Not pokemon.IsEgg) AndAlso pokemon.Status <> Pokemon.StatusProblems.Fainted And pokemon.HP > 0 Then
avgTeamBaseAttack += (pokemon.BaseAttack / 10)
pokemonCounter += 1
End If
Next
Else
avgTeamBaseAttack += (BattleScreen.OppPokemon.BaseAttack / 10)
pokemonCounter = 1
End If
If pokemonCounter <> 0 Then
avgTeamBaseAttack = avgTeamBaseAttack / pokemonCounter