
anti_soviet_pact_collective_action = {
	enable = {
		is_historical_focus_on = yes
		has_global_flag = SOV_has_early_war
		has_idea = anti_soviet_pact
		NOT = { has_government = communism }
		GER = { has_war_with = SOV }
		OR = {
			has_war = no
			has_war_with = SOV
		}
		GER = { has_idea = anti_soviet_pact }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = send_volunteers_desire
		id = "GER"
		value = 500
	}
	ai_strategy = {
		type = send_lend_lease_desire
		id = "GER"
		value = 500
	}
	ai_strategy = {
		type = support
		id = "GER"
		value = 500
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = 500
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = "GER"
		target = military_access
		value = 1000
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "GER"
		target = military_access
		value = 1000
	}
}

anti_soviet_pact_collective_action_reverse = {
	reversed = yes
	enable = {
		is_historical_focus_on = yes
		has_global_flag = SOV_has_early_war
		has_idea = anti_soviet_pact
		NOT = { has_government = communism }
		has_war_with = SOV
		GER = { has_idea = anti_soviet_pact }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = send_volunteers_desire
		id = "GER"
		value = 500
	}
	ai_strategy = {
		type = send_lend_lease_desire
		id = "GER"
		value = 500
	}
	ai_strategy = {
		type = support
		id = "GER"
		value = 500
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = 500
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = "GER"
		target = military_access
		value = 1000
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "GER"
		target = military_access
		value = 1000
	}
}

