
ENG_a_change_in_course_pp_spending = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		has_government = democratic
		has_completed_focus = ENG_a_change_in_course
		has_war = no
		is_subject = no
	}
	abort_when_not_enabled = yes

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


ENG_trying_to_save_benelux_is_deathtrap = {
	allowed = { 
		OR = {
			original_tag = ENG
			original_tag = CAN
			original_tag = RAJ
			original_tag = SAF
			original_tag = AST
			original_tag = NZL
		} 
	}
	enable = {
		OR = {
			has_global_flag = vanilla_history
			NOT = {
				any_country = {
					has_war_with = FRA
					is_ai = no
					is_major = yes
				}
			}
			SOV = { is_ai = no }
		}
		OR = {
			FRA = { is_ai = yes }
			has_global_flag = FRA_welfare_disabled
		}	
		is_historical_focus_on = yes
		has_war_with = GER
		date < 1940.6.1
		NOT = {
			AND = {
				OR = {
					GER = { is_ai = no }
					ITA = { is_ai = no }
				}
				is_historical_focus_on = yes
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_unit_request
		area = mainland_europe
		value = -500
	}

	ai_strategy = {
		type = dont_defend_ally_borders
		id = "HOL"
		value = 170
	}
	ai_strategy = {
		type = dont_defend_ally_borders
		id = "BEL"
		value = 150
	}
	ai_strategy = {
		type = dont_defend_ally_borders
		id = "LUX"
		value = 150
	}
	ai_strategy = {
		type = dont_defend_ally_borders
		id = "FRA"
		value = 150
	}
}



allies_tryhard_grace = {
	enable = {
		has_idea = AI_aggressive
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		tag = GER

		ratio = 0.3

		priority = 200
		ordertype = front
		execution_type = rush
		execute_order = yes
	}	

	ai_strategy = {
		type = front_control

		tag = ITA

		ratio = 0.3

		priority = 200
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

	ai_strategy = {
		type = front_control

		tag = FRA

		ratio = 0.3

		priority = 200
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.3

		priority = 200
		ordertype = front
		execution_type = rush
		execute_order = yes
	}
}

d_day_wait_normandy_BRA = {
	allowed = {
		is_allied_ai = yes
	}
	enable = {
		is_allied_ai = yes
		is_in_faction_with = ENG
		original_tag = BRA
		any_country = {
			OR = {
				has_idea = d_day_preparation_1 
				has_idea = d_day_preparation_2 
				has_idea = d_day_preparation_3
			}
			OR = {
				original_tag = ENG
				is_ai = no 
				is_in_faction_with = ENG
			}
		}
	}

	abort = {
		any_state = {
			OR = {
				state = 15
				state = 14
				state = 29
				state = 785
				state = 6
				state = 7
				state = 36
			}
			controller = { is_in_faction_with = ENG }
		}
	}

	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		# south england
		states = {
			125
			126
			127
			128
			129
			338
			123
			122
		}

		ratio = 1

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}

	ai_strategy = {
		type = area_priority
		id = asia
		value = -80
	}

	ai_strategy = {
  		type = garrison
   		value = -70
   	}

	ai_strategy = {
		type = dont_defend_ally_borders
		value = 500
		target = asia
	}

	ai_strategy = {
		type = dont_defend_ally_borders
		value = 500
		id = "FRA"
	}

}
d_day_wait_italy = {
	allowed = {
		is_allied_ai = yes
	}
	enable = {
		is_allied_ai = yes
		is_in_faction_with = ENG
		OR = {
			original_tag = ARG
			original_tag = URG
			original_tag = CHL
		}
		any_country = {
			OR = {
				has_idea = d_day_preparation_1 
				has_idea = d_day_preparation_2
			}
			OR = {
				original_tag = ENG
				is_ai = no 
				is_in_faction_with = ENG
			}
		}
	}

	abort = {
		any_state = {
			is_core_of = ITA
			is_on_continent = europe
			NOT = { state = 114 }
			controller = { is_in_faction_with = ENG }
		}
	}

	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		states = {
			1
			114
		}

		ratio = 1

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}

	ai_strategy = {
		type = dont_defend_ally_borders
		value = 500
		target = asia
	}

	ai_strategy = {
		type = area_priority
		id = asia
		value = -80
	}

	ai_strategy = {
  		type = garrison
   		value = -70
   	}

}

d_day_europe_on_the_beach_BRA = {
	allowed = {
		is_allied_ai = yes
	}
	enable = {
		is_allied_ai = yes
		is_in_faction_with = ENG
		original_tag = BRA
		any_state = {
			OR = {
				state = 15
				state = 14
				state = 29
				state = 785
				state = 6
				state = 7
				state = 36
			}
			controller = { is_in_faction_with = ENG }
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = dont_defend_ally_borders
		value = 500
		target = asia
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 500
		id = "FRA"
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 500
		id = "HOL"
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 500
		id = "BEL"
	}

	ai_strategy = {
		type = area_priority
		id = normandy_landing_zone
		value = 500
	}

	ai_strategy = {
		type = area_priority
		id = south_france_landing_zone
		value = -80
	}

	ai_strategy = {
		type = area_priority
		id = asia
		value = -80
	}

	ai_strategy = {
		type = area_priority
		id = africa
		value = -80
	}

	ai_strategy = {
		type = area_priority
		id = europe
		value = 80
	}

	ai_strategy = {
  		type = garrison
   		value = -70
   	}

}
d_day_wait_normandy_MEX = {
	allowed = {
		is_allied_ai = yes
	}
	enable = {
		is_allied_ai = yes
		is_in_faction_with = ENG
		original_tag = MEX
		any_country = {
			OR = {
				has_idea = d_day_preparation_1 
				has_idea = d_day_preparation_2
			}
			OR = {
				original_tag = ENG
				is_ai = no 
				is_in_faction_with = ENG
			}
		}
	}

	abort = {
		any_state = {
			is_core_of = FRA
			NOT = { state = 1 }
			is_on_continent = europe
			controller = { is_in_faction_with = ENG }
		}
	}

	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		# south england
		states = {
			125
			126
			127
			128
			129
			338
			123
			1
			122		
			114
		}

		ratio = 1

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}

	ai_strategy = {
		type = area_priority
		id = asia
		value = -80
	}

	ai_strategy = {
  		type = garrison
   		value = -70
   	}

	ai_strategy = {
		type = dont_defend_ally_borders
		value = 500
		target = asia
	}

}

d_day_europe_on_the_beach_MEX = {
	allowed = {
		is_allied_ai = yes
	}
	enable = {
		is_allied_ai = yes
		is_in_faction_with = ENG
		original_tag = MEX
		any_state = {
			is_core_of = FRA
			NOT = { state = 1 }
			is_on_continent = europe
			controller = { is_in_faction_with = ENG }
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = dont_defend_ally_borders
		value = 500
		target = asia
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 500
		id = "FRA"
	}

	ai_strategy = {
		type = area_priority
		id = asia
		value = -80
	}

	ai_strategy = {
		type = area_priority
		id = europe
		value = -80
	}

	ai_strategy = {
  		type = garrison
   		value = -70
   	}

}

d_day_europe_on_the_beach_italy = {
	allowed = {
		is_allied_ai = yes
	}
	enable = {
		is_allied_ai = yes
		is_in_faction_with = ENG
		OR = {
			original_tag = ARG
			original_tag = URG
			original_tag = CHL
		}
		any_state = {
			is_core_of = ITA
			NOT = { state = 114 }
			is_on_continent = europe
			controller = { is_in_faction_with = ENG }
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = dont_defend_ally_borders
		value = 500
		target = asia
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 500
		id = "ENG"
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 500
		id = "RDS"
	}

	ai_strategy = {
		type = area_priority
		id = asia
		value = -80
	}

	ai_strategy = {
		type = area_priority
		id = italy
		value = 200
	}

	ai_strategy = {
  		type = garrison
   		value = -70
   	}

}

allies_dont_waste_tanks_in_the_jungle = {
	enable = {
		is_in_faction_with = ENG
		any_enemy_country = {
			is_major = yes
			capital_scope = { is_on_continent = europe }
			has_capitulated = no
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_armor_score
		id = "SIA"
		value = -500
	}

	ai_strategy = {
		type = front_armor_score
		id = "JAP"
		value = -500
	}

	ai_strategy = {
		type = front_armor_score
		id = "MAN"
		value = -500
	}

	ai_strategy = {
		type = front_armor_score
		id = "CHI"
		value = -500
	}

	ai_strategy = {
		type = front_armor_score
		id = "YUN"
		value = -500
	}

	ai_strategy = {
		type = front_armor_score
		id = "GXC"
		value = -500
	}
}
allies_dont_waste_tanks_in_the_jungle_ENG = {
	allowed = {
		original_tag = ENG
	}
	reversed = yes
	enable = {
		has_war_with = ENG
		capital_scope = { is_on_continent = asia }
		any_neighbor_country = {
			is_in_faction_with = ENG
			has_capitulated = no
		}
				
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_armor_score
		id = "ENG"
		value = -200
	}
}
allies_dont_waste_tanks_in_the_jungle_USA = {
	allowed = {
		original_tag = USA
	}
	reversed = yes
	enable = {
		has_war_with = USA
		capital_scope = { is_on_continent = asia }
		any_neighbor_country = {
			is_in_faction_with = USA
			has_capitulated = no
		}
				
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_armor_score
		id = "USA"
		value = -200
	}
}

allied_d_day_preference = {
	enable = {
		is_allied_ai = yes
		is_in_faction_with = ENG
		GER_is_not_relevant_to_allies = no
		OR = {
			RAJ = { surrender_progress < 0.1 }
			has_global_flag = d_day_crisis
			GER = { surrender_progress > 0.1 }
		}
		OR = {
			original_tag = ENG
			original_tag = MEX
			original_tag = BRA
			original_tag = CAN
			original_tag = FRA
			original_tag = YUG
			original_tag = IRE
			original_tag = TUR
			original_tag = ARG
			original_tag = CHL
			original_tag = URG
			original_tag = GRE
			original_tag = ETH
			original_tag = USA
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_unit_request
		id = "JAP"
		value = -50
	}

	ai_strategy = {
		type = area_priority
		id = asia
		value = -50
	}

	ai_strategy = {
		type = area_priority
		id = mainland_europe
		value = 50
	}

	ai_strategy = {
		type = front_armor_score
		id = "SIA"
		value = -500
	}

	ai_strategy = {
		type = front_armor_score
		id = "JAP"
		value = -500
	}

}
allied_asia_preference = {
	enable = {
		is_in_faction_with = ENG
		OR = {
			AND = {
				GER = { is_ai = yes }
				CHI = { has_country_flag = LSM_eligibility_nation }
			}
			date > 1941.3.1
			has_war_with = JAP
			has_war_with = CHI
			JAP = { has_wargoal_against = ROOT }
			JAP = { has_wargoal_against = ENG }
			JAP = { is_justifying_wargoal_against = ROOT }
			JAP = { is_justifying_wargoal_against = ENG }
		}
		OR = {
			original_tag = AST
			original_tag = MAL
			original_tag = RAJ
			original_tag = PHI
			original_tag = SAF
			original_tag = ETH
			original_tag = NEP
			capital_scope = { is_on_continent = asia }
			AND = { 
				original_tag = HOL
				has_capitulated = yes
			}
			original_tag = INS
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_unit_request
		country_trigger = {
			is_in_faction_with = jAP
		}
		value = 25
	}

	ai_strategy = {
		type = area_priority
		id = asia
		value = 120
	}

	ai_strategy = {
		type = front_unit_request
		area = mainland_europe
		value = -50
	}

}
african_fun_time = {
	allowed = {
		OR = {
			original_tag = SAF
			original_tag = ETH
			original_tag = AST
			original_tag = MAL
			original_tag = NZL
		}
	}
	enable = {
		OR = {
			has_war = yes
			threat > 0.5
		}
		NOT = { 
			any_country = { 
				capital_scope = { is_on_continent = asia } 
				OR = {
					is_justifying_wargoal_against = ENG
					is_justifying_wargoal_against = ROOT
					has_wargoal_against = ENG
					has_wargoal_against = ROOT
				}
			}
		}
		date < 1941.1.1
		is_allied_ai = yes
		is_in_faction_with = ENG
		GER_is_not_relevant_to_allies = no
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		order_id = 2
		states = {
			447
		}

		ratio = 0.8

		area = suez

		subtract_invasions_from_need = no
		subtract_fronts_from_need = no
	}
	ai_strategy = {
		type = ai_wanted_divisions_factor
		value = 300
	}
	ai_strategy = {
		type = garrison
		value = -9999
	}
}
ENG_always_worry_about_invasion_support_england_first_if_you_cant_fight = {
	enable = {
		is_in_faction_with = ENG
		ENG_always_worry_invasion_condition_1 = yes
		transition_no_europe_war = no
		has_capitulated = yes
		OR = {
			AND = {
				tag = FRA
				num_of_military_factories < 100
				NOT = { 16 = { is_controlled_by = FRA } }
				NOT = { 15 = { is_controlled_by = FRA } }
			}
			AND = {
				is_major = no
				num_of_military_factories < 6
				has_manpower < 50000
			}
			AND = {
				is_major = yes
				num_of_military_factories < 12
				has_manpower < 200000
			}
			NOT = {
				any_country = {
					NOT = { tag = ENG }
					is_in_faction_with = ENG
					num_of_military_factories > 150
					OR = {
						NOT = { capital_scope = { is_on_continent = europe } }
						NOT = { surrender_progress > 0 }
					}
				}
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		# south england
		states = {
			125
			126
			127
			130
			123
			338
			131
			121
			932
			119
			132
			122
			4
			12
			6
		}

		ratio = 1

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}
	ai_strategy = {
		type = garrison
		value = -9999
	}

	ai_strategy = {
		type = naval_avoid_region
		id = 18
		value = 100
	}

	ai_strategy = {
		type = area_priority
		id = UK
		value = 25
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 16
	}
}
ENG_always_worry_about_invasion_support_england_first_if_you_cant_fight_2 = {
	enable = {
		is_in_faction_with = ENG
		ENG_always_worry_invasion_condition_1 = no
		has_capitulated = yes
		OR = {
			surrender_progress > 0.9
			AND = {
				tag = FRA
				num_of_military_factories < 100
				NOT = { 16 = { is_controlled_by = FRA } }
				NOT = { 15 = { is_controlled_by = FRA } }
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		# south england
		states = {
			125
			126
			127
			130
			123
			338
			131
			121
			119	
			932
			132
			122
			4
			12
			6
		}

		ratio = 0.75

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}
	ai_strategy = {
		type = garrison
		value = -9999
	}

	ai_strategy = {
		type = naval_avoid_region
		id = 18
		value = 100
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 16
	}
}
ENG_always_worry_about_invasion = {
	enable = {
		is_in_faction_with = ENG
		ENG_always_worry_invasion_condition_1 = yes
		transition_no_europe_war = no
		if = {
			limit = {
				has_capitulated = no
				capital_scope = { NOT = { is_on_continent = europe } }
			}
			NOT = {
				any_country = {
					is_neighbor_of = ROOT
					has_war_with = ROOT
				}
			}
		}
		OR = {
			has_capitulated = no
			AND = {
				is_major = no
				num_of_military_factories > 5
				has_manpower > 50000
			}
			AND = {
				is_major = yes
				num_of_military_factories > 10
				has_manpower > 200000
			}
			NOT = {
				any_country = {
					NOT = { tag = ENG }
					is_in_faction_with = ENG
					num_of_military_factories > 150
					OR = {
						NOT = { capital_scope = { is_on_continent = europe } }
						NOT = { surrender_progress > 0 }
					}
				}
			}	
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		# south england
		states = {
			125
			126
			127
			130
			123
		}

		ratio = 0.60

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}


	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		# south england
		states = {
			338
			131
			121
			119
			132
			122
			4
			12
			6
		}

		ratio = 0.20

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}

	ai_strategy = {
		type = area_priority
		id = asia
		value = -80
	}

	ai_strategy = {
		type = dont_defend_ally_borders
		value = 500
		id = "FRA"
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 16
	}
}
ENG_the_natural_defense_of_britain_natural = {
	enable = {
		is_in_faction_with = ENG
		ENG_always_worry_invasion_condition_1 = no
		ENG_always_worry_invasion_condition_2 = no
		transition_no_europe_war = no
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		order_id = 3

		# south england
		states = {
			125
			126
			127
			130
			123
			4
			12
			6
		}

		ratio = 0.35

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}


	ai_strategy = {
		type = put_unit_buffers

		order_id = 3

		# south england
		states = {
			338
			131
			121
			119
			132
			932
			122
			4
			12
			6
		}

		ratio = 0.10

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 16
	}
}
ENG_the_natural_defense_of_britain = {
	allowed = {
		tag = ENG
	}
	enable = {
		ENG_always_worry_invasion_condition_1 = no
		ENG_always_worry_invasion_condition_2 = yes
		transition_no_europe_war = no
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		order_id = 3

		# south england
		states = {
			125
			126
			127
			130
			123
			4
			12
			6
		}

		ratio = 0.35

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}


	ai_strategy = {
		type = put_unit_buffers

		order_id = 3

		# south england
		states = {
			338
			131
			121
			119
			132
			122
			4
			932
			12
			6
		}

		ratio = 0.20

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 1
		value = 35000
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 16 # cape verde plain
		value = 100
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 43 # cape verde plain
		value = 100
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 16
	}
}
ENG_the_natural_defense_of_britain_member = {
	enable = {
		is_in_faction_with = ENG
		transition_no_europe_war = no
		OR = {
			has_capitulated = yes
			NOT = {
				any_country = {
					is_neighbor_of = ROOT
					has_war_with = ROOT
				}
			}
		}
		NOT = { tag = ENG }
		NOT = { tag = SAF }
		NOT = { tag = ETH }
		OR = {
			NOT = { capital_scope = { is_on_continent = europe } }
			has_capitulated = yes
			AND = {
				surrender_progress > 0.5
				NOT = { has_country_flag = paradrop_grace }
			}
		}
		ENG_always_worry_invasion_condition_1 = no
		ENG_always_worry_invasion_condition_2 = yes
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		order_id = 3

		# south england
		states = {
			125
			126
			127
			130
			123
			4
			12
			6
		}

		ratio = 0.25

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}


	ai_strategy = {
		type = put_unit_buffers

		order_id = 3

		# south england
		states = {
			338
			131
			121
			119
			132
			932
			122
		}

		ratio = 0.25

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}
	ai_strategy = {
		type = strategic_air_importance
		id = 1
		value = 35000
	}
}
ENG_always_worry_about_invasion_ex = {
	allowed = {
		is_allied_ai = yes
	}
	enable = {
		transition_no_europe_war = no
		OR = {
			AND = {
				NOT = { tag = FRA }
				NOT = { tag = HOL }
				NOT = { tag = BEL }
				OR = {
					NOT = { tag = ETH }
					AND = {
						NOT = { 
							any_country = { 
								capital_scope = { is_on_continent = asia } 
								is_justifying_wargoal_against = ENG
							}
						}
						date < 1941.5.1
					}
				}
				OR = {
					NOT = { tag = SAF }
					AND = {
						NOT = { 
							any_country = { 
								capital_scope = { is_on_continent = asia } 
								is_justifying_wargoal_against = ENG
							}
						}
						date < 1941.5.1
					}
				}
				OR = {
					NOT = { tag = AST }
					AND = {
						NOT = { 
							any_country = { 
								capital_scope = { is_on_continent = asia } 
								is_justifying_wargoal_against = ENG
							}
						}
						date < 1941.5.1
					}
				}
				OR = {
					NOT = { tag = RAJ }
					AND = {
						NOT = { 
							any_country = { 
								capital_scope = { is_on_continent = asia } 
								is_justifying_wargoal_against = ENG
							}
						}
						date < 1941.5.1
					}
				}
				OR = {
					NOT = { tag = MAL }
					AND = {
						NOT = { 
							any_country = { 
								capital_scope = { is_on_continent = asia } 
								is_justifying_wargoal_against = ENG
							}
						}
						date < 1941.5.1
					}
				}
			}
			has_capitulated = yes
			has_global_flag = vanilla_history
			AND = {
				tag = FRA
				surrender_progress > 0.50 #time to flee
				NOT = { has_country_flag = paradrop_grace }
			}
		}
		is_in_faction_with = ENG
		OR = {
			AND = {
				NOT = { GER = { has_war_with = SOV } }
				country_exists = SOV
			}
			NOT = { country_exists = SOV }
			NOT = {
				any_country = {
					is_in_faction_with = ENG
					num_of_military_factories > 150
					OR = {
						NOT = { capital_scope = { is_on_continent = europe } }
						NOT = { surrender_progress > 0 }
					}
				}
			}
		}
		ENG = { surrender_progress < 0.02 }
		if = {
			limit = {
				FRA = { is_ai = yes }
				FRA = { is_in_faction_with = ENG }
			}
			FRA = { has_capitulated = no }
			FRA = { 
				surrender_progress > 0.20 
				NOT = { has_country_flag = paradrop_grace }
			}
		}
		if = {
			limit = {
				FRA = { is_ai = no }
				FRA = { is_in_faction_with = ENG }
			}
			FRA = { has_capitulated = no }
			FRA = { surrender_progress > 0.80 }
		}
		if = {
			limit = {
				NOT = { FRA = { is_in_faction_with = ENG } }
			}
			NOT = { FRA = { has_government = democratic } }
		}
		GER_is_not_relevant_to_allies = no
		NOT = {
			OR = {
				has_idea = d_day_preparation_1 
				has_idea = d_day_preparation_2
				has_idea = d_day_preparation_3
			}
		} 
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		# south england
		states = {
			125
			126
			127
			130
			123
		}

		ratio = 0.45

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}


	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		# south england
		states = {
			338
			131
			121
			119
			132
			122
			4
			12
			6
		}

		ratio = 0.20

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}

	ai_strategy = {
		type = area_priority
		id = asia
		value = -80
	}

	ai_strategy = {
		type = dont_defend_ally_borders
		value = 500
		id = "FRA"
	}
}
ENG_always_worry_about_invasion_WW3 = {
	enable = {
		transition_no_europe_war = no
		OR = {
			NOT = { tag = FRA }
			NOT = { tag = HOL }
			NOT = { tag = BEL }
			NOT = { tag = LUX }
			NOT = { tag = RAJ }
			NOT = { tag = MAL }
			NOT = { tag = ETH }
			NOT = { capital_scope = { is_on_continent = asia } }
			has_capitulated = yes
			has_global_flag = vanilla_history
			AND = {
				tag = FRA
				surrender_progress > 0.3 #time to flee
			}
		}
		has_war_with = SOV
		FRA = { surrender_progress > 0.7 }
		is_in_faction_with = ENG
		ENG = { surrender_progress < 0.02 }
		NOT = {
			OR = {
				has_idea = d_day_preparation_1 
				has_idea = d_day_preparation_2
				has_idea = d_day_preparation_3
			}
		} 
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		order_id = 2

		# south england
		states = {
			125
			126
			127
			338
			123
			130
			131
			121
			119
			132
			122
		}

		ratio = 0.6

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}

	ai_strategy = {
		type = area_priority
		id = asia
		value = -80
	}

	ai_strategy = {
		type = dont_defend_ally_borders
		value = 500
		id = "FRA"
	}
}

ENG_saved_burma = {
	enable = {
		is_in_faction_with = ENG
		NOT = {
			OR = {
				has_idea = d_day_preparation_1	
				has_idea = d_day_preparation_2	
				has_idea = d_day_preparation_3
			}
		}
		has_war_with = JAP
		has_war_with = SIA	
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = strategic_air_importance
		id = 189
		value = 35000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 141
		value = 12000
	}
}

ENG_always_worry_about_invasion21 = {
	enable = {
		NOT = { tag = SAF }
		NOT = { tag = ETH }
		is_in_faction_with = ENG
		FRA = { 
			surrender_progress > 0.1
			NOT = { has_country_flag = paradrop_grace }	
		}	
	}

	abort = {
		OR = {
			GER = { has_war_with = SOV }
			has_global_flag = {
				flag = FRA_already_surrendered
				days > 365 
			}
		}
	}

	ai_strategy = {
		type = area_priority
		id = UK
		value = 200
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 16 
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 1 #Strategic Region ID - English Channel
		value = 25000 #Too easy to lose planes here
	}
}

ENG_always_worry_about_invasion23 = {
	enable = {
		is_in_faction_with = ENG
		ENG = { surrender_progress > 0.02 }
	}

	abort = {
		NOT = { ENG = { surrender_progress > 0 } }
	}

	ai_strategy = {
		type = front_unit_request
		state_trigger = { 
			is_core_of = ENG
		}
		value = 50
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 9999
		id = "ENG"
	}

	ai_strategy = {
		type = area_priority
		id = UK
		value = 500
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 18
		value = 3000
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 16
		value = 3000
	}


	ai_strategy = {
		type = naval_convoy_raid_region
		id = 43
		value = 3000
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 16 
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 18 #Strategic Region ID - English Channel
		value = 25000 #Too easy to lose planes here
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 1 #Strategic Region ID - English Channel
		value = 25000 #Too easy to lose planes here
	}
}
ENG_always_worry_about_invasion24 = {
	enable = {
		is_in_faction_with = ENG
		ENG = { surrender_progress > 0.02 }
		has_capitulated = yes
	}

	abort = {
		NOT = { ENG = { surrender_progress > 0 } }
	}

	ai_strategy = {
		type = front_unit_request
		state_trigger = { 
			NOT = { is_core_of = ENG }
		}
		value = -500
	}

	ai_strategy = {
		type = front_unit_request
		state_trigger = { 
			is_core_of = ENG 
			NOT = { is_fully_controlled_by = ENG }
		}
		value = 100
	}
}
give_no_two_shit_about_communist_china = {
	allowed = { original_tag = ENG }

	enable = {
		CHI = { has_completed_focus = CHI_british_cooperation }
		CHI = {
			OR = {
				is_faction_leader = yes 
				is_in_faction_with = ENG
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "PRC"
		value = -9999
	}
}

give_no_two_shit_about_england = {
	allowed = { original_tag = PRC }

	enable = {
		CHI = { has_completed_focus = CHI_british_cooperation }
		CHI = {
			OR = {
				is_faction_leader = yes 
				is_in_faction_with = ENG
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = -9999
	}
}

allies_we_need_more_bombs = {
	allowed = {
		OR = {
			original_tag = ENG
			original_tag = USA
		}
	}
	enable = {
		OR = {
			AND = {
				has_deployed_air_force_size = {
					size > 8999 #we control the sky
					type = fighter
				}
				NOT = {
					any_country = {
						has_war_with = ROOT
						has_deployed_air_force_size = {
							size > 4999 #but they don't
							type = fighter
						}
					}
				}
			}
			has_deployed_air_force_size = {
				size > 12999 #we control the sky
				type = fighter
			}	
		}
		NOT = { has_idea = LSM_victory_in_europe }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = unit_ratio
		id = fighter
		value = 1
	}

	ai_strategy = {
		type = unit_ratio
		id = cas
		value = 30
	}

	ai_strategy = {
		type = unit_ratio
		id = tactical_bomber
		value = 8
	}

	ai_strategy = {
		type = unit_ratio
		id = strategic_bomber
		value = 0
	}

	ai_strategy = {
		type = unit_ratio
		id = naval_bomber
		value = 1
	}

 	ai_strategy = {
		type = equipment_production_factor
		id = cas
		value = 15 #we really control the sky sooooo...
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = cas
		value = 30
	}

	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = -15
	}
}

allies_save_the_soviet_union = {
	enable = {
		is_in_faction_with = ENG
		has_war = yes
		NOT = { has_government = fascism }
		NOT = { is_in_faction_with = GER }
		NOT = { has_war_with = SOV }
		has_war_with = GER
		GER = { has_war_with = SOV }
		OR = {
			SOV = { is_ai = yes }
			SOV = { surrender_progress > 0.30 }
			SOV = { num_of_military_factories < 150 }
		}
		OR = {
			SOV = { surrender_progress > 0.05 }
			GER = { is_ai = no }
		}
	}

	abort = {
		OR = {
			has_war = no
			has_war_with = SOV
			NOT = { GER = { has_war_with = SOV } }
			is_in_faction_with = GER
			has_government = fascism
			SOV = { has_war = no }
			has_idea = d_day_preparation_3
		}
	}

	ai_strategy = {
		type = support
		id = "SOV"
		value = 500
	}

	ai_strategy = {
		type = send_lend_lease_desire
		id = "SOV"
		value = 500
	}
}

allies_save_the_soviet_union_player = {
	enable = {
		is_in_faction_with = ENG
		has_war = yes
		NOT = { has_government = fascism }
		NOT = { is_in_faction_with = GER }
		NOT = { has_war_with = SOV }
		has_war_with = GER
		GER = { has_war_with = SOV }
		SOV = { is_ai = no }
		SOV = {
			OR = {
				num_of_military_factories < 150
				surrender_progress > 0.2
			}
		}
	}

	abort = {
		OR = {
			has_war = no
			has_war_with = SOV
			NOT = { GER = { has_war_with = SOV } }
			is_in_faction_with = GER
			has_government = fascism
			SOV = { has_war = no }
			has_idea = d_day_preparation_2
			has_idea = d_day_preparation_3
		}
	}

	ai_strategy = {
		type = support
		id = "SOV"
		value = 500
	}

	ai_strategy = {
		type = send_lend_lease_desire
		id = "SOV"
		value = 500
	}
}
allies_avoid_clogging_balkan = {
	allowed = {
		NOT = { tag = SAF }
		NOT = { tag = TUR }
		NOT = { tag = GRE }
	}
	enable = {
		OR = {
			is_in_faction_with = ENG
			is_in_faction_with = USA
		}
		has_war_with = BUL
	}
	abort = {
		OR = {
			NOT = { has_war_with = BUL }
			BUL = { surrender_progress > 0.3 }
		}
	}

	ai_strategy = {
		type = front_unit_request
		tag = BUL
		value = -60 
	}

	ai_strategy = {
		type = front_unit_request
		tag = ALB
		value = -40 
	}

	ai_strategy = {
		type = front_unit_request
		tag = MNT
		value = -40 
	}

	ai_strategy = {
		type = front_unit_request
		tag = YUG
		value = -40 
	}

	ai_strategy = {
		type = area_priority
		id = balkan_dead_spot
		value = -100 
	}

	ai_strategy = {
		type = front_unit_request
		area = balkan_dead_spot
		value = -100 
	}

	ai_strategy = {
		type = dont_defend_ally_borders
		id = "GRE"
		value = 300
	}
}

allies_victory_in_africa = {
	enable = {
		OR = {
			is_in_faction_with = ENG
			is_in_faction_with = USA
		}
		OR = {
			has_global_flag = allied_victory_in_africa
			date > 1943.1.1 #give up i guess
			has_idea = d_day_preparation_1
		}
	}
	abort = {
		surrender_progress > 0.01
	}

	ai_strategy = {
		type = area_priority
		id = europe
		value = 200
	}
}
ENG_the_blitz_1 = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		FRA = { is_in_faction_with = ENG }
		FRA = { has_capitulated = yes }
		has_war_with = GER
		has_war_with = ITA
	}
	abort = {
		has_global_flag = allied_victory_in_africa
	}

	ai_strategy = {
		type = air_factory_balance
		value = 50
	}

	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = 25
	}
}
ENG_the_blitz_2 = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		all_state = {
			OR = {
				NOT = { is_core_of = LBA }
				controller = { is_in_faction_with = ENG }
			}
		}
		has_war_with = GER
		has_war_with = ITA
	}
	abort = {
		has_global_flag = allied_victory_in_africa
	}

	ai_strategy = {
		type = air_factory_balance
		value = 50
	}

	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = 25
	}
}

the_push_into_the_reich = {
	enable = {
		OR = {
			has_equipment = { infantry_equipment > 15000 }
			has_equipment = { medium_tank_chassis > 1000 }
		}
		set_temp_variable = { push_days = global.num_days }
		modulo_temp_variable = { push_days = 90 }
		check_variable = { push_days < 18 }
		
		has_manpower > 500000
		has_war_with = GER
		OR = {
			AND = {
				GER = { surrender_progress > 0.05 }
				GER_is_not_relevant_to_allies = yes
			}
			has_global_flag = d_day_crisis
			AND = {
				FRA = { has_capitulated = no }
				is_in_faction_with = USA
				FRA = { is_in_faction_with = USA }
				GER = { has_war_with = SOV }
			}
		}
		FRA = { has_country_flag = LSM_eligibility_nation }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		state_trigger = {
			OR = {
				controller = {
					has_war_with = FROM.FROM
					is_in_faction_with = GER
				}
				owner = {
					is_in_faction_with = FROM.FROM
				}
			}
			is_on_continent = europe
		}

		ratio = 0.3

		priority = 300
		ordertype = front
		execution_type = balanced
	}

}

the_allies_are_on_a_roll_strategy = {
	enable = {
		has_idea = AI_aggressive_2
		has_army_manpower = { size > 200000 }
		has_manpower > 200000
		has_war_with = GER
		has_equipment = {
  			infantry_equipment > 2000
  		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		state_trigger = {
			OR = {
				controller = {
					has_war_with = FROM.FROM
					is_in_faction_with = GER
				}
				owner = {
					is_in_faction_with = FROM.FROM
				}
			}
			is_on_continent = europe
		}

		ratio = 0.0

		priority = 3000
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

}
USA_double_on_the_beaches = {
	allowed = {
		original_tag = USA
	}
	enable = {
		is_in_faction_with = ENG
		OR = {
			has_idea = d_day_preparation_2
			has_idea = d_day_preparation_3
		}
		any_country = {
			capital_scope = { is_on_continent = europe }
			is_faction_leader = yes
			has_war_with = USA
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = force_defend_ally_borders
		value = 50
		target = europe
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 500
		id = "ENG"
	}

}

allied_minor_on_the_beaches = {
	enable = {
		NOT = { capital_scope = { is_on_continent = asia } }
		NOT = { capital_scope = { is_on_continent = africa } }
		NOT = { capital_scope = { is_on_continent = australia } }
		is_in_faction_with = ENG
		has_global_flag = {
			flag = d_day_happened
			days > 7
		}
		is_major = no
		NOT = { tag = RAJ }
		NOT = { is_literally_china = yes }
		ITA = { has_civil_war = no }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = force_defend_ally_borders
		value = 50
		target = europe
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 200
		id = "ENG"
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 200
		id = "USA"
	}

}

allied_minor_on_the_mountains = {
	allowed = {
		OR = {
			tag = RAJ
			tag = NEP 
			tag = AST
			tag = NZL
			tag = SAF
			tag = TUR
			tag = GRE
		}
	}
	enable = {
		has_war_with = GER
		NOT = { GER = { has_war_with = SOV } }
		NOT = { 
			JAP = {
				OR = { 
					is_justifying_wargoal_against = ENG
					is_justifying_wargoal_against = ROOT
					has_wargoal_against = ENG
					has_wargoal_against = ROOT
				}
			}
		}
		OR = {
			NOT = { RAJ = { has_war_with = JAP } }
			NOT = { RAJ = { surrender_progress > 0 } }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = force_defend_ally_borders
		value = 200
		id = "GRE"
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 200
		id = "TUR"
	}

}

allied_save_the_corridor = {
	allowed = {
		is_allied_ai = yes
	}
	enable = {
		has_war_with = GER
		TUR = { surrender_progress > 0.2 }
	}
	abort = {
		TUR = { surrender_progress < 0.1 }
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 9999 #panic
		id = "TUR"
	}

}

allied_minor_on_italy = {
	enable = {
		is_in_faction_with = ENG
		is_major = no
		NOT = { capital_scope = { is_on_continent = asia } }
		NOT = { capital_scope = { is_on_continent = africa } }
		NOT = { capital_scope = { is_on_continent = australia } }
		NOT = { tag = RAJ }
		NOT = { is_literally_china = yes }
		OR = {
			ITA = { has_civil_war = yes }
			ITA = { surrender_progress > 0.4 }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = force_defend_ally_borders
		value = 200
		id = "RDS"
	}

}

allied_fight_VIC = {
	allowed = {
		OR = { 
			original_tag = ENG
			original_tag = USA
		}
	}
	enable = {
		OR = {
			is_in_faction_with = ENG
			is_in_faction_with = USA
		}
		OR = {
			date > 1942.1.1
			is_in_faction_with = USA
		}
		AND = {
			NOT = { has_global_flag = allied_victory_in_africa }
			date < 1943.1.1 #d-day prep must begin
		}
		OR = {
			AND = {
				tag = ENG
				any_country = {
					OR = {
						is_in_faction_with = VIC
						controls_state = 16
					}
					has_war_with = ENG
				}
			}
			AND = {
				tag = USA
				any_country = {
					OR = {
						is_in_faction_with = VIC
						controls_state = 16
					}
					has_war_with = USA
				}
			}
		}
	}

	abort = {
		OR = {
			has_global_flag = allied_victory_in_africa
			has_idea = d_day_preparation_2
			has_idea = d_day_preparation_3
			date > 1943.1.1
		}
	}
	
	ai_strategy = {
		type = prepare_for_war
		id = "VIC"
		value = 200
	}

	ai_strategy = {
		type = antagonize
		id = VIC
		value = 2500 # we hateses them filthy Vichy Frenches
	}
	ai_strategy = {
		type = declare_war
		id = VIC
		value = 500 # we hateses them filthy Vichy Frenches. strategy >= 500 forces declaration
	}

	ai_strategy = {
		type = naval_invasion_focus
		value = 10
	}

	ai_strategy = {
		type = area_priority
		id = africa
		value = 100
	}

	ai_strategy = {
		type = area_priority
		id = mainland_europe
		value = -300
	}

	ai_strategy = {
		type = invasion_unit_request
		area = mainland_europe
		value = -300
	}
	
	ai_strategy = {
		type = invade
		id = "VIC"
		value = 550 #counterbalances...
	}

	ai_strategy = {
		type = front_control

		area = north_africa

		ordertype = invasion
		execute_order = yes
	}
	
	ai_strategy = {
		type = invasion_unit_request
		area = north_africa
		value = 40
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 48 # western mediterranean
		value = 500
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 68 # western mediterranean
		value = 500
	}

	ai_strategy = {
		type = front_control
		state = 665 
		ratio = 0.1

		priority = 200
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

	ai_strategy = {
		type = front_control
		state = 458 
		ratio = 0.1

		priority = 200
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

	ai_strategy = {
		type = front_control
		state = 513 
		ratio = 0.1

		priority = 200
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

	ai_strategy = {
		type = front_control
		state = 459 
		ratio = 0.1

		priority = 200
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

	ai_strategy = {
		type = front_control
		state = 460 
		ratio = 0.1

		priority = 200
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

	ai_strategy = {
		type = front_control
		state = 461 
		ratio = 0.1

		priority = 200
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

	ai_strategy = {
		type = front_control
		state = 462 
		ratio = 0.1

		priority = 200
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

}

allies_sardegna_campaign = {
	allowed = {
		OR = {
			original_tag = ENG
			original_tag = FRA
			original_tag = USA
		}
	}
	enable = {
		is_historical_focus_on = yes
		is_in_faction_with = ENG
		is_in_faction_with = USA
		OR = {
			114 = { controller = { has_war_with = ENG } }
			1 = { controller = { has_war_with = ENG } }
		}
		NOT = { 	
			OR = {
				has_idea = d_day_preparation_1
				has_idea = d_day_preparation_2
				has_idea = d_day_preparation_3
			}
		}	
	}

	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = invasion_unit_request
		area = mainland_europe
		value = -100
	}

	ai_strategy = {
		type = naval_invasion_focus
		value = 10
	}
	
	ai_strategy = {
		type = invasion_unit_request
		area = sardinia
		value = 25
	}
	
	ai_strategy = {
		type = invade
		id = "ITA"
		value = 550 #counterbalances...
	}

}

ENG_blitzkrieging_north_africa_for_the_giggle = {
	enable = {
		OR = {
			is_in_faction_with = ENG
			is_in_faction_with = FRA
		}
		NOT = { has_global_flag = vanilla_history } #italy will join war later so dont do it
		OR = {
			NOT = { surrender_progress > 0 }
			AND = {
				tag = FRA
				NOT = { surrender_progress > 0.35 }
			}
		}
		ITA = { has_government = fascism }
		NOT = { 
			OR = {
				has_idea = d_day_preparation_1
				has_idea = d_day_preparation_2
				has_idea = d_day_preparation_3
			}
		}
		OR = {
			has_war_with = VIC
			date < 1941.1.1
			FRA = { has_capitulated = no }
		}
		is_historical_focus_on = yes
		any_state = {
			is_core_of = LBA
			controller = { has_war_with = ENG }
		}
		NOT = {
			any_state = {
				is_core_of = EGY
				controller = { has_war_with = ENG }
			}
		}
		OR = {
			AND = {
				is_in_faction_with = ENG 
				ENG = {
					has_navy_size = {
						size > 250
					}
				}
			}
			AND = {
				is_in_faction_with = USA 
				USA = {
					has_navy_size = {
						size > 250
					}
				}
			}
		}
	}

	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = invasion_unit_request
		area = mainland_europe
		value = -10
	}
	
	ai_strategy = {
		type = invasion_unit_request
		area = sardinia
		value = 20
	}
	
	ai_strategy = {
		type = front_unit_request
		area = sardinia
		value = 3
	}
	
	ai_strategy = {
		type = area_priority
		id = sardinia
		value = 15
	}

	ai_strategy = {
		type = front_control

		state = 114

		ratio = 0.1

		priority = 500
		ordertype = front
		execution_type = balanced
	}

	ai_strategy = {
		type = naval_invasion_focus
		value = 10
	}
	
	ai_strategy = {
		type = invasion_unit_request
		area = north_africa
		value = 20
	}
	
	ai_strategy = {
		type = front_unit_request
		area = north_africa
		value = 10
	}
	
	ai_strategy = {
		type = area_priority
		id = north_africa
		value = 50
	}
	
	ai_strategy = {
		type = prepare_for_war
		id = "ITA"
		value = 50
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 29 # western mediterranean
		value = 3000
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 68 # western mediterranean
		value = 500
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 48 # western mediterranean
		value = 500
	}

	ai_strategy = {
		type = front_control

		state = 451 #derna

		ratio = 0.1

		priority = 100
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

	ai_strategy = {
		type = front_control

		state = 448 #derna

		ratio = 0.1

		priority = 100
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

	ai_strategy = {
		type = front_control

		state = 661 #derna

		ratio = 0.1

		priority = 100
		ordertype = front
		execution_type = rush
		execute_order = yes
	}

	ai_strategy = {
		type = front_control

		state = 663 #derna

		ratio = 0.1

		priority = 100
		ordertype = front
		execution_type = rush
		execute_order = yes
	}
	
	ai_strategy = {
		type = invade
		id = "ITA"
		value = 550 #counterbalances...
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 69 
	}

}
naval_landing_preparation = {
	allowed = {
		is_allied_ai = yes
	}
	enable = {
		OR = {
			is_in_faction_with = ENG
			is_in_faction_with = USA
		}
		OR = {
			has_war = yes
			original_tag = USA
		}
		date > 1939.1.1
	}

	abort = {
		has_tech = mtg_transport
	}

	ai_strategy = {
		type = research_tech
		id = mtg_transport
		value = 300
	}
}
naval_landing_preparation_2 = {
	allowed = {
		is_allied_ai = yes
	}
	enable = {
		OR = {
			is_in_faction_with = ENG
			is_in_faction_with = USA
		}
		OR = {
			has_war = yes
			original_tag = USA
		}
		date > 1940.1.1
	}

	abort = {
		has_tech = mtg_landing_craft
	}

	ai_strategy = {
		type = research_tech
		id = mtg_landing_craft
		value = 300
	}
}
naval_landing_preparation_3 = {
	allowed = {
		is_allied_ai = yes
	}
	enable = {
		OR = {
			is_in_faction_with = ENG
			is_in_faction_with = USA
		}
		OR = {
			has_war = yes
			original_tag = USA
		}
		date > 1941.1.1
	}

	abort = {
		has_tech = mtg_tank_landing_craft 
	}

	ai_strategy = {
		type = research_tech
		id = mtg_tank_landing_craft 
		value = 300
	}
}
ENG_unit_production = {

	allowed = {	original_tag = ENG }
	enable = {
		always = yes
	}
	abort = {
		always = no
	}

	ai_strategy = {
		type = role_ratio
		id = garrison
		value = 7
	}

	# Old garrison system against resistance
	# ai_strategy = {
	# 	type = role_ratio
	# 	id = suppression
	# 	value = 1
	# }


	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = 0
	}

	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = 0
	}

	ai_strategy = {
		type = role_ratio
		id = marines
		value = 25
	}

	ai_strategy = {
		type = role_ratio
		id = cavalry
		value = 0
	}

	ai_strategy = {
		type = role_ratio
		id = armor
		value = 5
	}

	ai_strategy = {
		type = role_ratio
		id = infantry
		value = 50
	}

	# Naval unit factors
	ai_strategy = {
		type = unit_ratio
		id = capital_ship
		value = 20
	}

	ai_strategy = {
		type = unit_ratio
		id = carrier
		value = 10
	}

	ai_strategy = {
		type = unit_ratio
		id = submarine
		value = 5
	}

	ai_strategy = {
		type = unit_ratio
		id = screen_ship
		value = 55
	}

	ai_strategy = {
		type = unit_ratio
		id = convoy
		value = 100
	}

	ai_strategy = {
		type = equipment_production_factor
		id = infantry
		value = 10
	}

	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = 45
	}

	ai_strategy = {
		type = equipment_production_factor
		id = armor
		value = 10
	}

}

ENG_bomber_production = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		num_of_military_factories > 30
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_production_min_factories
		id = tactical_bomber
		value = 1
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = strategic_bomber
		value = 1
	}
}

bba_air_prod_1 = {
	# TODO BFW:
	allowed = { original_tag = ENG }
	enable = {
		date < 1940.1.1
	}
	abort_when_not_enabled = yes

	#Air unit factors
	ai_strategy = {
		type = unit_ratio
		id = fighter
		value = 200
	}

	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = 20
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = fighter
		value = 1
	}

	ai_strategy = {
		type = unit_ratio
		id = cas
		value = 37 #because doctrine this = 15
	}

 	ai_strategy = {
		type = equipment_production_factor
		id = cas
		value = 10
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = cas
		value = 1
	}

	ai_strategy = {
		type = unit_ratio
		id = naval_bomber
		value = 32
	}

	ai_strategy = {
		type = unit_ratio
		id = tactical_bomber
		value = 0
	}

	ai_strategy = {
		type = equipment_production_factor
		id = naval_bomber
		value = 17
	}

	ai_strategy = {
		type = unit_ratio
		id = strategic_bomber
		value = 0
	}

	ai_strategy = {
		type = unit_ratio
		id = scout_plane
		value = 1
	}

	ai_strategy = {
		type = unit_ratio
		id = cv_fighter
		value = 25
	}

	ai_strategy = {
		type = unit_ratio
		id = cv_naval_bomber
		value = 25
	}
}

bba_air_prod_2 = {
	# TODO BFW:
	allowed = { original_tag = ENG }
	enable = {
		date > 1940.1.1
	}
	abort_when_not_enabled = yes

	#Air unit factors
	ai_strategy = {
		type = unit_ratio
		id = fighter
		value = 200
	}

	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = 20
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = fighter
		value = 1
	}

	ai_strategy = {
		type = unit_ratio
		id = cas
		value = 37 #because doctrine this = 15
	}

 	ai_strategy = {
		type = equipment_production_factor
		id = cas
		value = 10
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = cas
		value = 1
	}

	ai_strategy = {
		type = unit_ratio
		id = naval_bomber
		value = 32
	}

	ai_strategy = {
		type = unit_ratio
		id = tactical_bomber
		value = 0
	}

	ai_strategy = {
		type = equipment_production_factor
		id = naval_bomber
		value = 17
	}

	ai_strategy = {
		type = unit_ratio
		id = strategic_bomber
		value = 0
	}

	ai_strategy = {
		type = unit_ratio
		id = scout_plane
		value = 1
	}

	ai_strategy = {
		type = unit_ratio
		id = cv_fighter
		value = 25
	}

	ai_strategy = {
		type = unit_ratio
		id = cv_naval_bomber
		value = 25
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = cv_fighter
		value = 2
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = cv_naval_bomber
		value = 2
	}

}

build_more_patrol_bombers = {

	enable = {
		has_dlc = "By Blood Alone"
		has_navy_size = {
			size > 1
		}
		tag = ENG
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = unit_ratio
		id = maritime_patrol_plane
		value = 10
	}

	ai_strategy = {
		type = equipment_production_factor
		id = maritime_patrol_plane
		value = 15
	}
}

eng_fighter_enhanced_production = {
	allowed = { original_tag = ENG }

	enable = {
		date < 1943.1.1
	}

	abort = {
		has_equipment = { small_plane_airframe > 4000 }
	}

	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = 20
	}

	ai_strategy = {
		type = air_xp_spend_priority
		id = upgrade_xp_cutoff
		value = 100
	}

}

eng_the_home_fleet  = {
	allowed = { original_tag = ENG }

	enable = {
		has_war = yes
		any_country = {
			capital_scope = { is_on_continent = europe }
			NOT = { is_in_faction_with = ENG }
			is_major = yes
			is_ai = no
		}
		NOT = { 
			GER = { has_idea = LSM_the_final_push_failure_GER }
			OR = {
				has_idea = LSM_victory_in_europe
				has_country_flag = era_of_transition 
			}
			has_war_with = JAP
			JAP = { NOT = { has_country_flag = LSM_eligibility_nation } }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = strike_force_home_base
		id = 16 # north sea
	}
}

eng_the_med_fleet  = {
	allowed = { original_tag = ENG }

	enable = {
		has_war = yes
		any_country = {
			capital_scope = { is_on_continent = europe }
			NOT = { is_in_faction_with = ENG }
			is_major = yes
			is_ai = no
		}
		NOT = { 
			GER = { has_idea = LSM_the_final_push_failure_GER }
			OR = {
				has_idea = LSM_victory_in_europe
				has_country_flag = era_of_transition 
			}
			has_war_with = JAP
			JAP = { NOT = { has_country_flag = LSM_eligibility_nation } }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = strike_force_home_base
		id = 69 # nice #eastern med
	}
}

eng_build_kgv_battleships = {
	allowed = { original_tag = ENG }

	enable = {
		date > 1936.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = naval_capital_bb
		value = 20
	}

	ai_strategy = {
		type = navy_xp_spend_priority
		id = upgrade_xp_cutoff
		value = 100
	}
}

protect_poland_against_germany = {
	allowed = { original_tag = ENG }

	enable = {
		GER = { has_completed_focus = GER_end_of_czechoslovakia }
		GER = { NOT = { has_war_with = POL } }
		country_exists = POL
		85 = { is_controlled_by = POL }
	}
	abort = {
		OR = {
			NOT = { country_exists = POL }
			has_war_with = POL
		}
	}

	ai_strategy = {
		type = protect
		id = "POL"
		value = 200
	}
	ai_strategy = {
		type = alliance
		id = "POL"
		value = 200
	}
	ai_strategy = {
		type = diplo_action_desire
		id = POL
		target = guarantee
		value = 20
	}
}

we_hate_poland_now = {
	allowed = { original_tag = ENG }

	enable = {
		country_exists = POL
		NOT = { 85 = { is_controlled_by = POL } }
	}
	abort = {
		OR = {
			NOT = { country_exists = POL }
			has_war_with = POL
		}
	}

	ai_strategy = {
		type = protect
		id = "POL"
		value = -2000
	}
	ai_strategy = {
		type = alliance
		id = "POL"
		value = -2000
	}
	ai_strategy = {
		type = diplo_action_desire
		id = POL
		target = guarantee
		value = -2000
	}
}

ENG_trade_with_poland = {
	# Poland has a mirrored version of this
	allowed = {
		original_tag = ENG
	}
	enable = {
		OR = {
			POL = { has_government = neutrality }
			POL = { has_government = democratic }
		}
		has_government = democratic
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_market_trade_desire
		id = POL
		value = 60
	}
}

ENG_less_weapon_purchases_more_for_construction = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		date < 1939.1.1
		has_war = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_market_spend_factories
		value = -80  # 80 % less factories
	}
	ai_strategy = {  # Don't even try buying infantry equipment too early
		type = equipment_market_buying_threshold
		id = infantry_equipment
		value = -20000  # Absolute number of units
	}
}

ENG_fewer_factories_for_purchases_please = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		date > 1939.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_market_spend_factories
		value = -50  # 50 % less factories
	}
}

protect_poland_against_germany_even_more = {
	allowed = { original_tag = ENG }
	enable = {
		GER = { has_completed_focus = GER_end_of_czechoslovakia }
		GER = { NOT = { has_war_with = POL } }
		country_exists = POL
	}
	abort = {
		NOT = { country_exists = POL }
	}

	ai_strategy = {
		type = protect
		id = "POL"
		value = 200
	}
	ai_strategy = {
		type = alliance
		id = "POL"
		value = 200
	}
}

defend_poland_against_germany = {
	allowed = { original_tag = ENG }
	enable = {
		GER = { has_war_with = POL }
		country_exists = POL
	}
	abort = {
		OR = {
			NOT = { country_exists = POL }
			has_war_with = POL
		}
	}

	ai_strategy = {
		type = befriend
		id = "POL"
		value = 200
	}
	ai_strategy = {
		type = alliance
		id = "POL"
		value = 200
	}
}

royal_air_force = {
	allowed = { original_tag = ENG }
	enable = {
		date > 1939.4.1
	}
	abort = {
		date < 1939.4.1
	}

	ai_strategy = {
		type = air_factory_balance
		value = 50
	}

}

scandinavia_is_convoy_trap = {
	enable = {
		is_in_faction_with = ENG 
		NOT = {
			SOV = {
				has_war_with = GER
			}
		}
	}
	abort = {
		SOV = { has_war_with = GER }
		date > 1942.8.1
	}

	ai_strategy = {
		type = area_priority
		id = scandinavia
		value = -300
	}

	ai_strategy = {
		type = dont_defend_ally_borders
		id = "NOR"
		value = 300
	}

	ai_strategy = {
		type = front_unit_request
		tag = NOR
		value = -100
	}
}

# lets make sure the allies dont overcommit to invasions early on
careful_with_early_invasions = {
	enable = {
		date < 1942.1.1
		has_war_with = GER
		OR = {
			has_war_with = FRA
			FRA = { has_capitulated = yes }
			NOT = { country_exists = FRA }
			date < 1941.1.1
		}
		NOT = { original_tag = USA }

		OR = {
			is_in_faction_with = ENG # anyone in allies
			tag = FRA
		}

		NOT = {
			SOV = {
				has_war_with = GER
				surrender_progress > 0.15
			}
		}
	}
	abort = {
		OR = {
			is_in_faction_with = USA
			SOV = {
				has_war_with = GER
				surrender_progress > 0.23
			}
			date > 1942.1.1
			is_historical_focus_on = no
		}
	}

	ai_strategy = {
		type = invade
		id = "ITA"
		value = -500
	}

	ai_strategy = {
		type = invade
		id = "GER"
		value = -500
	}

	ai_strategy = {
		type = invade
		id = "VIC"
		value = -500
	}

	ai_strategy = {
		type = invasion_unit_request
		area = mainland_europe
		value = -300
	}

	ai_strategy = {
		type = front_control

		area = mainland_europe

		ordertype = invasion
		execute_order = no
	}

	ai_strategy = { #TODO why does this crash
		type = invade
		id = "JAP"
		value = -500
	}

	ai_strategy = {
		type = area_priority
		id = scandinavia
		value = -300
	}
}

careful_with_early_invasions_USA = { #Same as above, alter in tandem

	allowed = { original_tag = USA }

	enable = {
		date < 1942.1.1

		NOT = {
			SOV = {
				has_war_with = GER
				surrender_progress > 0.15
			}
		}
		has_war_with = GER
		OR = {
			has_war_with = FRA
			FRA = { has_capitulated = yes }
			NOT = { country_exists = FRA }
		}
	}
	abort = {
		OR = {
			is_in_faction_with = ENG
			SOV = {
				has_war_with = GER
				surrender_progress > 0.23
			}
			date > 1942.1.1
		}
	}

	ai_strategy = {
		type = invade
		id = "ITA"
		value = -500
	}

	ai_strategy = {
		type = invade
		id = "GER"
		value = -500
	}

	ai_strategy = {
		type = invade
		id = "VIC"
		value = -500
	}

	ai_strategy = {
		type = invasion_unit_request
		area = mainland_europe
		value = -300
	}


	ai_strategy = {
		type = front_control

		area = mainland_europe

		ordertype = invasion
		execute_order = no
	}
	
	ai_strategy = {
		type = area_priority
		id = scandinavia
		value = -300
	}
	
}

east_prussia_invasion_is_death_trap = {
	enable = {

		OR = {
			is_in_faction_with = ENG # anyone in allies
			tag = FRA
		}

		GER = { has_war_with = POL }
		POL = {
			OR = {
				exists = yes
				has_capitulated = no
			}
		}

		date < 1940.6.1
	}

	abort = {
		OR = {
			NOT = { GER = { has_war_with = POL } }
			POL = {
				OR = {
					exists = no
					has_capitulated = yes
				}
			}
			date > 1940.6.1
		}
	}

	ai_strategy = {
		type = invade
		id = "GER"
		value = -2000
	}
	ai_strategy = {
		type = dont_defend_ally_borders
		id = "POL"
		value = 100
	}
}
ENG_cmwlth_minor_dock = {
	enable = {
		has_dlc = "Man the Guns"
		OR = {
			original_tag = CAN
			original_tag = AST
			original_tag = RAJ
		}
		date > 1939.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 20  #aim for a 2-1 ratio on naval factories
	}
}

ENG_naval_role_ratios_historical = {
	allowed = {
		has_dlc = "Man the Guns"
		original_tag = ENG
	}
	enable = { always = yes }
	abort_when_not_enabled = yes

	ai_strategy = {
		type = role_ratio
		id = naval_capital_bb
		value = 20
	}
	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 20  #aim for a 2-1 ratio on naval factories
	}
	ai_strategy = {
		type = role_ratio
		id = naval_capital_bc
		value = -10
	}

	ai_strategy = {
		type = role_ratio
		id = naval_carrier
		value = 20
	}

	ai_strategy = {
		type = role_ratio
		id = naval_carrier_light
		value = 15
	}

	ai_strategy = {
		type = role_ratio
		id = naval_submarine
		value = -150
	}

	ai_strategy = {
		type = role_ratio
		id = naval_screen
		value = 250
	}

	ai_strategy = {
		type = role_ratio
		id = naval_escort
		value = 10
	}

	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_light
		value = 60
	}

	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_heavy
		value = 5
	}

	ai_strategy = {
		type = role_ratio
		id = naval_mine_sweeper
		value = 20
	}

	ai_strategy = {
		type = role_ratio
		id = naval_mine_layer
		value = 10
	}
}

ENG_naval_role_ratios_anti_submarines = {
	allowed = {
		has_dlc = "Man the Guns"
		original_tag = ENG
	}
	enable = {
		anti_submarine_strategy_required_trigger = yes
	}
	abort = {
		not = { anti_submarine_strategy_required_trigger = yes }
	}
	ai_strategy = {
		type = role_ratio
		id = naval_capital_bb
		value = 10
	}
	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 20  #aim for a 2-1 ratio on naval factories
	}
	ai_strategy = {
		type = role_ratio
		id = naval_capital_bc
		value = -10
	}

	ai_strategy = {
		type = role_ratio
		id = naval_carrier
		value = 20
	}

	ai_strategy = {
		type = role_ratio
		id = naval_carrier_light
		value = -25
	}

	ai_strategy = {
		type = role_ratio
		id = naval_submarine
		value = -150
	}

	ai_strategy = {
		type = role_ratio
		id = naval_screen
		value = -70
	}

	ai_strategy = {
		type = role_ratio
		id = naval_escort
		value = 50
	}

	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_light
		value = -25
	}

	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_heavy
		value = -10
	}
}


ENG_the_adriatic_is_dangerous = {
	allowed = { original_tag = ENG }
	enable = {
		has_war_with = ITA
		NOT = { has_idea = d_day_preparation_1 }
		NOT = { has_idea = d_day_preparation_2 }
		NOT = { has_idea = d_day_preparation_3 }
		ITA = { surrender_progress > 0.12 }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_avoid_region
		id = 168 #adriatic
		value = 75
	}
}

ENG_baltic_is_a_trap = {
	allowed = { original_tag = ENG }
	enable = {
		has_war_with = GER
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_avoid_region
		id = 9 #northern baltic
		value = 600
	}
	ai_strategy = {
		type = naval_avoid_region
		id = 206 #central baltic
		value = 600
	}
	ai_strategy = {
		type = naval_avoid_region
		id = 207 #danish belts
		value = 600
	}
	#ai_strategy = {
	#	type = naval_avoid_region
	#	id = 279 #Bothnia
	#	value = 600
	#}
	ai_strategy = {
		type = naval_avoid_region
		id = 9 #gulf of finland
		value = 600
	}
}

ENG_lifeline_of_the_empire = {
	allowed = { original_tag = ENG }
	enable = {
		always = yes
	}
	abort = {
		always = no
	}

	ai_strategy = {
		type = area_priority
		id = suez
		value = 80 # this is extra on top of 50 base (now equal to other territory)
	}
}

ENG_USA_focus_on_europe = {
	allowed = {
		OR = {
			tag = USA
			tag = ENG
		}
	}

	enable = {
		is_historical_focus_on = yes
		OR = {
			date > 1942.1.1
			SOV = {
				surrender_progress > 0.05
			}
		}
		has_global_flag = FRA_already_surrendered
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_unit_request
		tag = GER
		value = 10
	}

	ai_strategy = {
		type = front_unit_request
		area = italy
		value = 20
	}

	ai_strategy = {
		type = front_unit_request
		area = north_africa
		value = 15
	}
}

ENG_USA_focus_on_europe_more = {
	allowed = {
		OR = {
			tag = USA
			tag = ENG
		}
	}

	enable = {
		is_historical_focus_on = yes
		OR = {
			date > 1942.6.1
			SOV = {
				surrender_progress > 0.25
			}
		}
		has_global_flag = FRA_already_surrendered
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_unit_request
		tag = GER
		value = 20
	}

	ai_strategy = {
		type = front_unit_request
		area = italy
		value = 20
	}

	ai_strategy = {
		type = front_unit_request
		area = north_africa
		value = 15
	}
	
}

ENG_USA_focus_on_europe_loads_more = {
	allowed = {
		OR = {
			tag = USA
			tag = ENG
		}
	}

	enable = {
		is_historical_focus_on = yes
		date > 1943.6.1
		has_global_flag = FRA_already_surrendered
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_unit_request
		area = mainland_europe
		value = 50
	}
}

ENG_evacuate_troops_after_fall_of_france = {

	enable = {
		OR = {
			NOT = { capital_scope = { is_on_continent = europe } }
			tag = ENG
		}
		is_in_faction_with = ENG
		is_historical_focus_on = yes
		OR = {
			has_global_flag = FRA_already_surrendered
			FRA = { surrender_progress > 0.3 }
		}
	}

	abort = {
		OR = {
			FRA = {
				has_country_flag = {
					flag = LSM_eligibility_nation 
					days > 90
				}
			}
			NOT = { FRA = { has_country_flag = LSM_eligibility_nation } }
			is_in_faction_with = USA
			date > 1941.1.1
		}
	}

	ai_strategy = {
		type = front_unit_request
		area = mainland_europe
		value = -500
	}

	ai_strategy = {
		type = dont_defend_ally_borders
		target = mainland_europe
		value = -9999
	}
}

ENG_time_to_ditch_FRA = {
	allowed = {
		original_tag = ENG
	}

	enable = {
		is_historical_focus_on = yes
		FRA = {
			has_capitulated = no
			surrender_progress > 0.25
		}
		OR = {
			NOT = { has_global_flag = FRA_already_surrendered }
			#lets give a month of retreat time after capitulation
			set_temp_variable = { t = global.num_days }
			subtract_from_temp_variable = { t = global.FRA_capitulation_days }
			check_variable = { t < 30 }
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = dont_defend_ally_borders
		id = FRA
		value = 100
	}
	ai_strategy = {
		type = dont_defend_ally_borders
		id = BEL
		value = 100
	}
	ai_strategy = {
		type = dont_defend_ally_borders
		id = HOL
		value = 100
	}
	ai_strategy = {
		type = dont_defend_ally_borders
		id = LUX
		value = 100
	}
}

ENG_gang_up_GER_with_USA = {
	allowed = { original_tag = ENG }
	enable = {
		FRA = {
			OR = {
				has_capitulated = yes
				exists = no
			}
		}
	}
	abort_when_not_enabled = yes

	# after FRA falls, both ENG and USA will try to help in europe and africa
	ai_strategy = {
		type = force_defend_ally_borders
		value = 100
		target = europe
	}
	ai_strategy = {
		type = force_defend_ally_borders
		value = 100
		target = africa
	}
}

ENG_accept_USA_access = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		tag = ENG
		date > 1940.9.9
		USA = {
			is_ai = yes
			NOT = {
				OR = {
					is_in_faction_with = ENG
					has_military_access_to = ENG
				}
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = diplo_action_acceptance
		id = USA
		target = military_access
		value = 1000
	}
}

ENG_in_for_the_long_haul_bruv = {
	allowed = { original_tag = ENG }
	enable = {
		has_government = democratic
		date < 1937.10.1
		has_war = no
		AND = {
			GER = { is_ai = yes }
			ITA = { is_ai = yes }
			PAN = { is_ai = yes }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = 49
	}
	ai_strategy = {
		type = air_factory_balance
		value = 15
	}
}

ENG_industry_we_on_an_island_bruv = {
	allowed = { original_tag = ENG }
	enable = {
		has_government = democratic
		has_war = no
		date > 1937.10.1
		AND = {
			GER = { is_ai = yes }
			ITA = { is_ai = yes }
			JAP = { is_ai = yes }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = arms_factory
		value = 50
	}

	ai_strategy = {
		type = building_target
		id = dockyard
		value = 25
	}

	ai_strategy = {
		type = air_factory_balance
		value = 30
	}
}

ENG_navy_preparation = {
	allowed = { original_tag = ENG }
	enable = {
		has_government = democratic
		date < 1938.3.1
		has_war = no
		OR = {
			GER = { is_ai = no }
			ITA = { is_ai = no }
			JAP = { is_ai = no }
		}
		NOT = { has_idea = partial_economic_mobilisation }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = dockyard
		value = 50
	}
	ai_strategy = {
		type = air_factory_balance
		value = 15
	}
}

ENG_industry_preparation = {
	allowed = { original_tag = ENG }
	enable = {
		has_government = democratic
		has_war = no
		date > 1938.3.1
		date < 1939.1.1
		OR = {
			GER = { is_ai = no }
			ITA = { is_ai = no }
			JAP = { is_ai = no }
		}
		has_idea = partial_economic_mobilisation
	}
	abort_when_not_enabled = yes

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

	ai_strategy = {
		type = air_factory_balance
		value = 15
	}
}

ENG_industry_preparation_2 = {
	allowed = { original_tag = ENG }
	enable = {
		has_government = democratic
		has_war = no
		date > 1939.1.1
		OR = {
			GER = { is_ai = no }
			ITA = { is_ai = no }
			JAP = { is_ai = no }
		}
		has_idea = partial_economic_mobilisation
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = arms_factory
		value = 50
	}

	ai_strategy = {
		type = air_factory_balance
		value = 30
	}
}

ENG_if_the_best_arrangements_are_made_as_they_are_being_made_mil = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		date > 1940.1.1
		has_war_with = GER
		num_of_military_factories < 200
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = added_military_to_civilian_factory_ratio
		value = 50
	}

	ai_strategy = {
		type = building_target
		id = arms_factory
		value = 200
	}
}

ENG_the_best_arrangements_are_made = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		date > 1940.1.1
		has_war_with = GER
		num_of_military_factories > 150
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = added_military_to_civilian_factory_ratio
		value = 20
	}
}

ENG_growing_confidence_in_the_air = {
	allowed = { original_tag = ENG }
	enable = {
		has_war = yes
		has_government = democratic
		date > 1938.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = air_factory_balance
		value = 30
	}
}

ENG_allies_dont_ask_for_diplo_access_to_SOV = {
	enable = {
		ENG = {
			has_government = democratic
		}
		SOV = {
			has_government = communism
		}
		is_in_faction_with = ENG
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = diplo_action_desire
		id = SOV
		target = military_access
		value = -5000
	}
	ai_strategy = {
		type = diplo_action_desire
		id = TAN
		target = military_access
		value = -5000
	}
	ai_strategy = {
		type = diplo_action_desire
		id = MON
		target = military_access
		value = -5000
	}
	ai_strategy = {
		type = diplo_action_desire
		id = SOV
		target = docking_rights
		value = -5000
	}
	ai_strategy = {
		type = diplo_action_desire
		id = TAN
		target = docking_rights
		value = -5000
	}
	ai_strategy = {
		type = diplo_action_desire
		id = MON
		target = docking_rights
		value = -5000
	}
}

ENG_Defends_Mediterranean = {
	allowed = {
		tag = ENG
	}

	enable = {
		always = yes
	}
	abort_when_not_enabled = yes

	# Alexandria
	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 447
		value = 10
	}

	# Gibraltar
	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 118
		value = 4
	}

	# Malta
	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 116
		value = 4
	}
}


