# Not technically a terrain type, here for modding convenience
castle = {
	# Shipyard, gives galleys
	ca_shipyard_1 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 1
			castle_building_allow = yes
		}
		gold_cost = 100
		build_time = 365
		galleys = 6
		ai_creation_factor = 100

		extra_tech_building_start = 0.3
	}
	ca_shipyard_2 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 2
			castle_building_allow = yes
		}
		upgrades_from = ca_shipyard_1
		gold_cost = 100
		build_time = 730
		galleys = 7
		ai_creation_factor = 99

		extra_tech_building_start = 0.3
	}
	ca_shipyard_3 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 3
			castle_building_allow = yes
		}
		upgrades_from = ca_shipyard_2
		gold_cost = 100
		build_time = 1095
		galleys = 8
		ai_creation_factor = 98

		extra_tech_building_start = 0.3
	}
	ca_shipyard_4 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 4
			castle_building_allow = yes
		}
		upgrades_from = ca_shipyard_3
		gold_cost = 100
		build_time = 1460
		galleys = 9
		ai_creation_factor = 97

		extra_tech_building_start = 0.3
	}
}

city = {
	# Port, gives income
	ct_port_1 = {
		desc = ct_port_1_desc
		port = yes
		trigger = {
			TECH_TRADE_PRACTICES >= 0
			city_building_allow = yes
		}
		gold_cost = 100
		build_time = 365
		tax_income = 3
		ai_creation_factor = 110

		extra_tech_building_start = 0.6
	}
	ct_port_2 = {
		desc = ct_port_1_desc
		port = yes
		trigger = {
			TECH_TRADE_PRACTICES >= 1
			city_building_allow = yes
		}
		prerequisites = { ct_wall_1 }
		upgrades_from = ct_port_1
		gold_cost = 120
		build_time = 547
		tax_income = 3
		ai_creation_factor = 109

		extra_tech_building_start = 0.2
	}
	ct_port_3 = {
		desc = ct_port_1_desc
		port = yes
		trigger = {
			TECH_TRADE_PRACTICES >= 3
			city_building_allow = yes
		}
		prerequisites = { ct_wall_2 }
		upgrades_from = ct_port_2
		gold_cost = 200
		build_time = 730
		tax_income = 3
		ai_creation_factor = 108

		extra_tech_building_start = 0.2
	}
	ct_port_4 = {
		desc = ct_port_1_desc
		port = yes
		trigger = {
			TECH_TRADE_PRACTICES >= 4
			city_building_allow = yes
		}
		upgrades_from = ct_port_3
		gold_cost = 300
		build_time = 1095
		tax_income = 3
		ai_creation_factor = 107

		extra_tech_building_start = 0.2
	}
	ct_port_5 = {
		desc = ct_port_1_desc
		port = yes
		trigger = {
			TECH_TRADE_PRACTICES >= 6
			city_building_allow = yes
		}
		upgrades_from = ct_port_4
		gold_cost = 400
		build_time = 2190
		tax_income = 3
		ai_creation_factor = 106

		extra_tech_building_start = 0.2
	}

	# Shipyard, gives galleys
	ct_shipyard_1 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 1
			city_building_allow = yes
		}
		gold_cost = 100
		build_time = 365
		galleys = 7
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ct_shipyard_2 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 2
			city_building_allow = yes
		}
		upgrades_from = ct_shipyard_1
		gold_cost = 100
		build_time = 730
		galleys = 8
		ai_creation_factor = 99

		extra_tech_building_start = 0.2
	}
	ct_shipyard_3 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 3
			city_building_allow = yes
		}
		upgrades_from = ct_shipyard_2
		gold_cost = 100
		build_time = 1095
		galleys = 9
		ai_creation_factor = 98

		extra_tech_building_start = 0.2
	}
	ct_shipyard_4 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 4
			city_building_allow = yes
		}
		upgrades_from = ct_shipyard_3
		gold_cost = 100
		build_time = 1460
		galleys = 10
		ai_creation_factor = 97

		extra_tech_building_start = 0.2
	}
}

