Fix some pokédex constructs and add 2 new ones...

Also update the scriptlibrary for dopokedex.
`<Pokedex.PokemonCaught(ID)>` Returns if the specified Pokémon has been caught.
`<Pokedex.PokemonSee(ID)>` Returns if the specified Pokémon has been seen.
This commit is contained in:
JappaWakka 2025-01-28 11:17:53 +01:00
parent 0022bf7455
commit 37cc3a7556
2 changed files with 102 additions and 20 deletions

View File

@ -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

View File

@ -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()