Complete.Org: Mailing Lists: Archives: freeciv-ai: March 2005:
[freeciv-ai] (PR#12625) kill desire and teams
Home

[freeciv-ai] (PR#12625) kill desire and teams

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [freeciv-ai] (PR#12625) kill desire and teams
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Fri, 25 Mar 2005 02:50:24 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12625 >

> [per - Fri Mar 25 10:18:52 2005]:

> I can agree with it from the perspective of the AI's chance of winning
> the
> game. But then at least generalize this to check for alliances.
> 
>   - Per
> 
Like this?
--
mateusz


Index: ai/advdiplomacy.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdiplomacy.c,v
retrieving revision 1.72
diff -u -r1.72 advdiplomacy.c
--- ai/advdiplomacy.c   18 Mar 2005 11:26:23 -0000      1.72
+++ ai/advdiplomacy.c   25 Mar 2005 10:48:15 -0000
@@ -705,6 +705,21 @@
     kill_desire += pcity->size > 8 ? 1 : 0;
   } city_list_iterate_end;
 
+  /* Destroy teams or large alliances */
+  players_iterate(eplayer) {
+    int ncities;
+    if (!eplayer->is_alive || eplayer == aplayer || eplayer == pplayer) {
+      continue;
+    }
+    
+    ncities = city_list_size(eplayer->cities);
+    if (players_on_same_team(eplayer, aplayer)) {
+      kill_desire += ncities / 2;
+    } else if (!pplayers_allied(pplayer, eplayer)) {
+      kill_desire += ncities / 3;
+    }
+  } players_iterate_end;
+  
   /* Tech lead is worrisome */
   kill_desire += MAX(aplayer->research->techs_researched -
                      pplayer->research->techs_researched, 0);

[Prev in Thread] Current Thread [Next in Thread]