###########################
# NSB Soviet Events
###########################

add_namespace = NSB_soviet_paranoia_system_events
add_namespace = NSB_soviet_propaganda_capmaign_events
add_namespace = NSB_soviet_foreign_politics_events
add_namespace = NSB_soviet_academy_of_sciences
add_namespace = NSB_soviet_atomic_bomb_project
add_namespace = NSB_soviet_five_year_plan
add_namespace = NSB_soviet_great_patriotic_war
add_namespace = NSB_soviet_soviet_german_trade_agreement
add_namespace = NSB_soviet_policies_of_collective_security
add_namespace = NSB_soviet_comecon
add_namespace = NSB_soviet_spanish_civil_war
add_namespace = NSB_soviet_planned_economy
add_namespace = NSB_Soviet_fascist_civil_war
add_namespace = NSB_soviet_communist_civil_war
add_namespace = NSB_soviet_permanent_revolution
add_namespace = NSB_soviet_for_the_common_good
add_namespace = NSB_soviet_civil_war_common
add_namespace = NSB_soviet_fascist_tsarist
add_namespace = NSB_soviet_nationalist


#########################
### INTRO TO PARANOIA ###
#########################

### PARANOIA SYSTEM STARTS ###
country_event = {
	id = NSB_soviet_paranoia_system_events.01
	title = NSB_soviet_paranoia_system_events.01.t
	desc = NSB_soviet_paranoia_system_events.01.desc
	picture = GFX_report_event_stalin_01
	
	is_triggered_only = yes

	fire_only_once = yes

	immediate = {
		hidden_effect = {
			if = {
				limit = {
					NOT = {
						has_global_flag = sov_old_focus_tree
					}
				}
				SOV_initiate_paranoia_effect = yes
			}
		}
	}

	trigger = {
		NOT = { has_completed_focus = SOV_the_bloc_of_rights_and_trotskyites }
	}

	option = { #GOOD TO KNOW, THANKS
		trigger = {
			NOT = {
				has_global_flag = sov_old_focus_tree
			}
		}
		name = NSB_soviet_paranoia_system_events.01.a
		
		custom_effect_tooltip = SOV_paranoia_system_intro_tt
		unlock_decision_category_tooltip = SOV_paranoia_system

		#Stalin gets paranoid
		effect_tooltip = {
			add_country_leader_trait = stalin_political_paranoia
		}

		#NKVD chiefs will make Political Paranoia worse
		custom_effect_tooltip = SOV_paranoia_system_nkvd_trait_tt
	}
	option = { #NOT RELAVENT TO ME
		trigger = {
			has_global_flag = sov_old_focus_tree
		}
		name = SOV_oh_no_purge
	}
}

####################
### ADMIN PURGES ###
####################

### ADVISOR ACCUSED OF TREASON - ADMIN ###
country_event = {
	id = NSB_soviet_paranoia_system_events.11
	title = NSB_soviet_paranoia_system_events.11.t
	desc = NSB_soviet_paranoia_system_events.11.desc
	picture = GFX_report_event_soviet_purge_trial
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_regular = yes
		}
	}

	option = { #PURGE MODE ON
		name = NSB_soviet_paranoia_system_events.11.a
		ai_chance = {
			base = 10
		}
		hidden_effect = {
			every_character = {
				limit = {
					is_character_slot = political_advisor
					has_character_flag = SOV_targeted_for_purge_flag
				}
				SOV_purge_character_effect = yes
			}
		}

		custom_effect_tooltip = SOV_characters_will_be_purged_tt
		character_list_tooltip = {
			limit = {
				has_character_flag = SOV_targeted_for_purge_flag
			}
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#PARANOIA decreases
		SOV_paranoia_high_decrease_effect = yes

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}

		clear_variable = SOV_purged_character_for_loc
	}

	option = { #PURGE MODE OFF
		name = NSB_soviet_paranoia_system_events.11.b
		ai_chance = {
			base = 1
			#modifier = { #Don't purge historically-not-purged people on historical # SOV_historically_not_purged_flag not implemented for now -> Adds more randomness
			#	factor = 100
			#	SOV_is_going_historical_stalinist = yes
			#	any_character = {
			#		has_character_flag = SOV_targeted_for_purge_flag
			#		has_character_flag = SOV_historically_not_purged_flag
			#	}
			#}
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_regular_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_regular }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_regular_pay

		#PARANOIA increases
		SOV_paranoia_low_increase_effect = yes

		#CLEAN EVERYTHING THANKS
		SOV_clean_purge_targets_effect = yes
		clear_variable = SOV_purged_character_for_loc
	}
}

### CIVIL SERVANTS PURGED - ADMIN ###
country_event = {
	id = NSB_soviet_paranoia_system_events.12
	title = NSB_soviet_paranoia_system_events.12.t
	desc = NSB_soviet_paranoia_system_events.12.desc
	picture = GFX_report_event_SOV_purge_administration
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_regular = yes
		}
	}

	option = {
		name = NSB_soviet_paranoia_system_events.12.a
		ai_chance = {
			base = 10
		}

		add_timed_idea = {
			idea = SOV_understaffed_bureaucracy
			days = 365
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#PARANOIA decreases
		SOV_paranoia_medium_decrease_effect = yes

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}
	}

	option = {
		name = NSB_soviet_paranoia_system_events.12.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_regular_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}

		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_regular }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_regular_pay

		#PARANOIA increases
		SOV_paranoia_low_increase_effect = yes
	}
}

### NKVD PURGED - ADMIN ###
country_event = {
	id = NSB_soviet_paranoia_system_events.13
	title = NSB_soviet_paranoia_system_events.13.t
	desc = NSB_soviet_paranoia_system_events.13.desc
	picture = GFX_report_event_soviet_purge_trial

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_regular = yes
		}
	}

	option = {
		name = NSB_soviet_paranoia_system_events.13.a
		ai_chance = {
			base = 10
		}

		if = {
			limit = {
				has_idea = SOV_genrikh_yagoda
			}
			hidden_effect = {
				SOV_genrikh_yagoda = {
					SOV_purge_character_effect = yes
				}
			}

			custom_effect_tooltip = SOV_characters_will_be_purged_tt
			character_list_tooltip = {
				limit = {
					is_character = SOV_genrikh_yagoda
				}
			}

			activate_advisor = SOV_nikolay_yezhov
		}
		else_if = {
			limit = {
				has_idea = SOV_nikolay_yezhov
			}
			hidden_effect = {
				SOV_nikolay_yezhov = {
					SOV_purge_character_effect = yes
				}
			}
			custom_effect_tooltip = SOV_characters_will_be_purged_tt
			character_list_tooltip = {
				limit = {
					is_character = SOV_nikolay_yezhov
				}
			}

			activate_advisor = SOV_lavrenty_beriya
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#PARANOIA decreases
		SOV_paranoia_high_decrease_effect = yes

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}
	}

	option = {
		name = NSB_soviet_paranoia_system_events.13.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_regular_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_regular }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_regular_pay

		#PARANOIA increases
		SOV_paranoia_low_increase_effect = yes
	}
}

### GREAT PURGE - MOSCOW TRIALS - ADMIN ###
country_event = {
	id = NSB_soviet_paranoia_system_events.19
	title = NSB_soviet_paranoia_system_events.19.t
	desc = {
		text = NSB_soviet_paranoia_system_events.19.desc_1 #first Moscow trial 
		trigger = {
			has_country_flag = SOV_purge_event_unavoidable_flag
			check_variable = { SOV_moscow_trial_index < 2 }
		}
	}
	desc = {
		text = NSB_soviet_paranoia_system_events.19.desc_2 #second Moscow trial 
		trigger = {
			has_country_flag = SOV_purge_event_unavoidable_flag
			check_variable = { SOV_moscow_trial_index > 1 } 
			check_variable = { SOV_moscow_trial_index < 3 } 
		}
	}
	desc = {
		text = NSB_soviet_paranoia_system_events.19.desc_3 #last Moscow trial 
		trigger = {
			has_country_flag = SOV_purge_event_unavoidable_flag
			check_variable = { SOV_moscow_trial_index > 2 }
		}
	}
	desc = {
		text = NSB_soviet_paranoia_system_events.19.desc_4 #Generic Purge
		trigger = { NOT = { has_country_flag = SOV_purge_event_unavoidable_flag } }
	}

	picture = GFX_report_event_SOV_purge_administration
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_great = yes
		}
	}

	option = { #PURGE MODE ON
		name = NSB_soviet_paranoia_system_events.19.a
		ai_chance = {
			base = 10
		}

		hidden_effect = {
			every_character = {
				limit = {
					is_character_slot = political_advisor
					has_character_flag = SOV_targeted_for_purge_flag
				}
				SOV_purge_character_effect = yes
				
			}
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		custom_effect_tooltip = SOV_characters_will_be_purged_tt
		character_list_tooltip = {
			limit = {
				has_character_flag = SOV_targeted_for_purge_flag
			}
		}

		#PARANOIA decreases
		SOV_paranoia_very_high_decrease_effect = yes

		#Increase moscow trial index by 1 for next event title
		add_to_variable = { SOV_moscow_trial_index = 1 }

		if = {
			limit = {
				has_country_flag = SOV_purge_event_unavoidable_flag
			}
			custom_effect_tooltip = SOV_purge_event_unavoidable_purge_great_tt
		}
		else_if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_great
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_great_tt
		}

		#Clear flags forbidding the "avoid purge" option from showing up
		SOV_clear_unavoidable_purge_flags_effect = yes
	}

	option = { #PURGE MODE OFF
		name = NSB_soviet_paranoia_system_events.19.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_great_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_great }
			NOT = { has_country_flag = SOV_purge_event_unavoidable_flag } #Used for historical purges triggered via focus
		}

		add_political_power = SOV_purge_event_pp_to_avoid_great_pay

		#PARANOIA increases
		SOV_paranoia_very_high_increase_effect = yes

		#CLEAN EVERYTHING THANKS
		SOV_clean_purge_targets_effect = yes

		#Increase moscow trial index by 1 for next event title
		add_to_variable = { SOV_moscow_trial_index = 1 }
	}
}

###################
### ARMY PURGES ###
###################

### GENERAL ACCUSED OF TREASON - ARMY ###
unit_leader_event = {
	id = NSB_soviet_paranoia_system_events.21
	title = NSB_soviet_paranoia_system_events.21.t
	desc = NSB_soviet_paranoia_system_events.21.desc
	picture = GFX_report_event_soviet_purge_officers_02
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_regular = yes
		}
	}

	option = { #PURGE
		name = NSB_soviet_paranoia_system_events.21.a
		ai_chance = {
			base = 10
		}

		hidden_effect = {
			random_army_leader = {
				limit = {
					has_character_flag = SOV_targeted_for_purge_flag
				}
				SOV_purge_character_effect = yes
			}
		}
		#custom_effect_tooltip = SOV_retire_purged_character_tt

		custom_effect_tooltip = SOV_characters_will_be_purged_tt
		character_list_tooltip = {
			limit = {
				has_character_flag = SOV_targeted_for_purge_flag
			}
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#RANDOM GENERALS COWED
		SOV_paranoia_daunt_generals_minor_effect = yes

		#PARANOIA DECREASES based on general's level
		set_variable = { SOV_unit_leader_level = SOV_accused_unit_leader_level } #Set the appropriate var used in the scripted effect
		SOV_paranoia_decrease_based_on_unit_leader_level_effect = yes
		custom_effect_tooltip = NSB_soviet_paranoia_system_events.24_paranoia_accused_decrease_tt

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}
		# Increase opposition Army Support 
		SOV_increase_opposition_army_support_small = yes 
		clear_variable = SOV_purged_character_for_loc
	}

	option = { #NO WAIT! Let's Think about it
		name = NSB_soviet_paranoia_system_events.21.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_regular_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_regular }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_regular_pay

		SOV_paranoia_increase_based_on_unit_leader_level_effect = yes

		#PARANOIA INCREASES
		set_variable = { SOV_unit_leader_level = SOV_accused_unit_leader_level } #Set the appropriate var used in the scripted effect
		SOV_paranoia_increase_based_on_unit_leader_level_effect = yes
		custom_effect_tooltip = NSB_soviet_paranoia_system_events.24_paranoia_accused_increase_tt

		#CLEAN EVERYTHING THANKS
		SOV_clean_purge_targets_effect = yes
		clear_variable = SOV_purged_character_for_loc
	}
}

### CONSPIRACY IN THE ACADEMY - ARMY ###
country_event = {
	id = NSB_soviet_paranoia_system_events.22
	title = NSB_soviet_paranoia_system_events.22.t
	desc = NSB_soviet_paranoia_system_events.22.desc
	picture = GFX_report_event_SOV_purge_administration
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_regular = yes
		}
	}

	option = { #PURGE
		name = NSB_soviet_paranoia_system_events.22.a
		ai_chance = {
			base = 10
		}

		add_ideas = SOV_anti_soviet_military_thinking_banned_army

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#PARANOIA decreases
		SOV_paranoia_low_decrease_effect = yes

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}
		# Increase opposition Army Support 
		SOV_increase_opposition_army_support_small = yes 
	}

	option = { #NO WAIT! Let's Think about it
		name = NSB_soviet_paranoia_system_events.22.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_regular_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_regular }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_regular_pay

		#PARANOIA increases
		SOV_paranoia_low_increase_effect = yes
	}
}

### ANTI-SABOTEUR CAMPAIGN - ARMY ###
country_event = {
	id = NSB_soviet_paranoia_system_events.23
	title = NSB_soviet_paranoia_system_events.23.t
	desc = NSB_soviet_paranoia_system_events.23.desc
	picture = GFX_report_event_soviet_soldiers_tank
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_regular = yes
		}
	}

	option = { #PURGE
		name = NSB_soviet_paranoia_system_events.23.a
		ai_chance = {
			base = 10
		}

		add_timed_idea = {
			idea = SOV_training_activities_curtailed
			days = 365
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#PARANOIA decreases
		SOV_paranoia_low_decrease_effect = yes

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}
		# Increase opposition Army Support 
		SOV_increase_opposition_army_support_small = yes 
	}

	option = { #NO WAIT! Let's Think about it
		name = NSB_soviet_paranoia_system_events.23.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_regular_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_regular }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_regular_pay

		#PARANOIA increases
		SOV_paranoia_low_increase_effect = yes
	}
}

### GENERAL ACCUSES GENERAL - ARMY ###
unit_leader_event = {
	id = NSB_soviet_paranoia_system_events.24
	title = NSB_soviet_paranoia_system_events.24.t
	desc = NSB_soviet_paranoia_system_events.24.desc
	picture = GFX_report_event_soviet_purge_officers_02
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_regular = yes
		}
	}

	option = { #PURGE ACCUSED
		name = NSB_soviet_paranoia_system_events.24.a
		ai_chance = {
			base = 10
		}

		hidden_effect = {
			random_army_leader = {
				limit = {
					has_character_flag = SOV_purge_accused_flag
				}
				SOV_purge_character_effect = yes
			}
		}
		#custom_effect_tooltip = SOV_retire_accused_character_tt
		custom_effect_tooltip = SOV_characters_will_be_purged_tt
		character_list_tooltip = {
			limit = {
				has_character_flag = SOV_purge_accused_flag
			}
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#RANDOM GENERALS COWED
		SOV_paranoia_daunt_generals_minor_effect = yes
		
		#PARANOIA decreases based on general's level
		set_variable = { SOV_unit_leader_level = SOV_accused_unit_leader_level } #Set the appropriate var used in the scripted effect
		SOV_paranoia_decrease_based_on_unit_leader_level_effect = yes
		custom_effect_tooltip = NSB_soviet_paranoia_system_events.24_paranoia_accused_decrease_tt

		#CLEAN EVERYTHING THANKS
		hidden_effect = {
			clear_variable = SOV_accused_unit_leader_level
			clear_variable = SOV_accuser_unit_leader_level
			clear_variable = SOV_accused_character_for_loc
			clear_variable = SOV_accuser_character_for_loc
			every_army_leader = {
				limit = {
					has_character_flag = SOV_purge_accuser_flag
				}
				clr_character_flag = SOV_purge_accuser_flag
			}
		}

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}
		# Increase opposition Army Support 
		SOV_increase_opposition_army_support_small = yes 
	}

	option = { #PURGE ACCUSER 
		name = NSB_soviet_paranoia_system_events.24.b
		ai_chance = {
			base = 5
			modifier = {
				factor = 2
				SOV_is_going_historical_stalinist = no
			}
		}

		hidden_effect = {
			random_army_leader = {
				limit = {
					has_character_flag = SOV_purge_accuser_flag
				}
				SOV_purge_character_effect = yes
			}
		}
		#custom_effect_tooltip = SOV_retire_accuser_character_tt
		custom_effect_tooltip = SOV_characters_will_be_purged_tt
		character_list_tooltip = {
			limit = {
				has_character_flag = SOV_purge_accuser_flag
			}
		}

		#RANDOM GENERALS COWED
		SOV_paranoia_daunt_generals_minor_effect = yes

		#PARANOIA decreases based on general's level
		set_variable = { SOV_unit_leader_level = SOV_accuser_unit_leader_level } #Set the appropriate var used in the scripted effect and clean vars and flags
		SOV_paranoia_decrease_based_on_unit_leader_level_effect = yes
		custom_effect_tooltip = NSB_soviet_paranoia_system_events.24_paranoia_accused_decrease_tt

		#CLEAN EVERYTHING THANKS
		hidden_effect = {
			clear_variable = SOV_accused_unit_leader_level
			clear_variable = SOV_accuser_unit_leader_level
			clear_variable = SOV_accused_character_for_loc
			clear_variable = SOV_accuser_character_for_loc
			every_army_leader = {
				limit = {
					has_character_flag = SOV_purge_accused_flag
				}
				clr_character_flag = SOV_purge_accused_flag
			}
		}

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}
		# Increase opposition Army Support 
		SOV_increase_opposition_army_support_small = yes 
	}

	option = { #NO WAIT! Let's Think about it
		name = NSB_soviet_paranoia_system_events.24.c
		ai_chance = {
			base = 2
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_regular_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_regular }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_regular_pay

		every_army_leader = { #Both characters get cowed
			limit = {
				OR = {
					has_character_flag = SOV_purge_accuser_flag
					has_character_flag = SOV_purge_accused_flag
				}
			}
			add_unit_leader_trait = trait_SOV_cowed_by_stalin_army
		}

		#PARANOIA INCREASES
		set_variable = { SOV_unit_leader_level = SOV_accused_unit_leader_level } #Set the appropriate var used in the scripted effect and clean vars and flags
		add_to_variable = { SOV_unit_leader_level = SOV_accuser_unit_leader_level }
		SOV_paranoia_increase_based_on_unit_leader_level_effect = yes
		custom_effect_tooltip = NSB_soviet_paranoia_system_events.24_paranoia_both_increase_tt

		#CLEAN EVERYTHING THANKS
		hidden_effect = {
			clear_variable = SOV_accused_unit_leader_level
			clear_variable = SOV_accuser_unit_leader_level
			clear_variable = SOV_accused_character_for_loc
			clear_variable = SOV_accuser_character_for_loc
			random_army_leader = {
				limit = {
					has_character_flag = SOV_purge_accused_flag
				}
				clr_character_flag = SOV_purge_accused_flag
			}
			random_army_leader = {
				limit = {
					has_character_flag = SOV_purge_accuser_flag
				}
				clr_character_flag = SOV_purge_accuser_flag
			}
		}
	}
}

### GREAT PURGE OF JUNIOR ARMY OFFICERS - ARMY ###
country_event = {
	id = NSB_soviet_paranoia_system_events.28
	title = NSB_soviet_paranoia_system_events.28.t
	desc = NSB_soviet_paranoia_system_events.28.desc
	picture = GFX_report_event_SOV_purge_young_officers
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_great = yes
		}
	}

	option = { #PURGE THEM!!
		name = NSB_soviet_paranoia_system_events.28.a
		ai_chance = {
			base = 10
		}

		if = {
			limit = {
				has_idea = SOV_purged_junior_army_officers_3
			}
			#NOTHING HAPPENS, but this should not be a possibility
			log = "I CAN'T MAKE THIS WORSE FOR GODS SAKE!"
		}
		else_if = {
			limit = {
				has_idea = SOV_purged_junior_army_officers_2
			}
			swap_ideas = {
				remove_idea = SOV_purged_junior_army_officers_2
				add_idea = SOV_purged_junior_army_officers_3
			}
		}
		else_if = {
			limit = {
				has_idea = SOV_purged_junior_army_officers_1
			}
			swap_ideas = {
				remove_idea = SOV_purged_junior_army_officers_1
				add_idea = SOV_purged_junior_army_officers_2
			}
		}
		else = {
			add_ideas = SOV_purged_junior_army_officers_1
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}
		
		#PARANOIA decreases
		SOV_paranoia_medium_decrease_effect = yes

		if = {
			limit = {
				has_country_flag = SOV_purge_event_unavoidable_flag
			}
			custom_effect_tooltip = SOV_purge_event_unavoidable_purge_great_tt
		}
		else_if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_great
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_great_tt
		}

		#Clear flags forbidding the "avoid purge" option from showing up
		SOV_clear_unavoidable_purge_flags_effect = yes

		# Increase opposition Army Support 
		SOV_increase_opposition_army_support_small = yes 
	}

	option = { #NO WAIT! Let's Think about it
		name = NSB_soviet_paranoia_system_events.28.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_great_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_great }
			NOT = { has_country_flag = SOV_purge_event_unavoidable_flag } #Used for historical purges triggered via focus
		}

		add_political_power = SOV_purge_event_pp_to_avoid_great_pay

		#PARANOIA INCREASES
		SOV_paranoia_high_increase_effect = yes
	}
}

### GREAT PURGE TRIAL OF THE GENERALS - ARMY ###
country_event = {
	id = NSB_soviet_paranoia_system_events.29
	title = NSB_soviet_paranoia_system_events.29.t
	desc = NSB_soviet_paranoia_system_events.29.desc
	picture = GFX_report_event_soviet_purge_officers_01
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_great = yes
		}
	}

	option = { #PURGE THEM!!
		name = NSB_soviet_paranoia_system_events.29.a
		ai_chance = {
			base = 10
		}

		hidden_effect = {
			#Purge any Advisors
			every_character = {
				limit = {
					has_army_ledger = yes
					has_character_flag = SOV_targeted_for_purge_flag
				}
				SOV_purge_character_effect = yes	
				log = "Hey I am [THIS.GetName] I am in the Event!"
			}

			#Purge any Marshals/Generals #This is a duplicate as a workaround for tooltip purposes
			every_army_leader = {
				limit = {
					OR = {
						is_field_marshal = yes
						is_corps_commander = yes
					}
					has_character_flag = SOV_targeted_for_purge_flag
				}
				SOV_purge_character_effect = yes	
				log = "Hey I am [THIS.GetName] I am in the Event!"
			}
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		custom_effect_tooltip = SOV_characters_will_be_purged_tt
		character_list_tooltip = {
			limit = {
				has_character_flag = SOV_targeted_for_purge_flag
			}
		}

		#RANDOM GENERALS COWED
		SOV_paranoia_daunt_generals_effect = yes

		#PARANOIA decreases
		SOV_paranoia_very_high_decrease_effect = yes

		if = {
			limit = {
				has_country_flag = SOV_purge_event_unavoidable_flag
			}
			custom_effect_tooltip = SOV_purge_event_unavoidable_purge_great_tt
		}
		else_if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_great
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_great_tt
		}

		#Clear flags forbidding the "avoid purge" option from showing up
		SOV_clear_unavoidable_purge_flags_effect = yes

		# Increase opposition Army Support 
		SOV_increase_opposition_army_support_small = yes  
	}

	option = { #NO WAIT! Let's Think about it
		name = NSB_soviet_paranoia_system_events.29.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_great_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_great }
			NOT = { has_country_flag = SOV_purge_event_unavoidable_flag } #Used for historical purges triggered via focus
		}

		add_political_power = SOV_purge_event_pp_to_avoid_great_pay

		#PARANOIA INCREASES
		SOV_paranoia_very_high_increase_effect = yes

		#CLEAN EVERYTHING THANKS
		SOV_clean_purge_targets_effect = yes
	}
}

###################
### NAVY PURGES ###
###################

### ADMIRAL ACCUSED OF TREASON - NAVY ###
unit_leader_event = {
	id = NSB_soviet_paranoia_system_events.31
	title = NSB_soviet_paranoia_system_events.31.t
	desc = NSB_soviet_paranoia_system_events.31.desc
	picture = GFX_report_event_soviet_purge_trial
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_regular = yes
		}
	}

	option = { #PURGE
		name = NSB_soviet_paranoia_system_events.31.a
		ai_chance = {
			base = 10
		}

		hidden_effect = {
			random_navy_leader = {
				limit = {
					has_character_flag = SOV_targeted_for_purge_flag
				}
				SOV_purge_character_effect = yes
			}
		}
		#custom_effect_tooltip = SOV_retire_purged_character_tt
		custom_effect_tooltip = SOV_characters_will_be_purged_tt
		character_list_tooltip = {
			limit = {
				has_character_flag = SOV_targeted_for_purge_flag
			}
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#RANDOM ADMIRALS COWED
		SOV_paranoia_daunt_admirals_minor_effect = yes

		#PARANOIA DECREASES based on general's level
		set_variable = { SOV_unit_leader_level = SOV_accused_unit_leader_level } #Set the appropriate var used in the scripted effect
		SOV_paranoia_decrease_based_on_unit_leader_level_effect = yes
		custom_effect_tooltip = NSB_soviet_paranoia_system_events.24_paranoia_accused_decrease_tt

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}

		# Increase opposition Navy Support 
		SOV_increase_opposition_navy_support_small = yes
		clear_variable = SOV_purged_character_for_loc 
	}

	option = { #NO WAIT! Let's Think about it
		name = NSB_soviet_paranoia_system_events.21.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_regular_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_regular }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_regular_pay

		#PARANOIA INCREASES
		set_variable = { SOV_unit_leader_level = SOV_accused_unit_leader_level } #Set the appropriate var used in the scripted effect
		SOV_paranoia_increase_based_on_unit_leader_level_effect = yes
		custom_effect_tooltip = NSB_soviet_paranoia_system_events.24_paranoia_accused_increase_tt

		#CLEAN EVERYTHING THANKS
		SOV_clean_purge_targets_effect = yes
		clear_variable = SOV_purged_character_for_loc
	}
}

### CONSPIRACY IN THE ACADEMY - NAVY ###
#Loc taken from the Army event
country_event = {
	id = NSB_soviet_paranoia_system_events.32
	title = NSB_soviet_paranoia_system_events.22.t
	desc = NSB_soviet_paranoia_system_events.22.desc
	picture = GFX_report_event_SOV_purge_administration
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_regular = yes
		}
	}

	option = { #PURGE
		name = NSB_soviet_paranoia_system_events.22.a
		ai_chance = {
			base = 10
		}

		add_ideas = SOV_anti_soviet_military_thinking_banned_navy

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#PARANOIA decreases
		SOV_paranoia_medium_decrease_effect = yes

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}

		# Increase opposition Navy Support 
		SOV_increase_opposition_navy_support_small = yes  	
	}

	option = { #NO WAIT! Let's Think about it
		name = NSB_soviet_paranoia_system_events.22.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_regular_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_regular }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_regular_pay

		#PARANOIA increases
		SOV_paranoia_low_increase_effect = yes

		#CLEAN EVERYTHING THANKS
		SOV_clean_purge_targets_effect = yes
	}
}

### ANTI-SABOTEUR CAMPAIGN - NAVY ###
country_event = {
	id = NSB_soviet_paranoia_system_events.33
	title = NSB_soviet_paranoia_system_events.23.t
	desc = NSB_soviet_paranoia_system_events.33.desc
	picture = GFX_report_event_SOV_purge_navy
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_regular = yes
		}
	}

	option = { #PURGE
		name = NSB_soviet_paranoia_system_events.23.a
		ai_chance = {
			base = 10
		}

		add_timed_idea = {
			idea = SOV_shipyard_staff_purged
			days = 365
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#PARANOIA decreases
		SOV_paranoia_medium_decrease_effect = yes

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}

		# Increase opposition Navy Support 
		SOV_increase_opposition_navy_support_small = yes  
	}

	option = { #NO WAIT! Let's Think about it
		name = NSB_soviet_paranoia_system_events.23.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_regular_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_regular }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_regular_pay

		#PARANOIA increases
		SOV_paranoia_low_increase_effect = yes

		#CLEAN EVERYTHING THANKS
		SOV_clean_purge_targets_effect = yes
	}
}

### GREAT PURGE - JUNIOR NAVY OFFICERS - NAVY ###
country_event = {
	id = NSB_soviet_paranoia_system_events.38
	title = NSB_soviet_paranoia_system_events.38.t
	desc = NSB_soviet_paranoia_system_events.38.desc
	picture = GFX_report_event_SOV_purge_young_officers
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_great = yes
		}
	}

	option = { #PURGE
		name = NSB_soviet_paranoia_system_events.28.a
		ai_chance = {
			base = 10
		}

		if = {
			limit = {
				has_idea = SOV_purged_junior_navy_officers_3
			}
			# NOTHING HAPPENS, but this should not be a possibility
			log = "I CAN'T MAKE THIS WORSE FOR GODS SAKE!"
		}
		else_if = {
			limit = {
				has_idea = SOV_purged_junior_navy_officers_2
			}
			swap_ideas = {
				remove_idea = SOV_purged_junior_navy_officers_2
				add_idea = SOV_purged_junior_navy_officers_3
			}
		}
		else_if = {
			limit = {
				has_idea = SOV_purged_junior_navy_officers_1
			}
			swap_ideas = {
				remove_idea = SOV_purged_junior_navy_officers_1
				add_idea = SOV_purged_junior_navy_officers_2
			}
		}
		else = {
			add_ideas = SOV_purged_junior_navy_officers_1
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#PARANOIA decreases
		SOV_paranoia_low_decrease_effect = yes

		if = {
			limit = {
				has_country_flag = SOV_purge_event_unavoidable_flag
			}
			custom_effect_tooltip = SOV_purge_event_unavoidable_purge_great_tt
		}
		else_if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_great
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_great_tt
		}

		#Clear flags forbidding the "avoid purge" option from showing up
		SOV_clear_unavoidable_purge_flags_effect = yes	

		# Increase opposition Navy Support 
		SOV_increase_opposition_navy_support_small = yes  
	}

	option = { #NO WAIT! Let's Think about it
		name = NSB_soviet_paranoia_system_events.28.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_great_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_great }
			NOT = { has_country_flag = SOV_purge_event_unavoidable_flag } #Used for historical purges triggered via focus
		}

		add_political_power = SOV_purge_event_pp_to_avoid_great_pay

		#PARANOIA increases
		SOV_paranoia_high_increase_effect = yes
	}
}

### GREAT PURGE - TRIAL OF THE ADMIRALS - NAVY ###
country_event = {
	id = NSB_soviet_paranoia_system_events.39
	title = NSB_soviet_paranoia_system_events.39.t
	desc = NSB_soviet_paranoia_system_events.39.desc
	picture = GFX_report_event_SOV_purge_navy
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_great = yes
		}
	}

	option = { #PURGE
		name = NSB_soviet_paranoia_system_events.29.a
		ai_chance = {
			base = 10
		}

		hidden_effect = {
			#Purge any Advisors
			every_character = {
				limit = {
					has_navy_ledger = yes
					has_character_flag = SOV_targeted_for_purge_flag
				}
				SOV_purge_character_effect = yes	
			}

			#Purge any Admirals # This is a duplicate as a workaround for tooltip purposes
			every_navy_leader = {
				limit = {
					has_character_flag = SOV_targeted_for_purge_flag
				}
				SOV_purge_character_effect = yes	
			}
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		custom_effect_tooltip = SOV_characters_will_be_purged_tt
		character_list_tooltip = {
			limit = {
				has_character_flag = SOV_targeted_for_purge_flag
			}
		}

		#RANDOM ADMIRALS COWED
		SOV_paranoia_daunt_admirals_effect = yes

		#PARANOIA decreases
		SOV_paranoia_very_high_decrease_effect = yes

		if = {
			limit = {
				has_country_flag = SOV_purge_event_unavoidable_flag
			}
			custom_effect_tooltip = SOV_purge_event_unavoidable_purge_great_tt
		}
		else_if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_great
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_great_tt
		}

		#Clear flags forbidding the "avoid purge" option from showing up
		SOV_clear_unavoidable_purge_flags_effect = yes

		# Increase opposition Navy Support 
		SOV_increase_opposition_navy_support_small = yes  
	}

	option = { #NO WAIT! Let's Think about it
		name = NSB_soviet_paranoia_system_events.29.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_great_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_great }
			NOT = { has_country_flag = SOV_purge_event_unavoidable_flag } #Used for historical purges triggered via focus
		}

		add_political_power = SOV_purge_event_pp_to_avoid_great_pay

		#PARANOIA increases
		SOV_paranoia_very_high_increase_effect = yes

		#CLEAN EVERYTHING THANKS
		SOV_clean_purge_targets_effect = yes
	}
}


#######################
### AIRFORCE PURGES ###
#######################

### CONSPIRACY IN THE ACADEMY - AIRFORCE ###
country_event = {
	id = NSB_soviet_paranoia_system_events.41
	title = NSB_soviet_paranoia_system_events.22.t
	desc = NSB_soviet_paranoia_system_events.22.desc
	picture = GFX_report_event_SOV_purge_administration
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_regular = yes
		}
	}

	option = {
		name = NSB_soviet_paranoia_system_events.22.a
		ai_chance = {
			base = 10
		}

		add_ideas = SOV_anti_soviet_military_thinking_banned_airforce

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#PARANOIA decreases
		SOV_paranoia_medium_decrease_effect = yes

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}
	}

	option = {
		name = NSB_soviet_paranoia_system_events.22.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_regular_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_regular }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_regular_pay

		#PARANOIA increases
		SOV_paranoia_low_increase_effect = yes
	}
}

#### ANTI-SABOTEUR CAMPAIGN - AIRFORCE ###
country_event = {
	id = NSB_soviet_paranoia_system_events.42
	title = NSB_soviet_paranoia_system_events.23.t
	desc = NSB_soviet_paranoia_system_events.42.desc
	picture = GFX_report_event_SOV_purge_aircraft_2
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_regular = yes
		}
	}

	option = {
		name = NSB_soviet_paranoia_system_events.23.a
		ai_chance = {
			base = 10
		}

		add_timed_idea = {
			idea = SOV_ground_based_training
			days = 365
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#PARANOIA decreases
		SOV_paranoia_medium_decrease_effect = yes

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_regular
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_regular_tt
		}	
	}

	option = {
		name = NSB_soviet_paranoia_system_events.23.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_regular_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_regular }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_regular_pay

		#PARANOIA increases
		SOV_paranoia_low_increase_effect = yes
	}
}

### GREAT PURGE - DESIGN BUREAU DISSOLVED - AIRFORCE ###
country_event = {
	id = NSB_soviet_paranoia_system_events.48
	title = NSB_soviet_paranoia_system_events.48.t
	desc = NSB_soviet_paranoia_system_events.48.desc
	picture = GFX_report_event_SOV_purge_aircraft_1
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV_paranoia_increase_purge_counter_great = yes
		}
	}

	option = {
		name = NSB_soviet_paranoia_system_events.48.a
		ai_chance = {
			base = 10
		}

		if = {
			limit = { # MIG
				check_variable = {
					var = SOV_random_bureau_to_dissolve
					value = 0.75
					compare = greater_than_or_equals 
				}
			}
			remove_ideas = SOV_mig_design_bureau
			set_country_flag = SOV_mig_design_bureau_dissolved_flag
			unlock_decision_tooltip = SOV_reinstate_mig_design_bureau
		}
		else_if = {
			limit = { # ILYUSHIN
				check_variable = {
					var = SOV_random_bureau_to_dissolve
					value = 0.5
					compare = greater_than_or_equals 
				}
			}
			remove_ideas = SOV_ilyushin_design_bureau
			set_country_flag = SOV_ilyushin_design_bureau_dissolved_flag
			unlock_decision_tooltip = SOV_reinstate_ilyushin_design_bureau
		}
		else_if = {
			limit = { # TUPOLEV
				check_variable = {
					var = SOV_random_bureau_to_dissolve
					value = 0.25
					compare = greater_than_or_equals 
				}
			}
			remove_ideas = SOV_tupolev_design_bureau
			set_country_flag = SOV_tupolev_design_bureau_dissolved_flag
			unlock_decision_tooltip = SOV_reinstate_tupolev_design_bureau
		}
		else= { #YAKOVLEV
			remove_ideas = SOV_yakovlev_design_bureau
			set_country_flag = SOV_yakovlev_design_bureau_dissolved_flag
			unlock_decision_tooltip = SOV_reinstate_yakovlev_design_bureau
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		#PARANOIA decreases
		SOV_paranoia_very_high_decrease_effect = yes

		if = {
			limit = {
				has_country_flag = SOV_purge_event_unavoidable_flag
			}
			custom_effect_tooltip = SOV_purge_event_unavoidable_purge_great_tt
		}
		else_if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_great
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_great_tt
		}
		
		#Clear flags forbidding the "avoid purge" option from showing up
		SOV_clear_unavoidable_purge_flags_effect = yes
	}

	option = {
		name = NSB_soviet_paranoia_system_events.48.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_great_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_great }
			NOT = { has_country_flag = SOV_purge_event_unavoidable_flag } #Used for historical purges triggered via focus
		}

		add_political_power = SOV_purge_event_pp_to_avoid_great_pay

		#PARANOIA increases
		SOV_paranoia_very_high_increase_effect = yes
	}
}

