Excel sum has high order of operations

This commit is contained in:
Andrew Tomaka 2013-04-09 21:52:07 -04:00
parent 5c1e26e390
commit 0f6b13f964

View file

@ -49,6 +49,7 @@ class Barbarian extends DiabloClass {
$new_mit = $after_block / $incoming_attack; $new_mit = $after_block / $incoming_attack;
$raw_no_dodge = $this->stats->getStat('Life') / $new_mit; $raw_no_dodge = $this->stats->getStat('Life') / $new_mit;
if($this->type == 'pvp') { if($this->type == 'pvp') {
$net_no_dodge = ($raw_no_dodge - $raw_ehp) * .75 + $raw_ehp; $net_no_dodge = ($raw_no_dodge - $raw_ehp) * .75 + $raw_ehp;
} else { } else {
@ -58,8 +59,8 @@ class Barbarian extends DiabloClass {
$raw_ehp_dodge = $net_no_dodge / (1 - $this->stats->getStat('Dodge Chance')); $raw_ehp_dodge = $net_no_dodge / (1 - $this->stats->getStat('Dodge Chance'));
$net_ehp_dodge = ($raw_ehp_dodge - $net_no_dodge) * $net_mod + $net_no_dodge; $net_ehp_dodge = ($raw_ehp_dodge - $net_no_dodge) * $net_mod + $net_no_dodge;
$final_ehp = $net_ehp_dodge * (1 + $this->stats->getStat('Melee Damage Reduction') $final_ehp = $net_ehp_dodge * (1 + ($this->stats->getStat('Melee Damage Reduction')
+ $this->stats->getStat('Missile Damage Reduction') / 2); + $this->stats->getStat('Missile Damage Reduction')) / 2);
$this->stats->stats['EHP Unbuffed'] = $final_ehp; $this->stats->stats['EHP Unbuffed'] = $final_ehp;
} }