local assets =
{
    Asset("ANIM", "anim/monstermeatbat.zip"),
    Asset("ANIM", "anim/swap_monstermeatbat.zip"),
	Asset("ANIM", "anim/monstermeatbat.zip"),
    Asset("ATLAS", "inventoryimages/monstermeatbat.xml"),
    Asset("IMAGE", "inventoryimages/monstermeatbat.tex"),
}
prefabs = {
    "monstermeatbat",
}
local function onequip(inst, owner)

    owner.AnimState:OverrideSymbol("swap_object", "swap_monstermeatbat", "monstermeatbat")
    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 init()
	local inst = CreateEntity()

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

    MakeInventoryPhysics(inst)

    inst.AnimState:SetBank("monstermeatbat")
    inst.AnimState:SetBuild("monstermeatbat")
    inst.AnimState:PlayAnimation("idle")
	inst:AddTag("show_spoilage")
    inst:AddTag("icebox_valid")

	    inst.entity:SetPristine()



    if not TheWorld.ismastersim then
        return inst
    end

    inst.entity:SetPristine()

    inst:AddComponent("weapon")
    inst.components.weapon:SetDamage(50)

    inst:AddComponent("inspectable")

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

    inst:AddComponent("equippable")
		inst.components.equippable.dapperness = -TUNING.DAPPERNESS_TINY
    inst.components.equippable:SetOnEquip(onequip)
    inst.components.equippable:SetOnUnequip(onunequip)

    inst:AddComponent("perishable")
    inst.components.perishable:SetPerishTime(TUNING.PERISH_FASTISH)
    inst.components.perishable:StartPerishing()
    inst.components.perishable.onperishreplacement = "spoiled_food"



    MakeHauntableLaunch(inst)

    return inst
end
return  Prefab("common/inventory/monstermeatbat", init, assets, prefabs)
