mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-23 22:05:36 +02:00
After Fainting Switch, Revision 1
This commit is contained in:
parent
a328c279b0
commit
d22d1fd5d8
@ -229,110 +229,117 @@
|
|||||||
Return BattleCalculation.SafariRound(BattleScreen)
|
Return BattleCalculation.SafariRound(BattleScreen)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If BattleScreen.FieldEffects.OppRecharge > 0 Then
|
'Own after fainting switching in non remote battles.
|
||||||
SelectedMoveOpp = False
|
If (Not BattleScreen.IsRemoteBattle) AndAlso BattleScreen.OwnFaint Then
|
||||||
BattleScreen.FieldEffects.OppRecharge -= 1
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Text, .Argument = "You have sent your next Pokemon!"}
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Text, .Argument = BattleScreen.OppPokemon.GetDisplayName() & " needs to recharge!"}
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Rollout
|
If Not BattleScreen.IsAfterFaint Then
|
||||||
If BattleScreen.FieldEffects.OppRolloutCounter > 0 Then
|
If BattleScreen.FieldEffects.OppRecharge > 0 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 205)}
|
BattleScreen.FieldEffects.OppRecharge -= 1
|
||||||
End If
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Text, .Argument = BattleScreen.OppPokemon.GetDisplayName() & " needs to recharge!"}
|
||||||
|
End If
|
||||||
|
|
||||||
'IceBall
|
'Rollout
|
||||||
If BattleScreen.FieldEffects.OppIceBallCounter > 0 Then
|
If BattleScreen.FieldEffects.OppRolloutCounter > 0 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 301)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 205)}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Fly:
|
'IceBall
|
||||||
If BattleScreen.FieldEffects.OppFlyCounter >= 1 Then
|
If BattleScreen.FieldEffects.OppIceBallCounter > 0 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 19)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 301)}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Dig:
|
'Fly:
|
||||||
If BattleScreen.FieldEffects.OppDigCounter >= 1 Then
|
If BattleScreen.FieldEffects.OppFlyCounter >= 1 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 91)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 19)}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Outrage:
|
'Dig:
|
||||||
If BattleScreen.FieldEffects.OppOutrage >= 1 Then
|
If BattleScreen.FieldEffects.OppDigCounter >= 1 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 200)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 91)}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Thrash:
|
'Outrage:
|
||||||
If BattleScreen.FieldEffects.OppThrash >= 1 Then
|
If BattleScreen.FieldEffects.OppOutrage >= 1 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 37)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 200)}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Petal Dance:
|
'Thrash:
|
||||||
If BattleScreen.FieldEffects.OppPetalDance >= 1 Then
|
If BattleScreen.FieldEffects.OppThrash >= 1 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 80)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 37)}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Bounce:
|
'Petal Dance:
|
||||||
If BattleScreen.FieldEffects.OppBounceCounter >= 1 Then
|
If BattleScreen.FieldEffects.OppPetalDance >= 1 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 340)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 80)}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Dive:
|
'Bounce:
|
||||||
If BattleScreen.FieldEffects.OppDiveCounter = 1 Then
|
If BattleScreen.FieldEffects.OppBounceCounter >= 1 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 291)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 340)}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
''Shadow Force:
|
'Dive:
|
||||||
'If BattleScreen.FieldEffects.OppShadowForceCounter = 1 Then
|
If BattleScreen.FieldEffects.OppDiveCounter = 1 Then
|
||||||
' Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = (19).ToString()}
|
SelectedMoveOpp = False
|
||||||
'End If
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 291)}
|
||||||
|
End If
|
||||||
|
|
||||||
''Sky Drop:
|
''Shadow Force:
|
||||||
'If BattleScreen.FieldEffects.OppSkyDropCounter = 1 Then
|
'If BattleScreen.FieldEffects.OppShadowForceCounter = 1 Then
|
||||||
' Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = (19).ToString()}
|
' Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = (19).ToString()}
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
'Solar Beam:
|
''Sky Drop:
|
||||||
If BattleScreen.FieldEffects.OppSolarBeam >= 1 Then
|
'If BattleScreen.FieldEffects.OppSkyDropCounter = 1 Then
|
||||||
SelectedMoveOpp = False
|
' Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = (19).ToString()}
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 76)}
|
'End If
|
||||||
End If
|
|
||||||
|
|
||||||
'Sky Attack:
|
'Solar Beam:
|
||||||
If BattleScreen.FieldEffects.OppSkyAttackCounter >= 1 Then
|
If BattleScreen.FieldEffects.OppSolarBeam >= 1 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 143)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 76)}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Skull Bash:
|
'Sky Attack:
|
||||||
If BattleScreen.FieldEffects.OppSkullBashCounter >= 1 Then
|
If BattleScreen.FieldEffects.OppSkyAttackCounter >= 1 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 130)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 143)}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'RazorWind:
|
'Skull Bash:
|
||||||
If BattleScreen.FieldEffects.OppRazorWindCounter >= 1 Then
|
If BattleScreen.FieldEffects.OppSkullBashCounter >= 1 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 13)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 130)}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Uproar:
|
'RazorWind:
|
||||||
If BattleScreen.FieldEffects.OppUproar >= 1 Then
|
If BattleScreen.FieldEffects.OppRazorWindCounter >= 1 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 253)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 13)}
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Bide:
|
'Uproar:
|
||||||
If BattleScreen.FieldEffects.OppBideCounter > 0 Then
|
If BattleScreen.FieldEffects.OppUproar >= 1 Then
|
||||||
SelectedMoveOpp = False
|
SelectedMoveOpp = False
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 117)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 253)}
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Bide:
|
||||||
|
If BattleScreen.FieldEffects.OppBideCounter > 0 Then
|
||||||
|
SelectedMoveOpp = False
|
||||||
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 117)}
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'PVP action:
|
'PVP action:
|
||||||
@ -355,7 +362,6 @@
|
|||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Text, .Argument = text}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Text, .Argument = text}
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'AI move here:
|
'AI move here:
|
||||||
If BattleScreen.IsTrainerBattle AndAlso Not BattleScreen.IsRemoteBattle Then
|
If BattleScreen.IsTrainerBattle AndAlso Not BattleScreen.IsRemoteBattle Then
|
||||||
Return TrainerAI.GetAIMove(BattleScreen, OwnStep)
|
Return TrainerAI.GetAIMove(BattleScreen, OwnStep)
|
||||||
@ -457,11 +463,16 @@
|
|||||||
|
|
||||||
|
|
||||||
Public Sub InitializeRound(ByVal BattleScreen As BattleScreen, ByVal OwnStep As RoundConst)
|
Public Sub InitializeRound(ByVal BattleScreen As BattleScreen, ByVal OwnStep As RoundConst)
|
||||||
|
If BattleScreen.OwnFaint OrElse BattleScreen.OppFaint Then
|
||||||
|
BattleScreen.IsAfterFaint = True
|
||||||
|
End If
|
||||||
If BattleHasEnded(BattleScreen) Then
|
If BattleHasEnded(BattleScreen) Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim OppStep As RoundConst = GetOppStep(BattleScreen, OwnStep)
|
Dim OppStep As RoundConst = GetOppStep(BattleScreen, OwnStep)
|
||||||
|
BattleScreen.OwnFaint = False '''
|
||||||
|
BattleScreen.OppFaint = False '''
|
||||||
If OwnStep.StepType = RoundConst.StepTypes.Move Then
|
If OwnStep.StepType = RoundConst.StepTypes.Move Then
|
||||||
OwnStep = GetAttack(BattleScreen, True, CType(OwnStep.Argument, Attack))
|
OwnStep = GetAttack(BattleScreen, True, CType(OwnStep.Argument, Attack))
|
||||||
Else
|
Else
|
||||||
@ -3978,96 +3989,98 @@
|
|||||||
EndRoundOpp(BattleScreen)
|
EndRoundOpp(BattleScreen)
|
||||||
EndRoundOwn(BattleScreen)
|
EndRoundOwn(BattleScreen)
|
||||||
End If
|
End If
|
||||||
.FieldEffects.Rounds += 1
|
If BattleScreen.IsAfterFaint = False Then
|
||||||
If .FieldEffects.WeatherRounds > 0 Then
|
.FieldEffects.Rounds += 1
|
||||||
.FieldEffects.WeatherRounds -= 1
|
If .FieldEffects.WeatherRounds > 0 Then
|
||||||
If .FieldEffects.WeatherRounds = 0 Then
|
.FieldEffects.WeatherRounds -= 1
|
||||||
.FieldEffects.Weather = BattleWeather.WeatherTypes.Clear
|
If .FieldEffects.WeatherRounds = 0 Then
|
||||||
.BattleQuery.Add(New TextQueryObject("The weather became clear again!"))
|
.FieldEffects.Weather = BattleWeather.WeatherTypes.Clear
|
||||||
|
.BattleQuery.Add(New TextQueryObject("The weather became clear again!"))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If .FieldEffects.TrickRoom > 0 Then
|
||||||
|
.FieldEffects.TrickRoom -= 1
|
||||||
|
If .FieldEffects.TrickRoom = 0 Then
|
||||||
|
.BattleQuery.Add(New TextQueryObject("The dimensions have returned to normal."))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If .FieldEffects.Gravity > 0 Then
|
||||||
|
.FieldEffects.Gravity -= 1
|
||||||
|
If .FieldEffects.Gravity = 0 Then
|
||||||
|
.BattleQuery.Add(New TextQueryObject("Gravity became normal again!"))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Water Sport
|
||||||
|
If .FieldEffects.WaterSport > 0 Then
|
||||||
|
.FieldEffects.WaterSport -= 1
|
||||||
|
If .FieldEffects.WaterSport = 0 Then
|
||||||
|
.BattleQuery.Add(New TextQueryObject("Water Sport's effect ended."))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Mud Sport
|
||||||
|
If .FieldEffects.MudSport > 0 Then
|
||||||
|
.FieldEffects.MudSport -= 1
|
||||||
|
If .FieldEffects.MudSport = 0 Then
|
||||||
|
.BattleQuery.Add(New TextQueryObject("Mud Sport's effect ended."))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Remove flinch:
|
||||||
|
If .OwnPokemon.HasVolatileStatus(Pokemon.VolatileStatus.Flinch) = True Then
|
||||||
|
.OwnPokemon.RemoveVolatileStatus(Pokemon.VolatileStatus.Flinch)
|
||||||
|
End If
|
||||||
|
If .OppPokemon.HasVolatileStatus(Pokemon.VolatileStatus.Flinch) = True Then
|
||||||
|
.OppPokemon.RemoveVolatileStatus(Pokemon.VolatileStatus.Flinch)
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Revert roost types:
|
||||||
|
If .FieldEffects.OwnRoostUsed = True Then
|
||||||
|
.OwnPokemon.Type1 = .OwnPokemon.OriginalType1
|
||||||
|
.OwnPokemon.Type2 = .OwnPokemon.OriginalType2
|
||||||
|
|
||||||
|
.FieldEffects.OwnRoostUsed = False
|
||||||
|
End If
|
||||||
|
If .FieldEffects.OppRoostUsed = True Then
|
||||||
|
.OppPokemon.Type1 = .OppPokemon.OriginalType1
|
||||||
|
.OppPokemon.Type2 = .OppPokemon.OriginalType2
|
||||||
|
|
||||||
|
.FieldEffects.OppRoostUsed = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Clear learned attack counter:
|
||||||
|
LearnMovesQueryObject.ClearCache()
|
||||||
|
|
||||||
|
'Remove Magical Coat:
|
||||||
|
.FieldEffects.OwnMagicCoat = 0
|
||||||
|
.FieldEffects.OppMagicCoat = 0
|
||||||
|
|
||||||
|
'Reset Detect/Protect
|
||||||
|
.FieldEffects.OwnDetectCounter = 0 'Reset protect and detect
|
||||||
|
.FieldEffects.OwnProtectCounter = 0
|
||||||
|
.FieldEffects.OwnKingsShieldCounter = 0
|
||||||
|
|
||||||
|
If .FieldEffects.OwnEndure > 0 Then 'Stop endure
|
||||||
|
.FieldEffects.OwnEndure = 0
|
||||||
|
End If
|
||||||
|
|
||||||
|
.FieldEffects.OppDetectCounter = 0 'Reset protect and detect
|
||||||
|
.FieldEffects.OppProtectCounter = 0
|
||||||
|
.FieldEffects.OppKingsShieldCounter = 0
|
||||||
|
|
||||||
|
If .FieldEffects.OppEndure > 0 Then 'Stop endure
|
||||||
|
.FieldEffects.OppEndure = 0
|
||||||
|
End If
|
||||||
|
|
||||||
|
If .FieldEffects.OwnProtectMovesCount > 0 AndAlso Not .FieldEffects.OwnLastMove Is Nothing AndAlso .FieldEffects.OwnLastMove.IsProtectMove = False Then
|
||||||
|
.FieldEffects.OwnProtectMovesCount = 0
|
||||||
|
End If
|
||||||
|
If .FieldEffects.OppProtectMovesCount > 0 AndAlso Not .FieldEffects.OppLastMove Is Nothing AndAlso .FieldEffects.OppLastMove.IsProtectMove = False Then
|
||||||
|
.FieldEffects.OppProtectMovesCount = 0
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
If .FieldEffects.TrickRoom > 0 Then
|
BattleScreen.IsAfterFaint = False
|
||||||
.FieldEffects.TrickRoom -= 1
|
|
||||||
If .FieldEffects.TrickRoom = 0 Then
|
|
||||||
.BattleQuery.Add(New TextQueryObject("The dimensions have returned to normal."))
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
If .FieldEffects.Gravity > 0 Then
|
|
||||||
.FieldEffects.Gravity -= 1
|
|
||||||
If .FieldEffects.Gravity = 0 Then
|
|
||||||
.BattleQuery.Add(New TextQueryObject("Gravity became normal again!"))
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Water Sport
|
|
||||||
If .FieldEffects.WaterSport > 0 Then
|
|
||||||
.FieldEffects.WaterSport -= 1
|
|
||||||
If .FieldEffects.WaterSport = 0 Then
|
|
||||||
.BattleQuery.Add(New TextQueryObject("Water Sport's effect ended."))
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Mud Sport
|
|
||||||
If .FieldEffects.MudSport > 0 Then
|
|
||||||
.FieldEffects.MudSport -= 1
|
|
||||||
If .FieldEffects.MudSport = 0 Then
|
|
||||||
.BattleQuery.Add(New TextQueryObject("Mud Sport's effect ended."))
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Remove flinch:
|
|
||||||
If .OwnPokemon.HasVolatileStatus(Pokemon.VolatileStatus.Flinch) = True Then
|
|
||||||
.OwnPokemon.RemoveVolatileStatus(Pokemon.VolatileStatus.Flinch)
|
|
||||||
End If
|
|
||||||
If .OppPokemon.HasVolatileStatus(Pokemon.VolatileStatus.Flinch) = True Then
|
|
||||||
.OppPokemon.RemoveVolatileStatus(Pokemon.VolatileStatus.Flinch)
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Revert roost types:
|
|
||||||
If .FieldEffects.OwnRoostUsed = True Then
|
|
||||||
.OwnPokemon.Type1 = .OwnPokemon.OriginalType1
|
|
||||||
.OwnPokemon.Type2 = .OwnPokemon.OriginalType2
|
|
||||||
|
|
||||||
.FieldEffects.OwnRoostUsed = False
|
|
||||||
End If
|
|
||||||
If .FieldEffects.OppRoostUsed = True Then
|
|
||||||
.OppPokemon.Type1 = .OppPokemon.OriginalType1
|
|
||||||
.OppPokemon.Type2 = .OppPokemon.OriginalType2
|
|
||||||
|
|
||||||
.FieldEffects.OppRoostUsed = False
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Clear learned attack counter:
|
|
||||||
LearnMovesQueryObject.ClearCache()
|
|
||||||
|
|
||||||
'Remove Magical Coat:
|
|
||||||
.FieldEffects.OwnMagicCoat = 0
|
|
||||||
.FieldEffects.OppMagicCoat = 0
|
|
||||||
|
|
||||||
'Reset Detect/Protect
|
|
||||||
.FieldEffects.OwnDetectCounter = 0 'Reset protect and detect
|
|
||||||
.FieldEffects.OwnProtectCounter = 0
|
|
||||||
.FieldEffects.OwnKingsShieldCounter = 0
|
|
||||||
|
|
||||||
If .FieldEffects.OwnEndure > 0 Then 'Stop endure
|
|
||||||
.FieldEffects.OwnEndure = 0
|
|
||||||
End If
|
|
||||||
|
|
||||||
.FieldEffects.OppDetectCounter = 0 'Reset protect and detect
|
|
||||||
.FieldEffects.OppProtectCounter = 0
|
|
||||||
.FieldEffects.OppKingsShieldCounter = 0
|
|
||||||
|
|
||||||
If .FieldEffects.OppEndure > 0 Then 'Stop endure
|
|
||||||
.FieldEffects.OppEndure = 0
|
|
||||||
End If
|
|
||||||
|
|
||||||
If .FieldEffects.OwnProtectMovesCount > 0 AndAlso Not .FieldEffects.OwnLastMove Is Nothing AndAlso .FieldEffects.OwnLastMove.IsProtectMove = False Then
|
|
||||||
.FieldEffects.OwnProtectMovesCount = 0
|
|
||||||
End If
|
|
||||||
If .FieldEffects.OppProtectMovesCount > 0 AndAlso Not .FieldEffects.OppLastMove Is Nothing AndAlso .FieldEffects.OppLastMove.IsProtectMove = False Then
|
|
||||||
.FieldEffects.OppProtectMovesCount = 0
|
|
||||||
End If
|
|
||||||
|
|
||||||
If .OwnPokemon.Status = Pokemon.StatusProblems.Fainted Or .OwnPokemon.HP <= 0 Then
|
If .OwnPokemon.Status = Pokemon.StatusProblems.Fainted Or .OwnPokemon.HP <= 0 Then
|
||||||
.OwnPokemon.Status = Pokemon.StatusProblems.Fainted
|
.OwnPokemon.Status = Pokemon.StatusProblems.Fainted
|
||||||
BattleScreen.OwnFaint = True
|
BattleScreen.OwnFaint = True
|
||||||
@ -4219,7 +4232,9 @@
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
ChangeCameraAngel(0, True, BattleScreen)
|
ChangeCameraAngel(0, True, BattleScreen)
|
||||||
|
If BattleScreen.IsAfterFaint = True Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
With BattleScreen
|
With BattleScreen
|
||||||
If .FieldEffects.OwnReflect > 0 Then 'Stop reflect
|
If .FieldEffects.OwnReflect > 0 Then 'Stop reflect
|
||||||
.FieldEffects.OwnReflect -= 1
|
.FieldEffects.OwnReflect -= 1
|
||||||
@ -4944,7 +4959,9 @@
|
|||||||
|
|
||||||
Private Sub EndRoundOpp(ByVal BattleScreen As BattleScreen)
|
Private Sub EndRoundOpp(ByVal BattleScreen As BattleScreen)
|
||||||
ChangeCameraAngel(0, True, BattleScreen)
|
ChangeCameraAngel(0, True, BattleScreen)
|
||||||
|
If BattleScreen.IsAfterFaint = True Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
With BattleScreen
|
With BattleScreen
|
||||||
If .FieldEffects.OppReflect > 0 Then 'Stop reflect
|
If .FieldEffects.OppReflect > 0 Then 'Stop reflect
|
||||||
.FieldEffects.OppReflect -= 1
|
.FieldEffects.OppReflect -= 1
|
||||||
@ -6205,6 +6222,7 @@
|
|||||||
Public Sub EndBattle(ByVal reason As EndBattleReasons, ByVal BattleScreen As BattleScreen, ByVal AddPVP As Boolean)
|
Public Sub EndBattle(ByVal reason As EndBattleReasons, ByVal BattleScreen As BattleScreen, ByVal AddPVP As Boolean)
|
||||||
BattleSystem.BattleScreen.OwnFaint = False
|
BattleSystem.BattleScreen.OwnFaint = False
|
||||||
BattleSystem.BattleScreen.OppFaint = False
|
BattleSystem.BattleScreen.OppFaint = False
|
||||||
|
BattleSystem.BattleScreen.IsAfterFaint = False
|
||||||
If AddPVP = True Then
|
If AddPVP = True Then
|
||||||
Select Case reason
|
Select Case reason
|
||||||
Case EndBattleReasons.WinTrainer 'Lost
|
Case EndBattleReasons.WinTrainer 'Lost
|
||||||
|
@ -606,12 +606,13 @@
|
|||||||
Case BattleSystem.BattleScreen.BattleModes.Standard
|
Case BattleSystem.BattleScreen.BattleModes.Standard
|
||||||
If BattleScreen.OwnFaint Then
|
If BattleScreen.OwnFaint Then
|
||||||
_mainMenuItemList.Add(New MainMenuItem(1, "Pokémon", 0, AddressOf MainMenuOpenPokemon))
|
_mainMenuItemList.Add(New MainMenuItem(1, "Pokémon", 0, AddressOf MainMenuOpenPokemon))
|
||||||
BattleScreen.OwnFaint = False
|
If BattleScreen.IsRemoteBattle AndAlso Not BattleScreen.IsHost Then
|
||||||
|
BattleScreen.OwnFaint = False
|
||||||
|
End If
|
||||||
ElseIf BattleScreen.OppFaint And BattleScreen.IsRemoteBattle Then
|
ElseIf BattleScreen.OppFaint And BattleScreen.IsRemoteBattle Then
|
||||||
If BattleScreen.IsHost Then
|
If BattleScreen.IsHost Then
|
||||||
BattleScreen.BattleQuery.Clear()
|
BattleScreen.BattleQuery.Clear()
|
||||||
BattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
|
BattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
|
||||||
BattleScreen.OppFaint = False
|
|
||||||
BattleScreen.Battle.InitializeRound(BattleScreen, New Battle.RoundConst With {.StepType = Battle.RoundConst.StepTypes.Text, .Argument = "The client sends the next pokemon!"})
|
BattleScreen.Battle.InitializeRound(BattleScreen, New Battle.RoundConst With {.StepType = Battle.RoundConst.StepTypes.Text, .Argument = "The client sends the next pokemon!"})
|
||||||
Else
|
Else
|
||||||
BattleScreen.OwnStatistics.Switches += 1
|
BattleScreen.OwnStatistics.Switches += 1
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
'Used for after fainting switching
|
'Used for after fainting switching
|
||||||
Public Shared OwnFaint As Boolean = False
|
Public Shared OwnFaint As Boolean = False
|
||||||
Public Shared OppFaint As Boolean = False
|
Public Shared OppFaint As Boolean = False
|
||||||
|
Public Shared IsAfterFaint As Boolean = False 'Is after faint switching round
|
||||||
|
|
||||||
|
|
||||||
'Used for lead picking in PvP Battles
|
'Used for lead picking in PvP Battles
|
||||||
@ -118,6 +119,9 @@
|
|||||||
Me.IsTrainerBattle = False
|
Me.IsTrainerBattle = False
|
||||||
Me.MouseVisible = False
|
Me.MouseVisible = False
|
||||||
Me.PVPGameJoltID = ""
|
Me.PVPGameJoltID = ""
|
||||||
|
IsAfterFaint = False
|
||||||
|
OppFaint = False
|
||||||
|
OwnFaint = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub New(ByVal Trainer As Trainer, ByVal OverworldScreen As Screen, ByVal defaultMapType As Integer)
|
Public Sub New(ByVal Trainer As Trainer, ByVal OverworldScreen As Screen, ByVal defaultMapType As Integer)
|
||||||
@ -127,6 +131,9 @@
|
|||||||
Me.IsTrainerBattle = True
|
Me.IsTrainerBattle = True
|
||||||
Me.MouseVisible = False
|
Me.MouseVisible = False
|
||||||
Me.PVPGameJoltID = ""
|
Me.PVPGameJoltID = ""
|
||||||
|
IsAfterFaint = False
|
||||||
|
OppFaint = False
|
||||||
|
OwnFaint = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region "Initialize"
|
#Region "Initialize"
|
||||||
@ -1449,7 +1456,13 @@ nextIndex:
|
|||||||
End While
|
End While
|
||||||
|
|
||||||
CType(s, BattleScreen).BattleMenu.Visible = False
|
CType(s, BattleScreen).BattleMenu.Visible = False
|
||||||
CType(s, BattleScreen).Battle.StartMultiTurnAction(CType(s, BattleScreen))
|
|
||||||
|
'prevents multi turn action to take place in an after fainting switching turn
|
||||||
|
If Not (OppFaint And CType(s, BattleScreen).IsRemoteBattle) Then
|
||||||
|
CType(s, BattleScreen).Battle.StartMultiTurnAction(CType(s, BattleScreen))
|
||||||
|
Else
|
||||||
|
CType(s, BattleScreen).BattleMenu.Visible = True
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub SendEndRoundData()
|
Public Sub SendEndRoundData()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user