##########
# Duchy Capital Buildings
# These are built in the first barony of the first county of any duchy
# Holding the associated duchy is required both to build, and for the buildings to be enabled
##########

# SPECIAL DUCHY BUILDINGS
# We place these at the top to make them more visible in the building interface.


##################
# Tower of Silence
##################
tower_of_silence_01 = {

	construction_time = slow_construction_time

	type_icon = "icon_building_tower_of_silence.dds"

	can_construct_potential = {
		building_requirement_tribal = no
		building_requirement_castle_city_church = { LEVEL = 01 }
		scope:holder = {
			faith = { has_doctrine_parameter = can_build_towers_of_silence_active }
		}
	}

	is_enabled = {
		custom_tooltip = {
			text = tower_of_silence_01.tt.county_not_tos_users
			county.faith = { has_doctrine_parameter = can_build_towers_of_silence_active }
		}
		custom_tooltip = {
			text = tower_of_silence_01.tt.liege_not_approve_of_burial
			scope:holder.liege ?= {
				faith = {
					NOT = { has_doctrine_parameter = can_build_towers_of_silence_active }
				}
			}
		}
		county.holder = {
			has_title = prev.duchy
			faith = { has_doctrine_parameter = can_build_towers_of_silence_active }
		}
	}
	show_disabled = yes

	cost_gold = expensive_building_tier_5_cost

	character_modifier = {
		same_faith_opinion = 10
		zealot_opinion = 10
		zealot_tax_contribution_mult = 0.2
		zealot_levy_contribution_mult = 0.2
		monthly_piety = 1
		owned_legend_spread_mult = 0.2
		legitimacy_gain_mult = 0.3
	}

	duchy_capital_county_modifier = {
		county_opinion_add = 30
		monthly_county_control_growth_add = 0.25
		epidemic_resistance = 10
	}

	ai_value = {
		base = 100
		# Fill all building slots before going for duchy buildings
		modifier = {
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}

	type = duchy_capital

	flag = fully_upgraded_duchy_capital_building
}

###################
# Charnel Grounds #
###################

charnel_grounds_01 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
		faith = {
			has_doctrine_parameter = sky_burials_active
		}
	}
	
	can_construct_showing_failures_only = {
		faith = {
			has_doctrine_parameter = sky_burials_active
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}

	show_disabled = no
	
	cost_gold = expensive_building_tier_3_cost
	
	duchy_capital_county_modifier = {
		county_opinion_add = 5
		epidemic_resistance = 10
	}
	character_modifier = {
		monthly_piety = 0.1
		stress_gain_mult = -0.1
		clergy_opinion = 5
	}

	next_building = charnel_grounds_02

	type_icon = "icon_building_tower_of_silence_2.dds"
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
	}
}

charnel_grounds_02 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
		faith = {
			has_doctrine_parameter = sky_burials_active
		}
	}
	
	can_construct_showing_failures_only = {
		faith = {
			has_doctrine_parameter = sky_burials_active
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}

	show_disabled = no
	
	cost_gold = expensive_building_tier_4_cost
	
	duchy_capital_county_modifier = {
		county_opinion_add = 10
		epidemic_resistance = 15
	}
	character_modifier = {
		monthly_piety = 0.2
		stress_gain_mult = -0.15
		negate_health_penalty_add = 0.05
		clergy_opinion = 10
	}
	
	next_building = charnel_grounds_03
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

charnel_grounds_03 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
		faith = {
			has_doctrine_parameter = sky_burials_active
		}
	}
	
	can_construct_showing_failures_only = {
		faith = {
			has_doctrine_parameter = sky_burials_active
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}

	show_disabled = no
	
	cost_gold = expensive_building_tier_5_cost
	
	duchy_capital_county_modifier = {
		county_opinion_add = 15
		epidemic_resistance = 20
	}
	character_modifier = {
		monthly_piety = 0.3
		stress_gain_mult = -0.2
		negate_health_penalty_add = 0.1
		clergy_opinion = 15
	}
	
	type = duchy_capital
	
	flag = fully_upgraded_duchy_capital_building
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

##################
### Graveyards ###
##################

burial_site_01 = {
	construction_time = slow_construction_time
	
	type_icon = "icon_building_graveyard.dds"

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
		scope:holder = { has_dlc_feature = legends_of_the_dead }
	}

	can_construct_showing_failures_only = {
		culture = {
			has_innovation = innovation_manorialism
		}
	}

	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes

	cost_gold = expensive_building_tier_3_cost

	character_modifier = {
		monthly_piety = 0.3
		court_grandeur_baseline_add = 2
		owned_legend_spread_mult = 0.2
		legitimacy_gain_mult = 0.1
	}
	duchy_capital_county_modifier = {
		monthly_county_control_growth_factor = 0.1
		county_opinion_add = 5
		epidemic_resistance = 20
	}

	next_building = burial_site_02

	type_icon = "icon_building_graveyard.dds"

	type = duchy_capital

	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
}

