^NeutralBuilding:
	Inherits@1: ^ExistsInWorld
	Inherits@2: ^SpriteActor
	Huntable:
	Interactable:
	HitShape:
		UseTargetableCellsOffsets: true
		Type: Rectangle
			TopLeft: -384, -384
			BottomRight: 384, 384
	Building:
		Dimensions: 1,1
		Footprint: x
		TerrainTypes: Rock, Concrete, Sand
		BuildSounds: BUILD1.WAV
	Health:
		HP: 20000
	Armor:
		Type: building
	Tooltip:
		Name: Neutral Building
		GenericVisibility: None
	FrozenUnderFog:
	MapEditorData:
		Categories: Neutral building
	Targetable:
		TargetTypes: Ground, Structure
		RequiresForceFire: true
	FireWarheadsOnDeath:
		Type: Footprint
		Weapon: BuildingExplode
		EmptyWeapon: BuildingExplode
	WithSpriteBody:
	FireProjectilesOnDeath@1:
		Weapons: derbisRock01, derbisRock02, derbisRock03
		Pieces: 0, 2
		Range: 1c0, 4c0
	FireProjectilesOnDeath@2:
		Weapons: derbisRock01, derbisRock02, derbisRock03
		Pieces: 1, 4
		Range: 0c512, 2c0
	FireProjectilesOnDeath:
		Weapons: Debris, Debris2, Debris3, Debris4
		Pieces: 1, 3
		Range: 1c256, 3c0
	ExternalCondition@vulnerable:
		Condition: vulnerable
	DamageMultiplier@vulnerable:
		Modifier: 125
		RequiresCondition: vulnerable
	WithColoredOverlay@vulnerable:
		Color: FF2C2C7D
		RequiresCondition: vulnerable
	RevealOnDeath:
		Duration: 25
		Radius: 3c768

^DecorationBuildings:
	Inherits@1: ^NeutralBuilding
	MapEditorData:
		Categories: Buildings decorations

^NeutralBuildingCapturable:
	Inherits@jammer: ^jammedvision
	Inherits@1: ^ExistsInWorld
	Inherits@2: ^SpriteActor
	Inherits@selection: ^SelectableBuilding
	FrozenUnderFog:
	WithSpriteBody:
	Huntable:
	HitShape:
		UseTargetableCellsOffsets: true
		Type: Rectangle
			TopLeft: -896, -896
			BottomRight: 896, 896
	D2kBuilding:
		Dimensions: 2,2
		Footprint: xx xx
		TerrainTypes: Rock, Concrete
		BuildSounds: BUILD1.WAV
	Health:
		HP: 20000
	Armor:
		Type: building
	MapEditorData:
		Categories: Neutral building capturable
	Targetable:
		TargetTypes: Ground, C4, Structure
		RequiresForceFire: false
	GrantConditionOnPrerequisite@vision:
		Condition: VisionUpgrade
		Prerequisites: upgrade.outpost, outpost
	GrantConditionOnPowerState@BigVis:
		Condition: BiggerVision
		ValidPowerStates: Normal
		RequiresCondition: VisionUpgrade
	CaptureManager:
	RevealsShroud:
		Range: 3c768
	RevealsShroud@BigVis:
		Range: 7c768
		RequiresCondition: BiggerVision
	Capturable:
		Types: building
	InstantlyRepairable:
	RepairableBuilding:
		RepairStep: 500
		PlayerExperience: 5
		RepairingNotification: Repairing
	Demolishable:
	RevealOnDeath:
		Duration: 100
		Radius: 4c768
	WithBuildingRepairDecoration:
		Image: allyrepair
		Sequence: repair
		Position: Center
		Palette: player
		IsPlayerPalette: True
	OwnerLostAction:
		Action: ChangeOwner
	FireProjectilesOnDeath:
		Weapons: Debris, Debris2, Debris3, Debris4
		Pieces: 2, 5
		Range: 1c512, 4c0
	FireWarheadsOnDeath:
		Type: Footprint
		Weapon: BuildingExplode
		EmptyWeapon: BuildingExplode
	SoundOnDamageTransition:
		DamagedSounds: EXPLSML1.WAV
		DestroyedSounds: EXPLHG1.WAV
	Demolishable:
		Condition: being-demolished
	FireWarheadsOnDeath@sabotuerdemolition:
		RequiresCondition: being-demolished
		Type: CenterPosition
		Weapon: SaboteurSmallExplosion
		EmptyWeapon: SaboteurSmallExplosion
	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
	ExternalCondition@vulnerable:
		Condition: vulnerable
	DamageMultiplier@vulnerable:
		Modifier: 125
		RequiresCondition: vulnerable
	WithColoredOverlay@vulnerable:
		Color: FF2C2C7D
		RequiresCondition: vulnerable
	RevealOnDeath:
		Duration: 25
		Radius: 3c768
	GrantConditionOnPrerequisite@CraneBonus:
		Condition: BonusCrane
		Prerequisites: bonus.crane
	ChangesHealth@CraneBonus:
		Step: 200
		Delay: 25
		StartIfBelow: 100
		RequiresCondition: BonusCrane && enabled
	GrantConditionOnCombatantOwner:
		Condition: enabled
	WithDecoration@jammed:
		ValidRelationships: Enemy, Neutral
		Palette: d2k

