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

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

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


UKR_hkbm_organization = {
	include = generic_heavy_tank_organization
	icon = GFX_idea_hkbm
	
	allowed = {	
		OR = {
			tag = UKR 
			tag = DKR
		}
	}

	available = {
		if = {
			limit = { FROM = { tag = DKR } }
			FROM = { 
				controls_state = 221
			}
		}	
	}
}

UKR_zhbtz_organization = {
	include = generic_mobile_tank_organization
	icon = GFX_idea_zhbtz
	
	allowed = {	
		OR = {
			tag = UKR 
			tag = DKR
		}
	}
	
	available = {
		if = {
			limit = { FROM = { tag = DKR } }
			FROM = { 
				controls_state = 201
			}
		}	
	}
}

UKR_kbtz_organization = {
	include = generic_medium_tank_organization
	icon = GFX_idea_kbtz
	
	allowed = {	
		OR = {
			tag = UKR 
			tag = DKR
		}
	}
	
	available = {
		if = {
			limit = { FROM = { tag = DKR } }
			FROM = { 
				controls_state = 202
			}
		}	
	}
}

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

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

UKR_chsz_organization = {
	include = generic_battle_line_ship_organization
	icon = GFX_idea_chsz
	
	allowed = {	
		tag = UKR 
	}
	
	add_trait = { 
        token = UKR_mio_trait_engine_optimization
        name = generic_mio_engine_optimization
        icon = GFX_generic_mio_trait_icon_naval_speed
        special_trait_background = yes

        position = { x=3 y=0 }

        equipment_bonus = {
            fuel_consumption = -0.03
            naval_speed = 0.02
        }
    }
    
    add_trait = { 
        token = DEN_mio_trait_ship_efficient_scrap_recycling
        name = generic_mio_trait_efficient_scrap_recycling
        icon = GFX_generic_mio_department_icon_ship_general_conversion
        special_trait_background = yes

        all_parents = {
            UKR_mio_trait_engine_optimization
        }

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

        production_bonus = {
            production_cost_factor = -0.05
            production_capacity_factor = 0.05
            production_resource_penalty_factor = -0.05
        }
    }
    
    trait = {
		token = SWE_mio_trait_high_capacity_dockyard
		name = SWE_mio_trait_high_capacity_dockyard
		icon = GFX_generic_mio_department_icon_ship_general_production
		
		relative_position_id = generic_mio_trait_semi_armor_piercing_shells
		any_parent = { generic_mio_trait_semi_armor_piercing_shells generic_mio_trait_super_heavy_shells generic_mio_trait_high_velocity_guns }
		special_trait_background  = yes
		position = { x=0 y=2 }
		
		available = { owner = { has_completed_focus = UKR_develop_ship_building } }
		
		production_bonus = {
			production_capacity_factor = 0.05
		}
	}
}

UKR_srdsc_organization = {
	include = generic_black_sea_fleet_organization
	icon = GFX_idea_UKR_srdsc
	
	allowed = {	
		tag = UKR 
	}
	
	add_trait = { 
        token = UKR_mio_trait_black_sea_engines_engines
        name = generic_mio_engine_optimization
        icon = GFX_generic_mio_trait_icon_naval_speed
        special_trait_background = yes

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

        all_parents = { generic_mio_trait_submarine_hunters_black_sea }
        
        equipment_bonus = {
            naval_range = 0.05
            naval_speed = 0.05
            fuel_consumption = -0.05
        }
    }

}

UKR_thunderbird_organization = {
	include = generic_escort_ship_organization
	icon = GFX_idea_UKR_thunderbird
	
	allowed = {	
		tag = UKR 
	}

	add_trait = { 
        token = UKR_mio_trait_thunderbird_radiodetection
        name = UKR_mio_trait_thunderbird_radiodetection
        icon = GFX_generic_mio_trait_icon_sub_detection
        special_trait_background = yes

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

        all_parents = { generic_mio_trait_submarine_hunters }
        
        available = {
			owner = {
				has_tech = radio_detection
			}
		}
        
        equipment_bonus = {
            sub_detection = 0.05
            surface_detection = 0.05
            patrol_coordination = 0.10
        }
    }
}

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

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

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

UKR_HAZ_organization = {
	include = generic_light_aircraft_organization
	icon = GFX_idea_HAZ
	
	allowed = {	
		tag = UKR
	}

}

UKR_MotorSich_organization = {
	include = generic_multi_role_aircraft_organization
	icon = GFX_idea_MotorSich
	
	allowed = {	
		tag = UKR 
	}
}

