Fixed Parental Bond implementation

This commit is contained in:
CaptainSegis 2018-03-25 18:22:55 -05:00
parent 01acc00a5b
commit 096fc52ec8
12 changed files with 31 additions and 37 deletions

View File

@ -1717,7 +1717,9 @@
"sky attack", "sky attack",
"sky drop", "sky drop",
"solar beam", "solar beam",
"solar blade" "solar blade",
"bide",
"struggle"
} }
If Not moveList.Contains(moveUsed.Name.ToLower) Then If Not moveList.Contains(moveUsed.Name.ToLower) Then
useParentalBond = True useParentalBond = True
@ -1896,7 +1898,7 @@
If effectiveness <> 0 Then If effectiveness <> 0 Then
Dim canUseEffect As Boolean = True Dim canUseEffect As Boolean = True
Dim canUseRecharge As Boolean = True Dim multiUseEffect As Boolean = True
If op.Ability.Name.ToLower() = "shield dust" AndAlso moveUsed.HasSecondaryEffect = True Then If op.Ability.Name.ToLower() = "shield dust" AndAlso moveUsed.HasSecondaryEffect = True Then
If BattleScreen.FieldEffects.CanUseAbility(Not own, BattleScreen) = True Then If BattleScreen.FieldEffects.CanUseAbility(Not own, BattleScreen) = True Then
@ -1909,38 +1911,24 @@
'Moves that only use secondary effects on the second turn of parental bond 'Moves that only use secondary effects on the second turn of parental bond
If p.Ability IsNot Nothing AndAlso p.Ability.Name.ToLower = "parental bond" AndAlso i <> TimesToAttack Then If useParentalBond Then
Dim PBmoveList As String() = {"secret power", Dim PBmoveList As String() = {"secret power",
"struggle",
"circle throw",
"dragon tail",
"bug bite", "bug bite",
"pluck", "pluck",
"u-turn",
"volt switch",
"smelling salt", "smelling salt",
"wake-up slap", "wake-up slap",
"knock off", "knock off",
"relic song", "relic song",
"outrage", "circle throw",
"thrash", "dragon tail"
"petal dance",
"hyper beam",
"giga impact",
"blast burn",
"frenzy plant",
"hydro cannon",
"roar of time",
"rock wrecker"
} }
If PBmoveList.Contains(moveUsed.Name.ToLower) Then If PBmoveList.Contains(moveUsed.Name.ToLower) Then
canUseEffect = False multiUseEffect = False
canUseRecharge = False
End If End If
End If End If
If canUseEffect = True Then If canUseEffect AndAlso multiUseEffect OrElse (multiUseEffect = False AndAlso i = TimesToAttack) Then
If substitute = 0 OrElse moveUsed.IsAffectedBySubstitute = False Then If substitute = 0 OrElse moveUsed.IsAffectedBySubstitute = False Then
moveUsed.MoveHits(own, BattleScreen) moveUsed.MoveHits(own, BattleScreen)
End If End If
@ -1957,11 +1945,6 @@
moveUsed.MoveRecoil(own, BattleScreen) moveUsed.MoveRecoil(own, BattleScreen)
If canUseRecharge Then
moveUsed.MoveRecharge(own, BattleScreen)
End If
If op.HP > 0 Then If op.HP > 0 Then
If own = True Then If own = True Then
If BattleScreen.FieldEffects.OppRageCounter > 0 Then If BattleScreen.FieldEffects.OppRageCounter > 0 Then
@ -2220,6 +2203,12 @@
End If End If
Next Next
If p.HP > 0 AndAlso p.Status <> Pokemon.StatusProblems.Fainted AndAlso effectiveness <> 0.0F Then
moveUsed.MoveMultiTurn(own, BattleScreen)
moveUsed.MoveRecharge(own, BattleScreen)
moveUsed.MoveSwitch(own, BattleScreen)
End If
If (Hits > 1 Or TimesToAttack > 1) And effectiveness <> 0.0F Then If (Hits > 1 Or TimesToAttack > 1) And effectiveness <> 0.0F Then
BattleScreen.BattleQuery.Add(New TextQueryObject("Hit " & Hits & " times!")) BattleScreen.BattleQuery.Add(New TextQueryObject("Hit " & Hits & " times!"))
End If End If
@ -2255,7 +2244,7 @@
End Select End Select
End If End If
End If End If
Else Else 'If not damaging move
Dim lastMove As Attack = BattleScreen.FieldEffects.OppLastMove Dim lastMove As Attack = BattleScreen.FieldEffects.OppLastMove
If own = False Then If own = False Then
lastMove = BattleScreen.FieldEffects.OwnLastMove lastMove = BattleScreen.FieldEffects.OwnLastMove

View File

