Module: Lich::Gemstone::Enhancive

Defined in:
documented/attributes/enhancive.rb

Overview

Provides access to enhancive item bonuses tracked via the INVENTORY ENHANCIVE TOTALS command.

Enhancive items in GemStone IV provide temporary stat, skill, resource, and spell bonuses. This module parses and exposes those bonuses through a clean API, allowing scripts to query current enhancive values, detect over-cap situations, and manage enhancive state.

Data is populated by the Infomon::Parser when processing game output from:

  • ‘INVENTORY ENHANCIVE TOTALS` - Full enhancive breakdown

  • ‘INVENTORY ENHANCIVE` - Active state and pause count

Examples:

Check enhancive strength bonus

Enhancive.strength.value  # => 41
Enhancive.strength.cap    # => 40
Enhancive.str             # => 41 (shorthand)

Check skill bonuses

Enhancive.edged_weapons.bonus  # => 50
Enhancive.edged_weapons.ranks  # => 10
Enhancive.ambush.bonus         # => 52

Check resource bonuses

Enhancive.max_mana.value       # => 18
Enhancive.mana_recovery.value  # => 30

Check for over-cap stats

Enhancive.stat_over_cap?(:strength)  # => true (if > 40)
Enhancive.over_cap_stats             # => [:strength, :agility]

Check enhancive-granted spells

Enhancive.spells              # => [215, 506, 1109]
Enhancive.knows_spell?(215)   # => true

Check active state

Enhancive.active?   # => true/false
Enhancive.pauses    # => 1233

Refresh data from game

Enhancive.refresh         # Full refresh (status + totals)
Enhancive.refresh_status  # Lightweight (just active state + pauses)

See Also:

Constants collapse

STATS =
Note:

Influence is not included as enhancives don’t provide influence bonuses.

List of stat symbols tracked by enhancives.

Returns:

  • (Array<Symbol>)

    Stat symbols

%i[strength constitution dexterity agility discipline aura logic intuition wisdom].freeze
STAT_ABBREV =

Maps 3-letter stat abbreviations to full stat symbols. Used by the parser to convert game output.

Returns:

  • (Hash<String, Symbol>)

    Abbreviation to symbol mapping

{
  'STR' => :strength, 'CON' => :constitution, 'DEX' => :dexterity,
  'AGI' => :agility, 'DIS' => :discipline, 'AUR' => :aura,
  'LOG' => :logic, 'INT' => :intuition, 'WIS' => :wisdom
}.freeze
STAT_CAP =

Maximum enhancive bonus for any single stat.

Returns:

  • (Integer)

    Cap value (40)

40
BONUS_SKILLS =

List of skill symbols that can receive enhancive bonuses. Skills can have both rank bonuses and skill bonus bonuses.

Returns:

  • (Array<Symbol>)

    Skill symbols

%i[
  two_weapon_combat armor_use shield_use combat_maneuvers edged_weapons
  blunt_weapons two_handed_weapons ranged_weapons thrown_weapons polearm_weapons
  brawling ambush multi_opponent_combat physical_fitness dodging arcane_symbols
  magic_item_use spell_aiming harness_power elemental_mana_control mental_mana_control
  spirit_mana_control elemental_lore_air elemental_lore_earth elemental_lore_fire
  elemental_lore_water spiritual_lore_blessings spiritual_lore_religion
  spiritual_lore_summoning sorcerous_lore_demonology sorcerous_lore_necromancy
  mental_lore_divination mental_lore_manipulation mental_lore_telepathy
  mental_lore_transference mental_lore_transformation survival disarming_traps
  picking_locks stalking_and_hiding perception climbing swimming first_aid
  trading pickpocketing
].freeze
SKILL_CAP =

Maximum enhancive bonus for any single skill.

Returns:

  • (Integer)

    Cap value (50)

50
RESOURCES =

List of resource symbols that can receive enhancive bonuses.

