﻿
# AI household size goal. Rulers may own more or fewer, but the living-market pulse pushes portfolios toward
# these ranges instead of letting the player become the only visible slave owner.
domcom_csr_owned_slave_count_value = {
    value = 0
    every_relation = { type = slave add = 1 }
}

domcom_csr_desired_slave_count_value = {
    value = 1
    if = { limit = { highest_held_title_tier = tier_duchy } value = 4 }
    else_if = { limit = { highest_held_title_tier = tier_kingdom } value = 8 }
    else_if = { limit = { highest_held_title_tier >= tier_empire } value = 10 }
    if = { limit = { gold < 100 } subtract = 1 }
    if = { limit = { gold > 1000 } add = 2 }
    min = 0
    max = 14
}

# Negotiated ruler-to-ruler price: midpoint of CSR's seller ask and buyer bid.
# Because buyer/seller scopes are saved before evaluation, CSR's government, greed,
# trader-attitude and slave-quality components all remain active.
domcom_csr_negotiated_slave_price_value = {
    value = carnx_slave_ask_price_value
    add = carnx_slave_bid_price_value
    divide = 2
    round = yes
    min = 5
}

# Limit annual market work so thousands of rulers do not all run global seller scans in the same pulse.
# Higher rulers and rich courts participate much more often, producing an active market without a yearly flood.
domcom_csr_market_activity_chance_value = {
    value = 20
    if = { limit = { highest_held_title_tier = tier_duchy } value = 35 }
    else_if = { limit = { highest_held_title_tier = tier_kingdom } value = 50 }
    else_if = { limit = { highest_held_title_tier >= tier_empire } value = 65 }
    if = { limit = { gold > 500 } add = 10 }
    if = { limit = { gold < 75 } subtract = 10 }
    min = 5
    max = 80
}
