################
#### SOVIET ####
################

####### NO STEP BACK! #######

SOV_paranoia_system = {

	priority = 101

	icon = SOV_paranoia

	scripted_gui = sov_paranoia_system_ui

	allowed = {
		original_tag = SOV
	}

	visible = {
		OR = {
			has_country_flag = SOV_paranoia_system_active_flag
			has_country_flag = SOV_third_moscow_trial_flag
			has_country_flag = SOV_debug_show_paranoia_system_flag #Debug

			# So Opposition can get rid of the Anti-Soviet Military Thinking NS
			has_idea = SOV_anti_soviet_military_thinking_banned_army
			has_idea = SOV_anti_soviet_military_thinking_banned_navy
			has_idea = SOV_anti_soviet_military_thinking_banned_airforce
			# So Opposition can get rid of the Junior Army/Navy Officers Purged NS
			has_idea = SOV_purged_junior_army_officers_1
			has_idea = SOV_purged_junior_army_officers_2
			has_idea = SOV_purged_junior_army_officers_3
			has_idea = SOV_purged_junior_navy_officers_1
			has_idea = SOV_purged_junior_navy_officers_2
			has_idea = SOV_purged_junior_navy_officers_3
			SOV_is_stalinist = yes
			has_country_flag = SOV_assassinated_stalin_flag
		}
	}

	visible_when_empty = yes
}

SOV_propaganda_campaigns = {
	priority = 100

	icon = SOV_propaganda

	scripted_gui = sov_propaganda_campaigns_ui

	allowed = {
		original_tag = SOV
	}

	visible = {
		OR = {
			has_completed_focus = SOV_expand_the_agitprop
			has_country_flag = SOV_debug_show_propaganda_system_flag #Debug
		}
	}
}

SOV_gosproyektstroy_decision_category = {
	priority = 29

	icon = generic_industry

	picture = SOV_civil_puppet_interaction 

	allowed = {
		original_tag = SOV
	}

	visible = {
		OR = {
			has_idea = SOV_gosproyektstroy_1
			has_country_flag = SOV_gosproyektstroy_level_2_flag
			has_country_flag = SOV_gosproyektstroy_level_3_flag
		}
	}
}

SOV_industry_relocation = {
	priority = 12

	icon = generic

	allowed = {
		original_tag = SOV
	}

	visible = {
		has_completed_focus = SOV_move_industry_to_the_urals
	}
}

SOV_soviet_aid_to_poum_decision_category = { #Dec cat for aiding the POUM
	priority = 31

	icon = SOV_support_the_poum

	picture = GFX_decision_cat_picture_spr_the_inevitable_civil_war

	allowed = {
		original_tag = SOV
	}

	visible = {
		has_completed_focus = SOV_covert_support_for_spanish_poum
		NOT = { has_global_flag = scw_over }
		NOT = {
			AND = {
				has_global_flag = SPR_anarchist_uprising_flag
				OR = {
					NOT = { SPC = { has_completed_focus = SPR_the_anti_fascist_workers_revolution } }
					NOT = { country_exists = SPC }
				}
			}
		}
	}
}

SOV_great_patriotic_war = {
	priority = 200

	icon = sov_great_patriotic_war
	
	allowed = {
		original_tag = SOV
	}
	visible = {
		any_enemy_country = {
			SOV_is_major_not_original_sov = yes
		}
	}	
}

SOV_diplomacy_baltic_decision_category = {
	priority = 26

	icon = generic_foreign_policy

	allowed = {
		original_tag = SOV
	}

	visible = {
		has_completed_focus = SOV_baltic_security
		OR = {
			country_exists = EST
			country_exists = LAT
			country_exists = LIT
		}
		is_subject = no
	}
}

SOV_diplomacy_nordic_decision_category = {
	priority = 25

	icon = generic_foreign_policy

	allowed = {
		original_tag = SOV
	}

	visible = {
		has_completed_focus = SOV_secure_leningrad
		OR = {
			country_exists = FIN
			country_exists = SWE
			country_exists = NOR
			country_exists = DEN
		}
		is_subject = no
	}
}

SOV_diplomacy_balkan_decision_category = {
	priority = 24

	icon = generic_foreign_policy

	allowed = {
		original_tag = SOV
	}

	visible = {
		has_completed_focus = SOV_claim_on_bessarabia
		any_country = {
			BUL_is_balkan_nation = yes
			exists = yes
		}
		is_subject = no
	}
}

