ATTACK_DEFS = {	
	projectile = {
		init = function(ent, slot)
		end,
		step = function(ent, slot, dt)
		end,
		execute = function(ent, slot)
			local angle = ent.angle
			local world = ent.world
			--local charge = slot.attack_charge
			local effect = slot.attack_effect
			local effect_power = slot.attack_effect_power
			--

			local radius = slot.attack_radius
			local x = ent.x + math.cos(angle)*radius
			local y = ent.y + math.sin(angle)*radius
			local z = ent.z + slot.attack_z

			local shots = slot.attack_shots
			local speed = slot.attack_muzzle_speed--+ charge*slot.attack_muzzle_speed_bonus
			local sprite, outline = slot.attack_sprite, slot.attack_outline
			local tint, outline_tint = slot.attack_tint, slot.attack_outline_tint
			for i=1,shots do
				local shot_angle = angle
				if shots > 1 then
					local arc = slot.attack_arc
					shot_angle = angle-arc*0.5 + arc*(i-1)/(shots-1)
				end
				
				local attack_ent = Entity:new("projectile")
				attack_ent:set_position(x, y, z)
				attack_ent:set_angle(shot_angle)
				attack_ent:set_team(ent.team)
				attack_ent:set_effect(effect, effect_power)
				attack_ent:set_tints(tint,outline_tint)
				attack_ent:set_life_time(slot.attack_life_time)

				attack_ent:set_sprites(sprite, outline)
				local dx = math.cos(shot_angle)*speed
				local dy = math.sin(shot_angle)*speed
				local dz = math.randomGaussian()*speed*0.25

				if ent.dx then
					dx = dx + ent.dx
					dy = dy + ent.dy
					dz = dz + ent.dz
				end

				attack_ent:set_speed(dx, dy, dz)
				world:add_ent(attack_ent)
			end

			if slot.attack_knockback > 0 then
				local knock_back_speed = -speed/(ent.mass or 1)*slot.attack_knockback
				local dx = math.cos(angle)*knock_back_speed
				local dy = math.sin(angle)*knock_back_speed
				--print(dx,dy)
				ent:add_friendly_impact_force(dx,dy,knock_back_speed)
			end
		end,
		cleanup = function(ent, slot)
		end,
	},
}