namespace = tgp_japan_decision

# tgp_japan_establish_house_fief_decision

scripted_effect tgp_establish_house_fief_save_scopes_effect = {
	top_liege ?= { save_scope_as = regent }
	save_scope_as = new_head
	house = {
		save_scope_as = old_house
		house_head = { save_scope_as = old_head }
	}
	random_held_title = {
		limit = { is_noble_family_title = yes }
		save_scope_as = old_nf_title
	}
}

tgp_japan_decision.9001 = { # CHOOSE HOUSE NAME EVENT - WITH WIDGET
	type = character_event
	title = {
		first_valid = {
			triggered_desc = {
				trigger = { has_character_flag = establish_house_fief }
				desc = tgp_japan_decision.9001.t.fief
			}
			desc = tgp_japan_decision.9001.t.cadet
		}
	}
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					this != scope:old_head
					has_character_flag = establish_house_fief
				}
				desc = tgp_japan_decision.9001.desc.fief_split_house
			}
			desc = tgp_japan_decision.9001.desc.cadet
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					has_character_flag = establish_house_fief
					var:petition_liege_house_fief_allowed_flag ?= top_liege
					top_liege = { government_allows = administrative }
				}
				desc = tgp_japan_decision.9001.desc.permission
			}
			triggered_desc = {
				trigger = {
					has_character_flag = establish_house_fief
					top_liege = { government_allows = administrative }
				}
				desc = tgp_japan_decision.9001.desc.crime
			}
			triggered_desc = {
				trigger = { has_character_flag = establish_house_fief }
				desc = tgp_japan_decision.9001.desc.feudal
			}
		}
		desc = tgp_japan_decision.9001.desc.fief_name
	}
	theme = realm

	left_portrait = {
		character = root
		animation = thinking
	}
	lower_left_portrait = {
		character = scope:old_head
		trigger = {
			NOR = {
				scope:regent ?= this
				root = this
			}
		}
	}
	lower_right_portrait =  scope:regent

	#NAMING WIDGET
	widget = {
		gui = "event_window_widget_enter_text"
		container = "dynamic_birth_name"
		controller = {
			type = text
			data = {
				key = new_japanese_house_name
				default = {
					localization_key = dynn_Abe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Abe } }
				}
				default = {
					localization_key = dynn_Adachi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Adachi } }
				}
				default = {
					localization_key = dynn_Aida
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Aida } }
				}
				default = {
					localization_key = dynn_Aihara
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Aihara } }
				}
				default = {
					localization_key = dynn_AikO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_AikO_ } }
				}
				default = {
					localization_key = dynn_Akamatsu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Akamatsu } }
				}
				default = {
					localization_key = dynn_Akasu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Akasu } }
				}
				default = {
					localization_key = dynn_Akata
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Akata } }
				}
				default = {
					localization_key = dynn_Akahori
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Akahori } }
				}
				default = {
					localization_key = dynn_Akatsuka
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Akatsuka } }
				}
				default = {
					localization_key = dynn_Akazawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Akazawa } }
				}
				default = {
					localization_key = dynn_Akiyama
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Akiyama } }
				}
				default = {
					localization_key = dynn_Akizuki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Akizuki } }
				}
				default = {
					localization_key = dynn_Amago
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Amago } }
				}
				default = {
					localization_key = dynn_Amano
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Amano } }
				}
				default = {
					localization_key = dynn_Amenomori
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Amenomori } }
				}
				default = {
					localization_key = dynn_Anami
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Anami } }
				}
				default = {
					localization_key = dynn_Ano
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ano } }
				}
				default = {
					localization_key = dynn_Anzai
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Anzai } }
				}
				default = {
					localization_key = dynn_Aoyama
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Aoyama } }
				}
				default = {
					localization_key = dynn_Asaba
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Asaba } }
				}
				default = {
					localization_key = dynn_Asaka
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Asaka } }
				}
				default = {
					localization_key = dynn_Asakura
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Asakura } }
				}
				default = {
					localization_key = dynn_Asami
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Asami } }
				}
				default = {
					localization_key = dynn_Asano
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Asano } }
				}
				default = {
					localization_key = dynn_Asari
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Asari } }
				}
				default = {
					localization_key = dynn_Ashida
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ashida } }
				}
				default = {
					localization_key = dynn_Ashikaga
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ashikaga } }
				}
				default = {
					localization_key = dynn_Ashina_JP
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ashina_JP } }
				}
				default = {
					localization_key = dynn_Aso
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Aso } }
				}
				default = {
					localization_key = dynn_Asuke
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Asuke } }
				}
				default = {
					localization_key = dynn_Atobe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Atobe } }
				}
				default = {
					localization_key = dynn_Awata
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Awata } }
				}
				default = {
					localization_key = dynn_Bessho
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Bessho } }
				}
				default = {
					localization_key = dynn_Chiba
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Chiba } }
				}
				default = {
					localization_key = dynn_Chichibu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Chichibu } }
				}
				default = {
					localization_key = dynn_ChO_sokabe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_ChO_sokabe } }
				}
				default = {
					localization_key = dynn_Date
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Date } }
				}
				default = {
					localization_key = dynn_Deura
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Deura } }
				}
				default = {
					localization_key = dynn_Doi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Doi } }
				}
				default = {
					localization_key = dynn_Ebina
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ebina } }
				}
				default = {
					localization_key = dynn_Ema
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ema } }
				}
				default = {
					localization_key = dynn_Fukushima
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Fukushima } }
				}
				default = {
					localization_key = dynn_Furuichi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Furuichi } }
				}
				default = {
					localization_key = dynn_Hachisuka
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hachisuka } }
				}
				default = {
					localization_key = dynn_Haga
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Haga } }
				}
				default = {
					localization_key = dynn_HanyU__2
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_HanyU__2 } }
				}
				default = {
					localization_key = dynn_Hara
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hara } }
				}
				default = {
					localization_key = dynn_Harada
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Harada } }
				}
				default = {
					localization_key = dynn_Haraishi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Haraishi } }
				}
				default = {
					localization_key = dynn_Hasuike
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hasuike } }
				}
				default = {
					localization_key = dynn_Hatano
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hatano } }
				}
				default = {
					localization_key = dynn_Hatakeyama
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hatakeyama } }
				}
				default = {
					localization_key = dynn_Hatta
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hatta } }
				}
				default = {
					localization_key = dynn_Hattori
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hattori } }
				}
				default = {
					localization_key = dynn_Hayami
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hayami } }
				}
				default = {
					localization_key = dynn_Hayashi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hayashi } }
				}
				default = {
					localization_key = dynn_Henmi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Henmi } }
				}
				default = {
					localization_key = dynn_Higuchi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Higuchi } }
				}
				default = {
					localization_key = dynn_Hiki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hiki } }
				}
				default = {
					localization_key = dynn_Hikida
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hikida } }
				}
				default = {
					localization_key = dynn_Hiraga
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hiraga } }
				}
				default = {
					localization_key = dynn_Hirukawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hirukawa } }
				}
				default = {
					localization_key = dynn_Hizume
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hizume } }
				}
				default = {
					localization_key = dynn_HO_jO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_HO_jO_ } }
				}
				default = {
					localization_key = dynn_Honda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Honda } }
				}
				default = {
					localization_key = dynn_HonjO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_HonjO_ } }
				}
				default = {
					localization_key = dynn_Hoshina
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hoshina } }
				}
				default = {
					localization_key = dynn_Hosokawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hosokawa } }
				}
				default = {
					localization_key = dynn_Hotta
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hotta } }
				}
				default = {
					localization_key = dynn_Hozumi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Hozumi } }
				}
				default = {
					localization_key = dynn_Iba_JP
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Iba_JP } }
				}
				default = {
					localization_key = dynn_Ichiji
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ichiji } }
				}
				default = {
					localization_key = dynn_Iga
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Iga } }
				}
				default = {
					localization_key = dynn_Ii
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ii } }
				}
				default = {
					localization_key = dynn_Iida
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Iida } }
				}
				default = {
					localization_key = dynn_Iinuma
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Iinuma } }
				}
				default = {
					localization_key = dynn_Ikeda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ikeda } }
				}
				default = {
					localization_key = dynn_Ikoma
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ikoma } }
				}
				default = {
					localization_key = dynn_Imai
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Imai } }
				}
				default = {
					localization_key = dynn_Imagawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Imagawa } }
				}
				default = {
					localization_key = dynn_Ina
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ina } }
				}
				default = {
					localization_key = dynn_Inage
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Inage } }
				}
				default = {
					localization_key = dynn_Inazawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Inazawa } }
				}
				default = {
					localization_key = dynn_Inomata
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Inomata } }
				}
				default = {
					localization_key = dynn_Inoue
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Inoue } }
				}
				default = {
					localization_key = dynn_IntO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_IntO_ } }
				}
				default = {
					localization_key = dynn_Irie
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Irie } }
				}
				default = {
					localization_key = dynn_Irobe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Irobe } }
				}
				default = {
					localization_key = dynn_Isa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Isa } }
				}
				default = {
					localization_key = dynn_Ishikawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ishikawa } }
				}
				default = {
					localization_key = dynn_Ishitani
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ishitani } }
				}
				default = {
					localization_key = dynn_Isshiki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Isshiki } }
				}
				default = {
					localization_key = dynn_Itakura
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Itakura } }
				}
				default = {
					localization_key = dynn_ItO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_ItO_ } }
				}
				default = {
					localization_key = dynn_ItO__2
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_ItO__2 } }
				}
				default = {
					localization_key = dynn_Itoga
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Itoga } }
				}
				default = {
					localization_key = dynn_Izumi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Izumi } }
				}
				default = {
					localization_key = dynn_Iwamatsu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Iwamatsu } }
				}
				default = {
					localization_key = dynn_Jinbo
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Jinbo } }
				}
				default = {
					localization_key = dynn_Kagami
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kagami } }
				}
				default = {
					localization_key = dynn_Kagawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kagawa } }
				}
				default = {
					localization_key = dynn_Kaji
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kaji } }
				}
				default = {
					localization_key = dynn_Kajiwara
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kajiwara } }
				}
				default = {
					localization_key = dynn_Kamachi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kamachi } }
				}
				default = {
					localization_key = dynn_Kambara
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kambara } }
				}
				default = {
					localization_key = dynn_Kanazu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kanazu } }
				}
				default = {
					localization_key = dynn_Kanbe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kanbe } }
				}
				default = {
					localization_key = dynn_Kaneda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kaneda } }
				}
				default = {
					localization_key = dynn_Kaneko
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kaneko } }
				}
				default = {
					localization_key = dynn_Kano
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kano } }
				}
				default = {
					localization_key = dynn_Kasai
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kasai } }
				}
				default = {
					localization_key = dynn_Kasuga
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kasuga } }
				}
				default = {
					localization_key = dynn_Kasukabe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kasukabe } }
				}
				default = {
					localization_key = dynn_Katagiri
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Katagiri } }
				}
				default = {
					localization_key = dynn_Kataoka
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kataoka } }
				}
				default = {
					localization_key = dynn_Katsuta
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Katsuta } }
				}
				default = {
					localization_key = dynn_Kawagoe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kawagoe } }
				}
				default = {
					localization_key = dynn_Kawasaki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kawasaki } }
				}
				default = {
					localization_key = dynn_Kawazu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kawazu } }
				}
				default = {
					localization_key = dynn_Kida
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kida } }
				}
				default = {
					localization_key = dynn_Kikkawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kikkawa } }
				}
				default = {
					localization_key = dynn_Kikuchi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kikuchi } }
				}
				default = {
					localization_key = dynn_Kimotsuki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kimotsuki } }
				}
				default = {
					localization_key = dynn_Kira
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kira } }
				}
				default = {
					localization_key = dynn_Kiso
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kiso } }
				}
				default = {
					localization_key = dynn_Kitahara
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kitahara } }
				}
				default = {
					localization_key = dynn_KO_no
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_KO_no } }
				}
				default = {
					localization_key = dynn_KO_sokabe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_KO_sokabe } }
				}
				default = {
					localization_key = dynn_Kobayakawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kobayakawa } }
				}
				default = {
					localization_key = dynn_Kodama
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kodama } }
				}
				default = {
					localization_key = dynn_Kokubu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kokubu } }
				}
				default = {
					localization_key = dynn_Kosaka
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kosaka } }
				}
				default = {
					localization_key = dynn_Kuki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kuki } }
				}
				default = {
					localization_key = dynn_Kumabe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kumabe } }
				}
				default = {
					localization_key = dynn_Kumagai
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kumagai } }
				}
				default = {
					localization_key = dynn_Kumasaka
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kumasaka } }
				}
				default = {
					localization_key = dynn_Kurita
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kurita } }
				}
				default = {
					localization_key = dynn_Kutsuki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kutsuki } }
				}
				default = {
					localization_key = dynn_Maki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Maki } }
				}
				default = {
					localization_key = dynn_Makino
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Makino } }
				}
				default = {
					localization_key = dynn_Masuda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Masuda } }
				}
				default = {
					localization_key = dynn_Matano
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Matano } }
				}
				default = {
					localization_key = dynn_Matsudaira
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Matsudaira } }
				}
				default = {
					localization_key = dynn_Matsura
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Matsura } }
				}
				default = {
					localization_key = dynn_Migata
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Migata } }
				}
				default = {
					localization_key = dynn_Mikata
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Mikata } }
				}
				default = {
					localization_key = dynn_Mimura
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Mimura } }
				}
				default = {
					localization_key = dynn_Minase
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Minase } }
				}
				default = {
					localization_key = dynn_Misawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Misawa } }
				}
				default = {
					localization_key = dynn_Mitai
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Mitai } }
				}
				default = {
					localization_key = dynn_Mitoya
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Mitoya } }
				}
				default = {
					localization_key = dynn_Miura
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Miura } }
				}
				default = {
					localization_key = dynn_Miyoshi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Miyoshi } }
				}
				default = {
					localization_key = dynn_Mizokui
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Mizokui } }
				}
				default = {
					localization_key = dynn_Mochizuki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Mochizuki } }
				}
				default = {
					localization_key = dynn_Mogami
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Mogami } }
				}
				default = {
					localization_key = dynn_Mokusai
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Mokusai } }
				}
				default = {
					localization_key = dynn_Momonoi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Momonoi } }
				}
				default = {
					localization_key = dynn_Mori_JP # Not prounounced "Mōri" yet
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Mori_JP } }
				}
				default = {
					localization_key = dynn_Murakami
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Murakami } }
				}
				default = {
					localization_key = dynn_Murayama
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Murayama } }
				}
				default = {
					localization_key = dynn_Nagae
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nagae } }
				}
				default = {
					localization_key = dynn_Nagao
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nagao } }
				}
				default = {
					localization_key = dynn_Nagasa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nagasa } }
				}
				default = {
					localization_key = dynn_NakajO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_NakajO_ } }
				}
				default = {
					localization_key = dynn_Nakamura
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nakamura } }
				}
				default = {
					localization_key = dynn_Nakano
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nakano } }
				}
				default = {
					localization_key = dynn_Namba
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Namba } }
				}
				default = {
					localization_key = dynn_Namekata
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Namekata } }
				}
				default = {
					localization_key = dynn_Nanbu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nanbu } }
				}
				default = {
					localization_key = dynn_NanjO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_NanjO_ } }
				}
				default = {
					localization_key = dynn_Narita
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Narita } }
				}
				default = {
					localization_key = dynn_Nasu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nasu } }
				}
				default = {
					localization_key = dynn_Natsume
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Natsume } }
				}
				default = {
					localization_key = dynn_Nemoto
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nemoto } }
				}
				default = {
					localization_key = dynn_Nezu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nezu } }
				}
				default = {
					localization_key = dynn_Nikaido
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nikaido } }
				}
				default = {
					localization_key = dynn_Niki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Niki } }
				}
				default = {
					localization_key = dynn_Nissai
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nissai } }
				}
				default = {
					localization_key = dynn_Nogi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nogi } }
				}
				default = {
					localization_key = dynn_Nomoto
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nomoto } }
				}
				default = {
					localization_key = dynn_Nose
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nose } }
				}
				default = {
					localization_key = dynn_Noyo
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Noyo } }
				}
				default = {
					localization_key = dynn_Nishina
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nishina } }
				}
				default = {
					localization_key = dynn_Nitta
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nitta } }
				}
				default = {
					localization_key = dynn_Niwa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Niwa } }
				}
				default = {
					localization_key = dynn_O_ba
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_ba } }
				}
				default = {
					localization_key = dynn_O_hara
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_hara } }
				}
				default = {
					localization_key = dynn_O_i
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_i } }
				}
				default = {
					localization_key = dynn_O_kawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_kawa } }
				}
				default = {
					localization_key = dynn_O_mi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_mi } }
				}
				default = {
					localization_key = dynn_O_miya
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_miya } }
				}
				default = {
					localization_key = dynn_O_no
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_no } }
				}
				default = {
					localization_key = dynn_O_suga
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_suga } }
				}
				default = {
					localization_key = dynn_O_ta
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_ta } }
				}
				default = {
					localization_key = dynn_O_tawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_tawa } }
				}
				default = {
					localization_key = dynn_O_tomo
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_tomo } }
				}
				default = {
					localization_key = dynn_O_uchi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_uchi } }
				}
				default = {
					localization_key = dynn_O_zone
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_zone } }
				}
				default = {
					localization_key = dynn_Obata
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Obata } }
				}
				default = {
					localization_key = dynn_Obu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Obu } }
				}
				default = {
					localization_key = dynn_Oda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Oda } }
				}
				default = {
					localization_key = dynn_Odagiri
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Odagiri } }
				}
				default = {
					localization_key = dynn_Ogasawara
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ogasawara } }
				}
				default = {
					localization_key = dynn_Ogata
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ogata } }
				}
				default = {
					localization_key = dynn_Ogawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ogawa } }
				}
				default = {
					localization_key = dynn_Okabe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Okabe } }
				}
				default = {
					localization_key = dynn_Okada
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Okada } }
				}
				default = {
					localization_key = dynn_Okazaki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Okazaki } }
				}
				default = {
					localization_key = dynn_Onodera
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Onodera } }
				}
				default = {
					localization_key = dynn_Onozaki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Onozaki } }
				}
				default = {
					localization_key = dynn_Osada
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Osada } }
				}
				default = {
					localization_key = dynn_Oyama
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Oyama } }
				}
				default = {
					localization_key = dynn_Oyamada
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Oyamada } }
				}
				default = {
					localization_key = dynn_Sado
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Sado } }
				}
				default = {
					localization_key = dynn_Sagae
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Sagae } }
				}
				default = {
					localization_key = dynn_Sagara
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Sagara } }
				}
				default = {
					localization_key = dynn_Saji
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Saji } }
				}
				default = {
					localization_key = dynn_Sakuma
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Sakuma } }
				}
				default = {
					localization_key = dynn_Sanada
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Sanada } }
				}
				default = {
					localization_key = dynn_Sano
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Sano } }
				}
				default = {
					localization_key = dynn_Sasaki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Sasaki } }
				}
				default = {
					localization_key = dynn_Satake
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Satake } }
				}
				default = {
					localization_key = dynn_Satomi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Satomi } }
				}
				default = {
					localization_key = dynn_Sawara
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Sawara } }
				}
				default = {
					localization_key = dynn_Seki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Seki } }
				}
				default = {
					localization_key = dynn_Seno_o
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Seno_o } }
				}
				default = {
					localization_key = dynn_Shiba
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Shiba } }
				}
				default = {
					localization_key = dynn_Shibuya
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Shibuya } }
				}
				default = {
					localization_key = dynn_Shida
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Shida } }
				}
				default = {
					localization_key = dynn_Shiga
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Shiga } }
				}
				default = {
					localization_key = dynn_Shima
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Shima } }
				}
				default = {
					localization_key = dynn_Shimazu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Shimazu } }
				}
				default = {
					localization_key = dynn_ShimokO_be
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_ShimokO_be } }
				}
				default = {
					localization_key = dynn_Shinagawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Shinagawa } }
				}
				default = {
					localization_key = dynn_ShingU_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_ShingU_ } }
				}
				default = {
					localization_key = dynn_Shinmen
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Shinmen } }
				}
				default = {
					localization_key = dynn_Shioda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Shioda } }
				}
				default = {
					localization_key = dynn_Shionoya
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Shionoya } }
				}
				default = {
					localization_key = dynn_Shiratori
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Shiratori } }
				}
				default = {
					localization_key = dynn_SO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_SO_ } }
				}
				default = {
					localization_key = dynn_Soga_2
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Soga } }
				}
				default = {
					localization_key = dynn_Sogabe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Sogabe } }
				}
				default = {
					localization_key = dynn_SogO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_SogO_ } }
				}
				default = {
					localization_key = dynn_SO_ma
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_SO_ma } }
				}
				default = {
					localization_key = dynn_SO_sa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_SO_sa } }
				}
				default = {
					localization_key = dynn_Sugime
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Sugime } }
				}
				default = {
					localization_key = dynn_Sugimoto
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Sugimoto } }
				}
				default = {
					localization_key = dynn_Suzuki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Suzuki } }
				}
				default = {
					localization_key = dynn_Tada
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Tada } }
				}
				default = {
					localization_key = dynn_Taguchi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Taguchi } }
				}
				default = {
					localization_key = dynn_Takaoka
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Takaoka } }
				}
				default = {
					localization_key = dynn_Takayasu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Takayasu } }
				}
				default = {
					localization_key = dynn_Takeda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Takeda } }
				}
				default = {
					localization_key = dynn_Takeishi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Takeishi } }
				}
				default = {
					localization_key = dynn_Takezaki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Takezaki } }
				}
				default = {
					localization_key = dynn_Tamura
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Tamura } }
				}
				default = {
					localization_key = dynn_Tanaka
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Tanaka } }
				}
				default = {
					localization_key = dynn_Tashiro
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Tashiro } }
				}
				default = {
					localization_key = dynn_TO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_TO_ } }
				}
				default = {
					localization_key = dynn_TO_gO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_TO_gO_ } }
				}
				default = {
					localization_key = dynn_Togashi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Togashi } }
				}
				default = {
					localization_key = dynn_Toida
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Toida } }
				}
				default = {
					localization_key = dynn_Toki_JP
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Toki_JP } }
				}
				default = {
					localization_key = dynn_Tokiwa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Tokiwa } }
				}
				default = {
					localization_key = dynn_Tokuda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Tokuda } }
				}
				default = {
					localization_key = dynn_Tokugawa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Tokugawa } }
				}
				default = {
					localization_key = dynn_Tomono
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Tomono } }
				}
				default = {
					localization_key = dynn_Tomura
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Tomura } }
				}
				default = {
					localization_key = dynn_Toshima
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Toshima } }
				}
				default = {
					localization_key = dynn_Tsuchiya
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Tsuchiya } }
				}
				default = {
					localization_key = dynn_Tsutsumi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Tsutsumi } }
				}
				default = {
					localization_key = dynn_Toyoda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Toyoda } }
				}
				default = {
					localization_key = dynn_Toyoyama
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Toyoyama } }
				}
				default = {
					localization_key = dynn_Ueda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ueda } }
				}
				default = {
					localization_key = dynn_Uesugi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Uesugi } }
				}
				default = {
					localization_key = dynn_Ui
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ui } }
				}
				default = {
					localization_key = dynn_Uji_ie
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Uji_ie } }
				}
				default = {
					localization_key = dynn_Unno
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Unno } }
				}
				default = {
					localization_key = dynn_Urakami
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Urakami } }
				}
				default = {
					localization_key = dynn_Usami
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Usami } }
				}
				default = {
					localization_key = dynn_Ushimaru
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ushimaru } }
				}
				default = {
					localization_key = dynn_Ushioda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Ushioda } }
				}
				default = {
					localization_key = dynn_Usuki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Usuki } }
				}
				default = {
					localization_key = dynn_Wada
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Wada } }
				}
				default = {
					localization_key = dynn_Wasada
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Wasada } }
				}
				default = {
					localization_key = dynn_Washizu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Washizu } }
				}
				default = {
					localization_key = dynn_Watanabe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Watanabe } }
				}
				default = {
					localization_key = dynn_Watari
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Watari } }
				}
				default = {
					localization_key = dynn_Yamada
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yamada } }
				}
				default = {
					localization_key = dynn_Yamaga
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yamaga } }
				}
				default = {
					localization_key = dynn_Yamagata
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yamagata } }
				}
				default = {
					localization_key = dynn_Yamaguchi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yamaguchi } }
				}
				default = {
					localization_key = dynn_Yamamoto
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yamamoto } }
				}
				default = {
					localization_key = dynn_Yamana
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yamana } }
				}
				default = {
					localization_key = dynn_Yamauchi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yamauchi } }
				}
				default = {
					localization_key = dynn_Yashiro
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yashiro } }
				}
				default = {
					localization_key = dynn_Yasu
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yasu } }
				}
				default = {
					localization_key = dynn_Yasuda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yasuda } }
				}
				default = {
					localization_key = dynn_Yasutomi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yasutomi } }
				}
				default = {
					localization_key = dynn_Yoda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yoda } }
				}
				default = {
					localization_key = dynn_Yokoyama
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yokoyama } }
				}
				default = {
					localization_key = dynn_Yomoda
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yomoda } }
				}
				default = {
					localization_key = dynn_Yoshida
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yoshida } }
				}
				default = {
					localization_key = dynn_YU_ki
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_YU_ki } }
				}
				default = {
					localization_key = dynn_Yuasa
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yuasa } }
				}
				default = {
					localization_key = dynn_Yuri
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Yuri } }
				}
				### KYOTO
				default = {
					localization_key = dynn_Awata
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Awata } }
				}
				default = {
					localization_key = dynn_Awataguchi
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Awataguchi } }
				}
				default = {
					localization_key = dynn_GojO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_GojO_ } }
				}
				default = {
					localization_key = dynn_IchijO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_IchijO_ } }
				}
				default = {
					localization_key = dynn_Kitabatake
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Kitabatake } }
				}
				default = {
					localization_key = dynn_Konoe
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Konoe } }
				}
				default = {
					localization_key = dynn_KyO_goku
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_KyO_goku } }
				}
				default = {
					localization_key = dynn_Nakamikado
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Nakamikado } }
				}
				default = {
					localization_key = dynn_NijO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_NijO_ } }
				}
				default = {
					localization_key = dynn_O_inomikado
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_O_inomikado } }
				}
				default = {
					localization_key = dynn_Rokkaku
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Rokkaku } }
				}
				default = {
					localization_key = dynn_RokujO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_RokujO_ } }
				}
				default = {
					localization_key = dynn_SanjO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_SanjO_ } }
				}
				default = {
					localization_key = dynn_ShijO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_ShijO_ } }
				}
				default = {
					localization_key = dynn_Tsuchimikado
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_Tsuchimikado } }
				}
				### FUJIWARA
				default = {
					localization_key = dynn_AndO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_AndO_ } }
				}
				default = {
					localization_key = dynn_EndO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_EndO_ } }
				}
				default = {
					localization_key = dynn_GotO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_GotO_ } }
				}
				default = {
					localization_key = dynn_KatO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_KatO_ } }
				}
				default = {
					localization_key = dynn_KondO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_KondO_ } }
				}
				default = {
					localization_key = dynn_KudO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_KudO_ } }
				}
				default = {
					localization_key = dynn_MutO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_MutO_ } }
				}
				default = {
					localization_key = dynn_SaitO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_SaitO_ } }
				}
				default = {
					localization_key = dynn_SatO_
					trigger = { is_target_in_variable_list = { name = japanese_house_names target = flag:dynn_SatO_ } }
				}
				### OTHER
				default = {
					localization_key = japanese_house_domicile_barony
					trigger = {
						exists = scope:domicile_barony
						trigger_if = {
							limit = { has_variable_list = japanese_house_names }
							variable_list_size = {
								name = japanese_house_names
								value < 2
							}
						}
					}
				}
				default = {
					localization_key = japanese_house_random_barony
					trigger = {
						exists = scope:random_barony
						NOT = { has_character_flag = found_cadet_branch }
						trigger_if = {
							limit = { has_variable_list = japanese_house_names }
							variable_list_size = {
								name = japanese_house_names
								value < 2
							}
						}
					}
				}
				default = {
					localization_key = japanese_house_first_name
					trigger = {
						exists = scope:old_head
						has_character_flag = found_cadet_branch
						trigger_if = {
							limit = { has_variable_list = japanese_house_names }
							variable_list_size = {
								name = japanese_house_names
								value < 2
							}
						}
					}
				}
				default = {
					localization_key = japanese_house_primary_county
					trigger = {
						exists = scope:primary_county
						trigger_if = {
							limit = { has_variable_list = japanese_house_names }
							variable_list_size = {
								name = japanese_house_names
								value < 3
							}
						}
					}
				}
				default = {
					localization_key = japanese_house_domicile_county
					trigger = {
						exists = scope:domicile_county
						trigger_if = {
							limit = { has_variable_list = japanese_house_names }
							variable_list_size = {
								name = japanese_house_names
								value < 3
							}
						}
					}
				}
			}
		}
		setup_scope = {
			root = { save_scope_as = text_target }
		}
	}

	immediate = {
		top_liege = { save_scope_as = regent }
		save_scope_as = new_head
		save_scope_as = new_house_head # don't ask
		house = {
			save_scope_as = old_house
			house_head = { save_scope_as = old_head }
		}
		if = {
			limit = { domicile.domicile_location.county.holder ?= root }
			domicile.domicile_location.barony = {
				save_scope_as = domicile_barony
				county = { save_scope_as = domicile_county }
			}
		}
		else_if = {
			limit = {
				is_landed = no
				scope:old_head.domicile.domicile_location.county.holder ?= scope:old_head
			}
			scope:old_head.domicile.domicile_location.barony = {
				save_scope_as = domicile_barony
				county = { save_scope_as = domicile_county }
			}
		}
		else_if = {
			limit = { is_landed = yes }
			save_scope_as = land_haver
		}
		else = {
			limit = { house.house_head = { is_landed = yes } }
			house.house_head = { save_scope_as = land_haver }
		}
		scope:land_haver.capital_county ?= {
			save_scope_as = primary_county
			random_county_province = {
				limit = {
					NOT = { has_holding_type = church_holding }
				}
				alternative_limit = { always = yes }
				barony = { save_scope_as = random_barony }
			}
		}
		hidden_effect = {
			if = {
				limit = {
					NOT = { has_character_flag = found_cadet_branch }
				}
				if = {
					limit = { domicile.domicile_location.county ?= title:c_yamashiro }
					while = {
						count = 3
						assign_japanese_house_name_options_kyoto_effect = yes
					}
				}
				else = {
					while = {
						count = 3
						assign_japanese_house_name_options_effect = yes
					}
				}
			}
			else = {
				if = {
					limit = { domicile.domicile_location.county ?= title:c_yamashiro }
					while = {
						count = 1
						assign_japanese_house_name_options_kyoto_effect = yes
					}
				}
				else = {
					while = {
						count = 1
						assign_japanese_house_name_options_effect = yes
					}
				}
			}
		}
		if = {
			limit = { is_ai = yes }
			random_list = {
				10 = {
					trigger = { has_variable_list = japanese_house_names }
					random_in_list = {
						variable = japanese_house_names
						save_scope_as = house_name
						root = {
							set_variable = {
								name = new_japanese_house_name
								value = scope:house_name
							}
						}
					}
				}
				1 = {
					trigger = { exists = scope:domicile_barony }
					set_variable = {
						name = new_japanese_house_name
						value = flag:japanese_house_domicile_barony
					}
				}
				1 = {
					trigger = { exists = scope:domicile_county }
					set_variable = {
						name = new_japanese_house_name
						value = flag:japanese_house_domicile_county
					}
				}
				1 = {
					trigger = { exists = scope:random_barony }
					set_variable = {
						name = new_japanese_house_name
						value = flag:japanese_house_random_barony
					}
				}
				1 = {
					trigger = {
						exists = scope:old_head
						has_character_flag = found_cadet_branch
						government_allows = administrative
					}
					set_variable = {
						name = new_japanese_house_name
						value = flag:japanese_house_first_name
					}
				}
			}
		}
		switch = {
			trigger = has_character_flag
			establish_house_fief = {
				tgp_establish_house_fief_save_scopes_effect = yes
				play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_adopting_feudal_government"
			}
			fallback = {
				play_music_cue = "mx_cue_low_key_positive"
			}
		}
	}

	option = {
		name = {
			trigger = { has_character_flag = establish_house_fief }
			text = tgp_japan_decision.9001.a.fief
		}
		name = {
			trigger = { has_character_flag = found_cadet_branch }
			text = tgp_japan_decision.9001.a.cadet
		}
	}

	after = {
		clear_variable_list = japanese_house_names
		if = {
			limit = {
				NOT = { has_variable = new_japanese_house_name }
			}
			if = {
				limit = { is_ai = no }
				set_variable = {
					name = new_japanese_house_name
					value = flag:custom
				}
			}
		}
		switch = {
			trigger = has_character_flag
			found_cadet_branch = {
				found_cadet_house_decision_effect = {
					CHARACTER = root
					PRESTIGE = minor_prestige_gain
				}
				#scope:new_title ?= { set_title_name_dynamic = japanese_noble_family_name }
			}
			establish_house_fief = {
				japan_establish_house_fief_effect = yes
			}
			fallback = {
				found_cadet_house_decision_effect = {
					CHARACTER = root
					PRESTIGE = major_prestige_gain
				}
				#scope:new_title ?= { set_title_name_dynamic = japanese_noble_family_name }
			}
		}
		switch = {
			trigger = has_character_flag
			found_cadet_branch = { remove_character_flag = found_cadet_branch }
			establish_house_fief = { remove_character_flag = establish_house_fief }
		}
		if = { # Help AI with Manors to propogate Soryo
			limit = {
				is_ai = yes
				exists = scope:new_title
				exists = domicile
				exists = scope:old_head.domicile
			}
			scope:old_head.domicile = {
				if = {
					limit = {
						has_domicile_building = japanese_manor_main_02
						root.culture ?= { has_innovation = innovation_manorialism }
					}
					add_domicile_building = japanese_manor_main_03
				}
				else_if = {
					limit = {
						has_domicile_building = japanese_manor_main_03
						root.culture ?= { has_innovation = innovation_development_03 }
					}
					add_domicile_building = japanese_manor_main_04
				}
				else_if = {
					limit = {
						has_domicile_building = japanese_manor_main_04
						root.culture ?= { has_innovation = innovation_cranes }
					}
					add_domicile_building = japanese_manor_main_05
				}
				else_if = {
					limit = {
						has_domicile_building = japanese_manor_main_05
						root.culture ?= { has_innovation = innovation_cranes }
					}
					add_domicile_building = japanese_manor_main_06
				}
			}
		}
		if = { # JOIN BLOC
			limit = { exists = scope:old_house.house_confederation }
			house = {
				tgp_join_house_bloc_effect = {
					INVITER = scope:old_house
					OPINION = flag:no
				}
				set_cadet_aspiration_cooldown_effect = yes
			}
		}
	}
}