anti_soviet_pact_collective_action_fight_soviet = {
	enable = {
		GER = { has_idea = anti_soviet_pact }
		is_historical_focus_on = yes
		has_idea = anti_soviet_pact
		NOT = { has_government = communism }
		GER = { has_war_with = SOV }
		OR = {
			is_faction_leader = yes
			is_in_faction = no 
		}
		OR = {
			has_war = no
			has_war_with = SOV
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = antagonize
		id = SOV
		value = 2500
	}
	ai_strategy = {
		type = declare_war
		id = SOV
		value = 500
	}
	ai_strategy = {
		type = prepare_for_war
		id = SOV
		value = 200
	}

}

the_push_into_the_union = {
	enable = {
		GER = { has_idea = anti_soviet_pact }
		OR = {
			has_equipment = { infantry_equipment > 15000 }
			has_equipment = { medium_tank_chassis > 1000 }
		}
		set_temp_variable = { days = global.num_days }
		modulo_temp_variable = { days = 60 }
		check_variable = { days < 30 }
		
		OR = {
			AND = {
				is_major = no
				has_manpower > 50000
			}
			AND = {
				is_major = yes
				has_manpower > 500000
			}
		}
		has_war_with = SOV
		has_idea = anti_soviet_pact
		OR = {
			SOV = { surrender_progress > 0.3 }
			date < 1941.1.1
		}
		has_equipment = { infantry_equipment > 10000 }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.3

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

}
invading_britain_is_fun = {
	enable = {
		has_war_with = ENG
		OR = {
			ENG = { is_ai = no }
			SOV = { is_ai = no }
			USA = { is_ai = no }
			is_historical_focus_on = no
		}
		maybe_england_is_eligible_target = yes
		NOT = { 
			any_country = {
				is_neighbor_of = ROOT
				has_war_with = ROOT
				is_major = yes
				surrender_progress < 0.5
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_invasion_focus
		value = 10
	}

	ai_strategy = {
		type = invasion_unit_request
		area = UK
		value = 24
	}
	
	ai_strategy = {
		type = invade
		id = "ENG"
		value = 500 #counterbalances...
	}
	
	ai_strategy = {
		type = naval_invasion_supremacy_weight
		value = 40
	}

	ai_strategy = {
		type = strike_force_home_base
		id = 16 # north sea
	}
}
fascist_has_wargoal = {
	allowed = {
		original_tag = GER
	}
	enable = {
		is_historical_focus_on = yes
		has_government = fascism
		NOT = { has_completed_focus = GER_around_maginot }
	}

	abort = {
		OR = {
			is_historical_focus_on = no
			date > 1940.5.1
			has_completed_focus = GER_around_maginot
			has_war_with = HOL
			has_war_with = BEL
			has_war_with = LUX
		}
	}

	ai_strategy = {
		type = declare_war
		id = "LUX"
		value = -99999
	}

	ai_strategy = {
		type = declare_war
		id = "BEL"
		value = -99999
	}

	ai_strategy = {
		type = declare_war
		id = "HOL"
		value = -99999
	}

	ai_strategy = {
		type = conquer
		id = "LUX"
		value = -99999
	}

	ai_strategy = {
		type = conquer
		id = "BEL"
		value = -99999
	}

	ai_strategy = {
		type = conquer
		id = "HOL"
		value = -99999
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "BEL"
		target = declare_war
		value = -50000
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "LUX"
		target = declare_war
		value = -50000
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "HOL"
		target = declare_war
		value = -50000
	}
}


netherland_die_first = {
	allowed = {
		original_tag = GER
	}
	enable = {
		country_exists = HOL
		is_historical_focus_on = yes
		OR = {
			focus_progress = {
				focus = GER_around_maginot
				progress > 0
			}
			has_completed_focus = GER_around_maginot
		}
	}

	abort = {
		OR = {
			date > 1940.5.1
			HOL = { surrender_progress > 0.8 }
			HOL = { has_capitulated = yes }
			AND = {
				BEL = { is_in_faction = yes }
				LUX = { is_in_faction = yes }
			}
			is_in_faction_with = HOL
			surrender_progress > 0.05
		}
	}

	ai_strategy = {
		type = front_armor_score
		id = "HOL"
		value = 200
	}

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

	ai_strategy = {
		type = declare_war
		id = "LUX"
		value = -99999
	}

	ai_strategy = {
		type = declare_war
		id = "BEL"
		value = -99999
	}

	ai_strategy = {
		type = declare_war
		id = "HOL"
		value = 9999
	}

	ai_strategy = {
		type = conquer
		id = "LUX"
		value = -99999
	}

	ai_strategy = {
		type = conquer
		id = "BEL"
		value = -99999
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "BEL"
		target = declare_war
		value = -50000
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "LUX"
		target = declare_war
		value = -50000
	}

	ai_strategy = {
		type = front_unit_request

		state = 28

		value = -25 
	}

	ai_strategy = {
		type = front_control

		state = 28 

		ratio = 0.3

		priority = 500
		ordertype = front
		execution_type = careful
		execute_order = no
	}
}
belgium_die_next = {
	allowed = {
		original_tag = GER
	}
	enable = {
		is_historical_focus_on = yes
		country_exists = BEL
		has_war_with = HOL
		OR = {
			focus_progress = {
				focus = GER_around_maginot
				progress > 0
			}
			has_completed_focus = GER_around_maginot
		}
	}

	abort = {
		OR = {
			date > 1940.8.1
			BEL = { surrender_progress > 0.8 }
			BEL = { has_capitulated = yes }
			LUX = { is_in_faction = yes }
			is_in_faction_with = BEL
			surrender_progress > 0.05
		}
	}

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

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

	ai_strategy = {
		type = declare_war
		id = "LUX"
		value = -99999
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "LUX"
		target = declare_war
		value = -50000
	}

	ai_strategy = {
		type = front_unit_request

		state = 28

		value = -25 # lets put more units, should be safe
	}

	ai_strategy = {
		type = front_control

		state = 28 

		ratio = 0.3

		priority = 500
		ordertype = front
		execution_type = careful
		execute_order = no
	}
}
is_it_time_for_war_benelux = {
	allowed = {
		original_tag = GER
	}
	enable = {
		is_historical_focus_on = yes
		has_government = fascism
		is_faction_leader = yes
		has_global_flag = vanilla_history
		NOT = { has_completed_focus = GER_around_maginot }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = declare_war
		id = "LUX"
		value = -9999
	}

	ai_strategy = {
		type = declare_war
		id = "BEL"
		value = -9999
	}

	ai_strategy = {
		type = declare_war
		id = "HOL"
		value = -9999
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "BEL"
		target = declare_war
		value = -50000
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "LUX"
		target = declare_war
		value = -50000
	}

	ai_strategy = {
		type = conquer
		id = "LUX"
		value = -9999
	}

	ai_strategy = {
		type = conquer
		id = "BEL"
		value = -9999
	}

	ai_strategy = {
		type = conquer
		id = "HOL"
		value = -9999
	}
}
do_not_declare_war_until_it_is_clear = {
	allowed = {
		original_tag = GER
	}
	reversed = yes
	enable = {
		is_historical_focus_on = no
		date < 1939.1.1
		has_army_size = { size < 850000 }
		has_government = fascism
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = ignore
		id = "GER"
		value = 9999
	}

	ai_strategy = {
		type = ignore_claim
		id = "GER"
		value = 9999
	}

	ai_strategy = {
		type = declare_war
		id = "GER"
		value = -9999
	}
}
is_it_time_for_war_polen = {
	allowed = {
		original_tag = GER
	}
	enable = {
		is_historical_focus_on = yes
		has_completed_focus = GER_danzig_or_war
		AND = {
			date < 1939.9.1
			has_global_flag = {
				flag = danzig_or_war_flag
				days < 16 
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = declare_war
		id = "POL"
		value = -9999
	}
}

is_it_time_for_war_soviet = {
	allowed = {
		original_tag = GER
	}
	enable = {
		is_historical_focus_on = yes
		has_completed_focus = GER_ussr_war_goal
		AND = {
			date < 1941.6.22
			has_global_flag = {
				flag = operation_barbarossa
				days < 180 
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = declare_war
		id = "SOV"
		value = -9999
	}
}

axis_gun3_is_bad = {
	enable = {
		OR = {
			tag = GER
			is_in_faction_with = GER
		}
		is_historical_focus_on = yes
		GER = { has_equipment = { infantry_equipment < 80000 } }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = production_upgrade_desire_offset
		id = infantry_equipment_3
		value = -100
	}

	ai_strategy = {
		type = production_upgrade_desire_offset
		id = infantry_equipment_2
		value = 100
	}
}

GER_FRA_is_always_enemy = {
	allowed = {
		is_axis_ai = yes
	}
	enable = {
		is_in_faction_with = GER
		is_historical_focus_on = yes
		SOV = { has_idea = SOV_molotov_ribbentrop_pact }
		NOT = {
			OR = {
				focus_progress = {
					focus = GER_around_maginot
					progress > 0
				}
				has_completed_focus = GER_around_maginot
			}
		}
	}

	abort_when_not_enabled = yes

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

	ai_strategy = {
		type = front_unit_request
		tag = FRA
		value = 5
	}
}


GER_dont_try_to_blitz = {
	allowed = {
		is_axis_ai = yes
	}
	enable = {
		is_historical_focus_on = yes
		has_war_with = FRA
		FRA = { has_capitulated = yes }
	}
	abort = {
		OR = {
			AND = {
				has_war_with = SOV
				has_global_flag = d_day_happened
			}
			SOV = { has_country_flag = LSM_eligibility_nation }
			ENG = { surrender_progress > 0 }
		}
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 1 #Strategic Region ID - Southern England
		value = -50000 #value of stocked main front in active combat is usually around 35,000
	}

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

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

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

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

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

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

GER_balkan_focus_YUG = {
	allowed = {
		original_tag = GER
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		is_historical_focus_on = yes
		has_war_with = YUG
		YUG = { has_capitulated = no }
		FRA = { has_capitulated = yes }
	}
	abort = {
		OR = {
			has_war_with = SOV
			SOV = { has_country_flag = LSM_eligibility_nation }
		}
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 24 
		value = 35000 #value of stocked main front in active combat is usually around 35,000
	}
}

ENG_balkan_dont_focus_YUG = {
	allowed = {
		original_tag = ENG
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		is_historical_focus_on = yes
		has_war_with = GER
		YUG = { has_capitulated = yes }
		YUG = { surrender_progress > 0.90 }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = strategic_air_importance
		id = 24 
		value = -35000 #value of stocked main front in active combat is usually around 35,000
	}
}


GER_balkan_focus_GRE = {
	allowed = {
		original_tag = GER
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		is_historical_focus_on = yes
		has_war_with = GRE
		GRE = { has_capitulated = no }
		date < 1941.4.4
		FRA = { has_capitulated = yes }
	}
	abort = {
		OR = {
			has_war_with = SOV
			SOV = { has_country_flag = LSM_eligibility_nation }
		}
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 25 
		value = 35000 #value of stocked main front in active combat is usually around 35,000
	}

	ai_strategy = {
		type = force_defend_ally_borders
		value = 9999
		id = "ITA"
	}
}
BUL_wait_for_historical_date = {
	allowed = {
		original_tag = BUL
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		is_historical_focus_on = yes
		country_exists = GER
		is_in_faction_with = GER
	}
	abort = {
		OR = {
			NOT = { country_exists = GER }
			date > 1941.04.01
			GER = { has_war_with = YUG }
			GER = { has_war_with = SOV }
			GER = { has_war_with = GRE }
			GER = { surrender_progress > 0 }
			ITA = { surrender_progress > 0.1 }
			any_country = {
				is_in_faction_with = ROOT
				has_war_with = SOV
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = GER
		target = join_allies
		value = -99999
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = GER
		target = call_allies
		value = -99999
	}
}


ROM_wait_for_historical_date = {
	allowed = {
		original_tag = ROM
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		is_historical_focus_on = yes
		country_exists = GER
		is_in_faction_with = GER
	}
	abort = {
		OR = {
			NOT = { country_exists = GER }
			date > 1940.11.23
			GER = { surrender_progress > 0 }
			ITA = { surrender_progress > 0.1 }
			any_country = {
				is_in_faction_with = ROOT
				has_war_with = SOV
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = GER
		target = join_allies
		value = -99999
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = GER
		target = call_allies
		value = -99999
	}
}


HUN_wait_for_historical_date = {
	allowed = {
		original_tag = HUN
		has_dlc = "Battle for the Bosporus"
	}
	enable = {
		is_historical_focus_on = yes
		country_exists = GER
		is_in_faction_with = GER
	}
	abort = {
		OR = {
			NOT = { country_exists = GER }
			date > 1940.11.20
			GER = { has_war_with = SOV }
			GER = { surrender_progress > 0 }
			ITA = { surrender_progress > 0.1 }
			any_country = {
				is_in_faction_with = ROOT
				has_war_with = SOV
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = GER
		target = join_allies
		value = -99999
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = GER
		target = call_allies
		value = -99999
	}
}


axis_do_not_pressure_BUL = {
	allowed = {
		is_axis_ai = yes
	}
	enable = {
		is_in_faction_with = BUL
		has_war = yes	
		is_historical_focus_on = yes
	}
	abort = {
		OR = {
			NOT = { country_exists = GER }
			date > 1941.04.01
			GER = { has_war_with = YUG }
			BUL = { has_war = yes }
			has_war_with = SOV
			GER = { has_war_with = GRE }
			GER = { surrender_progress > 0 }
			ITA = { surrender_progress > 0.1 }
			any_country = {
				is_in_faction_with = ROOT
				has_war_with = SOV
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = BUL
		target = call_allies
		value = -99999
	}
}

axis_do_not_pressure_BUL_2 = {
	allowed = {
		is_axis_ai = yes
	}
	enable = {
		is_in_faction_with = BUL
		has_war = yes	
		is_historical_focus_on = yes
	}
	abort = {
		OR = {
			NOT = { country_exists = GER }
			date > 1941.04.01
			GER = { has_war_with = YUG }
			BUL = { has_war = yes }
			has_war_with = SOV
			GER = { has_war_with = GRE }
			GER = { surrender_progress > 0 }
			ITA = { surrender_progress > 0.1 }
			any_country = {
				is_in_faction_with = ROOT
				has_war_with = SOV
			}
		}
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = BUL
		target = join_allies
		value = -99999
	}
}


axis_do_not_pressure_HUN = {
	allowed = {
		is_axis_ai = yes
	}
	enable = {
		is_in_faction_with = HUN
		has_war = yes	
		is_historical_focus_on = yes
	}
	abort = {
		OR = {
			NOT = { country_exists = GER }
			date > 1940.11.20
			HUN = { has_war = yes }
			has_war_with = SOV
			GER = { surrender_progress > 0 }
			ITA = { surrender_progress > 0.1 }
			any_country = {
				is_in_faction_with = ROOT
				has_war_with = SOV
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = HUN
		target = call_allies
		value = -99999
	}
}

axis_do_not_pressure_HUN_2 = {
	allowed = {
		is_axis_ai = yes
	}
	enable = {
		is_in_faction_with = HUN
		has_war = yes	
		is_historical_focus_on = yes
	}
	abort = {
		OR = {
			NOT = { country_exists = GER }
			HUN = { has_war = yes }
			date > 1940.11.20
			has_war_with = SOV
			GER = { surrender_progress > 0 }
			ITA = { surrender_progress > 0.1 }
			any_country = {
				is_in_faction_with = ROOT
				has_war_with = SOV
			}
		}
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = HUN
		target = join_allies
		value = -99999
	}
}


axis_do_not_pressure_ROM = {
	allowed = {
		is_axis_ai = yes
	}
	enable = {
		is_in_faction_with = ROM
		has_war = yes	
		is_historical_focus_on = yes
	}
	abort = {
		OR = {
			NOT = { country_exists = GER }
			date > 1940.11.23
			ROM = { has_war = yes }
			has_war_with = SOV
			GER = { surrender_progress > 0 }
			ITA = { surrender_progress > 0.1 }
			any_country = {
				is_in_faction_with = ROOT
				has_war_with = SOV
			}
		}
	}

	ai_strategy = {
		type = diplo_action_desire
		id = ROM
		target = call_allies
		value = -99999
	}
}

axis_do_not_pressure_ROM_2 = {
	allowed = {
		is_axis_ai = yes
	}
	enable = {
		is_in_faction_with = ROM
		has_war = yes	
		is_historical_focus_on = yes
	}
	abort = {
		OR = {
			NOT = { country_exists = GER }
			ROM = { has_war = yes }
			date > 1940.11.23
			has_war_with = SOV
			GER = { surrender_progress > 0 }
			ITA = { surrender_progress > 0.1 }
			any_country = {
				is_in_faction_with = ROOT
				has_war_with = SOV
			}
		}
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = ROM
		target = join_allies
		value = -99999
	}
}

hungarian_germany_friendship = {
	allowed = { original_tag = GER }

	enable = {
		NOT = { has_global_flag = vanilla_history }
		HUN = { has_government = fascism }
	}
	abort = {
		OR = {
			has_global_flag = vanilla_history
			is_in_faction_with = HUN
		}
	}
	ai_strategy = {
		type = alliance
		id = "HUN"
		value = 200
	}
}


hungarian_germany_friendship_2 = {
	allowed = { original_tag = HUN }

	enable = {
		NOT = { has_global_flag = vanilla_history }
		HUN = { has_government = fascism }
	}
	abort = {
		OR = {
			has_global_flag = vanilla_history
			is_in_faction_with = GER
		}
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = 200
	}
}
bulgarian_balkan_friend_GER = {
	allowed = { original_tag = GER }

	enable = {
		NOT = { has_global_flag = vanilla_history }
		BUL = { has_government = fascism }
	}
	abort = {
		OR = {
			has_global_flag = vanilla_history
			is_in_faction_with = BUL
		}
	}
	ai_strategy = {
		type = alliance
		id = "BUL"
		value = 200
	}
}


bulgarian_balkan_friend_BUL = {
	allowed = { original_tag = BUL }

	enable = {
		NOT = { has_global_flag = vanilla_history }
		BUL = { has_government = fascism }
	}
	abort = {
		OR = {
			has_global_flag = vanilla_history
			is_in_faction_with = GER
		}
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = 200
	}
}
romanian_balkan_friend_GER = {
	allowed = { original_tag = GER }

	enable = {	
		NOT = { has_global_flag = vanilla_history }
		BUL = { has_government = fascism }
	}
	abort = {
		OR = {
			has_global_flag = vanilla_history
			is_in_faction_with = ROM
		}
	}
	ai_strategy = {
		type = alliance
		id = "ROM"
		value = 200
	}
}


romanian_balkan_friend_ROM = {
	allowed = { original_tag = ROM }

	enable = {	
		NOT = { has_global_flag = vanilla_history }
		ROM = { has_government = fascism }
	}
	abort = {
		OR = {
			has_global_flag = vanilla_history
			is_in_faction_with = GER
		}
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = 200
	}
}
GER_do_not_train_too_much = {
	allowed = { original_tag = GER }
	enable = { 
		has_government = fascism
		has_war = yes
		NOT = { has_war_with = SOV }
		date > 1941.1.1
		has_global_flag = FRA_already_surrendered
		OR = {
			has_equipment = { infantry_equipment < 30000 } 
			has_equipment = { medium_tank_chassis < 500 } 
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = ai_wanted_divisions_factor
		value = -30 #override dictator trait
	}
}

GER_barbarossa_gun_prep = {
	allowed = {
		original_tag = GER
	}
	enable = { 
		has_war = yes
		NOT = { has_war_with = SOV }
		has_global_flag = FRA_already_surrendered
		has_equipment = { infantry_equipment < 60000 } 
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_production_factor
		id = infantry
		value = 160
	}
}
GER_supermarine = {
	allowed = { 
		original_tag = GER
	}
	enable = { 
		OR = {	
			has_country_flag = mobile_warfare
			has_tech = amphibious_mechanized_infantry
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = role_ratio
		id = marines
		value = 20
	}
	ai_strategy = {
		type = template_prio
		id = marines
		value = 100
	}
}

GER_unit_production = {
	allowed = {
		original_tag = GER
	}
	enable = {
		always = yes
	}
	abort = {
		always = no
	}

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

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

	ai_strategy = {
		type = role_ratio
		id = cavalry
		value = -100
	}

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

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

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

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

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

	ai_strategy = {
		type = unit_ratio
		id = submarine
		value = -50 #because doctrine this = 50
	}

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = naval_bomber
		value = -50
	}

	ai_strategy = {
		type = equipment_production_factor
		id = infantry
		value = 35 #30 to 50
	}

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

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = 5 #20 to 40
	}

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

	ai_strategy = {
		type = equipment_production_factor
		id = support
		value = 25
	}
	ai_strategy = {
		type = equipment_production_min_factories #Build these up over time, don't stall
		id = infantry
		value = 2
	}
	ai_strategy = {
		type = equipment_production_min_factories #Build these up over time, don't stall
		id = anti_air
		value = 2
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = artillery
		value = 1
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = support_equipment
		value = 5
	}

	ai_strategy = { #added to railway gun define (set to 0 by default, increased in default strategies)
		type = railway_gun_divisions_ratio
		value = 1
	}

}
GER_td_prod_mw = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1939.1.1
		has_country_flag = mobile_warfare_flag
	}
	abort = {
		always = no
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = medium_tank_destroyer_chassis
		value = 20
	}
}
GER_armored_production_axis_mass_mob = {
	allowed = {
		original_tag = GER
	}
	enable = { #count trigger does not work here
		OR = {
			AND = {
				is_in_faction_with = HUN
				is_in_faction_with = ROM
			}
			AND = {
				is_in_faction_with = BUL
				is_in_faction_with = ITA
			}
			AND = {
				is_in_faction_with = BUL
				is_in_faction_with = ROM
			}
			AND = {
				is_in_faction_with = BUL
				is_in_faction_with = HUN
			}
			AND = {
				is_in_faction_with = ROM
				is_in_faction_with = ITA
			}
			AND = {
				is_in_faction_with = HUN
				is_in_faction_with = ITA
			}
		}
		NOT = { has_country_flag = spacemarine }
		NOT = { has_country_flag = mech_god }
		NOT = { has_country_flag = mass_mob_flag }
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio #even more tanks
		id = armor
		value = 10
	}

	ai_strategy = {
		type = equipment_production_factor
		id = infantry
		value = -25
	}

	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = -40
	}

	ai_strategy = {
		type = equipment_production_factor
		id = anti_air
		value = -5
	}

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = support
		value = 45
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = support
		value = 7
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = heavy_tank_destroyer_chassis
		value = 20
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = medium_tank_flame_chassis
		value = 5
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = support_equipment
		value = 12
	}

	ai_strategy = {
		type = equipment_production_factor
		id = motorized
		value = 3
	}

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

GER_armored_production_axis_mass_mob_2 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1940.3.1
		NOT = { has_country_flag = spacemarine }
		NOT = { has_country_flag = mech_god }
		NOT = { has_country_flag = mass_mob_flag }
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio #even more tanks
		id = armor
		value = 10
	}

	ai_strategy = {
		type = equipment_production_factor
		id = infantry
		value = -25
	}

	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = -30
	}

	ai_strategy = {
		type = equipment_production_factor
		id = anti_air
		value = -5
	}

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = support
		value = 15
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = support
		value = 7
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = support_equipment
		value = 10
	}

	ai_strategy = {
		type = equipment_production_factor
		id = motorized
		value = 2
	}

	ai_strategy = {
		type = equipment_production_factor
		id = mechanized
		value = 13
	}
}

GER_armored_production_prebarb = {
	allowed = {
		original_tag = GER
	}
	enable = {
		FRA = { has_capitulated = yes }
		OR = {
			is_in_faction_with = ITA
			ITA = { has_capitulated = yes }
		}
		NOT = { has_country_flag = spacemarine }
		NOT = { has_country_flag = mass_mob_flag }
		NOT = { has_country_flag = mech_god }
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio #even more tanks
		id = armor
		value = 10
	}

	ai_strategy = {
		type = equipment_production_factor
		id = infantry
		value = -20
	}

	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = -30
	}

	ai_strategy = {
		type = equipment_production_factor
		id = anti_air
		value = -5
	}

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = support
		value = 15
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = support
		value = 10
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = support_equipment
		value = 10
	}

	ai_strategy = {
		type = equipment_production_factor
		id = motorized
		value = 2
	}

	ai_strategy = {
		type = equipment_production_factor
		id = mechanized
		value = 23
	}
}

GER_armored_production_axis_spacemarine = {
	allowed = {
		original_tag = GER
	}
	enable = {
		OR = {
			AND = {
				has_country_flag = spacemarine
				NOT = { has_country_flag = mech_god }
				has_army_manpower = { size < 1200000 }
				FRA = { has_capitulated = no }
			}
			has_country_flag = mass_mob_flag
		}
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = 100
	}
	
	ai_strategy = {
		type = role_ratio 
		id = armor
		value = -25
	}

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = -5
	}

	ai_strategy = {
		type = equipment_production_factor
		id = anti_air
		value = -5
	}

	ai_strategy = {
		type = equipment_production_factor
		id = support
		value = -5
	}

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

	ai_strategy = {
		type = build_army
		id = armor
		value = -25
	}
}

GER_armored_production_axis_spacemarine2 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_country_flag = spacemarine
		NOT = { has_country_flag = mech_god }
		OR = {
			has_army_manpower = { size > 1200000 }
			FRA = { has_capitulated = yes }
		}
	}
	abort_when_not_enabled = yes

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = -5
	}

	ai_strategy = {
		type = equipment_production_factor
		id = anti_air
		value = -5
	}

	ai_strategy = {
		type = equipment_production_factor
		id = support
		value = -5
	}

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

GER_armored_production_axis_mech_god = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_country_flag = mech_god
	}
	abort_when_not_enabled = yes
	
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = 100
	}
	
	ai_strategy = {
		type = role_ratio 
		id = armor
		value = -25
	}

	ai_strategy = {
		type = equipment_production_factor
		id = infantry
		value = -5
	}

	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = -5
	}

	ai_strategy = {
		type = equipment_production_factor
		id = anti_air
		value = -5
	}

	ai_strategy = {
		type = equipment_production_factor
		id = support
		value = -5
	}

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

	ai_strategy = {
		type = build_army
		id = armor
		value = -25
	}
}

GER_halt_light_armor_production_in_transitioning = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_template_majority_unit = medium_armor
		NOT = { has_country_flag = mass_mob_flag }
		NOT = { has_country_flag = mobile_warfare }
		OR = {
			has_equipment = { light_tank_chassis > 600 }
			date > 1938.8.1
		}
	}
	abort = {
		always = no  # once we start we never go back to light armor
	}

	ai_strategy = {
		type = equipment_variant_production_factor
		id = light_tank_chassis
		value = -100
	}
	
	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = -20 #downprio this for some more tanks
	}
	
}

