Fix two turns: part 4. Also fixed confusion conditions for Outrage and similar moves. Attempt on fix "but there's no target" issue.

This commit is contained in:
CaptainSegis 2016-12-21 19:01:13 -05:00
parent 15ce4e002d
commit f4980e079b
16 changed files with 126 additions and 12 deletions

View File

@ -939,8 +939,8 @@
Dim bounce As Integer
Dim dig As Integer
Dim dive As Integer
Dim skyDrop As Integer
Dim shadowForce As Integer
Dim skyDrop As Integer 'not implemented yet
Dim shadowForce As Integer 'not implemented yet
Dim skullBash As Integer
Dim skyAttack As Integer
Dim solarBeam As Integer
@ -1243,6 +1243,7 @@
If p.HasVolatileStatus(Pokemon.VolatileStatus.Flinch) = True Then
p.RemoveVolatileStatus(Pokemon.VolatileStatus.Flinch)
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " flinched and couldn't move!"))
moveUsed.InflictedFlinch(own, BattleScreen)
If p.Ability.Name.ToLower() = "steadfast" Then
RaiseStat(own, Not own, BattleScreen, "Speed", 1, "", "steadfast")
End If
@ -1350,7 +1351,18 @@
End If
'If there's no opponent (opponent is fainted), skip to end of turn:
If moveUsed.Target <> Attack.Targets.Self And moveUsed.Target <> Attack.Targets.All Then
Dim NoTargetCheck As Boolean = True
If moveUsed.ProtectAffected = False Then
NoTargetCheck = False
Select Case moveUsed.Name.ToLower
Case "accupressure", "confide", "feint", "hold hands", "hyperspace fury", "hyperspace hole", "phantom force", "psych up", "play nice", "roar", "role play", "shadow force", "sketch", "transform", "whirlwind"
NoTargetCheck = True
End Select
End If
If IsChargingTurn(BattleScreen, own, moveUsed) Then
NoTargetCheck = False
End If
If NoTargetCheck = True Then
If op.HP <= 0 Or op.Status = Pokemon.StatusProblems.Fainted Then
BattleScreen.BattleQuery.Add(New TextQueryObject("But there was no target..."))
Exit Sub
@ -1392,7 +1404,7 @@
If moveUsed.ProtectAffected = False Then
UseTwoTurnCheck = False
Select Case moveUsed.Name.ToLower
Case "psych up", "play nice", "role play"
Case "accupressure", "confide", "feint", "hold hands", "hyperspace fury", "hyperspace hole", "phantom force", "psych up", "play nice", "roar", "role play", "shadow force", "sketch", "transform", "whirlwind"
UseTwoTurnCheck = True
End Select
End If

View File

@ -1709,6 +1709,15 @@
'DO NOTHING
End Sub
''' <summary>
''' Event that occurs when a flinch has been inflicted.
''' </summary>
''' <param name="Own">If the own Pokémon used the move.</param>
''' <param name="BattleScreen">Reference to the BattleScreen.</param>
Public Overridable Sub InflictedFlinch(ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
'DO NOTHING
End Sub
''' <summary>
''' Returns the attack stat of a Pokémon (Physical or Special).
''' </summary>

View File

