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; if (ItemUtils.IsItemDefinedPastAreas(itemId)) { // Subtract amount of entries describing areas and other itemId -= Values.NumberOfAreasAndOther; } if (ItemUtils.IsItemDefinedPastAreas(replacesItemId)) { // Subtract amount of entries describing areas and other replacesItemId -= Values.NumberOfAreasAndOther; } if (ItemUtils.IsBottleCatchContent(i)) { ROMFuncs.WriteNewBottle(replacesItemId, itemId); } else { ROMFuncs.WriteNewItem(replacesItemId, itemId, isRepeatable, isCycleRepeatable); } } if (Settings.AddShopItems) { ROMFuncs.ApplyHack(ModsDirectory + "fix-shop-checks"); } }