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

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

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

 AFG_tanks_organization = {
 	include = generic_medium_tank_organization
 	#icon = GFX_idea_BRA_bernardini
 	allowed = {	
 		has_dlc = "Graveyard of Empires"
 		tag = AFG
 	}
	equipment_type = { armor }


	initial_trait = {
		name = USA_mio_trait_dedicated_tank_factory
		
		production_bonus = {
			production_efficiency_gain_factor = 0.1
		}
	}

 	available = {
 		AFG = {
 			has_country_flag = afg_tank_factory_mio
 		}
 	}
 }



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

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



AFG_naval_organization = {
	include = generic_escort_ship_organization
	#icon = GFX_idea_BRA_arsenal_de_marinha
	allowed = {
		has_dlc = "Graveyard of Empires"
		# TODO_JUNO: Add correct DLC check!
		tag = AFG
	}

	available = {
		AFG = {
			has_completed_focus = AFG_shipyards
		}
	}
}




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

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

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

AFG_aircraft_organization = {
	include = generic_light_aircraft_organization
	#icon = GFX_idea_BRA_bernardini
	allowed = {	
		has_dlc = "Graveyard of Empires"
		tag = AFG
	}

	available = {
		AFG = {
			has_country_flag = afg_aircraft_factory_mio
		}
	}


	equipment_type = {
        mio_cat_eq_all_small_plane
		mio_cat_eq_all_medium_plane
	}

	initial_trait = {
		name = generic_mio_initial_trait_standardized_production
		
		production_bonus = {
			production_cost_factor = -0.05
		}
	}
}


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

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


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

AFG_infantry_organization = {
	include = generic_infantry_equipment_organization
	#icon = GFX_idea_BRA_bernardini
	allowed = {	
		has_dlc = "Graveyard of Empires"
		tag = AFG
	}

	available = {
		AFG = {
			has_completed_focus = AFG_new_army
		}
	}
}

AFG_khyber_pass_rifling_org = {
	include = generic_infantry_equipment_organization
	equipment_type = { infantry_equipment }
	research_categories = { infantry_weapons }

	allowed = {	
		has_dlc = "Graveyard of Empires"
		tag = AFG
	}
	available = {
		AFG = {
			has_completed_focus = AFG_khyber_pass_riflining
		}
	}
	tree_header_text = {
		text = "Design and Production"
		x = 3
	}

	tree_header_text = {
		text = "Anti-Tank"
		x = 8
	}

	initial_trait = {
		limit_to_equipment_type = { infantry_equipment }
		production_bonus = {
			production_cost_factor = -0.05
		}
		organization_modifier = {
			military_industrial_organization_research_bonus = 0.1
		}
	}

	trait = {
		token = cost_reduction_1
		icon = GFX_generic_mio_trait_icon_efficiency_gain
		limit_to_equipment_type = { infantry_equipment }

		organization_modifier = {
			#military_industrial_organization_funds_gain = 0.5
		}
		equipment_bonus = {
			reliability = -0.05
		}
		production_bonus = {
			production_efficiency_cap_factor = 0.05
			production_cost_factor = -0.05
		}
		position = { x=0 y=0 }
		special_trait_background = yes
	}

	trait = {
		token = cost_reduction_2

		limit_to_equipment_type = { infantry_equipment }
		icon = GFX_generic_mio_trait_icon_resources
		organization_modifier = {
			#military_industrial_organization_funds_gain = 0.5
		}
		equipment_bonus = {
			reliability = -0.05
		}
		production_bonus = {
			production_resource_need_factor = -0.15
		}
		any_parent = { cost_reduction_1 }
		relative_position_id = cost_reduction_1
		position = { x=0 y=1 }
		special_trait_background = yes
	}

	trait = {
		token = cost_reduction_3

		limit_to_equipment_type = { infantry_equipment }
		icon = GFX_generic_mio_trait_icon_efficiency_gain
		organization_modifier = {
			#military_industrial_organization_funds_gain = 0.5
		}
		equipment_bonus = {
			reliability = -0.1
		}
		production_bonus = {
			production_resource_need_factor = -0.1
			production_cost_factor = -0.1
		}
		any_parent = { cost_reduction_2 }
		relative_position_id = cost_reduction_2
		position = { x=0 y=1 }
		special_trait_background = yes
	}


}

AFG_artillery_organization = {
	include = generic_artillery_organization
	#icon = GFX_idea_BRA_bernardini
	allowed = {	
		has_dlc = "Graveyard of Empires"
		tag = AFG
	}

	available = {
		AFG = {
			has_country_flag = afg_artillery_factory_mio
		}
	}
}
