Implemented GameData::Move

This commit is contained in:
Maruno17
2020-11-19 21:00:29 +00:00
parent 52ffae9e8a
commit 3cd8d59918
71 changed files with 1443 additions and 1584 deletions

View File

@@ -236,7 +236,7 @@ class PokemonReadyMenu
def pbStartReadyMenu(moves,items)
commands = [[],[]] # Moves, items
for i in moves
commands[0].push([i[0], PBMoves.getName(i[0]), true, i[1]])
commands[0].push([i[0], GameData::Move.get(i[0]).name, true, i[1]])
end
commands[0].sort! { |a,b| a[1]<=>b[1] }
for i in items
@@ -250,7 +250,7 @@ class PokemonReadyMenu
if command[0]==0 # Use a move
move = commands[0][command[1]][0]
user = $Trainer.party[commands[0][command[1]][3]]
if isConst?(move,PBMoves,:FLY)
if move == :FLY
ret = nil
pbFadeOutInWithUpdate(99999,@scene.sprites) {
pbHideMenu
@@ -299,30 +299,26 @@ def pbUseKeyItem
moves = [:CUT, :DEFOG, :DIG, :DIVE, :FLASH, :FLY, :HEADBUTT, :ROCKCLIMB,
:ROCKSMASH, :SECRETPOWER, :STRENGTH, :SURF, :SWEETSCENT, :TELEPORT,
:WATERFALL, :WHIRLPOOL]
realmoves = []
for i in moves
move = getID(PBMoves,i)
next if move==0
for j in 0...$Trainer.party.length
next if $Trainer.party[j].egg?
next if !$Trainer.party[j].hasMove?(move)
realmoves.push([move,j]) if pbCanUseHiddenMove?($Trainer.party[j],move,false)
break
real_moves = []
moves.each do |move|
$Trainer.pokemonParty.each_with_index do |pkmn, i|
next if !pkmn.hasMove?(move)
real_moves.push([move, i]) if pbCanUseHiddenMove?(pkmn, move, false)
end
end
realitems = []
real_items = []
for i in $PokemonBag.registeredItems
itm = GameData::Item.get(i).id
realitems.push(itm) if $PokemonBag.pbHasItem?(itm)
real_items.push(itm) if $PokemonBag.pbHasItem?(itm)
end
if realitems.length==0 && realmoves.length==0
if real_items.length == 0 && real_moves.length == 0
pbMessage(_INTL("An item in the Bag can be registered to this key for instant use."))
else
$game_temp.in_menu = true
$game_map.update
sscene = PokemonReadyMenu_Scene.new
sscreen = PokemonReadyMenu.new(sscene)
sscreen.pbStartReadyMenu(realmoves,realitems)
sscreen.pbStartReadyMenu(real_moves, real_items)
$game_temp.in_menu = false
end
end