
african_fun_time = {
	enable = {
		OR = {
			original_tag = SAF
			original_tag = ETH
			original_tag = AST
			original_tag = MAL
			original_tag = NZL
			original_tag = EGY
			capital_scope = { is_on_continent = africa }
			capital_scope = { is_on_continent = asia }
		}
		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
				}
			}
		}
		OR = {
			has_global_flag = allies_mainland_withdrawal
			FRA = { has_capitulated = yes }
			452 = { controller = { has_war_with = ENG } }
		}
		date < 1941.1.1
		is_in_faction_with = ENG
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			447
		}

		ratio = 0.3

		area = suez

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}
	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
		home_island_capitulated_defense_condition = yes
		transition_no_europe_war = no
		OR = {
			is_prepping_d_day = no
			AND = {
				is_historical_focus_on = yes
				d_day_secured = no
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			125
			126
			127
			130
			123
		}

		ratio = 0.80

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}


	ai_strategy = {
		type = put_unit_buffers
		states = {
			338
			131
			121
			119
			132
			122
			4
			12
			6
		}

		ratio = 0.30

		area = europe

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

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

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

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

	ai_strategy = {
		type = strike_force_home_base
		id = 16
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 43 # north sea
	}
}
ENG_always_worry_about_invasion_support_england_first_if_you_cant_fight_2 = {
	enable = {
		is_in_faction_with = ENG
		home_island_others_defense_condition = yes
		transition_no_europe_war = no
		OR = {
			is_prepping_d_day = no
			AND = {
				is_historical_focus_on = yes
				d_day_secured = no
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			125
			126
			127
			130
			123
		}

		ratio = 0.50

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}


	ai_strategy = {
		type = put_unit_buffers
		states = {
			338
			131
			121
			119
			132
			122
			4
			12
			6
		}

		ratio = 0.20

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}
	ai_strategy = {
		type = garrison
		value = -9999
	}
}
ENG_the_natural_defense_of_britain_others = {
	enable = {
		NOT = { tag = ENG }
		is_in_faction_with = ENG
		transition_no_europe_war = no
		home_island_others_defense_condition = no
		home_island_capitulated_defense_condition = no
		OR = {
			is_prepping_d_day = no
			AND = {
				is_historical_focus_on = yes
				d_day_secured = no
			}
		}
	}

	abort_when_not_enabled = yes

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

		ratio = 0.10

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}


	ai_strategy = {
		type = put_unit_buffers
		states = {
			338
			131
			121
			119
			132
			932
			122
			4
			12
			6
		}

		ratio = 0.05

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}
	ai_strategy = {
		type = garrison
		value = -9999
	}
}
ENG_the_natural_defense_of_britain_base = {
	allowed = {
		tag = ENG
	}
	enable = {
		home_island_britain_defense_condition = no
		transition_no_europe_war = no
		OR = {
			is_prepping_d_day = no
			AND = {
				is_historical_focus_on = yes
				d_day_secured = no
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
	    	type = put_unit_buffers
	    	ratio = 0.15
	    	states = {
			127
			338
			126
			123
			122
			130
			131
			125
	    	}
		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}
	ai_strategy = {
		type = put_unit_buffers
		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 = no
	}
}
ENG_the_natural_defense_of_britain_base_additional_ahist = {
	allowed = {
		tag = ENG
	}
	enable = {
		is_historical_focus_on = no
	}

	abort_when_not_enabled = yes

	ai_strategy = {
	    	type = put_unit_buffers
	    	ratio = 0.22
	    	states = {
			127
			338
			126
			123
			122
			130
			131
			125
	    	}
		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}
	ai_strategy = {
		type = put_unit_buffers
		states = {
			338
			131
			121
			119
			132
			932
			122
			4
			12
			6
		}

		ratio = 0.11
		area = europe


		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}
}
ENG_the_natural_defense_of_britain_britain = {
	allowed = {
		tag = ENG
	}
	enable = {
		home_island_britain_defense_condition = yes
		transition_no_europe_war = no
		is_prepping_d_day = no
	}

	abort_when_not_enabled = yes

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

		ratio = 0.70

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = yes
	}


	ai_strategy = {
		type = put_unit_buffers
		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
	}
}
ENG_home_guard_is_cool_others_minor = {
	enable = {
		NOT = { tag = ENG }
		is_in_faction_with = ENG
		ENG = { surrender_progress > 0 }
		is_major = no
	}

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

		ratio = 0.2

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}


	ai_strategy = {
		type = put_unit_buffers
		states = {
			338
			131
			121
			119
			132
			122
			4
			932
			12
			6
		}

		ratio = 0.2

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}

	abort_when_not_enabled = yes

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

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

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

	ai_strategy = {
	    	type = front_control
	    	state_trigger = {
	        	is_core_of = ENG
	    	}
	    	area = UK_excluding_ni
	    	priority = 99999
	    	ratio = 0
	    	ordertype = front
	   	execution_type = rush
	    	execute_order = yes
	    	manual_attack = yes
	}

	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 126
		value = 4
	}
	ai_strategy = {
		type = garrison
		value = -9999
	}
}
ENG_home_guard_is_cool_others_major = {
	enable = {
		NOT = { tag = ENG }
		is_in_faction_with = ENG
		ENG = { surrender_progress > 0 }
		is_major = yes
	}

	abort_when_not_enabled = yes

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

		ratio = 0.15

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}


	ai_strategy = {
		type = put_unit_buffers
		states = {
			338
			131
			121
			119
			132
			122
			4
			932
			12
			6
		}

		ratio = 0.15

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}

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

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

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

	ai_strategy = {
	    	type = front_control
	    	state_trigger = {
	        	is_core_of = ENG
	    	}
	    	area = UK_excluding_ni
	    	priority = 99999
	    	ratio = 0
	    	ordertype = front
	   	execution_type = rush
	    	execute_order = yes
	    	manual_attack = yes
	}

	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 126
		value = 9
	}
	ai_strategy = {
		type = garrison
		value = -9999
	}
}
ENG_home_guard_is_coole = {
	enable = {
		tag = ENG
		surrender_progress > 0
	}

	abort = {
		NOT = { surrender_progress > 0 }
	}

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

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

		ratio = 0.3

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}


	ai_strategy = {
		type = put_unit_buffers
		states = {
			338
			131
			121
			119
			132
			122
			4
			932
			12
			6
		}

		ratio = 0.3

		area = europe

		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}

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

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

	ai_strategy = {
	    	type = front_control
	    	state_trigger = {
	        	is_core_of = ENG
	    	}
	    	area = UK_excluding_ni
	    	priority = 99999
	    	ratio = 0
	    	ordertype = front
	   	execution_type = rush
	    	execute_order = yes
	    	manual_attack = yes
	}

	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 126
		value = 8
	}
}
ENG_avoid_raiding_english_channel_for_now = {
	enable = {
		game_is_on_historical_course = yes
		is_historical_focus_on = yes
		NOT = { ENG = { surrender_progress > 0 } }
		FRA = { has_capitulated = yes }
		is_in_faction_with = FRA
		NOT = { is_in_faction_with = USA }
		is_in_faction_with = ENG #getting bombed isn't cool
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = naval_convoy_raid_region
		id = 18
		value = -3000
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 43 #english channel
		value = 250
	}

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 16 #english channel
		value = 250
	}

	ai_strategy = {
    		type = strike_force_home_base
    		id = 43
    		value = 120
	}

	ai_strategy = {
    		type = strike_force_home_base
    		id = 16
    		value = 120
	}


}