tgp_japan_decision.9002 = { # SAME CLAN EVENT - NO WIDGET
	type = character_event
	title = {
		first_valid = {
			triggered_desc = {
				trigger = { is_landed = no }
				desc = tgp_japan_decision.9002.t.landless
			}
			desc = tgp_japan_decision.9002.t
		}
	}
	desc = {
		desc = tgp_japan_decision.9002.desc
		first_valid = {
			triggered_desc = {
				trigger = { is_landed = no }
				desc = tgp_japan_decision.9002.desc.landless
			}
			desc = tgp_japan_decision.9002.desc.landed
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					var:petition_liege_house_fief_allowed_flag ?= top_liege
					top_liege = { government_allows = administrative }
				}
				desc = tgp_japan_decision.9001.desc.permission
			}
			triggered_desc = {
				trigger = {
					top_liege = { government_allows = administrative }
				}
				desc = tgp_japan_decision.9001.desc.crime
			}
			desc = tgp_japan_decision.9001.desc.feudal
		}
	}
	theme = realm
	left_portrait = {
		character = root
		animation = thinking
	}
	lower_right_portrait =  scope:regent

	immediate = {
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_adopting_feudal_government"
		tgp_establish_house_fief_save_scopes_effect = yes
		japan_establish_house_fief_effect = yes
	}

	option = {
		name = tgp_japan_decision.9002.a
	}
}

