示例#1
0
 public void AddInfo(NEWGUILD_MY_BOSS_ROOMINFO info)
 {
     if (this.m_GuildBoss_MyRoomInfo.ContainsKey(info.i16Floor))
     {
         this.m_GuildBoss_MyRoomInfo[info.i16Floor] = info;
     }
     else
     {
         this.m_GuildBoss_MyRoomInfo.Add(info.i16Floor, info);
     }
 }
    public void SetRoomStateEffect()
    {
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
        short        num         = NrTSingleton <BabelTowerManager> .Instance.GetLastGuildBossFloor();

        short guildBossLastFloor = NrTSingleton <ContentsLimitManager> .Instance.GetGuildBossLastFloor();

        if (0 < guildBossLastFloor && guildBossLastFloor < num)
        {
            num = guildBossLastFloor;
        }
        short num2 = num / 5;

        if (num % 5 != 0)
        {
            num2 += 1;
        }
        bool flag = true;

        for (int i = 0; i < (int)num2; i++)
        {
            IUIListObject item = this.m_lbFloor.GetItem(i);
            for (int j = 5; j > 0; j--)
            {
                if ((int)num >= ((int)num2 - i) * 5 - (5 - j))
                {
                    string effectKey = string.Empty;
                    NEWGUILD_MY_BOSS_ROOMINFO guildBossMyRoomInfo = kMyCharInfo.GetGuildBossMyRoomInfo(num);
                    if (guildBossMyRoomInfo != null)
                    {
                        effectKey = this.GetRoomStateEffect(guildBossMyRoomInfo.byRoomState);
                    }
                    else
                    {
                        effectKey = this.GetRoomStateEffect(0);
                    }
                    int      num3     = j - 1;
                    UIButton uIButton = ((UIListItemContainer)item).GetElement(num3 + 1) as UIButton;
                    if (uIButton != null)
                    {
                        NrTSingleton <FormsManager> .Instance.AttachEffectKey(effectKey, uIButton, uIButton.GetSize());
                    }
                    num -= 1;
                }
            }
            flag = !flag;
        }
    }
    public void BtClickFloor(IUIObject obj)
    {
        if (obj == null)
        {
            return;
        }
        NrMyCharInfo kMyCharInfo        = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
        short        num                = (short)obj.Data;
        short        guildBossLastFloor = NrTSingleton <ContentsLimitManager> .Instance.GetGuildBossLastFloor();

        if (0 < guildBossLastFloor && guildBossLastFloor < num)
        {
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("608"), SYSTEM_MESSAGE_TYPE.NAGATIVE_MESSAGE);
            return;
        }
        NEWGUILD_MY_BOSS_ROOMINFO guildBossMyRoomInfo = kMyCharInfo.GetGuildBossMyRoomInfo(num);

        if (guildBossMyRoomInfo == null)
        {
            BABEL_GUILDBOSS babelGuildBossinfo = NrTSingleton <BabelTowerManager> .Instance.GetBabelGuildBossinfo(num);

            if (babelGuildBossinfo == null)
            {
                return;
            }
            if (NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(babelGuildBossinfo.m_nBossKind) == null)
            {
                return;
            }
            BabelGuildBossDlg.OnBabelGuildBossOpen(num);
        }
        else if (guildBossMyRoomInfo.byRoomState == 1 || guildBossMyRoomInfo.byRoomState == 2 || guildBossMyRoomInfo.byRoomState == 3)
        {
            GS_NEWGUILD_BOSS_ROOMINFO_REQ gS_NEWGUILD_BOSS_ROOMINFO_REQ = new GS_NEWGUILD_BOSS_ROOMINFO_REQ();
            gS_NEWGUILD_BOSS_ROOMINFO_REQ.i16Floor    = num;
            gS_NEWGUILD_BOSS_ROOMINFO_REQ.byRoomState = guildBossMyRoomInfo.byRoomState;
            SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_NEWGUILD_BOSS_ROOMINFO_REQ, gS_NEWGUILD_BOSS_ROOMINFO_REQ);
        }
        TsAudioManager.Instance.AudioContainer.RequestAudioClip("UI_SFX", "CHAOSTOWER", "ENTER", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay));
    }
    private void OnCompleteGuildBossBatch(object a_oObject)
    {
        if (NrTSingleton <NkCharManager> .Instance.GetMyCharInfo() == null)
        {
            return;
        }
        if (NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1) == null)
        {
            return;
        }
        clTempBattlePos[] tempBattlePosInfo = SoldierBatch.SOLDIERBATCH.GetTempBattlePosInfo();
        SoldierBatch.SOLDIERBATCH.SaveGuildBossBatchSolInfo();
        GS_NEWGUILD_BOSS_STARTBATTLE_REQ gS_NEWGUILD_BOSS_STARTBATTLE_REQ = new GS_NEWGUILD_BOSS_STARTBATTLE_REQ();

        gS_NEWGUILD_BOSS_STARTBATTLE_REQ.i16Floor           = SoldierBatch.GUILDBOSS_INFO.m_i16Floor;
        gS_NEWGUILD_BOSS_STARTBATTLE_REQ.nCombinationUnique = NrTSingleton <SolCombination_BatchSelectInfoManager> .Instance.GetUserSelectedUniqeKey(0);

        int num = 0;

        for (int i = 0; i < 9; i++)
        {
            if (tempBattlePosInfo[i].m_nSolID > 0L)
            {
                gS_NEWGUILD_BOSS_STARTBATTLE_REQ.clSolBatchPosInfo[num].SolID = tempBattlePosInfo[i].m_nSolID;
                byte b          = 0;
                byte nBattlePos = 0;
                SoldierBatch.GetCalcBattlePos((long)tempBattlePosInfo[i].m_nBattlePos, ref b, ref nBattlePos);
                gS_NEWGUILD_BOSS_STARTBATTLE_REQ.clSolBatchPosInfo[num].nBattlePos = nBattlePos;
                num++;
            }
        }
        SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_NEWGUILD_BOSS_STARTBATTLE_REQ, gS_NEWGUILD_BOSS_STARTBATTLE_REQ);
        NEWGUILD_MY_BOSS_ROOMINFO guildBossMyRoomInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetGuildBossMyRoomInfo(SoldierBatch.GUILDBOSS_INFO.m_i16Floor);

        if (guildBossMyRoomInfo != null)
        {
            guildBossMyRoomInfo.ui8PlayState = 0;
        }
    }
    public void UpdateFloor(short floor)
    {
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
        short        num         = floor / 5;

        if (floor % 5 != 0)
        {
            num += 1;
        }
        short       num2        = (floor - 1) % 5;
        NewListItem newListItem = this.CreateItem(num);

        if (newListItem != null)
        {
            bool flag = this.GuildBossRewardCheck();
            if (flag)
            {
                this.m_dtNotice.Visible = true;
            }
            for (int i = 0; i < this.m_lbFloor.Count; i++)
            {
                IUIListObject item = this.m_lbFloor.GetItem(i);
                if (item != null && (short)item.Data == num)
                {
                    NEWGUILD_MY_BOSS_ROOMINFO guildBossMyRoomInfo = kMyCharInfo.GetGuildBossMyRoomInfo(floor);
                    bool        guildBossRoomStateInfo            = kMyCharInfo.GetGuildBossRoomStateInfo(floor);
                    DrawTexture drawTexture = ((UIListItemContainer)item).GetElement((int)(51 + num2)) as DrawTexture;
                    if (guildBossMyRoomInfo != null && guildBossMyRoomInfo.byRoomState != 0)
                    {
                        drawTexture.Visible = guildBossRoomStateInfo;
                        drawTexture.SetTexture("Win_I_Notice04");
                    }
                    UIButton    uIButton     = ((UIListItemContainer)item).GetElement((int)(num2 + 1)) as UIButton;
                    DrawTexture drawTexture2 = ((UIListItemContainer)item).GetElement((int)(56 + num2 * 2)) as DrawTexture;
                    if (drawTexture2 != null)
                    {
                        drawTexture2.Visible = false;
                    }
                    ItemTexture itemTexture = ((UIListItemContainer)item).GetElement((int)(56 + num2 * 2 + 1)) as ItemTexture;
                    if (itemTexture != null)
                    {
                        itemTexture.Visible = false;
                    }
                    if (guildBossMyRoomInfo != null)
                    {
                        if (guildBossMyRoomInfo.i64PlayPersonID > 0L)
                        {
                            if (drawTexture2 != null)
                            {
                                drawTexture2.Visible = true;
                            }
                            if (itemTexture != null)
                            {
                                itemTexture.Visible = true;
                            }
                            NewGuildMember memberInfoFromPersonID = NrTSingleton <NewGuildManager> .Instance.GetMemberInfoFromPersonID(guildBossMyRoomInfo.i64PlayPersonID);

                            if (memberInfoFromPersonID != null)
                            {
                                if (memberInfoFromPersonID.GetPortrait() != null)
                                {
                                    itemTexture.SetTexture(memberInfoFromPersonID.GetPortrait());
                                    itemTexture.AddValueChangedDelegate(new EZValueChangedDelegate(this.BtnClickMemberInfo));
                                    itemTexture.Data = guildBossMyRoomInfo.i64PlayPersonID;
                                }
                                else
                                {
                                    itemTexture.SetSolImageTexure(eCharImageType.SMALL, new NkListSolInfo
                                    {
                                        SolCharKind = memberInfoFromPersonID.GetFaceCharKind(),
                                        SolGrade    = -1,
                                        SolLevel    = memberInfoFromPersonID.GetLevel()
                                    }, false);
                                    itemTexture.AddValueChangedDelegate(new EZValueChangedDelegate(this.BtnClickMemberInfo));
                                    itemTexture.Data = guildBossMyRoomInfo.i64PlayPersonID;
                                }
                            }
                        }
                        string effectKey = string.Empty;
                        if (guildBossMyRoomInfo != null)
                        {
                            effectKey = this.GetRoomStateEffect(guildBossMyRoomInfo.byRoomState);
                        }
                        else
                        {
                            effectKey = this.GetRoomStateEffect(0);
                        }
                        if (uIButton != null)
                        {
                            uIButton.DeleteChildEffect();
                            NrTSingleton <FormsManager> .Instance.AttachEffectKey(effectKey, uIButton, uIButton.GetSize());
                        }
                    }
                    break;
                }
            }
        }
    }
    public NewListItem CreateItem(short Column)
    {
        NrMyCharInfo kMyCharInfo        = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
        string       text               = string.Empty;
        string       text2              = string.Empty;
        short        num                = Column * 5;
        bool         flag               = Column % 2 == 0;
        short        guildBossLastFloor = NrTSingleton <ContentsLimitManager> .Instance.GetGuildBossLastFloor();

        string columnData = string.Empty;

        if (flag)
        {
            columnData = string.Format("Mobile/DLG/GuildBoss/newlistbox_floor_columndata{0}", NrTSingleton <UIDataManager> .Instance.AddFilePath);
        }
        else
        {
            columnData = string.Format("Mobile/DLG/GuildBoss/newlistbox_floor1_columndata{0}", NrTSingleton <UIDataManager> .Instance.AddFilePath);
        }
        this.m_lbFloor.SetColumnData(columnData);
        NewListItem newListItem = new NewListItem(this.m_lbFloor.ColumnNum, true, string.Empty);

        if (!flag)
        {
            newListItem.SetListItemData(0, "UI/BabelTower/boss_main1", true, null, null);
        }
        else
        {
            newListItem.SetListItemData(0, "UI/BabelTower/boss_main2", true, null, null);
        }
        bool flag2 = this.GuildBossRewardCheck();

        if (flag2)
        {
            this.m_dtNotice.Visible = true;
        }
        for (int i = 4; i >= 0; i--)
        {
            newListItem.SetListItemData(i * 6 + 6, false);
            newListItem.SetListItemData(i * 6 + 6 + 2, false);
            newListItem.SetListItemData(i * 6 + 6 + 4, false);
            newListItem.SetListItemData(i * 6 + 7, false);
            newListItem.SetListItemData(i * 6 + 7 + 2, false);
            newListItem.SetListItemData(i * 6 + 7 + 4, false);
            newListItem.SetListItemData(i + 36, false);
            newListItem.SetListItemData(i + 41, false);
            newListItem.SetListItemData(i + 5 + 41, false);
            newListItem.SetListItemData(i + 1, false);
            newListItem.SetListItemData(51 + i, false);
            newListItem.SetListItemData(56 + i * 2, false);
            newListItem.SetListItemData(56 + i * 2 + 1, false);
            if (num <= guildBossLastFloor)
            {
                newListItem.SetListItemData(i + 1, true);
                if (num / 10 <= 0 && num % 10 > 0)
                {
                    text = "Win_Number_" + num;
                    newListItem.SetListItemData(i + 36, true);
                    newListItem.SetListItemData(i + 36, text, null, null, null);
                }
                else
                {
                    short num2 = num / 10;
                    short num3 = num % 10;
                    text  = "Win_Number_" + num2;
                    text2 = "Win_Number_" + num3;
                    newListItem.SetListItemData(i + 41, true);
                    newListItem.SetListItemData(i + 41, text, null, null, null);
                    newListItem.SetListItemData(i + 5 + 41, true);
                    newListItem.SetListItemData(i + 5 + 41, text2, null, null, null);
                }
                newListItem.SetListItemData(i + 1, string.Empty, num, new EZValueChangedDelegate(this.BtClickFloor), null);
                newListItem.SetListItemData(51 + i, false);
                newListItem.SetListItemData(51 + i, "Win_I_Notice04", null, null, null);
                NEWGUILD_MY_BOSS_ROOMINFO guildBossMyRoomInfo = kMyCharInfo.GetGuildBossMyRoomInfo(num);
                if (guildBossMyRoomInfo != null)
                {
                    if (this.m_SelectFloor < num)
                    {
                        this.m_Selectindex = Column;
                        this.m_SelectFloor = num;
                    }
                    if (guildBossMyRoomInfo.i64PlayPersonID > 0L)
                    {
                        newListItem.SetListItemData(56 + i * 2, true);
                        newListItem.SetListItemData(56 + i * 2 + 1, true);
                        NewGuildMember memberInfoFromPersonID = NrTSingleton <NewGuildManager> .Instance.GetMemberInfoFromPersonID(guildBossMyRoomInfo.i64PlayPersonID);

                        if (memberInfoFromPersonID != null)
                        {
                            if (memberInfoFromPersonID.GetPortrait() != null)
                            {
                                newListItem.SetListItemData(56 + i * 2 + 1, memberInfoFromPersonID.GetPortrait(), guildBossMyRoomInfo.i64PlayPersonID, null, new EZValueChangedDelegate(this.BtnClickMemberInfo), null);
                            }
                            else
                            {
                                NkListSolInfo nkListSolInfo = new NkListSolInfo();
                                nkListSolInfo.SolCharKind = memberInfoFromPersonID.GetFaceCharKind();
                                nkListSolInfo.SolGrade    = -1;
                                nkListSolInfo.SolLevel    = memberInfoFromPersonID.GetLevel();
                                newListItem.SetListItemData(56 + i * 2 + 1, nkListSolInfo, guildBossMyRoomInfo.i64PlayPersonID, new EZValueChangedDelegate(this.BtnClickMemberInfo), null);
                            }
                        }
                    }
                }
            }
            num -= 1;
        }
        flag             = !flag;
        newListItem.Data = Column;
        return(newListItem);
    }