[Template AARUSAttackBattleShipBombard Template=AAAttackBattleshipBombard]
{
	range = 200
	recharge_time = 18

	[Effect Template=BlastDamageEffect]
	amount = 15000

	[Effect Template=MoraleLossEffect]
	amount = 20.0
	
	[WhenDo template=FXC_CreateVFX]
	{
		VFX_IDS = temperate_large_explosion_1
		at = TARGET_GROUND
		attached = false
	}

	[WhenDo template=FXC_PlaySFX]
	audio_ids = battleship_cannon
}

[Template AARUSBattleShipAntiAirMG Inherit=AABunkerAttack]
{
	targets = +enemy, +air
	range = 30
	icon = /Properties/AbilityIcons/IconAbilityAntiAircraft.png

	[Flags]
	ignore_for_cv = true
	
	[WhenDo template=FXC_CreateVFX]
	{
		VFX_IDS = flak_shot_1
		at = TARGET_HIT_POSITION
		attached = false
		delay = 0.1
	}
	
	[WhenDo template=FXC_CreateVFX]
	{
		VFX_IDS = flak_shot_2
		at = TARGET_HIT_POSITION
		attached = false
		delay = 0.5
	}
	
	[WhenDo template=FXC_CreateVFX]
	{
		VFX_IDS = flak_shot_3
		at = TARGET_HIT_POSITION
		attached = false
		delay = 0.8
	}
}

