﻿@holding_illustration_western = "gfx/interface/illustrations/holding_types/city_western.dds"
@holding_illustration_india = "gfx/interface/illustrations/holding_types/city_india.dds"
@holding_illustration_mediterranean = "gfx/interface/illustrations/holding_types/city_mediterranean.dds"
@holding_illustration_mena = "gfx/interface/illustrations/holding_types/city_mena.dds"

city_01 = {
	construction_time = slow_construction_time
	
	asset = {
		type = pdxmesh
		names = {
			"western_city_01_a_mesh"
			"western_city_01_b_mesh"
			"western_city_01_c_mesh"
		}
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/western_city" soundparameter = { "Tier" = 0 } }
	}
	
	asset = {
		type = pdxmesh
		names = {
			"building_mena_city_01_mesh"
		}
		illustration = @holding_illustration_mena
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/mena_city" soundparameter = { "Tier" = 0 } }
		graphical_regions = { graphical_mena }
	}
	
	asset = {
		type = pdxmesh
		names = {
			"building_indian_city_01_mesh"
		}
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/indian_city" soundparameter = { "Tier" = 0 } }
		graphical_regions = { graphical_india }
	}
	
	asset = {
		type = pdxmesh
		name = "building_mediterranean_city_01_mesh"
		illustration = @holding_illustration_mediterranean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/mediterranean_city" soundparameter = { "Tier" = 0 } }
		graphical_regions = { graphical_mediterranean }
	}

	can_construct_potential = {
		building_requirement_tribal = no
		barony_cannot_construct_holding = no
	}
	
	can_construct = {
		culture = {
			has_innovation = innovation_city_planning
		}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal_holding_in_county = no
	}
	cost_gold = 500
	
	levy = poor_building_levy_tier_2
	garrison = normal_building_garrison_tier_1
	province_modifier = {
		monthly_income = good_building_tax_tier_2
	}
	
	flag = city
	next_building = city_02

	type_icon = "icon_building_guild_halls.dds"
	
	ai_value = {
		base = 0
		modifier = {
			add = 12 ## Not 100 please. Paradox please.
			scope:holder = {
				domain_limit_available < 1
			}
		}		
		modifier = {
			factor = 0
			scope:holder = {
				has_government = theocracy_government
			}
		}
	}
}

city_02 = {
	construction_time = slow_construction_time
	
	asset = {
		type = pdxmesh
		names = {
			"western_city_01_a_mesh"
			"western_city_01_b_mesh"
			"western_city_01_c_mesh"
		}
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/western_city" soundparameter = { "Tier" = 1 } }
	}
	
	asset = {
		type = pdxmesh
		names = {
			"building_mena_city_01_mesh"
		}
		illustration = @holding_illustration_mena
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/mena_city" soundparameter = { "Tier" = 1 } }
		graphical_regions = { graphical_mena }
	}
	
	asset = {
		type = pdxmesh
		names = {
			"building_indian_city_01_mesh"
		}
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/indian_city" soundparameter = { "Tier" = 1 } }
		graphical_regions = { graphical_india }
	}
	
	asset = {
		type = pdxmesh
		name = "building_mediterranean_city_01_mesh"
		illustration = @holding_illustration_mediterranean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/mediterranean_city" soundparameter = { "Tier" = 1 } }
		graphical_regions = { graphical_mediterranean }
	}

	can_construct_potential = {
		building_requirement_tribal = no
	}
	can_construct = {
		culture = {
			has_innovation = innovation_manorialism
		}
	}
	cost_gold = 500
	
	levy = poor_building_levy_tier_4
	garrison = normal_building_garrison_tier_2
	province_modifier = {
		monthly_income = good_building_tax_tier_4
		levy_size = 0.25
		garrison_size = 0.25
	}
	flag = city
	next_building = city_03
	ai_value = {
		base = 1 ## Build after other buildings - see later
		modifier = { ## But Kings/Emperors please upgrade your cap asap!
			factor = 5
			scope:holder = {
				OR = {
				primary_title.tier = tier_kingdom
				primary_title.tier = tier_empire
				}
			}
			duchy = {is_capital_barony = yes}
		}
		modifier = {
			add = {
				value = 3 ## Castles have 4
				multiply = combined_building_level ## The more buildings we have, the more worth it this becomes.
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} } ## Topmost liege shouldn't construct in vassal holdings unless no better option.
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
	}
}

