﻿###########################
# Soviet Events
###########################

add_namespace = 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_national_unity = 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
	}
}

# Dany accepts Warlocks
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
		add_ideas = vyserion
		add_ideas = rheagul
		add_timed_idea = { idea = fascist_influence days = 365 }
		SOV = {
			country_event = { days = 1 id = soviet.5 }
		}
		hidden_effect = {
#			news_event = { id = news.199 }
		}
	}
}

# Warlocks give vision
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
		add_ideas = TAR_undying_vision
		remove_ideas = vyserion
		remove_ideas = rheagul
		SOV = { transfer_state = 443 }
		SOV = {	add_state_core = 443 }
		ISR = {	remove_state_core = 443 }
		SOV = { transfer_state = 415 }
		SOV = {	add_state_core = 415 }
		ISR = {	remove_state_core = 415 }
		hidden_effect = {
#			SOV = {
#				country_event = { days = 1 id = news.11 }
#			}
		}
	}
}

# Dany gives Port Yhos
country_event = {
	id = soviet.6
	title = soviet.6.t
	desc = soviet.6.d
	picture = GFX_report_event_soviet_invasion_map
	
	is_triggered_only = yes
	
	option = {
		name = soviet.6.a
		ISR = { transfer_state = 320 }
		ISR = {	add_state_core = 320 }
		SOV = {	remove_state_claim = 320 }
		set_global_flag = TAR_investin_yhos
	}
}

# Unburned Khaleesi
country_event = {
	id = soviet.7
	title = soviet.7.t
	desc = soviet.7.d
	picture = GFX_report_event_generic_read_write
	
	is_triggered_only = yes
	
	option = {
		name = soviet.7.a
		add_ideas = drogon
		add_ideas = rheagul
		add_ideas = vyserion
		hidden_effect = {
			set_politics = {
			
				ruling_party = communism			
				elections_allowed = no
		
			}

			add_popularity = {
				ideology = communism
				popularity = 1.00
			}
#			SOV = { add_country_leader_trait = mother_of_dragons }
#			add_trait = {
#   				character = TAR_daenerys
#     				ideology = communism
#   				trait = mother_of_dragons
#			}
			news_event = { hours = 6 id = news.308 }			
		}		
	}
}

# Dany chooses guild
country_event = {
	id = soviet.8
	title = soviet.8.t
	desc = soviet.8.d
	picture = GFX_report_event_soviet_tank_parade
	
	is_triggered_only = yes
	
	option = {
		name = soviet.8.a
		add_ideas = rheagul
		add_timed_idea = { idea = QAR_payment_once days = 285 }
		add_timed_idea = { idea = democratic_influence days = 205 }
		add_timed_idea = { idea = communist_influence days = 185 }
		SOV = {
			country_event = { days = 1 id = soviet.9 }
		}
	}
}

# Guild thanks Dany
country_event = {
	id = soviet.9
	title = soviet.9.t
	desc = soviet.9.d
	picture = report_event_generic_sign_treaty2
	
	is_triggered_only = yes
	
	option = {
		name = soviet.9.a
		add_timed_idea = { idea = TAR_payments days = 365 }
		remove_ideas = rheagul
		SOV = { transfer_state = 443 }
		SOV = {	add_state_core = 443 }
		ISR = {	remove_state_core = 443 }
		SOV = { transfer_state = 415 }
		SOV = {	add_state_core = 415 }
		ISR = {	remove_state_core = 415 }
		set_global_flag = TAR_chose_guild		
	}
}

# Dany Chose Spicers
country_event = {
	id = soviet.10
	title = soviet.10.t
	desc = soviet.10.d
	picture = GFX_report_event_soviet_tank_parade
	
	is_triggered_only = yes
	
	option = {
		name = soviet.10.a
		add_ideas = QAR_payments
		SOV = {
			country_event = { days = 1 id = soviet.11 }
		}
	}
}

# Spicers thankful
country_event = {
	id = soviet.11
	title = soviet.11.t
	desc = soviet.11.d
	picture = report_event_generic_sign_treaty2
	
	is_triggered_only = yes
	
	option = {
		name = soviet.11.a
		add_ideas = TAR_payments_2
		SOV = { transfer_state = 443 }
		SOV = {	add_state_core = 443 }
		ISR = {	remove_state_core = 443 }
		SOV = { transfer_state = 415 }
		SOV = {	add_state_core = 415 }
		ISR = {	remove_state_core = 415 }
		set_global_flag = TAR_chose_spicers		
	}
}

# new ibben yes
country_event = {
	id = soviet.12
	title = soviet.12.t
	desc = soviet.12.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = soviet.12.a
		SOV = { 
			transfer_state = 592
		}
		SOV = { 
			transfer_state = 637
		}
		SOV = {
			remove_state_claim = 399
			remove_state_claim = 614
			remove_state_claim = 593
		}
		hidden_effect = {
#			SOV = {
#				country_event = { days = 1 id = news.13 }
#			}
		}
	}
}

