@tank_hoesch_X = 9
@tank_hoesch_Y = 0

@aircraft_hamburger_X = 9
@aircraft_hamburger_Y = 0

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

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

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


GER_porsche_organization = {
	include = generic_heavy_tank_organization
	icon = GFX_idea_porsche
	
	allowed = {	
		OR = {
			original_tag = GER 
			AND = {
				original_tag = MEX 
				has_dlc = "Man the Guns"
			}
			NOR_AAT = yes
		}
	}

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

		IF = {
			limit = {
				FROM = { original_tag = MEX }
			}
			FROM = { is_in_faction_with = GER }
		}
		ELSE_IF = {
			limit = {
				FROM = { original_tag = NOR }
			}
			FROM = { has_completed_focus = NOR_invite_german_engineers }
		}
	}

	tree_header_text = {
		text = mio_header_engine_and_drive_system
		x = 0.5
	}

	tree_header_text = {
		text = mio_header_chassis
		x = 4
	}

	tree_header_text = {
		text = mio_header_guns_and_turret
		x = 7
	}

	override_trait = {
		token = generic_mio_trait_wide_tracks
		
		position = { x=0 y=0 }
	}

	override_trait = {
		token = generic_mio_trait_one_piece_hull_side_coverings
		
		position = { x=3 y=0 }
	}

	override_trait = {
		token = generic_mio_trait_improved_crew_ergonomics

		position = { x=0 y=2 }
	}

	override_trait = {
		token = generic_mio_trait_fully_cast_turret

		position = { x=4 y=0 }
	}

	add_trait = {
		token = GER_mio_trait_hoesch_facilities
		name = GER_mio_trait_hoesch_facilities
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=@tank_hoesch_X y=@tank_hoesch_Y }

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				NOT = { has_country_flag = GER_hoesch_facilities_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hoesch_facilities_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_involve_porsche_in_special_projects
		name = GER_mio_trait_involve_porsche_in_special_projects
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		position = { x=0 y=1 }
		relative_position_id = GER_mio_trait_hoesch_facilities

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			has_mio_size > 4
		}

		on_complete = {
			custom_effect_tooltip = {
				localization_key = available_scientist_one_line_tt
				CHARACTER = GER_ferdinand_porsche
			}
		}

		organization_modifier = {
			military_industrial_organization_research_bonus = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_multi_role_tanks
		name = GER_mio_trait_multi_role_tanks
		icon = GFX_generic_mio_department_icon_tank_heavy_tank_aa
		special_trait_background = yes

		position = { x=2 y=0 }
		relative_position_id = generic_mio_trait_one_piece_hull_side_coverings

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
		}

		equipment_bonus = {
			soft_attack = 0.05
			air_attack = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_anti_tank_specialization
		name = GER_mio_trait_anti_tank_specialization
		icon = GFX_generic_mio_department_icon_tank_heavy_tank_at
		special_trait_background = yes

		all_parents = {
            generic_mio_trait_one_piece_hull_side_coverings
            GER_mio_trait_multi_role_tanks
        }

		position = { x=1 y=1 }
		relative_position_id = generic_mio_trait_one_piece_hull_side_coverings

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
		}

		equipment_bonus = {
			hard_attack = 0.05
			ap_attack = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_unorthodox_transmission_design
		name = GER_mio_trait_unorthodox_transmission_design
		icon = GFX_generic_mio_department_icon_tank_heavy_tank_engine
		special_trait_background = yes

		all_parents = {
            generic_mio_trait_simplified_transmission_system
        }

		position = { x=-1 y=1 }
		relative_position_id = generic_mio_trait_simplified_transmission_system

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			
		}

		limit_to_equipment_type = { 
			armor
		}

		equipment_bonus = {
			maximum_speed = 0.05
			reliability = -0.02
		}

		ai_will_do = {
			base = 2
		}
	}
}

GER_henschel_organization = {
	include = generic_mobile_tank_organization
	icon = GFX_idea_henschel
	
	allowed = {	
		OR = {
			original_tag = GER 
			AND = {
				original_tag = BUL
				has_dlc = "Battle for the Bosporus"
			}
			AND = {
				original_tag = ETH
				has_dlc = "By Blood Alone"
			}
		}
	}
	
	visible = {
		IF = {
			limit = { FROM = { original_tag = ETH } }
			FROM = { has_completed_focus = ETH_invite_foreign_industrialists }
		}
	}

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

		IF = {
			limit = { 
				OR = { 
					FROM = { original_tag = BUL }
					FROM = { original_tag = ETH } 
				} 
			}
			custom_trigger_tooltip = {
				tooltip = has_invited_mio_tt
				FROM = {
					has_country_flag = has_invited_henschel_mio_flag
				}
			}
			
		}
		IF = {
			limit = { FROM = { original_tag = BUL } } 
			FROM = { 
				OR = {
					is_subject = no
					is_subject_of = GER
				}
				#is_in_faction_with = GER
				NOT = { has_completed_focus = BUL_nationalization }
			}
		}
	}

	add_trait = {
		token = GER_mio_trait_hoesch_facilities
		name = GER_mio_trait_hoesch_facilities
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=@tank_hoesch_X y=@tank_hoesch_Y }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				NOT = { has_country_flag = GER_hoesch_facilities_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hoesch_facilities_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_involve_henschel_in_special_projects
		name = GER_mio_trait_involve_henschel_in_special_projects
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		position = { x=0 y=1 }
		relative_position_id = GER_mio_trait_hoesch_facilities

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			has_mio_size > 4
		}

		on_complete = {
			custom_effect_tooltip = {
				localization_key = available_scientist_one_line_tt
				CHARACTER = GER_erwin_aders
			}
		}

		organization_modifier = {
			military_industrial_organization_research_bonus = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}
}

