public bool IsChangeChar(E_CHAR_TRIBE eCharTribe)
    {
        if (this.m_lNeedMoney > NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_Money)
        {
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("89"), SYSTEM_MESSAGE_TYPE.IMPORTANT_MESSAGE);
            return(false);
        }
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return(false);
        }
        NkSoldierInfo leaderSoldierInfo = charPersonInfo.GetLeaderSoldierInfo();

        if (leaderSoldierInfo == null)
        {
            return(false);
        }
        int changeCharKindFormIndex = CharChangeMainDlg.GetChangeCharKindFormIndex(eCharTribe);

        if (changeCharKindFormIndex == leaderSoldierInfo.GetCharKind())
        {
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("212"), SYSTEM_MESSAGE_TYPE.IMPORTANT_MESSAGE);
            return(false);
        }
        if (leaderSoldierInfo.IsEquipItem())
        {
            CharChangeMainDlg.ShowMessageBoxEquipItem();
            return(false);
        }
        return(true);
    }
    public static void MessageBoxEquipItem(object a_oObject)
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        NkSoldierInfo leaderSoldierInfo = charPersonInfo.GetLeaderSoldierInfo();

        if (leaderSoldierInfo == null)
        {
            return;
        }
        Protocol_Item.Send_EquipSol_InvenEquip_All(leaderSoldierInfo);
    }
    public void ShowInfo()
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        NkSoldierInfo leaderSoldierInfo = charPersonInfo.GetLeaderSoldierInfo();

        if (leaderSoldierInfo == null)
        {
            return;
        }
        int num = (int)NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetCharSubData(eCHAR_SUBDATA.CHAR_SUBDATA_REINCARNATION_COUNT);

        int num2 = num + 1;
        ReincarnationInfo reincarnation = NrTSingleton <NrBaseTableManager> .Instance.GetReincarnation(num.ToString());

        if (reincarnation == null)
        {
            return;
        }
        ReincarnationInfo reincarnation2 = NrTSingleton <NrBaseTableManager> .Instance.GetReincarnation(num2.ToString());

        if (reincarnation2 == null)
        {
            return;
        }
        UIBaseInfoLoader solGradeImg = NrTSingleton <NrCharKindInfoManager> .Instance.GetSolGradeImg(leaderSoldierInfo.GetCharKind(), (int)leaderSoldierInfo.GetGrade());

        if (solGradeImg != null)
        {
            this.m_dtCurRank.Visible = true;
            this.m_dtCurRank.SetTexture(solGradeImg);
        }
        else
        {
            this.m_dtCurRank.Visible = false;
        }
        this.m_dtCurPortrait.SetTexture(eCharImageType.LARGE, leaderSoldierInfo.GetCharKind(), (int)leaderSoldierInfo.GetGrade(), string.Empty);
        int num3 = leaderSoldierInfo.GetSeason() + 1;

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref this.m_strText, new object[]
        {
            NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1208"),
            "count",
            num3.ToString()
        });

        this.m_lbCurSeason.SetText(this.m_strText);
        solGradeImg = NrTSingleton <NrCharKindInfoManager> .Instance.GetSolGradeImg(leaderSoldierInfo.GetCharKind(), 0);

        if (solGradeImg != null)
        {
            this.m_dtAfterRank.Visible = true;
            this.m_dtAfterRank.SetTexture(solGradeImg);
        }
        else
        {
            this.m_dtAfterRank.Visible = false;
        }
        int reincarnationCharKind = reincarnation2.GetReincarnationCharKind(reincarnation, leaderSoldierInfo.GetCharKind());

        this.m_dtAfterPortrait.SetTexture(eCharImageType.LARGE, reincarnationCharKind, 0, string.Empty);
        num3 = 2;
        NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(reincarnationCharKind);

        if (charKindInfo != null)
        {
            BASE_SOLGRADEINFO cHARKIND_SOLGRADEINFO = charKindInfo.GetCHARKIND_SOLGRADEINFO(0);
            if (cHARKIND_SOLGRADEINFO != null)
            {
                num3 = cHARKIND_SOLGRADEINFO.SolSeason + 1;
            }
        }
        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref this.m_strText, new object[]
        {
            NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1208"),
            "count",
            num3.ToString()
        });

        this.m_lbAfterSeason.SetText(this.m_strText);
        this.m_lNeedMoney = reincarnation2.lNeedMoney;
        this.m_lbNeedMoney.SetText(ANNUALIZED.Convert(reincarnation2.lNeedMoney));
        this.m_lbMyMoney.SetText(ANNUALIZED.Convert(NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_Money));
    }
