Exemplo n.º 1
0
 public static void OpenMapAreaAll()
 {
     using (Dictionary <int, Mst_mapinfo> .ValueCollection.Enumerator enumerator = Mst_DataManager.Instance.Mst_mapinfo.get_Values().GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             Mst_mapinfo current = enumerator.get_Current();
             if (!Comm_UserDatas.Instance.User_mapclear.ContainsKey(current.Id))
             {
                 Mem_mapclear mem_mapclear = new Mem_mapclear(current.Id, current.Maparea_id, current.No, MapClearState.Cleard);
                 mem_mapclear.Insert();
             }
             if (current.Maparea_id != 1 && current.No == 1 && Mem_history.IsFirstOpenArea(current.Id))
             {
                 Mem_history mem_history = new Mem_history();
                 mem_history.SetAreaOpen(Comm_UserDatas.Instance.User_turn.Total_turn, current.Id);
                 Comm_UserDatas.Instance.Add_History(mem_history);
             }
         }
     }
     if (Utils.IsGameClear() && Comm_UserDatas.Instance.User_kdock.get_Count() > 0)
     {
         Comm_UserDatas.Instance.User_record.AddClearDifficult(Comm_UserDatas.Instance.User_basic.Difficult);
     }
     new Api_get_Member().StrategyInfo();
 }
Exemplo n.º 2
0
        public void LostArea(int maparea_id, List <int> sortieDeckRid)
        {
            Comm_UserDatas commInstance = Comm_UserDatas.Instance;

            if (sortieDeckRid == null)
            {
                sortieDeckRid = new List <int>();
            }
            List <int> lostArea = getLostArea(maparea_id);

            lostArea.ForEach(delegate(int lostAreaId)
            {
                Dictionary <int, Mem_mapclear> dictionary = (from x in commInstance.User_mapclear.Values
                                                             where x.Maparea_id == lostAreaId
                                                             select x).ToDictionary((Mem_mapclear x) => x.Mapinfo_no, (Mem_mapclear y) => y);
                int num = Mst_maparea.MaxMapNum(commInstance.User_basic.Difficult, lostAreaId);
                for (int i = 1; i <= num; i++)
                {
                    if (!dictionary.ContainsKey(i))
                    {
                        int mapinfo_id            = Mst_mapinfo.ConvertMapInfoId(lostAreaId, i);
                        Mem_mapclear mem_mapclear = new Mem_mapclear(mapinfo_id, lostAreaId, i, MapClearState.InvationClose);
                        mem_mapclear.Insert();
                        dictionary.Add(i, mem_mapclear);
                    }
                }
                lostMapClear(dictionary.Values.ToList(), Mst_DataManager.Instance.Mst_maparea[lostAreaId].Neighboring_area);
                Comm_UserDatas.Instance.User_rebellion_point.Remove(lostAreaId);
                List <Mem_tanker> areaTanker = Mem_tanker.GetAreaTanker(lostAreaId);
                lostTanker(areaTanker);
                IEnumerable <Mem_deck> memDeck = from x in commInstance.User_deck.Values
                                                 where x.Area_id == lostAreaId
                                                 select x;
                goBackDeck(memDeck, sortieDeckRid);
                Mem_esccort_deck escort = commInstance.User_EscortDeck[lostAreaId];
                goBackEscortDeck(escort);
                List <Mem_ndock> ndock = (from x in commInstance.User_ndock.Values
                                          where x.Area_id == lostAreaId
                                          select x).ToList();
                lostNdock(ndock);
                Dictionary <enumMaterialCategory, Mem_material> user_material = commInstance.User_material;
                lostMaterial(user_material);
                if (lostAreaId == 1)
                {
                    lostKdock();
                }
            });
        }
