Module: Lich::Gemstone::Status

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

Overview

Provides methods to check various character status effects.

See Also:

Class Method Summary collapse

Class Method Details

.bound?Boolean

Checks if the character is bound.

Examples:

Check bound status

Lich::Gemstone::Status.bound?

Returns:

  • (Boolean)

    true if the character is bound, false otherwise



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

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:

Check calmed status

Lich::Gemstone::Status.calmed?

Returns:

  • (Boolean)

    true if the character is calmed, false otherwise



32
33
34
# File 'documented/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 in a cutthroat state.

Examples:

Check cutthroat status

Lich::Gemstone::Status.cutthroat?

Returns:

  • (Boolean)

    true if the character is cutthroat, false otherwise



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

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

.dead?Boolean

Checks if the character is dead.

Examples:

Check dead status

Lich::Gemstone::Status.dead?

Returns:

  • (Boolean)

    true if the character is dead, false otherwise



72
73
74
# File 'documented/gemstone/infomon/status.rb', line 72

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

.muckled?Boolean

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

Examples:

Check muckled status

Lich::Gemstone::Status.muckled?

Returns:

  • (Boolean)

    true if the character is muckled, false otherwise



88
89
90
# File 'documented/gemstone/infomon/status.rb', line 88

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

.serializeArray<Boolean>

Serializes the current status of the character.

Examples:

Serialize character status

Lich::Gemstone::Status.serialize

Returns:

  • (Array<Boolean>)

    an array of boolean values representing the character's status



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

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

.silenced?Boolean

Checks if the character is silenced.

Examples:

Check silenced status

Lich::Gemstone::Status.silenced?

Returns:

  • (Boolean)

    true if the character is silenced, false otherwise



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

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

.sleeping?Boolean

Checks if the character is sleeping.

Examples:

Check sleeping status

Lich::Gemstone::Status.sleeping?

Returns:

  • (Boolean)

    true if the character is sleeping, false otherwise



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

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:

Check stunned status

Lich::Gemstone::Status.stunned?

Returns:

  • (Boolean)

    true if the character is stunned, false otherwise



80
81
82
# File 'documented/gemstone/infomon/status.rb', line 80

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

.thorned?Boolean

Checks if the character is thorned.

Examples:

Check thorned status

Lich::Gemstone::Status.thorned?

Returns:

  • (Boolean)

    true if the character is thorned, false otherwise



16
17
18
# File 'documented/gemstone/infomon/status.rb', line 16

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

.webbed?Boolean

Checks if the character is webbed.

Examples:

Check webbed status

Lich::Gemstone::Status.webbed?

Returns:

  • (Boolean)

    true if the character is webbed, false otherwise



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

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