예제 #1
0
        public bool Check_28(Mem_quest targetQuest)
        {
            if (type != KousyouKind.DestroyItem)
            {
                return(false);
            }
            Dictionary <int, int> dictionary = isAddCounter(targetQuest.Rid, checkData);
            Mem_ship flagShip = getFlagShip(1);
            Dictionary <int, List <int> > slotIndexFromId = flagShip.GetSlotIndexFromId(new HashSet <int>
            {
                79
            });

            if (slotIndexFromId[79].Count == 0)
            {
                return(false);
            }
            bool flag = false;

            foreach (int item in slotIndexFromId[79])
            {
                if (Comm_UserDatas.Instance.User_slot[flagShip.Slot[item]].IsMaxSkillLevel())
                {
                    flag = true;
                }
            }
            if (!flag)
            {
                return(false);
            }
            int num  = 0;
            int num2 = 0;

            foreach (Mst_slotitem destroyItem in destroyItems)
            {
                if (destroyItem.Id == 80)
                {
                    num++;
                }
                if (destroyItem.Id == 26)
                {
                    num2++;
                }
            }
            if (dictionary.ContainsKey(6811))
            {
                dictionary[6811] = num;
            }
            if (dictionary.ContainsKey(6812))
            {
                dictionary[6812] = num2;
            }
            addCounter(dictionary);
            return(CheckClearCounter(targetQuest.Rid));
        }
예제 #2
0
        public bool Check_21(Mem_quest targetQuest)
        {
            if (this.type != QuestKousyou.KousyouKind.DestroyItem)
            {
                return(false);
            }
            Dictionary <int, int> counter = base.isAddCounter(targetQuest.Rid, this.checkData);
            Mem_ship      flagShip        = this.getFlagShip(1);
            Mem_ship      arg_3D_0        = flagShip;
            HashSet <int> hashSet         = new HashSet <int>();

            hashSet.Add(23);
            Dictionary <int, List <int> > slotIndexFromId = arg_3D_0.GetSlotIndexFromId(hashSet);

            if (slotIndexFromId.get_Item(23).get_Count() == 0)
            {
                return(false);
            }
            bool flag = false;

            using (List <int> .Enumerator enumerator = slotIndexFromId.get_Item(23).GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    int current = enumerator.get_Current();
                    if (Comm_UserDatas.Instance.User_slot.get_Item(flagShip.Slot.get_Item(current)).IsMaxSkillLevel())
                    {
                        flag = true;
                    }
                }
            }
            if (!flag)
            {
                return(false);
            }
            int num = Enumerable.Count <Mst_slotitem>(this.destroyItems, (Mst_slotitem x) => x.Id == 23);

            for (int i = 0; i < num; i++)
            {
                base.addCounterIncrementAll(counter);
            }
            return(base.CheckClearCounter(targetQuest.Rid));
        }
