(pchrstr, pchr_ca, pchr, sctstr, dchr_ca, dchr): Replace pchrstr

member p_effic by sctstr member d_peffic.  Tables updated.
(show_sect_capab): Adapted.
(prod_eff): Adapted; requires changing first parameter to sector type.
Callers changed.
(P_MDUST): Remove, because pchr[P_MDUST] now identical to
pchr[P_DUST].
This commit is contained in:
Markus Armbruster 2006-06-02 05:35:54 +00:00
parent 568b9d6639
commit da88d91899
10 changed files with 69 additions and 72 deletions

View file

@ -54,7 +54,6 @@ struct pchrstr {
int p_nlndx; /* index (NAT_?LEV) affecting production */ int p_nlndx; /* index (NAT_?LEV) affecting production */
int p_nlmin; /* minimum lvl required */ int p_nlmin; /* minimum lvl required */
int p_nllag; /* lag, mul by (lvl-nlmin)/(lvl-nlmin+nllag) */ int p_nllag; /* lag, mul by (lvl-nlmin)/(lvl-nlmin+nllag) */
int p_effic; /* process efficiency, mult by p_effic/100 */
char *p_name; /* name of product */ char *p_name; /* name of product */
char *p_sname; /* short (7 char or less) name of product */ char *p_sname; /* short (7 char or less) name of product */
}; };
@ -74,8 +73,7 @@ struct pchrstr {
#define P_ELEV 13 #define P_ELEV 13
#define P_HLEV 14 #define P_HLEV 14
#define P_URAN 15 #define P_URAN 15
#define P_MDUST 16
extern struct pchrstr pchr[P_MDUST + 2]; extern struct pchrstr pchr[P_URAN + 2];
#endif #endif

View file

@ -780,7 +780,7 @@ extern int bank_income(struct sctstr *, int);
/* produce.c */ /* produce.c */
extern int produce(struct natstr *, struct sctstr *, short *, int, int, extern int produce(struct natstr *, struct sctstr *, short *, int, int,
int, int *, int *); int, int *, int *);
extern double prod_eff(struct pchrstr *, float); extern double prod_eff(int, float);
/* removewants.c */ /* removewants.c */
extern int update_removewants(void); extern int update_removewants(void);
/* revolt.c */ /* revolt.c */

View file

@ -99,6 +99,7 @@ struct dchrstr {
unsigned char d_uid; unsigned char d_uid;
char d_mnem; /* map symbol */ char d_mnem; /* map symbol */
int d_prd; /* product type */ int d_prd; /* product type */
int d_peffic; /* process efficiency, in percent */
int d_mcst; /* movement cost */ int d_mcst; /* movement cost */
d_navigation d_nav; /* navigation capability */ d_navigation d_nav; /* navigation capability */
i_packing d_pkg; /* type of packaging in these sects */ i_packing d_pkg; /* type of packaging in these sects */

View file

@ -206,7 +206,7 @@ prod(void)
/* /*
* production effic. * production effic.
*/ */
prodeff = prod_eff(pp, natp->nat_level[pp->p_nlndx]); prodeff = prod_eff(type, natp->nat_level[pp->p_nlndx]);
/* /*
* raw material limit * raw material limit
*/ */

View file

@ -114,7 +114,6 @@ struct castr pchr_ca[] = {
{NSC_INT, 0, 0, offsetof(struct pchrstr, p_nlndx), "nlndx", EF_LEVEL}, {NSC_INT, 0, 0, offsetof(struct pchrstr, p_nlndx), "nlndx", EF_LEVEL},
{NSC_INT, 0, 0, offsetof(struct pchrstr, p_nlmin), "nlmin", EF_BAD}, {NSC_INT, 0, 0, offsetof(struct pchrstr, p_nlmin), "nlmin", EF_BAD},
{NSC_INT, 0, 0, offsetof(struct pchrstr, p_nllag), "nllag", EF_BAD}, {NSC_INT, 0, 0, offsetof(struct pchrstr, p_nllag), "nllag", EF_BAD},
{NSC_INT, 0, 0, offsetof(struct pchrstr, p_effic), "effic", EF_BAD},
{NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD} {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
}; };
@ -172,6 +171,7 @@ struct castr dchr_ca[] = {
{NSC_STRINGY, NSC_CONST, 1, offsetof(struct dchrstr, d_mnem), "mnem", {NSC_STRINGY, NSC_CONST, 1, offsetof(struct dchrstr, d_mnem), "mnem",
EF_BAD}, EF_BAD},
{NSC_INT, 0, 0, offsetof(struct dchrstr, d_prd), "prd", EF_PRODUCT}, {NSC_INT, 0, 0, offsetof(struct dchrstr, d_prd), "prd", EF_PRODUCT},
{NSC_INT, 0, 0, offsetof(struct dchrstr, d_peffic), "effic", EF_BAD},
{NSC_INT, 0, 0, offsetof(struct dchrstr, d_mcst), "mcst", EF_BAD}, {NSC_INT, 0, 0, offsetof(struct dchrstr, d_mcst), "mcst", EF_BAD},
{NSC_SITYPE(d_navigation), 0, 0, offsetof(struct dchrstr, d_nav), "nav", {NSC_SITYPE(d_navigation), 0, 0, offsetof(struct dchrstr, d_nav), "nav",
EF_SECTOR_NAVIGATION}, EF_SECTOR_NAVIGATION},

View file

@ -43,56 +43,53 @@
struct pchrstr pchr[] = { struct pchrstr pchr[] = {
/* level cost nrndx nrdep nlndx nlmin nllag effic sname name */ /* level cost nrndx nrdep nlndx nlmin nllag effic sname name */
{0, {I_NONE, I_NONE, I_NONE}, {0, 0, 0}, {0, {I_NONE, I_NONE, I_NONE}, {0, 0, 0},
I_NONE, 0, 0, 0, 0, 0, 0, 0, 0, I_NONE, 0, 0, 0, 0, 0, 0, 0,
"unused", "",}, "unused", "",},
{P_SHELL, {I_LCM, I_HCM, I_NONE}, {2, 1, 0}, {P_SHELL, {I_LCM, I_HCM, I_NONE}, {2, 1, 0},
I_SHELL, -1, 3, 0, 0, NAT_TLEV, 20, 10, 100, I_SHELL, -1, 3, 0, 0, NAT_TLEV, 20, 10,
"shells", "shells",}, "shells", "shells",},
{P_GUN, {I_OIL, I_LCM, I_HCM}, {1, 5, 10}, {P_GUN, {I_OIL, I_LCM, I_HCM}, {1, 5, 10},
I_GUN, -1, 30, 0, 0, NAT_TLEV, 20, 10, 100, I_GUN, -1, 30, 0, 0, NAT_TLEV, 20, 10,
"guns", "guns",}, "guns", "guns",},
{P_PETROL, {I_OIL, I_NONE, I_NONE}, {1, 0, 0}, {P_PETROL, {I_OIL, I_NONE, I_NONE}, {1, 0, 0},
I_PETROL, -1, 1, 0, 0, NAT_TLEV, 20, 10, 1000, I_PETROL, -1, 1, 0, 0, NAT_TLEV, 20, 10,
"petrol", "petrol",}, "petrol", "petrol",},
{P_IRON, {I_NONE, I_NONE, I_NONE}, {0, 0, 0}, {P_IRON, {I_NONE, I_NONE, I_NONE}, {0, 0, 0},
I_IRON, -1, 0, offsetof(struct sctstr, sct_min), 0, -1, 0, 0, 100, I_IRON, -1, 0, offsetof(struct sctstr, sct_min), 0, -1, 0, 0,
"iron ore", "iron",}, "iron ore", "iron",},
{P_DUST, {I_NONE, I_NONE, I_NONE}, {0, 0, 0}, {P_DUST, {I_NONE, I_NONE, I_NONE}, {0, 0, 0},
I_DUST, -1, 0, offsetof(struct sctstr, sct_gmin), 20, -1, 0, 0, 100, I_DUST, -1, 0, offsetof(struct sctstr, sct_gmin), 20, -1, 0, 0,
"gold dust", "dust",}, "gold dust", "dust",},
{P_BAR, {I_DUST, I_NONE, I_NONE}, {5, 0, 0}, {P_BAR, {I_DUST, I_NONE, I_NONE}, {5, 0, 0},
I_BAR, -1, 10, 0, 0, -1, 0, 0, 100, I_BAR, -1, 10, 0, 0, -1, 0, 0,
"gold bars", "bars",}, "gold bars", "bars",},
{P_FOOD, {I_NONE, I_NONE, I_NONE}, {0, 0, 0}, {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, 900, I_FOOD, -1, 0, offsetof(struct sctstr, sct_fertil), 0, NAT_TLEV, -10, 10,
"food", "food",}, "food", "food",},
{P_OIL, {I_NONE, I_NONE, I_NONE}, {0, 0, 0}, {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, 100, I_OIL, -1, 0, offsetof(struct sctstr, sct_oil), 10, NAT_TLEV, -10, 10,
"oil", "oil",}, "oil", "oil",},
{P_LCM, {I_IRON, I_NONE, I_NONE}, {1, 0, 0}, {P_LCM, {I_IRON, I_NONE, I_NONE}, {1, 0, 0},
I_LCM, -1, 0, 0, 0, NAT_TLEV, -10, 10, 100, I_LCM, -1, 0, 0, 0, NAT_TLEV, -10, 10,
"light construction materials", "lcm",}, "light construction materials", "lcm",},
{P_HCM, {I_IRON, I_NONE, I_NONE}, {2, 0, 0}, {P_HCM, {I_IRON, I_NONE, I_NONE}, {2, 0, 0},
I_HCM, -1, 0, 0, 0, NAT_TLEV, -10, 10, 100, I_HCM, -1, 0, 0, 0, NAT_TLEV, -10, 10,
"heavy construction materials", "hcm",}, "heavy construction materials", "hcm",},
{P_TLEV, {I_DUST, I_OIL, I_LCM}, {1, 5, 10}, {P_TLEV, {I_DUST, I_OIL, I_LCM}, {1, 5, 10},
I_NONE, NAT_TLEV, 300, 0, 0, NAT_ELEV, 5, 10, 100, I_NONE, NAT_TLEV, 300, 0, 0, NAT_ELEV, 5, 10,
"technological breakthroughs", "tech",}, "technological breakthroughs", "tech",},
{P_RLEV, {I_DUST, I_OIL, I_LCM}, {1, 5, 10}, {P_RLEV, {I_DUST, I_OIL, I_LCM}, {1, 5, 10},
I_NONE, NAT_RLEV, 90, 0, 0, NAT_ELEV, 5, 10, 100, I_NONE, NAT_RLEV, 90, 0, 0, NAT_ELEV, 5, 10,
"medical discoveries", "medical",}, "medical discoveries", "medical",},
{P_ELEV, {I_LCM, I_NONE, I_NONE}, {1, 0, 0}, {P_ELEV, {I_LCM, I_NONE, I_NONE}, {1, 0, 0},
I_NONE, NAT_ELEV, 9, 0, 0, -1, 0, 0, 100, I_NONE, NAT_ELEV, 9, 0, 0, -1, 0, 0,
"a class of graduates", "edu",}, "a class of graduates", "edu",},
{P_HLEV, {I_LCM, I_NONE, I_NONE}, {1, 0, 0}, {P_HLEV, {I_LCM, I_NONE, I_NONE}, {1, 0, 0},
I_NONE, NAT_HLEV, 9, 0, 0, -1, 0, 0, 100, I_NONE, NAT_HLEV, 9, 0, 0, -1, 0, 0,
"happy strollers", "happy",}, "happy strollers", "happy",},
{P_URAN, {I_NONE, I_NONE, I_NONE}, {0, 0, 0}, {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, 100, I_RAD, -1, 2, offsetof(struct sctstr, sct_uran), 35, NAT_TLEV, 40, 10,
"radioactive materials", "rad",}, "radioactive materials", "rad",},
{P_MDUST, {I_NONE, I_NONE, I_NONE}, {0, 0, 0},
I_DUST, -1, 0, offsetof(struct sctstr, sct_gmin), 20, -1, 0, 0, 75,
"gold dust", "dust",},
{0, {I_NONE, I_NONE, I_NONE}, {0, 0, 0}, {0, {I_NONE, I_NONE, I_NONE}, {0, 0, 0},
I_NONE, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL,} I_NONE, 0, 0, 0, 0, 0, 0, 0, NULL, NULL,}
}; };

View file

@ -44,46 +44,46 @@
#include "product.h" #include "product.h"
struct dchrstr bigcity_dchr = { struct dchrstr bigcity_dchr = {
SCT_CAPIT, 'c', 0, 2, NAV_CANAL, UPKG, 1.0, 2.0, 30, 0, 10, 1, 2, 999, "city" SCT_CAPIT, 'c', 0, 0, 2, NAV_CANAL, UPKG, 1.0, 2.0, 30, 0, 10, 1, 2, 999, "city"
}; };
struct dchrstr dchr[] = { struct dchrstr dchr[] = {
/* mnem prd mcst flg pkg ostr dstr value $ bld lcm hcm maxpop name */ /* mnem prd peffic mcst flg pkg ostr dstr value $ bld lcm hcm maxpop name */
{SCT_WATER, '.', 0, 0, NAVOK, NPKG, 0.0, 0.0, 0, -1, 0, 0, 0, 0, "sea"}, {SCT_WATER, '.', 0, 0, 0, NAVOK, NPKG, 0.0, 0.0, 0, -1, 0, 0, 0, 0, "sea"},
{SCT_MOUNT, '^', P_MDUST, 25, NAV_NONE, NPKG, 1.0, 4.0, 5, -1, 1, 0, 0, 99, "mountain"}, {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, NAV_NONE, NPKG, 0.0, 99.0, 127, -1, 0, 0, 0, 999, "sanctuary"}, {SCT_SANCT, 's', 0, 100, 0, NAV_NONE, NPKG, 0.0, 99.0, 127, -1, 0, 0, 0, 999, "sanctuary"},
{SCT_WASTE, '\\', 0, 0, NAV_NONE, NPKG, 0.0, 99.0, 0, -1, 0, 0, 0, 0, "wasteland"}, {SCT_WASTE, '\\', 0, 0, 0, NAV_NONE, NPKG, 0.0, 99.0, 0, -1, 0, 0, 0, 0, "wasteland"},
{SCT_RURAL, '-', 0, 3, NAV_NONE, NPKG, 1.0, 2.0, 1, 0, 0, 0, 0, 999, "wilderness"}, {SCT_RURAL, '-', 0, 0, 3, NAV_NONE, NPKG, 1.0, 2.0, 1, 0, 0, 0, 0, 999, "wilderness"},
{SCT_CAPIT, 'c', 0, 2, NAV_NONE, NPKG, 1.0, 2.0, 30, 0, 1, 0, 0, 999, "capital"}, {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, 2, NAV_NONE, NPKG, 1.0, 2.0, 15, 0, 1, 0, 0, 999, "uranium mine"}, {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, 2, NAV_NONE, NPKG, 1.0, 1.5, 5, 0, 1, 0, 0, 999, "park"}, {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, 2, NAV_NONE, NPKG, 1.0, 1.5, 7, 0, 1, 0, 0, 999, "defense plant"}, {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, 2, NAV_NONE, NPKG, 1.0, 1.5, 6, 0, 1, 0, 0, 999, "shell industry"}, {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, 2, NAV_NONE, NPKG, 1.0, 2.0, 5, 0, 1, 0, 0, 999, "mine"}, {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, 2, NAV_NONE, NPKG, 1.0, 2.0, 8, 0, 1, 0, 0, 999, "gold 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, 2, NAV_02, WPKG, 1.0, 1.5, 12, 0, 1, 0, 0, 999, "harbor"}, {SCT_HARBR, 'h', 0, 0, 2, NAV_02, WPKG, 1.0, 1.5, 12, 0, 1, 0, 0, 999, "harbor"},
{SCT_WAREH, 'w', 0, 2, NAV_NONE, WPKG, 1.0, 1.5, 7, 0, 1, 0, 0, 999, "warehouse"}, {SCT_WAREH, 'w', 0, 0, 2, NAV_NONE, WPKG, 1.0, 1.5, 7, 0, 1, 0, 0, 999, "warehouse"},
{SCT_AIRPT, '*', 0, 2, NAV_NONE, NPKG, 1.0, 1.25, 12, 0, 1, 0, 0, 999, "airfield"}, {SCT_AIRPT, '*', 0, 0, 2, NAV_NONE, NPKG, 1.0, 1.25, 12, 0, 1, 0, 0, 999, "airfield"},
{SCT_AGRI, 'a', P_FOOD, 2, NAV_NONE, NPKG, 1.0, 1.5, 2, 0, 1, 0, 0, 999, "agribusiness"}, {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, 2, NAV_NONE, NPKG, 1.0, 1.5, 5, 0, 1, 0, 0, 999, "oil field"}, {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, 2, NAV_NONE, NPKG, 1.0, 1.5, 3, 0, 1, 0, 0, 999, "light manufacturing"}, {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, 2, NAV_NONE, NPKG, 1.0, 1.5, 4, 0, 1, 0, 0, 999, "heavy 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, 2, NAV_NONE, NPKG, 2.0, 4.0, 10, 0, 5, 0, 1, 999, "fortress"}, {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, 2, NAV_NONE, NPKG, 1.0, 1.5, 10, 0, 1, 0, 0, 999, "technical center"}, {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, 2, NAV_NONE, NPKG, 1.0, 1.5, 9, 0, 1, 0, 0, 999, "research lab"}, {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, 2, NAV_NONE, NPKG, 1.0, 2.0, 10, 0, 1, 0, 0, 999, "nuclear plant"}, {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, 2, NAV_NONE, NPKG, 1.0, 1.5, 4, 0, 1, 0, 0, 999, "library/school"}, {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, 1, NAV_NONE, NPKG, 1.0, 1.0, 3, 0, 1, 0, 0, 999, "highway"}, {SCT_HIWAY, '+', 0, 0, 1, NAV_NONE, NPKG, 1.0, 1.0, 3, 0, 1, 0, 0, 999, "highway"},
{SCT_RADAR, ')', 0, 2, NAV_NONE, NPKG, 1.0, 1.5, 4, 0, 1, 0, 0, 999, "radar installation"}, {SCT_RADAR, ')', 0, 100, 2, NAV_NONE, NPKG, 1.0, 1.5, 4, 0, 1, 0, 0, 999, "radar installation"},
{SCT_HEADQ, '!', 0, 2, NAV_NONE, NPKG, 1.0, 1.5, 12, 0, 1, 0, 0, 999, "headquarters"}, {SCT_HEADQ, '!', 0, 100, 2, NAV_NONE, NPKG, 1.0, 1.5, 12, 0, 1, 0, 0, 999, "headquarters"},
{SCT_BHEAD, '#', 0, 1, NAV_NONE, NPKG, 1.0, 1.5, 4, 0, 1, 0, 0, 999, "bridge head"}, {SCT_BHEAD, '#', 0, 100, 1, NAV_NONE, NPKG, 1.0, 1.5, 4, 0, 1, 0, 0, 999, "bridge head"},
{SCT_BSPAN, '=', 0, 1, NAV_60, NPKG, 1.0, 1.0, 5, -1, 1, 0, 0, 999, "bridge span"}, {SCT_BSPAN, '=', 0, 100, 1, NAV_60, NPKG, 1.0, 1.0, 5, -1, 1, 0, 0, 999, "bridge span"},
{SCT_BANK, 'b', P_BAR, 2, NAV_NONE, BPKG, 1.0, 2.25, 10, 0, 1, 0, 0, 999, "bank"}, {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, 2, NAV_NONE, NPKG, 1.0, 1.5, 2, 0, 1, 0, 0, 999, "refinery"}, {SCT_REFINE, '%', P_PETROL, 1000, 2, NAV_NONE, NPKG, 1.0, 1.5, 2, 0, 1, 0, 0, 999, "refinery"},
{SCT_ENLIST, 'e', 0, 2, NAV_NONE, NPKG, 1.0, 2.0, 7, 0, 1, 0, 0, 999, "enlistment center"}, {SCT_ENLIST, 'e', 0, 0, 2, NAV_NONE, NPKG, 1.0, 2.0, 7, 0, 1, 0, 0, 999, "enlistment center"},
{SCT_PLAINS, '~', 0, 2, NAV_NONE, NPKG, 1.0, 1.5, 1, -1, 1, 0, 0, 49, "plains"}, {SCT_PLAINS, '~', 0, 0, 2, NAV_NONE, NPKG, 1.0, 1.5, 1, -1, 1, 0, 0, 49, "plains"},
{SCT_BTOWER, '@', 0, 1, NAV_NONE, NPKG, 1.0, 1.5, 4, -1, 1, 0, 0, 999, "bridge tower"}, {SCT_BTOWER, '@', 0, 0, 1, NAV_NONE, NPKG, 1.0, 1.5, 4, -1, 1, 0, 0, 999, "bridge tower"},
{0, 0, 0, 0, NAV_NONE, IPKG, 0, 0, 0, 0, 0, 0, 0, 0, NULL}, {0, 0, 0, 0, 0, NAV_NONE, IPKG, 0, 0, 0, 0, 0, 0, 0, 0, NULL},
}; };
struct sctintrins intrchr[] = { struct sctintrins intrchr[] = {

View file

@ -604,7 +604,7 @@ show_sect_capab(int foo)
tmpstr, tmpstr,
pchr[j].p_nlmin, pchr[j].p_nlmin,
pchr[j].p_nllag, pchr[j].p_nllag,
pchr[j].p_effic, pchr[j].p_cost, pchr[j].p_nrdep, dchr[x].d_peffic, pchr[j].p_cost, pchr[j].p_nrdep,
pchr[j].p_type != I_NONE ? ichr[pchr[j].p_type].i_mnem : ' '); pchr[j].p_type != I_NONE ? ichr[pchr[j].p_type].i_mnem : ' ');
pr("\n"); pr("\n");

View file

@ -100,7 +100,7 @@ produce(struct natstr *np, struct sctstr *sp, short *vec, int work,
material_consume = worker_limit; material_consume = worker_limit;
if (material_consume == 0) if (material_consume == 0)
return 0; return 0;
prodeff = prod_eff(product, np->nat_level[product->p_nlndx]); prodeff = prod_eff(desig, np->nat_level[product->p_nlndx]);
if (prodeff <= 0.0 && !player->simulation) { if (prodeff <= 0.0 && !player->simulation) {
wu(0, sp->sct_own, wu(0, sp->sct_own,
"%s level too low to produce in %s (need %d)\n", "%s level too low to produce in %s (need %d)\n",
@ -219,14 +219,16 @@ materials_charge(struct pchrstr *pp, short *vec, int count)
} }
/* /*
* Return level p.e. for product PP. * Return level p.e. for sector type TYPE.
* Zero means level is too low for production. * Zero means level is too low for production.
* LEVEL is the affecting production of PP; it must match PP->p_nlndx. * LEVEL is the affecting production of PP; it must match PP->p_nlndx.
*/ */
double double
prod_eff(struct pchrstr *pp, float level) prod_eff(int type, float level)
{ {
double level_p_e; double level_p_e;
struct dchrstr *dp = &dchr[type];
struct pchrstr *pp = &pchr[dp->d_prd];
if (pp->p_nlndx < 0) if (pp->p_nlndx < 0)
level_p_e = 1.0; level_p_e = 1.0;
@ -240,5 +242,5 @@ prod_eff(struct pchrstr *pp, float level)
level_p_e = delta / (delta + pp->p_nllag); level_p_e = delta / (delta + pp->p_nllag);
} }
return level_p_e * pp->p_effic * 0.01; return level_p_e * dp->d_peffic * 0.01;
} }

View file

@ -167,7 +167,7 @@ upd_ship(struct shpstr *sp, int etus,
/* produce oil */ /* produce oil */
if ((mp->m_flags & M_OIL) && sectp->sct_type == SCT_WATER) { if ((mp->m_flags & M_OIL) && sectp->sct_type == SCT_WATER) {
product = &pchr[P_OIL]; product = &pchr[dchr[SCT_OIL].d_prd];
oil_gained = roundavg(total_work(100, etus, oil_gained = roundavg(total_work(100, etus,
sp->shp_item[I_CIVIL], sp->shp_item[I_CIVIL],
sp->shp_item[I_MILIT], sp->shp_item[I_MILIT],
@ -175,7 +175,7 @@ upd_ship(struct shpstr *sp, int etus,
ITEM_MAX) ITEM_MAX)
* sp->shp_effic / 100.0 * sp->shp_effic / 100.0
* sectp->sct_oil / 100.0 * sectp->sct_oil / 100.0
* prod_eff(product, sp->shp_tech)); * prod_eff(SCT_OIL, sp->shp_tech));
max_oil = mp->m_item[I_OIL]; max_oil = mp->m_item[I_OIL];
if (sp->shp_item[I_OIL] + oil_gained > max_oil) if (sp->shp_item[I_OIL] + oil_gained > max_oil)
oil_gained = max_oil - sp->shp_item[I_OIL]; oil_gained = max_oil - sp->shp_item[I_OIL];
@ -192,7 +192,6 @@ upd_ship(struct shpstr *sp, int etus,
} }
/* produce fish */ /* produce fish */
if ((mp->m_flags & M_FOOD) && sectp->sct_type == SCT_WATER) { if ((mp->m_flags & M_FOOD) && sectp->sct_type == SCT_WATER) {
product = &pchr[P_FOOD];
sp->shp_item[I_FOOD] sp->shp_item[I_FOOD]
+= roundavg(total_work(100, etus, += roundavg(total_work(100, etus,
sp->shp_item[I_CIVIL], sp->shp_item[I_CIVIL],
@ -201,7 +200,7 @@ upd_ship(struct shpstr *sp, int etus,
ITEM_MAX) ITEM_MAX)
* sp->shp_effic / 100.0 * sp->shp_effic / 100.0
* sectp->sct_fertil / 100.0 * sectp->sct_fertil / 100.0
* prod_eff(product, sp->shp_tech)); * prod_eff(SCT_AGRI, sp->shp_tech));
} }
/* feed */ /* feed */
if ((n = feed_ship(sp, etus)) > 0) { if ((n = feed_ship(sp, etus)) > 0) {