###########################
# Soviet Events
###########################

add_namespace = soviet

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

	hidden = yes

	is_triggered_only = yes

	immediate = {
		set_global_flag = russia_reworked_events_loaded_soviet
	}
}

# Border Skirmish with the Japanese
country_event = {
	id = soviet.1
	title = soviet.1.t
	desc = soviet.1.d
	picture = GFX_report_event_japanese_transport_soldiers

	is_triggered_only = yes

	option = { # Push back
		name = soviet.1.a
		ai_chance = { factor = 75 }
		add_political_power = -25
		hidden_effect = {
			random_list = {
				60 = {
					JAP = {
						country_event = { days = 1 id = japan.3 }
					}
				}
				40 = {
					JAP = {
						country_event = { days = 1 id = japan.4 }
					}
				}
			}
		}
		effect_tooltip = {
			random_list = {
				60 = {
					country_event = soviet.2
				}
				40 = {
					country_event = soviet.3
				}
			}
		}
	}
	option = { # Yield
		name = soviet.1.b
		ai_chance = { factor = 25 }
		JAP = {
			effect_tooltip = {
				add_stability = 0.05
			}
			country_event = { days = 1 id = japan.5 }
		}
	}
}

# Successful Raid
country_event = {
	id = soviet.2
	title = soviet.2.t
	desc = soviet.2.d
	picture = GFX_report_event_dead_soldiers

	is_triggered_only = yes

	option = {
		name = soviet.2.a
		if = {
			limit = {
				561 = {
					is_owned_by = SOV
					any_neighbor_state = {
						OR = {
							is_owned_by = JAP
							is_owned_by = MAN
						}
					}
				}
			}
			561 = { add_manpower = -30000 }
		}
		if = {
			limit = {
				NOT = {
					561 = {
						is_owned_by = SOV
						any_neighbor_state = {
							OR = {
								is_owned_by = JAP
								is_owned_by = MAN
							}
						}
					}
				}
			}
			random_owned_state = {
				limit = {
					any_neighbor_state = {
						OR = {
							is_owned_by = JAP
							is_owned_by = MAN
						}
					}
				}
				add_manpower = -30000
			}
		}

		army_experience = 10
	}
}

# Failed Raid
country_event = {
	id = soviet.3
	title = soviet.3.t
	desc = soviet.3.d
	picture = GFX_report_event_dead_soldiers

	is_triggered_only = yes

	option = {
		if = {
			limit = {
				561 = {
					is_owned_by = SOV
					any_neighbor_state = {
						OR = {
							is_owned_by = JAP
							is_owned_by = MAN
						}
					}
				}
			}
			561 = { add_manpower = -20000 }
		}
		if = {
			limit = {
				NOT = {
					561 = {
						is_owned_by = SOV
						any_neighbor_state = {
							OR = {
								is_owned_by = JAP
								is_owned_by = MAN
							}
						}
					}
				}
			}
			random_owned_state = {
				limit = {
					any_neighbor_state = {
						OR = {
							is_owned_by = JAP
							is_owned_by = MAN
						}
					}
				}
				add_manpower = -20000
			}
		}

		add_political_power = -25
		army_experience = 5
		name = soviet.3.a
	}
}

# Romania surrenders Bessarabia
country_event = {
	id = soviet.4
	title = soviet.4.t
	desc = soviet.4.d
	picture = GFX_report_event_soviet_army_greeted

	is_triggered_only = yes

	option = {
		name = soviet.4.a
		SOV = {
			transfer_state = 78
			transfer_state = 80
			transfer_state = 766
		}
		hidden_effect = {
			SOV = {
				country_event = { days = 1 id = news.10 }
			}
			news_event = { id = news.199 }
		}
	}
}

# Romania refuses to surrender Bessarabia
country_event = {
	id = soviet.5
	title = soviet.5.t
	desc = soviet.5.d
	picture = GFX_report_event_stalin_02

	is_triggered_only = yes

	option = {
		name = soviet.5.a
		create_wargoal = {
			type = take_state
			target = ROM
			generator = { 78 }
		}
		hidden_effect = {
			SOV = {
				country_event = { days = 1 id = news.11 }
			}
		}
	}
}

# Estonia Surrenders
country_event = {
	id = soviet.6
	title = soviet.6.t
	desc = soviet.6.d
	picture = GFX_report_event_soviet_invasion_map

	is_triggered_only = yes

	hidden = yes

	option = {
		name = soviet.6.a
	}
}

# Estonia Refuses
country_event = {
	id = soviet.7
	title = soviet.7.t
	desc = soviet.7.d
	picture = GFX_report_event_generic_read_write

	is_triggered_only = yes

	hidden = yes

	option = {
		name = soviet.7.a
	}
}

# Latvia Surrenders
country_event = {
	id = soviet.8
	title = soviet.8.t
	desc = soviet.8.d
	picture = GFX_report_event_soviet_tank_parade

	is_triggered_only = yes

	hidden = yes

	option = {
		name = soviet.8.a
	}
}

