TNO_russia_ending_screen = {
	if = {
		limit = { tag = RUS }
		TNO_Country_Closing_Screen_Show = yes
	}
}

TNO_is_russian_nation_initialize = {
	if = {
		limit = {
			OR = {
				original_tag = ALT
				original_tag = AMR
				original_tag = BKR
				original_tag = BRY
				original_tag = CHT
				original_tag = DRL
				original_tag = FAV
				original_tag = GAY
				original_tag = GOR
				original_tag = IRK
				original_tag = KAL
				original_tag = KEM
				original_tag = KMC
				original_tag = KOM
				original_tag = KRS
				original_tag = MAG
				original_tag = MGN
				original_tag = MPR
				original_tag = NOV
				original_tag = OMO
				original_tag = OMS
				original_tag = ONG
				original_tag = ORE
				original_tag = PRM
				original_tag = PRC
				original_tag = SAM
				original_tag = SBA
				original_tag = SGV
				original_tag = SVR
				original_tag = TAN
				original_tag = TAR
				original_tag = TOM
				original_tag = TYM
				original_tag = NTG
				original_tag = URL
				original_tag = VIL
				original_tag = VLY
				original_tag = VOL
				original_tag = VOR
				original_tag = VYT
				original_tag = WRS
				original_tag = YAK
				original_tag = YGR
				original_tag = ZLT
			}
		}
		set_country_flag = is_russian_nation
		add_dynamic_modifier = { modifier = RUS_war_weariness }
		set_variable = { RUS_surrender_limit = 0.10 }

		if = {
			limit = {
				OMO_2022_aprilfools_gamerule_active = yes
			}
			# disable war wariness for Irkutsk and Buryatia in the first war
			IRK = { clr_country_flag = RUS_war_start }
			BRY = { clr_country_flag = RUS_war_start }
		}
	}
}

TNO_is_kazakh_nation_initialize = {
	if = {
		limit = {
			OR = {
				original_tag = KAZ
				original_tag = ARL
				original_tag = AKT
				original_tag = NPL
				original_tag = KOK
				original_tag = DER
				original_tag = PAV
			}
		}

		set_country_flag = is_kazakh_nation
	}
}

RUS_init_nuke_system = {
	set_variable = { RUSNukesTheoryProgress = 5 }
	set_variable = { RUSNukesMatsProgress = 0 }
	set_variable = { RUSNukesInfraProgress = 0 }
	set_variable = { RUSNukesRefineProgress = 0 }
	set_variable = { RUSNukesWeaponsProgress = 0 }
	set_variable = { RUSNukesMonthlyProgress = 1 }
	set_country_flag = RUS_nuclear_program_phase_1
	set_country_flag = RUS_started_nukes
}

RUS_load_regional_tree_WRus = { #Note: AB + Samara loads from an event, due to how it handles Onega
	if = {
		limit = {
			AND = {
				tag = WRS
				has_country_leader = {
					character = WRS_Georgy_Zhukov
					ruling_only = yes
				}
			}
		}
		load_focus_tree = { tree = WRS_zhukov_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = WRS
				has_country_leader = {
					character = WRS_Mikhail_Tukhachevsky
					ruling_only = yes
				}
			}
		}
		load_focus_tree = { tree = WRS_tukhachevsky_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = KOM
				has_country_leader = {
					character = KOM_Andrei_Zhdanov
					ruling_only = yes
				}
			}
		}
		load_focus_tree = { tree = KOM_zhdanov_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = KOM
				has_country_leader = {
					character = KOM_Mikhail_Suslov
					ruling_only = yes
				}
			}
		}
		load_focus_tree = { tree = KOM_suslov_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = KOM
				has_country_leader = {
					character = KOM_Svetlana_Bukharina
					ruling_only = yes
				}
			}
		}
		load_focus_tree = { tree = KOM_bukharina_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = KOM
				OR = {
					has_government = progressivism
					has_government = liberalism
					has_government = liberal_conservatism
				}
			}
		}
		load_focus_tree = { tree = KOM_second_election_tree }
	}
	else_if = {
		limit = {
			AND = {
				tag = KOM
				has_country_leader = {
					character = KOM_Svetlana_Stalina
					ruling_only = yes
				}
				has_government = despotism
			}
		}
		load_focus_tree = { tree = KOM_stalina_despot_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = KOM
				has_country_leader = {
					character = KOM_Lev_Gumilyov
					ruling_only = yes
				}
			}
		}
		load_focus_tree = { tree = KOM_gumilyov_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = KOM
				has_country_leader = {
					character = KOM_Igor_Shafarevich
					ruling_only = yes
				}
			}
		}
		load_focus_tree = { tree = KOM_shafarevich_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = KOM
				has_country_leader = {
					character = KOM_Ivan_Serov
					ruling_only = yes
				}
			}
		}
		load_focus_tree = { tree = KOM_serov_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = KOM
				has_country_leader = {
					character = KOM_Sergey_Taboritsky
					ruling_only = yes
				}
			}
		}
		load_focus_tree = { tree = KOM_taboritsky_regional }
	}
	else_if = {
		limit = {
			tag = VYT
		}
		load_focus_tree = { tree = VYT_regional_trees }
	}
}

RUS_load_regional_tree_WSib = {
	if = {
		limit = {
			tag = TYM
		}
		load_focus_tree = { tree = tyumen_regional }
	}
	else_if = {
		limit = {
			tag = OMS
		}
		load_focus_tree = { tree = OMS_regional_tree }
	}
}

RUS_load_regional_tree_CSib = {
	if = {
		limit = {
			tag = KEM
		}
		load_focus_tree = { tree = KEM_regional }
	}
	else_if = {
		limit = {
			tag = NOV
		}
		load_focus_tree = { tree = NOV_novosibirsk_regional }
	}
	else_if = {
		limit = {
			tag = SBA
		}
		load_focus_tree = { tree = SBA_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = TOM
				has_government = progressivism
			}
		}
		load_focus_tree = { tree = TOM_humanist_tree_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = TOM
				has_government = liberalism
			}
		}
		load_focus_tree = { tree = TOM_modernist_tree_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = TOM
				has_government = conservatism
			}
		}
		load_focus_tree = { tree = TOM_decembrist_tree_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = TOM
				has_government = paternalism
			}
		}
		load_focus_tree = { tree = TOM_bastillard_tree_regional }
	}
}


RUS_load_regional_tree_FE = {
	if = {
		limit = {
			tag = IRK
		}
		load_focus_tree = { tree = IRK_regional }
	}
	else_if = {
		limit = {
			tag = BRY
		}
		load_focus_tree = { tree = TNO_Buryatia_regional }
	}
	else_if = {
		limit = {
			tag = CHT
		}
		load_focus_tree = { tree = CHT_chita_regional }
	}
	else_if = {
		limit = {
			tag = AMR
		}
		load_focus_tree = { tree = AMR_regional }
	}
	else_if = {
		limit = {
			AND = {
				tag = MAG
				NOT = {
					has_country_leader = {
						character = MAG_Mitchell_Werbell
						ruling_only = yes
					}
				}
			}
		}
		load_focus_tree = { tree = MAG_matkovsky_regional_tree }
	}
	else_if = {
		limit = {
			AND = {
				tag = MAG
				has_country_leader = {
					character = MAG_Mitchell_Werbell
					ruling_only = yes
				}
			}
		}
		load_focus_tree = { tree = MAG_west_alaska_regional_trees }
	}
	else_if = {
		limit = {
			tag = OMO
			OMO_2022_aprilfools_gamerule_active = no
		}
		load_focus_tree = {
			tree = OMO_father_regional
			keep_completed = no
		}
	}
}

RUS_decrease_administrative_strain = {
	if = {
		limit = {
			has_idea = RUS_administrative_overload_1
		}
		hidden_effect = {
			swap_ideas = {
				remove_idea = RUS_administrative_overload_1
				add_idea = RUS_administrative_overload_2
			}
		}
		custom_effect_tooltip = RUS_strain_reduce
	}
	else_if = {
		limit = {
			has_idea = RUS_administrative_overload_2
		}
		hidden_effect = {
			swap_ideas = {
				remove_idea = RUS_administrative_overload_2
				add_idea = RUS_administrative_overload_3
			}
		}
		custom_effect_tooltip = RUS_strain_reduce
	}
	else_if = {
		limit = {
			has_idea = RUS_administrative_overload_3
		}
		hidden_effect = {
			swap_ideas = {
				remove_idea = RUS_administrative_overload_3
				add_idea = RUS_administrative_overload_4
			}
		}
		custom_effect_tooltip = RUS_strain_reduce
	}
	else_if = {
		limit = {
			has_idea = RUS_administrative_overload_4
		}
		hidden_effect = {
			swap_ideas = {
				remove_idea = RUS_administrative_overload_4
				add_idea = RUS_administrative_overload_5
			}
		}
		custom_effect_tooltip = RUS_strain_reduce
	}
	else_if = {
		limit = {
			has_idea = RUS_administrative_overload_5
		}
		hidden_effect = {
			remove_ideas = RUS_administrative_overload_5
		}
		custom_effect_tooltip = RUS_strain_remove
	}
	else_if = {
		limit = {
			NOT = {
				has_idea = RUS_administrative_overload_5
				has_idea = RUS_administrative_overload_4
				has_idea = RUS_administrative_overload_3
				has_idea = RUS_administrative_overload_2
				has_idea = RUS_administrative_overload_1
			}
		}
		add_stability = 0.05
	}
}

