diff --git a/P3D/World/ActionScript/V2/ScriptConstructs/DoPokedex.vb b/P3D/World/ActionScript/V2/ScriptConstructs/DoPokedex.vb index 4d103c267..b917936b0 100644 --- a/P3D/World/ActionScript/V2/ScriptConstructs/DoPokedex.vb +++ b/P3D/World/ActionScript/V2/ScriptConstructs/DoPokedex.vb @@ -24,72 +24,114 @@ Dim dexIndex As Integer = int(argument) Return Core.Player.Pokedexes(dexIndex).Seen + Core.Player.Pokedexes(dexIndex).Obtained Case "getheight" - Dim id As Integer = CInt(argument.GetSplit(0, "_").GetSplit(0, ";")) + Dim id As Integer = CInt(argument.GetSplit(0, ",").GetSplit(0, "_").GetSplit(0, ";")) Dim ad As String = "" - If PokemonForms.GetAdditionalValueFromDataFile(argument) <> "" Then + Dim dexID As String = argument + If argument.Contains(";") Then + If Pokemon.PokemonDataExists(argument) = False Then + dexID = argument.GetSplit(0, ";") + End If + ad = argument.GetSplit(1, ";") + ElseIf argument.Contains("_") Then ad = PokemonForms.GetAdditionalValueFromDataFile(argument) End If - If Pokemon.PokemonDataExists(argument) Then + If Pokemon.PokemonDataExists(dexID) Then Return Pokemon.GetPokemonByID(id, ad).PokedexEntry.Height End If Case "getweight" - Dim id As Integer = CInt(argument.GetSplit(0, "_").GetSplit(0, ";")) + Dim id As Integer = CInt(argument.GetSplit(0, ",").GetSplit(0, "_").GetSplit(0, ";")) Dim ad As String = "" - If PokemonForms.GetAdditionalValueFromDataFile(argument) <> "" Then + Dim dexID As String = argument + If argument.Contains(";") Then + If Pokemon.PokemonDataExists(argument) = False Then + dexID = argument.GetSplit(0, ";") + End If + ad = argument.GetSplit(1, ";") + ElseIf argument.Contains("_") Then ad = PokemonForms.GetAdditionalValueFromDataFile(argument) End If - If Pokemon.PokemonDataExists(argument) Then + If Pokemon.PokemonDataExists(dexID) Then Return Pokemon.GetPokemonByID(id, ad).PokedexEntry.Weight End If Case "getentry" - Dim id As Integer = CInt(argument.GetSplit(0, "_").GetSplit(0, ";")) + Dim id As Integer = CInt(argument.GetSplit(0, ",").GetSplit(0, "_").GetSplit(0, ";")) Dim ad As String = "" - If PokemonForms.GetAdditionalValueFromDataFile(argument) <> "" Then + Dim dexID As String = argument + If argument.Contains(";") Then + If Pokemon.PokemonDataExists(argument) = False Then + dexID = argument.GetSplit(0, ";") + End If + ad = argument.GetSplit(1, ";") + ElseIf argument.Contains("_") Then ad = PokemonForms.GetAdditionalValueFromDataFile(argument) End If - If Pokemon.PokemonDataExists(argument) Then + If Pokemon.PokemonDataExists(dexID) Then Return Pokemon.GetPokemonByID(id, ad).PokedexEntry.Text End If Case "getcolor" - Dim id As Integer = CInt(argument.GetSplit(0, "_").GetSplit(0, ";")) + Dim id As Integer = CInt(argument.GetSplit(0, ",").GetSplit(0, "_").GetSplit(0, ";")) Dim ad As String = "" - If PokemonForms.GetAdditionalValueFromDataFile(argument) <> "" Then + Dim dexID As String = argument + If argument.Contains(";") Then + If Pokemon.PokemonDataExists(argument) = False Then + dexID = argument.GetSplit(0, ";") + End If + ad = argument.GetSplit(1, ";") + ElseIf argument.Contains("_") Then ad = PokemonForms.GetAdditionalValueFromDataFile(argument) End If - If Pokemon.PokemonDataExists(argument) Then + If Pokemon.PokemonDataExists(dexID) Then Return Pokemon.GetPokemonByID(id, ad).PokedexEntry.Color.ToString() End If Case "getspecies" - Dim id As Integer = CInt(argument.GetSplit(0, "_").GetSplit(0, ";")) + Dim id As Integer = CInt(argument.GetSplit(0, ",").GetSplit(0, "_").GetSplit(0, ";")) Dim ad As String = "" - If PokemonForms.GetAdditionalValueFromDataFile(argument) <> "" Then + Dim dexID As String = argument + If argument.Contains(";") Then + If Pokemon.PokemonDataExists(argument) = False Then + dexID = argument.GetSplit(0, ";") + End If + ad = argument.GetSplit(1, ";") + ElseIf argument.Contains("_") Then ad = PokemonForms.GetAdditionalValueFromDataFile(argument) End If - If Pokemon.PokemonDataExists(argument) Then + If Pokemon.PokemonDataExists(dexID) Then Return Pokemon.GetPokemonByID(id, ad).PokedexEntry.Species End If Case "getname" - Dim id As Integer = CInt(argument.GetSplit(0, "_").GetSplit(0, ";")) + Dim id As Integer = CInt(argument.GetSplit(0, ",").GetSplit(0, "_").GetSplit(0, ";")) Dim ad As String = "" - If PokemonForms.GetAdditionalValueFromDataFile(argument) <> "" Then + Dim dexID As String = argument + If argument.Contains(";") Then + If Pokemon.PokemonDataExists(argument) = False Then + dexID = argument.GetSplit(0, ";") + End If + ad = argument.GetSplit(1, ";") + ElseIf argument.Contains("_") Then ad = PokemonForms.GetAdditionalValueFromDataFile(argument) End If - If Pokemon.PokemonDataExists(argument) Then + If Pokemon.PokemonDataExists(dexID) Then Return Pokemon.GetPokemonByID(id, ad).GetName() End If Case "getability" Dim id As Integer = CInt(argument.GetSplit(0, ",").GetSplit(0, "_").GetSplit(0, ";")) Dim ad As String = "" - If PokemonForms.GetAdditionalValueFromDataFile(argument.GetSplit(0, ",").GetSplit(0, ";")) <> "" Then + Dim dexID As String = argument + If argument.Contains(";") Then + If Pokemon.PokemonDataExists(argument) = False Then + dexID = argument.GetSplit(0, ";") + End If + ad = argument.GetSplit(1, ";") + ElseIf argument.Contains("_") Then ad = PokemonForms.GetAdditionalValueFromDataFile(argument) End If - If Pokemon.PokemonDataExists(argument.GetSplit(0, ",")) Then + If Pokemon.PokemonDataExists(dexID.GetSplit(0, ",")) Then Select Case argument.GetSplit(1) Case "0" Return Pokemon.GetPokemonByID(id, ad).NewAbilities(Core.Random.Next(0, Pokemon.GetPokemonByID(id, ad).NewAbilities.Count)).ID @@ -102,6 +144,36 @@ End Select End If + Case "pokemoncaught" + Dim dexID As String = argument + If argument.Contains(";") Then + If Pokemon.PokemonDataExists(argument) = False Then + dexID = argument.GetSplit(0, ";") + End If + End If + If Pokemon.PokemonDataExists(dexID) Then + If Pokedex.GetEntryType(Core.Player.PokedexData, dexID) > 1 Then + Return ReturnBoolean(True) + Else + Return ReturnBoolean(False) + End If + + End If + Case "pokemonseen" + Dim dexID As String = argument + If argument.Contains(";") Then + If Pokemon.PokemonDataExists(argument) = False Then + dexID = argument.GetSplit(0, ";") + End If + End If + If Pokemon.PokemonDataExists(dexID) Then + If Pokedex.GetEntryType(Core.Player.PokedexData, dexID) > 0 Then + Return ReturnBoolean(True) + Else + Return ReturnBoolean(False) + End If + + End If End Select Return DEFAULTNULL diff --git a/P3D/World/ActionScript/V2/ScriptLibrary.vb b/P3D/World/ActionScript/V2/ScriptLibrary.vb index f16d531f9..7196b3d75 100644 --- a/P3D/World/ActionScript/V2/ScriptLibrary.vb +++ b/P3D/World/ActionScript/V2/ScriptLibrary.vb @@ -632,12 +632,22 @@ Namespace ScriptVersion2 Private Shared Sub DoPokedex() ' Commands: r(New ScriptCommand("pokedex", "setautodetect", {New ScriptArgument("autodetect", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets if the Pokédex registers seen Pokémon in wild or trainer battles.")) + r(New ScriptCommand("pokedex", "changeentry", {New ScriptArgument("ID", ScriptArgument.ArgumentTypes.Str), New ScriptArgument("Type", ScriptArgument.ArgumentTypes.Int), New ScriptArgument("ForceChange", ScriptArgument.ArgumentTypes.Bool, True, "false")}.ToList(), "Changes a Pokédex Entry.")) ' Constructs: r(New ScriptCommand("pokedex", "caught", "int", "Returns the amount of Pokémon registered as caught by the player.", "", True)) r(New ScriptCommand("pokedex", "seen", "int", "Returns the amount of Pokémon registered as seen by the player.", "", True)) r(New ScriptCommand("pokedex", "shiny", "int", "Returns the amount of Pokémon registered as Shiny by the player.", "", True)) r(New ScriptCommand("pokedex", "dexcaught", "int", {New ScriptArgument("dexIndex", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Returns the amount of Pokémon registered as caught by the player for a specific Pokédex.", "", True)) r(New ScriptCommand("pokedex", "dexseen", "int", {New ScriptArgument("dexIndex", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Returns the amount of Pokémon registered as seen by the player for a specific Pokédex.", "", True)) + r(New ScriptCommand("pokedex", "getheight", "sng", {New ScriptArgument("ID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Returns the height of the Pokémon.", "", True)) + r(New ScriptCommand("pokedex", "getweight", "sng", {New ScriptArgument("ID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Returns the weight of the Pokémon.", "", True)) + r(New ScriptCommand("pokedex", "getentry", "str", {New ScriptArgument("ID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Returns the description of the Pokémon.", "", True)) + r(New ScriptCommand("pokedex", "getspecies", "str", {New ScriptArgument("ID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Returns the species of the Pokémon.", "", True)) + r(New ScriptCommand("pokedex", "getname", "str", {New ScriptArgument("ID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Returns the name of the Pokémon.", "", True)) + r(New ScriptCommand("pokedex", "getability", "int", {New ScriptArgument("ID", ScriptArgument.ArgumentTypes.Str), New ScriptArgument("requestType", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Returns one of the abilities of the Pokémon based on the requestType. 0 = random 1st or 2nd, 1 = first ability, 2 = second ability, 3 = hidden ability.", "", True)) + r(New ScriptCommand("pokedex", "pokemoncaught", "bool", {New ScriptArgument("ID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Returns if the specified Pokémon has been caught.", "", True)) + r(New ScriptCommand("pokedex", "pokemonseen", "bool", {New ScriptArgument("ID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Returns if the specified Pokémon has been seen.", "", True)) + End Sub Private Shared Sub DoMath()