# Ibbish refuse!
country_event = {
	id = soviet.13
	title = soviet.13.t
	desc = soviet.13.d
	picture = GFX_report_event_soviet_tanks_snow
	
	is_triggered_only = yes
	
	option = {
		name = soviet.13.a
		create_wargoal = {
			type = take_state
			target = BLR
			generator = { 592 }
		}				
		hidden_effect = {
#			SOV = {
#				country_event = { days = 1 id = news.12 }				
#			}
		}
	}
}

# Qarth welcomes Dany ( ISR )
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 = 99 }
		SOV = {
			country_event = { id = soviet.15 days = 3 }
		}
#		custom_effect_tooltip = GAME_OVER_TT
	}
	option = { # Refuse
		name = soviet.14.b
		ai_chance = { factor = 1 }
#		SOV = {
#			country_event = { id = soviet.15 }
#		}
	}
}

# Qarth welcomes Dany
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
		SOV = {	add_state_core = 402 }
		diplomatic_relation = { country = ISR relation = non_aggression_pact }
	}
}

# ISR - We now control all ports
country_event = {
	id = soviet.16
	title = soviet.16.t
	desc = soviet.16.d
#	picture = GFX_report_event_stalin_propaganda

	trigger = {
		tag = ISR
		NOT = { has_war_with = SOV }
		has_global_flag = TAR_chose_spicers
		702 = { is_owned_and_controlled_by = ISR }
		649 = { is_owned_and_controlled_by = ISR }
		422 = { is_owned_and_controlled_by = ISR }
		320 = { is_owned_and_controlled_by = ISR }
	}

	mean_time_to_happen = { days = 5 }

	fire_only_once = yes
	
#	is_triggered_only = yes
	
	option = {
		name = soviet.16.a
		add_political_power = 250
		hidden_effect = {
			SOV = {
#				message = TAR_debt_repayed
				if = {
					limit = { has_idea = TAR_payments }
					remove_ideas = TAR_payments
				}
			}
		}
	}
}

# 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
			}
		}
	}
}

# yemen / New Khalassar
country_event = {
	id = soviet.18
	title = soviet.18.t
	desc = soviet.18.d
	picture = GFX_report_event_china_politicians_captured
	
#	trigger = {
#		tag = SOV
#		SOV = { has_idea = TAR_depression }
#	}

	is_triggered_only = yes

#	fire_only_once = yes

#	mean_time_to_happen = {
#		days = 1
#	}

	immediate = {
		hidden_effect = {
			YEM = { transfer_state = 584 }
			YEM = {	add_state_core = 584 }
			SOV = {	remove_state_core = 584 }
			YEM = {
				load_oob = YEM_1936
				add_manpower = 69876
			}
		}
	}
	
	# Big problem
	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
#	}
}

# Targaryens demand subjugation
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 }
		SOV = { puppet = Root }
		SOV = {
#			remove_opinion_modifier = { target = PRC modifier = hostile_status }
			country_event = { id = targaryen.1 days = 1 }
		}
		hidden_effect = {

		}
	}

	# Refuse to negotiate
	option = {
		name = soviet.19.b
		SOV = { country_event = { id = targaryen.2 days = 1 } }
#		set_global_flag = CHI_no_national_front_flag
#		ai_chance = { factor = 50 }
	}
}