RUS_increase_receptiveness_3 = {
	custom_effect_tooltip = RUS_increase_receptiveness_3_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		add_to_variable = { global.RWSUnificationReceptiveness = 3 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		add_to_variable = { global.SIBUnificationReceptiveness = 3 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		add_to_variable = { global.RUSUnificationReceptiveness = 3 }
	}
}

RUS_increase_receptiveness_5 = {
	custom_effect_tooltip = RUS_increase_receptiveness_5_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		add_to_variable = { global.RWSUnificationReceptiveness = 5 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		add_to_variable = { global.SIBUnificationReceptiveness = 5 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		add_to_variable = { global.RUSUnificationReceptiveness = 5 }
	}
}

RUS_increase_receptiveness_10 = {
	custom_effect_tooltip = RUS_increase_receptiveness_10_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		add_to_variable = { global.RWSUnificationReceptiveness = 10 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		add_to_variable = { global.SIBUnificationReceptiveness = 10 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		add_to_variable = { global.RUSUnificationReceptiveness = 10 }
	}
}

RUS_increase_receptiveness_15 = {
	custom_effect_tooltip = RUS_increase_receptiveness_5_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		add_to_variable = { global.RWSUnificationReceptiveness = 15 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		add_to_variable = { global.SIBUnificationReceptiveness = 15 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		add_to_variable = { global.RUSUnificationReceptiveness = 15 }
	}
}

RUS_increase_receptiveness_20 = {
	custom_effect_tooltip = RUS_increase_receptiveness_20_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		add_to_variable = { global.RWSUnificationReceptiveness = 20 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		add_to_variable = { global.SIBUnificationReceptiveness = 20 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		add_to_variable = { global.RUSUnificationReceptiveness = 20 }
	}
}

RUS_increase_tension_3 = {
	custom_effect_tooltip = RUS_increase_tension_3_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		add_to_variable = { global.RWSUnificationTension = 3 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		add_to_variable = { global.SIBUnificationTension = 3 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		add_to_variable = { global.RUSUnificationTension = 3 }
	}
}

RUS_increase_tension_5 = {
	custom_effect_tooltip = RUS_increase_tension_5_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		add_to_variable = { global.RWSUnificationTension = 5 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		add_to_variable = { global.SIBUnificationTension = 5 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		add_to_variable = { global.RUSUnificationTension = 5 }
	}
}

RUS_increase_tension_10 = {
	custom_effect_tooltip = RUS_increase_tension_10_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		add_to_variable = { global.RWSUnificationTension = 10 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		add_to_variable = { global.SIBUnificationTension = 10 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		add_to_variable = { global.RUSUnificationTension = 10 }
	}
}

RUS_increase_tension_15 = {
	custom_effect_tooltip = RUS_increase_tension_15_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		add_to_variable = { global.RWSUnificationTension = 15 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		add_to_variable = { global.SIBUnificationTension = 15 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		add_to_variable = { global.RUSUnificationTension = 15 }
	}
}

RUS_increase_tension_20 = {
	custom_effect_tooltip = RUS_increase_tension_20_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		add_to_variable = { global.RWSUnificationTension = 20 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		add_to_variable = { global.SIBUnificationTension = 20 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		add_to_variable = { global.RUSUnificationTension = 20 }
	}
}

RUS_decrease_receptiveness_3 = {
	custom_effect_tooltip = RUS_decrease_receptiveness_3_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		subtract_from_variable = { global.RWSUnificationReceptiveness = 3 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		subtract_from_variable = { global.SIBUnificationReceptiveness = 3 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		subtract_from_variable = { global.RUSUnificationReceptiveness = 3 }
	}
}

RUS_decrease_receptiveness_5 = {
	custom_effect_tooltip = RUS_decrease_receptiveness_5_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		subtract_from_variable = { global.RWSUnificationReceptiveness = 5 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		subtract_from_variable = { global.SIBUnificationReceptiveness = 5 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		subtract_from_variable = { global.RUSUnificationReceptiveness = 5 }
	}
}

RUS_decrease_receptiveness_10 = {
	custom_effect_tooltip = RUS_decrease_receptiveness_10_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		subtract_from_variable = { global.RWSUnificationReceptiveness = 10 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		subtract_from_variable = { global.SIBUnificationReceptiveness = 10 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		subtract_from_variable = { global.RUSUnificationReceptiveness = 10 }
	}
}

RUS_decrease_receptiveness_15 = {
	custom_effect_tooltip = RUS_decrease_receptiveness_5_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		subtract_from_variable = { global.RWSUnificationReceptiveness = 15 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		subtract_from_variable = { global.SIBUnificationReceptiveness = 15 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		subtract_from_variable = { global.RUSUnificationReceptiveness = 15 }
	}
}

RUS_decrease_receptiveness_20 = {
	custom_effect_tooltip = RUS_decrease_receptiveness_20_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		subtract_from_variable = { global.RWSUnificationReceptiveness = 20 }
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		subtract_from_variable = { global.SIBUnificationReceptiveness = 20 }
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		subtract_from_variable = { global.RUSUnificationReceptiveness = 20 }
	}
}

RUS_decrease_tension_3 = {
	custom_effect_tooltip = RUS_decrease_tension_3_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		subtract_from_variable = { global.RWSUnificationTension = 3 }
		clamp_variable = {
			var = global.RWSUnificationTension
			min = 0
		}
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		subtract_from_variable = { global.SIBUnificationTension = 3 }
		clamp_variable = {
			var = global.SIBUnificationTension
			min = 0
		}
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		subtract_from_variable = { global.RUSUnificationTension = 3 }
		clamp_variable = {
			var = global.RUSUnificationTension
			min = 0
		}
	}
}

RUS_decrease_tension_5 = {
	custom_effect_tooltip = RUS_decrease_tension_5_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		subtract_from_variable = { global.RWSUnificationTension = 5 }
		clamp_variable = {
			var = global.RWSUnificationTension
			min = 0
		}
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		subtract_from_variable = { global.SIBUnificationTension = 5 }
		clamp_variable = {
			var = global.SIBUnificationTension
			min = 0
		}
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		subtract_from_variable = { global.RUSUnificationTension = 5 }
		clamp_variable = {
			var = global.RUSUnificationTension
			min = 0
		}
	}
}

RUS_decrease_tension_10 = {
	custom_effect_tooltip = RUS_decrease_tension_10_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		subtract_from_variable = { global.RWSUnificationTension = 10 }
		clamp_variable = {
			var = global.RWSUnificationTension
			min = 0
		}
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		subtract_from_variable = { global.SIBUnificationTension = 10 }
		clamp_variable = {
			var = global.SIBUnificationTension
			min = 0
		}
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		subtract_from_variable = { global.RUSUnificationTension = 10 }
		clamp_variable = {
			var = global.RUSUnificationTension
			min = 0
		}
	}
}

RUS_decrease_tension_15 = {
	custom_effect_tooltip = RUS_decrease_tension_15_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		subtract_from_variable = { global.RWSUnificationTension = 15 }
		clamp_variable = {
			var = global.RWSUnificationTension
			min = 0
		}
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		subtract_from_variable = { global.SIBUnificationTension = 15 }
		clamp_variable = {
			var = global.SIBUnificationTension
			min = 0
		}
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		subtract_from_variable = { global.RUSUnificationTension = 15 }
		clamp_variable = {
			var = global.RUSUnificationTension
			min = 0
		}
	}
}

RUS_decrease_tension_20 = {
	custom_effect_tooltip = RUS_decrease_tension_20_tt
	if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		subtract_from_variable = { global.RWSUnificationTension = 20 }
		clamp_variable = {
			var = global.RWSUnificationTension
			min = 0
		}
	}
	if = {
		limit = {
			OR = {
				tag = CSB
				tag = FST
			}
		}
		subtract_from_variable = { global.SIBUnificationTension = 20 }
		clamp_variable = {
			var = global.SIBUnificationTension
			min = 0
		}
	}
	if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		subtract_from_variable = { global.RUSUnificationTension = 20 }
		clamp_variable = {
			var = global.RUSUnificationTension
			min = 0
		}
	}
}

### Prestige ###

RUS_increase_prestige_3 = {
	custom_effect_tooltip = RUS_increase_prestige_3_tt
	add_to_variable = { RUS_diplo_prestige_bonus = 3 }
	add_to_variable = { RUS_diplo_prestige = 3 }
	RUS_ccp_prestige_calculate = yes
}

RUS_increase_prestige_5 = {
	custom_effect_tooltip = RUS_increase_prestige_5_tt
	add_to_variable = { RUS_diplo_prestige_bonus = 5 }
	add_to_variable = { RUS_diplo_prestige = 5 }
	RUS_ccp_prestige_calculate = yes
}

RUS_increase_prestige_10 = {
	custom_effect_tooltip = RUS_increase_prestige_10_tt
	add_to_variable = { RUS_diplo_prestige_bonus = 10 }
	add_to_variable = { RUS_diplo_prestige = 10 }
	RUS_ccp_prestige_calculate = yes
}

RUS_increase_prestige_15 = {
	custom_effect_tooltip = RUS_increase_prestige_5_tt
	add_to_variable = { RUS_diplo_prestige_bonus = 15 }
	add_to_variable = { RUS_diplo_prestige = 15 }
	RUS_ccp_prestige_calculate = yes
}

RUS_increase_prestige_20 = {
	custom_effect_tooltip = RUS_increase_prestige_20_tt
	add_to_variable = { RUS_diplo_prestige_bonus = 20 }
	add_to_variable = { RUS_diplo_prestige = 20 }
	RUS_ccp_prestige_calculate = yes
}

RUS_decrease_prestige_3 = {
	custom_effect_tooltip = RUS_decrease_prestige_3_tt
	subtract_from_variable = { RUS_diplo_prestige_bonus = 3 }
	subtract_from_variable = { RUS_diplo_prestige = 3 }
	clamp_variable = { var = RUS_diplo_prestige min = 0 }
	RUS_ccp_prestige_calculate = yes
}

RUS_decrease_prestige_5 = {
	custom_effect_tooltip = RUS_decrease_prestige_5_tt
	subtract_from_variable = { RUS_diplo_prestige_bonus = 5 }
	subtract_from_variable = { RUS_diplo_prestige = 5 }
	clamp_variable = { var = RUS_diplo_prestige min = 0 }
	RUS_ccp_prestige_calculate = yes
}

RUS_decrease_prestige_10 = {
	custom_effect_tooltip = RUS_decrease_prestige_10_tt
	subtract_from_variable = { RUS_diplo_prestige_bonus = 10 }
	subtract_from_variable = { RUS_diplo_prestige = 10 }
	clamp_variable = { var = RUS_diplo_prestige min = 0 }
	RUS_ccp_prestige_calculate = yes
}

RUS_decrease_prestige_15 = {
	custom_effect_tooltip = RUS_decrease_prestige_5_tt
	subtract_from_variable = { RUS_diplo_prestige_bonus = 15 }
	subtract_from_variable = { RUS_diplo_prestige = 15 }
	clamp_variable = { var = RUS_diplo_prestige min = 0 }
	RUS_ccp_prestige_calculate = yes
}

RUS_decrease_prestige_20 = {
	custom_effect_tooltip = RUS_decrease_prestige_20_tt
	subtract_from_variable = { RUS_diplo_prestige_bonus = 20 }
	subtract_from_variable = { RUS_diplo_prestige = 20 }
	clamp_variable = { var = RUS_diplo_prestige min = 0 }
	RUS_ccp_prestige_calculate = yes
}

RUS_ccp_prestige_calculate = {
	if = {
		limit = {
			OR = {
				tag = FST
				tag = CSB
			}
		}
		if = {
			limit = {
				has_game_rule = {
					rule = SIBERIA_UNIFICATION_CONFERENCE
					option = SIBERIA_UNIFICATION_CONFERENCE_FST
				}
				NOT = {
					check_variable = { FST.RUS_diplo_prestige > CSB.RUS_diplo_prestige }
				}
			}
			set_variable = { FST.RUS_diplo_prestige = CSB.RUS_diplo_prestige }
			add_to_variable = { FST.RUS_diplo_prestige = 1 }
		}
		else_if = {
			limit = {
				has_game_rule = {
					rule = SIBERIA_UNIFICATION_CONFERENCE
					option = SIBERIA_UNIFICATION_CONFERENCE_CSB
				}
				NOT = {
					check_variable = { CSB.RUS_diplo_prestige > FST.RUS_diplo_prestige }
				}
			}
			set_variable = { CSB.RUS_diplo_prestige = FST.RUS_diplo_prestige }
			add_to_variable = { CSB.RUS_diplo_prestige = 1 }
		}
	}
	else_if = {
		limit = {
			OR = {
				tag = WSR
				tag = WSB
			}
		}
		if = {
			limit = {
				has_game_rule = {
					rule = RUSSIA_UNIFICATION_CONFERENCE
					option = RUSSIA_UNIFICATION_CONFERENCE_WSR
				}
				NOT = {
					check_variable = { WSR.RUS_diplo_prestige > WSB.RUS_diplo_prestige }
				}
			}
			set_variable = { WSR.RUS_diplo_prestige = WSB.RUS_diplo_prestige }
			add_to_variable = { WSR.RUS_diplo_prestige = 1 }
		}
		else_if = {
			limit = {
				has_game_rule = {
					rule = RUSSIA_UNIFICATION_CONFERENCE
					option = RUSSIA_UNIFICATION_CONFERENCE_WSB
				}
				NOT = {
					check_variable = { WSB.RUS_diplo_prestige > WSR.RUS_diplo_prestige }
				}
			}
			set_variable = { WSB.RUS_diplo_prestige = WSR.RUS_diplo_prestige }
			add_to_variable = { WSB.RUS_diplo_prestige = 1 }
		}
	}
	else_if = {
		limit = {
			OR = {
				tag = RWS
				tag = SIB
			}
		}
		if = {
			limit = {
				has_game_rule = {
					rule = RUSSIA_TOTAL_UNIFICATION_CONFERENCE
					option = RUSSIA_TOTAL_UNIFICATION_CONFERENCE_RWS
				}
				NOT = {
					check_variable = { RWS.RUS_diplo_prestige > SIB.RUS_diplo_prestige }
				}
			}
			set_variable = { RWS.RUS_diplo_prestige = SIB.RUS_diplo_prestige }
			add_to_variable = { RWS.RUS_diplo_prestige = 1 }
		}
		else_if = {
			limit = {
				has_game_rule = {
					rule = RUSSIA_TOTAL_UNIFICATION_CONFERENCE
					option = RUSSIA_TOTAL_UNIFICATION_CONFERENCE_SIB
				}
				NOT = {
					check_variable = { SIB.RUS_diplo_prestige > RWS.RUS_diplo_prestige }
				}
			}
			set_variable = { SIB.RUS_diplo_prestige = RWS.RUS_diplo_prestige }
			add_to_variable = { SIB.RUS_diplo_prestige = 1 }
		}
	}
}

RUS_calculate_prestige_value = {
	set_variable = { RUS_diplo_prestige = 1 }

	### Military Stuff ###
	if = {
		limit = { has_army_manpower = { size < 25000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 1 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 50000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 2 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 75000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 4 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 100000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 6 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 125000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 7 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 150000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 8 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 175000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 10 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 200000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 11 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 225000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 13 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 250000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 14 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 275000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 16 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 300000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 17 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 325000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 19 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 350000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 20 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 375000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 22 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 400000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 24 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 425000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 25 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 450000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 26 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 475000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 28 }
	}
	else_if = {
		limit = { has_army_manpower = { size < 500000 } }
		set_temp_variable = { RUS_diplo_prestige_mil = 29 }
	}

	### Industry Stuff ###
	set_temp_variable = { RUS_diplo_prestige_ind = num_of_factories }
	if = {
		limit = {
			has_idea = tno_industrial_equipment_hand_tools
		}
		multiply_temp_variable = { RUS_diplo_prestige_ind = 0.33 }
	}
	else_if = {
		limit = {
			has_idea = tno_industrial_equipment_power_tools
		}
		multiply_temp_variable = { RUS_diplo_prestige_ind = 0.66 }
	}
	else_if = {
		limit = {
			has_idea = tno_industrial_equipment_manufacturing_lines
		}
		multiply_temp_variable = { RUS_diplo_prestige_ind = 1 }
	}
	else_if = {
		limit = {
			has_idea = tno_industrial_equipment_factory_complexes
		}
		multiply_temp_variable = { RUS_diplo_prestige_ind = 1.33 }
	}
	else_if = {
		limit = {
			has_idea = tno_industrial_equipment_modern
		}
		multiply_temp_variable = { RUS_diplo_prestige_ind = 1.66 }
	}
	else_if = {
		limit = {
			has_idea = tno_industrial_equipment_cutting_edge
		}
		multiply_temp_variable = { RUS_diplo_prestige_ind = 2 }
	}

	### Economy Stuff ###
	set_temp_variable = { RUS_diplo_prestige_eco = GDP }
	divide_temp_variable = { RUS_diplo_prestige_eco = 1000 }

	### Rolling it Together ###

	add_to_variable = { RUS_diplo_prestige = RUS_diplo_prestige_mil }
	add_to_variable = { RUS_diplo_prestige = RUS_diplo_prestige_ind }
	add_to_variable = { RUS_diplo_prestige = RUS_diplo_prestige_eco }

	divide_variable = { RUS_diplo_prestige = 5 }

	### Bonus Ducks ###

	add_to_variable = { RUS_diplo_prestige = RUS_diplo_prestige_bonus }
	clamp_variable = { var = RUS_diplo_prestige min = 0 }

}

#########################################
##==========| Anarchy Stuff |==========##
#########################################

### West Russia - Post-Onega Collapse ###
WRS_west_russian_collapse = {
	set_global_flag = TNO_RUS_west_russia_collapse
	custom_effect_tooltip = WRS_west_russian_collapse_tt
	hidden_effect = {
		FIN = {
			if = { # Finland is beaten by Russia, but then Russia is somehow beaten by Onega need to give Finland their shit back
				limit = { NOT = { FIN = { owns_state = 1359 } } }
				add_state_core = 213
				add_state_core = 215
				add_state_core = 216
				add_state_core = 147
				add_state_core = 722
				add_state_core = 1359
				transfer_state = 213
				transfer_state = 215
				transfer_state = 216
				transfer_state = 147
				transfer_state = 722
				transfer_state = 1359
			}
			transfer_state = 146
			transfer_state = 213
			transfer_state = 215
			transfer_state = 216
		}
		ONG = {
			transfer_state = 214
			transfer_state = 862
			transfer_state = 262
			transfer_state = 861
			transfer_state = 860
			transfer_state = 869
			transfer_state = 857
			transfer_state = 351
			transfer_state = 867
			transfer_state = 868
			transfer_state = 397
			transfer_state = 866
			transfer_state = 856
			transfer_state = 870
			transfer_state = 859
			transfer_state = 858
			transfer_state = 1887
			country_event = { id = ONG.50 }
			remove_ideas = RUS_the_izhevsk_arsenal
			remove_ideas = RUS_gorky_tank_factory
		}
		BKR = {
			add_state_core = 853
			add_state_core = 651
			transfer_state = 853
			transfer_state = 651
			set_politics = {
				ruling_party = conservatism
			}
			add_popularity = {
				ideology = conservatism
				popularity = 0.5
			}
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			set_variable = { national_debt = 0 } # clear debt for successor
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			promote_character = BKR_ONG_Faizrakhman_Zagafuranov
		}
		GOR = {
			add_state_core = 252
			add_state_core = 855
			transfer_state = 252
			transfer_state = 855
			set_cosmetic_tag = GOR_ANARCHY
			set_politics = {
				ruling_party = liberalism
			}
			add_popularity = {
				ideology = liberalism
				popularity = 0.5
			}
			set_variable = { national_debt = 0 } # clear debt for successor
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			remove_all_ministers = yes
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			add_ideas = {
				GOR_ONG_Ivan_Kiselyov_hog
				GOR_ONG_Vasily_Semyonov_for
				GOR_ONG_Gennady_Yanayev_eco
				GOR_ONG_Anatoly_Burmistrov_sec
			}
			promote_character = GOR_ONG_Konstantin_Katushev
			GOR = {
				every_unit_leader = {
					retire = yes
				}
			}
			GOR_ONG_Anatoly_Burmistrov = {
				add_corps_commander_role = {
					traits = { politically_connected organizer }
					skill = 2
					attack_skill = 1
					defense_skill = 2
					planning_skill = 3
					logistics_skill = 1
					id = 15003
				}
			}
		}
		GAY = {
			transfer_state = 399
			add_state_core = 399
			866 = {
				remove_core_of = GAY
			}
			398 = {
				remove_core_of = GAY
			}
			set_cosmetic_tag = GAY_ANARCHY
			set_politics = {
				ruling_party = liberal_conservatism
			}
			set_popularities = {
				communist = 0
				ultranationalism = 0
				national_socialism = 0
				socialist = 0
				progressivism = 0
				liberalism = 10

				liberal_conservatism = 75
				conservatism = 0
				paternalism = 15
				despotism = 0
				fascism = 0

			}
			set_variable = { national_debt = 0 } # clear debt for successor
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			remove_all_ministers = yes
			add_ideas = {
				GAY_ONG_Flor_Vasilyev_hog
				GAY_ONG_Pyotr_Sysoyev_eco
				GAY_ONG_Nikolay_Bayteryakov_for
				GAY_ONG_Zosim_Makarov_sec
			}
			promote_character = GAY_ONG_Yakov_Panteleev
			GAY = {
				every_unit_leader = {
					limit = {
						NOT = { has_id = 15503 }
					}
					retire = yes
				}
			}
			add_ideas = RUS_the_izhevsk_arsenal
		}
		VYT = {
			add_state_core = 752
			add_state_core = 400
			add_state_core = 865
			transfer_state = 752
			transfer_state = 400
			transfer_state = 865
			set_cosmetic_tag = VYT_ANARCHY
			set_politics = {
				ruling_party = conservatism
			}
			add_popularity = {
				ideology = conservatism
				popularity = 0.25
			}
			set_variable = { national_debt = 0 } # clear debt for successor
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			remove_all_ministers = yes
			add_ideas = VYT_Nikolay_Rumyantsev_hog
			add_ideas = VYT_Leonid_Makerov_for
			add_ideas = VYT_Nikolay_Pauzin_eco
			add_ideas = VYT_Georgey_Zagainov_sec
			retire_country_leader = yes
			promote_character = VYT_Boris_I
			remove_ideas = {
				RUS_syktyvkar_arsenal
				RUS_gorky_tank_factory
				RUS_the_izhevsk_arsenal
				VYT_kirov_vodka
				VYT_reopened_universities
				VYT_general_staff_academy
			}
			VYT = {
				every_unit_leader = {
					limit = {
						OR = {
							has_id = 3401
							has_id = 3402
							has_id = 3406
							has_id = 3407
							has_id = 3408
							has_id = 3409
							has_id = 3410
							has_id = 3411
						}
					}
					retire = yes
				}
			}
		}
		VOL = {
			add_state_core = 854
			transfer_state = 854
			set_cosmetic_tag = VOL_ANARCHY
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			set_politics = {
				ruling_party = liberal_conservatism
			}
			add_popularity = {
				ideology = liberal_conservatism
				popularity = 0.5
			}
			set_variable = { national_debt = 0 } # clear debt for successor
			remove_all_ministers = yes
			add_ideas = {
				VOL_ONG_Olyk_Ipay_hog
				VOL_ONG_Arkady_Krupnyakov_for
				VOL_ONG_Vasily_Yuksern_eco
				VOL_ONG_Mikhail_Loginov_sec
			}
			add_country_leader_role = {
				character = VOL_ONG_Miklay_Kazakov
				promote_leader = yes
				country_leader = {
					desc = "POLITICS_MIKLAY_KAZAKOV_DESC"
					expire = "1999.1.1"
					ideology = liberal_conservatism_subtype
					traits = {
					}
					id = -1
				}
			}
			VOL = {
				every_unit_leader = {
					retire = yes
				}
			}
			add_corps_commander_role = {
				character = VOL_ONG_Mikhail_Loginov
				traits = {
					infantry_officer
					trait_engineer
				}
				skill = 2
				attack_skill = 3
				defense_skill = 2
				planning_skill = 1
				logistics_skill = 1
				legacy_id = 15504
			}
		}
		PRM = {
			add_state_core = 753
			add_state_core = 864
			add_state_core = 398
			transfer_state = 753
			transfer_state = 864
			transfer_state = 398
			set_cosmetic_tag = PRM_ANARCHY
			set_politics = {
				ruling_party = paternalism
			}
			add_popularity = {
				ideology = paternalism
				popularity = 0.5
			}

			set_variable = { national_debt = 0 } # clear debt for successor
			set_temp_variable = { TNO_economy_subtype_temp = token:Econ_Subtype_Military_Directed }
			econ_subtype_change = yes

			set_temp_variable = { temp_credit_rating_max = 4 }
			econ_set_max_credit_rating = yes

			set_temp_variable = { temp_credit_rating = 3 }
			econ_set_credit_rating = yes

			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			remove_all_ministers = yes
			add_ideas = {
				PRM_Vladimir_Trapeznikov_hog
				PRM_Viktor_Mitrakov_for
				PRM_Grigory_Sivkov_eco
				PRM_Vladimir_Bezukladnikov_sec
			}
			remove_ideas = {
				RUS_syktyvkar_arsenal
				RUS_gorky_tank_factory
				RUS_the_izhevsk_arsenal
			}
			remove_dynamic_modifier = {
				modifier = PRM_aryan_awakening
			}
			add_country_leader_role = {
				character = PRM_Alexander_Medvedev
				promote_leader = yes
				country_leader = {
					desc = "POLITICS_ALEXANDER_MEDVEDEV_DESC"
					expire = "1999.1.1"
					ideology = paternalism_stratocracy_subtype
					traits = {
					}
					id = -1
				}
			}
			PRM = {
				every_unit_leader = {
					retire = yes
				}
			}
		}
		SAM = {
			add_state_core = 250
			add_state_core = 851
			add_state_core = 850
			add_state_core = 251
			add_state_core = 755
			transfer_state = 250
			transfer_state = 851
			transfer_state = 850
			transfer_state = 251
			transfer_state = 755
			set_cosmetic_tag = SAM_ANARCHY
			set_politics = {
				ruling_party = progressivism
			}
			add_popularity = {
				ideology = progressivism
				popularity = 0.5
			}
			set_variable = { national_debt = 0 } # clear debt for successor
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			remove_all_ministers = yes
			add_ideas = SAM_Vitaly_Vorotnikov_hog
			add_ideas = SAM_Leonid_Yefremov_for
			add_ideas = SAM_Alexey_Rosovsky_eco
			add_ideas = SAM_Grigory_Shambarov_sec
			remove_ideas = {
				RUS_syktyvkar_arsenal
				RUS_gorky_tank_factory
				RUS_the_izhevsk_arsenal
			}
			add_country_leader_role = {
				character = SAM_Viktor_Polyakov
				promote_leader = yes
				country_leader = {
					desc = "POLITICS_VIKTOR_POLYAKOV_DESC"
					expire = "1999.1.1"
					ideology = progressivism_left_wing_populism_subtype
					traits = {
					}
					id = -1
				}
			}
			SAM = {
				every_unit_leader = {
					retire = yes
				}
			}
		}
		TAR = {
			add_state_core = 249
			add_state_core = 256
			transfer_state = 249
			transfer_state = 256
			set_politics = {
				ruling_party = liberalism
			}
			add_popularity = {
				ideology = liberalism
				popularity = 0.5
			}
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			set_variable = { national_debt = 0 } # clear debt for successor
			retire_country_leader = yes
			promote_character = TAR_Ibragim_Mingazeyev
		}
		every_country = {
			limit = { is_central_russian_nation = yes }
			clr_country_flag = RUS_regional_stage
		}
	}
}

### West Siberia - Post-Onega Collapse ###
WSB_ONG_west_siberia_collapse = {
	custom_effect_tooltip = WSB_add_collapse_administration_tt
	set_global_flag = TNO_RUS_west_siberia_collapse
	hidden_effect = {
		ONG = {
			transfer_state = 581
			add_state_core = 581
			transfer_state = 863
			add_state_core = 863
			country_event = { id = ONG.51 }
		}
		TYM = {
			transfer_state = 403
			add_state_core = 403
			transfer_state = 653
			add_state_core = 653
			transfer_state = 572
			add_state_core = 572
			transfer_state = 573
			add_state_core = 573
			transfer_state = 754
			add_state_core = 754
			set_cosmetic_tag = TYM_ZLATOUST
			set_politics = {
				ruling_party = paternalism
			}
			set_popularities = {
				communist = 0
				socialist = 0
				progressivism = 20
				liberalism = 40

				conservatism = 0
				paternalism = 40
				despotism = 0
				fascism = 0
				national_socialism = 0
				ultranationalism = 0

			}
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			remove_all_ministers = yes
			add_ideas = TYM_Ivan_Fedyuninsky_hog
			add_ideas = TYM_Yelena_Karbysheva_for
			add_ideas = TYM_Ernest_Voznesensky_eco
			add_ideas = TYM_Artyom_Sergeyev_sec
			TYM_Boris_Shcherbina = {
				add_country_leader_role = {
					promote_leader = yes
					country_leader = {
						desc = "POLITICS_BORIS_SHCHERBINA_ONEGA_DESC"
						ideology = paternalism_provisional_government_subtype
						expire = "1999.1.1"
						traits = { }
					}
				}
			}
			TYM = {
				every_unit_leader = {
					limit = {
						OR = {
							has_id = 3571
							has_id = 3572
							has_id = 3575
							has_id = 3578
						}
					}
					retire = yes
				}
			}
			remove_ideas = {
				TYM_revisionist_remnant
				TYM_unorthodox_bolshevism
				TYM_repopulation_program
				TYM_repopulation_program_2
				TYM_repopulation_program_3
				TYM_homebrew_tanks_2
				TYM_the_red_army_morale
				TYM_the_red_army_morale_2
				TYM_the_red_army_morale_3
				TYM_the_red_army_strength
				TYM_the_red_army_strength_2
				TYM_the_red_army_strength_3
				TYM_what_is_the_five_year_plan_idea
				TYM_what_is_the_five_year_plan_idea_2
				TYM_what_is_the_five_year_plan_idea_3
				TYM_what_is_the_five_year_plan_idea_4
				TYM_what_is_the_five_year_plan_idea_5
				TYM_what_is_the_five_year_plan_idea_6
				TYM_united_five_year_plan
				TYM_Khruschyovka_idea
				TNO_looming_fiscal_crisis
			}
			end_fiscal_crisis = yes
			set_variable = { national_debt = 0 } # clear debt for successor
		}
		YGR = {
			transfer_state = 844
			add_state_core = 844
			transfer_state = 579
			add_state_core = 579
			transfer_state = 756
			add_state_core = 756
			set_cosmetic_tag = YGR_ZLATOUST
			set_politics = {
				ruling_party = liberal_conservatism
			}
			set_popularities = {
				communist = 5
				socialist = 20
				progressivism = 29
				liberalism = 0
				liberal_conservatism = 36
				conservatism = 0
				paternalism = 10
				despotism = 0
				fascism = 0
				national_socialism = 0
				ultranationalism = 0

			}
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			promote_character = YGR_ZLT_Shatter_Ivan_Istomin
			set_country_leader_description = {
				desc = "POLITICS_IVAN_ISTOMIN_ONEGA_DESC"
			}
			remove_all_ministers = yes
			add_ideas = YGR_Ivan_Vyucheisky_hog
			add_ideas = YGR_Vasily_Ledkov_for
			add_ideas = YGR_Aleksandr_Bezumov_eco
			add_ideas = YGR_Alexey_Kalinin_sec
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			YGR = {
				every_unit_leader = { retire = yes }
			}
			remove_ideas = {
				SIB_terror_bombing
				YGR_selfmade_men
				TNO_looming_fiscal_crisis
			}
			end_fiscal_crisis = yes
			set_variable = { national_debt = 0 } # clear debt for successor
		}
		OMS = {
			transfer_state = 571
			add_state_core = 571
			set_cosmetic_tag = OMS_ZLATOUST
			set_politics = {
				ruling_party = paternalism
			}
			set_popularities = {
				communist = 0
				socialist = 0
				progressivism = 0
				liberalism = 10

				conservatism = 0
				paternalism = 80
				despotism = 0
				fascism = 0
				national_socialism = 0
				ultranationalism = 10

			}
			OMS = {
				every_unit_leader = { retire = yes }
			}
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			remove_all_ministers = yes
			add_ideas = OMS_Oskar_Kuul_hog
			add_ideas = OMS_Leonid_Shevchuk_for
			add_ideas = OMS_Dmitry_Eremeev_eco
			add_ideas = OMS_Andrey_Matvienko_sec
			OMS_Viktor_Grigoriev = {
				add_country_leader_role = {
					promote_leader = yes
					country_leader = {
						desc = "POLITICS_VIKTOR_GRIGORIEV_ONEGA_DESC"
						ideology = paternalism_provisional_government_subtype
						expire = "1999.1.1"
						traits = { }
					}
				}
				add_field_marshal_role = {
					traits = { war_hero inflexible_strategist infantry_leader winter_specialist unyielding_defender }
					skill = 3
					attack_skill = 2
					defense_skill = 4
					planning_skill = 3
					logistics_skill = 1
					legacy_id = 15002
				}
			}
			OMS_Andrey_Matvienko = {
				add_corps_commander_role = {
					traits = { trait_cautious trait_engineer }
					skill = 2
					attack_skill = 2
					defense_skill = 2
					planning_skill = 2
					logistics_skill = 1
					id = 15003
				}
			}
			remove_ideas = {
				OMS_fueled_by_revenge
				OMS_nothing_left_to_lose
				OMS_idea_quiet_war
				OMS_the_shield
				OMS_new_boss
				OMS_leadership_secured
				OMS_idea_plan_hydra
				OMS_idea_dispersed_industry
				OMS_collapsed_central_authority
				TNO_looming_fiscal_crisis
			}
			end_fiscal_crisis = yes
			set_variable = { national_debt = 0 } # clear debt for successor
			tno_conscription_improve = yes
		}
		SVR = {
			transfer_state = 580
			add_state_core = 580
			transfer_state = 653
			add_state_core = 653
			transfer_state = 871
			add_state_core = 871
			transfer_state = 845
			add_state_core = 845
			set_cosmetic_tag = SVR_ZLATOUST
			set_politics = {
				ruling_party = liberal_conservatism
			}
			set_popularities = {
				communist = 0
				socialist = 0
				progressivism = 10
				liberalism = 30
				liberal_conservatism = 40
				conservatism = 0
				paternalism = 20
				despotism = 0
				fascism = 0
				national_socialism = 0
				ultranationalism = 0

			}
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			remove_all_ministers = yes
			add_ideas = {
				SVR_Anatoly_Krasnov_Levitin_hog
				SVR_Sergey_Izvekov_for
				SVR_Avzalitdin_Isyangulov_eco
				SVR_Pyotr_Babichev_sec
			}
			retire_country_leader = yes
			SVR_Anton_Antonov_Ovseyenko = {
				add_country_leader_role = {
					promote_leader = yes
					country_leader = {
						desc = "POLITICS_ANTON_ANTONOV_OVSEYENKO_ONEGA_DESC"
						ideology = liberal_conservatism_subtype
						expire = "1999.1.1"
						traits = { }
					}
				}
			}
			SVR = {
				every_unit_leader = { retire = yes }
			}
			remove_ideas = {
				SVR_notso_redarmy
				SVR_fortified_homes
				SVR_fortified_homes_2
				SVR_fortified_homes_3
				SVR_fortified_factories
				SVR_fortified_factories_2
				SVR_new_russian_army
				SVR_new_russian_army_2
				SVR_new_russian_army_3
				SVR_new_russian_army_4
				SVR_specialized_defense
				SVR_specialized_defense_2
				SVR_specialized_defense_3
				SVR_combined_russian_army
				SVR_sverdlovsk_design_bureau_idea
				SVR_sverdlovsk_design_bureau_idea_2
				SVR_expanded_logistics_corps
				SVR_savant_high_command_idea
				SVR_quality_small_arms
				SVR_quality_small_arms_2
				SVR_simple_small_arms
				SVR_security_service
				SVR_security_service_2
				SVR_eyes_inside_the_machine_idea
				SVR_eyes_inside_the_machine_idea_2
				SVR_airland_battles
				SVR_increased_rations
				SVR_black_league_influence_tier_1
				SVR_black_league_influence_tier_2
				SVR_black_league_influence_tier_3
				SVR_black_league_influence_tier_4
				SVR_revisionist_influence_tier_1
				SVR_revisionist_influence_tier_2
				SVR_revisionist_influence_tier_3
				SVR_revisionist_influence_tier_4
				SVR_revisionist_sabotage
				SVR_revisionist_terrorism
				SVR_black_league_sabotage
				SVR_black_league_terrorism
				SVR_specialized_forces_idea
			}
			end_fiscal_crisis = yes
			set_variable = { national_debt = 0 } # clear debt for successor
		}
		ORE = {
			transfer_state = 852
			add_state_core = 852
			transfer_state = 849
			add_state_core = 849
			transfer_state = 652
			add_state_core = 652
			set_politics = {
				ruling_party = paternalism
			}
			add_popularity = {
				ideology = paternalism
				popularity = 0.27
			}
			swap_ideas = {
				remove_idea = tno_admin_efficiency_organized_chaos
				add_idea = tno_admin_efficiency_nonexistent_state_apparatus
			}
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			remove_faction_status = yes
		}
		URL = {
			transfer_state = 848
			add_state_core = 848
			transfer_state = 847
			add_state_core = 847
			transfer_state = 582
			add_state_core = 582
			transfer_state = 846
			add_state_core = 846
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			remove_faction_status = yes
		}
		ONG = {
			add_to_faction = URL
			add_to_faction = ORE
			add_to_faction = TYM
			add_to_faction = SVR
			add_to_faction = OMS
			add_to_faction = YGR
		}
	}
}

### West Siberia - Post-Zlatoust Collapse ###
WSB_add_collapse_administration = {
	custom_effect_tooltip = WSB_add_collapse_administration_tt
	set_global_flag = TNO_RUS_west_siberia_collapse
	hidden_effect = {
		TYM = {
			transfer_state = 403
			add_state_core = 403
			set_cosmetic_tag = TYM_ZLATOUST
			set_politics = {
				ruling_party = paternalism
			}
			set_popularities = {
				communist = 0
				socialist = 0
				progressivism = 20
				liberalism = 40

				conservatism = 0
				paternalism = 40
				despotism = 0
				fascism = 0
				national_socialism = 0
				ultranationalism = 0

			}
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			remove_all_ministers = yes
			TYM_Boris_Shcherbina = {
				add_country_leader_role = {
					promote_leader = yes
					country_leader = {
						desc = "POLITICS_BORIS_SHCHERBINA_ONEGA_DESC"
						ideology = paternalism_provisional_government_subtype
						expire = "1999.1.1"
						traits = { }
					}
				}
			}

			add_ideas = TYM_Ivan_Fedyuninsky_hog
			add_ideas = TYM_Yelena_Karbysheva_for
			add_ideas = TYM_Ernest_Voznesensky_eco
			add_ideas = TYM_Artyom_Sergeyev_sec

			TYM = {
				every_unit_leader = {
					limit = {
						OR = {
							has_id = 3571
							has_id = 3572
							has_id = 3575
							has_id = 3578
						}
					}
					retire = yes
				}
			}
			remove_ideas = {
				TYM_revisionist_remnant
				TYM_unorthodox_bolshevism
				TYM_repopulation_program
				TYM_repopulation_program_2
				TYM_repopulation_program_3
				TYM_homebrew_tanks_2
				TYM_the_red_army_morale
				TYM_the_red_army_morale_2
				TYM_the_red_army_morale_3
				TYM_the_red_army_strength
				TYM_the_red_army_strength_2
				TYM_the_red_army_strength_3
				TYM_what_is_the_five_year_plan_idea
				TYM_what_is_the_five_year_plan_idea_2
				TYM_what_is_the_five_year_plan_idea_3
				TYM_what_is_the_five_year_plan_idea_4
				TYM_what_is_the_five_year_plan_idea_5
				TYM_what_is_the_five_year_plan_idea_6
				TYM_united_five_year_plan
				TYM_Khruschyovka_idea
				TNO_looming_fiscal_crisis
			}
			end_fiscal_crisis = yes
			set_variable = { national_debt = 0 } # clear debt for successor
			reset_province_name = 12521
		}
		YGR = {
			transfer_state = 844
			add_state_core = 844
			transfer_state = 579
			add_state_core = 579
			set_cosmetic_tag = YGR_ZLATOUST
			set_politics = {
				ruling_party = liberal_conservatism
			}
			set_popularities = {
				communist = 5
				socialist = 20
				progressivism = 29
				liberalism = 0
				liberal_conservatism = 36
				conservatism = 0
				paternalism = 10
				despotism = 0
				fascism = 0
				national_socialism = 0
				ultranationalism = 0

			}
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			promote_character = YGR_ZLT_Shatter_Ivan_Istomin
			set_country_leader_description = {
				desc = "POLITICS_IVAN_ISTOMIN_DESC"
			}
			remove_ideas = {
				SIB_terror_bombing
				YGR_selfmade_men
				TNO_looming_fiscal_crisis
			}
			end_fiscal_crisis = yes
			set_variable = { national_debt = 0 } # clear debt for successor
			remove_all_ministers = yes
			add_ideas = {
				YGR_Ivan_Vyucheisky_hog
				YGR_Vasily_Ledkov_for
				YGR_Aleksandr_Bezumov_eco
				YGR_Alexey_Kalinin_sec
				RUS_shattered_ambitions
			}
			load_focus_tree = ZZZ_blank_focus
			YGR = {
				every_unit_leader = { retire = yes }
			}
		}
		OMS = {
			transfer_state = 571
			add_state_core = 571
			set_cosmetic_tag = OMS_ZLATOUST
			set_politics = {
				ruling_party = paternalism
			}
			set_popularities = {
				communist = 0
				socialist = 0
				progressivism = 0
				liberalism = 10

				conservatism = 0
				paternalism = 80
				despotism = 0
				fascism = 0
				national_socialism = 0
				ultranationalism = 10

			}
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			remove_all_ministers = yes
			OMS = {
				every_unit_leader = { retire = yes }
			}
			add_ideas = {
				OMS_Oskar_Kuul_hog
				OMS_Leonid_Shevchuk_for
				OMS_Dmitry_Eremeev_eco
				OMS_Andrey_Matvienko_sec
			}
			OMS_Viktor_Grigoriev = {
				add_country_leader_role = {
					promote_leader = yes
					country_leader = {
						desc = "POLITICS_VIKTOR_GRIGORIEV_DESC"
						ideology = paternalism_provisional_government_subtype
						expire = "1999.1.1"
						traits = { }
					}
				}
				add_field_marshal_role = {
					traits = { war_hero inflexible_strategist infantry_leader winter_specialist unyielding_defender }
					skill = 3
					attack_skill = 2
					defense_skill = 4
					planning_skill = 3
					logistics_skill = 1
					legacy_id = 15002
				}
			}
			OMS_Andrey_Matvienko = {
				add_corps_commander_role = {
					traits = { trait_cautious trait_engineer }
					skill = 2
					attack_skill = 2
					defense_skill = 2
					planning_skill = 2
					logistics_skill = 1
					id = 15003
				}
			}
			remove_ideas = {
				OMS_fueled_by_revenge
				OMS_nothing_left_to_lose
				OMS_idea_quiet_war
				OMS_the_shield
				OMS_new_boss
				OMS_leadership_secured
				OMS_idea_plan_hydra
				OMS_idea_dispersed_industry
				OMS_collapsed_central_authority
				TNO_looming_fiscal_crisis
			}
			end_fiscal_crisis = yes
			set_variable = { national_debt = 0 } # clear debt for successor
			tno_conscription_improve = yes
		}
		SVR = {
			transfer_state = 580
			add_state_core = 580
			set_cosmetic_tag = SVR_ZLATOUST
			set_politics = {
				ruling_party = liberal_conservatism
			}
			set_popularities = {
				communist = 0
				socialist = 0
				progressivism = 10
				liberalism = 30
				liberal_conservatism = 40
				conservatism = 0
				paternalism = 20
				despotism = 0
				fascism = 0
				national_socialism = 0
				ultranationalism = 0

			}
			set_temp_variable = { TNO_economy_type_temp = token:Econ_Type_Capitalism }
			econ_type_change = yes
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			remove_all_ministers = yes
			add_ideas = SVR_Anatoly_Krasnov_Levitin_hog
			add_ideas = SVR_Sergey_Izvekov_for
			add_ideas = SVR_Avzalitdin_Isyangulov_eco
			add_ideas = SVR_Pyotr_Babichev_sec
			retire_country_leader = yes
			SVR_Anton_Antonov_Ovseyenko = {
				add_country_leader_role = {
					promote_leader = yes
					country_leader = {
						desc = "POLITICS_ANTON_ANTONOV_OVSEYENKO_DESC"
						ideology = liberal_conservatism_subtype
						expire = "1999.1.1"
						traits = { }
					}
				}
			}
			SVR = {
				every_unit_leader = { retire = yes }
			}
			remove_ideas = {
				SVR_notso_redarmy
				SVR_fortified_homes
				SVR_fortified_homes_2
				SVR_fortified_homes_3
				SVR_fortified_factories
				SVR_fortified_factories_2
				SVR_new_russian_army
				SVR_new_russian_army_2
				SVR_new_russian_army_3
				SVR_new_russian_army_4
				SVR_specialized_defense
				SVR_specialized_defense_2
				SVR_specialized_defense_3
				SVR_combined_russian_army
				SVR_sverdlovsk_design_bureau_idea
				SVR_sverdlovsk_design_bureau_idea_2
				SVR_expanded_logistics_corps
				SVR_savant_high_command_idea
				SVR_quality_small_arms
				SVR_quality_small_arms_2
				SVR_simple_small_arms
				SVR_security_service
				SVR_security_service_2
				SVR_eyes_inside_the_machine_idea
				SVR_eyes_inside_the_machine_idea_2
				SVR_airland_battles
				SVR_increased_rations
				SVR_black_league_influence_tier_1
				SVR_black_league_influence_tier_2
				SVR_black_league_influence_tier_3
				SVR_black_league_influence_tier_4
				SVR_revisionist_influence_tier_1
				SVR_revisionist_influence_tier_2
				SVR_revisionist_influence_tier_3
				SVR_revisionist_influence_tier_4
				SVR_revisionist_sabotage
				SVR_revisionist_terrorism
				SVR_black_league_sabotage
				SVR_black_league_terrorism
				SVR_specialized_forces_idea
			}
			end_fiscal_crisis = yes
			set_variable = { national_debt = 0 } # clear debt for successor
		}
	}
	ZLT = {
		set_cosmetic_tag = ZLT_SERENE_REPUBLIC
		add_state_core = 754
		add_state_core = 572
		add_state_core = 653
		add_state_core = 845
		add_state_core = 756
		add_state_core = 581
		add_state_core = 863
	}
}

### Central Siberia - Workers' Revolt Collapse ###
KRS_reformed_siberian_socialist_workers_republic = {
	set_global_flag = TNO_RUS_central_siberia_collapse
	KRS = {
		set_politics = {
			ruling_party = communist
		}
		add_popularity = {
			ideology = communist
			popularity = 0.4
		}
		kill_country_leader = yes
		set_cosmetic_tag = KRS_REVOLT
		transfer_state = 757
		add_state_core = 757
		transfer_state = 569
		add_state_core = 569
		if = {
			limit = {
				KAL = {
					owns_state = 329
				}
			}
			transfer_state = 329
			add_state_core = 329
		}
		if = {
			limit = {
				KAL = {
					owns_state = 814
				}
			}
			transfer_state = 814
			add_state_core = 814
		}
		set_temp_variable = { TNO_economy_subtype_temp = token:Econ_Subtype_Worker_Directed }
		econ_subtype_change = yes
		remove_all_ministers = yes
		add_ideas = {
			KRS_Yegor_Burlov_hog
			KRS_Leonid_Gorshkov_for
			KRS_Gleb_Vanak_eco
			KRS_Victor_Us_sec
		}
		add_country_leader_role = {
			character = KRS_Ivan_Sevastyanov
			promote_leader = yes
			country_leader = {
				desc = "POLITICS_IVAN_SEVASTYANOV_DESC"
				expire = "1999.1.1"
				ideology = communist_bolshevism_subtype
				traits = { }
			}
		}
		KRS = {
			every_unit_leader = { retire = yes }
		}
		add_corps_commander_role = {
			character = KRS_Victor_Us
			traits = { career_officer organizer }
			skill = 2
			attack_skill = 2
			defense_skill = 2
			planning_skill = 2
			logistics_skill = 1
			legacy_id = 15106
		}
		hidden_effect = {
			load_focus_tree = ZZZ_blank_focus
			remove_ideas = {
				KRS_wild_promises
				KRS_military_guided_democracy
				KRS_treasonous_traditions
			}
		}
	}
}

ALT_siberian_workers_and_peasants_union = {
	ALT = {
		set_politics = {
			ruling_party = socialist
		}
		add_popularity = {
			ideology = socialist
			popularity = 0.4
		}
		set_temp_variable = { TNO_economy_subtype_temp = token:Econ_Subtype_Worker_Directed }
		econ_subtype_change = yes
		set_cosmetic_tag = ALT_REVOLT
		transfer_state = 654
		transfer_state = 40
		add_state_core = 654
		add_state_core = 40
		remove_all_ministers = yes
		remove_advisor_role = {
			character = ALT_Erkemen_Palkin
			slot = foreign_minister
		}
		add_advisor_role = {
			character = ALT_Erkemen_Palkin
			advisor = {
				slot = foreign_minister
				idea_token = ALT_Erkemen_Palkin_SWPU_for
				traits = { for_pacifist }
				ledger = civilian
				cost = -1
				can_be_fired = no
				ai_will_do = { factor = 0 }
			}
		}
		add_ideas = {
			ALT_Vil_Lipatov_hog
			ALT_Erkemen_Palkin_SWPU_for
			ALT_Alexander_Georgiev_eco
			ALT_Valery_Lazarev_sec
		}
		add_country_leader_role = {
			character = ALT_Maria_Borchenko
			promote_leader = yes
			country_leader = {
				desc = "POLITICS_MARIA_BORCHENKO_DESC"
				expire = "1999.1.1"
				ideology = socialist_revolutionary_frontism_subtype
				traits = { }
			}
		}
		ALT = {
			every_unit_leader = { retire = yes }
		}
		add_corps_commander_role = {
			character = ALT_Valery_Lazarev
			traits = { infantry_officer organizer }
			skill = 2
			attack_skill = 1
			defense_skill = 3
			planning_skill = 2
			logistics_skill = 1
			legacy_id = 15107
		}
		hidden_effect = {
			load_focus_tree = ZZZ_blank_focus
			remove_ideas = {
				ALT_religious_divide
				ALT_christian_socialism
				ALT_agrarian_economy
			}
		}
	}
}

SBA_free_workers_republic_of_siberia = {
	SBA = {
		set_country_flag = SBA_disable_black_army_control
		set_politics = {
			ruling_party = communist
		}
		add_popularity = {
			ideology = communist
			popularity = 0.4
		}
		set_cosmetic_tag = SBA_REVOLT
		transfer_state = 888
		transfer_state = 576
		transfer_state = 758
		transfer_state = 567
		transfer_state = 568
		add_state_core = 888
		add_state_core = 576
		add_state_core = 758
		add_state_core = 567
		add_state_core = 568
		remove_all_ministers = yes
		add_ideas = {
			SBA_Yevganiya_Taratuta_hog
			SBA_Tatyana_Okuneva_for
			SBA_Georgy_Boltayev_eco
			SBA_Mikhail_Mudrov_sec
		}
		add_country_leader_role = {
			character = SBA_Stepan_Valenteev
			country_leader = {
				desc = "POLITICS_STEPAN_VALENTEEV_DESC"
				expire = "1983.4.24"
				ideology = communist_mao_zedong_thought_subtype
				traits = {}
				id = -1
			}
		}
		promote_character = SBA_Stepan_Valenteev
		set_variable = { econ_centralization = 60 }
		set_temp_variable = { TNO_economy_subtype_temp = token:Econ_Subtype_Worker_Directed }
		econ_subtype_change = yes
		hidden_effect = {
			load_focus_tree = ZZZ_blank_focus
			remove_ideas = {
				SBA_anarchist_refuge
				SBA_militarized_society
				SBA_black_army_administration_2
			}
		}
	}
}

CSB_central_siberia_collapse = {
	set_global_flag = TNO_RUS_central_siberia_collapse
	KAL = {
		transfer_state = 570
		transfer_state = 578
		transfer_state = 40
		transfer_state = 654
		transfer_state = 569
		transfer_state = 887
		transfer_state = 757
		transfer_state = 568
		transfer_state = 888
		transfer_state = 576
		transfer_state = 566
		transfer_state = 567
		transfer_state = 758
		transfer_state = 577
		transfer_state = 516
		KRS_reformed_siberian_socialist_workers_republic = yes
		ALT_siberian_workers_and_peasants_union = yes
		SBA_free_workers_republic_of_siberia = yes
		if = {
			limit = {
				KAL = {
					owns_state = 566
				}
			}
			SBA = {
				transfer_state = 566
				add_state_core = 566
			}
		}
		if = {
			limit = {
				KAL = {
					owns_state = 575
				}
			}
			SBA = {
				transfer_state = 575
				add_state_core = 575
			}
		}
		if = {
			limit = {
				KAL = {
					owns_state = 761
				}
			}
			SBA = {
				transfer_state = 761
				add_state_core = 761
			}
		}
	}
}

### Far East Collapse ###
FST_far_east_collapse = {
	set_global_flag = TNO_RUS_far_east_collapse
	hidden_effect = {
		BRY = {
			set_politics = {
				ruling_party = despotism
			}
			set_popularities = {
				communist = 10
				socialist = 20
				progressivism = 0
				liberalism = 0
				liberal_conservatism = 0
				conservatism = 0
				paternalism = 0
				despotism = 70
				ultranationalism = 0
				fascism = 0
				national_socialism = 0
			}
			set_party_name = {
				ideology = despotism
				long_name = BRY_collapse_depostism_party_long
				name = BRY_collapse_depostism_party
			}
			BRY = {
				every_unit_leader = {
					remove_unit_leader_role = yes
				}
			}
			remove_ideas = {
				BRY_uncertain_revolutionaries
				BRY_ghost_of_bukharinism
			}
			add_country_leader_role = {
				character = BRY_Gurzhap_Ochirov
				country_leader = {
					desc = "POLITICS_GURZHAP_OCHIROV_COLLAPSE_DESC"
					expire = "1999.1.1"
					ideology = despotism_partisan_movement_subtype
					traits = { }
					id = -1
				}
				promote_leader = yes
			}
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			set_cosmetic_tag = BRY_collapse
			transfer_state = 565
			add_state_core = 565
			set_capital = { state = 565 remember_old_capital = no }
		}
		#absolutely disgusting but I've ran out of idea on how it works

		CHT = {
			set_politics = {
				ruling_party = paternalism
			}

			set_popularities = {
				communist = 0
				socialist = 0
				progressivism = 0
				liberalism = 0
				liberal_conservatism = 0
				conservatism = 20
				paternalism = 50
				despotism = 30
				ultranationalism = 0
				fascism = 0
				national_socialism = 0
			}
			set_party_name = {
				ideology = paternalism
				long_name = CHT_collapse_paternalism_party_long
				name = CHT_collapse_paternalism_party
			}
			add_country_leader_role = {
				character = CHT_Leonid_Chernykh
				country_leader = {
					expire = "1999.1.1"
					ideology = paternalism_controlled_democracy_subtype
					traits = { }
					desc = POLITICS_LEONID_CHERNYKH_COLLAPSE_DESC
				}
				promote_leader = yes
			}

			remove_ideas = {
				RUS_heirs_of_harbin
				CHT_uneasy_figurhead
				CHT_sunset_of_white_chivalry
			}
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			set_cosmetic_tag = CHT_collapse
			transfer_state = 563
			add_state_core = 563
			set_capital = { state = 563 remember_old_capital = no }
		}
		IRK = {
			set_politics = {
				ruling_party = communist
			}
			add_country_leader_role = {
				character = IRK_Zhambal_Gomboev
				country_leader = {
					desc = "POLITICS_ZHAMBAL_GOMBOEV_COLLAPSE_DESC"
					expire = "1999.1.1"
					ideology = communist_national_communism_subtype
					traits = { }
				}
				promote_leader = yes
			}
			set_popularities = {
				communist = 60
				socialist = 30
				progressivism = 0
				liberalism = 0
				liberal_conservatism = 0
				conservatism = 0
				paternalism = 0
				despotism = 10
				ultranationalism = 0
				fascism = 0
				national_socialism = 0
			}
			set_party_name = {
				ideology = communist
				long_name = IRK_collapse_communist_party_long
				name = IRK_collapse_communist_party
			}
			remove_ideas = {
				IRK_bitter_remnant
				IRK_yagodas_paranoia
			}
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			set_cosmetic_tag = IRK_collapse
			transfer_state = 564
			transfer_state = 566
			add_state_core = 564
			add_state_core = 566
			set_capital = { state = 566 remember_old_capital = no }
		}
		KMC = {
			add_country_leader_role = {
				character = KMC_Nikolay_Ivanovsky
				country_leader = {
					desc = "POLITICS_NIKOLAY_IVANOVSKY_COLLAPSE_DESC"
					expire = "1999.1.1"
					ideology = despotism_military_junta_subtype
					traits = { }
				}
				promote_leader = yes
			}
			set_politics = {
				ruling_party = despotism
			}
			set_popularities = {
				despotism = 100
			}
			set_party_name = {
				ideology = despotism
				long_name = KMC_collapse_despotism_party_long
				name = KMC_collapse_despotism_party
			}
			remove_ideas = {
				KMC_sailor_state
			}
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			set_cosmetic_tag = KMC_collapse
			transfer_state = 637
			add_state_core = 637
			set_capital = { state = 637 remember_old_capital = no }
		}
		MAG = {
			set_politics = {
				ruling_party = paternalism
			}
			set_popularities = {
				communist = 0
				socialist = 50
				progressivism = 0
				liberalism = 0
				liberal_conservatism = 0
				conservatism = 0
				paternalism = 20
				despotism = 30
				ultranationalism = 0
				fascism = 0
				national_socialism = 0
			}
			set_party_name = {
				ideology = paternalism
				long_name = MAG_collapse_paternalism_party_long
				name = MAG_collapse_paternalism_party
			}
			set_cosmetic_tag = MAG_collapse
			transfer_state = 561
			transfer_state = 562
			transfer_state = 886
			transfer_state = 1364
			add_state_core = 561
			add_state_core = 562
			add_state_core = 886
			add_state_core = 1364
			set_capital = { state = 562 remember_old_capital = no }
			OMO = { OMO_Pavel_Sudoplatov = { set_nationality = MAG } }
			add_country_leader_role = {
				character = OMO_Pavel_Sudoplatov
				country_leader = {
					ideology = paternalism_provisional_government_subtype
					traits = { }
					desc = POLITICS_PAVEL_SUDOPLATOV_COLLAPSE_DESC
				}
				promote_leader = yes
			}
			add_advisor_role = {
				character = MAG_Nahum_Eitingon
				advisor = {
					slot = head_of_government
					idea_token = OMO_Nahum_Eitingon_hog
					traits = { hog_backroom_backstabber }
					ledger = civilian
					cost = -1
					can_be_fired = no
					ai_will_do = { factor = 0 }
				}
				activate = yes
			}
			add_advisor_role = {
				character = MAG_Vasily_Bekkerov
				advisor = {
					slot = foreign_minister
					idea_token = OMO_Vasily_Bekkerov_for
					traits = { for_political_appointment }
					ledger = civilian
					cost = -1
					can_be_fired = no
					ai_will_do = { factor = 0 }
				}
				activate = yes
			}
			add_advisor_role = {
				character = MAG_Ivan_Arento
				advisor = {
					slot = economy_minister
					idea_token = OMO_Ivan_Arento_eco
					traits = { eco_balanced_budget_economy }
					ledger = civilian
					cost = -1
					can_be_fired = no
					ai_will_do = { factor = 0 }
				}
				activate = yes
			}
			add_advisor_role = {
				character = MAG_Yakov_Serebryansky
				advisor = {
					slot = security_minister
					idea_token = OMO_Yakov_Serebryansky_sec
					traits = { sec_secret_police_chief }
					ledger = civilian
					cost = -1
					can_be_fired = no
					ai_will_do = { factor = 0 }
				}
				activate = yes
			}
			remove_ideas = {
				RUS_heirs_of_harbin
				MAG_fascist_splitters
				MAG_gateway_into_russia
			}
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
		}
		OMO = {
			clr_country_flag = RUS_regional_stage
			clear_global_event_target = RUS_far_east_unifier
			set_politics = {
				ruling_party = despotism
			}
			add_country_leader_role = {
				character = OMO_Ivan_Nikishov
				promote_leader = yes
				country_leader = {
					desc = "POLITICS_IVAN_NIKISHOV_COLLAPSE_DESC"
					expire = "1999.1.1"
					ideology = despotism_warlordism_subtype
					traits = { }
				}
			}
			set_popularities = {
				communist = 0
				socialist = 80
				progressivism = 0
				liberalism = 0
				liberal_conservatism = 0
				conservatism = 0
				paternalism = 0
				despotism = 20
				ultranationalism = 0
				fascism = 0
				national_socialism = 0
			}
			set_party_name = {
				ideology = despotism
				long_name = OMO_collapse_despotism_party_long
				name = OMO_collapse_despotism_party
			}
			remove_ideas = {
				RUS_isolated_vilages
				OMO_holy_duty
			}
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			set_cosmetic_tag = OMO_collapse
			transfer_state = 644
			transfer_state = 891
			add_state_core = 644
			add_state_core = 891
			set_capital = { state = 644 remember_old_capital = no }
		}
		OMO_Gleb_Yakunin = {
			set_nationality = VIL
		}
		VIL = {
			clr_global_flag = VIL_anarchy_flag
			set_politics = {
				ruling_party = despotism
			}
			add_country_leader_role = {
				character = OMO_Gleb_Yakunin
				country_leader = {
					ideology = despotism_theocracy_subtype
					desc = POLITICS_GLEB_YAKUNIN_COLLAPSE_DESC
					expire = "1999.1.1"
				}
				promote_leader = yes
			}

			set_popularities = {
				communist = 0
				socialist = 40
				progressivism = 0
				liberalism = 0
				liberal_conservatism = 0
				conservatism = 0
				paternalism = 0
				despotism = 60
				ultranationalism = 0
				fascism = 0
				national_socialism = 0
			}
			set_party_name = {
				ideology = despotism
				long_name = OMO_socialism_party_men_long
				name = OMO_socialism_party_men
			}
			remove_ideas = RUS_isolated_vilages
			add_ideas = RUS_shattered_ambitions
			load_focus_tree = ZZZ_blank_focus
			set_cosmetic_tag = VIL_collapse
			transfer_state = 575
			transfer_state = 761
			transfer_state = 889
			transfer_state = 890
			add_state_core = 575
			add_state_core = 761
			add_state_core = 889
			add_state_core = 890
			set_capital = { state = 890 remember_old_capital = no }
		}
		YAK = {
			set_politics = {
				ruling_party = despotism
			}
			add_country_leader_role = {
				character = YAK_Vladimir_Kuroedov
				country_leader = {
					ideology = despotism_personalistic_dictatorship_subtype
					desc = POLITICS_VLADIMIR_KUROEDOV_COLLAPSE_DESC
					expire = "1999.1.1"
				}
				promote_leader = yes
			}
			set_popularities = {
				communist = 0
				socialist = 30
				progressivism = 0
				liberalism = 0
				liberal_conservatism = 0
				conservatism = 0
				paternalism = 10
				despotism = 60
				fascism = 0
				ultranationalism = 0
				national_socialism = 0
			}
			remove_all_ministers = yes
			add_ideas = {
				YAK_Generic_Vacant_hog
				YAK_Generic_Vacant_for
				YAK_Generic_Vacant_eco
				YAK_Generic_Vacant_sec
			}
			set_party_name = {
				ideology = despotism
				long_name = YAK_collapse_despotism_party_long
				name = YAK_collapse_despotism_party
			}
			load_focus_tree = ZZZ_blank_focus
			set_cosmetic_tag = YAK_collapse
			transfer_state = 574
			transfer_state = 760
			transfer_state = 759
			add_state_core = 574
			add_state_core = 760
			add_state_core = 759
			set_capital = { state = 574 remember_old_capital = no }
		}
	}
}

RUS_nuclear_program_effects = {
	if = {
		limit = {
			has_country_flag = RUS_started_nukes
		}
		clamp_variable = { var = RUSNukesMonthlyProgress min = 0 max = 100 }
		if = {
			limit = {
				has_country_flag = RUS_nuclear_program_phase_1
			}
			add_to_variable = { RUSNukesTheoryProgress = RUSNukesMonthlyProgress }
		}
		else_if = {
			limit = {
				has_country_flag = RUS_nuclear_program_phase_2
			}
			add_to_variable = { RUSNukesMatsProgress = RUSNukesMonthlyProgress }
		}
		else_if = {
			limit = {
				has_country_flag = RUS_nuclear_program_phase_3
			}
			add_to_variable = { RUSNukesInfraProgress = RUSNukesMonthlyProgress }
		}
		else_if = {
			limit = {
				has_country_flag = RUS_nuclear_program_phase_4
			}
			add_to_variable = { RUSNukesRefineProgress = RUSNukesMonthlyProgress }
		}
		else_if = {
			limit = {
				has_country_flag = RUS_nuclear_program_phase_5
			}
			add_to_variable = { RUSNukesWeaponsProgress = RUSNukesMonthlyProgress }
		}
		clamp_variable = { var = RUSNukesTheoryProgress min = 0 max = 100 }
		clamp_variable = { var = RUSNukesMatsProgress min = 0 max = 100 }
		clamp_variable = { var = RUSNukesInfraProgress min = 0 max = 100 }
		clamp_variable = { var = RUSNukesRefineProgress min = 0 max = 100 }
		clamp_variable = { var = RUSNukesWeaponsProgress min = 0 max = 100 }
	}
}

RUS_integration_cost_days_decrease = {
	custom_effect_tooltip = RUS_integration_cost_days_decrease_tt
	add_to_variable = { RUS_integration_cost_days = -5 }
	clamp_variable = { var = RUS_integration_cost_days max = 1000 min = 0 }
}

RUS_admin_efficiency_debuff_decrease = {
	custom_effect_tooltip = RUS_admin_efficiency_debuff_decrease_tt
	add_to_variable = { RUS_admin_efficiency_debuff = -1 }
	clamp_variable = { var = RUS_admin_efficiency_debuff max = 10 min = 1 }
}

RUS_fire_southern_urals_aftermath_magnitogorsk_despotism = {
	### WRRF ###

	if = {
		limit = {
			original_tag = WRS
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Mikhail_Tukhachevsky
					ruling_only = yes
				}
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Georgy_Zhukov
					ruling_only = yes
				}
			}
			###Post-Magnitogorsk Events Here
		}
	}

	### KOMI ###

	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_government = socialist
			}
			###Post-Magnitogorsk Events Here
			country_event = {
				id = iainmbanks.9
				days = 30
				random_hours = 200
			}
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Mikhail_Suslov
						ruling_only = yes
					}
				}
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Svetlana_Bukharina
						ruling_only = yes
					}
				}
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = progressivism
				}
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = liberalism
				}
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = paternalism
				}
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = despotism
					has_country_leader = {
						character = KOM_Svetlana_Stalina
						ruling_only = yes
					}
				}
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = fascism
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = ultranationalism
			}
			###Post-Magnitogorsk Events Here
		}
	}

	### VYATKA ###

	if = {
		limit = {
			original_tag = VYT
		}
		if = {
			limit = {
				has_government = liberalism
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-Magnitogorsk Events Here
		}
	}

	### ARYAN BROTHERHOOD ###

	if = {
		limit = {
			original_tag = PRM
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Gutrum_Vagner
					ruling_only = yes
				}
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Velimir
					ruling_only = yes
				}
			}
			###Post-Magnitogorsk Events Here
		}
	}

	### SAMARA ###

	if = {
		limit = {
			original_tag = SAM
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = despotism
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-Magnitogorsk Events Here
		}
	}

	### SVERDLOVSK ###

	if = {
		limit = {
			original_tag = SVR
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-Magnitogorsk Events Here
		}
	}

	### TYUMEN ###

	if = {
		limit = {
			original_tag = TYM
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Lazar_Kaganovich
					ruling_only = yes
				}
			}
			###Post-Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Nikita_Khrushchev
					ruling_only = yes
				}
			}
			###Post-Magnitogorsk Events Here
		}
	}

	### OMSK ###

	if = {
		limit = {
			original_tag = OMS
		}
		###Post-Magnitogorsk Events Here
	}
}

