Beispiel #1
0
        public MazeIsland(Hyrule hy)
            : base(hy)
        {
            LoadLocations(0xA131, 4, _terrains);
            LoadLocations(0xA140, 1, _terrains);
            LoadLocations(0xA143, 1, _terrains);
            LoadLocations(0xA145, 5, _terrains);

            _enemyAddr = 0x88B0;
            _enemies   = new List <int> {
                03, 04, 05, 0x11, 0x12, 0x14, 0x16, 0x18, 0x19, 0x1A, 0x1B, 0x1C
            };
            _flyingEnemies = new List <int> {
                0x06, 0x07, 0x0A, 0x0D, 0x0E, 0x15
            };
            _generators = new List <int> {
                0x0B, 0x0F, 0x17
            };
            _shorties = new List <int> {
                0x03, 0x04, 0x05, 0x11, 0x12, 0x16
            };
            _tallGuys = new List <int> {
                0x14, 0x18, 0x19, 0x1A, 0x1B, 0x1C
            };
            _enemyPtr      = 0xA08E;
            _overworldMaps = new List <int>();

            _kid            = GetLocationByMem(0xA143);
            _magic          = GetLocationByMem(0xA133);
            _palace4        = GetLocationByMem(0xA140);
            _palace4.PalNum = 4;
            _start          = GetLocationByMem(0xA134);
            _mapRows        = 20;
            _mapCols        = 64;
        }
Beispiel #2
0
        public static void GenerateRom(RandomizerSettings settings, Options o)
        {
            Console.WriteLine("Generating...", Color.Blue);
            //TODO we can remove the Seed param
            var romGenerator = new Hyrule(settings.GetRandomizerProperties(o.RomPath));

            romGenerator.GenerateRom();
            Console.WriteLine("Done...", Color.Green);
        }
Beispiel #3
0
 public Palace(int number, int b, int c, Hyrule h)
 {
     _num            = number;
     _root           = null;
     _upExits        = new List <Room>();
     _downExits      = new List <Room>();
     _leftExits      = new List <Room>();
     _rightExits     = new List <Room>();
     _onlyDownExits  = new List <Room>();
     _rooms          = new SortedDictionary <int, List <Room> >();
     AllRooms        = new List <Room>();
     _numRooms       = 0;
     _baseAddr       = b;
     _connAddr       = c;
     _hy             = h;
     NeedDstab       = false;
     NeedFairy       = false;
     NeedGlove       = false;
     NeedJumpOrFairy = false;
     LoadMaps();
     CreateTree();
 }
Beispiel #4
0
 protected World(Hyrule parent)
 {
     _hy          = parent;
     Caves        = new List <Location>();
     Towns        = new List <Location>();
     Palaces      = new List <Location>();
     Grasses      = new List <Location>();
     Swamps       = new List <Location>();
     Bridges      = new List <Location>();
     Deserts      = new List <Location>();
     Forests      = new List <Location>();
     Graves       = new List <Location>();
     Lavas        = new List <Location>();
     Roads        = new List <Location>();
     _connections = new Dictionary <Location, Location>();
     _locations   = new List <Location>[11] {
         Towns, Caves, Palaces, Bridges, Deserts, Grasses, Forests, Swamps, Graves, Roads, Lavas
     };
     AllLocations    = new List <Location>();
     _locsByCoords   = new SortedDictionary <Tuple <int, int>, Location>();
     _reachableAreas = new HashSet <string>();
     _visitedEnemies = new List <int>();
 }
