コード例 #1
0
    private bool checkMonster(int MonNum, int count, MonsterTeamInfo team, int capacity)
    {
        int totalCount = 0;

        for (int i = 0; i < _MonsterInfoList.Count; i++)
        {
            if (MonNum == _MonsterInfoList[i].num)
            {
                totalCount++;
            }
        }

        return(totalCount >= count);
    }
コード例 #2
0
    bool checkMyFate(FateData faDa, MonsterTeamInfo mTeam, int capacity)
    {
        bool check = true;

        if (faDa != null && mTeam != null)
        {
            int count = faDa.CountOfCondition;
            for (int i = 0; i < count; ++i)
            {
                int[] condition = faDa.MyFate(i);
                if (condition != null)
                {
                    ConfigDataType conData = (ConfigDataType)condition[FateData.Type_Pos];
                    int            ID      = condition[FateData.Item_ID_Pos];
                    int            amount  = condition[FateData.Item_Count_Pos];

                    switch (conData)
                    {
                    case ConfigDataType.HugeBeast:
                        check = false;
                        break;

                    case ConfigDataType.Gender:
                        check = false;
                        break;

                    case ConfigDataType.Monster:
                        check = checkMonster(ID, amount, mTeam, capacity) && check;
                        break;

                    case ConfigDataType.Star:
                        check = false;
                        break;

                    case ConfigDataType.Equip:
                        check = checkEquip(ID, amount, capacity) && check;
                        break;
                    }
                }
            }
        }

        return(check);
    }
コード例 #3
0
    public void SwapTeam(BaseHttpRequest request, BaseResponse response)
    {
        if (response != null && response.status != BaseResponse.ERROR)
        {
            SwapTeamResponse resp = response as SwapTeamResponse;

            HttpRequest   req   = request as HttpRequest;
            SwapTeamParam param = req.ParamMem as SwapTeamParam;

            if (resp.data)
            {
                Core.Data.playerManager.RTData.curTeamId = (short)param.teamid;

                //MonsterTeam team = RTData.curTeam;
                if (RTData.curTeam == null)
                {
                    MonsterTeamInfo teamInfo = new MonsterTeamInfo();
                    teamInfo.teamid = (short)param.teamid;
                    RTData.myTeams.Add(teamInfo.toMonsterTeam(14, Core.Data.monManager));
                }
            }
        }
    }
コード例 #4
0
    /// <summary>
    /// Fullfills the by network. 根据参数就是知道MonsterManager,equipManager 必须先初始化好
    /// </summary>
    /// <param name="response">Response.</param>
    /// <param name="monManager">Mon manager.</param>
    /// <param name="equipManager">Equip manager.</param>
    public void fullfillByNetwork(BaseResponse response, MonsterManager monManager, EquipManager equipManager)
    {
        if (response != null && response.status != BaseResponse.ERROR)
        {
            LoginResponse resp       = response as LoginResponse;
            PlayerInfo    playerInfo = resp.data.user;

            if (playerInfo != null)
            {
                RTData.ID = Convert.ToString(playerInfo.id);
                if (playerInfo.accountId != 0)
                {
                    RTData.uId = Convert.ToString(playerInfo.accountId);
                }
                RTData.curExp      = playerInfo.exp;
                RTData.nickName    = playerInfo.name;
                RTData.curLevel    = playerInfo.lv;
                RTData.curVipLevel = playerInfo.vip;
                RTData.curCoin     = playerInfo.coin;
                RTData.curStone    = playerInfo.stone;
                RTData.curJingLi   = playerInfo.jl;
                RTData.curTili     = playerInfo.tl;
                RTData.isFirstData = true;
                if (HttpRequestFactory._sessionId == "empty")
                {
                    HttpRequestFactory._sessionId = playerInfo.sessionId;
                }

                RTData.unixTimeForJingLi     = playerInfo.jldur;
                RTData.unixTimeForJingLiFull = playerInfo.jldurfull;
                RTData.unixTimeForTiLi       = playerInfo.tldur;
                RTData.unixTimeForTiLiFull   = playerInfo.tldurfull;

                RTData.systemTime = playerInfo.systime;
                RTData.createTime = playerInfo.createTime;
                RTData.shiled     = playerInfo.shiled;

                RTData.aislt  = playerInfo.aislt;
                RTData.headID = playerInfo.headID;
                RTData.happy  = playerInfo.happy;
                if (RTData.headID == 0)
                {
                    RTData.headID = PlayerInfo.DEFAULT_HEAD;
                }

                Core.TimerEng.OnLogin(RTData.systemTime);

                RTData.curRank = playerInfo.rank;

                RTData.curTeamId = (short)playerInfo.team;
                RTData.curGlory  = playerInfo.glory;

                RTData.curSuDiCount   = playerInfo.suDiCount;
                RTData.curFriendCount = playerInfo.friendCount;

                RTData.sevenAward = playerInfo.sevenAward;

                dayStatus = playerInfo.dayStatus;
            }

            //added by zhangqiang to check weither add a new team ;
            if (resp.data.monteam != null)
            {
                int teamLength = resp.data.monteam.Length;
                if (RTData.curTeamId > teamLength)
                {
                    List <MonsterTeamInfo> listTeamInfo = new List <MonsterTeamInfo>(resp.data.monteam);

                    for (int j = teamLength; j < RTData.curTeamId; j++)
                    {
                        MonsterTeamInfo team = new MonsterTeamInfo();
                        team.teamid = (short)(j + 1);
                        listTeamInfo.Add(team);
                    }

                    resp.data.monteam = listTeamInfo.ToArray();
                }

                setTeamList(resp.data.monteam, resp.data.equip, monManager, equipManager);
            }
            else if (RTData.myTeams.Count == 0)
            {
                List <MonsterTeamInfo> listTeamInfo = new List <MonsterTeamInfo> ();
                MonsterTeamInfo        team         = new MonsterTeamInfo();
                team.teamid = RTData.curTeamId;
                listTeamInfo.Add(team);
                setTeamList(listTeamInfo.ToArray(), resp.data.equip, monManager, equipManager);
            }

            if (Core.Data.temper.mPreLevel == -1)
            {
                Core.Data.temper.mPreLevel = RTData.curLevel;
                Core.Data.temper.mPreVipLv = RTData.curVipLevel;
            }
        }
    }
