--called by the host at the start of a game, makes the objects in question
function initHost()
	--terrain.callUpdate = 0--skip calling the update function
	terrain.callWithin = 0

	return 0
end

--called (by the host) every loop
function updateHost()
	--GRENDEL AVATAR OF EARTH SPEAKETH
	if terrain.hasTimerTicked("COMETS", 5500) == 1 then
		--stage.GFP("WHAT GOD SPEAKEST")
		theta = math.random(0,359)
		thetamove = theta + 180 + math.random(-45, 45)
		for i = 0, math.random(3, 14) do
			
			cx = math.cos(math.rad(theta))*(stage.width+200) + math.random(0, terrain.wid)
			cy = math.sin(math.rad(theta))*(stage.height+200) + math.random(0, terrain.het)
			
			--cx = math.random(0, terrain.wid)
			--cy = math.random(0, terrain.het)
			
			stage.createShot("shot8.png", cx, cy, thetamove + math.random(-2,2), 300 + math.random(-80, 80), stage.width*2.2, 6)
			shot.mass = 30
			shot.knockback = 9000
			shot.scale = 1.0 + math.random()/2
			shot.minimap = 1
			shot.setRGB(math.random(200,255), math.random(200,255), math.random(200,255))
			
			--ooo sparklies
			stage.createEmitter("micrometeortrail", 0, 0)
			--e.scale = shot.scale
			--e.setRGB(math.random(200,255), math.random(200,255), math.random(20, 75))
			--e.setRGB(math.random(120, 175), math.random(120, 175), math.random(220, 255))
			e.attach(shot)
			e.upload()
			--emitter.attach(shot)
			--emitter.upload()
		end
	end
	
	
	return 0
end

--called (by the host) when a ship is inside this terrain tile
function shipWithin()

	return 0
end


--sets the editor/minimap display icon and color
function setIcon()
	icon.frame = 21	--from map_icons.png, which frame to use.
	icon.color = 0	--grey
	return 0
end