Beispiel #5
0
        public IActionResult OnPostUpload()
        {
            if (SmallDropPool.Any(x => x.Selected))
            {
                SettingsModel.SmallEnemyPool = SmallDropPool.Where(x => x.Selected).Select(x => x.Enum).ToList();
            }
            if (LargeDropPool.Any(x => x.Selected))
            {
                SettingsModel.LargeEnemyPool = LargeDropPool.Where(x => x.Selected).Select(x => x.Enum).ToList();
            }

            //disabled values don't post
            if (!SettingsModel.ShufflePalaceRooms && !SettingsModel.ThunderbirdRequired)
            {
                SettingsModel.ThunderbirdRequired = true;
            }

            if (SettingsModel.ShuffleAllExperienceNeeded)
            {
                SettingsModel.ShuffleAttackExperienceNeeded = true;
                SettingsModel.ShuffleMagicExperienceNeeded  = true;
                SettingsModel.ShuffleLifeExperienceNeeded   = true;
            }

            using (var fileStream = RomFile.OpenReadStream())
            {
                //generate rom, json
                var romGenerator = new Hyrule(SettingsModel.GetRandomizerProperties(RomFile.FileName, fileStream));
                var rom          = romGenerator.GenerateRomStream();

                return(new FileStreamResult(rom.OutputStream, "application/octet-stream")
                {
                    FileDownloadName = rom.FileName
                });
            }
        }
Beispiel #6
0
        public DeathMountain(Hyrule hy)
            : base(hy)
        {
            LoadLocations(0x610C, 37, _terrains);
            LoadLocations(0x6136, 2, _terrains);
            LoadLocations(0x6144, 1, _terrains);

            _hammerCave  = GetLocationByMem(0x6128);
            _hammerEnter = GetLocationByMem(0x6136);
            _hammerExit  = GetLocationByMem(0x6137);
            _magicCave   = GetLocationByMem(0x6144);

            _reachableAreas = new HashSet <string>();
            _connectionsDm  = new Dictionary <Location, List <Location> >
            {
                { GetLocationByMem(0x610C), new List <Location>()
                  {
                      GetLocationByMem(0x610D)
                  } },
                { GetLocationByMem(0x610D), new List <Location>()
                  {
                      GetLocationByMem(0x610C)
                  } },
                { GetLocationByMem(0x610E), new List <Location>()
                  {
                      GetLocationByMem(0x610F)
                  } },
                { GetLocationByMem(0x610F), new List <Location>()
                  {
                      GetLocationByMem(0x610E)
                  } },
                { GetLocationByMem(0x6110), new List <Location>()
                  {
                      GetLocationByMem(0x6111)
                  } },
                { GetLocationByMem(0x6111), new List <Location>()
                  {
                      GetLocationByMem(0x6110)
                  } },
                { GetLocationByMem(0x6112), new List <Location>()
                  {
                      GetLocationByMem(0x6113)
                  } },
                { GetLocationByMem(0x6113), new List <Location>()
                  {
                      GetLocationByMem(0x6112)
                  } },
                { GetLocationByMem(0x6114), new List <Location>()
                  {
                      GetLocationByMem(0x6115)
                  } },
                { GetLocationByMem(0x6115), new List <Location>()
                  {
                      GetLocationByMem(0x6114)
                  } },
                { GetLocationByMem(0x6116), new List <Location>()
                  {
                      GetLocationByMem(0x6117)
                  } },
                { GetLocationByMem(0x6117), new List <Location>()
                  {
                      GetLocationByMem(0x6116)
                  } },
                { GetLocationByMem(0x6118), new List <Location>()
                  {
                      GetLocationByMem(0x6119)
                  } },
                { GetLocationByMem(0x6119), new List <Location>()
                  {
                      GetLocationByMem(0x6118)
                  } },
                { GetLocationByMem(0x611A), new List <Location>()
                  {
                      GetLocationByMem(0x611B)
                  } },
                { GetLocationByMem(0x611B), new List <Location>()
                  {
                      GetLocationByMem(0x611A)
                  } },
                { GetLocationByMem(0x611C), new List <Location>()
                  {
                      GetLocationByMem(0x611D)
                  } },
                { GetLocationByMem(0x611D), new List <Location>()
                  {
                      GetLocationByMem(0x611C)
                  } },
                { GetLocationByMem(0x611E), new List <Location>()
                  {
                      GetLocationByMem(0x611F)
                  } },
                { GetLocationByMem(0x611F), new List <Location>()
                  {
                      GetLocationByMem(0x611E)
                  } },
                { GetLocationByMem(0x6120), new List <Location>()
                  {
                      GetLocationByMem(0x6121)
                  } },
                { GetLocationByMem(0x6121), new List <Location>()
                  {
                      GetLocationByMem(0x6120)
                  } },
                { GetLocationByMem(0x6122), new List <Location>()
                  {
                      GetLocationByMem(0x6123)
                  } },
                { GetLocationByMem(0x6123), new List <Location>()
                  {
                      GetLocationByMem(0x6122)
                  } },
                { GetLocationByMem(0x6124), new List <Location>()
                  {
                      GetLocationByMem(0x6125)
                  } },
                { GetLocationByMem(0x6125), new List <Location>()
                  {
                      GetLocationByMem(0x6124)
                  } },
                { GetLocationByMem(0x6126), new List <Location>()
                  {
                      GetLocationByMem(0x6127)
                  } },
                { GetLocationByMem(0x6127), new List <Location>()
                  {
                      GetLocationByMem(0x6126)
                  } },
                {
                    GetLocationByMem(0x6129),
                    new List <Location>()
                    {
                        GetLocationByMem(0x612A), GetLocationByMem(0x612B), GetLocationByMem(0x612C)
                    }
                },
                {
                    GetLocationByMem(0x612D),
                    new List <Location>()
                    {
                        GetLocationByMem(0x612E), GetLocationByMem(0x612F), GetLocationByMem(0x6130)
                    }
                },
                {
                    GetLocationByMem(0x612E),
                    new List <Location>()
                    {
                        GetLocationByMem(0x612D), GetLocationByMem(0x612F), GetLocationByMem(0x6130)
                    }
                },
                {
                    GetLocationByMem(0x612F),
                    new List <Location>()
                    {
                        GetLocationByMem(0x612E), GetLocationByMem(0x612D), GetLocationByMem(0x6130)
                    }
                },
                {
                    GetLocationByMem(0x6130),
                    new List <Location>()
                    {
                        GetLocationByMem(0x612E), GetLocationByMem(0x612F), GetLocationByMem(0x612D)
                    }
                }
            };

            _enemies = new List <int> {
                3, 4, 5, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 31, 32
            };
            _flyingEnemies = new List <int> {
                0x06, 0x07, 0x0A, 0x0D, 0x0E
            };
            _generators = new List <int> {
                11, 12, 15, 29
            };
            _shorties = new List <int> {
                3, 4, 5, 17, 18, 0x1C, 0x1F
            };
            _tallGuys = new List <int> {
                0x20, 20, 21, 22, 23, 24, 25, 26, 27
            };
            _enemyAddr = 0x48B0;
            _enemyPtr  = 0x608E;

            _overworldMaps = new List <int>();
            _mapRows       = 45;
            _mapCols       = 64;
        }
