
ENG_convoy_voy_voy = {
	allowed = { original_tag = ENG }
	enable = {
		has_government = democratic
		has_war = no
		has_equipment = {
			convoy < 1000
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = equipment_production_min_factories
		id = convoy
		value = 5
	}
}

ENG_convoy_voy_voy2 = {
	allowed = { original_tag = ENG }
	enable = {
		has_government = democratic
		has_war = yes
		has_equipment = {
			convoy < 1000
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = equipment_production_min_factories
		id = convoy
		value = 10
	}
}
build_aden_is_cool = {
	allowed = { original_tag = ENG }
	enable = {
		controls_state = 992
		992 = { has_dynamic_modifier = { modifier = idea_RAJ_aden_treaty_port } }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
       	 	type = factory_build_score_factor
        	target = 992
       		value = 1000
    	}
}
allies_do_not_rely_on_AIFC = {
	enable = {
		is_historical_focus_on = yes
		is_in_faction_with = ENG
		NOT = {
			OR = {
				tag = ENG
				tag = USA
				tag = FRA
				has_global_flag = d_day_happened
				has_country_flag = fastgaming_test
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = force_concentration_factor
		value = -100
	}
}

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 = {
		game_is_on_historical_course = yes
		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 = {
				GER = { is_ai = no }
				is_historical_focus_on = yes
			}
		}
		NOT = { GER = { surrender_progress > 0.03 } }
	}

	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_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
	}
}

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 = 2
	}

 	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 = {
	enable = {
		is_historical_focus_on = yes
		OR = {
			is_in_faction_with = ENG
			is_in_faction_with = USA
		}
		OR = {
			has_war_with = GER
			has_war_with = ITA
			has_war_with = BUL
		}
		game_is_on_historical_course = yes
		NOT = { 
			OR = {
				original_tag = GRE
				original_tag = YUG
				original_tag = HUN
				original_tag = ROM
				original_tag = TUR
				original_tag = BUL
				original_tag = ALB
				original_tag = ITA
				is_subject_of = YUG
				is_subject_of = GRE
				is_subject_of = HUN
				is_subject_of = ROM
				is_subject_of = TUR
				is_subject_of = BUL
				is_subject_of = ALB
				is_subject_of = ITA
			}
		}
	}
	abort = {
		OR = {
			is_historical_focus_on = no
			AND = {
				NOT = { has_war_with = BUL }
				NOT = { has_war_with = GER }
				NOT = { has_war_with = ITA }
				is_historical_focus_on = yes
			}
			AND = {
				has_war_with = BUL
				BUL = { surrender_progress > 0.3 }
			}
			AND = {
				GRE = { 
					surrender_progress < 0.3
					date > 1943.1.1
				}
			}
			game_is_on_historical_course = no
		}
	}

	ai_strategy = {
		type = front_unit_request
		state_trigger = {
			OR = {
				is_core_of = GRE
				is_core_of = YUG
				is_core_of = BUL
				is_core_of = ALB
			}
		}
		value = -25
	}

	ai_strategy = {
		type = invasion_unit_request
		state_trigger = {
			OR = {
				is_core_of = GRE
				is_core_of = YUG
				is_core_of = BUL
				is_core_of = ALB
			}
		}
		value = -25
	}

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

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

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

	ai_strategy = {
		type = dont_defend_ally_borders
		id = "YUG"
		value = 9999
	}
}

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_punitive = {
	enable = {
		has_global_flag = {
			flag = league_of_nation_intervention_against_germany
			days < 365
		}
		set_temp_variable = { push_days = global.num_days }
		modulo_temp_variable = { push_days = 60 }
		check_variable = { push_days < 18 }
		has_war_with = GER
		NOT = { 
			has_global_flag = league_of_nation_intervention_against_germany_success
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		tag = GER

		ratio = 0.3

		priority = 300
		ordertype = front
		execution_type = balanced
	}

}
the_push_into_the_reich_punitive_success = {
	enable = {
		has_global_flag = {
			flag = league_of_nation_intervention_against_germany
			days < 365
		}
		has_war_with = GER
		has_global_flag = league_of_nation_intervention_against_germany_success
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		tag = GER

		ratio = 0.1

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

}

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
	}

}

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

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

}

