Example #1
0
        /// <summary>
        /// Modified by victim's resilience
        /// </summary>
        /// <param name="dmg"></param>
        /// <param name="victim"></param>
        /// <param name="effect"></param>
        /// <returns></returns>
        public virtual float CalcCritDamage(float dmg, Unit victim, SpellEffect effect)
        {
            /*if (effect != null)
             * {
             *  return (int)(dmg * 1.5f);
             * }*/
            var multiplier = 200;

            multiplier -= (int)victim.GetResiliencePct();
            multiplier += victim.GetIntMod(StatModifierInt.CritDamageBonusPct) + CritDamageBonusPrc;
            return((dmg * multiplier + 50) / 100);
        }
Example #2
0
		/// <summary>
		/// Modified by victim's resilience
		/// </summary>
		/// <param name="dmg"></param>
		/// <param name="victim"></param>
		/// <param name="effect"></param>
		/// <returns></returns>
		public virtual float CalcCritDamage(float dmg, Unit victim, SpellEffect effect)
		{
			if (effect != null)
			{
				return (int)(dmg * 1.5f);
			}
			var multiplier = 200;
			multiplier -= (int)victim.GetResiliencePct();
			multiplier += victim.GetIntMod(StatModifierInt.CritDamageBonusPct);
			return (dmg * multiplier + 50) / 100;
		}
Example #3
0
		public float CalcCritChance(Unit defender, DamageSchool dmgSchool, Spell spell, IWeapon weapon)
		{
			float chance;
			if (this is Character)
			{
				var chr = (Character)this;
				if (weapon != null)
				{
					if (weapon.IsRanged)
					{
						chance = chr.CritChanceRangedPct;
					}
					else
					{
						chance = chr.CritChanceMeleePct;
					}
				}
				else
				{
					chance = GetCritChance(dmgSchool);
				}
			}
			else
			{
				chance = GetCritChance(dmgSchool);
			}

			//chance -= defender.GetResiliencePct(this);
			chance -= defender.GetResiliencePct();
			return chance;
		}
Example #4
0
		public float CalcSpellCritChance(Unit defender, DamageSchool dmgSchool, float resistPct, Spell spell)
		{
			var chance = GetSpellCritChance(dmgSchool);
			if (this is Character)
			{
				var chr = (Character)this;
				chance += chr.PlayerSpells.GetModifierFlat(SpellModifierType.CritChance, spell);
			}
			chance -= defender.GetResiliencePct();
			return chance;
		}
Example #5
0
		public virtual float CalcCritDamage(float dmg, Unit victim, SpellEffect effect)
		{
			dmg = (dmg * (1.5f - (victim.GetResiliencePct() * 2)));
			return dmg;
		}