Beispiel #7
0
        public WestHyrule(Hyrule hy)
            : base(hy)
        {
            LoadLocations(0x462F, 31, _terrains);
            LoadLocations(0x464F, 1, _terrains);
            LoadLocations(0x4658, 5, _terrains);
            LoadLocations(0x465E, 8, _terrains);
            _start          = GetLocationByMap(0x80, 0x00);
            _reachableAreas = new HashSet <string>();
            _hammerEnter    = GetLocationByMap(0x2A, 1);
            _hammerExit     = GetLocationByMap(0x2B, 1);
            var jumpCave = GetLocationByMap(9, 0);

            jumpCave.NeedJump = true;
            _medicineCave     = GetLocationByMap(0x0E, 0);
            var heartCave = GetLocationByMap(0x10, 0);
            var fairyCave = GetLocationByMap(0x12, 0);

            fairyCave.NeedFairy = true;
            _jump               = GetLocationByMap(0xC5, 4);
            _bagu               = GetLocationByMap(0x18, 4);
            _fairy              = GetLocationByMap(0xCB, 4);
            _lifeNorth          = GetLocationByMap(0xC8, 4);
            _lifeSouth          = GetLocationByMap(0x06, 4);
            _lifeNorth.NeedBagu = true;
            _lifeSouth.NeedBagu = true;
            _trophyCave         = GetLocationByMap(0xE1, 0);
            _raftSpot           = GetLocationByMem(0x4658);
            _palaceOne          = GetLocationByMem(0x4663);
            _palaceOne.PalNum   = 1;
            _palaceTwo          = GetLocationByMem(0x4664);
            _palaceTwo.PalNum   = 2;
            _palaceThree        = GetLocationByMem(0x4665);
            _palaceThree.PalNum = 3;
            _jar        = GetLocationByMem(0x4632);
            _heartOne   = GetLocationByMem(0x463F);
            _heartTwo   = GetLocationByMem(0x4634);
            _shieldTown = GetLocationByMem(0x465C);
            _pbagCave   = GetLocationByMem(0x463D);


            var parapaCaveOne = GetLocationByMap(07, 0);
            var parapaCaveTwo = GetLocationByMap(0xC7, 0);
            var jumpCaveTwo   = GetLocationByMap(0xCB, 0);
            var fairyCaveTwo  = GetLocationByMap(0xD3, 0);

            _bridgeOne = GetLocationByMap(0x04, 0);
            _bridgeTwo = GetLocationByMap(0xC5, 0);

            _caveConn   = new Dictionary <Location, Location>();
            _bridgeConn = new Dictionary <Location, Location>();
            _cityConn   = new Dictionary <Location, Location>();
            _graveConn  = new Dictionary <Location, Location>();

            //connections.Add(hammerEnter, hammerExit);
            //connections.Add(hammerExit, hammerEnter);
            //caveConn.Add(hammerEnter, hammerExit);
            //caveConn.Add(hammerExit, hammerEnter);
            _connections.Add(parapaCaveOne, parapaCaveTwo);
            _connections.Add(parapaCaveTwo, parapaCaveOne);
            _caveConn.Add(parapaCaveOne, parapaCaveTwo);
            _caveConn.Add(parapaCaveTwo, parapaCaveOne);
            _connections.Add(jumpCave, jumpCaveTwo);
            _connections.Add(jumpCaveTwo, jumpCave);
            _caveConn.Add(jumpCave, jumpCaveTwo);
            _caveConn.Add(jumpCaveTwo, jumpCave);
            _connections.Add(fairyCave, fairyCaveTwo);
            _connections.Add(fairyCaveTwo, fairyCave);
            _caveConn.Add(fairyCaveTwo, fairyCave);
            _graveConn.Add(fairyCave, fairyCaveTwo);
            _connections.Add(_lifeNorth, _lifeSouth);
            _connections.Add(_lifeSouth, _lifeNorth);
            _cityConn.Add(_lifeSouth, _lifeNorth);
            _cityConn.Add(_lifeNorth, _lifeSouth);
            _connections.Add(_bridgeOne, _bridgeTwo);
            _connections.Add(_bridgeTwo, _bridgeOne);
            _bridgeConn.Add(_bridgeOne, _bridgeTwo);
            _bridgeConn.Add(_bridgeTwo, _bridgeOne);

            _enemies = new List <int> {
                3, 4, 5, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 31, 32
            };
            _flyingEnemies = new List <int> {
                0x06, 0x07, 0x0A, 0x0D, 0x0E
            };
            _generators = new List <int> {
                11, 12, 15, 29
            };
            _shorties = new List <int> {
                3, 4, 5, 17, 18, 0x1C, 0x1F
            };
            _tallGuys = new List <int> {
                0x20, 20, 21, 22, 23, 24, 25, 26, 27
            };
            _enemyAddr = 0x48B0;
            _enemyPtr  = 0x45B1;

            _overworldMaps = new List <int>()
            {
                0x22, 0x1D, 0x27, 0x30, 0x23, 0x3A, 0x1E, 0x35, 0x28
            };
            _mapRows = 75;
            _mapCols = 64;
        }