Ejemplo n.º 1
0
    /// <summary>
    /// 怒气技能已经准备好了
    /// </summary>
    /// <param name="aHeader">A header.</param>
    void AngrySkill_Ready(CMsgHeader aHeader)
    {
        BanBattleProcess UIProc = BanBattleProcess.Instance;

        UIProc.list_Item.Add(new BanBattleProcess.Item(0, 0,
                                                       localCached.attIndex, localCached.defIndex, localCached.attCurBp, localCached.defCurBp, localCached.attAPCount, localCached.defAPCount,
                                                       BanBattleProcess.Period.AngrySkillReady, -1, -1, -1, -1, -1, string.Empty, aHeader));
    }
Ejemplo n.º 2
0
    void NormalAttack(CMsgHeader aHeader)
    {
        //普通攻击
        CMsgNormalAttack aNormalAttack = aHeader as CMsgNormalAttack;

        if (localCached.firstNormalAttack == null)
        {
            localCached.firstNormalAttack = aNormalAttack;
        }
        else
        {
            if (localCached.secondNormalAttack == null)
            {
                localCached.secondNormalAttack = aNormalAttack;

                if (GetBattleRole(localCached.firstNormalAttack.suffer).group != BanBattleRole.Group.Attack)
                {
                    CMsgNormalAttack temp = localCached.firstNormalAttack;
                    localCached.firstNormalAttack  = localCached.secondNormalAttack;
                    localCached.secondNormalAttack = temp;
                }

                BanBattleProcess.Instance.list_Item.Add(new BanBattleProcess.Item(
                                                            0, 0,
                                                            localCached.firstNormalAttack.suffer,
                                                            localCached.secondNormalAttack.suffer,
                                                            localCached.firstNormalAttack.curAtt + localCached.AttExploreHurt,
                                                            localCached.secondNormalAttack.curAtt + localCached.DefExploreHurt,
                                                            localCached.attAPCount,
                                                            localCached.defAPCount,
                                                            BanBattleProcess.Period.NormalAttack, -1, -1, -1, -1, -1)
                                                        );

                localCached.firstNormalAttack  = null;
                localCached.secondNormalAttack = null;

                localCached.AttExploreHurt = 0;
                localCached.DefExploreHurt = 0;
            }
            else
            {
                #if DEBUG
                Debug.Log("can not come here");
                #endif
            }
        }
    }
Ejemplo n.º 3
0
    void Skill_420(CMsgHeader aHeader)
    {
        CMsgSkillAfterRecovery skill = aHeader as CMsgSkillAfterRecovery;

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

        if (skill.suffer == localCached.attIndex)
        {
            localCached.attCurBp   = skill.finalAtt;
            localCached.attAPCount = skill.curAngry;
            localCached.defCurBp   = skill.enemyAtt;
        }
        else
        {
            localCached.defCurBp   = skill.finalAtt;
            localCached.defAPCount = skill.curAngry;
            localCached.attCurBp   = skill.enemyAtt;
        }
        int skillId = skill.skillId;

        AddItemWhenSkill(localCached, skill.skillType, from, to,
                         BanBattleProcess.Item.Extra3_Recover, skillId, skill.curAngry, skill);
    }
Ejemplo n.º 4
0
    void WarEnd(CMsgHeader aHeader)
    {
        CMsgWarEnd aWarEnd = aHeader as CMsgWarEnd;

        if (side == 0)
        {
            battleWin = (aWarEnd.winner == "att");
        }
        else
        {
            battleWin = (aWarEnd.winner == "def");
        }

        if (aWarEnd.winner == "att")
        {
            maxAttendEnemyIndex = -1;
        }

        BanBattleProcess.Instance.list_Item.Add(new BanBattleProcess.Item(
                                                    0, 0,
                                                    localCached.attIndex, localCached.defIndex, localCached.attCurBp, localCached.defCurBp, localCached.attAPCount, localCached.defAPCount,
                                                    BanBattleProcess.Period.EndWar, -1, -1, -1, -1, -1, string.Empty, aHeader)
                                                );
    }
