From 34462191bbda56367a2309d730be28c358cd9e5d Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Mon, 8 Apr 2013 19:58:34 -0400 Subject: [PATCH] No DR on EHP in PvP --- libs/barbarian.php | 4 ++++ libs/diabloclass.php | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/libs/barbarian.php b/libs/barbarian.php index a62c899..ade6e84 100644 --- a/libs/barbarian.php +++ b/libs/barbarian.php @@ -8,6 +8,10 @@ class Barbarian extends DiabloClass { $this->calculateEHP(); $ehp = $this->stats->getStat('EHP Unbuffed'); + if($this->type == 'pvp') { + return $ehp / 10000; + } + if($ehp < 1000000) { return $ehp / 10000; } elseif(1000000 <= $ehp && $ehp <= 2000000) { diff --git a/libs/diabloclass.php b/libs/diabloclass.php index 1fe9128..59b91b1 100644 --- a/libs/diabloclass.php +++ b/libs/diabloclass.php @@ -33,8 +33,12 @@ class DiabloClass { } function hallScore() { - return $this->DPSScore() * $this->EHPScore() * $this->sustainScore() - * $this->moveScore() * $this->paragonScore() * $this->miscScore(); + $hallScore = $this->DPSScore() * $this->EHPScore() * $this->sustainScore() + * $this->moveScore() * $this->miscScore(); + if($this->type == 'pve') { + $hallScore *= $this->paragonScore(); + } + return $hallScore; } function DPSScore() { @@ -49,8 +53,14 @@ class DiabloClass { $effectiveLS = $this->stats->getStat('DPS Unbuffed') * $this->stats->getStat('Life Steal') * .5; $mitigation = $this->stats->getStat('EHP Unbuffed') / $this->stats->getStat('Life'); + $loh = $this->stats->getStat('Life on Hit'); - $rawSustainScore = 1 + $mitigation * ($this->stats->getStat('Life on Hit') * + if($this->type == 'pvp') { + $effectiveLS = 0; + $loh = 0; + } + + $rawSustainScore = 1 + $mitigation * ($loh * (1 + ($this->stats->getStat('Attacks per Second') - 1) / 2) + $effectiveLS + $this->stats->getStat('Life per Second')) / ($this->stats->getStat('Life') * $this->EHPScore() * 10000 /