### GREAT PURGE - AIRFORCE CHIEFS - AIRFORCE ###
country_event = {
	id = NSB_soviet_paranoia_system_events.49
	title = NSB_soviet_paranoia_system_events.49.t
	desc = NSB_soviet_paranoia_system_events.49.desc
	picture = GFX_report_event_soviet_purge_trial
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			if = {
				limit = {
					NOT = { has_country_flag = SOV_purged_airforce_chiefs_flag }
				}
				set_country_flag = SOV_purged_airforce_chiefs_flag
			}		
			SOV_paranoia_increase_purge_counter_great = yes
		}
	}

	option = { #PURGE MODE ON
		name = NSB_soviet_paranoia_system_events.49.a
		ai_chance = {
			base = 10
		}

		hidden_effect = {
			every_character = {
				limit = {
					has_character_flag = SOV_targeted_for_purge_flag
					has_air_ledger = yes
				}
				SOV_purge_character_effect = yes
			}
		}

		#Update purged portraits in UI
		hidden_effect = {
			SOV_paranoia_update_portraits_ui = yes
		}

		custom_effect_tooltip = SOV_characters_will_be_purged_tt
		character_list_tooltip = {
			limit = {
				has_character_flag = SOV_targeted_for_purge_flag
			}
		}

		#PARANOIA decreases
		SOV_paranoia_high_decrease_effect = yes

		if = {
			limit = {
				has_political_power < SOV_purge_event_pp_to_avoid_great
			}
			custom_effect_tooltip = SOV_purge_event_not_enough_pp_to_avoid_great_tt
		}
	}

	option = { #PURGE MODE OFF
		name = NSB_soviet_paranoia_system_events.49.b
		ai_chance = {
			base = 1
			modifier = { #Don't go to negative PP please
				factor = 0
				has_political_power < SOV_purge_event_pp_to_avoid_great_pay
			}
			modifier = { #Don't risk starting CW too early
				factor = 0
				SOV_is_opposition = yes 
			}
		}

		trigger = {
			NOT = { has_political_power < SOV_purge_event_pp_to_avoid_great }
		}

		add_political_power = SOV_purge_event_pp_to_avoid_great_pay

		#PARANOIA increases
		SOV_paranoia_low_increase_effect = yes

		#CLEAN EVERYTHING THANKS
		SOV_clean_purge_targets_effect = yes
	}
}



########  ########   #######  ########     ###     ######      ###    ##    ## ########     ###    
##     ## ##     ## ##     ## ##     ##   ## ##   ##    ##    ## ##   ###   ## ##     ##   ## ##   
##     ## ##     ## ##     ## ##     ##  ##   ##  ##         ##   ##  ####  ## ##     ##  ##   ##  
########  ########  ##     ## ########  ##     ## ##   #### ##     ## ## ## ## ##     ## ##     ## 
##        ##   ##   ##     ## ##        ######### ##    ##  ######### ##  #### ##     ## ######### 
##        ##    ##  ##     ## ##        ##     ## ##    ##  ##     ## ##   ### ##     ## ##     ## 
##        ##     ##  #######  ##        ##     ##  ######   ##     ## ##    ## ########  ##     ## 


#Propaganda Dispatcher - Left Slot - Used to update Campaign GFX when it's old.
country_event = {
	id = NSB_soviet_propaganda_capmaign_events.101
	title = NSB_soviet_propaganda_capmaign_events.101.t
	desc = NSB_soviet_propaganda_capmaign_events.101.desc
	
	is_triggered_only = yes

	trigger = {
		check_variable = { SOV_propaganda_left_poster_to_age = SOV_poster_left_icon_frame } #So that this does not happen if a propaganda is cancelled, breaking everything
	}

	hidden = yes

	immediate = {
		set_country_flag = SOV_propaganda_left_slot_is_old_flag
		#log = "I AM HERE: LEFT FRAME IS [?SOV_poster_left_icon_frame] // POSTER TO AGE IS [?SOV_propaganda_left_poster_to_age]" #Debug
	}
}

#Propaganda Dispatcher - Center Slot - Used to update Campaign GFX when it's old.
country_event = {
	id = NSB_soviet_propaganda_capmaign_events.102
	title = NSB_soviet_propaganda_capmaign_events.102.t
	desc = NSB_soviet_propaganda_capmaign_events.102.desc
	
	is_triggered_only = yes

	trigger = {
		check_variable = { SOV_propaganda_center_poster_to_age = SOV_poster_center_icon_frame } #So that this does not happen if a propaganda is cancelled, breaking everything
	}

	hidden = yes

	immediate = {
		set_country_flag = SOV_propaganda_center_slot_is_old_flag
		#log = "I AM HERE: CENTER FRAME IS [?SOV_poster_center_icon_frame] // POSTER TO AGE IS [?SOV_propaganda_center_poster_to_age]" #Debug
	}
}

#Propaganda Dispatcher - Right Slot - Used to update Campaign GFX when it's old.
country_event = {
	id = NSB_soviet_propaganda_capmaign_events.103
	title = NSB_soviet_propaganda_capmaign_events.103.t
	desc = NSB_soviet_propaganda_capmaign_events.103.desc
	
	is_triggered_only = yes

	trigger = {
		check_variable = { SOV_propaganda_right_poster_to_age = SOV_poster_right_icon_frame } #So that this does not happen if a propaganda is cancelled, breaking everything
	}

	hidden = yes

	immediate = {
		set_country_flag = SOV_propaganda_right_slot_is_old_flag
		#log = "I AM HERE: RIGHT FRAME IS [?SOV_poster_right_icon_frame] // POSTER TO AGE IS [?SOV_propaganda_right_poster_to_age]" #Debug
	}
}

# YOUNG BUILDERS OF COMMUNISM - event for SOV's puppets
country_event = {
	id = NSB_soviet_propaganda_capmaign_events.1
	title = NSB_soviet_propaganda_capmaign_events.1.t
	desc = NSB_soviet_propaganda_capmaign_events.1.desc
	picture = GFX_report_event_SOV_young_builders_of_communism
	
	is_triggered_only = yes

	option = { #OK
		name = NSB_soviet_propaganda_capmaign_events.1.a

		add_timed_idea = {
			idea = SOV_young_builders_of_communism
			days = SOV.SOV_default_propaganda_campaign_duration
		}
	}
}

# LONG LIVE TO PEACE - event for SOV (peace broken as attacker)
country_event = {
	id = NSB_soviet_propaganda_capmaign_events.2
	title = NSB_soviet_propaganda_capmaign_events.2.t
	desc = NSB_soviet_propaganda_capmaign_events.2.desc
	picture = GFX_report_event_SOV_young_builders_of_communism
	
	is_triggered_only = yes

	fire_only_once = yes

	immediate = {
		hidden_effect = {
			set_country_flag = SOV_punished_for_breaking_flag
			add_timed_idea = {
				idea = SOV_broken_peace_dreams_attacker
				days = 180
			}
			#RESET PROPAGANDA CAMPAIGN
			set_rule = { can_send_volunteers = yes }
			clr_country_flag = SOV_propaganda_peace_active_flag
			set_variable = { SOV_propaganda_campaign_to_remove = 25 }
			SOV_reset_propaganda_campaign_slot_effect = yes
		}
	}

	option = { #OK
		name = NSB_soviet_propaganda_capmaign_events.2.a

		effect_tooltip = {
			add_timed_idea = {
				idea = SOV_broken_peace_dreams_attacker
				days = 180
			}
		}
	}
}

# LONG LIVE TO PEACE - event for SOV (peace broken as defender)
country_event = {
	id = NSB_soviet_propaganda_capmaign_events.3
	title = NSB_soviet_propaganda_capmaign_events.2.t
	desc = NSB_soviet_propaganda_capmaign_events.3.desc
	picture = GFX_report_event_SOV_young_builders_of_communism

	is_triggered_only = yes

	fire_only_once = yes

	immediate = {
		hidden_effect = {
			set_country_flag = SOV_punished_for_breaking_flag
			add_timed_idea = {
				idea = SOV_broken_peace_dreams_defender
				days = 180
			}
			#RESET PROPAGANDA CAMPAIGN
			set_rule = { can_send_volunteers = yes }
			clr_country_flag = SOV_propaganda_peace_active_flag
			set_variable = { SOV_propaganda_campaign_to_remove = 25 }
			SOV_reset_propaganda_campaign_slot_effect = yes
		}
	}

	option = { #OK
		name = NSB_soviet_propaganda_capmaign_events.3.a

		effect_tooltip = {
			add_timed_idea = {
				idea = SOV_broken_peace_dreams_defender
				days = 180
			}
		}
	}
}


########  #######  ########  ######## ####  ######   ##    ##    ########   #######  ##       #### ######## ####  ######   ######  
##       ##     ## ##     ## ##        ##  ##    ##  ###   ##    ##     ## ##     ## ##        ##     ##     ##  ##    ## ##    ## 
##       ##     ## ##     ## ##        ##  ##        ####  ##    ##     ## ##     ## ##        ##     ##     ##  ##       ##       
######   ##     ## ########  ######    ##  ##   #### ## ## ##    ########  ##     ## ##        ##     ##     ##  ##        ######  
##       ##     ## ##   ##   ##        ##  ##    ##  ##  ####    ##        ##     ## ##        ##     ##     ##  ##             ## 
##       ##     ## ##    ##  ##        ##  ##    ##  ##   ###    ##        ##     ## ##        ##     ##     ##  ##    ## ##    ## 
##        #######  ##     ## ######## ####  ######   ##    ##    ##         #######  ######## ####    ##    ####  ######   ######  

# SOV is pressuring our government - Event for Targeted country ### (ITA uses this too)
country_event = {
	id = NSB_soviet_foreign_politics_events.1
	title = NSB_soviet_foreign_politics_events.1.t
	desc = NSB_soviet_foreign_politics_events.1.desc
	picture = "[GetPressureGovernmentGFX]"

	is_triggered_only = yes

	#immediate = { #Debug
	#	log = "FROM is [FROM.GetName]"
	#	log = "FROM.FROM [FROM.FROM.GetName]"
	#	log = "FROM.PREV [FROM.PREV.GetName]"
	#	log = "FROM.FROM.PREV [FROM.FROM.PREV.GetName]"
	#	log = "ROOT.FROM [ROOT.FROM.GetName]"
	#	log = "ROOT.PREV [ROOT.PREV.GetName]"
	#}

	option = { #Join Faction - Keep government
		name = NSB_soviet_foreign_politics_events.1.a

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				strength_ratio = {
					tag = FROM
					ratio < 0.5
				}
			}
			modifier = {
				factor = 4
				strength_ratio = {
					tag = FROM
					ratio < 0.2
				}
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > 75
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 2
				OR = {
					FROM = {
						original_tag = SOV
						has_idea = SOV_maksim_litvinov
					}
					FROM = { ITA_has_foreign_affairs_or_nice_guy_hired = yes }
				}
			}
			modifier = {
				factor = 0
				OR = {
					is_in_faction = yes
					is_subject = yes
				}
			}
		}

		trigger = {
			NOT = { is_in_faction_with = FROM }
		}

		FROM = { add_to_faction = ROOT }
		add_opinion_modifier = {
			target = FROM
			modifier = SOV_pressured_our_government
		}
		hidden_effect = {
			country_event = { id = NSB_soviet_foreign_politics_events.151 hours = 1 }
		}
	}

	option = { #Change Government
		name = NSB_soviet_foreign_politics_events.1.b

		ai_chance = {
			base = 10
			modifier = {
				factor = 5
				OR = {
					FROM = {
						has_government = communism
						communism > 0.5
					}
					FROM = {
						has_government = democratic
						democratic > 0.5
					}
					FROM = {
						has_government = fascism
						fascism > 0.5
					}
					FROM = {
						has_government = neutrality
						neutrality > 0.5
					}
				}
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > 75
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 2
				OR = {	
					FROM = {
						original_tag = SOV
						has_idea = SOV_vyacheslav_molotov
					}
					FROM = { ITA_has_foreign_affairs_or_nice_guy_hired = yes }
				}
			}
			modifier = {
				factor = 0
				OR = {
					is_in_faction = yes
					is_subject = yes
				}
			}
		}

		trigger = {
			NOT = { has_government = FROM }
		}

		set_politics = { ruling_party = FROM }
		add_opinion_modifier = {
			target = FROM
			modifier = SOV_pressured_our_government
		}
		hidden_effect = {
			country_event = { id = NSB_soviet_foreign_politics_events.158 hours = 1 }
		}
	}

	option = { #REFUSE
		name = NSB_soviet_foreign_politics_events.1.c

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				any_country = {
					is_major = yes
					has_guaranteed = ROOT
				}
			}
			modifier = {
				factor = 1.2
				any_country = {
					is_major = no
					has_guaranteed = ROOT
				}
			}
		}

		add_popularity = {
			ideology = FROM
			popularity = 0.05
		}
		add_opinion_modifier = {
			target = FROM
			modifier = SOV_pressured_our_government
		}
		hidden_effect = {
			FROM = { country_event = { id = NSB_soviet_foreign_politics_events.152 hours = 1 } }
		}
	}
}

# SOV is promoting ideology rallies - Event for Targeted country ### (ITA uses this too)
country_event = {
	id = NSB_soviet_foreign_politics_events.2
	title = NSB_soviet_foreign_politics_events.2.t
	desc = NSB_soviet_foreign_politics_events.2.desc
	picture = "[GetPromotingIdeologyGFX]"

	is_triggered_only = yes

	immediate = {
		log = "FROM is [FROM.GetName]"
		log = "FROM.FROM [FROM.FROM.GetName]"
		log = "FROM.PREV [FROM.PREV.GetName]"
		log = "FROM.FROM.PREV [FROM.FROM.PREV.GetName]"
		log = "ROOT.FROM [ROOT.FROM.GetName]"
		log = "ROOT.PREV [ROOT.PREV.GetName]"
	}

	option = { #OK
		name = NSB_soviet_foreign_politics_events.2.a

		ai_chance = {
			base = 1
			modifier = {
				factor = 2
				strength_ratio = {
					tag = FROM
					ratio < 0.5
				}
			}
			modifier = {
				factor = 5
				strength_ratio = {
					tag = FROM
					ratio < 0.2
				}
			}
			modifier = {
				factor = 1.5
				has_opinion = {
					target = FROM
					value > 75
				}
			}
			modifier = {
				factor = 0
				OR = {
					is_in_faction = yes
					is_subject = yes
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 2
				OR = {
					FROM = {
						original_tag = SOV
						has_idea = SOV_maksim_litvinov
					}
					FROM = { ITA_has_foreign_affairs_or_nice_guy_hired = yes }
				}
			}
		}

		hidden_effect = { #Country is slightly more willing to cooperate with Soviets
			if = {
				limit = {
					FROM = {
						original_tag = SOV
					}
				}
				add_ai_strategy = {
					type = befriend
					id = SOV			
					value = 10
				}
				add_ai_strategy = {
					type = alliance
					id = SOV			
					value = 10
				}
			}
			else_if = {
				limit = {
					FROM = {
						original_tag = ITA
					}
				}
				add_ai_strategy = {
					type = befriend
					id = ITA			
					value = 10
				}
				add_ai_strategy = {
					type = alliance
					id = ITA			
					value = 10
				}
			}
		}

		add_popularity = {
			ideology = FROM
			popularity = 0.1
		}
		add_opinion_modifier = {
			target = FROM
			modifier = SOV_stirring_the_masses
		}
	}

	option = { #Prevent it!
		name = NSB_soviet_foreign_politics_events.2.b

		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				has_political_power < 70
			}
		}

		trigger = {
			NOT = { has_government = FROM }
		}

		add_political_power = -70
		add_stability = -0.05
		add_popularity = {
			ideology = ROOT
			popularity = 0.1
		}
		add_opinion_modifier = {
			target = FROM
			modifier = SOV_stirring_the_masses
		}
	}
}


# SOV is investing in developing our country - Event for minor Asian allies
country_event = {
	id = NSB_soviet_foreign_politics_events.10
	title = NSB_soviet_foreign_politics_events.10.t
	desc = NSB_soviet_foreign_politics_events.10.desc
	picture = GFX_report_event_china_ledo_road

	is_triggered_only = yes
			
	option = { #Ok
		name = NSB_soviet_foreign_politics_events.10.a
	
		ai_chance = { base = 1 }

		#CAPITAL
		capital_scope = {
			if = {
				limit = {
					infrastructure < 4
				}
				add_building_construction = {
					type = infrastructure
					level = 2
					instant_build = yes
				}
			}
			else_if = {
				limit = {
					infrastructure < 5
				}
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
			if = {
				limit = {
					free_building_slots = {
						building = industrial_complex
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = industrial_complex
					level = 2
					instant_build = yes
				}
			}
			else_if = {
				limit = {
					free_building_slots = {
						building = industrial_complex
						size > 0
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}		
		}

		#ADDITIONAL RANDOM STATE
		if = {
			limit = {
				any_owned_state = {
					is_capital = no
				}
			}
			random_owned_state = {
				limit = {
					is_capital = no
				}
				if = {
					limit = {
						infrastructure < 5
					}
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes
					}
				}
				if = {
					limit = {
						free_building_slots = {
							building = industrial_complex
							size > 0
							include_locked = yes
						}
					}
					add_extra_state_shared_building_slots = 1
					add_building_construction = {
						type = industrial_complex
						level = 1
						instant_build = yes
					}
				}		
			}
		}
	}

	option = { #Refuse
		name = NSB_soviet_foreign_politics_events.10.b

		ai_chance = { base = 0 }

		FROM = {
			add_opinion_modifier = {
				target = ROOT
				modifier = SOV_refused_to_follow_our_guidelines
			}
		}
		FROM = { country_event = { id = NSB_soviet_foreign_politics_events.13 hours = 8 random_hours = 4 } }
	}
}

# SOV wants us to follow war measures - Event for minor Asian allies
country_event = {
	id = NSB_soviet_foreign_politics_events.11
	title = NSB_soviet_foreign_politics_events.11.t
	desc = NSB_soviet_foreign_politics_events.11.desc
	picture = GFX_report_event_SOV_mongolia_cavalry

	is_triggered_only = yes
			
	option = { #Ok
		name = NSB_soviet_foreign_politics_events.11.a
	
		ai_chance = { base = 1 }

		add_timed_idea = { idea = SOV_war_measures_allies days = 1095 }
	}

	option = { #Refuse
		name = NSB_soviet_foreign_politics_events.11.b
		
		ai_chance = { base = 0 }
		
		FROM = {
			add_opinion_modifier = {
				target = ROOT
				modifier = SOV_refused_to_follow_our_guidelines
			}
		}
		FROM = { country_event = { id = NSB_soviet_foreign_politics_events.13 hours = 8 random_hours = 4 } }
	}
}

# SOV wants to fortify our border with JAP - Event for MON
country_event = {
	id = NSB_soviet_foreign_politics_events.12
	title = NSB_soviet_foreign_politics_events.12.t
	desc = NSB_soviet_foreign_politics_events.12.desc
	picture = GFX_report_event_SOV_mongolia_fortify_border

	is_triggered_only = yes
			
	option = { #Ok
		name = NSB_soviet_foreign_politics_events.12.a

		ai_chance = { base = 1 }
	
		SOV_fortify_mongolian_border_effect = yes
	}

	option = { #Refuse
		name = NSB_soviet_foreign_politics_events.12.b
		
		ai_chance = { base = 0 }
		
		FROM = {
			add_opinion_modifier = {
				target = ROOT
				modifier = SOV_refused_to_follow_our_guidelines
			}
		}
		FROM = { country_event = { id = NSB_soviet_foreign_politics_events.13 hours = 8 random_hours = 4 } }
	}
}

# Our ally rejects our guidelines - Event for SOV (when any of the three events above are refused by a PLAYER)
country_event = {
	id = NSB_soviet_foreign_politics_events.13
	title = NSB_soviet_foreign_politics_events.13.t
	desc = NSB_soviet_foreign_politics_events.13.desc
	picture = GFX_report_event_stalin_meeting

	is_triggered_only = yes
			
	option = { #Refuse
		name = NSB_soviet_foreign_politics_events.13.a
				
		effect_tooltip = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_refused_to_follow_our_guidelines
			}
		}
	}
}

# SOV sends military advisors - Event for SPR
country_event = {
	id = NSB_soviet_foreign_politics_events.20
	title = NSB_soviet_foreign_politics_events.20.t
	desc = NSB_soviet_foreign_politics_events.20.desc
	picture = GFX_report_event_spr_spanish_civil_war

	is_triggered_only = yes
			
	option = { #Ok
		name = NSB_soviet_foreign_politics_events.20.a
		
		add_timed_idea = {idea = SOV_soviet_advisors_spr days = 1095 }
		effect_tooltip = {
			FROM = {
				add_timed_idea = {idea = SOV_military_advisors_in_spain days = 1095 }
			}
		}
	}
}

# SOV demands Alaska - Event for USA (or Alaska's owner)
country_event = {
	id = NSB_soviet_foreign_politics_events.30
	title = NSB_soviet_foreign_politics_events.30.t
	desc = NSB_soviet_foreign_politics_events.30.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_pressured_our_government
			}
		}
	}
			
	option = { #Accept
		name = NSB_soviet_foreign_politics_events.30.a
		
		ai_chance = {
			base = 1
			modifier = {
				factor = 10
				NOT = { is_in_faction_with = FROM }
				strength_ratio = {
					tag = FROM
					ratio < 0.6
				}
			}
			modifier = {
				factor = 5
				NOT = { is_in_faction_with = FROM }
				alliance_strength_ratio < 0.6
			}
			modifier = {
				factor = 100
				is_subject_of = FROM
			}
			modifier = {
				factor = 10
				is_in_faction_with = FROM
				has_opinion = {
					target = FROM
					value > 75
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.2
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 0.8
				SOV = { has_idea = SOV_vyacheslav_molotov }
			}
			modifier = {
				factor = 0.5
				NOT = { is_in_faction_with = FROM }
				strength_ratio = {
					tag = FROM
					ratio > 0.8
				}
			}
			modifier = {
				factor = 0
				NOT = { is_in_faction_with = FROM }
				strength_ratio = {
					tag = FROM
					ratio > 1
				}
			}
		}

		FROM = {
			effect_tooltip = {
				if = {
					limit = {
						ROOT = { controls_state = 463 }
					}
					transfer_state = 463 #ALASKA
				}
				if = {
					limit = {
						ROOT = { controls_state = 650 }
					}
					transfer_state = 650 #ATTU ISLAND
				}
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_complied_with_our_demands
				}
			}
			hidden_effect = {
				country_event = NSB_soviet_foreign_politics_events.31
			}
		}	
	}

	option = { #Refuse
		name = NSB_soviet_foreign_politics_events.30.b
		
		ai_chance = {
			base = 10
		}

		FROM = {
			effect_tooltip = {
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_rejected_our_demands
				}
				create_wargoal = {
					type = puppet_wargoal_focus
					target = ROOT
				}
			}
			hidden_effect = {
				country_event = NSB_soviet_foreign_politics_events.32
			}
		}
	}
}

# USA cedes Alaska - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.31
	title = NSB_soviet_foreign_politics_events.31.t
	desc = NSB_soviet_foreign_politics_events.31.desc
	picture = GFX_report_event_generic_usa_treaty

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_complied_with_our_demands
			}
		}
	}

	option = { #Ok
		name = NSB_soviet_foreign_politics_events.31.a
		
		if = {
			limit = {
				FROM = { controls_state = 463 }
			}
			transfer_state = 463 #ALASKA
		}
		if = {
			limit = {
				FROM = { controls_state = 650 }
			}
			transfer_state = 650 #ATTU ISLAND
		}
		
		effect_tooltip = {
			FROM = {
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_pressured_our_government
				}
			}
		}
	}
}

# USA refuses to cede Alaska - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.32
	title = NSB_soviet_foreign_politics_events.32.t
	desc = NSB_soviet_foreign_politics_events.32.desc
	picture = GFX_report_event_generic_usa_treaty

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_rejected_our_demands
			}
		}
	}

	option = { #WAAAAAGH!
		name = NSB_soviet_foreign_politics_events.32.a

		ai_chance = {
			base = 10
			modifier = {
				factor = 5
				strength_ratio = {
					tag = FROM
					ratio > 1
				}
			}
			modifier = {
				factor = 2
				has_war = yes
				alliance_strength_ratio > 0.8
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.2
				SOV = { has_idea = SOV_vyacheslav_molotov }
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 0.8
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = {
				factor = 0.5
				is_in_faction_with = FROM
				has_opinion = {
					target = FROM
					value > 75
				}
			}
			modifier = {
				factor = 0.5
				strength_ratio = {
					tag = FROM
					ratio < 0.8
				}
			}
			modifier = {
				factor = 0
				is_in_faction_with = FROM
			}
		}
		
		create_wargoal = {
			type = puppet_wargoal_focus
			target = FROM
		}
	}

	option = { #Leave it be
		name = NSB_soviet_foreign_politics_events.32.b

		ai_chance = {
			base = 10
		}
	}
}

# Country becomes a puppet - Event for SOV ### (ITA uses this too)
country_event = {
	id = NSB_soviet_foreign_politics_events.150
	title = NSB_soviet_foreign_politics_events.150.t
	desc = NSB_soviet_foreign_politics_events.150.desc
	picture = "[GetCountryBecomesPuppetGFX]"

	is_triggered_only = yes
			
	option = { #Cool
		name = NSB_soviet_foreign_politics_events.150.a
		effect_tooltip = {
			set_politics = { ruling_party = ROOT }
			puppet = FROM
			add_to_faction = FROM
		}
	}
}

# Country joins faction - Event for SOV ### (ITA uses this too)
country_event = {
	id = NSB_soviet_foreign_politics_events.151
	title = NSB_soviet_foreign_politics_events.151.t
	desc = NSB_soviet_foreign_politics_events.151.desc
	picture = "[GetCountryBecomesPuppetGFX]"

	is_triggered_only = yes
			
	option = { #Okay
		name = NSB_soviet_foreign_politics_events.151.a
		effect_tooltip = {
			add_to_faction = FROM
			FROM = {
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_pressured_our_government
				}
			}
		}
	}
}

# Country changes government - Event for SOV ### (ITA uses this too)
country_event = {
	id = NSB_soviet_foreign_politics_events.158
	title = NSB_soviet_foreign_politics_events.158.t
	desc = NSB_soviet_foreign_politics_events.158.desc
	picture = "[GetCountryChangesGovernmentGFX]"

	is_triggered_only = yes

	option = { #Okay
		name = NSB_soviet_foreign_politics_events.158.a
		effect_tooltip = {
			FROM = {
				set_politics = { ruling_party = ROOT }
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_pressured_our_government
				}
			}
		}
	}
}

# Country refuses - Event for SOV ### (ITA uses this too)
country_event = {
	id = NSB_soviet_foreign_politics_events.152
	title = NSB_soviet_foreign_politics_events.152.t
	desc = NSB_soviet_foreign_politics_events.152.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes
			
	option = { #Okay - Default generic option
		name = NSB_soviet_foreign_politics_events.152.a

		ai_chance = {
			base = 1
		}

		trigger = {
			NOT = {
				FROM = { original_tag = PER }
				ROOT = { original_tag = SOV }
			}
		}

		if = {
			limit = {
				NOT = {
					is_in_faction_with = FROM
				}
			}
			if = {
				limit = {
					OR = {
						has_government = fascism
						has_government = neutrality
					}
				}
				create_wargoal = {
					type = annex_everything
					target = FROM
				}
			}
			else = {
				create_wargoal = {
					type = puppet_wargoal_focus
					target = FROM
				}
			} 
		}

		effect_tooltip = {
			FROM = {
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_pressured_our_government
				}
			}
		}
	}

	option = { #Respect
		name = NSB_soviet_foreign_politics_events.152.b
		
		ai_chance = {
			base = 0
			modifier = {
				add = 1
				FROM = { original_tag = PER }
				original_tag = SOV
				NOT = {		#r56
					is_historical_focus_on = yes
				}
			}
		}
	}

	option = { #Make Preparations -> Iran
		name = NSB_soviet_foreign_politics_events.152.c

		trigger = {
			FROM = { original_tag = PER }
			original_tag = SOV
			is_subject = no
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					strength_ratio = {
						tag = FROM
						ratio < 0.6
					}
					surrender_progress > 0.25
				}
			}
			modifier = {	#r56: if historical cooperation possible, do that instead, UK will simply refuse if theyre rather busy
				factor = 0
				is_historical_focus_on = yes
				ENG = {
					exists = yes
					has_government = democratic	#option can be picked even if not, but no need to force it if UK isnt historical either
					is_subject = no
					NOT = {
						has_war_with = ROOT
					}
				}
				NOT = { is_justifying_wargoal_against = ENG }
			}
		}

		set_global_flag = SOV_soviet_invasion_of_iran_flag
		
		activate_mission = SOV_preparations_for_operation_countenance
		custom_effect_tooltip = SOV_preparations_for_operation_countenance_tt

		custom_effect_tooltip = SOV_operation_countenance_successful_tt
		effect_tooltip = {
			puppet = PER
			transfer_state = 419 #Tibriz (AZB)
			transfer_state = 420 #Gilan (AZB)
			transfer_state = 416 #Khorasan
			PER = {
				give_resource_rights = { receiver = SOV state = 411 }
				give_resource_rights = { receiver = SOV state = 412 }
				give_resource_rights = { receiver = SOV state = 413 }
			}
		}
	}

	option = { #Joint Invasion with ENG -> Iran
		name = NSB_soviet_foreign_politics_events.152.d

		trigger = {
			FROM = { original_tag = PER }
			original_tag = SOV
			is_subject = no
			ENG = {
				exists = yes
				is_subject = no	#R56 addition, theyll always say no
				NOT = {
					has_war_with = ROOT
				}
			}
			NOT = { is_justifying_wargoal_against = ENG }
		}

		ai_chance = {
			base = 10
			modifier = {
				factor = 100
				is_in_faction_with = ENG
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > -25
				}
			}
			modifier = {
				factor = 5
				has_opinion = {
					target = FROM
					value > 50
				}
			}
			modifier = {
				factor = 0
				OR = {
					strength_ratio = {
						tag = FROM
						ratio < 0.6
					}
					surrender_progress > 0.25
				}
			}
		}

		ENG = { country_event = { id = NSB_soviet_foreign_politics_events.153 hours = 6 random_hours = 3 } }

		effect_tooltip = {
			custom_effect_tooltip = if_they_accept_tt
			activate_mission = SOV_preparations_for_operation_countenance
			ENG = { activate_mission = SOV_preparations_for_operation_countenance }
			custom_effect_tooltip = SOV_preparations_for_operation_countenance_tt

			custom_effect_tooltip = SOV_operation_countenance_successful_tt
			ENG = {
				puppet = PER
			}
			SOV = {
				transfer_state = 419 #Tibriz (AZB)
				transfer_state = 420 #Gilan (AZB)
				transfer_state = 416 #Khorasan
			}
			PER = {
				give_resource_rights = { receiver = SOV state = 411 }
				give_resource_rights = { receiver = SOV state = 412 }
				give_resource_rights = { receiver = ENG state = 413 }
				give_military_access = SOV
			}

			custom_effect_tooltip = if_they_refuse_tt
			activate_mission = SOV_preparations_for_operation_countenance
			custom_effect_tooltip = SOV_operation_countenance_successful_tt
			puppet = PER
			transfer_state = 419 #Tibriz (AZB)
			transfer_state = 420 #Gilan (AZB)
			transfer_state = 416 #Khorasan
			PER = {
				give_resource_rights = { receiver = SOV state = 411 }
				give_resource_rights = { receiver = SOV state = 412 }
				give_resource_rights = { receiver = SOV state = 413 }
			}
		}
	}
}

# Anglo-Soviet Invasion of Iran proposal - Event for ENG
country_event = {
	id = NSB_soviet_foreign_politics_events.153
	title = NSB_soviet_foreign_politics_events.153.t
	desc = NSB_soviet_foreign_politics_events.153.desc
	picture = GFX_report_event_stalin_meeting

	is_triggered_only = yes
			
	option = { #Agree
		name = NSB_soviet_foreign_politics_events.153.a

		ai_chance = {
			base = 10
			modifier = {
				factor = 100
				is_in_faction_with = FROM
			}
			modifier = {	#r56
				factor = 100
				is_historical_focus_on = yes
				OR = {
					AND = {
						has_subject = IRQ
						IRQ = {
							has_capitulated = no
						}
					}
					controls_state = 291
					any_allied_country = {
						controls_state = 291
					}
				}
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > -25
				}
			}
			modifier = {
				factor = 5
				has_opinion = {
					target = FROM
					value > 50
				}
			}
			modifier = {
				factor = 0
				OR = {
					NOT = {
						any_enemy_country = {
							is_major = yes
							has_war_with = FROM
						}
					}
					has_war_with = PER
					has_guaranteed = PER
					has_non_aggression_pact_with = PER
					is_in_faction_with = PER
					strength_ratio = {
						tag = FROM
						ratio < 0.5				#r56: lowered slightly
					}
					surrender_progress > 0.15	#r56: lowered from 0.5, this is UK, if theyre at 50%, theyre screwed
				}
			}
		}
		
		set_global_flag = SOV_agreed_anglo_soviet_invasion_of_iran_flag

		effect_tooltip = {
			activate_mission = SOV_preparations_for_operation_countenance
			custom_effect_tooltip = SOV_preparations_for_operation_countenance_tt

			custom_effect_tooltip = SOV_operation_countenance_successful_tt
			puppet = PER
			SOV = {
				transfer_state = 419 #Tibriz (AZB)
				transfer_state = 420 #Gilan (AZB)
				transfer_state = 416 #Khorasan
			}
			PER = {
				give_resource_rights = { receiver = SOV state = 411 }
				give_resource_rights = { receiver = SOV state = 412 }
				give_resource_rights = { receiver = ENG state = 413 }
				give_military_access = SOV
			}
		}

		FROM = { country_event = { id = NSB_soviet_foreign_politics_events.154 hours = 1 } }
	}

	option = { #Reject
		name = NSB_soviet_foreign_politics_events.153.b

		ai_chance = {
			base = 1
		}

		custom_effect_tooltip = NSB_soviet_foreign_politics_events.153_soviets_alone_tt
		hidden_effect = {
			FROM = { country_event = { id = NSB_soviet_foreign_politics_events.155 hours = 4 } }
			set_global_flag = SOV_soviet_invasion_of_iran_flag
		}
	}
}

# Anglo-Soviet Invasion of Iran - ENG ACCEPTS - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.154
	title = NSB_soviet_foreign_politics_events.154.t
	desc = NSB_soviet_foreign_politics_events.154.desc
	picture = GFX_report_event_british_inspect_troops

	is_triggered_only = yes
			
	option = { #Good
		name = NSB_soviet_foreign_politics_events.154.a

		activate_mission = SOV_preparations_for_operation_countenance		
		ENG = { activate_mission = SOV_preparations_for_operation_countenance }
		custom_effect_tooltip = SOV_preparations_for_operation_countenance_tt

		effect_tooltip = {
			custom_effect_tooltip = SOV_operation_countenance_successful_tt
			ENG = {
				puppet = PER
			}
			transfer_state = 419 #Tibriz (AZB)
			transfer_state = 420 #Gilan (AZB)
			transfer_state = 416 #Khorasan
			PER = {
				give_resource_rights = { receiver = SOV state = 411 }
				give_resource_rights = { receiver = SOV state = 412 }
				give_resource_rights = { receiver = ENG state = 413 }
				give_military_access = SOV
			}
		}
	}
}

# Anglo-Soviet Invasion of Iran - ENG REFUSES - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.155
	title = NSB_soviet_foreign_politics_events.155.t
	desc = NSB_soviet_foreign_politics_events.155.desc
	picture = GFX_report_event_generic_sign_treaty2

	is_triggered_only = yes
	
	option = { #Ok
		name = NSB_soviet_foreign_politics_events.155.a

		activate_mission = SOV_preparations_for_operation_countenance
		custom_effect_tooltip = SOV_preparations_for_operation_countenance_tt

		effect_tooltip = {
			custom_effect_tooltip = SOV_operation_countenance_successful_tt
			puppet = PER
			transfer_state = 419 #Tibriz (AZB)
			transfer_state = 420 #Gilan (AZB)
			transfer_state = 416 #Khorasan
			PER = {
				give_resource_rights = { receiver = SOV state = 411 }
				give_resource_rights = { receiver = SOV state = 412 }
				give_resource_rights = { receiver = SOV state = 413 }
			}
		}
	}
}

# HIDDEN EVENT TO MANAGE THE FALL OF IRAN - ONLY SOVIETS
country_event = {
	id = NSB_soviet_foreign_politics_events.156

	is_triggered_only = yes

	hidden = yes

	immediate = {
		transfer_state = 419 #Tibriz (AZB)
		transfer_state = 420 #Gilan (AZB)
		transfer_state = 983
		transfer_state = 984
		transfer_state = 987
		transfer_state = 988
		PER = {
			give_resource_rights = { receiver = SOV state = 411 }
			give_resource_rights = { receiver = SOV state = 412 }
			give_resource_rights = { receiver = SOV state = 413 }
		}
		411 = { set_state_flag = SOV_soviet_resource_rights_iran_flag }
		412 = { set_state_flag = SOV_soviet_resource_rights_iran_flag }
		413 = { set_state_flag = SOV_soviet_resource_rights_iran_flag }

		if = {
			limit = {	#sanity check
				has_government = communism
			}
			PER = {
				set_party_name = {
					ideology = communism
					name = PER_communism_party_alternate
					long_name = PER_communism_party_alternate_long
				}				
			}
		}
	}
}

# HIDDEN EVENT TO MANAGE THE FALL OF IRAN - JOINT INVASION
country_event = {
	id = NSB_soviet_foreign_politics_events.157

	is_triggered_only = yes

	hidden = yes

	immediate = {
		transfer_state = 419 #Tibriz (AZB)
		transfer_state = 420 #Gilan (AZB)
		transfer_state = 983
		transfer_state = 984
		transfer_state = 987
		transfer_state = 988
		PER = {
			give_resource_rights = { receiver = SOV state = 411 }
			give_resource_rights = { receiver = SOV state = 412 }
			give_resource_rights = { receiver = ENG state = 413 }
			give_military_access = ROOT
		}
		411 = { set_state_flag = SOV_soviet_resource_rights_iran_flag }
		412 = { set_state_flag = SOV_soviet_resource_rights_iran_flag }
		413 = { set_state_flag = SOV_british_resource_rights_iran_flag }

		if = {
			limit = {	#sanity check
				has_government = communism
			}
			PER = {
				set_party_name = {
					ideology = communism
					name = PER_communism_party_alternate
					long_name = PER_communism_party_alternate_long
				}				
			}
		}
	}
}

