Subsystem: FlakCannon
	Name: #FLAKCANNON_NAME
	Description: #FLAKCANNON_DESC
	BaseColor: #66cc66 // #b746f9
	TypeColor: #66cc66 // #b746f9
	Picture: SubsystemButtonArt::4
	Elevation: 2
	
	Tags: BaseCost
	Tags: WeaponBase, Category:Weapons, Rotatable, HexLimitArc
	Tags: ExteriorCore, Weapon, IsExplosiveWeapon, HasInternals, SecondaryDPS, DefaultUnlock
	Tags: IgnoreRange
	Tags: HeraldsDLC
	Hull: Flagship, Station

	Size := HexSize * Hexes
	Range := (Size/2 + 200) * 2
	Damage := Size * 3.0
	Reload := 1 * (1.0 + Size/512)
	Speed := max(90, Range / 20)
	//Speed := max(180, Range / 10)
	Spread := 0.015 / max(Range / 600, 1)
	Tracking := 0.5
	FireArc := 1.5
	Pierce := 0.5
//	Radius := 1.5 + (log(Size) / log(2) * 6.0)
	Radius := 4.0 + (log(Size*16) / log(2) * 4)
	SupplyCost := Size * 1.0
	Hits := 10

	Hex.Mass := HexSize
	Hex.HP := 18 * HexSize
	Hex.Resistance := 0.2

	Modifier: AoERadiusFactor(Factor)
		Radius := Radius * Factor

	Requires:
		Command = 1

	Assert: Hexes <= 1
		Message: Flak Cannons may only be 1 hex in size.

	Module: Default

	Module: Core
		Hex.HP := Hex.HP * 3
		Hex.BuildCost := 5.0 * Hex.BuildCost
		Hex.Mass := 5.0 * Hex.Mass

		Sprite: RocketPod::0
		DrawMode: 1

		Hex.DamageResist := ShipSize / 64.0
		Effect: DamageResist
			Resist = Hex.DamageResist

	Effector: FlakCannon
		Range = Range
		Damage = Damage
		Reload = Reload
		Speed = Speed
		Pierce = Pierce
		Tracking = Tracking
		Spread = Spread
		FireArc = FireArc
		TargetTolerance = max(pi,FireArc + pi/4)
		FireTolerance = Spread * 3
		SupplyCost = SupplyCost * Reload
		CapOnTarget = 24
		Hits = Hits