burial_site_02 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
		scope:holder = { has_dlc_feature = legends_of_the_dead }
	}

	can_construct_showing_failures_only = {
		culture = {
			has_innovation = innovation_windmills
		}
	}

	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes

	cost_gold = expensive_building_tier_4_cost

	character_modifier = {
		monthly_piety = 0.5
		court_grandeur_baseline_add = 4
		owned_legend_spread_mult = 0.3
		legitimacy_gain_mult = 0.15
	}
	duchy_capital_county_modifier = {
		county_opinion_add = 10
		monthly_county_control_growth_factor = 0.2
		epidemic_resistance = 30
	}

	next_building = burial_site_03

	type = duchy_capital

	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

burial_site_03 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
		scope:holder = { has_dlc_feature = legends_of_the_dead }
	}

	can_construct_showing_failures_only = {
		culture = {
			has_innovation = innovation_cranes
		}
	}

	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes

	cost_gold = expensive_building_tier_5_cost

	character_modifier = {
		monthly_piety = 1
		court_grandeur_baseline_add = 6
		owned_legend_spread_mult = 0.4
		legitimacy_gain_mult = 0.2
	}
	duchy_capital_county_modifier = {
		county_opinion_add = 10
		monthly_county_control_growth_factor = 0.4
		epidemic_resistance = 40
	}

	type = duchy_capital

	flag = fully_upgraded_duchy_capital_building

	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

###############
### Regular ###
###############
royal_garden_01 = {
	construction_time = slow_construction_time
	effect_desc = royal_garden_effect_desc

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
		county.holder.culture = { has_cultural_parameter = enable_garden_duchy_building }
		NOR = {
			terrain = desert_mountains
			terrain = mountains
			terrain = wetlands
		}
	}
	
	can_construct_showing_failures_only = {
		culture = {
			has_innovation = innovation_manorialism
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_3_cost
	
	character_modifier = {
		monthly_prestige_gain_mult = 0.05
		stress_gain_mult = -0.10
		#Add a court grandeur bonus
		court_grandeur_baseline_add = 4
		#character_capital_county_monthly_development_growth_add = 0.2
	}
	duchy_capital_county_modifier = {
		county_opinion_add = 5
	}
	province_modifier = {
		monthly_income = good_building_tax_tier_2
	}
	
	next_building = royal_garden_02

	type_icon = "icon_building_royal_gardens.dds"
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
}

royal_garden_02 = {
	construction_time = slow_construction_time
	effect_desc = royal_garden_effect_desc

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		county.holder.culture = { has_cultural_parameter = enable_garden_duchy_building }
		culture = { has_innovation = innovation_windmills }
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_4_cost
	
	character_modifier = {
		monthly_prestige_gain_mult = 0.10
		stress_gain_mult = -0.20
		#Add a court grandeur bonus
		court_grandeur_baseline_add = 8
		#character_capital_county_monthly_development_growth_add = 0.4
	}
	duchy_capital_county_modifier = {
		county_opinion_add = 10
	}
	province_modifier = {
		monthly_income = good_building_tax_tier_3
	}
	
	next_building = royal_garden_03
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

royal_garden_03 = {
	construction_time = slow_construction_time
	effect_desc = royal_garden_effect_desc

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		county.holder.culture = { has_cultural_parameter = enable_garden_duchy_building }
		culture = { has_innovation = innovation_cranes }
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_5_cost
	
	character_modifier = {
		monthly_prestige_gain_mult = 0.15
		stress_gain_mult = -0.30
		#Add a court grandeur bonus
		court_grandeur_baseline_add = 12
		#character_capital_county_monthly_development_growth_add = 0.6
	}
	duchy_capital_county_modifier = {
		county_opinion_add = 15
	}
	province_modifier = {
		monthly_income = good_building_tax_tier_4
	}
	
	type = duchy_capital
	
	flag = fully_upgraded_duchy_capital_building
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

# REGULAR DUCHY BUILDINGS

military_academy_01 = {
	construction_time = slow_construction_time
	effect_desc = academies_effect_desc

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_burhs
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_3_cost
	
	character_modifier = {
		knight_limit = 2
		knight_effectiveness_mult = 0.25
		army_maintenance_mult = -0.025
		men_at_arms_recruitment_cost = -0.1
		men_at_arms_limit = 1
	}
	
	next_building = military_academy_02
	
	type_icon = "icon_building_military_academy.dds"

	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
}

military_academy_02 = {
	construction_time = slow_construction_time
	effect_desc = academies_effect_desc

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_castle_baileys
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_4_cost
	
	character_modifier = {
		knight_limit = 4
		knight_effectiveness_mult = 0.5
		army_maintenance_mult = -0.035
		men_at_arms_recruitment_cost = -0.2
		men_at_arms_limit = 2
	}
	
	next_building = military_academy_03
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

military_academy_03 = {
	construction_time = slow_construction_time
	effect_desc = academies_effect_desc

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_royal_armory
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_5_cost
	
	character_modifier = {
		knight_limit = 6
		knight_effectiveness_mult = 0.75
		army_maintenance_mult = -0.05
		men_at_arms_recruitment_cost = -0.3
		men_at_arms_limit = 3
	}
	
	type = duchy_capital
	
	flag = fully_upgraded_duchy_capital_building

	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

march_01 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_burhs
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_3_cost
	
	duchy_capital_county_modifier = {
		supply_limit_mult = 0.25
		levy_reinforcement_rate = 0.25
		garrison_size = 0.25
		hostile_raid_time = 0.2
		defender_holding_advantage = 5
		additional_fort_level = normal_building_fort_level_tier_2
		travel_danger = -10
		mountains_tax_mult = 0.15
		desert_mountains_tax_mult = 0.15
		hills_tax_mult = 0.15
	}
	
	next_building = march_02

	type_icon = "icon_building_march.dds"
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		culture_likely_to_fortify_modifier = yes
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
}

march_02 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_castle_baileys
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_4_cost
	
	duchy_capital_county_modifier = {
		supply_limit_mult = 0.5
		levy_reinforcement_rate = 0.5
		garrison_size = 0.5
		hostile_raid_time = 0.3
		defender_holding_advantage = 10
		additional_fort_level = normal_building_fort_level_tier_4
		travel_danger = -20
		mountains_tax_mult = 0.2
		desert_mountains_tax_mult = 0.2
		hills_tax_mult = 0.2
	}
	
	next_building = march_03
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		culture_likely_to_fortify_modifier = yes
	}
}

march_03 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_royal_armory
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_5_cost
	
	duchy_capital_county_modifier = {
		supply_limit_mult = 1
		levy_reinforcement_rate = 1
		garrison_size = 1
		hostile_raid_time = 0.4
		defender_holding_advantage = 15
		additional_fort_level = normal_building_fort_level_tier_6
		travel_danger = -30
		mountains_tax_mult = 0.3
		desert_mountains_tax_mult = 0.3
		hills_tax_mult = 0.3
	}
	
	type = duchy_capital
	
	flag = fully_upgraded_duchy_capital_building
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		culture_likely_to_fortify_modifier = yes
	}
}