ENG_unit_production = {

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

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

	# 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 = 15
	}

	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 = 37
	}

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

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = strategic_bomber
		value = 5
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = large_plane_airframe
		value = 1
	}

	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 = 25
	}
	ai_strategy = {
		type = unit_ratio
		id = strategic_bomber
		value = 5
	}

	ai_strategy = {
		type = equipment_production_factor
		id = strategic_bomber
		value = 5
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = large_plane_airframe
		value = 1
	}

	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 = naval_bomber
		value = 2
	}

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

}

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 = { 
			OR = {
				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
		value = 120
	}
}

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
    		value = 30
	}
}

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_fate_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_fate_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 
		is_historical_focus_on = yes
		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
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_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
		NOT = { is_in_faction_with = USA }
		game_is_on_historical_course = yes
		OR = {
			has_global_flag = FRA_already_surrendered
			AND = {
				FRA = { surrender_progress > 0.25 }
				is_ai_mech_mob = no
				is_ai_mass_mob = no
				is_major = yes
			}
			AND = {
				FRA = { surrender_progress > 0.35 }
				is_ai_mech_mob = no
				is_ai_mass_mob = no
				is_major = no
			}
			AND = {
				FRA = { surrender_progress > 0.45 }
				is_ai_mech_mob = yes
			}
			AND = {
				FRA = { surrender_progress > 0.8 }
				is_ai_mech_mob = no
				is_ai_mass_mob = yes
			}
		}
		date < 1941.1.1
	}

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

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

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

	ai_strategy = {
		type = put_unit_buffers #evacuate here
		states = {
			125
			126
			127
			130
			123
			4
			12
			6
		}

		ratio = 0.30

		area = europe

		subtract_invasions_from_need = no
	}
}

ENG_time_to_ditch_FRA = {
	allowed = {
		original_tag = ENG
	}

	enable = {
		is_historical_focus_on = yes
		FRA = {
			has_capitulated = no
			surrender_progress > 0.25
		}
		date < 1941.1.1
		OR = {
			NOT = { has_global_flag = FRA_already_surrendered }

			#lets give a month of retreat time after capitulation

			AND = {
				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_accept_USA_access = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		tag = ENG
		has_war = yes
		USA = {
			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 = 65
	}
	ai_strategy = {
		type = air_factory_balance
		value = 15
	}
}

ENG_proto_eco_quid_pro_quo = {
	allowed = { original_tag = ENG }
	enable = {
		is_historical_focus_on = yes
		date < 1936.8.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = arms_factory
		value = -100
	}

	ai_strategy = {
		type = building_target
		id = dockyard
		value = -100
	}

	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = -100
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 126 
		value = 2000
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 127
		value = 2000
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 128
		value = 2000
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 122
		value = 2000
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 132
		value = 2000
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 130
		value = 2000
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 338
		value = 2000
	}

	ai_strategy = {
		type = build_building
		id = infrastructure
		target = 121
		value = 2000
	}
}
ENG_industry_we_on_an_island_bruv = {
	allowed = { original_tag = ENG }
	enable = {
		is_historical_focus_on = 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 = 15
	}
}

ENG_navy_preparation = {
	allowed = { original_tag = ENG }
	enable = {
		is_historical_focus_on = yes
		OR = {
			GER = { is_ai = no }
			ITA = { is_ai = no }
			JAP = { is_ai = no }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = dockyard
		value = 10
	}
}
ENG_convoy_preparation = {
	allowed = { original_tag = ENG }
	enable = {
		is_historical_focus_on = yes
		OR = {
			GER = { is_ai = no }
			ITA = { is_ai = no }
			JAP = { is_ai = no }
		}
		has_war = yes
	}
	abort_when_not_enabled = yes

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

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

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

	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 > 1939.1.1
		num_of_military_factories < 150
	}
	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 = 150
	}
}

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
		NOT = {
			AND = {
				ENG = { has_war_with = JAP }
				SOV = { has_war_with = JAP }
				GER = { has_country_flag = LSM_eligibility_nation }
				NOT = { ENG = { has_war_with = SOV } }
			}
		}
	}
	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 = 50
	}

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

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 = 50
	}
}

