﻿# Preserve the original bundle, but run it no more than once per character per day.
domcom_run_patron_maintenance_once_effect = {
    if = {
        limit = { NOT = { has_character_flag = domcom_patron_work_ran_today_v2671 } }
        add_character_flag = { flag = domcom_patron_work_ran_today_v2671 days = 1 }
        domcom_run_patron_maintenance_body_effect = yes
    }
}

domcom_run_patron_maintenance_body_effect = {
        if = {
            limit = { is_ai = no }
            # One world scan per save/update repairs legacy list loss. Ongoing monthly work remains bounded
            # to the player's current relationships and Dominion registries.
            domcom_reconstruct_legacy_relationship_registries_200_once_effect = yes
            domcom_fast_recover_records_effect = yes
            domcom_repair_pet_registry_for_patron_effect = yes
            domcom_repair_patron_registries_effect = yes
            domcom_refresh_owned_benefit_tier_effect = yes
            domcom_human_ai_process_apex_queue_effect = yes
            domcom_refresh_trophy_registry_effect = yes
            domcom_inner_household_monthly_effect = yes
            domcom_external_monthly_sync_effect = yes
            # Legacy cult reconstruction walks the player's realm once. Do not repeat this migration
            # across every AI ruler; current AI adherents register themselves through normal gameplay.
            domcom_recover_existing_cult_adherents_once_effect = yes
        }
        domcom_monthly_owned_subject_effect = yes
        if = {
            limit = { NOT = { has_game_rule = domcom_passive_progression_manual } }
            domcom_monthly_cuck_pressure_for_patron_effect = yes
        }
        domcom_enforce_communion_for_patron_effect = yes
        domcom_reassert_cuck_reputations_for_patron_effect = yes
        domcom_refresh_cult_of_personality_effect = yes
        # Safe deployment sync: if armies are raised, the pending target remains queued instead.
        domcom_reconcile_devoted_retinue_effect = yes
        domcom_try_admirer_approach_effect = yes
        if = {
            limit = { is_ai = yes domcom_ai_is_enabled_trigger = yes }
            # AI Patrons now advance the same Devotion track as human Patrons.
            domcom_devotion_monthly_patron_effect = yes
            random = { chance = domcom_ai_public_humiliation_activity_chance_value domcom_ai_try_public_humiliation_effect = yes }
        }
}
