^Building:
	InstantlyRepairable:
		Types: Building
	ProductionTimeMultiplier@craneBonus:
		Prerequisites: bonus.crane
		Multiplier: 90
	GrantRandomCondition@randomFX:
		Conditions: explode02, explode03
	Explodes@02:
		Type: CenterPosition
		Weapon: buildingExplosions02
		EmptyWeapon: buildingExplosions02
		Chance: 50
		Offset: 1,0,1
		RequiresCondition: explode02 && !being-demolished
	Explodes@03:
		Type: CenterPosition
		Weapon: buildingExplosions03
		EmptyWeapon: buildingExplosions03
		Chance: 50
		Offset: 1,2,1
		RequiresCondition: (explode02 || explode03) && !being-demolished
	Explodes@sabotuerdemolition:
		RequiresCondition: being-demolished
		Type: CenterPosition
		Weapon: buildingBigExplosion
		EmptyWeapon: buildingBigExplosion
	ThrowsShrapnel:
		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


construction_yard:
	Health:
		HP: 95000
	GrantConditionOnPrerequisite@armor:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	RevealsShroud:
		Range: 5c768
	StoresResources:
		Capacity: 2000
	Power:
		Amount: 25
	ThrowsShrapnel:
		Weapons: Debris, Debris2
		Pieces: 1, 3
		Range: 1c0, 2c0
	ThrowsShrapnel@longer:
		Weapons: Debris, Debris2, Debris3, Debris4
		Pieces: 5, 7
		Range: 3c0, 6c0
	ThrowsShrapnel@longest:
		Weapons: Debris4, DerbisSiegetank
		Pieces: 0, 3
		Range: 6c0, 10c0
	Explodes@02:
		RequiresCondition: explode02
	Explodes@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: 615
		BuildDuration: 50
		Description: Prevents damage from the terrain.
	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: old.upgrade.conyard, ~!global-auto-concrete, !choosefaction
		BuildPaletteOrder: 619
		BuildDuration: 100
		Description: Prevents damage from the terrain.
	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:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	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:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	RevealsShroud:
		Range: 3c768
	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.smuggler
	Power:
		Amount: -50
	GrantConditionOnProduction@ClusterdebrisExplosion:
		Condition: producing
	ThrowsShrapnel@explosiveDerbis:
		Weapons: DeathHandClusterDebris
		Pieces: 0, 1
		Range: 1c0, 2c0
		RequiresCondition: producing
	ProvidesPrerequisite@smugler:
		Prerequisite: barracks.smuggler
		Factions: smuggler
		RequiresPrerequisites: factions.subfaction_allowed
	ProvidesPrerequisite@corrino:
		Prerequisite: barracks.corrino
		Factions: corrino
	ProvidesPrerequisite@mercenary:
		Prerequisite: barracks.mercenary
		Factions: mercenary
	ProvidesPrerequisite@fremen:
		Prerequisite: barracks.fremen
		Factions: fremen
	ProvidesPrerequisite@fremenMerged:
		Prerequisite: barracks.fremen
		RequiresPrerequisites: merged.fremen
		ResetOnOwnerChange: false


refinery:
	PlaceBuildingVariants:
		Actors: refinery_inverted
		Facings: 384, 896
	Buildable:
		BuildDuration: 600
	GrantConditionOnPrerequisite:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	Valued:
		Cost: 1500
	Health:
		HP: 40000
	RevealsShroud:
		Range: 3c768
	StoresResources:
		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
	Explodes@big04:
		Type: CenterPosition
		Weapon: buildingExplosions04_big
		EmptyWeapon: buildingExplosions04_big
		Chance: 100
		Offset: 2,2,1
	ThrowsShrapnel:
		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:
		DockAngle: 128
		DockOffset: 0,1
		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

