X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=sst.c;h=3567c2551b8aa14c25d622fdcc77a5de6d3097b4;hb=1072751ee59a11b65fe84d0314fee4bbcf14990e;hp=b456772c5a9a058e5e71a61c1d5f7feaf7313c32;hpb=1dbdcf7305347ff9f650b5434ab036e06e4be24c;p=super-star-trek.git diff --git a/sst.c b/sst.c index b456772..3567c25 100644 --- a/sst.c +++ b/sst.c @@ -35,10 +35,10 @@ Here are Tom Almy's changes: 1. Better base positioning at startup - 2. deathray improvement (but keeping original failure alternatives) + 2. Deathray improvement (but keeping original failure alternatives) + + 3. Tholian Web. - 3. Tholian Web -s 4. Enemies can ram the Enterprise. Regular Klingons and Romulans can move in Expert and Emeritus games. This code could use improvement. @@ -47,7 +47,7 @@ s 6. Perhaps cloaking to be added later? BSD version Here are Stas Sergeev's changes (controlled by the proprocessor symbol -SERGEEV, not yet merged): +SERGEEV, not yet completely merged): 1. The Space Thingy can be shoved, if you it ram, and can fire back if fired upon. @@ -78,7 +78,8 @@ SERGEEV, not yet merged): There are other minor adjustments to what yields an attack and what does not. - 10. Ramming a black hole is no longer instant death. + 10. Ramming a black hole is no longer instant death. There is a + chance you might get timewarped instead. */ @@ -132,6 +133,21 @@ static void listCommands(int x) { if (x) prout(" HELP"); } +#ifdef SERGEEV +void setwnd(short wndnum){ + int cury; + cury=wherey()+wnds[curwnd].wndtop-wnds[wndnum].wndtop; + if ((curwnd==0)&&(wndnum!=0)) clrscr(); + window(wnds[wndnum].wndleft, wnds[wndnum].wndtop, wnds[wndnum].wndright, wnds[wndnum].wndbottom); + if ((curwnd==wndnum)&&(cury>wnds[wndnum].wndbottom-wnds[wndnum].wndtop+1)){ + gotoxy(wnds[wndnum].wndright-wnds[wndnum].wndleft+1,wnds[wndnum].wndbottom-wnds[wndnum].wndtop+1); + skip(1); + } + curwnd=wndnum; + gotoxy(1,cury); +} +#endif /* SERGEEV */ + static void helpme(void) { int i, j; char cmdbuf[32], *cp; @@ -142,9 +158,15 @@ static void helpme(void) { key = scan(); while (TRUE) { if (key == IHEOL) { - proutn("Help on what command?"); +#ifdef SERGEEV + setwnd(5); +#endif /* SERGEEV */ + proutn("Help on what command? "); key = scan(); } +#ifdef SERGEEV + setwnd(4); +#endif /* SERGEEV */ if (key == IHEOL) return; for (i = 0; i < NUMCOMMANDS; i++) { if (strcmp(commands[i], citem)==0) break; @@ -199,9 +221,29 @@ static void helpme(void) { fclose(fp); } +#ifdef SERGEEV +void drawmaps(short l){ + _setcursortype(_NOCURSOR); + if (l==1) sensor(); + if (l!=2) setwnd(1); + gotoxy(1,1); + strcpy(line,"s"); + srscan(1); + if (l!=2){ + setwnd(2); + clrscr(); + srscan(2); + setwnd(3); + clrscr(); + strcpy(line,"l"); + lrscan(); + _setcursortype(_NORMALCURSOR); + } +} +#endif /* SERGEEV */ + static void makemoves(void) { int i, hitme; - char ch; while (TRUE) { /* command loop */ hitme = FALSE; justin = 0; @@ -385,9 +427,6 @@ static void makemoves(void) { int main(int argc, char **argv) { int i, option, usecurses = TRUE; - int hitme; - char ch; - while ((option = getopt(argc, argv, "t")) != -1) { switch (option) { case 't': @@ -424,12 +463,19 @@ int main(int argc, char **argv) { freeze(FALSE); } } - proutn("Do you want to play again?"); + proutn("Do you want to play again? "); if (!ja()) break; +#ifdef SERGEEV + setwnd(0); + clrscr(); +#endif /* SERGEEV */ } skip(1); +#ifndef SERGEEV ioend(); +#endif /* SERGEEV */ puts("May the Great Bird of the Galaxy roost upon your home planet."); + exit(0); } @@ -569,7 +615,7 @@ int ja(void) { chew(); if (*citem == 'y') return TRUE; if (*citem == 'n') return FALSE; - proutn("Please answer with \"Y\" or \"N\":"); + proutn("Please answer with \"Y\" or \"N\": "); } }