country_decisions = {

	mmetr_dec_contest_the_imperial_mandate = {
		major = yes
		potential = {
			has_dlc = "Mandate of Heaven"
			culture_group = east_asian
			is_emperor_of_china = no
			any_country = {
				is_emperor_of_china = yes
			}
			NOT = {
				has_reform = celestial_empire
			}
			NOT = {
				has_reform = chinese_claimant_empire_reform
			}
			capital_scope = {
				superregion = china_superregion
			}
			NOT = { has_country_flag = established_claimant_empire_dec_flag }
		}
		allow = {
			culture_group = east_asian
			is_emperor_of_china = no
			any_country = {
				is_emperor_of_china = yes
			}
			NOT = {
				has_reform = celestial_empire
			}
			capital_scope = {
				superregion = china_superregion
			}
			is_subject = no
			is_at_war = no
			government = monarchy
			government_reform_progress = 50
			prestige = 50
			OR = {
				total_development = 300
				num_of_owned_provinces_with = {
					value = 40
					superregion = china_superregion
					is_core = ROOT
				}
			}
		}
		effect = {
			add_government_reform = chinese_claimant_empire_reform
			change_government_reform_progress = -50
			add_adm_power = 50
			add_prestige = 20
			if = {
				limit = {
					NOT = { government_rank = 3 }
				}
				set_government_rank = 3
			}
			set_country_flag = established_claimant_empire_dec_flag
		}
		ai_will_do = {
			factor = 1
		}
		ai_importance = 200
	}
	mmetr_dec_restore_the_mandate_of_heaven = {
		major = yes
		potential = {
			has_dlc = "Mandate of Heaven"
			OR = {
				culture_group = east_asian
				AND = {
					OR = {
						technology_group = chinese
						technology_group = early_chinese
						technology_group = eastern_nomad_group	#allows Five Hu or Mongols to form as they did historically
					}
					OR = {
						religion_group = eastern
						religion_group = buddhic
					}
				}
			}
			NOT = {
				any_country = {
					is_emperor_of_china = yes
				}
			}
			NOT = {
				has_reform = celestial_empire
			}
			capital_scope = {
				superregion = china_superregion
			}
			NOT = { has_country_flag = restored_mandate_of_heaven_mmetr_dec_flag }
		}
		allow = {
			is_emperor_of_china = no
			NOT = {
				any_country = {
					is_emperor_of_china = yes
				}
			}
			NOT = {
				has_reform = celestial_empire
			}
			capital_scope = {
				superregion = china_superregion
			}
			is_subject = no
			is_at_war = no
			government = monarchy
			OR = {
				has_reform = chinese_claimant_empire_reform
				num_of_owned_provinces_with = {
					value = 60
					superregion = china_superregion
					is_core = ROOT
				}
			}
		}
		effect = {
			if = {
				limit = { has_global_flag = empire_of_china_dismantled }
				clr_global_flag = empire_of_china_dismantled
			}
			dismantle_empire_of_china = no
			set_emperor_of_china = ROOT
			save_global_event_target_as = EmperorOfChina
			add_government_reform = celestial_empire
			add_prestige = 40
			add_mandate = 80
			if = {
				limit = {
					NOT = { government_rank = 3 }
				}
				set_government_rank = 3
			}
			china_superregion = {
				limit = {
					NOT = { owned_by = ROOT }
					NOT = { is_core = ROOT }
					is_empty = no
				}
				add_permanent_claim = ROOT
			}
			set_country_flag = restored_mandate_of_heaven_mmetr_dec_flag
		}
		ai_will_do = {
			factor = 0		#AI will not do - only player can do it
		}
		ai_importance = 0
	}
	
}
