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

@@ -1222,6 +1222,15 @@ module Compiler
value_hash[s.id] = property_value[s.pbs_order] || property_value[0]
end
current_pkmn[line_schema[0]] = value_hash
when "Ball"
if property_value[/^\d+$/]
current_pkmn[line_schema[0]] = pbBallTypeToItem(property_value.to_i).id
elsif !GameData::Item.exists?(property_value.to_sym) ||
!GameData::Item.get(property_value.to_sym).is_poke_ball?
raise _INTL("Value {1} isn't a defined Poké Ball.\r\n{2}", property_value, FileLineData.linereport)
else
current_pkmn[line_schema[0]] = property_value.to_sym
end
else
current_pkmn[line_schema[0]] = property_value
end

View File

@@ -622,7 +622,7 @@ module Compiler
f.write(sprintf(" IV = %s\r\n", ivs_array.join(","))) if pkmn[:iv]
f.write(sprintf(" EV = %s\r\n", evs_array.join(","))) if pkmn[:ev]
f.write(sprintf(" Happiness = %d\r\n", pkmn[:happiness])) if pkmn[:happiness]
f.write(sprintf(" Ball = %d\r\n", pkmn[:poke_ball])) if pkmn[:poke_ball]
f.write(sprintf(" Ball = %s\r\n", pkmn[:poke_ball])) if pkmn[:poke_ball]
end
end
}