# Generic Ultimatum - Event for target ### (ITA uses this too)
country_event = {
	id = NSB_soviet_foreign_politics_events.200
	title = NSB_soviet_foreign_politics_events.200.t
	desc = NSB_soviet_foreign_politics_events.200.desc
	picture = "[GetUltimatumGFX]"

	is_triggered_only = yes

	immediate = {
		log = "FROM is [FROM.GetName]"
		log = "FROM.FROM [FROM.FROM.GetName]"
		log = "FROM.PREV [FROM.PREV.GetName]"
		log = "FROM.FROM.PREV [FROM.FROM.PREV.GetName]"
		log = "ROOT.FROM [ROOT.FROM.GetName]"
		log = "ROOT.PREV [ROOT.PREV.GetName]"
	}
			
	option = { # Become a puppet
		name = NSB_soviet_foreign_politics_events.200.a

		ai_chance = {
			base = 2
			modifier = {
				factor = 1.5
				has_opinion = {
					target = FROM
					value > 75
				}
			}
			modifier = {
				factor = 1.5
				OR = {
					AND = {
						FROM = {
							has_government = communism
						}
						communism > 0.5
					}
					AND = {
						FROM = {
							has_government = democratic
						}
						democratic > 0.5
					}
					AND = {
						FROM = {
							has_government = fascism
						}
						fascism > 0.5
					}
					AND = {
						FROM = {
							has_government = neutrality
						}
						neutrality > 0.5
					}
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
					tag = FROM
					ratio < 0.8
				}
			}
			modifier = {
				factor = 4
				strength_ratio = {
					tag = FROM
					ratio < 0.5
				}
			}
			modifier = {
				factor = 6
				strength_ratio = {
					tag = FROM
					ratio < 0.2
				}
			}
			modifier = {
				factor = 100
				is_in_faction_with = FROM
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				SOV = { has_idea = SOV_vyacheslav_molotov }
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						is_in_faction = yes
						NOT = { is_in_faction_with = FROM }
					}
					AND = {
						is_subject = yes
						NOT = { is_subject_of = FROM }
					}
				}
			}
			modifier = { 
				factor = 100000000
				YUG = {
					has_country_flag = ITA_ultimatum_sent_flag
				}
			}
		}

		trigger = {
		}

		set_politics = { ruling_party = FROM }
		FROM = {
			puppet = ROOT
			add_to_faction = ROOT
			hidden_effect = {
				country_event = { id = NSB_soviet_foreign_politics_events.150 hours = 1 }
			}
		}
		#TODO_Manu: Handle wars, civil wars and all that stuff
	}

	option = { #Join Faction - Keep government
		name = NSB_soviet_foreign_politics_events.200.b

		ai_chance = {
			base = 0
		}

		FROM = {
			add_to_faction = ROOT
			hidden_effect = {
				country_event = { id = NSB_soviet_foreign_politics_events.151 hours = 1 }
			}
		}
		hidden_effect = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_pressured_our_government
			}
		}
	}

	option = { #REFUSE
		name = NSB_soviet_foreign_politics_events.200.c

		ai_chance = {
			base = 10
		}

		FROM = {
			create_wargoal = {
				type = puppet_wargoal_focus
				target = ROOT
			}
			hidden_effect = {
				country_event = { id = NSB_soviet_foreign_politics_events.152 hours = 1 }
			}
		}

		hidden_effect = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_pressured_our_government
			}
		}
	}
}

# Ultimatum to Iran - Event for Iran
country_event = {
	id = NSB_soviet_foreign_politics_events.210
	title = NSB_soviet_foreign_politics_events.210.t
	desc = NSB_soviet_foreign_politics_events.210.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes
			
	option = { # Become a puppet
		name = NSB_soviet_foreign_politics_events.210.a

		ai_chance = {
			base = 1
			modifier = {	#r56, fixed them very rarely accepting on historical, feel free to add in exceptions
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				add = 0.5
				has_opinion = {
					target = FROM
					value > 75
				}
			}
			modifier = {
				add = 0.5
				OR = {
					FROM = {
						has_government = communism
						communism > 0.5
					}
					FROM = {
						has_government = democratic
						democratic > 0.5
					}
					FROM = {
						has_government = fascism
						fascism > 0.5
					}
					FROM = {
						has_government = neutrality
						neutrality > 0.5
					}
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
					tag = FROM
					ratio < 0.8
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
					tag = FROM
					ratio < 0.5
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
					tag = FROM
					ratio < 0.2
				}
			}
			modifier = {
				factor = 100
				is_in_faction_with = FROM
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						is_in_faction = yes
						NOT = { is_in_faction_with = FROM }
					}
					AND = {
						is_subject = yes
						NOT = { is_subject_of = FROM }
					}
				}
			}
		}

		set_politics = { ruling_party = FROM }
		FROM = {
			puppet = ROOT
			add_to_faction = ROOT
			hidden_effect = {
				country_event = { id = NSB_soviet_foreign_politics_events.150 hours = 1 }
			}
		}
		#TODO_Manu: Handle wars, civil wars and all that stuff
	}

	option = { #REFUSE
		name = NSB_soviet_foreign_politics_events.210.c

		ai_chance = {
			base = 20
		}

		FROM = {
			hidden_effect = {
				country_event = { id = NSB_soviet_foreign_politics_events.152 hours = 1 }
			}
		}

		hidden_effect = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_pressured_our_government
			}
		}

		custom_effect_tooltip = germany.126.warning
	}
}

# The Khakimov Proposal - Event for SAU
country_event = {
	id = NSB_soviet_foreign_politics_events.211
	title = NSB_soviet_foreign_politics_events.211.t
	desc = NSB_soviet_foreign_politics_events.211.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes
			
	option = { # Okay
		name = NSB_soviet_foreign_politics_events.211.a

		effect_tooltip = {
			add_ideas = SOV_ambassador_karim_khakimov
			add_opinion_modifier = { target = SOV modifier = SOV_cordial_relations_developed_by_soviet_diplomat } 
		}	
	}
}

# SOV sends Infantry Equipment - Event for Target
country_event = {
	id = NSB_soviet_foreign_politics_events.250
	title = NSB_soviet_foreign_politics_events.250.t
	desc = NSB_soviet_foreign_politics_events.250.desc
	picture = "[GetInfantryEquipmentGFX]"

	is_triggered_only = yes
			
	option = { # Nice
		name = NSB_soviet_foreign_politics_events.10.a
		
		if = { #Spanish POUM -> Not actually transfering them, just creating spoawning them
			limit = {
				tag = SPC
			}
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = 6000
				producer = FROM
			}
		}
		else = { #Chinese tags get different stuff -> SOV actually sends stuff
			effect_tooltip = {
				add_equipment_to_stockpile = {
					type = infantry_equipment
					amount = 1000
					producer = FROM
				}
				add_equipment_to_stockpile = {
					type = support_equipment
					amount = 200
					producer = FROM
				}
			}
		}		
	}
}

# SOV prepares a war against JAP - Event for SOV's allies
country_event = {
	id = NSB_soviet_foreign_politics_events.251
	title = NSB_soviet_foreign_politics_events.251.t
	desc = NSB_soviet_foreign_politics_events.251.desc
	picture = GFX_report_event_SOV_tank_column

	is_triggered_only = yes
			
	option = { # Nice
		name = NSB_soviet_foreign_politics_events.251.a

		add_timed_idea = {
			idea = SOV_preparations_for_soviet_japanese_war_china
			days = 365
		}		
	}
}

# SOV starts war with JAP - Event for SOV's allies
country_event = {
	id = NSB_soviet_foreign_politics_events.252
	title = NSB_soviet_foreign_politics_events.252.t
	desc = NSB_soviet_foreign_politics_events.252.desc
	picture = GFX_report_event_soviet_soldiers_tank

	is_triggered_only = yes
			
	option = { # Nice
		name = NSB_soviet_foreign_politics_events.252.a

		add_timed_idea = {
			idea = SOV_soviet_japanese_reckoning_china
			days = 180
		}		
	}
}

# SOV Peace deal for South Sakhalin and Kuril Islands - Event for JAP
country_event = {
	id = NSB_soviet_foreign_politics_events.260
	title = NSB_soviet_foreign_politics_events.260.t
	desc = NSB_soviet_foreign_politics_events.260.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes
			
	option = { # Accept
		name = NSB_soviet_foreign_politics_events.260.a

		ai_chance = {
			base = 5
			modifier = {
				factor = 2
				strength_ratio = {
					tag = FROM
					ratio < 0.8
				}
			}
			modifier = {
				factor = 5
				strength_ratio = {
					tag = FROM
					ratio < 0.5
				}
			}
			modifier = {
				factor = 2
				surrender_progress > 0.25
			}
			modifier = {
				factor = 5
				any_owned_state = {
					is_core_of = ROOT
					is_in_home_area = yes
					NOT = {	state = 536 } #HOKKAIDO
					is_controlled_by = FROM
				}
			}
			modifier = {
				factor = 10
				NOT = { has_full_control_of_state = 282 } #KANTO (Tokyo)
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 2
				SOV = { has_idea = SOV_vyacheslav_molotov }
			}
			modifier = {
				factor = 0.5
				naval_strength_ratio = {
					tag = FROM
					ratio > 1
				}
			}
		}

		white_peace = {
			tag = FROM
			#message = WE_CEDE_THEM_SOUTH_SAKHALIN_AND_KURIL_ISLANDS
		}
		FROM = {
			537 = {
				add_core_of = FROM
			}
			555 = {
				add_core_of = FROM
			}
			transfer_state = 537
			transfer_state = 555
		}
	}

	option = { # Nope
		name = NSB_soviet_foreign_politics_events.260.b

		ai_chance = {
			base = 10
		}
	}
}

# SOV Peace deal for Hokkaido (and South Sakhalin and Kuril Islands) - Event for JAP
country_event = {
	id = NSB_soviet_foreign_politics_events.261
	title = NSB_soviet_foreign_politics_events.260.t
	desc = NSB_soviet_foreign_politics_events.261.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes
			
	option = { # Accept
		name = NSB_soviet_foreign_politics_events.260.a

		ai_chance = {
			base = 5
			modifier = {
				factor = 2
				strength_ratio = {
					tag = FROM
					ratio < 0.8
				}
			}
			modifier = {
				factor = 5
				strength_ratio = {
					tag = FROM
					ratio < 0.5
				}
			}
			modifier = {
				factor = 2
				surrender_progress > 0.25
			}
			modifier = {
				factor = 5
				any_owned_state = {
					is_core_of = ROOT
					is_in_home_area = yes
					NOT = {
						state = 536 #HOKKAIDO
						state = 555 #KURIL ISLANDS
					}
					is_controlled_by = FROM
				}
			}
			modifier = {
				factor = 10
				NOT = { has_full_control_of_state = 282 } #KANTO (Tokyo)
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 2
				SOV = { has_idea = SOV_vyacheslav_molotov }
			}
			modifier = {
				factor = 0.5
				naval_strength_ratio = {
					tag = FROM
					ratio > 1
				}
			}
		}

		white_peace = {
			tag = FROM
			#message = WE_CEDE_THEM_SOUTH_SAKHALIN_AND_KURIL_ISLANDS
		}
		FROM = {
			537 = {
				add_core_of = FROM
			}
			555 = {
				add_core_of = FROM
			}
			transfer_state = 537
			transfer_state = 536 #Hokkaido
			transfer_state = 555
		}
		hidden_effect = {
			FROM = {
				set_country_flag = SOV_hokkaido_included_in_peace_deal_flag
				country_event = { id = NSB_soviet_foreign_politics_events.264 hours = 4 }
			}
		}
	}

	option = { # Nope
		name = NSB_soviet_foreign_politics_events.260.b

		ai_chance = {
			base = 10
		}

		hidden_effect = {
			FROM = { country_event = { id = NSB_soviet_foreign_politics_events.265 hours = 4 } }
		}
	}
}

# JAP Accepts Peace Deal - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.264
	title = NSB_soviet_foreign_politics_events.264.t
	desc = NSB_soviet_foreign_politics_events.264.desc
	picture = GFX_report_event_soviet_japanese_pact

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_foreign_politics_events.264.a

		effect_tooltip = {
			white_peace = {
				tag = ROOT
			}
			537 = {
				add_core_of = ROOT
			}
			555 = {
				add_core_of = ROOT
			}
			transfer_state = 537
			transfer_state = 555
			if = {
				limit = {
					has_country_flag = SOV_hokkaido_included_in_peace_deal_flag
				}
				transfer_state = 536 #Hokkaido
				clr_country_flag = SOV_hokkaido_included_in_peace_deal_flag
			}
		}
	}
}

# JAP Rejects Peace Deal - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.265
	title = NSB_soviet_foreign_politics_events.265.t
	desc = NSB_soviet_foreign_politics_events.265.desc
	picture = GFX_report_event_japanese_reply

	is_triggered_only = yes
			
	option = { # Bad for them
		name = NSB_soviet_foreign_politics_events.265.a

		if = {
			limit = {
				has_country_flag = SOV_hokkaido_included_in_peace_deal_flag
			}
			clr_country_flag = SOV_hokkaido_included_in_peace_deal_flag
		}
	}
}

# SOV offers North Sakhalin in exchange for NAP - Event for JAP
country_event = {
	id = NSB_soviet_foreign_politics_events.262
	title = soviet.23.t
	desc = soviet.23.d
	picture = GFX_report_event_soviet_japanese_pact

	is_triggered_only = yes
			
	option = { # Accept
		name = soviet.23.a

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > 50
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 2
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = { #Is going non-aligned (kill SOV in focus branch)
				factor = 0
				has_completed_focus = JAP_support_the_kodoha_faction
			}
		}

		add_opinion_modifier = { target = SOV modifier = border_conflict_reconciled }
		transfer_state = 655
		diplomatic_relation = {
			country = SOV
			relation = non_aggression_pact
			active = yes
		}
		
		hidden_effect = {
			FROM = { country_event = { id = NSB_soviet_foreign_politics_events.266 hours = 4 } }
			set_global_flag = SOV_soviet_japanese_reconciliation_flag
		}
	}

	option = { # Nope
		name = NSB_soviet_foreign_politics_events.262.b

		ai_chance = {
			base = 1
			modifier = {
				factor = 5
				has_opinion = {
					target = FROM
					value < -50
				}
			}
			modifier = { #Is going commie or historical
				factor = 0
				OR = {
					has_completed_focus = JAP_the_unthinkable_option
					has_completed_focus = JAP_purge_the_kodoha_faction
				}
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = NSB_soviet_foreign_politics_events.267 hours = 4 } }
		}
	}
}

# JAP Accepts NAP - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.266
	title = NSB_soviet_foreign_politics_events.266.t
	desc = NSB_soviet_foreign_politics_events.266.desc
	picture = GFX_report_event_soviet_japanese_pact

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_foreign_politics_events.266.a

		effect_tooltip = {
			FROM = {
				add_opinion_modifier = { target = ROOT modifier = border_conflict_reconciled }
				transfer_state = 655
				diplomatic_relation = {
					country = SOV
					relation = non_aggression_pact
					active = yes
				}
			}
		}
	}
}

# JAP Rejects NAP - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.267
	title = NSB_soviet_foreign_politics_events.267.t
	desc = NSB_soviet_foreign_politics_events.267.desc
	picture = GFX_report_event_japanese_reply

	is_triggered_only = yes
			
	option = { # Bad for them
		name = NSB_soviet_foreign_politics_events.267.a

	}
}

# SOV offers pact against USA - Event for JAP
country_event = {
	id = NSB_soviet_foreign_politics_events.263
	title = NSB_soviet_foreign_politics_events.263.t
	desc = NSB_soviet_foreign_politics_events.263.desc
	picture = GFX_report_event_soviet_japanese_pact

	is_triggered_only = yes
			
	option = { # Accept
		name = NSB_soviet_foreign_politics_events.263.a

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > 50
				}
			}
			modifier = {
				factor = 5
				has_non_aggression_pact_with = FROM
			}
			modifier = {
				factor = 10
				has_war_with = USA
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				SOV = { has_idea = SOV_vyacheslav_molotov }
			}
		}

		effect_tooltip = {
			#Diplo stuff
			add_opinion_modifier = { target = FROM modifier = SOV_soviet_japanese_pact_against_usa }
			FROM = { add_opinion_modifier = { target = ROOT modifier = SOV_soviet_japanese_pact_against_usa } }
			if = {
				limit = {
					NOT = {
						has_non_aggression_pact_with = SOV
					}
				}
				diplomatic_relation = {
					country = SOV
					relation = non_aggression_pact
					active = yes
				}
			}

			#Claims
			463 = { add_claim_by = SOV } #Alaska
			650 = { add_claim_by = SOV } #Atu Island
			632 = { add_claim_by = JAP } #Wake Island
			631 = { add_claim_by = JAP } #Midway Island
			629 = { add_claim_by = JAP } #Hawaii
			630 = { add_claim_by = JAP } #Johnston Atoll
			727 = { add_claim_by = JAP } #Line Islands
			642 = { add_claim_by = JAP } #Phoenix Island
			638 = { add_claim_by = JAP } #Guam

			#War
			if = {
				limit = {
					JAP = {	has_war_with = USA }
					NOT = { SOV = { has_war_with = USA } }
				}
				SOV = { add_to_war = { targeted_alliance = JAP enemy = USA hostility_reason = asked_to_join } }
			}
			else_if = {
				limit = {
					SOV = { has_war_with = USA }
					NOT = { JAP = {	has_war_with = USA } }
				}
				JAP = { add_to_war = { targeted_alliance = SOV enemy = USA hostility_reason = asked_to_join } }
			}
			else_if = {
				limit = {
					NOT = { SOV = { has_war_with = USA } }
					NOT = { JAP = {	has_war_with = USA } }
				}
				SOV = {
					declare_war_on = {
						target = USA
						type = annex_everything
					}
				}
				JAP = { add_to_war = { targeted_alliance = SOV enemy = USA hostility_reason = asked_to_join } }
			}

			#Targeted NS
			SOV = {
				add_timed_idea = { idea = SOV_soviet_japanese_anti_usa_pact days = 365 }
			}
			JAP = {
				add_timed_idea = { idea = SOV_soviet_japanese_anti_usa_pact days = 365 }
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = NSB_soviet_foreign_politics_events.268 hours = 1 } }
		}
	}

	option = { # Nope
		name = NSB_soviet_foreign_politics_events.263.b

		ai_chance = {
			base = 1
			modifier = {
				factor = 5
				has_opinion = {
					target = FROM
					value < -50
				}
			}
			modifier = {
				factor = 100
				strength_ratio = {
					tag = USA
					ratio < 0.5
				}
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = NSB_soviet_foreign_politics_events.269 hours = 4 } }
		}
	}
}

# JAP Accepts pact against USA - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.268
	title = NSB_soviet_foreign_politics_events.268.t
	desc = NSB_soviet_foreign_politics_events.268.desc
	picture = GFX_report_event_soviet_japanese_pact

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_foreign_politics_events.268.a

		463 = { add_claim_by = SOV } #Alaska
		650 = { add_claim_by = SOV } #Atu Island
		add_opinion_modifier = { target = FROM modifier = SOV_soviet_japanese_pact_against_usa }
		FROM = {
			#Diplo stuff
			add_opinion_modifier = { target = ROOT modifier = SOV_soviet_japanese_pact_against_usa }
			diplomatic_relation = {
				country = SOV
				relation = non_aggression_pact
				active = yes
			}
			#Claims
			632 = { add_claim_by = JAP } #Wake Island
			631 = { add_claim_by = JAP } #Midway Island
			629 = { add_claim_by = JAP } #Hawaii
			630 = { add_claim_by = JAP } #Johnston Atoll
			727 = { add_claim_by = JAP } #Line Islands
			642 = { add_claim_by = JAP } #Phoenix Island
			638 = { add_claim_by = JAP } #Guam
		}
		#War
		if = {
			limit = {
				JAP = {	has_war_with = USA }
				NOT = { SOV = { has_war_with = USA } }
			}
			SOV = { add_to_war = { targeted_alliance = JAP enemy = USA hostility_reason = asked_to_join } }
		}
		else_if = {
			limit = {
				SOV = { has_war_with = USA }
				NOT = { JAP = {	has_war_with = USA } }
			}
			JAP = { add_to_war = { targeted_alliance = SOV enemy = USA hostility_reason = asked_to_join } }
		}
		else_if = {
			limit = {
				NOT = { SOV = { has_war_with = USA } }
				NOT = { JAP = {	has_war_with = USA } }
			}
			SOV = {
				declare_war_on = {
					target = USA
					type = annex_everything
				}
			}
			JAP = { add_to_war = { targeted_alliance = SOV enemy = USA hostility_reason = asked_to_join } }
		}

		#Targeted NS
		SOV = {
			add_timed_idea = { idea = SOV_soviet_japanese_anti_usa_pact days = 365 }
		}
		JAP = {
			add_timed_idea = { idea = SOV_soviet_japanese_anti_usa_pact days = 365 }
		}
	}
}

# JAP Rejects pact against USA - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.269
	title = NSB_soviet_foreign_politics_events.269.t
	desc = NSB_soviet_foreign_politics_events.269.desc
	picture = GFX_report_event_japanese_reply

	is_triggered_only = yes
			
	option = { # Bad for them
		name = NSB_soviet_foreign_politics_events.269.a

	}
}

####### SINKIANG ########

# SOV-SINKIANG - Initiate relations (Railwway SOV-SIK - Gobi Gambit) - Event for SIK
country_event = {
	id = NSB_soviet_foreign_politics_events.270
	title = NSB_soviet_foreign_politics_events.270.t
	desc = NSB_soviet_foreign_politics_events.270.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes
			
	option = { # OK
		name = NSB_soviet_foreign_politics_events.270.a

		ai_chance = {
			base = 3
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 2
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				SOV = { has_idea = SOV_vyacheslav_molotov }
			}
		}
		
		FROM = {
			add_opinion_modifier = {
				target = ROOT
				modifier = SOV_complied_with_our_demands
			}

			# Tashkent - Frunze - Alma-Ata - Urumqi
			build_railway = {
				path = { 1459 10148 10366 12397 12340 12640 7706 12583 4224 1591 10547 10619 12529 7866 1783 10674 4709 }
			}
			#Supply Hub in Alma-Ata
			586 = {
				add_building_construction = {
					type = supply_node
					level = 1
					province = 1591
					instant_build = yes
				}
			}
			add_to_variable = { SOV_fyp_consumer_goods_factor = -0.01 }
		}
		custom_effect_tooltip = SOV_sinikiang_influence_cg_tt_sik

		hidden_effect = {
			FROM = { country_event = { id = NSB_soviet_foreign_politics_events.271 hours = 1 } }
		}
	}

	option = { # Nope
		name = NSB_soviet_foreign_politics_events.270.b

		ai_chance = {
			base = 0
			modifier = {
				add = 1
				has_opinion = {
					target = FROM
					value < -50
				}
			}
			modifier = {
				add = 1
				is_in_faction = yes
				NOT = { is_in_faction_with = SOV }
			}
			modifier = {
				add = 5
				FROM = { is_justifying_wargoal_against = ROOT }
			}
			modifier = {
				add = 10
				is_subject = yes
				NOT = { is_subject_of = SOV }
			}
		}
	
		effect_tooltip = {
			FROM = {
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_rejected_our_demands
				}
			}
		}

		FROM = { country_event = { id = NSB_soviet_foreign_politics_events.272 hours = 1 } }
		custom_effect_tooltip = germany.126.warning
	}
}

# SOV-SINKIANG - Sinkiang accepts our proposal - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.271
	title = NSB_soviet_foreign_politics_events.271.t
	desc = NSB_soviet_foreign_politics_events.271.desc
	picture = GFX_report_event_generic_train

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_foreign_politics_events.271.a

		ai_chance = {
			base = 1
		}

		effect_tooltip = {
			# Tashkent - Frunze - Alma-Ata - Urumqi
			build_railway = {
				path = { 1459 10148 10366 12397 12340 12640 7706 12583 4224 1591 10547 10619 12529 7866 1783 10674 4709 }
			}
			#Supply Hub in Alma-Ata
			586 = {
				add_building_construction = {
					type = supply_node
					level = 1
					province = 1591
					instant_build = yes
				}
			}
			custom_effect_tooltip = SOV_sinikiang_influence_cg_tt_sov

			add_opinion_modifier = {
				target = FROM
				modifier = SOV_complied_with_our_demands
			}
		}
	}
}

# SOV-SINKIANG - Sinkiang rejects our proposal - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.272
	title = NSB_soviet_foreign_politics_events.272.t
	desc = NSB_soviet_foreign_politics_events.272.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes
			
	option = { # Respect
		name = NSB_soviet_foreign_politics_events.272.a

		ai_chance = {
			base = 3
			modifier = {
				add = -1
				FROM = { is_in_faction = yes }
			}
			modifier = {
				add = -1
				has_war = yes
			}
			modifier = {
				add = -1
				FROM = {
					is_subject = yes
					OVERLORD = {
						is_major = yes
					}
				}
			}
		}

		# Tashkent - Frunze - Alma-Ata
		build_railway = {
			path = { 1459 10148 10366 12397 12340 12640 7706 12583 4224 1591 }
		}
		#Supply Hub in Alma-Ata
		586 = {
			add_building_construction = {
				type = supply_node
				level = 1
				province = 1591
				instant_build = yes
			}
		}
		
		add_opinion_modifier = {
			target = FROM
			modifier = SOV_rejected_our_demands
		}
	}

	option = { # Unacceptable
		name = NSB_soviet_foreign_politics_events.272.b

		ai_chance = {
			base = 1
		}

		# Tashkent - Frunze - Alma-Ata
		build_railway = {
			path = { 1459 10148 10366 12397 12340 12640 7706 12583 4224 1591 }
		}
		#Supply Hub in Alma-Ata
		586 = {
			add_building_construction = {
				type = supply_node
				level = 1
				province = 1591
				instant_build = yes
			}
		}
	
		add_opinion_modifier = {
			target = FROM
			modifier = SOV_rejected_our_demands
		}

		create_wargoal = {
			type = take_state_focus
			target = SIK
			expire = 0
			generator = { 618 617 287 619 759 760 }
		}
		add_named_threat = { threat = 2 name = SOV_claim_on_sinkiang_threat }
	}
}

# SOV-SINKIANG - Mineral Prospection (Railwway Urumqui-Kashgar) - Event for SIK
country_event = {
	id = NSB_soviet_foreign_politics_events.273
	title = NSB_soviet_foreign_politics_events.273.t
	desc = NSB_soviet_foreign_politics_events.273.desc
	picture = GFX_report_event_china_ledo_road

	is_triggered_only = yes
			
	option = { # OK
		name = NSB_soviet_foreign_politics_events.273.a

		ai_chance = {
			base = 3
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 2
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				SOV = { has_idea = SOV_vyacheslav_molotov }
			}
		}
		
		FROM = {
			add_opinion_modifier = {
				target = ROOT
				modifier = SOV_complied_with_our_demands
			}

			add_to_variable = { SOV_fyp_consumer_goods_factor = -0.01 }
			custom_effect_tooltip = SOV_sinikiang_influence_cg_tt_sik

			effect_tooltip = {
				custom_effect_tooltip = SOV_sinkiang_when_project_finishes_tt
				619 = { #YARKAND - Minerals and Infra
					add_resource = {
						type = aluminium
						amount = 3
					}
					add_resource = {
						type = chromium
						amount = 3
					}
					if = {
						limit = {
							infrastructure < 5
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes						
						}
					}
				}

				617 = { #URUMQI
					if = {
						limit = {
							infrastructure < 5
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes						
						}
					}
				}

				# Urumqi - Kashgar
				build_railway = {
					path = { 4709 4770 7702 4682 7949 2015 }
				}
				#Supply Hub in Kashgar
				619 = {
					add_building_construction = {
						type = supply_node
						level = 1
						province = 2015
						instant_build = yes
					}
				}
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = NSB_soviet_foreign_politics_events.274 hours = 1 } }
			activate_mission = SOV_sinkiang_mineral_prospection_mission_dummy
		}
	}

	option = { # Nope
		name = NSB_soviet_foreign_politics_events.273.b

		ai_chance = {
			base = 0
			modifier = {
				add = 1
				has_opinion = {
					target = FROM
					value < -50
				}
			}
			modifier = {
				add = 1
				is_in_faction = yes
				NOT = { is_in_faction_with = SOV }
			}
			modifier = {
				add = 5
				FROM = { is_justifying_wargoal_against = ROOT }
			}
			modifier = {
				add = 10
				is_subject = yes
				NOT = { is_subject_of = SOV }
			}
		}
	
		effect_tooltip = {
			FROM = {
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_rejected_our_demands
				}
			}
		}

		FROM = {
			country_event = { id = NSB_soviet_foreign_politics_events.275 hours = 1 }
			set_country_flag = SOV_sinkiang_prospection_rejected_flag
		}
		custom_effect_tooltip = germany.126.warning
	}
}

# SOV-SINKIANG - Sinkiang accepts our proposal (Mineral Prospection) - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.274
	title = NSB_soviet_foreign_politics_events.274.t
	desc = NSB_soviet_foreign_politics_events.274.desc
	picture = GFX_report_event_china_ledo_road

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_foreign_politics_events.274.a

		ai_chance = {
			base = 1
		}

		effect_tooltip = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_complied_with_our_demands
			}

			custom_effect_tooltip = SOV_sinikiang_influence_cg_tt_sov

			custom_effect_tooltip = SOV_sinkiang_when_project_finishes_tt
			619 = { #YARKAND - Minerals and Infra
				add_resource = {
					type = aluminium
					amount = 3
				}
				add_resource = {
					type = chromium
					amount = 3
				}
				if = {
					limit = {
						infrastructure < 5
					}
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes						
					}
				}
			}

			617 = { #URUMQI
				if = {
					limit = {
						infrastructure < 5
					}
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes						
					}
				}
			}

			# Urumqi - Kashgar
			build_railway = {
				path = { 4709 4770 7702 4682 7949 2015 }
			}
			#Supply Hub in Kashgar
			619 = {
				add_building_construction = {
					type = supply_node
					level = 1
					province = 2015
					instant_build = yes
				}
			}
		}
	}
}

# SOV-SINKIANG - Sinkiang rejects our proposal (generic) - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.275
	title = NSB_soviet_foreign_politics_events.275.t
	desc = NSB_soviet_foreign_politics_events.275.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes
			
	option = { # Respect
		name = NSB_soviet_foreign_politics_events.275.a

		ai_chance = {
			base = 3
			modifier = {
				add = -1
				FROM = { is_in_faction = yes }
			}
			modifier = {
				add = -1
				has_war = yes
			}
			modifier = {
				add = -1
				FROM = {
					is_subject = yes
					OVERLORD = {
						is_major = yes
					}
				}
			}
		}

		add_opinion_modifier = {
			target = FROM
			modifier = SOV_rejected_our_demands
		}
	}

	option = { # Unacceptable
		name = NSB_soviet_foreign_politics_events.275.b

		trigger = {
			NOT = { is_in_faction_with = FROM }
		}

		ai_chance = {
			base = 1
		}
	
		add_opinion_modifier = {
			target = FROM
			modifier = SOV_rejected_our_demands
		}

		create_wargoal = {
			type = take_state_focus
			target = SIK
			expire = 0
			generator = { 618 617 287 619 759 760 }
		}
		add_named_threat = { threat = 2 name = SOV_claim_on_sinkiang_threat }
	}
}

# SOV-SINKIANG - Oil Prospection (Railwway Urumqui-Altay) - Event for SIK
country_event = {
	id = NSB_soviet_foreign_politics_events.276
	title = NSB_soviet_foreign_politics_events.276.t
	desc = NSB_soviet_foreign_politics_events.276.desc
	picture = GFX_report_event_china_ledo_road

	is_triggered_only = yes
			
	option = { # OK
		name = NSB_soviet_foreign_politics_events.276.a

		ai_chance = {
			base = 3
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 2
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				SOV = { has_idea = SOV_vyacheslav_molotov }
			}
		}
		
		FROM = {
			add_opinion_modifier = {
				target = ROOT
				modifier = SOV_complied_with_our_demands
			}

			add_to_variable = { SOV_fyp_consumer_goods_factor = -0.01 }
			custom_effect_tooltip = SOV_sinikiang_influence_cg_tt_sik

			effect_tooltip = {
				custom_effect_tooltip = SOV_sinkiang_when_project_finishes_tt
				618 = { #DZUNGARIA - Minerals, oil and Infra
					add_resource = {
						type = aluminium
						amount = 3
					}
					add_resource = {
						type = tungsten
						amount = 3
					}
					add_resource = {
						type = oil
						amount = 6
					}
					if = {
						limit = {
							infrastructure < 5
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes
						}
					}
				}
				give_resource_rights = { receiver = SOV state = 618 } # Grant Resource rights to SOV
				617 = { #URUMQI - Infra
					if = {
						limit = {
							infrastructure < 5
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes
						}
					}
				}
				# Urumqi - Altay
				build_railway = {
					path = { 4709 10674 1783 1844 12737 4823 }
				}
				#Supply Hub in Altay
				618 = {
					add_building_construction = {
						type = supply_node
						level = 1
						province = 4823
						instant_build = yes
					}
				}

				ROOT = { add_ideas = SOV_expanded_exploitation_of_gold_mines }
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = NSB_soviet_foreign_politics_events.277 hours = 1 } }
			activate_mission = SOV_sinkiang_oil_prospection_mission_dummy
		}
	}

	option = { # Nope
		name = NSB_soviet_foreign_politics_events.276.b

		ai_chance = {
			base = 0
			modifier = {
				add = 1
				has_opinion = {
					target = FROM
					value < -50
				}
			}
			modifier = {
				add = 1
				is_in_faction = yes
				NOT = { is_in_faction_with = SOV }
			}
			modifier = {
				add = 5
				FROM = { is_justifying_wargoal_against = ROOT }
			}
			modifier = {
				add = 10
				is_subject = yes
				NOT = { is_subject_of = SOV }
			}
		}
	
		effect_tooltip = {
			FROM = {
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_rejected_our_demands
				}
			}
		}

		FROM = {
			country_event = { id = NSB_soviet_foreign_politics_events.275 hours = 1 }
			set_country_flag = SOV_sinkiang_oil_prospection_rejected_flag
		}
		custom_effect_tooltip = germany.126.warning
	}
}

# SOV-SINKIANG - Sinkiang accepts our proposal (Oil Prospection) - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.277
	title = NSB_soviet_foreign_politics_events.277.t
	desc = NSB_soviet_foreign_politics_events.277.desc
	picture = GFX_report_event_china_ledo_road

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_foreign_politics_events.277.a

		ai_chance = {
			base = 1
		}

		effect_tooltip = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_complied_with_our_demands
			}

			custom_effect_tooltip = SOV_sinikiang_influence_cg_tt_sov

			custom_effect_tooltip = SOV_sinkiang_when_project_finishes_tt
			618 = { #DZUNGARIA - Minerals, oil and Infra
				add_resource = {
					type = aluminium
					amount = 3
				}
				add_resource = {
					type = tungsten
					amount = 3
				}
				add_resource = {
					type = oil
					amount = 6
				}
				if = {
					limit = {
						infrastructure < 5
					}
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes
					}
				}
			}
			give_resource_rights = { receiver = SOV state = 618 } # Grant Resource rights to SOV (Not scoping to make tooltip slightly shorter)
			617 = { #URUMQI - Infra
				if = {
					limit = {
						infrastructure < 5
					}
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes
					}
				}
			}
			# Urumqi - Altay
			build_railway = {
				path = { 4709 10674 1783 1844 12737 4823 }
			}
			#Supply Hub in Altay
			618 = {
				add_building_construction = {
					type = supply_node
					level = 1
					province = 4823
					instant_build = yes
				}
			}

			SIK = { add_ideas = SOV_expanded_exploitation_of_gold_mines }
		}
	}
}

# SOV-SINKIANG - Military Aid (Mil in Urumqui + Infra, Air Base and Forts in Kunlun Shan + Forts in Dabancheng) - Event for SIK
country_event = {
	id = NSB_soviet_foreign_politics_events.278
	title = NSB_soviet_foreign_politics_events.278.t
	desc = NSB_soviet_foreign_politics_events.278.desc
	picture = GFX_report_event_SOV_purge_aircraft_2

	is_triggered_only = yes
			
	option = { # OK
		name = NSB_soviet_foreign_politics_events.278.a

		ai_chance = {
			base = 3
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 2
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				SOV = { has_idea = SOV_vyacheslav_molotov }
			}
		}
		
		FROM = {
			add_opinion_modifier = {
				target = ROOT
				modifier = SOV_complied_with_our_demands
			}

			add_to_variable = { SOV_fyp_consumer_goods_factor = -0.01 }
			custom_effect_tooltip = SOV_sinikiang_influence_cg_tt_sik

			SOV = {
				send_equipment = {
					type = small_plane_airframe
					amount = 40
					target = ROOT
				}
				send_equipment = {
					type = infantry_equipment
					amount = 500
					target = ROOT
				}
			}

			effect_tooltip = {
				custom_effect_tooltip = SOV_sinkiang_when_project_finishes_tt
				
				617 = { #URUMQI - Mil
					if = {
						limit = {
							free_building_slots = {
								building = arms_factory
								size > 0
								include_locked = yes
							}
						}
						add_extra_state_shared_building_slots = 1
						add_building_construction = {
							type = arms_factory
							level = 1
							instant_build = yes
						}
					}
				}
				759 = { #KUNLUN SHAN - Infra + Air base + Forts
					if = {
						limit = {
							infrastructure < 5
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes
						}
					}
					if = {
						limit = {
							air_base < 9
						}
						add_building_construction = {
							type = air_base
							level = 2
							instant_build = yes
						}
					}
					else_if = {
						limit = {
							air_base < 10
						}
						add_building_construction = {
							type = air_base
							level = 1
							instant_build = yes
						}
					}
					add_building_construction = {
						type = bunker
						level = 1
						province = {
							id = 10315
							id = 2074
							id = 1698
							id = 4947
						}
						instant_build = yes
					}
				}
				if = {  #DABANCHENG - Forts
					limit = {
						has_full_control_of_state = 760
					}
					760 = {
						add_building_construction = {
							type = bunker
							level = 1
							province = {
								id = 1838
								id = 4843
							}
							instant_build = yes
						}
					}
				}
				add_tech_bonus = {
					name = NSB_soviet_foreign_politics_events.278.t
					bonus = 1
					uses = 2
					category = air_equipment
				}
				air_experience = 50
				army_experience = 50
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = NSB_soviet_foreign_politics_events.279 hours = 1 } }
			activate_mission = SOV_sinkiang_military_aid_mission_dummy
		}
	}

	option = { # Nope
		name = NSB_soviet_foreign_politics_events.278.b

		ai_chance = {
			base = 0
			modifier = {
				add = 1
				has_opinion = {
					target = FROM
					value < -50
				}
			}
			modifier = {
				add = 1
				is_in_faction = yes
				NOT = { is_in_faction_with = SOV }
			}
			modifier = {
				add = 5
				FROM = { is_justifying_wargoal_against = ROOT }
			}
			modifier = {
				add = 10
				is_subject = yes
				NOT = { is_subject_of = SOV }
			}
		}
	
		effect_tooltip = {
			FROM = {
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_rejected_our_demands
				}
			}
		}

		FROM = {
			country_event = { id = NSB_soviet_foreign_politics_events.275 hours = 1 }
			set_country_flag = SOV_sinkiang_military_aid_rejected_flag
		}
		custom_effect_tooltip = germany.126.warning
	}
}