silo:
	GrantConditionOnPrerequisite@vision:
		Condition: SiloUpgrade
		Prerequisites: upgrade.silo
	Buildable:
		BuildPaletteOrder: 612
		BuildDuration: 200
	Valued:
		Cost: 200
	Health:
		HP: 20000
	GrantConditionOnPrerequisite@armor:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	RevealsShroud@basic:
		Range: 2c512
	RevealsShroud@upg:
		Range: 8c512
		RequiresCondition: SiloUpgrade
	StoresResources:
		Capacity: 2000
	Power:
		Amount: -25
	ThrowsShrapnel:
		Weapons: Debris, Debris2, Debris3, Debris4
		Pieces: 3, 5
		Range: 2c0, 5c0
	ProvidesPrerequisite@silo:

upgrade.silo:
	AlwaysVisible:
	Interactable:
	ScriptTriggers:
	Tooltip:
		Name: Silo Upgrade
	Buildable:
		BuildPaletteOrder: 11
		Prerequisites: silo, ~!choosefaction
		Queue: Upgrade
		BuildLimit: 1
		BuildDuration: 250
		BuildDurationModifier: 100
		Description: Greatly increases vision range of Silo
	Valued:
		Cost: 250
	RenderSprites:
		Image: silo.ordos
		FactionImages:
			atreides: silo.atreides
			fremen: silo.atreides
			harkonnen: silo.harkonnen
			corrino: silo.harkonnen
	ProvidesPrerequisite@upgradename:

light_factory:
	Buildable:
		Prerequisites: refinery
		BuildDuration: 450
	GrantConditionOnPrerequisite:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	Valued:
		Cost: 750
	Health:
		HP: 40000
	RevealsShroud:
		Range: 5c768
	Power:
		Amount: -100
	ThrowsShrapnel:
		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@crawler:
		Prerequisite: light.crawler
		Factions: smuggler
	GrantConditionOnPrerequisite@smugglertech:
		Condition: smugglertech
		Prerequisites: merged.smuggler
	GrantCondition@smuggler:
		Condition: enable_hunter
		GrantPermanently: true
		RequiresCondition: smugglertech
	ProvidesPrerequisite@smuglglertech:
		RequiresCondition: enable_hunter
		Prerequisite: light.hunter
	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: 750
	Valued:
		Cost: 1000
	Health:
		HP: 45000
	RenderSprites:
		Image: heavy.ordos
		FactionImages:
			atreides: heavy.atreides
			fremen: heavy.atreides
			harkonnen: heavy.harkonnen
			corrino: heavy.corrino
			mercenary: heavy.mercenary
	GrantConditionOnPrerequisite:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	RevealsShroud:
		Range: 4c768
	Power:
		Amount: -150
	ProvidesPrerequisite@missile_tank:
		Prerequisite: heavy.missile_tank
		Factions: atreides, fremen, harkonnen, corrino, 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.subfaction_allowed
		Condition: subfaction_mode
	GrantConditionOnProduction@debrisExplosion:
		Condition: producing
	ThrowsShrapnel:
		Weapons: Debris, Debris2, Debris3, Debris4
		Pieces: 10, 20
		Range: 1c0, 5c0
	ThrowsShrapnel@explosiveDerbis:
		Weapons: DeathHandClusterDebris
		Pieces: 0, 1
		Range: 1c0, 3c0
	ThrowsShrapnel@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.\nDetects invisible units at long range\nRequires power to operate
	Valued:
		Cost: 750
	Health:
		HP: 40000
	GrantConditionOnPrerequisite:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	RevealsShroud:
		Range: 9c768
		RequiresCondition: !disabled
	RevealsShroud@lowpower:
		Range: 4c768
		RequiresCondition: disabled
	Power:
		Amount: -125
	ProvidesRadar:
		RequiresCondition: !disabled
	DetectCloaked:
		Range: 4c768
		RequiresCondition: !disabled
	WithRangeCircle:
		Range: 4c768
	ProvidesPrerequisite@mercenary:
		Prerequisite: outpost.mercenary
		Factions: mercenary
		RequiresPrerequisites: factions.merged
	ProvidesPrerequisite@fremen:
		Prerequisite: outpost.fremen
		Factions: fremen
	GrantConditionOnFaction@fremen:
		Condition: fremen
		Factions: fremen
	GrantExternalConditionPower@HIDE_UNITS_ENABLED:
		RequiresCondition: fremen
		OrderName: FremenHideUnits
		Prerequisites: ~upgrade.outpost_fremen, ~!factions.standard
		PauseOnCondition: disabled
		Icon: true_sayer
		LaunchSound: audio/EBoD_MortarUndeploy.wav
		ChargeInterval: 1500
		Name: Desert Stealth
		Description: Makes selected vehicle or group of infantry invisible on sands\nRecommended for use on stationary units
		Duration: -1
		SelectTargetTextNotification: Select target.
		DisplayRadarPing: True
		Condition: hidden
		SupportPowerPaletteOrder: 50
		Dimensions: 1, 1
		Footprint: x
		Sequence: invisible
	GrantConditionOnPrerequisite@frementech:
		Condition: frementech
		Prerequisites: merged.fremen
	GrantCondition@permanentConditionFremen:
		Condition: enable_hideunits
		GrantPermanently: true
		RequiresCondition: frementech
	ProvidesPrerequisite@frementech:
		RequiresCondition: enable_hideunits
		Prerequisite: outpost.fremen
	GrantCondition@enableFremenCondition:
		Condition: fremen
		GrantPermanently: true
		RequiresCondition: enable_hideunits
	ProvidesPrerequisite@mercenarytech:
		Prerequisite: outpost.smuggler
		RequiresPrerequisites: merged.smuggler


starport:
	Buildable:
		BuildDuration: 600
		Prerequisites: heavy_factory, outpost, ~techlevel.high, ~!factions.merged
	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.atreides
			harkonnen: starport.harkonnen
			corrino: starport.harkonnen
			smuggler: starport.smuggler
			mercenary: starport.mercenary
	GrantConditionOnPrerequisite:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	RevealsShroud:
		Range: 3c768
	Tooltip@smuggler:
		Name: Smuggler Starport
		RequiresCondition: smuggler
	Tooltip@mercenary:
		Name: Mercenary Starport
		RequiresCondition: mercenary
	Tooltip:
		RequiresCondition: !smuggler && !mercenary
	Power:
		Amount: -150
	-Explodes@02:
	ExternalCondition@lights:
		Condition: frigate_proximity_influence
	WithIdleOverlay@LIGHTS:
		RequiresCondition: !build-incomplete && frigate_proximity_influence
		Sequence: active
		Palette: starportlights
	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
	Explodes@03:
		Type: CenterPosition
		Weapon: buildingExplosions05
		EmptyWeapon: buildingExplosions05
		Chance: 80
	ProduceActorPower@contractors:
		Name: Hire Contractors
		Description: 5 elite mercenaries with an accurate deployable cannons\n Huge firepower in a small area\nDelivered in Crawler that can transport and heal infantry\n Armed with a laser device that slows down targets
		Icon: mercenary
		RequiresCondition: mercenary
		Prerequisites: upgrade.starport, ~techlevel.superweapons, ~!factions.standard
		Actors: merc_apc
		Type: Starport
		ChargeInterval: 3750
		OrderName: ProduceActorPower.contractors
		SupportPowerPaletteOrder: 250
	GrantConditionOnPrerequisite@merchtech:
		Condition: mercenary
		Prerequisites: merged.mercenary

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: 6

medium_gun_turret:
	Inherits@chaosbomb: ^chaos_bomb_influence
	Inherits@jammer: ^jammedvision
	-AttackWander:
	Buildable:
		Prerequisites: barracks
		BuildDuration: 300
		Description: Defensive structure.\n Strong vs Infantry, Light Vehicles\n Weak vs Tanks, Artillery\nDetects 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
		RequiresCondition: !chaos_bomb
	Armament@chaos_bomb_influence:
		Weapon: 110mm_Gun
		LocalOffset: 512,0,432
		MuzzleSequence: muzzle
		Recoil: 200
		RecoilRecovery: 25
	Power:
		Amount: -50
	DetectCloaked:
		Range: 2c768
	ExternalCondition@jammed:
		Condition: jammed
	RevealsShroudMultiplier@jammed:
		RequiresCondition: jammed
		Modifier: 50
	DetectCloakedMultiplier@jammed:
		RequiresCondition: jammed
		Modifier: 5
	-RevealOnFire:

large_gun_turret:
	Inherits@AUTOTARGET: ^AutoTargetAll
	Inherits@Jammer: ^jammedvision
	Inherits@chaosbomb: ^chaos_bomb_influence
	-AttackWander:
	Buildable:
		Prerequisites: outpost, upgrade.conyard, ~techlevel.medium, ~global-auto-concrete
		BuildDuration: 350
		Description: Defensive structure.\n Strong vs Tanks, Aircraft\n Weak vs Infantry, Artillery\nHoming Missiles\nDetects invisible units\nRequires power to operate
	Valued:
		Cost: 750
	BlocksProjectiles:
		Height: 512
	Health:
		HP: 30000
	Armor:
		Type: wall
	RevealsShroud:
		Range: 5c768
	Armament:
		Weapon: MissleTowerNew
		LocalOffset: 256,384,768, 256,-384,768
		RequiresCondition: !chaos_bomb
	Armament@chaos_bomb_influence:
		Weapon: MissleTowerNew
		LocalOffset: 256,384,768, 256,-384,768
	Turreted:
		TurnSpeed: 28
	Power:
		Amount: -75
	DetectCloaked:
		Range: 2c768
	ExternalCondition@jammed:
		Condition: jammed
	RevealsShroudMultiplier@jammed:
		RequiresCondition: jammed
		Modifier: 50
	DetectCloakedMultiplier@jammed:
		RequiresCondition: jammed
		Modifier: 5
	-RevealOnFire:

old_large_gun_turret:
	Inherits: ^Defense
	Inherits@IDISABLE: ^DisableOnLowPowerOrPowerDown
	Inherits@AUTOTARGET: ^AutoTargetAll
	Inherits@Jammer: ^jammedvision
	Inherits@chaosbomb: ^chaos_bomb_influence
	AttackTurreted:
		PauseOnCondition: disabled || build-incomplete
	-AttackWander:
	Buildable:
		Queue: Building
		Prerequisites: outpost, old.upgrade.conyard, ~techlevel.medium, ~!global-auto-concrete
		BuildPaletteOrder: 609
		BuildDuration: 350
		BuildDurationModifier: 100
		Description: Defensive structure.\n Strong vs Tanks, Aircraft\n Weak vs Infantry, Artillery\nHoming Missiles\nDetects invisible units\nRequires power to operate
	Valued:
		Cost: 750
	Tooltip:
		Name: Rocket Turret
	BlocksProjectiles:
		Height: 512
	RequiresBuildableArea:
		Adjacent: 4
	Selectable:
		Bounds: 1024, 1024
		DecorationBounds: 1024, 1280, 0, -256
	Health:
		HP: 30000
	Armor:
		Type: wall
	RevealsShroud:
		Range: 5c768
	BodyOrientation:
		QuantizedFacings: 32
	Armament:
		Weapon: MissleTowerNew
		LocalOffset: 256,384,768, 256,-384,768
		RequiresCondition: !chaos_bomb
	Armament@chaos_bomb_influence:
		Weapon: MissleTowerNew
		LocalOffset: 256,384,768, 256,-384,768
	Turreted:
		TurnSpeed: 28
		InitialFacing: 512
		RealignDelay: -1
	Power:
		Amount: -75
	DetectCloaked:
		Range: 2c768
	RevealOnDeath:
		Radius: 5c512
	Replacement:
		ReplaceableTypes: Tower
	ExternalCondition@jammed:
		Condition: jammed
	RevealsShroudMultiplier@jammed:
		RequiresCondition: jammed
		Modifier: 50
	DetectCloakedMultiplier@jammed:
		RequiresCondition: jammed
		Modifier: 5
	-RevealOnFire:

repair_pad:
	Buildable:
		Queue: Building
		Prerequisites: heavy_factory, ~techlevel.medium, ~!repair_pad.bot
		BuildDuration: 400
	Valued:
		Cost: 750
	Health:
		HP: 40000
	GrantConditionOnPrerequisite:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	RevealsShroud:
		Range: 3c768
	Capturable:
		RequiresCondition: !build-incomplete
		Types: building
		CancelActivity: true
	Power:
		Amount: -50
	-Explodes@02:
	Explodes@03:
		Type: CenterPosition
		Weapon: buildingExplosions05
		EmptyWeapon: buildingExplosions05
		Chance: 80



