﻿# ================= INTEGRATION CHAIN =================
# Crown-built administrative offices that fold newly conquered (non-core)
# locations into the state. Staffed by bureaucrats. Three tiers, each one
# replacing the previous, and removed once the location becomes a core,
# since there is nothing left to integrate.
#
# Buildings apply *location*-scope modifiers, so the province-scope
# "province_integration_speed" cannot live on the building itself. The
# location-scope equivalent is local_integration_speed_modifier (the same
# "Speed of Integration" stat, applied per location).

integration_office = {
	audio_tier = 1
	is_foreign = no
	pop_type = bureaucrats
	max_levels = 1
	category = government_category
	employment_size = 0.25
	forbidden_for_estates = yes
	expensive = yes
	desc = "integration_office_desc"
	price = integration_office

	rural_settlement = yes
	town = yes
	city = yes
	megalopolis = yes

	location_potential = {
		NOT = { is_core_of = owner }
		province = {
			NOT = {
				any_location_in_province = { has_building = building_type:integration_office }
				any_location_in_province = { has_building = building_type:integration_chancery }
				any_location_in_province = { has_building = building_type:integration_ministry }
			}
		}
	}
	remove_if = {
		location = { is_core_of = owner }
	}

	modifier = {
		local_integration_speed_modifier = 0.50
		local_separatism = -0.02
		local_unrest = -0.01
		local_bureaucrats_desired_pop_scaled = 0.001
	}

	unique_production_methods = {
		integration_office_maintenance = {
			icon_type = goods
			icon = paper
			paper = 0.3
			books = 0.15
			tools = 0.2
			furniture = 0.2
			fine_cloth = 0.1
			category = building_maintenance
		}
	}

	graphical_tags = { palace }
	build_time = government_build_time
	construction_demand = town_building_construction
}

integration_chancery = {
	audio_tier = 2
	is_foreign = no
	pop_type = bureaucrats
	max_levels = 1
	category = government_category
	employment_size = 0.5
	forbidden_for_estates = yes
	expensive = yes
	desc = "integration_chancery_desc"
	price = integration_chancery
	obsolete = integration_office

	rural_settlement = yes
	town = yes
	city = yes
	megalopolis = yes

	location_potential = {
		NOT = { is_core_of = owner }
		has_building = building_type:integration_office
		province = {
			NOT = {
				any_location_in_province = { has_building = building_type:integration_chancery }
				any_location_in_province = { has_building = building_type:integration_ministry }
			}
		}
	}
	remove_if = {
		location = { is_core_of = owner }
	}

	modifier = {
		local_integration_speed_modifier = 1.0
		local_monthly_development = 0.005
		local_separatism = -0.04
		local_unrest = -0.02
		local_bureaucrats_desired_pop_scaled = 0.0025
	}

	unique_production_methods = {
		integration_chancery_maintenance = {
			icon_type = goods
			icon = paper
			paper = 0.6
			books = 0.3
			tools = 0.4
			furniture = 0.4
			fine_cloth = 0.2
			category = building_maintenance
		}
	}

	graphical_tags = { palace }
	build_time = government_build_time
	construction_demand = town_building_construction
}

integration_ministry = {
	audio_tier = 3
	is_foreign = no
	pop_type = bureaucrats
	max_levels = 1
	category = government_category
	employment_size = 0.75
	forbidden_for_estates = yes
	expensive = yes
	desc = "integration_ministry_desc"
	price = integration_ministry
	obsolete = integration_chancery

	rural_settlement = yes
	town = yes
	city = yes
	megalopolis = yes

	location_potential = {
		NOT = { is_core_of = owner }
		has_building = building_type:integration_chancery
		province = {
			NOT = {
				any_location_in_province = { has_building = building_type:integration_ministry }
			}
		}
	}
	remove_if = {
		location = { is_core_of = owner }
	}

	modifier = {
		local_integration_speed_modifier = 2.0
		local_monthly_development = 0.01
		local_separatism = -0.06
		local_unrest = -0.03
		local_bureaucrats_desired_pop_scaled = 0.005
	}

	unique_production_methods = {
		integration_ministry_maintenance = {
			icon_type = goods
			icon = paper
			paper = 1.0
			books = 0.5
			tools = 0.6
			furniture = 0.6
			fine_cloth = 0.35
			category = building_maintenance
		}
	}

	graphical_tags = { palace }
	build_time = government_build_time
	construction_demand = town_building_construction
}
