public Api_Result <List <User_QuestFmt> > QuestList() { if (Comm_UserDatas.Instance.User_quest.Count == 0) { Comm_UserDatas.Instance.InitQuest(this, mst_quest.Values.ToList()); } if (Comm_UserDatas.Instance.User_turn.ReqQuestReset) { QuestReset(); Comm_UserDatas.Instance.User_turn.DisableQuestReset(); } SetEnableList(); Api_Result <List <User_QuestFmt> > api_Result = new Api_Result <List <User_QuestFmt> >(); IEnumerable <Mem_quest> enumerable = from member in Comm_UserDatas.Instance.User_quest.Values orderby member.Rid where member.State != QuestState.END && member.State != QuestState.NOT_DISP select member; api_Result.data = new List <User_QuestFmt>(); int key = Comm_UserDatas.Instance.User_deck[1].Ship[0]; Mem_ship flagShip = Comm_UserDatas.Instance.User_ship[key]; foreach (Mem_quest item in enumerable) { Mst_quest mstObj = mst_quest[item.Rid]; User_QuestFmt user_QuestFmt = new User_QuestFmt(item, mstObj); slotModelChangeQuestNormalize(flagShip, item, mstObj, user_QuestFmt); api_Result.data.Add(user_QuestFmt); } return(api_Result); }
public Api_Result <List <User_QuestFmt> > QuestList() { if (Comm_UserDatas.Instance.User_quest.get_Count() == 0) { Comm_UserDatas.Instance.InitQuest(this, Enumerable.ToList <Mst_quest>(this.mst_quest.get_Values())); } if (Comm_UserDatas.Instance.User_turn.ReqQuestReset) { this.QuestReset(); Comm_UserDatas.Instance.User_turn.DisableQuestReset(); } this.SetEnableList(); Api_Result <List <User_QuestFmt> > api_Result = new Api_Result <List <User_QuestFmt> >(); IEnumerable <Mem_quest> enumerable = Enumerable.Where <Mem_quest>(Enumerable.OrderBy <Mem_quest, int>(Comm_UserDatas.Instance.User_quest.get_Values(), (Mem_quest member) => member.Rid), (Mem_quest member) => member.State != QuestState.END && member.State != QuestState.NOT_DISP); api_Result.data = new List <User_QuestFmt>(); int num = Comm_UserDatas.Instance.User_deck.get_Item(1).Ship[0]; Mem_ship flagShip = Comm_UserDatas.Instance.User_ship.get_Item(num); using (IEnumerator <Mem_quest> enumerator = enumerable.GetEnumerator()) { while (enumerator.MoveNext()) { Mem_quest current = enumerator.get_Current(); Mst_quest mstObj = this.mst_quest.get_Item(current.Rid); User_QuestFmt user_QuestFmt = new User_QuestFmt(current, mstObj); this.slotModelChangeQuestNormalize(flagShip, current, mstObj, user_QuestFmt); api_Result.data.Add(user_QuestFmt); } } return(api_Result); }
public Api_req_Quest() { IEnumerable <XElement> enumerable = Utils.Xml_Result(Mst_quest.tableName, Mst_quest.tableName, "Id"); foreach (XElement item6 in enumerable) { Mst_quest instance = null; Model_Base.SetMaster(out instance, item6); mst_quest.Add(instance.Id, instance); } IEnumerable <XElement> enumerable2 = Utils.Xml_Result("mst_quest_slotitemchange", "mst_quest_slotitemchange", "Id"); foreach (XElement item7 in enumerable2) { int key = int.Parse(item7.Element("Id").Value); int item = int.Parse(item7.Element("Old_slotitem_id").Value); int item2 = int.Parse(item7.Element("New_slotitem_id").Value); int item3 = int.Parse(item7.Element("Level_max").Value); int item4 = int.Parse(item7.Element("Use_crew").Value); mst_slotitemchange.Add(key, new List <int> { item, item2, item3, item4 }); } IEnumerable <XElement> enumerable3 = Utils.Xml_Result("mst_questcount_reset", "mst_questcount_reset", string.Empty); mst_quest_reset = new Dictionary <int, List <int> > { { 1, new List <int>() }, { 2, new List <int>() }, { 3, new List <int>() }, { 4, new List <int>() } }; foreach (XElement item8 in enumerable3) { int num = int.Parse(item8.Element("Type").Value); if (num != 0) { int item5 = int.Parse(item8.Element("Id").Value); mst_quest_reset[num].Add(item5); } } }
public Api_req_Quest() { IEnumerable <XElement> enumerable = Utils.Xml_Result(Mst_quest.tableName, Mst_quest.tableName, "Id"); using (IEnumerator <XElement> enumerator = enumerable.GetEnumerator()) { while (enumerator.MoveNext()) { XElement current = enumerator.get_Current(); Mst_quest mst_quest = null; Model_Base.SetMaster <Mst_quest>(out mst_quest, current); this.mst_quest.Add(mst_quest.Id, mst_quest); } } IEnumerable <XElement> enumerable2 = Utils.Xml_Result("mst_quest_slotitemchange", "mst_quest_slotitemchange", "Id"); using (IEnumerator <XElement> enumerator2 = enumerable2.GetEnumerator()) { while (enumerator2.MoveNext()) { XElement current2 = enumerator2.get_Current(); int num = int.Parse(current2.Element("Id").get_Value()); int num2 = int.Parse(current2.Element("Old_slotitem_id").get_Value()); int num3 = int.Parse(current2.Element("New_slotitem_id").get_Value()); int num4 = int.Parse(current2.Element("Level_max").get_Value()); int num5 = int.Parse(current2.Element("Use_crew").get_Value()); Dictionary <int, List <int> > arg_179_0 = this.mst_slotitemchange; int arg_179_1 = num; List <int> list = new List <int>(); list.Add(num2); list.Add(num3); list.Add(num4); list.Add(num5); arg_179_0.Add(arg_179_1, list); } } IEnumerable <XElement> enumerable3 = Utils.Xml_Result("mst_questcount_reset", "mst_questcount_reset", string.Empty); Dictionary <int, List <int> > dictionary = new Dictionary <int, List <int> >(); dictionary.Add(1, new List <int>()); dictionary.Add(2, new List <int>()); dictionary.Add(3, new List <int>()); dictionary.Add(4, new List <int>()); this.mst_quest_reset = dictionary; using (IEnumerator <XElement> enumerator3 = enumerable3.GetEnumerator()) { while (enumerator3.MoveNext()) { XElement current3 = enumerator3.get_Current(); int num6 = int.Parse(current3.Element("Type").get_Value()); if (num6 != 0) { int num7 = int.Parse(current3.Element("Id").get_Value()); this.mst_quest_reset.get_Item(num6).Add(num7); } } } }
private bool specialToriggerCheck(Mst_quest mst_record) { if (mst_record.Id == 423) { DifficultKind difficult = Comm_UserDatas.Instance.User_basic.Difficult; return((difficult == DifficultKind.KOU || difficult == DifficultKind.SHI) && this.isRequireShipLimit(mst_record.Get_1_id, 1)); } return(true); }
private void QuestReset() { List <int> reset_type = null; HashSet <int> reset_counter_type = null; setResetType(out reset_type, out reset_counter_type); foreach (Mst_quest value4 in mst_quest.Values) { if (value4.Type != 1) { Mem_quest value = null; if (Comm_UserDatas.Instance.User_quest.TryGetValue(value4.Id, out value) && value.State != 0 && reset_type.Contains(value4.Type)) { if (value4.Torigger == 0) { value.StateChange(this, QuestState.WAITING_START); } else { Mst_quest value2 = null; if (!mst_quest.TryGetValue(value4.Torigger, out value2)) { value.StateChange(this, QuestState.NOT_DISP); } else if (value2.Type != 1) { value.StateChange(this, QuestState.NOT_DISP); } else { value.StateChange(this, QuestState.WAITING_START); } } } } } foreach (int item in reset_counter_type) { List <int> list = mst_quest_reset[item]; foreach (int item2 in list) { Mem_questcount value3 = null; if (Comm_UserDatas.Instance.User_questcount.TryGetValue(item2, out value3)) { value3.Reset(deleteFlag: true); } } } }
public Api_req_Quest(Api_TurnOperator tInstance) { IEnumerable <XElement> enumerable = Utils.Xml_Result(Mst_quest.tableName, Mst_quest.tableName, "Id"); foreach (XElement item2 in enumerable) { Mst_quest instance = null; Model_Base.SetMaster(out instance, item2); mst_quest.Add(instance.Id, instance); } IEnumerable <XElement> enumerable2 = Utils.Xml_Result("mst_questcount_reset", "mst_questcount_reset", string.Empty); mst_quest_reset = new Dictionary <int, List <int> > { { 1, new List <int>() }, { 2, new List <int>() }, { 3, new List <int>() }, { 4, new List <int>() } }; foreach (XElement item3 in enumerable2) { int num = int.Parse(item3.Element("Type").Value); if (num != 0) { int item = int.Parse(item3.Element("Id").Value); mst_quest_reset[num].Add(item); } } }
public User_QuestFmt(Mem_quest memObj, Mst_quest mstObj) : this() { this.No = memObj.Rid; this.Category = mstObj.Category; this.State = memObj.State; this.Title = mstObj.Name; this.Detail = mstObj.Details; this.Type = mstObj.Type; this.GetMaterial = mstObj.GetMaterialValues(); this.GetSpoint = mstObj.GetSpointNum(); this.Progress = this.setProgress(); if (mstObj.Get_1_type > 0) { this.RewardTypes.Add((QuestItemGetKind)mstObj.Get_1_type); this.RewardCount.Add(mstObj.Get_1_count); } if (mstObj.Get_2_type > 0) { this.RewardTypes.Add((QuestItemGetKind)mstObj.Get_2_type); this.RewardCount.Add(mstObj.Get_2_count); } }
public Api_req_Quest(Api_TurnOperator tInstance) { IEnumerable <XElement> enumerable = Utils.Xml_Result(Mst_quest.tableName, Mst_quest.tableName, "Id"); using (IEnumerator <XElement> enumerator = enumerable.GetEnumerator()) { while (enumerator.MoveNext()) { XElement current = enumerator.get_Current(); Mst_quest mst_quest = null; Model_Base.SetMaster <Mst_quest>(out mst_quest, current); this.mst_quest.Add(mst_quest.Id, mst_quest); } } IEnumerable <XElement> enumerable2 = Utils.Xml_Result("mst_questcount_reset", "mst_questcount_reset", string.Empty); Dictionary <int, List <int> > dictionary = new Dictionary <int, List <int> >(); dictionary.Add(1, new List <int>()); dictionary.Add(2, new List <int>()); dictionary.Add(3, new List <int>()); dictionary.Add(4, new List <int>()); this.mst_quest_reset = dictionary; using (IEnumerator <XElement> enumerator2 = enumerable2.GetEnumerator()) { while (enumerator2.MoveNext()) { XElement current2 = enumerator2.get_Current(); int num = int.Parse(current2.Element("Type").get_Value()); if (num != 0) { int num2 = int.Parse(current2.Element("Id").get_Value()); this.mst_quest_reset.get_Item(num).Add(num2); } } } }
private void slotModelChangeQuestNormalize(Mem_ship flagShip, Mem_quest mem_quest, Mst_quest mst_quest, User_QuestFmt changeFmt) { HashSet <int> hashSet = new HashSet <int>(); if (mem_quest.State == QuestState.COMPLETE) { if (mst_quest.Get_1_type == 15) { hashSet.Add(mst_quest.Get_1_id); } if (mst_quest.Get_2_type == 15) { hashSet.Add(mst_quest.Get_2_id); } } if (hashSet.Count == 0) { return; } Mst_questcount value = null; Mst_DataManager.Instance.Mst_questcount.TryGetValue(mem_quest.Rid, out value); HashSet <int> hashSet2 = new HashSet <int>(); bool flag = false; foreach (int item2 in hashSet) { int mst_id = mst_slotitemchange[item2][0]; bool maxFlag = mst_quest.IsLevelMax(mst_slotitemchange[item2]); if (mst_quest.IsUseCrew(mst_slotitemchange[item2])) { flag = true; } int item = findModelChangeEnableSlotPos(flagShip.Slot, mst_id, maxFlag); hashSet2.Add(item); } if (flag) { int num = 0; Mem_useitem value2 = null; if (Comm_UserDatas.Instance.User_useItem.TryGetValue(70, out value2)) { num = value2.Value; } if (num == 0) { hashSet2.Add(-1); } } List <string> requireShip = QuestKousyou.GetRequireShip(mem_quest.Rid); if (requireShip.Count > 0) { string yomi = Mst_DataManager.Instance.Mst_ship[flagShip.Ship_id].Yomi; if (!requireShip.Any((string x) => x.Equals(yomi))) { hashSet2.Add(-1); } } if (hashSet2.Contains(-1)) { mem_quest.StateChange(this, QuestState.WAITING_START); changeFmt.State = mem_quest.State; if (value != null) { foreach (int item3 in value.Counter_id) { Mem_questcount value3 = null; if (Comm_UserDatas.Instance.User_questcount.TryGetValue(item3, out value3)) { value3.Reset(deleteFlag: false); } } } } else if (hashSet2.Contains(-2)) { changeFmt.InvalidFlag = true; } }
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)); }
private void slotModelChangeQuestNormalize(Mem_ship flagShip, Mem_quest mem_quest, Mst_quest mst_quest, User_QuestFmt changeFmt) { HashSet <int> hashSet = new HashSet <int>(); if (mem_quest.State == QuestState.COMPLETE) { if (mst_quest.Get_1_type == 15) { hashSet.Add(mst_quest.Get_1_id); } if (mst_quest.Get_2_type == 15) { hashSet.Add(mst_quest.Get_2_id); } } if (hashSet.get_Count() == 0) { return; } Mst_questcount mst_questcount = null; Mst_DataManager.Instance.Mst_questcount.TryGetValue(mem_quest.Rid, ref mst_questcount); HashSet <int> hashSet2 = new HashSet <int>(); bool flag = false; using (HashSet <int> .Enumerator enumerator = hashSet.GetEnumerator()) { while (enumerator.MoveNext()) { int current = enumerator.get_Current(); int mst_id = this.mst_slotitemchange.get_Item(current).get_Item(0); bool maxFlag = mst_quest.IsLevelMax(this.mst_slotitemchange.get_Item(current)); if (mst_quest.IsUseCrew(this.mst_slotitemchange.get_Item(current))) { flag = true; } int num = this.findModelChangeEnableSlotPos(flagShip.Slot, mst_id, maxFlag); hashSet2.Add(num); } } if (flag) { int num2 = 0; Mem_useitem mem_useitem = null; if (Comm_UserDatas.Instance.User_useItem.TryGetValue(70, ref mem_useitem)) { num2 = mem_useitem.Value; } if (num2 == 0) { hashSet2.Add(-1); } } List <string> requireShip = QuestKousyou.GetRequireShip(mem_quest.Rid); if (requireShip.get_Count() > 0) { string yomi = Mst_DataManager.Instance.Mst_ship.get_Item(flagShip.Ship_id).Yomi; if (!Enumerable.Any <string>(requireShip, (string x) => x.Equals(yomi))) { hashSet2.Add(-1); } } if (hashSet2.Contains(-1)) { mem_quest.StateChange(this, QuestState.WAITING_START); changeFmt.State = mem_quest.State; if (mst_questcount == null) { return; } using (HashSet <int> .Enumerator enumerator2 = mst_questcount.Counter_id.GetEnumerator()) { while (enumerator2.MoveNext()) { int current2 = enumerator2.get_Current(); Mem_questcount mem_questcount = null; if (Comm_UserDatas.Instance.User_questcount.TryGetValue(current2, ref mem_questcount)) { mem_questcount.Reset(false); } } } } else if (hashSet2.Contains(-2)) { changeFmt.InvalidFlag = true; } }
private void QuestReset() { List <int> list = null; HashSet <int> hashSet = null; this.setResetType(out list, out hashSet); using (Dictionary <int, Mst_quest> .ValueCollection.Enumerator enumerator = this.mst_quest.get_Values().GetEnumerator()) { while (enumerator.MoveNext()) { Mst_quest current = enumerator.get_Current(); if (current.Type != 1) { Mem_quest mem_quest = null; if (Comm_UserDatas.Instance.User_quest.TryGetValue(current.Id, ref mem_quest)) { if (mem_quest.State != QuestState.NOT_DISP && list.Contains(current.Type)) { if (current.Torigger == 0) { mem_quest.StateChange(this, QuestState.WAITING_START); } else { Mst_quest mst_quest = null; if (!this.mst_quest.TryGetValue(current.Torigger, ref mst_quest)) { mem_quest.StateChange(this, QuestState.NOT_DISP); } else if (mst_quest.Type != 1) { mem_quest.StateChange(this, QuestState.NOT_DISP); } else { mem_quest.StateChange(this, QuestState.WAITING_START); } } } } } } } using (HashSet <int> .Enumerator enumerator2 = hashSet.GetEnumerator()) { while (enumerator2.MoveNext()) { int current2 = enumerator2.get_Current(); List <int> list2 = this.mst_quest_reset.get_Item(current2); using (List <int> .Enumerator enumerator3 = list2.GetEnumerator()) { while (enumerator3.MoveNext()) { int current3 = enumerator3.get_Current(); Mem_questcount mem_questcount = null; if (Comm_UserDatas.Instance.User_questcount.TryGetValue(current3, ref mem_questcount)) { mem_questcount.Reset(true); } } } } } }
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); }