From ba600937cf5cd5f7fda44e34eee93868b9be7feb Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 9 May 2021 12:24:09 +0300 Subject: [PATCH 33/39] AI: Increase want for improvement provided gold when tax rate high The high tax rate indicates that there's gold shortage that runs it high, and we should avoid making situation worse. Ideally we even improve the situation and make it possible to lower the tax rate in the future. Improvement provided gold is often negative as maintenance cost is included. See osdn #42195 Signed-off-by: Marko Lindqvist --- ai/default/daicity.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ai/default/daicity.c b/ai/default/daicity.c index 260c0b9e33..fd957c5278 100644 --- a/ai/default/daicity.c +++ b/ai/default/daicity.c @@ -1412,7 +1412,7 @@ adv_want dai_city_want(struct player *pplayer, struct city *acity, memset(prod, 0, O_LAST * sizeof(*prod)); if (NULL != pimprove - && adv->impr_calc[improvement_index(pimprove)] == ADV_IMPR_CALCULATE_FULL) { + && adv->impr_calc[improvement_index(pimprove)] == ADV_IMPR_CALCULATE_FULL) { struct tile *acenter = city_tile(acity); bool celebrating = base_city_celebrating(acity); @@ -1461,7 +1461,15 @@ adv_want dai_city_want(struct player *pplayer, struct city *acity, } want += prod[O_LUXURY] * adv->luxury_priority; want += prod[O_SCIENCE] * adv->science_priority; - want += prod[O_GOLD] * adv->gold_priority; + if (pplayer->economic.tax > 50) { + /* Increased tax rate indicates that we've had gold shortage which + * we are trying to fill with taxes. Consider gold more critical + * than usually. + * Smallest tax rate we can have here is 60% -> factor (60 - 40) / 14.0 = 1.43 */ + want += prod[O_GOLD] * adv->gold_priority * (pplayer->economic.tax - 40) / 14.0; + } else { + want += prod[O_GOLD] * adv->gold_priority; + } return want; } -- 2.30.2