/// <inheritdoc /> public ItemAttributes GetBonus(D3Calculator calculator) { var stuff = calculator.HeroStatsItem.AttributesRaw; var attr = new ItemAttributes(); double maxResist = 0; var resistanceArcane = calculator.GetHeroResistance("Arcane").Min; if (resistanceArcane > maxResist) maxResist = resistanceArcane; var resistanceCold = calculator.GetHeroResistance("Cold").Min; if (resistanceCold > maxResist) maxResist = resistanceCold; var resistanceFire = calculator.GetHeroResistance("Fire").Min; if (resistanceFire > maxResist) maxResist = resistanceFire; var resistanceLightning = calculator.GetHeroResistance("Lightning").Min; if (resistanceLightning > maxResist) maxResist = resistanceLightning; var resistancePhysical = calculator.GetHeroResistance("Physical").Min; if (resistancePhysical > maxResist) maxResist = resistancePhysical; var resistancePoison = calculator.GetHeroResistance("Poison").Min; if (resistancePoison > maxResist) maxResist = resistancePoison; if (stuff.resistance_Arcane != null) attr.resistance_Arcane = ItemValueRange.Zero - stuff.resistance_Arcane; if (stuff.resistance_Cold != null) attr.resistance_Cold = ItemValueRange.Zero - stuff.resistance_Cold; if (stuff.resistance_Fire != null) attr.resistance_Fire = ItemValueRange.Zero - stuff.resistance_Fire; if (stuff.resistance_Lightning != null) attr.resistance_Lightning = ItemValueRange.Zero - stuff.resistance_Lightning; if (stuff.resistance_Physical != null) attr.resistance_Physical = ItemValueRange.Zero - stuff.resistance_Physical; if (stuff.resistance_Poison != null) attr.resistance_Poison = ItemValueRange.Zero - stuff.resistance_Poison; if (stuff.resistance_All != null) attr.resistance_All = new ItemValueRange(maxResist - calculator.getHeroResistance_All()); return attr; }
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(); }
/// <inheritdoc /> public ItemAttributes GetBonus(D3Calculator calculator) { var stuff = calculator.HeroStatsItem.AttributesRaw; var attr = new ItemAttributes(); double maxResist = 0; var resistanceArcane = calculator.GetHeroResistance("Arcane").Min; if (resistanceArcane > maxResist) { maxResist = resistanceArcane; } var resistanceCold = calculator.GetHeroResistance("Cold").Min; if (resistanceCold > maxResist) { maxResist = resistanceCold; } var resistanceFire = calculator.GetHeroResistance("Fire").Min; if (resistanceFire > maxResist) { maxResist = resistanceFire; } var resistanceLightning = calculator.GetHeroResistance("Lightning").Min; if (resistanceLightning > maxResist) { maxResist = resistanceLightning; } var resistancePhysical = calculator.GetHeroResistance("Physical").Min; if (resistancePhysical > maxResist) { maxResist = resistancePhysical; } var resistancePoison = calculator.GetHeroResistance("Poison").Min; if (resistancePoison > maxResist) { maxResist = resistancePoison; } if (stuff.resistance_Arcane != null) { attr.resistance_Arcane = ItemValueRange.Zero - stuff.resistance_Arcane; } if (stuff.resistance_Cold != null) { attr.resistance_Cold = ItemValueRange.Zero - stuff.resistance_Cold; } if (stuff.resistance_Fire != null) { attr.resistance_Fire = ItemValueRange.Zero - stuff.resistance_Fire; } if (stuff.resistance_Lightning != null) { attr.resistance_Lightning = ItemValueRange.Zero - stuff.resistance_Lightning; } if (stuff.resistance_Physical != null) { attr.resistance_Physical = ItemValueRange.Zero - stuff.resistance_Physical; } if (stuff.resistance_Poison != null) { attr.resistance_Poison = ItemValueRange.Zero - stuff.resistance_Poison; } if (stuff.resistance_All != null) { attr.resistance_All = new ItemValueRange(maxResist - calculator.getHeroResistance_All()); } return(attr); }