^InfantryHealing:
	ExternalCondition@carrierhealing:
		Condition: carrierhealing
	ExternalCondition@healing:
		Condition: healing
	WithDecoration@REDCROSS:
		Image: pips
		Sequence: healt_cross
		Position: BottomLeft
		Margin: 3, 6
		RequiresCondition: healing && damaged
		BlinkInterval: 25
		BlinkPattern: Off, On
		ValidRelationships: Ally
	ChangesHealth@HEALING:
		Step: 0
		PercentageStep: 2
		Delay: 25
		StartIfBelow: 100
		DamageCooldown: 0
		RequiresCondition: healing 
	ChangesHealth@CARRIER:
		Step: 8000
		Delay: 5
		StartIfBelow: 100
		DamageCooldown: 0
		RequiresCondition: carrierhealing
	GrantConditionOnDamageState@HOSPITAL:
		Condition: damaged
		ValidDamageStates: Light, Medium, Heavy, Critical
	GrantConditionOnPrerequisite@HOSPITAL:
		Condition: hospitalheal
		Prerequisites: hospitalHealing
	ChangesHealth@HOSPITAL:
		Step: 0
		PercentageStep: 1
		Delay: 25
		StartIfBelow: 100
		DamageCooldown: 250
		RequiresCondition: hospitalheal

