From 0bf30358da360418abf4f5807640c48b3a8a7155 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Fri, 17 Jun 2022 16:31:05 +0200 Subject: [PATCH] Rival rename texture bug fix --- P3D/Content/Data/Scripts/newgame/intro.dat | 2 +- P3D/Dialogues/PokemonImageView.vb | 2 +- P3D/Network/Profiles/GamejoltSave.vb | 2 +- P3D/Screens/MainMenu/NewNewGameScreen.vb | 54 ++++++++++++++++--- P3D/Screens/NewGameScreen.vb | 14 +++-- .../V2/ScriptCommands/DoPlayer.vb | 8 ++- 6 files changed, 64 insertions(+), 18 deletions(-) diff --git a/P3D/Content/Data/Scripts/newgame/intro.dat b/P3D/Content/Data/Scripts/newgame/intro.dat index ee6c7bafa..a38119467 100644 --- a/P3D/Content/Data/Scripts/newgame/intro.dat +++ b/P3D/Content/Data/Scripts/newgame/intro.dat @@ -184,7 +184,7 @@ @player.setot() @player.addmoney(3000) - +@player.setrivalskin(4) @system.endnewgame(yourroom.dat,1,0.1,3,1) diff --git a/P3D/Dialogues/PokemonImageView.vb b/P3D/Dialogues/PokemonImageView.vb index 2ab460e09..a674e1572 100644 --- a/P3D/Dialogues/PokemonImageView.vb +++ b/P3D/Dialogues/PokemonImageView.vb @@ -56,7 +56,7 @@ Canvas.DrawImageBorder(TextureManager.GetTexture("GUI\Menus\Menu", New Rectangle(0, 0, 48, 48), ""), 2, New Rectangle(CInt(p.X), CInt(p.Y), 320, 320)) - Core.SpriteBatch.Draw(Me.Texture, New Rectangle(CInt(p.X) - 15, CInt(p.Y) - 90, 384, 384), Color.White) + Core.SpriteBatch.Draw(Me.Texture, New Rectangle(CInt(p.X + 48), CInt(p.Y + 48), 256, 256), Color.White) If Me.Delay = 0.0F Then Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Overworld\TextBox"), New Rectangle(CInt(p.X) + 144 + 160, CInt(p.Y) + 144 + 160 + 32, 16, 16), New Rectangle(0, 48, 16, 16), Color.White) diff --git a/P3D/Network/Profiles/GamejoltSave.vb b/P3D/Network/Profiles/GamejoltSave.vb index 6f6c5bd15..e5558aa9a 100644 --- a/P3D/Network/Profiles/GamejoltSave.vb +++ b/P3D/Network/Profiles/GamejoltSave.vb @@ -869,7 +869,7 @@ Namespace GameJolt "MapFile|yourroom.dat" & Environment.NewLine & "Rotation|1.570796" & Environment.NewLine & "RivalName|???" & Environment.NewLine & - "RivalSkin|Silver" & Environment.NewLine & + "RivalSkin|4" & Environment.NewLine & "Money|3000" & Environment.NewLine & "Badges|0" & Environment.NewLine & "Gender|Male" & Environment.NewLine & diff --git a/P3D/Screens/MainMenu/NewNewGameScreen.vb b/P3D/Screens/MainMenu/NewNewGameScreen.vb index 8f98f1d74..7cec3bbb0 100644 --- a/P3D/Screens/MainMenu/NewNewGameScreen.vb +++ b/P3D/Screens/MainMenu/NewNewGameScreen.vb @@ -17,8 +17,19 @@ PreScreen = currentScreen CanBePaused = False UpdateFadeOut = True + For Each s As String In Core.GameOptions.ContentPackNames + ContentPackManager.Load(GameController.GamePath & "\ContentPacks\" & s & "\exceptions.dat") + Next + BattleSystem.GameModeAttackLoader.Load() + SmashRock.Load() + Badge.Load() + Pokedex.Load() + BattleSystem.BattleScreen.ResetVars() + LevelLoader.ClearTempStructures() + PokemonForms.Initialize() + 'Set up 3D environment variables (Effect, Camera, SkyDome and Level): Effect = New BasicEffect(GraphicsDevice) Effect.FogEnabled = True @@ -119,6 +130,7 @@ End Sub Public Shared Sub EndNewGame(ByVal map As String, ByVal x As Single, ByVal y As Single, ByVal z As Single, ByVal rot As Integer) + Dim folderPath As String = Core.Player.Name.Replace("\", "_").Replace("/", "_").Replace(":", "_").Replace("*", "_").Replace("?", "_").Replace("""", "_").Replace("<", "_").Replace(">", "_").Replace("|", "_").Replace(",", "_").Replace(".", "_") Dim folderPrefix As Integer = 0 @@ -128,7 +140,7 @@ Dim savePath As String = GameController.GamePath & "\Save\" - While IO.Directory.Exists(savePath & folderPath) = True + While System.IO.Directory.Exists(savePath & folderPath) = True If folderPath <> Core.Player.Name Then folderPath = folderPath.Remove(folderPath.Length - folderPrefix.ToString().Length, folderPrefix.ToString().Length) End If @@ -138,11 +150,11 @@ folderPrefix += 1 End While - If IO.Directory.Exists(GameController.GamePath & "\Save") = False Then - IO.Directory.CreateDirectory(GameController.GamePath & "\Save") + If System.IO.Directory.Exists(GameController.GamePath & "\Save") = False Then + System.IO.Directory.CreateDirectory(GameController.GamePath & "\Save") End If - 'IO.Directory.CreateDirectory(savePath & folderPath) + System.IO.Directory.CreateDirectory(savePath & folderPath) Core.Player.filePrefix = folderPath Core.Player.GameStart = Date.Now @@ -158,7 +170,7 @@ Core.Player.startRotation = CSng(MathHelper.Pi * (rot / 2)) Core.Player.BerryData = CreateBerryData() - Core.Player.AddVisitedMap("yourroom.dat") + Core.Player.AddVisitedMap(map) Core.Player.SaveCreated = GameController.GAMEDEVELOPMENTSTAGE & " " & GameController.GAMEVERSION Dim ot As String = Core.Random.Next(0, 999999).ToString() @@ -166,8 +178,38 @@ ot = "0" & ot End While Core.Player.OT = ot - End Sub + System.IO.File.WriteAllText(savePath & folderPath & "\Player.dat", Core.Player.GetPlayerData(False)) + System.IO.File.WriteAllText(savePath & folderPath & "\Pokedex.dat", "") + System.IO.File.WriteAllText(savePath & folderPath & "\Items.dat", "") + System.IO.File.WriteAllText(savePath & folderPath & "\Register.dat", "") + System.IO.File.WriteAllText(savePath & folderPath & "\Berries.dat", Core.Player.BerryData) + System.IO.File.WriteAllText(savePath & folderPath & "\Apricorns.dat", "") + System.IO.File.WriteAllText(savePath & folderPath & "\Daycare.dat", "") + System.IO.File.WriteAllText(savePath & folderPath & "\Party.dat", "") + System.IO.File.WriteAllText(savePath & folderPath & "\ItemData.dat", "") + System.IO.File.WriteAllText(savePath & folderPath & "\Options.dat", CreateOptionsData()) + System.IO.File.WriteAllText(savePath & folderPath & "\Box.dat", "") + System.IO.File.WriteAllText(savePath & folderPath & "\NPC.dat", "") + System.IO.File.WriteAllText(savePath & folderPath & "\HallOfFame.dat", "") + System.IO.File.WriteAllText(savePath & folderPath & "\SecretBase.dat", "") + System.IO.File.WriteAllText(savePath & folderPath & "\RoamingPokemon.dat", "") + System.IO.File.WriteAllText(savePath & folderPath & "\Statistics.dat", "") + + Core.Player.IsGameJoltSave = False + Core.Player.LoadGame(folderPath) + + + 'IO.Directory.CreateDirectory(savePath & folderPath) + + End Sub + Public Shared Function CreateOptionsData() As String + Dim s As String = "FOV|" & Core.Player.startFOV & Environment.NewLine & + "TextSpeed|2" & Environment.NewLine & + "MouseSpeed|" & Core.Player.startRotationSpeed + + Return s + End Function Private Shared Function CreateBerryData() As String Dim s As String = "{route29.dat|13,0,5|6|2|0|2012,9,21,4,0,0|1}" & Environment.NewLine & "{route29.dat|14,0,5|6|2|0|2012,9,21,4,0,0|1}" & Environment.NewLine & diff --git a/P3D/Screens/NewGameScreen.vb b/P3D/Screens/NewGameScreen.vb index cd51a80b0..e150c68ef 100644 --- a/P3D/Screens/NewGameScreen.vb +++ b/P3D/Screens/NewGameScreen.vb @@ -51,10 +51,6 @@ BattleSystem.GameModeAttackLoader.Load() - If GameModeManager.ActiveGameMode.IsDefaultGamemode = False Then - 'MusicManager.LoadMusic(True) - 'SoundManager.LoadSounds(True) - End If SmashRock.Load() Badge.Load() Pokedex.Load() @@ -397,7 +393,7 @@ "MapFile|" & Me.startMap & Environment.NewLine & "Rotation|" & Me.startYaw.ToString() & Environment.NewLine & "RivalName|???" & Environment.NewLine & - "RivalSkin|Silver" & Environment.NewLine & + "RivalSkin|4" & Environment.NewLine & "Money|3000" & Environment.NewLine & "Badges|0" & Environment.NewLine & "Gender|Male" & Environment.NewLine & @@ -411,6 +407,7 @@ "skin|" & skinFiles(SkinIndex) & Environment.NewLine & "location|" & Me.startLocation & Environment.NewLine & "battleAnimations|1" & Environment.NewLine & + "RunMode|1" & Environment.NewLine & "BoxAmount|5" & Environment.NewLine & "LastRestPlace|" & startMap & Environment.NewLine & "LastRestPlacePosition|" & Me.startPosition.X.ToString().Replace(GameController.DecSeparator, ".") & "," & Me.startPosition.Y.ToString().Replace(GameController.DecSeparator, ".") & "," & Me.startPosition.Z.ToString().Replace(GameController.DecSeparator, ".") & Environment.NewLine & @@ -419,7 +416,7 @@ "LastSavePlace|" & startMap & Environment.NewLine & "LastSavePlacePosition|" & Me.startPosition.X.ToString().Replace(GameController.DecSeparator, ".") & "," & Me.startPosition.Y.ToString().Replace(GameController.DecSeparator, ".") & "," & Me.startPosition.Z.ToString().Replace(GameController.DecSeparator, ".") & Environment.NewLine & "Difficulty|" & GameModeManager.GetGameRuleValue("Difficulty", "0") & Environment.NewLine & - "BattleStyle|0" & Environment.NewLine & + "BattleStyle|1" & Environment.NewLine & "saveCreated|" & GameController.GAMEDEVELOPMENTSTAGE & " " & GameController.GAMEVERSION & Environment.NewLine & "LastPokemonPosition|999,999,999" & Environment.NewLine & "DaycareSteps|0" & Environment.NewLine & @@ -430,13 +427,14 @@ "Surfing|0" & Environment.NewLine & "ShowModels|1" & Environment.NewLine & "GTSStars|4" & Environment.NewLine & - "SandBoxMode|0" + "SandBoxMode|0" & Environment.NewLine & + "EarnedAchievements|" Return s End Function Public Shared Function GetOptionsData() As String - Dim s As String = "FOV|50" & Environment.NewLine & + Dim s As String = "FOV|60" & Environment.NewLine & "TextSpeed|2" & Environment.NewLine & "MouseSpeed|12" diff --git a/P3D/World/ActionScript/V2/ScriptCommands/DoPlayer.vb b/P3D/World/ActionScript/V2/ScriptCommands/DoPlayer.vb index 16157cb84..000563068 100644 --- a/P3D/World/ActionScript/V2/ScriptCommands/DoPlayer.vb +++ b/P3D/World/ActionScript/V2/ScriptCommands/DoPlayer.vb @@ -25,7 +25,13 @@ Core.Player.HasPokegear = True IsReady = True Case "renamerival" - Dim RivalTexture2D As Texture2D = TextureManager.GetTexture(GameModeManager.ActiveGameMode.ContentPath & "Textures\NPC\" & Core.Player.RivalSkin) + If GameModeManager.ActiveGameMode.IsDefaultGamemode = True AndAlso Core.Player.RivalSkin <> "4" Then + Core.Player.RivalSkin = "4" + End If + If Core.Player.RivalSkin = "" Then + Core.Player.RivalSkin = "4" + End If + Dim RivalTexture2D As Texture2D = TextureManager.GetTexture("Textures\NPC\" & Core.Player.RivalSkin) Dim RivalFrameSize As Size If RivalTexture2D.Width = RivalTexture2D.Height / 2 Then RivalFrameSize = New Size(CInt(RivalTexture2D.Width / 2), CInt(RivalTexture2D.Height / 4))