BUL_befriend_GER = {
	allowed = {
		original_tag = BUL
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		focus_progress = {
			focus = BUL_bulgarian_irredentism
			progress > 0.1
		}
		country_exists = GER
		GER = {
			has_opinion	= {
				target = ROOT
				value < 50
			}
			has_capitulated = no
			is_subject = no
		}
		OR = {
			has_government = neutrality
			has_government = fascism
		}
	}
	abort = {
		OR = {
			NOT = { country_exists = GER }
			has_war_with = GER
			GER = {
				OR = {
					has_government = democratic
					has_government = communism
					has_opinion	= {
						target = ROOT
						value > 80
					}
					has_capitulated = yes
					is_subject = yes
				}
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = GER
		target = improve_relation
		value = 200
	}
}

BUL_befriend_ITA = {
	allowed = {
		original_tag = BUL
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		has_completed_focus = BUL_approach_germany
		country_exists = ITA
		ITA = {
			has_opinion	= {
				target = ROOT
				value < 50
			}
			has_capitulated = no
			is_subject = no
		}
		OR = {
			has_government = neutrality
			has_government = fascism
		}
	}
	abort = {
		OR = {
			NOT = { country_exists = ITA }
			has_war_with = ITA
			ITA = {
				OR = {
					has_government = democratic
					has_government = communism
					has_opinion	= {
						target = ROOT
						value > 80
					}
					has_capitulated = yes
					is_subject = yes
				}
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = ITA
		target = improve_relation
		value = 50
	}
}

BUL_befriend_ENG = {
	allowed = {
		original_tag = BUL
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		OR = {
			has_country_flag = BUL_AI_RANDOM_DEMOCRATIC_LIBERAL
			has_game_rule = {
				rule = BUL_ai_behavior 
				option = DEMOCRATIC_LIBERAL
			}
		}
		focus_progress = {
			focus = BUL_legislative_elections
			progress > 0.1
		}
		country_exists = ENG
		ENG = {
			has_opinion	= {
				target = ROOT
				value < 50
			}
			has_capitulated = no
			is_subject = no
		}
		OR = {
			has_government = democratic
			has_government = neutrality
		}
	}
	abort = {
		OR = {
			NOT = { country_exists = ENG }
			has_war_with = ENG
			ENG = {
				OR = {
					has_government = fascism
					has_government = communism
					has_opinion	= {
						target = ROOT
						value > 80
					}
					has_capitulated = yes
					is_subject = yes
				}
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = ENG
		target = improve_relation
		value = 200
	}
}

BUL_befriend_GRE = {
	allowed = {
		original_tag = BUL
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		OR = {
			has_country_flag = BUL_AI_RANDOM_DEMOCRATIC_SOCIALIST
			has_game_rule = {
				rule = BUL_ai_behavior 
				option = DEMOCRATIC_SOCIALIST
			}
		}
		focus_progress = {
			focus = BUL_legislative_elections
			progress > 0.1
		}
		country_exists = GRE
		GRE = {
			has_opinion	= {
				target = ROOT
				value < 50
			}
			has_capitulated = no
			is_subject = no
		}
	}
	abort = {
		OR = {
			NOT = { country_exists = GRE }
			has_war_with = GRE
			GRE = {
				OR = {
					AND = {
						is_in_faction = yes
						NOT = { is_in_faction_with = ROOT }
					}
					has_opinion	= {
						target = ROOT
						value > 80
					}
					has_capitulated = yes
					is_subject = yes
				}
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = GRE
		target = improve_relation
		value = 200
	}
}

BUL_befriend_YUG = {
	allowed = {
		original_tag = BUL
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		OR = {
			has_country_flag = BUL_AI_RANDOM_COMMUNIST_BALKAN_FEDERATION
			has_game_rule = {
				rule = BUL_ai_behavior 
				option = COMMUNIST_BALKAN_FEDERATION
			}
		}
		focus_progress = {
			focus = BUL_the_peoples_republic_of_bulgaria
			progress > 0.1
		}
		country_exists = YUG
		YUG = {
			has_opinion	= {
				target = ROOT
				value < 50
			}
			has_capitulated = no
			is_subject = no
		}
	}
	abort = {
		OR = {
			NOT = { country_exists = YUG }
			has_war_with = YUG
			YUG = {
				OR = {
					AND = {
						is_in_faction = yes
						NOT = { is_in_faction_with = ROOT }
					}
					has_opinion	= {
						target = ROOT
						value > 80
					}
					has_capitulated = yes
					is_subject = yes
				}
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = YUG
		target = improve_relation
		value = 200
	}
}

BUL_befriend_SOV = {
	allowed = {
		original_tag = BUL
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		OR = {
			has_country_flag = BUL_AI_RANDOM_COMMUNIST
			has_game_rule = {
				rule = BUL_ai_behavior 
				option = COMMUNIST
			}
		}
		focus_progress = {
			focus = BUL_the_peoples_republic_of_bulgaria
			progress > 0.1
		}
		country_exists = SOV
		SOV = {
			has_opinion	= {
				target = ROOT
				value < 50
			}
			has_capitulated = no
			is_subject = no
		}
		has_government = communism
	}
	abort = {
		OR = {
			NOT = { country_exists = SOV }
			has_war_with = SOV
			SOV = {
				OR = {
					NOT = { has_government = communism }
					has_opinion	= {
						target = ROOT
						value > 80
					}
					has_capitulated = yes
					is_subject = yes
				}
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = SOV
		target = improve_relation
		value = 200
	}
}

BUL_occupying_instead_of_dieing = {
	allowed = {
		original_tag = BUL
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		is_historical_focus_on = yes
		country_exists = GER
	}
	abort = {
		OR = {
			NOT = { country_exists = GER }
			date > 1941.04.01
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = GER
		target = join_allies
		value = -99999
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = GER
		target = call_allies
		value = -99999
	}
}

BUL_dont_pressure_bulgarians_yet = {
	allowed = {
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		is_in_faction_with = BUL
		OR = {
			tag = GER
			is_in_faction_with = GER
			tag = ITA
			is_in_faction_with = ITA
		}
		BUL = {
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
		has_war = yes
	}
	abort = {
		OR = {
			BUL = {
				OR = {
					has_war = yes
					has_government = communism
					has_government = democratic
				}
			}
			NOT = { is_in_faction_with = BUL }
			date > 1941.04.01
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = BUL
		target = call_allies
		value = -99999
	}
}

BUL_reject_bulgarian_aggressive_ai = {
	allowed = {
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		is_in_faction_with = BUL
		BUL = {
			is_ai = yes
			OR = {
				has_government = neutrality
				has_government = fascism
			}
		}
		OR = {
			tag = GER
			is_in_faction_with = GER
			tag = ITA
			is_in_faction_with = ITA
		}
		has_war = yes
	}
	abort = {
		OR = {
			BUL = {
				OR = {
					is_ai = no
					has_war = yes
					has_government = communism
					has_government = democratic
				}
			}
			date > 1941.04.01
		}
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = BUL
		target = join_allies
		value = -99999
	}
}

BUL_we_dont_want_to_fight_sov = {
	allowed = {
		original_tag = BUL
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		has_completed_focus = BUL_power_to_the_tsar
	}
	abort = {
		OR = {
			has_completed_focus = BUL_the_eastern_front
			date > 1945.01.01
		}
	}

	ai_strategy = {
		type = dont_join_wars_with
		id = GER
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = ITA
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = TUR
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = ROM
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = GRE
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = YUG
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = HUN
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = SLO
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = CZE
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = JAP
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = FRA
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = AUS
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = ENG
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = dont_join_wars_with
		id = FIN
		target_country = SOV
		value = 99999
	}
	ai_strategy = {
		type = declare_war
		id = SOV			
		value = -2000 
	}
}

BUL_address_internal_affairs_first = {
	allowed = {
		original_tag = BUL
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		OR = {
			has_completed_focus = BUL_power_to_the_tsar
			has_completed_focus = BUL_oppose_the_royal_dictatorship
		}
	}
	abort = {
		OR = {
			has_war = yes
			date > 1941.1.1
		}
	}

	ai_strategy = { 
		type = pp_spend_priority
		id = admiral
		value = -9999
	}

	ai_strategy = {
		type = pp_spend_priority
		id = guarantee
		value = -9999
	}

	ai_strategy = { 
		type = pp_spend_priority
		id = relation
		value = 10
	}

	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = 17
	}
}

BUL_cajole_the_brits = {
	allowed = {
		original_tag = BUL
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		OR = {
			has_country_flag = BUL_AI_RANDOM_THE_RETURN_OF_FERDINAND
			has_game_rule = {
				rule = BUL_ai_behavior 
				option = THE_RETURN_OF_FERDINAND
			}
		}
		has_completed_focus = BUL_negotiate_bulgarian_rearmament
		country_exists = ENG
		ENG = {
			has_opinion	= {
				target = ROOT
				value < 50
			}
			has_capitulated = no
			is_subject = no
		}
		OR = {
			has_idea = BUL_army_restrictions
			has_idea = BUL_army_restrictions_aat
		}
		NOT = { has_country_flag = { flag = BUL_rearmament_flag value = 2 } }
	}
	abort = {
		OR = {
			NOT = { country_exists = ENG }
			has_war_with = ENG
			ENG = {
				OR = {
					has_capitulated = yes
					is_subject = yes
				}
			}
			has_country_flag = { flag = BUL_rearmament_flag value = 2 }
			OR = {
				NOT = { has_idea = BUL_army_restrictions }
				NOT = { has_idea = BUL_army_restrictions_aat }
			}
			has_political_power < 10
			ENG = {
				has_opinion	= {
					target = ROOT
					value > 85
				}
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = ENG
		target = improve_relation
		value = 200
	}
}

BUL_ff_decisions = {
	allowed = {
		original_tag = BUL
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		OR = {
			has_active_mission = BUL_ff_impending_coup_mission
		}
	}
	abort = {
		OR = {
			has_war = no
			date > 1942.12.12
		}
	}

	ai_strategy = { 
		type = pp_spend_priority
		id = decision
		value = 9999
	}

	ai_strategy = {
		type = pp_spend_amount
		id = decision
		value = 200
   }
