# All major European formables except for Germany, NGF and SGF

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

BYZ = { # Byzantium
	flag_definition = {
		coa = BYZ
		allow_overlord_canton = yes
		subject_canton = BYZ
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		
		# WB edit
		coa_with_overlord_canton = BYZ_subject
	}
	
	# WB originals
	
	flag_definition = {
		coa = BYZ_absolute_monarchy
		subject_canton = BYZ_absolute_monarchy
		priority = 10
		
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		allow_overlord_canton = yes
		coa_with_overlord_canton = BYZ_subject
		
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = BYZ_republic
		subject_canton = BYZ_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}		
	
	flag_definition = {
		coa = BYZ_dictatorship
		subject_canton = BYZ_dictatorship
		priority = 50
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = BYZ_communist
		subject_canton = BYZ_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = BYZ_anarchist
		subject_canton = BYZ_anarchist
		priority = 1501
		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
		}
	}
	
	## Greece Byzantium
	
	
	flag_definition = {
		coa = BYZ_GRE_republic
		subject_canton = BYZ_GRE_republic
		priority = 15
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Greece_var }
		}
	}		
	
	flag_definition = {
		coa = BYZ_GRE_junta
		subject_canton = BYZ_GRE_junta
		priority = 16
		trigger = {
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Greece_var }
			scope:actor = { has_government_type = gov_junta }
		}
	}
	
	## Ionian Islands Byzantium
	
	flag_definition = {
		coa = BYZ_ION
		allow_overlord_canton = yes
		subject_canton = BYZ_ION
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		coa_with_overlord_canton = BYZ_ION_subject
		priority = 105
		trigger = {
			scope:actor ?= { has_variable = WB_is_Corfu_var }
		}
	}
	
	flag_definition = {
		coa = BYZ_ION_republic
		subject_canton = BYZ_ION_republic
		priority = 115
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Corfu_var }
		}
	}
	
	flag_definition = {
		coa = BYZ_ION_absolute_monarchy
		subject_canton = BYZ_absolute_monarchy
		priority = 110
		
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		allow_overlord_canton = yes
		coa_with_overlord_canton = BYZ_ION_subject
		
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Corfu_var }
		}
	}	
	
	flag_definition = {
		coa = BYZ_ION_dictatorship
		subject_canton = BYZ_dictatorship
		priority = 150
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Corfu_var }
		}
	}
	
	flag_definition = {
		coa = BYZ_ION_communist
		subject_canton = BYZ_communist
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Corfu_var }
		}
	}
	
	flag_definition = {
		coa = BYZ_ION_anarchist
		subject_canton = BYZ_anarchist
		priority = 1601
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Corfu_var }
		}
	}
	
	flag_definition = {
		coa = BYZ_ION_theocracy
		subject_canton = GRE_theocracy
		priority = 120
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Corfu_var }
		}
	}
	
	## Cyprus Byzantium
	
	flag_definition = {
		coa = BYZ_CYP
		allow_overlord_canton = yes
		subject_canton = BYZ_CYP
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		coa_with_overlord_canton = BYZ_subject
		priority = 5
		trigger = {
			exists = scope:actor
			scope:actor = {
				was_formed_from = CYP
			}
		}
	}
	
	flag_definition = {
		coa = BYZ_CYP_republic
		subject_canton = BYZ_CYP_republic
		priority = 15
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				was_formed_from = CYP
			}
		}
	}
	
	## Crete Byzantium
	
	flag_definition = {
		coa = BYZ_CRE
		allow_overlord_canton = yes
		subject_canton = BYZ_CRE
		overlord_canton_scale = { @canton_scale_cross_x @canton_scale_cross_y }
		coa_with_overlord_canton = BYZ_subject
		priority = 5
		trigger = {
			exists = scope:actor
			scope:actor = {
				was_formed_from = CRE
			}
		}
	}
	
	flag_definition = {
		coa = BYZ_CRE_republic
		subject_canton = BYZ_CRE_republic
		priority = 15
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				was_formed_from = CRE
			}
		}
	}
}

