local assets =
{
    Asset("anim", "anim/silverfeather.zip"),
    Asset("ATLAS", "images/inventoryimages/inventoryfeathersilver.xml"),
    Asset("IMAGE", "images/inventoryimages/inventoryfeathersilver.tex"),
}

local function shine(inst)
    inst.task = nil
    inst.AnimState:PlayAnimation("sparkle")
    inst.AnimState:PushAnimation("idle")
    inst.task = inst:DoTaskInTime(4 + math.random() * 5, shine)
end
--------------------------------------------------------------------------

local function fn()
    local inst = CreateEntity()

    inst.entity:AddTransform()
    inst.entity:AddAnimState()
    inst.entity:AddSoundEmitter()
    inst.entity:AddNetwork()

    MakeInventoryPhysics(inst)

    inst.AnimState:SetBank("silverfeather")
    inst.AnimState:SetBuild("silverfeather")
    inst.AnimState:PlayAnimation("idle")

    inst.entity:SetPristine()

    if not TheWorld.ismastersim then
        return inst
    end
 
    inst:AddComponent("inspectable")
    inst:AddComponent("inventoryitem")
    inst.components.inventoryitem.imagename = "silverfeather"
    inst.components.inventoryitem.atlasname = "images/inventoryimages/inventoryfeathersilver.xml"
	
    shine(inst)
    return inst
end

return Prefab("silverfeather", fn, assets)