From 22b975863ceb11f21af26c134910a80a28b1efa9 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 9 May 2021 12:39:09 +0300 Subject: [PATCH 16/20] 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/aicity.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ai/default/aicity.c b/ai/default/aicity.c index fe4f81f052..7623417631 100644 --- a/ai/default/aicity.c +++ b/ai/default/aicity.c @@ -1351,7 +1351,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); @@ -1400,7 +1400,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