[Template JPNCorpsHQ Template=AAJPNBuildingPackableCorpHQ]
{
	IDS = jpn2_corps
	name = "#jpn2_corps_name"	
	editor_name = "#jpn2_corps_editor_name"

	show_faction_portrait = true

	[BodyComponent]
	health = 60000
	defense = 10

	[DefenderComponent]
	{
		control_range = 20
	
		[Ability Template=AATurretAttackLocal]
		{
			turret_ids = Turret
			
			[AbilityDefinition Template=AAInfantryMG]
			{
				name = "#jpn_corps2_DefenderComponent_AbilityDefinition_name"
				area = 2
				attenuation_range_min = 0.5
				attenuation_factor_max = 0.5
				max_targets = 4

				recharge_time = 2
				range = 16
				
				[Effect Template=PierceDamageEffect]
				amount = 70
				
				[WhenDo template=FXC_PlaySFX]	
				audio_ids = usa_mg_heavy
				
				[Flags]
				spell = true				
			}
		}
	}
	
	[DenizenComponent]
	{
		[DeploymentInfo]
		{
			creation_offset = 0.0, 0.3
			deployment_offset = -10.0, 0.3
		}
	}

	[DetectionComponent Template=HQDetectionComponent]

	[EconomyComponent]
	{
		[Cost]
		money = 500

		[Upkeep]
		building_limit_consumed = 1
		
		[Production]
		money = 100
		ammo = 200
		oil = 200
	}

	[PerformerComponent]
	{
		[Turret]
		{
			turret_ids = Turret
			yaw_rotation_per_sec_degrees = 60
			yaw_rotation_range_degrees = 360
			yaw_start_degrees = 0
			;offset = -3.801, 3.472
		}
	}
	
	[PropertiesComponent]
	{	
		[Property]
		property_IDS = corpshq	
		
		[Property]
		property_ids = nation_jpn		

		[Property]
		property_IDS = economic_building

		[Property]
		property_ids = money
		
		[Property]
		property_ids = mg		
	}	
	
	[ResearchComponent]
	{
		[ResearchItem]
		{
			property_IDS = tech_foraging
			type = GLOBAL
			research_time = 60
		
			[ResearchCost Template=CostList]
			{
				money = 75
			}
		}
		
		[ResearchItem]
		{
			property_IDS = tech_improved_logistics
			type = GLOBAL	
			research_time = 60
		
			[ResearchCost Template=CostList]
			{
				money = 50
			}
		}

		[ResearchItem]
		{
			property_IDS = tech_sniper_rifle
			type = GLOBAL	
			research_time = 60
		
			[ResearchCost Template=CostList]
			{
				money = 100
			}
		}

		[ResearchItem]
		{
			property_IDS = tech_special_forces
			type = GLOBAL	
			research_time = 60
		
			[ResearchCost Template=CostList]
			{
				money = 100
			}
		}		
		
	}	

	[Size]
	{
		blocking_shape = SQUARE
		square_size = 10
	}

	[SupplyComponent Template=HQSupplyComponent]
	{
		is_relay = false	
	}

	[View]
	{
		minimap_icon = /Minimap/Icons/IconCorpsHQ.tga
		resource_prefix = JPNCorps/JPNCorps
		icon = /UI/Game/BuildingButtons/IconCorps.png
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = jpn_waving_flag_pole
			location = building_flag
		}

		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = ground_corps_dirt
			terrain_group_filter = dirt
		}
				
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = ground_corps_desert
			terrain_group_filter = desert
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = ground_corps_snow
			terrain_group_filter = snow
		}

		[WhenSelected Template=FXC_PlaySFX]
		{
			audio_ids = corps_select
		}
		
		;;------ Spot Lights --------------------
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = spotlight_03
			location = spotlight_ae_01
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = spotlight_02
			location = spotlight_ae_02
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = spotlight_02_bright
			location = spotlight_ae_03
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = window_tiny
			location = window_01
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = window_tiny
			location = window_02
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = window_tiny
			location = window_03
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = window_tiny
			location = window_04
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = window_tiny
			location = window_05
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = window_tiny
			location = window_06
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = window_tiny
			location = window_07
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = window_tiny
			location = window_08
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = window_thin
			location = window_09
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = window_thin
			location = window_10
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = window_thin
			location = window_11
			attached = true
		}
		
		[WhenConstructed Template=FXC_CreateVFX]
		{
			vfx_ids = window_thin
			location = window_12
			attached = true
		}
	}	
}

;; NORMAL

[Thing Template=JPNcorpsHQ]
{
	IDS = jpn2_corps
	name = "#jpn2_corps_Thing_name"
	editor_name = "#jpn2_corps_Thing_editor_name"
	
	[PropertiesComponent]
	{
		[Property]
		property_ids = mechhqproduction
		
		[Property]
		property_ids = armorhqproduction

		[Property]
		property_ids = air_support
	}

	[RecruitComponent]
	{
		[RecruitActor]
		actor_ids = regiment_jpn_hq_infantry

		[RecruitActor]
		actor_ids = regiment_jpn_hq_airborne

		[RecruitActor]
		actor_ids = regiment_jpn_hq_armor

		[RecruitActor]
		actor_ids = jpn_truck_engineer
		
		[RecruitActor]
		actor_ids = jpn_truck_motor

		[RecruitActor]
		actor_ids = jpn_truck_artillery
		
		[RecruitActor]
		actor_ids = jpn_truck_airfield

		[RecruitActor]
		actor_ids = jpn_truck_tacairfield

		[RecruitActor]
		actor_ids = jpn_truck_ammo
		
		[RecruitActor]
		actor_ids = jpn_truck_oil
	}	
}

;; DYNAMIC CAMPAIGN

[Thing Template=JPNcorpsHQ]
{
	IDS = jpn2_corps_dynamic
	name = "#jpn2_corps_dynamic_name"
	editor_name = "#jpn2_corps_dynamic_editor_name"

	[PropertiesComponent]
	{
		[Property]
		property_ids = mechhqproduction
		
		[Property]
		property_ids = armorhqproduction
	}


	[Placement]
	placement_group_ids = null

	[RecruitComponent]
	{

		[RecruitActor]
		actor_ids = regiment_jpn_hq_infantry

		[RecruitActor]
		actor_ids = regiment_jpn_hq_airborne

		[RecruitActor]
		actor_ids = regiment_jpn_hq_mechanized

		[RecruitActor]
		actor_ids = regiment_jpn_hq_armor

		[RecruitActor]
		actor_ids = jpn_truck_engineer
		
		[RecruitActor]
		actor_ids = jpn_truck_motor

		[RecruitActor]
		actor_ids = jpn_truck_artillery
		
		[RecruitActor]
		actor_ids = jpn_truck_airfield

		[RecruitActor]
		actor_ids = jpn_truck_tacairfield

		[RecruitActor]
		actor_ids = jpn_truck_ammo
		
		[RecruitActor]
		actor_ids = jpn_truck_oil
	}
}