Exemple #4
0
    public override void OnPrepareSceneChange()
    {
        Application.targetFrameRate = -1;
        NrTSingleton <NkCharManager> .Instance.DeleteBattleChar();

        NrLoadPageScreen.DecideLoadingType(Scene.CurScene, this.SceneType());
        NrLoadPageScreen.StepUpMain(1);
        NrLoadPageScreen.SetSkipMainStep(1);
        NrLoadPageScreen.ShowHideLoadingImg(true);
        this.m_SoldierBatch = new SoldierBatch();
        this.m_SoldierBatch.Init();
        this._bTemporalBattleUpdate = true;
        if (TsPlatform.IsLowSystemMemory)
        {
            TsSceneSwitcher.Instance.DeleteScene(TsSceneSwitcher.ESceneType.SoldierBatchScene);
        }
        NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

        if (@char != null)
        {
            @char.m_kCharMove.MoveStop(true, false);
        }
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (SoldierBatch.SOLDIER_BATCH_MODE == eSOLDIER_BATCH_MODE.MODE_PLUNDER)
        {
            GS_PLUNDER_MATCH_PLAYER_REQ gS_PLUNDER_MATCH_PLAYER_REQ = new GS_PLUNDER_MATCH_PLAYER_REQ();
            gS_PLUNDER_MATCH_PLAYER_REQ.m_PersonID = charPersonInfo.GetPersonID();
            gS_PLUNDER_MATCH_PLAYER_REQ.m_nMode    = 0;
            SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_PLUNDER_MATCH_PLAYER_REQ, gS_PLUNDER_MATCH_PLAYER_REQ);
        }
        if (SoldierBatch.SOLDIER_BATCH_MODE == eSOLDIER_BATCH_MODE.MODE_INFIBATTLE)
        {
            int value = COMMON_CONSTANT_Manager.GetInstance().GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_INFIBATTLE_LEVEL);
            if ((int)charPersonInfo.GetLeaderSoldierInfo().GetLevel() < value)
            {
                string empty = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("129"),
                    "level",
                    value
                });

                Main_UI_SystemMessage.ADDMessage(empty, SYSTEM_MESSAGE_TYPE.NAGATIVE_MESSAGE);
                return;
            }
            GS_INFIBATTLE_MATCH_REQ obj = new GS_INFIBATTLE_MATCH_REQ();
            SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_INFIBATTLE_MATCH_REQ, obj);
        }
        if (SoldierBatch.SOLDIER_BATCH_MODE == eSOLDIER_BATCH_MODE.MODE_PRACTICE_INFIBATTLE)
        {
            GS_INFIBATTLE_PRACTICE_START_REQ gS_INFIBATTLE_PRACTICE_START_REQ = new GS_INFIBATTLE_PRACTICE_START_REQ();
            gS_INFIBATTLE_PRACTICE_START_REQ.i64PersonID       = charPersonInfo.GetPersonID();
            gS_INFIBATTLE_PRACTICE_START_REQ.i64TargetPersonID = charPersonInfo.InfiBattlePersonID;
            gS_INFIBATTLE_PRACTICE_START_REQ.i32Rank           = charPersonInfo.InfiBattleRank;
            SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_INFIBATTLE_PRACTICE_START_REQ, gS_INFIBATTLE_PRACTICE_START_REQ);
        }
        GS_CHAR_STATE_SET_REQ gS_CHAR_STATE_SET_REQ = new GS_CHAR_STATE_SET_REQ();

        gS_CHAR_STATE_SET_REQ.nSet = 1;
        SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_CHAR_STATE_SET_REQ, gS_CHAR_STATE_SET_REQ);
        base.ResetCoTasks();
    }
