From 2a869e0b4bcb9aa16636d1e1bb0712a171faaa28 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Mon, 4 Dec 2023 19:05:31 +0100 Subject: [PATCH] Added @Pokemon.SetStatus(index,status) command... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Pokemon.SetStatus(index,status) index = Index of the Pokémon in the player's party status = the desired status to give the Pokémon (possible values: "brn", "frz", "prz", "psn", "bpsn", "slp", "fnt") --- .../V2/ScriptCommands/DoPokemon.vb | 25 +++++++++++++++++++ P3D/World/ActionScript/V2/ScriptLibrary.vb | 4 ++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/P3D/World/ActionScript/V2/ScriptCommands/DoPokemon.vb b/P3D/World/ActionScript/V2/ScriptCommands/DoPokemon.vb index b5267a731..931a1ba37 100644 --- a/P3D/World/ActionScript/V2/ScriptCommands/DoPokemon.vb +++ b/P3D/World/ActionScript/V2/ScriptCommands/DoPokemon.vb @@ -1025,6 +1025,31 @@ SetScreen(New TransitionScreen(CType(CurrentScreen, OverworldScreen), New HatchEggScreen(CType(CurrentScreen, OverworldScreen), {Pokemon}.ToList, CanRename, Message), Color.White, False)) CanContinue = False End If + Case "setstatus" + Dim Index As Integer = int(argument.GetSplit(0, ",")) + Dim Status As Pokemon.StatusProblems = Nothing + Select Case argument.GetSplit(1, ",") + Case "brn" + Status = Pokemon.StatusProblems.Burn + Case "frz" + Status = Pokemon.StatusProblems.Freeze + Case "prz" + Status = Pokemon.StatusProblems.Paralyzed + Case "psn" + Status = Pokemon.StatusProblems.Poison + Case "bpsn" + Status = Pokemon.StatusProblems.BadPoison + Case "slp" + Status = Pokemon.StatusProblems.Sleep + Case "fnt" + Status = Pokemon.StatusProblems.Fainted + End Select + If Status <> Nothing AndAlso Core.Player.Pokemons.Count - 1 >= Index Then + Core.Player.Pokemons(Index).Status = Status + If Status = Pokemon.StatusProblems.Fainted Then + Core.Player.Pokemons(Index).HP = 0 + End If + End If End Select IsReady = True diff --git a/P3D/World/ActionScript/V2/ScriptLibrary.vb b/P3D/World/ActionScript/V2/ScriptLibrary.vb index 18265ec6e..2aab56477 100644 --- a/P3D/World/ActionScript/V2/ScriptLibrary.vb +++ b/P3D/World/ActionScript/V2/ScriptLibrary.vb @@ -786,7 +786,7 @@ Namespace ScriptVersion2 r(New ScriptCommand("pokemon", "setot", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int), New ScriptArgument("newOT", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Sets the Original Trainer of a Pokémon in the player's party.")) r(New ScriptCommand("pokemon", "setitem", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int), - New ScriptArgument("itemID", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Sets the item of a Pokémon in the player's party.")) + New ScriptArgument("itemID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Sets the item of a Pokémon in the player's party.")) r(New ScriptCommand("pokemon", "setitemData", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int), New ScriptArgument("itemData", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Sets the data of the item of a Pokémon in the player's party.")) r(New ScriptCommand("pokemon", "setcatchtrainer", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int), @@ -799,6 +799,8 @@ Namespace ScriptVersion2 New ScriptArgument("location", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Sets the Catch Location of a Pokémon in the player's party.")) r(New ScriptCommand("pokemon", "setcatchlocation", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int), New ScriptArgument("location", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Sets the Catch Location of a Pokémon in the player's party.")) + r(New ScriptCommand("pokemon", "setstatus", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int), + New ScriptArgument("status", ScriptArgument.ArgumentTypes.Str, {"brn", "frz", "prz", "psn", "bpsn", "slp", "fnt"})}.ToList(), "Sets the status of a Pokémon in the player's party. Setting that to ""fnt"" (Fainted) will also set the Pokémon's HP to 0.")) r(New ScriptCommand("pokemon", "newroaming", {New ScriptArgument("pokemonID", ScriptArgument.ArgumentTypes.Int), New ScriptArgument("level", ScriptArgument.ArgumentTypes.Int), New ScriptArgument("regionID", ScriptArgument.ArgumentTypes.Int),