]> git.pond.sub.org Git - empserver/commitdiff
(opt_NEWPOWER, Options, gen_power): Remove nooption NEWPOWER.
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 11 Mar 2004 10:36:55 +0000 (10:36 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 11 Mar 2004 10:36:55 +0000 (10:36 +0000)
(opt_NEW_STARVE, Options, feed_ship, feed_people): Remove nooption
NEW_STARVE.

(opt_NEW_WORK, Options, move, explore): Remove nooption NEW_WORK.

12 files changed:
include/options.h
include/optlist.h
info/Commands/move.t
info/Commands/power.t
info/Concepts/Update-sequence.t
info/Server/Options.t
src/lib/commands/expl.c
src/lib/commands/move.c
src/lib/commands/powe.c
src/lib/global/options.c
src/lib/update/human.c
src/lib/update/ship.c

index 80327182267f586fbf4eeec8273e743ec3a5ce0e..7b24a16691ef24d7088be5c0123b8d6f5402cc16 100644 (file)
@@ -93,7 +93,6 @@
 #define        SAIL                    /* A update routine to move ships */
 #define        SHIPNAMES               /* Name your ships, removing this option saves space */
 #define        NEUTRON                 /* Enables Neurton Warheads */
-#define NEWPOWER               /* Better power formula */
 #define NOMOBCOST              /* No mob cost for firing from ships */
 /*#define SUPER_BARS *//* Bars can't be destroyed by fire */
 #define EASY_BRIDGES           /* Bridges can be built anywhere */
 /*#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 GRAB_THINGS*//* units will grab things they need to build */
 /*#define BIG_CITY *//* allow 10x civs in 'c' sectors */
 #define INTERDICT_ATT          /* interdict post-attack move in */
 #define        SHOWPLANE /**/
index edbdd3bc18101de2bb17e22debc9ddba5362da4b..84d824d2d6c0dae5d0505a33f57728a19afed117 100644 (file)
@@ -63,9 +63,6 @@ extern int opt_LOSE_CONTACT;
 extern int opt_MARKET;
 extern int opt_MOB_ACCESS;
 extern int opt_NEUTRON;
-extern int opt_NEWPOWER;
-extern int opt_NEW_STARVE;
-extern int opt_NEW_WORK;
 extern int opt_NOFOOD;
 extern int opt_NOMOBCOST;
 extern int opt_NONUKES;
index 855238e95a19270464abd46e5706fbf5bae43e21..7cf576ec2df4e9dfc7a0686bb06b9ccaee92ccdc 100644 (file)
@@ -99,15 +99,11 @@ some damage to the sector you were moving into.
 .L "Unhappy civilians"
 .s1
 Also, when moving unhappy civilians (work percentage less than 100%), 
-unhappiness is contagious. If you move even 1 unhappy civilian into a
-sector, the new sector's work percentage is set to the level of the
-civilian being moved, if that is less than the existing level.
-.s1
-However, if the NEW_WORK option is enabled, the work percentage of the
+unhappiness is contagious. The work percentage of the
 destination sector is computed by averaging the incoming civ's happiness
 with the happiness of the civs already there. For example, say you move
 100 civs with work percentage of 0% into a sector with 100 fully happy
-civilians (100% work). If NEW_WORK is enabled, the work would be:
+civilians (100% work). The work would be:
 .ti 3
 ((migrants * their work) + (people at dest * their work) / (total civs)
 ((100 * 0%) + (100 * 100%)) / (100+100) =  100/200 = 50%
index bee2b58d576f873528d2a4482d2edbef8d586693..302c6e047a6076108d9f609808dc55978da1b7da 100644 (file)
@@ -64,18 +64,6 @@ bb   gold bars
 .s1
 The \*Qpower factor\*U is determined by the following equation:
 .s1
-.NF
-power factor = n / 100
-               + (c + d + e + h + i + k + l + mm + oo) / 10
-               + pp / 5
-               + (f + a * b) / 3
-               + g + m + j + r
-               + a * 3
-               + qq * 100
-.FI
-.s1
-However, if the NEWPOWER option is in effect, the formula becomes:
-
 .NF
 power factor = for each land unit calculate and add the following
                 ((((land unit lcm cost / 10) * (land unit effic / 100)) +
index 1e5b661da349036f4facf08b91e1e0480e8fb8b8..49dc2c0d420dc2b4f00a6570a7bdfccc688f70db 100644 (file)
@@ -40,11 +40,7 @@ This document gives a rough order of events during the update.
                         2) If still not enough is available,
                                 the excess people will starve off.
                                 a) No more than 50% of the people
-                                        in a sect can die
-                                b) If the NEW_STARVE option is not
-                                        enabled, all types of people
-                                        (civs, uw, mil) starve evenly.
-                                c) If the NEW_STARVE option is enabled,
+                                        in a sect can die;
                                         the uw's die first, then
                                         the civs, then the mil.
                 c) if there was starvation, the work percentage is set
