dofile("scripts/entities/entityinclude.lua")

n = 0
s = 0

function init(me)
	n = getNaija()
	s = getEntity("sunworm")
end

function update(me, dt)
	if getFlag(FLAG_BOSS_SUNWORM) <= 0 then
		if s == 0 then
			s = getEntity("sunworm")
		else
			if node_isEntityIn(me, s) and entity_isUnderWater(s) then
				dx = entity_x(s) - node_x(me)
				dy = entity_y(s) - node_y(me)
				dx, dy = vector_setLength(dx, dy, 3000*dt)
				entity_addVel(s, dx, dy)
			end
		end
	end
end
