mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-22 21:35:07 +02:00
Fixed Beat Up base power
This commit is contained in:
parent
e76ffaab63
commit
8ed2ba478c
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user