ENG_convoy_raids_german_italian_convoys = {
	enable = {
		OR = {
			tag = ENG
			is_in_faction_with = ENG
		}
		OR = {
			has_war_with = GER
			has_war_with = ITA
		}
		NOT = { has_war_with = VIC }
		surrender_progress < 0.05
		ITA = { has_capitulated = no }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 48 # african coast
		value = 100
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 29 # western mediterranean
		value = 100
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 29 
		value = 25000 #Too easy to lose planes here
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 53 # western mediterranean
		value = 100
	}
}

ENG_convoy_raid_venezuela = {
	enable = {
		OR = {
			tag = ENG
			is_in_faction_with = ENG
		}
		OR = {
			has_war_with = GER
			has_war_with = ITA
		}
		surrender_progress > 0.05
		ITA = { has_capitulated = no }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 53 # western mediterranean
		value = 500
	}
}

USA_blockade_venezuela = {
	allowed = {
		OR = {
			tag = USA
			tag = MEX
			tag = CAN
		}
	}
	enable = {
		is_historical_focus_on = yes
		threat > 0.5
		has_war = no
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = strike_force_home_base
		id = 53
	}
}

USA_blockade_venezuela_2 = {
	allowed = {
		OR = {
			tag = USA
			tag = MEX
			tag = CAN
		}
	}
	enable = {
		is_historical_focus_on = yes
		threat > 0.5
		has_war = yes
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 53
		value = 500
	}
}

