コード例 #1
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public Skill(CombatStats combats, AbilityType abilityType, DamageType damageType, bool usesWeapon, bool righteousVengeance)
 {
     Combats            = combats;
     AbilityType        = abilityType;
     DamageType         = damageType;
     UsesWeapon         = usesWeapon;
     RighteousVengeance = righteousVengeance;
 }
コード例 #2
0
ファイル: Simulator.cs プロジェクト: edekk/rawr-2.3.23
        public Simulator(CombatStats combats, Ability[] rotation, decimal simulationTime)
            : base(combats)
        {
            if (rotation == null)
            {
                throw new ArgumentNullException("rotation");
            }

            Ability[] effectiveRotation = RemoveUnavailableAbilitiesFromRotation(rotation, combats);

            Rotation = effectiveRotation;
            Solution = GetCombinedSolutionWithBloodlust(combats, effectiveRotation, simulationTime);
        }
コード例 #3
0
ファイル: Rotation.cs プロジェクト: edekk/rawr-2.3.23
        protected Rotation(CombatStats combats)
        {
            if (combats == null)
            {
                throw new ArgumentNullException("combats");
            }

            Combats = combats;
            CS      = combats.Talents.CrusaderStrike == 0 ? (Skill) new NullCrusaderStrike(combats) : (Skill) new CrusaderStrike(combats);
            DS      = combats.Talents.DivineStorm == 0 ? (Skill) new NullCrusaderStrike(combats) : (Skill) new DivineStorm(combats);
            Exo     = new Exorcism(combats);
            HoW     = new HammerOfWrath(combats);
            Cons    = new Consecration(combats);
            White   = new White(combats);
            HoR     = new HandOfReckoning(combats);

            switch (combats.CalcOpts.Seal)
            {
            case SealOf.Righteousness:
                Seal    = new SealOfRighteousness(combats);
                SealDot = new NullSealDoT(combats);
                Judge   = new JudgementOfRighteousness(combats);
                break;

            case SealOf.Command:
                if (combats.Talents.SealOfCommand == 0)
                {
                    goto default;
                }

                Seal    = new SealOfCommand(combats);
                SealDot = new NullSealDoT(combats);
                Judge   = new JudgementOfCommand(combats);
                break;

            case SealOf.Vengeance:
                float stack = AverageSoVStackSize();
                Seal    = new SealOfVengeance(combats, stack);
                SealDot = new SealOfVengeanceDoT(combats, stack);
                Judge   = new JudgementOfVengeance(combats, stack);
                break;

            default:
                Seal    = new NullSeal(combats);
                SealDot = new NullSealDoT(combats);
                Judge   = new NullJudgement(combats);
                break;
            }
        }
コード例 #4
0
ファイル: Simulator.cs プロジェクト: edekk/rawr-2.3.23
 /// <summary>
 /// Calculates the solution with concrete parameters
 /// </summary>
 private static RotationSolution GetSolution(
     CombatStats combats,
     Ability[] rotation,
     decimal simulationTime,
     float divineStormCooldown,
     float spellHaste)
 {
     return(SimulatorEngine.SimulateRotation(new SimulatorParameters(
                                                 rotation,
                                                 combats.CalcOpts.Wait,
                                                 combats.CalcOpts.Delay,
                                                 combats.Stats.JudgementCDReduction > 0,
                                                 combats.Talents.ImprovedJudgements,
                                                 combats.Talents.GlyphOfConsecration,
                                                 divineStormCooldown,
                                                 spellHaste,
                                                 simulationTime)));
 }
コード例 #5
0
ファイル: Simulator.cs プロジェクト: edekk/rawr-2.3.23
        private static Ability[] RemoveUnavailableAbilitiesFromRotation(
            Ability[] rotation,
            CombatStats combats)
        {
            Ability[] result = rotation;

            if (combats.Talents.CrusaderStrike == 0)
            {
                List <Ability> abilities = new List <Ability>(result);
                abilities.Remove(Ability.CrusaderStrike);
                result = abilities.ToArray();
            }

            if (combats.Talents.DivineStorm == 0)
            {
                List <Ability> abilities = new List <Ability>(result);
                abilities.Remove(Ability.DivineStorm);
                result = abilities.ToArray();
            }

            return(result);
        }