UKR_Aviant_organization = {
	icon = GFX_idea_Aviant

	allowed = {	
		tag = UKR 
	}

	available = {
		FROM = {
			has_completed_focus = UKR_aviant
		}
	}

	equipment_type = {
		mio_cat_eq_all_medium_plane
		large_plane_airframe
		transport_plane_equipment
	}

	research_categories = { mio_cat_all_medium_aircraft_and_modules mio_cat_all_heavy_aircraft_and_modules }
	
	tree_header_text = {
		text = mio_header_design_department
		x = 2
	}

	tree_header_text = {
		text = UKR_mio_header_Aviant_medium
		x = 5
	}

	tree_header_text = {
		text = mio_header_operational_department
		x = 8
	}

	initial_trait = {
		name = UKR_mio_initial_trait_Aviant_designer

		limit_to_equipment_type = { large_plane_airframe mio_cat_eq_all_medium_plane }

		organization_modifier = {
			military_industrial_organization_research_bonus = 0.05
		}
		equipment_bonus = {
			air_bombing = 0.05
			air_ground_attack = 0.05
		}
	}

	trait = {
		token = generic_mio_trait_reinforced_frames
		name = generic_mio_trait_reinforced_frames
		icon = GFX_generic_mio_trait_icon_defense

		position = { x=2 y=0 }

		limit_to_equipment_type = { large_plane_airframe mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_defence = 0.05
		}
	}

	trait = {
		token = generic_mio_trait_standardized_alloys
		name = generic_mio_trait_standardized_alloys
		icon = GFX_generic_mio_trait_icon_resources

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

		any_parent = { generic_mio_trait_reinforced_frames }

		production_bonus = {
			production_efficiency_gain_factor = 0.05
			production_resource_penalty_factor = -0.1
		}
	}

	trait = {
		token = generic_mio_trait_transport_conversions
		name = generic_mio_trait_transport_conversions
		icon = GFX_generic_mio_department_icon_plane_general_production

		position = { x=-2 y=1 }
		relative_position_id = generic_mio_trait_standardized_alloys

		any_parent = { generic_mio_trait_standardized_alloys }

		limit_to_equipment_type = { transport_plane_equipment }

		production_bonus = {
			production_capacity_factor = 0.15
		}
	}

	trait = {
		token = generic_mio_trait_drop_hammer_alloy_straining
		name = generic_mio_trait_drop_hammer_alloy_straining
		icon = GFX_generic_mio_trait_icon_reliability

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

		any_parent = { generic_mio_trait_standardized_alloys }

		limit_to_equipment_type = { large_plane_airframe mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_defence = 0.05
			reliability = 0.05
		}
	}

	trait = {
		token = generic_mio_trait_refined_secondary_aluminium
		name = generic_mio_trait_refined_secondary_aluminium
		icon = GFX_generic_mio_trait_icon_resources

		position = { x=-1 y=2 }
		relative_position_id = generic_mio_trait_drop_hammer_alloy_straining

		any_parent = { generic_mio_trait_drop_hammer_alloy_straining }

		mutually_exclusive = { generic_mio_trait_high_quality_aluminium_alloys }

		limit_to_equipment_type = { large_plane_airframe mio_cat_eq_all_medium_plane }

		production_bonus = {
			production_capacity_factor = 0.05
			production_resource_need_factor = -0.15
		}
	}

	trait = {
		token = generic_mio_trait_high_quality_aluminium_alloys
		name = generic_mio_trait_high_quality_aluminium_alloys
		icon = GFX_generic_mio_trait_icon_air_agility

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

		any_parent = { generic_mio_trait_drop_hammer_alloy_straining }

		mutually_exclusive = { generic_mio_trait_refined_secondary_aluminium }

		limit_to_equipment_type = { large_plane_airframe mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_agility = 0.05
			reliability = 0.05
		}
	}

	trait = {
		token = generic_mio_trait_twin_tail
		name = generic_mio_trait_twin_tail
		icon = GFX_generic_mio_trait_icon_air_agility

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

		limit_to_equipment_type = { mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_agility = 0.05
		}
	}

	trait = {
		token = generic_mio_trait_streamlined_fuselage
		name = generic_mio_trait_streamlined_fuselage
		icon = GFX_generic_mio_trait_icon_maximum_speed

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

		any_parent = { generic_mio_trait_twin_tail }

		limit_to_equipment_type = { mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_defence = 0.05
			maximum_speed = 0.05
		}
	}

	trait = {
		token = generic_mio_trait_heavy_fighter_specialization
		name = generic_mio_trait_heavy_fighter_specialization
		icon = GFX_generic_mio_department_icon_plane_medium_quality

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

		all_parents = { generic_mio_trait_streamlined_fuselage }

		limit_to_equipment_type = { mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_range = 0.05
			air_attack = 0.05
			air_defence = 0.05
		}
	}

	trait = {
		token = generic_mio_trait_extended_rear_fuselage
		name = generic_mio_trait_extended_rear_fuselage
		icon = GFX_generic_mio_trait_icon_air_ground_attack

		position = { x=6 y=0 }
		relative_position_id = generic_mio_trait_reinforced_frames

		limit_to_equipment_type = { large_plane_airframe mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_bombing = 0.05
			naval_strike_attack = 0.05
		}
	}

	trait = {
		token = generic_mio_trait_auto_levelled_bombsights
		name = generic_mio_trait_auto_levelled_bombsights
		icon = GFX_generic_mio_trait_icon_strategic_attack

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

		any_parent = { generic_mio_trait_extended_rear_fuselage }

		limit_to_equipment_type = { large_plane_airframe mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_bombing = 0.05
		}
	}

	trait = {
		token = generic_mio_trait_cockpit_controlled_remote_gun_turrets
		name = generic_mio_trait_cockpit_controlled_remote_gun_turrets
		icon = GFX_generic_mio_trait_icon_anti_air_attack

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

		any_parent = { generic_mio_trait_auto_levelled_bombsights }

		limit_to_equipment_type = { large_plane_airframe mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_attack = 0.05
		}
	}
	
	trait = {
		token = generic_mio_trait_flying_fortress
		name = generic_mio_trait_flying_fortress
		icon = GFX_generic_mio_department_icon_plane_general_engine

		position = { x=-1 y=2 }
		relative_position_id = generic_mio_trait_cockpit_controlled_remote_gun_turrets

		any_parent = { generic_mio_trait_cockpit_controlled_remote_gun_turrets }

		mutually_exclusive = { generic_mio_trait_advanced_instruments }

		limit_to_equipment_type = { large_plane_airframe mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_defence = 0.15
			air_range = 0.15
			air_agility = -0.05
			fuel_consumption = 0.05
		}
	}

	trait = {
		token = generic_mio_trait_advanced_instruments
		name = generic_mio_trait_advanced_instruments
		icon = GFX_generic_mio_trait_icon_strategic_attack

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

		any_parent = { generic_mio_trait_cockpit_controlled_remote_gun_turrets }

		mutually_exclusive = { generic_mio_trait_flying_fortress }

		limit_to_equipment_type = { large_plane_airframe mio_cat_eq_all_medium_plane }

		equipment_bonus = {
			air_bombing = 0.05
			naval_strike_targetting = 0.05
		}
	}
}

