public static ItemLocationMap Randomize(Seed seed, FillingMethod fillingMethod, GameSave saveGame, bool progressionOnly = false)
        {
            var unlockingMap     = new ItemUnlockingMap(seed);
            var itemInfoProvider = new ItemInfoProvider(seed.Options, unlockingMap);

            ItemLocationRandomizer randomizer;

            switch (fillingMethod)
            {
            case FillingMethod.Forward:
                randomizer = new ForwardFillingItemLocationRandomizer(seed, itemInfoProvider, unlockingMap);
                break;

            case FillingMethod.Random:
                randomizer = new FullRandomItemLocationRandomizer(seed, itemInfoProvider, unlockingMap);
                break;

            case FillingMethod.Archipelago:
                randomizer = new ArchipelagoItemLocationRandomizer(seed, itemInfoProvider, unlockingMap, saveGame);
                break;

            default:
                throw new NotImplementedException($"filling method {fillingMethod} is not implemented");
            }

            return(randomizer.GenerateItemLocationMap(progressionOnly));
        }
Exemple #2
0
        public void Should_generate_beatable_seed_in_1_pass()
        {
            var seed          = new Seed(1U, SeedOptions.None);
            var unlockingMap  = new ItemUnlockingMap(seed);
            var itemProvder   = new ItemInfoProvider(SeedOptions.None, unlockingMap);
            var itemLocations = new ItemLocationMap(itemProvder, unlockingMap, SeedOptions.None);

            ForwardFillingItemLocationRandomizer.AddRandomItemsToLocationMap(seed, itemProvder, unlockingMap, itemLocations, true);

            Assert.That(itemLocations.IsBeatable(), Is.True);
        }
Exemple #3
0
        public void Should_fill_tuturial_with_melee_and_spellorb(uint seedIndex)
        {
            var seed          = new Seed(seedIndex, SeedOptions.None);
            var unlockingMap  = new ItemUnlockingMap(seed);
            var itemProvder   = new ItemInfoProvider(SeedOptions.None, unlockingMap);
            var itemLocations = new ItemLocationMap(itemProvder, unlockingMap, SeedOptions.None);

            ForwardFillingItemLocationRandomizer.AddRandomItemsToLocationMap(seed, itemProvder, unlockingMap, itemLocations, true);

            Assert.That(itemLocations[ItemKey.TutorialMeleeOrb].ItemInfo.Identifier.LootType, Is.EqualTo(LootType.Orb));
            Assert.That(itemLocations[ItemKey.TutorialMeleeOrb].ItemInfo.Identifier.OrbSlot, Is.EqualTo(EOrbSlot.Melee));

            Assert.That(itemLocations[ItemKey.TutorialSpellOrb].ItemInfo.Identifier.LootType, Is.EqualTo(LootType.Orb));
            Assert.That(itemLocations[ItemKey.TutorialSpellOrb].ItemInfo.Identifier.OrbSlot, Is.EqualTo(EOrbSlot.Spell));
        }
Exemple #4
0
        public static ItemLocationMap Randomize(Seed seed, FillingMethod fillingMethod, bool progressionOnly = false)
        {
            var unlockingMap     = new ItemUnlockingMap(seed);
            var itemInfoProvider = new ItemInfoProvider(seed.Options, unlockingMap);
            var itemLocations    = new ItemLocationMap(itemInfoProvider, unlockingMap, seed.Options);

            switch (fillingMethod)
            {
            case FillingMethod.Forward:
                ForwardFillingItemLocationRandomizer.AddRandomItemsToLocationMap(seed, itemInfoProvider, unlockingMap, itemLocations, progressionOnly);
                break;

            case FillingMethod.Random:
                FullRandomItemLocationRandomizer.AddRandomItemsToLocationMap(seed, itemInfoProvider, unlockingMap, itemLocations, progressionOnly);
                break;

            default:
                throw new NotImplementedException($"filling method {fillingMethod} is not implemented");
            }

            return(itemLocations);
        }