]> git.pond.sub.org Git - empserver/commitdiff
(ROLLOVER_AVAIL, opt_ROLLOVER_AVAIL, Options, do_feed, prod, newe):
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 20 Jan 2004 16:51:43 +0000 (16:51 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 20 Jan 2004 16:51:43 +0000 (16:51 +0000)
New option ROLLOVER_AVAIL; from Drake Diedrich.

include/options.h
include/optlist.h
info/Server/Options.t
src/lib/commands/newe.c
src/lib/commands/prod.c
src/lib/global/options.c
src/lib/update/human.c

index 18b06c733e5d26d79e3226227e94a19ec3ce8b23..80327182267f586fbf4eeec8273e743ec3a5ce0e 100644 (file)
 #define ALL_BLEED              /* Tech bleeds to everyone */
 /*#define DRNUKE*//* Need research to make nukes */
 #define NO_PLAGUE              /* Plague is disabled */
 #define ALL_BLEED              /* Tech bleeds to everyone */
 /*#define DRNUKE*//* Need research to make nukes */
 #define NO_PLAGUE              /* Plague is disabled */
+/*#define ROLLOVER_AVAIL*/     /* Avail builds up across updates like mob */
 #define NEW_STARVE             /* UW's starve, then civs, then mil */
 #define NEW_WORK               /* Work is changed in proportion to the # of civs mvd */
 /*#define RES_POP*//* population is limited by research */
 #define NEW_STARVE             /* UW's starve, then civs, then mil */
 #define NEW_WORK               /* Work is changed in proportion to the # of civs mvd */
 /*#define RES_POP*//* population is limited by research */
index 477735ed4d27c21f688b4b62ccaa66522154cfda..65b2332725d405be6f5915a0837399209cf2fe91 100644 (file)
@@ -99,6 +99,7 @@ extern int opt_DEMANDUPDATE;
 extern int opt_BIG_CITY;
 extern int opt_INTERDICT_ATT;
 extern int opt_TECH_POP;
 extern int opt_BIG_CITY;
 extern int opt_INTERDICT_ATT;
 extern int opt_TECH_POP;
+extern int opt_ROLLOVER_AVAIL;
 
 struct keymatch;               /* forward decl */
 
 
 struct keymatch;               /* forward decl */
 
index 728f7460cfeb40fcb9f5cd15646f6d91a90ddc82..f7da7fa7a6fc945f6eeb87f7eb001f2b0aee5415 100644 (file)
@@ -10,7 +10,7 @@ SAIL:         another wait to automatically move ships (may also be buggy)
 NUKEFAIL(etc): nukes on missiles that explode in launching may detonate
 SHIPNAMES:     ships may be named
 DEMANDUPDATE:  updates may be allowed on player demand
 NUKEFAIL(etc): nukes on missiles that explode in launching may detonate
 SHIPNAMES:     ships may be named
 DEMANDUPDATE:  updates may be allowed on player demand
-UPDATESC(etc): updates can be controlled by the 'hours' file. NITP
+UPDATESCHED:   updates can be controlled by the 'hours' file. NITP
 
 The following options were introduced in the Chainsaw server:
 
 
 The following options were introduced in the Chainsaw server:
 
@@ -44,6 +44,7 @@ BIG_CITY:     'c' sectors cost $, lcm, hcm to build and hold 10x civs
 INTERDICT_ATT  Interdict units & mil as they move in after an attack
 
 The following options were introduced in the Empire4 Server:
 INTERDICT_ATT  Interdict units & mil as they move in after an attack
 
 The following options were introduced in the Empire4 Server:
+ROLLOVER_AVAIL: Unused production avail is rolled over across updates.
 BRIDGETOWERS:   You can build bridge towers, which allow you to build
                  bridges from them.
 DEFENSE_INFRA:  Use the new defensive infrastructure.  Otherwise, use
 BRIDGETOWERS:   You can build bridge towers, which allow you to build
                  bridges from them.
 DEFENSE_INFRA:  Use the new defensive infrastructure.  Otherwise, use
index 4608b1a9f92ce86194145791f73ceecc60c771ef..3f2175705bed336178118445bb374826f1234e05 100644 (file)
@@ -42,6 +42,7 @@
 #include "item.h"
 #include "file.h"
 #include "commands.h"
 #include "item.h"
 #include "file.h"
 #include "commands.h"
+#include "optlist.h"
 
 int
 newe(void)
 
 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  */
            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;
 
            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;
            bwork = work / 2;
 
            type = sect.sct_type;
index 9daf6092177928bedd34308e5e8ab7506e8a10e4..1065454ec0b4254caf96bd21358a81322fa0258d 100644 (file)
@@ -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;
                       / 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)
        bwork = (int)((double)work / 2.0);
 
        if (sect.sct_off)
index fb07ba37e0c4a3c8dc4a1218026a846626453c0d..7c193fbef62af784721937cc43fc4c2f4efcd4ff 100644 (file)
@@ -327,6 +327,12 @@ int opt_TECH_POP = 1;
 int opt_TECH_POP = 0;
 #endif
 
 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},
 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},
     {"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},
     {"SAIL", &opt_SAIL},
     {"SHIP_DECAY", &opt_SHIP_DECAY},
     {"SHIPNAMES", &opt_SHIPNAMES},
index ab71ce10722ed1f2e245a28784ae958f59dfb86c..19e2ed47811f6b4b4a54072b9c10f1913809afde 100644 (file)
@@ -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);
     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) {
 
     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]);
     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;
 }
     *workp = work_avail;
     return sctwork;
 }