siege_works_01 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_burhs
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_3_cost
	
	character_modifier = {
		siege_weapon_recruitment_cost_mult = -0.15
		siege_weapon_maintenance_mult = -0.15
	}
	province_modifier = {
		stationed_siege_weapon_siege_value_mult = very_high_maa_siege_value_tier_1
		stationed_siege_weapon_toughness_add = 5
	}
	duchy_capital_county_modifier = {
		additional_fort_level = normal_building_fort_level_tier_2
	}
	
	next_building = siege_works_02

	type_icon = "icon_building_siege_works.dds"
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		culture_likely_to_fortify_modifier = yes
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
}

siege_works_02 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_castle_baileys
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_4_cost
	
	character_modifier = {
		siege_weapon_recruitment_cost_mult = -0.3
		siege_weapon_maintenance_mult = -0.3
	}
	
	province_modifier = {
		stationed_siege_weapon_siege_value_mult = very_high_maa_siege_value_tier_2
		stationed_siege_weapon_toughness_add = 10
	}
	duchy_capital_county_modifier = {
		additional_fort_level = normal_building_fort_level_tier_4
	}
	
	next_building = siege_works_03
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		culture_likely_to_fortify_modifier = yes
	}
}

siege_works_03 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_royal_armory
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_5_cost
	
	character_modifier = {
		siege_weapon_recruitment_cost_mult = -0.45
		siege_weapon_maintenance_mult = -0.45
	}
	
	province_modifier = {
		stationed_siege_weapon_siege_value_mult = very_high_maa_siege_value_tier_3
		stationed_siege_weapon_toughness_add = 15
	}
	duchy_capital_county_modifier = {
		additional_fort_level = normal_building_fort_level_tier_6
	}

	
	type = duchy_capital
	
	flag = fully_upgraded_duchy_capital_building
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		culture_likely_to_fortify_modifier = yes
	}
}

royal_armory_01 = {
	construction_time = slow_construction_time
	effect_desc = {
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }
			desc = tournament_melee_cost_discount_effect_toto_desc
		}
	}
	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_burhs
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_3_cost
	
	duchy_capital_county_modifier = {
		levy_size = 0.2
	}
	
	character_modifier = {
		army_maintenance_mult = -0.025
	}
	
	province_modifier = {
		stationed_maa_damage_mult = normal_maa_damage_tier_1
		stationed_maa_toughness_mult = normal_maa_toughness_tier_1
	}

	character_culture_modifier = {
		parameter = better_armory_buildings
		prowess = 2
		knight_effectiveness_mult = 0.15
	}

	duchy_capital_county_culture_modifier = {
		parameter = better_armory_buildings
		build_gold_cost = -0.1
		holding_build_gold_cost = -0.1
	}

	province_culture_modifier = {
		parameter = better_armory_buildings
		stationed_maa_damage_mult = normal_maa_damage_tier_1
		stationed_maa_toughness_mult = normal_maa_toughness_tier_1
	}
	
	next_building = royal_armory_02

	type_icon = "icon_building_royal_armory.dds"
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
}