예제 #3
0
        public bool Check_21(Mem_quest targetQuest)
        {
            if (type != KousyouKind.DestroyItem)
            {
                return(false);
            }
            Dictionary <int, int> counter = isAddCounter(targetQuest.Rid, checkData);
            Mem_ship flagShip             = getFlagShip(1);
            Dictionary <int, List <int> > slotIndexFromId = flagShip.GetSlotIndexFromId(new HashSet <int>
            {
                23
            });

            if (slotIndexFromId[23].Count == 0)
            {
                return(false);
            }
            bool flag = false;

            foreach (int item in slotIndexFromId[23])
            {
                if (Comm_UserDatas.Instance.User_slot[flagShip.Slot[item]].IsMaxSkillLevel())
                {
                    flag = true;
                }
            }
            if (!flag)
            {
                return(false);
            }
            int num = destroyItems.Count((Mst_slotitem x) => x.Id == 23);

            for (int i = 0; i < num; i++)
            {
                addCounterIncrementAll(counter);
            }
            return(CheckClearCounter(targetQuest.Rid));
        }
        private bool getCombatRationResult(out Dictionary <int, List <Mst_slotitem> > useShipInfo, out List <int> givenShips)
        {
            int mapBattleCellPassCount = this.mapInstance.MapBattleCellPassCount;

            useShipInfo = null;
            givenShips  = null;
            if (mapBattleCellPassCount < 2)
            {
                return(false);
            }
            Dictionary <int, List <Mst_slotitem> > dictionary = new Dictionary <int, List <Mst_slotitem> >();
            List <int>    list    = new List <int>();
            HashSet <int> hashSet = new HashSet <int>();

            hashSet.Add(145);
            hashSet.Add(150);
            HashSet <int> searchIds = hashSet;
            Dictionary <int, List <int> > dictionary2 = new Dictionary <int, List <int> >();
            Dictionary <int, int>         dictionary3 = Enumerable.ToDictionary <int, int, int>(this.userSubInfo.get_Keys(), (int key) => key, (int value) => 0);

            for (int i = 0; i < this.userData.ShipData.get_Count(); i++)
            {
                Mem_ship mem_ship = this.userData.ShipData.get_Item(i);
                if (mem_ship.IsFight())
                {
                    Dictionary <int, List <int> > slotIndexFromId = mem_ship.GetSlotIndexFromId(searchIds);
                    if (slotIndexFromId.get_Item(145).get_Count() != 0 || slotIndexFromId.get_Item(150).get_Count() != 0)
                    {
                        if (this.isRationLotteryWinning(mapBattleCellPassCount, mem_ship.Luck))
                        {
                            List <int> rationRecoveryShips = this.getRationRecoveryShips(i);
                            if (rationRecoveryShips.get_Count() != 0)
                            {
                                dictionary.Add(mem_ship.Rid, new List <Mst_slotitem>());
                                int        num   = 0;
                                List <int> list2 = new List <int>();
                                if (slotIndexFromId.get_Item(145).get_Count() > 0)
                                {
                                    num++;
                                    int num2 = slotIndexFromId.get_Item(145).get_Count() - 1;
                                    list2.Add(slotIndexFromId.get_Item(145).get_Item(num2));
                                    dictionary.get_Item(mem_ship.Rid).Add(Mst_DataManager.Instance.Mst_Slotitem.get_Item(145));
                                }
                                if (slotIndexFromId.get_Item(150).get_Count() > 0)
                                {
                                    num += 2;
                                    int num3 = slotIndexFromId.get_Item(150).get_Count() - 1;
                                    list2.Add(slotIndexFromId.get_Item(150).get_Item(num3));
                                    dictionary.get_Item(mem_ship.Rid).Add(Mst_DataManager.Instance.Mst_Slotitem.get_Item(150));
                                }
                                Dictionary <int, int> dictionary4;
                                Dictionary <int, int> expr_23B = dictionary4 = dictionary3;
                                int num4;
                                int expr_245 = num4 = mem_ship.Rid;
                                num4 = dictionary4.get_Item(num4);
                                expr_23B.set_Item(expr_245, num4 + this.getCombatRationCondPlus(num, false));
                                dictionary2.Add(i, list2);
                                rationRecoveryShips.Remove(mem_ship.Rid);
                                list.AddRange(rationRecoveryShips);
                                using (List <int> .Enumerator enumerator = rationRecoveryShips.GetEnumerator())
                                {
                                    while (enumerator.MoveNext())
                                    {
                                        int current = enumerator.get_Current();
                                        Dictionary <int, int> dictionary5;
                                        Dictionary <int, int> expr_29F = dictionary5 = dictionary3;
                                        int expr_2A4 = num4 = current;
                                        num4 = dictionary5.get_Item(num4);
                                        expr_29F.set_Item(expr_2A4, num4 + this.getCombatRationCondPlus(num, true));
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (dictionary2.get_Count() == 0)
            {
                return(false);
            }
            List <int> list3 = new List <int>();
            Dictionary <int, Mst_ship> mst_ship = Mst_DataManager.Instance.Mst_ship;

            using (Dictionary <int, List <int> > .Enumerator enumerator2 = dictionary2.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    KeyValuePair <int, List <int> > current2 = enumerator2.get_Current();
                    Mem_ship            mem_ship2            = this.userData.ShipData.get_Item(current2.get_Key());
                    Mem_shipBase        mem_shipBase         = new Mem_shipBase(mem_ship2);
                    List <Mst_slotitem> list4 = this.userData.SlotData.get_Item(current2.get_Key());
                    using (List <int> .Enumerator enumerator3 = current2.get_Value().GetEnumerator())
                    {
                        while (enumerator3.MoveNext())
                        {
                            int current3 = enumerator3.get_Current();
                            int num5;
                            if (current3 != 2147483647)
                            {
                                num5 = mem_ship2.Slot.get_Item(current3);
                                mem_shipBase.Slot.set_Item(current3, -1);
                                list4.set_Item(current3, null);
                            }
                            else
                            {
                                num5 = mem_ship2.Exslot;
                                mem_shipBase.Exslot = -1;
                            }
                            list3.Add(num5);
                        }
                    }
                    mem_ship2.Set_ShipParam(mem_shipBase, mst_ship.get_Item(mem_shipBase.Ship_id), false);
                    mem_ship2.TrimSlot();
                    list4.RemoveAll((Mst_slotitem x) => x == null);
                }
            }
            using (Dictionary <int, int> .Enumerator enumerator4 = dictionary3.GetEnumerator())
            {
                while (enumerator4.MoveNext())
                {
                    KeyValuePair <int, int> current4 = enumerator4.get_Current();
                    Mem_ship shipInstance            = this.userSubInfo.get_Item(current4.get_Key()).ShipInstance;
                    int      value2 = current4.get_Value();
                    shipInstance.AddRationItemCond(value2);
                }
            }
            Comm_UserDatas.Instance.Remove_Slot(list3);
            useShipInfo = dictionary;
            givenShips  = Enumerable.ToList <int>(Enumerable.Distinct <int>(list));
            return(true);
        }
예제 #5
0
        private bool getCombatRationResult(out Dictionary <int, List <Mst_slotitem> > useShipInfo, out List <int> givenShips)
        {
            int mapBattleCellPassCount = mapInstance.MapBattleCellPassCount;

            useShipInfo = null;
            givenShips  = null;
            if (mapBattleCellPassCount < 2)
            {
                return(false);
            }
            Dictionary <int, List <Mst_slotitem> > dictionary = new Dictionary <int, List <Mst_slotitem> >();
            List <int>    list    = new List <int>();
            HashSet <int> hashSet = new HashSet <int>();

            hashSet.Add(145);
            hashSet.Add(150);
            HashSet <int> searchIds = hashSet;
            Dictionary <int, List <int> > dictionary2 = new Dictionary <int, List <int> >();
            Dictionary <int, int>         dictionary3 = userSubInfo.Keys.ToDictionary((int key) => key, (int value) => 0);

            for (int i = 0; i < userData.ShipData.Count; i++)
            {
                Mem_ship mem_ship = userData.ShipData[i];
                if (!mem_ship.IsFight())
                {
                    continue;
                }
                Dictionary <int, List <int> > slotIndexFromId = mem_ship.GetSlotIndexFromId(searchIds);
                if ((slotIndexFromId[145].Count == 0 && slotIndexFromId[150].Count == 0) || !isRationLotteryWinning(mapBattleCellPassCount, mem_ship.Luck))
                {
                    continue;
                }
                List <int> rationRecoveryShips = getRationRecoveryShips(i);
                if (rationRecoveryShips.Count != 0)
                {
                    dictionary.Add(mem_ship.Rid, new List <Mst_slotitem>());
                    int        num   = 0;
                    List <int> list2 = new List <int>();
                    if (slotIndexFromId[145].Count > 0)
                    {
                        num++;
                        int index = slotIndexFromId[145].Count - 1;
                        list2.Add(slotIndexFromId[145][index]);
                        dictionary[mem_ship.Rid].Add(Mst_DataManager.Instance.Mst_Slotitem[145]);
                    }
                    if (slotIndexFromId[150].Count > 0)
                    {
                        num += 2;
                        int index2 = slotIndexFromId[150].Count - 1;
                        list2.Add(slotIndexFromId[150][index2]);
                        dictionary[mem_ship.Rid].Add(Mst_DataManager.Instance.Mst_Slotitem[150]);
                    }
                    Dictionary <int, int> dictionary4;
                    Dictionary <int, int> dictionary5 = dictionary4 = dictionary3;
                    int rid;
                    int key2 = rid = mem_ship.Rid;
                    rid = dictionary4[rid];
                    dictionary5[key2] = rid + getCombatRationCondPlus(num, givenShip: false);
                    dictionary2.Add(i, list2);
                    rationRecoveryShips.Remove(mem_ship.Rid);
                    list.AddRange(rationRecoveryShips);
                    foreach (int item2 in rationRecoveryShips)
                    {
                        Dictionary <int, int> dictionary6;
                        Dictionary <int, int> dictionary7 = dictionary6 = dictionary3;
                        int key3 = rid = item2;
                        rid = dictionary6[rid];
                        dictionary7[key3] = rid + getCombatRationCondPlus(num, givenShip: true);
                    }
                }
            }
            if (dictionary2.Count == 0)
            {
                return(false);
            }
            List <int> list3 = new List <int>();
            Dictionary <int, Mst_ship> mst_ship = Mst_DataManager.Instance.Mst_ship;

            foreach (KeyValuePair <int, List <int> > item3 in dictionary2)
            {
                Mem_ship            mem_ship2    = userData.ShipData[item3.Key];
                Mem_shipBase        mem_shipBase = new Mem_shipBase(mem_ship2);
                List <Mst_slotitem> list4        = userData.SlotData[item3.Key];
                foreach (int item4 in item3.Value)
                {
                    int item;
                    if (item4 != int.MaxValue)
                    {
                        item = mem_ship2.Slot[item4];
                        mem_shipBase.Slot[item4] = -1;
                        list4[item4]             = null;
                    }
                    else
                    {
                        item = mem_ship2.Exslot;
                        mem_shipBase.Exslot = -1;
                    }
                    list3.Add(item);
                }
                mem_ship2.Set_ShipParam(mem_shipBase, mst_ship[mem_shipBase.Ship_id], enemy_flag: false);
                mem_ship2.TrimSlot();
                list4.RemoveAll((Mst_slotitem x) => x == null);
            }
            foreach (KeyValuePair <int, int> item5 in dictionary3)
            {
                Mem_ship shipInstance = userSubInfo[item5.Key].ShipInstance;
                int      value2       = item5.Value;
                shipInstance.AddRationItemCond(value2);
            }
            Comm_UserDatas.Instance.Remove_Slot(list3);
            useShipInfo = dictionary;
            givenShips  = list.Distinct().ToList();
            return(true);
        }
예제 #6
0
        public bool Check_25(Mem_quest targetQuest)
        {
            if (type != KousyouKind.DestroyItem)
            {
                return(false);
            }
            Dictionary <int, int> dictionary = isAddCounter(targetQuest.Rid, checkData);
            Mem_ship flagShip = getFlagShip(1);
            string   yomi     = Mst_DataManager.Instance.Mst_ship[flagShip.Ship_id].Yomi;

            if (!yomi.Equals("ほうしょう"))
            {
                return(false);
            }
            Dictionary <int, List <int> > slotIndexFromId = flagShip.GetSlotIndexFromId(new HashSet <int>
            {
                20
            });

            if (slotIndexFromId[20].Count == 0)
            {
                return(false);
            }
            bool flag = false;

            foreach (int item in slotIndexFromId[20])
            {
                if (Comm_UserDatas.Instance.User_slot[flagShip.Slot[item]].IsMaxSkillLevel())
                {
                    flag = true;
                }
            }
            if (!flag)
            {
                return(false);
            }
            int            num   = 2;
            int            num2  = 0;
            Mem_questcount value = new Mem_questcount();

            if (Comm_UserDatas.Instance.User_questcount.TryGetValue(6806, out value))
            {
                num2 = value.Value;
            }
            int            num3   = 1;
            int            num4   = 0;
            Mem_questcount value2 = new Mem_questcount();

            if (Comm_UserDatas.Instance.User_questcount.TryGetValue(6807, out value2))
            {
                num4 = value2.Value;
            }
            foreach (Mst_slotitem destroyItem in destroyItems)
            {
                if (destroyItem.Id == 20 && num2 < num)
                {
                    num2++;
                }
                if (destroyItem.Id == 19 && num4 < num3)
                {
                    num4++;
                }
            }
            if (dictionary.ContainsKey(6806))
            {
                dictionary[6806] = num2;
            }
            if (dictionary.ContainsKey(6807))
            {
                dictionary[6807] = num4;
            }
            addCounter(dictionary);
            return(CheckClearCounter(targetQuest.Rid));
        }
예제 #7
0
        public bool Check_28(Mem_quest targetQuest)
        {
            if (this.type != QuestKousyou.KousyouKind.DestroyItem)
            {
                return(false);
            }
            Dictionary <int, int> dictionary = base.isAddCounter(targetQuest.Rid, this.checkData);
            Mem_ship      flagShip           = this.getFlagShip(1);
            Mem_ship      arg_3D_0           = flagShip;
            HashSet <int> hashSet            = new HashSet <int>();

            hashSet.Add(79);
            Dictionary <int, List <int> > slotIndexFromId = arg_3D_0.GetSlotIndexFromId(hashSet);

            if (slotIndexFromId.get_Item(79).get_Count() == 0)
            {
                return(false);
            }
            bool flag = false;

            using (List <int> .Enumerator enumerator = slotIndexFromId.get_Item(79).GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    int current = enumerator.get_Current();
                    if (Comm_UserDatas.Instance.User_slot.get_Item(flagShip.Slot.get_Item(current)).IsMaxSkillLevel())
                    {
                        flag = true;
                    }
                }
            }
            if (!flag)
            {
                return(false);
            }
            int num  = 0;
            int num2 = 0;

            using (List <Mst_slotitem> .Enumerator enumerator2 = this.destroyItems.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    Mst_slotitem current2 = enumerator2.get_Current();
                    if (current2.Id == 80)
                    {
                        num++;
                    }
                    if (current2.Id == 26)
                    {
                        num2++;
                    }
                }
            }
            if (dictionary.ContainsKey(6811))
            {
                dictionary.set_Item(6811, num);
            }
            if (dictionary.ContainsKey(6812))
            {
                dictionary.set_Item(6812, num2);
            }
            base.addCounter(dictionary);
            return(base.CheckClearCounter(targetQuest.Rid));
        }
예제 #8
0
        public bool Check_25(Mem_quest targetQuest)
        {
            if (this.type != QuestKousyou.KousyouKind.DestroyItem)
            {
                return(false);
            }
            Dictionary <int, int> dictionary = base.isAddCounter(targetQuest.Rid, this.checkData);
            Mem_ship flagShip = this.getFlagShip(1);
            string   yomi     = Mst_DataManager.Instance.Mst_ship.get_Item(flagShip.Ship_id).Yomi;

            if (!yomi.Equals("ほうしょう"))
            {
                return(false);
            }
            Mem_ship      arg_6A_0 = flagShip;
            HashSet <int> hashSet  = new HashSet <int>();

            hashSet.Add(20);
            Dictionary <int, List <int> > slotIndexFromId = arg_6A_0.GetSlotIndexFromId(hashSet);

            if (slotIndexFromId.get_Item(20).get_Count() == 0)
            {
                return(false);
            }
            bool flag = false;

            using (List <int> .Enumerator enumerator = slotIndexFromId.get_Item(20).GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    int current = enumerator.get_Current();
                    if (Comm_UserDatas.Instance.User_slot.get_Item(flagShip.Slot.get_Item(current)).IsMaxSkillLevel())
                    {
                        flag = true;
                    }
                }
            }
            if (!flag)
            {
                return(false);
            }
            int            num            = 2;
            int            num2           = 0;
            Mem_questcount mem_questcount = new Mem_questcount();

            if (Comm_UserDatas.Instance.User_questcount.TryGetValue(6806, ref mem_questcount))
            {
                num2 = mem_questcount.Value;
            }
            int            num3            = 1;
            int            num4            = 0;
            Mem_questcount mem_questcount2 = new Mem_questcount();

            if (Comm_UserDatas.Instance.User_questcount.TryGetValue(6807, ref mem_questcount2))
            {
                num4 = mem_questcount2.Value;
            }
            using (List <Mst_slotitem> .Enumerator enumerator2 = this.destroyItems.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    Mst_slotitem current2 = enumerator2.get_Current();
                    if (current2.Id == 20 && num2 < num)
                    {
                        num2++;
                    }
                    if (current2.Id == 19 && num4 < num3)
                    {
                        num4++;
                    }
                }
            }
            if (dictionary.ContainsKey(6806))
            {
                dictionary.set_Item(6806, num2);
            }
            if (dictionary.ContainsKey(6807))
            {
                dictionary.set_Item(6807, num4);
            }
            base.addCounter(dictionary);
            return(base.CheckClearCounter(targetQuest.Rid));
        }