﻿# 2.6.20 — autonomous AI-to-AI ownership trading remains disabled.
# The old background market transfer path was the path associated with prior access-violation
# crashes. Keep its public effect name inert for save/external-reference compatibility.

domcom_csr_living_market_yearly_effect = {
    # Intentionally empty. Never walk a global slave-owner list while transferring ownership.
}

# Rank-scaled AI procurement. The actual acquisition is delegated to CSR's native
# Buy Foreign Slaves event (carnx_slave.0001), which creates candidates and applies
# CSR legality/price/consequence logic. Cooldowns deliberately vary by rank:
# empire/hegemony 1–2 months, kingdom 1–3 months, duchy 2–4 months.
domcom_csr_safe_household_procurement_effect = {
    if = {
        limit = { domcom_csr_can_run_household_procurement_trigger = yes }

        if = {
            limit = { highest_held_title_tier >= tier_empire }
            random_list = {
                50 = { add_character_flag = { flag = domcom_csr_household_procurement_recent months = 1 } }
                50 = { add_character_flag = { flag = domcom_csr_household_procurement_recent months = 2 } }
            }
            trigger_event = carnx_slave.0001
        }
        else_if = {
            limit = { highest_held_title_tier = tier_kingdom }
            random_list = {
                34 = { add_character_flag = { flag = domcom_csr_household_procurement_recent months = 1 } }
                33 = { add_character_flag = { flag = domcom_csr_household_procurement_recent months = 2 } }
                33 = { add_character_flag = { flag = domcom_csr_household_procurement_recent months = 3 } }
            }
            trigger_event = carnx_slave.0001
        }
        else_if = {
            limit = { highest_held_title_tier = tier_duchy }
            random_list = {
                34 = { add_character_flag = { flag = domcom_csr_household_procurement_recent months = 2 } }
                33 = { add_character_flag = { flag = domcom_csr_household_procurement_recent months = 3 } }
                33 = { add_character_flag = { flag = domcom_csr_household_procurement_recent months = 4 } }
            }
            trigger_event = carnx_slave.0001
        }
    }
}