RUS_fire_southern_urals_aftermath_magnitogorsk_communist = {
	### WRRF ###

	if = {
		limit = {
			original_tag = WRS
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Mikhail_Tukhachevsky
					ruling_only = yes
				}
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Georgy_Zhukov
					ruling_only = yes
				}
			}
			###Post-NKVD Magnitogorsk Events Here
		}
	}

	### KOMI ###

	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_government = socialist
			}
			###Post-NKVD Magnitogorsk Events Here
			country_event = {
				id = iainmbanks.9
				days = 30
				random_hours = 200
			}
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Mikhail_Suslov
						ruling_only = yes
					}
				}
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Svetlana_Bukharina
						ruling_only = yes
					}
				}
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = progressivism
				}
			}
			###Post-NKVD Magnitogorsk Events Here
			country_event = {
				id = komi.51
				days = 60
				random_hours = 200
			}
		}
		if = {
			limit = {
				OR = {
					has_government = liberalism
				}
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = paternalism
				}
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = despotism
					has_country_leader = {
						character = KOM_Svetlana_Stalina
						ruling_only = yes
					}
				}
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = fascism
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = ultranationalism
			}
			###Post-NKVD Magnitogorsk Events Here
		}
	}

	### VYATKA ###

	if = {
		limit = {
			original_tag = VYT
		}
		if = {
			limit = {
				has_government = liberalism
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-NKVD Magnitogorsk Events Here
		}
	}

	### ARYAN BROTHERHOOD ###

	if = {
		limit = {
			original_tag = PRM
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Gutrum_Vagner
					ruling_only = yes
				}
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Velimir
					ruling_only = yes
				}
			}
			###Post-NKVD Magnitogorsk Events Here
		}
	}

	### SAMARA ###

	if = {
		limit = {
			original_tag = SAM
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = despotism
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-NKVD Magnitogorsk Events Here
		}
	}

	### SVERDLOVSK ###

	if = {
		limit = {
			original_tag = SVR
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-NKVD Magnitogorsk Events Here
		}
	}

	### TYUMEN ###

	if = {
		limit = {
			original_tag = TYM
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Lazar_Kaganovich
					ruling_only = yes
				}
			}
			###Post-NKVD Magnitogorsk Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Nikita_Khrushchev
					ruling_only = yes
				}
			}
			###Post-NKVD Magnitogorsk Events Here
		}
	}

	### OMSK ###

	if = {
		limit = {
			original_tag = OMS
		}
		###Post-NKVD Magnitogorsk Events Here
	}
}

