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
Constants collapse
- STATS =
Note:
Influence is not included as enhancives don’t provide influence bonuses.
List of stat symbols tracked by enhancives.
%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.
{ '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.
40- BONUS_SKILLS =
List of skill symbols that can receive enhancive bonuses. Skills can have both rank bonuses and skill bonus bonuses.
%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.
50- RESOURCES =
List of resource symbols that can receive enhancive bonuses.
%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.
{ 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.
{ '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.
{ 'Max Mana' => :max_mana, 'Max Health' => :max_health, 'Max Stamina' => :max_stamina, 'Mana Recovery' => :mana_recovery, 'Stamina Recovery' => :stamina_recovery }.freeze
Stat Accessors collapse
-
#agi ⇒ Integer
Enhancive agility bonus value.
-
#agility ⇒ OpenStruct
Struct with :value (Integer) and :cap (Integer).
-
#aur ⇒ Integer
Enhancive aura bonus value.
-
#aura ⇒ OpenStruct
Struct with :value (Integer) and :cap (Integer).
-
#con ⇒ Integer
Enhancive constitution bonus value.
-
#constitution ⇒ OpenStruct
Struct with :value (Integer) and :cap (Integer).
-
#dex ⇒ Integer
Enhancive dexterity bonus value.
-
#dexterity ⇒ OpenStruct
Struct with :value (Integer) and :cap (Integer).
-
#dis ⇒ Integer
Enhancive discipline bonus value.
-
#discipline ⇒ OpenStruct
Struct with :value (Integer) and :cap (Integer).
-
#int ⇒ Integer
Enhancive intuition bonus value.
-
#intuition ⇒ OpenStruct
Struct with :value (Integer) and :cap (Integer).
-
#log ⇒ Integer
Enhancive logic bonus value.
-
#logic ⇒ OpenStruct
Struct with :value (Integer) and :cap (Integer).
-
#str ⇒ Integer
Enhancive strength bonus value.
-
#strength ⇒ OpenStruct
Struct with :value (Integer) and :cap (Integer).
-
#wis ⇒ Integer
Enhancive wisdom bonus value.
-
#wisdom ⇒ OpenStruct
Struct with :value (Integer) and :cap (Integer).
Resource Accessors collapse
-
.health ⇒ OpenStruct
Convenience alias for #max_health.
-
.mana ⇒ OpenStruct
Convenience alias for #max_mana.
-
.stamina ⇒ OpenStruct
Convenience alias for #max_stamina.
-
#mana_recovery ⇒ OpenStruct
Struct with :value (Integer) and :cap (50).
-
#max_health ⇒ OpenStruct
Struct with :value (Integer) and :cap (300).
-
#max_mana ⇒ OpenStruct
Struct with :value (Integer) and :cap (600).
-
#max_stamina ⇒ OpenStruct
Struct with :value (Integer) and :cap (300).
-
#stamina_recovery ⇒ OpenStruct
Struct with :value (Integer) and :cap (50).
Spell Accessors collapse
-
.knows_spell?(spell_num) ⇒ Boolean
Check if enhancives grant knowledge of a specific spell.
-
.spells ⇒ Array<Integer>
Returns array of spell numbers that enhancives grant self-knowledge of.
Statistics Accessors collapse
-
.item_count ⇒ Integer
Returns the total number of enhancive items contributing bonuses.
-
.property_count ⇒ Integer
Returns the total number of enhancive properties across all items.
-
.total_amount ⇒ Integer
Returns the sum of all enhancive bonus amounts.
Active State collapse
-
.active? ⇒ Boolean
Returns whether enhancives are currently active (toggled on).
-
.active_last_updated ⇒ Time?
Returns the Time when active state was last updated.
-
.pauses ⇒ Integer
Returns the number of enhancive pauses available.
Metadata collapse
-
.last_updated ⇒ Time?
Returns the Time when enhancive data was last refreshed.
Utility Methods collapse
-
.over_cap_skills ⇒ Array<Symbol>
Returns all skills that are currently over their enhancive cap.
-
.over_cap_stats ⇒ Array<Symbol>
Returns all stats that are currently over their enhancive cap.
-
.skill_over_cap?(skill) ⇒ Boolean
Check if a specific skill’s enhancive bonus exceeds the cap.
-
.stat_over_cap?(stat) ⇒ Boolean
Check if a specific stat’s enhancive bonus exceeds the cap.
Refresh Methods collapse
-
.refresh ⇒ void
Triggers a full refresh of enhancive data from the game.
-
.refresh_status ⇒ void
Triggers a lightweight refresh of just the active state and pause count.
Internal Methods collapse
-
.reset_all ⇒ void
private
Resets all enhancive values to 0/empty.
Class Method Details
.active? ⇒ Boolean
Returns whether enhancives are currently active (toggled on). Players can toggle enhancives on/off with INVENTORY ENHANCIVE ON/OFF.
407 408 409 |
# File 'documented/attributes/enhancive.rb', line 407 def self.active? Infomon.get("enhancive.active") == true end |
.active_last_updated ⇒ Time?
Returns the Time when active state was last updated.
414 415 416 417 |
# File 'documented/attributes/enhancive.rb', line 414 def self.active_last_updated = Infomon.get_updated_at("enhancive.active") ? Time.at() : nil end |
.health ⇒ OpenStruct
Convenience alias for #max_health.
335 336 337 |
# File 'documented/attributes/enhancive.rb', line 335 def self.health max_health end |
.item_count ⇒ Integer
Returns the total number of enhancive items contributing bonuses.
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.
369 370 371 |
# File 'documented/attributes/enhancive.rb', line 369 def self.knows_spell?(spell_num) spells.include?(spell_num.to_i) end |
.last_updated ⇒ Time?
Returns the Time when enhancive data was last refreshed. Based on when item_count was last updated.
435 436 437 438 |
# File 'documented/attributes/enhancive.rb', line 435 def self.last_updated = Infomon.get_updated_at("enhancive.stats.item_count") ? Time.at() : nil end |
.mana ⇒ OpenStruct
Convenience alias for #max_mana.
329 330 331 |
# File 'documented/attributes/enhancive.rb', line 329 def self.mana max_mana end |
.over_cap_skills ⇒ Array<Symbol>
Returns all skills that are currently over their enhancive 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_stats ⇒ Array<Symbol>
Returns all stats that are currently over their enhancive cap.
470 471 472 |
# File 'documented/attributes/enhancive.rb', line 470 def self.over_cap_stats STATS.select { |s| stat_over_cap?(s) } end |
.pauses ⇒ Integer
Returns the number of enhancive pauses available. Pauses allow temporarily disabling enhancive drain.
423 424 425 |
# File 'documented/attributes/enhancive.rb', line 423 def self.pauses Infomon.get("enhancive.pauses").to_i end |
.property_count ⇒ Integer
Returns the total number of enhancive properties across all items. A single item can have multiple 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 |
.refresh ⇒ void
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_status ⇒ void
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_all ⇒ void
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.
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 |
.spells ⇒ Array<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.
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 |
.stamina ⇒ OpenStruct
Convenience alias for #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.
450 451 452 |
# File 'documented/attributes/enhancive.rb', line 450 def self.stat_over_cap?(stat) send(stat).value > STAT_CAP end |
Instance Method Details
#agi ⇒ Integer
Returns 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 |
#agility ⇒ OpenStruct
Returns 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 |
#aur ⇒ Integer
Returns 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 |
#aura ⇒ OpenStruct
Returns 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 |
#con ⇒ Integer
Returns 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 |
#constitution ⇒ OpenStruct
Returns 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 |
#dex ⇒ Integer
Returns 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 |
#dexterity ⇒ OpenStruct
Returns 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 |
#dis ⇒ Integer
Returns 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 |
#discipline ⇒ OpenStruct
Returns 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 |
#int ⇒ Integer
Returns 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 |
#intuition ⇒ OpenStruct
Returns 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 |
#log ⇒ Integer
Returns 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 |
#logic ⇒ OpenStruct
Returns 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_recovery ⇒ OpenStruct
Returns 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_health ⇒ OpenStruct
Returns 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_mana ⇒ OpenStruct
Returns 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_stamina ⇒ OpenStruct
Returns 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_recovery ⇒ OpenStruct
Returns 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 |
#str ⇒ Integer
Returns 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 |
#strength ⇒ OpenStruct
Returns 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 |
#wis ⇒ Integer
Returns 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 |
#wisdom ⇒ OpenStruct
Returns 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 |