﻿# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are.
can_be_commander_now_trigger = {

	NOT = { has_character_flag = commandership_recently_revoked }
	
	is_available_quick = {
		alive = yes
		adult = yes
		imprisoned = no
		travel = no
	}

	OR = { # You can always lead your own armies
		this = $ARMY_OWNER$
		can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = $ARMY_OWNER$ }
	}

	trigger_if = {
		limit = { $ARMY_OWNER$ = { is_ai = yes } }
		is_ai = yes
	}

	custom_description = {
		text = ALREADY_IN_ACTIVITY
		NOR = {
			exists = involved_activity
			has_variable = homage_liege_scope
			has_character_flag = meditation_character_flag
			has_character_flag = local_shrine_rite
			has_character_flag = petition_liege_character_flag
			has_character_flag = holding_court_character_flag
			is_being_visited_on_tour_strict = yes
		}
	}
}