SOV_diplomacy_middle_east_decision_category = {
	priority = 23

	icon = generic_foreign_policy

	allowed = {
		original_tag = SOV
	}

	visible = {
		OR = {
			has_completed_focus = SOV_support_afghan_ideology
			has_completed_focus = SOV_the_khakimov_proposal
		}
		OR = {
			country_exists = IRQ
			country_exists = PER
			country_exists = AFG
			country_exists = SAU
		}
		is_subject = no
	}
}

SOV_diplomacy_asia_decision_category = {
	priority = 22

	icon = generic_foreign_policy

	allowed = {
		original_tag = SOV
	}

	visible = {
		OR = {
			AND = {
				has_completed_focus = SOV_the_threat_from_the_land_of_the_rising_sun
				any_country = {
					OR = {
						SOV_is_free_chinese_tag = yes
					}
					exists = yes
				}
			}
			AND = {
				has_completed_focus = SOV_reconcile_japan
				any_country = {
					OR = {
						AND = {
							tag = JAP
							is_subject = no
						}
						AND = {
							SOV_is_free_chinese_tag = yes
							is_in_faction_with = JAP
						}
					}
				}
			}
		}
	}
}

SOV_soviet_aid_decision_category = { #Dec cat for Sinkiang (mission dummies go here)
	icon = decision_category_generic_communism

	allowed = {
		original_tag = SIK
	}
}

SOV_national_academy_of_sciences_dec_cat = {
	priority = 30

	icon = SOV_soviet_academy_of_sciences

	picture = GFX_decision_cat_picture_soviet_national_academy_of_sciences 

	allowed = {
		original_tag = SOV
	}

	visible = {
		has_completed_focus = SOV_national_academies_of_sciences
		has_civil_war = no
	}
}

SOV_merge_designers_dec_cat = {
	priority = 28

	icon = SOV_merge_designers

	allowed = {
		original_tag = SOV
		NOT = { has_dlc = "Arms Against Tyranny" } #Decisions became actual traits in MIOs
	}

	visible = {
		has_civil_war = no
	}
}

SOV_kill_trotsky_dec_cat = {
	priority = 9

	icon = spr_political_assassination

	allowed = {
		original_tag = SOV
		NOT = { has_dlc = "La Resistance" }
	}

	visible = {
		has_completed_focus = SOV_behead_the_snake
	}
}

SOV_infiltrate_foreign_atomic_programs_dec_cat = {
	priority = 10

	icon = eng_move_to_secure_the_dominions

	allowed = {
		original_tag = SOV
		NOT = { has_dlc = "La Resistance" }
	}

	visible = {
		has_completed_focus = SOV_soviet_atomic_bomb_project
	}
}

SOV_comecon_dec_cat = {
	priority = 13

	icon = SOV_civil_puppet_interaction
	picture = GFX_decision_cat_picture_soviet_comecon

	allowed = {
		original_tag = SOV
	}

	visible = {
		has_completed_focus = SOV_found_the_comecon
	}
}

SOV_soviet_civil_war_dec_cat = {  
	priority = 105

	icon = GFX_decision_category_SOV_civil_war 
	picture = GFX_decision_cat_picture_soviet_civil_war    
	
	allowed = {
		original_tag = SOV
	} 

	visible = {
		OR = {
			SOV_is_left_opposition = yes 
			SOV_is_right_opposition = yes
			SOV_is_exiles = yes 
		}
		NOT = { has_global_flag = SOV_soviet_civil_war_over }
	}

	highlight_states = {
		highlight_states_trigger = {
			OR = {
				state = var:SOV.SOV_civil_war_start_state
				SOV_is_opposition_state = yes  
			}
			NOT = { has_global_flag = SOV_soviet_civil_war }
		}
		highlight_color_while_active = 3
	}
	# TODO THOMAS decide whether to keep
	custom_icon = {
		tag = SOV
		value = SOV_opposition_civil_war_divisions_value
		desc = SOV_SOS_civil_war_divisions_tt_long 

		visible = {
			SOV_soviet_civil_war_not_started = yes 
		}
	}

	visible_when_empty = yes
}

SOV_permanent_revolution_dec_cat = {
	priority = 90

	icon = GFX_decision_category_SOV_permanent_revolution

	allowed = {
		original_tag = SOV
	}

	visible = {
		has_completed_focus = SOV_the_permanent_revolution
	}
}

SOV_panslavic_nationalism = {
	priority = 75

	icon = generic_formable_nations

	allowed = {
		original_tag = SOV
	}

	visible = {
		has_completed_focus = SOV_panslavic_nationalism
	}
}

SOV_polish_territory = {
	priority = 70

	icon = generic_formable_nations

	allowed = {
		original_tag = SOV
	}

	visible = {
		POL = {
			is_subject_of = ROOT
		}
		#97 = {
		#	is_owned_by = ROOT
		#}
	}
}
