dna splicers that don't crash the game...

This commit is contained in:
chardub
2025-05-09 20:30:35 -04:00
parent 4ecf97b777
commit 13c7792686
7 changed files with 573 additions and 84 deletions

View File

@@ -32,6 +32,19 @@ module GameData
return self.types.include?(type)
end
def self.get_species_form(species, form)
return nil if !species || !form
return GameData::Species.get(species)
validate species => [Symbol, self, String]
validate form => Integer
species = species.species if species.is_a?(self)
species = species.to_sym if species.is_a?(String)
trial = sprintf("%s_%d", species, form).to_sym
species_form = (DATA[trial].nil?) ? species : trial
return (DATA.has_key?(species_form)) ? DATA[species_form] : nil
end
end
end