Пример #1
0
            public static void Spawn(PrisonLevel level, Room room)
            {
                if (Spawned || Dungeon.Depth <= 6 || Random.Int(10 - Dungeon.Depth) != 0)
                {
                    return;
                }

                var npc = new Wandmaker();

                do
                {
                    npc.pos = room.Random();
                }while (level.map[npc.pos] == Terrain.ENTRANCE || level.map[npc.pos] == Terrain.SIGN);

                level.mobs.Add(npc);
                OccupyCell(npc);

                Spawned     = true;
                Alternative = Random.Int(2) == 0;

                IsGiven = false;

                switch (Random.Int(5))
                {
                case 0:
                    Wand1 = new WandOfAvalanche();
                    break;

                case 1:
                    Wand1 = new WandOfDisintegration();
                    break;

                case 2:
                    Wand1 = new WandOfFirebolt();
                    break;

                case 3:
                    Wand1 = new WandOfLightning();
                    break;

                case 4:
                    Wand1 = new WandOfPoison();
                    break;
                }
                Wand1.Random().Upgrade();

                switch (Random.Int(5))
                {
                case 0:
                    Wand2 = new WandOfAmok();
                    break;

                case 1:
                    Wand2 = new WandOfBlink();
                    break;

                case 2:
                    Wand2 = new WandOfRegrowth();
                    break;

                case 3:
                    Wand2 = new WandOfSlowness();
                    break;

                case 4:
                    Wand2 = new WandOfTelekinesis();
                    break;
                }
                Wand2.Random().Upgrade();
            }
Пример #2
0
        public static Level NewLevel()
        {
            Level = null;
            Actor.Clear();

            Depth++;
            if (Depth > Statistics.DeepestFloor)
            {
                Statistics.DeepestFloor = Depth;

                if (Statistics.QualifiedForNoKilling)
                {
                    Statistics.CompletedWithNoKilling = true;
                }
                else
                {
                    Statistics.CompletedWithNoKilling = false;
                }
            }

            Arrays.Fill(Visible, false);

            Level level;

            switch (Depth)
            {
            case 1:
            case 2:
            case 3:
            case 4:
                level = new SewerLevel();
                break;

            case 5:
                level = new SewerBossLevel();
                break;

            case 6:
            case 7:
            case 8:
            case 9:
                level = new PrisonLevel();
                break;

            case 10:
                level = new PrisonBossLevel();
                break;

            case 11:
            case 12:
            case 13:
            case 14:
                level = new CavesLevel();
                break;

            case 15:
                level = new CavesBossLevel();
                break;

            case 16:
            case 17:
            case 18:
            case 19:
                level = new CityLevel();
                break;

            case 20:
                level = new CityBossLevel();
                break;

            case 21:
                level = new LastShopLevel();
                break;

            case 22:
            case 23:
            case 24:
                level = new HallsLevel();
                break;

            case 25:
                level = new HallsBossLevel();
                break;

            case 26:
                level = new LastLevel();
                break;

            default:
                level = new DeadEndLevel();
                Statistics.DeepestFloor--;
                break;
            }

            level.Create();

            Statistics.QualifiedForNoKilling = !BossLevel();

            return(level);
        }