示例#1
0
        public void BeDamageBySkill(DamageInfo <Skill> info)
        {
            DamageEventArgs <Bot> e = new DamageEventArgs <Bot>(info.Damage, info.source.owner.owner.Owner, info.damageMode, info.HitValue, info.AttackDirection, info.AttackPosition, info.StrongGPImmuse, info.DamageRateImmuse, info.DownDamage);

            if (OnBeingDamage != null)
            {
                OnBeingDamage(this, e);
            }
            DamageEventArgs <Skill> e1 = new DamageEventArgs <Skill>(e.Damage, info.source, e.DamageMode, e.HitValue, info.AttackDirection, info.AttackPosition, e.StrongGPImmuse, e.DamageRateImmuse, info.DownDamage);

            e1.Cancel = e.Cancel;
            if (OnBeingDamageBySkill != null)
            {
                OnBeingDamageBySkill(this, e1);
            }

            //伤害计算前的事件
            info.Damage     = e1.Damage;
            info.damageMode = e1.DamageMode;
            info.HitValue   = e1.HitValue;
            if (e1.Cancel)
            {
                return;
            }
            //百分比减伤
            info.Damage = (int)(owner.Abilities.DamageInComeRate * info.Damage);

            //强护甲减伤
            info.Damage -= owner.Abilities.StrongGP;

            //扣血
            owner.Abilities.HP.Value -= info.Damage;
            //硬直计算 时间=0.3*技能硬直/对方人物硬直(0.6秒上限),如果比值超过2就击飞,处于被打出硬直中的敌人,只要技能硬直不为0,就会刷新硬直,时间至少0.3s
            KnockBackCalc(info.source.owner.owner.Owner, info.HitValue, info.AttackDirection);
        }
示例#2
0
 private void Owner_OnBeingDamageBySkill(object sender, DamageEventArgs <Skill> e)
 {
     if (!e.DownDamage)
     {
         e.Cancel = true;
     }
 }
示例#3
0
        public void BeDamageByItem(DamageInfo <Item> info)
        {
            DamageEventArgs <Bot> e = new DamageEventArgs <Bot>(info.Damage, info.source.Owner.Owner, info.damageMode, info.HitValue, info.AttackDirection, info.AttackPosition, info.StrongGPImmuse, info.DamageRateImmuse, info.DownDamage);

            if (OnBeingDamage != null)
            {
                OnBeingDamage(this, e);
            }
            DamageEventArgs <Item> e1 = new DamageEventArgs <Item>(e.Damage, info.source, e.DamageMode, e.HitValue, info.AttackDirection, info.AttackPosition, e.StrongGPImmuse, e.DamageRateImmuse, info.DownDamage);

            e1.Cancel = e.Cancel;
            if (OnBeingDamageBySkill != null)
            {
                OnBeingDamageByItem(this, e1);
            }

            //伤害计算前的事件
            info.Damage     = e1.Damage;
            info.damageMode = e1.DamageMode;
            info.HitValue   = e1.HitValue;
            if (e1.Cancel)
            {
                return;
            }

            //强护甲减伤
            info.Damage -= owner.Abilities.StrongGP;

            //百分比减伤
            info.Damage = (int)(owner.Abilities.DamageInComeRate * info.Damage);

            //扣血
            owner.Abilities.HP.Value -= info.Damage;
            //硬直计算
            KnockBackCalc(info.source.Owner.Owner, info.HitValue, info.AttackDirection);
        }