mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-27 15:54:25 +02:00
Fixed Baton Pass, PVP needs testing
This commit is contained in:
parent
c007d0d6f4
commit
944e42cadd
@ -405,7 +405,15 @@
|
|||||||
If BattleScreen.ReceivedInput.StartsWith("MEGA|") Then
|
If BattleScreen.ReceivedInput.StartsWith("MEGA|") Then
|
||||||
BattleScreen.IsMegaEvolvingOpp = True
|
BattleScreen.IsMegaEvolvingOpp = True
|
||||||
End If
|
End If
|
||||||
Dim moveID As Integer = CInt(BattleScreen.ReceivedInput.Remove(0, 5))
|
Dim moveID As Integer
|
||||||
|
Dim inputString As String = BattleScreen.ReceivedInput.Remove(0, 5)
|
||||||
|
If inputString.Contains("|BATON|") Then
|
||||||
|
BattleScreen.FieldEffects.OppBatonPassIndex = CInt(inputString.GetSplit(2, "|"))
|
||||||
|
moveID = CInt(inputString.GetSplit(0, "|"))
|
||||||
|
Else
|
||||||
|
moveID = CInt(inputString)
|
||||||
|
End If
|
||||||
|
|
||||||
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, moveID)}
|
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, moveID)}
|
||||||
ElseIf BattleScreen.ReceivedInput.StartsWith("SWITCH|") Then
|
ElseIf BattleScreen.ReceivedInput.StartsWith("SWITCH|") Then
|
||||||
BattleScreen.OppStatistics.Switches += 1
|
BattleScreen.OppStatistics.Switches += 1
|
||||||
@ -7383,7 +7391,7 @@
|
|||||||
If .OwnUsedBatonPass = False Then .OwnEmbargo = 0
|
If .OwnUsedBatonPass = False Then .OwnEmbargo = 0
|
||||||
.OwnYawn = 0
|
.OwnYawn = 0
|
||||||
If .OwnUsedBatonPass = False Then .OwnPerishSongCount = 0
|
If .OwnUsedBatonPass = False Then .OwnPerishSongCount = 0
|
||||||
.OwnConfusionTurns = 0
|
If .OwnUsedBatonPass = False Then .OwnConfusionTurns = 0
|
||||||
.OwnTorment = 0
|
.OwnTorment = 0
|
||||||
.OwnTormentMove = Nothing
|
.OwnTormentMove = Nothing
|
||||||
.OwnChoiceMove = Nothing
|
.OwnChoiceMove = Nothing
|
||||||
@ -7794,7 +7802,7 @@
|
|||||||
If .OppUsedBatonPass = False Then .OppEmbargo = 0
|
If .OppUsedBatonPass = False Then .OppEmbargo = 0
|
||||||
.OppYawn = 0
|
.OppYawn = 0
|
||||||
If .OppUsedBatonPass = False Then .OppPerishSongCount = 0
|
If .OppUsedBatonPass = False Then .OppPerishSongCount = 0
|
||||||
.OppConfusionTurns = 0
|
If .OppUsedBatonPass = False Then .OppConfusionTurns = 0
|
||||||
.OppTorment = 0
|
.OppTorment = 0
|
||||||
.OppTormentMove = Nothing
|
.OppTormentMove = Nothing
|
||||||
.OppChoiceMove = Nothing
|
.OppChoiceMove = Nothing
|
||||||
|
@ -913,9 +913,22 @@
|
|||||||
_moveMenuAlpha -= 15
|
_moveMenuAlpha -= 15
|
||||||
If _moveMenuAlpha <= 0 Then
|
If _moveMenuAlpha <= 0 Then
|
||||||
_moveMenuAlpha = 0
|
_moveMenuAlpha = 0
|
||||||
|
If BattleScreen.OwnPokemon.Attacks(_moveMenuIndex).ID = 226 Then
|
||||||
|
If PartyScreen.Selected <> -1 Then
|
||||||
|
BattleScreen.FieldEffects.OwnBatonPassIndex = PartyScreen.Selected
|
||||||
|
MoveMenuStartRound(BattleScreen)
|
||||||
|
PartyScreen.Selected = -1
|
||||||
|
Else
|
||||||
|
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), Nothing, "Choose Pokémon", False, False, False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = False}
|
||||||
|
AddHandler selScreen.SelectedObject, Nothing
|
||||||
|
|
||||||
|
Core.SetScreen(selScreen)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
MoveMenuStartRound(BattleScreen)
|
MoveMenuStartRound(BattleScreen)
|
||||||
Visible = False
|
Visible = False
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
UseStruggle(BattleScreen)
|
UseStruggle(BattleScreen)
|
||||||
|
|
||||||
@ -980,12 +993,16 @@
|
|||||||
BattleScreen.BattleQuery.Clear()
|
BattleScreen.BattleQuery.Clear()
|
||||||
BattleScreen.BattleQuery.Add(BattleScreen.FocusBattle())
|
BattleScreen.BattleQuery.Add(BattleScreen.FocusBattle())
|
||||||
BattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
|
BattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
|
||||||
|
Dim BatonPassSuffix As String = ""
|
||||||
|
If BattleScreen.FieldEffects.OwnBatonPassIndex <> -1 Then
|
||||||
|
BatonPassSuffix = "|BATON|" & BattleScreen.FieldEffects.OwnBatonPassIndex
|
||||||
|
End If
|
||||||
If BattleScreen.IsMegaEvolvingOwn Then
|
If BattleScreen.IsMegaEvolvingOwn Then
|
||||||
BattleScreen.SendClientCommand("MEGA|" & BattleScreen.OwnPokemon.Attacks(_moveMenuIndex).ID.ToString())
|
BattleScreen.SendClientCommand("MEGA|" & BattleScreen.OwnPokemon.Attacks(_moveMenuIndex).ID.ToString() & BatonPassSuffix)
|
||||||
BattleScreen.IsMegaEvolvingOwn = False
|
BattleScreen.IsMegaEvolvingOwn = False
|
||||||
BattleScreen.FieldEffects.OwnMegaEvolved = True
|
BattleScreen.FieldEffects.OwnMegaEvolved = True
|
||||||
Else
|
Else
|
||||||
BattleScreen.SendClientCommand("MOVE|" & BattleScreen.OwnPokemon.Attacks(_moveMenuIndex).ID.ToString())
|
BattleScreen.SendClientCommand("MOVE|" & BattleScreen.OwnPokemon.Attacks(_moveMenuIndex).ID.ToString() & BatonPassSuffix)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If BattleScreen.IsMegaEvolvingOwn Then
|
If BattleScreen.IsMegaEvolvingOwn Then
|
||||||
|
@ -291,10 +291,12 @@
|
|||||||
Public OwnUsedBatonPass As Boolean = False
|
Public OwnUsedBatonPass As Boolean = False
|
||||||
Public OwnBatonPassStats As List(Of Integer)
|
Public OwnBatonPassStats As List(Of Integer)
|
||||||
Public OwnBatonPassConfusion As Boolean = False
|
Public OwnBatonPassConfusion As Boolean = False
|
||||||
|
Public OwnBatonPassIndex As Integer = -1
|
||||||
|
|
||||||
Public OppUsedBatonPass As Boolean = False
|
Public OppUsedBatonPass As Boolean = False
|
||||||
Public OppBatonPassStats As List(Of Integer)
|
Public OppBatonPassStats As List(Of Integer)
|
||||||
Public OppBatonPassConfusion As Boolean = False
|
Public OppBatonPassConfusion As Boolean = False
|
||||||
|
Public OppBatonPassIndex As Integer = -1
|
||||||
|
|
||||||
Public Function CanUseItem(ByVal own As Boolean) As Boolean
|
Public Function CanUseItem(ByVal own As Boolean) As Boolean
|
||||||
Dim embargo As Integer = OwnEmbargo
|
Dim embargo As Integer = OwnEmbargo
|
||||||
|
@ -57,15 +57,27 @@
|
|||||||
|
|
||||||
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen)
|
Public Overrides Sub MoveHits(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 AndAlso BattleScreen.FieldEffects.OwnBatonPassIndex <> BattleScreen.OwnPokemonIndex AndAlso BattleScreen.FieldEffects.OwnBatonPassIndex <> -1 Then
|
||||||
BattleScreen.FieldEffects.OwnUsedBatonPass = True
|
BattleScreen.FieldEffects.OwnUsedBatonPass = True
|
||||||
|
|
||||||
BattleScreen.Battle.SwitchOutOwn(BattleScreen, GetPokemonIndex(BattleScreen, own), -1)
|
BattleScreen.Battle.SwitchOutOwn(BattleScreen, BattleScreen.FieldEffects.OwnBatonPassIndex, -1)
|
||||||
|
BattleScreen.FieldEffects.OwnBatonPassIndex = -1
|
||||||
|
Else
|
||||||
|
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If BattleScreen.IsTrainerBattle = True Then
|
||||||
|
If BattleScreen.IsRemoteBattle = True Or BattleScreen.IsPVPBattle = True Then
|
||||||
|
BattleScreen.FieldEffects.OppUsedBatonPass = True
|
||||||
|
If BattleScreen.Trainer.CountUseablePokemon > 1 AndAlso BattleScreen.FieldEffects.OppBatonPassIndex <> BattleScreen.OppPokemonIndex AndAlso BattleScreen.FieldEffects.OppBatonPassIndex <> -1 Then
|
||||||
|
BattleScreen.FieldEffects.OppUsedBatonPass = True
|
||||||
|
|
||||||
|
BattleScreen.Battle.SwitchOutOpp(BattleScreen, BattleScreen.FieldEffects.OppBatonPassIndex)
|
||||||
|
BattleScreen.FieldEffects.OppBatonPassIndex = -1
|
||||||
Else
|
Else
|
||||||
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
|
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If BattleScreen.IsTrainerBattle = True Or BattleScreen.IsRemoteBattle = True Or BattleScreen.IsPVPBattle = True Then
|
|
||||||
If BattleScreen.Trainer.CountUseablePokemon > 1 Then
|
If BattleScreen.Trainer.CountUseablePokemon > 1 Then
|
||||||
BattleScreen.FieldEffects.OppUsedBatonPass = True
|
BattleScreen.FieldEffects.OppUsedBatonPass = True
|
||||||
|
|
||||||
@ -73,6 +85,7 @@
|
|||||||
Else
|
Else
|
||||||
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
|
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
|
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
|
||||||
End If
|
End If
|
||||||
@ -96,6 +109,6 @@
|
|||||||
Return -1
|
Return -1
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
End Class
|
|
||||||
|
|
||||||
|
End Class
|
||||||
End Namespace
|
End Namespace
|
Loading…
x
Reference in New Issue
Block a user