Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2005:
[Freeciv-Dev] (PR#7239) Patch: buildbox server variable, for accelerated
Home

[Freeciv-Dev] (PR#7239) Patch: buildbox server variable, for accelerated

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: use_less@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#7239) Patch: buildbox server variable, for accelerated production
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 2 May 2005 22:51:42 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=7239 >

Here's an updated version of the buildbox patch.  I also merged in my
proposed foodbox changes.

-jason

diff -ur -Xdiff_ignore freeciv-bcremoved/client/packhand.c 
freeciv-mod/client/packhand.c
--- freeciv-bcremoved/client/packhand.c Sun Jan 11 22:16:16 2004
+++ freeciv-mod/client/packhand.c       Tue Jan 13 16:58:08 2004
@@ -1315,6 +1315,7 @@
   }
   game.techpenalty=pinfo->techpenalty;
   game.foodbox=pinfo->foodbox;
+  game.buildbox=pinfo->buildbox;
   game.civstyle=pinfo->civstyle;
   game.unhappysize = pinfo->unhappysize;
   game.cityfactor = pinfo->cityfactor;
diff -ur -Xdiff_ignore freeciv-bcremoved/common/game.c freeciv-mod/common/game.c
--- freeciv-bcremoved/common/game.c     Fri Nov 28 22:05:26 2003
+++ freeciv-mod/common/game.c   Tue Jan 13 16:52:34 2004
@@ -234,6 +234,7 @@
   game.unhappysize = GAME_DEFAULT_UNHAPPYSIZE;
   game.angrycitizen= GAME_DEFAULT_ANGRYCITIZEN;
   game.foodbox     = GAME_DEFAULT_FOODBOX;
+  game.buildbox    = GAME_DEFAULT_BUILDBOX;
   game.aqueductloss= GAME_DEFAULT_AQUEDUCTLOSS;
   game.killcitizen = GAME_DEFAULT_KILLCITIZEN;
   game.scorelog    = GAME_DEFAULT_SCORELOG;
diff -ur -Xdiff_ignore freeciv-bcremoved/common/game.h freeciv-mod/common/game.h
--- freeciv-bcremoved/common/game.h     Sun Jan 11 22:16:20 2004
+++ freeciv-mod/common/game.h   Tue Jan 13 16:58:48 2004
@@ -123,6 +123,7 @@
   int save_nturns;
   int save_compress_level;
   int foodbox;
+  int buildbox;
   int aqueductloss;
   int killcitizen;
   int techpenalty;
@@ -369,6 +370,10 @@
 #define GAME_DEFAULT_FOODBOX         10
 #define GAME_MIN_FOODBOX             5
 #define GAME_MAX_FOODBOX             30
+
+#define GAME_DEFAULT_BUILDBOX        10
+#define GAME_MIN_BUILDBOX            5
+#define GAME_MAX_BUILDBOX            30
 
 #define GAME_DEFAULT_AQUEDUCTLOSS    0
 #define GAME_MIN_AQUEDUCTLOSS        0
diff -ur -Xdiff_ignore freeciv-bcremoved/common/improvement.c 
freeciv-mod/common/improvement.c
--- freeciv-bcremoved/common/improvement.c      Tue Jan 13 16:00:42 2004
+++ freeciv-mod/common/improvement.c    Tue Jan 13 17:02:38 2004
@@ -159,7 +159,7 @@
 **************************************************************************/
 int improvement_build_value(Impr_Type_id id)
 {
-  return (improvement_types[id].build_cost);
+  return (improvement_types[id].build_cost * game.buildbox);
 }
 
 /**************************************************************************
@@ -168,9 +168,9 @@
 int improvement_buy_value(Impr_Type_id id)
 {
   if (is_wonder(id)) {
-    return (improvement_types[id].build_cost * 4);
+    return (improvement_types[id].build_cost * 40);
   } else {
-    return (improvement_types[id].build_cost * 2);
+    return (improvement_types[id].build_cost * 20);
   }
 }
 
@@ -179,7 +179,7 @@
 **************************************************************************/
 int improvement_sell_value(Impr_Type_id id)
 {
-  return (improvement_types[id].build_cost);
+  return (improvement_types[id].build_cost * game.buildbox);
 }
 
 /**************************************************************************
diff -ur -Xdiff_ignore freeciv-bcremoved/common/packets.def 
freeciv-mod/common/packets.def
--- freeciv-bcremoved/common/packets.def        Sun Jan 11 22:16:20 2004
+++ freeciv-mod/common/packets.def      Tue Jan 13 16:53:32 2004
@@ -334,6 +334,7 @@
   UINT8 angrycitizen;
   UINT8 techpenalty;
   UINT8 foodbox;
+  UINT8 buildbox;
   UINT8 civstyle;
   UINT8 diplomacy;
 
diff -ur -Xdiff_ignore freeciv-bcremoved/common/unittype.c 
freeciv-mod/common/unittype.c
--- freeciv-bcremoved/common/unittype.c Tue Jan 13 16:00:42 2004
+++ freeciv-mod/common/unittype.c       Tue Jan 13 17:04:06 2004
@@ -195,7 +195,7 @@
 **************************************************************************/
 int unit_build_value(Unit_Type_id id)
 {
-  return (unit_types[id].build_cost);
+  return (unit_types[id].build_cost * game.buildbox);
 }
 
 /**************************************************************************
@@ -203,7 +203,7 @@
 **************************************************************************/
 int unit_buy_value(Unit_Type_id id)
 {
-  return (unit_types[id].build_cost * 2);
+  return (unit_types[id].build_cost * 20);
 }
 
 /**************************************************************************
@@ -211,7 +211,7 @@
 **************************************************************************/
 int unit_disband_value(Unit_Type_id id)
 {
-  return (unit_types[id].build_cost / 2);
+  return (unit_types[id].build_cost * game.buildbox / 2);
 }
 
 /**************************************************************************
diff -ur -Xdiff_ignore freeciv-bcremoved/server/gamehand.c 
freeciv-mod/server/gamehand.c
--- freeciv-bcremoved/server/gamehand.c Wed Dec  3 22:08:14 2003
+++ freeciv-mod/server/gamehand.c       Tue Jan 13 16:54:02 2004
@@ -285,6 +285,7 @@
   ginfo.diplomacy = game.diplomacy;
   ginfo.techpenalty = game.techpenalty;
   ginfo.foodbox = game.foodbox;
+  ginfo.buildbox = game.buildbox;
   ginfo.civstyle = game.civstyle;
   ginfo.spacerace = game.spacerace;
   ginfo.unhappysize = game.unhappysize;
diff -ur -Xdiff_ignore freeciv-bcremoved/server/ruleset.c 
freeciv-mod/server/ruleset.c
--- freeciv-bcremoved/server/ruleset.c  Sun Jan 11 22:16:30 2004
+++ freeciv-mod/server/ruleset.c        Tue Jan 13 16:55:30 2004
@@ -866,7 +866,7 @@
               secfile_lookup_str_default(file, "-", "%s.graphic_alt", sec[i]));
     
     u->build_cost =
-      secfile_lookup_int(file,"%s.build_cost", sec[i]);
+      secfile_lookup_int(file,"%s.build_cost", sec[i]) / 10;
     u->pop_cost =
       secfile_lookup_int(file,"%s.pop_cost", sec[i]);
     u->attack_strength =
@@ -1219,7 +1219,7 @@
 
     b->is_wonder = secfile_lookup_bool(file, "%s.is_wonder", sec[i]);
 
-    b->build_cost = secfile_lookup_int(file, "%s.build_cost", sec[i]);
+    b->build_cost = secfile_lookup_int(file, "%s.build_cost", sec[i]) / 10;
 
     b->upkeep = secfile_lookup_int(file, "%s.upkeep", sec[i]);
 
diff -ur -Xdiff_ignore freeciv-bcremoved/server/savegame.c 
freeciv-mod/server/savegame.c
--- freeciv-bcremoved/server/savegame.c Mon Jan 12 22:16:42 2004
+++ freeciv-mod/server/savegame.c       Tue Jan 13 16:54:56 2004
@@ -1957,6 +1957,7 @@
       game.freecost    = secfile_lookup_int(file, "game.freecost");
       game.conquercost = secfile_lookup_int(file, "game.conquercost");
       game.foodbox     = secfile_lookup_int(file, "game.foodbox");
+      game.buildbox    = secfile_lookup_int(file, "game.buildbox");
       game.techpenalty = secfile_lookup_int(file, "game.techpenalty");
       game.razechance  = secfile_lookup_int(file, "game.razechance");
 
diff -ur -Xdiff_ignore freeciv-bcremoved/server/stdinhand.c 
freeciv-mod/server/stdinhand.c
--- freeciv-bcremoved/server/stdinhand.c        Thu Jan  8 22:16:08 2004
+++ freeciv-mod/server/stdinhand.c      Tue Jan 13 16:57:12 2004
@@ -437,6 +437,10 @@
          N_("Food required for a city to grow"), "", NULL,
          GAME_MIN_FOODBOX, GAME_MAX_FOODBOX, GAME_DEFAULT_FOODBOX)
 
+  GEN_INT("buildbox", game.buildbox, SSET_RULES, SSET_TO_CLIENT,
+         N_("Shields required for a city to build"), "", NULL,
+         GAME_MIN_BUILDBOX, GAME_MAX_BUILDBOX, GAME_DEFAULT_BUILDBOX)
+
   GEN_INT("aqueductloss", game.aqueductloss, SSET_RULES, SSET_TO_CLIENT,
          N_("Percentage food lost when need aqueduct"),
          N_("If a city would expand, but it can't because it needs "

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