diff --git a/include/options.h b/include/options.h index 80327182..7b24a166 100644 --- a/include/options.h +++ b/include/options.h @@ -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 */ @@ -101,10 +100,7 @@ /*#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 /**/ diff --git a/include/optlist.h b/include/optlist.h index edbdd3bc..84d824d2 100644 --- a/include/optlist.h +++ b/include/optlist.h @@ -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; diff --git a/info/Commands/move.t b/info/Commands/move.t index 855238e9..7cf576ec 100644 --- a/info/Commands/move.t +++ b/info/Commands/move.t @@ -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% diff --git a/info/Commands/power.t b/info/Commands/power.t index bee2b58d..302c6e04 100644 --- a/info/Commands/power.t +++ b/info/Commands/power.t @@ -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)) + diff --git a/info/Concepts/Update-sequence.t b/info/Concepts/Update-sequence.t index 1e5b661d..49dc2c0d 100644 --- a/info/Concepts/Update-sequence.t +++ b/info/Concepts/Update-sequence.t @@ -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 diff --git a/info/Server/Options.t b/info/Server/Options.t index fe713ec6..1706fe26 100644 --- a/info/Server/Options.t +++ b/info/Server/Options.t @@ -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 diff --git a/src/lib/commands/expl.c b/src/lib/commands/expl.c index a4dc589c..ed969086 100644 --- a/src/lib/commands/expl.c +++ b/src/lib/commands/expl.c @@ -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(§); return RET_OK; diff --git a/src/lib/commands/move.c b/src/lib/commands/move.c index 60c44c11..f68e1fc2 100644 --- a/src/lib/commands/move.c +++ b/src/lib/commands/move.c @@ -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(§); getsect(x, y, &start); diff --git a/src/lib/commands/powe.c b/src/lib/commands/powe.c index e1c9e625..0154b8e2 100644 --- a/src/lib/commands/powe.c +++ b/src/lib/commands/powe.c @@ -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); diff --git a/src/lib/global/options.c b/src/lib/global/options.c index 8a3a7a8d..e9ba0b44 100644 --- a/src/lib/global/options.c +++ b/src/lib/global/options.c @@ -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}, diff --git a/src/lib/update/human.c b/src/lib/update/human.c index b3982436..be0e5037 100644 --- a/src/lib/update/human.c +++ b/src/lib/update/human.c @@ -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]--; - } + 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; - } /* end opt_NEW_STARVE */ + vec[I_FOOD] = 0; } else { vec[I_FOOD] -= roundavg(food_eaten); } diff --git a/src/lib/update/ship.c b/src/lib/update/ship.c index d4c7628a..67ee08b0 100644 --- a/src/lib/update/ship.c +++ b/src/lib/update/ship.c @@ -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]; + 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; + /* 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; + 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; }