Exemplo n.º 1
0
        public void Calculate()
        {
            float attackSpeed = ParryModel.BossAttackSpeed;           // Options.BossAttackSpeed;

#if (RAWR3)
            float armorReduction = (1.0f - Lookup.ArmorReduction(Character, Stats, BossOpts.Level));
#else
            float armorReduction = (1.0f - Lookup.ArmorReduction(Character, Stats, CalcOpts.TargetLevel));
#endif
            float baseDamagePerSecond = CalcOpts.BossAttackValue / CalcOpts.BossAttackSpeed;
            float guaranteedReduction = (Lookup.StanceDamageReduction(Character, Stats) * armorReduction);
            float absorbed            = Stats.DamageAbsorbed;

            DamagePerHit   = (CalcOpts.BossAttackValue * guaranteedReduction) - absorbed;
            DamagePerCrit  = (2.0f * DamagePerHit);
            DamagePerBlock = Math.Max(0.0f, DamagePerHit - Lookup.ActiveBlockReduction(Character, Stats));

            AverageDamagePerHit =
                DamagePerHit * (DefendTable.Hit / DefendTable.AnyHit) +
                DamagePerCrit * (DefendTable.Critical / DefendTable.AnyHit) +
                DamagePerBlock * (DefendTable.Block / DefendTable.AnyHit);
            AverageDamagePerAttack =
                DamagePerHit * DefendTable.Hit +
                DamagePerCrit * DefendTable.Critical +
                DamagePerBlock * DefendTable.Block;

            float reductionAD = 1.0f - Lookup.ArdentDefenderReduction(Character);
            float healthAD    = (0.65f + (0.35f / reductionAD)) * Stats.Health;

            DamagePerSecond     = AverageDamagePerAttack / attackSpeed;
            DamageTaken         = DamagePerSecond / baseDamagePerSecond;
            Mitigation          = (1.0f - (DamagePerSecond / baseDamagePerSecond));
            TankPoints          = (healthAD / (1.0f - Mitigation));
            EffectiveHealth     = (healthAD / guaranteedReduction);
            GuaranteedReduction = (1.0f - guaranteedReduction);


            double a = Convert.ToDouble(DefendTable.AnyMiss);
            double h = Convert.ToDouble(healthAD);
            double H = Convert.ToDouble(AverageDamagePerHit);
            double s = Convert.ToDouble(ParryModel.BossAttackSpeed / CalcOpts.BossAttackSpeed);
            BurstTime = Convert.ToSingle((1.0d / a) * ((1.0d / Math.Pow(1.0d - a, h / H)) - 1.0d) * s);

            /*
             * // Attempt to make a different TTL:
             * float damageTaken = Options.BossAttackValue; // for TTL(EH)
             * float health = EffectiveHealth;
             * float anyHit = 1.0f; // worst case, you get hit every swing
             * float attacksToKill = (float)Math.Ceiling(health / DamageTaken); // So 10 health / 4 damage = 2.5 attacks = 3 attacks.
             * float timeToDie = attacksToKill * attackSpeed; // time in seconds
             * float chanceToDie = Convert.ToSingle((float)Math.Pow(anyHit, attacksToKill)); // (= 1^attacksToKill)
             * float timeToLive = timeToDie * chanceToDie;
             * BurstTime = timeToLive;
             */
        }
Exemplo n.º 2
0
        public void Calculate()
        {
            float attackSpeed         = BossOpts.DefaultMeleeAttack.AttackSpeed / (1f - Stats.BossAttackSpeedReductionMultiplier);
            float armorReduction      = (1.0f - Lookup.ArmorReduction(Stats.Armor, BossOpts.Level));
            float baseDamagePerSecond = BossOpts.DefaultMeleeAttack.DamagePerHit / BossOpts.DefaultMeleeAttack.AttackSpeed;
            float guaranteedReduction = (Lookup.DamageReduction(Stats) * armorReduction);
            float absorbed            = Stats.DamageAbsorbed;

            DamagePerHit   = (BossOpts.DefaultMeleeAttack.DamagePerHit * guaranteedReduction) - absorbed;
            DamagePerCrit  = (2.0f * DamagePerHit);
            DamagePerBlock = Math.Max(0.0f, DamagePerHit * (1f - Lookup.ActiveBlockReduction(Stats.BonusBlockValueMultiplier, Character.PaladinTalents.HolyShield)));

            AverageDamagePerHit =
                DamagePerHit * (DefendTable.Hit / DefendTable.AnyHit) +
                DamagePerCrit * (DefendTable.Critical / DefendTable.AnyHit) +
                DamagePerBlock * (DefendTable.Block / DefendTable.AnyHit);
            AverageDamagePerAttack =
                DamagePerHit * DefendTable.Hit +
                DamagePerCrit * DefendTable.Critical +
                DamagePerBlock * DefendTable.Block;

            DamagePerSecond     = AverageDamagePerAttack / attackSpeed;
            DamageTaken         = DamagePerSecond / baseDamagePerSecond;
            Mitigation          = (1.0f - (DamagePerSecond / baseDamagePerSecond));
            CTCovered           = (DefendTable.AnyMiss + DefendTable.Block);
            TankPoints          = (Stats.Health / (1.0f - Mitigation));
            EffectiveHealth     = (Stats.Health / guaranteedReduction);
            GuaranteedReduction = (1.0f - guaranteedReduction);

            double a = Convert.ToDouble(DefendTable.AnyMiss);
            double h = Convert.ToDouble(Stats.Health);
            double H = Convert.ToDouble(AverageDamagePerHit);
            double s = Convert.ToDouble(BossOpts.DefaultMeleeAttack.AttackSpeed / BossOpts.DefaultMeleeAttack.AttackSpeed);

            BurstTime = Convert.ToSingle((1.0d / a) * ((1.0d / Math.Pow(1.0d - a, h / H)) - 1.0d) * s);

            /*
             * // Attempt to make a different TTL:
             * float damageTaken = Options.BossAttackValue; // for TTL(EH)
             * float health = EffectiveHealth;
             * float anyHit = 1.0f; // worst case, you get hit every swing
             * float attacksToKill = (float)Math.Ceiling(health / DamageTaken); // So 10 health / 4 damage = 2.5 attacks = 3 attacks.
             * float timeToDie = attacksToKill * attackSpeed; // time in seconds
             * float chanceToDie = Convert.ToSingle((float)Math.Pow(anyHit, attacksToKill)); // (= 1^attacksToKill)
             * float timeToLive = timeToDie * chanceToDie;
             * BurstTime = timeToLive;
             */
        }