# Second sons agree
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
		set_global_flag = second_sons_not_4_hire
		create_corps_commander = {
			name = "Mero"
			picture = "Portrait_Mero.dds"
			id = 597
			traits = { }
			skill = 2
			attack_skill = 2
			defense_skill = 1
			planning_skill = 2
			logistics_skill = 1
		}
		create_corps_commander = {
			name = "Prendahl na Ghezn"
			picture = "Portrait_Prendahl.dds"
			id = 598
			traits = { }
			skill = 2
			attack_skill = 1
			defense_skill = 2
			planning_skill = 1
			logistics_skill = 2
		}
		create_corps_commander = {
			name = "Daario Naharis"
			picture = "Portrait_Daario.dds"
			id = 599
			traits = { panzer_leader }
			skill = 2
			attack_skill = 2
			defense_skill = 1
			planning_skill = 2
			logistics_skill = 2
		}
		hidden_effect = {
			division_template = {
				name = "Second Sons Infantry Division"
				regiments = {
					infantry = { x = 0 y = 0 }
					infantry = { x = 0 y = 1 }
					infantry = { x = 0 y = 2 }
					infantry = { x = 0 y = 3 }
					infantry = { x = 1 y = 0 }
					infantry = { x = 1 y = 1 }
					infantry = { x = 1 y = 2 }
					infantry = { x = 1 y = 3 }	
					cavalry = { x = 2 y = 0 }
					cavalry = { x = 2 y = 1 }
				}
				support = {
        				recon = { x = 0 y = 0 }
				}
			}
			division_template = {
				name = "Second Sons Light Armored Division"
				regiments = {
					light_armor = { x = 0 y = 0 }
					light_armor = { x = 0 y = 1 }
					light_armor = { x = 0 y = 2 }
					light_armor = { x = 1 y = 0 }
					light_armor = { x = 1 y = 1 }
					motorized = { x = 2 y = 0 }
					motorized = { x = 2 y = 1 }
				}
			}

			set_division_template_lock = {
				division_template = "Second Sons Infantry Division"
				is_locked = yes
			}

			set_division_template_lock = {
				division_template = "Second Sons Light Armored Division"
				is_locked = yes
			}

		random_owned_controlled_state = {
			prioritize = { 443 }
				create_unit = { 
				division = "name = \"'Broken Sword' Division\" division_template = \"Second Sons Infantry Division\" 				start_experience_factor = 0.6"
				owner = Root
					}
				create_unit = { 
				division = "name = \"'Harwyn Hoare' Division\" division_template = \"Second Sons Infantry Division\" 				start_experience_factor = 0.6"
				owner = Root
					}
				create_unit = { 
				division = "name = \"'Aegon Rivers' Division\" division_template = \"Second Sons Infantry Division\" 				start_experience_factor = 0.6"
				owner = Root
					}
				create_unit = { 
				division = "name = \"'Prince Aerion' Division\" division_template = \"Second Sons Infantry Division\" 				start_experience_factor = 0.6"
				owner = Root
					}
				create_unit = { 
				division = "name = \"'Rodrik Stark' Division\" division_template = \"Second Sons Infantry Division\" 				start_experience_factor = 0.4"
				owner = Root
					}
				create_unit = { 
				division = "name = \"'Tattered Prince' Division\" division_template = \"Second Sons Infantry Division\" 				start_experience_factor = 0.4"
				owner = Root
					}
				create_unit = { 
				division = "name = \"'Hammer' Division\" division_template = \"Second Sons Light Armored Division\" 				start_experience_factor = 0.6"
				owner = SOV
					}
				create_unit = { 
				division = "name = \"'Nail' Division\" division_template = \"Second Sons Light Armored Division\" 				start_experience_factor = 0.3"
				owner = SOV
					}
				create_unit = { 
				division = "name = \"'Snatch' Division\" division_template = \"Second Sons Light Armored Division\" 				start_experience_factor = 0.3"
				owner = SOV
					}
				create_unit = { 
				division = "name = \"'Uhlan' Division\" division_template = \"Second Sons Light Armored Division\" 				start_experience_factor = 0.3"
				owner = SOV
					}

				}
			}
	}
}

# Second sons refuse
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
		hidden_effect = {
			SOV = { country_event = { id = soviet.22 days = 5 } }
		}
	}
}

# Daario
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
		set_global_flag = second_sons_not_4_hire
		create_corps_commander = {
			name = "Daario Naharis"
			picture = "Portrait_Daario.dds"
			id = 599
			traits = { panzer_leader }
			skill = 3
			attack_skill = 3
			defense_skill = 2
			planning_skill = 3
			logistics_skill = 2
		}
		hidden_effect = {

			division_template = {
				name = "Second Sons Infantry Division"
				regiments = {
					infantry = { x = 0 y = 0 }
					infantry = { x = 0 y = 1 }
					infantry = { x = 0 y = 2 }
					infantry = { x = 0 y = 3 }
					infantry = { x = 1 y = 0 }
					infantry = { x = 1 y = 1 }
					infantry = { x = 1 y = 2 }
					infantry = { x = 1 y = 3 }	
					cavalry = { x = 2 y = 0 }
					cavalry = { x = 2 y = 1 }
				}
				support = {
        				recon = { x = 0 y = 0 }
				}
			}

			division_template = {
				name = "Second Sons Light Armored Division"
				regiments = {
					light_armor = { x = 0 y = 0 }
					light_armor = { x = 0 y = 1 }
					light_armor = { x = 0 y = 2 }
					light_armor = { x = 1 y = 0 }
					light_armor = { x = 1 y = 1 }
					motorized = { x = 2 y = 0 }
					motorized = { x = 2 y = 1 }
				}
			}

			set_division_template_lock = {
				division_template = "Second Sons Infantry Division"
				is_locked = yes
			}

			set_division_template_lock = {
				division_template = "Second Sons Light Armored Division"
				is_locked = yes
			}

		random_owned_controlled_state = {
			prioritize = { 443 }
				create_unit = { 
				division = "name = \"'Broken Sword' Division\" division_template = \"Second Sons Infantry Division\" 				start_experience_factor = 0.4"
				owner = Root
					}
				create_unit = { 
				division = "name = \"'Harwyn Hoare' Division\" division_template = \"Second Sons Infantry Division\" 				start_experience_factor = 0.6"
				owner = Root
					}
				create_unit = { 
				division = "name = \"'Aegon Rivers' Division\" division_template = \"Second Sons Infantry Division\" 				start_experience_factor = 0.4"
				owner = Root
					}
				create_unit = { 
				division = "name = \"'Prince Aerion' Division\" division_template = \"Second Sons Infantry Division\" 				start_experience_factor = 0.4"
				owner = Root
					}
				create_unit = { 
				division = "name = \"'Rodrik Stark' Division\" division_template = \"Second Sons Infantry Division\" 				start_experience_factor = 0.3"
				owner = Root
					}
				create_unit = { 
				division = "name = \"'Hammer' Division\" division_template = \"Second Sons Light Armored Division\" 				start_experience_factor = 0.4" 
				owner = SOV
					}
				create_unit = { 
				division = "name = \"'Nail' Division\" division_template = \"Second Sons Light Armored Division\" 				start_experience_factor = 0.2" 
				owner = SOV
					}
				create_unit = { 
				division = "name = \"'Snatch' Division\" division_template = \"Second Sons Light Armored Division\" 				start_experience_factor = 0.2" 
				owner = SOV
					}
				create_unit = { 
				division = "name = \"'Uhlan' Division\" division_template = \"Second Sons Light Armored Division\" 				start_experience_factor = 0.1" 
				owner = SOV
					}

				}
			}
	}
}

