local assets =
{
    Asset("ANIM", "anim/potie.zip"),
    Asset("ANIM", "anim/swap_potie.zip"),
	Asset("IMAGE","images/inventoryimages/tisuiya.tex"),
	Asset("ATLAS","images/inventoryimages/tisuiya.xml")
}

local function onequip(inst, owner)
inst:AddTag("feng")
    owner.AnimState:OverrideSymbol("swap_object", "swap_potie", "swap_potie")
    owner.AnimState:Show("ARM_carry")
    owner.AnimState:Hide("ARM_normal")

end

local function onunequip(inst, owner)
inst:RemoveTag("feng")
    owner.AnimState:Hide("ARM_carry")
    owner.AnimState:Show("ARM_normal")
inst:DoTaskInTime(0.1,function()inst:Remove()end)
end


local function fn()
    local inst = CreateEntity()

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

    MakeInventoryPhysics(inst)

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

    inst:AddTag("sharp")

    inst.entity:SetPristine()

    if not TheWorld.ismastersim then
        return inst
    end

    inst:AddComponent("weapon")
    inst.components.weapon:SetDamage(5)

    -------
    --inst.components.weapon:SetRange()



    inst:AddComponent("inspectable")

    inst:AddComponent("inventoryitem")
	inst.components.inventoryitem.imagename = "tisuiya"
    inst.components.inventoryitem.atlasname = "images/inventoryimages/tisuiya.xml"
	
inst:AddComponent("tool")
	inst.components.tool:SetAction(ACTIONS.CHOP, 3)
        inst.components.tool:SetAction(ACTIONS.MINE, 2)
		
    inst:AddComponent("equippable")
    inst.components.equippable:SetOnEquip(onequip)
    inst.components.equippable:SetOnUnequip(onunequip)



    MakeHauntableLaunch(inst)

    return inst
end

return Prefab( "common/inventory/potie", fn, assets)