tgp_japan_decision.9005 = { # NOTIFICATION FOR OLD HOUSE HEADS
	type = character_event
	title = {
		triggered_desc = {
			trigger = {
				scope:new_head = { is_landed = no }
			}
			desc = tgp_japan_decision.9005.t.landless
		}
		desc = tgp_japan_decision.9005.t
	}
	desc = tgp_japan_decision.9005.desc
	theme = realm

	left_portrait = {
		character = scope:new_head
		animation = war_over_tie
	}

	trigger = {
		is_ai = no
		NOT = { scope:new_head ?= this }
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_adopting_feudal_government"
		show_as_tooltip = {
			scope:new_head = {
				set_house = scope:new_head.house
				#get_title = scope:new_nf_title
				change_government = japan_feudal_government
				if = {
					limit = {
						NOT = { var:petition_liege_house_fief_allowed_flag ?= scope:regent }
					}
					reverse_add_opinion = {
						modifier = admin_soryo_conquest_crime
						target = scope:regent
					}
				}
			}
		}
	}

	option = {
		name = tgp_japan_decision.9005.a
	}
}

# tgp_japan_become_shogun_decision

tgp_japan_decision.9101 = {
	type = character_event
	window = fullscreen_event
	title = tgp_japan_decision.9101.t
	desc = tgp_japan_decision.9101.desc
	theme = crown
	override_background = { reference = tgp_fullscreen_japanese_shogunate }
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { has_trait = devoted }
			animation = war_over_win
		}
		animation = japanese_war_fan
	}
	right_portrait = {
		character = scope:ceremonial_liege
		animation = holding_hu
	}

	immediate = {
		save_scope_as = shogun
		tgp_save_realm_ceremonial_liege_effect = yes
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_become_japanese_shogun"
		if = {
			limit = {
				any_vassal = {
					is_landed = yes
					has_government = japan_administrative_government
					highest_held_title_tier >= tier_county
				}
			}
			custom_tooltip = tgp_japan_become_shogun_decision_vassal_revocation_effect
		}
		# Inform Vassals
		every_vassal_or_below = {
			limit = { 
				is_ruler = yes 
			}
			trigger_event = tgp_japan_decision.9102
		}
		# Rewards
		japanese_become_shogun_reward_effect = yes
	}

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

