^Building:
	InstantlyRepairable:
		Types: Building
	ProductionTimeMultiplier@craneBonus:
		Prerequisites: bonus.crane
		Multiplier: 90
	GrantRandomCondition@randomFX:
		Conditions: explode02, explode03
	FireWarheadsOnDeath@02:
		Type: CenterPosition
		Weapon: buildingExplosions02
		EmptyWeapon: buildingExplosions02
		Chance: 50
		Offset: 1,0,1
		RequiresCondition: explode02 && !being-demolished
	FireWarheadsOnDeath@03:
		Type: CenterPosition
		Weapon: buildingExplosions03
		EmptyWeapon: buildingExplosions03
		Chance: 50
		Offset: 1,2,1
		RequiresCondition: (explode02 || explode03) && !being-demolished
	FireWarheadsOnDeath@sabotuerdemolition:
		RequiresCondition: being-demolished
		Type: CenterPosition
		Weapon: buildingBigExplosion
		EmptyWeapon: buildingBigExplosion
	FireProjectilesOnDeath:
		Weapons: derbisRock01, derbisRock02, derbisRock03, Debris4
		Pieces: 2, 5
		Range: 1c512, 4c0
	SpawnActorOnDeath@bigcrater:
		Actor: crater_big
		Offset: 0,1
		RequiresCondition: being-demolished
	AmbientSound@saboteurCharge:
		SoundFiles: audio/explodeSaboteurEmperor02.wav
		RequiresCondition: being-demolished
	WithBuildingRepairDecoration:
		Palette: player
		IsPlayerPalette: True
	ExternalCondition@vulnerable:
		Condition: vulnerable
	DamageMultiplier@vulnerable:
		Modifier: 200
		RequiresCondition: vulnerable
	ExternalCondition@jammed:
		Condition: jammed
	RevealsShroudMultiplier@jammed:
		RequiresCondition: jammed
		Modifier: 50
	DetectCloakedMultiplier@jammed:
		RequiresCondition: jammed
		Modifier: 5
	RevealOnDeath:
		Duration: 25
		Radius: 3c768
	WithColoredOverlay@vulnerable:
		Color: FF2C2C7D
		RequiresCondition: vulnerable
	WithColoredOverlay@black:
		Color: 3E202080
		RequiresCondition: jammed
	WithDecoration@skullFromRA:
		Image: pips
		Sequence: pip-jammer
		Palette: disabled
		Position: TopLeft
		ValidRelationships: Enemy, Neutral
		RequiresCondition: jammed

construction_yard:
	Health:
		HP: 95000
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RevealsShroud:
		Range: 5c768
	RevealsShroud@BigVis:
		Range: 9c768
		RequiresCondition: BiggerVision
	Valued:
		Cost: 4000
	CustomSellValue:
		Value: 2000
	StoresPlayerResources:
		Capacity: 2000
	Power:
		Amount: 25
		RequiresCondition: VisionUpgrade
	FireProjectilesOnDeath:
		Weapons: Debris, Debris2
		Pieces: 1, 3
		Range: 1c0, 2c0
	FireProjectilesOnDeath@longer:
		Weapons: Debris, Debris2, Debris3, Debris4
		Pieces: 5, 7
		Range: 3c0, 6c0
	FireProjectilesOnDeath@longest:
		Weapons: Debris4, DerbisSiegetank
		Pieces: 0, 3
		Range: 6c0, 10c0
	FireWarheadsOnDeath@02:
		RequiresCondition: explode02
	FireWarheadsOnDeath@03:
		RequiresCondition: explode03
	Tooltip:
		Name: Atreides Conyard
		RequiresCondition: !harkonnen && !ordos && !fremen && !corrino && !smuggler && !mercenary
	Tooltip@harkonnen:
		Name: Harkonnen Conyard
		RequiresCondition: harkonnen
	Tooltip@ordos:
		Name: Ordos Conyard
		RequiresCondition: ordos
	Tooltip@fremen:
		Name: Fremen Conyard
		RequiresCondition: fremen
	Tooltip@corrino:
		Name: Corrino Conyard
		RequiresCondition: corrino
	Tooltip@smuggler:
		Name: Smuggler Conyard
		RequiresCondition: smuggler
	Tooltip@mercenary:
		Name: Mercenary Conyard
		RequiresCondition: mercenary
	GrantConditionOnFaction@harkonnen:
		Condition: harkonnen
		Factions: harkonnen
	GrantConditionOnFaction@ordos:
		Condition: ordos
		Factions: ordos
	GrantConditionOnFaction@corrino:
		Condition: corrino
		Factions: corrino
	GrantConditionOnFaction@fremen:
		Condition: fremen
		Factions: fremen
	GrantConditionOnFaction@smuggler:
		Condition: smuggler
		Factions: smuggler
	GrantConditionOnFaction@mercenary:
		Condition: mercenary
		Factions: mercenary
	ProvidesPrerequisite@fremenBuildins:
		Prerequisite: conyard.fremen
		Factions: fremen
	ProvidesPrerequisite@atreides:
		Prerequisite: conyard.atreides
		Factions: atreides
	ProvidesPrerequisite@harkonnen:
		Prerequisite: conyard.harkonnen
		Factions: harkonnen
	ProvidesPrerequisite@ordos:
		Prerequisite: conyard.ordos
		Factions: ordos
	ProvidesPrerequisite@corrino:
		Prerequisite: conyard.corrino
		Factions: corrino

concretea:
	D2kBuilding:
		Footprint: xxxx xxxx xxxx xxxx
		Dimensions: 4,4
	Buildable:
		Prerequisites: ~!global-auto-concrete, !choosefaction
		BuildPaletteOrder: 618
		BuildDuration: 50
		Description: Protects against terrain damage.
	Valued:
		Cost: 25
	RevealsShroud:
		Range: 1c512
	RequiresBuildableArea:
		AreaTypes: building
		Adjacent: 3
	KillsSelf:
		Delay: 1

concreteb:
	D2kBuilding:
		Footprint: xxxxxx xxxxxx xxxxxx xxxxxx xxxxxx xxxxxx
		Dimensions: 6,6
	Buildable:
		Prerequisites: wind_trap, ~!global-auto-concrete, !choosefaction
		BuildPaletteOrder: 619
		BuildDuration: 100
		Description: Protects against terrain damage.
	RevealsShroud:
		Range: 1c512
	RequiresBuildableArea:
		AreaTypes: building
		Adjacent: 3
	KillsSelf:
		Delay: 1

wind_trap:
	Buildable:
		Prerequisites: !choosefaction
		BuildDuration: 250
		BuildDurationModifier: 100
	Selectable:
		Bounds: 2048, 2048
	Valued:
		Cost: 250
	Health:
		HP: 35000
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RevealsShroud:
		Range: 3c768
	RevealsShroud@BigVis:
		Range: 7c768
		RequiresCondition: BiggerVision
	Power:
		Amount: 250
	RevealOnDeath:
		Radius: 3c768
	SpawnActorOnDeath@husktype01:
		Actor: windTrap.husk
		RequiresCondition: explode02 && !being-demolished
	SpawnActorOnDeath@huskType02:
		Actor: windTrap.husk_passable
		RequiresCondition: explode03 && !being-demolished

