do the Mayday animation. Also get rid of literal \n and \r.
iy = y + 0.5;
if (!VALID_SECTOR(ix, iy)) break;
iquad=game.quad[ix][iy];
- tracktorpedo(ix, iy, l, i, n);
+ tracktorpedo(ix, iy, l, i, n, iquad);
if (iquad==IHDOT) continue;
/* hit something */
setwnd(message_window);
va_start(ap, fmt);
vsprintf(buf, fmt, ap);
va_end(ap);
- skip(1);
for (s = buf; *s; s++) {
delay(30);
if (game.options & OPTION_CURSES) {
/* sound and visual effects for teleportation */
{
if (game.options & OPTION_CURSES) {
- drawmaps(1);
+ drawmaps(2);
setwnd(message_window);
sound(50);
+ }
+ prouts(" . . . . . ");
+ if (game.options & OPTION_CURSES) {
delay(1000);
nosound();
- } else
- prouts(" . . . . . ");
+ }
}
-void tracktorpedo(int ix, int iy, int l, int i, int n)
+void tracktorpedo(int ix, int iy, int l, int i, int n, int iquad)
/* torpedo-track animation */
{
if (!game.options & OPTION_CURSES) {
drawmaps(2);
delay(400);
}
- if ((game.quad[ix][iy]==IHDOT)||(game.quad[ix][iy]==IHBLANK)){
+ if ((iquad==IHDOT)||(iquad==IHBLANK)){
put_srscan_sym(ix, iy, '+');
sound(l*10);
delay(100);
nosound();
- put_srscan_sym(ix, iy, game.quad[ix][iy]);
+ put_srscan_sym(ix, iy, iquad);
}
else {
wattron(curwnd, A_REVERSE);
- put_srscan_sym(ix, iy, game.quad[ix][iy]);
+ put_srscan_sym(ix, iy, iquad);
sound(500);
delay(1000);
nosound();
wattroff(curwnd, A_REVERSE);
- put_srscan_sym(ix, iy, game.quad[ix][iy]);
+ put_srscan_sym(ix, iy, iquad);
}
} else {
proutn("%d - %d ", ix, iy);
finish(FNEG3);
return;
}
- prout("\n\rYOU HAVE ATTEMPTED TO CROSS THE NEGATIVE ENERGY BARRIER\n\r"
- "AT THE EDGE OF THE GALAXY. THE THIRD TIME YOU TRY THIS,\n\r"
- "YOU WILL BE DESTROYED.\n\r");
+ skip(1);
+ prout("YOU HAVE ATTEMPTED TO CROSS THE NEGATIVE ENERGY BARRIER");
+ prout("AT THE EDGE OF THE GALAXY. THE THIRD TIME YOU TRY THIS,");
+ prout("YOU WILL BE DESTROYED.");
}
/* Compute final position in new quadrant */
if (trbeam) return; /* Don't bother if we are to be beamed */
quady = (iy+(QUADSIZE-1))/QUADSIZE;
sectx = ix - QUADSIZE*(quadx-1);
secty = iy - QUADSIZE*(quady-1);
- prout("\n\rEntering %s.",
+ skip(1);
+ prout("Entering %s.",
cramlc(quadrant, quadx, quady));
game.quad[sectx][secty] = ship;
newqad(0);
return;
}
if (game.damage[DWARPEN] > 0.0 && aaitem > 4.0) {
- prout("Engineer Scott- \"I'm doing my best, Captain,\n"
- " but right now we can only go warp 4.\"");
+ prout("Engineer Scott- \"I'm doing my best, Captain,");
+ prout(" but right now we can only go warp 4.\"");
return;
}
if (aaitem > 10.0) {
/* found one -- finish up */
sectx=ix;
secty=iy;
- game.quad[ix][iy]=IHMATER0;
break;
}
}
}
proutn(" attempt to re-materialize ");
crmshp();
- warble();
- if (Rand() > probf) break;
switch (l){
- case 1: game.quad[ix][iy]=IHMATER1;
+ case 1: game.quad[ix][iy]=IHMATER0;
break;
- case 2: game.quad[ix][iy]=IHMATER2;
+ case 2: game.quad[ix][iy]=IHMATER1;
break;
- case 3: game.quad[ix][iy]=IHQUEST;
+ case 3: game.quad[ix][iy]=IHMATER2;
break;
}
textcolor(RED);
+ warble();
+ if (Rand() > probf) break;
prout("fails.");
delay(500);
textcolor(DEFAULT);
}
if (l > 3) {
+ game.quad[ix][iy]=IHQUEST;
+ alive = 0;
+ drawmaps(1);
+ setwnd(message_window);
finish(FMATERIALIZE);
return;
}
}
if (plnetx == 0 || abs(sectx-plnetx) > 1 || abs(secty-plnety) > 1) {
crmshp();
- prout(" not adjacent to planet.\n");
+ prout(" not adjacent to planet.");
+ skip(1);
return;
}
Time = 0.02+0.03*Rand();
void chart(int nn)
{
int i,j;
- char *cp;
chew();
if (game.damage[DRADIO] == 0.0)
else if (!game.state.galaxy[i][j].charted && game.state.galaxy[i][j].starbase)
strcpy(buf, ".1.");
else if (game.state.galaxy[i][j].charted)
- sprintf(buf, "%d%d%d", game.state.chart[i][j].klingons, game.state.chart[i][j].starbase, game.state.chart[i][j].stars);
+ sprintf(buf, "%3d", game.state.chart[i][j].klingons*100 + game.state.chart[i][j].starbase * 10 + game.state.chart[i][j].stars);
else
strcpy(buf, "...");
- for (cp = buf; cp < buf + sizeof(buf); cp++)
- if (*cp == '0')
- *cp = '.';
proutn(buf);
if ((game.options & OPTION_SHOWME) && i == quadx && j == quady)
proutn(">");
else
prout(" [Using Base's sensors]");
}
- else proutn(" Short-range scan");
+ else prout(" Short-range scan");
if (goodScan && !game.damage[DRADIO]) {
game.state.chart[quadx][quady].klingons = game.state.galaxy[quadx][quady].klingons;
game.state.chart[quadx][quady].starbase = game.state.galaxy[quadx][quady].starbase;
if (isit("chart")) nn = TRUE;
if (isit("no")) rightside = FALSE;
chew();
- proutn(" 1 2 3 4 5 6 7 8 9 10\n");
+ prout(" 1 2 3 4 5 6 7 8 9 10");
break;
case SCAN_REQUEST:
while (scan() == IHEOL)
if (strncmp(citem,requests[req],min(2,strlen(citem)))==0)
break;
if (req > sizeof(requests)/sizeof(requests[0])) {
- prout("UNRECOGNIZED REQUEST. Legal requests are:\n"
- " date, condition, position, lsupport, warpfactor,\n"
- " energy, torpedoes, shields, klingons, time, bases.");
+ prout("UNRECOGNIZED REQUEST. Legal requests are:");
+ prout(" date, condition, position, lsupport, warpfactor,");
+ prout(" energy, torpedoes, shields, klingons, time, bases.");
return FALSE;
}
// no break
while (TRUE) { /* Play a game */
setwnd(fullscreen_window);
#ifdef DEBUG
- prout("INITIAL OPTIONS: %0lx\n", game.options);
+ prout("INITIAL OPTIONS: %0lx", game.options);
#endif /* DEBUG */
clrscr();
prelim();
void setwnd(WINDOW *);
void warble(void);
void boom(int ii, int jj);
-void tracktorpedo(int ix, int iy, int l, int i, int n);
+void tracktorpedo(int ix, int iy, int l, int i, int n, int iquad);
void cgetline(char *, int);
void waitfor(void);
void setpassword(void);