ENG_convoy_raids_german_italian_convoys_vichy = {
	enable = {
		OR = {
			tag = ENG
			is_in_faction_with = ENG
		}
		OR = {
			has_war_with = GER
			has_war_with = ITA
		}
		has_war_with = VIC
		surrender_progress < 0.05
		ITA = { has_capitulated = no }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 47 # iberian coast
		value = 50
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 48 # african coast
		value = 50
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 68 # western mediterranean
		value = 25
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 48 # western mediterranean
		value = 25
	}
}

ENG_produce_floating_harbors = {
	allowed = {	original_tag = ENG }
	enable = {
		is_historical_focus_on = yes
		date > 1941.1.1
		has_war = yes
		num_of_naval_factories > 25
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = unit_ratio
		id = floating_harbor # for floating harbors, 'unit_ratio' is actually not a ratio but an absolute desired number
		value = 10
	}
}

ENG_unit_buffer_for_african_defense = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		OR = {
			has_war = no
			AND = {
				has_war = yes
				surrender_progress < 0.5
			}
		}
		NOT = { has_global_flag = allied_victory_in_africa }
		any_state = {
			OR = {
				any_neighbor_state = { is_core_of = EGY }
				any_neighbor_state = { is_core_of = LEB }
				any_neighbor_state = { is_core_of = SYR }
				any_neighbor_state = { is_core_of = ISR }
				any_neighbor_state = { is_core_of = PAL }
			}
			controller = { has_war_with = ENG }
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers

		# ratio of total armeis in country to be buffered
		ratio = 0.1

		# you can specify an order id. ratio of same orders ids will be share same ratio
		#order_id = 2

		# states to put garrison orders (if no state is friendly, strat is invalid)
		states = {
			446
			447
			452
		}

		area = suez

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}
}

