﻿#####################################
# Public Health (always-available free tree)
#####################################
surgery_advance = {
	age = age_3_discovery
	icon = alchemy_advance

	global_life_expectancy = 3
	global_disease_resistance = 0.05

	depth = 0
}

#####################################
# New World
#####################################
new_world_advance = {
	age = age_3_discovery
	

	depth = 0
	
	allow = { has_embraced_institution = institution:new_world }

	exploration_preparation_time_modifier = -0.05
	colonial_range = 600
	diplomatic_range_modifier = 0.10

	ai_preference_tags = {
		exploration
	}
}

explorer_commisions_advance = {
	age = age_3_discovery
	icon = safe_exploration_techniques_advance
	requires = new_world_advance
	can_recruit_explorer = yes
	ai_preference_tags = {
		exploration
	}
}


open_sea_exploration = {
	age = age_3_discovery
	icon = maritime_advance_age_4
	requires = explorer_commisions_advance
	allow_open_sea_exploration = yes
	colonial_range = 1500
	ai_preference_tags = {
		exploration
	}
}






repair_at_sea_aod = {
	age = age_3_discovery
	icon = rudimentary_coastal_ship_repair

	requires = explorer_commisions_advance

	ship_repair_at_sea_to_max_strength = 0.1
}

merchant_power_from_maritime_discovery_advance = {
	age = age_3_discovery
	icon = merchant_power_from_maritime_reformation_advance
	
	merchant_power_from_maritime = 0.025
	
	requires = open_sea_exploration

}
maritime_decay_advance_disc = {
	icon = letters_of_marque
	age = age_3_discovery
	
	requires = merchant_power_from_maritime_discovery_advance
	global_maritime_presence_decay = -0.001
}



colonial_charters = {
	age = age_3_discovery
	icon = colonies

	requires = new_world_advance
	colonial_migration_size_modifier = 0.25
	create_colonial_charter_cost_modifier = -0.2
	colonial_maintenance_efficiency = 0.40

	ai_preference_tags = {
		exploration
	}
}


colonial_policy_advance = {
	age = age_3_discovery
	requires = colonial_charters
	
	unlock_law = colonial_policy
}


maritime_advance_age_3 = {
	age = age_3_discovery
	icon = maritime_advance_age_4

	requires = colonial_charters

	global_maritime_presence_modifier = 0.1
	num_naval_governors = 1
}

trade_range_advance_age_3 = {
	age = age_3_discovery
	icon = ship_building_advance
	requires = maritime_advance_age_3
	
	trade_range	= 250
}


coastal_trade_routes_advance = {
	age = age_3_discovery
	icon = safe_exploration_techniques_advance
	
	requires = maritime_advance_age_3
	
	sea_cost_on_distance_from_capital_when_maritime = -0.5
}




ship_building_techniques_discovery = {
	age = age_3_discovery
	icon = rudimentary_coastal_ship_repair
	
	requires = merchant_power_from_maritime_discovery_advance

	ship_build_speed = 0.2

}

port_cost_distance_from_capital_advance = {
	icon = global_trade_routes_advance
	age = age_3_discovery
	requires = ship_building_techniques_discovery
	
	port_cost_distance_from_capital = -5
}



exploration_maintenance_advance = {
	age = age_3_discovery
	icon = maritime_advance_age_4
	
	requires = maritime_advance_age_3
	exploration_maintenance_efficiency = 0.20
	ai_preference_tags = {
		exploration
	}
}



native_policy_advance = {
	age = age_3_discovery
	requires = open_sea_exploration

	unlock_law = native_policy
}

beat_to_windward_advance = {
	age = age_3_discovery
	icon = new_world_advance
	
	requires = new_world_advance

	exploration_mission_speed = 0.1
	ai_preference_tags = {
		exploration
	}
}



plantation_buildings_advance = {
	age = age_3_discovery

	requires = colonial_charters
	unlock_building = sugar_plantation
	unlock_building = tobacco_plantation
	unlock_building = cotton_plantation

	ai_preference_tags = {
		exploration
	}
}


naval_ambitions = {
	age = age_3_discovery
	icon = safe_exploration_techniques_advance
	
	requires = colonial_policy_advance
	naval_range = 250

	ai_preference_tags = {
		exploration
	}
}


