예제 #1
0
        public SlotSetChkResult_Ship IsValidSlotSet(int ship_rid)
        {
            Mem_ship value = null;

            if (!Comm_UserDatas.Instance.User_ship.TryGetValue(ship_rid, out value))
            {
                return(SlotSetChkResult_Ship.Invalid);
            }
            if (value.IsBlingShip())
            {
                return(SlotSetChkResult_Ship.BlingShip);
            }
            Mem_deck mem_deck = Comm_UserDatas.Instance.User_deck.Values.FirstOrDefault((Mem_deck x) => (x.Ship.Find(ship_rid) != -1) ? true : false);

            if (mem_deck != null)
            {
                if (mem_deck.MissionState != 0)
                {
                    return(SlotSetChkResult_Ship.Mission);
                }
                if (mem_deck.IsActionEnd)
                {
                    return(SlotSetChkResult_Ship.ActionEndDeck);
                }
            }
            if (Comm_UserDatas.Instance.User_ndock.Values.Any((Mem_ndock x) => x.Ship_id == ship_rid))
            {
                return(SlotSetChkResult_Ship.Repair);
            }
            return(SlotSetChkResult_Ship.Ok);
        }
예제 #2
0
        public Api_req_Kaisou.SlotSetChkResult_Ship IsValidSlotSet(int ship_rid)
        {
            Mem_ship mem_ship = null;

            if (!Comm_UserDatas.Instance.User_ship.TryGetValue(ship_rid, ref mem_ship))
            {
                return(Api_req_Kaisou.SlotSetChkResult_Ship.Invalid);
            }
            if (mem_ship.IsBlingShip())
            {
                return(Api_req_Kaisou.SlotSetChkResult_Ship.BlingShip);
            }
            Mem_deck mem_deck = Enumerable.FirstOrDefault <Mem_deck>(Comm_UserDatas.Instance.User_deck.get_Values(), (Mem_deck x) => x.Ship.Find(ship_rid) != -1);

            if (mem_deck != null)
            {
                if (mem_deck.MissionState != MissionStates.NONE)
                {
                    return(Api_req_Kaisou.SlotSetChkResult_Ship.Mission);
                }
                if (mem_deck.IsActionEnd)
                {
                    return(Api_req_Kaisou.SlotSetChkResult_Ship.ActionEndDeck);
                }
            }
            if (Enumerable.Any <Mem_ndock>(Comm_UserDatas.Instance.User_ndock.get_Values(), (Mem_ndock x) => x.Ship_id == ship_rid))
            {
                return(Api_req_Kaisou.SlotSetChkResult_Ship.Repair);
            }
            return(Api_req_Kaisou.SlotSetChkResult_Ship.Ok);
        }
        public Api_Result <int> Stop(int deck_rid)
        {
            Api_Result <int> api_Result  = new Api_Result <int>();
            Mem_deck         mem_deck    = Comm_UserDatas.Instance.User_deck.get_Item(deck_rid);
            Mst_mission2     mst_mission = Mst_DataManager.Instance.Mst_mission.get_Item(mem_deck.Mission_id);
            int    num        = mst_mission.Time - (mem_deck.StartTime - mem_deck.CompleteTime);
            double num2       = Math.Ceiling((double)(mst_mission.Time + num) / 2.0);
            int    total_turn = Comm_UserDatas.Instance.User_turn.Total_turn;
            int    num3       = ((double)(total_turn - mem_deck.StartTime) >= num2) ? 2 : 1;
            double num4;

            if (num3 == 1)
            {
                num4 = (double)(total_turn - mem_deck.StartTime);
            }
            else
            {
                num4 = (double)(mem_deck.CompleteTime - total_turn);
            }
            num4 = Math.Ceiling(num4 / 3.0);
            int newEndTime = (int)((double)total_turn + num4);

            mem_deck.MissionStop(newEndTime);
            api_Result.data = mem_deck.StartTime - mem_deck.CompleteTime;
            return(api_Result);
        }