barracks:
	Buildable:
		BuildDuration: 300
	Valued:
		Cost: 500
	Health:
		HP: 35000
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RevealsShroud:
		Range: 3c768
	RevealsShroud@BigVis:
		Range: 7c768
		RequiresCondition: BiggerVision
	GrantConditionOnFaction@fremenExit:
		Condition: fremen
		Factions: fremen
	Exit@1:
		RequiresCondition: !fremen
	Exit@2:
		RequiresCondition: !fremen
	Exit@3:
		SpawnOffset: -0,700,0
		ExitCell: 0,2
		RequiresCondition: fremen
	Exit@4:
		SpawnOffset: -0,700,0
		ExitCell: 1,2
		RequiresCondition: fremen
	RenderSprites:
		Image: barracks.ordos
		FactionImages:
			atreides: barracks.atreides
			fremen: barracks.fremen
			harkonnen: barracks.harkonnen
			corrino: barracks.corrino
			smuggler: barracks.ordos
			mercenary: barracks.mercenary
	Power:
		Amount: -50
	GrantConditionOnProduction@ClusterdebrisExplosion:
		Condition: producing
	FireProjectilesOnDeath@explosiveDerbis:
		Weapons: DeathHandClusterDebris
		Pieces: 0, 1
		Range: 1c0, 2c0
		RequiresCondition: producing
	ProvidesPrerequisite@corrino:
		Prerequisite: barracks.corrino
		Factions: corrino
	ProvidesPrerequisite@mercenary:
		Prerequisite: barracks.mercenary
		Factions: mercenary
	ProvidesPrerequisite@fremen:
		Prerequisite: barracks.fremen
		Factions: fremen

refinery:
	PlaceBuildingVariants:
		Actors: refinery_inverted
		Facings: 384, 896
	Buildable:
		BuildDuration: 700
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	Valued:
		Cost: 1750
	Health:
		HP: 40000
	RevealsShroud:
		Range: 3c768
	RevealsShroud@BigVis:
		Range: 7c768
		RequiresCondition: BiggerVision
	StoresPlayerResources:
		Capacity: 2000
	FreeActorWithDelivery:
		Actor: harvester
		DeliveryOffset: 2,2
		DeliveringActor: carryall.harvester.delivery
		Facing: 160
	CustomSellValue:
	Sellable:
		RequiresCondition: !build-incomplete && !being-demolished
		SellSounds: BUILD1.WAV
	Power:
		Amount: -75
	FireWarheadsOnDeath@big04:
		Type: CenterPosition
		Weapon: buildingExplosions04_big
		EmptyWeapon: buildingExplosions04_big
		Chance: 100
		Offset: 2,2,1
	FireProjectilesOnDeath:
		Weapons: Debris, Debris2, Debris3, Debris4, HarvesterSpiceExplosion
		Pieces: 7, 15
		Range: 2c0, 10c0
	ProvidesPrerequisite@cloak_carryall.reinforce:
		Prerequisite: cloak_carryall.reinforce
	GrantConditionOnFaction@Atreides:
		Condition: atreides
		Factions: atreides, fremen
	GrantConditionOnFaction@Harkonnen:
		Condition: harkonnen
		Factions: harkonnen, corrino
	GrantConditionOnFaction@Ordos:
		Condition: ordos
		Factions: ordos, mercenary, smuggler
	SpawnActorOnDeath@ordosHusk:
		Actor: refinery_husk.ordos
		RequiresCondition: ordos && !being-demolished
	SpawnActorOnDeath@atreidesHusk:
		Actor: refinery_husk.atreides
		RequiresCondition: atreides && !being-demolished
	SpawnActorOnDeath@harkonnenHusk:
		Actor: refinery_husk.harkonnen
		RequiresCondition: harkonnen && !being-demolished

refinery_inverted:
	Inherits: refinery
	PlaceBuildingVariants:
		Actors: refinery
		Facings: 896, 384
	Buildable:
		Prerequisites: wind_trap
		Queue: Building
		BuildPaletteOrder: 310
		Description: Refinery with docking from north side.
	RenderSprites:
		Image: refinery_invert.ordos
		FactionImages:
			atreides: refinery_invert.atreidis
			fremen: refinery_invert.atreidis
			harkonnen: refinery_invert.harkonnen
			corrino: refinery_invert.harkonnen
	WithIdleOverlay@front:
		Sequence: idle-front
		RequiresCondition: !build-incomplete
	Selectable:
		Bounds: 3072, 2048, 0, 1024
	WithIdleOverlay@top:
		Sequence: idle-top
		RequiresCondition: !build-incomplete
	Refinery:
		TickRate: 20
	Tooltip:
		Name: Spice Refinery Inverted
	D2kBuilding:
		Footprint: === =xx xx=
		Dimensions: 3,3
		LocalCenterOffset: 0,-512,0
	HitShape:
		Type: Rectangle
			TopLeft: -512, 0
			BottomRight: 1536, 1024
	HitShape@BOTTOM:
		Type: Rectangle
			TopLeft: -1536, 1024
			BottomRight: 512, 2048
	ProvidesPrerequisite:
		Prerequisite: refinery
	FreeActorWithDelivery:
		DeliveryOffset: 0,0
	DockHost:
		Type: Unload
		DockAngle: 128
		DockOffset: -1024,512,0

silo:
	GrantConditionOnPrerequisite@heal:
		Condition: SiloUpgrade
		Prerequisites: upgrade.silo
	Buildable:
		BuildPaletteOrder: 612
		BuildDuration: 200
		Description: Stores excess harvested Spice. Can heal infantry after upgrading. -Requires energy and money.
	Valued:
		Cost: 200
	Health:
		HP: 20000
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RevealsShroud:
		Range: 3c768
	RevealsShroud@BigVis:
		Range: 7c768
		RequiresCondition: BiggerVision
	StoresPlayerResources:
		Capacity: 2000
	Power:
		Amount: -25
	Power@deployed:
		Amount: -25
		RequiresCondition: DeployedSilo
	FireProjectilesOnDeath:
		Weapons: Debris, Debris2, Debris3, Debris4
		Pieces: 3, 5
		Range: 2c0, 5c0
	ProvidesPrerequisite@silo:
	RevealOnDeath:
		Duration: 25
		Radius: 3c768
	ProximityExternalCondition@dhealign:
		Condition: healing
		Range: 2c512
		ValidRelationships: Ally
		RequiresCondition: DeployedSilo
	WithRangeCircle:
		Range: 2c512
		RequiresCondition: DeployedSilo
	GrantConditionOnDeploy:
		DeployedCondition: DeployedSilo
		SkipMakeAnimation: true
		DeploySounds: SONIC3.WAV
		RequiresCondition: SiloUpgrade
	WithIdleOverlay:
		RequiresCondition: DeployedSilo
		Image: deployed_silo
		Sequence: deployed
		Palette: terrain
	CashTrickler:
		Interval: 25
		Amount: -5
		RequiresCondition: DeployedSilo

light_factory:
	Buildable:
		Prerequisites: refinery
		BuildDuration: 400
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	Valued:
		Cost: 750
	Health:
		HP: 40000
	RenderSprites:
		Image: light.ordos
		FactionImages:
			atreides: light.atreides
			fremen: light.atreides
			harkonnen: light.harkonnen
			corrino: light.harkonnen
			smuggler: light.smuggler
			mercenary: light.mercenary
	RevealsShroud:
		Range: 5c768
	RevealsShroud@BigVis:
		Range: 9c768
		RequiresCondition: BiggerVision
	Power:
		Amount: -100
	FireProjectilesOnDeath:
		Weapons: Debris2, derbisRock01, Debris4
		Pieces: 5, 7
		Range: 0c512, 3c0
	ProvidesPrerequisite@hunter:
		Prerequisite: light.hunter
		Factions: smuggler
	ProvidesPrerequisite@harkonnen:
		Prerequisite: light.harkonnen
		Factions: harkonnen
	ProvidesPrerequisite@atreides:
		Prerequisite: light.atreides
		Factions: atreides
	ProvidesPrerequisite@quad:
		Prerequisite: light.quad
		Factions: atreides, fremen, harkonnen, corrino, ordos, smuggler
	ProvidesPrerequisite@trike:
		Prerequisite: light.trike
		Factions: atreides, harkonnen, corrino, mercenary, fremen
	ProvidesPrerequisite@raider:
		Prerequisite: light.raider
		Factions: ordos
	ProvidesPrerequisite@jammer:
		Prerequisite: light.jammer
		Factions: smuggler
	ProvidesPrerequisite@heavyQuad:
		Prerequisite: light.heavy_quad
		Factions: mercenary
	ProvidesPrerequisite@spire:
		Prerequisite: spire
		Factions: atreides, fremen, harkonnen, corrino, ordos, smuggler, mercenary
	