# SOV-SINKIANG - Sinkiang accepts our proposal (Military Aid) - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.279
	title = NSB_soviet_foreign_politics_events.279.t
	desc = NSB_soviet_foreign_politics_events.279.desc
	picture = GFX_report_event_SOV_purge_aircraft_2

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_foreign_politics_events.279.a

		ai_chance = {
			base = 1
		}

		effect_tooltip = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_complied_with_our_demands
			}

			custom_effect_tooltip = SOV_sinikiang_influence_cg_tt_sov

			send_equipment = {
				type = small_plane_airframe
				amount = 40
				target = SIK
			}
			send_equipment = {
				type = infantry_equipment
				amount = 500
				target = SIK
			}

			custom_effect_tooltip = SOV_sinkiang_when_project_finishes_tt
			617 = { #URUMQI - Mil
				if = {
					limit = {
						free_building_slots = {
							building = arms_factory
							size > 0
							include_locked = yes
						}
					}
					add_extra_state_shared_building_slots = 1
					add_building_construction = {
						type = arms_factory
						level = 1
						instant_build = yes
					}
				}
			}
			759 = { #KUNLUN SHAN - Infra + Air base + Forts
				if = {
					limit = {
						infrastructure < 5
					}
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes
					}
				}
				if = {
					limit = {
						air_base < 9
					}
					add_building_construction = {
						type = air_base
						level = 2
						instant_build = yes
					}
				}
				else_if = {
					limit = {
						air_base < 10
					}
					add_building_construction = {
						type = air_base
						level = 1
						instant_build = yes
					}
				}
				add_building_construction = {
					type = bunker
					level = 1
					province = {
						id = 10315
						id = 2074
						id = 1698
						id = 4947
					}
					instant_build = yes
				}
			}
			if = {  #DABANCHENG - Forts
				limit = {
					SIK = { has_full_control_of_state = 760 }
				}
				760 = {
					add_building_construction = {
						type = bunker
						level = 1
						province = {
							id = 1838
							id = 4843
						}
						instant_build = yes
					}
				}
			}
			SIK = {
				add_tech_bonus = {
					name = NSB_soviet_foreign_politics_events.278.t
					bonus = 1
					uses = 2
					category = air_equipment
				}
				air_experience = 50
				army_experience = 50
			}
		}
	}
}

# SOV-SINKIANG - Support Expansion (in XSM) (Infra and Forts in various XSM states + Air Base in Gansu + Oil in Jiuquan) - Event for SIK
country_event = {
	id = NSB_soviet_foreign_politics_events.280
	title = NSB_soviet_foreign_politics_events.280.t
	desc = NSB_soviet_foreign_politics_events.280.desc
	picture = GFX_report_event_generic_truck

	is_triggered_only = yes
			
	option = { # OK
		name = NSB_soviet_foreign_politics_events.280.a

		ai_chance = {
			base = 3
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 2
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				SOV = { has_idea = SOV_vyacheslav_molotov }
			}
		}
		
		FROM = {
			add_opinion_modifier = {
				target = ROOT
				modifier = SOV_complied_with_our_demands
			}

			SOV = {
				send_equipment = {
					type = motorized_equipment
					amount = 300
					target = ROOT
				}
			}

			add_to_variable = { SOV_fyp_consumer_goods_factor = -0.01 }
			custom_effect_tooltip = SOV_sinikiang_influence_cg_tt_sik

			effect_tooltip = {
				custom_effect_tooltip = SOV_sinkiang_when_project_finishes_tt
				
				755 = { #HAIXI - Infra
					if = {
						limit = {
							infrastructure < 5
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes
						}
					}
				}
				756 = { #JIUQUAN - Infra + Oil
					if = {
						limit = {
							infrastructure < 5
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes
						}
					}
					add_resource = {
						type = oil
						amount = 12
					}
				}
				604 = { #QINGHAI (Golmud) - Infra 
					if = {
						limit = {
							infrastructure < 5
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes
						}
					}
					add_building_construction = {
						type = bunker
						level = 1
						province = {
							id = 7940
						}
						instant_build = yes
					}
				}
				754 = { #GOLOG (Lanzhou) - Infra
					if = {
						limit = {
							infrastructure < 5
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes
						}
					}
					add_building_construction = {
						type = bunker
						level = 1
						province = {
							id = 12732
						}
						instant_build = yes
					}
				}
				283 = { #GANSU - Infra + Air Base + Fort
					if = {
						limit = {
							infrastructure < 5
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes
						}
					}
					if = {
						limit = {
							air_base < 9
						}
						add_building_construction = {
							type = air_base
							level = 2
							instant_build = yes
						}
					}
					else_if = {
						limit = {
							air_base < 10
						}
						add_building_construction = {
							type = air_base
							level = 1
							instant_build = yes
						}
					}
					add_building_construction = {
						type = bunker
						level = 1
						province = {
							id = 531
						}
						instant_build = yes
					}
				}
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = NSB_soviet_foreign_politics_events.281 hours = 1 } }
			activate_mission = SOV_sinkiang_support_expansion_mission_dummy
		}
	}

	option = { # Nope
		name = NSB_soviet_foreign_politics_events.280.b

		ai_chance = {
			base = 0
			modifier = {
				add = 1
				has_opinion = {
					target = FROM
					value < -50
				}
			}
			modifier = {
				add = 1
				is_in_faction = yes
				NOT = { is_in_faction_with = SOV }
			}
			modifier = {
				add = 5
				FROM = { is_justifying_wargoal_against = ROOT }
			}
			modifier = {
				add = 10
				is_subject = yes
				NOT = { is_subject_of = SOV }
			}
		}
	
		effect_tooltip = {
			FROM = {
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_rejected_our_demands
				}
			}
		}

		FROM = {
			country_event = { id = NSB_soviet_foreign_politics_events.275 hours = 1 }
			set_country_flag = SOV_sinkiang_support_expansion_rejected_flag
		}
	}
}

# SOV-SINKIANG - Sinkiang accepts our proposal (Support Territorial Expansion) - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.281
	title = NSB_soviet_foreign_politics_events.281.t
	desc = NSB_soviet_foreign_politics_events.281.desc
	picture = GFX_report_event_generic_truck

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_foreign_politics_events.281.a

		ai_chance = {
			base = 1
		}

		effect_tooltip = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_complied_with_our_demands
			}

			send_equipment = {
				type = motorized_equipment
				amount = 300
				target = SIK
			}

			custom_effect_tooltip = SOV_sinikiang_influence_cg_tt_sov

			custom_effect_tooltip = SOV_sinkiang_when_project_finishes_tt
			
			755 = { #HAIXI - Infra
				if = {
					limit = {
						infrastructure < 5
					}
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes
					}
				}
			}
			756 = { #JIUQUAN - Infra + Oil
				if = {
					limit = {
						infrastructure < 5
					}
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes
					}
				}
				add_resource = {
					type = oil
					amount = 12
				}
			}
			604 = { #QINGHAI (Golmud) - Infra 
				if = {
					limit = {
						infrastructure < 5
					}
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes
					}
				}
				add_building_construction = {
					type = bunker
					level = 1
					province = {
						id = 7940
					}
					instant_build = yes
				}
			}
			754 = { #GOLOG (Lanzhou) - Infra
				if = {
					limit = {
						infrastructure < 5
					}
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes
					}
				}
				add_building_construction = {
					type = bunker
					level = 1
					province = {
						id = 12732
					}
					instant_build = yes
				}
			}
			283 = { #GANSU - Infra + Air Base + Fort
				if = {
					limit = {
						infrastructure < 5
					}
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes
					}
				}
				if = {
					limit = {
						air_base < 9
					}
					add_building_construction = {
						type = air_base
						level = 2
						instant_build = yes
					}
				}
				else_if = {
					limit = {
						air_base < 10
					}
					add_building_construction = {
						type = air_base
						level = 1
						instant_build = yes
					}
				}
				add_building_construction = {
					type = bunker
					level = 1
					province = {
						id = 531
					}
					instant_build = yes
				}
			}
		}
	}
}

# SOV-SINKIANG - Formalize the Soviet Republic of Sinkiang (aka puppet Sinkiang)- Event for SIK
country_event = {
	id = NSB_soviet_foreign_politics_events.282
	title = NSB_soviet_foreign_politics_events.282.t
	desc = NSB_soviet_foreign_politics_events.282.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes
			
	option = { # Accept
		name = NSB_soviet_foreign_politics_events.282.a

		ai_chance = {
			base = 1
		}

		add_political_power = 75
		SOV = {
			puppet = ROOT

			add_opinion_modifier = {
				target = ROOT
				modifier = SOV_complied_with_our_demands
			}
		}

		FROM = {
			country_event = { id = NSB_soviet_foreign_politics_events.283 hours = 1 }
		}
	}

	option = { # Refuse
		name = NSB_soviet_foreign_politics_events.282.b

		ai_chance = {
			base = 0
		}

		effect_tooltip = {
			SOV = {
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_rejected_our_demands
				}
				country_event = { id = NSB_soviet_foreign_politics_events.284 hours = 1 }
			}
			custom_effect_tooltip = germany.126.warning
		}
	}
}

# SOV-SINKIANG - Sinkiang becomes a puppet - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.283
	title = NSB_soviet_foreign_politics_events.283.t
	desc = NSB_soviet_foreign_politics_events.283.desc
	picture = GFX_report_event_stalin_propaganda

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_foreign_politics_events.283.a

		effect_tooltip = {
			puppet = FROM
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_complied_with_our_demands
			}
			FROM = { add_political_power = 75 }
		}		
	}
}

# SOV-SINKIANG - Sinkiang refuses to become a puppet - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.284
	title = NSB_soviet_foreign_politics_events.284.t
	desc = NSB_soviet_foreign_politics_events.284.desc
	picture = GFX_report_event_stalin_meeting

	is_triggered_only = yes
			
	option = { # Respect
		name = NSB_soviet_foreign_politics_events.284.a

		ai_chance = {
			base = 2
			modifier = {
				add = -1
				has_war = yes
			}
		}

		add_opinion_modifier = {
			target = FROM
			modifier = SOV_rejected_our_demands
		}
	}

	option = { # Unacceptable
		name = NSB_soviet_foreign_politics_events.284.b

		trigger = {
			is_faction_leader = yes
		}

		ai_chance = {
			base = 0
		}
	
		add_opinion_modifier = {
			target = FROM
			modifier = SOV_rejected_our_demands
		}

		remove_from_faction = FROM
		create_wargoal = {
			type = take_state_focus
			target = FROM
			expire = 0
			generator = { 618 617 287 619 759 760 }
		}
		add_named_threat = { threat = 2 name = SOV_claim_on_sinkiang_threat }
	}
}

# SOV-SINKIANG - Soviet Union is losing and we might need new friends - Event for SIK (triggered via MTTH)
country_event = {
	id = NSB_soviet_foreign_politics_events.285
	title = NSB_soviet_foreign_politics_events.285.t
	desc = NSB_soviet_foreign_politics_events.285.desc
	picture = GFX_report_event_soviet_tanks_snow

	fire_only_once = yes

	trigger = {
		original_tag = SIK
		OR = {
			is_in_faction_with = SOV
			is_subject_of = SOV
		}
		SOV = {
			has_completed_focus = SOV_the_gobi_gambit
			surrender_progress > 0.5
		}
		OR = {
			AND = {
				country_exists = PRC
				PRC = { is_subject = no }
				NOT = { has_war_with = PRC }
			}
			AND = {
				country_exists = CHI
				CHI = { is_subject = no }
				NOT = { has_war_with = CHI }
			}
		}
	}

	mean_time_to_happen = {
		days = 180
		modifier = {
			factor = 2
			has_full_control_of_state = 604 #GOLMUD (XSM)
		}
		modifier = {
			factor = 2
			has_full_control_of_state = 622 #YAN'AN (PRC)
		}
		modifier = {
			factor = 2
			has_full_control_of_state = 615 #TAIYUAN (SHX)
		}
		modifier = {
			factor = 2
			has_full_control_of_state = 613 # NANJING (CHI)
		}
		modifier = {
			factor = 2
			has_full_control_of_state = 325 # KUNMING (YUN)
		}
		modifier = {
			factor = 2
			has_full_control_of_state = 594 #NANNING (GXC)
		}
		modifier = {
			factor = 2
			has_full_control_of_state = 611 #ZHANGBEI (MEN)
		}
		modifier = {
			factor = 2
			has_full_control_of_state = 328 #HSINKING (MAN)
		}
	}
			
	option = { # Stay with the Soviets
		name = NSB_soviet_foreign_politics_events.285.a

		ai_chance = {
			base = 2
			modifier = {
				factor = 2
				has_war = yes
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > 50
				}
			}
			modifier = {
				factor = 0.5
				is_subject = no
			}
		}

		if = {
			limit = {
				is_subject_of = SOV
			}
			effect_tooltip = {
				add_autonomy_score = {
					value = 500
					localization = NSB_soviet_foreign_politics_events.286.t
				}
			}
			hidden_effect = {
				SOV = { country_event = { id = NSB_soviet_foreign_politics_events.286 hours = 1 } }
			}
		}
	}

	option = { # Time to flee!
		name = NSB_soviet_foreign_politics_events.285.b

		trigger = {
			is_subject = no
		}

		ai_chance = {
			base = 2
		}

		hidden_effect = {
			SOV = {
				add_ai_strategy = {
					type = befriend
					id = SIK			
					value = -200
				}
				add_ai_strategy = {
					type = alliance
					id = SIK		
					value = -200
				}
				if = {
					limit = {
						has_war = no
					}
					add_ai_strategy = {
						type = antagonize
						id = SIK		
						value = 100
					}
				}
				else = {
					add_ai_strategy = {
						type = antagonize
						id = SIK		
						value = 25
					}
				}
			}
			add_ai_strategy = {
				type = befriend
				id = SOV			
				value = -100
			}
			add_ai_strategy = {
				type = alliance
				id = SOV			
				value = -100
			}
			if = {
				limit = {
					CHI = { is_faction_leader = yes }
					NOT = { has_war_with = CHI }	
				}
				add_ai_strategy = {
					type = alliance
					id = CHI		
					value = 100
				}
			}
			if = {
				limit = {
					PRC = { is_faction_leader = yes }
					NOT = { has_war_with = PRC }	
				}
				add_ai_strategy = {
					type = alliance
					id = PRC		
					value = 100
				}
			}
			if = {
				limit = {
					XSM = { is_faction_leader = yes }
					NOT = { has_war_with = XSM }	
				}
				add_ai_strategy = {
					type = alliance
					id = XSM		
					value = 100
				}
			}
			if = {
				limit = {
					SHX = { is_faction_leader = yes }
					NOT = { has_war_with = SHX }	
				}
				add_ai_strategy = {
					type = alliance
					id = SHX		
					value = 100
				}
			}
			if = {
				limit = {
					YUN = { is_faction_leader = yes }
					NOT = { has_war_with = YUN }	
				}
				add_ai_strategy = {
					type = alliance
					id = YUN		
					value = 100
				}
			}
			if = {
				limit = {
					GXC = { is_faction_leader = yes }
					NOT = { has_war_with = GXC }	
				}
				add_ai_strategy = {
					type = alliance
					id = GXC		
					value = 100
				}
			}
		}

		#Break all previous agreements with the Comintern
		every_other_country = {
			limit = {
				is_in_faction_with = ROOT
			}
			if = {
				limit = {
					has_guaranteed = ROOT
				}
				diplomatic_relation = {
					country = ROOT
					relation = guarantee
					active = no
				}
			}
			if = {
				limit = {
					is_guaranteed_by = ROOT
				}
				ROOT = {
					diplomatic_relation = {
						country = PREV
						relation = guarantee
						active = no
					}
				}
			}
			if = {
				limit = {
					has_non_aggression_pact_with = ROOT
				}
				diplomatic_relation = {
					country = ROOT
					relation = non_aggression_pact
					active = no
				}
			}
			if = {
				limit = {
					has_military_access_to = ROOT
				}
				diplomatic_relation = {
					country = ROOT
					relation = military_access
					active = no
				}
			}
			if = {
				limit = {
					gives_military_access_to = ROOT
				}
				ROOT = {
					diplomatic_relation = {
						country = PREV
						relation = military_access
						active = no
					}
				}
			}
		}

		leave_faction = yes

		remove_resource_rights = 618
	
		SOV = {
			add_opinion_modifier = {
				target = ROOT
				modifier = betrayed_alliance
			}
		}

		SOV = { country_event = { id = NSB_soviet_foreign_politics_events.287 hours = 1 } }
		custom_effect_tooltip = germany.126.warning
	}
}

# SOV-SINKIANG - Sinkiang loses autonomy - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.286
	title = NSB_soviet_foreign_politics_events.286.t
	desc = NSB_soviet_foreign_politics_events.286.desc
	picture = GFX_report_event_soviet_tanks_snow

	is_triggered_only = yes
			
	option = { # Nothing to do
		name = NSB_soviet_foreign_politics_events.286.a

		ai_chance = {
			base = 1
		}

		FROM = {
			add_autonomy_score = {
				value = 500
				localization = NSB_soviet_foreign_politics_events.286.t
			}
		}
	}

	option = { # Talk to them
		name = NSB_soviet_foreign_politics_events.286.b

		trigger = {
			has_political_power > 74
		}

		ai_chance = {
			base = 0
		}

		add_political_power = -75
		FROM = {
			add_autonomy_score = {
				value = 250
				localization = NSB_soviet_foreign_politics_events.286.t
			}
		}
	}
}

# SOV-SINKIANG - Sinkiang leaves faction - Event for SOV
country_event = {
	id = NSB_soviet_foreign_politics_events.287
	title = NSB_soviet_foreign_politics_events.287.t
	desc = NSB_soviet_foreign_politics_events.287.desc
	picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes
			
	option = { # Don't care
		name = NSB_soviet_foreign_politics_events.287.a

		ai_chance = {
			base = 2
			modifier = {
				factor = 2
				has_war = yes
			}
		}

		effect_tooltip = {
			FROM = { leave_faction = yes }
			remove_resource_rights = 618
		
			add_opinion_modifier = {
				target = FROM
				modifier = betrayed_alliance
			}
		}
	}

	option = { # Make them pay!
		name = NSB_soviet_foreign_politics_events.287.b

		ai_chance = {
			base = 2
			modifier = {
				factor = 2
				has_country_flag = SOV_sinkiang_prospection_flag
			}
			modifier = {
				factor = 2
				has_country_flag = SOV_sinkiang_oil_prospection_flag
			}
			modifier = {
				factor = 2
				has_country_flag = SOV_sinkiang_military_aid_flag
			}
			modifier = {
				factor = 2
				has_country_flag = SOV_sinkiang_support_expansion_flag
			}
		}
		
		effect_tooltip = {
			FROM = { leave_faction = yes }
			remove_resource_rights = 618
		
			add_opinion_modifier = {
				target = FROM
				modifier = betrayed_alliance
			}
		}

		create_wargoal = {
			type = take_state_focus
			target = FROM
			expire = 0
			generator = { 618 617 287 619 759 760 }
		}
	}
}


 ######   #######  ##     ##          ######   ######## ########     ######## ########     ###    ########  ########       ###     ######   ########  ######## ######## ##     ## ######## ##    ## ######## 
##    ## ##     ## ##     ##         ##    ##  ##       ##     ##       ##    ##     ##   ## ##   ##     ## ##            ## ##   ##    ##  ##     ## ##       ##       ###   ### ##       ###   ##    ##    
##       ##     ## ##     ##         ##        ##       ##     ##       ##    ##     ##  ##   ##  ##     ## ##           ##   ##  ##        ##     ## ##       ##       #### #### ##       ####  ##    ##    
 ######  ##     ## ##     ## ####### ##   #### ######   ########        ##    ########  ##     ## ##     ## ######      ##     ## ##   #### ########  ######   ######   ## ### ## ######   ## ## ##    ##    
      ## ##     ##  ##   ##          ##    ##  ##       ##   ##         ##    ##   ##   ######### ##     ## ##          ######### ##    ##  ##   ##   ##       ##       ##     ## ##       ##  ####    ##    
##    ## ##     ##   ## ##           ##    ##  ##       ##    ##        ##    ##    ##  ##     ## ##     ## ##          ##     ## ##    ##  ##    ##  ##       ##       ##     ## ##       ##   ###    ##    
 ######   #######     ###             ######   ######## ##     ##       ##    ##     ## ##     ## ########  ########    ##     ##  ######   ##     ## ######## ######## ##     ## ######## ##    ##    ##    


# Soviet-German Trade Agreement - Event for GER
country_event = {
	id = NSB_soviet_soviet_german_trade_agreement.1
	title = NSB_soviet_soviet_german_trade_agreement.1.t
	desc = NSB_soviet_soviet_german_trade_agreement.1.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes
			
	option = { # Accept -> This will also make GER more likely to take Molotov-Ribbentrop pact and less to take Anti-Soviet Pact
		name = NSB_soviet_soviet_german_trade_agreement.1.a

		ai_chance = {
			base = 5
			modifier = {
				factor = 10
				has_war = yes
			}
			modifier = {
				factor = 10
				has_war_with = ENG
			}
			modifier = {
				factor = 10
				has_completed_focus = GER_molotov_ribbentrop_pact
			}
			modifier = {
				factor = 10
				has_completed_focus = GER_alliance_with_the_ussr
			}
			modifier = {
				factor = 0.1
				has_completed_focus = GER_anti_comintern_pact
			}
			modifier = {
				factor = 0
				OR = {
					has_war_with = FROM
					is_justifying_wargoal_against = FROM
					has_completed_focus = GER_anti_soviet_pact
					has_completed_focus = GER_war_with_the_ussr
				}
			}
		}

		add_timed_idea = { idea = SOV_soviet_german_trade_agreement days = 545 } #Technically 1 year but really 18 months for Soviet payment 
		set_variable = { SOV_capital_for_soviet_imports = ROOT.capital } #Store capital where the dynamic modifier is set so that it can be removed easily later
		capital_scope = {
			add_dynamic_modifier = { modifier = SOV_soviet_imports }
		}

		#Effects to Soviets
		effect_tooltip = {
			FROM = {
				if = {
					limit = {
						has_dlc = "Man the Guns"
					}
					if = {
						limit = {
							NOT = { has_tech = basic_ship_hull_cruiser }
						}
						set_technology = { basic_ship_hull_cruiser = 1 }
					}
					if = {
						limit = {
							NOT = { has_tech = basic_cruiser_armor_scheme }
						}
						set_technology = { basic_cruiser_armor_scheme = 1 }
					}
					if = {
						limit = {
							has_tech = basic_medium_battery
						}
						create_equipment_variant = {
							name = "Hipper Class"
							type = ship_hull_cruiser_2
							name_group = SOV_CA_HISTORICAL
							parent_version = 0
							allow_without_tech = yes #Makes no difference since event grants appropriate tech (above), but it improves tooltip
							modules = {
								fixed_ship_battery_slot = ship_medium_battery_2
								fixed_ship_anti_air_slot = ship_anti_air_1
								fixed_ship_fire_control_system_slot = ship_fire_control_system_0
								fixed_ship_radar_slot = empty
								fixed_ship_engine_slot = cruiser_ship_engine_1
								fixed_ship_secondaries_slot = empty
								fixed_ship_armor_slot = ship_armor_cruiser_2
								front_1_custom_slot = ship_anti_air_1
								mid_1_custom_slot = ship_torpedo_1
								mid_2_custom_slot = ship_airplane_launcher_1
								rear_1_custom_slot = ship_medium_battery_2
							}
						}
					}
					else = {
						create_equipment_variant = {
							name = "Hipper Class"
							type = ship_hull_cruiser_2
							name_group = SOV_CA_HISTORICAL
							parent_version = 0
							allow_without_tech = yes #Makes no difference since event grants appropriate tech (above), but it improves tooltip
							modules = {
								fixed_ship_battery_slot = ship_medium_battery_1
								fixed_ship_anti_air_slot = ship_anti_air_1
								fixed_ship_fire_control_system_slot = ship_fire_control_system_0
								fixed_ship_radar_slot = empty
								fixed_ship_engine_slot = cruiser_ship_engine_1
								fixed_ship_secondaries_slot = empty
								fixed_ship_armor_slot = ship_armor_cruiser_2
								front_1_custom_slot = ship_anti_air_1
								mid_1_custom_slot = ship_torpedo_1
								mid_2_custom_slot = ship_airplane_launcher_1
								rear_1_custom_slot = ship_medium_battery_1
							}
						}
					}
					
					# CA: Lützow -> Petropavlovsk
					add_equipment_production = {
						equipment = {
							type = ship_hull_cruiser_2
							creator = "SOV"
							version_name = "Hipper Class"
						}
						name = "Petropavlovsk"
						requested_factories = 1
						progress = 0.5
						amount = 1
					}

					add_tech_bonus = {
						name = NSB_soviet_soviet_german_trade_agreement.1.t
						bonus = 0.5
						uses = 2
						category = ship_modules_tech
						category = bb_tech
						category = dd_tech
					}
				}
				else = { #No MTG
					if = {
						limit = {
							NOT = { has_tech = basic_heavy_cruiser }
						}
						set_technology = { basic_heavy_cruiser = 1 }
					}
					create_equipment_variant = {
						name = "Hipper Class"
						type = heavy_cruiser_2
						parent_version = 0
						allow_without_tech = yes #Makes no difference since event grants appropriate tech (above), but it improves tooltip
						upgrades = {
							ship_reliability_upgrade = 1
							ship_engine_upgrade = 1
							ship_armor_upgrade = 2
							ship_gun_upgrade = 2
						}
					}

					add_equipment_production = {
						equipment = {
							type = heavy_cruiser_2
							creator = "SOV"
						}
						requested_factories = 1
						progress = 0.5
						amount = 1
					}

					add_tech_bonus = {
						name = NSB_soviet_soviet_german_trade_agreement.1.t
						bonus = 0.5
						uses = 2
						category = ca_tech
						category = bb_tech
						category = dd_tech
					}
				}

				add_tech_bonus = {
					name = NSB_soviet_soviet_german_trade_agreement.1.t
					bonus = 0.5
					uses = 2
					category = air_equipment
				}
			}
		}

		add_opinion_modifier = {
			target = FROM
			modifier = SOV_strengthened_relations_with_us
		}
		FROM = {
			add_opinion_modifier = {
				target = ROOT
				modifier = SOV_strengthened_relations_with_us
			}
		}
		hidden_effect = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_strengthened_relations_with_us_trade
			}
			FROM = {
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_strengthened_relations_with_us_trade
				}
			}
		}
		FROM = { country_event = { id = NSB_soviet_soviet_german_trade_agreement.2 hours = 1 } }
	}

	option = { # Refuse
		name = NSB_soviet_soviet_german_trade_agreement.1.b

		ai_chance = {
			base = 1
		}

		FROM = {
			country_event = { id = NSB_soviet_soviet_german_trade_agreement.3 hours = 1 }
			add_opinion_modifier = {
				target = ROOT
				modifier = SOV_rejected_our_demands
			}
		}
	}
}

# Soviet-German Trade Agreement - GER Accepts - Event for SOV
country_event = {
	id = NSB_soviet_soviet_german_trade_agreement.2
	title = NSB_soviet_soviet_german_trade_agreement.2.t
	desc = NSB_soviet_soviet_german_trade_agreement.2.desc
	picture = GFX_report_event_molotov_ribentrop_handshake

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_soviet_german_trade_agreement.2.a

		if = {
			limit = {
				has_dlc = "Man the Guns"
			}
			if = {
				limit = {
					NOT = { has_tech = basic_ship_hull_cruiser }
				}
				set_technology = { basic_ship_hull_cruiser = 1 }
			}
			if = {
				limit = {
					NOT = { has_tech = basic_cruiser_armor_scheme }
				}
				set_technology = { basic_cruiser_armor_scheme = 1 }
			}
			if = {
				limit = {
					has_tech = basic_medium_battery
				}
				create_equipment_variant = {
					name = "Hipper Class"
					type = ship_hull_cruiser_2
					name_group = SOV_CA_HISTORICAL
					parent_version = 0
					allow_without_tech = yes #Makes no difference since event grants appropriate tech (above), but it improves tooltip
					modules = {
						fixed_ship_battery_slot = ship_medium_battery_2
						fixed_ship_anti_air_slot = ship_anti_air_1
						fixed_ship_fire_control_system_slot = ship_fire_control_system_0
						fixed_ship_radar_slot = empty
						fixed_ship_engine_slot = cruiser_ship_engine_1
						fixed_ship_secondaries_slot = empty
						fixed_ship_armor_slot = ship_armor_cruiser_2
						front_1_custom_slot = ship_anti_air_1
						mid_1_custom_slot = ship_torpedo_1
						mid_2_custom_slot = ship_airplane_launcher_1
						rear_1_custom_slot = ship_medium_battery_2
					}
				}
			}
			else = {
				create_equipment_variant = {
					name = "Hipper Class"
					type = ship_hull_cruiser_2
					name_group = SOV_CA_HISTORICAL
					parent_version = 0
					allow_without_tech = yes #Makes no difference since event grants appropriate tech (above), but it improves tooltip
					modules = {
						fixed_ship_battery_slot = ship_medium_battery_1
						fixed_ship_anti_air_slot = ship_anti_air_1
						fixed_ship_fire_control_system_slot = ship_fire_control_system_0
						fixed_ship_radar_slot = empty
						fixed_ship_engine_slot = cruiser_ship_engine_1
						fixed_ship_secondaries_slot = empty
						fixed_ship_armor_slot = ship_armor_cruiser_2
						front_1_custom_slot = ship_anti_air_1
						mid_1_custom_slot = ship_torpedo_1
						mid_2_custom_slot = ship_airplane_launcher_1
						rear_1_custom_slot = ship_medium_battery_1
					}
				}
			}
			
			# CA: Lützow -> Petropavlovsk
			add_equipment_production = {
				equipment = {
					type = ship_hull_cruiser_2
					creator = "SOV"
					version_name = "Hipper Class"
				}
				name = "Petropavlovsk"
				requested_factories = 1
				progress = 0.5
				amount = 1
			}

			add_tech_bonus = {
				name = NSB_soviet_soviet_german_trade_agreement.1.t
				bonus = 0.5
				uses = 2
				category = ship_modules_tech
				category = bb_tech
				category = dd_tech
			}			
		}
		else = { #No MTG
			if = {
				limit = {
					NOT = { has_tech = basic_heavy_cruiser }
				}
				set_technology = { basic_heavy_cruiser = 1 }
			}
			create_equipment_variant = {
				name = "Hipper Class"
				type = heavy_cruiser_2
				parent_version = 0
				allow_without_tech = yes #Makes no difference since event grants appropriate tech (above), but it improves tooltip
				upgrades = {
					ship_reliability_upgrade = 1
					ship_engine_upgrade = 1
					ship_armor_upgrade = 2
					ship_gun_upgrade = 2
				}
			}

			add_equipment_production = {
				equipment = {
					type = heavy_cruiser_2
					creator = "SOV"
				}
				requested_factories = 1
				progress = 0.5
				amount = 1
			}

			add_tech_bonus = {
				name = NSB_soviet_soviet_german_trade_agreement.1.t
				bonus = 0.5
				uses = 2
				category = ca_tech
				category = bb_tech
				category = dd_tech
			}
		}

		add_tech_bonus = {
			name = NSB_soviet_soviet_german_trade_agreement.1.t
			bonus = 0.5
			uses = 2
			category = air_equipment
		}

		#Effects to Germans
		effect_tooltip = {
			FROM = {
				add_timed_idea = { idea = SOV_soviet_german_trade_agreement days = 545 } #Technically 1 year but really 18 months for Soviet payment 
				capital_scope = {
					add_dynamic_modifier = { modifier = SOV_soviet_imports }
				}
			}

			add_opinion_modifier = {
				target = FROM
				modifier = SOV_strengthened_relations_with_us
			}
			FROM = {
				add_opinion_modifier = {
					target = ROOT
					modifier = SOV_strengthened_relations_with_us
				}
			}
		}
		hidden_effect = { news_event = { id = nsb_news.103 days = 1 } }
	}
}

# Soviet-German Trade Agreement - GER Refuses - Event for SOV
country_event = {
	id = NSB_soviet_soviet_german_trade_agreement.3
	title = NSB_soviet_soviet_german_trade_agreement.3.t
	desc = NSB_soviet_soviet_german_trade_agreement.3.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes
			
	option = { # Damn
		name = NSB_soviet_soviet_german_trade_agreement.3.a

		effect_tooltip = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_rejected_our_demands
			}
		}
	}
}


 ######   #######  ##       ##       ########  ######  ######## #### ##     ## ########     ######  ########  ######  ##     ## ########  #### ######## ##    ## 
##    ## ##     ## ##       ##       ##       ##    ##    ##     ##  ##     ## ##          ##    ## ##       ##    ## ##     ## ##     ##  ##     ##     ##  ##  
##       ##     ## ##       ##       ##       ##          ##     ##  ##     ## ##          ##       ##       ##       ##     ## ##     ##  ##     ##      ####   
##       ##     ## ##       ##       ######   ##          ##     ##  ##     ## ######       ######  ######   ##       ##     ## ########   ##     ##       ##    
##       ##     ## ##       ##       ##       ##          ##     ##   ##   ##  ##                ## ##       ##       ##     ## ##   ##    ##     ##       ##    
##    ## ##     ## ##       ##       ##       ##    ##    ##     ##    ## ##   ##          ##    ## ##       ##    ## ##     ## ##    ##   ##     ##       ##    
 ######   #######  ######## ######## ########  ######     ##    ####    ###    ########     ######  ########  ######   #######  ##     ## ####    ##       ##    


# Policies of Collective Security - SOV offers Mutual Assitance - Event for FRA
country_event = {
	id = NSB_soviet_policies_of_collective_security.1
	title = NSB_soviet_policies_of_collective_security.1.t
	desc = NSB_soviet_policies_of_collective_security.1.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes
			
	option = { # Accept
		name = NSB_soviet_policies_of_collective_security.1.a

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				OR = {
					has_government = democratic
					has_government = communism
				}
			}
			modifier = {
				factor = 2
				OR ={
					has_completed_focus = FRA_radicalize_front
					has_completed_focus = FRA_support_blum
				}
				
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > 50
				}
			}
			modifier = {
				factor = 1.5
				has_opinion = {
					target = FROM
					value > 90
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = {
				factor = 0
				OR = {
					has_wargoal_against = SOV
					AND = {
						is_subject = yes
						NOT = { is_subject_of = SOV }
					}
					has_completed_focus = FRA_far_right_leagues
					has_completed_focus = FRA_action_francaise
					focus_progress = {
						focus = FRA_far_right_leagues
						progress > 0
					}
					focus_progress = {
						focus = FRA_action_francaise
						progress > 0
					}					
				}
			}
		}

		effect_tooltip = {
			SOV_clear_hostile_diplomacy_in_both_countries = yes #Clears wargoals and claims

			#SOV -> FRA
			FROM = {		
				diplomatic_relation = {
					country = ROOT
					relation = non_aggression_pact
					active = yes
				}
				give_guarantee = ROOT
				add_opinion_modifier = { 
					target = ROOT
					modifier = SOV_policies_of_collective_security_opinion
				}
			}

			#FRA -> SOV
			diplomatic_relation = {
				country = FROM
				relation = non_aggression_pact
				active = yes
			}
			give_guarantee = FROM
			add_opinion_modifier = { 
				target = FROM
				modifier = SOV_policies_of_collective_security_opinion
			}
		}

		FROM = { country_event = { id = NSB_soviet_policies_of_collective_security.2 hours = 8 random_hours = 4 } }
	}

	option = { # Conditions
		name = NSB_soviet_policies_of_collective_security.1.b

		ai_chance = {
			base = 10
			modifier = {
				factor = 4
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 1.5
				has_government = democratic
			}
			modifier = {
				factor = 1.5
				has_completed_focus = FRA_support_daladier
			}
			modifier = {
				factor = 1.5
				is_in_faction_with = ENG
				ENG = { has_government = democratic }
			}
			modifier = {
				factor = 4
				has_guaranteed = POL 
			}
			modifier = {
				factor = 0
				OR = {
					NOT = { country_exists = POL }
					POL = { has_capitulated = yes }
					has_completed_focus = FRA_far_right_leagues
					has_completed_focus = FRA_action_francaise
					focus_progress = {
						focus = FRA_far_right_leagues
						progress > 0
					}
					focus_progress = {
						focus = FRA_action_francaise
						progress > 0
					}
				}
			}
		}

		trigger = { #Only European countries care about Poland
			FROM = {
				var:SOV_collective_security_target = {
					capital_scope = { is_on_continent = europe }
				}
			}
		}

		FROM = { country_event = { id = NSB_soviet_policies_of_collective_security.4 hours = 8 random_hours = 4 } }

		effect_tooltip = {
			custom_effect_tooltip = NSB_soviet_policies_of_collective_security_agreed_effects_tt
			SOV_clear_hostile_diplomacy_in_both_countries = yes #Clears wargoals and claims

			#SOV -> FRA
			FROM = {		
				diplomatic_relation = {
					country = ROOT
					relation = non_aggression_pact
					active = yes
				}
				give_guarantee = ROOT
				add_opinion_modifier = { 
					target = ROOT
					modifier = SOV_policies_of_collective_security_opinion
				}
			}

			#FRA -> SOV
			diplomatic_relation = {
				country = FROM
				relation = non_aggression_pact
				active = yes
			}
			give_guarantee = FROM
			add_opinion_modifier = { 
				target = FROM
				modifier = SOV_policies_of_collective_security_opinion
			}

			custom_effect_tooltip = NSB_soviet_policies_of_collective_security_condition_effects_tt
		}
	}

	option = { # Nope
		name = NSB_soviet_policies_of_collective_security.1.c

		ai_chance = {
			base = 10
			modifier = {
				factor = 10
				has_completed_focus = FRA_far_right_leagues
				has_completed_focus = FRA_action_francaise
				focus_progress = {
					focus = FRA_far_right_leagues
					progress > 0
				}
				focus_progress = {
					focus = FRA_action_francaise
					progress > 0
				}
			}
			modifier = {
				factor = 0.1
				has_completed_focus = FRA_radicalize_front
			}
		}
		effect_tooltip = {
			FROM = {
				add_opinion_modifier = { 
					target = ROOT
					modifier = SOV_rejected_defensive_pact
				}
			}
		}

		FROM = { country_event = { id = NSB_soviet_policies_of_collective_security.3 hours = 8 random_hours = 4 } }
	}
}