예제 #4
0
        public void SelectSupportDeck(List <Mem_deck> targetDeck, bool isForwardDeck)
        {
            MissionType searchKey2;

            if (Mst_DataManager.Instance.Mst_mapenemy.get_Item(this._e_Data.Enemy_id).Boss != 0)
            {
                searchKey2 = MissionType.SupportBoss;
            }
            else
            {
                searchKey2 = MissionType.SupportForward;
            }
            this.supportType = searchKey2;
            if (targetDeck == null || targetDeck.get_Count() == 0)
            {
                return;
            }
            IOrderedEnumerable <Mem_deck> orderedEnumerable = Enumerable.OrderByDescending <Mem_deck, int>(targetDeck, (Mem_deck x) => x.Mission_id);
            MissionType searchKey = searchKey2;

            this.supportDeck = Enumerable.FirstOrDefault <Mem_deck>(Enumerable.Select(Enumerable.Where(Enumerable.Select(orderedEnumerable, (Mem_deck deck) => new
            {
                deck       = deck,
                mst_misson = Mst_DataManager.Instance.Mst_mission.get_Item(deck.Mission_id)
            }), <> __TranspIdent14 => < > __TranspIdent14.mst_misson.Mission_type == searchKey), <> __TranspIdent14 => < > __TranspIdent14.deck));
        }
예제 #5
0
        public void __UpdateDeck__(Api_get_Member api_get_mem)
        {
            Api_Result <Dictionary <int, Mem_deck> > api_Result = api_get_mem.Deck();

            if (api_Result.state == Api_Result_State.Success)
            {
                using (Dictionary <int, Mem_deck> .KeyCollection.Enumerator enumerator = api_Result.data.get_Keys().GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        int       current  = enumerator.get_Current();
                        Mem_deck  mem_deck = api_Result.data.get_Item(current);
                        DeckModel deckModel;
                        if (this._decks.TryGetValue(current, ref deckModel))
                        {
                            deckModel.__Update__(mem_deck, this._ships);
                        }
                        else
                        {
                            this._decks.set_Item(current, new DeckModel(mem_deck, this._ships));
                        }
                    }
                }
            }
        }
        public BattleBaseData(Mem_deck deck)
        {
            List <Mem_ship> memShip = deck.Ship.getMemShip();

            this.ShipData       = new List <Mem_ship>();
            this.SlotData       = new List <List <Mst_slotitem> >();
            this.StartHp        = new List <int>();
            this.SlotLevel      = new List <List <int> >();
            this.SlotExperience = new Dictionary <int, int[]>();
            memShip.ForEach(delegate(Mem_ship x)
            {
                this.SlotData.Add(x.GetMstSlotItems());
                List <int> list = null;
                this.setSlotLevel(x.Slot, false, out list, ref this.SlotExperience);
                this.SlotLevel.Add(list);
                Mst_ship mst_data     = Mst_DataManager.Instance.Mst_ship.get_Item(x.Ship_id);
                Mem_shipBase baseData = new Mem_shipBase(x);
                Mem_ship mem_ship     = new Mem_ship();
                mem_ship.Set_ShipParamPracticeShip(baseData, mst_data);
                this.ShipData.Add(mem_ship);
                this.StartHp.Add(mem_ship.Nowhp);
            });
            this.Enemy_Name        = deck.Name;
            this.haveBattleCommand = false;
        }