# Latvia Refuses
country_event = {
	id = soviet.9
	title = soviet.9.t
	desc = soviet.9.d
	picture = report_event_generic_sign_treaty2

	is_triggered_only = yes

	hidden = yes

	option = {
		name = soviet.9.a
	}
}

# Lithuania Surrenders
country_event = {
	id = soviet.10
	title = soviet.10.t
	desc = soviet.10.d
	picture = GFX_report_event_soviet_tank_parade

	is_triggered_only = yes

	hidden = yes

	option = {
		name = soviet.10.a
	}
}

# Lithuania Refuses
country_event = {
	id = soviet.11
	title = soviet.11.t
	desc = soviet.11.d
	picture = report_event_generic_sign_treaty2

	is_triggered_only = yes

	hidden = yes

	option = {
		name = soviet.11.a
	}
}

# Finland Accepts Demands
country_event = {
	id = soviet.12
	title = soviet.12.t
	desc = soviet.12.d
	picture = GFX_report_event_soviet_finnish_pact

	is_triggered_only = yes

	hidden = yes

	option = {
		name = soviet.12.a
	}
}

# Finland Refuses Demands
country_event = {
	id = soviet.13
	title = soviet.13.t
	desc = soviet.13.d
	picture = GFX_report_event_soviet_tanks_snow

	is_triggered_only = yes

	hidden = yes

	option = {
		name = soviet.13.a
	}
}

# Tannu Tuva is asked to join the USSR
country_event = {
	id = soviet.14
	title = soviet.14.t
	desc = soviet.14.d
	picture = GFX_report_event_stalin_01

	is_triggered_only = yes

	option = { # Accept
		name = soviet.14.a
		ai_chance = { factor = 100 }
		SOV = {
			country_event = { id = soviet.16 }
		}
		custom_effect_tooltip = SOV_game_totally_over_TT
	}
	option = { # Refuse
		name = soviet.14.b
		SOV = {
			country_event = { id = soviet.15 }
		}
	}
}

# Tannu Tuva declines the offer
country_event = {
	id = soviet.15
	title = soviet.15.t
	desc = soviet.15.d
	picture = GFX_report_event_stalin_02

	is_triggered_only = yes

	option = {
		name = soviet.15.a
	}
}

# Tannu Tuva accepts the offer
country_event = {
	id = soviet.16
	title = soviet.16.t
	desc = soviet.16.d
	picture = GFX_report_event_stalin_propaganda

	is_triggered_only = yes

	option = {
		name = soviet.16.a
		annex_country = { target = TAN }
		hidden_effect = {
			SOV = {
				country_event = { days = 1 id = news.14 }
			}
		}
	}
}

# Improving the Stalin Line
country_event = {
	id = soviet.17
	title = soviet.17.t
	desc = soviet.17.d
	picture = GFX_report_event_bunker_01

	is_triggered_only = yes

	option = {
		name = soviet.17.a

		209 = {
			add_building_construction = {
				type = bunker
				province = 11202
				level = 5
			}
			add_building_construction = {
				type = bunker
				province = 6324
				level = 5
			}
			add_building_construction = {
				type = bunker
				province = 11392
				level = 5
			}
		}
		210 = {
			add_building_construction = {
				type = bunker
				province = 6242
				level = 5
			}
		}
		207 = {
			add_building_construction = {
				type = bunker
				province = 6249
				level = 5
			}
			add_building_construction = {
				type = bunker
				province = 9241
				level = 5
			}
			add_building_construction = {
				type = bunker
				province = 3331
				level = 5
			}
		}
		206 = {
			add_building_construction = {
				type = bunker
				province = 9289
				level = 5
			}
		}
		202 = {
			add_building_construction = {
				type = bunker
				province = 9568
				level = 5
			}
			add_building_construction = {
				type = bunker
				province = 3543
				level = 5
			}
			add_building_construction = {
				type = bunker
				province = 504
				level = 5
			}
			add_building_construction = {
				type = bunker
				province = 6497
				level = 5
			}
		}
		203 = {
			add_building_construction = {
				type = bunker
				province = 9451
				level = 5
			}
			add_building_construction = {
				type = bunker
				province = 11409
				level = 5
			}
		}
		192 = {
			add_building_construction = {
				type = bunker
				province = 3757
				level = 5
			}
			add_building_construction = {
				type = bunker
				province = 9714
				level = 5
			}
			add_building_construction = {
				type = bunker
				province = 741
				level = 5
			}
			add_building_construction = {
				type = bunker
				province = 11670
				level = 5
			}
		}
	}
}