repair_pad.bot:
	Inherits: repair_pad
	Buildable:
		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: 600
	Valued:
		Cost: 1250
	Health:
		HP: 45000
	GrantConditionOnPrerequisite:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	RevealsShroud:
		Range: 4c768
	Power:
		Amount: -100
	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@Corrinodropship:
		Condition: harkonnen
		Factions: harkonnen
	ProvidesPrerequisite@enableupgradeStandard_enhancedAir:
		Prerequisite: hightech.enableupgrade
		Factions: atreides, ordos, harkonnen, corrino
	ProvidesPrerequisite@enableupgradeSubfaction:
		Prerequisite: hightech.enableupgrade
		RequiresPrerequisites: ~factions.subfaction_allowed
		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\nEffective against infantry, light vehicles and defensive structures
		UnitType: ornithopter_bomb
		DisplayBeacon: True
		CameraActor: camera
		RequiresCondition: atreides
		CameraRemoveDelay: 75
		ArrowSequence: arrow
		CircleSequence: circles
		UseDirectionalTarget: True
		DirectionArrowAnimation: ornidirection
		SupportPowerPaletteOrder: 430
		EndChargeTextNotification: Airstrike 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, 2048, 0
		Description: 5 Ornithopters with a heavy machine guns hit at the target location\nEffective 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: Airstrike 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: Carryall drops a gas-filled bomb at the target location\nPermanently captures enemy vehicles in a small area
		UnitType: carryall.bomber
		DisplayBeacon: True
		CameraActor: camera
		CameraRemoveDelay: 75
		ArrowSequence: arrow
		CircleSequence: circles
		UseDirectionalTarget: True
		DirectionArrowAnimation: ornidirection
		SupportPowerPaletteOrder: 350
		EndChargeTextNotification: Airstrike ready.
		SelectTargetTextNotification: Select target.
	ParatroopersPower@CORRINO_ENABLED:
		UnitType: carryall.reinforce
		RequiresCondition: corrino
		OrderName: CorrinoDrop
		Prerequisites: ~techlevel.superweapons, upgrade.hightech
		SquadSize: 3
		SquadOffset: -2048, 1024, 0
		Icon: sardaukarFleet
		ChargeInterval: 8250
		Name: Emperor Airdrop
		Description: Carryall squadron drops 15 Sardaukars on target location\nClear space required for safe descent
		DropItems: 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
		CameraActor: camera
		DisplayBeacon: true
		ArrowSequence: arrow
		CircleSequence: circles
		UseDirectionalTarget: True
		DirectionArrowAnimation: ornidirection
		SupportPowerPaletteOrder: 550





research_centre:
	Buildable:
		BuildDuration: 550
		Prerequisites: heavy_factory, outpost, ~techlevel.high
	Valued:
		Cost: 1250
	Health:
		HP: 35000
	GrantConditionOnPrerequisite:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	RevealsShroud:
		Range: 4c768
	Power:
		Amount: -175
	RenderSprites:
		Image: research.ordos
		FactionImages:
			atreides: research.atreides
			fremen: research.atreides
			harkonnen: research.harkonnen
			corrino: research.harkonnen
			smuggler: research.smuggler
	ProvidesPrerequisite@shutup:
		Prerequisite: research_centre.smuggler
		Factions: smuggler
	GrantConditionOnFaction@jammereds:
		Condition: smuggler
		Factions: smuggler
	SpawnActorPower@SmugglerTrueSayer:
		EffectImage: frigate.harkonnen
		EffectSequence:
		Actor: dummy.true_sayer
		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: Spy Comms
		Description: Shows the marked area and detects invisible units
		SupportPowerPaletteOrder: 400
		DisplayBeacon: True
		OrderName: SmugglerJammer
		DisplayRadarPing: true