ENG_knocking_down_the_jutland_door = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		OR = {
			GER = { 
				focus_progress = {
					focus = GER_weserubung
					progress > 0.01
				}
			}
			GER = { 
				has_completed_focus = GER_weserubung
			}
			has_war_with = GER
			GER = { has_war_with = NOR }
		}
		date < 1940.5.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = area_priority
		id = jutland_war_region
		value = 150
	}

	ai_strategy = {
		type = prepare_for_war
		id = GER
		value = 200
	}
}

ENG_order_of_the_day = {
	allowed = {
		OR = {
			original_tag = ENG
			original_tag = USA
		}
	}
	enable = {
		ENG = {
			OR = {
				divisions_in_state = { state = 127 size > 20 }
				divisions_in_state = { state = 126 size > 20 }
				divisions_in_state = { state = 125 size > 20 }
			}
		}
		date > 1944.1.1
	}
	abort = {
		OR = {
			FRA = { surrender_progress < 0.2 }
			GER = { has_country_flag = LSM_eligibility_nation }
		}
	}

	ai_strategy = {
		type = area_priority
		id = d_day_landing_region
		value = 5000
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 18 
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 18 
		value = 5000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 18 #Strategic Region ID - English Channel
		value = 15000 #Too easy to lose planes here
	}
}

