Calculate EHP cleanly to correct issue with some overwriting variable...somewhere...???

This commit is contained in:
Andrew Tomaka 2013-04-10 00:23:03 -04:00
parent 1922897d05
commit 167f7e59d5
3 changed files with 11 additions and 13 deletions

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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();
}
}