Returns:

  • (Array<Symbol>)

    Resource symbols

%i[max_mana max_health max_stamina mana_recovery stamina_recovery].freeze
RESOURCE_CAPS =

Maximum enhancive bonus for each resource type. Different resources have different caps.

Returns:

  • (Hash<Symbol, Integer>)

    Resource to cap mapping

{
  max_mana: 600, max_health: 300, max_stamina: 300,
  mana_recovery: 50, stamina_recovery: 50
}.freeze
SKILL_NAME_MAP =

Maps game output skill names to internal symbol names. Used by the parser to normalize skill names from INVENTORY ENHANCIVE TOTALS.

Returns:

  • (Hash<String, Symbol>)

    Display name to symbol mapping

{
  'Two Weapon Combat'            => :two_weapon_combat,
  'Armor Use'                    => :armor_use,
  'Shield Use'                   => :shield_use,
  'Combat Maneuvers'             => :combat_maneuvers,
  'Edged Weapons'                => :edged_weapons,
  'Blunt Weapons'                => :blunt_weapons,
  'Two-Handed Weapons'           => :two_handed_weapons,
  'Ranged Weapons'               => :ranged_weapons,
  'Thrown Weapons'               => :thrown_weapons,
  'Polearm Weapons'              => :polearm_weapons,
  'Brawling'                     => :brawling,
  'Ambush'                       => :ambush,
  'Multi Opponent Combat'        => :multi_opponent_combat,
  'Physical Fitness'             => :physical_fitness,
  'Dodging'                      => :dodging,
  'Arcane Symbols'               => :arcane_symbols,
  'Magic Item Use'               => :magic_item_use,
  'Spell Aiming'                 => :spell_aiming,
  'Harness Power'                => :harness_power,
  'Elemental Mana Control'       => :elemental_mana_control,
  'Mental Mana Control'          => :mental_mana_control,
  'Spirit Mana Control'          => :spirit_mana_control,
  'Elemental Lore - Air'         => :elemental_lore_air,
  'Elemental Lore - Earth'       => :elemental_lore_earth,
  'Elemental Lore - Fire'        => :elemental_lore_fire,
  'Elemental Lore - Water'       => :elemental_lore_water,
  'Spiritual Lore - Blessings'   => :spiritual_lore_blessings,
  'Spiritual Lore - Religion'    => :spiritual_lore_religion,
  'Spiritual Lore - Summoning'   => :spiritual_lore_summoning,
  'Sorcerous Lore - Demonology'  => :sorcerous_lore_demonology,
  'Sorcerous Lore - Necromancy'  => :sorcerous_lore_necromancy,
  'Mental Lore - Divination'     => :mental_lore_divination,
  'Mental Lore - Manipulation'   => :mental_lore_manipulation,
  'Mental Lore - Telepathy'      => :mental_lore_telepathy,
  'Mental Lore - Transference'   => :mental_lore_transference,
  'Mental Lore - Transformation' => :mental_lore_transformation,
  'Survival'                     => :survival,
  'Disarming Traps'              => :disarming_traps,
  'Picking Locks'                => :picking_locks,
  'Stalking and Hiding'          => :stalking_and_hiding,
  'Perception'                   => :perception,
  'Climbing'                     => :climbing,
  'Swimming'                     => :swimming,
  'First Aid'                    => :first_aid,
  'Trading'                      => :trading,
  'Pickpocketing'                => :pickpocketing
}.freeze
RESOURCE_NAME_MAP =

Maps game output resource names to internal symbol names. Used by the parser to normalize resource names from INVENTORY ENHANCIVE TOTALS.

Returns:

  • (Hash<String, Symbol>)

    Display name to symbol mapping

{
  'Max Mana'         => :max_mana,
  'Max Health'       => :max_health,
  'Max Stamina'      => :max_stamina,
  'Mana Recovery'    => :mana_recovery,
  'Stamina Recovery' => :stamina_recovery
}.freeze

