﻿#dynamically changes title flags to match holder's House CoA
dynamic_coa_effect = {
	if = {
		every_held_title = {
			limit = {
				holder = prev
				NOR = {
					this = title:e_the_iron_throne
					is_holy_order = yes
					is_mercenary_company = yes
					is_head_of_faith = yes
					
				}
			}
			set_coa = prev.house
		}
	}
	if = { #SUB KINGDOM GAME RULE
		limit = {
			has_game_rule = asoiaf_dynamic_coa_sub_kingdom
		}
		every_held_title = {
			limit = {
				holder = prev
				NOR = {
					is_holy_order = yes
					is_mercenary_company = yes
					is_head_of_faith = yes
					
					tier >= tier_kingdom
				}
			}
			set_coa = prev.house
		}
	}
	if = { #SUB DUCHY GAME RULE
		limit = {
			has_game_rule = asoiaf_dynamic_coa_sub_duchy
		}
		every_held_title = {
			limit = {
				holder = prev
				NOR = {
					is_holy_order = yes
					is_mercenary_company = yes
					is_head_of_faith = yes
					
					tier >= tier_duchy
				}
			}
			set_coa = prev.house
		}
	}
}