KUK = { # Danubian State

	# WB originals

	flag_definition = {
		coa = KUK
		subject_canton = KUK
		allow_overlord_canton = yes	
		priority = 1
	}
	
	flag_definition = {
		coa = KUK_republic
		subject_canton = KUK_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}		
	
	flag_definition = {
		coa = KUK_dictatorship
		subject_canton = KUK_dictatorship
		priority = 20
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = KUK_communist
		subject_canton = KUK_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	
	# WB anarchist flags
	flag_definition = {
		coa = KUK_anarchist
		subject_canton = KUK_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	# Austria Danubia (for mods) #
	
	flag_definition = {
		coa = KUK_AUS
		subject_canton = KUK_AUS
		allow_overlord_canton = yes	
		priority = 100
		
		trigger = {
			exists = scope:actor	
			OR = {
				scope:actor = { has_variable = WB_is_Austria_var }
				scope:actor = { has_variable = WB_is_Austria_Hungary_var }
			}
		}
	}
	
	flag_definition = {
		coa = KUK_AUS_republic
		subject_canton = KUK_AUS_republic
		priority = 110
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			exists = scope:actor	
			OR = {
				scope:actor = { has_variable = WB_is_Austria_var }
				scope:actor = { has_variable = WB_is_Austria_Hungary_var }
			}
		}
	}		
	
	flag_definition = {
		coa = KUK_AUS_dictatorship
		subject_canton = KUK_AUS_dictatorship
		priority = 1600
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor	
			OR = {
				scope:actor = { has_variable = WB_is_Austria_var }
				scope:actor = { has_variable = WB_is_Austria_Hungary_var }
			}
		}
	}
	
	flag_definition = {
		coa = KUK_AUS_communist
		subject_canton = KUK_AUS_communist
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor	
			OR = {
				scope:actor = { has_variable = WB_is_Austria_var }
				scope:actor = { has_variable = WB_is_Austria_Hungary_var }
			}
		}
	}
	
	flag_definition = {
		coa = AUS_Austria_Hungary_anarchist
		subject_canton = AUS_Austria_Hungary_anarchist
		priority = 1601
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			exists = scope:actor	
			OR = {
				scope:actor = { has_variable = WB_is_Austria_var }
				scope:actor = { has_variable = WB_is_Austria_Hungary_var }
			}
		}
	}
	
	# Hungary Danubia #
	
	flag_definition = {
		coa = KUK_HUN_absolute_monarchy # I like this flag better
		subject_canton = KUK_HUN # But Hungary Danubia's overlord flag can still be the old one
		allow_overlord_canton = no	
		priority = 101
		
		trigger = {
			scope:actor ?= { has_variable = WB_is_Hungary_var }
		}
	}
	
	#flag_definition = {
	#	coa = KUK_HUN_absolute_monarchy
	#	subject_canton = KUK_HUN_absolute_monarchy
	#	allow_overlord_canton = yes	
	#	priority = 110
	#	
	#	trigger = { 
	#		coa_def_absolute_monarchy_flag_trigger = yes
	#		
	#		exists = scope:actor
	#		exists = c:KUK
	#		
	#		OR = {
	#			scope:actor = { was_formed_from = HUN }
	#			scope:actor = { has_variable = WB_is_Hungary_var }
	#			c:KUK = { capital = { state_region = s:STATE_CENTRAL_HUNGARY } }
	#		}
	#	}
	#}
	
	flag_definition = {
		coa = KUK_HUN_republic
		subject_canton = KUK_HUN_republic
		priority = 111
		trigger = { 
			coa_def_republic_flag_trigger = yes
			scope:actor ?= { has_variable = WB_is_Hungary_var }
		}
	}		
	
	flag_definition = {
		coa = KUK_HUN_dictatorship
		subject_canton = KUK_HUN_dictatorship
		priority = 121
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			scope:actor ?= { has_variable = WB_is_Hungary_var }
		}
	}
	
	flag_definition = {
		coa = KUK_HUN_communist
		subject_canton = KUK_HUN_communist
		priority = 1601
		trigger = { 
			coa_def_communist_flag_trigger = yes
			scope:actor ?= { has_variable = WB_is_Hungary_var }
		}
	}
	
	flag_definition = {
		coa = HUN_anarchist
		subject_canton = HUN_anarchist
		priority = 1602
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			scope:actor ?= { has_variable = WB_is_Hungary_var }
		}
	}
	
	flag_definition = {
		coa = KUK_HUN_flag_hole_republic
		subject_canton = ROM_flag_hole_republic
		priority = 1606
		allow_revolutionary_indicator = no
		trigger = {
			exists = c:KUK
			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:KUK = { has_law = law_type:law_council_republic }
			OR = {
				c:KUK = { was_formed_from = HUN }
				c:KUK = { has_variable = WB_is_Hungary_var }
				c:KUK = { capital = { state_region = s:STATE_CENTRAL_HUNGARY } }
			}
		}
	}
	
	flag_definition = {
		coa = KUK_HUN_flag_hole_monarchy
		subject_canton = ROM_flag_hole_monarchy
		allow_revolutionary_indicator = no
		priority = 1605
		trigger = {
			exists = c:KUK
			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:KUK = { has_law = law_type:law_council_republic  }
			OR = {
				c:KUK = { was_formed_from = HUN }
				c:KUK = { has_variable = WB_is_Hungary_var }
				c:KUK = { capital = { state_region = s:STATE_CENTRAL_HUNGARY } }
			}
		}
	}
	
	# For portrait-less tags to get a portrait
	flag_definition = {
		coa = KUK_HUN_absolute_monarchy # I like this flag better
		subject_canton = KUK_HUN # But Hungary Danubia's overlord flag can still be the old one
		allow_overlord_canton = no	
		priority = 100
		
		trigger = {
			exists = c:KUK
			c:KUK = { capital = { state_region = s:STATE_CENTRAL_HUNGARY } }
		}
	}
	
	flag_definition = {
		coa = KUK_HUN_republic
		subject_canton = KUK_HUN_republic
		priority = 110
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			exists = c:KUK
			c:KUK = { capital = { state_region = s:STATE_CENTRAL_HUNGARY } }
		}
	}		
	
	flag_definition = {
		coa = KUK_HUN_dictatorship
		subject_canton = KUK_HUN_dictatorship
		priority = 120
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			exists = c:KUK
			c:KUK = { capital = { state_region = s:STATE_CENTRAL_HUNGARY } }
		}
	}
	
	flag_definition = {
		coa = KUK_HUN_communist
		subject_canton = KUK_HUN_communist
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = c:KUK
			c:KUK = { capital = { state_region = s:STATE_CENTRAL_HUNGARY } }
		}
	}
	
	flag_definition = {
		coa = HUN_anarchist
		subject_canton = HUN_anarchist
		priority = 1601
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			exists = c:KUK
			c:KUK = { capital = { state_region = s:STATE_CENTRAL_HUNGARY } }
		}
	}
	
	# Romania Danubia #
	
	flag_definition = {
		coa = KUK_ROM
		subject_canton = KUK_ROM
		allow_overlord_canton = yes	
		priority = 101
		
		trigger = {
			scope:actor ?= { has_variable = WB_is_Wallachia_var }
		}
	}
	
	flag_definition = {
		coa = KUK_ROM_republic
		subject_canton = KUK_ROM_republic
		priority = 111
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Wallachia_var }
		}
	}		
	
	flag_definition = {
		coa = KUK_ROM_dictatorship
		subject_canton = KUK_ROM_dictatorship
		priority = 121
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Wallachia_var }
		}
	}
	
	flag_definition = {
		coa = KUK_ROM_communist
		subject_canton = KUK_ROM_communist
		priority = 1601
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Wallachia_var }
		}
	}
	
	flag_definition = {
		coa = KUK_ROM_anarchist
		subject_canton = KUK_ROM_anarchist
		priority = 1602
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Wallachia_var }
		}
	}
	
	flag_definition = {
		coa = KUK_ROM_flag_hole_republic
		subject_canton = ROM_flag_hole_republic
		priority = 1605
		allow_revolutionary_indicator = no
		trigger = {
			exists = c:KUK
			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:KUK = { has_law = law_type:law_council_republic }
			OR = {
				c:KUK = { was_formed_from = ROM }
				c:KUK = { was_formed_from = WAL }
				c:KUK = { has_variable = WB_is_Wallachia_var }
				c:KUK = { capital = { state_region = s:STATE_WALLACHIA  } }
			}
		}
	}
	
	flag_definition = {
		coa = KUK_ROM_flag_hole_monarchy
		subject_canton = ROM_flag_hole_monarchy
		allow_revolutionary_indicator = no
		priority = 1605
		trigger = {
			exists = c:KUK
			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:KUK = { has_law = law_type:law_council_republic  }
			OR = {
				c:KUK = { was_formed_from = ROM }
				c:KUK = { was_formed_from = WAL }
				c:KUK = { has_variable = WB_is_Wallachia_var }
				c:KUK = { capital = { state_region = s:STATE_WALLACHIA  } }
			}
		}
	}
	
	# For portrait-less tags to a portrait
	flag_definition = {
		coa = KUK_ROM
		subject_canton = KUK_ROM
		allow_overlord_canton = yes	
		priority = 100
		
		trigger = {
			exists = scope:actor
			exists = c:KUK
			
			OR = {
				scope:actor = { was_formed_from = ROM }
				scope:actor = { was_formed_from = WAL }
				scope:actor = { has_variable = WB_is_Wallachia_var }
				c:KUK = { capital = { state_region = s:STATE_WALLACHIA  } }
			}
		}
	}
	
	flag_definition = {
		coa = KUK_ROM_republic
		subject_canton = KUK_ROM_republic
		priority = 110
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			exists = scope:actor
			exists = c:KUK
			
			OR = {
				scope:actor = { was_formed_from = ROM }
				scope:actor = { was_formed_from = WAL }
				scope:actor = { has_variable = WB_is_Wallachia_var }
				c:KUK = { capital = { state_region = s:STATE_WALLACHIA  } }
			}
		}
	}		
	
	flag_definition = {
		coa = KUK_ROM_dictatorship
		subject_canton = KUK_ROM_dictatorship
		priority = 120
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			exists = c:KUK
			
			OR = {
				scope:actor = { was_formed_from = ROM }
				scope:actor = { was_formed_from = WAL }
				scope:actor = { has_variable = WB_is_Wallachia_var }
				c:KUK = { capital = { state_region = s:STATE_WALLACHIA  } }
			}
		}
	}
	
	flag_definition = {
		coa = KUK_ROM_communist
		subject_canton = KUK_ROM_communist
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			exists = c:KUK
			
			OR = {
				scope:actor = { was_formed_from = ROM }
				scope:actor = { was_formed_from = WAL }
				scope:actor = { has_variable = WB_is_Wallachia_var }
				c:KUK = { capital = { state_region = s:STATE_WALLACHIA  } }
			}
		}
	}
	
	flag_definition = {
		coa = KUK_ROM_anarchist
		subject_canton = KUK_ROM_anarchist
		priority = 1601
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			exists = scope:actor
			exists = c:KUK
			
			OR = {
				scope:actor = { was_formed_from = ROM }
				scope:actor = { was_formed_from = WAL }
				scope:actor = { has_variable = WB_is_Wallachia_var }
				c:KUK = { capital = { state_region = s:STATE_WALLACHIA  } }
			}
		}
	}
	
	
	# Moldavia Danubia #
	
	flag_definition = {
		coa = KUK_MOL
		subject_canton = KUK_MOL
		allow_overlord_canton = yes	
		priority = 102
		
		trigger = {
			scope:actor ?= { has_variable = WB_is_Moldavia_var }
		}
	}
	
	flag_definition = {
		coa = KUK_MOL_absolute_monarchy
		subject_canton = KUK_MOL_absolute_monarchy
		priority = 103
		
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Moldavia_var
			}
		}
	}
	
	flag_definition = {
		coa = KUK_MOL_republic
		subject_canton = KUK_MOL_republic
		priority = 112
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Moldavia_var }
		}
	}
	
	flag_definition = {
		coa = KUK_MOL_republic_bessarabia
		subject_canton = KUK_MOL_republic_bessarabia
		priority = 113
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Moldavia_var }
			c:KUK ?= { capital = { state_region = s:STATE_BESSARABIA } }
		}
	}
	
	flag_definition = {
		coa = KUK_MOL_dictatorship
		subject_canton = KUK_MOL_dictatorship
		priority = 122
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Moldavia_var }
		}
	}
	
	flag_definition = {
		coa = KUK_MOL_communist
		subject_canton = KUK_MOL_communist
		priority = 1602
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Moldavia_var }
		}
	}
	
	flag_definition = {
		coa = MOL_anarchist
		subject_canton = MOL_anarchist
		priority = 2603
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Moldavia_var }
		}
	}
	
	flag_definition = {
		coa = KUK_MOL_flag_hole_republic
		subject_canton = KUK_MOL_flag_hole_republic
		priority = 1607
		allow_revolutionary_indicator = no
		trigger = {
			exists = c:KUK
			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:KUK = { has_law = law_type:law_council_republic }
			OR = {
				c:KUK = { was_formed_from = MOL }
				c:KUK = { has_variable = WB_is_Moldavia_var }
				c:KUK = { capital = { state_region = s:STATE_MOLDAVIA  } }
			}
		}
	}
	
	flag_definition = {
		coa = KUK_MOL_flag_hole_monarchy
		subject_canton = KUK_MOL_flag_hole_monarchy
		allow_revolutionary_indicator = no
		priority = 1607
		trigger = {
			exists = c:KUK
			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:KUK = { has_law = law_type:law_council_republic  }
			OR = {
				c:KUK = { was_formed_from = MOL }
				c:KUK = { has_variable = WB_is_Moldavia_var }
				c:KUK = { capital = { state_region = s:STATE_MOLDAVIA  } }
			}
		}
	}
	
	## Romania and Moldavia
	
	flag_definition = {
		coa = KUK_ROM_together
		subject_canton = KUK_ROM_together
		priority = 170
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_ROM_duo_var
				
				OR = {
					was_formed_from = ROM
					has_variable = WB_is_Wallachia_var
				}
			}
		}
	}
		
	flag_definition = {
		coa = KUK_ROM_together_MOL
		subject_canton = KUK_ROM_together_MOL
		priority = 171
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_ROM_duo_var
				has_variable = WB_is_Moldavia_var
			}
		}
	}
	
	flag_definition = {
		coa = KUK_ROM_together_MOL_abs_monarchy
		subject_canton = KUK_ROM_together_MOL_abs_monarchy
		priority = 172
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_ROM_duo_var
				has_variable = WB_is_Moldavia_var
			}
		}
	}
}

