﻿aureliani_senate_recognition_open = {
	scope = character
	is_shown = { aureliani_senate_visible_trigger = yes }
	is_valid = {
		custom_description = { text = aureliani_senate_req_recognition_needed house = { var:aureliani_senate_recognition_pending = root } }
		custom_description = { text = aureliani_senate_req_recognition_house_head house = house:house_aureliani is_house_head = yes is_ruler = yes }
		custom_description = { text = aureliani_senate_req_alive is_alive = yes }
		custom_description = { text = aureliani_senate_req_capable_adult is_capable_adult = yes }
		custom_description = { text = aureliani_senate_req_not_imprisoned is_imprisoned = no }
		custom_description = { text = aureliani_senate_req_peaceful is_at_war = no }
		custom_description = { text = aureliani_senate_req_italian_crown house = { has_variable = aureliani_italian_crown_secured } }
		custom_description = {
			text = aureliani_senate_req_eligible_realm
			OR = { primary_title = title:k_italy primary_title = title:e_italy primary_title = title:h_roman_empire }
		}
		trigger_if = {
			limit = { house = { var:aureliani_senate_stage = 2 } }
			custom_description = { text = aureliani_senate_req_roman_independence aureliani_roman_sovereignty_trigger = yes }
		}
		custom_description = {
			text = aureliani_senate_req_recognition_cooldown_clear
			NOT = { house = { has_variable = aureliani_senate_recognition_cooldown } }
		}
	}
	effect = {
		custom_tooltip = aureliani_senate_req_action_recognition
		hidden_effect = {
			if = {
				limit = { aureliani_senate_recognition_petition_available_trigger = yes }
				house = { set_variable = { name = aureliani_senate_recognition_cooldown value = 1 days = 30 } }
				save_scope_value_as = { name = aureliani_senate_recognition_attempt value = house.var:aureliani_senate_recognition_serial }
				trigger_event = { id = aureliani.0120 }
			}
		}
	}
}
