From e07857d1affab13358f553e97707e16a49427a12 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Mon, 15 Apr 2013 03:16:49 -0400 Subject: [PATCH] Update barb DPS score with adjusted APS --- libs/barbarian.php | 19 +++++++++++++++++++ libs/demonhunter.php | 12 ++++++++++++ libs/diabloclass.php | 10 +--------- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/libs/barbarian.php b/libs/barbarian.php index b06a37b..37338c6 100644 --- a/libs/barbarian.php +++ b/libs/barbarian.php @@ -4,6 +4,25 @@ class Barbarian extends DiabloClass { parent::__construct($stats, $type); } + function DPSScore() { + 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)); + + if($this->type == 'pvp') { + $aps = $this->stats->getStat('Attacks per Second'); + $overAps = $aps - 1; + + $dps = $dps / (1 + ($overAps / 2)); + } + + return $dps / 1000; + } + function EHPScore() { $ehp = $this->calculateEHP(); diff --git a/libs/demonhunter.php b/libs/demonhunter.php index 16f0c63..adcd416 100644 --- a/libs/demonhunter.php +++ b/libs/demonhunter.php @@ -4,6 +4,18 @@ class DemonHunter extends DiabloClass { parent::__construct($stats, $type); } + function DPSScore() { + 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() { $ehp = $this->calculateEHP(); diff --git a/libs/diabloclass.php b/libs/diabloclass.php index c965c21..141637a 100644 --- a/libs/diabloclass.php +++ b/libs/diabloclass.php @@ -48,15 +48,7 @@ class DiabloClass { } function DPSScore() { - 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; + return 0; } function EHPScore() {