Exemplo n.º 1
0
 /// <summary>
 /// Computes max damage of the weapon.
 /// </summary>
 /// <param name="weaponAttr">Attributes of a weapon.</param>
 /// <returns></returns>
 public static ItemValueRange GetRawWeaponDamageMax(this ItemAttributes weaponAttr)
 {
     return(weaponAttr.GetRawWeaponDamageMax("Arcane") + weaponAttr.GetRawWeaponDamageMax("Cold")
            + weaponAttr.GetRawWeaponDamageMax("Fire") + weaponAttr.GetRawWeaponDamageMax("Holy")
            + weaponAttr.GetRawWeaponDamageMax("Lightning") + weaponAttr.GetRawWeaponDamageMax("Physical")
            + weaponAttr.GetRawWeaponDamageMax("Poison"));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Computes max damage of the weapon (based on a specific resist).
        /// </summary>
        /// <param name="weaponAttr">Attributes of a weapon.</param>
        /// <param name="resist">Name of the resist.</param>
        /// <param name="useDamageTypePercentBonus"></param>
        /// <returns></returns>
        public static ItemValueRange GetRawWeaponDamageMax(this ItemAttributes weaponAttr, String resist, bool useDamageTypePercentBonus = true)
        {
            var damage = weaponAttr.GetBaseWeaponDamageMax(resist);

            damage *= ItemValueRange.One + weaponAttr.GetAttributeByName("damageWeaponPercentBonus_" + resist);

            if (useDamageTypePercentBonus && resist != "Physical")
            {
                damage += weaponAttr.GetRawWeaponDamageMax("Physical") * weaponAttr.GetAttributeByName("damageTypePercentBonus_" + resist);
            }

            return(damage);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Computes weapon only damages
 /// </summary>
 /// <param name="itemAttr"></param>
 /// <returns></returns>
 public static ItemValueRange GetRawAverageWeaponDamage(this ItemAttributes itemAttr)
 {
     // formula: ( min + max ) / 2
     return((itemAttr.GetRawWeaponDamageMin() + itemAttr.GetRawWeaponDamageMax()) / 2);
 }
Exemplo n.º 4
0
 public void GetRawWeaponDamageMax()
 {
     Assert.AreEqual(new ItemValueRange(25.2, 252), weaponAttr.GetRawWeaponDamageMax("Arcane"));
     Assert.AreEqual(new ItemValueRange(36, 360), weaponAttr.GetRawWeaponDamageMax("Physical"));
 }