Exemple #5
0
    private void SetStageList()
    {
        this.m_fScrollPos = this.m_nlbStage.scrollPos;
        this.m_fScrollPos = ((this.m_fScrollPos < 0f) ? 0f : this.m_fScrollPos);
        this.m_nlbStage.Clear();
        string empty = string.Empty;

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3424"),
            "count",
            (int)this.m_bSelectedFloor
        });

        this.m_lbTitle.SetText(empty);
        for (int i = 0; i < 2; i++)
        {
            string text = string.Empty;
            if (i == 0)
            {
                text = string.Format("Mobile/DLG/NewExploration/NLB_NewExploration_columndata{0}", NrTSingleton <UIDataManager> .Instance.AddFilePath);
            }
            else
            {
                text = string.Format("Mobile/DLG/NewExploration/NLB_NewExploration2_columndata{0}", NrTSingleton <UIDataManager> .Instance.AddFilePath);
            }
            this.m_nlbStage.SetColumnData(text);
            NewListItem newListItem = new NewListItem(this.m_nlbStage.ColumnNum, true, string.Empty);
            newListItem.m_szColumnData = text;
            newListItem.SetListItemData(0, string.Format("ui/NewExploration/NewExploration_{0}_{1}", (int)this.m_bSelectedFloor, i + 1), true, null, null);
            int num = 0;
            for (int j = 0; j < 5; j++)
            {
                int num2 = j * 9 + 1;
                int num3 = j + i * 5 + 1;
                newListItem.SetListItemData(num2, string.Empty, (sbyte)num3, new EZValueChangedDelegate(this.OnClickStageList), null);
                newListItem.SetListItemData(num2 + 3, string.Format("{0}-{1}", this.m_bSelectedFloor, num3), null, null, null);
                if (num3 != 10)
                {
                    NEWEXPLORATION_DATA data = NrTSingleton <NewExplorationManager> .Instance.GetData(this.m_bSelectedFloor, (sbyte)num3);

                    if (data != null)
                    {
                        NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(data.i32BossCharKind);

                        if (charKindInfo == null)
                        {
                            break;
                        }
                        CostumeDrawTextureInfo costumeDrawTextureInfo = new CostumeDrawTextureInfo();
                        costumeDrawTextureInfo.imageType = eCharImageType.SMALL;
                        costumeDrawTextureInfo.charKind  = charKindInfo.GetCharKind();
                        newListItem.SetListItemData(num2 + 4, costumeDrawTextureInfo, null, null, null);
                    }
                }
                else
                {
                    num2--;
                }
                bool visibe = NrTSingleton <NewExplorationManager> .Instance.IsClear(this.m_bSelectedFloor, (sbyte)num3);

                newListItem.SetListItemData(num2 + 5, visibe);
                newListItem.SetListItemData(num2 + 6, visibe);
                bool flag = (int)this.m_bSelectedFloor == (int)NrTSingleton <NewExplorationManager> .Instance.GetFloor() && (int)((sbyte)num3) == (int)NrTSingleton <NewExplorationManager> .Instance.GetSubFloor();

                newListItem.SetListItemData(num2 + 7, flag);
                newListItem.SetListItemData(num2 + 8, flag);
                if (flag)
                {
                    NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

                    if (charPersonInfo != null && charPersonInfo.GetLeaderSoldierInfo().IsValid())
                    {
                        NrCharKindInfo charKindInfo2 = charPersonInfo.GetLeaderSoldierInfo().GetCharKindInfo();
                        if (charKindInfo2 != null)
                        {
                            CostumeDrawTextureInfo costumeDrawTextureInfo2 = new CostumeDrawTextureInfo();
                            costumeDrawTextureInfo2.imageType = eCharImageType.SMALL;
                            costumeDrawTextureInfo2.charKind  = charKindInfo2.GetCharKind();
                            newListItem.SetListItemData(num2 + 8, costumeDrawTextureInfo2, null, null, null);
                        }
                    }
                }
                num = num2 + 8;
            }
            num++;
            int num4 = (i != 0) ? 3 : 2;
            for (int k = 0; k < num4; k++)
            {
                int num5 = (k + 1) * 2;
                if (i != 0)
                {
                    num5 += 4;
                }
                bool flag2 = NrTSingleton <NewExplorationManager> .Instance.IsOpenTreasureBox(this.m_bSelectedFloor, (sbyte)num5);

                newListItem.SetListItemData(num, !flag2);
                newListItem.SetListItemData(num, string.Empty, (sbyte)num5, new EZValueChangedDelegate(this.OnClickTreasureList), null);
                newListItem.SetListItemData(num + 1, flag2);
                newListItem.SetListItemData(num + 1, string.Empty, (sbyte)num5, new EZValueChangedDelegate(this.OnClickTreasureList), null);
                newListItem.SetListItemData(num + 4, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3425"), null, null, null);
                newListItem.SetListItemData(num + 5, NrTSingleton <NewExplorationManager> .Instance.CanGetTreasure(this.m_bSelectedFloor, (sbyte)num5));
                num += 6;
            }
            this.m_nlbStage.Add(newListItem);
        }
        this.m_nlbStage.RepositionItems();
        this.m_nlbStage.ScrollPosition = this.m_fScrollPos;
    }
    private void MakeSolListAndSort()
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        this.m_kSolList.Clear();
        this.m_kSolSortList.Clear();
        byte nSearch_SolPosType = this.m_nSearch_SolPosType;

        switch (nSearch_SolPosType)
        {
        case 0:
            this.MakeMilitarySolList();
            this.MakeReadySolList();
            goto IL_BD;

        case 1:
            this.MakeBattleSolList();
            goto IL_BD;

        case 2:
        case 6:
            this.MakeMilitarySolList((int)this.m_byMilityUnique);
            goto IL_BD;

        case 3:
        case 4:
        case 5:
IL_54:
            if (nSearch_SolPosType != 100)
            {
                goto IL_BD;
            }
            if (this.m_nSearch_SolSortType == 1)
            {
                this.MakeBattleSolList();
            }
            else
            {
                this.MakeBattleSolList();
                this.MakeMilitarySolList();
                this.MakeReadySolList();
            }
            goto IL_BD;
        }
        goto IL_54;
