Esempio n. 1
0
        // Computes accuracy.
        public void AccuracyRating(AttributeSet attrs)
        {
            Accuracy = attrs["+# Accuracy Rating"][0];
            // Local weapon accuracy bonus.
            if (Local.ContainsKey("+# to Accuracy Rating"))
            {
                Accuracy += Local["+# to Accuracy Rating"][0];
            }
            float incAcc = 0;

            // Local weapon accuracy bonus.
            if (Local.ContainsKey("#% increased Accuracy Rating"))
            {
                incAcc += Local["#% increased Accuracy Rating"][0];
            }
            // Gems & global bonuses.
            if (attrs.ContainsKey("+# to Accuracy Rating"))
            {
                Accuracy += attrs["+# to Accuracy Rating"][0];
            }
            if (attrs.ContainsKey("#% increased Accuracy Rating"))
            {
                incAcc += attrs["#% increased Accuracy Rating"][0];
            }
            if (attrs.ContainsKey("#% reduced Accuracy Rating"))
            {
                incAcc += attrs["#% reduced Accuracy Rating"][0];
            }
            foreach (var attr in attrs.Matches(ReIncreasedAccuracyRatingWithWeaponType))
            {
                Match      m = ReIncreasedAccuracyRatingWithWeaponType.Match(attr.Key);
                WeaponType weaponType;
                if (WithWeaponType.TryGetValue(m.Groups[2].Value, out weaponType) && Nature.Is(weaponType))
                {
                    incAcc += m.Groups[1].Value == "increased" ? attr.Value[0] : -attr.Value[0];
                }
            }
            if (Compute.IsDualWielding && attrs.ContainsKey("#% increased Accuracy Rating while Dual Wielding"))
            {
                incAcc += attrs["#% increased Accuracy Rating while Dual Wielding"][0];
            }
            if (incAcc != 0)
            {
                Accuracy = IncreaseValueByPercentage(Accuracy, incAcc);
            }
        }
Esempio n. 2
0
 // Returns attacks/casts per second.
 public float AttacksPerSecond()
 {
     return(Nature.Is(DamageSource.Attack) && Compute.IsDualWielding ? (Sources[0].APS + Sources[1].APS) / 2 : Sources[0].APS);
 }