Fixed most moves interactions with Protect and Two turn moves. (fly, dive, etc.)

This commit is contained in:
CaptainSegis 2016-12-12 00:47:37 -05:00
parent 8c85cc8c37
commit 59170f5678
29 changed files with 70 additions and 29 deletions

View File

@ -1387,7 +1387,16 @@
DoesNotMiss = True
End If
If DoesNotMiss = True And moveUsed.Target <> Attack.Targets.Self Then 'Dig check
Dim UseTwoTurnCheck As Boolean = True
If moveUsed.ProtectAffected = False Then
UseTwoTurnCheck = False
Select Case moveUsed.Name.ToLower
Case "psych up", "play nice", "role play"
UseTwoTurnCheck = True
End Select
End If
If DoesNotMiss = True And UseTwoTurnCheck Then 'Dig check
Dim dig As Integer = BattleScreen.FieldEffects.OppDigCounter
If own = False Then
dig = BattleScreen.FieldEffects.OwnDigCounter
@ -1398,7 +1407,7 @@
End If
End If
If DoesNotMiss = True And moveUsed.Target <> Attack.Targets.Self Then 'Fly check
If DoesNotMiss = True And UseTwoTurnCheck Then 'Fly check
Dim fly As Integer = BattleScreen.FieldEffects.OppFlyCounter
If own = False Then
fly = BattleScreen.FieldEffects.OwnFlyCounter
@ -1409,7 +1418,7 @@
End If
End If
If DoesNotMiss = True And moveUsed.Target <> Attack.Targets.Self Then 'bounce check
If DoesNotMiss = True And UseTwoTurnCheck Then 'bounce check
Dim bounce As Integer = BattleScreen.FieldEffects.OppBounceCounter
If own = False Then
bounce = BattleScreen.FieldEffects.OwnBounceCounter
@ -1420,7 +1429,7 @@
End If
End If
If DoesNotMiss = True And moveUsed.Target <> Attack.Targets.Self Then 'dive check
If DoesNotMiss = True And UseTwoTurnCheck Then 'dive check
Dim dive As Integer = BattleScreen.FieldEffects.OppDiveCounter
If own = False Then
dive = BattleScreen.FieldEffects.OwnDiveCounter
@ -1431,7 +1440,7 @@
End If
End If
If DoesNotMiss = True And moveUsed.Target <> Attack.Targets.Self Then 'shadowforce check
If DoesNotMiss = True And UseTwoTurnCheck Then 'shadowforce check
Dim shadowforce As Integer = BattleScreen.FieldEffects.OppShadowForceCounter
If own = False Then
shadowforce = BattleScreen.FieldEffects.OwnShadowForceCounter
@ -1442,7 +1451,7 @@
End If
End If
If DoesNotMiss = True And moveUsed.Target <> Attack.Targets.Self Then 'sky drop check
If DoesNotMiss = True And UseTwoTurnCheck Then 'sky drop check
Dim skydrop As Integer = BattleScreen.FieldEffects.OppSkyDropCounter
If own = False Then
skydrop = BattleScreen.FieldEffects.OwnSkyDropCounter

View File

@ -668,6 +668,8 @@
Return {OppLeft, OppCenter, OppRight}.ToList()
Case Attack.Targets.OneAlly, Attack.Targets.AllAllies
Return {OwnCenter, OwnRight}.ToList()
Case Attack.Targets.AllOwn
Return {OwnCenter, OwnRight, OwnLeft}.ToList()
End Select
Case Targets.OwnCenter
Select Case AttackTarget
@ -677,6 +679,8 @@
Return {OppLeft, OppCenter, OppRight}.ToList()
Case Attack.Targets.OneAdjacentAlly, Attack.Targets.OneAlly, Attack.Targets.AllAdjacentAllies, Attack.Targets.AllAllies
Return {OwnLeft, OwnRight}.ToList()
Case Attack.Targets.AllOwn
Return {OwnCenter, OwnRight, OwnLeft}.ToList()
End Select
Case Targets.OwnRight
Select Case AttackTarget
@ -692,6 +696,8 @@
Return {OppLeft, OppCenter, OppRight}.ToList()
Case Attack.Targets.OneAlly, Attack.Targets.AllAllies
Return {OwnLeft, OwnCenter}.ToList()
Case Attack.Targets.AllOwn
Return {OwnCenter, OwnRight, OwnLeft}.ToList()
End Select
Case Targets.OppLeft
Select Case AttackTarget
@ -707,6 +713,8 @@
Return {OwnLeft, OwnCenter, OwnRight}.ToList()
Case Attack.Targets.OneAlly, Attack.Targets.AllAllies
Return {OppCenter, OppRight}.ToList()
Case Attack.Targets.AllOwn
Return {OppCenter, OppRight, OppLeft}.ToList()
End Select
Case Targets.OppCenter
Select Case AttackTarget
@ -716,6 +724,8 @@
Return {OwnLeft, OwnCenter, OwnRight}.ToList()
Case Attack.Targets.OneAdjacentAlly, Attack.Targets.OneAlly, Attack.Targets.AllAdjacentAllies, Attack.Targets.AllAllies
Return {OppLeft, OppRight}.ToList()
Case Attack.Targets.AllOwn
Return {OppCenter, OppRight, OppLeft}.ToList()
End Select
Case Targets.OppRight
Select Case AttackTarget
@ -731,6 +741,8 @@
Return {OwnLeft, OwnCenter, OwnRight}.ToList()
Case Attack.Targets.OneAlly, Attack.Targets.AllAllies
Return {OppLeft, OppCenter}.ToList()
Case Attack.Targets.AllOwn
Return {OppCenter, OppRight, OppLeft}.ToList()
End Select
End Select

