From 38acb8955b330b8978216ed2fd7cb9322500c9ae Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Thu, 28 Mar 2024 18:58:01 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20Beat=20Up=20no=20damage=20for=20wild=20Po?= =?UTF-8?q?k=C3=A9mon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- P3D/Pokemon/Attacks/Dark/BeatUp.vb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/P3D/Pokemon/Attacks/Dark/BeatUp.vb b/P3D/Pokemon/Attacks/Dark/BeatUp.vb index ba3e6c696..6620eff27 100644 --- a/P3D/Pokemon/Attacks/Dark/BeatUp.vb +++ b/P3D/Pokemon/Attacks/Dark/BeatUp.vb @@ -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