ENG_norway_is_not_THAT_important = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		date > 1940.5.1
		date < 1945.1.1
		any_allied_country = { 
			NORDIC_is_nordic = yes 
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = area_priority
		id = scandinavia
		value = -150
	}
	
	ai_strategy = {
		type = front_unit_request
		area = scandinavia
		value = -40
	}
	
	ai_strategy = {
		type = invasion_unit_request
		area = scandinavia
		value = -60
	}

	ai_strategy = {
		type = naval_avoid_region
		id = 173 #eastern north sea
		value = 600
	}
}

ENG_super_boost_armor_div_med = { #lets make sure the uk upgrades armor divs to mediums
	allowed = {
		original_tag = ENG
	}
	enable = {
		OR = {
			has_tech = basic_medium_tank
			has_tech = basic_medium_tank_chassis
		}
		NOT = { has_template_ai_majority_unit = medium_armor }

		date > 1940.1.1
	}

	abort = {
		has_template_ai_majority_unit = medium_armor
	}

	# lets do changes more often during this period too

	# this is gateway
	ai_strategy = {
		type = template_prio
		id = light_armor
		value = 100
	}

	ai_strategy = {
		type = template_prio
		id = medium_armor
		value = 150
	}
}

ENG_Italy_is_dead = {
	allowed = {
		OR = {
			original_tag = USA
			original_tag = ENG
		}
		is_historical_focus_on = yes
	}
	enable = {
		OR = {
			date > 1944.2.1
			AND = {
				date > 1943.6.1
				NOT = {
					OR = {
						has_global_flag = vanilla_history
					}
				}
			}
			has_global_flag = allied_victory_in_africa
		}
		OR = {
			ITA = { surrender_progress > 0.2 }
			ITA = { has_civil_war = yes }
			date > 1944.2.1
		}
	}
	abort_when_not_enabled = yes	

	ai_strategy = {
		type = front_unit_request
		area = italy
		value = -5
	}	

	ai_strategy = {
		type = front_unit_request
		area = south_france_landing_zone
		value = -5
	}	

	ai_strategy = {
		type = area_priority
		id = south_france_landing_zone
		value = -5
	}

	ai_strategy = {
		type = front_unit_request
		area = normandy_landing_zone
		value = 50
	}

	ai_strategy = {
		type = area_priority
		id = normandy_landing_zone
		value = 50
	}
	
	ai_strategy = {
		type = invade
		id = "GER"
		value = 600 #counterbalances...
	}
	
	ai_strategy = {
		type = invade
		id = "ITA"
		value = -50 #counterbalances...
	}

}