# Policies of Collective Security - FRA accepts - Event for SOV
country_event = {
	id = NSB_soviet_policies_of_collective_security.2
	title = NSB_soviet_policies_of_collective_security.2.t
	desc = NSB_soviet_policies_of_collective_security.2.desc
	picture = GFX_report_event_worried_french

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_policies_of_collective_security.2.a

		SOV_apply_collective_ageement_on_mutual_assistance_effects_basic = yes

		FROM = { save_global_event_target_as = SOV_collective_security_pact_integrant }
		hidden_effect = { news_event = { id = nsb_news.102 days = 1 } } #Poland not Included
	}
}

# Policies of Collective Security - FRA refuses - Event for SOV
country_event = {
	id = NSB_soviet_policies_of_collective_security.3
	title = NSB_soviet_policies_of_collective_security.3.t
	desc = NSB_soviet_policies_of_collective_security.3.desc
	picture = GFX_report_event_worried_french

	is_triggered_only = yes
			
	option = { # OK
		name = NSB_soviet_policies_of_collective_security.3.a

		add_opinion_modifier = { 
			target = FROM
			modifier = SOV_rejected_defensive_pact
		}
	}
}

# Policies of Collective Security - FRA wants to include Poland - Event for SOV
country_event = {
	id = NSB_soviet_policies_of_collective_security.4
	title = NSB_soviet_policies_of_collective_security.4.t
	desc = NSB_soviet_policies_of_collective_security.4.desc
	picture = GFX_report_event_worried_french

	is_triggered_only = yes
			
	option = { # Consent
		name = NSB_soviet_policies_of_collective_security.4.a

		ai_chance = {
			base = 10
			modifier = {
				factor = 5
				has_opinion = {
					target = FROM
					value > 25
				}
			}
			modifier = {
				factor = 5
				has_opinion = {
					target = POL
					value > 25
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = {
				factor = 0
				OR = {
					has_wargoal_against = POL
					is_justifying_wargoal_against = POL
					has_opinion_modifier = MR_pact
					has_completed_focus = SOV_claims_on_poland
					focus_progress = {
						focus = SOV_claims_on_poland
						progress > 0
					}
				}
			}
		}

		FROM = { country_event = { id = NSB_soviet_policies_of_collective_security.6 hours = 8 random_hours = 4 } }

		custom_effect_tooltip = NSB_soviet_policies_of_collective_security_tt
	}

	option = { # No way Poland is being included here
		name = NSB_soviet_policies_of_collective_security.4.b

		ai_chance = {
			base = 10
		}

		custom_effect_tooltip = NSB_soviet_policies_of_collective_security_refusing_poland_inclusion_tt

		FROM = { country_event = { id = NSB_soviet_policies_of_collective_security.5 hours = 8 random_hours = 4 } }

		custom_effect_tooltip = NSB_soviet_policies_of_collective_security_agreed_effects_tt
		effect_tooltip = {
			SOV_apply_collective_ageement_on_mutual_assistance_effects_basic = yes
		}
	}
}

# Policies of Collective Security - SOV rejects Poland's inclusion - Event for FRA
country_event = {
	id = NSB_soviet_policies_of_collective_security.5
	title = NSB_soviet_policies_of_collective_security.5.t
	desc = NSB_soviet_policies_of_collective_security.5.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes
			
	option = { # Avanti without Poland
		name = NSB_soviet_policies_of_collective_security.5.a

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				has_government = communism
			}
			modifier = {
				factor = 2
				has_completed_focus = FRA_radicalize_front
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.25
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = {
				factor = 0
				OR = {
					has_completed_focus = FRA_far_right_leagues
					has_completed_focus = FRA_action_francaise
					focus_progress = {
						focus = FRA_far_right_leagues
						progress > 0
					}
					focus_progress = {
						focus = FRA_action_francaise
						progress > 0
					}
				}
			}
		}

		FROM = { country_event = { id = NSB_soviet_policies_of_collective_security.9 hours = 8 random_hours = 4 } }

		effect_tooltip = {
			SOV_apply_collective_ageement_on_mutual_assistance_effects_basic = yes
		}
	}

	option = { # Not interested, then
		name = NSB_soviet_policies_of_collective_security.5.b

		ai_chance = {
			base = 5
			modifier = {
				factor = 2
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 1.5
				has_government = democratic
			}
			modifier = {
				factor = 2
				has_guaranteed = POL 
			}
			modifier = {
				factor = 0
				OR = {
					NOT = { country_exists = POL }
					POL = { has_capitulated = yes }
				}
			}
		}

		FROM = { country_event = { id = NSB_soviet_policies_of_collective_security.8 hours = 8 random_hours = 4 } }
	}
}

# Policies of Collective Security - SOV accepts Poland's inclusion - Event for FRA
country_event = {
	id = NSB_soviet_policies_of_collective_security.6
	title = NSB_soviet_policies_of_collective_security.6.t
	desc = NSB_soviet_policies_of_collective_security.6.desc
	picture = GFX_report_event_SOV_litvinov_beck

	is_triggered_only = yes
			
	option = { # Good, let's ask POL
		name = NSB_soviet_policies_of_collective_security.6.a

		if = {
			limit = {
				country_exists = POL
			}
			POL = { country_event = { id = NSB_soviet_policies_of_collective_security.7 hours = 8 random_hours = 4 } } #Don't waste time, send it right away, Poland tends to die

			effect_tooltip = {
				SOV_apply_collective_ageement_on_mutual_assistance_effects_basic = yes
			}
			custom_effect_tooltip = NSB_soviet_policies_of_collective_security_tt
		}
		else = { #Fallback in case Poland gets wiped out during this political jobbery
			FROM = { country_event = { id = NSB_soviet_policies_of_collective_security.2 hours = 8 random_hours = 4 } }

			effect_tooltip = {
				SOV_apply_collective_ageement_on_mutual_assistance_effects_basic = yes
			}
		}
	}
}

# Policies of Collective Security - Wanna join Soviet-French <-(potentially) Mutual Assitance pact? - Event for POL
country_event = {
	id = NSB_soviet_policies_of_collective_security.7
	title = NSB_soviet_policies_of_collective_security.7.t
	desc = NSB_soviet_policies_of_collective_security.7.desc
	picture = GFX_report_event_SOV_litvinov_beck

	is_triggered_only = yes
			
	option = { # Accept
		name = NSB_soviet_policies_of_collective_security.7.a

		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				OR = {
					has_government = democratic
					has_government = communism
				}
			}
			modifier = {
				factor = 2
				has_completed_focus = POL_organize_the_peasants_strike
			}
			modifier = {
				factor = 2
				is_in_faction = no
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.2
				SOV = { has_idea = SOV_maksim_litvinov }
			}
			modifier = {
				factor = 0.5
				OR = {
					SOV = { has_completed_focus = SOV_claims_on_poland }
				}
			}
			modifier = {
				factor = 0
				has_completed_focus = POL_assemble_the_regency_council
			}
		}

		FROM = { country_event = { id = NSB_soviet_policies_of_collective_security.12 hours = 8 random_hours = 4 } } #Answer to FRA (potentially) who will in turn asnswer to SOV, so FROM is available for effects that can't use variables

		custom_effect_tooltip = NSB_soviet_policies_of_collective_security_poland_included_effects_from_tt
	}

	option = { # Not interested
		name = NSB_soviet_policies_of_collective_security.7.b

		ai_chance = {
			base = 10
			modifier = {
				factor = 4
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 4
				any_country = {
					is_major = yes
					has_guaranteed = POL
				}
			}
			modifier = {
				factor = 2
				has_completed_focus = POL_complete_april_constitution
			}
			modifier = {
				factor = 2
				has_government = fascism
			}
		}

		FROM = { country_event = { id = NSB_soviet_policies_of_collective_security.10 hours = 10 random_hours = 4 } }
	}
}

# Policies of Collective Security - FRA refuses the pact without Poland - Event for SOV
country_event = {
	id = NSB_soviet_policies_of_collective_security.8
	title = NSB_soviet_policies_of_collective_security.8.t
	desc = NSB_soviet_policies_of_collective_security.8.desc
	picture = GFX_report_event_generic_sign_treaty2

	is_triggered_only = yes
			
	option = { # Who needs them anyway?
		name = NSB_soviet_policies_of_collective_security.8.a

	}
}

# Policies of Collective Security - FRA agrees to the pact not including Poland - Event for SOV
country_event = {
	id = NSB_soviet_policies_of_collective_security.9
	title = NSB_soviet_policies_of_collective_security.9.t
	desc = NSB_soviet_policies_of_collective_security.9.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes
			
	option = { # Shame on them
		name = NSB_soviet_policies_of_collective_security.9.a

		SOV_apply_collective_ageement_on_mutual_assistance_effects_basic = yes

		FROM = { save_global_event_target_as = SOV_collective_security_pact_integrant }
		hidden_effect = { news_event = { id = nsb_news.102 days = 1 } } #Poland not Included
	}
}

# Policies of Collective Security - Poland does not want to be involved in any of this - Event for FRA
country_event = {
	id = NSB_soviet_policies_of_collective_security.10
	title = NSB_soviet_policies_of_collective_security.10.t
	desc = NSB_soviet_policies_of_collective_security.10.desc
	picture = GFX_report_event_polish_army

	is_triggered_only = yes
			
	option = { # Who needs them anyway?
		name = NSB_soviet_policies_of_collective_security.10.a

		SOV = { country_event = { id = NSB_soviet_policies_of_collective_security.11 hours = 10 random_hours = 4 } }

		effect_tooltip = {
			SOV_apply_collective_ageement_on_mutual_assistance_effects_basic = yes
		}
	}
}

# Policies of Collective Security - Poland refused to join our pact, let's just sign it ourselves - Event for SOV
country_event = {
	id = NSB_soviet_policies_of_collective_security.11
	title = NSB_soviet_policies_of_collective_security.11.t
	desc = NSB_soviet_policies_of_collective_security.11.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes
			
	option = { # Who needs them anyway?
		name = NSB_soviet_policies_of_collective_security.11.a

		SOV_apply_collective_ageement_on_mutual_assistance_effects_basic = yes

		FROM = { save_global_event_target_as = SOV_collective_security_pact_integrant }
		hidden_effect = { news_event = { id = nsb_news.102 days = 1 } } #Poland not Included
	}
}

# Policies of Collective Security - Poland joins our pact, hurray! - Event for FRA
country_event = {
	id = NSB_soviet_policies_of_collective_security.12
	title = NSB_soviet_policies_of_collective_security.12.t
	desc = NSB_soviet_policies_of_collective_security.12.desc
	picture = GFX_report_event_SOV_litvinov_beck

	is_triggered_only = yes
			
	option = { # COOL
		name = NSB_soviet_policies_of_collective_security.12.a

		SOV = { country_event = { id = NSB_soviet_policies_of_collective_security.13 hours = 10 random_hours = 4 } }

		custom_effect_tooltip = NSB_soviet_policies_of_collective_security_poland_included_effects_from_tt
	}
}

# Policies of Collective Security - Poland joins our pact, viva! - Event for SOV
country_event = {
	id = NSB_soviet_policies_of_collective_security.13
	title = NSB_soviet_policies_of_collective_security.12.t
	desc = NSB_soviet_policies_of_collective_security.13.desc
	picture = GFX_report_event_SOV_litvinov_beck

	is_triggered_only = yes
			
	option = {
		name = NSB_soviet_policies_of_collective_security.13.a

		custom_effect_tooltip = NSB_soviet_policies_of_collective_security_poland_included_effects_from_tt

		hidden_effect = {
			SOV_apply_collective_ageement_on_mutual_assistance_effects_poland_included = yes
		}

		FROM = { save_global_event_target_as = SOV_collective_security_pact_integrant }
		set_global_flag = SOV_collective_security_pact_poland_inlcuded_flag
		hidden_effect = { news_event = { id = nsb_news.102 days = 1 } } #Poland Included
	}
}



# SOV builds a National Academy of Sciences in our country
country_event = {
	id = NSB_soviet_academy_of_sciences.1
	title = NSB_soviet_academy_of_sciences.1.t
	desc = NSB_soviet_academy_of_sciences.1.desc
	picture = GFX_report_event_SOV_national_academy_of_sciences

	is_triggered_only = yes
			
	option = { # Accept
		name = NSB_soviet_academy_of_sciences.1.a

		add_ideas = SOV_national_academy_of_sciences_puppet
	}
}


# SOV infiltrates an atomic program - Success - Event for SOV (Only non-LaR)
country_event = {
	id = NSB_soviet_atomic_bomb_project.1
	title = NSB_soviet_atomic_bomb_project.1.t
	desc = NSB_soviet_atomic_bomb_project.1.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_atomic_bomb_project.1.a

		if = {
			limit = {
				NOT = { has_tech = nukes }
			}
			add_breakthrough_progress = {
				specialization = specialization_nuclear
				value = 0.4
			}
		}
		else = {
			add_timed_idea = {
				idea = SOV_stolen_vital_nuclear_information
				days = 180
			}
		}
	}
}

# SOV fails to infiltrate an atomic program - Failure - Event for SOV
country_event = {
	id = NSB_soviet_atomic_bomb_project.2
	title = NSB_soviet_atomic_bomb_project.2.t
	desc = NSB_soviet_atomic_bomb_project.2.desc
	picture = GFX_report_event_SOV_atomic_program_caught

	is_triggered_only = yes
			
	option = { # Bad, but okay
		name = NSB_soviet_atomic_bomb_project.2.a

		add_political_power = -50

		effect_tooltip = {
			var:SOV_aggrieved_country_atomic_spies = {
				if = {
					limit = {
						original_tag = USA
					}
					add_opinion_modifier = {
						target = ROOT
						modifier = SOV_attempted_to_infiltrate_manhattan_project
					}
				}
				else = {
					add_opinion_modifier = {
						target = ROOT
						modifier = SOV_attempted_to_infiltrate_our_atomic_program
					}
				}
			}
		}
	}
}

# SOV fails to infiltrate an atomic program - Failure - Event for target country
country_event = {
	id = NSB_soviet_atomic_bomb_project.3
	title = NSB_soviet_atomic_bomb_project.3.t
	desc = NSB_soviet_atomic_bomb_project.3.desc
	picture = GFX_report_event_SOV_atomic_program_caught

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_atomic_bomb_project.3.a

		add_political_power = 50

		if = {
			limit = {
				original_tag = USA
			}
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_attempted_to_infiltrate_manhattan_project
			}
		}
		else = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_attempted_to_infiltrate_our_atomic_program
			}
		}

		effect_tooltip = {
			FROM = {
				add_political_power = -50
			}
		}
	}
}


######################
### FIVE YEAR PLAN ###
######################

### THIRD FIVE YEAR PLAN CANCELED ###
country_event = {
	id = NSB_soviet_five_year_plan.01
	title = NSB_soviet_five_year_plan.01.t
	desc = NSB_soviet_five_year_plan.01.desc
	picture = GFX_report_event_SOV_five_year_plan_disrupted
	
	is_triggered_only = yes

	fire_only_once = yes

	option = { #VAYA POR DIOS
		name = NSB_soviet_five_year_plan.01.a
		
		custom_effect_tooltip = NSB_soviet_five_year_plan_tt
	}
}



######################
######## MISC ########
######################

### Kuznetsov becomes an Operative -> Fired when SOV loses control over a Ukrainian state 
country_event = {
	id = NSB_soviet_great_patriotic_war.01
	title = NSB_soviet_great_patriotic_war.01.t
	desc = NSB_soviet_great_patriotic_war.01.desc
	picture = GFX_report_event_SOV_tank_column
	
	is_triggered_only = yes

	fire_only_once = yes

	option = { #WELCOME TO THE NKVD
		name = NSB_soviet_great_patriotic_war.01.a

		create_operative_leader = {
			name = "Nikolay Ivanovich Kuznetsov"
			GFX = GFX_Portrait_nikolay_kuznetsov
			traits = { operative_commando operative_infiltrator }
			bypass_recruitment = no
			available_to_spy_master = yes
			nationalities = { SOV GER UKR }
		}
	}
}



###################
##### COMECON #####
###################

# SOV starts an industrialization project in our country - Event for puppet
country_event = {
	id = NSB_soviet_comecon.1
	title = NSB_soviet_comecon.1.t
	desc = NSB_soviet_comecon.1.desc
	picture = GFX_report_event_generic_factory

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_comecon.1.a

		effect_tooltip = {
			swap_ideas = {
				remove_idea = SOV_comecon_puppet_default
				add_idea = SOV_comecon_puppet_industrialization
			}
			custom_effect_tooltip = NSB_soviet_comecon_effect_duration_tt
		}
	}
}

# SOV starts a joint military program - Event for puppets
country_event = {
	id = NSB_soviet_comecon.2
	title = NSB_soviet_comecon.2.t
	desc = NSB_soviet_comecon.2.desc
	picture = GFX_report_event_soviet_tanks

	is_triggered_only = yes
			
	option = { # Good
		name = NSB_soviet_comecon.2.a

		effect_tooltip = {
			swap_ideas = {
				remove_idea = SOV_comecon_puppet_default
				add_idea = SOV_comecon_puppet_military
			}
			custom_effect_tooltip = NSB_soviet_comecon_effect_duration_tt
		}
	}
}


#########################
### SPANISH CIVIL WAR ###
#########################

#REPUBLICAN SPAIN / POUM LOSES THE SCW -> LÍSTER / EL CAMPESINO / ROVIRA JOINS SOV -> Event for SOV
unit_leader_event = {
	id = NSB_soviet_spanish_civil_war.1
	title = NSB_soviet_spanish_civil_war.1.t
	desc = NSB_soviet_spanish_civil_war.1.desc
	
	is_triggered_only = yes

	option = {
		name = NSB_soviet_spanish_civil_war.1.a
		effect_tooltip = {
			var:SOV.SOV_spanish_general = { set_nationality = SOV }
		}
	}
}

# POUM - SOV has organized International Marxist Brigades -> Event for SPC
country_event = {
	id = NSB_soviet_spanish_civil_war.2
	title = NSB_soviet_spanish_civil_war.2.t
	desc = NSB_soviet_spanish_civil_war.2.desc
	picture = GFX_report_event_spr_poum_militia
	
	is_triggered_only = yes

	option = {
		name = NSB_soviet_spanish_civil_war.2.a
		
		if = {
			limit = {
				NOT = { has_template = "International Marxist Brigades" }
			}
			division_template = {
				name = "International Marxist Brigades"
				is_locked = yes
				priority = 1
				template_counter = 14
				regiments = {
					infantry = { x = 0 y = 0 }
					infantry = { x = 0 y = 1 }
					infantry = { x = 1 y = 0 }
					infantry = { x = 1 y = 1 }
				}
			}
		}
		capital_scope = {
			create_unit = { 
				division = "name = \"International Marxist Brigade\" division_template = \"International Marxist Brigades\" start_experience_factor = 0.1 start_equipment_factor = 1.0" owner = ROOT count = 6
			}
		}
	}
}

# POUM - SOV has sent special commandos -> Event for SPC
country_event = {
	id = NSB_soviet_spanish_civil_war.3
	title = NSB_soviet_spanish_civil_war.3.t
	desc = NSB_soviet_spanish_civil_war.3.desc
	picture = GFX_report_event_spr_the_maquis
	
	is_triggered_only = yes

	option = {
		name = NSB_soviet_spanish_civil_war.3.a
		
		add_timed_idea = {
			idea = SOV_soviet_commandos_poum
			days = 180
		}

		if = {
			limit = {
				NOT = { has_template = "Soviet Special Brigades" }
			}
			division_template = {
				name = "Soviet Special Brigades"
				is_locked = yes
				priority = 1
				template_counter = 02
				regiments = {
					infantry = { x = 0 y = 0 }
					infantry = { x = 0 y = 1 }
					infantry = { x = 0 y = 2 }
					infantry = { x = 1 y = 0 }
					infantry = { x = 1 y = 1 }
					infantry = { x = 1 y = 2 }
				}
				support = {
					engineer = { x = 0 y = 0 }
					recon = { x = 0 y = 1 }
					artillery = { x = 0 y = 2 }
					anti_tank = { x = 0 y = 3 }
				}
			}
		}
		capital_scope = {
			create_unit = { 
				division = "name = \"Soviet Special Brigade\" division_template = \"Soviet Special Brigades\" start_experience_factor = 0.7 start_equipment_factor = 1.0" owner = ROOT count = 2
			}
		}
	}
}

# POUM - SOV has organized popular speeches in the country -> Event for SPC
country_event = {
	id = NSB_soviet_spanish_civil_war.4
	title = NSB_soviet_spanish_civil_war.4.t
	desc = NSB_soviet_spanish_civil_war.4.desc
	picture = GFX_report_event_spr_anarchists
	
	is_triggered_only = yes

	option = {
		name = NSB_soviet_spanish_civil_war.4.a
		
		add_timed_idea = {
			idea = SOV_popular_speeches_poum
			days = 180
		}

		if = {
			limit = {
				NOT = { has_template = "International Marxist Brigades" }
			}
			division_template = {
				name = "International Marxist Brigades"
				is_locked = yes
				priority = 1
				template_counter = 14
				regiments = {
					infantry = { x = 0 y = 0 }
					infantry = { x = 0 y = 1 }
					infantry = { x = 1 y = 0 }
					infantry = { x = 1 y = 1 }
				}
			}
		}
		capital_scope = {
			create_unit = { 
				division = "name = \"International Marxist Brigade\" division_template = \"International Marxist Brigades\" start_experience_factor = 0.1 start_equipment_factor = 1.0" owner = ROOT count = 2
			}
		}
	}
}

# POUM - SOV has infiltrate the Stalinist command in Spain -> Event for SPC
country_event = {
	id = NSB_soviet_spanish_civil_war.5
	title = NSB_soviet_spanish_civil_war.5.t
	desc = NSB_soviet_spanish_civil_war.5.desc
	picture = GFX_report_event_spr_republican_soldiers
	
	is_triggered_only = yes

	option = {
		name = NSB_soviet_spanish_civil_war.5.a
		
		add_timed_idea = {
			idea = SOV_agents_in_the_stalinist_command_poum
			days = 365
		}
	}
}

# POUM won CW -> Troops will aid Right Oppo in the Soviet CW -> Event for SOV
country_event = {
	id = NSB_soviet_spanish_civil_war.6
	title = NSB_soviet_spanish_civil_war.6.t
	desc = {
		text = NSB_soviet_spanish_civil_war.6.desc_1
		trigger = {
			NOT = { has_global_flag = SOV_soviet_civil_war }
		}
	}
	desc = {
		text = NSB_soviet_spanish_civil_war.6.desc_2
		trigger = {
			has_global_flag = SOV_soviet_civil_war
		}
	}
	picture = GFX_report_event_spr_anarchists2

	is_triggered_only = yes

	trigger = {
		OR = { #Do not trigger if Soviet civil war has finished or was bypassed
			NOT = {	has_completed_focus = SOV_coup_detat }
			has_global_flag = SOV_soviet_civil_war
		}
	}

	immediate = {
		set_country_flag = SOV_poum_brigades_ready_to_help_flag #Will be checked when the Soviet CW happens, and effects will be run in the CW setup effect
	}

	# Nice, comrades! -> Soviet Civil War has not happen
	option = {
		name = NSB_soviet_spanish_civil_war.6.a

		trigger = {
			NOT = { has_global_flag = SOV_soviet_civil_war }
		}
		
		custom_effect_tooltip = SOV_poum_aid_in_case_of_civil_War_tt
	}

	#Let's kick some asses! -> Soviet Civil War is ongoing
	option = {
		name = NSB_soviet_spanish_civil_war.6.a

		trigger = {
			has_global_flag = SOV_soviet_civil_war
		}

		SOV_poum_brigades_to_soviet_civil_war_effect = yes
	}
}


#######################
### PLANNED ECONOMY ###
#######################

# SOV planned economy - Event for puppets
country_event = {
	id = NSB_soviet_planned_economy.1
	title = NSB_soviet_planned_economy.1.t
	desc = NSB_soviet_planned_economy.1.desc
	picture = GFX_report_event_SOV_national_academy_of_sciences

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			FROM = {
				if = {
					limit = {
						check_variable = { SOV_planned_economy_industrial_capacity_factory_initial < 0.1 }
					}
					add_to_variable = { SOV_planned_economy_industrial_capacity_factory_initial = 0.01 }
				}
				if = {
					limit = {
						check_variable = { SOV_planned_economy_production_lack_of_resource_penalty_factor_initial > -0.1 }
					}
					add_to_variable = { SOV_planned_economy_production_lack_of_resource_penalty_factor_initial = -0.01 }
				}
			}
			add_tech_bonus = {
				name = NSB_soviet_planned_economy.1.t
				bonus = 1.0
				uses = 2
				category = industry
			}

			add_ideas = new_economic_policy
		}
	}
			
	option = { # Good
		name = NSB_soviet_planned_economy.1.a

		effect_tooltip = {
			add_tech_bonus = {
				name = NSB_soviet_planned_economy.1.t
				bonus = 1.0
				uses = 2
				category = industry
			}

			add_ideas = new_economic_policy
		}
	}
}



############################################################################################

### #  # ###      ##  ##  #   # ### ### ###      ##  ### #   # ### #       #   #  ##  ###  
 #  #  # #       #   #  # #   #  #  #    #      #  #  #  #   #  #  #       #   # #  # #  # 
 #  #### ##       #  #  #  # #   #  ##   #      #     #   # #   #  #       # # # #### ###  
 #  #  # #         # #  #  # #   #  #    #      #  #  #   # #   #  #       # # # #  # #  # 
 #  #  # ###     ##   ##    #   ### ###  #       ##  ###   #   ### ###      # #  #  # #  # 

############################################################################################



# Thus it begins - Left Opposition Civil War Start
country_event = {
	id = NSB_soviet_communist_civil_war.001
	title = NSB_soviet_communist_civil_war.001.t
	desc = NSB_soviet_communist_civil_war.001.desc
	picture = GFX_report_event_generic_battle
	is_triggered_only = yes
	immediate = {
		hidden_effect = { SOV_initiate_civil_war = yes }
	}
	trigger = { NOT = { has_global_flag = SOV_soviet_civil_war } }

	# Civil war starts
	option = {
		name = NSB_soviet_communist_civil_war.001.a
		ai_chance = { 
			base = 10
		}
		trigger = {
			has_character = SOV_lev_trotsky
			NOT = {
				has_global_flag = trotsky_dead # just to be sure we don't end up with a ghost leading the country
			}
		}

		# SET UP NEW CAPITAL - This is where the player will launch the uprising from
		SOV_set_up_civil_war_capital = yes 

		# Determine Army size
		SOV_set_up_civil_war_army_fractions = yes 

		# DEPOSE STALIN 
		SOV_promote_to_country_leader_trotsky = yes	

		hidden_effect = {
			#START CIVIL WAR
			SOV_start_civil_war = yes 

			# LEFT Opposition Specific Stuff 
			SOV_left_opposition_civil_war_start = yes 

			# Return Trotsky from Mexico
			set_global_flag = flag_trotsky_returning_to_ussr_from_mexico
			MEX = { country_event = { id = mexico.22 hours = 1} }	
		}


	}
	option = {
		name = NSB_soviet_communist_civil_war.001.b
		ai_chance = { 
			base = 10
		}
		trigger = {
			has_character = SOV_ivan_smirnov
			has_completed_focus = SOV_integrate_smirnovs_bloc
		}

		# SET UP NEW CAPITAL - This is where the player will launch the uprising from
		SOV_set_up_civil_war_capital = yes 

		# Determine Army size
		SOV_set_up_civil_war_army_fractions = yes 

		# DEPOSE STALIN 
		SOV_promote_to_country_leader_smirnov = yes

		hidden_effect = {
			#START CIVIL WAR
			SOV_start_civil_war = yes 

			# LEFT Opposition Specific Stuff 
			SOV_left_opposition_civil_war_start = yes 	
		}
	}

	option = {
		name = NSB_soviet_communist_civil_war.001.c
		ai_chance = { 
			base = 10
		}
		trigger = {
			NOT = { has_character = SOV_lev_trotsky }
			OR = { 
				NOT = { has_character = SOV_ivan_smirnov }
				NOT = { has_completed_focus = SOV_integrate_smirnovs_bloc }
			}
			OR = { 
				NOT = { has_character = SOV_grigory_zinovyev }
				NOT = { has_completed_focus = SOV_align_the_zinovyevites }
			}
			OR = { 
				NOT = { has_character = SOV_lev_kamenev }
				NOT = { has_completed_focus = SOV_align_the_zinovyevites }
			}
		}
		

		# SET UP NEW CAPITAL - This is where the player will launch the uprising from
		SOV_set_up_civil_war_capital = yes 

		# Determine Army size
		SOV_set_up_civil_war_army_fractions = yes 

		# DEPOSE STALIN 
		IF = {
			limit = { 
				any_unit_leader = { has_trait = trait_SOV_trotskyist }
			}
			ROOT = {
				random_unit_leader = {
					limit = { 
						has_trait = trait_SOV_trotskyist
					}
					add_country_leader_role = {
						country_leader = {
							ideology = marxism
							expire = "1965.1.1.1"
						}
						promote_leader = yes 
					}
					
				}
			}
		}
		ELSE = {
			ROOT = {
				random_unit_leader = {
					limit = { 
						NOT = { has_trait = trait_SOV_stalinist }
					}
					add_country_leader_role = {
						country_leader = {
							ideology = marxism
							expire = "1965.1.1.1"
						}
						promote_leader = yes 
					}
				}
			}
		}
		hidden_effect = {
			random_list = {
				20 = {
					SOV = { add_country_leader_trait = stout_defender }
				}
				20 = {
					SOV = { add_country_leader_trait = devoted_trotskyist }
				}
				20 = {
					SOV = { add_country_leader_trait = cornered_fox }
				}
				20 = {
					SOV = { add_country_leader_trait = permanent_revolutionary }
				}
				20 = {
					SOV = { add_country_leader_trait = indecisive }
				}
			}
		}
		
		

		hidden_effect = {
			#START CIVIL WAR
			SOV_start_civil_war = yes 

			# LEFT Opposition Specific Stuff 
			SOV_left_opposition_civil_war_start = yes  
		}
				
	}
	# Zinovyev
	option = {
		name = NSB_soviet_communist_civil_war.001.d
		ai_chance = { 
			base = 10
		}
		trigger = {
			has_character = SOV_grigory_zinovyev
			has_completed_focus = SOV_align_the_zinovyevites
		}

		# SET UP NEW CAPITAL - This is where the player will launch the uprising from
		SOV_set_up_civil_war_capital = yes 

		# Determine Army size
		SOV_set_up_civil_war_army_fractions = yes 

		# DEPOSE STALIN 
		SOV_promote_to_country_leader_zinovyev = yes 	

		hidden_effect = {
			#START CIVIL WAR
			SOV_start_civil_war = yes 

			# LEFT Opposition Specific Stuff 
			SOV_left_opposition_civil_war_start = yes 	
		}
	}
	# Kamenev
	option = {
		name = NSB_soviet_communist_civil_war.001.e
		ai_chance = { 
			base = 10
		}
		trigger = {
			has_character = SOV_lev_kamenev
			has_completed_focus = SOV_align_the_zinovyevites
		}

		# SET UP NEW CAPITAL - This is where the player will launch the uprising from
		SOV_set_up_civil_war_capital = yes 

		# Determine Army size
		SOV_set_up_civil_war_army_fractions = yes 

		# DEPOSE STALIN 
		SOV_promote_to_country_leader_kamenev = yes 

		hidden_effect = {
			#START CIVIL WAR
			SOV_start_civil_war = yes 

			# LEFT Opposition Specific Stuff 
			SOV_left_opposition_civil_war_start = yes 	
		}
	}




	

}


# Right Opposition Coup Successful
country_event = {
	id = NSB_soviet_communist_civil_war.002
	title = NSB_soviet_communist_civil_war.002.t
	desc = NSB_soviet_communist_civil_war.002.desc
	picture = GFX_report_event_soviet_tank_parade

	is_triggered_only = yes
	trigger = { NOT = { has_global_flag = SOV_soviet_civil_war } }

	option = {
		name = NSB_soviet_communist_civil_war.002.a
		trigger = {
			has_character = SOV_nikolay_bukharin
		}
		# Set New Country Leader
		SOV_promote_to_country_leader_bukharin = yes
		
		retire_character = SOV_lavrenty_beriya
		hidden_effect = { every_other_country = { news_event = { id = nsb_news.12 hours = 8 } } }
		set_division_template_lock = {
			division_template = "NKVD Pogranichnaya Diviziya"
			is_locked = no
		}
	}
	option = {
		name = NSB_soviet_communist_civil_war.002.b
		trigger = {
			has_character = SOV_aleksey_rykov
		}
		# Set New Country Leader
		SOV_promote_to_country_leader_rykov = yes

		retire_character = SOV_lavrenty_beriya
		hidden_effect = { every_other_country = { news_event = { id = nsb_news.12 hours = 8 } } }
		set_division_template_lock = {
			division_template = "NKVD Pogranichnaya Diviziya"
			is_locked = no
		}
	}
	option = {
		name = NSB_soviet_communist_civil_war.002.c
		trigger = {
			NOT = { has_character = SOV_nikolay_bukharin }
			NOT = { has_character = SOV_aleksey_rykov }
			OR = { 
				NOT = { has_character = SOV_grigory_zinovyev }
				NOT = { has_completed_focus = SOV_align_the_zinovyevites }
			}
			OR = { 
				NOT = { has_character = SOV_lev_kamenev }
				NOT = { has_completed_focus = SOV_align_the_zinovyevites }
			}
		}
		# Set New Country Leader
		IF = {
			limit = { 
				any_unit_leader = { has_trait = trait_SOV_bukharinist }
			}
			ROOT = {
				random_unit_leader = {
					limit = { 
						has_trait = trait_SOV_bukharinist
					}
					add_country_leader_role = {
						country_leader = {
							ideology = marxism
							expire = "1965.1.1.1"
						}
						promote_leader = yes 
					}
					
				}
			}
		}
		ELSE = {
			ROOT = {
				random_unit_leader = {
					limit = { 
						NOT = { has_trait = trait_SOV_stalinist }
					}
					add_country_leader_role = {
						country_leader = {
							ideology = marxism
							expire = "1965.1.1.1"
						}
						promote_leader = yes 
					}
				}
			}
		}
		hidden_effect = {
			random_list = {
				20 = {
					SOV = { add_country_leader_trait = army_connections }
				}				
				20 = {
					SOV = { add_country_leader_trait = stout_defender }
				}
				20 = {
					SOV = { add_country_leader_trait = empire_builder }
				}
				20 = {
					SOV = { add_country_leader_trait = railroad_enthusiast }
				}
				20 = {
					SOV = { add_country_leader_trait = rearmer }
				}
				20 = {
					SOV = { add_country_leader_trait = indecisive }
				}
			}

			random_list = {
				50 = {
					SOV = { add_country_leader_trait = r56_trait_opposed_to_fascism }
				}				
				50 = {
					SOV = {  }
				}
			}			
		}
		retire_character = SOV_lavrenty_beriya
		hidden_effect = { every_other_country = { news_event = { id = nsb_news.12 hours = 8 } } }
		set_division_template_lock = {
			division_template = "NKVD Pogranichnaya Diviziya"
			is_locked = no
		}
	}
	option = {
		name = NSB_soviet_communist_civil_war.002.d
		trigger = {
			has_character = SOV_grigory_zinovyev
			has_completed_focus = SOV_align_the_zinovyevites
		}
		# Set New Country Leader
		SOV_promote_to_country_leader_zinovyev = yes
		retire_character = SOV_lavrenty_beriya
		hidden_effect = { every_other_country = { news_event = { id = nsb_news.12 hours = 8 } } }
		set_division_template_lock = {
			division_template = "NKVD Pogranichnaya Diviziya"
			is_locked = no
		}
	}
	option = {
		name = NSB_soviet_communist_civil_war.002.e
		trigger = {
			has_character = SOV_lev_kamenev
			has_completed_focus = SOV_align_the_zinovyevites
		}
		# Set New Country Leader
		SOV_promote_to_country_leader_kamenev = yes
		retire_character = SOV_lavrenty_beriya
		hidden_effect = { every_other_country = { news_event = { id = nsb_news.12 hours = 8 } } }
		set_division_template_lock = {
			division_template = "NKVD Pogranichnaya Diviziya"
			is_locked = no
		}
	}
}


