Module: Lich::DragonRealms::DRStats
- Defined in:
- documented/dragonrealms/drinfomon/drstats.rb
Overview
Module for managing DragonRealms character statistics This module provides methods to access and modify character stats.
Constant Summary collapse
- @@race =
The character’s race
nil- @@guild =
nil- @@gender =
The character’s gender
nil- @@encumbrance =
The character’s encumbrance
nil
Class Method Summary collapse
-
.age ⇒ Integer
Retrieves the character’s age.
-
.age=(val) ⇒ void
Sets the character’s age.
-
.agility ⇒ Integer
Retrieves the character’s agility.
-
.agility=(val) ⇒ void
Sets the character’s agility.
-
.balance ⇒ Integer
Retrieves the character’s balance.
-
.balance=(val) ⇒ void
Sets the character’s balance.
-
.barbarian? ⇒ Boolean
Checks if the character’s guild is Barbarian.
-
.bard? ⇒ Boolean
Checks if the character’s guild is Bard.
-
.charisma ⇒ Integer
Retrieves the character’s charisma.
-
.charisma=(val) ⇒ void
Sets the character’s charisma.
-
.circle ⇒ Integer
Retrieves the character’s circle.
-
.circle=(val) ⇒ void
Sets the character’s circle.
-
.cleric? ⇒ Boolean
Checks if the character’s guild is Cleric.
-
.commoner? ⇒ Boolean
Checks if the character’s guild is Commoner.
-
.concentration ⇒ Integer
Retrieves the character’s concentration from XMLData.
-
.discipline ⇒ Integer
Retrieves the character’s discipline.
-
.discipline=(val) ⇒ void
Sets the character’s discipline.
-
.empath? ⇒ Boolean
Checks if the character’s guild is Empath.
-
.encumbrance ⇒ Integer?
Retrieves the character’s encumbrance.
-
.encumbrance=(val) ⇒ void
Sets the character’s encumbrance.
-
.fatigue ⇒ Integer
Retrieves the character’s fatigue from XMLData.
-
.favors ⇒ Integer
Retrieves the character’s favors.
-
.favors=(val) ⇒ void
Sets the character’s favors.
-
.gender ⇒ String?
Retrieves the character’s gender.
-
.gender=(val) ⇒ void
Sets the character’s gender.
-
.guild ⇒ String?
Retrieves the character’s guild.
-
.guild=(val) ⇒ void
Sets the character’s guild.
-
.health ⇒ Integer
Retrieves the character’s health from XMLData.
-
.intelligence ⇒ Integer
Retrieves the character’s intelligence.
-
.intelligence=(val) ⇒ void
Sets the character’s intelligence.
-
.load_serialized=(array) ⇒ void
Loads character stats from a serialized array.
-
.luck ⇒ Integer
Retrieves the character’s luck.
-
.luck=(val) ⇒ void
Sets the character’s luck.
-
.mana ⇒ Integer
Retrieves the character’s mana from XMLData.
-
.moon_mage? ⇒ Boolean
Checks if the character’s guild is Moon Mage.
-
.name ⇒ String
Retrieves the character’s name from XMLData.
-
.native_mana ⇒ String?
Determines the character’s native mana type based on their guild.
-
.necromancer? ⇒ Boolean
Checks if the character’s guild is Necromancer.
-
.paladin? ⇒ Boolean
Checks if the character’s guild is Paladin.
-
.race ⇒ String?
Retrieves the character’s race.
-
.race=(val) ⇒ void
Sets the character’s race.
-
.ranger? ⇒ Boolean
Checks if the character’s guild is Ranger.
-
.reflex ⇒ Integer
Retrieves the character’s reflex.
-
.reflex=(val) ⇒ void
Sets the character’s reflex.
-
.serialize ⇒ Array
Serializes the character’s stats into an array.
-
.spirit ⇒ Integer
Retrieves the character’s spirit from XMLData.
-
.stamina ⇒ Integer
Retrieves the character’s stamina.
-
.stamina=(val) ⇒ void
Sets the character’s stamina.
-
.strength ⇒ Integer
Retrieves the character’s strength.
-
.strength=(val) ⇒ void
Sets the character’s strength.
-
.tdps ⇒ Integer
Retrieves the character’s TDPS.
-
.tdps=(val) ⇒ void
Sets the character’s TDPS.
-
.thief? ⇒ Boolean
Checks if the character’s guild is Thief.
-
.trader? ⇒ Boolean
Checks if the character’s guild is Trader.
-
.warrior_mage? ⇒ Boolean
Checks if the character’s guild is Warrior Mage.
-
.wisdom ⇒ Integer
Retrieves the character’s wisdom.
-
.wisdom=(val) ⇒ void
Sets the character’s wisdom.
Class Method Details
.age ⇒ Integer
Retrieves the character’s age
104 105 106 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 104 def self.age @@age end |
.age=(val) ⇒ void
This method returns an undefined value.
Sets the character’s age
111 112 113 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 111 def self.age=(val) @@age = val end |
.agility ⇒ Integer
Retrieves the character’s agility
169 170 171 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 169 def self.agility @@agility end |
.agility=(val) ⇒ void
This method returns an undefined value.
Sets the character’s agility
176 177 178 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 176 def self.agility=(val) @@agility = val end |
.balance ⇒ Integer
Retrieves the character’s balance
273 274 275 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 273 def self.balance @@balance end |
.balance=(val) ⇒ void
This method returns an undefined value.
Sets the character’s balance
280 281 282 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 280 def self.balance=(val) @@balance = val end |
.barbarian? ⇒ Boolean
Checks if the character’s guild is Barbarian
368 369 370 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 368 def self. @@guild == 'Barbarian' end |
.bard? ⇒ Boolean
Checks if the character’s guild is Bard
374 375 376 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 374 def self. @@guild == 'Bard' end |
.charisma ⇒ Integer
Retrieves the character’s charisma
221 222 223 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 221 def self.charisma @@charisma end |
.charisma=(val) ⇒ void
This method returns an undefined value.
Sets the character’s charisma
228 229 230 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 228 def self.charisma=(val) @@charisma = val end |
.circle ⇒ Integer
Retrieves the character’s circle
117 118 119 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 117 def self.circle @@circle end |
.circle=(val) ⇒ void
This method returns an undefined value.
Sets the character’s circle
124 125 126 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 124 def self.circle=(val) @@circle = val end |
.cleric? ⇒ Boolean
Checks if the character’s guild is Cleric
380 381 382 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 380 def self.cleric? @@guild == 'Cleric' end |
.commoner? ⇒ Boolean
Checks if the character’s guild is Commoner
386 387 388 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 386 def self.commoner? @@guild == 'Commoner' end |
.concentration ⇒ Integer
Retrieves the character’s concentration from XMLData
329 330 331 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 329 def self.concentration XMLData.concentration end |
.discipline ⇒ Integer
Retrieves the character’s discipline
208 209 210 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 208 def self.discipline @@discipline end |
.discipline=(val) ⇒ void
This method returns an undefined value.
Sets the character’s discipline
215 216 217 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 215 def self.discipline=(val) @@discipline = val end |
.empath? ⇒ Boolean
Checks if the character’s guild is Empath
392 393 394 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 392 def self.empath? @@guild == 'Empath' end |
.encumbrance ⇒ Integer?
Retrieves the character’s encumbrance
286 287 288 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 286 def self.encumbrance @@encumbrance end |
.encumbrance=(val) ⇒ void
This method returns an undefined value.
Sets the character’s encumbrance
293 294 295 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 293 def self.encumbrance=(val) @@encumbrance = val end |
.fatigue ⇒ Integer
Retrieves the character’s fatigue from XMLData
317 318 319 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 317 def self.fatigue XMLData.stamina end |
.favors ⇒ Integer
Retrieves the character’s favors
234 235 236 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 234 def self.favors @@favors end |
.favors=(val) ⇒ void
This method returns an undefined value.
Sets the character’s favors
241 242 243 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 241 def self.favors=(val) @@favors = val end |
.gender ⇒ String?
Retrieves the character’s gender
91 92 93 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 91 def self.gender @@gender end |
.gender=(val) ⇒ void
This method returns an undefined value.
Sets the character’s gender
98 99 100 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 98 def self.gender=(val) @@gender = val end |
.guild ⇒ String?
Retrieves the character’s guild
78 79 80 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 78 def self.guild @@guild end |
.guild=(val) ⇒ void
This method returns an undefined value.
Sets the character’s guild
85 86 87 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 85 def self.guild=(val) @@guild = val end |
.health ⇒ Integer
Retrieves the character’s health from XMLData
305 306 307 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 305 def self.health XMLData.health end |
.intelligence ⇒ Integer
Retrieves the character’s intelligence
182 183 184 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 182 def self.intelligence @@intelligence end |
.intelligence=(val) ⇒ void
This method returns an undefined value.
Sets the character’s intelligence
189 190 191 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 189 def self.intelligence=(val) @@intelligence = val end |
.load_serialized=(array) ⇒ void
This method returns an undefined value.
Loads character stats from a serialized array
361 362 363 364 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 361 def self.load_serialized=(array) @@race, @@guild, @@gender, @@age = array[0..3] @@circle, @@strength, @@stamina, @@reflex, @@agility, @@intelligence, @@wisdom, @@discipline, @@charisma, @@favors, @@tdps, @@luck, @@encumbrance = array[5..12] end |
.luck ⇒ Integer
Retrieves the character’s luck
260 261 262 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 260 def self.luck @@luck end |
.luck=(val) ⇒ void
This method returns an undefined value.
Sets the character’s luck
267 268 269 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 267 def self.luck=(val) @@luck = val end |
.mana ⇒ Integer
Retrieves the character’s mana from XMLData
311 312 313 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 311 def self.mana XMLData.mana end |
.moon_mage? ⇒ Boolean
Checks if the character’s guild is Moon Mage
398 399 400 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 398 def self.moon_mage? @@guild == 'Moon Mage' end |
.name ⇒ String
Retrieves the character’s name from XMLData
299 300 301 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 299 def self.name XMLData.name end |
.native_mana ⇒ String?
Determines the character’s native mana type based on their guild
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 335 def self.native_mana case DRStats.guild when 'Necromancer' 'arcane' when 'Barbarian', 'Thief' nil when 'Moon Mage', 'Trader' 'lunar' when 'Warrior Mage', 'Bard' 'elemental' when 'Cleric', 'Paladin' 'holy' when 'Empath', 'Ranger' 'life' end end |
.necromancer? ⇒ Boolean
Checks if the character’s guild is Necromancer
404 405 406 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 404 def self.necromancer? @@guild == 'Necromancer' end |
.paladin? ⇒ Boolean
Checks if the character’s guild is Paladin
410 411 412 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 410 def self.paladin? @@guild == 'Paladin' end |
.race ⇒ String?
Retrieves the character’s race
65 66 67 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 65 def self.race @@race end |
.race=(val) ⇒ void
This method returns an undefined value.
Sets the character’s race
72 73 74 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 72 def self.race=(val) @@race = val end |
.ranger? ⇒ Boolean
Checks if the character’s guild is Ranger
416 417 418 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 416 def self.ranger? @@guild == 'Ranger' end |
.reflex ⇒ Integer
Retrieves the character’s reflex
156 157 158 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 156 def self.reflex @@reflex end |
.reflex=(val) ⇒ void
This method returns an undefined value.
Sets the character’s reflex
163 164 165 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 163 def self.reflex=(val) @@reflex = val end |
.serialize ⇒ Array
Serializes the character’s stats into an array
354 355 356 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 354 def self.serialize [@@race, @@guild, @@gender, @@age, @@circle, @@strength, @@stamina, @@reflex, @@agility, @@intelligence, @@wisdom, @@discipline, @@charisma, @@favors, @@tdps, @@luck, @@encumbrance] end |
.spirit ⇒ Integer
Retrieves the character’s spirit from XMLData
323 324 325 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 323 def self.spirit XMLData.spirit end |
.stamina ⇒ Integer
Retrieves the character’s stamina
143 144 145 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 143 def self.stamina @@stamina end |
.stamina=(val) ⇒ void
This method returns an undefined value.
Sets the character’s stamina
150 151 152 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 150 def self.stamina=(val) @@stamina = val end |
.strength ⇒ Integer
Retrieves the character’s strength
130 131 132 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 130 def self.strength @@strength end |
.strength=(val) ⇒ void
This method returns an undefined value.
Sets the character’s strength
137 138 139 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 137 def self.strength=(val) @@strength = val end |
.tdps ⇒ Integer
Retrieves the character’s TDPS
247 248 249 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 247 def self.tdps @@tdps end |
.tdps=(val) ⇒ void
This method returns an undefined value.
Sets the character’s TDPS
254 255 256 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 254 def self.tdps=(val) @@tdps = val end |
.thief? ⇒ Boolean
Checks if the character’s guild is Thief
422 423 424 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 422 def self.thief? @@guild == 'Thief' end |
.trader? ⇒ Boolean
Checks if the character’s guild is Trader
428 429 430 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 428 def self.trader? @@guild == 'Trader' end |
.warrior_mage? ⇒ Boolean
Checks if the character’s guild is Warrior Mage
434 435 436 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 434 def self.warrior_mage? @@guild == 'Warrior Mage' end |
.wisdom ⇒ Integer
Retrieves the character’s wisdom
195 196 197 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 195 def self.wisdom @@wisdom end |
.wisdom=(val) ⇒ void
This method returns an undefined value.
Sets the character’s wisdom
202 203 204 |
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 202 def self.wisdom=(val) @@wisdom = val end |