示例#1
0
        /// <summary>
        /// 技能攻击
        /// </summary>
        /// <param name="fighter"></param>
        /// <param name="par"></param>
        /// <returns></returns>
        private bool AttackJiNeng(FightObject fighter, int level, GameConfig gc)
        {
            //伤害类型 物理0  魔法1
            int injuryType = gc.Value.GetIntOrDefault("InjuryType");

            List<ActionResult> results = SkillAttack(fighter, level, gc, injuryType);
            if (results.Count > 0)
            {
                FightAction action = fighter.Action;
                action.Result = results;
                int fightCount = action.FightCount;
                action.FightCount = FightAction.HasAction;
                m_actions.Add(action);

                //蓄力,第二次攻击..
                SkillBuffer buff = fighter.FindBuffer(BufferType.XuLi);
                if (buff != null)
                {
                    action = action.CopyNew();
                    action.FightCount = fightCount;
                    fighter.Action = action;
                    List<ActionResult> results2 = SkillAttack(fighter, level, gc, injuryType);
                    if (results2.Count > 0)
                    {
                        action.Result = results2;
                        action.FightCount = FightAction.HasAction;
                        m_actions.Add(action);
                    }
                }
                return true;
            }
            return false;
        }
示例#2
0
文件: AttackMagic.cs 项目: abel/sinan
 /// <summary>
 /// 计算魔法攻击值
 /// </summary>
 /// <returns></returns>
 protected override int GetGongJi(FightObject target)
 {
     double beiShu = 1;
     SkillBuffer buff = m_a.FindBuffer(BufferType.ShenTuo);
     if (buff != null)
     {
         beiShu += buff.V;
     }
     buff = m_a.FindBuffer(BufferType.XiSheng);
     if (buff != null)
     {
         //如提升自己75%的魔法攻击,但会多受到30%的物理伤害
         //则保存为 75030(即前面的为提升..后面三位为多受的伤害)
         int d = Convert.ToInt32(buff.V);
         beiShu += (d / 1000) * 0.01;
         //beiShu += buff.V;
     }
     //目标有神龙.
     buff = target.FindBuffer(BufferType.ShengLong);
     if (buff != null)
     {
         beiShu -= buff.V;
     }
     return m_Par.GetGonJi(m_a.Life.MoFaGongJi * beiShu) + m_a.MG - target.MF;
 }
示例#3
0
文件: AttackMagic.cs 项目: abel/sinan
 /// <summary>
 /// 计算魔法吸收
 /// </summary>
 /// <returns></returns>
 protected override double GetXiShou(FightObject target)
 {
     double xishou = target.Life.MoFaXiShou;
     SkillBuffer o = target.FindBuffer(BufferType.ShengLong);
     if (o != null)
     {
         xishou += o.V;
     }
     return Math.Min(0.8, xishou);
 }
示例#4
0
 /// <summary>
 /// 修改生命值.
 /// </summary>
 /// <param name="target">接受攻击者</param>
 /// <param name="w"></param>
 /// <returns></returns>
 protected int ChangeShengMing(ActionResult result, FightObject sender, FightObject target)
 {
     int xiuShen = 0;
     if (target.HP <= 0)
     {
         SkillBuffer b = target.FindBuffer(BufferType.XiuShen);
         if (b != null)
         {
             xiuShen = Convert.ToInt32(b.V);
             result.Value["XiuShen"] = xiuShen;
             result.ActionFlag |= ActionFlag.XiuShen;
             target.HP = xiuShen;
         }
         else
         {
             target.HP = 0;
             target.Buffers.Clear();
             //target.Buffers.RemoveAll(x => x.CanRemove);
             if (target is FightApc)
             {
                 ((FightApc)target).Killer = sender;
             }
         }
     }
     result.Value["ShengMing"] = new MVPair(target.Life.ShengMing, target.HP);
     return xiuShen;
 }