^Palettes:
	PaletteFromFile@temptd:
		Name: temptd
		Filename: temperattd.pal
		ShadowIndex: 4
	PlayerColorPalette@TD:
		BasePalette: temptd
		BaseName: playertd
		RemapIndex: 176, 178, 180, 182, 184, 186, 189, 191, 177, 179, 181, 183, 185, 187, 188, 190
	PaletteFromFile@chromeTD:
		Name: chrometd
		Filename: temperattd.pal
		ShadowIndex: 3
		AllowModifiers: false

TRAN:
	Buildable:
		BuildAtProductionType: Aircraft
		Prerequisites: ~techlevel.medium

DD2:
	Inherits: ^Ship
	Inherits@AUTOTARGET: ^AutoTargetGroundAssaultMove
	Buildable:
		Queue: Ship
		BuildAtProductionType: Boat
		BuildPaletteOrder: 40
		Prerequisites: ~syrd, atek, ~techlevel.medium
		IconPalette: chrometd
		Description: Advanced long-range warship\marmed with a powerful railgun.\n  Strong vs Naval, Ground units\n  Weak vs Aircraft
	Valued:
		Cost: 1500
	Tooltip:
		Name: Frigate
	UpdatesPlayerStatistics:
		AddToArmyValue: true
	Health:
		HP: 60000
	Armor:
		Type: Heavy
	Mobile:
		TurnSpeed: 5
		Speed: 65
	RevealsShroud:
		Range: 6c0
		RevealGeneratedShroud: False
	RevealsShroud@GAPGEN:
		Range: 5c0
	WithIdleOverlay@SPINNER:
		Sequence: spinner
		Offset: -90,0,406
	Turreted:
		TurnSpeed: 6
		Offset: 551,0,158
	Armament:
		Weapon: Railgun
		LocalOffset: 200,0,30
		Recoil: 0
		RecoilRecovery: 0
		MuzzleSequence: muzzle
	AttackTurreted:
	SelectionDecorations:
	AutoTarget:
	WithSpriteTurret@PRIMARY:
		Turret: primary
	WithMuzzleOverlay:
	Selectable:
		DecorationBounds: 38,38
    RenderSprites:
        Image: naval/shp/dd2
SS:
	DetectCloaked:
		Range: 6c0
	Valued:
		Cost: 800
	AutoTarget:
		InitialStance: Defend
		InitialStanceAI: AttackAnything
	Health:
		HP: 30000

ICBMSUB:
	Inherits: ^Ship
	Inherits@AUTOTARGET: ^AutoTargetAllAssaultMove
	Buildable:
		Queue: Ship
		BuildAtProductionType: Submarine
		BuildPaletteOrder: 61
		Prerequisites: ~spen, stek, ~techlevel.high
		Description: Submerged anti-ground siege unit\narmed with napalm missiles.\nCan detect other submarines.\n  Strong vs Infantry, Buildings\n  Weak vs Naval units, Aircraft\n  Special Ability: Submerge
	Valued:
		Cost: 2000
	Tooltip:
		Name: ICBM Submarine
	UpdatesPlayerStatistics:
		AddToArmyValue: true
	Health:
		HP: 45000
	Armor:
		Type: Light
	Mobile:
		TurnSpeed: 3
		Speed: 40
	RevealsShroud:
		Range: 8c0
		RevealGeneratedShroud: False
	RevealsShroud@GAPGEN:
		Range: 5c0
	Targetable:
		TargetTypes: Ground, Water, Ship, Submarine, Repair
		RequiresCondition: !underwater
	Targetable@UNDERWATER:
		TargetTypes: Underwater, Submarine
		RequiresCondition: underwater
	Cloak:
		CloakTypes: Underwater
		UncloakOn: Attack, Unload, Infiltrate, Demolish, Dock, Heal
		InitialDelay: 0
		CloakDelay: 100
		CloakSound: subshow1.aud
		UncloakSound: subshow1.aud
		CloakedCondition: underwater
		Palette: submerged
		PauseOnCondition: cloak-force-disabled
	GrantConditionOnDamageState@UNCLOAK:
		Condition: cloak-force-disabled
		ValidDamageStates: Critical
	Armament@primary:
		Weapon: NapalmMissile
		LocalOffset: 350,-151,0, 350,151,0
		FireDelay: 1
	Armament@secondary:
		Weapon: NapalmMissile
		LocalOffset: 350,-151,0, 350,151,0
		FireDelay: 10
	AttackFrontal:
		TargetFrozenActors: True
		ForceFireIgnoresActors: True
	SelectionDecorations:
	AutoTarget:
		InitialStance: HoldFire
		InitialStanceAI: ReturnFire
	DetectCloaked:
		CloakTypes: Underwater
		Range: 4c0
	RenderDetectionCircle:
	Explodes:
		Weapon: UnitExplodeSubmarine
		EmptyWeapon: UnitExplodeSubmarine
	-MustBeDestroyed:
	Selectable:
		DecorationBounds: 44,44