Stat Accessors collapse

Resource Accessors collapse

Spell Accessors collapse

Statistics Accessors collapse

Active State collapse

Metadata collapse

Utility Methods collapse

Refresh Methods collapse

Internal Methods collapse

Class Method Details

.active?Boolean

Returns whether enhancives are currently active (toggled on). Players can toggle enhancives on/off with INVENTORY ENHANCIVE ON/OFF.

Returns:

  • (Boolean)

    true if enhancives are active



407
408
409
# File 'documented/attributes/enhancive.rb', line 407

def self.active?
  Infomon.get("enhancive.active") == true
end

.active_last_updatedTime?

Returns the Time when active state was last updated.

Returns:

  • (Time, nil)

    Time of last update, or nil if never updated



414
415
416
417
# File 'documented/attributes/enhancive.rb', line 414

def self.active_last_updated
  timestamp = Infomon.get_updated_at("enhancive.active")
  timestamp ? Time.at(timestamp) : nil
end

.healthOpenStruct

Convenience alias for #max_health.

Returns:

  • (OpenStruct)

    Same as max_health



335
336
337
# File 'documented/attributes/enhancive.rb', line 335

def self.health
  max_health
end

.item_countInteger

Returns the total number of enhancive items contributing bonuses.

Returns:

  • (Integer)

    Number of enhancive items



380
381
382
# File 'documented/attributes/enhancive.rb', line 380

def self.item_count
  Infomon.get("enhancive.stats.item_count").to_i
end

.knows_spell?(spell_num) ⇒ Boolean

Check if enhancives grant knowledge of a specific spell.

Examples:

Enhancive.knows_spell?(215)   # => true
Enhancive.knows_spell?(101)   # => false

Parameters:

  • spell_num (Integer, String)

    Spell number to check

Returns:

  • (Boolean)

    true if enhancives grant this spell



369
370
371
# File 'documented/attributes/enhancive.rb', line 369

def self.knows_spell?(spell_num)
  spells.include?(spell_num.to_i)
end

.last_updatedTime?

Returns the Time when enhancive data was last refreshed. Based on when item_count was last updated.

Returns:

  • (Time, nil)

    Time of last refresh, or nil if never refreshed



435
436
437
438
# File 'documented/attributes/enhancive.rb', line 435

def self.last_updated
  timestamp = Infomon.get_updated_at("enhancive.stats.item_count")
  timestamp ? Time.at(timestamp) : nil
end

.manaOpenStruct

Convenience alias for #max_mana.

Returns:

  • (OpenStruct)

    Same as max_mana



329
330
331
# File 'documented/attributes/enhancive.rb', line 329

def self.mana
  max_mana
end

.over_cap_skillsArray<Symbol>

Returns all skills that are currently over their enhancive cap.

Examples:

Enhancive.over_cap_skills  # => [:ambush, :stalking_and_hiding]

Returns:

  • (Array<Symbol>)

    Array of skill symbols that are over cap



479
480
481
# File 'documented/attributes/enhancive.rb', line 479

def self.over_cap_skills
  BONUS_SKILLS.select { |s| skill_over_cap?(s) rescue false }
end

.over_cap_statsArray<Symbol>

Returns all stats that are currently over their enhancive cap.

Examples:

Enhancive.over_cap_stats  # => [:strength, :agility]

Returns:

  • (Array<Symbol>)

    Array of stat symbols that are over cap



470
471
472
# File 'documented/attributes/enhancive.rb', line 470

def self.over_cap_stats
  STATS.select { |s| stat_over_cap?(s) }
end

.pausesInteger

Returns the number of enhancive pauses available. Pauses allow temporarily disabling enhancive drain.

Returns:

  • (Integer)

    Number of pauses available



423
424
425
# File 'documented/attributes/enhancive.rb', line 423

def self.pauses
  Infomon.get("enhancive.pauses").to_i
