# common variables
@coa_width = 768
@coa_height = 512
@canton_scale_cross_x = @[ ( 333 / coa_width ) + 0.001 ]
@canton_scale_cross_y = @[ ( 205 / coa_height ) + 0.001 ]
@canton_scale_sweden_x = @[ ( 255 / coa_width ) + 0.001 ]
@canton_scale_sweden_y = @[ ( 204 / coa_height ) + 0.001 ]
@canton_scale_norway_x = @[ ( 192 / coa_width ) + 0.001 ]
@canton_scale_norway_y = @[ ( 192 / coa_height ) + 0.001 ]
@canton_scale_denmark_x = @[ ( 220 / coa_width ) + 0.001 ]
@canton_scale_denmark_y = @[ ( 220 / coa_height ) + 0.001 ]
@third = @[1/3]

AOT = { # Aotearoa
	flag_definition = {
		coa = AOT
		subject_canton = AOT
	}
	
	# WB originals
	
	flag_definition = {
		coa = AOT_absolute_monarchy
		subject_canton = AOT_absolute_monarchy
		priority = 10
		trigger = { 
		coa_def_absolute_monarchy_flag_trigger = yes
		}
	}

	
	flag_definition = {
		coa = AOT_dictatorship
		subject_canton = AOT_dictatorship
		priority = 20
		allow_overlord_canton = no
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = AOT_communist
		subject_canton = AOT_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	
	flag_definition = {
		coa = AOT_anarchist
		subject_canton = AOT_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = AOT_ahitereiria_aotearoa
		subject_canton = AOT_ahitereiria_aotearoa
		priority = 15
		trigger = {
			exists = scope:actor
			scope:actor = {
				any_scope_state = {
					OR = {
						state_region = s:STATE_NEW_SOUTH_WALES
						state_region = s:STATE_VICTORIA
						state_region = s:STATE_TASMANIA
						state_region = s:STATE_QUEENSLAND
						state_region = s:STATE_SOUTH_AUSTRALIA
						state_region = s:STATE_WESTERN_AUSTRALIA
						state_region = s:STATE_NORTHERN_TERRITORY
						state_region = s:STATE_NORTH_ISLAND
						state_region = s:STATE_SOUTH_ISLAND
					}
					count >= 7
				}
				
				NOT = { has_journal_entry = je_australia_aus }
			}
		}
	}
}

AST = { # Australia
	flag_definition = {
		coa = AST
		coa_with_overlord_canton = AST_subject
		allow_overlord_canton = yes
	}
	flag_definition = {
		coa = AST_monarchy
		subject_canton = AST_monarchy
		priority = 5
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = AST_theocracy
		subject_canton = AST_theocracy
		priority = 10
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = AST_subject_GBR # WB edit
		subject_canton = AST_subject_GBR
		allow_overlord_canton = no		
		priority = 50
		trigger = { 
			coa_def_british_ensign_trigger = yes
		}
	}	

	# WB originals
	
	flag_definition = {
		coa = AST_dictatorship_GBR_subject
		subject_canton = AST_dictatorship_GBR_subject
		priority = 55
		trigger = {
			coa_def_british_ensign_trigger = yes
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = AST_dictatorship
		subject_canton = AST_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}

	flag_definition = {
		coa = AST_communist
		subject_canton = AST_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	
	flag_definition = {
		coa = AST_communist_GBR_subject
		subject_canton = AST_communist_GBR_subject
		priority = 1501
		trigger = {
			coa_def_british_ensign_trigger = yes
			coa_def_communist_flag_trigger = yes
		}
	}
	
	# WB anarchist flags
	flag_definition = {
		coa = AST_anarchist
		subject_canton = AST_anarchist
		priority = 1502
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	# New Zealand Australia flags

	flag_definition = {
		coa = AST_NZL
		coa_with_overlord_canton = AST_NZL_subject
		allow_overlord_canton = yes
		priority = 100
		
		trigger = {
			exists = scope:actor
			scope:actor = { has_variable = WB_is_New_Zealand_var }
		}
	}
	flag_definition = {
		coa = AST_NZL_monarchy
		subject_canton = AST_NZL_monarchy
		priority = 105
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_New_Zealand_var }
		}
	}	
	flag_definition = {
		coa = AST_NZL_theocracy
		subject_canton = AST_NZL_theocracy
		priority = 110
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_New_Zealand_var }
		}
	}
	flag_definition = {
		coa = AST_NZL_subject_GBR
		subject_canton = AST_NZL_subject_GBR
		allow_overlord_canton = no		
		priority = 150
		trigger = { 
			coa_def_british_ensign_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_New_Zealand_var }
		}
	}	
	
	flag_definition = {
		coa = AST_NZL_dictatorship_GBR_subject
		subject_canton = AST_NZL_dictatorship_GBR_subject
		priority = 155
		trigger = {
			coa_def_british_ensign_trigger = yes
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_New_Zealand_var }
		}
	}
	
	flag_definition = {
		coa = AST_NZL_dictatorship
		subject_canton = AST_NZL_dictatorship
		priority = 120
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_New_Zealand_var }
		}
	}
	
	flag_definition = {
		coa = NZL_fascist
		subject_canton = NZL_fascist
		priority = 1590
		trigger = {
			coa_def_fascist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_New_Zealand_var }
		}
	}

	flag_definition = {
		coa = AST_NZL_communist
		subject_canton = AST_NZL_communist
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_New_Zealand_var }
		}
	}		
	
	flag_definition = {
		coa = AST_NZL_communist_GBR_subject
		subject_canton = AST_NZL_communist_GBR_subject
		priority = 1601
		trigger = {
			coa_def_british_ensign_trigger = yes
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_New_Zealand_var }
		}
	}
	
	flag_definition = {
		coa = NZL_anarchist
		subject_canton = NZL_anarchist
		priority = 1602
		trigger = {
			coa_def_anarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_New_Zealand_var }
		}
	}
	
	# Tasmania's Australia flags
	
	flag_definition = {
		coa = AST_TAS
		coa_with_overlord_canton = AST_TAS_subject
		allow_overlord_canton = yes
		priority = 100
		
		trigger = {
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
		}
	}
	flag_definition = {
		coa = AST_TAS_monarchy
		subject_canton = AST_TAS_monarchy
		coa_with_overlord_canton = AST_TAS_subject
		allow_overlord_canton = yes
		priority = 105
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
		}
	}	
	flag_definition = {
		coa = AST_TAS_theocracy
		subject_canton = AST_TAS_theocracy
		priority = 110
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
		}
	}
	flag_definition = {
		coa = AST_TAS_subject_GBR # WB edit
		subject_canton = AST_TAS_subject_GBR
		allow_overlord_canton = no		
		priority = 150
		trigger = { 
			coa_def_british_ensign_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
		}
	}	
	
	flag_definition = {
		coa = AST_TAS_dictatorship_GBR_subject
		subject_canton = AST_TAS_dictatorship_GBR_subject
		priority = 160
		trigger = {
			coa_def_british_ensign_trigger = yes
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
		}
	}
	
	flag_definition = {
		coa = AST_TAS_dictatorship
		subject_canton = AST_TAS_dictatorship
		priority = 120
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
		}
	}

	flag_definition = {
		coa = AST_TAS_communist
		subject_canton = AST_TAS_communist
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
		}
	}		
	
	flag_definition = {
		coa = AST_TAS_communist_GBR_subject
		subject_canton = AST_TAS_communist_GBR_subject
		priority = 1601
		trigger = {
			coa_def_british_ensign_trigger = yes
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
		}
	}
	
	flag_definition = {
		coa = AST_TAS_anarchist
		subject_canton = AST_TAS_anarchist
		priority = 1602
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
		}
	}
	
	# Aboriginal Tasmania's Australia flags
	
	flag_definition = {
		coa = AST_TAS_free
		coa_with_overlord_canton = AST_TAS_free_subject
		allow_overlord_canton = yes
		priority = 110
		
		trigger = {
			NOT = { has_game_rule = WB_no_extra_fluff }
			
			exists = scope:actor
			
			OR = {
				scope:actor = { country_has_primary_culture = cu:aborigine }
				
				AND = {
					exists = c:AST
					c:AST = {
						ruler = { has_culture = cu:aborigine }
					}
				}
			}
		}
	}
	
	flag_definition = {
		coa = AST_TAS_free
		coa_with_overlord_canton = AST_TAS_free_subject
		allow_overlord_canton = yes
		priority = 110
		
		trigger = {
			NOT = { has_game_rule = WB_no_extra_fluff }
		
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
			
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}
	
	flag_definition = {
		coa = AST_TAS_free_eureka_flag
		coa_with_overlord_canton = AST_TAS_free_subject
		allow_overlord_canton = yes
		priority = 109
		
		trigger = {
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
			
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}
	
	flag_definition = {
		coa = AST_TAS_free_monarchy
		subject_canton = AST_TAS_free_monarchy
		coa_with_overlord_canton = AST_TAS_free_subject
		allow_overlord_canton = yes
		priority = 115
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
			
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}	
	flag_definition = {
		coa = AST_TAS_free_theocracy
		subject_canton = AST_TAS_free_theocracy
		priority = 120
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
			
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}
	flag_definition = {
		coa = AST_TAS_free_subject_GBR # WB edit
		subject_canton = AST_TAS_free_subject_GBR
		allow_overlord_canton = no		
		priority = 160
		trigger = { 
			coa_def_british_ensign_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
			
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}	
	
	flag_definition = {
		coa = AST_TAS_free_dictatorship_GBR_subject
		subject_canton = AST_TAS_free_dictatorship_GBR_subject
		priority = 165
		trigger = {
			coa_def_british_ensign_trigger = yes
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
			
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}
	
	flag_definition = {
		coa = AST_TAS_free_dictatorship
		subject_canton = AST_TAS_free_dictatorship
		priority = 130
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
			
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}

	flag_definition = {
		coa = AST_TAS_free_communist
		subject_canton = AST_TAS_free_communist
		priority = 1610
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
			
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}		
	
	flag_definition = {
		coa = AST_TAS_free_communist_GBR_subject
		subject_canton = AST_TAS_free_communist_GBR_subject
		priority = 1611
		trigger = {
			coa_def_british_ensign_trigger = yes
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
			
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}
	
	flag_definition = {
		coa = AST_TAS_free_anarchist
		subject_canton = AST_TAS_free_anarchist
		priority = 1612
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tasmania_var }
			
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}
	
	# Western Australia's Australia flags
	
	flag_definition = {
		coa = AST_WAS
		coa_with_overlord_canton = AST_WAS_subject
		allow_overlord_canton = yes
		priority = 100
		
		trigger = {
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Western_Australia_var }
		}
	}
	flag_definition = {
		coa = AST_WAS_monarchy
		subject_canton = AST_WAS_monarchy
		coa_with_overlord_canton = AST_WAS_subject
		allow_overlord_canton = yes
		priority = 105
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Western_Australia_var }
		}
	}	
	flag_definition = {
		coa = AST_WAS_theocracy
		subject_canton = AST_WAS_theocracy
		priority = 110
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Western_Australia_var }
		}
	}
	flag_definition = {
		coa = AST_WAS_subject_GBR # WB edit
		subject_canton = AST_WAS_subject_GBR
		allow_overlord_canton = no		
		priority = 150
		trigger = { 
			coa_def_british_ensign_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Western_Australia_var }
		}
	}	
	
	flag_definition = {
		coa = AST_WAS_dictatorship_GBR_subject
		subject_canton = AST_WAS_dictatorship_GBR_subject
		priority = 155
		trigger = {
			coa_def_british_ensign_trigger = yes
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Western_Australia_var }
		}
	}
	
	flag_definition = {
		coa = AST_WAS_dictatorship
		subject_canton = AST_WAS_dictatorship
		priority = 120
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Western_Australia_var }
		}
	}

	flag_definition = {
		coa = AST_WAS_communist
		subject_canton = AST_WAS_communist
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Western_Australia_var }
		}
	}		
	
	flag_definition = {
		coa = AST_WAS_communist_GBR_subject
		subject_canton = AST_WAS_communist_GBR_subject
		priority = 1601
		trigger = {
			coa_def_british_ensign_trigger = yes
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Western_Australia_var }
		}
	}
	
	flag_definition = {
		coa = WAS_anarchist
		subject_canton = WAS_anarchist
		priority = 1602
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Western_Australia_var }
		}
	}
	
	# South Australia's Australia flags
	
	flag_definition = {
		coa = AST_SAS
		coa_with_overlord_canton = AST_SAS_subject
		allow_overlord_canton = yes
		priority = 100
		
		trigger = {
			exists = scope:actor
			scope:actor = { has_variable = WB_is_South_Australia_var }
		}
	}
	flag_definition = {
		coa = AST_SAS_monarchy
		subject_canton = AST_SAS_monarchy
		coa_with_overlord_canton = AST_SAS_subject
		allow_overlord_canton = yes
		priority = 105
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_South_Australia_var }
		}
	}	
	flag_definition = {
		coa = AST_SAS_theocracy
		subject_canton = AST_SAS_theocracy
		priority = 110
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_South_Australia_var }
		}
	}
	flag_definition = {
		coa = AST_SAS_subject_GBR # WB edit
		subject_canton = AST_SAS_subject_GBR
		allow_overlord_canton = no		
		priority = 150
		trigger = { 
			coa_def_british_ensign_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_South_Australia_var }
		}
	}	
	
	flag_definition = {
		coa = AST_SAS_dictatorship_GBR_subject
		subject_canton = AST_SAS_dictatorship_GBR_subject
		priority = 155
		trigger = {
			coa_def_british_ensign_trigger = yes
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_South_Australia_var }
		}
	}
	
	flag_definition = {
		coa = AST_SAS_dictatorship
		subject_canton = AST_SAS_dictatorship
		priority = 120
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_South_Australia_var }
		}
	}

	flag_definition = {
		coa = AST_SAS_communist
		subject_canton = AST_SAS_communist
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_South_Australia_var }
		}
	}		
	
	flag_definition = {
		coa = AST_SAS_communist_GBR_subject
		subject_canton = AST_SAS_communist_GBR_subject
		priority = 1601
		trigger = {
			coa_def_british_ensign_trigger = yes
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_South_Australia_var }
		}
	}
	
	flag_definition = {
		coa = AST_SAS_anarchist
		subject_canton = AST_SAS_anarchist
		priority = 1602
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_South_Australia_var }
		}
	}
	
	# Australia Anglo Sisters Subject Flags
	
	flag_definition = {
		coa = AST_subject_CAN
		subject_canton = NZL_subject_CAN
		allow_overlord_canton = no		
		priority = 150
		trigger = { 
			OR = {
				coa_def_canadian_ensign_trigger = yes
				coa_def_ontarian_ensign_trigger = yes
			}
		}
	}
	
	flag_definition = {
		coa = AST_NZL_subject_CAN
		subject_canton = AST_NZL_subject_CAN
		allow_overlord_canton = no		
		priority = 151
		trigger = { 
			OR = {
				coa_def_canadian_ensign_trigger = yes
				coa_def_ontarian_ensign_trigger = yes
			}
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_New_Zealand_var }
		}
	}
	
	flag_definition = {
		coa = AST_subject_USA
		subject_canton = AST_subject_USA
		allow_overlord_canton = no		
		priority = 150
		trigger = { 
			coa_def_american_ensign_trigger = yes
		}
	}
	
	flag_definition = {
		coa = AST_NZL_subject_USA
		subject_canton = AST_NZL_subject_USA
		allow_overlord_canton = no		
		priority = 151
		trigger = { 
			coa_def_american_ensign_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_New_Zealand_var }
		}
	}
}

