local function dbg(s)
    log(s, "Motu")
end

local function forEach(enumerable, f)
    em = enumerable:GetEnumerator()
    while em:MoveNext() do
        f(em.Current)
    end
end

local function getType(name, prefix)
    return celeste.Mod[modName].MethodWrappers.GetTypeFromString(name, prefix)
end

function onBegin()
    makeUnskippable()

    local silverBerries = {}
    local i = 1
    forEach(player.Leader.Followers, function(f)
        if getType("Mod.CollabUtils2.Entities.SilverBerry"):IsInstanceOfType(f.Entity) then
            silverBerries[i] = f.Entity
            i = i + 1
        end
    end)
    for _, b in ipairs(silverBerries) do
        b:OnCollect()
        wait(0.3)
    end
end