IL_BD:
        switch (this.m_nSearch_SolSortType)
        {
        case 1:
            this.m_kSolList.Sort(new Comparison <NkSoldierInfo>(this.ComparePosIndex));
            break;

        case 2:
            this.m_kSolList.Sort(new Comparison <NkSoldierInfo>(this.CompareName));
            break;

        case 3:
            this.m_kSolList.Sort(new Comparison <NkSoldierInfo>(this.CompareLevel));
            break;

        case 4:
            this.m_kSolList.Sort(new Comparison <NkSoldierInfo>(this.CompareCombatPower));
            break;

        case 5:
            this.m_kSolList.Sort(new Comparison <NkSoldierInfo>(this.ComparePosIndex));
            break;
        }
        if (this.m_nSearch_SolPosType == 100)
        {
            NkSoldierInfo leaderSoldierInfo = charPersonInfo.GetLeaderSoldierInfo();
            if (leaderSoldierInfo != null)
            {
                for (int i = 0; i < this.m_kSolList.Count; i++)
                {
                    if (leaderSoldierInfo.GetSolID() == this.m_kSolList[i].GetSolID())
                    {
                        this.m_kSolSortList.Add(this.m_kSolList[i]);
                        this.m_kSolList.Remove(this.m_kSolSortList[0]);
                        break;
                    }
                }
            }
        }
        for (int j = 0; j < this.m_kSolList.Count; j++)
        {
            this.m_kSolSortList.Add(this.m_kSolList[j]);
        }
    }
    private void ProcessOTPReady(eOTPRequestType eReqType)
    {
        if (this.szOTPAuthKey[(int)eReqType].Length > 0)
        {
            switch (eReqType)
            {
            case eOTPRequestType.OTPREQ_USERAUTH:
            {
                bool            flag       = false;
                NrWebViewObject gameObject = NrWebViewObject.GetGameObject();
                if (!gameObject.FirstNoticeOpen || gameObject.MainmenuNoticeOpen)
                {
                    flag = true;
                }
                if (flag)
                {
                    string     strCharName = string.Empty;
                    NrCharBase @char       = NrTSingleton <NkCharManager> .Instance.GetChar(1);

                    if (@char != null)
                    {
                        strCharName = @char.GetCharName();
                    }
                    NrMobileNoticeWeb nrMobileNoticeWeb = new NrMobileNoticeWeb();
                    nrMobileNoticeWeb.OnGameNotice(this.szOTPAuthKey[0], strCharName);
                }
                gameObject.FirstNoticeOpen    = true;
                gameObject.MainmenuNoticeOpen = false;
                break;
            }

            case eOTPRequestType.OTPREQ_CHARPORTRAIT:
            {
                NrCharBase char2 = NrTSingleton <NkCharManager> .Instance.GetChar(1);

                if (char2 != null)
                {
                    NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

                    NkSoldierInfo leaderSoldierInfo = charPersonInfo.GetLeaderSoldierInfo();
                    string        arg = string.Empty;
                    if (charPersonInfo != null && leaderSoldierInfo != null)
                    {
                        arg = this.GetProcessLeaderHero(leaderSoldierInfo.GetCharKind());
                    }
                    string url = string.Format("http://{0}/mobilephoto/user.aspx?otp={1}&type={2}", NrGlobalReference.strWebPageDomain, this.szOTPAuthKey[1], arg);
                    Application.OpenURL(url);
                }
                break;
            }

            case eOTPRequestType.OTPREQ_GUILDMARK:
                if (0L < NrTSingleton <NewGuildManager> .Instance.GetGuildID())
                {
                    string url2 = string.Format("http://{0}/mobilephoto/guild.aspx?otp={1}", NrGlobalReference.strWebPageDomain, this.szOTPAuthKey[2]);
                    Application.OpenURL(url2);
                }
                break;

            case eOTPRequestType.OTPREQ_EMAIL:
            {
                string            text = string.Format("http://{0}/member/member_confirm1.aspx?OTP={1}", NrGlobalReference.strWebPageDomain, this.szOTPAuthKey[3]);
                NrMobileNoticeWeb nrMobileNoticeWeb2 = new NrMobileNoticeWeb();
                nrMobileNoticeWeb2.OpenWebURL(text);
                TsLog.LogOnlyEditor("!!!!!!!!!!!!!!!! OTPREQ_EMAIL :{0}" + text);
                break;
            }

            case eOTPRequestType.OTPREQ_HP_AUTH:
            {
                string url3 = string.Format("http://{0}/mobileAuth/auth.aspx?otp={1}", NrGlobalReference.strWebPageDomain, this.szOTPAuthKey[4]);
                Application.OpenURL(url3);
                NrTSingleton <NrMainSystem> .Instance.QuitGame(false);

                break;
            }

            case eOTPRequestType.OTPREQ_GUESTID:
            {
                string url4 = string.Empty;
                if (TsPlatform.IsAndroid)
                {
                    url4 = string.Format("http://{0}/member/AuthPlatformSync_auth.aspx?OTP={1}&platform=android", NrGlobalReference.strWebPageDomain, this.szOTPAuthKey[5]);
                }
                else
                {
                    url4 = string.Format("http://{0}/member/AuthPlatformSync_auth.aspx?OTP={1}&platform=ios", NrGlobalReference.strWebPageDomain, this.szOTPAuthKey[5]);
                }
                NrMobileNoticeWeb nrMobileNoticeWeb3 = new NrMobileNoticeWeb();
                nrMobileNoticeWeb3.OpenWebURL(url4);
                break;
            }

            case eOTPRequestType.OTPREQ_HELPQUESTION:
            {
                NrMobileNoticeWeb nrMobileNoticeWeb4 = new NrMobileNoticeWeb();
                nrMobileNoticeWeb4.OnGameQuestion(this.szOTPAuthKey[6], string.Empty);
                break;
            }

            case eOTPRequestType.OTPREQ_UNREGISTER:
            {
                NrMobileNoticeWeb nrMobileNoticeWeb5 = new NrMobileNoticeWeb();
                nrMobileNoticeWeb5.OnGameUnregister(this.szOTPAuthKey[7]);
                break;
            }
            }
            this.szOTPAuthKey[(int)eReqType] = string.Empty;
        }
    }