RUS_fire_southern_urals_aftermath_orenburg_socialist = {
	### WRRF ###

	if = {
		limit = {
			original_tag = WRS
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Mikhail_Tukhachevsky
					ruling_only = yes
				}
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Georgy_Zhukov
					ruling_only = yes
				}
			}
			###Post-LibSoc Orenburg Events Here
		}
	}

	### KOMI ###

	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_government = socialist
			}
			###Post-LibSoc Orenburg Events Here
			country_event = {
				id = iainmbanks.6
				days = 50
				random_hours = 200
			}
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Mikhail_Suslov
						ruling_only = yes
					}
				}
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Svetlana_Bukharina
						ruling_only = yes
					}
				}
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = progressivism
				}
			}
			###Post-LibSoc Orenburg Events Here
			country_event = {
				id = komi.40
				days = 50
				random_hours = 200
			}
		}
		if = {
			limit = {
				OR = {
					has_government = liberalism
				}
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = paternalism
				}
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = despotism
					has_country_leader = {
						character = KOM_Svetlana_Stalina
						ruling_only = yes
					}
				}
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = fascism
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = ultranationalism
			}
			###Post-LibSoc Orenburg Events Here
		}
	}

	### VYATKA ###

	if = {
		limit = {
			original_tag = VYT
		}
		if = {
			limit = {
				has_government = liberalism
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-LibSoc Orenburg Events Here
		}
	}

	### ARYAN BROTHERHOOD ###

	if = {
		limit = {
			original_tag = PRM
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Gutrum_Vagner
					ruling_only = yes
				}
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Velimir
					ruling_only = yes
				}
			}
			###Post-LibSoc Orenburg Events Here
		}
	}

	### SAMARA ###

	if = {
		limit = {
			original_tag = SAM
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = despotism
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-LibSoc Orenburg Events Here
		}
	}

	### SVERDLOVSK ###

	if = {
		limit = {
			original_tag = SVR
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-LibSoc Orenburg Events Here
		}
	}

	### TYUMEN ###

	if = {
		limit = {
			original_tag = TYM
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Lazar_Kaganovich
					ruling_only = yes
				}
			}
			###Post-LibSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Nikita_Khrushchev
					ruling_only = yes
				}
			}
			###Post-LibSoc Orenburg Events Here
		}
	}

	### OMSK ###

	if = {
		limit = {
			original_tag = OMS
		}
		###Post-LibSoc Orenburg Events Here
	}
}

