######################################################################
# Holding Level
######################################################################

# is_a_special_cow_mine_province = {
	# has_special_building_slot = yes
		# OR = {
			# has_special_building = no
			# has_building_or_higher = rammelsberg_mines_01
			# has_building_or_higher = kutna_hora_mines_01
			# has_building_or_higher = kremnica_mines_01
			# has_building_or_higher = falun_mines_01
			# has_building_or_higher = schwaz_mines_01
			# has_building_or_higher = argentiera_mines_01
			# has_building_or_higher = kollur_mines_01
			# has_building_or_higher = siderokausia_mines_01
			# has_building_or_higher = mali_mines_01
		# }
	# barony = { is_holy_site = no }
	# OR = {
		# barony = { title:b_goslar }
		# barony = { title:b_caslav }
		# barony = { title:b_turoc }
		# barony = { title:b_falene }
		# barony = { title:b_innsbruck }
		# barony = { title:b_iglesias }
		# barony = { title:b_ellur }
		# barony = { title:b_ierrisos }
		# barony = { title:b_wasulu }
		# barony = { title:b_diakha }
		# barony = { title:b_goundafa }
	# }
# }

building_requirement_castle_city_church = {
	trigger_if = {
		limit = { has_holding_type = castle_holding }
		has_building_or_higher = castle_$LEVEL$
	}
	trigger_else_if = {
		limit = { has_holding_type = city_holding }
		has_building_or_higher = city_$LEVEL$
	}
	trigger_else_if = {
		limit = { has_holding_type = church_holding }
		has_building_or_higher = temple_$LEVEL$
	}
	trigger_else_if = {
		limit = { has_holding_type = cow_metropolis_holding }
		has_building_or_higher = cow_metropolis_$LEVEL$
	}
	trigger_else = {
		custom_description = {
			text = "building_requirement_castle_city_church_failed"
			always = no
		}
	}
}

building_requirement_cow_metropolis = {
	trigger_if = {
		limit = { has_holding_type = cow_metropolis_holding }
		has_building_or_higher = cow_metropolis_$LEVEL$
	}
	trigger_else = {
		custom_description = {
			text = "BUILDING_REQUIREMENT_COW_METROPOLIS_FAILED"
			always = no
		}
	}
}

building_requirement_cow_metropolis_civic_divine_right = {
	custom_description = {
		text = cow_metropolis_civic_divine_right
		county = { 
			OR = { 
				development_level >= 50
				culture = {
					has_innovation = innovation_divine_right
				}
			}
		}
	}
}

building_requirement_cow_metropolis_civic_renaissance = {
	custom_description = {
		text = cow_metropolis_civic_renaissance
		county = { 
			OR = { 
				development_level >= 50
				culture = {
					has_innovation = innovation_development_04
				}
			}
		}
	}
}

building_requirement_cow_metropolis_military_machicolations = {
	custom_description = {
		text = cow_metropolis_military_machicolations
		county = { 
			OR = { 
				development_level >= 50
				culture = {
					has_innovation = innovation_machicolations
				}
			}
		}
	}
}

building_requirement_cow_metropolis_civic_cranes = {
	custom_description = {
		text = cow_metropolis_civic_cranes
		county = { 
			OR = { 
				development_level >= 50
				culture = {
					has_innovation = innovation_cranes
				}
			}
		}
	}
}

building_cow_bad_terrain = {
	OR = {
		terrain = steppe
		terrain = wetlands
		terrain = taiga
		terrain = forest
		terrain = jungle
	}
}

building_cow_terrible_terrain = {
	OR = {
		terrain = mountains
		terrain = desert_mountains
		terrain = desert
	}
}

barony_is_valid_for_cow_metropolis_trigger = {
	OR = {
		barony = title:b_alexandria
		barony = title:b_antiocheia
		barony = title:b_baghdad
		barony = title:b_constantinople
		barony = title:b_cordoba
		barony = title:b_roma
		barony = title:b_jerusalem 
	}
}

