HUN_unit_production_early = {
	allowed = {
		original_tag = HUN
	}
	enable = {
		date < 1940.1.1
	}
	abort_when_not_enabled = yes

	### Land unit factors ###
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = 0
	}

	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = 2
	}

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

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

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

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

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

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

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

	ai_strategy = {
		type = unit_ratio
		id = tactical_bomber
		value = 10
	}

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = heavy_fighter
		value = -40 #Just build a few slowly
	}

	ai_strategy = {
		type = unit_ratio
		id = heavy_fighter
		value = 0
	}

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

	ai_strategy = {
		type = unit_ratio
		id = submarine
		value = 10
	}

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

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

	### Equipment production ###
	ai_strategy = {
		type = equipment_production_min_factories
		id = convoy
		value = 1
	}

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

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

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

HUN_unit_production_mid = {
	allowed = {
		original_tag = HUN
	}
	enable = {
		date > 1940.1.1
		date < 1943.1.1
	}
	abort_when_not_enabled = yes

	### Land unit factors ###
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = 0
	}

	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = 2
	}

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

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

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

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

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

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

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

	ai_strategy = {
		type = unit_ratio
		id = tactical_bomber
		value = 10
	}

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = heavy_fighter
		value = -40 #Just build a few slowly
	}

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

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

	ai_strategy = {
		type = unit_ratio
		id = submarine
		value = 10
	}

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

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

	### Equipment production ###
	ai_strategy = {
		type = equipment_production_min_factories
		id = convoy
		value = 1
	}

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

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

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

HUN_unit_production_late = {
	allowed = {
		original_tag = HUN
	}
	enable = {
		date > 1943.1.1
	}
	abort_when_not_enabled = yes

	### Land unit factors ###
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = 0
	}

	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = 2
	}

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

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

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

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

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

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

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

	ai_strategy = {
		type = unit_ratio
		id = tactical_bomber
		value = 10
	}

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = heavy_fighter
		value = -40 #Just build a few slowly
	}

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

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

	ai_strategy = {
		type = unit_ratio
		id = submarine
		value = 10
	}

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

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

	### Equipment production ###
	ai_strategy = {
		type = equipment_production_min_factories
		id = convoy
		value = 1
	}

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

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

	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = 25
	}
}
HUN_build_up_army = {
	allowed = {
		original_tag = HUN
	}
	enable = {
		has_completed_focus = wuw_HUN_secret_rearmament
	}
	abort = {
		has_war = yes  # Return back to dynamic behavior when we end up at war
	}

	ai_strategy = {
		type = ai_wanted_divisions_factor
		value = 240
	}
}

germany_ally_1 = {
	allowed = {
		original_tag = HUN
	}
	enable = {
		has_country_flag = GER_second_vienna_award_HUN_north
		country_exists = GER
	}
	abort = {
		NOT = { country_exists = GER }
	}

	ai_strategy = {
		type = befriend
		id = "GER"
		value = 100
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = 100
	}
}
germany_dont_ally_historical = {
	allowed = {
		original_tag = HUN
	}
	enable = {
		is_historical_focus_on = yes
		country_exists = GER
		date < 1939.1.1
		has_global_flag = vanilla_history
	}
	abort = {
		is_in_faction_with = GER #got here somehow, might as well stay
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = -200
	}
}
germany_ally_2 = {
	allowed = {
		original_tag = HUN
	}
	enable = {
		has_country_flag = GER_second_vienna_award_HUN_all
		country_exists = GER
	}
	abort = {
		NOT = { country_exists = GER }
	}

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

germany_jerk = {
	allowed = {
		original_tag = HUN
	}
	enable = {
		has_country_flag = GER_second_vienna_award_noland
		country_exists = GER
	}
	abort = {
		NOT = { country_exists = GER }
	}

	ai_strategy = {
		type = befriend
		id = "GER"
		value = -200
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = -200
	}
}
germany_kaiser = {
	allowed = {
		original_tag = HUN
	}
	enable = {
		has_completed_focus = HUN_proclaim_the_restoration_of_austria_hungary
		GER = {
			OR = {
				has_completed_focus = GER_oppose_hitler_ww
				has_completed_focus = GER_oppose_hitler
			}
			has_government = neutrality
		}
	}
	abort = {
		GER = {
			OR = {
				exists = no
				has_government = fascism
			}
		}
	}
	ai_strategy = {
		type = befriend
		id = "GER"
		value = 200
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = 200
	}
	ai_strategy = {
		type = support
		id = "GER"
		value = 200
	}
}

germany_hungary_kaiser = {
	allowed = {
		original_tag = GER
	}
	enable = {
		OR = {
			has_completed_focus = GER_oppose_hitler_ww
			has_completed_focus = GER_oppose_hitler
		}
		has_government = neutrality
		HUN = {
			has_completed_focus = HUN_proclaim_the_restoration_of_austria_hungary
		}
	}
	abort = {
		HUN = {
			OR = {
				exists = no
				has_government = fascism
				has_government = communism
			}
		}
	}
	ai_strategy = {
		type = befriend
		id = "HUN"
		value = 200
	}
	ai_strategy = {
		type = alliance
		id = "HUN"
		value = 200
	}
	ai_strategy = {
		type = support
		id = "HUN"
		value = 200
	}
}
