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

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

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

world_at_peace_countries = {
	input = game:all_countries
	operators = {
		limit = {
			has_war = no 
		}
	}
	name = COLLECTION_COUNTRIES_AT_PEACE
}

# New Order in Asia etc

countries_asia = {
	input = game:all_countries
	name = COLLECTION_COUNTRIES_ASIA
	operators = {
		limit = {
			capital_scope = { is_on_continent = asia }
		}
	}
}

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

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

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


faction_owned_core_states = {
	input = game:scope
	operators = {
		faction_members
		owned_states
		limit = {
			is_core_of = PREV 
		}
	}
	name = COLLECTION_FACTION_OWNED_CORE_STATES
}

faction_controlled_non_core_states = {
	input = game:scope
	operators = {
		faction_members
		controlled_states
		limit = {
			NOT = { is_core_of = PREV }
		}
	}
	name = COLLECTION_FACTION_CONTROLLED_NON_CORE_STATES
}


country_and_all_subjects_controlled_non_core_states = {
	input = game:scope
	operators = {
		country_and_all_subjects
		controlled_states
		limit = {
			NOT = { is_core_of = PREV }
		}
	}
	name = COLLECTION_COUNTRY_AND_SUBJECTS_CONTROLLED_NON_CORE_STATES
}

states_in_africa = {
	input = game:all_states
	operators = {
		limit = {
			is_on_continent = africa
		}
	}
	name = COLLECTION_STATES_IN_AFRICA
}

faction_states_in_africa = {
	input = game:scope
	operators = {
		faction_members
		controlled_states
		limit = {
			is_on_continent = africa
		}
	}
	name = COLLECTION_FACTION_CONTROLLED_STATES_IN_AFRICA
}

states_in_americas = {
	input = game:all_states
	operators = {
		limit = {
			OR = {
				is_on_continent = north_america
				is_on_continent = south_america
			}
		}
	}
	name = COLLECTION_STATES_IN_AMERICAS
}

faction_states_in_americas = {
	input = game:scope
	operators = {
		faction_members
		controlled_states
		limit = {
			OR = {
				is_on_continent = north_america
				is_on_continent = south_america
			}
		}
	}
	name = COLLECTION_FACTION_CONTROLLED_STATES_IN_AMERICAS
}

states_in_the_baltics = {
	input = game:all_states
	operators = {
		limit = {
			OR = {
				region = 37
				state = 763 
				state = 784  
				state = 208  
				state = 209   
			}
		}
	}
	name = COLLECTION_STATES_IN_BALTICS
}

faction_states_in_the_baltics = {
	input = game:scope
	operators = {
		faction_members
		controlled_states
		limit = {
			OR = {
				region = 37
				state = 763 
				state = 784  
				state = 208  
				state = 209   
			}
		}
	}
	name = COLLECTION_FACTION_CONTROLLED_STATES_IN_BALTICS
}

states_in_the_nordics = {
	input = game:all_states
	operators = {
		limit = {
			OR = {
				region = 275 
				region = 10
				region = 11
				region = 192
				region = 276
				region = 191
				region = 277
				region = 278
				region = 13
				region = 161
				region = 36 
				region = 45 
			}
		}
	}
	name = COLLECTION_STATES_IN_NORDICS
}

faction_states_in_the_nordics = {
	input = game:scope
	operators = {
		faction_members
		controlled_states
		limit = {
			OR = {
				region = 275 
				region = 10
				region = 11
				region = 192
				region = 276
				region = 191
				region = 277
				region = 278
				region = 13
				region = 161
				region = 36 
				region = 45 
			}
		}
	}
	name = COLLECTION_FACTION_CONTROLLED_STATES_IN_NORDICS
}

states_in_europe = {
	input = game:all_states
	operators = {
		limit = {
			is_on_continent = europe			
		}
	}
	name = COLLECTION_STATES_IN_EUROPE
}

faction_states_in_europe = {
	input = game:scope
	operators = {
		faction_members
		controlled_states
		limit = {
			is_on_continent = europe			
		}
	}
	name = COLLECTION_FACTION_CONTROLLED_STATES_IN_EUROPE
}

