function init()
	gun.name = "Helix"
	gun.fireDelay = 300
	gun.shotrange = 1450
	gun.shotspeed = 650
	gun.shotdamage = 2
	gun.shotknockback = 1000
	gun.burstDelay = 30
	
	--gun.firecost = .2

	gun.enabledoppler = 1--so the arcs don't get messed up
	
	return 0
end


function update()
	return 0
end


function fire()
	dmod = math.min(400 / math.sqrt((gun.firex-gun.firetarx)^2 + (gun.firey-gun.firetary)^2), 8)
	
	--make two shots going out at 45d angles
	for i = 0, 1 do
		gun.addShot("shot6.png", gun.firex, gun.firey, gun.firetheta - (40+dmod*2) + ((80+dmod*4)*i))
		shot.skipLuaUpdate = 0
		--shot.scale = 1.5
		--shot.vars.set("theta", shot.movrot)
		shot.vars.set("theta", i * 180)
		shot.vars.set("dmod", dmod)

		--attach a trail emitter to the shot
		stage.createEmitter("trail", 0, 0)
		e.interval = 10
		e.scale = .8
		e.lifetimer = 350
		e.setRGB(0,190,255)
		--e.scale = .5
		e.attach(shot)
		e.upload()
	end
		
	--gun.sfx("gun_pew1.wav", gun.firex, gun.firey)
	gun.sfx("gun_classic.wav", gun.firex, gun.firey)
	return 0
end

function shot_update()

	--alter move direction back and forth as lifetimer decays
	--dtheta = math.rad(math.mod((shot.lifetimer / 1000) * 180, 360) + shot.vars.get("thetaoffset"))
	--shot.movrot = shot.movrot - math.sin(dtheta) * 2
	
	
	
	theta = shot.vars.get("theta")
	dmod = shot.vars.get("dmod")--1--(shot.speed / 500) * 1.25
	
	drot = math.sin(math.rad(theta)) * 4 * dmod
	
	shot.movrot = shot.movrot + drot
	shot.vars.set("theta", theta + 5 * dmod)
	return 0
end