Exemple #1
0
        public OwMapExchange(FF1Rom _rom, OverworldMap _overworldMap, OwMapExchangeData replacement)
        {
            rom          = _rom;
            overworldMap = _overworldMap;

            exit      = new ExitTeleData(rom);
            locations = new OwLocationData(rom);
            domains   = new DomainData(rom);

            data = replacement;

            ShipLocations = new ShipLocations(locations, data.ShipLocations);
        }
Exemple #2
0
        public OwMapExchange(FF1Rom _rom, OverworldMap _overworldMap, string _name)
        {
            rom          = _rom;
            overworldMap = _overworldMap;
            name         = _name;

            exit      = new ExitTeleData(rom);
            locations = new OwLocationData(rom);
            domains   = new DomainData(rom);

            data = LoadJson(name);

            ShipLocations = new ShipLocations(locations, data.ShipLocations);
        }
Exemple #3
0
        public SanityCheckerV2(List <Map> _maps, OverworldMap _overworldMap, NPCdata _npcdata, FF1Rom _rom, ItemShopSlot _declaredShopSlot, ShipLocations _shiplocations)
        {
            rom          = _rom;
            overworldMap = _overworldMap;
            maps         = _maps;
            npcdata      = _npcdata;

            locations = new OwLocationData(rom);
            locations.LoadData();

            Shiplocations = _shiplocations;

            allTreasures     = ItemLocations.AllTreasures.Select(r => r as TreasureChest).Where(r => r != null).ToDictionary(r => (byte)(r.Address - 0x3100));
            allQuestNpcs     = ItemLocations.AllNPCItemLocations.Select(r => r as MapObject).Where(r => r != null).ToDictionary(r => r.ObjectId);
            declaredShopSlot = _declaredShopSlot;

            UpdateNpcRequirements();

            Main = new SCMain(_maps, _overworldMap, _npcdata, locations, _rom);
        }
Exemple #4
0
        public OwMapExchange(FF1Rom _rom, Flags flags, OverworldMap _overworldMap, MT19337 rng)
        {
            rom          = _rom;
            overworldMap = _overworldMap;

            exit      = new ExitTeleData(rom);
            locations = new OwLocationData(rom);
            domains   = new DomainData(rom);

            string name;

            if (flags.OwShuffledAccess && flags.OwUnsafeStart)
            {
                name = "unsafe256.zip";
            }
            else if (flags.OwShuffledAccess && !flags.OwUnsafeStart)
            {
                name = "shuffled256.zip";
            }
            else
            {
                name = "normal256.zip";
            }

            var assembly     = System.Reflection.Assembly.GetExecutingAssembly();
            var resourcePath = assembly.GetManifestResourceNames().First(str => str.EndsWith(name));

            using Stream stream = assembly.GetManifestResourceStream(resourcePath);

            var archive = new ZipArchive(stream);

            var maplist = archive.Entries.Where(e => e.Name.EndsWith(".json")).Select(e => e.Name).ToList();

            var map = maplist.PickRandom(rng);

            data = LoadJson(archive.GetEntry(map).Open());

            ShipLocations = new ShipLocations(locations, data.ShipLocations);
        }
 public ShipLocations(OwLocationData _locations, ShipLocation[] _data)
 {
     locations = _locations;
     data      = _data;
 }