NSW = { # New South Wales
	flag_definition = {
		coa = NSW
		coa_with_overlord_canton = NSW_subject
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		subject_canton = NSW
	}
	
	# WB originals
	
	flag_definition = {
		coa = NSW_monarchy
		coa_with_overlord_canton = NSW_subject
		allow_overlord_canton = yes
		subject_canton = NSW_monarchy
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		priority = 20
		trigger = { 
			OR = {
				coa_def_monarchy_flag_trigger = yes
				coa_def_theocracy_flag_trigger = yes
			}
		}
	}
	
	flag_definition = {
		coa = NSW_dictatorship
		subject_canton = NSW_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}

	flag_definition = {
		coa = NSW_communist
		subject_canton = NSW_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	
	# WB anarchist flags
	flag_definition = {
		coa = AST_anarchist
		subject_canton = AST_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

NZL = { # New Zealand
	flag_definition = {
		coa = NZL
		coa_with_overlord_canton = NZL_canton
		allow_overlord_canton = yes
		priority = 1
	}
	flag_definition = {
		coa = NZL_absolute_monarchy
		allow_overlord_canton = yes
		coa_with_overlord_canton = NZL_absolute_monarchy_subject
		priority = 10
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = NZL_republic
		priority = 10
		allow_overlord_canton = yes
		overlord_canton_scale = { 0.25 0.25 }			
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = NZL_dictatorship
		subject_canton = NZL_dictatorship
		allow_overlord_canton = yes
		overlord_canton_scale = { 0.25 0.25 }	
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = NZL_fascist
		subject_canton = NZL_fascist
		priority = 1500
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}		
	flag_definition = {
		coa = NZL_republic_maori
		priority = 15
		trigger = {
			coa_def_republic_flag_trigger = yes
			coa_def_egalitarian_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = NZL_theocracy
		subject_canton = NZL_theocracy
		coa_with_overlord_canton = NZL_theocracy_subject
		allow_overlord_canton = yes
		priority = 20
		trigger = {
			coa_def_theocracy_flag_trigger = yes
		}
	}
	
	# WB originals
	
	flag_definition = {
		coa = NZL_subject_GBR
		subject_canton = NZL_subject_GBR
		allow_overlord_canton = no		
		priority = 20
		trigger = { 
			coa_def_british_ensign_trigger = yes
		}
	}
	
	flag_definition = {
		coa = NZL_theocracy_GBR_subject
		subject_canton = NZL_theocracy_GBR_subject
		allow_overlord_canton = no		
		priority = 25
		trigger = { 
			coa_def_british_ensign_trigger = yes
			coa_def_theocracy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = NZL_absolute_monarchy_GBR_subject
		allow_overlord_canton = no
		coa_with_overlord_canton = NZL_absolute_monarchy_GBR_subject
		priority = 25
		trigger = { 
			coa_def_british_ensign_trigger = yes
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = NZL_communist
		subject_canton = NZL_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	
	# WB anarchist flags
	flag_definition = {
		coa = NZL_anarchist
		subject_canton = NZL_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	# If Australia, Canada, or America puppets their baby sister
	
	flag_definition = {
		coa = NZL_subject_AST
		subject_canton = NZL_subject_AST
		allow_overlord_canton = no		
		priority = 20
		trigger = {
			OR = {
				coa_def_australian_ensign_trigger = yes
				coa_def_new_south_welsh_ensign_trigger = yes
			}
		}
	}
	
	flag_definition = {
		coa = NZL_subject_CAN
		subject_canton = NZL_subject_CAN
		allow_overlord_canton = no		
		priority = 20
		trigger = { 
			OR = {
				coa_def_canadian_ensign_trigger = yes
				coa_def_ontarian_ensign_trigger = yes
			}
		}
	}
	
	flag_definition = {
		coa = NZL_subject_USA
		subject_canton = NZL_subject_USA
		allow_overlord_canton = no		
		priority = 20
		trigger = { 
			coa_def_american_ensign_trigger = yes
		}
	}
}

SAS = { # South Australia
	flag_definition = {
		coa = SAS
		coa_with_overlord_canton = SAS_subject
		allow_overlord_canton = yes
	}
	
	# WB originals
	
	flag_definition = {
		coa = SAS_republic
		subject_canton = SAS_republic
		priority = 10
		coa_with_overlord_canton = SAS_subject
		allow_overlord_canton = yes		
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = SAS_dictatorship
		subject_canton = SAS_dictatorship
		coa_with_overlord_canton = SAS_dictatorship_subject
		priority = 60
		allow_overlord_canton = yes
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = SAS_communist
		subject_canton = SAS_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	
	flag_definition = {
		coa = SAS_anarchist
		subject_canton = SAS_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = SAS_theocracy
		subject_canton = SAS_theocracy
		priority = 20
		trigger = {
			coa_def_theocracy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = SAS_subject_1876
		subject_canton = SAS_subject_1876
		coa_with_overlord_canton = SAS_subject_1876
		allow_overlord_canton = yes
		priority = 50
		trigger = {
			coa_def_independent_trigger = no
			
			AND = {
					exists = c:SAS
					c:SAS = {
						any_scope_state = {
							state_region = { is_homeland = australian }
							count > 1
						}
					}
			}
		}
	}
	
	flag_definition = {
		coa = SAS_subject_modern
		subject_canton = SAS_subject_modern
		coa_with_overlord_canton = SAS_subject_modern
		allow_overlord_canton = yes
		priority = 51
		trigger = {
			coa_def_independent_trigger = no
			
			AND = {
					exists = c:SAS
					c:SAS = {
						any_scope_state = {
							state_region = { is_homeland = australian }
							count > 3
						}
					}
			}
		}
	}
}


TAS = { # Tasmania
	flag_definition = {
		coa = TAS
		coa_with_overlord_canton = TAS_subject
		allow_overlord_canton = yes
	}
	
	# WB originals
	
	flag_definition = {
		coa = TAS_van_diemens_land
		coa_with_overlord_canton = TAS_van_diemens_land_subject
		allow_overlord_canton = yes
		overlord_canton_scale = { 0.46 0.45 }
		priority = 50
		trigger = {
			exists = scope:actor
			scope:actor = {
				NOT = { 
					AND = {
						has_technology_researched = central_archives
						has_technology_researched = egalitarianism
						has_technology_researched = central_banking
						has_technology_researched = nationalism
					}
				}
			}
		}
	}
	
	flag_definition = {
		coa = TAS_republic
		priority = 10
		coa_with_overlord_canton = TAS_subject
		allow_overlord_canton = yes		
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = TAS_dictatorship
		subject_canton = TAS_dictatorship
		coa_with_overlord_canton = TAS_subject
		allow_overlord_canton = yes
		priority = 55
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = TAS_communist
		subject_canton = TAS_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	
	flag_definition = {
		coa = TAS_theocracy
		subject_canton = TAS_theocracy
		priority = 55
		trigger = {
			coa_def_theocracy_flag_trigger = yes
		}
	}
	
	# WB anarchist flags
	flag_definition = {
		coa = TAS_anarchist
		subject_canton = TAS_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	# Free/Non-Prisoner/Aboriginal Tasmania
	
	flag_definition = {
		coa = TAS_free_van_diemens_land
		coa_with_overlord_canton = TAS_free_van_diemens_land_subject
		allow_overlord_canton = yes
		overlord_canton_scale = { 0.46 0.45 }
		priority = 150
		trigger = {
			exists = scope:actor
			scope:actor = {
				NOT = { 
					AND = {
						has_technology_researched = central_archives
						has_technology_researched = egalitarianism
						has_technology_researched = central_banking
						has_technology_researched = nationalism
					}
				}
			}
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}
	
	flag_definition = {
		coa = TAS_free
		coa_with_overlord_canton = TAS_free_subject
		allow_overlord_canton = yes
		
		priority = 100
		
		trigger = { 
			exists = scope:actor
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}
	
	flag_definition = {
		coa = TAS_free_republic
		priority = 110
		coa_with_overlord_canton = TAS_free_subject
		allow_overlord_canton = yes		
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}
	
	flag_definition = {
		coa = TAS_free_dictatorship
		subject_canton = TAS_free_dictatorship
		priority = 151
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}
	
	flag_definition = {
		coa = TAS_free_communist
		subject_canton = TAS_free_communist
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}		
	
	flag_definition = {
		coa = TAS_free_theocracy
		subject_canton = TAS_free_theocracy
		priority = 151
		trigger = {
			coa_def_theocracy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}
	
	flag_definition = {
		coa = TAS_free_anarchist
		subject_canton = TAS_free_anarchist
		priority = 1601
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				has_law = law_type:law_multicultural
				has_law = law_type:law_slavery_banned
			}
		}
	}
}

WAS = { # Western Australia
	flag_definition = {
		coa = WAS
		subject_canton = WAS
		coa_with_overlord_canton = WAS_subject
		allow_overlord_canton = yes
	}
	
	# WB originals
	
	flag_definition = {
		coa = WAS_republic
		subject_canton = WAS_republic
		priority = 10
		coa_with_overlord_canton = WAS_subject
		allow_overlord_canton = yes		
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = WAS_dictatorship
		subject_canton = WAS_dictatorship
		coa_with_overlord_canton = WAS_dictatorship_subject
		priority = 20
		allow_overlord_canton = yes
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = WAS_communist
		subject_canton = WAS_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	
	flag_definition = {
		coa = WAS_anarchist
		subject_canton = WAS_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = WAS_theocracy
		subject_canton = WAS_theocracy
		priority = 20
		trigger = {
			coa_def_theocracy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = WAS_westralia
		subject_canton = WAS_westralia
		priority = 15
		trigger = {
			coa_def_british_ensign_trigger = yes
			
			OR = {
				AND = {
					scope:actor = { 
						country_rank >= rank_value:major_power
					}
				}
				AND = {
					exists = c:WAS
					c:WAS = {
						any_scope_state = {
							state_region = { is_homeland = australian }
							count > 2
						}
					}
				}
			}
		}
	}
}

UNT = { # United Tribes of New Zealand
	flag_definition = {
		coa = UNT
		subject_canton = sub_UNT_canton_black
	}
	flag_definition = {
		coa = UNT_subject
		priority = 5
		subject_canton = sub_UNT_canton_white
		trigger = { 
			coa_def_independent_trigger = no
		}
	}
	
	# WB originals
	
	flag_definition = {
		coa = UNT_absolute_monarchy
		subject_canton = UNT_absolute_monarchy
		priority = 10
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			coa_def_independent_trigger = yes
		}
	}
	
	flag_definition = {
		coa = UNT_independent_monarchy
		subject_canton = UNT_independent_monarchy
		priority = 8
		trigger = { 
			coa_def_monarchy_flag_trigger = yes = yes
			coa_def_independent_trigger = yes
		}
	}
	
	flag_definition = {
		coa = UNT_dictatorship
		subject_canton = UNT_dictatorship
		priority = 20
		allow_overlord_canton = no
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = UNT_communist
		subject_canton = UNT_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	
	flag_definition = {
		coa = UNT_anarchist
		subject_canton = UNT_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}


PNS = { # Polynesia
	flag_definition = {
		coa = PNS
		subject_canton = PNS
		priority = 1
	}
	flag_definition = {
		coa = PNS_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	
	# WB originals
	
	
	## Aotearoa Polynesia 
	
	flag_definition = {
		coa = PNS_AOT
		subject_canton = PNS_AOT
		priority = 2
		
		trigger = { 
			scope:actor ?= {
				OR = {
					was_formed_from = AOT
					was_formed_from = UNT
				}
			}
		}
	}
	
	flag_definition = {
		coa = PNS_AOT_republic
		subject_canton = PNS_AOT_republic
		priority = 11
		
		trigger = { 
			coa_def_republic_flag_trigger = yes
		
			scope:actor ?= {
				OR = {
					was_formed_from = AOT
					was_formed_from = UNT
				}
			}
		}
	}
	
	flag_definition = {
		coa = PNS_AOT_communist
		subject_canton = PNS_AOT_communist
		priority = 1501
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= {
				OR = {
					was_formed_from = AOT
					was_formed_from = UNT
				}
			}
		}
	}
	
	flag_definition = {
		coa = PNS_AOT_dictatorship
		subject_canton = PNS_AOT_dictatorship
		priority = 20
		allow_overlord_canton = no
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= {
				OR = {
					was_formed_from = AOT
					was_formed_from = UNT
				}
			}
		}
	}
	
	flag_definition = {
		coa = AOT_anarchist
		subject_canton = AOT_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= {
				OR = {
					was_formed_from = AOT
					was_formed_from = UNT
				}
			}
		}
	}
}