예제 #7
0
        public Api_Result <Mem_deck> Start(int deck_rid, int mission_id, int tankerNum)
        {
            Api_Result <Mem_deck> api_Result = new Api_Result <Mem_deck>();
            Mst_mission2          value      = null;

            if (mission_id > 0)
            {
                if (!Mst_DataManager.Instance.Mst_mission.TryGetValue(mission_id, out value))
                {
                    api_Result.state = Api_Result_State.Parameter_Error;
                    return(api_Result);
                }
            }
            else
            {
                List <Mst_mission2> supportResistedData = Mst_DataManager.Instance.GetSupportResistedData(Comm_UserDatas.Instance.User_deck[deck_rid].Area_id);
                value = ((mission_id != -1) ? supportResistedData[1] : supportResistedData[0]);
            }
            Mem_deck value2 = null;

            if (!Comm_UserDatas.Instance.User_deck.TryGetValue(deck_rid, out value2))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (mission_id > 0 && !Comm_UserDatas.Instance.User_missioncomp.ContainsKey(mission_id))
            {
                Mem_missioncomp mem_missioncomp = new Mem_missioncomp(mission_id, value.Maparea_id, MissionClearKinds.NOTCLEAR);
                mem_missioncomp.Insert();
            }
            if (!value2.MissionStart(value))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (tankerNum > 0)
            {
                IEnumerable <Mem_tanker> enumerable = Mem_tanker.GetFreeTanker(Comm_UserDatas.Instance.User_tanker).Take(tankerNum);
                List <Mem_tanker>        list       = new List <Mem_tanker>();
                foreach (Mem_tanker item in enumerable)
                {
                    if (!item.MissionStart(value.Maparea_id, deck_rid))
                    {
                        list.ForEach(delegate(Mem_tanker x)
                        {
                            x.MissionTerm();
                        });
                        api_Result.state = Api_Result_State.Parameter_Error;
                        return(api_Result);
                    }
                    list.Add(item);
                }
            }
            api_Result.data = value2;
            QuestMission questMission = new QuestMission(value.Id, value2, MissionResultKinds.FAILE);

            questMission.ExecuteCheck();
            return(api_Result);
        }
        public QuestMission(int mstId, Mem_deck deck, MissionResultKinds resultKind)
        {
            this.checkData     = base.getCheckDatas(4);
            this.missionId     = mstId;
            this.missionDeck   = deck;
            this.missionResult = resultKind;
            Dictionary <int, HashSet <int> > dictionary = new Dictionary <int, HashSet <int> >();
            Dictionary <int, HashSet <int> > arg_66_0   = dictionary;
            int           arg_66_1 = 43;
            HashSet <int> hashSet  = new HashSet <int>();

            hashSet.Add(10);
            hashSet.Add(11);
            hashSet.Add(12);
            hashSet.Add(51);
            hashSet.Add(52);
            arg_66_0.Add(arg_66_1, hashSet);
            Dictionary <int, HashSet <int> > arg_7E_0 = dictionary;
            int arg_7E_1 = 45;

            hashSet = new HashSet <int>();
            hashSet.Add(60);
            arg_7E_0.Add(arg_7E_1, hashSet);
            Dictionary <int, HashSet <int> > arg_96_0 = dictionary;
            int arg_96_1 = 46;

            hashSet = new HashSet <int>();
            hashSet.Add(67);
            arg_96_0.Add(arg_96_1, hashSet);
            Dictionary <int, HashSet <int> > arg_AE_0 = dictionary;
            int arg_AE_1 = 47;

            hashSet = new HashSet <int>();
            hashSet.Add(45);
            arg_AE_0.Add(arg_AE_1, hashSet);
            Dictionary <int, HashSet <int> > arg_C6_0 = dictionary;
            int arg_C6_1 = 48;

            hashSet = new HashSet <int>();
            hashSet.Add(46);
            arg_C6_0.Add(arg_C6_1, hashSet);
            Dictionary <int, HashSet <int> > arg_DE_0 = dictionary;
            int arg_DE_1 = 49;

            hashSet = new HashSet <int>();
            hashSet.Add(52);
            arg_DE_0.Add(arg_DE_1, hashSet);
            Dictionary <int, HashSet <int> > arg_110_0 = dictionary;
            int arg_110_1 = 50;

            hashSet = new HashSet <int>();
            hashSet.Add(3);
            hashSet.Add(9);
            hashSet.Add(13);
            hashSet.Add(20);
            arg_110_0.Add(arg_110_1, hashSet);
            this.commonCounterEnableMission = dictionary;
        }
