namespace = est_isolation

### ISOLATION ###

#Isolation 5, unity if no diplomatic relations.
country_event = {
	id = est_isolation.1
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		has_active_tradition = tr_est_isolation_5
	}
	
	immediate = {
		if = {
			limit = {
				NOT = {
					any_relation = {
						has_communications = prev
						OR = {
							has_diplo_migration_treaty = prev
							has_research_agreement = prev
							is_in_federation_with = prev
							is_guaranteeing = prev
							has_defensive_pact = prev
						}
					}
				}	
				#trade_income < 1
				#trade_expenses < 1
			}
			if = {	
				limit = {
					Not = {
						has_modifier = mod_est_isolation_5
					}
				}				
				add_modifier = {
					modifier = "mod_est_isolation_5"
				}	
			}
		}
		else = {
			if = {
				limit = {
					has_modifier = mod_est_isolation_5
				}
				remove_modifier = "mod_est_isolation_5"
			}
		}
	}
}

#Isolation 5 (GC), unity if no diplomatic relations.
country_event = {
	id = est_isolation.2
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		has_active_tradition = tr_est_isolation_5_GC
	}
	
	immediate = {
		if = {
			limit = {
				NOT = {
					any_relation = {
						has_communications = prev
						OR = {
							has_diplo_migration_treaty = prev
							has_research_agreement = prev
							is_in_federation_with = prev
							is_guaranteeing = prev
							has_defensive_pact = prev
						}
					}
				}	
				#trade_income < 1
				#trade_expenses < 1
			}
			if = {
				limit = {
					Not = {
						has_modifier = "mod_est_isolation_5_GC"
					}
				}				
				add_modifier = {
					modifier = "mod_est_isolation_5_GC"
				}	
			}
		}
		else = {
			if = {
				limit = {
					has_modifier = mod_est_isolation_5_GC
				}
				remove_modifier = "mod_est_isolation_5_GC"
			}
		}
	}
}

#Isolation finish, hapiness if not at war.
country_event = {
	id = est_isolation.3
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		has_active_tradition = tr_est_isolation_finish
	}
	
	immediate = {
		if = {
			limit = {
				is_at_war = no
			}
			if = {
				limit = {
					Not = {
						has_modifier = mod_est_isolation_finish
					}
				}
				add_modifier = {
					modifier = "mod_est_isolation_finish"
				}
			}
		}
		else = {
			if = {
				limit = {
					has_modifier = mod_est_isolation_finish
				}
				remove_modifier = "mod_est_isolation_finish"
			}
		}
	}
}

#Isolation finish (GC), influence if not at war.
country_event = {
	id = est_isolation.4
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		has_active_tradition = tr_est_isolation_finish_GC
	}
	
	immediate = {
		if = {
			limit = {
				is_at_war = no
			}
			if = {
				limit = {
					Not = {
						has_modifier = mod_est_isolation_finish_GC
					}
				}
				add_modifier = {
					modifier = "mod_est_isolation_finish_GC"
				}
			}
		}
		else = {
			if = {
				limit = {
					has_modifier = mod_est_isolation_finish_GC
				}
				remove_modifier = "mod_est_isolation_finish_GC"
			}
		}
	}
}

