Author: cazfi
Date: Thu May 18 17:24:51 2017
New Revision: 35652

URL: http://svn.gna.org/viewcvs/freeciv?rev=35652&view=rev
Log:
Multiply AI want for Great Wonders by 1.5

See hrm Feature #661176

Modified:
    branches/S3_0/ai/default/aicity.c

Modified: branches/S3_0/ai/default/aicity.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/ai/default/aicity.c?rev=35652&r1=35651&r2=35652&view=diff
==============================================================================
--- branches/S3_0/ai/default/aicity.c   (original)
+++ branches/S3_0/ai/default/aicity.c   Thu May 18 17:24:51 2017
@@ -1867,19 +1867,26 @@
            * We DO want to calculate (tech) wants because of buildings
            * we already have. */
           const bool already = city_has_building(pcity, pimprove);
+          int idx = improvement_index(pimprove);
 
           adjust_improvement_wants_by_effects(ait, pplayer, pcity,
                                               pimprove, already);
 
           fc_assert(!(already
-                      && 0 < 
pcity->server.adv->building_want[improvement_index(pimprove)]));
+                      && 0 < pcity->server.adv->building_want[idx]));
+
+          if (is_great_wonder(pimprove)) {
+            /* Not only would we get the wonder, but we would also prevent
+             * opponents from getting it. */
+            pcity->server.adv->building_want[idx] *= 1.5;
+          }
 
           /* If I am not an expansionist, I want buildings more than units */
-          if (pcity->server.adv->building_want[improvement_index(pimprove)] > 
0) {
-            pcity->server.adv->building_want[improvement_index(pimprove)]
-              = pcity->server.adv->building_want[improvement_index(pimprove)]
-              * TRAIT_DEFAULT_VALUE
-              / ai_trait_get_value(TRAIT_EXPANSIONIST, pplayer);
+          if (pcity->server.adv->building_want[idx] > 0) {
+            pcity->server.adv->building_want[idx]
+              = pcity->server.adv->building_want[idx]
+                  * TRAIT_DEFAULT_VALUE
+                  / ai_trait_get_value(TRAIT_EXPANSIONIST, pplayer);
           }
         }
         /* else wait until a later turn */


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to