(new_work, do_feed, prod, newe): Factor out calculation of work into

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.
This commit is contained in:
Markus Armbruster 2004-05-10 20:30:38 +00:00
parent b665d57de1
commit 7f4e59fb8d
9 changed files with 19 additions and 28 deletions

View file

@ -82,14 +82,7 @@ newe(void)
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(&sect, wforce * etu_per_update / 100);
bwork = work / 2;
type = sect.sct_type;

View file

@ -134,13 +134,7 @@ prod(void)
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(&sect, wforce * etu_per_update / 100);
bwork = work / 2;
if (sect.sct_off)

View file

@ -95,6 +95,8 @@ vers(void)
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",