﻿warrior_temple = {
	audio_tier = 1
	is_special = yes
	is_foreign = no
	pop_type = soldiers
	max_levels = 1
	
	category = military_category
	
	employment_size = manpower_employment
	
	town = yes
	city = yes
	megalopolis = yes
	
	build_time = medium_soldier_building
	
	country_potential = {
		religion ?= religion:nahuatl
	}
	graphical_tags = { medium_religious }
	
	modifier = {
		local_clergy_estate_power = 0.1
		local_manpower = 0.01
		can_recruit_regiment_in_this_location = yes
	}
	
	raw_modifier = {
		local_may_build_nahuatl_units = yes
	}

	possible_production_methods = {
		nahuatl_warrior_building_maintenance
	}
	construction_demand = nahuatl_warrior_building_construction
}

armory = {
	audio_tier = 1
	is_foreign = no
	pop_type = soldiers
	max_levels = manpower_max_level
	
	category = military_category
	forbidden_for_estates = yes

	employment_size = manpower_employment
	
	town = yes
	city = yes
	megalopolis = yes
	
	important_for_AI = yes

	build_time = soldier_building
	
	obsolete = provincial_garrison
	obsolete = korean_barracks
	
	allow = {
		owner = { has_primary_or_accepted_culture = prev.dominant_culture }
	}
	remove_if = {
		NOT = { owner = { has_primary_or_accepted_culture = prev.location.dominant_culture } }
	}
	
	
	modifier = {
		local_manpower = 0.01
		can_recruit_regiment_in_this_location = yes
	}
	
		
	unique_production_methods = {
		armory_maintenance = {
			icon_type = goods
			icon = firearms
			firearms = 0.25
			leather = 0.25
			cloth = 0.10
			paper = 0.20
			weaponry = 0.3
			
			category = building_maintenance
		}

	}


	construction_demand = early_soldier_building_construction
}

training_fields = {
	audio_tier = 1
	is_foreign = no
	pop_type = soldiers
	max_levels = manpower_max_level
	
	category = military_category
	forbidden_for_estates = yes
	
	employment_size = manpower_employment
	
	rural_settlement = yes

	build_time = soldier_building
	important_for_AI = yes
	AI_ignore_available_worker_flag = yes #more important than some random RGO

	allow = {
		owner = { has_primary_or_accepted_culture = prev.dominant_culture }
	}
	remove_if = {
		NOT = { owner = { has_primary_or_accepted_culture = prev.location.dominant_culture } }
	}
	
	modifier = {
		local_manpower = 0.01
		can_recruit_regiment_in_this_location = yes
	}
	
	unique_production_methods = {
		training_fields_maintenance = {
			icon_type = goods
			icon = firearms
			firearms = 0.5
			leather = 0.5
			cloth = 0.10
			paper = 0.20
			weaponry = 0.5
			
			category = building_maintenance
		}

	}

	construction_demand = soldier_building_construction
}

barracks = {
	audio_tier = 2
	is_foreign = no
	pop_type = soldiers
	max_levels = manpower_max_level
	
	category = military_category
	forbidden_for_estates = yes

	employment_size = manpower_employment
	important_for_AI = yes
	
	town = yes
	city = yes
	megalopolis = yes
	
	obsolete = armory
	
	build_time = soldier_building
	
	allow = {
		owner = { has_primary_or_accepted_culture = prev.dominant_culture }
	}
	remove_if = {
		NOT = { owner = { has_primary_or_accepted_culture = prev.location.dominant_culture } }
	}

	modifier = {
		local_manpower = 0.015
		can_recruit_regiment_in_this_location = yes
		max_regiments_trained_at_same_time = 1
	}
	
	unique_production_methods = {
		barracks_maintenance = {
			icon_type = goods
			icon = firearms
			firearms = 1.0
			leather = 1.0
			cloth = 0.20
			paper = 0.40
			weaponry = 1.0
			
			category = building_maintenance
		}

	}

	construction_demand = soldier_building_construction
}