heavy_factory:
	Buildable:
		Prerequisites: refinery
		BuildDuration: 800
	Valued:
		Cost: 1000
	Health:
		HP: 45000
	RenderSprites:
		Image: heavy.ordos
		FactionImages:
			atreides: heavy.atreides
			fremen: heavy.fremen
			harkonnen: heavy.harkonnen
			corrino: heavy.corrino
			smuggler: heavy.smuggler
			mercenary: heavy.mercenary
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RevealsShroud:
		Range: 4c768
	RevealsShroud@BigVis:
		Range: 8c768
		RequiresCondition: BiggerVision
	Power:
		Amount: -150
	ProvidesPrerequisite@missile_tank:
		Prerequisite: heavy.missile_tank
		Factions: atreides, fremen, harkonnen, corrino, ordos, smuggler, mercenary
	ProvidesPrerequisite@crawler:
		Prerequisite: heavy.bison
		Factions: mercenary
	ProvidesPrerequisite@smuggler:
		Prerequisite: heavy.smuggler
		Factions: smuggler
	ProvidesPrerequisite@mercenary:
		Prerequisite: heavy.mercenary
		Factions: mercenary
	ProvidesPrerequisite@corrino:
		Prerequisite: heavy.corrino
		Factions: corrino
	ProvidesPrerequisite@atreides_combat:
		Prerequisite: heavy.atreides_combat
		Factions: atreides, fremen
		RequiresCondition: !subfaction_mode
	ProvidesPrerequisite@ordos_combat:
		Prerequisite: heavy.ordos_combat
		Factions: ordos, smuggler, mercenary
		RequiresCondition: !subfaction_mode
	ProvidesPrerequisite@harkonnen_combat:
		Prerequisite: heavy.harkonnen_combat
		Factions: harkonnen, corrino
		RequiresCondition: !subfaction_mode
	ProvidesPrerequisite@atreides_combat_subfactions:
		Prerequisite: heavy.atreides_combat
		Factions: atreides
		RequiresCondition: subfaction_mode
	ProvidesPrerequisite@ordos_combat_subfactions:
		Prerequisite: heavy.ordos_combat
		Factions: ordos
		RequiresCondition: subfaction_mode
	ProvidesPrerequisite@harkonnen_combat_subfactions:
		Prerequisite: heavy.harkonnen_combat
		Factions: harkonnen
		RequiresCondition: subfaction_mode
	ProvidesPrerequisite@cheap_tank:
		Prerequisite: heavy.cheap_tank
		Factions: smuggler
		RequiresCondition: subfaction_mode
	ProvidesPrerequisite@corrinotank:
		Prerequisite: heavy.corrino_combat
		Factions: corrino
		RequiresCondition: subfaction_mode
	ProvidesPrerequisite@fremen_tank:
		Prerequisite: heavy.fremen_tank
		Factions: fremen
		RequiresCondition: subfaction_mode
	ProvidesPrerequisite@mercenary_tank:
		Prerequisite: heavy.mercenary_tank
		Factions: mercenary
		RequiresCondition: subfaction_mode
	ProvidesPrerequisite@carriers:
		Prerequisite: carrier
		Factions: fremen
		RequiresCondition: subfaction_mode
	GrantConditionOnPrerequisite@combattankslogic:
		Prerequisites: !factions.standard
		Condition: subfaction_mode
	GrantConditionOnProduction@debrisExplosion:
		Condition: producing
	FireProjectilesOnDeath:
		Weapons: Debris, Debris2, Debris3, Debris4
		Pieces: 10, 20
		Range: 1c0, 5c0
	FireProjectilesOnDeath@explosiveDerbis:
		Weapons: DeathHandClusterDebris
		Pieces: 0, 1
		Range: 1c0, 3c0
	FireProjectilesOnDeath@explosiveDerbiswhenproducing:
		Weapons: DeathHandClusterDebris
		Pieces: 1, 2
		Range: 1c0, 5c0
		RequiresCondition: producing
	SpawnActorOnDeath@bigcrater:
		Offset: 0,2

outpost:
	Buildable:
		BuildDuration: 400
		Description: Provides a radar map of the battlefield. Detects invisible units at long range. Requires power to operate.
	Valued:
		Cost: 750
	Health:
		HP: 40000
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RenderSprites:
		Image: outpost.ordos
		FactionImages:
			atreides: outpost.atreides
			fremen: outpost.atreides
			harkonnen: outpost.harkonnen
			corrino: outpost.harkonnen
	RevealsShroud:
		Range: 5c768
	RevealsShroud@BigVis:
		Range: 9c768
		RequiresCondition: BiggerVision && !disabled
	Power:
		Amount: -100
	ProvidesRadar:
		RequiresCondition: !disabled
	DetectCloaked:
		Range: 5c002
		RequiresCondition: !disabled
	WithRangeCircle:
		Range: 5c002
		RequiresCondition: !disabled

starport:
	Buildable:
		BuildDuration: 600
		Prerequisites: heavy_factory, outpost, ~techlevel.high
		Description: Dropzone for extra reinforcements, at a price.
	Valued:
		Cost: 1500
	Health:
		HP: 50000
	D2kBuilding:
		Footprint: xxx +++ +x+
		Dimensions: 3,3
	Production:
		Produces: Starport
	RenderSprites:
		Image: starport.ordos
		FactionImages:
			atreides: starport.atreides
			fremen: starport.fremen
			harkonnen: starport.harkonnen
			corrino: starport.corrino
			smuggler: starport.smuggler
			mercenary: starport.mercenary
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RevealsShroud:
		Range: 3c768
	RevealsShroud@BigVis:
		Range: 7c768
		RequiresCondition: BiggerVision
	Tooltip@smuggler:
		Name: Smuggler Starport
		RequiresCondition: smuggler
	Tooltip@mercenary:
		Name: Mercenary Starport
		RequiresCondition: mercenary
	Tooltip:
		RequiresCondition: !smuggler && !mercenary
	Power:
		Amount: -150
	-FireWarheadsOnDeath@02:
	ExternalCondition@lights:
		Condition: frigate_proximity_influence
	WithIdleOverlay@LIGHTS:
		RequiresCondition: !build-incomplete && frigate_proximity_influence
		Sequence: active
	ProvidesPrerequisite@cloak_frigate:
		Prerequisite: cloak.frigate
	ProvidesPrerequisite@atreides_combat:
		Prerequisite: starport.atreides_combat
		Factions: atreides
	ProvidesPrerequisite@ordos_combat:
		Prerequisite: starport.ordos_combat
		Factions: ordos
	ProvidesPrerequisite@harkonnen_combat:
		Prerequisite: starport.harkonnen_combat
		Factions: harkonnen
	ProvidesPrerequisite@corrino_combat:
		Prerequisite: starport.corrino_combat
		Factions: corrino
	ProvidesPrerequisite@cheap_Tank:
		Prerequisite: starport.cheap_combat
		Factions: smuggler
	ProvidesPrerequisite@fremen_Tank:
		Prerequisite: starport.fremen_combat
		Factions: fremen
	ProvidesPrerequisite@mercenary_Tank:
		Prerequisite: starport.mercenary_combat
		Factions: mercenary
	ProvidesPrerequisite@smugglerstarport:
		Prerequisite: starport.smuggler
		Factions: smuggler
	ProvidesPrerequisite@mercenaryStarport:
		Prerequisite: starport.mercenary
		Factions: mercenary
	ProvidesPrerequisite@ordosstarport:
		Prerequisite: starport.ordos
		Factions: ordos
	GrantConditionOnFaction@mercenary:
		Condition: mercenary
		Factions: mercenary
	GrantConditionOnFaction@smuggler:
		Condition: smuggler
		Factions: smuggler
	FireWarheadsOnDeath@03:
		Type: CenterPosition
		Weapon: buildingExplosions05
		EmptyWeapon: buildingExplosions05
		Chance: 80
	ProduceActorPower@contractors:
		Name: Hire Contractors
		Description: 5 elite mercenaries with an accurate deployable cannons. -Huge firepower in a small area. Delivered in Crawler that can transport and heal infantry. -Armed with a laser device that stops targets completely
		Icon: mercenary
		RequiresCondition: mercenary
		Prerequisites: upgrade.starport, ~techlevel.superweapons, ~!factions.standard
		Actors: crawler
		Type: Starport
		ChargeInterval: 3750
		OrderName: ProduceActorPower.contractors
		SupportPowerPaletteOrder: 250
		EndChargeTextNotification: Hire Contractors ready.

