####NO STEP BACK####
BALTIC_entente = {

	formalize_the_entente = {

		allowed = {  
			OR = {
				tag = LIT
				tag = LAT
				tag = EST
			}
		}

		icon = GFX_decision_hol_exchange_intelligence_data
		is_good = yes
		fire_only_once = yes
		
		available = {
			any_other_country = {
				has_country_flag = baltic_entente_flag
			}
		}

		visible = {
			is_in_faction = no
		}
		
		cancel_effect = {
		
		}
		
		complete_effect = {
			set_rule = {
				can_create_factions = yes
			}
			create_faction = BALTIC_ENTENTE_FACTION
			every_country = {
				limit = {
					has_country_flag = baltic_entente_flag
				}
				ROOT = { add_to_faction = PREV }
			}
		}

		ai_will_do = {
			factor = 200
			modifier = {
				factor = 0
				any_other_country = {
					OR = {
						tag = LIT
						tag = LAT
						tag = EST
					}
					NOT = { tag = ROOT }
					is_in_faction = yes
				}
			}
			modifier = {
				factor = 0
				has_war = no
				GER = { 
					OR = {
						has_government = democratic
						has_government = neutrality
					}
					is_faction_leader = yes #trust in Germany
				}
				NOT = { 
					any_other_country = {
						OR = {
							has_wargoal_against = ROOT
							is_justifying_wargoal_against = ROOT
						}
					}
				}
			}
		}
	}

	abandon_the_entente = {

		allowed = {  
			OR = {
				tag = LIT
				tag = LAT
				tag = EST
			}
		}

		icon = GFX_decision_generic_break_treaty
		is_good = yes
		fire_only_once = yes
		
		available = {
			has_country_flag = baltic_entente_flag
			has_country_flag = baltic_entente_leader_flag
		}

		visible = {
			is_in_faction = no
		}
		
		cancel_effect = {
		
		}
		
		complete_effect = {
			if = {
				limit = {
					original_tag = LAT
				}
				unlock_national_focus = LAT_beyond_the_baltic
			}
			if = {
				limit = {
					original_tag = LIT
				}
				#unlock_national_focus = LIT_beyond_the_baltic #TODO
			}
			if = {
				limit = {
					original_tag = EST
				}
				unlock_national_focus = EST_beyond_the_baltic
			}
			every_country = {
				limit = {
					has_country_flag = baltic_entente_flag
				}
				country_event = BALTIC_events.203
				clr_country_flag = baltic_entente_flag
			}
		}

		ai_will_do = {
			factor = 0
		}
	}
}

convert_neighbours_baltic_cat = {
	BALTIC_promote_communism = {

		icon = hol_draw_up_staff_plans

		state_target = yes

		available = {
			FROM = {
				owner = {
					is_baltic_country = yes
					NOT = { original_tag = ROOT }
				}
			}
		}
		target_trigger = {
			FROM = {
				owner = {
					is_baltic_country = yes
					NOT = { original_tag = ROOT }
					NOT = { has_government = communism }
					NOT = { has_country_flag = banned_communism_flag }
				}
				is_capital = yes
			}
		}
		visible = {
			ROOT = {
				has_completed_focus = BALTIC_influence_neighbours
			}
		}

		fire_only_once = no
		cost = 50

		days_remove = 70
		#on_map_mode = map_only
		complete_effect = {
			FROM = {
				owner = {
					add_timed_idea = {
						idea = BALTIC_communist_propaganda
						days = 70
					}
				}
			}
		}
		
		remove_effect = {
			
		}

		ai_will_do = {
			base = 10
		}
	}

	BALTIC_promote_communism_militancy = {

		icon = hol_draw_up_staff_plans

		state_target = yes

		available = {
			FROM = {
				owner = {
					is_baltic_country = yes
					NOT = { original_tag = ROOT }
					NOT = { has_country_flag = banned_communism_flag }
				}
			}
		}
		target_trigger = {
			FROM = {
				owner = {
					is_baltic_country = yes
					NOT = { original_tag = ROOT }
					NOT = { has_government = communism }
					NOT = { has_country_flag = banned_communism_flag }
				}
				is_capital = yes
			}
		}
		visible = {
			ROOT = {
				has_completed_focus = BALTIC_influence_neighbours
			}
		}

		fire_only_once = no
		custom_cost_trigger = {
			command_power > 24
			has_political_power > 24
		}
		custom_cost_text = decision_cost_CP_25_pp_25

		days_remove = 70
		complete_effect = {
			hidden_effect = {
				add_political_power = -25
				add_command_power = -25
			}
			FROM = {
				owner = {
					add_timed_idea = {
						idea = BALTIC_communist_militancy
						days = 70
					}
				}
			}
		}
		
		remove_effect = {
			
		}

		ai_will_do = {
			base = 10
		}
	}
}

