Exemplo n.º 1
0
        public bool Check_26(Mem_quest targetQuest)
        {
            if (type != KousyouKind.DestroyItem)
            {
                return(false);
            }
            Dictionary <int, int> counter = isAddCounter(targetQuest.Rid, checkData);
            Mem_ship flagShip             = getFlagShip(1);
            Dictionary <int, int> mstSlotItemNum_OrderId = flagShip.GetMstSlotItemNum_OrderId(new HashSet <int>
            {
                96
            });

            if (mstSlotItemNum_OrderId[96] == 0)
            {
                return(false);
            }
            int num = destroyItems.Count((Mst_slotitem x) => x.Id == 21);

            for (int i = 0; i < num; i++)
            {
                addCounterIncrementAll(counter);
            }
            return(CheckClearCounter(targetQuest.Rid));
        }
Exemplo n.º 2
0
        public bool Check_22(Mem_quest targetQuest)
        {
            if (type != KousyouKind.DestroyItem)
            {
                return(false);
            }
            Dictionary <int, int> counter = 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, int> mstSlotItemNum_OrderId = flagShip.GetMstSlotItemNum_OrderId(new HashSet <int>
            {
                143
            });

            if (mstSlotItemNum_OrderId[143] == 0)
            {
                return(false);
            }
            int num = destroyItems.Count((Mst_slotitem x) => x.Id == 17);

            for (int i = 0; i < num; i++)
            {
                addCounterIncrementAll(counter);
            }
            return(CheckClearCounter(targetQuest.Rid));
        }
Exemplo n.º 3
0
        public bool Check_26(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(96);
            Dictionary <int, int> mstSlotItemNum_OrderId = arg_3D_0.GetMstSlotItemNum_OrderId(hashSet);

            if (mstSlotItemNum_OrderId.get_Item(96) == 0)
            {
                return(false);
            }
            int num = Enumerable.Count <Mst_slotitem>(this.destroyItems, (Mst_slotitem x) => x.Id == 21);

            for (int i = 0; i < num; i++)
            {
                base.addCounterIncrementAll(counter);
            }
            return(base.CheckClearCounter(targetQuest.Rid));
        }
Exemplo n.º 4
0
        public bool Check_22(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);
            string   yomi = Mst_DataManager.Instance.Mst_ship.get_Item(flagShip.Ship_id).Yomi;

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

            hashSet.Add(143);
            Dictionary <int, int> mstSlotItemNum_OrderId = arg_6D_0.GetMstSlotItemNum_OrderId(hashSet);

            if (mstSlotItemNum_OrderId.get_Item(143) == 0)
            {
                return(false);
            }
            int num = Enumerable.Count <Mst_slotitem>(this.destroyItems, (Mst_slotitem x) => x.Id == 17);

            for (int i = 0; i < num; i++)
            {
                base.addCounterIncrementAll(counter);
            }
            return(base.CheckClearCounter(targetQuest.Rid));
        }