royal_armory_02 = {
	construction_time = slow_construction_time
	effect_desc = {
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }
			desc = tournament_activity_cost_max_discount_effect_desc
		}
	}

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_castle_baileys
		}
	}

	character_culture_modifier = {
		parameter = better_armory_buildings
		prowess = 3
		knight_effectiveness_mult = 0.3
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_4_cost
	
	duchy_capital_county_modifier = {
		levy_size = 0.3
	}
	
	character_modifier = {
		army_maintenance_mult = -0.05
	}
	
	province_modifier = {
		stationed_maa_damage_mult = normal_maa_damage_tier_2
		stationed_maa_toughness_mult = normal_maa_toughness_tier_2
	}

	duchy_capital_county_culture_modifier = {
		parameter = better_armory_buildings
		build_gold_cost = -0.15
		holding_build_gold_cost = -0.15
	}

	province_culture_modifier = {
		parameter = better_armory_buildings
		stationed_maa_damage_mult = normal_maa_damage_tier_2
		stationed_maa_toughness_mult = normal_maa_toughness_tier_2
	}
	
	next_building = royal_armory_03
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

royal_armory_03 = {
	construction_time = slow_construction_time
	effect_desc = {
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }
			desc = tournament_activity_cost_max_discount_effect_desc
		}
	}
	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_royal_armory
		}
	}

	character_culture_modifier = {
		parameter = better_armory_buildings
		prowess = 4
		knight_effectiveness_mult = 0.45
	}
	
	duchy_capital_county_culture_modifier = {
		parameter = better_armory_buildings
		build_gold_cost = -0.2
		holding_build_gold_cost = -0.2
	}
	
	character_modifier = {
		army_maintenance_mult = -0.1
	}
	
	province_modifier = {
		stationed_maa_damage_mult = normal_maa_damage_tier_3
		stationed_maa_toughness_mult = normal_maa_toughness_tier_3
	}

	province_culture_modifier = {
		parameter = better_armory_buildings
		stationed_maa_damage_mult = normal_maa_damage_tier_3
		stationed_maa_toughness_mult = normal_maa_toughness_tier_3
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_5_cost
	
	duchy_capital_county_modifier = {
		levy_size = 0.4
	}
	
	type = duchy_capital
	
	flag = fully_upgraded_duchy_capital_building
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

jousting_lists_01 = {
	construction_time = slow_construction_time
	effect_desc = {
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }
			desc = unlocks_building_desc
		}
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }	
			desc = tournament_horse_cost_discount_effect_toto_desc
		}
	}
	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_burhs
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_3_cost
	
	character_modifier = {
		men_at_arms_maintenance = -0.06
	}
	
	province_modifier = {
		stationed_heavy_cavalry_damage_mult = very_high_maa_damage_tier_1
		stationed_heavy_cavalry_toughness_mult = very_high_maa_toughness_tier_1
		stationed_heavy_cavalry_screen_mult = very_high_maa_screen_tier_1
		stationed_heavy_cavalry_pursuit_mult = very_high_maa_pursuit_tier_1
		stationed_light_cavalry_damage_mult = high_maa_damage_tier_1
		stationed_light_cavalry_toughness_mult = high_maa_toughness_tier_1
		stationed_light_cavalry_screen_mult = high_maa_screen_tier_1
		stationed_light_cavalry_pursuit_mult = high_maa_pursuit_tier_1
		stationed_elephant_cavalry_damage_mult = very_high_maa_damage_tier_1
		stationed_elephant_cavalry_toughness_mult = very_high_maa_toughness_tier_1
		stationed_camel_cavalry_damage_mult = high_maa_damage_tier_1
		stationed_camel_cavalry_toughness_mult = high_maa_toughness_tier_1
		stationed_camel_cavalry_screen_mult = high_maa_screen_tier_1
		stationed_camel_cavalry_pursuit_mult = high_maa_pursuit_tier_1
	}
	
	next_building = jousting_lists_02

	type_icon = "icon_building_jousting_lists.dds"
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		ai_anti_synergy_armored_infantry_modifier = yes
		ai_anti_synergy_light_infantry_modifier = yes
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		modifier = { # Don't build unsuitable MaA-boosting duchy buildings
			factor = 0
			scope:holder = {
				NOR = {
					number_maa_regiments_of_base_type = {
						type = heavy_cavalry
						value > 0
					}
					number_maa_regiments_of_base_type = {
						type = light_cavalry
						value > 0
					}
					number_maa_regiments_of_base_type = {
						type = elephant_cavalry
						value > 0
					}
					number_maa_regiments_of_base_type = {
						type = camel_cavalry
						value > 0
					}
				}
			}
		}
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
}

