Attempt to fix client not able to perform Mega Evolution

This commit is contained in:
CaptainSegis 2016-10-04 16:28:47 -05:00
parent 25908af6b4
commit 24f0200dbd
2 changed files with 16 additions and 9 deletions

View File

@ -340,16 +340,19 @@
If BattleScreen.IsRemoteBattle AndAlso BattleScreen.IsHost Then
BattleScreen.OppStatistics.Turns += 1
BattleScreen.OwnStatistics.Turns += 1
If BattleScreen.ReceivedInput.StartsWith("MOVE|") Then
If BattleScreen.ReceivedInput.StartsWith("MOVE|") OrElse BattleScreen.ReceivedInput.StartsWith("MEGA|") Then
BattleScreen.OppStatistics.Moves += 1
If BattleScreen.ReceivedInput.StartsWith("MEGA|") Then
BattleScreen.IsMegaEvolvingOpp = True
End If
Dim moveID As Integer = CInt(BattleScreen.ReceivedInput.Remove(0, 5))
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, moveID)}
ElseIf BattleScreen.ReceivedInput.StartsWith("SWITCH|") Then
BattleScreen.OppStatistics.Switches += 1
Dim switchID As Integer = CInt(BattleScreen.ReceivedInput.Remove(0, 7))
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Switch, .Argument = switchID.ToString()}
ElseIf BattleScreen.ReceivedInput.StartsWith("TEXT|") Then
Dim text As String = BattleScreen.ReceivedInput.Remove(0, 5)
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, moveID)}
ElseIf BattleScreen.ReceivedInput.StartsWith("SWITCH|") Then
BattleScreen.OppStatistics.Switches += 1
Dim switchID As Integer = CInt(BattleScreen.ReceivedInput.Remove(0, 7))
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Switch, .Argument = switchID.ToString()}
ElseIf BattleScreen.ReceivedInput.StartsWith("TEXT|") Then
Dim text As String = BattleScreen.ReceivedInput.Remove(0, 5)
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Text, .Argument = text}
End If
End If

View File

@ -821,7 +821,11 @@
BattleScreen.BattleQuery.Clear()
BattleScreen.BattleQuery.Add(BattleScreen.FocusBattle())
BattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
BattleScreen.SendClientCommand("MOVE|" & BattleScreen.OwnPokemon.Attacks(_moveMenuIndex).ID.ToString())
If BattleScreen.IsMegaEvolvingOwn Then
BattleScreen.SendClientCommand("MEGA|" & BattleScreen.OwnPokemon.Attacks(_moveMenuIndex).ID.ToString())
Else
BattleScreen.SendClientCommand("MOVE|" & BattleScreen.OwnPokemon.Attacks(_moveMenuIndex).ID.ToString())
End If
Else
BattleScreen.OwnStatistics.Moves += 1
BattleScreen.BattleQuery.Clear()