RUS_fire_southern_urals_aftermath_orenburg_communist = {
	### WRRF ###

	if = {
		limit = {
			original_tag = WRS
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Mikhail_Tukhachevsky
					ruling_only = yes
				}
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Georgy_Zhukov
					ruling_only = yes
				}
			}
			###Post-AuthSoc Orenburg Events Here
		}
	}

	### KOMI ###

	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_government = socialist
			}
			###Post-AuthSoc Orenburg Events Here
			country_event = {
				id = iainmbanks.6
				days = 50
				random_hours = 200
			}
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Mikhail_Suslov
						ruling_only = yes
					}
				}
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Svetlana_Bukharina
						ruling_only = yes
					}
				}
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = progressivism
				}
			}
			###Post-AuthSoc Orenburg Events Here
			country_event = {
				id = komi.39
				days = 50
				random_hours = 200
			}
		}
		if = {
			limit = {
				OR = {
					has_government = liberalism
				}
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = paternalism
				}
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = despotism
					has_country_leader = {
						character = KOM_Svetlana_Stalina
						ruling_only = yes
					}
				}
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = fascism
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = ultranationalism
			}
			###Post-AuthSoc Orenburg Events Here
		}
	}

	### VYATKA ###

	if = {
		limit = {
			original_tag = VYT
		}
		if = {
			limit = {
				has_government = liberalism
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-AuthSoc Orenburg Events Here
		}
	}

	### ARYAN BROTHERHOOD ###

	if = {
		limit = {
			original_tag = PRM
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Gutrum_Vagner
					ruling_only = yes
				}
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Velimir
					ruling_only = yes
				}
			}
			###Post-AuthSoc Orenburg Events Here
		}
	}

	### SAMARA ###

	if = {
		limit = {
			original_tag = SAM
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = despotism
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-AuthSoc Orenburg Events Here
		}
	}

	### SVERDLOVSK ###

	if = {
		limit = {
			original_tag = SVR
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-AuthSoc Orenburg Events Here
		}
	}

	### TYUMEN ###

	if = {
		limit = {
			original_tag = TYM
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Lazar_Kaganovich
					ruling_only = yes
				}
			}
			###Post-AuthSoc Orenburg Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Nikita_Khrushchev
					ruling_only = yes
				}
			}
			###Post-AuthSoc Orenburg Events Here
		}
	}

	### OMSK ###

	if = {
		limit = {
			original_tag = OMS
		}
		###Post-AuthSoc Orenburg Events Here
	}
}

RUS_fire_southern_urals_aftermath_orenburg_authdem = {
	### WRRF ###

	if = {
		limit = {
			original_tag = WRS
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Mikhail_Tukhachevsky
					ruling_only = yes
				}
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Georgy_Zhukov
					ruling_only = yes
				}
			}
			###Post-AuthDem Orenburg Events Here
		}
	}

	### KOMI ###

	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_government = socialist
			}
			###Post-AuthDem Orenburg Events Here
			country_event = {
				id = iainmbanks.6
				days = 50
				random_hours = 200
			}
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Mikhail_Suslov
						ruling_only = yes
					}
				}
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Svetlana_Bukharina
						ruling_only = yes
					}
				}
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = progressivism
				}
			}
			###Post-AuthDem Orenburg Events Here
			country_event = {
				id = komi.38
				days = 50
				random_hours = 200
			}
		}
		if = {
			limit = {
				OR = {
					has_government = liberalism
				}
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = paternalism
				}
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = despotism
					has_country_leader = {
						character = KOM_Svetlana_Stalina
						ruling_only = yes
					}
				}
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				has_government = fascism
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				has_government = ultranationalism
			}
			###Post-AuthDem Orenburg Events Here
		}
	}

	### VYATKA ###

	if = {
		limit = {
			original_tag = VYT
		}
		if = {
			limit = {
				has_government = liberalism
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-AuthDem Orenburg Events Here
		}
	}

	### ARYAN BROTHERHOOD ###

	if = {
		limit = {
			original_tag = PRM
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Gutrum_Vagner
					ruling_only = yes
				}
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Velimir
					ruling_only = yes
				}
			}
			###Post-AuthDem Orenburg Events Here
		}
	}

	### SAMARA ###

	if = {
		limit = {
			original_tag = SAM
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				has_government = despotism
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-AuthDem Orenburg Events Here
		}
	}

	### SVERDLOVSK ###

	if = {
		limit = {
			original_tag = SVR
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-AuthDem Orenburg Events Here
		}
	}

	### TYUMEN ###

	if = {
		limit = {
			original_tag = TYM
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Lazar_Kaganovich
					ruling_only = yes
				}
			}
			###Post-AuthDem Orenburg Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Nikita_Khrushchev
					ruling_only = yes
				}
			}
			###Post-AuthDem Orenburg Events Here
		}
	}

	### OMSK ###

	if = {
		limit = {
			original_tag = OMS
		}
		###Post-AuthDem Orenburg Events Here
	}
}

RUS_fire_southern_urals_aftermath_ural_league = {
	### WRRF ###

	if = {
		limit = {
			original_tag = WRS
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Mikhail_Tukhachevsky
					ruling_only = yes
				}
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Georgy_Zhukov
					ruling_only = yes
				}
			}
			###Post-Ural League Events Here
		}
	}

	### KOMI ###

	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_government = socialist
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Mikhail_Suslov
						ruling_only = yes
					}
				}
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Svetlana_Bukharina
						ruling_only = yes
					}
				}
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = progressivism
				}
			}
			###Post-Ural League Events Here
			country_event = {
				id = komi.41
				days = 75
				random_hours = 200
			}
		}
		if = {
			limit = {
				OR = {
					has_government = liberalism
				}
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = paternalism
				}
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = despotism
					has_country_leader = {
						character = KOM_Svetlana_Stalina
						ruling_only = yes
					}
				}
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				has_government = fascism
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				has_government = ultranationalism
			}
			###Post-Ural League Events Here
		}
	}

	### VYATKA ###

	if = {
		limit = {
			original_tag = VYT
		}
		if = {
			limit = {
				has_government = liberalism
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-Ural League Events Here
		}
	}

	### ARYAN BROTHERHOOD ###

	if = {
		limit = {
			original_tag = PRM
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Gutrum_Vagner
					ruling_only = yes
				}
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Velimir
					ruling_only = yes
				}
			}
			###Post-Ural League Events Here
		}
	}

	### SAMARA ###

	if = {
		limit = {
			original_tag = SAM
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				has_government = despotism
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-Ural League Events Here
		}
	}

	### SVERDLOVSK ###

	if = {
		limit = {
			original_tag = SVR
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-Ural League Events Here
		}
	}

	### TYUMEN ###

	if = {
		limit = {
			original_tag = TYM
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Lazar_Kaganovich
					ruling_only = yes
				}
			}
			###Post-Ural League Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Nikita_Khrushchev
					ruling_only = yes
				}
			}
			###Post-Ural League Events Here
		}
	}

	### OMSK ###

	if = {
		limit = {
			original_tag = OMS
		}
		###Post-Ural League Events Here
	}
}

RUS_fire_southern_urals_aftermath_orsk = {
	### WRRF ###

	if = {
		limit = {
			original_tag = WRS
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Mikhail_Tukhachevsky
					ruling_only = yes
				}
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Georgy_Zhukov
					ruling_only = yes
				}
			}
			###Post-Orsk Events Here
		}
	}

	### KOMI ###

	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_government = socialist
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Mikhail_Suslov
						ruling_only = yes
					}
				}
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = communist
					has_country_leader = {
						character = KOM_Svetlana_Bukharina
						ruling_only = yes
					}
				}
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = progressivism
				}
			}
			###Post-Orsk Events Here
			country_event = {
				id = komi.42
				days = 25
				random_hours = 200
			}
		}
		if = {
			limit = {
				OR = {
					has_government = liberalism
				}
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				OR = {
					has_government = paternalism
				}
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				AND = {
					has_government = despotism
					has_country_leader = {
						character = KOM_Svetlana_Stalina
						ruling_only = yes
					}
				}
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				has_government = fascism
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				has_government = ultranationalism
			}
			###Post-Orsk Events Here
		}
	}

	### VYATKA ###

	if = {
		limit = {
			original_tag = VYT
		}
		if = {
			limit = {
				has_government = liberalism
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-Orsk Events Here
		}
	}

	### ARYAN BROTHERHOOD ###

	if = {
		limit = {
			original_tag = PRM
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Gutrum_Vagner
					ruling_only = yes
				}
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Velimir
					ruling_only = yes
				}
			}
			###Post-Orsk Events Here
		}
	}

	### SAMARA ###

	if = {
		limit = {
			original_tag = SAM
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				has_government = despotism
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			###Post-Orsk Events Here
		}
	}

	### SVERDLOVSK ###

	if = {
		limit = {
			original_tag = SVR
		}
		if = {
			limit = {
				has_government = paternalism
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				has_government = conservatism
			}
			###Post-Orsk Events Here
		}
	}

	### TYUMEN ###

	if = {
		limit = {
			original_tag = TYM
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Lazar_Kaganovich
					ruling_only = yes
				}
			}
			###Post-Orsk Events Here
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Nikita_Khrushchev
					ruling_only = yes
				}
			}
			###Post-Orsk Events Here
		}
	}

	### OMSK ###

	if = {
		limit = {
			original_tag = OMS
		}
		###Post-Orsk Events Here
	}
}

VP_change_outman = {
	if = {
		limit = {
			state = 657
		}
		if = {
			limit = {
				ROOT = {
					is_russian_nation = yes
				}
			}
			657 = {
				set_state_name = STATE_657_rus
			}
			set_province_name = {
				id = 7801
				name = VICTORY_POINTS_7801_rus
			}
		}
		else_if = {
			limit = {
				ROOT = {
					OR = {
						is_in_faction_with = CHI
						is_in_faction_with = JAP
					}
				}
			}
			657 = {
				reset_state_name = yes
			}
			reset_province_name = 7801
		}
	}
	if = {
		limit = {
			state = 1646
		}
		if = {
			limit = {
				ROOT = {
					is_russian_nation = yes
				}
			}
			1646 = {
				set_state_name = STATE_1646_rus
			}
			set_province_name = {
				id = 7672
				name = VICTORY_POINTS_7672_rus
			}
			if = {
				limit = {
					ROOT = {
						RUS_consider_communist_regime = yes
					}
				}
				set_province_name = {
					id = 12263
					name = VICTORY_POINTS_12263_ruscom
				}
			}
			else = {
				set_province_name = {
					id = 12263
					name = VICTORY_POINTS_12263_rusnor
				}
			}
		}
		else_if = {
			limit = {
				ROOT = {
					OR = {
						is_in_faction_with = CHI
						is_in_faction_with = JAP
					}
				}
			}
			1646 = {
				reset_state_name = yes
			}
			reset_province_name = 12263
			reset_province_name = 7672
		}
	}
	if = {
		limit = {
			state = 1647
		}
		if = {
			limit = {
				ROOT = {
					is_russian_nation = yes
				}
			}
			1647 = {
				set_state_name = STATE_1647_rus
			}
			set_province_name = {
				id = 12559
				name = VICTORY_POINTS_12559_rus
			}
		}
		else_if = {
			limit = {
				ROOT = {
					OR = {
						is_in_faction_with = CHI
						is_in_faction_with = JAP
					}
				}
			}
			1647 = {
				reset_state_name = yes
			}
			reset_province_name = 12559
		}
	}
	if = {
		limit = {
			state = 409
		}
		if = {
			limit = {
				ROOT = {
					is_russian_nation = yes
				}
			}
			409 = {
				set_state_name = STATE_409_rus
			}
			set_province_name = {
				id = 12189
				name = VICTORY_POINTS_12189_rus
			}
			if = {
				limit = {
					ROOT = {
						RUS_consider_communist_regime = yes
					}
				}
				set_province_name = {
					id = 9604
					name = VICTORY_POINTS_9604_ruscom
				}
			}
			else = {
				set_province_name = {
					id = 9604
					name = VICTORY_POINTS_9604_rusnor
				}
			}
		}
		else_if = {
			limit = {
				ROOT = {
					OR = {
						is_in_faction_with = CHI
						is_in_faction_with = JAP
					}
				}
			}
			409 = {
				reset_state_name = yes
			}
			reset_province_name = 12189
			reset_province_name = 9604
		}
	}
	if = {
		limit = {
			state = 408
		}
		if = {
			limit = {
				ROOT = {
					is_russian_nation = yes
				}
			}
			408 = {
				set_state_name = STATE_408_rus
			}
			set_province_name = {
				id = 11750
				name = VICTORY_POINTS_11750_rus
			}
			set_province_name = {
				id = 3977
				name = VICTORY_POINTS_3977_rus
			}
			set_province_name = {
				id = 6961
				name = VICTORY_POINTS_6961_rus
			}
		}
		else_if = {
			limit = {
				ROOT = {
					is_in_faction_with = JAP
				}
			}
			408 = {
				reset_state_name = yes
			}
			reset_province_name = 11750
			reset_province_name = 3977
			reset_province_name = 6961
		}
	}
	if = {
		limit = {
			state = 809
		}
		if = {
			limit = {
				ROOT = {
					is_russian_nation = yes
				}
			}
			809 = {
				set_state_name = STATE_809_rus
			}
			set_province_name = {
				id = 957
				name = VICTORY_POINTS_957_rus
			}
		}
		else_if = {
			limit = {
				ROOT = {
					is_in_faction_with = JAP
				}
			}
			809 = {
				reset_state_name = yes
			}
			reset_province_name = 957
		}
		else_if = {
			limit = {
				ROOT = {
					OR = {
						AND = {
							is_in_faction_with = CHI
							CHI = {
								NOT = { is_in_faction_with = JAP }
							}
						}
						AND = {
							tag = YUN
							OR = {
								has_cosmetic_tag = YUN_NPA_Long_Yun
								has_cosmetic_tag = YUN_NPA_China
							}
						}
					}
				}
			}
			809 = {
				set_state_name = STATE_809_chi
			}
			set_province_name = {
				id = 957
				name = VICTORY_POINTS_957_chi
			}
		}
	}
}


	### Fuck Finland ###


VP_change_fin = {
	if = {
		limit = {
			state = 213
		}
		if = {
			limit = {
				ROOT = {
					is_russian_nation = yes
				}
			}
			213 = {
				set_state_name = STATE_213_rus
			}
			set_province_name = {
				id = 11117
				name = VICTORY_POINTS_11117_rus
			}
			set_province_name = {
				id = 9115
				name = VICTORY_POINTS_9115_rus
			}
			set_province_name = {
				id = 6181
				name = VICTORY_POINTS_6181_rus
			}
		}
		else = {
			213 = {
				reset_state_name = yes
			}
			reset_province_name = 6181
		}
	}
	if = {
		limit = {
			state = 1359
		}
		if = {
			limit = {
				ROOT = {
					is_russian_nation = yes
				}
			}
			1359 = {
				set_state_name = STATE_1359_rus
			}
			set_province_name = {
				id = 3134
				name = VICTORY_POINTS_3134_rus
			}
		}
		else = {
			1359 = {
				reset_state_name = yes
			}
			reset_province_name = 3134
		}
	}
	if = {
		limit = {
			state = 215
		}
		if = {
			limit = {
				ROOT = {
					is_russian_nation = yes
				}
			}
			215 = {
				set_state_name = STATE_215_rus
			}
			set_province_name = {
				id = 94
				name = VICTORY_POINTS_94_rus
			}
		}
		else = {
			215 = {
				reset_state_name = yes
			}
			reset_province_name = 94
		}
	}
	if = {
		limit = {
			state = 216
		}
		if = {
			limit = {
				ROOT = {
					is_russian_nation = yes
				}
			}
			216 = {
				set_state_name = STATE_216_rus
			}
			set_province_name = {
				id = 11159
				name = VICTORY_POINTS_11159_rus
			}
		}
		else = {
			216 = {
				reset_state_name = yes
			}
			reset_province_name = 11159
		}
	}
}


#Deferred payment proposal, or how to help the poorest warrior finance a military.
#Step 1: use RUS_expand_promisory_notes_system, reducing drastically the cost of keeping the military, at the price of inflation.
#Step 2: run monthly RUS_monthly_deferred_payments_calculation to store how much money was saved overall
#Step 3: when your warlord is big enough, make him pay and clear the mechanic by using RUS_solve_deferred_military_payments. You pay in one installement, no credit facility.
#I hate poor warlords.