allies_retake_england = {
	enable = {
		is_in_faction_with = ENG
		is_in_faction_with = USA
		ENG = { has_capitulated = yes }
		OR = {
			has_idea = d_day_preparation_1 
			has_idea = d_day_preparation_2 
			has_idea = d_day_preparation_3
			date > 1943.1.1
			GER = { has_war_with = SOV }
		}

	}
	abort_when_not_enabled = yes	
	
	ai_strategy = {
		type = invasion_unit_request
		area = UK
		value = 100
	}

	ai_strategy = {
		type = front_unit_request
		area = UK
		value = 100
	}

	ai_strategy = {
		type = area_priority
		id = UK
		value = 100
	}

}

ENG_take_italys_spaghetti_preparation = {
	allowed = {
		OR = {
			original_tag = USA
			original_tag = ENG
		}
	}
	enable = {
		is_historical_focus_on = yes
		any_state = {
			is_core_of = LBA
			controller = { is_in_faction_with = ENG }
		}
		NOT = { has_idea = d_day_preparation_2 }
		NOT = { has_idea = d_day_preparation_3 }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = strategic_air_importance
		id = 29 
		value = 45000 #Too easy to lose planes here
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 169 
		value = 25000 
	}
	ai_strategy = {
		type = front_unit_request
		state_trigger = { 
			state = 116
		}
		value = -75
	}
}

