Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] (PR#7383) fixated revolution length
Home

[Freeciv-Dev] (PR#7383) fixated revolution length

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7383) fixated revolution length
From: "Tarje Bargheer" <tarje@xxxxxxxxxx>
Date: Fri, 6 Feb 2004 11:44:20 -0800
Reply-to: rt@xxxxxxxxxxx

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

This patch allows for the user to fixate the revolution length (server 
option "revolen") at a number of rounds ranging from 1 to 50. Default 
and zero means random as usual.

From:

Tarje Bargheer: tarje@xxxxxxxxxx

diff -Nurd -Xfreeciv/diff_ignore freeciv/common/game.c 
freeciv.update/common/game.c
--- freeciv/common/game.c       2004-01-29 16:04:00.000000000 +0100
+++ freeciv.update/common/game.c        2004-02-08 01:38:07.000000000 +0100
@@ -252,6 +252,7 @@
   game.onsetbarbarian = GAME_DEFAULT_ONSETBARBARIAN;
   game.nbarbarians = 0;
   game.occupychance= GAME_DEFAULT_OCCUPYCHANCE;
+  game.revolution_length= GAME_DEFAULT_REVOLUTION_LENGTH;
 
   game.heating     = 0;
   game.cooling     = 0;
diff -Nurd -Xfreeciv/diff_ignore freeciv/common/game.h 
freeciv.update/common/game.h
--- freeciv/common/game.h       2004-01-31 17:58:17.000000000 +0100
+++ freeciv.update/common/game.h        2004-02-08 01:39:03.000000000 +0100
@@ -233,6 +233,7 @@
   int trireme_loss_chance[MAX_VET_LEVELS];
   int work_veteran_chance[MAX_VET_LEVELS];
   int veteran_chance[MAX_VET_LEVELS];
+  int revolution_length; /* 0=> random length, else the fixated length */
 };
 
 /* Unused? */
@@ -485,6 +486,10 @@
 #define GAME_MIN_ALLOWED_CITY_NAMES 0
 #define GAME_MAX_ALLOWED_CITY_NAMES 3
 
+#define GAME_DEFAULT_REVOLUTION_LENGTH 0
+#define GAME_MIN_REVOLUTION_LENGTH 0
+#define GAME_MAX_REVOLUTION_LENGTH 50
+
 #define GAME_START_YEAR -4000
 
 #endif  /* FC__GAME_H */
diff -Nurd -Xfreeciv/diff_ignore freeciv/server/plrhand.c 
freeciv.update/server/plrhand.c
--- freeciv/server/plrhand.c    2004-01-31 18:52:42.000000000 +0100
+++ freeciv.update/server/plrhand.c     2004-02-08 01:40:03.000000000 +0100
@@ -873,8 +873,10 @@
       (pplayer->revolution>0) &&
       ( pplayer->government==game.government_when_anarchy))
     return;
-
-  pplayer->revolution=myrand(5)+1;
+  if(game.revolution_length == 0)
+      pplayer->revolution=myrand(5)+1;
+  else
+    pplayer->revolution=game.revolution_length;
   pplayer->government=game.government_when_anarchy;
   notify_player_ex(pplayer, -1, -1, E_REVOLT_START,
                   _("Game: The %s have incited a revolt!"),
diff -Nurd -Xfreeciv/diff_ignore freeciv/server/stdinhand.c 
freeciv.update/server/stdinhand.c
--- freeciv/server/stdinhand.c  2004-01-29 16:04:00.000000000 +0100
+++ freeciv.update/server/stdinhand.c   2004-02-08 02:26:09.000000000 +0100
@@ -630,6 +630,17 @@
          GAME_MIN_ONSETBARBARIAN, GAME_MAX_ONSETBARBARIAN, 
          GAME_DEFAULT_ONSETBARBARIAN)
 
+  GEN_INT("revolen", game.revolution_length, SSET_RULES_FLEXIBLE,
+         SSET_TO_CLIENT,
+         N_("length in turns of revolution"),
+         N_("When changing government an intermission"
+             " period of the specified length, in turns,"
+             " occur."
+             " Setting this value to 0 will give a random"
+             " length of 1-6 turns."), NULL, 
+         GAME_MIN_REVOLUTION_LENGTH, GAME_MAX_REVOLUTION_LENGTH, 
+         GAME_DEFAULT_REVOLUTION_LENGTH)
+
   GEN_BOOL("fogofwar", game.fogofwar, SSET_RULES_FLEXIBLE, SSET_TO_CLIENT,
          N_("Whether to enable fog of war"),
          N_("If this is set to 1, only those units and cities within "

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#7383) fixated revolution length, Tarje Bargheer <=