ENG_let_sealion_happens_FRA_alive = {
	enable = {
		game_is_on_historical_course = yes
		is_historical_focus_on = yes
		NOT = { ENG = { surrender_progress > 0 } }
		FRA = { has_capitulated = no }
		is_in_faction_with = FRA
		is_in_faction_with = ENG
	}
	abort_when_not_enabled = yes

	#ai_strategy = {
	#	type = naval_avoid_region
	#	id = 18
	#	value = 20
	#}

	ai_strategy = {
	    	type = naval_mission_threshold
	    	id = MISSION_STRIKE_FORCE
	    	value = -100
	}

	#ai_strategy = {
	#    	type = naval_mission_threshold
	#    	id = MISSION_CONVOY_RAIDING
	#    	value = 300
	#}

	#ai_strategy = {
	#    	type = naval_mission_threshold
	#    	id = MISSION_PATROL
	#    	value = 300
	#}

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

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

	#ai_strategy = {
    	#	type = strike_force_home_base
    	#	id = 18
    	#	value = 120
	#}

	ai_strategy = {
    		type = strike_force_home_base
    		id = 43
    		value = 120
	}

	ai_strategy = {
    		type = strike_force_home_base
    		id = 16
    		value = 120
	}
}
ENG_let_sealion_happens_FRA_dead = {
	enable = {
		game_is_on_historical_course = yes
		is_historical_focus_on = yes
		NOT = { ENG = { surrender_progress > 0 } }
		FRA = { has_capitulated = yes }
		is_in_faction_with = FRA
		is_in_faction_with = ENG
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_avoid_region
		id = 42
		value = 500
	}

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

	ai_strategy = {
	    	type = naval_mission_threshold
	    	id = MISSION_STRIKE_FORCE
	    	value = -100
	}

	#ai_strategy = {
	#    	type = naval_mission_threshold
	#    	id = MISSION_CONVOY_RAIDING
	#    	value = 300
	#}

	#ai_strategy = {
	#    	type = naval_mission_threshold
	#    	id = MISSION_PATROL
	#    	value = 300
	#}

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

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

	#ai_strategy = {
    	#	type = strike_force_home_base
    	#	id = 18
    	#	value = 120
	#}

	ai_strategy = {
    		type = strike_force_home_base
    		id = 43
    		value = 120
	}

	ai_strategy = {
    		type = strike_force_home_base
    		id = 16
    		value = 120
	}
}

