/// <summary> /// Calculates the solution by combining subsolutions with and withou Bloodlust /// </summary> private static RotationSolution GetCombinedSolutionWithBloodlust( CombatStats combats, Ability[] rotation, decimal simulationTime) { const float bloodlustDuration = 40f; const float secondsPerMinute = 60f; const float bloodlustHaste = 0.3f; // in seconds float fightLengthWithBloodlust = combats.CalcOpts.Bloodlust ? Math.Min(combats.CalcOpts.FightLength * secondsPerMinute, bloodlustDuration) : 0; // in seconds float fightLengthWithoutBloodlust = Math.Max(0, combats.CalcOpts.FightLength * secondsPerMinute - fightLengthWithBloodlust); float bloodlustSpellHaste = (1 + combats.Stats.SpellHaste) * (1 + bloodlustHaste) - 1; float normalSwingTime = combats.BaseWeaponSpeed / (1 + combats.Stats.PhysicalHaste); float bloodlustSwingTime = normalSwingTime / (1 + bloodlustHaste); return(RotationSolution.Combine( () => GetCombinedSolutionWithDivineStormCooldown( combats, rotation, simulationTime, combats.Stats.SpellHaste, normalSwingTime), fightLengthWithoutBloodlust, () => GetCombinedSolutionWithDivineStormCooldown( combats, rotation, simulationTime, bloodlustSpellHaste, bloodlustSwingTime), fightLengthWithBloodlust)); }
/// <summary> /// Calculates the solution by combining subsolutions with the boss above and under 20% health /// </summary> private static RotationSolution GetCombinedSolutionWithUnder20PercentHealth( CombatStats combats, Ability[] rotation, decimal simulationTime, float divineStormCooldown, float spellHaste) { return(RotationSolution.Combine( () => GetSolution( combats, RemoveHammerOfWrathFromRotation(rotation), simulationTime, divineStormCooldown, spellHaste), 1 - combats.CalcOpts.TimeUnder20, () => GetSolution( combats, rotation, simulationTime, divineStormCooldown, spellHaste), combats.CalcOpts.TimeUnder20)); }
/// <summary> /// Calculates the solution by combining subsolutions with different Divine Storm cooldowns, /// if 2 piece T10 bonus is active. /// </summary> private static RotationSolution GetCombinedSolutionWithDivineStormCooldown( CombatStats combats, Ability[] rotation, decimal simulationTime, float spellHaste, float swingTime) { const float normalDivineStormCooldown = 10; const float cooldownRangeStep = 0.6f; if (combats.Stats.DivineStormRefresh == 0) { return(GetCombinedSolutionWithUnder20PercentHealth( combats, rotation, simulationTime, normalDivineStormCooldown, spellHaste)); } // Calculate solutions for different Divine Storm cooldowns // and combine them weighted by their neighbourhood cooldown range probabilities RotationSolution result = null; float resultProbability = 0; for ( float cooldownRangeStart = 0; cooldownRangeStart < normalDivineStormCooldown; cooldownRangeStart += cooldownRangeStep) { float currentSolutionProbability = GetT10DivineStormCooldownProbability( swingTime, cooldownRangeStart, Math.Min(normalDivineStormCooldown, cooldownRangeStart + cooldownRangeStep), combats.Stats.DivineStormRefresh); result = RotationSolution.Combine( () => result, resultProbability, () => GetCombinedSolutionWithUnder20PercentHealth( combats, rotation, simulationTime, Math.Min( normalDivineStormCooldown, cooldownRangeStart + cooldownRangeStart / 2 + combats.CalcOpts.Delay), spellHaste), currentSolutionProbability); resultProbability += currentSolutionProbability; } // Combine with normal Divine Storm cooldown in cases when T10 doesn't proc return(RotationSolution.Combine( () => result, resultProbability, () => GetCombinedSolutionWithUnder20PercentHealth( combats, rotation, simulationTime, normalDivineStormCooldown, spellHaste), 1 - resultProbability)); }