function init()
	enabled = true
	body = FindBody("ammo")
	toolsDone = false

	arrow = LoadSprite("gfx/arrowdown.png")
end


function drawArrow(t)
	if GetBool("game.map.enabled") then
		return
	end
	t.rot = QuatLookAt(t.pos, GetCameraTransform().pos)
	local offset = 3.2 + math.sin(4.0*GetTime())*0.5
	t.pos[2] = t.pos[2] + offset
	DrawSprite(arrow, t, 2, 2, .3, .3, .3, 3, false, true)
	DrawSprite(arrow, t, 2, 2, 1, 1, 1, 1, true, true)
end


function tick(dt)
	if not enabled then
		return
	end

	local p = GetPlayerPos()
	local bt = GetBodyTransform(body)

	local dist = VecLength(VecSub(p, bt.pos))
	
	if not toolsDone then
		if dist > 4 then
			SetString("hud.hintinfo", GetTranslatedStringByKey("UI_HUD_HINT_PICK_UP_TOOLS_2"))
			drawArrow(bt)
		end
		if GetBool("game.tool.minigun.enabled") or GetBool("level.demolish.fireworks") then
			toolsDone = true
		end
	end
end
