﻿open_lineages_founder_major_menu = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_open_lineages.dds"
	}
	decision_group_type = major
    desc = open_lineages_founder_major_menu_desc

    ai_check_interval = 0

    # cost = { 
	# 	piety = {
	# 		value = 10
	# 	}
    # }

    is_shown = {
		is_ai = no
        NOT = { 
            OR = {
                has_character_flag = lineage_founder_major_menu_manager
                # Only marked family members of the founder have perpetual access without having to become a patron:
                has_trait_rank = {
                    trait = patrilinefounder
                    rank > 0
                } 
                has_trait_rank = {
                    trait = patrilineages
                    rank > 0
                }
                has_trait_rank = {
                    trait = matrilinefounder
                    rank > 0
                } 
                has_trait_rank = {
                    trait = matrilineages
                    rank > 0
                }
                has_trait_rank = {
                    trait = linefounder
                    rank > 0
                }
                has_trait_rank = {
                    trait = dynastylineages
                    rank > 0
                }
            }
        }
    }

    effect = {
        
		custom_tooltip = donate_lineage_archive_desc

        add_character_flag = lineage_founder_major_menu_manager
        add_character_flag = lineage_founder_manager

    }

    ai_potential = {
		always = no
	}
	ai_will_do = {
		base = 0
	}
}

open_lineages_founder_menu = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_open_lineages.dds"
	}

    desc = open_lineages_founder_menu_desc
    selection_tooltip = open_lineages_founder_menu_desc
    confirm_text = CONFIRM_OKAY

    ai_check_interval = 0

    is_shown = {
		is_ai = no
        OR = {
            has_character_flag = lineage_founder_major_menu_manager
            # Only family members of the founder have perpetual access and do not need to start patronage again
            has_trait_rank = {
                trait = patrilinefounder
                rank > 0
            } 
            has_trait_rank = {
                trait = patrilineages
                rank > 0
            }
            has_trait_rank = {
                trait = matrilinefounder
                rank > 0
            } 
            has_trait_rank = {
                trait = matrilineages
                rank > 0
            }
            has_trait_rank = {
                trait = linefounder
                rank > 0
            }
            has_trait_rank = {
                trait = dynastylineages
                rank > 0
            }
        }
        NOT = { has_character_flag = lineage_founder_manager }
    }

    effect = {
		custom_tooltip = lineage_founder_open_desc
        add_character_flag = lineage_founder_manager
    }
	
    ai_potential = {
		always = no
	}
	ai_will_do = {
		base = 0
	}
}

close_lineages_founder_menu = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_open_lineages.dds"
	}

    desc = close_lineages_founder_menu_desc
    selection_tooltip = close_lineages_founder_menu_desc
    confirm_text = CONFIRM_OKAY

    ai_check_interval = 0

    is_shown = {
		is_ai = no
        has_character_flag = lineage_founder_manager
    }

    effect = {
		custom_tooltip = lineage_founder_close_desc
        remove_character_flag = lineage_founder_manager
    }

    ai_potential = {
		always = no
	}
	ai_will_do = {
		base = 0
	}
}