diff --git a/libs/barbarian.php b/libs/barbarian.php index ca0a74c..b06a37b 100644 --- a/libs/barbarian.php +++ b/libs/barbarian.php @@ -5,8 +5,7 @@ class Barbarian extends DiabloClass { } function EHPScore() { - $this->calculateEHP(); - $ehp = $this->stats->getStat('EHP Unbuffed'); + $ehp = $this->calculateEHP(); if($this->type == 'pvp') { return $ehp / 10000; @@ -64,5 +63,6 @@ class Barbarian extends DiabloClass { + $this->stats->getStat('Missile Damage Reduction')) / 2); $this->stats->stats['EHP Unbuffed'] = $final_ehp; + return $final_ehp; } } \ No newline at end of file diff --git a/libs/demonhunter.php b/libs/demonhunter.php index 9c12375..0423bf1 100644 --- a/libs/demonhunter.php +++ b/libs/demonhunter.php @@ -5,8 +5,7 @@ class DemonHunter extends DiabloClass { } function EHPScore() { - $this->calculateEHP(); - $ehp = $this->stats->getStat('EHP Unbuffed'); + $ehp = $this->calculateEHP(); if($this->type == 'pvp') { return $ehp / 10000; @@ -24,6 +23,7 @@ class DemonHunter extends DiabloClass { } function sustainScore() { + $ehp = $this->calculateEHP(); if($this->stats->getStat('Attacks per Second') > 2) { $lsCoefficient = .1; } else { @@ -32,7 +32,7 @@ class DemonHunter extends DiabloClass { $effectiveLs = $this->stats->getStat('DPS Unbuffed') * $this->stats->getStat('Life Steal') * $lsCoefficient; - $mitigation = $this->stats->getStat('EHP Unbuffed') / $this->stats->getStat('Life'); + $mitigation = $ehp / $this->stats->getStat('Life'); $loh = $this->stats->getStat('Life on Hit'); if($this->type == 'pvp') { @@ -45,7 +45,7 @@ class DemonHunter extends DiabloClass { (1 + ($this->stats->getStat('Attacks per Second') - 1) / 2) + $this->stats->getStat('Life per Second') + $effectiveLs) / ($this->stats->getStat('Life') * $this->EHPScore() * 10000 / - $this->stats->getStat('EHP Unbuffed')); + $ehp); if($rawSustainScore <= 1.5) { return $rawSustainScore; @@ -105,5 +105,6 @@ class DemonHunter extends DiabloClass { + $this->stats->getStat('Missile Damage Reduction')) / 2); $this->stats->stats['EHP Unbuffed'] = $final_ehp; + return $final_ehp; } } \ No newline at end of file diff --git a/libs/diabloclass.php b/libs/diabloclass.php index cf1178a..f745c3e 100644 --- a/libs/diabloclass.php +++ b/libs/diabloclass.php @@ -36,7 +36,7 @@ class DiabloClass { $this->stats->stats['All Elemental Damage'] = $this->elementalDamage(); $this->modifyDPSUnbuffed(); - $this->modifyEHP(); + $this->calculateEHP(); } function hallScore() { @@ -57,9 +57,10 @@ class DiabloClass { } function sustainScore() { + $ehp = $this->calculateEHP(); $effectiveLS = $this->stats->getStat('DPS Unbuffed') * $this->stats->getStat('Life Steal') * .5; - $mitigation = $this->stats->getStat('EHP Unbuffed') / $this->stats->getStat('Life'); + $mitigation = $ehp / $this->stats->getStat('Life'); $loh = $this->stats->getStat('Life on Hit'); if($this->type == 'pvp') { @@ -71,7 +72,7 @@ class DiabloClass { (1 + ($this->stats->getStat('Attacks per Second') - 1) / 2) + $effectiveLS + $this->stats->getStat('Life per Second')) / ($this->stats->getStat('Life') * $this->EHPScore() * 10000 / - $this->stats->getStat('EHP Unbuffed')); + $ehp); if($rawSustainScore <= 1.5) { return $rawSustainScore; @@ -142,8 +143,4 @@ class DiabloClass { $this->stats->stats['Exp Bonus'] = $this->stats->getStat('Exp Bonus') - .35; } } - - function modifyEHP() { - $this->calculateEHP(); - } }