temple = {
	# Shipyard, gives galleys
	tp_shipyard_1 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 1
			temple_building_allow = yes
		}
		gold_cost = 100
		build_time = 365
		galleys = 6
		ai_creation_factor = 100

		extra_tech_building_start = 0.4
	}
	tp_shipyard_2 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 2
			temple_building_allow = yes
		}
		upgrades_from = tp_shipyard_1
		gold_cost = 100
		build_time = 730
		galleys = 7
		ai_creation_factor = 99

		extra_tech_building_start = 0.4
	}
	tp_shipyard_3 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 3
			temple_building_allow = yes
		}
		upgrades_from = tp_shipyard_2
		gold_cost = 100
		build_time = 1095
		galleys = 8
		ai_creation_factor = 98

		extra_tech_building_start = 0.4
	}
	tp_shipyard_4 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 4
			temple_building_allow = yes
		}
		upgrades_from = tp_shipyard_3
		gold_cost = 100
		build_time = 1460
		galleys = 9
		ai_creation_factor = 97

		extra_tech_building_start = 0.4
	}
}

tribal = {
	# Shipyard
	tb_shipyard_1 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 1
			tribal_building_allow = yes
		}
		prestige_cost = 100
		build_time = 365
		galleys = 6
		ai_creation_factor = 96
		ai_republic_modifier = 5

		convert_to_castle = ca_shipyard_1
		convert_to_city = ct_shipyard_1

		extra_tech_building_start = 0.3
	}
	tb_shipyard_2 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 2
			tribal_building_allow = yes
		}
		upgrades_from = tb_shipyard_1
		prestige_cost = 200
		build_time = 730
		galleys = 7
		ai_creation_factor = 95
		ai_republic_modifier = 5

		convert_to_castle = ca_shipyard_2
		convert_to_city = ct_shipyard_2

		extra_tech_building_start = 0.3
	}
	tb_shipyard_3 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 3
			tribal_building_allow = yes
		}
		upgrades_from = tb_shipyard_2
		prestige_cost = 300
		build_time = 1095
		galleys = 8
		ai_creation_factor = 94
		ai_republic_modifier = 5

		convert_to_castle = ca_shipyard_3
		convert_to_city = ct_shipyard_3

		extra_tech_building_start = 0.3
	}
	tb_shipyard_4 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL >= 4
			tribal_building_allow = yes
		}
		upgrades_from = tb_shipyard_3
		prestige_cost = 400
		build_time = 1460
		galleys = 9
		ai_creation_factor = 93
		ai_republic_modifier = 5

		convert_to_castle = ca_shipyard_4
		convert_to_city = ct_shipyard_4

		extra_tech_building_start = 0.3
	}
}

