############################
#
# Leader Events
#
############################

namespace = leader

# Fired by on_added_to_leader_pool
# A leader is added to the leader pool, available for recruitment
# scope: country, from: leader
# Add traits from civics and origins
country_event = {
	id = leader.100
	hide_window = yes

	is_triggered_only = yes


	trigger = {
		NOT = { has_country_flag = spawning_renowned_leader }
	}

	immediate = {

		from = {
			add_initial_leader_traits_effect = yes
		}

		# Aristocratic Elite
		# 20% Chance for a random positive trait and a random negative trait
		if = {
			limit = {
				has_valid_civic = civic_aristocratic_elite
			}
			from = {
				random_list = {
					80 = {  }
					20 = {
						add_trait = {
							trait = random_common
							show_message = no
						}
						add_trait = {
							trait = random_negative
							show_message = no
						}
						# Variable "leader_pending_negative_traits_unmodified" doesn't exist yet, can't reduce it yet. Check made in paragon_2.2200.
						change_background_job = noble
					}
				}
			}
		}

		# Technocracy
		# Adds a random expertise trait
		if = {
			limit = {
				has_valid_civic = civic_technocracy
				from = { leader_class = scientist }
			}
			from = {
				add_random_expertise_trait_effect = yes
			}
		}

		# Crusader Spirit
		# Adds the Crusader trait
		if = {
			limit = {
				has_valid_civic = civic_crusader_spirit
				from = { leader_class = commander }
			}
			from = {
				give_trait_no_notify_ignore_autocracy_restriction = {
					TRAIT = leader_trait_crusader
				}
			}
		}

		# Letters of Marque
		# Adds the Corsair trait
		if = {
			limit = {
				has_civic = civic_crusader_spirit_corporate
				from = { leader_class = commander }
			}
			from = {
				give_trait_no_notify_ignore_autocracy_restriction = {
					TRAIT = leader_trait_corsair
				}
			}
		}

		# Tactical Algorithms
		# Adds the Tactical Algorithms trait
		if = {
			limit = {
				has_civic = civic_machine_tactical_algorithms
				from = { leader_class = commander }
			}
			from = {
				add_trait = {
					trait = leader_trait_tactical_algorithms
					show_message = no
				}
			}
		}

		# Specialist Subjects
		if = {
			limit = {
				from = { has_specialist_subject_leader_trait = no }
			}
			if = {
				limit = {
					is_specialist_subject_tier = {
						TYPE = bulwark
						TIER = 2
					}
					from = { leader_class = commander }
				}
				from = { add_bulwark_leader_trait = yes }
			}
			else_if = {
				limit = {
					is_specialist_subject_tier = {
						TYPE = scholarium
						TIER = 2
					}
					from = { leader_class = scientist }
				}
				from = { add_scholarium_leader_trait = yes }
			}
			else_if = {
				limit = {
					is_specialist_subject_tier = {
						TYPE = prospectorium
						TIER = 2
					}
					from = { leader_class = official }
				}
				from = { add_prospectorium_leader_trait = yes }
			}
		}

		# Storm Chasers
		# Adds the Storm Rider trait
		if = {
			limit = {
				has_origin = origin_storm_chasers
			}
			from = {
				switch = {
					trigger = leader_class
					commander = {
						add_trait = {
							trait = leader_trait_storm_rider_commander
							show_message = no
						}
					}
					scientist = {
						add_trait = {
							trait = leader_trait_storm_rider_scientist
							show_message = no
						}
					}
					official = {
						add_trait = {
							trait = leader_trait_storm_rider_official
							show_message = no
						}
					}
				}
			}
		}

		# Treasure Hunters
		# Adds the Adventurous Spirit trait
		if = {
			limit = {
				has_origin = origin_treasure_hunters
			}
			from = {
				give_trait_no_notify_ignore_autocracy_restriction = {
					TRAIT = leader_trait_adventurous_spirit_3
				}
			}
		}

		# Biochemical Composure/Cloning Authorities
		if = {
			limit = {
				from = {
					leader_can_have_backup_clone = yes
				}
			}
			from = {
				random_list = {
					75 = {
						# Base 75% chance of nothing
						modifier = {
							factor = 0
							root = {
								is_cloning_authority = yes
								has_cloning_biochemical_composure_tradition = yes
							}
						}
					}
					25 = {
						add_trait = {
							trait = leader_trait_has_backup_clone
							show_message = no
						}
					}
				}
			}
		}

		# Genetic Purity Authorities
		if = {
			limit = {
				is_purity_authority = yes
				is_imperial_authority = no
				is_hive_empire = no
				is_megacorp = no
				from = {
					species = {
						is_robotic_species = no
					}
				}
			}
			from = {
				add_trait = {
					trait = trait_leader_genetic_purist
				}
			}
		}

		# Biotic Dominion
		if = {
			limit = {
				is_purity_authority = yes
				is_imperial_authority = yes
				from = {
					is_same_species = root.ruler
				}
			}
			from = {
				add_trait = {
					trait = trait_imperial_heir
					show_message = no
				}
			}
		}

		# Unplugged
		# Adds Cybernetic Benefits Trait
		if = {
			limit = {
				has_origin = origin_unplugged
				from = {
					leader_class = commander
					species = {
						is_same_value = prevprev.owner_main_species
					}
				}
			}

			owner_main_species = {
				switch = {
					trigger = has_trait
					trait_unplugged_cybernetic_positives_3 = {
						prev.from = {
							add_trait = {
								trait = leader_trait_unplugged_cybernetic_positives_3
								show_message = no
							}
						}
					}
					trait_unplugged_cybernetic_positives_2 = {
						prev.from = {
							add_trait = {
								trait = leader_trait_unplugged_cybernetic_positives_2
								show_message = no
							}
						}
					}
					trait_unplugged_cybernetic_positives_1 = {
						prev.from = {
							add_trait = {
								trait = leader_trait_unplugged_cybernetic_positives_1
								show_message = no
							}
						}
					}
				}
			}
		}

		# Entropy Drinkers
		# Adds the Psionic trait
		if = {
			limit = { is_entropy_drinkers_empire = yes }
			from = {
				add_trait = {
					trait = leader_trait_psionic
					show_message = no
				}
			}
		}

		if = {
			limit = {
				has_shroud_dlc = yes
				is_oligarchic_authority = yes
				is_corporeal_authority = yes
			}
			from = {
				add_trait = {
					trait = random_negative
					show_message = no
				}
			}
		}

		if = {
			limit = {
				has_shroud_dlc = yes
				is_superstitious_beliefs_empire = yes
			}
			if = {
				limit = {
					has_cycle_of_fortune = yes
				}
				from = {
					add_trait = {
						trait = random_common
						show_message = no
					}
				}
			}
			if = {
				limit = {
					has_cycle_of_omens = yes
				}
				from = {
					add_trait = {
						trait = random_negative
						show_message = no
					}
				}
			}
		}

		# Reaver trait
		# Adds the Plunderer trait
		if = {
			limit = {
				from.species = { has_trait = trait_reavers }
				from = {
					leader_class = commander
					is_xenophile = no
					is_pacifist = no
				}
			}
			from = {
				give_trait_no_notify_ignore_autocracy_restriction = {
					TRAIT = leader_trait_plunderer
				}
			}
		}

		# Cybernetic Creed traits
		# Adds the Ritualistic Implants trait
		if = {
			limit = {
				from.species = { has_cybernetic_creed_trait = yes }
				from = {
					NOR = {
						leader_class = envoy
						has_trait = leader_trait_ritualistic_implants_cyborg
						has_trait = leader_trait_psionic
						has_any_chosen_one_leader_trait = yes
					}
				}
			}
			from = {
				add_trait = {
					trait = leader_trait_ritualistic_implants_cyborg
					show_message = no
				}
			}
		}
	}
}

