Ejemplo n.º 1
0
        public void Damage(BaseAspect aspect, Mobile target)
        {
            aspect.DoHarmful(target, true);

            var damage = Utility.RandomMinMax(aspect.DamageMin, aspect.DamageMax);

            if (DamageFactor != 1.0)
            {
                damage = (int)Math.Ceiling(damage * DamageFactor);
            }

            if (damage > 0)
            {
                OnDamage(aspect, target, ref damage);
            }

            if (damage > 0)
            {
                target.Damage(damage, aspect);

                if (target.PlayDamagedAnimation())
                {
                    target.PlayHurtSound();
                }
            }
        }