Ball property in trainers.txt can now be a Poké Ball item's ID, fixed move-learning saying "already knows four moves" regardless of the value of Pokemon::MAX_MOVES

This commit is contained in:
Maruno17
2021-05-13 21:50:36 +01:00
parent 52e7f7b51a
commit 8384adeb22
10 changed files with 39 additions and 17 deletions

View File

@@ -206,16 +206,16 @@ def pbChooseAbilityList(default = nil)
return pbChooseList(commands, default, nil, -1)
end
def pbChooseBallList(defaultMoveID = -1)
def pbChooseBallList(defaultMoveID = nil)
cmdwin = pbListWindow([], 200)
commands = []
moveDefault = 0
for key in $BallTypes.keys
item = GameData::Item.try_get($BallTypes[key])
commands.push([key.to_i, item.name]) if item
commands.push([$BallTypes[key], item.name]) if item
end
commands.sort! { |a, b| a[1] <=> b[1] }
if defaultMoveID >= 0
if defaultMoveID
for i in 0...commands.length
moveDefault = i if commands[i][0] == defaultMoveID
end

View File

@@ -557,8 +557,7 @@ class BallProperty
end
def set(_settingname,oldsetting)
ret = pbChooseBallList((oldsetting) ? oldsetting : -1)
return (ret>=0) ? ret : (oldsetting) ? oldsetting : nil
return pbChooseBallList(oldsetting)
end
def defaultValue
@@ -566,7 +565,7 @@ class BallProperty
end
def format(value)
return (value) ? pbBallTypeToItem(value).name : "-"
return (value) ? GameData::Item.get(value).name : "-"
end
end