index fe713ec6c6390eb4a9c1b1b4607de730968fe04b..1706fe26bf7abe210596d5c667ddc7017c68a9f2 100644 (file)
@@ -27,10 +27,7 @@ RES_POP:     Research affects max sector population.
 NOFOOD         No food is required.
 BLITZ:         Turns NOFOOD option on and players get infinite BTU's.
 NONUKES:       No nuclear weapons
-NEWPOWER:      New power formula.  See "info power".
 NO_PLAGUE:     Plague is disabled.
-NEW_STARVE:    UW's starve, then civs, then mil
-NEW_WORK:      Work is changed in proportion to the # of civs moved
 NEUTRON:       Enables neutron bombs
 FALLOUT:       Sectors are damaged by radiation for a few updates after blast
 
index a4dc589c6f07dbda12ee2e3827d54c3828523383..ed9690868fab09209a2b63767f2db0ffe942c1f1 100644 (file)
@@ -261,19 +261,10 @@ explore(void)
     if (infected && sect.sct_pstage == PLG_HEALTHY)
        sect.sct_pstage = PLG_EXPOSED;
     if (vtype == V_CIVIL) {
-       if (opt_NEW_WORK) {
-           sect.sct_loyal = ((amt_dst * sect.sct_loyal) +
-                             (amount * loyal)) / (amt_dst + amount);
-           sect.sct_work = ((amt_dst * sect.sct_work) +
-                            (amount * work)) / (amt_dst + amount);
-       } else {                /* ! NEW_WORK */
-
-           /* It only takes one bad apple... */
-           if (sect.sct_loyal < loyal)
-               sect.sct_loyal = loyal;
-           if (sect.sct_work > work)
-               sect.sct_work = work;
-       }                       /* end NEW_WORK */
+       sect.sct_loyal
+           = (amt_dst * sect.sct_loyal + amount * loyal) / (amt_dst + amount);
+       sect.sct_work
+           = (amt_dst * sect.sct_work + amount * work) / (amt_dst + amount);
     }
     putsect(&sect);
     return RET_OK;
index 60c44c11b2a8064e88ddbae6cd4ae1c944345647..f68e1fc2612c9459163c8aae1b939d1b0807c6bd 100644 (file)
@@ -323,19 +323,10 @@ move(void)
     if (infected && sect.sct_pstage == PLG_HEALTHY)
        sect.sct_pstage = PLG_EXPOSED;
     if (vtype == V_CIVIL) {
-       if (opt_NEW_WORK) {
-           sect.sct_loyal = ((amt_dst * sect.sct_loyal) +
-                             (amount * loyal)) / (amt_dst + amount);
-           sect.sct_work = ((amt_dst * sect.sct_work) +
-                            (amount * work)) / (amt_dst + amount);
-       } else {                /* ! NEW_WORK */
-
-           /* It only takes one bad apple... */
-           if (sect.sct_loyal < loyal)
-               sect.sct_loyal = loyal;
-           if (sect.sct_work > work)
-               sect.sct_work = work;
-       }                       /* end NEW_WORK */
+       sect.sct_loyal
+           = (amt_dst * sect.sct_loyal + amount * loyal) / (amt_dst + amount);
+       sect.sct_work
+           = (amt_dst * sect.sct_work + amount * work) / (amt_dst + amount);
     }
     putsect(&sect);
     getsect(x, y, &start);
index e1c9e6250708f10882c583f4f14646ee0ef55e3f..0154b8e2c012e3570ae8109266f3381a7e6aa12f 100644 (file)
@@ -258,16 +258,9 @@ gen_power(void)
            continue;
        pow = &powbuf[land.lnd_own];
        addtopow(land.lnd_item, pow);