View File

@ -46,6 +46,8 @@
AllAllies 'All allies, excluding itself.
All 'All Pokémon, including itself
AllOwn 'All allies, including itself.
End Enum
Public Enum AIField

View File

@ -11,7 +11,7 @@
Me.OriginalPP = 5
Me.CurrentPP = 5
Me.MaxPP = 5
Me.Power = 120
Me.Power = 100
Me.Accuracy = 50
Me.Category = Categories.Special
Me.ContestCategory = ContestCategories.Cool

View File

@ -44,7 +44,7 @@ Namespace BattleSystem.Moves.Fairy
Me.IsPunchingMove = False
Me.IsDamagingMove = True
Me.IsProtectMove = False
Me.IsSoundMove = False
Me.IsSoundMove = True
Me.IsAffectedBySubstitute = True
Me.IsOneHitKOMove = False

View File

@ -26,7 +26,7 @@ Namespace BattleSystem.Moves.Fighting
'#SpecialDefinitions
Me.MakesContact = False
Me.ProtectAffected = True
Me.ProtectAffected = False
Me.MagicCoatAffected = True
Me.SnatchAffected = False
Me.MirrorMoveAffected = True

View File

@ -26,7 +26,7 @@
'#SpecialDefinitions
Me.MakesContact = False
Me.ProtectAffected = False
Me.ProtectAffected = True
Me.MagicCoatAffected = True
Me.SnatchAffected = True
Me.MirrorMoveAffected = True

View File

@ -19,7 +19,7 @@ Namespace BattleSystem.Moves.Flying
Me.Description = "The user whips up a turbulent whirlwind that ups the Speed stat of the user and its allies for four turns."
Me.CriticalChance = 1
Me.IsHMMove = False
Me.Target = Targets.AllAllies
Me.Target = Targets.AllOwn
Me.Priority = 0
Me.TimesToAttack = 1
'#End

View File

@ -19,7 +19,7 @@
Me.Description = "The user releases a soothing scent that heals all status conditions affecting the user's party."
Me.CriticalChance = 0
Me.IsHMMove = False
Me.Target = Targets.AllAllies
Me.Target = Targets.AllOwn
Me.Priority = 0
Me.TimesToAttack = 1
'#End

View File

@ -19,7 +19,7 @@
Me.Description = "The user cloaks its body with a white mist that prevents any of its stats from being cut for five turns."
Me.CriticalChance = 0
Me.IsHMMove = False
Me.Target = Targets.AllAllies
Me.Target = Targets.AllOwn
Me.Priority = 0
Me.TimesToAttack = 1
'#End

View File

@ -19,7 +19,7 @@
Me.Description = "The user makes a soothing bell chime to heal the status problems of all the party Pokémon."
Me.CriticalChance = 0
Me.IsHMMove = False
Me.Target = Targets.AllAllies
Me.Target = Targets.AllOwn
Me.Priority = 0
Me.TimesToAttack = 1
'#End

View File

@ -26,7 +26,7 @@
'#SpecialDefinitions
Me.MakesContact = False
Me.ProtectAffected = False
Me.ProtectAffected = True
Me.MagicCoatAffected = False
Me.SnatchAffected = False
Me.MirrorMoveAffected = True

View File

@ -26,7 +26,7 @@
'#SpecialDefinitions
Me.MakesContact = False
Me.ProtectAffected = False
Me.ProtectAffected = True
Me.MagicCoatAffected = True
Me.SnatchAffected = False
Me.MirrorMoveAffected = True

