# These laws give the council more or less power over certain decisions

law_groups = {
	law_voting_power = {
		law_type = council
		allowed_for_councillors = yes
	}
	war_voting_power = {
		law_type = council
		allowed_for_councillors = yes
	}
	grant_title_voting_power = {
		law_type = council
		allowed_for_councillors = yes
	}
	revoke_title_voting_power = {
		law_type = council
		allowed_for_councillors = yes
	}
	imprison_voting_power = {
		law_type = council
		allowed_for_councillors = yes
	}
	banish_voting_power = {
		law_type = council
		allowed_for_councillors = yes
	}
	execution_voting_power = {
		law_type = council
		allowed_for_councillors = yes
	}
	succession_voting_power = {
		law_type = council
		allowed_for_councillors = yes
	}
}

laws = {
	# COUNCIL POWER LAWS
	##############################

	# VOTE ON LAW CHANGES
	law_voting_power_0 = {
		group = law_voting_power
		default = yes

		potential = {
			has_dlc = "Conclave"

			holder_scope = {
				is_playable = yes
			}

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_1
					has_law = tribal_organization_2
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		allow = {
			holder_scope = {
				show_scope_change = no

				trigger_if = {
					limit = { is_nomadic = yes }
					is_nomadic = no
				}
				trigger_else = {
					has_law = law_voting_power_1
					has_law = banish_voting_power_0
					has_law = revoke_title_voting_power_0
					has_law = grant_title_voting_power_0
					has_law = imprison_voting_power_0
					has_law = execution_voting_power_0
					has_law = war_voting_power_0

					trigger_if = {
						limit = { is_tribal = yes }
						has_law = tribal_organization_4
					}
				}
			}
		}

		pass_effect = {
			# log = "law_voting_power_0 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = law_voting_power_1
					is_primary_holder_title = yes
				}

				decreased_council_power_effect = yes
			}
		}

		effect = {
			# log = "law_voting_power_0 ([This.GetFullBaseName])"

			disable_council_voting_on_issue = laws

			custom_tooltip = {
				text = council_off_custom
				disable_council_voting_on_issue = enforce_peace
			}

			custom_tooltip = { text = tooltip_disables_advisors }
			revoke_law = law_voting_power_1
		}

		ai_will_do = {
			factor = 0.05
		}
	}

	law_voting_power_1 = {
		group = law_voting_power

		vassal_limit = 2

		potential = {
			is_law_potential = law_voting_power_0
		}

		allow = {
			has_law = law_voting_power_0

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_1
					has_law = tribal_organization_2
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		pass_effect = {
			# log = "law_voting_power_1 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = law_voting_power_0
					is_primary_holder_title = yes
				}

				increased_council_power_effect = yes
			}
		}

		effect = {
			# log = "law_voting_power_1 ([This.GetFullBaseName])"

			enable_council_voting_on_issue = laws

			custom_tooltip = {
				text = council_on_custom
				enable_council_voting_on_issue = enforce_peace
			}

			custom_tooltip = { text = tooltip_enables_advisors }
			revoke_law = law_voting_power_0
		}

		ai_will_do = {
			factor = 0
		}

		default_selection = {
			factor = 0

			additive_modifier = {
				value = 10

				holder_scope = {
					religion = catholic
					is_feudal = yes
				}

				year >= 850
			}

			additive_modifier = {
				value = 10

				OR = {
					title = e_hre
					title = e_byzantium
				}
			}

			additive_modifier = {
				value = 10

				holder_scope = {
					OR = {
						is_nomadic = yes
						is_tribal = yes
						is_republic = yes
					}
				}
			}
		}
	}

	# VOTE ON WAR
	war_voting_power_0 = {
		group = war_voting_power
		default = yes

		potential = {
			has_dlc = "Conclave"

			holder_scope = {
				is_playable = yes
			}

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_1
					has_law = tribal_organization_2
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		allow = {
			holder_scope = {
				trigger_if = {
					limit = { is_nomadic = yes }
					is_nomadic = no
				}
				trigger_else = {
					has_law = law_voting_power_1
					has_law = war_voting_power_1
					has_law = banish_voting_power_0
					has_law = revoke_title_voting_power_0
					has_law = grant_title_voting_power_0
					has_law = imprison_voting_power_0
					has_law = execution_voting_power_0

					trigger_if = {
						limit = { is_tribal = yes }
						has_law = tribal_organization_4
					}
				}
			}
		}

		pass_effect = {
			# log = "war_voting_power_0 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = war_voting_power_1
					is_primary_holder_title = yes
				}

				decreased_council_power_effect = yes
			}
		}

		effect = {
			# log = "war_voting_power_0 ([This.GetFullBaseName])"

			disable_council_voting_on_issue = declare_war_interaction
			custom_tooltip = { text = council_war_off_custom }
			revoke_law = war_voting_power_1
		}

		ai_will_do = {
			factor = 1
		}
	}

	war_voting_power_1 = {
		group = war_voting_power

		vassal_limit = 2

		potential = {
			is_law_potential = war_voting_power_0
		}

		allow = {
			has_law = law_voting_power_1
			has_law = war_voting_power_0

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_1
					has_law = tribal_organization_2
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		pass_effect = {
			# log = "war_voting_power_1 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = war_voting_power_0
					is_primary_holder_title = yes
				}

				increased_council_power_effect = yes
			}
		}

		effect = {
			# log = "war_voting_power_1 ([This.GetFullBaseName])"

			enable_council_voting_on_issue = declare_war_interaction
			custom_tooltip = { text = council_war_on_custom }
			revoke_law = war_voting_power_0
		}

		ai_will_do = {
			factor = 0
		}

		default_selection = {
			factor = 0

			additive_modifier = {
				value = 10

				holder_scope = {
					religion = catholic
					is_feudal = yes
				}

				year >= 900
			}

			additive_modifier = {
				value = 10
				title = e_hre
			}

			additive_modifier = {
				value = 10
				holder_scope = { is_nomadic = yes }
			}
		}
	}

	# VOTE ON GRANT TITLES
	grant_title_voting_power_0 = {
		group = grant_title_voting_power
		default = yes

		potential = {
			has_dlc = "Conclave"

			holder_scope = {
				is_playable = yes
			}

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_2
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		allow = {
			trigger_if = {
				limit = { is_nomadic = yes }
				is_nomadic = no
			}

			trigger_else = {
				has_law = grant_title_voting_power_1

				trigger_if = {
					limit = { holder_scope = { is_tribal = yes } }
					has_law = tribal_organization_4
				}
			}
		}

		pass_effect = {
			# log = "grant_title_voting_power_0 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = grant_title_voting_power_1
					is_primary_holder_title = yes
				}

				decreased_council_power_effect = yes
			}
		}

		effect = {
			# log = "grant_title_voting_power_0 ([This.GetFullBaseName])"

			disable_council_voting_on_issue = grant_landed_title_interaction
			revoke_law = grant_title_voting_power_1
		}

		ai_will_do = {
			factor = 1
		}
	}

	grant_title_voting_power_1 = {
		group = grant_title_voting_power

		vassal_limit = 2

		potential = {
			is_law_potential = grant_title_voting_power_0
		}

		allow = {
			has_law = law_voting_power_1
			has_law = war_voting_power_1
			has_law = grant_title_voting_power_0

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_2
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		pass_effect = {
			# log = "grant_title_voting_power_1 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = grant_title_voting_power_0
					is_primary_holder_title = yes
				}

				increased_council_power_effect = yes
			}
		}

		effect = {
			# log = "grant_title_voting_power_1 ([This.GetFullBaseName])"

			enable_council_voting_on_issue = grant_landed_title_interaction
			revoke_law = grant_title_voting_power_0
		}

		ai_will_do = {
			factor = 0
		}

		default_selection = {
			factor = 0

			additive_modifier = {
				value = 10

				holder_scope = {
					religion = catholic
					is_feudal = yes
				}

				year >= 1200
			}

			additive_modifier = {
				value = 10
				title = e_hre
			}

			additive_modifier = {
				value = 10
				holder_scope = { is_nomadic = yes }
			}
		}
	}

	# VOTE ON REVOKE TITLES
	revoke_title_voting_power_0 = {
		group = revoke_title_voting_power
		default = yes

		potential = {
			has_dlc = "Conclave"

			holder_scope = {
				is_playable = yes
			}

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_2
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		allow = {
			trigger_if = {
				limit = { is_nomadic = yes }
				is_nomadic = no
			}

			trigger_else = {
				has_law = revoke_title_voting_power_1

				trigger_if = {
					limit = { holder_scope = { is_tribal = yes } }
					has_law = tribal_organization_4
				}
			}
		}

		pass_effect = {
			# log = "revoke_title_voting_power_0 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = revoke_title_voting_power_1
					is_primary_holder_title = yes
				}

				decreased_council_power_effect = yes
			}
		}

		effect = {
			# log = "revoke_title_voting_power_0 ([This.GetFullBaseName])"

			disable_council_voting_on_issue = revoke_title_interaction
			revoke_law = revoke_title_voting_power_1
		}

		ai_will_do = {
			factor = 1
		}
	}

	revoke_title_voting_power_1 = {
		group = revoke_title_voting_power

		vassal_limit = 2

		potential = {
			is_law_potential = revoke_title_voting_power_0
		}

		allow = {
			has_law = law_voting_power_1
			has_law = war_voting_power_1
			has_law = revoke_title_voting_power_0

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_2
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		pass_effect = {
			# log = "revoke_title_voting_power_1 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = revoke_title_voting_power_0
					is_primary_holder_title = yes
				}

				increased_council_power_effect = yes
			}
		}

		effect = {
			# log = "revoke_title_voting_power_1 ([This.GetFullBaseName])"

			enable_council_voting_on_issue = revoke_title_interaction
			revoke_law = revoke_title_voting_power_0
		}

		ai_will_do = {
			factor = 0
		}

		default_selection = {
			factor = 0

			additive_modifier = {
				value = 10

				holder_scope = {
					religion = catholic
					is_feudal = yes
				}

				year >= 1100
			}

			additive_modifier = {
				value = 10
				title = e_hre
			}

			additive_modifier = {
				value = 10
				holder_scope = { is_nomadic = yes }
			}
		}
	}

	# VOTE ON IMPRISON
	imprison_voting_power_0 = {
		group = imprison_voting_power
		default = yes

		potential = {
			has_dlc = "Conclave"

			holder_scope = {
				is_playable = yes
			}

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		allow = {
			trigger_if = {
				limit = { is_nomadic = yes }
				is_nomadic = no
			}

			trigger_else = {
				has_law = imprison_voting_power_1

				trigger_if = {
					limit = { holder_scope = { is_tribal = yes } }
					has_law = tribal_organization_4
				}
			}
		}

		pass_effect = {
			# log = "imprison_voting_power_0 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = imprison_voting_power_1
					is_primary_holder_title = yes
				}

				decreased_council_power_effect = yes
			}
		}

		effect = {
			# log = "imprison_voting_power_0 ([This.GetFullBaseName])"

			disable_council_voting_on_issue = imprison_character_interaction
			revoke_law = imprison_voting_power_1
		}

		ai_will_do = {
			factor = 1
		}
	}

	imprison_voting_power_1 = {
		group = imprison_voting_power

		vassal_limit = 2

		potential = {
			is_law_potential = imprison_voting_power_0
		}

		allow = {
			has_law = law_voting_power_1
			has_law = war_voting_power_1
			has_law = imprison_voting_power_0

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		pass_effect = {
			# log = "imprison_voting_power_1 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = imprison_voting_power_0
					is_primary_holder_title = yes
				}

				increased_council_power_effect = yes
			}
		}

		effect = {
			# log = "imprison_voting_power_1 ([This.GetFullBaseName])"

			enable_council_voting_on_issue = imprison_character_interaction
			revoke_law = imprison_voting_power_0
		}

		ai_will_do = {
			factor = 0
		}

		default_selection = {
			factor = 0

			additive_modifier = {
				value = 10


				holder_scope = {
					religion = catholic
					is_feudal = yes
				}

				year >= 1000
			}

			additive_modifier = {
				value = 10
				title = e_hre
			}

			additive_modifier = {
				value = 10
				holder_scope = { is_nomadic = yes }
			}
		}
	}

	# VOTE ON BANISH
	banish_voting_power_0 = {
		group = banish_voting_power
		default = yes

		potential = {
			has_dlc = "Conclave"

			holder_scope = {
				is_playable = yes
			}

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		allow = {
			trigger_if = {
				limit = { is_nomadic = yes }
				is_nomadic = no
			}

			trigger_else = {
				has_law = banish_voting_power_1

				trigger_if = {
					limit = { holder_scope = { is_tribal = yes } }
					has_law = tribal_organization_4
				}
			}
		}

		pass_effect = {
			# log = "banish_voting_power_0 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = banish_voting_power_1
					is_primary_holder_title = yes
				}

				decreased_council_power_effect = yes
			}
		}

		effect = {
			# log = "banish_voting_power_0 ([This.GetFullBaseName])"

			disable_council_voting_on_issue = exile_imprisoned_interaction
			revoke_law = banish_voting_power_1

		}

		ai_will_do = {
			factor = 1
		}
	}

	banish_voting_power_1 = {
		group = banish_voting_power
		default = yes

		vassal_limit = 2

		potential = {
			is_law_potential = banish_voting_power_0
		}

		allow = {
			has_law = law_voting_power_1
			has_law = war_voting_power_1
			has_law = banish_voting_power_0

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		pass_effect = {
			# log = "banish_voting_power_1 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = banish_voting_power_0
					is_primary_holder_title = yes
				}

				increased_council_power_effect = yes
			}
		}

		effect = {
			# log = "banish_voting_power_1 ([This.GetFullBaseName])"

			enable_council_voting_on_issue = exile_imprisoned_interaction
			revoke_law = banish_voting_power_0
		}

		ai_will_do = {
			factor = 0
		}

		default_selection = {
			factor = 0

			additive_modifier = {
				value = 10

				holder_scope = {
					religion = catholic
					is_feudal = yes
				}

				year >= 1300
			}

			additive_modifier = {
				value = 10
				title = e_hre
			}

			additive_modifier = {
				value = 10
				holder_scope = { is_nomadic = yes }
			}
		}
	}

	# VOTE ON EXECUTE
	execution_voting_power_0 = {
		group = execution_voting_power
		default = yes

		potential = {
			has_dlc = "Conclave"

			holder_scope = {
				is_playable = yes
			}

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		allow = {
			trigger_if = {
				limit = { is_nomadic = yes }
				is_nomadic = no
			}

			trigger_else = {
				has_law = execution_voting_power_1

				trigger_if = {
					limit = { holder_scope = { is_tribal = yes } }
					has_law = tribal_organization_4
				}
			}
		}

		pass_effect = {
			# log = "execution_voting_power_0 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = execution_voting_power_1
					is_primary_holder_title = yes
				}

				decreased_council_power_effect = yes
			}
		}

		effect = {
			# log = "execution_voting_power_0 ([This.GetFullBaseName])"

			disable_council_voting_on_issue = execute_imprisoned_interaction
			revoke_law = execution_voting_power_1
		}

		ai_will_do = {
			factor = 1
		}
	}

	execution_voting_power_1 = {
		group = execution_voting_power

		vassal_limit = 2

		potential = {
			is_law_potential = execution_voting_power_0
		}

		allow = {
			has_law = law_voting_power_1
			has_law = war_voting_power_1
			has_law = execution_voting_power_0

			trigger_if = {
				limit = { holder_scope = { is_tribal = yes } }

				OR = {
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		pass_effect = {
			# log = "execution_voting_power_1 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = execution_voting_power_0
					is_primary_holder_title = yes
				}

				increased_council_power_effect = yes
			}
		}

		effect = {
			# log = "execution_voting_power_1 ([This.GetFullBaseName])"

			enable_council_voting_on_issue = execute_imprisoned_interaction
			revoke_law = execution_voting_power_0
		}

		ai_will_do = {
			factor = 0
		}

		default_selection = {
			factor = 0

			additive_modifier = {
				value = 10

				holder_scope = {
					religion = catholic
					is_feudal = yes
				}

				year >= 1200
			}

			additive_modifier = {
				value = 10
				title = e_hre
			}

			additive_modifier = {
				value = 10
				holder_scope = { is_nomadic = yes }
			}
		}
	}

	# VOTE ON SUCCESSION
	succession_voting_power_0 = {
		group = succession_voting_power
		default = yes

		potential = {
			higher_real_tier_than = DUKE
			has_dlc = "Conclave"

			holder_scope = {
				is_feudal = yes
				holy_order = no
			}
		}

		allow = {
			has_law = succession_voting_power_1
		}

		pass_effect = {
			# log = "succession_voting_power_0 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = succession_voting_power_1
					is_primary_holder_title = yes
				}

				decreased_council_power_effect = yes
			}
		}

		effect = {
			# log = "succession_voting_power_0 ([This.GetFullBaseName])"

			custom_tooltip = { text = succession_voting_power_0_effect_tooltip }
			revoke_law = succession_voting_power_1
		}

		ai_will_do = {
			factor = 1
		}
	}

	succession_voting_power_1 = {
		group = succession_voting_power

		vassal_limit = 2

		potential = {
			is_law_potential = succession_voting_power_0
		}

		allow = {
			has_law = law_voting_power_1
			has_law = war_voting_power_1
			has_law = grant_title_voting_power_1
			has_law = revoke_title_voting_power_1
			has_law = imprison_voting_power_1
			has_law = banish_voting_power_1
			has_law = execution_voting_power_1
			has_law = succession_voting_power_0
		}

		pass_effect = {
			# log = "succession_voting_power_1 pass ([This.GetFullBaseName])"

			if = {
				limit = {
					has_law = succession_voting_power_0
					is_primary_holder_title = yes
				}

				increased_council_power_effect = yes
			}
		}

		effect = {
			# log = "succession_voting_power_1 ([This.GetFullBaseName])"

			custom_tooltip = { text = succession_voting_power_1_effect_tooltip }
			revoke_law = succession_voting_power_0
		}

		ai_will_do = {
			factor = 0
		}
	}
}