require 'Items/ProceduralDistributions'

local DakimakuraWeapons = require("DakimakuraList")
local OpaiZList = require("OpaiZList")
local function addMyDistributions()
    if SandboxVars.BigDegens.Junk then
        --Benni & PowPow's
        table.insert(ProceduralDistributions["list"]["FreezerTrailerPark"].items, "Base.BenniPow");
        table.insert(ProceduralDistributions["list"]["FreezerTrailerPark"].items, 0.13 * SandboxVars.BigDegens.JunkSpawnRate);
        table.insert(ProceduralDistributions["list"]["FreezerGeneric"].items, "Base.BenniPow");
        table.insert(ProceduralDistributions["list"]["FreezerGeneric"].items, 0.16 * SandboxVars.BigDegens.JunkSpawnRate);
        table.insert(ProceduralDistributions["list"]["FreezerRich"].items, "Base.BenniPow");
        table.insert(ProceduralDistributions["list"]["FreezerRich"].items, 0.1 * SandboxVars.BigDegens.JunkSpawnRate);
        table.insert(ProceduralDistributions["list"]["FreezerIceCream"].items, "Base.BenniPow");
        table.insert(ProceduralDistributions["list"]["FreezerIceCream"].items, 2.6 * SandboxVars.BigDegens.JunkSpawnRate);
        table.insert(ProceduralDistributions["list"]["TheatreKitchenFreezer"].items, "Base.BenniPow");
        table.insert(ProceduralDistributions["list"]["TheatreKitchenFreezer"].items, 1.5 * SandboxVars.BigDegens.JunkSpawnRate);
    end

    --Dakis
    if SandboxVars.BigDegens.Dakis then
        local WardrobeMan = ProceduralDistributions["list"]["WardrobeMan"].items
        for i = 0, DakimakuraWeapons:size()-1 do
            table.insert(WardrobeMan, DakimakuraWeapons:get(i))
            table.insert(WardrobeMan, 0.01 * SandboxVars.BigDegens.DakiSpawnRate) -- this is the spawn chance, this should probably be quite low since you're presumably adding lots of items at once
        end
    end
    --Manga
    if SandboxVars.BigDegens.Manga then
        --Rub-N-Tug
        table.insert(ProceduralDistributions["list"]["BathroomShelf"].items, "Base.RubNTug");
        table.insert(ProceduralDistributions["list"]["BathroomShelf"].items, 0.13);
        table.insert(ProceduralDistributions["list"]["BathroomCounterNoMeds"].items, "Base.RubNTug");
        table.insert(ProceduralDistributions["list"]["BathroomCounterNoMeds"].items, 0.13);
        table.insert(ProceduralDistributions["list"]["BathroomCounter"].items, "Base.RubNTug");
        table.insert(ProceduralDistributions["list"]["BathroomCounter"].items, 0.13);
        table.insert(ProceduralDistributions["list"]["BathroomCabinet"].items, "Base.RubNTug");
        table.insert(ProceduralDistributions["list"]["BathroomCabinet"].items, 0.13);
        
        --Manga/Doujinshi
        local BookstoreBooks = ProceduralDistributions["list"]["BookstoreBooks"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(BookstoreBooks, OpaiZList:get(i))
            table.insert(BookstoreBooks, 0.01 * SandboxVars.BigDegens.MangaSpawnRate)
        end
        local ClassroomDesk = ProceduralDistributions["list"]["ClassroomDesk"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(ClassroomDesk, OpaiZList:get(i))
            table.insert(ClassroomDesk, 0.01 * SandboxVars.BigDegens.MangaSpawnRate)
        end
        local CrateBooks = ProceduralDistributions["list"]["CrateBooks"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(CrateBooks, OpaiZList:get(i))
            table.insert(CrateBooks, 0.01 * SandboxVars.BigDegens.MangaSpawnRate)
        end
        local LibraryBooks = ProceduralDistributions["list"]["LibraryBooks"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(LibraryBooks, OpaiZList:get(i))
            table.insert(LibraryBooks, 0.01 * SandboxVars.BigDegens.MangaSpawnRate)
        end
        local LivingRoomShelf = ProceduralDistributions["list"]["LivingRoomShelf"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(LivingRoomShelf, OpaiZList:get(i))
            table.insert(LivingRoomShelf, 0.01 * SandboxVars.BigDegens.MangaSpawnRate)
        end
        local LivingRoomShelfNoTapes = ProceduralDistributions["list"]["LivingRoomShelfNoTapes"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(LivingRoomShelfNoTapes, OpaiZList:get(i))
            table.insert(LivingRoomShelfNoTapes, 0.01 * SandboxVars.BigDegens.MangaSpawnRate)
        end
        local SchoolLockers = ProceduralDistributions["list"]["SchoolLockers"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(SchoolLockers, OpaiZList:get(i))
            table.insert(SchoolLockers, 0.01 * SandboxVars.BigDegens.MangaSpawnRate)
        end
    end
    ItemPickerJava.Parse()
end
Events.OnInitGlobalModData.Add(addMyDistributions)