tgp_japan_decision.9102 = {
	type = character_event
	title = tgp_japan_decision.9102.t
	desc = {
		desc = tgp_japan_decision.9102.desc
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:title_change }
				desc = tgp_japan_decision.9102.admin
			}
			triggered_desc = {
				trigger = { is_landed = yes }
				desc = tgp_japan_decision.9102.feudal
			}
			desc = tgp_japan_decision.9102.fallback
		}
	}
	theme = realm

	left_portrait = {
		character = root
		animation = war_over_win
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_become_japanese_shogun"
	}

	option = {
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = { exists = scope:title_change }
						desc = tgp_japan_decision.9102.a.admin
					}
					desc = tgp_japan_decision.9101.a
				}
			}
		}
		if = {
			limit = {
				government_has_flag = government_is_japan_administrative
			}
			change_government = japan_feudal_government
		}
	}
}

# tgp_japan_imperial_branch_decision

tgp_japan_decision.9201 = {
	type = character_event
	title = tgp_japan_decision.9201.t
	desc = {
		desc = tgp_japan_decision.9201.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:minamoto_house
					exists = scope:taira_house
				}
				desc = tgp_japan_decision.9201.both
			}
			triggered_desc = {
				trigger = { exists = scope:minamoto_house }
				desc = tgp_japan_decision.9201.minamoto
			}
			triggered_desc = {
				trigger = { exists = scope:taira_house }
				desc = tgp_japan_decision.9201.taira
			}
		}
	}
	theme = family
	left_portrait = {
		character = root
		animation = throne_room_bow_1
	}
	right_portrait = {
		character = scope:ceremonial_liege
		animation = holding_hu
	}
	lower_left_portrait = scope:minamoto_head
	lower_center_portrait = {
		character = scope:nearest_emperor
		trigger = {
			NOT = { this = scope:ceremonial_liege }
		}
	}
	lower_right_portrait = scope:taira_head
	override_background = { reference = throne_room_scope }

	immediate = {
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_restoring_japanese_emperor"
		tgp_save_realm_ceremonial_liege_effect = yes
		scope:ceremonial_liege = { save_scope_as = background_throne_room_scope }
		top_liege = { save_scope_as = liege }
		house = {
			save_scope_as = old_house
			house_head = { save_scope_as = old_house_head }
		}
	}

	option = { # Join Existing Minamoto
		name = tgp_japan_decision.9201.a
		trigger = { exists = scope:minamoto_house }
		highlight_portrait = scope:minamoto_house.house_head
		japan_set_house_effect = { NEW_HOUSE = scope:minamoto_house }
		reverse_add_opinion = {
			target = scope:minamoto_head
			modifier = respect_opinion
			opinion = 25
		}
		ai_chance = {
			base = 5
			modifier = {
				scope:minamoto_house.house_head = { is_close_family_of = root }
				add = 25
			}
		}
	}

	option = { # Join Existing Taira
		name = tgp_japan_decision.9201.b
		trigger = { exists = scope:taira_house }
		highlight_portrait = scope:taira_house.house_head
		japan_set_house_effect = { NEW_HOUSE = scope:taira_house }
		reverse_add_opinion = {
			target = scope:taira_head
			modifier = respect_opinion
			opinion = 25
		}
		ai_chance = {
			base = 5
			modifier = {
				scope:taira_house.house_head = { is_close_family_of = root }
				add = 25
			}
		}
	}

	option = { # Found New Minamoto
		name = tgp_japan_decision.9201.c
		trigger = {
			NOT = { exists = scope:minamoto_house }
		}
		# Prestige cost for not joining existing
		if = {
			limit = { exists = scope:taira_house }
			add_prestige = medium_prestige_loss
		}
		custom_tooltip = {
			text = tgp_japan_decision.9201.c.tt
			create_dynasty = {
				name = dynn_Minamoto
				coat_of_arms = japanese_minamoto_seiwa
				spread_to_descendants = yes
				save_scope_as = new_dynasty
			}
			scope:new_dynasty ?= {
				set_coa = dynasty:japanese_minamoto_seiwa
				set_variable = { name = minamoto_flag }
				hidden_effect = { add_dynasty_prestige_level = 4 }
			}
			house = {
				save_scope_as = new_house
				set_coa = dynasty:japanese_minamoto_seiwa
				set_house_name = new_honsei_house_name
			}
		}
		if = {
			limit = { government_allows = noble_families }
			create_noble_family_effect = { GOVERNMENT_GIVER = this }
		}
		ai_chance = {
			base = 25
			modifier = { # Avoid AI creating both
				exists = scope:taira_house
				add = -20
			}
		}
	}

	option = { # Found New Taira
		name = tgp_japan_decision.9201.d
		trigger = {
			NOT = { exists = scope:taira_house }
		}
		# Prestige cost for not joining existing
		if = {
			limit = { exists = scope:minamoto_house }
			add_prestige = medium_prestige_loss
		}
		custom_tooltip = {
			text = tgp_japan_decision.9201.d.tt
			create_dynasty = {
				name = dynn_Taira
				coat_of_arms = japanese_taira_kanmu
				spread_to_descendants = yes
				save_scope_as = new_dynasty
			}
			scope:new_dynasty ?= {
				set_coa = dynasty:japanese_taira_kanmu
				set_variable = { name = taira_flag }
				hidden_effect = { add_dynasty_prestige_level = 4 }
			}
			house = {
				save_scope_as = new_house
				set_coa = dynasty:japanese_taira_kanmu
				set_house_name = new_honsei_house_name
			}
		}
		if = {
			limit = { government_allows = noble_families }
			create_noble_family_effect = { GOVERNMENT_GIVER = this }
		}
		ai_chance = {
			base = 25
			modifier = { # Avoid AI creating both
				exists = scope:minamoto_house
				add = -20
			}
		}
	}

	after = {
		if = { # JOIN BLOC
			limit = { exists = scope:old_house.house_confederation }
			house = {
				tgp_join_house_bloc_effect = {
					INVITER = scope:old_house
					OPINION = flag:no
				}
			}
		}
		# Move to 'Kingdom' if necessary
		if = {
			limit = {
				is_ruler = no
				top_liege != scope:regent
			}
			scope:regent = { add_courtier = root }
		}
		# Message
		if = {
			limit = { exists = scope:new_house }
			hidden_effect = {
				every_player = {
					limit = { top_liege = title:e_japan.holder }
					send_interface_message = {
						type = event_generic_neutral
						title = tgp_japan_decision.9201.message_title
						left_icon = root
						right_icon = scope:nearest_emperor
						show_as_tooltip = {
							root = { set_house = scope:new_house }
						}
					}
				}
			}
		}
		# ERROR SUPPRESSION
		if = {
			limit = {
				has_variable = fujiwara_flag
				has_variable = minamoto_flag
				has_variable = taira_flag
			}
		}
	}
}

# tgp_japan_emperor_restoration_decision

tgp_japan_decision.9301 = {
	type = character_event
	title = tgp_japan_decision.9301.t
	desc = tgp_japan_decision.9301.desc
	theme = crown

	left_portrait = {
		character = root
		animation = holding_hu
	}
	right_portrait = {
		character = scope:attacker
		animation = war_over_win
		trigger = {	
			NOT = { this = root }
		}
	}
	lower_center_portrait = scope:defender

	override_effect_2d = { reference = legend_glow }

	immediate = {
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_restoring_japanese_emperor"
		save_scope_as = tenno
		save_scope_as = bg_override_char
		japan_clear_flavour_flags_effect = yes
		set_global_variable = {
			name = tenno_restored
			value = yes
		}
		add_character_flag = ceremonial_liege_flag
		# Inform Vassals
		every_player = {
			limit = { is_vassal_or_below_of = root }
			trigger_event = tgp_japan_decision.9302
		}
		restore_ceremonial_liege_faction_reward_effect = yes
	}

	option = {
		name = tgp_japan_decision.9301.a
	}
}

tgp_japan_decision.9302 = {
	type = character_event
	title = tgp_japan_decision.9302.t
	desc = tgp_japan_decision.9302.desc
	theme = crown

	override_effect_2d = { reference = legend_glow }

	left_portrait = {
		character = scope:tenno
		animation = holding_hu
	}
	right_portrait = {
		character = scope:attacker
		animation = war_over_win
		trigger = {
			NOT = { this = scope:tenno }
		}
	}
	lower_center_portrait = scope:defender

	immediate = {
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_restoring_japanese_emperor"
		show_as_tooltip = {
			scope:tenno = { restore_ceremonial_liege_faction_reward_effect = yes }
		}
	}

	option = {
		name = tgp_japan_decision.9302.a
	}
}