@ -73,13 +73,25 @@
End Sub
Private Sub Interruption(ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
Dim outrage As Integer = 0
Dim p As Pokemon
If own = True Then
outrage = BattleScreen.FieldEffects.OwnOutrage
p = BattleScreen.OwnPokemon
Else
outrage = BattleScreen.FieldEffects.OppOutrage
p = BattleScreen.OppPokemon
End If
If outrage = 1 Then
BattleScreen.Battle.InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & "'s Outrage stopped.", "move:outrage")
End If
If own = True Then
BattleScreen.FieldEffects.OwnOutrage = 0
Else
BattleScreen.FieldEffects.OppOutrage = 0
End If
BattleScreen.Battle.InflictConfusion(own, own, BattleScreen, "", "move:outrage")
End Sub
Public Overrides Sub MoveHasNoEffect(own As Boolean, BattleScreen As BattleScreen)
@ -94,6 +106,9 @@
Interruption(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
Interruption(own, BattleScreen)
End Sub
End Class
End Namespace

View File

@ -161,6 +161,10 @@
MoveFails(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
MoveFails(own, BattleScreen)
End Sub
End Class
End Namespace

View File

@ -159,6 +159,10 @@
MoveFails(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
MoveFails(own, BattleScreen)
End Sub
End Class
End Namespace

View File

@ -162,6 +162,10 @@
MoveFails(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
MoveFails(own, BattleScreen)
End Sub
End Class
End Namespace

View File

@ -73,13 +73,25 @@
End Sub
Private Sub Interruption(ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
Dim petalDance As Integer = 0
Dim p As Pokemon
If own = True Then
petalDance = BattleScreen.FieldEffects.OwnPetalDance
p = BattleScreen.OwnPokemon
Else
petalDance = BattleScreen.FieldEffects.OppPetalDance
p = BattleScreen.OppPokemon
End If
If petalDance = 1 Then
BattleScreen.Battle.InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & "'s PetalDance stopped.", "move:petaldance")
End If
If own = True Then
BattleScreen.FieldEffects.OwnPetalDance = 0
Else
BattleScreen.FieldEffects.OppPetalDance = 0
End If
BattleScreen.Battle.InflictConfusion(own, own, BattleScreen, "", "move:petaldance")
End Sub
Public Overrides Sub MoveHasNoEffect(own As Boolean, BattleScreen As BattleScreen)
@ -94,6 +106,9 @@
Interruption(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
Interruption(own, BattleScreen)
End Sub
End Class
End Namespace

View File

@ -180,6 +180,10 @@
MoveFails(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
MoveFails(own, BattleScreen)
End Sub
End Class
End Namespace

View File

@ -163,6 +163,9 @@
MoveFails(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
MoveFails(own, BattleScreen)
End Sub
End Class

View File

@ -122,6 +122,10 @@
Interruption(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
Interruption(own, BattleScreen)
End Sub
End Class
End Namespace

View File

@ -161,6 +161,9 @@
MoveFails(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
MoveFails(own, BattleScreen)
End Sub
End Class
End Namespace

View File

@ -163,6 +163,9 @@
MoveFails(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
MoveFails(own, BattleScreen)
End Sub
End Class
End Namespace

View File

@ -73,13 +73,25 @@
End Sub
Private Sub Interruption(ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
Dim thrash As Integer = 0
Dim p As Pokemon
If own = True Then
thrash = BattleScreen.FieldEffects.OwnThrash
p = BattleScreen.OwnPokemon
Else
thrash = BattleScreen.FieldEffects.OppThrash
p = BattleScreen.OppPokemon
End If
If thrash = 1 Then
BattleScreen.Battle.InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & "'s Thrash stopped.", "move:thrash")
End If
If own = True Then
BattleScreen.FieldEffects.OwnThrash = 0
Else
BattleScreen.FieldEffects.OppThrash = 0
End If
BattleScreen.Battle.InflictConfusion(own, own, BattleScreen, "", "move:thrash")
End Sub
Public Overrides Sub MoveHasNoEffect(own As Boolean, BattleScreen As BattleScreen)
@ -94,6 +106,9 @@
Interruption(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
Interruption(own, BattleScreen)
End Sub
End Class
End Namespace

View File

@ -64,7 +64,7 @@
End If
End Sub
Private Sub StopMove(own As Boolean, BattleScreen As BattleScreen)
Private Sub Interruption(own As Boolean, BattleScreen As BattleScreen)
Dim p As Pokemon = BattleScreen.OwnPokemon
If own = False Then
p = BattleScreen.OppPokemon
@ -79,11 +79,23 @@
End Sub
Public Overrides Sub MoveHasNoEffect(own As Boolean, BattleScreen As BattleScreen)
Me.StopMove(own, BattleScreen)
Me.Interruption(own, BattleScreen)
End Sub
Public Overrides Sub MoveFailsSoundproof(own As Boolean, BattleScreen As BattleScreen)
Me.StopMove(own, BattleScreen)
Me.Interruption(own, BattleScreen)
End Sub
Public Overrides Sub MoveProtectedDetected(own As Boolean, BattleScreen As BattleScreen)
Interruption(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
Interruption(own, BattleScreen)
End Sub
Public Overrides Sub MoveMisses(own As Boolean, BattleScreen As BattleScreen)
Interruption(own, BattleScreen)
End Sub
End Class

View File

@ -122,6 +122,10 @@ Namespace BattleSystem.Moves.Rock
Interruption(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
Interruption(own, BattleScreen)
End Sub
End Class
End Namespace

View File

@ -165,6 +165,9 @@
MoveFails(own, BattleScreen)
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
MoveFails(own, BattleScreen)
End Sub
End Class
End Namespace