# Xi'an Incident
country_event = {
	id = soviet.18
	title = soviet.18.t
	desc = soviet.18.d
	picture = GFX_report_event_china_politicians_captured

	trigger = {
		date > 1936.11.1
		tag = CHI
		has_opinion_modifier = hostile_status
		NOT = { has_dlc = "Waking the Tiger" }
	}

	fire_only_once = yes

	mean_time_to_happen = {
		days = 50
	}

	# Enter negotiations with Communist China
	option = {
		name = soviet.18.a
		PRC = { country_event = { id = soviet.19 days = 1 } }
	}

	# Refuse to negotiate
	option = {
		name = soviet.18.b
		#SOV = { country_event = { id = soviet.20 days = 1 } }
		ai_chance = { factor = 0 }
		set_global_flag = CHI_no_national_front_flag
		custom_effect_tooltip = CHI_no_united_front
	}
}

# Xi'an Incident - Communist China
country_event = {
	id = soviet.19
	title = soviet.19.t
	desc = soviet.19.d
	picture = GFX_report_event_japanese_chinese_surrender

	is_triggered_only = yes

	# Agree to a truce
	option = {
		name = soviet.19.a
		remove_opinion_modifier = { target = CHI modifier = hostile_status }
		CHI = {
			remove_opinion_modifier = { target = PRC modifier = hostile_status }
			country_event = { id = soviet.21 days = 1 }
		}
		hidden_effect = {
			605 = {
				if = {
					limit = { is_border_conflict = yes }
					set_border_war = no
				}
			}
			620 = {
				if = {
					limit = { is_border_conflict = yes }
					set_border_war = no
				}
			}
			607 = {
				if = {
					limit = { is_border_conflict = yes }
					set_border_war = no
				}
			}
			622 = {
				if = {
					limit = { is_border_conflict = yes }
					set_border_war = no
				}
			}
		}
		#SOV = { country_event = { id = soviet.21 days = 1 } }
	}

	# Refuse to negotiate
	option = {
		name = soviet.19.b
		SOV = { country_event = { id = soviet.22 days = 1 } }
		set_global_flag = CHI_no_national_front_flag
		ai_chance = { factor = 0 }
		custom_effect_tooltip = CHI_no_united_front
	}
}

# Xi'an Incident - Kuomintang Refuses
country_event = {
	id = soviet.20
	title = soviet.20.t
	desc = soviet.20.d
	picture = GFX_report_event_nationalist_china_machinegun_firing

	is_triggered_only = yes

	option = {
		name = soviet.20.a
	}
}

# Xi'an Incident - Truce
country_event = {
	id = soviet.21
	title = soviet.21.t
	desc = soviet.21.d
	picture = GFX_report_event_chinese_japanese_handshake

	is_triggered_only = yes

	option = {
		name = soviet.21.a
		effect_tooltip = {
			PRC = { remove_opinion_modifier = { target = CHI modifier = hostile_status } }
			CHI = { remove_opinion_modifier = { target = PRC modifier = hostile_status } }
		}
	}
}

# Xi'an Incident - Communists Refuse
country_event = {
	id = soviet.22
	title = soviet.22.t
	desc = soviet.22.d
	picture = GFX_report_event_chinese_officers

	is_triggered_only = yes

	option = {
		name = soviet.22.a
	}
}

# Soviet Union Cedes Land (Japan)
country_event = {
	id = soviet.23
	title = soviet.23.t
	desc = soviet.23.d
	picture = GFX_report_event_soviet_japanese_pact

	is_triggered_only = yes

	option = {
		name = soviet.23.a
		transfer_state = 655
	}
}

# Great Purge - Begins
country_event = {
	id = soviet.24
	title = soviet.24.t
	desc = soviet.24.d
	picture = GFX_report_event_soviet_purge_speech

	is_triggered_only = yes

	hidden = yes

	option = {
		name = soviet.24.a
	}
}

# Great Purge - Trial of the Anti-Soviet Trotskyist Center
country_event = {
	id = soviet.25
	title = soviet.25.t
	desc = soviet.25.d
	picture = GFX_report_event_soviet_purge_trial

	fire_only_once = yes

	hidden = yes

	trigger = {

	}

	mean_time_to_happen = {

	}

	option = {
		name = soviet.25.a
	}
	option = {
		name = soviet.25.b
	}
	option = {
		name = soviet.25.c
	}
	option = {
		name = soviet.25.e
	}
}

# Great Purge - Secret Trial of the Generals
country_event = {
	id = soviet.26
	title = soviet.26.t
	desc = soviet.26.d
	picture = GFX_report_event_soviet_purge_officers_01

	fire_only_once = yes

	hidden = yes

	trigger = {

	}

	mean_time_to_happen = {

	}

	option = {
		name = soviet.26.a
	}
	option = {
		name = soviet.26.b
	}
	# REVISIT Balance, since the latter removes more unit leaders
	option = {
		name = soviet.26.c
	}
}

# Great Purge - Trial of the 21
country_event = {
	id = soviet.27
	title = soviet.27.t
	desc = soviet.27.d
	picture = GFX_report_event_soviet_purge_officers_02

	fire_only_once = yes

	hidden = yes

	trigger = {

	}

	mean_time_to_happen = {

	}

	option = {
		name = soviet.27.a
	}
	option = {
		name = soviet.27.b
	}
	option = {
		name = soviet.27.c
	}
}

