###########################
# Estonian Events
###########################

add_namespace = EST_events

# Ask Germany to be friends
country_event = {
	id = EST_events.1
	title = EST_events.1.t
	desc = EST_events.1.d
	picture = GFX_report_event_generic_conference
	
	is_triggered_only = yes
	
	option = { #Esti truly is besti
		name = EST_events.1.a
		ai_chance = {
			base = 30
		}
		add_opinion_modifier = {
			target = FROM
			modifier = BALTIC_reached_out
		}
		reverse_add_opinion_modifier = {
			target = FROM
			modifier = BALTIC_reached_out
		}
		diplomatic_relation = {
			country = FROM
			relation = guarantee
			active = yes
		}
		add_ai_strategy = {
			type = alliance
			id = EST
			value = 50
		}
		EST = {
			country_event = EST_events.101
		}
	}
	option = { #How about no
		name = EST_events.1.b
		ai_chance = {
			base = 30
		}
		add_ai_strategy = {
			type = alliance
			id = EST
			value = -50
		}
		EST = {
			country_event = EST_events.102
		}
	}
}
country_event = {
	id = EST_events.101
	title = EST_events.101.t
	desc = EST_events.101.d
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes
	
	option = {
		name = EST_events.101.a
		ai_chance = {
			base = 30
		}
		effect_tooltip = {
			add_opinion_modifier = {
				target = FROM
				modifier = BALTIC_reached_out
			}
			reverse_add_opinion_modifier = {
				target = FROM
				modifier = BALTIC_reached_out
			}
			diplomatic_relation = {
				country = FROM
				relation = guarantee
				active = yes
			}
			
		}
	}
}
country_event = {
	id = EST_events.102
	title = EST_events.102.t
	desc = EST_events.102.d
	picture = GFX_report_event_military_planning
	
	is_triggered_only = yes
	
	option = { #Screw you Germany, I never liked you anyway
		name = EST_events.102.a
		ai_chance = {
			base = 30
		}
		complete_national_focus = EST_anti_communist_militia
	}
}


# Annex Finland
country_event = {
	id = EST_events.2
	title = EST_events.2.t
	desc = EST_events.2.d
	picture = GFX_report_event_gre_cabinet_meeting
	
	is_triggered_only = yes
	
	option = { #We're not so different
		name = EST_events.2.a
		ai_chance = {
			base = 30
		}
		effect_tooltip = {
			FROM = {
				annex_country = {
					target = ROOT
					transfer_troops = yes
				}
			}
			custom_effect_tooltip = GAME_OVER_TT
		}
		hidden_effect = {
			FROM = { country_event = EST_events.201 }
		}
	}
	option = { #How about no
		name = EST_events.2.b
		ai_chance = {
			base = 0
		}
		effect_tooltip = {
			FROM = {
				create_wargoal = {
					type = annex_everything
					target = ROOT
				}
			}
		}
		hidden_effect = {
			FROM = { country_event = EST_events.202 }
		}
	}
}
country_event = {
	id = EST_events.201
	title = EST_events.201.t
	desc = EST_events.201.d
	picture = GFX_report_event_generic_sign_treaty3
	
	is_triggered_only = yes
	
	option = {
		name = EST_events.201.a
		ai_chance = {
			base = 30
		}
		annex_country = {
			target = FROM
			transfer_troops = yes
		}
	}
}
country_event = {
	id = EST_events.202
	title = EST_events.202.t
	desc = EST_events.202.d
	picture = GFX_report_event_generic_rally
	
	is_triggered_only = yes
	
	option = {
		name = EST_events.202.a
		ai_chance = {
			base = 30
		}
		
		hidden_effect = {
			ROOT = {
				add_opinion_modifier = {
					target = FROM
					modifier = large_decrease
				}	
			}
			ROOT = {
				add_opinion_modifier = {
					target = FROM
					modifier = large_decrease
				}	
			}
			FROM = {
				add_opinion_modifier = {
					target = ROOT
					modifier = large_decrease
				}	
			}
			FROM = {
				add_opinion_modifier = {
					target = ROOT
					modifier = large_decrease
				}	
			}
		}

		add_war_support = 0.05

		ROOT = {
			create_wargoal = {
				type = annex_everything
				target = FROM
			}
		}
		
	}
}