end

.property_countInteger

Returns the total number of enhancive properties across all items. A single item can have multiple enhancive properties.

Returns:

  • (Integer)

    Number of enhancive properties



388
389
390
# File 'documented/attributes/enhancive.rb', line 388

def self.property_count
  Infomon.get("enhancive.stats.property_count").to_i
end

.refreshvoid

Note:

Output is hidden from the user via quiet mode

This method returns an undefined value.

Triggers a full refresh of enhancive data from the game. Issues INVENTORY ENHANCIVE and INVENTORY ENHANCIVE TOTALS commands. Blocks until complete.



493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
# File 'documented/attributes/enhancive.rb', line 493

def self.refresh
  respond "Refreshing enhancive data..."
  # First get status (active state + pauses)
  Lich::Util.issue_command(
    "invento enh",
    /^You are (?:currently|not currently|now|already|no longer)/,
    /<prompt/,
    include_end: true, timeout: 5, silent: false, usexml: true, quiet: true
  )
  # Then get full totals
  # TODO: Update start pattern once GM adds proper start message to invento enhancive totals
  # Current pattern is fragile - if player has no stat enhancives, output starts with Skills/Resources
  Lich::Util.issue_command(
    "invento enhancive totals",
    /^<pushBold\/>(?:Stats:|Skills:|Resources:)|^No enhancive item bonuses found\./,
    /<prompt/,
    include_end: true, timeout: 5, silent: false, usexml: true, quiet: true
  )
  respond "Enhancive data refreshed."
end

.refresh_statusvoid

Note:

Faster than refresh when you only need active state

This method returns an undefined value.

Triggers a lightweight refresh of just the active state and pause count. Issues only INVENTORY ENHANCIVE command. Blocks until complete.



520
521
522
523
524
525
526
527
# File 'documented/attributes/enhancive.rb', line 520

def self.refresh_status
  Lich::Util.issue_command(
    "invento enh",
    /^You are (?:currently|not currently|now|already|no longer)/,
    /<prompt/,
    include_end: true, timeout: 5, silent: false, usexml: true, quiet: true
  )
end

.reset_allvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Resets all enhancive values to 0/empty. Called by the parser before populating new data to ensure stale values are cleared. This is critical because game output only shows non-zero values.



539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'documented/attributes/enhancive.rb', line 539

def self.reset_all
  batch = []

  # Reset all stats to 0
  STATS.each do |stat|
    batch.push(["enhancive.stat.#{stat}", 0])
  end

  # Reset all skills to 0
  BONUS_SKILLS.each do |skill|
    batch.push(["enhancive.skill.#{skill}.ranks", 0])
    batch.push(["enhancive.skill.#{skill}.bonus", 0])
  end

  # Reset all resources to 0
  RESOURCES.each do |resource|
    batch.push(["enhancive.resource.#{resource}", 0])
  end

  # Reset spells to empty array
  batch.push(["enhancive.spells", ""])

  # Reset statistics to 0
  batch.push(["enhancive.stats.item_count", 0])
  batch.push(["enhancive.stats.property_count", 0])
  batch.push(["enhancive.stats.total_amount", 0])

  Infomon.upsert_batch(batch)
end

.skill_over_cap?(skill) ⇒ Boolean

Check if a specific skill’s enhancive bonus exceeds the cap.

Examples:

Enhancive.skill_over_cap?(:ambush)  # => true (if bonus > 50)

Parameters:

  • skill (Symbol)

    Skill symbol (e.g., :ambush, :edged_weapons)

Returns:

  • (Boolean)

    true if the skill bonus exceeds SKILL_CAP



460
461
462
463
# File 'documented/attributes/enhancive.rb', line 460

def self.skill_over_cap?(skill)
  s = send(skill)
  s.bonus > SKILL_CAP
end

.spellsArray<Integer>

Returns array of spell numbers that enhancives grant self-knowledge of. These are spells the character can cast due to enhancive items, not trained spells.

