local assets =
{
	Asset("ANIM", "anim/armor_beefalo.zip"),
}

local function onequip(inst, owner)
    owner.AnimState:OverrideSymbol("swap_body", "armor_beefalo", "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()
	local inst = CreateEntity()

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

	MakeInventoryPhysics(inst)

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

	inst.entity:SetPristine()

	if not TheWorld.ismastersim then
        return inst
    end

    inst:AddComponent("inspectable")

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

    inst:AddComponent("equippable")
    inst.components.equippable.equipslot = EQUIPSLOTS.BODY
	inst.components.equippable.dapperness = TUNING.DAPPERNESS_MED

    inst:AddComponent("insulator")
    inst.components.insulator:SetInsulation(TUNING.INSULATION_LARGE)

    inst:AddComponent("fueled")
    inst.components.fueled.fueltype = FUELTYPE.USAGE
    inst.components.fueled:InitializeFuelLevel(TUNING.BEEFALOHAT_PERISHTIME)
    inst.components.fueled:SetDepletedFn(onperish)

    inst.components.equippable:SetOnEquip(onequip)
    inst.components.equippable:SetOnUnequip(onunequip)

	MakeHauntableLaunch(inst)

    return inst
end

STRINGS.NAMES.ARMOR_BEEFALO 							= "Beefalo Coat"
STRINGS.RECIPE_DESC.ARMOR_BEEFALO 						= "Stylish, yet smelly."

STRINGS.CHARACTERS.GENERIC.DESCRIBE.ARMOR_BEEFALO 		= "A warm winter coat."
STRINGS.CHARACTERS.WILLOW.DESCRIBE.ARMOR_BEEFALO 		= "I am covered in hair!"
STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.ARMOR_BEEFALO 		= "Is good coat! But smell bad!"
STRINGS.CHARACTERS.WENDY.DESCRIBE.ARMOR_BEEFALO 		= "I now wear what was once theirs."
STRINGS.CHARACTERS.WX78.DESCRIBE.ARMOR_BEEFALO 			= "BENEFICIAL DURING WINTER"
STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.ARMOR_BEEFALO 	= "A primitive attempt at clothing."
STRINGS.CHARACTERS.WOODIE.DESCRIBE.ARMOR_BEEFALO 		= "Covered in Beefalo."
STRINGS.CHARACTERS.WAXWELL.DESCRIBE.ARMOR_BEEFALO 		= "Clothing made for brutes."
STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.ARMOR_BEEFALO 	= "A warriors garment."
STRINGS.CHARACTERS.WEBBER.DESCRIBE.ARMOR_BEEFALO 		= "We won't blend in as much."

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