# Fired by on_game_start_country
# scope: country
# Add traits from civics and origins
country_event = {
	id = leader.110
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		# Aristocratic Elite
		# 20% Chance for a random positive trait and a random negative trait
		if = {
			limit = {
				has_valid_civic = civic_aristocratic_elite
			}
			every_owned_leader = {
				limit = {
					NOT = {
						leader_class = envoy
					}
				}
				random_list = {
					80 = {  }
					20 = {
						add_trait = {
							trait = random_common
							show_message = no
						}
						add_trait = {
							trait = random_negative
							show_message = no
						}
						# Variable "leader_pending_negative_traits_unmodified" doesn't exist yet, can't reduce it yet. Check made in paragon_2.2200.
						change_background_job = noble
					}
				}
			}
		}

		# Remnants
		# Adds a Archaeostudies Expertise trait
		if = {
			limit = {
				has_ancrel = yes
				has_origin = origin_remnants
			}
			every_owned_leader = {
				limit = {
					leader_class = scientist
					OR = {
						is_councilor_type = councilor_research
						is_councilor_type = councilor_gestalt_cognitive
					}
				}
				add_trait = {
					trait = leader_trait_expertise_archaeostudies
					show_message = no
				}
			}
		}

		# Static Research Analysis
		# Adds a random Expertise trait
		if = {
			limit = {
				is_machine_empire = yes
				has_valid_civic = civic_machine_predictive_analysis
			}
			every_owned_leader = {
				limit = {
					is_councilor_type = councilor_gestalt_cognitive
				}
				add_random_expertise_trait_effect = yes
			}
		}

		# Technocracy
		# Adds a random Expertise trait
		if = {
			limit = {
				has_valid_civic = civic_technocracy
			}
			every_owned_leader = {
				limit = {
					leader_class = scientist
				}
				add_random_expertise_trait_effect = yes
			}
		}

		# Crusader Spirit
		# Adds the Crusader trait
		if = {
			limit = {
				has_valid_civic = civic_crusader_spirit
			}
			every_owned_leader = {
				limit = {
					leader_class = commander
				}
				give_trait_no_notify_ignore_autocracy_restriction = {
					TRAIT = leader_trait_crusader
				}
			}
		}

		# Letters of Marque
		# Adds the Corsair trait
		if = {
			limit = { has_civic = civic_crusader_spirit_corporate }
			every_owned_leader = {
				limit = {
					leader_class = commander
				}
				give_trait_no_notify_ignore_autocracy_restriction = {
					TRAIT = leader_trait_corsair
				}
			}
		}

		# Tactical Algorithms
		# Adds the Tactical Algorithms trait
		if = {
			limit = {
				has_civic = civic_machine_tactical_algorithms
			}
			every_owned_leader = {
				limit = {
					leader_class = commander
					is_gestalt_node = no
					is_ruler = no
				}
				add_trait = {
					trait = leader_trait_tactical_algorithms
					show_message = no
				}
			}
		}

		# Storm Chasers
		# Adds the Storm Rider trait
		if = {
			limit = {
				has_origin = origin_storm_chasers
			}
			every_owned_leader = {
				switch = {
					trigger = leader_class
					commander = {
						add_trait = {
							trait = leader_trait_storm_rider_commander
							show_message = no
						}
					}
					scientist = {
						add_trait = {
							trait = leader_trait_storm_rider_scientist
							show_message = no
						}
					}
					official = {
						add_trait = {
							trait = leader_trait_storm_rider_official
							show_message = no
						}
					}
				}
			}
		}

		# Treasure Hunters
		# Adds the Adventurous Spirit trait
		if = {
			limit = {
				has_origin = origin_treasure_hunters
			}
			every_owned_leader = {
				limit = {
					NOT = {
						leader_class = envoy
					}
				}
				give_trait_no_notify_ignore_autocracy_restriction = {
					TRAIT = leader_trait_adventurous_spirit_3
				}
			}
		}

		# Entropy Drinkers
		# Adds the Psionic trait
		if = {
			limit = {
				is_entropy_drinkers_empire = yes
			}
			every_owned_leader = {
				limit = {
					NOT = {
						leader_class = envoy
					}
					is_gestalt_node = no
				}
				add_trait = {
					trait = leader_trait_psionic
					show_message = no
				}
			}
		}

		# Reaver trait
		# Adds the Plunderer trait
		every_owned_leader = {
			limit = {
				is_xenophile = no
				is_pacifist = no
				is_gestalt = no
				leader_class = commander
				species = {
					has_trait = trait_reavers
				}
			}
			give_trait_no_notify_ignore_autocracy_restriction = {
				TRAIT = leader_trait_plunderer
			}
		}

		# Cybernetic Creed traits
		# Adds the Ritualistic Implants trait
		every_owned_leader = {
			limit = {
				species = {
					has_cybernetic_creed_trait = yes
				}
				NOR = {
					leader_class = envoy
					has_trait = leader_trait_ritualistic_implants_cyborg
					has_trait = leader_trait_psionic
					has_any_chosen_one_leader_trait = yes
				}
			}
			add_trait = {
				trait = leader_trait_ritualistic_implants_cyborg
				show_message = no
			}
		}
	}
}

# New heir appointed
leader_event = {
	id = leader.200
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		exists = owner
	}

	immediate = {
		# Set age to be younger than normal.
		set_variable_to_random_value = {
			which = heir_age_mod
			min = -10
			max = 0
			rounded = yes
		}
		add_age = heir_age_mod

		####################
		# CLASS RANDOMISER #
		####################

		# Set skill level to 1
		set_skill = 1
		# Add generic level modifiers
		add_skill_without_trait_selection = owner.modifier:leader_initial_skill

		if = {
			limit = {
				owner = {
					OR = {
						# Commander
						has_valid_civic = civic_crusader_spirit_corporate
						has_tradition = tr_supremacy_war_games
						has_valid_civic = civic_distinguished_admiralty
						has_valid_civic = civic_crusader_spirit
						# Official
						has_valid_civic = civic_aristocratic_elite
						has_tradition = tr_domination_colonial_viceroys
						# Scientist
						has_valid_civic = civic_technocracy
						has_tradition = tr_discovery_science_division
						# Current Ruler's Class
						has_valid_civic = civic_philosopher_king
					}
				}
			}

			# All classes have a base weight of 10.
			# Civics that boost only one class add 40.
			# Civics that boost two classes add 20 to each class.
			# Traditions that boost a class add 20.

			random_list = {
				# Commander
				0 = {
					modifier = {
						add = value:heir_class_weight_commander
					}
					change_leader_class = commander
					add_skill_without_trait_selection = owner.modifier:commander_initial_skill
				}
				# Official
				0 = {
					modifier = {
						add = value:heir_class_weight_official
					}
					change_leader_class = official
					add_skill_without_trait_selection = owner.modifier:official_initial_skill
				}
				# Scientist
				0 = {
					modifier = {
						add = value:heir_class_weight_scientist
					}
					change_leader_class = scientist
					add_skill_without_trait_selection = owner.modifier:scientist_initial_skill
				}
			}
		}

		##########
		# TRAITS #
		##########

		# Initial Traits, set after determining class.
		add_trait = {
			trait = trait_imperial_heir
			show_message = no
		}
		add_trait = {
			trait = random_common
			show_message = no
		}

		# Chance for a negative trait.
		random_list = {
			95 = { }
			5 = {
				add_trait = {
					trait = random_common
					show_message = no
				}
				add_trait = {
					trait = random_negative
					show_message = no
				}
				# Variable "leader_pending_negative_traits_unmodified" doesn't exist yet, can't reduce it yet. Checked now made in paragon_2.2200.
				modifier = {
					factor = 0
					owner = { has_valid_civic = civic_philosopher_king }
				}
			}
		}

		add_initial_leader_traits_effect = yes

		# Under One Rule
		if = {
			limit = {
				owner = {
					OR = {
						has_origin = origin_legendary_leader_imperial
						ruler = { has_trait = leader_trait_legendary_offspring }
					}
				}
			}
			add_trait = {
				trait = leader_trait_legendary_offspring
				show_message = no
			}
		}

		# Technocracy
		if = {
			limit = {
				owner = {
					has_valid_civic = civic_technocracy
				}
				leader_class = scientist
			}
			add_random_expertise_trait_effect = yes
		}
		# Crusader Spirit
		if = {
			limit = {
				owner = {
					has_valid_civic = civic_crusader_spirit
				}
				leader_class = commander
			}
			give_trait_no_notify_ignore_autocracy_restriction = {
				TRAIT = leader_trait_crusader
			}
		}

		# Letters of Marque
		if = {
			limit = {
				owner = {
					has_valid_civic = civic_crusader_spirit_corporate
				}
				leader_class = commander
			}
			give_trait_no_notify_ignore_autocracy_restriction = {
				TRAIT = leader_trait_corsair
			}
		}

		# Specialist Subjects
		if = {
			limit = {
				has_specialist_subject_leader_trait = no
			}
			if = {
				limit = {
					leader_class = commander
					owner = {
						is_specialist_subject_tier = {
							TYPE = bulwark
							TIER = 2
						}
					}
				}
				add_bulwark_leader_trait = yes
			}
			else_if = {
				limit = {
					leader_class = scientist
					owner = {
						is_specialist_subject_tier = {
							TYPE = scholarium
							TIER = 2
						}
					}
				}
				add_scholarium_leader_trait = yes
			}
			else_if = {
				limit = {
					leader_class = official
					owner = {
						is_specialist_subject_tier = {
							TYPE = prospectorium
							TIER = 2
						}
					}
				}
				add_prospectorium_leader_trait = yes
			}
		}

		# Storm Chasers
		# Adds the Storm Rider trait
		if = {
			limit = {
				owner = {
					has_origin = origin_storm_chasers
				}
			}
			switch = {
				trigger = leader_class
				commander = {
					add_trait = {
						trait = leader_trait_storm_rider_commander
						show_message = no
					}
				}
				scientist = {
					add_trait = {
						trait = leader_trait_storm_rider_scientist
						show_message = no
					}
				}
				official = {
					add_trait = {
						trait = leader_trait_storm_rider_official
						show_message = no
					}
				}
			}
		}

		# Treasure Hunters
		if = {
			limit = {
				owner = {
					has_origin = origin_treasure_hunters
				}
			}
			give_trait_no_notify_ignore_autocracy_restriction = {
				TRAIT = leader_trait_adventurous_spirit_3
			}
		}

		# Entropy Drinkers
		if = {
			limit = {
				owner = {
					is_entropy_drinkers_empire = yes
				}
			}
			give_trait_no_notify_ignore_autocracy_restriction = {
				TRAIT = leader_trait_psionic
			}
		}

		# Biochemical Composure/Cloning Authorities
		if = {
			limit = {
				leader_can_have_backup_clone = yes
			}
			random_list = {
				75 = {
					# Base 75% chance of nothing
					modifier = {
						factor = 0
						root = {
							is_cloning_authority = yes
							has_cloning_biochemical_composure_tradition = yes
						}
					}
				}
				25 = {
					add_trait = {
						trait = leader_trait_has_backup_clone
						show_message = no
					}
				}
			}
		}

		# Reaver trait
		# Adds the Plunderer trait
		if = {
			limit = {
				is_xenophile = no
				is_pacifist = no
				leader_class = commander
				species = {
					has_trait = trait_reavers
				}
			}
			give_trait_no_notify_ignore_autocracy_restriction = {
				TRAIT = leader_trait_plunderer
			}
		}

		# Cybernetic Creed traits
		# Adds the Ritualistic Implants trait
		if = {
			limit = {
				species = {
					has_cybernetic_creed_trait = yes
				}
				NOR = {
					leader_class = envoy
					has_trait = leader_trait_ritualistic_implants_cyborg
					has_trait = leader_trait_psionic
					has_any_chosen_one_leader_trait = yes
				}
			}
			add_trait = {
				trait = leader_trait_ritualistic_implants_cyborg
				show_message = no
			}
		}
	}
}