jousting_lists_02 = {
	construction_time = slow_construction_time
	effect_desc = {
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }
			desc = unlocks_building_desc
		}
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }	
			desc = tournament_horse_cost_discount_effect_toto_desc
		}
	}
	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_castle_baileys
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_4_cost
	
	character_modifier = {
		men_at_arms_maintenance = -0.08
	}
	
	province_modifier = {
		stationed_heavy_cavalry_damage_mult = very_high_maa_damage_tier_2
		stationed_heavy_cavalry_toughness_mult = very_high_maa_toughness_tier_2
		stationed_heavy_cavalry_screen_mult = very_high_maa_screen_tier_2
		stationed_heavy_cavalry_pursuit_mult = very_high_maa_pursuit_tier_2
		stationed_light_cavalry_damage_mult = high_maa_damage_tier_2
		stationed_light_cavalry_toughness_mult = high_maa_toughness_tier_2
		stationed_light_cavalry_screen_mult = high_maa_screen_tier_2
		stationed_light_cavalry_pursuit_mult = high_maa_pursuit_tier_2
		stationed_elephant_cavalry_damage_mult = very_high_maa_damage_tier_2
		stationed_elephant_cavalry_toughness_mult = very_high_maa_toughness_tier_2
		stationed_camel_cavalry_damage_mult = high_maa_damage_tier_2
		stationed_camel_cavalry_toughness_mult = high_maa_toughness_tier_2
		stationed_camel_cavalry_screen_mult = high_maa_screen_tier_2
		stationed_camel_cavalry_pursuit_mult = high_maa_pursuit_tier_2
	}
	
	next_building = jousting_lists_03
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

jousting_lists_03 = {
	construction_time = slow_construction_time
	effect_desc = {
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }
			desc = unlocks_building_desc
		}
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }	
			desc = tournament_horse_cost_discount_effect_toto_desc
		}
	}
	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_royal_armory
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_5_cost
	
	character_modifier = {
		men_at_arms_maintenance = -0.1
	}
	
	province_modifier = {
		stationed_heavy_cavalry_damage_mult = very_high_maa_damage_tier_3
		stationed_heavy_cavalry_toughness_mult = very_high_maa_toughness_tier_3
		stationed_heavy_cavalry_screen_mult = very_high_maa_screen_tier_3
		stationed_heavy_cavalry_pursuit_mult = very_high_maa_pursuit_tier_3
		stationed_light_cavalry_damage_mult = high_maa_damage_tier_3
		stationed_light_cavalry_toughness_mult = high_maa_toughness_tier_3
		stationed_light_cavalry_screen_mult = high_maa_screen_tier_3
		stationed_light_cavalry_pursuit_mult = high_maa_pursuit_tier_3
		stationed_elephant_cavalry_damage_mult = very_high_maa_damage_tier_3
		stationed_elephant_cavalry_toughness_mult = very_high_maa_toughness_tier_3
		stationed_camel_cavalry_damage_mult = high_maa_damage_tier_3
		stationed_camel_cavalry_toughness_mult = high_maa_toughness_tier_3
		stationed_camel_cavalry_screen_mult = high_maa_screen_tier_3
		stationed_camel_cavalry_pursuit_mult = high_maa_pursuit_tier_3
	}
	
	type = duchy_capital
	
	flag = fully_upgraded_duchy_capital_building
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

blacksmiths_01 = {
	construction_time = slow_construction_time
	effect_desc = {
		desc = unlocks_building_desc
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }
			desc = blacksmiths_toto_effect_desc
		}
		triggered_desc = {
			trigger = { has_dlc_feature = royal_court }
			desc = blacksmiths_roco_effect_desc
		}
		desc = blacksmiths_effect_desc
	}

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_burhs
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_3_cost
	
	character_modifier = {
		men_at_arms_maintenance = -0.06
	}
	
	province_modifier = {
		stationed_pikemen_damage_mult = normal_maa_damage_tier_1
		stationed_pikemen_toughness_mult = very_high_maa_toughness_tier_1
		stationed_heavy_infantry_damage_mult = normal_maa_damage_tier_1
		stationed_heavy_infantry_toughness_mult = very_high_maa_toughness_tier_1
	}

	character_culture_modifier = {
		parameter = better_blacksmith_buildings
		prowess = 2
	}

	duchy_capital_county_culture_modifier = {
		parameter = better_blacksmith_buildings
		supply_limit_mult = 0.25
	}

	province_culture_modifier = {
		parameter = better_blacksmith_buildings
		stationed_pikemen_damage_mult = normal_maa_damage_tier_1
		stationed_pikemen_toughness_mult = normal_maa_toughness_tier_1
		stationed_heavy_infantry_damage_mult = normal_maa_damage_tier_1
		stationed_heavy_infantry_toughness_mult = normal_maa_toughness_tier_1
	}

	
	next_building = blacksmiths_02

	type_icon = "icon_building_blacksmiths.dds"
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		ai_anti_synergy_cavalry_modifier = yes
		ai_anti_synergy_light_infantry_modifier = yes
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		modifier = { # Don't build unsuitable MaA-boosting duchy buildings
			factor = 0
			scope:holder = {
				NOR = {
					number_maa_regiments_of_base_type = {
						type = pikemen
						value > 0
					}
					number_maa_regiments_of_base_type = {
						type = heavy_infantry
						value > 0
					}
				}
			}
		}
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
}

