mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Implemented GameData::Move
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user