Class: Studio::Group::Encounter
- Defined in:
- scripts/00800 Studio/00001 Data/00011 Group.rb
Overview
Data class describing an Encounter for a wild group
Defined Under Namespace
Classes: LevelSetup, ShinySetup
Instance Attribute Summary collapse
-
#encounter_rate ⇒ Integer
readonly
Encounter rate of the creature in its group.
-
#extra ⇒ Hash
readonly
Additional info for the creature (to generate it).
-
#form ⇒ Integer
readonly
Form of the creature that should be encountered.
-
#level_setup ⇒ LevelSetup
readonly
Level setup of the creature that should be encountered.
-
#shiny_setup ⇒ ShinySetup
readonly
Shiny attribute setup for the creature.
-
#specie ⇒ Symbol
readonly
db_symbol of the creature that should be encountered.
Instance Method Summary collapse
-
#to_creature(level = nil) ⇒ PFM::Pokemon
Convert the encounter to an actual creature.
Instance Attribute Details
#encounter_rate ⇒ Integer (readonly)
Encounter rate of the creature in its group
97 98 99 |
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 97 def encounter_rate @encounter_rate end |
#extra ⇒ Hash (readonly)
Additional info for the creature (to generate it)
101 102 103 |
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 101 def extra @extra end |
#form ⇒ Integer (readonly)
Form of the creature that should be encountered
85 86 87 |
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 85 def form @form end |
#level_setup ⇒ LevelSetup (readonly)
Level setup of the creature that should be encountered
93 94 95 |
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 93 def level_setup @level_setup end |
#shiny_setup ⇒ ShinySetup (readonly)
Shiny attribute setup for the creature
89 90 91 |
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 89 def shiny_setup @shiny_setup end |
#specie ⇒ Symbol (readonly)
db_symbol of the creature that should be encountered
81 82 83 |
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 81 def specie @specie end |
Instance Method Details
#to_creature(level = nil) ⇒ PFM::Pokemon
Convert the encounter to an actual creature
106 107 108 109 |
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 106 def to_creature(level = nil) level ||= rand(level_setup.range) return PFM::Pokemon.new(specie, level, shiny_setup.shiny, shiny_setup.not_shiny, form, extra) end |