# Trotsykist Coup
country_event = {
	id = soviet.28
	title = soviet.28.t
	desc = soviet.28.d
	picture = GFX_report_event_soviet_purge_politicians

	fire_only_once = yes

	trigger = {
		has_country_flag = SOV_soviet.48_trotsky
		tag = SOV
		NOT = {
		MEX = {
				has_country_leader = { character = SOV_lev_trotsky ruling_only = yes }
			}
		}
	}

	mean_time_to_happen = {
		days = 90
		#modifier = {
		#	factor = 1.25
		#	OR = {
		#		has_country_flag = purged_kalinin
		#		has_country_flag = purged_khrushchev
		#		has_country_flag = purged_party_members
		#	}
		#}
	}

	option = {
		name = soviet.28.a
		set_country_flag = counter_purge
		if = {
			limit = { has_idea = SOV_Trotskyite_plot_purged_russia2 }
			remove_ideas = SOV_Trotskyite_plot_purged_russia2
		}
		if = {
			limit = { has_idea = SOV_Trotskyite_plot_russia2 }
			remove_ideas = SOV_Trotskyite_plot_russia2
		}
		kill_country_leader = yes
		add_country_leader_role = {
			character = MEX_leon_trotsky
			country_leader = {
				expire = "1965.1.1"
				ideology = leninism
				traits = {
					permanent_revolutionary
				}
			}
			promote_leader = yes
		}
		remove_ideas = mikhail_kalinin
		remove_ideas = ivan_konev
		remove_unit_leader = 408
		remove_ideas = pavel_zhigarev
		remove_ideas = stepan_krasovsky
		remove_ideas = arseniy_golovko
		remove_unit_leader = 409
		remove_ideas = georgy_zhukov
		remove_unit_leader = 410
		remove_ideas = sergey_gorshkov
		remove_unit_leader = 411
		remove_ideas = sergei_rudenko
		remove_ideas = nikita_khrushchev
		remove_ideas = konstantin_rodzaevsky
		add_timed_idea = {
			idea = officers_purged_7
			days = 584
		}
		hidden_effect = {
			country_event = { id = soviet.43 days = 146 }
		}
		start_civil_war = {
			ideology = neutrality
			size = 0.18
			keep_unit_leaders = { 401 402 407 410 406 405 403 407 404 }
		}
		hidden_effect = {
			random_other_country = {
				limit = {
					original_tag = SOV
					has_government = neutrality
				}
				kill_country_leader = yes
				create_country_leader = {
					name = "Ivan Konev"
					desc = "POLITICS_IVAN_KONEV_DESC"
					picture = "Portrait_Soviet_Ivan_Konev.dds"
					expire = "1965.1.1"
					ideology = oligarchism
					traits = {
					}
				}
			}
			news_event = { hours = 6 id = news.221 }
		}
	}
}

# France national focus -  requests to join commitern
country_event = {
	id = soviet.29
	title = soviet.29.t
	desc = soviet.29.d
	picture = GFX_report_event_stalin_01

	is_triggered_only = yes

	option = {
		name = soviet.29.a
		SOV = { add_to_faction = FRA }
		FRA = {
			add_ai_strategy = {
				type = alliance
				id = "SOV"
				value = 200
			}
		}
		hidden_effect = {
			news_event = { hours = 6 id = news.180 }
		}
	}
	option = {
		name = soviet.29.b
		ai_chance = { factor = 0 }
		FRA = {
			add_opinion_modifier = {
				target = SOV
				modifier = SOV_FRA_join_comintern_reject
			}
		}
	}
}

# comintern_influence removed due to war with common enemy
country_event = {
	id = soviet.100
	title = soviet.100.t
	desc = soviet.100.d
	picture = GFX_report_event_soviet_soldiers_tank

	trigger = {
		has_idea = comintern_influence
		has_war = yes
		SOV = { has_war = yes }
		NOT = { has_war_with = SOV }
		any_enemy_country = {
			has_war_with = SOV
		}
	}

	mean_time_to_happen = {
		days = 30
	}

	option = {
		name = soviet.100.a
		remove_ideas = comintern_influence
	}
}

# Demand Bessarabia
country_event = {
	id = soviet.30
	title = soviet.30.t
	desc = soviet.30.d
	picture = GFX_report_event_stalin_propaganda

	is_triggered_only = yes

	hidden = yes

	trigger = {

	}

	immediate = {  }

	option = {
		name = soviet.30.a
	}
	option = {
		name = soviet.30.b
	}
}

# Demand Karjala
country_event = {
	id = soviet.31
	title = soviet.31.t
	desc = soviet.31.d
	picture = GFX_report_event_stalin_propaganda

	is_triggered_only = yes

	hidden = yes

	trigger = {

	}

	immediate = {  }

	option = {
		name = soviet.31.a
	}
	option = {
		name = soviet.31.b
	}
}