RUS_monthly_deferred_payments_calculation = {
	set_variable = { monthly_deferred_payments = manpower_costs }
	divide_variable = { monthly_deferred_payments = 12 }
	set_temp_variable = { reduced_expenditure_multiplier = modifier@Military_expenditures_factor }
	add_to_temp_variable = { reduced_expenditure_multiplier = 0.2 }
	multiply_temp_variable = { reduced_expenditure_multiplier = modifier@personnel_cost_modifier }
	#-1*-1 = 1. Don't forget that if you remove/add a modifier
	clamp_temp_variable = {
		var = reduced_expenditure_multiplier
		min = 0.01
		max = 1
	}
	divide_variable = { monthly_deferred_payments = reduced_expenditure_multiplier }
	add_to_variable = { deferred_military_cost = monthly_deferred_payments }
	set_temp_variable = { monthly_inflation = base_inflation_rate }
	divide_temp_variable = { monthly_inflation = 12 }
	divide_temp_variable = { monthly_inflation = 100 }
	add_to_temp_variable = { monthly_inflation = 1 }
	multiply_variable = { deferred_military_cost = monthly_inflation }
	log = "[GetDateText]: [Root.GetName]: [?monthly_deferred_payments] monthly deferred military cost"
	set_variable = { deferred_military_cost_million = 1000 }
	multiply_variable = { deferred_military_cost_million = deferred_military_cost }
	if = {
		limit = {
			has_idea = RUS_promisory_notes_system
		}
		multiply_temp_variable = { deferred_military_cost_million = 1.2 }
	}
	else_if = {
		limit = {
			has_idea = RUS_expanded_promisory_notes_system
		}
		multiply_variable = { deferred_military_cost_million = 1.4 }
	}
}

RUS_solve_deferred_military_payments = {
	set_temp_variable = { temp_econ_spending_amount = deferred_military_cost }
	if = {
		limit = {
			has_idea = RUS_promisory_notes_system
		}
		multiply_temp_variable = { temp_econ_spending_amount = 1.2 }
	}
	else_if = {
		limit = {
			has_idea = RUS_expanded_promisory_notes_system
		}
		multiply_temp_variable = { temp_econ_spending_amount = 1.4 }
	}
	log = "[GetDateText]: [Root.GetName]: [?temp_econ_spending_amount] promisory notes system total cost"
	econ_spend_money_once_effect_raw_money = yes
	clr_country_flag = deferred_military_payments
	remove_ideas = {
		RUS_expanded_promisory_notes_system
		RUS_promisory_notes_system
	}
	if = {
		limit = { check_variable = { promisory_notes_inflation > 0 } }
		set_temp_variable = { inflation_temp = promisory_notes_inflation }
		Econ_inflation_change = yes
	}
}

RUS_expand_promisory_notes_system = {
	if = {
		limit = { has_idea = RUS_promisory_notes_system }
		swap_ideas = {
			remove_idea = RUS_promisory_notes_system
			add_idea = RUS_expanded_promisory_notes_system
		}
		activate_mission = RUS_Worsening_moral_2
	}
	else_if = {
		limit = { has_idea = RUS_expanded_promisory_notes_system }
		set_temp_variable = { inflation_temp = 2 }
		activate_mission = RUS_Worsening_moral_2
		add_to_variable = { promisory_notes_inflation = -1 }
		Econ_inflation_change = yes
	}
	else_if = {
		limit = { has_idea = RUS_savy_army }
		swap_ideas = {
			add_idea = RUS_promisory_notes_system
			remove_idea = RUS_savy_army
		}
		set_country_flag = deferred_military_payments
		activate_mission = RUS_Worsening_moral
		activate_mission = RUS_monthly_payment
	}
	else = {
		add_ideas = RUS_savy_army
	}
}

################################################
##==========| Re-Unification Stuff |==========##
################################################

RUS_select_regional_news_event = {
	if = {
		limit = {
			original_tag = GAY
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.2
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = VYT
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.16
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_government = socialist
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.8
					}
				}
			}
		}
		if = {
			limit = {
				has_government = communist
			}
			hidden_effect = {
				if = {
					limit = {
						has_country_leader = {
							character = KOM_Mikhail_Suslov
							ruling_only = yes
						}
					}
					every_country = {
						limit = { is_ai = no }
						news_event = {
							id = RUS_news.7
						}
					}
				}
				if = {
					limit = {
						has_country_leader = {
							character = KOM_Svetlana_Bukharina
							ruling_only = yes
						}
					}
					every_country = {
						limit = { is_ai = no }
						news_event = {
							id = RUS_news.6
						}
					}
				}
			}
		}
		if = {
			limit = {
				OR = {
					has_government = liberalism
					has_government = liberal_conservatism
					has_government = progressivism
				}
			}
			hidden_effect = {
				if = {
					limit = {
						has_government = progressivism
					}
					every_country = {
						limit = { is_ai = no }
						news_event = {
							id = RUS_news.5
						}
					}
				}
				if = {
					limit = {
						OR = {
							has_government = liberalism
							has_government = liberal_conservatism
						}
					}
					every_country = {
						limit = { is_ai = no }
						news_event = {
							id = RUS_news.3
						}
					}
				}
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Igor_Shafarevich
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.9
					}
				}
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Ivan_Serov
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.11
					}
				}
			}
		}
		if = {
			limit = {
				has_government = despotism
				has_country_leader = {
					character = KOM_Svetlana_Stalina
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.4
					}
				}
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Sergey_Taboritsky
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.12
					}
				}
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Lev_Gumilyov
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.10
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = PRM
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.1
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = SAM
		}
		hidden_effect = {
			if = {
				limit = {
					has_government = paternalism
				}
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.15
					}
				}
			}
			if = {
				limit = {
					has_government = despotism
				}
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.13
					}
				}
			}
			if = {
				limit = {
					has_government = national_socialism
				}
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.14
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = WRS
		}
		hidden_effect = {
			if = {
				limit = {
					has_country_leader = {
						character = WRS_Mikhail_Tukhachevsky
						ruling_only = yes
					}
				}
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.18
					}
				}
			}
			else_if = {
				limit = {
					has_country_leader = {
						character = WRS_Georgy_Zhukov
						ruling_only = yes
					}
				}
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.19
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = TYM
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.22
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = OMS
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.23
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = SVR
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.21
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = TOM
		}
		hidden_effect = {
			if = {
				limit = {
					has_government = progressivism
				}
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.32
					}
				}
			}
			else_if = {
				limit = {
					has_government = liberalism
				}
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.30
					}
				}
			}
			else_if = {
				limit = {
					has_government = conservatism
				}
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.33
					}
				}
			}
			else_if = {
				limit = {
					has_government = paternalism
				}
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.31
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = KEM
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.29
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = SBA
		}
		hidden_effect = {
			if = {
				limit = {
					has_government = socialist
				}
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.25
					}
				}
			}
			else_if = {
				limit = {
					has_government = despotism
				}
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.26
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = NOV
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.28
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = PRC
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.27
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = AMR
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.34
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = BRY
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.36
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = IRK
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.35
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = MAG
			NOT = {
				has_country_flag = MAG_merc
			}
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.38
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = MAG
			has_country_flag = MAG_merc
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.39
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = OMO
			NOT = { has_country_leader = { character = OMO_2022_Nikolai_Buckharin ruling_only = yes } }
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.40
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = OMO
			has_country_leader = { character = OMO_2022_Nikolai_Buckharin ruling_only = yes }
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = OMO_aprilfools_news.2
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = CHT
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.37
				}
			}
		}
	}
}

RUS_select_regional_cosmetic_tag = {
	hidden_effect = {
		drop_cosmetic_tag = yes
	}
	if = {
		limit = {
			original_tag = GAY
		}
		set_cosmetic_tag = GAY_regional_unifier
	}
	if = {
		limit = {
			original_tag = YGR
		}
		set_cosmetic_tag = YGR_regional_unifier
	}
	if = {
		limit = {
			original_tag = VYT
		}
		set_cosmetic_tag = VYT_regional_unifier
	}
	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_government = communist
				has_country_leader = {
					character = KOM_Svetlana_Bukharina
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_REGIONAL_BUKHARINA
		}
		if = {
			limit = {
				has_government = communist
				OR = {
					has_country_leader = {
						character = KOM_Mikhail_Suslov
						ruling_only = yes
					}
					has_country_leader = {
						character = KOM_KPK_Presidium
						ruling_only = yes
					}
				}
			}
			set_cosmetic_tag = KOM_REGIONAL_SUSLOV
		}
		if = {
			limit = {
				has_government = socialist
				has_country_leader = {
					character = KOM_Andrei_Zhdanov
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_REGIONAL_ZHDANOV
		}
		if = {
			limit = {
				OR = {
					has_government = progressivism
					has_government = liberalism
					has_government = liberal_conservatism
				}
			}
			set_cosmetic_tag = KOM_REGIONAL_REPUBLIC
		}
		if = {
			limit = {
				has_government = despotism
				has_country_leader = {
					character = KOM_Svetlana_Stalina
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_REGIONAL_STALINA
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Ivan_Serov
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_REGIONAL_SEROV
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Igor_Shafarevich
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_REGIONAL_SHAFAREVICH
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Lev_Gumilyov
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_REGIONAL_GUMILYOV
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Sergey_Taboritsky
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_REGIONAL_TABORITSKY
		}
	}
	if = {
		limit = {
			original_tag = PRM
		}
		set_cosmetic_tag = PRM_regional_unifier
	}
	if = {
		limit = {
			original_tag = SAM
		}
		set_cosmetic_tag = SAM_regional_unifier
	}
	if = {
		limit = {
			original_tag = VOL
		}
		set_cosmetic_tag = VOL_regional_unifier
	}
	if = {
		limit = {
			original_tag = WRS
		}
		set_cosmetic_tag = WRS_regional_unifier
	}
	if = {
		limit = {
			original_tag = TYM
		}
		set_cosmetic_tag = TYM_regional_unifier
	}
	if = {
		limit = {
			original_tag = OMS
		}
		set_cosmetic_tag = OMS_regional_unifier
	}
	if = {
		limit = {
			original_tag = SVR
		}
		set_cosmetic_tag = SVR_regional_unifier
	}
	if = {
		limit = {
			original_tag = TOM
		}
		if = {
			limit = {
				has_government = progressivism
			}
			set_cosmetic_tag = TOM_HUM_regional_unifier
		}
		else_if = {
			limit = {
				has_government = liberalism
			}
			set_cosmetic_tag = TOM_MOD_regional_unifier
		}
		else_if = {
			limit = {
				has_government = paternalism
			}
			set_cosmetic_tag = TOM_BAS_regional_unifier
		}
		else = {
			set_cosmetic_tag = TOM_regional_unifier
		}
	}
	if = {
		limit = {
			original_tag = KEM
		}
		set_cosmetic_tag = KEM_regional_unifier
	}
	if = {
		limit = {
			original_tag = SBA
		}
		set_cosmetic_tag = SBA_regional_unifier
	}
	if = {
		limit = {
			original_tag = NOV
		}
		set_cosmetic_tag = NOV_regional_unifier
	}
	if = {
		limit = {
			original_tag = KRS
		}
		set_cosmetic_tag = KRS_regional_unifier
	}
	if = {
		limit = {
			original_tag = PRC
		}
		set_cosmetic_tag = PRC_regional_unifier
	}
	if = {
		limit = {
			original_tag = AMR
		}
		set_cosmetic_tag = AMR_regional_unifier
	}
	if = {
		limit = {
			original_tag = BRY
		}
		set_cosmetic_tag = BRY_regional_unifier
	}
	if = {
		limit = {
			original_tag = IRK
		}
		set_cosmetic_tag = IRK_regional_unifier
	}
	if = {
		limit = {
			original_tag = MAG
		}
		if = {
			limit = {
				has_country_flag = MAG_merc
			}
			set_cosmetic_tag = MAG_WA_regional_unifier
		}
		else = {
			set_cosmetic_tag = MAG_regional_unifier
		}
	}
	if = {
		limit = {
			original_tag = OMO
		}
		if = {
			limit = {
				has_country_leader = { character = OMO_2022_Nikolai_Buckharin ruling_only = yes }
			}
			set_cosmetic_tag = OMO_Harmonious_State_SIB
		}
		else = {
			set_cosmetic_tag = OMO_regional_unifier
		}
	}
	if = {
		limit = {
			original_tag = CHT
		}
		set_cosmetic_tag = CHT_regional_unifier
	}
}

RUS_select_superregional_news_event = { ###Apparently there are no superregional news events. Huh.

}

RUS_select_superregional_cosmetic_tag = {
	hidden_effect = {
		drop_cosmetic_tag = yes
	}
	if = {
		limit = {
			original_tag = WRS
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Mikhail_Tukhachevsky
					ruling_only = yes
				}
			}
			set_cosmetic_tag = WRS_RUS_tukha
		}
		else_if = {
			limit = {
				has_country_leader = {
					character = WRS_Georgy_Zhukov
					ruling_only = yes
				}
			}
			set_cosmetic_tag = WRS_RUS
		}
		else = {
			set_cosmetic_tag = WRS_RUS
		}
	}
	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_government = communist
				has_country_leader = {
					character = KOM_Svetlana_Bukharina
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_BUKHARINA
		}
		if = {
			limit = {
				has_government = communist
				has_country_leader = {
					character = KOM_Mikhail_Suslov
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_SUSLOV
		}
		if = {
			limit = {
				has_government = socialist
				has_country_leader = {
					character = KOM_Andrei_Zhdanov
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_ZHDANOV
		}
		if = {
			limit = {
				OR = {
					has_government = progressivism
					has_government = liberalism
					has_government = liberal_conservatism
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_REPUBLIC
		}
		if = {
			limit = {
				has_government = despotism
				has_country_leader = {
					character = KOM_Svetlana_Stalina
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_STALINA
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Ivan_Serov
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_SEROV
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Igor_Shafarevich
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_SHAFAREVICH
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Lev_Gumilyov
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_GUMILYOV
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Sergey_Taboritsky
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_TABORITSKY
		}
	}
	if = {
		limit = {
			original_tag = VYT
		}
		set_cosmetic_tag = VYT_RUS
	}

	if = {
		limit = {
			original_tag = PRM
		}
		if = {
			limit = { 
				has_country_leader = {
					character = PRM_Gutrum_Vagner
					ruling_only = yes
				}
			}
			set_cosmetic_tag = PRM_RUS
		}
		else_if = {
			limit = { 
				has_country_leader = {
					character = PRM_Velimir
					ruling_only = yes
				}
			}
			set_cosmetic_tag = PRM_hyperborea_RUS
		}
		else = {
			set_cosmetic_tag = PRM_RUS
		}
	}
	if = {
		limit = {
			original_tag = GAY
		}
		set_cosmetic_tag = GAY_RUS
	}
	if = {
		limit = {
			original_tag = SAM
		}
		set_cosmetic_tag = SAM_RUS
	}
	if = {
		limit = {
			original_tag = SVR
		}
		if = {
			limit = {
				has_government = paternalism
			}
			set_cosmetic_tag = SVR_RUS
		}
		if = {
			limit = {
				has_government = conservatism
			}
			set_cosmetic_tag = SVR_RUS_YELTSIN
		}
	}
	if = {
		limit = {
			original_tag = TYM
		}
		set_cosmetic_tag = TYM_RUS
	}
	if = {
		limit = {
			original_tag = OMS
		}
		set_cosmetic_tag = OMS_POTEMKIN_RUS
	}
	if = {
		limit = {
			original_tag = TOM
		}
		if = {
			limit = {
				has_government = progressivism
			}
			set_cosmetic_tag = TOM_HUM_SIB
		}
		if = {
			limit = {
				has_government = liberalism
			}
			set_cosmetic_tag = TOM_MOD_SIB
		}
		if = {
			limit = {
				has_government = conservatism
			}
			set_cosmetic_tag = TOM_SIB
		}
		if = {
			limit = {
				has_government = paternalism
			}
			set_cosmetic_tag = TOM_BAS_SIB
		}
	}
	if = {
		limit = {
			original_tag = NOV
		}
		set_cosmetic_tag = NOV_SIB
	}
	if = {
		limit = {
			original_tag = KEM
		}
		set_cosmetic_tag = KEM_SIB
	}
	if = {
		limit = {
			original_tag = PRC
		}
		set_cosmetic_tag = PRC_SIB
	}
	if = {
		limit = {
			original_tag = SBA
		}
		set_cosmetic_tag = SBA_SIB
	}
	if = {
		limit = {
			original_tag = IRK
		}
		set_cosmetic_tag = IRK_SIB
	}
	if = {
		limit = {
			original_tag = BRY
		}
		set_cosmetic_tag = BRY_SIB
	}
	if = {
		limit = {
			original_tag = CHT
		}
		set_cosmetic_tag = CHT_SIB
	}
	if = {
		limit = {
			original_tag = AMR
		}
		set_cosmetic_tag = AMR_SIB
	}
	if = {
		limit = {
			original_tag = MAG
		}
		if = {
			limit = {
				NOT = {
					has_country_leader = {
						character = MAG_Mitchell_Werbell
						ruling_only = yes
					}
				}
			}
			set_cosmetic_tag = MAG_SIB
		}
		if = {
			limit = {
				has_country_leader = {
					character = MAG_Mitchell_Werbell
					ruling_only = yes
				}
			}
			set_cosmetic_tag = MAG_WA_SIB
		}
	}
	if = {
		limit = {
			original_tag = OMO
			OMO_2022_aprilfools_gamerule_active = no
		}
		set_cosmetic_tag = OMO_SIB
	}
	if = {
		limit = {
			original_tag = OMO
			OMO_2022_aprilfools_gamerule_active = yes
		}
		set_cosmetic_tag = OMO_Harmonious_State_SIB # Same as Regional
	}
}

RUS_select_superregional_focus_tree = {
	if = {
		limit = {
			original_tag = WRS
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Mikhail_Tukhachevsky
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = WRS_tukhachevsky_superregional
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Georgy_Zhukov
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = WRS_zhukov_superregional
			}
		}
	}
	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Svetlana_Bukharina
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = KOM_bukharina_superregional
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Mikhail_Suslov
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = KOM_superregional_suslov
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Andrei_Zhdanov
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = KOM_superregional_zhdanov
			}
		}
		if = {
			limit = {
				OR = {
					has_government = progressivism
					has_government = liberalism
					has_government = liberal_conservatism
				}
			}
			hidden_effect = {
				load_focus_tree = KOM_third_election_tree
			}
		}
		if = {
			limit = {
				has_government = despotism
				has_country_leader = {
					character = KOM_Svetlana_Stalina
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = KOM_superregional_despotist_stalina
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Ivan_Serov
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = KOM_superregional_serov
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Igor_Shafarevich
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = KOM_shafarevich_superregional
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Lev_Gumilyov
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = KOM_gumilyov_superregional
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Sergey_Taboritsky
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = KOM_taboritsky_superregional
			}
		}
	}
	if = {
		limit = {
			original_tag = VYT
		}
		if = {
			limit = {
				has_government = liberalism
			}
			hidden_effect = {
				load_focus_tree = { tree = VYT_superregional_kadet_tree keep_completed = no }
			}
		}
		if = {
			limit = {
				has_government = conservatism
			}
			hidden_effect = {
				load_focus_tree = { tree = VYT_superregional_shulgin_tree keep_completed = no }
			}
		}
		if = {
			limit = {
				has_government = paternalism
			}
			hidden_effect = {
				load_focus_tree = { tree = VYT_superregional_solidarist_tree keep_completed = no }
			}
		}
	}
	if = {
		limit = {
			original_tag = PRM
		}
		if = {
			limit = { 
				has_country_leader = {
					character = PRM_Gutrum_Vagner
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = { tree = PRM_vagner_superregional keep_completed = no }
			}
		}
		if = {
			limit = { 
				has_country_leader = {
					character = PRM_Velimir
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = { tree = PRM_yemelyanov_superregional keep_completed = no }
			}
		}
	}
	if = {
		limit = {
			original_tag = SAM
		}
		if = {
			limit = {
				has_government = paternalism
			}
			hidden_effect = {
				load_focus_tree = SAM_Superegional_Tree_Zykov
			}
		}
		if = {
			limit = {
				has_government = despotism
			}
			hidden_effect = {
				load_focus_tree = SAM_Superegional_Tree_Bunyachenko
			}
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			hidden_effect = {
				load_focus_tree = SAM_Superegional_Tree_Oktan
			}
		}
	}
	if = {
		limit = {
			original_tag = SVR
		}
		if = {
			limit = {
				has_government = paternalism
			}
			hidden_effect = {
				load_focus_tree = SVR_superregional_tree_batov
			}
		}
		if = {
			limit = {
				has_government = conservatism
			}
			hidden_effect = {
				load_focus_tree = SVR_superregional_tree_yeltsin
			}
		}
	}
	if = {
		limit = {
			original_tag = TYM
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Lazar_Kaganovich
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = TYM_superregional_kaganovich
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Nikita_Khrushchev
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = TYM_superregional_khrushchev
			}
		}
	}
	if = {
		limit = {
			original_tag = OMS
		}
		hidden_effect = {
			load_focus_tree = OMS_superregional_tree
		}
	}
	if = {
		limit = {
			original_tag = TOM
		}
		if = {
			limit = {
				has_government = progressivism
			}
			hidden_effect = {
				load_focus_tree = { tree = TOM_humanist_tree_superregional keep_completed = no }
			}
		}
		if = {
			limit = {
				has_government = liberalism
			}
			hidden_effect = {
				load_focus_tree = { tree = TOM_modernist_tree_superregional keep_completed = no }
			}
		}
		if = {
			limit = {
				has_government = conservatism
			}
			hidden_effect = {
				load_focus_tree = { tree = TOM_decembrist_tree_superregional keep_completed = no }
			}
		}
		if = {
			limit = {
				has_government = paternalism
			}
			hidden_effect = {
				load_focus_tree = { tree = TOM_bastillard_tree_superregional keep_completed = no }
			}
		}
	}
	if = {
		limit = {
			original_tag = NOV
		}
		hidden_effect = {
			load_focus_tree = { tree = NOV_novosibirsk_superregional keep_completed = no }
		}
	}
	if = {
		limit = {
			original_tag = KEM
		}
		if = {
			limit = {
				has_government = paternalism
			}
			hidden_effect = {
				load_focus_tree = { tree = KEM_superregional_yuriy keep_completed = no }
			}
		}
		if = {
			limit = {
				has_government = despotism
			}
			hidden_effect = {
				load_focus_tree = { tree = KEM_superregional_lydia keep_completed = no }
			}
		}
	}
	if = {
		limit = {
			original_tag = IRK
		}
		if = {
			limit = {
				OR = {
					has_country_flag = IRK_party_influence_locked_in
					has_country_leader = { character = IRK_Sergey_Bessonov ruling_only = yes }
					check_variable = { IRK_party_balance > IRK_state_balance }
				}
			}
			hidden_effect = {
				load_focus_tree = IRK_party_superregional
			}
		}
		else = {
			hidden_effect = {
				load_focus_tree = IRK_state_superregional
			}
		}
	}
	if = {
		limit = {
			original_tag = BRY
		}
		if = {
			limit = {
				has_country_flag = BRY_sablin_leninist
			}
			hidden_effect = {
				load_focus_tree = TNO_buryatia_superregional_libsoc
			}
		}
		if = {
			limit = {
				has_country_flag = BRY_sablin_bukharinist
			}
			hidden_effect = {
				load_focus_tree = TNO_buryatia_superregional_authsoc
			}
		}
	}
	if = {
		limit = {
			original_tag = CHT
		}
		if = {
			limit = {
				has_country_flag = CHT_mikhail_victorious
			}
			hidden_effect = {
				load_focus_tree = CHT_chita_imperial_superregional
			}
		}
		if = {
			limit = {
				has_country_flag = CHT_shepunov_victorious
			}
			hidden_effect = {
				load_focus_tree = CHT_chita_stratocracy_superregional
			}
		}
	}
	if = {
		limit = {
			original_tag = AMR
		}
		hidden_effect = {
			load_focus_tree = { tree = AMR_superregional keep_completed = no }
		}
	}
	if = {
		limit = {
			original_tag = MAG
		}
		if = {
			limit = {
				has_government = paternalism
				NOT = {
					has_country_leader = {
						character = MAG_Mitchell_Werbell
						ruling_only = yes
					}
				}
			}
			hidden_effect = {
				load_focus_tree = { tree = MAG_superregional_petlin_tree keep_completed = no }
			}
		}
		if = {
			limit = {
				has_government = despotism
			}
			hidden_effect = {
				load_focus_tree = { tree = MAG_superregional_matkovsky_tree keep_completed = no }
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = MAG_Mitchell_Werbell
					ruling_only = yes
				}
			}
			hidden_effect = {
				load_focus_tree = { tree = MAG_superregional_west_alaska_tree keep_completed = no }
			}
		}
	}
	if = {
		limit = {
			original_tag = OMO
			OMO_2022_aprilfools_gamerule_active = no
		}
		hidden_effect = {
			load_focus_tree = OMO_father_superregional
		}
	}
	if = {
		limit = {
			original_tag = OMO
			OMO_2022_aprilfools_gamerule_active = yes
		}
		hidden_effect = {
			clr_country_flag = OMO_2022_regional_phase_2
			load_focus_tree = OMO_april_fools_superregional
		}
	}
}

RUS_select_final_news_event = {
	if = {
		limit = {
			original_tag = WRS
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Georgy_Zhukov
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.46
					}
				}
			}
		}
		else_if = {
			limit = {
				has_country_leader = {
					character = WRS_Mikhail_Tukhachevsky
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.48
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Andrei_Zhdanov
					ruling_only = yes
				}
			}
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.63
				}
			}
		}
		if = {
			limit = {
				has_government = communist
			}
			hidden_effect = {
				if = {
					limit = {
						has_country_leader = {
							character = KOM_Mikhail_Suslov
							ruling_only = yes
						}
					}
					every_country = {
						limit = { is_ai = no }
						news_event = {
							id = RUS_news.61
						}
					}
				}
				else_if = {
					limit = {
						has_country_leader = {
							character = KOM_Svetlana_Bukharina
							ruling_only = yes
						}
					}
					hidden_effect = {
						every_country = {
						limit = { is_ai = no }
							news_event = {
								id = RUS_news.62
							}
						}
					}
				}
			}
		}
		if = {
			limit = {
				has_government = liberalism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.57
					}
				}
			}
		}
		if = {
			limit = {
				has_government = liberal_conservatism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.58
					}
				}
			}
		}
		if = {
			limit = {
				has_government = progressivism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.60
					}
				}
			}
		}
		if = {
			limit = {
				has_government = despotism
				has_country_leader = {
					character = KOM_Svetlana_Stalina
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.59
					}
				}
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Igor_Shafarevich
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.65
					}
				}
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Ivan_Serov
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.66
					}
				}
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Lev_Gumilyov
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.64
					}
				}
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Sergey_Taboritsky
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.67
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = VYT
		}
		if = {
			limit = {
				has_government = liberalism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.52
					}
				}
			}
		}
		if = {
			limit = {
				has_government = paternalism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.54
					}
				}
			}
		}
		if = {
			limit = {
				has_government = conservatism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.53
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = PRM
			NOT = { has_cosmetic_tag = PRM_hyperborea_RUS }
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.55
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = PRM
			has_cosmetic_tag = PRM_hyperborea_RUS
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.56
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = SAM
		}
		if = {
			limit = {
				has_government = paternalism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.49
					}
				}
			}
		}
		if = {
			limit = {
				has_government = despotism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.50
					}
				}
			}
		}
		if = {
			limit = {
				has_government = national_socialism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.51
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = SVR
		}
		if = {
			limit = {
				has_government = paternalism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.70
					}
				}
			}
		}
		if = {
			limit = {
				has_government = conservatism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.69
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = TYM
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Lazar_Kaganovich
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.68
					}
				}
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = TYM_Nikita_Khrushchev
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.72
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = OMS
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.71
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = TOM
		}
		if = {
			limit = {
				has_government = progressivism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.75
					}
				}
			}
		}
		if = {
			limit = {
				has_government = paternalism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.76
					}
				}
			}
		}
		if = {
			limit = {
				has_government = liberalism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.77
					}
				}
			}
		}
		if = {
			limit = {
				has_government = conservatism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.78
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = NOV
		}
		if = {
			limit = {
				has_government = paternalism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.90
					}
				}
			}
		}
		else_if = {
			limit = {
				has_government = conservatism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.91
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = KEM
		}
		if = {
			limit = {
				has_government = paternalism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.73
					}
				}
			}
		}
		if = {
			limit = {
				has_government = despotism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.74
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = PRC
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.93
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = SBA
		}
		if = {
			limit = {
				has_government = socialist
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.80
					}
				}
			}
		}
		if = {
			limit = {
				has_government = despotism
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.79
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = IRK
		}
		if = {
			limit = {
				OR = {
					has_country_flag = IRK_party_influence_locked_in
					has_country_leader = { character = IRK_Sergey_Bessonov ruling_only = yes }
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.81
					}
				}
			}
		}
		else = {
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.82
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = BRY
		}
		if = {
			limit = {
				has_country_flag = BRY_sablin_leninist
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.83
					}
				}
			}
		}
		if = {
			limit = {
				has_country_flag = BRY_sablin_bukharinist
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.84
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = CHT
		}
		if = {
			limit = {
				has_country_flag = CHT_mikhail_victorious
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.87
					}
				}
			}
		}
		if = {
			limit = {
				has_country_flag = CHT_shepunov_victorious
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.47
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = AMR
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.88
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = MAG
		}
		if = {
			limit = {
				OR = {
					has_government = despotism
					has_government = fascism
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.85
					}
				}
			}
		}
		if = {
			limit = {
				has_government = paternalism
				NOT = {
					has_country_leader = {
						character = MAG_Mitchell_Werbell
						ruling_only = yes
					}
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.86
					}
				}
			}
		}
		if = {
			limit = {
				has_country_leader = {
					character = MAG_Mitchell_Werbell
					ruling_only = yes
				}
			}
			hidden_effect = {
				every_country = {
					limit = { is_ai = no }
					news_event = {
						id = RUS_news.92
					}
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = OMO
			OMO_2022_aprilfools_gamerule_active = no
		}
		hidden_effect = {
			every_country = {
				limit = { is_ai = no }
				news_event = {
					id = RUS_news.89
				}
			}
		}
	}
}