-       if (opt_NEWPOWER == 0) {
-           pow->p_power += lchr[(int)land.lnd_type].l_lcm / 10.0;
-           pow->p_power += lchr[(int)land.lnd_type].l_hcm / 5.0;
-       } else {                /* old power */
-           f = ((float)(lchr[(int)land.lnd_type].l_lcm / 10.0)) *
-               ((float)land.lnd_effic) / 100.0;
-           f += ((float)(lchr[(int)land.lnd_type].l_hcm / 10.0)) *
-               ((float)land.lnd_effic / 100.0);
-           pow->p_power += f * 2;
-       }                       /* end NEWPOWER */
+       f = (lchr[(int)land.lnd_type].l_lcm / 10.0) * (land.lnd_effic / 100.0);
+       f += (lchr[(int)land.lnd_type].l_hcm / 10.0) * (land.lnd_effic / 100.0);
+       pow->p_power += f * 2;
        pow->p_units += 1.0;
     }
     snxtitem_all(&ni, EF_SHIP);
@@ -276,16 +269,9 @@ gen_power(void)
            continue;
        pow = &powbuf[ship.shp_own];
        addtopow(ship.shp_item, pow);
-       if (opt_NEWPOWER == 0) {
-           pow->p_power += mchr[(int)ship.shp_type].m_lcm / 10.0;
-           pow->p_power += mchr[(int)ship.shp_type].m_hcm / 5.0;
-       } else {                /* old power formula */
-           f = ((float)(mchr[(int)ship.shp_type].m_lcm / 10.0)) *
-               ((float)ship.shp_effic) / 100.0;
-           f += ((float)(mchr[(int)ship.shp_type].m_hcm / 10.0)) *
-               ((float)ship.shp_effic / 100.0);
-           pow->p_power += f * 2;
-       }                       /* end NEWPOWER */
+       f = (mchr[(int)ship.shp_type].m_lcm / 10.0) * (ship.shp_effic / 100.0);
+       f += (mchr[(int)ship.shp_type].m_hcm / 10.0) * (ship.shp_effic / 100.0);
+       pow->p_power += f * 2;
        pow->p_ships += 1.0;
     }
     snxtitem_all(&ni, EF_PLANE);
@@ -294,13 +280,9 @@ gen_power(void)
            continue;
        pow = &powbuf[plane.pln_own];
        pow->p_planes += 1.0;
-       if (opt_NEWPOWER == 0)
-           pow->p_power += plane.pln_effic / 100.0;
-       else {                  /* old POWER */
-           natp = getnatp(plane.pln_own);
-           pow->p_power += 20 * (plane.pln_effic / 100.0) *
-               (natp->nat_level[NAT_TLEV] / 500.0);
-       }                       /* end old POWER */
+       natp = getnatp(plane.pln_own);
+       pow->p_power += 20 * (plane.pln_effic / 100.0) *
+           (natp->nat_level[NAT_TLEV] / 500.0);
     }
     for (i = 1; NULL != (natp = getnatp(i)); i++) {
        pow = &powbuf[i];
@@ -310,41 +292,29 @@ gen_power(void)
            pow->p_power = 0.;
            continue;
        }
