Module: Lich::Gemstone::Stats
- Defined in:
- documented/attributes/stats.rb
Overview
API for querying character statistics: abilities, attributes, experience, and level.
Constant Summary collapse
- @@stats =
%i(strength constitution dexterity agility discipline aura logic intuition wisdom influence)
Class Method Summary collapse
-
.age ⇒ Integer?
Returns the character's age in years.
-
.exp ⇒ Integer?
Returns the character's current experience.
-
.gender ⇒ String?
Returns the character's gender.
-
.level ⇒ Integer?
Returns the character's level.
-
.prof ⇒ String?
Alias for
.profession. -
.profession ⇒ String?
Returns the character's profession.
-
.race ⇒ String?
Returns the character's race.
-
.serialize ⇒ Array
Returns an array of all character statistics in a fixed order for serialization.
Class Method Details
.age ⇒ Integer?
Returns the character's age in years.
48 49 50 |
# File 'documented/attributes/stats.rb', line 48 def self.age Infomon.get("stat.age") end |
.exp ⇒ Integer?
Returns the character's current experience.
108 109 110 |
# File 'documented/attributes/stats.rb', line 108 def self.exp XMLData.exp end |
.gender ⇒ String?
Returns the character's gender.
39 40 41 |
# File 'documented/attributes/stats.rb', line 39 def self.gender Infomon.get("stat.gender") end |
.level ⇒ Integer?
Returns the character's level.
57 58 59 |
# File 'documented/attributes/stats.rb', line 57 def self.level XMLData.level end |
.prof ⇒ String?
Alias for .profession.
30 31 32 |
# File 'documented/attributes/stats.rb', line 30 def self.prof self.profession end |
.profession ⇒ String?
Returns the character's profession.
23 24 25 |
# File 'documented/attributes/stats.rb', line 23 def self.profession Infomon.get("stat.profession") end |
.race ⇒ String?
Returns the character's race.
14 15 16 |
# File 'documented/attributes/stats.rb', line 14 def self.race Infomon.get("stat.race") end |
.serialize ⇒ Array
Returns an array of all character statistics in a fixed order for serialization.
Includes race, profession, gender, age, experience, level, all base and shorthand attributes (str, con, dex, agi, dis, aur, log, int, wis, inf), their enhanced variants, and base variants.
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'documented/attributes/stats.rb', line 121 def self.serialize [self.race, self.prof, self.gender, self.age, self.exp, self.level, self.str, self.con, self.dex, self.agi, self.dis, self.aur, self.log, self.int, self.wis, self.inf, self.enhanced_str, self.enhanced_con, self.enhanced_dex, self.enhanced_agi, self.enhanced_dis, self.enhanced_aur, self.enhanced_log, self.enhanced_int, self.enhanced_wis, self.enhanced_inf, self.base_str, self.base_con, self.base_dex, self.base_agi, self.base_dis, self.base_aur, self.base_log, self.base_int, self.base_wis, self.base_inf] end |