wall:
	Buildable:
		BuildDuration: 150
	Valued:
		Cost: 100
	Health:
		HP: 20000
	Armor:
		Type: wall
	RevealsShroud:
		Range: 1c768
	LineBuild:
		Range: 6
		NodeTypes: wall, turret
	RequiresBuildableArea:
		AreaTypes: building
		Adjacent: 8

medium_gun_turret:
	Inherits@jammer: ^jammedvision
	Buildable:
		Prerequisites: barracks
		BuildDuration: 300
		Description: Defensive structure. -Strong vs Infantry, Light Vehicles. -Weak vs Tanks, Artillery. Detects invisible units.
	Valued:
		Cost: 500
	BlocksProjectiles:
		Height: 512
	Health:
		HP: 30000
	Armor:
		Type: wall
	RevealsShroud:
		Range: 5c756
	Turreted:
		TurnSpeed: 21
		InitialFacing: 512
		RealignDelay: -1
	WithSpriteTurret:
		Recoils: false
	WithSpriteBarrel:
		RequiresCondition: !build-incomplete
	Armament:
		Weapon: 110mm_Gun
		LocalOffset: 512,0,432
		MuzzleSequence: muzzle
		Recoil: 200
		RecoilRecovery: 25
	Power:
		Amount: -50
	DetectCloaked:
		Range: 2c512
	ExternalCondition@jammed:
		Condition: jammed
	RevealsShroudMultiplier@jammed:
		RequiresCondition: jammed
		Modifier: 50
	DetectCloakedMultiplier@jammed:
		RequiresCondition: jammed
		Modifier: 5
	-RevealOnFire:
	WithRangeCircle@invis:
		Range: 2c512

large_gun_turret:
	Inherits@AUTOTARGET: ^AutoTargetAll
	Inherits@Jammer: ^jammedvision
	Buildable:
		Prerequisites: outpost, upgrade.outpost, ~techlevel.medium
		BuildDuration: 400
		Description: Defensive structure. -Strong vs Tanks, Aircraft. -Weak vs Infantry, Artillery. Homing Missiles. Detects invisible units. Requires power to operate.
	Valued:
		Cost: 750
	BlocksProjectiles:
		Height: 512
	Health:
		HP: 30000
	Armor:
		Type: wall
	RevealsShroud:
		Range: 6c768
	Armament:
		Weapon: MissleTowerNew
		LocalOffset: 256,384,768, 256,-384,768
	Turreted:
		TurnSpeed: 28
	Power:
		Amount: -50
	DetectCloaked:
		Range: 2c512
	ExternalCondition@jammed:
		Condition: jammed
	RevealsShroudMultiplier@jammed:
		RequiresCondition: jammed
		Modifier: 50
	DetectCloakedMultiplier@jammed:
		RequiresCondition: jammed
		Modifier: 5
	-RevealOnFire:
	WithRangeCircle@invis:
		Range: 2c512

repair_pad:
	Buildable:
		Queue: Building
		Prerequisites: heavy_factory, ~techlevel.medium, ~!repair_pad.bot
		BuildDuration: 400
	Valued:
		Cost: 750
	Health:
		HP: 40000
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RevealsShroud:
		Range: 3c768
	RevealsShroud@BigVis:
		Range: 7c768
		RequiresCondition: BiggerVision
	Capturable:
		RequiresCondition: !build-incomplete
		Types: building
		CancelActivity: true
	Power:
		Amount: -50
	-FireWarheadsOnDeath@02:
	FireWarheadsOnDeath@03:
		Type: CenterPosition
		Weapon: buildingExplosions05
		EmptyWeapon: buildingExplosions05
		Chance: 80



repair_pad.bot:
	Inherits: repair_pad
	Buildable:
		BuildPaletteOrder: 650
		Queue: Building
		Prerequisites: heavy_factory, ~techlevel.medium, ~repair_pad.bot
	Tooltip:
		Name: Repair Pad - bot dummy
	D2kBuilding:
		Footprint: +++ +=+ =+=
	GrantConditionOnBotOwner@enableProximity:
		Condition: bot
		Bots: omnius, vidious, gladius
	ProximityExternalCondition@repairingForbot:
		Condition: start_repair
		Range: 2c0
		RequiresCondition: bot
	ProvidesPrerequisite@buildingname:
		Prerequisite: repair_pad

high_tech_factory:
	Buildable:
		BuildDuration: 500
	Valued:
		Cost: 1250
	Health:
		HP: 45000
	RenderSprites:
		Image: hightech.ordos
		FactionImages:
			atreides: hightech.atreides
			fremen: hightech.fremen
			harkonnen: hightech.harkonnen
			corrino: hightech.corrino
			smuggler: hightech.smuggler
			mercenary: hightech.smuggler
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RevealsShroud:
		Range: 4c768
	RevealsShroud@BigVis:
		Range: 8c768
		RequiresCondition: BiggerVision
	Power:
		Amount: -125
	RallyPoint:
		ForceSetType: Infantry
	ProvidesPrerequisite@ordosprerequisite:
		Prerequisite: hightech.ordos
		Factions: ordos
	SpawnActorOnDeath@bigcrater:
		Offset: 0,2
	GrantConditionOnFaction@airstrike:
		Condition: atreides
		Factions: atreides
	GrantConditionOnFaction@reinforcemets:
		Condition: ordos
		Factions: ordos
	GrantConditionOnFaction@harkonnendropship:
		Condition: corrino
		Factions: corrino
	GrantConditionOnFaction@fremen:
		Condition: fremen
		Factions: fremen
	GrantConditionOnFaction@Corrinodropship:
		Condition: harkonnen
		Factions: harkonnen
	ProvidesPrerequisite@enableupgradeStandard_enhancedAir:
		Prerequisite: High Tech Factory
		Factions: atreides, ordos, harkonnen, fremen, corrino
	ProvidesPrerequisite@enableupgradeSubfaction:
		Prerequisite: High Tech Factory
		RequiresPrerequisites: ~!factions.standard
		Factions: mercenary, smuggler, fremen, corrino
	-AirstrikePower:
	AirstrikePower@ATREIDES_ENABLED:
		OrderName: AtreidesEnabledAirstrike
		Icon: ornistrike
		Name: Air Strike
		Prerequisites: ~techlevel.superweapons, upgrade.hightech
		ChargeInterval: 6750
		SquadSize: 3
		SquadOffset: -1024, 1024, 0
		Description: 3 Ornithopters drops a heavy grenades at the target location. Effective against infantry, light vehicles and Turrets.
		UnitType: ornithopter_bomb
		DisplayBeacon: True
		CameraActor: camera
		RequiresCondition: atreides
		CameraRemoveDelay: 75
		ArrowSequence: arrow
		CircleSequence: circles
		UseDirectionalTarget: True
		DirectionArrowAnimation: ornidirection
		SupportPowerPaletteOrder: 430
		EndChargeTextNotification: Air Strike ready.
		SelectTargetTextNotification: Select target.
	AirstrikePower@HARKONNEN_ENABLED:
		OrderName: HarkonnenEnabledAirstrike
		Icon: lightStrike
		Name: Air Support
		Prerequisites: ~techlevel.superweapons, upgrade.hightech
		ChargeInterval: 4500
		SquadSize: 5
		SquadOffset: -1024, 1024, 0
		Description: 5 Ornithopters with a heavy machine guns hit at the target location. Effective against infantry and light vehicles.
		UnitType: ornithopter_mg
		DisplayBeacon: True
		CameraActor: camera
		RequiresCondition: harkonnen
		CameraRemoveDelay: 50
		ArrowSequence: arrow
		CircleSequence: circles
		UseDirectionalTarget: True
		DirectionArrowAnimation: ornidirection
		SupportPowerPaletteOrder: 300
		EndChargeTextNotification: Air Support ready.
		SelectTargetTextNotification: Select target.
	AirstrikePower@ORDOS_ENABLED:
		OrderName: OrdosEnabledAirstike
		Icon: gascloud
		RequiresCondition: ordos
		Name: Gas Bomb
		Prerequisites: ~techlevel.superweapons, upgrade.hightech
		ChargeInterval: 5250
		SquadSize: 1
		SquadOffset: -1024, 2048, 0
		Description: Ornithopter drops a bomb filled with Deviator gas at the target location. Effective against vehicles only.
		UnitType: ornithopter.bomber
		DisplayBeacon: True
		CameraActor: camera
		CameraRemoveDelay: 75
		ArrowSequence: arrow
		CircleSequence: circles
		UseDirectionalTarget: True
		DirectionArrowAnimation: ornidirection
		SupportPowerPaletteOrder: 350
		EndChargeTextNotification: Gas Bomb ready.
		SelectTargetTextNotification: Select target.
	ParatroopersPower@CORRINO_ENABLED:
		UnitType: carryall.reinforce
		RequiresCondition: corrino
		OrderName: CorrinoDrop
		Prerequisites: ~techlevel.superweapons, upgrade.hightech
		SquadSize: 5
		SquadOffset: -2048, 1024, 0
		Icon: sardaukarFleet
		ChargeInterval: 9000
		Name: Emperor Airdrop
		Description: Carryall squadron drops 25 Sardaukars on target location. Clear space required for safe descent.
		DropItems: mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar, mpsardaukar
		ReinforcementsArrivedTextNotification: Reinforcements have arrived.
		SelectTargetTextNotification: Select target.
		AllowImpassableCells: true
		QuantizedFacings: 8
		DisplayBeacon: true
		ArrowSequence: arrow
		CircleSequence: circles
		UseDirectionalTarget: True
		DirectionArrowAnimation: ornidirection
		SupportPowerPaletteOrder: 600
		EndChargeTextNotification: Emperor Airdrop ready.
	ParatroopersPower@FREMEN_ENABLED:
		UnitType: carryall.reinforce.for.thumper
		RequiresCondition: fremen
		OrderName: FremenDrop
		Prerequisites: ~techlevel.superweapons, upgrade.hightech
		SquadSize: 1
		Icon: true_sayer
		ChargeInterval: 1500
		Name: Fremen Thumper
		Description: Carriall drops 1 Fremen Thumper on clear space. Sacrifices himself to attract a sandworm. Invisible when standing and not deployed. Regenerates to full health after damage.
		DropItems: box.for.thumper
		ReinforcementsArrivedTextNotification: Reinforcements have arrived.
		SelectTargetTextNotification: Select target.
		AllowImpassableCells: false
		QuantizedFacings: 8
		DisplayBeacon: true
		ArrowSequence: arrow
		CircleSequence: circles
		UseDirectionalTarget: True
		DirectionArrowAnimation: ornidirection
		SupportPowerPaletteOrder: 100
		EndChargeTextNotification: Fremen Airdrop ready.