-       if (opt_NEWPOWER && (natp->nat_stat & STAT_GOD)) {
+       if (natp->nat_stat & STAT_GOD) {
            pow->p_power = 0.;
            continue;
        }
        pow->p_money = natp->nat_money;
        pow->p_power += pow->p_money / 100.;
 
-       pow->p_power += pow->p_petrol / (opt_NEWPOWER ? 500.0 : 50.0);
+       pow->p_power += pow->p_petrol / 500.0;
 
-       if (opt_NEWPOWER == 0) {
-           pow->p_power += (pow->p_civil + pow->p_milit +
-                            pow->p_shell) / 10.;
-           pow->p_power += (pow->p_iron + pow->p_dust +
-                            pow->p_effic + pow->p_oil) / 10.;
-           pow->p_power += (pow->p_guns + pow->p_effic) / 3.;
-           pow->p_power += pow->p_ships;
-           pow->p_power += pow->p_sects * 3.0;
-           pow->p_power += pow->p_planes * 5.0;
-       } else {                /* new POWER format */
-           pow->p_power += (pow->p_civil + pow->p_milit) / 10.0;
-           pow->p_power += (pow->p_shell) / 12.5;
-           pow->p_power += (pow->p_iron) / 100.0;
-           pow->p_power += (pow->p_dust / 5 +
-                            pow->p_oil / 10 + pow->p_bars);
-           pow->p_power += (pow->p_guns) / 2.5;
-           if (pow->p_sects > 0)
-               pow->p_power += (pow->p_sects *
-                                ((pow->p_effic / pow->p_sects) /
-                                 100.0)) * 10.0;
-           if (natp->nat_level[NAT_TLEV] > 0.0)
-               pow->p_power = pow->p_power *
-                   (((float)natp->nat_level[NAT_TLEV]) / 500.0);
-           else
-               pow->p_power = pow->p_power * (1.0 / 500.0);
-       }                       /* end new POWER */
+       pow->p_power += (pow->p_civil + pow->p_milit) / 10.0;
+       pow->p_power += pow->p_shell / 12.5;
+       pow->p_power += pow->p_iron / 100.0;
+       pow->p_power += pow->p_dust / 5 + pow->p_oil / 10 + pow->p_bars;
+       pow->p_power += pow->p_guns / 2.5;
+       if (pow->p_sects > 0)
+           pow->p_power += (pow->p_sects
+                            * ((pow->p_effic / pow->p_sects) / 100.0))
+               * 10.0;
+       if (natp->nat_level[NAT_TLEV] > 0.0)
+           pow->p_power = pow->p_power *
+               (((float)natp->nat_level[NAT_TLEV]) / 500.0);
+       else
+           pow->p_power = pow->p_power * (1.0 / 500.0);
        /* ack.  add this vec to the "world power" element */
        f_pt2 = &(powbuf[0].p_sects);
        f_ptr = &(pow->p_sects);
index 8a3a7a8df9f26ea2e8abe1bd1908c1bc529b77dd..e9ba0b442721ee94dd3f552c4778c76e5f357b37 100644 (file)
@@ -177,12 +177,6 @@ int opt_TRADESHIPS = 1;
 int opt_TRADESHIPS = 0;
 #endif
 
-#ifdef NEWPOWER
-int opt_NEWPOWER = 1;
-#else
-int opt_NEWPOWER = 0;
-#endif
-
 #ifdef NOMOBCOST
 int opt_NOMOBCOST = 1;
 #else
@@ -225,18 +219,6 @@ int opt_NO_PLAGUE = 1;
 int opt_NO_PLAGUE = 0;
 #endif
 
-#ifdef NEW_STARVE
-int opt_NEW_STARVE = 1;
-#else
-int opt_NEW_STARVE = 0;
-#endif
-
-#ifdef NEW_WORK
-int opt_NEW_WORK = 1;
-#else
-int opt_NEW_WORK = 0;
-#endif
-
 #ifdef RES_POP
 int opt_RES_POP = 1;
 #else
@@ -348,9 +330,6 @@ struct option_list Options[] = {
     {"MARKET", &opt_MARKET},
     {"MOB_ACCESS", &opt_MOB_ACCESS},
     {"NEUTRON", &opt_NEUTRON},
-    {"NEW_STARVE", &opt_NEW_STARVE},
-    {"NEW_WORK", &opt_NEW_WORK},
-    {"NEWPOWER", &opt_NEWPOWER},
     {"NO_FORT_FIRE", &opt_NO_FORT_FIRE},
     {"NO_HCMS", &opt_NO_HCMS},
     {"NO_LCMS", &opt_NO_LCMS},
index b3982436671cdd593d130fd662ec0b7f874a9112..be0e503797783d3f3c8d4d7e0c0bcdfd447b0171 100644 (file)
@@ -187,7 +187,6 @@ int
 feed_people(register int *vec, int etu, int *needed)
 {
     double food_eaten;
-    double people_left;
     int can_eat;
     int total_people;
     int to_starve;
@@ -206,45 +205,31 @@ feed_people(register int *vec, int etu, int *needed)
        *needed = food_eaten - vec[I_FOOD];
        if ((double)(*needed) < (double)(food_eaten - (double)vec[I_FOOD]))
            (*needed)++;
-       if (opt_NEW_STARVE) {
-           can_eat = (vec[I_FOOD] / (etu * eatrate));
-           total_people = vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
+       can_eat = (vec[I_FOOD] / (etu * eatrate));
+       total_people = vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
 
-           /* only want to starve off at most 1/2 the populace. */
-           if (can_eat < (total_people / 2))
-               can_eat = total_people / 2;
+       /* only want to starve off at most 1/2 the populace. */
+       if (can_eat < (total_people / 2))
+           can_eat = total_people / 2;
 
-           to_starve = total_people - can_eat;
-           while (to_starve && vec[I_UW]) {
-               to_starve--;
-               starved++;
-               vec[I_UW]--;
-           }
-           while (to_starve && vec[I_CIVIL]) {
-               to_starve--;
-               starved++;
-               vec[I_CIVIL]--;
-           }
-           while (to_starve && vec[I_MILIT]) {
-               to_starve--;
-               starved++;
-               vec[I_MILIT]--;
-           }
-
-           vec[I_FOOD] = 0;
-       } else {                /* ! opt_NEW_STARVE */
+       to_starve = total_people - can_eat;
+       while (to_starve && vec[I_UW]) {
+           to_starve--;
+           starved++;
+           vec[I_UW]--;
+       }
+       while (to_starve && vec[I_CIVIL]) {
+           to_starve--;
+           starved++;
+           vec[I_CIVIL]--;
+       }
+       while (to_starve && vec[I_MILIT]) {
+           to_starve--;
+           starved++;
+           vec[I_MILIT]--;
+       }
 
-           people_left = (vec[I_FOOD] + 0.01) / (food_eaten + 0.01);
-           starved = vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
-           /* only want to starve off at most 1/2 the populace. */
-           if (people_left < 0.5)
-               people_left = 0.5;
-           vec[I_CIVIL] = (int)(vec[I_CIVIL] * people_left);
-           vec[I_MILIT] = (int)(vec[I_MILIT] * people_left);
-           vec[I_UW] = (int)(vec[I_UW] * people_left);
-           starved -= vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
-           vec[I_FOOD] = 0;
-       }                       /* end opt_NEW_STARVE */
+       vec[I_FOOD] = 0;
     } else {
        vec[I_FOOD] -= roundavg(food_eaten);
     }
index d4c7628a12961431044cf1c3db43e82d83909861..67ee08b0cd5a57a3ef1a232f00e4ab8ba2b582ac 100644 (file)
@@ -432,7 +432,6 @@ feed_ship(struct shpstr *sp, register int *vec, int etus, int *needed,
          int doit)
 {
     double food_eaten, land_eaten;
-    double people_left;
     int ifood_eaten;
     int can_eat, need;
     int total_people;
@@ -482,44 +481,31 @@ feed_ship(struct shpstr *sp, register int *vec, int etus, int *needed,
        *needed = food_eaten - vec[I_FOOD];
        if (*needed < (food_eaten - vec[I_FOOD]))
            (*needed)++;
-       if (opt_NEW_STARVE) {
-           can_eat = (vec[I_FOOD] / (etus * eatrate));
-           total_people = vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
-
-           /* only want to starve off at most 1/2 the populace. */
-           if (can_eat < (total_people / 2))
-               can_eat = total_people / 2;
-
-           to_starve = total_people - can_eat;
-           while (to_starve && vec[I_UW]) {
-               to_starve--;
-               starved++;
-               vec[I_UW]--;
-           }
-           while (to_starve && vec[I_CIVIL]) {
-               to_starve--;
-               starved++;
-               vec[I_CIVIL]--;
-           }
-           while (to_starve && vec[I_MILIT]) {
-               to_starve--;
-               starved++;
-               vec[I_MILIT]--;
-           }
-
-           vec[I_FOOD] = 0;
-       } else {                /* ! opt_NEW_STARVE */
-           people_left = (vec[I_FOOD] + 0.01) / (food_eaten + 0.01);
-           starved = vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
-           /* only want to starve off at most 1/2 the populace. */
-           if (people_left < 0.5)
-               people_left = 0.5;
-           vec[I_CIVIL] = (int)(vec[I_CIVIL] * people_left);
-           vec[I_MILIT] = (int)(vec[I_MILIT] * people_left);
-           vec[I_UW] = (int)(vec[I_UW] * people_left);
-           starved -= vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
-           vec[I_FOOD] = 0;
+       can_eat = (vec[I_FOOD] / (etus * eatrate));
+       total_people = vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
+
+       /* only want to starve off at most 1/2 the populace. */
+       if (can_eat < (total_people / 2))
+           can_eat = total_people / 2;
+
+       to_starve = total_people - can_eat;
+       while (to_starve && vec[I_UW]) {
+           to_starve--;
+           starved++;
+           vec[I_UW]--;
        }
+       while (to_starve && vec[I_CIVIL]) {
+           to_starve--;
+           starved++;
+           vec[I_CIVIL]--;
+       }
+       while (to_starve && vec[I_MILIT]) {
+           to_starve--;
+           starved++;
+           vec[I_MILIT]--;
+       }
+
+       vec[I_FOOD] = 0;
     } else {
        vec[I_FOOD] -= (int)food_eaten;
     }