Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] (PR#7322) Four small features requests
Home

[Freeciv-Dev] (PR#7322) Four small features requests

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7322) Four small features requests
From: "Josh Cogliati" <jjc@xxxxxxxxxxxxxxxxxx>
Date: Thu, 20 May 2004 19:49:33 -0700
Reply-to: rt@xxxxxxxxxxx

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

> [jrincayc - Mon Jan 26 15:35:34 2004]:
> 
> These are a few features that I think will help beginning players:
> 
> 1. Give an embassay from all human players to all novice (maybe easy?)
> ai players.
> This will help because it allows the new player to compare their armys,
> population, production etc with the computer player.  This gives them
> feedback as to how efficiently they are growing their empire.

Attached is a simple implementation of this.  It adds the embassys 
in the generate_ai_players code for every player that has the 
handicap H_EMBASSY.  novice ai players get this handicap.
The patch is against cvs current.

? data/experimental
? data/experimental.tar.gz
? data/graphics/isotrident/units/u.workers.png
? data/graphics/trident/units/u.workers.png
Index: common/player.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/player.h,v
retrieving revision 1.115
diff -u -r1.115 player.h
--- common/player.h     23 Apr 2004 22:58:06 -0000      1.115
+++ common/player.h     21 May 2004 02:46:09 -0000
@@ -53,7 +53,8 @@
   H_HUTS = 128,       /* Doesn't know which unseen tiles have huts on them */
   H_FOG = 256,        /* Can't see through fog of war */
   H_NOPLANES = 512,   /* Doesn't build air units */
-  H_MAP = 1024        /* Only knows map_is_known tiles */
+  H_MAP = 1024,       /* Only knows map_is_known tiles */
+  H_EMBASSY = 2048    /* Other players get embassy with */
 };
 
 struct player_economic {
Index: server/srv_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.c,v
retrieving revision 1.160
diff -u -r1.160 srv_main.c
--- server/srv_main.c   2 May 2004 14:47:12 -0000       1.160
+++ server/srv_main.c   21 May 2004 02:46:29 -0000
@@ -1231,6 +1231,18 @@
     announce_ai_player(pplayer);
     set_ai_level_direct(pplayer, pplayer->ai.skill_level);
   }
+
+  for (i=0; i<game.nplayers; i++) {
+    pplayer = &game.players[i];
+    
+    if(pplayer->ai.handicap & H_EMBASSY) {
+      int j;
+      for (j=0; j<game.nplayers; j++) {
+       game.players[j].embassy |= (1 << pplayer->player_no);
+      }
+    }
+  }
+  
   (void) send_server_info_to_metaserver(TRUE, FALSE);
 }
 
Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.317
diff -u -r1.317 stdinhand.c
--- server/stdinhand.c  17 May 2004 05:34:53 -0000      1.317
+++ server/stdinhand.c  21 May 2004 02:46:58 -0000
@@ -1906,7 +1906,8 @@
   int h[11] = { -1,
                H_AWAY,
  /* novice */   H_RATES | H_TARGETS | H_HUTS | H_NOPLANES 
-                        | H_DIPLOMAT | H_LIMITEDHUTS | H_DEFENSIVE,
+                        | H_DIPLOMAT | H_LIMITEDHUTS | H_DEFENSIVE
+                        | H_EMBASSY,
  /* easy */    H_RATES | H_TARGETS | H_HUTS | H_NOPLANES 
                         | H_DIPLOMAT | H_LIMITEDHUTS | H_DEFENSIVE,
                H_NONE,

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#7322) Four small features requests, Josh Cogliati <=