GER_stockpile_less_early_game = {
	allowed = {
		original_tag = GER
	}

	enable = {
		date < 1940.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_stockpile_surplus_ratio
		value = -20 # reduce while we build up in case of CZE or Austria issues
	}
}

GER_dont_waste_xp_until_medium_armor = {
	allowed = {
		original_tag = GER
	}
	enable = {
		always = yes
	}
	abort = {
		has_template_majority_unit = medium_armor
	}

	ai_strategy = {
		type = template_prio
		id = paratrooper
		value = -100
	}
}


GER_template_design = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date < 1940.1.1
	}
	abort = {
		date > 1940.1.1
	}

	ai_strategy = {
		type = template_prio
		id = infantry
		value = 20
	}

	ai_strategy = {
		type = template_prio
		id = artillery
		value = 20
	}

	ai_strategy = {
		type = template_prio
		id = motorized
		value = -50
	}

	ai_strategy = {
		type = template_prio
		id = cavalry
		value = -100
	}

	ai_strategy = {
		type = template_prio
		id = light_armor
		value = 30
	}

	ai_strategy = {
		type = template_prio
		id = heavy_armor
		value = -50
	}

	ai_strategy = {
		type = template_prio
		id = paratroopers
		value = -50
	}
}

war_with_poland = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_demand_memel
		country_exists = POL
	}
	abort = {
		NOT = { country_exists = POL }
	}

	ai_strategy = {
		type = antagonize
		id = "POL"
		value = 1000
	}

	ai_strategy = {

	 	type = front_unit_request

		tag = FRA

		value = 12
	}
}

we_stab_poland_in_the_ass = {
	allowed = {
		original_tag = GER
	}
	enable = {
			tag = GER
			has_government = fascism
			NOT = { POL = { is_in_faction_with = GER } }
			OR = {
				POL = { is_faction_leader = yes } 
				POL = { is_in_faction = no }
			}
			NOT = { has_war_with = POL }
			POL = { is_ai = no }
			POL = { has_war_with = SOV }
			85 = { owner = { tag = GER } }
			NOT = {
				any_country = {
					is_neighbor_of = GER
					is_major = yes
					has_war_with = GER
					num_of_military_factories > 24
					has_capitulated = no
				}
			}
	}

	abort = {
		OR = {
			NOT = { country_exists = POL }
			has_war_with = POL
			is_in_faction_with = POL
		}
	}

	ai_strategy = {
		type = conquer
		id = "POL"
		value = 9999
	}

	ai_strategy = {
		type = declare_war
		id = "POL"
		value = 9999
	}
}

danzig_of_war_preparation = {
	allowed = {
		original_tag = GER
	}
	enable = {
		focus_progress = {
			focus = GER_danzig_or_war
			progress > 0.01
		}
		NOT = {
			has_completed_focus = GER_danzig_or_war
			owns_state = 85
		}
		country_exists = POL
	}

	abort = {
		OR = {
			NOT = { country_exists = POL }

			AND = {
				has_completed_focus = GER_danzig_or_war
				GER = { has_war_with = POL }
			}

			owns_state = 85
		}
	}

	ai_strategy = {
		type = conquer
		id = "POL"
		value = 100
	}
}