#TODO, news event

#Annex Baltic States
country_event = {
	id = EST_events.4
	title = EST_events.4.t
	desc = EST_events.4.d
	picture = GFX_report_event_generic_conference
	
	is_triggered_only = yes
	
	option = { #We'd be fools not to!
		name = EST_events.4.a
		ai_chance = {
			base = 30
		}
		effect_tooltip = {
			FROM = {
				annex_country = {
					target = ROOT
					transfer_troops = yes
				}
			}
		}
		hidden_effect = {
			FROM = { country_event = EST_events.201 }
		}
	}
	option = { #How about no
		name = EST_events.4.b
		ai_chance = {
			base = 0
		}
		effect_tooltip = {
			FROM = {
				create_wargoal = {
					type = annex_everything
					target = ROOT
				}
			}
		}
		hidden_effect = {
			FROM = { country_event = EST_events.202 }
		}
	}
}
country_event = {
	id = EST_events.401
	title = EST_events.401.t
	desc = EST_events.401.d
	picture = GFX_report_event_generic_sign_treaty1
	
	is_triggered_only = yes
	
	option = {
		name = EST_events.401.a
		ai_chance = {
			base = 30
		}
		annex_country = {
			target = FROM
			transfer_troops = yes
		}
	}
}
country_event = {
	id = EST_events.402
	title = EST_events.402.t
	desc = EST_events.402.d
	picture = GFX_report_event_soldiers_marching
	
	is_triggered_only = yes
	
	option = {
		name = EST_events.402.a
		ai_chance = {
			base = 30
		}
		create_wargoal = {
			type = annex_everything
			target = FROM
		}
	}
}

#Other Baltics are informed of Estonia getting wargoal
country_event = {
	id = EST_events.5
	title = EST_events.5.t
	desc = EST_events.5.d
	picture = GFX_report_event_german_troops
	
	is_triggered_only = yes
	
	option = {
		name = EST_events.5.a
		ai_chance = {
			base = 30
		}
		effect_tooltip = {
			FROM = {
				create_wargoal = {
					type = annex_everything
					target = ROOT
				}
			}
		}
	}
}

#Estonia asks to add Finland to the faction
country_event = {
	id = EST_events.6
	title = EST_events.6.t
	desc = EST_events.6.d
	picture = GFX_report_event_hol_cabinet_de_geer
	
	is_triggered_only = yes

	option = {
		name = EST_events.6.a
		ai_chance = {
			factor = 10
		}
		FIN = { country_event = generic.2 }
	}

	option = { #We'll accept Estonia into our faction but Finland is going too far!
		name = EST_events.6.b
		ai_chance = {
			factor = 0
		}
		EST = { country_event = EST_events.601 }
	}
}

country_event = {
	id = EST_events.601
	title = EST_events.601.t
	desc = EST_events.601.d
	picture = GFX_report_event_generic_rally
	
	is_triggered_only = yes
	
	option = { #Dangit!
		name = EST_events.601.a
		ai_chance = {
			factor = 10
		}
	}
}

