• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Sketch as a field move

v20.1 Sketch as a field move 2022-11-23

This resource pertains to version 20.1 of Pokémon Essentials.
Pokémon Essentials Version
v20.1 ➖
sketchfield.gif

Give players a little more freedom to teambuild by letting them Sketch off party members!

Code​

Unfortunately, this isn't really suited for a plug-and-play script. Luckily, it's not too much hassle to add.

These changes are in UI_Party. If you’re using a script that modifies the party UI, such as Deep_Blue’s BW UI, you’ll need to edit that script instead.

Find:
Ruby:
          next if !HiddenMoveHandlers.hasHandler(move.id) &&
                  ![:MILKDRINK, :SOFTBOILED].include?(move.id)
Add :SKETCH to the list of moves, like so-
Ruby:
          next if !HiddenMoveHandlers.hasHandler(move.id) &&
                  ![:MILKDRINK, :SOFTBOILED,:SKETCH].include?(move.id)
Below that, find the line:-

Ruby:
        elsif pbCanUseHiddenMove?(pkmn, move.id)

Right above that line, paste this:
Ruby:
        elsif move.id == :SKETCH
          if move.pp <= 0
            pbDisplay(_INTL("Not enough PP..."))
            next
          end
          @scene.pbSetHelpText(_INTL("Sketch from which Pokémon?"))
          old_party_idx = party_idx
          loop do
            @scene.pbPreSelect(old_party_idx)
            party_idx = @scene.pbChoosePokemon(true, party_idx)
            break if party_idx < 0
            newpkmn = @party[party_idx]
            movename = move.name
            if party_idx == old_party_idx
              pbDisplay(_INTL("{1} can't use {2} on itself!", pkmn.name, movename))
            elsif newpkmn.egg?
              pbDisplay(_INTL("{1} can't be used on an Egg!", movename))
            else
              newcommands = []
              newpkmn.moves.each do |move|
                newcommands.push(move.name)
              end
              newcommands.push("Cancel")
              newmove = @scene.pbShowCommands(_INTL("Sketch which of {1}'s moves?", newpkmn.name), newcommands)
              if newmove < (newcommands.length-1) && newmove > -1
                newmove = newpkmn.moves[newmove]
                if pkmn.hasMove?(newmove.id)
                    pbDisplay(_INTL("{1} already knows {2}.", pkmn.name, newmove.name))
                elsif newmove.type == :SHADOW
                    pbDisplay(_INTL("{1} can't be sketched.",newmove.name))
                elsif pbConfirm(_INTL("Sketch {1}?",newmove.name))
                  for i in 0..pkmn.moves.length
                    if pkmn.moves[i].id == :SKETCH
                      pkmn.moves[i] = Pokemon::Move.new(newmove.id)
                      break
                    end
                  end
                  pbRefresh
                  break
                else
                  @scene.pbSetHelpText(_INTL("Sketch from which Pokémon?"))
                end
              else
                @scene.pbSetHelpText(_INTL("Sketch from which Pokémon?"))
              end
            end
          end
          @scene.pbSelect(old_party_idx)
          pbRefresh
Can't be used on the user or on Eggs, and can't be used to teach Shadow moves or moves the user already knows. (Any other move is fair game - if you want to restrict certain moves, you'll have to add a blacklist yourself.) Requires 1PP to use.

Looking for more field moves?​

You may also be interested in Lucidious89's Improved Field Skills.
Credits
Credit to TechSkylander1518, please!
Author
TechSkylander1518
Views
1,661
First release
Last update
Rating
4.00 star(s) 1 ratings

More resources from TechSkylander1518

Back
Top