From 3f1b7ffc0cb28f45aed65edc551ed5c177bf6769 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Wed, 27 Dec 2023 17:13:00 +0100 Subject: [PATCH] Added @Pokemon.Ride([pokeIndex[) command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Pokemon.Ride([pokeIndex]) Makes a Pokémon in the player's party use the field move Ride. If the argument is left empty, the first Pokémon who knows Ride gets selected. pokeIndex (int) [optional, defaults to -1] = the party index of a Pokémon --- .../V2/ScriptCommands/DoPokemon.vb | 65 +++++++++++++++++++ P3D/World/ActionScript/V2/ScriptLibrary.vb | 1 + 2 files changed, 66 insertions(+) diff --git a/P3D/World/ActionScript/V2/ScriptCommands/DoPokemon.vb b/P3D/World/ActionScript/V2/ScriptCommands/DoPokemon.vb index 3380c5d31..633075e99 100644 --- a/P3D/World/ActionScript/V2/ScriptCommands/DoPokemon.vb +++ b/P3D/World/ActionScript/V2/ScriptCommands/DoPokemon.vb @@ -1054,6 +1054,71 @@ Core.Player.Pokemons(Index).HP = 0 End If End If + Case "ride" + Dim Index As Integer = -1 + If argument <> "" Then + If Core.Player.Pokemons(Index).KnowsMove(BattleSystem.Attack.GetAttackByID(560)) = False Then + Logger.Log(Logger.LogTypes.ErrorMessage, "The specified Pokémon does not know the move Ride. The specified index is: " & Index.ToString & ".") + Else + Index = CInt(argument) + End If + End If + + If Index = -1 Then + For p = 0 To Core.Player.Pokemons.Count - 1 + If Core.Player.Pokemons(p).KnowsMove(BattleSystem.Attack.GetAttackByID(560)) Then + Index = p + Exit For + End If + Next + End If + + If Index <> -1 Then + If Screen.Level.Riding = True Then + If Screen.Level.RideType = 3 Then + Screen.TextBox.Show(Localization.GetString("fieldmove_ride_cannot_walk", "You cannot walk here!"), {}, True, False) + Else + Screen.Level.Riding = False + Screen.Level.OwnPlayer.SetTexture(Core.Player.TempRideSkin, True) + Core.Player.Skin = Core.Player.TempRideSkin + Screen.ChooseBox.Showing = False + + + If Screen.Level.IsRadioOn = False OrElse GameJolt.PokegearScreen.StationCanPlay(Screen.Level.SelectedRadioStation) = False Then + MusicManager.Play(Screen.Level.MusicLoop, True, 0.01F) + End If + End If + Else + If Screen.Level.Surfing = False And Screen.Camera.IsMoving() = False And Screen.Camera.Turning = False And Screen.Level.CanRide() = True Then + Screen.ChooseBox.Showing = False + + Screen.Level.Riding = True + Core.Player.TempRideSkin = Core.Player.Skin + + Dim skin As String = "[POKEMON|" + If Core.Player.Pokemons(Index).IsShiny = True Then + skin &= "S]" + Else + skin &= "N]" + End If + skin &= Core.Player.Pokemons(Index).Number & PokemonForms.GetOverworldAddition(Core.Player.Pokemons(Index)) + + Screen.Level.OwnPlayer.SetTexture(skin, False) + + SoundManager.PlayPokemonCry(Core.Player.Pokemons(Index).Number) + + Screen.TextBox.Show(Core.Player.Pokemons(Index).GetDisplayName() & " " & Localization.GetString("fieldmove_ride_used", "used~Ride!"), {}, True, False) + PlayerStatistics.Track("Ride used", 1) + + If Screen.Level.IsRadioOn = False OrElse GameJolt.PokegearScreen.StationCanPlay(Screen.Level.SelectedRadioStation) = False Then + MusicManager.Play("ride", True) + End If + Else + Screen.TextBox.Show(Localization.GetString("fieldmove_ride_cannot_ride", "You cannot Ride here!"), {}, True, False) + End If + 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 69859bf55..ee23c0cc6 100644 --- a/P3D/World/ActionScript/V2/ScriptLibrary.vb +++ b/P3D/World/ActionScript/V2/ScriptLibrary.vb @@ -826,6 +826,7 @@ Namespace ScriptVersion2 New ScriptArgument("trainerName", ScriptArgument.ArgumentTypes.Str, True, "Current TrainerName"), New ScriptArgument("heldItemID", ScriptArgument.ArgumentTypes.Int, True, "0"), New ScriptArgument("isShiny", ScriptArgument.ArgumentTypes.Bool, True, "false")}.ToList(), "Adds a Pokémon with the given Pokémon properties to the storage system.")) + r(New ScriptCommand("pokemon", "ride", {New ScriptArgument("pokemonID", ScriptArgument.ArgumentTypes.Int, True, "-1")}.ToList(), "Makes a Pokémon in the player's party use the field move Ride. If the argument is left empty, the first Pokémon who knows Ride gets selected.")) ' Constructs: