namespace = tgp_korea_decision

# unify_goryeo_decision

tgp_korea_decision.9101 = { # Ruler
	type = character_event
	title = tgp_korea_decision.9101.t
	desc = {
		desc = tgp_korea_decision.9101.intro
		desc = tgp_korea_decision.9101.desc
	}
	theme = realm
	override_effect_2d = { reference = legend_glow }
	override_background = { reference = throne_room_scope }
	left_portrait = {
		character = scope:king_of_goryeo
		animation = holding_hu
	}

	immediate = {
		play_music_cue = "mx_cue_epic_sacral_moment"
		save_scope_as = background_throne_room_scope
		korea_unify_goryeo_reward_effect = yes
	}

	option = { # Samhan
		name = tgp_korea_decision.9101.a
		# Rename Goryeo culture
		hidden_effect = {
			culture:goryeo = {
				set_culture_name = {
					noun = samhan_hybrid_name
					collective_noun = samhan_hybrid_collective_noun
					prefix = samhan_hybrid_prefix
				}
			}
		}
		ai_chance = {
			base = 10
		}
	}

	option = { # Goryeo
		name = tgp_korea_decision.9101.b
		trigger = { culture = culture:goguryeo }
		custom_tooltip = {
			text = tgp_korea_decision.9101.b.reason
			title:e_goryeo = { set_title_name = "cn_goryeo" }
		}
		ai_chance = {
			base = 100
		}
	}

	after = {
		# Inform Vassals
		every_player = {
			limit = { is_vassal_or_below_of = root }
			trigger_event = tgp_korea_decision.9102
		}
	}
}

tgp_korea_decision.9102 = { # Vassal
	type = character_event
	title = tgp_korea_decision.9102.t
	desc = {
		desc = tgp_korea_decision.9101.intro
		desc = tgp_korea_decision.9102.desc
	}
	theme = realm
	override_effect_2d = { reference = legend_glow }
	override_background = { reference = throne_room_scope }
	left_portrait = {
		character = scope:king_of_goryeo
		animation = war_over_tie
	}

	immediate = {
		show_as_tooltip = {
			scope:king_of_goryeo = { korea_unify_goryeo_reward_effect = yes }
		}
	}

	option = {
		name = tgp_korea_decision.9101.a
	}
}

# NEW CEREMONIAL REGENCY EVENT

#tgp_korea_decision.9201 = {
#	orphan = yes # DEPRECATED
#	type = character_event
#	title = tgp_korea_decision.9201.t
#	desc = tgp_korea_decision.9201.desc
#	theme = crown
#	left_portrait = {
#		character = root
#		animation = holding_hu
#	}
#	override_background = { reference = throne_room_scope }
#
#	trigger = {
#		OR = {
#			exists = primary_title.previous_holder
#			NOT = { primary_title = title:e_viet }
#		}
#	}
#
#	immediate = {
#		show_as_tooltip = {
#			scope:founder = { get_title = scope:new_title }
#			scope:regent_title.holder = { add_realm_law_skip_effects = single_heir_succession_law } # Regency inherited separately
#			scope:new_title = { add_title_law = single_heir_succession_law }
#		}
#		every_player = {
#			limit = {
#				top_liege = root
#				NOT = { this = root }
#			}
#			trigger_event = {
#				id = tgp_korea_decision.9202
#				delayed = yes
#			}
#		}
#	}
#	option = {
#		name = tgp_korea_decision.9201.a
#		ai_chance = {
#			base = 100
#		}
#	}
#}

#tgp_korea_decision.9202 = {
#	orphan = yes # DEPRECATED
#	type = character_event
#	title = tgp_korea_decision.9201.t
#	desc = tgp_korea_decision.9202.desc
#	theme = crown
#	left_portrait = {
#		character = root
#		animation = throne_room_bow_1
#	}
#	right_portrait = {
#		character = scope:founder
#		animation = holding_hu
#	}
#	override_background = { reference = throne_room_scope }
#	immediate = {
#		show_as_tooltip = {
#			scope:founder = { get_title = scope:new_title }
#			scope:regent_title.holder = { add_realm_law_skip_effects = single_heir_succession_law } # Regency inherited separately
#			scope:new_title = { add_title_law = single_heir_succession_law }
#		}
#	}
#	option = { name = tgp_korea_decision.9202.a }
#}

#tgp_korea_decision.9203 = {
#	orphan = yes # DEPRECATED
#	hidden = yes
#	type = character_event
#	trigger = {
#		government_has_flag = government_is_meritocratic
#		is_independent_ruler = yes
#		highest_held_title_tier >= tier_empire
#		tgp_realm_has_ceremonial_liege_trigger = no
#	}
#	immediate = {
#		save_scope_as = founder
#		save_scope_as = background_throne_room_scope
#		#tgp_create_ceremonial_regent_title_effect = { FOUNDER = root }
#		trigger_event = {
#			id = tgp_korea_decision.9201
#			delayed = yes
#		}
#	}
#}
