From 5747c2f1ce4d28a4331ad3b7f9c78f5f796c0636 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Sun, 3 Sep 2023 18:47:15 +0200 Subject: [PATCH] Added pkmn gender constructs + fix hidden grotto --- .../Scripts/hiddengrotto/getlists/route34.dat | Bin 624 -> 1122 bytes .../Data/Scripts/hiddengrotto/main.dat | Bin 5794 -> 6602 bytes .../Data/Scripts/hiddengrotto/pokemon.dat | Bin 1470 -> 1694 bytes P3D/Entites/Other/NPC.vb | 12 ++++++ .../V2/ScriptCommands/DoBattle.vb | 36 +++++++++++++++--- .../V2/ScriptConstructs/DoPokemon.vb | 13 +++++++ P3D/World/ActionScript/V2/ScriptLibrary.vb | 5 ++- 7 files changed, 59 insertions(+), 7 deletions(-) diff --git a/P3D/Content/Data/Scripts/hiddengrotto/getlists/route34.dat b/P3D/Content/Data/Scripts/hiddengrotto/getlists/route34.dat index bd49e8322c0368cdaab93d5e66058d09ccae6b6c..8bbe720a18821f95aebf88f63e684c21407fa905 100644 GIT binary patch literal 1122 zcmc(e>q^5=5QOKig6~nG1bb1j#NeBVm-K>7D#udr<<)OCDHy>Lupl8hoXwuunb|#` zA3K#wdecf9)w{-#D~0ztZn43_?D`)it_1HT9SL1$StkDj6 qW~}n?{psJ&aXXol*2~}TWPeQ0>@^cRJtC%OpqUBZ%&Tvmw<}+TiN+ZK delta 19 ZcmaFF@quN75aZ+mrVt=@nLLO27ywD42Rr}( diff --git a/P3D/Content/Data/Scripts/hiddengrotto/main.dat b/P3D/Content/Data/Scripts/hiddengrotto/main.dat index 113c7691a0186a7c1f364045d57927257a8b4e12..704094e455561abb9150161b15bffa715c61c755 100644 GIT binary patch delta 253 zcmZ3ad&+o&3De{QjC|bb451uCoyVZZ zfMgv*GD8MXe;$xdWzd*x$Ravd5bo=1gsFL!dlZ7HI21PSMFO a{4VHfI6m0}xI$wB}A{NM*=lNCA>XlRq-4PMp9t*@)={KKacG%=4H4qVE$Z delta 16 YcmbQoyN`Q=4%6g0Oz$@TVqU@o060Yk$N&HU diff --git a/P3D/Entites/Other/NPC.vb b/P3D/Entites/Other/NPC.vb index 564b04faf..d817a9f01 100644 --- a/P3D/Entites/Other/NPC.vb +++ b/P3D/Entites/Other/NPC.vb @@ -113,6 +113,18 @@ End If End If + If StringHelper.IsNumeric(Me.TextureID) = False Then + If System.IO.File.Exists(GameController.GamePath & "\" & GameModeManager.ActiveGameMode.ContentPath & texturePath & Me.TextureID & PokemonAddition & ".png") = False Then + If Me.TextureID.Contains("_") Then + Me.TextureID = Me.TextureID.GetSplit(0, "_") + ElseIf Me.TextureID.Contains("-") Then + Me.TextureID = Me.TextureID.GetSplit(0, "-") + ElseIf Me.TextureID.Contains(";") Then + Me.TextureID = Me.TextureID.GetSplit(0, ";") + End If + End If + End If + If UseGameJoltID = True And Core.Player.IsGameJoltSave = True And GameJolt.API.LoggedIn = True AndAlso Not GameJolt.Emblem.GetOnlineSprite(GameJoltID) Is Nothing Then Me.Texture = GameJolt.Emblem.GetOnlineSprite(GameJoltID) Else diff --git a/P3D/World/ActionScript/V2/ScriptCommands/DoBattle.vb b/P3D/World/ActionScript/V2/ScriptCommands/DoBattle.vb index 2dbd3c183..07f8cd4cc 100644 --- a/P3D/World/ActionScript/V2/ScriptCommands/DoBattle.vb +++ b/P3D/World/ActionScript/V2/ScriptCommands/DoBattle.vb @@ -128,18 +128,30 @@ Case 0 musicLoop = args(i) Case 1 - introType = int(args(i)) + If args(i) <> "" Then + introType = int(args(i)) + End If End Select Next End If End If Else If argument.Length > 0 Then - Dim ID As Integer = int(argument.GetSplit(0).Split(CChar("_"))(0)) + Dim ID As Integer Dim AD As String = "" - If argument.GetSplit(0).Contains(CChar("_")) Then - AD = argument.GetSplit(0).Split(CChar("_"))(1) + If argument.GetSplit(0).Contains("-") Then + ID = int(argument.GetSplit(0).GetSplit(0, "-")) + ElseIf argument.GetSplit(0).Contains(";") Then + ID = int(argument.GetSplit(0).GetSplit(0, ";")) + AD = argument.GetSplit(0).GetSplit(1, ";") + Else + ID = int(argument.GetSplit(0).GetSplit(0, "_")) + + If argument.GetSplit(0).Contains("_") Then + AD = PokemonForms.GetAdditionalValueFromDataFile(argument.GetSplit(0)) + End If End If + Dim Level As Integer = int(argument.GetSplit(1)) If AD IsNot "" Then @@ -151,7 +163,6 @@ End If - Dim args() As String = argument.Split(CChar(",")) For i = 0 To args.Length - 1 @@ -163,7 +174,20 @@ Case 3 musicLoop = args(i) Case 4 - introType = int(args(i)) + If args(i) <> "" Then + introType = int(args(i)) + End If + Case 5 + If args(i) <> "" Then + Select Case int(args(i)) + Case 0 + p.Gender = Pokemon.Genders.Male + Case 1 + p.Gender = Pokemon.Genders.Female + Case 2 + p.Gender = Pokemon.Genders.Genderless + End Select + End If End Select Next End If diff --git a/P3D/World/ActionScript/V2/ScriptConstructs/DoPokemon.vb b/P3D/World/ActionScript/V2/ScriptConstructs/DoPokemon.vb index 20450a68f..401719ec8 100644 --- a/P3D/World/ActionScript/V2/ScriptConstructs/DoPokemon.vb +++ b/P3D/World/ActionScript/V2/ScriptConstructs/DoPokemon.vb @@ -17,6 +17,19 @@ Case "data" Dim index As Integer = int(argument.GetSplit(0)) Return Core.Player.Pokemons(index).GetSaveData().Replace(",", "§").Replace("[", "«").Replace("]", "»") + Case "gender" + Dim index As Integer = int(argument.GetSplit(0)) + Return Core.Player.Pokemons(index).Gender + Case "genderchance" + Dim dexID As String = argument.GetSplit(0) + Dim dexAD As String = "" + If dexID.Contains("_") = True Then + dexAD = PokemonForms.GetAdditionalValueFromDataFile(dexID) + dexID = dexID.GetSplit(0, "_") + End If + Dim p As Pokemon = Pokemon.GetPokemonByID(CInt(dexID), dexAD) + + Return p.IsMale Case "level" Dim index As Integer = int(argument.GetSplit(0)) Return Core.Player.Pokemons(index).Level diff --git a/P3D/World/ActionScript/V2/ScriptLibrary.vb b/P3D/World/ActionScript/V2/ScriptLibrary.vb index 19be4d9c2..6b1f89d96 100644 --- a/P3D/World/ActionScript/V2/ScriptLibrary.vb +++ b/P3D/World/ActionScript/V2/ScriptLibrary.vb @@ -192,7 +192,8 @@ Namespace ScriptVersion2 New ScriptArgument("level", ScriptArgument.ArgumentTypes.Int), New ScriptArgument("shiny", ScriptArgument.ArgumentTypes.Int, True, "-1"), New ScriptArgument("musicloop", ScriptArgument.ArgumentTypes.Str, True, ""), - New ScriptArgument("introtype", ScriptArgument.ArgumentTypes.Int, True, "0-10")}.ToList(), "Initializes the battle with a wild Pokémon.")) + New ScriptArgument("introtype", ScriptArgument.ArgumentTypes.Int, True, "0-10"), + New ScriptArgument("gender", ScriptArgument.ArgumentTypes.Int, True, "")}.ToList(), "Initializes the battle with a wild Pokémon.")) r(New ScriptCommand("battle", "setvar", {New ScriptArgument("varName", ScriptArgument.ArgumentTypes.Str, {"canrun", "cancatch", "canblackout", "canreceiveexp", "canuseitems", "frontiertrainer", "divebattle", "inversebattle, custombattlemusic, hiddenabilitychance"}), New ScriptArgument("varValue", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Sets a battle value.")) ' Constructs: @@ -818,6 +819,8 @@ Namespace ScriptVersion2 r(New ScriptCommand("pokemon", "id", "int", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Returns the ID of a Pokémon in the player's party.", ",", True)) r(New ScriptCommand("pokemon", "number", "int", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Returns the ID of a Pokémon in the player's party.", ",", True)) r(New ScriptCommand("pokemon", "data", "pokemonData", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Returns the save data for a Pokémon in the player's party.", ",", True)) + r(New ScriptCommand("pokemon", "gender", "int", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Returns the gender for a Pokémon in the player's party.", ",", True)) + r(New ScriptCommand("pokemon", "genderchance", "int", {New ScriptArgument("pokemonID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Returns the Male/Female chance (1-100) of a Pokémon as defined by its Data file.", ",", True)) r(New ScriptCommand("pokemon", "level", "int", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Returns the level of a Pokémon in the player's party.", ",", True)) r(New ScriptCommand("pokemon", "hasfullhp", "bool", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Returns if a Pokémon in the player's party has a full Hit Point count.", ",", True)) r(New ScriptCommand("pokemon", "hp", "int", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Returns the Hit Points of a Pokémon in the player's party.", ",", True))