# Attach France's Fake Medium Tank support power to their helipad.
HPAD:
	ParatroopersPower@decoyarmy:
		OrderName: DecoyArmy
		Prerequisites: aircraft.france
		Icon: fake-icon
		ChargeInterval: 7500
		Description: Decoy Army
		LongDesc: A Badger drops a squad of fake Medium Tanks\nanywhere on the map.
		DropItems: 2TNF,2TNF,2TNF,2TNF,2TNF
		ReinforcementsArrivedSpeechNotification: ReinforcementsArrived
		SelectTargetSpeechNotification: SelectTarget
		AllowImpassableCells: false
		QuantizedFacings: 8
		CameraActor: camera.paradrop
		DisplayBeacon: true
		BeaconPoster: pinficon
		ArrowSequence: arrow
		ClockSequence: clock
		CircleSequence: circles
		UseDirectionalTarget: True
		DirectionArrowAnimation: paradirection
		SupportPowerPaletteOrder: 50



# Buff phase transports cargo bay but increasse cost.
STNK:
	Valued:
		Cost: 1350
	Cargo:
		MaxWeight: 9



# Buff chrono tank armor to that of a medium tank, and increase jump distance.. Also now they leave husks.
CTNK:
	Armor:
		Type: Heavy
	Health:
		HP: 46000
	PortableChrono:
		MaxDistance: 18
		ChargeDelay: 375
	SpawnActorOnDeath:
		Actor: CTNK.Husk
CTNK.Husk:
	Inherits: ^Husk
	Tooltip:
		Name: Husk (Chrono Tank)
	TransformOnCapture:
		IntoActor: ctnk
	InfiltrateForTransform:
		IntoActor: ctnk
	RenderSprites:
		Image: ctnk.destroyed


# Remove tesla coil requirement for tesla tank, and give a new voice set.. Also now they leave husks.
TTNK:
	Buildable:
		Prerequisites: stek, ~vehicles.russia, ~techlevel.high
	Mobile:
		Voice: Move 
	AttackTurreted:
		Voice: Attack
	Passenger:
		Voice: Move
	Voiced:
		VoiceSet: TeslaTankVoice
	SpawnActorOnDeath:
		Actor: TTNK.Husk
TTNK.Husk:
	Inherits: ^Husk
	Tooltip:
		Name: Husk (Tesla Tank)
	ThrowsParticle@turret:
		Anim: turret
	TransformOnCapture:
		IntoActor: ttnk
	InfiltrateForTransform:
		IntoActor: ttnk
	RenderSprites:
		Image: ttnk.destroyed



# Increase supply truck payload, and decrease build duration. 
TRUK:
	Buildable:
		BuildDuration: 170
	Valued:
		Cost: 1000
	DeliversCash:
		Payload: 1000



# Make it so attack dogs can detect mines, and decrease build duration.
DOG:
	Buildable:
		Description: Anti-infantry unit.\nCan detect spies.\nCan detect mines.\n  Strong vs Infantry \n  Weak vs Vehicles, Aircraft 
		BuildDuration: 100
	DetectCloaked:
		Range: 3c0
		CloakTypes: Mine
	MineImmune:



# Make it so when you spy a tanya, the new skull pip will appear.
SPY: 
	Inherits@selection: ^SelectableSupportUnit
	WithDecoration@COMMANDOSKULL:
		RequiresCondition: tanyadisguise
		Image: pips
		Sequence: pip-skull
		Palette: effect
		Position: TopLeft
		ValidRelationships: Ally, Enemy, Neutral
	Disguise:
		DisguisedAsConditions:
			e7: tanyadisguise


# Decrease thief build time and cost to that of a british spy.
THF:
	Buildable:
		Description: Steals enemy credits.\nHijacks enemy vehicles.\nEnters enemy Tech Centers to unlock Laser Tank.\n Unarmed
		BuildDuration: 170
	Valued:
		Cost: 250



# Make it so mechanics so get selected when you also select combat units.
MECH:
	Inherits@selection: ^SelectableSupportUnit






