projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some messages.
[super-star-trek.git]
/
sst.c
diff --git
a/sst.c
b/sst.c
index c353d04b0621bfe41e97a429c538f25b4aaac314..07b7da5cef805bca47a59a279237eee70611f9c1 100644
(file)
--- a/
sst.c
+++ b/
sst.c
@@
-49,47
+49,48
@@
Here are Tom Almy's changes:
6. Perhaps cloaking to be added later? BSD version
6. Perhaps cloaking to be added later? BSD version
-Here are Stas Sergeev's changes (controlled by the proprocessor symbol
-SERGEEV, not yet completely merged):
+Here are Stas Sergeev's changes:
1. The Space Thingy can be shoved, if you it ram, and can fire back if
fired upon.
1. The Space Thingy can be shoved, if you it ram, and can fire back if
fired upon.
-
1
The Tholian can be hit with phasers
+
2.
The Tholian can be hit with phasers
-
2
. When you are docked, base covers you with an almost invincible shields
+
3
. When you are docked, base covers you with an almost invincible shields
(a commander can still ram you, or a Romulan can destroy the base,
or a SCom can even succeed with direct attack IIRC, but this rarely
happens).
(a commander can still ram you, or a Romulan can destroy the base,
or a SCom can even succeed with direct attack IIRC, but this rarely
happens).
-
3
. SCom can't escape from you if no more enemies remain (without this,
-
chasing SCom can take an eternity).
+
4
. SCom can't escape from you if no more enemies remain (without this,
+ chasing SCom can take an eternity).
-
4
. Probe target you enter is now the destination quadrant. Before I don't
-
remember what it was, but it was something I had difficulty using)
+
5
. Probe target you enter is now the destination quadrant. Before I don't
+ remember what it was, but it was something I had difficulty using)
-
5
. Secret password is now autogenerated.
+
6
. Secret password is now autogenerated.
-
6. "Plaque" is adjusted for A4 paper:
)
+
7. "Plaque" is adjusted for A4 paper :-
)
-
7
. Phasers now tells you how much energy needed, but only if the computer
+
8
. Phasers now tells you how much energy needed, but only if the computer
is alive.
is alive.
-
8
. Planets are auto-scanned when you enter the quadrant.
+
9
. Planets are auto-scanned when you enter the quadrant.
-
9
. Mining or using crystals in presense of enemy now yields an attack.
+
10
. Mining or using crystals in presense of enemy now yields an attack.
There are other minor adjustments to what yields an attack
and what does not.
There are other minor adjustments to what yields an attack
and what does not.
-
10
. Ramming a black hole is no longer instant death. There is a
-
chance you might get timewarped instead.
+
11
. Ramming a black hole is no longer instant death. There is a
+ chance you might get timewarped instead.
-
11
. "freeze" command reverts to "save", most people will understand this
+
12
. "freeze" command reverts to "save", most people will understand this
better anyway.
better anyway.
+ 13. Screen-oriented interface, with sensor scans always up.
+
Eric Raymond's changes:
Eric Raymond's changes:
-
1. "sos" and "call" becomes "mayday", "freeze" and "save" are both good.
+ 1. "sos" and "call" becomes "mayday", "freeze" and "save" are both good.
*/
*/
@@
-99,13
+100,11
@@
static struct
int value;
}
commands[] = {
int value;
}
commands[] = {
-#ifndef SERGEEV
#define SRSCAN 1
{"SRSCAN", SRSCAN},
{"STATUS", SRSCAN},
#define LRSCAN 2
{"LRSCAN", LRSCAN},
#define SRSCAN 1
{"SRSCAN", SRSCAN},
{"STATUS", SRSCAN},
#define LRSCAN 2
{"LRSCAN", LRSCAN},
-#endif /* SERGEEV */
#define PHASERS 3
{"PHASERS", PHASERS},
#define TORPEDO 4
#define PHASERS 3
{"PHASERS", PHASERS},
#define TORPEDO 4
@@
-129,62
+128,51
@@
commands[] = {
{"WARP", WARP},
#define SCORE 13
{"SCORE", SCORE},
{"WARP", WARP},
#define SCORE 13
{"SCORE", SCORE},
-#ifndef SERGEEV
#define SENSORS 14
{"SENSORS", SENSORS},
#define SENSORS 14
{"SENSORS", SENSORS},
-#endif /* SERGEEV */
#define ORBIT 15
{"ORBIT", ORBIT},
#define ORBIT 15
{"ORBIT", ORBIT},
-#define TRANSPORT 1
7
+#define TRANSPORT 1
6
{"TRANSPORT", TRANSPORT},
{"TRANSPORT", TRANSPORT},
-#define MINE 1
8
+#define MINE 1
7
{"MINE", MINE},
{"MINE", MINE},
-#define CRYSTALS 1
9
+#define CRYSTALS 1
8
{"CRYSTALS", CRYSTALS},
{"CRYSTALS", CRYSTALS},
-#define SHUTTLE
20
+#define SHUTTLE
19
{"SHUTTLE", SHUTTLE},
{"SHUTTLE", SHUTTLE},
-#define PLANETS 2
1
+#define PLANETS 2
0
{"PLANETS", PLANETS},
{"PLANETS", PLANETS},
-#ifdef SERGEEV
-#define REQUEST 22
- {"REQUEST", REQUEST},
-#endif /* SERGEEV */
-#define REPORT 23
+#define REPORT 21
{"REPORT", REPORT},
{"REPORT", REPORT},
-#define COMPUTER 2
4
+#define COMPUTER 2
3
{"COMPUTER", COMPUTER},
{"COMPUTER", COMPUTER},
-#define COMMANDS 2
5
+#define COMMANDS 2
4
{"COMMANDS", COMMANDS},
{"COMMANDS", COMMANDS},
-#define EMEXIT 2
6
+#define EMEXIT 2
5
{"EMEXIT", EMEXIT},
{"EMEXIT", EMEXIT},
-#define PROBE 2
7
+#define PROBE 2
6
{"PROBE", PROBE},
{"PROBE", PROBE},
-#define SAVE 2
8
+#define SAVE 2
7
{"SAVE", SAVE},
{"FREEZE", SAVE},
{"SAVE", SAVE},
{"FREEZE", SAVE},
-#define ABANDON 2
9
+#define ABANDON 2
8
{"ABANDON", ABANDON},
{"ABANDON", ABANDON},
-#define DESTRUCT
30
+#define DESTRUCT
29
{"DESTRUCT", DESTRUCT},
{"DESTRUCT", DESTRUCT},
-#define DEATHRAY 3
1
+#define DEATHRAY 3
0
{"DEATHRAY", DEATHRAY},
{"DEATHRAY", DEATHRAY},
-#define DEBUGCMD 3
2
+#define DEBUGCMD 3
1
{"DEBUG", DEBUGCMD},
{"DEBUG", DEBUGCMD},
-#define MAYDAY 3
3
+#define MAYDAY 3
2
{"MAYDAY", MAYDAY},
{"SOS", MAYDAY},
{"CALL", MAYDAY},
{"MAYDAY", MAYDAY},
{"SOS", MAYDAY},
{"CALL", MAYDAY},
-#define QUIT 3
4
+#define QUIT 3
3
{"QUIT", QUIT},
{"QUIT", QUIT},
-#define HELP 3
5
+#define HELP 3
4
{"HELP", HELP},
};
{"HELP", HELP},
};
-#ifdef SERGEEV
-wnd wnds[6]={{1,1,80,25},{1,1,25,12},{26,2,80,12},{65,1,80,10},{1,13,80,23},{1,24,80,25}};
-short curwnd;
-#endif /* SERGEEV */
-
#define NUMCOMMANDS sizeof(commands)/sizeof(commands[0])
static void listCommands(int x) {
#define NUMCOMMANDS sizeof(commands)/sizeof(commands[0])
static void listCommands(int x) {
@@
-208,15
+196,11
@@
static void helpme(void) {
key = scan();
while (TRUE) {
if (key == IHEOL) {
key = scan();
while (TRUE) {
if (key == IHEOL) {
-#ifdef SERGEEV
- setwnd(5);
-#endif /* SERGEEV */
+ setwnd(BOTTOM_WINDOW);
proutn("Help on what command? ");
key = scan();
}
proutn("Help on what command? ");
key = scan();
}
-#ifdef SERGEEV
- setwnd(4);
-#endif /* SERGEEV */
+ setwnd(LOWER_WINDOW);
if (key == IHEOL) return;
for (i = 0; i < NUMCOMMANDS; i++) {
if (strcasecmp(commands[i].name, citem)==0) {
if (key == IHEOL) return;
for (i = 0; i < NUMCOMMANDS; i++) {
if (strcasecmp(commands[i].name, citem)==0) {
@@
-277,34
+261,10
@@
static void helpme(void) {
fclose(fp);
}
fclose(fp);
}
-void drawmaps(short l) {
-/* hook to be called after moving to redraw maps */
-#ifdef SERGEEV
- _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;
static void makemoves(void) {
int i, hitme;
-#ifdef SERGEEV
clrscr();
clrscr();
- setwnd(4);
-#endif /* SERGEEV */
+ setwnd(LOWER_WINDOW);
while (TRUE) { /* command loop */
drawmaps(1);
while (TRUE) { /* get a command */
while (TRUE) { /* command loop */
drawmaps(1);
while (TRUE) { /* get a command */
@@
-313,27
+273,17
@@
static void makemoves(void) {
Time = 0.0;
i = -1;
chew();
Time = 0.0;
i = -1;
chew();
-#ifdef SERGEEV
- setwnd(5);
+ setwnd(BOTTOM_WINDOW);
clrscr();
clrscr();
-#endif /* SERGEEV */
proutn("COMMAND> ");
if (scan() == IHEOL) {
proutn("COMMAND> ");
if (scan() == IHEOL) {
-#ifdef SERGEEV
- _setcursortype(_NOCURSOR);
- setwnd(4);
- clrscr();
- chart(0);
- _setcursortype(_NORMALCURSOR);
-#endif /* SERGEEV */
+ makechart();
continue;
}
continue;
}
-#ifdef SERGEEV
ididit=0;
clrscr();
ididit=0;
clrscr();
- setwnd(
4
);
+ setwnd(
LOWER_WINDOW
);
clrscr();
clrscr();
-#endif /* SERGEEV */
for (i=0; i < ABANDON; i++)
if (isit(commands[i].name)) {
i = commands[i].value;
for (i=0; i < ABANDON; i++)
if (isit(commands[i].name)) {
i = commands[i].value;
@@
-351,14
+301,12
@@
static void makemoves(void) {
}
commandhook(commands[i].name, TRUE);
switch (i) { /* command switch */
}
commandhook(commands[i].name, TRUE);
switch (i) { /* command switch */
-#ifndef SERGEEV
case SRSCAN: // srscan
srscan(1);
break;
case LRSCAN: // lrscan
lrscan();
break;
case SRSCAN: // srscan
srscan(1);
break;
case LRSCAN: // lrscan
lrscan();
break;
-#endif /* SERGEEV */
case PHASERS: // phasers
phasers();
if (ididit) hitme = TRUE;
case PHASERS: // phasers
phasers();
if (ididit) hitme = TRUE;
@@
-400,11
+348,9
@@
static void makemoves(void) {
case SCORE: // score
score();
break;
case SCORE: // score
score();
break;
-#ifndef SERGEEV
case SENSORS: // sensors
sensor();
break;
case SENSORS: // sensors
sensor();
break;
-#endif /* SERGEEV */
case ORBIT: // orbit
orbit();
if (ididit) hitme = TRUE;
case ORBIT: // orbit
orbit();
if (ididit) hitme = TRUE;
@@
-453,9
+399,7
@@
static void makemoves(void) {
break;
case SAVE: // Save Game
freeze(FALSE);
break;
case SAVE: // Save Game
freeze(FALSE);
-#ifdef SERGEEV
clrscr();
clrscr();
-#endif /* SERGEEV */
if (skill > 3)
prout("WARNING--Saved games produce no plaques!");
break;
if (skill > 3)
prout("WARNING--Saved games produce no plaques!");
break;
@@
-526,14
+470,9
@@
int main(int argc, char **argv) {
}
}
}
}
-#ifndef SERGEEV
- iostart(usecurses);
-#else
randomize();
randomize();
- textattr(7);
- clrscr();
- setwnd(0);
-#endif /* SERGEEV */
+ iostart(usecurses);
+
line[0] = '\0';
for (i = optind; i < argc; i++) {
strcat(line, argv[i]);
line[0] = '\0';
for (i = optind; i < argc; i++) {
strcat(line, argv[i]);
@@
-560,15
+499,11
@@
int main(int argc, char **argv) {
}
proutn("Do you want to play again? ");
if (!ja()) break;
}
proutn("Do you want to play again? ");
if (!ja()) break;
-#ifdef SERGEEV
- setwnd(0);
+ setwnd(FULLSCREEN_WINDOW);
clrscr();
clrscr();
-#endif /* SERGEEV */
}
skip(1);
}
skip(1);
-#ifndef SERGEEV
ioend();
ioend();
-#endif /* SERGEEV */
prout("May the Great Bird of the Galaxy roost upon your home planet.");
return 0;
}
prout("May the Great Bird of the Galaxy roost upon your home planet.");
return 0;
}
@@
-669,15
+604,13
@@
int scan(void) {
chew();
return IHEOL;
}
chew();
return IHEOL;
}
- getline(line, sizeof(line));
-#ifdef SERGEEV
+ cgetline(line, sizeof(line));
fflush(stdin);
fflush(stdin);
- if (curwnd==
5
){
+ if (curwnd==
BOTTOM_WINDOW
){
clrscr();
clrscr();
- setwnd(
4
);
+ setwnd(
LOWER_WINDOW
);
clrscr();
}
clrscr();
}
-#endif /* SERGEEV */
linep = line;
}
// Skip leading white space
linep = line;
}
// Skip leading white space