Exemplo n.º 1
0
 /// <summary>
 /// Opens the plugin panel if closed
 /// </summary>
 public void OpenWizard(Object sender, System.EventArgs e)
 {
     this.wizard = new AirWizard(this);
     if (this.wizard.IsPropertiesLoaded)
     {
         this.wizard.ShowDialog(PluginBase.MainForm);
     }
 }
Exemplo n.º 2
0
        public Level(int w, int h, int level, Level parentLevel)
        {
            unchecked
            {
                if (level < 0)
                {
                    dirtColor = 222;
                }
                this.depth = level;
                this.w     = w;
                this.h     = h;
                byte[][] maps;

                if (level == 1)
                {
                    dirtColor = 444;
                }
                if (level == 0)
                {
                    maps = LevelGen.createAndValidateTopMap(w, h);
                }
                else if (level < 0)
                {
                    maps           = LevelGen.createAndValidateUndergroundMap(w, h, -level);
                    monsterDensity = 4;
                }
                else
                {
                    maps           = LevelGen.createAndValidateSkyMap(w, h); // Sky level
                    monsterDensity = 4;
                }

                tiles = maps[0];
                data  = maps[1];

                if (parentLevel != null)
                {
                    for (int y = 0; y < h; y++)
                    {
                        for (int x = 0; x < w; x++)
                        {
                            if (parentLevel.getTile(x, y) == Tile.stairsDown)
                            {
                                setTile(x, y, Tile.stairsUp, 0);
                                if (level == 0)
                                {
                                    setTile(x - 1, y, Tile.hardRock, 0);
                                    setTile(x + 1, y, Tile.hardRock, 0);
                                    setTile(x, y - 1, Tile.hardRock, 0);
                                    setTile(x, y + 1, Tile.hardRock, 0);
                                    setTile(x - 1, y - 1, Tile.hardRock, 0);
                                    setTile(x - 1, y + 1, Tile.hardRock, 0);
                                    setTile(x + 1, y - 1, Tile.hardRock, 0);
                                    setTile(x + 1, y + 1, Tile.hardRock, 0);
                                }
                                else
                                {
                                    setTile(x - 1, y, Tile.dirt, 0);
                                    setTile(x + 1, y, Tile.dirt, 0);
                                    setTile(x, y - 1, Tile.dirt, 0);
                                    setTile(x, y + 1, Tile.dirt, 0);
                                    setTile(x - 1, y - 1, Tile.dirt, 0);
                                    setTile(x - 1, y + 1, Tile.dirt, 0);
                                    setTile(x + 1, y - 1, Tile.dirt, 0);
                                    setTile(x + 1, y + 1, Tile.dirt, 0);
                                }
                            }
                        }
                    }
                }

                entitiesInTiles = new List <Entity> [w * h];
                for (int i = 0; i < w * h; i++)
                {
                    entitiesInTiles[i] = new List <Entity>();
                }

                if (level == 1)
                {
                    AirWizard aw = new AirWizard();
                    aw.x = w * 8;
                    aw.y = h * 8;
                    add(aw);
                }
            }
        }