# Cedes Land / defecting to yemen
country_event = {
	id = soviet.23
	title = soviet.23.t
	desc = soviet.23.d
	picture = GFX_report_event_soviet_japanese_pact
	
	trigger = {
		tag = SOV
		YEM = { exists = yes }
		SOV = { NOT = { has_completed_focus = TAR_cross_redwaste } } 
	}

	fire_only_once = yes

	mean_time_to_happen = {
		days = 30
	}

	immediate = {
		hidden_effect = {
			YEM = { transfer_state = 504 }
			YEM = {	add_state_core = 504 }
			YEM = { transfer_state = 490 }
			YEM = {	add_state_core = 490 }
			SOV = {	remove_state_core = 504 }
			SOV = {	remove_state_core = 490 }
			}
	}
	
	option = {
		name = soviet.23.a
#		transfer_state = 655
	}
}

# Drogo Volunteers arrive - 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
	
	option = {
		name = soviet.24.a
		hidden_effect = {
			SOV = {
				load_oob = Drogo_Khals
				add_manpower = 39876
			}
		}
		create_corps_commander = {
			name = "Bloodrider Kovarro"
			picture = "Portrait_Kovarro.dds"
#			traits = { panzer_leader }
			skill = 2
			id = 411
		}
		create_corps_commander = {
			name = "Bloodrider Rakharo"
			picture = "Portrait_Rakharo.dds"
#			traits = { panzer_leader }
			skill = 1
			id = 408
		}
	}
}

# Overlord of Slavers Bay
country_event = {
	id = soviet.25
	title = soviet.25.t
	desc = soviet.25.d
	picture = GFX_report_event_soviet_purge_trial

	is_triggered_only = yes

	option = {
		ai_chance = {
			factor = 60
		}
		name = soviet.25.a
		set_capital = { state = 656 }
		hidden_effect = {
		every_state = {
			limit = {
				is_core_of = EGY
				is_owned_and_controlled_by = SOV
			}
			SOV = {
				add_state_core = PREV
			}
		}
		}
	}
	option = {
		ai_chance = {
			factor = 30
		}
		name = soviet.25.b
		set_capital = { state = 321 }
		hidden_effect = {
		every_state = {
			limit = {
				is_core_of = PER
				is_owned_and_controlled_by = SOV
			}
			SOV = {
				add_state_core = PREV
			}
		}
		}
	}
	option = {
		ai_chance = {
			factor = 10
		}
		name = soviet.25.c
		set_capital = { state = 701 }
		hidden_effect = {
		every_state = {
			limit = {
				is_core_of = IRQ
				is_owned_and_controlled_by = SOV
			}
			SOV = {
				add_state_core = PREV
			}
		}
		}
	}
}

# 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
	
#	trigger = {
#		tag = SOV
#		NOT = { has_completed_focus = SOV_great_purge }
#		focus_progress = {
#			focus = SOV_great_purge
#			progress > 0.5
#		}
#	}

	is_triggered_only = yes

