mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
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:
@@ -53,10 +53,6 @@ module GameData
|
||||
extend ClassMethodsSymbols
|
||||
include InstanceMethods
|
||||
|
||||
def self.each_species
|
||||
DATA.each_value { |species| yield species if species.form == 0 }
|
||||
end
|
||||
|
||||
# @param species [Symbol, self, String, Integer]
|
||||
# @param form [Integer]
|
||||
# @return [self, nil]
|
||||
@@ -75,6 +71,16 @@ module GameData
|
||||
return (DATA.has_key?(species_form)) ? DATA[species_form] : nil
|
||||
end
|
||||
|
||||
def self.each_species
|
||||
DATA.each_value { |species| yield species if species.form == 0 }
|
||||
end
|
||||
|
||||
def self.species_count
|
||||
ret = 0
|
||||
self.species_count { |species| ret += 1 }
|
||||
return ret
|
||||
end
|
||||
|
||||
def self.schema(compiling_forms = false)
|
||||
ret = {
|
||||
"FormName" => [0, "q"],
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user