diplomatic_range_age_2 = {
	age = age_3_discovery
	icon = diplomatic_range_age_1
	requires = naval_ambitions
	diplomatic_range_modifier = 0.25
}

construction_speed_discovery = {
	icon = rudimentary_coastal_ship_repair
	age = age_3_discovery
	global_construction_speed = 0.1

	requires = surgery_advance
}


#####################################
# Printing Press
#####################################

printing_press_advance = {
	age = age_3_discovery
	icon = printing_press_advance
		
	global_max_literacy = 5

	depth = 0
	allow = { has_embraced_institution = institution:printing_press }
}

spy_construction_discovery = {
	age = age_3_discovery
	icon = efficient_spies
	requires = printing_press_advance

	spy_network_construction = 0.1
}

diplomatic_training = {
	age = age_3_discovery
	icon = scholasticism
	
	monthly_diplomats = 0.1
	
	requires = spy_construction_discovery
}

formalized_relations = {
	age = age_3_discovery
	icon = diplomatic_range_age_1
	
	diplomatic_capacity = 1
	
	requires = printing_press_advance
}

faceting = {
	age = age_3_discovery
	icon = improve_relation_impact_renaissance
	
	global_jewelry_output_modifier = 0.1
	
	requires = formalized_relations
}


print_culture = {
	icon = printing_press_advance
	age = age_3_discovery
	
	requires =  formalized_relations
	
	global_institution_growth_modifier = 0.20
}


artists_advance_discovery = {
	age = age_3_discovery
	icon = renaissance_advance
	requires = faceting
	skill_of_new_artists = 0.1
}

improved_book_binding = {
	age = age_3_discovery
	icon = scholasticism
	requires = print_culture
	global_books_output_modifier = 0.25
}


regulate_court_procedures = {
	age = age_3_discovery
	icon = genoese_banking_traditions
	court_spending_efficiency = 0.1

	requires = surgery_advance
}

crown_power_advance_discovery = {
	age = age_3_discovery
	icon = crown_power_advance_renaissance
	global_crown_estate_power = 0.10
	
	requires = regulate_court_procedures
}

government_size_discovery  = {
	icon = government_size
	age = age_3_discovery
	
	government_size = 1

	requires = crown_power_advance_discovery
}

town_rights_aod_advance = {
	age = age_3_discovery
	icon = town_rights_advance
	requires = government_size_discovery
	capital_possible_town_rights = 1
}



trade_through_owned_disc_advance = {
	icon = colonies
	age = age_3_discovery
	global_trade_through_owned_territory_efficiency = 0.2

	in_tree_of = surgery_advance
}

lazaretto_advance = {
	age = age_3_discovery
	unlock_building = lazaretto

	requires = trade_through_owned_disc_advance

}

naval_morale_advance_2 = {
	age = age_3_discovery
	icon = global_trade_routes_advance

	requires = lazaretto_advance

	naval_morale = 0.25
}

basic_financial_instruments = {
	age = age_3_discovery
	icon = smooth_administration
	global_merchant_power = 0.2

	requires = lazaretto_advance
}

hire_artist_cost_modifier_advance_disc = {
	icon = cultural_ties_culture
	age = age_3_discovery
	hire_artist_cost_modifier = -0.05

	requires = basic_financial_instruments
}

gov_reform_discovery_a  = {
	icon = government_size
	age = age_3_discovery
	government_reform_slots = 1

	requires = hire_artist_cost_modifier_advance_disc
}


rural_rgo_disc_advance = {
	icon = efficient_mining
	age = age_3_discovery
	global_max_rgo_size_modifier_in_rural = 0.2

	requires = basic_financial_instruments
}


power_projection_advance_4 = {
	age = age_3_discovery
	icon = crown_power_advance_renaissance
	power_projection = 5

	requires = government_size_discovery
}

#####################################
# Pike and Shot
#####################################
pike_and_shot_advance = {
	age = age_3_discovery
	icon = pike_and_shot_advance

	land_morale = 0.25
	depth = 0
	ai_weight = { add = 100 }

	allow = { has_embraced_institution = institution:pike_and_shot }
}

matchlock_gun = {
	icon = supply_depot_advance_age_3_discovery
	age = age_3_discovery
	requires = pike_and_shot_advance
	
	global_fur_output_modifier = 0.1
	global_wild_game_output_modifier = 0.1
}