SCA = { # Scandinavia
	flag_definition = {
		coa = SCA
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_denmark_x @canton_scale_denmark_y }
		subject_canton = SCA_canton
		priority = 1
	}

	flag_definition = {
		coa = SCA_kalmar_union
		subject_canton = SCA_kalmar_union
		allow_overlord_canton = yes		
		priority = 20
		trigger = {
			coa_def_kalmar_flag_trigger = yes
		}
	}
	
	# WB originals
	
	flag_definition = {
		coa = SCA_anarchist
		subject_canton = SCA_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = SCA_communist
		subject_canton = SCA_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = SCA_dictatorship
		subject_canton = SCA_dictatorship
		priority = 1500
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	
	## Denmark Scandinavia	
	
	flag_definition = {
		coa = SCA_kalmar_union
		subject_canton = SCA_kalmar_union
		allow_overlord_canton = yes		
		priority = 100
		
		trigger = {
			scope:actor ?= { has_variable = WB_is_Denmark_var }
		}
	}
	
	flag_definition = {
		coa = SCA_anarchist_denmark
		subject_canton = SCA_anarchist_denmark
		priority = 1602
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Denmark_var }
		}
	}	
	
	flag_definition = {
		coa = SCA_communist_denmark
		subject_canton = SCA_communist_denmark
		priority = 1601
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Denmark_var }
		}
	}	
	
	flag_definition = {
		coa = SCA_dictatorship_denmark
		subject_canton = SCA_dictatorship_denmark
		priority = 1601
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Denmark_var }
		}
	}
	
	# Denmark legacy triggers
	
	flag_definition = {
		coa = SCA_kalmar_union
		subject_canton = SCA_kalmar_union
		allow_overlord_canton = yes		
		priority = 15
		
		trigger = {
			exists = scope:actor
			exists = c:SCA
			
			scope:actor = {
				capital = {
					state_region = {
						OR = {
							this = s:STATE_JUTLAND
							this = s:STATE_ZEALAND
							this = s:STATE_SCHLESWIG_HOLSTEIN
							
							this = s:STATE_GREENLAND
							this = s:STATE_ICELAND # Iceland should get her own portrait one day
						}
					}
				}
			}
			
			
		}
	}
	
	flag_definition = {
		coa = SCA_anarchist_denmark
		subject_canton = SCA_anarchist_denmark
		priority = 1551
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			exists = scope:actor
			exists = c:SCA
			
			scope:actor = {
				capital = {
					state_region = {
						OR = {
							this = s:STATE_JUTLAND
							this = s:STATE_ZEALAND
							this = s:STATE_SCHLESWIG_HOLSTEIN
							
							this = s:STATE_GREENLAND
							this = s:STATE_ICELAND # Iceland should get her own portrait one day
						}
					}
				}
			}
			
			
		}
	}	
	
	flag_definition = {
		coa = SCA_communist_denmark
		subject_canton = SCA_communist_denmark
		priority = 1550
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			exists = c:SCA
			
			scope:actor = {
				capital = {
					state_region = {
						OR = {
							this = s:STATE_JUTLAND
							this = s:STATE_ZEALAND
							this = s:STATE_SCHLESWIG_HOLSTEIN
							
							this = s:STATE_GREENLAND
							this = s:STATE_ICELAND # Iceland should get her own portrait one day
						}
					}
				}
			}
			
			
		}
	}	
	
	flag_definition = {
		coa = SCA_dictatorship_denmark
		subject_canton = SCA_dictatorship_denmark
		priority = 1550
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			exists = c:SCA
			
			scope:actor = {
				capital = {
					state_region = {
						OR = {
							this = s:STATE_JUTLAND
							this = s:STATE_ZEALAND
							this = s:STATE_SCHLESWIG_HOLSTEIN
							
							this = s:STATE_GREENLAND
							this = s:STATE_ICELAND # Iceland should get her own portrait one day
						}
					}
				}
			}
			
			
		}
	}
	
	## Norway Scandinavia
	
	flag_definition = {
		coa = SCA_norway
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_denmark_x @canton_scale_denmark_y }
		subject_canton = SCA_canton
		priority = 100
		
		trigger = {
			scope:actor ?= { has_variable = WB_is_Norway_var }
		}
	}
	
	flag_definition = {
		coa = SCA_anarchist_norway
		subject_canton = SCA_anarchist_norway
		priority = 1601
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Norway_var }
		}
	}	
	
	flag_definition = {
		coa = SCA_communist_norway
		subject_canton = SCA_communist_norway
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Norway_var }
		}
	}
	
	flag_definition = {
		coa = SCA_dictatorship_norway
		subject_canton = SCA_dictatorship_denmark
		priority = 1600
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= { has_variable = WB_is_Norway_var }
		}
	}
	
	# Norway legacy triggers
	
	flag_definition = {
		coa = SCA_norway
		allow_overlord_canton = yes
		overlord_canton_scale = { @canton_scale_sweden_x @canton_scale_sweden_y }
		subject_canton = SCA_canton
		priority = 20
		
		trigger = {
			exists = scope:actor
			exists = c:SCA
			
			c:SCA = {
				capital = {
					state_region = {
						OR = {
							this = s:STATE_WESTERN_NORWAY
							this = s:STATE_NORTHERN_NORWAY
							this = s:STATE_EASTERN_NORWAY
						}
					}
				}
			}
			
		}
	}
	
	flag_definition = {
		coa = SCA_anarchist_norway
		subject_canton = SCA_anarchist_norway
		priority = 1551
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			exists = scope:actor
			exists = c:SCA
			
			c:SCA = {
				capital = {
					state_region = {
						OR = {
							this = s:STATE_WESTERN_NORWAY
							this = s:STATE_NORTHERN_NORWAY
							this = s:STATE_EASTERN_NORWAY
						}
					}
				}
			}
			
		}
	}	
	
	flag_definition = {
		coa = SCA_communist_norway
		subject_canton = SCA_communist_norway
		priority = 1550
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			exists = scope:actor
			exists = c:SCA
			
			c:SCA = {
				capital = {
					state_region = {
						OR = {
							this = s:STATE_WESTERN_NORWAY
							this = s:STATE_NORTHERN_NORWAY
							this = s:STATE_EASTERN_NORWAY
						}
					}
				}
			}
			
		}
	}
	
	flag_definition = {
		coa = SCA_dictatorship_norway
		subject_canton = SCA_dictatorship_denmark
		priority = 1550
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			exists = c:SCA
			
			c:SCA = {
				capital = {
					state_region = {
						OR = {
							this = s:STATE_WESTERN_NORWAY
							this = s:STATE_NORTHERN_NORWAY
							this = s:STATE_EASTERN_NORWAY
						}
					}
				}
			}
			
		}
	}
}

