(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:
parent
71411189b4
commit
d64fa8d529
12 changed files with 80 additions and 208 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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},
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue