From 14ff704b5fe0c1a3aab787b450c576b3b35dde27 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Mon, 8 Apr 2013 20:12:30 -0400 Subject: [PATCH] Calculate EHP one time insead of every time --- libs/barbarian.php | 3 +-- libs/diabloclass.php | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/libs/barbarian.php b/libs/barbarian.php index ade6e84..6bf7723 100644 --- a/libs/barbarian.php +++ b/libs/barbarian.php @@ -5,7 +5,6 @@ class Barbarian extends DiabloClass { } function EHPScore() { - $this->calculateEHP(); $ehp = $this->stats->getStat('EHP Unbuffed'); if($this->type == 'pvp') { @@ -23,7 +22,7 @@ class Barbarian extends DiabloClass { } } - private + protected function calculateEHP() { if($this->type == 'pvp') { $ar_mod = 300;$armor_mod = 3000;$inherent_red = .35;$incoming_attack = 250000; diff --git a/libs/diabloclass.php b/libs/diabloclass.php index ceb88d3..b7cdda7 100644 --- a/libs/diabloclass.php +++ b/libs/diabloclass.php @@ -141,9 +141,7 @@ class DiabloClass { } function modifyEHP() { - $this->stats->stats['EHP Unbuffed'] = $this->stats->getStat('EHP Unbuffed') * - (1 + $this->stats->getStat('Life Bonus') + $this->stats->getStat('Gem Life')) / - (1 + $this->stats->getStat('Life Bonus')); + $this->calculateEHP(); } function modifyHP() {