Пример #1
0
        /// <summary>
        /// FloorUIを更新
        /// </summary>
        public void InitFloor()
        {
            floorIndex = 0;
            floors     = new List <Button>();
            DungeonProcess process = gameManager.DungeonProcess;
            StageInfo      info    = stageInfo[dungeonIndex];
            int            limit   = 1;                     //制限階層

            if (process.HasKey(info.dungeonNo))             //攻略したことがあれば進捗で更新
            {
                limit = process.GetProcess()[info.dungeonNo];
            }

            int chooseFloor = info.totalFloor / info.bossRange;

            for (int i = 0; i < chooseFloor; i++)           //Buttonを作る
            {
                if ((1 + info.bossRange * i) > limit + 1)   //到達した階層以外は選択できない
                {
                    break;
                }

                Vector2 position = FLOOR_OFFSET + new Vector2(0, 25 * i + 35);
                Button  button   = new Button(position + new Vector2(0, 2), 280, 21);
                floors.Add(button);
            }
        }
Пример #2
0
        public void LoadStoreItem(ItemManager itemManager, DungeonProcess dungeonProcess)
        {
            FileStream   fs             = new FileStream(@"Content/" + "StoreItemCSV/StoreItem.csv", FileMode.Open); //設定ファイルを開く
            StreamReader sr             = new StreamReader(fs);
            List <int>   equipList      = new List <int>();
            List <int>   consuptionList = new List <int>();
            List <int>   accessaryList  = new List <int>();

            while (!sr.EndOfStream)                     //最後まで読み込む
            {
                string   line = sr.ReadLine();          //一行つず読み込む
                string[] data = line.Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
                if (data[0] == "Start")                 //最初の欄がStartの場合は定義用、Skipする
                {
                    continue;
                }
                if (data[0] == "End")                   //End以降は資料として使われないので、脱出
                {
                    break;
                }

                int dataDungeon = int.Parse(data[1]);   //ダンジョン番号
                int dataFloor   = int.Parse(data[2]);   //階層を読み取る

                if (dataDungeon != 0 && dataFloor != 0)
                {
                    //攻略したことのないダンジョン以降のアイテムを読み込む必要がない
                    if (!dungeonProcess.HasKey(dataDungeon))
                    {
                        continue;
                    }

                    //到達していない階層のアイテムを読み込む必要がない
                    if (dataFloor > dungeonProcess.GetProcess()[dataDungeon])
                    {
                        continue;
                    }
                }


                int id = int.Parse(data[4]);            //IDを読み取る
                if (data[3] == "equipment")             //装備アイテムの場合
                {
                    equipList.Add(id);
                }

                if (data[3] == "consuption")            //使用アイテムの場合
                {
                    consuptionList.Add(id);
                }
                if (data[3] == "accessary")
                {
                    accessaryList.Add(id);
                }
            }
            sr.Close();                                 //読み終わったらファイルをClose
            fs.Close();

            itemManager.Load(equipList.ToArray(), consuptionList.ToArray());        //Listを渡してDictionaryを作ってくれる
            for (int i = 0; i < accessaryList.Count; i++)
            {
                itemManager.LoadAccessary(accessaryList[i]);
            }
            isItemLoad = true;                                                      //読み終わった
        }
Пример #3
0
        public void Load(DungeonProcess dungeonProcess, bool loadAll = false)
        {
            FileStream   fs = new FileStream(@"Content/" + "QuestCSV/Quest.csv", FileMode.Open);    //設定ファイルを開く
            StreamReader sr = new StreamReader(fs, Encoding.GetEncoding("shift_jis"));

            while (!sr.EndOfStream)                     //最後まで読み込む
            {
                string   line = sr.ReadLine();          //一行つず読み込む
                string[] data = line.Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
                if (data[0] == "Start")                 //最初の欄がStartの場合は定義用、Skipする
                {
                    continue;
                }
                if (data[0] == "End")                   //End以降は資料として使われないので、脱出
                {
                    break;
                }

                int dungeonNo = int.Parse(data[9]);
                int floor     = int.Parse(data[10]);
                if (!loadAll)
                {
                    if (!dungeonProcess.HasKey(dungeonNo) && floor > 0)  //Clearしたことなかったら出現しない
                    {
                        continue;
                    }
                    if (dungeonProcess.HasKey(dungeonNo) &&
                        dungeonProcess.GetProcess()[dungeonNo] < floor)  //階層達していない
                    {
                        continue;
                    }
                }

                int    id   = int.Parse(data[0]);
                string type = data[1];
                string name = data[2];
                string info = data[3];
                info = info.Replace("nl", "\n");
                int difficulty = int.Parse(data[4]);
                int money      = int.Parse(data[5]);

                #region 報酬アイテム
                int count = 0;
                if (data[6] != "null")
                {
                    count++;
                }
                if (data[7] != "null")
                {
                    count++;
                }
                if (data[8] != "null")
                {
                    count++;
                }
                int[]    award     = null;
                string[] awardType = null;
                if (count > 0)
                {
                    award     = new int[count];
                    awardType = new string[count];
                    for (int i = 0; i < count; i++)
                    {
                        awardType[i] = data[6 + i][0].ToString();
                        char[] awardID = new char[data[6 + i].Length - 1];
                        data[6 + i].CopyTo(1, awardID, 0, data[6 + i].Length - 1);
                        award[i] = int.Parse(new string(awardID));
                    }
                }
                #endregion

                #region 条件
                count = 0;
                if (data[11] != "null")
                {
                    count++;
                }
                if (data[13] != "null")
                {
                    count++;
                }
                if (data[15] != "null")
                {
                    count++;
                }
                List <Requirement> requires = new List <Requirement>();
                for (int i = 0; i < count; i++)
                {
                    Requirement require = new Requirement(
                        int.Parse(data[i * 2 + 11]),
                        int.Parse(data[i * 2 + 12]));
                    requires.Add(require);
                }
                #endregion

                int exp = int.Parse(data[17]);

                if (type == "Collection")
                {
                    Quest collectionQuest = new CollectQuest(
                        id, name, info, difficulty, money, award, awardType,
                        requires, dungeonNo, floor, exp);
                    activeQuest.Add(collectionQuest);
                }
                else if (type == "Battle")
                {
                    Quest battleQuest = new BattleQuest(
                        id, name, info, difficulty, money, award, awardType,
                        requires, dungeonNo, floor, exp);
                    activeQuest.Add(battleQuest);
                }
            }
            sr.Close();                                 //読み終わったらファイルをClose
            fs.Close();

            isLoad = true;                              //読み終わった
        }