예제 #9
0
 public void Add_Deck(int rid)
 {
     if (rid <= 8 && !User_deck.ContainsKey(rid))
     {
         Mem_deck value = new Mem_deck(rid);
         User_deck.Add(rid, value);
         Mem_room value2 = new Mem_room(rid);
         User_room.Add(rid, value2);
     }
 }
        private TurnWorkResult ExecTurnStartWork()
        {
            IEnumerable <int> enumerable  = Enumerable.Select <Mem_ndock, int>(Enumerable.Where <Mem_ndock>(Comm_UserDatas.Instance.User_ndock.get_Values(), (Mem_ndock ndock) => !ndock.IsRecoverEndTime() && ndock.State == NdockStates.RESTORE), (Mem_ndock ndock) => ndock.Ship_id);
            HashSet <int>     hashSet     = new HashSet <int>(enumerable);
            IEnumerable <int> enumerable2 = Enumerable.Select <Mem_deck, int>(Comm_UserDatas.Instance.User_deck.get_Values(), (Mem_deck x) => x.Ship[0]);
            HashSet <int>     hashSet2    = new HashSet <int>(enumerable2);

            using (Dictionary <int, Mem_ship> .ValueCollection.Enumerator enumerator = Comm_UserDatas.Instance.User_ship.get_Values().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Mem_ship current = enumerator.get_Current();
                    current.AddTurnRecoveryCond(this, 10);
                    bool flag = current.SumLovToTurnStart(hashSet.Contains(current.Rid), hashSet2.Contains(current.Rid));
                }
            }
            TurnWorkResult turnWorkResult = new TurnWorkResult();

            turnWorkResult.ChangeState       = TurnState.CONTINOUS;
            turnWorkResult.TransportMaterial = new Dictionary <enumMaterialCategory, int>();
            Dictionary <enumMaterialCategory, int> dictionary = new Dictionary <enumMaterialCategory, int>();

            using (IEnumerator enumerator2 = Enum.GetValues(typeof(enumMaterialCategory)).GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    object current2 = enumerator2.get_Current();
                    turnWorkResult.TransportMaterial.Add((enumMaterialCategory)((int)current2), 0);
                    dictionary.Add((enumMaterialCategory)((int)current2), 0);
                }
            }
            this.TakeMaterial(ref turnWorkResult.TransportMaterial, ref dictionary);
            this.setSummaryMaterialInfo(dictionary, out turnWorkResult.BonusMaterialMonthly, out turnWorkResult.BonusMaterialWeekly);
            using (Dictionary <int, Mem_deck> .ValueCollection.Enumerator enumerator3 = Comm_UserDatas.Instance.User_deck.get_Values().GetEnumerator())
            {
                while (enumerator3.MoveNext())
                {
                    Mem_deck current3 = enumerator3.get_Current();
                    if (current3.MissionState == MissionStates.NONE)
                    {
                        this.repairShipAutoRecovery(current3.Ship);
                    }
                }
            }
            this.getInstance.Deck_Port();
            turnWorkResult.MissionEndDecks = Enumerable.ToList <Mem_deck>(Enumerable.Where <Mem_deck>(Comm_UserDatas.Instance.User_deck.get_Values(), (Mem_deck x) => x.MissionState == MissionStates.END || (x.MissionState == MissionStates.STOP && x.CompleteTime == 0)));
            this.ExecBling_Ship(out turnWorkResult.BlingEndShip);
            this.ExecBling_EscortDeck(out turnWorkResult.BlingEndEscortDeck);
            this.ExecBling_Tanker(out turnWorkResult.BlingEndTanker);
            this.setTurnRewardItem(out turnWorkResult.SpecialItem);
            this.updateRewardItem(turnWorkResult.SpecialItem);
            return(turnWorkResult);
        }