dont_die_in_mountains = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date < 1942.5.1
		country_exists = SWI
		is_historical_focus_on = yes
	}
	abort = {
		OR = {
			AND = {
				NOT = { country_exists = FRA }
				date > 1942.5.1
			}
			SWI = {	
				NOt = {has_idea = SWI_swiss_neutrality}
			}
		}
	}

	ai_strategy = {
		type = ignore
		id = "SWI"
		value = 1000
	}
}

war_with_soviets = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_ussr_war_goal
		country_exists = SOV
	}
	abort = {
		NOT = { country_exists = SOV }
	}


	ai_strategy = {
		type = antagonize
		id = "SOU" # Yes, SOU is deliberate
		value = 200
	}
}

soviet_ally = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_soviet_ally
		country_exists = SOV
	}
	abort = {
		NOT = { country_exists = SOV }
	}

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


italy_ally = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_italy_ally
		country_exists = ITA
	}
	abort = {
		NOT = { country_exists = ITA }
	}

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

iron_pact_italy = {
	allowed = {
		original_tag = GER
	}
	enable = {
		ITA = {
			has_completed_focus = ITA_pact_of_steel
			exists = yes
		}
	}
	abort = {
		NOT = { country_exists = ITA }
	}

	ai_strategy = {
		type = befriend
		id = "ITA"
		value = 100
	}
	ai_strategy = {
		type = alliance
		id = "ITA"
		value = 100
	}
}

dont_join_gie_wars_early = {
	allowed = {
		original_tag = GER
	}
	enable = {
		is_in_faction_with = ITA
		ITA = {
			all_enemy_country = {
				is_government_in_exile = yes
			}
		}
	}
	abort = {
		OR = {
			GER = {
				any_enemy_country = {
					is_government_in_exile = no
				}
			}
			ITA = {
				any_enemy_country = {
					is_government_in_exile = no
				}
			}
		}
	}

	ai_strategy = {
	    type = diplo_action_desire
	    id = ITA
	    value = -9999
	    target = join_allies
	}

	ai_strategy = {
	    type = diplo_action_acceptance
	    id = ITA
	    value = -9999
	    target = call_allies
	}
}

japan_ally = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_japan_friend
		country_exists = JAP
	}
	abort = {
		NOT = { country_exists = JAP }
	}

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

china_ally = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_china_friend
		country_exists = CHI
	}
	abort = {
		NOT = { country_exists = CHI }
	}

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

poland_ally = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_poland_friend
		country_exists = POL
	}
	abort = {
		NOT = { country_exists = POL }
	}
	ai_strategy = {
		type = alliance
		id = "POL"
		value = 9999
	}
}

poland_allyd = {
	allowed = {
		original_tag = POL
	}
	enable = {
		GER = { has_completed_focus = GER_poland_friend }
		country_exists = GER
	}
	abort = {
		NOT = { country_exists = GER }
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = 9999
	}
}
turkey_ally = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_turkey_friend
		country_exists = TUR
	}
	abort = {
		NOT = { country_exists = TUR }
	}

	ai_strategy = {
		type = befriend
		id = "TUR"
		value = 100
	}
	ai_strategy = {
		type = alliance
		id = "TUR"
		value = 100
	}
}

dislike_poland = {
	allowed = {
		original_tag = GER
	}
	enable = {
		NOT = { has_war_together_with = POL }
		OR = {
			AND = {
				NOT = { POL = { has_government = fascism } }
				GER = { has_government = fascism }
			}
			AND = {
				POL = { has_government = fascism }
				NOT = { GER = { has_government = fascism } }
			}
			POL = { 
				is_in_faction = yes 
				NOT = { is_in_faction_with = GER }
			}
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = alliance
		id = "POL"
		value = -2000
	}
	ai_strategy = {
		type = befriend
		id = "POL"
		value = -2000
	}
}
dislike_poland_POL = {
	allowed = {
		original_tag = POL
	}
	enable = {
		NOT = { has_war_together_with = GER }
		OR = {
			AND = {
				NOT = { POL = { has_government = fascism } }
				GER = { has_government = fascism }
			}
			AND = {
				POL = { has_government = fascism }
				NOT = { GER = { has_government = fascism } }
			}
			POL = { 
				is_in_faction = yes 
				NOT = { is_in_faction_with = GER }
			}
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = alliance
		id = "GER"
		value = -2000
	}
	ai_strategy = {
		type = befriend
		id = "GER"
		value = -2000
	}
	ai_strategy = {
		type = declare_war
		id = "GER"
		value = 200
	}
}

spain_ally = {
	allowed = {
		NOT = { has_dlc = "La Resistance" }
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_nationalist_spain_ally
		country_exists = SPR
		SPR = { has_government = fascism } # TODO Find way to detect dynamic revolter tag
	}
	abort = {
		NOT = { country_exists = SPR }
	}

	ai_strategy = {
		type = befriend
		id = "SPR"
		value = 100
	}
	ai_strategy = {
		type = alliance
		id = "SPR"
		value = 100
	}
}

spain_ally_resistance = {
	allowed = {
		original_tag = GER
		has_dlc = "La Resistance"
	}
	enable = {
		has_completed_focus = GER_nationalist_spain_ally
		country_exists = SPA
	}
	abort = {
		OR = {
			NOT = { country_exists = SPA }
			SPA = { has_completed_focus = SPA_join_the_allies }
		}
	}

	ai_strategy = {
		type = befriend
		id = "SPA"
		value = 100
	}
	ai_strategy = {
		type = alliance
		id = "SPA"
		value = 100
	}
}

denmark_ally = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_denmark_friend
		country_exists = DEN
	}
	abort = {
		NOT = { country_exists = DEN }
	}

	ai_strategy = {
		type = befriend
		id = "DEN"
		value = 100
	}
	ai_strategy = {
		type = alliance
		id = "DEN"
		value = 100
	}
}

sweden_ally = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_sweden_friend
		country_exists = SWE
	}
	abort = {
		NOT = { country_exists = SWE }
	}

	ai_strategy = {
		type = befriend
		id = "SWE"
		value = 100
	}
	ai_strategy = {
		type = alliance
		id = "SWE"
		value = 100
	}
}

dutch_ally = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_dutch_friend
		country_exists = HOL
	}
	abort = {
		NOT = { country_exists = HOL }
	}

	ai_strategy = {
		type = befriend
		id = "HOL"
		value = 100
	}
	ai_strategy = {
		type = alliance
		id = "HOL"
		value = 100
	}
}

norway_ally = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_norway_friend
		country_exists = NOR
	}
	abort = {
		NOT = { country_exists = NOR }
	}

	ai_strategy = {
		type = befriend
		id = "NOR"
		value = 100
	}
	ai_strategy = {
		type = alliance
		id = "NOR"
		value = 100
	}
}

anschluss_rejected = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_completed_focus = GER_anschluss
		country_exists = AUS
	}
	abort = {
		NOT = {
			country_exists = AUS
		}
	}

	ai_strategy = {
		type = antagonize
		id = "AUS"
		value = 300
	}
}

CZE_is_idiot = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_global_flag = CZE_refused_sudetenland
		country_exists = CZE
	}
	abort = {
		NOT = {
			country_exists = CZE
		}
	}

	ai_strategy = {
		type = antagonize
		id = "CZE"
		value = 300
	}
}

play_nice_with_ribbentrop_pact = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_global_flag = sov_yes_pact
	}
	abort = {
		OR ={
			GER = { has_war_with = SOV }
			date > 1941.5.1
			AND = {
				LIT = { is_in_faction_with = SOV }
				LAT = { is_in_faction_with = SOV }
				EST = { is_in_faction_with = SOV }
			}
		}
	}

	# leave britney alone!
	ai_strategy = {
		type = ignore
		id = "LIT"
		value = 100
	}
	ai_strategy = {
		type = ignore
		id = "LAT"
		value = 100
	}
	ai_strategy = {
		type = ignore
		id = "EST"
		value = 100
	}
}

tfv_protect_fascist_south_africa = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_country_flag = saf_fascist_uprising # Set from the national focus
	}
	abort = {
		surrender_progress > 0.8
		SAF = { has_civil_war = no }
	}

	ai_strategy = {
		type = protect
		id = "SAF"
		value = 200
	}
	ai_strategy = {
		type = send_volunteers_desire
		id = "SAF"
		value = 200
	}
	ai_strategy = {
		type = support
		id = "SAF"
		value = 200
	}
	ai_strategy = {
		type = alliance
		id = "SAF"
		value = 200
	}
}

less_naval_focused_nation = {
	allowed = {
		original_tag = GER
		not = {
			has_dlc = "Man the Guns"
		}
	}
	enable = {
		date > "1936.1.1" #Don't Germany, just dont
	}
	abort = {
		date > "1943.1.1" #Don't Germany, just dont, if you haven't already won
	}

	ai_strategy = {
		type = unit_ratio
		id = capital_ship
		value = -3
	}

	ai_strategy = {
		type = unit_ratio
		id = submarine
		value = -3
	}

	ai_strategy = {
		type = unit_ratio
		id = screen_ship
		value = -3
	}

	ai_strategy = {
		type = unit_ratio
		id = convoy
		value = -3
	}
}