SCOUTSUB:
	Inherits: ^Ship
	Inherits@EXPERIENCE: ^GainsExperience
	Inherits@AUTOTARGET: ^AutoTargetAllAssaultMove
	RenderSprites:
        Image: naval/shp/scoutsub
		PlayerPalette: playertd
	Buildable:
		Queue: Ship
		BuildPaletteOrder: 31
		Prerequisites: ~spen, dome, ~techlevel.medium
		Description: Submerged harassment unit\narmed with a powerful cruise cannon.\nCan detect other submarines.\n  Strong vs Ground Units, Ships\n  Weak vs Aircraft\n  Special Ability: Submerge
	Valued:
		Cost: 1000
	Tooltip:
		Name: Cruiser Submarine
	Health:
		HP: 25000
	Armor:
		Type: Light
	Mobile:
		TurnSpeed: 6
		Speed: 94
	RevealsShroud:
		Range: 7c0
		RevealGeneratedShroud: False
	RevealsShroud@GAPGEN:
		Range: 5c0
	Targetable:
		TargetTypes: Ground, Water, Ship, Submarine
		RequiresCondition: !underwater
	Targetable@UNDERWATER:
		TargetTypes: Underwater, Submarine
		RequiresCondition: underwater
	Cloak:
		CloakTypes: Underwater
		InitialDelay: 0
		CloakDelay: 100
		CloakSound: subshow1.aud
		UncloakSound: subshow1.aud
		CloakedCondition: underwater
		Palette: submerged
		PauseOnCondition: cloak-force-disabled
	GrantConditionOnDamageState@UNCLOAK:
		Condition: cloak-force-disabled
		ValidDamageStates: Critical
	Armament:
		Weapon: SubFlak
		LocalOffset: 600,0,128
		Recoil: 160
		RecoilRecovery: 18
		MuzzleSequence: muzzle
	AttackTurreted:
	Turreted:
		TurnSpeed: 4
		Offset: 370,0,164
	WithMuzzleOverlay:
	WithSpriteTurret:
	Selectable:
		Bounds: 38,38
	DetectCloaked:
		CloakTypes: Underwater
		Range: 4c0
	RenderDetectionCircle:
	Explodes:
		Weapon: UnitExplodeSubmarine
		EmptyWeapon: UnitExplodeSubmarine
	-WithDamageOverlay:

CATAMARA:
	Inherits: ^Ship
	Inherits@EXPERIENCE: ^GainsExperience
	Inherits@AUTOTARGET: ^AutoTargetAllAssaultMove
	RenderSprites:
        Image: naval/shp/catamara
		PlayerPalette: playertd
	Buildable:
		Queue: Ship
		BuildPaletteOrder: 20
		Prerequisites: ~syrd, ~techlevel.medium
		IconPalette: chrometd
		Description: Fast reconnaissance ship\narmed with a gatling gun.\n  Strong vs Infantry\n  Weak vs Everything else\n  Special Ability: Mine Immune
	Valued:
		Cost: 750
	Tooltip:
		Name: Scout Craft
	Health:
		HP: 15000
	Armor:
		Type: Light
	Mobile:
		TurnSpeed: 10
		Speed: 150
        Locomotor: lcraft
	MineImmune:
	RevealsShroud:
		Range: 9c0
		RevealGeneratedShroud: False
	RevealsShroud@GAPGEN:
		Range: 7c0
	Turreted:
		TurnSpeed: 15
		Offset: 0,0,427
	Armament@PRIMARY:
		Weapon: GatlingGun
		LocalOffset: 384,0,128
		MuzzleSequence: muzzle
	AttackTurreted:
	WithMuzzleOverlay:
	Selectable:
		Bounds: 32,32
	WithSpriteTurret:

