コード例 #1
0
        public List <QuestItemGetFmt> ClearItemGet(User_QuestFmt fmt)
        {
            Mem_quest value = null;

            if (!Comm_UserDatas.Instance.User_quest.TryGetValue(fmt.No, out value))
            {
                return(null);
            }
            if (value.State != QuestState.COMPLETE)
            {
                return(null);
            }
            value.StateChange(this, QuestState.END);
            Mst_questcount value2 = null;

            if (Mst_DataManager.Instance.Mst_questcount.TryGetValue(value.Rid, out value2))
            {
                foreach (KeyValuePair <int, bool> item in value2.Reset_flag)
                {
                    if (item.Value)
                    {
                        Mem_questcount value3 = null;
                        if (Comm_UserDatas.Instance.User_questcount.TryGetValue(item.Key, out value3))
                        {
                            value3.Reset(deleteFlag: true);
                        }
                    }
                }
            }
            Mst_quest mst_quest         = this.mst_quest[fmt.No];
            List <QuestItemGetFmt> list = new List <QuestItemGetFmt>();

            foreach (KeyValuePair <enumMaterialCategory, int> item2 in fmt.GetMaterial)
            {
                if (item2.Key <= enumMaterialCategory.Bauxite)
                {
                    list.Add(_ItemGet(item2.Key, item2.Value));
                }
            }
            int  slotModelChangeId  = mst_quest.GetSlotModelChangeId(1);
            int  slotModelChangeId2 = mst_quest.GetSlotModelChangeId(2);
            bool useCrewFlag        = false;
            bool maxExpFlag         = false;

            if (slotModelChangeId > 0)
            {
                maxExpFlag  = mst_quest.IsLevelMax(mst_slotitemchange[slotModelChangeId]);
                useCrewFlag = mst_quest.IsUseCrew(mst_slotitemchange[slotModelChangeId]);
            }
            list.Add(_ItemGet(mst_quest.Get_1_type, mst_quest.Get_1_id, mst_quest.Get_1_count, maxExpFlag, useCrewFlag));
            bool useCrewFlag2 = false;
            bool maxExpFlag2  = false;

            if (slotModelChangeId2 > 0)
            {
                maxExpFlag2  = mst_quest.IsLevelMax(mst_slotitemchange[slotModelChangeId2]);
                useCrewFlag2 = mst_quest.IsUseCrew(mst_slotitemchange[slotModelChangeId2]);
            }
            list.Add(_ItemGet(mst_quest.Get_2_type, mst_quest.Get_2_id, mst_quest.Get_2_count, maxExpFlag2, useCrewFlag2));
            return(list.FindAll((QuestItemGetFmt item) => item != null));
        }
コード例 #2
0
        public List <QuestItemGetFmt> ClearItemGet(User_QuestFmt fmt)
        {
            Mem_quest mem_quest = null;

            if (!Comm_UserDatas.Instance.User_quest.TryGetValue(fmt.No, ref mem_quest))
            {
                return(null);
            }
            if (mem_quest.State != QuestState.COMPLETE)
            {
                return(null);
            }
            mem_quest.StateChange(this, QuestState.END);
            Mst_questcount mst_questcount = null;

            if (Mst_DataManager.Instance.Mst_questcount.TryGetValue(mem_quest.Rid, ref mst_questcount))
            {
                using (Dictionary <int, bool> .Enumerator enumerator = mst_questcount.Reset_flag.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        KeyValuePair <int, bool> current = enumerator.get_Current();
                        if (current.get_Value())
                        {
                            Mem_questcount mem_questcount = null;
                            if (Comm_UserDatas.Instance.User_questcount.TryGetValue(current.get_Key(), ref mem_questcount))
                            {
                                mem_questcount.Reset(true);
                            }
                        }
                    }
                }
            }
            Mst_quest mst_quest         = this.mst_quest.get_Item(fmt.No);
            List <QuestItemGetFmt> list = new List <QuestItemGetFmt>();

            using (Dictionary <enumMaterialCategory, int> .Enumerator enumerator2 = fmt.GetMaterial.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    KeyValuePair <enumMaterialCategory, int> current2 = enumerator2.get_Current();
                    if (current2.get_Key() <= enumMaterialCategory.Bauxite)
                    {
                        list.Add(this._ItemGet(current2.get_Key(), current2.get_Value()));
                    }
                }
            }
            int  slotModelChangeId  = mst_quest.GetSlotModelChangeId(1);
            int  slotModelChangeId2 = mst_quest.GetSlotModelChangeId(2);
            bool useCrewFlag        = false;
            bool maxExpFlag         = false;

            if (slotModelChangeId > 0)
            {
                maxExpFlag  = mst_quest.IsLevelMax(this.mst_slotitemchange.get_Item(slotModelChangeId));
                useCrewFlag = mst_quest.IsUseCrew(this.mst_slotitemchange.get_Item(slotModelChangeId));
            }
            list.Add(this._ItemGet(mst_quest.Get_1_type, mst_quest.Get_1_id, mst_quest.Get_1_count, maxExpFlag, useCrewFlag));
            bool useCrewFlag2 = false;
            bool maxExpFlag2  = false;

            if (slotModelChangeId2 > 0)
            {
                maxExpFlag2  = mst_quest.IsLevelMax(this.mst_slotitemchange.get_Item(slotModelChangeId2));
                useCrewFlag2 = mst_quest.IsUseCrew(this.mst_slotitemchange.get_Item(slotModelChangeId2));
            }
            list.Add(this._ItemGet(mst_quest.Get_2_type, mst_quest.Get_2_id, mst_quest.Get_2_count, maxExpFlag2, useCrewFlag2));
            list = list.FindAll((QuestItemGetFmt item) => item != null);
            return(list);
        }