local assets =
{
	Asset("ANIM", "anim/hat_wood.zip"),
--	Asset("ANIM", "anim/hat_wood_swap.zip"),

	Asset("ATLAS", "images/inventoryimages/hat_wood.xml"),
	Asset("IMAGE", "images/inventoryimages/hat_wood.tex"),
}

local function fn()

	local function onequip(inst, owner)
--		owner.AnimState:OverrideSymbol("swap_hat", "hat_wood_swap", "swap_hat")
		owner.AnimState:OverrideSymbol("swap_hat", "hat_wood", "swap_hat")
		owner.AnimState:Show("HAT")
		owner.AnimState:Show("HAT_HAIR")
		owner.AnimState:Hide("HAIR_NOHAT")
		owner.AnimState:Hide("HAIR")

		if owner:HasTag("player") then
			owner.AnimState:Hide("HEAD")
			owner.AnimState:Show("HEAD_HAT")
		end
	end

	local function onunequip(inst, owner)
		owner.AnimState:Hide("HAT")
		owner.AnimState:Hide("HAT_HAIR")
		owner.AnimState:Show("HAIR_NOHAT")
		owner.AnimState:Show("HAIR")

		if owner:HasTag("player") then
			owner.AnimState:Show("HEAD")
			owner.AnimState:Hide("HEAD_HAT")
		end
	end

	local inst = CreateEntity()

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

	MakeInventoryPhysics(inst)

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

	inst:AddTag("hat")

	inst.entity:SetPristine()

	if not TheWorld.ismastersim then
		return inst
	end

	inst:AddComponent("inspectable")

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

	inst:AddComponent("tradable")

	inst:AddComponent("armor")
	inst.components.armor:InitCondition(650, TUNING.ARMOR_FOOTBALLHAT_ABSORPTION)

    inst:AddComponent("equippable")
    inst.components.equippable.equipslot = EQUIPSLOTS.HEAD
    inst.components.equippable:SetOnEquip(onequip)
    inst.components.equippable:SetOnUnequip(onunequip)

	inst:AddComponent("waterproofer")
    inst.components.waterproofer:SetEffectiveness(TUNING.WATERPROOFNESS_SMALL*2)

    inst:AddComponent("fuel")
    inst.components.fuel.fuelvalue = TUNING.MED_LARGE_FUEL

	MakeHauntableLaunch(inst)

    return inst
end

STRINGS.NAMES.HAT_WOOD 									= "Bucket Helmet"
STRINGS.RECIPE_DESC.HAT_WOOD 							= "A bucket for your head."

STRINGS.CHARACTERS.GENERIC.DESCRIBE.HAT_WOOD 			= "I can think of better uses."
STRINGS.CHARACTERS.WILLOW.DESCRIBE.HAT_WOOD 			= "Keeping my head where it should be."
STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.HAT_WOOD 			= "Is for my head."
STRINGS.CHARACTERS.WENDY.DESCRIBE.HAT_WOOD 				= "A bucket to hold my head in place."
STRINGS.CHARACTERS.WX78.DESCRIBE.HAT_WOOD 				= "IT FAILS TO HAVE ABSOLUTE WATER RESISTANCE."
STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.HAT_WOOD 		= "Crude use for a bucket."
STRINGS.CHARACTERS.WOODIE.DESCRIBE.HAT_WOOD 			= "Looking good!"
STRINGS.CHARACTERS.WAXWELL.DESCRIBE.HAT_WOOD 			= "Imaginative, but not my style."
STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.HAT_WOOD 		= "It serves a better purpose now."
STRINGS.CHARACTERS.WEBBER.DESCRIBE.HAT_WOOD 			= "We can play pretend with this."

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

--TO DO:
--	Make 512x512
--	Remove shading and try to make it high resolution