palace:
	Inherits: ^Building
	Inherits@PRIMARY: ^PrimaryBuilding
	Inherits@IDISABLE: ^DisableOnLowPowerOrPowerDown
	Buildable:
		Prerequisites: research_centre, ~techlevel.high, ~!factions.subfaction_allowed
		Queue: Building
		BuildPaletteOrder: 620
		BuildDuration: 900
		BuildDurationModifier: 100
		Description: Unlocks elite infantry and weapons.\nRequires 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:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	RevealsShroud:
		Range: 4c768
	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\nDestroy 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
		MissileImage: deathhand
	-ProduceActorPower@fremen:
	ProduceActorPower@fremen_standart:
		Name: Noble Fremens
		Description: Invisible warriors of Dune loyal to the Duke\nArmed with anti-vehicle sound weapon\nRegenerates to full health
		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
	ProduceActorPower@saboteur_standart:
		Name: Hidden Saboteur
		Description: Stealth infantry armed with explosives\nCan explode buildings or a huge area around himself
		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
	-ProduceActorPower@saboteur:
	AirstrikePower@chaosbombMerged:
		Icon: gascloud
		Name: Gas Bomb
		ChargeInterval: 5250
		SquadSize: 1
		StartFullyCharged: false
		PauseOnCondition: disabled
		Prerequisites: ~techlevel.high, ~palace.saboteur, ~factions.merged
		Description: Carryall drops a gas-filled bomb at the target location\nPermanently captures enemy vehicles in a small area
		UnitType: carryall.bomber
		DisplayBeacon: True
		CameraActor: camera
		CameraRemoveDelay: 75
		ArrowSequence: arrow
		UseDirectionalTarget: True
		DirectionArrowAnimation: airstrike_direction
		CircleSequence: circles
		SupportPowerPaletteOrder: 350
		OrderName: Orderproduction.chaosbombmerged
	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
	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@armor:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	RevealsShroud:
		Range: 4c768
	Power:
		Amount: -200
	Buildable:
		Prerequisites: research_centre, ~techlevel.high, ~factions.subfaction_allowed, ~conyard.harkonnen
		Queue: Building
		BuildPaletteOrder: 620
		BuildDuration: 900
		BuildDurationModifier: 100
		Description: Unlocks elite infantry and weapons.\nRequires 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\nDestroy almost everything at the target location
		BeginChargeSpeechNotification: DeathHandMissilePrepping
		EndChargeSpeechNotification: DeathHandMissileReady
		IncomingSpeechNotification: MissileLaunchDetected
		DisplayBeacon: True
		DisplayRadarPing: True
		CameraRange: 7c0
		ArrowSequence: arrow
		SupportPowerPaletteOrder: 500
		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.subfaction_allowed, ~conyard.atreides
		Queue: Building
		BuildPaletteOrder: 620
		BuildDuration: 900
		BuildDurationModifier: 100
		Description: Unlocks elite infantry and weapons.\nRequires 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:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	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
	ProduceActorPower@Fremen_Enabled:
		Name: Noble Fremens
		Description: Invisible warriors of Dune loyal to the Duke\nArmed with anti-vehicle sound weapon\nRegenerates to full health
		Actors: fremen, fremen, fremen, fremen, fremen
		Type: Fremen
		ChargeInterval: 3000
		Icon: fremen
		PauseOnCondition: disabled
		Prerequisites: ~techlevel.superweapons, ~factions.subfaction_allowed
		OrderName: ProduceActorPower.Fremen_Standart
		SupportPowerPaletteOrder: 200
	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.subfaction_allowed, ~conyard.ordos
		Queue: Building
		BuildPaletteOrder: 620
		BuildDuration: 900
		BuildDurationModifier: 100
		Description: Unlocks elite infantry and weapons.\nRequires 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@armor:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	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
	WithBuildingBib:
		HasMinibib: True
	Power:
		Amount: -200
	SupportPowerChargeBar:
	Production:
		Produces: Building, Elite
	ProduceActorPower@Saboteur_Enabled:
		Name: Hidden Saboteur
		Description: Stealth infantry, armed with explosives\nCan explode buildings or a huge area around himself
		Actors: saboteur
		Type: Saboteur
		ChargeInterval: 2250
		Icon: saboteur
		PauseOnCondition: disabled
		Prerequisites: ~techlevel.superweapons, ~factions.subfaction_allowed
		OrderName: ProduceActorPower.Saboteur
		SupportPowerPaletteOrder: 150
	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.subfaction_allowed
		Queue: Building
		BuildPaletteOrder: 630
		BuildDuration: 1250
		BuildDurationModifier: 100
		Description: Unlocks Target Designator.\nHas built-in Bombardment weapons\n Modest vs Everything\nRequires 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@armor:
		Condition: ArmorUpgrade
		Prerequisites: upgrade.conyard
	GrantConditionOnPrerequisite@concreteON:
		Condition: concrete_on
		Prerequisites: global-auto-concrete
	Armor:
		Type: building
		RequiresCondition: ArmorUpgrade || !concrete_on
	Armor@weakArmor:
		Type: buildingWeak
		RequiresCondition: !ArmorUpgrade && concrete_on
	RevealsShroud:
		Range: 4c768
	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\nTargets near the laser marked point take double damage
		Actors: officer
		Type: Designator
		ChargeInterval: 1500
		Icon: officer
		PauseOnCondition: disabled
		Prerequisites: ~techlevel.superweapons, ~factions.subfaction_allowed
		OrderName: ProduceActorPower.fremen_enabled
		SupportPowerPaletteOrder: 100
	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: 1250
		BuildDurationModifier: 100
		Prerequisites: research_centre, ~techlevel.high, ~conyard.fremen, ~factions.subfaction_allowed
		Description: Unlocks Worm Rider
	SpawnActorsOnSell:
		ActorTypes: light_inf
	Valued:
		Cost: 2500
	RevealsShroud:
		Range: 4c768
	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: Fremen
	ProduceActorPower@wormrider:
		Name: Worm Rider
 		Description: Attracts the worm and saddles it for a couple of minutes\nNeeds to be deployed on the sand, invisible until this time
		Icon: sandworm
 		Prerequisites: ~techlevel.high
		Actors: worm_rider
		Type: Fremen
		ChargeInterval: 8250
		OrderName: ProduceActorPower.Rider
		SupportPowerPaletteOrder: 600

