﻿############################
# Military Buildings
############################

fortress_building = {
	fort_level = 1
	local_defensive = 0.05
	local_manpower_modifier = -0.05
	local_country_civilization_value = 1
	cost = 160
	time = 720
	
	modification_display = {
		0 = fort_level
		1 = value_manpower
		2 = local_defensive
		3 = value_civilization_cap
	}
#AI handles fort building in code. It's too complicated to script this
}

fortress_ramparts_building = {
	local_combat_width_modifier = -3
	local_defensive = 0.50
	local_hostile_attrition = 1
	local_population_capacity_modifier = -0.1
	cost = 160
	time = 1440
	
	max_amount = 1
	
	potential = {
		has_city_status = yes
	}
	
	allow = { 
		AND = {
			exists = owner
			owner = {
				invention = global_defensive_inv_3
			}
		}
		fort_level >= 1
	}
	
	modification_display = {
		0 = local_defensive
		1 = value_population_capacity
		2 = local_combat_width_modifier
	}

	chance = {
		base = 1
		modifier = {
			factor = brc_fortress_ramparts
		}
	}
}

port_building = {
	local_base_trade_routes = 0.25
	local_ship_recruit_speed = 0.15
	local_migration_speed = 0.1
	local_migration_attraction = 0.1
	local_country_civilization_value = 1
	
	allow = {
		can_have_port = yes
	}

	max_amount = 6
	
	cost = 160
	time = 180
	modification_display = {
		0 = local_base_trade_routes
		1 = local_ship_recruit_speed
		2 = local_migration_attraction
	}
	
	chance = {
		base = 1
		modifier = {
			factor = brc_port
		}
	}
}

barracks_building = {
	local_manpower_modifier = 0.2
	local_freemen_desired_pop_ratio = 0.15
	local_freemen_happyness = happiness_large_svalue
	local_migration_speed_modifier = -0.25
	local_country_civilization_value = 5
	max_amount = 1

	cost = 200
	time = 720
	
	potential = {
		has_city_status = no
	}
	
	modification_display = {
		0 = value_manpower
		1 = local_freemen_happyness
		2 = local_migration_speed_modifier
		3 = value_civilization_cap
	}

	chance = {
		base = 1
		modifier = {
			factor = brc_barracks
		}
	}
}

foundry_building = { #Foundry
	base_resources = 1	
	local_slaves_output = 0.05
	local_freemen_output = 0.05
	local_country_civilization_value = 5
	cost = 320
	time = 360
	
	max_amount = 1
	
	potential = {
		has_city_status = yes
	}
	
	allow = {
		AND = {
			exists = owner
			owner = {
				invention = centralised_production_inv
			}
		}
	}
	
	modification_display = {
		0 = value_num_of_goods_produced
		1 = local_slaves_output
		2 = local_freemen_output
		3 = value_civilization_cap
		
	}
	
	chance = {
		base = 1
		modifier = {
			factor = brc_foundry
		}
	}
}

##############################
# Economical / Management
##############################


aqueduct_building = { #Aqueduct
	local_population_capacity = 4
	cost = 160
	time = 720

	max_amount = 15

	potential = {
		has_city_status = yes
	}
	
	allow = {
		civilization_value >= 30
	}
	
	modification_display = {
		0 = value_population_capacity
	}
	
	chance = {
		base = 1
		modifier = {
			factor = brc_aqueduct
		}
	}
}

temple_building = {
	local_pop_conversion_speed = 2
	local_happiness_for_same_religion_modifier = 0.1
	city_monthly_state_loyalty = 0.03
	local_country_civilization_value = 5
	
	max_amount = 1
	
	cost = 320
	time = 360

	potential = {
		has_city_status = yes
	}
	
	allow = {
		AND = {
			exists = owner
			owner = {
				invention = global_unrest_inv_2
			}
		}
	}
	
	modification_display = {
		0 = local_pop_conversion_speed
		1 = local_happiness_for_same_religion_modifier
		2 = value_state_loyalty
	}
	
	chance = {
		base = 1
		modifier = {
			factor = brc_temple
		}
	}
}

population_building = { #Granary
	local_food_capacity = 300
	local_monthly_food_modifier = 0.03
	local_country_civilization_value = 2
	
	cost = 100
	time = 180

	potential = {
		has_city_status = yes
	}
	
	modification_display = {
		0 = local_food_capacity
		1 = local_monthly_food_modifier
		2 = value_civilization_cap
	}

	chance = {
		base = 1
		modifier = {
			factor = brc_granary
		}
	}
}

