Implemented usage of GameData::Item

This commit is contained in:
Maruno17
2020-11-08 22:45:59 +00:00
parent ff70791104
commit 1955d3698e
82 changed files with 1986 additions and 2195 deletions

View File

@@ -433,7 +433,7 @@ module PokemonDebugMixin
oldabil = (pkmn.ability) ? pkmn.ability.name : "No ability"
commands = []
for i in abils
commands.push(((i[1]<2) ? "" : "(H) ") + PokemonData::Ability.get(i[0]).name)
commands.push(((i[1]<2) ? "" : "(H) ") + GameData::Ability.get(i[0]).name)
end
commands.push(_INTL("Remove override"))
msg = [_INTL("Ability {1} is natural.",oldabil),
@@ -615,8 +615,8 @@ module PokemonDebugMixin
when "setpokeball"
commands = []; balls = []
for key in $BallTypes.keys
item = getID(PBItems,$BallTypes[key])
balls.push([key.to_i,PBItems.getName(item)]) if item && item>0
item = GameData::Item.try_get($BallTypes[key])
balls.push([key.to_i, item.name]) if item
end
balls.sort! { |a,b| a[1]<=>b[1] }
cmd = 0
@@ -629,7 +629,7 @@ module PokemonDebugMixin
commands.push(i[1])
end
loop do
oldball = PBItems.getName(pbBallTypeToItem(pkmn.ballused))
oldball = pbBallTypeToItem(pkmn.ballused).name
cmd = pbShowCommands(_INTL("{1} used.",oldball),commands,cmd)
break if cmd<0
pkmn.ballused = balls[cmd][0]