title_decisions = {
	
	restore_democracy = {
		filter = owned
		ai_target_filter = owned
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			FROM = {
				OR = {
				religion = liberalist
				religion = neo_classical
				religion = interventionist
				religion = imperialist
				}
				is_playable = yes
				is_feudal = yes
				government = democracy_government
			}
			ROOT = {
				holy_order = no
				NOT = { has_title_flag = restored_democracy  }
			}		
		}
		
		allow = {
			FROM = {
				OR = {
					independent = yes
					top_liege = { government = democracy_government }
				}
				is_ruler = yes
				prisoner = no
				is_incapable = no
				is_adult = yes
				war = no
			}
		}
		
		effect = {
			ROOT = {
				add_law = succ_democracy_censal
				set_title_flag = restored_democracy 
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.01
				religion = imperialist
			}
		}
	}
}
	
decisions = {
	
	submit_candidacy_presidency = {
		is_high_prio = yes
		ai_check_interval = 6
		
		potential = {
			is_theocracy = no
			NOT = {
				liege = {
					primary_title = {
						claimed_by = FROM
					}
				}
			}
			liege = {
				primary_title = {
					OR = {
						has_law = succ_democracy
						has_law = succ_democracy_capa
						has_law = succ_democracy_censal
					}
				}
			}
		}
		
		allow = {
			is_adult = yes
			is_incapable = no
			prisoner = no
			OR = {
				wealth = 15
				prestige = 300
			}
			NOT = { num_of_claims >= 1 }
		}
		
		effect = {
			ROOT = {
				if = {
					limit = {
						wealth = 15
						NOT = { prestige = 300 }
					}
					wealth = -15
				}
				if = {
					limit = {
						NOT = { wealth = 15 }
						prestige = 300
					}
					prestige = -300
				}
				if = {
					limit = {
						wealth = 15
						prestige = 300
					}
					wealth = -15
				}
			}
			liege = {
				primary_title = {
					add_weak_claim = ROOT
				}
			}
			hidden_effect = {
				liege = { character_event = { id = ORDERDEM.2 }}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
			}
			modifier = {
				factor = 1
				OR = {
					trait = proud
					trait = ambitious
					trait = greedy
					trait = envious
				}
			}
			modifier = {
				factor = 0.8
				OR = {
					trait = administrator
					trait = gamer
					trait = seducer
					trait = seductress
					trait = socializer
					trait = strategist
				}
			}
			modifier = {
				factor = 0.7
				OR = {
					trait = diligent
					trait = patient
					trait = socializer
					trait = strategist
					trait = gregarious
					trait = trusting
					trait = zealous
				}
			}
			modifier = {
				factor = 0.5
				opinion = {
					who = liege
					NOT = { value >= 0 }
				}
			}
		}
	}
	
	establish_democracy = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion_group = capitalist
				religion = anarchist
				religion = anarcho-syndicalism
				religion = anarcho-mutualism
				religion = anarcho-feminism
				religion = ecoanarchism
				religion = ecosocialism
			}
			is_playable = yes
			is_feudal = yes
			holy_order = no
			NOT = { government = democracy_government }
			primary_title = {
				NOR = {
					has_law = succ_democracy_censal	
					has_law = succ_democracy_capa
					has_law = succ_feudal_elective
				}
			}
			NOT = { government = confucian_bureaucracy }
		}
		
		allow = {
			OR = {
				independent = yes
				top_liege = { government = democracy_government }
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 50
		}
		
		effect = {
			prestige = -50
			hidden_effect = { character_event = { id = ORDERDEM.1 }}
			set_government_type = democracy_government
			if = {
				limit = {
					religion_group = capitalist
				}
				primary_title = {
					add_law = succ_democracy_censal
				}
				any_vassal = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
					any_vassal = {
						limit = {
							government = feudal_government
							religion_group = capitalist
						}
						set_government_type = democracy_government
						primary_title = {
							add_law = succ_democracy_censal
						}
					}
				}
			}
			if = {
				limit = {
					OR = {
						religion = anarchist
						religion = anarcho-syndicalism
						religion = anarcho-mutualism
						religion = anarcho-feminism
						religion = ecoanarchism
						religion = ecosocialism
					}
				}
				primary_title = {
					add_law = succ_democracy
				}
				any_vassal = {
					limit = {
						government = feudal_government
						OR = {
							religion_group = capitalist
							religion = anarchist
							religion = anarcho-syndicalism
							religion = anarcho-mutualism
							religion = anarcho-feminism
							religion = ecoanarchism
							religion = ecosocialism
						}
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
					any_vassal = {
						limit = {
							government = feudal_government
							OR = {
								religion_group = capitalist
								religion = anarchist
								religion = anarcho-syndicalism
								religion = anarcho-mutualism
								religion = anarcho-feminism
								religion = ecoanarchism
								religion = ecosocialism
							}
						}
						set_government_type = democracy_government
						primary_title = {
							add_law = succ_democracy
						}
					}
				}
			}
			if = {
				limit = {
					OR = {
						religion = anarchist
						religion = anarcho-syndicalism
						religion = ecoanarchism
					}
				}
				primary_title = {
					add_law = cognatic_succession
				}
			}
			if = {
				limit = {
					OR = {
						religion = anarcho-feminism
						religion = ecosocialism
					}
				}
				primary_title = {
					add_law = true_cognatic_succession
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.001
				religion = imperialist
			}
		}
	}
	
	create_french_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_france
				has_landed_title = k_communist_france
				AND = {
					culture = frankish
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_french_republic }
			k_french_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_french_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_france
								de_jure_liege = k_communist_france
							}
												
							NOT = { de_jure_liege_or_above = k_french_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_french_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_the_netherlands = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = d_holland
				has_landed_title = d_gelre
				AND = {
					culture = dutch
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_frisia }
			NOT = { has_landed_title = k_communist_netherlands }
			NOT = { has_landed_title = k_netherlands }
			k_netherlands = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_netherlands = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_frisia
								de_jure_liege = k_communist_netherlands
							}
												
							NOT = { de_jure_liege_or_above = k_netherlands }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_netherlands
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_the_netherlands_frisian = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_frisia
				has_landed_title = k_communist_netherlands
			}
			NOT = { has_landed_title = k_netherlands }
			k_netherlands = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_netherlands = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_frisia
								de_jure_liege = k_communist_netherlands
							}
												
							NOT = { de_jure_liege_or_above = k_netherlands }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_netherlands
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_belgium = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = d_flanders
				has_landed_title = d_brabant
				has_landed_title = k_communist_belgium
				AND = {
					OR = {
						culture = walloon
						culture = flamish
					}
					tier = DUKE 
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_belgium }
			k_belgium = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_belgium = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_communist_belgium
							}
												
							NOT = { de_jure_liege_or_above = k_belgium }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_belgium
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_lotharingian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_lotharingia
				has_landed_title = k_communist_lotharingia
			}
			NOT = { has_landed_title = k_lotharingian_republic }
			k_lotharingian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_lotharingian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_lotharingia
								de_jure_liege = k_communist_lotharingia
							}
												
							NOT = { de_jure_liege_or_above = k_lotharingian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_lotharingian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_austrian_republic_bavaria = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_bavaria
				has_landed_title = k_communist_austria
			}
			NOT = { has_landed_title = k_austrian_republic }
			k_austrian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_austrian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_bavaria
								de_jure_liege = k_communist_austria
							}
												
							NOT = { de_jure_liege_or_above = k_austrian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_austrian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_austrian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = d_osterreich
				has_landed_title = d_tyrol
			}
			NOT = { has_landed_title = k_bavaria }
			NOT = { has_landed_title = k_communist_austria }
			NOT = { has_landed_title = k_austrian_republic }
			k_austrian_republic = {
				has_holder = no
			}
			
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
			has_landed_title = d_osterreich
			has_landed_title = d_tyrol
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_austrian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_bavaria
								de_jure_liege = k_communist_austria
							}
												
							NOT = { de_jure_liege_or_above = k_austrian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_austrian_republic
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_federal_germany = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_germany
				has_landed_title = k_democratic_germany
				AND = {
					culture = german
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_federal_germany }
			k_federal_germany = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_federal_germany = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_germany
								de_jure_liege = k_democratic_germany
							}
												
							NOT = { de_jure_liege_or_above = k_federal_germany }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_federal_germany
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_italian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_naples
				has_landed_title = k_italy
				has_landed_title = k_communist_italy
				has_landed_title = k_romagna
				AND = {
					culture = italian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_italian_republic }
			NOT = { culture = lombard }
			k_italian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_italian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_italy
								de_jure_liege = k_naples
								de_jure_liege = k_communist_italy
								de_jure_liege = k_trinacria
								de_jure_liege = k_sicily
								de_jure_liege = k_romagna
								de_jure_liege = k_papacy
							}
												
							NOT = { de_jure_liege_or_above = k_italian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_italian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_lombard_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			culture = lombard
			NOT = { has_landed_title = k_lombard_republic }
			k_lombard_republic = {
				has_holder = no
			}
		}
		
		allow = {
			culture = lombard
			completely_controls = d_lombardia
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 200
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_lombard_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_sicily_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_sicily
				has_landed_title = k_trinacria
			}
			NOT = { has_landed_title = k_sicily_republic }
			k_sicily_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_sicily_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_sicily
								de_jure_liege = k_trinacria
							}
												
							NOT = { de_jure_liege_or_above = k_sicily_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_sicily_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_spanish_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_leon
				has_landed_title = k_castille
				has_landed_title = k_socialist_spain
				AND = {
					culture = castillan
					tier = DUKE 
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_spanish_republic }
			k_spanish_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_spanish_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_castille
								de_jure_liege = k_leon
								de_jure_liege = k_valencia 
								de_jure_liege = k_andalusia 
								de_jure_liege = k_socialist_spain
							}
												
							NOT = { de_jure_liege_or_above = k_spanish_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_spanish_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_catalonia = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion = liberalist
				religion = neo_classical
				religion = interventionist
				religion = imperialist
				religion_group = communism
			}
			NOR = {
				religion = anarchist
				religion = anarcho-syndicalism
				religion = anarcho-mutualism
				religion = anarcho-feminism
				religion = ecoanarchism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			culture = catalan
			OR = {
				has_landed_title = k_aragon
				has_landed_title = k_def_council_aragon
			}
			NOT = { has_landed_title = k_catalonia }
			k_catalonia = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_catalonia = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_aragon
								de_jure_liege = k_def_council_aragon
							}	
												
							NOT = { de_jure_liege_or_above = k_catalonia }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_catalonia
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_czech_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_bohemia
				has_landed_title = k_moravia
				has_landed_title = k_czechoslovakia
				AND = {
					culture = czech
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_czech_republic }
			k_czech_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_czech_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_bohemia
								de_jure_liege = k_moravia
								de_jure_liege = k_czechoslovakia
							}
							
												
							NOT = { de_jure_liege_or_above = k_czech_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_czech_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
			modifier = {
				factor = 0.2
				culture = slovak
			}
			modifier = {
				factor = 0.2
				culture = slovieni
			}
		}
	}
	
	create_cyprus_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			NOT = { culture = turkish }
			has_landed_title = d_cyprus
			NOT = { has_landed_title = k_cyprus }
			NOT = { has_landed_title = k_cyprus_republic }
			k_cyprus_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_cyprus_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_cyprus
							de_jure_liege = k_turkish_cyprus
												
							NOT = { de_jure_liege_or_above = k_cyprus_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_cyprus_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_cyprus_republic_king = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			NOT = { culture = turkish }
			OR = {
				has_landed_title = k_cyprus
				has_landed_title = k_turkish_cyprus
				has_landed_title = k_communist_cyprus
				has_landed_title = k_communist_turkish_cyprus
			}
			NOT = { has_landed_title = k_cyprus_republic }
			k_cyprus_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_cyprus_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_cyprus
								de_jure_liege = k_turkish_cyprus
								de_jure_liege = k_communist_cyprus
								de_jure_liege = k_communist_turkish_cyprus
							}
												
							NOT = { de_jure_liege_or_above = k_cyprus_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_cyprus_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_turkish_cyprus = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			culture = turkish
			OR = {
				AND = {
					tier = DUKE
					NOT = { tier = KING }
					has_landed_title = d_cyprus
				}
				has_landed_title = k_cyprus
				has_landed_title = k_communist_cyprus
				has_landed_title = k_cyprus_republic
				has_landed_title = k_communist_turkish_cyprus
			}
			NOT = { has_landed_title = k_turkish_cyprus }
			k_turkish_cyprus = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_turkish_cyprus = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_cyprus
							de_jure_liege = k_cyprus_republic
							de_jure_liege = k_communist_cyprus
							de_jure_liege = k_communist_turkish_cyprus
												
							NOT = { de_jure_liege_or_above = k_turkish_cyprus }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_turkish_cyprus
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_greek_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_greece
				has_landed_title = k_byzantium
				has_landed_title = k_epirus
				AND = {
					culture = greek
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_greek_republic }
			k_greek_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_greek_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_communist_greece
								de_jure_liege = k_byzantium
								de_jure_liege = k_epirus
							}
												
							NOT = { de_jure_liege_or_above = k_greek_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_greek_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_slovenia_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_carinthia
				AND = {
					has_landed_title = k_yugoslavia
					culture = carantanian
				}
				AND = {
					culture = carantanian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_slovenia_republic }
			k_slovenia_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_slovenia_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_yugoslavia
								de_jure_liege = k_carinthia
							}
												
							NOT = { de_jure_liege_or_above = k_slovenia_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_slovenia_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_hungarian_republic = {	
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_hungary
				has_landed_title = k_communist_hungary
				AND = {
					culture = hungarian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_hungarian_republic }
			k_hungarian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_hungarian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_hungary
								de_jure_liege = k_communist_hungary
							}
												
							NOT = { de_jure_liege_or_above = k_hungarian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_hungarian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_croatian_republic_king = {	
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_croatia
				AND = {
					has_landed_title = k_yugoslavia
					culture = croatian
				}
			}
			NOT = { has_landed_title = k_croatian_republic }
			k_croatian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_croatian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_croatia
								de_jure_liege = k_yugoslavia
							}
												
							NOT = { de_jure_liege_or_above = k_croatian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_croatian_republic 
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_croatian_republic = {	
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = d_croatia
				AND = {
					culture = croatian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_croatia }
			NOT = { has_landed_title = k_croatian_republic }
			k_croatian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_croatian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_croatia
								de_jure_liege = k_yugoslavia
							}
												
							NOT = { de_jure_liege_or_above = k_croatian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_croatian_republic 
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_bosnian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = d_bosnia
				AND = { 
					culture = bosnian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_bosnia }
			NOT = { has_landed_title = k_bosnian_republic }
			k_bosnian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			independent = yes
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_bosnian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_bosnia
								de_jure_liege = k_yugoslavia
							}
												
							NOT = { de_jure_liege_or_above = k_bosnian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_bosnian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_bosnian_republic_king = {	
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_bosnia
				AND = {
					has_landed_title = k_yugoslavia
					culture = bosnian
				}
			}
			NOT = { has_landed_title = k_bosnian_republic }
			k_bosnian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_bosnian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_bosnia
								de_jure_liege = k_yugoslavia
							}
												
							NOT = { de_jure_liege_or_above = k_bosnian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_bosnian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_montenegrin_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				AND = {
					has_landed_title = k_yugoslavia
					culture = montenegrin
				}
				AND = { 
					culture = montenegrin
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_montenegrin_republic }
			k_montenegrin_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_montenegrin_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_yugoslavia
												
							NOT = { de_jure_liege_or_above = k_montenegrin_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_montenegrin_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_serbian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_serbia
				AND = {
					has_landed_title = k_yugoslavia
					culture = serbian
				}
				AND = {
					culture = serbian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_serbian_republic }
			k_serbian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_serbian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_serbia
								de_jure_liege = k_yugoslavia
							}
												
							NOT = { de_jure_liege_or_above = k_serbian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_serbian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_bulgarian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_bulgaria
				has_landed_title = k_communist_bulgaria
				AND = {
					culture = bulgarian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_bulgarian_republic }
			k_bulgarian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_bulgarian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				limit = {
					government = feudal_government
					religion_group = capitalist
				}
				set_government_type = democracy_government
				primary_title = {
					add_law = succ_democracy_censal
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_bulgaria
								de_jure_liege = k_communist_bulgaria
							}
												
							NOT = { de_jure_liege_or_above = k_bulgarian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_bulgarian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_polish_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_poland
				has_landed_title = k_communist_poland
				AND = {
					culture = polish
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_polish_republic }
			k_polish_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_polish_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				limit = {
					government = feudal_government
					religion_group = capitalist
				}
				set_government_type = democracy_government
				primary_title = {
					add_law = succ_democracy_censal
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_poland
								de_jure_liege = k_communist_poland
							}
												
							NOT = { de_jure_liege_or_above = k_polish_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_polish_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_lithuanian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_lithuania
				has_landed_title = k_communist_lithuania
				AND = {
					culture = lithuanian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_lithuanian_republic }
			k_lithuanian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_lithuanian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_lithuania
								de_jure_liege = k_communist_lithuania
							}
												
							NOT = { de_jure_liege_or_above = k_lithuanian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_lithuanian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_latvian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				AND = {
					has_landed_title = d_livonia
					has_landed_title = d_latgale
				}
				has_landed_title = k_communist_latvia
				AND = {
					culture = lettigallish
					tier = DUKE 
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_latvian_republic }
			k_latvian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_latvian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_lithuania
												
							NOT = { de_jure_liege_or_above = k_latvian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_latvian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_estonian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_estonia
				has_landed_title = k_communist_estonia
				AND = {
					culture = ugricbaltic
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_estonian_republic }
			k_estonian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_estonian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_estonia
								de_jure_liege = k_communist_estonia
							}
												
							NOT = { de_jure_liege_or_above = k_estonian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_estonian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_romanian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_romania
				AND = { 
					has_landed_title = k_dacia
					culture = romanian
				}
				AND = {
					culture = romanian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_moldovan_republic }
			NOT = { has_landed_title = k_romanian_republic }
			k_romanian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_romanian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_dacia
								de_jure_liege = k_communist_romania
							}
												
							NOT = { de_jure_liege_or_above = k_romanian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_romanian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_moldovan_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_moldova
				AND = {
					has_landed_title = d_moldau
					NOT = { culture = romanian }
				}
				AND = { 
					has_landed_title = k_dacia
					culture = moldovan
				}
				AND = {
					culture = moldovan
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_romanian_republic }
			NOT = { has_landed_title = k_moldovan_republic }
			k_moldovan_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_moldovan_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_communist_moldova
								de_jure_liege = k_dacia
							}
												
							NOT = { de_jure_liege_or_above = k_moldovan_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_moldovan_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_ukrainian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_ukraine
				has_landed_title = k_ruthenia
				has_landed_title = k_galicia-volhynia
				AND = {
					culture = ukrainian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_ukrainian_republic }
			k_ukrainian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_ukrainian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_communist_ukraine
								de_jure_liege = k_ruthenia
								de_jure_liege = k_galicia-volhynia
							}
												
							NOT = { de_jure_liege_or_above = k_ukrainian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_ukrainian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_belarusian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_belarus
				has_landed_title = d_minsk
			}
			NOT = { has_landed_title = k_belarusian_republic }
			k_belarusian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_belarusian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_belarus
												
							NOT = { de_jure_liege_or_above = k_belarusian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_belarusian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_albanian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_albania
				AND = {
					culture = arberian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_albanian_republic }
			k_albanian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_albanian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_albania
												
							NOT = { de_jure_liege_or_above = k_albanian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_albanian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_macedonian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			has_landed_title = d_strymon
			culture_group = byzantine 
			NOT = { has_landed_title = k_macedonian_republic }
			k_macedonian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_macedonian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_english_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_england
				has_landed_title = k_england
				AND = {
					culture = english
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_english_republic }
			k_english_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_english_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_england
								de_jure_liege = k_communist_england
							}
												
							NOT = { de_jure_liege_or_above = k_english_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_english_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_scottish_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_scotland
				has_landed_title = k_scotland
				AND = {
					culture = scottish
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_scottish_republic }
			k_scottish_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_scottish_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_scotland
								de_jure_liege = k_communist_scotland
							}
												
							NOT = { de_jure_liege_or_above = k_scottish_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_scottish_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_irish_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_ireland
				has_landed_title = k_ireland
				AND = {
					culture = irish
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_irish_republic }
			k_irish_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_irish_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_ireland
								de_jure_liege = k_communist_ireland
							}
												
							NOT = { de_jure_liege_or_above = k_irish_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_irish_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_norwegian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_norway
				has_landed_title = k_norway
				AND = {
					culture = norwegian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_norwegian_republic }
			k_norwegian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_norwegian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_norway
								de_jure_liege = k_communist_norway
							}
												
							NOT = { de_jure_liege_or_above = k_norwegian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_norwegian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
			modifier = { # Will create Iceland instead
				factor = 0
				has_landed_title = d_iceland
			}
			modifier = { # Will create Faroe instead
				factor = 0
				has_landed_title = d_orkney
			}
		}
	}
	
	create_swedish_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_sweden
				has_landed_title = k_communist_sweden
				AND = {
					culture = swedish
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_swedish_republic }
			k_swedish_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_swedish_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_sweden
								de_jure_liege = k_communist_sweden
							}
												
							NOT = { de_jure_liege_or_above = k_swedish_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_swedish_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_danish_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_denmark
				has_landed_title = k_communist_denmark
				AND = {
					culture = danish
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_danish_republic }
			k_danish_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_danish_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_denmark
								de_jure_liege = k_communist_denmark
							}
												
							NOT = { de_jure_liege_or_above = k_danish_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_danish_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_faroe_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = d_orkney
				has_landed_title = k_communist_faroe
			}
			NOT = { has_landed_title = k_faroe_republic }
			k_faroe_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_faroe_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			if = {
				limit = { completely_controls = d_orkney }
				d_orkney = {
					show_scope_change = no
					de_jure_liege = k_faroe_republic
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_faroe
												
							NOT = { de_jure_liege_or_above = k_faroe_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_faroe_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_iceland_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion_group = capitalist
				religion_group = totalitarist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_iceland
				has_landed_title = d_iceland
			}
			NOT = { has_landed_title = k_iceland_republic }
			k_iceland_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_iceland_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			if = {
				limit = { completely_controls = d_iceland }
				d_iceland = {
					show_scope_change = no
					de_jure_liege = k_iceland_republic
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_iceland
												
							NOT = { de_jure_liege_or_above = k_iceland_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_iceland_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_finnish_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_finland
				has_landed_title = k_communist_finland
				AND = {
					culture = finnish
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_finnish_republic }
			k_finnish_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_finnish_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_finland
								de_jure_liege = k_communist_finland
							}
												
							NOT = { de_jure_liege_or_above = k_finnish_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_finnish_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_russian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_rus
				has_landed_title = k_chernigov
				has_landed_title = k_vladimir
				has_landed_title = k_communist_russia
				AND = {
					culture = russian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_russian_republic }
			k_russian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_russian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_rus
								de_jure_liege = k_communist_russia
								de_jure_liege = k_chernigov
								de_jure_liege = k_vladimir
							}
												
							NOT = { de_jure_liege_or_above = k_russian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_russian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_georgian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			OR = {
				has_landed_title = d_kartli
				has_landed_title = k_finnish_republic
				AND = {
					culture = georgian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			k_georgia = {
				has_holder = no
			}
			NOR = {
				has_alternate_start_setting = {
					setting = dejure
					value = random
				}
				has_alternate_start_setting = {
					setting = title_names
					value = random
				}
				has_alternate_start_setting = {
					setting = title_names
					value = random_including_duchies
				}
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			k_georgia = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_georgia
												
							NOT = { de_jure_liege_or_above = k_georgia }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_georgia
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	
	create_armenian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_armenia
				has_landed_title = k_communist_armenia
				AND = {
					culture = armenian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_armenian_republic }
			k_armenian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_armenian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_armenia
								de_jure_liege = k_communist_armenia
							}
												
							NOT = { de_jure_liege_or_above = k_armenian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_armenian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_azerbaijani_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = d_azerbaijan
				has_landed_title = k_communist_azerbaijan
			}
			NOT = { has_landed_title = k_azerbaijani_republic }
			k_azerbaijani_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_azerbaijani_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_azerbaijan
												
							NOT = { de_jure_liege_or_above = k_azerbaijani_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_azerbaijani_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_turkish_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_turkey
				has_landed_title = k_ottoman
				has_landed_title = k_eretnid
				has_landed_title = k_karaman
				has_landed_title = k_germiyan
				has_landed_title = k_candar
				has_landed_title = k_mentese
				has_landed_title = k_aydin
				has_landed_title = k_tekke
				has_landed_title = k_rum
				AND = {
					culture = turkish
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_turkish_republic }
			k_turkish_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_turkish_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_communist_turkey
								de_jure_liege = k_ottoman
								de_jure_liege = k_eretnid
								de_jure_liege = k_karaman
								de_jure_liege = k_germiyan
								de_jure_liege = k_candar
								de_jure_liege = k_mentese
								de_jure_liege = k_aydin
								de_jure_liege = k_tekke
								de_jure_liege = k_rum
							}
												
							NOT = { de_jure_liege_or_above = k_turkish_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_turkish_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_slovak_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = d_slovakia
				AND = { 
					has_landed_title = k_czechoslovakia
					culture = slovak
				}
				AND = { 
					has_landed_title = k_czechoslovakia
					culture = slovieni
				}
				AND = {
					culture = slovieni
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_slovak_republic }
			k_slovak_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_slovak_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_czechoslovakia
												
							NOT = { de_jure_liege_or_above = k_slovak_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_slovak_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_syrian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			has_landed_title = k_syria
			NOT = { has_landed_title = k_syrian_republic }
			k_syrian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_syrian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_syria
												
							NOT = { de_jure_liege_or_above = k_syrian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_syrian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_lebanon = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			has_landed_title = d_galilee
			NOT = { has_landed_title = k_lebanon }
			k_lebanon = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_lebanon = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_iraqi_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			has_landed_title = k_iraq
			NOT = { has_landed_title = k_iraqi_republic }
			k_iraqi_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_iraqi_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_iraq
												
							NOT = { de_jure_liege_or_above = k_iraqi_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_iraqi_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_kurdistan = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				AND = {
					has_landed_title = k_mesopotamia
					culture = kurdish
				}
				AND = {
					culture = kurdish
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_kurdistan }
			k_kurdistan = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_kurdistan = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_mesopotamia
												
							NOT = { de_jure_liege_or_above = k_kurdistan }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_kurdistan
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_iranian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_persia
				has_landed_title = k_communist_iran
				AND = {
					OR = {
						culture = iranian
						culture = persian
					}
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_iranian_republic }
			k_iranian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_iranian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_persia
								de_jure_liege = k_communist_iran
							}
												
							NOT = { de_jure_liege_or_above = k_iranian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_iranian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_welsh_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_wales
				has_landed_title = k_wales
				AND = {
					culture = welsh
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_welsh_republic }
			k_welsh_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_welsh_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_wales
								de_jure_liege = k_communist_wales
							}
												
							NOT = { de_jure_liege_or_above = k_welsh_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_welsh_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_egyptian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_egypt
				AND = {
					culture = egyptian_arabic
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_egyptian_republic }
			k_egyptian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_egyptian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_egypt
												
							NOT = { de_jure_liege_or_above = k_egyptian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_egyptian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_jordanian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_jerusalem
				AND = {
					culture = levantine_arabic
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_jordanian_republic }
			k_jordanian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_jordanian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_jerusalem
												
							NOT = { de_jure_liege_or_above = k_jordanian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_jordanian_republic
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_palestine = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			culture_group = arabic
			AND = {
				tier = DUKE
				NOT = { tier = KING }
			}
			OR = {
				has_landed_title = d_jerusalem
				has_landed_title = d_oultrejourdain
				has_landed_title = d_galilee
			}
			NOT = { has_landed_title = k_jordanian_republic }
			NOT = { has_landed_title = k_palestine }
			k_palestine = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_palestine = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.8
			}
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_sudanese_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_nubia
				AND = {
					culture = nubian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_sudanese_republic }
			k_sudanese_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_sudanese_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_nubia
												
							NOT = { de_jure_liege_or_above = k_sudanese_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_sudanese_republic
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_ethiopian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			NOT = { culture = somali }
			OR = {
				has_landed_title = k_abyssinia
				AND = {
					culture = ethiopian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_ethiopian_republic }
			k_ethiopian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_ethiopian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_abyssinia
												
							NOT = { de_jure_liege_or_above = k_ethiopian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_ethiopian_republic
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_somali_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				AND = {
					has_landed_title = k_abyssinia
					culture = somali
				}
				AND = {
					culture = somali
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_somali_republic }
			k_somali_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_somali_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_abyssinia
												
							NOT = { de_jure_liege_or_above = k_somali_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_somali_republic
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_libyan_republic = { 
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				AND = {
					has_landed_title = k_africa
					OR = {
						culture = italian
						culture = libyan
					}
				}
				AND = {
					culture = italian
					tier = DUKE
					NOT = { tier = KING }
					region = world_africa_north
				}
				AND = {
					culture = libyan
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_libyan_republic }
			k_libyan_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_libyan_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_africa
												
							NOT = { de_jure_liege_or_above = k_libyan_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_libyan_republic
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_tunisian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_tunisia
				AND = {
					has_landed_title = k_africa
					OR = {
						culture = frankish
						culture = tunisian
					}
				}
				AND = {
					culture = frankish
					tier = DUKE
					NOT = { tier = KING }
					region = world_africa_north
				}
				AND = {
					culture = tunisian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_tunisian_republic }
			k_tunisian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_tunisian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_communist_tunisia
								de_jure_liege = k_africa
							}
												
							NOT = { de_jure_liege_or_above = k_tunisian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_tunisian_republic
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_afghan_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_afghanistan
				has_landed_title = k_communist_afghanistan
				AND = {
					culture = afghan
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_afghan_republic }
			k_afghan_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_afghan_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_afghanistan
							de_jure_liege = k_communist_afghanistan
												
							NOT = { de_jure_liege_or_above = k_afghan_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_afghan_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_chad = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_kanem
				AND = {
					culture = zaghawa # Temporary
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_chad }
			k_chad = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_chad = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_kanem
												
							NOT = { de_jure_liege_or_above = k_chad }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_chad
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_niger = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_hausaland
				AND = {
					culture = hausa # Temporary
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_niger }
			k_niger = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_niger = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_hausaland
												
							NOT = { de_jure_liege_or_above = k_niger }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_niger
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_malian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_mali
				has_landed_title = k_songhay
				AND = {
					culture = manden # Temporary
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_malian_republic }
			k_malian_republic = {
				has_holder = no
			}
			holy_order = no
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_malian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_mali
								de_jure_liege = k_songhay
							}
												
							NOT = { de_jure_liege_or_above = k_malian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_malian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_mauritania_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_ghana
				AND = {
					culture = soninke # Temporary
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_mauritania_republic }
			k_mauritania_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_mauritania_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_ghana
												
							NOT = { de_jure_liege_or_above = k_mauritania_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_mauritania_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_morocco = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_mauretania
				has_landed_title = k_communist_morocco
			}
			NOT = { has_landed_title = k_morocco }
			k_morocco = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_morocco = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {	
								de_jure_liege = k_mauretania
								de_jure_liege = k_communist_morocco
							}
												
							NOT = { de_jure_liege_or_above = k_morocco }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_morocco
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_oman = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			has_landed_title = d_oman
			NOT = { has_landed_title = k_oman }
			k_oman = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_oman = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			if = {
				limit = { completely_controls = d_oman }
				d_oman = {
					show_scope_change = no
					de_jure_liege = k_oman
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_pakistan = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_pakistan
				has_landed_title = k_baluchistan
				has_landed_title = k_sindh
				has_landed_title = k_punjab
				AND = {
					culture = balouch
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_pakistan }
			k_pakistan = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_pakistan = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_communist_pakistan
								de_jure_liege = k_baluchistan
								de_jure_liege = k_sindh
								de_jure_liege = k_punjab
								de_jure_liege = k_kahsmir
							}
												
							NOT = { de_jure_liege_or_above = k_pakistan }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_pakistan
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_indian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_india
				has_landed_title = k_sindh
				has_landed_title = k_punjab
				has_landed_title = k_delhi
				has_landed_title = k_rajputana
				has_landed_title = k_gujarat
				has_landed_title = k_malwa
				has_landed_title = k_kosala
				has_landed_title = k_gondwana
				has_landed_title = k_maharastra
				has_landed_title = k_orissa
				has_landed_title = k_bihar
				has_landed_title = k_kamarupa
				has_landed_title = k_telingana
				has_landed_title = k_karnata
				has_landed_title = k_andhra
				has_landed_title = k_tamilakam
				AND = {
					culture = indian
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_indian_republic }
			k_indian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_indian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_communist_india
								de_jure_liege = k_sindh
								de_jure_liege = k_punjab
								de_jure_liege = k_delhi
								de_jure_liege = k_rajputana
								de_jure_liege = k_gujarat
								de_jure_liege = k_malwa
								de_jure_liege = k_kosala
								de_jure_liege = k_gondwana
								de_jure_liege = k_maharastra
								de_jure_liege = k_orissa
								de_jure_liege = k_bihar
								de_jure_liege = k_kamarupa
								de_jure_liege = k_telingana
								de_jure_liege = k_karnata
								de_jure_liege = k_andhra
								de_jure_liege = k_tamilakam
								de_jure_liege = k_kashmir
							}
											
							NOT = { de_jure_liege_or_above = k_indian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_indian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_nepali_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_nepal
				has_landed_title = k_communist_nepal
				AND = {
					culture = nepali
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			
			NOT = { has_landed_title = k_nepali_republic }
			k_nepali_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_nepali_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_nepal
								de_jure_liege = k_communist_nepal
							}
												
							NOT = { de_jure_liege_or_above = k_nepali_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_nepali_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_bhutan_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = d_bhutan
				has_landed_title = k_communist_bhutan
			}
			NOT = { has_landed_title = k_bhutan_republic }
			k_bhutan_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_bhutan_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			if = {
				limit = { completely_controls = d_bhutan }
				d_bhutan = {
					show_scope_change = no
					de_jure_liege = k_bhutan_republic
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_bhutan
												
							NOT = { de_jure_liege_or_above = k_bhutan_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_bhutan_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_turkmenistan = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_turkmenistan
				AND = {
					has_landed_title = k_khorasan
					OR = { # to "simplify" at the beginning, I took the Oghuz Turkish for this one
						culture = turkish
						culture = pecheneg
					}
				}
			}
			NOT = { has_landed_title = k_turkmenistan }
			k_turkmenistan = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_turkmenistan = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_khorasan
								de_jure_liege = k_communist_turkmenistan
							}
												
							NOT = { de_jure_liege_or_above = k_turkmenistan }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_turkmenistan
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_uzbekistan = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_uzbekistan
				AND = {
					has_landed_title = k_khiva
					culture = mongol
				}
				AND = {
					culture = uzbek
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_uzbekistan }
			k_uzbekistan = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_uzbekistan = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_khiva
								de_jure_liege = k_communist_uzbekistan
							}
												
							NOT = { de_jure_liege_or_above = k_uzbekistan }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_uzbekistan
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_kyrgyzstan = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_kirghizistan
				AND = {
					has_landed_title = d_pamir
					culture_group = altaic
				}
				AND = {
					culture = kirghiz
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_kyrgyzstan }
			k_kyrgyzstan = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_kyrgyzstan = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			if = {
				limit = { completely_controls = d_pamir }
				d_pamir = {
					show_scope_change = no
					de_jure_liege = k_kyrgyzstan
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_kirghizistan
												
							NOT = { de_jure_liege_or_above = k_kyrgyzstan }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_kyrgyzstan
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_kazakhstan = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_cuman
				has_landed_title = k_turkestan
				has_landed_title = k_zhetysu
				has_landed_title = k_communist_kazakhstan
				AND = {
					culture = kazakh
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_kazakhstan }
			k_kazakhstan = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_kazakhstan = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_cuman
								de_jure_liege = k_turkestan
								de_jure_liege = k_zhetysu
								de_jure_liege = k_communist_kazakhstan
							}
												
							NOT = { de_jure_liege_or_above = k_kazakhstan }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_kazakhstan
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_mongolian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_mongolia
				has_landed_title = k_communist_mongolia
				AND = {
					culture = mongol
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_mongolian_republic }
			k_mongolian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_mongolian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_mongolia
								de_jure_liege = k_communist_mongolia
							}
												
							NOT = { de_jure_liege_or_above = k_mongolian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_mongolian_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_yemeni_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_yemen
				has_landed_title = k_communist_yemen
			}
			NOT = { has_landed_title = k_yemeni_republic }
			k_yemeni_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_yemeni_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_yemen
								de_jure_liege = k_communist_yemen
							}
												
							NOT = { de_jure_liege_or_above = k_yemeni_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_yemeni_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_algerian_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = { 
				has_landed_title = k_communist_algeria
				AND = {
					has_landed_title = d_alger
					OR = {
						has_landed_title = d_tlemcen
						has_landed_title = d_tahert
						has_landed_title = d_kabylia
						has_landed_title = d_mzab
					}
				}
			}
			NOT = { has_landed_title = k_algerian_republic }
			k_algerian_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_algerian_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_algeria
												
							NOT = { de_jure_liege_or_above = k_algerian_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_algerian_republic
					}
				}
			}
			if = {
				limit = { completely_controls = d_alger }
				d_alger = {
					show_scope_change = no
					de_jure_liege = k_algerian_republic
				}
			}
			if = {
				limit = { completely_controls = d_tlemcen }
				d_tlemcen = {
					show_scope_change = no
					de_jure_liege = k_algerian_republic
				}
			}
			if = {
				limit = { completely_controls = d_tahert }
				d_tahert = {
					show_scope_change = no
					de_jure_liege = k_algerian_republic
				}
			}
			if = {
				limit = { completely_controls = d_kabylia }
				d_kabylia = {
					show_scope_change = no
					de_jure_liege = k_algerian_republic
				}
			}
			if = {
				limit = { completely_controls = d_mzab }
				d_mzab = {
					show_scope_change = no
					de_jure_liege = k_algerian_republic
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_oman_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion_group = capitalist
				religion_group = totalitarist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = d_oman
				has_landed_title = k_communist_oman
			}
			NOT = { has_landed_title = k_oman_republic }
			k_oman_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_oman_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			if = {
				limit = {
					FROM = {
						OR = {
							religion_group = capitalist
							religion = ecosocialism
						}
					}
				}
				set_government_type = democracy_government
				any_vassal = {
					if = {
						limit = {
							government = feudal_government
							religion_group = capitalist
						}
						set_government_type = democracy_government
						primary_title = {
							add_law = succ_democracy_censal
						}
					}
					if = {
						limit = {
							government = feudal_government
							religion = ecosocialism
						}
						set_government_type = democracy_government
						primary_title = {
							add_law = succ_democracy
						}
					}
				}
			}
			if = {
				limit = { completely_controls = d_oman }
				d_oman = {
					show_scope_change = no
					de_jure_liege = k_oman_republic
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_oman
												
							NOT = { de_jure_liege_or_above = k_oman_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_oman_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_sapmi_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			culture = lappish
			OR = {
				has_landed_title = k_sapmi
				AND = {
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_sapmi_republic }
			k_sapmi_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }} 
			k_sapmi_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_sapmi
												
							NOT = { de_jure_liege_or_above = k_sapmi_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_sapmi_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_nenets_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_nenets
				has_landed_title = k_nenets
				AND = {
					culture = samoyed
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_nenets_republic }
			k_nenets_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_nenets_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_nenets
								de_jure_liege = k_communist_nenets
							}
												
							NOT = { de_jure_liege_or_above = k_nenets_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_nenets_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_mordvins_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion_group = capitalist
				religion_group = totalitarist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_mordvins
				AND = {
					culture = mordvin
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_mordvins_republic }
			k_mordvins_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = FROM
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }} 
			k_mordvins_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			if = {
				limit = {
					FROM = {
						OR = {
							religion_group = capitalist
							religion = ecosocialism
						}
					}
				}
				set_government_type = democracy_government
				any_vassal = {
					if = {
						limit = {
							government = feudal_government
							religion_group = capitalist
						}
						set_government_type = democracy_government
						primary_title = {
							add_law = succ_democracy_censal
						}
					}
					if = {
						limit = {
							government = feudal_government
							religion = ecosocialism
						}
						set_government_type = democracy_government
						primary_title = {
							add_law = succ_democracy
						}
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_mordvins
												
							NOT = { de_jure_liege_or_above = k_mordvins_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_mordvins_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_komi_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_komi
				has_landed_title = k_perm
				AND = {
					culture = komi
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_komi_republic }
			k_komi_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_komi_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_perm
								de_jure_liege = k_communist_komi
							}
												
							NOT = { de_jure_liege_or_above = k_komi_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_komi_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_khanty_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion_group = capitalist
				religion_group = totalitarist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_khanty
				AND = {
					culture = khanty
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_khanty_republic }
			k_khanty_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = FROM
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_khanty_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			if = {
				limit = {
					FROM = {
						OR = {
							religion_group = capitalist
							religion = ecosocialism
						}
					}
				}
				set_government_type = democracy_government
				any_vassal = {
					if = {
						limit = {
							government = feudal_government
							religion_group = capitalist
						}
						set_government_type = democracy_government
						primary_title = {
							add_law = succ_democracy_censal
						}
					}
					if = {
						limit = {
							government = feudal_government
							religion = ecosocialism
						}
						set_government_type = democracy_government
						primary_title = {
							add_law = succ_democracy
						}
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_khanty
												
							NOT = { de_jure_liege_or_above = k_khanty_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_khanty_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_cheremisa_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_communist_cheremisa
				AND = {
					culture_group = finno_ugric
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_cheremisa_republic }
			k_cheremisa_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			OR = {
				has_landed_title = k_communist_cheremisa
				has_landed_title = d_cheremisa
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }} 
			k_cheremisa_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							de_jure_liege = k_communist_cheremisa
												
							NOT = { de_jure_liege_or_above = k_cheremisa_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_cheremisa_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_israelite_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion_group = capitalist
				religion_group = communism
				religion_group = totalitarist
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			AND = {
				culture_group = israelite
				tier = DUKE
				NOT = { tier = KING }
			}
			NOT = { has_landed_title = k_israelite_republic }
			k_israelite_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = FROM
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }} 
			k_israelite_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			if = {
				limit = {
					FROM = {
						OR = {
							religion_group = capitalist
							religion = ecosocialism
						}
					}
				}
				set_government_type = democracy_government
				any_vassal = {
					if = {
						limit = {
							government = feudal_government
							religion_group = capitalist
						}
						set_government_type = democracy_government
						primary_title = {
							add_law = succ_democracy_censal
						}
					}
					if = {
						limit = {
							government = feudal_government
							religion = ecosocialism
						}
						set_government_type = democracy_government
						primary_title = {
							add_law = succ_democracy
						}
					}
				}
			}
			if = { 
				limit = {
					religion_group = communism
					NOT = { religion = ecosocialism }
				}
				set_government_type = soviet_government
				any_vassal = {
					limit = {
						government = feudal_government
						religion_group = communism
					}
					set_government_type = soviet_government
					primary_title = {
						add_law = succ_soviet
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
			modifier = {
				factor = 0
				OR = {
					religion = anarchist
					religion = anarcho-mutualism
				}
			}
		}
	}
	
	create_turkestan_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_khotan
				has_landed_title = k_communist_turkestan
				AND = {
					culture = uyghur
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_turkestan_republic }
			k_turkestan_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_turkestan_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_khotan
								de_jure_liege = k_communist_turkestan
							}
												
							NOT = { de_jure_liege_or_above = k_turkestan_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_turkestan_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
	
	create_tibetan_republic = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = { 
				religion_group = capitalist
				religion = ecosocialism
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_yarlung
				has_landed_title = k_kham
				has_landed_title = k_guge
				has_landed_title = k_communist_tibet
				AND = {
					culture = bodpa
					tier = DUKE
					NOT = { tier = KING }
				}
			}
			NOT = { has_landed_title = k_tibetan_republic }
			k_tibetan_republic = {
				has_holder = no
			}
		}
		
		allow = {
			OR = {
				independent = yes
				liege = {
					tier = EMPEROR
					religion_group = capitalist
					NOT = { religion = FROM }
				}
			}
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			prestige = 100
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERDEM.3 }}
			k_tibetan_republic = {
				grant_title = PREV
				if = {
					limit = {
						FROM = {
							religion_group = capitalist
						}
					}	
					add_law = succ_democracy_censal
				}
				if = {
					limit = {
						FROM = {
							religion = ecosocialism
						}
					}	
					add_law = succ_democracy
					add_law = true_cognatic_succession
				}
			}
			set_government_type = democracy_government
			any_vassal = {
				if = {
					limit = {
						government = feudal_government
						religion_group = capitalist
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy_censal
					}
				}
				if = {
					limit = {
						government = feudal_government
						religion = ecosocialism
					}
					set_government_type = democracy_government
					primary_title = {
						add_law = succ_democracy
					}
				}
			}
			any_title_under = {
				limit = {
					tier = COUNT
					location = {
						duchy = {
							OR = {
								de_jure_liege = k_yarlung
								de_jure_liege = k_kham
								de_jure_liege = k_guge
								de_jure_liege = k_communist_tibet
							}
												
							NOT = { de_jure_liege_or_above = k_tibetan_republic }
							ROOT = {
								completely_controls = PREV
							}
						}
					}
				}
				location = {
					duchy = {
						de_jure_liege = k_tibetan_republic
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				religion = imperialist
			}
		}
	}
}