regimental_camp = {
	audio_tier = 2
	is_foreign = no
	pop_type = soldiers
	max_levels = manpower_max_level
	
	category = military_category
	forbidden_for_estates = yes
	important_for_AI = yes
	AI_ignore_available_worker_flag = yes #more important than some random RGO

	employment_size = manpower_employment
	
	obsolete = training_fields
	
	rural_settlement = yes

	build_time = soldier_building
	
	allow = {
		owner = { has_primary_or_accepted_culture = prev.dominant_culture }
	}
	remove_if = {
		NOT = { owner = { has_primary_or_accepted_culture = prev.location.dominant_culture } }
	}	

	modifier = {
		local_manpower = 0.02
		can_recruit_regiment_in_this_location = yes
	}
	
	unique_production_methods = {
		regimental_camp_maintenance = {
			icon_type = goods
			icon = firearms
			firearms = 1.0
			leather = 1.0
			cloth = 0.20
			paper = 0.40
			weaponry = 1.0
			
			category = building_maintenance
		}

	}

	construction_demand = soldier_building_construction
}

conscription_center = {
	audio_tier = 3
	is_foreign = no
	pop_type = soldiers
	max_levels = manpower_max_level
	important_for_AI = yes	
	employment_size = manpower_employment

	category = military_category
	forbidden_for_estates = yes
	
	obsolete = regimental_camp
	obsolete = barracks
	
	rural_settlement = yes
	town = yes
	city = yes
	megalopolis = yes
	
	build_time = soldier_building
	
	allow = {
		owner = { has_primary_or_accepted_culture = prev.dominant_culture }
	}
	remove_if = {
		NOT = { owner = { has_primary_or_accepted_culture = prev.location.dominant_culture } }
	}	

	modifier = {
		local_manpower = 0.025
		can_recruit_regiment_in_this_location = yes
		max_regiments_trained_at_same_time = 5
	}
	
	unique_production_methods = {
		conscription_center_maintenance = {
			icon_type = goods
			icon = firearms
			firearms = 1.0
			leather = 1.0
			cloth = 0.20
			paper = 0.50
			weaponry = 1.0
			
			category = building_maintenance
		}

	}

	construction_demand = soldier_building_construction
}

jurchen_barracks = {
	audio_tier = 1
	is_special = yes
	is_foreign = no
	pop_type = soldiers
	max_levels = 1
	
	category = military_category
	forbidden_for_estates = yes
	
	employment_size = manpower_employment
	
	town = yes
	city = yes
	megalopolis = yes
	rural_settlement = yes
	
	build_time = soldier_building
	
	allow = {
		dominant_culture = { has_culture_group = culture_group:jurchen_group }
	}
	remove_if = {
		location = {
			NOT = { 
				dominant_culture = { has_culture_group = culture_group:jurchen_group } 
			}
		}
	}
	
	
	modifier = {
		local_manpower = 0.0025
		can_recruit_regiment_in_this_location = yes
	}
	
	possible_production_methods = {
		jurchen_barracks_maintenance
	}
	construction_demand = early_soldier_building_construction
}

thema_headquarters = {
	audio_tier = 1
	is_special = yes
	is_foreign = no
	pop_type = soldiers
	max_levels = 1
	
	category = military_category
	
	employment_size = manpower_employment
	
	town = yes
	city = yes
	megalopolis = yes
	
	build_time = medium_soldier_building

	country_potential = {
		modifier:allow_thema_headquarters = yes
	}

	allow = { 
		is_province_capital = yes 
		owner = { modifier:allow_thema_headquarters = yes }
	}
	
	location_potential = { not = { is_capital = yes } }

	remove_if = {
		root.owner = { modifier:allow_thema_headquarters = no }
	}
	
	modifier = {
		local_manpower = 0.01
		can_recruit_regiment_in_this_location = yes
		local_crown_estate_power = -0.1
		local_levy_size_modifier = 0.1
	}

	possible_production_methods =  {
		early_soldier_building_maintenance
	}
	construction_demand = early_soldier_building_construction
}

