1
0
Fork 0

Remove Elemental Damage From Calculations

Diablo Progress currently includes elemental damage in their unbuffed
DPS score.  By calculating it, we are double dipping and artificially
increasing scores.  All instances of elemental damage have been
removed from the formula.
This commit is contained in:
Andrew Tomaka 2012-12-06 13:40:40 -05:00
parent 557157238e
commit 00834e66e7
2 changed files with 5 additions and 13 deletions

View File

@ -4,7 +4,6 @@ include_once(__DIR__ . '/libs/dpclass.php');
if($_POST['submit']) {
$diabloProgressUrl = trim($_POST['url']);
$elementalOnWeapon = isset($_POST['elemental']['elemental']) ? true : false;
if(preg_match('{^http://www.diabloprogress.com/hero/.*\-[\d]+/.*/[\d]+$}', $diabloProgressUrl) != 1) {
die('Bad URL. Please enter the entire diablo progress URL.<br/><br/>Example: http://www.diabloprogress.com/hero/celanian-1548/HsuMing/21706367');
}
@ -17,7 +16,7 @@ if($_POST['submit']) {
$contents = curl_exec($curl);
curl_close($curl);
$character = DPClassFactory::createClassObject($contents, $elementalOnWeapon);
$character = DPClassFactory::createClassObject($contents);
if($character === FALSE) {
die('Bad class. Either your class could not be detected or we do not support your class at this time.');
@ -38,6 +37,5 @@ Misc Score: <?php echo number_format($character->miscScore(), 2, '.', ','); ?><b
?>
<form method="POST">
D3 Progress URL: <input type="text" name="url" style="width:500px;" value="<?php echo $diabloProgressUrl ?>" /><br />
Elemental Damage on Weapon: <input type="checkbox" name="elemental" value="elemental" <?php echo $elementalOnWeapon ? 'checked="checked"' : '' ?> /><br/>
<input type="submit" name="submit" />
</form>

View File

@ -1,16 +1,16 @@
<?php
class DPClassFactory {
function createClassObject($characterPage, $elementalOnWeapon) {
function createClassObject($characterPage) {
$class = DPClassFactory::findClass($characterPage);
include_once(__DIR__ . "/$class.php");
switch($class) {
case 'barbarian':
return new Barbarian($characterPage, $elementalOnWeapon);
return new Barbarian($characterPage);
case 'demonhunter':
return new DemonHunter($characterPage, $elementalOnWeapon);
return new DemonHunter($characterPage);
default:
return false;
}
@ -30,11 +30,10 @@ class DPClass {
var $stats = array();
var $items = array();
function __construct($characterPage, $elementalOnWeapon) {
function __construct($characterPage) {
$this->dpHTML = $characterPage;
$this->class = get_class($this);
$this->elementalOnWeapon = $elementalOnWeapon;
$this->parseStats();
}
@ -136,10 +135,6 @@ class DPClass {
}
}
if($this->elementalOnWeapon && $totalElemental != 1) {
$totalElemental *= .5;
}
return ($totalElemental > 0) ? $totalElemental : 0;
}
@ -165,7 +160,6 @@ class DPClass {
function modifyDPSUnbuffed() {
$this->stats['DPS Unbuffed'] = $this->getStat('DPS Unbuffed') *
(1 + $this->getStat('All Elemental Damage')) *
max(1, 1 + ($this->getStat('+DPS Against Elites') / 2));
}