# Make Tanya uncrushable.
E7:
	Buildable:
		Description: Elite commando infantry. Armed with\ndual pistols and C4.\nUncrushable.\nMaximum 1 can be trained.\n  Strong vs Infantry, Buildings\n  Weak vs Vehicles, Aircraft\n  Special Ability: Destroy Buildings with C4
	Valued:
		Cost: 1500
	WithDecoration@COMMANDOSKULL:
		Image: pips
		Sequence: pip-skull
		Palette: effect
		Position: TopLeft
		ValidRelationships: Ally, Enemy, Neutral
	Crushable:
		CrushClasses: heavywall







# This is all required for the stolen tech laser tanks
tech.stolen.soviet:
	AlwaysVisible:
	ProvidesPrerequisite:
	Interactable:
	Tooltip:
		Name: Enemy Tech Center infiltrated
	Buildable:
		Description: Tech Unit
LATNK:
	Inherits: ^TrackedVehicle
	Inherits@GAINSEXPERIENCE: ^GainsExperience
	Inherits@AUTOTARGET: ^AutoTargetGroundAssaultMove
	Buildable:
		Queue: Vehicle
		BuildDuration: 1350
		Prerequisites: stek, ~vehicles.soviet, ~tech.stolen.soviet
		Description: Experimental laser tank artillery cannon.\n  Strong vs Vehicles, Infantry, Buildings\n  Weak vs Aircraft
	Valued:
		Cost: 2500
	Tooltip:
		Name: Laser Tank
		GenericName: Tank
	UpdatesPlayerStatistics:
		AddToArmyValue: true
	Health:
		HP: 30000
	Armor:
		Type: Light
	Mobile:
		Speed: 72
	RevealsShroud:
		MinRange: 4c0
		Range: 5c0
		RevealGeneratedShroud: False
	RevealsShroud@GAPGEN:
		Range: 4c0
	Armament:
		Weapon: LaserCannon
	AttackTurreted:
	Turreted:
	WithIdleOverlay@SPINNER:
		Sequence: spinner
		Offset: 0, 0, 0
		Palette:
		IsPlayerPalette: false
		PauseOnLowPower: false
	Selectable:
		DecorationBounds: 30,30
	AutoTarget:
		ScanRadius: 16
	ProducibleWithLevel:
		Prerequisites: vehicles.upgraded
	SpawnActorOnDeath:
		Actor: LATNK.Husk
LATNK.Husk:
	Inherits: ^Husk
	Tooltip:
		Name: Husk (Laser Tank)
	ThrowsParticle@spinner:
		Anim: spinner-idle
		Offset: -299,0,171
	TransformOnCapture:
		IntoActor: latnk
	InfiltrateForTransform:
		IntoActor: latnk
	RenderSprites:
		Image: latnk.destroyed
ATEK:
	Targetable:
		TargetTypes: Ground, GroundActor, C4, DetonateAttack, Structure, SpyInfiltrate, ThiefInfiltrate
	InfiltrateForSupportPower:
		Proxy: tech.stolen.soviet
		Types: ThiefInfiltrate
STEK:
	Targetable:
		TargetTypes: Ground, GroundActor, C4, DetonateAttack, Structure, ThiefInfiltrate
	InfiltrateForSupportPower:
		Proxy: tech.stolen.soviet
		Types: ThiefInfiltrate






# Allied GPS re-work
ATEK:
	GpsPower:
		ChargeInterval: 1
		RevealDelay: 30
		DisplayTimerRelationships: None
		RequiresCondition: gpsactivated
		StartFullyCharged: True
		RequiresActiveRadar: True
	ProduceActorPower@powergps:
		Description: GPS Satellite
		LongDesc: Reveals map terrain and provides tactical\ninformation. Requires power and active radar.
		Icon: gps
		PauseOnCondition: disabled
		Actors: powergps
		Type: GPSPower
		ChargeInterval: 4500
		OrderName: GPSSpawner
		SupportPowerPaletteOrder: 20
		LaunchSpeechNotification: SatelliteInitialzed
		IncomingSpeechNotification: SatelliteInitialzed
		DisplayTimerRelationships: None
		EndChargeSpeechNotification: SatelliteReady
		RequiresCondition: !gpsactivated
	ProduceActorPower@gpsactivesign:
		Description: GPS Active Timer
		LongDesc: Displays the amount of time the satellite is still active.
		Icon: gpsactive
		Actors: e1
		Type: Infantry
		ChargeInterval: 1501
		SupportPowerPaletteOrder: 20
		DisplayTimerRelationships: Ally, Neutral, Enemy
		RequiresCondition: gpsactivated
	GrantConditionOnPrerequisite@gpsactivation:
		Prerequisites: gpsactiveprereq
		Condition: gpsactivated
	ProvidesPrerequisite@uplink:
		Prerequisite: uplink
	Exit@1:
		SpawnOffset: -704,768,0
		ExitCell: -1,2
	Production@GPSPower:
		Produces: GPSPower
