Skip to content

Commit

Permalink
Add more keys to bonus_stats since the Armory now stores some values …
Browse files Browse the repository at this point in the history
…in these keys as well (seemingly at random).
  • Loading branch information
rspeicher authored and pwood committed Jan 3, 2010
1 parent 956740f commit 15158e5
Showing 1 changed file with 41 additions and 5 deletions.
46 changes: 41 additions & 5 deletions lib/wowr/item.rb
Expand Up @@ -202,11 +202,47 @@ def initialize(elem, api = nil)
@bonuses = {}

bonus_stats = {
:strength => :bonusStrength,
:agility => :bonusAgility,
:stamina => :bonusStamina,
:intellect => :bonusIntellect,
:spirit => :bonusSpirit
:strength => :bonusStrength,
:agility => :bonusAgility,
:stamina => :bonusStamina,
:intellect => :bonusIntellect,
:spirit => :bonusSpirit,

# http://www.wowarmory.com/_layout/items/tooltip.xsl defines these bonuses as well
:defense => :bonusDefenseSkillRating,
:dodge => :bonusDodgeRating,
:parry => :bonusParryRating,
:block => :bonusBlockRating,
:melee_hit => :bonusHitMeleeRating,
:ranged_hit => :bonusHitRangedRating,
:spell_hit => :bonusHitSpellRating,
:melee_crit => :bonusCritMeleeRating,
:ranged_crit => :bonusCritRangedRating,
:spell_crit => :bonusCritSpellRating,
# :bonusHitTakenMeleeRating,
# :bonusHitTakenRangedRating,
# :bonusHitTakenSpellRating,
# :bonusCritTakenMeleeRating,
# :bonusCritTakenRangedRating,
# :bonusCritTakenSpellRating,
:melee_haste => :bonusHasteMeleeRating,
:ranged_haste => :bonusHasteRangedRating,
:spell_haste => :bonusHasteSpellRating,
:hit => :bonusHitRating,
:crit => :bonusCritRating,
# :bonusHitTakenRating,
# :bonusCritTakenRating,
:resilience => :bonusResilienceRating,
:haste => :bonusHasteRating,
:spell_power => :bonusSpellPower,
:attack_power => :bonusAttackPower,
:feral_attack_power => :bonusFeralAttackPower,
:mana_regen => :bonusManaRegen,
:armor_penetration => :bonusArmorPenetration,
:block_value => :bonusBlockValue,
:health_regen => :bonusHealthRegen,
:spell_penetration => :bonusSpellPenetration,
:expertise => :bonusExpertiseRating,
}
bonus_stats.each do |stat, xml_elem|
@bonuses[stat] = test_stat(elem/xml_elem) if test_stat(elem/xml_elem)
Expand Down

0 comments on commit 15158e5

Please sign in to comment.