# Add Imperial Ruler trait on changing to Imperial authority.
country_event = {
	id = leader.201
	hide_window = yes

	is_triggered_only = yes

	trigger = {
		is_country_type = default
		is_imperial_authority = yes
		exists = ruler
	}

	immediate = {
		ruler = {
			if = {
				limit = {
					NOT = { has_trait = trait_imperial_heir }
				}
				add_trait = {
					trait = trait_imperial_heir
				}
			}
		}
	}
}

#Fired by on_monthly_pulse_country
# Favors from leader_trait_ambassador_favor_maker
country_event = {
	id = leader.300
	is_triggered_only = yes
	hide_window = yes

	trigger = {
		has_tier1or2or3_in_council = {
			TRAIT = leader_trait_ambassador_favor_maker
		}
	}

	immediate = {
		every_owned_leader = {
			limit = {
				is_councilor = yes
				has_trait = leader_trait_ambassador_favor_maker
			}
			root = {
				every_envoy = {
					limit = {
						has_envoy_task = { task = improve_relations }
						root = {
							num_favors = {
								target = prev.envoy_location_country
								value < 10
							}
						}
					}
					random_list = {
						25 = {
							root = {
								add_favors = {
									target = prev.envoy_location_country
									value = 1
								}
								create_message = {
									type = MESSAGE_FAVOR_GAINED_TRADITION
									localization = MESSAGE_FAVOR_GAINED_TRADITION_DESC
									days = 30
									target = prev.envoy_location_country.capital_scope
									variable = {
										type = name
										localization = WHO
										scope = prev.envoy_location_country
									}
								}
							}
						}
						9975 = {}
					}
				}
			}

		}
		every_owned_leader = {
			limit = {
				is_councilor = yes
				has_trait = leader_trait_ambassador_favor_maker_2
			}
			root = {
				every_envoy = {
					limit = {
						has_envoy_task = { task = improve_relations }
						root = {
							num_favors = {
								target = prev.envoy_location_country
								value < 10
							}
						}
					}
					random_list = {
						50 = {
							root = {
								add_favors = {
									target = prev.envoy_location_country
									value = 1
								}
								create_message = {
									type = MESSAGE_FAVOR_GAINED_TRADITION
									localization = MESSAGE_FAVOR_GAINED_TRADITION_DESC
									days = 30
									target = prev.envoy_location_country.capital_scope
									variable = {
										type = name
										localization = WHO
										scope = prev.envoy_location_country
									}
								}
							}
						}
						9950 = {}
					}
				}
			}

		}
		every_owned_leader = {
			limit = {
				is_councilor = yes
				has_trait = leader_trait_ambassador_favor_maker_3
			}
			root = {
				every_envoy = {
					limit = {
						has_envoy_task = { task = improve_relations }
						root = {
							num_favors = {
								target = prev.envoy_location_country
								value < 10
							}
						}
					}
					random_list = {
						100 = {
							root = {
								add_favors = {
									target = prev.envoy_location_country
									value = 1
								}
								create_message = {
									type = MESSAGE_FAVOR_GAINED_TRADITION
									localization = MESSAGE_FAVOR_GAINED_TRADITION_DESC
									days = 30
									target = prev.envoy_location_country.capital_scope
									variable = {
										type = name
										localization = WHO
										scope = prev.envoy_location_country
									}
								}
							}
						}
						9900 = {}
					}
				}
			}
		}
	}
}