#	mean_time_to_happen = {
#		days = 1
#	}

	option = {
		ai_chance = {
			factor = 20
		}
		name = soviet.26.a
		set_country_flag = purge_1_group_a
		custom_effect_tooltip = remove_theorist
		show_ideas_tooltip = mikhail_tukhachevsky
		custom_effect_tooltip = remove_chief_of_army
		show_ideas_tooltip = alexander_yegorov
		show_ideas_tooltip = vasily_blucher
		custom_effect_tooltip = remove_chief_of_navy
		show_ideas_tooltip = pyotr_smirnov
		show_ideas_tooltip = mikhail_frinovsky
		remove_unit_leader = 401 #mikhail_tukhachevsky, field marshal
		custom_effect_tooltip = soviet.27_tt
		hidden_effect = {
			remove_ideas = mikhail_tukhachevsky
			remove_ideas = alexander_yegorov
			remove_ideas = vasily_blucher
			remove_ideas = pyotr_smirnov
			remove_ideas = mikhail_frinovsky
		}
	}
	option = {
		ai_chance = {
			factor = 75
		}
		name = soviet.26.b
		set_country_flag = purge_1_group_b
		custom_effect_tooltip = remove_chief_of_army
		show_ideas_tooltip = semyon_timoshenko
		show_ideas_tooltip = kliment_voroshilov
		custom_effect_tooltip = remove_chief_of_navy
		show_ideas_tooltip = ivan_yumashev
		custom_effect_tooltip = remove_military_high_command
		show_ideas_tooltip = konstantin_rokossovsky
		show_ideas_tooltip = vladimir_kasatonov
		remove_unit_leader = 405 #kliment_voroshilov, field marshal
		remove_unit_leader = 402 #konstantin_rokossovsky, general
		remove_unit_leader = 404 #semyon_timoshenko, general
		remove_unit_leader = 403 #vladimir_kasatonov, naval commander
		custom_effect_tooltip = soviet.27_tt
		hidden_effect = {
			remove_ideas = semyon_timoshenko
			remove_ideas = kliment_voroshilov
			remove_ideas = ivan_yumashev
			remove_ideas = konstantin_rokossovsky
			remove_ideas = vladimir_kasatonov
		}	
	}
	# REVISIT Balance, since the latter removes more unit leaders
	option = {
		ai_chance = {
			factor = 5
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
		name = soviet.26.c
		set_country_flag = purge_1_no_purge 
		custom_effect_tooltip = soviet.27_tt2
	}
}

# 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
	
#	trigger = {
#		tag = SOV
#		NOT = { has_completed_focus = SOV_great_purge }
#		focus_progress = {
#			focus = SOV_great_purge
#			progress > 0.75
#		}
#	}

	is_triggered_only = yes

#	mean_time_to_happen = {
#		days = 1
#	}

	option = {
		ai_chance = {
			factor = 50
		}
		name = soviet.27.a
		set_country_flag = purge_2_group_a
		custom_effect_tooltip = remove_political_advisor
		show_ideas_tooltip = SOV_nikolai_yezhov
		custom_effect_tooltip = remove_chief_of_airforce
		show_ideas_tooltip = yakov_smushkevich
		show_ideas_tooltip = pavel_rychagov
		show_ideas_tooltip = alexander_novikov
		custom_effect_tooltip = remove_military_high_command
		show_ideas_tooltip = gordey_levchenko
		remove_unit_leader = 406 #gordey_levchenko, naval commander
		custom_effect_tooltip = soviet.27_tt
		hidden_effect = {
			remove_ideas = SOV_nikolai_yezhov
			remove_ideas = yakov_smushkevich
			remove_ideas = pavel_rychagov
			remove_ideas = alexander_novikov
			remove_ideas = gordey_levchenko
		}
	}
	option = {
		ai_chance = {
			factor = 45
		}
		name = soviet.27.b
		set_country_flag = purge_2_group_b
		custom_effect_tooltip = remove_chief_of_navy
		show_ideas_tooltip = nikolay_kuznetsov
		custom_effect_tooltip = remove_chief_of_airforce
		show_ideas_tooltip = konstantin_vershinin
		custom_effect_tooltip = remove_military_high_command
		show_ideas_tooltip = sergei_khudyakov
		show_ideas_tooltip = aleksandr_vasilevsky
		remove_unit_leader = 407 #aleksandr_vasilevsky, general
		custom_effect_tooltip = soviet.27_tt
		hidden_effect = {
			remove_ideas = nikolay_kuznetsov
			remove_ideas = konstantin_vershinin
			remove_ideas = sergei_khudyakov
			remove_ideas = aleksandr_vasilevsky
		}
	}
	option = {
		ai_chance = {
			factor = 5
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
		name = soviet.27.c
		set_country_flag = purge_2_no_purge
		custom_effect_tooltip = soviet.27_tt2
	}
}