# Iberia
IBE = { 
	# WB originals
	
	flag_definition = {
		coa = IBE
		subject_canton = IBE_absolute_monarchy	
		priority = 1		
	}	
	
	flag_definition = {
		coa = IBE_absolute_monarchy
		subject_canton = IBE_absolute_monarchy
		priority = 10
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = IBE_republic
		subject_canton = IBE_republic
		priority = 20
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = IBE_dictatorship
		subject_canton = IBE_dictatorship
		priority = 1500
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = IBE_communist
		subject_canton = IBE_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}
	
	#WB anarchist flags
	flag_definition = {
		coa = IBE_anarchist
		subject_canton = IBE_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
# Portugal Iberia
	
	flag_definition = {
		coa = IBE_POR
		subject_canton = IBE_absolute_monarchy_POR	
		priority = 10		
		
		trigger = {
			scope:actor ?= {
				OR = {
					was_formed_from = POR
					has_variable = WB_is_Portugal_var
				}
			}
		}
	}	
	
	flag_definition = {
		coa = IBE_absolute_monarchy_POR
		subject_canton = IBE_absolute_monarchy_POR
		priority = 15
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				OR = {
					was_formed_from = POR
					has_variable = WB_is_Portugal_var
				}
			}
		}
	}
	
	flag_definition = {
		coa = IBE_republic_POR
		subject_canton = IBE_republic_POR
		priority = 25
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			scope:actor ?= {
				OR = {
					was_formed_from = POR
					has_variable = WB_is_Portugal_var
				}
			}
		}
	}
	
	flag_definition = {
		coa = IBE_dictatorship_POR
		subject_canton = IBE_dictatorship_POR
		priority = 1505
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= {
				OR = {
					was_formed_from = POR
					has_variable = WB_is_Portugal_var
				}
			}
		}
	}	
	
	flag_definition = {
		coa = IBE_communist_POR
		subject_canton = IBE_communist_POR
		priority = 1505
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= {
				OR = {
					was_formed_from = POR
					has_variable = WB_is_Portugal_var
				}
			}
		}
	}
	
	#WB anarchist flags
	flag_definition = {
		coa = IBE_anarchist_POR
		subject_canton = IBE_anarchist_POR
		priority = 1506
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= {
				OR = {
					was_formed_from = POR
					has_variable = WB_is_Portugal_var
				}
			}
		}
	}
}


