예제 #1
0
        public bool BeHited(LiveMonster src)
        {
            int hitrate = SkillAssistant.GetHit(src, this);

            if (hitrate > MathTool.GetRandom(100))
            {
                HitDamage damage = SkillAssistant.GetDamage(src, this);
                CheckDamageBuffEffect(src, damage);

                HpBar.OnDamage(damage);
                SkillAssistant.CheckHitEffectAfter(src, this, damage);
                if (src.WeaponId > 0)
                {
                    src.Weapon.OnHit();
                }
                if (WeaponId > 0)
                {
                    Weapon.OnHited();
                }
                if (damage.Value > 0)
                {
                    BuffManager.CheckRecoverOnHit();
                    lastDamagerId  = src.Id;
                    peakDamagerLuk = Math.Max(peakDamagerLuk, src.RealLuk);
                }
                return(true);
            }
            return(false);
        }