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

local function onequip(inst, owner) 
    owner.AnimState:OverrideSymbol("swap_body", "poshsweatervest", "swap_body")
    inst.components.fueled:StartConsuming()
end

local function onunequip(inst, owner) 
    owner.AnimState:ClearOverrideSymbol("swap_body")
    inst.components.fueled:StopConsuming()
end

local function onperish(inst)
	inst:Remove()
end


local function fn(Sim)
	local inst = CreateEntity()
	local trans = inst.entity:AddTransform()
	local anim = inst.entity:AddAnimState()
    MakeInventoryPhysics(inst)
    
    anim:SetBank("poshsweatervest")
    anim:SetBuild("poshsweatervest")
    anim:PlayAnimation("anim")
	
	-- if IsDLCEnabled(CAPY_DLC) then
		-- Make floatable
		-- MakeInventoryFloatable(inst, "idle_water", "idle")
	--end
	
    inst:AddComponent("inspectable")
    inst:AddComponent("inventoryitem")
	inst.components.inventoryitem.atlasname = "images/inventoryimages/poshsweatervest.xml"
  
	
	inst:AddComponent("fueled")
	inst.components.fueled.fueltype = "USAGE"
	inst.components.fueled:InitializeFuelLevel(TUNING.EARMUFF_PERISHTIME)
	inst.components.fueled:SetDepletedFn(onperish)
	
	
    inst:AddComponent("insulator")
    inst.components.insulator.insulation = TUNING.INSULATION_LARGE
	
	inst:AddComponent("dapperness")
    inst.components.dapperness.dapperness = TUNING.DAPPERNESS_SMALL
	
    inst:AddComponent("equippable")
    inst.components.equippable.equipslot = EQUIPSLOTS.BODY
    
    inst.components.equippable:SetOnEquip( onequip )
    inst.components.equippable:SetOnUnequip( onunequip )
	
    
    return inst
end


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