private void UpdateCalculationResults(D3Calculator d3Calculator) { var attr = d3Calculator.HeroStatsItem.AttributesRaw; guiCalculatedAttackPerSecond.Text = d3Calculator.GetActualAttackSpeed().Min.ToString(); PopulateCalculatedData(guiCalcultatedDamageMin, d3Calculator.HeroStatsItem.GetWeaponDamageMin() * d3Calculator.GetDamageMultiplierNormal()); PopulateCalculatedData(guiCalcultatedDamageMax, d3Calculator.HeroStatsItem.GetWeaponDamageMax() * d3Calculator.GetDamageMultiplierNormal()); PopulateCalculatedData(guiCalcultatedDamageCriticMin, d3Calculator.HeroStatsItem.GetWeaponDamageMin() * d3Calculator.GetDamageMultiplierCritic()); PopulateCalculatedData(guiCalcultatedDamageCriticMax, d3Calculator.HeroStatsItem.GetWeaponDamageMax() * d3Calculator.GetDamageMultiplierCritic()); PopulateCalculatedData(guiCalculatedHitpoints, d3Calculator.GetHeroHitpoints()); guiCalculatedDodge.Text = d3Calculator.GetHeroDodge().ToString(); PopulateCalculatedData(guiCalculatedArmor, d3Calculator.GetHeroArmor()); PopulateCalculatedData(guiCalculatedResistance_Arcane, d3Calculator.GetHeroResistance("Arcane")); PopulateCalculatedData(guiCalculatedResistance_Cold, d3Calculator.GetHeroResistance("Cold")); PopulateCalculatedData(guiCalculatedResistance_Fire, d3Calculator.GetHeroResistance("Fire")); PopulateCalculatedData(guiCalculatedResistance_Lightning, d3Calculator.GetHeroResistance("Lightning")); PopulateCalculatedData(guiCalculatedResistance_Physical, d3Calculator.GetHeroResistance("Physical")); PopulateCalculatedData(guiCalculatedResistance_Poison, d3Calculator.GetHeroResistance("Poison")); PopulateCalculatedData(guiCalculatedResistance_All, d3Calculator.getHeroResistance_All()); guiCalculatedDamageReduction_Armor.Text = (100 * d3Calculator.GetHeroDamageReduction_Armor(heroLevel)).ToString(); guiCalculatedDamageReduction_Arcane.Text = (100 * d3Calculator.GetHeroDamageReduction(heroLevel, "Arcane")).ToString(); guiCalculatedDamageReduction_Cold.Text = (100 * d3Calculator.GetHeroDamageReduction(heroLevel, "Cold")).ToString(); guiCalculatedDamageReduction_Fire.Text = (100 * d3Calculator.GetHeroDamageReduction(heroLevel, "Fire")).ToString(); guiCalculatedDamageReduction_Lightning.Text = (100 * d3Calculator.GetHeroDamageReduction(heroLevel, "Lightning")).ToString(); guiCalculatedDamageReduction_Physical.Text = (100 * d3Calculator.GetHeroDamageReduction(heroLevel, "Physical")).ToString(); guiCalculatedDamageReduction_Poison.Text = (100 * d3Calculator.GetHeroDamageReduction(heroLevel, "Poison")).ToString(); PopulateCalculatedData(guiCalculatedBlockChance, attr.blockChanceItem); PopulateCalculatedData(guiCalculatedBlockMin, attr.blockAmountItemMin); PopulateCalculatedData(guiCalculatedBlockMax, attr.blockAmountItemMin + attr.blockAmountItemDelta); guiCalculatedEffectiveHitpoints.Text = Math.Round(d3Calculator.GetHeroEffectiveHitpoints(heroLevel)).ToString(); guiCalculatedDPSEHPRatio.Text = Math.Round(d3Calculator.GetHeroDps().Min *d3Calculator.GetHeroEffectiveHitpoints(heroLevel) / 1000000).ToString(); }
private void UpdateCalculationResults(D3Calculator d3Calculator) { var attr = d3Calculator.HeroStatsItem.AttributesRaw; guiCalculatedDPS.Text = calculatedDps.Min.ToString("N"); guiCalculatedAttackPerSecond.Text = d3Calculator.GetActualAttackSpeed().Min.ToString("N2"); PopulateCalculatedData(guiCalcultatedDamageMin, d3Calculator.HeroStatsItem.GetWeaponDamageMin() * d3Calculator.GetDamageMultiplierNormal()); PopulateCalculatedData(guiCalcultatedDamageMax, d3Calculator.HeroStatsItem.GetWeaponDamageMax() * d3Calculator.GetDamageMultiplierNormal()); PopulateCalculatedData(guiCalcultatedDamageCriticMin, d3Calculator.HeroStatsItem.GetWeaponDamageMin() * d3Calculator.GetDamageMultiplierCritic()); PopulateCalculatedData(guiCalcultatedDamageCriticMax, d3Calculator.HeroStatsItem.GetWeaponDamageMax() * d3Calculator.GetDamageMultiplierCritic()); PopulateCalculatedDataPercent(guiCalculatedSkillBonusPercent_Arcane, attr.damageDealtPercentBonusArcane); PopulateCalculatedDataPercent(guiCalculatedSkillBonusPercent_Cold, attr.damageDealtPercentBonusCold); PopulateCalculatedDataPercent(guiCalculatedSkillBonusPercent_Fire, attr.damageDealtPercentBonusFire); PopulateCalculatedDataPercent(guiCalculatedSkillBonusPercent_Holy, attr.damageDealtPercentBonusHoly); PopulateCalculatedDataPercent(guiCalculatedSkillBonusPercent_Lightning, attr.damageDealtPercentBonusLightning); PopulateCalculatedDataPercent(guiCalculatedSkillBonusPercent_Physical, attr.damageDealtPercentBonusPhysical); PopulateCalculatedDataPercent(guiCalculatedSkillBonusPercent_Poison, attr.damageDealtPercentBonusPoison); PopulateCalculatedData(guiCalculatedSkillDamage_Arcane, calculatedDps * (1 + attr.damageDealtPercentBonusArcane)); PopulateCalculatedData(guiCalculatedSkillDamage_Cold, calculatedDps * (1 + attr.damageDealtPercentBonusCold)); PopulateCalculatedData(guiCalculatedSkillDamage_Fire, calculatedDps * (1 + attr.damageDealtPercentBonusFire)); PopulateCalculatedData(guiCalculatedSkillDamage_Holy, calculatedDps * (1 + attr.damageDealtPercentBonusHoly)); PopulateCalculatedData(guiCalculatedSkillDamage_Lightning, calculatedDps * (1 + attr.damageDealtPercentBonusLightning)); PopulateCalculatedData(guiCalculatedSkillDamage_Physical, calculatedDps * (1 + attr.damageDealtPercentBonusPhysical)); PopulateCalculatedData(guiCalculatedSkillDamage_Poison, calculatedDps * (1 + attr.damageDealtPercentBonusPoison)); PopulateCalculatedData(guiCalculatedSkillDamageVsElites_Arcane, calculatedDps * (1 + attr.damageDealtPercentBonusArcane) * (1 + attr.damagePercentBonusVsElites)); PopulateCalculatedData(guiCalculatedSkillDamageVsElites_Cold, calculatedDps * (1 + attr.damageDealtPercentBonusCold) * (1 + attr.damagePercentBonusVsElites)); PopulateCalculatedData(guiCalculatedSkillDamageVsElites_Fire, calculatedDps * (1 + attr.damageDealtPercentBonusFire) * (1 + attr.damagePercentBonusVsElites)); PopulateCalculatedData(guiCalculatedSkillDamageVsElites_Holy, calculatedDps * (1 + attr.damageDealtPercentBonusHoly) * (1 + attr.damagePercentBonusVsElites)); PopulateCalculatedData(guiCalculatedSkillDamageVsElites_Lightning, calculatedDps * (1 + attr.damageDealtPercentBonusLightning) * (1 + attr.damagePercentBonusVsElites)); PopulateCalculatedData(guiCalculatedSkillDamageVsElites_Physical, calculatedDps * (1 + attr.damageDealtPercentBonusPhysical) * (1 + attr.damagePercentBonusVsElites)); PopulateCalculatedData(guiCalculatedSkillDamageVsElites_Poison, calculatedDps * (1 + attr.damageDealtPercentBonusPoison) * (1 + attr.damagePercentBonusVsElites)); PopulateCalculatedDataPercent(guiSkillCooldownReductionAll, attr.powerCooldownReductionPercentAll); PopulateCalculatedDataPercent(guiCalculatedReductionFromElitesPercent, attr.damagePercentReductionFromElites); PopulateCalculatedDataPercent(guiCalculatedReductionFromMeleePercent, attr.damagePercentReductionFromMelee); PopulateCalculatedDataPercent(guiCalculatedReductionFromRangedPercent, attr.damagePercentReductionFromRanged); PopulateCalculatedData(guiCalculatedHitpoints, d3Calculator.GetHeroHitpoints()); guiCalculatedDodge.Text = d3Calculator.GetHeroDodge().ToString(); PopulateCalculatedData(guiCalculatedArmor, d3Calculator.GetHeroArmor()); PopulateCalculatedData(guiCalculatedResistance_Arcane, d3Calculator.GetHeroResistance("Arcane")); PopulateCalculatedData(guiCalculatedResistance_Cold, d3Calculator.GetHeroResistance("Cold")); PopulateCalculatedData(guiCalculatedResistance_Fire, d3Calculator.GetHeroResistance("Fire")); PopulateCalculatedData(guiCalculatedResistance_Lightning, d3Calculator.GetHeroResistance("Lightning")); PopulateCalculatedData(guiCalculatedResistance_Physical, d3Calculator.GetHeroResistance("Physical")); PopulateCalculatedData(guiCalculatedResistance_Poison, d3Calculator.GetHeroResistance("Poison")); PopulateCalculatedData(guiCalculatedResistance_All, d3Calculator.GetHeroResistance_All()); guiCalculatedDamageReduction_Armor.Text = (100 * d3Calculator.GetHeroDamageReduction_Armor(heroLevel)).ToString("N2"); guiCalculatedDamageReduction_Arcane.Text = (100 * d3Calculator.GetHeroDamageReduction(heroLevel, "Arcane")).ToString("N2"); guiCalculatedDamageReduction_Cold.Text = (100 * d3Calculator.GetHeroDamageReduction(heroLevel, "Cold")).ToString("N2"); guiCalculatedDamageReduction_Fire.Text = (100 * d3Calculator.GetHeroDamageReduction(heroLevel, "Fire")).ToString("N2"); guiCalculatedDamageReduction_Lightning.Text = (100 * d3Calculator.GetHeroDamageReduction(heroLevel, "Lightning")).ToString("N2"); guiCalculatedDamageReduction_Physical.Text = (100 * d3Calculator.GetHeroDamageReduction(heroLevel, "Physical")).ToString("N2"); guiCalculatedDamageReduction_Poison.Text = (100 * d3Calculator.GetHeroDamageReduction(heroLevel, "Poison")).ToString("N2"); PopulateCalculatedData(guiCalculatedBlockChance, attr.blockChanceItem); PopulateCalculatedData(guiCalculatedBlockMin, attr.blockAmountItemMin); PopulateCalculatedData(guiCalculatedBlockMax, attr.blockAmountItemMin + attr.blockAmountItemDelta); guiCalculatedEffectiveHitpoints.Text = Math.Round(d3Calculator.GetHeroEffectiveHitpoints(heroLevel)).ToString("N0"); guiCalculatedDPSEHPRatio.Text = Math.Round(d3Calculator.GetHeroDps().Min *d3Calculator.GetHeroEffectiveHitpoints(heroLevel) / 1000000).ToString("N0"); }