# Right Opposition Civil War start
country_event = {
	id = NSB_soviet_communist_civil_war.003
	title = NSB_soviet_communist_civil_war.003.t
	desc = NSB_soviet_communist_civil_war.003.desc
	picture = GFX_report_event_generic_battle
	
	is_triggered_only = yes
	trigger = { NOT = { has_global_flag = SOV_soviet_civil_war } }

	immediate = {
		hidden_effect = { SOV_initiate_civil_war = yes }
	}

	# Civil war starts
	option = {
		name = NSB_soviet_communist_civil_war.003.a
		ai_chance = { 
			base = 20
		}
		trigger = {
			has_character = SOV_nikolay_bukharin
		}

		# SET UP NEW CAPITAL - This is where the player will launch the uprising from
		SOV_set_up_civil_war_capital = yes 
		
		# Determine Army size
		SOV_set_up_civil_war_army_fractions = yes 
		
		# DEPOSE STALIN 
		# Set New Country Leader 
		SOV_promote_to_country_leader_bukharin = yes
		
		hidden_effect = {
			#START CIVIL WAR
			SOV_start_civil_war = yes 

			# RIGHT Opposition Specific Stuff 
			SOV_right_opposition_civil_war_start = yes 
		}
	}
	option = {
		name = NSB_soviet_communist_civil_war.003.b
		ai_chance = { 
			base = 10
		}
		trigger = {
			has_character = SOV_aleksey_rykov
		}

		# SET UP NEW CAPITAL - This is where the player will launch the uprising from
		SOV_set_up_civil_war_capital = yes 

		# Determine Army size
		SOV_set_up_civil_war_army_fractions = yes 

		# DEPOSE STALIN
		SOV_promote_to_country_leader_rykov = yes

		hidden_effect = {
			#START CIVIL WAR
			SOV_start_civil_war = yes 

			# LEFT Opposition Specific Stuff 
			SOV_right_opposition_civil_war_start = yes 	
		}
	}

	option = {
		name = NSB_soviet_communist_civil_war.003.c
		ai_chance = { 
			base = 10
		}
		trigger = {
			NOT = { has_character = SOV_nikolay_bukharin }
			NOT = { has_character = SOV_aleksey_rykov }
			OR = { 
				NOT = { has_character = SOV_grigory_zinovyev }
				NOT = { has_completed_focus = SOV_align_the_zinovyevites }
			}
			OR = { 
				NOT = { has_character = SOV_lev_kamenev }
				NOT = { has_completed_focus = SOV_align_the_zinovyevites }
			}
		}
		

		# SET UP NEW CAPITAL - This is where the player will launch the uprising from
		SOV_set_up_civil_war_capital = yes 

		# Determine Army size
		SOV_set_up_civil_war_army_fractions = yes 

		# DEPOSE STALIN
		IF = {
			limit = { 
				any_unit_leader = { has_trait = trait_SOV_bukharinist }
			}
			ROOT = {
				random_unit_leader = {
					limit = { 
						has_trait = trait_SOV_bukharinist
					}
					add_country_leader_role = {
						country_leader = {
							ideology = marxism
							expire = "1965.1.1.1"
						}
						promote_leader = yes 
					}
					
				}
			}
		}
		ELSE = {
			ROOT = {
				random_unit_leader = {
					limit = { 
						NOT = { has_trait = trait_SOV_stalinist }
					}
					add_country_leader_role = {
						country_leader = {
							ideology = marxism
							expire = "1965.1.1.1"
						}
						promote_leader = yes 
					}
				}
			}
		}
		hidden_effect = {
			random_list = {
				20 = {
					SOV = { add_country_leader_trait = stout_defender }
				}
				20 = {
					SOV = { add_country_leader_trait = empire_builder }
				}
				20 = {
					SOV = { add_country_leader_trait = railroad_enthusiast }
				}
				20 = {
					SOV = { add_country_leader_trait = anti_democrat }
				}
				20 = {
					SOV = { add_country_leader_trait = indecisive }
				}
			}
		}
		
		
		

		hidden_effect = {
			#START CIVIL WAR
			SOV_start_civil_war = yes 

			# LEFT Opposition Specific Stuff 
			SOV_right_opposition_civil_war_start = yes  
		}
				
	}
	# Zinovyev
	option = {
		name = NSB_soviet_communist_civil_war.003.d
		ai_chance = { 
			base = 10
		}
		trigger = {
			has_character = SOV_grigory_zinovyev
			has_completed_focus = SOV_align_the_zinovyevites
		}

		# SET UP NEW CAPITAL - This is where the player will launch the uprising from
		SOV_set_up_civil_war_capital = yes 

		# Determine Army size
		SOV_set_up_civil_war_army_fractions = yes 

		# DEPOSE STALIN
		SOV_promote_to_country_leader_zinovyev = yes 	

		hidden_effect = {
			#START CIVIL WAR
			SOV_start_civil_war = yes 

			# LEFT Opposition Specific Stuff 
			SOV_right_opposition_civil_war_start = yes 	
		}
	}
	# Kamenev
	option = {
		name = NSB_soviet_communist_civil_war.003.e
		ai_chance = { 
			base = 10
		}
		trigger = {
			has_character = SOV_lev_kamenev
			has_completed_focus = SOV_align_the_zinovyevites
		}

		# SET UP NEW CAPITAL - This is where the player will launch the uprising from
		SOV_set_up_civil_war_capital = yes 

		# Determine Army size
		SOV_set_up_civil_war_army_fractions = yes 

		# DEPOSE STALIN 
		SOV_promote_to_country_leader_kamenev = yes 

		hidden_effect = {
			#START CIVIL WAR
			SOV_start_civil_war = yes 

			# LEFT Opposition Specific Stuff 
			SOV_right_opposition_civil_war_start = yes 	
		}
	}

}

# The Vanguard of the True Revolution
country_event = {
	id = NSB_soviet_communist_civil_war.004
	title = NSB_soviet_communist_civil_war.004.t
	desc = NSB_soviet_communist_civil_war.004.desc
	picture = GFX_report_event_generic_rally2
	
	is_triggered_only = yes
	immediate = {
		set_temp_variable = { temp_support = party_popularity@communism }
		# divide_temp_variable = { temp_support = 10 }
		set_variable = { volunteer_mp = max_available_manpower_k }
		multiply_variable = { volunteer_mp = temp_support }
		round_variable = volunteer_mp
		set_variable = { volunteer_mp_org = volunteer_mp }
		
		multiply_variable = { volunteer_mp_org = -50 }
		multiply_variable = { volunteer_mp = -10 }
	}

	# Communist Only - Sponsor Volunteers
	option = {
		name = NSB_soviet_communist_civil_war.004.a
		ai_chance = {
			base = 10
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 2
				FROM = { has_idea = SOV_maksim_litvinov }
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.2
				FROM = { has_idea = SOV_vyacheslav_molotov }
			}
		}
		trigger = {
			has_government = communism
			NOT = { has_war_with = SOV }
		}
		add_manpower = var:volunteer_mp_org
		multiply_variable = { volunteer_mp_org = -1 }
		add_to_variable = { SOV.SOV_international_brigades_mp = volunteer_mp_org }
		clear_variable = volunteer_mp_org
		clear_variable = volunteer_mp
	}

	# Communist Only - We would never betray our friend Stalin!
	option = {
		name = NSB_soviet_communist_civil_war.004.b
		ai_chance = {
			base = 10
			modifier = {
				factor = 10
				is_in_faction_with = SOS
			}
		}
		trigger = {
			has_government = communism
		}
		add_popularity = {
			ideology = communism
			popularity = -0.05
		}
		
	}

	# anyone - Oh
	option = {
		name = NSB_soviet_communist_civil_war.004.c
		ai_chance = {
			base = 10
		}
		add_manpower = var:volunteer_mp
		multiply_variable = { volunteer_mp = -1 }
		add_to_variable = { SOV.SOV_international_brigades_mp = volunteer_mp }
		clear_variable = volunteer_mp_org
		clear_variable = volunteer_mp
	}
}

# International brigades
country_event = {
	id = NSB_soviet_communist_civil_war.005
	title = NSB_soviet_communist_civil_war.005.t
	desc = NSB_soviet_communist_civil_war.005.desc
	picture = GFX_report_event_generic_army
	immediate = {
		divide_variable = { SOV.SOV_international_brigades_mp = 4000 }
		round_variable = SOV.SOV_international_brigades_mp
		clamp_variable = {
			var = SOV.SOV_international_brigades_mp
			min = 1
			max = 40
		}
	}
	is_triggered_only = yes
	# International Brigades Arrive
	option = {
		name = NSB_soviet_communist_civil_war.005.a
		ai_chance = {
			base = 10
		}
		division_template = {
		    name = "International Brigades"
			priority = 1
			template_counter = 3
			regiments = {
				infantry = { x = 0 y = 0 }
				infantry = { x = 0 y = 1 }
				infantry = { x = 1 y = 0 }
				infantry = { x = 1 y = 1 }
			}
		    is_locked = yes 
		}
		IF = {
			limit = {
				var:SOV.SOV_civil_war_start_state = { is_controlled_by = SOV }
			}
			var:SOV.SOV_civil_war_start_state = {
				create_unit = { 
					division = "name = \"International Brigade\" division_template = \"International Brigades\" start_experience_factor = 0.1 start_equipment_factor = 1.0" owner = ROOT count = var:SOV.SOV_international_brigades_mp
				}
			}
		}
		ELSE = {
			random_owned_controlled_state = {
				create_unit = { 
					division = "name = \"International Brigade\" division_template = \"International Brigades\" start_experience_factor = 0.1 start_equipment_factor = 1.0" owner = ROOT count = var:SOV.SOV_international_brigades_mp
				}
			}
		}
	}
}

# Uprisings
country_event = {
	id = NSB_soviet_communist_civil_war.006
	title = NSB_soviet_communist_civil_war.006.t
	desc = NSB_soviet_communist_civil_war.006.desc
	picture = GFX_report_event_worker_protests
	
	is_triggered_only = yes
	trigger = { SOV_soviet_civil_war_not_started = yes }
	# Allow Uprisings
	option = {
		name = NSB_soviet_communist_civil_war.006.a
		ai_chance = {
			base = 10
		}
		SOV_opposition_support_low_increase_effect = yes 
		var:SOV_uprising_state = { SOV_set_civil_war_state = yes }
		
		random_list = {
			25 = {
				SOV_paranoia_medium_increase_effect = yes 
				IF = {
					limit = {
						var:SOV_uprising_state = { dockyard  > 0 }
					}
					var:SOV_uprising_state = { damage_building = { type = dockyard  damage = 0.75 }	}
				}
				ELSE_IF = {
					limit = {
						var:SOV_uprising_state = { arms_factory > 0 }
					}
					var:SOV_uprising_state = { damage_building = { type = arms_factory damage = 0.75 } }
				}
				ELSE_IF = {
					limit = {
						var:SOV_uprising_state = { industrial_complex > 0 }
					}
					var:SOV_uprising_state = { damage_building = { type = industrial_complex damage = 0.75 } }
				}
			}
			25 = {
				SOV_paranoia_low_increase_effect = yes 
				add_stability = -0.05	
			}
			25 = {
				SOV_paranoia_low_increase_effect = yes 
				add_popularity = {
					ideology = democratic
					popularity = 0.02
				}
			}
			25 = {
				SOV_paranoia_very_low_increase_effect = yes 
			}	
		}
		# trigger new uprising soemwhere else 
		hidden_effect = {
			country_event = {
				id = NSB_soviet_communist_civil_war.007
				days = 30
				random_days = 20
			}
		}
	}

	# Put an end to uprisings
	option = {
		name = NSB_soviet_communist_civil_war.006.b
		ai_chance = {
			base = 10
			modifier = {
				factor = 0 # The AI shouldn't do this unless it is a bad spot
				OR = {
					has_political_power > 0 
					check_variable = { SOV_paranoia < 65 } 
				}
			} 
		}
		SOV_opposition_support_low_decrease_effect = yes 
		SOV_paranoia_low_decrease_effect = yes 
		add_political_power = -75
		add_popularity = {
			ideology = communism 
			popularity = -0.05
		}
	}
}

# Uprisings trigger
country_event = {
	id = NSB_soviet_communist_civil_war.007
	title = NSB_soviet_communist_civil_war.007.t
	desc = NSB_soviet_communist_civil_war.007.desc
	# picture = GFX_report_event_soviet_japanese_pact
	hidden = yes
	is_triggered_only = yes

	option = {
		name = NSB_soviet_communist_civil_war.007.a
		random_owned_state = {
			limit = {
				SOV_is_unaligned_state = yes 
				NOT = { region = 133}
				NOT = { region = 132}
				OR = {
					industrial_complex > 0
					arms_factory > 0
					dockyard  > 0
				}
			}
			ROOT = { set_variable = { SOV_uprising_state = PREV } }
		}
		country_event = {
			id = NSB_soviet_communist_civil_war.006
		}
	}
}

# Stalin Surivives 
news_event = {
	id = NSB_soviet_communist_civil_war.008
	title = NSB_soviet_communist_civil_war.008.t
	desc = NSB_soviet_communist_civil_war.008.desc
	picture = GFX_news_event_dimitrov_and_stalin
	is_triggered_only = yes

	option = {
		name = NSB_soviet_communist_civil_war.008.a
		
	}
}

# The Death of Stalin
news_event = {
	id = NSB_soviet_communist_civil_war.009
	title = NSB_soviet_communist_civil_war.009.t
	desc = NSB_soviet_communist_civil_war.009.desc
	picture = GFX_news_event_generic_funeral
	is_triggered_only = yes

	option = {
		name = NSB_soviet_communist_civil_war.009.a
		hidden_effect = {
			every_other_country = { news_event = { id = nsb_news.11 hours = 8 } }
		}
	}
}


# Defections
country_event = {
	id = NSB_soviet_communist_civil_war.010
	title = NSB_soviet_communist_civil_war.010.t
	desc = NSB_soviet_communist_civil_war.010.desc
	picture = GFX_report_event_soviet_japanese_pact
	
	is_triggered_only = yes

	option = {
		name = NSB_soviet_communist_civil_war.010.a
		var:SOS.SOV_general_to_desert = { 
			remove_unit_leader_trait = trait_SOV_cowed_by_stalin_army
			set_nationality = ROOT 
		}

		SOS = {
			transfer_units_fraction= {
				target = SOV
				target_organization = 1
				source_organization = 0.9
				size = 0
				stockpile_ratio = 0
				army_ratio = 0.02
				navy_ratio = 0
				air_ratio = 0
				keep_unit_leaders_trigger = {
					always = yes 
				}
			}

		}
	}
}

# PERMANENT REVOLUTION
country_event = {
	id = NSB_soviet_permanent_revolution.1
	title = NSB_soviet_permanent_revolution.1.t
	desc = NSB_soviet_permanent_revolution.1.desc
	picture = GFX_report_event_soviet_purge_speech
	
	is_triggered_only = yes

	option = {
		name = NSB_soviet_permanent_revolution.1.a

		effect_tooltip = {
			if = { #I f country has banned communism, then add the weakened version of the NS
				limit = {
					has_country_flag = banned_communism_flag
				}
				add_timed_idea = {
					idea = SOV_trotskyist_revolutionary_agitation_weakened
					days = 120
				}
			}
			else = {
				add_timed_idea = {
					idea = SOV_trotskyist_revolutionary_agitation
					days = 120
				}
			}
			FROM = {
				create_wargoal = {
					type = topple_government
					target = ROOT
					expire = 90
				}
			}
		}
	}
}

# FOR THE COMMON GOOD - Event for Soviet Subjects and Allies
country_event = {
	id = NSB_soviet_for_the_common_good.1
	title = NSB_soviet_for_the_common_good.1.t
	desc = NSB_soviet_for_the_common_good.1.desc
	picture = GFX_report_event_SOV_demands
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			if = { #sUBJECT EFFECTS
				limit = {
					is_subject_of = FROM
				}
				add_ideas = SOV_for_the_common_good_subjects
				add_autonomy_score = {
					value = -100
					localization = SOV_for_the_common_good
				}
			}
			else = { #ALLY EFFECTS
				add_ideas = SOV_for_the_common_good_allies
				add_relation_modifier = {
					target = ROOT
					modifier = SOV_for_the_common_good_relation
				}
			}
		}
	}

	option = {
		name = NSB_soviet_for_the_common_good.1.a

		effect_tooltip = {
			if = { #sUBJECT EFFECTS
				limit = {
					is_subject_of = FROM
				}
				add_ideas = SOV_for_the_common_good_subjects
				add_autonomy_score = {
					value = -100
					localization = SOV_for_the_common_good
				}
			}
			else = { #ALLY EFFECTS
				add_ideas = SOV_for_the_common_good_allies
				add_relation_modifier = {
					target = ROOT
					modifier = SOV_for_the_common_good_relation
				}
			}
		}
	}
}


country_event = {
	id = NSB_Soviet_fascist_civil_war.001
	title = NSB_Soviet_fascist_civil_war.001.t
	desc = NSB_Soviet_fascist_civil_war.001.desc
	picture = GFX_report_event_SOV_military_offensive
	is_triggered_only = yes
	trigger = { NOT = { has_global_flag = SOV_soviet_civil_war } }

	immediate = {
		hidden_effect = { SOV_initiate_civil_war = yes }
	}

	# Civil war starts
	option = {
		name = NSB_Soviet_fascist_civil_war.001.a
		ai_chance = { 
			base = 10
		}

		# SET UP NEW CAPITAL - This is where the player will launch the uprising from
		SOV_set_up_civil_war_capital = yes 
		hidden_effect = {

			# Determine Army size
			SOV_set_up_civil_war_army_fractions = yes 

			# DEPOSE STALIN
			SOV_promote_to_country_leader_provisional = yes 

			#START CIVIL WAR
			SOV_start_civil_war = yes 
			
			# Exiles stuff set up
			SOV_exiles_civil_war_start = yes 
            if = {
                limit = {
                    is_ai = yes
                }
				add_political_power = 200
				add_command_power = 100
			}
		}
	}
}


country_event = {
	id = NSB_Soviet_fascist_civil_war.002
	title = NSB_Soviet_fascist_civil_war.002.t
	desc = NSB_Soviet_fascist_civil_war.002.desc
	picture = GFX_report_event_soldiers_marching
	is_triggered_only = yes

	immediate = {
		
	}

	option = {
		name = NSB_Soviet_fascist_civil_war.002.a
		ai_chance = { 
			base = 10
		}
		SOV_the_eyes_fear_units = yes 
		
	}
}

unit_leader_event = {
	id = NSB_Soviet_fascist_civil_war.003
	title = NSB_Soviet_fascist_civil_war.003.t
	desc = NSB_Soviet_fascist_civil_war.003.desc
	# picture = GFX_report_event_SOV_mongolia_cavalry
	is_triggered_only = yes

	immediate = {
		
	}

	option = {
		name = NSB_Soviet_fascist_civil_war.003.a
		SOV_grigory_semyonov = { set_nationality = SOV }
	}
}

country_event = {
	id = NSB_Soviet_fascist_civil_war.004
	title = NSB_Soviet_fascist_civil_war.004.t
	desc = NSB_Soviet_fascist_civil_war.004.desc
	picture = GFX_report_event_SOV_mongolia_cavalry
	is_triggered_only = yes
	hidden = yes  

	immediate = {
		
	}

	option = {
		name = NSB_Soviet_fascist_civil_war.004.a
		SOV_grigory_semyonov = { 
			unit_leader_event = {
				id = NSB_Soviet_fascist_civil_war.003
				hours = 0
			}
		}
	}
}

###############################################################################################################

 ##  ### #   # ### #       #   #  ##  ###       ##   ##  #   # #   #  ##  #  #     ### #   # ### #  # ###  ## 
#  #  #  #   #  #  #       #   # #  # #  #     #  # #  # ## ## ## ## #  # ## #     #   #   # #   ## #  #  #   
#     #   # #   #  #       # # # #### ###      #    #  # # # # # # # #  # # ##     ##   # #  ##  # ##  #   #  
#  #  #   # #   #  #       # # # #  # #  #     #  # #  # #   # #   # #  # #  #     #    # #  #   #  #  #    # 
 ##  ###   #   ### ###      # #  #  # #  #      ##   ##  #   # #   #  ##  #  #     ###   #   ### #  #  #  ##  

##############################################################################################################

# Post Civil War - Concessions etc
country_event = {
	id = NSB_soviet_civil_war_common.001
	title = NSB_soviet_civil_war_common.001.t
	desc = {
		text = NSB_soviet_civil_war_common.001.desc_left 
		trigger = { SOV_is_left_opposition = yes }
	}
	desc = {
		text = NSB_soviet_civil_war_common.001.desc_right_concessions 
		trigger = { 
			SOV_is_right_opposition = yes 
			OR = {
				has_country_flag = SOV_CSW_transfer_vladivostok_flag
				has_country_flag = SOV_CSW_transfer_sakhalin_flag 
				has_country_flag = SOV_CSW_baku_oil_flag 
				has_country_flag = SOV_CSW_ukraine_germany_flag 
				has_country_flag = SOV_CSW_belarus_uk_flag  
			}
		}
	}
	desc = {
		text = NSB_soviet_civil_war_common.001.desc_right_no_concessions 
		trigger = { 
			SOV_is_right_opposition = yes 
			NOT = { has_country_flag = SOV_CSW_transfer_vladivostok_flag }
			NOT = { has_country_flag = SOV_CSW_transfer_sakhalin_flag }
			NOT = { has_country_flag = SOV_CSW_baku_oil_flag }
			NOT = { has_country_flag = SOV_CSW_ukraine_germany_flag }
			NOT = { has_country_flag = SOV_CSW_belarus_uk_flag  }
		}
	}
	desc = {
		text = NSB_soviet_civil_war_common.001.desc_exiles
		trigger = { 
			SOV_is_exiles = yes 
		}
	}
	picture = GFX_report_event_generic_ruins

	is_triggered_only = yes

	
	option = {
		name = NSB_soviet_civil_war_common.001.a

		# Vladivostok 
		IF = {
			limit = {
				has_country_flag = SOV_CSW_transfer_vladivostok_flag 
				owns_state = 408
			}
			JAP = {
				transfer_state = 408
			}
		}

		# Send Japanese General home
		every_army_leader = {
			limit = {
				has_character_flag = japanese_expeditionary_leader_flag
			}
			set_nationality = JAP
		}

		# North Sakhalin 
		IF = {
			limit = {
				has_country_flag = SOV_CSW_transfer_sakhalin_flag 
				owns_state = 655
			}
			JAP = {
				transfer_state = 655
				add_state_claim = 655
			}
		}

		# Baku Oil
		IF = {
			limit = {
				has_country_flag = SOV_CSW_baku_oil_flag 
				owns_state = 229
			}
			give_resource_rights = { receiver = GER state = 229 }
		}

		# Send advisors home
		every_army_leader = {
			limit = {
				has_trait = trait_SOV_foreign_military_advisor
			}
			set_nationality = GER
			remove_unit_leader_trait = trait_SOV_foreign_military_advisor
		}

		# Ukrainian oil for Germany 
		IF = {
			limit = {
				has_country_flag = SOV_CSW_ukraine_germany_flag 
				UKR = { owns_state = 192 }
			}
			UKR = { give_resource_rights = { receiver = GER state = 229 } }
		}

		# Independence for Belarus
		
		IF = {
			limit = {
				has_country_flag = SOV_CSW_belarus_uk_flag 
			}
			release = BLR
		}


		# Set capital 
		country_event = {
			id = NSB_soviet_civil_war_common.002
			days = 7
			random_days = 5
		}
		# De-stalinization 
		country_event = {
			id = NSB_soviet_civil_war_common.010
			days = 21
			random_days = 7
		}
		hidden_effect = {
			news_event = { id = nsb_news.10 hours = 8 }
		}
	}
}

# Post Civil War - Capital selection
country_event = {
	id = NSB_soviet_civil_war_common.002
	title = NSB_soviet_civil_war_common.002.t
	desc = NSB_soviet_civil_war_common.002.desc
	picture = GFX_report_event_generic_ruins 

	is_triggered_only = yes

	# Moscow
	option = {
		name = NSB_soviet_civil_war_common.002.a
		ai_chance = {
			base = 10
			modifier = {
				factor = 1.5
				SOV_is_right_opposition = yes 
			}
			modifier = {
				factor = 2
				has_country_leader = { character = SOV_lev_kamenev }
			}
		}
		trigger = {
			219 = { 
				is_owned_by = ROOT 
				is_controlled_by = ROOT
			}
		}
		set_capital = { state = 219 }

	}
	# Leningrad
	option = {
		name = NSB_soviet_civil_war_common.002.b
		ai_chance = {
			base = 5
			modifier = {
				factor = 3
				has_country_leader = { character = SOV_grigory_zinovyev }
			}
		}
		trigger = {
			195 = { 
				is_owned_by = ROOT 
				is_controlled_by = ROOT
			}
			NOT = { SOV_is_exiles = yes }
		}
		set_capital = { state = 195 }
	}
	# Petrograd
	option = {
		name = NSB_soviet_civil_war_common.002.c
		ai_chance = {
			base = 5
			modifier = {
				factor = 4
				has_country_leader = { character = SOV_lev_trotsky }
			}
		}
		trigger = {
			195 = { 
				is_owned_by = ROOT 
				is_controlled_by = ROOT
			}
			NOT = { SOV_is_exiles = yes }
		}
		195 = { set_state_name = SOV_petrograd }
		set_province_name = {
			id = 3151
			name = SOV_petrograd
		}
		set_capital = { state = 195 }
	}
	# Keep the one we have
	option = {
		name = NSB_soviet_civil_war_common.002.d
		ai_chance = {
			base = 1
		}
		trigger = {
			var:SOV_civil_war_start_state = { is_owned_by = ROOT }
		}
		set_capital = { state = var:SOV_civil_war_start_state }
	}
	# Vladivostok
	option = {
		name = NSB_soviet_civil_war_common.002.e
		ai_chance = {
			base = 2
		}
		trigger = {
			408 = { 
				is_owned_by = ROOT 
				is_controlled_by = ROOT
			}
			SOV_is_exiles = yes
		}
		set_capital = { state = 408 }
	}
	# St. Petersburg
	option = {
		name = NSB_soviet_civil_war_common.002.f
		ai_chance = {
			base = 10
		}
		trigger = {
			195 = { 
				is_owned_by = ROOT 
				is_controlled_by = ROOT
			}
			SOV_is_exiles = yes
		}
		195 = { set_state_name = SOV_StPetersburg }
		set_province_name = {
			id = 3151
			name = SOV_StPetersburg
		}
		set_capital = { state = 195 }
	}
}

# LAUNCH CIVIL WAR BASED ON HIGH PARANOIA
country_event = {
	id = NSB_soviet_civil_war_common.003
	title = NSB_soviet_civil_war_common.003.t
	desc = NSB_soviet_civil_war_common.003.desc
	picture = GFX_report_event_soviet_soldiers

	is_triggered_only = yes

	# Here we go
	option = {
		name = NSB_soviet_civil_war_common.003.a
		IF = { 
			limit = {
				SOV_is_left_opposition = yes 
			}
			country_event = {
				id = NSB_soviet_communist_civil_war.001
				hours = 1
			}
		}
		ELSE_IF = { 
			limit = {
				SOV_is_right_opposition = yes 
			}
			country_event = {
				id = NSB_soviet_communist_civil_war.003
				hours = 1
			}
		}
		ELSE_IF = { 
			limit = {
				SOV_is_exiles = yes 
			}
			country_event = {
				id = NSB_Soviet_fascist_civil_war.001
				hours = 1
			}
		}
	}
}

# Dispatcher event for Stalin trying to align generals and stuff
country_event = {
	id = NSB_soviet_civil_war_common.004
	title = NSB_soviet_civil_war_common.004.t
	desc = NSB_soviet_civil_war_common.004.desc  
	# # Hidden event, no need for picture
	is_triggered_only = yes
	hidden = yes
	trigger = {
		SOV_soviet_civil_war_not_started = yes # Don't run if war has already started
	}
	option = {
		name = NSB_soviet_civil_war_common.004.a
		IF = { 
			limit = { 
				NOT = { has_global_flag = SOV_soviet_civil_war_over } # Sanity check, in order not to activate more missions once the war has started
			}
			random_list = {
				# Secure loyalty of a General
				10 = {
					random_army_leader = {
						limit = {
							NOT = { has_trait = trait_SOV_stalinist }
							NOT = { has_trait = trait_SOV_bukharinist }
							NOT = { has_trait = trait_SOV_trotskyist }
							NOT = { has_trait = trait_SOV_monarchist_sympathizer }
						}
						set_variable = { SOV.SOV_selected_general_stalin = THIS }

					}
					activate_mission = SOV_align_general_stalin
				}
				10 = {
					random_navy_leader = {
						limit = {
							NOT = { has_trait = trait_SOV_stalinist }
							NOT = { has_trait = trait_SOV_bukharinist }
							NOT = { has_trait = trait_SOV_trotskyist }
							NOT = { has_trait = trait_SOV_monarchist_sympathizer }
						}
						set_variable = { SOV.SOV_selected_admiral_stalin = THIS }

					}
					activate_mission = SOV_align_admiral_stalin
				}
			}
		}
	}
}

# Dispatcher event for Stalinist Focuses

country_event = {
	id = NSB_soviet_civil_war_common.005
	title = NSB_soviet_civil_war_common.005.t
	desc = NSB_soviet_civil_war_common.005.desc 
	# picture =  # Hidden event, no need for picture
	is_triggered_only = yes
	hidden = yes
	trigger = {
		SOV_soviet_civil_war_not_started = yes # Don't run if war has already started
	}
	option = {
		name = NSB_soviet_civil_war_common.004.a
		IF = {
			limit = { NOT = { has_country_flag = SOV_the_stalin_constitution_completed_flag }}
			activate_mission = SOV_the_stalin_constitution_mission
		}
		ELSE_IF = {
			limit = { NOT = { has_country_flag = SOV_the_zinovyevite_terrorist_center_completed_flag }}
			activate_mission = SOV_the_zinovyevite_terrorist_center_mission
		}
		ELSE_IF = {
			limit = { NOT = { has_country_flag = SOV_the_anti_soviet_trotskyist_center_completed_flag }}
			activate_mission = SOV_the_anti_soviet_trotskyist_center_mission
		}
		ELSE_IF = {
			limit = { NOT = { has_country_flag = SOV_the_workers_dictatorship_completed_flag }}
			activate_mission = SOV_the_workers_dictatorship_mission
		}
		ELSE_IF = {
			limit = { NOT = { has_country_flag = SOV_the_military_conspiracy_completed_flag }}
			activate_mission = SOV_the_military_conspiracy_mission
		}
		ELSE_IF = {
			limit = { NOT = { has_country_flag = SOV_socialism_in_one_country_completed_flag }}
			activate_mission = SOV_socialism_in_one_country_mission
		}
		ELSE_IF = {
			limit = { NOT = { has_country_flag = SOV_secure_the_administration_completed_flag }}
			activate_mission = SOV_secure_the_administration_mission
		}
		ELSE_IF = {
			limit = { NOT = { has_country_flag = SOV_the_bloc_of_rights_and_trotskyites_completed_flag }}
			activate_mission = SOV_the_bloc_of_rights_and_trotskyites_mission
		}
		ELSE_IF = {
			limit = { NOT = { has_country_flag = SOV_behead_the_snake_completed_flag }}
			activate_mission = SOV_behead_the_snake_mission
		}
	}
}

# launching opposition partisans after war starts
country_event = {
	id = NSB_soviet_civil_war_common.006
	title = NSB_soviet_civil_war_common.006.t
	desc = NSB_soviet_civil_war_common.006.desc
	picture = GFX_report_event_generic_riot
	is_triggered_only = yes

	immediate = {
		
	}

	option = {
		name = NSB_soviet_civil_war_common.006.a
		ai_chance = { 
			base = 10
		}
		custom_effect_tooltip = SOV_popular_uprising_units_tt
		hidden_effect = { SOV_popular_uprising_units = yes }
		
	}
}

# De-Stalinization
country_event = {
	id = NSB_soviet_civil_war_common.010
	title = NSB_soviet_civil_war_common.010.t
	desc = {
		text = NSB_soviet_civil_war_common.010_right_opposition
		trigger = { SOV_is_right_opposition = yes }
	}
	desc = {
		text = NSB_soviet_civil_war_common.010_left_opposition
		trigger = { SOV_is_left_opposition = yes }
	}
	desc = {
		text = NSB_soviet_civil_war_common.010_exiles
		trigger = { SOV_is_exiles = yes }
	}

	picture = GFX_report_event_stalin_01
	is_triggered_only = yes

	immediate = {
		
	}
	# Volgograd
	option = {
		name = NSB_soviet_civil_war_common.010.a
		
		ai_chance = { 
			base = 10
		}
		trigger = {
			always = yes 
		}
		# Stalingrad
		set_province_name = {
			id = 3529
			name = SOV_Volgograd
		}
		hidden_effect = { 217 = { set_state_name = SOV_Volgograd } }
		# Stalino / Donetsk / Yuzovka / Trotsk 
		set_province_name = {
			id = 6474
			name = SOV_Donetsk
		}
		hidden_effect = { 227 = { set_state_name = SOV_Donetsk } }
		# Stalinabad / Dushanbe
		set_province_name = {
			id = 1384
			name = SOV_Dushanbe
		}
		hidden_effect = { 742 = { set_state_name = SOV_Dushanbe set_state_flag = dushanbe_flag } }
		# Kalinin / Tver
		IF = {
			limit = { NOT = { has_character = SOV_mikhail_kalinin } }
			set_province_name = {
				id = 6245
				name = SOV_Tver
			}
			hidden_effect = { 247 = { set_state_name = SOV_Tver } }
		}
		# Leningrad / Petrograd / St. Petersburg
		IF = {
			limit = {
				195 = { is_capital = no }
				SOV_is_exiles = yes 
			}
			set_province_name = {
				id = 3151
				name = SOV_StPetersburg
			}
			hidden_effect = { 195 = { set_state_name = SOV_StPetersburg } }
		}
		# Engels / Pokrovsk / Kosakenstadt + Marksshtadt / Yekaterinograd / Baronsk
		IF = {
			limit = {
				SOV_is_exiles = yes 
			}
			set_province_name = {
				id = 11523
				name = SOV_Pokrovsk
			}
			set_province_name = {
				id = 9432
				name = SOV_Baronsk
			}
			hidden_effect = { 829 = { set_state_name = SOV_Pokrovsk } }
		}
		# Kirov / Vyatka
		set_province_name = {
			id = 6124
			name = SOV_Vyatka
		}
		hidden_effect = { 400 = { set_state_name = SOV_Vyatka } }


		# Gorky / Nizhny Novgorod
		set_province_name = {
			id = 11375
			name = SOV_Nizhny_Novgorod
		}
		hidden_effect = { 252 = { set_state_name = SOV_Nizhny_Novgorod } }

		# Ordzhonikidze / Vladikavkaz
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 9628
				name = SOV_Vladikavkaz
			}
		}

		# Frunze / Bishkek / Bishkek
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 12583
				name = SOV_Bishkek
			}
		}
		# Yoshkar-Ola / Tsaryovokokshaysk / Krasnokokshaysk
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 9402
				name = SOV_Krasnokokshaysk
			}
		}
		# Kyzil / Belotsarsk / Khem-Beldir
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 10627
				name = SOV_Khem-Beldir
			}
		}
		# Makhachkala / Petrovskoye / Petrovsk-Port
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 6701
				name = SOV_Petrovsk-Port
			}
		}

		# Sverdlovsk / Yekaterinburg /  
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 1821
				name = SOV_Yekaterinburg
			}
			hidden_effect = { 653 = { set_state_name = SOV_Yekaterinburg } }
		}

	}
	# Tsaritsyn
	option = {
		name = NSB_soviet_civil_war_common.010.b
		
		ai_chance = { 
			base = 10
		}
		trigger = {
			SOV_is_exiles = yes 
		}
		# Stalingrad
		set_province_name = {
			id = 3529
			name = SOV_Tsaritsyn
		}
		hidden_effect = { 217 = { set_state_name = SOV_Tsaritsyn } }
		# Stalino / Donetsk / Yuzovka / Trotsk 
		set_province_name = {
			id = 6474
			name = SOV_Yuzovka
		}
		hidden_effect = { 227 = { set_state_name = SOV_Yuzovka } }
		# Stalinabad / Dushanbe
		set_province_name = {
			id = 1384
			name = SOV_Dushanbe
		}
		hidden_effect = { 742 = { set_state_name = SOV_Dushanbe set_state_flag = dushanbe_flag } }
		# Kalinin / Tver
		set_province_name = {
			id = 6245
			name = SOV_Tver
		}
		hidden_effect = { 247 = { set_state_name = SOV_Tver } }
		# Leningrad / Petrograd / St. Petersburg
		IF = {
			limit = {
				195 = { is_capital = no }
				SOV_is_exiles = yes 
			}
			set_province_name = {
				id = 3151
				name = SOV_StPetersburg
			}
			hidden_effect = { 195 = { set_state_name = SOV_StPetersburg } }
		}
		# Engels / Pokrovsk / Kosakenstadt + Marksshtadt / Yekaterinograd / Baronsk
		IF = {
			limit = {
				SOV_is_exiles = yes 
			}
			set_province_name = {
				id = 11523
				name = SOV_Kosakenstadt
			}
			set_province_name = {
				id = 9432
				name = SOV_Yekaterinograd
			}
			hidden_effect = { 829 = { set_state_name = SOV_Yekaterinograd } }
		}
		# Kirov / Vyatka
		set_province_name = {
			id = 6124
			name = SOV_Vyatka
		}
		hidden_effect = { 400 = { set_state_name = SOV_Vyatka } }

		# Gorky / Nizhny Novgorod
		set_province_name = {
			id = 11375
			name = SOV_Nizhny_Novgorod
		}
		hidden_effect = { 252 = { set_state_name = SOV_Nizhny_Novgorod } }

		# Ordzhonikidze / Vladikavkaz
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 9628
				name = SOV_Vladikavkaz
			}
		}

		# Frunze / Bishkek / Bishkek
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 12583
				name = SOV_Bishkek
			}
		}
		# Yoshkar-Ola / Tsaryovokokshaysk / Krasnokokshaysk
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 9402
				name = SOV_Tsaryovokokshaysk
			}
		}
		# Kyzil / Belotsarsk / Khem-Beldir
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 10627
				name = SOV_Belotsarsk
			}
		}
		# Makhachkala / Petrovskoye / Petrovsk-Port
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 6701
				name = SOV_Petrovskoye
			}
		}
		# Anadyr / Novo-Mariinsk /
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 13063
				name = SOV_Novo-Mariinsk
			}
		}

		# Sverdlovsk / Yekaterinburg /  
		IF = {
			limit = { SOV_is_exiles = yes }
			set_province_name = {
				id = 1821
				name = SOV_Yekaterinburg
			}
			hidden_effect = { 653 = { set_state_name = SOV_Yekaterinburg } }
		}
	
		
	}
	# Trotskygrad
	option = {
		name = NSB_soviet_civil_war_common.010.c
		
		ai_chance = { 
			base = 10
		}
		trigger = {
			SOV_is_left_opposition = yes
		}
		
		# Stalingrad
		set_province_name = {
			id = 3529
			name = SOV_Trotskygrad
		}
		hidden_effect = { 217 = { set_state_name = SOV_Trotskygrad } }
		
		# Stalino / Donetsk / Yuzovka / Trotsk 
		set_province_name = {
			id = 6474
			name = SOV_Trotsk
		}
		hidden_effect = { 227 = { set_state_name = SOV_Trotsk } }
		# Stalinabad / Dushanbe
		set_province_name = {
			id = 1384
			name = SOV_Smirnovabad
		}
		hidden_effect = { 742 = { set_state_name = SOV_Smirnovabad } }
		# Kalinin / Tver
		IF = {
			limit = { NOT = { has_character = SOV_mikhail_kalinin } }
			IF = {
				limit = { has_character = SOV_grigory_zinovyev}
				set_province_name = {
					id = 6245
					name = SOV_zinovyev
				}
				hidden_effect = { 247 = { set_state_name = SOV_zinovyev } }
			}
			ELSE = {
				set_province_name = {
					id = 6245
					name = SOV_Tver
				}
				hidden_effect = { 247 = { set_state_name = SOV_Tver } }
			}
		}
		# Kirov / Vyatka
		set_province_name = {
			id = 6124
			name = SOV_Vyatka
		}
		hidden_effect = { 400 = { set_state_name = SOV_Vyatka } }

		# Gorky / Nizhny Novgorod
		set_province_name = {
			id = 11375
			name = SOV_Nizhny_Novgorod
		}
		hidden_effect = { 252 = { set_state_name = SOV_Nizhny_Novgorod } }
		
	}
	# Bukharino - Only if Right opposition, but Bukharin has been killed
	option = {
		name = NSB_soviet_civil_war_common.010.d
		
		ai_chance = { 
			base = 10
		}
		trigger = {
			SOV_is_right_opposition = yes
			SOV = { NOT = { has_character = SOV_nikolay_bukharin } }
		}
		# Stalingrad
		set_province_name = {
			id = 3529
			name = SOV_Bukharino
		}
		hidden_effect = { 217 = { set_state_name = SOV_Bukharino } }
		# Stalino / Donetsk / Yuzovka / Trotsk 
		set_province_name = {
			id = 6474
			name = SOV_Donetsk
		}
		hidden_effect = { 227 = { set_state_name = SOV_Donetsk }}
		# Stalinabad / Dushanbe
		set_province_name = {
			id = 1384
			name = SOV_Dushanbe
		}
		hidden_effect = { 742 = { set_state_name = SOV_Dushanbe set_state_flag = dushanbe_flag } }
		# Kalinin / Tver
		IF = {
			limit = { NOT = { has_character = SOV_mikhail_kalinin } }
			set_province_name = {
				id = 6245
				name = SOV_Rykovgrad
			}
			hidden_effect = { 247 = { set_state_name = SOV_Rykovgrad } }
		}
		# Kirov / Vyatka
		set_province_name = {
			id = 6124
			name = SOV_Vyatka
		}
		hidden_effect = { 400 = { set_state_name = SOV_Vyatka } }		

		# Gorky / Nizhny Novgorod
		set_province_name = {
			id = 11375
			name = SOV_Nizhny_Novgorod
		}
		hidden_effect = { 252 = { set_state_name = SOV_Nizhny_Novgorod } }
	}
}


# Sending offer of Vladivostok to Japan
country_event = {
	id = NSB_soviet_civil_war_common.100
	title = NSB_soviet_civil_war_common.100.t
	desc = {
		text = NSB_soviet_civil_war_common.100.desc  
		trigger = {
			SOV = { SOV_is_exiles = no }
		}
	}
	desc = {
		text = NSB_soviet_civil_war_common.100_exiles.desc  
		trigger = {
			SOV = { SOV_is_exiles = yes }
		}
	}
	immediate = {
		hidden_effect = {
			random_army_leader = {
				set_variable = { SOV.SOV_japanese_general = THIS } 
			}
		}
	}

	picture = "[GetJapaneseNegotiationsPicture]" 

	is_triggered_only = yes

	# Japan Agrees
	option = {
		name = NSB_soviet_civil_war_common.100.a
		ai_chance = {
			base = 2 # Japan should be pretty eager to say yes to this deal
			modifier = {
				factor = 5 # Military wants this!
				JAP = { 
					has_government = fascism
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				FROM = {
					SOV_is_opposition = yes
					has_idea = SOV_maksim_litvinov
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.2
				FROM = {
					SOV_is_opposition = yes
					has_idea = SOV_vyacheslav_molotov
				}
			}
		}
		trigger = {
			NOT = { has_manpower < 80000 } # Don't show if not having the troops avaialable
		}
		add_manpower = -80000 # 80k seems to be the standard Japanese Russian Far East expeditionary force size, so why not this time around as well...
		FROM = {
			country_event = {
				id = NSB_soviet_civil_war_common.101
				hours = 8 
				random_hours = 12
			}
		}
		hidden_effect = {
			var:SOV.SOV_japanese_general = { set_character_flag = japanese_expeditionary_leader_flag }
		}
		custom_effect_tooltip = vladivostock_concession_tt
	}
	# Japan Refuses
	option = {
		name = NSB_soviet_civil_war_common.100.b
		ai_chance = {
			base = 1
			modifier = {
				factor = 0 # A fascist / militarist Japan, not already at war won't say no. 
				JAP = { 
					has_war = no
					NOT = { has_government = democratic }
					NOT = { has_government = communism }
				}
			}
			modifier = {
				factor = 1.5 # A non-fascist / militarist Japan, at war will be slightly more inclined not to commit manpower elsewhere
				JAP = { 
					has_war = yes 
					NOT = { has_government = democratic }
					NOT = { has_government = communism }
				}
			}
		}
		
		FROM = {
			country_event = {
				id = NSB_soviet_civil_war_common.102
				hours = 8
				random_hours = 12
			}
		}

	}
}

# Japan wants Vladivostok!
country_event = {
	id = NSB_soviet_civil_war_common.101
	title = NSB_soviet_civil_war_common.101.t
	desc = {
		text = NSB_soviet_civil_war_common.101.desc  
		trigger = {
			NOT = { SOV_is_exiles = yes }
		}
	}
	desc = {
		text = NSB_soviet_civil_war_common.101.desc_exiles
		trigger = {
			SOV_is_exiles = yes
		}
	}
	picture = "[GetJapaneseNegotiationsPicture]" 

	is_triggered_only = yes

	# Japan Agrees
	option = {
		name = NSB_soviet_civil_war_common.101.a
		set_country_flag = SOV_CSW_transfer_vladivostok_flag
		# If war is already raging
		IF = {
			limit = {
				has_global_flag = SOV_soviet_civil_war
				
			}
			hidden_effect = { SOV_set_up_japanese_troops = yes }
		}
	}
}

# Japan refuses Vladivostok!
country_event = {
	id = NSB_soviet_civil_war_common.102
	title = NSB_soviet_civil_war_common.102.t
	desc = NSB_soviet_civil_war_common.102.desc 
	picture = "[GetJapaneseNegotiationsPicture]" 

	is_triggered_only = yes

	# Japan refuses
	option = {
		name = NSB_soviet_civil_war_common.102.a	
	}
}


# How about Sakhalin?
country_event = {
	id = NSB_soviet_civil_war_common.103
	title = NSB_soviet_civil_war_common.103.t
	desc = {
		text = NSB_soviet_civil_war_common.103.desc_exiles
		trigger = { SOV_is_exiles = yes } 
	}
	desc = {
		text = NSB_soviet_civil_war_common.103.desc  
		trigger = {
			NOT = { SOV_is_exiles = yes }
		}
	}
	picture = "[GetJapaneseNegotiationsPicture]" 
	immediate = {
		# Count Rifles!
		set_variable = { SOV.SOV_japanese_rifles = JAP.num_equipment@infantry_equipment }
		clamp_variable = {
			var = SOV.SOV_japanese_rifles
			min = 0
			max = 4000
		}
		# Annie get your gun
		set_variable = { SOV.SOV_japanese_guns = JAP.num_equipment@artillery_equipment }
		clamp_variable = {
			var = SOV.SOV_japanese_guns
			min = 0
			max = 1000
		}
		# Re:zero
		set_variable = { SOV.SOV_japanese_fighters = JAP.num_equipment@small_plane_airframe }
		clamp_variable = {
			var = SOV.SOV_japanese_fighters
			min = 0
			max = 200
		}
		remove_state_claim = 655 #dont go to war for land youll be getting - readded if offer refused
	}
	is_triggered_only = yes

	# We has loads, have a bunch!
	option = {
		name = NSB_soviet_civil_war_common.103.a
		ai_chance = {
			base = 2 # Japan should be pretty eager to say yes to this deal
			modifier = {
				factor = 5 # Military wants this!
				JAP = { 
					has_government = fascism
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				FROM = {
					SOV_is_opposition = yes
					has_idea = SOV_maksim_litvinov
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.2
				FROM = {
					SOV_is_opposition = yes
					has_idea = SOV_vyacheslav_molotov
				}
			}
		}
		trigger = {
			has_equipment = {
				infantry_equipment   > 400
			}
		}
		
		IF = {
			limit = { 
				SOV_soviet_civil_war_not_started = yes 
			}
			set_temp_variable = { temp_rifles = SOV.SOV_japanese_rifles }
			multiply_temp_variable = {temp_rifles = -1 }
			set_temp_variable = { temp_guns = SOV.SOV_japanese_guns }
			multiply_temp_variable = {temp_guns = -1 }
			set_temp_variable = { temp_fighters = SOV.SOV_japanese_fighters }
			multiply_temp_variable = {temp_fighters = -1 }
			# Storing equipment for a later date...
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = var:temp_rifles
			}
			add_equipment_to_stockpile = {
				type = artillery_equipment
				amount = var:temp_guns
			}
			add_equipment_to_stockpile = {
				type = small_plane_airframe
				amount = var:temp_fighters
			}
		}
		ELSE = {
			# If war is raging, just send the stuff
			send_equipment = {
				equipment = infantry_equipment
				amount = SOV.SOV_japanese_rifles
				target = SOV
			}
			send_equipment = {
				equipment = artillery_equipment
				amount = SOV.SOV_japanese_guns
				target = SOV
			}
			send_equipment = {
				equipment = small_plane_airframe
				amount = SOV.SOV_japanese_fighters
				target = SOV
			}
		}
		FROM = {
			set_country_flag = SOV_CSW_transfer_sakhalin_flag
			country_event = {
				id = NSB_soviet_civil_war_common.104
				hours = 8
				random_hours = 12
			}
		}
		custom_effect_tooltip = sakhalin_concession_tt
	}

	# We should be able to spare rifles at least
	option = {
		name = NSB_soviet_civil_war_common.103.b
		ai_chance = {
			base = 1 # Japan should be pretty eager to say yes to this deal
			modifier = {
				factor = 2 # Military wants this!
				JAP = { 
					has_government = fascism
				}
			}
		}
		trigger = {
			has_equipment = {
				infantry_equipment > 199
			}
		}
		IF = {
			limit = { 
				OR = {
					SOV_soviet_civil_war_not_started = yes 
					# TODO Add relevant trigger for Fascist Civil war or simply remove this if using same...
				}
			}
			# Storing equipment for a later date...
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = -200
			}
			set_variable = { SOV.SOV_japanese_rifles = 200 }
			set_variable = { SOV.SOV_japanese_guns = 0 }
			set_variable = { SOV.SOV_japanese_fighters = 0 }
		}
		ELSE = {
			# If war is raging, just send the stuff
			send_equipment = {
				equipment = infantry_equipment
				amount = 200
				target = SOV
			}
			
		}
		FROM = {
			set_country_flag = SOV_CSW_transfer_sakhalin_flag
			country_event = {
				id = NSB_soviet_civil_war_common.104
				hours = 8 
				random_hours = 12
			}
		}
		custom_effect_tooltip = sakhalin_concession_tt
	}
	# No but we can buy some!
	option = {
		name = NSB_soviet_civil_war_common.103.c
		ai_chance = {
			base = 1 # Japan should be pretty eager to say yes to this deal
			modifier = {
				factor = 3 # Military wants this!
				JAP = { 
					has_government = fascism
				}
			}
		}
		trigger = {
			NOT = { 
				has_equipment = {
					infantry_equipment > 400
				}
			}
		}
		ROOT = { 
			add_timed_idea = { 
				idea = SOV_arms_purchases_idea 
				days = 365 
			} 
		}
		set_variable = { SOV.SOV_japanese_rifles = 2500 }
		set_variable = { SOV.SOV_japanese_guns = 200 }
		set_variable = { SOV.SOV_japanese_fighters = 150 }
		FROM = {
			set_country_flag = SOV_CSW_transfer_sakhalin_flag
			country_event = {
				id = NSB_soviet_civil_war_common.104
				hours = 8 
				random_hours = 12
			}
		}
		custom_effect_tooltip = sakhalin_concession_tt
		hidden_effect = {
			IF = {
				limit = {
					OR = {
						has_global_flag = SOV_soviet_civil_war 
					}
				}
				FROM = {
					add_equipment_to_stockpile = {
						type = infantry_equipment
						amount =  SOV.SOV_japanese_rifles
						producer = JAP
					}
					add_equipment_to_stockpile = {
						type = artillery_equipment
						amount = SOV.SOV_japanese_guns
						producer = JAP
					}
					add_equipment_to_stockpile = {
						type = small_plane_airframe
						amount = SOV.SOV_japanese_fighters
						producer = SOV
					}
				}
			}
		}
	}
	# It ain't worth it
	option = {
		name = NSB_soviet_civil_war_common.103.d
		ai_chance = {
			base = 1
			modifier = {
				factor = 0 # A fascist / militarist Japan, not already at war won't say no. 
				JAP = { 
					has_war = no
					NOT = { has_government = democratic }
					NOT = { has_government = communism }
				}
			}
			modifier = {
				factor = 1.25 # A non-fascist / militarist Japan, at war will be slightly more inclined not to commit equipment elsewhere
				JAP = { 
					has_war = yes 
					NOT = { has_government = democratic }
					NOT = { has_government = communism }
				}
			}
		}
		add_state_claim = 655
		FROM = {
			country_event = {
				id = NSB_soviet_civil_war_common.105
				days = 2
				random_hours = 12 
			}
		}
	}
}

# Japan wants Sakhalin
country_event = {
	id = NSB_soviet_civil_war_common.104
	title = NSB_soviet_civil_war_common.104.t
	desc = NSB_soviet_civil_war_common.104.desc 
	picture = "[GetJapaneseNegotiationsPicture]" 

	is_triggered_only = yes

	# Japan Agrees
	option = {
		name = NSB_soviet_civil_war_common.104.a
	}
}

# Japan refuses Sakhalin
country_event = {
	id = NSB_soviet_civil_war_common.105
	title = NSB_soviet_civil_war_common.105.t
	desc = NSB_soviet_civil_war_common.105.desc 
	picture = "[GetJapaneseNegotiationsPicture]"  

	is_triggered_only = yes

	# Japan refuses
	option = {
		name = NSB_soviet_civil_war_common.105.a	
	}
}

# Baku Oil fields in return for help with military buildup
country_event = {
	id = NSB_soviet_civil_war_common.106
	title = NSB_soviet_civil_war_common.106.t
	desc = {
		text = NSB_soviet_civil_war_common.106.desc_right_opp_before 
		trigger = { 
			SOV_soviet_civil_war_not_started = yes 
			NOT = { SOV_is_exiles = yes }
		}
	}
	desc = {
		text = NSB_soviet_civil_war_common.106.desc_right_opp_civil_war 
		trigger = { 
			has_global_flag = SOV_soviet_civil_war 
			NOT = { SOV_is_exiles = yes }
		}
	}
	desc = {
		text = NSB_soviet_civil_war_common.106.desc_exiles_before 
		trigger = { 
			SOV_soviet_civil_war_not_started = yes 
			SOV_is_exiles = yes
		}
	}
	desc = {
		text = NSB_soviet_civil_war_common.106.desc_exiles_civil_war 
		trigger = { 
			has_global_flag = SOV_soviet_civil_war 
			SOV_is_exiles = yes 
		}
	}
	
	picture =  GFX_report_event_generic_read_write

	is_triggered_only = yes

	# Yes plz
	option = {
		name = NSB_soviet_civil_war_common.106.a
		ai_chance = {
			base = 4 # It's most likely worth it
			modifier = {
				factor = 1.5 # fascists are extra keen to get hands on more oil
				GER = { 
					has_government = fascism
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 0.8
				FROM = {
					SOV_is_opposition = yes
					has_idea = SOV_maksim_litvinov
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.2
				FROM = {
					SOV_is_opposition = yes
					has_idea = SOV_vyacheslav_molotov
				}
			}
		}
		ROOT = {
			custom_effect_tooltip = SOV_baku_oil_fields_tt
			add_timed_idea = {
				idea = SOV_covert_military_buildup_idea
				days = 60
			}
		}
		FROM = {
			set_country_flag = SOV_CSW_baku_oil_flag
			country_event = {
				id = NSB_soviet_civil_war_common.107
				hours = 1
			}
			IF = {
				limit = { 
					SOV_soviet_civil_war_not_started = no 
				}
				IF = {
					limit = {
						NOT = {
							has_dlc = "No Step Back"
						}
					}
					SOV = { add_equipment_to_stockpile = { type = light_tank_equipment_2 amount = 100 producer = GER } }
				}
				ELSE = { 
					SOV = { add_equipment_to_stockpile = { type = light_tank_chassis_2 amount = 100 producer = GER variant_name = "Panzer II Ausf. a" } }
				}
				SOV = { add_equipment_to_stockpile = { type = infantry_equipment_0 amount = 200 producer = GER } }
			}
		}	
	}
	# Yes plz - and let's send som "advisors"
	option = {
		name = NSB_soviet_civil_war_common.106.b
		ai_chance = {
			base = 4 # It's most likely worth it
			modifier = {
				factor = 0.5 # Probably not as easy to motivate if democratic
				GER = { 
					has_government = democratic
				}
			}
			modifier = {
				factor = 2 # More likely if both are going down the fascist path
				GER = { has_government = fascism }
				SOV = { SOV_is_exiles = yes }
			}
			modifier = {
				factor = 0
				GER = { 
					has_war = yes
				}
			}
		}
		ROOT = {
			custom_effect_tooltip = SOV_baku_oil_fields_tt
			custom_effect_tooltip = SOV_german_advisors_tt
			add_timed_idea = {
				idea = SOV_covert_military_buildup_idea
				days = 120
			}
		}
		FROM = {
			set_country_flag = SOV_CSW_baku_oil_flag
			set_country_flag = SOV_CSW_german_advisors_flag
			country_event = {
				id = NSB_soviet_civil_war_common.107
				hours = 6
			}	
		}
	}
	# Refuse
	option = {
		name = NSB_soviet_civil_war_common.106.c
		ai_chance = {
			base = 1
			modifier = {
				factor = 5
				GER = { 
					has_war = yes 
				}
			}
		}
		FROM = {
			country_event = {
				id = NSB_soviet_civil_war_common.108
				hours = 6
			}	
		}	
	}
}

# Baku Oil fields yes please
country_event = {
	id = NSB_soviet_civil_war_common.107
	title = NSB_soviet_civil_war_common.107.t
	desc = {
		text = NSB_soviet_civil_war_common.107.desc_advisors 
		trigger = { has_country_flag = SOV_CSW_german_advisors_flag }
	}
	desc = {
		text = NSB_soviet_civil_war_common.107.desc_normal 
		trigger = { NOT = { has_country_flag = SOV_CSW_german_advisors_flag } }
	}
	picture = GFX_report_event_generic_sign_treaty1  

	is_triggered_only = yes

	option = {
		name = NSB_soviet_civil_war_common.107.a	
		IF = {
			limit = { 
				has_country_flag = SOV_soviet_civil_war 
				has_country_flag = SOV_CSW_german_advisors_flag 
			}
			GER = {
				country_event = {
					id = NSB_soviet_civil_war_common.109
					hours = 6
				}
			}
		}
	}
	
}

# Baku Oil fields no thanks
country_event = {
	id = NSB_soviet_civil_war_common.108
	title = NSB_soviet_civil_war_common.108.t
	desc = NSB_soviet_civil_war_common.108.desc
	picture =  GFX_report_event_german_reichstag_gathering

	is_triggered_only = yes

	option = {
		name = NSB_soviet_civil_war_common.108.a	
	}
	
}

# Sending "advisors"
country_event = {
	id = NSB_soviet_civil_war_common.109
	title = NSB_soviet_civil_war_common.109.t
	desc = NSB_soviet_civil_war_common.109.desc 
	picture = GFX_report_event_german_inspect_troops
	is_triggered_only = yes
	immediate = {
		hidden_effect = {
			random_army_leader = {
				# limit = { is_high_command = no }
				add_unit_leader_trait = trait_SOV_foreign_military_advisor
				set_variable = { ROOT.SOV_foreign_military_advisor_1 = THIS }
			}
			random_army_leader = {
				limit = { 
					# is_high_command = no 
					NOT = { has_trait = trait_SOV_foreign_military_advisor }
				}
				add_unit_leader_trait = trait_SOV_foreign_military_advisor
				set_variable = { ROOT.SOV_foreign_military_advisor_2 = THIS }
			}
		}
	}
	option = {
		name = NSB_soviet_civil_war_common.109.a	
		#var:ROOT.SOV_foreign_military_advisor_1 = { set_nationality = SOV }
		#var:ROOT.SOV_foreign_military_advisor_2 = { set_nationality = SOV }
		every_army_leader = {
			limit = {
				has_trait = trait_SOV_foreign_military_advisor
			}
			set_nationality = SOV
		}
	}
}

# Ukraininan independence to Germany
country_event = {
	id = NSB_soviet_civil_war_common.110
	title = NSB_soviet_civil_war_common.110.t
	desc = NSB_soviet_civil_war_common.110.desc 
	picture =  GFX_report_event_generic_read_write

	is_triggered_only = yes
	# Germany supports militia
	option = {
		name = NSB_soviet_civil_war_common.110.a
		ai_chance = {
			base = 5 # in general Germany should be pretty interested in wrecking havoc in the USSR
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 0.8
				FROM = {
					SOV_is_opposition = yes
					has_idea = SOV_maksim_litvinov
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.2
				FROM = {
					SOV_is_opposition = yes
					has_idea = SOV_vyacheslav_molotov
				}
			}
		}
		ROOT = {
			custom_effect_tooltip = SOV_ukraine_insurrection_tt
			add_timed_idea = {
				idea = SOV_covert_ukrainian_military_buildup_idea
				days = 180
			}
		}
		FROM = {
			set_country_flag = SOV_CSW_ukraine_germany_flag
			country_event = {
				id = NSB_soviet_civil_war_common.111
				hours = 6
			}
		}	
	}
	# Not interested
	option = {
		name = NSB_soviet_civil_war_common.110.b	
		ai_chance = {
			base = 1
			modifier = {
				factor = 2 # Not as interested if already involved in a war
				ROOT = { 
					has_war = yes 
				}
			}
			modifier = {
				factor = 2 # Even less interested if already involved in a war and democratic
				ROOT = { 
					has_war = yes 
					has_government = democratic
				}
			}
			modifier = {
				factor = 3 # Even less interested if already involved in a war with a major country
				any_country = {
					is_major = yes
					has_war_with = ROOT
				}
			}
		}
		FROM = {
			country_event = {
				id = NSB_soviet_civil_war_common.112
				hours = 6
			}
		}
	}
}

#Ukraininan independence yes please
country_event = {
	id = NSB_soviet_civil_war_common.111
	title = NSB_soviet_civil_war_common.111.t
	desc = NSB_soviet_civil_war_common.111.desc 
	picture =  GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	option = {
		name = NSB_soviet_civil_war_common.111.a	
	}
}

# Ukraininan independence no thanks
country_event = {
	id = NSB_soviet_civil_war_common.112
	title = NSB_soviet_civil_war_common.112.t
	desc = NSB_soviet_civil_war_common.112.desc 
	picture =  GFX_report_event_german_reichstag_gathering

	is_triggered_only = yes

	option = {
		name = NSB_soviet_civil_war_common.112.a	
	}
}

# Ukrainian insurrection prepped
country_event = {
	id = NSB_soviet_civil_war_common.113
	title = NSB_soviet_civil_war_common.113.t
	desc = {
		text = NSB_soviet_civil_war_common.113.desc_before
		trigger = { SOV_soviet_civil_war_not_started = yes } 
	}
	desc = {
		text = NSB_soviet_civil_war_common.113.desc_started
		trigger = { 
			OR = {
				has_global_flag = SOV_soviet_civil_war
				has_global_flag = SOV_soviet_civil_war_over
			}
		} 
	}

	picture =  GFX_report_event_gre_rural_rebels

	is_triggered_only = yes

	# Ukraine attacks Stalin now
	option = {
		name = NSB_soviet_civil_war_common.113.a	
		trigger = {
			has_global_flag = SOV_soviet_civil_war  
		}
		country_event = {
			id = NSB_soviet_civil_war_common.114
			hours = 6
		}
	}
	# Ukrainians are ready to strike when war breaks out
	option = {
		name = NSB_soviet_civil_war_common.113.b	
		trigger = {
			SOV_soviet_civil_war_not_started = yes 
		}
		set_country_flag = SOV_CSW_ukraine_germany_ready_flag
	}
	# Civil war over, the Ukrainians will launch the rebellion anyhow
	option = {
		name = NSB_soviet_civil_war_common.114.b	
		trigger = {
			has_global_flag = SOV_soviet_civil_war_over 
		}
		country_event = {
			id = NSB_soviet_civil_war_common.114
			hours = 6
		}
	}
}

# ukrainian insurrection starts 
country_event = {
	id = NSB_soviet_civil_war_common.114
	title = NSB_soviet_civil_war_common.114.t
	desc = NSB_soviet_civil_war_common.114.desc 
	picture =  GFX_report_event_generic_rally2

	is_triggered_only = yes
	immediate = {
		hidden_effect = {
			every_country = {
				limit = {
					original_tag = SOV
				}
				every_owned_state = {
					limit = { is_core_of = UKR }
					UKR = { transfer_state = PREV }
				}
			}
		}
		UKR = {
			division_template = {
			    name = "German Trained Division"
				priority = 1
				template_counter = 3
				regiments = {
					infantry = { x = 0 y = 0 }
					infantry = { x = 0 y = 1 }
					infantry = { x = 0 y = 2 }
					infantry = { x = 1 y = 0 }
					infantry = { x = 1 y = 1 }
					infantry = { x = 1 y = 2 }
					artillery_brigade = { x= 2 y = 0}
				}
				is_locked = yes 
			}
			every_owned_state = {
				limit = { is_core_of = UKR }
				create_unit = { 
					division = "name = \"German Division\" division_template = \"German Trained Division\" start_experience_factor = 0.2 start_equipment_factor = 0.95" owner = UKR 
				}
			}

		}
	}

	option = {
		name = NSB_soviet_civil_war_common.114.a	
		trigger = {
			has_global_flag = SOV_soviet_civil_war_over 
		}
		
		declare_war_on = {
			target = UKR
			type = annex_everything
		} 
	}
	option = {
		name = NSB_soviet_civil_war_common.114.b	
		trigger = {
			has_global_flag = SOV_soviet_civil_war_over 
		}
	}
	option = {
		name = NSB_soviet_civil_war_common.114.c	
		trigger = {
			NOT = { has_global_flag = SOV_soviet_civil_war_over }
		}
		SOS = {
			declare_war_on = {
				target = UKR
				type = annex_everything
			} 
		}
	}
}


# Belarus -> UK
country_event = {
	id = NSB_soviet_civil_war_common.115
	title = NSB_soviet_civil_war_common.115.t
	desc = NSB_soviet_civil_war_common.115.desc
	picture =  GFX_report_event_generic_read_write

	is_triggered_only = yes
	# UK agrees
	option = {
		name = NSB_soviet_civil_war_common.115.a
		ai_chance = {
			base = 5 # in general the UK should be pretty interested in restoring Belarus
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.2
				FROM = {
					SOV_is_opposition = yes
					has_idea = SOV_maksim_litvinov
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 0.8
				FROM = {
					SOV_is_opposition = yes
					has_idea = SOV_vyacheslav_molotov
				}
			}
		}
		ROOT = {
			custom_effect_tooltip = SOV_belarus_tt
			add_timed_idea = {
				idea = SOV_arms_purchases_idea
				days = 150 # TODO set correct number of days
			}
			add_timed_idea = {
				idea = SOV_covert_military_buildup_idea
				days = 180 # TODO set correct number of days
			}
		}
		FROM = {
			set_country_flag = SOV_CSW_belarus_uk_flag
			country_event = {
				id = NSB_soviet_civil_war_common.116
				hours = 1
			}
		}	
	}
	# Not interested
	option = {
		name = NSB_soviet_civil_war_common.115.b	
		ai_chance = {
			base = 1
			modifier = {
				factor = 5 # Not as interested if already involved in a war
				ROOT = { 
					has_war = yes 
				}
			}
			modifier = {
				factor = 2 # Even less interested if already involved in a war with a major country
				any_country = {
					is_major = yes
					has_war_with = ROOT
				}
			}
		}
		FROM = {
			country_event = {
				id = NSB_soviet_civil_war_common.117
				hours = 1
			}
		}
	}
}

#Belarus independence yes please
country_event = {
	id = NSB_soviet_civil_war_common.116
	title = NSB_soviet_civil_war_common.116.t
	desc = NSB_soviet_civil_war_common.116.desc 
	picture =  GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	option = {
		name = NSB_soviet_civil_war_common.116.a	
	}
}

# Belarus independence no thanks
country_event = {
	id = NSB_soviet_civil_war_common.117
	title = NSB_soviet_civil_war_common.117.t
	desc = NSB_soviet_civil_war_common.117.desc 
	picture =  GFX_report_event_generic_parliament

	is_triggered_only = yes

	option = {
		name = NSB_soviet_civil_war_common.117.a	
	}
}

# Funds for the cause
country_event = {
	id = NSB_soviet_civil_war_common.118
	title = NSB_soviet_civil_war_common.118.t
	desc = NSB_soviet_civil_war_common.118.desc
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes

	# Give them a lot
	option = {
		name = NSB_soviet_civil_war_common.118.a
		ai_chance = { 
			base = 40
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.5
				FROM = {
					SOV_is_opposition = yes
					has_idea = SOV_maksim_litvinov
				}
			}
			modifier = { #Appropriate PC for Foreign Affairs
				factor = 1.2
				FROM = {
					SOV_is_opposition = yes
					has_idea = SOV_vyacheslav_molotov
				}
			}
		}
		trigger = {
			has_equipment = {
				infantry_equipment > 199
			}
		}
		IF = {
			limit = { 
				SOV_soviet_civil_war_not_started = yes 
			}
			add_to_array = {
				array = SOV.many_weapons_array
				value = ROOT
			}
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = -200
			}
		}
		ELSE = {
			# If war is raging, just send the stuff
			send_equipment = {
				equipment = infantry_equipment
				amount = 200
				target = SOV
			}
		}
		FROM = {
			country_event = {
				id = NSB_soviet_civil_war_common.119
				days = 1
				random_days = 5
			}
		}
		set_country_flag = SOV_supporting_trotsky_flag
	}

	# Give them some
	option = {
		name = NSB_soviet_civil_war_common.118.b
		ai_chance = { 
			base = 20
		}
		trigger = {
			has_equipment = {
				infantry_equipment > 49
			}
		}
		IF = {
			limit = { 
				SOV_soviet_civil_war_not_started = yes 
			}
			add_to_array = {
				array = SOV.some_weapons_array
				value = ROOT
			}
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = -50
			}
		}
		ELSE = {
			# If war is raging, just send the stuff
			send_equipment = {
				equipment = infantry_equipment
				amount = 50
				target = SOV
			}
		}
		FROM = {
			country_event = {
				id = NSB_soviet_civil_war_common.119
				days = 1
				random_days = 5
			}
		}
		set_country_flag = SOV_supporting_trotsky_flag
	}
	# we can buy some
	option = {
		name = NSB_soviet_civil_war_common.118.c
		ai_chance = { 
			base = 20
		}
		trigger = {
			has_equipment = {
				infantry_equipment < 50
			}
		}
		ROOT = { add_timed_idea = { idea = SOV_arms_purchases_idea days = 365 } }
		IF = {
			limit = { 
				SOV_soviet_civil_war_not_started = yes 
			}
			add_to_array = {
				array = SOV.some_weapons_array
				value = ROOT
			}
			
		}
		ELSE = {
			# If war is raging, just send the stuff
			hidden_effect = {
				FROM = {
					add_equipment_to_stockpile = {
						type = infantry_equipment
						amount = 200
						producer = ROOT
					}
				}
			}	
		}
		FROM = {
			country_event = {
				id = NSB_soviet_civil_war_common.119
				days = 1
				random_days = 5
			}
		}
		set_country_flag = SOV_supporting_trotsky_flag
	}
	

	# Don't give them any
	option = {
		name = NSB_soviet_civil_war_common.118.d
		ai_chance = { 
			base = 10
		}
		FROM = {
			country_event = {
				id = NSB_soviet_civil_war_common.120
				days = 1
				random_days = 5
			}
		}
	}
}

# Have some guns
country_event = {
	id = NSB_soviet_civil_war_common.119
	title = NSB_soviet_civil_war_common.119.t
	desc = NSB_soviet_civil_war_common.119.desc 
	picture =  GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	option = {
		name = NSB_soviet_civil_war_common.119.a	
	}
}

# No weapons 
country_event = {
	id = NSB_soviet_civil_war_common.120
	title = NSB_soviet_civil_war_common.120.t
	desc = NSB_soviet_civil_war_common.120.desc
	picture =  GFX_report_event_generic_conference

	is_triggered_only = yes

	option = {
		name = NSB_soviet_civil_war_common.120.a	
	}
}

# Hirohito - tasukete kudasai !
country_event = {
	id = NSB_soviet_civil_war_common.121
	title = NSB_soviet_civil_war_common.121.t
	desc = NSB_soviet_civil_war_common.121.desc
	picture =  "[GetJapaneseNegotiationsPicture]" 

	is_triggered_only = yes

	# hai
	option = {
		name = NSB_soviet_civil_war_common.121.a
		ai_chance = { 
			base = 50
			modifier = {
				factor = 10
				has_government = FROM
			}
		}
		trigger = {
			NOT = { has_government = communism }
			NOT = { has_government = democratic }
		}
		FROM = {
			country_event = {
				id = NSB_soviet_civil_war_common.122
				days = 1
				random_days = 2
			}
		}	
	}
	# iie
	option = {
		name = NSB_soviet_civil_war_common.121.b	
		ai_chance = { 
			base = 10
			modifier = {
				factor = 2
				has_war = yes
			}
		}
		FROM = {
			country_event = {
				id = NSB_soviet_civil_war_common.123
				days = 1
				random_days = 2
			}
		}	
	}
}
# They are coming to help us!
country_event = {
	id = NSB_soviet_civil_war_common.122
	title = NSB_soviet_civil_war_common.122.t
	desc = NSB_soviet_civil_war_common.122.desc
	picture =  GFX_report_event_japanese_transport_soldiers

	is_triggered_only = yes

	option = {
		name = NSB_soviet_civil_war_common.122.a
		# Get Ideology Support
		set_variable = { SOV_communist_support_before_puppet = party_popularity_100@communism }
		set_variable = { SOV_democratic_support_before_puppet = party_popularity_100@democratic }
		set_variable = { SOV_fascist_support_before_puppet = party_popularity_100@fascism }
		set_variable = { SOV_neutrality_support_before_puppet = party_popularity_100@neutrality }
		JAP = {
			add_to_war = { 
			    targeted_alliance = ROOT 
				enemy = SOS 
				hostility_reason = asked_to_join
			}
		}
		FROM = {
			set_autonomy = {
				target = ROOT
				autonomous_state = autonomy_wtt_imperial_protectorate
				end_wars  = no 
				end_civil_wars = no
			}
		}
		# Ensure Provisional government stays Non-aligned
		hidden_effect = {
			ROOT = {
				set_politics = {
					ruling_party = neutrality
				}
			}
			# Reset popluarities to what they were before puppeting 
			set_popularities = {
				communism = SOV.SOV_communist_support_before_puppet
				democratic = SOV.SOV_democratic_support_before_puppet
				fascism = SOV.SOV_fascist_support_before_puppet
				neutrality = SOV.SOV_neutrality_support_before_puppet
			}
			clear_variable = SOV.SOV_communist_support_before_puppet
			clear_variable = SOV.SOV_democratic_support_before_puppet
			clear_variable = SOV.SOV_fascist_support_before_puppet
			clear_variable = SOV.SOV_neutrality_support_before_puppet
		}	
	}
}
# Japan abandones us!
country_event = {
	id = NSB_soviet_civil_war_common.123
	title = NSB_soviet_civil_war_common.123.t
	desc = NSB_soviet_civil_war_common.123.desc
	picture =  GFX_report_event_military_planning

	is_triggered_only = yes

	option = {
		name = NSB_soviet_civil_war_common.123.a	
	}
}

# Factories Done
country_event = {
	id = NSB_soviet_civil_war_common.124
	title = NSB_soviet_civil_war_common.124.t
	desc = NSB_soviet_civil_war_common.124.desc
	picture =  GFX_report_event_generic_factory

	is_triggered_only = yes

	option = {
		name = NSB_soviet_civil_war_common.124.a	
	}
}

# Snowballing - Defections Army
country_event = {
	id = NSB_soviet_civil_war_common.125
	title = NSB_soviet_civil_war_common.125.t
	desc = NSB_soviet_civil_war_common.125.desc
	picture = GFX_report_event_soviet_soldiers_tank

	is_triggered_only = yes

	trigger = {
		NOT = { SOS = { has_capitulated = yes }}
	}

	option = {
		name = NSB_soviet_civil_war_common.125.a
		custom_effect_tooltip = SOS_army_desertions_tt	
		hidden_effect = {
			every_state = {
				limit = {
					OR = {
						is_owned_by = SOV 
						is_owned_by = SOS
					}
				}
				damage_units = {
					state = THIS 
					limit = { tag = SOS } 
					damage = 0.1
					ratio = yes  
					army = yes
				}
			}

			SOS = {
				transfer_units_fraction= {
					target = SOV
					target_organization = 1
					source_organization = 1
					size = 0
					stockpile_ratio = 0
					army_ratio = 0.05
					navy_ratio = 0
					air_ratio = 0
					keep_unit_leaders_trigger = {
						always = yes 
					}
				}

			}
			SOV = { clr_country_flag = SOV_defections_army_flag }
		}
	}
}

# Snowballing - Stockpiles
country_event = {
	id = NSB_soviet_civil_war_common.126
	title = NSB_soviet_civil_war_common.126.t
	desc = NSB_soviet_civil_war_common.126.desc
	picture =  GFX_report_event_generic_rifles

	is_triggered_only = yes
	trigger = {
		NOT = { SOS = { has_capitulated = yes }}
	}

	option = {
		name = NSB_soviet_civil_war_common.126.a	
		
		SOV = { 
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = 200
				producer = SOS
			}
			add_equipment_to_stockpile = {
				type = support_equipment
				amount = 50
				producer = SOS
			}	
		}
		SOS = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = -200
				producer = SOS
			}
			add_equipment_to_stockpile = {
				type = support_equipment
				amount = -50
				producer = SOS
			}	

		}
		SOV = { clr_country_flag = SOV_stockpiles_flag }
	}
}