barony_has_hist_cow_university_trigger = {
	OR = {
		barony = title:b_alexandria
		barony = title:b_constantinople
		barony = title:b_cordoba
	}
}

barony_is_hist_vanilla_cow_university_trigger = {
	NOR = {
		barony = title:b_fes
		barony = title:b_cairo
		barony = title:b_bologna
		barony = title:b_salamanca
		barony = title:b_madrid
		barony = title:b_oxford
		barony = title:b_cambridge
		barony = title:b_padua
		barony = title:b_siena
		barony = title:b_coimbra
		barony = title:b_napoli
		barony = title:b_tirakka
	}
}

barony_has_hist_cow_library_trigger = {
	OR = {
		barony = title:b_alexandria
		barony = title:b_baghdad
		barony = title:b_constantinople
		barony = title:b_roma
	}
}

barony_has_hist_cow_temple_trigger = {
	OR = {
		barony = title:b_alexandria
		barony = title:b_athens
		barony = title:b_roma
	}
}

barony_has_hist_cow_royal_palace_trigger = {
	OR = {
		barony = title:b_constantinople
		barony = title:b_cordoba
		barony = title:b_roma
	}
}

barony_has_hist_cow_great_harbor_trigger = {
	OR = {
		barony = title:b_athens
		barony = title:b_constantinople
	}
}

barony_has_hist_cow_lighthouse_trigger = {
	OR = {
		barony = title:b_alexandria
		barony = title:b_baghdad # Secret 'Lighthouse'
	}
}

barony_has_hist_cow_amphitheater_trigger = {
	OR = {
		barony = title:b_antiocheia
		barony = title:b_athens
		barony = title:b_constantinople
		barony = title:b_roma
	}
}

barony_has_hist_cow_mausoleum_trigger = { # Unused
	OR = {
		barony = title:b_alexandria
	}
}

barony_has_hist_cow_statue_trigger = { # Unused
	OR = {
		barony = title:b_athens
		barony = title:b_constantinople
		barony = title:b_roma
	}
}

barony_has_hist_cow_great_walls_trigger = {
	custom_description = {
		text = barony_has_hist_cow_great_walls_trigger
		OR = {
			barony = title:b_athens
			barony = title:b_baghdad
			barony = title:b_constantinople
			barony = title:b_roma
		}
	}
}

barony_has_hist_cow_grand_fortress_trigger = {
	custom_description = {
		text = barony_has_hist_cow_grand_fortress_trigger
		OR = {
			barony = title:b_antiocheia
			barony = title:b_constantinople
			barony = title:b_roma
			barony = title:b_granada
			barony = title:b_london
		}
	}
}

barony_has_cow_metropolis_fortifications_trigger = {
	OR = {
		has_building_or_higher = cow_great_walls_01
		has_building_or_higher = cow_great_walls_athens_01
		has_building_or_higher = cow_great_walls_baghdad_01
		# has_building_or_higher = cow_grand_fortress_01 # Disabled restriction due to building rework
		# has_building_or_higher = cow_grand_fortress_antiocheia_01 # Disabled restriction due to building rework
		# has_building_or_higher = cow_grand_fortress_byzantion_01 # Disabled restriction due to building rework
	}
}

barony_has_cow_metropolis_generic_forts_trigger = {
	OR = {
		has_building_or_higher = cow_ramparts_01
		has_building_or_higher = cow_curtain_walls_01
		has_building_or_higher = cow_watchtowers_01
		has_building_or_higher = cow_hill_forts_01
	}
}

cow_holder_is_lunatic_or_possessed_trigger = { # Must scope to holder (scope:holder =)
	custom_description = {
		text = cow_holder_is_lunatic_or_possessed_trigger
		OR = {
			has_trait = possessed
			has_trait = lunatic
			has_trait = pure_blooded
		}
	}
}