ecology_station:
	Inherits: ^NeutralBuildingCapturable
	Inherits@selection: ^SelectableBuilding
	Armor:
		Type: building
	Health:
		HP: 100000
	WithBuildingBib:
	D2kBuilding:
		Dimensions: 4,3
		Footprint: _xx_ XxxX =xx=
	HitShape:
		UseTargetableCellsOffsets: true
		TargetableOffsets: 0,-1280,0, 0,1280,0
		Type: Rectangle
			TopLeft: -1664, -384
			BottomRight: 1664, 384
	HitShape@TOP:
		Type: Rectangle
			TopLeft: -896, -1408
			BottomRight: 896, -384
	HitShape@BOTTOM:
		Type: Rectangle
			TopLeft: -896, 384
			BottomRight: 896, 1408
	FloatingSpriteEmitter@smoke_huge_atreides:
		RequiresCondition: well.damaged
		Image: smoke3
		Lifetime: 18, 22
		Speed: 4
		Gravity: 60
		Offset: 0, -500, 0
		SpawnFrequency: 3, 10
		RandomFacing: true
		RandomRate: 4
		TurnRate: 3
		Duration: 1000
	SpawnActorOnDeath@bigcrater:
		Actor: crater_big
		Offset: 1,1
	ProximityExternalCondition@dhealing:
		Condition: healing
		Range: 4c512
		ValidRelationships: Ally, Neutral, Enemy
	ProvidesPrerequisite@heal:
		Prerequisite: hospitalHealing
	Tooltip:
		Name: Hospital
	TooltipDescription@adf:
		Description: Continuously heals nearby infantry. When captured, heals all own infantry after damage.
	RevealsShroud:
		Range: 4c768
	RevealsShroud@BigVis:
		Range: 8c768
		RequiresCondition: BiggerVision
	WithRangeCircle@Hospital:
		Range: 4c512
		Color:	FF0000
		BorderColor: 00000060
		ValidRelationships: Ally, Neutral, Enemy
	GrantConditionOnPrerequisite@RadarStationBonus:
		Condition: BonusRadarStation
		Prerequisites: bonus.radar.station
	DetectCloaked@RadarStationBonus:
		Range: 3c512
		RequiresCondition: !jammed && BonusRadarStation
	WithRangeCircle@RadarStationBonus:
		Range: 3c512
		RequiresCondition: !jammed && BonusRadarStation
	GrantConditionOnDamageState@welldamaged:
		Condition: well.damaged
		ValidDamageStates: Heavy, Critical
	WithColoredOverlay@welldamaged:
		Color: 766F5F42
		RequiresCondition: well.damaged

radar_station:
	Inherits: ^NeutralBuildingCapturable
	Tooltip:
		Name: Radar Station
	TooltipDescription:
		Description: Provides invisibility detection for buildings. Provides buildable area and a battlefield radar map.
	ProvidesPrerequisite:
		Prerequisite: bonus.radar.station
	WithBuildingBib:
	HitShape:
		Type: Rectangle
			TopLeft: -1408, -896
			BottomRight: 1408, 896
	Health:
		HP: 80000
	D2kBuilding:
		Dimensions: 3,2
		Footprint: xxx xxx
	FloatingSpriteEmitter@smoke_huge_atreides:
		RequiresCondition: well.damaged
		Image: smoke3
		Lifetime: 18, 22
		Speed: 4
		Gravity: 60
		Offset: 0, -500, 0
		SpawnFrequency: 3, 10
		RandomFacing: true
		RandomRate: 4
		TurnRate: 3
		Duration: 1000
	WithIdleOverlay@DISH:
		Sequence: idle-dish
	FireWarheadsOnDeath:
		Type: Footprint
		Weapon: BuildingExplode
		EmptyWeapon: BuildingExplode
	GivesBuildableArea:
		AreaTypes: building
	RevealsShroud:
		Range: 4c768
	RevealsShroud@BigVis:
		Range: 8c768
		RequiresCondition: BiggerVision
	DetectCloaked:
		Range: 3c512
		RequiresCondition: !jammed
	WithRangeCircle:
		Range: 3c512
		RequiresCondition: !jammed
	ProvidesRadar:
	GrantConditionOnDamageState@welldamaged:
		Condition: well.damaged
		ValidDamageStates: Heavy, Critical
	WithColoredOverlay@welldamaged:
		Color: 766F5F42
		RequiresCondition: well.damaged

defensive_post:
	Inherits: ^NeutralBuildingCapturable
	Tooltip:
		Name: Defensive Post
	TooltipDescription:
		Description: Increases turret attack, vision, and invisibility detection range. Detects invisible units.
	ProvidesPrerequisite:
		Prerequisite: bonus.defensive.post
	WithBuildingBib:
	FloatingSpriteEmitter@SMOKE:
		RequiresCondition: well.damaged
		Image: smoke3
		Lifetime: 16, 20
		Speed: 3
		Gravity: 50
		Offset: 0, 0, 600
		SpawnFrequency: 5, 15
		RandomFacing: true
		RandomRate: 4
		TurnRate: 3
		Duration: 500
	Health:
		HP: 60000
	RenderSprites:
		Image: defensive_post
	WithIdleOverlay@DISH:
		Sequence: idle-top
	FireWarheadsOnDeath:
		Type: Footprint
		Weapon: BuildingExplode
		EmptyWeapon: BuildingExplode
	RevealsShroud:
		Range: 4c768
	RevealsShroud@BigVis:
		Range: 8c768
		RequiresCondition: BiggerVision
	DetectCloaked:
		Range: 3c512
	WithRangeCircle:
		Range: 3c512
		RequiresCondition: !jammed
	GrantConditionOnDamageState@welldamaged:
		Condition: well.damaged
		ValidDamageStates: Heavy, Critical
	WithColoredOverlay@welldamaged:
		Color: 766F5F42
		RequiresCondition: well.damaged

