control_ai_allies_category = {
	ROOT_hide_ai_allies_decisions = {				#adding an option to hide these decisions			- Illya

		icon = eng_trade_unions_support
        
        days_remove = -1
		priority = 100
		allowed = {
			is_ai1 = yes
		}
		visible = {
			is_faction_leader = yes
		}

		complete_effect = {
			set_country_flag = ROOT_hide_ai_allies_decisions_flag
		}
		modifier = {
			custom_modifier_tooltip = ROOT_ai_allies_decision_will_remain_hidden_tt
		}
		fire_only_once = no
        remove_trigger = {
			hidden_trigger = {
				NOT = {
					has_country_flag = ROOT_hide_ai_allies_decisions_flag
				}
			}
        }
	}
	ROOT_show_ai_allies_decisions = {

		priority = 100

		icon = eng_trade_unions_demand
		fire_only_once = no
		allowed = {
			is_ai1 = yes
		}
		visible = {
			is_faction_leader = yes
			has_country_flag = ROOT_hide_ai_allies_decisions_flag
		}

		complete_effect = {
			clr_country_flag = ROOT_hide_ai_allies_decisions_flag
		}
	}
	ai_ally_favor_navy = {

		icon = generic_naval
		
		target_array = allies

		target_trigger = {
			FROM = {
				OR = {
					is_puppet_of = ROOT
					is_in_faction_with = ROOT
				}	
			}
		}	
		
		#target_array = subjects
		#targets = {
		#	target_array = allies
		#	target_array = subjects
		#}

		#target_trigger = {
		#	FROM = {
		#		OR = {
		#			is_puppet_of = ROOT
		#			is_in_faction_with = ROOT
		#		}
		#	}
		#ROOT = {
		#		is_in_faction_with = FROM
		#	}		
		#}
		available = {
			FROM = {
				num_of_naval_factories > 0
			}
			command_power > 10
		}
		
		cost = 10
		
		days_remove = 30

		custom_cost_text = r56_10_command_power_cost	
		custom_cost_trigger = {
			command_power > 10			
		}	
		allowed = {
			is_ai1 = yes
		}
	
	
		visible = {
			is_faction_leader = yes
			FROM = {
				is_ai = yes
				num_of_naval_factories > 0
				NOT = {
					OR = {
						has_idea = r56_ai_favor_defense
						has_idea = r56_ai_favor_offense
						has_idea = r56_ai_favor_war_production
						has_idea = r56_ai_favor_aviation
						has_idea = r56_ai_favor_navy
						has_decision = ai_ally_favor_aviation
						has_decision = ai_ally_favor_offense
						has_decision = ai_ally_favor_defense
						has_decision = ai_ally_favor_war_production
					}
				}				
			}
			NOT = {
				has_country_flag = ROOT_hide_ai_allies_decisions_flag
			}

		}

		complete_effect = {
			add_command_power = -10			
		}
		remove_effect = {
			FROM = {
				add_ideas = r56_ai_favor_navy
			}
		}						
		ai_will_do = {
			factor = 0
		}
	}
	drop_ai_ally_favor_navy = {

		icon = generic_naval

		allowed = {
			is_ai1 = yes
		}
		target_array = allies

		target_trigger = {
			FROM = {
				OR = {
					is_puppet_of = ROOT
					is_in_faction_with = ROOT
				}	
			}
		}	
		
		#target_array = subjects
		#targets = {
		#	target_array = allies
		#	target_array = subjects
		#}

		#target_trigger = {
		#	FROM = {
		#		OR = {
		#			is_puppet_of = ROOT
		#			is_in_faction_with = ROOT
		#		}
		#	}
		#ROOT = {
		#		is_in_faction_with = FROM
		#	}		
		#}
		available = {
			FROM = {
				has_idea = r56_ai_favor_navy
			}
			command_power > 10		
		}

		custom_cost_text = r56_10_command_power_cost	
		custom_cost_trigger = {
			command_power > 10			
		}	
	
		visible = {
			is_faction_leader = yes
			FROM = {
				has_idea = r56_ai_favor_navy
			}
			NOT = {
				has_country_flag = ROOT_hide_ai_allies_decisions_flag
			}

		}

		complete_effect = {
			add_command_power = -10	
			FROM = {
				remove_ideas = r56_ai_favor_navy
			}						
		}
			
		ai_will_do = {
			factor = 0
		}
	}
	ai_ally_favor_aviation = {

		icon = generic_air

		allowed = {
			is_ai1 = yes
		}
		target_array = allies

		target_trigger = {
			FROM = {
				OR = {
					is_puppet_of = ROOT
					is_in_faction_with = ROOT
				}	
			}
		}	
		
		available = {
			FROM = {
				num_of_military_factories > 0
			}
			command_power > 10			
		}

		custom_cost_text = r56_10_command_power_cost	
		custom_cost_trigger = {
			command_power > 10			
		}	
	
		visible = {
			is_faction_leader = yes
			FROM = {
				is_ai = yes
				num_of_military_factories > 0
				NOT = {
					OR = {
						has_idea = r56_ai_favor_defense
						has_idea = r56_ai_favor_offense
						has_idea = r56_ai_favor_war_production
						has_idea = r56_ai_favor_aviation
						has_idea = r56_ai_favor_navy
						has_decision = ai_ally_favor_navy
						has_decision = ai_ally_favor_offense
						has_decision = ai_ally_favor_defense
						has_decision = ai_ally_favor_war_production						
					}
				}			
			}
			NOT = {
				has_country_flag = ROOT_hide_ai_allies_decisions_flag
			}

		}
		complete_effect = {
			add_command_power = -10		
			FROM = {
				add_ideas = r56_ai_favor_aviation
			}					
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	drop_ai_ally_favor_aviation = {

		icon = generic_air

		allowed = {
			is_ai1 = yes
		}
		target_array = allies

		target_trigger = {
			FROM = {
				OR = {
					is_puppet_of = ROOT
					is_in_faction_with = ROOT
				}	
			}
		}	
		cost = 10
		
		days_remove = 30

		custom_cost_text = r56_10_command_power_cost	
		custom_cost_trigger = {
			command_power > 10			
		}		
		available = {
			FROM = {
				has_idea = r56_ai_favor_aviation
			}
			command_power > 10
		}
		
	
		visible = {
			is_faction_leader = yes
			FROM = {
				has_idea = r56_ai_favor_aviation
			}
			NOT = {
				has_country_flag = ROOT_hide_ai_allies_decisions_flag
			}

		}
		complete_effect = {
			add_command_power = -10			
		}
		remove_effect = {			
			FROM = {
				remove_ideas = r56_ai_favor_aviation
			}				
		}			
		ai_will_do = {
			factor = 0
		}
	}	

	
	ai_ally_favor_defense = {

		icon = generic_operation

		allowed = {
			is_ai1 = yes
		}
		target_array = allies

		target_trigger = {
			FROM = {
				OR = {
					is_puppet_of = ROOT
					is_in_faction_with = ROOT
				}	
			}
		}		
		
		cost = 10

		custom_cost_text = r56_10_command_power_cost	
		custom_cost_trigger = {
			command_power > 10			
		}
		available = {
			command_power > 10			
		}
		
	
		visible = {
			is_faction_leader = yes
			FROM = {
				is_ai = yes
				NOT = {
					OR = {
						has_idea = r56_ai_favor_defense
						has_idea = r56_ai_favor_offense
						has_idea = r56_ai_favor_war_production
						has_idea = r56_ai_favor_aviation
						has_idea = r56_ai_favor_navy
						has_decision = ai_ally_favor_aviation
						has_decision = ai_ally_favor_offense
						has_decision = ai_ally_favor_navy
						has_decision = ai_ally_favor_war_production						
					}	
				}								
			}
			NOT = {
				has_country_flag = ROOT_hide_ai_allies_decisions_flag
			}

		}
		complete_effect = {
			add_command_power = -10	
			FROM = {
				add_ideas = r56_ai_favor_defense
			}					
		}		
		ai_will_do = {
			factor = 0
		}
	}
	drop_ai_ally_favor_defense = {

		icon = generic_operation

		allowed = {
			is_ai1 = yes
		}
		target_array = allies

		target_trigger = {
			FROM = {
				OR = {
					is_puppet_of = ROOT
					is_in_faction_with = ROOT
				}	
			}
		}	
		
		available = {
			FROM = {
				has_idea = r56_ai_favor_defense
			}
			command_power > 10	
		}
		cost = 10
		
		days_remove = 30

		custom_cost_text = r56_10_command_power_cost	
		custom_cost_trigger = {
			command_power > 10			
		}		
	
		visible = {
			is_faction_leader = yes
			FROM = {
				has_idea = r56_ai_favor_defense
			}
			NOT = {
				has_country_flag = ROOT_hide_ai_allies_decisions_flag
			}

		}

		complete_effect = {
			add_command_power = -10			
		}
		remove_effect = {			
			FROM = {
				remove_ideas = r56_ai_favor_defense
			}				
		}			
		ai_will_do = {
			factor = 0
		}
	}

	ai_ally_favor_offense = {

		icon = infiltrate_state

		allowed = {
			is_ai1 = yes
		}
		target_array = allies

		target_trigger = {
			FROM = {
				OR = {
					is_puppet_of = ROOT
					is_in_faction_with = ROOT
				}	
			}
		}

		custom_cost_text = r56_10_command_power_cost	
		custom_cost_trigger = {
			command_power > 10			
		}
		available = {
			command_power > 10			
		}
		
	
		visible = {
			is_faction_leader = yes
			FROM = {
				is_ai = yes
				NOT = {
					OR = {
						has_idea = r56_ai_favor_defense
						has_idea = r56_ai_favor_offense
						has_idea = r56_ai_favor_war_production
						has_idea = r56_ai_favor_aviation
						has_idea = r56_ai_favor_navy
						has_decision = ai_ally_favor_aviation
						has_decision = ai_ally_favor_defense
						has_decision = ai_ally_favor_navy
						has_decision = ai_ally_favor_war_production						
					}
					
				}				
			}
			NOT = {
				has_country_flag = ROOT_hide_ai_allies_decisions_flag
			}

		}

		complete_effect = {
			add_command_power = -10			
			FROM = {
				add_ideas = r56_ai_favor_offense
			}			
		}			
		ai_will_do = {
			factor = 0
		}
	}
	drop_ai_ally_favor_offense = {

		icon = infiltrate_state

		allowed = {
			is_ai1 = yes
		}
		target_array = allies

		target_trigger = {
			FROM = {
				OR = {
					is_puppet_of = ROOT
					is_in_faction_with = ROOT
				}	
			}
		}	
		available = {
			FROM = {
				has_idea = r56_ai_favor_offense
			}
			command_power > 10		
		}
		cost = 10
		
		days_remove = 30

		custom_cost_text = r56_10_command_power_cost	
		custom_cost_trigger = {
			command_power > 10			
		}	
	
		visible = {
			is_faction_leader = yes
			FROM = {
				has_idea = r56_ai_favor_offense
			}
			NOT = {
				has_country_flag = ROOT_hide_ai_allies_decisions_flag
			}

		}

		complete_effect = {
			add_command_power = -10			
		}
		remove_effect = {			
			FROM = {
				remove_ideas = r56_ai_favor_offense
			}				
		}			
		ai_will_do = {
			factor = 0
		}
	}	

	ai_ally_favor_war_production = {

		icon = generic_industry

		allowed = {
			is_ai1 = yes
		}
		target_array = allies

		target_trigger = {
			FROM = {
				OR = {
					is_puppet_of = ROOT
					is_in_faction_with = ROOT
				}	
			}
		}
		custom_cost_text = r56_10_command_power_cost	
		custom_cost_trigger = {
			command_power > 10			
		}
		available = {
			command_power > 10			
		}
		
	
		visible = {
			is_faction_leader = yes
			FROM = {
				is_ai = yes
				NOT = {
					OR = {
						has_idea = r56_ai_favor_defense
						has_idea = r56_ai_favor_offense
						has_idea = r56_ai_favor_war_production
						has_idea = r56_ai_favor_aviation
						has_idea = r56_ai_favor_navy
						has_decision = ai_ally_favor_aviation
						has_decision = ai_ally_favor_offense
						has_decision = ai_ally_favor_defense
						has_decision = ai_ally_favor_navy						
					}
				}				
			}
			NOT = {
				has_country_flag = ROOT_hide_ai_allies_decisions_flag
			}

		}

		complete_effect = {
			add_command_power = -10		
			FROM = {
				add_ideas = r56_ai_favor_war_production
			}				
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	drop_ai_ally_favor_war_production = {

		icon = generic_industry

		allowed = {
			is_ai1 = yes
		}
		target_array = allies

		target_trigger = {
			FROM = {
				OR = {
					is_puppet_of = ROOT
					is_in_faction_with = ROOT
				}	
			}
		}		
		available = {
			FROM = {
				has_idea = r56_ai_favor_war_production
			}
		}
		
	
		visible = {
			is_faction_leader = yes
			FROM = {
				has_idea = r56_ai_favor_war_production
			}
			NOT = {
				has_country_flag = ROOT_hide_ai_allies_decisions_flag
			}

		}

		cost = 10
		
		days_remove = 30

		custom_cost_text = r56_10_command_power_cost	
		custom_cost_trigger = {
			command_power > 10			
		}
		available = {
			command_power > 10			
		}
		remove_effect = {			
			FROM = {
				remove_ideas = r56_ai_favor_war_production
			}				
		}			
		ai_will_do = {
			factor = 0
		}
	}	
	

}