Exemplo n.º 5
0
        private bool haveFlagShipRequireItem(Mem_ship flagShip)
        {
            Dictionary <int, int> mstSlotItemNum_OrderId = flagShip.GetMstSlotItemNum_OrderId(spItemID);

            return(mstSlotItemNum_OrderId.Values.Any((int x) => x > 0));
        }
        private void repairShipAutoRecovery(DeckShips deck)
        {
            int             num  = 86;
            int             num2 = 19;
            List <Mem_ship> list = deck.getMemShip();

            if (Enumerable.Count <Mem_ship>(list) == 0)
            {
                return;
            }
            if (list.get_Item(0).Stype != num2)
            {
                return;
            }
            DamageState damageState = list.get_Item(0).Get_DamageState();

            if (damageState == DamageState.Tyuuha || damageState == DamageState.Taiha)
            {
                return;
            }
            if (list.get_Item(0).ExistsNdock())
            {
                return;
            }
            if (list.get_Item(0).IsBlingShip())
            {
                return;
            }
            Mem_material mem_material  = Comm_UserDatas.Instance.User_material.get_Item(enumMaterialCategory.Fuel);
            Mem_material mem_material2 = Comm_UserDatas.Instance.User_material.get_Item(enumMaterialCategory.Steel);

            if (mem_material.Value == 0 && mem_material2.Value == 0)
            {
                return;
            }
            Mem_ship      arg_C7_0 = list.get_Item(0);
            HashSet <int> hashSet  = new HashSet <int>();

            hashSet.Add(num);
            Dictionary <int, int> mstSlotItemNum_OrderId = arg_C7_0.GetMstSlotItemNum_OrderId(hashSet);
            int num3 = mstSlotItemNum_OrderId.get_Item(num);

            list = Enumerable.ToList <Mem_ship>(Enumerable.Take <Mem_ship>(list, num3 + 2));
            using (List <Mem_ship> .Enumerator enumerator = list.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Mem_ship current = enumerator.get_Current();
                    if (current.Nowhp < current.Maxhp)
                    {
                        DamageState damageState2 = current.Get_DamageState();
                        if (damageState2 != DamageState.Tyuuha && damageState2 != DamageState.Taiha)
                        {
                            if (!current.ExistsNdock())
                            {
                                if (!current.IsBlingShip())
                                {
                                    int    ndockTimeSpan = current.GetNdockTimeSpan();
                                    int    num4          = ndockTimeSpan * 30;
                                    int    num5          = 30;
                                    double num6          = (double)num5 / (double)num4;
                                    Dictionary <enumMaterialCategory, int> ndockMaterialNum = current.GetNdockMaterialNum();
                                    int num7 = (int)Math.Ceiling((double)ndockMaterialNum.get_Item(enumMaterialCategory.Fuel) * num6);
                                    int num8 = (int)Math.Ceiling((double)ndockMaterialNum.get_Item(enumMaterialCategory.Steel) * num6);
                                    if (mem_material.Value >= num7 && mem_material2.Value >= num8)
                                    {
                                        double num9  = (double)(current.Maxhp - current.Nowhp) * num6;
                                        int    num10 = (num9 >= 1.0) ? ((int)num9) : ((int)Math.Ceiling(num9));
                                        current.SubHp(-num10);
                                        mem_material.Sub_Material(num7);
                                        mem_material2.Sub_Material(num8);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 7
0
        private void setResultKind()
        {
            if (this.mem_deck.MissionState == MissionStates.STOP)
            {
                this.resultInfo.MissionResult = MissionResultKinds.FAILE;
                return;
            }
            if (this.mst_mission.Flagship_level > 0)
            {
                FatigueState fatigueState = this.mem_ships.get_Item(0).Get_FatigueState();
                if (fatigueState >= FatigueState.Light)
                {
                    this.resultInfo.MissionResult = MissionResultKinds.FAILE;
                    return;
                }
                if (this.mst_mission.Flagship_level > this.mem_ships.get_Item(0).Level)
                {
                    this.resultInfo.MissionResult = MissionResultKinds.FAILE;
                    return;
                }
            }
            if (this.mst_mission.Flagship_stype1 > 0 && this.mst_mission.Flagship_stype1 != this.mem_ships.get_Item(0).Stype)
            {
                this.resultInfo.MissionResult = MissionResultKinds.FAILE;
                return;
            }
            if (this.mst_mission.Tanker_num > 0 && this.missionTanker.get_Count() < this.mst_mission.Tanker_num)
            {
                this.resultInfo.MissionResult = MissionResultKinds.FAILE;
                return;
            }
            Dictionary <int, int> dictionary = Enumerable.ToDictionary(Enumerable.Select(Enumerable.Select(Utils.Xml_Result("mst_stype_group", "mst_stype_group", "Id"), (XElement data) => new
            {
                data = data,
                item = new
                {
                    id   = int.Parse(data.Element("Id").get_Value()),
                    type = int.Parse(data.Element("Mission").get_Value())
                }
            }), <> __TranspIdent15 => < > __TranspIdent15.item), obj => obj.id, value => value.type);
            IEnumerable <int>     enumerable  = Enumerable.Distinct <int>(dictionary.get_Values());
            Dictionary <int, int> dictionary2 = Enumerable.ToDictionary <int, int, int>(enumerable, (int type) => type, (int count) => 0);
            int num  = 0;
            int num2 = 0;
            int num3 = 0;
            int num4 = 0;
            int num5 = 0;
            int num6 = 0;
            int num7 = 0;

            using (List <Mem_ship> .Enumerator enumerator = this.mem_ships.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Mem_ship     current       = enumerator.get_Current();
                    FatigueState fatigueState2 = current.Get_FatigueState();
                    if (fatigueState2 == FatigueState.Distress)
                    {
                        this.resultInfo.MissionResult = MissionResultKinds.FAILE;
                        return;
                    }
                    Mem_ship      arg_251_0 = current;
                    HashSet <int> hashSet   = new HashSet <int>();
                    hashSet.Add(68);
                    hashSet.Add(75);
                    Dictionary <int, int> mstSlotItemNum_OrderId = arg_251_0.GetMstSlotItemNum_OrderId(hashSet);
                    Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship.get_Item(current.Ship_id);
                    this.daihatuNum += mstSlotItemNum_OrderId.get_Item(68);
                    if (mstSlotItemNum_OrderId.get_Item(75) > 0)
                    {
                        this.drumShipNum++;
                    }
                    this.drumNum += mstSlotItemNum_OrderId.get_Item(75);
                    num7         += current.Level;
                    num6         += mst_ship.Bull_max;
                    num5         += mst_ship.Fuel_max;
                    if (fatigueState2 == FatigueState.Light)
                    {
                        num2++;
                    }
                    else
                    {
                        if (fatigueState2 == FatigueState.Exaltation)
                        {
                            num++;
                        }
                        num4 += current.Bull;
                        num3 += current.Fuel;
                        int num8 = dictionary.get_Item(current.Stype);
                        Dictionary <int, int> dictionary3;
                        Dictionary <int, int> expr_326 = dictionary3 = dictionary2;
                        int num9;
                        int expr_32B = num9 = num8;
                        num9 = dictionary3.get_Item(num9);
                        expr_326.set_Item(expr_32B, num9 + 1);
                    }
                }
            }
            if (dictionary2.get_Item(1) < this.mst_mission.Stype_num1 || dictionary2.get_Item(2) < this.mst_mission.Stype_num2 || dictionary2.get_Item(3) < this.mst_mission.Stype_num3 || dictionary2.get_Item(4) < this.mst_mission.Stype_num4 || dictionary2.get_Item(5) < this.mst_mission.Stype_num5 || dictionary2.get_Item(6) < this.mst_mission.Stype_num6 || dictionary2.get_Item(7) < this.mst_mission.Stype_num7 || dictionary2.get_Item(8) < this.mst_mission.Stype_num8 || dictionary2.get_Item(9) < this.mst_mission.Stype_num9)
            {
                this.resultInfo.MissionResult = MissionResultKinds.FAILE;
                return;
            }
            if (this.mst_mission.Deck_num > 0)
            {
                int num10 = this.mem_ships.get_Count() - num2;
                if (num10 < this.mst_mission.Deck_num)
                {
                    this.resultInfo.MissionResult = MissionResultKinds.FAILE;
                    return;
                }
            }
            if (num7 < this.mst_mission.Level)
            {
                this.resultInfo.MissionResult = MissionResultKinds.FAILE;
                return;
            }
            if (this.drumShipNum < this.mst_mission.Drum_ship_num || this.drumNum < this.mst_mission.Drum_total_num1)
            {
                this.resultInfo.MissionResult = MissionResultKinds.FAILE;
                return;
            }
            double num11 = (double)(num3 + num4);
            double num12 = (double)(num5 + num6);
            double num13 = num11 / num12 * 100.0;
            int    num14 = (int)(num13 + (double)this.randInstance.Next(20));

            if (num14 < 100)
            {
                this.resultInfo.MissionResult = MissionResultKinds.FAILE;
                return;
            }
            if (num2 > 0)
            {
                this.resultInfo.MissionResult = MissionResultKinds.SUCCESS;
                return;
            }
            if (!this.mst_mission.IsGreatSuccessCondition() && num < this.mem_ships.get_Count())
            {
                this.resultInfo.MissionResult = MissionResultKinds.SUCCESS;
                return;
            }
            int drumKeisu = 0;

            if (this.mst_mission.Drum_total_num2 > 0)
            {
                drumKeisu = ((this.drumNum < this.mst_mission.Drum_total_num2) ? -15 : 20);
            }
            if (this.mst_mission.Flagship_stype2 > 0 && this.mst_mission.Flagship_stype2 != this.mem_ships.get_Item(0).Stype)
            {
                this.resultInfo.MissionResult = MissionResultKinds.SUCCESS;
                return;
            }
            int checkRate = this.getCheckRate(num, drumKeisu);
            int num15     = this.randInstance.Next(100);

            if (checkRate >= num15)
            {
                this.resultInfo.MissionResult = MissionResultKinds.GREAT;
                return;
            }
            this.resultInfo.MissionResult = MissionResultKinds.SUCCESS;
            return;
        }
Exemplo n.º 8
0
        private bool haveFlagShipRequireItem(Mem_ship flagShip)
        {
            Dictionary <int, int> mstSlotItemNum_OrderId = flagShip.GetMstSlotItemNum_OrderId(this.spItemID);

            return(Enumerable.Any <int>(mstSlotItemNum_OrderId.get_Values(), (int x) => x > 0));
        }