#################################
# Population 
################################

theathre_building = { #Theater
	local_pop_assimilation_speed = 2
	local_happiness_for_same_culture_modifier = 0.1
	city_monthly_state_loyalty = 0.03
	local_country_civilization_value = 5
	
	cost = 320
	time = 360
	
	max_amount = 1
	
	potential = {
		has_city_status = yes
	}
	
	allow = {
		AND = {
			exists = owner
			owner = {
				invention = agressive_expansion_monthly_decay_inv_3
			}
		}
	}
	
	modification_display = {
		0 = local_pop_assimilation_speed
		1 = local_happiness_for_same_culture_modifier
		2 = value_state_loyalty
		3 = value_civilization_cap
	}
	
	chance = {
		base = 1
		modifier = {
			factor = brc_theatre
		}
	}
}

library_building = { #Library
	local_research_points_modifier = 0.05
	local_pop_conversion_speed_modifier = 0.025
	local_country_civilization_value = 2
	
	cost = 100
	time = 180
	
	potential = {
		has_city_status = yes
	}
	
	modification_display = {
		0 = value_research
		1 = local_pop_conversion_speed_modifier
		2 = value_civilization_cap
	}
	
	chance = {
		base = 1
		modifier = {
			factor = brc_library
		}
	}
}

academy_building = { #Academy
	local_nobles_desired_pop_ratio = 0.05
	local_nobles_happyness = 0.04
	local_monthly_civilization = 0.01
	local_country_civilization_value = 3
	
	cost = 160
	time = 180
	
	max_amount = 3
	
	potential = {
		has_city_status = yes
	}
	
	modification_display = {
		0 = local_nobles_desired_pop_ratio
		1 = local_nobles_happyness
		2 = value_civilization_increase
		3 = value_civilization_cap
	}
	
	chance = {
		base = 1
		modifier = {
			factor = brc_academy
		}
	}
}

commerce_building = { #Market
	local_base_trade_routes_modifier = 0.025
	local_base_trade_routes = 0.1
	local_pop_assimilation_speed_modifier = 0.025
	local_country_civilization_value = 2

	cost = 100
	time = 180
	
	potential = {
		has_city_status = yes
	}
	
	modification_display = {
		0 = local_base_trade_routes_modifier
		1 = local_base_trade_routes
		2 = local_pop_assimilation_speed_modifier
		3 = value_civilization_cap
	}
	
	chance = {
		base = 1
		modifier = {
			factor = brc_commerce
		}
	}
}

court_building = { #Court of Law
	local_citizen_desired_pop_ratio = 0.1
	local_citizen_happyness = 0.06
	city_monthly_state_loyalty = 0.01
	local_country_civilization_value = 3
	
	max_amount = 3
	
	cost = 160
	time = 180

	potential = {
		has_city_status = yes
	}
	
	modification_display = {
		0 = local_citizen_desired_pop_ratio
		1 = local_citizen_happyness
		2 = value_state_loyalty
		3 = value_civilization_cap
	}
	
	chance = {		
		base = 1
		modifier = {
			factor = brc_court
		}
	}
}

military_building = { #Training Camp
	local_manpower_modifier = 0.075
	local_country_civilization_value = 2
	
	cost = 100
	time = 180
	
	potential = {
		has_city_status = yes
	}

	modification_display = {
		0 = value_manpower
		1 = value_civilization_cap
	}
	
	chance = {		
		base = 1
		modifier = {
			factor = brc_military
		}
	}
}

forum_building = { #Forum
	local_freemen_desired_pop_ratio = 0.1
	local_freemen_happyness = 0.06
	local_monthly_food_modifier = 0.025
	local_country_civilization_value = 3
	
	max_amount = 3
	
	cost = 160
	time = 180

	potential = {
		has_city_status = yes
	}
	
	modification_display = {
		0 = local_freemen_desired_pop_ratio
		1 = local_freemen_happyness
		2 = local_monthly_food_modifier
		3 = value_civilization_cap
	}
	
	chance = {	
		base = 1	
		modifier = {
			factor = brc_forum
		}
	}
}