# Oppress Estonia
country_event = {
	id = soviet.32
	title = soviet.32.t
	desc = soviet.32.d
	picture = GFX_report_event_soviet_in_riga

	is_triggered_only = yes

	hidden = yes

	trigger = {

	}

	immediate = {  }

	option = {
		name = soviet.32.a
	}
	option = {
		name = soviet.32.b
	}
}

# Oppress Latvia
country_event = {
	id = soviet.33
	title = soviet.33.t
	desc = soviet.33.d
	picture = GFX_report_event_soviet_in_riga

	is_triggered_only = yes

	hidden = yes

	trigger = {

	}

	immediate = {  }

	option = {
		name = soviet.33.a
	}
	option = {
		name = soviet.33.b
	}
}

# Oppress Lithuania
country_event = {
	id = soviet.34
	title = soviet.34.t
	desc = soviet.34.d
	picture = GFX_report_event_soviet_in_riga

	is_triggered_only = yes

	hidden = yes

	trigger = {

	}

	immediate = {  }

	option = {
		name = soviet.34.a
	}
	option = {
		name = soviet.34.b
	}
}

# Communist government in FROM baltic country and they wish to be annexed
country_event = {
	id = soviet.35
	title = soviet.35.t
	desc = soviet.35.d
	picture = GFX_report_event_soviet_in_riga

	is_triggered_only = yes

	hidden = yes

	option = {
		name = soviet.35.a
	}
	option = {
		name = soviet.35.b
	}
}

# Communist government in FROM baltic country and they wish to be part puppet
country_event = {
	id = soviet.36
	title = soviet.36.t
	desc = soviet.36.d
	picture = GFX_report_event_soviet_in_riga

	is_triggered_only = yes

	hidden = yes

	immediate = {

	}

	option = {
		name = soviet.36.a
	}
	option = {
		name = soviet.36.b
	}
}

