DEN_avoid_axis_or_comintern = {

	allowed = { 
		original_tag = DEN 
		has_dlc = "Arms Against Tyranny"
	}
	
	enable = {
		DEN_historical_ai = yes
		is_historical_focus_on = yes
	}
	
	abort = {
		OR = {
			date > 1945.6.1
			AND = {
				has_country_flag = DEN_has_occupation_flag
				any_other_country = { #TODO_DANNE: Optimize this
					has_subject = DEN
					OR = {
						has_government = democratic 
						AND = {
							has_government = neutrality
							has_elections = yes
						}
					}
				}
			}
		}
	}

	ai_strategy = {
		type = alliance
		id = "JAP"
		value = -1000
	}
	
	ai_strategy = {
		type = alliance
		id = "SOV"
		value = -1000
	}
	
	ai_strategy = {
		type = alliance
		id = "GER"
		value = -1000
	}

	ai_strategy = {
		type = alliance
		id = "ITA"
		value = -1000
	}
}

DEN_avoid_allies = {

	allowed = { 
		original_tag = DEN 
		has_dlc = "Arms Against Tyranny"
	}
	
	enable = {
		DEN_historical_ai = yes
		is_historical_focus_on = yes
	}
	
	abort = {
		OR = {
			date > 1943.1.1
			AND = {
				has_country_flag = DEN_has_occupation_flag
				any_other_country = { #TODO_DANNE: Optimize this
					has_subject = DEN
					OR = {
						has_government = fascism 
						has_government = communism
						AND = {
							has_government = neutrality
							has_elections = no
						}
					}
				}
			}
		}
	}

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = -1000
	}
	
	ai_strategy = {
		type = alliance
		id = "USA"
		value = -1000
	}
	
	ai_strategy = {
		type = alliance
		id = "FRA"
		value = -1000
	}

	ai_strategy = {
		type = alliance
		id = "CAN"
		value = -1000
	}

	ai_strategy = {
		type = alliance
		id = "AST"
		value = -1000
	}

	ai_strategy = {
		type = alliance
		id = "SAF"
		value = -1000
	}

	ai_strategy = {
		type = alliance
		id = "ICE"
		value = -1000
	}

	ai_strategy = {
		type = alliance
		id = "NZL"
		value = -1000
	}

	ai_strategy = {
		type = alliance
		id = "HOL"
		value = -1000
	}

	ai_strategy = {
		type = alliance
		id = "LUX"
		value = -1000
	}

	ai_strategy = {
		type = alliance
		id = "BEL"
		value = -1000
	}

	ai_strategy = {
		type = alliance
		id = "NOR"
		value = -1000
	}
}

DEN_buy_planes_from_netherlands_and_uk = {
	allowed = {
		original_tag = DEN
		has_dlc = "Arms Against Tyranny"
	}
	enable = {
		DEN_historical_ai = yes
		is_historical_focus_on = yes
	}
	abort_when_not_enabled = yes

	# Increase threshold of wanted planes
	ai_strategy = {
		type = equipment_market_buying_threshold
		id = small_plane_cas_airframe
		value = 100  # Absolute number of units
	}
	ai_strategy = {
		type = equipment_market_buying_threshold
		id = small_plane_airframe
		value = 100  # Absolute number of units
	}

	# We want to buy from the Netherlands
	ai_strategy = {
		type = diplo_action_desire
		id = HOL
		target = market_access_rights
		value = 50
	}
	ai_strategy = {
		type = equipment_market_buy
		equipment_type = small_plane_cas_airframe
		seller = HOL
		value = 100
	}
	ai_strategy = {
		type = equipment_market_buy
		equipment_type = small_plane_airframe
		seller = HOL
		value = 100
	}

	# We want to buy from the UK
	ai_strategy = {
		type = diplo_action_desire
		id = ENG
		target = market_access_rights
		value = 50
	}
	ai_strategy = {
		type = equipment_market_buy
		equipment_type = small_plane_cas_airframe
		seller = ENG
		value = 100
	}
	ai_strategy = {
		type = equipment_market_buy
		equipment_type = small_plane_airframe
		seller = ENG
		value = 100
	}
}

DEN_prioritize_artillery = {
	allowed = {
		original_tag = DEN
		has_dlc = "Arms Against Tyranny"
	}
	enable = {
		date < 1937.01.01
	}
	abort_when_not_enabled = yes

	ai_strategy = { # Forces the AI to allocate this many factories to production of this type of equipment. Use with caution since it doesn't take into account how many factories are actually available.
		type = equipment_production_min_factories
		id = infantry
		value = 1  # The AI will put at least 1 factories on producing infantry equipment
	}

	ai_strategy = { # Forces the AI to allocate this many factories to production of this type of equipment. Use with caution since it doesn't take into account how many factories are actually available.
		type = equipment_production_min_factories_archetype
		id = artillery_equipment
		value = 1  # The AI will put at least 1 factories on producing artillery
	}

	ai_strategy = { # Affects the AI's perceived archetype needs regarding equipment purchases on the market. A value of 50 means it will try to buy 50 more of the equipment than what is actually needed, while a value of -20 means it will only try to buy if it has a deficit larger than 20.
		type = equipment_market_buying_threshold
		id = support_equipment_1  # equipment archetype
		value = 50  # Absolute number of units
	}
}