Examples:

Enhancive.spells  # => [215, 506, 1109]

Returns:

  • (Array<Integer>)

    Array of spell numbers, or empty array if none



355
356
357
358
359
360
# File 'documented/attributes/enhancive.rb', line 355

def self.spells
  raw = Infomon.get("enhancive.spells")
  return [] if raw.nil? || raw.empty?

  raw.to_s.split(',').map(&:to_i)
end

.staminaOpenStruct

Convenience alias for #max_stamina.

Returns:

  • (OpenStruct)

    Same as max_stamina



341
342
343
# File 'documented/attributes/enhancive.rb', line 341

def self.stamina
  max_stamina
end

.stat_over_cap?(stat) ⇒ Boolean

Check if a specific stat’s enhancive bonus exceeds the cap.

Examples:

Enhancive.stat_over_cap?(:strength)  # => true (if > 40)

Parameters:

  • stat (Symbol)

    Stat symbol (e.g., :strength, :agility)

Returns:

  • (Boolean)

    true if the stat bonus exceeds STAT_CAP



450
451
452
# File 'documented/attributes/enhancive.rb', line 450

def self.stat_over_cap?(stat)
  send(stat).value > STAT_CAP
end

.total_amountInteger

Returns the sum of all enhancive bonus amounts.

Returns:

  • (Integer)

    Total enhancive amount



395
396
397
# File 'documented/attributes/enhancive.rb', line 395

def self.total_amount
  Infomon.get("enhancive.stats.total_amount").to_i
end

Instance Method Details

#agiInteger

Returns Enhancive agility bonus value.

Returns:

  • (Integer)

    Enhancive agility bonus value



221
222
223
224
225
226
# File 'documented/attributes/enhancive.rb', line 221

%i[str con dex agi dis aur log int wis].each do |shorthand|
  long_hand = STATS.find { |s| s.to_s.start_with?(shorthand.to_s) }
  define_singleton_method(shorthand) do
    send(long_hand).value
  end
end

#agilityOpenStruct

Returns Struct with :value (Integer) and :cap (Integer).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (Integer)



193
194
195
196
197
198
199
200
# File 'documented/attributes/enhancive.rb', line 193

STATS.each do |stat|
  define_singleton_method(stat) do
    OpenStruct.new(
      value: Infomon.get("enhancive.stat.#{stat}").to_i,
      cap: STAT_CAP
    )
  end
end

#aurInteger

Returns Enhancive aura bonus value.

Returns:

  • (Integer)

    Enhancive aura bonus value



221
222
223
224
225
226
# File 'documented/attributes/enhancive.rb', line 221

%i[str con dex agi dis aur log int wis].each do |shorthand|
  long_hand = STATS.find { |s| s.to_s.start_with?(shorthand.to_s) }
  define_singleton_method(shorthand) do
    send(long_hand).value
  end
end

#auraOpenStruct

Returns Struct with :value (Integer) and :cap (Integer).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (Integer)



193
194
195
196
197
198
199
200
# File 'documented/attributes/enhancive.rb', line 193

STATS.each do |stat|
  define_singleton_method(stat) do
    OpenStruct.new(
      value: Infomon.get("enhancive.stat.#{stat}").to_i,
      cap: STAT_CAP
    )
  end
end

#conInteger

Returns Enhancive constitution bonus value.

Returns:

  • (Integer)

    Enhancive constitution bonus value



221
222
223
224
225
226
# File 'documented/attributes/enhancive.rb', line 221

%i[str con dex agi dis aur log int wis].each do |shorthand|
  long_hand = STATS.find { |s| s.to_s.start_with?(shorthand.to_s) }
  define_singleton_method(shorthand) do
    send(long_hand).value
  end
end

#constitutionOpenStruct

Returns Struct with :value (Integer) and :cap (Integer).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (Integer)



