Fixed client pokemon trapping conditions, after fainting menu index issue, and Archen sprite
This commit is contained in:
parent
d2d0bb189e
commit
f01a294725
|
@ -904,6 +904,13 @@
|
|||
If BattleScreen.OwnPokemon.Status = Pokemon.StatusProblems.Fainted Or BattleScreen.OwnPokemon.HP <= 0 Then
|
||||
Return True
|
||||
End If
|
||||
|
||||
If BattleScreen.IsRemoteBattle AndAlso BattleScreen.IsPVPBattle AndAlso Not BattleScreen.IsHost Then
|
||||
If BattleScreen.FieldEffects.ClientCanSwitch = False Then
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
|
||||
If BattleScreen.OppPokemon.Ability.Name.ToLower() = "shadow tag" And BattleScreen.OwnPokemon.Ability.Name.ToLower() <> "shadow tag" Then
|
||||
Return False
|
||||
End If
|
||||
|
|
|
@ -605,6 +605,8 @@
|
|||
|
||||
Case BattleSystem.BattleScreen.BattleModes.Standard
|
||||
If BattleScreen.OwnFaint Then
|
||||
_mainMenuIndex = 0
|
||||
_mainMenuNextIndex = 0
|
||||
_mainMenuItemList.Add(New MainMenuItem(1, "Pokémon", 0, AddressOf MainMenuOpenPokemon))
|
||||
If BattleScreen.IsRemoteBattle AndAlso Not BattleScreen.IsHost Then
|
||||
BattleScreen.OwnFaint = False
|
||||
|
|
|
@ -1342,6 +1342,7 @@ nextIndex:
|
|||
Dim tempData As String = ""
|
||||
Dim cData As String = data
|
||||
|
||||
'Converts the single string received as data into a list of queries (as string)
|
||||
While cData.Length > 0
|
||||
If cData(0).ToString() = "|" AndAlso tempData(tempData.Length - 1).ToString() = "}" Then
|
||||
newQueries.Add(tempData)
|
||||
|
@ -1363,7 +1364,9 @@ nextIndex:
|
|||
End While
|
||||
|
||||
If s.Identification = Identifications.BattleScreen Then
|
||||
CType(s, BattleScreen).LockData = newQueries(0)
|
||||
|
||||
'First set of queries are read and converted into BattleScreen values for the client side.
|
||||
CType(s, BattleScreen).LockData = newQueries(0) 'when locked into certain situations that do not allow the client to take actions (like multi turn moves)
|
||||
CType(s, BattleScreen).OppStatistics.FromString(newQueries(1))
|
||||
CType(s, BattleScreen).OwnStatistics.FromString(newQueries(2))
|
||||
CType(s, BattleScreen).OppPokemon = Pokemon.GetPokemonByData(newQueries(3))
|
||||
|
@ -1373,10 +1376,15 @@ nextIndex:
|
|||
weatherInfo = weatherInfo.Remove(weatherInfo.Length - 1, 1).Remove(0, 1)
|
||||
CType(s, BattleScreen).FieldEffects.Weather = CType(CInt(weatherInfo), BattleWeather.WeatherTypes)
|
||||
|
||||
For i = 0 To 5
|
||||
Dim CanSwitchInfo As String = newQueries(6)
|
||||
CanSwitchInfo = CanSwitchInfo.Remove(CanSwitchInfo.Length - 1, 1).Remove(0, 1)
|
||||
CType(s, BattleScreen).FieldEffects.ClientCanSwitch = CType(CanSwitchInfo, Boolean)
|
||||
|
||||
For i = 0 To 6
|
||||
newQueries.RemoveAt(0)
|
||||
Next
|
||||
|
||||
'Next queries contain the data from the party of the host and the client.
|
||||
Dim ownCount As Integer = Core.Player.Pokemons.Count
|
||||
Dim oppCount As Integer = CType(s, BattleScreen).Trainer.Pokemons.Count
|
||||
|
||||
|
@ -1496,7 +1504,8 @@ nextIndex:
|
|||
Dim d As String = lockData & "|" &
|
||||
OwnStatistics.ToString() & "|" & OppStatistics.ToString() & "|" &
|
||||
OwnPokemon.GetSaveData() & "|" & OppPokemon.GetSaveData() & "|" &
|
||||
"{" & CInt(FieldEffects.Weather).ToString() & "}"
|
||||
"{" & CInt(FieldEffects.Weather).ToString() & "}" & "|" &
|
||||
"{" & BattleCalculation.CanSwitch(Me, False).ToString & "}"
|
||||
|
||||
For Each p As Pokemon In Core.Player.Pokemons
|
||||
If d <> "" Then
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
Public Class FieldEffects
|
||||
|
||||
'Client side stuff in PvP
|
||||
Public ClientCanSwitch As Boolean = True 'Calculated by the host, sent to the client
|
||||
|
||||
'Own stuff
|
||||
Public OwnSleepTurns As Integer = 0 'Sleep turns
|
||||
Public OwnTruantRound As Integer = 0 'Truant move counter
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.7 KiB |
Loading…
Reference in New Issue