コード例 #1
0
    void Skill_401(CMsgHeader aHeader)
    {
        //技能
        CMsgSkillAttack skill = aHeader as CMsgSkillAttack;

        int from = skill.caster;
        int to   = skill.suffer; //谁受到伤害

        if (skill.suffer == localCached.attIndex)
        {
            localCached.attCurBp   = skill.curAtt;
            localCached.defAPCount = skill.curAngry;
        }
        else
        {
            localCached.defCurBp   = skill.curAtt;
            localCached.attAPCount = skill.curAngry;
        }

        int skillId = skill.skillId;
        //恢复的怒气
        int RecoverAngry = skill.recoverAngry;
        //消耗的怒气
        int CostAngry = skill.costAngry;
        //消耗时的怒气
        int PreAngry = skill.preAngry;

        BanBattleProcess.Item newItem = null;

        if (RecoverAngry > 0)
        {
            newItem = AddItemWhenSkill(localCached, skill.skillType, from, to,
                                       BanBattleProcess.Item.CostAndRecoverAngry, skillId, skill.curAngry, skill);
            newItem.recoverAngry = RecoverAngry;
            newItem.costAngry    = CostAngry;
            newItem.preAngry     = PreAngry;
        }
        else
        {
            AddItemWhenSkill(localCached, skill.skillType, from, to,
                             0, skillId, skill.curAngry, skill);
        }
    }
コード例 #2
0
    void Skill_416(CMsgHeader aHeader)
    {
        //无视属性相克
        CMsgSkillAttack skill = aHeader as CMsgSkillAttack;

        int from = skill.caster;
        int to   = 0;

        if (skill.suffer == localCached.attIndex)
        {
            to = localCached.defIndex;
        }
        else
        {
            to = localCached.attIndex;
        }

        int skillId = skill.skillId;

        AddItemWhenSkill(localCached, skill.skillType, from, to, -1, skillId, -1, skill);
    }
コード例 #3
0
    void Skill_407(CMsgHeader aHeader, List <CMsgHeader> battleInfo, int headerIndex)
    {
        //自爆技能
        //因为自爆技能的特殊,很有可能是夹在两个互殴片段之间
        //所以我们要判定是否还处于互殴阶段
        bool             Vs1 = false, Vs2 = false, Vs = false;
        CMsgNormalAttack AfterVsAttack = null;
        int maxLength = battleInfo.Count;
        int preIndex  = headerIndex - 2;

        if (headerIndex < maxLength)
        {
            int        tmp      = headerIndex;
            CMsgHeader nextItem = null;
            do
            {
                nextItem = battleInfo[tmp];

                CMsgSkillCast check = nextItem as CMsgSkillCast;
                if (check != null)
                {
                    if (check.skillType == (int)CSkill_Type.Die)
                    {
                        tmp += 1;
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    ConsoleEx.DebugLog("check = " + nextItem.GetType().ToString()); break;
                }
            } while(tmp < maxLength);


            if (nextItem.status == CMsgHeader.STATUS_ATTACK)
            {
                Vs1           = true;
                AfterVsAttack = nextItem as CMsgNormalAttack;
            }
        }

        if (preIndex >= 0)
        {
            CMsgHeader preItem = battleInfo[preIndex];
            if (preItem.status == CMsgHeader.STATUS_ATTACK)
            {
                Vs2 = true;
            }
        }
        Vs = Vs1 && Vs2;

        ///
        /// 我只对受伤队列的第一个感兴趣,后面的,登场时候血量就会减少
        ///
        CMsgSkillBlast item = aHeader as CMsgSkillBlast;

        int             nFrom;
        CMsgSkillAttack one = item.sufferArr.Value <CMsgSkillAttack>(0);

        if (item.caster == localCached.attIndex)
        {
            localCached.attCurBp = 0;
            if (Vs)
            {
                localCached.defCurBp = AfterVsAttack.curAtt;

                if (one != null)
                {
                    localCached.DefExploreHurt = one.finalAtt;
                }
            }
            else
            {
                if (one != null)
                {
                    localCached.defCurBp = one.curAtt;
                }
            }

            nFrom = localCached.attIndex;
        }
        else
        {
            if (Vs)
            {
                localCached.attCurBp = AfterVsAttack.curAtt;
                if (one != null)
                {
                    localCached.AttExploreHurt = one.finalAtt;
                }
            }
            else
            {
                if (one != null)
                {
                    localCached.attCurBp = one.curAtt;
                }
            }

            localCached.defCurBp = 0;
            nFrom = localCached.defIndex;
        }

        int skillId = item.skillId;

        BanBattleProcess.Item added = AddItemWhenSkill(localCached, item.skillType, nFrom, -1,
                                                       BanBattleProcess.Item.Extra3_Explore, skillId, item.curAngry, item);

        added.VsMiddle = Vs ? 1 : 0;
    }
コード例 #4
0
    void Skill_403(CMsgHeader aHeader)
    {
        //10100  悟天克斯布欧
        CMsgSkillAttackCombo skill = aHeader as CMsgSkillAttackCombo;

        int last = skill.attackArr.Length - 1;

        if (last < 0)
        {
            return;
        }
        CMsgSkillAttack lastItem = skill.attackArr[last];

        int from = 0;
        int to   = 0;

        int skillId = skill.skillId;

        //连击的情况,我们应该先把怒气使用怒气
        if (lastItem.skillType == 0)
        {
            //左边是挨打方
            if (lastItem.suffer == localCached.attIndex)
            {
                localCached.attCurBp   = lastItem.curAtt;
                localCached.attAPCount = lastItem.curAngry;
                localCached.defAPCount = skill.curAngry;
                from = localCached.defIndex;
                to   = localCached.attIndex;
            }
            else
            {
                //右边是挨打方
                localCached.defCurBp   = lastItem.curAtt;
                localCached.defAPCount = lastItem.curAngry;
                localCached.attAPCount = skill.curAngry;
                from = localCached.attIndex;
                to   = localCached.defIndex;
            }

            AddItemWhenSkill(localCached, lastItem.skillType, from, to,
                             BanBattleProcess.Item.Extra3_Combo, skillId, lastItem.curAngry, skill);
        }
        else
        {
            foreach (CMsgSkillAttack item in skill.attackArr)
            {
                from = item.caster;
                to   = item.suffer;

                if (item.suffer == localCached.defIndex)
                {
                    localCached.defCurBp   = item.curAtt;
                    localCached.attAPCount = skill.curAngry;
                    localCached.defAPCount = item.curAngry;
                }
                else
                {
                    localCached.attCurBp   = item.curAtt;
                    localCached.attAPCount = item.curAngry;
                    localCached.defAPCount = skill.curAngry;
                }

                AddItemWhenSkill(localCached, item.skillType, from, to,
                                 BanBattleProcess.Item.Extra3_Combo, skillId, item.curAngry, skill);
            }
        }
    }