Subsystem: AncientsShieldHardener
	Name: #ANCIENTSSHIELDHARDENER_NAME
	Description: #ANCIENTSSHIELDHARDENER_DESC
	BaseColor: #681be3
	Elevation: 1

	EvaluationOrder: 100
	DamageOrder: -200

	Tags: BaseCost
	Tags: Defense, Category:Defense, HasInternals
	Hull: Flagship, Station

	Size := HexSize * Hexes
	PowerUse := 18 * Size
	Chance := pow(0.625, 1.25 / (Hexes / Sum.ShieldHexes))
	HasShieldHardener := 1

	ShieldCapacity := Size * 12
	//ShieldMitFactor := 0.01 * Hexes
	//AddModifier: ShieldCapacityFactor(1.2)
	//AddModifier: ShieldRegenFactor(1 + 0.01 * Hexes)
	//This doesn't work because of Evaluation order... which is required for Chance to work
	//ShieldBuffFactor := 1.0 + 0.01 * Hexes
	//AddShipModifier: ShieldCapacityFactor(ShieldBuffFactor)
	//AddShipModifier: ShieldRegenFactor(ShieldBuffFactor)
	//AddShipModifier: tag/IsShield::ShieldMitFactorFactor(ShieldBuffFactor)
		
	Hex.Resistance := 0.5
	Hex.HP := 12 * HexSize
	Hex.Mass := 2.5 * HexSize
	Hex.MaintainCost := 4.0 * HexSize
	
	Requires:
		Command = 1
		Power = PowerUse

	Effect: ShieldBlock
		Chance = Chance

	Assert: Sum.ShieldCapacity > 0
		Unique: True
		Message: #ERROR_NEED_SHIELD

	Assert: Sum.HasShieldHardener <= 1
		Unique: True
		Message: #ERROR_ONLY_ONE
	
	Module: Core
		Sprite: FissionReactor
		Hex.BuildCost := 3.5 * Hex.BuildCost