ENG_raid_the_channel = {
	enable = {
		OR = {
			is_in_faction_with = ENG
			original_tag = ENG
		}
		OR = {
			127 = { NOT = { is_fully_controlled_by = ENG } }
			123 = { NOT = { is_fully_controlled_by = ENG } }
			126 = { NOT = { is_fully_controlled_by = ENG } }
			125 = { NOT = { is_fully_controlled_by = ENG } }
		}
		
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 18 #english channel
		value = 250
	}

	ai_strategy = {
    		type = strike_force_home_base
    		id = 18
    		value = 120
	}
}

ENG_raid_the_north_sea = {
	enable = {
		OR = {
			is_in_faction_with = ENG
			original_tag = ENG
		}
		has_war = yes
		OR = {
			130 = { NOT = { is_fully_controlled_by = ENG } }
			131 = { NOT = { is_fully_controlled_by = ENG } }
			121 = { NOT = { is_fully_controlled_by = ENG } }
			136 = { NOT = { is_fully_controlled_by = ENG } }
			120 = { NOT = { is_fully_controlled_by = ENG } }
		}
		
	}
	abort_when_not_enabled = yes

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

	ai_strategy = {
    		type = strike_force_home_base
    		id = 16
    		value = 120
	}
}

ENG_raid_the_western_appproaches = {
	enable = {
		OR = {
			is_in_faction_with = ENG
			original_tag = ENG
		}
		has_war = yes

		OR = {
			120 = { NOT = { is_fully_controlled_by = ENG } }
			133 = { NOT = { is_fully_controlled_by = ENG } }
			131 = { NOT = { is_fully_controlled_by = ENG } }
			132 = { NOT = { is_fully_controlled_by = ENG } }
			122 = { NOT = { is_fully_controlled_by = ENG } }
			338 = { NOT = { is_fully_controlled_by = ENG } }
			131 = { NOT = { is_fully_controlled_by = ENG } }
		}
		
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_convoy_raid_region
		id = 16 #english channel
		value = 250
	}

	ai_strategy = {
    		type = strike_force_home_base
    		id = 16
    		value = 120
	}
}
