####################################
# Standard Fortification Buildings #
####################################

# Ramparts - Archers, Skirmishers
# Curtain Walls - Heavy Cavalry, Economy
# Watchtowers - Heavy Infantry, Light Cavalry
# Hill Forts - Pikemen, Skirmishers

### ramparts

ramparts_01 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_ramparts_requirement_terrain = yes
		building_requirement_castle_city_church = { LEVEL = 01 }
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_1_cost
	
	levy = normal_building_levy_tier_1
	max_garrison = normal_building_max_garrison_tier_1
	province_modifier = {
		fort_level = normal_building_fort_level_tier_1
		stationed_archers_damage_mult = low_maa_damage_tier_1
		stationed_skirmishers_damage_mult = low_maa_damage_tier_1
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_1
		travel_danger = -1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = ramparts_02

	type_icon = "icon_building_ramparts.dds"
	
	ai_value = {
		base = 10
		ai_tier_1_building_modifier = yes
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		modifier = {
			factor = 5
			free_building_slots <= 3
			scope:holder.capital_province = this
		}
		modifier = {
			factor = 5
			free_building_slots <= 2
		}
		modifier = {
			factor = 5
			free_building_slots <= 1
		}
		culture_likely_to_fortify_modifier = yes
	}
}

ramparts_02 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_ramparts_requirement_terrain = yes
		building_requirement_castle_city_church = { LEVEL = 01 }
			scope:holder.culture = {
				has_innovation = innovation_motte
			}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_2_cost
	
	levy = normal_building_levy_tier_2
	max_garrison = normal_building_max_garrison_tier_2
	province_modifier = {
		fort_level = normal_building_fort_level_tier_2
		tax_mult = 0.02
		stationed_archers_damage_mult = low_maa_damage_tier_2
		stationed_skirmishers_damage_mult = low_maa_damage_tier_2
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_2
		travel_danger = -2
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = ramparts_03
	
	ai_value = {
		base = 9
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		modifier = { # Fill all building slots before going for upgrades
			factor = 0
			free_building_slots > 0
		}
	}
}

