(ROLLOVER_AVAIL, opt_ROLLOVER_AVAIL, Options, do_feed, prod, newe):
New option ROLLOVER_AVAIL; from Drake Diedrich.
This commit is contained in:
parent
1261d1c825
commit
d7a054c20a
7 changed files with 33 additions and 4 deletions
|
@ -42,6 +42,7 @@
|
|||
#include "item.h"
|
||||
#include "file.h"
|
||||
#include "commands.h"
|
||||
#include "optlist.h"
|
||||
|
||||
int
|
||||
newe(void)
|
||||
|
@ -83,11 +84,17 @@ newe(void)
|
|||
uws = min(uws, maxpop);
|
||||
/* This isn't quite right, since research might rise/fall */
|
||||
/* during the update, but it's the best we can really do */
|
||||
wforce = (int)
|
||||
((civs * sect.sct_work) / 100.0
|
||||
+ uws + items[I_MILIT] * 2 / 5.0);
|
||||
wforce = (int)((civs * sect.sct_work) / 100.0
|
||||
+ uws + items[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;
|
||||
}
|
||||
|
||||
bwork = work / 2;
|
||||
|
||||
type = sect.sct_type;
|
||||
|
|
|
@ -142,6 +142,12 @@ prod(void)
|
|||
/ 100.0 + (double)uws +
|
||||
(double)items[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;
|
||||
}
|
||||
bwork = (int)((double)work / 2.0);
|
||||
|
||||
if (sect.sct_off)
|
||||
|
|
|
@ -327,6 +327,12 @@ int opt_TECH_POP = 1;
|
|||
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},
|
||||
|
@ -365,6 +371,7 @@ struct option_list Options[] = {
|
|||
{"PINPOINTMISSILE", &opt_PINPOINTMISSILE},
|
||||
{"PLANENAMES", &opt_PLANENAMES},
|
||||
{"RES_POP", &opt_RES_POP},
|
||||
{"ROLLOVER_AVAIL", &opt_ROLLOVER_AVAIL},
|
||||
{"SAIL", &opt_SAIL},
|
||||
{"SHIP_DECAY", &opt_SHIP_DECAY},
|
||||
{"SHIPNAMES", &opt_SHIPNAMES},
|
||||
|
|
|
@ -82,6 +82,11 @@ do_feed(register struct sctstr *sp, register struct natstr *np, int *vec,
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
||||
people = vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
|
||||
if (sp->sct_type != SCT_SANCT) {
|
||||
|
@ -140,6 +145,7 @@ do_feed(register struct sctstr *sp, register struct natstr *np, int *vec,
|
|||
pt_bg_nmbr(bp, sp, I_CIVIL, vec[I_CIVIL]);
|
||||
pt_bg_nmbr(bp, sp, I_UW, vec[I_UW]);
|
||||
pt_bg_nmbr(bp, sp, I_MILIT, vec[I_MILIT]);
|
||||
if (work_avail > 999) work_avail = 999;
|
||||
*workp = work_avail;
|
||||
return sctwork;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue