
VIC_unit_production = {
	allowed = { original_tag = FRA }
	enable = {
		has_focus_tree = vichy_french_focus
	}
	abort_when_not_enabled = yes

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

	ai_strategy = {
		type = role_ratio
		id = armor
		value = -300
	}
}


coastal_defense_of_the_reich = {
	allowed = {
		original_tag = FRA
	}
	enable = {
		is_historical_focus_on = yes
		OR = {
			has_focus_tree = vichy_french_focus
			has_global_flag = d_day_crisis
		}
		has_war_with = ENG
		ENG = { has_capitulated = no }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			22
			21
			851
			14
			15
			29
			2
			162
			103
			6
			7
			35
			36
			56
			5
		}
		ratio = 0.70
		area = europe
		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}

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

	ai_strategy = {
		type = garrison
		value = 4
	}
}


coastal_defense_of_the_reich_others = {
	enable = {
		is_historical_focus_on = yes
		is_in_faction_with = GER
		is_major = no
		NOT = {
			any_country = {
				capital_scope = { is_on_continent = europe }
				is_neighbor_of = GER
				NOT = { 
					OR = {
						tag = ENG 
						has_idea = LSM_neutrality_idea
					}
				}
				OR = {
					has_war_with = GER
					AND = {
						is_in_faction = yes
						NOT = { is_in_faction_with = GER }
					}
				}
				is_major = yes
				OR = {
					surrender_progress < 0.5
					has_capitulated = no
				}
			}
		}
		has_war_with = ENG
		ENG = { has_capitulated = no }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			22
			21
			851
			14
			15
			29
			2
			162
			103
			6
			7
			35
			36
			56
			5
		}
		ratio = 0.60
		area = europe
		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}

	ai_strategy = {
		type = role_ratio
		id = garrison
		value = 30
	}
}
axis_d_day_buffer = {
	enable = {
		is_in_faction_with = GER
		is_historical_focus_on = yes
		OR = {
			ENG = { is_ai = no }
			USA = { is_ai = no }
		}
		OR = {
			ENG = { has_idea = d_day_preparation_2 }
			USA = { has_idea = d_day_preparation_2 }
			ENG = { has_idea = d_day_preparation_1 }
			USA = { has_idea = d_day_preparation_1 }
			ENG = { has_idea = d_day_preparation_3 }
			USA = { has_idea = d_day_preparation_3 }
		}
		has_war_with = ENG
		ENG = { has_capitulated = no }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			2
			162
			19
			21
			22
			14
			30
			23
			15
			785
			29
			6
			977
			35
			7
			36
			56
			59
			58
		}
		ratio = 0.10
		area = europe
		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}

	ai_strategy = {
		type = garrison
		value = 4
	}
}

axis_d_day_buffer_2 = {
	enable = {
		is_in_faction_with = GER
		is_historical_focus_on = yes
		OR = {
			NOT = { is_neighbor_of = SOV }
			SOV = { surrender_progress > 0.50 }
		}
		OR = {
			ENG = { has_idea = d_day_preparation_2 }
			USA = { has_idea = d_day_preparation_2 }
			ENG = { has_idea = d_day_preparation_1 }
			USA = { has_idea = d_day_preparation_1 }
			ENG = { has_idea = d_day_preparation_3 }
			USA = { has_idea = d_day_preparation_3 }
		}
		OR = {
			has_global_flag = {
				flag = allied_victory_in_africa
				days > 210 
			}
			date > 1942.6.14
		}
		has_war_with = ENG
		ENG = { has_capitulated = no }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			2
			162
			19
			21
			22
			14
			30
			23
			15
			785
			29
			6
			977
			35
			7
			36
			56
			59
			58
		}
		ratio = 0.10
		area = europe
		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}

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

	ai_strategy = {
		type = garrison
		value = 4
	}

	ai_strategy = {
	 	type = front_unit_request
		tag = SOV
		value = -1
	}
}

axis_d_day_buffer_3 = {
	enable = {
		OR = {
			NOT = { is_neighbor_of = SOV }
			SOV = { surrender_progress > 0.50 }
		}
		is_in_faction_with = GER
		is_historical_focus_on = yes
		NOT = { has_global_flag = d_day_happened }
		OR = {
			ENG = { has_idea = d_day_preparation_2 }
			USA = { has_idea = d_day_preparation_2 }
			ENG = { has_idea = d_day_preparation_1 }
			USA = { has_idea = d_day_preparation_1 }
			ENG = { has_idea = d_day_preparation_3 }
			USA = { has_idea = d_day_preparation_3 }
		}
		OR = {
			has_global_flag = {
				flag = allied_victory_in_africa
				days > 300 
			}
			date > 1942.11.14
		}
		has_war_with = ENG
		ENG = { has_capitulated = no }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			2
			162
			19
			21
			22
			14
			30
			23
			15
			785
			29
			6
			977
			35
			7
			36
			56
			59
			58
		}
		ratio = 0.10
		area = europe
		subtract_invasions_from_need = yes
		subtract_fronts_from_need = no
	}

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

	ai_strategy = {
		type = garrison
		value = 4
	}

	ai_strategy = {
	 	type = front_unit_request
		tag = SOV
		value = -3
	}
}