supply_depot_advance_age_3_discovery = {
	age = age_3_discovery
	icon = global_supply_limit_modifier_advance_5
			
	supply_depot_capacity = 500
		
	requires = pike_and_shot_advance
}

regiment_reinforcement_speed_discovery = {
	age = age_3_discovery
	icon = glorious_arms

	requires = supply_depot_advance_age_3_discovery
	regiment_reinforcement_speed = 0.1
}


correct_box_advance_discovery = {
	age = age_3_discovery
	icon = expansionism

	correct_box_chance = 0.1

	requires = matchlock_gun
}

pike_square = {
	age = age_3_discovery
	icon = drill_army_advance
	
	requires = matchlock_gun
	
	military_tactics = 0.25
	
	ai_weight = { add = 20 }
}



supply_lines = {
	icon = maritime_advance_age_2
	age = age_3_discovery
	
	requires = pike_square
	army_logistics_distance = 25
}


land_morale_attrition_cost_advance = {
	icon = defensive_army_attrition
	age = age_3_discovery
	requires = supply_lines
	
	land_morale_attrition_cost = -0.002
}


linked_armies_advance = {
	age = age_3_discovery
	icon = expansionism
	
	requires = land_morale_attrition_cost_advance
	
	movement_speed_when_attached_to_another_unit = -0.1
}


land_morale_movement_cost_advance_disc = {
	icon = expansionism
	age = age_3_discovery
	
	
	requires = linked_armies_advance
	
	land_morale_movement_cost = -0.0001
}

new_world_crops = {
	age = age_3_discovery
	icon = expanded_supply_trains
	
	requires = construction_speed_discovery
	global_monthly_food_modifier = 0.10
}

rgo_size_advance_discovery = {
	age = age_3_discovery
	icon = efficient_mining
	
	global_max_rgo_size_modifier = 0.10

	requires = trade_range_advance_age_3
}

patio_process_advance = {
	age = age_3_discovery

	unlock_building = mercury_patio

	ai_weight = {
		if = {
			limit = {
				OR = {
					produced_in_country:goods_gold > 0
					produced_in_country:silver > 0
				}
			}
			add = 200
		}
	}	

	requires = rgo_size_advance_discovery
}

town_rights_enable = {
	age = age_3_discovery
	icon = town_rights_advance
	requires = town_rights_aod_advance
	
	unlock_town_rights = royal_tooling_rights
	unlock_town_rights = royal_jewelry_rights
	unlock_town_rights = royal_naval_rights
	unlock_town_rights = royal_textile_rights
	unlock_town_rights = royal_weaponry_rights
	unlock_town_rights = royal_book_rights
	unlock_town_rights = royal_artisan_rights
	unlock_town_rights = royal_brewing_rights
	unlock_town_rights = royal_masonry_rights
	
	ai_weight = { 
		add = 100
		multiply = num_of_non_rural
		divide = num_locations 
	}
}



rgo_logistics_discovery = {
	icon = efficient_mining
	age = age_3_discovery
	
	requires = repair_at_sea_aod

	raw_material_in_province_impact = 0.025
}

green_vitriol = {
	age = age_3_discovery
	icon = new_world_advance
	
	requires = rgo_logistics_discovery

	global_alum_output_modifier = 0.1
}

pop_promotion_speed_age_3 = {
	age = age_3_discovery
	icon = cultural_acceptance_advance

	requires = new_world_crops

	global_pop_promotion_speed_modifier = 0.1
}

blast_furnace = {
	age = age_3_discovery
	icon = serbian_mining
	
	requires = plantation_buildings_advance
	
	global_iron_output_modifier = 0.75
}

saiger_process_discovery = {
	age = age_3_discovery
	icon = serbian_mining
	
	global_silver_output_modifier = 0.2
	global_lead_output_modifier = 0.2

	requires = blast_furnace
}

new_currency_demands = {
	icon = debt_and_loans
	age = age_3_discovery
	
	global_copper_output_modifier = 0.25
	global_tin_output_modifier = 0.1

	requires = blast_furnace
}

lumber_improvements_discovery = {
	icon = lumber_improvements_absolutism
	age = age_3_discovery
	requires = improved_book_binding
	global_lumber_output_modifier = 0.50
}