Exemplo n.º 3
0
        public static void OpenMapArea(int maparea_id, int mapinfo_no)
        {
            if (Comm_UserDatas.Instance.User_basic.Starttime == 0)
            {
                return;
            }
            if (!Mst_DataManager.Instance.Mst_maparea.ContainsKey(maparea_id))
            {
                return;
            }
            int num = Mst_mapinfo.ConvertMapInfoId(maparea_id, mapinfo_no);

            if (!Mst_DataManager.Instance.Mst_mapinfo.ContainsKey(num))
            {
                return;
            }
            Mem_mapclear mem_mapclear = null;

            if (Comm_UserDatas.Instance.User_mapclear.TryGetValue(num, ref mem_mapclear))
            {
                if (mem_mapclear.State == MapClearState.InvationClose)
                {
                    return;
                }
                if (mem_mapclear.State != MapClearState.Cleard)
                {
                    mem_mapclear.StateChange(MapClearState.Cleard);
                }
            }
            else
            {
                mem_mapclear = new Mem_mapclear(num, maparea_id, mapinfo_no, MapClearState.Cleard);
                mem_mapclear.Insert();
            }
            if (Utils.IsGameClear() && Comm_UserDatas.Instance.User_kdock.get_Count() > 0)
            {
                Comm_UserDatas.Instance.User_record.AddClearDifficult(Comm_UserDatas.Instance.User_basic.Difficult);
            }
            if (maparea_id != 1 && mapinfo_no == 1 && Mem_history.IsFirstOpenArea(num))
            {
                Mem_history mem_history = new Mem_history();
                mem_history.SetAreaOpen(Comm_UserDatas.Instance.User_turn.Total_turn, num);
                Comm_UserDatas.Instance.Add_History(mem_history);
            }
            List <int> list = new List <int>();

            new RebellionUtils().MapReOpen(mem_mapclear, out list);
        }
Exemplo n.º 4
0
        private bool updateMapComp(out List <int> diffMapOpen, out List <int> reOpenMap)
        {
            diffMapOpen = new List <int>();
            reOpenMap   = new List <int>();
            if (mst_enemy.Boss == 0)
            {
                return(false);
            }
            bool result = false;

            Dictionary <int, Mst_mapinfo> .KeyCollection keys = Utils.GetActiveMap().Keys;
            if (cleard == null)
            {
                cleard = new Mem_mapclear(mst_mapinfo.Id, mst_mapinfo.Maparea_id, mst_mapinfo.No, MapClearState.Cleard);
                cleard.Insert();
                result = true;
            }
            else
            {
                if (cleard.State != MapClearState.InvationOpen && cleard.State != MapClearState.InvationNeighbor)
                {
                    if (cleard.State == MapClearState.Cleard)
                    {
                        return(false);
                    }
                    return(false);
                }
                if (!cleard.Cleared)
                {
                    result = true;
                }
                cleard.StateChange(MapClearState.Cleard);
            }
            List <int> reOpenMap2 = null;

            new RebellionUtils().MapReOpen(cleard, out reOpenMap2);
            Dictionary <int, Mst_mapinfo> .KeyCollection keys2 = Utils.GetActiveMap().Keys;
            diffMapOpen = keys2.Except(keys).ToList();
            reOpenMap   = reOpenMap2.Intersect(diffMapOpen).ToList();
            foreach (int item in reOpenMap)
            {
                diffMapOpen.Remove(item);
            }
            return(result);
        }
Exemplo n.º 5
0
 public static void OpenMapAreaAll()
 {
     foreach (Mst_mapinfo value in Mst_DataManager.Instance.Mst_mapinfo.Values)
     {
         if (!Comm_UserDatas.Instance.User_mapclear.ContainsKey(value.Id))
         {
             Mem_mapclear mem_mapclear = new Mem_mapclear(value.Id, value.Maparea_id, value.No, MapClearState.Cleard);
             mem_mapclear.Insert();
         }
         if (value.Maparea_id != 1 && value.No == 1 && Mem_history.IsFirstOpenArea(value.Id))
         {
             Mem_history mem_history = new Mem_history();
             mem_history.SetAreaOpen(Comm_UserDatas.Instance.User_turn.Total_turn, value.Id);
             Comm_UserDatas.Instance.Add_History(mem_history);
         }
     }
     if (Utils.IsGameClear() && Comm_UserDatas.Instance.User_kdock.Count > 0)
     {
         Comm_UserDatas.Instance.User_record.AddClearDifficult(Comm_UserDatas.Instance.User_basic.Difficult);
     }
     new Api_get_Member().StrategyInfo();
 }