upgrade.conyard:
	Buildable:
		BuildPaletteOrder: 10
		BuildDuration: 1500
		Prerequisites: ~construction_yard, ~!choosefaction, ~global-auto-concrete
		Description: Improves building armor\nUnlocks Rocket Turret
	Valued:
		Cost: 1500

old.upgrade.conyard:
	AlwaysVisible:
	Interactable:
	ScriptTriggers:
	Tooltip:
		Name: Construction Yard Upgrade
	Buildable:
		Queue: Upgrade
		BuildLimit: 1
		BuildPaletteOrder: 9
		BuildDuration: 1500
		BuildDurationModifier: 100
		Prerequisites: ~construction_yard, ~!choosefaction, ~!global-auto-concrete
		Description: Unlocks Large Concrete Slab\nUnlocks Rocket Turret
	Valued:
		Cost: 1500
	RenderSprites:
		Image: conyard.ordos
		FactionImages:
			atreides: conyard.atreides
			fremen: conyard.atreides
			harkonnen: conyard.harkonnen
			corrino: conyard.harkonnen
	ProvidesPrerequisite@upgradename:

upgrade.barracks:
	Buildable:
		Prerequisites: barracks, ~!choosefaction
		BuildDuration: 500
		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.smuggler

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

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

upgrade.outpost_fremen:
	AlwaysVisible:
	Interactable:
	ScriptTriggers:
	Tooltip:
		Name: Fremen Outpost Upgrade
	Buildable:
		BuildPaletteOrder: 50
		Prerequisites: ~!choosefaction, ~outpost.fremen, ~!factions.standard, ~techlevel.superweapons
		Queue: Upgrade
		BuildLimit: 1
		BuildDuration: 750
		BuildDurationModifier: 100
		Description: Unlocks Desert Stealth
	Valued:
		Cost: 750
	RenderSprites:
		Image: outpost.atreides
	ProvidesPrerequisite@upgradename:

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

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