ramparts_03 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_ramparts_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 02 }
			scope:holder.culture = {
				has_innovation = innovation_battlements
			}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_3_cost
	
	levy = normal_building_levy_tier_3
	max_garrison = normal_building_max_garrison_tier_3
	province_modifier = {
		fort_level = normal_building_fort_level_tier_3
		defender_holding_advantage = normal_building_advantage_tier_1
		tax_mult = 0.02
		stationed_archers_damage_mult = low_maa_damage_tier_3
		stationed_skirmishers_damage_mult = low_maa_damage_tier_3
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_3
		travel_danger = -3
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = ramparts_04
	
	ai_value = {
		base = 8
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

ramparts_04 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_ramparts_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 02 }
			scope:holder.culture = {
				has_innovation = innovation_battlements
			}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_4_cost
	
	levy = normal_building_levy_tier_4
	max_garrison = normal_building_max_garrison_tier_4
	province_modifier = {
		fort_level = normal_building_fort_level_tier_4
		defender_holding_advantage = normal_building_advantage_tier_1
		tax_mult = 0.02
		stationed_archers_damage_mult = low_maa_damage_tier_4
		stationed_skirmishers_damage_mult = low_maa_damage_tier_4
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_4
		travel_danger = -4
	}
	county_modifier = {
		hostile_raid_time = 0.1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = ramparts_05
	
	ai_value = {
		base = 7
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

ramparts_05 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_ramparts_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 03 }
			scope:holder.culture = {
				has_innovation = innovation_hoardings
			}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_5_cost
	
	levy = normal_building_levy_tier_5
	max_garrison = normal_building_max_garrison_tier_5
	province_modifier = {
		fort_level = normal_building_fort_level_tier_5
		defender_holding_advantage = normal_building_advantage_tier_1
		tax_mult = 0.02
		stationed_archers_damage_mult = low_maa_damage_tier_5
		stationed_skirmishers_damage_mult = low_maa_damage_tier_5
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_5
		travel_danger = -5
	}
	county_modifier = {
		hostile_raid_time = 0.1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = ramparts_06
	
	ai_value = {
		base = 6
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

ramparts_06 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_ramparts_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 03 }
			scope:holder.culture = {
				has_innovation = innovation_hoardings
			}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_6_cost
	
	levy = normal_building_levy_tier_6
	max_garrison = normal_building_max_garrison_tier_6
	province_modifier = {
		fort_level = normal_building_fort_level_tier_6
		defender_holding_advantage = normal_building_advantage_tier_2
		tax_mult = 0.02
		stationed_archers_damage_mult = low_maa_damage_tier_6
		stationed_skirmishers_damage_mult = low_maa_damage_tier_6
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_6
		travel_danger = -6
	}
	county_modifier = {
		hostile_raid_time = 0.1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = ramparts_07
	
	ai_value = {
		base = 5
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

ramparts_07 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_ramparts_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 04 }
			scope:holder.culture = {
				has_innovation = innovation_machicolations
			}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_7_cost
	
	levy = normal_building_levy_tier_7
	max_garrison = normal_building_max_garrison_tier_7
	province_modifier = {
		fort_level = normal_building_fort_level_tier_7
		defender_holding_advantage = normal_building_advantage_tier_2
		tax_mult = 0.02
		stationed_archers_damage_mult = low_maa_damage_tier_7
		stationed_skirmishers_damage_mult = low_maa_damage_tier_7
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_7
		travel_danger = -7
	}
	county_modifier = {
		hostile_raid_time = 0.1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = ramparts_08
	
	ai_value = {
		base = 4
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

ramparts_08 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_ramparts_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 04 }
			scope:holder.culture = {
				has_innovation = innovation_machicolations
			}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_8_cost
	
	levy = normal_building_levy_tier_8
	max_garrison = normal_building_max_garrison_tier_8
	province_modifier = {
		fort_level = normal_building_fort_level_tier_8
		defender_holding_advantage = normal_building_advantage_tier_2
		tax_mult = 0.02
		stationed_archers_damage_mult = low_maa_damage_tier_8
		stationed_skirmishers_damage_mult = low_maa_damage_tier_8
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_8
		travel_danger = -8
	}
	county_modifier = {
		hostile_raid_time = 0.1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	ai_value = {
		base = 3
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

### curtain_walls

curtain_walls_01 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_curtain_walls_requirement_terrain = yes
		building_requirement_castle_city_church = { LEVEL = 01 }
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_1_cost
	
	max_garrison = normal_building_max_garrison_tier_1
	province_modifier = {
		monthly_income = poor_building_tax_tier_1
		fort_level = normal_building_fort_level_tier_1
		stationed_heavy_cavalry_damage_mult = low_maa_damage_tier_1
		stationed_heavy_cavalry_toughness_mult = low_maa_toughness_tier_1
		travel_danger = -1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = curtain_walls_02

	type_icon = "icon_building_curtain_walls.dds"
	
	ai_value = {
		base = 10
		ai_tier_1_building_modifier = yes
		ai_tier_1_economical_building_preference_modifier = yes
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		modifier = {
			factor = 5
			free_building_slots <= 3
			scope:holder.capital_province = this
		}
		modifier = {
			factor = 5
			free_building_slots <= 2
		}
		modifier = {
			factor = 5
			free_building_slots <= 1
		}
	}
}

curtain_walls_02 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_curtain_walls_requirement_terrain = yes
		building_requirement_castle_city_church = { LEVEL = 01 }
		scope:holder.culture = {
			has_innovation = innovation_motte
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_2_cost
	
	max_garrison = normal_building_max_garrison_tier_2
	province_modifier = {
		monthly_income = poor_building_tax_tier_2
		fort_level = normal_building_fort_level_tier_2
		stationed_heavy_cavalry_damage_mult = low_maa_damage_tier_2
		stationed_heavy_cavalry_toughness_mult = low_maa_toughness_tier_2
		travel_danger = -2
	}
	
	county_modifier = {
		supply_limit = 300
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = curtain_walls_03
	
	ai_value = {
		base = 9
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		ai_economical_building_preference_modifier = yes
		modifier = { # Fill all building slots before going for upgrades
			factor = 0
			free_building_slots > 0
		}
	}
}

curtain_walls_03 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_curtain_walls_requirement_terrain = yes
	}

	can_construct = {
		building_requirement_castle_city_church = { LEVEL = 02 }
		scope:holder.culture = {
			has_innovation = innovation_battlements
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_3_cost
	
	max_garrison = normal_building_max_garrison_tier_3
	province_modifier = {
		monthly_income = poor_building_tax_tier_3
		fort_level = normal_building_fort_level_tier_3
		stationed_heavy_cavalry_damage_mult = low_maa_damage_tier_3
		stationed_heavy_cavalry_toughness_mult = low_maa_toughness_tier_3
		travel_danger = -3
	}
	
	county_modifier = {
		supply_limit = 300
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = curtain_walls_04
	
	ai_value = {
		base = 8
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		ai_economical_building_preference_modifier = yes
	}
}

curtain_walls_04 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_curtain_walls_requirement_terrain = yes
	}

	can_construct = {
		building_requirement_castle_city_church = { LEVEL = 02 }
		scope:holder.culture = {
			has_innovation = innovation_battlements
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_4_cost
	
	max_garrison = normal_building_max_garrison_tier_4
	province_modifier = {
		monthly_income = poor_building_tax_tier_4
		fort_level = normal_building_fort_level_tier_4
		stationed_heavy_cavalry_damage_mult = low_maa_damage_tier_4
		stationed_heavy_cavalry_toughness_mult = low_maa_toughness_tier_4
		travel_danger = -4
	}
	
	county_modifier = {
		supply_limit = 300
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = curtain_walls_05
	
	ai_value = {
		base = 7
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		ai_economical_building_preference_modifier = yes
	}
}

curtain_walls_05 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_curtain_walls_requirement_terrain = yes
	}

	can_construct = {
		building_requirement_castle_city_church = { LEVEL = 03 }
		scope:holder.culture = {
			has_innovation = innovation_hoardings
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_5_cost
	
	max_garrison = normal_building_max_garrison_tier_5
	province_modifier = {
		monthly_income = poor_building_tax_tier_5
		fort_level = normal_building_fort_level_tier_5
		defender_holding_advantage = normal_building_advantage_tier_2
		stationed_heavy_cavalry_damage_mult = low_maa_damage_tier_5
		stationed_heavy_cavalry_toughness_mult = low_maa_toughness_tier_5
		travel_danger = -5
	}
	
	county_modifier = {
		supply_limit = 300
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = curtain_walls_06
	
	ai_value = {
		base = 6
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		ai_economical_building_preference_modifier = yes
	}
}

curtain_walls_06 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_curtain_walls_requirement_terrain = yes
	}

	can_construct = {
		building_requirement_castle_city_church = { LEVEL = 03 }
		scope:holder.culture = {
			has_innovation = innovation_hoardings
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_6_cost
	
	max_garrison = normal_building_max_garrison_tier_6
	province_modifier = {
		monthly_income = poor_building_tax_tier_6
		fort_level = normal_building_fort_level_tier_6
		defender_holding_advantage = normal_building_advantage_tier_2
		stationed_heavy_cavalry_damage_mult = low_maa_damage_tier_6
		stationed_heavy_cavalry_toughness_mult = low_maa_toughness_tier_6
		travel_danger = -6
	}
	
	county_modifier = {
		supply_limit = 300
		supply_limit_mult = 0.02
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = curtain_walls_07
	
	ai_value = {
		base = 5
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		ai_economical_building_preference_modifier = yes
	}
}

curtain_walls_07 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_curtain_walls_requirement_terrain = yes
	}

	can_construct = {
		building_requirement_castle_city_church = { LEVEL = 04 }
		scope:holder.culture = {
			has_innovation = innovation_machicolations
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_7_cost
	
	max_garrison = normal_building_max_garrison_tier_7
	province_modifier = {
		monthly_income = poor_building_tax_tier_7
		fort_level = normal_building_fort_level_tier_7
		defender_holding_advantage = normal_building_advantage_tier_2
		stationed_heavy_cavalry_damage_mult = low_maa_damage_tier_7
		stationed_heavy_cavalry_toughness_mult = low_maa_toughness_tier_7
		travel_danger = -7
	}
	
	county_modifier = {
		supply_limit = 300
		supply_limit_mult = 0.02
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = curtain_walls_08
	
	ai_value = {
		base = 4
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		ai_economical_building_preference_modifier = yes
	}
}

curtain_walls_08 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		building_curtain_walls_requirement_terrain = yes
	}

	can_construct = {
		building_requirement_castle_city_church = { LEVEL = 04 }
		scope:holder.culture = {
			has_innovation = innovation_machicolations
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_8_cost
	
	max_garrison = normal_building_max_garrison_tier_8
	province_modifier = {
		monthly_income = poor_building_tax_tier_8
		fort_level = normal_building_fort_level_tier_8
		defender_holding_advantage = normal_building_advantage_tier_2
		stationed_heavy_cavalry_damage_mult = low_maa_damage_tier_8
		stationed_heavy_cavalry_toughness_mult = low_maa_toughness_tier_8
		travel_danger = -8
	}
	
	county_modifier = {
		supply_limit = 300
		supply_limit_mult = 0.02
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	ai_value = {
		base = 3
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		ai_economical_building_preference_modifier = yes
	}
}

### watchtowers

watchtowers_01 = {
	construction_time = standard_construction_time
	effect_desc = watchtowers_desc

	can_construct_potential = {
		building_watchtowers_requirement_terrain = yes
		building_requirement_castle_city_church = { LEVEL = 01 }
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_1_cost
	
	max_garrison = normal_building_max_garrison_tier_1
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_1
		fort_level = normal_building_fort_level_tier_1
		stationed_heavy_infantry_damage_mult = low_maa_damage_tier_1
		stationed_heavy_infantry_toughness_mult = low_maa_toughness_tier_1
		stationed_light_cavalry_damage_mult = low_maa_damage_tier_1
		stationed_light_cavalry_toughness_mult = low_maa_toughness_tier_1
		travel_danger = -1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = watchtowers_02

	type_icon = "icon_building_watchtowers.dds"
	
	ai_value = {
		base = 10
		ai_tier_1_building_modifier = yes
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		modifier = {
			factor = 5
			free_building_slots <= 3
			scope:holder.capital_province = this
		}
		modifier = {
			factor = 5
			free_building_slots <= 2
		}
		modifier = {
			factor = 5
			free_building_slots <= 1
		}
	}
}

watchtowers_02 = {
	construction_time = standard_construction_time
	effect_desc = watchtowers_desc

	can_construct_potential = {
		building_watchtowers_requirement_terrain = yes
		building_requirement_castle_city_church = { LEVEL = 01 }
		scope:holder.culture = {
			has_innovation = innovation_motte
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_2_cost
	
	max_garrison = normal_building_max_garrison_tier_2
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_2
		fort_level = normal_building_fort_level_tier_2
		stationed_heavy_infantry_damage_mult = low_maa_damage_tier_2
		stationed_heavy_infantry_toughness_mult = low_maa_toughness_tier_2
		stationed_light_cavalry_damage_mult = low_maa_damage_tier_2
		stationed_light_cavalry_toughness_mult = low_maa_toughness_tier_2
		travel_danger = -2
	}
	
	county_modifier = {
		hostile_raid_time = 0.1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = watchtowers_03
	
	ai_value = {
		base = 9
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		modifier = { # Fill all building slots before going for upgrades
			factor = 0
			free_building_slots > 0
		}
	}
}

watchtowers_03 = {
	construction_time = standard_construction_time
	effect_desc = watchtowers_desc

	can_construct_potential = {
		building_watchtowers_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 02 }
			scope:holder.culture = {
				has_innovation = innovation_battlements
			}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = cheap_building_tier_3_cost
	
	max_garrison = normal_building_max_garrison_tier_3
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_3
		fort_level = normal_building_fort_level_tier_3
		stationed_heavy_infantry_damage_mult = low_maa_damage_tier_3
		stationed_heavy_infantry_toughness_mult = low_maa_toughness_tier_3
		stationed_light_cavalry_damage_mult = low_maa_damage_tier_3
		stationed_light_cavalry_toughness_mult = low_maa_toughness_tier_3
		travel_danger = -3
	}
	
	county_modifier = {
		hostile_raid_time = 0.1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = watchtowers_04
	
	ai_value = {
		base = 8
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

watchtowers_04 = {
	construction_time = standard_construction_time
	effect_desc = watchtowers_desc

	can_construct_potential = {
		building_watchtowers_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 02 }
			scope:holder.culture = {
				has_innovation = innovation_battlements
			}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = cheap_building_tier_4_cost
	
	max_garrison = normal_building_max_garrison_tier_4
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_4
		fort_level = normal_building_fort_level_tier_4
		supply_limit = 300
		stationed_heavy_infantry_damage_mult = low_maa_damage_tier_4
		stationed_heavy_infantry_toughness_mult = low_maa_toughness_tier_4
		stationed_light_cavalry_damage_mult = low_maa_damage_tier_4
		stationed_light_cavalry_toughness_mult = low_maa_toughness_tier_4
		travel_danger = -4
	}
	
	county_modifier = {
		hostile_raid_time = 0.1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = watchtowers_05
	
	ai_value = {
		base = 7
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

watchtowers_05 = {
	construction_time = standard_construction_time
	effect_desc = watchtowers_desc

	can_construct_potential = {
		building_watchtowers_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 03 }
			scope:holder.culture = {
				has_innovation = innovation_hoardings
			}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = cheap_building_tier_5_cost
	
	max_garrison = normal_building_max_garrison_tier_5
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_5
		fort_level = normal_building_fort_level_tier_5
		supply_limit = 300
		stationed_heavy_infantry_damage_mult = low_maa_damage_tier_5
		stationed_heavy_infantry_toughness_mult = low_maa_toughness_tier_5
		stationed_light_cavalry_damage_mult = low_maa_damage_tier_5
		stationed_light_cavalry_toughness_mult = low_maa_toughness_tier_5
		travel_danger = -5
		epidemic_resistance = 5
	}
	
	county_modifier = {
		hostile_raid_time = 0.15	
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = watchtowers_06
	
	ai_value = {
		base = 6
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

watchtowers_06 = {
	construction_time = standard_construction_time
	effect_desc = watchtowers_desc

	can_construct_potential = {
		building_watchtowers_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 03 }
			scope:holder.culture = {
				has_innovation = innovation_hoardings
			}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = cheap_building_tier_6_cost
	
	max_garrison = normal_building_max_garrison_tier_6
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_6
		fort_level = normal_building_fort_level_tier_6
		supply_limit = 300
		stationed_heavy_infantry_damage_mult = low_maa_damage_tier_6
		stationed_heavy_infantry_toughness_mult = low_maa_toughness_tier_6
		stationed_light_cavalry_damage_mult = low_maa_damage_tier_6
		stationed_light_cavalry_toughness_mult = low_maa_toughness_tier_6
		travel_danger = -6
		epidemic_resistance = 8
	}
	
	county_modifier = {
		hostile_raid_time = 0.15
		supply_limit_mult = 0.05		
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = watchtowers_07
	
	ai_value = {
		base = 5
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

watchtowers_07 = {
	construction_time = standard_construction_time
	effect_desc = watchtowers_desc

	can_construct_potential = {
		building_watchtowers_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 04 }
			scope:holder.culture = {
				has_innovation = innovation_machicolations
			}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = cheap_building_tier_7_cost
	
	max_garrison = normal_building_max_garrison_tier_7
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_7
		fort_level = normal_building_fort_level_tier_7
		supply_limit = 600
		stationed_heavy_infantry_damage_mult = low_maa_damage_tier_7
		stationed_heavy_infantry_toughness_mult = low_maa_toughness_tier_7
		stationed_light_cavalry_damage_mult = low_maa_damage_tier_7
		stationed_light_cavalry_toughness_mult = low_maa_toughness_tier_7
		travel_danger = -7
		epidemic_resistance = 10
	}
	
	county_modifier = {
		hostile_raid_time = 0.15
		supply_limit_mult = 0.05		
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = watchtowers_08
	
	ai_value = {
		base = 4
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

watchtowers_08 = {
	construction_time = standard_construction_time
	effect_desc = watchtowers_desc

	can_construct_potential = {
		building_watchtowers_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 04 }
			scope:holder.culture = {
				has_innovation = innovation_machicolations
			}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = cheap_building_tier_8_cost
	
	max_garrison = normal_building_max_garrison_tier_8
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_8
		fort_level = normal_building_fort_level_tier_8
		supply_limit = 600
		stationed_heavy_infantry_damage_mult = low_maa_damage_tier_8
		stationed_heavy_infantry_toughness_mult = low_maa_toughness_tier_8
		stationed_light_cavalry_damage_mult = low_maa_damage_tier_8
		stationed_light_cavalry_toughness_mult = low_maa_toughness_tier_8
		travel_danger = -8
		epidemic_resistance = 12
	}
	
	county_modifier = {
		hostile_raid_time = 0.2
		supply_limit_mult = 0.05	
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	ai_value = {
		base = 3
		modifier = {
			add = 1
			scope:holder = {
				culture = {
					has_cultural_parameter = ai_more_likely_to_fortify
				}
			}
		}
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

### hill_forts

hill_forts_01 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_hill_forts_requirement_terrain = yes
		building_requirement_castle_city_church = { LEVEL = 01 }
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = cheap_building_tier_1_cost
	
	max_garrison = good_building_max_garrison_tier_1
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_1
		fort_level = good_building_fort_level_tier_1
		stationed_skirmishers_damage_mult = low_maa_damage_tier_1
		stationed_skirmishers_toughness_mult = low_maa_toughness_tier_1
		stationed_pikemen_damage_mult = low_maa_damage_tier_1
		stationed_pikemen_toughness_mult = low_maa_toughness_tier_1
		travel_danger = -1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = hill_forts_02

	type_icon = "icon_building_hill_forts.dds"
	
	ai_value = {
		base = 10
		ai_tier_1_building_modifier = yes
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		modifier = {
			factor = 5
			free_building_slots <= 3
			scope:holder.capital_province = this
		}
		modifier = {
			factor = 5
			free_building_slots <= 2
		}
		modifier = {
			factor = 5
			free_building_slots <= 1
		}
	}
}

hill_forts_02 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_hill_forts_requirement_terrain = yes
		building_requirement_castle_city_church = { LEVEL = 01 }
			scope:holder.culture = {
				has_innovation = innovation_motte
			}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_2_cost
	
	max_garrison = good_building_max_garrison_tier_2
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_2
		fort_level = good_building_fort_level_tier_2
		stationed_skirmishers_damage_mult = low_maa_damage_tier_2
		stationed_skirmishers_toughness_mult = low_maa_toughness_tier_2
		stationed_pikemen_damage_mult = low_maa_damage_tier_2
		stationed_pikemen_toughness_mult = low_maa_toughness_tier_2
		travel_danger = -2
	}
	county_modifier = {
		monthly_county_control_growth_factor = 0.1
		monthly_county_control_decline_factor = -0.1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = hill_forts_03
	
	ai_value = {
		base = 9
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
		modifier = { # Fill all building slots before going for upgrades
			factor = 0
			free_building_slots > 0
		}
	}
}

hill_forts_03 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_hill_forts_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 02 }
			scope:holder.culture = {
				has_innovation = innovation_battlements
			}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = cheap_building_tier_3_cost
	
	max_garrison = good_building_max_garrison_tier_3
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_3
		fort_level = good_building_fort_level_tier_3
		stationed_skirmishers_damage_mult = low_maa_damage_tier_3
		stationed_skirmishers_toughness_mult = low_maa_toughness_tier_3
		stationed_pikemen_damage_mult = low_maa_damage_tier_3
		stationed_pikemen_toughness_mult = low_maa_toughness_tier_3
		travel_danger = -3
	}
	county_modifier = {
		monthly_county_control_growth_factor = 0.1
		monthly_county_control_decline_factor = -0.1
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = hill_forts_04
	
	ai_value = {
		base = 8
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

hill_forts_04 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_hill_forts_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 02 }
			scope:holder.culture = {
				has_innovation = innovation_battlements
			}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = cheap_building_tier_4_cost
	
	max_garrison = good_building_max_garrison_tier_4
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_4
		fort_level = good_building_fort_level_tier_4
		stationed_skirmishers_damage_mult = low_maa_damage_tier_4
		stationed_skirmishers_toughness_mult = low_maa_toughness_tier_4
		stationed_pikemen_damage_mult = low_maa_damage_tier_4
		stationed_pikemen_toughness_mult = low_maa_toughness_tier_4
		travel_danger = -4
	}
	county_modifier = {
		monthly_county_control_growth_factor = 0.1
		monthly_county_control_decline_factor = -0.1
		levy_size = 0.02
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = hill_forts_05
	
	ai_value = {
		base = 7
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

hill_forts_05 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_hill_forts_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 03 }
			scope:holder.culture = {
				has_innovation = innovation_hoardings
			}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = cheap_building_tier_5_cost
	
	max_garrison = good_building_max_garrison_tier_5
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_5
		fort_level = good_building_fort_level_tier_5
		stationed_skirmishers_damage_mult = low_maa_damage_tier_5
		stationed_skirmishers_toughness_mult = low_maa_toughness_tier_5
		stationed_pikemen_damage_mult = low_maa_damage_tier_5
		stationed_pikemen_toughness_mult = low_maa_toughness_tier_5
		travel_danger = -5
	}
	county_modifier = {
		monthly_county_control_growth_factor = 0.15
		monthly_county_control_decline_factor = -0.15
		levy_size = 0.02
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = hill_forts_06
	
	ai_value = {
		base = 6
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

hill_forts_06 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_hill_forts_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 03 }
			scope:holder.culture = {
				has_innovation = innovation_hoardings
			}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = cheap_building_tier_6_cost
	
	max_garrison = good_building_max_garrison_tier_6
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_6
		fort_level = good_building_fort_level_tier_6
		stationed_skirmishers_damage_mult = low_maa_damage_tier_6
		stationed_skirmishers_toughness_mult = low_maa_toughness_tier_6
		stationed_pikemen_damage_mult = low_maa_damage_tier_6
		stationed_pikemen_toughness_mult = low_maa_toughness_tier_6
		travel_danger = -6
	}
	county_modifier = {
		monthly_county_control_growth_factor = 0.15
		monthly_county_control_decline_factor = -0.15
		levy_size = 0.02
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = hill_forts_07
	
	ai_value = {
		base = 5
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

hill_forts_07 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_hill_forts_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 04 }
			scope:holder.culture = {
				has_innovation = innovation_machicolations
			}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = cheap_building_tier_7_cost
	
	max_garrison = good_building_max_garrison_tier_7
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_7
		fort_level = good_building_fort_level_tier_7
		stationed_skirmishers_damage_mult = low_maa_damage_tier_7
		stationed_skirmishers_toughness_mult = low_maa_toughness_tier_7
		stationed_pikemen_damage_mult = low_maa_damage_tier_7
		stationed_pikemen_toughness_mult = low_maa_toughness_tier_7
		travel_danger = -7
	}
	county_modifier = {
		monthly_county_control_growth_factor = 0.15
		monthly_county_control_decline_factor = -0.15
		levy_size = 0.02
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	next_building = hill_forts_08
	
	ai_value = {
		base = 4
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}

hill_forts_08 = {
	construction_time = slow_construction_time

	can_construct_potential = {
		building_hill_forts_requirement_terrain = yes
	}

	can_construct = {
			building_requirement_castle_city_church = { LEVEL = 04 }
			scope:holder.culture = {
				has_innovation = innovation_machicolations
			}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = cheap_building_tier_8_cost
	
	max_garrison = good_building_max_garrison_tier_8
	province_modifier = {
		defender_holding_advantage = normal_building_advantage_tier_8
		fort_level = good_building_fort_level_tier_8
		stationed_skirmishers_damage_mult = low_maa_damage_tier_8
		stationed_skirmishers_toughness_mult = low_maa_toughness_tier_8
		stationed_pikemen_damage_mult = low_maa_damage_tier_8
		stationed_pikemen_toughness_mult = low_maa_toughness_tier_8
		travel_danger = -8
	}
	county_modifier = {
		monthly_county_control_growth_factor = 0.2
		monthly_county_control_decline_factor = -0.2
		levy_size = 0.02
	}

	on_complete = {
		#Mandala Creator Aspect
		creator_mandala_built_regular_building_piety_effect = yes
	}
	
	ai_value = {
		base = 3
		ai_general_building_modifier = yes
		directive_to_fortify_modifier = yes
	}
}