crane:
	Inherits: ^NeutralBuildingCapturable
	Tooltip:
		Name: Crane
	TooltipDescription:
		Description: Reduces building production costs. Provides slow passive repair to buildings.
	ProvidesPrerequisite:
		Prerequisite: bonus.crane
	WithBuildingBib:
	Health:
		HP: 60000
	Armor:
		Type: building
	RenderSprites:
		Image: crane
	WithIdleOverlay@ZAPS:
		Sequence: idle-zaps
	WithIdleOverlay@LIGHTS:
		Sequence: idle-lights
	GrantConditionOnPrerequisite@RadarStationBonus:
		Condition: BonusRadarStation
		Prerequisites: bonus.radar.station
	DetectCloaked@RadarStationBonus:
		Range: 3c512
		RequiresCondition: !jammed && BonusRadarStation
	WithRangeCircle@RadarStationBonus:
		Range: 3c512
		RequiresCondition: !jammed && BonusRadarStation

spice_sifter:
	Inherits: ^NeutralBuildingCapturable
	Inherits@IDISABLE: ^DisableOnLowPower
	Tooltip:
		Name: Spice Sifter
	TooltipDescription:
		Description: Provides fast passive income. Requires power and no damage to operate.
	Power:
		Amount: 0
	Health:
		HP: 60000
	Armor:
		Type: building
	WithBuildingBib:
	CashTrickler:
		Interval: 75
		Amount: 25
		PauseOnCondition: lowpower || disabled
		UseResourceStorage: True
		RequiresCondition: enabled
	CashTricklerMultiplier:
		Modifier: 0
		RequiresCondition: damaged
	WithIdleOverlay:
		RequiresCondition: !damaged && enabled
		PauseOnCondition: disabled
	GrantConditionOnDamageState@DAMAGED:
		Condition: damaged
		ValidDamageStates: Heavy, Critical
	FireWarheadsOnDeath:
		Type: Footprint
		Weapon: BuildingExplode
		EmptyWeapon: BuildingExplode
	FireProjectilesOnDeath@spice:
		Weapons: HarvesterSpiceExplosion
		Pieces: 1, 5
		Range: 5c0, 10c0
	GrantConditionOnPrerequisite@RadarStationBonus:
		Condition: BonusRadarStation
		Prerequisites: bonus.radar.station
	DetectCloaked@RadarStationBonus:
		Range: 3c512
		RequiresCondition: !disabled && !jammed && BonusRadarStation
	WithRangeCircle@RadarStationBonus:
		Range: 3c512
		RequiresCondition: !disabled && !jammed && BonusRadarStation
	-WithColoredOverlay@IDISABLE:

mining_rig:
	Inherits: ^NeutralBuildingCapturable
	Tooltip:
		Name: Mining Rig
	TooltipDescription:
		Description: Provides passive income. Can by rebuild when destroyed.
	Health:
		HP: 20000
	CashTrickler:
		Interval: 75
		Amount: 10
		UseResourceStorage: True
		RequiresCondition: enabled
	WithIdleOverlay:
		RequiresCondition: enabled
	FireWarheadsOnDeath:
		Type: Footprint
		Weapon: BuildingExplode
		EmptyWeapon: BuildingExplode
	FireProjectilesOnDeath@spice:
		Weapons: HarvesterSpiceExplosion
		Pieces: 1, 3
		Range: 1c0, 3c0
	HitShape:
		UseTargetableCellsOffsets: true
		Type: Rectangle
			TopLeft: -384, -384
			BottomRight: 384, 384
	-D2kBuilding:
	Building:
		Dimensions: 1,1
		Footprint: x
	FloatingSpriteEmitter@SMOKE:
		RequiresCondition: well.damaged
		Image: smoke3
		Lifetime: 16, 20
		Speed: 3
		Gravity: 50
		Offset: 0, 0, 600
		SpawnFrequency: 5, 15
		RandomFacing: true
		RandomRate: 4
		TurnRate: 3
		Duration: 500
	SpawnActorOnDeath:
		Actor: mining_rig.husk
		OwnerType: InternalName
	SpawnActorOnDeath@bigcrater:
		Offset: -1,0
	GrantConditionOnPrerequisite@RadarStationBonus:
		Condition: BonusRadarStation
		Prerequisites: bonus.radar.station
	DetectCloaked@RadarStationBonus:
		Range: 3c512
		RequiresCondition: !jammed && BonusRadarStation
	WithRangeCircle@RadarStationBonus:
		Range: 3c512
		RequiresCondition: !jammed && BonusRadarStation
	GrantConditionOnDamageState@welldamaged:
		Condition: well.damaged
		ValidDamageStates: Heavy, Critical
	WithColoredOverlay@welldamaged:
		Color: 60587642
		RequiresCondition: well.damaged

mining_rig.husk:
	Inherits: ^NeutralBuildingCapturable
	HitShape:
		UseTargetableCellsOffsets: false
		Type: Rectangle
			TopLeft: -4, -4
			BottomRight: 4, 4
	-D2kBuilding:
	Tooltip:
		Name: Mining Rig (Destroyed)
	TooltipDescription:
		Description: Provides passive income. Can be repaired by engineer.
	HitShape:
		UseTargetableCellsOffsets: true
		Type: Rectangle
			TopLeft: -4, -4
			BottomRight: 4, 4
	Building:
		Dimensions: 1,1
		Footprint: x
	TransformOnCapture:
		IntoActor: mining_rig
	FloatingSpriteEmitter@SMOKE:
		Image: smoke3
		Lifetime: 15, 20
		Speed: 3
		Gravity: 50
		SpawnFrequency: 5, 10
		RandomFacing: true
		RandomRate: 4
		Offset: 0, 0, 200
		TurnRate: 3
		Duration: 500
	-Demolishable:
	-FireWarheadsOnDeath@sabotuerdemolition:
	-FireProjectilesOnDeath:
	-SpawnActorOnDeath@bigcrater:
	-AmbientSound@saboteurCharge:
	Health:
		HP: 1
	DamageMultiplier@IMMORTAL:
		Modifier: 0

building01:
	Inherits: ^DecorationBuildings
	RenderSprites:
		Palette: terrain
	Tooltip:
		Name: House
		GenericVisibility: None
	Crushable:
		CrushClasses: wall
	FireWarheadsOnDeath:
		Weapon: WallExplode
		EmptyWeapon: WallExplode

building01_burned:
	Inherits: ^BuildingHusk
	Building:
		Dimensions: 1,1
		Footprint: _
	-GrantRandomCondition:
	-WithBuildingBib:

building02:
	Inherits: ^DecorationBuildings
	Tooltip:
		Name: Garden
		GenericVisibility: None
	Building:
		Dimensions: 2,1
		Footprint: xx
	HitShape:
		UseTargetableCellsOffsets: true
		Type: Rectangle
			TopLeft: -640, -384
			BottomRight: 640, 384
	FireWarheadsOnDeath:
		Weapon: WallExplode
		EmptyWeapon: WallExplode