CSTL:
	Inherits: ^Defense
	Inherits@AUTOTARGET: ^AutoTargetGround
	RenderSprites:
        Image: naval/shp/cstl
		PlayerPalette: playertd
	Valued:
		Cost: 900
	Tooltip:
		Name: Coastal Defense Turret
	Buildable:
		BuildPaletteOrder: 115
		Prerequisites: dome, ~techlevel.medium
		Queue: Defense
		IconPalette: chrometd
		Description: Long-ranged anti-Naval turret.\nCan detect submarines.\n  Strong vs Naval units\n  Weak vs Everything else
	Building:
		TerrainTypes: Water
	Health:
		HP: 40000
	Armor:
		Type: Heavy
	RevealsShroud:
		Range: 9c0
		RevealGeneratedShroud: False
	RevealsShroud@GAPGEN:
		Range: 5c0
	Turreted:
		TurnSpeed: 8
		InitialFacing: 50
	Selectable:
		Bounds: 28,28
	-WithSpriteBody:
	WithEmbeddedTurretSpriteBody:
	Armament:
		Weapon: SurfaceTorpTube
		LocalOffset: 1024,-200,0, 1024,0,0, 1024,200,0
	AttackTurreted:
		RequiresCondition: !build-incomplete
	WithMuzzleOverlay:
	RenderRangeCircle:
	RenderDetectionCircle:
	Power:
		Amount: -50
	DetectCloaked:
		CloakTypes: Underwater, Cloak
		Range: 6c0

SSFK:
	Inherits: ^Ship
	Inherits@AUTOTARGET: ^AutoTargetAir
	Tooltip:
		Name: Flak Trap
	Buildable:
		Queue: Ship
		BuildAtProductionType: Submarine
		BuildPaletteOrder: 32
		Prerequisites: ~spen, dome, ~techlevel.medium
		IconPalette: chrometd
		Description: Submerged anti-air platform\narmed with two flak guns.\n  Strong vs Air units\n  Weak vs Ground units, other Naval units.\n  Special Ability: Submerge
	Health:
		HP: 25000
	Valued:
		Cost: 1600
	Armor:
		Type: Light
	Mobile:
		TurnSpeed: 4
		Speed: 56
	RevealsShroud:
		Range: 6c0
		RevealGeneratedShroud: False
	RevealsShroud@GAPGEN:
		Range: 5c0
	Targetable:
		TargetTypes: Ground, Water, Ship, Submarine, Repair
		RequiresCondition: !underwater
	Targetable@UNDERWATER:
		TargetTypes: Underwater, Submarine, Repair
		RequiresCondition: underwater
	Cloak:
		CloakTypes: Underwater
		InitialDelay: 0
		CloakDelay: 300
		CloakSound: subshow1.aud
		UncloakSound: subshow1.aud
		CloakedCondition: underwater
		Palette: submerged
		PauseOnCondition: cloak-force-disabled
	GrantConditionOnDamageState@UNCLOAK:
		Condition: cloak-force-disabled
		ValidDamageStates: Critical
	Selectable:
		DecorationBounds: 38,38
	-MustBeDestroyed:
	WithMakeAnimation:
		Sequence: submerge
	AttackTurreted:
	Turreted@PRIMARY:
		Offset: 240,-190,20
		TurnSpeed: 10
	Turreted@SECONDARY:
		Turret: secondary
		Offset: 240,190,20
		TurnSpeed: 10
	Armament@PRIMARY:
		Weapon: FLAK-23-AA
		Recoil: 30
		LocalOffset: 400,0,160
		MuzzleSequence: muzzle
		FireDelay: 2
	Armament@SECONDARY:
		Name: secondary
		Turret: secondary
		Weapon: FLAK-23-AA
		Recoil: 30
		LocalOffset: 400,0,160
		MuzzleSequence: muzzle
	WithSpriteTurret@PRIMARY:
	WithSpriteTurret@SECONDARY:
		Turret: secondary
	WithMuzzleOverlay:
	RenderSprites:
        Image: naval/shp/ssfk

