require 'Items/ProceduralDistributions'
local dM = 1.0
local dakilocations= {
    BedroomDresser = .05 * dM,
    BedroomDresserClassy = .02 * dM,
    BedroomDresserRedneck = .08 * dM,
    CrateLinens = .02 * dM,
    CrateRandomJunk = .02 * dM,
    GigamartBedding = .02 * dM,
    LingerieStoreAccessories = .1 * dM,
    MotelLinens = .02 * dM,
    StripClubDressers = 0.1 * dM,
    VacationStuff = .02 * dM,
    WardrobeClassy = .02 * dM,
    WardrobeGeneric = .02 * dM,
    WardrobeRedneck = .08 * dM,
}
local mM = 1.0
local mangalocations= {
    BookstoreBooks = 0.1 * mM,
    ClassroomDesk = 0.2 * mM,
    ComicStoreDisplayBooks = 0.4 * mM,
    CrateBooks = 0.01 * mM,
    LibraryBooks = 0.2 * mM,
    LivingRoomShelf = 0.2 * mM,
    ShelfGeneric = 0.1 * mM,
    LivingRoomShelfNoTapes = 0.1* mM,
    SchoolLockers = 0.4 * mM,
}

local DakimakuraWeapons = require("DakimakuraList")
local OpaiZList = require("OpaiZList")

local insert = table.insert
local list = ProceduralDistributions.list
local function addItems(dist,loot)
    for i = 1, #loot do
        insert(dist,loot[i])
    end
end

local function addMyDistributions()
    if SandboxVars.BigDegens.Junk then
        local sB = SandboxVars.BigDegens.JunkSpawnRate
        local item = "Base.BenniPow"
        --Benni & PowPow's
        addItems(list["FreezerTrailerPark"].items, {item, 0.13 * sB,});
        addItems(list["FreezerGeneric"].items, {item, 0.16 * sB,});
        addItems(list["FreezerRich"].items, {item, 0.1 * sB,});
        addItems(list["FreezerIceCream"].items, {item, 0.1 * sB,});
        addItems(list["TheatreKitchenFreezer"].items, {item, 1.5 * sB,});
    end
    --Dakis
    if SandboxVars.BigDegens.Dakis and DakimakuraWeapons:size() > 0 then
                for loc,val in pairs(dakilocations)do
                        addItems(list[loc].items,{"Base.dakiDummy", val * SandboxVars.BigDegens.DakiSpawnRate,})
                end
    end
    --Manga
    if SandboxVars.BigDegens.Manga and OpaiZList:size() > 0 then
        --rubNtug Spawns
        local item = "Base.RubNTug"
        addItems(list["BathroomShelf"].items,{item, 0.13,})
        addItems(list["BathroomCounterNoMeds"].items,{item, 0.13,})
        addItems(list["BathroomCounter"].items,{item, 0.13,})
        addItems(list["BathroomCabinet"].items,{item, 0.13,})
           --Manga/Doujinshi
            for loc,val in pairs(mangalocations)do
                    addItems(list[loc].items,{"Base.mangaDummy", val * SandboxVars.BigDegens.MangaSpawnRate,})
            end

    end
   ItemPickerJava.Parse()
end
Events.OnInitGlobalModData.Add(addMyDistributions)