powergps:
	Interactable:
	EditorOnlyTooltip:
		Name: (GPS Power Dummy)
	AlwaysVisible:
	Aircraft:
		Repulsable: False
	BodyOrientation:
		QuantizedFacings: 1
	WithSpriteBody:
	RenderSpritesEditorOnly:
		Image: camera
	MapEditorData:
		Categories: System
	ProvidesPrerequisite@gap:
		Prerequisite: gpsactiveprereq
	ActorLostNotification:
		Notification: SatelliteTerminated
		NotifyAll: True
	Health:
		HP: 1500
	HitShape:
	ChangesHealth:
		Step: -1
		StartIfBelow: 101
		Delay: 1
	GrantConditionOnPrerequisite@satelliteexists:
		Prerequisites: uplink
		Condition: uplinkexists
	KillsSelf:
		RequiresCondition: !uplinkexists




# Make it so that enemies will hear a custom incoming nuclear missile sound. And decrease timer.
MSLO:
	NukePower:
		MissileWeapon: atomic
		IncomingSound: bits/audio/nukelaunch.aud
		ChargeInterval: 9000







# This is all required for the elite paradrops. (E1R4-AFDL)
E1R4:
	Inherits: E1
	RenderSprites:
		Image: E1
	ProducibleWithLevel:
		Prerequisites: techlevel.infonly
		InitialLevels: 4
	-Buildable:
E2R4:
	Inherits: E2
	RenderSprites:
		Image: E2
	ProducibleWithLevel:
		Prerequisites: techlevel.infonly
		InitialLevels: 4
	-Buildable:
E3R4:
	Inherits: E3
	RenderSprites:
		Image: E3
	ProducibleWithLevel:
		Prerequisites: techlevel.infonly
		InitialLevels: 4
	-Buildable:
AFLD:
	ParatroopersPower@paratroopers:
		Prerequisites: aircraft.ukraine
		LongDesc: A Badger drops a squad of elite infantry\nanywhere on the map.
		DropItems: E1R4,E1R4,E3R4,E3R4,E2R4
	ParatroopersPower@paratroopersrussia:
		OrderName: RussiaParatroopers
		Prerequisites: aircraft.russia
		Icon: paratroopers
		ChargeInterval: 7500
		Description: Paratroopers
		LongDesc: A Badger drops a squad of elite infantry\nanywhere on the map.
		DropItems: E1R4,E1R4,E3R4,E3R4,E2R4
		ReinforcementsArrivedSpeechNotification: ReinforcementsArrived
		SelectTargetSpeechNotification: SelectTarget
		AllowImpassableCells: false
		QuantizedFacings: 8
		CameraActor: camera.paradrop
		DisplayBeacon: true
		BeaconPoster: pinficon
		ArrowSequence: arrow
		ClockSequence: clock
		CircleSequence: circles
		UseDirectionalTarget: True
		DirectionArrowAnimation: paradirection
		SupportPowerPaletteOrder: 50


# Give mig jets a cool take off sound.
MIG:
	Aircraft:
		TakeoffSounds: bits/audio/cjetbana.aud


# New voice set for demo truck
DTRK:
	Mobile:
		Voice: Move
	AttackFrontal:
		Voice: Attack
	Passenger:
		Voice: Move
	Voiced:
		VoiceSet: TTruckVoice



