Complete.Org: Mailing Lists: Archives: freeciv-ai: September 2004:
[freeciv-ai] (PR#10241) Make AI take part in spacerace
Home

[freeciv-ai] (PR#10241) Make AI take part in spacerace

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [freeciv-ai] (PR#10241) Make AI take part in spacerace
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Tue, 21 Sep 2004 10:07:17 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10241 >

Current code is completely stupid.
This patch helps. It depends on PR#10239
With this patch AI produces Apollo only if it is a production leader.
--
mateusz
Index: aicity.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aicity.c,v
retrieving revision 1.167
diff -u -r1.167 aicity.c
--- aicity.c    21 Sep 2004 05:51:12 -0000      1.167
+++ aicity.c    21 Sep 2004 17:06:09 -0000
@@ -318,7 +318,10 @@
            break;
          case EFT_ENABLE_SPACE:
            if (game.spacerace) {
-             v += 50;
+             v += 5;
+             if (ai->diplomacy.production_leader == pplayer) {
+               v += 100;
+             }
            }
            break;
          case EFT_GIVE_IMM_TECH:
@@ -361,7 +364,11 @@
          case EFT_SS_STRUCTURAL:
          case EFT_SS_COMPONENT:
          case EFT_SS_MODULE:
-           if (game.spacerace && ai->diplomacy.strategy == WIN_SPACE) {
+           if (game.spacerace
+               /* If someone has started building spaceship already or
+                * we have chance to win a spacerace */
+               && (ai->diplomacy.spacerace_leader
+                   || ai->diplomacy.production_leader == pplayer)) {
              v += 95;
            }
            break;

[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] (PR#10241) Make AI take part in spacerace, Mateusz Stefek <=