UKR_Anatra_organization = {
	include = generic_naval_aircraft_organization
	icon = GFX_idea_Anatra
	
	allowed = {	
		tag = UKR 
	}
}


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

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


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

UKR_sgc_organization = {
	include = generic_artillery_organization
	icon = GFX_idea_UKR_artillery_focus
	
	allowed = {	
		tag = UKR 
	}

	available = {

	}

	add_trait = { 
		token = UKR_mio_trait_sgc
		name = UKR_mio_trait_1_artillery
		icon = GFX_generic_mio_trait_icon_efficiency_cap
		special_trait_background = yes

		position = { x=9 y=2 }
		
		available = {
			FROM = {
				has_completed_focus = ukr_production_effort_2
			}
		}

		production_bonus = {
			production_cost_factor = -0.1
		}
	}
}

UKR_dob_organization = {
	include = generic_infantry_equipment_organization
	icon = GFX_idea_generic_infantry_equipment_manufacturer_2
	
	allowed = {	
		tag = UKR 
	}
	
	available = {

	}

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

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

		any_parent = { generic_mio_trait_reinforced_stocks generic_mio_trait_drum_pattern_sights }

		available = {
			FROM = {
				has_completed_focus = UKR_DOB
			}
		}

		equipment_bonus = {
			reliability = 0.05
			soft_attack = 0.03
			ap_attack = 0.03
		}
	}
}

UKR_zaz_organization = {
	include = generic_motorized_mechanized_organization
	icon = GFX_idea_zaz
	
	allowed = {	
		OR = {
			tag = UKR 
			tag = DKR
			tag = CUA
		}
	}
	
	available = {
		if = {
			limit = { FROM = { tag = CUA } }
			FROM = {
				OR = {
					is_subject_of = UKR
					is_in_faction_with = UKR
				}
			}
		}
		else_if = {
			limit = { FROM = { tag = DKR } }
			FROM = {
				controls_state = 200
			}
		}
	}
}