MNLY:
	Buildable:
		BuildDuration: 620


# Put thieves in the mad tanks 
QTNK:
	MadTank:
		DriverActor: thf


PATR:
	Inherits: ^Defense
	RenderSprites:
		PlayerPalette: playertd
	ActorPreviewPlaceBuildingPreview:
		OverridePalette: placebuildingtd
	Inherits@IDISABLE: ^DisableOnLowPowerOrPowerDown
	Inherits@shape: ^2x2Shape
	Buildable:
		Queue: Defense
		BuildPaletteOrder: 130
		Prerequisites: atek, ~structures.england, ~techlevel.unrestricted
		BuildLimit: 1
		IconPalette: chrometd
		Description: Launches E.M. Pulse Missiles that disable vehicles & structures.\nRequires power to operate.\nMaximum 1 can be built.\n  Special Ability: E.M. Pulse Missile
	Valued:
		Cost: 1500
	Tooltip:
		Name: EMP Missile Launcher
	Building:
		Footprint: xx xx
		Dimensions: 2,2
	Health:
		HP: 100000
	Armor:
		Type: Wood
	RevealsShroud:
		MinRange: 5c0
		Range: 6c0
		RequiresCondition: !disabled
		RevealGeneratedShroud: False
	RevealsShroud@Offline:
		Range: 5c0
		RequiresCondition: disabled
	RevealsShroud@GAPGEN:
		Range: 5c0
		RequiresCondition: !disabled
	Turreted:
		TurnSpeed: 21
		InitialFacing: 0
		RealignDelay: -1
	-WithSpriteBody:
	AttackTurreted:
		RequiresCondition: !build-incomplete && !reloading
		OpportunityFire: False
		PersistentTargeting: False
		ForceFireIgnoresActors: True
	Armament:
		Weapon: THLauncher
		LocalOffset: 1000,0,500
		ReloadingCondition: reloading
	AttackOrderPower@EMPMISSILE:
		OrderName: empmissile
		Cursor: ability
		Icon: empmissile
		ChargeInterval: 3000
		Description: E.M. Missile
		LongDesc: Fires a Tomahawk missile which disables\nall mechanical units in the area.
		SelectTargetSpeechNotification: SelectTarget
		InsufficientPowerSpeechNotification: InsufficientPower
		DisplayTimerRelationships: Ally, Neutral, Enemy
	SupportPowerChargeBar:
	Power:
		Amount: -150
	BodyOrientation:
		UseClassicFacingFudge: True
	Explodes:
		Weapon: BuildingExplode
		EmptyWeapon: BuildingExplode
	WithBuildingBib:
		HasMinibib: true
	Selectable:
		Bounds: 48,48
	RejectsOrders:
		Except: Sell, PowerDown
	Targetable:
		TargetTypes: Ground, GroundActor, Structure, C4, DetonateAttack, SpyInfiltrate



# Display German Advanced Cronosphere timer to enemies
PDOX:
	Buildable:
		Prerequisites: atek, ~structures.germany, ~techlevel.unrestricted
	ChronoshiftPower@advancedchronoshift:
		DisplayTimerRelationships: Ally, Neutral, Enemy





# Make iron curtain also give a speed boost, and also now enemies can see iron curtain timer
IRON:
	Buildable:
		Description: Makes a group of units invulnerable and increases\ntheir speed, for a short time.\nRequires power to operate.\nMaximum 1 can be built.\n  Special Ability: Invulnerability
	GrantExternalConditionPower@IRONCURTAIN:
		Description: Invulnerability
		LongDesc: Makes a group of units invulnerable,\nand boosts speed for 20 seconds.
		DisplayTimerRelationships: Ally, Neutral, Enemy
	Inherits@shape: ^2x2Shape
	Building: # The following increases the footprint of the structure so you can IC it + MCV
		Footprint: xx xx
		Dimensions: 2,2
	Selectable:
		Bounds: 48,50,0,-4
		-DecorationBounds: 50,50,0,-12



# Incrased gap gen shroud by 1 cell
GAP:
	CreatesShroud:
		Range: 7c0