# Purge - New officers less dumb. Regaining org
country_event = {
	id = soviet.37
	title = soviet.37.t
	desc = soviet.37.d
	picture = GFX_report_event_soldiers_marching

	is_triggered_only = yes

	trigger = {	has_idea = officers_purged }

	immediate = {
		hidden_effect = {
			remove_ideas = officers_purged
			add_timed_idea = {
				idea = officers_purged_2
				days = 1314
			}
			country_event = { id = soviet.38 days = 146 }
		}
	}
	option = {
		name = soviet.37.a
		custom_effect_tooltip = soviet.37.a_tt
	}
}
# Purge - New officers less dumb. Regaining org
country_event = {
	id = soviet.38
	title = soviet.37.t
	desc = soviet.37.d
	picture = GFX_report_event_soldiers_marching

	is_triggered_only = yes

	trigger = {	has_idea = officers_purged_2 }

	immediate = {
		hidden_effect = {
			remove_ideas = officers_purged_2
			add_timed_idea = {
				idea = officers_purged_3
				days = 1168
			}
			if = {
				limit = { has_idea = SOV_great_patriotic_war }
				remove_ideas = SOV_great_patriotic_war
				add_ideas = SOV_great_patriotic_war_2
			}
			country_event = { id = soviet.39 days = 146 }
		}
	}
	option = {
		name = soviet.37.a
		custom_effect_tooltip = soviet.37.a_tt
	}
}
# Purge - New officers less dumb. Regaining org
country_event = {
	id = soviet.39
	title = soviet.37.t
	desc = soviet.37.d
	picture = GFX_report_event_soldiers_marching

	is_triggered_only = yes

	trigger = {	has_idea = officers_purged_3 }

	immediate = {
		hidden_effect = {
			remove_ideas = officers_purged_3
			add_timed_idea = {
				idea = officers_purged_4
				days = 1022
			}
			country_event = { id = soviet.40 days = 146 }
		}
	}
	option = {
		name = soviet.37.a
		custom_effect_tooltip = soviet.37.a_tt
	}
}
# Purge - New officers less dumb. Regaining org
country_event = {
	id = soviet.40
	title = soviet.37.t
	desc = soviet.37.d
	picture = GFX_report_event_soldiers_marching

	is_triggered_only = yes

	trigger = {	has_idea = officers_purged_4 }

	immediate = {
		hidden_effect = {
			remove_ideas = officers_purged_4
			add_timed_idea = {
				idea = officers_purged_5
				days = 876
			}
			if = {
				limit = { has_idea = SOV_great_patriotic_war_2 }
				remove_ideas = SOV_great_patriotic_war_2
				add_ideas = SOV_great_patriotic_war_3
			}
			country_event = { id = soviet.41 days = 146 }
		}
	}
	option = {
		name = soviet.37.a
		custom_effect_tooltip = soviet.37.a_tt
	}
}
# Purge - New officers less dumb. Regaining org
country_event = {
	id = soviet.41
	title = soviet.37.t
	desc = soviet.37.d
	picture = GFX_report_event_soldiers_marching

	is_triggered_only = yes

	trigger = {	has_idea = officers_purged_5 }

	immediate = {
	hidden_effect = {
			remove_ideas = officers_purged_5
			add_timed_idea = {
				idea = officers_purged_6
				days = 730
			}
			country_event = { id = soviet.42 days = 146 }
		}
	}
	option = {
		name = soviet.37.a
		custom_effect_tooltip = soviet.37.a_tt
	}
}
# Purge - New officers less dumb. Regaining org
country_event = {
	id = soviet.42
	title = soviet.37.t
	desc = soviet.37.d
	picture = GFX_report_event_soldiers_marching

	is_triggered_only = yes

	trigger = {	has_idea = officers_purged_6 }

	immediate = {
		hidden_effect = {
			remove_ideas = officers_purged_6
			add_timed_idea = {
				idea = officers_purged_7
				days = 584
			}
			if = {
				limit = { has_idea = SOV_great_patriotic_war_3 }
				remove_ideas = SOV_great_patriotic_war_3
				add_ideas = SOV_great_patriotic_war_4
			}
			country_event = { id = soviet.43 days = 146 }
		}
	}
	option = {
		name = soviet.37.a
		custom_effect_tooltip = soviet.37.a_tt
	}
}
# Purge - New officers less dumb. Regaining org
country_event = {
	id = soviet.43
	title = soviet.37.t
	desc = soviet.37.d
	picture = GFX_report_event_soldiers_marching

	is_triggered_only = yes

	trigger = {	has_idea = officers_purged_7 }

	immediate = {
		hidden_effect = {
			remove_ideas = officers_purged_7
			add_timed_idea = {
				idea = officers_purged_8
				days = 438
			}
			country_event = { id = soviet.44 days = 146 }
		}
	}
	option = {
		name = soviet.37.a
		custom_effect_tooltip = soviet.37.a_tt
	}
}
# Purge - New officers less dumb. Regaining org
country_event = {
	id = soviet.44
	title = soviet.37.t
	desc = soviet.37.d
	picture = GFX_report_event_soldiers_marching

	is_triggered_only = yes

	trigger = {	has_idea = officers_purged_8 }

	immediate = {
		hidden_effect = {
			remove_ideas = officers_purged_8
			add_timed_idea = {
				idea = officers_purged_9
				days = 292
			}
			if = {
				limit = { has_idea = SOV_great_patriotic_war_4 }
				remove_ideas = SOV_great_patriotic_war_4
				add_ideas = SOV_great_patriotic_war_5
			}
			country_event = { id = soviet.45 days = 146 }
		}
	}
	option = {
		name = soviet.37.a
		custom_effect_tooltip = soviet.37.a_tt
	}
}
# Purge - New officers less dumb. Regaining org
country_event = {
	id = soviet.45
	title = soviet.37.t
	desc = soviet.37.d
	picture = GFX_report_event_soldiers_marching

	is_triggered_only = yes

	trigger = {	has_idea = officers_purged_9 }

	immediate = {
		hidden_effect = {
			remove_ideas = officers_purged_9
			add_timed_idea = {
				idea = officers_purged_10
				days = 146
			}
		}
		country_event = { id = soviet.47 days = 146 }
	}
	option = {
		name = soviet.37.a
		custom_effect_tooltip = soviet.37.a_tt
	}
}
# Purge - Fighting defensive war against major
country_event = {
	id = soviet.46
	title = soviet.46.t
	desc = soviet.46.d
	picture = GFX_report_event_soldiers_marching

	is_triggered_only = yes

	trigger = {

	}

	immediate = {
		hidden_effect = {
			if = {
				limit = {
					OR = {
						has_idea = officers_purged
						has_idea = officers_purged_2
					}
				}
				add_ideas = SOV_great_patriotic_war
			}
			if = {
				limit = {
					OR = {
						has_idea = officers_purged_3
						has_idea = officers_purged_4
					}
				}
				add_ideas = SOV_great_patriotic_war_2
			}
			if = {
				limit = {
					OR = {
						has_idea = officers_purged_5
						has_idea = officers_purged_6
					}
				}
				add_ideas = SOV_great_patriotic_war_3
			}
			if = {
				limit = {
					OR = {
						has_idea = officers_purged_7
						has_idea = officers_purged_8
					}
				}
				add_ideas = SOV_great_patriotic_war_4
			}
			if = {
				limit = {
					OR = {
						has_idea = officers_purged_9
						has_idea = officers_purged_10
					}
				}
				add_ideas = SOV_great_patriotic_war_5
			}
		}
	}

	option = {
		name = soviet.46.a
		custom_effect_tooltip = soviet.46.a_tt
	}
}
# Purge - Special event to remove patriotic war if it has been added
country_event = {
	id = soviet.47

	hidden = yes

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { has_idea = SOV_great_patriotic_war_5 }
			remove_ideas = SOV_great_patriotic_war_5
		}
	}
}

#No purges completed - decide what to do
country_event = {
	id = soviet.48
	title = soviet.48.t
	desc = soviet.48.d
	picture = GFX_report_event_soviet_purge_politicians

	hidden = yes

	trigger = {

	}

	mean_time_to_happen = {

	}

	fire_only_once = yes

	#Don't invite trotsky
	option = {
		name = soviet.48.a
	}

	#Invite back Trotsky
	option = {
		name = soviet.48.b
	}

}