PT:
	Buildable:
		Description: Light combat ship.\nCan detect submarines.\n  Strong vs Naval units\n  Weak vs Ground units, Aircraft
	Valued:
		Cost: 300
	Health:
		HP: 10000
	Turreted@SECONDARY:
		Turret: secondary
		TurnSpeed: 5
		Offset: -461,0,18
	Armament@SECONDARY:
		Turret: secondary
	WithSpriteTurret@SECONDARY:
		Turret: secondary
		Sequence: turret-dc

DD:
	Turreted@SECONDARY:
		Turret: secondary
		TurnSpeed: 5
		Offset: -761,0,128
	Armament@SECONDARY:
		Turret: secondary
	-WithSpriteTurret:
	WithSpriteTurret@PRIMARY:
		Turret: primary
		Sequence: turret
	WithSpriteTurret@SECONDARY:
		Turret: secondary
		Sequence: turret-dc

CARR:
	RenderSprites:
        Image: naval/shp/carr
	Inherits: ^Ship
	Buildable:
		Queue: Ship
		BuildAtProductionType: Boat
		BuildPaletteOrder: 35
		Prerequisites: ~syrd, dome, ~techlevel.medium
		Description: Mobile helipad.\n  Unarmed\n  Special Toggle Ability: Deploy
	Valued:
		Cost: 400
	Tooltip:
		Name: Heli Carrier
	Health:
		HP: 30000
	Armor:
		Type: Heavy
	Mobile:
		TurnSpeed: 255
		Speed: 85
	RevealsShroud:
		Range: 6c0
		RevealGeneratedShroud: False
	RevealsShroud@GAPGEN:
		Range: 4c0
	SelectionDecorations:
	Selectable:
		DecorationBounds: 48,48
	Transforms:
		IntoActor: carr.deployed
		Offset: 0,0

CARR.Deployed:
	Inherits: ^Building
	-GivesBuildableArea:
	-RepairableBuilding:
	-WithBuildingRepairDecoration:
	-EngineerRepairable:
	-AcceptsDeliveredCash:
	-WithMakeAnimation:
	-CaptureManager:
	-Capturable:
	-CapturableProgressBar:
	-CapturableProgressBlink:
	-SpawnActorsOnSell:
	-GpsDot:
	GpsDot:
		String: Ship
	-Demolishable:
	-Sellable:
	-Explodes:
	Explodes:
		Weapon: UnitExplodeShip
		EmptyWeapon: UnitExplodeShip
	Selectable:
		Bounds: 48,48
	Valued:
		Cost: 400
	Tooltip:
		Name: Heli Carrier
	Building:
		TerrainTypes: Water
		RequiresBaseProvider: False
	-RequiresBuildableArea:
	-ShakeOnDeath:
	Health:
		HP: 30000
	Armor:
		Type: Heavy
	RevealsShroud:
		Range: 6c0
		RevealGeneratedShroud: False
	RevealsShroud@GAPGEN:
		Range: 4c0
	SelectionDecorations:
	Selectable:
		DecorationBounds: 48,48
	Transforms:
		IntoActor: carr
		Offset: 0,0
	Reservable:
	WithDecoration@deployed:
		Image: pips
		Sequence: pip-deployed
		ReferencePoint: Top
		ZOffset: 256
	Targetable:
		TargetTypes: Ground, Water, Ship
	WithResupplyAnimation:
	RenderSprites:
        Image: naval/shp/carr.deployed
HELI:
	Rearmable:
		RearmActors: hpad, carr.deployed

HIND:
	Rearmable:
		RearmActors: hpad, carr.deployed

MH60:
	Rearmable:
		RearmActors: hpad, carr.deployed

LST:
	Cargo:
		MaxWeight: 12
		PipCount: 12
	Valued:
		Cost: 500
	MineImmune:
	Buildable:
        Prerequisites: ~syrd, ~techlevel.low
		Description: General-purpose naval transport.\nCan carry infantry and tanks.\n  Unarmed\n  Special Ability: Mine Immune
    Mobile:
        Speed: 85
        PauseOnCondition: notmobile || being-captured

