public static RDungeon LoadRDungeon(int dungeonNum) { RDungeon dungeon = new RDungeon(dungeonNum); string FilePath = IO.Paths.RDungeonsFolder + "rdungeon" + dungeonNum.ToString() + ".dat"; using (System.IO.StreamReader reader = new System.IO.StreamReader(FilePath)) { while (!(reader.EndOfStream)) { string[] parse = reader.ReadLine().Split('|'); switch (parse[0].ToLower()) { case "rdungeondata": if (parse[1].ToLower() != "v2") { reader.Close(); reader.Dispose(); return null; } break; case "data": dungeon.DungeonName = parse[1]; dungeon.Direction = (Enums.Direction)parse[2].ToInt(); dungeon.MaxFloors = parse[3].ToInt(); dungeon.Recruitment = parse[4].ToBool(); dungeon.Exp = parse[5].ToBool(); dungeon.WindTimer = parse[6].ToInt(); break; case "floor": { RDungeonFloor floor = new RDungeonFloor(); //floor.Options.TrapFrequency = parse[1].ToInt(); floor.Options.TrapMin = parse[2].ToInt(); floor.Options.TrapMax = parse[3].ToInt(); floor.Options.RoomWidthMin = parse[4].ToInt(); floor.Options.RoomWidthMax = parse[5].ToInt(); floor.Options.RoomLengthMin = parse[6].ToInt(); floor.Options.RoomLengthMax = parse[7].ToInt(); floor.Options.HallTurnMin = parse[8].ToInt(); floor.Options.HallTurnMax = parse[9].ToInt(); floor.Options.HallVarMin = parse[10].ToInt(); floor.Options.HallVarMax = parse[11].ToInt(); floor.Options.WaterFrequency = parse[12].ToInt(); floor.Options.Craters = parse[13].ToInt(); floor.Options.CraterMinLength = parse[14].ToInt(); floor.Options.CraterMaxLength = parse[15].ToInt(); floor.Options.CraterFuzzy = parse[16].ToBool(); floor.Darkness = parse[17].ToInt(); floor.GoalType = (Enums.RFloorGoalType)parse[18].ToInt(); floor.GoalMap = parse[19].ToInt(); floor.GoalX = parse[20].ToInt(); floor.GoalY = parse[21].ToInt(); floor.Music = parse[22]; #region terrain #region wall floor.StairsX = parse[23].ToInt(); floor.StairsSheet = parse[24].ToInt(); floor.mGroundX = parse[25].ToInt(); floor.mGroundSheet = parse[26].ToInt(); floor.mTopLeftX = parse[27].ToInt(); floor.mTopLeftSheet = parse[28].ToInt(); floor.mTopCenterX = parse[29].ToInt(); floor.mTopCenterSheet = parse[30].ToInt(); floor.mTopRightX = parse[31].ToInt(); floor.mTopRightSheet = parse[32].ToInt(); floor.mCenterLeftX = parse[33].ToInt(); floor.mCenterLeftSheet = parse[34].ToInt(); floor.mCenterCenterX = parse[35].ToInt(); floor.mCenterCenterSheet = parse[36].ToInt(); floor.mCenterRightX = parse[37].ToInt(); floor.mCenterRightSheet = parse[38].ToInt(); floor.mBottomLeftX = parse[39].ToInt(); floor.mBottomLeftSheet = parse[40].ToInt(); floor.mBottomCenterX = parse[41].ToInt(); floor.mBottomCenterSheet = parse[42].ToInt(); floor.mBottomRightX = parse[43].ToInt(); floor.mBottomRightSheet = parse[44].ToInt(); floor.mInnerTopLeftX = parse[45].ToInt(); floor.mInnerTopLeftSheet = parse[46].ToInt(); floor.mInnerBottomLeftX = parse[47].ToInt(); floor.mInnerBottomLeftSheet = parse[48].ToInt(); floor.mInnerTopRightX = parse[49].ToInt(); floor.mInnerTopRightSheet = parse[50].ToInt(); floor.mInnerBottomRightX = parse[51].ToInt(); floor.mInnerBottomRightSheet = parse[52].ToInt(); floor.mColumnTopX = parse[53].ToInt(); floor.mColumnTopSheet = parse[54].ToInt(); floor.mColumnCenterX = parse[55].ToInt(); floor.mColumnCenterSheet = parse[56].ToInt(); floor.mColumnBottomX = parse[57].ToInt(); floor.mColumnBottomSheet = parse[58].ToInt(); floor.mRowLeftX = parse[59].ToInt(); floor.mRowLeftSheet = parse[60].ToInt(); floor.mRowCenterX = parse[61].ToInt(); floor.mRowCenterSheet = parse[62].ToInt(); floor.mRowRightX = parse[63].ToInt(); floor.mRowRightSheet = parse[64].ToInt(); floor.mIsolatedWallX = parse[65].ToInt(); floor.mIsolatedWallSheet = parse[66].ToInt(); #endregion #region water floor.mWaterX = parse[67].ToInt(); floor.mWaterSheet = parse[68].ToInt(); floor.mWaterAnimX = parse[69].ToInt(); floor.mWaterAnimSheet = parse[70].ToInt(); floor.mShoreTopLeftX = parse[71].ToInt(); floor.mShoreTopLeftSheet = parse[72].ToInt(); floor.mShoreTopRightX = parse[73].ToInt(); floor.mShoreTopRightSheet = parse[74].ToInt(); floor.mShoreBottomRightX = parse[75].ToInt(); floor.mShoreBottomRightSheet = parse[76].ToInt(); floor.mShoreBottomLeftX = parse[77].ToInt(); floor.mShoreBottomLeftSheet = parse[78].ToInt(); floor.mShoreDiagonalForwardX = parse[79].ToInt(); floor.mShoreDiagonalForwardSheet = parse[80].ToInt(); floor.mShoreDiagonalBackX = parse[81].ToInt(); floor.mShoreDiagonalBackSheet = parse[82].ToInt(); floor.mShoreTopX = parse[83].ToInt(); floor.mShoreTopSheet = parse[84].ToInt(); floor.mShoreRightX = parse[85].ToInt(); floor.mShoreRightSheet = parse[86].ToInt(); floor.mShoreBottomX = parse[87].ToInt(); floor.mShoreBottomSheet = parse[88].ToInt(); floor.mShoreLeftX = parse[89].ToInt(); floor.mShoreLeftSheet = parse[90].ToInt(); floor.mShoreVerticalX = parse[91].ToInt(); floor.mShoreVerticalSheet = parse[92].ToInt(); floor.mShoreHorizontalX = parse[93].ToInt(); floor.mShoreHorizontalSheet = parse[94].ToInt(); floor.mShoreInnerTopLeftX = parse[95].ToInt(); floor.mShoreInnerTopLeftSheet = parse[96].ToInt(); floor.mShoreInnerTopRightX = parse[97].ToInt(); floor.mShoreInnerTopRightSheet = parse[98].ToInt(); floor.mShoreInnerBottomRightX = parse[99].ToInt(); floor.mShoreInnerBottomRightSheet = parse[100].ToInt(); floor.mShoreInnerBottomLeftX = parse[101].ToInt(); floor.mShoreInnerBottomLeftSheet = parse[102].ToInt(); floor.mShoreInnerTopX = parse[103].ToInt(); floor.mShoreInnerTopSheet = parse[104].ToInt(); floor.mShoreInnerRightX = parse[105].ToInt(); floor.mShoreInnerRightSheet = parse[106].ToInt(); floor.mShoreInnerBottomX = parse[107].ToInt(); floor.mShoreInnerBottomSheet = parse[108].ToInt(); floor.mShoreInnerLeftX = parse[109].ToInt(); floor.mShoreInnerLeftSheet = parse[110].ToInt(); floor.mShoreSurroundedX = parse[111].ToInt(); floor.mShoreSurroundedSheet = parse[112].ToInt(); #endregion #endregion floor.ItemSpawnRate = parse[113].ToInt(); int maxTraps = parse[114].ToInt(); int maxWeather = parse[115].ToInt(); int n = 116; for (int i = 0; i < 16; i++) { floor.Items[i] = parse[n].ToInt(); n++; } for (int i = 0; i < Constants.MAX_MAP_NPCS; i++) { floor.Npc[i].NpcNum = parse[n].ToInt(); floor.Npc[i].MinLevel = parse[n + 1].ToInt(); n+= 2; } for (int i = 0; i < maxTraps; i++) { floor.Traps.Add(parse[n].ToInt()); n++; } for (int i = 0; i < maxWeather; i++) { floor.Weather.Add((Enums.Weather)parse[n].ToInt()); n++; } dungeon.Floors.Add(floor); } break; } } } return dungeon; }
public static void SaveRDungeon(RDungeon rdungeon, int dungeonNum) { string Filepath = IO.Paths.RDungeonsFolder + "rdungeon" + dungeonNum.ToString() + ".dat"; using (System.IO.StreamWriter writer = new System.IO.StreamWriter(Filepath)) { writer.WriteLine("RDungeonData|V2"); writer.WriteLine("Data|" + rdungeon.DungeonName + "|" + ((int)rdungeon.Direction).ToString() + "|" + rdungeon.MaxFloors.ToString() + "|" + rdungeon.Recruitment.ToString() + "|" + rdungeon.Exp.ToString() + "|"+ rdungeon.WindTimer.ToString() + "|"); for (int i = 0; i < rdungeon.Floors.Count; i++) { string data = "Floor|" + "0" + "|" + rdungeon.Floors[i].Options.TrapMin.ToString() + "|" + rdungeon.Floors[i].Options.TrapMax.ToString() + "|" + rdungeon.Floors[i].Options.RoomWidthMin.ToString() + "|" + rdungeon.Floors[i].Options.RoomWidthMax.ToString() + "|" + rdungeon.Floors[i].Options.RoomLengthMin.ToString() + "|" + rdungeon.Floors[i].Options.RoomLengthMax.ToString() + "|" + rdungeon.Floors[i].Options.HallTurnMin.ToString() + "|" + rdungeon.Floors[i].Options.HallTurnMax.ToString() + "|" + rdungeon.Floors[i].Options.HallVarMin.ToString() + "|" + rdungeon.Floors[i].Options.HallVarMax.ToString() + "|" + rdungeon.Floors[i].Options.WaterFrequency.ToString() + "|" + rdungeon.Floors[i].Options.Craters.ToString() + "|" + rdungeon.Floors[i].Options.CraterMinLength.ToString() + "|" + rdungeon.Floors[i].Options.CraterMaxLength.ToString() + "|" + rdungeon.Floors[i].Options.CraterFuzzy.ToIntString() + "|" + rdungeon.Floors[i].Darkness.ToString() + "|" + ((int)rdungeon.Floors[i].GoalType).ToString() + "|" + rdungeon.Floors[i].GoalMap.ToString() + "|" + rdungeon.Floors[i].GoalX.ToString() + "|" + rdungeon.Floors[i].GoalY.ToString() + "|" + rdungeon.Floors[i].Music + "|" + rdungeon.Floors[i].StairsX.ToString() + "|" + rdungeon.Floors[i].StairsSheet.ToString() + "|" + rdungeon.Floors[i].mGroundX.ToString() + "|" + rdungeon.Floors[i].mGroundSheet.ToString() + "|" + rdungeon.Floors[i].mTopLeftX.ToString() + "|" + rdungeon.Floors[i].mTopLeftSheet.ToString() + "|" + rdungeon.Floors[i].mTopCenterX.ToString() + "|" + rdungeon.Floors[i].mTopCenterSheet.ToString() + "|" + rdungeon.Floors[i].mTopRightX.ToString() + "|" + rdungeon.Floors[i].mTopRightSheet.ToString() + "|" + rdungeon.Floors[i].mCenterLeftX.ToString() + "|" + rdungeon.Floors[i].mCenterLeftSheet.ToString() + "|" + rdungeon.Floors[i].mCenterCenterX.ToString() + "|" + rdungeon.Floors[i].mCenterCenterSheet.ToString() + "|" + rdungeon.Floors[i].mCenterRightX.ToString() + "|" + rdungeon.Floors[i].mCenterRightSheet.ToString() + "|" + rdungeon.Floors[i].mBottomLeftX.ToString() + "|" + rdungeon.Floors[i].mBottomLeftSheet.ToString() + "|" + rdungeon.Floors[i].mBottomCenterX.ToString() + "|" + rdungeon.Floors[i].mBottomCenterSheet.ToString() + "|" + rdungeon.Floors[i].mBottomRightX.ToString() + "|" + rdungeon.Floors[i].mBottomRightSheet.ToString() + "|" + rdungeon.Floors[i].mInnerTopLeftX.ToString() + "|" + rdungeon.Floors[i].mInnerTopLeftSheet.ToString() + "|" + rdungeon.Floors[i].mInnerBottomLeftX.ToString() + "|" + rdungeon.Floors[i].mInnerBottomLeftSheet.ToString() + "|" + rdungeon.Floors[i].mInnerTopRightX.ToString() + "|" + rdungeon.Floors[i].mInnerTopRightSheet.ToString() + "|" + rdungeon.Floors[i].mInnerBottomRightX.ToString() + "|" + rdungeon.Floors[i].mInnerBottomRightSheet.ToString() + "|" + rdungeon.Floors[i].mColumnTopX.ToString() + "|" + rdungeon.Floors[i].mColumnTopSheet.ToString() + "|" + rdungeon.Floors[i].mColumnCenterX.ToString() + "|" + rdungeon.Floors[i].mColumnCenterSheet.ToString() + "|" + rdungeon.Floors[i].mColumnBottomX.ToString() + "|" + rdungeon.Floors[i].mColumnBottomSheet.ToString() + "|" + rdungeon.Floors[i].mRowLeftX.ToString() + "|" + rdungeon.Floors[i].mRowLeftSheet.ToString() + "|" + rdungeon.Floors[i].mRowCenterX.ToString() + "|" + rdungeon.Floors[i].mRowCenterSheet.ToString() + "|" + rdungeon.Floors[i].mRowRightX.ToString() + "|" + rdungeon.Floors[i].mRowRightSheet.ToString() + "|" + rdungeon.Floors[i].mIsolatedWallX.ToString() + "|" + rdungeon.Floors[i].mIsolatedWallSheet.ToString() + "|" + rdungeon.Floors[i].mWaterX.ToString() + "|" + rdungeon.Floors[i].mWaterSheet.ToString() + "|" + rdungeon.Floors[i].mWaterAnimX.ToString() + "|" + rdungeon.Floors[i].mWaterAnimSheet.ToString() + "|" + rdungeon.Floors[i].mShoreTopLeftX.ToString() + "|" + rdungeon.Floors[i].mShoreTopLeftSheet.ToString() + "|" + rdungeon.Floors[i].mShoreTopRightX.ToString() + "|" + rdungeon.Floors[i].mShoreTopRightSheet.ToString() + "|" + rdungeon.Floors[i].mShoreBottomRightX.ToString() + "|" + rdungeon.Floors[i].mShoreBottomRightSheet.ToString() + "|" + rdungeon.Floors[i].mShoreBottomLeftX.ToString() + "|" + rdungeon.Floors[i].mShoreBottomLeftSheet.ToString() + "|" + rdungeon.Floors[i].mShoreDiagonalForwardX.ToString() + "|" + rdungeon.Floors[i].mShoreDiagonalForwardSheet.ToString() + "|" + rdungeon.Floors[i].mShoreDiagonalBackX.ToString() + "|" + rdungeon.Floors[i].mShoreDiagonalBackSheet.ToString() + "|" + rdungeon.Floors[i].mShoreTopX.ToString() + "|" + rdungeon.Floors[i].mShoreTopSheet.ToString() + "|" + rdungeon.Floors[i].mShoreRightX.ToString() + "|" + rdungeon.Floors[i].mShoreRightSheet.ToString() + "|" + rdungeon.Floors[i].mShoreBottomX.ToString() + "|" + rdungeon.Floors[i].mShoreBottomSheet.ToString() + "|" + rdungeon.Floors[i].mShoreLeftX.ToString() + "|" + rdungeon.Floors[i].mShoreLeftSheet.ToString() + "|" + rdungeon.Floors[i].mShoreVerticalX.ToString() + "|" + rdungeon.Floors[i].mShoreVerticalSheet.ToString() + "|" + rdungeon.Floors[i].mShoreHorizontalX.ToString() + "|" + rdungeon.Floors[i].mShoreHorizontalSheet.ToString() + "|" + rdungeon.Floors[i].mShoreInnerTopLeftX.ToString() + "|" + rdungeon.Floors[i].mShoreInnerTopLeftSheet.ToString() + "|" + rdungeon.Floors[i].mShoreInnerTopRightX.ToString() + "|" + rdungeon.Floors[i].mShoreInnerTopRightSheet.ToString() + "|" + rdungeon.Floors[i].mShoreInnerBottomRightX.ToString() + "|" + rdungeon.Floors[i].mShoreInnerBottomRightSheet.ToString() + "|" + rdungeon.Floors[i].mShoreInnerBottomLeftX.ToString() + "|" + rdungeon.Floors[i].mShoreInnerBottomLeftSheet.ToString() + "|" + rdungeon.Floors[i].mShoreInnerTopX.ToString() + "|" + rdungeon.Floors[i].mShoreInnerTopSheet.ToString() + "|" + rdungeon.Floors[i].mShoreInnerRightX.ToString() + "|" + rdungeon.Floors[i].mShoreInnerRightSheet.ToString() + "|" + rdungeon.Floors[i].mShoreInnerBottomX.ToString() + "|" + rdungeon.Floors[i].mShoreInnerBottomSheet.ToString() + "|" + rdungeon.Floors[i].mShoreInnerLeftX.ToString() + "|" + rdungeon.Floors[i].mShoreInnerLeftSheet.ToString() + "|" + rdungeon.Floors[i].mShoreSurroundedX.ToString() + "|" + rdungeon.Floors[i].mShoreSurroundedSheet.ToString() + "|" + rdungeon.Floors[i].ItemSpawnRate.ToString() + "|" + rdungeon.Floors[i].Traps.Count.ToString() + "|" + rdungeon.Floors[i].Weather.Count.ToString() + "|"; for (int item = 0; item < 16; item++) { data += rdungeon.Floors[i].Items[item].ToString() + "|"; } for (int npc = 0; npc < Constants.MAX_MAP_NPCS; npc++) { data += (rdungeon.Floors[i].Npc[npc].NpcNum.ToString() + "|" + rdungeon.Floors[i].Npc[npc].MinLevel.ToString() + "|"); } for (int trap = 0; trap < rdungeon.Floors[i].Traps.Count; trap++) { data += rdungeon.Floors[i].Traps[trap].ToString() + "|"; } for (int weather = 0; weather < rdungeon.Floors[i].Weather.Count; weather++) { data += ((int)rdungeon.Floors[i].Weather[weather]).ToString() + "|"; } writer.WriteLine(data); } } }
public static RDungeon LoadRDungeon(int dungeonNum) { RDungeon dungeon = new RDungeon(dungeonNum); string FilePath = IO.Paths.RDungeonsFolder + "rdungeon" + dungeonNum.ToString() + ".dat"; using (System.IO.StreamReader reader = new System.IO.StreamReader(FilePath)) { while (!(reader.EndOfStream)) { string[] parse = reader.ReadLine().Split('|'); switch (parse[0].ToLower()) { case "rdungeondata": if (parse[1].ToLower() != "v1") { reader.Close(); reader.Dispose(); return null; } break; case "data": dungeon.DungeonName = parse[1]; dungeon.Direction = (Enums.Direction)parse[2].ToInt(); dungeon.MaxFloors = parse[3].ToInt(); dungeon.Recruitment = parse[4].ToBool(); dungeon.Exp = parse[5].ToBool(); break; case "terrain": { #region Terrain dungeon.StairsX = parse[1].ToInt(); dungeon.StairsSheet = parse[2].ToInt(); dungeon.mGroundX = parse[3].ToInt(); dungeon.mGroundSheet = parse[4].ToInt(); dungeon.mTopLeftX = parse[5].ToInt(); dungeon.mTopLeftSheet = parse[6].ToInt(); dungeon.mTopCenterX = parse[7].ToInt(); dungeon.mTopCenterSheet = parse[8].ToInt(); dungeon.mTopRightX = parse[9].ToInt(); dungeon.mTopRightSheet = parse[10].ToInt(); dungeon.mCenterLeftX = parse[11].ToInt(); dungeon.mCenterLeftSheet = parse[12].ToInt(); dungeon.mCenterCenterX = parse[13].ToInt(); dungeon.mCenterCenterSheet = parse[14].ToInt(); dungeon.mCenterRightX = parse[15].ToInt(); dungeon.mCenterRightSheet = parse[16].ToInt(); dungeon.mBottomLeftX = parse[17].ToInt(); dungeon.mBottomLeftSheet = parse[18].ToInt(); dungeon.mBottomCenterX = parse[19].ToInt(); dungeon.mBottomCenterSheet = parse[20].ToInt(); dungeon.mBottomRightX = parse[21].ToInt(); dungeon.mBottomRightSheet = parse[22].ToInt(); dungeon.mInnerTopLeftX = parse[23].ToInt(); dungeon.mInnerTopLeftSheet = parse[24].ToInt(); dungeon.mInnerBottomLeftX = parse[25].ToInt(); dungeon.mInnerBottomLeftSheet = parse[26].ToInt(); dungeon.mInnerTopRightX = parse[27].ToInt(); dungeon.mInnerTopRightSheet = parse[28].ToInt(); dungeon.mInnerBottomRightX = parse[29].ToInt(); dungeon.mInnerBottomRightSheet = parse[30].ToInt(); if (parse.Length > 32) { dungeon.mWaterX = parse[31].ToInt(); dungeon.mWaterSheet = parse[32].ToInt(); dungeon.mWaterAnimX = parse[33].ToInt(); dungeon.mWaterAnimSheet = parse[34].ToInt(); dungeon.mIsolatedWallX = parse[35].ToInt(); dungeon.mIsolatedWallSheet = parse[36].ToInt(); dungeon.mColumnTopX = parse[37].ToInt(); dungeon.mColumnTopSheet = parse[38].ToInt(); dungeon.mColumnCenterX = parse[39].ToInt(); dungeon.mColumnCenterSheet = parse[40].ToInt(); dungeon.mColumnBottomX = parse[41].ToInt(); dungeon.mColumnBottomSheet = parse[42].ToInt(); dungeon.mRowLeftX = parse[43].ToInt(); dungeon.mRowLeftSheet = parse[44].ToInt(); dungeon.mRowCenterX = parse[45].ToInt(); dungeon.mRowCenterSheet = parse[46].ToInt(); if (parse.Length > 48) { dungeon.mRowRightX = parse[47].ToInt(); dungeon.mRowRightSheet = parse[48].ToInt(); if (parse.Length > 50) { dungeon.mShoreTopLeftX = parse[49].ToInt(); dungeon.mShoreTopLeftSheet = parse[50].ToInt(); dungeon.mShoreTopRightX = parse[51].ToInt(); dungeon.mShoreTopRightSheet = parse[52].ToInt(); dungeon.mShoreBottomRightX = parse[53].ToInt(); dungeon.mShoreBottomRightSheet = parse[54].ToInt(); dungeon.mShoreBottomLeftX = parse[55].ToInt(); dungeon.mShoreBottomLeftSheet = parse[56].ToInt(); dungeon.mShoreDiagonalForwardX = parse[57].ToInt(); dungeon.mShoreDiagonalForwardSheet = parse[58].ToInt(); dungeon.mShoreDiagonalBackX = parse[59].ToInt(); dungeon.mShoreDiagonalBackSheet = parse[60].ToInt(); dungeon.mShoreTopX = parse[61].ToInt(); dungeon.mShoreTopSheet = parse[62].ToInt(); dungeon.mShoreRightX = parse[63].ToInt(); dungeon.mShoreRightSheet = parse[64].ToInt(); dungeon.mShoreBottomX = parse[65].ToInt(); dungeon.mShoreBottomSheet = parse[66].ToInt(); dungeon.mShoreLeftX = parse[67].ToInt(); dungeon.mShoreLeftSheet = parse[68].ToInt(); dungeon.mShoreVerticalX = parse[69].ToInt(); dungeon.mShoreVerticalSheet = parse[70].ToInt(); dungeon.mShoreHorizontalX = parse[71].ToInt(); dungeon.mShoreHorizontalSheet = parse[72].ToInt(); dungeon.mShoreInnerTopLeftX = parse[73].ToInt(); dungeon.mShoreInnerTopLeftSheet = parse[74].ToInt(); dungeon.mShoreInnerTopRightX = parse[75].ToInt(); dungeon.mShoreInnerTopRightSheet = parse[76].ToInt(); dungeon.mShoreInnerBottomRightX = parse[77].ToInt(); dungeon.mShoreInnerBottomRightSheet = parse[78].ToInt(); dungeon.mShoreInnerBottomLeftX = parse[79].ToInt(); dungeon.mShoreInnerBottomLeftSheet = parse[80].ToInt(); dungeon.mShoreInnerTopX = parse[81].ToInt(); dungeon.mShoreInnerTopSheet = parse[82].ToInt(); dungeon.mShoreInnerRightX = parse[83].ToInt(); dungeon.mShoreInnerRightSheet = parse[84].ToInt(); dungeon.mShoreInnerBottomX = parse[85].ToInt(); dungeon.mShoreInnerBottomSheet = parse[86].ToInt(); dungeon.mShoreInnerLeftX = parse[87].ToInt(); dungeon.mShoreInnerLeftSheet = parse[88].ToInt(); dungeon.mShoreSurroundedX = parse[89].ToInt(); dungeon.mShoreSurroundedSheet = parse[90].ToInt(); } } } #endregion } break; case "floor": { RDungeonFloor floor = new RDungeonFloor(); floor.WeatherIntensity = parse[1].ToInt(); floor.Weather = (Enums.Weather)parse[2].ToInt(); floor.Music = parse[3]; floor.GoalType = (Enums.RFloorGoalType)parse[4].ToInt(); floor.GoalMap = parse[5].ToInt(); floor.GoalX = parse[6].ToInt(); floor.GoalY = parse[7].ToInt(); floor.ItemSpawnRate = parse[8].ToInt(); int maxTraps = parse[9].ToInt(); int n = 10; for (int i = 0; i < 15; i++) { floor.Npc[i] = parse[n].ToInt(); n++; } for (int i = 0; i < 8; i++) { floor.Items[i] = parse[n].ToInt(); n++; } for (int i = 0; i < maxTraps; i++) { floor.Traps.Add(parse[n].ToInt()); n++; } dungeon.Floors.Add(floor); } break; case "cratersettings": { dungeon.Options.Craters = parse[1].ToInt(); dungeon.Options.CraterMinLength = parse[2].ToInt(); dungeon.Options.CraterMaxLength = parse[3].ToInt(); dungeon.Options.CraterFuzzy = parse[4].ToBool(); } break; } } } return dungeon; }
public static void SendEditRDungeonTo(Client client, int dungeonIndex) { RDungeons.RDungeon dungeon = RDungeons.RDungeonManager.RDungeons[dungeonIndex]; TcpPacket packet = new TcpPacket("editrdungeon"); packet.AppendParameter(dungeonIndex.ToString()); if (dungeon == null) dungeon = new RDungeon(dungeonIndex); packet.AppendParameters(dungeon.DungeonName, ((int)dungeon.Direction).ToString(), dungeon.Floors.Count.ToString(), dungeon.Recruitment.ToIntString(), dungeon.Exp.ToIntString(), dungeon.WindTimer.ToString(), dungeon.DungeonIndex.ToString()); for (int i = 0; i < dungeon.Floors.Count; i++) { //Generator Options packet.AppendParameters(dungeon.Floors[i].Options.TrapMin.ToString(), dungeon.Floors[i].Options.TrapMax.ToString(), dungeon.Floors[i].Options.ItemMin.ToString(), dungeon.Floors[i].Options.ItemMax.ToString(), dungeon.Floors[i].Options.Intricacy.ToString(), dungeon.Floors[i].Options.RoomWidthMin.ToString(), dungeon.Floors[i].Options.RoomWidthMax.ToString(), dungeon.Floors[i].Options.RoomLengthMin.ToString(), dungeon.Floors[i].Options.RoomLengthMax.ToString(), dungeon.Floors[i].Options.HallTurnMin.ToString(), dungeon.Floors[i].Options.HallTurnMax.ToString(), dungeon.Floors[i].Options.HallVarMin.ToString(), dungeon.Floors[i].Options.HallVarMax.ToString(), dungeon.Floors[i].Options.WaterFrequency.ToString(), dungeon.Floors[i].Options.Craters.ToString(), dungeon.Floors[i].Options.CraterMinLength.ToString(), dungeon.Floors[i].Options.CraterMaxLength.ToString(), dungeon.Floors[i].Options.CraterFuzzy.ToIntString(), dungeon.Floors[i].Options.MinChambers.ToString(), dungeon.Floors[i].Options.MaxChambers.ToString()); packet.AppendParameters(dungeon.Floors[i].Darkness, (int)dungeon.Floors[i].GoalType, dungeon.Floors[i].GoalMap, dungeon.Floors[i].GoalX, dungeon.Floors[i].GoalY); packet.AppendParameter(dungeon.Floors[i].Music); //Terrain packet.AppendParameters(dungeon.Floors[i].StairsX.ToString(), dungeon.Floors[i].StairsSheet.ToString(), dungeon.Floors[i].mGroundX.ToString(), dungeon.Floors[i].mGroundSheet.ToString(), dungeon.Floors[i].mTopLeftX.ToString(), dungeon.Floors[i].mTopLeftSheet.ToString(), dungeon.Floors[i].mTopCenterX.ToString(), dungeon.Floors[i].mTopCenterSheet.ToString(), dungeon.Floors[i].mTopRightX.ToString(), dungeon.Floors[i].mTopRightSheet.ToString(), dungeon.Floors[i].mCenterLeftX.ToString(), dungeon.Floors[i].mCenterLeftSheet.ToString(), dungeon.Floors[i].mCenterCenterX.ToString(), dungeon.Floors[i].mCenterCenterSheet.ToString(), dungeon.Floors[i].mCenterRightX.ToString(), dungeon.Floors[i].mCenterRightSheet.ToString(), dungeon.Floors[i].mBottomLeftX.ToString(), dungeon.Floors[i].mBottomLeftSheet.ToString(), dungeon.Floors[i].mBottomCenterX.ToString(), dungeon.Floors[i].mBottomCenterSheet.ToString(), dungeon.Floors[i].mBottomRightX.ToString(), dungeon.Floors[i].mBottomRightSheet.ToString(), dungeon.Floors[i].mInnerTopLeftX.ToString(), dungeon.Floors[i].mInnerTopLeftSheet.ToString(), dungeon.Floors[i].mInnerBottomLeftX.ToString(), dungeon.Floors[i].mInnerBottomLeftSheet.ToString(), dungeon.Floors[i].mInnerTopRightX.ToString(), dungeon.Floors[i].mInnerTopRightSheet.ToString(), dungeon.Floors[i].mInnerBottomRightX.ToString(), dungeon.Floors[i].mInnerBottomRightSheet.ToString(), dungeon.Floors[i].mIsolatedWallX.ToString(), dungeon.Floors[i].mIsolatedWallSheet.ToString(), dungeon.Floors[i].mColumnTopX.ToString(), dungeon.Floors[i].mColumnTopSheet.ToString(), dungeon.Floors[i].mColumnCenterX.ToString(), dungeon.Floors[i].mColumnCenterSheet.ToString(), dungeon.Floors[i].mColumnBottomX.ToString(), dungeon.Floors[i].mColumnBottomSheet.ToString(), dungeon.Floors[i].mRowLeftX.ToString(), dungeon.Floors[i].mRowLeftSheet.ToString(), dungeon.Floors[i].mRowCenterX.ToString(), dungeon.Floors[i].mRowCenterSheet.ToString(), dungeon.Floors[i].mRowRightX.ToString(), dungeon.Floors[i].mRowRightSheet.ToString()); packet.AppendParameters(dungeon.Floors[i].mGroundAltX.ToString(), dungeon.Floors[i].mGroundAltSheet.ToString(), dungeon.Floors[i].mGroundAlt2X.ToString(), dungeon.Floors[i].mGroundAlt2Sheet.ToString(), dungeon.Floors[i].mTopLeftAltX.ToString(), dungeon.Floors[i].mTopLeftAltSheet.ToString(), dungeon.Floors[i].mTopCenterAltX.ToString(), dungeon.Floors[i].mTopCenterAltSheet.ToString(), dungeon.Floors[i].mTopRightAltX.ToString(), dungeon.Floors[i].mTopRightAltSheet.ToString(), dungeon.Floors[i].mCenterLeftAltX.ToString(), dungeon.Floors[i].mCenterLeftAltSheet.ToString(), dungeon.Floors[i].mCenterCenterAltX.ToString(), dungeon.Floors[i].mCenterCenterAltSheet.ToString(), dungeon.Floors[i].mCenterCenterAlt2X.ToString(), dungeon.Floors[i].mCenterCenterAlt2Sheet.ToString(), dungeon.Floors[i].mCenterRightAltX.ToString(), dungeon.Floors[i].mCenterRightAltSheet.ToString(), dungeon.Floors[i].mBottomLeftAltX.ToString(), dungeon.Floors[i].mBottomLeftAltSheet.ToString(), dungeon.Floors[i].mBottomCenterAltX.ToString(), dungeon.Floors[i].mBottomCenterAltSheet.ToString(), dungeon.Floors[i].mBottomRightAltX.ToString(), dungeon.Floors[i].mBottomRightAltSheet.ToString(), dungeon.Floors[i].mInnerTopLeftAltX.ToString(), dungeon.Floors[i].mInnerTopLeftAltSheet.ToString(), dungeon.Floors[i].mInnerBottomLeftAltX.ToString(), dungeon.Floors[i].mInnerBottomLeftAltSheet.ToString(), dungeon.Floors[i].mInnerTopRightAltX.ToString(), dungeon.Floors[i].mInnerTopRightAltSheet.ToString(), dungeon.Floors[i].mInnerBottomRightAltX.ToString(), dungeon.Floors[i].mInnerBottomRightAltSheet.ToString(), dungeon.Floors[i].mIsolatedWallAltX.ToString(), dungeon.Floors[i].mIsolatedWallAltSheet.ToString(), dungeon.Floors[i].mColumnTopAltX.ToString(), dungeon.Floors[i].mColumnTopAltSheet.ToString(), dungeon.Floors[i].mColumnCenterAltX.ToString(), dungeon.Floors[i].mColumnCenterAltSheet.ToString(), dungeon.Floors[i].mColumnBottomAltX.ToString(), dungeon.Floors[i].mColumnBottomAltSheet.ToString(), dungeon.Floors[i].mRowLeftAltX.ToString(), dungeon.Floors[i].mRowLeftAltSheet.ToString(), dungeon.Floors[i].mRowCenterAltX.ToString(), dungeon.Floors[i].mRowCenterAltSheet.ToString(), dungeon.Floors[i].mRowRightAltX.ToString(), dungeon.Floors[i].mRowRightAltSheet.ToString()); packet.AppendParameters(dungeon.Floors[i].mWaterX.ToString(), dungeon.Floors[i].mWaterSheet.ToString(), dungeon.Floors[i].mWaterAnimX.ToString(), dungeon.Floors[i].mWaterAnimSheet.ToString(), dungeon.Floors[i].mShoreTopLeftX.ToString(), dungeon.Floors[i].mShoreTopLeftSheet.ToString(), dungeon.Floors[i].mShoreTopRightX.ToString(), dungeon.Floors[i].mShoreTopRightSheet.ToString(), dungeon.Floors[i].mShoreBottomRightX.ToString(), dungeon.Floors[i].mShoreBottomRightSheet.ToString(), dungeon.Floors[i].mShoreBottomLeftX.ToString(), dungeon.Floors[i].mShoreBottomLeftSheet.ToString(), dungeon.Floors[i].mShoreDiagonalForwardX.ToString(), dungeon.Floors[i].mShoreDiagonalForwardSheet.ToString(), dungeon.Floors[i].mShoreDiagonalBackX.ToString(), dungeon.Floors[i].mShoreDiagonalBackSheet.ToString(), dungeon.Floors[i].mShoreTopX.ToString(), dungeon.Floors[i].mShoreTopSheet.ToString(), dungeon.Floors[i].mShoreRightX.ToString(), dungeon.Floors[i].mShoreRightSheet.ToString(), dungeon.Floors[i].mShoreBottomX.ToString(), dungeon.Floors[i].mShoreBottomSheet.ToString(), dungeon.Floors[i].mShoreLeftX.ToString(), dungeon.Floors[i].mShoreLeftSheet.ToString(), dungeon.Floors[i].mShoreVerticalX.ToString(), dungeon.Floors[i].mShoreVerticalSheet.ToString(), dungeon.Floors[i].mShoreHorizontalX.ToString(), dungeon.Floors[i].mShoreHorizontalSheet.ToString(), dungeon.Floors[i].mShoreInnerTopLeftX.ToString(), dungeon.Floors[i].mShoreInnerTopLeftSheet.ToString(), dungeon.Floors[i].mShoreInnerTopRightX.ToString(), dungeon.Floors[i].mShoreInnerTopRightSheet.ToString(), dungeon.Floors[i].mShoreInnerBottomRightX.ToString(), dungeon.Floors[i].mShoreInnerBottomRightSheet.ToString(), dungeon.Floors[i].mShoreInnerBottomLeftX.ToString(), dungeon.Floors[i].mShoreInnerBottomLeftSheet.ToString(), dungeon.Floors[i].mShoreInnerTopX.ToString(), dungeon.Floors[i].mShoreInnerTopSheet.ToString(), dungeon.Floors[i].mShoreInnerRightX.ToString(), dungeon.Floors[i].mShoreInnerRightSheet.ToString(), dungeon.Floors[i].mShoreInnerBottomX.ToString(), dungeon.Floors[i].mShoreInnerBottomSheet.ToString(), dungeon.Floors[i].mShoreInnerLeftX.ToString(), dungeon.Floors[i].mShoreInnerLeftSheet.ToString(), dungeon.Floors[i].mShoreSurroundedX.ToString(), dungeon.Floors[i].mShoreSurroundedSheet.ToString()); packet.AppendParameters(dungeon.Floors[i].mShoreTopLeftAnimX.ToString(), dungeon.Floors[i].mShoreTopLeftAnimSheet.ToString(), dungeon.Floors[i].mShoreTopRightAnimX.ToString(), dungeon.Floors[i].mShoreTopRightAnimSheet.ToString(), dungeon.Floors[i].mShoreBottomRightAnimX.ToString(), dungeon.Floors[i].mShoreBottomRightAnimSheet.ToString(), dungeon.Floors[i].mShoreBottomLeftAnimX.ToString(), dungeon.Floors[i].mShoreBottomLeftAnimSheet.ToString(), dungeon.Floors[i].mShoreDiagonalForwardAnimX.ToString(), dungeon.Floors[i].mShoreDiagonalForwardAnimSheet.ToString(), dungeon.Floors[i].mShoreDiagonalBackAnimX.ToString(), dungeon.Floors[i].mShoreDiagonalBackAnimSheet.ToString(), dungeon.Floors[i].mShoreTopAnimX.ToString(), dungeon.Floors[i].mShoreTopAnimSheet.ToString(), dungeon.Floors[i].mShoreRightAnimX.ToString(), dungeon.Floors[i].mShoreRightAnimSheet.ToString(), dungeon.Floors[i].mShoreBottomAnimX.ToString(), dungeon.Floors[i].mShoreBottomAnimSheet.ToString(), dungeon.Floors[i].mShoreLeftAnimX.ToString(), dungeon.Floors[i].mShoreLeftAnimSheet.ToString(), dungeon.Floors[i].mShoreVerticalAnimX.ToString(), dungeon.Floors[i].mShoreVerticalAnimSheet.ToString(), dungeon.Floors[i].mShoreHorizontalAnimX.ToString(), dungeon.Floors[i].mShoreHorizontalAnimSheet.ToString(), dungeon.Floors[i].mShoreInnerTopLeftAnimX.ToString(), dungeon.Floors[i].mShoreInnerTopLeftAnimSheet.ToString(), dungeon.Floors[i].mShoreInnerTopRightAnimX.ToString(), dungeon.Floors[i].mShoreInnerTopRightAnimSheet.ToString(), dungeon.Floors[i].mShoreInnerBottomRightAnimX.ToString(), dungeon.Floors[i].mShoreInnerBottomRightAnimSheet.ToString(), dungeon.Floors[i].mShoreInnerBottomLeftAnimX.ToString(), dungeon.Floors[i].mShoreInnerBottomLeftAnimSheet.ToString(), dungeon.Floors[i].mShoreInnerTopAnimX.ToString(), dungeon.Floors[i].mShoreInnerTopAnimSheet.ToString(), dungeon.Floors[i].mShoreInnerRightAnimX.ToString(), dungeon.Floors[i].mShoreInnerRightAnimSheet.ToString(), dungeon.Floors[i].mShoreInnerBottomAnimX.ToString(), dungeon.Floors[i].mShoreInnerBottomAnimSheet.ToString(), dungeon.Floors[i].mShoreInnerLeftAnimX.ToString(), dungeon.Floors[i].mShoreInnerLeftAnimSheet.ToString(), dungeon.Floors[i].mShoreSurroundedAnimX.ToString(), dungeon.Floors[i].mShoreSurroundedAnimSheet.ToString()); packet.AppendParameters(((int)dungeon.Floors[i].GroundTile.Type).ToString(), dungeon.Floors[i].GroundTile.Data1.ToString(), dungeon.Floors[i].GroundTile.Data2.ToString(), dungeon.Floors[i].GroundTile.Data3.ToString(), dungeon.Floors[i].GroundTile.String1, dungeon.Floors[i].GroundTile.String2, dungeon.Floors[i].GroundTile.String3, ((int)dungeon.Floors[i].HallTile.Type).ToString(), dungeon.Floors[i].HallTile.Data1.ToString(), dungeon.Floors[i].HallTile.Data2.ToString(), dungeon.Floors[i].HallTile.Data3.ToString(), dungeon.Floors[i].HallTile.String1, dungeon.Floors[i].HallTile.String2, dungeon.Floors[i].HallTile.String3, ((int)dungeon.Floors[i].WaterTile.Type).ToString(), dungeon.Floors[i].WaterTile.Data1.ToString(), dungeon.Floors[i].WaterTile.Data2.ToString(), dungeon.Floors[i].WaterTile.Data3.ToString(), dungeon.Floors[i].WaterTile.String1, dungeon.Floors[i].WaterTile.String2, dungeon.Floors[i].WaterTile.String3, ((int)dungeon.Floors[i].WallTile.Type).ToString(), dungeon.Floors[i].WallTile.Data1.ToString(), dungeon.Floors[i].WallTile.Data2.ToString(), dungeon.Floors[i].WallTile.Data3.ToString(), dungeon.Floors[i].WallTile.String1, dungeon.Floors[i].WallTile.String2, dungeon.Floors[i].WallTile.String3, dungeon.Floors[i].NpcSpawnTime.ToString(), dungeon.Floors[i].NpcMin.ToString(), dungeon.Floors[i].NpcMax.ToString()); packet.AppendParameter(dungeon.Floors[i].Items.Count); for (int item = 0; item < dungeon.Floors[i].Items.Count; item++) { packet.AppendParameters(dungeon.Floors[i].Items[item].ItemNum.ToString(), dungeon.Floors[i].Items[item].MinAmount.ToString(), dungeon.Floors[i].Items[item].MaxAmount.ToString(), dungeon.Floors[i].Items[item].AppearanceRate.ToString(), dungeon.Floors[i].Items[item].StickyRate.ToString(), dungeon.Floors[i].Items[item].Tag, dungeon.Floors[i].Items[item].Hidden.ToIntString(), dungeon.Floors[i].Items[item].OnGround.ToIntString(), dungeon.Floors[i].Items[item].OnWater.ToIntString(), dungeon.Floors[i].Items[item].OnWall.ToIntString()); } packet.AppendParameter(dungeon.Floors[i].Npcs.Count); for (int npc = 0; npc < dungeon.Floors[i].Npcs.Count; npc++) { packet.AppendParameters(dungeon.Floors[i].Npcs[npc].NpcNum.ToString(), dungeon.Floors[i].Npcs[npc].MinLevel.ToString(), dungeon.Floors[i].Npcs[npc].MaxLevel.ToString(), dungeon.Floors[i].Npcs[npc].AppearanceRate.ToString(), ((int)dungeon.Floors[i].Npcs[npc].StartStatus).ToString(), dungeon.Floors[i].Npcs[npc].StartStatusCounter.ToString(), dungeon.Floors[i].Npcs[npc].StartStatusChance.ToString()); } packet.AppendParameter(dungeon.Floors[i].SpecialTiles.Count); for (int trap = 0; trap < dungeon.Floors[i].SpecialTiles.Count; trap++) { packet.AppendParameters(((int)dungeon.Floors[i].SpecialTiles[trap].Type).ToString(), dungeon.Floors[i].SpecialTiles[trap].Data1.ToString(), dungeon.Floors[i].SpecialTiles[trap].Data2.ToString(), dungeon.Floors[i].SpecialTiles[trap].Data3.ToString(), dungeon.Floors[i].SpecialTiles[trap].String1, dungeon.Floors[i].SpecialTiles[trap].String2, dungeon.Floors[i].SpecialTiles[trap].String3, dungeon.Floors[i].SpecialTiles[trap].Ground.ToString(), dungeon.Floors[i].SpecialTiles[trap].GroundSet.ToString(), dungeon.Floors[i].SpecialTiles[trap].GroundAnim.ToString(), dungeon.Floors[i].SpecialTiles[trap].GroundAnimSet.ToString(), dungeon.Floors[i].SpecialTiles[trap].Mask.ToString(), dungeon.Floors[i].SpecialTiles[trap].MaskSet.ToString(), dungeon.Floors[i].SpecialTiles[trap].Anim.ToString(), dungeon.Floors[i].SpecialTiles[trap].AnimSet.ToString(), dungeon.Floors[i].SpecialTiles[trap].Mask2.ToString(), dungeon.Floors[i].SpecialTiles[trap].Mask2Set.ToString(), dungeon.Floors[i].SpecialTiles[trap].M2Anim.ToString(), dungeon.Floors[i].SpecialTiles[trap].M2AnimSet.ToString(), dungeon.Floors[i].SpecialTiles[trap].Fringe.ToString(), dungeon.Floors[i].SpecialTiles[trap].FringeSet.ToString(), dungeon.Floors[i].SpecialTiles[trap].FAnim.ToString(), dungeon.Floors[i].SpecialTiles[trap].FAnimSet.ToString(), dungeon.Floors[i].SpecialTiles[trap].Fringe2.ToString(), dungeon.Floors[i].SpecialTiles[trap].Fringe2Set.ToString(), dungeon.Floors[i].SpecialTiles[trap].F2Anim.ToString(), dungeon.Floors[i].SpecialTiles[trap].F2AnimSet.ToString(), dungeon.Floors[i].SpecialTiles[trap].RDungeonMapValue.ToString(), dungeon.Floors[i].SpecialTiles[trap].AppearanceRate.ToString()); } packet.AppendParameter(dungeon.Floors[i].Weather.Count); for (int weather = 0; weather < dungeon.Floors[i].Weather.Count; weather++) { packet.AppendParameters(((int)dungeon.Floors[i].Weather[weather]).ToString()); } packet.AppendParameter(dungeon.Floors[i].Options.Chambers.Count); for (int chamber = 0; chamber < dungeon.Floors[i].Options.Chambers.Count; chamber++) { packet.AppendParameters(dungeon.Floors[i].Options.Chambers[chamber].ChamberNum.ToString(), dungeon.Floors[i].Options.Chambers[chamber].String1, dungeon.Floors[i].Options.Chambers[chamber].String2, dungeon.Floors[i].Options.Chambers[chamber].String3); } } packet.FinalizePacket(); SendDataTo(client, packet, true, false); }
public static void SaveRDungeon(RDungeon rdungeon, int dungeonNum) { string Filepath = IO.Paths.RDungeonsFolder + "rdungeon" + dungeonNum.ToString() + ".dat"; using (System.IO.StreamWriter writer = new System.IO.StreamWriter(Filepath)) { writer.WriteLine("RDungeonData|V1"); writer.WriteLine("Data|" + rdungeon.DungeonName + "|" + ((int)rdungeon.Direction).ToString() + "|" + rdungeon.MaxFloors.ToString() + "|" + rdungeon.Recruitment.ToString() + "|" + rdungeon.Exp.ToString() + "|"); writer.WriteLine("Terrain|" + rdungeon.StairsX.ToString() + "|" + rdungeon.StairsSheet.ToString() + "|" + rdungeon.mGroundX.ToString() + "|" + rdungeon.mGroundSheet.ToString() + "|" + rdungeon.mTopLeftX.ToString() + "|" + rdungeon.mTopLeftSheet.ToString() + "|" + rdungeon.mTopCenterX.ToString() + "|" + rdungeon.mTopCenterSheet.ToString() + "|" + rdungeon.mTopRightX.ToString() + "|" + rdungeon.mTopRightSheet.ToString() + "|" + rdungeon.mCenterLeftX.ToString() + "|" + rdungeon.mCenterLeftSheet.ToString() + "|" + rdungeon.mCenterCenterX.ToString() + "|" + rdungeon.mCenterCenterSheet.ToString() + "|" + rdungeon.mCenterRightX.ToString() + "|" + rdungeon.mCenterRightSheet.ToString() + "|" + rdungeon.mBottomLeftX.ToString() + "|" + rdungeon.mBottomLeftSheet.ToString() + "|" + rdungeon.mBottomCenterX.ToString() + "|" + rdungeon.mBottomCenterSheet.ToString() + "|" + rdungeon.mBottomRightX.ToString() + "|" + rdungeon.mBottomRightSheet.ToString() + "|" + rdungeon.mInnerTopLeftX.ToString() + "|" + rdungeon.mInnerTopLeftSheet.ToString() + "|" + rdungeon.mInnerBottomLeftX.ToString() + "|" + rdungeon.mInnerBottomLeftSheet.ToString() + "|" + rdungeon.mInnerTopRightX.ToString() + "|" + rdungeon.mInnerTopRightSheet.ToString() + "|" + rdungeon.mInnerBottomRightX.ToString() + "|" + rdungeon.mInnerBottomRightSheet.ToString() + "|" + rdungeon.mWaterX.ToString() + "|" + rdungeon.mWaterSheet.ToString() + "|" + rdungeon.mWaterAnimX.ToString() + "|" + rdungeon.mWaterAnimSheet.ToString() + "|" + rdungeon.mIsolatedWallX.ToString() + "|" + rdungeon.mIsolatedWallSheet.ToString() + "|" + rdungeon.mColumnTopX.ToString() + "|" + rdungeon.mColumnTopSheet.ToString() + "|" + rdungeon.mColumnCenterX.ToString() + "|" + rdungeon.mColumnCenterSheet.ToString() + "|" + rdungeon.mColumnBottomX.ToString() + "|" + rdungeon.mColumnBottomSheet.ToString() + "|" + rdungeon.mRowLeftX.ToString() + "|" + rdungeon.mRowLeftSheet.ToString() + "|" + rdungeon.mRowCenterX.ToString() + "|" + rdungeon.mRowCenterSheet.ToString() + "|" + rdungeon.mRowRightX.ToString() + "|" + rdungeon.mRowRightSheet.ToString() + "|"); for (int i = 0; i < rdungeon.Floors.Count; i++) { string data = "Floor|" + rdungeon.Floors[i].WeatherIntensity.ToString() + "|" + ((int)rdungeon.Floors[i].Weather).ToString() + "|" + rdungeon.Floors[i].Music + "|" + ((int)rdungeon.Floors[i].GoalType).ToString() + "|" + rdungeon.Floors[i].GoalMap.ToString() + "|" + rdungeon.Floors[i].GoalX.ToString() + "|" + rdungeon.Floors[i].GoalY.ToString() + "|" + rdungeon.Floors[i].ItemSpawnRate.ToString() + "|" + rdungeon.Floors[i].Traps.Count.ToString() + "|"; for (int npc = 0; npc < 15; npc++) { data += rdungeon.Floors[i].Npc[npc].ToString() + "|"; } for (int item = 0; item < 8; item++) { data += rdungeon.Floors[i].Items[item].ToString() + "|"; } for (int trap = 0; trap < rdungeon.Floors[i].Traps.Count; trap++) { data += rdungeon.Floors[i].Traps[trap].ToString() + "|"; } writer.WriteLine(data); } writer.WriteLine("CraterSettings|" + rdungeon.Options.Craters + "|" + rdungeon.Options.CraterMinLength + "|" + rdungeon.Options.CraterMaxLength + "|" + rdungeon.Options.CraterFuzzy.ToIntString() + "|"); } }