

local assets =
{
    --Asset("ANIM", "anim/papyrus.zip"),
    --Asset("ANIM", "anim/guardcommand.zip"),
Asset("ANIM", "anim/galientsword.zip"),
    Asset("ATLAS", "images/inventoryimages/galientsword.xml"),
    Asset("IMAGE", "images/inventoryimages/galientsword.tex"),

}

--local function shine(inst)
 --   inst.task = nil
 --   if not inst.AnimState:IsCurrentAnimation("sparkle") then
  --      inst.AnimState:PlayAnimation("sparkle")
      -- inst.AnimState:PushAnimation("idle", true)
 --   end
  --  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:SetBloomEffectHandle("shaders/anim.ksh")
    inst.AnimState:SetBank("galientsword")
    inst.AnimState:SetBuild("galientsword")
    inst.AnimState:PlayAnimation("idle")

    inst:AddTag("paper")
    inst:AddTag("kings")

    inst.entity:SetPristine()

    if not TheWorld.ismastersim then
        return inst
    end

    inst:AddComponent("edible")
    inst.components.edible.foodtype = FOODTYPE.ELEMENTAL
    inst.components.edible.hungervalue = 2
    inst:AddComponent("tradable")

    inst:AddComponent("inspectable")


    inst:AddComponent("inventoryitem")
  inst.components.inventoryitem.imagename = "galientsword"
    inst.components.inventoryitem.atlasname = "images/inventoryimages/galientsword.xml"


    inst:AddComponent("stackable")
    inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM
    inst:AddComponent("bait")

    MakeHauntableLaunchAndSmash(inst)

    --shine(inst)

    return inst
end

return Prefab("guardcommand", fn, assets)
