(opt_NEWPOWER, Options, gen_power): Remove nooption NEWPOWER.

(opt_NEW_STARVE, Options, feed_ship, feed_people): Remove nooption
NEW_STARVE.

(opt_NEW_WORK, Options, move, explore): Remove nooption NEW_WORK.
This commit is contained in:
Markus Armbruster 2004-03-11 10:36:55 +00:00
parent 71411189b4
commit d64fa8d529
12 changed files with 80 additions and 208 deletions

View file

@ -93,7 +93,6 @@
#define SAIL /* A update routine to move ships */ #define SAIL /* A update routine to move ships */
#define SHIPNAMES /* Name your ships, removing this option saves space */ #define SHIPNAMES /* Name your ships, removing this option saves space */
#define NEUTRON /* Enables Neurton Warheads */ #define NEUTRON /* Enables Neurton Warheads */
#define NEWPOWER /* Better power formula */
#define NOMOBCOST /* No mob cost for firing from ships */ #define NOMOBCOST /* No mob cost for firing from ships */
/*#define SUPER_BARS *//* Bars can't be destroyed by fire */ /*#define SUPER_BARS *//* Bars can't be destroyed by fire */
#define EASY_BRIDGES /* Bridges can be built anywhere */ #define EASY_BRIDGES /* Bridges can be built anywhere */
@ -101,10 +100,7 @@
/*#define DRNUKE*//* Need research to make nukes */ /*#define DRNUKE*//* Need research to make nukes */
#define NO_PLAGUE /* Plague is disabled */ #define NO_PLAGUE /* Plague is disabled */
/*#define ROLLOVER_AVAIL*/ /* Avail builds up across updates like mob */ /*#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 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 BIG_CITY *//* allow 10x civs in 'c' sectors */
#define INTERDICT_ATT /* interdict post-attack move in */ #define INTERDICT_ATT /* interdict post-attack move in */
#define SHOWPLANE /**/ #define SHOWPLANE /**/

View file

@ -63,9 +63,6 @@ extern int opt_LOSE_CONTACT;
extern int opt_MARKET; extern int opt_MARKET;
extern int opt_MOB_ACCESS; extern int opt_MOB_ACCESS;
extern int opt_NEUTRON; 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_NOFOOD;
extern int opt_NOMOBCOST; extern int opt_NOMOBCOST;
extern int opt_NONUKES; extern int opt_NONUKES;

View file

@ -99,15 +99,11 @@ some damage to the sector you were moving into.
.L "Unhappy civilians" .L "Unhappy civilians"
.s1 .s1
Also, when moving unhappy civilians (work percentage less than 100%), Also, when moving unhappy civilians (work percentage less than 100%),
unhappiness is contagious. If you move even 1 unhappy civilian into a unhappiness is contagious. The work percentage of the
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
destination sector is computed by averaging the incoming civ's happiness destination sector is computed by averaging the incoming civ's happiness
with the happiness of the civs already there. For example, say you move 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 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 .ti 3
((migrants * their work) + (people at dest * their work) / (total civs) ((migrants * their work) + (people at dest * their work) / (total civs)
((100 * 0%) + (100 * 100%)) / (100+100) = 100/200 = 50% ((100 * 0%) + (100 * 100%)) / (100+100) = 100/200 = 50%

View file

@ -64,18 +64,6 @@ bb gold bars
.s1 .s1
The \*Qpower factor\*U is determined by the following equation: The \*Qpower factor\*U is determined by the following equation:
.s1 .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 .NF
power factor = for each land unit calculate and add the following power factor = for each land unit calculate and add the following
((((land unit lcm cost / 10) * (land unit effic / 100)) + ((((land unit lcm cost / 10) * (land unit effic / 100)) +

View file

@ -40,11 +40,7 @@ This document gives a rough order of events during the update.
2) If still not enough is available, 2) If still not enough is available,
the excess people will starve off. the excess people will starve off.
a) No more than 50% of the people a) No more than 50% of the people
in a sect can die 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,
the uw's die first, then the uw's die first, then
the civs, then the mil. the civs, then the mil.
c) if there was starvation, the work percentage is set c) if there was starvation, the work percentage is set

View file

