Add construct <Pokemon.FullyHealed([partyID])>

Checks if a specific Pokémon or all Pokémon in the party are fully healed.
This commit is contained in:
JappaWakka 2024-04-21 09:10:23 +02:00
parent 9f7b722bcf
commit 86428f8055
2 changed files with 36 additions and 0 deletions

View File

@ -524,6 +524,41 @@
End If
Next
Return ReturnBoolean(False)
Case "fullyhealed"
Dim IsFullyHealed As Boolean = True
If argument = "" Then
For Each pokemon As Pokemon In Core.Player.Pokemons
If pokemon.Attacks.Count > 0 Then
For d = 0 To pokemon.Attacks.Count - 1
If pokemon.Attacks(d).CurrentPP < pokemon.Attacks(d).MaxPP Then
IsFullyHealed = False
End If
Next
End If
If pokemon.HP < pokemon.MaxHP Then
IsFullyHealed = False
End If
If pokemon.Status <> Pokemon.StatusProblems.None Then
IsFullyHealed = False
End If
Next
Else
Dim pokemon As Pokemon = Core.Player.Pokemons(CInt(argument))
If pokemon.Attacks.Count > 0 Then
For d = 0 To pokemon.Attacks.Count - 1
If pokemon.Attacks(d).CurrentPP < pokemon.Attacks(d).MaxPP Then
IsFullyHealed = False
End If
Next
End If
If pokemon.HP < pokemon.MaxHP Then
IsFullyHealed = False
End If
If pokemon.Status <> Pokemon.StatusProblems.None Then
IsFullyHealed = False
End If
End If
Return ReturnBoolean(IsFullyHealed)
End Select
Return DEFAULTNULL
End Function

View File

@ -920,6 +920,7 @@ Namespace ScriptVersion2
r(New ScriptCommand("pokemon", "istype", "bool", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int),
New ScriptArgument("type", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Checks if a Pokémon in the player's party has a specific type.", ",", True))
r(New ScriptCommand("pokemon", "IsRoaming", "bool", {New ScriptArgument("roamerID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Checks if the given roaming Pokémon is still active.", ",", True))
r(New ScriptCommand("pokemon", "FullyHealed", "bool", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Str, True, "")}.ToList(), "Checks if a specific Pokémon or all Pokémon in the party are fully healed.", ",", True))
End Sub