#Triggers to control Coat of Arms weighting

coa_african_trigger = {
	OR = {
		coa_african_culture_trigger = yes
		coa_african_religion_trigger = yes
	}
}

coa_african_culture_trigger = {
	scope:culture = {
		OR = {
			has_coa_gfx = central_african_group_coa_gfx
			has_coa_gfx = east_african_coa_gfx
			has_coa_gfx = west_african_group_coa_gfx
		}
	}
}

coa_african_religion_trigger = {
#	scope:faith.religion = { 
#		save_temporary_scope_as = religion 
#	}
	always = no
#	scope:religion = {
#		OR = {
#			this = religion:akom_religion
#			this = religion:waaqism_religion
#			this = religion:west_african_religion
#			this = religion:west_african_bori_religion
#			this = religion:west_african_orisha_religion
#		this = religion:west_african_roog_religion
#		}
#	}
}

coa_bishopric_trigger = {
	NEOW_is_broadly_catholic_trigger = yes
	coa_theocratic_trigger = yes
}

coa_breton_trigger = {
	OR = {
		scope:culture = { has_coa_gfx = breton_coa_gfx }
		scope:title ?= {
			any_this_title_or_de_jure_above = {
				this = title:k_brittany
			}
		}
	}
}

coa_byzantine_trigger = {
	OR = {
		scope:culture = { has_coa_gfx = byzantine_group_coa_gfx }
#		scope:title ?= {
#			any_this_title_or_de_jure_above = {
#				this = title:e_byzantium
#			}
#		}
	}
}

coa_castilian_trigger = {
	OR = {
		scope:culture = { has_coa_gfx = castilian_coa_gfx }
		scope:title ?= {
			any_this_title_or_de_jure_above = {
				this = title:k_castille
			}
		}
	}
}

coa_coptic_trigger = {
	always = no
#	OR = {
#		scope:faith = faith:coptic
#	}
}

coa_cross_trigger = {
	scope:faith = {
		OR = { religion = religion:catholic_religion religion = religion:eastern_orthodox_religion religion = religion:protestant_religion }
		NOT = { has_doctrine = tenet_aniconism }
	}
}

coa_england_switches_to_france_coa_trigger = {
	always = no
#	holder = {
#		OR = {
#			has_title 		= title:k_france
#			has_claim_on 	= title:k_france
#			has_title 		= title:e_france
#			has_claim_on 	= title:e_france
#		}
#	}
}
coa_switch_to_norman_trigger = {
	always = no
#	holder.culture = {
#		OR = {
#			has_coa_gfx = english_coa_gfx
#			has_coa_gfx = frankish_group_coa_gfx
#			has_coa_gfx = latin_group_coa_gfx
#			has_coa_gfx = iberian_group_coa_gfx
#		}
#	}
}

coa_switch_to_norse_trigger = {
	holder = {
		NOT = {
			NEOW_religion_is_broadly_christian_trigger = no
		}
		OR = {
			faith.religion = religion:folkgerman_religion
			culture = { has_coa_gfx = norse_coa_gfx }
		}
	}
}

coa_feudal_trigger = {
	
	scope:faith.religion = {
		OR = {
			this = religion:catholic_religion
			this = religion:eastern_orthodox_religion
			this = religion:protestant_religion
		}
	}
	government_has_flag = government_is_feudal
}

coa_french_trigger = {
	OR = {
		scope:culture = { has_coa_gfx = french_coa_gfx }
		AND = {
			exists = root
			any_liege_or_above = {
				primary_title = {
					this = title:k_france
				}
			}
		}
	}
}

coa_irish_trigger = {
	OR = {
		scope:culture = { has_coa_gfx = irish_coa_gfx }
		scope:title ?= {
			any_this_title_or_de_jure_above = {
				this = title:k_ireland
			}
		}
	}
}


coa_indian_culture_trigger = {
	scope:culture = {
		OR = {
			has_coa_gfx = burman_group_coa_gfx
			has_coa_gfx = dravidian_group_coa_gfx
			has_coa_gfx = indo_aryan_group_coa_gfx
			has_coa_gfx = tibetan_group_coa_gfx
		}
	}
}
coa_indian_region_trigger = {
	exists = scope:title
	scope:title = {
		is_landless_type_title = no
		title_province ?= { geographical_region = world_india }
	}
}
coa_indian_religion_trigger = {
	scope:faith.religion = { 
		save_temporary_scope_as = religion 
	}
	scope:religion = {
		OR = {
			this = { is_in_family = rf_eastern }
#			this = religion:bon_religion
			this = religion:buddhism_religion
#			this = religion:hinduism_religion
#			this = religion:jainism_religion
		}
	}
}
coa_indian_trigger = {
	OR = {
		coa_indian_culture_trigger = yes
		coa_indian_region_trigger = yes
		coa_indian_religion_trigger = yes
	}
	scope:culture = { has_graphical_east_asia_culture_group_trigger = no }
}

