Esempio n. 1
0
    void Skill_417(CMsgHeader aHeader)
    {
        //变成全属性
        CMsgSkillCast skill = aHeader as CMsgSkillCast;

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

        int skillId = skill.skillId;

        //有可能是奥义的技能,所以要转换一下
        string skillname = string.Empty;

        if (isAoYiSkill(skillId))
        {
            AddItemWhenSkill(localCached, skill.skillType, from, to,
                             BanBattleProcess.Item.Extra3_Attribute_CHG, skillId, skill.curAngry, skill);
        }
        else
        {
            skillname = Core.Data.skillManager.getSkillDataConfig(skillId).name;
            addItemWhenPropertyChg(localCached, from, skillname, skillId);
        }
    }
Esempio n. 2
0
    void Skill_418(CMsgHeader aHeader, List <CMsgHeader> battleInfo, int headerIndex)
    {
        //虽然是增加怒气,但是有可能增加怒气的技能师怒气技能或者是奥义技能
        //如果是奥义技能的话,还要区分是否是死亡时候触发
        //所以我们要判定是否还处于互殴阶段

        //增加怒气
        CMsgSkillCast addAngry = aHeader as CMsgSkillCast;

        bool Vs = false;

        if (addAngry.skillType == (int)CSkill_Type.Die)
        {
            //我们要判定是否还处于互殴阶段
            bool Vs1 = false, Vs2 = false;
            int  maxLength = battleInfo.Count;
            int  preIndex  = headerIndex - 2;

            if (headerIndex < maxLength)
            {
                CMsgHeader nextItem = battleInfo[headerIndex];
                if (nextItem.status == CMsgHeader.STATUS_ATTACK)
                {
                    Vs1 = true;
                }
            }

            if (preIndex >= 0)
            {
                CMsgHeader preItem = null;

                do
                {
                    preItem = battleInfo[preIndex];
                    CMsgSkillCast check = preItem as CMsgSkillCast;
                    if (check != null)
                    {
                        if (check.skillType == (int)CSkill_Type.Die)
                        {
                            preIndex -= 1;
                        }
                        else
                        {
                            break;
                        }
                    }
                    else
                    {
                        ConsoleEx.DebugLog("check = " + preItem.GetType().ToString());
                        break;
                    }
                } while(preIndex >= 0);


                if (preItem.status == CMsgHeader.STATUS_ATTACK)
                {
                    Vs2 = true;
                }
            }

            Vs = Vs1 && Vs2;
        }


        int from    = addAngry.caster;
        int to      = -1;
        int skillId = addAngry.skillId;

        if (addAngry.caster == localCached.attIndex)
        {
            localCached.attAPCount = addAngry.curAngry;
        }
        else
        {
            localCached.defAPCount = addAngry.curAngry;
        }

        if (Vs)
        {
            if (addAngry.caster == localCached.attIndex)
            {
                localCached.attCurBp = 0;
            }
            else
            {
                localCached.defCurBp = 0;
            }

            AddItemWhenSkill(localCached, addAngry.skillType, from, to,
                             BanBattleProcess.Item.Extra3_AoYiAngry, skillId, addAngry.curAngry, addAngry);
        }
        else
        {
            AddItemWhenSkill(localCached, addAngry.skillType, from, to,
                             BanBattleProcess.Item.Extra3_AddAP, skillId, addAngry.curAngry, addAngry);
        }
    }
Esempio n. 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;
    }