merged_upgrade.starport:
	Inherits: upgrade.starport
	RenderSprites:
		Image: starport.mercenary
	Buildable:
		Prerequisites: ~starport, ~!choosefaction, ~merged.mercenary,~factions.merged, merged.mercenary_factory, ~techlevel.superweapons
	ProvidesPrerequisite@enablecontractors:
		Prerequisite: upgrade.starport

upgrade.hightech:
	Buildable:
		Prerequisites: ~!choosefaction, ~hightech.enableupgrade, ~techlevel.superweapons
		BuildDuration: 1250
		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

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

merged.fremen_sietch:
	Inherits: fremen_sietch
	Buildable:
		Prerequisites: research_centre, ~merged.fremen, ~techlevel.high, ~factions.merged
	RenderSprites:
		Image: fremen_sietch
	ProvidesPrerequisite@name:
	ProvidesPrerequisite@frementech:
		Prerequisite: merged.fremen

merged.corrino_palace:
	Inherits: palace.corrino
	Buildable:
		Prerequisites: research_centre, ~merged.corrino, ~techlevel.high,  ~factions.merged
	RenderSprites:
		Image: palace.corrino
	ProvidesPrerequisite@name:
	Production:
		Produces: palace_corinno
	RallyPoint:
	ProvidesPrerequisite@corrinotech:
		Prerequisite: merged.corrino
	SpawnActorPower@CorrinoTrueSayer:
		EffectImage: frigate.harkonnen
		EffectSequence:
		Actor: dummy.true_sayer
		Icon: true_sayer
		Prerequisites: ~techlevel.superweapons, factions.merged
		ChargeInterval: 3900
		LifeTime: 500
		StartFullyCharged: false
		DeploySound: audio/true_sayer.wav
		LaunchSound: audio/true_sayer.wav
		Name: Emperor's True Sayer
		Description: Reveal target Area
		SupportPowerPaletteOrder: 25
		DisplayBeacon: True
		OrderName: corrino.true_sayer
		DisplayRadarPing: true

merged.starport:
	Inherits: starport
	Buildable:
		Prerequisites: heavy_factory, outpost, ~techlevel.high, ~factions.merged, ~!merged.smuggler
	RenderSprites:
		Image: starport.ordos
		FactionImages:
			atreides: starport.atreides
			fremen: starport.atreides
			harkonnen: starport.harkonnen
			corrino: starport.harkonnen
			smuggler: starport.smuggler
			mercenary: starport.mercenary
	ProvidesPrerequisite@justincase:
		Prerequisite: starport


merged.starport_smuggler:
	Inherits: starport
	Buildable:
		Prerequisites: heavy_factory, outpost, ~techlevel.high, ~factions.merged, ~merged.smuggler
	RenderSprites:
		Image: starport.smuggler
		FactionImages:
			atreides: starport.smuggler
			fremen: starport.smuggler
			harkonnen: starport.smuggler
			corrino: starport.smuggler
			smuggler: starport.smuggler
			mercenary: starport.smuggler
	Tooltip:
		Name: Smugglers Starport
	ProvidesPrerequisite@smugglerstarportmerged:
		Prerequisite: starport.smuggler
	ProvidesPrerequisite@default:
		Prerequisite: starport
	ProvidesPrerequisite@smugllertech:
		Prerequisite: merged.smuggler



merged.mercenary_factory:
	Inherits: heavy_factory
	Buildable:
		BuildDuration: 750
		Prerequisites: refinery, ~merged.mercenary
		Queue: Building
		BuildPaletteOrder: 630
		BuildDurationModifier: 100
		Description: Produces mercenary vehicles
	Tooltip:
		Name: Mercenary Heavy factory
	RenderSprites:
		Image: heavy.mercenary
		FactionImages:
			atreides: heavy.mercenary
			fremen: heavy.mercenary
			harkonnen: heavy.mercenary
			corrino: heavy.mercenary
			mercenary: heavy.mercenary
	ProvidesPrerequisite@actorsname:
	ProvidesPrerequisite@mercenarytech:
		Prerequisite: merged.mercenary
	ProvidesPrerequisite@buildingname:
		Prerequisite: heavy_factory
