If you are tired of teaching Surf to your Gyarados and ruin his physical moveset this script is perfect for you.
Instead of checking the moveset of your party for any learned field move, you can instead check the compatibility with this moves.
So in this way Gyarados can freely use Surf, Strength, Rocksmash, Dive and Waterfall without wasting any move slot
Code for v.19.1
- Starting point
Put this code above main
- Set the moves list on the Pokemon menu in the party screen
In UI_Party change
With
- Change how field moves work in the overworld
In Trainer change the entirety of get_pokemon_with_move with
Code for v.18
- Starting point
Put this code above main
- Set the moves list on the Pokemon menu in the party screen
In PScreen_Party change
With
- Change how field moves work in the overworld
In PSystem_PokemonUtilities change the entirety of pbCheckMove with this code
Add these in tm.txt if you wanna use softboiled, milkdrink, teleport and sweetscent
[SOFTBOILED]
CLEFAIRY,CLEFABLE,CHANSEY,MEW,CLEFFA,TOGEPI,TOGETIC,BLISSEY,HAPPINY,TOGEKISS
[MILKDRINK]
MILTANK
[SWEETSCENT]
BULBASAUR,IVYSAUR,VENUSAUR,BUTTERFREE,BEEDRILL,ODDISH,GLOOM,VILEPLUME,PARAS,PARASECT,VENONAT,VENOMOTH,BELLSPROUT,WEEPINBELL,VICTREEBEL,EXEGGCUTE,EXEGGUTOR,CHANSEY,TANGELA,JYNX,MEW,CHIKORITA,BAYLEEF,MEGANIUM,LEDYBA,LEDIAN,BELLOSSOM,HOPPIP,SKIPLOOM,JUMPLUFF,SUNKERN,SUNFLORA,PINECO,FORRETRESS,SHUCKLE,TEDDIURSA,URSARING,SMOOCHUM,MILTANK,BLISSEY,CELEBI,LOTAD,LOMBRE,LUDICOLO,SURSKIT,MASQUERAIN,MAWILE,ILLUMISE,ROSELIA,TROPIUS,ROSERADE,COMBEE,VESPIQUEN,CHERUBI,CHERRIM,HAPPINY,CARNIVINE,TANGROWTH,SHAYMIN,SNIVY,SERVINE,SERPERIOR,PETILIL,LILLIGANT,MARACTUS,FOONGUS,AMOONGUSS
[TELEPORT]
ABRA,KADABRA,ALAKAZAM,MEWTWO,MEW,NATU,XATU,RALTS,KIRLIA,GARDEVOIR,CLAYDOL,DEOXYS,GALLADE,ELGYEM,BEHEEYEM
Code for v.17
- Starting point
Put this code above main
- Set the moves list on the Pokemon menu in the party screen
In PScreen_Party change
With
- Change how field moves work in the overworld
In PSystem_PokemonUtilities change the entirety of pbCheckMove with this code
-- Edit 25/09/20: Added support to v.18
-- Edit 01/11/21: Added support to v.19.1
Instead of checking the moveset of your party for any learned field move, you can instead check the compatibility with this moves.
So in this way Gyarados can freely use Surf, Strength, Rocksmash, Dive and Waterfall without wasting any move slot
Code for v.19.1
Spoiler:
- Starting point
Spoiler:
Put this code above main
Code:
#===============================================================================
# * Field moves defined by species - by Lexor
#===============================================================================
#
# This script make the field moves (cut, fly, ...) usable by simply check
# if the Pokemon can learn that move instead of check the moveset
#
# NOTE: You must insert add the TM/HM moves like softboiled and teleport
# in pokemon.txt in the TutorMove field if you want to make them usable
#
# If you wanna add a new field move, after defined in Overworld_FieldMoves their
# code, add in the returned array in getFieldMoves a new element:
#
# GameData::Move.get(:"INTERNAL MOVE NAME")
#
#===============================================================================
def getFieldMoves()
return [GameData::Move.get(:CUT),
GameData::Move.get(:FLY),
GameData::Move.get(:SURF),
GameData::Move.get(:STRENGTH),
GameData::Move.get(:FLASH),
GameData::Move.get(:ROCKSMASH),
GameData::Move.get(:DIVE),
GameData::Move.get(:WATERFALL),
GameData::Move.get(:DIG),
GameData::Move.get(:SOFTBOILED),
GameData::Move.get(:MILKDRINK),
GameData::Move.get(:HEADBUTT),
GameData::Move.get(:TELEPORT),
GameData::Move.get(:SWEETSCENT)
]
end
- Set the moves list on the Pokemon menu in the party screen
Spoiler:
In UI_Party change
Code:
pkmn = @party[pkmnid]
commands = []
cmdSummary = -1
cmdDebug = -1
cmdMoves = [-1] * pkmn.numMoves
cmdSwitch = -1
cmdMail = -1
cmdItem = -1
# Build the commands
commands[cmdSummary = commands.length] = _INTL("Summary")
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
if !pkmn.egg?
# Check for hidden moves and add any that were found
pkmn.moves.each_with_index do |m, i|
if [:MILKDRINK, :SOFTBOILED].include?(m.id) ||
HiddenMoveHandlers.hasHandler(m.id)
commands[cmdMoves[i] = commands.length] = [m.name, 1]
end
end
end
commands[cmdSwitch = commands.length] = _INTL("Switch") if @party.length>1
if !pkmn.egg?
if pkmn.mail
commands[cmdMail = commands.length] = _INTL("Mail")
else
commands[cmdItem = commands.length] = _INTL("Item")
end
end
commands[commands.length] = _INTL("Cancel")
command = @scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),commands)
havecommand = false
cmdMoves.each_with_index do |cmd, i|
next if cmd < 0 || cmd != command
havecommand = true
if [:MILKDRINK, :SOFTBOILED].include?(pkmn.moves[i].id)
amt = [(pkmn.totalhp/5).floor,1].max
if pkmn.hp<=amt
pbDisplay(_INTL("Not enough HP..."))
break
end
@scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
oldpkmnid = pkmnid
loop do
@scene.pbPreSelect(oldpkmnid)
pkmnid = @scene.pbChoosePokemon(true,pkmnid)
break if pkmnid<0
newpkmn = @party[pkmnid]
movename = pkmn.moves[i].name
if pkmnid==oldpkmnid
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))
elsif newpkmn.hp==0 || newpkmn.hp==newpkmn.totalhp
pbDisplay(_INTL("{1} can't be used on that Pokémon.",movename))
else
pkmn.hp -= amt
hpgain = pbItemRestoreHP(newpkmn,amt)
@scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",newpkmn.name,hpgain))
pbRefresh
end
break if pkmn.hp<=amt
end
@scene.pbSelect(oldpkmnid)
pbRefresh
break
elsif pbCanUseHiddenMove?(pkmn,pkmn.moves[i].id)
if pbConfirmUseHiddenMove(pkmn,pkmn.moves[i].id)
@scene.pbEndScene
if pkmn.moves[i].id == :FLY
scene = PokemonRegionMap_Scene.new(-1,false)
screen = PokemonRegionMapScreen.new(scene)
ret = screen.pbStartFlyScreen
if ret
$PokemonTemp.flydata=ret
return [pkmn,pkmn.moves[i].id]
end
@scene.pbStartScene(@party,
(@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
break
end
return [pkmn,pkmn.moves[i].id]
end
end
end
Code:
pkmn = @party[pkmnid]
usableFieldMoves = getFieldMoves()
commands = []
cmdSummary = -1
cmdDebug = -1
cmdMoves = [-1] * usableFieldMoves.length
cmdSwitch = -1
cmdMail = -1
cmdItem = -1
# Build the commands
commands[cmdSummary = commands.length] = _INTL("Summary")
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
if !pkmn.egg?
# Check for hidden moves and add any that were found
usableFieldMoves.each_with_index do |m, i|
if pkmn.compatible_with_move?(m.id) &&
HiddenMoveHandlers.hasHandler(m.id)
commands[cmdMoves[i] = commands.length] = [m.name, 1]
end
end
end
commands[cmdSwitch = commands.length] = _INTL("Switch") if @party.length>1
if !pkmn.egg?
if pkmn.mail
commands[cmdMail = commands.length] = _INTL("Mail")
else
commands[cmdItem = commands.length] = _INTL("Item")
end
end
commands[commands.length] = _INTL("Cancel")
command = @scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),commands)
havecommand = false
cmdMoves.each_with_index do |cmd, i|
next if cmd < 0 || cmd != command
havecommand = true
if [:MILKDRINK, :SOFTBOILED].include?(usableFieldMoves[i].id)
amt = [(pkmn.totalhp/5).floor,1].max
if pkmn.hp<=amt
pbDisplay(_INTL("Not enough HP..."))
break
end
@scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
oldpkmnid = pkmnid
loop do
@scene.pbPreSelect(oldpkmnid)
pkmnid = @scene.pbChoosePokemon(true,pkmnid)
break if pkmnid<0
newpkmn = @party[pkmnid]
movename = usableFieldMoves[i].name
if pkmnid==oldpkmnid
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))
elsif newpkmn.hp==0 || newpkmn.hp==newpkmn.totalhp
pbDisplay(_INTL("{1} can't be used on that Pokémon.",movename))
else
pkmn.hp -= amt
hpgain = pbItemRestoreHP(newpkmn,amt)
@scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",newpkmn.name,hpgain))
pbRefresh
end
break if pkmn.hp<=amt
end
@scene.pbSelect(oldpkmnid)
pbRefresh
break
elsif pbCanUseHiddenMove?(pkmn,usableFieldMoves[i].id)
if pbConfirmUseHiddenMove(pkmn,usableFieldMoves[i].id)
@scene.pbEndScene
if usableFieldMoves[i].id == :FLY
scene = PokemonRegionMap_Scene.new(-1,false)
screen = PokemonRegionMapScreen.new(scene)
ret = screen.pbStartFlyScreen
if ret
$PokemonTemp.flydata=ret
return [pkmn,usableFieldMoves[i].id]
end
@scene.pbStartScene(@party,
(@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
break
end
return [pkmn,usableFieldMoves[i].id]
end
end
end
- Change how field moves work in the overworld
Spoiler:
In Trainer change the entirety of get_pokemon_with_move with
Code:
def get_pokemon_with_move(move)
pokemon_party.each { |pkmn| return pkmn if pkmn.compatible_with_move?(move) }
return nil
end
Code for v.18
Spoiler:
- Starting point
Spoiler:
Put this code above main
Code:
#===============================================================================
# * Field moves defined by species - by Lexor
#===============================================================================
#
# This script make the field moves (cut, fly, ...) usable by simply check
# if the Pokemon can learn that move instead of check the moveset
#
# NOTE: You must insert non TM/HM moves like softboiled and teleport
# in tm.txt if you want to make them usable
#
# If you wanna add a new field move, after defined in PField_FieldMoves their
# code, add in UsableFieldMoves a new element:
#
# getID(PBMoves,:"INTERNAL MOVE NAME")
#
#===============================================================================
UsableFieldMoves = [getID(PBMoves,:CUT),
getID(PBMoves,:FLY),
getID(PBMoves,:SURF),
getID(PBMoves,:STRENGTH),
getID(PBMoves,:FLASH),
getID(PBMoves,:ROCKSMASH),
getID(PBMoves,:DIVE),
getID(PBMoves,:WATERFALL),
getID(PBMoves,:DIG),
getID(PBMoves,:SOFTBOILED),
getID(PBMoves,:MILKDRINK),
getID(PBMoves,:HEADBUTT),
getID(PBMoves,:TELEPORT),
getID(PBMoves,:SWEETSCENT)
]
- Set the moves list on the Pokemon menu in the party screen
Spoiler:
In PScreen_Party change
Code:
pkmn = @party[pkmnid]
commands = []
cmdSummary = -1
cmdDebug = -1
cmdMoves = [-1,-1,-1,-1]
cmdSwitch = -1
cmdMail = -1
cmdItem = -1
# Build the commands
commands[cmdSummary = commands.length] = _INTL("Summary")
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
for i in 0...pkmn.moves.length
move = pkmn.moves[i]
# Check for hidden moves and add any that were found
if !pkmn.egg? && (isConst?(move.id,PBMoves,:MILKDRINK) ||
isConst?(move.id,PBMoves,:SOFTBOILED) ||
HiddenMoveHandlers.hasHandler(move.id))
commands[cmdMoves[i] = commands.length] = [PBMoves.getName(move.id),1]
end
end
commands[cmdSwitch = commands.length] = _INTL("Switch") if @party.length>1
if !pkmn.egg?
if pkmn.mail
commands[cmdMail = commands.length] = _INTL("Mail")
else
commands[cmdItem = commands.length] = _INTL("Item")
end
end
commands[commands.length] = _INTL("Cancel")
command = @scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),commands)
havecommand = false
for i in 0...4
if cmdMoves[i]>=0 && command==cmdMoves[i]
havecommand = true
if isConst?(pkmn.moves[i].id,PBMoves,:SOFTBOILED) ||
isConst?(pkmn.moves[i].id,PBMoves,:MILKDRINK)
amt = [(pkmn.totalhp/5).floor,1].max
if pkmn.hp<=amt
pbDisplay(_INTL("Not enough HP..."))
break
end
@scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
oldpkmnid = pkmnid
loop do
@scene.pbPreSelect(oldpkmnid)
pkmnid = @scene.pbChoosePokemon(true,pkmnid)
break if pkmnid<0
newpkmn = @party[pkmnid]
movename = PBMoves.getName(pkmn.moves[i].id)
if pkmnid==oldpkmnid
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))
elsif newpkmn.hp==0 || newpkmn.hp==newpkmn.totalhp
pbDisplay(_INTL("{1} can't be used on that Pokémon.",movename))
else
pkmn.hp -= amt
hpgain = pbItemRestoreHP(newpkmn,amt)
@scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",newpkmn.name,hpgain))
pbRefresh
end
break if pkmn.hp<=amt
end
@scene.pbSelect(oldpkmnid)
pbRefresh
break
elsif pbCanUseHiddenMove?(pkmn,pkmn.moves[i].id)
if pbConfirmUseHiddenMove(pkmn,pkmn.moves[i].id)
@scene.pbEndScene
if isConst?(pkmn.moves[i].id,PBMoves,:FLY)
scene = PokemonRegionMap_Scene.new(-1,false)
screen = PokemonRegionMapScreen.new(scene)
ret = screen.pbStartFlyScreen
if ret
$PokemonTemp.flydata=ret
return [pkmn,pkmn.moves[i].id]
end
@scene.pbStartScene(@party,
(@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
break
end
return [pkmn,pkmn.moves[i].id]
end
else
break
end
end
end
With
Code:
pkmn = @party[pkmnid]
commands = []
cmdSummary = -1
cmdDebug = -1
cmdMoves = Array.new(UsableFieldMoves.length,-1)
cmdSwitch = -1
cmdMail = -1
cmdItem = -1
# Build the commands
commands[cmdSummary = commands.length] = _INTL("Summary")
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
usableMoves = []
count = 0
if !pkmn.egg?
for i in 0...UsableFieldMoves.length
if pkmn.compatibleWithMove?(UsableFieldMoves[i])
commands[cmdMoves[count] = commands.length] = [PBMoves.getName(UsableFieldMoves[i]),1]
usableMoves.push(UsableFieldMoves[i])
count += 1
end
end
end
commands[cmdSwitch = commands.length] = _INTL("Switch") if @party.length>1
if !pkmn.egg?
if pkmn.mail
commands[cmdMail = commands.length] = _INTL("Mail")
else
commands[cmdItem = commands.length] = _INTL("Item")
end
end
commands[commands.length] = _INTL("Cancel")
command = @scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),commands)
havecommand = false
for i in 0...usableMoves.length
if cmdMoves[i]>=0 && command==cmdMoves[i]
havecommand = true
if isConst?(usableMoves[i],PBMoves,:SOFTBOILED) ||
isConst?(usableMoves[i],PBMoves,:MILKDRINK)
amt = [(pkmn.totalhp/5).floor,1].max
if pkmn.hp<=amt
pbDisplay(_INTL("Not enough HP..."))
break
end
@scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
oldpkmnid = pkmnid
loop do
@scene.pbPreSelect(oldpkmnid)
pkmnid = @scene.pbChoosePokemon(true,pkmnid)
break if pkmnid<0
newpkmn = @party[pkmnid]
movename = PBMoves.getName(usableMoves[i])
if pkmnid==oldpkmnid
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))
elsif newpkmn.hp==0 || newpkmn.hp==newpkmn.totalhp
pbDisplay(_INTL("{1} can't be used on that Pokémon.",movename))
else
pkmn.hp -= amt
hpgain = pbItemRestoreHP(newpkmn,amt)
@scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",newpkmn.name,hpgain))
pbRefresh
end
break if pkmn.hp<=amt
end
@scene.pbSelect(oldpkmnid)
pbRefresh
break
elsif pbCanUseHiddenMove?(pkmn,usableMoves[i])
if pbConfirmUseHiddenMove(pkmn,usableMoves[i])
@scene.pbEndScene
if isConst?(usableMoves[i],PBMoves,:FLY)
scene = PokemonRegionMap_Scene.new(-1,false)
screen = PokemonRegionMapScreen.new(scene)
ret = screen.pbStartFlyScreen
if ret
$PokemonTemp.flydata=ret
return [pkmn,usableMoves[i]]
end
@scene.pbStartScene(@party,
(@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
break
end
return [pkmn,usableMoves[i]]
end
else
break
end
end
end
- Change how field moves work in the overworld
Spoiler:
In PSystem_PokemonUtilities change the entirety of pbCheckMove with this code
Code:
def pbCheckMove(move)
move = getID(PBMoves,move)
return nil if !move || move<=0
for i in $Trainer.pokemonParty
return i if i.compatibleWithMove?(move)
end
return nil
end
Add these in tm.txt if you wanna use softboiled, milkdrink, teleport and sweetscent
Spoiler:
[SOFTBOILED]
CLEFAIRY,CLEFABLE,CHANSEY,MEW,CLEFFA,TOGEPI,TOGETIC,BLISSEY,HAPPINY,TOGEKISS
[MILKDRINK]
MILTANK
[SWEETSCENT]
BULBASAUR,IVYSAUR,VENUSAUR,BUTTERFREE,BEEDRILL,ODDISH,GLOOM,VILEPLUME,PARAS,PARASECT,VENONAT,VENOMOTH,BELLSPROUT,WEEPINBELL,VICTREEBEL,EXEGGCUTE,EXEGGUTOR,CHANSEY,TANGELA,JYNX,MEW,CHIKORITA,BAYLEEF,MEGANIUM,LEDYBA,LEDIAN,BELLOSSOM,HOPPIP,SKIPLOOM,JUMPLUFF,SUNKERN,SUNFLORA,PINECO,FORRETRESS,SHUCKLE,TEDDIURSA,URSARING,SMOOCHUM,MILTANK,BLISSEY,CELEBI,LOTAD,LOMBRE,LUDICOLO,SURSKIT,MASQUERAIN,MAWILE,ILLUMISE,ROSELIA,TROPIUS,ROSERADE,COMBEE,VESPIQUEN,CHERUBI,CHERRIM,HAPPINY,CARNIVINE,TANGROWTH,SHAYMIN,SNIVY,SERVINE,SERPERIOR,PETILIL,LILLIGANT,MARACTUS,FOONGUS,AMOONGUSS
[TELEPORT]
ABRA,KADABRA,ALAKAZAM,MEWTWO,MEW,NATU,XATU,RALTS,KIRLIA,GARDEVOIR,CLAYDOL,DEOXYS,GALLADE,ELGYEM,BEHEEYEM
Code for v.17
Spoiler:
- Starting point
Spoiler:
Put this code above main
Code:
#===============================================================================
# * Field moves defined by species - by Lexor
#===============================================================================
#
# This script make the field moves (cut, fly, ...) usable by simply check
# if the Pokemon can learn that move instead of check the moveset
#
# NOTE: You must insert non TM/HM moves like softboiled and teleport
# in tm.txt if you want to make them usable
#
# If you wanna add a new field move, after defined in PField_FieldMoves their
# code, add in UsableFieldMoves a new element:
#
# getID(PBMoves,:"INTERNAL MOVE NAME")
#
#===============================================================================
UsableFieldMoves = [getID(PBMoves,:CUT),
getID(PBMoves,:FLY),
getID(PBMoves,:SURF),
getID(PBMoves,:STRENGTH),
getID(PBMoves,:FLASH),
getID(PBMoves,:ROCKSMASH),
getID(PBMoves,:DIVE),
getID(PBMoves,:WATERFALL),
getID(PBMoves,:DIG),
getID(PBMoves,:SOFTBOILED),
getID(PBMoves,:MILKDRINK),
getID(PBMoves,:HEADBUTT),
getID(PBMoves,:TELEPORT),
getID(PBMoves,:SWEETSCENT)
]
- Set the moves list on the Pokemon menu in the party screen
Spoiler:
In PScreen_Party change
Code:
pkmn = @party[pkmnid]
commands = []
cmdSummary = -1
cmdDebug = -1
cmdMoves = [-1,-1,-1,-1]
cmdSwitch = -1
cmdMail = -1
cmdItem = -1
# Build the commands
commands[cmdSummary = commands.length] = _INTL("Summary")
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
for i in 0...pkmn.moves.length
move = pkmn.moves[i]
# Check for hidden moves and add any that were found
if !pkmn.egg? && (isConst?(move.id,PBMoves,:MILKDRINK) ||
isConst?(move.id,PBMoves,:SOFTBOILED) ||
HiddenMoveHandlers.hasHandler(move.id))
commands[cmdMoves[i] = commands.length] = [PBMoves.getName(move.id),1]
end
end
commands[cmdSwitch = commands.length] = _INTL("Switch") if @party.length>1
if !pkmn.egg?
if pkmn.mail
commands[cmdMail = commands.length] = _INTL("Mail")
else
commands[cmdItem = commands.length] = _INTL("Item")
end
end
commands[commands.length] = _INTL("Cancel")
command = @scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),commands)
havecommand = false
for i in 0...4
if cmdMoves[i]>=0 && command==cmdMoves[i]
havecommand = true
if isConst?(pkmn.moves[i].id,PBMoves,:SOFTBOILED) ||
isConst?(pkmn.moves[i].id,PBMoves,:MILKDRINK)
amt = [(pkmn.totalhp/5).floor,1].max
if pkmn.hp<=amt
pbDisplay(_INTL("Not enough HP..."))
break
end
@scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
oldpkmnid = pkmnid
loop do
@scene.pbPreSelect(oldpkmnid)
pkmnid = @scene.pbChoosePokemon(true,pkmnid)
break if pkmnid<0
newpkmn = @party[pkmnid]
movename = PBMoves.getName(pkmn.moves[i].id)
if pkmnid==oldpkmnid
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))
elsif newpkmn.hp==0 || newpkmn.hp==newpkmn.totalhp
pbDisplay(_INTL("{1} can't be used on that Pokémon.",movename))
else
pkmn.hp -= amt
hpgain = pbItemRestoreHP(newpkmn,amt)
@scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",newpkmn.name,hpgain))
pbRefresh
end
break if pkmn.hp<=amt
end
@scene.pbSelect(oldpkmnid)
pbRefresh
break
elsif Kernel.pbCanUseHiddenMove?(pkmn,pkmn.moves[i].id)
if Kernel.pbConfirmUseHiddenMove(pkmn,pkmn.moves[i].id)
@scene.pbEndScene
if isConst?(pkmn.moves[i].id,PBMoves,:FLY)
scene = PokemonRegionMap_Scene.new(-1,false)
screen = PokemonRegionMapScreen.new(scene)
ret = screen.pbStartFlyScreen
if ret
$PokemonTemp.flydata=ret
return [pkmn,pkmn.moves[i].id]
end
@scene.pbStartScene(@party,
(@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
break
end
return [pkmn,pkmn.moves[i].id]
end
else
break
end
end
end
With
Code:
pkmn = @party[pkmnid]
commands = []
cmdSummary = -1
cmdDebug = -1
cmdMoves = Array.new(UsableFieldMoves.length,-1)
cmdSwitch = -1
cmdMail = -1
cmdItem = -1
# Build the commands
commands[cmdSummary = commands.length] = _INTL("Summary")
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
usableMoves = []
count = 0
if !pkmn.egg?
for i in 0...UsableFieldMoves.length
if pkmn.isCompatibleWithMove?(UsableFieldMoves[i])
commands[cmdMoves[count] = commands.length] = [PBMoves.getName(UsableFieldMoves[i]),1]
usableMoves.push(UsableFieldMoves[i])
count += 1
end
end
end
commands[cmdSwitch = commands.length] = _INTL("Switch") if @party.length>1
if !pkmn.egg?
if pkmn.mail
commands[cmdMail = commands.length] = _INTL("Mail")
else
commands[cmdItem = commands.length] = _INTL("Item")
end
end
commands[commands.length] = _INTL("Cancel")
command = @scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),commands)
havecommand = false
for i in 0...usableMoves.length
if cmdMoves[i]>=0 && command==cmdMoves[i]
havecommand = true
if isConst?(usableMoves[i],PBMoves,:SOFTBOILED) ||
isConst?(usableMoves[i],PBMoves,:MILKDRINK)
amt = [(pkmn.totalhp/5).floor,1].max
if pkmn.hp<=amt
pbDisplay(_INTL("Not enough HP..."))
break
end
@scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
oldpkmnid = pkmnid
loop do
@scene.pbPreSelect(oldpkmnid)
pkmnid = @scene.pbChoosePokemon(true,pkmnid)
break if pkmnid<0
newpkmn = @party[pkmnid]
movename = PBMoves.getName(usableMoves[i])
if pkmnid==oldpkmnid
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))
elsif newpkmn.hp==0 || newpkmn.hp==newpkmn.totalhp
pbDisplay(_INTL("{1} can't be used on that Pokémon.",movename))
else
pkmn.hp -= amt
hpgain = pbItemRestoreHP(newpkmn,amt)
@scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",newpkmn.name,hpgain))
pbRefresh
end
break if pkmn.hp<=amt
end
@scene.pbSelect(oldpkmnid)
pbRefresh
break
elsif Kernel.pbCanUseHiddenMove?(pkmn,usableMoves[i])
if Kernel.pbConfirmUseHiddenMove(pkmn,usableMoves[i])
@scene.pbEndScene
if isConst?(usableMoves[i],PBMoves,:FLY)
scene = PokemonRegionMap_Scene.new(-1,false)
screen = PokemonRegionMapScreen.new(scene)
ret = screen.pbStartFlyScreen
if ret
$PokemonTemp.flydata=ret
return [pkmn,usableMoves[i]]
end
@scene.pbStartScene(@party,
(@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
break
end
return [pkmn,usableMoves[i]]
end
else
break
end
end
end
- Change how field moves work in the overworld
Spoiler:
In PSystem_PokemonUtilities change the entirety of pbCheckMove with this code
Code:
def pbCheckMove(move)
if move.is_a?(String) || move.is_a?(Symbol)
move = getID(PBMoves,move)
end
return nil if !move || move<=0
for i in $Trainer.party
next if i.egg?
return i if i.isCompatibleWithMove?(move)
end
return nil
end
-- Edit 25/09/20: Added support to v.18
-- Edit 01/11/21: Added support to v.19.1
Last edited: