Merge some more SERGEEV stuff.
[super-star-trek.git] / sst.c
diff --git a/sst.c b/sst.c
index 330d8de7a5256a7e01904014bad5b28ef2d763bf..3567c2551b8aa14c25d622fdcc77a5de6d3097b4 100644 (file)
--- a/sst.c
+++ b/sst.c
@@ -35,9 +35,9 @@ Here are Tom Almy's changes:
 \r
    1. Better base positioning at startup\r
 \r
 \r
    1. Better base positioning at startup\r
 \r
-   2. deathray improvement (but keeping original failure alternatives)\r
+   2. Deathray improvement (but keeping original failure alternatives)\r
 \r
 \r
-   3. Tholian Web\r
+   3. Tholian Web.\r
 \r
    4. Enemies can ram the Enterprise. Regular Klingons and Romulans can\r
       move in Expert and Emeritus games. This code could use improvement.\r
 \r
    4. Enemies can ram the Enterprise. Regular Klingons and Romulans can\r
       move in Expert and Emeritus games. This code could use improvement.\r
@@ -47,7 +47,7 @@ Here are Tom Almy's changes:
    6. Perhaps cloaking to be added later? BSD version\r
 \r
 Here are Stas Sergeev's changes (controlled by the proprocessor symbol\r
    6. Perhaps cloaking to be added later? BSD version\r
 \r
 Here are Stas Sergeev's changes (controlled by the proprocessor symbol\r
-SERGEEV, not yet merged):\r
+SERGEEV, not yet completely merged):\r
 \r
    1. The Space Thingy can be shoved, if you it ram, and can fire back if \r
       fired upon.\r
 \r
    1. The Space Thingy can be shoved, if you it ram, and can fire back if \r
       fired upon.\r
@@ -133,6 +133,21 @@ static void listCommands(int x) {
        if (x) prout("   HELP");\r
 }\r
 \r
        if (x) prout("   HELP");\r
 }\r
 \r
+#ifdef SERGEEV\r
+void setwnd(short wndnum){\r
+     int cury;\r
+     cury=wherey()+wnds[curwnd].wndtop-wnds[wndnum].wndtop;\r
+     if ((curwnd==0)&&(wndnum!=0)) clrscr();\r
+     window(wnds[wndnum].wndleft, wnds[wndnum].wndtop, wnds[wndnum].wndright, wnds[wndnum].wndbottom);\r
+     if ((curwnd==wndnum)&&(cury>wnds[wndnum].wndbottom-wnds[wndnum].wndtop+1)){\r
+        gotoxy(wnds[wndnum].wndright-wnds[wndnum].wndleft+1,wnds[wndnum].wndbottom-wnds[wndnum].wndtop+1);\r
+       skip(1);\r
+     }\r
+     curwnd=wndnum;\r
+     gotoxy(1,cury);\r
+}\r
+#endif /* SERGEEV */\r
+\r
 static void helpme(void) {\r
        int i, j;\r
        char cmdbuf[32], *cp;\r
 static void helpme(void) {\r
        int i, j;\r
        char cmdbuf[32], *cp;\r
@@ -143,9 +158,15 @@ static void helpme(void) {
        key = scan();\r
        while (TRUE) {\r
                if (key == IHEOL) {\r
        key = scan();\r
        while (TRUE) {\r
                if (key == IHEOL) {\r
-                       proutn("Help on what command?");\r
+#ifdef SERGEEV\r
+                        setwnd(5);\r
+#endif /* SERGEEV */\r
+                        proutn("Help on what command? ");\r
                        key = scan();\r
                }\r
                        key = scan();\r
                }\r
+#ifdef SERGEEV\r
+                setwnd(4);\r
+#endif /* SERGEEV */\r
                if (key == IHEOL) return;\r
                for (i = 0; i < NUMCOMMANDS; i++) {\r
                        if (strcmp(commands[i], citem)==0) break;\r
                if (key == IHEOL) return;\r
                for (i = 0; i < NUMCOMMANDS; i++) {\r
                        if (strcmp(commands[i], citem)==0) break;\r
@@ -442,11 +463,17 @@ int main(int argc, char **argv) {
                                freeze(FALSE);\r
                        }\r
                }\r
                                freeze(FALSE);\r
                        }\r
                }\r
-               proutn("Do you want to play again?");\r
+               proutn("Do you want to play again? ");\r
                if (!ja()) break;\r
                if (!ja()) break;\r
+#ifdef SERGEEV\r
+               setwnd(0);\r
+               clrscr();\r
+#endif /* SERGEEV */\r
        }\r
        skip(1);\r
        }\r
        skip(1);\r
+#ifndef SERGEEV\r
        ioend();\r
        ioend();\r
+#endif /* SERGEEV */\r
        puts("May the Great Bird of the Galaxy roost upon your home planet.");\r
        exit(0);\r
 }\r
        puts("May the Great Bird of the Galaxy roost upon your home planet.");\r
        exit(0);\r
 }\r
@@ -588,7 +615,7 @@ int ja(void) {
                chew();\r
                if (*citem == 'y') return TRUE;\r
                if (*citem == 'n') return FALSE;\r
                chew();\r
                if (*citem == 'y') return TRUE;\r
                if (*citem == 'n') return FALSE;\r
-               proutn("Please answer with \"Y\" or \"N\":");\r
+               proutn("Please answer with \"Y\" or \"N\": ");\r
        }\r
 }\r
 \r
        }\r
 }\r
 \r