#####################

###  ##  #  # # #  ## 
 #  #  # ## # # # #   
 #  #### # ## ##   #  
 #  #  # #  # # #   # 
 #  #  # #  # # # ## 

 #################### 

 HUN_hti_turan_organization = {
 	include = generic_medium_tank_organization
 	icon = GFX_idea_mw_aircraft #GFX_idea_HUN_hti_turan
 	
 	allowed = {	
 		original_tag = HUN
 		has_dlc = "Arms Against Tyranny"
 	}
 	
 	available = {
 		IF = {
 			limit = {
 				has_dlc = "Gotterdammerung"
 			}
 			FROM = {
 				has_completed_focus = wuw_HUN_the_turan
 			}
 		}
 		ELSE = {
 			FROM = {
 				has_completed_focus = HUN_develop_tanks
 			}
 		}
 	}
 }

 HUN_mavag_assault_guns_organization = {
 	include = generic_assault_guns_organization
 	icon = GFX_idea_HUN_mavag_assault_gun
 	
 	allowed = {	
 		original_tag = HUN
 		has_dlc = "Arms Against Tyranny"
 	}
 	
 	available = {
 		IF = {
 			limit = {
 				has_dlc = "Gotterdammerung"
 			}
 			FROM = {
 				has_completed_focus = wuw_HUN_establish_the_mavag_army_division
 			}
 		}
 		ELSE = {
 			FROM = {
 				has_completed_focus = HUN_assault_gun_focus
 			}
 		}
 	}
 }

 HUN_fiat_tankettes_organization = {
 	include = generic_mobile_tank_organization
 	icon = GFX_idea_fiat
 	
 	allowed = {	
 		original_tag = HUN 
 		has_dlc = "Arms Against Tyranny"
 	}

 	visible = {
 		IF = {
 			limit = {
 				FROM = {
 					original_tag = HUN
 				}
 			}
 			FROM = {
 				has_completed_focus = wuw_HUN_license_fiat_tankettes
 			}
 		}
 	}
 	
 	available = {
 		# When in a Foreign MIO, countries need to be at peace with original country
 		IF = {
 			limit = {
 				FROM = { NOT = { original_tag = ITA } }
 			}
 			FROM = { NOT = { has_war_with = ITA } }
 		}
 	}
 }

 HUN_henschel_organization = {
 	include = generic_heavy_tank_organization
 	icon = GFX_idea_henschel
 	
 	allowed = {	
 		original_tag = HUN 
 		has_dlc = "Arms Against Tyranny"
 	}

 	visible = {
 		IF = {
 			limit = {
 				FROM = {
 					original_tag = HUN
 				}
 			}
 			FROM = {
 				has_completed_focus = wuw_HUN_seek_german_contracts
 			}
 		}
 	}
 	
 	available = {
 		# When in a Foreign MIO, countries need to be at peace with original country
 		IF = {
 			limit = {
 				FROM = { NOT = { original_tag = GER } }
 			}
 			FROM = { NOT = { has_war_with = GER } }
 		}
 	}
 }

#####################

 ## #  # ### ###   ## 
#   #  #  #  #  # #   
 #  ####  #  ###   #  
  # #  #  #  #      # 
##  #  # ### #    ##  
 
#####################

HUN_ganz_danubius_organization = { 
	include = generic_escort_ship_organization
	icon = GFX_idea_HUN_ganz_danubius
	allowed = { 
		original_tag = HUN
		has_dlc = "Arms Against Tyranny"
	}
	available = {
		IF = {
			limit = { 
				AND = {
					has_dlc = "Death or Dishonor" 
					NOT = {
						has_dlc = "Gotterdammerung"
					}
				}
			}
			owner = { has_completed_focus = HUN_naval_warfare }
		}

		IF = {
			limit = { 
				has_dlc = "Gotterdammerung"
			}
			owner = { has_completed_focus = wuw_HUN_enlarge_the_ganz_danubius_division }
		}
	}
}

HUN_obudai_hajogyar_organization = { 
	include = generic_refurbishment_repair_organization
	icon = GFX_idea_HUN_obudai_hajogyar
	allowed = { 
		original_tag = HUN
		has_dlc = "Arms Against Tyranny"
		has_dlc = "Gotterdammerung"
	}
	available = {
		IF = {
			limit = { 
				AND = {
					has_dlc = "Death or Dishonor" 
					NOT = {
						has_dlc = "Gotterdammerung"
					}
				}
			}
			owner = { has_completed_focus = HUN_naval_warfare }
		}

		IF = {
			limit = { 
				has_dlc = "Gotterdammerung"
			}
			owner = { has_completed_focus = wuw_HUN_reinstate_the_navy }
		}
	}
}

###########################

###  #    ##  #  # ###  ## 
#  # #   #  # ## # #   #   
###  #   #### # ## ##   #  
#    #   #  # #  # #     # 
#    ### #  # #  # ### ##  

###########################

HUN_mw_aircraft_organization = {
	include = generic_light_aircraft_organization
	icon = GFX_idea_mw_aircraft
	allowed = { 
		original_tag = HUN
		has_dlc = "Arms Against Tyranny"
	}

	available = {
		IF = {
			limit = {
				has_dlc = "Gotterdammerung"
			}
			FROM = {
				has_completed_focus = wuw_HUN_the_matyasfold_fighter_factory
			}
		}
		ELSE = {
			FROM = {
				has_completed_focus = HUN_establish_the_air_force
			}
		}
	}
}

HUN_mavag_aircraft_organization = {
	include = generic_range_focused_aircraft_organization
	icon = GFX_idea_HUN_mavag_aircraft
	allowed = { 
		original_tag = HUN
		has_dlc = "Arms Against Tyranny"
		has_dlc = "Gotterdammerung"
	}

	available = {
		FROM = {
			has_completed_focus = wuw_HUN_establish_the_mavag_aircraft_factory
		}
	}
}

