#################
### Diplomacy ###
#################
ENG_hates_reichspakt = {
	reversed = yes

	enable_reverse = {
		ENG = { has_socialist_government = yes }
		GER = {
			is_faction_leader = yes
			has_socialist_government = no
		}
	}
	enable = {
		is_in_faction_with = GER
	}
	abort_when_not_enabled = yes

	target_array = GER.faction_members

	ai_strategy = {
		type = antagonize
		id = ENG
		value = 1000
	}
	ai_strategy = {
		type = diplo_action_acceptance
		target = market_access_rights
		id = ENG
		value = -1000
	}
}
ENG_hates_entente = {
	reversed = yes

	enable_reverse = {
		ENG = { has_socialist_government = yes }
		ENT = {
			is_faction_leader = yes
			has_socialist_government = no
		}
	}
	enable = {
		is_in_faction_with = ENT
	}
	abort_when_not_enabled = yes

	target_array = ENT.faction_members

	ai_strategy = {
		type = antagonize
		id = ENG
		value = 1000
	}
	ai_strategy = {
		type = diplo_action_acceptance
		target = market_access_rights
		id = ENG
		value = -1000
	}
}

################
### Industry ###
################

ENG_per_ardua_ad_astra_1 = {
	allowed = {
		original_tag = ENG
	}
	enable = { always = yes }
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = 50
	}
	ai_strategy = { type = unit_ratio id = fighter value = 60 }
	ai_strategy = { type = unit_ratio id = cas value = 40 }
}

ENG_per_ardua_ad_astra_2 = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		date > 1938.6.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = air_factory_balance
		value = 125
	}
	ai_strategy = { type = unit_ratio id = fighter value = 60 }
	ai_strategy = { type = unit_ratio id = cas value = 40 }
}

ENG_per_ardua_ad_astra_3 = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		has_war = yes
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = air_factory_balance
		value = 125
	}
	ai_strategy = { type = unit_ratio id = fighter value = 60 }
	ai_strategy = { type = unit_ratio id = cas value = 40 }
}

ENG_the_wooden_wall = {
	allowed = {
		original_tag = ENG
	}
	enable = { always = yes }
	abort_when_not_enabled = yes

	ai_strategy = {
		type = dockyard_to_military_factory_ratio
		value = 20
	}

	ai_strategy = {
		type = naval_invasion_focus
		value = 80
	}

	ai_strategy = {
		type = role_ratio
		id = marine
		value = 10
	}
	ai_strategy = {
		type = template_prio
		id = marine
		value = 100
	}
}

ENG_produce_synthetic_oil = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		date > 1939.6.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = building_target
		id = synthetic_refinery
		value = 8
	}
}

ENG_build_naval_bombers = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		always = yes
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = unit_ratio
		id = naval_bomber
		value = 10
	}
	ai_strategy = {
		type = equipment_production_factor
		id = naval_bomber
		value = 15
	}
}

