Exemplo n.º 1
0
        void btnSave_Click(object sender, SdlDotNet.Widgets.MouseButtonEventArgs e)
        {
            rdungeon.DungeonName = txtDungeonName.Text;
            if (optUp.Checked) {
                rdungeon.Direction = Enums.Direction.Up;
            } else {
                rdungeon.Direction = Enums.Direction.Down;
            }
            rdungeon.MaxFloors = nudMaxFloors.Value;
            rdungeon.Recruitment = chkRecruiting.Checked;
            rdungeon.Exp = chkEXPGain.Checked;
            rdungeon.WindTimer = nudWindTimer.Value;

            Messenger.SendSaveRDungeon(rdungeon);

            rdungeon = null;
            pnlRDungeonGeneral.Visible = false;
            pnlRDungeonList.Visible = true;
            this.Size = new System.Drawing.Size(pnlRDungeonList.Width, pnlRDungeonList.Height);
            this.TitleBar.Text = "Random Dungeon Panel";
        }
Exemplo n.º 2
0
        public void LoadRDungeon(string[] parse)
        {
            //load Rdungeon from packet
            rdungeon = new EditableRDungeon(parse[1].ToInt());
            rdungeon.DungeonName = parse[2];
            rdungeon.Direction = (Enums.Direction)parse[3].ToInt();
            rdungeon.MaxFloors = parse[4].ToInt();
            rdungeon.Recruitment = parse[5].ToBool();
            rdungeon.Exp = parse[6].ToBool();
            rdungeon.WindTimer = parse[7].ToInt();
            rdungeon.DungeonIndex = parse[8].ToInt();
            int n = 9;
            for (int i = 0; i < rdungeon.MaxFloors; i++) {
                rdungeon.Floors.Add(new EditableRDungeonFloor());
                rdungeon.Floors[i].TrapMin = parse[n].ToInt();
                rdungeon.Floors[i].TrapMax = parse[n + 1].ToInt();
                rdungeon.Floors[i].ItemMin = parse[n + 2].ToInt();
                rdungeon.Floors[i].ItemMax = parse[n + 3].ToInt();
                rdungeon.Floors[i].Intricacy = parse[n + 4].ToInt();
                rdungeon.Floors[i].RoomWidthMin = parse[n + 5].ToInt();
                rdungeon.Floors[i].RoomWidthMax = parse[n + 6].ToInt();
                rdungeon.Floors[i].RoomLengthMin = parse[n + 7].ToInt();
                rdungeon.Floors[i].RoomLengthMax = parse[n + 8].ToInt();
                rdungeon.Floors[i].HallTurnMin = parse[n + 9].ToInt();
                rdungeon.Floors[i].HallTurnMax = parse[n + 10].ToInt();
                rdungeon.Floors[i].HallVarMin = parse[n + 11].ToInt();
                rdungeon.Floors[i].HallVarMax = parse[n + 12].ToInt();
                rdungeon.Floors[i].WaterFrequency = parse[n + 13].ToInt();
                rdungeon.Floors[i].Craters = parse[n + 14].ToInt();
                rdungeon.Floors[i].CraterMinLength = parse[n + 15].ToInt();
                rdungeon.Floors[i].CraterMaxLength = parse[n + 16].ToInt();
                rdungeon.Floors[i].CraterFuzzy = parse[n + 17].ToBool();
                rdungeon.Floors[i].MinChambers = parse[n + 18].ToInt();
                rdungeon.Floors[i].MaxChambers = parse[n + 19].ToInt();
                rdungeon.Floors[i].Darkness = parse[n + 20].ToInt();
                rdungeon.Floors[i].GoalType = (Enums.RFloorGoalType)parse[n + 21].ToInt();
                rdungeon.Floors[i].GoalMap = parse[n + 22].ToInt();
                rdungeon.Floors[i].GoalX = parse[n + 23].ToInt();
                rdungeon.Floors[i].GoalY = parse[n + 24].ToInt();
                rdungeon.Floors[i].Music = parse[n + 25];

                n += 26;

                rdungeon.Floors[i].StairsX = parse[n].ToInt();
                rdungeon.Floors[i].StairsSheet = parse[n + 1].ToInt();

                rdungeon.Floors[i].mGroundX = parse[n + 2].ToInt();
                rdungeon.Floors[i].mGroundSheet = parse[n + 3].ToInt();

                rdungeon.Floors[i].mTopLeftX = parse[n + 4].ToInt();
                rdungeon.Floors[i].mTopLeftSheet = parse[n + 5].ToInt();
                rdungeon.Floors[i].mTopCenterX = parse[n + 6].ToInt();
                rdungeon.Floors[i].mTopCenterSheet = parse[n + 7].ToInt();
                rdungeon.Floors[i].mTopRightX = parse[n + 8].ToInt();
                rdungeon.Floors[i].mTopRightSheet = parse[n + 9].ToInt();

                rdungeon.Floors[i].mCenterLeftX = parse[n + 10].ToInt();
                rdungeon.Floors[i].mCenterLeftSheet = parse[n + 11].ToInt();
                rdungeon.Floors[i].mCenterCenterX = parse[n + 12].ToInt();
                rdungeon.Floors[i].mCenterCenterSheet = parse[n + 13].ToInt();
                rdungeon.Floors[i].mCenterRightX = parse[n + 14].ToInt();
                rdungeon.Floors[i].mCenterRightSheet = parse[n + 15].ToInt();

                rdungeon.Floors[i].mBottomLeftX = parse[n + 16].ToInt();
                rdungeon.Floors[i].mBottomLeftSheet = parse[n + 17].ToInt();
                rdungeon.Floors[i].mBottomCenterX = parse[n + 18].ToInt();
                rdungeon.Floors[i].mBottomCenterSheet = parse[n + 19].ToInt();
                rdungeon.Floors[i].mBottomRightX = parse[n + 20].ToInt();
                rdungeon.Floors[i].mBottomRightSheet = parse[n + 21].ToInt();

                rdungeon.Floors[i].mInnerTopLeftX = parse[n + 22].ToInt();
                rdungeon.Floors[i].mInnerTopLeftSheet = parse[n + 23].ToInt();
                rdungeon.Floors[i].mInnerBottomLeftX = parse[n + 24].ToInt();
                rdungeon.Floors[i].mInnerBottomLeftSheet = parse[n + 25].ToInt();
                rdungeon.Floors[i].mInnerTopRightX = parse[n + 26].ToInt();
                rdungeon.Floors[i].mInnerTopRightSheet = parse[n + 27].ToInt();
                rdungeon.Floors[i].mInnerBottomRightX = parse[n + 28].ToInt();
                rdungeon.Floors[i].mInnerBottomRightSheet = parse[n + 29].ToInt();

                rdungeon.Floors[i].mIsolatedWallX = parse[n + 30].ToInt();
                rdungeon.Floors[i].mIsolatedWallSheet = parse[n + 31].ToInt();
                rdungeon.Floors[i].mColumnTopX = parse[n + 32].ToInt();
                rdungeon.Floors[i].mColumnTopSheet = parse[n + 33].ToInt();
                rdungeon.Floors[i].mColumnCenterX = parse[n + 34].ToInt();
                rdungeon.Floors[i].mColumnCenterSheet = parse[n + 35].ToInt();
                rdungeon.Floors[i].mColumnBottomX = parse[n + 36].ToInt();
                rdungeon.Floors[i].mColumnBottomSheet = parse[n + 37].ToInt();

                rdungeon.Floors[i].mRowLeftX = parse[n + 38].ToInt();
                rdungeon.Floors[i].mRowLeftSheet = parse[n + 39].ToInt();
                rdungeon.Floors[i].mRowCenterX = parse[n + 40].ToInt();
                rdungeon.Floors[i].mRowCenterSheet = parse[n + 41].ToInt();
                rdungeon.Floors[i].mRowRightX = parse[n + 42].ToInt();
                rdungeon.Floors[i].mRowRightSheet = parse[n + 43].ToInt();

                rdungeon.Floors[i].mGroundAltX = parse[n + 44].ToInt();
                rdungeon.Floors[i].mGroundAltSheet = parse[n + 45].ToInt();
                rdungeon.Floors[i].mGroundAlt2X = parse[n + 46].ToInt();
                rdungeon.Floors[i].mGroundAlt2Sheet = parse[n + 47].ToInt();

                rdungeon.Floors[i].mTopLeftAltX = parse[n + 48].ToInt();
                rdungeon.Floors[i].mTopLeftAltSheet = parse[n + 49].ToInt();
                rdungeon.Floors[i].mTopCenterAltX = parse[n + 50].ToInt();
                rdungeon.Floors[i].mTopCenterAltSheet = parse[n + 51].ToInt();
                rdungeon.Floors[i].mTopRightAltX = parse[n + 52].ToInt();
                rdungeon.Floors[i].mTopRightAltSheet = parse[n + 53].ToInt();

                rdungeon.Floors[i].mCenterLeftAltX = parse[n + 54].ToInt();
                rdungeon.Floors[i].mCenterLeftAltSheet = parse[n + 55].ToInt();
                rdungeon.Floors[i].mCenterCenterAltX = parse[n + 56].ToInt();
                rdungeon.Floors[i].mCenterCenterAltSheet = parse[n + 57].ToInt();
                rdungeon.Floors[i].mCenterCenterAlt2X = parse[n + 58].ToInt();
                rdungeon.Floors[i].mCenterCenterAlt2Sheet = parse[n + 59].ToInt();
                rdungeon.Floors[i].mCenterRightAltX = parse[n + 60].ToInt();
                rdungeon.Floors[i].mCenterRightAltSheet = parse[n + 61].ToInt();

                rdungeon.Floors[i].mBottomLeftAltX = parse[n + 62].ToInt();
                rdungeon.Floors[i].mBottomLeftAltSheet = parse[n + 63].ToInt();
                rdungeon.Floors[i].mBottomCenterAltX = parse[n + 64].ToInt();
                rdungeon.Floors[i].mBottomCenterAltSheet = parse[n + 65].ToInt();
                rdungeon.Floors[i].mBottomRightAltX = parse[n + 66].ToInt();
                rdungeon.Floors[i].mBottomRightAltSheet = parse[n + 67].ToInt();

                rdungeon.Floors[i].mInnerTopLeftAltX = parse[n + 68].ToInt();
                rdungeon.Floors[i].mInnerTopLeftAltSheet = parse[n + 69].ToInt();
                rdungeon.Floors[i].mInnerBottomLeftAltX = parse[n + 70].ToInt();
                rdungeon.Floors[i].mInnerBottomLeftAltSheet = parse[n + 71].ToInt();
                rdungeon.Floors[i].mInnerTopRightAltX = parse[n + 72].ToInt();
                rdungeon.Floors[i].mInnerTopRightAltSheet = parse[n + 73].ToInt();
                rdungeon.Floors[i].mInnerBottomRightAltX = parse[n + 74].ToInt();
                rdungeon.Floors[i].mInnerBottomRightAltSheet = parse[n + 75].ToInt();

                rdungeon.Floors[i].mIsolatedWallAltX = parse[n + 76].ToInt();
                rdungeon.Floors[i].mIsolatedWallAltSheet = parse[n + 77].ToInt();
                rdungeon.Floors[i].mColumnTopAltX = parse[n + 78].ToInt();
                rdungeon.Floors[i].mColumnTopAltSheet = parse[n + 79].ToInt();
                rdungeon.Floors[i].mColumnCenterAltX = parse[n + 80].ToInt();
                rdungeon.Floors[i].mColumnCenterAltSheet = parse[n + 81].ToInt();
                rdungeon.Floors[i].mColumnBottomAltX = parse[n + 82].ToInt();
                rdungeon.Floors[i].mColumnBottomAltSheet = parse[n + 83].ToInt();

                rdungeon.Floors[i].mRowLeftAltX = parse[n + 84].ToInt();
                rdungeon.Floors[i].mRowLeftAltSheet = parse[n + 85].ToInt();
                rdungeon.Floors[i].mRowCenterAltX = parse[n + 86].ToInt();
                rdungeon.Floors[i].mRowCenterAltSheet = parse[n + 87].ToInt();
                rdungeon.Floors[i].mRowRightAltX = parse[n + 88].ToInt();
                rdungeon.Floors[i].mRowRightAltSheet = parse[n + 89].ToInt();

                n += 90;

                rdungeon.Floors[i].mWaterX = parse[n].ToInt();
                rdungeon.Floors[i].mWaterSheet = parse[n + 1].ToInt();
                rdungeon.Floors[i].mWaterAnimX = parse[n + 2].ToInt();
                rdungeon.Floors[i].mWaterAnimSheet = parse[n + 3].ToInt();

                rdungeon.Floors[i].mShoreTopLeftX = parse[n + 4].ToInt();
                rdungeon.Floors[i].mShoreTopLeftSheet = parse[n + 5].ToInt();
                rdungeon.Floors[i].mShoreTopRightX = parse[n + 6].ToInt();
                rdungeon.Floors[i].mShoreTopRightSheet = parse[n + 7].ToInt();
                rdungeon.Floors[i].mShoreBottomRightX = parse[n + 8].ToInt();
                rdungeon.Floors[i].mShoreBottomRightSheet = parse[n + 9].ToInt();
                rdungeon.Floors[i].mShoreBottomLeftX = parse[n + 10].ToInt();
                rdungeon.Floors[i].mShoreBottomLeftSheet = parse[n + 11].ToInt();

                rdungeon.Floors[i].mShoreDiagonalForwardX = parse[n + 12].ToInt();
                rdungeon.Floors[i].mShoreDiagonalForwardSheet = parse[n + 13].ToInt();
                rdungeon.Floors[i].mShoreDiagonalBackX = parse[n + 14].ToInt();
                rdungeon.Floors[i].mShoreDiagonalBackSheet = parse[n + 15].ToInt();

                rdungeon.Floors[i].mShoreTopX = parse[n + 16].ToInt();
                rdungeon.Floors[i].mShoreTopSheet = parse[n + 17].ToInt();
                rdungeon.Floors[i].mShoreRightX = parse[n + 18].ToInt();
                rdungeon.Floors[i].mShoreRightSheet = parse[n + 19].ToInt();
                rdungeon.Floors[i].mShoreBottomX = parse[n + 20].ToInt();
                rdungeon.Floors[i].mShoreBottomSheet = parse[n + 21].ToInt();
                rdungeon.Floors[i].mShoreLeftX = parse[n + 22].ToInt();
                rdungeon.Floors[i].mShoreLeftSheet = parse[n + 23].ToInt();

                rdungeon.Floors[i].mShoreVerticalX = parse[n + 24].ToInt();
                rdungeon.Floors[i].mShoreVerticalSheet = parse[n + 25].ToInt();
                rdungeon.Floors[i].mShoreHorizontalX = parse[n + 26].ToInt();
                rdungeon.Floors[i].mShoreHorizontalSheet = parse[n + 27].ToInt();

                rdungeon.Floors[i].mShoreInnerTopLeftX = parse[n + 28].ToInt();
                rdungeon.Floors[i].mShoreInnerTopLeftSheet = parse[n + 29].ToInt();
                rdungeon.Floors[i].mShoreInnerTopRightX = parse[n + 30].ToInt();
                rdungeon.Floors[i].mShoreInnerTopRightSheet = parse[n + 31].ToInt();
                rdungeon.Floors[i].mShoreInnerBottomRightX = parse[n + 32].ToInt();
                rdungeon.Floors[i].mShoreInnerBottomRightSheet = parse[n + 33].ToInt();
                rdungeon.Floors[i].mShoreInnerBottomLeftX = parse[n + 34].ToInt();
                rdungeon.Floors[i].mShoreInnerBottomLeftSheet = parse[n + 35].ToInt();

                rdungeon.Floors[i].mShoreInnerTopX = parse[n + 36].ToInt();
                rdungeon.Floors[i].mShoreInnerTopSheet = parse[n + 37].ToInt();
                rdungeon.Floors[i].mShoreInnerRightX = parse[n + 38].ToInt();
                rdungeon.Floors[i].mShoreInnerRightSheet = parse[n + 39].ToInt();
                rdungeon.Floors[i].mShoreInnerBottomX = parse[n + 40].ToInt();
                rdungeon.Floors[i].mShoreInnerBottomSheet = parse[n + 41].ToInt();
                rdungeon.Floors[i].mShoreInnerLeftX = parse[n + 42].ToInt();
                rdungeon.Floors[i].mShoreInnerLeftSheet = parse[n + 43].ToInt();
                rdungeon.Floors[i].mShoreSurroundedX = parse[n + 44].ToInt();
                rdungeon.Floors[i].mShoreSurroundedSheet = parse[n + 45].ToInt();

                rdungeon.Floors[i].mShoreTopLeftAnimX = parse[n + 46].ToInt();
                rdungeon.Floors[i].mShoreTopLeftAnimSheet = parse[n + 47].ToInt();
                rdungeon.Floors[i].mShoreTopRightAnimX = parse[n + 48].ToInt();
                rdungeon.Floors[i].mShoreTopRightAnimSheet = parse[n + 49].ToInt();
                rdungeon.Floors[i].mShoreBottomRightAnimX = parse[n + 50].ToInt();
                rdungeon.Floors[i].mShoreBottomRightAnimSheet = parse[n + 51].ToInt();
                rdungeon.Floors[i].mShoreBottomLeftAnimX = parse[n + 52].ToInt();
                rdungeon.Floors[i].mShoreBottomLeftAnimSheet = parse[n + 53].ToInt();

                rdungeon.Floors[i].mShoreDiagonalForwardAnimX = parse[n + 54].ToInt();
                rdungeon.Floors[i].mShoreDiagonalForwardAnimSheet = parse[n + 55].ToInt();
                rdungeon.Floors[i].mShoreDiagonalBackAnimX = parse[n + 56].ToInt();
                rdungeon.Floors[i].mShoreDiagonalBackAnimSheet = parse[n + 57].ToInt();

                rdungeon.Floors[i].mShoreTopAnimX = parse[n + 58].ToInt();
                rdungeon.Floors[i].mShoreTopAnimSheet = parse[n + 59].ToInt();
                rdungeon.Floors[i].mShoreRightAnimX = parse[n + 60].ToInt();
                rdungeon.Floors[i].mShoreRightAnimSheet = parse[n + 61].ToInt();
                rdungeon.Floors[i].mShoreBottomAnimX = parse[n + 62].ToInt();
                rdungeon.Floors[i].mShoreBottomAnimSheet = parse[n + 63].ToInt();
                rdungeon.Floors[i].mShoreLeftAnimX = parse[n + 64].ToInt();
                rdungeon.Floors[i].mShoreLeftAnimSheet = parse[n + 65].ToInt();

                rdungeon.Floors[i].mShoreVerticalAnimX = parse[n + 66].ToInt();
                rdungeon.Floors[i].mShoreVerticalAnimSheet = parse[n + 67].ToInt();
                rdungeon.Floors[i].mShoreHorizontalAnimX = parse[n + 68].ToInt();
                rdungeon.Floors[i].mShoreHorizontalAnimSheet = parse[n + 69].ToInt();

                rdungeon.Floors[i].mShoreInnerTopLeftAnimX = parse[n + 70].ToInt();
                rdungeon.Floors[i].mShoreInnerTopLeftAnimSheet = parse[n + 71].ToInt();
                rdungeon.Floors[i].mShoreInnerTopRightAnimX = parse[n + 72].ToInt();
                rdungeon.Floors[i].mShoreInnerTopRightAnimSheet = parse[n + 73].ToInt();
                rdungeon.Floors[i].mShoreInnerBottomRightAnimX = parse[n + 74].ToInt();
                rdungeon.Floors[i].mShoreInnerBottomRightAnimSheet = parse[n + 75].ToInt();
                rdungeon.Floors[i].mShoreInnerBottomLeftAnimX = parse[n + 76].ToInt();
                rdungeon.Floors[i].mShoreInnerBottomLeftAnimSheet = parse[n + 77].ToInt();

                rdungeon.Floors[i].mShoreInnerTopAnimX = parse[n + 78].ToInt();
                rdungeon.Floors[i].mShoreInnerTopAnimSheet = parse[n + 79].ToInt();
                rdungeon.Floors[i].mShoreInnerRightAnimX = parse[n + 80].ToInt();
                rdungeon.Floors[i].mShoreInnerRightAnimSheet = parse[n + 81].ToInt();
                rdungeon.Floors[i].mShoreInnerBottomAnimX = parse[n + 82].ToInt();
                rdungeon.Floors[i].mShoreInnerBottomAnimSheet = parse[n + 83].ToInt();
                rdungeon.Floors[i].mShoreInnerLeftAnimX = parse[n + 84].ToInt();
                rdungeon.Floors[i].mShoreInnerLeftAnimSheet = parse[n + 85].ToInt();

                rdungeon.Floors[i].mShoreSurroundedAnimX = parse[n + 86].ToInt();
                rdungeon.Floors[i].mShoreSurroundedAnimSheet = parse[n + 87].ToInt();

                n += 88;

                rdungeon.Floors[i].GroundTile.Type = (Enums.TileType)parse[n].ToInt();
                rdungeon.Floors[i].GroundTile.Data1 = parse[n + 1].ToInt();
                rdungeon.Floors[i].GroundTile.Data2 = parse[n + 2].ToInt();
                rdungeon.Floors[i].GroundTile.Data3 = parse[n + 3].ToInt();
                rdungeon.Floors[i].GroundTile.String1 = parse[n + 4];
                rdungeon.Floors[i].GroundTile.String2 = parse[n + 5];
                rdungeon.Floors[i].GroundTile.String3 = parse[n + 6];

                rdungeon.Floors[i].HallTile.Type = (Enums.TileType)parse[n + 7].ToInt();
                rdungeon.Floors[i].HallTile.Data1 = parse[n + 8].ToInt();
                rdungeon.Floors[i].HallTile.Data2 = parse[n + 9].ToInt();
                rdungeon.Floors[i].HallTile.Data3 = parse[n + 10].ToInt();
                rdungeon.Floors[i].HallTile.String1 = parse[n + 11];
                rdungeon.Floors[i].HallTile.String2 = parse[n + 12];
                rdungeon.Floors[i].HallTile.String3 = parse[n + 13];

                rdungeon.Floors[i].WaterTile.Type = (Enums.TileType)parse[n + 14].ToInt();
                rdungeon.Floors[i].WaterTile.Data1 = parse[n + 15].ToInt();
                rdungeon.Floors[i].WaterTile.Data2 = parse[n + 16].ToInt();
                rdungeon.Floors[i].WaterTile.Data3 = parse[n + 17].ToInt();
                rdungeon.Floors[i].WaterTile.String1 = parse[n + 18];
                rdungeon.Floors[i].WaterTile.String2 = parse[n + 19];
                rdungeon.Floors[i].WaterTile.String3 = parse[n + 20];

                rdungeon.Floors[i].WallTile.Type = (Enums.TileType)parse[n + 21].ToInt();
                rdungeon.Floors[i].WallTile.Data1 = parse[n + 22].ToInt();
                rdungeon.Floors[i].WallTile.Data2 = parse[n + 23].ToInt();
                rdungeon.Floors[i].WallTile.Data3 = parse[n + 24].ToInt();
                rdungeon.Floors[i].WallTile.String1 = parse[n + 25];
                rdungeon.Floors[i].WallTile.String2 = parse[n + 26];
                rdungeon.Floors[i].WallTile.String3 = parse[n + 27];

                rdungeon.Floors[i].NpcSpawnTime = parse[n + 28].ToInt();
                rdungeon.Floors[i].NpcMin = parse[n + 29].ToInt();
                rdungeon.Floors[i].NpcMax = parse[n + 30].ToInt();

                n += 31;

                for (int item = 0; item < parse[n].ToInt(); item++) {
                    EditableRDungeonItem newItem = new EditableRDungeonItem();
                    newItem.ItemNum = parse[n + item * 10 + 1].ToInt();
                    newItem.MinAmount = parse[n + item * 10 + 2].ToInt();
                    newItem.MaxAmount = parse[n + item * 10 + 3].ToInt();
                    newItem.AppearanceRate = parse[n + item * 10 + 4].ToInt();
                    newItem.StickyRate = parse[n + item * 10 + 5].ToInt();
                    newItem.Tag = parse[n + item * 10 + 6];
                    newItem.Hidden = parse[n + item * 10 + 7].ToBool();
                    newItem.OnGround = parse[n + item * 10 + 8].ToBool();
                    newItem.OnWater = parse[n + item * 10 + 9].ToBool();
                    newItem.OnWall = parse[n + item * 10 + 10].ToBool();

                    rdungeon.Floors[i].Items.Add(newItem);
                }
                n += rdungeon.Floors[i].Items.Count * 10 + 1;

                for (int npc = 0; npc < parse[n].ToInt(); npc++) {
                    MapNpcSettings newNpc = new MapNpcSettings();
                    newNpc.NpcNum = parse[n + npc * 7 + 1].ToInt();
                    newNpc.MinLevel = parse[n + npc * 7 + 2].ToInt();
                    newNpc.MaxLevel = parse[n + npc * 7 + 3].ToInt();
                    newNpc.AppearanceRate = parse[n + npc * 7 + 4].ToInt();
                    newNpc.StartStatus = (Enums.StatusAilment)parse[n + npc * 7 + 5].ToInt();
                    newNpc.StartStatusCounter = parse[n + npc * 7 + 6].ToInt();
                    newNpc.StartStatusChance = parse[n + npc * 7 + 7].ToInt();

                    rdungeon.Floors[i].Npcs.Add(newNpc);
                }
                n += rdungeon.Floors[i].Npcs.Count * 7 + 1;

                for (int traps = 0; traps < parse[n].ToInt(); traps++) {
                    EditableRDungeonTrap newTile = new EditableRDungeonTrap();
                    newTile.SpecialTile.Type = (Enums.TileType)parse[n + traps * 29 + 1].ToInt();
                    newTile.SpecialTile.Data1 = parse[n + traps * 29 + 2].ToInt();
                    newTile.SpecialTile.Data2 = parse[n + traps * 29 + 3].ToInt();
                    newTile.SpecialTile.Data3 = parse[n + traps * 29 + 4].ToInt();
                    newTile.SpecialTile.String1 = parse[n + traps * 29 + 5];
                    newTile.SpecialTile.String2 = parse[n + traps * 29 + 6];
                    newTile.SpecialTile.String3 = parse[n + traps * 29 + 7];
                    newTile.SpecialTile.Ground = parse[n + traps * 29 + 8].ToInt();
                    newTile.SpecialTile.GroundSet = parse[n + traps * 29 + 9].ToInt();
                    newTile.SpecialTile.GroundAnim = parse[n + traps * 29 + 10].ToInt();
                    newTile.SpecialTile.GroundAnimSet = parse[n + traps * 29 + 11].ToInt();
                    newTile.SpecialTile.Mask = parse[n + traps * 29 + 12].ToInt();
                    newTile.SpecialTile.MaskSet = parse[n + traps * 29 + 13].ToInt();
                    newTile.SpecialTile.Anim = parse[n + traps * 29 + 14].ToInt();
                    newTile.SpecialTile.AnimSet = parse[n + traps * 29 + 15].ToInt();
                    newTile.SpecialTile.Mask2 = parse[n + traps * 29 + 16].ToInt();
                    newTile.SpecialTile.Mask2Set = parse[n + traps * 29 + 17].ToInt();
                    newTile.SpecialTile.M2Anim = parse[n + traps * 29 + 18].ToInt();
                    newTile.SpecialTile.M2AnimSet = parse[n + traps * 29 + 19].ToInt();
                    newTile.SpecialTile.Fringe = parse[n + traps * 29 + 20].ToInt();
                    newTile.SpecialTile.FringeSet = parse[n + traps * 29 + 21].ToInt();
                    newTile.SpecialTile.FAnim = parse[n + traps * 29 + 22].ToInt();
                    newTile.SpecialTile.FAnimSet = parse[n + traps * 29 + 23].ToInt();
                    newTile.SpecialTile.Fringe2 = parse[n + traps * 29 + 24].ToInt();
                    newTile.SpecialTile.Fringe2Set = parse[n + traps * 29 + 25].ToInt();
                    newTile.SpecialTile.F2Anim = parse[n + traps * 29 + 26].ToInt();
                    newTile.SpecialTile.F2AnimSet = parse[n + traps * 29 + 27].ToInt();
                    newTile.SpecialTile.RDungeonMapValue = parse[n + traps * 29 + 28].ToInt();
                    newTile.AppearanceRate = parse[n + traps * 29 + 29].ToInt();

                    rdungeon.Floors[i].SpecialTiles.Add(newTile);

                }
                n += rdungeon.Floors[i].SpecialTiles.Count * 29 + 1;

                for (int weather = 0; weather < parse[n].ToInt(); weather++) {
                    rdungeon.Floors[i].Weather.Add((Enums.Weather)parse[n + 1 + weather].ToInt());

                }
                n += rdungeon.Floors[i].Weather.Count + 1;

                for (int chamber = 0; chamber < parse[n].ToInt(); chamber++) {
                    EditableRDungeonChamber newChamber = new EditableRDungeonChamber();
                    newChamber.ChamberNum = parse[n + chamber * 4 + 1].ToInt();
                    newChamber.String1 = parse[n + chamber * 4 + 2];
                    newChamber.String2 = parse[n + chamber * 4 + 3];
                    newChamber.String3 = parse[n + chamber * 4 + 4];
                    rdungeon.Floors[i].Chambers.Add(newChamber);
                }
                n += rdungeon.Floors[i].Chambers.Count * 4 + 1;

            }

            pnlRDungeonList.Visible = false;
            btnEdit.Text = "Edit";

            txtDungeonName.Text = rdungeon.DungeonName;
            if (rdungeon.Direction == Enums.Direction.Up) {
                optUp.Checked = true;
            } else {
                optDown.Checked = true;
            }
            nudMaxFloors.Value = rdungeon.MaxFloors;
            chkRecruiting.Checked = rdungeon.Recruitment;
            chkEXPGain.Checked = rdungeon.Exp;
            nudWindTimer.Value = rdungeon.WindTimer;

            pnlRDungeonGeneral.Visible = true;
            this.Size = new System.Drawing.Size(pnlRDungeonGeneral.Width, pnlRDungeonGeneral.Height);

            //btnGeneral.Visible = true;
            //btnFloors.Visible = true;
            //btnTerrain.Visible = true;
            //btnGeneral.Size = new Size((pnlRDungeonGeneral.Width - 21) / 3, 32);
            //btnFloors.Location = new Point((pnlRDungeonGeneral.Width - 21) / 3 + 10, 0);
            //btnFloors.Size = new Size((pnlRDungeonGeneral.Width - 21) / 3, 32);
            //btnFloors.Visible = true;
            //btnTerrain.Location = new Point((pnlRDungeonGeneral.Width - 21) / 3 * 2 + 10, 0);
            //btnTerrain.Size = new Size((pnlRDungeonGeneral.Width - 21) / 3, 32);
            //btnGeneral.Selected = true;

            //this.TitleBar.Text = "General Random Dungeon Options";
        }
Exemplo n.º 3
0
 void btnEditorCancel_Click(object sender, SdlDotNet.Widgets.MouseButtonEventArgs e)
 {
     rdungeon = null;
     pnlRDungeonGeneral.Visible = false;
     pnlRDungeonList.Visible = true;
     this.Size = new System.Drawing.Size(pnlRDungeonList.Width, pnlRDungeonList.Height);
     this.TitleBar.Text = "Random Dungeon Panel";
 }