Module: Lich::Gemstone::Experience
- Defined in:
- documented/gemstone/experience.rb
Overview
Namespace for character experience, field experience, and related bonuses tracked by the game server.
Class Method Summary collapse
-
.axp ⇒ Integer
Returns the character's current ascension experience (AXP).
-
.deaths_sting ⇒ Integer?
Returns the character's deaths sting value, representing a temporary experience penalty.
-
.deeds ⇒ Integer?
Returns the character's completed deeds value.
-
.exp ⇒ Integer
Returns the character's current total experience (EXP), excluding ascension experience.
-
.fame ⇒ Integer?
Returns the character's current fame value.
-
.fashlonae? ⇒ Boolean
fashlonae has three states on the mindState bar: absent (no orb redeemed), 1 (redeemed but not active), and 2 (redeemed and active).
-
.fashlonae_redeemed? ⇒ Boolean
Returns whether a Fashlonae orb has been redeemed, regardless of whether it is currently active.
-
.fxp_current ⇒ Integer
Returns the character's current field experience (FXP).
-
.fxp_max ⇒ Integer
Returns the character's maximum field experience (FXP) for the current field rank.
-
.lte ⇒ Integer?
Returns the character's long-term experience (LTE) bonus value.
-
.lumnis ⇒ Integer?
Returns the character's current Lumnis bonus value.
-
.lumnis? ⇒ Boolean
Returns whether the Lumnis bonus is active.
-
.next_atp ⇒ Object
Ascension experience remaining until the next ascension training point.
-
.percent_axp ⇒ Float
Returns the character's ascension experience as a percentage of total experience.
-
.percent_exp ⇒ Float
Returns the character's experience as a percentage of total experience.
-
.percent_fxp ⇒ Float
Returns the character's field experience as a percentage of the maximum for the current rank.
-
.recently_updated?(threshold: 5.minutes) ⇒ Boolean
Returns whether the experience data was updated within the given threshold.
-
.rpa ⇒ Integer?
Returns the character's current Rank Point Adjustment (RPA) value.
-
.rpa? ⇒ Boolean
Returns whether the Rank Point Adjustment (RPA) bonus is active.
-
.stale?(threshold: 24.hours) ⇒ Boolean
Returns whether the experience data is older than the given threshold.
-
.txp ⇒ Integer
Returns the sum of the character's total experience and ascension experience.
-
.until_next ⇒ Integer
Returns the total experience needed to reach the next experience level.
-
.updated_at ⇒ Time?
Returns the timestamp when experience data was last updated by the server.
Class Method Details
.axp ⇒ Integer
Returns the character's current ascension experience (AXP).
42 43 44 |
# File 'documented/gemstone/experience.rb', line 42 def self.axp XMLData.ascension_exp end |
.deaths_sting ⇒ Integer?
Returns the character's deaths sting value, representing a temporary experience penalty.
107 108 109 |
# File 'documented/gemstone/experience.rb', line 107 def self.deaths_sting Infomon.get("experience.deaths_sting") end |
.deeds ⇒ Integer?
Returns the character's completed deeds value.
100 101 102 |
# File 'documented/gemstone/experience.rb', line 100 def self.deeds Infomon.get("experience.deeds") end |
.exp ⇒ Integer
Returns the character's current total experience (EXP), excluding ascension experience.
35 36 37 |
# File 'documented/gemstone/experience.rb', line 35 def self.exp XMLData.exp end |
.fame ⇒ Integer?
Returns the character's current fame value.
14 15 16 |
# File 'documented/gemstone/experience.rb', line 14 def self.fame Infomon.get("experience.fame") end |
.fashlonae? ⇒ Boolean
fashlonae has three states on the mindState bar: absent (no orb redeemed), 1 (redeemed but not active), and 2 (redeemed and active). fashlonae? reports whether the bonus is active; fashlonae_redeemed? reports whether an orb has been redeemed at all.
143 144 145 |
# File 'documented/gemstone/experience.rb', line 143 def self.fashlonae? XMLData.fashlonae.eql?(2) end |
.fashlonae_redeemed? ⇒ Boolean
Returns whether a Fashlonae orb has been redeemed, regardless of whether it is currently active.
151 152 153 |
# File 'documented/gemstone/experience.rb', line 151 def self.fashlonae_redeemed? !XMLData.fashlonae.nil? end |
.fxp_current ⇒ Integer
Returns the character's current field experience (FXP).
21 22 23 |
# File 'documented/gemstone/experience.rb', line 21 def self.fxp_current XMLData.field_exp end |
.fxp_max ⇒ Integer
Returns the character's maximum field experience (FXP) for the current field rank.
28 29 30 |
# File 'documented/gemstone/experience.rb', line 28 def self.fxp_max XMLData.max_field_exp end |
.lte ⇒ Integer?
Returns the character's long-term experience (LTE) bonus value.
93 94 95 |
# File 'documented/gemstone/experience.rb', line 93 def self.lte Infomon.get("experience.long_term_experience") end |
.lumnis ⇒ Integer?
Returns the character's current Lumnis bonus value.
135 136 137 |
# File 'documented/gemstone/experience.rb', line 135 def self.lumnis XMLData.lumnis end |
.lumnis? ⇒ Boolean
Returns whether the Lumnis bonus is active.
128 129 130 |
# File 'documented/gemstone/experience.rb', line 128 def self.lumnis? !XMLData.lumnis.nil? end |
.next_atp ⇒ Object
Ascension experience remaining until the next ascension training point. One ATP is earned per 50,000 ascension experience, so at an exact multiple this reports a full 50,000 interval to the next point.
65 66 67 |
# File 'documented/gemstone/experience.rb', line 65 def self.next_atp 50_000 - (axp % 50_000) end |
.percent_axp ⇒ Float
Returns the character's ascension experience as a percentage of total experience.
79 80 81 |
# File 'documented/gemstone/experience.rb', line 79 def self.percent_axp (axp.to_f / txp.to_f) * 100 end |
.percent_exp ⇒ Float
Returns the character's experience as a percentage of total experience.
86 87 88 |
# File 'documented/gemstone/experience.rb', line 86 def self.percent_exp (exp.to_f / txp.to_f) * 100 end |
.percent_fxp ⇒ Float
Returns the character's field experience as a percentage of the maximum for the current rank.
72 73 74 |
# File 'documented/gemstone/experience.rb', line 72 def self.percent_fxp (fxp_current.to_f / fxp_max.to_f) * 100 end |
.recently_updated?(threshold: 5.minutes) ⇒ Boolean
Returns whether the experience data was updated within the given threshold.
180 181 182 183 |
# File 'documented/gemstone/experience.rb', line 180 def self.recently_updated?(threshold: 5.minutes) return false unless updated_at updated_at >= threshold.ago end |
.rpa ⇒ Integer?
Returns the character's current Rank Point Adjustment (RPA) value.
121 122 123 |
# File 'documented/gemstone/experience.rb', line 121 def self.rpa XMLData.rpa end |
.rpa? ⇒ Boolean
Returns whether the Rank Point Adjustment (RPA) bonus is active.
114 115 116 |
# File 'documented/gemstone/experience.rb', line 114 def self.rpa? !XMLData.rpa.nil? end |
.stale?(threshold: 24.hours) ⇒ Boolean
Returns whether the experience data is older than the given threshold.
169 170 171 172 |
# File 'documented/gemstone/experience.rb', line 169 def self.stale?(threshold: 24.hours) return true unless updated_at updated_at < threshold.ago end |
.txp ⇒ Integer
Returns the sum of the character's total experience and ascension experience.
51 52 53 |
# File 'documented/gemstone/experience.rb', line 51 def self.txp XMLData.exp + XMLData.ascension_exp end |
.until_next ⇒ Integer
Returns the total experience needed to reach the next experience level.
58 59 60 |
# File 'documented/gemstone/experience.rb', line 58 def self.until_next XMLData.until_next end |
.updated_at ⇒ Time?
Returns the timestamp when experience data was last updated by the server.
158 159 160 161 |
# File 'documented/gemstone/experience.rb', line 158 def self.updated_at = Infomon.get_updated_at("experience.total_experience") ? Time.at() : nil end |