Ejemplo n.º 5
0
    private void WarBegin(CMsgHeader aHeader)
    {
        //战斗开始,读取队伍信息,怒气槽等信息
        CMsgWarBegin aWarBegin = aHeader as CMsgWarBegin;

        foreach (AW.Battle.Monster aMonster in aWarBegin.attTeam.team)
        {
            BanBattleRole role = new BanBattleRole(aMonster.pveIndex, aMonster.num, BanTools.TransAttributeType(aMonster.myAttribute), aMonster.level, aMonster.curAtt, 0, BanBattleRole.Group.Attack, aMonster.curAtt, aMonster.AllFated);
            role.angSkObj = aMonster.aSkill;
            role.norSkObj = aMonster.nSkill;
            role.isBoss   = aMonster.isBoss;

            list_BattleRole.Add(role);
        }

        foreach (AW.Battle.Monster aMonster in aWarBegin.defTeam.team)
        {
            BanBattleRole role = new BanBattleRole(aMonster.pveIndex, aMonster.num, BanTools.TransAttributeType(aMonster.myAttribute), aMonster.level, 0, aMonster.curAtt, BanBattleRole.Group.Defense, aMonster.curAtt, aMonster.AllFated);
            role.angSkObj = aMonster.aSkill;
            role.norSkObj = aMonster.nSkill;
            role.isBoss   = aMonster.isBoss;

            list_BattleRole.Add(role);
        }

        //added by zq for atk and def icon
        attackSideInfo.IsAttack  = (0 == aWarBegin.attTeam.type);
        defenseSideInfo.IsAttack = !attackSideInfo.IsAttack;
        //end

        if (aWarBegin.attAoYi != null)
        {
            foreach (int aoyi in aWarBegin.attAoYi)
            {
                list_AttAoYi.Add(aoyi);
            }
        }

        if (aWarBegin.defAoYi != null)
        {
            foreach (int aoyi in aWarBegin.defAoYi)
            {
                list_DefAoYi.Add(aoyi);
            }
        }

        if (Core.Data.guideManger.isGuiding)
        {
            side = 0;
        }
        else
        {
            if (attackSideInfo.IsAttack)
            {
                side = 0;
            }
            else
            {
                side = 1;
            }
        }
    }
Ejemplo n.º 6
0
    BanBattleProcess.Item AddSkillItem(int skillType, int attackIndex, int defenseIndex, int attackBP, int defenseBP, int attackAP, int defenseAP, int extra_1, int extra_2, int extra_3, int skillId, int leftAp, CMsgHeader item = null)
    {
        BanBattleProcess.Item proItem = null;

        //判定是SkillID 还是AoYiID
        //非常恶心的判定
        if (isAoYiSkill(skillId))
        {
            AoYiData aoyiCfg = Core.Data.dragonManager.getAoYiData(skillId);

            int pos = getAoYiSkillPos(skillId, attackIndex == extra_1);

            proItem            = new BanBattleProcess.Item(0, 0, attackIndex, defenseIndex, attackBP, defenseBP, attackAP, defenseAP, BanBattleProcess.Period.DragonAoYi, extra_1, extra_2, extra_3, pos, leftAp, aoyiCfg.name, item);
            proItem.aoyiConfig = aoyiCfg;
            BanBattleProcess.Instance.list_Item.Add(proItem);

            return(proItem);
        }
        else
        {
            int sAction = GetSkillAction(extra_1, skillId);

            SkillData data      = Core.Data.skillManager.getSkillDataConfig(skillId);
            string    skillname = "";
            if (data != null)
            {
                skillname = data.name;
            }

            CSkill_Type cskType = CSkill_Type.Normal;
            if (System.Enum.IsDefined(typeof(CSkill_Type), skillType))
            {
                cskType = (CSkill_Type)skillType;
            }


            if (cskType == CSkill_Type.Anger)
            {
                proItem = new BanBattleProcess.Item(data.param.num, 0, attackIndex, defenseIndex, attackBP, defenseBP, attackAP, defenseAP, BanBattleProcess.Period.AngrySkill, extra_1, extra_2, extra_3, sAction, leftAp, skillname, item);
            }
            else if (cskType == CSkill_Type.Normal)
            {
                proItem = new BanBattleProcess.Item(0, 0, attackIndex, defenseIndex, attackBP, defenseBP, attackAP, defenseAP, BanBattleProcess.Period.NormalSkill, extra_1, extra_2, extra_3, sAction, leftAp, skillname, item);
            }
            else if (cskType == CSkill_Type.Die)
            {
                proItem = new BanBattleProcess.Item(0, 0, attackIndex, defenseIndex, attackBP, defenseBP, attackAP, defenseAP, BanBattleProcess.Period.DieSkill, extra_1, extra_2, extra_3, sAction, leftAp, skillname, item);
            }
            else if (cskType == CSkill_Type.AfterWar)
            {
                proItem = new BanBattleProcess.Item(0, 0, attackIndex, defenseIndex, attackBP, defenseBP, attackAP, defenseAP, BanBattleProcess.Period.AfterBattle, extra_1, extra_2, extra_3, sAction, leftAp, skillname, item);
            }

            if (proItem != null)
            {
                proItem.skillType = cskType;
                proItem.skillId   = skillId;
                BanBattleProcess.Instance.list_Item.Add(proItem);
            }
        }


        return(proItem);
    }