ITA = { # Italy
	flag_definition = {
		coa = ITA_republic
		subject_canton = ITA_republic
		priority = 1
	}
	flag_definition = {
		coa = ITA
		subject_canton = ITA
		priority = 10
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = ITA_republic
		subject_canton = ITA_republic
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = ITA_dictatorship
		subject_canton = ITA_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = ITA_communist
		subject_canton = ITA_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = ITA_fascist
		subject_canton = ITA_fascist
		priority = 1500
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}	
	
	## From vanilla's 1.1 patch
	
	flag_definition = {
		coa = ITA_sicilian
		subject_canton = ITA_sicilian
		
		priority = 5 # make it lower priority than WB's Two Sicilies Italy
		
		trigger = { 
			exists = scope:actor
			
			scope:actor = {
				has_law = law_type:law_monarchy
				ruler = {
					has_culture = cu:south_italian
				}
				capital = { 
					OR = {
						state_region = s:STATE_SICILY 
						state_region = s:STATE_CAMPANIA
						state_region = s:STATE_ABRUZZO
						state_region = s:STATE_APULIA
					}
				}
			}
		}
	}
	
	flag_definition = {
		coa = ITA_papal
		subject_canton = ITA_papal
		priority = 101
		
		trigger = {
			NOT = { exists = c:PAP } # Can't be Pope if the Pope is still in control of another country!
			coa_def_theocracy_flag_trigger = yes
		}
	}
	
	## WB originals
	
	flag_definition = {
		coa = ITA_anarchist
		subject_canton = ITA_anarchist
		priority = 1501
		trigger = {
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
## Various Italian unifier alts
	
	# Two Sicilies Italy
	
	flag_definition = {
		coa = ITA_SIC
		subject_canton = ITA_SIC
		priority = 100
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
		}
	}
	
	flag_definition = {
		coa = ITA_SIC_republic
		subject_canton = ITA_SIC_republic
		priority = 150
		trigger = { 
			exists = scope:actor
			coa_def_republic_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
		}
	}	
	flag_definition = {
		coa = ITA_SIC_dictatorship
		subject_canton = ITA_SIC_dictatorship
		priority = 250
		trigger = {
			exists = scope:actor
			coa_def_dictatorship_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
		}
	}	
	flag_definition = {
		coa = ITA_SIC_communist
		subject_canton = ITA_SIC_communist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_communist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
		}
	}	
	flag_definition = {
		coa = ITA_SIC_fascist
		subject_canton = ITA_SIC_fascist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_fascist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
		}
	}	
	
	flag_definition = {
		coa = ITA_SIC_anarchist
		subject_canton = ITA_SIC_anarchist
		priority = 1506
		trigger = {
			exists = scope:actor
			coa_def_anarchy_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
		}
	}
	
	
	# Papal States Italy
	
	flag_definition = {
		coa = ITA_PAP
		subject_canton = ITA_PAP
		priority = 150
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Papal_States_var }
			coa_def_theocracy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ITA_PAP_monarchy
		subject_canton = ITA_PAP_monarchy
		priority = 100
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Papal_States_var }
		}
	}
	
	flag_definition = {
		coa = PAP_roman_republic_1849
		subject_canton = PAP_roman_republic_1849
		priority = 150
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Papal_States_var }
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ITA_PAP_dictatorship
		subject_canton = ITA_PAP_dictatorship
		priority = 250
		trigger = {
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Papal_States_var }
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ITA_PAP_communist
		subject_canton = ITA_PAP_communist
		priority = 1505
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Papal_States_var }
			coa_def_communist_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = ITA_PAP_fascist
		subject_canton = ITA_PAP_fascist
		priority = 1505
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Papal_States_var }
			coa_def_fascist_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = PAP_anarchist
		subject_canton = PAP_anarchist
		priority = 1506
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Papal_States_var }
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	# Tuscany Italy
	
	flag_definition = {
		coa = ITA_TUS
		subject_canton = ITA_TUS
		priority = 100
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tuscany_var }
		}
	}
	
	flag_definition = {
		coa = ITA_TUS_republic
		subject_canton = ITA_TUS_republic
		priority = 150
		trigger = { 
			exists = scope:actor
			coa_def_republic_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Tuscany_var }
		}
	}	
	flag_definition = {
		coa = ITA_TUS_dictatorship
		subject_canton = ITA_TUS_dictatorship
		priority = 250
		trigger = {
			exists = scope:actor
			coa_def_dictatorship_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Tuscany_var }
		}
	}	
	flag_definition = {
		coa = ITA_TUS_communist
		subject_canton = ITA_TUS_communist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_communist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Tuscany_var }
		}
	}	
	flag_definition = {
		coa = ITA_TUS_fascist
		subject_canton = ITA_TUS_fascist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_fascist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Tuscany_var }
		}
	}	
	
	flag_definition = {
		coa = TUS_anarchist
		subject_canton = TUS_anarchist
		priority = 1506
		trigger = {
			exists = scope:actor
			coa_def_anarchy_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Tuscany_var }
		}
	}
	
	flag_definition = {
		coa = ITA_TUS_theocracy
		subject_canton = ITA_TUS_theocracy
		priority = 350
		trigger = {
			exists = scope:actor
			coa_def_theocracy_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Tuscany_var }
		}
	}
	
	# If just in a customs union
	flag_definition = {
		coa = ITA_TUS_France
		subject_canton = ITA_TUS_France
		priority = 151
		trigger = {
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tuscany_var }
			
			AND = {
				exists = c:FRA
				c:FRA = {
						has_diplomatic_pact = {
							who = scope:actor
							type = customs_union
							is_initiator = yes
						}
				}
			}
		}
	}
	
	# If an outright subject
	flag_definition = {
		coa = ITA_TUS_France_alt
		subject_canton = ITA_TUS_France_alt
		priority = 152
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Tuscany_var }
			
			coa_def_french_ensign_trigger = yes
		}
	}
	
	# Modena Italy
	
	flag_definition = {
		coa = ITA_MOD
		subject_canton = ITA_MOD
		priority = 100
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Modena_var }
		}
	}
	
	flag_definition = {
		coa = ITA_MOD_republic
		subject_canton = ITA_MOD_republic
		priority = 150
		trigger = { 
			exists = scope:actor
			coa_def_republic_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Modena_var }
		}
	}	
	flag_definition = {
		coa = ITA_MOD_dictatorship
		subject_canton = ITA_MOD_dictatorship
		priority = 250
		trigger = {
			exists = scope:actor
			coa_def_dictatorship_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Modena_var }
		}
	}	
	flag_definition = {
		coa = ITA_MOD_communist
		subject_canton = ITA_MOD_communist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_communist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Modena_var }
		}
	}	
	flag_definition = {
		coa = ITA_MOD_fascist
		subject_canton = ITA_MOD_fascist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_fascist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Modena_var }
		}
	}	
	
	flag_definition = {
		coa = ITA_MOD_anarchist
		subject_canton = ITA_MOD_anarchist
		priority = 1506
		trigger = {
			exists = scope:actor
			coa_def_anarchy_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Modena_var }
		}
	}
	
	flag_definition = {
		coa = ITA_MOD_Austria
		subject_canton = ITA_MOD_Austria
		priority = 105
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Modena_var }
			
			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
						}
					}
				}
			}
		}
	}
	
	# Lucca Italy
	
	flag_definition = {
		coa = ITA_LUC
		subject_canton = ITA_LUC
		priority = 100
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Lucca_var }
		}
	}
	
	flag_definition = {
		coa = LUC_Italy_risorgimento
		subject_canton = LUC_risorgimento
		priority = 150
		trigger = { 
			exists = scope:actor
			coa_def_republic_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Lucca_var }
		}
	}	
	flag_definition = {
		coa = ITA_LUC_dictatorship
		subject_canton = ITA_LUC_dictatorship
		priority = 250
		trigger = {
			exists = scope:actor
			coa_def_dictatorship_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Lucca_var }
		}
	}	
	flag_definition = {
		coa = ITA_LUC_communist
		subject_canton = ITA_LUC_communist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_communist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Lucca_var }
		}
	}	
	flag_definition = {
		coa = ITA_LUC_fascist
		subject_canton = ITA_LUC_fascist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_fascist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Lucca_var }
		}
	}	
	
	flag_definition = {
		coa = LUC_anarchist
		subject_canton = LUC_anarchist
		priority = 1506
		trigger = {
			exists = scope:actor
			coa_def_anarchy_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Lucca_var }
		}
	}
	
	flag_definition = {
		coa = ITA_LUC_theocracy
		subject_canton = ITA_LUC_theocracy
		priority = 350
		trigger = {
			exists = scope:actor
			coa_def_theocracy_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Lucca_var }
		}
	}
	
	flag_definition = {
		coa = ITA_LUC_Austria
		subject_canton = ITA_LUC_Austria
		priority = 105
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Lucca_var }
			
			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
						}
					}
				}
			}
		}
	}
	
	# Parma Italy
	
	flag_definition = {
		coa = ITA_PAR
		subject_canton = ITA_PAR
		allow_overlord_canton = yes	
		overlord_canton_scale = { 0.25 0.25 }
		priority = 100
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Parma_var }
		}
	}
	
	flag_definition = {
		coa = ITA_PAR_republic
		subject_canton = ITA_PAR_republic
		allow_overlord_canton = yes	
		overlord_canton_scale = { 0.25 0.25 }
		priority = 150
		trigger = { 
			exists = scope:actor
			coa_def_republic_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Parma_var }
		}
	}	
	flag_definition = {
		coa = ITA_PAR_dictatorship
		subject_canton = ITA_PAR_dictatorship
		priority = 250
		trigger = {
			exists = scope:actor
			coa_def_dictatorship_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Parma_var }
		}
	}	
	flag_definition = {
		coa = ITA_PAR_communist
		subject_canton = ITA_PAR_communist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_communist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Parma_var }
		}
	}	
	flag_definition = {
		coa = ITA_PAR_fascist
		subject_canton = ITA_PAR_fascist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_fascist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Parma_var }
		}
	}	
	
	flag_definition = {
		coa = ITA_PAR_Austria
		subject_canton = ITA_PAR_Austria
		priority = 105
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Parma_var }
			
			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
						}
					}
				}
			}
		}
	}
	
	flag_definition = {
		coa = ITA_PAR_anarchist
		subject_canton = ITA_PAR_anarchist
		priority = 1506
		trigger = {
			exists = scope:actor
			coa_def_anarchy_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Parma_var }
		}
	}
	
	# Lombardia Italy
	
	flag_definition = {
		coa = ITA_LOM
		subject_canton = ITA_LOM
		priority = 100
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Lombardia_var }
		}
	}
	
	flag_definition = {
		coa = ITA_LOM_republic
		subject_canton = ITA_LOM_republic
		priority = 150
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Lombardia_var }
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ITA_LOM_dictatorship
		subject_canton = ITA_LOM_dictatorship
		priority = 250
		trigger = {
			exists = scope:actor
			coa_def_dictatorship_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Lombardia_var }
		}
	}	
	flag_definition = {
		coa = ITA_LOM_communist
		subject_canton = ITA_LOM_communist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_communist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Lombardia_var }
		}
	}	
	flag_definition = {
		coa = ITA_LOM_fascist
		subject_canton = ITA_LOM_fascist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_fascist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Lombardia_var }
		}
	}	
	
	flag_definition = {
		coa = ITA_LOM_anarchist
		subject_canton = ITA_LOM_anarchist
		priority = 1506
		trigger = {
			exists = scope:actor
			coa_def_anarchy_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Lombardia_var }
		}
	}
	
	flag_definition = {
		coa = ITA_LOM_Austria
		subject_canton = ITA_LOM_Austria
		priority = 105
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Lombardia_var }
			
			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
						}
					}
				}
			}
		}
	}
	
	# Venice Italy
	
	flag_definition = {
		coa = ITA_VEN
		subject_canton = ITA_VEN_v1
		priority = 100
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Venice_var }
		}
	}
	
	flag_definition = {
		coa = ITA_VEN_absolute_monarchy
		subject_canton = ITA_VEN_v1
		priority = 101
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Venice_var }
		}
	}
	
	flag_definition = {
		coa = ITA_VEN_republic
		subject_canton = ITA_VEN_republic_v1
		priority = 150
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Venice_var }
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ITA_VEN_dictatorship
		subject_canton = ITA_VEN_dictatorship
		priority = 250
		trigger = {
			exists = scope:actor
			coa_def_dictatorship_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Venice_var }
		}
	}	
	flag_definition = {
		coa = ITA_VEN_communist
		subject_canton = ITA_VEN_communist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_communist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Venice_var }
		}
	}	
	flag_definition = {
		coa = ITA_VEN_fascist
		subject_canton = ITA_VEN_fascist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_fascist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Venice_var }
		}
	}	
	
	flag_definition = {
		coa = ITA_VEN_anarchist
		subject_canton = ITA_VEN_anarchist
		priority = 1506
		trigger = {
			exists = scope:actor
			coa_def_anarchy_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Venice_var }
		}
	}
	
	flag_definition = {
		coa = ITA_VEN_Austria
		subject_canton = ITA_VEN_Austria
		priority = 105
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Venice_var }
			
			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
						}
					}
				}
			}
		}
	}
	
	# Trieste Italy
	
	flag_definition = {
		coa = ITA_TRE
		subject_canton = ITA_TRE
		priority = 100
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Trieste_var }
		}
	}
	
	flag_definition = {
		coa = ITA_TRE_republic
		subject_canton = ITA_TRE_republic
		priority = 150
		trigger = { 
			exists = scope:actor
			coa_def_republic_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Trieste_var }
		}
	}	
	flag_definition = {
		coa = ITA_TRE_dictatorship
		subject_canton = ITA_TRE_dictatorship
		priority = 250
		trigger = {
			exists = scope:actor
			coa_def_dictatorship_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Trieste_var }
		}
	}	
	flag_definition = {
		coa = ITA_TRE_communist
		subject_canton = ITA_TRE_communist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_communist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Trieste_var }
		}
	}	
	flag_definition = {
		coa = ITA_TRE_fascist
		subject_canton = ITA_TRE_fascist
		priority = 1505
		trigger = { 
			exists = scope:actor
			coa_def_fascist_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Trieste_var }
		}
	}	
	
	flag_definition = {
		coa = ITA_TRE_theocracy
		subject_canton = ITA_TRE_theocracy
		priority = 350
		trigger = {
			exists = scope:actor
			coa_def_theocracy_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Trieste_var }
		}
	}
	
	flag_definition = {
		coa = ITA_TRE_anarchist
		subject_canton = ITA_TRE_anarchist
		priority = 1506
		trigger = {
			exists = scope:actor
			coa_def_anarchy_flag_trigger = yes
			scope:actor = { has_variable = WB_is_Trieste_var }
		}
	}
	
	flag_definition = {
		coa = ITA_TRE_south_slavs_monarchy
		subject_canton = ITA_TRE_south_slavs_monarchy
		
		priority = 200
		trigger = {
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Trieste_var }
			scope:actor = { 
				OR = {
					has_law = law_type:law_cultural_exclusion
					has_law = law_type:law_multicultural
				}
			}
			
			coa_def_monarchy_flag_trigger = yes
			
			exists = c:ITA
			c:ITA = {
				any_scope_state = {
					OR = {
						state_region = { is_homeland = slovene }
						state_region = { is_homeland = croat }
						state_region = { is_homeland = serb }
					}
					count > 5
				}
			}
		}
	}
	
	flag_definition = {
		coa = ITA_TRE_south_slavs_republic
		subject_canton = ITA_TRE_south_slavs_republic
		
		priority = 200
		trigger = {
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Trieste_var }
			scope:actor = { 
				OR = {
					has_law = law_type:law_cultural_exclusion
					has_law = law_type:law_multicultural
				}
			}
			
			coa_def_republic_flag_trigger = yes
			
			exists = c:ITA
			c:ITA = {
				any_scope_state = {
					OR = {
						state_region = { is_homeland = slovene }
						state_region = { is_homeland = croat }
						state_region = { is_homeland = serb }
					}
					count > 5
				}
			}
		}
	}
	
	flag_definition = {
		coa = ITA_TRE_Austria_subject
		subject_canton = ITA_TRE
		priority = 105
		trigger = { 
			exists = scope:actor
			scope:actor = { has_variable = WB_is_Trieste_var }
			
			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
						}
					}
				}
			}
		}
	}
	
	# WU Sicily Italy
	
	flag_definition = {
		coa = ITA_WU_Sicily
		subject_canton = ITA_WU_Sicily
		priority = 150
		trigger = { 
			exists = scope:actor
			exists = c:ITA
			
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
			scope:actor = {
				owns_entire_state_region = STATE_SICILY
				NOT = { owns_entire_state_region = STATE_CAMPANIA }
			}
		}
	}
	
	flag_definition = {
		coa = ITA_WU_Sicily_republic
		subject_canton = ITA_WU_Sicily_republic
		priority = 200
		trigger = { 
			exists = scope:actor
			exists = c:ITA
			
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
			coa_def_republic_flag_trigger = yes
			
			scope:actor = {
				owns_entire_state_region = STATE_SICILY
				NOT = { owns_entire_state_region = STATE_CAMPANIA }
			}
		}
	}
	
	flag_definition = {
		coa = ITA_WU_Sicily_dictatorship
		subject_canton = ITA_WU_Sicily_dictatorship
		priority = 300
		trigger = {
			exists = scope:actor
			exists = c:ITA
			
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor = {
				owns_entire_state_region = STATE_SICILY
				NOT = { owns_entire_state_region = STATE_CAMPANIA }
			}
		}
	}
	
	flag_definition = {
		coa = ITA_WU_Sicily_communist
		subject_canton = ITA_WU_Sicily_communist
		priority = 1510
		trigger = { 
			exists = scope:actor
			exists = c:ITA
			
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
			coa_def_communist_flag_trigger = yes
			
			scope:actor = {
				owns_entire_state_region = STATE_SICILY
				NOT = { owns_entire_state_region = STATE_CAMPANIA }
			}
		}
	}	
	
	flag_definition = {
		coa = ITA_WU_Sicily_fascist
		subject_canton = ITA_WU_Sicily_fascist
		priority = 1510
		trigger = { 
			exists = scope:actor
			exists = c:ITA
			
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
			coa_def_fascist_flag_trigger = yes
			
			scope:actor = {
				owns_entire_state_region = STATE_SICILY
				NOT = { owns_entire_state_region = STATE_CAMPANIA }
			}
		}
	}	
	
	flag_definition = {
		coa = ITA_WU_Sicily_anarchist
		subject_canton = ITA_WU_Sicily_anarchist
		priority = 1511
		trigger = { 
			exists = scope:actor
			exists = c:ITA
			
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor = {
				owns_entire_state_region = STATE_SICILY
				NOT = { owns_entire_state_region = STATE_CAMPANIA }
			}
		}
	}
	
	# WU Naples Italy
	
	flag_definition = {
		coa = ITA_WU_Naples
		subject_canton = ITA_WU_Naples
		priority = 150
		trigger = { 
			exists = scope:actor
			exists = c:ITA
			
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
			scope:actor = {
				NOT = { owns_entire_state_region = STATE_SICILY }
				owns_entire_state_region = STATE_CAMPANIA
			}
		}
	}
	
	flag_definition = {
		coa = ITA_WU_Naples_republic
		subject_canton = ITA_WU_Naples_republic
		priority = 200
		trigger = { 
			exists = scope:actor
			exists = c:ITA
			
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
			coa_def_republic_flag_trigger = yes
			
			scope:actor = {
				NOT = { owns_entire_state_region = STATE_SICILY }
				owns_entire_state_region = STATE_CAMPANIA
			}
		}
	}
	
	flag_definition = {
		coa = ITA_WU_Naples_dictatorship
		subject_canton = ITA_WU_Naples_dictatorship
		priority = 300
		trigger = {
			exists = scope:actor
			exists = c:ITA
			
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor = {
				NOT = { owns_entire_state_region = STATE_SICILY }
				owns_entire_state_region = STATE_CAMPANIA
			}
		}
	}
	
	flag_definition = {
		coa = ITA_WU_Naples_communist
		subject_canton = ITA_WU_Naples_communist
		priority = 1510
		trigger = { 
			exists = scope:actor
			exists = c:ITA
			
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
			coa_def_communist_flag_trigger = yes
			
			scope:actor = {
				NOT = { owns_entire_state_region = STATE_SICILY }
				owns_entire_state_region = STATE_CAMPANIA
			}
		}
	}	
	
	flag_definition = {
		coa = ITA_WU_Naples_fascist
		subject_canton = ITA_WU_Naples_fascist
		priority = 1510
		trigger = { 
			exists = scope:actor
			exists = c:ITA
			
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
			coa_def_fascist_flag_trigger = yes
			
			scope:actor = {
				NOT = { owns_entire_state_region = STATE_SICILY }
				owns_entire_state_region = STATE_CAMPANIA
			}
		}
	}	
	
	flag_definition = {
		coa = ITA_WU_Naples_anarchist
		subject_canton = ITA_WU_Naples_anarchist
		priority = 1511
		trigger = { 
			exists = scope:actor
			exists = c:ITA
			
			scope:actor = { has_variable = WB_is_Two_Sicilies_var }
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor = {
				NOT = { owns_entire_state_region = STATE_SICILY }
				owns_entire_state_region = STATE_CAMPANIA
			}
		}
	}

}