ENG_build_patrol_bombers = {
	allowed = {
		original_tag = ENG
		has_dlc_bba = yes
	}
	enable = {
		is_eligible_for_heavy_aircraft_production = yes
	}
	abort_when_not_enabled = yes

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

ENG_build_radars_sussex = {
	allowed = {
		original_tag = ENG
		threat > 0.6
		is_special_project_completed = sp:sp_air_radar
	}
	enable = {
		127 = { #Sussex
			controller = { is_ally_with = FROM }
			free_building_slots = { building = radar_station size > 0 }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = radar_station
		target = 127 #Sussex
		value = 2000
	}
}

ENG_build_radars_london = {
	allowed = {
		original_tag = ENG
		threat > 0.6
		is_special_project_completed = sp:sp_air_radar
	}
	enable = {
		126 = { #Greater London
			controller = { is_ally_with = FROM }
			free_building_slots = { building = radar_station size > 0 }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = radar_station
		target = 126 #Greater London
		value = 2000
	}
}

ENG_build_radars_east_anglia = {
	allowed = {
		original_tag = ENG
		threat > 0.6
		is_special_project_completed = sp:sp_air_radar
	}
	enable = {
		125 = { #East Anglia
			controller = { is_ally_with = FROM }
			free_building_slots = { building = radar_station size > 0 }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = radar_station
		target = 125 #East Anglia
		value = 2000
	}
}

ENG_build_radars_cornwall = {
	allowed = {
		original_tag = ENG
		threat > 0.6
		is_special_project_completed = sp:sp_air_radar
	}
	enable = {
		123 = { #Cornwall
			controller = { is_ally_with = FROM }
			free_building_slots = { building = radar_station size > 0 }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = radar_station
		target = 123 #Cornwall
		value = 2000
	}
}

ENG_build_radars_yorkshire = {
	allowed = {
		original_tag = ENG
		threat > 0.6
		is_special_project_completed = sp:sp_air_radar
	}
	enable = {
		130 = { #Yorkshire
			controller = { is_ally_with = FROM }
			free_building_slots = { building = radar_station size > 0 }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = radar_station
		target = 130 #Yorkshire
		value = 2000
	}
}

ENG_build_radars_lothian = {
	allowed = {
		original_tag = ENG
		threat > 0.7
		is_special_project_completed = sp:sp_air_radar
	}
	enable = {
		121 = { #Lothian
			controller = { is_ally_with = FROM }
			free_building_slots = { building = radar_station size > 0 }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = radar_station
		target = 121 #Lothian
		value = 2000
	}
}

################
### Military ###
################
ENG_protect_our_coasts = {
	allowed = {
		original_tag = ENG
	}
	enable = { always = yes }
	abort_when_not_enabled = yes

	ai_strategy = {
		type = garrison
		value = 20
	}

	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 703 #Ascension
		value = 1
	}
	ai_strategy = {
		type = theatre_distribution_demand_increase
		id = 704 #Saint Helena
		value = 1
	}
}

ENG_scapa_flow_naval_base = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		has_war = yes
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = strike_force_home_base
		id = 16 #North Sea
	}
}

ENG_keep_out_of_the_baltic = {
	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 = 100
	}
	ai_strategy = {
		type = naval_avoid_region
		id = 206 #Southern Baltic
		value = 100
	}
	ai_strategy = {
		type = naval_avoid_region
		id = 147 #Danish Belts
		value = 100
	}
}

ENG_retreat_to_the_isles = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		has_war = yes
		any_home_area_neighbor_country = { has_war_with = ROOT } #ENG has no home_area neighbours unless invaded
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = dont_defend_ally_borders
		target = globally
		value = 100
	}
}

ENG_invade_ireland = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		has_war_with = IRE
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = invade
		id = IRE
		value = 200
	}
	ai_strategy = {
		type = invasion_unit_request
		tag = IRE
		value = 40
	}
	ai_strategy = {
		type = front_unit_request
		tag = IRE
		value = 100
	}
}

ENG_invade_iceland = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		has_war_with = ICE
		OR = {
			NOT = { has_war_with = IRE }
			IRE = { has_capitulated = yes }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = invade
		id = ICE
		value = 200
	}
	ai_strategy = {
		type = invasion_unit_request
		tag = ICE
		value = 25
	}
	ai_strategy = {
		type = front_unit_request
		tag = ICE
		value = 100
	}
}

ENG_invade_canada = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		has_war_with = CAN
		OR = {
			NOT = { has_war_with = IRE }
			IRE = { has_capitulated = yes }
		}
		OR = {
			NOT = { has_war_with = ICE }
			ICE = { has_capitulated = yes }
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = invade
		id = "IMP"
		value = 200
	}
	ai_strategy = {
		type = invasion_unit_request
		tag = IMP
		value = 100
	}
	ai_strategy = {
		type = front_unit_request
		tag = IMP
		value = 100
	}
}