コード例 #5
0
    public void OnShow(GetNewFinalTrialRankCheckInfoResponse mresponse)
    {
        m_teamindex = 0;
        if (mGrid == null || mView == null)
        {
            FindGrid();
        }
        if (mresponse == null || mresponse.data == null)
        {
            return;
        }
        int index = 0;


        if (mresponse.data.detail != null)
        {
            _EquipInfo = mresponse.data.detail.eqip;
            if (mresponse.data.currTeam > 0)
            {
                foreach (MonsterTeamInfo monsterteaminfo in mresponse.data.detail.monteam)
                {
                    if (monsterteaminfo.teamid == mresponse.data.currTeam)
                    {
                        break;
                    }
                    m_teamindex++;
                }
            }
            for (int z = 0; z < mresponse.data.detail.monteam.Length; z++)
            {
                if (mresponse.data.detail.monteam[z].teamid == mresponse.data.currTeam)
                {
                    teaminfo = mresponse.data.detail.monteam[z];
                    Capacity = Core.Data.playerManager.GetUserLvlInfo(mresponse.data.lv).petSlot;
                }
            }
        }

        m_equipteamindex = -1;
        if (mresponse.data.detail != null && mresponse.data.detail.equip != null)
        {
            for (int i = 0; i < mresponse.data.detail.equip.Length; i++)
            {
                if (mresponse.data.detail.equip[i].id == mresponse.data.currTeam)
                {
                    m_equipteamindex = i;
                    mresponse.data.detail.equip[m_equipteamindex].HumanReadable();
                    break;
                }
            }
        }



        GameObject obj1 = PrefabLoader.loadFromPack("LS/pbLSRankRole") as GameObject;

        SortedDictionary <string, int> dic = new SortedDictionary <string, int>();

        foreach (string key in teaminfo.mon.Keys)
        {
            dic.Add(key, teaminfo.mon[key]);
        }

        teaminfoTemp        = new MonsterTeamInfo();
        teaminfoTemp.teamid = teaminfo.teamid;
        teaminfoTemp.mon    = new Dictionary <string, int>();
        foreach (string keys in dic.Keys)
        {
            for (int i = 0; i < mresponse.data.detail.monster.Length; i++)
            {
                int id = 0;
                if (dic.TryGetValue(keys, out id))
                {
                    if (mresponse.data.detail.monster[i].id == id)
                    {
                        _MonsterInfoList.Add(mresponse.data.detail.monster[i]);
                        teaminfoTemp.mon.Add(keys, mresponse.data.detail.monster[i].num);
                        if (obj1 != null)
                        {
                            GameObject go = NGUITools.AddChild(mGrid.gameObject, obj1);

                            //						go.gameObject.name = (1000 + i).ToString();
                            RankRoleIcon mm = go.gameObject.GetComponent <RankRoleIcon>();
                            DragonBallRankMgr.GetInstance().mRankRoleIcon.Add(mm);
                            mm.gameObject.SetActive(true);

                            Monster mon = mresponse.data.detail.monster[i].toMonster(Core.Data.monManager);

                            if (mresponse.data.detail.equip != null && m_equipteamindex >= 0)
                            {
                                mm.InitUI(mon, index, mresponse.data.detail.equip[m_equipteamindex].EquipIdList[index], mresponse.data.detail.monteam);
                            }
                            else
                            {
                                mm.InitUI(mon, index, new int[] {}, mresponse.data.detail.monteam);
                            }
                            break;
                        }
                    }
                }
            }
            index++;
        }

        _RankRoleIcon = DragonBallRankMgr.GetInstance().mRankRoleIcon[0];
        _RankRoleIcon.SetChoose(true);
        DragonBallRankMgr.GetInstance()._NowChooseIndex = 0;

        SetChoose();

        //自己组装monsterteam 用于打开缘界面做准备
        SetMonsterTeam();

        mGrid.Reposition();
        mView.ResetPosition();
    }