ROM = { # Romania
	flag_definition = {
		coa = ROM
		subject_canton = ROM
		priority = 1
	}
	flag_definition = {
		coa = ROM_fascist
		subject_canton = ROM_fascist
		priority = 10
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}	
	
	# WB originals
	
	flag_definition = {
		coa = ROM_republic
		subject_canton = ROM_republic
		priority = 5
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ROM_absolute_monarchy
		subject_canton = ROM_absolute_monarchy
		priority = 15
		
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ROM_dictatorship
		subject_canton = ROM_dictatorship
		priority = 10
		
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}

	flag_definition = {
		coa = ROM_communist
		subject_canton = ROM_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}

	flag_definition = {
		coa = ROM_anarchist
		subject_canton = ROM_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ROM_flag_hole_republic
		subject_canton = ROM_flag_hole_republic
		priority = 1600
		allow_revolutionary_indicator = no
		trigger = {
			exists = c:ROM
			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:ROM = {
				has_law = law_type:law_council_republic
			}
		}
	}
	
	flag_definition = {
		coa = ROM_flag_hole_monarchy
		subject_canton = ROM_flag_hole_monarchy
		allow_revolutionary_indicator = no
		priority = 1600
		trigger = {
			exists = c:ROM
			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:ROM = {
				has_law = law_type:law_council_republic
			}
		}
	}
	
	flag_definition = {
		coa = ROM_flag_hole_dictatorship
		subject_canton = ROM_flag_hole_dictatorship
		allow_revolutionary_indicator = no
		priority = 1601
		trigger = {
			exists = c:ROM
			exists = scope:actor
			
			coa_def_secessionist_or_revolutionary_trigger = yes
			
			scope:actor = {
				is_secessionist = no
				has_law = law_type:law_autocracy
				OR = {
					has_law = law_type:law_presidential_republic
					has_law = law_type:law_parliamentary_republic
				}
			}
			
			c:ROM = {
				has_law = law_type:law_council_republic
			}
		}
	}
	
	## Moldavia Romania
	
	flag_definition = {
		coa = ROM_MOL
		subject_canton = ROM_MOL
		priority = 90
		trigger = { 
			scope:actor ?= {
				has_variable = WB_is_Moldavia_var
			}
		}
	}
	flag_definition = {
		coa = ROM_MOL_fascist
		subject_canton = ROM_MOL_fascist
		priority = 100
		trigger = { 
			coa_def_fascist_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Moldavia_var
			}
		}
	}	
	
	flag_definition = {
		coa = ROM_MOL_republic
		subject_canton = ROM_MOL_republic
		priority = 150
		trigger = { 
			coa_def_republic_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Moldavia_var
			}
		}
	}
	
	flag_definition = {
		coa = ROM_MOL_absolute_monarchy
		subject_canton = ROM_MOL_absolute_monarchy
		priority = 160
		
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Moldavia_var
			}
		}
	}
	
	flag_definition = {
		coa = ROM_MOL_dictatorship
		subject_canton = ROM_MOL_dictatorship
		priority = 155
		
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Moldavia_var
			}
		}
	}

	flag_definition = {
		coa = ROM_MOL_communist
		subject_canton = ROM_MOL_communist
		priority = 1501
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Moldavia_var
			}
		}
	}

	flag_definition = {
		coa = MOL_anarchist
		subject_canton = MOL_anarchist
		priority = 2501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Moldavia_var
			}
		}
	}
	
	flag_definition = {
		coa = ROM_MOL_flag_hole_republic
		subject_canton = ROM_MOL_flag_hole_republic
		priority = 1601
		allow_revolutionary_indicator = no
		trigger = {
			exists = c:ROM
			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:ROM = {
				has_law = law_type:law_council_republic
				has_variable = WB_is_Moldavia_var
			}
		}
	}
	
	flag_definition = {
		coa = ROM_MOL_flag_hole_monarchy
		subject_canton = ROM_MOL_flag_hole_monarchy
		allow_revolutionary_indicator = no
		priority = 1601
		trigger = {
			exists = c:ROM
			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:ROM = {
				has_law = law_type:law_council_republic
				has_variable = WB_is_Moldavia_var
			}
		}
	}
	
	flag_definition = {
		coa = ROM_MOL_flag_hole_dictatorship
		subject_canton = ROM_MOL_flag_hole_dictatorship
		allow_revolutionary_indicator = no
		priority = 1602
		trigger = {
			exists = c:ROM
			exists = scope:actor
			
			coa_def_secessionist_or_revolutionary_trigger = yes
			
			scope:actor = {
				is_secessionist = no
				has_law = law_type:law_autocracy
				OR = {
					has_law = law_type:law_presidential_republic
					has_law = law_type:law_parliamentary_republic
				}
			}
			
			c:ROM = {
				has_law = law_type:law_council_republic
				has_variable = WB_is_Moldavia_var
			}
		}
	}
	
	flag_definition = {
		coa = MOL_republic_bessarabia
		subject_canton = MOL_republic_bessarabia
		priority = 151
		trigger = {
			coa_def_republic_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Moldavia_var
			}
			c:ROM ?= { capital = { state_region = s:STATE_BESSARABIA } }
		}
	}
	
	## Romania and Moldavia together
	
	flag_definition = {
		coa = ROM_together
		subject_canton = ROM_together
		priority = 170
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_ROM_duo_var
			}
		}
	}
	
	flag_definition = {
		coa = ROM_together_ROM
		subject_canton = ROM_together_ROM
		priority = 171
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_ROM_duo_var
			}
		}
	}
	
	flag_definition = {
		coa = ROM_together_MOL
		subject_canton = ROM_together_MOL
		priority = 172
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_ROM_duo_var
				has_variable = WB_is_Moldavia_var
			}
		}
	}
}

