Fix Counter & Mirror Coat

This commit is contained in:
JappaWakka 2024-04-27 17:01:56 +02:00
parent d5d291bdda
commit 4717d097e7
2 changed files with 38 additions and 13 deletions

View File

@ -53,12 +53,20 @@
End Sub
Public Overrides Function MoveFailBeforeAttack(Own As Boolean, BattleScreen As BattleScreen) As Boolean
Dim damagedLastTurn As Boolean = BattleScreen.FieldEffects.OppPokemonDamagedLastTurn
If Own = False Then
damagedLastTurn = BattleScreen.FieldEffects.OwnPokemonDamagedThisTurn
Dim hasBeenDamaged As Boolean = BattleScreen.FieldEffects.OppPokemonDamagedLastTurn
If Own = True Then
hasBeenDamaged = BattleScreen.FieldEffects.OwnPokemonDamagedLastTurn
End If
If damagedLastTurn = True Then
If BattleScreen.FieldEffects.OppTurnCounts = 0 OrElse BattleScreen.FieldEffects.OwnTurnCounts = 0 Then
If Own = False Then
hasBeenDamaged = BattleScreen.FieldEffects.OppPokemonDamagedThisTurn
Else
hasBeenDamaged = BattleScreen.FieldEffects.OwnPokemonDamagedThisTurn
End If
End If
If hasBeenDamaged = True Then
Dim damage As Integer = BattleScreen.FieldEffects.OwnLastDamage
If Own = True Then
damage = BattleScreen.FieldEffects.OppLastDamage
@ -77,6 +85,7 @@
End If
End If
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Return True
End Function

View File

@ -56,23 +56,39 @@
End Sub
Public Overrides Function MoveFailBeforeAttack(Own As Boolean, BattleScreen As BattleScreen) As Boolean
Dim damage As Integer = BattleScreen.FieldEffects.OwnLastDamage
Dim hasBeenDamaged As Boolean = BattleScreen.FieldEffects.OppPokemonDamagedLastTurn
If Own = True Then
damage = BattleScreen.FieldEffects.OppLastDamage
hasBeenDamaged = BattleScreen.FieldEffects.OwnPokemonDamagedLastTurn
End If
If damage > 0 Then
Dim lastMove As Attack = BattleScreen.FieldEffects.OwnLastMove
If Own = True Then
lastMove = BattleScreen.FieldEffects.OppLastMove
If BattleScreen.FieldEffects.OppTurnCounts = 0 OrElse BattleScreen.FieldEffects.OwnTurnCounts = 0 Then
If Own = False Then
hasBeenDamaged = BattleScreen.FieldEffects.OppPokemonDamagedThisTurn
Else
hasBeenDamaged = BattleScreen.FieldEffects.OwnPokemonDamagedThisTurn
End If
If Not lastMove Is Nothing Then
If lastMove.Category = Categories.Special Then
Return False
End If
If hasBeenDamaged = True Then
Dim damage As Integer = BattleScreen.FieldEffects.OwnLastDamage
If Own = True Then
damage = BattleScreen.FieldEffects.OppLastDamage
End If
If damage > 0 Then
Dim lastMove As Attack = BattleScreen.FieldEffects.OwnLastMove
If Own = True Then
lastMove = BattleScreen.FieldEffects.OppLastMove
End If
If Not lastMove Is Nothing Then
If lastMove.Category = Categories.Special Then
Return False
End If
End If
End If
End If
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Return True
End Function