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.

Examples:

Accessing character race

Lich::DragonRealms::DRStats.race

Constant Summary collapse

@@race =

The character’s race

Returns:

  • (String, nil)

    The race of the character or nil if not set.

nil
@@guild =
nil
@@gender =

The character’s gender

Returns:

  • (String, nil)

    The gender of the character or nil if not set.

nil
@@encumbrance =

The character’s encumbrance

Returns:

  • (Integer, nil)

    The encumbrance of the character or nil if not set.

nil

Class Method Summary collapse

Class Method Details

.ageInteger

Retrieves the character’s age

Returns:

  • (Integer)

    The age of the character.



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

Parameters:

  • val (Integer)

    The age to set for the character



111
112
113
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 111

def self.age=(val)
  @@age = val
end

.agilityInteger

Retrieves the character’s agility

Returns:

  • (Integer)

    The agility of the character.



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

Parameters:

  • val (Integer)

    The agility to set for the character



176
177
178
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 176

def self.agility=(val)
  @@agility = val
end

.balanceInteger

Retrieves the character’s balance

Returns:

  • (Integer)

    The balance of the character.



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

Parameters:

  • val (Integer)

    The balance to set for the character



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

Returns:

  • (Boolean)

    True if the character is a Barbarian, false otherwise.



368
369
370
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 368

def self.barbarian?
  @@guild == 'Barbarian'
end

.bard?Boolean

Checks if the character’s guild is Bard

Returns:

  • (Boolean)

    True if the character is a Bard, false otherwise.



374
375
376
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 374

def self.bard?
  @@guild == 'Bard'
end

.charismaInteger

Retrieves the character’s charisma

Returns:

  • (Integer)

    The charisma of the character.



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

Parameters:

  • val (Integer)

    The charisma to set for the character



228
229
230
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 228

def self.charisma=(val)
  @@charisma = val
end

.circleInteger

Retrieves the character’s circle

Returns:

  • (Integer)

    The circle of the character.



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

Parameters:

  • val (Integer)

    The circle to set for the character



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

Returns:

  • (Boolean)

    True if the character is a Cleric, false otherwise.



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

Returns:

  • (Boolean)

    True if the character is a Commoner, false otherwise.



386
387
388
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 386

def self.commoner?
  @@guild == 'Commoner'
end

.concentrationInteger

Retrieves the character’s concentration from XMLData

Returns:

  • (Integer)

    The concentration of the character.



329
330
331
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 329

def self.concentration
  XMLData.concentration
end

.disciplineInteger

Retrieves the character’s discipline

Returns:

  • (Integer)

    The discipline of the character.



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

Parameters:

  • val (Integer)

    The discipline to set for the character



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

Returns:

  • (Boolean)

    True if the character is an Empath, false otherwise.



392
393
394
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 392

def self.empath?
  @@guild == 'Empath'
end

.encumbranceInteger?

Retrieves the character’s encumbrance

Returns:

  • (Integer, nil)

    The encumbrance of the character or nil if not set.



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

Parameters:

  • val (Integer)

    The encumbrance to set for the character



293
294
295
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 293

def self.encumbrance=(val)
  @@encumbrance = val
end

.fatigueInteger

Retrieves the character’s fatigue from XMLData

Returns:

  • (Integer)

    The fatigue of the character.



317
318
319
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 317

def self.fatigue
  XMLData.stamina
end

.favorsInteger

Retrieves the character’s favors

Returns:

  • (Integer)

    The favors of the character.



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

Parameters:

  • val (Integer)

    The favors to set for the character



241
242
243
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 241

def self.favors=(val)
  @@favors = val
end

.genderString?

Retrieves the character’s gender

Returns:

  • (String, nil)

    The gender of the character or nil if not set.



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

Parameters:

  • val (String)

    The gender to set for the character



98
99
100
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 98

def self.gender=(val)
  @@gender = val
end

.guildString?

Retrieves the character’s guild

Returns:

  • (String, nil)

    The guild of the character or nil if not set.



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

