Super Star Trek TO-DO list
+Bugs:
+
+-----------------------------------------------------------------------------
+ Short-range scan
+ 1 2 3 4 5 6 7 8 9 10
+ 1 E . . . . . . . . . Stardate 3800.9, Time Left 6.14
+ 2 . . . . . . . . . C Condition RED, 0 DAMAGES
+ 3 . @ . * . . . . . . Position 1 - 3 , 1 - 1
+ 4 . . . . . . . . . . Life Support ACTIVE
+ 5 . . . . . . . . . . Warp Factor 5.0
+ 6 . . . . . . . . . . Energy 3871.68
+ 7 . . . . * . . . . . Torpedoes 10
+ 8 . . . . . . . . . . Shields UP, 92% 2294.3 units
+ 9 . . . . . . R . . . Klingons Left 8
+10 . . . . . . * . . . Major system Capella IV (Kohath)
+
+
+COMMAND> phot 2
+Target sector for torpedo number 1- 2 10
+Target sector for torpedo number 2- 2 10
+
+***Commander at Sector 2 - 10 damaged-- displaced by blast to Sector 3 - 10
+
+
+***Commander at Sector 2 - 10 destroyed.
+=== ATTACK!
+
+***TORPEDO INCOMING From Unknown?? at Sector 3 - 10
+
+Torpedo missed.
+-----------------------------------------------------------------------------
+
+Here's the log that reproduces it
+
+-----------------------------------------------------------------------------
+seed 1158606492
+sr
+phasers
+auto
+391
+sensors
+planets
+lr
+chart
+probe
+y
+n
+a
+1 8
+shields up
+sr
+m a 10 10
+
+chart
+m a 1 3 1 1
+
+n
+chart
+sr
+phot 2
+2 10
+2 10
+-----------------------------------------------------------------------------
+
+The bug is the 'Unknown??' in the incoming-torpedo message. What
+happened here is that the Commander launched a torp just before being
+killed. The torpedo knows its origin but not who fired it.
Short-term items:
<quote>Super-Commander</quote> is more powerful than an ordinary
commander, he can destroy a base more quickly.</para>
+<para>Inhabited worlds can be attacked, enslaved, and forced to
+build more Klingon starships. They will send out a distress call
+by subspace radio when they are attacked, and you will lose contact
+with them when they are enslaved.</para>
+
<para>The <quote>Super-Commander</quote> travels around the galaxy at
a speed of about warp 6 or 7. His movement is strictly time based;
the more time passes, the further he can go.</para>
<para>You lose—</para>
<orderedlist>
+<listitem><para>300 points for each inhabited world you destroy,</para></listitem>
<listitem><para>200 points if you get yourself killed,</para></listitem>
<listitem><para>100 points for each starbase you destroy,</para></listitem>
<listitem><para>100 points for each starship you lose,</para></listitem>
<listitem><para>45 points for each time you had to call for help,</para></listitem>
-<listitem><para>10 points for each planet you destroyed,</para></listitem>
+<listitem><para>10 points for each uninhabited planet you destroyed,</para></listitem>
<listitem><para>5 points for each star you destroyed, and</para></listitem>
<listitem><para>1 point for each casualty you incurred.</para></listitem>
</orderedlist>
<cmdsynopsis>
<command>sst</command>
-<arg choice='opt'>-t </arg>
-<arg rep='repeat' ><replaceable>command</replaceable></arg>
+ <arg choice='opt'>-r <replaceable>filename</replaceable></arg>
+ <arg choice='opt'>-t </arg>
+ <arg choice='opt'>-x </arg>
+ <arg rep='repeat' ><replaceable>command</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
systems where <filename>/usr/share/doc/sst/</filename> is a legal
filename, it will probably be installed there as well.</para>
-<para>There is one option -t, which forces the original pure-tty mode.
+<para>The option -t forces the original pure-tty mode.
Normally sst tries to come up in full-screen mode that assumes it is
running on a cursor-addressable terminal or terminal emulator.</para>
+<para>The option -r sets up replay of a session logfile. Commands
+in the logfile are executed, then additional commands are taken
+from stdin as normal. The -r option forces -t mode.</para>
+
+<para>The option -x enables some debugging features of interest
+probably only to sst2k developers.</para>
+
<para>Input tokens for the setup prompts will be read from the
remainder of the command line before standard input. Thus, for
example, you can invoke the program as</para>
mode (all features enabled).</para>
</refsect1>
+<refsect1 id='files'><title>FILES</title>
+<variablelist>
+<varlistentry>
+<term>/usr/share/doc/sst/sst.doc</term>
+<listitem>
+<para>Documentation file.</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>sst-input.log</term>
+<listitem>
+<para>Where user input is saved to (send this with your bug reports).</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>emsave.trk</term>
+<listitem>
+<para>Save file produced by EMEXIT command.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refsect1>
+
<refsect1 id='authors'><title>AUTHORS</title>
<para>Super Star Trek was designed and written by David Matuszek, Paul
Reynolds, and Don Smith in the 1970s. It was resurrected by Tom Almy.
The screen-oriented interface is by Stas Sergeev. This version has
-been cleaned up and documented by Eric S. Raymond
+been improved, cleaned up and documented by Eric S. Raymond
<email>esr@snark.thyrsus.com</email>. There is a <ulink
url='https://developer.berlios.de/projects/sst/'>project
page</ulink>.</para>
}
break;
case FDISTR: /* inhabited system issues distress call */
- schedule(FDISTR, expran(0.5*game.intime));
+ unschedule(FDISTR);
/* try a whole bunch of times to find something suitable */
i = 100;
do {
ev = schedule(FENSLV, expran(game.intime));
ev->quadrant = w;
q->status = distressed;
- if (idebug)
- prout("=== Distress call set at %d, %d.", w.x, w.y);
/* tell the captain about it if we can */
if (game.damage[DRADIO] == 0.0 || game.condit == IHDOCKED)
strcat(line, "\n");
wrefresh(curwnd);
} else {
- fgets(line, max, stdin);
+ if (replayfp && !feof(replayfp))
+ fgets(line, max, replayfp);
+ else
+ fgets(line, max, stdin);
}
if (logfp)
fputs(line, logfp);
char citem[10];
int seed; // the random-number seed
bool idebug; // debug mode
-bool randready; // Has the random-number generator initialized?
-FILE *logfp;
+FILE *logfp, *replayfp;
char *device[NDEVICES] = {
"S. R. Sensors",
else
game.options |= OPTION_TTY;
- while ((option = getopt(argc, argv, "tx")) != -1) {
+ seed = (int)time(NULL);
+ while ((option = getopt(argc, argv, "r:tx")) != -1) {
switch (option) {
+ case 'r':
+ replayfp = fopen(optarg, "r");
+ if (replayfp == NULL) {
+ fprintf(stderr, "sst: can't open replay file %s\n", optarg);
+ exit(1);
+ }
+ if (fscanf(replayfp, "seed %d\n", &seed) != 1) {
+ fprintf(stderr, "sst: replay file %s is ill-formed\n", optarg);
+ exit(1);
+ }
+ /* FALL THROUGH */
case 't':
game.options |= OPTION_TTY;
game.options &=~ OPTION_CURSES;
/* where to save the input in case of bugs */
logfp = fopen("sst-input.log", "w");
setlinebuf(logfp);
+ fprintf(logfp, "seed %d\n", seed);
+ srand(seed);
- randomize();
+ srand(seed);
iostart();
line[0] = '\0';
double Rand(void)
{
- if (!randready) {
- if (seed == 0)
- seed = (unsigned)time(NULL);
- if (logfp)
- fprintf(logfp, "seed %d\n", seed);
- srand(seed);
- randready = true;
- }
return rand()/(1.0 + (double)RAND_MAX);
}
case FENSLV: proutn("Enlavement "); break;
case FREPRO: proutn("Klingon Build "); break;
}
- if (is_scheduled(i))
+ if (is_scheduled(i)) {
proutn("%.2f", scheduled(i)-game.state.date);
- else
+ if (i == FENSLV || i == FREPRO) {
+ ev = findevent(i);
+ proutn(" in %d-%d", ev->quadrant.x,ev->quadrant.y);
+ }
+ } else
proutn("never");
- chew();
proutn("? ");
+ chew();
key = scan();
if (key == 'n') {
unschedule(i);
extern event *schedule(int, double);
extern void postpone(int, double);
extern double scheduled(int);
+#define findevent(evtype) &game.future[evtype]
#define SSTMAGIC "SST2.0\n"
extern double aaitem;
extern char citem[10];
extern int seed;
-extern bool randready;
extern bool idebug;
-extern FILE *logfp;
+extern FILE *logfp, *replayfp;
/* the Space Thingy's global state should *not* be saved! */
extern coord thing;