line = FSPY;
if (alldone) return;
datemin = fintim;
- for (l=1; l<=NEVENTS; l++)
+ for (l = 1; l < NEVENTS; l++)
if (game.future[l] < datemin) {
line = l;
datemin = game.future[l];
game.damage[l] -= (game.damage[l]-repair > 0.0 ? repair : game.damage[l]);
/* If radio repaired, update star chart and attack reports */
if (radio_was_broken && game.damage[DRADIO] == 0.0) {
- stdamtim = 1e30;
prout("Lt. Uhura- \"Captain, the sub-space radio is working and");
prout(" surveillance reports are coming in.");
skip(1);
case FTBEAM: /* Tractor beam */
if (line==FTBEAM) {
if (game.state.remcom == 0) {
- game.future[FTBEAM] = 1e30;
+ game.future[FTBEAM] = FOREVER;
break;
}
i = Rand()*game.state.remcom+1.0;
/* Adjust finish time to time of tractor beaming */
fintim = game.state.date+Time;
attack(0);
- if (game.state.remcom <= 0) game.future[FTBEAM] = 1e30;
+ if (game.state.remcom <= 0) game.future[FTBEAM] = FOREVER;
else game.future[FTBEAM] = game.state.date+Time+expran(1.5*intime/game.state.remcom);
break;
case FSNAP: /* Snapshot of the universe (for time warp) */
case FBATTAK: /* Commander attacks starbase */
if (game.state.remcom==0 || game.state.rembase==0) {
/* no can do */
- game.future[FBATTAK] = game.future[FCDBAS] = 1e30;
+ game.future[FBATTAK] = game.future[FCDBAS] = FOREVER;
break;
}
i = 0;
- for_commanders (j) {
+ for_starbases(j) {
for_commanders(k)
if (game.state.baseqx[j]==game.state.cx[k] && game.state.baseqy[j]==game.state.cy[k] &&
(game.state.baseqx[j]!=quadx || game.state.baseqy[j]!=quady) &&
if (j>game.state.rembase) {
/* no match found -- try later */
game.future[FBATTAK] = game.state.date + expran(0.3*intime);
- game.future[FCDBAS] = 1e30;
+ game.future[FCDBAS] = FOREVER;
break;
}
/* commander + starbase combination found -- launch attack */
}
break;
case FSCDBAS: /* Supercommander destroys base */
- game.future[FSCDBAS] = 1e30;
+ game.future[FSCDBAS] = FOREVER;
isatb = 2;
if (!game.state.galaxy[game.state.isx][game.state.isy].starbase)
break; /* WAS RETURN! */
baty = game.state.isy;
case FCDBAS: /* Commander succeeds in destroying base */
if (line==FCDBAS) {
- game.future[FCDBAS] = 1e30;
+ game.future[FCDBAS] = FOREVER;
/* find the lucky pair */
for_commanders(i)
if (game.state.cx[i]==batx && game.state.cy[i]==baty)
proutn("is no longer transmitting");
prout(".\"");
}
- game.future[FDSPROB] = 1e30;
+ game.future[FDSPROB] = FOREVER;
break;
}
if (game.damage[DRADIO]==0.0 || condit == IHDOCKED) {
game.state.galaxy[probecx][probecy].stars) {
/* lets blow the sucker! */
snova(1,0);
- game.future[FDSPROB] = 1e30;
+ game.future[FDSPROB] = FOREVER;
if (game.state.galaxy[quadx][quady].supernova)
return;
}
/* did in the Supercommander! */
game.state.nscrem = game.state.isx = game.state.isy = isatb = iscate = 0;
iscdead = 1;
- game.future[FSCMOVE] = game.future[FSCDBAS] = 1e30;
+ game.future[FSCMOVE] = game.future[FSCDBAS] = FOREVER;
}
- game.state.remkl -= kldead;
if (game.state.remcom) {
int maxloop = game.state.remcom, l;
for (l = 1; l <= maxloop; l++) {
game.state.remcom--;
kldead--;
comdead++;
- if (game.state.remcom==0) game.future[FTBEAM] = 1e30;
+ if (game.state.remcom==0) game.future[FTBEAM] = FOREVER;
break;
}
}
}
+ game.state.remkl -= kldead;
/* destroy Romulans and planets in supernovaed quadrant */
nrmdead = game.state.galaxy[nqx][nqy].romulans;
game.state.galaxy[nqx][nqy].romulans = 0;
if (insx) {
game.state.starkl += game.state.galaxy[nqx][nqy].stars;
game.state.basekl += game.state.galaxy[nqx][nqy].starbase;
- game.state.killk += kldead;
- game.state.killc += comdead;
- game.state.nromkl += nrmdead;
game.state.nplankl += npdead;
- game.state.nsckill += iscdead;
}
/* mark supernova in galaxy and in star chart */
if ((quadx == nqx && quady == nqy) ||
condit == IHDOCKED)
game.state.galaxy[nqx][nqy].supernova = TRUE;
/* If supernova destroys last klingons give special message */
- if (game.state.remkl==0 && (nqx != quadx || nqy != quady)) {
+ if (KLINGREM==0 && (nqx != quadx || nqy != quady)) {
skip(2);
if (insx == 0) prout("Lucky you!");
proutn("A supernova in %s has just destroyed the last Klingons.",