Module: Lich::Gemstone::Status

Defined in:
lib/gemstone/infomon/status.rb

Class Method Summary collapse

Class Method Details

.bound?Boolean

Checks if the character is bound.

Examples:

Lich::Gemstone::Status.bound? # => true or false

Returns:

  • (Boolean)

    true if the character is bound, false otherwise.



23
24
25
# File 'lib/gemstone/infomon/status.rb', line 23

def self.bound?
  Infomon.get_bool("status.bound") && (Effects::Debuffs.active?('Bind') || Effects::Debuffs.active?(214))
end

.calmed?Boolean

Checks if the character is calmed.

Examples:

Lich::Gemstone::Status.calmed? # => true or false

Returns:

  • (Boolean)

    true if the character is calmed, false otherwise.



32
33
34
# File 'lib/gemstone/infomon/status.rb', line 32

def self.calmed?
  Infomon.get_bool("status.calmed") && (Effects::Debuffs.active?('Calm') || Effects::Debuffs.active?(201))
end

.cutthroat?Boolean

Checks if the character is cutthroat.

Examples:

Lich::Gemstone::Status.cutthroat? # => true or false

Returns:

  • (Boolean)

    true if the character is cutthroat, false otherwise.



41
42
43
# File 'lib/gemstone/infomon/status.rb', line 41

def self.cutthroat?
  Infomon.get_bool("status.cutthroat") && Effects::Debuffs.active?('Major Bleed')
end

.dead?Boolean

Checks if the character is dead.

Examples:

Lich::Gemstone::Status.dead? # => true or false

Returns:

  • (Boolean)

    true if the character is dead, false otherwise.



78
79
80
# File 'lib/gemstone/infomon/status.rb', line 78

def self.dead?
  XMLData.indicator['IconDEAD'] == 'y'
end

.muckled?Boolean

Checks if the character is muckled (webbed, dead, stunned, bound, or sleeping).

Examples:

Lich::Gemstone::Status.muckled? # => true or false

Returns:

  • (Boolean)

    true if the character is muckled, false otherwise.



96
97
98
# File 'lib/gemstone/infomon/status.rb', line 96

def self.muckled?
  return Status.webbed? || Status.dead? || Status.stunned? || Status.bound? || Status.sleeping?
end

.serializeArray<Boolean>

Serializes the status of the character.

Examples:

Lich::Gemstone::Status.serialize # => [true, false, true, false, true]

Returns:

  • (Array<Boolean>)

    an array of booleans representing the character’s status.



105
106
107
# File 'lib/gemstone/infomon/status.rb', line 105

def self.serialize
  [self.bound?, self.calmed?, self.cutthroat?, self.silenced?, self.sleeping?]
end

.silenced?Boolean

Checks if the character is silenced.

Examples:

Lich::Gemstone::Status.silenced? # => true or false

Returns:

  • (Boolean)

    true if the character is silenced, false otherwise.



50
51
52
# File 'lib/gemstone/infomon/status.rb', line 50

def self.silenced?
  Infomon.get_bool("status.silenced") && Effects::Debuffs.active?('Silenced')
end

.sleeping?Boolean

Checks if the character is sleeping.

Examples:

Lich::Gemstone::Status.sleeping? # => true or false

Returns:

  • (Boolean)

    true if the character is sleeping, false otherwise.



59
60
61
# File 'lib/gemstone/infomon/status.rb', line 59

def self.sleeping?
  Infomon.get_bool("status.sleeping") && (Effects::Debuffs.active?('Sleep') || Effects::Debuffs.active?(501))
end

.stunned?Boolean

Checks if the character is stunned.

Examples:

Lich::Gemstone::Status.stunned? # => true or false

Returns:

  • (Boolean)

    true if the character is stunned, false otherwise.



87
88
89
# File 'lib/gemstone/infomon/status.rb', line 87

def self.stunned?
  XMLData.indicator['IconSTUNNED'] == 'y'
end

.thorned?Boolean

Checks if the character is thorned.

Examples:

Lich::Gemstone::Status.thorned? # => true or false

Returns:

  • (Boolean)

    true if the character is thorned, false otherwise.



14
15
16
# File 'lib/gemstone/infomon/status.rb', line 14

def self.thorned? # added 2024-09-08
  (Infomon.get_bool("status.thorned") && Effects::Debuffs.active?(/Wall of Thorns Poison [1-5]/))
end

.webbed?Boolean

Note:

This method is planned for deprecation in global_defs.

Checks if the character is webbed.

Examples:

Lich::Gemstone::Status.webbed? # => true or false

Returns:

  • (Boolean)

    true if the character is webbed, false otherwise.



69
70
71
# File 'lib/gemstone/infomon/status.rb', line 69

def self.webbed?
  XMLData.indicator['IconWEBBED'] == 'y'
end