^BaseWorld:
	Locomotor@NAVAL:
		Crushes: mine, crate
	Locomotor@LANDINGCRAFT:
		Crushes: mine, crate
    Locomotor@NAVALFOOT:
        Name: navalfoot
        Crushes: mine, crate
        SharesCell: true
        TerrainSpeeds:
            Clear: 90
            Rough: 80
            Road: 100
            Bridge: 100
            Ore: 80
            Gems: 80
            Beach: 80
            River: 80
            Water: 80
    Locomotor@FOOTBOAT:
        Name: footboat
        Crushes: mine, crate
        SharesCell: true
        TerrainSpeeds:
            Clear: 90
            Rough: 80
            Road: 100
            Bridge: 100
            Ore: 80
            Gems: 80
            Beach: 50
            River: 50
            Water: 150
    Locomotor@HEAVYAMPHIBIAN:
        Name: heavyamphibian
        Crushes: wall, mine, crate, infantry
        TerrainSpeeds:
            Clear: 80
            Rough: 40
            Road: 100
            Bridge: 100
            Ore: 70
            Gems: 70
            Beach: 40
            River: 30
            Water: 35
    Locomotor@LIGHTFLOATER:
        Name: lightfloater
        Crushes: mine, crate
        TerrainSpeeds:
            Clear: 80
            Rough: 40
            Road: 100
            Bridge: 100
            Ore: 70
            Gems: 70
            Beach: 40
            Water: 25
    Locomotor@HEAVYFLOATER:
        Name: heavyfloater
        Crushes: wall, mine, crate, infantry
        TerrainSpeeds:
            Clear: 80
            Rough: 40
            Road: 100
            Bridge: 100
            Ore: 70
            Gems: 70
            Beach: 40
            Water: 25
    Locomotor@HEAVYTRACKED:
        TerrainSpeeds:
            Water: 25
    Locomotor@LIGHTTRACKED:
        TerrainSpeeds:
            Water: 25
    Locomotor@HEAVYWHEELED:
        TerrainSpeeds:
            Water: 25


^BasicBuilding:
    Building:
        TerrainTypes: Clear, Road, Beach, Water
    Targetable@WATER:
        TargetTypes: Water, Structure
        RequiresCondition: water
    GrantConditionOnTerrain:
        Condition: water
        TerrainTypes: Water, Beach
        
^Defense:
    GrantConditionOnTerrain:
        Condition: water
        TerrainTypes: Water
    Targetable@WATER:
        TargetTypes: Water, Structure, Defence
	
SPEN:
	GivesBuildableArea:
        AreaTypes: building, fake
	Valued:
		Cost: 700
	-InfiltrateForSupportPower:

SYRD:
	GivesBuildableArea:
        AreaTypes: building, fake
	Valued:
		Cost: 700
	-InfiltrateForSupportPower:
	SpawnActorPower@sonar:
        Icon: sonar
        Description: Sonar Pulse
        LongDesc: Reveals all submarines in the vicinity for a \nshort time.
        ChargeInterval: 2000
        EndChargeSpeechNotification: SonarPulseReady
        SelectTargetSpeechNotification: SelectTarget
        Actor: sonar
        LifeTime: 250
        DeploySound: sonpulse.aud
        EffectImage: moveflsh
        EffectPalette: moveflash
    SupportPowerChargeBar:

CA:
	Valued:
		Cost: 2000

camera.spyplane:
	DetectCloaked:
		CloakTypes: Underwater
		Range: 10c0
        
E6:
    Mobile:
        Locomotor: footboat
    GrantConditionOnTerrain:
        Condition: swimming
        TerrainTypes: Water
    Targetable@WATER:
        TargetTypes: Water
        RequiresCondition: swimming
    LeavesTrails:
        TerrainTypes: Water
        Image: bubbles
        Type: CenterPosition
        Offsets: -50,0,-50
        MovingInterval: 3
        
THF:
    Mobile:
        Locomotor: footboat
    GrantConditionOnTerrain:
        Condition: swimming
        TerrainTypes: Water
    Targetable@WATER:
        TargetTypes: Water
        RequiresCondition: swimming
    Cloak:
        PauseOnCondition: cloak-force-disabled || swimming
    Captures:
        CaptureTypes: vehicle, ship
    LeavesTrails:
        TerrainTypes: Water
        Image: bubbles
        Type: CenterPosition
        Offsets: -50,0,-50
        MovingInterval: 2
        
