# 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]

AUS = { # Austria
	flag_definition = {
		coa = AUS
		subject_canton = AUS		
		
		allow_overlord_canton = yes
		coa_with_overlord_canton = AUS_subject
		allow_overlord_canton = yes		
		overlord_canton_scale = { 0.337 0.337 }
		
		priority = 1
	}

	flag_definition = {
		coa = AUS_absolute_monarchy
		subject_canton = AUS_absolute_monarchy
		
		coa_with_overlord_canton = AUS_subject
		allow_overlord_canton = yes		
		overlord_canton_scale = { 0.337 0.337 }	
		
		priority = 20
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = AUS_republic
		subject_canton = AUS_republic
		priority = 10
		
		coa_with_overlord_canton = AUS_subject
		allow_overlord_canton = yes		
		overlord_canton_scale = { 0.337 0.337 }
		
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = AUS_dictatorship
		subject_canton = AUS_dictatorship
		priority = 20
		
		coa_with_overlord_canton = AUS_subject
		allow_overlord_canton = yes		
		overlord_canton_scale = { 0.337 0.337 }
		
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = AUS_theocracy
		subject_canton = AUS_theocracy
		priority = 10
		
		coa_with_overlord_canton = AUS_subject
		allow_overlord_canton = yes		
		overlord_canton_scale = { 0.337 0.337 }
		
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
	flag_definition = { # I did not realise KUK is the Danubian State and not Austria-Hungary
		coa = AUS_Austria_Hungary
		subject_canton = AUS_Austria_Hungary
		priority = 100
		trigger = { 
			exists = scope:actor
			scope:actor = { country_has_primary_culture = cu:hungarian }
		}
	}
	flag_definition = {
		coa = AUS_communist
		priority = 1500
		
		coa_with_overlord_canton = AUS_subject
		allow_overlord_canton = yes		
		overlord_canton_scale = { 0.337 0.337 }
		
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = AUS_fascist
		subject_canton = AUS_fascist
		priority = 1500
		
		coa_with_overlord_canton = AUS_subject
		allow_overlord_canton = yes		
		overlord_canton_scale = { 0.337 0.337 }
		
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}		

	# WB originals - The Bulli Flag
	flag_definition = {
		coa = AUS_anarchist
		subject_canton = AUS_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = AUS_flag_hole_republic
		subject_canton = AUS_flag_hole_republic
		priority = 1502
		allow_revolutionary_indicator = no
		trigger = {
			exists = c:AUS
			exists = scope:actor
			
			coa_def_secessionist_or_revolutionary_trigger = yes
			
			scope:actor = {
				is_secessionist = no
				OR = {
					has_law = law_type:law_presidential_republic
					has_law = law_type:law_parliamentary_republic
				}
			}
			
			c:AUS = {
				has_law = law_type:law_council_republic
			}
		}
	}
	
	flag_definition = {
		coa = AUS_flag_hole_monarchy
		subject_canton = AUS_flag_hole_monarchy
		allow_revolutionary_indicator = no
		priority = 1502
		trigger = {
			exists = c:AUS
			exists = scope:actor
			
			coa_def_secessionist_or_revolutionary_trigger = yes
			
			scope:actor = {
				is_secessionist = no
				OR = {
					has_law = law_type:law_chiefdom
					has_law = law_type:law_monarchy
				}
			}
			
			c:AUS = {
				has_law = law_type:law_council_republic
			}
		}
	}
	
	# Austria-Hungary flags 
	
	flag_definition = {
		coa = AUS_Austria_Hungary_republic
		subject_canton = AUS_Austria_Hungary_republic
		priority = 120
		trigger = { 
			exists = scope:actor
			scope:actor = { country_has_primary_culture = cu:hungarian }
			
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = AUS_Austria_Hungary_dictatorship
		subject_canton = AUS_Austria_Hungary_dictatorship
		priority = 130
		trigger = { 
			exists = scope:actor
			scope:actor = { country_has_primary_culture = cu:hungarian }
			
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = AUS_Austria_Hungary_communist
		subject_canton = AUS_Austria_Hungary_communist
		priority = 1501
		trigger = { 
			exists = scope:actor
			scope:actor = { country_has_primary_culture = cu:hungarian }
			
			coa_def_communist_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = AUS_Austria_Hungary_anarchist
		subject_canton = AUS_Austria_Hungary_anarchist
		priority = 1502
		trigger = { 
			exists = scope:actor
			scope:actor = { country_has_primary_culture = cu:hungarian }
			
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	# A-H Austria standalone
	
	flag_definition = {
		coa = AUS_Austria_Hungary_standalone
		subject_canton = AUS_Austria_Hungary_standalone
		priority = 200
		trigger = { 
			exists = scope:actor
			scope:actor = { country_has_primary_culture = cu:hungarian }
			
			exists = c:HUN
			c:HUN = {
				NOT = { is_subject_of = c:AUS }
			}
		}
	}
	
	flag_definition = {
		coa = AUS_Austria_Hungary_republic_standalone
		subject_canton = AUS_Austria_Hungary_republic_standalone
		priority = 220
		trigger = { 
			exists = scope:actor
			scope:actor = { country_has_primary_culture = cu:hungarian }
			
			coa_def_republic_flag_trigger = yes
			
			exists = c:HUN
			c:HUN = {
				NOT = { is_subject_of = c:AUS }
			}
		}
	}
	
	flag_definition = {
		coa = AUS_Austria_Hungary_dictatorship_standalone
		subject_canton = AUS_Austria_Hungary_dictatorship_standalone
		priority = 230
		trigger = { 
			exists = scope:actor
			scope:actor = { country_has_primary_culture = cu:hungarian }
			
			coa_def_dictatorship_flag_trigger = yes
			
			exists = c:HUN
			c:HUN = {
				NOT = { is_subject_of = c:AUS }
			}
		}
	}
	
	flag_definition = {
		coa = AUS_Austria_Hungary_communist_standalone
		subject_canton = AUS_Austria_Hungary_communist_standalone
		priority = 1601
		trigger = { 
			exists = scope:actor
			scope:actor = { country_has_primary_culture = cu:hungarian }
			
			coa_def_communist_flag_trigger = yes
			
			exists = c:HUN
			c:HUN = {
				NOT = { is_subject_of = c:AUS }
			}
		}
	}
	
	flag_definition = {
		coa = AUS_anarchist
		subject_canton = AUS_anarchist
		priority = 1602
		trigger = { 
			exists = scope:actor
			scope:actor = { country_has_primary_culture = cu:hungarian }
			
			coa_def_anarchy_flag_trigger = yes
			
			exists = c:HUN
			c:HUN = {
				NOT = { is_subject_of = c:AUS }
			}
		}
	}
}

BAV = { # Bavaria
	flag_definition = {
		coa = BAV
		subject_canton = BAV
		allow_overlord_canton = yes
		coa_with_overlord_canton = BAV_subject
		priority = 1
	}
	flag_definition = {
		coa = BAV_republic
		subject_canton = BAV_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = BAV_absolute_monarchy
		subject_canton = BAV_absolute_monarchy
		allow_overlord_canton = yes
		coa_with_overlord_canton = BAV_subject
		priority = 20
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = BAV_theocracy
		subject_canton = BAV_theocracy
		priority = 20
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = BAV_communist
		subject_canton = BAV_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = BAV_subject_PRU
		subject_canton = BAV_subject_PRU
		priority = 50
		trigger = { 
			coa_def_prussian_ensign_trigger = yes
		}
	}	
	
	# WB originals
	
	flag_definition = {
		coa = BAV_dictatorship
		subject_canton = BAV_dictatorship
		allow_overlord_canton = yes
		priority = 50
		
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = BAV_anarchist
		subject_canton = BAV_anarchist
		priority = 1502
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = BAV_communist_revolutionary
		subject_canton = BAV_communist_revolutionary
		priority = 1501
		trigger = {
			coa_def_communist_flag_trigger = yes
			coa_def_secessionist_or_revolutionary_trigger = yes
		}
	}
}

DEN = { # Denmark
	flag_definition = {
		coa = DEN
		coa_with_overlord_canton = DEN
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_denmark_x @canton_scale_denmark_y }
		subject_canton = DEN_canton
	}
	flag_definition = {
		coa = DEN_absolute_monarchy
		subject_canton = DEN_absolute_monarchy
		priority = 20
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = DEN_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = DEN_fascist
		subject_canton = DEN_fascist
		priority = 10
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}	
	
	# WB originals
	
	flag_definition = {
		coa = DEN_republic
		coa_with_overlord_canton = DEN_republic
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_denmark_x @canton_scale_denmark_y }
		subject_canton = DEN_canton
		priority = 10
		
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = DEN_anarchist
		priority = 1501
		subject_canton = DEN_anarchist
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = DEN_dictatorship
		coa_with_overlord_canton = DEN_dictatorship
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_denmark_x @canton_scale_denmark_y }
		subject_canton = DEN_canton
		priority = 1000
		
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}
}

BEL = { # Belgium

	flag_definition = {
		coa = BEL
		subject_canton = BEL
		allow_overlord_canton = yes	
		coa_with_overlord_canton = BEL_subject			
		priority = 1
	}
	# WB edits
	flag_definition = {
		coa = BEL_no_flanders
		subject_canton = BEL_no_flanders
		allow_overlord_canton = yes	
		coa_with_overlord_canton = BEL_subject			
		priority = 2
		trigger = {
			scope:actor ?= {
				OR= {
					exists = c:FLA
				
					AND = {
						has_state_in_state_region = STATE_WALLONIA
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_no_wallonia
		subject_canton = BEL_no_wallonia
		allow_overlord_canton = yes	
		coa_with_overlord_canton = BEL_subject			
		priority = 2
		trigger = {
			scope:actor ?= {
				OR= {
					exists = c:WLL
				
					AND = {
						has_state_in_state_region = STATE_FLANDERS
						NOT = { has_state_in_state_region = STATE_WALLONIA }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_no_both
		subject_canton = BEL_no_both
		allow_overlord_canton = yes	
		coa_with_overlord_canton = BEL_subject			
		priority = 3
		trigger = {
			scope:actor ?= {
				OR= {
					has_variable = WB_belgium_no_chibis_var
				
					AND = {
						exists = c:FLA
						exists = c:WLL
					}
				
					AND = {
						NOT = { has_state_in_state_region = STATE_WALLONIA }
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	
	
	flag_definition = {
		coa = BEL_absolute_monarchy
		subject_canton = BEL_absolute_monarchy
		priority = 20
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}	
	# WB edits
	flag_definition = {
		coa = BEL_absolute_monarchy_no_flanders
		subject_canton = BEL_absolute_monarchy_no_flanders
		priority = 21
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:FLA
				
					AND = {
						has_state_in_state_region = STATE_WALLONIA
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_absolute_monarchy_no_wallonia
		subject_canton = BEL_absolute_monarchy_no_wallonia
		priority = 21
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:WLL
				
					AND = {
						has_state_in_state_region = STATE_FLANDERS
						NOT = { has_state_in_state_region = STATE_WALLONIA }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_absolute_monarchy_no_both
		subject_canton = BEL_absolute_monarchy_no_both
		priority = 22
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					has_variable = WB_belgium_no_chibis_var
					
					AND = {
						exists = c:FLA
						exists = c:WLL
					}
				
					AND = {
						NOT = { has_state_in_state_region = STATE_WALLONIA }
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	
	
	flag_definition = {
		coa = BEL_republic
		subject_canton = BEL_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	# WB edits
	flag_definition = {
		coa = BEL_republic_no_flanders
		subject_canton = BEL_republic_no_flanders
		priority = 11
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:FLA
				
					AND = {
						has_state_in_state_region = STATE_WALLONIA
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_republic_no_wallonia
		subject_canton = BEL_republic_no_wallonia
		priority = 11
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:WLL
				
					AND = {
						has_state_in_state_region = STATE_FLANDERS
						NOT = { has_state_in_state_region = STATE_WALLONIA }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_republic_no_both
		subject_canton = BEL_republic_no_both
		priority = 12
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					has_variable = WB_belgium_no_chibis_var
					
					AND = {
						exists = c:FLA
						exists = c:WLL
					}
				
					AND = {
						NOT = { has_state_in_state_region = STATE_WALLONIA }
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	
	
	flag_definition = {
		coa = BEL_dictatorship
		subject_canton = BEL_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	# WB edits
	flag_definition = {
		coa = BEL_dictatorship_no_flanders
		subject_canton = BEL_dictatorship_no_flanders
		priority = 21
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:FLA
				
					AND = {
						has_state_in_state_region = STATE_WALLONIA
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_dictatorship_no_wallonia
		subject_canton = BEL_dictatorship_no_wallonia
		priority = 21
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:WLL
				
					AND = {
						has_state_in_state_region = STATE_FLANDERS
						NOT = { has_state_in_state_region = STATE_WALLONIA }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_dictatorship_no_both
		subject_canton = BEL_dictatorship_no_both
		priority = 22
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					has_variable = WB_belgium_no_chibis_var
					
					AND = {
						exists = c:FLA
						exists = c:WLL
					}
				
					AND = {
						NOT = { has_state_in_state_region = STATE_WALLONIA }
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	
	
	flag_definition = {
		coa = BEL_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	# WB edits
	flag_definition = {
		coa = BEL_communist_no_flanders
		subject_canton = BEL_communist_no_flanders
		priority = 1501
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:FLA
				
					AND = {
						has_state_in_state_region = STATE_WALLONIA
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_communist_no_wallonia
		subject_canton = BEL_communist_no_wallonia
		priority = 1501
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:WLL
				
					AND = {
						has_state_in_state_region = STATE_FLANDERS
						NOT = { has_state_in_state_region = STATE_WALLONIA }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_communist_no_both
		subject_canton = BEL_communist_no_both
		priority = 1502
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					has_variable = WB_belgium_no_chibis_var
					
					AND = {
						exists = c:FLA
						exists = c:WLL
					}
				
					AND = {
						NOT = { has_state_in_state_region = STATE_WALLONIA }
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	
	
	flag_definition = {
		coa = BEL_fascist
		subject_canton = BEL_fascist
		priority = 1500
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}	
	# WB edits
	flag_definition = {
		coa = BEL_fascist_no_flanders
		subject_canton = BEL_fascist_no_flanders
		priority = 1501
		trigger = { 
			coa_def_fascist_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:FLA
				
					AND = {
						has_state_in_state_region = STATE_WALLONIA
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_fascist_no_wallonia
		subject_canton = BEL_fascist_no_wallonia
		priority = 1501
		trigger = { 
			coa_def_fascist_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:WLL
				
					AND = {
						has_state_in_state_region = STATE_FLANDERS
						NOT = { has_state_in_state_region = STATE_WALLONIA }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_fascist_no_both
		subject_canton = BEL_fascist_no_both
		priority = 1502
		trigger = { 
			coa_def_fascist_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					has_variable = WB_belgium_no_chibis_var
					
					AND = {
						exists = c:FLA
						exists = c:WLL
					}
				
					AND = {
						NOT = { has_state_in_state_region = STATE_WALLONIA }
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	
	
	flag_definition = {
		coa = BEL_subject	
		subject_canton = BEL
		allow_overlord_canton = yes	
		overlord_canton_offset = { 0.01 0.015 }
		overlord_canton_scale = { 0.48 0.47 }			
		priority = 50
		trigger = { 
			coa_def_french_ensign_trigger = yes
		}
	}	
	flag_definition = {
		coa = BEL_subject	
		subject_canton = BEL
		allow_overlord_canton = yes	
		overlord_canton_offset = { 0.01 0.015 }
		overlord_canton_scale = { 0.48 0.47 }			
		priority = 50
		trigger = { 
			coa_def_spanish_ensign_trigger = yes
		}
	}		
	
	# WB originals
	
	flag_definition = {
		coa = BEL_anarchist
		subject_canton = BEL_anarchist
		priority = 1600
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = BEL_anarchist_no_flanders
		subject_canton = BEL_anarchist_no_flanders
		priority = 1601
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:FLA
				
					AND = {
						has_state_in_state_region = STATE_WALLONIA
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_anarchist_no_wallonia
		subject_canton = BEL_anarchist_no_wallonia
		priority = 1601
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:WLL
				
					AND = {
						has_state_in_state_region = STATE_FLANDERS
						NOT = { has_state_in_state_region = STATE_WALLONIA }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_anarchist_no_both
		subject_canton = BEL_anarchist_no_both
		priority = 1602
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					has_variable = WB_belgium_no_chibis_var
					
					AND = {
						exists = c:FLA
						exists = c:WLL
					}
				
					AND = {
						NOT = { has_state_in_state_region = STATE_WALLONIA }
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	
	flag_definition = {
		coa = BEL_theocracy
		subject_canton = BEL_theocracy
		priority = 20
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = BEL_theocracy_no_flanders
		subject_canton = BEL_theocracy_no_flanders
		priority = 21
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:FLA
				
					AND = {
						has_state_in_state_region = STATE_WALLONIA
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_theocracy_no_wallonia
		subject_canton = BEL_theocracy_no_wallonia
		priority = 21
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					exists = c:WLL
				
					AND = {
						has_state_in_state_region = STATE_FLANDERS
						NOT = { has_state_in_state_region = STATE_WALLONIA }
					}
				}
			}
		}
	}
	flag_definition = {
		coa = BEL_theocracy_no_both
		subject_canton = BEL_theocracy_no_both
		priority = 22
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
			
			scope:actor ?= {
				OR= {
					has_variable = WB_belgium_no_chibis_var
					
					AND = {
						exists = c:FLA
						exists = c:WLL
					}
				
					AND = {
						NOT = { has_state_in_state_region = STATE_WALLONIA }
						NOT = { has_state_in_state_region = STATE_FLANDERS }
					}
				}
			}
		}
	}
}

FRA = { # France
	flag_definition = {
		coa = FRA
		subject_canton = FRA
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject		
		priority = 1
	}
	flag_definition = {
		coa = FRA_republic
		subject_canton = FRA_republic
		allow_overlord_canton = yes		
		overlord_canton_scale = { 0.337 0.337 }			
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = FRA_dictatorship
		subject_canton = FRA_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	# moved
	
	flag_definition = {
		coa = FRA_absolute_monarchy
		subject_canton = FRA_absolute_monarchy	
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject			
		priority = 25
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}	
	
	# moved
	
	flag_definition = {
		coa = FRA_theocracy
		subject_canton = FRA_theocracy
		priority = 20
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = FRA_communist
		subject_canton = FRA_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = FRA_military
		subject_canton = FRA_military
		priority = 1500
		trigger = { 
			coa_def_military_junta_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = FRA_fascist
		subject_canton = FRA_fascist
		priority = 1550
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}		
	
	### WB originals
	
	flag_definition = {
		coa = FRA_wb_commune_flag
		subject_canton = FRA_wb_commune_flag
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	## Orleanist France
	
	# With DLC
	flag_definition = {
		coa = FRA_orleanist
		subject_canton = FRA_orleanist
		priority = 30
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = {
			scope:actor ?= {
				has_law = law_type:law_monarchy
				
				# So that the game starts with the July Revolution portrait
				has_variable = supporting_orleanist_var
				
				NOR = {
					has_variable = bonapartist_restoration_var
					has_variable = legitimist_restoration_var
				}
			}
		}
	}
	
	flag_definition = {
		coa = FRA_orleanist_absolute_monarchy
		subject_canton = FRA_orleanist_absolute_monarchy
		priority = 32
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
		
			scope:actor ?= {
				has_law = law_type:law_monarchy
				
				# So that the game starts with the July Revolution portrait
				has_variable = supporting_orleanist_var
				
				NOR = {
					has_variable = bonapartist_restoration_var
					has_variable = legitimist_restoration_var
				}
			}
		}
	}
	
	flag_definition = {
		coa = FRA_orleanist
		subject_canton = FRA_orleanist
		priority = 33
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = {
			scope:actor ?= {
				has_law = law_type:law_monarchy
				has_variable = orleanist_restoration_var
				
				has_journal_entry = je_cement_the_rightful_dynasty
			}
		}
	}
	
	flag_definition = {
		coa = FRA_orleanist_absolute_monarchy
		subject_canton = FRA_orleanist_absolute_monarchy
		priority = 34
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
		
			scope:actor ?= {
				has_law = law_type:law_monarchy
				has_variable = orleanist_restoration_var
				
				has_journal_entry = je_cement_the_rightful_dynasty
			}
		}
	}
	
	flag_definition = {
		coa = FRA_orleanist
		subject_canton = FRA_orleanist
		priority = 33
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = {
			scope:actor ?= {
				has_law = law_type:law_monarchy
				has_variable = orleanist_restoration_var
				has_variable = one_true_french_dynasty
			}
		}
	}
	
	flag_definition = {
		coa = FRA_orleanist_absolute_monarchy
		subject_canton = FRA_orleanist_absolute_monarchy
		priority = 34
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
		
			scope:actor ?= {
				has_law = law_type:law_monarchy
				has_variable = orleanist_restoration_var
				has_variable = one_true_french_dynasty
			}
		}
	}
	
	# Without DLC
	flag_definition = {
		coa = FRA_orleanist
		subject_canton = FRA_orleanist
		priority = 36
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_orleanist_flag_var }
		}
	}
	
	flag_definition = {
		coa = FRA_orleanist_absolute_monarchy
		subject_canton = FRA_orleanist_absolute_monarchy
		priority = 37
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_orleanist_flag_var }
		}
	}
	
	## Bonapartist France
	
	# With DLC
	
	flag_definition = {
		coa = FRA_second_empire
		subject_canton = FRA_bonapartist
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject			
		priority = 30
		trigger = {
			scope:actor ?= {
				has_law = law_type:law_monarchy
				has_variable = bonapartist_restoration_var
			}
		}
	}
	
	flag_definition = {
		coa = FRA_dictatorship_emperor
		subject_canton = FRA_dictatorship_emperor
		priority = 31
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_law = law_type:law_monarchy
				has_variable = bonapartist_restoration_var
			}
		}
	}
	
	# WIthout DLC
	flag_definition = {
		coa = FRA_bonapartist
		subject_canton = FRA_bonapartist
		priority = 36
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_bonapartist_flag_var }
		}
	}
	
	flag_definition = {
		coa = FRA_dictatorship_emperor
		subject_canton = FRA_dictatorship_emperor
		priority = 38
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_bonapartist_flag_var }
		}
	}
	
	flag_definition = {
		coa = FRA_second_empire
		subject_canton = FRA_bonapartist
		priority = 37
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject			
		trigger = {			
			coa_def_undemocratic_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_bonapartist_flag_var }
		}
	}
	
	## Bourbon France
	
	# With DLC
	
	flag_definition = {
		coa = FRA_bourbon_tricolore
		subject_canton = FRA_bourbon_tricolore
		priority = 30
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject			
		trigger = {	
			scope:actor ?= {
				has_law = law_type:law_monarchy
				has_variable = legitimist_restoration_var
			}
		}
	}
	
	flag_definition = {
		coa = FRA_bourbon
		subject_canton = FRA_bourbon
		priority = 31
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject			
		trigger = {			
			coa_def_undemocratic_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_law = law_type:law_monarchy
				has_variable = legitimist_restoration_var
			}
		}
	}
	
	flag_definition = {
		coa = FRA_absolute_monarchy
		subject_canton = FRA_absolute_monarchy
		priority = 32
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_law = law_type:law_monarchy
				has_variable = legitimist_restoration_var
			}
		}
	}
	
	# Without DLC
	flag_definition = {
		coa = FRA_absolute_monarchy
		subject_canton = FRA_absolute_monarchy
		priority = 38
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_bourbon_flag_var }
		}
	}
	
	flag_definition = {
		coa = FRA_bourbon
		subject_canton = FRA_bourbon
		priority = 37
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject			
		trigger = {			
			coa_def_undemocratic_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_bourbon_flag_var }
		}
	}
	
	flag_definition = {
		coa = FRA_bourbon_tricolore
		subject_canton = FRA_bourbon_tricolore
		priority = 36
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_bourbon_flag_var }
		}
	}
	
	# Force July Revolution portrait
	
	flag_definition = {
		coa = FRA
		subject_canton = FRA
		priority = 36
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_july_revolution_flag_var }
		}
	}
	
	flag_definition = {
		coa = FRA_orleanist_absolute_monarchy
		subject_canton = FRA_orleanist_absolute_monarchy
		priority = 39
		allow_overlord_canton = yes
		coa_with_overlord_canton = FRA_subject
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_july_revolution_flag_var }
		}
	}
	
	
	# Technocracy flags
	
	flag_definition = {
		coa = FRA_technocracy
		subject_canton = FRA_technocracy
		priority = 1501
		trigger = { 
			scope:actor ?= {
				OR = {
					has_law = law_type:law_presidential_republic
					has_law = law_type:law_parliamentary_republic
					has_law = law_type:law_monarchy
				}
				has_law = law_type:law_technocracy
			}
		}
	}
	
	flag_definition = {
		coa = FRA_bourbon_tricolore_technocracy
		subject_canton = FRA_bourbon_tricolore_technocracy
		priority = 1502
		trigger = {
			scope:actor ?= {
				OR = {
					has_variable = legitimist_restoration_var
					has_variable = WB_bourbon_flag_var
				}
				AND = {
					has_law = law_type:law_monarchy
					has_law = law_type:law_technocracy
				}
				NOT = { has_law = law_type:law_anarchy }
			}
		}
	}
	
	flag_definition = {
		coa = FRA_second_empire_technocracy
		subject_canton = FRA_second_empire_technocracy
		priority = 1502
		trigger = {
			scope:actor ?= {
				OR = {
					has_variable = bonapartist_restoration_var
					has_variable = WB_bonapartist_flag_var
				}
				AND = {
					has_law = law_type:law_monarchy
					has_law = law_type:law_technocracy
				}
				NOT = { has_law = law_type:law_anarchy }
			}
		}
	}
	
	flag_definition = {
		coa = FRA_communist_technocracy
		subject_canton = FRA_communist_technocracy
		priority = 1502
		trigger = {
			scope:actor ?= {
				AND = {
					has_law = law_type:law_council_republic
					has_law = law_type:law_technocracy
				}
				NOT = { has_law = law_type:law_anarchy }
			}
		}
	}
	
}

GBR = { # Great Britain / United Kingdom
	flag_definition = {
		coa = GBR
		subject_canton = GBR
		priority = 1
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
	}
	flag_definition = {
		coa = GBR_uk
		subject_canton = GBR_uk
		priority = 2
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		trigger = { 
			coa_def_controls_part_of_ireland = yes
		}
	}
	flag_definition = {
		coa = GBR_scotland
		subject_canton = GBR_scotland
		priority = 10
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		trigger = { 
			coa_def_dominant_scotland_trigger = yes
		}
	}
	flag_definition = {
		coa = GBR_republic
		subject_canton = GBR_republic
		priority = 15
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	flag_definition = {
		# English and Scottish flags quartered
		coa = GBR_dictatorship
		subject_canton = GBR_ENG_dictatorship_canton
		priority = 16
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	flag_definition = {
		# English, Scottish, Irish crosses quartered
		coa = GBR_dictatorship_uk
		subject_canton = GBR_ENG_dictatorship_canton
		priority = 17
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			coa_def_controls_part_of_ireland = yes
		}
	}
	flag_definition = {
		coa = GBR_coa
		subject_canton = GBR_coa
		priority = 20
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = GBR_coa_scotland
		subject_canton = GBR_coa_scotland
		priority = 21
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			coa_def_dominant_scotland_trigger = yes
		}
	}
	flag_definition = {
		coa = GBR_coa_france
		subject_canton = GBR_coa_france
		priority = 22
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			coa_def_controls_part_of_france = yes
		}
	}
	flag_definition = {
		coa = GBR_uk_coa
		subject_canton = GBR_uk_coa
		priority = 23
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			coa_def_controls_part_of_ireland = yes
		}
	}
	flag_definition = {
		coa = GBR_uk_coa_france
		subject_canton = GBR_uk_coa_france
		priority = 24
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			coa_def_controls_part_of_ireland = yes
			coa_def_controls_part_of_france = yes
		}
	}
	flag_definition = {
		coa = GBR_uk_scotland_coa
		subject_canton = GBR_uk_scotland_coa
		priority = 24
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			coa_def_controls_part_of_ireland = yes
			coa_def_dominant_scotland_trigger = yes
		}
	}
	flag_definition = {
		coa = GBR_uk_scotland_coa_france
		subject_canton = GBR_uk_scotland_coa_france
		priority = 25
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			coa_def_controls_part_of_ireland = yes
			coa_def_dominant_scotland_trigger = yes
			coa_def_controls_part_of_france = yes
		}
	}
	flag_definition = {
		coa = GBR_theocracy
		subject_canton = GBR_theocracy
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		priority = 20
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = GBR_white_ensign
		subject_canton = GBR_white_ensign_overlord_canton
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		priority = 20
		trigger = { 
			coa_def_military_junta_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = GBR_uk_white_ensign
		subject_canton = GBR_uk_white_ensign_overlord_canton
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		priority = 21
		trigger = { 
			coa_def_military_junta_flag_trigger = yes
			coa_def_controls_part_of_ireland = yes
		}
	}
	flag_definition = {
		coa = MAC
		subject_canton = MAC
		priority = 22
		trigger = { 
			exists = scope:actor
			scope:actor = { capital = { state_region = s:STATE_LANCASHIRE } }
		}
	}
	flag_definition = {
		coa = MAC_communist
		priority = 1500
		trigger = {
			exists = scope:actor
			coa_def_communist_flag_trigger = yes
			scope:actor = { capital = { state_region = s:STATE_LANCASHIRE } }
		}
	}
	flag_definition = {
		coa = GBR_communist
		priority = 1500
		trigger = { 
			exists = scope:actor
			coa_def_communist_flag_trigger = yes
			scope:actor = { NOT = { capital = { state_region = s:STATE_LANCASHIRE } } }
		}
	}	
	flag_definition = {
		coa = GBR_fascist
		subject_canton = GBR_fascist
		priority = 1500
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}
	
	## WB originals
	
	flag_definition = {
		coa = GBR_anarchist
		subject_canton = GBR_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = GBR_technocracy
		subject_canton = GBR_technocracy_canton
		priority = 1501
		trigger = { 
			scope:actor ?= {
				OR = {
					has_law = law_type:law_presidential_republic
					has_law = law_type:law_parliamentary_republic
				}
				has_law = law_type:law_technocracy
			}
		}
	}
	
	flag_definition = {
		coa = GBR_monarchy_technocracy_uk
		subject_canton = GBR_monarchy_technocracy_uk
		priority = 1502
		trigger = { 
			coa_def_controls_part_of_ireland = yes
			scope:actor ?= {
				AND = {
					has_law = law_type:law_monarchy
					has_law = law_type:law_technocracy
				}
				NOT = { has_law = law_type:law_anarchy }
			}
		}
	}
	
	flag_definition = {
		coa = GBR_monarchy_technocracy_no_ireland
		subject_canton = GBR_monarchy_technocracy_no_ireland
		priority = 1501
		trigger = {
			scope:actor ?= {
				AND = {
					has_law = law_type:law_monarchy
					has_law = law_type:law_technocracy
				}
				NOT = { has_law = law_type:law_anarchy }
			}
		}
	}
	
	flag_definition = {
		coa = GBR_monarchy_technocracy_scotland
		subject_canton = GBR_monarchy_technocracy_scotland
		priority = 1503
		trigger = {
			coa_def_dominant_scotland_trigger = yes
			
			scope:actor ?= {
				AND = {
					has_law = law_type:law_monarchy
					has_law = law_type:law_technocracy
				}
				NOT = { has_law = law_type:law_anarchy }
			}
		}
	}
	
	flag_definition = {
		coa = GBR_communist_technocracy
		subject_canton = GBR_communist_technocracy
		priority = 1503
		trigger = {
			scope:actor ?= {
				AND = {
					has_law = law_type:law_council_republic
					has_law = law_type:law_technocracy
				}
				NOT = { has_law = law_type:law_anarchy }
			}
		}
	}
}

GRE = { # Greece
	flag_definition = {
		coa = GRE 
		allow_overlord_canton = yes
		subject_canton = sub_GRE_square # WB edit
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		
		coa_with_overlord_canton = GRE_monarchy_subject	# WB edit 
	}
	flag_definition = {
		coa = GRE_absolute_monarchy
		priority = 10
		allow_overlord_canton = yes
		subject_canton = sub_GRE_square # WB edit 
		
		# WB edit 
		overlord_canton_scale = { @canton_scale_cross_x 0.4 }
		overlord_canton_offset = { 0 0.04 }
		coa_with_overlord_canton = GRE_absolute_monarchy_subject
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = GRE_republic
		subject_canton = sub_GRE_square # WB edit 
		priority = 10
		allow_overlord_canton = yes
		overlord_canton_scale = { 0.5 @[1/9*5] }
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = GRE_fascist
		subject_canton = GRE_dictatorship_canton # WB edit 
		priority = 50
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}	
	
	## WB originals
	
	flag_definition = {
		coa = GRE_dictatorship
		subject_canton = GRE_dictatorship_canton # WB edit 
		priority = 15
		allow_overlord_canton = yes
		overlord_canton_scale = { 0.5 @[1/9*5] }
		coa_with_overlord_canton = GRE_dictatorship_subject
		trigger = { 
			exists = scope:actor
			OR = {
				coa_def_dictatorship_flag_trigger = yes
				scope:actor = { has_government_type = gov_junta }
			}
		}
	}
	
	flag_definition = {
		coa = GRE_communist
		subject_canton = GRE_communist
		priority = 1500
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = GRE_anarchist
		subject_canton = GRE_anarchist
		priority = 1501
		allow_overlord_canton = yes
		overlord_canton_scale = { 0.5 @[1/9*5] }
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = GRE_theocracy
		subject_canton = GRE_theocracy
		priority = 20
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
}

HAN = { # Hanover
	flag_definition = {
		coa = HAN
		allow_overlord_canton = yes		
		coa_with_overlord_canton = HAN_subject
		subject_canton = HAN
		priority = 1
	}
	flag_definition = {
		coa = HAN_subject_GBR
		subject_canton = HAN_absolute_monarchy
		priority = 2
		trigger = { 
			coa_def_british_ensign_trigger = yes
		}
	}
	flag_definition = {
		coa = HAN_absolute_monarchy
		subject_canton = HAN_absolute_monarchy
		priority = 20
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = HAN_republic
		subject_canton = HAN_republic
		allow_overlord_canton = yes		
		coa_with_overlord_canton = HAN_subject		
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = HAN_communist
		subject_canton = HAN_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = HAN_subject	
		subject_canton = HAN		
		allow_overlord_canton = yes	
		overlord_canton_offset = { 0.01 0.015 }
		overlord_canton_scale = { 0.48 0.47 }			
		priority = 50
		trigger = { 
			coa_def_french_ensign_trigger = yes
		}
	}	
	flag_definition = {
		coa = HAN_subject_gold
		subject_canton = HAN
		allow_overlord_canton = yes	
		overlord_canton_offset = { 0.01 0.015 }
		overlord_canton_scale = { 0.48 0.47 }			
		priority = 50
		trigger = { 
			coa_def_spanish_ensign_trigger = yes
		}
	}	
	flag_definition = {
		coa = HAN_subject_PRU
		priority = 50
		trigger = { 
			coa_def_prussian_ensign_trigger = yes
		}
	}	
	
	# WB originals
	
	flag_definition = {
		coa = HAN_war
		allow_overlord_canton = yes		
		coa_with_overlord_canton = HAN_subject_war
		subject_canton = HAN_war_war
		priority = 2
		
		trigger = {
			coa_def_war_trigger = yes
		}
	}
	flag_definition = {
		coa = HAN_subject_GBR_war
		subject_canton = HAN_absolute_monarchy_war
		priority = 30
		trigger = { 
			coa_def_british_ensign_trigger = yes
			
			coa_def_war_trigger = yes
		}
	}	
	flag_definition = {
		coa = HAN_absolute_monarchy_war
		subject_canton = HAN_absolute_monarchy_war
		allow_overlord_canton = yes
		coa_with_overlord_canton = HAN_subject_war
		priority = 21
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			coa_def_war_trigger = yes
		}
	}	
	flag_definition = {
		coa = HAN_subject_war	
		subject_canton = HAN_war		
		allow_overlord_canton = yes	
		overlord_canton_offset = { 0.01 0.015 }
		overlord_canton_scale = { 0.48 0.47 }			
		priority = 51
		trigger = { 
			coa_def_french_ensign_trigger = yes
			
			coa_def_war_trigger = yes
		}
	}	
	flag_definition = {
		coa = HAN_subject_gold_war
		subject_canton = HAN_subject_gold_war
		allow_overlord_canton = yes	
		overlord_canton_offset = { 0.01 0.015 }
		overlord_canton_scale = { 0.48 0.47 }			
		priority = 51
		trigger = { 
			coa_def_spanish_ensign_trigger = yes
			
			coa_def_war_trigger = yes
		}
	}	
	flag_definition = {
		coa = HAN_subject_PRU_war
		subject_canton = HAN_war
		priority = 51
		trigger = { 
			coa_def_prussian_ensign_trigger = yes
			
			coa_def_war_trigger = yes
		}
	}
	
	flag_definition = {
		coa = HAN_republic_war
		subject_canton = HAN_republic_war
		allow_overlord_canton = yes		
		coa_with_overlord_canton = HAN_subject_war	
		priority = 11
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			coa_def_war_trigger = yes
		}
	}
	flag_definition = {
		coa = HAN_communist_war
		subject_canton = HAN_communist_war
		priority = 1501
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			coa_def_war_trigger = yes
		}
	}
	
	flag_definition = {
		coa = HAN_dictatorship
		subject_canton = HAN_dictatorship
		priority = 15
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = HAN_dictatorship_war
		subject_canton = HAN_dictatorship_war
		priority = 16
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			coa_def_war_trigger = yes
		}
	}
	
	flag_definition = {
		coa = HAN_dictatorship_alt
		subject_canton = HAN_dictatorship_alt
		priority = 16
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes	
			scope:actor ?= { has_variable = WB_Hanover_dictator_alt_var }
		}
	}
	
	flag_definition = {
		coa = HAN_dictatorship_alt_war
		subject_canton = HAN_dictatorship_alt_war
		priority = 17
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			scope:actor ?= { has_variable = WB_Hanover_dictator_alt_var }
			
			coa_def_war_trigger = yes
		}
	}
	
	flag_definition = {
		coa = HAN_anarchist
		subject_canton = HAN_anarchist
		priority = 1502
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = HAN_anarchist_war
		subject_canton = HAN_anarchist_war
		priority = 1503
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			coa_def_war_trigger = yes
		}
	}
}

HUN = { # Hungary
	flag_definition = {
		coa = HUN
		subject_canton = HUN	
		priority = 1
	}
	flag_definition = {
		coa = HUN_fascist
		subject_canton = HUN_fascist
		priority = 10
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}	
	
	# WB originals
	
	flag_definition = {
		coa = HUN_republic
		subject_canton = HUN_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}		
	
	flag_definition = {
		coa = HUN_dictatorship
		subject_canton = HUN_dictatorship
		priority = 1500
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}

	flag_definition = {
		coa = HUN_communist
		subject_canton = HUN_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = HUN_communist_autocratic
		subject_canton = HUN_communist_autocratic
		priority = 1501
		trigger = {
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				has_law = law_type:law_autocracy
			}
		}
	}
	
	flag_definition = {
		coa = HUN_anarchist
		subject_canton = HUN_anarchist
		priority = 1502
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = HUN_flag_hole_republic
		subject_canton = HUN_flag_hole_republic
		priority = 1600
		allow_revolutionary_indicator = no
		trigger = {
			exists = c:HUN
			exists = scope:actor
			
			coa_def_secessionist_or_revolutionary_trigger = yes
			
			scope:actor = {
				is_secessionist = no
				OR = {
					has_law = law_type:law_presidential_republic
					has_law = law_type:law_parliamentary_republic
				}
			}
			
			c:HUN = {
				has_law = law_type:law_council_republic
			}
		}
	}
	
	flag_definition = {
		coa = HUN_flag_hole_monarchy
		subject_canton = HUN_flag_hole_monarchy
		allow_revolutionary_indicator = no
		priority = 1600
		trigger = {
			exists = c:HUN
			exists = scope:actor
			
			coa_def_secessionist_or_revolutionary_trigger = yes
			
			scope:actor = {
				is_secessionist = no
				OR = {
					has_law = law_type:law_chiefdom
					has_law = law_type:law_monarchy
				}
			}
			
			c:HUN = {
				has_law = law_type:law_council_republic
			}
		}
	}
}

ION = { # Ionian Islands
	flag_definition = {
		coa = ION	
		allow_overlord_canton = yes
		coa_with_overlord_canton = ION_subject	
		overlord_canton_offset = { 0 0.1 }
		overlord_canton_scale = { 0.4 0.4 }			
		subject_canton = ION
		priority = 1
	}
	
	# WB originals
	
	flag_definition = {
		coa = ION_subject_GBR
		subject_canton = ION
		priority = 30
		allow_overlord_canton = no
		overlord_canton_offset = { 0.067 0.1 }
		overlord_canton_scale = { 0.4 0.4 }	
		
		trigger = {
		
			c:GBR ?= {
				OR = {
					has_law = law_type:law_chiefdom
					has_law = law_type:law_monarchy
				}
			}
			
			exists = scope:actor
			
			OR = {
				coa_def_british_ensign_trigger = yes
			
				AND = {
					c:GBR ?= {
						has_diplomatic_pact = {
							who = scope:actor
							type = protectorate
							is_initiator = yes
						}
					}
				}
				
				AND = {
					c:GBR ?= {
						has_diplomatic_pact = {
							who = scope:actor
							type = tributary
							is_initiator = yes
						}
					}
				}
			}
		}
	}
	
	flag_definition = {
		coa = ION_republic
		subject_canton = ION_republic
		allow_overlord_canton = yes
		coa_with_overlord_canton = ION_subject	
		overlord_canton_offset = { 0 0.1 }
		overlord_canton_scale = { 0.4 0.4 }		
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = ION_monarchy
		subject_canton = ION_monarchy
		allow_overlord_canton = yes
		coa_with_overlord_canton = ION_subject	
		overlord_canton_offset = { 0 0.1 }
		overlord_canton_scale = { 0.4 0.4 }	
		priority = 30
		
		trigger = {
			coa_def_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ION_oligarchy
		subject_canton = LUC_oligarchy
		priority = 25
		trigger = {
			coa_def_oligarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ION_dictatorship
		subject_canton = ION_dictatorship
		priority = 35
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = ION_communist
		subject_canton = ION_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ION_anarchist
		subject_canton = ION_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

LOM = { # Lombardia
	flag_definition = {
		coa = LOM	
		subject_canton = LOM
		priority = 1
		# WB edits
		allow_overlord_canton = yes	
		coa_with_overlord_canton = LOM_subject_republic
	}
	
	# WB originals
	
	flag_definition = {
		coa = LOM_lombardy_venetia
		subject_canton = LOM_lombardy_venetia
		priority = 20
		trigger = {
			coa_def_monarchy_flag_trigger = yes
			OR = {
				coa_def_austrian_ensign_trigger = yes
				
				AND = {
					exists = c:AUS
					c:AUS = {
						has_diplomatic_pact = {
							who = scope:actor
							type = customs_union
							is_initiator = yes
						}
					}
				}
				
				AND = {
					exists = c:AUS
					c:AUS = {
						has_diplomatic_pact = {
							who = scope:actor
							type = protectorate
							is_initiator = yes
						}
					}
				}
			}
		}
	}
	
	flag_definition = {
		coa = LOM_monarchy
		subject_canton = LOM_monarchy
		allow_overlord_canton = yes	
		coa_with_overlord_canton = LOM_subject
		priority = 15
		trigger = {
			coa_def_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = LOM_dictatorship
		subject_canton = LOM_dictatorship
		priority = 25
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = LOM_risorgimento
		subject_canton = LOM_risorgimento
		allow_overlord_canton = yes
		priority = 25
		trigger = {
			coa_def_republic_flag_trigger = yes
			exists = scope:actor
			scope:actor = {
				has_technology_researched = nationalism
			}
		}
	}
	flag_definition = {
		coa = LOM_communist
		subject_canton = LOM_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = LOM_anarchist
		subject_canton = LOM_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

LUC = { # Lucca
	flag_definition = {
		coa = LUC
		allow_overlord_canton = yes	
		overlord_canton_scale = { 0.25 0.25 }		
		subject_canton = LUC_merchant_flag
		priority = 1
	}
	flag_definition = {
		coa = LUC_republic
		subject_canton = LUC_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = LUC_communist
		subject_canton = LUC_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = LUC_subject_FRA	
		priority = 50
		trigger = { 
			coa_def_french_ensign_trigger = yes
			coa_def_republic_flag_trigger = yes
		}
	}	
	
	# WB originals
	
	flag_definition = {
		coa = LUC_non_absolute_monarchy
		subject_canton = LUC_merchant_flag
		allow_overlord_canton = yes	
		overlord_canton_scale = { 0.25 0.25 }	
		priority = 5
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = no
		}
	}
	
	flag_definition = {
		coa = LUC_merchant_flag
		subject_canton = LUC_merchant_flag
		priority = 15
		trigger = {
			coa_def_oligarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = LUC_dictatorship
		subject_canton = LUC_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = LUC_theocracy
		subject_canton = LUC_theocracy
		priority = 15
		trigger = {
			coa_def_theocracy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = LUC_risorgimento
		subject_canton = LUC_risorgimento
		priority = 15
		trigger = {
			coa_def_republic_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				has_technology_researched = nationalism
			}
		}
	}
	
	flag_definition = {
		coa = LUC_anarchist
		subject_canton = LUC_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

MOD = { # Modena
	flag_definition = {
		coa = MOD	
		subject_canton = MOD
		allow_overlord_canton = yes	
		coa_with_overlord_canton = MOD_subject		
		overlord_canton_offset = { 0.066 0.1 }
		overlord_canton_scale = { 0.4 0.4 }			
		priority = 1
	}
	flag_definition = {
		coa = MOD_republic
		subject_canton = MOD_republic
		allow_overlord_canton = yes			
		overlord_canton_scale = { 0.337 0.337 }			
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = MOD_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = MOD
		allow_overlord_canton = no
		priority = 50
		trigger = { 
			coa_def_austrian_ensign_trigger = yes
		}
	}

	# WB originals
	
	flag_definition = {
		coa = MOD_dictatorship
		subject_canton = MOD_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = { # absolute monarchy flag when not under Austria
		coa = MOD_este_flag	
		subject_canton = MOD_este_flag
		allow_overlord_canton = yes	
		coa_with_overlord_canton = MOD_subject		
		overlord_canton_offset = { 0.066 0.1 }
		overlord_canton_scale = { 0.4 0.4 }			
		priority = 35
		
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
			
			NOT = {
				OR = {
					AND = {
						exists = c:AUS
						c:AUS = {
							has_diplomatic_pact = {
								who = scope:actor
								type = customs_union
								is_initiator = yes
							}
						}
					}
					
					AND = {
						exists = c:AUS
						c:AUS = {
							has_diplomatic_pact = {
						who = scope:actor
								type = protectorate
								is_initiator = yes
							}
						}
					}
				}
			}
		}
	}
	
	flag_definition = { # monarchy flag when not under Austria
		coa = MOD_emilia_flag	
		subject_canton = MOD_emilia_flag
		allow_overlord_canton = yes	
		coa_with_overlord_canton = MOD_subject		
		overlord_canton_offset = { 0.066 0.1 }
		overlord_canton_scale = { 0.4 0.4 }			
		priority = 30
		
		trigger = {
			coa_def_monarchy_flag_trigger = yes
			
			NOT = {
				OR = {
					AND = {
						exists = c:AUS
						c:AUS = {
							has_diplomatic_pact = {
								who = scope:actor
								type = customs_union
								is_initiator = yes
							}
						}
					}
					
					AND = {
						exists = c:AUS
						c:AUS = {
							has_diplomatic_pact = {
						who = scope:actor
								type = protectorate
								is_initiator = yes
							}
						}
					}
				}
			}
		}
	}
	
	flag_definition = {
		coa = MOD_anarchist
		subject_canton = MOD_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

MOL = { # Moldavia
	flag_definition = {
		coa = MOL	
		subject_canton = MOL
		allow_overlord_canton = yes	
		coa_with_overlord_canton = MOL_subject			
		priority = 1
	}
	flag_definition = {
		# Corner cantons with stars when ruled by the Ottoman Empire
		coa = MOL_subject_TUR
		subject_canton = MOL
		priority = 5
		trigger = { 
			coa_def_turkish_ensign_trigger = yes
		}
	}		
	flag_definition = {
		coa = MOL_communist
		subject_canton = MOL_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	
	# WB edit
	flag_definition = {
		coa = ROM_MOL_united_principalities
		subject_canton = ROM_MOL_united_principalities
		priority = 100
		trigger = { 
			scope:actor ?= {
				has_variable = ROM_united_principality
			}
		}
	}
	
	# WB originals
	
	flag_definition = {
		coa = ROM_MOL_united_principalities
		subject_canton = ROM_MOL_united_principalities
		priority = 50
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			coa_def_wallachian_ensign_trigger = yes
			
			c:WAL ?= { has_variable = ROM_united_principality }
		}
	}
	
	flag_definition = {
		coa = ROM_MOL_united_principalities
		subject_canton = ROM_MOL_united_principalities
		priority = 15
		allow_overlord_canton = yes
		coa_with_overlord_canton = MOL_subject
		
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			exists = scope:actor
			
			scope:actor = {
				has_state_in_state_region = STATE_WALLACHIA
			}
			
			NOT = { exists = c:WAL }
			
			scope:actor = { 
				has_technology_researched = nationalism
			}
		}
	}
	
	flag_definition = {
		coa = MOL_civil_ensign
		subject_canton = MOL_civil_ensign
		priority = 2
		trigger = {
			coa_def_monarchy_flag_trigger = yes
			exists = scope:actor
			OR = {
				AND = {
					c:TUR ?= {
						has_diplomatic_pact = {
							who = scope:actor
							type = protectorate
							is_initiator = yes
						}
					}
				}
				
				AND = {
					c:TUR ?= {
						has_diplomatic_pact = {
							who = scope:actor
							type = tributary
							is_initiator = yes
						}
					}
				}
			}
		}
	}
	
	flag_definition = {
		coa = MOL_absolute_monarchy
		subject_canton = MOL_absolute_monarchy
		allow_overlord_canton = yes	
		coa_with_overlord_canton = MOL_subject	
		priority = 2
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = MOL_republic
		subject_canton = MOL_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = MOL_republic_nationalism
		subject_canton = MOL_republic_nationalism
		priority = 15
		trigger = {
			coa_def_republic_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { 
				has_technology_researched = nationalism
			}
			
			OR = {
				coa_def_independent_trigger = yes
				coa_def_secessionist_or_revolutionary_trigger = yes
			}
		}
	}
	
	flag_definition = {
		coa = MOL_dictatorship
		subject_canton = MOL_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = MOL_anarchist
		subject_canton = MOL_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = MOL_republic_bessarabia
		subject_canton = MOL_republic_bessarabia
		priority = 16
		trigger = {
			coa_def_republic_flag_trigger = yes
			
			c:MOL ?= { capital = { state_region = s:STATE_BESSARABIA } }
		}
	}
}

MON = { # Montenegro
	flag_definition = {
		coa = MON	
		subject_canton = MON
		priority = 1
	}
	
	flag_definition = {
		coa = MON_absolute_monarchy
		subject_canton = MON_absolute_monarchy
		priority = 10
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = MON_dictatorship
		subject_canton = MON_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}		
	
	# WB originals
	
	flag_definition = {
		coa = MON
		subject_canton = MON
		priority = 15
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				NOT = { has_technology_researched = nationalism }
			}
		}
	}
	
	flag_definition = {
		coa = MON_absolute_monarchy
		subject_canton = MON_absolute_monarchy
		priority = 16
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_technology_researched = nationalism
			}
		}
	}
	
	flag_definition = {
		coa = MON_kingdom
		subject_canton = MON_kingdom
		priority = 17
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_technology_researched = nationalism
				owns_entire_state_region = STATE_MONTENEGRO
			}
			
		}
	}
	
	flag_definition = {
		coa = MON_theocracy
		subject_canton = MON_theocracy
		priority = 30
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = MON_republic
		subject_canton = MON_republic
		priority = 15
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = MON_communist
		subject_canton = MON_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = MON_anarchist
		subject_canton = MON_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

NET = { # Netherlands
	flag_definition = {
		coa = NET
		allow_overlord_canton = yes	
		coa_with_overlord_canton = NET_subject		
		priority = 1
	}
	flag_definition = {
		coa = NET_princes_flag
		priority = 5
		trigger = { 
			coa_def_autocracy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = NET_republic
		subject_canton = NET_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = NET_dictatorship
		subject_canton = NET_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = NET_fascist
		subject_canton = NET_fascist
		priority = 1500
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}		

	#WB original flags
	
	flag_definition = {
		coa = NET_communist
		subject_canton = NET_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = NET_anarchist
		subject_canton = NET_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}

	flag_definition = {
		coa = NET_batavian_republic
		subject_canton = NET_batavian_republic
		priority = 50
		trigger = { 
			coa_def_french_ensign_trigger = yes
		}
	}
}


NOR = { # Norway
	flag_definition = {
		coa = NOR
		priority = 1
		coa_with_overlord_canton = NOR
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_norway_x @canton_scale_norway_y }
		subject_canton = NOR_canton
	}
	flag_definition = {
		coa = NOR
		priority = 5
		subject_canton = NOR_canton
		trigger = { 
			# Norway didn't use a Swedish canton in 1836
			coa_SWE_use_union_mark_canton_trigger = no
			coa_def_swedish_ensign_trigger = yes
		}
	}
	flag_definition = {
		coa = NOR_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = NOR_fascist
		subject_canton = NOR_fascist
		priority = 10
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}		
	
	
	## WB originals
	
	flag_definition = {
		coa = NOR_republic
		subject_canton = NOR_republic
		priority = 10
		allow_overlord_canton = yes
		
		trigger = {
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = NOR_dictatorship
		subject_canton = NOR_dictatorship
		priority = 1500
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = NOR_anarchist
		subject_canton = NOR_anarchist
		priority = 1501
		trigger = {
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = NOR_subject_denmark
		priority = 5
		subject_canton = NOR
		allow_overlord_canton = yes
		trigger = {
			coa_def_danish_ensign_trigger = yes
		}
	}
	
	# Fredrik Meltzer's other Norwegian flag / Noruega Dominicana!
	flag_definition = {
		coa = NOR_santo_domingo
		priority = 1000
		subject_canton = NOR
		allow_overlord_canton = yes
		trigger = {
			exists = scope:actor
			scope:actor = {			
				capital = { state_region = s:STATE_SANTO_DOMINGO }
			}
		}
	}
	
	# WB's overwrite for Norway's union flags
	
	flag_definition = {
		coa = NOR_union_no_mark
		priority = 6
		coa_with_overlord_canton = NOR_union_no_mark
		subject_canton = NOR_union_no_mark
		trigger = { 

			coa_SWE_use_union_mark_canton_trigger = no
			coa_def_swedish_ensign_trigger = yes
		}
	}
	
	flag_definition = {
		coa = NOR_union_yes_mark
		priority = 10
		subject_canton = NOR_union_no_mark
		
		trigger = {
			coa_def_WB_king_karl_johan_is_dead_trigger = yes
			coa_def_swedish_ensign_trigger = yes
		}
	}
	
	# So that the couple portrait of Sweden and Norway is removed if a monarchist Norway declares an indepedence war
	flag_definition = {
		coa = NOR
		allow_overlord_canton = no
		subject_canton = NOR_canton
		priority = 11
		
		trigger = {
			coa_def_war_trigger = yes
			
			coa_def_monarchy_flag_trigger = yes
			
			exists = c:NOR
			exists = c:SWE
			c:NOR = { has_war_with = c:SWE }
		}
	}
}

PAP = { # Papal States
	flag_definition = {
		coa = PAP
		allow_overlord_canton = yes		
		subject_canton = PAP
		priority = 1
		
		#WB edit
		coa_with_overlord_canton = PAP_monarchy_subject
	}
	flag_definition = {
		coa = PAP_theocracy
		allow_overlord_canton = yes	
		subject_canton = PAP_theocracy		
		priority = 10
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
		
		#WB edit
		coa_with_overlord_canton = PAP_theocracy_subject
	}
	flag_definition = {
		coa = PAP_republic
		allow_overlord_canton = yes		
		subject_canton = PAP_republic
		overlord_canton_scale = { 0.337 0.337 }			
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = PAP_communist
		subject_canton = PAP_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = PAP_fascist
		subject_canton = PAP_fascist
		priority = 1500
		trigger = { 
			OR = {
				coa_def_fascist_flag_trigger = yes
				coa_def_dictatorship_flag_trigger = yes
			}
		}
	}	
	
	#WB originals
	
	flag_definition = {
		coa = PAP_anarchist
		subject_canton = PAP_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = PAP_roman_republic_1849
		allow_overlord_canton = yes			
		overlord_canton_scale = { 0.337 0.337 }
		subject_canton = PAP_roman_republic_1849		
		priority = 100
		trigger = {
			coa_def_republic_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				has_technology_researched = nationalism
			}
		}
	}
}

PAR = { # Parma
	flag_definition = {
		coa = PAR
		subject_canton = PAR
		allow_overlord_canton = yes
		coa_with_overlord_canton = PAR_absolute_monarchy_subject
		priority = 1
	}
	flag_definition = {
		coa = PAR_republic
		subject_canton = PAR_republic
		allow_overlord_canton = yes		
		coa_with_overlord_canton = PAR_republic_subject
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = PAR_absolute_monarchy
		subject_canton = PAR
		allow_overlord_canton = yes
		coa_with_overlord_canton = PAR_absolute_monarchy_subject	
		priority = 10
		
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = PAR_dictatorship
		subject_canton = PAR_dictatorship
		allow_overlord_canton = yes	
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}		
	flag_definition = {
		coa = PAR_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	
	# WB originals
	
	flag_definition = { # Absolute monarchy flag when not under Austria's customs union
		coa = PAR_charles_iii
		subject_canton = PAR_charles_iii
		allow_overlord_canton = yes
		coa_with_overlord_canton = PAR_absolute_monarchy_subject	
		priority = 30
		
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
			
			NOT = {
				OR = {
					AND = {
						exists = c:AUS
						c:AUS = {
							has_diplomatic_pact = {
								who = scope:actor
								type = customs_union
								is_initiator = yes
							}
						}
					}
					
					AND = {
						exists = c:AUS
						c:AUS = {
							has_diplomatic_pact = {
						who = scope:actor
								type = protectorate
								is_initiator = yes
							}
						}
					}
				}
			}
		}
	}
	
	flag_definition = { # Monarchy flag when Parma is in Austria's customs union
		coa = PAR_monarchy_austria
		subject_canton = PAR_monarchy_austria
		allow_overlord_canton = yes
		coa_with_overlord_canton = PAR_absolute_monarchy_subject	
		priority = 5
		
		trigger = {
			coa_def_monarchy_flag_trigger = yes
			OR = {
					AND = {
						exists = c:AUS
						c:AUS = {
							has_diplomatic_pact = {
								who = scope:actor
								type = customs_union
								is_initiator = yes
							}
						}
					}
					
					AND = {
						exists = c:AUS
						c:AUS = {
							has_diplomatic_pact = {
						who = scope:actor
								type = protectorate
								is_initiator = yes
							}
						}
					}
				}
		}
	}
	
	flag_definition = {
		coa = PAR_fleur_flag
		subject_canton = PAR_fleur_flag
		allow_overlord_canton = yes		
		coa_with_overlord_canton = PAR_absolute_monarchy_subject
		priority = 25
		trigger = {
			coa_def_oligarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = PAR_theocracy
		subject_canton = PAR_theocracy
		allow_overlord_canton = yes		
		coa_with_overlord_canton = PAR_absolute_monarchy_subject
		priority = 35
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
	
	# WB anarchist flags
	flag_definition = {
		coa = PAR_anarchist
		subject_canton = PAR_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

POR = { # Portugal
	flag_definition = {
		coa = POR
		subject_canton = POR
		allow_overlord_canton = yes
		coa_with_overlord_canton = POR_subject			
		priority = 1
	}
	flag_definition = {
		coa = POR_absolute_monarchy
		subject_canton = POR_absolute_monarchy
		priority = 20
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = POR_republic
		subject_canton = POR_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = POR_dictatorship
		subject_canton = POR_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = POR_communist
		subject_canton = POR_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = POR_fascist
		subject_canton = POR_fascist
		priority = 1500
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}			
	
	# WB originals
	flag_definition = {
		coa = POR_anarchist
		subject_canton = POR_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = POR_BRZ_united_kingdom
		subject_canton = POR_BRZ_united_kingdom
		priority = 30
		trigger = {
			coa_def_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				owns_entire_state_region = STATE_RIO_DE_JANEIRO
				owns_entire_state_region = STATE_SAO_PAULO
			}
			
			NOT = { exists = c:BRZ }
		}
	}
	
	flag_definition = {
		coa = POR_BRZ_united_kingdom_absolute_monarchy
		subject_canton = POR_BRZ_united_kingdom_absolute_monarchy
		priority = 31
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				owns_entire_state_region = STATE_RIO_DE_JANEIRO
				owns_entire_state_region = STATE_SAO_PAULO
			}
			
			NOT = { exists = c:BRZ }
		}
	}
}

PRU = { # Prussia
	flag_definition = {
		coa = PRU	
		subject_canton = PRU
		allow_overlord_canton = yes	
		coa_with_overlord_canton = PRU_subject	
		overlord_canton_scale = { 0.337 0.337 }			
		priority = 1
	}
	flag_definition = {
		coa = PRU_teutonic_order
		subject_canton = PRU_teutonic_order
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		priority = 5		
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = PRU_republic
		subject_canton = PRU_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = PRU_absolute_monarchy
		subject_canton = PRU_absolute_monarchy
		allow_overlord_canton = yes	
		coa_with_overlord_canton = PRU_subject	
		overlord_canton_scale = { 0.337 0.337 }				
		priority = 20
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = PRU_communist
		subject_canton = PRU_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = PRU_fascist
		subject_canton = PRU_fascist
		priority = 1500
		trigger = { 
			OR = {
				coa_def_fascist_flag_trigger = yes
				coa_def_dictatorship_flag_trigger = yes
			}
		}
	}	
	
	# WB originals
	
	flag_definition = {
		coa = PRU_anarchist
		subject_canton = PRU_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	# Technocracy flags
	
	flag_definition = {
		coa = PRU_technocracy
		subject_canton = PRU_technocracy
		priority = 1501
		trigger = { 
			scope:actor ?= {
				OR = {
					has_law = law_type:law_presidential_republic
					has_law = law_type:law_parliamentary_republic
					has_law = law_type:law_monarchy
				}
				has_law = law_type:law_technocracy
			}
		}
	}
	
	flag_definition = {
		coa = PRU_monarchy_technocracy
		subject_canton = PRU_monarchy_technocracy
		priority = 1502
		trigger = {
			scope:actor ?= {
				AND = {
					has_law = law_type:law_monarchy
					has_law = law_type:law_technocracy
				}
				NOT = { has_law = law_type:law_anarchy }
			}
		}
	}
	
	flag_definition = {
		coa = PRU_communist_technocracy
		subject_canton = PRU_communist_technocracy
		priority = 1502
		trigger = {
			scope:actor ?= {
				AND = {
					has_law = law_type:law_council_republic
					has_law = law_type:law_technocracy
				}
				NOT = { has_law = law_type:law_anarchy }
			}
		}
	}
}

RUS = { # Russia
	flag_definition = {
		coa = RUS_imperial
		allow_overlord_canton = yes		
		subject_canton = RUS_imperial
		priority = 1
	}
	flag_definition = {
		coa = RUS_absolute_monarchy
		subject_canton = RUS 
		priority = 20
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = RUS_republic
		subject_canton = RUS_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}		
	flag_definition = {
		coa = RUS_dictatorship
		subject_canton = RUS_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = RUS_oligarchy
		subject_canton = RUS_oligarchy
		priority = 25
		trigger = {
			coa_def_oligarchy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = RUS_soviet_union
		subject_canton = RUS_wb_soviet_union_just_russia
		priority = 1500 # need to override the DEFAULT
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = RUS_fascist
		subject_canton = RUS_fascist
		priority = 1500
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = RUS_theocracy
		subject_canton = RUS_theocracy
		priority = 20
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = RUS_nihilist
		priority = 1500 # need to override the DEFAULT
		trigger = { 
			coa_def_nihilist_flag_trigger = yes
		}
	}
	
	# WB anarchist flags
	flag_definition = {
		coa = RUS_anarchist
		subject_canton = RUS_anarchist
		priority = 1501
		
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

SAR = { # Sardinia-Piedmont
	flag_definition = {
		coa = SAR
		subject_canton = SAR_canton
		coa_with_overlord_canton = SAR_subject
		overlord_canton_offset = { 0.067 0.1 }
		overlord_canton_scale = { 0.4 0.4 }			
		allow_overlord_canton = yes		
		priority = 1
	}
	flag_definition = {
		coa = SAR_republic
		subject_canton = SAR_republic
		coa_with_overlord_canton = SAR_subject
		allow_overlord_canton = yes	
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = SAR_communist
		subject_canton = SAR_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = SAR_subject_GBR
		allow_overlord_canton = yes	
		overlord_canton_offset = { 0.067 0.1 }
		overlord_canton_scale = { 0.4 0.4 }			
		priority = 50
		trigger = { 
			coa_def_british_ensign_trigger = yes
		}
	}		
	
	# WB originals
	
	flag_definition = {
		coa = SAR_absolute_monarchy
		subject_canton = SAR_canton
		coa_with_overlord_canton = SAR_subject
		overlord_canton_offset = { 0.067 0.1 }
		overlord_canton_scale = { 0.4 0.4 }			
		allow_overlord_canton = yes	
		priority = 20
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = SAR_dictatorship
		subject_canton = SAR_canton
		coa_with_overlord_canton = SAR_subject
		overlord_canton_offset = { 0.067 0.1 }
		overlord_canton_scale = { 0.4 0.4 }			
		allow_overlord_canton = yes	
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = SAR_anarchist
		subject_canton = SAR_anarchist
		priority = 1501
		trigger = {
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

SAV = { # Savoy
	flag_definition = {
		coa = SAV		
		subject_canton = SAV
		priority = 1
		
		# WB edit
		overlord_canton_scale = { 0.44 0.4 }
		allow_overlord_canton = yes		
		coa_with_overlord_canton = SAV_subject
	}
	
	# WB originals
	
	flag_definition = {
		coa = SAV_absolute_monarchy
		subject_canton = SAV_absolute_monarchy
		
		overlord_canton_scale = { 0.44 0.4 }
		allow_overlord_canton = yes		
		coa_with_overlord_canton = SAV_subject
		priority = 15
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = SAV_republic
		subject_canton = SAV_republic
		
		overlord_canton_scale = { 0.44 0.4 }
		allow_overlord_canton = yes		
		coa_with_overlord_canton = SAV_subject		
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = SAV_dictatorship
		subject_canton = SAV_dictatorship
		priority = 20
		allow_overlord_canton = no
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = SAV_communist
		subject_canton = SAV_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	
	flag_definition = {
		coa = SAV_anarchist
		subject_canton = SAV_anarchist
		priority = 2501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	# Portrait-less flag, if Sardinia-Piedmont or S-P unifed Italy exists
	
	flag_definition = {
		coa = SAV_empty		
		subject_canton = SAV_empty	
		priority = 100
		
		# WB edit
		overlord_canton_scale = { 0.44 0.4 }
		allow_overlord_canton = yes
		
		trigger = {
			OR = {
				exists = c:SAR
				
				AND = {
					exists = c:ITA
					c:ITA = { has_variable = WB_is_Sardinia_Piedmont_var }
				}
			}
		}
	}
	
	flag_definition = {
		coa = SAV_absolute_monarchy_empty
		subject_canton = SAV_absolute_monarchy_empty
		
		overlord_canton_scale = { 0.44 0.4 }
		allow_overlord_canton = yes
		
		priority = 150
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			OR = {
				exists = c:SAR
				
				AND = {
					exists = c:ITA
					c:ITA = { has_variable = WB_is_Sardinia_Piedmont_var }
				}
			}
		}
	}
	
	flag_definition = {
		coa = SAV_republic_empty
		subject_canton = SAV_republic_empty
		
		overlord_canton_scale = { 0.44 0.4 }
		allow_overlord_canton = yes		
		coa_with_overlord_canton = SAV_empty	
		
		priority = 101
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			OR = {
				exists = c:SAR
				
				AND = {
					exists = c:ITA
					c:ITA = { has_variable = WB_is_Sardinia_Piedmont_var }
				}
			}
		}
	}
	
	flag_definition = {
		coa = SAV_dictatorship_empty
		subject_canton = SAV_dictatorship_empty
		
		priority = 200
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			OR = {
				exists = c:SAR
				
				AND = {
					exists = c:ITA
					c:ITA = { has_variable = WB_is_Sardinia_Piedmont_var }
				}
			}
		}
	}
	
	flag_definition = {
		coa = SAV_communist_empty
		subject_canton = SAV_communist_empty
		
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			OR = {
				exists = c:SAR
				
				AND = {
					exists = c:ITA
					c:ITA = { has_variable = WB_is_Sardinia_Piedmont_var }
				}
			}
		}
	}		
	
	flag_definition = {
		coa = SAV_anarchist_empty
		subject_canton = SAV_anarchist_empty
		priority = 2601
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			OR = {
				exists = c:SAR
				
				AND = {
					exists = c:ITA
					c:ITA = { has_variable = WB_is_Sardinia_Piedmont_var }
				}
			}
		}
	}
}

SER = { # Serbia
	flag_definition = {
		coa = SER_absolute_monarchy # WB edit
		subject_canton = SER_absolute_monarchy # WB edit
		allow_overlord_canton = yes			
		coa_with_overlord_canton = SER_subject					
		priority = 1
	}
	flag_definition = {
		coa = SER_principality # WB edit
		subject_canton = SER_absolute_monarchy # WB edit
		allow_overlord_canton = yes			
		coa_with_overlord_canton = SER_subject			
		priority = 20
		trigger = { 
			coa_def_monarchy_flag_trigger = yes # WB edit
		}
	}	
	flag_definition = {
		coa = SER
		subject_canton = SER
		allow_overlord_canton = yes				
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = SER_subject_TUR
		subject_canton = SER_subject_TUR
		priority = 50
		trigger = { 
			coa_def_turkish_ensign_trigger = yes
		}
	}		
	
	# WB originals
	
	flag_definition = {
		coa = SER_principality_TUR # WB edit
		subject_canton = SER_principality_TUR # WB edit		
		priority = 25
		trigger = {
			coa_def_monarchy_flag_trigger = yes
			exists = scope:actor
			OR = {
				AND = {
					c:TUR ?= {
						has_diplomatic_pact = {
							who = scope:actor
							type = protectorate
							is_initiator = yes
						}
					}
				}
				
				AND = {
					c:TUR ?= {
						has_diplomatic_pact = {
							who = scope:actor
							type = tributary
							is_initiator = yes
						}
					}
				}
			}
		}
	}
	
	flag_definition = {
		coa = SER_subject_AUS
		subject_canton = SER_subject_AUS
		allow_overlord_canton = no
		priority = 26	
		#overlord_canton_scale = { 0.34 0.34 }
		trigger = { 
			OR = {
				coa_def_austrian_ensign_trigger = yes
				
				AND = {
					exists = c:GER
					scope:actor = {
						is_subject_of = c:GER
					}
					c:GER = {
						OR = {
							has_variable = WB_is_Austria_var
							has_variable = WB_is_Austria_Hungary_var
							has_variable = WB_force_use_Austria_Hungary_var
						}
					}
				}
			}
		}
	}
	
	flag_definition = {
		coa = SER_kingdom
		subject_canton = SER_kingdom
		allow_overlord_canton = yes			
		coa_with_overlord_canton = SER_subject			
		priority = 21
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			coa_def_independent_trigger = yes
			
			scope:actor ?= {
				has_technology_researched = nationalism
			}
			
		}
	}
	
	flag_definition = {
		coa = SER_dictatorship
		subject_canton = SER_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = SER_fascist
		subject_canton = SER_fascist
		priority = 1500
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = SER_theocracy
		subject_canton = SER_theocracy
		priority = 30
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = SER_communist
		subject_canton = SER_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = SER_anarchist
		subject_canton = SER_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}


	
SPA = { # Spain
	flag_definition = {
		coa = SPA
		subject_canton = SPA
		coa_with_overlord_canton = SPA_subject
		allow_overlord_canton = yes
	}
	flag_definition = {
		coa = SPA_republic
		subject_canton = SPA_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = SPA_absolute_monarchy
		subject_canton = SPA_absolute_monarchy	
		priority = 10
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = SPA_dictatorship
		subject_canton = SPA_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = SPA_communist
		subject_canton = SPA_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	flag_definition = {
		coa = SPA_theocracy
		subject_canton = SPA_theocracy
		priority = 20
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = SPA_subject_GBR
		allow_overlord_canton = yes		
		priority = 50
		trigger = { 
			coa_def_british_ensign_trigger = yes
		}
	}		
	
	# WB anarchist flags
	flag_definition = {
		coa = SPA_anarchist
		subject_canton = SPA_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

SWE = { # Sweden
	flag_definition = {
		coa = SWE
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_sweden_x @canton_scale_sweden_y }
		subject_canton = SWE_canton
		priority = 1
	}
	flag_definition = {
		coa = SWE_norway
		coa_with_overlord_canton = SWE
		allow_overlord_canton = yes
		subject_canton = SWE_canton
		overlord_canton_scale = { @canton_scale_sweden_x @canton_scale_sweden_y }
		priority = 5
		trigger = {
			coa_SWE_use_norway_canton_trigger = yes
		}
	}
	flag_definition = {
		coa = SWE_union_mark_canton
		coa_with_overlord_canton = SWE
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_sweden_x @canton_scale_sweden_y }
		subject_canton = sub_SWE_union_mark
		priority = 6
		trigger = {
			coa_SWE_use_norway_canton_trigger = yes
			#coa_SWE_use_union_mark_canton_trigger = yes
			coa_def_WB_king_karl_johan_is_dead_trigger = yes
		}
	}
	flag_definition = {
		coa = SWE_united_scandinavia # WB edit
		subject_canton = SWE_united_scandinavia
		priority = 7
		trigger = {
			coa_SWE_use_union_mark_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = SWE_theocracy
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_sweden_x @canton_scale_sweden_y }
		subject_canton = SWE_theocracy_canton
		priority = 10
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = SWE_absolute_monarchy
		# allow_overlord_canton = yes
		# overlord_canton_scale = { @canton_scale_sweden_x @canton_scale_sweden_y }
		subject_canton = SWE
		priority = 10
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = SWE_communist
		subject_canton = SWE_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = SWE_fascist
		subject_canton = SWE_fascist
		priority = 1500
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}			
	
	# WB originals
	
	flag_definition = {
		coa = SWE_republic
		priority = 10
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_sweden_x @canton_scale_sweden_y }
		subject_canton = SWE_canton
		
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = SWE_WB_war_union
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_sweden_x @canton_scale_sweden_y }
		subject_canton = sub_SWE_union_mark
		priority = 11
		
		trigger = {
			coa_def_war_trigger = yes
			
			coa_def_monarchy_flag_trigger = yes
			coa_SWE_use_norway_canton_trigger = yes
			coa_def_WB_king_karl_johan_is_dead_trigger = no
		}
	}
	
	flag_definition = {
		coa = SWE_WB_war_union_mark
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_sweden_x @canton_scale_sweden_y }
		subject_canton = sub_SWE_union_mark
		priority = 12
		
		trigger = {
			coa_def_war_trigger = yes
			
			coa_def_monarchy_flag_trigger = yes
			coa_def_WB_king_karl_johan_is_dead_trigger = yes
		}
	}
	
	# Just so sleepy Sweden has something interesting
	flag_definition = {
		coa = SWE_WB_war
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_sweden_x @canton_scale_sweden_y }
		subject_canton = SWE_canton
		priority = 2
		
		trigger = {
			coa_def_war_trigger = yes
			
			coa_def_monarchy_flag_trigger = yes
		}
	}
	
	# So that the couple portrait of Sweden and Norway is removed if Norway declares an indepedence war
	flag_definition = {
		coa = SWE_WB_war
		subject_canton = SWE_canton
		priority = 6
		
		trigger = {
			coa_def_war_trigger = yes
			
			coa_def_monarchy_flag_trigger = yes
			
			exists = c:NOR
			exists = c:SWE
			c:SWE = { has_war_with = c:NOR }
		}
	}
	
	flag_definition = {
		coa = SWE_dictatorship
		subject_canton = SWE_dictatorship
		priority = 1500
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes = yes
		}
	}
	
	flag_definition = {
		coa = SWE_anarchist
		subject_canton = SWE_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

SIC = { # Two Sicilies
	flag_definition = {
		coa = SIC
		coa_with_overlord_canton = SIC_subject		
		allow_overlord_canton = yes				
		subject_canton = SIC
		priority = 1
	}
	flag_definition = {
		coa = SIC_republic
		subject_canton = SIC_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = SIC_dictatorship
		subject_canton = SIC_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = SIC_communist
		subject_canton = SIC_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	
	# WB anarchist flags
	flag_definition = {
		coa = SIC_anarchist
		subject_canton = SIC_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	# WU Sicily only
	
	flag_definition = {
		coa = SIC_WU_Sicily
		coa_with_overlord_canton = SIC_subject_WU_Sicily		
		allow_overlord_canton = yes				
		subject_canton = SIC_WU_Sicily
		priority = 5
		
		trigger = {
			exists = scope:actor
			scope:actor = {
				owns_entire_state_region = STATE_SICILY
				NOT = { has_state_in_state_region = STATE_CAMPANIA }
			}
		}
	}
	flag_definition = {
		coa = SIC_republic_WU_Sicily
		subject_canton = SIC_republic_WU_Sicily
		priority = 15
		trigger = {
			coa_def_republic_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				owns_entire_state_region = STATE_SICILY
				NOT = { has_state_in_state_region = STATE_CAMPANIA }
			}
		}
	}	
	flag_definition = {
		coa = SIC_dictatorship_WU_Sicily
		subject_canton = SIC_dictatorship_WU_Sicily
		priority = 25
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				owns_entire_state_region = STATE_SICILY
				NOT = { has_state_in_state_region = STATE_CAMPANIA }
			}
		}
	}	
	flag_definition = {
		coa = SIC_communist_WU_Sicily
		subject_canton = SIC_communist_WU_Sicily
		priority = 1505
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				owns_entire_state_region = STATE_SICILY
				NOT = { has_state_in_state_region = STATE_CAMPANIA }
			}
		}
	}		
	
	flag_definition = {
		coa = SIC_anarchist_WU_Sicily
		subject_canton = SIC_anarchist_WU_Sicily
		priority = 1506
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				owns_entire_state_region = STATE_SICILY
				NOT = { owns_entire_state_region = STATE_CAMPANIA }
			}
		}
	}
	
	# WU Naples only
	
	flag_definition = {
		coa = SIC_WU_Naples
		coa_with_overlord_canton = SIC_subject_WU_Naples		
		allow_overlord_canton = yes				
		subject_canton = SIC_WU_Naples
		priority = 5
		
		trigger = {
			exists = scope:actor
			scope:actor = {
				NOT = { has_state_in_state_region = STATE_SICILY }
				owns_entire_state_region = STATE_CAMPANIA
			}
		}
	}
	flag_definition = {
		coa = SIC_republic_WU_Naples
		subject_canton = SIC_republic_WU_Naples
		priority = 15
		trigger = {
			coa_def_republic_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				NOT = { has_state_in_state_region = STATE_SICILY }
				owns_entire_state_region = STATE_CAMPANIA
			}
		}
	}	
	flag_definition = {
		coa = SIC_dictatorship_WU_Naples
		subject_canton = SIC_dictatorship_WU_Naples
		priority = 25
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				NOT = { has_state_in_state_region = STATE_SICILY }
				owns_entire_state_region = STATE_CAMPANIA
			}
		}
	}	
	flag_definition = {
		coa = SIC_communist_WU_Naples
		subject_canton = SIC_communist_WU_Naples
		priority = 1505
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				NOT = { has_state_in_state_region = STATE_SICILY }
				owns_entire_state_region = STATE_CAMPANIA
			}
		}
	}		
	
	flag_definition = {
		coa = SIC_anarchist_WU_Naples
		subject_canton = SIC_anarchist_WU_Naples
		priority = 1506
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				NOT = { has_state_in_state_region = STATE_SICILY }
				owns_entire_state_region = STATE_CAMPANIA
			}
		}
	}
}	

TRE = { # Trieste
	flag_definition = {
		coa = TRE
		allow_overlord_canton = yes		
		coa_with_overlord_canton = TRE_subject			
		subject_canton = TRE
		priority = 1
	}
	
	# WB originals
	
	flag_definition = {
		coa = TRE_austrian_littoral		
		subject_canton = TRE_austrian_littoral
		priority = 20
		
		trigger = { 
			coa_def_austrian_ensign_trigger = yes
		}
	}
	
	flag_definition = {
		coa = TRE_imperial_city		
		subject_canton = TRE_imperial_city
		priority = 55
		
		trigger = {
			coa_def_austrian_ensign_trigger = yes
			coa_def_republic_flag_trigger = yes
			
			exists = c:AUS
			c:AUS = {
				OR = {
					has_law = law_type:law_chiefdom
					has_law = law_type:law_monarchy
				}
			}
		}
	}
	
	flag_definition = {
		coa = TRE_monarchy
		subject_canton = TRE_monarchy
		allow_overlord_canton = yes		
		coa_with_overlord_canton = TRE_subject
		priority = 10
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = TRE_dictatorship
		subject_canton = TRE_dictatorship
		priority = 60
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = TRE_communist
		subject_canton = TRE_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = TRE_theocracy
		subject_canton = TRE_theocracy
		priority = 60
		trigger = {
			coa_def_theocracy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = TRE_anarchist
		subject_canton = TRE_anarchist
		priority = 1506
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

TUS = { # Tuscany
	flag_definition = {
		coa = TUS
		allow_overlord_canton = yes	
		coa_with_overlord_canton = TUS_subject
		overlord_canton_scale = { 0.337 0.337 }		
		subject_canton = TUS
		priority = 1
	}
	flag_definition = {
		coa = TUS_republic
		subject_canton = TUS_merchant_ensign	
		allow_overlord_canton = yes	
		overlord_canton_scale = { 0.337 0.337 }				
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = TUS_communist
		subject_canton = TUS_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = TUS
		subject_canton = TUS
		allow_overlord_canton = no
		priority = 50
		trigger = { 
			coa_def_austrian_ensign_trigger = yes
		}
	}		
	
	# WB originals
	
	flag_definition = {
		coa = TUS_dictatorship
		subject_canton = TUS_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = TUS_florentine_republic
		subject_canton = TUS_merchant_ensign
		allow_overlord_canton = yes		
		coa_with_overlord_canton = TUS_subject
		priority = 25
		trigger = {
			coa_def_oligarchy_flag_trigger = yes
		}
	}

	flag_definition = {
		coa = TUS_theocracy
		subject_canton = TUS_theocracy
		priority = 20
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = TUS_anarchist
		subject_canton = TUS_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = TUS_subject_FRA	
		subject_canton = TUS_subject_FRA			
		priority = 50
		trigger = { 
			coa_def_french_ensign_trigger = yes
		}
	}
}	

VEN = { # Venice
	flag_definition = {
		coa = VEN_republic # WB edit
		subject_canton = VEN
		allow_overlord_canton = yes		
		coa_with_overlord_canton = VEN_subject			
		priority = 1
	}
	
	# WB originals
	
	flag_definition = {
		coa = VEN_monarchy
		subject_canton = VEN_monarchy
		allow_overlord_canton = yes		
		coa_with_overlord_canton = VEN_subject
		priority = 10
		trigger = {
			coa_def_monarchy_flag_trigger = yes = yes
		}
	}
	
	flag_definition = {
		coa = VEN_dictatorship
		subject_canton = VEN_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = VEN_risorgimento
		subject_canton = VEN_risorgimento
		allow_overlord_canton = yes		
		coa_with_overlord_canton = VEN_subject
		priority = 15
		trigger = {
			coa_def_republic_flag_trigger = yes
			exists = scope:actor
			scope:actor = {
				has_technology_researched = nationalism
			}
		}
	}
	
	flag_definition = {
		coa = VEN_austria_subject
		subject_canton = VEN_austria_subject
		allow_overlord_canton = no
		priority = 50
		trigger = { 
			coa_def_austrian_ensign_trigger = yes
		}
	}
	
	flag_definition = {
		coa = VEN_communist
		subject_canton = VEN_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	flag_definition = {
		coa = VEN_anarchist
		subject_canton = VEN_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

UKR = { # Ukraine
	flag_definition = {
		coa = UKR
		allow_overlord_canton = yes		
		subject_canton = UKR
		priority = 1
	}
	flag_definition = {
		coa = UKR_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = UKR_free_state
		priority = 1600
		trigger = {
			exists = scope:actor
			scope:actor = {
				has_law = law_type:law_council_republic
				has_law = law_type:law_anarchy
			}
		}
	}
	flag_definition = {
		coa = UKR_fascist
		priority = 1500
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}
	
	# WB anarchist flags
	flag_definition = {
		coa = UKR_anarchist
		subject_canton = UKR_anarchist
		priority = 1700
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}


WAL = { # Wallachia
	flag_definition = {
		coa = WAL
		allow_overlord_canton = yes
		coa_with_overlord_canton = WAL_subject		
		subject_canton = WAL
		priority = 1
	}
	flag_definition = {
		# Canton with stars when ruled by the Ottoman Empire
		coa = WAL_subject
		subject_canton = WAL
		priority = 3 # WB edit
		trigger = { 
			coa_def_turkish_ensign_trigger = yes		
		}
	}	
	
	# WB edit
	flag_definition = {
		coa = WAL_united_principalities
		subject_canton = WAL_united_principalities
		priority = 100
		trigger = { 
			scope:actor ?= {
				has_variable = ROM_united_principality
			}
		}
	}
	
	# WB originals
	
	flag_definition = {
		coa = WAL_united_principalities
		subject_canton = WAL_united_principalities
		priority = 50
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			coa_def_moldavian_ensign_trigger = yes
			
			c:MOL ?= { has_variable = ROM_united_principality }
		}
	}
	
	flag_definition = {
		coa = WAL_united_principalities
		subject_canton = WAL_united_principalities
		priority = 15
		allow_overlord_canton = yes
		coa_with_overlord_canton = WAL_subject
		
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			exists = scope:actor
			
			scope:actor = {
				has_state_in_state_region = STATE_MOLDAVIA
			}
			
			NOT = { exists = c:MOL }
			
			scope:actor = { 
				has_technology_researched = nationalism
			}
		}
	}
	
	flag_definition = {
		coa = WAL_republic
		subject_canton = WAL_republic
		priority = 10
		allow_overlord_canton = yes
		coa_with_overlord_canton = WAL_subject
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}		
	
	flag_definition = {
		coa = WAL_dictatorship
		subject_canton = WAL_dictatorship
		priority = 1500
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}

	flag_definition = {
		coa = WAL_communist
		subject_canton = WAL_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = WAL_anarchist
		subject_canton = WAL_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = WAL_civil_ensign
		subject_canton = WAL
		priority = 2
		trigger = {
			coa_def_monarchy_flag_trigger = yes
			exists = scope:actor
			OR = {
				AND = {
					c:TUR ?= {
						has_diplomatic_pact = {
							who = scope:actor
							type = protectorate
							is_initiator = yes
						}
					}
				}
				
				AND = {
					c:TUR ?= {
						has_diplomatic_pact = {
							who = scope:actor
							type = tributary
							is_initiator = yes
						}
					}
				}
			}
		}
	}
	
	flag_definition = {
		coa = WAL_monarchy_nationalism
		subject_canton = WAL_monarchy_nationalism
		priority = 10
		trigger = {
			coa_def_monarchy_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { 
				has_technology_researched = nationalism
			}
			
			OR = {
				coa_def_independent_trigger = yes
				coa_def_secessionist_or_revolutionary_trigger = yes
			}
		}
	}
	
	flag_definition = {
		coa = WAL_republic_nationalism
		subject_canton = WAL_republic_nationalism
		priority = 15
		trigger = {
			coa_def_republic_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { 
				has_technology_researched = nationalism
			}
			
			OR = {
				coa_def_independent_trigger = yes
				coa_def_secessionist_or_revolutionary_trigger = yes
			}
		}
	}
}


PRC = { # Paris Commune
	flag_definition = {
		coa = PRC
		subject_canton = PRC
		priority = 1
	}
	
	# WB originals
	
	flag_definition = {
		coa = PRC
		subject_canton = PRC
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = FRA_wb_commune_flag
		subject_canton = FRA_wb_commune_flag
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = PRC_monarchy
		subject_canton = PRC_monarchy
		priority = 100
		trigger = {
			scope:actor ?= {
				OR = {
					has_law = law_type:law_chiefdom
					has_law = law_type:law_monarchy
				}
			}
		}
	}
}