Beispiel #1
0
 public void AddDailyDungeonInfo(DAILYDUNGEON_INFO info)
 {
     if (info == null)
     {
         return;
     }
     if (!this.m_kDailyDungeonInfo.ContainsKey(info.m_i32DayOfWeek))
     {
         this.m_kDailyDungeonInfo.Add(info.m_i32DayOfWeek, info);
     }
     else
     {
         foreach (int current in this.m_kDailyDungeonInfo.Keys)
         {
             if (this.m_kDailyDungeonInfo[current].m_i32DayOfWeek == info.m_i32DayOfWeek)
             {
                 this.m_kDailyDungeonInfo[current].m_i8Diff        = info.m_i8Diff;
                 this.m_kDailyDungeonInfo[current].m_i32IsClear    = info.m_i32IsClear;
                 this.m_kDailyDungeonInfo[current].m_i32ResetCount = info.m_i32ResetCount;
                 this.m_kDailyDungeonInfo[current].m_i8IsReward    = info.m_i8IsReward;
                 break;
             }
         }
     }
 }
    public bool IsGet_DailyDungeonReward()
    {
        bool  result    = false;
        sbyte dayOfWeek = NrTSingleton <DailyDungeonManager> .Instance.GetDayOfWeek();

        DAILYDUNGEON_INFO dailyDungeonInfo = NrTSingleton <DailyDungeonManager> .Instance.GetDailyDungeonInfo((int)dayOfWeek);

        if (dailyDungeonInfo != null)
        {
            sbyte b = dailyDungeonInfo.m_i8Diff;
            if ((int)b == 0)
            {
                b = 1;
            }
            if (EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(b, dayOfWeek) == null)
            {
                return(false);
            }
            if (dailyDungeonInfo.m_i32IsClear <= 1)
            {
                result = (dailyDungeonInfo.m_i32IsClear == 1);
                if ((int)dailyDungeonInfo.m_i8IsReward == 1)
                {
                    result = false;
                }
            }
        }
        else
        {
            result = false;
        }
        return(result);
    }
    public void OnClickChangeDifficulty(IUIObject obj)
    {
        if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo == null)
        {
            this.Close();
            return;
        }
        sbyte dayOfWeek = NrTSingleton <DailyDungeonManager> .Instance.GetDayOfWeek();

        DAILYDUNGEON_INFO dailyDungeonInfo = NrTSingleton <DailyDungeonManager> .Instance.GetDailyDungeonInfo((int)dayOfWeek);

        int num;

        if (dailyDungeonInfo == null)
        {
            num = 0;
        }
        else
        {
            num = dailyDungeonInfo.m_i32IsClear;
        }
        if (num >= 1)
        {
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("602"), SYSTEM_MESSAGE_TYPE.NAGATIVE_MESSAGE);
            return;
        }
        if (NrTSingleton <FormsManager> .Instance.GetForm(G_ID.DAILYDUNGEON_DIFFICULTY) == null)
        {
            NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.DAILYDUNGEON_DIFFICULTY);
        }
    }
    public bool SetBasicData()
    {
        if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo == null)
        {
            return(false);
        }
        sbyte dayOfWeek = NrTSingleton <DailyDungeonManager> .Instance.GetDayOfWeek();

        DAILYDUNGEON_INFO dailyDungeonInfo = NrTSingleton <DailyDungeonManager> .Instance.GetDailyDungeonInfo((int)dayOfWeek);

        if (dailyDungeonInfo == null)
        {
            return(false);
        }
        if ((int)this.m_nDifficult < 0)
        {
            this.m_nDifficult = dailyDungeonInfo.m_i8Diff;
        }
        if ((int)this.m_nDifficult == 0)
        {
            this.m_nDifficult = 1;
        }
        return(EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(this.m_nDifficult, dayOfWeek) != null && (dailyDungeonInfo.m_i32IsClear > 1 || (int)dailyDungeonInfo.m_i8IsReward == 0));
    }