coa_jewish_trigger = {
	OR = {
		scope:faith.religion = religion:judaism_religion
		scope:culture = { has_coa_gfx = israelite_group_coa_gfx }
	}
}

coa_leonese_trigger = {
	OR = {
		scope:culture = { has_coa_gfx = leonese_coa_gfx }
		scope:title ?= {
			any_this_title_or_de_jure_above = {
				this = title:k_leon
			}
		}
	}
}

coa_manx_trigger = {
	OR = {
		scope:title ?= {
			any_this_title_or_de_jure_above = {
				this = title:d_the_isles # Mann
			}
		}
		AND = {
			exists = root
			any_liege_or_above = {
				primary_title = {
					OR = {
						this = title:c_isle_of_man
						this = title:d_the_isles # Mann
					}
				}
			}
		}
	}
}

coa_mena_trigger = {
	OR = {
		scope:faith.religion = religion:islam_religion
		scope:culture = {
			OR = {
				has_coa_gfx = arabic_group_coa_gfx
				has_coa_gfx = berber_group_coa_gfx
			}
		}
	}
}

coa_suomenusko_trigger = {
	OR = {
		scope:faith.religion = religion:finnic_religion
		scope:culture = {
			OR = {
				has_coa_gfx = balto_finnic_group_coa_gfx
				has_coa_gfx = ugro_permian_group_coa_gfx
				has_coa_gfx = volga_finnic_group_coa_gfx
			}
		}
	}
}

coa_polish_trigger = {
	OR = {
		scope:culture = { has_coa_gfx = polish_coa_gfx }
		AND = {
			exists = root
			any_liege_or_above = {
				primary_title = {
					this = title:k_poland
				}
			}
		}
	}
}

coa_scottish_trigger = {
	OR = {
		scope:culture = { has_coa_gfx = scottish_coa_gfx }
		scope:title ?= {
			any_this_title_or_de_jure_above = {
				this = title:k_scotland
			}
		}
	}
}

coa_theocratic_trigger = {
	exists = root
	OR = {
		government_has_flag = government_is_theocracy
		is_theocratic_lessee = yes
	}
}

coa_welsh_trigger = {
	scope:culture = { has_coa_gfx = welsh_coa_gfx }
}

coa_tamga_trigger = {
	scope:culture = { has_coa_gfx = steppe_coa_gfx }
}

coa_scandinavian_trigger = {
	scope:culture = {
		OR = {
			has_coa_gfx = swedish_coa_gfx
			has_coa_gfx = norwegian_coa_gfx
			has_coa_gfx = danish_coa_gfx
		}
	}
}

coa_norse_trigger = {
	scope:culture = { has_coa_gfx = norse_coa_gfx }
}

coa_germanic_trigger = {
	scope:culture = { has_coa_gfx = german_group_coa_gfx }
}

coa_iberian_trigger = {
	OR = {
		scope:culture = { has_coa_gfx = iberian_group_coa_gfx }
		AND = {
			scope:culture = { has_coa_gfx = arabic_group_coa_gfx }
			scope:title ?= {
				OR = {
					this = title:e_spain
					empire ?= title:e_spain
				}
			}
		}
	}
}

coa_iranian_trigger = {
	scope:culture = { has_coa_gfx = iranian_group_coa_gfx }
}