예제 #11
0
 public Exec_MissionResult(Mem_deck deck, Dictionary <int, int> mst_level, Dictionary <int, int> mst_userlevel)
 {
     this.daihatuNum    = 0;
     this.drumNum       = 0;
     this.drumShipNum   = 0;
     this.mem_deck      = deck;
     this.mst_level     = mst_level;
     this.mst_userlevel = mst_userlevel;
     this.mem_ships     = deck.Ship.getMemShip();
     this.mst_mission   = Mst_DataManager.Instance.Mst_mission.get_Item(deck.Mission_id);
     this.missionTanker = Enumerable.ToList <Mem_tanker>(Enumerable.Where <Mem_tanker>(Comm_UserDatas.Instance.User_tanker.get_Values(), (Mem_tanker x) => x.Mission_deck_rid == deck.Rid));
     this.randInstance  = new Random();
 }
예제 #12
0
        protected override void init()
        {
            this.practiceFlag = true;
            Mem_deck mem_deck = Comm_UserDatas.Instance.User_deck.get_Item(this.deckRid);

            mem_deck.ActionEnd();
            this.userData  = this.getUserData(mem_deck);
            this.enemyData = new BattleBaseData(Comm_UserDatas.Instance.User_deck.get_Item(this.deckRidEnemy));
            base.setBattleSubInfo(this.userData, out this.userSubInfo);
            base.setBattleSubInfo(this.enemyData, out this.enemySubInfo);
            this.battleKinds         = ExecBattleKinds.None;
            this.battleCommandParams = new BattleCommandParams(this.userData);
        }
        public void Add_Deck(int rid)
        {
            if (rid > 8 || this.User_deck.ContainsKey(rid))
            {
                return;
            }
            Mem_deck mem_deck = new Mem_deck(rid);

            this.User_deck.Add(rid, mem_deck);
            Mem_room mem_room = new Mem_room(rid);

            this.User_room.Add(rid, mem_room);
        }
예제 #14
0
        protected override void init()
        {
            practiceFlag = true;
            Mem_deck mem_deck = Comm_UserDatas.Instance.User_deck[deckRid];

            mem_deck.ActionEnd();
            userData  = getUserData(mem_deck);
            enemyData = new BattleBaseData(Comm_UserDatas.Instance.User_deck[deckRidEnemy]);
            setBattleSubInfo(userData, out userSubInfo);
            setBattleSubInfo(enemyData, out enemySubInfo);
            battleKinds         = ExecBattleKinds.None;
            battleCommandParams = new BattleCommandParams(userData);
        }
        public Api_Result <Hashtable> Update_DeckName(int deck_id, string name)
        {
            Api_Result <Hashtable> api_Result = new Api_Result <Hashtable>();

            api_Result.data = null;
            Mem_deck mem_deck = null;

            if (!Comm_UserDatas.Instance.User_deck.TryGetValue(deck_id, ref mem_deck))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
            }
            mem_deck.SetDeckName(name);
            return(api_Result);
        }
예제 #16
0
 public Exec_MissionResult(Mem_deck deck, Dictionary <int, int> mst_level, Dictionary <int, int> mst_userlevel)
 {
     daihatuNum         = 0;
     drumNum            = 0;
     drumShipNum        = 0;
     mem_deck           = deck;
     this.mst_level     = mst_level;
     this.mst_userlevel = mst_userlevel;
     mem_ships          = deck.Ship.getMemShip();
     mst_mission        = Mst_DataManager.Instance.Mst_mission[deck.Mission_id];
     missionTanker      = (from x in Comm_UserDatas.Instance.User_tanker.Values
                           where x.Mission_deck_rid == deck.Rid
                           select x).ToList();
     randInstance = new Random();
 }
 public void UpdateDeckShipLocale()
 {
     this.Temp_deckship.Clear();
     using (Dictionary <int, Mem_deck> .ValueCollection.Enumerator enumerator = Comm_UserDatas.Instance.User_deck.get_Values().GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             Mem_deck current = enumerator.get_Current();
             for (int i = 0; i < current.Ship.Count(); i++)
             {
                 this.Temp_deckship.Add(current.Ship[i]);
             }
         }
     }
 }
