function init()
	gun.name = "Velocity Cannon"
	gun.fireDelay = 50
	gun.shotrange = 1000
	gun.shotspeed = 1300
	gun.shotdamage = 10
	gun.shotknockback = 6000
	gun.burstDelay = 50
	
	gun.skipUpdate = 0		--don't skip update function
	return 0
end

function update()
	--if we've started charging, finish it
	charge = gun.vars.get("charge")
	if charge > 0 then
		gun.vars.set("charge", charge + .025*gun.gunTimeMod)
		--show the place we're targeting
		if charge <= .1 or math.random(0,3) == 0 then
			stage.createEmitter("muzzleflash", gun.burstx, gun.bursty)
			e.scale = .25
			--stage.createEmitter("ship_charge", gun.burstx, gun.bursty)
			--e.num = 25
			--e.movrotX = gun.burstx
			--e.movrotY = gun.bursty
			e.upload()
		end
		--keep us from pulling the trigger again till we're done
		gun.enabled = 0
	end
	--if we've charged up, fire!
	if charge >= 1 and gun.burst == 0 then gun.burst = 6 end

	--stage.GFP(charge .. "     " .. gun.burst)
	
	return 0
end

function fire()
	charge = gun.vars.get("charge")
	
	--if we haven't charged, start
	if charge <= .01 and gun.burst <= 0 then
		gun.vars.set("charge", .01)
		--POWER UP
		stage.createEmitter("ship_charge")
		e.num = 50
		e.movrotX = gun.owner.x
		e.movrotY = gun.owner.y
		e.attachToPlaceholder(gun.owner)
		e.upload()
	end
	
	--if we've charged
	if charge >= 1 then
		--add a charged shot
		gun.addShot("shot6.png", gun.firex, gun.firey, gun.firetheta)
		--shot.durable = 1
		shot.damage = gun.shotdamage
		shot.knockback = gun.shotknockback
		--reset charge, re-enable the gun
		if gun.burst <= 1 then
			--stage.GFP("end vel burst!")
			--gun.burst = 0
			gun.vars.set("charge", 0)
			gun.enabled = 1
		end
	end
	return 0
end

function shot_update()

	return 0
end