^Ship:
    Mobile:
        PauseOnCondition: being-captured
    CaptureManager:
        BeingCapturedCondition: being-captured
    Capturable:
        Types: vehicle
        CancelActivity: True
    CaptureNotification:
        Notification: UnitStolen
        LoseNotification: UnitLost
        
E7:
    Mobile:
        Locomotor: navalfoot
    GrantConditionOnTerrain:
        Condition: swimming
        TerrainTypes: Water
    Targetable@WATER:
        TargetTypes: Water
        RequiresCondition: swimming
    WithInfantryBody:
        RequiresCondition: !swimming
    WithInfantryBody@SEA:
        RequiresCondition: swimming
        MoveSequence: swim
        DefaultAttackSequence: swim_shoot
        IdleSequences: swim_idle
        StandSequences: swim_stand
    WithDeathAnimation:
        RequiresCondition: !swimming
        
SPY:
    Mobile:
        Locomotor: footboat
    GrantConditionOnTerrain:
        Condition: swimming
        TerrainTypes: Water
    Targetable@WATER:
        TargetTypes: Water
        RequiresCondition: swimming
    LeavesTrails:
        TerrainTypes: Water
        Image: bubbles
        Type: CenterPosition
        Offsets: -50,0,-50
        MovingInterval: 3
   # WithDisguisingInfantryBody:
   #     RequiresCondition: swimming
   #     MoveSequence: run
   #      (tanya && !swimming) || !tanya
   # WithDisguisingInfantryBody@SWIMMING:
   #     RequiresCondition: !testest
   #     MoveSequence: swim
   #     DefaultAttackSequence: swim_shoot
   #     IdleSequences: swim_idle
   #     StandSequences: swim_stand
   # Disguise:
   #     DisguisedAsConditions:
   #         e7: tanya
   # MNLY.Sea:
   #     RenderSprites:
   #         Image: MNLY.Sea   
   
MINV:
    ConditionManager:
    Targetable@WATER:
        TargetTypes: Water
        RequiresCondition: water
    GrantConditionOnTerrain:
        Condition: water
        TerrainTypes: Water
    WithCrateBody:
        WaterSequence: float
    Explodes:
        RequiresCondition: !water
    Explodes@WATER:
        Weapon: AGMine
        RequiresCondition: water
        
MSUB:
    AttackFrontal:
        ForceFireIgnoresActors: False
        
TURRSUB:
    Inherits: ^Ship
    Buildable:
        Queue: Ship
        BuildAtProductionType: Submarine
        BuildPaletteOrder: 11
        IconPalette: chrometd
        Prerequisites: ~spen, ~techlevel.low
        Description: Infantry transport submarine.\n  Unarmed\n  Special Ability: Submerge
    Valued:
        Cost: 400
    Tooltip:
        Name: Submersible
    Health:
        HP: 35000
    Armor:
        Type: Light
    Mobile:
        TurnSpeed: 4
        Speed: 100
        PauseOnCondition: notmobile || being-captured
    RevealsShroud:
        Range: 8c0
        RevealGeneratedShroud: False
    RevealsShroud@GAPGEN:
        Range: 5c0
    Targetable:
        TargetTypes: Ground, Water, Ship, Submarine, Repair
        RequiresCondition: !underwater
    Targetable@UNDERWATER:
        TargetTypes: Underwater, Submarine
        RequiresCondition: underwater
    Cargo:
        Types: Infantry
        MaxWeight: 9
        PipCount: 9
        PassengerFacing: 0
        LoadingCondition: notmobile
    Cloak:
        CloakTypes: Underwater
        InitialDelay: 0
        CloakDelay: 50
        CloakSound: subshow1.aud
        UncloakSound: subshow1.aud
        CloakedCondition: underwater
        Palette: submerged
        PauseOnCondition: notmobile || being-captured || cloak-force-disabled
    GrantConditionOnDamageState@UNCLOAK:
        Condition: cloak-force-disabled
        ValidDamageStates: Critical
    Selectable:
        Bounds: 38,38
    DetectCloaked:
        CloakTypes: Underwater
        Range: 4c0
    RenderSprites:
        Image: naval/shp/turrsub
        PlayerPalette: playertd