예제 #18
0
        public Api_Result <Mem_deck> MoveArea(int rid, int move_id)
        {
            Api_Result <Mem_deck> api_Result = new Api_Result <Mem_deck>();
            Mem_deck value = null;

            if (!Comm_UserDatas.Instance.User_deck.TryGetValue(rid, out value))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            value.MoveArea(move_id);
            value.ActionEnd();
            api_Result.t_state = TurnState.OWN_END;
            return(api_Result);
        }
예제 #19
0
        public void SelectSupportDeck(List <Mem_deck> targetDeck, bool isForwardDeck)
        {
            MissionType missionType = supportType = ((Mst_DataManager.Instance.Mst_mapenemy[_e_Data.Enemy_id].Boss == 0) ? MissionType.SupportForward : MissionType.SupportBoss);

            if (targetDeck != null && targetDeck.Count != 0)
            {
                IOrderedEnumerable <Mem_deck> source = from x in targetDeck
                                                       orderby x.Mission_id descending
                                                       select x;
                MissionType searchKey = missionType;
                supportDeck = (from deck in source
                               let mst_misson = Mst_DataManager.Instance.Mst_mission[deck.Mission_id]
                                                where mst_misson.Mission_type == searchKey
                                                select deck).FirstOrDefault();
            }
        }
예제 #20
0
        private BattleBaseData getUserData(Mem_deck deck)
        {
            List <Mem_ship>             memShip = deck.Ship.getMemShip();
            List <List <Mst_slotitem> > list    = new List <List <Mst_slotitem> >();
            List <int> list2 = new List <int>();

            foreach (Mem_ship item in memShip)
            {
                list2.Add(item.Stype);
                IEnumerable <Mst_slotitem> source = from mem_id in item.Slot
                                                    where Comm_UserDatas.Instance.User_slot.ContainsKey(mem_id)
                                                    select Mst_DataManager.Instance.Mst_Slotitem[Comm_UserDatas.Instance.User_slot[mem_id].Slotitem_id];
                list.Add(source.ToList());
            }
            return(new BattleBaseData(deck, memShip, list2, list));
        }
예제 #21
0
        public bool PrackticeDeckCheck(DeckPracticeType type, int deck_rid)
        {
            Mem_deck value = null;

            if (!Comm_UserDatas.Instance.User_deck.TryGetValue(deck_rid, out value))
            {
                return(false);
            }
            List <Mem_ship> memShip = value.Ship.getMemShip();

            if (memShip.Count < 0)
            {
                return(false);
            }
            Dictionary <int, Mst_ship> mst_shipDict = Mst_DataManager.Instance.Mst_ship;

            switch (type)
            {
            case DeckPracticeType.Normal:
                return(true);

            case DeckPracticeType.Hou:
            {
                HashSet <int> disableItem = submarineGroup;
                return(memShip.Any((Mem_ship x) => !disableItem.Contains(x.Stype)));
            }

            case DeckPracticeType.Rai:
                return(memShip.Any((Mem_ship x) => mst_shipDict[x.Ship_id].Raig > 0));

            case DeckPracticeType.Taisen:
                return(memShip.Any((Mem_ship x) => mst_shipDict[x.Ship_id].Tais > 0));

            case DeckPracticeType.Kouku:
            {
                HashSet <int> enableItem = motherBGroup;
                return(memShip.Any((Mem_ship x) => enableItem.Contains(x.Stype)));
            }

            case DeckPracticeType.Sougou:
                return((memShip.Count >= 6) ? true : false);

            default:
                return(false);
            }
        }
