has_demon_demand_trigger = { 
	OR = { 
		has_character_flag = demand_kill_pure_flag
		has_character_flag = demand_banish_rival_flag
		has_character_flag = demand_prepare_bodies_flag
		has_character_flag = demand_bring_infernalist_flag
		has_character_flag = demand_corrupt_place_flag
	}
}

is_a_cultist = {
	num_of_relation_worshipped_demon > 0
}

is_a_thrall = {
	num_of_relation_demonic_master > 0
}

is_a_diabolist = {
	OR = {
		num_of_relation_bound_demon > 0
		has_character_modifier = POD_tainted_soul_modifier
		has_character_modifier = decani_boon_modifier
	}
}

has_demonic_liege_trigger = {
	liege ?= { 
		OR = {
			has_trait = demon
			is_a_cultist = yes 
		}
	} 
}

can_hide_demon_worship_trigger = {
	NOT = { has_character_flag = obviously_demonic }
}

has_arcana_focus_trigger = {
	has_focus = arcana_focus
}

can_be_thrall = {
	NOT = { has_trait = demon }
	#NOT = { has_trait = fae }
	NOT = { has_trait = wraith }
	NOT = { has_trait = spirit }
}

POD_can_be_converted_by_cult_leader = {
	NOT = { this = $DEMON$ }
	NOT = { has_relation_worshipped_demon = $DEMON$ }
	NOT = { has_relation_rival = $DEMON$ }
	POD_hostile_mental_interaction_is_shown_custom = {
		ACTOR = $DEMON$
		RECIPIENT = this
	}
	opinion = {
		target = $DEMON$
		value >= 50
	}
}

POD_splat_can_be_infernalist = {
	NOT = { has_trait = demon }
}

POD_character_can_use_investments = {
	OR = {
		has_character_modifier = decani_boon_modifier
		has_trait = infernalist
		any_secret = { secret_type = secret_infernalist }
	}
	POD_splat_can_be_infernalist = yes
}

can_be_demonic_possesed = {
	NOT = { has_trait = demon }
	NOT = { has_trait = wraith } # As spirits, ghosts cannot suffer demonic possession.
	NOT = { has_trait = fera } # The souls of werewolves blaze with spiritual power, leaving no room for demons to enter and seize control.
	NOT = { has_trait = vampire } # The blood of Caine carries a curse imposed by God upon that monstrous race.
	#NOT = { has_trait = fae } # Demons generally find the true fae too alien to possess under any circumstances.
	NOT = { has_trait = mummy }
	NOT = { has_trait = kueijin }
	NOT = { has_trait = fomori }
	NOT = { has_trait = drone }
	NOT = { has_trait = gorgon }
	NOT = { has_trait = kami }
	NOT = { has_trait = spirit }
	is_ai = yes
}

POD_is_demon_or_pseudo_demon = {
	OR = {
		has_trait = demon
		has_character_modifier = decani_modifier
		has_character_modifier = yama_king_modifier
	}
}

POD_has_any_resolve_modifier = {
	OR = {
		has_character_modifier = resolve0_modifier
		has_character_modifier = resolve1_modifier
		has_character_modifier = resolve2_modifier
		has_character_modifier = resolve3_modifier
		has_character_modifier = resolve4_modifier
		has_character_modifier = resolve5_modifier
		has_character_modifier = resolve6_modifier
		has_character_modifier = resolve7_modifier
		has_character_modifier = resolve8_modifier
		has_character_modifier = resolve9_modifier
		has_character_modifier = resolve10_modifier
	}
}

has_demonologist_xp = {
	trigger_if = {
		limit = { has_trait = demonology }
		has_trait_xp = {
			trait = demonology
			track = demonologist
			value $COMPARATOR$ $VALUE$
		}
	}
	trigger_else_if = {
		limit = {
			any_secret = { secret_type = secret_demonology }
			has_variable = secret_demonologist_xp
		}
		var:secret_demonologist_xp $COMPARATOR$ $VALUE$
	}
	trigger_else = { always = no }
}

has_thrall_xp = {
	trigger_if = {
		limit = { has_trait = demonology }
		has_trait_xp = {
			trait = demonology
			track = thrall
			value $COMPARATOR$ $VALUE$
		}
	}
	trigger_else_if = {
		limit = {
			any_secret = { secret_type = secret_demonology }
			has_variable = secret_thrall_xp
		}
		var:secret_thrall_xp $COMPARATOR$ $VALUE$
	}
	trigger_else = { always = no }
}

has_diabolist_xp = {
	trigger_if = {
		limit = { has_trait = demonology }
		has_trait_xp = {
			trait = demonology
			track = diabolist
			value $COMPARATOR$ $VALUE$
		}
	}
	trigger_else_if = {
		limit = {
			any_secret = { secret_type = secret_demonology }
			has_variable = secret_diabolist_xp
		}
		var:secret_diabolist_xp $COMPARATOR$ $VALUE$
	}
	trigger_else = { always = no }
}

POD_has_enough_arcana_perk_points = {
	arcana_lifestyle_perk_points >= $LEVEL$
}

POD_has_access_to_lore_of_herald = {
	OR = {
		dynasty ?= { has_dynasty_modifier = namaru_dynasty_modifier }
		has_global_variable = abyss_broken
		has_character_flag = learnt_lore_of_herald
	}
}

POD_has_access_to_lore_of_life_bringer = {
	OR = {
		dynasty ?= { has_dynasty_modifier = asharu_dynasty_modifier }
		has_global_variable = abyss_broken
		has_character_flag = learnt_lore_of_life_bringer
	}
}

POD_has_access_to_lore_of_creation = {
	OR = {
		dynasty ?= { has_dynasty_modifier = annunaki_dynasty_modifier }
		has_global_variable = abyss_broken
		has_character_flag = learnt_lore_of_creation
	}
}

POD_has_access_to_lore_of_seer = {
	OR = {
		dynasty ?= { has_dynasty_modifier = neberu_dynasty_modifier }
		has_global_variable = abyss_broken
		has_character_flag = learnt_lore_of_seer
	}
}

POD_has_access_to_lore_of_beauty = {
	OR = {
		dynasty ?= { has_dynasty_modifier = lammasu_dynasty_modifier }
		has_global_variable = abyss_broken
		has_character_flag = learnt_lore_of_beauty
	}
}

POD_has_access_to_lore_of_living = {
	OR = {
		dynasty ?= { has_dynasty_modifier = rabisu_dynasty_modifier }
		has_global_variable = abyss_broken
		has_character_flag = learnt_lore_of_living
	}
}

POD_has_access_to_lore_of_ethereal = {
	OR = {
		dynasty ?= { has_dynasty_modifier = halaku_dynasty_modifier }
		has_global_variable = abyss_broken
		has_character_flag = learnt_lore_of_ethereal
	}
}