projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pull SERGEEV dependencies out of reports.c.
[super-star-trek.git]
/
sst.c
diff --git
a/sst.c
b/sst.c
index acef9841228ecf2f18b4f1b5568683a9b07bb210..346bb4c740c4a697ed76451183eadf6375f923b9 100644
(file)
--- a/
sst.c
+++ b/
sst.c
@@
-227,8
+227,11
@@
static void helpme(void) {
fp = fopen(SSTDOC, "r");
if (fp == NULL) {
prout("Spock- \"Captain, that information is missing from the");
fp = fopen(SSTDOC, "r");
if (fp == NULL) {
prout("Spock- \"Captain, that information is missing from the");
- prout(" computer. You need to find SST.DOC and put it in the");
- prout(" current directory.\"");
+ prout(" computer.\"");
+ /*
+ * This used to continue: "You need to find SST.DOC and put
+ * it in the current directory."
+ */
return;
}
for (;;) {
return;
}
for (;;) {
@@
-258,8
+261,9
@@
static void helpme(void) {
fclose(fp);
}
fclose(fp);
}
+void drawmaps(short l) {
+/* hook to be called after moving to redraw maps */
#ifdef SERGEEV
#ifdef SERGEEV
-void drawmaps(short l){
_setcursortype(_NOCURSOR);
if (l==1) sensor();
if (l!=2) setwnd(1);
_setcursortype(_NOCURSOR);
if (l==1) sensor();
if (l!=2) setwnd(1);
@@
-276,8
+280,8
@@
void drawmaps(short l){
lrscan();
_setcursortype(_NORMALCURSOR);
}
lrscan();
_setcursortype(_NORMALCURSOR);
}
-}
#endif /* SERGEEV */
#endif /* SERGEEV */
+}
static void makemoves(void) {
int i, hitme;
static void makemoves(void) {
int i, hitme;
@@
-286,9
+290,7
@@
static void makemoves(void) {
setwnd(4);
#endif /* SERGEEV */
while (TRUE) { /* command loop */
setwnd(4);
#endif /* SERGEEV */
while (TRUE) { /* command loop */
-#ifdef SERGEEV
drawmaps(1);
drawmaps(1);
-#endif /* SERGEEV */
while (TRUE) { /* get a command */
hitme = FALSE;
justin = 0;
while (TRUE) { /* get a command */
hitme = FALSE;
justin = 0;
@@
-408,7
+410,7
@@
static void makemoves(void) {
srscan(2);
break;
case 21: // Game Report
srscan(2);
break;
case 21: // Game Report
- report(
0
);
+ report();
break;
case 22: // use COMPUTER!
eta();
break;
case 22: // use COMPUTER!
eta();
@@
-417,12
+419,15
@@
static void makemoves(void) {
listCommands(TRUE);
break;
case 24: // Emergency exit
listCommands(TRUE);
break;
case 24: // Emergency exit
- clearscreen(); // Hide screen
+#ifdef SERGEEV
+ clrscr(); // Hide screen
+#endif /* SERGEEV */
freeze(TRUE); // forced save
exit(1); // And quick exit
break;
case 25:
probe(); // Launch probe
freeze(TRUE); // forced save
exit(1); // And quick exit
break;
case 25:
probe(); // Launch probe
+ if (ididit) hitme = TRUE;
break;
case 26: // Abandon Ship
abandn();
break;
case 26: // Abandon Ship
abandn();
@@
-432,8
+437,11
@@
static void makemoves(void) {
break;
case 28: // Save Game
freeze(FALSE);
break;
case 28: // Save Game
freeze(FALSE);
+#ifdef SERGEEV
+ clrscr();
+#endif /* SERGEEV */
if (skill > 3)
if (skill > 3)
-
prout("WARNING--Frozen
games produce no plaques!");
+
prout("WARNING--Saved
games produce no plaques!");
break;
case 29: // Try a desparation measure
deathray();
break;
case 29: // Try a desparation measure
deathray();
@@
-472,7
+480,6
@@
static void makemoves(void) {
atover(0);
continue;
}
atover(0);
continue;
}
- if (nenhere == 0) movetho();
if (hitme && justin==0) {
attack(2);
if (alldone) break;
if (hitme && justin==0) {
attack(2);
if (alldone) break;
@@
-490,7
+497,8
@@
static void makemoves(void) {
int main(int argc, char **argv) {
int main(int argc, char **argv) {
- int i, option, usecurses = TRUE;
+ int i, option, usecurses = TRUE;
+
while ((option = getopt(argc, argv, "t")) != -1) {
switch (option) {
case 't':
while ((option = getopt(argc, argv, "t")) != -1) {
switch (option) {
case 't':
@@
-502,21
+510,28
@@
int main(int argc, char **argv) {
}
}
}
}
+#ifndef SERGEEV
iostart(usecurses);
iostart(usecurses);
- prelim();
+#else
+ randomize();
+ textattr(7);
+ clrscr();
+ setwnd(0);
+#endif /* SERGEEV */
line[0] = '\0';
for (i = optind; i < argc; i++) {
strcat(line, argv[i]);
strcat(line, " ");
}
while (TRUE) { /* Play a game */
line[0] = '\0';
for (i = optind; i < argc; i++) {
strcat(line, argv[i]);
strcat(line, " ");
}
while (TRUE) { /* Play a game */
+ prelim();
setup(line[0] == '\0');
if (alldone) {
score();
alldone = 0;
}
else makemoves();
setup(line[0] == '\0');
if (alldone) {
score();
alldone = 0;
}
else makemoves();
- skip(
2
);
+ skip(
1
);
stars();
skip(1);
stars();
skip(1);
@@
-569,7
+584,7
@@
char *cramlc(enum loctype key, int x, int y) {
buf[0] = '\0';
if (key == quadrant) strcpy(buf, "Quadrant ");
else if (key == sector) strcpy(buf, "Sector ");
buf[0] = '\0';
if (key == quadrant) strcpy(buf, "Quadrant ");
else if (key == sector) strcpy(buf, "Sector ");
- sprintf(buf+strlen(buf), "%d
-
%d", x, y);
+ sprintf(buf+strlen(buf), "%d
-
%d", x, y);
return buf;
}
return buf;
}
@@
-639,6
+654,14
@@
int scan(void) {
return IHEOL;
}
getline(line, sizeof(line));
return IHEOL;
}
getline(line, sizeof(line));
+#ifdef SERGEEV
+ fflush(stdin);
+ if (curwnd==5){
+ clrscr();
+ setwnd(4);
+ clrscr();
+ }
+#endif /* SERGEEV */
linep = line;
}
// Skip leading white space
linep = line;
}
// Skip leading white space