### AI ###
#BUL_is_historical_ai
#BUL_is_communist_stalinist_ai
#BUL_is_communist_balkan_ai
#BUL_is_democratic_socialist_ai
#BUL_is_democratic_liberal_ai
#BUL_is_fascist_axis_ai
#BUL_is_monarchist_ferdinand_ai

#INTERNAL FACTIONS
BUL_internal_factions = {
	BUL_a_royal_visit  = { #Tsar Boris visits a random location in Bulgaria

		priority = 50

		icon = eng_ally_imperialist_coup

		ai_will_do = {
			base = 0
			modifier = {
				add = 1
				has_stability < 0.5
			}
			modifier = {
				factor = 10
				has_stability < 0.3
			}
			modifier = {
				factor = 10
				has_stability < 0.2
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			has_completed_focus = BUL_power_to_the_tsar
		}

		days_remove = 7

		days_re_enable = 120

		visible = {
			NOT = { has_completed_focus = BUL_oppose_the_royal_dictatorship }
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_tsar_boris_is_dead_flag }
			has_country_leader = {
				character = BUL_boris_iii
				ruling_only = yes
			}
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		modifier = {
			political_power_gain = -0.5
		}

		remove_effect = {
			hidden_effect = {
				random_list =  {
					70 = {
					}
					20 = {
						set_country_flag = BUL_a_royal_visit_extra_success_flag
					}
					10 = {
						set_country_flag = BUL_a_royal_visit_failure_flag
					}
				}
			}
			country_event = { id = bftb_bulgaria_tsar_boris.1 }
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}
	}


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


	BUL_cooperation_zveno_speech  = { #ZVENO Allow/Support faction speech

		priority = 42

		icon = GFX_decision_bul_speech_zveno

		ai_will_do = {
			base = 4
			modifier = {
				factor = 0.1
				has_country_flag = BUL_zveno_joint_act_flag
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			NOT = { has_country_flag = BUL_zveno_bolstered_flag }
		}

		days_remove = BUL_faction_days_remove_very_low

		days_re_enable = BUL_faction_days_reenable_low

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_completed_focus = BUL_cooperate_with_the_zveno
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_zveno_bolstered_flag }
			NOT = { has_country_flag = BUL_disposed_of_zveno_generals_flag }
			NOT = { has_country_flag = BUL_zveno_integrated_flag }
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
			if = {
				limit = {
					has_country_flag = BUL_discredited_zveno_flag
				}
				clr_country_flag = BUL_discredited_zveno_flag
			}
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_cooperation_zveno_joint_act
			BUL_zveno_low_loyalty_increase_effect = yes
			BUL_zveno_low_popularity_increase_effect = yes
			set_country_flag = BUL_speech_zveno_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_cooperation_faction_speech_cd_tt
		}
	}

	BUL_cooperation_bs_speech  = { #BROAD SOCIALISTS Allow/Support faction speech

		priority = 32

		icon = GFX_decision_bul_speech_bs

		ai_will_do = {
			base = 2
			modifier = {
				factor = 0.1
				has_country_flag = BUL_bs_joint_act_flag
			}
			modifier = {
				factor = 0.1
				BUL_is_historical_ai = yes #Not a prio thing for Boris
			}
			modifier = {
				factor = 0
				OR = {
					BUL_is_fascist_axis_ai = yes
					BUL_is_monarchist_ferdinand_ai = yes
					BUL_is_democratic_liberal_ai = yes
				}
			}
			modifier = {
				factor = 1.5
				OR = {
					BUL_is_communist_stalinist_ai = yes
					BUL_is_communist_balkan_ai = yes
					BUL_is_democratic_socialist_ai = yes
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			NOT = {	has_country_flag = BUL_bs_legalized_flag }
			NOT = {
				focus_progress = {
					focus = BUL_crush_the_communists
					progress > 0
				}
			}
		}

		days_remove = BUL_faction_days_remove_very_low

		days_re_enable = BUL_faction_days_reenable_low

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_completed_focus = BUL_crush_the_communists
					focus_progress = {
						focus = BUL_crush_the_communists
						progress > 0
					}
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			OR = {
				has_completed_focus = BUL_oppose_the_royal_dictatorship
				has_completed_focus = BUL_freedom_of_press
			}
			NOT = { has_completed_focus = BUL_crush_the_communists }
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bs_integrated_flag }
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
			NOT = { has_country_flag = BUL_bs_media_banned_flag }
			NOT = {	has_country_flag = BUL_bs_legalized_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
			if = {
				limit = {
					has_country_flag = BUL_discredited_bs_flag
				}
				clr_country_flag = BUL_discredited_bs_flag
			}
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_cooperation_bs_joint_act
			BUL_bs_low_loyalty_increase_effect = yes
			BUL_bs_low_popularity_increase_effect = yes
			set_country_flag = BUL_speech_bs_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_cooperation_faction_speech_cd_tt
		}
	}

	BUL_cooperation_bzns_speech  = { #AGRARIAN UNION Allow/Support faction speech

		priority = 22

		icon = GFX_decision_bul_speech_bzns

		ai_will_do = {
			base = 2
			modifier = {
				factor = 0.1
				has_country_flag = BUL_bzns_joint_act_flag
			}
			modifier = {
				factor = 0
				BUL_is_fascist_axis_ai = yes
			}
			modifier = {
				factor = 1.5
				OR = {
					BUL_is_communist_stalinist_ai = yes
					BUL_is_communist_balkan_ai = yes
					BUL_is_democratic_socialist_ai = yes
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			NOT = {	has_country_flag = BUL_bzns_legalized_flag }
		}

		days_remove = BUL_faction_days_remove_very_low

		days_re_enable = BUL_faction_days_reenable_low

		visible = {
			OR = {
				has_completed_focus = BUL_oppose_the_royal_dictatorship
				has_completed_focus = BUL_power_to_the_tsar
			}
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_integrated_flag }
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
			NOT = { has_country_flag = BUL_bzns_media_banned_flag }
			NOT = {	has_country_flag = BUL_bzns_legalized_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
			if = {
				limit = {
					has_country_flag = BUL_discredited_bzns_flag
				}
				clr_country_flag = BUL_discredited_bzns_flag
			}
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_cooperation_bzns_joint_act
			BUL_bzns_low_loyalty_increase_effect = yes
			BUL_bzns_low_popularity_increase_effect = yes
			set_country_flag = BUL_speech_bzns_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_cooperation_faction_speech_cd_tt
		}
	}

	BUL_cooperation_nsm_speech  = { #NATIONAL SOCIAL MOVEMENT Allow/Support faction speech

		priority = 12

		icon = GFX_decision_bul_speech_nsm

		ai_will_do = {
			base = 2
			modifier = {
				factor = 0.1
				has_country_flag = BUL_nsm_joint_act_flag
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			NOT = {	has_country_flag = BUL_nsm_legalized_flag }
		}

		days_remove = BUL_faction_days_remove_very_low

		days_re_enable = BUL_faction_days_reenable_low

		visible = {
			OR = {
				has_completed_focus = BUL_restrained_paramilitary_organizations
				has_completed_focus = BUL_appoint_right_wing_ministers
			}
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_integrated_flag }
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
			NOT = { has_country_flag = BUL_nsm_media_banned_flag }
			NOT = {	has_country_flag = BUL_nsm_legalized_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
			if = {
				limit = {
					has_country_flag = BUL_discredited_nsm_flag
				}
				clr_country_flag = BUL_discredited_nsm_flag
			}
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_cooperation_nsm_joint_act
			BUL_nsm_low_loyalty_increase_effect = yes
			BUL_nsm_low_popularity_increase_effect = yes
			set_country_flag = BUL_speech_nsm_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_cooperation_faction_speech_cd_tt
		}
	}

	BUL_cooperation_zveno_joint_act  = { #ZVENO Joint Act

		priority = 43

		icon = GFX_decision_bul_joint_act_zveno

		ai_will_do = {
			base = 4.5
			modifier = {
				factor = 0.5
				has_country_flag = BUL_zveno_legalized_flag
				check_variable = { BUL_zveno_loyalty = 55 compare = less_than_or_equals }
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_faction_joint_act_tt
				check_variable = { BUL_zveno_loyalty = 25 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_low

		days_re_enable = BUL_faction_days_reenable_medium

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			OR = {
				has_country_flag = BUL_speech_zveno_flag
				has_country_flag = BUL_zveno_legalized_flag
			}			
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_zveno_integrated_flag }
			NOT = { has_country_flag = BUL_disposed_of_zveno_generals_flag }
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			BUL_zveno_medium_loyalty_increase_effect = yes
			BUL_zveno_medium_popularity_increase_effect = yes
			set_country_flag = BUL_zveno_joint_act_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_cooperation_faction_joint_act_cd_tt
		}
	}

	BUL_cooperation_bs_joint_act  = { #BROAD SOCIALISTS Joint Act

		priority = 33

		icon = GFX_decision_bul_joint_act_bs

		ai_will_do = {
			base = 2.5
			modifier = {
				factor = 0.5
				has_country_flag = BUL_bs_legalized_flag
				check_variable = { BUL_bs_loyalty = 55 compare = less_than_or_equals }
			}
			modifier = {
				factor = 0.1
				BUL_is_historical_ai = yes #Not a prio thing for Boris
			}
			modifier = {
				factor = 1.5
				OR = {
					BUL_is_communist_stalinist_ai = yes
					BUL_is_communist_balkan_ai = yes
					BUL_is_democratic_socialist_ai = yes
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_faction_joint_act_tt
				check_variable = { BUL_bs_loyalty = 25 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			NOT = {
				focus_progress = {
					focus = BUL_crush_the_communists
					progress > 0
				}
			}
		}

		days_remove = BUL_faction_days_remove_low

		days_re_enable = BUL_faction_days_reenable_medium

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_completed_focus = BUL_crush_the_communists
					focus_progress = {
						focus = BUL_crush_the_communists
						progress > 0
					}
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			OR = {
				has_country_flag = BUL_speech_bs_flag
				has_country_flag = BUL_bs_legalized_flag
			}
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bs_integrated_flag }
			NOT = { has_completed_focus = BUL_crush_the_communists }
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
			NOT = { has_country_flag = BUL_bs_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			BUL_bs_medium_loyalty_increase_effect = yes
			BUL_bs_medium_popularity_increase_effect = yes
			set_country_flag = BUL_bs_joint_act_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_cooperation_faction_joint_act_cd_tt
		}
	}

	BUL_cooperation_bzns_joint_act  = { #AGRARIAN UNION Joint Act

		priority = 23

		icon = GFX_decision_bul_joint_act_bzns

		ai_will_do = {
			base = 2.5
			modifier = {
				factor = 0.5
				has_country_flag = BUL_bzns_legalized_flag
				check_variable = { BUL_bzns_loyalty = 55 compare = less_than_or_equals }
			}
			modifier = {
				factor = 1.5
				OR = {
					BUL_is_communist_stalinist_ai = yes
					BUL_is_communist_balkan_ai = yes
					BUL_is_democratic_socialist_ai = yes
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_faction_joint_act_tt
				check_variable = { BUL_bzns_loyalty = 25 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_low

		days_re_enable = BUL_faction_days_reenable_medium

		visible = {
			OR = {
				has_country_flag = BUL_speech_bzns_flag
				has_country_flag = BUL_bzns_legalized_flag
			}
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_integrated_flag }
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
			NOT = { has_country_flag = BUL_bzns_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			BUL_bzns_medium_loyalty_increase_effect = yes
			BUL_bzns_medium_popularity_increase_effect = yes
			set_country_flag = BUL_bzns_joint_act_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_cooperation_faction_joint_act_cd_tt
		}
	}

	BUL_cooperation_nsm_joint_act  = { #NATIONAL SOCIAL MOVEMENT Joint Act

		priority = 13

		icon = GFX_decision_bul_joint_act_nsm

		ai_will_do = {
			base = 2.5
			modifier = {
				factor = 0.5
				has_country_flag = BUL_nsm_legalized_flag
				check_variable = { BUL_nsm_loyalty = 55 compare = less_than_or_equals }
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_faction_joint_act_tt
				check_variable = { BUL_nsm_loyalty = 25 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_low

		days_re_enable = BUL_faction_days_reenable_medium

		visible = {
			OR = {
				has_country_flag = BUL_speech_nsm_flag
				has_country_flag = BUL_nsm_legalized_flag
			}
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_integrated_flag }
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
			NOT = { has_country_flag = BUL_nsm_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			BUL_nsm_medium_loyalty_increase_effect = yes
			BUL_nsm_medium_popularity_increase_effect = yes
			set_country_flag = BUL_nsm_joint_act_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_cooperation_faction_joint_act_cd_tt
		}
	}

	BUL_cooperation_bolster_zveno  = { #ZVENO Extra unique decision

		priority = 44

		icon = GFX_decision_bul_bolster_zveno

		ai_will_do = {
			base = 20
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_bolster_zveno_tt
				check_variable = { BUL_zveno_loyalty = 40 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_medium

		fire_only_once = yes

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_country_flag = BUL_factions_unlocked_flag
			has_completed_focus = BUL_cooperate_with_the_zveno
			NOT = { has_country_flag = BUL_zveno_integrated_flag }
			NOT = { has_country_flag = BUL_disposed_of_zveno_generals_flag }
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_cooperation_zveno_social_renovation_directory
			unlock_decision_tooltip = BUL_cooperation_fund_zveno
			unlock_decision_tooltip = BUL_cooperation_appoint_zveno_members
			BUL_zveno_low_loyalty_increase_effect = yes
			custom_effect_tooltip = available_chief_of_army
			show_ideas_tooltip = BUL_kiril_stanchev
			custom_effect_tooltip = available_military_high_command
			show_ideas_tooltip = BUL_stoyan_trendafilov
			show_ideas_tooltip = BUL_vladimir_stoychev
			show_ideas_tooltip = BUL_gancho_manchev
			set_country_flag = BUL_zveno_bolstered_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag

			#Add days to Zveno Coup timer if active
			if = {
				limit = {
					has_active_mission = BUL_impending_zveno_coup
				}
				add_days_mission_timeout = {
					mission = BUL_impending_zveno_coup
					days = BUL_zveno_coup_timer_delay_medium
				}
			}

			custom_effect_tooltip = BUL_legalize_faction_prevents_oppression_tt
		}
	}

	BUL_cooperation_zveno_social_renovation_directory  = { #ZVENO Legalize Faction equivalent

		priority = 45

		icon = GFX_decision_bul_legalize_zveno

		ai_will_do = {
			base = 20
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_legalize_faction_tt
				check_variable = { BUL_zveno_loyalty = 50 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		fire_only_once = yes

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_completed_focus = BUL_cooperate_with_the_zveno
			check_variable = { BUL_zveno_loyalty = 35 compare = greater_than_or_equals }
			has_country_flag = BUL_zveno_bolstered_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_zveno_integrated_flag }
			NOT = { has_country_flag = BUL_disposed_of_zveno_generals_flag }
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			add_stability = 0.1
			add_war_support = -0.05
			BUL_zveno_high_loyalty_increase_effect = yes
			BUL_zveno_low_popularity_increase_effect = yes
			set_country_flag = BUL_zveno_legalized_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag

			#Add days to Zveno Coup timer if active
			if = {
				limit = {
					has_active_mission = BUL_impending_zveno_coup
				}
				add_days_mission_timeout = {
					mission = BUL_impending_zveno_coup
					days = BUL_zveno_coup_timer_delay_medium
				}
			}
		}
	}

	BUL_cooperation_bs_legalize_faction  = { #BROAD SOCIALISTS Legalize Faction

		priority = 35

		icon = GFX_decision_bul_legalize_bs

		ai_will_do = {
			base = 10
			modifier = {
				factor = 0.1
				BUL_is_historical_ai = yes #Not a prio thing for Boris
			}
			modifier = {
				factor = 0
				OR = {
					BUL_is_fascist_axis_ai = yes
					BUL_is_monarchist_ferdinand_ai = yes
					BUL_is_democratic_liberal_ai = yes
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_legalize_faction_tt
				check_variable = { BUL_bs_loyalty = 50 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			NOT = {
				focus_progress = {
					focus = BUL_crush_the_communists
					progress > 0
				}
			}
		}

		days_remove = BUL_faction_days_remove_high

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_completed_focus = BUL_crush_the_communists
					focus_progress = {
						focus = BUL_crush_the_communists
						progress > 0
					}
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			OR = {
				has_completed_focus = BUL_oppose_the_royal_dictatorship
				has_completed_focus = BUL_freedom_of_press
			}
			check_variable = { BUL_bs_loyalty = 35 compare = greater_than_or_equals }
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_completed_focus = BUL_crush_the_communists }
			NOT = { has_country_flag = BUL_bs_integrated_flag }
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
			NOT = { has_country_flag = BUL_bs_media_banned_flag }
			NOT = { has_country_flag = BUL_bs_legalized_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_cooperation_fund_bs
			unlock_decision_tooltip = BUL_cooperation_appoint_bs_members
			BUL_bs_medium_loyalty_increase_effect = yes
			BUL_bs_medium_popularity_increase_effect = yes
			set_country_flag = BUL_bs_legalized_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_legalize_faction_prevents_oppression_tt
		}
	}

	BUL_cooperation_bzns_legalize_faction  = { #AGRARIAN UNION Legalize Faction

		priority = 25

		icon = GFX_decision_bul_legalize_bzns

		ai_will_do = {
			base = 10
			modifier = {
				factor = 0
				BUL_is_fascist_axis_ai = yes
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_legalize_faction_tt
				check_variable = { BUL_bzns_loyalty = 50 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		fire_only_once = yes

		cancel_trigger = {
			hidden_trigger = {
				has_completed_focus = BUL_legalize_the_agrarian_party
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			OR = {
				has_completed_focus = BUL_oppose_the_royal_dictatorship
				has_completed_focus = BUL_power_to_the_tsar
			}
			check_variable = { BUL_bzns_loyalty = 35 compare = greater_than_or_equals }
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_integrated_flag }
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
			NOT = { has_country_flag = BUL_bzns_media_banned_flag }
			NOT = { has_country_flag = BUL_bzns_legalized_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_cooperation_fund_bzns
			unlock_decision_tooltip = BUL_cooperation_appoint_bzns_members
			BUL_bzns_medium_loyalty_increase_effect = yes
			BUL_bzns_medium_popularity_increase_effect = yes
			set_country_flag = BUL_bzns_legalized_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_legalize_faction_prevents_oppression_tt
		}
	}

	BUL_cooperation_nsm_legalize_faction  = { #NATIONAL SOCIAL MOVEMENT Legalize Faction

		priority = 15

		icon = GFX_decision_bul_legalize_nsm

		ai_will_do = {
			base = 10
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_legalize_faction_tt
				check_variable = { BUL_nsm_loyalty = 50 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		fire_only_once = yes

		cancel_trigger = {
			hidden_trigger = {
				has_completed_focus = BUL_allow_far_right_organizations
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			OR = {
				has_completed_focus = BUL_restrained_paramilitary_organizations
				has_completed_focus = BUL_appoint_right_wing_ministers
			}
			check_variable = { BUL_nsm_loyalty = 35 compare = greater_than_or_equals }
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_integrated_flag }
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
			NOT = { has_country_flag = BUL_nsm_media_banned_flag }
			NOT = { has_country_flag = BUL_nsm_legalized_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_cooperation_fund_nsm
			unlock_decision_tooltip = BUL_cooperation_appoint_nsm_members
			BUL_nsm_medium_loyalty_increase_effect = yes
			BUL_nsm_medium_popularity_increase_effect = yes
			set_country_flag = BUL_nsm_legalized_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_legalize_faction_prevents_oppression_tt
		}
	}

	BUL_cooperation_fund_zveno = { # Fund ZVENO

		priority = 46

		icon = GFX_decision_bul_fund_zveno

		ai_will_do = {
			base = 5
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		days_re_enable = BUL_faction_days_reenable_high

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_country_flag = BUL_zveno_bolstered_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_zveno_integrated_flag }		
			NOT = { has_country_flag = BUL_disposed_of_zveno_generals_flag }
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			set_country_flag = BUL_fund_zveno_flag
			BUL_zveno_high_loyalty_increase_effect = yes
			BUL_zveno_medium_popularity_increase_effect = yes
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_cooperation_fund_faction_cd_tt

			#Add days to Zveno Coup timer if active
			if = {
				limit = {
					has_active_mission = BUL_impending_zveno_coup
				}
				add_days_mission_timeout = {
					mission = BUL_impending_zveno_coup
					days = BUL_zveno_coup_timer_delay_low
				}
			}
		}
	}

	BUL_cooperation_fund_bs = { # Fund BROAD SOCIALISTS

		priority = 36

		icon = GFX_decision_bul_fund_bs

		ai_will_do = {
			base = 3
			modifier = {
				factor = 1.5
				OR = {
					BUL_is_communist_stalinist_ai = yes
					BUL_is_communist_balkan_ai = yes
					BUL_is_democratic_socialist_ai = yes
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		days_re_enable = BUL_faction_days_reenable_high

		visible = {
			has_country_flag = BUL_bs_legalized_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_completed_focus = BUL_crush_the_communists }
			NOT = { has_country_flag = BUL_bs_integrated_flag }
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
			NOT = { has_country_flag = BUL_bs_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			set_country_flag = BUL_fund_bs_flag
			BUL_bs_high_loyalty_increase_effect = yes
			BUL_bs_medium_popularity_increase_effect = yes
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_cooperation_fund_faction_cd_tt
		}
	}

	BUL_cooperation_fund_bzns = { # Fund AGRARIAN UNION

		priority = 26

		icon = GFX_decision_bul_fund_bzns

		ai_will_do = {
			base = 3
			modifier = {
				factor = 1.5
				OR = {
					BUL_is_communist_stalinist_ai = yes
					BUL_is_communist_balkan_ai = yes
					BUL_is_democratic_socialist_ai = yes
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		days_re_enable = BUL_faction_days_reenable_high

		visible = {
			has_country_flag = BUL_bzns_legalized_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_integrated_flag }
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
			NOT = { has_country_flag = BUL_bzns_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			set_country_flag = BUL_fund_bzns_flag
			BUL_bzns_high_loyalty_increase_effect = yes
			BUL_bzns_medium_popularity_increase_effect = yes
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_cooperation_fund_faction_cd_tt
		}
	}

	BUL_cooperation_fund_nsm = { # Fund NATIONAL SOCIAL MOVEMENT

		priority = 16

		icon = GFX_decision_bul_fund_nsm

		ai_will_do = {
			base = 3
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		days_re_enable = BUL_faction_days_reenable_high

		visible = {
			has_country_flag = BUL_nsm_legalized_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_integrated_flag }
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
			NOT = { has_country_flag = BUL_nsm_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			set_country_flag = BUL_fund_nsm_flag
			BUL_nsm_high_loyalty_increase_effect = yes
			BUL_nsm_medium_popularity_increase_effect = yes
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_cooperation_fund_faction_cd_tt
		}
	}

	BUL_cooperation_appoint_zveno_members = { # Appoint ZVENO Members

		priority = 47

		icon = GFX_decision_bul_appoint_members_zveno

		ai_will_do = {
			base = 10
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_appoint_faction_members_tt
				check_variable = { BUL_zveno_loyalty = 75 compare = greater_than_or_equals }
				check_variable = { BUL_zveno_popularity = 60 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		fire_only_once = yes

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_country_flag = BUL_zveno_bolstered_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_zveno_integrated_flag }
			NOT = { has_country_flag = BUL_disposed_of_zveno_generals_flag }
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			custom_effect_tooltip = available_political_advisor
			show_ideas_tooltip = BUL_kimon_georgiev
			unlock_decision_tooltip = BUL_cooperation_integrate_zveno
			BUL_zveno_medium_loyalty_increase_effect = yes
			BUL_zveno_medium_popularity_increase_effect = yes
			set_country_flag = BUL_appointed_zveno_members_flag
			if = {
				limit = {
					NOT = { has_country_flag = BUL_bs_destroyed_flag }
					NOT = { has_country_flag = BUL_bs_integrated_flag }
				}
				BUL_bs_low_loyalty_decrease_effect = yes
			}
			if = {
				limit = {
					NOT = { has_country_flag = BUL_bzns_destroyed_flag }
					NOT = { has_country_flag = BUL_bzns_integrated_flag }
				}
				BUL_bzns_low_loyalty_decrease_effect = yes
			}
			if = {
				limit = {
					NOT = { has_country_flag = BUL_nsm_destroyed_flag }
					NOT = { has_country_flag = BUL_nsm_integrated_flag }
				}
				BUL_nsm_low_loyalty_decrease_effect = yes
			}
			clr_country_flag = BUL_internal_affairs_ongoing_flag

			#Add days to Zveno Coup timer if active
			if = {
				limit = {
					has_active_mission = BUL_impending_zveno_coup
				}
				add_days_mission_timeout = {
					mission = BUL_impending_zveno_coup
					days = BUL_zveno_coup_timer_delay_high
				}
			}
		}
	}

	BUL_cooperation_appoint_bs_members = { # Appoint BROAD SOCIALISTS Members

		priority = 37

		icon = GFX_decision_bul_appoint_members_bs

		ai_will_do = {
			base = 10
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_appoint_faction_members_tt
				check_variable = { BUL_bs_loyalty = 75 compare = greater_than_or_equals }
				check_variable = { BUL_bs_popularity = 60 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_bs_legalized_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_completed_focus = BUL_crush_the_communists }
			NOT = { has_country_flag = BUL_bs_integrated_flag }
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
			NOT = { has_country_flag = BUL_bs_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			custom_effect_tooltip = available_political_advisor
			show_ideas_tooltip = BUL_todor_pavlov
			unlock_decision_tooltip = BUL_cooperation_integrate_bs
			BUL_bs_medium_loyalty_increase_effect = yes
			BUL_bs_medium_popularity_increase_effect = yes
			set_country_flag = BUL_appointed_bs_members_flag
			if = {
				limit = {
					NOT = { has_country_flag = BUL_zveno_destroyed_flag }
					NOT = { has_country_flag = BUL_zveno_integrated_flag }
				}
				BUL_zveno_low_loyalty_decrease_effect = yes
			}
			if = {
				limit = {
					NOT = { has_country_flag = BUL_bzns_destroyed_flag }
					NOT = { has_country_flag = BUL_bzns_integrated_flag }
				}
				BUL_bzns_low_loyalty_decrease_effect = yes
			}
			if = {
				limit = {
					NOT = { has_country_flag = BUL_nsm_destroyed_flag }
					NOT = { has_country_flag = BUL_nsm_integrated_flag }
				}
				BUL_nsm_low_loyalty_decrease_effect = yes
			}
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}
	}

	BUL_cooperation_appoint_bzns_members = { # Appoint AGRARIAN UNION Members

		priority = 27

		icon = GFX_decision_bul_appoint_members_bzns

		ai_will_do = {
			base = 10
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_appoint_faction_members_tt
				check_variable = { BUL_bzns_loyalty = 75 compare = greater_than_or_equals }
				check_variable = { BUL_bzns_popularity = 60 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_bzns_legalized_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_integrated_flag }
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
			NOT = { has_country_flag = BUL_bzns_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			custom_effect_tooltip = available_political_advisor
			show_ideas_tooltip = BUL_nikola_petkov
			unlock_decision_tooltip = BUL_cooperation_integrate_bzns
			BUL_bzns_medium_loyalty_increase_effect = yes
			BUL_bzns_medium_popularity_increase_effect = yes
			set_country_flag = BUL_appointed_bzns_members_flag
			if = {
				limit = {
					NOT = { has_country_flag = BUL_zveno_destroyed_flag }
					NOT = { has_country_flag = BUL_zveno_integrated_flag }
				}
				BUL_zveno_low_loyalty_decrease_effect = yes
			}
			if = {
				limit = {
					NOT = { has_country_flag = BUL_bs_destroyed_flag }
					NOT = { has_country_flag = BUL_bs_integrated_flag }
				}
				BUL_bs_low_loyalty_decrease_effect = yes
			}
			if = {
				limit = {
					NOT = { has_country_flag = BUL_nsm_destroyed_flag }
					NOT = { has_country_flag = BUL_nsm_integrated_flag }
				}
				BUL_nsm_low_loyalty_decrease_effect = yes
			}
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}
	}

	BUL_cooperation_appoint_nsm_members = { # Appoint NATIONAL SOCIAL MOVEMENT Members

		priority = 17

		icon = GFX_decision_bul_appoint_members_nsm

		ai_will_do = {
			base = 10
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_appoint_faction_members_tt
				check_variable = { BUL_nsm_loyalty = 75 compare = greater_than_or_equals }
				check_variable = { BUL_nsm_popularity = 60 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_nsm_legalized_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_integrated_flag }
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
			NOT = { has_country_flag = BUL_nsm_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			custom_effect_tooltip = available_political_advisor
			show_ideas_tooltip = BUL_aleksandar_tsankov
			unlock_decision_tooltip = BUL_cooperation_integrate_nsm
			BUL_nsm_medium_loyalty_increase_effect = yes
			BUL_nsm_medium_popularity_increase_effect = yes
			set_country_flag = BUL_appointed_nsm_members_flag
			if = {
				limit = {
					NOT = { has_country_flag = BUL_zveno_destroyed_flag }
					NOT = { has_country_flag = BUL_zveno_integrated_flag }
				}
				BUL_zveno_low_loyalty_decrease_effect = yes
			}
			if = {
				limit = {
					NOT = { has_country_flag = BUL_bs_destroyed_flag }
					NOT = { has_country_flag = BUL_bs_integrated_flag }
				}
				BUL_bs_low_loyalty_decrease_effect = yes
			}
			if = {
				limit = {
					NOT = { has_country_flag = BUL_bzns_destroyed_flag }
					NOT = { has_country_flag = BUL_bzns_integrated_flag }
				}
				BUL_bzns_low_loyalty_decrease_effect = yes
			}
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}
	}

	BUL_cooperation_integrate_zveno = { # Integrate ZVENO

		priority = 48

		icon = GFX_decision_bul_integrate_zveno

		ai_will_do = {
			base = 100
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_integrate_faction_tt
				check_variable = { BUL_zveno_loyalty = 100 compare = greater_than_or_equals }
				check_variable = { BUL_zveno_popularity = 75 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_very_high

		fire_only_once = yes

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_country_flag = BUL_appointed_zveno_members_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_zveno_integrated_flag }
			NOT = { has_country_flag = BUL_disposed_of_zveno_generals_flag }
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			country_event = bftb_bulgaria_factions.17
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			clr_country_flag = BUL_speech_zveno_flag
			clr_country_flag = BUL_zveno_joint_act_flag
			clr_country_flag = BUL_fund_zveno_flag
			set_country_flag = BUL_zveno_integrated_flag
			effect_tooltip = {
				add_political_power = 120
				add_stability = 0.1
				if = {
					limit = {
						NOT = { has_country_flag = BUL_bs_destroyed_flag }
						NOT = { has_country_flag = BUL_bs_integrated_flag }
					}
					BUL_bs_medium_loyalty_decrease_effect = yes
				}
				if = {
					limit = {
						NOT = { has_country_flag = BUL_bzns_destroyed_flag }
						NOT = { has_country_flag = BUL_bzns_integrated_flag }
					}
					BUL_bzns_medium_loyalty_decrease_effect = yes
				}
				if = {
					limit = {
						NOT = { has_country_flag = BUL_nsm_destroyed_flag }
						NOT = { has_country_flag = BUL_nsm_integrated_flag }
					}
					BUL_nsm_medium_loyalty_decrease_effect = yes
				}
			}
		}
	}

	BUL_cooperation_integrate_bs = { # Integrate BROAD SOCIALISTS

		priority = 38

		icon = GFX_decision_bul_integrate_bs

		ai_will_do = {
			base = 100
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_integrate_faction_tt
				check_variable = { BUL_bs_loyalty = 100 compare = greater_than_or_equals }
				check_variable = { BUL_bs_popularity = 75 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_very_high

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_appointed_bs_members_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_completed_focus = BUL_crush_the_communists }
			NOT = { has_country_flag = BUL_bs_integrated_flag }
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
			NOT = { has_country_flag = BUL_bs_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			country_event = bftb_bulgaria_factions.27
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			clr_country_flag = BUL_speech_bs_flag
			clr_country_flag = BUL_bs_joint_act_flag
			clr_country_flag = BUL_fund_bs_flag
			set_country_flag = BUL_bs_integrated_flag
			effect_tooltip = {
				add_political_power = 120
				add_stability = 0.1
				if = {
					limit = {
						NOT = { has_country_flag = BUL_zveno_destroyed_flag }
						NOT = { has_country_flag = BUL_zveno_integrated_flag }
					}
					BUL_zveno_medium_loyalty_decrease_effect = yes
				}
				if = {
					limit = {
						NOT = { has_country_flag = BUL_bzns_destroyed_flag }
						NOT = { has_country_flag = BUL_bzns_integrated_flag }
					}
					BUL_bzns_medium_loyalty_decrease_effect = yes
				}
				if = {
					limit = {
						NOT = { has_country_flag = BUL_nsm_destroyed_flag }
						NOT = { has_country_flag = BUL_nsm_integrated_flag }
					}
					BUL_nsm_medium_loyalty_decrease_effect = yes
				}
			}
		}
	}

	BUL_cooperation_integrate_bzns = { # Integrate AGRARIAN UNION

		priority = 28

		icon = GFX_decision_bul_integrate_bzns

		ai_will_do = {
			base = 100
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_integrate_faction_tt
				check_variable = { BUL_bzns_loyalty = 100 compare = greater_than_or_equals }
				check_variable = { BUL_bzns_popularity = 75 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_very_high

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_appointed_bzns_members_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_integrated_flag }
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
			NOT = { has_country_flag = BUL_bzns_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			country_event = bftb_bulgaria_factions.37
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			clr_country_flag = BUL_speech_bzns_flag
			clr_country_flag = BUL_bzns_joint_act_flag
			clr_country_flag = BUL_fund_bzns_flag
			set_country_flag = BUL_bzns_integrated_flag
			effect_tooltip = {
				add_political_power = 120
				add_stability = 0.1
				if = {
					limit = {
						NOT = { has_country_flag = BUL_zveno_destroyed_flag }
						NOT = { has_country_flag = BUL_zveno_integrated_flag }
					}
					BUL_zveno_medium_loyalty_decrease_effect = yes
				}
				if = {
					limit = {
						NOT = { has_country_flag = BUL_bs_destroyed_flag }
						NOT = { has_country_flag = BUL_bs_integrated_flag }
					}
					BUL_bs_medium_loyalty_decrease_effect = yes
				}
				if = {
					limit = {
						NOT = { has_country_flag = BUL_nsm_destroyed_flag }
						NOT = { has_country_flag = BUL_nsm_integrated_flag }
					}
					BUL_nsm_medium_loyalty_decrease_effect = yes
				}
			}
		}
	}

	BUL_cooperation_integrate_nsm = { # Integrate NATIONAL SOCIAL MOVEMENT

		priority = 18

		icon = GFX_decision_bul_integrate_nsm

		ai_will_do = {
			base = 100
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_cooperation_integrate_faction_tt
				check_variable = { BUL_nsm_loyalty = 100 compare = greater_than_or_equals }
				check_variable = { BUL_nsm_popularity = 75 compare = greater_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_very_high

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_appointed_nsm_members_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_integrated_flag }
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
			NOT = { has_country_flag = BUL_nsm_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			country_event = bftb_bulgaria_factions.47
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			clr_country_flag = BUL_speech_nsm_flag
			clr_country_flag = BUL_nsm_joint_act_flag
			clr_country_flag = BUL_fund_nsm_flag
			set_country_flag = BUL_nsm_integrated_flag
			effect_tooltip = {
				add_political_power = 120
				add_stability = 0.1
				if = {
					limit = {
						NOT = { has_country_flag = BUL_zveno_destroyed_flag }
						NOT = { has_country_flag = BUL_zveno_integrated_flag }
					}
					BUL_zveno_medium_loyalty_decrease_effect = yes
				}
				if = {
					limit = {
						NOT = { has_country_flag = BUL_bs_destroyed_flag }
						NOT = { has_country_flag = BUL_bs_integrated_flag }
					}
					BUL_bs_medium_loyalty_decrease_effect = yes
				}
				if = {
					limit = {
						NOT = { has_country_flag = BUL_bzns_destroyed_flag }
						NOT = { has_country_flag = BUL_bzns_integrated_flag }
					}
					BUL_bzns_medium_loyalty_decrease_effect = yes
				}
			}
		}
	}


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


	BUL_opression_discredit_zveno_leaders  = { # Discredit ZVENO Leaders

		priority = 40

		icon = GFX_decision_bul_discredit_zveno

		ai_will_do = {
			base = 5
			modifier = {
				factor = 1000
				has_country_flag = BUL_impending_zveno_coup
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_very_low

		days_re_enable = BUL_faction_days_reenable_low

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_completed_focus = BUL_dissolve_the_military_union
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_zveno_bolstered_flag }
			NOT = { has_country_flag = BUL_disposed_of_zveno_generals_flag }
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
			if = { 
				limit = {
					has_country_flag = BUL_speech_zveno_flag
				}
				clr_country_flag = BUL_speech_zveno_flag
			}
			if = { 
				limit = {
					has_country_flag = BUL_zveno_joint_act_flag
				}
				clr_country_flag = BUL_zveno_joint_act_flag
			}
		}

		remove_effect = {
			BUL_zveno_medium_loyalty_decrease_effect = yes
			BUL_zveno_medium_popularity_decrease_effect = yes
			set_country_flag = BUL_discredited_zveno_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_opression_discredit_faction_leaders_cd_tt
		}
	}

	BUL_opression_discredit_bs_leaders  = { # Discredit BROAD SOCIALISTS Leaders

		priority = 30

		icon = GFX_decision_bul_discredit_bs

		ai_will_do = {
			base = 0
			modifier = {
				add = 2
				OR = {
					BUL_is_fascist_axis_ai = yes
					BUL_is_monarchist_ferdinand_ai = yes
					BUL_is_democratic_liberal_ai = yes
					#AND = { #MM: Check how the AI performs without this. Might be necessary to not add it to help the FF coup.
					#	BUL_is_historical_ai = yes
					#	date > 1940.6.1
					#}
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_very_low

		days_re_enable = BUL_faction_days_reenable_low

		visible = {
			OR = {
				has_completed_focus = BUL_oppose_the_royal_dictatorship
				has_completed_focus = BUL_power_to_the_tsar
			}
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bs_legalized_flag }
			NOT = { has_country_flag = BUL_bs_media_banned_flag }
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
		}

		cost = BUL_broad_socialist_opression_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
			if = { 
				limit = {
					has_country_flag = BUL_speech_bs_flag
				}
				clr_country_flag = BUL_speech_bs_flag
			}
			if = { 
				limit = {
					has_country_flag = BUL_bs_joint_act_flag
				}
				clr_country_flag = BUL_bs_joint_act_flag
			}
		}

		remove_effect = {
			BUL_bs_medium_loyalty_decrease_effect = yes
			BUL_bs_medium_popularity_decrease_effect = yes
			set_country_flag = BUL_discredited_bs_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_opression_discredit_faction_leaders_cd_tt
		}
	}

	BUL_opression_discredit_bzns_leaders  = { # Discredit AGRARIAN UNION Leaders

		priority = 20

		icon = GFX_decision_bul_discredit_bzns

		ai_will_do = {
			base = 0
			modifier = {
				add = 2
				BUL_is_fascist_axis_ai = yes
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_very_low

		days_re_enable = BUL_faction_days_reenable_low

		visible = {
			OR = {
				has_completed_focus = BUL_oppose_the_royal_dictatorship
				has_completed_focus = BUL_power_to_the_tsar
			}
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_legalized_flag }
			NOT = { has_country_flag = BUL_bzns_media_banned_flag }
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
			if = { 
				limit = {
					has_country_flag = BUL_speech_bzns_flag
				}
				clr_country_flag = BUL_speech_bzns_flag
			}
			if = { 
				limit = {
					has_country_flag = BUL_bzns_joint_act_flag
				}
				clr_country_flag = BUL_bzns_joint_act_flag
			}
		}

		remove_effect = {
			BUL_bzns_medium_loyalty_decrease_effect = yes
			BUL_bzns_medium_popularity_decrease_effect = yes
			set_country_flag = BUL_discredited_bzns_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_opression_discredit_faction_leaders_cd_tt
		}
	}

	BUL_opression_discredit_nsm_leaders  = { # Discredit NATIONAL SOCIAL MOVEMENT Leaders

		priority = 10

		icon = GFX_decision_bul_discredit_nsm

		ai_will_do = {
			base = 2
			modifier = {
				factor = 0
				BUL_is_fascist_axis_ai = yes
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_very_low

		days_re_enable = BUL_faction_days_reenable_low

		visible = {
			OR = {
				has_completed_focus = BUL_appoint_communist_ministers
				has_completed_focus = BUL_ban_far_right_organizations
				has_completed_focus = BUL_appoint_right_wing_ministers
			}
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_legalized_flag }
			NOT = { has_country_flag = BUL_nsm_media_banned_flag }
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
				if = { 
				limit = {
					has_country_flag = BUL_speech_nsm_flag
				}
				clr_country_flag = BUL_speech_nsm_flag
			}
			if = { 
				limit = {
					has_country_flag = BUL_nsm_joint_act_flag
				}
				clr_country_flag = BUL_nsm_joint_act_flag
			}
		}

		remove_effect = {
			BUL_nsm_medium_loyalty_decrease_effect = yes
			BUL_nsm_medium_popularity_decrease_effect = yes
			set_country_flag = BUL_discredited_nsm_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_opression_discredit_faction_leaders_cd_tt
		}
	}

	BUL_opression_dispose_of_zveno_generals  = { #ZVENO Ban Media equivalent

		priority = 41

		icon = GFX_decision_bul_ban_media_zveno

		ai_will_do = {
			base = 20
			modifier = {
				factor = 1000
				has_country_flag = BUL_impending_zveno_coup
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_oppression_ban_faction_media_tt
				check_variable = { BUL_zveno_popularity = 50 compare = less_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_low

		fire_only_once = yes

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_completed_focus = BUL_dissolve_the_military_union
			check_variable = { BUL_zveno_popularity = 65 compare = less_than_or_equals }
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_zveno_bolstered_flag }
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
			NOT = { has_country_flag = BUL_disposed_of_zveno_generals_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_opression_anti_zveno_speech
			unlock_decision_tooltip = BUL_opression_imprison_zveno_leaders
			BUL_zveno_medium_loyalty_decrease_effect = yes
			every_unit_leader = {
				limit = {
					has_trait = trait_BUL_zveno_member
				}
				retire = yes
			}
			set_country_flag = BUL_disposed_of_zveno_generals_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_ban_media_prevents_cooperation_tt

			#Add days to Zveno Coup timer if active
			if = {
				limit = {
					has_active_mission = BUL_impending_zveno_coup
				}
				add_days_mission_timeout = {
					mission = BUL_impending_zveno_coup
					days = BUL_zveno_coup_timer_delay_medium
				}
			}
		}
	}


	BUL_opression_ban_bs_media  = { #BROAD SOCIALISTS Ban Media

		priority = 31

		icon = GFX_decision_bul_ban_media_bs

		ai_will_do = {
			base = 0.5
			modifier = {
				add = 2
				OR = {
					BUL_is_fascist_axis_ai = yes
					BUL_is_monarchist_ferdinand_ai = yes
					BUL_is_democratic_liberal_ai = yes
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			custom_trigger_tooltip = {
				tooltip = BUL_oppression_ban_faction_media_tt
				check_variable = { BUL_bs_popularity = 50 compare = less_than_or_equals }
			}
			if = {
				limit = {
					has_completed_focus = BUL_freedom_of_press
				}
				custom_trigger_tooltip = {
					tooltip = BUL_oppression_ban_faction_media_freedom_of_press_tt
					has_country_flag = {
						flag = BUL_freedom_of_press_flag
						days > 365
					}
				}
			}
			else = {
				NOT = {
					focus_progress = {
						focus = BUL_freedom_of_press
						progress > 0
					}
				}
				custom_trigger_tooltip = {
					tooltip = BUL_oppression_ban_faction_media_freedom_of_press_tt
					OR = {
						has_country_flag = {
							flag = BUL_freedom_of_press_flag
							days > 365
						}
						focus_progress = {
							focus = BUL_freedom_of_press
							progress < 1
						}
					}
				}
			}
		}

		days_remove = BUL_faction_days_remove_low

		cancel_trigger = {
			hidden_trigger = {
				focus_progress = {
					focus = BUL_freedom_of_press
					progress > 0
				}
				focus_progress = {
					focus = BUL_freedom_of_press
					progress < 1
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			OR = {
				has_completed_focus = BUL_oppose_the_royal_dictatorship
				has_completed_focus = BUL_power_to_the_tsar
			}
			check_variable = { BUL_bs_popularity = 65 compare = less_than_or_equals }
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bs_legalized_flag }
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
			NOT = { has_country_flag = BUL_bs_media_banned_flag }
		}

		cost = BUL_broad_socialist_opression_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_opression_anti_bs_speech
			unlock_decision_tooltip = BUL_opression_imprison_bs_leaders
			BUL_bs_low_loyalty_decrease_effect = yes
			BUL_bs_medium_popularity_decrease_effect = yes
			set_country_flag = BUL_bs_media_banned_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_ban_media_prevents_cooperation_tt
		}
	}

	BUL_opression_ban_bzns_media  = { #AGRARIAN UNION Ban Media

		priority = 21

		icon = GFX_decision_bul_ban_media_bzns

		ai_will_do = {
			base = 0
			modifier = {
				add = 2.5
				BUL_is_fascist_axis_ai = yes
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			custom_trigger_tooltip = {
				tooltip = BUL_oppression_ban_faction_media_tt
				check_variable = { BUL_bzns_popularity = 50 compare = less_than_or_equals }
			}
			if = {
				limit = {
					has_completed_focus = BUL_freedom_of_press
				}
				custom_trigger_tooltip = {
					tooltip = BUL_oppression_ban_faction_media_freedom_of_press_tt
					has_country_flag = {
						flag = BUL_freedom_of_press_flag
						days > 365
					}
				}
			}
			else = {
				NOT = {
					focus_progress = {
						focus = BUL_freedom_of_press
						progress > 0
					}
				}
				custom_trigger_tooltip = {
					tooltip = BUL_oppression_ban_faction_media_freedom_of_press_tt
					OR = {
						has_country_flag = {
							flag = BUL_freedom_of_press_flag
							days > 365
						}
						focus_progress = {
							focus = BUL_freedom_of_press
							progress < 1
						}
					}
				}
			}
		}

		days_remove = BUL_faction_days_remove_low

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					AND = {
						focus_progress = {
							focus = BUL_freedom_of_press
							progress > 0
						}
						focus_progress = {
							focus = BUL_freedom_of_press
							progress < 1
						}
					}
					focus_progress = {
						focus = BUL_legalize_the_agrarian_party
						progress > 0
					}
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			OR = {
				has_completed_focus = BUL_oppose_the_royal_dictatorship
				has_completed_focus = BUL_power_to_the_tsar
			}
			check_variable = { BUL_bzns_popularity = 65 compare = less_than_or_equals }
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_legalized_flag }
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
			NOT = { has_country_flag = BUL_bzns_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_opression_anti_bzns_speech
			unlock_decision_tooltip = BUL_opression_imprison_bzns_leaders
			BUL_bzns_low_loyalty_decrease_effect = yes
			BUL_bzns_medium_popularity_decrease_effect = yes
			set_country_flag = BUL_bzns_media_banned_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_ban_media_prevents_cooperation_tt
		}
	}

	BUL_opression_ban_nsm_media  = { #NATIONAL SOCIAL MOVEMENT Ban Media

		priority = 11

		icon = GFX_decision_bul_ban_media_nsm

		ai_will_do = {
			base = 2.5
			modifier = {
				factor = 0
				OR = {
					BUL_is_fascist_axis_ai = yes
					BUL_is_monarchist_ferdinand_ai = yes
					BUL_is_democratic_liberal_ai = yes
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			custom_trigger_tooltip = {
				tooltip = BUL_oppression_ban_faction_media_tt
				check_variable = { BUL_nsm_popularity = 50 compare = less_than_or_equals }
			}
			if = {
				limit = {
					has_completed_focus = BUL_freedom_of_press
				}
				custom_trigger_tooltip = {
					tooltip = BUL_oppression_ban_faction_media_freedom_of_press_tt
					has_country_flag = {
						flag = BUL_freedom_of_press_flag
						days > 365
					}
				}
			}
			else = {
				NOT = {
					focus_progress = {
						focus = BUL_freedom_of_press
						progress > 0
					}
				}
				custom_trigger_tooltip = {
					tooltip = BUL_oppression_ban_faction_media_freedom_of_press_tt
					OR = {
						has_country_flag = {
							flag = BUL_freedom_of_press_flag
							days > 365
						}
						focus_progress = {
							focus = BUL_freedom_of_press
							progress < 1
						}
					}
				}
			}
		}

		days_remove = BUL_faction_days_remove_low

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					AND = {
						focus_progress = {
							focus = BUL_freedom_of_press
							progress > 0
						}
						focus_progress = {
							focus = BUL_freedom_of_press
							progress < 1
						}
					}
					focus_progress = {
						focus = BUL_allow_far_right_organizations
						progress > 0
					}
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			OR = {
				has_completed_focus = BUL_appoint_communist_ministers
				has_completed_focus = BUL_ban_far_right_organizations
				has_completed_focus = BUL_appoint_right_wing_ministers
			}
			check_variable = { BUL_nsm_popularity = 65 compare = less_than_or_equals }
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_legalized_flag }
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
			NOT = { has_country_flag = BUL_nsm_media_banned_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_opression_anti_nsm_speech
			unlock_decision_tooltip = BUL_opression_imprison_nsm_leaders
			BUL_nsm_low_loyalty_decrease_effect = yes
			BUL_nsm_medium_popularity_decrease_effect = yes
			set_country_flag = BUL_nsm_media_banned_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_ban_media_prevents_cooperation_tt
		}
	}

	BUL_opression_anti_zveno_speech  = { #ZVENO Speech against organization

		priority = 43

		icon = GFX_decision_bul_against_zveno

		ai_will_do = {
			base = 10
			modifier = {
				factor = 1000
				has_country_flag = BUL_impending_zveno_coup
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_low

		days_re_enable = BUL_faction_days_reenable_medium

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_country_flag = BUL_disposed_of_zveno_generals_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
			NOT = { has_country_flag = BUL_zveno_bolstered_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			BUL_zveno_medium_loyalty_decrease_effect = yes
			BUL_zveno_medium_popularity_decrease_effect = yes
			set_country_flag = BUL_anti_zveno_speech_held_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_opression_anti_faction_speech_cd_tt

			#Add days to Zveno Coup timer if active
			if = {
				limit = {
					has_active_mission = BUL_impending_zveno_coup
				}
				add_days_mission_timeout = {
					mission = BUL_impending_zveno_coup
					days = BUL_zveno_coup_timer_delay_low
				}
			}
		}
	}

	BUL_opression_anti_bs_speech  = { #BROAD SOCIALISTS Speech against organization

		priority = 33

		icon = GFX_decision_bul_against_bs

		ai_will_do = {
			base = 3
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_low

		days_re_enable = BUL_faction_days_reenable_medium

		visible = {
			has_country_flag = BUL_bs_media_banned_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
			NOT = { has_country_flag = BUL_bs_legalized_flag }
		}

		cost = BUL_broad_socialist_opression_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			BUL_bs_medium_loyalty_decrease_effect = yes
			BUL_bs_medium_popularity_decrease_effect = yes
			set_country_flag = BUL_anti_bs_speech_held_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_opression_anti_faction_speech_cd_tt
		}
	}

	BUL_opression_anti_bzns_speech  = { #AGRARIAN UNION Speech against organization

		priority = 23

		icon = GFX_decision_bul_against_bzns

		ai_will_do = {
			base = 3
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_low

		days_re_enable = BUL_faction_days_reenable_medium

		visible = {
			has_country_flag = BUL_bzns_media_banned_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
			NOT = { has_country_flag = BUL_bzns_legalized_flag }		
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			BUL_bzns_medium_loyalty_decrease_effect = yes
			BUL_bzns_medium_popularity_decrease_effect = yes
			set_country_flag = BUL_anti_bzns_speech_held_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_opression_anti_faction_speech_cd_tt
		}
	}

	BUL_opression_anti_nsm_speech  = { #NATIONAL SOCIALIST MOVEMENT Speech against organization

		priority = 13

		icon = GFX_decision_bul_against_nsm

		ai_will_do = {
			base = 3
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_low

		days_re_enable = BUL_faction_days_reenable_medium

		visible = {
			has_country_flag = BUL_nsm_media_banned_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_legalized_flag }
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			BUL_nsm_medium_loyalty_decrease_effect = yes
			BUL_nsm_medium_popularity_decrease_effect = yes
			set_country_flag = BUL_anti_nsm_speech_held_flag
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_opression_anti_faction_speech_cd_tt
		}
	}

	BUL_opression_imprison_zveno_leaders = { #ZVENO Imprison leaders

		priority = 44

		icon = GFX_decision_bul_imprison_leaders_zveno

		ai_will_do = {
			base = 50
			modifier = {
				factor = 1000
				has_country_flag = BUL_impending_zveno_coup
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			custom_trigger_tooltip = {
				tooltip = BUL_oppression_imprison_faction_leaders_tt
				check_variable = { BUL_zveno_popularity = 35 compare = less_than_or_equals }
			}
			
		}

		days_remove = BUL_faction_days_remove_medium

		fire_only_once = yes

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_country_flag = BUL_disposed_of_zveno_generals_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
			NOT = { has_country_flag = BUL_zveno_bolstered_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		fixed_random_seed = no

		remove_effect = {
			set_country_flag = BUL_zveno_leaders_imprisoned_flag
			hidden_effect = {
				random_list = {
					60 = {
						country_event = { id = bftb_bulgaria_factions.53 hours = 4 random_hours = 2 }
					}
					30 = {
						country_event = { id = bftb_bulgaria_factions.54 hours = 4 random_hours = 2 }
					}
					10 = {
						country_event = { id = bftb_bulgaria_factions.55 hours = 4 random_hours = 2 }
					}
				}
			}
			effect_tooltip = {
				country_event = bftb_bulgaria_factions.53
			}
			unlock_decision_tooltip = BUL_opression_raid_zveno_supporters
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}
	}

	BUL_opression_imprison_bs_leaders = { #BROAD SOCIALISTS Imprison leaders

		priority = 34

		icon = GFX_decision_bul_imprison_leaders_bs

		ai_will_do = {
			base = 10
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			custom_trigger_tooltip = {
				tooltip = BUL_oppression_imprison_faction_leaders_tt
				check_variable = { BUL_bs_popularity = 35 compare = less_than_or_equals }
			}
		}

		days_remove = BUL_faction_days_remove_medium

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_bs_media_banned_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
			NOT = { has_country_flag = BUL_bs_legalized_flag }
		}

		cost = BUL_broad_socialist_opression_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		fixed_random_seed = no

		remove_effect = {
			set_country_flag = BUL_bs_leaders_imprisoned_flag
			hidden_effect = {
				random_list = {
					60 = {
						country_event = { id = bftb_bulgaria_factions.63 hours = 4 random_hours = 2 }
					}
					30 = {
						country_event = { id = bftb_bulgaria_factions.64 hours = 4 random_hours = 2 }
					}
					10 = {
						country_event = { id = bftb_bulgaria_factions.65 hours = 4 random_hours = 2 }
					}
				}
			}
			effect_tooltip = {
				country_event = bftb_bulgaria_factions.63
			}
			unlock_decision_tooltip = BUL_opression_raid_bs_supporters
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}
	}

	BUL_opression_imprison_bzns_leaders = { #AGRARIAN UNION Imprison leaders

		priority = 24

		icon = GFX_decision_bul_imprison_leaders_bzns

		ai_will_do = {
			base = 10
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			custom_trigger_tooltip = {
				tooltip = BUL_oppression_imprison_faction_leaders_tt
				check_variable = { BUL_bzns_popularity = 35 compare = less_than_or_equals }
			}
		}

		days_remove = BUL_faction_days_remove_medium

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_bzns_media_banned_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
			NOT = { has_country_flag = BUL_bzns_legalized_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		fixed_random_seed = no

		remove_effect = {
			set_country_flag = BUL_bzns_leaders_imprisoned_flag
			hidden_effect = {
				random_list = {
					60 = {
						country_event = { id = bftb_bulgaria_factions.73 hours = 4 random_hours = 2 }
					}
					30 = {
						country_event = { id = bftb_bulgaria_factions.74 hours = 4 random_hours = 2 }
					}
					10 = {
						country_event = { id = bftb_bulgaria_factions.75 hours = 4 random_hours = 2 }
					}
				}
			}
			effect_tooltip = {
				country_event = bftb_bulgaria_factions.73
			}
			unlock_decision_tooltip = BUL_opression_raid_bzns_supporters
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}
	}

	BUL_opression_imprison_nsm_leaders = { #NATIONAL SOCIAL MOVEMENT Imprison leaders

		priority = 14

		icon = GFX_decision_bul_imprison_leaders_nsm

		ai_will_do = {
			base = 10
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
			custom_trigger_tooltip = {
				tooltip = BUL_oppression_imprison_faction_leaders_tt
				check_variable = { BUL_nsm_popularity = 35 compare = less_than_or_equals }
			}
		}

		days_remove = BUL_faction_days_remove_medium

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_nsm_media_banned_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
			NOT = { has_country_flag = BUL_nsm_legalized_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		fixed_random_seed = no

		remove_effect = {
			set_country_flag = BUL_nsm_leaders_imprisoned_flag
			hidden_effect = {
				random_list = {
					60 = {
						country_event = { id = bftb_bulgaria_factions.83 hours = 4 random_hours = 2 }
					}
					30 = {
						country_event = { id = bftb_bulgaria_factions.84 hours = 4 random_hours = 2 }
					}
					10 = {
						country_event = { id = bftb_bulgaria_factions.85 hours = 4 random_hours = 2 }
					}
				}
			}
			effect_tooltip = {
				country_event = bftb_bulgaria_factions.83
			}
			unlock_decision_tooltip = BUL_opression_raid_nsm_supporters
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}
	}

	BUL_opression_raid_zveno_supporters  = { # Raid ZVENO Supporters

		ai_will_do = {
			base = 30
			modifier = {
				factor = 1000
				has_country_flag = BUL_impending_zveno_coup
			}
		}

		priority = 45

		icon = GFX_decision_bul_raid_zveno

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_opression_raid_faction_supporters_tt
				check_variable = { BUL_zveno_popularity = 25 compare = less_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		days_re_enable = BUL_faction_days_reenable_very_high

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_country_flag = BUL_zveno_leaders_imprisoned_flag
			has_country_flag = BUL_factions_unlocked_flag		
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
			NOT = { has_country_flag = BUL_zveno_bolstered_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_opression_destroy_zveno
			set_country_flag = BUL_raided_zveno_supporters_flag
			BUL_zveno_medium_loyalty_decrease_effect = yes
			BUL_zveno_high_popularity_decrease_effect = yes
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_opression_raid_faction_supporters_cd_tt

			#Add days to Zveno Coup timer if active
			if = {
				limit = {
					has_active_mission = BUL_impending_zveno_coup
				}
				add_days_mission_timeout = {
					mission = BUL_impending_zveno_coup
					days = BUL_zveno_coup_timer_delay_high
				}
			}
		}
	}

	BUL_opression_raid_bs_supporters  = { # Raid BROAD SOCIALISTS Supporters

		priority = 35

		icon = GFX_decision_bul_raid_bs

		ai_will_do = {
			base = 5
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_opression_raid_faction_supporters_tt
				check_variable = { BUL_bs_popularity = 25 compare = less_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		days_re_enable = BUL_faction_days_reenable_very_high

		visible = {
			has_country_flag = BUL_bs_leaders_imprisoned_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
			NOT = { has_country_flag = BUL_bs_legalized_flag }
		}

		cost = BUL_broad_socialist_opression_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_opression_destroy_bs
			set_country_flag = BUL_raided_bs_supporters_flag
			BUL_bs_medium_loyalty_decrease_effect = yes
			BUL_bs_high_popularity_decrease_effect = yes
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_opression_raid_faction_supporters_cd_tt
		}
	}

	BUL_opression_raid_bzns_supporters  = { # Raid AGRARIAN UNION Supporters

		priority = 25

		icon = GFX_decision_bul_raid_bzns

		ai_will_do = {
			base = 5
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_opression_raid_faction_supporters_tt
				check_variable = { BUL_bzns_popularity = 25 compare = less_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		days_re_enable = BUL_faction_days_reenable_very_high

		visible = {
			has_country_flag = BUL_bzns_leaders_imprisoned_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
			NOT = { has_country_flag = BUL_bzns_legalized_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_opression_destroy_bzns
			set_country_flag = BUL_raided_bzns_supporters_flag
			BUL_bzns_medium_loyalty_decrease_effect = yes
			BUL_bzns_high_popularity_decrease_effect = yes
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_opression_raid_faction_supporters_cd_tt
		}
	}

	BUL_opression_raid_nsm_supporters  = { # Raid NATIONAL SOCIAL MOVEMENT Supporters

		priority = 15

		icon = GFX_decision_bul_raid_nsm

		ai_will_do = {
			base = 5
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_opression_raid_faction_supporters_tt
				check_variable = { BUL_nsm_popularity = 25 compare = less_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		days_re_enable = BUL_faction_days_reenable_very_high

		visible = {
			has_country_flag = BUL_nsm_leaders_imprisoned_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
			NOT = { has_country_flag = BUL_nsm_legalized_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_opression_destroy_nsm
			set_country_flag = BUL_raided_nsm_supporters_flag
			BUL_nsm_medium_loyalty_decrease_effect = yes
			BUL_nsm_high_popularity_decrease_effect = yes
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			custom_effect_tooltip = BUL_opression_raid_faction_supporters_cd_tt
		}
	}

	BUL_opression_destroy_zveno  = { # Destroy ZVENO

		priority = 46

		icon = GFX_decision_bul_destroy_zveno

		ai_will_do = {
			base = 100
			modifier = {
				factor = 1000
				has_country_flag = BUL_impending_zveno_coup
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_opression_destroy_faction_tt
				check_variable = { BUL_zveno_popularity = 0 compare = less_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		fire_only_once = yes

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_country_flag = BUL_raided_zveno_supporters_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
			NOT = { has_country_flag = BUL_zveno_bolstered_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			country_event = bftb_bulgaria_factions.19
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			set_country_flag = BUL_zveno_destroyed_flag
			if = { #Any generals that might have received the Zveno Trait after disposing of Zveno Generals are removed
				limit = {
					any_unit_leader = {
						has_trait = trait_BUL_zveno_member
					}
				}
				every_unit_leader = {
					limit = {
						has_trait = trait_BUL_zveno_member
					}
					retire = yes
				}
			}
		}
	}

	BUL_opression_destroy_bs  = { # Destroy BROAD SOCIALISTS

		priority = 36

		icon = GFX_decision_bul_destroy_bs

		ai_will_do = {
			base = 100
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_opression_destroy_faction_tt
				check_variable = { BUL_bs_popularity = 0 compare = less_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_raided_bs_supporters_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
			NOT = { has_country_flag = BUL_bs_legalized_flag }
		}

		cost = BUL_broad_socialist_opression_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			country_event = bftb_bulgaria_factions.29
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			set_country_flag = BUL_bs_destroyed_flag
		}
	}

	BUL_opression_destroy_bzns  = { # Destroy AGRARIAN UNION

		priority = 26

		icon = GFX_decision_bul_destroy_bzns

		ai_will_do = {
			base = 100
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_opression_destroy_faction_tt
				check_variable = { BUL_bzns_popularity = 0 compare = less_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_raided_bzns_supporters_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
			NOT = { has_country_flag = BUL_bzns_legalized_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			country_event = bftb_bulgaria_factions.39
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			set_country_flag = BUL_bzns_destroyed_flag
		}
	}

	BUL_opression_destroy_nsm  = { # Destroy NATIONAL SOCIAL MOVEMENT

		priority = 16

		icon = GFX_decision_bul_destroy_nsm

		ai_will_do = {
			base = 100
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = BUL_opression_destroy_faction_tt
				check_variable = { BUL_nsm_popularity = 0 compare = less_than_or_equals }
			}
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_high

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_raided_nsm_supporters_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
			NOT = { has_country_flag = BUL_nsm_legalized_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
		}

		remove_effect = {
			country_event = bftb_bulgaria_factions.49
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			set_country_flag = BUL_nsm_destroyed_flag
		}
	}

	BUL_opression_repress_zveno  = { #ZVENO Repress Organization

		priority = 42

		icon = GFX_decision_bul_repress_zveno

		ai_will_do = {
			base = 100
			modifier = {
				factor = 100
				has_country_flag = BUL_impending_zveno_coup
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_very_low

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_zveno_destroyed_flag
					has_country_flag = BUL_zveno_coup_flag
					has_country_flag = BUL_zveno_integrated_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_country_flag = BUL_zveno_dissident_event_flag #This faction has triggered a dissident event
			has_country_flag = BUL_zveno_dissident_event_not_addressed_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_zveno_integrated_flag }
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
			set_country_flag = BUL_zveno_repressed_flag
		}

		fixed_random_seed = no

		remove_effect = {
			hidden_effect = {
				random_list = {
					70 = {#Success
						country_event = { id = bftb_bulgaria_factions.50 hours = 4 random_hours = 2 }
					}
					20 = {#Extra success
						country_event = { id = bftb_bulgaria_factions.51 hours = 4 random_hours = 2 }
					}
					10 = {#Failure
						country_event = { id = bftb_bulgaria_factions.52 hours = 4 random_hours = 2 }
					}
				}
			}
			effect_tooltip = {
				country_event = bftb_bulgaria_factions.50
			}
			custom_effect_tooltip = BUL_repress_faction_tt
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			clr_country_flag = BUL_zveno_dissident_event_not_addressed_flag
		}
	}

	BUL_opression_repress_bs  = { #BROAD SOCIALISTS Repress Organization

		priority = 32

		icon = GFX_decision_bul_repress_bs

		ai_will_do = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					BUL_is_communist_stalinist_ai = yes
					BUL_is_communist_balkan_ai = yes
					BUL_is_democratic_socialist_ai = yes
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag } 
		}

		days_remove = BUL_faction_days_remove_very_low

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_bs_destroyed_flag
					has_country_flag = BUL_bs_integrated_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_country_flag = BUL_bs_dissident_event_flag #This faction has triggered a dissident event
			has_country_flag = BUL_bs_dissident_event_not_addressed_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bs_integrated_flag }
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
		}

		cost = BUL_broad_socialist_opression_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
			set_country_flag = BUL_bs_repressed_flag
		}

		fixed_random_seed = no

		remove_effect = {		
			hidden_effect = {
				random_list = {
					70 = {
						country_event = { id = bftb_bulgaria_factions.60 hours = 4 random_hours = 2 }
					}
					20 = {
						country_event = { id = bftb_bulgaria_factions.61 hours = 4 random_hours = 2 }
					}
					10 = {
						country_event = { id = bftb_bulgaria_factions.62 hours = 4 random_hours = 2 }
					}
				}
			}
			effect_tooltip = {
				country_event = bftb_bulgaria_factions.60
			}
			custom_effect_tooltip = BUL_repress_faction_tt
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			clr_country_flag = BUL_bs_dissident_event_not_addressed_flag
		}
	}

	BUL_opression_repress_bzns  = { #AGRARIAN UNION Repress Organization

		priority = 22

		icon = GFX_decision_bul_repress_bzns

		ai_will_do = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					BUL_is_communist_stalinist_ai = yes
					BUL_is_communist_balkan_ai = yes
					BUL_is_democratic_socialist_ai = yes
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_very_low

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_bzns_destroyed_flag
					has_country_flag = BUL_bzns_integrated_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_country_flag = BUL_bzns_dissident_event_flag #This faction has triggered a dissident event
			has_country_flag = BUL_bzns_dissident_event_not_addressed_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_bzns_integrated_flag }
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
			set_country_flag = BUL_bzns_repressed_flag
		}

		fixed_random_seed = no

		remove_effect = {
			hidden_effect = {
				random_list = {
					70 = {
						country_event = { id = bftb_bulgaria_factions.70 hours = 4 random_hours = 2 }
					}
					20 = {
						country_event = { id = bftb_bulgaria_factions.71 hours = 4 random_hours = 2 }
					}
					10 = {
						country_event = { id = bftb_bulgaria_factions.72 hours = 4 random_hours = 2 }
					}
				}
			}
			effect_tooltip = {
				country_event = bftb_bulgaria_factions.70
			}
			custom_effect_tooltip = BUL_repress_faction_tt
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			clr_country_flag = BUL_bzns_dissident_event_not_addressed_flag
		}
	}

	BUL_opression_repress_nsm  = { #NATIONAL SOCIAL MOVEMENT Repress Organization

		priority = 12

		icon = GFX_decision_bul_repress_nsm

		ai_will_do = {
			base = 10
			modifier = {
				factor = 0
				BUL_is_fascist_axis_ai = yes
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_internal_affairs_ongoing_flag }
		}

		days_remove = BUL_faction_days_remove_very_low

		cancel_trigger = {
			hidden_trigger = {
				OR = {
					has_country_flag = BUL_nsm_destroyed_flag
					has_country_flag = BUL_nsm_integrated_flag
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_internal_affairs_ongoing_flag
		}

		visible = {
			has_country_flag = BUL_nsm_dissident_event_flag #This faction has triggered a dissident event
			has_country_flag = BUL_nsm_dissident_event_not_addressed_flag
			has_country_flag = BUL_factions_unlocked_flag
			NOT = { has_country_flag = BUL_nsm_integrated_flag }
			NOT = { has_country_flag = BUL_nsm_destroyed_flag }
		}

		cost = BUL_faction_interaction_cost_standard

		complete_effect = {
			set_country_flag = BUL_internal_affairs_ongoing_flag
			set_country_flag = BUL_nsm_repressed_flag
		}

		fixed_random_seed = no

		remove_effect = {
			hidden_effect = {
				random_list = {
					70 = {
						country_event = { id = bftb_bulgaria_factions.80 hours = 4 random_hours = 2 }
					}
					20 = {
						country_event = { id = bftb_bulgaria_factions.81 hours = 4 random_hours = 2 }
					}
					10 = {
						country_event = { id = bftb_bulgaria_factions.82 hours = 4 random_hours = 2 }
					}
				}
			}
			effect_tooltip = {
				country_event = bftb_bulgaria_factions.80
			}
			custom_effect_tooltip = BUL_repress_faction_tt
			clr_country_flag = BUL_internal_affairs_ongoing_flag
			clr_country_flag = BUL_nsm_dissident_event_not_addressed_flag
		}
	}

	BUL_impending_zveno_coup  = { #The ZVENO is preparing a coup

		priority = 100

		icon = GFX_decision_generic_civil_support

		allowed = { 
			original_tag = BUL
		}

		available = {
			OR = {
				has_country_flag = BUL_zveno_destroyed_flag
				has_country_flag = BUL_zveno_integrated_flag
				AND = {
					has_country_flag = BUL_fatherland_front_formed_flag
					NOT = { has_country_flag = BUL_ff_destroyed_flag }
				}
				hidden_trigger = {
					has_completed_focus = BUL_the_fatherland_front
				}
			}
		}

		activation = {
			has_country_flag = BUL_impending_zveno_coup_flag
		}

		days_mission_timeout = 180

		fire_only_once = yes

		visible = {
			
		}

		cancel_if_not_visible = yes

		is_good = no

		complete_effect = {
		}

		timeout_effect = {
			clr_country_flag = BUL_factions_unlocked_flag
			set_country_flag = BUL_zveno_coup_flag
			
			set_variable = { BUL_zveno_coup_size = 0.25 }
			#CIVIL WAR
			if = {
				limit = {
					check_variable = { BUL_zveno_popularity = 80 compare = greater_than_or_equals }
				}
				add_to_variable = { BUL_zveno_coup_size = 0.5 }
			}
			else_if = {
				limit = {
					check_variable = { BUL_zveno_popularity = 60 compare = greater_than_or_equals }
				}
				add_to_variable = { BUL_zveno_coup_size = 0.4 }
			}
			else_if = {
				limit = {
					check_variable = { BUL_zveno_popularity = 40 compare = greater_than_or_equals }
				}
				add_to_variable = { BUL_zveno_coup_size = 0.3 }
			}
			else_if = {
				limit = {
					check_variable = { BUL_zveno_popularity = 20 compare = greater_than_or_equals }
				}
				add_to_variable = { BUL_zveno_coup_size = 0.2 }
			}
			else_if = {
				limit = {
					check_variable = { BUL_zveno_popularity = 10 compare = greater_than_or_equals }
				}
				add_to_variable = { BUL_zveno_coup_size = 0.1 }
			}

			#log = "Zveno coup size: [?BUL.BUL_zveno_coup_size]"

			hidden_effect = {
				#Store ideology support values to fix the mess after the split
				set_variable = { BUL_communist_support_before_zveno_coup = party_popularity_100@communism }
				set_variable = { BUL_democratic_support_before_zveno_coup = party_popularity_100@democratic }
				set_variable = { BUL_fascist_support_before_zveno_coup = party_popularity_100@fascism }
				set_variable = { BUL_neutrality_support_before_zveno_coup = party_popularity_100@neutrality }

				#START CIVIL WAR
				start_civil_war = {
					ideology = neutrality
					size = BUL_zveno_coup_size
					capital = 212
					states = { 211 }
					keep_political_leader = yes
					keep_unit_leaders_trigger = {
						always = yes
					}
				}
			}

			custom_effect_tooltip = BUL_impending_zveno_coup_size_tt

			clr_country_flag = BUL_factions_unlocked_flag #No factions stuff during CW

			hidden_effect = {
				#Reset ideology support
				set_popularities = {
					communism = BUL_communist_support_before_zveno_coup
					democratic = BUL_democratic_support_before_zveno_coup
					fascism = BUL_fascist_support_before_zveno_coup
					neutrality = BUL_neutrality_support_before_zveno_coup
				}

				random_country = {
					limit = {
						original_tag = BUL
						controls_state = 212
					}
					set_cosmetic_tag = BUL_zveno_bulgaria
					set_country_flag = BUL_zveno_bulgaria_flag

					if = {
						limit = {
							NOT = { has_government = neutrality }
						}
						set_politics = { ruling_party = neutrality }
					}			
					every_other_country = {
						limit = {
							PREV = { #Zveno Bul
								has_volunteers_amount_from = {
								    tag = PREV
								    count > 0
								}
							}
						}
						recall_volunteers_from = PREV
					}

					#REMOVE Tsar Boris NS
					if = {
						limit = {
							has_idea = BUL_tsar_boris_positive_01
						}
						remove_ideas = BUL_tsar_boris_positive_01
					}
					else_if = {
						limit = {
							has_idea = BUL_tsar_boris_positive_02
						}
						remove_ideas = BUL_tsar_boris_positive_02
					}
					else_if = {
						limit = {
							has_idea = BUL_tsar_boris_positive_03
						}
						remove_ideas = BUL_tsar_boris_positive_03
					}
					else_if = {
						limit = {
							has_idea = BUL_tsar_boris_negative_01
						}
						remove_ideas = BUL_tsar_boris_negative_01
					}
					else_if = {
						limit = {
							has_idea = BUL_tsar_boris_negative_02
						}
						remove_ideas = BUL_tsar_boris_negative_02
					}

					if = {
						limit = {
							OR = {
								has_idea = BUL_army_restrictions_aat
								has_idea = BUL_army_restrictions
							}
						}
						set_rule = {
							can_not_declare_war = yes
						}
						country_lock_all_division_template = yes
					}

					set_popularities = {
						democratic = 10
						neutrality = 55
						communism = 5
						fascism = 30
					}
					set_party_name = {
						ideology = neutrality
						long_name = BUL_zveno_bulgaria_neutrality_party_long
						name = BUL_zveno_bulgaria_neutrality_party
					}

					if = { # Delete duplicated Kimon Georgiev, the impostor, the fake, the cheap pirate copy
						limit = {
							has_character = BUL_kimon_georgiev
						}
						retire_character = BUL_kimon_georgiev
					}

					if = { # Transfer Kimon Georgiev the real one, the original one, the only one -> And then add him the country role he needs
						limit = {
							BUL = {
								has_character = BUL_kimon_georgiev
							}
						}
						BUL = {
							BUL_kimon_georgiev = {
								set_nationality = BUZ
								add_country_leader_role = {
									character = "BUL_kimon_georgiev"
									country_leader = {
										ideology=despotism
										traits = { old_coup_maker hardened_officer }
										expire="1965.1.1"
									}
									promote_leader = yes
								}
							}
						}
					}

					set_country_flag = BUL_appointed_zveno_members_flag
					set_country_flag = BUL_zveno_bolstered_flag

					delete_unit_template_and_units = {
						division_template = "IMRO Militia"
					}

					every_unit_leader = {
						limit = {
							NOT = { has_trait = trait_BUL_zveno_member }
						}
						set_nationality = ROOT
					}

					#Operatives in the FF
					if = {
						limit = {
							has_dlc = "La Resistance"
						}
						every_operative = {
							limit = {
								has_trait = trait_BUL_tsar_loyalist
							}
							set_nationality = BUL
						}
					}
				}
			
				#Operatives in original BUL
				if = {
					limit = {
						has_dlc = "La Resistance"
					}
					every_operative = {
						limit = {
							OR = {
								has_trait = trait_BUL_ff_sympathizer
								has_trait = trait_BUL_zveno_member
							}
						}
						set_nationality = BUZ
					}
				}

				every_unit_leader = {
					limit = {
						has_trait = trait_BUL_zveno_member
					}
					set_nationality = BUZ
				}
			}
		}
	}
}


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


BUL_macedonian_revolutionary_organizations = {
	BUL_repress_imro_propaganda  = {

		priority = 10

		icon = GFX_decision_eng_propaganda_campaigns

		ai_will_do = {
			base = 10
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_macedonian_affairs_ongoing_flag }
		}

		days_remove = 60

		fire_only_once = yes

		visible = {
			has_completed_focus = BUL_condemn_macedonian_organizations
			has_civil_war = no
		}

		cost = 50

		complete_effect = {
			set_country_flag = BUL_macedonian_affairs_ongoing_flag
			set_country_flag = { flag = BUL_repress_imro_flag value = 1 }
		}

		remove_effect = {
			swap_ideas = {
				remove_idea = BUL_imro_01
				add_idea = BUL_imro_02
			}
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
		}
	}

	BUL_repress_imro_persecute_activists  = {

		priority = 9

		icon = GFX_decision_generic_police_action

		ai_will_do = {
			base = 10
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_macedonian_affairs_ongoing_flag }
			has_manpower > 2000
			has_equipment = { support_equipment > 199 }
			has_equipment = { infantry_equipment > 799 }
		}

		days_remove = 60

		fire_only_once = yes

		visible = {
			has_country_flag = { flag = BUL_repress_imro_flag value = 1 }
			has_civil_war = no
		}

		cost = 25

		complete_effect = {
			set_country_flag = BUL_macedonian_affairs_ongoing_flag
			set_country_flag = { flag = BUL_repress_imro_flag value = 2 }
			add_manpower = -2000
			add_equipment_to_stockpile = {
				type = support_equipment
				amount = -200
				producer = BUL
			}
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = -800
				producer = BUL
			}
		}

		remove_effect = {
			swap_ideas = {
				remove_idea = BUL_imro_02
				add_idea = BUL_imro_03
			}
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
		}
	}

	BUL_repress_imro_destroy_organization  = {

		priority = 8

		icon = GFX_decision_oppression

		ai_will_do = {
			base = 1
			modifier = {
				factor = 0
				BUL_is_historical_ai = yes
			}
			modifier = {
				factor = 2
				OR = {
					has_government = communism
					has_government = democratic
				}
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_macedonian_affairs_ongoing_flag }
			has_war = no
			divisions_in_border_state = { #SOFIA - Macedonia
				size > 1
				state = 48
				border_state = 106
			}
			divisions_in_border_state = { #PLOVDIV - Central Macedonia
				size > 3
				state = 212
				border_state = 731
			}
			divisions_in_border_state = { #PLOVDIV - Thrace
				size > 3
				state = 212
				border_state = 184
			}		
		}

		days_remove = 60

		visible = {
			has_country_flag = { flag = BUL_repress_imro_flag value = 2 }
			owns_state = 212
			owns_state = 48
		}

		cancel_trigger = {
			OR = {
				custom_trigger_tooltip = { #SOFIA - Macedonia
					tooltip = BUL_destroy_imro_divisions_macedonia_tt
					divisions_in_border_state = {
						size < 2
						state = 48
						border_state = 106
					}
				}
				custom_trigger_tooltip = { #PLOVDIV - Central Macedonia
					tooltip = BUL_destroy_imro_divisions_central_macedonia_tt
					divisions_in_border_state = {
						size < 4
						state = 212
						border_state = 731
					}
				}
				custom_trigger_tooltip = { #PLOVDIV - Thrace
					tooltip = BUL_destroy_imro_divisions_thrace_tt
					divisions_in_border_state = {
						size < 4
						state = 212
						border_state = 184
					}
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
			48 = {
				remove_dynamic_modifier = { modifier = skirmishes_against_imro }
			}
			212 = {
				remove_dynamic_modifier = { modifier = skirmishes_against_imro }
			}
		}

		cost = 25

		complete_effect = {
			set_country_flag = BUL_macedonian_affairs_ongoing_flag

			48 = {
				add_dynamic_modifier = { modifier = skirmishes_against_imro }
			}
			212 = {
				add_dynamic_modifier = { modifier = skirmishes_against_imro }
			}
		}

		remove_effect = {
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
			set_country_flag = { flag = BUL_repress_imro_flag value = 3 }
			remove_ideas = BUL_imro_03
			add_stability = 0.1
			add_political_power = 70

			48 = {
				remove_dynamic_modifier = { modifier = skirmishes_against_imro }
			}
			212 = {
				remove_dynamic_modifier = { modifier = skirmishes_against_imro }
			}
		}
	}

	BUL_support_imro_make_contacts = {

		priority = 10

		icon = GFX_decision_generic_political_discourse

		ai_will_do = {
			base = 10
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_macedonian_affairs_ongoing_flag }
		}

		days_remove = 30

		fire_only_once = yes

		visible = {
			has_completed_focus = BUL_support_macedonian_organizations
			has_civil_war = no
			NOT = { has_country_flag = BUL_support_imro_flag }
		}

		cost = 50

		complete_effect = {
			set_country_flag = BUL_macedonian_affairs_ongoing_flag
			set_country_flag = { flag = BUL_support_imro_flag value = 1 }
		}

		remove_effect = {
			swap_ideas = {
				remove_idea = BUL_imro_01
				add_idea = BUL_imro_04
			}
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
		}
	}

	BUL_support_imro_supply_activists = {

		priority = 9

		icon = GFX_decision_generic_industry

		ai_will_do = {
			base = 5
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_macedonian_affairs_ongoing_flag }
			has_equipment = { support_equipment > 99 }
			has_equipment = { infantry_equipment > 999 }
		}

		days_remove = 60

		fire_only_once = yes

		visible = {
			has_country_flag = { flag = BUL_support_imro_flag value = 1 }
			has_civil_war = no
		}

		cost = 50

		complete_effect = {
			set_country_flag = BUL_macedonian_affairs_ongoing_flag
			set_country_flag = { flag = BUL_support_imro_flag value = 2 }
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = -1000
				producer = BUL
			}
			add_equipment_to_stockpile = {
				type = support_equipment
				amount = -100
				producer = BUL
			}
		}

		remove_effect = {
			swap_ideas = {
				remove_idea = BUL_imro_04
				add_idea = BUL_imro_05
			}
			if = {
				limit = {
					any_country = {
						has_opinion_modifier = BUL_supported_imro
					}			
				}
				every_country = {
					limit = {
						has_opinion_modifier = BUL_supported_imro
					}
					remove_opinion_modifier = { 
						target = BUL
						modifier = BUL_supported_imro
					}
				}
			}
			every_country = {
				limit = {
					BUL_country_seeks_macedonian_stability = yes
				}
				add_opinion_modifier = { 
					target = BUL
					modifier = BUL_supplied_imro
				}
			}

			#Set resistance
			every_state = {
				limit = {
					BUL_is_macedonian_state = yes
					NOT = { is_controlled_by = ROOT }
				}
				if = {
					limit = {
						NOT = { is_core_of = BUL }
					}
					add_core_of = BUL
				}
				remove_core_of = controller
				start_resistance = BUL
				hidden_effect = {
					if = {
						limit = { state = 106 }
						set_compliance = 15
						set_resistance = 15
					}
					else = {
						set_compliance = 25
						set_resistance = 10
					}
					if = {
						limit = {
							controller = { 
								NOT = { has_country_flag = BUL_imro_awakened_in_country_flag }
							}
						}
						controller = {
							country_event = bftb_bulgaria_imro.1
							set_country_flag = BUL_imro_awakened_in_country_flag
						}
					}
					if = {
						limit = {
							state = 106 #MACEDONIA
						}
						controller = {
							set_country_flag = BUL_imro_awakened_in_macedonia_flag
						}
					}
					else_if = {
						limit = {
							state = 731 #CENTRAL MACEDONIA
						}
						controller = {
							set_country_flag = BUL_imro_awakened_in_central_macedonia_flag
						}
					}
					else = { #THRACE
						controller = {
							set_country_flag = BUL_imro_awakened_in_thrace_flag
						}
					}
				}
				custom_effect_tooltip = BUL_support_imro_supply_activists_resistance_tt
			}
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
		}
	}

	BUL_support_imro_prepare_bulgarian_occupation = {

		priority = 8

		icon = GFX_decision_generic_nationalism

		ai_will_do = {
			base = 10
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_macedonian_affairs_ongoing_flag }
		}

		days_remove = 180

		fire_only_once = yes

		visible = {
			has_country_flag = { flag = BUL_support_imro_flag value = 2 }
			has_civil_war = no
		}

		cost = 50

		complete_effect = {
			set_country_flag = { flag = BUL_support_imro_flag value = 3 }
			set_country_flag = BUL_macedonian_affairs_ongoing_flag
		}

		remove_effect = {
			every_state = {
				limit = {
					BUL_is_macedonian_state = yes
					is_controlled_by = ROOT
				}
				add_dynamic_modifier = { modifier = widespread_bulgarian_sentiment_02 }
			}
			every_state = {
				limit = {
					BUL_is_macedonian_state = yes
					NOT = { is_controlled_by = ROOT }
				}
				add_dynamic_modifier = { modifier = widespread_bulgarian_sentiment_01 }
				hidden_effect = {
					controller = { country_event = bftb_bulgaria_imro.2 }
				}
			}

			custom_effect_tooltip = BUL_widespread_bulgarian_sentiment_tt
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
		}
	}

	BUL_support_imro_militias = {

		priority = 7

		icon = GFX_decision_generic_military

		ai_will_do = { #AI should use the IMRO as garrison instead
			base = 0
			modifier = { #EAI
				factor = -1000
				has_active_mission = BUL_ff_impending_coup_mission
			}			
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_macedonian_affairs_ongoing_flag }
			has_war = yes
			any_controlled_state = {
				BUL_is_macedonian_state = yes
			}
		}

		days_remove = 7

		fire_only_once = yes

		visible = {
			has_country_flag = { flag = BUL_support_imro_flag value = 3 }
			has_civil_war = no
		}

		cancel_effect = {
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
		}

		cancel_trigger = {
			NOT = {
				any_state = {
					BUL_is_macedonian_state = yes
					is_fully_controlled_by = ROOT
				}
			}
		}

		cost = 50

		complete_effect = {
			set_country_flag = { flag = BUL_support_imro_flag value = 4 }
		}

		remove_effect = {
			division_template = {
				name = "Makedonska Revolyutsionna Militsiya"
				is_locked = yes
				template_counter = 6
				division_names_group = BUL_INF_05
				regiments = {
					infantry = { x = 0 y = 0 }
					infantry = { x = 0 y = 1 }
					infantry = { x = 0 y = 2 }
					infantry = { x = 1 y = 0 }
					infantry = { x = 1 y = 1 }
					infantry = { x = 1 y = 2 }
				}
			}
			if = {
				limit = {
					106 = {	is_fully_controlled_by = ROOT }
				}
				106 = {
					create_unit = {
						division = "division_template = \"Makedonska Revolyutsionna Militsiya\" start_experience_factor = 0.4" 
						owner = ROOT
					}
					create_unit = {
						division = "division_template = \"Makedonska Revolyutsionna Militsiya\" start_experience_factor = 0.4" 
						owner = ROOT
					}
					create_unit = {
						division = "division_template = \"Makedonska Revolyutsionna Militsiya\" start_experience_factor = 0.4" 
						owner = ROOT
					}
				}
				every_state = {
					limit = {
						BUL_is_macedonian_state = yes
						is_fully_controlled_by = BUL
						NOT = { state = 106 }
					}
					create_unit = {
						division = "division_template = \"Makedonska Revolyutsionna Militsiya\" start_experience_factor = 0.4" 
						owner = ROOT
					}
				}
			}
			else = {
				random_state = {
					limit = {
						BUL_is_macedonian_state = yes
						is_fully_controlled_by = ROOT
					}
					create_unit = {
						division = "division_template = \"Makedonska Revolyutsionna Militsiya\" start_experience_factor = 0.4" 
						owner = ROOT
					}
					create_unit = {
						division = "division_template = \"Makedonska Revolyutsionna Militsiya\" start_experience_factor = 0.4" 
						owner = ROOT
					}
					create_unit = {
						division = "division_template = \"Makedonska Revolyutsionna Militsiya\" start_experience_factor = 0.4" 
						owner = ROOT
					}
					random_state = {
						limit = {
							BUL_is_macedonian_state = yes
							is_fully_controlled_by = ROOT
							NOT = { state = PREV }
						}
						create_unit = {
							division = "division_template = \"Makedonska Revolyutsionna Militsiya\" start_experience_factor = 0.4" 
							owner = ROOT
						}
					}
				}
			}
			if = {
				limit = {
					NOT = {
						any_state = {
							BUL_is_macedonian_state = yes
							is_fully_controlled_by = ROOT
						}
					}
				}
				custom_effect_tooltip = BUL_support_imro_militias_tt
			}
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
		}
	}

	BUL_support_imro_garrisons = {

		priority = 7

		icon = GFX_decision_generic_prepare_civil_war

		ai_will_do = {
			base = 1
			modifier = { #EAI
				factor = -1000
				has_active_mission = BUL_ff_impending_coup_mission
			}			
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_country_flag = BUL_macedonian_affairs_ongoing_flag }
			any_controlled_state = {
				BUL_is_macedonian_state = yes
				is_fully_controlled_by = ROOT
			}
		}

		days_remove = 7

		fire_only_once = yes

		visible = {
			has_country_flag = { flag = BUL_support_imro_flag value = 3 }
			has_civil_war = no
		}

		cost = 50

		complete_effect = {
			hidden_effect = {
				set_country_flag = { flag = BUL_support_imro_flag value = 4 }
				set_variable = { BUL_total_mp_from_macedonian_states = 0 }
				every_state = {
					limit = {
						BUL_is_macedonian_state = yes
						is_fully_controlled_by = ROOT
					}
					BUL = {
						add_to_variable = { BUL_total_mp_from_macedonian_states = BUL_imro_garrisons_mp_value  }
					}
				}
			}
		}

		remove_effect = {
			custom_effect_tooltip = BUL_support_imro_garrisons_tt
			if = {
				limit = {
					check_variable = { BUL_total_mp_from_macedonian_states = 0 }
				}
				hidden_effect = {
					add_manpower = BUL_total_mp_from_macedonian_states
				}
			}
			else = {
				add_manpower = BUL_total_mp_from_macedonian_states
			}
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
			clear_variable = BUL_total_mp_from_macedonian_states 
		}
	}
}

BUL_macedonian_revolutionary_organizations_foreign = {
	BUL_repress_imro_foreign = {

		priority = 9

		icon = GFX_decision_generic_police_action

		ai_will_do = {
			base = 0.01
			modifier = {
				factor = 10
				difficulty > 1
			}
			modifier = {
				factor = 10
				difficulty > 2
			}
		}

		available = {
			NOT = { has_country_flag = BUL_macedonian_affairs_ongoing_flag }
			has_manpower > 2000
			has_equipment = { support_equipment > 249 }
			has_equipment = { infantry_equipment > 999 }
		}

		days_remove = 60

		fire_only_once = yes

		visible = {
			has_country_flag = BUL_imro_awakened_in_country_flag
		}

		cost = 25

		complete_effect = {
			set_country_flag = BUL_macedonian_affairs_ongoing_flag
			set_country_flag = BUL_repress_imro_flag
			add_manpower = -2000
			add_equipment_to_stockpile = {
				type = support_equipment
				amount = -250
				producer = ROOT
			}
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = -1000
				producer = ROOT
			}
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_destroy_imro_foreign
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
		}
	}

	BUL_destroy_imro_foreign = {

		priority = 8

		icon = GFX_decision_oppression

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 10
				difficulty > 1
			}
			modifier = {
				factor = 10
				difficulty > 2
			}
		}

		available = {
			has_country_flag = BUL_repress_imro_flag
			NOT = { has_country_flag = BUL_macedonian_affairs_ongoing_flag }
			OR = {
				has_full_control_of_state = 106
				has_full_control_of_state = 731
				has_full_control_of_state = 184
			}
			OR = {
				NOT = { has_full_control_of_state = 106 }
				divisions_in_state = {
					type = infantry
					size > 8
					state = 106
				}
			}
			OR = {
				NOT = { has_full_control_of_state = 731 }
				divisions_in_state = {
					type = infantry
					size > 3
					state = 731
				}
			}
			OR = {
				NOT = { has_full_control_of_state = 184 }
				divisions_in_state = {
					type = infantry
					size > 2
					state = 184
				}
			}
		}

		days_remove = 90

		visible = {
			has_country_flag = BUL_imro_awakened_in_country_flag
		}

		cancel_trigger = {
			custom_trigger_tooltip = {
				tooltip = BUL_destroy_imro_foreign_cancel_trigger_tt
			
				OR = {
					AND = {
						has_country_flag = BUL_imro_awakened_in_macedonia_flag
						106 = {
							has_dynamic_modifier = { modifier = skirmishes_against_imro }
							OR = {
								NOT = { is_fully_controlled_by = ROOT }	
								custom_trigger_tooltip = {
									tooltip = BUL_destroy_imro_divisions_macedonia_foreign_tt
									ROOT = {
										divisions_in_state = {
											type = infantry
											size < 9
											state = 106
										}
									}
								}
							}		
						}
					}
					AND = {
						has_country_flag = BUL_imro_awakened_in_central_macedonia_flag
						731 = {
							has_dynamic_modifier = { modifier = skirmishes_against_imro }
							OR = {
								NOT = { is_fully_controlled_by = ROOT }	
								custom_trigger_tooltip = {
									tooltip = BUL_destroy_imro_divisions_central_macedonia_foreign_tt
									ROOT = {
										divisions_in_state = {
											type = infantry
											size < 4
											state = 731
										}
									}
								}
							}		
						}
					}
					AND = {
						has_country_flag = BUL_imro_awakened_in_thrace_flag
						184 = {
							has_dynamic_modifier = { modifier = skirmishes_against_imro }
							OR = {
								NOT = { is_fully_controlled_by = ROOT }	
								custom_trigger_tooltip = {
									tooltip = BUL_destroy_imro_divisions_thrace_foreign_tt
									ROOT = {
										divisions_in_state = {
											type = infantry
											size < 3
											state = 184
										}
									}
								}
							}		
						}
					}
				}
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
			every_controlled_state = {
				limit = {
					has_dynamic_modifier = { modifier = skirmishes_against_imro }
				}
				remove_dynamic_modifier = { modifier = skirmishes_against_imro }
			}
		}

		cost = 25

		complete_effect = {
			set_country_flag = BUL_macedonian_affairs_ongoing_flag

			every_controlled_state = {
				limit = {
					BUL_is_macedonian_state = yes
					is_fully_controlled_by = ROOT
				}
				effect_tooltip = {
					add_dynamic_modifier = { modifier = skirmishes_against_imro }
				}
				hidden_effect = {
					add_dynamic_modifier = { modifier = skirmishes_against_imro days = 91 } #This is a fallback with one extra day so that it has time to remove widespread_bulgarian_sentiment
				}
			}
		}

		remove_effect = {
			clr_country_flag = BUL_macedonian_affairs_ongoing_flag
			clr_country_flag = BUL_repress_imro_flag
			clr_country_flag = BUL_imro_awakened_in_country_flag
			add_stability = 0.1
			if = {
				limit = {
					NOT = {
						any_state = {
							has_dynamic_modifier = { modifier = skirmishes_against_imro }
						}
					}
				}
				custom_effect_tooltip = BUL_destroy_imro_foreign_tt
			}
			every_controlled_state = {
				limit = {
					has_dynamic_modifier = { modifier = skirmishes_against_imro }
				}
				remove_dynamic_modifier = { modifier = skirmishes_against_imro }
				if = {
					limit = {
						has_dynamic_modifier = { modifier = widespread_bulgarian_sentiment_01 }
					}
					remove_dynamic_modifier = { modifier = widespread_bulgarian_sentiment_01 }
				}
				remove_core_of = BUL
				add_core_of = ROOT
			}
		}
	}
}


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


BUL_the_fatherland_front_dec_cat = { 
	BUL_ff_impending_coup_mission  = {

		priority = 10

		icon = generic_prepare_civil_war

		allowed = { 
			original_tag = BUL
		}

		available = {
			has_country_flag = BUL_ff_destroyed_flag
		}

		days_mission_timeout = 500

		fire_only_once = yes

		activation = {
			has_country_flag = BUL_fatherland_front_formed_flag
			NOT = { has_completed_focus = BUL_the_fatherland_front }
		}

		visible = {
			hidden_trigger = {
				has_country_flag = BUL_fatherland_front_formed_flag
				NOT = { has_country_flag = BUL_ff_civil_war_flag }
			}
			NOT = { has_country_flag = BUL_ff_destroyed_flag }
		}

		cancel_if_not_visible = yes

		days_remove = 7

		is_good = no

		complete_effect = {
		}

		timeout_effect = {
			set_country_flag = BUL_ff_coup_planned_flag
		}
	}

	BUL_ff_approaching_zveno_mission  = {

		priority = 10

		icon = generic_political_discourse

		allowed = { 
			original_tag = BUL
		}

		available = {
			has_country_flag = BUL_ff_destroyed_flag
			has_country_flag = BUL_zveno_destroyed_flag
			has_country_flag = BUL_zveno_integrated_flag
		}

		days_mission_timeout = 60

		fire_only_once = yes

		#activation = {
		#	has_country_flag = BUL_fatherland_front_formed_flag
		#}

		visible = {
			has_country_flag = BUL_fatherland_front_formed_flag
			NOT = { has_country_flag = BUL_ff_destroyed_flag }
			NOT = { has_country_flag = BUL_ff_civil_war_flag }
			NOT = { has_country_flag = BUL_zveno_destroyed_flag }
			NOT = { has_country_flag = BUL_zveno_integrated_flag }
		}

		cancel_if_not_visible = yes

		is_good = no

		complete_effect = {
			#Take away days (to the total amount of days to be removed from the coup timer) based on faction loyalty.
			set_variable = { BUL_days_based_on_faction_loyalty = BUL_zveno_loyalty }
			multiply_variable = { BUL_days_based_on_faction_loyalty = BUL_ff_missions_loyalty_factor }

			#Set base amount of days to be removed from coup timer. Then add days based on popularity and subtract days based on loyalty
			set_variable = { extra_days = BUL_ff_missions_base_days_to_add }
			add_to_variable = { extra_days = BUL_days_based_on_faction_loyalty }

			#Add the resulting amount of days
			add_days_mission_timeout = {
				mission = BUL_ff_impending_coup_mission
				days = extra_days
			}

			#Clear variables
			clear_variable = BUL_days_based_on_faction_loyalty
			clear_variable = extra_days
		}

		timeout_effect = {
			set_country_flag = BUL_zveno_joined_ff_flag
			add_stability = -0.05
			add_popularity = {
				ideology = communism
				popularity = 0.05
			}
			if = {
				limit = { 
					NOT = { has_country_flag = BUL_ff_coup_planned_flag }
				}
				custom_effect_tooltip = BUL_ff_approaching_faction_timer_effects_tt
			}
			custom_effect_tooltip = BUL_ff_approaching_faction_cw_effects_tt

			#Add days (to the total amount of days to be removed from the coup timer) based on faction popularity
			set_variable = { BUL_days_based_on_faction_popularity = BUL_zveno_popularity }
			multiply_variable = { BUL_days_based_on_faction_popularity = BUL_ff_missions_popularity_factor }

			#Take away days (to the total amount of days to be removed from the coup timer) based on faction loyalty.
			set_variable = { BUL_days_based_on_faction_loyalty = BUL_zveno_loyalty }
			multiply_variable = { BUL_days_based_on_faction_loyalty = BUL_ff_missions_loyalty_factor }

			#Set base amount of days to be removed from coup timer. Then add days based on popularity and subtract days based on loyalty
			set_variable = { extra_days = BUL_ff_missions_base_days_to_add }
			add_to_variable = { extra_days = BUL_days_based_on_faction_popularity }
			subtract_from_variable = { extra_days = BUL_days_based_on_faction_loyalty }
			multiply_variable = { extra_days = -1 } #Final value needs to be negative, in order to take away days from the timer

			#Subtract the resulting amount of days
			add_days_mission_timeout = {
				mission = BUL_ff_impending_coup_mission
				days = extra_days
			}

			#Zveno Generals now sympathize with the Fatherland Front
			random_unit_leader = {
				limit = {
					has_trait = trait_BUL_zveno_member
				}
				add_unit_leader_trait = trait_BUL_ff_sympathizer
			}

			#hidden_effect = {
			#	log = "FF approached ZVENO days added: [?BUL.extra_days]"
			#}

			#Clear variables
			clear_variable = BUL_days_based_on_faction_popularity
			clear_variable = BUL_days_based_on_faction_loyalty
			clear_variable = extra_days
		}
	}

	BUL_ff_approaching_bs_mission  = {

		priority = 9

		icon = generic_political_discourse

		allowed = { 
			original_tag = BUL
		}

		available = {
			has_country_flag = BUL_ff_destroyed_flag
			has_country_flag = BUL_bs_destroyed_flag
			has_country_flag = BUL_bs_integrated_flag
		}

		days_mission_timeout = 60

		fire_only_once = yes

		#activation = {
		#	has_country_flag = BUL_fatherland_front_formed_flag
		#}

		visible = {
			has_country_flag = BUL_fatherland_front_formed_flag
			NOT = { has_country_flag = BUL_ff_destroyed_flag }
			NOT = { has_country_flag = BUL_ff_civil_war_flag }
			NOT = { has_country_flag = BUL_bs_destroyed_flag }
			NOT = { has_country_flag = BUL_bs_integrated_flag }
		}

		cancel_if_not_visible = yes

		is_good = no

		complete_effect = {
			#Take away days (to the total amount of days to be removed from the coup timer) based on faction loyalty.
			set_variable = { BUL_days_based_on_faction_loyalty = BUL_bs_loyalty }
			multiply_variable = { BUL_days_based_on_faction_loyalty = BUL_ff_missions_loyalty_factor }

			#Set base amount of days to be removed from coup timer. Then add days based on popularity and subtract days based on loyalty
			set_variable = { extra_days = BUL_ff_missions_base_days_to_add }
			add_to_variable = { extra_days = BUL_days_based_on_faction_loyalty }

			#Subtract the resulting amount of days
			add_days_mission_timeout = {
				mission = BUL_ff_impending_coup_mission
				days = extra_days
			}

			#Clear variables
			clear_variable = BUL_days_based_on_faction_loyalty
			clear_variable = extra_days
		}

		timeout_effect = {
			set_country_flag = BUL_bs_joined_ff_flag
			add_stability = -0.05
			add_popularity = {
				ideology = communism
				popularity = 0.05
			}
			if = {
				limit = { 
					NOT = { has_country_flag = BUL_ff_coup_planned_flag }
				}
				custom_effect_tooltip = BUL_ff_approaching_faction_timer_effects_tt
			}
			custom_effect_tooltip = BUL_ff_approaching_faction_cw_effects_tt

			#Add days (to the total amount of days to be removed from the coup timer) based on faction popularity
			set_variable = { BUL_days_based_on_faction_popularity = BUL_bs_popularity }
			multiply_variable = { BUL_days_based_on_faction_popularity = BUL_ff_missions_popularity_factor }

			#Take away days (to the total amount of days to be removed from the coup timer) based on faction loyalty.
			set_variable = { BUL_days_based_on_faction_loyalty = BUL_bs_loyalty }
			multiply_variable = { BUL_days_based_on_faction_loyalty = BUL_ff_missions_loyalty_factor }

			#Set base amount of days to be removed from coup timer. Then add days based on popularity and subtract days based on loyalty
			set_variable = { extra_days = BUL_ff_missions_base_days_to_add }
			add_to_variable = { extra_days = BUL_days_based_on_faction_popularity }
			subtract_from_variable = { extra_days = BUL_days_based_on_faction_loyalty }
			multiply_variable = { extra_days = -1 } #Final value needs to be negative, in order to take away days from the timer

			#Subtract the resulting amount of days
			add_days_mission_timeout = {
				mission = BUL_ff_impending_coup_mission
				days = extra_days
			}

			#hidden_effect = {
			#	log = "FF approached BS days added: [?BUL.extra_days]"
			#}

			#Clear variables
			clear_variable = BUL_days_based_on_faction_popularity
			clear_variable = BUL_days_based_on_faction_loyalty
			clear_variable = extra_days
		}
	}

	BUL_ff_approaching_bzns_mission  = {

		priority = 9

		icon = generic_political_discourse

		allowed = { 
			original_tag = BUL
		}

		available = {
			has_country_flag = BUL_ff_destroyed_flag
			has_country_flag = BUL_bzns_destroyed_flag
			has_country_flag = BUL_bzns_integrated_flag
		}

		days_mission_timeout = 60

		fire_only_once = yes

		#activation = {
		#	has_country_flag = BUL_fatherland_front_formed_flag
		#}

		visible = {
			has_country_flag = BUL_fatherland_front_formed_flag
			NOT = { has_country_flag = BUL_ff_destroyed_flag }
			NOT = { has_country_flag = BUL_ff_civil_war_flag }
			NOT = { has_country_flag = BUL_bzns_destroyed_flag }
			NOT = { has_country_flag = BUL_bzns_integrated_flag }
		}

		cancel_if_not_visible = yes

		is_good = no

		complete_effect = {
			#Take away days (to the total amount of days to be removed from the coup timer) based on faction loyalty.
			set_variable = { BUL_days_based_on_faction_loyalty = BUL_bzns_loyalty }
			multiply_variable = { BUL_days_based_on_faction_loyalty = BUL_ff_missions_loyalty_factor }

			#Set base amount of days to be removed from coup timer. Then add days based on popularity and subtract days based on loyalty
			set_variable = { extra_days = BUL_ff_missions_base_days_to_add }
			add_to_variable = { extra_days = BUL_days_based_on_faction_loyalty }

			#Subtract the resulting amount of days
			add_days_mission_timeout = {
				mission = BUL_ff_impending_coup_mission
				days = extra_days
			}

			#Clear variables
			clear_variable = BUL_days_based_on_faction_loyalty
			clear_variable = extra_days
		}

		timeout_effect = {
			set_country_flag = BUL_bzns_joined_ff_flag
			add_stability = -0.05
			add_popularity = {
				ideology = communism
				popularity = 0.05
			}
			if = {
				limit = { 
					NOT = { has_country_flag = BUL_ff_coup_planned_flag }
				}
				custom_effect_tooltip = BUL_ff_approaching_faction_timer_effects_tt
			}
			custom_effect_tooltip = BUL_ff_approaching_faction_cw_effects_tt

			#Add days (to the total amount of days to be removed from the coup timer) based on faction popularity
			set_variable = { BUL_days_based_on_faction_popularity = BUL_bzns_popularity }
			multiply_variable = { BUL_days_based_on_faction_popularity = BUL_ff_missions_popularity_factor }

			#Take away days (to the total amount of days to be removed from the coup timer) based on faction loyalty.
			set_variable = { BUL_days_based_on_faction_loyalty = BUL_bzns_loyalty }
			multiply_variable = { BUL_days_based_on_faction_loyalty = BUL_ff_missions_loyalty_factor }

			#Set base amount of days to be removed from coup timer. Then add days based on popularity and subtract days based on loyalty
			set_variable = { extra_days = BUL_ff_missions_base_days_to_add }
			add_to_variable = { extra_days = BUL_days_based_on_faction_popularity }
			subtract_from_variable = { extra_days = BUL_days_based_on_faction_loyalty }
			multiply_variable = { extra_days = -1 } #Final value needs to be negative, in order to take away days from the timer

			#Subtract the resulting amount of days
			add_days_mission_timeout = {
				mission = BUL_ff_impending_coup_mission
				days = extra_days
			}

			#hidden_effect = {
			#	log = "FF approached BZNS days added: [?BUL.extra_days]"
			#}

			#Clear variables
			clear_variable = BUL_days_based_on_faction_popularity
			clear_variable = BUL_days_based_on_faction_loyalty
			clear_variable = extra_days
		}
	}

	BUL_ff_root_out_sympathizers = { 

		priority = 1

		icon = generic_military

		ai_will_do = {
			base = 2
			modifier = {
				factor = 200
				BUL_is_historical_ai = yes
				date < 1942.12.12
				has_political_power > 100
			}
			modifier = {
				factor = 0.5
				BUL_is_historical_ai = yes
			}
            modifier = { #EAI
				factor = -1000
				BUL_is_historical_ai = yes
				OR = {
				      date > 1941.12.30
				      has_stability < 0.40
			    }
			}			
		}

		allowed = { original_tag = BUL } 

		available = {
			
		}

		visible = {
			has_country_flag = BUL_fatherland_front_formed_flag
			NOT = { has_country_flag = BUL_ff_destroyed_flag }
			NOT = { has_country_flag = BUL_ff_civil_war_flag }
		}

		cost = 35
		days_remove = 30
		days_re_enable = 15

		modifier = {
			communism_drift = -0.1
			political_power_gain = -0.5
		}
		
		complete_effect = {
			add_stability = -0.05			
		}
		remove_effect = {
			if = {
				limit = {
					has_idea = BUL_fatherland_front_negative
				}
				swap_ideas = {
					remove_idea = BUL_fatherland_front_negative
					add_idea = BUL_fatherland_front_negative_02
				}
			}

			set_country_flag = BUL_ff_sympathizers_rooted_out_flag

			if = {
				limit = { 
					NOT = { has_country_flag = BUL_ff_coup_planned_flag }
				}
				#Add the resulting amount of days
				add_days_mission_timeout = {
					mission = BUL_ff_impending_coup_mission
					days = BUL_ff_missions_base_days_to_add
				}
			}
			else = {
				BUL_ff_preventive_action_taken = yes
			}
			custom_effect_tooltip = BUL_ff_root_out_sympathizers_cooldown_tt
		}
	}

	BUL_ff_massive_arrests = { 

		priority = 2

		icon = generic_arrest

		ai_will_do = {
			base = 4
			modifier = {
				factor = 0.25
				BUL_is_historical_ai = yes
			}
			modifier = { #EAI
				factor = -1000
				BUL_is_historical_ai = yes
				OR = {
				      date > 1942.12.31
				      has_stability < 0.35
			    }
			}
		}

		allowed = { original_tag = BUL } 

		available = {
		}

		visible = {
			has_country_flag = BUL_fatherland_front_formed_flag
			has_country_flag = BUL_ff_sympathizers_rooted_out_flag
			NOT = { has_country_flag = BUL_ff_destroyed_flag }
			NOT = { has_country_flag = BUL_ff_civil_war_flag }
		}

		cost = 75
		days_remove = 30
		days_re_enable = 30

		modifier = {
			communism_drift = -0.15
			political_power_gain = -1
		}
		
		complete_effect = {
			add_stability = -0.1
		}
		remove_effect = {
			if = {
				limit = {
					has_idea = BUL_fatherland_front_negative_02
				}
				swap_ideas = {
					remove_idea = BUL_fatherland_front_negative_02
					add_idea = BUL_fatherland_front_negative_03
				}
			}

			if = {
				limit = {
					has_country_flag = BUL_zveno_joined_ff_flag
				}
				BUL_zveno_medium_popularity_decrease_effect = yes
			}
			if = {
				limit = {
					has_country_flag = BUL_bs_joined_ff_flag
				}
				BUL_bs_medium_popularity_decrease_effect = yes
			}
			if = {
				limit = {
					has_country_flag = BUL_bzns_joined_ff_flag
				}
				BUL_bzns_medium_popularity_decrease_effect = yes
			}

			if = {
				limit = { 
					NOT = { has_country_flag = BUL_ff_coup_planned_flag }
				}
				#Add the resulting amount of days
				add_days_mission_timeout = {
					mission = BUL_ff_impending_coup_mission
					days = BUL_ff_missions_base_days_to_add
				}
			}
			else = {
				BUL_ff_preventive_action_taken = yes
			}
			custom_effect_tooltip = BUL_ff_massive_arrests_cooldown_tt			
		}
	}

	BUL_ff_deal_the_final_blow = {

		icon = oppression

		ai_will_do = {
			base = 10
			modifier = {
				factor = 0.1
				BUL_is_historical_ai = yes
			}
		}

		allowed = { original_tag = BUL } 

		available = {
			communism < 0.01
			if = {
				limit = {
					has_country_flag = BUL_zveno_joined_ff_flag
				}
				custom_trigger_tooltip = {
					tooltip = BUL_ff_deal_the_final_blow_zveno_pop_tt
					check_variable = { BUL_zveno_popularity = 5 compare = less_than }
				}	
			}
			if = {
				limit = {
					has_country_flag = BUL_bs_joined_ff_flag
				}
				custom_trigger_tooltip = {
					tooltip = BUL_ff_deal_the_final_blow_bs_pop_tt
					check_variable = { BUL_bs_popularity = 5 compare = less_than }
				}
			}
			if = {
				limit = {
					has_country_flag = BUL_bzns_joined_ff_flag
				}
				custom_trigger_tooltip = {
					tooltip = BUL_ff_deal_the_final_blow_bzns_pop_tt
					check_variable = { BUL_bzns_popularity = 5 compare = less_than }
				}
			}
		}

		visible = {
			has_active_mission = BUL_ff_impending_coup_mission
			has_country_flag = BUL_ff_sympathizers_rooted_out_flag
			has_country_flag = BUL_fatherland_front_formed_flag
			NOT = { has_country_flag = BUL_ff_destroyed_flag }
			NOT = { has_country_flag = BUL_ff_civil_war_flag }
		}

		cost = 75
		days_remove = 15

		fire_only_once = yes
	
		complete_effect = {
			
		}
		remove_effect = {
			set_country_flag = BUL_ff_destroyed_flag
			custom_effect_tooltip = BUL_ff_deal_the_final_blow_tt
			if = {
				limit = {
					has_country_flag = BUL_zveno_joined_ff_flag
				}
				set_country_flag = BUL_zveno_destroyed_flag
				custom_effect_tooltip = BUL_ff_deal_the_final_blow_zveno_destroyed_tt
			}
			if = {
				limit = {
					has_country_flag = BUL_bs_joined_ff_flag
				}
				set_country_flag = BUL_bs_destroyed_flag
				custom_effect_tooltip = BUL_ff_deal_the_final_blow_bs_destroyed_tt
			}
			if = {
				limit = {
					has_country_flag = BUL_bzns_joined_ff_flag
				}
				set_country_flag = BUL_bzns_destroyed_flag
				custom_effect_tooltip = BUL_ff_deal_the_final_blow_bzns_destroyed_tt
			}
		}
	}
}



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


BUL_rearmament = {
	BUL_demonstrate_our_policies_of_peace = {

		icon = GFX_decision_generic_form_nation

		ai_will_do = {
			base = 100
			modifier = {
				factor = 100
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_government = fascism
			}
		}

		cancel_trigger = {
			focus_progress = {
				focus = BUL_support_macedonian_organizations
				progress > 0
			}
		}

		cancel_effect = {
			clr_country_flag = BUL_rearmament_negotiations_ongoing_flag
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			has_war = no
			NOT = { has_country_flag = BUL_rearmament_negotiations_ongoing_flag }
			custom_trigger_tooltip = {
				tooltip = BUL_not_justifying_wargoals_tt
				NOT = {
					any_country = {
						BUL = {
							is_justifying_wargoal_against = PREV
						}
					}
				}
			}
		}

		days_remove = 90

		fire_only_once = yes

		visible = {
			OR = {
				has_idea = BUL_army_restrictions_aat
				has_idea = BUL_army_restrictions
			}
			NOT = { has_completed_focus = BUL_support_macedonian_organizations }
			has_completed_focus = BUL_negotiate_bulgarian_rearmament
		}

		cost = 50

		complete_effect = {
			set_country_flag = BUL_rearmament_negotiations_ongoing_flag
		}

		remove_effect = {
			unlock_decision_tooltip = BUL_negotiate_bulgarian_rearmament
			clr_country_flag = BUL_rearmament_negotiations_ongoing_flag
			set_country_flag = { flag = BUL_rearmament_flag value = 1 }
		}
	}

	BUL_negotiate_bulgarian_rearmament = {

		icon = GFX_decision_generic_industry

		ai_will_do = {
			base = 100
			modifier = {
				factor = 100
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0.5
				has_government = fascism
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			has_war = no
			NOT = { has_country_flag = BUL_rearmament_negotiations_ongoing_flag }
			custom_trigger_tooltip = {
				tooltip = BUL_not_justifying_wargoals_tt
				NOT = {
					any_country = {
						BUL = {
							is_justifying_wargoal_against = PREV
						}
					}
				}
			}
		}

		days_remove = 30

		fire_only_once = yes

		visible = {
			OR = {
				has_idea = BUL_army_restrictions_aat
				has_idea = BUL_army_restrictions
			}
			NOT = { has_completed_focus = BUL_support_macedonian_organizations }
			has_country_flag = { flag = BUL_rearmament_flag value = 1 }
		}

		cost = 50

		complete_effect = {
			set_country_flag = BUL_rearmament_negotiations_ongoing_flag
			set_country_flag = { flag = BUL_rearmament_flag value = 2 }
		}

		remove_effect = {
			clr_country_flag = BUL_rearmament_negotiations_ongoing_flag
			ENG = { country_event = bftb_bulgaria_rearmament.1 }
			if = {
				limit = {
					ENG = { is_ai = yes }
				}
				custom_effect_tooltip = BUL_rearmament_main_factors_tt
			}
		}
	}

	BUL_pressure_to_lift_army_restrictions = {

		icon = GFX_decision_eng_trade_unions_support

		ai_will_do = {
			base = 100
			modifier = {
				factor = 100
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0.5
				has_government = fascism
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			has_war = no
			NOT = { has_country_flag = BUL_rearmament_negotiations_ongoing_flag }
			custom_trigger_tooltip = {
				tooltip = BUL_not_justifying_wargoals_tt
				NOT = {
					any_country = {
						BUL = {
							is_justifying_wargoal_against = PREV
						}
					}
				}
			}
		}

		fire_only_once = yes

		visible = {
			OR = {
				has_idea = BUL_army_restrictions_aat
				has_idea = BUL_army_restrictions
			}
			has_country_flag = { flag = BUL_rearmament_flag value = 2 }
		}

		cost = 50

		complete_effect = {
			ENG = { country_event = { id = bftb_bulgaria_rearmament.7 hours = 1 } }
			if = {
				limit = {
					ENG = { is_ai = yes }
				}
				custom_effect_tooltip = BUL_rearmament_main_factors_tt
			}
		}
	}

	BUL_refuse_army_restrictions = {

		icon = GFX_decision_generic_break_treaty

		ai_will_do = {
			base = 1000
			modifier = {
				factor = 100
				has_government = fascism
			}
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			OR = {
				has_war = yes
				AND = {
					is_in_faction = yes
					NOT = { is_in_faction_with = ENG }
				}
			}	
			NOT = { has_country_flag = BUL_rearmament_negotiations_ongoing_flag }
		}

		fire_only_once = yes

		visible = {
			OR = {
				has_idea = BUL_army_restrictions_aat
				has_idea = BUL_army_restrictions
			}
		}

		cost = 50

		complete_effect = {
			clr_country_flag = BUL_rearmament_negotiations_ongoing_flag
			if = {
				limit = {
					has_dlc = "Arms Against Tyranny"
				}
				remove_ideas = BUL_army_restrictions_aat
			}
			else = {
				remove_ideas = BUL_army_restrictions
			}
			if = {
				limit = { has_country_flag = BUL_rearmament_flag }
				clr_country_flag = BUL_rearmament_flag
			}
			set_country_flag = BUL_refused_arms_restrictions_flag
			ENG = { country_event = bftb_bulgaria_rearmament.9 }
			if = {
				limit = {
					has_war = no
				}
				add_threat = 5
			}
		}
	}
}


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


BUL_purchase_equipment = {
	BUL_purchase_infantry_equipment = {

		priority = 10

		icon = generic_industry

		allowed = { always = no } #Activated from effect

		available = {
			FROM = {
				has_opinion = {
					target = ROOT
					value > 0
				}
				BUL_is_valid_subject = yes
			}
			FROM = { has_tech = infantry_weapons }
			NOT = { has_country_flag = BUL_purchasing_infantry_equipment_flag }

			
			NOT = { has_war_with = FROM }
			NOT = { is_justifying_wargoal_against = FROM }
			if = {
				limit = {
					FROM = { tag = GER }
				}
				OR = {
					is_in_faction_with = GER
					AND = {
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ITA }
				}
				OR = {
					is_in_faction_with = ITA
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ENG }
				}
				OR = {
					is_in_faction_with = ENG
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = SOU }
				}
				OR = {
					is_in_faction_with = SOU
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
		}

		visible = {
			country_exists = FROM
			NOT = { has_war_with = FROM }
			FROM = { BUL_is_valid_subject = yes }
		}

		cost = BUL_purchase_equipment_cost
		days_remove = 90
		days_re_enable = 90
		fire_only_once = no

		ai_will_do = {
			factor = 0.1
			modifier = {
				factor = 2
				is_in_faction_with = FROM
			}
			modifier = {
				factor = 0
				OR = {
					num_of_civilian_factories < 10
					stockpile_ratio = { 
		  				archetype = infantry_equipment
		  				ratio > 0.75
		  			}
				}
			}
			modifier = {
				factor = 0
				NOT = { is_in_faction_with = FROM }
			}
			modifier = { #EAI
				factor = -1000
				has_active_mission = BUL_ff_impending_coup_mission
			}
		}
		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			set_country_flag = BUL_purchasing_infantry_equipment_flag
			FROM = {
				add_offsite_building = {
					type = industrial_complex
					level = 1
				}
				add_opinion_modifier = {
					target = BUL
					modifier = BUL_bought_guns
				}

			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_sold_guns
			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_arms_trade
			}
		}
		remove_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = BUL_quantity_purchased_infantry_equipment
				producer = FROM
			}
			FROM = {
				add_offsite_building = {
					type = industrial_complex
					level = -1
				}
			}
			clr_country_flag = BUL_purchasing_infantry_equipment_flag
		}
	}

	BUL_purchase_artillery = {

		priority = 9

		icon = ger_military_buildup

		allowed = { always = no } #Activated from effect

		available = {
			FROM = {
				has_opinion = {
					target = ROOT
					value > 0
				}
				BUL_is_valid_subject = yes
			}
			FROM = { has_tech = gw_artillery }
			NOT = { has_country_flag = BUL_purchasing_artillery_flag }

			NOT = { has_war_with = FROM }
			NOT = { is_justifying_wargoal_against = FROM }
			if = {
				limit = {
					FROM = { tag = GER }
				}
				OR = {
					is_in_faction_with = GER
					AND = {
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ITA }
				}
				OR = {
					is_in_faction_with = ITA
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ENG }
				}
				OR = {
					is_in_faction_with = ENG
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = SOU }
				}
				OR = {
					is_in_faction_with = SOU
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
		}

		visible = {
			country_exists = FROM
			NOT = { has_war_with = FROM }
			FROM = { BUL_is_valid_subject = yes }
		}		

		cost = BUL_purchase_equipment_cost
		days_remove = 90
		days_re_enable = 90
		fire_only_once = no

		ai_will_do = {
			factor = 0.1
			modifier = {
				factor = 2
				is_in_faction_with = FROM
			}
			modifier = {
				factor = 0
				OR = {
					num_of_civilian_factories < 10
					AND = {
						stockpile_ratio = { 
			  				archetype = artillery_equipment
			  				ratio > 0.75
			  			}
			  			stockpile_ratio = { 
			  				archetype = anti_air_equipment
			  				ratio > 0.75
			  			}
			  			stockpile_ratio = { 
			  				archetype = anti_tank_equipment
			  				ratio > 0.75
			  			}
					}
				}
			}
			modifier = {
				factor = 0
				NOT = { is_in_faction_with = FROM }
			}
			modifier = { #EAI
				factor = -1000
				has_active_mission = BUL_ff_impending_coup_mission
			}			
		}

		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			set_country_flag = BUL_purchasing_artillery_flag
			hidden_effect = {
				set_variable = { BUL_artillery_seller = FROM }
				country_event = bftb_bulgaria_equipment_purchases.1
			}

			FROM = {
				add_offsite_building = {
					type = industrial_complex
					level = 1
				}
				add_opinion_modifier = {
					target = BUL
					modifier = BUL_bought_guns
				}

			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_sold_guns
			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_arms_trade
			}
			custom_effect_tooltip = BUL_purchase_artillery_tt
		}
		remove_effect = {
			add_equipment_to_stockpile = {
				type = var:BUL_artillery_type
				amount = BUL_quantity_purchased_artillery
				producer = FROM
			}
			FROM = {
				add_offsite_building = {
					type = industrial_complex
					level = -1
				}
			}
			clear_variable = BUL_artillery_type
			clr_country_flag = BUL_purchasing_artillery_flag
		}
	}

	BUL_purchase_military_vehicles = {

		priority = 8

		icon = generic_trucks

		allowed = { always = no } #Activated from effect

		available = {
			FROM = {
				has_opinion = {
					target = ROOT
					value > 0
				}
				BUL_is_valid_subject = yes
			}
			FROM = { has_tech = motorised_infantry }
			NOT = { has_country_flag = BUL_purchasing_military_vehicles_flag }

			NOT = { has_war_with = FROM }
			NOT = { is_justifying_wargoal_against = FROM }
			if = {
				limit = {
					FROM = { tag = GER }
				}
				OR = {
					is_in_faction_with = GER
					AND = {
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ITA }
				}
				OR = {
					is_in_faction_with = ITA
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ENG }
				}
				OR = {
					is_in_faction_with = ENG
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = SOU }
				}
				OR = {
					is_in_faction_with = SOU
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
		}

		visible = {
			country_exists = FROM
			NOT = { has_war_with = FROM }
			FROM = { BUL_is_valid_subject = yes }
		}

		cost = BUL_purchase_equipment_cost
		days_remove = 90
		days_re_enable = 90
		fire_only_once = no

		ai_will_do = {
			factor = 0.1
			modifier = {
				factor = 2
				is_in_faction_with = FROM
			}
			modifier = {
				factor = 0
				OR = {
					num_of_civilian_factories < 10
					AND = {
						stockpile_ratio = { 
			  				archetype = motorized_equipment
			  				ratio > 0.75
			  			}
			  			stockpile_ratio = { 
			  				archetype = mechanized_equipment
			  				ratio > 0.75
			  			}
			  			stockpile_ratio = { 
			  				archetype = armored_car_equipment
			  				ratio > 0.75
			  			}
					}
				}
			}
			modifier = { #EAI
				factor = -1000
				has_active_mission = BUL_ff_impending_coup_mission
			}			
		}

		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			set_country_flag = BUL_purchasing_military_vehicles_flag
			hidden_effect = {
				set_variable = { BUL_military_vehicles_seller = FROM }
				country_event = bftb_bulgaria_equipment_purchases.2
			}
			FROM = {
				add_offsite_building = {
					type = industrial_complex
					level = 1
				}
				add_opinion_modifier = {
					target = BUL
					modifier = BUL_bought_guns
				}

			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_sold_guns
			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_arms_trade
			}
			custom_effect_tooltip = BUL_purchase_vehicles_tt
		}
		remove_effect = {
			if = {
				limit = {
					FROM = { has_country_flag = BUL_producing_motorized_for_bulgaria_flag }
				}
				add_equipment_to_stockpile = {
					type = var:BUL_vehicle_type
					amount = BUL_quantity_purchased_motorized
					producer = FROM
				}
				FROM = { clr_country_flag = BUL_producing_motorized_for_bulgaria_flag }
			}
			else_if = {
				limit = {
					FROM = { has_country_flag = BUL_producing_mechanized_for_bulgaria_flag }
				}
				add_equipment_to_stockpile = {
					type = var:BUL_vehicle_type
					amount = BUL_quantity_purchased_mechanized
					producer = FROM
				}
				FROM = { clr_country_flag = BUL_producing_mechanized_for_bulgaria_flag }
			}
			else = {
				add_equipment_to_stockpile = {
					type = var:BUL_vehicle_type
					amount = BUL_quantity_purchased_armored_car
					producer = FROM
				}
				FROM = { clr_country_flag = BUL_producing_armored_car_for_bulgaria_flag }
			}
			FROM = {
				add_offsite_building = {
					type = industrial_complex
					level = -1
				}
			}
			clear_variable = BUL_vehicle_type
			clr_country_flag = BUL_purchasing_military_vehicles_flag
		}
	}

	BUL_purchase_armor = {

		priority = 7

		icon = generic_tank

		allowed = { always = no } #Activated from effect

		available = {
			FROM = {
				has_opinion = {
					target = ROOT
					value > 0
				}
				BUL_is_valid_subject = yes
			}
			FROM = { 
				OR = {
					has_tech = basic_light_tank 
					has_tech = basic_light_tank_chassis 
				}
			}
			NOT = { has_country_flag = BUL_purchasing_armor_flag }

			NOT = { has_war_with = FROM }
			NOT = { is_justifying_wargoal_against = FROM }
			if = {
				limit = {
					FROM = { tag = GER }
				}
				OR = {
					is_in_faction_with = GER
					AND = {
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ITA }
				}
				OR = {
					is_in_faction_with = ITA
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ENG }
				}
				OR = {
					is_in_faction_with = ENG
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = SOU }
				}
				OR = {
					is_in_faction_with = SOU
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
		}

		visible = {
			country_exists = FROM
			NOT = { has_war_with = FROM }
			FROM = { BUL_is_valid_subject = yes }
		}

		cost = BUL_purchase_equipment_cost
		days_remove = 90
		days_re_enable = 90
		fire_only_once = no

		ai_will_do = {
			factor = 0.1
			modifier = {
				factor = 0
				OR = {
					NOT = { is_in_faction_with = FROM }
					num_of_civilian_factories < 10
					AND = {
						stockpile_ratio = { 
			  				archetype = light_tank_chassis
			  				ratio > 0.75
			  			}
			  			stockpile_ratio = { 
			  				archetype = medium_tank_chassis
			  				ratio > 0.75
			  			}
			  			stockpile_ratio = { 
			  				archetype = heavy_tank_chassis
			  				ratio > 0.75
			  			}
					}
				}
			}
			modifier = { #EAI
				factor = -1000
				has_active_mission = BUL_ff_impending_coup_mission
			}			
		}

		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			set_country_flag = BUL_purchasing_armor_flag
			hidden_effect = {
				set_variable = { BUL_armor_seller = FROM }
				country_event = bftb_bulgaria_equipment_purchases.3
			}
			FROM = {
				add_offsite_building = {
					type = industrial_complex
					level = 1
				}
				add_opinion_modifier = {
					target = BUL
					modifier = BUL_bought_guns
				}

			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_sold_guns
			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_arms_trade
			}
			custom_effect_tooltip = BUL_purchase_armor_tt
		}
		remove_effect = {
			if = {
				limit = {
					FROM = { has_country_flag = BUL_producing_light_armor_for_bulgaria_flag }
				}
				add_equipment_to_stockpile = {
					type = var:BUL_armor_type
					amount = BUL_quantity_purchased_light_armor
					producer = FROM
				}
				FROM = { clr_country_flag = BUL_producing_light_armor_for_bulgaria_flag }
			}
			else_if = {
				limit = {
					FROM = { has_country_flag = BUL_producing_medium_armor_for_bulgaria_flag }
				}
				add_equipment_to_stockpile = {
					type = var:BUL_armor_type
					amount = BUL_quantity_purchased_medium_armor
					producer = FROM
				}
				FROM = { clr_country_flag = BUL_producing_medium_armor_for_bulgaria_flag }
			}
			else = {
				add_equipment_to_stockpile = {
					type = var:BUL_armor_type
					amount = BUL_quantity_purchased_heavy_armor
					producer = FROM
				}
				FROM = { clr_country_flag = BUL_producing_heavy_armor_for_bulgaria_flag }
			}
			FROM = {
				add_offsite_building = {
					type = industrial_complex
					level = -1
				}
			}
			clear_variable = BUL_vehicle_type
			clr_country_flag = BUL_purchasing_armor_flag
		}
	}

	BUL_purchase_aircraft = {

		priority = 6

		icon = generic_air

		allowed = { always = no } #Activated from effect

		available = {
			FROM = {
				has_opinion = {
					target = ROOT
					value > 0
				}
				BUL_is_valid_subject = yes
			}
			FROM = { 
				OR = { 
					has_tech = early_fighter 
					has_tech = iw_small_airframe 
				}
			}
			NOT = { has_country_flag = BUL_purchasing_aircraft_flag }

			NOT = { has_war_with = FROM }
			NOT = { is_justifying_wargoal_against = FROM }
			if = {
				limit = {
					FROM = { tag = GER }
				}
				OR = {
					is_in_faction_with = GER
					AND = {
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ITA }
				}
				OR = {
					is_in_faction_with = ITA
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ENG }
				}
				OR = {
					is_in_faction_with = ENG
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = SOU }
				}
				OR = {
					is_in_faction_with = SOU
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
		}

		visible = {
			country_exists = FROM
			NOT = { has_war_with = FROM }
			FROM = { BUL_is_valid_subject = yes }
		}

		cost = BUL_purchase_equipment_cost
		days_remove = 90
		days_re_enable = 90
		fire_only_once = no

		ai_will_do = {
			factor = 0.1
			modifier = {
				factor = 2
				is_in_faction_with = FROM
			}
			modifier = {
				factor = 0
				OR = {
					num_of_civilian_factories < 10
					AND = {
						stockpile_ratio = { 
			  				archetype = small_plane_airframe
			  				ratio > 0.75
			  			}
			  			stockpile_ratio = { 
			  				archetype = small_plane_naval_bomber_airframe
			  				ratio > 0.75
			  			}
			  			stockpile_ratio = { 
			  				archetype = medium_plane_airframe
			  				ratio > 0.75
			  			}
					}
				}
			}
			modifier = { #EAI
				factor = -1000
				has_active_mission = BUL_ff_impending_coup_mission
			}			
		}

		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			set_country_flag = BUL_purchasing_aircraft_flag
			hidden_effect = {
				set_variable = { BUL_aircraft_seller = FROM }
				country_event = bftb_bulgaria_equipment_purchases.4
			}
			FROM = {
				add_offsite_building = {
					type = industrial_complex
					level = 1
				}
				add_opinion_modifier = {
					target = BUL
					modifier = BUL_bought_guns
				}

			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_sold_guns
			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_arms_trade
			}
			custom_effect_tooltip = BUL_purchase_aircraft_tt
		}
		remove_effect = {
			if = {
				limit = {
					FROM = { has_country_flag = BUL_producing_fighters_for_bulgaria_flag }
				}
				add_equipment_to_stockpile = {
					type = var:BUL_aircraft_type
					amount = BUL_quantity_purchased_fighter
					producer = FROM
				}
				FROM = { clr_country_flag = BUL_producing_fighters_for_bulgaria_flag }
			}
			else_if = {
				limit = {
					FROM = { has_country_flag = BUL_producing_naval_bombers_for_bulgaria_flag }
				}
				add_equipment_to_stockpile = {
					type = var:BUL_aircraft_type
					amount = BUL_quantity_purchased_naval_bomber
					producer = FROM
				}
				FROM = { clr_country_flag = BUL_producing_naval_bombers_for_bulgaria_flag }
			}
			else = {
				add_equipment_to_stockpile = {
					type = var:BUL_aircraft_type
					amount = BUL_quantity_purchased_tactical_bomber
					producer = FROM
				}
				FROM = { clr_country_flag = BUL_producing_tactical_bombers_for_bulgaria_flag }
			}
			FROM = {
				add_offsite_building = {
					type = industrial_complex
					level = -1
				}
			}
			clear_variable = BUL_vehicle_type
			clr_country_flag = BUL_purchasing_aircraft_flag
		}
	}

	BUL_purchase_ships = {

		priority = 1

		icon = GFX_decision_generic_naval

		allowed = { always = no } #Activated from effect

		available = {
			FROM = {
				has_opinion = {
					target = ROOT
					value > 0
				}
				BUL_is_valid_subject = yes
				if = {
					limit = {
						has_dlc = "Man the Guns"
					}
					OR = {
						has_tech = early_ship_hull_submarine
						has_tech = early_ship_hull_light
						has_tech = early_ship_hull_cruiser
					}
				}
				else = {
					has_tech = early_submarine
					has_tech = early_destroyer
					has_tech = early_light_cruiser
				}
				NOT = { has_country_flag = BUL_producing_bulgarian_ships_flag }
				NOT = { has_country_flag = BUL_ships_purchase_rejected_flag }
			}

			NOT = { has_war_with = FROM }
			NOT = { is_justifying_wargoal_against = FROM }
			if = {
				limit = {
					FROM = { tag = ITA }
				}
				OR = {
					is_in_faction_with = ITA
					AND = {
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ENG }
				}
				OR = {
					is_in_faction_with = ENG
					AND = {
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = SOU }
				}
				OR = {
					is_in_faction_with = SOU
					AND = {
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
		}

		visible = {
			country_exists = FROM
			NOT = { has_war_with = FROM }
			hidden_trigger = {
				NOT = { has_country_flag = BUL_ships_purchase_rejected_flag }
			}
			FROM = { BUL_is_valid_subject = yes }
		}

		cancel_if_not_visible = yes

		cancel_effect = {
			FROM = {
				add_offsite_building = {
					type = industrial_complex
					level = -1
				}
				clr_country_flag = BUL_producing_bulgarian_ships_flag
			}
		}

		cost = BUL_purchase_equipment_cost
		days_remove = 365
		days_re_enable = 1
		fire_only_once = no

		ai_will_do = {
			factor = 0.1
			modifier = {
				OR = {
					num_of_civilian_factories < 5
					num_of_naval_factories < 2 
				}
				factor = 0
			}
			modifier = {
				has_war = yes
				factor = 2
			}
			modifier = { #EAI
				factor = -1000
				has_active_mission = BUL_ff_impending_coup_mission
			}			
		}
		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			FROM = {
				set_country_flag = BUL_producing_bulgarian_ships_flag
				add_offsite_building = {
					type = industrial_complex
					level = 1
				}
				country_event = { id = bftb_bulgaria_equipment_purchases.5 hours = 1 }
			}
		}

		remove_effect = {
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_built_ships
			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_arms_trade
			}
			FROM = {
				add_offsite_building = {
					type = industrial_complex
					level = -1
				}
				clr_country_flag = BUL_producing_bulgarian_ships_flag
			}
			if = {
				limit = {
					FROM = { has_country_flag = BUL_building_submarines_flag }
				}
				hidden_effect = {
					country_event = bftb_bulgaria_equipment_purchases.8
				}
				custom_effect_tooltip = BUL_purchase_ships_submarines_tt
				FROM = { clr_country_flag = BUL_building_submarines_flag }
			}
			else_if = {
				limit = {
					FROM = { has_country_flag = BUL_building_destroyers_flag }
				}
				hidden_effect = {
					country_event = bftb_bulgaria_equipment_purchases.9
				}
				custom_effect_tooltip = BUL_purchase_ships_destroyers_tt
				FROM = { clr_country_flag = BUL_building_destroyers_flag }
			}
			else_if = {
				limit = {
					FROM = { has_country_flag = BUL_building_light_cruiser_flag }
				}
				hidden_effect = {
					country_event = bftb_bulgaria_equipment_purchases.10
				}
				custom_effect_tooltip = BUL_purchase_ships_light_cruiser_tt
				FROM = { clr_country_flag = BUL_building_light_cruiser_flag }
			}
			else = {
				custom_effect_tooltip = BUL_purchase_ships_undetermined_tt
			}
		}
	}
}

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


BUL_foreign_agreements = {

	BUL_german_industrial_agreements = {

		priority = 59

		icon = generic_factory

		ai_will_do = {
			base = 10
		}

		allowed = { always = no } #Activated from effect

		available = {
			GER = {
				has_opinion = {
					target = ROOT
					value > 14
				}
				BUL_is_valid_subject = yes
			}
			#Manage Cap
			if = { # Being in faction grants 10 civs cap
				limit = {
					is_in_faction_with = GER
					has_completed_focus = BUL_approach_germany
				}
				custom_trigger_tooltip = {
					tooltip = BUL_german_industrial_agreements_cap_faction_tt
					check_variable = { BUL_german_industrial_investments < BUL_industrial_investments_max_cap }
				}
			}
			else_if = { # Approaching country grants 5 civs cap
				limit = {
					has_completed_focus = BUL_approach_germany
				}
				custom_trigger_tooltip = {
					tooltip = BUL_german_industrial_agreements_cap_approach_tt
					check_variable = { BUL_german_industrial_investments < BUL_industrial_investments_medium_cap }
				}
			}
			else = { #Basic Cap
				custom_trigger_tooltip = {
					tooltip = BUL_german_industrial_agreements_cap_basic_tt
					check_variable = { BUL_german_industrial_investments < BUL_industrial_investments_basic_cap }
				}
			}
			NOT = { has_war_with = GER }
			NOT = { is_justifying_wargoal_against = GER }
			OR = {
				is_in_faction_with = GER
				AND = {
					BUL_foreign_agreements_in_faction_with_eng = yes
					BUL_foreign_agreements_in_faction_with_sov = yes
				}
			}
			if = {
				limit = {
					has_country_flag = BUL_british_military_agreements_flag
				}
				NOT = { ENG = { has_war_with = GER } }
			}
			if = {
				limit = {
					has_country_flag = BUL_soviet_military_agreements_flag
				}
				NOT = { SOV = { has_war_with = GER } }
			}
		}

		visible = {
			country_exists = GER
			check_variable = { BUL_german_industrial_investments < BUL_industrial_investments_max_cap }
			NOT = { has_completed_focus = BUL_nationalization }
		}

		cancel_trigger = {
			has_completed_focus = BUL_nationalization
		}

		cost = BUL_german_civ_industries_cost
		days_remove = 70
		days_re_enable = 1
		
		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			GER = {
				add_opinion_modifier = {
					target = BUL
					modifier = BUL_industrial_investments_in_bulgaria
				}
			}
			add_opinion_modifier = {
				target = GER
				modifier = BUL_industrial_investments_in_bulgaria
			}
		}
		
		remove_effect = {
			if = {
				limit = { 
					NOT = { GER = { has_country_flag = BUL_industrial_investments_in_bulgaria_flag } }
				}
				GER = { set_country_flag = BUL_industrial_investments_in_bulgaria_flag }
			}
			
			add_to_variable = { BUL_german_industrial_investments = 1 }

			random_owned_controlled_state = {
				limit = {
					ROOT = { has_full_control_of_state = PREV }
					free_building_slots = {
						building = industrial_complex
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
			add_to_variable = { BUL_foreign_industry_consumer_goods_modifier = 0.01 }
			custom_effect_tooltip = BUL_increase_foreign_industry_ns_tt
		}
	}

	BUL_british_industrial_agreements = {

		priority = 58

		icon = generic_factory

		allowed = { always = no } #Activated from effect

		ai_will_do = {
			base = 10
		}

		available = {
			ENG = {
				has_opinion = {
					target = ROOT
					value > 14
				}
				BUL_is_valid_subject = yes
			}
			#Manage Cap
			if = { # Being in faction grants 10 civs cap
				limit = {
					is_in_faction_with = ENG
					has_completed_focus = BUL_approach_the_united_kingdom
				}
				custom_trigger_tooltip = {
					tooltip = BUL_british_industrial_agreements_cap_faction_tt
					check_variable = { BUL_british_industrial_investments < BUL_industrial_investments_max_cap }
				}
			}
			else_if = { # Approaching country grants 5 civs cap
				limit = {
					has_completed_focus = BUL_approach_the_united_kingdom
				}
				custom_trigger_tooltip = {
					tooltip = BUL_british_industrial_agreements_cap_approach_tt
					check_variable = { BUL_british_industrial_investments < BUL_industrial_investments_medium_cap }
				}
			}
			else = { #Basic Cap
				custom_trigger_tooltip = {
					tooltip = BUL_british_industrial_agreements_cap_basic_tt
					check_variable = { BUL_british_industrial_investments < BUL_industrial_investments_basic_cap }
				}
			}
			NOT = { has_war_with = ENG }
			NOT = { is_justifying_wargoal_against = ENG }
			OR = {
				is_in_faction_with = ENG
				AND = {
					BUL_foreign_agreements_in_faction_with_ger = yes
					BUL_foreign_agreements_in_faction_with_sov = yes
				}
			}
			if = {
				limit = {
					has_country_flag = BUL_german_military_agreements_flag
				}
				NOT = { GER = { has_war_with = ENG } }
			}
			if = {
				limit = {
					has_country_flag = BUL_soviet_military_agreements_flag
				}
				NOT = { SOV = { has_war_with = ENG } }
			}
		}

		visible = {
			country_exists = ENG
			check_variable = { BUL_british_industrial_investments < BUL_industrial_investments_max_cap }
			NOT = { has_completed_focus = BUL_nationalization }
		}

		cancel_trigger = {
			has_completed_focus = BUL_nationalization
		}

		cost = BUL_british_civ_industries_cost
		days_remove = 70
		days_re_enable = 1
		
		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			ENG = {
				add_opinion_modifier = {
					target = BUL
					modifier = BUL_industrial_investments_in_bulgaria
				}
			}
			add_opinion_modifier = {
				target = ENG
				modifier = BUL_industrial_investments_in_bulgaria
			}
		}
		
		remove_effect = {
			if = {
				limit = { 
					NOT = { ENG = { has_country_flag = BUL_industrial_investments_in_bulgaria_flag } }
				}
				ENG = { set_country_flag = BUL_industrial_investments_in_bulgaria_flag }
			}
			
			add_to_variable = { BUL_british_industrial_investments = 1 }

			random_owned_controlled_state = {
				limit = {
					ROOT = { has_full_control_of_state = PREV }
					free_building_slots = {
						building = industrial_complex
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
			add_to_variable = { BUL_foreign_industry_consumer_goods_modifier = 0.01 }
			custom_effect_tooltip = BUL_increase_foreign_industry_ns_tt
		}
	}

	BUL_soviet_industrial_agreements = {

		priority = 57

		icon = generic_factory

		ai_will_do = {
			base = 10
		}

		allowed = { always = no } #Activated from effect

		available = {
			SOV = {
				has_opinion = {
					target = ROOT
					value > 14
				}
				BUL_is_valid_subject = yes
			}
			#Manage Cap
			if = { # Being in faction grants 10 civs cap
				limit = {
					is_in_faction_with = SOV
					has_completed_focus = BUL_soviet_bulgarian_treaty_of_mutual_assistance
				}
				custom_trigger_tooltip = {
					tooltip = BUL_soviet_industrial_agreements_cap_faction_tt
					check_variable = { BUL_soviet_industrial_investments < BUL_industrial_investments_max_cap }
				}
			}
			else_if = { # Approaching country grants 5 civs cap
				limit = {
					has_completed_focus = BUL_soviet_bulgarian_treaty_of_mutual_assistance
				}
				custom_trigger_tooltip = {
					tooltip = BUL_soviet_industrial_agreements_cap_approach_tt
					check_variable = { BUL_soviet_industrial_investments < BUL_industrial_investments_medium_cap }
				}
			}
			else = { #Basic Cap
				custom_trigger_tooltip = {
					tooltip = BUL_soviet_industrial_agreements_cap_basic_tt
					check_variable = { BUL_soviet_industrial_investments < BUL_industrial_investments_basic_cap }
				}
			}
			NOT = { has_war_with = SOV }
			NOT = { is_justifying_wargoal_against = SOV }
			OR = {
				is_in_faction_with = SOV
				AND = {
					BUL_foreign_agreements_in_faction_with_ger = yes
					BUL_foreign_agreements_in_faction_with_eng = yes
				}
			}
			if = {
				limit = {
					has_country_flag = BUL_british_military_agreements_flag
				}
				NOT = { ENG = { has_war_with = SOV } }
			}
			if = {
				limit = {
					has_country_flag = BUL_german_military_agreements_flag
				}
				NOT = { GER = { has_war_with = SOV } }
			}
		}

		visible = {
			country_exists = SOV
			check_variable = { BUL_soviet_industrial_investments < BUL_industrial_investments_max_cap }
			NOT = { has_completed_focus = BUL_nationalization }
		}

		cancel_trigger = {
			has_completed_focus = BUL_nationalization
		}

		cost = BUL_soviet_civ_industries_cost
		days_remove = 70
		days_re_enable = 1
		
		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			SOV = {
				add_opinion_modifier = {
					target = BUL
					modifier = BUL_industrial_investments_in_bulgaria
				}
			}
			add_opinion_modifier = {
				target = SOV
				modifier = BUL_industrial_investments_in_bulgaria
			}
		}
		
		remove_effect = {
			if = {
				limit = { 
					NOT = { SOV = { has_country_flag = BUL_industrial_investments_in_bulgaria_flag } }
				}
				SOV = { set_country_flag = BUL_industrial_investments_in_bulgaria_flag }
			}
			
			add_to_variable = { BUL_soviet_industrial_investments = 1 }

			random_owned_controlled_state = {
				limit = {
					ROOT = { has_full_control_of_state = PREV }
					free_building_slots = {
						building = industrial_complex
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
			add_to_variable = { BUL_foreign_industry_consumer_goods_modifier = 0.01 }
			custom_effect_tooltip = BUL_increase_foreign_industry_ns_tt
		}
	}

	BUL_military_agreements = {

		priority = 40

		icon = generic_tank

		allowed = { always = no } #Activated from effect

		ai_will_do = {
			base = 10
		}

		available = {
			FROM = {
				has_opinion = {
					target = ROOT
					value > 49
				}
				BUL_is_valid_subject = yes
			}
			NOT = { has_country_flag = BUL_military_agreements_ongoing_flag }
			NOT = { has_war_with = FROM }
			NOT = { is_justifying_wargoal_against = FROM }
			if = {
				limit = {
					FROM = { tag = GER }
				}
				OR = {
					is_in_faction_with = GER
					AND = {
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ITA }
				}
				OR = {
					is_in_faction_with = ITA
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ENG }
				}
				OR = {
					is_in_faction_with = ENG
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = SOV }
				}
				OR = {
					is_in_faction_with = SOV
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
		}

		visible = {
			country_exists = FROM
			NOT = { has_war_with = FROM }
		}

		cost = BUL_foreign_military_agreements_cost
		days_remove = 30
		fire_only_once = yes
		
		modifier = {
			political_power_factor = -0.15
			consumer_goods_factor = 0.50
		}
		
		complete_effect = {
			set_country_flag = BUL_military_agreements_ongoing_flag
			FROM = {
				add_opinion_modifier = {
					target = BUL
					modifier = BUL_industrial_investments_in_bulgaria
				}
			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_industrial_investments_in_bulgaria
			}
		}

		remove_effect = {
			if = { 
				limit = {
					FROM = { original_tag = GER }
				}
				set_country_flag = BUL_german_military_agreements_flag
				custom_effect_tooltip = available_designer
				show_ideas_tooltip = BUL_german_materiel_designer
				show_ideas_tooltip = BUL_german_tank_designer
			}
			if = { 
				limit = {
					FROM = { original_tag = ENG }
				}
				set_country_flag = BUL_british_military_agreements_flag
				custom_effect_tooltip = available_designer
				show_ideas_tooltip = BUL_british_materiel_designer
				show_ideas_tooltip = BUL_british_tank_designer
			}
			if = { 
				limit = {
					FROM = { original_tag = SOV }
				}
				set_country_flag = BUL_soviet_military_agreements_flag
				custom_effect_tooltip = available_designer
				show_ideas_tooltip = BUL_soviet_materiel_designer
				show_ideas_tooltip = BUL_soviet_tank_designer
			}
			if = { 
				limit = {
					FROM = { original_tag = ITA }
				}
				set_country_flag = BUL_italian_military_agreements_flag
				custom_effect_tooltip = available_designer
				show_ideas_tooltip = BUL_italian_materiel_designer
				show_ideas_tooltip = BUL_italian_tank_designer
			}
			clr_country_flag = BUL_military_agreements_ongoing_flag
		}
	}

	BUL_naval_agreements = {

		priority = 20

		icon = generic_naval

		allowed = { always = no } #Activated from effect

		ai_will_do = {
			base = 10
		}

		available = {
			FROM = {
				has_opinion = {
					target = ROOT
					value > 49
				}
				BUL_is_valid_subject = yes
			}
			NOT = { has_country_flag = BUL_naval_agreements_ongoing_flag }
			NOT = { has_war_with = FROM }
			NOT = { is_justifying_wargoal_against = FROM }
			if = {
				limit = {
					FROM = { tag = ENG }
				}
				OR = {
					is_in_faction_with = ENG
					AND = {
						BUL_foreign_agreements_in_faction_with_sov = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = SOV }
				}
				OR = {
					is_in_faction_with = SOV
					AND = {
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_ita = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ITA }
				}
				OR = {
					is_in_faction_with = ITA
					AND = {
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
					}
				}
			}
		}

		visible = {
			country_exists = FROM
			NOT = { has_war_with = FROM }
		}

		cost = BUL_foreign_military_agreements_cost
		days_remove = 30
		fire_only_once = yes
		
		modifier = {
			political_power_factor = -0.15
			consumer_goods_factor = 0.50
		}
		
		complete_effect = {
			set_country_flag = BUL_naval_agreements_ongoing_flag
			FROM = {
				add_opinion_modifier = {
					target = BUL
					modifier = BUL_industrial_investments_in_bulgaria
				}
			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_industrial_investments_in_bulgaria
			}
		}

		remove_effect = {
			if = { 
				limit = {
					FROM = { original_tag = ENG }
				}
				set_country_flag = BUL_british_naval_agreements_flag
				custom_effect_tooltip = available_designer
				show_ideas_tooltip = BUL_british_naval_designer
			}
			if = { 
				limit = {
					FROM = { original_tag = SOV }
				}
				set_country_flag = BUL_soviet_naval_agreements_flag
				custom_effect_tooltip = available_designer
				show_ideas_tooltip = BUL_soviet_naval_designer
			}
			if = { 
				limit = {
					FROM = { original_tag = ITA }
				}
				set_country_flag = BUL_italian_naval_agreements_flag
				custom_effect_tooltip = available_designer
				show_ideas_tooltip = BUL_italian_naval_designer
			}
			clr_country_flag = BUL_naval_agreements_ongoing_flag
		}
	}

	BUL_aircraft_agreements = {

		priority = 30

		icon = generic_air

		ai_will_do = {
			base = 10
		}

		allowed = { always = no } #Activated from effect

		available = {
			FROM = {
				has_opinion = {
					target = ROOT
					value > 49
				}
				BUL_is_valid_subject = yes
			}
			NOT = { has_country_flag = BUL_aircraft_agreements_ongoing_flag }
			NOT = { has_war_with = FROM }
			NOT = { is_justifying_wargoal_against = FROM }
			if = {
				limit = {
					FROM = { tag = GER }
				}
				OR = {
					is_in_faction_with = GER
					AND = {
						BUL_foreign_agreements_in_faction_with_eng = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = ENG }
				}
				OR = {
					is_in_faction_with = ENG
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_sov = yes
					}
				}
			}
			else_if = {
				limit = {
					FROM = { tag = SOV }
				}
				OR = {
					is_in_faction_with = SOV
					AND = {
						BUL_foreign_agreements_in_faction_with_ger = yes
						BUL_foreign_agreements_in_faction_with_eng = yes
					}
				}
			}
		}

		visible = {
			country_exists = FROM
			NOT = { has_war_with = FROM }
		}

		cost = BUL_foreign_military_agreements_cost
		days_remove = 30
		fire_only_once = yes
		
		modifier = {
			political_power_factor = -0.15
			consumer_goods_factor = 0.50
		}
		
		complete_effect = {
			set_country_flag = BUL_aircraft_agreements_ongoing_flag
			FROM = {
				add_opinion_modifier = {
					target = BUL
					modifier = BUL_industrial_investments_in_bulgaria
				}
			}
			add_opinion_modifier = {
				target = FROM
				modifier = BUL_industrial_investments_in_bulgaria
			}
		}
		
		remove_effect = {
			if = { 
				limit = {
					FROM = { original_tag = GER }
				}
				set_country_flag = BUL_german_aeronautical_agreements_flag
				custom_effect_tooltip = available_designer
				show_ideas_tooltip = BUL_german_aircraft_designer
			}
			if = { 
				limit = {
					FROM = { original_tag = ENG }
				}
				set_country_flag = BUL_british_aeronautical_agreements_flag
				custom_effect_tooltip = available_designer
				show_ideas_tooltip = BUL_british_aircraft_designer
			}
			if = { 
				limit = {
					FROM = { original_tag = SOV }
				}
				set_country_flag = BUL_soviet_aeronautical_agreements_flag
				custom_effect_tooltip = available_designer
				show_ideas_tooltip = BUL_soviet_aircraft_designer
			}
			clr_country_flag = BUL_aircraft_agreements_ongoing_flag
		}
	}
}



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


prospect_for_resources = {
	BUL_mineral_extraction_in_the_rhodopes = { #212
		
		icon = chromium

		ai_will_do = {
			base = 0.5
			modifier = { #EAI
				factor = -1000
				has_active_mission = BUL_ff_impending_coup_mission
			}			
		}

		allowed = {
			has_dlc = "Battle for the Bosporus"
		}

		highlight_states = {
			highlight_state_targets = {
				state = 212
			}
		}

		available = {
			has_tech = construction3
			num_of_civilian_factories_available_for_projects > 1
		}

		visible = {
			owns_state = 212
			controls_state = 212
			212 = {
				NOT = {
					has_state_flag = { 
						flag = BUL_chromium_deposits_flag
						value = 3
					}
				}
			}
			has_completed_focus = BUL_mineral_extraction_in_the_rhodopes
		}

		cost = 25
		days_remove = BUL_plovdiv_chromium_duration

		modifier = {
			civilian_factory_use = 1
		}

		remove_effect = {
			add_to_variable = { var = BUL_plovdiv_chromium_duration value = 30 }
			212 = {
				if = {
					limit = {
						NOT = {
							has_state_flag = BUL_chromium_deposits_flag
						}
					}
					set_state_flag = {
						flag = BUL_chromium_deposits_flag
						value = 1
					}
				}
				else = {
					modify_state_flag = {
						flag = BUL_chromium_deposits_flag
						value = 1
					}
				}
			}
			212 = {
				add_resource = {
					type = chromium
					amount = 3
				}
			}
		}

		complete_effect = {
		}
	}

	BUL_uranium_concession_agreement = {
		
		icon = eng_trade_unions_support

		allowed = {
			has_dlc = "Battle for the Bosporus"
		}

		target_array = allies

		target_trigger = {
			FROM = {
				is_in_faction_with = ROOT
				OR = {
					is_faction_leader = yes
					AND = {
						is_major = yes
						BUL = { is_faction_leader = yes }
					}
				}
			}
		}

		target_root_trigger = {
			has_completed_focus = BUL_uranium_prospecting
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 10
				FROM = {
					is_ai = no
					strength_ratio = {
						tag = ROOT
						ratio > 1
					}
				}
			}
		}

		available = {
			FROM = { has_tech = atomic_research }
		}

		visible = {
			controls_state = 48
		}

		fire_only_once = yes
		cost = 0

		complete_effect = {
			FROM = {
				country_event = bftb_bulgaria_uranium_mining_concessions.1
				add_ideas = BUL_buhovo_uranium_mines
				add_opinion_modifier = {
					target = ROOT
					modifier = BUL_granted_uranium_mining_rights
				}
			}
			remove_ideas = BUL_buhovo_uranium_mines
			add_ideas = BUL_uranium_concession_agreement_ns
		}
	}
}

BUL_negotiate_claims_in_the_balkans = {
	BUL_demand_our_historical_claims = {

		icon = hol_draw_up_staff_plans

		ai_will_do = {
			base = 800
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
		}

		available = {
			
		}

		visible = {
			has_completed_focus = BUL_approach_germany
			country_exists = GER
			NOT = { has_war_with = GER }
			GER = {
				has_capitulated = no
				is_subject = no
			}
			any_state = {
				has_state_flag = BUL_historical_bulgarian_claim_flag
				controller = {
					OR = {
						tag = GER
						AND = {
							NOT = { is_in_faction_with = GER }
							NOT = { tag = BUL }
						}
					}
				}
			}
		}

		cost = 75

		fire_only_once = yes
		
		complete_effect = {		
			GER = { country_event = { id = bftb_bulgarian_claims.1 hours = 1 } }
		}
	}

	BUL_secure_occupation_in_balkan_state = {

		icon = hol_draw_up_staff_plans

		on_map_mode = map_and_decisions_view

		state_target = europe
		target_root_trigger = {
			has_completed_focus = BUL_peaceful_development
			is_in_faction = yes
		}
		target_trigger = {
			FROM = {
				BUL_is_balkan_state = yes
				NOT = { is_controlled_by = BUL }
				controller = {
					PREV = {
						NOT = { is_core_of = PREV }
						is_fully_controlled_by = PREV
					}
					is_in_faction_with = ROOT
				}
				any_neighbor_state = {
					is_fully_controlled_by = BUL
				}
			}
		}

		ai_will_do = {
			base = 0
			modifier = {
				add = 100
				FROM = {
					OR = {
						has_state_flag = BUL_initial_bulgarian_state_flag
						has_state_flag = BUL_historical_bulgarian_claim_flag
					}
				}
			}
			modifier = {
				factor = 100
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				FROM = {
					OR = {
						owner = {
							has_capitulated = no
						}
						controller = {
							NOT = { has_full_control_of_state = FROM }
						}
					}
				}
			}
		}

		available = {
			has_manpower > 4999
		}

		visible = {
			has_completed_focus = BUL_peaceful_development
			is_in_faction = yes
			FROM = {
				NOT = { is_controlled_by = BUL }
				any_neighbor_state = {
					is_fully_controlled_by = BUL
				}
				controller = {
					PREV = {
						NOT = { is_core_of = PREV }
						is_fully_controlled_by = PREV
					}
					is_in_faction_with = ROOT
				}
			}
		}

		cost = 25

		fire_only_once = yes
		
		complete_effect = {
			FROM = {
				controller = {
					country_event = { id = bftb_bulgarian_claims.7 hours = 1 }
				}
			}
			custom_effect_tooltip = BUL_secure_occupation_in_balkan_state_tt
		}
	}
}

BUL_bulgarian_administration_of_the_balkans = {
	BUL_bulgarian_reintegration_campaign = {

		icon = GFX_decision_generic_nationalism

		ai_will_do = {
			base = 0
			modifier = {
				add = 100
				FROM = {
					has_state_flag = BUL_historical_bulgarian_claim_flag
				}
			}
			modifier = {
				factor = 100
				is_historical_focus_on = yes
			}
			modifier = {
				add = 0.1
				OR = {
					has_government = fascism
					has_country_leader = {
						character = BUL_ferdinand_i
						ruling_only = yes
					}
				}
			}
		}

		on_map_mode = map_and_decisions_view

		state_target = yes

		target_array = controlled_states

		target_trigger = {
			FROM = {
				BUL_is_balkan_state = yes
				is_fully_controlled_by = ROOT
				NOT = { is_core_of = ROOT }
				any_neighbor_state = {
					is_core_of = ROOT
				}
			}
		}

		available = {
			FROM = {
				compliance > 30
			}
			has_equipment = {
			    infantry_equipment > 499
			}
			has_manpower > 999
			command_power > 14
		}

		visible = {
			has_completed_focus = BUL_bulgarian_administration_of_the_balkans
			FROM = {
				is_fully_controlled_by = ROOT
				NOT = { is_core_of = ROOT }
				any_neighbor_state = {
					is_core_of = ROOT
				}
			}
		}
  
		cost = 35

		days_remove = 70
		
		complete_effect = {
			FROM = { set_state_flag = BUL_bulgarian_reintegration_campaign_flag }
			add_manpower = -1000
			add_equipment_to_stockpile = {
			    type = infantry_equipment
			    amount = -500
			}
			add_command_power = -15
		}

		remove_effect = {
			FROM = {
				add_core_of = ROOT
			}
		}
	}
}


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


#DECISIONS FOR GERMANY
BUL_align_bulgaria = {
	BUL_germany_donate_fighters = {

		icon = generic_air

		available = {
			has_equipment = {
				small_plane_airframe > 11
			}
		}

		visible = {
			BUL = {
				has_completed_focus = BUL_reorganize_the_military_industry
				OR = {
					is_in_faction = no
					is_in_faction_with = GER
				}
			}
			NOT = {	
				has_war_with = BUL
				is_justifying_wargoal_against = BUL
			}
			is_subject = no
			has_capitulated = no
		}

		ai_will_do = {
			base = 0
			modifier = {
				add = 100
				is_historical_focus_on = yes
				date > 1937.6.1
			}
			modifier = {
				add = 1
				is_historical_focus_on = no
				has_government = BUL
			}
			modifier = {
				factor = 0
				OR = {
					BUL = {
						has_opinion = {
							target = ROOT
							value < 0
						}
					}
					
				}
			}
		}

		cost = 0

		fire_only_once = yes
		
		complete_effect = {
			BUL = { country_event = { id = bftb_bulgaria_german_influence.1 hours = 2 random_hours = 1 } }
			custom_effect_tooltip = BUL_donate_aircraft_tt
		}
	}

	BUL_germany_demand_military_access = {

		icon = hol_draw_up_staff_plans

		available = {

		}

		visible = {
			BUL = { 
				has_country_flag = BUL_german_influence_flag
				OR = {
					is_in_faction = no
					is_in_faction_with = GER
				}
			}
			NOT = {	
				has_war_with = BUL
				is_justifying_wargoal_against = BUL
				has_military_access_to = BUL
			}
			any_country = {
				has_war_with = ROOT
				is_neighbor_of = BUL				
			}
			is_subject = no
			has_capitulated = no
		}

		ai_will_do = {
			base = 0
			modifier = {
				add = 2
				OR = {
					BUL = { has_government = ROOT }
					AND = {
						has_government = fascism
						BUL = { has_government = neutrality }
					}
				}
			}
			modifier = {
				factor = 5
				BUL = { has_completed_focus = BUL_join_the_tripartite_pact }
			}
			modifier = {
				factor = 500
				is_historical_focus_on = yes
				has_war_with = GRE
			}
		}

		cost = 25

		fire_only_once = yes
		
		complete_effect = {
			BUL = { country_event = { id = bftb_bulgaria_german_influence.7 hours = 2 random_hours = 1 } }
		}
	}

	BUL_germany_demand_replacement_of_bulgarian_prime_minister = {

		icon = eng_trade_unions_demand

		available = {

		}

		visible = {
			NOT = {	
				has_war_with = BUL
				is_justifying_wargoal_against = BUL
			}
			BUL = {
				OR = {
					is_in_faction = no
					is_in_faction_with = GER
				}
				has_completed_focus = BUL_approach_germany
				has_idea = BUL_georgi_ivanov_kyoseivanov
				NOT = { has_idea = BUL_bogdan_filov }
				has_country_flag = { flag = BUL_german_influence_flag value > 3 }
			}
			is_subject = no
			has_capitulated = no
		}

		ai_will_do = {
			base = 1
			modifier = {
				add = 100
				BUL = { has_completed_focus = BUL_join_the_tripartite_pact }
			}
			modifier = {
				factor = 100
				is_historical_focus_on = yes
				date > 1939.1.1
			}
			modifier = {
				factor = 0
				BUL = {
					has_opinion = {
						target = ROOT
						value < 0
					}
				}
			}
		}

		cost = 5

		fire_only_once = yes
		
		complete_effect = {
			BUL = { country_event = { id = bftb_bulgaria_german_influence.4 hours = 2 random_hours = 1 } }
		}
	}
}


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


BUL_the_balkan_federation_dream = {
	BUL_develop_balkan_federation_project  = { #Bulgaria is developing a project for a Federation of Balkan Republics.

		priority = 100

		icon = GFX_decision_eng_trade_unions_support

		ai_will_do = {
			base = 100
		}

		allowed = { 
			original_tag = BUL
		}

		available = {
			NOT = { has_war_with = YUG }
		}

		days_remove = 120

		visible = {
			has_completed_focus = BUL_treaty_of_perpetual_friendship
			has_government = communism
			NOT = { has_war_with = YUG }
		}

		cancel_if_not_visible = yes

		cost = 15

		fire_only_once = yes

		complete_effect = {
		}

		modifier = {
			political_power_gain = -0.5
		}

		remove_effect = {
			add_political_power = 70
			set_country_flag = BUL_balkan_federation_project_ready_flag
			add_popularity = {
				ideology = communism
				popularity = 0.1
			}
			country_event = bftb_bulgaria_balkan_federation.1
			YUG = {
				effect_tooltip = {
					add_popularity = {
						ideology = communism
						popularity = 0.1
					}
				}
				country_event = bftb_bulgaria_balkan_federation.2
			}
		}
	}

	BUL_balkan_federation_propaganda = {

		icon = GFX_decision_eng_propaganda_campaigns


		target_trigger = {
			FROM = {
				BUL_is_balkan_nation = yes
				OR = {
					NOT = { is_in_faction_with = ROOT }
					NOT = { has_government = communism }
				}
				NOT = { tag = ROOT }
				has_capitulated = no
			}
		}

		ai_will_do = {
			base = 0.01
			modifier = {
				factor = 10
				FROM = {
					communism > 0.2
					NOT = { is_in_faction_with = ROOT }
				}
			}
			modifier = {
				factor = 10
				FROM = {
					tag = YUG
				}
			}
			modifier = {
				factor = 10
				FROM = {
					tag = YUG
					NOT = { is_in_faction_with = ROOT }
				}
			}
			modifier = {
				factor = 2
				FROM = {
					OR = {
						tag = GRE
						tag = TUR
					}
				}
			}
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			NOT = { has_war_with = FROM }
			FROM = { NOT = { has_country_flag = banned_communism_flag } }
		}
		
		visible = {
			FROM = {
				country_exists = FROM
				NOT = { has_idea = BUL_balkan_federation_project_propaganda }
				OR = {
					NOT = { is_in_faction_with = ROOT }
					NOT = { has_government = communism }
				}
				has_capitulated = no
			}
			OR = {
				AND = {
					FROM = { original_tag = YUG }
					has_completed_focus = BUL_treaty_of_perpetual_friendship
				}
				AND = {
					FROM = {
						BUL_is_balkan_nation = yes
						NOT = { original_tag = YUG }
						NOT = { original_tag = ROOT }
					}
					has_completed_focus = BUL_balkan_federation_of_socialist_republics
				}
			}
		}

		days_re_enable = 180

		cost = 50
		
		complete_effect = {
			FROM = {
				effect_tooltip = {
					add_timed_idea = {
						idea = BUL_balkan_federation_project_propaganda
						days = 180
					}
				}
				hidden_effect = {
					country_event = bftb_bulgaria_balkan_federation.3
				}
			}
		}
	}

	BUL_destabilize_country = {

		icon = GFX_decision_revolt


		target_trigger = {
			FROM = {
				BUL_is_balkan_nation = yes
				NOT = { is_in_faction_with = ROOT }
				NOT = { tag = ROOT }
				has_capitulated = no
				NOT = { has_government = communism }
			}
		}

		ai_will_do = {
			base = 0
			modifier = {
				add = 0.01
				has_manpower > 5000
				has_equipment = { infantry_equipment > 3000 }
			}
			modifier = {
				add = 1
				FROM = {
					communism > 0.4
				}
			}
			modifier = {
				factor = 10
				FROM = {
					tag = YUG
				}
			}
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			NOT = { has_war_with = FROM }
			has_manpower > 250
			has_equipment = { infantry_equipment > 999 }
			FROM = {
				NOT = { has_country_flag = banned_communism_flag }
				NOT = { has_government = communism }
			}
		}
		
		visible = {
			country_exists = FROM
			OR = {
				AND = {
					FROM = {
						original_tag = YUG
						NOT = { is_in_faction_with = ROOT }
						has_capitulated = no
						NOT = { has_government = communism }
					}
					has_completed_focus = BUL_treaty_of_perpetual_friendship
				}
				AND = {
					FROM = {
						BUL_is_balkan_nation = yes
						NOT = { original_tag = YUG }
						NOT = { original_tag = ROOT }
						has_capitulated = no
						NOT = { is_in_faction_with = ROOT }
						NOT = { has_government = communism }
					}
					has_completed_focus = BUL_balkan_federation_of_socialist_republics
				}
			}
		}

		cost = 50

		days_re_enable = 180

		days_remove = 30
		
		complete_effect = {
			add_manpower = -250
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = -1000
				producer = BUL
			}
		}

		remove_effect = {
			FROM = {
				effect_tooltip = {
					add_stability = -0.05
					add_popularity = {
						ideology = communism
						popularity = 0.1
					}
				}
				hidden_effect = {
					country_event = bftb_bulgaria_balkan_federation.4
				}
			}
		}
	}

	BUL_fight_alongside_country_comrades = {

		icon = GFX_decision_generic_prepare_civil_war

		target_trigger = {
			FROM = {
				BUL_is_balkan_nation = yes
				NOT = { tag = ROOT }
				has_civil_war = yes	
				has_government = communism
				NOT = { has_war_with = ROOT }
			}
		}

		ai_will_do = {
			base = 0
			modifier = {
				add = 0.01
				has_war = no
				has_stability > 0.4
				FROM = { is_neighbor_of = ROOT }
				OR = {
					NOT = { has_idea = BUL_army_restrictions }
					NOT = { has_idea = BUL_army_restrictions_aat }
				}
				NOT = {
					FROM = { has_war_with = GER }
					FROM = { has_war_with = ITA }
					FROM = { has_war_with = SOV }
					FROM = { has_war_with = ENG }
				}
			}
			modifier = {
				factor = 10
				has_manpower > 10000
				has_equipment = { infantry_equipment > 3000 }
			}
			modifier = {
				factor = 10
				FROM = {
					tag = YUG
				}
			}
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			has_war_support > 0.15
			has_stability > 0.25
		}
		
		visible = {
			country_exists = FROM
			has_government = communism
			OR = {
				AND = {
					FROM = { original_tag = YUG }
					has_completed_focus = BUL_treaty_of_perpetual_friendship
				}
				AND = {
					FROM = {
						BUL_is_balkan_nation = yes
						NOT = { original_tag = YUG }
						NOT = { original_tag = ROOT }
					}
					has_completed_focus = BUL_balkan_federation_of_socialist_republics
				}
			}
		}

		fire_only_once = yes
		
		complete_effect = {
			hidden_effect = {
				random_country = {
					limit = {
						original_tag = FROM
						has_civil_war = yes
						NOT = { has_government = communism }
					}
					ROOT = { add_to_war = { targeted_alliance = FROM enemy = PREV hostility_reason = asked_to_join } }
				}
			}
			custom_effect_tooltip = BUL_fight_alongside_country_comrades_join_cw_tt
			
			effect_tooltip = {
				give_military_access = FROM
				FROM = { give_military_access = ROOT }
			}
			hidden_effect = {
				diplomatic_relation = {
					country = FROM
					relation = military_access
					active = yes
				}
				FROM = {
					diplomatic_relation = {
						country = ROOT
						relation = military_access
						active = yes
					}
				}
			}
		}
	}

	BUL_balkan_federation_industrial_aid = {

		icon = GFX_decision_generic_factory

		ai_will_do = {
			base = 10
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			NOT = { has_war_with = FROM }
			num_of_civilian_factories_available_for_projects > 5
		}
		
		visible = {
			country_exists = FROM
			NOT = { has_war_with = FROM }
			has_government = communism
			FROM = { 
				NOT = {
					tag = ROOT
					has_government = fascism
				}
			}
		}

		cancel_if_not_visible = yes

		cost = 15

		days_remove = 180

		modifier = {
			civilian_factory_use = 6
		}
		
		complete_effect = {
		}

		remove_effect = {
			FROM = {
				random_owned_controlled_state = {
					limit = {
						free_building_slots = {
							building = industrial_complex
							size > 1
							include_locked = yes
						}
					}
					add_extra_state_shared_building_slots = 2
					add_building_construction = {
						type = industrial_complex
						level = 2
						instant_build = yes
					}
					set_state_flag = BUL_industrial_aid_flag
				}
				random_owned_controlled_state = {
					limit = {
						NOT = { has_state_flag = BUL_industrial_aid_flag }
						free_building_slots = {
							building = industrial_complex
							size > 0
							include_locked = yes
						}
					}
					add_extra_state_shared_building_slots = 1
					add_building_construction = {
						type = industrial_complex
						level = 1
						instant_build = yes
					}
				}
				random_owned_controlled_state = {
					limit = {
						has_state_flag = BUL_industrial_aid_flag
					}
					clr_state_flag = BUL_industrial_aid_flag
				}
				every_unit_leader = {
					set_nationality = BUL
				}
			}
			annex_country = { target = FROM transfer_troops = yes }
		}
	}

	BUL_balkan_federation_economic_aid = {

		icon = GFX_decision_hol_attract_foreign_investors

		ai_will_do = {
			base = 10
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			NOT = { has_war_with = FROM }
		}
		
		visible = {
			country_exists = FROM
			NOT = { has_war_with = FROM }
			NOT = { tag = ROOT }
			has_government = communism
			FROM = { 
				NOT = {
					tag = ROOT
					has_government = fascism
				}
			}
		}

		cancel_if_not_visible = yes

		cost = 15

		days_remove = 90

		modifier = {
			consumer_goods_factor = 0.10
		}
		
		complete_effect = {
		}

		remove_effect = {
			FROM = {
				every_owned_state = {
					limit = {
						is_in_home_area = yes
						infrastructure < 5
					}
					add_extra_state_shared_building_slots = 1
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes
					}
				}
				every_unit_leader = {
					set_nationality = BUL
				}
			}
			annex_country = { target = FROM transfer_troops = yes }
		}
	}

	BUL_balkan_federation_military_aid = {

		icon = GFX_decision_generic_military

		ai_will_do = {
			base = 10
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			NOT = { has_war_with = FROM }
			has_army_experience > 49
		}
		
		visible = {
			country_exists = FROM
			NOT = { has_war_with = FROM }
			NOT = { tag = ROOT }
			has_government = communism
			FROM = { 
				NOT = {
					tag = ROOT
					has_government = fascism
				}
			}
		}

		cancel_if_not_visible = yes

		cost = 15

		days_remove = 90

		modifier = {
			weekly_manpower = -300
		}
		
		complete_effect = {
			army_experience = -50
		}

		remove_effect = {
			add_war_support = 0.1
			FROM = {
				add_manpower = 3600 #90 days of -300 weekly MP
				every_unit_leader = {
					set_nationality = BUL
				}
			}
			annex_country = { target = FROM transfer_troops = yes }
		}
	}

	BUL_balkan_federation_demand_turkish_territory = {

		icon = GFX_decision_generic_military

		ai_will_do = {
			base = 0
			modifier = {
				add = 0.01
				strength_ratio = {
					tag = TUR
					ratio > 1.5
				}
			}
			modifier = {
				factor = 5
				strength_ratio = {
					tag = TUR
					ratio > 2
				}
			}
			modifier = {
				factor = 10
				strength_ratio = {
					tag = TUR
					ratio > 3
				}
			}
			modifier = {
				factor = 100
				TUR = { is_in_faction = no }
			}
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			NOT = { has_war_with = FROM }
			strength_ratio = {
				tag = TUR
				ratio > 1
			}
		}
		
		visible = {
			country_exists = TUR
			TUR = {
				OR = {
					controls_state = 341
					controls_state = 797
				}	
			}
			NOT = { is_in_faction_with = TUR }
			has_government = communism
			has_completed_focus = BUL_the_unification_of_the_balkans
		}

		cancel_if_not_visible = yes

		cost = 75
		
		complete_effect = {
			TUR = {
				country_event = { 
					id = bftb_bulgaria_balkan_federation.16
					hours = 1
				}
			}
		}
	}
}


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


BUL_plot_against_boris_dec_cat = {
	BUL_brainwash_political_prisoners = {
		priority = 10

		icon = GFX_decision_generic_brainwash

		ai_will_do = {
			base = 0.1
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = BUL_has_repressed_faction_tt
					OR = {
						has_country_flag = BUL_zveno_repressed_flag
						has_country_flag = BUL_bs_repressed_flag
						has_country_flag = BUL_bzns_repressed_flag
						has_country_flag = BUL_nsm_repressed_flag
					}
				}
				custom_trigger_tooltip = {
					tooltip = BUL_has_imprisoned_faction_leaders_tt
					OR = {
						has_country_flag = BUL_zveno_leaders_imprisoned_flag
						has_country_flag = BUL_bs_leaders_imprisoned_flag
						has_country_flag = BUL_bzns_leaders_imprisoned_flag
						has_country_flag = BUL_nsm_leaders_imprisoned_flag
					}
				}
			}
		}
		
		visible = {
			has_completed_focus = BUL_plot_against_boris
			NOT = { has_country_flag = BUL_assassin_persuaded_flag }
		}

		fire_only_once = yes

		cost = 50

		days_remove = 60

		modifier = {
			political_power_gain = -0.15
			command_power_gain = -0.15
		}
		
		remove_effect = {
			set_country_flag = BUL_assassin_persuaded_flag
		}
	}

	BUL_persuade_faction_members = {
		priority = 9

		icon = GFX_decision_hol_attract_foreign_investors

		ai_will_do = {
			base = 0.1
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = BUL_has_integrated_faction_tt
					OR = {
						has_country_flag = BUL_zveno_integrated_flag
						has_country_flag = BUL_bs_integrated_flag
						has_country_flag = BUL_bzns_integrated_flag
						has_country_flag = BUL_nsm_integrated_flag
					}
				}
			}
		}
		
		visible = {
			has_completed_focus = BUL_plot_against_boris
			NOT = { has_country_flag = BUL_assassin_persuaded_flag }
		}

		fire_only_once = yes
		
		cost = 75

		days_remove = 60

		modifier = {
			political_power_gain = -0.5
		}
		
		remove_effect = {
			set_country_flag = BUL_assassin_persuaded_flag
		}
	}

	BUL_draw_up_a_plan_for_regicide = {
		priority = 8

		icon = GFX_decision_generic_operation

		ai_will_do = {
			base = 0.1
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			has_country_flag = BUL_assassin_persuaded_flag
		}
		
		visible = {
			has_completed_focus = BUL_plot_against_boris
		}

		fire_only_once = yes
		
		cost = 50

		days_remove = 60

		modifier = {
			political_power_gain = -0.15
		}
		
		remove_effect = {
			set_country_flag = BUL_regicide_plan_ready_flag
		}
	}

	BUL_seek_foreign_support = {
		priority = 7

		icon = GFX_decision_eng_trade_unions_support

		ai_will_do = {
			base = 0.1
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			hidden_trigger = {
				has_country_flag = BUL_regicide_plan_ready_flag
			}
		}
		
		visible = {
			has_country_flag = BUL_regicide_plan_ready_flag
		}

		fire_only_once = yes
		
		cost = 50

		days_remove = 15

		modifier = {
			political_power_gain = -0.25
		}
		
		remove_effect = {
			set_country_flag = BUL_foreign_support_for_regicide_flag
			if = {
				limit = {
					has_decision = BUL_execute_plan
				}
				add_days_remove = {
					decision = BUL_execute_plan
					days = -60
				}
			}
			else = {
				custom_effect_tooltip = BUL_seek_foreign_support_variable_reduction_tt
				set_variable = { BUL_regicide_execution_time = 15 }
			}
			custom_effect_tooltip = BUL_seek_foreign_support_reduced_stability_penalty_tt
		}
	}

	BUL_execute_plan = {
		priority = 6

		icon = GFX_decision_generic_political_discourse

		ai_will_do = {
			base = 0.1
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			hidden_trigger = {
				has_country_flag = BUL_regicide_plan_ready_flag
			}
		}
		
		visible = {
			has_country_flag = BUL_regicide_plan_ready_flag
		}

		fire_only_once = yes
		
		cost = 50

		days_remove = BUL_regicide_execution_time

		modifier = {
			political_power_gain = -0.15
			stability_weekly = -0.01
			command_power_gain = -0.5
		}
		
		remove_effect = {
			set_country_flag = BUL_tsar_boris_assassinated_flag
			country_event = bftb_bulgaria_tsar_boris.2
		}
	}
}


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


BUL_the_fate_of_the_balkans_dec_cat= {
	BUL_fate_of_the_balkans_influence_government = {

		icon = GFX_decision_generic_political_discourse

		target_trigger = {
			FROM = {
				BUL_is_balkan_nation = yes
				NOT = { original_tag = BUL }
				has_capitulated = no
				country_exists = FROM
				OR = {
					is_subject = no
					is_subject_of = ROOT
				}
				OR = {
					is_in_faction = no
					AND = {
						is_in_faction = yes
						is_faction_leader = no
					}
				}
			}
		}

		ai_will_do = {
			base = 0.01
			modifier = {
				factor = 10
				FROM = {
					strength_ratio = {
						tag = ROOT
						ratio < 1
					}
				}
			}
			modifier = {
				factor = 100
				FROM = {
					strength_ratio = {
						tag = ROOT
						ratio < 0.5
					}
				}
			}
			modifier = {
				factor = 10
				is_in_faction = no
			}
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			NOT = { has_war_with = FROM }
		}
		
		visible = {
			country_exists = FROM
			has_completed_focus = BUL_the_fate_of_the_balkans
		}
 
		days_remove = 90
		days_re_enable = 180

		cost = 15

		modifier = {
			political_power_gain = -0.25
		}
		
		remove_effect = {
			#Country flag will be used to determine AI willingness to submit to Bulgaria
			if = {
				limit = {
					FROM = {
						NOT = { has_country_flag = BUL_fate_of_the_balkans_government_influenced_flag }
					}
				}
				FROM = { set_country_flag = BUL_fate_of_the_balkans_government_influenced_flag }
			}
			else = {
				FROM = { modify_country_flag = { flag = BUL_fate_of_the_balkans_government_influenced_flag value = 1 } }
			}
			if = {
				limit = {
					FROM = { is_subject_of = ROOT }
				}
				FROM = {
					add_autonomy_score = {
						value = -150
						localization = BUL_fate_of_the_balkans_influence_government_autonomy
					}
				}
			}
			else = {
				custom_effect_tooltip = BUL_fate_of_the_balkans_influence_government_tt
			}
		}
	}

	BUL_fate_of_the_balkans_ultimatum = {

		icon = GFX_decision_eng_trade_unions_support

		target_trigger = {
			FROM = {
				BUL_is_balkan_nation = yes
				NOT = { is_in_faction_with = ROOT }
				has_capitulated = no
				country_exists = FROM
				is_subject = no
				OR = {
					is_in_faction = no
					AND = {
						is_in_faction = yes
						is_faction_leader = no
					}
				}
			}
		}

		ai_will_do = {
			base = 0.01
			modifier = {
				factor = 10
				FROM = {
					strength_ratio = {
						tag = ROOT
						ratio < 1
					}
				}
			}
			modifier = {
				factor = 100
				FROM = {
					strength_ratio = {
						tag = ROOT
						ratio < 0.5
					}
				}
			}
			modifier = {
				factor = 10
				is_in_faction = no
			}
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			NOT = { has_war_with = FROM }
		}
		
		visible = {
			has_completed_focus = BUL_the_fate_of_the_balkans
			country_exists = FROM
			FROM = {
				is_subject = no
				NOT = { is_in_faction_with = ROOT }
			}
		}

		days_re_enable = 365

		cost = 35
		
		complete_effect = {
			FROM = {
				country_event = { id = bftb_bulgaria_fate_of_the_balkans.1 hours = 4 random_hours = 4 }
			}
			custom_effect_tooltip = BUL_fate_of_the_balkans_ultimatum_tt
		}
	}

	BUL_fate_of_the_balkans_bring_back_state = {

		icon = GFX_decision_infiltrate_state

		target_trigger = {
			FROM = {
				BUL_is_balkan_state = yes
				NOT = { is_controlled_by = ROOT }
				OR = {
					has_state_flag = BUL_historical_bulgarian_claim_flag
					has_state_flag = BUL_initial_bulgarian_state_flag
				}
				any_neighbor_state = {
					is_controlled_by = ROOT 
				}
			}
		}

		ai_will_do = {
			base = 1
			modifier = {
				factor = 10
				FROM = {
					controller = {
						strength_ratio = {
							tag = ROOT
							ratio < 1
						}
					}
				}
			}
		}

		state_target = yes

		allowed = {
			original_tag = BUL
		}

		available = {
			FROM = {
				controller = {
					is_subject_of = ROOT
				}
			}		
		}
		
		visible = {
			has_completed_focus = BUL_the_fate_of_the_balkans
			FROM = {
				controller = {
					is_in_faction_with = ROOT
					NOT = { original_tag = BUL }
				}
			}
		}

		days_re_enable = 365

		cost = 50
		
		complete_effect = {
			FROM = {
				controller = {
					country_event = { id = bftb_bulgaria_fate_of_the_balkans.4 hours = 4 random_hours = 4 }
				}
			}
		}
	}

	BUL_fate_of_the_balkans_demand_submission = {

		icon = GFX_decision_eng_trade_unions_demand

		target_trigger = {
			FROM = {
				BUL_is_balkan_nation = yes
				has_capitulated = no
				country_exists = FROM
				NOT = { is_subject_of = ROOT }
			}
		}

		ai_will_do = {
			base = 0
			modifier = {
				add = 0.01
				FROM = {
					strength_ratio = {
						tag = ROOT
						ratio < 1
					}
				}
			}
			modifier = {
				factor = 10
				FROM = {
					strength_ratio = {
						tag = ROOT
						ratio < 0.5
					}
				}
			}
			modifier = {
				factor = 10
				is_in_faction = no
			}
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			is_in_faction_with = FROM		
		}
		
		visible = {
			has_completed_focus = BUL_the_fate_of_the_balkans
			country_exists = FROM
			NOT = { FROM = { is_subject_of = ROOT } }
		}

		days_re_enable = 365

		cost = 50
		
		complete_effect = {
			FROM = {
				country_event = { id = bftb_bulgaria_fate_of_the_balkans.7 hours = 4 random_hours = 4 }
			}
			custom_effect_tooltip = BUL_fate_of_the_balkans_demand_submission_tt
			custom_effect_tooltip = germany.126.warning
		}
	}
}


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


BUL_dominance_in_the_seas = {
	BUL_dominance_in_the_black_sea_mission = {

		icon = GFX_decision_generic_operation

		ai_will_do = {
			base = 0
			modifier = {
				add = 0.01
				is_major = yes
				OR = {
					has_war = no
					alliance_strength_ratio > 1
				}
			}
		}

		allowed = {
			original_tag = BUL
		}

		available = { #GOAL
			NOT = {
				any_state = {
					BUL_state_is_in_the_black_sea = yes
					controller = {
						NOT = {
							OR = {
								tag = ROOT
								is_subject_of = ROOT
								is_in_faction_with = ROOT
							}
						}
					}
				}
			}
		}

		activation = {
			has_completed_focus = BUL_dominance_in_the_black_sea
		}
		
		visible = {
			has_completed_focus = BUL_dominance_in_the_black_sea
		}

		highlight_states = {
			highlight_states_trigger = { 
				BUL_state_is_in_the_black_sea = yes
				controller = {
					NOT = {
						OR = {
							tag = ROOT
							is_subject_of = ROOT
							is_in_faction_with = ROOT
						}
					}
				}
			}
		}

		days_mission_timeout = 730

		fire_only_once = yes

		is_good = no
		
		timeout_effect = { #FAIL
			set_country_flag = BUL_black_sea_mission_failure_flag
			add_stability = -0.1
			add_war_support = -0.1
			every_state = {
				limit = {
					has_state_flag = BUL_dominance_in_the_seas_claim_flag
				}
				remove_claim_by = ROOT
				clr_state_flag = BUL_dominance_in_the_seas_claim_flag
			}
			BUL_add_weakened_prussia_of_the_balkans_ns = yes
			mark_focus_tree_layout_dirty = yes
		}

		complete_effect = { #SUCCESS
			set_country_flag = BUL_black_sea_mission_success_flag
			add_stability = 0.1
			add_war_support = 0.1
			if = {
				limit = {
					has_idea = BUL_supremacy_on_the_bosporus
				}
				modify_timed_idea = {
					idea = BUL_supremacy_on_the_bosporus
					days = 180
				}
			}
			BUL_add_improved_prussia_of_the_balkans_ns = yes
			mark_focus_tree_layout_dirty = yes
		}
	}

	BUL_dominance_in_the_aegean_sea_mission = {

		icon = GFX_decision_generic_operation

		ai_will_do = {
			base = 0
			modifier = {
				add = 0.01
				is_major = yes
				OR = {
					has_war = no
					alliance_strength_ratio > 1
				}
			}
		}

		allowed = {
			original_tag = BUL
		}

		available = { #GOAL
			NOT = {
				any_state = {
					BUL_state_is_in_the_aegean_sea = yes
					controller = {
						NOT = {
							OR = {
								tag = ROOT
								is_subject_of = ROOT
								is_in_faction_with = ROOT
							}
						}
					}
				}
			}
		}

		activation = {
			has_completed_focus = BUL_dominance_in_the_aegean_sea
		}
		
		visible = {
			has_completed_focus = BUL_dominance_in_the_aegean_sea
		}

		days_mission_timeout = 730

		fire_only_once = yes

		is_good = no

		highlight_states = {
			highlight_states_trigger = { 
				BUL_state_is_in_the_aegean_sea = yes
				controller = {
					NOT = {
						OR = {
							tag = ROOT
							is_subject_of = ROOT
							is_in_faction_with = ROOT
						}
					}
				}
			}
		}
		
		timeout_effect = { #FAIL
			set_country_flag = BUL_aegean_sea_mission_failure_flag
			add_stability = -0.1
			add_war_support = -0.1
			every_state = {
				limit = {
					has_state_flag = BUL_dominance_in_the_seas_claim_flag
				}
				remove_claim_by = ROOT
				clr_state_flag = BUL_dominance_in_the_seas_claim_flag
			}
			BUL_add_weakened_prussia_of_the_balkans_ns = yes
			mark_focus_tree_layout_dirty = yes
		}

		complete_effect = { #SUCCESS
			set_country_flag = BUL_aegean_sea_mission_success_flag
			add_stability = 0.1
			add_war_support = 0.1
			if = {
				limit = {
					has_idea = BUL_supremacy_on_the_bosporus
				}
				modify_timed_idea = {
					idea = BUL_supremacy_on_the_bosporus
					days = 180
				}
			}
			BUL_add_improved_prussia_of_the_balkans_ns = yes
			mark_focus_tree_layout_dirty = yes
		}
	}

	BUL_dominance_in_the_adriatic_sea_mission = {

		icon = GFX_decision_generic_operation

		ai_will_do = {
			base = 0
			modifier = {
				add = 0.01
				is_major = yes
				OR = {
					has_war = no
					alliance_strength_ratio > 1
				}
			}
		}

		allowed = {
			original_tag = BUL
		}

		available = { #GOAL
			NOT = {
				any_state = {
					BUL_state_is_in_the_adriatic_sea = yes
					controller = {
						NOT = {
							OR = {
								tag = ROOT
								is_subject_of = ROOT
								is_in_faction_with = ROOT
							}
						}
					}
				}
			}
		}

		activation = {
			has_completed_focus = BUL_dominance_in_the_adriatic_sea
		}
		
		visible = {
			has_completed_focus = BUL_dominance_in_the_adriatic_sea
		}

		days_mission_timeout = 730

		fire_only_once = yes

		is_good = no

		highlight_states = {
			highlight_states_trigger = { 
				BUL_state_is_in_the_adriatic_sea = yes
				controller = {
					NOT = {
						OR = {
							tag = ROOT
							is_subject_of = ROOT
							is_in_faction_with = ROOT
						}
					}
				}
			}
		}
		
		timeout_effect = { #FAIL
			set_country_flag = BUL_adriatic_sea_mission_failure_flag
			add_stability = -0.1
			add_war_support = -0.1
			every_state = {
				limit = {
					has_state_flag = BUL_dominance_in_the_seas_claim_flag
				}
				remove_claim_by = ROOT
				clr_state_flag = BUL_dominance_in_the_seas_claim_flag
			}
			BUL_add_weakened_prussia_of_the_balkans_ns = yes
			mark_focus_tree_layout_dirty = yes
		}

		complete_effect = { #SUCCESS
			set_country_flag = BUL_adriatic_sea_mission_success_flag
			add_stability = 0.1
			add_war_support = 0.1
			if = {
				limit = {
					has_idea = BUL_supremacy_on_the_bosporus
				}
				modify_timed_idea = {
					idea = BUL_supremacy_on_the_bosporus
					days = 180
				}
			}
			BUL_add_improved_prussia_of_the_balkans_ns = yes
			mark_focus_tree_layout_dirty = yes
		}
	}
}


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


political_actions = {
	BUL_appoint_tsankov = {
		priority = 100

		icon = GFX_decision_generic_speech

		ai_will_do = {
			base = 0
		}

		allowed = {
			original_tag = BUL
			has_dlc = "Battle for the Bosporus"
		}

		available = {
			has_country_flag = BUL_nsm_integrated_flag
		}
		
		visible = {
			has_government = fascism
			NOT = {
				has_country_leader = { character = BUL_aleksandar_tsankov }
			}
		}

		fire_only_once = yes
		
		cost = 50
		
		complete_effect = {
			retire_ideology_leader = fascism
			set_party_name = {
				ideology = fascism
				long_name = BUL_national_social_movement_party_long
				name = BUL_national_social_movement_party
			}
			add_country_leader_role = {
				character = BUL_aleksandar_tsankov
				country_leader = {
				  ideology=nazism
				  traits = { the_bloody_professor }
				  expire="1965.1.1"
				}
				promote_leader = yes
			}
		}
	}

	BUL_appoint_georgiev = {
		priority = 100

		icon = GFX_decision_generic_speech

		ai_will_do = {
			base = 0
		}

		allowed = {
			original_tag = BUL
			has_dlc = "Battle for the Bosporus"
		}

		available = {
			has_country_flag = BUL_zveno_integrated_flag
			has_completed_focus = BUL_the_fatherland_front
		}
		
		visible = {
			has_government = communism
			NOT = {
				has_country_leader = { character = BUL_kimon_georgiev }
			}
		}

		fire_only_once = yes
		
		cost = 50
		
		complete_effect = {
			retire_ideology_leader = communism
			if = {
				limit = {
					has_character = BUL_kimon_georgiev
				}
				add_country_leader_role = {
					character = "BUL_kimon_georgiev"
					country_leader = {
					  ideology=anti_revisionism
					  traits = { old_coup_maker hardened_officer }
					  expire="1965.1.1"
					}
					promote_leader = yes
				}
			}
		}
	}
}


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


BUL_balkan_confederation = {
	BUL_balkan_confederation_industrial_investment = {

		icon = GFX_decision_generic_factory
		
		target_trigger = {
			FROM = {
				BUL_is_balkan_nation = yes
				NOT = { tag = ROOT }
				country_exists = FROM
				has_capitulated = no
				OR = {
					is_subject_of = ROOT
					is_subject = no
				}
			}
		}

		ai_will_do = {
			base = 0.01
			modifier = {
				factor = 5
				FROM = {
					democratic > 0.2
				}
			}
			modifier = {
				factor = 5
				FROM = {
					tag = GRE
				}
			}
			modifier = {
				factor = 5
				FROM = {
					tag = GRE
					NOT = { is_in_faction_with = ROOT }
				}
			}
			modifier = {
				factor = 2
				FROM = {
					OR = {
						tag = YUG
						tag = TUR
					}
				}
			}
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			NOT = { has_war_with = FROM }
			num_of_civilian_factories_available_for_projects > 2
		}
		
		visible = {
			has_completed_focus = BUL_a_balkan_confederation
			has_government = democratic
			country_exists = FROM
			FROM = {
				BUL_is_balkan_nation = yes
				NOT = { tag = ROOT }
				has_capitulated = no	
				OR = {
					is_subject_of = ROOT
					is_subject = no
				}
			}
		}

		cost = 15

		days_re_enable = 365

		days_remove = 120
		
		modifier = {
			civilian_factory_use = 3
		}
		
		complete_effect = {
			FROM = {			
				random_owned_controlled_state = {
					limit = {
						free_building_slots = {
							building = industrial_complex
							size > 1
							include_locked = yes
						}
					}
					set_state_flag = BUL_industrial_investement_target
				}
				if = {
					limit = {
						has_country_flag = BUL_bulgarian_capitalists_lobbying_country_flag
					}
					modify_country_flag = { flag = BUL_bulgarian_capitalists_lobbying_country_flag value = 1 }
				}
				set_country_flag = { flag = BUL_bulgarian_capitalists_lobbying_country_flag value = 1 }
			}
		}

		remove_effect = {	
			effect_tooltip = {
				FROM = {
					add_popularity = {
						ideology = democratic
						popularity = 0.1
					}
					if = {
						limit = {
							any_controlled_state = {
								has_state_flag = BUL_industrial_investement_target
							}
						}
						random_owned_controlled_state = {
							limit = {
								has_state_flag = BUL_industrial_investement_target
							}
							add_extra_state_shared_building_slots = 1
							add_building_construction = {
								type = industrial_complex
								level = 1
								instant_build = yes
							}
						}
					}
					else = {
						random_owned_controlled_state = {
							limit = {
								free_building_slots = {
									building = industrial_complex
									size > 1
									include_locked = yes
								}
							}
							add_extra_state_shared_building_slots = 1
							add_building_construction = {
								type = industrial_complex
								level = 1
								instant_build = yes
							}
						}
					}
				}
			}
			if = {
				limit = {
					FROM = { is_ai = yes }
				}
				custom_effect_tooltip = BUL_balkan_confederation_ai_tt
			}
			hidden_effect = {
				FROM = { country_event = bftb_bulgaria_democratic_international_policies.2 }
			}
			custom_effect_tooltip = BUL_balkan_confederation_cooldown_tt
		}
	}

	BUL_balkan_confederation_capital_injection = {

		icon = GFX_decision_gre_investment_decisions

		target_trigger = {
			FROM = {
				BUL_is_balkan_nation = yes
				NOT = { tag = ROOT }
				country_exists = FROM
				has_capitulated = no
				OR = {
					is_subject_of = ROOT
					is_subject = no
				}
			}
		}

		ai_will_do = {
			base = 0.01
			modifier = {
				factor = 5
				FROM = {
					democratic > 0.2
				}
			}
			modifier = {
				factor = 5
				FROM = {
					tag = GRE
				}
			}
			modifier = {
				factor = 5
				FROM = {
					tag = GRE
					NOT = { is_in_faction_with = ROOT }
				}
			}
			modifier = {
				factor = 2
				FROM = {
					OR = {
						tag = YUG
						tag = TUR
					}
				}
			}
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			NOT = { has_war_with = FROM }
		}
		
		visible = {
			has_completed_focus = BUL_a_balkan_confederation
			has_government = democratic
			country_exists = FROM
			FROM = {
				BUL_is_balkan_nation = yes
				NOT = { tag = ROOT }
				has_capitulated = no
				OR = {
					is_subject_of = ROOT
					is_subject = no
				}	
			}
		}

		cost = 15

		days_remove = 120	

		modifier = {
			consumer_goods_factor = 0.10
		}
		
		complete_effect = {
			FROM = {
				if = {
					limit = {
						has_country_flag = BUL_bulgarian_capitalists_lobbying_country_flag
					}
					modify_country_flag = { flag = BUL_bulgarian_capitalists_lobbying_country_flag value = 1 }
				}
				set_country_flag = { flag = BUL_bulgarian_capitalists_lobbying_country_flag value = 1 }
			}
		}

		remove_effect = {
			effect_tooltip = {
				FROM = {
					add_popularity = {
						ideology = democratic
						popularity = 0.05
					}
					add_timed_idea = {
						idea = BUL_bulgarian_capital_injection
						days = 120
					}
				}
			}
			if = {
				limit = {
					FROM = { is_ai = yes }
				}
				custom_effect_tooltip = BUL_balkan_confederation_ai_tt
			}
			hidden_effect = {
				FROM = { country_event = bftb_bulgaria_democratic_international_policies.3 }
			}
		}
	}

	BUL_balkan_confederation_balkan_summit = {

		icon = GFX_decision_generic_form_nation

		ai_will_do = {
			base = 2
		}

		allowed = {
			original_tag = BUL
		}

		available = {
			any_other_country = {
				BUL_is_balkan_nation = yes
				has_capitulated = no
				NOT = { has_war_with = ROOT }
				OR = {
					is_subject_of = ROOT
					is_subject = no
				}
			}
		}
		
		visible = {
			has_completed_focus = BUL_a_balkan_confederation
			has_government = democratic
		}

		cost = 75

		days_re_enable = 365
		
		complete_effect = {
			every_other_country = {
				limit = {
					BUL_is_balkan_nation = yes
					has_capitulated = no
					NOT = { has_war_with = ROOT }
					OR = {
						is_subject_of = ROOT
						is_subject = no
					}
				}
				add_timed_idea = {
					idea = democratic_influence
					days = 365
				}
				country_event = { id = generic.1 }
			}
			custom_effect_tooltip = BUL_balkan_confederation_balkan_summit_cooldown_tt
		}
	}
}