Parameters:

  • val (String)

    The guild to set for the character



85
86
87
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 85

def self.guild=(val)
  @@guild = val
end

.healthInteger

Retrieves the character’s health from XMLData

Returns:

  • (Integer)

    The health of the character.



305
306
307
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 305

def self.health
  XMLData.health
end

.intelligenceInteger

Retrieves the character’s intelligence

Returns:

  • (Integer)

    The intelligence of the character.



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

Parameters:

  • val (Integer)

    The intelligence to set for the character



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

Parameters:

  • array (Array)

    The array containing serialized stats



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

.luckInteger

Retrieves the character’s luck

Returns:

  • (Integer)

    The luck of the character.



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

Parameters:

  • val (Integer)

    The luck to set for the character



267
268
269
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 267

def self.luck=(val)
  @@luck = val
end

.manaInteger

Retrieves the character’s mana from XMLData

Returns:

  • (Integer)

    The mana of the character.



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

Returns:

  • (Boolean)

    True if the character is a Moon Mage, false otherwise.



398
399
400
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 398

def self.moon_mage?
  @@guild == 'Moon Mage'
end

.nameString

Retrieves the character’s name from XMLData

Returns:

  • (String)

    The name of the character.



299
300
301
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 299

def self.name
  XMLData.name
end

.native_manaString?

Determines the character’s native mana type based on their guild

Returns:

  • (String, nil)

    The native mana type or nil if not applicable.



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

Returns:

  • (Boolean)

    True if the character is a Necromancer, false otherwise.



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

Returns:

  • (Boolean)

    True if the character is a Paladin, false otherwise.



410
411
412
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 410

def self.paladin?
  @@guild == 'Paladin'
end

.raceString?

Retrieves the character’s race

Returns:

  • (String, nil)

    The race of the character or nil if not set.



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

Parameters:

  • val (String)

    The race to set for the character



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

Returns:

  • (Boolean)

    True if the character is a Ranger, false otherwise.



416
417
418
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 416

def self.ranger?
  @@guild == 'Ranger'
end

.reflexInteger

Retrieves the character’s reflex

Returns:

  • (Integer)

    The reflex of the character.



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

Parameters:

  • val (Integer)

    The reflex to set for the character



163
164
165
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 163

def self.reflex=(val)
  @@reflex = val
end

.serializeArray

Serializes the character’s stats into an array

Returns:

  • (Array)

    An array containing the serialized stats.



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

.spiritInteger

Retrieves the character’s spirit from XMLData

Returns:

  • (Integer)

    The spirit of the character.



323
324
325
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 323

def self.spirit
  XMLData.spirit
end

.staminaInteger

Retrieves the character’s stamina

Returns:

  • (Integer)

    The stamina of the character.



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

Parameters:

  • val (Integer)

    The stamina to set for the character



150
151
152
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 150

def self.stamina=(val)
  @@stamina = val
end

.strengthInteger

Retrieves the character’s strength

Returns:

  • (Integer)

    The strength of the character.



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

Parameters:

  • val (Integer)

    The strength to set for the character



137
138
139
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 137

def self.strength=(val)
  @@strength = val
end

.tdpsInteger

Retrieves the character’s TDPS

Returns:

  • (Integer)

    The TDPS of the character.



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

Parameters:

  • val (Integer)

    The TDPS to set for the character



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

Returns:

  • (Boolean)

    True if the character is a Thief, false otherwise.



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

Returns:

  • (Boolean)

    True if the character is a Trader, false otherwise.



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

Returns:

  • (Boolean)

    True if the character is a Warrior Mage, false otherwise.



434
435
436
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 434

def self.warrior_mage?
  @@guild == 'Warrior Mage'
end

.wisdomInteger

Retrieves the character’s wisdom

Returns:

  • (Integer)

    The wisdom of the character.



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

Parameters:

  • val (Integer)

    The wisdom to set for the character



202
203
204
# File 'documented/dragonrealms/drinfomon/drstats.rb', line 202

def self.wisdom=(val)
  @@wisdom = val
end