Removed all uses of ID numbers for species, some other code changes for abolishing ID numbers

This commit is contained in:
Maruno17
2021-06-16 22:42:20 +01:00
parent 8c67127f06
commit e9457a3ea8
22 changed files with 965 additions and 1750 deletions

View File

@@ -134,9 +134,10 @@ module GameData
pkmn.shiny = (pkmn_data[:shininess]) ? true : false
if pkmn_data[:nature]
pkmn.nature = pkmn_data[:nature]
else
nature = pkmn.species_data.id_number + GameData::TrainerType.get(trainer.trainer_type).id_number
pkmn.nature = nature % (GameData::Nature::DATA.length / 2)
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)
end
GameData::Stat.each_main do |s|
if pkmn_data[:iv]