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

local function onequip(inst, owner)
	owner.AnimState:OverrideSymbol("swap_object", "swap_houndsbite", "swap_nightmaresword")
	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()
	inst.entity:AddNetwork()

	MakeInventoryPhysics(inst)

	inst.AnimState:SetBank("nightmaresword")
	inst.AnimState:SetBuild("houndsbite")
	inst.AnimState:PlayAnimation("idle")
	--inst.AnimState:SetMultColour(1, 1, 1, 1)

	inst:AddTag("sharp")

	inst.entity:SetPristine()
	if not TheWorld.ismastersim then
		return inst
	end

	inst:AddComponent("weapon")
	inst.components.weapon:SetDamage(TUNING.MAD_HOUNDSBITE.damage) --50

	inst:AddComponent("finiteuses")
	inst.components.finiteuses:SetMaxUses(TUNING.MAD_HOUNDSBITE.uses) --150
	inst.components.finiteuses:SetUses(TUNING.MAD_HOUNDSBITE.uses)
	inst.components.finiteuses:SetOnFinished( inst.Remove )

	inst:AddComponent("inspectable")

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

	MakeHauntableLaunch(inst)

	return inst
end

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