game.damage[l] += Time + extradm; /* Damage for at least time of travel! */
}
shldup = 0;
- if (game.state.remkl) {
+ if (KLINGREM) {
pause_game(2);
dreprt();
}
return;
}
-void torpedo(double course, double r, int inx, int iny, double *hit, int wait, int i, int n)
+void torpedo(double course, double r, int inx, int iny, double *hit, int i, int n)
{
int l, iquad=0, ix=0, iy=0, jx=0, jy=0, shoved=0, ll;
iy = y + 0.5;
if (!VALID_SECTOR(ix, iy)) break;
iquad=game.quad[ix][iy];
- tracktorpedo(x, y, ix, iy, wait, l, i, n, iquad);
- wait = 1;
+ tracktorpedo(ix, iy, l, i, n, iquad);
if (iquad==IHDOT) continue;
/* hit something */
setwnd(message_window);
case IHB: /* Hit a base */
skip(1);
prout("***STARBASE DESTROYED..");
- for (ll=1; ll<=game.state.rembase; ll++) {
+ for_starbases(ll) {
if (game.state.baseqx[ll]==quadx && game.state.baseqy[ll]==quady) {
game.state.baseqx[ll]=game.state.baseqx[game.state.rembase];
game.state.baseqy[ll]=game.state.baseqy[game.state.rembase];
} else {
/*
* Stas Sergeev added the possibility that
- * you can shove the Thingy abd piss it off.
+ * you can shove the Thingy and piss it off.
* It then becomes an enemy and may fire at you.
*/
iqengry=1;
prout(" ");
r = (Rand()+Rand())*0.5 -0.5;
r += 0.002*game.kpower[l]*r;
- torpedo(course, r, jx, jy, &hit, 0, 1, 1);
- if (game.state.remkl==0)
+ torpedo(course, r, jx, jy, &hit, 1, 1);
+ if (KLINGREM==0)
finish(FWON); /* Klingons did themselves in! */
if (game.state.galaxy[quadx][quady].supernova || alldone)
return; /* Supernova or finished */
/* chalk up a Romulan */
game.state.galaxy[quadx][quady].romulans--;
irhere--;
- game.state.nromkl++;
game.state.nromrem--;
}
else if (type == IHT) {
/* Some type of a Klingon */
game.state.galaxy[quadx][quady].klingons--;
klhere--;
- game.state.remkl--;
switch (type) {
case IHC:
comhere = 0;
game.state.cx[game.state.remcom] = 0;
game.state.cy[game.state.remcom] = 0;
game.state.remcom--;
- game.future[FTBEAM] = 1e30;
+ game.future[FTBEAM] = FOREVER;
if (game.state.remcom != 0)
game.future[FTBEAM] = game.state.date + expran(1.0*incom/game.state.remcom);
- game.state.killc++;
break;
case IHK:
- game.state.killk++;
+ game.state.remkl--;
break;
case IHS:
- game.state.nscrem = ishere = game.state.isx = game.state.isy = isatb = iscate = 0;
- game.state.nsckill = 1;
- game.future[FSCMOVE] = game.future[FSCDBAS] = 1e30;
+ game.state.nscrem--;
+ ishere = game.state.isx = game.state.isy = isatb = iscate = 0;
+ game.future[FSCMOVE] = game.future[FSCDBAS] = FOREVER;
break;
}
}
/* For each kind of enemy, finish message to player */
prout(" destroyed.");
game.quad[ix][iy] = IHDOT;
- if (game.state.remkl==0) return;
+ if (KLINGREM==0) return;
game.state.remtime = game.state.remres/(game.state.remkl + 4*game.state.remcom);
/* Remove enemy ship from arrays describing local conditions */
- if (game.future[FCDBAS] < 1e30 && batx==quadx && baty==quady && type==IHC)
- game.future[FCDBAS] = 1e30;
+ if (game.future[FCDBAS] < FOREVER && batx==quadx && baty==quady && type==IHC)
+ game.future[FCDBAS] = FOREVER;
for_local_enemies(i)
if (game.kx[i]==ix && game.ky[i]==iy) break;
nenhere--;
}
if (shldup || condit == IHDOCKED)
r *= 1.0 + 0.0001*shield;
- torpedo(course[i], r, sectx, secty, &dummy, 0, i, n);
+ torpedo(course[i], r, sectx, secty, &dummy, i, n);
if (alldone || game.state.galaxy[quadx][quady].supernova)
return;
}
- if (game.state.remkl==0) finish(FWON);
+ if (KLINGREM==0) finish(FWON);
}
skip(1);
if (kpow == 0) {
deadkl(ii, jj, ienm, ii, jj);
- if (game.state.remkl==0) finish(FWON);
+ if (KLINGREM==0) finish(FWON);
if (alldone) return;
kk--; /* don't do the increment */
}