TOA_blockade_venezuela = {
	allowed = {
		OR = {
			tag = BRA
			tag = MEX
			tag = CHL
		}
	}
	enable = {
		is_historical_focus_on = yes
		threat > 0.5
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = strike_force_home_base
		id = 53
	}
}


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_norway_is_not_THAT_important = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		is_historical_focus_on = yes
		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_RAJ_the_hot_gates = {
	allowed = {
		OR = {
			original_tag = NEP
			original_tag = RAJ
		}
	}
	enable = {
		is_historical_focus_on = yes
		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 = 25
	}

	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 = 15
	}

}

ENG_sonar_are_cool = {
	allowed = {
		OR = {
			original_tag = ENG
			original_tag = USA
		}
	}
	enable = {
		NOT = { has_tech = improved_sonar }
	}

	abort = {
		has_tech = improved_sonar
	}

	ai_strategy = {
		type = research_tech
		id = sonar
		value = 100
	}

	ai_strategy = {
		type = research_tech
		id = improved_sonar
		value = 100
	}
}
ENG_radar_2_are_cool = {
	allowed = {
		OR = {
			original_tag = ENG
			original_tag = USA
		}
	}
	enable = {
		NOT = { has_tech = cavity_magnatron }
		date > 1938.1.1
	}

	abort = {
		has_tech = cavity_magnatron
	}

	ai_strategy = {
		type = research_tech
		id = cavity_magnatron
		value = 100
	}
}
ENG_we_hate_fighting_in_the_balkans = {

	allowed = {
		is_allied_ai = yes
	}
	enable = {
		game_is_on_historical_course = yes
		is_historical_focus_on = yes
		date < 1943.6.1
		NOT = { has_global_flag = allied_victory_in_africa }
		NOT = { 
			OR = {
				is_neighbor_of = GRE
				is_neighbor_of = YUG
				is_neighbor_of = HUN
				is_neighbor_of = ROM
				is_neighbor_of = TUR
				is_neighbor_of = BUL
				is_neighbor_of = ALB
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = invasion_unit_request
		area = 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_avoid_balkans_until_africa_is_secure = {
	allowed = { original_tag = ENG }
	enable = {
		is_historical_focus_on = yes
		date > 1939.6.6
		date < 1943.6.6

		# The check below should really be a scripted trigger or something
		OR = { # Check whole north-african coast
			448 = { CONTROLLER = { has_war_with = ROOT } } # tripoli
			450 = { CONTROLLER = { has_war_with = ROOT } } # benghazi
			458 = { CONTROLLER = { has_war_with = ROOT } } # tunisia
			461 = { CONTROLLER = { has_war_with = ROOT } } # casablanca
			462 = { CONTROLLER = { has_war_with = ROOT } } # marrakech
			459 = { CONTROLLER = { has_war_with = ROOT } } # algiers
			460 = { CONTROLLER = { has_war_with = ROOT } } # constantine
			665 = { CONTROLLER = { has_war_with = ROOT } } # gabès
			449 = { CONTROLLER = { has_war_with = ROOT } } # el agheila
			451 = { CONTROLLER = { has_war_with = ROOT } } # derna
			452 = { CONTROLLER = { has_war_with = ROOT } } # matrouh
			447 = { CONTROLLER = { has_war_with = ROOT } } # alexandria
			446 = { CONTROLLER = { has_war_with = ROOT } } # cairo
			290 = { CONTROLLER = { has_war_with = ROOT } } # spanish africa
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = invasion_unit_request
		area = greater_balkans
		value = -100
	}

	ai_strategy = {
		type = area_priority
		id = greater_balkans
		value = -50
	}
 
}
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_prepare_gibraltar = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		date > 1941.1.1
		118 = {
			naval_base < 8
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = build_building
		id = naval_base
		target = 4135
		value = 10
	}
}

ENG_raids = {
	allowed = {
		original_tag = ENG
	}
    	enable = { always = yes }
    	abort_when_not_enabled = yes
    	ai_strategy = {
       		type = raid_target_country
        	id = GER
        	value = 200 # +200% more likely to target GER
    	}
}
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
	}
	
}