has_recognizable_chinese_seal = {
	trigger_if = {
		limit = { exists = scope:title }
		scope:title = { is_noble_family_title = yes }
	}
	house ?= {
		OR = {
			### CHINESE ###
			has_base_name = "dynn_Bai_767D"
			has_base_name = "dynn_Cai_8521"
			has_base_name = "dynn_Cao_66F9"
			has_base_name = "dynn_Chen_9673"
			has_base_name = "dynn_Cheng_7A0B"
			has_base_name = "dynn_Cui_5D14"
			has_base_name = "dynn_Da_5927"
			has_base_name = "dynn_Dai_6234"
			has_base_name = "dynn_Deng_9127"
			has_base_name = "dynn_Ding_4E01"
			has_base_name = "dynn_Dong_8463"
			has_base_name = "dynn_Du_675C"
			has_base_name = "dynn_Duan_6BB5"
			has_base_name = "dynn_Fan_8303"
			has_base_name = "dynn_Fang_65B9"
			has_base_name = "dynn_Feng_99AE"
			has_base_name = "dynn_Fu_5085"
			has_base_name = "dynn_Gao_9AD8"
			has_base_name = "dynn_Gong_9F94"
			has_base_name = "dynn_Gu_9867"
			has_base_name = "dynn_Guo_90ED"
			has_base_name = "dynn_Han_97D3"
			has_base_name = "dynn_Hao_90DD"
			has_base_name = "dynn_He_4F55"
			has_base_name = "dynn_He_8CC0"
			has_base_name = "dynn_Hou_4FAF"
			has_base_name = "dynn_Hu_80E1"
			has_base_name = "dynn_Huang_9EC3"
			has_base_name = "dynn_Jia_8CC8"
			has_base_name = "dynn_Jiang_59DC"
			has_base_name = "dynn_Jiang_6C5F"
			has_base_name = "dynn_Jiang_8523"
			has_base_name = "dynn_Jin_91D1"
			has_base_name = "dynn_Kong_5B54"
			has_base_name = "dynn_Lei_96F7"
			has_base_name = "dynn_Li_674E"
			has_base_name = "dynn_Li_9ECE"
			has_base_name = "dynn_Liang_6881"
			has_base_name = "dynn_Liao_5ED6"
			has_base_name = "dynn_Liao_907C"
			has_base_name = "dynn_Lin_6797"
			has_base_name = "dynn_Liu_5289"
			has_base_name = "dynn_Long_9F8D"
			has_base_name = "dynn_Lu_5442"
			has_base_name = "dynn_Lu_76E7"
			has_base_name = "dynn_Lu_9678"
			has_base_name = "dynn_Luo_7F85"
			has_base_name = "dynn_Ma_99AC"
			has_base_name = "dynn_Mao_6BDB"
			has_base_name = "dynn_Meng_5B5F"
			has_base_name = "dynn_Meng_8499"
			has_base_name = "dynn_Mo_83AB"
			has_base_name = "dynn_Nan_5357"
			has_base_name = "dynn_Nangong_5357"
			has_base_name = "dynn_Ou_6B50"
			has_base_name = "dynn_Pan_6F58"
			has_base_name = "dynn_Peng_5F6D"
			has_base_name = "dynn_Po_6734"
			has_base_name = "dynn_Qian_9322"
			has_base_name = "dynn_Qin_79E6"
			has_base_name = "dynn_Qiu_90B1"
			has_base_name = "dynn_Quan_6B0A"
			has_base_name = "dynn_Ren_4EFB"
			has_base_name = "dynn_Shan_55AE"
			has_base_name = "dynn_Shao_90B5"
			has_base_name = "dynn_Shen_6C88"
			has_base_name = "dynn_Shi_53F2"
			has_base_name = "dynn_Shi_77F3"
			has_base_name = "dynn_Situ_53F8_5F92"
			has_base_name = "dynn_Song_5B8B"
			has_base_name = "dynn_Su_8607"
			has_base_name = "dynn_Sun_5B6B"
			has_base_name = "dynn_Tan_8983"
			has_base_name = "dynn_Tan_8B5A"
			has_base_name = "dynn_Tang_5510"
			has_base_name = "dynn_Tao_9676"
			has_base_name = "dynn_Tian_7530"
			has_base_name = "dynn_Wan_842C"
			has_base_name = "dynn_Wang_6C6A"
			has_base_name = "dynn_Wang_738B"
			has_base_name = "dynn_Wei_97CB"
			has_base_name = "dynn_Wei_9B4F"
			has_base_name = "dynn_Wen_6587"
			has_base_name = "dynn_Wu_5433"
			has_base_name = "dynn_Wu_6B66"
			has_base_name = "dynn_Xia_590F"
			has_base_name = "dynn_Xiang_5411"
			has_base_name = "dynn_Xiao_856D"
			has_base_name = "dynn_Xie_8B1D"
			has_base_name = "dynn_Xie_90aa"
			has_base_name = "dynn_Xi_897F"
			has_base_name = "dynn_Xin_8F9B"
			has_base_name = "dynn_Xiong_718A"
			has_base_name = "dynn_Xu_5F90"
			has_base_name = "dynn_Xu_8A31"
			has_base_name = "dynn_Xue_859B"
			has_base_name = "dynn_Yan_56B4"
			has_base_name = "dynn_Yan_95BB"
			has_base_name = "dynn_Yang_694A"
			has_base_name = "dynn_Yao_59DA"
			has_base_name = "dynn_Ye_8449"
			has_base_name = "dynn_Yin_5C39"
			has_base_name = "dynn_Yu_4E8E"
			has_base_name = "dynn_Yu_4F59"
			has_base_name = "dynn_Yuan_8881"
			has_base_name = "dynn_Yue_8D8A"
			has_base_name = "dynn_Zeng_66FE"
			has_base_name = "dynn_Zhang_5F35"
			has_base_name = "dynn_Zhao_8A54"
			has_base_name = "dynn_Zhao_8D99"
			has_base_name = "dynn_Zheng_912D"
			has_base_name = "dynn_Zhong_937E"
			has_base_name = "dynn_Zhou_5468"
			has_base_name = "dynn_Zhu_6731"
			has_base_name = "dynn_Zou_9112"
			### KOREAN/BALHAE ###
			has_base_name = "dynn_An_694A"
			has_base_name = "dynn_Baek_767D"
			has_base_name = "dynn_Bak_6734"
			has_base_name = "dynn_Chae_8521"
			has_base_name = "dynn_Choe_5D14"
			has_base_name = "dynn_Dae_5927"
			has_base_name = "dynn_Du_675C_KO"
			has_base_name = "dynn_Gang_59DC"
			has_base_name = "dynn_Gim_91D1"
			has_base_name = "dynn_Go_9AD8"
			has_base_name = "dynn_Gwak_90ED"
			has_base_name = "dynn_Gwon_6B0A"
			has_base_name = "dynn_Ha_590F"
			has_base_name = "dynn_Ha_8CC0"
			has_base_name = "dynn_Han_97D3_KO"
			has_base_name = "dynn_I_674E"
			has_base_name = "dynn_Im_4EFB"
			has_base_name = "dynn_Jang_5F35"
			has_base_name = "dynn_Jeong_912D"
			has_base_name = "dynn_Jo_8D99"
			has_base_name = "dynn_Ju_5468"
			has_base_name = "dynn_Ju_6731"
			has_base_name = "dynn_Ma_99AC_KO"
			has_base_name = "dynn_Mun_6587"
			has_base_name = "dynn_O_5433"
			has_base_name = "dynn_Pung_99AE"
			has_base_name = "dynn_Ra_7F85"
			has_base_name = "dynn_Rim_6797"
			has_base_name = "dynn_Sa_53F2"
			has_base_name = "dynn_Seo_5F90"
			has_base_name = "dynn_Sin_8F9B"
			has_base_name = "dynn_Song_5B8B_KO"
			has_base_name = "dynn_Wang_738B_KO"
			has_base_name = "dynn_Yang_6881"
			has_base_name = "dynn_Yang_694A_KO"
			has_base_name = "dynn_Yeo_5442"
			has_base_name = "dynn_Yu_5289"
			has_base_name = "dynn_Yun_5C39"
			### VIET ###
			has_base_name = "dynn_Bach_767D"
			has_base_name = "dynn_Cao_9AD8"
			has_base_name = "dynn_Chu_6731"
			has_base_name = "dynn_Dao_9676"
			has_base_name = "dynn_Dinh_4E01"
			has_base_name = "dynn_Doan_6BB5"
			has_base_name = "dynn_Dong_8463_VN"
			has_base_name = "dynn_Duong_694A"
			has_base_name = "dynn_Ha_4F55"
			has_base_name = "dynn_Ho_80E1"
			has_base_name = "dynn_Hoang_9EC3"
			has_base_name = "dynn_Lam_6797"
			has_base_name = "dynn_Le_9ECE"
			has_base_name = "dynn_Loi_96F7"
			has_base_name = "dynn_Luu_5289"
			has_base_name = "dynn_Ly_674E"
			has_base_name = "dynn_Mac_83AB"
			has_base_name = "dynn_Ngo_5433"
			has_base_name = "dynn_Phan_6F58"
			has_base_name = "dynn_Pham_8303"
			has_base_name = "dynn_Phung_99AE"
			has_base_name = "dynn_Quach_90ED"
			has_base_name = "dynn_Quyen_6B0A"
			has_base_name = "dynn_Ta_8B1D"
			has_base_name = "dynn_To_8607"
			has_base_name = "dynn_Ton_5B6B"
			has_base_name = "dynn_Tong_5B8B"
			has_base_name = "dynn_Tran_9673"
			has_base_name = "dynn_Trieu_8D99"
			has_base_name = "dynn_Trinh_912D"
			has_base_name = "dynn_Truong_5F35"
			has_base_name = "dynn_Van_6587"
			has_base_name = "dynn_Vu_6B66"
			has_base_name = "dynn_Vuong_738B"
		}
	}
}