states_in_asia = {
	input = game:all_states
	operators = {
		limit = {
			is_on_continent = asia
		}
	}
	name = COLLECTION_STATES_IN_ASIA
}

faction_states_in_asia = {
	input = game:scope
	operators = {
		faction_members
		controlled_states
		limit = {
			is_on_continent = asia			
		}
	}
	name = COLLECTION_FACTION_CONTROLLED_STATES_IN_ASIA
}

states_in_middle_east = {
	input = game:all_states
	operators = {
		limit = {
			is_on_continent = middle_east
		}
	}
	name = COLLECTION_STATES_IN_MIDDLE_EAST
}

faction_states_in_middle_east = {
	input = game:scope
	operators = {
		faction_members
		controlled_states
		limit = {
			is_on_continent = middle_east			
		}
	}
	name = COLLECTION_FACTION_CONTROLLED_STATES_IN_MIDDLE_EAST
}

states_in_oceania = {
	input = game:all_states
	operators = {
		limit = {
			is_on_continent = australia
		}
	}
	name = COLLECTION_STATES_IN_OCEANIA
}

states_in_asia_and_oceania = {
	input = game:all_states
	operators = {
		limit = {
			OR = {
				is_on_continent = asia
				is_on_continent = australia
			}
		}
	}
	name = COLLECTION_STATES_IN_ASIA_AND_IN_OCEANIA
}
states_on_my_continent = {
	input = game:all_states
	operators = {
		limit = {
			is_on_same_continent_as = ROOT
		}
	}
	name = COLLECTION_STATES_MY_CONTINENT
}

states_controlled_by_faction_member_and_core_holder = {
	input = game:scope
	operators = {
		faction_members
		controlled_states
		limit = {
			is_core_of = controller
		}
	}
	name = COLLECTION_STATES_CONTROLLED_BY_FACTION_MEMBER_AND_CORE_HOLDER
}


# Balkans Factions

controllable_balkan_states = {
	input = constant:state_groups.balkans
	name = COLLECTION_FACTION_BALKAN_STATES
}

faction_controlled_balkan_states = {
	input = constant:state_groups.balkans
	operators = {
		limit = {
			is_controlled_by_ROOT_or_ally = yes 
		}
	}
	name = COLLECTION_FACTION_CONTROLLED_BALKAN_STATES
}


# African Union 
african_states = {
	input = game:all_states
	operators = {
		limit = {
			is_on_continent = africa 
		}
	}
}

non_colonial_power_controlled_african_states = {
	input = collection:african_states 
	operators = {
		limit = {
			controller = {
				AND = {
					capital_scope = {
						is_on_continent = africa 
					}
					NOT = {
						any_country = {
							has_subject = PREV
							capital_scope = {
								NOT = {
									is_on_continent = africa
								}
							}
						}
					}
				}
			}
		}
	}
	name = COLLECTION_NON_COLONIAL_CONTROLLED_AFRICAN_STATES
}

# Islamic World 

all_islamic_countries = {
	input = constant:country_groups.islamic_world
	name = COLLECTION_FACTION_ISLAMIC_COUNTRIES
}

islamic_faction_members = {
	input = constant:country_groups.islamic_world
	operators = {
		#faction_members
		limit = {
			OR = {
				tag = ROOT
				is_in_faction_with = ROOT
			}
		}
	}
	name = COLLECTION_ISLAMIC_FACTION_MEMBERS
}

neighboring_states_to_leader = {
	input = game:all_states
	name = COLLECTION_NEIGHBORING_STATES
	operators = {
		limit = {
			any_neighbor_state = {
				is_owned_by = ROOT 
			}	
		}
	}
}

puppet_controlled_border_states = {
	input = collection:neighboring_states_to_leader
	name = COLLECTION_CONTROLLED_PUPPET_BORDER_STATES
	operators = {
		limit = {
			controller = {
				is_subject_of = ROOT
			}
		}
	}
}

# Faction Goals