예제 #22
0
        public Api_Result <int> Stop(int deck_rid)
        {
            Api_Result <int> api_Result  = new Api_Result <int>();
            Mem_deck         mem_deck    = Comm_UserDatas.Instance.User_deck[deck_rid];
            Mst_mission2     mst_mission = Mst_DataManager.Instance.Mst_mission[mem_deck.Mission_id];
            int    num        = mst_mission.Time - (mem_deck.StartTime - mem_deck.CompleteTime);
            double num2       = Math.Ceiling((double)(mst_mission.Time + num) / 2.0);
            int    total_turn = Comm_UserDatas.Instance.User_turn.Total_turn;
            int    num3       = ((double)(total_turn - mem_deck.StartTime) < num2) ? 1 : 2;
            double num4       = (num3 != 1) ? ((double)(mem_deck.CompleteTime - total_turn)) : ((double)(total_turn - mem_deck.StartTime));

            num4 = Math.Ceiling(num4 / 3.0);
            int newEndTime = (int)((double)total_turn + num4);

            mem_deck.MissionStop(newEndTime);
            api_Result.data = mem_deck.StartTime - mem_deck.CompleteTime;
            return(api_Result);
        }
        public Api_Result <Dictionary <int, Mem_deck> > Deck_Port()
        {
            Api_Result <Dictionary <int, Mem_deck> > api_Result = this.Deck();

            if (api_Result.data == null)
            {
                return(api_Result);
            }
            using (Dictionary <int, Mem_deck> .ValueCollection.Enumerator enumerator = api_Result.data.get_Values().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Mem_deck current = enumerator.get_Current();
                    current.MissionEnd();
                }
            }
            return(api_Result);
        }
예제 #24
0
        private BattleBaseData getUserData(Mem_deck deck)
        {
            List <Mem_ship>             memShip = deck.Ship.getMemShip();
            List <List <Mst_slotitem> > list    = new List <List <Mst_slotitem> >();
            List <int> list2 = new List <int>();

            using (List <Mem_ship> .Enumerator enumerator = memShip.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Mem_ship current = enumerator.get_Current();
                    list2.Add(current.Stype);
                    IEnumerable <Mst_slotitem> enumerable = Enumerable.Select <int, Mst_slotitem>(Enumerable.Where <int>(current.Slot, (int mem_id) => Comm_UserDatas.Instance.User_slot.ContainsKey(mem_id)), (int mem_id) => Mst_DataManager.Instance.Mst_Slotitem.get_Item(Comm_UserDatas.Instance.User_slot.get_Item(mem_id).Slotitem_id));
                    list.Add(Enumerable.ToList <Mst_slotitem>(enumerable));
                }
            }
            return(new BattleBaseData(deck, memShip, list2, list));
        }
        public bool ValidStop(int deck_rid)
        {
            Mem_deck mem_deck = null;

            if (!Comm_UserDatas.Instance.User_deck.TryGetValue(deck_rid, ref mem_deck))
            {
                return(false);
            }
            if (mem_deck.MissionState != MissionStates.RUNNING)
            {
                return(false);
            }
            if (mem_deck.SupportKind != Mem_deck.SupportKinds.NONE)
            {
                return(false);
            }
            int total_turn = Comm_UserDatas.Instance.User_turn.Total_turn;

            return(mem_deck.CompleteTime > total_turn);
        }
예제 #26
0
        public void __UpdateDeck__(Api_get_Member api_get_mem)
        {
            Api_Result <Dictionary <int, Mem_deck> > api_Result = api_get_mem.Deck();

            if (api_Result.state == Api_Result_State.Success)
            {
                foreach (int key in api_Result.data.Keys)
                {
                    Mem_deck mem_deck = api_Result.data[key];
                    if (_decks.TryGetValue(key, out DeckModel value))
                    {
                        value.__Update__(mem_deck, _ships);
                    }
                    else
                    {
                        _decks[key] = new DeckModel(mem_deck, _ships);
                    }
                }
            }
        }