# 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
	}

	mean_time_to_happen = {
		days = 9000
		#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 = trotskyite_plot_purged }
			remove_ideas = trotskyite_plot_purged
		}
		if = {
			limit = { has_idea = trotskyite_plot }
			remove_ideas = trotskyite_plot
		}
		kill_country_leader = yes
		create_country_leader = {
			name = "Leon Trotsky"
			desc = "POLITICS_LEON_TROTSKY_DESC"
			picture = "Portrait_Leon_Trotsky.dds"
			expire = "1965.1.1"
			ideology = leninism
			traits = {
				permanent_revolutionary
			}
		}
		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 // Mormont joins
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 New Ibben
country_event = {
	id = soviet.30
	title = soviet.30.t
	desc = soviet.30.d
	picture = GFX_report_event_stalin_propaganda

#	is_triggered_only = yes

	fire_only_once = yes
	
	trigger = {
		original_tag = SOV
		FROM = { tag = BLR }
		NOT = { has_global_flag = newibben_demand }
		592 = {
			is_claimed_by = SOV
			is_owned_by = BLR
		}
		637 = {
			is_claimed_by = SOV
			is_owned_by = BLR
		}
	}

	mean_time_to_happen = {
		days = 13
	}
	
	immediate = { set_global_flag = newibben_demand } 
		
	option = {
		name = soviet.30.a
		BLR = { country_event = { days = 2 id = romania.1 } }
	}
	option = {
		name = soviet.30.b
		ai_chance = { factor = 5 }
	}
}

# 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
		
#	option = {
#		name = soviet.31.a
#		FIN = { country_event = { days = 2 id = finland.1 } }
#	}
#	option = {
#		name = soviet.31.b
#		ai_chance = { factor = 0 }
#	}
#}

# Dotraki accept
#country_event = {
#	id = soviet.32
#	title = soviet.32.t
#	desc = soviet.32.d
#	picture = GFX_report_event_soviet_in_riga

#	is_triggered_only = yes
	
#	immediate = { set_country_flag = estonia_demand } 
		
#	option = {
#		name = soviet.32.a
#		if = {
#			limit = { is_in_faction = yes }
#			add_to_faction = From

#		}

#		if = {
#			limit = { is_in_faction = no }
#			create_faction = "Targaryen Alliance"
#			add_to_faction = From

#		}
#	}
#}

# Dothraki Refuse
#country_event = {
#	id = soviet.33
#	title = soviet.33.t
#	desc = soviet.33.d
#	picture = GFX_report_event_soviet_in_riga

#	is_triggered_only = yes
		
#	option = {
#		name = soviet.33.a
#		create_wargoal = {
#			type = puppet_wargoal_focus
#			target = From
#		}
#	}
#	option = {
#		name = soviet.33.b
#		ai_chance = { factor = 0 }
#		#
#	}
#}

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

#	is_triggered_only = yes
	
	trigger = {
		tag = SOV
		SOV = { any_owned_state = { is_coastal = yes } }
		SOV = { has_government = communism }
#		FROM = {
#			tag = LIT
#			any_owned_state = { is_claimed_by = SOV }
#		}
		NOT = { has_country_flag = selmyis_here }
		ENG = { has_country_flag = selmyis_gone }
	}

	mean_time_to_happen = {
		days = 30
	}

	fire_only_once = yes
	
	immediate = { set_country_flag = selmyis_here } 
		
	option = {
		name = soviet.34.a

#		recruit_character = TAR_barristan

		BOS = {
			TAR_barristan = {
				set_nationality = SOV
			}
		}

#		LIT = { country_event = { days = 2 id = baltic.3 } }
#		create_corps_commander = {
#			name = "Barristan Selmy"
#			picture = "Portrait_Ser_Barristan.dds"
#			traits = { old_guard panzer_leader fortress_buster war_hero }
#			skill = 4
#			id = 407
#		}
		ai_chance = { factor = 99 }

		hidden_effect = {
			promote_character = TAR_barristan
#			create_country_leader = {
#				name = "Barristan Selmy"
#				desc = "POLITICS_BARRISTAN_SELMY_DESC"
#	
#				picture = "Portrait_Ser_Barristan.dds"
#				ideology = liberalism
#				traits = {
#					#
#				}
#			}
		}
	}
	option = {
		name = soviet.34.b
		ai_chance = { factor = 0 }
		#
	}
}

# 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

	option = {
		name = soviet.35.a
		ai_chance = { factor = 100 }

		effect_tooltip = {
			if = {
				limit = { FROM = { tag = LIT } }
			 	SOV = {
			 		annex_country = {
					target = LIT
					transfer_troops = yes } 
					add_named_threat = { threat = 2 name = soviet.35_threat_LIT }
				}
			}
			if = {
				limit = { FROM = { tag = EST } } 
			 	SOV = { 
			 		annex_country = {
					target = EST
					transfer_troops = yes } 
					add_named_threat = { threat = 2 name = soviet.35_threat_EST }
				}
			}
			if = {
				limit = { FROM = { tag = LAT } } 
			 	SOV = {
			 		annex_country = {
					target = LAT
					transfer_troops = yes } 
					add_named_threat = { threat = 2 name = soviet.35_threat_LAT }
				}
			}
		} 

		hidden_effect = {

			 FROM = {
			 	country_event = { id = baltic.6 hours = 6}
			 }			
		}
	}
	option = {
		name = soviet.35.b
		ai_chance = { factor = 0 }
	}
}

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

	is_triggered_only = yes

	option = {
		name = soviet.36.a
		ai_chance = { factor = 100 }

#		effect_tooltip = {
#			if = {
#				limit = { FROM = { tag = POR } }
			 	SOV = {
			 		annex_country = {
					target = POR
					transfer_troops = yes } 
					add_named_threat = { threat = 5 name = soviet.35_threat_POR }
					every_state = {
						limit = {
							is_core_of = POR
							is_controlled_by = ROOT
						}
						add_core_of = SOV
#						set_compliance = 50
					}
				}
#			}
#		} 

#		hidden_effect = {
#
#			ECU = {
#				country_event = { id = baltic.6 hours = 6}
#			}			
#		}
	}