# Remove flame turret requirement for flame solider
E4:
	Buildable:
		Prerequisites: ~barr, ~techlevel.low



# Give oil derricks a buildable area, and make them explode for more damage
OILB:
	TooltipDescription@ally:
		Description: Provides additional funds and buildable area.
	TooltipDescription@other:
		Description: Capture to receive additional funds and buildable area.
	Explodes:
		Weapon: OilExplode
	GivesBuildableArea:
		AreaTypes: building
	BaseProvider:
		PauseOnCondition: being-captured
		Range: 4c0
	CashTrickler:
		Amount: 125



# Remove tesla coil requirement for shock troopers
SHOK:
	Buildable:
		Prerequisites: ~barr, stek, ~infantry.russia, ~techlevel.high


STHGEN:
	Inherits: ^ScienceBuilding
	Inherits@IDISABLE: ^DisableOnLowPowerOrPowerDown
	Inherits@shape: ^2x2Shape
	Selectable:
	Buildable:
		Queue: Defense
		BuildPaletteOrder: 120
		Prerequisites: atek, ~structures.france, ~techlevel.unrestricted
		BuildLimit: 1
		Description: Makes a group of units invisible for a short time.\nRequires power to operate.\nMaximum 1 can be built.\n  Special Ability: Invisibility
	Valued:
		Cost: 1500
	Tooltip:
		Name: Stealth Generator
	Building:
		Footprint: xx xx
		Dimensions: 2,2
	Health:
		HP: 100000
	Armor:
		Type: Wood
	RevealsShroud:
		MinRange: 5c0
		Range: 6c0
		RequiresCondition: !disabled
		RevealGeneratedShroud: False
	RevealsShroud@Offline:
		Range: 5c0
		RequiresCondition: disabled
	RevealsShroud@GAPGEN:
		Range: 5c0
		RequiresCondition: !disabled
	WithBuildingBib:
		HasMinibib: true
	GrantExternalConditionPower@STEALTH:
		OrderName: GrantExternalConditionPowerStealth
		PauseOnCondition: empdisable || disabled
		Icon: cloakicon
		ChargeInterval: 3000
		Description: Stealth Shield
		LongDesc: Makes a group of units invisible\nfor 20 seconds.
		Duration: 500
		SelectTargetSpeechNotification: SelectTarget
		InsufficientPowerSpeechNotification: InsufficientPower
		BeginChargeSpeechNotification: Charging
		EndChargeSpeechNotification: Ready
		DisplayRadarPing: True
		Condition: stealth
		OnFireSound: ironcur9.aud
		SupportPowerPaletteOrder: 10
		Dimensions: 5, 5
		Footprint: __x__ _xxx_ xxxxx _xxx_ __x__
		DisplayTimerRelationships: Ally, Neutral, Enemy
	SupportPowerChargeBar:
	InfiltrateForSupportPowerReset:
		Types: SpyInfiltrate
	Targetable:
		TargetTypes: GroundActor, C4, DetonateAttack, Structure, SpyInfiltrate
	Power:
		Amount: -200
	MustBeDestroyed:
		RequiredForShortGame: false
	ProvidesPrerequisite@buildingname:




# Render skull icon when tanya is inside, and other tanya stuff
JEEP:
	WithDecoration@COMMANDOSKULL:
		Image: pips
		Sequence: pip-skull
		Palette: effect
		Position: TopLeft
		ValidRelationships: Ally, Enemy, Neutral
		RequiresCondition: loaded-cmdo
	Armament:
		RequiresCondition: !loaded-cmdo
	Armament@E7:
		Weapon: Colt45-Ranger
		MuzzleSequence: garrison-muzzle
		LocalOffset: 128,0,43
		RequiresCondition: loaded-cmdo
	Cargo:
		PassengerConditions:
			e7: loaded-cmdo






# This is all required for the gates. (^Building-VGATE)
^Building:
	Capturable@2:          
		RequiresCondition: !build-incomplete
		Types: building-external  
^Wall:
	LineBuildNode:
		Types: wall, gate