infiltrate_belarus_decisions = {
	BALTIC_promote_unity_BLR = {

		#SOV
		icon = {
			key = GFX_decision_USSR_claim_state_1
			trigger = {
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = 0
						compare = equals
					}
				}
			}
		}
		icon = {
			key = GFX_decision_USSR_claim_state_2
			trigger = {
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = -1
						compare = equals
					}
				}
			}
		}
		icon = {
			key = GFX_decision_USSR_claim_state_3
			trigger = {
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = -2
						compare = equals
					}
				}
			}
		}
		icon = {
			key = GFX_decision_USSR_claim_state_4
			trigger = {
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = -3
						compare = less_than_or_equals
					}
				}
			}
		}
		#LIT
		icon = {
			key = GFX_decision_LIT_claim_state_4
			trigger = {
				LIT = { has_completed_focus = BALTIC_belarus_ssr }
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = 3
						compare = greater_than_or_equals
					}
				}
			}
		}
		icon = {
			key = GFX_decision_LIT_claim_state_3
			trigger = {
				LIT = { has_completed_focus = BALTIC_belarus_ssr }
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = 2
						compare = greater_than_or_equals
					}
				}
			}
		}
		icon = {
			key = GFX_decision_LIT_claim_state_2
			trigger = {
				LIT = { has_completed_focus = BALTIC_belarus_ssr }
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = 1
						compare = greater_than_or_equals
					}
				}
			}
		}
		#LAT
		icon = {
			key = GFX_decision_LAT_claim_state_4
			trigger = {
				LAT = { has_completed_focus = BALTIC_belarus_ssr }
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = 3
						compare = greater_than_or_equals
					}
				}
			}
		}
		icon = {
			key = GFX_decision_LAT_claim_state_3
			trigger = {
				LAT = { has_completed_focus = BALTIC_belarus_ssr }
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = 2
						compare = greater_than_or_equals
					}
				}
			}
		}
		icon = {
			key = GFX_decision_LAT_claim_state_2
			trigger = {
				LAT = { has_completed_focus = BALTIC_belarus_ssr }
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = 1
						compare = greater_than_or_equals
					}
				}
			}
		}
		#EST
		icon = {
			key = GFX_decision_EST_claim_state_4
			trigger = {
				tag = EST
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = 3
						compare = greater_than_or_equals
					}
				}
			}
		}
		icon = {
			key = GFX_decision_EST_claim_state_3
			trigger = {
				tag = EST
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = 2
						compare = greater_than_or_equals
					}
				}
			}
		}
		icon = {
			key = GFX_decision_EST_claim_state_2
			trigger = {
				tag = EST
				FROM = {
					check_variable = {
						var = BALTIC_claims
						value = 1
						compare = greater_than_or_equals
					}
				}
			}
		}

		state_target = yes

		available = {
			FROM = {
				is_core_of = BLR
				owner = {
					tag = SOV
				}
				custom_trigger_tooltip = {
					tooltip = BALT_claims_no_greater_than_2_tt
					check_variable = { BALTIC_claims < 2 }
				}
				custom_trigger_tooltip = {
					tooltip = BALT_claims_no_less_than_2_tt
					check_variable = { BALTIC_claims > -2 }
				}
				custom_trigger_tooltip = {
					tooltip = BALT_current_claims_tt
					always = yes
				}
			}
			NOT = { has_country_flag = promoting_belarus_state_flag }
		}
		target_trigger = {
			FROM = {
				is_core_of = BLR
				owner = {
					tag = SOV
				}
			}
		}
		visible = {
		}

		fire_only_once = no
		cost = 25

		days_remove = 14
		on_map_mode = map_only
		complete_effect = {
			set_country_flag = promoting_belarus_state_flag
		}
		
		remove_effect = {
			clr_country_flag = promoting_belarus_state_flag
			if = {
				limit = { tag = SOV }
				FROM = {
					subtract_from_variable = {
						var = BALTIC_claims
						value = 1
					}
				}
			}
			else = {
				FROM = {
					add_to_variable = {
						var = BALTIC_claims
						value = 1
					}
				}
			}
			set_variable = {
				var = BALTIC_claims_printed
				value = BALTIC_claims
			}
			multiply_variable = { #Turn negative numbers positive for the tooltip.
				var = BALTIC_claims_printed
				value = 1
			}
		}

		ai_will_do = {
			factor = 10
			modifier = {
				factor = 0
				any_state = {
					is_core_of = BLR
					NOT = { owner = { tag = SOV } }
					NOT = { owner = { tag = ROOT } }
				}
			}
		}
	}

	BALTIC_belarus_uprising = {

		icon = GFX_decision_revolt

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 200
		is_good = yes
		fire_only_once = yes
		
		activation = {
			ROOT = {
				has_completed_focus = BALTIC_belarus_ssr
				NOT = { has_completed_focus = BALTIC_seek_support_of_soviets }
			}
			NOT = { has_global_flag = belarus_baltic_resolved }
		}
		
		cancel_effect = {
		
		}

		timeout_effect = {
			effect_tooltip = {
				BLR = {
					start_civil_war = {
						ideology = communism
						size = 0.5
						ruling_party = communism
					}
				}
			}
			hidden_effect = {
				SOV = {
					release = BLR
				}
				BLR = {
					division_template = { 
						name = "Belarusian Red Riflemen"
						division_names_group = SOV_INF_01
						is_locked = no
						regiments = { 
							infantry = { x = 0 y = 0 }
							infantry = { x = 1 y = 0 }
							infantry = { x = 2 y = 0 }
							infantry = { x = 3 y = 0 }

							infantry = { x = 0 y = 1 }
							infantry = { x = 1 y = 1 }
						}
						support = {
						}
					}
					random_owned_controlled_state = {
						create_unit = {
							division = "name = \"1. Belarusian Red Riflemen\" division_template = \"Belarusian Red Riflemen\" start_experience_factor = 0.5" 
							owner = PREV
						}
						create_unit = { 
							division = "name = \"2. Belarusian Red Riflemen\" division_template = \"Belarusian Red Riflemen\" start_experience_factor = 0.5" 
							owner = PREV
						}
						create_unit = { 
							division = "name = \"3. Belarusian Red Riflemen\" division_template = \"Belarusian Red Riflemen\" start_experience_factor = 0.5" 
							owner = PREV
						}
					}
					random_owned_controlled_state = {
						create_unit = { 
							division = "name = \"4. Belarusian Red Riflemen\" division_template = \"Belarusian Red Riflemen\" start_experience_factor = 0.5" 
							owner = PREV
						}
						create_unit = { 
							division = "name = \"5. Belarusian Red Riflemen\" division_template = \"Belarusian Red Riflemen\" start_experience_factor = 0.5" 
							owner = PREV
						}
					}
					random_owned_controlled_state = {
						create_unit = { 
							division = "name = \"6. Belarusian Red Riflemen\" division_template = \"Belarusian Red Riflemen\" start_experience_factor = 0.5" 
							owner = PREV
						}
						create_unit = { 
							division = "name = \"7. Belarusian Red Riflemen\" division_template = \"Belarusian Red Riflemen\" start_experience_factor = 0.5" 
							owner = PREV
						}
						create_unit = { 
							division = "name = \"8. Belarusian Red Riflemen\" division_template = \"Belarusian Red Riflemen\" start_experience_factor = 0.5" 
							owner = PREV
						}
					}
					random_owned_controlled_state = {
						create_unit = { 
							division = "name = \"9. Belarusian Red Riflemen\" division_template = \"Belarusian Red Riflemen\" start_experience_factor = 0.5" 
							owner = PREV
						}
						create_unit = { 
							division = "name = \"10. Belarusian Red Riflemen\" division_template = \"Belarusian Red Riflemen\" start_experience_factor = 0.5" 
							owner = PREV
						}
					}
					random_owned_controlled_state = {
						create_unit = { 
							division = "name = \"11. Belarusian Red Riflemen\" division_template = \"Belarusian Red Riflemen\" start_experience_factor = 0.5" 
							owner = PREV
						}
						create_unit = { 
							division = "name = \"12. Belarusian Red Riflemen\" division_template = \"Belarusian Red Riflemen\" start_experience_factor = 0.5" 
							owner = PREV
						}
					}
					if = {
						limit = {
							all_owned_state = {
								check_variable = { BALTIC_claims > 0 }
							}
						}
						ROOT = {
							annex_country = {
								target = PREV
								transfer_troops = no
							}
						}
					}
					else_if = {
						limit = {
							all_owned_state = {
								check_variable = { BALTIC_claims < 1 }
							}
						}
						SOV = {
							annex_country = {
								target = PREV
								transfer_troops = no
							}
						}
					}
					else = {
						if = {
							limit = {
								206 = { check_variable = { BALTIC_claims > 0 } }
							}
							add_to_variable = {
								var = civil_war_size_var
								value = 0.2
							}
						}
						if = {
							limit = {
								204 = { check_variable = { BALTIC_claims > 0 } }
							}
							add_to_variable = {
								var = civil_war_size_var
								value = 0.2
							}
						}
						if = {
							limit = {
								194 = { check_variable = { BALTIC_claims > 0 } }
							}
							add_to_variable = {
								var = civil_war_size_var
								value = 0.2
							}
						}
						if = {
							limit = {
								241 = { check_variable = { BALTIC_claims > 0 } }
							}
							add_to_variable = {
								var = civil_war_size_var
								value = 0.2
							}
						}
						if = {
							limit = {
								207 = { check_variable = { BALTIC_claims > 0 } }
							}
							add_to_variable = {
								var = civil_war_size_var
								value = 0.2
							}
						}
						start_civil_war = {
							ideology = communism
							size = civil_war_size_var
							states = all
							states_filter = {
								check_variable = { BALTIC_claims > 0 }
								is_capital = no
							}
						}
						random_country = {
							limit = {
								original_tag = BLR
								has_government = communism
							}
							set_cosmetic_tag = BLR_baltic
						}
						set_politics = {
							ruling_party = communism
							elections_allowed = no
						}
						add_popularity = {
							ideology = communism
							popularity = 0.51
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 200
			modifier = {
				factor = 0
				any_state = {
					is_core_of = BLR
					NOT = { owner = { tag = SOV } }
					NOT = { owner = { tag = ROOT } }
				}
			}
		}
	}
}

BALTIC_forest_brother_resistance_cat = {

	BALTIC_forest_brothers_resistance = {

		allowed = {
			OR = {
				tag = EST
				tag = LIT
				tag = LAT
			}
		}

		icon = GFX_decision_revolt

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 180
		is_good = no

		cancel_trigger = {
			has_completed_focus = BALTIC_crush_forest_brothers
		}
		
		activation = {
			has_government = communism
			NOT = { has_completed_focus = BALTIC_crush_forest_brothers }
			has_completed_focus = BALTIC_overthrow_the_government
			has_civil_war = no
		}

		visible = {
			
		}
		
		cancel_effect = {
			hidden_effect = {
				clr_country_flag = recent_forest_brothers_1
				clr_country_flag = recent_forest_brothers_2
				clr_country_flag = recent_forest_brothers_3
				clr_country_flag = recent_forest_brothers_4
			}
		}

		timeout_effect = {
			random_list = {
				25 = {
					country_event = { id = BALTIC_events.11 }
					modifier = {
						factor = 0
						has_country_flag = recent_forest_brothers_1
					}
				}
				25 = {
					hidden_effect = {
						random_owned_state = {
							limit = {
								OR = {
									arms_factory > 0
									industrial_complex > 0
								}
							}
							save_event_target_as = forest_brothers_raid_state_target
						}
					}
					country_event = { id = BALTIC_events.12 }
					modifier = {
						factor = 0
						has_country_flag = recent_forest_brothers_2
					}
				}
				25 = {
					hidden_effect = {
						random_owned_state = {
							limit = {
								is_core_of = ROOT
							}
							save_event_target_as = forest_brothers_raid_state_target
						}
					}
					country_event = { id = BALTIC_events.13 }
					modifier = {
						factor = 0
						has_country_flag = recent_forest_brothers_3
					}
				}
				25 = {
					country_event = { id = BALTIC_events.14 }
					modifier = {
						factor = 0
						has_country_flag = recent_forest_brothers_4
					}
				}
			}
			hidden_effect = {
				clr_country_flag = recent_forest_brothers_1
				clr_country_flag = recent_forest_brothers_2
				clr_country_flag = recent_forest_brothers_3
				clr_country_flag = recent_forest_brothers_4
			}
			activate_mission = BALTIC_forest_brothers_resistance
		}

		ai_will_do = {
			factor = 200
		}
	}
}