Class: FFXI::SkillupCalculator
- Inherits:
-
Util::RubyBean
- Object
- Util::RubyBean
- FFXI::SkillupCalculator
- Includes:
- Constants
- Defined in:
- lib/Vana/skillup_calculator.rb
Constant Summary
Constants included from Constants
Constants::BASIS_DATE, Constants::DAY, Constants::HOUR, Constants::MINUTE, Constants::MOON_DATE, Constants::MS_BASIS_DATE, Constants::MS_BASIS_VANA, Constants::MS_DAY, Constants::MS_GAME_DAY, Constants::MS_HOUR, Constants::MS_MINUTE, Constants::MS_MONTH, Constants::MS_MOON_DATE, Constants::MS_SECOND, Constants::MS_YEAR
Instance Attribute Summary collapse
-
#crystal_element ⇒ Object
Returns the value of attribute crystal_element.
-
#recipe_cap ⇒ Object
Returns the value of attribute recipe_cap.
-
#skill ⇒ Object
Returns the value of attribute skill.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ SkillupCalculator
constructor
A new instance of SkillupCalculator.
- #update_day_and_moon(vanaday, vanamoon) ⇒ Object
Methods inherited from Util::RubyBean
#add_listener, #has_listeners?, property, #remove_listener
Constructor Details
#initialize(opts = {}) ⇒ SkillupCalculator
Returns a new instance of SkillupCalculator.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/Vana/skillup_calculator.rb', line 8 def initialize(opts={}) super() add_listener(opts[:listener]) if opts[:listener] @recipe_cap = opts[:recipe_cap] || 0 @skill = opts[:skill] || 0 update_base_difficulty @crystal_element = opts[:crystal_element] if opts[:crystal_element] if opts[:vana_day] and opts[:vana_moon] update_day_and_moon(opts[:vana_day], opts[:vana_moon]) end end |
Instance Attribute Details
#crystal_element ⇒ Object
Returns the value of attribute crystal_element.
67 68 69 |
# File 'lib/Vana/skillup_calculator.rb', line 67 def crystal_element @crystal_element end |
#recipe_cap ⇒ Object
Returns the value of attribute recipe_cap.
67 68 69 |
# File 'lib/Vana/skillup_calculator.rb', line 67 def recipe_cap @recipe_cap end |
#skill ⇒ Object
Returns the value of attribute skill.
67 68 69 |
# File 'lib/Vana/skillup_calculator.rb', line 67 def skill @skill end |
Instance Method Details
#update_day_and_moon(vanaday, vanamoon) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/Vana/skillup_calculator.rb', line 24 def update_day_and_moon(vanaday, vanamoon) if (! vanaday.is_a? VanaDay) || (! vanamoon.is_a? VanaMoon) raise "invalid input. initialize with a VanaDay and VanaMoon object" end @day_element = vanaday.day_element @moon_percent = vanamoon.moon_percent if @day_element and @moon_percent update_moon_phase_factor if ! @crystal_element.nil? update_day_crystal_factor update_skillup_difficulty end end end |