]> git.pond.sub.org Git - empserver/commitdiff
(dchr_ca, packing, empfile): Add packing symbol table.
authorRon Koenderink <rkoenderink@yahoo.ca>
Sun, 13 Nov 2005 12:27:02 +0000 (12:27 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Sun, 13 Nov 2005 12:27:02 +0000 (12:27 +0000)
(sect_ca, ship_ca, land_ca, plague_stages, empfile):
Add plague stages symbol table.

(treaty_ca, loan_ca, agreement_statuses, empfile):
Add agreement status symbol table.
Combine treatystatuses (TS_FREE, TS_SIGNED and TS_PENDING)
and loan statuses (LS_FREE, LS_SIGNED and LS_PENDING)
into a single agreement status.

(pchr_ca, level, empfile): Add packing symbol table.

include/file.h
include/loan.h
include/misc.h
include/nsc.h
include/treaty.h
src/lib/global/file.c
src/lib/global/nsc.c

index d7a10357a653d825cd79d9861822828bda0852d0..42c979dd3cc39a98674b57c795f6877365c64083 100644 (file)
@@ -137,7 +137,11 @@ struct empfile {
 #define EF_RETREAT_FLAGS       35
 #define EF_NATION_FLAGS        36
 #define EF_NATION_RELATIONS 37
-#define EF_MAX         38
+#define EF_LEVEL       38
+#define EF_AGREEMENT_STATUS    39
+#define EF_PLAGUE_STAGES       40
+#define EF_PACKING     41
+#define EF_MAX         42
 
 #define EF_IS_GAME_STATE(type) (EF_SECTOR <= (type) && (type) <= EF_LOST)
 
index 6064ad48a1d71ab69a12bd6524ddb039b2c1d7aa..fe88f5a29aaba42cb68d7b5a70bcc6ed8bda68be 100644 (file)
@@ -52,9 +52,9 @@ struct lonstr {
     time_t l_duedate;          /* date after which interest doubles, etc */
 };
 
-#define LS_FREE                0
-#define LS_PROPOSED    1
-#define LS_SIGNED      2
+#define LS_FREE                AGREE_FREE
+#define LS_PROPOSED    AGREE_PROPOSED
+#define LS_SIGNED      AGREE_SIGNED
 
 extern long get_outstand(int);
 extern double loan_owed(struct lonstr *loan, time_t paytime);
index 9bb5cf39b103e4057fcf244387058e9de20fe7ab..d29738a72706de893e25f36a792e45aa30550725 100644 (file)
@@ -146,4 +146,8 @@ extern char *ugetstring(char *prompt, char buf[]);
 extern s_char *prbuf(s_char *format, ...)
     ATTRIBUTE((format (printf, 1, 2)));
 
+#define AGREE_FREE     0
+#define AGREE_PROPOSED 1
+#define AGREE_SIGNED   2
+
 #endif /* _MISC_H_ */
index 090f9fd32cd20ca1360306cdf74ef40fe97b90ff..a55972748ea9b4e678b7c3f892a5e4ec69f935d7 100644 (file)
@@ -229,6 +229,10 @@ extern struct symbol plane_flags[];
 extern struct symbol retreat_flags[];
 extern struct symbol nation_flags[];
 extern struct symbol nation_relations[];
+extern struct symbol level[];
+extern struct symbol agreement_statuses[];
+extern struct symbol plague_stages[];
+extern struct symbol packing[];
 
 /* src/lib/subs/nstr.c */
 extern int nstr_comp(struct nscstr *np, int len, int type, char *str);
index 1e19a0f985150ab6aa26ab271f6da9b8564a7780..b06db7c8cfcdb890128408088d001741c16e9bc6 100644 (file)
@@ -48,9 +48,9 @@ struct trtstr {
     time_t trt_exp;            /* expiration date */
 };
 
-#define TS_FREE                0
-#define TS_PROPOSED    1
-#define TS_SIGNED      2
+#define TS_FREE                AGREE_FREE
+#define TS_PROPOSED    AGREE_PROPOSED
+#define TS_SIGNED      AGREE_SIGNED
 
        /* treaty clauses */
 #define        LNDATT  bit(0)          /* no attacks on land units */
index 67dfe0ceb6ab7b34c67f4877a488096f92b1e501..d3d7e1c5a855d649e9f4a52a81449c2b326065f9 100644 (file)
@@ -173,6 +173,13 @@ struct empfile empfile[] = {
      PTR_CACHE(nation_flags, EFF_CFG)},
     {EF_NATION_RELATIONS, "nation relationships", NULL, symbol_ca,
      PTR_CACHE(nation_relations, EFF_CFG)},
+    {EF_LEVEL, "level", NULL, symbol_ca, PTR_CACHE(level, EFF_CFG)},
+    {EF_AGREEMENT_STATUS, "agreement status", NULL, symbol_ca,
+     PTR_CACHE(agreement_statuses, EFF_CFG)},
+    {EF_PLAGUE_STAGES, "plague stages", NULL, symbol_ca,
+     PTR_CACHE(plague_stages, EFF_CFG)},
+    {EF_PACKING, "packing", NULL, symbol_ca,
+     PTR_CACHE(packing, EFF_CFG)},
 
     /* Sentinel */
     {EF_BAD, NULL, NULL, NULL, 0, 0, NULL, 0, 0, 0, 0, -1, NULL, NULL, NULL},
index 9a59233641c1cf0830c370592c57d2e5dbdb28e2..5a7a3040a1f8acb17a9e005bc3586782227f6a4e 100644 (file)
@@ -53,6 +53,7 @@
 #include "product.h"
 #include "file.h"
 #include "mission.h"
+#include "plague.h"
 
 #define fldoff(str, fld) offsetof(struct str, fld)
 
@@ -98,7 +99,7 @@ struct castr pchr_ca[] = {
      EF_BAD},
     {NSC_SITYPE(i_type), 0, 0, offsetof(struct pchrstr, p_type), "type",
      EF_ITEM},
-    {NSC_INT, 0, 0, offsetof(struct pchrstr, p_level), "level", EF_BAD},
+    {NSC_INT, 0, 0, offsetof(struct pchrstr, p_level), "level", EF_LEVEL},
     {NSC_INT, 0, 0, offsetof(struct pchrstr, p_cost), "cost", EF_BAD},
     {NSC_INT, 0, 0, offsetof(struct pchrstr, p_nrndx), "nrndx", EF_BAD},
     {NSC_INT, 0, 0, offsetof(struct pchrstr, p_nrdep), "nrdep", EF_BAD},
@@ -139,7 +140,8 @@ struct castr sect_ca[] = {
     NSC_IVEC(fldoff(sctstr, sct_dist), "_dist"),
     NSC_IVEC(fldoff(sctstr, sct_del), "_del"),
     {NSC_SHORT, NSC_DEITY, 0, fldoff(sctstr, sct_mines), "mines", EF_BAD},
-    {NSC_SHORT, NSC_DEITY, 0, fldoff(sctstr, sct_pstage), "pstage", EF_BAD},
+    {NSC_SHORT, NSC_DEITY, 0, fldoff(sctstr, sct_pstage), "pstage",
+     EF_PLAGUE_STAGES},
     {NSC_SHORT, NSC_DEITY, 0, fldoff(sctstr, sct_ptime), "ptime", EF_BAD},
     {NSC_UCHAR, NSC_DEITY, 0, fldoff(sctstr, sct_che), "che", EF_BAD},
     {NSC_NATID, NSC_DEITY, 0, fldoff(sctstr, sct_che_target), "che_target",
@@ -161,7 +163,7 @@ struct castr dchr_ca[] = {
     {NSC_INT, 0, 0, offsetof(struct dchrstr, d_mcst), "mcst", EF_BAD},
     {NSC_INT, 0, 0, offsetof(struct dchrstr, d_flg), "flg", EF_BAD},
     {NSC_SITYPE(i_packing), 0, 0, offsetof(struct dchrstr, d_pkg), "pkg",
-     EF_BAD},
+     EF_PACKING},
     {NSC_FLOAT, 0, 0, offsetof(struct dchrstr, d_ostr), "ostr", EF_BAD},
     {NSC_FLOAT, 0, 0, offsetof(struct dchrstr, d_dstr), "dstr", EF_BAD},
     {NSC_INT, 0, 0, offsetof(struct dchrstr, d_value), "value", EF_BAD},
@@ -205,7 +207,8 @@ struct castr ship_ca[] = {
     {NSC_SHORT, 0, TMAX, fldoff(shpstr, shp_lend), "amtend", EF_BAD},
     {NSC_UCHAR, 0, 0, fldoff(shpstr, shp_autonav), "autonav", EF_BAD},
     NSC_IVEC(fldoff(shpstr, shp_item), ""),
-    {NSC_SHORT, NSC_DEITY, 0, fldoff(shpstr, shp_pstage), "pstage", EF_BAD},
+    {NSC_SHORT, NSC_DEITY, 0, fldoff(shpstr, shp_pstage), "pstage",
+     EF_PLAGUE_STAGES},
     {NSC_SHORT, NSC_DEITY, 0, fldoff(shpstr, shp_ptime), "ptime", EF_BAD},
     {NSC_TIME, 0, 0, fldoff(shpstr, shp_access), "access", EF_BAD},
     {NSC_TIME, NSC_EXTRA, 0, fldoff(shpstr, shp_timestamp), "timestamp",
@@ -305,7 +308,8 @@ struct castr land_ca[] = {
     {NSC_STRINGY, 0, RET_LEN, fldoff(lndstr, lnd_rpath), "rpath", EF_BAD},
     {NSC_UCHAR, 0, 0, fldoff(lndstr, lnd_rad_max), "react", EF_BAD},
     NSC_IVEC(fldoff(lndstr, lnd_item), ""),
-    {NSC_SHORT, NSC_DEITY, 0, fldoff(lndstr, lnd_pstage), "pstage", EF_BAD},
+    {NSC_SHORT, NSC_DEITY, 0, fldoff(lndstr, lnd_pstage), "pstage",
+     EF_PLAGUE_STAGES},
     {NSC_SHORT, NSC_DEITY, 0, fldoff(lndstr, lnd_ptime), "ptime", EF_BAD},
     {NSC_SHORT, 0, 0, fldoff(lndstr, lnd_land), "land", EF_BAD},
     {NSC_UCHAR, NSC_EXTRA, 0, fldoff(lndstr, lnd_nland), "nland", EF_BAD},
@@ -393,7 +397,8 @@ struct castr treaty_ca[] = {
     {NSC_SHORT, 0, 0, fldoff(trtstr, trt_uid), "uid", EF_TREATY},
     {NSC_NATID, 0, 0, fldoff(trtstr, trt_cna), "cna", EF_NATION},
     {NSC_NATID, 0, 0, fldoff(trtstr, trt_cnb), "cnb", EF_NATION},
-    {NSC_CHAR, 0, 0, fldoff(trtstr, trt_status), "status", EF_BAD},
+    {NSC_CHAR, 0, 0, fldoff(trtstr, trt_status), "status",
+     EF_AGREEMENT_STATUS},
     {NSC_SHORT, NSC_BITS, 0, fldoff(trtstr, trt_acond), "acond",
      EF_TREATY_FLAGS},
     {NSC_SHORT, NSC_BITS, 0, fldoff(trtstr, trt_bcond), "bcond",
@@ -406,7 +411,8 @@ struct castr loan_ca[] = {
     {NSC_SHORT, 0, 0, fldoff(lonstr, l_uid), "uid", EF_LOAN},
     {NSC_NATID, 0, 0, fldoff(lonstr, l_loner), "loaner", EF_NATION},
     {NSC_NATID, 0, 0, fldoff(lonstr, l_lonee), "loanee", EF_NATION},
-    {NSC_CHAR, 0, 0, fldoff(lonstr, l_status), "status", EF_BAD},
+    {NSC_CHAR, 0, 0, fldoff(lonstr, l_status), "status",
+     EF_AGREEMENT_STATUS},
     {NSC_INT, 0, 0, fldoff(lonstr, l_irate), "irate", EF_BAD},
     {NSC_INT, 0, 0, fldoff(lonstr, l_ldur), "ldur", EF_BAD},
     {NSC_LONG, 0, 0, fldoff(lonstr, l_amtpaid), "amtpaid", EF_BAD},
@@ -694,3 +700,36 @@ struct symbol nation_relations[] = {
     {ALLIED, "allied"},
     {0, NULL}
 };
+
+struct symbol level[] = {
+    {NAT_TLEV, "technology"},
+    {NAT_RLEV, "research"},
+    {NAT_ELEV, "education"},
+    {NAT_HLEV, "happiness"},
+    {0, NULL}
+};
+
+struct symbol agreement_statuses[] = {
+    {AGREE_FREE, "free"},
+    {AGREE_PROPOSED, "proposed"},
+    {AGREE_SIGNED, "signed"},
+    {0, NULL}
+};
+
+struct symbol plague_stages[] = {
+    {PLG_HEALTHY, "healthy"},
+    {PLG_DYING, "dying"},
+    {PLG_INFECT, "infect"},
+    {PLG_INCUBATE, "incubate"},
+    {PLG_EXPOSED, "exposed"},
+    {0, NULL}
+};
+
+struct symbol packing[] = {
+    {IPKG, "inefficient"},
+    {NPKG, "normal"},
+    {WPKG, "warehouse"},
+    {UPKG, "urban"},
+    {BPKG, "bank"},
+    {0, NULL}
+};