#Become a Poet - Ceremony - House Aspiration
tgp_japan_decision.9401 = {
	type = character_event
	title = tgp_japan_decision.9401.t
	desc = tgp_japan_decision.9401.desc
	theme = education
	left_portrait = {
		character = root
		animation = writing
	}

	#Study to become a poet
	option = {
		name = tgp_japan_decision.9401.a

		duel = {
			skill = learning
			value = high_skill_rating
			50 = { #Success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = {
					has_trait = shrewd
					add = 10
				}
				modifier = {
					has_trait = scholar
					add = 10
				}
				send_interface_toast = {
					title = tgp_japan_decision.9401.a.toast.success
					left_icon = root
					add_trait = lifestyle_poet
					add_stress = minor_stress_gain
				}
			}

			50 = { #Failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = tgp_japan_decision.9401.a.toast.failure
					left_icon = root
					add_stress = medium_stress_gain
				}
			}
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_energy = 1
				ai_sociability = 1
			}
		}
	}

	#Opt out
	option = {
		name = tgp_japan_decision.9401.b

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
				ai_energy = -1
				ai_sociability = -1
			}
		}
	}
}

# tgp_japan_become_a_monk_decision - Becoming a Buddhist monk near the end of your life (or when you become seriously ill)
tgp_japan_decision.9500 = {
	type = character_event
	title = tgp_japan_decision.9500.t
	desc = tgp_japan_decision.9500.desc
	theme = faith
	left_portrait = {
		character = root
		animation = personality_zealous
	}

	option = {
		name = tgp_japan_decision.9500.a
		add_trait = devoted
		tgp_renounce_estate_effect = yes
	}
}

# tgp_japan_establish_soryo_administration_decision

tgp_japan_decision.9601 = {
	type = character_event
	hidden = yes

	immediate = {
		save_scope_as = daijo_daijin
		# Inform Vassals
		every_vassal = {
			limit = {
				highest_held_title_tier >= tier_county
				is_landed = yes
				# Exclude members of bloc, allies, prisoners
				NOR = {
					house.house_confederation ?= scope:daijo_daijin.house.house_confederation
					is_allied_to = scope:daijo_daijin
					is_imprisoned_by = scope:daijo_daijin
				}
			}
			trigger_event = tgp_japan_decision.9602
		}
		# After AI decisions
		trigger_event = {
			id = tgp_japan_decision.9604
			delayed = yes
		}
	}
}

tgp_japan_decision.9602 = { # Vassal AI event
	type = character_event
	hidden = yes

	trigger = { is_ai = yes }

	on_trigger_fail = { # Create player list to handle separately
		save_temporary_scope_as = war_joiner_temp
		scope:daijo_daijin = {
			add_to_variable_list = {
				name = war_players
				target = scope:war_joiner_temp
				months = 1
			}
		}
	}

	immediate = {
		random_list = {
			20 = { # Join war
				trigger = {
					# Only bloc leaders join
					trigger_if = {
						limit = { exists = house.house_confederation.leading_house }
						is_house_head = yes
						house.house_confederation.leading_house ?= house
					}
					trigger_else = { always = yes }
				}
				modifier = {
					add = 15
					is_house_head = yes
					house.house_confederation.leading_house ?= house
				}
				modifier = {
					add = 15
					house = { has_house_aspiration_parameter = unlocks_japanese_manor_archive }
				}
				modifier = {
					add = 15
					house = { has_house_aspiration_parameter = ceremony_cheaper_feasts }
				}
				modifier = {
					add = 30
					has_relation_rival = scope:daijo_daijin
				}
				modifier = {
					add = 30
					house = {
						any_house_relation = {
							has_house_relation_level = feud
							any_relation_house = { this = scope:daijo_daijin.house }
						}
					}
				}
				modifier = {
					add = 20
					house = {
						any_house_relation = {
							has_house_relation_level = rivalry
							any_relation_house = { this = scope:daijo_daijin.house }
						}
					}
				}
				modifier = {
					add = 10
					house = {
						any_house_relation = {
							has_house_relation_level = quarrel
							any_relation_house = { this = scope:daijo_daijin.house }
						}
					}
				}
				modifier = {
					add = 15
					government_allows = administrative
				}
				save_temporary_scope_as = war_joiner_temp
				scope:daijo_daijin = {
					add_to_variable_list = {
						name = war_joiners
						target = scope:war_joiner_temp
						months = 1
					}
				}
				if = {
					limit = {
						is_house_head = yes
						house.house_confederation.leading_house ?= house
					}
					top_liege = {
						every_vassal = {
							limit = {
								highest_held_title_tier > tier_barony
								house.house_confederation ?= root.house.house_confederation
							}
							save_temporary_scope_as = war_joiner_temp
							scope:daijo_daijin = {
								add_to_variable_list = {
									name = war_joiners
									target = scope:war_joiner_temp
									months = 1
								}
							}
						}
					}
				}
			}
			10 = { # Don't join war
				opinion_modifier = {
					opinion_target = scope:daijo_daijin
					multiplier = -0.1
				}
				ai_value_modifier = {
					ai_boldness = -0.1
				}
				modifier = {
					add = 30
					house = {
						any_house_relation = {
							has_house_relation_level = amity
							any_relation_house = { this = scope:daijo_daijin.house }
						}
					}
				}
				modifier = {
					add = 20
					house = {
						any_house_relation = {
							has_house_relation_level = friendly
							any_relation_house = { this = scope:daijo_daijin.house }
						}
					}
				}
				modifier = {
					add = 10
					house = {
						any_house_relation = {
							has_house_relation_level = cordial
							any_relation_house = { this = scope:daijo_daijin.house }
						}
					}
				}
			}
		}
	}
}

tgp_japan_decision.9603 = { # Vassal player event
	type = character_event
	title = tgp_japan_decision.9603.t
	desc = {
		desc = tgp_japan_decision.9603.desc
		triggered_desc = {
			trigger = { exists = scope:leader }
			desc = tgp_japan_decision.9603.leader
		}
	}
	theme = war

	left_portrait = {
		character = scope:daijo_daijin
		animation = japanese_war_fan
	}
	lower_left_portrait = scope:leader
	lower_center_portrait = scope:portrait_1
	lower_right_portrait = scope:portrait_2

	trigger = {
		is_ai = no
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_become_japanese_shogun"
		show_as_tooltip = {
			scope:daijo_daijin = {
				custom_description_no_bullet = { text = if_you_win_effect }
				show_as_tooltip = { japanese_establish_soryo_administration_reward_effect = yes }
			}
		}
	}

	option = {
		name = {
			text = tgp_japan_decision.9603.a.bloc
			trigger = { house.house_confederation.leading_house ?= house }
		}
		name = {
			text = tgp_japan_decision.9603.a
			trigger = {
				NOT = { house.house_confederation.leading_house ?= house }
			}
		}
		hidden_effect = {
			if = {
				limit = { is_defender_in_war = scope:war }
				scope:war = { remove_participant = root }
			}
		}
		scope:war = { add_attacker = root }
		if = {
			limit = {
				is_house_head = yes
				house.house_confederation.leading_house = root.house
			}
			custom_tooltip = tgp_japan_decision.9603.a.tt
			hidden_effect = {
				top_liege = {
					every_vassal = {
						limit = {
							NOT = { this = root }
							highest_held_title_tier > tier_barony
							house.house_confederation ?= root.house.house_confederation
						}
						save_temporary_scope_as = war_joiner_temp
						if = {
							limit = {
								exists = scope:war
								is_defender_in_war = scope:war
							}
							scope:war = { remove_participant = scope:war_joiner_temp }
						}
						scope:war ?= { add_attacker = scope:war_joiner_temp }
					}
				}
			}
		}
	}

	option = {
		name = tgp_japan_decision.9603.b
	}
}