city_03 = {
	construction_time = slow_construction_time
	
	asset = {
		type = pdxmesh
		names = {
			"building_western_city_02_a_mesh"
		}
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/western_city" soundparameter = { "Tier" = 2 } }
	}
	
	asset = {
		type = pdxmesh
		names = {
			"building_mena_city_02_mesh"
		}
		illustration = @holding_illustration_mena
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/mena_city" soundparameter = { "Tier" = 2 } }
		graphical_regions = { graphical_mena }
	}
	
	asset = {
		type = pdxmesh
		names = {
			"building_indian_city_02_mesh"
		}
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/indian_city" soundparameter = { "Tier" = 2 } }
		graphical_regions = { graphical_india }
	}
	
	asset = {
		type = pdxmesh
		names = {
			"building_mediterranean_city_02_mesh"
		}
		illustration = @holding_illustration_mediterranean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/mediterranean_city" soundparameter = { "Tier" = 2 } }
		graphical_regions = { graphical_mediterranean }
	}

	can_construct_potential = {
		building_requirement_tribal = no
	}
	can_construct = {
		culture = {
			has_innovation = innovation_windmills
		}
	}
	cost_gold = 500
	next_building = city_04
	
	levy = poor_building_levy_tier_6
	garrison = normal_building_garrison_tier_3
	province_modifier = {
		monthly_income = good_building_tax_tier_6
		levy_size = 0.5
		garrison_size = 0.5
	}
	flag = city
	ai_value = {
		base = 1 ## Build after other buildings - see later
		modifier = { ## But Kings/Emperors please upgrade your cap asap!
			factor = 5
			scope:holder = {
				OR = {
				primary_title.tier = tier_kingdom
				primary_title.tier = tier_empire
				}
			}
			duchy = {is_capital_barony = yes}
		}
		modifier = {
			add = {
				value = 3 ## Castles have 4
				multiply = combined_building_level ## The more buildings we have, the more worth it this becomes.
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} } ## Topmost liege shouldn't construct in vassal holdings unless no better option.
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
	}
}

city_04 = {
	construction_time = slow_construction_time
	
	asset = {
		type = pdxmesh
		names = {
			"building_western_city_02_a_mesh"
		}
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/western_city" soundparameter = { "Tier" = 2 } }
	}
	
	asset = {
		type = pdxmesh
		names = {
			"building_mena_city_02_mesh"
		}
		illustration = @holding_illustration_mena
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/mena_city" soundparameter = { "Tier" = 2 } }
		graphical_regions = { graphical_mena }
	}
	
	asset = {
		type = pdxmesh
		names = {
			"building_indian_city_02_mesh"
		}
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/indian_city" soundparameter = { "Tier" = 2 } }
		graphical_regions = { graphical_india }
	}
	
	asset = {
		type = pdxmesh
		names = {
			"building_mediterranean_city_02_mesh"
		}
		illustration = @holding_illustration_mediterranean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/City/mediterranean_city" soundparameter = { "Tier" = 2 } }
		graphical_regions = { graphical_mediterranean }
	}
	can_construct_potential = {
		building_requirement_tribal = no
	}
	can_construct = {
		culture = {
			has_innovation = innovation_cranes
		}
	}
	cost_gold = 500
	
	levy = poor_building_levy_tier_8
	garrison = normal_building_garrison_tier_7
	province_modifier = {
		monthly_income = good_building_tax_tier_8
		levy_size = 1.0
		garrison_size = 1.0
	}
	flag = city
	ai_value = {
		base = 1 ## Build after other buildings - see later
		modifier = { ## But Kings/Emperors please upgrade your cap asap!
			factor = 5
			scope:holder = {
				OR = {
				primary_title.tier = tier_kingdom
				primary_title.tier = tier_empire
				}
			}
			duchy = {is_capital_barony = yes}
		}
		modifier = {
			add = {
				value = 3 ## Castles have 4
				multiply = combined_building_level ## The more buildings we have, the more worth it this becomes.
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} } ## Topmost liege shouldn't construct in vassal holdings unless no better option.
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
	}
}


####
#
# City Buildings
#
####