Beispiel #5
0
    public void OnClickOk(IUIObject obj)
    {
        sbyte b = (sbyte)NrTSingleton <DailyDungeonManager> .Instance.GetCurrWeekofDay();

        DAILYDUNGEON_INFO dAILYDUNGEON_INFO = null;

        if ((int)b == 0 || (int)b == 6)
        {
            Dictionary <int, DAILYDUNGEON_INFO> totalDailyDungeonInfo = NrTSingleton <DailyDungeonManager> .Instance.GetTotalDailyDungeonInfo();

            if (totalDailyDungeonInfo == null)
            {
                this.Close();
            }
            foreach (DAILYDUNGEON_INFO current in totalDailyDungeonInfo.Values)
            {
                if (current.m_i32DayOfWeek != 0)
                {
                    if ((int)current.m_i8IsReward == 1)
                    {
                        dAILYDUNGEON_INFO = current;
                    }
                }
            }
        }
        else
        {
            dAILYDUNGEON_INFO = NrTSingleton <DailyDungeonManager> .Instance.GetDailyDungeonInfo((int)this.m_DayOfWeek);
        }
        if (dAILYDUNGEON_INFO == null)
        {
            return;
        }
        NrMyCharInfo myCharInfo = NrTSingleton <NkCharManager> .Instance.GetMyCharInfo();

        if (myCharInfo == null)
        {
            return;
        }
        long charSubData = myCharInfo.GetCharSubData(eCHAR_SUBDATA.CHAR_SUBDATA_VIP_EXP);
        byte levelExp    = NrTSingleton <NrTableVipManager> .Instance.GetLevelExp((long)((int)charSubData));

        byte dailyDungeonDcByVipLevel = NrTSingleton <NrTableVipManager> .Instance.GetDailyDungeonDcByVipLevel(levelExp);

        this.m_SoulGemsCount = NkUserInventory.GetInstance().Get_First_ItemCnt(70002);
        long num        = this.MaxResetCount();
        long resetCount = NrTSingleton <DailyDungeonManager> .Instance.GetResetCount();

        int  value = COMMON_CONSTANT_Manager.GetInstance().GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_DAILYDUNGEON_COST_PLUS);
        long num2  = (long)(value - (int)dailyDungeonDcByVipLevel);

        if (num <= resetCount)
        {
            Main_UI_SystemMessage.ADDMessage("�ʱ�ȭ Ƚ���� �̹� �ִ�ġ", SYSTEM_MESSAGE_TYPE.IMPORTANT_MESSAGE);
            return;
        }
        if (num2 >= (long)this.m_SoulGemsCount)
        {
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("910"), SYSTEM_MESSAGE_TYPE.IMPORTANT_MESSAGE);
            return;
        }
        GS_CHARACTER_DAILYDUNGEON_SET_REQ gS_CHARACTER_DAILYDUNGEON_SET_REQ = new GS_CHARACTER_DAILYDUNGEON_SET_REQ();

        gS_CHARACTER_DAILYDUNGEON_SET_REQ.i8Diff       = dAILYDUNGEON_INFO.m_i8Diff;
        gS_CHARACTER_DAILYDUNGEON_SET_REQ.i32DayOfWeek = dAILYDUNGEON_INFO.m_i32DayOfWeek;
        gS_CHARACTER_DAILYDUNGEON_SET_REQ.i8IsReset    = 1;
        SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_CHARACTER_DAILYDUNGEON_SET_REQ, gS_CHARACTER_DAILYDUNGEON_SET_REQ);
    }
    public void SetBasicData(sbyte nDayOfWeek, bool bCheck)
    {
        if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo == null)
        {
            this.Close();
            return;
        }
        DAILYDUNGEON_INFO dailyDungeonInfo = NrTSingleton <DailyDungeonManager> .Instance.GetDailyDungeonInfo((int)nDayOfWeek);

        EVENT_DAILY_DUNGEON_INFO dailyDungeonInfo2;

        if (dailyDungeonInfo != null)
        {
            this.m_nDayOfWeek = (sbyte)dailyDungeonInfo.m_i32DayOfWeek;
            if (!bCheck)
            {
                this.m_nDifficult = dailyDungeonInfo.m_i8Diff;
            }
            dailyDungeonInfo2 = EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(this.m_nDifficult, this.m_nDayOfWeek);
            if (dailyDungeonInfo2 == null)
            {
                this.Close();
                return;
            }
            if (dailyDungeonInfo.m_i32IsClear <= 1)
            {
                if (dailyDungeonInfo.m_i32IsClear != 1)
                {
                    this.m_btStart.Visible  = true;
                    this.m_btReward.Visible = false;
                    if (this.m_goGageEffect != null)
                    {
                        this.m_goGageEffect.SetActive(false);
                    }
                }
                else
                {
                    this.m_btStart.Visible  = false;
                    this.m_btReward.Visible = true;
                    if (this.m_goGageEffect != null)
                    {
                        this.m_goGageEffect.SetActive(true);
                    }
                }
                if ((int)dailyDungeonInfo.m_i8IsReward == 1)
                {
                    this.m_btStart.Visible            = false;
                    this.m_btReward.Visible           = false;
                    this.m_btHeroInfo.Visible         = false;
                    this.m_lbHeroInfo.Visible         = false;
                    this.m_dtRightBottomFrame.Visible = false;
                    if (this.m_goGageEffect != null)
                    {
                        this.m_goGageEffect.SetActive(true);
                    }
                    MyCharInfoDlg myCharInfoDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.MYCHARINFO_DLG) as MyCharInfoDlg;

                    if (myCharInfoDlg != null)
                    {
                        myCharInfoDlg.UpdateNoticeInfo();
                    }
                }
            }
        }
        else
        {
            this.m_nDayOfWeek = nDayOfWeek;
            if ((int)this.m_nDifficult <= 0 || !bCheck)
            {
                this.m_nDifficult = 1;
            }
            dailyDungeonInfo2 = EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(this.m_nDifficult, this.m_nDayOfWeek);
            if (dailyDungeonInfo2 == null)
            {
                this.Close();
                return;
            }
            this.m_btStart.Visible  = true;
            this.m_btReward.Visible = false;
            if (this.m_goGageEffect != null)
            {
                this.m_goGageEffect.SetActive(false);
            }
        }
        if (dailyDungeonInfo2 == null)
        {
            this.Close();
            return;
        }
        string textFromMap = NrTSingleton <NrTextMgr> .Instance.GetTextFromMap(dailyDungeonInfo2.i32TextKey.ToString());

        this.m_lbTitle.SetText(textFromMap);
        ITEM iTEM = new ITEM();

        iTEM.m_nItemUnique = dailyDungeonInfo2.i32RewardItemUnique;
        iTEM.m_nItemNum    = dailyDungeonInfo2.i32RewardItemNum;
        this.m_itRewardItem.SetItemTexture(iTEM);
        string empty = string.Empty;

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1697"),
            "itemname",
            NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(dailyDungeonInfo2.i32RewardItemUnique),
            "count",
            dailyDungeonInfo2.i32RewardItemNum.ToString()
        });

        this.m_lbRewardName.SetText(empty);
        this.m_dtDifficulty.SetTexture("Win_I_WorrGradeS" + this.m_nDifficult.ToString());
        this.m_lbMonsterInfo.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(dailyDungeonInfo2.i32ExplainText.ToString()));
        this.m_dtMonsterImage.SetTextureFromBundle("ui/soldier/512/" + dailyDungeonInfo2.szMonIMG);
    }
    public override void SetComponent()
    {
        this.m_lbTitle            = (base.GetControl("Title_Label") as Label);
        this.m_dtDifficulty       = (base.GetControl("DrawTexture_Difficulty") as DrawTexture);
        this.m_lbRewardName       = (base.GetControl("LB_RewardName") as Label);
        this.m_lbMonsterInfo      = (base.GetControl("LB_MonsterInfo") as Label);
        this.m_dtBG               = (base.GetControl("Main_BG") as DrawTexture);
        this.m_itRewardItem       = (base.GetControl("ItemTexture_reward") as ItemTexture);
        this.m_btChangeDifficulty = (base.GetControl("Button_Difficulty") as Button);
        Button expr_A0 = this.m_btChangeDifficulty;

        expr_A0.Click   = (EZValueChangedDelegate)Delegate.Combine(expr_A0.Click, new EZValueChangedDelegate(this.OnClickChangeDifficulty));
        this.m_btReward = (base.GetControl("Btn_GetReward") as Button);
        Button expr_DD = this.m_btReward;

        expr_DD.Click = (EZValueChangedDelegate)Delegate.Combine(expr_DD.Click, new EZValueChangedDelegate(this.OnRewardReq));
        this.m_btReward.AlphaAni(1f, 0.5f, -0.5f);
        this.m_btStart = (base.GetControl("Start_Btn") as Button);
        Button expr_134 = this.m_btStart;

        expr_134.Click = (EZValueChangedDelegate)Delegate.Combine(expr_134.Click, new EZValueChangedDelegate(this.OnClickStart));
        this.m_btExit  = (base.GetControl("Exit_Btn") as Button);
        Button expr_171 = this.m_btExit;

        expr_171.Click    = (EZValueChangedDelegate)Delegate.Combine(expr_171.Click, new EZValueChangedDelegate(this.OnClickClose));
        this.m_btHeroInfo = (base.GetControl("Button_HeroInfo") as Button);
        this.m_btHeroInfo.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickSoldierInfo));
        this.m_dtRightBottomFrame = (base.GetControl("DrawTexture_RightBottom") as DrawTexture);
        this.m_lbHeroInfo         = (base.GetControl("Label_HeroInfo") as Label);
        this.m_dtMonsterImage     = (base.GetControl("DT_MonsterFace") as DrawTexture);
        this.m_nDayOfWeek         = NrTSingleton <DailyDungeonManager> .Instance.GetDayOfWeek();

        DAILYDUNGEON_INFO dailyDungeonInfo = NrTSingleton <DailyDungeonManager> .Instance.GetDailyDungeonInfo((int)this.m_nDayOfWeek);

        if (dailyDungeonInfo == null)
        {
            this.m_nDifficult = 1;
        }
        else
        {
            this.m_nDifficult = dailyDungeonInfo.m_i8Diff;
        }
        this._SetDialogPos();
        this.SetBG();
        base.SetScreenCenter();
        sbyte dayOfWeek = NrTSingleton <DailyDungeonManager> .Instance.GetDayOfWeek();

        if ((int)dayOfWeek <= 0)
        {
            this.OnClose();
        }
        else
        {
            this.SetBasicData(dayOfWeek, false);
        }
        string  str     = string.Format("{0}", "effect/instant/fx_direct_daydungeon" + NrTSingleton <UIDataManager> .Instance.AddFilePath);
        WWWItem wWWItem = Holder.TryGetOrCreateBundle(str + Option.extAsset, NkBundleCallBack.UIBundleStackName);

        wWWItem.SetItemType(ItemType.USER_ASSETB);
        wWWItem.SetCallback(new PostProcPerItem(this.PlayAni), null);
        TsImmortal.bundleService.RequestDownloadCoroutine(wWWItem, DownGroup.RUNTIME, true);
    }