#Vapsid Civil War
country_event = {
	id = EST_events.7
	title = EST_events.7.t
	desc = EST_events.7.d
	picture = GFX_report_event_ger_civil_war
	
	is_triggered_only = yes
	
	immediate = {
		hidden_effect = {
			set_variable = {
				var = civil_war_size_var
				value = 0.9
			}
			subtract_from_variable = {
				var = civil_war_size_var
				value = party_popularity@fascism
			}
			random_owned_state = {
				limit = {
					has_state_flag = vaps_loyal_state
				}
				EST = { set_capital = { state = PREV } }
			}
			start_civil_war = {
				ruling_party = fascism
				ideology = neutrality
				size = civil_war_size_var
				states = all
				states_filter = {
					NOT = { has_state_flag = vaps_loyal_state }
				}
			}
			random_other_country = {
				limit = {
					original_tag = EST
					has_government = neutrality
				}
				save_event_target_as = neutral_EST_civil_war
			}
		}
	}
	
	option = { #Welp, that didn't go as planned...
		name = EST_events.7.a
		ai_chance = {
			factor = 10
		}
	}
}
#Vapsid peaceful takeover
country_event = {
	id = EST_events.701
	title = EST_events.701.t
	desc = EST_events.701.d
	picture = GFX_report_event_generic_peaceful_annexation
	
	is_triggered_only = yes
	
	option = { #Vaps become ruling party
		name = EST_events.701.a
		ai_chance = {
			factor = 10
		}
		set_politics = {
			ruling_party = fascism
			elections_allowed = no
		}
		if = {
			limit = { has_idea = democratic_opposition }
			remove_ideas = democratic_opposition
		}
		if = {
			limit = { has_idea = democratic_opposition_idea_1 }
			remove_ideas = democratic_opposition_idea_1
		}
		if = {
			limit = { has_idea = democratic_opposition_idea_2 }
			remove_ideas = democratic_opposition_idea_2
		}
	}
}

#Vapsid march results
country_event = {
	id = EST_events.801
	title = EST_events.801.t
	desc = EST_events.801.d
	picture = GFX_report_event_generic_riot
	
	is_triggered_only = yes
	
	option = { #Could have gone better...
		name = EST_events.801.a
		ai_chance = {
			factor = 10
		}
		if = {
			limit = {
				original_tag = EST
			}
			add_popularity = {
				ideology = fascism
				popularity = 0.1
			}
		}
		else = {
			add_popularity = {
				ideology = fascism
				popularity = 0.05
			}
		}
		if = {
			limit = {
				has_active_mission = EST_stomp_the_vaps
			}
			add_days_mission_timeout = {
				mission = EST_stomp_the_vaps
				days = -10
			}
		}
	}
	option = { #We must put down these insurgents!
		name = EST_events.801.b
		ai_chance = {
			factor = 1
		}
		trigger = {
			original_tag = FIN
		}

		custom_effect_tooltip = FIN_putting_down_insurgents_tt
		var:ROOT.vaps_from = {
			clr_state_flag = vaps_loyal_state
		}
		

		add_popularity = {
			ideology = fascism
			popularity = 0.02
		}
		add_stability = -0.02
		add_political_power = -25
	}
}

country_event = {
	id = EST_events.802
	title = EST_events.802.t
	desc = EST_events.802.d
	picture = GFX_report_event_vaps_march
	
	is_triggered_only = yes
	
	option = { #Could have gone worse...
		name = EST_events.802.a
		ai_chance = {
			factor = 10
		}
		if = {
			limit = {
				original_tag = EST
			}
			add_popularity = {
				ideology = fascism
				popularity = 0.15
			}
		}
		else = {
			add_popularity = {
				ideology = fascism
				popularity = 0.1
			}
		}
		if = {
			limit = {
				has_active_mission = EST_stomp_the_vaps
			}
			add_days_mission_timeout = {
				mission = EST_stomp_the_vaps
				days = 10
			}
		}
	}
	option = { #We must put down these insurgents!
		name = EST_events.801.b
		ai_chance = {
			factor = 1
		}
		trigger = {
			original_tag = FIN
		}

		custom_effect_tooltip = FIN_putting_down_insurgents_tt
		var:ROOT.vaps_from = {
			clr_state_flag = vaps_loyal_state
		}
		

		add_popularity = {
			ideology = fascism
			popularity = 0.02
		}
		add_stability = -0.02
		add_political_power = -25
	}
}
country_event = {
	id = EST_events.803
	title = EST_events.803.t
	desc = EST_events.803.d
	picture = GFX_report_event_vaps_march
	
	is_triggered_only = yes
	
	option = { #This went very well
		name = EST_events.803.a
		ai_chance = {
			factor = 10
		}
		if = {
			limit = {
				original_tag = EST
			}
			add_popularity = {
				ideology = fascism
				popularity = 0.2
			}
		}
		else = {
			add_popularity = {
				ideology = fascism
				popularity = 0.15
			}
		}
		if = {
			limit = {
				has_active_mission = EST_stomp_the_vaps
			}
			add_days_mission_timeout = {
				mission = EST_stomp_the_vaps
				days = 20
			}
		}
	}
	option = { #We must put down these insurgents!
		name = EST_events.801.b
		ai_chance = {
			factor = 1
		}
		trigger = {
			original_tag = FIN
		}

		custom_effect_tooltip = FIN_putting_down_insurgents_tt
		var:ROOT.vaps_from = {
			clr_state_flag = vaps_loyal_state
		}
		

		add_popularity = {
			ideology = fascism
			popularity = 0.02
		}
		add_stability = -0.02
		add_political_power = -25
	}
}
#End of Vapsid march results

