public bool IsEnableBattleUseActivityPoint(short nFloor, short nSubFloor, short nFloorType)
    {
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (kMyCharInfo == null)
        {
            return(false);
        }
        BABELTOWER_DATA babelTowerData = this.GetBabelTowerData(nFloor, nSubFloor, nFloorType);

        return(babelTowerData != null && kMyCharInfo.IsEnableBattleUseActivityPoint(babelTowerData.m_nWillSpend));
    }
    public void OnClickStart(IUIObject obj)
    {
        NrCharUser nrCharUser = NrTSingleton <NkCharManager> .Instance.GetChar(1) as NrCharUser;

        if (nrCharUser == null)
        {
            return;
        }
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (!kMyCharInfo.IsEnableBattleUseActivityPoint(1))
        {
            string textFromNotify = NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("488");

            Main_UI_SystemMessage.ADDMessage(textFromNotify, SYSTEM_MESSAGE_TYPE.IMPORTANT_MESSAGE);
            return;
        }
        if (nrCharUser.GetPersonInfoUser() == null)
        {
            return;
        }
        this.OnBattleOK(null);
    }
    private bool CheckBattlePos()
    {
        if (this.m_nSelectStage <= 0 || this.m_nSubFloor < 0)
        {
            string textFromNotify = NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("614");

            Main_UI_SystemMessage.ADDMessage(textFromNotify, SYSTEM_MESSAGE_TYPE.IMPORTANT_MESSAGE);
            return(false);
        }
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        NrMyCharInfo    kMyCharInfo    = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
        BABELTOWER_DATA babelTowerData = NrTSingleton <BabelTowerManager> .Instance.GetBabelTowerData(this.m_nSelectStage, this.m_nSubFloor, this.m_nFloorType);

        if (babelTowerData == null)
        {
            TsLog.LogError("BABELTOWER_DATA == NULL  FloorType ={0} Floor={1} SubFloor={2}", new object[]
            {
                this.m_nFloorType,
                this.m_nSelectStage,
                this.m_nSubFloor
            });
            return(false);
        }
        if (!kMyCharInfo.IsEnableBattleUseActivityPoint(babelTowerData.m_nWillSpend))
        {
            string textFromNotify2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("488");

            Main_UI_SystemMessage.ADDMessage(textFromNotify2, SYSTEM_MESSAGE_TYPE.IMPORTANT_MESSAGE);
            return(false);
        }
        this.m_nMyBatchSolNum = 0;
        byte b;

        if (this.m_BatchUserSol != null)
        {
            b = 0;
            while ((int)b < this.MYSOL_NUM_MAX)
            {
                this.m_BatchUserSol[(int)b].Init();
                b += 1;
            }
        }
        if (this.m_FriendBatch != null)
        {
            for (b = 0; b < 3; b += 1)
            {
                this.m_FriendBatch[(int)b].Init();
            }
        }
        for (b = 1; b <= 20; b += 1)
        {
            if (this.m_nMyBatchSolNum >= this.MYSOL_NUM_MAX)
            {
                break;
            }
            if (b >= 17)
            {
                string value = "0";
                PlayerPrefs.SetString(this.babel_solpos_string + b.ToString(), value);
            }
            else
            {
                string @string = PlayerPrefs.GetString(this.babel_solpos_string + b.ToString());
                if (@string != string.Empty)
                {
                    long          num = long.Parse(@string);
                    NkSoldierInfo soldierInfoFromSolID = charPersonInfo.GetSoldierInfoFromSolID(num);
                    byte          b2       = 0;
                    byte          nGridPos = 0;
                    SoldierBatch.GetCalcBattlePos((long)b, ref b2, ref nGridPos);
                    if (soldierInfoFromSolID != null)
                    {
                        if (soldierInfoFromSolID.GetSolPosType() == 1 || soldierInfoFromSolID.GetSolPosType() == 0 || soldierInfoFromSolID.GetSolPosType() == 2 || soldierInfoFromSolID.GetSolPosType() == 6)
                        {
                            this.m_BatchUserSol[this.m_nMyBatchSolNum].m_nSolID   = num;
                            this.m_BatchUserSol[this.m_nMyBatchSolNum].m_nGridPos = nGridPos;
                            this.m_BatchUserSol[this.m_nMyBatchSolNum].m_bInjury  = soldierInfoFromSolID.IsInjuryStatus();
                            this.m_nMyBatchSolNum++;
                        }
                    }
                }
            }
        }
        if (this.m_nMyBatchSolNum < this.MYSOL_NUM_MAX)
        {
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("610"), SYSTEM_MESSAGE_TYPE.NAGATIVE_MESSAGE);
            return(false);
        }
        List <byte> list = new List <byte>();

        for (b = 0; b < 16; b += 1)
        {
            list.Add(b);
        }
        b = 0;
        while ((int)b < this.m_nMyBatchSolNum)
        {
            list.Remove(this.m_BatchUserSol[(int)b].m_nGridPos);
            b += 1;
        }
        this.m_kFriendSolList.Clear();
        foreach (USER_FRIEND_INFO uSER_FRIEND_INFO in NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_kFriendInfo.GetFriendInfoValues())
        {
            if (uSER_FRIEND_INFO.FriendHelpSolInfo.i64HelpSolID > 0L)
            {
                if (uSER_FRIEND_INFO.ui8HelpUse < 1)
                {
                    this.m_kFriendSolList.Add(uSER_FRIEND_INFO);
                }
            }
        }
        this.m_kFriendSolList.Sort(new Comparison <USER_FRIEND_INFO>(this.CompareFriendSolLevel));
        int num2 = 0;

        for (int i = 0; i < this.m_kFriendSolList.Count; i++)
        {
            if (num2 >= 3)
            {
                break;
            }
            USER_FRIEND_INFO uSER_FRIEND_INFO2 = this.m_kFriendSolList[i];
            int  index = UnityEngine.Random.Range(0, list.Count);
            byte b3    = list[index];
            this.m_FriendBatch[num2].m_nPersonID = uSER_FRIEND_INFO2.nPersonID;
            this.m_FriendBatch[num2].m_nSolID    = uSER_FRIEND_INFO2.FriendHelpSolInfo.i64HelpSolID;
            this.m_FriendBatch[num2].m_nGridPos  = b3;
            this.m_FriendBatch[num2].m_bInjury   = false;
            list.Remove(b3);
            num2++;
        }
        if (NrTSingleton <NkClientLogic> .Instance.IsWorldScene() && NrTSingleton <FormsManager> .Instance.GetForm(G_ID.BABELTOWER_REPEAT_MAIN_DLG) == null)
        {
            NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.BABELTOWER_REPEAT_MAIN_DLG);
        }
        return(true);
    }