Exemple #1
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);
        }
Exemple #2
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);
        }