GER_man_organization = {
	include = generic_medium_tank_organization
	icon = GFX_idea_GER_MAN
	
	allowed = {	
		OR = {
			original_tag = GER 
			AND = {
				original_tag = GRE
				has_dlc = "Battle for the Bosporus"
			}
		}
	}
	
	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 } }
		}
	}

	tree_header_text = {
		text = mio_header_design
		x = 1
	}

	tree_header_text = {
		text = mio_header_armor
		x = 4
	}

	tree_header_text = {
		text = mio_header_engines
		x = 7
	}

	override_trait = {
		token = generic_mio_trait_armor_steel_working

		position = { x=3 y=0 }
	}

	add_trait = {
		token = GER_mio_trait_hoesch_facilities
		name = GER_mio_trait_hoesch_facilities
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=@tank_hoesch_X y=@tank_hoesch_Y }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				NOT = { has_country_flag = GER_hoesch_facilities_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hoesch_facilities_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_high_velocity_armament
		name = GER_mio_trait_high_velocity_armament
		icon = GFX_generic_mio_department_icon_tank_general_at
		special_trait_background = yes

		position = { x=1 y=2 }
		relative_position_id = generic_mio_trait_spaced_armor

		all_parents = { generic_mio_trait_improved_gun_metallurgy }

		any_parent = { generic_mio_trait_spaced_armor generic_mio_trait_crew_survival_layout generic_mio_trait_sloped_side_armor }
		
		available = {
		}

		equipment_bonus = {
			ap_attack = 0.05
			hard_attack = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_schachtellaufwerk 
		name = GER_mio_trait_schachtellaufwerk 
		icon = GFX_generic_mio_department_icon_tank_medium_tank_quality
		special_trait_background = yes

		position = { x=-1 y=1 }
		relative_position_id = generic_mio_trait_improved_suspension

		all_parents = { generic_mio_trait_improved_suspension }

		
		available = {
		}

		equipment_bonus = {
			breakthrough = 0.03
			reliability = 0.03
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_mobility_design_philosophy
		name = GER_mio_trait_mobility_design_philosophy 
		icon = GFX_generic_mio_department_icon_tank_medium_tank_engine
		special_trait_background = yes

		position = { x=1 y=1 }
		relative_position_id = generic_mio_trait_improved_suspension

		all_parents = { generic_mio_trait_improved_suspension }

		
		available = {
		}

		equipment_bonus = {
			maximum_speed = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}
}

#Alkett
GER_alkett_organization = {
	include = generic_assault_guns_organization
	icon = GFX_idea_GER_alkett
	
	allowed = {	
		original_tag = GER 
	}

	tree_header_text = {
		text = mio_header_light_tank_department
		x = 1
	}

	tree_header_text = {
		text = mio_header_medium_tank_department
		x = 4
	}

	tree_header_text = {
		text = mio_header_heavy_tank_department
		x = 7
	}

	override_trait = {
		token = generic_mio_medium_assault_gun_rocket_tubes

		mutually_exclusive = { GER_mio_trait_panzerjager }	
	}

	#override_trait = {
	#	token = generic_mio_trait_fully_cast_turret_assault_gun
#
	#	position = { x = 0 y = 2 }	
	#}
	
	add_trait = {
		token = GER_mio_trait_hoesch_facilities
		name = GER_mio_trait_hoesch_facilities
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes
		
		position = { x=@tank_hoesch_X y=@tank_hoesch_Y }  

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				NOT = { has_country_flag = GER_hoesch_facilities_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hoesch_facilities_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_panzerjager
		name = GER_mio_trait_panzerjager
		icon = GFX_generic_mio_department_icon_tank_general_at
		special_trait_background = yes 

		position = { x = 0 y = 1 }
		relative_position_id = generic_mio_medium_assault_gun_75_mm_43M_tank_gun

		all_parents = { generic_mio_medium_assault_gun_75_mm_43M_tank_gun }

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				has_tech = antitank2
			}
		}

		mutually_exclusive = { generic_mio_medium_assault_gun_rocket_tubes }

		limit_to_equipment_type = { medium_tank_artillery_chassis heavy_tank_artillery_chassis }

		equipment_bonus = {
			ap_attack = 0.05
			hard_attack = 0.1
			reliability = -0.05
		}

		ai_will_do = {
			base = 2
		}
	}
	
	add_trait = {
		token = GER_mio_trait_armored_superstructure_specialist
		name = GER_mio_trait_armored_superstructure_specialist
		icon = GFX_generic_mio_department_icon_tank_general_armor
		special_trait_background = yes 

		position = { x = 9 y = 1 }

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
		}

		equipment_bonus = {
			armor_value = 0.05
			defense = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_sturmhaubitze
		name = GER_mio_trait_sturmhaubitze
		icon = GFX_generic_mio_department_icon_tank_general_at
		special_trait_background = yes 

		position = { x = 9 y = 2 }
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			#TODO_Danne fix this with a flag or something! GER should integrate CZE industries or something before doing this
			FROM = {
				OR = {
					has_completed_focus = GER_fate_of_czechoslovakia
					has_completed_focus = GER_integrate_czechoslovakia
					has_completed_focus = GER_carve_up_czechoslovakia
				}
			}
		}

		limit_to_equipment_type = { medium_tank_artillery_chassis heavy_tank_artillery_chassis }

		equipment_bonus = {
			soft_attack = 0.03
			hard_attack = 0.05
			breakthrough = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

}

#Benz 
GER_daimler_benz_organization = {
	include = generic_tank_organization
	icon = GFX_idea_GER_daimler_benz
	
	allowed = {	
		OR = {
			original_tag = GER 
			AND = {
				original_tag = BRA
				has_dlc = "Trial of Allegiance"
			}
			AND = {
				original_tag = BEL
				has_dlc = "Gotterdammerung"
			}
		}
	}

	available = {
		IF = {
			limit = {
				FROM = { NOT = { original_tag = GER } }
			}
			FROM = { NOT = { has_war_with = GER } }
		}
		IF = {
			limit = {
				FROM = {
					original_tag = BRA
				}
			}
			FROM = {
				has_completed_focus = BRA_german_tanks
			}
		}

		IF = {
			limit = {
				FROM = {
					original_tag = BEL
				}
			}
			FROM = {
				has_completed_focus = BEL_invite_german_tank_organization
			}
		}
	}

	tree_header_text = {
		text = mio_header_tank_construction
		x = 2
	}

	tree_header_text = {
		text = mio_header_equipment_and_specialization
		x = 6
	}

	tree_header_text = {
		text = mio_header_armor
		x = 8
	}

	initial_trait = {
		organization_modifier = {
			military_industrial_organization_research_bonus = 0.05
		}
	}

	override_trait = {
		token = generic_mio_trait_simplified_suspension
		
		position = { x=0 y=0 }
	}

	override_trait = {
    	token = generic_mio_trait_improved_tooling

    	relative_position_id = GER_mio_trait_versatile_chassis
		
		all_parents = { generic_mio_trait_improved_tracks generic_mio_trait_command_upgrades GER_mio_trait_versatile_chassis }

    	position = { x=0 y=1 }
  	}
    #override_trait = {
    #    token = generic_mio_trait_crew_ergonomics
    #    position = { x=3 y=0 }
    #}

	add_trait = {  
		token = GER_mio_trait_hotrolled_armor
		name = GER_mio_trait_hotrolled_armor
		icon = GFX_generic_mio_department_icon_tank_general_technology
		special_trait_background = yes

		position = { x=8 y=0 }  
		
		limit_to_equipment_type = { light_tank_chassis medium_tank_chassis }
		production_bonus = {
			production_efficiency_cap_factor = 0.05
			production_efficiency_gain_factor = 0.05
		}

		ai_will_do = {
			base = 2
			modifier = {
				factor = 1.5
				date > 1937.1.1
			}
		}
	}

	add_trait = {
		token = GER_mio_trait_multilayer_armour
		name = GER_mio_trait_multilayer_armour
		icon = GFX_generic_mio_trait_icon_armor_value
		special_trait_background = yes

		position = { x=0 y=2 }
		relative_position_id = GER_mio_trait_hotrolled_armor
		
		any_parent = { GER_mio_trait_hotrolled_armor }
		
		limit_to_equipment_type = { light_tank_chassis medium_tank_chassis }
		
		equipment_bonus = {
			armor_value = 0.1
		} 

		ai_will_do = {
			base = 2
			modifier = {
				factor = 1.5
				date > 1937.1.1
			}
		}
	}

	add_trait = {
		token = GER_mio_trait_hoesch_facilities
		name = GER_mio_trait_hoesch_facilities
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=@tank_hoesch_X y=@tank_hoesch_Y }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				NOT = { has_country_flag = GER_hoesch_facilities_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hoesch_facilities_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_versatile_chassis
		name = GER_mio_trait_versatile_chassis
		icon = GFX_generic_mio_department_icon_tank_general_production
		special_trait_background = yes

		relative_position_id = generic_mio_trait_standardized_components
		
		all_parents = {  generic_mio_trait_standardized_components }

		position = { x=0 y=1 }  
		
		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
			modifier = {
				factor = 1.5
				date > 1937.1.1
			}
		}
	}

	add_trait = {  
		token = GER_mio_trait_tungsten_tipped_rounds
		name = GER_mio_trait_tungsten_tipped_rounds
		icon = GFX_generic_mio_department_icon_tank_general_at
		special_trait_background = yes

		relative_position_id = generic_mio_trait_long_barreled_guns
		
		all_parents = {  generic_mio_trait_long_barreled_guns }

		position = { x=0 y=1 }  

		available = {
            FROM = {
                has_tech = antitank2
            }
        }
		
		equipment_bonus = {
			ap_attack = 0.05
			hard_attack = 0.05
		}

		ai_will_do = {
			base = 2
			modifier = {
				factor = 1.5
				date > 1937.1.1
			}
		}
	}
}


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

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

GER_deschimag_organization = {
	include = generic_escort_ship_organization
	icon = GFX_idea_GER_deschimag

	override_trait = {
		token = generic_mio_trait_fleet_escorts
		
		position = { x=4 y=0 }
	}

	override_trait = {
		token = generic_mio_trait_anti_air_ships
		
		position = { x=-2 y=2 }
	}
	
	allowed = {	
		original_tag = GER 
	}

	add_trait = {  
		token = GER_mio_trait_krupp_contacts
		name = GER_mio_trait_krupp_contacts
		icon = GFX_generic_mio_department_icon_ship_screen_ship_quality
		special_trait_background = yes

		relative_position_id = generic_mio_trait_escort_in_force

		any_parent = { generic_mio_trait_anti_air_ships generic_mio_trait_escort_in_force }

		position = { x=0 y=1 } 

		#available = {
		#	FROM = {
		#		has_completed_focus = GER_high_seas_fleet
		#	}
		#}

		equipment_bonus = {
			lg_attack = 0.05
			lg_armor_piercing = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_armored_design
		name = GER_mio_trait_armored_design
		icon = GFX_generic_mio_trait_icon_armor_value
		special_trait_background = yes

		relative_position_id = GER_mio_trait_krupp_contacts

		all_parents = { GER_mio_trait_krupp_contacts }

		position = { x=0 y=1 } 

		#available = {
		#	FROM = {
		#		has_completed_focus = GER_high_seas_fleet
		#	}
		#}

		equipment_bonus = {
			armor_value = 0.07
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_shipyard_conglomerate
		name = GER_mio_trait_shipyard_conglomerate
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		relative_position_id = generic_mio_trait_fleet_escorts 

		position = { x=3 y=0 } 

		#available = {
		#	FROM = {
		#		has_completed_focus = GER_u_boat_efforts
		#	}
		#}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}
}

GER_germaniawerft_organization = {
	include = generic_battle_line_ship_organization
	icon = GFX_idea_germaniawerft

	override_trait = {
		token = generic_mio_trait_internal_armor_belt
		
		position = { x=1 y=0 }
	}

	override_trait = {
		token = generic_mio_trait_advanced_armor_design
		
		position = { x=0 y=2 }
	}

	override_trait = {
		token = generic_mio_trait_anti_air_layout
		
		position = { x=3 y=0 }
	}
	
	allowed = {	
		original_tag = GER 
	}

	add_trait = {  
		token = GER_mio_trait_history_of_battleships
		name = GER_mio_trait_history_of_battleships
		icon = GFX_generic_mio_department_icon_ship_capital_ship_production
		special_trait_background = yes

		relative_position_id = generic_mio_trait_internal_armor_belt

		position = { x=1 y=0 }  

		available = {
            FROM = {
                has_completed_focus = GER_plan_z
            }
        }

        limit_to_equipment_type = { mio_cat_eq_all_battleship }

      	equipment_bonus = {
			hg_attack = 0.05
			build_cost_ic = -0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_krupp_guns
		name = GER_mio_trait_krupp_guns
		icon = GFX_generic_mio_department_icon_ship_capital_ship_weapons
		special_trait_background = yes

		relative_position_id = GER_mio_trait_history_of_battleships

		all_parents = { GER_mio_trait_history_of_battleships }
		position = { x=0 y=1 }  

		available = {
			FROM = {
				has_completed_focus = GER_grosskampfschiff_construction
			}
		}

      	equipment_bonus = {
			hg_attack = 0.05
			lg_attack = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_h_class_battleships
		name = GER_mio_trait_h_class_battleships
		icon = GFX_generic_mio_department_icon_ship_capital_ship_quality
		special_trait_background = yes

		relative_position_id = GER_mio_trait_krupp_guns

		all_parents = { GER_mio_trait_krupp_guns }

		position = { x=0 y=1 }  

		available = {
			FROM = {
				has_completed_focus = GER_grosskampfschiff_construction
			}
		}

        limit_to_equipment_type = { mio_cat_eq_all_battleship }

      	equipment_bonus = {
			hg_armor_piercing = 0.05
			naval_speed = 0.05
			build_cost_ic = -0.05
		}

		ai_will_do = {
			base = 2
		}
	}
}

GER_blohm_und_voss_organization = {
	include = generic_raider_ship_organization
	icon = GFX_idea_blohm_und_voss

	override_trait = {
		token = generic_mio_trait_unescorted_raider_requirements
		
		position = { x=2 y=1 }
	}
	override_trait = {
		token = generic_mio_trait_raider_escort_requirements
		
		position = { x=0 y=1 }
	}
	
	allowed = {	
		original_tag = GER 
	}

	add_trait = {  
		token = GER_mio_trait_heavy_raiders
		name = GER_mio_trait_heavy_raiders
		icon = GFX_generic_mio_department_icon_ship_screen_ship_engine
		special_trait_background = yes

		relative_position_id = generic_mio_trait_raiding_capital_ships

		all_parents = { generic_mio_trait_raiding_capital_ships }

		position = { x=-2 y=1 }  

		available = {
            FROM = {
                has_completed_focus = GER_cruiser_warfare
            }
        }

        limit_to_equipment_type = { ship_hull_cruiser }

      	equipment_bonus = {
			surface_visibility = -0.05
			naval_speed = 0.05
			naval_range = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_o_class_battlecruisers
		name = GER_mio_trait_o_class_battlecruisers
		icon = GFX_generic_mio_department_icon_ship_screen_ship_engine
		special_trait_background = yes

		relative_position_id = GER_mio_trait_heavy_raiders

		all_parents = { GER_mio_trait_heavy_raiders }

		position = { x=0 y=1 }  

		available = {
			FROM = {
				has_completed_focus = GER_panzerschiff_raiders
			}
		}

        limit_to_equipment_type = { mio_cat_eq_all_cruiser }

      	equipment_bonus = {
			hg_armor_piercing = 0.05
			naval_speed = 0.05
			build_cost_ic = -0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_u_boat_yards
		name = GER_mio_trait_u_boat_yards
		icon = GFX_generic_mio_department_icon_ship_submarine_production
		special_trait_background = yes

		relative_position_id = generic_mio_trait_raiding_submarines

		all_parents = { generic_mio_trait_raiding_submarines }

		position = { x=2 y=1 }  

		available = {
            FROM = {
                has_completed_focus = GER_u_boat_efforts
            }
        }

        limit_to_equipment_type = { submarine }

        equipment_bonus = {
			build_cost_ic = -0.1		
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_high_test_peroxide
		name = GER_mio_trait_high_test_peroxide
		icon = GFX_generic_mio_department_icon_ship_submarine_engine
		special_trait_background = yes

		relative_position_id = GER_mio_trait_u_boat_yards

		all_parents = { GER_mio_trait_u_boat_yards }

		position = { x=0 y=1 }  

        limit_to_equipment_type = { submarine }

        equipment_bonus = {
			naval_speed = 0.1		
		}

		ai_will_do = {
			base = 2
		}
	}
}

GER_hdw_organization = {
	include = generic_submarine_organization
	icon = GFX_idea_GER_hdw 
	
	allowed = {	
		original_tag = GER 
	}

	add_trait = {  
		token = GER_mio_trait_ocean_u_boats
		name = GER_mio_trait_ocean_u_boats
		icon = GFX_generic_mio_department_icon_ship_submarine_engine
		special_trait_background = yes

		relative_position_id = generic_mio_trait_long_range_raiding

		all_parents = { generic_mio_trait_long_range_raiding }

		position = { x=0 y=1 }  

		available = {
			FROM = {
				has_completed_focus = GER_u_boat_efforts
			}
		}

        equipment_bonus = {
			sub_visibility = -0.03
			naval_range = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_kilian_submarine_bunker
		name = GER_mio_trait_kilian_submarine_bunker
		icon = GFX_generic_mio_department_icon_ship_submarine_production
		special_trait_background = yes

		relative_position_id = generic_mio_trait_submarine_mass_production

		all_parents = { generic_mio_trait_submarine_mass_production }

		position = { x=0 y=1 }  

		available = {
			FROM = {
				has_completed_focus = GER_u_boat_efforts
			}
		}

        production_bonus = {
			production_capacity_factor = 0.05
		}

		equipment_bonus = {
			build_cost_ic = -0.05		
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_saddle_tanks
		name = GER_mio_trait_saddle_tanks
		icon = GFX_generic_mio_department_icon_ship_submarine_quality
		special_trait_background = yes

		position = { x=9 y=0 }  

		equipment_bonus = {
			naval_range = 0.07
			build_cost_ic = 0.02	
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_excellent_diving_performance
		name = GER_mio_trait_excellent_diving_performance
		icon = GFX_generic_mio_department_icon_ship_submarine_survivability
		special_trait_background = yes

		relative_position_id = GER_mio_trait_saddle_tanks

		all_parents = { GER_mio_trait_saddle_tanks }

		position = { x=0 y=1 } 

		equipment_bonus = {
			sub_visibility = -0.05	
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_atlantic_raiders
		name = GER_mio_trait_atlantic_raiders
		icon = GFX_generic_mio_department_icon_ship_submarine_engine
		special_trait_background = yes

		relative_position_id = GER_mio_trait_excellent_diving_performance

		all_parents = { GER_mio_trait_excellent_diving_performance }

		position = { x=0 y=1 } 

		available = {
			FROM = {
				has_completed_focus = GER_u_boat_efforts
			}
		}

		equipment_bonus = {
			sub_visibility = -0.03
			naval_range = 0.05
			naval_speed = 0.03
		}

		ai_will_do = {
			base = 2
		}
	}
}

GER_deutsche_werke_organization = {
	include = generic_task_force_ship_organization
	icon = GFX_idea_GER_deutsche_werke

	override_trait = {
		token = generic_mio_trait_primary_fire_director_control
		
		position = { x=2 y=0 }
	}

	override_trait = {
		token = generic_mio_trait_splinter_protection

		all_parents = { GER_mio_trait_raider_doctrine }

		relative_position_id = GER_mio_trait_raider_doctrine 
		
		position = { x=0 y=1 }
	}

	override_trait = {
		token = generic_mio_trait_underway_replenishment_equipment

		position = { x=0 y=2 }
	}
	
	allowed = {	
		original_tag = GER 
	}

	add_trait = {  
		token = GER_mio_trait_foreign_influences
		name = GER_mio_trait_foreign_influences
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		relative_position_id = generic_mio_trait_primary_fire_director_control 

		

		position = { x=2 y=0 } 

		#available = {
		#	FROM = {
		#		has_completed_focus = GER_u_boat_efforts
		#	}
		#}

		organization_modifier = {
			military_industrial_organization_research_bonus = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_raider_doctrine
		name = GER_mio_trait_raider_doctrine
		icon = GFX_generic_mio_department_icon_ship_screen_ship_quality
		special_trait_background = yes

		position = { x=1 y=1 }
		relative_position_id = generic_mio_trait_long_range_cruising
		
		any_parent = { generic_mio_trait_long_range_cruising generic_mio_trait_high_speed_cruising }

		#available = {
		#	FROM = {
		#		has_completed_focus = GER_u_boat_efforts
		#	}
		#}

		limit_to_equipment_type = { screen_ship }

		equipment_bonus = {
			naval_speed = 0.05
			surface_visibility = -0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_fast_raiders
		name = GER_mio_trait_fast_raiders
		icon = GFX_generic_mio_department_icon_ship_screen_ship_engine
		special_trait_background = yes

		position = { x=1 y=1 }
		relative_position_id = generic_mio_trait_splinter_protection
		
		any_parent = { generic_mio_trait_splinter_protection  }

		#available = {
		#	FROM = {
		#		has_completed_focus = GER_u_boat_efforts
		#	}
		#}

		limit_to_equipment_type = { screen_ship }

		equipment_bonus = {
			naval_speed = 0.05
			naval_range = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_carrier_raiders
		name = GER_mio_trait_carrier_raiders
		icon = GFX_generic_mio_department_icon_ship_carrier_engine
		special_trait_background = yes

		position = { x=0 y=1 }
		relative_position_id = GER_mio_trait_fast_raiders
		
		all_parents = { GER_mio_trait_fast_raiders  }

		#available = {
		#	FROM = {
		#		has_completed_focus = GER_u_boat_efforts
		#	}
		#}

		limit_to_equipment_type = { mio_cat_eq_all_carrier }

		equipment_bonus = {
			naval_speed = 0.05
			naval_range = 0.05
			surface_visibility = -0.05
		}

		ai_will_do = {
			base = 2
		}
	}
}

GER_kriegsmarinewerft_wilhelmshaven_organization = {
	include = generic_refurbishment_repair_organization
	icon = GFX_idea_GER_kriegsmarinewerft_wilhelmshaven
	
	allowed = {	
		original_tag = GER 
	}

	add_trait = {  
		token = GER_mio_trait_historical_shipyard
		name = GER_mio_trait_historical_shipyard
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		position = { x=8 y=0 }
		
		available = {
			FROM = {
				has_completed_focus = GER_expand_kriegsmarinewerft
			}
		}

		production_bonus = {
			production_capacity_factor = 0.07
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_upgrade_panzerschiffs
		name = GER_mio_trait_upgrade_panzerschiffs
		icon = GFX_generic_mio_department_icon_ship_screen_ship_engine
		special_trait_background = yes

		position = { x=9 y=0 }
		
		#available = {
		#	FROM = {
		#		has_completed_focus = GER_u_boat_efforts
		#	}
		#}

		limit_to_equipment_type = { ship_hull_cruiser }

		equipment_bonus = {
			naval_speed = 0.05
			surface_visibility = -0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {  
		token = GER_mio_trait_innovative_battleship_designs
		name = GER_mio_trait_innovative_battleship_designs
		icon = GFX_generic_mio_department_icon_ship_capital_ship_engine
		special_trait_background = yes

		relative_position_id = GER_mio_trait_upgrade_panzerschiffs
		
		all_parents = { GER_mio_trait_upgrade_panzerschiffs }

		position = { x=0 y=1 }
		
		#available = {
		#	FROM = {
		#		has_completed_focus = GER_u_boat_efforts
		#	}
		#}

		limit_to_equipment_type = { capital_ship }

		equipment_bonus = {
			naval_speed = 0.05
			surface_visibility = -0.03
			naval_torpedo_enemy_critical_chance_factor = -0.05
		}

		ai_will_do = {
			base = 2
		}
	}
}

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

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

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

GER_messerschmitt_organization = {
	include = generic_light_aircraft_organization
	icon = GFX_idea_messerschmitt
	
	allowed = {	
		OR = {
			original_tag = GER
			NOR_AAT = yes 
		}
	}

	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 } }
		}
		
		if = {
			limit = {
				FROM = { original_tag = NOR }
			}
			FROM = { has_completed_focus = NOR_invite_german_engineers }
		}
	}

	add_trait = {
		token = GER_mio_trait_maintenance_first_design
		name = GER_mio_trait_maintenance_first_design

		icon = GFX_generic_mio_department_icon_plane_fighter_line_efficiency
		special_trait_background = yes
		
		position = { x=-2 y=1 }
		relative_position_id = generic_mio_trait_expanded_production_facilities

		all_parents = { generic_mio_trait_expanded_production_facilities }

		equipment_bonus = {
			reliability = 0.05
		}

		production_bonus = {
			production_efficiency_gain_factor = 0.05
		}
	}

	add_trait = {
		token = GER_mio_trait_fuselage_based_weapons
		name = GER_mio_trait_fuselage_based_weapons

		icon = GFX_generic_mio_trait_icon_anti_air_attack
		special_trait_background = yes
		
		position = { x=1 y=1 }
		relative_position_id = generic_mio_trait_gun_pods

		any_parent = { generic_mio_trait_heavier_airframe generic_mio_trait_maximum_wing_loads generic_mio_trait_gun_pods }

		equipment_bonus = {
			air_attack = 0.05
			air_agility = 0.05
		} 
	}

	add_trait = {
		token = GER_mio_trait_hamburger_flugzeugbau
		name = GER_mio_trait_hamburger_flugzeugbau
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=@aircraft_hamburger_X y=@aircraft_hamburger_Y }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				mio:GER_blohm_und_voss_organization = {
					has_mio_size > 4
				}
				NOT = { has_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_aerodynamic_research_insitute
		name = GER_mio_trait_aerodynamic_research_insitute
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		relative_position_id = generic_mio_trait_advanced_aerodynamics

		position = { x = 2 y = 0 }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				has_completed_focus = GER_aerodynamic_research_institute
				NOT = { has_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag
			}
		}

		organization_modifier = {
		    military_industrial_organization_research_bonus = 0.1
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_amerikabomber_learnings
		name = GER_mio_trait_amerikabomber_learnings

		icon = GFX_generic_mio_department_icon_plane_medium_engine
		special_trait_background = yes
		
		position = { x=1 y=4 }
		relative_position_id = GER_mio_trait_aerodynamic_research_insitute

		visible = {
			has_dlc = "Gotterdammerung"
		}

		available = {
			owner = {
				has_completed_focus = GER_amerikabomber
				has_country_flag = GER_amerikabomber_messerschmitt_flag
			}
		}

		limit_to_equipment_type = { mio_cat_eq_only_light_fighter }

		equipment_bonus = {
			air_range = 0.1
		} 
	}
}

GER_junkers_organization = {
	include = generic_cas_aircraft_organization
	icon = GFX_idea_junkers
	
	allowed = {	 
		OR = {
			original_tag = GER 
			AND = {
				original_tag = ETH
				has_dlc = "By Blood Alone"
			}
		}
	}
	
	visible = {
		IF = {
			limit = { FROM = { original_tag = ETH } }
			FROM = { has_completed_focus = ETH_invite_foreign_industrialists }
		}
	}

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

		IF = {
			limit = {
				FROM = { NOT  = { original_tag = GER } }
			}
			custom_trigger_tooltip = {
				tooltip = has_invited_mio_tt
				FROM = {
					has_country_flag = has_invited_GER_junkers_organization_flag
				}
			}
		}
	}

	add_trait = {
		token = GER_mio_trait_psychological_warfare
		name = GER_mio_trait_psychological_warfare

		icon = GFX_generic_mio_trait_icon_fuel_consumption
		special_trait_background = yes
		
		position = { x=2 y=0 }
		relative_position_id = generic_mio_trait_reinforced_wings

		equipment_bonus = {
			fuel_consumption = -0.05
		} 
	}

	add_trait = {
		token = GER_mio_trait_90_degree_dives
		name = GER_mio_trait_90_degree_dives

		icon = GFX_generic_mio_department_icon_plane_cas_quality
		special_trait_background = yes
		
		position = { x=0 y=1 }
		relative_position_id = generic_mio_trait_automatic_pull_out
		all_parents = { generic_mio_trait_automatic_pull_out }

		equipment_bonus = {
			air_ground_attack = 0.05
		} 
	}

	add_trait = {
		token = GER_mio_trait_hamburger_flugzeugbau
		name = GER_mio_trait_hamburger_flugzeugbau
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=@aircraft_hamburger_X y=@aircraft_hamburger_Y }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				mio:GER_blohm_und_voss_organization = {
					has_mio_size > 4
				}
				NOT = { has_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_aerodynamic_research_insitute
		name = GER_mio_trait_aerodynamic_research_insitute
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		relative_position_id = generic_mio_trait_reinforced_wings

		position = { x = 2 y = 1 }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				has_completed_focus = GER_aerodynamic_research_institute
				NOT = { has_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag
			}
		}

		organization_modifier = {
		    military_industrial_organization_research_bonus = 0.1
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_amerikabomber_learnings
		name = GER_mio_trait_amerikabomber_learnings

		icon = GFX_generic_mio_department_icon_plane_medium_engine
		special_trait_background = yes
		
		position = { x=1 y=3 }
		relative_position_id = GER_mio_trait_aerodynamic_research_insitute

		visible = {
			has_dlc = "Gotterdammerung"
		}

		available = {
			owner = {
				has_completed_focus = GER_amerikabomber
				has_country_flag = GER_amerikabomber_junkers_flag
			}
		}

		limit_to_equipment_type = { small_plane_cas_airframe }

		equipment_bonus = {
			air_range = 0.05
			air_ground_attack = 0.05
		}
	}
}

GER_focke_wulf_organization = {
	include = generic_range_focused_aircraft_organization
	icon = GFX_idea_focke_wulf
	
	allowed = {	
		original_tag = GER 
	}

	override_trait = {
		token = generic_mio_trait_extra_cargo_doors

		position = { x=8 y=0 }
	}

	add_trait = {
		token = GER_mio_trait_work_horse_design_philosophy
		name = GER_mio_trait_work_horse_design_philosophy

		icon = GFX_generic_mio_department_icon_plane_medium_engine
		special_trait_background = yes
		
		position = { x=0 y=1 }
		relative_position_id = GER_mio_trait_hamburger_flugzeugbau

		limit_to_equipment_type = { mio_cat_eq_all_small_plane mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			reliability = 0.05
			air_defence = 0.03
		} 
	}

	add_trait = {
		token = GER_mio_trait_aerodynamic_research_insitute
		name = GER_mio_trait_aerodynamic_research_insitute
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		relative_position_id = GER_mio_trait_work_horse_design_philosophy

		position = { x = 0 y = 1 }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				has_completed_focus = GER_aerodynamic_research_institute
				NOT = { has_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag
			}
		}

		organization_modifier = {
		    military_industrial_organization_research_bonus = 0.1
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_bomber_destroyer
		name = GER_mio_trait_bomber_destroyer

		icon = GFX_generic_mio_department_icon_plane_light_combat
		special_trait_background = yes
		
		position = { x=-0 y=1 }
		relative_position_id = generic_mio_trait_strafing_techniques
		all_parents = { generic_mio_trait_strafing_techniques }

		limit_to_equipment_type = { mio_cat_eq_all_small_plane mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_attack = 0.05
			air_agility = 0.03
		}
	}

	add_trait = {
		token = GER_mio_trait_radial_engine
		name = GER_mio_trait_radial_engine

		icon = GFX_generic_mio_trait_icon_air_agility
		special_trait_background = yes
		
		position = { x=-0 y=1 }
		relative_position_id = GER_mio_trait_long_nose_design
		all_parents = { GER_mio_trait_long_nose_design }

		limit_to_equipment_type = { mio_cat_eq_all_small_plane }

		equipment_bonus = {
			air_defence = 0.05
			air_agility = 0.05
		}
	}

	add_trait = {
		token = GER_mio_trait_long_nose_design
		name = GER_mio_trait_long_nose_design

		icon = GFX_generic_mio_department_icon_plane_light_engine
		special_trait_background = yes
		
		position = { x=0 y=1 }
		relative_position_id = generic_mio_trait_large_rudders_and_flaps
		all_parents = { generic_mio_trait_large_rudders_and_flaps }

		limit_to_equipment_type = { mio_cat_eq_all_small_plane }

		equipment_bonus = {
			air_range = 0.05
			air_defence = 0.05
		} 
	} 

	add_trait = {
		token = GER_mio_trait_hamburger_flugzeugbau
		name = GER_mio_trait_hamburger_flugzeugbau
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=@aircraft_hamburger_X y=@aircraft_hamburger_Y }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				mio:GER_blohm_und_voss_organization = {
					has_mio_size > 4
				}
				NOT = { has_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_amerikabomber_learnings
		name = GER_mio_trait_amerikabomber_learnings

		icon = GFX_generic_mio_department_icon_plane_medium_engine
		special_trait_background = yes
		
		position = { x=0 y=2 }
		relative_position_id = GER_mio_trait_aerodynamic_research_insitute

		visible = {
			has_dlc = "Gotterdammerung"
		}

		available = {
			owner = {
				has_completed_focus = GER_amerikabomber
				has_country_flag = GER_amerikabomber_focke_wulf_flag
			}
		}

		limit_to_equipment_type = { mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_range = 0.1
		} 
	}
}

GER_heinkel_organization = {
	include = generic_heavy_aircraft_organization
	icon = GFX_idea_heinkel
	
	allowed = {	
		OR = {
			original_tag = GER 
			AND = {
				original_tag = BUL
				has_dlc = "Battle for the Bosporus"
			}
			NOR_AAT = yes
		}
	}

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

		IF = {
			limit = {
				FROM = { original_tag = BUL }
			}
			custom_trigger_tooltip = {
				tooltip = has_invited_mio_tt
				FROM = {
					has_country_flag = has_invited_heinkel_mio_flag
				}
			}
			FROM = { 
				OR = {
					is_subject = no
					is_subject_of = GER
				}
				#is_in_faction_with = GER
				NOT = { has_completed_focus = BUL_nationalization }
			}
		}
		ELSE_IF = {
			limit = {
				FROM = { original_tag = NOR }
			}
			FROM = { has_completed_focus = NOR_invite_german_engineers }
		}
	}

	tree_header_text = {
		text = mio_header_design_department
		x = 2
	}

	tree_header_text = {
		text = mio_header_operational_department
		x = 7
	}

	override_trait = {
		token = generic_mio_trait_advanced_turbochargers

		position = { x=0 y=1 }
	}

	override_trait = {
		token = generic_mio_trait_extended_rear_fuselage

		position = { x=5 y=0 }
	}

	override_trait = {
		token = generic_mio_trait_pressurized_cockpit

		position = { x=2 y=1 }
	}

	add_trait = {
		token = GER_mio_trait_doppel_blitz
		name = GER_mio_trait_doppel_blitz
		icon = GFX_generic_mio_department_icon_plane_heavy_engine
		special_trait_background = yes
		
		position = { x=3 y=0 }
		relative_position_id = generic_mio_trait_reinforced_frames

		equipment_bonus = {
			maximum_speed = 0.05
		} 
	} 

	add_trait = {
		token = GER_mio_trait_advanced_night_equipment
		name = GER_mio_trait_advanced_night_equipment
		icon = GFX_generic_mio_trait_icon_detection
		special_trait_background = yes
		
		position = { x=-1 y=1 }
		relative_position_id = generic_mio_trait_pressurized_cockpit
		all_parents = { generic_mio_trait_pressurized_cockpit }

		equipment_bonus = {
			night_penalty = -0.05
		} 
	} 

	add_trait = {
		token = GER_mio_trait_stepless_cockpit
		name = GER_mio_trait_stepless_cockpit
		icon = GFX_generic_mio_trait_icon_strategic_attack
		special_trait_background = yes
		
		position = { x=1 y=1 }
		relative_position_id = generic_mio_trait_pressurized_cockpit
		all_parents = { generic_mio_trait_pressurized_cockpit }

		limit_to_equipment_type = { large_plane_airframe }

		equipment_bonus = {
			air_bombing = 0.05
		} 
	} 

	add_trait = {
		token = GER_mio_trait_hamburger_flugzeugbau
		name = GER_mio_trait_hamburger_flugzeugbau
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=@aircraft_hamburger_X y=@aircraft_hamburger_Y }  

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				mio:GER_blohm_und_voss_organization = {
					has_mio_size > 4
				}
				NOT = { has_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_aerodynamic_research_insitute
		name = GER_mio_trait_aerodynamic_research_insitute
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		relative_position_id = generic_mio_trait_air_deployed_sonobuoys

		position = { x = 1 y = 0 }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				has_completed_focus = GER_aerodynamic_research_institute
				NOT = { has_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag
			}
		}

		organization_modifier = {
		    military_industrial_organization_research_bonus = 0.1
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_amerikabomber_learnings
		name = GER_mio_trait_amerikabomber_learnings

		icon = GFX_generic_mio_department_icon_plane_medium_engine
		special_trait_background = yes
		
		position = { x=0 y=3 }
		relative_position_id = GER_mio_trait_aerodynamic_research_insitute

		visible = {
			has_dlc = "Gotterdammerung"
		}

		available = {
			owner = {
				has_completed_focus = GER_amerikabomber
				has_country_flag = GER_amerikabomber_heinkel_flag
			}
		}

		limit_to_equipment_type = { large_plane_airframe }

		equipment_bonus = {
			air_range = 0.1
			air_bombing = 0.05
		} 
	}
}

GER_dornier_organization = {
	include = generic_medium_aircraft_organization
	icon = GFX_idea_dornier
	
	allowed = {	
		original_tag = GER 
	}

	add_trait = {
		token = GER_mio_trait_flying_boat_specialist
		name = GER_mio_trait_flying_boat_specialist
		icon = GFX_generic_mio_trait_icon_torpedo_attack
		special_trait_background = yes
		
		position = { x=-1 y=1 }
		relative_position_id = generic_mio_trait_skip_bombing
		all_parents = { generic_mio_trait_skip_bombing }

		limit_to_equipment_type = { mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			surface_detection = 0.03
			naval_strike_attack = 0.05
		} 
	}

	add_trait = {
		token = GER_mio_trait_schnellbomber_doctrine
		name = GER_mio_trait_schnellbomber_doctrine
		icon = GFX_generic_mio_department_icon_plane_medium_engine
		special_trait_background = yes
		
		position = { x=-1 y=1 }
		relative_position_id = generic_mio_trait_refined_engines
		all_parents = { generic_mio_trait_refined_engines }

		limit_to_equipment_type = { mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			maximum_speed = 0.1
		} 
	} 

	add_trait = {
		token = GER_mio_trait_hamburger_flugzeugbau
		name = GER_mio_trait_hamburger_flugzeugbau
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=@aircraft_hamburger_X y=@aircraft_hamburger_Y }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				mio:GER_blohm_und_voss_organization = {
					has_mio_size > 4
				}
				NOT = { has_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_aerodynamic_research_insitute
		name = GER_mio_trait_aerodynamic_research_insitute
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		relative_position_id = GER_mio_trait_flying_boat_specialist

		position = { x = 2 y = 0 }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				has_completed_focus = GER_aerodynamic_research_institute
				NOT = { has_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag
			}
		}

		organization_modifier = {
		    military_industrial_organization_research_bonus = 0.1
		}

		ai_will_do = {
			base = 2
		}
	}
}

GER_arado_flugzeugwerke_organization = {
	include = generic_multi_role_aircraft_organization
	icon = GFX_idea_GER_arado_flugzeugwerke
	
	allowed = {	
		original_tag = GER 
	}

	add_trait = {
		token = GER_mio_trait_jet_bomber_innovator
		name = GER_mio_trait_jet_bomber_innovator
		icon = GFX_generic_mio_department_icon_plane_medium_engine
		special_trait_background = yes
		
		position = { x=0 y=1 }
		relative_position_id = GER_mio_trait_hamburger_flugzeugbau

		available = {
			FROM = {
				is_special_project_completed = sp:sp_air_jet_engine
			}
		}

		limit_to_equipment_type = { mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			maximum_speed = 0.1
		} 
	} 

	add_trait = {
		token = GER_mio_trait_hamburger_flugzeugbau
		name = GER_mio_trait_hamburger_flugzeugbau
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes
		
		position = { x=@aircraft_hamburger_X y=@aircraft_hamburger_Y }  

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				mio:GER_blohm_und_voss_organization = {
					has_mio_size > 4
				}
				NOT = { has_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_aerodynamic_research_insitute
		name = GER_mio_trait_aerodynamic_research_insitute
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		relative_position_id = GER_mio_trait_hamburger_flugzeugbau

		position = { x = -1 y = 0 }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				has_completed_focus = GER_aerodynamic_research_institute
				NOT = { has_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag
			}
		}

		organization_modifier = {
		    military_industrial_organization_research_bonus = 0.1
		}

		ai_will_do = {
			base = 2
		}
	}
}

GER_fieseler_organization = {
	include = generic_naval_aircraft_organization
	icon = GFX_idea_GER_fieseler
	
	allowed = {	
		original_tag = GER 
	}

	add_trait = {
		token = GER_mio_trait_hamburger_flugzeugbau
		name = GER_mio_trait_hamburger_flugzeugbau
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=@aircraft_hamburger_X y=@aircraft_hamburger_Y }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				mio:GER_blohm_und_voss_organization = {
					has_mio_size > 4
				}
				NOT = { has_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_aerodynamic_research_insitute
		name = GER_mio_trait_aerodynamic_research_insitute
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		relative_position_id = GER_mio_trait_hamburger_flugzeugbau

		position = { x = 0 y = 1 }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				has_completed_focus = GER_aerodynamic_research_institute
				NOT = { has_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag
			}
		}

		organization_modifier = {
		    military_industrial_organization_research_bonus = 0.1
		}

		ai_will_do = {
			base = 2
		}
	}

}

GER_focke_achgelis_organization = {
	include = generic_helicopter_organization
	icon = GFX_idea_GER_focke_achgelis
	
	allowed = {	
		original_tag = GER 
		has_dlc = "Gotterdammerung"		
	}

	add_trait = {
		token = GER_mio_trait_hamburger_flugzeugbau
		name = GER_mio_trait_hamburger_flugzeugbau
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=@aircraft_hamburger_X y=@aircraft_hamburger_Y }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				mio:GER_blohm_und_voss_organization = {
					has_mio_size > 4
				}
				NOT = { has_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_hamburger_flugzeugbau_trait_taken_flag
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_aerodynamic_research_insitute
		name = GER_mio_trait_aerodynamic_research_insitute
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		relative_position_id = GER_mio_trait_hamburger_flugzeugbau

		position = { x = 0 y = 1 }  
		
		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				has_completed_focus = GER_aerodynamic_research_institute
				NOT = { has_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag }
			}
		}

		on_complete = {
			custom_effect_tooltip = generic_trait_will_not_be_available_in_other_organizations
			FROM = {
				set_country_flag = GER_mio_trait_aerodynamic_research_insitute_taken_flag
			}
		}

		organization_modifier = {
		    military_industrial_organization_research_bonus = 0.1
		}

		ai_will_do = {
			base = 2
		}
	}
}


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

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


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

GER_rheinmetall_organization = {
	include = generic_artillery_organization
	icon = GFX_idea_rheinmetall
	
	allowed = {	
		OR = {
			original_tag = GER 
			AND = {
				original_tag = GRE
				has_dlc = "Battle for the Bosporus"
			}
			AND = {
				original_tag = HUN
				has_dlc = "Gotterdammerung"
			}
		}
	}

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

	visible = {
		IF = {
			limit = { FROM = { original_tag = HUN } }
			FROM = { has_completed_focus = wuw_HUN_seek_german_contracts }
		}
	}

	add_trait = { 
		token = GER_mio_trait_3_7_cm_pak
		name = GER_mio_trait_3_7_cm_pak
		icon = GFX_generic_mio_department_icon_anti_tank
		special_trait_background = yes

		position = { x = 1 y = 0 }
		relative_position_id = generic_mio_trait_big_guns

		#any_parent = { generic_mio_trait_cantilever_wing_structure }

		limit_to_equipment_type = { 
			anti_tank_equipment
		}

		equipment_bonus = {
			ap_attack = 0.05
			hard_attack = 0.05
			soft_attack = 0.1
		}
	}

	add_trait = { 
		token = GER_mio_trait_7_5_cm_pak
		name = GER_mio_trait_7_5_cm_pak
		icon = GFX_generic_mio_trait_icon_ap_attack
		special_trait_background = yes

		position = { x = 0 y = 1 }
		relative_position_id = GER_mio_trait_3_7_cm_pak

		any_parent = { GER_mio_trait_3_7_cm_pak }

		limit_to_equipment_type = { 
			anti_tank_equipment
		}

		equipment_bonus = {
			ap_attack = 0.05
			hard_attack = 0.1
		}
	}

	add_trait = { 
		token = GER_mio_trait_versatile_carriage
		name = GER_mio_trait_versatile_carriage
		icon = GFX_generic_mio_department_icon_anti_air
		special_trait_background = yes

		position = { x = 1 y = 1 }
		relative_position_id = generic_mio_trait_rapid_fire

		all_parents = {
			generic_mio_trait_rapid_fire
			generic_mio_trait_advanced_barrel_forging
		}

		limit_to_equipment_type = { 
			anti_tank_equipment
			anti_air_equipment
		}

		equipment_bonus = {
			ap_attack = 0.03
			hard_attack = 0.03
			air_attack = 0.05
		}
	}

	add_trait = { 
		token = GER_mio_trait_dual_recoil_mechanism
		name = GER_mio_trait_dual_recoil_mechanism
		icon = GFX_generic_mio_department_icon_artillery
		special_trait_background = yes

		position = { x = 1 y = 1 }
		relative_position_id = generic_mio_trait_advanced_barrel_forging

		all_parents = {
			generic_mio_trait_advanced_barrel_forging
			generic_mio_trait_big_guns
		}

		available = {
			FROM = {
				has_tech = artillery3
			}
		}

		limit_to_equipment_type = { 
			artillery_equipment
		}

		equipment_bonus = {
			soft_attack = 0.1
			build_cost_ic = 0.05
		}
	}
}

GER_mauser_organization = {
	include = generic_infantry_equipment_organization
	icon = GFX_idea_mauser

	override_trait = {
		token = generic_mio_trait_armor_piercing_rounds

		position = { x=0 y=2 }
	}

	override_trait = {
		token = generic_mio_trait_advanced_barrel_forging

		position = { x=1 y=2 }
	}

	override_trait = {
		token = generic_mio_trait_reinforced_stocks

		position = { x=3 y=0 }
	}

	override_trait = {
		token = generic_mio_trait_medium_machineguns

		position = { x=0 y=2 }
	}
	
	allowed = {	 
		OR = {
			original_tag = GER 
			AND = {
				original_tag = ETH
				has_dlc = "By Blood Alone"
			}
		}
	}
	
	visible = {
		IF = {
			limit = { FROM = { original_tag = ETH } }
			FROM = { has_completed_focus = ETH_invite_foreign_industrialists }
		}
	}
	
	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 } }
		}

		IF = {
			limit = {
				FROM = { NOT  = { original_tag = GER } }
			}
			custom_trigger_tooltip = {
				tooltip = has_invited_mio_tt
				FROM = {
					has_country_flag = has_invited_GER_mauser_organization_flag
				}
			}
		}
	}

	add_trait = {
		token = GER_mio_trait_experienced_manufacturer
		name = GER_mio_trait_experienced_manufacturer
		icon = GFX_generic_mio_trait_icon_reliability
		special_trait_background = yes

		position = { x=-1 y=0 }  
		relative_position_id = generic_mio_trait_drum_pattern_sights

		visible = {
			FROM = { original_tag = GER }
		}

		equipment_bonus = {
			reliability = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_export_models
		name = GER_mio_trait_export_models
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		position = { x=-1 y=1 }  
		relative_position_id = generic_mio_trait_drum_pattern_sights

		visible = {
			FROM = { original_tag = GER }
		}

		production_bonus = {
			production_efficiency_cap_factor = 0.03
			production_cost_factor = -0.03
		}
		
		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_karabiner
		name = GER_mio_trait_karabiner
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=0 y=1 }  
		relative_position_id = generic_mio_trait_reinforced_stocks

		visible = {
			FROM = { original_tag = GER }
		}

		all_parents = {	generic_mio_trait_reinforced_stocks }

		equipment_bonus = {
			soft_attack = 0.03
		}

		production_bonus = {
			production_capacity_factor = 0.03
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_sturmgewehr
		name = GER_mio_trait_sturmgewehr
		icon = GFX_generic_mio_department_icon_infantry_offense
		special_trait_background = yes

		position = { x=2 y=2 }
		relative_position_id = generic_mio_trait_bolt_action

		any_parent = { generic_mio_trait_semi_auto generic_mio_trait_bolt_action }

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				has_tech = advanced_infantry_weapons
			}
		}

		equipment_bonus = {
			soft_attack = 0.07
			breakthrough = 0.03
		}

		production_bonus = {
			production_cost_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}
}

GER_opel_organization = {
	include = generic_motorized_mechanized_organization
	icon = GFX_idea_opel
	
	allowed = {	
		OR = {
			original_tag = GER
			AND = {
				original_tag = ROM
				has_dlc = "Death or Dishonor"
			}
			AND = {
				original_tag = BUL
				has_dlc = "Battle for the Bosporus"
			}
		}
	}
	
	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 } }
		}

		IF = {
			limit = { FROM = { original_tag = BUL } }
			custom_trigger_tooltip = {
				tooltip = has_invited_mio_tt
				FROM = {
					has_country_flag = has_invited_opel_mio_flag
				}
			}
			FROM = { 
				OR = {
					is_subject = no
					is_subject_of = GER
				}
				#is_in_faction_with = GER
				NOT = { has_completed_focus = BUL_nationalization }
			}
		}
		IF = {
			limit = { FROM = { original_tag = ROM } }
			FROM = { has_country_flag = GER_mot_chosen }
		}	
	}

	add_trait = {
		token = GER_mio_trait_continental_ag_tires
		name = GER_mio_trait_continental_ag_tires
		icon = GFX_generic_mio_trait_icon_reliability
		special_trait_background = yes

		position = { x=9 y=0 }  

		visible = {
			FROM = { original_tag = GER }
		}

		available = { 
			FROM = {
				has_completed_focus = GER_nationalize_ford_factories
			}
		}

		equipment_bonus = {
			reliability = 0.05
			build_cost_ic = -0.02
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_ford_facilities
		name = GER_mio_trait_ford_facilities
		icon = GFX_generic_mio_trait_icon_production_capacity
		special_trait_background = yes

		position = { x=9 y=1 }  

		visible = {
			FROM = { original_tag = GER }
		}

		available = {
			FROM = {
				has_completed_focus = GER_nationalize_ford_factories
			}
		}

		production_bonus = {
			production_capacity_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_efficiency_in_mass_production
		name = GER_mio_trait_efficiency_in_mass_production
		icon = GFX_generic_mio_trait_icon_efficiency_cap
		special_trait_background = yes

		position = { x=0 y=1 }
		relative_position_id = GER_mio_trait_ford_facilities

		any_parent = { GER_mio_trait_ford_facilities }

		visible = {
			FROM = { original_tag = GER }
		}

		production_bonus = {
			production_efficiency_cap_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_improved_engines
		name = GER_mio_trait_improved_engines
		icon = GFX_generic_mio_department_icon_motorized_mechanized_engine
		special_trait_background = yes

		position = { x=-1 y=1 }
		relative_position_id = GER_mio_trait_ford_facilities

		any_parent = { GER_mio_trait_ford_facilities }

		visible = {
			FROM = { original_tag = GER }
		}

		equipment_bonus = {
			maximum_speed = 0.05
			reliability = 0.03
			build_cost_ic = 0.02
		}

		ai_will_do = {
			base = 2
		}
	}
}

GER_carl_walther_organization = {
	include = generic_support_equipment_organization
	icon = GFX_idea_GER_carl_walther
	
	allowed = {	
		original_tag = GER 
	}

	add_trait = {
		token = GER_mio_trait_innovative_safety_features
		name = GER_mio_trait_innovative_safety_features
		icon = GFX_generic_mio_department_icon_facilities
		special_trait_background = yes

		position = { x=1 y=1 } 
		relative_position_id = generic_mio_trait_private_scientists_program
		
		all_parents = { generic_mio_trait_private_scientists_program }

		ai_will_do = {
			base = 2
		}

		organization_modifier = {
			military_industrial_organization_research_bonus = 0.05
			military_industrial_organization_design_team_assign_cost = -0.05
			military_industrial_organization_industrial_manufacturer_assign_cost = -0.05
		}
	}

	add_trait = {
		token = GER_mio_trait_policiary_equipment
		name = GER_mio_trait_policiary_equipment
		icon = GFX_generic_mio_department_icon_support_equipment
		special_trait_background = yes

		position = { x=0 y=1 } 
		relative_position_id = generic_mio_trait_private_tenders
		
		all_parents = { generic_mio_trait_private_tenders }

		ai_will_do = {
			base = 2
		}

		limit_to_equipment_type = { support_equipment }

		organization_modifier = {
			military_industrial_organization_funds_gain = 0.05
		}

		equipment_bonus = {
			build_cost_ic = -0.05
		}
	}
}

GER_auto_union_organization = {
	include = generic_armored_car_organization
	icon = GFX_idea_GER_auto_union
	
	allowed = {	
		original_tag = GER 
	}

	add_trait = {
		token = GER_mio_trait_racing_pedigree
		name = GER_mio_trait_racing_pedigree
		icon = GFX_generic_mio_department_icon_armored_car_engine
		special_trait_background = yes

		position = { x=-1 y=1 }
		relative_position_id = generic_mio_trait_simplified_suspension

		all_parents = { generic_mio_trait_simplified_suspension }

		equipment_bonus = {
			maximum_speed = 0.07
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_military_exclusivity
		name = GER_mio_trait_military_exclusivity
		icon = GFX_generic_mio_department_icon_armored_car_line_efficiency
		special_trait_background = yes

		position = { x=0 y=3 }
		relative_position_id = GER_mio_trait_racing_pedigree

		all_parents = { GER_mio_trait_racing_pedigree generic_mio_trait_improved_tooling }

		production_bonus = {
			production_efficiency_gain_factor = 0.05
			production_efficiency_cap_factor = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}

	add_trait = {
		token = GER_mio_trait_schwerer_panzerspahwagen
		name = GER_mio_trait_schwerer_panzerspahwagen
		icon = GFX_generic_mio_department_icon_armored_car_defense
		special_trait_background = yes

		position = { x=1 y=1 }
		relative_position_id = generic_mio_trait_defensive_equipment

		all_parents = { generic_mio_trait_defensive_equipment }

		available = { 
			FROM = {
				has_completed_focus = GER_panzergrenadier
			}
		}

		equipment_bonus = {
			breakthrough = 0.03
			armor_value = 0.05
		}

		ai_will_do = {
			base = 2
		}
	}
}