Fixed Beat Up base power

This commit is contained in:
CaptainSegis 2016-10-30 21:54:03 -05:00
parent e76ffaab63
commit 8ed2ba478c

View File

@ -72,14 +72,30 @@
End Function End Function
Public Overrides Function GetBasePower(own As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetBasePower(own As Boolean, BattleScreen As BattleScreen) As Integer
Dim p As Pokemon = BattleScreen.OwnPokemon Dim avgTeamBaseAttack As Double = 0.0D
If own = False Then Dim pokemonCounter As Integer = 0
p = BattleScreen.OppPokemon If own 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 End If
Next
Return CInt(Math.Ceiling(p.Attack / 10)) + 5 Else
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
End If
If pokemonCounter <> 0 Then
avgTeamBaseAttack = avgTeamBaseAttack / pokemonCounter
Else
avgTeamBaseAttack = 10 'should never meet this case.
End If
Return CInt(avgTeamBaseAttack) + 5
End Function End Function
End Class End Class
End Namespace End Namespace