Beispiel #1
0
        private float CalculateThisDamage(ItemDamageType type, float baseDamage)
        {
            float dmg = 0;

            try {
                AttackTable MHAtkTable = AttackTables[type];
                dmg  = baseDamage;                   // Base Damage
                dmg *= 1f + DamageMultipliers[type]; // Global Damage Bonuses
                dmg *= 1f - DamageResistances[type]; // Global Damage Penalties

                // Work the Attack Table, note: some of these points will always be zero
                float dmgDrop = (1f
                                 - MHAtkTable.Miss                                            // no damage when being missed
                                 - MHAtkTable.Dodge                                           // no damage when being dodged
                                 - MHAtkTable.Parry                                           // no damage when being parried
                                 - MHAtkTable.Glance                                          // glancing handled below
                                 - MHAtkTable.Block                                           // blocked  handled below
                                 - MHAtkTable.Crit);                                          // crits    handled below

                float dmgGlance = dmg * MHAtkTable.Glance * 0.70f;                            // Partial Damage when glancing
                float dmgBlock  = dmg * MHAtkTable.Block * 0.70f;                             // Partial damage when blocked
                float dmgCrit   = dmg * MHAtkTable.Crit * (1f + DamageCritMultipliers[type]); // Bonus Damage when critting

                dmg *= dmgDrop;

                dmg += dmgGlance + dmgBlock + dmgCrit;
            } catch (Exception ex) {
                Rawr.Base.ErrorBox eb = new Rawr.Base.ErrorBox("Error calculating special proc DPS",
                                                               ex.Message, "CalculateThisDamage(...)", "", ex.StackTrace);
            }

            return(dmg);
        }
Beispiel #2
0
        /// <summary>
        /// Generates the necessary Damage Multipliers and Attack Tables.
        /// This function is automatically called by the constructor.
        /// </summary>
        public void CreateDictionaries()
        {
            Reset();
            // Partial Spell Resists
            float averageResist = (LevelDelta) * 0.02f;
            float resist10      = 5.0f * averageResist;
            float resist20      = 2.5f * averageResist;
            float partialResist = (resist10 * 0.1f + resist20 * 0.2f);

            { // Physical
                ItemDamageType type           = ItemDamageType.Physical;
                AttackTable    a              = new AttackTable(Char, StatS, false, false, LevelDelta);
                float          DamageMult     = StatS.BonusPhysicalDamageMultiplier;
                float          DamageCritMult = StatS.BonusCritMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, 1f - ArmorDmgReduc);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
            { // Arcane
                ItemDamageType type           = ItemDamageType.Arcane;
                AttackTable    a              = new AttackTable(Char, StatS, true, false, LevelDelta);
                float          DamageMult     = StatS.BonusArcaneDamageMultiplier;
                float          DamageCritMult = StatS.BonusSpellCritMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, partialResist);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
            { // Holy
                ItemDamageType type           = ItemDamageType.Holy;
                AttackTable    a              = new AttackTable(Char, StatS, true, false, LevelDelta);
                float          DamageMult     = StatS.BonusHolyDamageMultiplier;
                float          DamageCritMult = StatS.BonusSpellCritMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, partialResist);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
            { // Nature
                ItemDamageType type           = ItemDamageType.Nature;
                AttackTable    a              = new AttackTable(Char, StatS, true, false, LevelDelta);
                float          DamageMult     = StatS.BonusNatureDamageMultiplier;
                float          DamageCritMult = StatS.BonusSpellCritMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, partialResist);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
            { // Shadow
                ItemDamageType type           = ItemDamageType.Shadow;
                AttackTable    a              = new AttackTable(Char, StatS, true, false, LevelDelta);
                float          DamageMult     = StatS.BonusShadowDamageMultiplier;
                float          DamageCritMult = StatS.BonusSpellCritMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, partialResist);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
            { // Fire
                ItemDamageType type           = ItemDamageType.Fire;
                AttackTable    a              = new AttackTable(Char, StatS, true, false, LevelDelta);
                float          DamageMult     = StatS.BonusFireDamageMultiplier;
                float          DamageCritMult = StatS.BonusSpellCritMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, partialResist);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
            { // Frost
                ItemDamageType type           = ItemDamageType.Frost;
                AttackTable    a              = new AttackTable(Char, StatS, true, false, LevelDelta);
                float          DamageMult     = StatS.BonusFrostDamageMultiplier;
                float          DamageCritMult = StatS.BonusSpellCritMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, partialResist);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
        }
        /// <summary>
        /// Generates the necessary Damage Multipliers and Attack Tables.
        /// This function is automatically called by the constructor.
        /// </summary>
        public void CreateDictionaries()
        {
            Reset();
            // Partial Spell Resists
            float averageResist = (LevelDelta) * 0.02f;
            float resist10 = 5.0f * averageResist;
            float resist20 = 2.5f * averageResist;
            float partialResist = (resist10 * 0.1f + resist20 * 0.2f);

            { // Physical
                ItemDamageType type = ItemDamageType.Physical;
                AttackTable a = new AttackTable(Char, StatS, false, false, LevelDelta);
                float DamageMult = StatS.BonusPhysicalDamageMultiplier;
                float DamageCritMult = StatS.BonusCritDamageMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, 1f - ArmorDmgReduc);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
            { // Arcane
                ItemDamageType type = ItemDamageType.Arcane;
                AttackTable a = new AttackTable(Char, StatS, true, false, LevelDelta);
                float DamageMult = StatS.BonusArcaneDamageMultiplier;
                float DamageCritMult = StatS.BonusSpellCritDamageMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, partialResist);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
            { // Holy
                ItemDamageType type = ItemDamageType.Holy;
                AttackTable a = new AttackTable(Char, StatS, true, false, LevelDelta);
                float DamageMult = StatS.BonusHolyDamageMultiplier;
                float DamageCritMult = StatS.BonusSpellCritDamageMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, partialResist);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
            { // Nature
                ItemDamageType type = ItemDamageType.Nature;
                AttackTable a = new AttackTable(Char, StatS, true, false, LevelDelta);
                float DamageMult = StatS.BonusNatureDamageMultiplier;
                float DamageCritMult = StatS.BonusSpellCritDamageMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, partialResist);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
            { // Shadow
                ItemDamageType type = ItemDamageType.Shadow;
                AttackTable a = new AttackTable(Char, StatS, true, false, LevelDelta);
                float DamageMult = StatS.BonusShadowDamageMultiplier;
                float DamageCritMult = StatS.BonusSpellCritDamageMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, partialResist);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
            { // Fire
                ItemDamageType type = ItemDamageType.Fire;
                AttackTable a = new AttackTable(Char, StatS, true, false, LevelDelta);
                float DamageMult = StatS.BonusFireDamageMultiplier;
                float DamageCritMult = StatS.BonusSpellCritDamageMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, partialResist);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
            { // Frost
                ItemDamageType type = ItemDamageType.Frost;
                AttackTable a = new AttackTable(Char, StatS, true, false, LevelDelta);
                float DamageMult = StatS.BonusFrostDamageMultiplier;
                float DamageCritMult = StatS.BonusSpellCritDamageMultiplier;
                DamageMultipliers.Add(type, DamageMult);
                DamageCritMultipliers.Add(type, DamageCritMult);
                DamageResistances.Add(type, partialResist);
                AttackTables.Add(type, a);
                TotalDamage.Add(type, 0f);
                TotalDamagePerSec.Add(type, 0f);
                TotalNumProcs.Add(type, 0f);
                TotalNumProcsPerSec.Add(type, 0f);
            }
        }