tree01:
	Inherits: ^DecorationBuildings
	RenderSprites:
		Palette: tree01
	Tooltip:
		Name: Palm
		GenericVisibility: None
	Health:
		HP: 10000
	Armor:
		Type: wood
	Crushable:
		CrushClasses: wall
	-FireWarheadsOnDeath:
	-FireProjectilesOnDeath@1:
	-FireProjectilesOnDeath@2:
	-FireProjectilesOnDeath:

tree02:
	Inherits: tree01
	RenderSprites:
		Palette: tree01
	Tooltip:
		Name: Small Palm
		GenericVisibility: None
	Health:
		HP: 5000
	Crushable:
		CrushClasses: infantry
		WarnProbability: 0

fremen_tent:
	Inherits: ^DecorationBuildings
	RenderSprites:
		Palette: terrain
	Tooltip:
		Name: Fremen Tent
		GenericVisibility: None
	FireWarheadsOnDeath:
		Weapon: WallExplode
		EmptyWeapon: WallExplode

fremen_temple:
	Inherits: ^DecorationBuildings
	RenderSprites:
		Palette: terrain
	Building:
		Dimensions: 4,2
		Footprint: xxxx xxxx
	Tooltip:
		Name: Fremen Temple
		GenericVisibility: None
	HitShape:
		UseTargetableCellsOffsets: true
		Type: Rectangle
			TopLeft: -1536, -512
			BottomRight: 1536, 512
	Health:
		HP: 40000
	Armor:
		Type: wall
	FireWarheadsOnDeath:
		Type: CenterPosition
		Weapon: cliffExplode01
		EmptyWeapon: cliffExplode01

fremen_cave:
	Inherits: ^DecorationBuildings
	RenderSprites:
		Palette: terrain
	Building:
		Dimensions: 3,3
		Footprint: xxx xxx xxx
	Tooltip:
		Name: Fremen Cave
		GenericVisibility: None
	HitShape:
		Type: Rectangle
			TopLeft: -1012, -1012
			BottomRight: 1012, 1012
	WithSpriteBody:
		Palette: d2k
	WithIdleOverlay@TOP:
		Sequence: idle-top
		Palette: d2k
	Health:
		HP: 60000
	SpawnActorOnDeath:
		Actor: fremen_cave.husk
		OwnerType: InternalName

fremen_cave.husk:
	Inherits: fremen_cave
	RenderSprites:
		Palette: terrain
	Building:
		Dimensions: 3,3
		Footprint: xxx xxx xxx
	Tooltip:
		Name: Destroyed Cave
		GenericVisibility: None
	HitShape:
		Type: Rectangle
			TopLeft: -4, -4
			BottomRight: 4, 4
	-Huntable:
	-Targetable:
	Health:
		HP: 1
	DamageMultiplier@IMMORTAL:
		Modifier: 0

custom_rock01_buildings:
	Inherits: ^DecorationBuildings
	RenderSprites:
		Palette: terrain
	Building:
		Dimensions: 4,4
		Footprint: _XX_ XxxX XxxX xxxx
	Tooltip:
		Name: Mountain Settlement
		GenericVisibility: None
	HitShape:
		Type: Rectangle
			TopLeft: -4, -4
			BottomRight: 4, 4
	-Huntable:
	-Targetable:
	Health:
		HP: 1
	DamageMultiplier@IMMORTAL:
		Modifier: 0

custom_rock02_ecology_station:
	Inherits: ^DecorationBuildings
	RenderSprites:
		Palette: terrain
	Building:
		Dimensions: 4,4
		Footprint: _XX_ xxxX xxxX XxxX
	Tooltip:
		Name: Mountain Laboratory
		GenericVisibility: None
	WithColoredOverlay@welldamaged:
		Color: 7D7C7112
	HitShape:
		Type: Rectangle
			TopLeft: -4, -4
			BottomRight: 4, 4
	-Huntable:
	-Targetable:
	Health:
		HP: 1
	DamageMultiplier@IMMORTAL:
		Modifier: 0
