Module: Lich::DragonRealms::DRSpells

Defined in:
documented/dragonrealms/drinfomon/drspells.rb

Overview

Provides functionality related to spells in the DragonRealms game. This module manages known spells, feats, and spellbook formats.

Examples:

Accessing known spells

known_spells = Lich::DragonRealms::DRSpells.known_spells

Constant Summary collapse

@@known_spells =

A hash storing known spells.

{}
@@known_feats =

A hash storing known feats.

{}
@@spellbook_format =

The format of the spellbook, can be ‘column-formatted’ or ‘non-column’.

nil
@@grabbing_known_spells =

Indicates if the module is currently grabbing known spells.

false
@@grabbing_known_barbarian_abilities =

Indicates if the module is currently grabbing known barbarian abilities.

false
@@grabbing_known_khri =

Indicates if the module is currently grabbing known khri.

false

Class Method Summary collapse

Class Method Details

.active_spellsHash

Retrieves the currently active spells.

Returns:

  • (Hash)

    A hash of active spells.



24
25
26
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 24

def self.active_spells
  XMLData.dr_active_spells
end

.check_known_barbarian_abilitiesBoolean

Checks if the module is currently grabbing known barbarian abilities.

Returns:

  • (Boolean)

    True if grabbing known barbarian abilities, false otherwise.



67
68
69
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 67

def self.check_known_barbarian_abilities
  @@grabbing_known_barbarian_abilities
end

.check_known_barbarian_abilities=(val) ⇒ Boolean

Sets the state of grabbing known barbarian abilities.

Parameters:

  • val (Boolean)

    The state to set for grabbing known barbarian abilities.

Returns:

  • (Boolean)

    The value that was set.



74
75
76
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 74

def self.check_known_barbarian_abilities=(val)
  @@grabbing_known_barbarian_abilities = val
end

.grabbing_known_khriBoolean

Checks if the module is currently grabbing known khri.

Returns:

  • (Boolean)

    True if grabbing known khri, false otherwise.



80
81
82
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 80

def self.grabbing_known_khri
  @@grabbing_known_khri
end

.grabbing_known_khri=(val) ⇒ Boolean

Sets the state of grabbing known khri.

Parameters:

  • val (Boolean)

    The state to set for grabbing known khri.

Returns:

  • (Boolean)

    The value that was set.



87
88
89
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 87

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

.grabbing_known_spellsBoolean

Checks if the module is currently grabbing known spells.

Returns:

  • (Boolean)

    True if grabbing known spells, false otherwise.



54
55
56
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 54

def self.grabbing_known_spells
  @@grabbing_known_spells
end

.grabbing_known_spells=(val) ⇒ Boolean

Sets the state of grabbing known spells.

Parameters:

  • val (Boolean)

    The state to set for grabbing known spells.

Returns:

  • (Boolean)

    The value that was set.



61
62
63
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 61

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

.known_featsHash

Returns the known feats.

Returns:

  • (Hash)

    A hash of known feats.



36
37
38
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 36

def self.known_feats
  @@known_feats
end

.known_spellsHash

Returns the known spells.

Returns:

  • (Hash)

    A hash of known spells.



30
31
32
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 30

def self.known_spells
  @@known_spells
end

.sliversArray

Retrieves the slivers of currently active spells.

Returns:

  • (Array)

    An array of spell slivers.



42
43
44
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 42

def self.slivers
  XMLData.dr_active_spells_slivers
end

.spellbook_formatString?

Retrieves the current spellbook format.

Returns:

  • (String, nil)

    The spellbook format, or nil if not set.



93
94
95
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 93

def self.spellbook_format
  @@spellbook_format
end

.spellbook_format=(val) ⇒ String

Sets the spellbook format.

Parameters:

  • val (String)

    The format to set for the spellbook.

Returns:

  • (String)

    The value that was set.



100
101
102
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 100

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

.stellar_percentageFloat

Retrieves the stellar percentage of active spells.

Returns:

  • (Float)

    The stellar percentage.



48
49
50
# File 'documented/dragonrealms/drinfomon/drspells.rb', line 48

def self.stellar_percentage
  XMLData.dr_active_spells_stellar_percentage
end