#No purges massive civil war
country_event = {
	id = soviet.49
	title = soviet.49.t
	desc = soviet.49.d
	picture = GFX_report_event_soviet_tanks

	hidden = yes

	is_triggered_only = yes

	option = {
		name = soviet.49.a
	}
}

#1/4 purges
country_event = {
	id = soviet.50
	title = soviet.50.t
	desc = soviet.50.d
	picture = GFX_report_event_soviet_purge_officers_02

	hidden = yes

	is_triggered_only = yes

	option = {
		name = soviet.50.a
	}
}

#2/4 purges
country_event = {
	id = soviet.51
	title = soviet.51.t
	desc = soviet.51.d
	picture = GFX_report_event_soviet_purge_officers_02

	hidden = yes

	is_triggered_only = yes

	option = {
		name = soviet.51.a
	}
}

#3/4 purges
country_event = {
	id = soviet.52
	title = soviet.52.t
	desc = soviet.52.d
	picture = GFX_report_event_stalin_propaganda

	hidden = yes

	is_triggered_only = yes

	option = {
		name = soviet.52.a
	}
}

#4/4 purges
country_event = {
	id = soviet.53
	title = soviet.53.t
	desc = soviet.53.d
	picture = GFX_report_event_stalin_01

	hidden = yes

	is_triggered_only = yes

	option = {
		name = soviet.53.a
	}

}


#New Leadership in Russia
country_event = {
	id = soviet.54
	title = soviet.54.t
	desc = soviet.54.d
	picture = GFX_report_event_soviet_purge_speech

	hidden = yes

	is_triggered_only = yes

	option = {
		name = soviet.54.a
	}
}


