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

local function OnDropped(inst)
            local weapon = GetPlayer().components.combat and GetPlayer().components.combat:GetWeapon()
            if weapon and weapon:HasTag("bow") then
    inst:DoTaskInTime(0.5, function()
			GetPlayer().components.inventory:DropItem(weapon)
		end) 
	end
end

local function fn(Sim)
	local inst = CreateEntity()
	inst.entity:AddTransform()
	inst.entity:AddAnimState()
    
    MakeInventoryPhysics(inst)

	inst.Transform:SetScale(1.4, 1.4, 1.4)
    inst.AnimState:SetBank("poop")
    inst.AnimState:SetBuild("warfarin_bow")
    inst.AnimState:PlayAnimation("idle")
  

    ---------------------       
    
    inst:AddComponent("inspectable")
    
    inst:AddComponent("inventoryitem")
    inst.components.inventoryitem.atlasname = "images/inventoryimages/warfarinbow.xml"
    inst.components.inventoryitem:SetOnDroppedFn(OnDropped)
    
    return inst
end

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