예제 #27
0
        public void SelectSupportDeck(List <Mem_deck> targetDeck)
        {
            MissionType ms_type = MissionType.None;

            if (Mst_DataManager.Instance.Mst_mapenemy[_e_Data.Enemy_id].Boss != 0)
            {
                ms_type = MissionType.SupportBoss;
            }
            else
            {
                ms_type = MissionType.SupportForward;
            }
            supportType = ms_type;
            if (targetDeck != null && targetDeck.Count != 0)
            {
                supportDeck = (from deck in targetDeck
                               let mst_misson = Mst_DataManager.Instance.Mst_mission[deck.Mission_id]
                                                where mst_misson.Mission_type == ms_type
                                                select deck).FirstOrDefault();
            }
        }
예제 #28
0
 public BattleBaseData(Mem_deck deck, List <Mem_ship> ships, List <int> stypes, List <List <Mst_slotitem> > slotitems)
 {
     Deck           = deck;
     ShipData       = ships;
     SlotData       = slotitems;
     LostFlag       = new List <bool>();
     StartHp        = new List <int>();
     SlotLevel      = new List <List <int> >();
     SlotExperience = new Dictionary <int, int[]>();
     ships.ForEach(delegate(Mem_ship x)
     {
         bool item = (x.Get_DamageState() == DamageState.Taiha) ? true : false;
         LostFlag.Add(item);
         StartHp.Add(x.Nowhp);
         List <int> outlevel = null;
         setSlotLevel(x.Slot, areaEnemy: false, out outlevel, ref SlotExperience);
         SlotLevel.Add(outlevel);
     });
     LostFlag[0]       = false;
     haveBattleCommand = true;
 }
 public BattleBaseData(Mem_deck deck, List <Mem_ship> ships, List <int> stypes, List <List <Mst_slotitem> > slotitems)
 {
     this.Deck           = deck;
     this.ShipData       = ships;
     this.SlotData       = slotitems;
     this.LostFlag       = new List <bool>();
     this.StartHp        = new List <int>();
     this.SlotLevel      = new List <List <int> >();
     this.SlotExperience = new Dictionary <int, int[]>();
     ships.ForEach(delegate(Mem_ship x)
     {
         bool flag = x.Get_DamageState() == DamageState.Taiha;
         this.LostFlag.Add(flag);
         this.StartHp.Add(x.Nowhp);
         List <int> list = null;
         this.setSlotLevel(x.Slot, false, out list, ref this.SlotExperience);
         this.SlotLevel.Add(list);
     });
     this.LostFlag.set_Item(0, false);
     this.haveBattleCommand = true;
 }
예제 #30
0
        public Api_Result <MissionResultFmt> Result(int deck_rid)
        {
            Api_Result <MissionResultFmt> api_Result = new Api_Result <MissionResultFmt>();
            Mem_deck value = null;

            if (!Comm_UserDatas.Instance.User_deck.TryGetValue(deck_rid, out value))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (value.MissionState != MissionStates.END && value.MissionState != MissionStates.STOP)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (value.Ship.Count() == 0)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (mst_level == null)
            {
                mst_level = Mst_DataManager.Instance.Get_MstLevel(shipTable: true);
            }
            if (mst_userlevel == null)
            {
                mst_userlevel = Mst_DataManager.Instance.Get_MstLevel(shipTable: false);
            }
            int  mission_id = value.Mission_id;
            bool flag       = value.MissionState == MissionStates.STOP;
            Exec_MissionResult exec_MissionResult = new Exec_MissionResult(value, mst_level, mst_userlevel);

            api_Result.data = exec_MissionResult.GetResultData();
            if (!flag)
            {
                QuestMission questMission = new QuestMission(mission_id, value, api_Result.data.MissionResult);
                questMission.ExecuteCheck();
            }
            return(api_Result);
        }