# Poland conquered... honor MR Pact?
country_event = {
	id = soviet.60
	title = soviet.60.t
	desc = soviet.60.d
	picture = GFX_report_event_soviet_tanks

	fire_only_once = yes

	trigger = {
		tag = SOV
		has_global_flag = sov_yes_pact
		GER = {
			exists = yes
			is_subject = no
		}
		NOT =  { has_war_with = GER }
		OR = {
			OR = {
				owns_state = 88 #KRAKOW
				owns_state = 92 #LUBLIN
				owns_state = 90 #KIELCE
				owns_state = 86 #POZNAN
				owns_state = 87 #LODZ
				owns_state = 85 #DANZIG
				owns_state = 98 #PLOCK
				owns_state = 10 #WARSAW
				owns_state = 762 #KATOWICE
				owns_state = 807 #GDYNIA
			}
			AND = {
				POL = { has_capitulated = yes }
				OR = {
					controls_state = 88 #KRAKOW
					controls_state = 92 #LUBLIN
					controls_state = 90 #KIELCE
					controls_state = 86 #POZNAN
					controls_state = 87 #LODZ
					controls_state = 85 #DANZIG
					controls_state = 98 #PLOCK
					controls_state = 10 #WARSAW
					controls_state = 762 #KATOWICE
					controls_state = 807 #GDYNIA
				}
			}
			OR = {
				any_other_country = {
					is_in_faction_with = SOV
					SOV = {
						is_faction_leader = yes
					}
					OR = {
						owns_state = 88 #KRAKOW
						owns_state = 92 #LUBLIN
						owns_state = 90 #KIELCE
						owns_state = 86 #POZNAN
						owns_state = 87 #LODZ
						owns_state = 85 #DANZIG
						owns_state = 98 #PLOCK
						owns_state = 10 #WARSAW
						owns_state = 762 #KATOWICE
						owns_state = 807 #GDYNIA
						AND = {
							POL = { has_capitulated = yes }
							OR = {
								controls_state = 88 #KRAKOW
								controls_state = 92 #LUBLIN
								controls_state = 90 #KIELCE
								controls_state = 86 #POZNAN
								controls_state = 87 #LODZ
								controls_state = 85 #DANZIG
								controls_state = 98 #PLOCK
								controls_state = 10 #WARSAW
								controls_state = 762 #KATOWICE
								controls_state = 807 #GDYNIA
							}
						}
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		ai_chance = {
			base = 1
			modifier = {
				factor = 0
				AND = {
					POL = {
						is_ai = no
						has_civil_war = no
					}
					is_in_faction_with = POL
				}
			}
		}
		name = soviet.60.a
		#KRAKOW
		if = {
			limit = {
				88 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 88
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = { transfer_state = 88 }
		}
		#LUBLIN
		if = {
			limit = {
				92 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 92
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = { transfer_state = 92 }
		}
		#KIELCE
		if = {
			limit = {
				90 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 90
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = { transfer_state = 90 }
		}
		#POZNAN
		if = {
			limit = {
				86 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 86
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = {
				transfer_state = 86
				add_state_core = 86
			}
		}
		#LODZ
		if = {
			limit = {
				87 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 87
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = { transfer_state = 87 }
		}
		#DANZIG
		if = {
			limit = {
				85 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 85
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = {
				transfer_state = 85
				add_state_core = 85
			}
		}
		#PLOCK
		if = {
			limit = {
				98 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 98
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = { transfer_state = 98 }
		}
		#WARSAW
		if = {
			limit = {
				10 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 10
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = { transfer_state = 10 }
		}
		#KATOWICE
		if = {
			limit = {
				762 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 762
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = {
				transfer_state = 762
				add_state_core = 762
			}
		}
		#GDYNIA
		if = {
			limit = {
				807 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 807
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = { transfer_state = 807 }
		}
		#MEMEL
		if = {
			limit = {
				188 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 188
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = { transfer_state = 188 }
		}
		#WESTERN SLOVAKIA
		if = {
			limit = {
				70 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 70
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = { transfer_state = 70 }
		}
		#EASTERN SLOVAKIA
		if = {
			limit = {
				71 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 71
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = { transfer_state = 71 }
		}
		#SOJTHERN SLOVAKIA
		if = {
			limit = {
				664 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 664
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = { transfer_state = 664 }
		}
		#ZAOLZIE
		if = {
			limit = {
				72 = {
					OR = {
						is_controlled_by = SOV
						any_other_country = {
							controls_state = 72
							is_in_faction_with = SOV
							SOV = { is_faction_leader = yes }
						}
					}
				}
			}
			GER = { transfer_state = 72 }
		}

		GER = { country_event = soviet.61 }
	}
	option = {
		name = soviet.60.b
		ai_chance = {
			base = 1
			modifier = {
				add = -1
				is_historical_focus_on = yes
				NOT = {
					AND = {
						POL = {
							is_ai = no
							has_civil_war = no
						}
						is_in_faction_with = POL
					}
				}
			}
		}
		GER = { country_event = soviet.62 }
		clr_global_flag = sov_yes_pact
		diplomatic_relation = {
			country = GER
			relation = non_aggression_pact
			active = no
		}
		GER = {
			add_state_claim = 88
			add_state_claim = 92
			add_state_claim = 90
			add_state_claim = 86
			add_state_claim = 87
			add_state_claim = 85
			add_state_claim = 98
			add_state_claim = 10
			add_state_claim = 762
			add_state_claim = 807
			effect_tooltip = {
				create_wargoal = {
					type = annex_everything
					target = SOV
				}
			}
		}
	}
}

# Soviet honors MR Pact (Germany)
country_event = {
	id = soviet.61
	title = soviet.61.t
	desc = soviet.61.d
	picture = GFX_report_event_soviet_german_soldier_handshake

	is_triggered_only = yes

	option = {
		name = germany.12.a
		if = {
			limit = {
				GER = {
					controls_state = 85
					controls_state = 86
					controls_state = 87
				}
			}
			hidden_effect = {
				news_event = { hours = 6 id = news.287 }
			}
		}
	}
}

# Soviet betrays MR Pact (Germany)
country_event = {
	id = soviet.62
	title = soviet.62.t
	desc = soviet.62.d
	picture = GFX_report_event_soviet_tanks

	is_triggered_only = yes

	option = {
		name = soviet.62.a
		create_wargoal = {
			type = annex_everything
			target = SOV
		}
	}
}

# SOV becomes just Russia
#country_event = {
#	id = soviet.63
#
#	trigger = {
#		tag = SOV
#		country_exists = UKR
#		country_exists = BLR
#		country_exists = GEO
#		country_exists = AZR
#		country_exists = ARM
#		country_exists = UZB
#		country_exists = TAJ
#		country_exists = KYR
#		country_exists = TMS
#		country_exists = KAZ
#		NOT = { has_global_flag = SOV_became_russia }
#	}
#
#	mean_time_to_happen = { days = 2 }
#
#	hidden = yes
#
#	immediate = {
#		set_cosmetic_tag = SOV_russia
#		set_global_flag = SOV_became_russia
#	}
#}

# SOV becomes SOV again
#country_event = {
#	id = soviet.64
#
#	trigger = {
#		tag = SOV
#		NOT = { country_exists = UKR }
#		NOT = { country_exists = BLR }
#		NOT = { country_exists = GEO }
#		NOT = { country_exists = AZR }
#		NOT = { country_exists = ARM }
#		NOT = { country_exists = UZB }
#		NOT = { country_exists = TAJ }
#		NOT = { country_exists = KYR }
#		NOT = { country_exists = TMS }
#		NOT = { country_exists = KAZ }
#		NOT = {
#			any_state = {
#				is_core_of = SOV
#				NOT = { state = 329 }
#				NOT = { is_owned_by = SOV }
#			}
#		}
#		has_global_flag = SOV_became_russia
#	}
#
#	mean_time_to_happen = { days = 2 }
#
#	hidden = yes
#
#	immediate = {
#		drop_cosmetic_tag = yes
#		clr_global_flag = SOV_became_russia
#	}
#}