GER_naval_role_ratios_historical = {
	allowed = {
		original_tag = GER
		has_dlc = "Man the Guns"
	}
	enable = {
		not = { GER_naval_interest_trigger = yes }
	}
	abort_when_not_enabled = yes

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

	ai_strategy = {
		type = role_ratio
		id = naval_capital_bc
		value = -100
	}

	ai_strategy = {
		type = role_ratio
		id = naval_carrier
		value = -50
	}

	ai_strategy = {
		type = role_ratio
		id = naval_submarine
		value = 200
	}
	ai_strategy = {
		type = role_ratio
		id = submarine
		value = 200
	}

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

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

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

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

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

GER_naval_role_ratios_ahistorical = {
	allowed = {
		original_tag = GER
		has_dlc = "Man the Guns"
	}
	enable = {
		GER_naval_interest_trigger = yes
	}
	abort_when_not_enabled = yes

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

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

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

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

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

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

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

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

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

GER_naval_role_ratios_maximum_kaiser = {
	allowed = {
		original_tag = GER
		has_dlc = "Man the Guns"
	}
	enable = {
		has_completed_focus = GER_rebuild_the_high_seas_fleet
	}
	abort_when_not_enabled = yes

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

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

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

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

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

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

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

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

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

GER_area_priority = {
	allowed = {
		original_tag = GER
	}
	enable = {
		always = yes
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = area_priority
		id = europe
		value = 110 #more focus here
	}

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

	ai_strategy = {
		type = area_priority
		id = north_america
		value = 90
	}

	ai_strategy = {
		type = area_priority
		id = south_america
		value = 75
	}

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

	ai_strategy = {
		type = area_priority
		id = middle_east
		value = 50
	}
	ai_strategy = {
		type = area_priority
		id = suez
		value = 30
	}

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

	ai_strategy = {
		type = area_priority
		id = pacific
		value = -120 #less focus here
	}

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

invading_france_is_pointless_because_we_go_through_benelux_soon = {
	allowed = {
		original_tag = GER
	}
	enable = {
		if = {
			limit = { NOT = { has_dlc = "Man the Guns" } }
			NOT = { has_tech = landing_craft }
		}
		else = {
			NOT = { has_tech = mtg_landing_craft }
		}
		date < 1940.1.1
	}
	abort = {
		OR = {
			has_tech = landing_craft
			has_tech = mtg_landing_craft
			date > 1940.1.1
		}
	}

	ai_strategy = {
		type = invade
		id = "FRA"
		value = -2000 # that low means not going for islands either
	}

	# danzig corridor is too small to be worth opening extra invasion front
	ai_strategy = {
		type = invade
		id = "POL"
		value = -500
	}
}

worry_about_barbarossa_before_africa_and_greece = {

	abort_when_not_enabled = yes

	enable = {
		is_in_faction_with = GER 
		NOT = { original_tag = ITA }
		NOT = { original_tag = BUL }
		capital_scope = { is_on_continent = europe } 
		country_exists = SOV
		NOT = {	is_in_faction_with = SOV }
		GER = {
			OR = {
				has_war_with = SOV
				focus_progress = {
					focus = GER_ussr_war_goal
					progress > 0
				}
				has_completed_focus = GER_ussr_war_goal
			}
		}
		has_war_with = ENG
		FRA = { has_capitulated = yes }
		is_historical_focus_on = yes
		219 = { owner = { tag = SOV } }
		ITA = { surrender_progress < 0.2 }
	}

	ai_strategy = {
	 	type = front_unit_request
		tag = SOV
		value = 30
	}

	ai_strategy = {
		type = prepare_for_war
		id = SOV
		value = 50
	}

	ai_strategy = {
	 	type = front_unit_request
		tag = GRE
		value = -50
	}

	ai_strategy = {
		type = area_priority
		id = middle_east
		value = -100
	}
	ai_strategy = {
		type = area_priority
		id = suez
		value = -100
	}

	ai_strategy = {
		type = area_priority
		id = horn_of_africa
		value = -100
	}
	ai_strategy = {
		type = front_unit_request
		area = horn_of_africa
		value = -100
	}
	ai_strategy = {
		type = area_priority
		id = belgian_congo
		value = -100
	}
	ai_strategy = {
		type = invasion_unit_request
		area = belgian_congo
		value = -100
	}
}

worry_about_barbarossa_before_africa_and_greece2 = {

	abort_when_not_enabled = yes

	enable = {
		is_in_faction_with = GER 
		NOT = { original_tag = ITA }
		NOT = { original_tag = BUL }
		has_war_with = SOV
	}

	ai_strategy = {
		type = front_control

		tag = GRE

		ratio = 0.5

		priority = 100
		ordertype = front
		execution_type = careful
		execute_order = no
	}
}

make_sure_poland_is_ganked_before_we_move = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_war_with = POL
		POL = { has_capitulated = no }
		date < 1940.2.1
	}
	abort = {
		OR = {
			POL = {
				has_capitulated = yes
                		days_since_capitulated > 8
			}
			POL = { is_in_faction_with = GER }
			POL = { is_subject_of = GER }
			date > 1940.2.1
		}
	}

	ai_strategy = {
		type = declare_war
		id = "HOL"
		value = -2000
	}
	#ai_strategy = {
	#	type = declare_war
	#	id = "BEL"
	#	value = -2000
	#}
	ai_strategy = {
		type = declare_war
		id = "LUX"
		value = -2000
	}
}

make_sure_poland_is_ganked_before_we_move_bel = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_war_with = POL
		POL = { has_capitulated = no }
		date < 1940.2.1
	}
	abort = {
		OR = {
			POL = {
				has_capitulated = yes
                		days_since_capitulated > 16
			}
			POL = { is_in_faction_with = GER }
			POL = { is_subject_of = GER }
			date > 1940.2.1
		}
	}
	ai_strategy = {
		type = declare_war
		id = "BEL"
		value = -2000
	}
}

GER_want_to_invade_FRA_without_ITA = {
	allowed = {
		original_tag = GER
	}
	enable = {
		is_historical_focus_on = yes
		date < 1940.1.1
		FRA = {
			is_ai = yes
		}
		HOL = {	has_capitulated = no }
		BEL = {	has_capitulated = no }
	}

	abort = {
		OR = {
			date > 1940.1.1
			FRA = {
				is_ai = no
			}
			AND = {
				HOL = {	has_capitulated = yes }
				BEL = {	has_capitulated = yes }
			}
		}
	}

	ai_strategy = {
		type = dont_join_wars_with  # TODO seems bugged
		id = ITA
		target_country = FRA
		value = 500
	}
}

axis_stay_away_from_the_royal_navy = {
	enable = {
		has_war_with = ENG
		date < 1942.1.1

		OR = {
			GER = {
				naval_strength_ratio = {
					tag = ENG
  					ratio < 0.5
  				}
  			}

			# if we manage to get a foothold in UK we must do what we can to exploit it! (checks coastal states)
			divisions_in_state = { state = 127 size < 1 }
			divisions_in_state = { state = 126 size < 1 }
			divisions_in_state = { state = 125 size < 1 }
			divisions_in_state = { state = 129 size < 1 }
			divisions_in_state = { state = 130 size < 1 }
			divisions_in_state = { state = 131 size < 1 }
			divisions_in_state = { state = 123 size < 1 }
			divisions_in_state = { state = 122 size < 1 }
			divisions_in_state = { state = 132 size < 1 }
			divisions_in_state = { state = 121 size < 1 }
			divisions_in_state = { state = 136 size < 1 }
			divisions_in_state = { state = 120 size < 1 }
			divisions_in_state = { state = 133 size < 1 }
			any_state = {
				is_core_of = ENG
				controller = { 
					has_war_with = ENG 
					is_in_faction_with = ROOT
				}
			}
		}
		maybe_england_is_eligible_target = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = naval_avoid_region
		id = 18 #english channel
		value = 600 # avoid doing missions as well
	}
	ai_strategy = {
		type = naval_avoid_region
		id = 16 #around UK
		value = 100
	}
	ai_strategy = {
		type = naval_avoid_region
		id = 43 #around UK
		value = 100
	}
}

dont_take_claims_on_POL_we_got_focus = {
	allowed = {
		original_tag = GER
	}
	enable = {
		country_exists = POL
		has_war = no
		has_completed_focus = GER_demand_memel
	}

	abort = {
		OR = {
			NOT = { country_exists = POL }
			date > 1940.1.1
			has_war = yes
		}
	}

	ai_strategy = {
		type = ignore_claim
		id = "POL"
		value = 1
	}
}

axis_dont_mess_with_volunteers = {
	allowed = {
		OR = {
			original_tag = GER
			original_tag = ITA
		}
	}
	enable = {
		date < 1941.6.1
	}
	abort = {
		date > 1941.6.1
	}

	ai_strategy = {
		type = send_volunteers_desire
		id = JAP
		value = -500
	}

	ai_strategy = {
		type = send_volunteers_desire
		id = CHI
		value = -500 #sorry buds
	}

	ai_strategy = {
		type = send_volunteers_desire
		id = MAN
		value = -500
	}
}

GER_industry_we_are_the_baddies = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1937.8.1
	}
	abort={
		date > 1940.1.1
	}

	ai_strategy = {
		type = added_military_to_civilian_factory_ratio
		value = 50
	}
	ai_strategy = {
		type = air_factory_balance
		value = 30
	}
}

GER_industry_plane_vs_sov_ai = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_war_with = SOV
		SOV = { is_ai = yes }
		OR = {
			is_in_faction_with = FRA
			NOT = { country_exists = FRA }
			FRA = { has_capitulated = yes }
		}
		NOT = {
			any_home_area_neighbor_country = {
				NOT = { tag = SOV }
				has_war_with = ROOT
				num_of_military_factories > 39
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = air_factory_balance
		value = 50
	}
}


GER_industry_we_are_the_baddies_2 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1940.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = added_military_to_civilian_factory_ratio
		value = 20
	}
}

GER_industry_we_are_the_baddies_but_not_yet = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date < 1936.8.1
	}
	abort={
		date > 1937.8.1
	}

	ai_strategy = {
		type = air_factory_balance
		value = 45
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -50 #because doctrine this = 3
	}
}

Axis_care_less_about_making_friends = {

	enable = {
		has_government = fascism
		is_in_faction = yes
		manpower_per_military_factory < 3000
		has_war = yes
	}
	abort = {
		OR = {
			NOT = { has_government = fascism }
			is_in_faction = no
			manpower_per_military_factory > 3000
			has_war = no
		}
	}

	ai_strategy = {
		type = pp_spend_priority
		id = relation
		value = -9999
	}
}

GER_wants_civ = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_government = fascism
		date < 1937.2.15
		is_historical_focus_on = yes
		has_war = no
		NOT = {
			any_country = {
				is_allied_ai = yes
				NOT = { tag = SOV }
				is_ai = no
			}
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = 80
	}
}

GER_wants_civ2 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_government = fascism
		date < 1937.2.15
		is_historical_focus_on = yes
		has_war = no
		any_country = {
			is_allied_ai = yes
			NOT = { tag = SOV }
			is_ai = no
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = industrial_complex
		value = 68
	}
}