#Finnish Civil War
country_event = {
	id = EST_events.9
	title = EST_events.7.t
	desc = EST_events.7.d
	picture = GFX_report_event_ger_civil_war
	
	is_triggered_only = yes

	option = { #Start of Finish civil war.
		name = EST_events.7.a
		ai_chance = {
			factor = 10
		}
		start_civil_war = {
			ideology = fascism
			size = party_popularity@fascism
			states = all
			states_filter = {
				has_state_flag = vaps_loyal_state
			}
		}
		set_country_flag = estonia_started_cw_in_finland
		random_other_country = {
			limit = {
				original_tag = FIN
				has_government = fascism
			}
			save_global_event_target_as = neutral_EST_civil_war
		}
		EST = { country_event = EST_events.10 }
	}

	option = { #Finland just caves
		name = EST_events.9.b
		ai_chance = {
			factor = 5
		}
		hidden_effect = {
			FROM = { #EST
				PREV = { #FIN
					random_character = {
				 		limit = {
					  		is_country_leader = yes
				 		}
				 		FROM = {
				 			set_variable = { FIN.EST_previous_finnish_leader = PREV } #For loc purposes
						}
					}
				}
			}
		}
		set_politics = {
			ruling_party = fascism
			elections_allowed = no
		}
		EST = { country_event = EST_events.901 }
	}
}
#Estonia informed that Finland voluntarily flipped
country_event = {
	id = EST_events.901
	title = EST_events.901.t
	desc = EST_events.901.d
	picture = GFX_report_event_hungary_parliament
	
	is_triggered_only = yes

	option = { #Well, that was unexpected
		name = EST_events.901.a
		ai_chance = {
			factor = 10
		}
		effect_tooltip = {
			FROM = {
				set_politics = {
					ruling_party = fascism
					elections_allowed = no
				}
			}
		}
	}
}

#Estonia adds itself to the war
country_event = {
	id = EST_events.10
	title = EST_events.10.t
	desc = EST_events.10.d
	picture = GFX_report_event_generic_army
	
	is_triggered_only = yes

	option = { #Veterans fighting side-by-side again!
		name = EST_events.10.a
		ai_chance = {
			factor = 10
		}
		random_country = {
			limit = {
				original_tag = FIN
				has_government = fascism
			}
			PREV = {
				add_to_war = {
					targeted_alliance = PREV
					enemy = FROM
					hostility_reason = asked_to_join
				}
			}
		}
	}

	option = { #Maybe we will just send volunteers
		name = EST_events.10.b
		ai_chance = {
			factor = 10
		}
		add_timed_idea = {
			idea = EST_volunteer_corps
			days = 365
		}
	}
}

#Finland informed of Estonia boosting fascism and what they can do about it.
country_event = {
	id = EST_events.11
	title = EST_events.11.t
	desc = EST_events.11.d
	picture = GFX_report_event_eng_blackshirt_march
	
	is_triggered_only = yes

	option = {
		name = EST_events.11.a
		ai_chance = {
			factor = 10
		}
		custom_effect_tooltip = EST_you_can_ban_fascism_tt
	}
}