HUN_mrt_aircraft_organization = {
	include = generic_multi_role_aircraft_organization
	icon = GFX_idea_HUN_mrt_aircraft
	allowed = { 
		original_tag = HUN
		has_dlc = "Arms Against Tyranny"
	}

	initial_trait = {
		name = HUN_mio_trait_aircraft_production_plant
		
		limit_to_equipment_type = { 
			mio_cat_eq_all_small_plane
			mio_cat_eq_all_medium_plane
			mio_cat_eq_all_large_plane
		}
		
		equipment_bonus = {
			
		}

		production_bonus = {
			production_cost_factor = -0.05
			production_resource_need_factor = -0.1
			production_capacity_factor = 0.05
		}
	}
}

################################### 

#   #  ##  ### ### ###  ### ### #   
## ## #  #  #  #   #  #  #  #   #   
# # # ####  #  ##  ###   #  ##  #   
#   # #  #  #  #   #  #  #  #   #   
#   # #  #  #  ### #  # ### ### ### 


###################################

HUN_femaru_fegyver_es_gepgyar_organization = {
	include = generic_infantry_equipment_organization
	icon = GFX_idea_HUN_femaru_fegyver_es_gepgyar
	allowed = { 
		original_tag = HUN
		has_dlc = "Arms Against Tyranny"
	}
}

HUN_danuvia_inf_organization = {
	include = generic_support_equipment_organization
	icon = GFX_idea_HUN_dunai_gepgyar
	allowed = { 
		original_tag = HUN
		has_dlc = "Arms Against Tyranny"
	}

	available = {
		IF = {
			limit = {
				has_dlc = "Gotterdammerung"
			}
			FROM = {
				has_completed_focus = wuw_HUN_danuvia_submachine_guns
			}
		}
		ELSE = {
			FROM = {
				has_completed_focus = HUN_danuvia_submachine_guns
			}
		}
	}

	initial_trait = {
		name = HUN_mio_trait_army_ammunition_and_wepaons_works
		
		limit_to_equipment_type = { 
			infantry_equipment 
		}
		
		equipment_bonus = {
			reliability = 0.05
			breakthrough = 0.03
		}

		production_bonus = {
			production_cost_factor = -0.05
		}
	}

	add_trait = { 
		token = HUN_mio_trait_danuvia_two_part_lever_delayed_blowback_bolt
		name = HUN_mio_trait_danuvia_two_part_lever_delayed_blowback_bolt
		icon = GFX_generic_mio_department_icon_infantry_quality
		special_trait_background = yes

		relative_position_id = generic_mio_trait_anti_tank_rifle

		all_parents = { generic_mio_trait_anti_tank_rifle }

		position = { x = -1 y = 1 }

		visible = {
			FROM = { original_tag = HUN }
		}
		
		available = {
		}

		limit_to_equipment_type = { infantry_equipment }
		
		equipment_bonus = {
			reliability = 0.05
			soft_attack = 0.05
			breakthrough = 0.05
		}

	}

	add_trait = { 
		token = HUN_mio_trait_danuvia_improved_stock
		name = HUN_mio_trait_danuvia_improved_stock
		icon = GFX_generic_mio_department_icon_infantry_quality
		special_trait_background = yes

		relative_position_id = HUN_mio_trait_danuvia_two_part_lever_delayed_blowback_bolt

		all_parents = { HUN_mio_trait_danuvia_two_part_lever_delayed_blowback_bolt }

		position = { x = 0 y = 1 }

		visible = {
			FROM = { original_tag = HUN }
		}
		
		available = {
		}

		limit_to_equipment_type = { infantry_equipment }
		
		equipment_bonus = {
			reliability = 0.05
			soft_attack = 0.05
		}

	}

	add_trait = { 
		token = HUN_mio_trait_heavy_mauser_rounds
		name = HUN_mio_trait_heavy_mauser_rounds
		icon = GFX_generic_mio_department_icon_infantry_quality
		special_trait_background = yes

		relative_position_id = HUN_mio_trait_danuvia_improved_stock

		all_parents = { HUN_mio_trait_danuvia_improved_stock }

		position = { x = 0 y = 1 }

		visible = {
			FROM = { original_tag = HUN }
		}
		
		available = {
		}

		limit_to_equipment_type = { infantry_equipment }
		
		equipment_bonus = {
			breakthrough = 0.1
			hard_attack = 0.1
		}

	}

	add_trait = { 
		token = HUN_mio_trait_danuvia_motorcycles
		name = HUN_mio_trait_danuvia_motorcycles
		icon = GFX_generic_mio_department_icon_support_production
		special_trait_background = yes

		relative_position_id = generic_mio_trait_pontoons

		all_parents = { generic_mio_trait_pontoons }

		position = { x = 0 y = 1 }

		visible = {
			FROM = { original_tag = HUN }
		}
		
		available = {
		}

		limit_to_equipment_type = { support_equipment }
		
		equipment_bonus = {
			build_cost_ic = -0.15
		}

	}

}

HUN_digep_artillery = {
	include = generic_artillery_organization
	icon = GFX_idea_HUN_digep_artillery
	
	allowed = {	
		original_tag = HUN
		has_dlc = "Arms Against Tyranny"
		has_dlc = "Gotterdammerung"
	}

	available = {
	}

	visible = {
		FROM = { original_tag = HUN }
	}

}

HUN_mwg_raba_organization = {
	include = generic_motorized_mechanized_organization 
	icon = GFX_idea_HUN_mwg_raba
	allowed = {	 
		original_tag = HUN
		has_dlc = "Arms Against Tyranny"
		has_dlc = "Gotterdammerung"
	}
}