tgp_japan_decision.9604 = { # War setup
	type = character_event
	hidden = yes

	immediate = {
		if = {
			limit = { any_in_list = { variable = war_joiners } }
			# Find bloc leaders
			every_in_list = {
				variable = war_joiners
				limit = {
					is_house_head = yes
					house.house_confederation.leading_house ?= house # Prefer Bloc Leaders
				}
				add_to_list = bloc_leaders
			}
			# Find bloc leader as war leader, and power portraits
			ordered_in_list = {
				list = bloc_leaders
				order_by = {
					value = 0
					# TODO_CD_TGP_JP AWAITING CODE SUPPORT
					#add = tgp_confederation_military_power
				}
				max = 3
				if = {
					limit = { exists = scope:portrait_1 }
					save_scope_as = portrait_2
				}
				else_if = {
					limit = { exists = scope:leader }
					save_scope_as = portrait_1
				}
				else = { save_scope_as = leader }
			}
			# Find non bloc leader if necessary, or power portraits
			ordered_in_list = {
				variable = war_joiners
				order_by = {
					value = 0
					add = military_power
				}
				max = 3
				if = {
					limit = { exists = scope:portrait_1 }
					save_scope_as = portrait_2
				}
				else_if = {
					limit = { exists = scope:leader }
					save_scope_as = portrait_1
				}
				else_if = {
					limit = {
						NOT = { exists = scope:leader }
					}
					save_scope_as = leader
				}
			}
			# Start war
			scope:leader ?= {
				start_war = {
					cb = japan_establish_soryo_administration_cb
					target = scope:daijo_daijin
				}
				random_character_war = {
					limit = {
						primary_attacker = scope:leader
						primary_defender = scope:daijo_daijin
						using_cb = japan_establish_soryo_administration_cb
					}
					save_scope_as = war
				}
			}
			# Counter for other joiners
			set_variable = {
				name = other_joiners_count
				value = 0
			}
			# Add other participants
			every_in_list = {
				variable = war_joiners
				limit = { NOT = { this = scope:leader } }
				save_temporary_scope_as = war_joiner_temp
				if = {
					limit = {
						exists = scope:war
						is_defender_in_war = scope:war
					}
					scope:war = { remove_participant = scope:war_joiner_temp }
				}
				scope:war ?= { add_attacker = scope:war_joiner_temp }
				if = {
					limit = {
						is_house_head = yes
						house.house_confederation.leading_house ?= house
					}
					add_to_list = bloc_leaders
				}
				else_if = {
					limit = { NOT = { exists = house.house_confederation } }
					add_to_list = other_joiners
					root = {
						change_variable = {
							name = other_joiners_count
							add = 1
						}
					}
				}
			}
		}
		trigger_event = {
			id = tgp_japan_decision.9605
			delayed = yes
		}
	}
}

tgp_japan_decision.9605 = { # War start event
	type = character_event
	title = {
		desc = {
			first_valid = {
				triggered_desc = {
					trigger = { exists = scope:war }
					desc = tgp_japan_decision.9605.t
				}
				desc = tgp_japan_decision.9606.t
			}
		}
	}
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:war }
				desc = tgp_japan_decision.9605.desc
			}
			desc = tgp_japan_decision.9605.peace
		}
	}
	theme = war

	left_portrait = {
		character = scope:daijo_daijin
		animation = japanese_war_fan
	}
	lower_left_portrait = scope:leader
	lower_center_portrait = scope:portrait_1
	lower_right_portrait = scope:portrait_2

	immediate = {
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_become_japanese_shogun"
		add_character_flag = wear_armor
		if = {
			limit = { exists = scope:leader }
			# Start war
			if = {
				limit = { any_in_list = { list = bloc_leaders } }
				every_in_list = {
					list = bloc_leaders
					custom_tooltip = tgp_establish_soryo_administration_bloc_leaders_tt
				}
			}
			# Tooltip
			if = {
				limit = { any_in_list = { list = other_joiners } }
				custom_tooltip = tgp_establish_soryo_administration_other_joiners_tt
			}
		}
		else = { japanese_establish_soryo_administration_reward_effect = yes }
	}

	option = {
		name = tgp_japan_decision.9605.a
		trigger = { exists = scope:war }
		show_as_tooltip = {
			custom_description_no_bullet = { text = if_you_win_effect }
			show_as_tooltip = { japanese_establish_soryo_administration_reward_effect = yes }
		}
	}

	option = {
		name = tgp_japan_decision.9605.b
		trigger = {
			NOT = { exists = scope:war }
		}
		japanese_establish_soryo_administration_reward_effect = yes
		every_player = {
			limit = {
				top_liege = scope:daijo_daijin
				NOT = { this = scope:daijo_daijin }
			}
			trigger_event = tgp_japan_decision.9607
		}
	}

	after = {
		remove_character_flag = wear_armor
		if = {
			limit = { exists = scope:leader }
			every_in_list = {
				variable = war_players
				trigger_event = tgp_japan_decision.9603
			}
		}
		remove_variable = other_joiners_count
	}
}

tgp_japan_decision.9606 = { # War won event
	type = character_event
	title = tgp_japan_decision.9606.t
	desc = tgp_japan_decision.9606.desc
	theme = war

	left_portrait = {
		character = scope:daijo_daijin
		animation = japanese_war_fan
	}
	right_portrait = {
		character = scope:leader
		triggered_animation = {
			trigger = { is_imprisoned = yes }
			animation = prisonhouse
		}
		animation = war_over_loss
		override_imprisonment_visuals = yes
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_become_japanese_shogun"
		japanese_establish_soryo_administration_reward_effect = yes
	}

	option = {
		name = tgp_japan_decision.9606.a
	}

	after = {
		every_player = {
			limit = {
				top_liege = scope:daijo_daijin
				NOT = { this = scope:daijo_daijin }
			}
			trigger_event = tgp_japan_decision.9607
		}
	}
}

tgp_japan_decision.9607 = { # War won vassal event
	type = character_event
	title = tgp_japan_decision.9606.t
	desc = tgp_japan_decision.9607.desc
	theme = war

	left_portrait = {
		character = scope:daijo_daijin
		animation = war_over_win
	}
	right_portrait = {
		character = scope:leader
		triggered_animation = {
			trigger = { is_imprisoned = yes }
			animation = prisonhouse
		}
		animation = war_over_loss
		override_imprisonment_visuals = yes
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_become_japanese_shogun"
		show_as_tooltip = { japanese_establish_soryo_administration_reward_effect = yes }
	}

	option = {
		name = tgp_japan_decision.9607.a
	}
}

# tgp_japan_restore_japanese_monarchy_decision

tgp_japan_decision.9901 = {
	type = character_event
	title = tgp_japan_decision.9901.t
	desc = tgp_japan_decision.9901.desc
	theme = realm
	left_portrait = {
		character = scope:kampaku
		triggered_animation = {
			trigger = { this = scope:scion }
			animation = war_over_tie
		}
		animation = throne_room_bow_1
	}
	right_portrait = {
		character = scope:scion
		animation = war_over_tie
		trigger = { this != scope:kampaku }
	}
	override_background = { reference = throne_room_scope }

	immediate = {
		play_music_cue = "mx_cue_sacredrite"
		show_as_tooltip = { tgp_restore_japanese_monarchy_decision_effect = yes }
		tgp_restore_japanese_monarchy_yamato_restoration_effect = yes
		every_player = {
			limit = { is_vassal_or_below_of = root }
			trigger_event = tgp_japan_decision.9902
		}
	}

	option = { # Rule as Regent
		name = {
			trigger = { this = scope:scion }
			text = tgp_japan_decision.9901.a
		}
		name = {
			trigger = { this != scope:scion }
			text = tgp_japan_decision.9901.a.scion
		}
	}
}

tgp_japan_decision.9902 = {
	type = character_event
	title = tgp_japan_decision.9901.t
	desc = tgp_japan_decision.9902.desc
	theme = family
	left_portrait = {
		character = scope:kampaku
		triggered_animation = {
			trigger = { this = scope:scion }
			animation = war_over_tie
		}
		animation = throne_room_bow_1
	}
	right_portrait = {
		character = scope:scion
		animation = war_over_tie
		trigger = { this != scope:kampaku }
	}
	override_background = { reference = throne_room_scope }

	immediate = {
		play_music_cue = "mx_cue_sacredrite"
		show_as_tooltip = {
			scope:kampaku = {
				tgp_restore_japanese_monarchy_decision_effect = yes
				tgp_restore_japanese_monarchy_yamato_restoration_effect = yes
			}
		}
	}

	option = { # Long live the Emperor
		name = tgp_japan_decision.9902.a
	}
}