RUS_select_final_cosmetic_tag = {
	hidden_effect = {
		drop_cosmetic_tag = yes
	}
	if = {
		limit = {
			original_tag = WRS
		}
		if = {
			limit = {
				has_country_leader = {
					character = WRS_Georgy_Zhukov
					ruling_only = yes
				}
			}
			set_cosmetic_tag = WRS_USSR_zhukov
		}
		else_if = {
			limit = {
				has_country_leader = {
					character = WRS_Mikhail_Tukhachevsky
					ruling_only = yes
				}
			}
			set_cosmetic_tag = WRS_USSR_tukha
		}
	}
	if = {
		limit = {
			original_tag = KOM
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Andrei_Zhdanov
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_ZHDANOV
		}
		if = {
			limit = {
				has_government = communist
			}
			hidden_effect = {
				if = {
					limit = {
						has_country_leader = {
							character = KOM_Mikhail_Suslov
							ruling_only = yes
						}
					}
					set_cosmetic_tag = KOM_RUSSIA_SUSLOV
				}
				else_if = {
					limit = {
						has_country_leader = {
							character = KOM_Svetlana_Bukharina
							ruling_only = yes
						}
					}
					set_cosmetic_tag = KOM_RUSSIA_BUKHARINA
				}
			}
		}
		if = {
			limit = {
				OR = {
					has_government = progressivism
					has_government = liberalism
					has_government = conservatism
					has_government = liberal_conservatism
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_REPUBLIC
		}
		if = {
			limit = {
				has_government = despotism
				has_country_leader = {
					character = KOM_Svetlana_Stalina
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_STALINA
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Ivan_Serov
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_SEROV
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Igor_Shafarevich
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_SHAFAREVICH
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Lev_Gumilyov
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_GUMILYOV
		}
		if = {
			limit = {
				has_country_leader = {
					character = KOM_Sergey_Taboritsky
					ruling_only = yes
				}
			}
			set_cosmetic_tag = KOM_RUSSIA_TABORITSKY
		}
	}
	if = {
		limit = {
			original_tag = VYT
		}
		set_cosmetic_tag = VYT_RUS
	}
	if = {
		limit = {
			original_tag = PRM
		}
		if = {
			limit = {
				has_country_leader = {
					character = PRM_Gutrum_Vagner
					ruling_only = yes
				}
			}
			set_cosmetic_tag = PRM_RUS
		}
		else_if = {
			limit = { 
				has_country_leader = {
					character = PRM_Velimir
					ruling_only = yes
				}
			}
			set_cosmetic_tag = PRM_hyperborea_RUS
		}
		else = {
			set_cosmetic_tag = PRM_RUS
		}
	}
	if = {
		limit = {
			original_tag = GAY
		}
		set_cosmetic_tag = GAY_RUS
	}
	if = {
		limit = {
			original_tag = SAM
		}
		set_cosmetic_tag = SAM_RUS
	}
	if = {
		limit = {
			original_tag = SVR
		}
		if = {
			limit = {
				has_government = paternalism
			}
			set_cosmetic_tag = SVR_RUS
		}
		if = {
			limit = {
				has_government = conservatism
			}
			set_cosmetic_tag = SVR_RUS_YELTSIN
		}
	}
	if = {
		limit = {
			original_tag = TYM
		}
		set_cosmetic_tag = TYM_RUS
	}
	if = {
		limit = {
			original_tag = OMS
		}
		set_cosmetic_tag = OMS_POTEMKIN_RUS
	}
	if = {
		limit = {
			original_tag = TOM
		}
		if = {
			limit = {
				has_government = progressivism
			}
			set_cosmetic_tag = TOM_RUS_HUMANIST
		}
		if = {
			limit = {
				has_government = paternalism
			}
			set_cosmetic_tag = TOM_RUS_BASTILLARD
		}
		if = {
			limit = {
				has_government = liberalism
			}
			set_cosmetic_tag = TOM_RUS_MODERNIST
		}
		if = {
			limit = {
				has_government = conservatism
			}
			set_cosmetic_tag = TOM_RUS
		}
	}
	if = {
		limit = {
			original_tag = NOV
		}
		set_cosmetic_tag = NOV_RUS
	}
	if = {
		limit = {
			original_tag = KEM
		}
		set_cosmetic_tag = KEM_RUS
	}
	if = {
		limit = {
			original_tag = PRC
		}
		set_cosmetic_tag = PRC_RUS
	}
	if = {
		limit = {
			original_tag = SBA
		}
		set_cosmetic_tag = SBA_RUS
	}
	if = {
		limit = {
			original_tag = IRK
		}
		set_cosmetic_tag = IRK_RUS
	}
	if = {
		limit = {
			original_tag = BRY
		}
		set_cosmetic_tag = BRY_RUS
	}
	if = {
		limit = {
			original_tag = CHT
		}
		set_cosmetic_tag = CHT_RUS
	}
	if = {
		limit = {
			original_tag = AMR
		}
		set_cosmetic_tag = AMR_RUS
	}
	if = {
		limit = {
			original_tag = MAG
		}
		if = {
			limit = {
				NOT = {
					has_country_leader = {
						character = MAG_Mitchell_Werbell
						ruling_only = yes
					}
				}
			}
			set_cosmetic_tag = MAG_RUS
		}
		if = {
			limit = {
				has_country_leader = {
					character = MAG_Mitchell_Werbell
					ruling_only = yes
				}
			}
			set_cosmetic_tag = MAG_WA_RUS
		}
	}
	if = {
		limit = {
			original_tag = OMO
			OMO_2022_aprilfools_gamerule_active = no
		}
		set_cosmetic_tag = OMO_RUS
	}
	if = {
		limit = {
			original_tag = OMO
			OMO_2022_aprilfools_gamerule_active = yes
		}
		set_cosmetic_tag = OMO_Harmonious_State_RUS
	}
}

RUS_select_kazakh_news_event = {
	if = {
		limit = {
			original_tag = AKT
		}
		hidden_effect = {
			every_country = {
				news_event = {
					id = WORLD.1104
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = ARL
		}
		hidden_effect = {
			every_country = {
				news_event = {
					id = WORLD.1103
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = DER
		}
		hidden_effect = {
			every_country = {
				news_event = {
					id = WORLD.1106
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = NPL
		}
		every_country = {
			news_event = {
				id = WORLD.1105 hours = 2
			}
		}
	}
	if = {
		limit = {
			original_tag = KAZ
		}
		hidden_effect = {
			every_country = {
				news_event = {
					id = WORLD.1100
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = KOK
		}
		hidden_effect = {
			every_country = {
				news_event = {
					id = WORLD.1101
				}
			}
		}
	}
	if = {
		limit = {
			original_tag = PAV
		}
		hidden_effect = {
			every_country = {
				news_event = {
					id = WORLD.1102
				}
			}
		}
	}
}

RUS_select_kazakh_cosmetic_tag = {
	if = {
		limit = {
			original_tag = AKT
		}
		set_cosmetic_tag = AKT_regional_unifier
	}
	if = {
		limit = {
			original_tag = ARL
		}
		set_cosmetic_tag = ARL_regional_unifier
	}
	if = {
		limit = {
			original_tag = DER
		}
		set_cosmetic_tag = DER_regional_unifier
	}
	if = {
		limit = {
			original_tag = KAZ
		}
		set_cosmetic_tag = KAZ_regional_unifier
	}
	if = {
		limit = {
			original_tag = KOK
		}
		set_cosmetic_tag = KOK_regional_unifier
	}
	if = {
		limit = {
			original_tag = PAV
		}
		set_cosmetic_tag = PAV_regional_unifier
	}
}

RUS_FE_manpower_add_to_states = {
	if = {
		limit = {
			has_country_flag = RUS_FE_manpower_immigration_1_ongoing
		}
		if = {
			limit = {
				country_exists = AMR
			}
			574 = { add_manpower = 1000 }
		}
		if = {
			limit = {
				country_exists = CHT
			}
			562 = { add_manpower = 1250 }
			563 = { add_manpower = 1250 }
		}
		if = {
			limit = {
				country_exists = MAG
			}
			562 = { add_manpower = 1000 }
			760 = { add_manpower = 1000 }
			637 = { add_manpower = 1000 }
		}
		if = {
			limit = {
				country_exists = BRY
			}
			562 = { add_manpower = 1000 }
			564 = { add_manpower = 1000 }
		}
		if = {
			limit = {
				country_exists = IRK
			}
			562 = { add_manpower = 1000 }
			563 = { add_manpower = 1000 }
			566 = { add_manpower = 1000 }
		}
	}

	if = {
		limit = {
			has_country_flag = RUS_FE_manpower_immigration_2_ongoing
		}
		if = {
			limit = {
				country_exists = AMR
			}
			574 = { add_manpower = 1500 }
		}
		if = {
			limit = {
				country_exists = CHT
			}
			562 = { add_manpower = 2000 }
			563 = { add_manpower = 2000 }
		}
		if = {
			limit = {
				country_exists = MAG
			}
			562 = { add_manpower = 2000 }
			563 = { add_manpower = 2000 }
			574 = { add_manpower = 2000 }
		}
		if = {
			limit = {
				country_exists = BRY
			}
			562 = { add_manpower = 2000 }
			564 = { add_manpower = 2000 }
		}
		if = {
			limit = {
				country_exists = IRK
			}
			574 = { add_manpower = 2000 }
		}
	}

	if = {
		limit = {
			has_country_flag = RUS_FE_manpower_immigration_2_ongoing
		}
		if = {
			limit = {
				country_exists = AMR
			}
			561 = { add_manpower = 1000 }
			1364 = { add_manpower = 1000 }
			564 = { add_manpower = 1000 }
			566 = { add_manpower = 1000 }
			886 = { add_manpower = 1000 }
		}
		if = {
			limit = {
				country_exists = CHT
				CHT = {
					has_country_flag = CHT_shepunov_victorious
				}
			}
			564 = { add_manpower = 2000 }
			563 = { add_manpower = 2000 }
			566 = { add_manpower = 2000 }
			561 = { add_manpower = 2000 }
			1364 = { add_manpower = 2000 }
		}
		if = {
			limit = {
				country_exists = CHT
				CHT = {
					has_country_flag = CHT_mikhail_victorious
				}
			}
			574 = { add_manpower = 2000 }
			563 = { add_manpower = 2000 }
			566 = { add_manpower = 2000 }
			637 = { add_manpower = 2000 }
			562 = { add_manpower = 2000 }
		}
		if = {
			limit = {
				country_exists = MAG
			}
			562 = { add_manpower = 3000 }
			563 = { add_manpower = 3000 }
			637 = { add_manpower = 3000 }
			574 = { add_manpower = 3000 }
			566 = { add_manpower = 3000 }
		}
		if = {
			limit = {
				country_exists = BRY
			}
			562 = { add_manpower = 3000 }
			564 = { add_manpower = 3000 }
			574 = { add_manpower = 3000 }
			561 = { add_manpower = 3000 }
			637 = { add_manpower = 3000 }
		}
		if = {
			limit = {
				country_exists = IRK
			}
			574 = { add_manpower = 3000 }
		}
	}
}

RUS_reset_war_weariness = {
	if = {
		limit = {
			OR = {
				has_war = no
				any_enemy_country = {
					is_russian_nation = no
				}
			}
		}
		set_variable = { RUS_surrender_limit = 0 }
		clr_country_flag = RUS_war_start
	}
}

RUS_capitulation_effect = {
	#So the Kamchatka fleet doesn't just disappear
	if = {
		limit = {
			FROM = {
				NOT = { #these guys get the fleet through focus
					tag = AMR
					tag = BRY
					tag = MAG
				}
			}
		}
		ROOT = {
			transfer_navy = { target = FROM }
		}
	}

	# Peace deal code
	#Workers' Uprising
	if = {
		limit = {
			FROM = { tag = KAL }
			ROOT = { tag = CSB }
		}
		KAL = {
			white_peace = CSB
		}
		KAL = {
			annex_country = {
				target = CSB
				transfer_troops = no
			}
			country_event = {
				id = kostin.14
				days = 1
			}
		}
		clear_global_event_target = RUS_central_siberia_unifier
		set_global_flag = skip_default_capitulation
	}
	else_if = {
		limit = {
			FROM = { tag = CSB }
			ROOT = { tag = KAL }
		}
		CSB = {
			white_peace = KAL
		}
		CSB = {
			annex_country = {
				target = KAL
				transfer_troops = no
			}
			every_owned_state = {
				remove_core_of = KAL
			}
			remove_ideas = KAL_general_strike_1
			remove_ideas = KAL_general_strike_2
			remove_ideas = KAL_general_strike_3
			add_timed_idea = { idea = KAL_legacy_of_the_siberian_uprising days = 365 }
		}
		TOM = {
			country_event = {
				id = TOM_constitutional_crisis.1
				days = 35
			}
		}
		set_global_flag = skip_default_capitulation
	}

	else_if = {
		limit = {
			FROM = {
				has_country_flag = RUS_Smuta_Enabled
			}
			ROOT = {
				tag = AMR
				has_country_flag = RUS_Smuta_Enabled
			}
			CHT = {
				exists = yes
			}
		}
		CHT = {
			country_event = { id = CHT.16 days = 3 }
		}
	}

	###KOMI DIPLO PEACE DEALS
	else_if = {
		limit = {
			OR = {
				FROM = { original_tag = VOL }
				FROM = { original_tag = KOM }
			}
			ROOT = { original_tag = WRS }
			ROOT = {
				AND = {
					has_war_with = KOM
					has_war_with = VOL
				}
			}
		}
		VOL = {
			transfer_state = 214
			transfer_state = 860
			transfer_state = 861
		}
		KOM = {
			annex_country = {
				target = WRS
				transfer_troops = no
			}
		}
		set_global_flag = skip_default_capitulation
	}

	else_if = {
		limit = {
			OR = {
				FROM = { original_tag = WRS }
				FROM = { original_tag = KOM }
			}
			ROOT = { original_tag = GAY }
			KOM = {
				has_country_flag = WRS_ALLY
				exists = yes
				NOT = {
					has_war_with = WRS
				}
			}
		}
		KOM = {
			white_peace = GAY
			annex_country = {
				target = GAY
				transfer_troops = no
			}
		}
		set_global_flag = skip_default_capitulation
	}

	else_if = {
		limit = {
			OR = {
				FROM = { original_tag = WRS }
				FROM = { original_tag = KOM }
			}
			ROOT = { original_tag = VYT }
			KOM = {
				has_country_flag = WRS_ALLY
				exists = yes
				NOT = {
					has_war_with = WRS
				}
			}
		}
		KOM = {
			white_peace = VYT
			annex_country = {
				target = VYT
				transfer_troops = no
			}
		}
		set_global_flag = skip_default_capitulation
	}

	else_if = {
		limit = {
			OR = {
				FROM = { original_tag = WRS }
				FROM = { original_tag = KOM }
			}
			ROOT = { original_tag = VOL }
			KOM = {
				has_country_flag = WRS_ALLY
				exists = yes
				NOT = {
					has_war_with = WRS
				}
			}
		}
		WRS = {
			white_peace = VOL
			annex_country = {
				target = VOL
				transfer_troops = no
			}
		}
		set_global_flag = skip_default_capitulation
	}

	#Irkutsk defeats Buryatia
	else_if = {
		limit = {
			FROM = {
				original_tag = IRK
			}
			ROOT = { original_tag = BRY }
			NOT = { has_global_flag = AFTER_MIDNIGHT_COMMENCED }
		}
		IRK = {
			white_peace = BRY
			annex_country = {
				target = BRY
				transfer_troops = no
			}
			every_owned_state = {
				limit = { is_core_of = BRY }
				add_core_of = IRK
				remove_core_of = BRY
			}
			country_event = {
				id = IRK.6
				days = 1
			}
			IRK_Sablinite_Sympathizers = {
				set_character_name = IRK_Sablinite_Remnants
			}
			set_party_name = { 
				ideology = socialist 
				long_name = IRK_post_sablin_socialist_party_long
				name = IRK_post_sablin_socialist_party
			}
		}
		set_global_flag = skip_default_capitulation
	}
	#Buryatia defeats Irkutsk
	else_if = {
		limit = {
			FROM = {
				original_tag = BRY
			}
			ROOT = { original_tag = IRK }
			NOT = { has_global_flag = AFTER_MIDNIGHT_COMMENCED }
		}
		BRY = {
			white_peace = IRK
			annex_country = {
				target = IRK
				transfer_troops = no
			}
			every_owned_state = {
				limit = { is_core_of = IRK }
				add_core_of = BRY
				remove_core_of = IRK
			}
			country_event = {
				id = BRY.7
				days = 1
			}
		}
		set_global_flag = skip_default_capitulation
	}

	else_if = {
		limit = {
			ROOT = {
				OR = {
					original_tag = ORE
					is_in_faction_with = URL
				}
				OR = {
					is_in_faction_with = ORE
					original_tag = URL
				}
				all_allied_country = {
					has_capitulated = yes
				}
			}
		}
		FROM = {
			annex_country = {
				target = ORE
				transfer_troops = no
			}
			annex_country = {
				target = URL
				transfer_troops = no
			}
		}
		set_global_flag = skip_default_capitulation
	}

	#Zlatoust unification
	else_if = {
		limit = {
			FROM = { tag = ZLT }
			ROOT = {
				OR = {
					tag = OMS
					tag = TYM
					tag = SVR
				}
			}
		}
		ZLT = {
			annex_country = {
				target = ROOT
				transfer_troops = no
			}
			if = {
				limit = {
					OMS = { exists = no }
					SVR = { exists = no }
					TYM = { exists = no }
				}
				country_event = { id = ZLT.16 days = 1 }
			}
		}
		set_global_flag = skip_default_capitulation
	}

	# SBA Collapse Wars
	else_if = {
		limit = {
			has_global_flag = SBA_collapsed
			FROM = { is_central_siberian_nation = yes }
			ROOT = { is_central_siberian_nation = yes }
		}
		if = { # Mongush wins against Stepanov
			limit = {
				ROOT = { tag = PRC }
				FROM = { tag = TAN }
			}
			TAN = {
				annex_country = { target = PRC transfer_troops = no }
			}
			SBA = {
				set_country_flag = SBA_Collapse_Siberian_War
			}
			if = {
				limit = {
					country_exists = BRY
				}
				BRY = {
					country_event = {
						id = SBA.110
						days = 180
					}
				}
			}
			else_if = {
				limit = {
					country_exists = IRK
				}
				IRK = {
					country_event = {
						id = SBA.111
						days = 180
					}
				}
			}
		}
		else_if = { # Stepanov wins against Mongush
			limit = {
				ROOT = { tag = TAN }
				FROM = { tag = PRC }
			}
			PRC = {
				annex_country = { target = TAN transfer_troops = no }
				country_event = {
					id = SBA.117
					days = 10
				}
			}
		}
		else_if = { # Siuda wins against Stepanov
			limit = {
				ROOT = { tag = PRC }
				FROM = { tag = SBA }
			}
			SBA = {
				set_country_flag = SBA_Collapse_Siberian_War
			}
		}
		else_if = { # Stepanov wins against Siuda
			limit = {
				ROOT = { tag = SBA }
				FROM = { tag = PRC }
			}
			PRC = {
				set_country_flag = SBA_Collapse_Siberian_War
			}
		}
		else_if = { # Novosibirsk wins against Barnaul
			limit = {
				ROOT = { tag = ALT }
				FROM = { tag = NOV }
			}
			KEM = {
				country_event = {
					id = SBA.118
					days = 10
				}
			}
		}
		else_if = { # Barnaul wins against Novosibirsk
			limit = {
				ROOT = { tag = NOV }
				FROM = { tag = ALT }
			}
			KEM = {
				country_event = {
					id = SBA.118
					days = 10
				}
			}
		}
		else_if = { # Kemerovo wins against Novosibirsk/Barnaul
			limit = {
				OR = {
					ROOT = { tag = NOV }
					ROOT = { tag = ALT }
				}
				FROM = { tag = KEM }
			}
			KEM = {
				set_country_flag = SBA_Collapse_Siberian_War
			}
		}
		else_if = { # Novosibirsk wins against Kemerovo
			limit = {
				ROOT = { tag = ALT }
				FROM = { tag = NOV }
			}
			NOV = {
				set_country_flag = SBA_Collapse_Siberian_War
			}
		}
		else_if = { # Barnaul wins against Kemerovo
			limit = {
				ROOT = { tag = KEM }
				FROM = { tag = ALT }
			}
			ALT = {
				set_country_flag = SBA_Collapse_Siberian_War
			}
		}
		else_if = { # Central Siberian War
			limit = {
				OR = {
					NOV = { has_country_flag = SBA_Collapse_Siberian_War }
					ALT = { has_country_flag = SBA_Collapse_Siberian_War }
					KEM = { has_country_flag = SBA_Collapse_Siberian_War }
				}
				OR = {
					SBA = { has_country_flag = SBA_Collapse_Siberian_War }
					PRC = { has_country_flag = SBA_Collapse_Siberian_War }
				}
			}
			every_country = {
				limit = {
					has_country_flag = SBA_Collapse_Siberian_War
				}
				country_event = {
					id = SBA.119
					days = 16
				}
			}
		}
		else_if = { # Central Siberia re-reunified
			limit = {
				FROM = {
					has_country_flag = SBA_Collapse_Siberian_War
					controls_state = 568
					controls_state = 570
					controls_state = 578
					controls_state = 757
				}
			}
			FROM = {
				country_event = {
					id = SBA.120
				}
			}
		}
	}

	else_if = { # Pechora War
		limit = {
			FROM = {
				OR = {
					tag = VOR
					tag = YGR
				}
			}
			ROOT = {
				OR = {
					tag = VOR
					tag = YGR
				}
			}
		}
		VOR = { remove_ideas = VOR_pechora_war }
		YGR = { remove_ideas = YGR_pechora_war }
	}

	# Flavor
	if = {
		limit = {
			FROM = { tag = OMS }
			ROOT = { tag = AMR }
		}
		OMS = {
			country_event = { id = omsksr.28 days = 14 }
		}
	}
	else_if = {
		limit = {
			FROM = { tag = OMS }
			ROOT = { tag = WRS }
		}
		OMS = {
			country_event = { id = omsksr.30 days = 30 }
		}
	}
	else_if = {
		limit = {
			FROM = { tag = OMS }
			ROOT = { tag = PRM }
		}
		OMS = {
			country_event = { id = omsksr.31 days = 90 }
		}
	}
	else_if = {
		limit = {
			FROM = { tag = OMS }
			ROOT = { tag = SAM }
		}
		OMS = {
			country_event = { id = omsksr.32 days = 30 }
		}
	}
	else_if = {
		limit = {
			FROM = {
				AND = {
					tag = KOM
					KOM_has_center_government = yes
				}
			}
			ROOT = { tag = ONG }
		}
		KOM = {
			country_event = { id = KOM.427 days = 21 random_hours = 48 }
		}
	}
	else_if = {
		limit = {
			FROM = {
				AND = {
					tag = KOM
					KOM_has_right_government = yes
				}
			}
			ROOT = { tag = ONG }
		}
		KOM = {
			country_event = { id = KOM.433 days = 21 random_hours = 48 }
		}
	}
	else_if = {
		limit = {
			FROM = {
				AND = {
					tag = WRS
					has_country_leader = {
						character = WRS_Georgy_Zhukov
						ruling_only = yes
					}
				}
			}
			ROOT = {
				AND = {
					tag = KOM
					KOM_has_center_government = yes
				}
			}
		}
		WRS = {
			country_event = { id = zhukov.11 days = 7 }
		}
	}
	else_if = {
		limit = {
			FROM = {
				AND = {
					tag = WRS
					has_country_leader = {
						character = WRS_Georgy_Zhukov
						ruling_only = yes
					}
				}
			}
			ROOT = {
				AND = {
					tag = KOM
					KOM_has_right_government = yes
				}
			}
		}
		WRS = {
			country_event = { id = zhukov.12 days = 7 }
		}
	}
	else_if = {
		limit = {
			FROM = {
				AND = {
					tag = WRS
					has_country_leader = {
						character = WRS_Georgy_Zhukov
						ruling_only = yes
					}
				}
			}
			ROOT = {
				AND = {
					tag = KOM
					KOM_has_left_government = yes
				}
			}
		}
		WRS = {
			country_event = { id = zhukov.13 days = 7 }
		}
	}
	else_if = { # Fire event for the Ural Guard if Orenburg dies
		limit = {
			ROOT = { tag = ORE }
			FROM = {
				OR = {
					tag = DRL
					tag = MGN
				}
			}
		}
		URL = { country_event = { id = URL.2500	days = 2 } }
	}
	else_if = {
		limit = {
			FROM = { tag = URL }
			ROOT = { tag = MGN }
		}
		DRL = {
			country_event = DRL.2500
		}
	}
	else_if = { #Keeping these two here, not sure how country leader check would work otherwise
		limit = {
			FROM = { tag = TYM }
			ROOT = {
				tag = OMS
				has_country_leader = {
					character = OMS_Dmitry_Yazov
					ruling_only = yes
				}
			}
		}
		TYM = { country_event = { id = TYM.115 days = 7 random_hours = 3 } }
	}
	else_if = {
		limit = {
			FROM = { tag = TYM }
			ROOT = {
				tag = OMS
				NOT = {
					has_country_leader = {
						character = OMS_Dmitry_Yazov
						ruling_only = yes
					}
				}
			}
		}
		TYM = { country_event = { id = TYM.160 days = 7 random_hours = 3 } }
	}
	# two flavour events one if eurasia capitulates decembrist tomsk and the other if the opposite happens
	else_if = { #tomsk capitulates eurasia
		limit = {
			ROOT = { tag = KOM }
			FROM = { tag = TOM }
			has_global_flag = KOM_gumilyov_in_power
			has_global_flag = TOM_decembrists_in_power
		}
		TOM = {
			country_event = { id = TOM.152 days = 1	}
		}
	}
	else_if = { #tomsk capitulates eurasia
		limit = {
			ROOT = { tag = TOM }
			FROM = { tag = KOM }
			has_global_flag = KOM_gumilyov_in_power
			has_global_flag = TOM_decembrists_in_power
		}
		KOM = {
			country_event = { id = KOM_gumilyov_regional.35 days = 1 }
		}
	}


	if = { # checks the state changes in southern urals for race for the urals GUI
		limit = {
			ROOT = {
				OR = {
					original_tag = ORE
					original_tag = URL
					original_tag = MGN
					original_tag = DRL
				}
				AND = {
					country_exists = WSR
					country_exists = WSB
				}
			}
		}
		WSR = {
			country_event = { id = RUS_race_for_the_urals.105 days = 1 }
		}
		WSB = {
			country_event = { id = RUS_race_for_the_urals.105 days = 1 }
		}
		ROOT = {
			set_temp_variable = {
				ROOT.owned_states = 0
			}
			every_owned_state = {
				add_to_temp_variable = {
					ROOT.owned_states = 1
				}
			}
		}
		FROM = {
			set_temp_variable = { admin_counter = RUS_admin_efficiency_debuff }
			multiply_temp_variable = { admin_counter = ROOT.owned_states }
			multiply_temp_variable = { admin_counter = -1 }
			clamp_variable = { var = admin_counter max = 0 }
			add_to_variable = { admin_efficiency_counter = admin_counter }
			# Manual downgrade trigger
			if = {
				limit = { check_variable = { admin_efficiency_counter < -239 } }
				country_event = societal_development.1103
				add_to_variable = { admin_efficiency_counter = 240 }
				multiply_variable = { admin_efficiency_monthly_change = 0.25 }
			}
		}
	}
	###Experimental warlord ideology transfer code
	if = {
		limit = {
			OR = {
				ROOT = {
					is_russian_nation = yes
					is_moskowien_splits = no
				}
			}
			FROM = {
				is_russian_nation = yes
				is_moskowien_splits = no
				NOT = {
					original_tag = TOM
					original_tag = OMO
				}
			}
			NOT = { has_global_flag = skip_default_capitulation }
		}
		if = {
			limit = {
				ROOT = {
					has_government = communist
				}
			}
			FROM = {
				add_popularity = {
					ideology = communist
					popularity = 0.05
				}
			}
		}
		else_if = {
			limit = {
				ROOT = {
					has_government = socialist
				}
			}
			FROM = {
				add_popularity = {
					ideology = socialist
					popularity = 0.05
				}
			}
		}
		else_if = {
			limit = {
				ROOT = {
					has_government = ultranationalism
				}
			}
			FROM = {
				add_popularity = {
					ideology = ultranationalism
					popularity = 0.05
				}
			}
		}
		else_if = {
			limit = {
				ROOT = {
					has_government = despotism
				}
			}
			FROM = {
				add_popularity = {
					ideology = despotism
					popularity = 0.05
				}
			}
		}
		else_if = {
			limit = {
				ROOT = {
					has_government = paternalism
				}
			}
			FROM = {
				add_popularity = {
					ideology = paternalism
					popularity = 0.05
				}
			}
		}
		else_if = {
			limit = {
				ROOT = {
					has_government = progressivism
				}
			}
			FROM = {
				add_popularity = {
					ideology = progressivism
					popularity = 0.05
				}
			}
		}
		else_if = {
			limit = {
				ROOT = {
					has_government = liberalism
				}
			}
			FROM = {
				add_popularity = {
					ideology = liberalism
					popularity = 0.05
				}
			}
		}
		else_if = {
			limit = {
				ROOT = {
					has_government = conservatism
				}
			}
			FROM = {
				add_popularity = {
					ideology = conservatism
					popularity = 0.05
				}
			}
		}
		else_if = {
			limit = {
				ROOT = {
					has_government = fascism
				}
			}
			FROM = {
				add_popularity = {
					ideology = fascism
					popularity = 0.05
				}
			}
		}
		else_if = {
			limit = {
				ROOT = {
					has_government = national_socialism
				}
			}
			FROM = {
				add_popularity = {
					ideology = national_socialism
					popularity = 0.05
				}
			}
		}
	}

	if = {
		limit = {
			country_exists = ROOT
		}
		ROOT = { white_peace = FROM }
		FROM = {
			annex_country = {
				target = ROOT
				transfer_troops = no
			}
		}
		set_global_flag = skip_default_capitulation
	}

	# Reset the war weariness
	every_country = {
		limit = {
			is_russian_nation = yes
		}
		RUS_reset_war_weariness = yes
	}
}