From a829fe580a145e486922e25bdca28ae695747414 Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 22:24:23 -0600 Subject: [PATCH] Animation speed now properly scales That is, the increase in attack speed is the same as the increase in animation speed. Previously, this was only the case for absolute increases. Now percentage increases do so, as well. --- source/glest_game/types/skill_type.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index 9aabec79..b6aa6318 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -941,8 +941,16 @@ int AttackSkillType::getTotalSpeed(const TotalUpgrade *totalUpgrade) const{ return result; } +// Get the amount to boost the attack animation speed by (based on attack-speed upgrades) int AttackSkillType::getAnimSpeedBoost(const TotalUpgrade *totalUpgrade) const{ - return totalUpgrade->getAttackSpeed(this); + // Same calculation as in TotalUpgrade::sum, but bypassing the use of the value + // list (which is for the attack speed, not animation speed) + if(totalUpgrade->getAttackRangeIsMultiplier()) { + return animSpeed * (totalUpgrade->getAttackSpeed(NULL) / (double)100); + } + else { + return totalUpgrade->getAttackSpeed(NULL); + } } string AttackSkillType::toString(bool translatedValue) const{