## Yugoslavia

YUG = {
	flag_definition = {
		coa = YUG
		subject_canton = YUG
		allow_overlord_canton = no		
		priority = 1
	}
	flag_definition = {
		coa = YUG_communist
		subject_canton = YUG_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	

	# WB originals
	
	flag_definition = {
		coa = YUG_republic
		subject_canton = YUG_republic
		priority = 10
		trigger = {
			coa_def_republic_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = YUG_absolute_monarchy
		subject_canton = YUG_absolute_monarchy	
		priority = 15
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = YUG_dictatorship
		subject_canton = YUG_dictatorship
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = YUG_theocracy
		subject_canton = YUG_theocracy
		priority = 30
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = YUG_anarchist
		subject_canton = YUG_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = YUG_fascist_serb
		subject_canton = YUG_fascist_serb
		priority = 1500
		trigger = {
			coa_def_fascist_flag_trigger = yes
			
			c:YUG ?= {
				ruler = {
					has_culture = cu:serb
				}
			}
		}
	}
	
	## Serbia Yugoslavia
	
	flag_definition = {
		coa = YUG_SER
		subject_canton = YUG_SER
		allow_overlord_canton = no		
		priority = 100
		trigger = { 
			scope:actor ?= {
				has_variable = WB_is_Serbia_var
			}
		}
	}
	flag_definition = {
		coa = YUG_SER_communist
		subject_canton = YUG_SER_communist
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Serbia_var
			}
		}
	}
	
	flag_definition = {
		coa = YUG_SER_republic
		subject_canton = YUG_SER_republic
		priority = 110
		trigger = {
			coa_def_republic_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Serbia_var
			}
		}
	}
	
	flag_definition = {
		coa = YUG_SER_absolute_monarchy
		subject_canton = YUG_SER_absolute_monarchy	
		priority = 115
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Serbia_var
			}
		}
	}
	
	flag_definition = {
		coa = YUG_SER_dictatorship
		subject_canton = YUG_SER_dictatorship
		priority = 120
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Serbia_var
			}
		}
	}
	
	flag_definition = {
		coa = YUG_SER_theocracy
		subject_canton = YUG_SER_theocracy
		priority = 130
		trigger = {
			coa_def_theocracy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Serbia_var
			}
		}
	}
	
	flag_definition = {
		coa = YUG_SER_anarchist
		subject_canton = YUG_SER_anarchist
		priority = 1601
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Serbia_var
			}
		}
	}
	
	flag_definition = {
		coa = YUG_SER_fascist_serb
		subject_canton = YUG_SER_fascist_serb
		priority = 1600
		trigger = {
			coa_def_fascist_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Serbia_var
			}
			
			c:YUG ?= {
				ruler = {
					has_culture = cu:serb
				}
			}
		}
	}
	
	
	## Montenegro Yugoslavia
	
	flag_definition = {
		coa = YUG_MON
		subject_canton = YUG_MON
		allow_overlord_canton = no		
		priority = 100
		trigger = { 
			scope:actor ?= {
				has_variable = WB_is_Montenegro_var
			}
		}
	}
	flag_definition = {
		coa = YUG_MON_communist
		subject_canton = YUG_MON_communist
		priority = 1600
		trigger = { 
			coa_def_communist_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Montenegro_var
			}
		}
	}
	
	flag_definition = {
		coa = YUG_MON_republic
		subject_canton = YUG_MON_republic
		priority = 110
		trigger = {
			coa_def_republic_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Montenegro_var
			}
		}
	}
	
	flag_definition = {
		coa = YUG_MON_absolute_monarchy
		subject_canton = YUG_MON_absolute_monarchy	
		priority = 115
		trigger = {
			coa_def_absolute_monarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Montenegro_var
			}
		}
	}
	
	flag_definition = {
		coa = YUG_MON_dictatorship
		subject_canton = YUG_MON_dictatorship
		priority = 120
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Montenegro_var
			}
		}
	}
	
	flag_definition = {
		coa = YUG_MON_theocracy
		subject_canton = YUG_MON_theocracy
		priority = 130
		trigger = {
			coa_def_theocracy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Montenegro_var
			}
		}
	}
	
	flag_definition = {
		coa = YUG_MON_anarchist
		subject_canton = YUG_MON_anarchist
		priority = 1601
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			scope:actor ?= {
				has_variable = WB_is_Montenegro_var
			}
		}
	}
}