コード例 #6
0
ファイル: Simulator.cs プロジェクト: edekk/rawr-2.3.23
        /// <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));
        }
コード例 #7
0
ファイル: Simulator.cs プロジェクト: edekk/rawr-2.3.23
 /// <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));
 }
コード例 #8
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public MagicDamage(CombatStats combats, float amount)
     : base(combats, AbilityType.Spell, DamageType.Magic, false, false)
 {
     this.amount = amount;
 }
コード例 #9
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public NullJudgement(CombatStats combats) : base(combats, AbilityType.Melee, DamageType.Holy, true, false)
 {
 }
コード例 #10
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public JudgementOfCommand(CombatStats combats)
     : base(combats, AbilityType.Range, DamageType.Holy, true, true)
 {
 }
コード例 #11
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public NullSealDoT(CombatStats combats) : base(combats, AbilityType.Melee, DamageType.Holy, true, false)
 {
 }
コード例 #12
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public HandOfReckoning(CombatStats combats) : base(combats, AbilityType.Spell, DamageType.Holy, false, false)
 {
 }
コード例 #13
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public White(CombatStats combats) : base(combats, AbilityType.Melee, DamageType.Physical, true, false)
 {
 }
コード例 #14
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public NullDivineStorm(CombatStats combats)
     : base(combats, AbilityType.Melee, DamageType.Physical, true, true)
 {
 }
コード例 #15
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public JudgementOfVengeance(CombatStats combats, float averageStack)
     : base(combats, AbilityType.Range, DamageType.Holy, true, true)
 {
     AverageStackSize = averageStack;
 }
コード例 #16
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public SealOfCommand(CombatStats combats) : base(combats, AbilityType.Melee, DamageType.Holy, true, false)
 {
 }
コード例 #17
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public Consecration(CombatStats combats)
     : base(combats, AbilityType.Spell, DamageType.Holy, false, false)
 {
 }
コード例 #18
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public Exorcism(CombatStats combats)
     : base(combats, AbilityType.Spell, DamageType.Holy, false, false)
 {
 }
コード例 #19
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public HammerOfWrath(CombatStats combats)
     : base(combats, AbilityType.Range, DamageType.Holy, false, false)
 {
 }
コード例 #20
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public JudgementOfRighteousness(CombatStats combats)
     : base(combats, AbilityType.Range, DamageType.Holy, true, true)
 {
 }
コード例 #21
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public SealOfRighteousness(CombatStats combats) : base(combats, AbilityType.Spell, DamageType.Holy, true, false)
 {
 }
コード例 #22
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public NullCrusaderStrike(CombatStats combats)
     : base(combats, AbilityType.Melee, DamageType.Physical, true, true)
 {
 }
コード例 #23
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public SealOfVengeanceDoT(CombatStats combats, float averageStack)
     : base(combats, AbilityType.Spell, DamageType.Holy, false, false)
 {
     AverageStackSize = averageStack;
 }
コード例 #24
0
ファイル: Skill.cs プロジェクト: tsebalj1/rawr
 public SealOfVengeance(CombatStats combats, float averageStack)
     : base(combats, AbilityType.Melee, DamageType.Holy, true, false)
 {
     AverageStackSize = averageStack;
 }
コード例 #25
0
ファイル: Simulator.cs プロジェクト: edekk/rawr-2.3.23
        /// <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));
        }
コード例 #26
0
ファイル: EffectiveCooldown.cs プロジェクト: tsebalj1/rawr
 public EffectiveCooldown(CombatStats combats)
     : base(combats)
 {
 }