public ExtSpoiler(FF1Rom _rom, SanityCheckerV2 _checker, ShopData _shopData, ItemNames _itemsText, List <IRewardSource> _itemPlacement, OverworldMap _overworldMap, IncentiveData _incentivesData, GearPermissions _weaponPermissions, GearPermissions _armorPermissions, Flags _flags)
        {
            rom               = _rom;
            checker           = _checker;
            shopData          = _shopData;
            itemsText         = _itemsText;
            itemPlacement     = _itemPlacement;
            overworldMap      = _overworldMap;
            incentivesData    = _incentivesData;
            weaponPermissions = _weaponPermissions;
            armorPermissions  = _armorPermissions;
            flags             = _flags;

            logic       = new SCLogic(rom, checker.Main, itemPlacement, flags, false);
            weapons     = Weapon.LoadAllWeapons(rom, flags).ToList();
            armors      = Armor.LoadAllArmors(rom, flags).ToList();
            magicSpells = rom.GetSpells();
        }
Example #2
0
        public Archipelago(FF1Rom _rom, List <IRewardSource> generatedPlacement, SanityCheckerV2 checker, ExpChests _expChests, IncentiveData _incentivesData, Flags _flags, Preferences _preferences)
        {
            rom            = _rom;
            expChests      = _expChests;
            incentivesData = _incentivesData;
            flags          = _flags;
            preferences    = _preferences;

            var kiPlacement = generatedPlacement.Where(r => ItemLists.AllQuestItems.Contains(r.Item) && r.Item != Item.Bridge).ToList();

            if (flags.ArchipelagoConsumables)
            {
                if (flags.ExtConsumablesEnabled)
                {
                    kiPlacement.AddRange(generatedPlacement.Where(r => r.Item >= Item.Tent && r.Item <= Item.Rapier));
                }
                else
                {
                    kiPlacement.AddRange(generatedPlacement.Where(r => r.Item >= Item.Tent && r.Item <= Item.Soft));
                }
            }

            if (flags.ArchipelagoShards)
            {
                kiPlacement.AddRange(generatedPlacement.Where(r => r.Item == Item.Shard));
            }

            if (flags.ArchipelagoGold)
            {
                kiPlacement.AddRange(generatedPlacement.Where(r => r.Item >= Item.Gold10 && r.Item < expChests.FirstExpItem));
            }

            switch (flags.ArchipelagoEquipment)
            {
            case ArchipelagoEquipment.Common:
                AddCommonEquipment(kiPlacement, generatedPlacement);
                AddRareEquipment(kiPlacement, generatedPlacement);
                AddLegendaryEquipment(kiPlacement, generatedPlacement);
                AddCasterEquipment(kiPlacement, generatedPlacement);
                break;

            case ArchipelagoEquipment.Rare:
                AddRareEquipment(kiPlacement, generatedPlacement);
                AddLegendaryEquipment(kiPlacement, generatedPlacement);
                AddCasterEquipment(kiPlacement, generatedPlacement);
                break;

            case ArchipelagoEquipment.Legendary:
                AddLegendaryEquipment(kiPlacement, generatedPlacement);
                AddCasterEquipment(kiPlacement, generatedPlacement);
                break;

            case ArchipelagoEquipment.CasterItems:
                AddCasterEquipment(kiPlacement, generatedPlacement);
                break;

            case ArchipelagoEquipment.Incentivized:
                AddIncentivizedEquipment(kiPlacement, generatedPlacement);
                break;
            }

            //Remove ToFr and distinct by address to remove duplicates
            kiPlacement = kiPlacement.Where(r => !ItemLocations.ToFR.Any(l => l.Address == r.Address)).GroupBy(r => r.Address).Select(g => g.First()).ToList();

            logic = new SCLogic(rom, checker.Main, kiPlacement, flags, true);
        }