###########################
# Baltic Events
###########################

add_namespace = baltic

# Check if File is Loaded
country_event = {
	id = baltic.2092066524

	hidden = yes

	is_triggered_only = yes

	immediate = {
		set_global_flag = russia_reworked_events_loaded_baltic
	}
}

# Soviet Ultimatum (Estonia)
country_event = {
	id = baltic.1
	title = baltic.1.t
	desc = baltic.1.d
	picture = GFX_report_event_soviet_soldiers
	
	is_triggered_only = yes

	hidden = yes
	
	option = { # Accept demands
		name = baltic.1.a
	}
	option = { # Refuse
		name = baltic.1.b
	}
}

# Soviet Ultimatum (Latvia)
country_event = {
	id = baltic.2
	title = baltic.1.t
	desc = baltic.1.d
	picture = GFX_report_event_soviet_soldiers
	
	is_triggered_only = yes

	hidden = yes
	
	option = { # Accept demands
		name = baltic.1.a
	}
	option = { # Refuse
		name = baltic.1.b
	}
}

# Soviet Ultimatum (Lithuania)
country_event = {
	id = baltic.3
	title = baltic.1.t
	desc = baltic.1.d
	picture = GFX_report_event_soviet_soldiers
	
	is_triggered_only = yes

	hidden = yes
	
	option = { # Accept demands
		name = baltic.1.a
	}
	option = { # Refuse
		name = baltic.1.b
	}
}

# Germany Claims Memel (Lithuania)
country_event = {
	id = baltic.4
	title = baltic.4.t
	desc = baltic.4.d
	picture = GFX_report_event_generic_read_write
	
	is_triggered_only = yes
	
	option = { # Accept demands
		name = baltic.4.a
		ai_chance = { 
			factor = 90
			modifier = {
				factor = 0
				NOT = {
					OR = {
						is_puppet_of = GER
						is_in_faction_with = GER
					}
				}
				GER = {
					surrender_progress > 0.09
				}
			}
			modifier = {
				factor = 0
				any_other_country = {
					is_in_faction_with = ROOT
					has_war_with = GER
				}
			}
			modifier = {
				factor = 0
				any_other_country = {
					NOT = {
						tag = GER
					}
					ROOT = {
						is_puppet_of = PREV
					}
					NOT = {
						is_in_faction_with = GER
					}
				}
			}
		}
		GER = {
			effect_tooltip = {
				transfer_state = 188
				add_state_core = 188
			}
			country_event = { days = 1 id = germany.22 }
		}
		hidden_effect = {
			hidden_effect = {
				every_country = {
					limit = {
						capital_scope = {
							is_on_continent = europe
						}
					}
					news_event = { 
						id = news.19
						days = 1 
					}	
				}
			}
		}
	}
	option = { # Refuse
		name = baltic.4.b		
		ai_chance = { 
			factor = 10
			modifier = {
				factor = 0
				is_historical_focus_on = yes
				NOT = {
					GER = {
						surrender_progress > 0.09
					}
				}
				NOT = {
					any_other_country = {
						is_in_faction_with = ROOT
						has_war_with = GER
					}
				}
				NOT = {
					any_other_country = {
						NOT = {
							tag = GER
						}
						ROOT = {
							is_puppet_of = PREV
						}
						NOT = {
							is_in_faction_with = GER
						}
					}
				}
			}
			modifier = {
				factor = 0
				OR = {
					is_in_faction_with = GER
					ROOT = {
						is_puppet_of = GER
					}
				}
			}
		}
		effect_tooltip = {
			GER = {
				create_wargoal = {
					type = take_state_focus
				target = ROOT
					generator = { 188 }
				}
				country_event = { days = 1 id = germany.23 }
			}
		}
		hidden_effect = {
			GER = {
				country_event = { days = 1 id = germany.23 }
			}
			hidden_effect = {
				every_country = {
					limit = {
						capital_scope = {
							is_on_continent = europe
						}
					}
					news_event = { 
						id = news.20
						days = 1 
					}	
				}
			}
		}		
	}
}

# Country becomes communist. Get's event to become part of the Soviet Union
country_event = {
	id = baltic.5
	title = baltic.5.t
	desc = baltic.5.d
	picture = GFX_report_event_worker_protests

	hidden = yes

	trigger = {

	}

	immediate = {

	}
	
	option = { # Annexed by SOV
		name = baltic.5.a
	}
	option = { # Become Puppet state
		name = baltic.5.b
	}
	option = { # Stay as own communist state
		name = baltic.5.c
	}

	mean_time_to_happen = {
		days = 2
	}
}

# Hidden event to be annexed. Needed because of problem with FROM and events in annexed countries (JH)
country_event = {
	id = baltic.6

	hidden = yes
	
	is_triggered_only = yes

	immediate = {

	}
}

#Poland Seeks Alliance With ROOT  
#Event fired by Poland seeking to make a Baltic faction
country_event = {
	id = baltic.7
	title = baltic.7.t
	desc = baltic.7.d
	picture = GFX_report_event_polish_tanks_01

	is_triggered_only = yes

	option = { #Enter alliance
		name = baltic.7.a
		ai_chance = {
			factor = 90
		}
		POL = {
			add_to_faction = ROOT
			ROOT = {
				add_ai_strategy = {
					type = alliance
					id = "POL"
					value = 200
				}
			}
			country_event = { id = poland.10 days = 1 }
		}
	}

	option = {
		name = baltic.7.b
		ai_chance = {
			factor = 10
		}
		effect_tooltip = {
			POL = {
				create_wargoal = {
					type = puppet_wargoal_focus
					target = ROOT
				}
			}
		}
		POL = {
			country_event = { id = poland.11 days = 1 }
		}
	}
}

