]> git.pond.sub.org Git - empserver/commitdiff
(ichr, pchr, dchr, intrchr): Move initializer to new builtin config
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 4 Jun 2006 09:34:39 +0000 (09:34 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 4 Jun 2006 09:34:39 +0000 (09:34 +0000)
files item.config, product.config, sect.config, infra.config.
(empfile): Declare the new config files.  Reorder table entries so
that read_builtin_tables() reads the config files in the right order.

(bigcity_dchr, opt_BIG_CITY, init_dchr): Remove.  Deities can edit
sect.config instead.

13 files changed:
include/econfig-spec.h
include/file.h
src/lib/common/conftab.c
src/lib/global/file.c
src/lib/global/infra.config [new file with mode: 0644]
src/lib/global/init.c
src/lib/global/item.c
src/lib/global/item.config [new file with mode: 0644]
src/lib/global/options.c
src/lib/global/product.c
src/lib/global/product.config [new file with mode: 0644]
src/lib/global/sect.c
src/lib/global/sect.config [new file with mode: 0644]

index 3cad6277370d647da413881029815d26e08ac6d1..c19e5c268dc113c8d27862f4ded97c34a2dcfd3e 100644 (file)
@@ -149,8 +149,6 @@ EMPCFBOTH("game_hours", game_hours, char *, NSC_STRING, 0,
 EMPCF_COMMENT("\n\n### Options")
 EMPCF_OPT("ALL_BLEED", opt_ALL_BLEED,
     "Let tech bleed to everyone, not just allies")
-EMPCF_OPT("BIG_CITY", opt_BIG_CITY,
-    "Allow 10x civs in 'c' sectors")
 EMPCF_OPT("BLITZ", opt_BLITZ,
     "Enable blitz mode")
 EMPCF_OPT("BRIDGETOWERS", opt_BRIDGETOWERS,
index 073762e0b450fc513ef0fddc15c92c0e2518e100..0e0e2b5fe159db3592a7ac757a97831689458a00 100644 (file)
@@ -118,15 +118,16 @@ enum {
     EF_LOST,
     EF_REALM,
     /* Static game data (configuration) */
+    /* Order is relevant; see read_builtin_tables() */
+    EF_ITEM,
+    EF_PRODUCT,
     EF_SECTOR_CHR,
     EF_SHIP_CHR,
     EF_PLANE_CHR,
     EF_LAND_CHR,
     EF_NUKE_CHR,
     EF_NEWS_CHR,
-    EF_ITEM,
     EF_INFRASTRUCTURE,
-    EF_PRODUCT,
     EF_TABLE,
     EF_META,
     /* Symbol tables */
index a78aafc12ba321c151aeffd75a930ca8bbd0b903..27693f75751ee046860ad4254246c5b1e3825baf 100644 (file)
@@ -49,7 +49,12 @@ read_builtin_tables(void)
     struct empfile *ep;
     FILE *fp;
     int res;
-    
+
+    /*
+     * Need to read config files for tables referenced through
+     * ep->cadef[].ca_table before those for ep.  empfile[] is ordered
+     * that way.
+     */
     for (ep = empfile; ep->name; ep++) {
        if (!EF_IS_GAME_STATE(ep->uid) && ep->file) {
            if ((fp = fopen(ep->file, "r")) == NULL) {
index ac0b7e82e7c55060e052beeffec933ab7d8b192e..d3d330a5a9ae0003b0bc5299f5a37736b17c20ab 100644 (file)
@@ -145,7 +145,11 @@ struct empfile empfile[] = {
      UNMAPPED_CACHE(struct realmstr, EFF_OWNER)},
 
     /* Static game data (configuration) */
-    {EF_SECTOR_CHR, "sect-chr", NULL, dchr_ca,
+    {EF_ITEM, "item", "item.config", ichr_ca,
+     ARRAY_TABLE(ichr, EFF_CFG)},
+    {EF_PRODUCT, "product", "product.config", pchr_ca,
+     ARRAY_TABLE(pchr, EFF_CFG)},
+    {EF_SECTOR_CHR, "sect-chr", "sect.config", dchr_ca,
      ARRAY_TABLE(dchr, EFF_CFG)},
     {EF_SHIP_CHR, "ship-chr", "ship.config", mchr_ca,
      ARRAY_CACHE(mchr, EFF_CFG)},
@@ -157,12 +161,8 @@ struct empfile empfile[] = {
      ARRAY_CACHE(nchr, EFF_CFG)},
     {EF_NEWS_CHR, "news-chr", NULL, rpt_ca,
      ARRAY_TABLE(rpt, EFF_CFG)},
-    {EF_ITEM, "item", NULL, ichr_ca,
-     ARRAY_TABLE(ichr, EFF_CFG)},
-    {EF_INFRASTRUCTURE, "infrastructure", NULL, intrchr_ca,
+    {EF_INFRASTRUCTURE, "infrastructure", "infra.config", intrchr_ca,
      ARRAY_TABLE(intrchr, EFF_CFG)},
-    {EF_PRODUCT, "product", NULL, pchr_ca,
-     ARRAY_TABLE(pchr, EFF_CFG)},
     {EF_TABLE, "table", NULL, empfile_ca,
      ARRAY_TABLE(empfile, EFF_CFG)},
     {EF_META, "meta", NULL, mdchr_ca,
diff --git a/src/lib/global/infra.config b/src/lib/global/infra.config
new file mode 100644 (file)
index 0000000..e062e96
--- /dev/null
@@ -0,0 +1,6 @@
+config infrastructure
+name             lcm hcm dcost mcost
+"road network"     2   2     2     1
+"rail network"     1   1     1     1
+"defense factor"   1   1     1     1
+/config
index 82428ac20d0b37752002302a8fd1b5bbfc8a24c9..d5bb82c6d722b60fd8d7ee37db01e7f27b1bb0c6 100644 (file)
@@ -44,7 +44,6 @@
 static void init_mchr(void);
 static void init_pchr(void);
 static void init_plchr(void);
-static void init_dchr(void);
 static void init_lchr(void);
 
 void
@@ -53,7 +52,6 @@ global_init(void)
     init_pchr();
     init_mchr();
     init_plchr();
-    init_dchr();
     init_lchr();
 }
 
@@ -96,13 +94,6 @@ init_pchr(void)
     }
 }
 
-static void
-init_dchr()
-{
-    if (opt_BIG_CITY)
-       dchr[SCT_CAPIT] = bigcity_dchr;
-}
-
 static void
 init_lchr()
 {
index f72c5cc88c34b67475b3f4cfa96958fefeef1af3..8aa717f0dc5f45ef256b360dbde77959f98d2fdd 100644 (file)
 #include "misc.h"
 #include "item.h"
 
-struct ichrstr ichr[] = {
-/*  mnem  uid     val sell lbs {in rg wh  ur bnk} melt  name */
-    {'c', I_CIVIL,  1, 0,  1, {1, 10, 10, 10, 10},   4, "civilians"},
-    {'m', I_MILIT,  0, 0,  1, {1,  1,  1,  1,  1},  20, "military"},
-    {'s', I_SHELL,  5, 1,  1, {1,  1, 10,  1,  1},  80, "shells"},
-    {'g', I_GUN,   60, 1, 10, {1,  1, 10,  1,  1}, 100, "guns"},
-    {'p', I_PETROL, 4, 1,  1, {1,  1, 10,  1,  1},  50, "petrol"},
-    {'i', I_IRON,   2, 1,  1, {1,  1, 10,  1,  1}, 100, "iron ore"},
-    {'d', I_DUST,  20, 1,  5, {1,  1, 10,  1,  1}, 100, "dust (gold)"},
-    {'b', I_BAR,  280, 1, 50, {1,  1,  5,  1,  4}, 200, "bars of gold"},
-    {'f', I_FOOD,   0, 1,  1, {1,  1, 10,  1,  1},   2, "food"},
-    {'o', I_OIL,    8, 1,  1, {1,  1, 10,  1,  1},  50, "oil"},
-    {'l', I_LCM,    2, 1,  1, {1,  1, 10,  1,  1}, 100, "light products"},
-    {'h', I_HCM,    4, 1,  1, {1,  1, 10,  1,  1}, 100, "heavy products"},
-    {'u', I_UW,     1, 1,  2, {1,  1,  2,  1,  1},   2, "uncompensated workers"},
-    {'r', I_RAD,  150, 1,  8, {1,  1, 10,  1,  1},1000, "radioactive materials"},
-    {0,   I_NONE,   0, 0,  0, {0,  0,  0,  0,  0},   0, NULL}
-};
+/*
+ * Table of item types
+ * Initialized on startup from item.config and deity custom config (if any).
+ */
+struct ichrstr ichr[I_MAX + 2];
diff --git a/src/lib/global/item.config b/src/lib/global/item.config
new file mode 100644 (file)
index 0000000..f254cd5
--- /dev/null
@@ -0,0 +1,58 @@
+#
+#   Empire - A multi-player, client/server Internet based war game.
+#   Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+#                            Ken Stevens, Steve McClure
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#   ---
+#
+#   See files README, COPYING and CREDITS in the root of the source
+#   tree for related information and legal notices.  It is expected
+#   that future projects/authors will amend these files as needed.
+#
+#   ---
+#
+#   item.config: Item characteristics
+#
+#   Known contributors to this file:
+#      Markus Armbruster, 2006
+#
+#   Derived from item.c; no known contributors.
+#
+
+# Columns pkg are indexed by packing types in packing[].
+
+# Do not edit this file to customize a game!  Create your own custom
+# configuration file(s), best next to your econfig, and name them in
+# econfig key custom_tables.
+
+config item #          ineff  norm   ware   urban  bank
+uid mnem  val sell lbs pkg(0) pkg(1) pkg(2) pkg(3) pkg(4) melt name
+  0  "c"    1    0   1     1     10     10     10     10     4 "civilians"
+  1  "m"    0    0   1     1      1      1      1      1    20 "military"
+  2  "s"    5    1   1     1      1     10      1      1    80 "shells"
+  3  "g"   60    1  10     1      1     10      1      1   100 "guns"
+  4  "p"    4    1   1     1      1     10      1      1    50 "petrol"
+  5  "i"    2    1   1     1      1     10      1      1   100 "iron ore"
+  6  "d"   20    1   5     1      1     10      1      1   100 "dust (gold)"
+  7  "b"  280    1  50     1      1      5      1      4   200 "bars of gold"
+  8  "f"    0    1   1     1      1     10      1      1     2 "food"
+  9  "o"    8    1   1     1      1     10      1      1    50 "oil"
+ 10  "l"    2    1   1     1      1     10      1      1   100 "light products"
+ 11  "h"    4    1   1     1      1     10      1      1   100 "heavy products"
+ 12  "u"    1    1   2     1      1      2      1      1     2 "uncompensated workers"
+ 13  "r"  150    1   8     1      1     10      1      1  1000 "radioactive materials"
+/config
index 6f6ba31478f32a0e39d2a0c3f6ee692812801680..dab7575186480893e70e142a1ef13534d91826b9 100644 (file)
@@ -37,7 +37,6 @@
 #include "optlist.h"
 
 int opt_ALL_BLEED = 1;
-int opt_BIG_CITY = 0;
 int opt_BLITZ = 1;
 int opt_BRIDGETOWERS = 1;
 int opt_DEFENSE_INFRA = 0;
index 5d263256cbe8e2b7285ee73190326f7ad5c1ed66..37b80c5fd9e7a28da0b9b8f02ca991a2faa75f04 100644 (file)
 
 #include <config.h>
 
-#include <stddef.h>
 #include "misc.h"
 #include "product.h"
-#include "sect.h"
-#include "nat.h"
 
-
-struct pchrstr pchr[] = {
-/*       level      cost    nrndx nrdep nlndx   nlmin nllag effic  sname name */
-    {0, {I_NONE, I_NONE, I_NONE}, {0, 0, 0},
-     I_NONE, 0, 0, 0, 0, 0, 0, 0,
-     "unused", "",},
-    {P_SHELL, {I_LCM, I_HCM, I_NONE}, {2, 1, 0},
-     I_SHELL, -1, 3, 0, 0, NAT_TLEV, 20, 10,
-     "shells", "shells",},
-    {P_GUN, {I_OIL, I_LCM, I_HCM}, {1, 5, 10},
-     I_GUN, -1, 30, 0, 0, NAT_TLEV, 20, 10,
-     "guns", "guns",},
-    {P_PETROL, {I_OIL, I_NONE, I_NONE}, {1, 0, 0},
-     I_PETROL, -1, 1, 0, 0, NAT_TLEV, 20, 10,
-     "petrol", "petrol",},
-    {P_IRON, {I_NONE, I_NONE, I_NONE}, {0, 0, 0},
-     I_IRON, -1, 0, offsetof(struct sctstr, sct_min), 0, -1, 0, 0,
-     "iron ore", "iron",},
-    {P_DUST, {I_NONE, I_NONE, I_NONE}, {0, 0, 0},
-     I_DUST, -1, 0, offsetof(struct sctstr, sct_gmin), 20, -1, 0, 0,
-     "gold dust", "dust",},
-    {P_BAR, {I_DUST, I_NONE, I_NONE}, {5, 0, 0},
-     I_BAR, -1, 10, 0, 0, -1, 0, 0,
-     "gold bars", "bars",},
-    {P_FOOD, {I_NONE, I_NONE, I_NONE}, {0, 0, 0},
-     I_FOOD, -1, 0, offsetof(struct sctstr, sct_fertil), 0, NAT_TLEV, -10, 10,
-     "food", "food",},
-    {P_OIL, {I_NONE, I_NONE, I_NONE}, {0, 0, 0},
-     I_OIL, -1, 0, offsetof(struct sctstr, sct_oil), 10, NAT_TLEV, -10, 10,
-     "oil", "oil",},
-    {P_LCM, {I_IRON, I_NONE, I_NONE}, {1, 0, 0},
-     I_LCM, -1, 0, 0, 0, NAT_TLEV, -10, 10,
-     "light construction materials", "lcm",},
-    {P_HCM, {I_IRON, I_NONE, I_NONE}, {2, 0, 0},
-     I_HCM, -1, 0, 0, 0, NAT_TLEV, -10, 10,
-     "heavy construction materials", "hcm",},
-    {P_TLEV, {I_DUST, I_OIL, I_LCM}, {1, 5, 10},
-     I_NONE, NAT_TLEV, 300, 0, 0, NAT_ELEV, 5, 10,
-     "technological breakthroughs", "tech",},
-    {P_RLEV, {I_DUST, I_OIL, I_LCM}, {1, 5, 10},
-     I_NONE, NAT_RLEV, 90, 0, 0, NAT_ELEV, 5, 10,
-     "medical discoveries", "medical",},
-    {P_ELEV, {I_LCM, I_NONE, I_NONE}, {1, 0, 0},
-     I_NONE, NAT_ELEV, 9, 0, 0, -1, 0, 0,
-     "a class of graduates", "edu",},
-    {P_HLEV, {I_LCM, I_NONE, I_NONE}, {1, 0, 0},
-     I_NONE, NAT_HLEV, 9, 0, 0, -1, 0, 0,
-     "happy strollers", "happy",},
-    {P_URAN, {I_NONE, I_NONE, I_NONE}, {0, 0, 0},
-     I_RAD, -1, 2, offsetof(struct sctstr, sct_uran), 35, NAT_TLEV, 40, 10,
-     "radioactive materials", "rad",},
-    {0, {I_NONE, I_NONE, I_NONE}, {0, 0, 0},
-     I_NONE, 0, 0, 0, 0, 0, 0, 0, NULL, NULL,}
-};
+/*
+ * Table of product types
+ * Initialized on startup from product.config and deity custom config (if any).
+ */
+struct pchrstr pchr[P_URAN + 2];
diff --git a/src/lib/global/product.config b/src/lib/global/product.config
new file mode 100644 (file)
index 0000000..59ce56f
--- /dev/null
@@ -0,0 +1,62 @@
+#
+#   Empire - A multi-player, client/server Internet based war game.
+#   Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+#                            Ken Stevens, Steve McClure
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#   ---
+#
+#   See files README, COPYING and CREDITS in the root of the source
+#   tree for related information and legal notices.  It is expected
+#   that future projects/authors will amend these files as needed.
+#
+#   ---
+#
+#   product.config: Product characteristics
+#
+#   Known contributors to this file:
+#      Markus Armbruster, 2006
+#
+#   Derived from product.c; no known contributors
+#
+
+# Available item types (columns ct and type) are in item.config.
+# Levels (columns lev and nlndx) are in level[].  Resources (column
+# nrndx) are in resources[].
+
+# Do not edit this file to customize a game!  Create your own custom
+# configuration file(s), best next to your econfig, and name them in
+# econfig key custom_tables.
+
+config product
+uid sname     ct(0) ct(1) ct(2) ca(0) ca(1) ca(2) type  lev cost nrndx nrdep nlndx nlmin nllag name
+  0 ""          -1    -1    -1     0     0     0    -1    0    0     0     0  tech     0     0 "unused"
+  1 "shells"     l     h    -1     2     1     0     s none    3     0     0  tech    20    10 "shells"
+  2 "guns"       o     l     h     1     5    10     g none   30     0     0  tech    20    10 "guns"
+  3 "petrol"     o    -1    -1     1     0     0     p none    1     0     0  tech    20    10 "petrol"
+  4 "iron"      -1    -1    -1     0     0     0     i none    0   min     0  none     0     0 "iron ore"
+  5 "dust"      -1    -1    -1     0     0     0     d none    0  gold    20  none     0     0 "gold dust"
+  6 "bars"       d    -1    -1     5     0     0     b none   10     0     0  none     0     0 "gold bars"
+  7 "food"      -1    -1    -1     0     0     0     f none    0  fert     0  tech   -10    10 "food"
+  8 "oil"       -1    -1    -1     0     0     0     o none    0  ocon    10  tech   -10    10 "oil"
+  9 "lcm"        i    -1    -1     1     0     0     l none    0     0     0  tech   -10    10 "light construction materials"
+ 10 "hcm"        i    -1    -1     2     0     0     h none    0     0     0  tech   -10    10 "heavy construction materials"
+ 11 "tech"       d     o     l     1     5    10    -1 tech  300     0     0   edu     5    10 "technological breakthroughs"
+ 12 "medical"    d     o     l     1     5    10    -1  res   90     0     0   edu     5    10 "medical discoveries"
+ 13 "edu"        l    -1    -1     1     0     0    -1  edu    9     0     0  none     0     0 "a class of graduates"
+ 14 "happy"      l    -1    -1     1     0     0    -1  hap    9     0     0  none     0     0 "happy strollers"
+ 15 "rad"       -1    -1    -1     0     0     0     r none    2  uran    35  tech    40    10 "radioactive materials"
+/config
index 1fafd885684b3e56a52a12c64283e49a2483317e..e74d0b80286104ca5e3ca9e675354e9cd3599b97 100644 (file)
  *     Steve McClure, 1998
  */
 
-/* order must agree with sect.h */
-
 #include <config.h>
 
 #include "misc.h"
 #include "sect.h"
-#include "product.h"
-
-struct dchrstr bigcity_dchr = {
-    SCT_CAPIT,   'c',       0,  0, 2, NAV_CANAL, UPKG, 1.0, 2.0,   30, 0, 10, 1, 2, 999, "city"
-};
 
-struct dchrstr dchr[] = {
-    /*          mnem  prd peffic mcst  flg       pkg  ostr dstr value  $ bld lcm hcm maxpop name */
-    {SCT_WATER,  '.',       0,   0, 0, NAVOK,    NPKG, 0.0,  0.0,   0, -1, 0, 0, 0,   0, "sea"},
-    {SCT_MOUNT,  '^', P_DUST,   75, 25, NAV_NONE, NPKG, 1.0,  4.0,   5, -1, 1, 0, 0,  99, "mountain"},
-    {SCT_SANCT,  's',       0,   0, 0, NAV_NONE, NPKG, 0.0, 99.0, 127, -1, 0, 0, 0, 999, "sanctuary"},
-    {SCT_WASTE,  '\\',      0,   0, 0, NAV_NONE, NPKG, 0.0, 99.0,   0, -1, 0, 0, 0,   0, "wasteland"},
-    {SCT_RURAL,  '-',       0,   0, 3, NAV_NONE, NPKG, 1.0,  2.0,   1,  0, 0, 0, 0, 999, "wilderness"},
-    {SCT_CAPIT,  'c',       0,   0, 2, NAV_NONE, NPKG, 1.0,  2.0,  30,  0, 1, 0, 0, 999, "capital"},
-    {SCT_URAN,   'u', P_URAN,  100, 2, NAV_NONE, NPKG, 1.0,  2.0,  15,  0, 1, 0, 0, 999, "uranium mine"},
-    {SCT_PARK,   'p', P_HLEV,  100, 2, NAV_NONE, NPKG, 1.0,  1.5,   5,  0, 1, 0, 0, 999, "park"},
-    {SCT_ARMSF,  'd', P_GUN,   100, 2, NAV_NONE, NPKG, 1.0,  1.5,   7,  0, 1, 0, 0, 999, "defense plant"},
-    {SCT_AMMOF,  'i', P_SHELL, 100, 2, NAV_NONE, NPKG, 1.0,  1.5,   6,  0, 1, 0, 0, 999, "shell industry"},
-    {SCT_MINE,   'm', P_IRON,  100, 2, NAV_NONE, NPKG, 1.0,  2.0,   5,  0, 1, 0, 0, 999, "mine"},
-    {SCT_GMINE,  'g', P_DUST,  100, 2, NAV_NONE, NPKG, 1.0,  2.0,   8,  0, 1, 0, 0, 999, "gold mine"},
-    {SCT_HARBR,  'h',       0,   0, 2, NAV_02,   WPKG, 1.0,  1.5,  12,  0, 1, 0, 0, 999, "harbor"},
-    {SCT_WAREH,  'w',      0,   0, 2, NAV_NONE, WPKG, 1.0,  1.5,   7,  0, 1, 0, 0, 999, "warehouse"},
-    {SCT_AIRPT,  '*',      0,   0, 2, NAV_NONE, NPKG, 1.0,  1.25, 12,  0, 1, 0, 0, 999, "airfield"},
-    {SCT_AGRI,   'a', P_FOOD,  900, 2, NAV_NONE, NPKG, 1.0,  1.5,   2,  0, 1, 0, 0, 999, "agribusiness"},
-    {SCT_OIL,    'o', P_OIL,   100, 2, NAV_NONE, NPKG, 1.0,  1.5,   5,  0, 1, 0, 0, 999, "oil field"},
-    {SCT_LIGHT,  'j', P_LCM,   100, 2, NAV_NONE, NPKG, 1.0,  1.5,   3,  0, 1, 0, 0, 999, "light manufacturing"},
-    {SCT_HEAVY,  'k', P_HCM,   100, 2, NAV_NONE, NPKG, 1.0,  1.5,   4,  0, 1, 0, 0, 999, "heavy manufacturing"},
-    {SCT_FORTR,  'f',       0,   0, 2, NAV_NONE, NPKG, 2.0,  4.0,  10,  0, 5, 0, 1, 999, "fortress"},
-    {SCT_TECH,   't', P_TLEV,  100, 2, NAV_NONE, NPKG, 1.0,  1.5,  10,  0, 1, 0, 0, 999, "technical center"},
-    {SCT_RSRCH,  'r', P_RLEV,  100, 2, NAV_NONE, NPKG, 1.0,  1.5,   9,  0, 1, 0, 0, 999, "research lab"},
-    {SCT_NUKE,   'n',       0,   0, 2, NAV_NONE, NPKG, 1.0,  2.0,  10,  0, 1, 0, 0, 999, "nuclear plant"},
-    {SCT_LIBR,   'l', P_ELEV,  100, 2, NAV_NONE, NPKG, 1.0,  1.5,   4,  0, 1, 0, 0, 999, "library/school"},
-    {SCT_HIWAY,  '+',      0,   0, 1, NAV_NONE, NPKG, 1.0,  1.0,   3,  0, 1, 0, 0, 999, "highway"},
-    {SCT_RADAR,  ')',      0,   0, 2, NAV_NONE, NPKG, 1.0,  1.5,   4,  0, 1, 0, 0, 999, "radar installation"},
-    {SCT_HEADQ,  '!',      0,   0, 2, NAV_NONE, NPKG, 1.0,  1.5,  12,  0, 1, 0, 0, 999, "headquarters"},
-    {SCT_BHEAD,  '#',      0,   0, 1, NAV_NONE, NPKG, 1.0,  1.5,   4,  0, 1, 0, 0, 999, "bridge head"},
-    {SCT_BSPAN,  '=',      0,   0, 1, NAV_60,   NPKG, 1.0,  1.0,   5, -1, 1, 0, 0, 999, "bridge span"},
-    {SCT_BANK,   'b', P_BAR,   100, 2, NAV_NONE, BPKG, 1.0,  2.25, 10,  0, 1, 0, 0, 999, "bank"},
-    {SCT_REFINE, '%', P_PETROL, 1000, 2, NAV_NONE, NPKG, 1.0, 1.5,  2,  0, 1, 0, 0, 999, "refinery"},
-    {SCT_ENLIST, 'e',      0,   0, 2, NAV_NONE, NPKG, 1.0,  2.0,   7,  0, 1, 0, 0, 999, "enlistment center"},
-    {SCT_PLAINS, '~',      0,   0, 2, NAV_NONE, NPKG, 1.0,  1.5,   1, -1, 1, 0, 0,  49, "plains"},
-    {SCT_BTOWER, '@',      0,   0, 1, NAV_NONE, NPKG, 1.0,  1.5,   4, -1, 1, 0, 0, 999, "bridge tower"},
-    {0, 0, 0, 0, 0, NAV_NONE, IPKG, 0, 0, 0, 0, 0, 0, 0, 0, NULL},
-};
+/*
+ * Table of sector designations
+ * Initialized on startup from sect.config and deity custom config (if any).
+ */
+struct dchrstr dchr[SCT_MAXDEF + 1];
 
-struct sctintrins intrchr[] = {
-/* name              lcm hcm dollars mobility */
-    {"road network", 2, 2, 2, 1},
-    {"rail network", 1, 1, 1, 1},
-    {"defense factor", 1, 1, 1, 1},
-    {0, 0, 0, 0, 0}
-};
+/*
+ * Table of infrastructure types
+ * Initialized on startup from infra.config and deity custom config (if any).
+ */
+struct sctintrins intrchr[INT_DEF + 2];
diff --git a/src/lib/global/sect.config b/src/lib/global/sect.config
new file mode 100644 (file)
index 0000000..966d63a
--- /dev/null
@@ -0,0 +1,87 @@
+#
+#   Empire - A multi-player, client/server Internet based war game.
+#   Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+#                            Ken Stevens, Steve McClure
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#   ---
+#
+#   See files README, COPYING and CREDITS in the root of the source
+#   tree for related information and legal notices.  It is expected
+#   that future projects/authors will amend these files as needed.
+#
+#   ---
+#
+#   sect.config: Sector characteristics
+#
+#   Known contributors to this file:
+#      Markus Armbruster, 2006
+#
+#   Derived from sect.c; known contributors:
+#      Dave Pare, 1986
+#      Jeff Bailey
+#      Thomas Ruschak, 1992
+#      Ken Stevens, 1995
+#      Steve McClure, 1998
+#
+
+# Available products (column prd) are in product.config.  Navigation
+# types (column nav) are in sector_navigation[].  Packing types
+# (column pkg) are in packing[].
+
+# Do not edit this file to customize a game!  Create your own custom
+# configuration file(s), best next to your econfig, and name them in
+# econfig key custom_tables.
+
+config sect-chr
+uid mnem  prd peff mcst  nav  pkg ostr dstr val cost bui lcm hcm maxp name
+  0  "."    0    0    0  sea norm  0.0  0.0   0   -1   0   0   0    0 "sea"
+  1  "^" dust   75   25 land norm  1.0  4.0   5   -1   1   0   0   99 "mountain"
+  2  "s"    0    0    0 land norm  0.0 99.0 127   -1   0   0   0  999 "sanctuary"
+  3 "\134"  0    0    0 land norm  0.0 99.0   0   -1   0   0   0    0 "wasteland"
+  4  "-"    0    0    3 land norm  1.0  2.0   1    0   0   0   0  999 "wilderness"
+# Uncomment one of the following two.  The second is for big cities.
+  5  "c"    0    0    2 land norm  1.0  2.0  30    0   1   0   0  999 "capital"
+# 5  "c"    0    0    2 cana urba  1.0  2.0  30    0  10   1   2  999 "city"
+  6  "u"  rad  100    2 land norm  1.0  2.0  15    0   1   0   0  999 "uranium mine"
+  7  "p"  hap  100    2 land norm  1.0  1.5   5    0   1   0   0  999 "park"
+  8  "d"  gun  100    2 land norm  1.0  1.5   7    0   1   0   0  999 "defense plant"
+  9  "i"   sh  100    2 land norm  1.0  1.5   6    0   1   0   0  999 "shell industry"
+ 10  "m" iron  100    2 land norm  1.0  2.0   5    0   1   0   0  999 "mine"
+ 11  "g" dust  100    2 land norm  1.0  2.0   8    0   1   0   0  999 "gold mine"
+ 12  "h"    0    0    2 harb ware  1.0  1.5  12    0   1   0   0  999 "harbor"
+ 13  "w"    0    0    2 land ware  1.0  1.5   7    0   1   0   0  999 "warehouse"
+ 14  "*"    0    0    2 land norm  1.0  1.25 12    0   1   0   0  999 "airfield"
+ 15  "a" food  900    2 land norm  1.0  1.5   2    0   1   0   0  999 "agribusiness"
+ 16  "o"  oil  100    2 land norm  1.0  1.5   5    0   1   0   0  999 "oil field"
+ 17  "j"  lcm  100    2 land norm  1.0  1.5   3    0   1   0   0  999 "light manufacturing"
+ 18  "k"  hcm  100    2 land norm  1.0  1.5   4    0   1   0   0  999 "heavy manufacturing"
+ 19  "f"    0    0    2 land norm  2.0  4.0  10    0   5   0   1  999 "fortress"
+ 20  "t" tech  100    2 land norm  1.0  1.5  10    0   1   0   0  999 "technical center"
+ 21  "r"  med  100    2 land norm  1.0  1.5   9    0   1   0   0  999 "research lab"
+ 22  "n"    0    0    2 land norm  1.0  2.0  10    0   1   0   0  999 "nuclear plant"
+ 23  "l"  edu  100    2 land norm  1.0  1.5   4    0   1   0   0  999 "library/school"
+ 24  "+"    0    0    1 land norm  1.0  1.0   3    0   1   0   0  999 "highway"
+ 25  ")"    0    0    2 land norm  1.0  1.5   4    0   1   0   0  999 "radar installation"
+ 26  "!"    0    0    2 land norm  1.0  1.5  12    0   1   0   0  999 "headquarters"
+ 27  "#"    0    0    1 land norm  1.0  1.5   4    0   1   0   0  999 "bridge head"
+ 28  "="    0    0    1 brid norm  1.0  1.0   5   -1   1   0   0  999 "bridge span"
+ 29  "b" bars  100    2 land bank  1.0  2.25 10    0   1   0   0  999 "bank"
+ 30  "%"  pet 1000    2 land norm  1.0  1.5   2    0   1   0   0  999 "refinery"
+ 31  "e"    0    0    2 land norm  1.0  2.0   7    0   1   0   0  999 "enlistment center"
+ 32  "~"    0    0    2 land norm  1.0  1.5   1   -1   1   0   0   49 "plains"
+ 33  "@"    0    0    1 land norm  1.0  1.5   4   -1   1   0   0  999 "bridge tower"
+/config