﻿INJECT:building_government_administration = {
	ai_value = {
		# KAI: Excess bureaucracy should have lower priority than everything else
		value = 250

		# KAI: Prioritize states with insufficient tax capacity
		if = {
			limit = {
				is_incorporated = yes
			}
			add = {
				value = 30
				multiply = {
					# Scale inversely with surplus from 5 to 30
					value = tax_capacity_usage
					subtract = tax_capacity
					add = 30
				}
				min = 0
				max = 750
			}
		}
	}
}

INJECT:building_construction_sector = {
	ai_value = {
		value = 1000

		# KAI: Prefer states with iron
		if = {
			limit = {
				state_population >= 250000
				has_potential_resource = building_iron_mine
			}
			add = 500
		}
	}
}

INJECT:building_power_bloc_statue = {
	ai_value = {
		value = 0

		if = {
			limit = {
				is_incorporated = yes
				state_population >= 500000
			}

			add = {
				value = state_population
				divide = 2500
				max = 5000
			}
		}

		if = {
			limit = { is_capital = yes }
			add = 2500
		}

		owner = {
			if = {
				limit = { is_power_bloc_leader = yes }
				multiply = 2.0
			}

			if = {
				limit = { country_rank < rank_value:major_power }
				multiply = 0.0
			}
			else_if = {
				limit = { country_rank < rank_value:great_power }
				multiply = 0.5
			}
		}

		if = {
			limit = {
				not = { has_game_rule = allow_monument_effects }
			}
			multiply = 0
		}
	}
}
