Exemplo n.º 1
0
        private void AddCasterEquipment(List <IRewardSource> kiPlacement, List <IRewardSource> generatedPlacement)
        {
            var weapons = Weapon.LoadAllWeapons(rom, flags).Where(w => w.Spell != Spell.None).ToList();
            var armors  = Armor.LoadAllArmors(rom, flags).Where(a => a.Spell != Spell.None).ToList();

            HashSet <Item> items = new HashSet <Item>(weapons.Select(w => w.Id).Concat(armors.Select(a => a.Id)));

            kiPlacement.AddRange(generatedPlacement.Where(r => items.Contains(r.Item)));
        }
Exemplo n.º 2
0
        public StartingEquipment(MT19337 _rng, Flags _flags, FF1Rom _rom)
        {
            rng   = _rng;
            flags = _flags;
            rom   = _rom;

            spellHelper = new SpellHelper(rom);
            weapons     = Weapon.LoadAllWeapons(rom, flags).ToList();
            armors      = Armor.LoadAllArmors(rom, flags).ToList();
        }
        public void Work()
        {
            if (flags.RibbonMode == RibbonMode.Removed)
            {
                var armors = Armor.LoadAllArmors(rom, flags).ToList();

                var ribbon = armors.FirstOrDefault(a => a.Id == Item.Ribbon);
                ribbon.ElementalResist = 0x00;
                ribbon.writeArmorMemory(rom);

                itemsText[(int)Item.Ribbon] = "Ripoff";
            }
            else if (flags.RibbonMode == RibbonMode.Split)
            {
                var armors = Armor.LoadAllArmors(rom, flags).ToList();
                rareArmors = new HashSet <Item>(ItemLists.RareArmorTier.Concat(ItemLists.LegendaryArmorTier));

                allElements = new List <SpellElement>();

                for (int i = 0; i < ElementalGroup1Count; i++)
                {
                    allElements.Add(SpellElement.Fire);
                    allElements.Add(SpellElement.Lightning);
                    allElements.Add(SpellElement.Ice);
                    allElements.Add(SpellElement.Earth);
                }

                for (int i = 0; i < ElementalGroup2Count; i++)
                {
                    allElements.Add(SpellElement.Poison);
                    allElements.Add(SpellElement.Time);
                }

                for (int i = 0; i < ElementalGroup3Count; i++)
                {
                    allElements.Add(SpellElement.Death);
                    allElements.Add(SpellElement.Status);
                }

                foreach (var a in armors)
                {
                    a.ElementalResist = 0x00;
                }

                EnsureFullProtectionForAllClasses(armors);

                foreach (var a in armors)
                {
                    a.writeArmorMemory(rom);
                }
            }
        }
        public void ShuffleItemMagic(MT19337 rng, Flags flags)
        {
            IEnumerable <Item> magicWeapons;

            if ((flags.MagisizeWeapons ?? false) && flags.ItemMagicPool == ItemMagicPool.Balanced)
            {
                //this case needs to be done with the original magisize code, because it has a different behavior.
                MagisizeWeaponsBalanced(rng);
                magicWeapons = Weapon.LoadAllWeapons(this, flags).Where(w => w.Spell >= Spell.CURE).Select(w => w.Id);
            }
            else if (flags.MagisizeWeapons ?? false)
            {
                magicWeapons = Weapon.LoadAllWeapons(this, flags).Select(w => w.Id);
            }
            else
            {
                magicWeapons = Weapon.LoadAllWeapons(this, flags).Where(w => w.Spell >= Spell.CURE).Select(w => w.Id);
            }

            var magicArmor = Armor.LoadAllArmors(this, flags).Where(w => w.Spell >= Spell.CURE).Select(w => w.Id);
            var magicItems = magicWeapons.Concat(magicArmor).ToList();

            List <MagicSpell> Spells;

            if (flags.ItemMagicPool == ItemMagicPool.Balanced)
            {
                Spells = GetBalancedSpells(rng);
            }
            else if (flags.ItemMagicPool == ItemMagicPool.Low)
            {
                Spells = GetLowSpells(rng);
            }
            else if (flags.ItemMagicPool == ItemMagicPool.Support)
            {
                Spells = GetSupportSpells(rng);
            }
            else if (flags.ItemMagicPool == ItemMagicPool.Curated)
            {
                Spells = GetTournamentSpells(rng);
            }
            else
            {
                Spells = GetAllSpells(rng);
            }

            foreach (var item in Spells.Zip(magicItems, (s, i) => new { Spell = s, Item = i }))
            {
                WriteItemSpellData(item.Spell, item.Item);
            }
        }
        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();
        }