View File

@ -19,7 +19,7 @@
Me.Description = "The user creates a protective field that prevents status problems for five turns."
Me.CriticalChance = 0
Me.IsHMMove = False
Me.Target = Targets.AllAllies
Me.Target = Targets.AllOwn
Me.Priority = 0
Me.TimesToAttack = 1
'#End

View File

@ -19,7 +19,7 @@
Me.Description = "The user attacks everything around it by causing an explosion. The user faints upon using this move."
Me.CriticalChance = 1
Me.IsHMMove = False
Me.Target = Targets.OneAdjacentTarget
Me.Target = Targets.AllTargets
Me.Priority = 0
Me.TimesToAttack = 1
'#End

View File

@ -19,7 +19,7 @@
Me.Description = "The user breaks its shell, lowering its Defense and Sp. Def stats but sharply raising Attack, Sp. Atk, and Speed stats."
Me.CriticalChance = 1
Me.IsHMMove = False
Me.Target = Targets.OneAdjacentTarget
Me.Target = Targets.Self
Me.Priority = 0
Me.TimesToAttack = 1
'#End

View File

@ -26,7 +26,7 @@
'#SpecialDefinitions
Me.MakesContact = False
Me.ProtectAffected = False
Me.ProtectAffected = True
Me.MagicCoatAffected = True
Me.SnatchAffected = False
Me.MirrorMoveAffected = True

View File

@ -26,7 +26,7 @@ Namespace BattleSystem.Moves.Psychic
'#SpecialDefinitions
Me.MakesContact = False
Me.ProtectAffected = True
Me.ProtectAffected = False
Me.MagicCoatAffected = True
Me.SnatchAffected = False
Me.MirrorMoveAffected = True

View File

@ -19,14 +19,14 @@
Me.Description = "For five turns, the user prevents the opposing team from using any moves, Abilities, or held items that recover HP."
Me.CriticalChance = 0
Me.IsHMMove = False
Me.Target = Targets.OneFoe
Me.Target = Targets.AllFoes
Me.Priority = 0
Me.TimesToAttack = 1
'#End
'#SpecialDefinitions
Me.MakesContact = False
Me.ProtectAffected = True
Me.ProtectAffected = False
Me.MagicCoatAffected = True
Me.SnatchAffected = False
Me.MirrorMoveAffected = True

View File

@ -19,7 +19,7 @@ Namespace BattleSystem.Moves.Psychic
Me.Description = "A wondrous wall of light is put up to suppress damage from special attacks for five turns."
Me.CriticalChance = 0
Me.IsHMMove = False
Me.Target = Targets.Self
Me.Target = Targets.AllOwn
Me.Priority = 0
Me.TimesToAttack = 1
'#End

View File

@ -19,7 +19,7 @@ Namespace BattleSystem.Moves.Psychic
Me.Description = "A wondrous wall is put up to suppress damage from physical attacks for five turns."
Me.CriticalChance = 0
Me.IsHMMove = False
Me.Target = Targets.Self
Me.Target = Targets.AllOwn
Me.Priority = 0
Me.TimesToAttack = 1
'#End

View File

@ -26,7 +26,7 @@
'#SpecialDefinitions
Me.MakesContact = False
Me.ProtectAffected = False
Me.ProtectAffected = True
Me.MagicCoatAffected = False
Me.SnatchAffected = False
Me.MirrorMoveAffected = True
@ -56,7 +56,25 @@
End Sub
Public Overrides Function MoveFailBeforeAttack(Own As Boolean, BattleScreen As BattleScreen) As Boolean
Return Not BattleScreen.FieldEffects.MovesFirst(Own)
If BattleScreen.FieldEffects.MovesFirst(Own) Then
Return True
End If
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 Or lastMove.Category = Categories.Physical Then
Return False
End If
End If
End If
Return True
End Function
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer

View File

@ -19,7 +19,7 @@
Me.Description = "Diving on the first turn, the user floats up and attacks on the next turn."
Me.CriticalChance = 1
Me.IsHMMove = False
Me.Target = Targets.AllAdjacentTargets
Me.Target = Targets.OneAdjacentTarget
Me.Priority = 0
Me.TimesToAttack = 1
'#End

View File

@ -19,7 +19,7 @@
Me.Description = "The user attacks by shooting muddy water at the opposing team. It may also lower the targets' accuracy."
Me.CriticalChance = 1
Me.IsHMMove = False
Me.Target = Targets.OneAdjacentTarget
Me.Target = Targets.AllAdjacentFoes
Me.Priority = 0
Me.TimesToAttack = 1
'#End