@ -1590,11 +1590,15 @@
End Sub End Sub
Public Overridable Sub MoveRecharge(ByVal own As Boolean, ByVal BattleScreen As BattleScreen) Public Overridable Sub MoveRecharge(ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
'DO NOTHING HERE (will do recoil if moves overrides it) 'DO NOTHING HERE (will do a one turn recharge if moves overrides it)
End Sub
Public Overridable Sub MoveMultiTurn(ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
'DO NOTHING HERE (will do the multi turn countdown if moves overrides it)
End Sub End Sub
Public Overridable Sub MoveSwitch(ByVal own As Boolean, ByVal BattleScreen As BattleScreen) Public Overridable Sub MoveSwitch(ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
'DO NOTHING HERE (will do recoil if moves overrides it) 'DO NOTHING HERE (will force user switching if moves overrides it)
End Sub End Sub
''' <summary> ''' <summary>

View File

@ -52,7 +52,7 @@
'#End '#End
End Sub End Sub
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) Public Overrides Sub MoveSwitch(own As Boolean, BattleScreen As BattleScreen)
If own = True Then If own = True Then
If Core.Player.CountFightablePokemon > 1 Then If Core.Player.CountFightablePokemon > 1 Then
BattleScreen.Battle.SwitchOutOwn(BattleScreen, GetPokemonIndex(BattleScreen, own), -1) BattleScreen.Battle.SwitchOutOwn(BattleScreen, GetPokemonIndex(BattleScreen, own), -1)

View File

@ -56,7 +56,7 @@
Me.AIField3 = AIField.ConfuseOwn Me.AIField3 = AIField.ConfuseOwn
End Sub End Sub
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) Public Overrides Sub MoveMultiTurn(own As Boolean, BattleScreen As BattleScreen)
Dim currentTurns As Integer = BattleScreen.FieldEffects.OwnOutrage Dim currentTurns As Integer = BattleScreen.FieldEffects.OwnOutrage
If own = False Then If own = False Then
currentTurns = BattleScreen.FieldEffects.OppOutrage currentTurns = BattleScreen.FieldEffects.OppOutrage

View File

@ -52,7 +52,7 @@ Namespace BattleSystem.Moves.Electric
'#End '#End
End Sub End Sub
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) Public Overrides Sub MoveSwitch(own As Boolean, BattleScreen As BattleScreen)
If own = True Then If own = True Then
If Core.Player.CountFightablePokemon > 1 Then If Core.Player.CountFightablePokemon > 1 Then
BattleScreen.Battle.SwitchOutOwn(BattleScreen, GetPokemonIndex(BattleScreen, own), -1) BattleScreen.Battle.SwitchOutOwn(BattleScreen, GetPokemonIndex(BattleScreen, own), -1)

View File

@ -56,7 +56,7 @@
Me.AIField3 = AIField.ConfuseOwn Me.AIField3 = AIField.ConfuseOwn
End Sub End Sub
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) Public Overrides Sub MoveMultiTurn(own As Boolean, BattleScreen As BattleScreen)
Dim currentTurns As Integer = BattleScreen.FieldEffects.OwnPetalDance Dim currentTurns As Integer = BattleScreen.FieldEffects.OwnPetalDance
If own = False Then If own = False Then
currentTurns = BattleScreen.FieldEffects.OppPetalDance currentTurns = BattleScreen.FieldEffects.OppPetalDance

View File

@ -81,7 +81,7 @@
Return p Return p
End Function End Function
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) Public Overrides Sub MoveMultiTurn(own As Boolean, BattleScreen As BattleScreen)
Dim iceball As Integer = BattleScreen.FieldEffects.OwnIceBallCounter Dim iceball As Integer = BattleScreen.FieldEffects.OwnIceBallCounter
If own = False Then If own = False Then
iceball = BattleScreen.FieldEffects.OppIceBallCounter iceball = BattleScreen.FieldEffects.OppIceBallCounter

View File

@ -56,7 +56,7 @@
Me.AIField2 = AIField.ConfuseOwn Me.AIField2 = AIField.ConfuseOwn
End Sub End Sub
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) Public Overrides Sub MoveMultiTurn(own As Boolean, BattleScreen As BattleScreen)
Dim currentTurns As Integer = BattleScreen.FieldEffects.OwnThrash Dim currentTurns As Integer = BattleScreen.FieldEffects.OwnThrash
If own = False Then If own = False Then
currentTurns = BattleScreen.FieldEffects.OppThrash currentTurns = BattleScreen.FieldEffects.OppThrash

View File

@ -52,7 +52,7 @@
'#End '#End
End Sub End Sub
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) Public Overrides Sub MoveMultiTurn(own As Boolean, BattleScreen As BattleScreen)
If own = True Then If own = True Then
If BattleScreen.FieldEffects.OwnUproar = 0 Then If BattleScreen.FieldEffects.OwnUproar = 0 Then
BattleScreen.FieldEffects.OwnUproar = 3 BattleScreen.FieldEffects.OwnUproar = 3

View File

@ -81,7 +81,7 @@ Namespace BattleSystem.Moves.Rock
Return p Return p
End Function End Function
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) Public Overrides Sub MoveMultiTurn(own As Boolean, BattleScreen As BattleScreen)
Dim rollout As Integer = BattleScreen.FieldEffects.OwnRolloutCounter Dim rollout As Integer = BattleScreen.FieldEffects.OwnRolloutCounter
If own = False Then If own = False Then
rollout = BattleScreen.FieldEffects.OppRolloutCounter rollout = BattleScreen.FieldEffects.OppRolloutCounter

View File

@ -1030,6 +1030,7 @@ Public Class Pokemon
Public Sub LoadAltAbility() Public Sub LoadAltAbility()
NormalAbility = OriginalAbility NormalAbility = OriginalAbility
Me.Ability = NewAbilities(0) Me.Ability = NewAbilities(0)
SetOriginalAbility()
End Sub End Sub
Public Sub RestoreAbility() Public Sub RestoreAbility()
Me.Ability = NormalAbility Me.Ability = NormalAbility

Binary file not shown.