Subsystem: AsgardShieldGeneratorSupport
	Name: #ASGARDSHIELDGENERATOR_NAME
	Description: #ASGARDSHIELDGENERATOR_DESC
	BaseColor: #0044db
	Elevation: 1

	DamageOrder: -100

	Tags: IsShield, Defense, Category:Defense, HasInternals
	Tags: SecondaryDefense
	Hull: Support, Satellite

	Size := HexSize * Hexes
	ShieldCapacity := Size * 50
	ShieldRegen := Size * 3.0
	//ShieldHexes := Hexes
	ShieldHexes := max(Hexes*60/(ShipSize/HexSize), 1.0)
	PowerUse := 7.5 * Size

	//Shield Mitigation
	ShieldMitFactor := 7
	ShieldMitCap := 70
	//Mitigation := min((1 - pow((1-ShieldMitFactor/100), (Sum.ShieldHexes-1))) * 100, 80)
	//Mitigation := min((1 - pow((1-ShieldMitFactor/100), (ShieldHexes-1))) * 100, 80)
	Mitigation := min((1 - pow((1-ShieldMitFactor/100), (ShieldHexes-1))) * 100, ShieldMitCap)
	//This is only for data display purposes
	ShieldAbsorbRate := ShieldRegen / (1 - Mitigation/100)

	//Must limit to one for mitigation calculations to work correctly
	HasShieldGen := 1

	Hex.Resistance := 0.5
	Hex.HP := 12 * HexSize
	Hex.Mass := 2.5 * HexSize

	Hex.BuildCost := 1.25 * HexSize
	Hex.LaborCost := 0.2 * HexSize

	//Effect: ShieldDamage
	Effect: DOFShieldDamage
		Mitigation = Mitigation
	
	Requires:
		Command = 1
		Power = PowerUse

	//Enforce one generator limit
	Assert: Sum.HasShieldGen <= 1
		Unique: True
		Message: #ERROR_ONLY_ONE
	
	Module: Core
		Sprite: DOFGenerator6
		Hex.BuildCost := 5 * Hex.BuildCost