blacksmiths_02 = {
	construction_time = slow_construction_time
	effect_desc = {
		desc = unlocks_building_desc
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }
			desc = blacksmiths_toto_effect_desc
		}
		triggered_desc = {
			trigger = { has_dlc_feature = royal_court }
			desc = blacksmiths_roco_effect_desc
		}
		desc = blacksmiths_effect_desc
	}
	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_castle_baileys
		}
	}

	character_culture_modifier = {
		parameter = better_blacksmith_buildings
		pikemen_toughness_mult = 0.05
		heavy_infantry_toughness_mult = 0.05
		prowess = 3
	}

	duchy_capital_county_culture_modifier = {
		parameter = better_blacksmith_buildings
		supply_limit_mult = 0.5
	}

	province_culture_modifier = {
		parameter = better_blacksmith_buildings
		stationed_pikemen_damage_mult = normal_maa_damage_tier_2
		stationed_pikemen_toughness_mult = normal_maa_toughness_tier_2
		stationed_heavy_infantry_damage_mult = normal_maa_damage_tier_2
		stationed_heavy_infantry_toughness_mult = normal_maa_toughness_tier_2
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_4_cost
	
	character_modifier = {
		men_at_arms_maintenance = -0.08
	}
	
	province_modifier = {
		stationed_pikemen_damage_mult = normal_maa_damage_tier_2
		stationed_pikemen_toughness_mult = very_high_maa_toughness_tier_2
		stationed_heavy_infantry_damage_mult = normal_maa_damage_tier_2
		stationed_heavy_infantry_toughness_mult = very_high_maa_toughness_tier_2
	}
	
	next_building = blacksmiths_03
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

blacksmiths_03 = {
	construction_time = slow_construction_time
	effect_desc = {
		desc = unlocks_building_desc
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }
			desc = blacksmiths_toto_effect_desc
		}
		triggered_desc = {
			trigger = { has_dlc_feature = royal_court }
			desc = blacksmiths_roco_effect_desc
		}
		desc = blacksmiths_effect_desc
	}
	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_royal_armory
		}
	}

	character_culture_modifier = {
		parameter = better_blacksmith_buildings
		prowess = 4
		pikemen_toughness_mult = 0.08
		heavy_infantry_toughness_mult = 0.08
	}
	
	duchy_capital_county_culture_modifier = {
		parameter = better_blacksmith_buildings
		supply_limit_mult = 0.75
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_5_cost
	
	character_modifier = {
		men_at_arms_maintenance = -0.1
	}
	
	province_modifier = {
		stationed_pikemen_damage_mult = normal_maa_damage_tier_3
		stationed_pikemen_toughness_mult = very_high_maa_toughness_tier_3
		stationed_heavy_infantry_damage_mult = normal_maa_damage_tier_3
		stationed_heavy_infantry_toughness_mult = very_high_maa_toughness_tier_3
	}

	province_culture_modifier = {
		parameter = better_blacksmith_buildings
		stationed_pikemen_damage_mult = normal_maa_damage_tier_3
		stationed_pikemen_toughness_mult = normal_maa_toughness_tier_3
		stationed_heavy_infantry_damage_mult = normal_maa_damage_tier_3
		stationed_heavy_infantry_toughness_mult = normal_maa_toughness_tier_3
	}
	
	type = duchy_capital
	
	flag = fully_upgraded_duchy_capital_building
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

archery_ranges_01 = {
	construction_time = slow_construction_time
	effect_desc = {
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }
			desc = tournament_archery_cost_discount_effect_toto_desc
		}
	}
	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_burhs
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_3_cost
	
	character_modifier = {
		men_at_arms_maintenance = -0.06
	}
	
	province_modifier = {
		stationed_archers_damage_mult = very_high_maa_damage_tier_1
		stationed_archers_toughness_mult = low_maa_toughness_tier_1
		stationed_skirmishers_screen_mult = high_maa_screen_tier_1
		stationed_skirmishers_damage_mult = very_high_maa_damage_tier_1
		stationed_skirmishers_toughness_mult = high_maa_toughness_tier_1
		stationed_skirmishers_pursuit_mult = high_maa_pursuit_tier_1
		stationed_archer_cavalry_screen_mult = high_maa_screen_tier_1
		stationed_archer_cavalry_damage_mult = high_maa_damage_tier_1
		stationed_archer_cavalry_toughness_mult = low_maa_toughness_tier_1
		stationed_archer_cavalry_pursuit_mult = high_maa_pursuit_tier_1
	}
	
	next_building = archery_ranges_02

	type_icon = "icon_building_royal_hunting_grounds.dds"
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		ai_anti_synergy_cavalry_modifier = yes
		ai_anti_synergy_armored_infantry_modifier = yes
		modifier = {
			add = 10
			scope:holder = {
				number_maa_regiments_of_base_type = {
					type = archer_cavalry
					value >= 2
				}
			}
		}
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		modifier = { # Don't build unsuitable MaA-boosting duchy buildings
			factor = 0
			scope:holder = {
				NOR = {
					number_maa_regiments_of_base_type = {
						type = archers
						value > 0
					}
					number_maa_regiments_of_base_type = {
						type = skirmishers
						value > 0
					}
					number_maa_regiments_of_base_type = {
						type = archer_cavalry
						value > 0
					}
				}
			}
		}
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
}