GER_wants_mil = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date < 1938.1.1
		is_historical_focus_on = no
		has_war = no
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = arms_factory
		value = 60
	}
}
GER_wants_mil2 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1939.8.1
		date < 1941.1.1
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = arms_factory
		value = 270
	}
}
GER_wants_mil3 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		date > 1941.1.1
		date < 1943.1.1
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = arms_factory
		value = 320
	}
}
GER_ww2_airforce = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_war = yes
		NOT = { has_war_with = SOV }
		GER_is_not_relevant = no
		NOT = { has_global_flag = FRA_already_surrendered }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = air_factory_balance
		value = 25 #we gonna beat the shit out of the Royal Airforce and the Reds
	}
}
GER_prepare_for_barbarossa_airforce = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_war = yes
		NOT = { has_war_with = SOV }
		GER_is_not_relevant = no
		has_global_flag = FRA_already_surrendered
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = air_factory_balance
		value = 75 #we gonna beat the shit out of the Royal Airforce and the Reds
	}
}
GER_ramping_up_the_airforce = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_war = yes
		has_war_with = SOV
		GER_is_not_relevant = no
		has_global_flag = FRA_already_surrendered
		check_variable = { GER_blitzkrieg > 20 }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = air_factory_balance
		value = 25 #we gonna beat the shit out of the Royal Airforce and the Reds
	}
}
GER_ramping_up_the_airforce_2 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_war = yes
		has_war_with = SOV
		GER_is_not_relevant = no
		has_global_flag = FRA_already_surrendered
		check_variable = { GER_blitzkrieg > 20 }
		has_idea = GER_barbarossa
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = air_factory_balance
		value = 25 #we gonna beat the shit out of the Reds
	}
}
GER_wants_synth = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_government = fascism
		is_historical_focus_on = yes
		date > 1937.5.1
	}
	abort = {
		OR = {
			focus_progress = {
				focus = GER_demand_sudetenland
				progress > 0
			}
			has_completed_focus = GER_demand_sudetenland
		}	
	}
	ai_strategy = {
		type = building_target
		id = synthetic_refinery
		value = 18
	}

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

	ai_strategy = {
		type = research_tech
		id = improved_rubber_processing
		value = 100
	}
}
GER_wants_synthb = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_government = fascism
		is_historical_focus_on = no
		date > 1937.5.1
	}
	abort = {
		OR = {
			focus_progress = {
				focus = GER_demand_sudetenland
				progress > 0
			}
			has_completed_focus = GER_demand_sudetenland
		}	
	}
	ai_strategy = {
		type = building_target
		id = synthetic_refinery
		value = 12
	}

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

	ai_strategy = {
		type = research_tech
		id = improved_rubber_processing
		value = 100
	}
}
GER_wants_synth_2 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_government = fascism
		is_historical_focus_on = yes
		OR = {
			has_completed_focus = GER_synthetic_rubber
			focus_progress = {
				focus = GER_synthetic_rubber
				progress > 0.01
			}
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = synthetic_refinery
		value = 10
	}

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

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

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

	ai_strategy = {
		type = air_factory_balance
		value = 5 #barbarossa ramp up
	}

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = -10
	}
}
GER_wants_synth_3 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_government = fascism
		date > 1940.5.1
		has_completed_focus = GER_synthetic_rubber
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = synthetic_refinery
		value = 7
	}

	ai_strategy = {
		type = air_factory_balance
		value = 5 #barbarossa aftermath
	}

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

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

	ai_strategy = {
		type = research_tech
		id = advanced_rubber_processing
		value = 100
	}
}
GER_wants_synth_4 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_government = fascism
		date > 1941.1.1
		has_completed_focus = GER_synthetic_rubber
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = building_target
		id = synthetic_refinery
		value = 9
	}

	ai_strategy = {
		type = air_factory_balance
		value = 5
	}
}

GER_we_dont_fight_pathetic_sweden = { # :O
	allowed = {
		original_tag = GER
	}
	enable = {
		is_historical_focus_on = no
		has_government = fascism
		SWE = {
			has_idea = neutrality_idea
		}
	}
	abort = {
		SWE = {
			not = { has_idea = neutrality_idea }
		}
	}
	ai_strategy = {
		type = antagonize
		id = SWE
		value = -200 #keep the iron coming and no one gets hurt
	}
	ai_strategy = {
		type = protect
		id = SWE
		value = 100 #keep the iron coming and no one gets hurt
	}
}

GER_we_dont_fight_pathetic_sweden_on_historical = { # :O
	allowed = {
		original_tag = GER
	}
	enable = {
		is_historical_focus_on = yes
		has_government = fascism
		SWE = {
			has_idea = neutrality_idea
		}
	}
	abort = {
		SWE = {
			not = { has_idea = neutrality_idea }
		}
	}
	ai_strategy = {
		type = antagonize
		id = SWE
		value = -50 #keep the iron coming and no one gets hurt
	}
	ai_strategy = {
		type = protect
		id = SWE
		value = 50 #keep the iron coming and no one gets hurt
	}
}

GER_trade_with_sweden = {
	allowed = {
		original_tag = GER
	}
	enable = {
		# if we're not communist and they're not communist
		NOT = { has_government = communism }
		NOT = { SWE = { has_government = communism } }
	}
	abort_when_not_enabled = yes

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

GER_trade_with_italy = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_government = fascism
		ITA = { has_government = fascism }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_market_trade_desire
		id = ITA
		value = 40
	}
}

GER_market_management_after_anschluss = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_government = fascism
		has_completed_focus = GER_anschluss
	}
	abort_when_not_enabled = yes

	# Time to start buffer for war
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = infantry
		value = 10000
	}
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = support
		value = 500
	}
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = artillery
		value = 500
	}
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = armor
		value = 500
	}
}

GER_market_management_after_sudetenland = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_government = fascism
		has_completed_focus = GER_demand_sudetenland
	}
	abort_when_not_enabled = yes

	# Oh nein, we're not gonna sell this, we're... "saving" it...
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = infantry
		value = 20000
	}
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = support
		value = 1500
	}
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = artillery
		value = 1500
	}
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = anti_air
		value = 1500
	}
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = anti_tank
		value = 1500
	}
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = armor
		value = 1000
	}
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = motorized
		value = 2000
	}
	ai_strategy = {
		type = equipment_market_for_sale_threshold
		id = train
		value = 200
	}
}

spain_scw_support_GER_resistance = {
	allowed = {
		original_tag = GER
		has_dlc = "La Resistance"
	}
	enable = {
		has_government = fascism
		country_exists = SPA
	}
	abort = {
		OR = {
			NOT = { country_exists = SPA }
			SPA = { has_completed_focus = SPA_join_the_allies }
		}
	}

	ai_strategy = {
		type = support
		id = SPA
		value = 100
	}

	ai_strategy = {
		type = send_volunteers_desire
		id = CHI
		value = -100 #Complicated
	}

	ai_strategy = {
		type = send_volunteers_desire
		id = SPA
		value = 100
	}
}

GER_we_are_bad_at_espionage_because_it_is_expensive_and_not_tanks = {
	allowed = {
		original_tag = GER
		has_dlc = "La Resistance"
	}
	enable = {
		has_government = fascism
		num_of_civilian_factories < 90
		num_of_civilian_factories > 30
	}
	abort = {
		OR = {
			num_of_civilian_factories > 90
		}
	}
	ai_strategy = {
		type = intelligence_agency_usable_factories
		value = -20
	}
}