#	option = {
#		name = soviet.36.b
#		if = {
#			limit = {
#				FROM = { is_puppet = no }
#			}
#			SOV = { puppet = FROM }
#		}
#		ai_chance = { factor = 20 }
#			if = {
#				limit = { FROM = { tag = POR } }
#				add_named_threat = { threat = 1 name = soviet.35_threat_POR }
#			}	
#			if = {
#				limit = { FROM = { tag = ECU } }
#				add_named_threat = { threat = 2 name = soviet.35_threat_FIN }
#			}			
#			if = {
#				limit = { FROM = { tag = EGY } }
#				add_named_threat = { threat = 1 name = soviet.35_threat_EST }
#			}			
#			if = {
#				limit = { FROM = { tag = LBA } }
#				add_named_threat = { threat = 1 name = soviet.35_threat_LAT }
#			}		
#
		#trigger news event
#		hidden_effect = {
#			ECU = {
#				country_event = { id = baltic.6 hours = 6}
#			}
#			news_event =  { id = news.70 days = 1}
#		}		
#	}

	option = {
		name = soviet.36.c
		ai_chance = { factor = 0 }
	}
}

# 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    // Stallion who will mount the world
country_event = {
	id = soviet.40
	title = soviet.40.t
	desc = soviet.40.d
	picture = GFX_report_event_soldiers_marching

	is_triggered_only = yes

	option = {
		name = soviet.40.a
		add_political_power = 200
		activate_mission = TAR_dany_pregnant
#		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 // Dragon captured
country_event = {
	id = soviet.48
	title = soviet.48.t
	desc = soviet.48.d
	picture = GFX_report_event_soviet_purge_politicians

	is_triggered_only = yes

#	trigger = {
#		has_government = communism
#		tag = SOV
#		has_global_flag = SOV_fourth_international_fired
#		SOV = { has_country_leader = { ruling_only = yes name = "Daenerys Targaryen" } }
#		OR = {
#			SOV = { has_war_with = EGY }
#			SOV = { has_war_with = IRQ }
#			SOV = { has_war_with = PER }
#		}
#	}

	mean_time_to_happen = {
		days = 9
	}

	fire_only_once = yes

	#Don't invite trotsky
	option = {
		name = soviet.48.a
		custom_effect_tooltip = soviet.48.a_tt
		set_country_flag = SOV_soviet.48_notrotsky
	}

	#Invite back Trotsky
	option = {
		name = soviet.48.b
		custom_effect_tooltip = soviet.48.b_tt
		set_country_flag = SOV_soviet.48_trotsky
	}

}

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

	trigger = {
		tag = SOV
		has_country_flag = SOV_soviet.48_notrotsky
	}
	
	fire_only_once = yes

	mean_time_to_happen = { days = 10 }

	option = {
		name = soviet.49.a
		start_civil_war = {
			ideology = neutrality
			size = 0.5
			keep_unit_leaders = { 401 402 407 410 406 405 403 407 408 410 411 404 }
		}
		hidden_effect = {
			remove_unit_leader = 412 #Remove Andrey Vlasov
			random_other_country = {
				limit = {
					original_tag = SOV
					has_government = neutrality
				}
				kill_country_leader = yes
				create_country_leader = {
					name = "Andrey Vlasov"
					desc = "POLITICS_ANDREY_VLASOV_DESC"
					picture = "Portrait_Soviet_Andrey_Vlasov.dds"
					expire = "1965.1.1"
					ideology = moderatism
					traits = {
					}
				}
			}
			news_event = { hours = 3 id = news.220 }
		}
	}
}

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

	fire_only_once = yes

	trigger = {
		tag = SOV
		has_country_flag = SOV_purged_1
	}

	mean_time_to_happen = { days = 90 }

	option = {
		name = soviet.50.a
		remove_unit_leader = 412 #Remove Andrey Vlasov
		start_civil_war = {
			ideology = neutrality
			size = 0.3
			keep_unit_leaders = { 401 402 407 410 406 405 403 407 408 410 411 404 }
		}
		hidden_effect = {
			random_other_country = {
				limit = {
					original_tag = SOV
					has_government = neutrality
				}
				kill_country_leader = yes
				create_country_leader = {
					name = "Andrey Vlasov"
					desc = "POLITICS_ANDREY_VLASOV_DESC"
					picture = "Portrait_Soviet_Andrey_Vlasov.dds"
					expire = "1965.1.1"
					ideology = moderatism
					traits = {
					}
				}
			}
			news_event = { hours = 3 id = news.220 }
		}
	}
}

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

	fire_only_once = yes
	
	trigger = {
		tag = SOV
		has_country_flag = SOV_purged_2
	}

	mean_time_to_happen = { days = 90 }

	option = {
		name = soviet.51.a
		remove_unit_leader = 412 #Remove Andrey Vlasov
		start_civil_war = {
			ideology = neutrality
			size = 0.25
			keep_unit_leaders = { 401 402 407 410 406 405 403 407 408 410 411 404 }
		}
		hidden_effect = {
			random_other_country = {
				limit = {
					original_tag = SOV
					has_government = neutrality
				}
				kill_country_leader = yes
				create_country_leader = {
					name = "Andrey Vlasov"
					desc = "POLITICS_ANDREY_VLASOV_DESC"
					picture = "Portrait_Soviet_Andrey_Vlasov.dds"
					expire = "1965.1.1"
					ideology = moderatism
					traits = {
					}
				}
			}
			news_event = { hours = 3 id = news.220 }
		}
	}
}

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

	fire_only_once = yes

	trigger = {
		tag = SOV
		has_country_flag = SOV_purged_3
	}

	mean_time_to_happen = { days = 90 }

	option = {
		name = soviet.52.a
		remove_unit_leader = 412 #Remove Andrey Vlasov
		start_civil_war = {
			ideology = neutrality
			size = 0.2
			keep_unit_leaders = { 401 402 407 410 406 405 403 407 408 410 411 404 }
		}
		hidden_effect = {
			random_other_country = {
				limit = {
					original_tag = SOV
					has_government = neutrality
				}
				kill_country_leader = yes
				create_country_leader = {
					name = "Andrey Vlasov"
					desc = "POLITICS_ANDREY_VLASOV_DESC"
					picture = "Portrait_Soviet_Andrey_Vlasov.dds"
					expire = "1965.1.1"
					ideology = moderatism
					traits = {
					}
				}
			}
			news_event = { hours = 3 id = news.220 }
		}
	}

}

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

	fire_only_once = yes

	trigger = {
		tag = SOV
		has_country_flag = SOV_purged_4
	}

	mean_time_to_happen = { days = 2 }

	option = {
		name = soviet.53.a
		remove_ideas = trotskyite_plot_purged
	}

}


