sortkl();
}
-static bool movescom(coord iq, bool flag, bool *ipage)
+static bool movescom(coord iq, bool flag)
/* commander movement helper */
{
int i;
DESTROY(&game.state.planets[i]);
game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].planet = NOPLANET;
if (!damaged(DRADIO) || game.condition == docked) {
- if (!*ipage)
- pause_game(true);
- *ipage = true;
+ pause_game(true);
prout(_("Lt. Uhura- \"Captain, Starfleet Intelligence reports"));
proutn(_(" a planet in "));
proutn(cramlc(quadrant, game.state.kscmdr));
return false; /* looks good! */
}
-void scom(bool *ipage)
+void scom(void)
/* move the Super Commander */
{
int i, i2, j, ideltax, ideltay, ifindit, iwhichb;
/* try moving in both x and y directions */
iq.x = game.state.kscmdr.x + ideltax;
iq.y = game.state.kscmdr.y + ideltax;
- if (movescom(iq, flag, ipage)) {
+ if (movescom(iq, flag)) {
/* failed -- try some other maneuvers */
if (ideltax==0 || ideltay==0) {
/* attempt angle move */
if (ideltax != 0) {
iq.y = game.state.kscmdr.y + 1;
- if (movescom(iq, flag, ipage)) {
+ if (movescom(iq, flag)) {
iq.y = game.state.kscmdr.y - 1;
- movescom(iq, flag, ipage);
+ movescom(iq, flag);
}
}
else {
iq.x = game.state.kscmdr.x + 1;
- if (movescom(iq, flag, ipage)) {
+ if (movescom(iq, flag)) {
iq.x = game.state.kscmdr.x - 1;
- movescom(iq, flag, ipage);
+ movescom(iq, flag);
}
}
}
else {
/* try moving just in x or y */
iq.y = game.state.kscmdr.y;
- if (movescom(iq, flag, ipage)) {
+ if (movescom(iq, flag)) {
iq.y = game.state.kscmdr.y + ideltay;
iq.x = game.state.kscmdr.x;
- movescom(iq, flag, ipage);
+ movescom(iq, flag);
}
}
}
if (damaged(DRADIO) && game.condition != docked)
return; /* no warning */
game.iseenit = true;
- if (!*ipage)
- pause_game(true);
- *ipage = true;
+ pause_game(true);
proutn(_("Lt. Uhura- \"Captain, the starbase in "));
proutn(cramlc(quadrant, game.state.kscmdr));
skip(1);
(damaged(DRADIO) && game.condition != docked) ||
!game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].charted))
return;
- if (!*ipage)
- pause_game(true);
- *ipage = true;
+ pause_game(true);
prout(_("Lt. Uhura- \"Captain, Starfleet Intelligence reports"));
proutn(_(" the Super-commander is in "));
proutn(cramlc(quadrant, game.state.kscmdr));
{
int evcode, i=0, j, k, l;
double fintim = game.state.date + game.optime, datemin, xtime, repair, yank=0;
- bool radio_was_broken, ictbeam = false, ipage = false, istract = false;
+ bool radio_was_broken, ictbeam = false, istract = false;
struct quadrant *pdest, *q;
coord w, hold;
event *ev, *ev2;
+ pause_reset();
+
if (idebug) {
prout("=== EVENTS from %.2f to %.2f:", game.state.date, fintim);
for (i = 1; i < NEVENTS; i++) {
game.optime -= xtime;
switch (evcode) {
case FSNOVA: /* Supernova */
- if (!ipage)
- pause_game(true);
- ipage=true;
+ pause_game(true);
snova(false, NULL);
schedule(FSNOVA, expran(0.5*game.intime));
if (game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova)
}
/* tractor beaming cases merge here */
yank = sqrt(yank);
- if (!ipage)
- pause_game(true);
- ipage=true;
+ pause_game(true);
game.optime = (10.0/(7.5*7.5))*yank; /* 7.5 is yank rate (warp 7.5) */
ictbeam = true;
skip(1);
if (!damaged(DRADIO) && game.condition != docked)
break; /* No warning :-( */
game.iseenit = true;
- if (!ipage)
- pause_game(true);
- ipage = true;
+ pause_game(true);
skip(1);
proutn(_("Lt. Uhura- \"Captain, the starbase in "));
prout(cramlc(quadrant, game.battle));
else if (game.state.rembase != 1 &&
(!damaged(DRADIO) || game.condition == docked)) {
/* Get word via subspace radio */
- if (!ipage)
- pause_game(true);
- ipage = true;
+ pause_game(true);
skip(1);
prout(_("Lt. Uhura- \"Captain, Starfleet Command reports that"));
proutn(_(" the starbase in "));
schedule(FSCMOVE, 0.2777);
if (!game.ientesc && !istract && game.isatb != 1 &&
(!game.iscate || !game.justin))
- scom(&ipage);
+ scom();
break;
case FDSPROB: /* Move deep space probe */
schedule(FDSPROB, 0.01);
game.state.galaxy[game.probec.x][game.probec.y].supernova) {
// Left galaxy or ran into supernova
if (!damaged(DRADIO) || game.condition == docked) {
- if (!ipage)
- pause_game(true);
- ipage = true;
+ pause_game(true);
skip(1);
proutn(_("Lt. Uhura- \"The deep space probe "));
if (!VALID_QUADRANT(j, i))
break;
}
if (!damaged(DRADIO) || game.condition == docked) {
- if (!ipage)
- pause_game(true);
- ipage = true;
+ pause_game(true);
skip(1);
proutn(_("Lt. Uhura- \"The deep space probe is now in "));
proutn(cramlc(quadrant, game.probec));
#include "sstlinux.h"
static int rows, linecount; /* for paging */
+static bool pause_latch;
WINDOW *curwnd;
WINDOW *fullscreen_window;
getch();
}
+void pause_reset(void)
+{
+ pause_latch = false;
+}
+
void pause_game(bool announcement)
{
- char *prompt;
- char buf[BUFSIZ];
- if (announcement) {
- if (game.skill > SKILL_FAIR)
- prompt = _("[ANOUNCEMENT ARRIVING...]");
- else
- prompt = _("[IMPORTANT ANNOUNCEMENT ARRIVING -- PRESS ENTER TO CONTINUE]");
- }
+ if (pause_latch)
+ return;
else {
- if (game.skill > SKILL_FAIR)
- prompt = _("[CONTINUE?]");
- else
- prompt = _("[PRESS ENTER TO CONTINUE]");
-
- }
- if (game.options & OPTION_CURSES) {
- drawmaps(0);
- setwnd(prompt_window);
- wclear(prompt_window);
- waddstr(prompt_window, prompt);
- wgetnstr(prompt_window, buf, sizeof(buf));
- wclear(prompt_window);
- wrefresh(prompt_window);
- setwnd(message_window);
- } else {
- putchar('\n');
- proutn(prompt);
- fgets(buf, sizeof(buf), stdin);
+ char *prompt;
+ char buf[BUFSIZ];
if (announcement) {
- int j;
- for (j = 0; j < rows; j++)
- putchar('\n');
+ if (game.skill > SKILL_FAIR)
+ prompt = _("[ANOUNCEMENT ARRIVING...]");
+ else
+ prompt = _("[IMPORTANT ANNOUNCEMENT ARRIVING -- PRESS ENTER TO CONTINUE]");
+ }
+ else {
+ if (game.skill > SKILL_FAIR)
+ prompt = _("[CONTINUE?]");
+ else
+ prompt = _("[PRESS ENTER TO CONTINUE]");
+
+ }
+ if (game.options & OPTION_CURSES) {
+ drawmaps(0);
+ setwnd(prompt_window);
+ wclear(prompt_window);
+ waddstr(prompt_window, prompt);
+ wgetnstr(prompt_window, buf, sizeof(buf));
+ wclear(prompt_window);
+ wrefresh(prompt_window);
+ setwnd(message_window);
+ } else {
+ putchar('\n');
+ proutn(prompt);
+ fgets(buf, sizeof(buf), stdin);
+ if (announcement) {
+ int j;
+ for (j = 0; j < rows; j++)
+ putchar('\n');
+ }
+ linecount = 0;
}
- linecount = 0;
+ pause_latch = true;
}
}
void moveklings(void);
void torpedo(double, double, coord, double *, int, int);
void huh(void);
+void pause_reset(void);
void pause_game(bool);
void nova(coord);
void snova(bool, coord *);
-void scom(bool *);
+void scom(void);
void hittem(double *);
bool isit(char *);
void preport(void);
def movescom(ship, avoid):
# commander movement helper
- global ipage
if game.state.kscmdr == game.quadrant or \
game.state.galaxy[iq].supernova or \
game.state.galaxy[iq].klingons > MAXKLQUAD-1:
# destroy the planet
del planet
if communicating():
- if not ipage:
pause_game(True)
- ipage = true
prout("Lt. Uhura- \"Captain, Starfleet Intelligence reports")
proutn(_(" a planet in "))
proutn(cramlc(quadrant, game.state.kscmdr))
if not communicating():
return # no warning
game.iseenit = True
- if not ipage:
- pause_game(true)
- ipage = True
+ pause_game(true)
proutn(_("Lt. Uhura- \"Captain, the starbase in "))
proutn(cramlc(quadrant, game.state.kscmdr))
skip(1)
if (Rand() > 0.2 or not communicating() or
not game.state.galaxy[game.state.kscmdr].charted):
return
- if ipage:
- pause_game(true)
- ipage = true
+ pause_game(true)
prout(_("Lt. Uhura- \"Captain, Starfleet Intelligence reports"))
proutn(_(" the Super-commander is in "))
proutn(cramlc(quadrant, game.state.kscmdr))