From f01a294725487b7efc27fdef977bf5644e131930 Mon Sep 17 00:00:00 2001 From: CaptainSegis Date: Mon, 13 Feb 2017 13:07:15 -0500 Subject: [PATCH] Fixed client pokemon trapping conditions, after fainting menu index issue, and Archen sprite --- .../BattleSystemV2/BattleCalculation.vb | 7 +++++++ .../Battle/BattleSystemV2/BattleMenu.vb | 2 ++ .../Battle/BattleSystemV2/BattleScreen.vb | 15 ++++++++++++--- .../Battle/BattleSystemV2/FieldEffects.vb | 3 +++ .../Content/Pokemon/Overworld/Normal/566.png | Bin 2293 -> 1719 bytes 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleCalculation.vb b/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleCalculation.vb index 925c60bc1..ec8df1b18 100644 --- a/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleCalculation.vb +++ b/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleCalculation.vb @@ -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 diff --git a/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleMenu.vb b/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleMenu.vb index a20a8cb11..f0781698e 100644 --- a/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleMenu.vb +++ b/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleMenu.vb @@ -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 diff --git a/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleScreen.vb b/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleScreen.vb index 103b76058..942b69c48 100644 --- a/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleScreen.vb +++ b/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleScreen.vb @@ -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 diff --git a/2.5DHero/2.5DHero/Battle/BattleSystemV2/FieldEffects.vb b/2.5DHero/2.5DHero/Battle/BattleSystemV2/FieldEffects.vb index c929abcb9..e672da395 100644 --- a/2.5DHero/2.5DHero/Battle/BattleSystemV2/FieldEffects.vb +++ b/2.5DHero/2.5DHero/Battle/BattleSystemV2/FieldEffects.vb @@ -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 diff --git a/2.5DHero/2.5DHeroContent/Content/Pokemon/Overworld/Normal/566.png b/2.5DHero/2.5DHeroContent/Content/Pokemon/Overworld/Normal/566.png index f5a6ec02f3aa9bfb740b52436ad9a11ba825bee4..dfadeabacc7252302dd29d3a035efa1b1d4535cc 100644 GIT binary patch delta 1703 zcmV;Y23Yy^5w{JHB!2{FK}|sb0I`n?{9y$E000SaNLh0L01m?d01m?e$8V@)0000P zbVXQnQ*UN;cVTj60B~VxZgehgWpp4kE-)@JGc*HRdH?_hG)Y83RCr$Pojr0KHxPxH z`xK7EjF}j@9I1E&hdzfd;6N#_;4}CNzJMdAEFD4RaE;gK2Y)rOvwt(w19|6tRb3eT z4Bl&CW|vh2r3WE|5JCtcgb+ep;_>D6@WbP;El~HaP1v=*3I6u=DA4XhQrWdWc6v&@ zMe>udcYQD|?1BC|ER9KB2Kwu;G$wT!=&!@_m=tE9zYa@d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