# Snowballing - Defections Navy
country_event = {
	id = NSB_soviet_civil_war_common.127
	title = NSB_soviet_civil_war_common.127.t
	desc = NSB_soviet_civil_war_common.127.desc
	picture =  GFX_report_event_SOV_purge_navy

	is_triggered_only = yes
	trigger = {
		NOT = { SOS = { has_capitulated = yes }}
	}

	option = {
		name = NSB_soviet_civil_war_common.127.a	
		custom_effect_tooltip = SOS_navy_desertions_tt
		hidden_effect = {
			SOS = {
				transfer_units_fraction= {
					target = SOV
					target_organization = 1
					source_organization = 1
					size = 0
					stockpile_ratio = 0
					army_ratio = 0
					navy_ratio = 0.1
					air_ratio = 0
					keep_unit_leaders_trigger = {
						always = yes 
					}
				}

			}
			SOV = { clr_country_flag = SOV_defections_navy_flag }
		}
	}
}

# Snowballing - Civilian Unrest
country_event = {
	id = NSB_soviet_civil_war_common.128
	title = NSB_soviet_civil_war_common.128.t
	desc = NSB_soviet_civil_war_common.128.desc
	picture =  GFX_report_event_generic_riot

	is_triggered_only = yes
	trigger = {
		NOT = { SOS = { has_capitulated = yes }}
	}

	option = {
		name = NSB_soviet_civil_war_common.128.a
		custom_effect_tooltip = SOS_civilian_unrest_tt
		hidden_effect = { 	
			SOS = {
				every_owned_state = {
					limit = {
						is_controlled_by = SOS
						arms_factory > 1
					}
					damage_building = {
						type = arms_factory
						damage = 2
					}
				}
				every_owned_state = {
					limit = {
						is_controlled_by = SOS
						industrial_complex > 1
					}
					damage_building = {
						type = industrial_complex 
						damage = 2
					}
				}
				add_to_variable = { SOV_surrender_modifier = -0.05 }
			}
			SOV = { clr_country_flag = SOV_civilian_unrest_flag }
		}
	}
}

# Japanese Leader leaves
unit_leader_event = {
	id = NSB_soviet_civil_war_common.129
	title = NSB_soviet_civil_war_common.129.t
	desc = NSB_soviet_civil_war_common.129.desc
	picture =  GFX_report_event_generic_riot

	is_triggered_only = yes

	option = {
		name = NSB_soviet_civil_war_common.129.a
		var:SOV.SOV_japanese_general = { set_nationality = SOV }
	}
}


#  #  ##  ### ###  ##  #  #  ##  #   ###  ## ###     #  # ###  ###  ###  ## ### #  #  ##   ## 
## # #  #  #   #  #  # ## # #  # #    #  #    #      #  # #  # #  #  #  #    #  ## # #    #   
# ## ####  #   #  #  # # ## #### #    #   #   #      #  # ###  ###   #   #   #  # ## # ##  #  
#  # #  #  #   #  #  # #  # #  # #    #    #  #      #  # #    #  #  #    #  #  #  # #  #   # 
#  # #  #  #  ###  ##  #  # #  # ### ### ##   #       ##  #    #  # ### ##  ### #  #  ##  ##  


# Dispatcher event for uprisings 
country_event = {
	id = NSB_soviet_nationalist.000
	title = NSB_soviet_nationalist.000.t
	desc = NSB_soviet_nationalist.000.desc
	picture =  GFX_report_event_SOV_purge_navy
	hidden = yes 
	is_triggered_only = yes

	option = {
		name = NSB_soviet_nationalist.000.a	
		IF = {
			limit = { has_global_flag =  SOV_soviet_civil_war } # No point in kicking off if war has ended already
			random_list = {
				35 = { } # Nothing happens 
				# the "Western" Front
				6 = { # Ukrainian uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 1.5 # To keep a ukrainian uprising always slightly more likely than the others
						always = yes
					}
					modifier = {
						factor = 0
						OR = { 
							has_country_flag = ukr_uprising_flag
							UKR = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = UKR }
					set_country_flag = ukr_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				2 = { # Belarussan uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = blr_uprising_flag
							BLR = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = BLR }
					set_country_flag = blr_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				1 = { # CRI uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0.25
						any_state = {
							is_core_of = CRI
							is_controlled_by = SOV
						}
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = CRI_uprising_flag
							CRI = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = CRI }
					set_country_flag = CRI_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				1 = { # KAR uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0.25
						any_state = {
							is_core_of = KAR
							is_controlled_by = SOV
						}
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = KAR_uprising_flag
							KAR = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = KAR }
					set_country_flag = KAR_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				# The Caucasus 
				3 = { # Georgian uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 1.5 # To keep a georgian uprising always slightly more likely than the others
						always = yes
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = geo_uprising_flag
							GEO = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = GEO }
					set_country_flag = geo_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				2 = { # Armenian uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = arm_uprising_flag
							ARM = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = ARM }
					set_country_flag = arm_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				2 = { # Azer uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = azr_uprising_flag
							AZR = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = AZR }
					set_country_flag = azr_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				1 = { # DAG uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0.25
						any_state = {
							is_core_of = DAG
							is_controlled_by = SOV
						}
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = DAG_uprising_flag
							DAG = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = DAG }
					set_country_flag = DAG_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				1 = { # CIN uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0.25
						any_state = {
							is_core_of = CIN
							is_controlled_by = SOV
						}
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = CIN_uprising_flag
							CIN = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = CIN }
					set_country_flag = CIN_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}

				# Central Asia
				1 = { # Khivan uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0.25
						any_state = {
							is_core_of = KHI
							is_controlled_by = SOV
						}
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = khi_uprising_flag
							KHI = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = KHI }
					set_country_flag = khi_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				1 = { # Bukharan uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0.25
						any_state = {
							is_core_of = BUK
							is_controlled_by = SOV
						}
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = buk_uprising_flag
							BUK = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = BUK }
					set_country_flag = buk_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				1 = { # Kazakh uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0
						any_state = {
							is_core_of = KAZ
							is_controlled_by = SOV
						}
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = kaz_uprising_flag
							KAZ = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = KAZ }
					set_country_flag = kaz_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				1 = { # UZB uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0
						any_state = {
							is_core_of = UZB
							is_controlled_by = SOV
						}
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = uzb_uprising_flag
							UZB = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = UZB }
					set_country_flag = uzb_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				1 = { # KKP uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0.25
						any_state = {
							is_core_of = KKP
							is_controlled_by = SOV
						}
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = kkp_uprising_flag
							KKP = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = KKP }
					set_country_flag = kkp_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				1 = { # TMS uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0.25
						any_state = {
							is_core_of = TMS
							is_controlled_by = SOV
						}
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = tms_uprising_flag
							TMS = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = TMS }
					set_country_flag = tms_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}
				1 = { # KYR uprising
					modifier = {
						add = SOV_civil_war_months
						always = yes
					}
					modifier = {
						factor = 0.25
						any_state = {
							is_core_of = KYR
							is_controlled_by = SOV
						}
					}
					modifier = {
						factor = 0
						OR = {
							has_country_flag = KYR_uprising_flag
							KYR = { exists = yes }
						}
					}
					set_variable = { SOV_nationalist_country = KYR }
					set_country_flag = KYR_uprising_flag
					SOV = { country_event = NSB_soviet_nationalist.001 }
				}

			}
		}
	}
}

# Nationalist Revolt
country_event = {
	id = NSB_soviet_nationalist.001
	title = NSB_soviet_nationalist.001.t
	desc = NSB_soviet_nationalist.001.desc
	picture =  GFX_report_event_generic_rally2
	is_triggered_only = yes
	immediate = {
		hidden_effect = {
			every_country = {
				limit = {
					original_tag = SOV
				}
				every_owned_state = {
					limit = { is_core_of = var:SOV.SOV_nationalist_country }
					var:SOV.SOV_nationalist_country = { transfer_state = PREV }
				}
			}
			# Capture any Stalinist soldiers in our territory
			every_state = {
				limit = { is_owned_by = var:SOV.SOV_nationalist_country}
				SOS = { 
					delete_unit = { 
						state = PREV 
						disband = no 
					}
				}
			}
			var:SOV.SOV_nationalist_country  = {
				division_template = {
				    name = "Resistance Fighters"
					priority = 1
					template_counter = 3
					regiments = {
						infantry = { x = 0 y = 0 }
						infantry = { x = 0 y = 1 }
						infantry = { x = 0 y = 2 }
						infantry = { x = 1 y = 0 }
						infantry = { x = 1 y = 1 }
					}
					is_locked = yes 
				}
				every_owned_state = {
					limit = { is_core_of = var:SOV.SOV_nationalist_country }
					create_unit = { 
						division = "name = \"Resistance Fighters\" division_template = \"Resistance Fighters\" start_experience_factor = 0.05 start_equipment_factor = 0.95" owner = var:SOV.SOV_nationalist_country count = 2
					}
				}
				random_owned_state = {
					limit = { 
						is_core_of = var:SOV.SOV_nationalist_country 
						is_capital = yes
					}
					create_unit = { 
						division = "name = \"Resistance Fighters\" division_template = \"Resistance Fighters\" start_experience_factor = 0.05 start_equipment_factor = 0.95" owner = var:SOV.SOV_nationalist_country count = 2
					}
				}


			}
			var:SOV.SOV_nationalist_country = {
				set_politics = { 
					ruling_party = democratic
					elections_allowed = yes 
				}
				add_popularity = {
					ideology = democratic 
					popularity = 0.4
				}
				add_popularity = {
					ideology = fascism  
					popularity = 0.2
				}
				add_popularity = {
					ideology = neutrality 
					popularity = 0.2
				}
				set_country_flag = SOV_breakaway_country_flag
				set_country_flag = SOV_unrecognized_country_flag 
				set_rule = { can_join_factions = no }
			}
			# Renaming of cities where apropriate 
			IF = {
				limit = { var:SOV.SOV_nationalist_country = { tag = KYR }}
				set_province_name = {
					id = 12583
					name = SOV_Bishkek
				}
			}
			ELSE_IF = {
				limit = { var:SOV.SOV_nationalist_country = { tag = MEL }}
				set_province_name = {
					id = 9402
					name = SOV_Krasnokokshaysk
				}
			}

		}
	}

	option = {
		name = NSB_soviet_nationalist.001.a	
		ai_chance = {
			base = 5 # The AI needs all the help it can get
		}
		var:SOV.SOV_nationalist_country = {
			add_named_threat = { 
				threat = -1
				name = indepence_war_threat
			}
			declare_war_on = {
				target = SOS
				type = independence_wargoal
			}
		}
		var:SOV.SOV_nationalist_country = {
			give_military_access = ROOT
		}
		ROOT = {
			give_military_access = var:SOV.SOV_nationalist_country
		}
	}
	option = {
		name = NSB_soviet_nationalist.001.b	
		ai_chance = {
			base = 1
		}
		var:SOV.SOV_nationalist_country = {
			declare_war_on = {
				target = SOS
				type = independence_wargoal
			}
		}
		var:SOV.SOV_nationalist_country = {
			add_named_threat = { 
				threat = -1 
				name = indepence_war_threat
			}
			declare_war_on = {
				target = ROOT
				type = independence_wargoal
			}
		}
	}
	option = {
		name = NSB_soviet_nationalist.001.c	
		ai_chance = {
			base = 0 # The AI needs all the help it can get
		}
		var:SOV.SOV_nationalist_country = {
			add_named_threat = { 
				threat = -1
				name = indepence_war_threat
			}
			declare_war_on = {
				target = SOS
				type = independence_wargoal
			}
		}

		var:SOV.SOV_nationalist_country = {
			give_military_access = ROOT
		}
		var:SOV.SOV_nationalist_country = {
			change_tag_from = ROOT
		}			
		ROOT = {
			give_military_access = var:SOV.SOV_nationalist_country
		}
	}	
}


# Nationalists offered autonomy
country_event = {
	id = NSB_soviet_nationalist.002
	title = NSB_soviet_nationalist.002.t
	desc = NSB_soviet_nationalist.002.desc
	picture =  GFX_report_event_generic_read_write
	is_triggered_only = yes
	# Nah
	option = {
		name = NSB_soviet_nationalist.002.a	
		ai_chance = {
			base = 1
			modifier = {
				factor = 5
				is_in_faction = yes # Don't surrender so easily if already have friends
			}
			modifier = {
				factor = 2
				check_variable = { ROOT.num_owned_states > 5 } # We're big enough to defend ourselves
			}
		}
		FROM = {
			country_event = {
				id = NSB_soviet_nationalist.004
				days = 3
				random_days = 3
			}
		}
		
	}
	# We have to accept, I suppose
	option = {
		name = NSB_soviet_nationalist.002.b	
		ai_chance = {
			base = 1
			modifier = {
				factor = 2
				check_variable = { ROOT.num_owned_states < 3 }
			}
		}
		FROM = {
			country_event = {
				id = NSB_soviet_nationalist.003
				days = 3
				random_days = 3
			}
		}
	
	}
}

# Nationalists accept puppet status
country_event = {
	id = NSB_soviet_nationalist.003
	title = NSB_soviet_nationalist.003.t
	desc = NSB_soviet_nationalist.003.desc
	picture =  GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes

	option = {
		name = NSB_soviet_nationalist.003.a	
		ai_chance = {
			base = 1 
		}
		ROOT = { puppet = FROM }
	}
}

# Nationalists reject puppet status
country_event = {
	id = NSB_soviet_nationalist.004
	title = NSB_soviet_nationalist.004.t
	desc = NSB_soviet_nationalist.004.desc
	picture =  GFX_report_event_generic_parliament
	is_triggered_only = yes
	# War it is
	option = {
		name = NSB_soviet_nationalist.004.a	
		ai_chance = {
			base = 3 
		}
		declare_war_on = {
			target = FROM
			type = puppet_wargoal_focus
		}
		
	}
	# Ah well, it was a nice try
	option = {
		name = NSB_soviet_nationalist.004.b	
		ai_chance = {
			base = 1
			modifier = {
				factor = 10
				FROM = {
					is_in_faction = yes # Let's not start a world war over this - yet
				}
			}
			modifier = {
				factor = 2
				ROOT = {
					has_war = yes # We should be slightly more careful if already at war.
				}
			}
		}
	}
}


###  ##   ##  ##  ###  ## ###    ###  ##  ##  ###  ###  ## ### 
#   #  # #   #  #  #  #    #      #  #   #  # #  #  #  #    #  
##  ####  #  #     #   #   #      #   #  #### ###   #   #   #  
#   #  #   # #  #  #    #  #      #    # #  # #  #  #    #  #  
#   #  # ##   ##  ### ##   #      #  ##  #  # #  # ### ##   #  


# Events for minor Slavic powers: "Join or die"
country_event = {
	id = NSB_soviet_fascist_tsarist.1
	title = NSB_soviet_fascist_tsarist.1.t
	desc = NSB_soviet_fascist_tsarist.1.desc
	picture = GFX_report_event_generic_sign_treaty3

	is_triggered_only = yes

	# Accept
	option = {
		name = NSB_soviet_fascist_tsarist.1.a
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				strength_ratio = {
				    tag = FROM
				    ratio > 0.8
				}
			}
			modifier = {
				factor = 1.2
				has_opinion = {
				    target = FROM
				    value > 50
				}
			}
			modifier = {
				factor = 1.5
				has_opinion = {
				    target = FROM
				    value > 75
				}
			}
			modifier = {
				factor = 2
				has_opinion = {
				    target = FROM
				    value > 95
				}
			}
			modifier = {
				factor = 2
				is_in_faction_with = FROM
			}
		}
		custom_effect_tooltip = GAME_OVER_TT
		effect_tooltip = {
			FROM = {
				annex_country = {
					target = ROOT
					transfer_troops = yes
				}
			}
		}
		FROM = {
			country_event = NSB_soviet_fascist_tsarist.2
		}
	}

	# Reject
	option = {
		name = NSB_soviet_fascist_tsarist.1.b
		ai_chance = {
			base = 90
			modifier = {
				factor = 0
				is_subject_of = FROM
			}
			modifier = {
				factor = 0.2
				any_country = {
					is_major = yes
					OR = {
						has_wargoal_against = ROOT
						has_war_with = ROOT
					}
				}
			}
			modifier = {
				factor = 0.5
				surrender_progress > 0
			}
			modifier = {
				factor = 0.8
				strength_ratio = {
				    tag = FROM
				    ratio < 0.05
				}
			}
			modifier = {
				factor = 0.8
				has_war = yes
			}
			modifier = {
				factor = 1.2
				has_opinion = {
				    target = FROM
				    value < 0
				}
			}
			modifier = {
				factor = 1.5
				has_opinion = {
				    target = FROM
				    value < -50
				}
			}
			modifier = {
				factor = 2
				has_opinion = {
				    target = FROM
				    value < -75
				}
			}
			modifier = {
				factor = 2
				has_opinion = {
				    target = FROM
				    value < -90
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
				    tag = FROM
				    ratio > 0.5
				}
			}
		}
		effect_tooltip = {
			FROM = {
				create_wargoal = {
				    type = annex_everything
				    target = ROOT
				}
			}
		}
		FROM = {
			country_event = NSB_soviet_fascist_tsarist.3
		}
	}
}

# Events for Russia: Slavic country accepted "Join or die"
country_event = {
	id = NSB_soviet_fascist_tsarist.2
	title = NSB_soviet_fascist_tsarist.2.t
	desc = NSB_soviet_fascist_tsarist.2.desc
	picture = GFX_report_event_generic_read_write

	is_triggered_only = yes

	# Excellent!
	option = {
		name = NSB_soviet_fascist_tsarist.2.a
		annex_country = {
			target = FROM
			transfer_troops = yes
		}
	}
}

# Events for Russia: Slavic country rejected "Join or die"
country_event = {
	id = NSB_soviet_fascist_tsarist.3
	title = NSB_soviet_fascist_tsarist.3.t
	desc = NSB_soviet_fascist_tsarist.3.desc
	picture = GFX_report_event_generic_read_write

	is_triggered_only = yes

	# Excellent!
	option = {
		name = NSB_soviet_fascist_tsarist.3.a
		create_wargoal = {
		    type = annex_everything
		    target = FROM
		}
	}
}

# Event for Central American nations (excluding Mexico): Russia influencing our politics!
country_event = {
	id = NSB_soviet_fascist_tsarist.4
	title = NSB_soviet_fascist_tsarist.4.t
	desc = NSB_soviet_fascist_tsarist.4.desc
	picture = GFX_report_event_worker_protests

	is_triggered_only = yes

	# Bastards!
	option = {
		name = NSB_soviet_fascist_tsarist.4.a
		effect_tooltip = {
			add_timed_idea = {
				idea = SOV_russian_political_influence
				days = 730
			}
		}
	}
}

# Event for American Fascist nations: Wanna join the party?
country_event = {
	id = NSB_soviet_fascist_tsarist.5
	title = NSB_soviet_fascist_tsarist.5.t
	desc = NSB_soviet_fascist_tsarist.5.desc
	picture = GFX_report_event_generic_sign_treaty3

	is_triggered_only = yes

	# Sounds good!
	option = {
		name = NSB_soviet_fascist_tsarist.5.a
		FROM = {
			add_to_faction = ROOT
			hidden_effect = {
				country_event = { id = NSB_soviet_fascist_tsarist.6 }
			}
		}
	}

	# No thanks!
	option = {
		name = NSB_soviet_fascist_tsarist.5.b
		hidden_effect = {
			country_event = { id = NSB_soviet_fascist_tsarist.7 }
		}
	}
}

# Events for Russia: American country joins faction
country_event = {
	id = NSB_soviet_fascist_tsarist.6
	title = NSB_soviet_fascist_tsarist.6.t
	desc = NSB_soviet_fascist_tsarist.6.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Excellent!
	option = {
		name = NSB_soviet_fascist_tsarist.6.a
		effect_tooltip = {
			add_to_faction = FROM
		}
	}
}

# Events for Russia: American country refuses to join faction
country_event = {
	id = NSB_soviet_fascist_tsarist.7
	title = NSB_soviet_fascist_tsarist.7.t
	desc = NSB_soviet_fascist_tsarist.7.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Bummer
	option = {
		name = NSB_soviet_fascist_tsarist.7.a

	}
}

# Event for American Fascist nations that have switched fascist later on: Wanna join the party?
country_event = {
	id = NSB_soviet_fascist_tsarist.8
	title = NSB_soviet_fascist_tsarist.7.t
	desc = NSB_soviet_fascist_tsarist.8.desc
	picture = GFX_report_event_generic_sign_treaty3

	is_triggered_only = yes

	# Sounds good!
	option = {
		name = NSB_soviet_fascist_tsarist.7.a
		FROM = {
			add_to_faction = ROOT
			hidden_effect = {
				country_event = { id = NSB_soviet_fascist_tsarist.9 }
			}
		}
	}

	# No thanks!
	option = {
		name = NSB_soviet_fascist_tsarist.7.b
		hidden_effect = {
			country_event = { id = NSB_soviet_fascist_tsarist.10 }
		}
	}
}

# Events for Russia: American country joins faction
country_event = {
	id = NSB_soviet_fascist_tsarist.9
	title = NSB_soviet_fascist_tsarist.6.t
	desc = NSB_soviet_fascist_tsarist.9.desc
	picture = GFX_report_event_generic_sign_treaty2

	is_triggered_only = yes

	# Excellent!
	option = {
		name = NSB_soviet_fascist_tsarist.6.a
		effect_tooltip = {
			add_to_faction = FROM
		}
	}
}

# Events for Russia: American country refuses to join faction
country_event = {
	id = NSB_soviet_fascist_tsarist.10
	title = NSB_soviet_fascist_tsarist.6.t
	desc = NSB_soviet_fascist_tsarist.10.desc
	picture = GFX_report_event_generic_sign_treaty2

	is_triggered_only = yes

	# Bummer
	option = {
		name = NSB_soviet_fascist_tsarist.6.a

	}
}

# Event for Japan: Russia's rebuilding Far Eastern Fleet infrastructure
country_event = {
	id = NSB_soviet_fascist_tsarist.11
	title = NSB_soviet_fascist_tsarist.11.t
	desc = NSB_soviet_fascist_tsarist.11.desc
	picture = GFX_report_event_usa_heavy_cruiser

	trigger = {
		original_tag = JAP
		NOT = { 
			SOV = {
				has_completed_focus = SOV_rebuild_the_far_eastern_fleet
			}
		}
		SOV = {
			focus_progress = {
				focus = SOV_rebuild_the_far_eastern_fleet
				progress > 0.33
			}
		}
	}

	mean_time_to_happen = {
		days = 2
	}

	# Concerning!
	option = {
		name = NSB_soviet_fascist_tsarist.11.a
	}
}

# Event for Japan: Russia's digging up the past
country_event = {
	id = NSB_soviet_fascist_tsarist.12
	title = NSB_soviet_fascist_tsarist.12.t
	desc = NSB_soviet_fascist_tsarist.12.desc
	picture = GFX_report_event_fascist_speech

	trigger = {
		original_tag = SOV
		NOT = { has_completed_focus = SOV_memories_of_1905 }
		focus_progress = {
			focus = SOV_memories_of_1905
			progress > 0.33
		}
	}

	mean_time_to_happen = {
		days = 2
	}

	# They're coming for us!
	option = {
		name = NSB_soviet_fascist_tsarist.12.a
	}
}

# Event for USA: Russia's building military infrastructure facing Alaska
country_event = {
	id = NSB_soviet_fascist_tsarist.13
	title = NSB_soviet_fascist_tsarist.13.t
	desc = NSB_soviet_fascist_tsarist.13.desc
	picture = GFX_report_event_soviet_tanks

	trigger = {
		original_tag = USA
		NOT = { 
			SOV = {
				has_completed_focus = SOV_eastern_expansion
			}
		}
		SOV = {
			focus_progress = {
				focus = SOV_eastern_expansion
				progress > 0.33
			}
		}
	}

	mean_time_to_happen = {
		days = 2
	}

	# They're coming for us!
	option = {
		name = NSB_soviet_fascist_tsarist.13.a
	}
}


# Event for Russia: coronation of Tsar Vladimir I
country_event = {
	id = NSB_soviet_fascist_tsarist.14
	title = NSB_soviet_fascist_tsarist.14.t
	desc = NSB_soviet_fascist_tsarist.14.desc
	picture = GFX_report_event_generic_military_parade

	is_triggered_only = yes

	# Glorious!
	option = {
		name = NSB_soviet_fascist_tsarist.14.a
		promote_character = SOV_tsar_vladimir_kirillovich
		news_event = { id = nsb_news.400 hours = 12 }
		hidden_effect = {
			ROOT = { drop_cosmetic_tag = yes }
			set_cosmetic_tag = russian_empire
		}

	}
}

# Event for Russia: coronation of Patriarch Meletius
country_event = {
	id = NSB_soviet_fascist_tsarist.15
	title = NSB_soviet_fascist_tsarist.15.t
	desc = NSB_soviet_fascist_tsarist.15.desc
	picture = GFX_report_event_generic_military_parade

	is_triggered_only = yes

	# And there was much rejoicing!
	option = {
		name = NSB_soviet_fascist_tsarist.15.a
		effect_tooltip = {
			promote_character = SOV_metropolitan_meletius
		}
		news_event = { id = nsb_news.404 hours = 12 }
	}
}

# Event for ENG/FRA: Russia proposes recreation of Triple Entente
country_event = {
	id = NSB_soviet_fascist_tsarist.16
	title = NSB_soviet_fascist_tsarist.16.t
	desc = NSB_soviet_fascist_tsarist.16.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Yes
	option = {
		name = NSB_soviet_fascist_tsarist.16.a
		set_faction_name = TRIPLE_ENTENTE
		add_to_faction = FROM
		FROM = {
			country_event = { id = NSB_soviet_fascist_tsarist.17 }
		}
		if = {
			limit = {
				tag = ENG
				FRA = {
					is_in_faction = no
					NOT = { has_war_with = ROOT }
					NOT = { has_war_with = FROM }
				}
			}
			FRA = { country_event = { id = NSB_soviet_fascist_tsarist.19 hours = 12 random_hours = 6 } }
		}
		if = {
			limit = {
				tag = FRA
				ENG = {
					is_in_faction = no
					NOT = { has_war_with = ROOT }
					NOT = { has_war_with = FROM }
				}
			}
			ENG = { country_event = { id = NSB_soviet_fascist_tsarist.19 hours = 1 random_hours = 6 } }
		}
	}

	# No
	option = {
		name = NSB_soviet_fascist_tsarist.16.b
		FROM = {
			country_event = { id = NSB_soviet_fascist_tsarist.18 hours = 6 }
		}
	}
}

# Event for SOV: Proposal for Triple Entente Accepted
country_event = {
	id = NSB_soviet_fascist_tsarist.17
	title = NSB_soviet_fascist_tsarist.17.t
	desc = NSB_soviet_fascist_tsarist.17.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Good
	option = {
		name = NSB_soviet_fascist_tsarist.17.a
		effect_tooltip = {
			FROM = {
				set_faction_name = TRIPLE_ENTENTE
				add_to_faction = ROOT
			}
			if = {
				limit = {
					FROM = { tag = ENG }
					FRA = { is_in_faction = no }
				}
				FRA = { country_event = { id = NSB_soviet_fascist_tsarist.19 hours = 12 random_hours = 6 } }
			}
			if = {
				limit = {
					FROM = { tag = FRA }
					ENG = { is_in_faction = no }
				}
				ENG = { country_event = { id = NSB_soviet_fascist_tsarist.19 hours = 12 random_hours = 6 } }
			}
		}
		news_event = { id = nsb_news.407 hours = 12 }
	}
}

# Event for SOV: Proposal for Triple Entente Rejected
country_event = {
	id = NSB_soviet_fascist_tsarist.18
	title = NSB_soviet_fascist_tsarist.18.t
	desc = NSB_soviet_fascist_tsarist.18.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Unfortunate
	option = {
		name = NSB_soviet_fascist_tsarist.18.a
		
	}
}

# Event for ENG/FRA: Invitation to Triple Entente
country_event = {
	id = NSB_soviet_fascist_tsarist.19
	title = NSB_soviet_fascist_tsarist.16.t
	desc = NSB_soviet_fascist_tsarist.19.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Yes
	option = {
		name = NSB_soviet_fascist_tsarist.19.a
		FROM = {
			add_to_faction = ROOT
			country_event = NSB_soviet_fascist_tsarist.20
		}
	}

	# No
	option = {
		name = NSB_soviet_fascist_tsarist.19.b
		FROM = {
			country_event = NSB_soviet_fascist_tsarist.21
		}
	}
}

# Event for FROM: Invitation to Triple Entente Accepted
country_event = {
	id = NSB_soviet_fascist_tsarist.20
	title = NSB_soviet_fascist_tsarist.17.t
	desc = NSB_soviet_fascist_tsarist.17.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Good
	option = {
		name = NSB_soviet_fascist_tsarist.20.a
		effect_tooltip = { add_to_faction = FROM }
		news_event = { id = nsb_news.408 hours = 12 }
	}
}

# Event for FROM: Invitation to Triple Entente Rejected
country_event = {
	id = NSB_soviet_fascist_tsarist.21
	title = NSB_soviet_fascist_tsarist.18.t
	desc = NSB_soviet_fascist_tsarist.18.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Unfortunate
	option = {
		name = NSB_soviet_fascist_tsarist.21.a
		
	}
}

# Event for GER: Russia wants to join Axis
country_event = {
	id = NSB_soviet_fascist_tsarist.22
	title = NSB_soviet_fascist_tsarist.22.t
	desc = NSB_soviet_fascist_tsarist.22.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Yes
	option = {
		name = NSB_soviet_fascist_tsarist.22.a
		add_to_faction = FROM
		FROM = {
			country_event = NSB_soviet_fascist_tsarist.23
		}
	}

	# No
	option = {
		name = NSB_soviet_fascist_tsarist.22.b
		FROM = {
			country_event = NSB_soviet_fascist_tsarist.24
		}
	}
}

# Event for Russia: Germany accepts
country_event = {
	id = NSB_soviet_fascist_tsarist.23
	title = NSB_soviet_fascist_tsarist.23.t
	desc = NSB_soviet_fascist_tsarist.23.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Good
	option = {
		name = NSB_soviet_fascist_tsarist.22.a
		effect_tooltip = { FROM = { add_to_faction = ROOT } }
		news_event = { id = nsb_news.402 hours = 12 }
	}
}

# Event for Russia: Germany rejects
country_event = {
	id = NSB_soviet_fascist_tsarist.24
	title = NSB_soviet_fascist_tsarist.24.t
	desc = NSB_soviet_fascist_tsarist.24.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Unfortunate
	option = {
		name = NSB_soviet_fascist_tsarist.24.a
		
	}
}


# Event for GER: Russia wants Japan to be invited
country_event = {
	id = NSB_soviet_fascist_tsarist.25
	title = NSB_soviet_fascist_tsarist.25.t
	desc = NSB_soviet_fascist_tsarist.25.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Yes
	option = {
		name = NSB_soviet_fascist_tsarist.25.a
		JAP = {
			country_event = NSB_soviet_fascist_tsarist.29
		}
	}

	# No
	option = {
		name = NSB_soviet_fascist_tsarist.25.b
		FROM = {
			country_event = NSB_soviet_fascist_tsarist.28
		}
	}
}

# Event for Russia: Germany accepted proposal, Japan accepted invitation
country_event = {
	id = NSB_soviet_fascist_tsarist.26
	title = NSB_soviet_fascist_tsarist.26.t
	desc = NSB_soviet_fascist_tsarist.26.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Good
	option = {
		name = NSB_soviet_fascist_tsarist.26.a
		effect_tooltip = { FROM = { add_to_faction = JAP} }
		news_event = { id = nsb_news.409 hours = 12 }
	}
}

# Event for Russia: Germany accepted proposal, Japan rejected invitation
country_event = {
	id = NSB_soviet_fascist_tsarist.27
	title = NSB_soviet_fascist_tsarist.27.t
	desc = NSB_soviet_fascist_tsarist.27.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Unfortunate
	option = {
		name = NSB_soviet_fascist_tsarist.27.a
		
	}
}

# Event for Russia: Germany rejected proposal
country_event = {
	id = NSB_soviet_fascist_tsarist.28
	title = NSB_soviet_fascist_tsarist.28.t
	desc = NSB_soviet_fascist_tsarist.28.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Unfortunate
	option = {
		name = NSB_soviet_fascist_tsarist.28.a
		
	}
}

# Event for JAP: Germany and Russia invite Japan to faction
country_event = {
	id = NSB_soviet_fascist_tsarist.29
	title = NSB_soviet_fascist_tsarist.25.t
	desc = NSB_soviet_fascist_tsarist.29.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Yes
	option = {
		name = NSB_soviet_fascist_tsarist.29.a
		FROM = {
			effect_tooltip = {
				add_to_faction = ROOT
			}
			country_event = NSB_soviet_fascist_tsarist.30
		}
	}

	# No
	option = {
		name = NSB_soviet_fascist_tsarist.29.b
		FROM = {
			country_event = NSB_soviet_fascist_tsarist.31
		}
	}
}

# Event for GER: Japan accepted invitation
country_event = {
	id = NSB_soviet_fascist_tsarist.30
	title = NSB_soviet_fascist_tsarist.26.t
	desc = NSB_soviet_fascist_tsarist.30.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Great!
	option = {
		name = NSB_soviet_fascist_tsarist.30.a
		add_to_faction = FROM
		SOV = {
			country_event = NSB_soviet_fascist_tsarist.26
		}
	}
}

# Event for GER: Japan rejected invitation
country_event = {
	id = NSB_soviet_fascist_tsarist.31
	title = NSB_soviet_fascist_tsarist.27.t
	desc = NSB_soviet_fascist_tsarist.31.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes

	# Unfortunate
	option = {
		name = NSB_soviet_fascist_tsarist.31.a
		SOV = {
			country_event = NSB_soviet_fascist_tsarist.27
		}
	}
}

# Event for GER: Vlasov captured/collaborates
country_event = {
	id = NSB_soviet_fascist_tsarist.32
	title = NSB_soviet_fascist_tsarist.32.t
	desc = NSB_soviet_fascist_tsarist.32.desc
	picture = GFX_report_event_soviet_soldiers

	fire_only_once = yes
	
	trigger = {
		original_tag = GER
		has_war_with = SOV
		SOV = {
			has_government = communism
			has_country_leader = { character = SOV_iosif_stalin ruling_only = yes }
			surrender_progress > 0.25
		}
		has_dlc = "No Step Back"
	}

	mean_time_to_happen = {
		days = 14
	}

	# A great idea!
	option = {
		name = NSB_soviet_fascist_tsarist.32.a
		SOV = {
			SOV_andrey_vlasov = {
				set_nationality = GER
			}
		}
		division_template = {
			name = "Russische Freiwilligendivision"
			template_counter = 4
			division_names_group = GER_Inf_01
			regiments = {
				infantry = { x = 0 y = 0 }
				infantry = { x = 0 y = 1 }
				infantry = { x = 0 y = 2 }
				infantry = { x = 1 y = 0 }
				infantry = { x = 1 y = 1 }
				infantry = { x = 1 y = 2 }
				infantry = { x = 2 y = 0 }
				artillery_brigade = { x = 2 y = 1 }
				artillery_brigade = { x = 2 y = 2 }
			}
			support = {
				recon = { x = 0 y = 0 }
				engineer = { x = 0 y = 1 }
			}
		}
		random_controlled_state = {
			limit = {
				is_core_of = SOV
			}
			create_unit = {
				division = "name = \"600. (russ.) Infanterie-Division\" division_template = \"Russische Freiwilligendivision\" start_experience_factor = 0.3"
				owner = GER
			}
			create_unit = {
				division = "name = \"650. (russ.) Infanterie-Division\" division_template = \"Russische Freiwilligendivision\" start_experience_factor = 0.3"
				owner = GER
			}
			create_unit = {
				division = "name = \"700. (russ.) Infanterie-Division\" division_template = \"Russische Freiwilligendivision\" start_experience_factor = 0.3"
				owner = GER
			}
		}
		SOV = {
			clr_country_flag = vlasov_owner_flag
			country_event = { id = NSB_soviet_fascist_tsarist.33 hours = 12 }
		}
		set_country_flag = vlasov_owner_flag
	}

	# Let's not
	option = {
		name = NSB_soviet_fascist_tsarist.32.b
		SOV = {
			SOV_andrey_vlasov = {
				set_nationality = GER
				set_character_flag = vlasov_imprisoned_flag
			}
		}
		SOV = {
			clr_country_flag = vlasov_owner_flag
			country_event = { id = NSB_soviet_fascist_tsarist.33 hours = 12 }
		}
		set_country_flag = vlasov_owner_flag
	}
}

# Event for SOV: Vlasov captured
country_event = {
	id = NSB_soviet_fascist_tsarist.33
	title = NSB_soviet_fascist_tsarist.32.t
	desc = NSB_soviet_fascist_tsarist.33.desc
	picture = GFX_report_event_soviet_soldiers

	is_triggered_only = yes

	# Unfortunate
	option = {
		name = NSB_soviet_fascist_tsarist.33.a
		effect_tooltip = {
			SOV_andrey_vlasov = {
				set_nationality = GER
			}
		}
	}
}