# tgp_japan_restore_japanese_government_decision

tgp_japan_decision.9911 = {
	type = character_event
	title = tgp_japan_decision.9911.t
	desc = {
		desc = tgp_japan_decision.9911.desc
		triggered_desc = {
			trigger = { exists = scope:rebel }
			desc = tgp_japan_decision.9911.rebel
		}
	}
	theme = crown
	left_portrait = {
		character = scope:kampaku
		animation = chaplain
	}
	right_portrait = {
		character = scope:ceremonial_liege
		animation = holding_hu
	}
	lower_right_portrait = scope:rebel
	override_background = { reference = throne_room_scope }

	immediate = {
		tgp_save_realm_ceremonial_liege_effect = yes
		tgp_restore_japanese_government_decision_effect = yes
	}

	option = { # Yay
		name = tgp_japan_decision.9911.a
	}
}

tgp_japan_decision.9912 = {
	type = character_event
	title = tgp_japan_decision.9911.t
	desc = {
		desc = tgp_japan_decision.9912.desc
		triggered_desc = {
			trigger = { exists = scope:rebel }
			desc = tgp_japan_decision.9912.rebel
		}
	}
	theme = realm
	left_portrait = {
		character = scope:kampaku
		animation = war_over_tie
	}
	override_background = { reference = throne_room_scope }

	trigger = {
		NOT = { is_at_war_with = scope:kampaku }
	}

	immediate = {
		show_as_tooltip = {
			scope:kampaku = { tgp_restore_japanese_government_decision_effect = yes }
		}
	}

	option = { # Yay
		name = tgp_japan_decision.9911.a
		if = {
			limit = {
				NOT = { has_government = japan_administrative_government }
			}
			change_government = japan_administrative_government
		}
	}

	option = { # Boo
		name = tgp_japan_decision.9912.b
		trigger = {
			is_ai = no
			NOR = {
				is_at_war_with = scope:kampaku
				has_government = japan_administrative_government
			}
		}
		every_in_list = {
			list = war_to_join
			limit = {
				NOT = { is_defender = root }
			}
			hidden_effect = { set_called_to = root }
			add_attacker = root
		}
		reverse_add_opinion = {
			target = scope:kampaku
			modifier = rebellious_vassal_opinion
		}
	}
}

#Player called to war by rebellious vassal. (vs imprisonment)
tgp_japan_decision.9913 = {
	type = letter_event
	opening = {
		desc = call_ally.0100.opening
	}
	desc = tgp_japan_decision.9913.desc

	sender = {
		character = scope:recipient
		animation = anger
	}

	option = {
		name = tgp_japan_decision.9913.a
		scope:recipient = {
			every_character_war = {
				limit = {
					using_cb = japan_refused_ritsuryo_cb
					casus_belli = {
						primary_attacker = scope:recipient
						primary_defender = scope:actor
					}
				}
				hidden_effect = { set_called_to = root }
				add_attacker = root
			}
			scope:recipient = {
				add_opinion = {
					target = root
					modifier = helped_me_against_tyrant_opinion
				}
			}
		}
	}
	option = {
		name = tgp_japan_decision.9913.b
		scope:recipient = {
			add_opinion = {
				target = root
				modifier = sided_with_tyrant_opinion
			}
		}
	}
}
scripted_trigger dominion_fight = {
	exists = scope:main_defender
	NOT = {
		any_in_list = {
			list = potential_vassals
		}
	}
}
scripted_trigger dominion_fight_partial = {
	exists = scope:main_defender
	any_in_list = {
		list = potential_vassals
	}
}
#Assert Regional Dominion
#tgp_japan_decision.9960
tgp_japan_decision.9960 = {
	type = character_event
	window = big_event_window
	title = tgp_japan_decision.9960.t
	desc = {
		desc = tgp_japan_decision.9960.intro
		first_valid = {
			#de jure vassals agree to let you be duke
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:main_defender }
				}
				desc = tgp_japan_decision.9960.agree
			}
			#some de jure vassals agree to let you be duke, some will fight you
			triggered_desc = {
				trigger = { dominion_fight_partial = yes }
				desc = tgp_japan_decision.9960.partial_war
			}
			#all jure vassals will fight you
			desc = tgp_japan_decision.9960.full_war
		}
	}
	theme = battle
	override_icon = {
		trigger = { dominion_fight = no }
		reference = "gfx/interface/icons/event_types/type_authority.dds"
	}
	override_icon = {
		trigger = { dominion_fight = yes }
		reference ="gfx/interface/icons/event_types/type_war.dds"
	}
	override_header_background = {
		trigger = { dominion_fight = yes }
		reference = "gfx/interface/window_event/event_header_red.dds"
	}
	override_sound = {
		trigger = { dominion_fight = no }
		reference = "event:/SFX/Events/Themes/sfx_event_theme_type_diplomacy"
	}
	left_portrait = {
		character = scope:super_soryo
		triggered_animation = {
			trigger = {
				is_adult = yes
				dominion_fight = yes
				can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
			}
			#it's war!
			animation = gedan_no_kamae
		}
		#it's not war!
		animation = personality_content
	}
	right_portrait = { #main defender
		character = scope:main_defender
		camera = camera_event_right_crowner_crowning
	}
	override_background = {
		trigger = { dominion_fight = yes }
		#it's war!
		reference = army_camp
	}
	override_background = {	reference = bp1_crossroads_inn }
	override_effect_2d = {
		trigger = { dominion_fight = no }
		reference = legend_glow
	}
	immediate = {
		if = {
			limit = {
				is_adult = yes
				can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
			}
			add_character_flag = {
				flag = wear_armor
				days = 1
			}
		}
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_become_japanese_shogun"

		tgp_japan_assert_regional_dominion_government_decision_effect = yes
	}
	#fight
	option = {
		trigger = { dominion_fight = yes }
		name = tgp_japan_decision.9960.a
	}
	#no fight
	option = {
		trigger = { dominion_fight = no }
		name = tgp_japan_decision.9960.b
	}
	after = {
		remove_character_flag = wear_armor
	}
}
#winner follow up
tgp_japan_decision.9961 = {
	type = character_event
	window = big_event_window
	title = tgp_japan_decision.9961.t
	desc = tgp_japan_decision.9961.desc
	theme = battle
	override_icon = {
		trigger = { dominion_fight = yes }
		reference ="gfx/interface/icons/event_types/type_hunt.dds"
	}
	override_header_background = { reference = "gfx/interface/window_event/header_neutral.dds" }
	left_portrait = {
		character = scope:winner
		triggered_animation = {
			trigger = {
				is_adult = yes
				can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
			}
			animation = japanese_war_fan
		}
		animation = personality_content
	}
	override_background = { reference = battlefield }
	override_effect_2d = { reference = legend_glow }
	immediate = {
		play_sound_effect = "event:/DLC/EP4/SFX/Stingers/Japan/tgp_mx_sting_become_japanese_shogun"
		if = {
			limit = {
				is_adult = yes
				can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
			}
			add_character_flag = {
				flag = wear_armor
				days = 1
			}
		}
		scope:title_scope = { tgp_japan_assert_regional_dominance_war_outcome_effect = yes }
	}
	#you won, enjoy
	option = {
		name = tgp_japan_decision.9961.a
	}
	after = {
		remove_character_flag = wear_armor
	}
}
#loser follow up
tgp_japan_decision.9962 = {
	type = character_event
	window = big_event_window
	title = tgp_japan_decision.9962.t
	desc = tgp_japan_decision.9962.desc
	theme = battle
	override_icon = {
		trigger = { dominion_fight = yes }
		reference ="gfx/interface/icons/event_types/type_hunt.dds"
	}
	override_header_background = { reference = "gfx/interface/window_event/header_neutral.dds" }
	left_portrait = {
		character = scope:loser
		animation = shame
	}
	#main defender
	right_portrait = {
		character = scope:winner
		animation = war_over_win
	}
	override_background = {
		reference = battlefield
	}
	override_effect_2d = {
		reference = rain
	}
	immediate = {
		play_music_cue = "mx_cue_general_crusade_event_3"
	}
	#you lost, enjoy
	option = {
		name = tgp_japan_decision.9962.a
	}
}
#letter event
tgp_japan_decision.9963 = {
	type = letter_event
	opening = tgp_japan_decision.9963.opening
	desc = tgp_japan_decision.9963.desc
	sender = scope:super_soryo
	#decline war
	option = {
		name = tgp_japan_decision.9963.a
		play_music_cue = mx_cue_combat_stinger
		custom_tooltip = tgp_japan_decision.9963.a.tt
	}
	#join war
	option = {
		name = tgp_japan_decision.9963.b
		scope:super_soryo_war = {
			add_defender = root
			hidden_effect = {
				set_called_to = root
			}
		}
	}
}