@ -27,10 +27,7 @@ RES_POP: Research affects max sector population.
NOFOOD No food is required. NOFOOD No food is required.
BLITZ: Turns NOFOOD option on and players get infinite BTU's. BLITZ: Turns NOFOOD option on and players get infinite BTU's.
NONUKES: No nuclear weapons NONUKES: No nuclear weapons
NEWPOWER: New power formula. See "info power".
NO_PLAGUE: Plague is disabled. 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 NEUTRON: Enables neutron bombs
FALLOUT: Sectors are damaged by radiation for a few updates after blast FALLOUT: Sectors are damaged by radiation for a few updates after blast

View file

@ -261,19 +261,10 @@ explore(void)
if (infected && sect.sct_pstage == PLG_HEALTHY) if (infected && sect.sct_pstage == PLG_HEALTHY)
sect.sct_pstage = PLG_EXPOSED; sect.sct_pstage = PLG_EXPOSED;
if (vtype == V_CIVIL) { if (vtype == V_CIVIL) {
if (opt_NEW_WORK) { sect.sct_loyal
sect.sct_loyal = ((amt_dst * sect.sct_loyal) + = (amt_dst * sect.sct_loyal + amount * loyal) / (amt_dst + amount);
(amount * loyal)) / (amt_dst + amount); sect.sct_work
sect.sct_work = ((amt_dst * sect.sct_work) + = (amt_dst * sect.sct_work + amount * work) / (amt_dst + amount);
(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 */
} }
putsect(&sect); putsect(&sect);
return RET_OK; return RET_OK;

View file

@ -323,19 +323,10 @@ move(void)
if (infected && sect.sct_pstage == PLG_HEALTHY) if (infected && sect.sct_pstage == PLG_HEALTHY)
sect.sct_pstage = PLG_EXPOSED; sect.sct_pstage = PLG_EXPOSED;
if (vtype == V_CIVIL) { if (vtype == V_CIVIL) {
if (opt_NEW_WORK) { sect.sct_loyal
sect.sct_loyal = ((amt_dst * sect.sct_loyal) + = (amt_dst * sect.sct_loyal + amount * loyal) / (amt_dst + amount);
(amount * loyal)) / (amt_dst + amount); sect.sct_work
sect.sct_work = ((amt_dst * sect.sct_work) + = (amt_dst * sect.sct_work + amount * work) / (amt_dst + amount);
(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 */
} }
putsect(&sect); putsect(&sect);
getsect(x, y, &start); getsect(x, y, &start);

View file

@ -258,16 +258,9 @@ gen_power(void)
continue; continue;
pow = &powbuf[land.lnd_own]; pow = &powbuf[land.lnd_own];
addtopow(land.lnd_item, pow); addtopow(land.lnd_item, pow);
if (opt_NEWPOWER == 0) { f = (lchr[(int)land.lnd_type].l_lcm / 10.0) * (land.lnd_effic / 100.0);
pow->p_power += lchr[(int)land.lnd_type].l_lcm / 10.0; f += (lchr[(int)land.lnd_type].l_hcm / 10.0) * (land.lnd_effic / 100.0);
pow->p_power += lchr[(int)land.lnd_type].l_hcm / 5.0; pow->p_power += f * 2;
} 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 */
pow->p_units += 1.0; pow->p_units += 1.0;
} }
snxtitem_all(&ni, EF_SHIP); snxtitem_all(&ni, EF_SHIP);
@ -276,16 +269,9 @@ gen_power(void)
continue; continue;
pow = &powbuf[ship.shp_own]; pow = &powbuf[ship.shp_own];
addtopow(ship.shp_item, pow); addtopow(ship.shp_item, pow);
if (opt_NEWPOWER == 0) { f = (mchr[(int)ship.shp_type].m_lcm / 10.0) * (ship.shp_effic / 100.0);
pow->p_power += mchr[(int)ship.shp_type].m_lcm / 10.0; f += (mchr[(int)ship.shp_type].m_hcm / 10.0) * (ship.shp_effic / 100.0);
pow->p_power += mchr[(int)ship.shp_type].m_hcm / 5.0; pow->p_power += f * 2;
} 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 */
pow->p_ships += 1.0; pow->p_ships += 1.0;
} }
snxtitem_all(&ni, EF_PLANE); snxtitem_all(&ni, EF_PLANE);
@ -294,13 +280,9 @@ gen_power(void)
continue; continue;
pow = &powbuf[plane.pln_own]; pow = &powbuf[plane.pln_own];
pow->p_planes += 1.0; pow->p_planes += 1.0;
if (opt_NEWPOWER == 0) natp = getnatp(plane.pln_own);
pow->p_power += plane.pln_effic / 100.0; pow->p_power += 20 * (plane.pln_effic / 100.0) *
else { /* old POWER */ (natp->nat_level[NAT_TLEV] / 500.0);
natp = getnatp(plane.pln_own);
pow->p_power += 20 * (plane.pln_effic / 100.0) *
(natp->nat_level[NAT_TLEV] / 500.0);
} /* end old POWER */
} }
for (i = 1; NULL != (natp = getnatp(i)); i++) { for (i = 1; NULL != (natp = getnatp(i)); i++) {
pow = &powbuf[i]; pow = &powbuf[i];
@ -310,41 +292,29 @@ gen_power(void)
pow->p_power = 0.; pow->p_power = 0.;
continue; continue;
} }
if (opt_NEWPOWER && (natp->nat_stat & STAT_GOD)) { if (natp->nat_stat & STAT_GOD) {
pow->p_power = 0.; pow->p_power = 0.;
continue; continue;
} }
pow->p_money = natp->nat_money; pow->p_money = natp->nat_money;
pow->p_power += pow->p_money / 100.; 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) / 10.0;
pow->p_power += (pow->p_civil + pow->p_milit + pow->p_power += pow->p_shell / 12.5;
pow->p_shell) / 10.; pow->p_power += pow->p_iron / 100.0;
pow->p_power += (pow->p_iron + pow->p_dust + pow->p_power += pow->p_dust / 5 + pow->p_oil / 10 + pow->p_bars;
pow->p_effic + pow->p_oil) / 10.; pow->p_power += pow->p_guns / 2.5;
pow->p_power += (pow->p_guns + pow->p_effic) / 3.; if (pow->p_sects > 0)
pow->p_power += pow->p_ships; pow->p_power += (pow->p_sects
pow->p_power += pow->p_sects * 3.0; * ((pow->p_effic / pow->p_sects) / 100.0))
pow->p_power += pow->p_planes * 5.0; * 10.0;
} else { /* new POWER format */ if (natp->nat_level[NAT_TLEV] > 0.0)
pow->p_power += (pow->p_civil + pow->p_milit) / 10.0; pow->p_power = pow->p_power *
pow->p_power += (pow->p_shell) / 12.5; (((float)natp->nat_level[NAT_TLEV]) / 500.0);
pow->p_power += (pow->p_iron) / 100.0; else
pow->p_power += (pow->p_dust / 5 + pow->p_power = pow->p_power * (1.0 / 500.0);
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 */
/* ack. add this vec to the "world power" element */ /* ack. add this vec to the "world power" element */
f_pt2 = &(powbuf[0].p_sects); f_pt2 = &(powbuf[0].p_sects);
f_ptr = &(pow->p_sects); f_ptr = &(pow->p_sects);

View file

@ -177,12 +177,6 @@ int opt_TRADESHIPS = 1;
int opt_TRADESHIPS = 0; int opt_TRADESHIPS = 0;
#endif #endif
#ifdef NEWPOWER
int opt_NEWPOWER = 1;
#else
int opt_NEWPOWER = 0;
#endif
#ifdef NOMOBCOST #ifdef NOMOBCOST
int opt_NOMOBCOST = 1; int opt_NOMOBCOST = 1;
#else #else
@ -225,18 +219,6 @@ int opt_NO_PLAGUE = 1;
int opt_NO_PLAGUE = 0; int opt_NO_PLAGUE = 0;
#endif #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 #ifdef RES_POP
int opt_RES_POP = 1; int opt_RES_POP = 1;
#else #else
@ -348,9 +330,6 @@ struct option_list Options[] = {
{"MARKET", &opt_MARKET}, {"MARKET", &opt_MARKET},
{"MOB_ACCESS", &opt_MOB_ACCESS}, {"MOB_ACCESS", &opt_MOB_ACCESS},
{"NEUTRON", &opt_NEUTRON}, {"NEUTRON", &opt_NEUTRON},
{"NEW_STARVE", &opt_NEW_STARVE},
{"NEW_WORK", &opt_NEW_WORK},
{"NEWPOWER", &opt_NEWPOWER},
{"NO_FORT_FIRE", &opt_NO_FORT_FIRE}, {"NO_FORT_FIRE", &opt_NO_FORT_FIRE},
{"NO_HCMS", &opt_NO_HCMS}, {"NO_HCMS", &opt_NO_HCMS},
{"NO_LCMS", &opt_NO_LCMS}, {"NO_LCMS", &opt_NO_LCMS},

View file

@ -187,7 +187,6 @@ int
feed_people(register int *vec, int etu, int *needed) feed_people(register int *vec, int etu, int *needed)
{ {
double food_eaten; double food_eaten;
double people_left;
int can_eat; int can_eat;
int total_people; int total_people;
int to_starve; int to_starve;
@ -206,45 +205,31 @@ feed_people(register int *vec, int etu, int *needed)
*needed = food_eaten - vec[I_FOOD]; *needed = food_eaten - vec[I_FOOD];
if ((double)(*needed) < (double)(food_eaten - (double)vec[I_FOOD])) if ((double)(*needed) < (double)(food_eaten - (double)vec[I_FOOD]))
(*needed)++; (*needed)++;
if (opt_NEW_STARVE) { can_eat = (vec[I_FOOD] / (etu * eatrate));
can_eat = (vec[I_FOOD] / (etu * eatrate)); total_people = vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
total_people = vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
/* only want to starve off at most 1/2 the populace. */ /* only want to starve off at most 1/2 the populace. */
if (can_eat < (total_people / 2)) if (can_eat < (total_people / 2))
can_eat = total_people / 2; can_eat = total_people / 2;
to_starve = total_people - can_eat; to_starve = total_people - can_eat;
while (to_starve && vec[I_UW]) { while (to_starve && vec[I_UW]) {
to_starve--; to_starve--;
starved++; starved++;
vec[I_UW]--; vec[I_UW]--;
} }
while (to_starve && vec[I_CIVIL]) { while (to_starve && vec[I_CIVIL]) {
to_starve--; to_starve--;
starved++; starved++;
vec[I_CIVIL]--; vec[I_CIVIL]--;
} }
while (to_starve && vec[I_MILIT]) { while (to_starve && vec[I_MILIT]) {
to_starve--; to_starve--;
starved++; starved++;
vec[I_MILIT]--; vec[I_MILIT]--;
} }
vec[I_FOOD] = 0; 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 */
} else { } else {
vec[I_FOOD] -= roundavg(food_eaten); vec[I_FOOD] -= roundavg(food_eaten);
} }

View file

@ -432,7 +432,6 @@ feed_ship(struct shpstr *sp, register int *vec, int etus, int *needed,
int doit) int doit)
{ {
double food_eaten, land_eaten; double food_eaten, land_eaten;
double people_left;
int ifood_eaten; int ifood_eaten;
int can_eat, need; int can_eat, need;
int total_people; 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]; *needed = food_eaten - vec[I_FOOD];
if (*needed < (food_eaten - vec[I_FOOD])) if (*needed < (food_eaten - vec[I_FOOD]))
(*needed)++; (*needed)++;
if (opt_NEW_STARVE) { can_eat = (vec[I_FOOD] / (etus * eatrate));
can_eat = (vec[I_FOOD] / (etus * eatrate)); total_people = vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
total_people = vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW];
/* only want to starve off at most 1/2 the populace. */ /* only want to starve off at most 1/2 the populace. */
if (can_eat < (total_people / 2)) if (can_eat < (total_people / 2))
can_eat = total_people / 2; can_eat = total_people / 2;
to_starve = total_people - can_eat; to_starve = total_people - can_eat;
while (to_starve && vec[I_UW]) { while (to_starve && vec[I_UW]) {
to_starve--; to_starve--;
starved++; starved++;
vec[I_UW]--; 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;
} }
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 { } else {
vec[I_FOOD] -= (int)food_eaten; vec[I_FOOD] -= (int)food_eaten;
} }