country_event = { # Mutual Support
	id = leader.310

	hide_window = yes
	is_triggered_only = yes

	immediate = {
		every_galcom_member = {
			limit = {
				position_on_last_resolution = support
				any_owned_leader = {
					has_trait = leader_trait_supporting_voter
					is_assigned_to_galcom = yes
				}
				NOT = {
					is_same_value = root
				}
			}
			random_owned_leader = {
				limit = {
					has_trait = leader_trait_supporting_voter
					is_assigned_to_galcom = yes
				}
				save_event_target_as = galcom_delegate
			}
			add_favors = {
				target = prev
				value = 1
			}
			root = {
				add_trust = {
					amount = 5
					who = prev
				}
			}
			create_message = {
				type = MESSAGE_SUPPORTING_VOTER
				localization = MESSAGE_FAVOR_SUPPORTING_VOTER_DESC
				days = 30
				target = root.capital_scope
				variable = {
					type = name
					localization = WHO
					scope = root
				}
				variable = {
					type = name
					localization = LEADER
					scope = event_target:galcom_delegate
				}
			}
		}
	}
}

country_event = { # Delegate Focus Traits
	id = leader.320

	hide_window = yes
	is_triggered_only = yes

	immediate = {
		every_galcom_member = {
			limit = {
				NOT = {
					is_same_value = root
				}
				position_on_last_resolution = support
				any_owned_leader = {
					is_assigned_to_galcom = yes
					has_matching_resolution_category_focus_trait_tier1or2or3 = yes
				}
			}
			random_owned_leader = {
				limit = {
					is_assigned_to_galcom = yes
					has_matching_resolution_category_focus_trait_tier1or2or3 = yes
				}
				save_event_target_as = galcom_delegate
				if = {
					limit = {
						has_matching_resolution_category_focus_trait_tier_1 = yes
					}
					delegate_focus_effect = {
						CHANCE = @resolution_focus_amt_1
					}
				}
				else_if = {
					limit = {
						has_matching_resolution_category_focus_trait_tier_2 = yes
					}
					delegate_focus_effect = {
						CHANCE = @resolution_focus_amt_2
					}
				}
				else = {
					delegate_focus_effect = {
						CHANCE = @resolution_focus_amt_3
					}
				}
			}
		}
	}
}

# Remove Divine Sovereign civic should the ruler die / be removed
# From = Previous Ruler
# This = Country
country_event = {
	id = leader.330
	hide_window = yes

	is_triggered_only = yes

	trigger = {
		From = { is_ruler = yes }
		has_civic = civic_psionic_sovereign
	}

	immediate = {
		force_remove_civic = civic_psionic_sovereign
	}
}