archery_ranges_02 = {
	construction_time = slow_construction_time
	effect_desc = {
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }
			desc = tournament_archery_cost_discount_effect_toto_desc
		}
	}
	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_castle_baileys
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_4_cost
	
	character_modifier = {
		men_at_arms_maintenance = -0.08
	}
	
	province_modifier = {
		stationed_archers_damage_mult = very_high_maa_damage_tier_2
		stationed_archers_toughness_mult = low_maa_toughness_tier_2
		stationed_skirmishers_screen_mult = high_maa_screen_tier_2
		stationed_skirmishers_damage_mult = very_high_maa_damage_tier_2
		stationed_skirmishers_toughness_mult = high_maa_toughness_tier_2
		stationed_skirmishers_pursuit_mult = high_maa_pursuit_tier_2
		stationed_archer_cavalry_screen_mult = high_maa_screen_tier_2
		stationed_archer_cavalry_damage_mult = high_maa_damage_tier_2
		stationed_archer_cavalry_toughness_mult = low_maa_toughness_tier_2
		stationed_archer_cavalry_pursuit_mult = high_maa_pursuit_tier_2
	}
	
	next_building = archery_ranges_03
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

archery_ranges_03 = {
	construction_time = slow_construction_time
	effect_desc = {
		triggered_desc = {
			trigger = { has_dlc_feature = tours_and_tournaments }
			desc = tournament_archery_cost_discount_effect_toto_desc
		}
	}
	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_royal_armory
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_5_cost
	
	character_modifier = {
		men_at_arms_maintenance = -0.1
	}
	
	province_modifier = {
		stationed_archers_damage_mult = very_high_maa_damage_tier_3
		stationed_archers_toughness_mult = low_maa_toughness_tier_3
		stationed_skirmishers_screen_mult = high_maa_screen_tier_3
		stationed_skirmishers_damage_mult = very_high_maa_damage_tier_3
		stationed_skirmishers_toughness_mult = high_maa_toughness_tier_3
		stationed_skirmishers_pursuit_mult = high_maa_pursuit_tier_3
		stationed_archer_cavalry_screen_mult = high_maa_screen_tier_3
		stationed_archer_cavalry_damage_mult = high_maa_damage_tier_3
		stationed_archer_cavalry_toughness_mult = low_maa_toughness_tier_3
		stationed_archer_cavalry_pursuit_mult = high_maa_pursuit_tier_3
	}
	
	type = duchy_capital
	
	flag = fully_upgraded_duchy_capital_building
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

tax_assessor_01 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_manorialism
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_3_cost
	
	duchy_capital_county_modifier = {
		tax_mult = 0.15
	}
	
	next_building = tax_assessor_02

	type_icon = "icon_building_tax_assessor.dds"
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		modifier = {
			factor = 2
			AND = {
				building_watermills_requirement_terrain = yes
				building_windmills_requirement_terrain = yes
			}
		}
		modifier = {
			factor = 2
			OR = {
				has_building_or_higher = watermills_01
				has_building_or_higher = windmills_01
				has_building_or_higher = caravanserai_01
			}
		}
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
}

tax_assessor_02 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_windmills
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_4_cost
	
	duchy_capital_county_modifier = {
		tax_mult = 0.20
	}
	
	next_building = tax_assessor_03
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

tax_assessor_03 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_cranes
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_5_cost
	
	duchy_capital_county_modifier = {
		tax_mult = 0.30
	}
	
	type = duchy_capital
	
	flag = fully_upgraded_duchy_capital_building
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