[Template AARUSBattleship Template=AAUnitRUSSeaMajor]
{
	name = "#ger_itlbattleship_name"
	editor_name = "#ger_itlbattleship_editor_name"

	[BodyComponent]
	{
		health = 35000
		defense = 15
	}
	
	[PropertiesComponent]
	{
		[Property]
		property_IDS = artillery

		[Property]
		property_IDS = military_building

		[Property]
		property_ids = tech_battleship

		[Property]
		property_IDS = support
		
		[Property]
		property_IDS = combat_unit
	}

	[DetectionComponent]	
	{
		detection_range = 50
		remote_detection_range = 200
	}
	
	[EconomyComponent]
	{
		[Cost]
		money = 500

		[Upkeep]
		money = 50
		ammo = 50
		oil = 50	
		[Production]

		unit_limit_provided = 3
		
	}

	[PerformerComponent]
	{
		
		[Ability template=AATurretAttackLocal]
		{
			turret_ids = turret
			
			[AbilityDefinition Template=AARUSAttackBattleShipBombard]
			{				
				name = "#ger_itlbattleship_AbilityDefinition_name"
				
				[WhenDo template=FXC_CreateVFX]
				{
					VFX_IDS = artillery_shot ;replace with 3-barrel vfx
					location = cannon_ae_01
					attached = true
				}
				
				[WhenDo Template=FXC_PlayObjectAnimation]
				object_animation_IDS = Recoil1
			}
		}

		[Ability template=AATurretAttackLocal]
		{
			turret_ids = turret2
			
			[AbilityDefinition Template=AARUSAttackBattleShipBombard]
			{				
				name = "#ger_itlbattleship_AbilityDefinition_name_2"
				
				[WhenDo template=FXC_CreateVFX]
				{
					VFX_IDS = artillery_shot ;replace with 3-barrel vfx
					location = cannon_ae_02
					attached = true
				}
				
				[WhenDo Template=FXC_PlayObjectAnimation]
				object_animation_IDS = Recoil2
			}
		}

		[Ability template=AATurretAttackLocal]
		{
			turret_ids = turret3
						
			[AbilityDefinition Template=AARUSAttackBattleShipBombard]
			{				
				name = "#ger_itlbattleship_AbilityDefinition_name_3"
				
				[WhenDo template=FXC_CreateVFX]
				{
					VFX_IDS = artillery_shot ;replace with 3-barrel vfx
					location = cannon_ae_03
					attached = true
				}
				
				[WhenDo Template=FXC_PlayObjectAnimation]
				object_animation_IDS = Recoil3
			}
		}
		
		[Turret]
		{
			turret_ids = Turret
			yaw_rotation_per_sec_degrees = 15
			yaw_rotation_range_degrees = 270
			yaw_start_degrees = 0
			reset_time = 20
		}

		[Turret]
		{
			turret_ids = Turret2
			yaw_rotation_per_sec_degrees = 15
			yaw_rotation_range_degrees = 270
			yaw_start_degrees = 0
			reset_time = 20
		}

		[Turret]
		{
			turret_ids = Turret3
			yaw_rotation_per_sec_degrees = 15
			yaw_rotation_range_degrees = 270
			yaw_start_degrees = 180
			reset_time = 20
		}
		
		[Turret]
		{
			turret_ids = Turret4	
			;offset = 0.0,-0.0
			reset_time = 10
			
			yaw_start_degrees = 90
			yaw_rotation_range_degrees = 210
			yaw_rotation_per_sec_degrees = 180

			pitch_start_degrees = 25
			pitch_rotation_range_start_degrees = -90
			pitch_rotation_range_end_degrees = 90
			pitch_rotation_per_sec_degrees = 180
		}

		[Turret]
		{	
			turret_ids = Turret5	
			;offset = 0.0,-0.0
			reset_time = 10
			
			yaw_start_degrees = 270
			yaw_rotation_range_degrees = 210
			yaw_rotation_per_sec_degrees = 180

			pitch_start_degrees = 25
			pitch_rotation_range_start_degrees = -90
			pitch_rotation_range_end_degrees = 90
			pitch_rotation_per_sec_degrees = 180
		}
	}
	
	[DefenderComponent]
	{
		control_range = 30
		
		[Ability Template=AAAttackLocal]
		{		
			turret_ids = Turret4

	[AbilityDefinition Template=AARUSBattleShipAntiAirMG]

			{
				name = "#ger_itlbattleship_DefenderComponent_AbilityDefinition_name"
				recharge_time = 6
				range = 40
								
				[Effect Template=PierceDamageEffect]
				amount = 350
				
				;; TEMPORARY EFFECTS
				;;Muzzle flash effect
				[WhenDo template=FXC_CreateVFX]
				{
					VFX_IDS = aa_shot1
					;at = SELF
					attached = false
					delay = 0.05
					location = gun_ae_01
				}
				
				[WhenDo template=FXC_CreateVFX]
				{
					VFX_IDS = aa_shot1
					;at = SELF
					attached = false
					delay = 0.25
					location = gun_ae_01
				}
				
				[WhenDo template=FXC_CreateVFX]
				{
					VFX_IDS = aa_shot1
					;at = SELF
					attached = false
					delay = 0.5
					location = gun_ae_01
				}
				
				[WhenDo template=FXC_CreateVFX]
				{
					VFX_IDS = aa_shot1
					;at = SELF
					attached = false
					delay = 0.75
					location = gun_ae_01
				}
				
				;;Tracer effect for tommy gun
				[WhenDo Template=FXC_CreateVFX]
				{
					VFX_IDS = mg_shot_tracer
					attached = false
					frequency = 2
					delay = 0.05
					location = gun_ae_01
				}
			
				[WhenDo Template=FXC_CreateVFX]
				{
					VFX_IDS = mg_shot_tracer
					attached = false
					frequency = 2
					delay = 0.25
					location = gun_ae_01
				}
			
				[WhenDo Template=FXC_CreateVFX]
				{
					VFX_IDS = mg_shot_tracer
					attached = false
					frequency = 2
					delay = 0.5
					location = gun_ae_01
				}
				
				[WhenDo Template=FXC_CreateVFX]
				{
					VFX_IDS = mg_shot_tracer
					attached = false
					frequency = 2
					delay = 0.75
					location = gun_ae_01
				}

				[WhenDo Template=FXC_PlayObjectAnimation]
				object_animation_IDS = Recoil4
			}
		}
		
		[Ability Template=AAAttackLocal]
		{		
			turret_ids = Turret5

		[AbilityDefinition Template=AARUSBattleShipAntiAirMG]
			{
				name = "#ger_itlbattleship_DefenderComponent_AbilityDefinition_name_2"
				recharge_time = 6
				range = 40
								
				[Effect Template=PierceDamageEffect]
				amount = 350
				
				;; TEMPORARY EFFECTS
				;;Muzzle flash effect
				[WhenDo template=FXC_CreateVFX]
				{
					VFX_IDS = aa_shot1
					;at = SELF
					attached = false
					delay = 0.05
					location = gun_ae_02
				}
				
				[WhenDo template=FXC_CreateVFX]
				{
					VFX_IDS = aa_shot1
					;at = SELF
					attached = false
					delay = 0.25
					location = gun_ae_02
				}
				
				[WhenDo template=FXC_CreateVFX]
				{
					VFX_IDS = aa_shot1
					;at = SELF
					attached = false
					delay = 0.5
					location = gun_ae_02
				}
				
				[WhenDo template=FXC_CreateVFX]
				{
					VFX_IDS = aa_shot1
					;at = SELF
					attached = false
					delay = 0.75
					location = gun_ae_02
				}
				
				;;Tracer effect for tommy gun
				[WhenDo Template=FXC_CreateVFX]
				{
					VFX_IDS = mg_shot_tracer
					attached = false
					frequency = 2
					delay = 0.05
					location = gun_ae_02
				}
			
				[WhenDo Template=FXC_CreateVFX]
				{
					VFX_IDS = mg_shot_tracer
					attached = false
					frequency = 2
					delay = 0.25
					location = gun_ae_02
				}
			
				[WhenDo Template=FXC_CreateVFX]
				{
					VFX_IDS = mg_shot_tracer
					attached = false
					frequency = 2
					delay = 0.5
					location = gun_ae_02
				}
				
				[WhenDo Template=FXC_CreateVFX]
				{
					VFX_IDS = mg_shot_tracer
					attached = false
					frequency = 2
					delay = 0.75
					location = gun_ae_02
				}

				[WhenDo Template=FXC_PlayObjectAnimation]
				object_animation_IDS = Recoil5
			}
		}
	}

	[Size]
	{
		height = 2

		blocking_shape = CIRCLE
		blocking_radius = 9

		soft_shape = CIRCLE
		soft_radius = 10.1
		
		target_shape = RECT
		target_rect_width = 4
		target_rect_height = 16
	}
	
	[View]
	{
		resource_prefix = GERITLBattleship/GERITLBattleship
		minimap_icon = /Minimap/Icons/IconBattleship.tga

		[Swivel]
		{
			swivel_node_ids = base
			swivel_inertia = .25
			spring_constant = .2
			swivel_mass = 8000
			recoil = false
			impact_sway = false
		}

		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = ger_waving_flag
			location = flag_dummy
		}

		[WhenSelected Template=FXC_PlaySFX]
		audio_ids = battleship_select
			
		[WhenCommanded Template=FXC_PlaySFX]
		audio_ids = battleship_move
			
		[WhenCommandedAggressive Template=FXC_PlaySFX]
		audio_ids = battleship_attack
		
		[AspectNormal]
		{						
			[Animation Template=ObjectAnimationCustomPlay]
			{
				ids = Recoil1
				length = 1
				kf = GERITLBattleship/GERITLBattleshipRecoil1.kf
			}
					
			[Animation Template=ObjectAnimationCustomPlay]
			{
				ids = Recoil2
				length = 1
				kf = GERITLBattleship/GERITLBattleshipRecoil2.kf
			}
						
			[Animation Template=ObjectAnimationCustomPlay]
			{
				ids = Recoil3
				length = 1
				kf = GERITLBattleship/GERITLBattleshipRecoil3.kf
			}
			
			[Animation Template=ObjectAnimationCustomPlay]
			{
				ids = Recoil4
				length = 1
				kf = GERITLBattleship/GERITLBattleshipRecoil4.kf
			}
						
			[Animation Template=ObjectAnimationCustomPlay]
			{
				ids = Recoil5
				length = 1
				kf = GERITLBattleship/GERITLBattleshipRecoil5.kf
			}
		}
	}
}

[Thing Template=AARUSBattleship]
{
	IDS = ger_itlbattleship

	[RecruitComponent]
	{	
		[RecruitActor]
		actor_ids = regiment_ger_infantry_amphib
		
		[RecruitActor]
		actor_ids = gerit_truck_corps_amphibious
	}
}

[Thing Template=AARUSBattleship]
{
	IDS = ger_itlbattleship_dynamic
	editor_name = "#ger_itlbattleship_dynamic_editor_name"

	[RecruitComponent]
	{	
		[RecruitActor]
		actor_ids = regiment_ger_infantry_amphib
		
		[RecruitActor]
		actor_ids = gerit_truck_corps_amphibious_dynamic
	}

	[Placement]
	placement_group_ids = null
}

