###########################
# Russian States Events
###########################

add_namespace = russia2_russian_states

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

	hidden = yes

	is_triggered_only = yes

	immediate = {
		set_global_flag = russia_reworked_events_loaded_russian_states
	}
}

#The New Government
country_event = {
	id = russia2_russian_states.1
	title = russia2_russian_states.1.t
	desc = russia2_russian_states.1.d
	picture = GFX_report_event_saf_soldiers_3

	is_triggered_only = yes

	#Current Government
	option = {
		name = russia2_russian_states.1.a
		ai_chance = {
			base = 25
			modifier = {
				add = 75
				OR = {
					SOV = {
						has_completed_focus = SOV_second_civil_war
					}
					SOV = {
						has_completed_focus = SOV_prepare_democratic_coup
					}
					SOV = {
						has_completed_focus = SOV_great_purge2
					}
					SOV = {
						has_completed_focus = SOV_consolidate_true_communism
					}
					AND = {
						has_government = democratic
						has_country_flag = RSC_AI_RANDOM_DEMOCRATIC_BEHAVIOR
					}
					AND = {
						has_government = neutrality
						has_country_flag = RSC_AI_RANDOM_NEUTRAL_BEHAVIOR
					}
					AND = {
						has_government = communism
						has_country_flag = RSC_AI_RANDOM_COMMUNIST_BEHAVIOR
					}
					AND = {
						has_government = fascism
						has_country_flag = RSC_AI_RANDOM_FASCIST_BEHAVIOR
					}
				}
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						has_government = democratic
						OR = {
							has_country_flag = RSC_AI_RANDOM_NEUTRAL_BEHAVIOR
							has_country_flag = RSC_AI_RANDOM_COMMUNIST_BEHAVIOR
							has_country_flag = RSC_AI_RANDOM_FASCIST_BEHAVIOR
						}
					}
					AND = {
						has_government = neutrality
						OR = {
							has_country_flag = RSC_AI_RANDOM_DEMOCRATIC_BEHAVIOR
							has_country_flag = RSC_AI_RANDOM_COMMUNIST_BEHAVIOR
							has_country_flag = RSC_AI_RANDOM_FASCIST_BEHAVIOR
						}
					}
					AND = {
						has_government = communism
						OR = {
							has_country_flag = RSC_AI_RANDOM_NEUTRAL_BEHAVIOR
							has_country_flag = RSC_AI_RANDOM_DEMOCRATIC_BEHAVIOR
							has_country_flag = RSC_AI_RANDOM_FASCIST_BEHAVIOR
						}
					}
					AND = {
						has_government = fascism
						OR = {
							has_country_flag = RSC_AI_RANDOM_NEUTRAL_BEHAVIOR
							has_country_flag = RSC_AI_RANDOM_COMMUNIST_BEHAVIOR
							has_country_flag = RSC_AI_RANDOM_DEMOCRATIC_BEHAVIOR
						}
					}
				}
			}
		}
		add_political_power = 150
		add_popularity = {
			ideology = ROOT
			popularity = 0.1
		}
	}

	#Democratic
	option = {
		name = russia2_russian_states.1.b
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				OR = {
					has_country_flag = RSC_AI_RANDOM_FASCIST_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_NEUTRAL_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_COMMUNIST_BEHAVIOR
				}
			}
			modifier = {
				add = 75
				has_country_flag = RSC_AI_RANDOM_DEMOCRATIC_BEHAVIOR
			}
			modifier = {
				factor = 0
				NOT = {
					has_country_flag = RSC_AI_RANDOM_DEMOCRATIC_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_FASCIST_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_NEUTRAL_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_COMMUNIST_BEHAVIOR
				}
				has_government = communism
				is_in_faction_with = SOV
				SOV = {
					is_subject = no
					is_faction_leader = yes
					has_government = communism
				}
			}
		}
		trigger = {
			NOT = {
				has_government = democratic
				is_subject = no
			}
		}
		set_politics = {
			ruling_party = democratic
			elections_allowed = yes
		}
		add_stability = 0.1
		hidden_effect = {
			if = {
				limit = {
					democratic < 0.5
				}
				set_political_party = {
					ideology = democratic
					popularity = 50
				}
			}
		}
	}

	#Non-aligned
	option = {
		name = russia2_russian_states.1.c
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				OR = {
					has_country_flag = RSC_AI_RANDOM_DEMOCRATIC_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_FASCIST_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_COMMUNIST_BEHAVIOR
				}
			}
			modifier = {
				add = 75
				has_country_flag = RSC_AI_RANDOM_NEUTRAL_BEHAVIOR
			}
			modifier = {
				factor = 0
				NOT = {
					has_country_flag = RSC_AI_RANDOM_DEMOCRATIC_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_FASCIST_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_NEUTRAL_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_COMMUNIST_BEHAVIOR
				}
				has_government = communism
				is_in_faction_with = SOV
				SOV = {
					is_subject = no
					is_faction_leader = yes
					has_government = communism
				}
			}
		}
		trigger = {
			NOT = {
				has_government = neutrality
				is_subject = no
			}
		}
		set_politics = {
			ruling_party = neutrality
			elections_allowed = no
		}
		add_stability = 0.1
		hidden_effect = {
			if = {
				limit = {
					neutrality < 0.5
				}
				set_political_party = {
					ideology = neutrality
					popularity = 50
				}
			}
		}
	}

	#Communism
	option = {
		name = russia2_russian_states.1.e
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				OR = {
					has_country_flag = RSC_AI_RANDOM_DEMOCRATIC_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_NEUTRAL_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_FASCIST_BEHAVIOR
				}
			}
			modifier = {
				add = 75
				has_country_flag = RSC_AI_RANDOM_COMMUNIST_BEHAVIOR
			}
			modifier = {
				factor = 0
				NOT = {
					has_country_flag = RSC_AI_RANDOM_DEMOCRATIC_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_FASCIST_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_NEUTRAL_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_COMMUNIST_BEHAVIOR
				}
				has_government = communism
				is_in_faction_with = SOV
				SOV = {
					is_subject = no
					is_faction_leader = yes
					has_government = communism
				}
			}
		}
		trigger = {
			NOT = {
				has_government = communism
				is_subject = no
			}
		}
		set_politics = {
			ruling_party = communism
			elections_allowed = no
		}
		add_stability = 0.1
		hidden_effect = {
			if = {
				limit = {
					communism < 0.5
				}
				set_political_party = {
					ideology = communism
					popularity = 50
				}
			}
		}
	}

	#Fascism
	option = {
		name = russia2_russian_states.1.f
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				OR = {
					has_country_flag = RSC_AI_RANDOM_DEMOCRATIC_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_NEUTRAL_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_COMMUNIST_BEHAVIOR
				}
			}
			modifier = {
				add = 75
				has_country_flag = RSC_AI_RANDOM_FASCIST_BEHAVIOR
			}
			modifier = {
				factor = 0
				NOT = {
					has_country_flag = RSC_AI_RANDOM_DEMOCRATIC_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_FASCIST_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_NEUTRAL_BEHAVIOR
					has_country_flag = RSC_AI_RANDOM_COMMUNIST_BEHAVIOR
				}
				has_government = communism
				is_in_faction_with = SOV
				SOV = {
					is_subject = no
					is_faction_leader = yes
					has_government = communism
				}
			}
		}
		trigger = {
			NOT = {
				has_government = fascism
				is_subject = no
			}
		}
		set_politics = {
			ruling_party = fascism
			elections_allowed = no
		}
		add_stability = 0.1
		hidden_effect = {
			if = {
				limit = {
					fascism < 0.5
				}
				set_political_party = {
					ideology = fascism
					popularity = 50
				}
			}
		}
	}
}