﻿############################################################
# Unsafe perk registry / pending perk safety
#
# Global audit status:
# - Safe immediate grants: standard visible perk nodes, final perk nodes,
#   final lifestyle traits, relation/variable helpers, and vanilla
#   government-gated tooltip/update helpers.
# - Pending until ruler: absolute_control_perk.
# - Pending until other valid context: registry reserved; no current
#   supported perk needs this category after the audit.
############################################################

eotm_has_pending_absolute_control_perk = {
	has_variable = eotm_pending_perk_absolute_control
}

eotm_has_any_pending_ruler_only_perk = {
	OR = {
		eotm_has_pending_absolute_control_perk = yes
	}
}

eotm_has_any_pending_valid_context_perk = {
	always = no
}

eotm_has_any_pending_unsafe_perk = {
	OR = {
		eotm_has_any_pending_ruler_only_perk = yes
		eotm_has_any_pending_valid_context_perk = yes
	}
}

############################################################
# Pending adulthood inheritance queues
#
# These variables are written on underage death inheritance and consumed
# through the adulthood activation hook/fallback. Parent-owned perk
# snapshots preserve the death-time source data so activation does not
# depend on a deceased parent scope surviving until adulthood.
############################################################

eotm_has_pending_learning_inheritance = {
	has_variable = eotm_pending_learning_inheritance
	has_variable = eotm_pending_learning_target_count
}

eotm_has_pending_martial_inheritance = {
	has_variable = eotm_pending_martial_inheritance
	has_variable = eotm_pending_martial_target_count
}

eotm_has_pending_diplomacy_inheritance = {
	has_variable = eotm_pending_diplomacy_inheritance
	has_variable = eotm_pending_diplomacy_target_count
}

eotm_has_pending_stewardship_inheritance = {
	has_variable = eotm_pending_stewardship_inheritance
	has_variable = eotm_pending_stewardship_target_count
}

eotm_has_pending_intrigue_inheritance = {
	has_variable = eotm_pending_intrigue_inheritance
	has_variable = eotm_pending_intrigue_target_count
}

eotm_has_pending_wanderer_inheritance = {
	has_variable = eotm_pending_wanderer_inheritance
	has_variable = eotm_pending_wanderer_target_count
}

eotm_has_any_pending_adulthood_inheritance = {
	OR = {
		eotm_has_pending_learning_inheritance = yes
		eotm_has_pending_martial_inheritance = yes
		eotm_has_pending_diplomacy_inheritance = yes
		eotm_has_pending_stewardship_inheritance = yes
		eotm_has_pending_intrigue_inheritance = yes
		eotm_has_pending_wanderer_inheritance = yes
	}
}