^Gate:
	Inherits: ^Building
	-WithSpriteBody:
	-EngineerRepairable:
	-Capturable:
	-Capturable@2:
	-SpawnActorsOnSell:
	-CaptureManager:
	-CapturableProgressBar:
	-CapturableProgressBlink:
	-WithMakeAnimation:
	-GivesBuildableArea:
	-GivesExperience:
	-MustBeDestroyed:
	Health:
		HP: 35000
	Armor:
		Type: Concrete
	LineBuildNode:
		Types: concrete, gate
	WithGateSpriteBody:
		PauseOnCondition: disabled
	Tooltip:
		Name: Gate
	Building:
		BuildSounds: bits/audio/place2.aud
		TerrainTypes: Clear, Road
	RequiresBuildableArea:
		AreaTypes: building
		Adjacent: 4
	MapEditorData:
		Categories: Wall
	Gate:
		PauseOnCondition: disabled || empdisable
		OpeningSound: bits/audio/hydrod1.aud
		ClosingSound: bits/audio/hvydoor1.aud
		BlocksProjectilesHeight: 0
HGATE:
	Inherits: ^Gate
	HitShape:
		UseTargetableCellsOffsets: true
		Type: Rectangle
			TopLeft: -1536, -512
			BottomRight: 1536, 512
	Building:
		Footprint: xxx
		Dimensions: 3,1
	Buildable:
		Queue: Defense
		Prerequisites: fact, ~techlevel.medium
		Description: Places an horizontal gate.\nThe gate automatically opens for friendly units.\nBlocks enemy access into your base.
		BuildDuration: 180
	Valued:
		Cost: 200
	Demolishable:
		Condition: being-demolished
	Sellable:
		RequiresCondition: !being-demolished
	CustomSellValue:
		Value: 50
	WithGateSpriteBody:
		WallConnections: -1,0, 3,0
	LineBuildNode:
		Connections: -1,0, 1,0
	Tooltip:
		Name: Gate - (horizontal)
	RevealsShroud:
		Range: 1c0
	RenderSprites:
		Image: hgate
VGATE:
	Inherits: ^Gate
	HitShape:
		UseTargetableCellsOffsets: true
		Type: Rectangle
			TopLeft: -512, -1536
			BottomRight: 512, 1536
	Building:
		Footprint: x x x
		Dimensions: 1,3
	Buildable:
		Queue: Defense
		Prerequisites: fact, ~techlevel.medium
		Description: Places an vertical gate.\nThe gate automatically opens for friendly units.\nBlocks enemy access into your base.
		BuildDuration: 180
	Valued:
		Cost: 200
	Demolishable:
		Condition: being-demolished
	Sellable:
		RequiresCondition: !being-demolished
	CustomSellValue:
		Value: 50
	WithGateSpriteBody:
		WallConnections: 0,-1, 0,3
	LineBuildNode:
		Connections: 0,-1, 0,1
	Tooltip:
		Name: Gate I (vertical)
	RevealsShroud:
		Range: 1c0


# Double concrete walls HP.
BRIK:
	Health:
		HP: 80000



# Decrease radar dome cost, to help make rushing tech more viable.
DOME: 
	Valued:
		Cost: 1500


# Increase yak ammo pool.
YAK:
	AmmoPool:
		Ammo: 24
























# ANTI-RAGL BALANCE CHANGES 
^Husk:
	TransformOnCapture:
		ForceHealthPercentage: 50 # from 15
	InfiltrateForTransform:
		ForceHealthPercentage: 50 # from 15

IRON:
	GrantExternalConditionPower@IRONCURTAIN:
		Duration: 500 # from 400

# Phase Transport not uncloak upon loading/unloading, or attacking
STNK:
	Cloak:
		RequiresCondition: !notmobile
		UncloakOn: Heal, Dock, Attack

# This is the code they used to make MGG have to deploy to work (undo this when/if base game decides to implement it) 
#MGG:
#	WithIdleOverlay@SPINNER:
#		PauseOnCondition: undeployed
#	CreatesShroud:
#		RequiresCondition: !undeployed
#	GrantConditionOnDeploy:
#		DeployedCondition: undeployed
