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



local function onequip(inst, owner) 
    owner.AnimState:OverrideSymbol("swap_object", "swap_jc", "swap_hammer")
    owner.AnimState:Show("ARM_carry") 
    owner.AnimState:Hide("ARM_normal") 
end

local function onunequip(inst, owner) 
    owner.AnimState:Hide("ARM_carry") 
    owner.AnimState:Show("ARM_normal") 
end

local function fn(Sim)
	local inst = CreateEntity()
	local trans = inst.entity:AddTransform()
	local anim = inst.entity:AddAnimState()
	
     MakeInventoryPhysics(inst)
if SaveGameIndex:IsModeShipwrecked() then
  
	MakeInventoryFloatable(inst, "idle", "idle")
end
    inst:AddComponent("inspectable")

      
   
    
    anim:SetBank("hammer")
    anim:SetBuild("jc")
    anim:PlayAnimation("idle")
  
    
    inst:AddTag("hammer")
    
    inst:AddComponent("weapon")
    inst.components.weapon:SetDamage(40)

    -----
    
  inst:AddComponent("tool")
    inst.components.tool:SetAction(ACTIONS.HAMMER,10)
    -------
 inst:AddComponent("finiteuses")
    inst.components.finiteuses:SetMaxUses(TUNING.HAMMER_USES)
    inst.components.finiteuses:SetUses(TUNING.HAMMER_USES)

    inst.components.finiteuses:SetOnFinished(inst.Remove)
    inst.components.finiteuses:SetConsumption(ACTIONS.HAMMER, 1)
    
    

  
    
    inst:AddComponent("inventoryitem")
	inst.components.inventoryitem.atlasname = "images/inventoryimages/jc.xml"
   
    inst:AddComponent("equippable")
    inst.components.equippable:SetOnEquip( onequip )
    inst.components.equippable:SetOnUnequip( onunequip)

    
    
    
 
    
    
    
    return inst
end


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

