new_work().
(ROLLOVER_AVAIL, opt_ROLLOVER_AVAIL, opt_ROLLOVER_AVAIL, Options,
rollover_avail_max, configkeys, vers, new_work): Replace option
ROLLOVER_AVAIL by configuration parameter rollover_avail_max.
extern double fcrate;
extern double fgrate;
extern double obrate;
+extern int rollover_avail_max;
extern double decay_per_etu;
extern double fallout_spread;
extern float drnuke_const;
/* finish.c */
extern void finish_sects(int);
/* human.c */
+extern int new_work(struct sctstr *, int);
extern int do_feed(register struct sctstr *, register struct natstr *,
short *, int *, int *, int);
extern int feed_people(short *, int, int *);
wforce = (int)((civs * sect.sct_work) / 100.0
+ uws + sect.sct_item[I_MILIT] * 2 / 5.0);
- work = etu_per_update * wforce / 100.0;
- if (opt_ROLLOVER_AVAIL) {
- if (sect.sct_type == sect.sct_newtype) {
- work += sect.sct_avail;
- }
- if (work > 999) work = 999;
- }
-
+ work = new_work(§, wforce * etu_per_update / 100);
bwork = work / 2;
type = sect.sct_type;
wforce = (int)(((double)civs * sect.sct_work) / 100.0
+ uws
+ sect.sct_item[I_MILIT] * 2.0 / 5.0);
- work = (double)etu_per_update *(double)wforce / 100.0;
- if (opt_ROLLOVER_AVAIL) {
- if (sect.sct_type == sect.sct_newtype) {
- work += sect.sct_avail;
- }
- if (work > 999) work = 999;
- }
+ work = new_work(§, wforce * etu_per_update / 100);
bwork = work / 2;
if (sect.sct_off)
pr("1000 civilians generate $%.2f, uncompensated workers $%.2f each time unit.\n", 1000.0 * money_civ, 1000.0 * money_uw);
pr("1000 active military cost $%.2f, reserves cost $%.2f.\n",
-money_mil * 1000.0, -money_res * 1000.0);
+ if (rollover_avail_max)
+ pr("Up to %d avail can roll over an update.\n", rollover_avail_max);
if (opt_SLOW_WAR)
pr("Declaring war will cost you $%i\n\n", War_Cost);
pr("Happiness p.e. requires 1 happy stroller per %d civ.\n",
"Food growth rate (* fertility of sector)"},
{"obrate", doubleset, (caddr_t)&obrate, 0,
"Civilian birth rate"},
+ {"rollover_avail_max", intset, (caddr_t)&rollover_avail_max, 0,
+ "Maximum avail that can roll over an update"},
{"", intset, (caddr_t)&emp_config_dummy, 0, "\n\n### Nukes"},
{"decay_per_etu", doubleset, (caddr_t)&decay_per_etu, 0,
double obrate = 0.005; /* other sectors birth rate */
double uwbrate = 0.0025; /* uncompensated worker birth rate */
/* values > 0.25 for either will overflow */
+int rollover_avail_max = 0; /* max. avail that can roll over an update */
/* opt_FALLOUT */
/* these are the radioactive decay constants */
int opt_TECH_POP = 0;
#endif
-#ifdef ROLLOVER_AVAIL
-int opt_ROLLOVER_AVAIL = 1;
-#else
-int opt_ROLLOVER_AVAIL = 0;
-#endif
-
struct option_list Options[] = {
{"ALL_BLEED", &opt_ALL_BLEED},
{"BIG_CITY", &opt_BIG_CITY},
{"PINPOINTMISSILE", &opt_PINPOINTMISSILE},
{"PLANENAMES", &opt_PLANENAMES},
{"RES_POP", &opt_RES_POP},
- {"ROLLOVER_AVAIL", &opt_ROLLOVER_AVAIL},
{"SAIL", &opt_SAIL},
{"SHIPNAMES", &opt_SHIPNAMES},
{"SHOWPLANE", &opt_SHOWPLANE},
civvies = (vec[I_CIVIL] > maxpop) ? maxpop : vec[I_CIVIL];
uws = (vec[I_UW] > maxpop) ? maxpop : vec[I_UW];
mil = (vec[I_MILIT] > maxpop) ? maxpop : vec[I_MILIT];
- work_avail = total_work(sctwork, etu, civvies, mil, uws);
- if (opt_ROLLOVER_AVAIL) {
- if (sp->sct_type == sp->sct_newtype) {
- work_avail += sp->sct_avail;
- }
- }
+ work_avail = new_work(sp, total_work(sctwork, etu, civvies, mil, uws));
people = vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
if (sp->sct_type != SCT_SANCT) {
return sctwork;
}
+int
+new_work(struct sctstr *sp, int delta)
+{
+ if (sp->sct_type == sp->sct_newtype)
+ return min(rollover_avail_max, sp->sct_avail) + delta;
+
+ return delta;
+}
+
static int
growfood(struct sctstr *sp, short *vec, int work, int etu)
{