Пример #1
0
        protected override void ApplyToItem(AttributeAffix affix, QualityRoll quality)
        {
            Assert.IsTrue(IsApplicableToItem(affix));
            MagnitudeRange magnitudeRange = affix.Range.Value;
            int            magnitude      = magnitudeRange.Interpolate(quality);

            tempEnhancement.ApplyWeaponAttribute(affix.Attribute, affix.Priority, magnitude);
        }
Пример #2
0
        DamageInfo ComputeDamage(MagnitudeRange damageRange, int mitigation, int absorption, int reduction)
        {
            int        rawDamage       = damageRange.Interpolate(QualityRoll.GetRandom());
            int        afterResistance = ApplyMitigation(rawDamage, mitigation);
            int        absorbed        = rawDamage - ApplyMitigation(rawDamage, absorption);
            DamageInfo damageResult    = new DamageInfo(rawDamage, rawDamage - afterResistance, absorbed, reduction);

            return(damageResult);
        }
Пример #3
0
        DamageInfo ComputePhysicalDamage(MagnitudeRange damageRange, int armor, int critFactor, int reduction)
        {
            int        mitigation   = ArmorToMitigation(armor);
            int        rawDamage    = critFactor * damageRange.Interpolate(QualityRoll.GetRandom());
            int        afterArmor   = ApplyMitigation(rawDamage, mitigation);
            DamageInfo damageResult = new DamageInfo(rawDamage, rawDamage - afterArmor, 0, reduction);

            return(damageResult);
        }
Пример #4
0
 AttributeEnhancement BuildEnhancement(QualityRoll quality, MagnitudeRange range)
 {
     return(new AttributeEnhancement(attribute, priority, range.Interpolate(quality)));
 }