### Guild Halls

guild_halls_01 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		has_building_or_higher = city_01
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_1_cost
	
	province_modifier = {
		monthly_income = normal_building_tax_tier_1
		tax_mult = 0.04
	}
	county_modifier = {
		development_growth_factor = 0.05
	}
	
	next_building = guild_halls_02

	type_icon = "icon_building_guild_halls.dds"
	
	ai_value = {
		base = 10
		modifier = {
			add = 15
			scope:holder = {
				has_government = republic_government
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
	}
}

guild_halls_02 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		has_building_or_higher = city_01
		culture = {
			has_innovation = innovation_crop_rotation
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_2_cost
	
	province_modifier = {
		monthly_income = normal_building_tax_tier_2
		tax_mult = 0.07
	}
	county_modifier = {
		development_growth_factor = 0.1
	}
	
	next_building = guild_halls_03
	ai_value = {
		base = 0
		modifier = {
			add = 9
			scope:holder = {
				has_government = republic_government
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
	}
}

guild_halls_03 = {
	construction_time = standard_construction_time

	can_construct = {
		has_building_or_higher = city_02
		culture = {
			has_innovation = innovation_manorialism
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_3_cost
	
	province_modifier = {
		monthly_income = normal_building_tax_tier_3
		tax_mult = 0.1
	}
	county_modifier = {
		development_growth_factor = 0.15
	}
	
	next_building = guild_halls_04
	ai_value = {
		base = 0
		modifier = {
			add = 8
			scope:holder = {
				has_government = republic_government
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
	}
}

guild_halls_04 = {
	construction_time = standard_construction_time

	can_construct = {
		has_building_or_higher = city_02
		culture = {
			has_innovation = innovation_manorialism
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_4_cost
	
	province_modifier = {
		monthly_income = normal_building_tax_tier_4
		tax_mult = 0.13
	}
	county_modifier = {
		development_growth_factor = 0.2
	}
	
	next_building = guild_halls_05
	ai_value = {
		base = 0
		modifier = {
			add = 7
			scope:holder = {
				has_government = republic_government
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
	}
}

guild_halls_05 = {
	construction_time = standard_construction_time

	can_construct = {
		has_building_or_higher = city_03
		culture = {
			has_innovation = innovation_windmills
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_5_cost
	
	province_modifier = {
		monthly_income = normal_building_tax_tier_5
		tax_mult = 0.16
	}
	county_modifier = {
		development_growth_factor = 0.25
	}
	
	next_building = guild_halls_06
	ai_value = {
		base = 0
		modifier = {
			add = 6
			scope:holder = {
				has_government = republic_government
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
	}
}

guild_halls_06 = {
	construction_time = standard_construction_time

	can_construct = {
		has_building_or_higher = city_03
		culture = {
			has_innovation = innovation_windmills
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_6_cost
	
	province_modifier = {
		monthly_income = normal_building_tax_tier_6
		tax_mult = 0.19
	}
	county_modifier = {
		development_growth_factor = 0.3
	}
	
	next_building = guild_halls_07
	ai_value = {
		base = 0
		modifier = {
			add = 5
			scope:holder = {
				has_government = republic_government
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
	}
}

guild_halls_07 = {
	construction_time = standard_construction_time

	can_construct = {
		has_building_or_higher = city_04
		culture = {
			has_innovation = innovation_cranes
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_7_cost
	
	province_modifier = {
		monthly_income = normal_building_tax_tier_7
		tax_mult = 0.22
	}
	county_modifier = {
		development_growth_factor = 0.35
	}
	
	next_building = guild_halls_08
	ai_value = {
		base = 0
		modifier = {
			add = 4
			scope:holder = {
				has_government = republic_government
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
	}
}

guild_halls_08 = {
	construction_time = standard_construction_time

	can_construct = {
		has_building_or_higher = city_04
		culture = {
			has_innovation = innovation_cranes
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = normal_building_tier_8_cost
	
	province_modifier = {
		monthly_income = normal_building_tax_tier_8
		tax_mult = 0.25
	}
	county_modifier = {
		development_growth_factor = 0.4
	}
	
	ai_value = {
		base = 0
		modifier = {
			add = 3
			scope:holder = {
				has_government = republic_government
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
	}
}
