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

	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 = 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_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 = 20
	}

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

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

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

	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_research_early = {
	allowed = {
		original_tag = HUN
	}
	enable = {
		always = yes
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = research_weight_factor
		id = interwar_artillery
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = artillery1
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = basic_small_airframe
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = engines_2
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = basic_medium_tank_chassis
		value = 500
	}

	ai_strategy = {
		type = research_weight_factor
		id = support_weapons
		value = 100
	}

	ai_strategy = {
		type = research_weight_factor
		id = support_weapons2
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = infantry_weapons2
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = improved_infantry_weapons
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = motorised_infantry
		value = 1000
	}

	ai_strategy = {
		type = research_weight_factor
		id = tech_recon
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = tech_engineers
		value = 150
	}

	# And then down-prio a few things...
	ai_strategy = {
		type = research_weight_factor
		id = air_torpedoe_1
		value = -500
	}
}

HUN_research_mid = {
	allowed = {
		original_tag = HUN
	}
	enable = {
		date > 1940.1.1
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = research_weight_factor
		id = antiair1
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = antiair2
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = antitank1
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = antitank2
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = artillery2
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = artillery3
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = artillery4
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = improved_small_airframe
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = engines_3
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = aa_hmg
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = aa_cannon_1
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = improved_medium_tank_chassis
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = improved_light_tank_chassis
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = improved_infantry_weapons_2
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = advanced_infantry_weapons
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = support_weapons3
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = support_weapons4
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = tech_maintenance_company
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = tech_maintenance_company
		value = 150
	}
}

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

	ai_strategy = {
		type = research_weight_factor
		id = antiair2
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = antiair3
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = antiair4
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = antitank2
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = antitank3
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = antitank4
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = artillery4
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = advanced_small_airframe
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = engines_4
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = aa_cannon_2
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = advanced_medium_tank_chassis
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = improved_light_tank_chassis
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = mechanised_infantry
		value = 250
	}

	ai_strategy = {
		type = research_weight_factor
		id = improved_infantry_weapons_2
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = advanced_infantry_weapons
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = support_weapons4
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = infantry_at
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = tech_field_hospital
		value = 150
	}

	ai_strategy = {
		type = research_weight_factor
		id = tech_logistics_company
		value = 150
	}
}

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
	}
	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 = {
			has_completed_focus = GER_oppose_hitler
		}
	}
	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 = {
		has_completed_focus = GER_oppose_hitler
		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
	}
}
