Esempio n. 1
0
        void RemoveKillRooms(RoomCollection rc)
        {
            if (optionFlags.DebugOpenShutterDoors)
            {
                var doc = new DungeonObjectDataPointerCollection(romData);
                foreach (var r in doc.RoomDungeonObjectDataPointers.Values.Where(x => shutterDoorRooms.Contains(x.RoomId)).ToList())
                {
                    r.MakeShutterDoorsNormal();
                }
                doc.WriteChangesToRom(AddressConstants.movedRoomObjectBaseAddress);

                var killTags = RoomTags.Tags.Where(x => x.Value.ToLower().Contains("kill")).Select(x => x.Key).ToList();

                foreach (var r in rc.Rooms.Where(x => shutterDoorRooms.Contains(x.RoomId)).ToList())
                {
                    if (killTags.Any(x => x == r.Tag1))
                    {
                        r.Tag1 = 0;
                    }
                    if (killTags.Any(x => x == r.Tag2))
                    {
                        r.Tag2 = 0;
                    }
                }
            }
        }
        public DungeonEnemyRandomizer(RomData romData, Random rand, SpriteGroupCollection spriteGroupCollection, SpriteRequirementCollection spriteRequirementCollection)
        {
            this.romData = romData;
            this.rand    = rand;
            this.spriteGroupCollection       = spriteGroupCollection;
            this.spriteRequirementCollection = spriteRequirementCollection;

            this.roomCollection = new RoomCollection(romData, rand, spriteGroupCollection, spriteRequirementCollection);
        }
Esempio n. 3
0
 void SetDungeonEnemy(RoomCollection rc)
 {
     foreach (var r in rc.Rooms)
     {
         foreach (var s in r.Sprites)
         {
             if (false == dontModifySprites.Contains(s.SpriteId))
             {
                 s.SpriteId        = optionFlags.DebugForceEnemyId;
                 r.GraphicsBlockId = 4;
             }
         }
     }
 }
Esempio n. 4
0
        public void SetDebugMode()
        {
            var rand = new Random();
            var sr   = new SpriteRequirementCollection();
            var sg   = new SpriteGroupCollection(romData, rand, sr);

            sg.LoadSpriteGroups();
            var rc  = new RoomCollection(romData, rand, sg, sr);
            var owa = new OverworldAreaCollection(romData, rand, sg, sr);

            rc.LoadRooms();

            if (optionFlags.DebugForceBoss)
            {
                // this is set in the boss randomizer because there is too much to do after picking a boss
            }
            if (optionFlags.DebugForceEnemy)
            {
                SetDungeonEnemy(rc);
                SetOverworldEnemy(owa);
                SetSpriteGroups(sg, sr);
            }
            if (optionFlags.DebugOpenShutterDoors)
            {
                RemoveKillRooms(rc);
            }
            if (optionFlags.DebugForceEnemyDamageZero)
            {
                SetEnemyDamageZero();
            }

            if (optionFlags.DebugShowRoomIdInRupeeCounter)
            {
                // put the room id in the rupee slot
                this.romData[0x1017A9]     = 0xA0;
                this.romData[0x1017A9 + 1] = 0x00;
                this.romData[0x1017A9 + 2] = 0x7E;
            }

            rc.UpdateRom();
            owa.UpdateRom();
            sg.UpdateRom();
        }