193
194
195
196
197
198
199
200
# File 'documented/attributes/enhancive.rb', line 193

STATS.each do |stat|
  define_singleton_method(stat) do
    OpenStruct.new(
      value: Infomon.get("enhancive.stat.#{stat}").to_i,
      cap: STAT_CAP
    )
  end
end

#dexInteger

Returns Enhancive dexterity bonus value.

Returns:

  • (Integer)

    Enhancive dexterity bonus value



221
222
223
224
225
226
# File 'documented/attributes/enhancive.rb', line 221

%i[str con dex agi dis aur log int wis].each do |shorthand|
  long_hand = STATS.find { |s| s.to_s.start_with?(shorthand.to_s) }
  define_singleton_method(shorthand) do
    send(long_hand).value
  end
end

#dexterityOpenStruct

Returns Struct with :value (Integer) and :cap (Integer).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (Integer)



193
194
195
196
197
198
199
200
# File 'documented/attributes/enhancive.rb', line 193

STATS.each do |stat|
  define_singleton_method(stat) do
    OpenStruct.new(
      value: Infomon.get("enhancive.stat.#{stat}").to_i,
      cap: STAT_CAP
    )
  end
end

#disInteger

Returns Enhancive discipline bonus value.

Returns:

  • (Integer)

    Enhancive discipline bonus value



221
222
223
224
225
226
# File 'documented/attributes/enhancive.rb', line 221

%i[str con dex agi dis aur log int wis].each do |shorthand|
  long_hand = STATS.find { |s| s.to_s.start_with?(shorthand.to_s) }
  define_singleton_method(shorthand) do
    send(long_hand).value
  end
end

#disciplineOpenStruct

Returns Struct with :value (Integer) and :cap (Integer).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (Integer)



193
194
195
196
197
198
199
200
# File 'documented/attributes/enhancive.rb', line 193

STATS.each do |stat|
  define_singleton_method(stat) do
    OpenStruct.new(
      value: Infomon.get("enhancive.stat.#{stat}").to_i,
      cap: STAT_CAP
    )
  end
end

#intInteger

Returns Enhancive intuition bonus value.

Returns:

  • (Integer)

    Enhancive intuition bonus value



221
222
223
224
225
226
# File 'documented/attributes/enhancive.rb', line 221

%i[str con dex agi dis aur log int wis].each do |shorthand|
  long_hand = STATS.find { |s| s.to_s.start_with?(shorthand.to_s) }
  define_singleton_method(shorthand) do
    send(long_hand).value
  end
end

#intuitionOpenStruct

Returns Struct with :value (Integer) and :cap (Integer).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (Integer)



193
194
195
196
197
198
199
200
# File 'documented/attributes/enhancive.rb', line 193

STATS.each do |stat|
  define_singleton_method(stat) do
    OpenStruct.new(
      value: Infomon.get("enhancive.stat.#{stat}").to_i,
      cap: STAT_CAP
    )
  end
end

#logInteger

Returns Enhancive logic bonus value.

Returns:

  • (Integer)

    Enhancive logic bonus value



221
222
223
224
225
226
# File 'documented/attributes/enhancive.rb', line 221

%i[str con dex agi dis aur log int wis].each do |shorthand|
  long_hand = STATS.find { |s| s.to_s.start_with?(shorthand.to_s) }
  define_singleton_method(shorthand) do
    send(long_hand).value
  end
end

#logicOpenStruct

Returns Struct with :value (Integer) and :cap (Integer).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (Integer)



193
194
195
196
197
198
199
200
# File 'documented/attributes/enhancive.rb', line 193

STATS.each do |stat|
  define_singleton_method(stat) do
    OpenStruct.new(
      value: Infomon.get("enhancive.stat.#{stat}").to_i,
      cap: STAT_CAP
    )
  end
end

#mana_recoveryOpenStruct

Returns Struct with :value (Integer) and :cap (50).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (50)