nomad = {
	# HARBOR
	no_harbor_1 = {
		desc = no_harbor_desc
		trigger = {
			is_coastal = yes
			FROM = { TECH_NAVAL >= 0 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = { is_coastal = yes }
		}
		gold_cost = 60
		build_time = 600
		galleys = 7
		ai_creation_factor = 97
		extra_tech_building_start = 1

		nomad_tax_modifier = 0.02
	}
	no_harbor_2 = {
		desc = no_harbor_desc
		trigger = {
			is_coastal = yes
			FROM = { TECH_NAVAL >= 1 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = { is_coastal = yes }
		}
		gold_cost = 90
		build_time = 700
		galleys = 8
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_harbor_1

		nomad_tax_modifier = 0.02

		convert_to_tribal = tb_shipyard_1
	}
	no_harbor_3 = {
		desc = no_harbor_desc
		trigger = {
			is_coastal = yes
			FROM = { TECH_NAVAL >= 2 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = { is_coastal = yes }
		}
		gold_cost = 120
		build_time = 800
		galleys = 9
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_harbor_2

		nomad_tax_modifier = 0.02
	}
	no_harbor_4 = {
		desc = no_harbor_desc
		trigger = {
			is_coastal = yes
			FROM = { TECH_NAVAL >= 3 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = { is_coastal = yes }
		}
		gold_cost = 150
		build_time = 900
		galleys = 10
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_harbor_3

		nomad_tax_modifier = 0.02

		convert_to_tribal = tb_shipyard_2
	}
	no_harbor_5 = {
		desc = no_harbor_desc
		trigger = {
			is_coastal = yes
			FROM = { TECH_NAVAL >= 4 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = { is_coastal = yes }
		}
		gold_cost = 180
		build_time = 1000
		galleys = 11
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_harbor_4

		nomad_tax_modifier = 0.03
	}
	no_harbor_6 = {
		desc = no_harbor_desc
		trigger = {
			is_coastal = yes
			FROM = { TECH_NAVAL >= 5 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = { is_coastal = yes }
		}
		gold_cost = 220
		build_time = 1100
		galleys = 12
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_harbor_5

		nomad_tax_modifier = 0.03

		convert_to_tribal = tb_shipyard_3
	}
	no_harbor_7 = {
		desc = no_harbor_desc
		trigger = {
			is_coastal = yes
			FROM = { TECH_NAVAL >= 6 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = { is_coastal = yes }
		}
		gold_cost = 260
		build_time = 1200
		galleys = 13
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_harbor_6

		nomad_tax_modifier = 0.03
	}
	no_harbor_8 = {
		desc = no_harbor_desc
		trigger = {
			is_coastal = yes
			FROM = { TECH_NAVAL >= 7 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = { is_coastal = yes }
		}
		gold_cost = 300
		build_time = 1300
		galleys = 14
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_harbor_7

		nomad_tax_modifier = 0.04

		convert_to_tribal = tb_shipyard_4
	}

	# FISHING VILLAGE
	no_fishing_village_1 = {
		desc = no_fishing_village_desc
		trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
			FROM = { TECH_CITY_CONSTRUCTION >= 0 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
		}
		gold_cost = 20
		build_time = 180
		ai_creation_factor = 97
		extra_tech_building_start = 1

		population_growth = 0.01
	}
	no_fishing_village_2 = {
		desc = no_fishing_village_desc
		trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
			FROM = { TECH_CITY_CONSTRUCTION >= 0 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
		}
		gold_cost = 35
		build_time = 240
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_fishing_village_1

		population_growth = 0.01
	}
	no_fishing_village_3 = {
		desc = no_fishing_village_desc
		trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
			FROM = { TECH_CITY_CONSTRUCTION >= 1 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
		}
		gold_cost = 50
		build_time = 360
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_fishing_village_2

		population_growth = 0.01
	}
	no_fishing_village_4 = {
		desc = no_fishing_village_desc
		trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
			FROM = { TECH_CITY_CONSTRUCTION >= 1 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
		}
		gold_cost = 70
		build_time = 480
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_fishing_village_3

		population_growth = 0.02
	}
	no_fishing_village_5 = {
		desc = no_fishing_village_desc
		trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
			FROM = { TECH_CITY_CONSTRUCTION >= 2 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
		}
		gold_cost = 90
		build_time = 540
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_fishing_village_4

		population_growth = 0.02
	}
	no_fishing_village_6 = {
		desc = no_fishing_village_desc
		trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
			FROM = { TECH_CITY_CONSTRUCTION >= 2 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
		}
		gold_cost = 120
		build_time = 600
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_fishing_village_5

		population_growth = 0.02
	}
	no_fishing_village_7 = {
		desc = no_fishing_village_desc
		trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
			FROM = { TECH_CITY_CONSTRUCTION >= 3 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
		}
		gold_cost = 150
		build_time = 660
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_fishing_village_6

		population_growth = 0.03
	}
	no_fishing_village_8 = {
		desc = no_fishing_village_desc
		trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
			FROM = { TECH_CITY_CONSTRUCTION >= 3 }
			nomad_building_allow = yes
		}
		is_active_trigger = {
			ROOT = {
				OR = {
					is_coastal = yes
					borders_major_river = yes
					borders_lake = yes
				}
			}
		}
		gold_cost = 180
		build_time = 720
		ai_creation_factor = 97
		extra_tech_building_start = 1

		upgrades_from = no_fishing_village_7

		population_growth = 0.03
	}
}