research_centre:
	Buildable:
		BuildDuration: 500
		Prerequisites: heavy_factory, outpost, ~techlevel.high
	Valued:
		Cost: 1250
	Health:
		HP: 35000
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RevealsShroud:
		Range: 4c768
	RevealsShroud@BigVis:
		Range: 8c768
		RequiresCondition: BiggerVision
	Power:
		Amount: -175
	RenderSprites:
		Image: research.ordos
		FactionImages:
			atreides: research.atreides
			fremen: research.atreides
			harkonnen: research.harkonnen
			corrino: research.harkonnen
			smuggler: research.smuggler
	ProvidesPrerequisite@s:
		Prerequisite: research_centre.smuggler
		Factions: smuggler
	GrantConditionOnFaction@jammereds:
		Condition: smuggler
		Factions: smuggler
	SpawnActorPower@SmugglerTrueSayer:
		EffectImage: frigate.harkonnen
		EffectSequence:
		Actor: jammer_point
		Icon: jammer
		RequiresCondition: smuggler
		Prerequisites: ~techlevel.superweapons, upgrade.research
		ChargeInterval: 6000
		LifeTime: 6000
		StartFullyCharged: false
		DeploySound: audio/EBoD_hidenunits1.wav
		LaunchSound: audio/EBoD_hidenunits1.wav
		Name: Signal Dominator
		Description: Shows the marked area and detects invisible units. Blocks enemy view of marked area.
		SupportPowerPaletteOrder: 400
		EndChargeTextNotification: Signal Dominator ready.
		DisplayBeacon: True
		OrderName: SmugglerJammer
		DisplayRadarPing: true
		BlockedCursor: move-blocked

palace:
	Inherits: ^Building
	Inherits@PRIMARY: ^PrimaryBuilding
	Inherits@IDISABLE: ^DisableOnLowPowerOrPowerDown
	Buildable:
		Prerequisites: research_centre, ~techlevel.high, ~factions.standard
		Queue: Building
		BuildPaletteOrder: 620
		BuildDuration: 900
		BuildDurationModifier: 100
		Description: Unlocks elite infantry and weapons. Requires power to operate.
	Selectable:
		Bounds: 3072, 3072
	Valued:
		Cost: 1750
	Tooltip:
		Name: Palace
	D2kBuilding:
		Footprint: xx= xxx =xx
		Dimensions: 3,3
	Health:
		HP: 80000
	HitShape:
		Type: Rectangle
			TopLeft: -1536, -512
			BottomRight: 1536, 512
	HitShape@TOP:
		Type: Rectangle
			TopLeft: -1536, -1536
			BottomRight: 512, -512
	HitShape@BOTTOM:
		Type: Rectangle
			TopLeft: -512, 512
			BottomRight: 1536, 1536
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RevealsShroud:
		Range: 4c768
	RevealsShroud@BigVis:
		Range: 8c768
		RequiresCondition: BiggerVision && !disabled
	RenderSprites:
		Image: palace.ordos
		FactionImages:
			atreides: palace.atreides
			fremen: palace.atreides
			harkonnen: palace.harkonnen
			corrino: palace.corrino
	WithBuildingBib:
		HasMinibib: True
	WithSupportPowerActivationOverlay:
		RequiresCondition: !build-incomplete && !launchpad-damaged && harkonnen
	GrantConditionOnDamageState@LAUNCHPADDAMAGED:
		Condition: launchpad-damaged
	Power:
		Amount: -200
	RallyPoint:
	ProvidesPrerequisite@nuke:
		Prerequisite: palace.nuke
		Factions: harkonnen
	ProvidesPrerequisite@fremen:
		Prerequisite: palace.fremen
		Factions: atreides
	ProvidesPrerequisite@saboteur:
		Prerequisite: palace.saboteur
		Factions: ordos
	ProvidesPrerequisite@sardaukar:
		Prerequisite: palace.sardaukar
		Factions: corrino
	PrimaryBuilding:
		ProductionQueues: Fremen, Saboteur
		RequiresCondition: atreides || ordos
	WithTextDecoration@primary:
		RequiresCondition: primary && (atreides || ordos)
	-NukePower:
	NukePower@harkonnen_standart:
		OrderName: DeathHand_Standart
		Cursor: nuke
		Icon: deathhand
		PauseOnCondition: disabled
		MissileDelay: 18
		DetonationAltitude: 6c0
		RequiresCondition: harkonnen
		RemoveMissileOnDetonation: True
		Prerequisites: ~techlevel.superweapons, ~palace.nuke
		ChargeInterval: 7500
		Name: Death Hand
		Description: Launches an unstoppable atomic missile. Destroy almost everything at the target location
		BeginChargeSpeechNotification: DeathHandMissilePrepping
		EndChargeSpeechNotification: DeathHandMissileReady
		IncomingSpeechNotification: MissileLaunchDetected
		MissileWeapon: deathhand
		SpawnOffset: 32,816,0
		DisplayBeacon: True
		DisplayRadarPing: True
		CameraRange: 7c0
		CameraRemoveDelay: 150
		ArrowSequence: arrow
		CircleSequence: circles
		FlightVelocity: 384
		TrailInterval: 0
		TrailImage: large_trail
		TrailSequences: idle
		SupportPowerPaletteOrder: 500
		EndChargeTextNotification: Death Hand ready.
		MissileImage: deathhand
	-ProduceActorPower@fremen:
	ProduceActorPower@fremen_standart:
		Name: Elite Rangers
		Description: 5 stealth warriors armed with anti-vehicle sonic weapon. Effective against everything except infantry. Regenerates to full health after damage. Resistant to slowdown from damage.
		Icon: fremen
		PauseOnCondition: disabled
		RequiresCondition: atreides
		Prerequisites: ~techlevel.superweapons, ~palace.fremen, ~factions.standard, !~factions.allowed
		Actors: fremen, fremen, fremen, fremen, fremen
		Type: Fremen
		ChargeInterval: 3000
		OrderName: ProduceActorPower.Fremen_Standart
		SupportPowerPaletteOrder: 200
		EndChargeTextNotification: Elite Rangers ready.
	ProduceActorPower@saboteur_standart:
		Name: Hidden Saboteur
		Description: Stealth infantry armed with explosives. Can explode buildings and vehicles or a huge area around himself. Remains invisible with critical health. Quickly becomes invisible until deployed.
		Icon: saboteur
		PauseOnCondition: disabled
		RequiresCondition: ordos
		Prerequisites: ~techlevel.superweapons, ~palace.saboteur, ~factions.standard, !~factions.allowed
		Actors: saboteur
		Type: Saboteur
		ChargeInterval: 2250
		OrderName: ProduceActorPower.Saboteur
		SupportPowerPaletteOrder: 150
		EndChargeTextNotification: Hidden Saboteur ready.
	-ProduceActorPower@saboteur:
	Production@Atreides:
		Produces: Fremen
		RequiresCondition: atreides
	Production@OfficerSpawn:
		Produces: Officer
		RequiresCondition: atreides
	Production@Ordos:
		Produces: Saboteur
		RequiresCondition: ordos
	GrantConditionOnFaction@Atreides:
		Condition: atreides
		Factions: atreides, fremen
	GrantConditionOnFaction@Harkonnen:
		Condition: harkonnen
		Factions: harkonnen
	GrantConditionOnFaction@Ordos:
		Condition: ordos
		Factions: ordos, mercenary, smuggler
	SupportPowerChargeBar:
		RequiresCondition: atreides || harkonnen || ordos
	ProvidesPrerequisite@buildingname:






palace.harkonnen:
	Inherits: ^Building
	Inherits@IDISABLE: ^DisableOnLowPowerOrPowerDown
	Valued:
		Cost: 1750
	Health:
		HP: 80000
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RevealsShroud:
		Range: 4c768
	RevealsShroud@BigVis:
		Range: 8c768
		RequiresCondition: BiggerVision && !disabled
	Power:
		Amount: -200
	Buildable:
		Prerequisites: research_centre, ~techlevel.high, ~!factions.standard, ~conyard.harkonnen
		Queue: Building
		BuildPaletteOrder: 620
		BuildDuration: 900
		BuildDurationModifier: 100
		Description: Unlocks elite infantry and weapons. Requires power to operate.
	Selectable:
		Bounds: 3072, 3072
	Tooltip:
		Name: Harkonnen Palace
	D2kBuilding:
		Footprint: xx= xxx =xx
		Dimensions: 3,3
	Health:
		HP: 80000
	HitShape:
		Type: Rectangle
			TopLeft: -1536, -512
			BottomRight: 1536, 512
	HitShape@TOP:
		Type: Rectangle
			TopLeft: -1536, -1536
			BottomRight: 512, -512
	HitShape@BOTTOM:
		Type: Rectangle
			TopLeft: -512, 512
			BottomRight: 1536, 1536
	RenderSprites:
		Image: palace.harkonnen
	WithBuildingBib:
		HasMinibib: True
	WithSupportPowerActivationOverlay:
		RequiresCondition: !build-incomplete && !launchpad-damaged
	GrantConditionOnDamageState@LAUNCHPADDAMAGED:
		Condition: launchpad-damaged
	ProvidesPrerequisite@nuke:
		Prerequisite: palace.nuke
		Factions: harkonnen
	NukePower:
		LaunchSound: audio/death_hand_launch_1.wav
		Cursor: nuke
		Icon: deathhand
		ChargeInterval: 7500
		MissileWeapon: deathhand
		MissileDelay: 18
		Name: Death Hand
		SpawnOffset: 32,816,0
		DetonationAltitude: 6c0
		RemoveMissileOnDetonation: True
		FlightVelocity: 384
		TrailInterval: 0
		TrailImage: large_trail
		TrailSequences: idle
		CameraRemoveDelay: 100
		PauseOnCondition: disabled
		Description: Launches an unstoppable atomic missile. Destroy almost everything at the target location.
		BeginChargeSpeechNotification: DeathHandMissilePrepping
		EndChargeSpeechNotification: DeathHandMissileReady
		IncomingSpeechNotification: MissileLaunchDetected
		DisplayBeacon: True
		DisplayRadarPing: True
		CameraRange: 7c0
		ArrowSequence: arrow
		SupportPowerPaletteOrder: 500
		EndChargeTextNotification: Death Hand ready.
		MissileImage: deathhand
		OrderName: DeathHand_Enabled
	SupportPowerChargeBar:
	ProvidesPrerequisite@buildingname:

palace.atreides:
	Inherits: ^Building
	Inherits@PRIMARY: ^PrimaryBuilding
	Inherits@IDISABLE: ^DisableOnLowPowerOrPowerDown
	PrimaryBuilding:
		ProductionQueues: Fremen
	Buildable:
		Prerequisites: research_centre, ~techlevel.high, ~!factions.standard, ~conyard.atreides
		Queue: Building
		BuildPaletteOrder: 620
		BuildDuration: 900
		BuildDurationModifier: 100
		Description: Unlocks elite infantry and weapons. Requires power to operate.
	Selectable:
		Bounds: 3072, 3072
	RallyPoint:
	Valued:
		Cost: 1750
	Tooltip:
		Name: Atreides Palace
	D2kBuilding:
		Footprint: xx= xxx =xx
		Dimensions: 3,3
	Health:
		HP: 80000
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	HitShape:
		Type: Rectangle
			TopLeft: -1536, -512
			BottomRight: 1536, 512
	HitShape@TOP:
		Type: Rectangle
			TopLeft: -1536, -1536
			BottomRight: 512, -512
	HitShape@BOTTOM:
		Type: Rectangle
			TopLeft: -512, 512
			BottomRight: 1536, 1536
	RenderSprites:
		Image: palace.atreides
		FactionImages:
	WithBuildingBib:
		HasMinibib: True
	Power:
		Amount: -200
	Exit@1:
		SpawnOffset: -704,768,0
		ExitCell: -1,2
	Exit@2:
		SpawnOffset: -704,768,0
		ExitCell: -1,3
	Exit@3:
		SpawnOffset: -704,768,0
		ExitCell: 0,3
	Exit@4:
		SpawnOffset: -704,768,0
		ExitCell: 0,2
	RevealsShroud:
		Range: 4c768
	RevealsShroud@BigVis:
		Range: 8c768
		RequiresCondition: BiggerVision && !disabled
	ProduceActorPower@Fremen_Enabled:
		Name: Elite Rangers
		Description: 5 stealth warriors armed with anti-vehicle sonic weapon. Effective against everything except infantry. Regenerates to full health after damage. Resistant to slowdown from damage.
		Actors: fremen, fremen, fremen, fremen, fremen
		Type: Fremen
		ChargeInterval: 3000
		Icon: fremen
		PauseOnCondition: disabled
		Prerequisites: ~techlevel.superweapons, ~!factions.standard
		OrderName: ProduceActorPower.Fremen_Standart
		SupportPowerPaletteOrder: 200
		EndChargeTextNotification: Elite Rangers ready.
	Production@Atreides_enabled:
		Produces: Fremen
	SupportPowerChargeBar:
	ProvidesPrerequisite@buildingname:


palace.ordos:
	Inherits: ^Building
	Inherits@PRIMARY: ^PrimaryBuilding
	Inherits@IDISABLE: ^DisableOnLowPowerOrPowerDown
	PrimaryBuilding:
		ProductionQueues: Saboteur
	Buildable:
		Prerequisites: research_centre, ~techlevel.high, ~!factions.standard, ~conyard.ordos
		Queue: Building
		BuildPaletteOrder: 620
		BuildDuration: 900
		BuildDurationModifier: 100
		Description: Unlocks elite infantry and weapons. Requires power to operate.
	Selectable:
		Bounds: 3072, 3072
	RallyPoint:
	Valued:
		Cost: 1750
	Tooltip:
		Name: Ordos Palace
	D2kBuilding:
		Footprint: xx= xxx =xx
		Dimensions: 3,3
	Health:
		HP: 80000
	HitShape:
		Type: Rectangle
			TopLeft: -1536, -512
			BottomRight: 1536, 512
	HitShape@TOP:
		Type: Rectangle
			TopLeft: -1536, -1536
			BottomRight: 512, -512
	HitShape@BOTTOM:
		Type: Rectangle
			TopLeft: -512, 512
			BottomRight: 1536, 1536
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	Exit@1:
		SpawnOffset: -704,768,0
		ExitCell: -1,2
	Exit@2:
		SpawnOffset: -704,768,0
		ExitCell: -1,3
	Exit@3:
		SpawnOffset: -704,768,0
		ExitCell: 0,3
	Exit@4:
		SpawnOffset: -704,768,0
		ExitCell: 0,2
	RevealsShroud:
		Range: 4c768
	RevealsShroud@BigVis:
		Range: 8c768
		RequiresCondition: BiggerVision && !disabled
	WithBuildingBib:
		HasMinibib: True
	Power:
		Amount: -200
	SupportPowerChargeBar:
	Production:
		Produces: Building, Elite
	ProduceActorPower@Saboteur_Enabled:
		Name: Hidden Saboteur
		Description: Stealth infantry armed with explosives. Can explode buildings and vehicles or a huge area around himself. Remains invisible with critical health. Quickly becomes invisible until deployed.
		Actors: saboteur
		Type: Saboteur
		ChargeInterval: 2250
		Icon: saboteur
		PauseOnCondition: disabled
		Prerequisites: ~techlevel.superweapons, ~!factions.standard
		OrderName: ProduceActorPower.Saboteur
		SupportPowerPaletteOrder: 150
		EndChargeTextNotification: Hidden Saboteur ready.
	Production@Saboteur_enabled:
		Produces: Saboteur
	ProvidesPrerequisite@buildingname:
	

palace.corrino:
	Inherits: ^Defense
	Inherits: ^Building
	Inherits@PRIMARY: ^PrimaryBuilding
	Inherits@IDISABLE: ^DisableOnLowPowerOrPowerDown
	Inherits@AUTOTARGET: ^AutoTargetGround
	PrimaryBuilding:
		ProductionQueues: Designator
	Buildable:
		Prerequisites: research_centre, ~techlevel.high, ~conyard.corrino, ~!factions.standard
		Queue: Building
		BuildPaletteOrder: 630
		BuildDuration: 1300
		BuildDurationModifier: 100
		Description: Unlocks Target Designator. Has built-in Bombardment weapons. -Modest vs Everything. Requires power to operate
	Selectable:
		Bounds: 3072, 3072
	Valued:
		Cost: 2500
	RallyPoint:
	Tooltip:
		Name: Palace Corrino
	D2kBuilding:
		Footprint: xxx xxx ===
		Dimensions: 3,3
	Health:
		HP: 80000
	HitShape:
		Type: Rectangle
			TopLeft: -1536, -512
			BottomRight: 1536, 512
	HitShape@TOP:
		Type: Rectangle
			TopLeft: -1536, -1536
			BottomRight: 1536, -512
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	Armor:
		Type: building
	RevealsShroud:
		Range: 4c768
	RevealsShroud@BigVis:
		Range: 8c768
		RequiresCondition: BiggerVision && !disabled
	WithBuildingBib:
		HasMinibib: True
	Power:
		Amount: -250
	Exit@1:
		SpawnOffset: 544,-224,0
		ExitCell: 0,2
	Exit@2:
		SpawnOffset: 544,-224,0
		ExitCell: 1,2
	Exit@3:
		SpawnOffset: 544,-224,0
		ExitCell: 2,2
	ProvidesPrerequisite@buildingname:
	ProduceActorPower@Fremen:
		Name: Target Designator
		Description: Unarmed infantry with laser area pointer and better vision range. Targets near the laser marked point take double damage. Regenerates to half health after damage. Resistant to slowdown from damage, rocks and dunes.
		Actors: officer
		Type: Designator
		ChargeInterval: 750
		Icon: officer
		PauseOnCondition: disabled
		Prerequisites: ~techlevel.superweapons, ~!factions.standard
		OrderName: ProduceActorPower.fremen_enabled
		SupportPowerPaletteOrder: 50
		EndChargeTextNotification: Target Designator ready.
	Production@Corrino_enabled:
		Produces: Designator
	Armament@clusterMissile.palace:
		FireDelay: 5
		Weapon: clusterMissile.palace
		LocalOffset: 128,64,640, 128,-64,640
	WithRangeCircle:
		Range: 7c512
	AttackTurreted:
		PauseOnCondition: disabled
		FacingTolerance: 128
	Turreted:
		TurnSpeed: 50
	-RevealOnFire:

fremen_sietch:
	Inherits: ^Building
	Inherits@primary: ^PrimaryBuilding
	-D2kBuilding:
	WithBuildingBib:
	Buildable:
		Queue: Building
		BuildPaletteOrder: 640
		BuildDuration: 1300
		BuildDurationModifier: 100
		Prerequisites: research_centre, ~techlevel.high, ~conyard.fremen, ~!factions.standard
		Description: Unlocks Worm Rider
	SpawnActorsOnSell:
		ActorTypes: light_inf
	Valued:
		Cost: 2500
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	RevealsShroud:
		Range: 4c768
	RevealsShroud@BigVis:
		Range: 8c768
		RequiresCondition: BiggerVision
	PrimaryBuilding:
		ProductionQueues: Rider
	HitShape:
		Type: Rectangle
			TopLeft: -1536, -512
			BottomRight: 1536, 512
	HitShape@TOP:
		Type: Rectangle
			TopLeft: -536, -1536
			BottomRight: 512, -512
	HitShape@BOTTOM:
		Type: Rectangle
			TopLeft: -512, 512
			BottomRight: 1536, 1536
	Building:
		Footprint: =x= xxx =xx
		Dimensions: 3,3
		TerrainTypes: Rock, Concrete
		BuildSounds: BUILD1.WAV
	RallyPoint:
	Tooltip:
		Name: Sietch
	Health:
		HP: 80000
	Armor:
		Type: building
	Selectable:
		Bounds: 3072, 3072
	Exit@1:
		SpawnOffset: -704,1024,0
		ExitCell: -1,2
	Exit@2:
		SpawnOffset: -704,1024,0
		ExitCell: -1,3
	Exit@3:
		SpawnOffset: -704,1024,0
		ExitCell: 0,3
	Production@wormriderproduction:
		Produces: Rider
	ProduceActorPower@wormrider:
		Name: Worm Rider
		Description: Attracts a worm and saddle it for a couple of minutes. Invisible when not deployed. Regenerates to full health after damage. Best vision range on worm.
		Icon: sandworm
		Prerequisites: ~techlevel.high
		Actors: worm_rider
		Type: Rider
		ChargeInterval: 8250
		OrderName: ProduceActorPower.Rider
		SupportPowerPaletteOrder: 550
		EndChargeTextNotification: Worm Rider ready.