#Khal Drogo injured
country_event = {
	id = soviet.54
	title = soviet.54.t
	desc = {
		text = soviet.54.d_nopurge
		trigger = {
			NOT = {
				has_government = communism
			}
		}
	}
	desc = {
		text = soviet.54.d_purge
		trigger = {
			has_government = communism
		}
	}
	picture = GFX_report_event_soviet_purge_speech

	fire_only_once = yes

	trigger = {
		tag = SOV
		SOV = { has_offensive_war = yes }
		SOV = { has_completed_focus = TAR_stallion_world } 
		SOV = { has_country_leader = { ruling_only = yes name = "Khal Drogo" } }
		NOT = {
			has_government = communism
		}
		has_civil_war = no
	}

	mean_time_to_happen = {
		days = 2
	}

	immediate = { set_global_flag = khal_drogo_poisoned }

	option = {
		name = soviet.54.a
		activate_mission = TAR_drogo_is_dying
#		if = {
#			limit = {
#				has_idea = trotskyite_plot
#			}
#			remove_ideas = trotskyite_plot
#		}
	}
}


# Khal Drogo Dies
country_event = {
	id = soviet.60
	title = soviet.60.t
	desc = soviet.60.d
	picture = GFX_report_event_soviet_tanks

	is_triggered_only = yes
	
#	fire_only_once = yes

#	trigger = {
#		tag = SOV
#		has_global_flag = khal_drogo_poisoned
#		has_government = fascism
#		NOT = { has_war_with = LEB }
#		SOV = { has_war = no }
#	}
	
#	mean_time_to_happen = {
#		days = 25
#	}
	
	option = {
		ai_chance = {
			base = 60
		}
		name = soviet.60.a
		kill_ideology_leader = fascism
#		kill_country_leader = yes
		remove_unit_leader = 401 #drogo, field marshal
		add_ideas = TAR_depression
		if = {
			limit = { has_idea = dothraki_bloodriders }
			remove_ideas = dothraki_bloodriders
		}
		set_global_flag = drogo_dead
		hidden_effect = {
			if = {
				limit = { has_war_with = LEB }
				white_peace = LEB
			}

			SOV = {	country_event = { id = soviet.18 days = 5 } }
		}
	}
}

# 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
		}
	}
}


