﻿# Townsquare

Townsquare_01 = {
	construction_time = mbrxxx_construction_time_half_year

	is_enabled = {
		building_requirement_tribal = yes
	}
	can_construct_potential = {
		has_building_or_higher = tribe_01
	}
	can_construct_showing_failures_only = {
		scope:holder = {
			has_government = tribal_government
		}
	}	
	cost_prestige = expensive_building_tier_1_cost
	cost_gold = tribal_building_tier_1_cost


	character_modifier = {
		monthly_piety = 0.1
		monthly_prestige = 0.1
		county_fertility_growth_mult = 0.35
	}
	province_modifier = {
		monthly_income = poor_building_tax_tier_1
	}
	county_modifier = {
		development_growth_factor = 0.10
	}
	
	next_building = Townsquare_02

	type_icon = "icon_building_Town_square.dds" #works
	
	ai_value = {
		base = 1
	}

	flag = mbrxxx_building
	flag = MRBXXX_foundation
	flag = mbrxxx_townsquare
}

Townsquare_02 = {
	construction_time = mbrxxx_construction_time_1_year

	cost_prestige = expensive_building_tier_2_cost
	cost_gold = tribal_building_tier_2_cost

	character_modifier = {
		monthly_piety = 0.1
		monthly_prestige = 0.1
		county_fertility_growth_mult = 0.35
	}

	province_modifier = {
		monthly_income = poor_building_tax_tier_3
	}

	county_modifier = {
		development_growth_factor = 0.10
		tax_mult = 0.01
	}

	next_building = Townsquare_03

	ai_value = {
		base = 1
		modifier = { # Fill all building slots before going for upgrades
			factor = 0
			free_building_slots > 0
		}
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_townsquare
}

Townsquare_03 = {
	construction_time = mbrxxx_construction_time_1_year

	can_construct_potential = {
		has_building_or_higher = tribe_02
	}

	levy = normal_building_levy_tier_3
	max_garrison = 150
	
	character_modifier = {
		monthly_prestige = 0.2
		monthly_piety = 0.1
		county_fertility_growth_mult = 0.40
	}

	province_modifier = {
		monthly_income = 0.6
	}

	county_modifier = {
		development_growth_factor = 0.10
		tax_mult = 0.01
	}

	cost_prestige = expensive_building_tier_3_cost
	cost_gold = tribal_building_tier_2_cost
	
	on_complete = {
		county.holder = { add_prestige = medium_prestige_value }
	}

	ai_value = {
		base = 1
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_townsquare
}

###docks for tribes?

tribeport_01 = {
	construction_time = mbrxxx_construction_time_half_year

	is_enabled = {
		building_requirement_tribal = yes
	}
	can_construct_potential = {
		building_common_tradeport_requirement_terrain = yes
		has_building_or_higher = tribe_01
		is_coastal = yes
	}
	can_construct_showing_failures_only = {
		scope:holder = {
			has_government = tribal_government
		}
	}	
	cost_prestige = normal_building_tier_1_cost
	cost_gold = tribal_building_tier_1_cost

	province_modifier = {
		monthly_income = 0.2
		defender_holding_advantage = 2
		additional_fort_level = 1
		hostile_raid_time = 0.25
		build_speed = good_building_build_speed_tier_1
	}

	character_modifier = {
		monthly_prestige = 0.1
		coastal_advantage = 2
		embarkation_cost_mult = -0.25
		owned_legend_spread_mult = 0.2
	}

	next_building = tribeport_02

	type_icon = "icon_building_tribeport.dds"
	
	ai_value = {
		base = 2
	}

	flag = mbrxxx_building
	flag = MRBXXX_foundation
	flag = mbrxxx_tribeport
}

###fishing house?

tribeport_02 = {
	construction_time = mbrxxx_construction_time_1_year

	cost_prestige = normal_building_tier_2_cost
	cost_gold = tribal_building_tier_2_cost

	province_modifier = {
		monthly_income = 0.4
		defender_holding_advantage = 3
		additional_fort_level = 2
		hostile_raid_time = 0.5
		build_speed = good_building_build_speed_tier_1
	}
	county_modifier = {
		development_growth = 0.05
	}

	character_modifier = {
		coastal_advantage = 4
		embarkation_cost_mult = -0.3
		naval_movement_speed_mult = 0.25
		monthly_prestige = 0.2
		owned_legend_spread_mult = 0.2
	}
		
	on_complete = {
		county.holder = { add_prestige = medium_prestige_value }
	}

	ai_value = {
		base = 2
		modifier = { # Fill all building slots before going for upgrades
			factor = 0
			free_building_slots > 0
		}
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_tribeport
}

war_01 = {
	construction_time = mbrxxx_construction_time_half_year

	is_enabled = {
		building_requirement_tribal = yes
	}
	can_construct_potential = {
		has_building_or_higher = tribe_01
	}
	can_construct_showing_failures_only = {
		scope:holder = {
			has_government = tribal_government
		}
	}	

	cost_prestige = normal_building_tier_3_cost
	cost_gold = tribal_building_tier_1_cost
	
	levy = 75
	max_garrison = 100
 
    province_modifier = {
        defender_holding_advantage = 3
        fort_level = 1
		stationed_maa_damage_mult = normal_maa_damage_tier_1
		stationed_maa_toughness_mult = normal_maa_toughness_tier_1
    }
    county_modifier = {
        monthly_county_control_growth_add = 0.1
    }
    
	next_building = war_02
	
	type_icon = "icon_building_war.dds" #works
	
	ai_value = {
		base = 1
	}

	flag = mbrxxx_building
	flag = MRBXXX_foundation
	flag = mbrxxx_war
}

war_02 = {
	construction_time = mbrxxx_construction_time_1_year

	can_construct_potential = {
		has_building_or_higher = tribe_02
	}

	cost_prestige = normal_building_tier_4_cost
	cost_gold = tribal_building_tier_2_cost
	
	levy = 125
	max_garrison = 150
 
    character_modifier = {
		monthly_prestige = 0.1
    }
 
    province_modifier = {
        defender_holding_advantage = 5
        fort_level = 1
		stationed_maa_toughness_mult = normal_maa_toughness_tier_2
		stationed_skirmishers_damage_mult = high_maa_damage_tier_2
		stationed_heavy_infantry_damage_mult = high_maa_damage_tier_2
		stationed_archers_damage_mult = high_maa_damage_tier_2
    }
 
    county_modifier = {
        monthly_county_control_growth_add = 0.1
    }
 
    next_building = war_03
 	
	ai_value = {
		base = 1
		modifier = { # Fill all building slots before going for upgrades
			factor = 0
			free_building_slots > 0
		}
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_war
}

war_03 = {
	construction_time = mbrxxx_construction_time_1_year


    character_modifier = {
        knight_limit = 3
		supply_capacity_mult = 1.5
		supply_duration = 0.25
		monthly_prestige = 0.2
    }
 
    province_modifier = {
        defender_holding_advantage = 7
        fort_level = 1
		stationed_skirmishers_damage_mult = high_maa_damage_tier_3
		stationed_skirmishers_toughness_mult = high_maa_toughness_tier_3
		stationed_heavy_infantry_damage_mult = high_maa_damage_tier_3
		stationed_heavy_infantry_toughness_mult = high_maa_toughness_tier_3
		stationed_archers_damage_mult = high_maa_damage_tier_3
		stationed_archers_toughness_mult = high_maa_damage_tier_3
    }
 
    county_modifier = {
        monthly_county_control_growth_add = 0.2
	}
	
	levy = 175
	max_garrison = 250

	cost_prestige = normal_building_tier_5_cost
	cost_gold = tribal_building_tier_2_cost
 	
	on_complete = {
		county.holder = { add_prestige = medium_prestige_value }
	}

	ai_value = {
		base = 1
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_war
}

raiding_01 = {
	construction_time = mbrxxx_construction_time_half_year

	is_enabled = {
		or = {
			building_requirement_tribal = yes
			building_requirement_pirate = yes
		}
	}
	can_construct_potential = {
		MBRXXX_building_requirement_tribe_pirate = { LEVEL = 01 }
	}
	can_construct_showing_failures_only = {
		scope:holder = {
			or = {
				has_government = tribal_government
				has_government = pirate_government
			}
		}
	}	

    character_modifier = {
		raid_speed = 0.05
		monthly_prestige = 0.1
    }

	province_modifier = {
		stationed_maa_damage_mult = normal_maa_damage_tier_2
		stationed_maa_toughness_mult = normal_maa_toughness_tier_2
    }

	levy = 50

	cost_prestige = normal_building_tier_1_cost
	cost_gold = tribal_building_tier_1_cost

	next_building = raiding_02

	type_icon = "icon_building_raiding.dds"
 	
	ai_value = {
		base = 1
	}

	flag = mbrxxx_building
	flag = MRBXXX_foundation
	flag = mbrxxx_raiding
}

raiding_02 = {
	construction_time = mbrxxx_construction_time_1_year

	can_construct_potential = {
		MBRXXX_building_requirement_tribe_pirate = { LEVEL = 02 }
	}

    character_modifier = {
		raid_speed = 0.10
		supply_duration = 0.25
		monthly_prestige = 0.2
    }

	province_modifier = {
		stationed_maa_damage_mult = normal_maa_damage_tier_2
		stationed_maa_toughness_mult = normal_maa_toughness_tier_2
    }

	levy = 175

	cost_prestige = normal_building_tier_2_cost
	cost_gold = tribal_building_tier_2_cost
 	
	on_complete = {
		county.holder = { add_prestige = medium_prestige_value }
	}

	ai_value = {
		base = 1
		modifier = { # Fill all building slots before going for upgrades
			factor = 0
			free_building_slots > 0
		}
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_raiding
}

ting_01 = {
	construction_time = mbrxxx_construction_time_1_and_half_years

	is_enabled = {
		is_county_capital = yes
		building_requirement_tribal = yes
	}
	can_construct_potential = {
		has_building_or_higher = tribe_01
	}
	can_construct_showing_failures_only = {
		scope:holder = {
			has_government = tribal_government
		}
	}	
	
	cost_prestige = expensive_building_tier_1_cost
	cost_gold = normal_building_tier_3_cost

	character_modifier = {
		monthly_dynasty_prestige_mult = 0.1
		clergy_opinion = 5
		vassal_opinion = 5
		dynasty_opinion = 5
		monthly_piety = 0.1
		monthly_prestige = 0.4
		legitimacy_gain_mult = 0.4
		owned_legend_spread_mult = 0.2
		county_fertility_growth_mult = 0.35
	}

	character_government_modifier = {
		parameter = government_has_influence
		monthly_influence = 5
	}

	character_government_modifier = {
		parameter = government_has_merit
		monthly_merit = 5
	}

	type_icon = "icon_building_ting.dds"

	on_complete = {
		county.holder = { add_prestige = massive_prestige_value }
	}

	ai_value = {
		base = 5
	}

	flag = mbrxxx_building
	flag = MRBXXX_foundation
	flag = mbrxxx_ting
}

medicine_lodge_01 = {
	construction_time = mbrxxx_construction_time_half_year

	is_enabled = {
		is_county_capital = yes
		or = {
			building_requirement_tribal = yes
			building_requirement_pirate = yes
		}
	}
	can_construct_potential = {
		MBRXXX_building_requirement_tribe_pirate = { LEVEL = 01 }
	}
	can_construct_showing_failures_only = {
		scope:holder = {
			or = {
				has_government = tribal_government
				has_government = pirate_government
			}
		}
	}	
	
	cost_prestige = normal_building_tier_1_cost
	cost_gold = tribal_building_tier_1_cost

	character_modifier = {
		negate_health_penalty_add = 0.05
		health = 0.05
	}

	county_modifier = {
		development_growth = 0.1
		county_opinion_add = 2
		epidemic_resistance = 4
	}
	
	next_building = medicine_lodge_02

	type_icon = "icon_building_medicine.dds"
	
	on_complete = {
		county.holder = { add_prestige = miniscule_prestige_value }
	}

	ai_value = {
		base = 10
	}

	flag = mbrxxx_building
	flag = MRBXXX_foundation
	flag = mbrxxx_medicine_lodge
}


medicine_lodge_02 = {
	construction_time = mbrxxx_construction_time_1_year

	
	cost_prestige = normal_building_tier_2_cost
	cost_gold = tribal_building_tier_2_cost
	
	character_modifier = {
		negate_health_penalty_add = 0.05
		health = 0.05		
		monthly_piety = 0.1
		monthly_prestige = 0.1
		clergy_opinion = 2
		legitimacy_gain_mult = 0.01
	}

	county_modifier = {
		development_growth = 0.1
		county_opinion_add = 4
		epidemic_resistance = 8
	}

	next_building = medicine_lodge_03
	ai_value = {
		base = 1
		modifier = { # Fill all building slots before going for upgrades
			factor = 0
			free_building_slots > 0
		}
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_medicine_lodge
}

medicine_lodge_03 = {
	construction_time = mbrxxx_construction_time_1_year

	
	cost_prestige = normal_building_tier_3_cost
	cost_gold = tribal_building_tier_2_cost

	character_modifier = {
		negate_health_penalty_add = 0.05
		health = 0.05	
		monthly_piety = 0.2
		monthly_prestige = 0.1
		clergy_opinion = 4
		stress_gain_mult = -0.05
		legitimacy_gain_mult = 0.02
	}

	county_modifier = {
		development_growth = 0.1
		county_opinion_add = 6
		epidemic_resistance = 12
	}	

	next_building = medicine_lodge_04

	on_complete = {
		county.holder = { add_prestige = minor_prestige_value }
	}

	ai_value = {
		base = 1
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_medicine_lodge
}

medicine_lodge_04 = {
	construction_time = mbrxxx_construction_time_1_and_half_years

	can_construct_potential = {
		MBRXXX_building_requirement_tribe_pirate = { LEVEL = 02 }
	}
	
	cost_prestige = normal_building_tier_4_cost
	cost_gold = tribal_building_tier_2_cost

	character_modifier = {
		negate_health_penalty_add = 0.1
		health = 0.05	
		monthly_piety = 0.2
		monthly_prestige = 0.2
		clergy_opinion = 4
		vassal_opinion = 4
		stress_gain_mult = -0.1
		stress_loss_mult = 0.1
		legitimacy_gain_mult = 0.03
		owned_legend_spread_mult = 0.1
	}

	county_modifier = {
		development_growth = 0.1
		county_opinion_add = 8
		epidemic_resistance = 16
	}	
	
	next_building = medicine_lodge_05
	ai_value = {
		base = 1
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_medicine_lodge
}

medicine_lodge_05 = {
	construction_time = mbrxxx_construction_time_1_and_half_years

	
	cost_prestige = expensive_building_tier_5_cost
	cost_gold = tribal_building_tier_2_cost

	character_modifier = {
		negate_health_penalty_add = 0.5
		health = 0.05	
		monthly_piety = 0.3
		monthly_prestige = 0.3
		clergy_opinion = 8
		vassal_opinion = 5
		stress_gain_mult = -0.2
		stress_loss_mult = 0.15
		legitimacy_gain_mult = 0.04
		owned_legend_spread_mult = 0.2
	}

	county_modifier = {
		development_growth = 0.2
		county_opinion_add = 10

		epidemic_resistance = 24
	}	

	on_complete = {
		county.holder = { add_prestige = medium_prestige_value }
	}

	ai_value = {
		base = 1
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_medicine_lodge
}

tunnel_tribal_01 = {
	construction_time = mbrxxx_construction_time_half_year

	is_enabled = {
		or = {
			building_requirement_tribal = yes
			building_requirement_pirate = yes
		}
	}

	can_construct_potential = {
		MBRXXX_building_requirement_tribe_pirate = { LEVEL = 01 }
	}
	
	can_construct_showing_failures_only = {
		scope:holder = {
			or = {
				has_government = tribal_government
				has_government = pirate_government
			}
		}
		building_tunnel_requirement_terrain = yes
	}

	cost_prestige = cheap_building_tier_1_cost
	
	province_modifier = {
		defender_holding_advantage = 2
		supply_limit = 500
		levy_reinforcement_rate = 0.01
		travel_danger = building_travel_danger_factor_tier_4
		stationed_skirmishers_damage_mult = normal_maa_damage_tier_4
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_4
		stationed_skirmishers_pursuit_mult = normal_maa_pursuit_tier_4
	}

	next_building = tunnel_tribal_02

	type_icon = "icon_building_tunnel.dds"
	
	ai_value = {
		base = 3
	}

	flag = mbrxxx_building
	flag = MRBXXX_foundation
	flag = mbrxxx_tunnel
}

tunnel_tribal_02 = {
	construction_time = mbrxxx_construction_time_1_year

	can_construct = {
		scope:holder.culture = {
			has_innovation = innovation_crop_rotation
		}
	}
	
	cost_prestige = cheap_building_tier_2_cost
	
	province_modifier = {
		monthly_income = 0.2
		defender_holding_advantage = 2
		supply_limit = 1000
		levy_reinforcement_rate = 0.02
		travel_danger = building_travel_danger_factor_tier_5
		stationed_skirmishers_damage_mult = normal_maa_damage_tier_5
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_5
		stationed_skirmishers_pursuit_mult = normal_maa_pursuit_tier_5
	}


	next_building = tunnel_tribal_03

	ai_value = {
		base = 1
		modifier = { # Fill all building slots before going for upgrades
			factor = 0
			free_building_slots > 0
		}
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_tunnel
}

tunnel_tribal_03 = {
	construction_time = mbrxxx_construction_time_1_year

	can_construct = {
		scope:holder.culture = {
			has_innovation = innovation_crop_rotation
		}
	}
	
	cost_prestige = cheap_building_tier_3_cost
	
	province_modifier = {
		monthly_income = 0.3
		defender_holding_advantage = 4
		supply_limit = 1500
		levy_reinforcement_rate = 0.03
		travel_danger = building_travel_danger_factor_tier_6
		stationed_skirmishers_damage_mult = normal_maa_damage_tier_6
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_6
		stationed_skirmishers_pursuit_mult = normal_maa_pursuit_tier_6
	}

	next_building = tunnel_tribal_04
	
	ai_value = {
		base = 1
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_tunnel
}

tunnel_tribal_04 = {
	construction_time = mbrxxx_construction_time_1_and_half_years

	can_construct_potential = {
		MBRXXX_building_requirement_tribe_pirate = { LEVEL = 02 }
	}

	can_construct = {
		scope:holder.culture = {
			has_innovation = innovation_manorialism
		}
	}
	
	cost_prestige = cheap_building_tier_4_cost
	
	province_modifier = {
		monthly_income = 0.5
		defender_holding_advantage = 4
		supply_limit = 2000
		levy_reinforcement_rate = 0.05
		travel_danger = building_travel_danger_factor_tier_7
		stationed_skirmishers_damage_mult = normal_maa_damage_tier_7
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_7
		stationed_skirmishers_pursuit_mult = normal_maa_pursuit_tier_7
	}

	next_building = tunnel_tribal_05

	ai_value = {
		base = 1
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_tunnel
}

tunnel_tribal_05 = {
	construction_time = mbrxxx_construction_time_1_and_half_years

	can_construct = {
		scope:holder.culture = {
			has_innovation = innovation_windmills
		}
	}
	
	cost_prestige = cheap_building_tier_5_cost
	
	province_modifier = {
		monthly_income = 0.8
		defender_holding_advantage = 4
		supply_limit = 2500
		levy_reinforcement_rate = 0.10
		travel_danger = building_travel_danger_factor_tier_8
		stationed_skirmishers_damage_mult = normal_maa_damage_tier_8
		stationed_skirmishers_toughness_mult = normal_maa_toughness_tier_8
		stationed_skirmishers_pursuit_mult = normal_maa_pursuit_tier_8
	}

	ai_value = {
		base = 1
	}

	flag = mbrxxx_building
	flag = MRBXXX_upgrade
	flag = mbrxxx_tunnel
}