ENG_take_italys_spaghetti = {
	allowed = {
		OR = {
			original_tag = USA
			original_tag = ENG
		}
		is_historical_focus_on = yes
	}
	enable = {
		date > 1942.1.1
		OR = {
			has_idea = d_day_preparation_1
			has_idea = d_day_preparation_2
			has_idea = d_day_preparation_3
			has_global_flag = allied_victory_in_africa
			date > 1942.6.1 #d-day prep must begin
			any_country = {
				is_in_faction_with = ENG
				is_ai = no
			}
		}
		NOT = {
			any_country = {
				original_tag = ITA
				OR = {
					surrender_progress > 0.2
					has_civil_war = yes
				}
			}
		}
		any_state = {
			is_core_of = LBA
			OR = {
				controller = { is_in_faction_with = ENG }
				owner = { is_in_faction_with = ENG }
			}
		}
		date < 1943.4.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = strategic_air_importance
		id = 29 
		value = 10000 #Too easy to lose planes here
	}

	ai_strategy = {
		type = area_priority
		id = italy
		value = 150
	}

	ai_strategy = {
		type = area_priority
		id = sardinia
		value = 50
	}

	ai_strategy = {
		type = invasion_unit_request
		tag = ITA
		value = 80
	}

	ai_strategy = {
		type = invasion_unit_request
		area = south_france_landing_zone
		value = -100
	}
	
	ai_strategy = {
		type = area_priority
		id = north_africa
		value = 40
	}

	ai_strategy = {
		type = area_priority
		id = normandy_landing_zone
		value = -50
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 69 # north sea
	}
}

