Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] (PR#5135) Re: Re: Free for all Games
Home

[Freeciv-Dev] (PR#5135) Re: Re: Free for all Games

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#5135) Re: Re: Free for all Games
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 19 Aug 2003 09:18:58 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Wed, 13 Aug 2003, Christian Knoke wrote:
> Well, actually, I wanted to turn off *AI* diplomacy. Now, this is even
> better:
>
> set diplomacy 0- no diplomacy at all
> set diplomacy 1- diplomacy only between human players
> set diplomacy 2- full diplomacy (default)

I see your diplomacy 2 and raise to 3:

Option: diplomacy  -  The ability to do diplomacy with other players
Description:
  If set to 0 (default), diplomacy is enabled for all. If set to 1, diplomacy
  is only allowed between human players. If set to 2, diplomacy is only
  allowed between AI players. If set to 3, diplomacy is disabled for all.
Status: changeable
Value: 0, Minimum: 0, Default: 0, Maximum: 3

Untested patch attached. Please try it out.

  - Per

"The truth is there is an ideological struggle between those who believe
that the best way to grow the economy is to give more money to the
wealthy, and the Democrats who believe that the wealthy will make more
money if average people do better." -- Bill Clinton, November 2000

Index: common/diptreaty.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/diptreaty.c,v
retrieving revision 1.17
diff -u -r1.17 diptreaty.c
--- common/diptreaty.c  8 Aug 2003 22:11:41 -0000       1.17
+++ common/diptreaty.c  19 Aug 2003 16:13:38 -0000
@@ -18,6 +18,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "game.h"
 #include "log.h"
 #include "mem.h"
 #include "player.h"
@@ -36,6 +37,13 @@
   return (pplayer->is_alive
           && aplayer->is_alive
           && pplayer != aplayer
+          && (game.diplomacy == 0
+              || (game.diplomacy == 1 
+                  && !pplayer->ai.control 
+                  && !aplayer->ai.control)
+              || (game.diplomacy == 2
+                  && pplayer->ai.control
+                  && aplayer->ai.control))
           && (player_has_embassy(aplayer, pplayer) 
               || player_has_embassy(pplayer, aplayer)
               || pplayer->diplstates[aplayer->player_no].contact_turns_left > 0
Index: common/game.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.h,v
retrieving revision 1.124
diff -u -r1.124 game.h
--- common/game.h       10 Aug 2003 14:44:14 -0000      1.124
+++ common/game.h       19 Aug 2003 16:13:38 -0000
@@ -161,6 +161,7 @@
   int allowed_city_names;
 
   int borders;         /* distance of border from city; 0=disabled. */
+  int diplomacy;        /* who can do it */
 
   char rulesetdir[MAX_LEN_NAME];
   int firepower_factor;                /* See README.rulesets */
@@ -319,6 +320,10 @@
 #define GAME_DEFAULT_BORDERS         7
 #define GAME_MIN_BORDERS             0
 #define GAME_MAX_BORDERS             24
+
+#define GAME_DEFAULT_DIPLOMACY       0
+#define GAME_MIN_DIPLOMACY           0
+#define GAME_MAX_DIPLOMACY           3
 
 #define GAME_DEFAULT_DIPLCHANCE      80
 #define GAME_MIN_DIPLCHANCE          1
Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.288
diff -u -r1.288 stdinhand.c
--- server/stdinhand.c  10 Aug 2003 14:44:14 -0000      1.288
+++ server/stdinhand.c  19 Aug 2003 16:13:38 -0000
@@ -564,6 +564,14 @@
             "the maximum distance from any city specified."), NULL,
          GAME_MIN_BORDERS, GAME_MAX_BORDERS, GAME_DEFAULT_BORDERS)
 
+  GEN_INT("diplomacy", game.diplomacy, SSET_RULES, SSET_TO_CLIENT,
+         N_("The ability to do diplomacy with other players"),
+         N_("If set to 0 (default), diplomacy is enabled for all. "
+            "If set to 1, diplomacy is only allowed between human players. "
+            "If set to 2, diplomacy is only allowed between AI players. "
+             "If set to 3, diplomacy is disabled for all."), NULL,
+         GAME_MIN_DIPLOMACY, GAME_MAX_DIPLOMACY, GAME_DEFAULT_DIPLOMACY)
+
   GEN_INT("citynames", game.allowed_city_names, SSET_RULES, SSET_TO_CLIENT,
          N_("Allowed city names"),
          N_("If set to 0, there are no restrictions: players can have "

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