318
319
320
321
322
323
324
325
# File 'documented/attributes/enhancive.rb', line 318

RESOURCES.each do |resource|
  define_singleton_method(resource) do
    OpenStruct.new(
      value: Infomon.get("enhancive.resource.#{resource}").to_i,
      cap: RESOURCE_CAPS[resource]
    )
  end
end

#max_healthOpenStruct

Returns Struct with :value (Integer) and :cap (300).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (300)



318
319
320
321
322
323
324
325
# File 'documented/attributes/enhancive.rb', line 318

RESOURCES.each do |resource|
  define_singleton_method(resource) do
    OpenStruct.new(
      value: Infomon.get("enhancive.resource.#{resource}").to_i,
      cap: RESOURCE_CAPS[resource]
    )
  end
end

#max_manaOpenStruct

Returns Struct with :value (Integer) and :cap (600).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (600)



318
319
320
321
322
323
324
325
# File 'documented/attributes/enhancive.rb', line 318

RESOURCES.each do |resource|
  define_singleton_method(resource) do
    OpenStruct.new(
      value: Infomon.get("enhancive.resource.#{resource}").to_i,
      cap: RESOURCE_CAPS[resource]
    )
  end
end

#max_staminaOpenStruct

Returns Struct with :value (Integer) and :cap (300).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (300)



318
319
320
321
322
323
324
325
# File 'documented/attributes/enhancive.rb', line 318

RESOURCES.each do |resource|
  define_singleton_method(resource) do
    OpenStruct.new(
      value: Infomon.get("enhancive.resource.#{resource}").to_i,
      cap: RESOURCE_CAPS[resource]
    )
  end
end

#stamina_recoveryOpenStruct

Returns Struct with :value (Integer) and :cap (50).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (50)



318
319
320
321
322
323
324
325
# File 'documented/attributes/enhancive.rb', line 318

RESOURCES.each do |resource|
  define_singleton_method(resource) do
    OpenStruct.new(
      value: Infomon.get("enhancive.resource.#{resource}").to_i,
      cap: RESOURCE_CAPS[resource]
    )
  end
end

#strInteger

Returns Enhancive strength bonus value.

Returns:

  • (Integer)

    Enhancive strength bonus value



221
222
223
224
225
226
# File 'documented/attributes/enhancive.rb', line 221

%i[str con dex agi dis aur log int wis].each do |shorthand|
  long_hand = STATS.find { |s| s.to_s.start_with?(shorthand.to_s) }
  define_singleton_method(shorthand) do
    send(long_hand).value
  end
end

#strengthOpenStruct

Returns Struct with :value (Integer) and :cap (Integer).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (Integer)



193
194
195
196
197
198
199
200
# File 'documented/attributes/enhancive.rb', line 193

STATS.each do |stat|
  define_singleton_method(stat) do
    OpenStruct.new(
      value: Infomon.get("enhancive.stat.#{stat}").to_i,
      cap: STAT_CAP
    )
  end
end

#wisInteger

Returns Enhancive wisdom bonus value.

Returns:

  • (Integer)

    Enhancive wisdom bonus value



221
222
223
224
225
226
# File 'documented/attributes/enhancive.rb', line 221

%i[str con dex agi dis aur log int wis].each do |shorthand|
  long_hand = STATS.find { |s| s.to_s.start_with?(shorthand.to_s) }
  define_singleton_method(shorthand) do
    send(long_hand).value
  end
end

#wisdomOpenStruct

Returns Struct with :value (Integer) and :cap (Integer).

Returns:

  • (OpenStruct)

    Struct with :value (Integer) and :cap (Integer)



193
194
195
196
197
198
199
200
# File 'documented/attributes/enhancive.rb', line 193

STATS.each do |stat|
  define_singleton_method(stat) do
    OpenStruct.new(
      value: Infomon.get("enhancive.stat.#{stat}").to_i,
      cap: STAT_CAP
    )
  end
end