示例#1
0
    public void IsOpened()
    {
        animator.SetBool("isOpenChest", true);
        SewerLevel levelScript = level.GetComponent <SewerLevel>();

        levelScript.AddLunaKey();
    }
示例#2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     level = GameObject.FindGameObjectWithTag("Level");
     if (collision.gameObject.tag == "Player")
     {
         GameObject player      = GameObject.FindGameObjectWithTag("Player");
         SewerLevel levelScript = level.GetComponent <SewerLevel>();
         levelScript.AddLunaKey();
         Destroy(gameObject);
     }
 }
示例#3
0
        public void TestMethod1()
        {
            Dungeon.Depth = 1;
            var level = new SewerLevel();

            level.feeling = Level.Feeling.WATER;

            level.Create();

            //level.DebugBuild();
            var quadLevel = new int[Level.Width, Level.Width];

            for (var i = 0; i < level.map.Length; i++)
            {
                var x = i / Level.Width;
                var y = i % Level.Width;
                quadLevel[x, y] = level.map[i];
            }

            var levelBitmap = DrawLevel(quadLevel);

            levelBitmap.Save(@"c:\temp\lbl.bmp");
        }
示例#4
0
            public static void Spawn(SewerLevel level)
            {
                if (spawned || Dungeon.Depth <= 1 || pdsharp.utils.Random.Int(5 - Dungeon.Depth) != 0)
                {
                    return;
                }

                var ghost = new Ghost();

                do
                {
                    ghost.pos = level.RandomRespawnCell();
                } while (ghost.pos == -1);

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

                spawned     = true;
                alternative = pdsharp.utils.Random.Int(2) == 0;
                if (!alternative)
                {
                    left2kill = 8;
                }

                given     = false;
                processed = false;
                depth     = Dungeon.Depth;

                do
                {
                    weapon = (Weapon)Generator.Random(Generator.Category.WEAPON);
                } while (weapon is MissileWeapon);

                if (Dungeon.IsChallenged(Challenges.NO_ARMOR))
                {
                    armor = (Armor) new ClothArmor().Degrade();
                }
                else
                {
                    armor = (Armor)Generator.Random(Generator.Category.ARMOR);
                }

                for (int i = 0; i < 3; i++)
                {
                    Item another;
                    do
                    {
                        another = Generator.Random(Generator.Category.WEAPON);
                    } while (another is MissileWeapon);
                    if (another.level > weapon.level)
                    {
                        weapon = (Weapon)another;
                    }
                    another = Generator.Random(Generator.Category.ARMOR);
                    if (another.level > armor.level)
                    {
                        armor = (Armor)another;
                    }
                }
                weapon.Identify();
                armor.Identify();
            }
示例#5
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);
        }
示例#6
0
 // Use this for initialization
 void Start()
 {
     park   = GameObject.FindGameObjectWithTag("Level").GetComponent <SewerLevel>();
     gotKey = false;
 }