town_hall_building = { #Tax Office
	local_tax_modifier = 0.1
	local_country_civilization_value = 2
	
	cost = 100
	time = 180

	potential = {
		has_city_status = yes
	}
	
	modification_display = {
		0 = value_income
		1 = value_civilization_cap
	}
	
	chance = {		
		base = 1
		modifier = {
			factor = brc_town_hall
		}
	}
}


workshop_building = { #Mill
	local_goods_from_slaves = -1
	local_slaves_desired_pop_ratio = 0.1
	local_slaves_happyness = 0.06
	local_migration_attraction = 3
	local_country_civilization_value = 3
	
	cost = 160
	time = 180
	
	max_amount = 3
	
	potential = {
		has_city_status = yes
	}
	
	modification_display = {
		0 = value_num_of_goods_produced
		1 = local_slaves_desired_pop_ratio
		2 = local_slaves_happyness
		3 = value_civilization_cap
	}

	chance = {
		base = 1
		modifier = {
			factor = brc_workshop
		}
	}
}


### Settlement Buildings

latifundia_building = { #Slave Estate
	local_slaves_output = 0.3
	local_monthly_food_modifier = 0.4
	local_goods_from_slaves = -3
	local_migration_attraction = 3
	local_migration_speed_modifier = -0.25
	local_country_civilization_value = 5
	max_amount = 1
	potential = {
		has_city_status = no
	}

	cost = 200
	time = 730
	
	modification_display = {
		0 = value_num_of_goods_produced
		1 = local_slaves_output
		2 = local_monthly_food_modifier
		3 = value_civilization_cap
	}
	
	chance = {
		base = 1
		modifier = {
			factor = brc_latifundia
		}
	}
}

slave_mine_building = { #Mine
	local_goods_from_slaves = -5
	base_resources = 1	
	local_migration_attraction = 3
	local_migration_speed_modifier = -0.25
	local_country_civilization_value = 5
	max_amount = 1
	potential = {
		has_city_status = no
	}
	
	allow = {
		has_minable_trade_good_trigger = yes 
	}
	
	cost = 200
	time = 730
	
	modification_display = {
		0 = value_num_of_goods_produced
		1 = local_migration_speed_modifier
		2 = value_civilization_cap
	}
	
	chance = {
		base = 1
		modifier = {
			factor = brc_slave_mine
		}
	}
}

basic_settlement_infratructure_building = { #Farming Settlement
	local_monthly_food_modifier = 0.5
	local_goods_from_slaves = -5
	base_resources = 1	
	local_migration_attraction = 3
	local_migration_speed_modifier = -0.25
	local_country_civilization_value = 5
	max_amount = 1
	potential = {
		has_city_status = no
	}
	
	allow = {
		has_food_trade_good_trigger = yes
	}
	
	cost = 200
	time = 730
	
	modification_display = {
		0 = value_num_of_goods_produced
		1 = local_monthly_food_modifier
		2 = local_migration_speed_modifier
	}
	
	chance = {
		base = 1
		modifier = {
			factor = brc_basic_settlement_infratructure
		}
	}
}

hill_fort = { #Tribal Settlement
	local_population_capacity_modifier = 0.1
	local_tribesmen_happyness = happiness_large_svalue
	local_tribesmen_output = 0.3
	local_citizen_desired_pop_ratio = -0.025
	local_migration_attraction = 3
	max_amount = 1
	potential = {
		has_city_status = no
	}
	
	cost = 200
	time = 730
	
	modification_display = {
		0 = value_population_capacity
		1 = local_citizen_desired_pop_ratio
		2 = local_tribesmen_output

	}
	
	chance = {
		base = 1
		modifier = {
			factor = brc_hill_fort
		}
	}
}

local_forum_building = { #Provincial Legation
	local_pop_assimilation_speed_modifier = 0.15 #vanilla value, lowered from Invictus 1 [100%!]
	local_migration_speed_modifier = 0.75 #vanilla value, lowered from Invictus 1.5
	local_migration_attraction = 3.5
	max_amount = 1
	potential = {
		has_city_status = no
	}
	
	cost = 160
	time = 180
	
	modification_display = {
		0 = local_pop_assimilation_speed_modifier 
		1 = local_migration_speed_modifier
		2 = value_civilization_cap
	}

	chance = {
		base = 1
		modifier = {
			factor = brc_local_forum
		}
	}
}
