# Recovery moves as overworld moves

Pokémon Essentials Version
I made this for messi3d on this thread, but I figured it'd be easier to put it in resources if anyone else is looking for it!

Moves like these affect the party rather than the overworld, so we need to define them in PScreen_Party. Locate this part of the code:
Ruby:
        if !pkmn.egg? && (isConst?(move.id,PBMoves,:MILKDRINK) ||
isConst?(move.id,PBMoves,:SOFTBOILED) ||
HiddenMoveHandlers.hasHandler(move.id))

This defines all moves that will appear as commands. To make another move appear as a command, just add it to the list- for example:
Ruby:
        if !pkmn.egg? && (isConst?(move.id,PBMoves,:MILKDRINK) ||
isConst?(move.id,PBMoves,:SOFTBOILED) ||
isConst?(move.id,PBMoves,:ROOST) ||
HiddenMoveHandlers.hasHandler(move.id))

However, this is only the part that makes the command appear. For the actual function, we have to go a little further down.

Ruby:
            @scene.pbSelect(oldpkmnid)
pbRefresh
break
elsif pbCanUseHiddenMove?(pkmn,pkmn.moves[i].id)
if pbConfirmUseHiddenMove(pkmn,pkmn.moves[i].id)
That "elsif" is setting up the commands for Hidden Moves, right after the code for Softboiled/Milk Drink has been completed. So we'll put our new code right in between them.
Ruby:
            @scene.pbSelect(oldpkmnid)
pbRefresh
break
#CODEGOESHERE
elsif pbCanUseHiddenMove?(pkmn,pkmn.moves[i].id)
if pbConfirmUseHiddenMove(pkmn,pkmn.moves[i].id)
Moves that heal the user
Ruby:
          elsif isConst?(pkmn.moves[i].id,PBMoves,:ROOST) ||
isConst?(pkmn.moves[i].id,PBMoves,:RECOVER)
amt = [(pkmn.totalhp/5).floor,1].max
if pkmn.hp==0 || pkmn.hp==pkmn.totalhp
movename = PBMoves.getName(pkmn.moves[i].id)
pbDisplay(_INTL("{1} can't be used.",movename))
@scene.pbSelect(pkmnid)
break
end
if pkmn.moves[i].pp<=1
pbDisplay(_INTL("Not enough PP..."))
break
end
pkmn.moves[i].pp -= 1
hpgain = pbItemRestoreHP(pkmn,amt)
@scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",pkmn.name,hpgain))
pbRefresh
@scene.pbSelect(pkmnid)
pbRefresh
break
• This move can't be used while the Pokemon is fainted or at full health. It also only works on the user.
• Using this move outside of battle will deplete 1PP from the move. If you'd like to change this, change pkmn.moves.pp -= 1
• If you paste this code in as it is, only Roost and Recover will work this way. You can add more moves in the same way that you added them in the first step, adding isConst?(pkmn.moves.id,PBMoves,:MOVE) to the list here.
• These moves will heal by 1/5th of the user's max HP. If you'd like to change that, change amt = [(pkmn.totalhp/5).floor,1].max. If you'd like different moves to have different amounts, set up a condition for amt.

Ruby:
          if isConst?(pkmn.moves[i].id,PBMoves,:ROOST)
amt = [(pkmn.totalhp/5).floor,1].max
elsif  isConst?(pkmn.moves[i].id,PBMoves,:RECOVER)
amt = [(pkmn.totalhp/2).floor,1].max
end

Moves that cure the party's status effects
Ruby:
          elsif isConst?(pkmn.moves[i].id,PBMoves,:HEALBELL)
if pkmn.hp==0
movename = PBMoves.getName(pkmn.moves[i].id)
pbDisplay(_INTL("{1} can't be used.",movename))
@scene.pbSelect(pkmnid)
break
end
moveno = i
oldpkmnid = pkmnid
cured = 0
for i in 0...party.length
newpkmn = @party[i]
if newpkmn.status!=0
newpkmn.healStatus
else
cured+=1
end
end
if cured==party.length
pbDisplay(_INTL("Nobody has any status effects!"))
@scene.pbSelect(oldpkmnid)
pbRefresh
else
pkmn.moves[moveno].pp -= 1
pbDisplay(_INTL("Everyone's status effects were cured!"))
@scene.pbSelect(oldpkmnid)
pbRefresh
break
end

Same deal as the recovery moves! Depletes 1PP outside of battle, can't be used if there's no need for it or if the user is fainted! This is only set up for Heal Bell, but adding Aromatherapy should be a cinch!

Looking for more overworld moves?
• This script lets you use weather-summoning moves to affect the weather of a map!
• This script lets a move work as a move reminder!
Credits
Credits to TechSkylander1518, please!
Author
TechSkylander1518
Views
386
First release
Last update
Rating
0 ratings