SOV_civil_war_preparations = {

	######## government

	SOV_government_help_right_organizations_mission = {

		allowed = { original_tag = SOV }

		available = {
			hidden_trigger = { always = no }
		}

		activation = {
			has_global_flag = SOV_precw_desicions
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}

		icon = decision_sponsor_rights

		fire_only_once = yes

		cancel_if_not_visible = no

		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			NOT = { has_global_flag = second_october }
		}

		is_good = no

		days_mission_timeout = 50

		timeout_effect = {
			custom_effect_tooltip = SOV_gov_advance_decisions_TT
			set_global_flag = SOV_gov_helped_rights
			add_popularity = {
				ideology = reactionary
				popularity = 0.05
			}
			add_popularity = {
				ideology = fascist
				popularity = 0.05
			}
		}
	}

	SOV_government_fight_workers_and_communist_organizations_mission = {

		allowed = { tag = SOV }

		icon = decision_supress_work_ogs

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = yes

		activation = {
			has_global_flag = SOV_precw_desicions
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}

		cancel_if_not_visible = no

		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			NOT = { has_global_flag = second_october }
		}

		is_good = no

		days_mission_timeout = 60

		timeout_effect = {
			set_global_flag = SOV_gov_thought_work_orgs
			add_popularity = {
				ideology = communist
				popularity = -0.09
			}
			add_timed_idea = {
				idea = SOV_supressed_workers_activity
				days = 30
			}
			random_owned_state = {
				damage_building = {
					type = infrastructure
					damage = 1
				}
			}
		}
	}

	SOV_government_cleanse_fsb_mission = {

		allowed = { tag = SOV }

		icon = decision_nazbol_actions

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = yes

		cancel_if_not_visible = yes

		activation = {
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_gov_created_natguard
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		visible = {
			tag = SOV
			NOT = { has_global_flag = second_october }
		}

		is_good = no

		days_mission_timeout = 50

		timeout_effect = {
			custom_effect_tooltip = SOV_gov_advance_decisions_TT
			set_global_flag = SOV_gov_cleaned_fsb
		}
	}

	SOV_government_supress_communist_movement_mission = {

		allowed = { tag = SOV }

		icon = decision_ban_coalition

		available = {
			hidden_trigger = { always = no }
			has_global_flag = SOV_gov_cleaned_fsb
		}

		fire_only_once = yes

		cancel_if_not_visible = yes

		activation = {
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_gov_cleaned_fsb
			has_global_flag = SOV_gov_helped_rights
		}

		visible = {
			tag = SOV
			NOT = { has_global_flag = second_october }
		}

		is_good = no

		days_mission_timeout = 120

		timeout_effect = {
			custom_effect_tooltip = SOV_gov_supressed_communists_decisions_TT
			custom_effect_tooltip = SOV_gov_supressed_communists_decisions_aditional_TT
			set_global_flag = SOV_gov_supressed_communists
			clr_global_flag = russia_reactionary_nofocus
		}
	}

	SOV_government_create_national_guard_mission = {

		allowed = { tag = SOV }

		icon = decision_create_national_guard

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = yes

		cancel_if_not_visible = yes
		activation = {
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_gov_thought_work_orgs
			has_global_flag = SOV_gov_helped_rights
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		visible = {
			tag = SOV
			NOT = { has_global_flag = second_october }
		}

		is_good = no

		days_mission_timeout = 50

		timeout_effect = {
			custom_effect_tooltip = SOV_gov_advance_decisions_TT
			custom_effect_tooltip = SOV_gov_cw_5_divs_TT
			set_global_flag = SOV_gov_created_natguard
		}
	}

	SOV_government_takeaway_factory_from_workers_mission = {

		allowed = { tag = SOV }

		icon = decision_supress_work_ogs

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = no

		cancel_if_not_visible = no

		activation = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_workers_helped
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}

		visible = {
			tag = SOV
			NOT = { has_global_flag = second_october }
		}

		is_good = no

		days_mission_timeout = 5

		timeout_effect = {
			add_popularity = {
				ideology = communist
				popularity = -0.03
			}
			random_owned_state = {
				limit = {
					free_building_slots = {
						building = industrial_complex
						size > 2
						include_locked = yes
					}
				}
				remove_building = {
					type = industrial_complex
					level = 1
				}
			}
		}
	}

	SOV_government_fight_workers_orgs_mission = {

		allowed = { tag = SOV }

		icon = decision_supress_work_ogs

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = no

		cancel_if_not_visible = yes

		activation = {
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_gov_thought_work_orgs
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}

		visible = {
			tag = SOV
			NOT = { has_global_flag = second_october }
		}

		is_good = no

		days_mission_timeout = 60

		timeout_effect = {
			if = {
				limit = {
					has_idea = SOV_workers_movement_1
				}
				swap_ideas = {
					remove_idea = SOV_workers_movement_1
					add_idea = SOV_workers_movement_5
				}
			}
			if = {
				limit = {
					has_idea = SOV_workers_movement_2
				}
				swap_ideas = {
					remove_idea = SOV_workers_movement_2
					add_idea = SOV_workers_movement_1
				}
			}
			if = {
				limit = {
					has_idea = SOV_workers_movement_3
				}
				swap_ideas = {
					remove_idea = SOV_workers_movement_3
					add_idea = SOV_workers_movement_2
				}
			}
			if = {
				limit = {
					has_idea = SOV_workers_movement_4
				}
				swap_ideas = {
					remove_idea = SOV_workers_movement_4
					add_idea = SOV_workers_movement_3
				}
			}
			if = {
				limit = {
					has_idea = SOV_workers_movement_5
				}
				swap_ideas = {
					remove_idea = SOV_workers_movement_5
					add_idea = SOV_workers_movement_6
				}
			}
		}
	}

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

	SOV_commies_help_workers_2 = {
		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_workers_helped
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		icon = decision_help_workers
		cost = 10
		available = {
			has_government = reactionary
		}
		fire_only_once = no
		complete_effect = {
			add_popularity = {
				ideology = communist
				popularity = 0.1
			}
		}
		days_remove = 15
		remove_effect = {
			if = {
				limit = {
					has_idea = SOV_workers_movement_5
				}
				swap_ideas = {
					remove_idea = SOV_workers_movement_5
					add_idea = SOV_workers_movement_1
				}
			}
			if = {
				limit = {
					has_idea = SOV_workers_movement_6
				}
				swap_ideas = {
					remove_idea = SOV_workers_movement_6
					add_idea = SOV_workers_movement_5
				}
			}
			if = {
				limit = {
					has_idea = SOV_workers_movement_3
				}
				swap_ideas = {
					remove_idea = SOV_workers_movement_3
					add_idea = SOV_workers_movement_4
				}
			}
			if = {
				limit = {
					has_idea = SOV_workers_movement_2
				}
				swap_ideas = {
					remove_idea = SOV_workers_movement_2
					add_idea = SOV_workers_movement_3
				}
			}
			if = {
				limit = {
					has_idea = SOV_workers_movement_1
				}
				swap_ideas = {
					remove_idea = SOV_workers_movement_1
					add_idea = SOV_workers_movement_2
				}
			}
		}
	}

	SOV_RKR = {
		visible = {
			tag = SOV
			has_global_flag = SOV_workers_helped
			has_global_flag = SOV_front_congress_done
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		cost = 50
		icon = decision_help_workers
		available = {
			has_government = reactionary
		}
		fire_only_once = yes
		complete_effect = {
			add_popularity = {
				ideology = communist
				popularity = 0.05
			}
		}
		days_remove = 30
		remove_effect = {
			set_global_flag = SOV_RKR_held
			custom_effect_tooltip = SOV_comm_advance_decisions_TT
			country_event = {
				id = precw.5
			}
		}
	}

	SOV_commies_help_workers = {
		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		icon = decision_help_workers
		cost = 35
		available = {
			has_government = reactionary
		}
		fire_only_once = yes
		complete_effect = {
			add_popularity = {
				ideology = communist
				popularity = 0.1
			}
		}
		days_remove = 15
		remove_effect = {
			set_global_flag = SOV_workers_helped
			country_event = {
				id = precw.8
			}
		}
	}

	SOV_general_strike_desicion = {
		visible = {
			tag = SOV
			has_global_flag = SOV_RKR_held
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		cost = 45
		icon = decision_strike
		available = {
			has_government = reactionary
		}
		fire_only_once = yes
		complete_effect = {
			add_popularity = {
				ideology = communist
				popularity = 0.05
			}
		}
		days_remove = 35
		remove_effect = {
			custom_effect_tooltip = SOV_comm_advance_decisions_TT
			set_global_flag = SOV_general_strike
			add_ideas = SOV_general_strike

			add_days_mission_timeout = {
				mission = SOV_government_supress_communist_movement_mission
				days = 40
			}
		}
	}

	SOV_congress_of_soviets_desicion = {
		visible = {
			tag = SOV
			has_global_flag = SOV_general_strike
			has_global_flag = SOV_Petersburg_soviet
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		icon = decision_ban_coalition
		cost = 30
		available = {
			has_government = reactionary
			custom_trigger_tooltip = { tooltip = SOV_congress_of_soviets_needed_TT}
			has_global_flag = SOV_general_strike
			has_global_flag = SOV_Petersburg_soviet
		}
		fire_only_once = yes
		complete_effect = {
			add_popularity = {
				ideology = communist
				popularity = 0.05
			}
		}
		days_remove = 5
		remove_effect = {
			custom_effect_tooltip = SOV_comm_start_cw_decisions_TT
			custom_effect_tooltip = SOV_congressadditional_cw_decisions_TT
			country_event = {
				id = precw.6
			}
		}
	}

	SOV_street_propaganda = {
		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		cost = 35
		icon = decision_street_propaganda
		available = {
			has_government = reactionary
		}
		fire_only_once = yes
		complete_effect = {
			add_popularity = {
				ideology = communist
				popularity = 0.05
			}
		}
		days_remove = 30
		remove_effect = {
			set_global_flag = SOV_street_prop_done
			custom_effect_tooltip = SOV_comm_advance_decisions_TT
		}
	}

	SOV_communist_congress = {
		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_street_prop_done
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		cost = 50
		icon = decision_help_workers
		available = {
			has_government = reactionary
		}
		fire_only_once = yes
		complete_effect = {
			add_popularity = {
				ideology = communist
				popularity = 0.05
			}
		}
		days_remove = 30
		remove_effect = {
			custom_effect_tooltip = SOV_comm_advance_decisions_TT
			set_global_flag = SOV_front_congress_done
			country_event = {
				id = precw.7
			}
		}
	}

	SOV_nazbols_terr_actions = {
		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_street_prop_done
			NOT = { has_global_flag = SOV_gov_supressed_communists }
			NOT = { has_global_flag = second_october }
		}
		cost = 35
		icon = decision_nazbol_actions
		available = {
			has_government = reactionary
		}
		fire_only_once = yes
		complete_effect = {
			add_popularity = {
				ideology = communist
				popularity = 0.01
			}
			add_stability = -0.05
			add_war_support = -0.05
		}
		days_remove = 20
		remove_effect = {
			custom_effect_tooltip = SOV_nazbol_actions_decisions_TT
			set_global_flag = SOV_nazbol_actions_1_done
			add_stability = -0.02
		}
	}

	SOV_nazbols_actions_2 = {
		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_nazbol_actions_1_done
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		cost = 45
		icon = decision_nazbol_actions
		fire_only_once = yes
		available = {
			has_government = reactionary
			has_global_flag = SOV_nazbol_actions_1_done
		}
		complete_effect = {
			add_popularity = {
				ideology = communist
				popularity = 0.01
			}
			add_stability = -0.05
			add_war_support = -0.05
		}
		days_remove = 25
		remove_effect = {
			custom_effect_tooltip = SOV_nazbol_actions_decisions_TT
			set_global_flag = SOV_nazbol_actions_2_done
			add_stability = -0.02
		}
	}

	SOV_nazbols_actions_3 = {
		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_nazbol_actions_2_done
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		cost = 50
		icon = decision_nazbol_actions
		fire_only_once = yes
		available = {
			has_government = reactionary
			has_global_flag = SOV_nazbol_actions_2_done
		}
		complete_effect = {
			add_popularity = {
				ideology = communist
				popularity = 0.01
			}
			add_stability = -0.05
			add_war_support = -0.05
		}
		days_remove = 25
		remove_effect = {
			custom_effect_tooltip = SOV_nazbol_actions_decisions_TT
			set_global_flag = SOV_nazbol_actions_3_done
			add_stability = -0.02
		}
	}

	SOV_create_military_organizations = {
		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_street_prop_done
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		cost = 35
		icon = decision_mil_orgs
		fire_only_once = yes
		available = {
			has_government = reactionary
		}
		complete_effect = {
			custom_effect_tooltip = SOV_additional_units_in_gw_TT
			add_war_support = -0.1
		}
		days_remove = 10
		remove_effect = {
			set_global_flag = SOV_communist_military_organizations_1_done
		}
	}

	SOV_create_military_organizations_2 = {
		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_communist_military_organizations_1_done
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		cost = 40
		icon = decision_mil_orgs
		fire_only_once = yes
		available = {
			has_government = reactionary
		}
		complete_effect = {
			custom_effect_tooltip = SOV_additional_units_in_gw_TT
			add_war_support = -0.1
		}
		days_remove = 20
		remove_effect = {
			set_global_flag = SOV_communist_military_organizations_2_done
		}
	}

	SOV_create_military_organizations_3 = {
		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_communist_military_organizations_2_done
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		cost = 50
		icon = decision_mil_orgs
		fire_only_once = yes
		available = {
			has_government = reactionary
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		complete_effect = {
			custom_effect_tooltip = SOV_additional_units_in_gw_TT
			add_war_support = -0.1
		}
		days_remove = 30
		remove_effect = {
			set_global_flag = SOV_communist_military_organizations_3_done
		}
	}

	SOV_create_petersburg_soviet  = {
		visible = {
			tag = SOV
			has_global_flag = SOV_precw_desicions
			has_global_flag = SOV_front_congress_done
			NOT = { has_global_flag = second_october }
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		cost = 55
		icon = decision_help_workers
		fire_only_once = yes
		available = {
			has_government = reactionary
			NOT = { has_global_flag = SOV_gov_supressed_communists }
		}
		complete_effect = {
			add_stability = -0.1
		}
		days_remove = 30
		remove_effect = {
			add_stability = -0.05
			custom_effect_tooltip = SOV_comm_advance_decisions_TT
			set_global_flag = SOV_Petersburg_soviet
		}
	}

}
