Esempio n. 1
0
        private void WriteItems()
        {
            if (Settings.LogicMode == LogicMode.Vanilla)
            {
                WriteFreeItem(Items.MaskDeku);

                if (Settings.ShortenCutscenes)
                {
                    //giants cs were removed
                    WriteFreeItem(Items.SongOath);
                }

                return;
            }

            //write free item
            int itemId = ItemList.FindIndex(u => u.ReplacesItemId == 0);

            WriteFreeItem(ItemList[itemId].ID);

            //write everything else
            ROMFuncs.ReplaceGetItemTable(ModsDirectory);
            ROMFuncs.InitItems();

            for (int i = 0; i < ItemList.Count; i++)
            {
                itemId = ItemList[i].ID;

                // Unused item
                if (ItemList[i].ReplacesItemId == -1)
                {
                    continue;
                }
                ;

                bool isRepeatable      = Items.REPEATABLE.Contains(itemId);
                bool isCycleRepeatable = Items.CYCLE_REPEATABLE.Contains(itemId);
                int  replacesItemId    = ItemList[i].ReplacesItemId;

                itemId -= ItemUtils.GetItemOffset(itemId);

                replacesItemId -= ItemUtils.GetItemOffset(replacesItemId);

                if (ItemUtils.IsBottleCatchContent(i))
                {
                    ROMFuncs.WriteNewBottle(replacesItemId, itemId);
                }
                else
                {
                    ROMFuncs.WriteNewItem(replacesItemId, itemId, isRepeatable, isCycleRepeatable);
                }
            }

            if (Settings.AddShopItems)
            {
                ROMFuncs.ApplyHack(ModsDirectory + "fix-shop-checks");
            }
        }