Example #1
0
        public int GetDamageResistRating(CombatType?combatType = null)
        {
            // get from base properties (monsters)?
            var damageResistRating = DamageResistRating ?? 0;

            // additive enchantments
            var enchantments = EnchantmentManager.GetRating(PropertyInt.DamageResistRating);

            // nether DoTs as negative DRR?
            // TODO: this should be factored in as a separate nether damage rating...
            var netherDotDamageRating = EnchantmentManager.GetNetherDotDamageRating();

            var augBonus    = 0;
            var lumAugBonus = 0;
            var specBonus   = 0;

            if (this is Player player)
            {
                augBonus    = player.AugmentationDamageReduction * 3;
                lumAugBonus = player.LumAugDamageReductionRating;
                specBonus   = GetSpecDefenseBonus(combatType);
            }

            return(damageResistRating + enchantments - netherDotDamageRating + augBonus + lumAugBonus + specBonus);
        }
        public int GetDamageResistRating(CombatType?combatType = null, bool directDamage = true)
        {
            // get from base properties (monsters)?
            var damageResistRating = DamageResistRating ?? 0;

            // additive enchantments
            var enchantments = EnchantmentManager.GetRating(PropertyInt.DamageResistRating);

            // equipment ratings
            // TODO: caching?
            var equipment = EquippedObjects.Values.Sum(i => i.GearDamageResist ?? 0);

            // nether DoTs as negative DRR?
            // TODO: this should be factored in as a separate nether damage rating...
            var netherDotDamageRating = directDamage ? EnchantmentManager.GetNetherDotDamageRating() : 0;

            var augBonus    = 0;
            var lumAugBonus = 0;
            var specBonus   = 0;

            if (this is Player player)
            {
                augBonus    = player.AugmentationDamageReduction * 3;
                lumAugBonus = player.LumAugDamageReductionRating;
                specBonus   = GetSpecDefenseBonus(combatType);
            }

            return(damageResistRating + equipment + enchantments - netherDotDamageRating + augBonus + lumAugBonus + specBonus);
        }