ENG_it_is_invade_time = {
	allowed = {
		OR = {
			original_tag = USA
			original_tag = ENG
		}
		is_historical_focus_on = yes
	}
	enable = {
		NOT = { has_idea = d_day_preparation_3 }
		OR = { 
			has_idea = d_day_preparation_1
			has_idea = d_day_preparation_2
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_invasion_focus
		value = 15
	}

}

ENG_onto_the_beaches = {
	allowed = {
		OR = {
			original_tag = USA
			original_tag = ENG
		}
		is_historical_focus_on = yes
	}
	enable = {
		OR = {
			has_global_flag = allied_victory_in_africa
			date > 1943.1.1 #d-day prep must begin
		}
		date > 1942.6.1
		NOT = { has_idea = d_day_preparation_3 }
		OR = { 
			has_idea = d_day_preparation_1
			has_idea = d_day_preparation_2
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_invasion_focus
		value = 10
	}

	ai_strategy = {
		type = invasion_unit_request
		area = normandy_landing_zone
		value = 5
	}

}

ENG_onto_the_beaches_2 = {
	allowed = {
		OR = {
			original_tag = USA
			original_tag = ENG
		}
		is_historical_focus_on = yes
	}
	enable = {
		date > 1942.8.1
		OR = {
			has_global_flag = allied_victory_in_africa
			date > 1943.1.1 #d-day prep must begin
		}
		NOT = { has_idea = d_day_preparation_3 }
		OR = { 
			has_idea = d_day_preparation_1
			has_idea = d_day_preparation_2
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_invasion_focus
		value = 20
	}
	
	ai_strategy = {
		type = invasion_unit_request
		area = normandy_landing_zone
		value = 6
	}
	
	ai_strategy = {
		type = area_priority
		id = normandy_landing_zone
		value = 80
	}
}

ENG_onto_the_beaches_3 = {
	allowed = {
		OR = {
			original_tag = USA
			original_tag = ENG
		}
		is_historical_focus_on = yes
	}
	enable = {
		date > 1943.1.1
		OR = {
			has_global_flag = allied_victory_in_africa
			date > 1942.8.1 #d-day prep must begin
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_invasion_focus
		value = 30
	}
}

ENG_onto_the_beaches_4 = {
	allowed = {
		OR = {
			original_tag = USA
			original_tag = ENG
		}
		is_historical_focus_on = yes
	}
	enable = {
		date > 1943.1.1
		OR = {
			has_global_flag = allied_victory_in_africa
			date > 1943.1.1 #d-day prep must begin
		}
		NOT = { has_idea = d_day_preparation_3 }
		OR = { 
			has_idea = d_day_preparation_1
			has_idea = d_day_preparation_2
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_invasion_focus
		value = 20
	}
}

ENG_USA_d_day = {
	allowed = {
		OR = {
			original_tag = USA
			original_tag = ENG
		}
		is_historical_focus_on = yes
	}
	enable = {
		OR = {
			date > 1944.2.1
			AND = {
				date > 1942.8.1
				NOT = { 
					OR = {
						has_global_flag = vanilla_history
					}
				}
			}
		}
		OR = {
			has_global_flag = allied_victory_in_africa
			date > 1942.8.1 #d-day prep must begin
		}
		NOT = { has_idea = d_day_preparation_3 }
		OR = { 
			has_idea = d_day_preparation_1
			has_idea = d_day_preparation_2
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = area_priority
		id = normandy_landing_zone
		value = 60
	}

	ai_strategy = {
		type = invasion_unit_request
		area = normandy_landing_zone
		value = 5
	}

}

ENG_RAJ_the_hot_gates = {
	allowed = {
		OR = {
			original_tag = NEP
			original_tag = RAJ
		}
	}
	enable = {
		OR = {
			671 = { is_controlled_by = JAP }
			670 = { is_controlled_by = JAP }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = area_priority
		id = burma
		value = 60
	}

	ai_strategy = {
		type = front_unit_request
		area = burma
		value = 300
	}

	ai_strategy = {
		type = front_unit_request
		state_trigger = {
			owner = { is_in_faction_with = JAP }
			OR = {
				is_core_of = SIA
				is_core_of = CHI
				is_core_of = MAN
				is_core_of = JAP
			}
		}
		value = 300
	}

}

ENG_we_hate_fighting_in_the_balkans = {

	allowed = {
		is_allied_ai = yes
	}
	enable = {
		date < 1943.6.1
		NOT = { has_global_flag = allied_victory_in_africa }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = dont_defend_ally_borders #Just a bit, we wait for greece
		id = YUG
		value = 30
	}

	ai_strategy = {
		type = dont_defend_ally_borders #Just a bit, we wait for greece
		id = GRE
		value = 30
	}

	ai_strategy = {
		type = front_unit_request
		area = albania
		value = -50
	}
	ai_strategy = {
		type = invasion_unit_request
		area = albania
		value = -50
	}

	ai_strategy = {
		type = area_priority
		id = albania
		value = -50
	}
}

ENG_dont_kick_russia_out_from_triple_entente_due_to_gobbling_up_breakaway_states = {
	allowed = {
		original_tag = ENG
	}

	enable = {
		is_in_faction_with = SOV
		SOV = { has_completed_focus = SOV_the_triple_entente }
	}

	abort = {
		NOT = { is_in_faction_with = SOV }
	}

	ai_strategy = {
		type =  alliance
		id = SOV
		value = 500
	}

	ai_strategy = {
		type =  befriend
		id = SOV
		value = 500
	}
}

ENG_the_baltic_is_a_terrible_holiday_destination = {
	
	allowed = {
		original_tag = ENG
	}

	enable = {
		OR = {
			has_war_with = GER
			has_war_with = DEN
			GER = {
				OR = {
					has_war_with = POL
					has_war_with = HOL
					has_war_with = DEN
				}
			}
		}
	}
	
	abort = {
		GER = { has_war = no }
	}
	
	ai_strategy = {
		type = naval_avoid_region
		id = 9 #northern baltic
		value = 200
	}
	ai_strategy = {
		type = naval_avoid_region
		id = 206 #central baltic
		value = 200
	}
	ai_strategy = {
		type = naval_avoid_region
		id = 207 #danish belts
		value = 200
	}
	#ai_strategy = {
	#	type = naval_avoid_region
	#	id = 279 #Bothnia
	#	value = 200
	#}
	ai_strategy = {
		type = naval_avoid_region
		id = 9 #gulf of finland
		value = 200
	}
}

ENG_chill_on_the_pacific = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		is_historical_focus_on = yes
		has_war_with = JAP
		has_war_with = GER
		GER = { has_capitulated = no }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = area_priority
		id = pacific
		value = -50
	}
	
	ai_strategy = { #Invade japan after germany has capitulated
		type = invade
		id = "JAP"
		value = -500
	}
	
}

ENG_to_tobruk = {
	allowed = { 
		OR = {
			original_tag = ENG 
			original_tag = FRA
		}
	}
	enable = { 
		is_historical_focus_on = yes
		451 = { is_controlled_by = ITA }
		has_war_with = ITA
		FRA = { has_capitulated = no }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		state = 451 #derna

		ratio = 0.1

		priority = 100
		ordertype = front
		execution_type = rush
		execute_order = yes
	}
	
	ai_strategy = {
		type = invasion_unit_request
		area = north_africa
		value = 15
	}
	
	ai_strategy = {
		type = invasion_unit_request
		area = italy
		value = -100
	}
	
	ai_strategy = {
		type = area_priority
		id = north_africa
		value = 50
	}
	
	ai_strategy = {
		type = area_priority
		id = italy
		value = -100
	}
	
	ai_strategy = {
		type = invade
		id = "ITA"
		value = 550 #counterbalances...
	}
	
}

ENG_dont_invade_norway = {
	allowed = { original_tag = ENG }
	enable = {
		is_historical_focus_on = yes
		date < 1943.2.1
		has_war_with = NOR
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = invade
		id = "NOR"
		value = -500
	}
	
	ai_strategy = {
		type = area_priority
		id = scandinavia
		value = -100
	}
	
	ai_strategy = {
		type = front_unit_request
		area = scandinavia
		value = -100
	}
	
}