GER_my_precisioussss = {
	allowed = {
		original_tag = GER
	}

	enable = {
		OR = {
			date < 1944.6.1
			has_war = yes
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = send_lend_lease_desire
		id = SLO
		value = -999
	}
	ai_strategy = {
		type = send_lend_lease_desire
		id = MAN
		value = -999
	}
	ai_strategy = {
		type = send_lend_lease_desire
		id = CHI
		value = -999
	}
	ai_strategy = {
		type = send_lend_lease_desire
		id = YUN
		value = -999
	}
	ai_strategy = {
		type = send_lend_lease_desire
		id = SHX
		value = -999
	}
	ai_strategy = {
		type = send_lend_lease_desire
		id = XSM
		value = -999
	}
	ai_strategy = {
		type = send_lend_lease_desire
		id = SIK
		value = -999
	}
}

GER_let_italy_handle_french_front_alone = {
	allowed = {
		original_tag = GER
	}
	enable = {
		is_in_faction_with = ITA
		OR = {
			AND = {
				has_war_together_with = ITA
				has_war_with = FRA
			}
			focus_progress = {
				focus = GER_danzig_or_war
				progress > 0.01
			}
		}
		FRA = { has_capitulated = no } # Abort when France is out of the equation
		date < 1940.4.1 #might need a new trick
		ITA = { surrender_progress < 0.05 }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = dont_defend_ally_borders
		id = "ITA"
		value = 100
	}
}


GER_ITA_close_up_maginot_line_after_FRA_falls  = {
	allowed = {
		OR = {
			original_tag = GER
			original_tag = FRA
		}
	}

	enable = {
		NOT = { has_war_with = SOV }
		has_war_with = FRA
		FRA = {
			has_capitulated = yes
			days_since_capitulated > 7 # let's give a week before things settle
			days_since_capitulated < 90
		}
		NOT = { has_full_control_of_state = 28 }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		state = 28 # close up maginot line

		ratio = 0.3

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

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

	ai_strategy = {
		type = front_unit_request

		state = 28

		value = 150 # lets put more units, should be safe
	}
}


# AI are not willing to invade if it is at war at its home against another country's home location
# lets force invade NOR for GER & ITA
GER_enable_invasion_of_NOR = {
	allowed = {
		OR = {
			original_tag = GER
			original_tag = ITA
		}
	}
	enable = {
		# try to invade NOR if things are looking not so bad
		OR = {
			date < 1940.4.4
			FRA = { has_capitulated = yes } # uh oh, maybe we need more units against FRA
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = invade
		id = "NOR"
		value = 20
	}

	ai_strategy = {
		type = invade
		id = "DEN"
		value = 20
	}
}


# focus armor units on low countries
# and ignore mighty lux until they fall
GER_around_the_maginot = {
	allowed = {
		original_tag = GER
		is_historical_focus_on = yes
	}

	enable = {
		is_historical_focus_on = yes
		date < 1941.4.1
		FRA = {
			is_ai = yes
		}
		42 = {
			is_controlled_by = GER
		}
		50 = {
			is_controlled_by = GER
		}
		OR = {
			HOL = {
				has_capitulated = no
			}
			BEL = {
				has_capitulated = no
			}
		}
		NOT = { has_war_with = LUX }
		LUX = {
			has_capitulated = no
			NOT = { is_in_faction_with = FRA }
		}
		OR = {
			focus_progress = {
				focus = GER_around_maginot
				progress > 0
			}
			AND = {
				is_in_array = { potential_and_current_enemies = HOL }
				is_in_array = { potential_and_current_enemies = BEL }
			}
		}
		is_in_array = { potential_and_current_enemies = FRA }
	}

	abort_when_not_enabled = yes

	# leave LUX for later
	ai_strategy = {
		type = declare_war
		id = "LUX"
		value = -5000
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "LUX"
		target = declare_war
		value = -5000
	}

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

	ai_strategy = {
		type = front_armor_score
		id = "HOL"
		value = 200
	}

	ai_strategy = {
		type = front_armor_score
		id = "BEL"
		value = 200
	}

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

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

}


# lets not invade until we have europe
GER_dont_invade_until_FRA_falls = {
	allowed = {
		original_tag = GER
		is_historical_focus_on = yes
	}

	enable = {
		date < 1941.3.1
		FRA = {
			has_capitulated = no
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = invasion_unit_request
		country_trigger = { always = yes }

		value = -100
	}

	ai_strategy = {
		type = front_unit_request

		# norway
		state = 110
		state = 142
		state = 143
		state = 144

		value = -100
	}
}

GER_have_some_train_production = {
	allowed = {
		original_tag = GER
	}

	enable = {
		date > 1936.7.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = equipment_production_min_factories
		id = train
		value = 1  # Always have some production of trains
	}
}

GER_stock_up_on_trains_before_barbarossa = {
	allowed = {
		original_tag = GER
	}

	enable = {
		is_historical_focus_on = yes
		date > 1940.7.1
		date < 1943.1.1
		has_war = yes
		# always = no
	}
	abort = {
		has_war_with = SOV # Barbarossa has started, let wartime prioritization do its thing
		date > 1943.1.1
	}

	#ai_strategy = {
	#	type = min_wanted_supply_trains  # Causes large spike, not optimal
	#	value = 300
	#}

	ai_strategy = {
		type = equipment_production_min_factories
		id = train
		value = 4  # Boost train production before Barbarossa
	}
}

GER_ignore_vichy_we_will_annex_them_later = {
	allowed = {
		original_tag = GER
	}

	enable = {
		country_exists = VIC
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = ignore
		id = "VIC"
		value = 100
	}
}

GER_vichy_has_served_its_purpose = {
	allowed = {
		original_tag = GER
	}

	enable = {
		country_exists = VIC
		VIC = {
			OR = {
				has_country_flag = case_anton # Germany has activated the decision

				count_triggers = { # Conditions for decision GER_case_anton
					amount = 3 # lost control of ca half french north africa
					458 = { CONTROLLER = { has_war_with = ROOT } }
					459 = { CONTROLLER = { has_war_with = ROOT } }
					460 = { CONTROLLER = { has_war_with = ROOT } }
					461 = { CONTROLLER = { has_war_with = ROOT } }
					462 = { CONTROLLER = { has_war_with = ROOT } }
					513 = { CONTROLLER = { has_war_with = ROOT } }
					665 = { CONTROLLER = { has_war_with = ROOT } }
				}
			}
		}
	}
	abort = { always = no }

	ai_strategy = {
		type = prepare_for_war
		id = VIC
		value = 100
	}
}

GER_dont_upgrade_to_weapons_3_too_early = {
	allowed = {
		original_tag = GER
	}
	enable = {
		is_historical_focus_on = yes
		has_equipment = { infantry_equipment < 60000 }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = production_upgrade_desire_offset
		id = infantry_equipment_3
		value = -100
	}
}

GER_blitzkrieg_benelux  = {
	allowed = {
		original_tag = GER
	}

	enable = {
		date < 1940.3.1 #Don't keep pushing wildly if we haven't capitulated benelux in 4 months - we lost anyway
		OR = {
			AND = {
				focus_progress = {
					focus = GER_around_maginot
					progress > 0.01
				}
				NOT = { has_war_with = HOL  }
			}
			AND = {
				has_war_with = HOL
				HOL = { has_capitulated = no }
			}
			AND = {
				has_war_with = BEL
				BEL = { has_capitulated = no }
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		tag = HOL

		ratio = 0.25

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

	ai_strategy = {
		type = front_control

		tag = BEL

		ratio = 0.25

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

	ai_strategy = {
		type = front_unit_request

		tag = BEL

		value = 50 # lets put more units, should be safe
	}

	ai_strategy = {
		type = front_unit_request

		tag = HOL

		value = 50 # lets put more units, should be safe
	}
}

GER_blitz_france = {

	allowed = {
		original_tag = GER
	}

	enable = {
		date < 1940.6.1
		HOL = { has_capitulated = yes }
		is_historical_focus_on = yes
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = consider_weak
		id = "FRA"
		value = 25
	}

	ai_strategy = {
		type = front_control

		tag = FRA

		ratio = 0.5

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

}

GER_tanks_in_the_snow = {
	allowed = {
		original_tag = GER
	}

	enable = {
		OR = {
			focus_progress = {
				focus = GER_ussr_war_goal
				progress > 0.01
			}
			has_completed_focus = GER_ussr_war_goal
		}
	}

	abort = {
		surrender_progress > 0.15 #Bring our metal bawkses home
	}

	ai_strategy = {
		type = front_armor_score
		id = "SOV"
		value = 200
	}

	ai_strategy = {
		type = front_unit_request

		tag = SOV

		value = 40
	}

}

GER_tanks_against_france = {
	allowed = {
		original_tag = GER
	}

	enable = {
		is_historical_focus_on = yes
		HOL = { has_capitulated = yes }
		BEL = { has_capitulated = yes }
	}

	abort = {
		surrender_progress > 0.15 #Bring our metal bawkses home
	}

	ai_strategy = {
		type = front_armor_score
		id = "FRA"
		value = 200
	}

	ai_strategy = {
		type = front_unit_request

		tag = FRA

		value = 10
	}

	ai_strategy = {
		type = front_unit_request

		state = 28

		value = -25 # lets put less units, should be safe
	}

}

GER_abandon_ship = {
	allowed = {
		original_tag = GER
	}

	enable = {
		surrender_progress > 0.25 #Bring our metal bawkses home
	}

	abort = {
		surrender_progress < 0.25 #Bring our metal bawkses home
	}

	ai_strategy = {
		type = front_unit_request

		tag = SOV

		value = -40
	}

}

GER_blitzkrieg_russia_hard  = { #STEINER, IT IS NOT TIME YET
	allowed = {
		is_axis_ai = yes
	}

	enable = {
		date < 1943.1.1
		date > 1941.7.1
		has_war_with = SOV
		NOT = { has_global_flag = d_day_happened }
		any_state = { 
			is_core_of = POL
			is_controlled_by = SOV
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = strategic_air_importance
		id = 39 #Strategic Region ID - Eastern Poland
		value = 65000 #value of stocked main front in active combat is usually around 35,000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 130 #Strategic Region ID - Ukraine
		value = 25000 #value of stocked main front in active combat is usually around 35,000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 131 #Strategic Region ID - Ukraine
		value = 25000 #value of stocked main front in active combat is usually around 35,000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 37 #Strategic Region ID - Ukraine
		value = 15000 #value of stocked main front in active combat is usually around 35,000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 1 #Strategic Region ID - Ukraine
		value = -25000 #value of stocked main front in active combat is usually around 35,000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 18 #Strategic Region ID - Ukraine
		value = -25000 #value of stocked main front in active combat is usually around 35,000
	}

}
GER_ukraine_war  = { #STEINER, IT IS NOT TIME YET
	allowed = {
		is_axis_ai = yes
	}

	enable = {
		date < 1943.7.1
		date > 1941.7.1
		has_war_with = SOV
		NOT = { has_global_flag = d_day_happened }
		NOT = {
			any_state = { 
				is_core_of = POL
				is_controlled_by = SOV
			}
		}
		NOT = { 227 = { controller = { is_in_faction_with = GER } } }
		NOT = { 221 = { controller = { is_in_faction_with = GER } } }
		NOT = { 137 = { controller = { is_in_faction_with = GER } } }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = strategic_air_importance
		id = 39 #Strategic Region ID - Eastern Poland
		value = -25000 #value of stocked main front in active combat is usually around 35,000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 130 #Strategic Region ID - Ukraine
		value = 60000 #value of stocked main front in active combat is usually around 35,000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 131 #Strategic Region ID - Ukraine
		value = -25000 #value of stocked main front in active combat is usually around 35,000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 37 #Strategic Region ID - Ukraine
		value = -15000 #value of stocked main front in active combat is usually around 35,000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 1 #Strategic Region ID - Ukraine
		value = -25000 #value of stocked main front in active combat is usually around 35,000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 18 #Strategic Region ID - Ukraine
		value = -25000 #value of stocked main front in active combat is usually around 35,000
	}

}

GER_blitzkrieg_russia_baltic  = { #STEINER, IT IS NOT TIME YET
	allowed = {
		original_tag = GER
	}

	enable = {
		has_war_with = SOV
		814 = { controller = { tag = SOV } }
		189 = { controller = { tag = SOV } }
		11 = { controller = { tag = SOV } }
		815 = { controller = { tag = SOV } }
		809 = { controller = { tag = SOV } }
		NOT = { has_global_flag = d_day_happened }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = strategic_air_importance
		id = 39 #Strategic Region ID - Eastern Poland
		value = 10000 #value of stocked main front in active combat is usually around 35,000
	}

	ai_strategy = {
		type = strategic_air_importance
		id = 37 #Strategic Region ID - Baltic States
		value = 50000 #value of stocked main front in active combat is usually around 35,000
	}

}

GER_normandy_buffer = {
	allowed = {
		original_tag = GER
	}
	enable = {
		is_historical_focus_on = yes
		FRA = {
			has_capitulated = yes
		}
		date < 1943.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			14
			15
			29
			735
			22
		}
		ratio = 0.11
		area = normandy_landing_zone
		subtract_invasions_from_need = no
		subtract_fronts_from_need = yes
	}

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

GER_invasion_buffer = {
	allowed = {
		original_tag = GER
	}
	enable = {
		is_historical_focus_on = yes
		FRA = {
			has_capitulated = yes
		}
		date > 1943.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		states = {
			15
			14
			23
			29
			6
		}
		ratio = 0.20
		area = normandy_landing_zone
		subtract_invasions_from_need = no
		subtract_fronts_from_need = yes
	}
	ai_strategy = {
		type = role_ratio
		id = garrison
		value = 10
	}
}

GER_build_more_cas_to_invade_russia = {
	allowed = {
		original_tag = GER
	}
	enable = {
		is_historical_focus_on = yes
		FRA = {
			has_capitulated = yes
		}
		date > 1940.1.1
	}
	abort_when_not_enabled = yes

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

GER_push_back_our_coasts_until_overlord  = {
	allowed = {
		original_tag = GER
	}

	enable = {
		has_global_flag = event_completed
		date < 1943.6.6
		is_historical_focus_on = yes
		FRA = { has_capitulated = yes }
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		tag = HOL

		ratio = 0.25

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

	ai_strategy = {
		type = front_control

		tag = BEL

		ratio = 0.25

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

	ai_strategy = {
		type = front_control

		tag = FRA

		ratio = 0.25

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

	ai_strategy = {
		type = front_unit_request

		tag = BEL

		value = 25
	}

	ai_strategy = {
		type = front_unit_request

		tag = HOL

		value = 25 # lets put more units, should be safe
	}

	ai_strategy = {
		type = front_unit_request

		tag = FRA

		value = 25
	}
}

GER_pause_in_SOV = { #We got this far but our home is under siege
	allowed = {
		original_tag = GER
	}

	enable = {
		is_historical_focus_on = yes
		has_war_with = SOV
		SOV = { has_capitulated = no }
		OR = {
			surrender_progress > 0.25
			16 = {
				controller = {
					has_war_with = GER
				}
			}
		}
		date > 1942.1.1
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control

		tag = SOV

		ratio = 0.60

		priority = 100
		ordertype = front
		execution_type = careful
		execute_order = no
	}

	ai_strategy = {
		type = front_unit_request

		tag = FRA

		value = 20 # omg no, the french
	}

	ai_strategy = {
		type = front_unit_request

		tag = SOV

		value = -5 # FLEE
	}

}

GER_make_some_radar_1 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_war_with_major = yes  # Oy, we need some radar tech!
	}

	abort = {
		has_tech = radio_detection
	}

	ai_strategy = {
		type = research_tech
		id = radio_detection
		value = 2000
	}
}

GER_make_some_radar_2 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_tech = radio_detection
		has_war_with_major = yes  # Oy, we need some radar tech!
	}

	abort = {
		has_tech = decimetric_radar
	}

	ai_strategy = {
		type = research_tech
		id = decimetric_radar
		value = 2000
	}
}

GER_make_some_radar_3 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_tech = decimetric_radar
		has_war_with_major = yes  # Oy, we need some radar tech!
	}

	abort = {
		has_tech = improved_decimetric_radar
	}

	ai_strategy = {
		type = research_tech
		id = improved_decimetric_radar
		value = 200
	}
} # After this, you're on your own chaps

GER_make_some_radar_4 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_tech = radio_detection
		90 = {
			is_controlled_by = FROM
			free_building_slots = {
				building = radar_station
				size > 0
				include_locked = yes
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = radar_station
		target = 90 #Kielce
		value = 2000
	}
}

GER_make_some_radar_5 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_tech = radio_detection
		763 = {
			is_controlled_by = FROM
			free_building_slots = {
				building = radar_station
				size > 0
				include_locked = yes
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = radar_station
		target = 763 #Konigsberg
		value = 2000
	}
}

GER_make_some_radar_6 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_tech = radio_detection
		36 = {
			is_controlled_by = FROM
			free_building_slots = {
				building = radar_station
				size > 0
				include_locked = yes
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = radar_station
		target = 36 #Holland
		value = 2000
	}
}

GER_make_some_radar_7 = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_tech = radio_detection
		42 = {
			is_controlled_by = FROM
			free_building_slots = {
				building = radar_station
				size > 0
				include_locked = yes
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = radar_station
		target = 42 #Moselland
		value = 2000
	}
}

GER_focus_yugo = {
	allowed = { original_tag = GER }
	enable = {
		has_war_with = YUG
		YUG = { has_capitulated = no }
		is_historical_focus_on = yes
		NOT = { has_global_flag = d_day_happened }
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = strategic_air_importance
		id = 24 #Strategic Region ID - Western Balkans
		value = 30000
	}
}

GER_protect_hungary = {
	allowed = { original_tag = GER }
	enable = {
		is_historical_focus_on = yes
		HUN = {
			has_government = fascism
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = protect
		id = "HUN"
		value = 50
	}

}

GER_protect_romania = {
	allowed = { original_tag = GER }
	enable = {
		is_historical_focus_on = yes
		ROM = {
			OR = {
				has_government = fascism
				has_government = neutrality
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = protect
		id = "ROM"
		value = 50
	}
}

GER_avoid_war_with_SWI = {
	allowed = { original_tag = GER }
	enable = {
		is_historical_focus_on = yes
		SWI = {
			exists = yes
		}
	}
	abort = {
		OR = {
			is_historical_focus_on = no
			has_wargoal_against = SWI
			SWI = {
				NOT = { has_idea = SWI_swiss_neutrality }
			}
		}
	}

	ai_strategy = {
		type = conquer
		id = SWI
		value = -999
	}

	ai_strategy = {
		type = antagonize
		id = SWI
		value = -75
	}
}

bba_air_prod_1 = {
	# TODO BFW:
	allowed = { original_tag = GER }
	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 = 15
	}

	ai_strategy = {
		type = equipment_production_min_factories
		id = fighter
		value = 6  # Germany needs a minimum production of fighters
	}

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

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

	ai_strategy = {
		type = equipment_production_min_factories
		id = cas
		value = 3  # Germany needs a minimum production of CAS planes
	}

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

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

}

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

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

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

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

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

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

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

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

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

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

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

}

GER_dont_act_on_danzig_if_things_went_south = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_war_with = CZE
		CZE = { surrender_progress < 0.6 }
		date < 1940.6.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = declare_war
		id = "POL"
		value = -2000
	}
}

GER_protect_swedish_ore = {
	allowed = {
		original_tag = GER
	}
	enable = {
		NOT = { has_war_with = SWE }
		SWE = { has_capitulated = no }
		
 		142 = { is_fully_controlled_by = ROOT }
 		110 = { is_fully_controlled_by = ROOT }
 		143 = { is_fully_controlled_by = ROOT }
 		144 = { is_fully_controlled_by = ROOT }
	}
	abort_when_not_enabled = yes

	 ai_strategy = {
	 	type = put_unit_buffers

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

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

	 	# states to put garrison orders (if no state is friendly, strat is invalid)
	 	states = {
	 		142
	 		110
	 		143
	 		144
	 	} 

		# ai areas that the orders will use these buffers in
	 	area = europe
	 }
	
}

TEMP_avoid_sweden = {
	allowed = {
		original_tag = GER
	}
	enable = {
		country_exists = SWE
		is_historical_focus_on = yes
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = conquer
		id = "SWE"
		value = -999
	}
}

SWE_nils_flyg_is_in_charge_and_he_is_a_weird_communist_that_does_not_like_stalin_so_we_like_him = {
	allowed = {
		original_tag = GER
	}
	enable = {
		country_exists = SWE
		SWE = {
			has_country_leader = {
				ruling_only = yes 
				character = SWE_nils_flyg 
			}
			has_government = communism
		}
		OR = {
			has_war = yes
			date > 1940.1.1
			SWE = { has_war = yes }
		}
	}
	abort = {
		SWE = {
			NOT = {
				has_government = communism
				has_country_leader = {
					ruling_only = yes 
					character = SWE_nils_flyg 
				}
			}
		}
	}	

	ai_strategy = {
		type = avoid_starting_wars
		id = "SWE"
		value = 200
	}

	ai_strategy = {
		type = befriend
		id = "SWE"
		value = 200
	}

	ai_strategy = {
		type = alliance
		id = "SWE"
		value = 1000
	}
}

Sweden_was_a_puppet_and_broke_free_so_now_we_are_angry = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_country_flag = sweden_was_a_puppet_and_has_broken_free
	}

	abort = {
		NOT = { has_country_flag = sweden_was_a_puppet_and_has_broken_free }
	}

	ai_strategy = {
		type = conquer
		id = "SWE"
		value = 200
	}
	ai_strategy = {
		type = antagonize
		id = "SWE"
		value = 200
	}
}

Sweden_joined_our_pact_so_we_are_kinda_happy = {
	allowed = {
		original_tag = GER
	}
	enable = {
		SWE = { has_completed_focus = SWE_join_the_anti_soviet_pact }
	}

	abort = {
		SWE = { has_war_with = GER }
	}

	ai_strategy = {
		type = alliance
		id = "SWE"
		value = 50
	}
	ai_strategy = {
		type = protect
		id = "SWE"
		value = 70
	}
}

respect_anti_soviet_pact_GER = {
	reversed = yes
	allowed = {
		original_tag = GER
	}
	enable = {
		has_idea = anti_soviet_pact
		GER = { has_idea = anti_soviet_pact }
	}

	abort = {
		OR = {
			NOT = { has_idea = anti_soviet_pact }
			has_war_with = GER
			NOT = { GER = { has_idea = anti_soviet_pact } }
		}
	}

	ai_strategy = {
		type = alliance
		id = "GER"
		value = 100
	}

	ai_strategy = {
		type = protect
		id = "GER"
		value = 100
	}

	ai_strategy = {
		type = declare_war
		id = "GER"
		value = -200
	}
	ai_strategy = {
		type = diplo_action_desire
		id = "GER"
		target = guarantee
		value = 20
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = "GER"
		target = military_access
		value = 1000
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = "GER"
		target = non_aggression_pact
		value = 1000
	}
}

respect_anti_soviet_pact_ENG = {
	reversed = yes
	allowed = {
		original_tag = ENG
	}
	enable = {
		has_idea = anti_soviet_pact
		ENG = { has_idea = anti_soviet_pact }
	}

	abort = {
		OR = {
			NOT = { has_idea = anti_soviet_pact }
			has_war_with = ENG
			NOT = { GER = { has_idea = anti_soviet_pact } }
			NOT = { ENG = { has_idea = anti_soviet_pact } }
		}
	}

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = 100
	}

	ai_strategy = {
		type = protect
		id = "ENG"
		value = 100
	}

	ai_strategy = {
		type = declare_war
		id = "ENG"
		value = -200
	}
	ai_strategy = {
		type = diplo_action_desire
		id = "ENG"
		target = guarantee
		value = 20
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = "ENG"
		target = military_access
		value = 1000
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = "ENG"
		target = non_aggression_pact
		value = 1000
	}
}

respect_anti_soviet_pact_FRA = {
	reversed = yes
	allowed = {
		original_tag = FRA
	}
	enable = {
		has_idea = anti_soviet_pact	
		FRA = { has_idea = anti_soviet_pact }
	}

	abort = {
		OR = {
			NOT = { has_idea = anti_soviet_pact }
			has_war_with = FRA
			NOT = { GER = { has_idea = anti_soviet_pact } }
			NOT = { FRA = { has_idea = anti_soviet_pact } }
		}
	}

	ai_strategy = {
		type = alliance
		id = "FRA"
		value = 100
	}

	ai_strategy = {
		type = protect
		id = "FRA"
		value = 100
	}

	ai_strategy = {
		type = declare_war
		id = "FRA"
		value = -200
	}
	ai_strategy = {
		type = diplo_action_desire
		id = "FRA"
		target = guarantee
		value = 20
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = "FRA"
		target = military_access
		value = 1000
	}

	ai_strategy = {
		type = diplo_action_acceptance
		id = "FRA"
		target = non_aggression_pact
		value = 1000
	}
}