1
0
Fork 0

Direct copy barb EHP caclulation for DH...DRY as hell

This commit is contained in:
Andrew Tomaka 2013-04-09 22:49:45 -04:00
parent 06875717cd
commit 4f93c77afd
1 changed files with 45 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<?php
class DemonHunter extends DiabloClass {
function __construct($stats) {
parent::__construct($stats);
function __construct($stats, $type) {
parent::__construct($stats, $type);
}
function EHPScore() {
@ -49,4 +49,47 @@ class DemonHunter extends DiabloClass {
$this->stats->getStat('+Hatred Regenerated per Second') * 2 +
$this->stats->getStat('+Discipline Regenerated per Second') * 15) / 100;
}
protected
function calculateEHP() {
if($this->type == 'pvp') {
$ar_mod = 300;$armor_mod = 3000;$inherent_red = .35;$incoming_attack = 250000;
$net_mod = .50; // no idea what this is for
} else {
$ar_mod = 315;$armor_mod = 3150;$inherent_red = .30;$incoming_attack = 100000;
$net_mod = .75; // no idea what this is for
}
$block_amount = 4206;
$ar_red = $this->stats->getStat('Resistance') /
($this->stats->getStat('Resistance') + $ar_mod);
$armor_red = $this->stats->getStat('Armor') /
($this->stats->getStat('Armor') + $armor_mod);
$total_red = (1 - $ar_red) * (1 - $armor_red) * (1 - $inherent_red);
$raw_ehp = $this->stats->getStat('Life') / $total_red;
$net = $incoming_attack * $total_red;
$after_block = $net * (1 - $this->stats->getStat('Block Chance')) + ($net - $block_amount)
* $this->stats->getStat('Block Chance');
$new_mit = $after_block / $incoming_attack;
$raw_no_dodge = $this->stats->getStat('Life') / $new_mit;
if($this->type == 'pvp') {
$net_no_dodge = ($raw_no_dodge - $raw_ehp) * .75 + $raw_ehp;
} else {
$net_no_dodge = $raw_no_dodge;
}
$raw_ehp_dodge = $raw_no_dodge / (1 - $this->stats->getStat('Dodge Chance'));
$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')
+ $this->stats->getStat('Missile Damage Reduction')) / 2);
$this->stats->stats['EHP Unbuffed'] = $final_ehp;
}
}