Added def count to all GameData variants, and one that returns the number of species for Species, removed all uses of ID numbers for GameData::Status, made more use of GameData::X.keys

This commit is contained in:
Maruno17
2021-06-17 22:21:24 +01:00
parent 5358037986
commit eaa915878a
15 changed files with 86 additions and 72 deletions

View File

@@ -137,7 +137,7 @@ module GameData
else # Make the nature random but consistent for the same species used by the same trainer type
species_num = GameData::Species.keys.index(species) || 1
tr_type_num = GameData::TrainerType.keys.index(@trainer_type) || 1
pkmn.nature = (species_num + tr_type_num) % (GameData::Nature::DATA.length / 2)
pkmn.nature = (species_num + tr_type_num) % GameData::Nature.count
end
GameData::Stat.each_main do |s|
if pkmn_data[:iv]