# Bloodline Buildings

# Castle
castle = {
	# Castellan Bloodline buildings.
	ca_special_fortifications_1 = { # Insulated Sections
		desc = ca_special_fortifications_1_desc
		potential = {
			OR = {
				# Show the building only if it has been already built or if the owner has the proper bloodline to build it.
				FROMFROM = { has_building = ca_special_fortifications_1 }
				bloodline_castellan_trigger = yes
			}
		}

		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 1
			bloodline_castellan_trigger = yes
			castle_building_allow = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		gold_cost = 125
		build_time = 365
		fort_level = 0.5
		land_morale = 0.05

		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_special_fortifications_2 = { # Killing Fields
		desc = ca_special_fortifications_2_desc

		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 3
			bloodline_castellan_trigger = yes
			castle_building_allow = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}
		upgrades_from = ca_special_fortifications_1
		gold_cost = 250
		build_time = 560
		fort_level = 1
		land_morale = 0.05
		garrison_size = 0.05

		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_special_fortifications_3 = { # Extended Machicolations
		desc = ca_special_fortifications_3_desc

		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 5
			bloodline_castellan_trigger = yes
			castle_building_allow = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		upgrades_from = ca_special_fortifications_2
		gold_cost = 450
		build_time = 760
		fort_level = 1.5
		garrison_size = 0.15
		archers = 50

		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_special_fortifications_4 = { # Reinforced Barbican
		desc = ca_special_fortifications_4_desc

		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 7
			bloodline_castellan_trigger = yes
			castle_building_allow = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}
		upgrades_from = ca_special_fortifications_3
		gold_cost = 750
		build_time = 1250
		fort_level = 2
		levy_size = 0.2
		garrison_size = 0.3
		light_infantry = 100

		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}

	# Murder Builder Bloodline buildings.
	ca_oppressive_fortifications_1 = { # Gloomy Monument
		desc = ca_oppressive_fortifications_1_desc

		potential = {
			OR = {
				# Show the building only if it has been already built or if the owner has the proper bloodline to build it.
				FROMFROM = { has_building = ca_oppressive_fortifications_1 }
				bloodline_blood_trigger = yes
			}
		}

		trigger = {
			TECH_CASTLE_CONSTRUCTION >= 2
			bloodline_blood_trigger = yes
			castle_building_allow = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		gold_cost = 125
		build_time = 365
		local_revolt_risk = -0.05
		liege_prestige = 0.05

		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_oppressive_fortifications_2 = { # Connected Watchtowers
		desc = ca_oppressive_fortifications_2_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION >= 4
			bloodline_blood_trigger = yes
			castle_building_allow = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}
		upgrades_from = ca_oppressive_fortifications_1
		gold_cost = 250
		build_time = 560
		fort_level = 1
		local_revolt_risk = -0.05
		garrison_size = 0.05

		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_oppressive_fortifications_3 = { # Lonely Spire
		desc = ca_oppressive_fortifications_3_desc

		trigger = {
			TECH_CASTLE_CONSTRUCTION >= 6
			bloodline_blood_trigger = yes
			castle_building_allow = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		upgrades_from = ca_oppressive_fortifications_2
		gold_cost = 300
		build_time = 560
		fort_level = 1
		local_revolt_risk = -0.05
		garrison_size = 0.05

		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_oppressive_fortifications_4 = { # Palace of Justice
		desc = ca_oppressive_fortifications_4_desc

		trigger = {
			TECH_CASTLE_CONSTRUCTION >= 8
			bloodline_blood_trigger = yes
			castle_building_allow = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		upgrades_from = ca_oppressive_fortifications_3
		gold_cost = 450
		build_time = 760
		fort_level = 1
		local_revolt_risk = -0.05
		garrison_size = 0.05

		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
}

# City
city = {
	#Architect Bloodline buildings.
	ct_planned_infrastructure_1 = { #Garrisoned roads
		desc = ct_planned_infrastructure_1_desc

		potential = {
			OR = {
				# Show the building only if it has been already built or if the owner has the proper bloodline to build it.
				FROMFROM = { has_building = ct_planned_infrastructure_1 }
				bloodline_architect_trigger = yes
			}
		}

		trigger = {
			TECH_CITY_CONSTRUCTION >= 1
			bloodline_architect_trigger = yes
			city_building_allow = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		gold_cost = 125
		build_time = 365
		tax_income = 3
		land_morale = 0.05
		tech_growth_modifier = 0.05
		tradevalue = 5

		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ct_planned_infrastructure_2 = { #Stone Roads
		desc = ct_planned_infrastructure_2_desc

		trigger = {
			TECH_CITY_CONSTRUCTION >= 3
			bloodline_architect_trigger = yes
			city_building_allow = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		upgrades_from = ct_planned_infrastructure_1
		gold_cost = 250
		build_time = 560
		tax_income = 3
		max_tradeposts = 2
		tech_growth_modifier = 0.05
		tradevalue = 5

		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ct_planned_infrastructure_3 = { #Cleared Pathways
		desc = ct_planned_infrastructure_3_desc

		trigger = {
			TECH_CITY_CONSTRUCTION >= 5
			bloodline_architect_trigger = yes
			city_building_allow = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		upgrades_from = ct_planned_infrastructure_2
		gold_cost = 450
		build_time = 760

		tech_growth_modifier = 0.1
		levy_reinforce_rate = 0.1
		disease_defence = 0.05
		tradevalue = 5

		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ct_planned_infrastructure_4 = { #Great Acqueduct
		desc = ct_planned_infrastructure_4_desc

		trigger = {
			TECH_CITY_CONSTRUCTION >= 7
			bloodline_architect_trigger = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		upgrades_from = ct_planned_infrastructure_3
		gold_cost = 750
		build_time = 1250
		tech_growth_modifier = 0.05
		economy_techpoints = 0.1
		disease_defence = 0.1
		tradevalue = 5

		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
}

# Temple
temple = {
	#Monumental Bloodline buildings.
	tp_monumental_shrines_1 = { #Monumental Shrines
		desc = tp_monumental_shrines_1_desc

		potential = {
			OR = {
				# Show the building only if it has been already built or if the owner has the proper bloodline to build it.
				FROMFROM = { has_building = tp_monumental_shrines_1 }
				bloodline_monumental_trigger = yes
			}
		}

		trigger = {
			TECH_CITY_CONSTRUCTION >= 1
			bloodline_monumental_trigger = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		gold_cost = 125
		build_time = 365
		liege_piety = 0.05
		tax_income = 1

		add_number_to_name = yes

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	tp_monumental_shrines_2 = {
		desc = tp_monumental_shrines_2_desc

		trigger = {
			TECH_CITY_CONSTRUCTION >= 3
			bloodline_monumental_trigger = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		upgrades_from = tp_monumental_shrines_1
		gold_cost = 250
		build_time = 560
		liege_piety = 0.1
		tax_income = 1

		add_number_to_name = yes

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	tp_monumental_shrines_3 = {
		desc = tp_monumental_shrines_3_desc

		trigger = {
			TECH_CITY_CONSTRUCTION >= 5
			bloodline_monumental_trigger = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		upgrades_from = tp_monumental_shrines_2
		gold_cost = 250
		build_time = 560
		liege_piety = 0.15
		tax_income = 1

		add_number_to_name = yes

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	tp_monumental_shrines_4 = {
		desc = tp_monumental_shrines_4_desc

		trigger = {
			TECH_CITY_CONSTRUCTION >= 7
			bloodline_monumental_trigger = yes
		}

		is_active_trigger = {
			show_only_failed_conditions = yes

			FROM = {
				is_tribal = no
				is_nomadic = no
			}
		}

		upgrades_from = tp_monumental_shrines_3
		gold_cost = 250
		build_time = 560
		liege_piety = 0.25
		tax_income = 1

		add_number_to_name = yes

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
}