local function isWeeb(player) return player:getDescriptor():getProfession() == 'Weeb' end

local function OnCreatePlayer(n,player)
    local data = player:getModData()
    if data.WaifuDakisWIP_spawned then return end

    if isWeeb(player) then
        local DakimakuraWeapons = DakimakuraWeapons  --global DakimakuraWeapons
        if DakimakuraWeapons and not DakimakuraWeapons:isEmpty() then
            local item = player:getInventory():AddItem(DakimakuraWeapons:get(ZombRand(DakimakuraWeapons:size())))
        end
    end
    if player:HasTrait("Blade") then
        --local item = InventoryItemFactory.CreateItem("Base.Katana")
        --local inv = player:getInventory()
        --inv:Additem(item)
        local item = player:getInventory():AddItem("Base.Katana")
        item:setCondition(item:getCondition()/8)
        player:setPrimaryHandItem(item)
        player:setSecondaryHandItem(item)
        --ISInventoryPage.renderDirty = true
    end
    data.WaifuDakisWIP_spawned = true
end

Events.OnCreatePlayer.Add(OnCreatePlayer)