Module: Lich::Gemstone::Status

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

Overview

Provides methods to check character status in the game This module includes various methods to determine the current status of a character.

Examples:

Checking character status

Lich::Gemstone::Status.thorned?

Class Method Summary collapse

Class Method Details

.bound?Boolean

Checks if the character is bound

Examples:

Checking if a character is bound

Lich::Gemstone::Status.bound?

Returns:

  • (Boolean)

    true if the character is bound, false otherwise



33
34
35
# File 'documented/gemstone/infomon/status.rb', line 33

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:

Checking if a character is calmed

Lich::Gemstone::Status.calmed?

Returns:

  • (Boolean)

    true if the character is calmed, false otherwise



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

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

.cutthroat?Boolean

Checks if the character is in a cutthroat state

Examples:

Checking if a character is cutthroat

Lich::Gemstone::Status.cutthroat?

Returns:

  • (Boolean)

    true if the character is cutthroat, false otherwise



49
50
51
# File 'documented/gemstone/infomon/status.rb', line 49

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

.dead?Boolean

Checks if the character is dead

Examples:

Checking if a character is dead

Lich::Gemstone::Status.dead?

Returns:

  • (Boolean)

    true if the character is dead, false otherwise



82
83
84
# File 'documented/gemstone/infomon/status.rb', line 82

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

.muckled?Boolean

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

Examples:

Checking if a character is muckled

Lich::Gemstone::Status.muckled?

Returns:

  • (Boolean)

    true if the character is muckled, false otherwise



98
99
100
# File 'documented/gemstone/infomon/status.rb', line 98

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

.serializeArray<Boolean>

todo: does this serve a purpose? Serializes the status of the character

Examples:

Serializing character status

Lich::Gemstone::Status.serialize

Returns:

  • (Array<Boolean>)

    an array of booleans representing various status checks



107
108
109
# File 'documented/gemstone/infomon/status.rb', line 107

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

.silenced?Boolean

Checks if the character is silenced

Examples:

Checking if a character is silenced

Lich::Gemstone::Status.silenced?

Returns:

  • (Boolean)

    true if the character is silenced, false otherwise



57
58
59
# File 'documented/gemstone/infomon/status.rb', line 57

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

.sleeping?Boolean

Checks if the character is sleeping

Examples:

Checking if a character is sleeping

Lich::Gemstone::Status.sleeping?

Returns:

  • (Boolean)

    true if the character is sleeping, false otherwise



65
66
67
# File 'documented/gemstone/infomon/status.rb', line 65

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:

Checking if a character is stunned

Lich::Gemstone::Status.stunned?

Returns:

  • (Boolean)

    true if the character is stunned, false otherwise



90
91
92
# File 'documented/gemstone/infomon/status.rb', line 90

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

.thorned?Boolean

Checks if the character is thorned

Examples:

Checking if a character is thorned

Lich::Gemstone::Status.thorned?

Returns:

  • (Boolean)

    true if the character is thorned, false otherwise



25
26
27
# File 'documented/gemstone/infomon/status.rb', line 25

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

.webbed?Boolean

deprecate these in global_defs after warning, consider bringing other status maps over Checks if the character is webbed

Examples:

Checking if a character is webbed

Lich::Gemstone::Status.webbed?

Returns:

  • (Boolean)

    true if the character is webbed, false otherwise



74
75
76
# File 'documented/gemstone/infomon/status.rb', line 74

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