function init()
	gun.name = "Warp Core"
	gun.fireDelay = 1000
	gun.shotrange = 1000
	gun.shotspeed = 150
	gun.shotdamage = 32
	gun.shotknockback = 10000
	
	gun.overheat = 1000

	return 0
end

function update()
	return 0
end

function fire()
	--if we've at least charged a little bit
	if gun.charge > .2 then

		--store gun properties (after we create the torpedo, "gun" changes)
		fireangle = gun.owner.rot
		targetx = gun.firetarx
		targety = gun.firetary
		shotrange = math.sqrt((gun.firex-targetx)^2 + (gun.firey-targety)^2)*3.5
		shotspeed =  gun.shotspeed
		owner = gun.owner
		shotdamage = gun.shotdamage
		shotknockback = gun.shotknockback
		
		--fire a missile
		stage.createShip("Warpcore", "", gun.firex, gun.firey, gun.owner.faction)
		ship.setWeaponDamage(shotdamage)
		ship.setWeaponKnockback(shotknockback)
		--aquire target
		ship.controller.goalx = targetx
		ship.controller.goaly = targety
		--set the fuse
		ship.controller.resetTimer("fuse", shotrange)
		--ignore owner (can't collide)
		ship.ignore(owner)
		--move at speed
		ship.movrot = fireangle
		ship.rot = fireangle
		ship.speed = shotspeed
		
		stage.sfx("gun_missilethoom.wav", ship.x, ship.y)
	end

	return 0
end

function shot_update()

	return 0
end