[freeciv-ai] (PR#12625) kill desire and teams
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<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);
|
|