leisure_palace_01 = {
	construction_time = slow_construction_time
	effect_desc = leisure_palace_effect_desc

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_manorialism
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_3_cost
	
	character_modifier = {
		monthly_prestige_gain_mult = 0.05
		stress_loss_mult = 0.15
		owned_hostile_scheme_success_chance_add = 5
		owned_personal_scheme_success_chance_add = 5
	}
	
	duchy_capital_county_modifier = {
		monthly_county_control_growth_factor = 0.2
		monthly_county_control_growth_add = 0.2
	}
	
	next_building = leisure_palace_02

	type_icon = "icon_building_leisure_palace.dds"
	
	type = duchy_capital
	
	ai_value = {
		base = 10
		
		modifier = { # This type of Duchy Capital Building should be more rare
			add = 10
			scope:holder = {
				OR = { # Suitable personality; cares a lot about their image or reclusive
					has_trait = arrogant
					has_trait = deceitful
					has_trait = paranoid
					has_trait = shy
					has_trait = lazy
					has_trait = reclusive
					has_trait = profligate
				}
			}
		}
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
}

leisure_palace_02 = {
	construction_time = slow_construction_time
	effect_desc = leisure_palace_effect_desc

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_windmills
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_4_cost
	
	character_modifier = {
		monthly_prestige_gain_mult = 0.1
		stress_loss_mult = 0.25
		owned_hostile_scheme_success_chance_add = 15
		owned_personal_scheme_success_chance_add = 15
	}
	
	duchy_capital_county_modifier = {
		monthly_county_control_growth_factor = 0.4
		monthly_county_control_growth_add = 0.3
	}
	
	next_building = leisure_palace_03
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

leisure_palace_03 = {
	construction_time = slow_construction_time
	effect_desc = leisure_palace_effect_desc
	
	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_cranes
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_5_cost
	
	character_modifier = {
		monthly_prestige_gain_mult = 0.15
		stress_loss_mult = 0.35
		owned_hostile_scheme_success_chance_add = 25
		owned_personal_scheme_success_chance_add = 25
	}
	
	duchy_capital_county_modifier = {
		monthly_county_control_growth_factor = 0.6
		monthly_county_control_growth_add = 0.4
	}
	
	type = duchy_capital
	
	flag = fully_upgraded_duchy_capital_building
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

royal_forest_01 = {
	construction_time = slow_construction_time
	effect_desc = royal_reserves_desc

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
		NOR = {
			terrain = steppe
			terrain = desert
			terrain = oasis
			terrain = desert_mountains
			terrain = mountains
			terrain = wetlands
		}
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_manorialism
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_3_cost
	
	duchy_capital_county_modifier = {
		county_opinion_add = 5
		development_growth_factor = 0.1
	}
	province_modifier = {
		monthly_income = good_building_tax_tier_2
	}
	
	next_building = royal_forest_02

	type_icon = "icon_building_royal_forest.dds"
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
}

royal_forest_02 = {
	construction_time = slow_construction_time
	effect_desc = royal_reserves_desc

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_windmills
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_4_cost
	
	duchy_capital_county_modifier = {
		county_opinion_add = 10
		development_growth_factor = 0.2
	}
	province_modifier = {
		monthly_income = good_building_tax_tier_3
	}
	
	next_building = royal_forest_03
	
	type = duchy_capital
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

royal_forest_03 = {
	construction_time = slow_construction_time
	effect_desc = royal_reserves_desc

	can_construct_potential = {
		building_requirement_castle_city_church = { LEVEL = 01 }
		building_requirement_tribal = no
	}
	
	can_construct_showing_failures_only = {
		
		culture = {
			has_innovation = innovation_cranes
		}
	}
	
	is_enabled = {
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_5_cost
	
	duchy_capital_county_modifier = {
		county_opinion_add = 15
		development_growth_factor = 0.3
	}
	province_modifier = {
		monthly_income = good_building_tax_tier_4
	}
	
	type = duchy_capital
	
	flag = fully_upgraded_duchy_capital_building
	
	ai_value = {
		base = 20
		modifier = {
			factor = 2
			scope:holder.capital_province = this
		}
	}
}

##########
# Megalith
##########
pyramids_02 = {

	construction_time = very_slow_construction_time

	type_icon = "icon_buildings_pyramids.dds"
	
	can_construct_potential = {
		building_requirement_tribal = no
		building_requirement_castle_city_church = { LEVEL = 01 }
		scope:holder = {
			faith = {
				has_doctrine_parameter = can_build_pyramids
			}
		}
	}
	
	cost_gold = 2000

	character_modifier = {
		monthly_dynasty_prestige_mult = 0.05
		short_reign_duration_mult = -0.2
		monthly_piety_gain_mult = 0.1
	}
	county_modifier = {
		development_growth = 0.2
	}
	province_modifier = {
		monthly_income = good_building_tax_tier_2
	}
	
	
	ai_value = {
		base = 100
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
	
	type = duchy_capital

	flag = travel_point_of_interest_wonder
}
great_megalith_01 = {

	construction_time = very_slow_construction_time

	type_icon = "icon_megalith.dds"
	
	can_construct_potential = {
		building_requirement_tribal = no
		building_requirement_castle_city_church = { LEVEL = 01 }
		scope:holder = {
			faith = {
				has_doctrine_parameter = can_build_megaliths
			}
		}
	}
	
	is_enabled = {
		custom_tooltip = {
			text = province_is_of_a_megalith_faith_tt
			county.faith = { has_doctrine_parameter = can_build_megaliths }
		}
		county.holder = { has_title = prev.duchy }
	}
	show_disabled = yes
	
	cost_gold = expensive_building_tier_3_cost

	character_modifier = {
		monthly_learning_lifestyle_xp_gain_mult = 0.1
		monthly_piety = 0.25
		monthly_dynasty_prestige_mult = 0.05
		naval_movement_speed_mult = 0.1
	}

	duchy_capital_county_modifier = {
		county_opinion_add = 10
		development_growth_factor = 0.15
	}
	
	province_modifier = {
		monthly_income = good_building_tax_tier_3
	}
	
	ai_value = {
		base = 100
		modifier = { # Fill all building slots before going for duchy buildings
			factor = 0
			free_building_slots > 0
		}
		modifier = { # Less likely when the AI should build regular buildings first
			factor = 0.1
			scope:holder = { ai_should_focus_on_building_in_their_capital = yes }
		}
	}
	
	type = duchy_capital

	flag = fully_upgraded_duchy_capital_building
}
