From f7ba2ca831e49dd67478be5ca63fc9e18a2aaf81 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Fri, 12 Apr 2013 18:22:02 -0400 Subject: [PATCH] Fixed bug where modified DPS was not being used for DPS Score --- libs/diabloclass.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/libs/diabloclass.php b/libs/diabloclass.php index f745c3e..c965c21 100644 --- a/libs/diabloclass.php +++ b/libs/diabloclass.php @@ -35,7 +35,6 @@ class DiabloClass { $this->stats->stats['All Elemental Damage'] = $this->elementalDamage(); - $this->modifyDPSUnbuffed(); $this->calculateEHP(); } @@ -49,7 +48,15 @@ class DiabloClass { } function DPSScore() { - return $this->stats->getStat('DPS Unbuffed') / 1000; + if($this->type == 'pvp') { + $eliteDivisor = 1; + } else { + $eliteDivisor = 2; + } + $dps = $this->stats->getStat('DPS Unbuffed') * + max(1, 1 + ($this->stats->getStat('+DPS Against Elites') / $eliteDivisor)); + + return $dps / 1000; } function EHPScore() { @@ -102,16 +109,6 @@ class DiabloClass { return $this->stats->getStat('Paragon Level') == 100; } - function modifyDPSUnbuffed() { - if($this->type == 'pvp') { - $eliteDivisor = 1; - } else { - $eliteDivisor = 2; - } - $this->stats->stats['DPS Unbuffed'] = $this->stats->getStat('DPS Unbuffed') * - max(1, 1 + ($this->stats->getStat('+DPS Against Elites') / $eliteDivisor)); - } - private function elementalDamage() { $totalElemental = 0;