Class: Studio::Group::Encounter::ShinySetup
- Defined in:
- scripts/00800 Studio/00001 Data/00011 Group.rb
Overview
Data class helping to know the shiny setup of a creature
Instance Method Summary collapse
-
#initialize(hash) ⇒ ShinySetup
constructor
Create a new shiny setup.
-
#not_shiny ⇒ Boolean
Get the forbid shiny attribute.
-
#shiny(rate = rand) ⇒ Boolean
Get the shiny attribute of the creature.
Constructor Details
#initialize(hash) ⇒ ShinySetup
Create a new shiny setup
115 116 117 118 |
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 115 def initialize(hash) @kind = hash['kind'].to_sym @rate = hash['rate'].to_f end |
Instance Method Details
#not_shiny ⇒ Boolean
Get the forbid shiny attribute
131 132 133 134 135 |
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 131 def not_shiny return false if @kind == :automatic return @rate == 0 end |
#shiny(rate = rand) ⇒ Boolean
Get the shiny attribute of the creature
123 124 125 126 127 |
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 123 def shiny(rate = rand) return false if @kind == :automatic return @rate > rate end |