upgrade.conyard:
	Buildable:
		BuildPaletteOrder: 1
		BuildDuration: 750
		Prerequisites: ~construction_yard, ~!choosefaction
		Description: Gives Conyards extra energy. Increases vision of buildings if energy is not low
	Valued:
		Cost: 1000

upgrade.outpost:
	AlwaysVisible:
	Interactable:
	ScriptTriggers:
	Tooltip:
		Name: Outpost Upgrade
	Buildable:
		BuildPaletteOrder: 2
		Prerequisites: outpost, ~!choosefaction
		Queue: Upgrade
		BuildLimit: 1
		BuildDuration: 500
		BuildDurationModifier: 100
		Description: Unlocks Rocket Turret
	Valued:
		Cost: 750
	RenderSprites:
		Image: outpost.ordos
		FactionImages:
			atreides: outpost.atreides
			fremen: outpost.atreides
			harkonnen: outpost.harkonnen
			corrino: outpost.harkonnen
	ProvidesPrerequisite@upgradename:

upgrade.silo:
	AlwaysVisible:
	Interactable:
	ScriptTriggers:
	Tooltip:
		Name: Silo Upgrade
	Buildable:
		BuildPaletteOrder: 3
		Prerequisites: silo, ~!choosefaction
		Queue: Upgrade
		BuildLimit: 1
		BuildDuration: 250
		BuildDurationModifier: 100
		Description: Heals ally infantry when deployed
	Valued:
		Cost: 500
	RenderSprites:
		Image: silo.ordos
		FactionImages:
			atreides: silo.atreides
			fremen: silo.atreides
			harkonnen: silo.harkonnen
			corrino: silo.harkonnen
	ProvidesPrerequisite@upgradename:

upgrade.barracks:
	Buildable:
		BuildPaletteOrder: 4
		Prerequisites: barracks, ~!choosefaction
		BuildDuration: 250
		Description: Unlocks additional infantry
	Valued:
		Cost: 500
	RenderSprites:
		Image: barracks.ordos
		FactionImages:
			atreides: barracks.atreides
			fremen: barracks.fremen
			harkonnen: barracks.harkonnen
			corrino: barracks.corrino
			mercenary: barracks.mercenary

upgrade.light:
	Buildable:
		BuildPaletteOrder: 5
		Prerequisites: light_factory, ~!choosefaction
		BuildDuration: 500
		Description: Unlocks additional light vehicles
	Valued:
		Cost: 750

upgrade.heavy:
	Buildable:
		BuildPaletteOrder: 6
		Prerequisites: heavy_factory, ~!choosefaction
		BuildDuration: 750
		Description: Unlocks additional heavy vehicles
	Valued:
		Cost: 1000

upgrade.hightech:
	Buildable:
		BuildPaletteOrder: 7
		Prerequisites: ~!choosefaction, High Tech Factory, ~techlevel.superweapons
		BuildDuration: 1000
		Description: Unlocks hight tech support powers
	Valued:
		Cost: 1250
	RenderSprites:
		Image: hightech.atreides
		FactionImages:
			ordos: hightech.ordos
			harkonnen: hightech.harkonnen
			corrino: hightech.harkonnen
			smuggler: hightech.ordos
			mercenary: hightech.ordos

upgrade.research:
	AlwaysVisible:
	Interactable:
	ScriptTriggers:
	Tooltip:
		Name: Smuggler IX Research Center Upgrade
	Buildable:
		BuildPaletteOrder: 9
		Prerequisites: ~!choosefaction, ~research_centre.smuggler, ~!factions.standard, ~techlevel.high
		Queue: Upgrade
		BuildLimit: 1
		BuildDuration: 1000
		BuildDurationModifier: 100
		Description: Unlocks Spy Comms
	Valued:
		Cost: 1250
	RenderSprites:
		Image: research.smuggler
	ProvidesPrerequisite@upgradename:

upgrade.starport:
	AlwaysVisible:
	Interactable:
	ScriptTriggers:
	Tooltip:
		Name: Mercenary Starport Upgrade
	Buildable:
		BuildPaletteOrder: 10
		Prerequisites: ~!choosefaction, ~starport.mercenary, ~!factions.standard, ~techlevel.high
		Queue: Upgrade
		BuildLimit: 1
		BuildDuration: 1250
		BuildDurationModifier: 100
		Description: Unlocks Hire Contractors
	Valued:
		Cost: 1500
	RenderSprites:
		Image: starport.mercenary
	ProvidesPrerequisite@upgradename:

sietch:
	-GrantRandomCondition@randomFX:
	-FireWarheadsOnDeath@02:
	-FireWarheadsOnDeath@03:
	-FireWarheadsOnDeath@sabotuerdemolition:
	-Demolishable:
	Demolishable@testfix:
		Condition: being-demolished
	Building:
		Footprint: xx xx
		Dimensions: 2,2
		TerrainTypes: Cliff

conyard.atreides:
	Inherits: construction_yard
	Buildable:
		Queue: Building
		BuildDuration: 6000
		BuildDurationModifier: 100
		BuildPaletteOrder: 1001
		Prerequisites: ~merged.atreides
		ForceFaction: atreides
	UpdatesPlayerStatistics:
		OverrideActor: construction_yard
	Tooltip:
		Name: Atreides Conyard

conyard.harkonnen:
	Inherits: construction_yard
	Buildable:
		Queue: Building
		BuildDuration: 6000
		BuildDurationModifier: 100
		BuildPaletteOrder: 1002
		Prerequisites: ~merged.harkonnen
		ForceFaction: harkonnen
	UpdatesPlayerStatistics:
		OverrideActor: construction_yard
	Tooltip:
		Name: Harkonnen Conyard

conyard.ordos:
	Inherits: construction_yard
	Buildable:
		Queue: Building
		BuildDuration: 6000
		BuildDurationModifier: 100
		BuildPaletteOrder: 1003
		Prerequisites: ~merged.ordos
		ForceFaction: ordos
	UpdatesPlayerStatistics:
		OverrideActor: construction_yard
	Tooltip:
		Name: Ordos Conyard

conyard.fremen:
	Inherits: construction_yard
	Buildable:
		Queue: Building
		BuildDuration: 6000
		BuildDurationModifier: 100
		BuildPaletteOrder: 1004
		Prerequisites: ~merged.fremen
		ForceFaction: fremen
	RenderSprites:
		Image: conyard.atreides
		-FactionImages:
	UpdatesPlayerStatistics:
		OverrideActor: construction_yard
	Tooltip:
		Name: Fremen Conyard

conyard.corrino:
	Inherits: construction_yard
	Buildable:
		Queue: Building
		BuildDuration: 6000
		BuildDurationModifier: 100
		BuildPaletteOrder: 1005
		Prerequisites: ~merged.corrino
		ForceFaction: corrino
	RenderSprites:
		Image: conyard.harkonnen
		-FactionImages:
	UpdatesPlayerStatistics:
		OverrideActor: construction_yard
	Tooltip:
		Name: Corrino Conyard

conyard.smuggler:
	Inherits: construction_yard
	Buildable:
		Queue: Building
		BuildDuration: 6000
		BuildDurationModifier: 100
		BuildPaletteOrder: 1006
		Prerequisites: ~merged.smuggler
		ForceFaction: smuggler
	RenderSprites:
		Image: conyard.ordos
		-FactionImages:
	UpdatesPlayerStatistics:
		OverrideActor: construction_yard
	Tooltip:
		Name: Smuggler Conyard

conyard.mercenary:
	Inherits: construction_yard
	Buildable:
		Queue: Building
		BuildDuration: 6000
		BuildDurationModifier: 100
		BuildPaletteOrder: 1007
		Prerequisites: ~merged.mercenary
		ForceFaction: mercenary
	RenderSprites:
		Image: conyard.ordos
		-FactionImages:
	UpdatesPlayerStatistics:
		OverrideActor: construction_yard
	Tooltip:
		Name: Mercenary Conyard