Bounce as a field move

Bounce as a field move

Pokémon Essentials Version
v18.1 ✅
Jumping.gif

My quest for more overworld moves continues with bounce! This lets the player use Bounce to get the ability to jump over the tile directly in front of them! (Provided they can stand on the next tile, of course)


Using Bounce

I chose Alt for jumping, because it's near the space bar but isn't already used for anything else. If you want to change that, it's easy to just look in PSystem_Control and see what other keys are already programmed, or use Marin's tutorial on adding input keys to add more.

Bounce can't be used while surfing, to jump across a counter, or while on a bridge. (You can still jump under bridges, though) You can jump over a trainer's line of sight, but if you land in front of them, they will see you. Poisoned Pokémon will still take damage, and wild encounters can still be triggered if the player lands in grass or a cave. Egg will still have their steps decreased by jumps, but it will only be by one.

The player will still trigger events that they land on, provided that they're intended to be stepped on and not like, NPCs or item balls or the like.

Installing this resource
There's a few steps to this process!

In PField_Field, add this to the bottom:

Ruby:
#===============================================================================
# Bounce
#===============================================================================

def pbBounce
    new_x = $game_player.x + ($game_player.direction == 6 ? 1 : $game_player.direction == 4 ? -1 : 0)
    new_y = $game_player.y + ($game_player.direction == 2 ? 1 : $game_player.direction == 8 ? -1 : 0)
  if Input.trigger?(Input::ALT) && !$PokemonGlobal.surfing &&
    !$game_player.moving? && !$game_system.map_interpreter.running? &&
    !PBTerrain.isBridge?(pbGetTerrainTag($game_player)) && $PokemonMap.bounceUsed &&
    !$game_map.counter?(new_x, new_y)
    pbBridgeOn  
    if !PBTerrain.isBridge?(pbFacingTerrainTag)
        pbMoveRoute($game_player,[PBMoveRoute::AlwaysOnTopOn])
      end
      pbBridgeOff
  if  pbJumpToward(2,true)
      $scene.spriteset.addUserAnimation(DUST_ANIMATION_ID,$game_player.x,$game_player.y,true,1)
      $game_player.increase_steps
       if !PBTerrain.isGrass?($game_map.terrain_tag($game_player.x,$game_player.y)) && !pbGetEnvironment==PBEnvironment::Cave
        $PokemonEncounters.clearStepCount
       end
      $game_player.check_event_trigger_here([1,2])
      Graphics.update
      Input.update
      pbUpdateSceneMap
    end
  pbMoveRoute($game_player,[PBMoveRoute::AlwaysOnTopOff])
  end
end

In PField_FieldMoves, add this at the bottom:
Ruby:
#===============================================================================
# Bounce
#===============================================================================


HiddenMoveHandlers::CanUseMove.add(:BOUNCE,proc { |move,pkmn,showmsg|
  if $PokemonMap.bounceUsed
    pbMessage(_INTL("Bounce is already being used.")) if showmsg
    next false
  end
  if $PokemonGlobal.surfing
    pbMessage(_INTL("Can't do that while surfing.")) if showmsg
    next false
  end
  next true
})

HiddenMoveHandlers::UseMove.add(:BOUNCE,proc { |move,pokemon|
  if !pbHiddenMoveAnimation(pokemon)
    pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
  end
    pbMessage(_INTL("{1} made it possible to jump with the Alt key!",pokemon.name))
    $PokemonMap.bounceUsed=true
  next true
})

Go to PField_Metadata and find:
Ruby:
class PokemonMapMetadata
  attr_reader :erasedEvents
  attr_reader :movedEvents
  attr_accessor :strengthUsed
  attr_accessor :blackFluteUsed
  attr_accessor :whiteFluteUsed
Below that, add:
Ruby:
  attr_accessor :bounceUsed
Ruby:
  def clear
    @erasedEvents   = {}
    @movedEvents    = {}
    @strengthUsed   = false
    @blackFluteUsed = false
    @whiteFluteUsed = false
  end
Right before "end", add
Ruby:
    @bounceUsed     = false

And one final step: Create a common event set to parallel process. It should just run pbBounce, and its condition switch should be something you intend to leave On, like access to the PokeDex.
1611625064084.png

(Apologies for this step- I know it's really weird, but when I playtested without this, sometimes the functionality would cut out, and this was the only fix I could find.)


When to give the player Bounce
When the player receives Bounce, they're going to be given a way around a lot of obstacles. Not only will Bounce make Cut and Rock Smash near-obsolete, it will also let them skip past trainers and ledges, as well as possibly giving them ways around Strength and Ice Puzzles. Because of this, I personally recommend you give Bounce to the player in the postgame, so your whole game doesn't become a cakewalk. (Alternatively, if you want to let them use Bounce in battle but not in the overworld, you could add in another switch to control when they're allowed to use it, like a gym badge)

There's another issue with Bounce- The player can use Bounce to jump over tiles that would trigger a roadblock event.
Leaving.gif
You could definitely work around this, but that would mean putting two sets of roadblocks every time you want to keep the player somewhere. That sounds really annoying to me, so I'd definitely want to cut down on how often I had to do that lol. The later in the game you give it, the less you have to worry about it!

Known Issues:
  • If you jump into grass/a cave and an encounter starts, the dust cloud animation will still be going when you exit the battle.
  • Jumping behind a large object like a building can look a bit clippy. I also recommend giving the tiles below the top row of the building increased priority, so the player doesn't clip through those.
  • I had a problem earlier where jumping out of grass could still trigger an encounter. As far as I know, that has been fixed, but let me know if you encounter it!

Ideas with Bounce
For the most part, Bounce will kind of serve as this catch-all field move, but there's some things you could do to make it more unique!
  • Get rid of my check for the counter, and let the player hop over whatever counters they want! Maybe there's a secret backroom in the PokéMart, or they can watch someone else fighting in a battle facility!
  • Create events that work as projectiles and let the player jump over them! Maybe a Fire-type legendary spits fireballs at you, and you have to get past them to be able to battle it!
  • We all know about holes to let the player fall through to the floor below, but why not let the player jump over safety railings to fall somewhere unique? Just put an event on the other side of some guardrails!
Credits
Credits to TechSkylander1518, please!
Author
TechSkylander1518
Views
453
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from TechSkylander1518

Top