From 6e230d76cb937fb122a79fb32547a6938b4490b9 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 4 Feb 2005 17:31:03 +0000 Subject: [PATCH 01/16] Don't use a compiler trick to initialize the conio library, because later we'll need to make the choice about whether or not to use it at runtime. --- conio.c | 6 +----- io.c | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/conio.c b/conio.c index 27c38c3..9f51c31 100644 --- a/conio.c +++ b/conio.c @@ -31,7 +31,6 @@ char color_warning=1; int directvideo; WINDOW *conio_scr; -#ifdef SERGEEV /* Some internals... */ static int colortab(int a) /* convert LINUX Color code to DOS-standard */ { @@ -47,7 +46,6 @@ static int colortab(int a) /* convert LINUX Color code to DOS-standard */ } return COLOR_BLACK; } -#endif /* SERGEEV */ static void docolor (int color) /* Set DOS-like text mode colors */ { @@ -61,9 +59,8 @@ static void docolor (int color) /* Set DOS-like text mode colors */ wattron(conio_scr,COLOR_PAIR(1+(color&7)+((color&112)>>1))); } -#ifdef SERGEEV /* Call this before any call to linux conio - except the port functions ! */ -void __attribute__((constructor)) initconio (void) /* This is needed, because ncurses needs to be initialized */ +void initconio (void) { int x,y; short pair; @@ -93,7 +90,6 @@ void __attribute__((constructor)) initconio (void) /* This is needed, because nc textcolor(7); textbackground(0); } -#endif /* SERGEEV */ /* Call this on exiting your program */ void doneconio (void) diff --git a/io.c b/io.c index e9cc3d7..9e66eb6 100644 --- a/io.c +++ b/io.c @@ -53,6 +53,7 @@ static void fastexit(int sig) { void iostart(int usecurses) { #ifdef SERGEEV + initconio(); textattr(7); clrscr(); setwnd(FULLSCREEN_WINDOW); -- 2.31.1 From c430e3a5fdb07728d3199f20cda2b566e6b60caa Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 4 Feb 2005 22:56:07 +0000 Subject: [PATCH 02/16] Prevent the sensor display from being garbled. --- io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/io.c b/io.c index 9e66eb6..d59a509 100644 --- a/io.c +++ b/io.c @@ -10,6 +10,7 @@ #include "conio.h" #include "sst.h" +#include "sstlinux.h" #ifndef SERGEEV static int linecount; /* for paging */ @@ -349,7 +350,7 @@ void drawmaps(short l) { if (l==1) sensor(); if (l!=2) setwnd(LEFTUPPER_WINDOW); gotoxy(1,1); - enqueue("s"); + enqueue("no"); srscan(SCAN_FULL); if (l!=2){ setwnd(SRSCAN_WINDOW); -- 2.31.1 From 7453bc4027cf9dcf29ebae79341070c3bfb30aed Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 4 Feb 2005 23:51:24 +0000 Subject: [PATCH 03/16] Remove CRs. --- sst-doc.xml | 3690 +++++++++++++++++++++++++-------------------------- 1 file changed, 1845 insertions(+), 1845 deletions(-) diff --git a/sst-doc.xml b/sst-doc.xml index 2ef513b..1a74780 100644 --- a/sst-doc.xml +++ b/sst-doc.xml @@ -1,1845 +1,1845 @@ - - - - - -Super Star Trek - - - - David - Matuzsek - - - Paul - Reynolds - - - Tom - Almy - - - Stas - Sergeev - - - Eric - Steven - Raymond - - - - -Permission is hereby granted for the copying, distribution, -modification and use of this program and associated documentation -for recreational purposes, provided that all references to the -authors are retained. However, permission is not and will not be -granted for the sale or promotional use of this program or program -documentation, or for use in any situation in which profit may be -considered an objective, since it is the desire of the authors to -respect the copyrights of the originators of Star Trek. - - - - - - - SSSSS U U PPPPP EEEEE RRRRR - S U U P P E R R - SSSSS U U PPPPP EEEE RRRRR - S U U P E R R - SSSSS UUUUU P EEEEE R R - - - SSSSSSS TTTTTTTT A RRRRRRR - SSSSSSSS TTTTTTTT AAA RRRRRRRR - SS TT AAA RR RR - SSSSSSS TT AA AA RR RR - SSSSSSS TT AA AA RRRRRRRR - SS TT AAAAAAA RRRRRRR - SS TT AAAAAAA RR RR - SSSSSSSS TT AA AA RR RR - SSSSSSS TT AA AA RR RR - - - - TTTTTTTT RRRRRRR EEEEEEEEE KK KK - TTTTTTTT RRRRRRRR EEEEEEEEE KK KK - TT RR RR EE KK KK - TT RR RR EEEEEE KKKKKK - TT RRRRRRRR EEEEEE KKKKK - TT RRRRRRR EE KK KK - TT RR RR EE KK KK - TT RR RR EEEEEEEEE KK KK - TT RR RR EEEEEEEEE KK KK - - - Produced For Your Enjoyment - - By - - David Matuszek - and - Paul Reynolds - - With Modifications By - Don Smith - - Resurrected By - Tom Almy - - Curses Interface By - Stas Sergeev - - SST 2K polishing by - Eric S. Raymond - - - -Introduction -The Organian Peace Treaty has collapsed, and the Federation is at war -with the Klingon Empire. Joining the Klingons against the Federation -are the members of the Romulan Star Empire. As commander of the -Starship U.S.S. Enterprise, your job is to wipe out the Klingon -invasion fleet and make the galaxy safe for democracy. - -Your battleground is the entire galaxy, which for convenience is -divided up into eight rows of eight quadrants each, like a -checkerboard. Rows are numbered from top to bottom, and columns are -numbered left to right, so quadrant 1 - 8 would be in the upper right -hand corner of the galaxy. - -During battle you will be concerned only with those enemies that -occupy the same quadrant as yourself. Quadrants are divided up into -sectors: ten rows of ten sectors each. Sectors are numbered in the -same way as quadrants, so the sector in the upper right corner is -sector 1 - 10. You have a short-range scanner which allows you to -look at the entire quadrant in a single display. - -Enemies recharge during your absence. If you leave a quadrant -containing a weakened enemy, when you return to that quadrant he will -be strong again. Also, each time you enter a quadrant, the positions -of everthing in the quadrant (except your ship) are randomized, to -save you the trouble of trying to remember where everything in the -quadrant is. Notice that this refers only to the positions of things -in the quadrant—the numbers of each kind of thing are not changed -(except for black holes and the Super-commander, which move around -the galaxy). If you kill something, it stays dead. - -The Romulans are not as serious a threat to the Federation as the -Klingons. For one thing, there are not as many of them. For -another, the Romulans are not as treacherous. However, Romulans are -not to be trifled with, especially when you are in violation of the -Romulan Neutral Zone. - -There are two kinds of Klingons: Ordinary Klingons, which are -bad enough, and Klingon Commanders, which are even worse. Commanders -are about three times stronger than ordinary Klingons. Commanders are -more resistant to your weapons. Commanders can move about during -battle while Ordinary Klingons stay put. And finally, Commanders have -a thing called a long-range tractor beam which they can -use, at random intervals, to yank you away from what you are doing -into their quadrant, to do battle with them. There is also a special -commander, called the Super-commander. This character -is so bad he is reserved for the Good, Expert, and Emeritus games. -Fortunately, there is just one Super-commander in a game. In addition -to the undesirable traits of Commanders, he can move from quadrant to -quadrant at will, seeking out and destroying your starbases and any -helpful planets he runs across. He also has a spy planted aboard your -ship, giving him valuable information about your condition. Using -this information, he can do dastardly things like tractor beam your -ship when you are in bad shape. And once you've been tractor beamed -by the Super-commander — - -But the advantages are not all on the side of the enemy. Your ship -is more powerful, and has better weapons. Besides, in the this -galaxy there are from two to five starbases, at which you can stop to -refuel and lick your wounds, safe from phaser attack or tractor -beams. But you had best not dally there too long, since time is not -on your side. The Klingons are not just after you; they are -attacking the entire Federation. There is always a finite time -left, which is how much longer the Federation can hold out if you -just sit on your fat behind and do nothing. As you wipe out -Klingons, you reduce the rate at which the invasion fleet weakens the -Federation, and so the time left until the Federation collapses may -actually increase. Since Klingons are the main threat to the -Federation, the Romulans do not figure into the time left. In -fact, you need not kill all the Romulans to win. If you can get all -the Klingons, the Federation will abide forever, and you have won the -game. - -Space is vast, and it takes precious time to move from one place to -another. In comparison, other things happen so quickly that we -assume the take no time at all. Two ways that time can pass are when -you move, or when you issue a command to sit still and rest for a -period of time. You will sometimes want to do the latter, since the -various devices aboard your starship may be damaged and require time -to repair. Of course, repairs can be made more quickly at a starbase -than than can in flight. - -In addition to Klingons, Romulans, and starbases, the galaxy -contains (surprise) stars. Mostly, stars are a nuisance and just get -in your way. You can trigger a star into going nova by shooting one -of your photon torpedoes at it. When a star novas, it does a lot of -dammage to anything immediately adjacent to it. If another star is -adjacent to a nova, it too will go nova. Stars may also occasionally -go supernova; a supernova in a quadrant destroys everything in the -quadrant andmakes the quadrant permanently uninhabitable. You may -jump over a quadrant containing a supernova when you -move, but you should not stop there. - -Supernovas may happen spontaneously, without provocation. If a -supernova occurs in the same quadrant you are in, your starship has an -emergency automatic override which picks some random -direction and some random warp factor, and tries to throw you clear of -the supernova. If the supernova occurs in some other quadrant, you -just get a warning message from starfleet about it (provided, of -course, that your subspace radio is working). - -Also a few planets are scattered through the galaxy. These can -sometimes be a great help since some of them will have dilithium -crystals, which are capable of replenishing the ship's energy -supply. You can either beam down to the planet surface using the -transporter, or take the shuttle craft Galileo. - -Finally, each quadrant will contain from zero to three black -holes. These can deflect or swallow torpedoes passing near them. They -also swallow enemy ships knocked into them. If your ship enters one -— - -Star Trek is a rich game, full of detail. These instructions are -written at a moderate level—no attempt has been made fully to -describe everything about the game, but there is quite a bit more -here than you need to get started. If you are new to the game, just -get a rough idea of the kinds of commands available, and start -playing. After a game or two you will have learned everthing -important, and the detailed command descriptions which follow will be -a lot more meaningful to you. - -You have weapons: phasers and photon torpedoes. You have a defense: -deflector shields. You can look at things: long-range scaners, -short-range scanners, and a star chart. You can move about, under -warp drive or impulse power. You can also dock at a starbase, rest -while repairs are being made, abandon ship, self destruct, or give up -and start a new game. - -The Klingons are waiting. - - -How To Issue Commands - -When the game is waiting for you to enter a command it will -print out - - - COMMAND> - - -You may then type in your command. All you have to remember for each -command is the mnemonic. For example, if you want to move straight up -one quadrant, you can type in the mnemonic (case insensitive) - - - move - - -and the computer will prompt you with - - - Manual or automatic- - - -Say you type in manual. The computer then responds - - - X and Y displacements- - - -Now you type in 0 1 which specifies an X movement of zero and a Y -movement of one. - -When you have learned the commands, you can avoid being prompted -simply by typing in the information without waiting to be asked for -it. For example, in the above example, you could simply type in - - - move manual 0 1 - - -and it will be done. Or you could type in - - - move manual - - -and when the computer responds with the displacement prompt, you -can type in - - - 0 1 - - -and it will understand. - -You can abbreviate most mnemonics. For move, you can use any -of - - - move mov mo m - - -successfully. For your safety, certain critical commands (such as to -abandon ship) must be written out in full. Also, in a few cases two -or more commands begin with the same letter, and in this case that -letter refers to a particular one of the commands; to get the other, -your abbreviation must be two or more characters long. This sounds -complicated, but you will learn the abbreviations qGuickly enough. - -What this all boils down to is: - - -You can abbreviate practically anything -If you forget, the computer will proompt you -If you remember, you can type it all on one line - - -If you are part way through entering a command and you change your -minde, you can cancel the command by typing -1 as one of the -parameters, with the exception of the manual move command. - -If anything is not clear to you, experiment. The worst you can do is -lose a game or two. - - -List of Commands - -Short-Range Scan - - -Mnemonic: SRSCAN -Shortest abbreviation: S -Full commands: SRSCAN - SRSCAN NO - SRSCAN CHART - - - -If you are using the screen-oriented interface, it should never -be necessary to call this command explicitly; a short-range scan will -always be present on the screen. - -The short-range scan gives you a considerable amount of information -about the quadrant your starship is in. A short-range scan is best -described by an example. - - - 1 2 3 4 5 6 7 8 9 10 - 1 * . . . . R . . . . Stardate 2516.3 - 2 . . . E . . . . . . Condition RED - 3 . . . . . * . B . . Position 5 - 1, 2 - 4 - 4 . . . S . . . . . . Life Support DAMAGED, Reserves=2.30 - 5 . . . . . . . K . . Warp Factor 5.0 - 6 . K . . . . . * . Energy 2176.24 - 7 . . . . . P . . . . Torpedoes 3 - 8 . . . . * . . . . . Shields UP, 42% 1050.0 units - 9 . * . . * . . . C . Klingons Left 12 - 10 . . . . . . . . . . Time Left 3.72 - - -The left part is a picture of the quadrant. The E at sector 2 - -4 represents the Enterprise; the B at sector 3 - 8 is a starbase. -There are ordinary Klingons (K) at sectors 5 - 8 and 6 - 2, and a -Klingon Commander (C) at 9 - 9. The (GULP) -Super-commander (S) is occupies sector 4 - 4, and a -Romulan (R) is at 1 - 6. A planet (P) is at sector 7 - 6. There are -also a large number of stars (*). The periods (.) are just empty -space—they are printed to help you get your bearings. Sector 6 -- 4 contains a black hole ( ). - -The information on the right is assorted status information. You -can get this alone with the STATUS command. The status information -will be absent if you type N after SRSCAN. Otherwise -status information will be presented. - -If you type C after SRSCAN, you will be given a -short-range scan and a Star Chart. - -Short-range scans are free. That is, they use up no energy and no -time. If you are in battle, doing a short-range scan does not give -the enemies another chance to hit you. You can safely do a -short-range scan anytime you like. - -If your short-range sensors are damaged, this command will only show -the contents of adjacent sectors. - -Status Report - - -Mnemonic: STATUS -Shortest abbreviation: ST - - -This command gives you information about the current state of your -starship as follows: - - - -STARDATE - -The current date. A stardate is the same as a day. - - - -CONDITION - -There are four possible conditions: - - - DOCKED - docked at starbase. - - - RED - in battle. - - - YELLOW - low on energy (<1000 units) - - - GREEN - none of the above - - - - - -POSITION - -Quadrant is given first, then sector - - - -LIFE SUPPOR - -If ACTIVE then life support systems are functioning -normally. If on RESERVES the number is how many stardates your -reserve food, air, etc. will last—you must get repairs made or get to -starbase before your reserves run out. - - - -WARP FACTOR - -What your warp factor is currently set to. - - - -ENERGY - -The amount of energy you have left. If it drops to zero, you die. - - - -TORPEDOES - -How many photon torpedoes you have left. - - - -SHIELDS - -Whether your shields are up or down, how strong they are -(what percentage of a hit they can deflect), and shield energy. - - - -KLINGONS LEFT - -How many of the Klingons are still out there. - - - -TIME LEFT - -How long the Federation can hold out against the -present number of Klingons; that is, how long until the end -if you do nothing in the meantime. If you kill Klingons -quickly, this number will go up—if not, it will go down. If -it reaches zero, the federation is conquered and you lose. - - - - -Status information is free—it uses no time or energy, and -if you are in battle, the Klingons are not given another chance to hit -you. - -Status information can also be obtained by doing a short-range scan. -See the SRSCAN command for details. - -Each item of information can be obtained singly by requesting it. -See REQUEST command for details. - - -Long-Range Scan - - -Mnemonic: LRSCAN -Shortest abbreviation: L - - - -If you are using the screen-oriented interface, it should never -be necessary to call this command explicitly; a long-range scan will -always be present on the screen. - -A long-range scan gives you general information about where you are -and what is around you. Here is an example output. - - - Long-range scan for Quadrant 5 - 1 - -1 107 103 - -1 316 5 - -1 105 1000 - - -This scan says that you are in row 5, column 1 of the 8 by 8 galaxy. -The numbers in the scan indicate how many of each kind of thing there -is in your quadrant and all adjacent quadrants. The digits are -interpreted as follows. - - - - - - Thousands digit: - 1000 indicates a supernova (only) - - - Hundreds digit: - number of Klingons present - - - Tens digit: - number of starbases present - - - Ones digit: - number of stars present - - - - - -For example, in your quadrant (5 - 1) the number is 316, which -indicates 3 Klingons, 1 starbase, and 6 stars. The long-range -scanner does not distinguish between ordinary Klingons and Klingon -command ships. If there is a supernova, as in the quadrant below and -to your right (quadrant 6 - 2), there is nothing else in the -quadrant. - -Romulans possess a cloaking device which prevents -their detection by long-range scan. Because of this fact, Starfleet -Command is never sure how many Romulans are out there. -When you kill the last Klingon, the remaining Romulans surrender to -the Federation. - -Planets are also undetectable by long-range scan. The only way to -detect a planet is to find it in your current quadrant with the -short-range sensors. - -Since you are in column 1, there are no quadrants to your left. The -minus ones indicate the negative energy barrier at the edge of the -galaxy, which you are not permitted to cross. - -Long-range scans are free. They use up no energy or time, and can be -done safely regardless of battle conditions. - -Star Chart - - -Mnemonic: CHART -Shortest abbreviation: C - - -As you proceed in the game, you learn more and more about what things -are where in the galaxy. When ever you first do a scan in a quadrant, -telemetry sensors are ejected which will report any changes in the -quadrant(s) back to your ship, providing the sub-space radio is -working. Spock will enter this information in the chart. If the radio -is not working, Spock can only enter new information discovered from -scans, and information in other quadrants may be obsolete. - -The chart looks like an 8 by 8 array of numbers. These numbers are -interpreted exactly as they are on a long-range scan. A period (.) in -place of a digit means you do not know that information yet. For -example, ... means you know nothing about the quadrant, while .1. -menas you know it contains a base, but an unknown number of Klingons -and stars. - -Looking at the star chart is a free operation. It costs neither time -nor energy, and can be done safely whether in or out of battle. - - -Damage Report - - -Mnemonic: DAMAGES -Shortest abbreviation: DA - - -At any time you may ask for a damage report to find out what devices -are damaged and how long it will take to repair them. Naturally, -repairs proceed faster at a starbase. - -If you suffer damages while moving, it is possible that a subsequent -damage report will not show any damage. This happens if the time -spent on the move exceeds the repair time, since in this case the -damaged devices were fixed en route. - -Damage reports are free. They use no energy or time, and can be done -safely even in the midst of battle. - - -Move Under Warp Drive - - -Mnemonic: MOVE -Shortest abbreviation: M -Full command: MOVE MANUAL <displacement> - MOVE AUTOMATIC <destination> - - -This command is the usual way to move from one place to another -within the galaxy. You move under warp drive, according to the -current warp factor (see WARP FACTOR). - -There are two command modes for movement: MANUAL and AUTOMATIC. -The manual mode requires the following format: - - - MOVE MANUAL <deltax> <deltay> - - -<deltax> and <deltay> are the horizontal and vertical -displacements for your starship, in quadrants; a displacement of one -sector is 0.1 quadrants. Specifying <deltax> and <deltay> -causes your ship to move in a straight line to the specified -destination. If <deltay> is omitted, it is assumed zero. For -example, the shortest possible command to move one sector to the right -would be - - - M M .1 - - -The following examples of manual movement refer to the short-range -scan shown earlier. - - - Destination Sector Manual Movement command - 3 - 1 M M -.3 -.1 - 2 - 1 M M -.3 - 1 - 2 M M -.2 .1 - 1 - 4 M M 0 .1 - (leaving quadrant) M M 0 .2 - - -The automatic mode is as follows: - - - MOVE AUTOMATIC <qrow> <qcol> <srow> <scol> - - -<para>where <qrow> and <qcol> are the row and column -numbers of the destination quadrant, and <srow> and <scol> -are the row and column numbers of the destination sector in that -quadrant. This command also moves your ship in a straight line path -to the destination. For moving within a quadrant, <qrow> and -<qcol> may be omitted. For example, to move to sector 2 - 9 in -the current quadrant, the shortest command would be - - - M A 2 9 - - -To move to quadrant 3 - 7, sector 5 - 8, type - - - M A 3 7 5 8 - - -and it will be done. In automatic mode, either two or four numbers -must be supplied. - -Automatic mode utilizes the ship's battle computer. If the -computer is damaged, manual movement must be used. - -If warp engines are damaged less than 10 stardates (undocked) you can -still go warp 4. - -It uses time and energy to move. How much time and how much energy -depends on your current warp factor, the distance you move, and -whether your shields are up. The higher the warp factor, the faster -you move, but higher warp factors require more energy. You may move -with your shields up, but this doubles the energy required. - -You can move within a quadrant without being attacked if you just -entered the quadrant or have been attacked since your last move -command. This enables you to move and hit them before they -retaliate. - - -Warp Factor - - -Mnemonic: WARP -Shortest abbreviation: W -Full command: WARP <number> - - -Your warp factor controls the speed of your starship. The larger the -warp factor, the faster you go and the more energy you use. - -Your minimum warp factor is 1.0 and your maximum warp factor is 10.0 -(which is 100 times as fast and uses 1000 times as much energy). At -speeds above warp 6 there is some danger of causing damage to your -warp engines; this damage is larger at higher warp factors and also -depends on how far you go at that warp factor. - -At exactly warp 10 there is some probability of entering a -so-called time warp and being thrown foward or backward -in time. The farther you go at warp 10, the greater is the -probability of entering the time warp. - - -Impulse Engines - - -Mnemonic: IMPULSE -Shortest abbreviation: I -Full command: IMPULSE MANUAL <displacement> - IMPULSE AUTOMATIC <destination> - - -The impulse engines give you a way to move when your warp engines are -damaged. They move you at a speed of 0.95 sectors per stardate, -which is the equivalent of a warp factor of about 0.975, so they are -much too slow to use except in emergencies. - -Movement commands are indicated just as in the MOVE command. - -The impulse engines require 20 units of energy to engage, plus 10 -units per sector (100 units per quadrant) traveled. It does not cost -extra to move with the shields up. - - -Deflector Shields - - -Mnemonic: SHIELDS -Shortest abbreviation: SH -Full commands: SHIELDS UP - SHIELDS DOWN - SHIELDS TRANSFER <amount of energy to transfer> - - -Your deflector shields are a defensive device to protect you from -Klingon attacks (and nearby novas). As the shields protect you, they -gradually weaken. A shield strength of 75%, for example, means that -the next time a Klingon hits you, your shields will deflect 75% of -the hit, and let 25% get through to hurt you. - -It costs 50 units of energy to raise shields, nothing to lower them. -You may move with your shields up; this costs nothing under impulse -power, but doubles the energy required for warp drive. - -Each time you raise or lower your shields, the Klingons have another -chance to attack. Since shields do not raise and lower -instantaneously, the hits you receive will be intermediate between -what they would be if the shields were completely up or completely -down. - -You may not fire phasers through your shields. However you may use -the high-speed shield control to lower shields, fire phasers, and -raise the shields again before the Klingons can react. Since rapid -lowering and raising of the shields requires more energy than normal -speed operation, it costs you 200 units of energy to activate this -control. It is automatically activated when you fire phasers while -shields are up. You may fire photon torpedoes, but they may be -deflected considerably from their intended course as they pass -through the shields (depending on shield strength). - -You may transfer energy beteen the ship's energy (given as -Energy in the status) and the shields. Thee word -TRANSFER may be abbreviated T. The -ammount of energy to transfer is the number of units of energy you -wish to take from the ship's energy and put into the shields. If you -specify an negative number, energy is drained from the shields to the -ship. Transfering energy constitutes a turn. If you transfer energy -to the shields while you are under attack, they will be at the new -energy level when you are next hit. - -Enemy torpedoes hitting your ship explode on your shields (if they -are up) and have essentially the same effect as phaser hits. - - -Phasers - - -Mnemonic: PHASERS -Shortest abbreviation: P -Full commands: PHASERS AUTOMATIC <AMOUNT TO FIRE> <NO> - PHASERS <AMOUNT TO FIRE> <NO> - PHASERS MANUAL <NO> <AMOUNT 1> <AMOUNT 2>...<AMOUNT N> - - -Phasers are energy weapons. As you fire phasers at Klingons, you -specify an amount to fire which is drawn from your -energy reserves. The amount of total hit required to kill an enemy is -partly random. but also depends on skill level. - -The average hit required to kill an ordinary Klingon varies from 200 -units in the Novice game to 250 units in the Emeritus game. -Commanders normally require from 600 (Novice) to 700 (Emeritus). The -Super-commander requres from 875 (Good) to 1000 (Emeritus). Romulans -require an average of 350 (Novice) to 450 (Emeritus). - -Hits on enemies are cumulative, as long as you don't leave the -quadrant. - -In general, not all that you fire will reach the Klingons. The -farther away they are, the less phaser energy will reach them. If a -Klingon is adjacent to you, he will receive about 90% of the phaser -energy directed at him; a Klingon 5 sectors away will receive about -60% and a Klingon 10 sectors away will receive about 35%. There is -some randomness involved, so these figures are not exact. Phasers -have no effect beyond the boundaries of the quadrant you are in. - -Phasers may overheat (and be damaged) if you fire too large a burst -at once. Firing up to 1500 units is safe. From 1500 on up the -probability of overheat increases with the amount fired. - -If phaser firing is automatic, the computer decides how to -divide up your <amount to fire> among the Klingons present. If -phaser firing is manual, you specify how much energy to fire at each -Klingon present (nearest first), rather than just specifying a total -amount. You can abreviate MANUAL and -AUTOMATIC to one or more letters; if you mention -neither, automatic fire is usually assumed. - -Battle computer information is available by firing phasers manually, -and allowing the computer to prompt you. If you enter zero for the -amount to fire at each enemy, you will get a complete report, without -cost. The battle computer will tell you how much phaser energy to -fire at each enemy for a sure kill. This information appears in -parentheses prior to the prompt for each enemy. Since the amount is -computed from sensor data, if either the computer or the S.R. sensors -are damaged, this information will be unavailable, and phasers must -be fired manually. - -A safety interlock prevents phasers from being fired through -the shields. If this were not so, the shields would contain your fire -and you would fry yourself. However, you may utilize the -high-speed shield control to drop shields, fire -phasers, and raise shields before the enemy can react. Since it takes -more energy to work the shields rapidly with a shot, it costs you 200 -units of energy each time you activate this control. It is -automatically activated when you fire phasers while the shields are -up. By specifying the <no> option, shields are not raised after -firing. - -Phasers have no effect on starbases (which are shielded) or on -stars. - - -Report - - -Mnemonic: REPORT -Shortest abbreviation: REP - - -This command supplies you with information about the state of the -current game. Its purpose is to remind you of things that you have -learned during play, but may have forgotten, and cannot otherwise -retrieve if you are not playing at a hard-copy terminal. - -You are told the following things: - - -The length and skill level of the game you are playing -The original number of Klingons -How many Klingons you have destroyed -Whether the Super-Commander has been destroyed -How many bases have been destroyed -How many bases are left -What bases (if any) are under attack; your subspace radio -must have been working since the attack to get this -information. -How many casualties you have suffered -How many times you have called for help. - - -This same information is automatically given to you when you start to -play a frozen game. - - -Computer - - -Mnemonic: COMPUTER -Shortest abbreviation: CO - - -This command allows using the ship's computer (if functional) to -calculate travel times and energy usage. - - -Photon Torpedoes - - -Mnemonic: PHOTONS -Shortest abbreviation: PHO -Full commands: PHOTONS <NUMBER> <TARG1> <TARG2> <TARG3> - - -Photon torpedoes are projectile weapons—you either hit what you aim -at, or you don't. There are no partial hits. - -One photon torpedo will usually kill one ordinary Klingon, but it -usually takes about two for a Klingon Commander. Photon torpedoes -can also blow up stars and starbases, if you aren't careful. - -You may fire photon torpedoes singly, or in bursts of two or three. -Each torpedo is individually targetable. The computer will prompt -you, asking for the target sector for each torpedo. Alternately, you -may specify each target in the command line. - -Photon torpedoes cannot be aimed precisely—there is always some -randomness involved in the direction they go. Photon torpedoes may -be fired with your shields up, but as they pass through the shields -they are randomly deflected from their intended course even more. - -Photon torpedoes are proximity-fused. The closer they explode to the -enemy, the more damage they do. There is a hit window about one -sector wide. If the torpedo misses the hit window, it does not -explode and the enemy is unaffected. Photon torpedoes are only -effective within the quadrant. They have no effect on things in -adjacent quadrants. - -If more than one torpedo is fired and only one target sector is -specified, all torpedoes are fired at that sector. For example, to -fire two torpedoes at sector 3 - 4, you type - - - PHO 2 3 4 (or) PHO 2 3 4 3 4 - - -To fire torpedoes at, consecutively, sectors 2 - 6, 1 - 10, and 4 - -7, type - - - PHO 3 2 6 1 10 4 7 - - -There is no restriction to fire directly at a sector. For example, -you can enter - - - PHO 1 3 2.5 - - -to aim between two sectors. However, sector numbers must be 1 to 10 -inclusive. - - -Dock at Starbase - - -Mnemonic: DOCK -Shortest abbreviation: D - - -You may dock your starship whenever you are in one of the eight -sector positions immediately adjacent to a starbase. When you dock, -your starship is resupplied with energy, shield energy photon -torpedoes, and life support reserves. Repairs also proceed faster at -starbase, so if some of your devices are damaged, you may wish to stay -at base (by using the REST command) until they are -fixed. If your ship has more than its normal maximum energy (which -can happen if you've loaded crystals) the ship's energy is not -changed. - -You may not dock while in standard orbit around a planet. - -Starbases have their own deflector shields, so you are completely -safe from phaser attack while docked. You are also safe from -long-range tractor beams. - -Starbases also have both short and long range sensors, which you can -use if yours are broken. There's also a subspace radio to get -information about happenings in the galaxy. Mr. Spock will update the -star chart if your ask for it while docked and your own radio is dead. - - -Rest - - -Mnemonic: REST -Shortest abbreviation: R -Full command: REST <NUMBER OF STARDATES> - - -This command simply allows the specified number of stardates to go -by. This is useful if you have suffered damages and wish to wait -until repairs are made before you go back into battle. - -It is not generally advisable to rest while you are under attack by -Klingons. - - -Call Starbase for Help - - -Mnemonic: CALL -(No abbreviation) - - -[Originally, this command was called HELP, but -these days it might be misinterpreted as built-in -documentation!] - -When you get into serious trouble, you may call starbase for -help. Starbases have a device called a long-range transporter -beam which they can use to teleport you to base. This works -by dematerializing your starship at its current position and -re-materializing it adjacent to the nearest starbase. Teleportation -is instantaneous, and starbase supplies the required energy—all -you have to do is let them know (via subspace radio) that you need to -be rescued. - -This command should be employed only when absolutely necessary. In -the first place, calling for help is an admission on your part that -you got yourself into something you cannot get yourself out of, and -you are heavily penalized for this in the final scoring. Secondly, -the long-range transporter beam is not reliable—starbase can always -manage to dematerialize your starship, but (depending on distance) -may or may not be able to re-materialize you again. The long-range -transporter beam has no absolute maximum range; if you are in the -same quadrant as a starbase, you have a good chance (about 90%) of -re-materializing successfully. your chances drop to roughly 50-50 at -just over 3 quadrants. - - -Abandon Ship - - -Mnemonic: ABANDON -(no abbreviation) - - -You may abandon the Enterprise if necessary. If there is still a -starbase in the galaxy, you will be sent there and put in charge of a -weaker ship, the Faerie Queene. - -The Faerie Queene cannot be abandoned. - - -Self-Destruct - - -Mnemonic: DESTRUCT -(no abbreviation) - - -You may self-destruct, thus killing yourself and ending the game. If -there are nearby Klingons, you may take a few of them with you (the -more energy you have left, the bigger the bang). - -In order to self-destruct you must remember the password you typed in -at the beginning of the game. - - -Quit Game - - -Mnemonic: QUIT -(no abbreviation) - - -Immediately cancel the current game; no conclusion is reached. You -will be given an opportunity to start a new game or to leave the Star -Trek program. - - -Sensor-Scan - - -Mnemonic: SENSORS -Shortest abbreviation: SE - - -Utilizing the short-range sensors, science officer Spock gives you a -readout on any planet in your quadrant. Planets come in three -classes: M, N, and O. Only class M planets have earth-like -conditions. Spock informs you if the planet has any dilithium -crystals. Sensor scans are free. - - -Enter Standard Orbit - - -Mnemonic: ORBIT -Shortest abbreviation: O - - -To land on a planet you must first be in standard orbit. You achieve -this in a manner similar to docking at starbase. Moving to one of -the eight sector positions immediately adjacent to the planet, you -give the orbit command which puts your ship into standard orbit about -the planet. Since this is a maneuver, a small amount of time is -used; negligible energy is required. If enemies are present, they -will attack. - - -Transporter Travel - - -Mnemonic: TRANSPORT -Shortest abbreviation: T - - -The transporter is a device which can convert any physical object -into energy, beam the energy through space, and reconstruct the -physical object at some destination. Transporting is one way to land -on a planet. Since the transporter has a limited range, you must be -in standard orbit to beam down to a planet. Shields must be down -while transporting. - -The transport command is used to beam a landing party onto a planet -to mine dilithium crystals. Each time the command is given the -landing party (which you lead) moves from the ship to the planet, or -vice-versa. - -You are advised against needless transporting, since like all -devices, the transporter will sometimes malfunction. - -The transporter consumes negligible time and energy. Its use does -not constitute a turn. - - -Shuttle Craft - - -Mnemonic: SHUTTLE -Shortest abbreviation: SHU - - -An alternate way to travel to and from planets. Because of limited -range, you must be in standard orbit to use the shuttle craft, named -"Galileo". Shields must be down. - -Unlike transporting, use of the shuttle craft does constitute a -turn since time is consumed. The time naturally -depends on orbit altitude, and is equal to 3.0e-5 times altitude. -Shuttling uses no ship energy. - -You should use the same travel device going from the planet to the -ship as you use to go from the ship to the planet. However it is -possible to transport to the planet and have the Galileo crew come -and pick your landing party up, or to take the Galileo to the planet -and then transport back, leaving the shuttle craft on the planet. - - -Mine Dilithium Crystals - - -Mnemonic: MINE -Shortest abbreviation: MI - - -Once you and your mining party are on the surface of a planet which -has dilithium crystals, this command will dig them for you. - -Mining requires time and constitutes a turn. No -energy is used. Class M planets require 0.1 to 0.3 stardates to mine. -Class N planets take twice as long, and class O planets take three -times as long. - -Dilithium crystals contain enormous energy in a form that is readily -released in the ship's power system. It is an excellent idea to mine -them whenever possible, for use in emergencies. You keep the -crystals until the game is over or you abandon ship when not at a -starbase. - - -Load Dilithium Crystals - - -Mnemonic: CRYSTALS -Shortest abbreviation: CR - - -This is a very powerful command which should be used with caution. -Once you have dilithium crystals aboard ship, this command will -instruct engineering officer Scott and Mr. Spock to place a raw -dilithium crystal into the power channel of the ship's -matter-antimatter converter. When it works, this command will -greatly boost the ship's energy. - -Because the crystals are raw and impure, instabilities can occur in -the power channel. Usually Scotty can control these. When he -cannot, the results are disastrous. Scotty will use those crystals -that appear to be most stable first. - -Since using raw dilithium crystals for this purpose entails -considerable risk, Starfleet Regulations allow its use only during -"condition yellow". No time or energy is used. - - -Planet Report - - -Mnemonic: PLANETS -Shortest abbreviation: PL - - -Mr. Spock presents you a list of the available information on planets -in the galaxy. Since planets do not show up on long-range scans, the -only way to obtain this information is with the SENSORS command. - - -Freeze - - -Mnemonic: FREEZE -(no abbreviation) -Full command: FREEZE <FILE NAME> - - -The purpose of the FREEZE command is to allow a player to save the -current state of the game, so that it can be finished later. A -plaque may not be generated from a frozen game. A file with the -specified <file name> and type '.TRK' is created (if necessary) in -the current directory, and all pertinent information about the game -is written to that file. The game may be continued as usual or be -terminated at the user's option. - -To restart a game created by the FREEZE command, -the user need only type FROZEN in response to the -initial question about the type of game desired, followed by the -<file name>. - -NOTE: A tournament game is like a frozen game, -with the following differences. (1) Tournament games always start -from the beginning, while a frozen game can start at any point. (2) -Tournament games require only that the player remember the name or -number of the tournament, while the information about a frozen game -must be kept on a file. Tournament games can be frozen, but then they -behave like regular frozen games. - -A point worth noting is that 'FREEZE' does not save the seed for the -random number generator, so that identical actions after restarting -the same frozen game can lead to different results. However, -identical actions after starting a given tournament game always lead -to the same results. - - -Request - - -Mnemonic: REQUEST -Shortest abbreviation: REQ -Full command: REQUEST <ITEM> - - -This command allows you to get any single piece of information -from the <STATUS> command. <ITEM> specifies which -information as follows: - - - - - - Information - Mnemonic for <item> - Shortest Abbreviation - - - -STARDATE DATE D -CONDITION CONDITION C -POSITION POSITION P -LIFE SUPPORTLSUPPORT L -WARP FACTOR WARPFACTORW -ENERGY ENERGY E -TORPEDOES TORPEDOES T -SHIELDS SHIELDS S -KLINGONS LEFTKLINGONS K -TIME LEFT TIME TI - - - - - -Experimental Death Ray - - -Mnemonic: DEATHRAY -(No abbreviation) - - -This command should be used only in those desperate cases where -you have absolutely no alternative. The death ray uses energy to -rearrange matter. Unfortunately, its working principles are not yet -thoroughly understood, and the results are highly -unpredictable. - -The only good thing that can result is the destruction of all -enemies in your current quadrant. This will happen about 70% of the -time. Only enemies are destroyed; starbases, stars, and planets are -unaffected. - -Constituting the remaining 30% are results varying from bad to -fatal. - -The death ray requires no energy or time, but if you survive, enemies -will hit you. - -The Faerie Queene has no death ray. - -If the death ray is damaged in its use, it must be totally replaced. -This can only be done at starbase. Because it is a very complex -device, it takes 9.99 stardates at base to replace the death ray. -The death ray cannot be repaired in flight. - - -Launch Deep Space Probe - - -Mnemonic: PROBE -Shortest abbreviation: PR -Full command: PROBE <ARMED> MANUAL <displacement> - PROBE <ARMED> AUTOMATIC <destination> - - -The Enterprise carries a limited number of Long Range Probes. These -fly to the end of the galaxy and report back a count of the number of -important things found in each quadrant through which it went. The -probe flies at warp 10, and therefore uses time during its flight. -Results are reported immediately via subspace radio and are recorded -in the star chart. - -The probe can also be armed with a NOVAMAX warhead. When launched -with the warhead armed, the probe flies the same except as soon as it -reaches the target location, it detonates the warhead in the heart of -a star, causing a supernova and destroying everything in the -quadrant. It then flies no further. There must be a star in the -target quadrant for the NOVAMAX to function. - -The probe can fly around objects in a galaxy, but is destroyed if it -enters a quadrant containing a supernova, or if it leaves the galaxy. - -The target location is specified in the same manner as the MOVE -command, however for automatic movement, if only one pair of -coordinates are specified they are assumed to be the quadrant and not -the sector in the current quadrant! - -The Faerie Queene has no probes. - - -Emergency Exit - - -Mnemonic: EMEXIT -Shortest abbreviation: E - - -This command provides a quick way to exit from the game when you -observe a Klingon battle cruiser approaching your terminal. Its -effect is to freeze the game on the file 'EMSAVE.TRK' in your current -directory, erase the screen, and exit. - -Of course, you do lose the chance to get a plaque when you use this -maneuver. - - -Ask for Help - - -Mnemonic: HELP -Full command: HELP <command> - - -This command reads the appropriate section from the SST.DOC file, -providing the file is in the current directory. - - - -Miscellaneous Notes - -Starbases can be attacked by either commanders or by the -Super-Commander. When this happens, you will be -notified by subspace radio, provided it is working. The message will -inform you how long the base under attack can last. Since the -Super-Commander is more powerful than an ordinary -commander, he can destroy a base more quickly. - -The Super-Commander 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. - -Scattered through the galaxy are certain zones of control, -collectively designated the Romulan Neutral Zone. Any -quadrant which contains Romulans without Klingons is part of the -Neutral Zone, except if a base is present. Since Romulans do not show -on either the long-range scan or the star chart, it is easy for you to -stumble into this zone. When you do, if your subspace radio is -working, you will receive a warning message from the Romulan, politely -asking you to leave. - -In general, Romulans are a galactic nuisance. - -The high-speed shield control is fairly reliable, but it has been -known to malfunction. - -You can observe the galactic movements of the -Super-Commander on the star chart, provided he is in -territory you have scanned and your subspace radio is working. - -Periodically, you will receive intelligence reports from -starfleet command, indicating the current quadrant of the -Super-Commander. Your subspace radio must be working, -of course. - -Each quadrant will contain from 0 to 3 black holes. Torpedoes -entering a black hole disappear. In fact, anything entering a black -hole disappears, permanently. If you can displace an enemy into one, -he is a goner. Black holes do not necessarily remain in a quadrant. -they are transient phenomena. - -Commanders will ram your ship, killing themselves and inflicting -heavy damage to you, if they should happen to decide to advance into -your sector. - -You can get a list of commands by typing -COMMANDS. - - -Scoring - -Scoring is fairly simple. You get points for good things, and you -lose points for bad things. - -You gain— - - -10 points for each ordinary Klingon you kill, -50 points for each commander you kill, -200 points for killing the Super-Commander, -20 points for each Romulan killed, -1 point for each Romulan captured. - -100 times your average Klingon/stardate kill rate. If you lose -the game, your kill rate is based on a minimum of 5 stardates. - - -You get a bonus if you win the game, based on your rating: -Novice=100, Fair=200, Good=300, Expert=400, Emeritus=500. - - - -You lose— - - -200 points if you get yourself killed, -100 points for each starbase you destroy, -100 points for each starship you lose, -45 points for each time you had to call for help, -10 points for each planet you destroyed, -5 points for each star you destroyed, and -1 point for each casualty you incurred. - - -In addition to your score, you may also be promoted one grade in rank -if you play well enough. Promotion is based primarily on your -Klingon/stardate kill rate, since this is the best indicator of -whether you are ready to go on to the next higher rating. However, -if you have lost 100 or more points in penalties, the required kill -rate goes up. Normally, the required kill rate is 0.1 * skill * -(skill + 1.0) + 0.1, where skill ranges from 1 for Novice to 5 for -Emeritus. - -You can be promoted from any level. There is a special -promotion available if you go beyond the Expert range. -You can also have a certificate of merit printed with your name, date, -and Klingon kill rate, provided you are promoted from either the -Expert or Emeritus levels. This -plaque requires a 132 column printer. You may need -print the certificate to a file, import it into your word processor, -selecting Courier 8pt font, and then print in landscape -orientation. - -You should probably start out at the novice level, even if you are -already familiar with one of the other versions of the Star Trek -game—but, of course, the level of game you play is up to you. If -you want to start at the Expert level, go ahead. It's your funeral. -The emeritus game is strictly for masochists. - - -Handy Reference Page - - - ABBREV FULL COMMAND DEVICE USED - ------ ------------ ----------- - ABANDON ABANDON shuttle craft - C CHART (none) - CALL CALL (for help) subspace radio - CO COMPUTER computer - CR CRYSTALS (none) - DA DAMAGES (none) - DEATHRAY DEATHRAY (none) - DESTRUCT DESTRUCT computer - D DOCK (none) - E EMEXIT (none) - FREEZE FREEZE <FILE NAME> (none) - I IMPULSE <MANUAL> <DISPLACEMENT> impulse engines - IMPULSE AUTOMATIC <DESTINATION> impulse engines and computer - L LRSCAN long-range sensors - MI MINE (none) - M MOVE <MANUAL> <DISPLACEMENT> warp engines - MOVE AUTOMATIC <DESTINATION> warp engines and computer - O ORBIT warp or impulse engines - P PHASERS <TOTAL AMOUNT> phasers and computer - PHASERS AUTOMATIC <TOTAL AMOUNT> phasers, computer, sr sensors - PHASERS MANUAL <AMT1> <AMT2> ... phasers - PHO PHOTONS <NUMBER> <TARGETS> torpedo tubes - PL PLANETS (none) - PR PROBE <ARMED> <MANUAL> <DISPLACEMENT> probe launcher, radio - PROBE <ARMED> AUTOMATIC <DESTINATION> launcher, radio, computer - REP REPORT (none) - REQ REQUEST (none) - R REST <NUMBER OF STARDATES> (none) - QUIT QUIT (none) - S SRSCAN <NO or CHART> short-range sensors - SE SENSORS short-range sensors - SH SHIELDS <UP, DOWN, or TRANSFER> deflector shields - SHU SHUTTLE shuttle craft - ST STATUS (none) - T TRANSPORT transporter - W WARP <FACTOR> (none) - - L. R. Scan: thousands digit: supernova - hundreds digit: Klingons - tens digit: starbases - ones digit: stars - period (.): digit not known (star chart only) - -Courses are given in manual mode in X - Y displacements; in automatic - mode as destination quadrant and/or sector. Manual mode is default. -Distances are given in quadrants. A distance of one sector is 0.1 quadrant. -Ordinary Klingons have about 400 units of energy, Commanders about - 1200. Romulans normally have about 800 units of energy, and the - (GULP) "Super-Commander" has about 1800. -Phaser fire diminishes to about 60 percent at 5 sectors. Up to 1500 - units may be fired in a single burst without danger of overheat. -Warp 6 is the fastest safe speed. At higher speeds, engine damage - may occur. At warp 10 you may enter a time warp. -Shields cost 50 units of energy to raise, and double the power - requirements of moving under warp drive. Engaging the high-speed - shield control requires 200 units of energy. -Warp drive requires (distance)*(warp factor cubed) units of energy - to travel at a speed of (warp factor squared)/10 quadrants per stardate. -Impulse engines require 20 units to warm up, plus 100 units per - quadrant. Speed is just under one sector per stardate. - - - -Game History and Modifications - -Tom Almy's story - -Back in (about) 1977 I got a copy of this Super Star Trek game for -the CDC 6600 mainframe computer. Someone had converted it to PDP-11 -Fortran but couldn't get it to run because of its size. I modified -the program to use overlays and managed to shoehorn it in on the 56k -byte machine. - -I liked the game so much I put some time into fixing bugs, mainly -what could be called continuity errors and loopholes in the game's -logic. We even played a couple tournaments. - -In 1979, I lost access to that PDP-11. I did save the source code -listing. In 1995, missing that old friend, I started converting the -program into portable ANSI C. It's been slow, tedious work that took -over a year to accomplish. - -In early 1997, I got the bright idea to look for references to -Super Star Trek on the World Wide Web. There weren't -many hits, but there was one that came up with 1979 Fortran sources! -This version had a few additional features that mine didn't have, -however mine had some feature it didn't have. So I merged its features -that I liked. I also took a peek at the DECUS version (a port, less -sources, to the PDP-10), and some other variations. - -Modifications I made: - -Compared to original version, I've changed the -help command to call and the -terminate command to quit to better -match user expectations. The DECUS version apparently made those -changes as well as changing freeze to -save. However I like freeze. - -I added EMEXIT from the 1979 version. - -That later version also mentions srscan and lrscan working when -docked (using the starbase's scanners), so I made some changes here -to do this (and indicating that fact to the player), and then -realized the base would have a subspace radio as well — doing a -Chart when docked updates the star chart, and all radio reports will -be heard. The Dock command will also give a report if a base is under -attack. - -It also had some added logic to spread the initial positioning of -bases. That made sense to add because most people abort games with -bad base placement. - -The experimental deathray originally had only a 5% chance of success, -but could be used repeatedly. I guess after a couple years of use, it -was less experimental because the 1979 version had a 70% success -rate. However it was prone to breaking after use. I upgraded the -deathray, but kept the original set of failure modes (great humor!). - -I put in the Tholian Web code from the 1979 version. - -I added code so that Romulans and regular Klingons could move in -advanced games. I re-enabled the code which allows enemy ships to -ram the Enterprise; it had never worked right. The 1979 version -seems to have it all fixed up, but I'm still not overly happy with -the algorithm. - -The DECUS version had a Deep Space Probe. Looked like a good idea -so I implemented it based on its description. - - -Stas Sergeev's story - -I started from an older Tom Almy version and added features I had -seen in mainframe variants of the game, I wrote a screen-oriented -interface for it based on the curses library. - - - -The Space Thingy can be shoved, if you ram it, and can fire back if -fired upon. - - -The Tholian can be hit with phasers. - - -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). - - -SCom can't escape from you if no more enemies remain (without this, - chasing SCom can take an eternity). - - -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) - - -Secret password is now autogenerated. - - -Victory plaque is adjusted for A4 paper rather than 132-column greenbar -:-) - - -Phasers now tells you how much energy needed, but only if the computer -is alive. - - -Planets are auto-scanned when you enter the quadrant. - - -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. - - -Ramming a black hole is no longer instant death. There is a -chance you might get timewarped instead. - - -"freeze" command reverts to "save", most people will understand this -better anyway. - - -Screen-oriented interface, with sensor scans always up. - - - - -Eric Raymond's story - -I played the FORTRAN version of this game in the mid-1970s on a -DEC minicomputer. In the late 1980s Dave Matuszek and I became -friends; I was vaguely aware that he had had something to do with the -original Star Trek game. In October 2004, sitting in Dave's living -room, we got to talking about the game and I realized it would make a -great exhibit for the Retrocomputing Museum. - -A few quick web searches later we found Tom Almy's page. We -downloaded his code and Dave verified that that it was a direct -descendent of UT Super Star Trek — even though it had been translated -to C, he was able to recognize names and techniques from the FORTRAN -version. - -Thus, this game is a cousin of Eric Allman's BSD Trek game, which is -also derived from UT Super Star Trek. However, this one has had a lot -more stuff folded into it over the years — deep space probes, -dilithium mining, the Tholian Web, and so forth. - -One signature trait of this group of variants is that the sectors are -10x10 rather than the 8x8 in Mike Mayfield's 1972 original and its -BASIC descendants) Also, you set courses and firing directions with -rectangular rather than polar coordinates. It also preserves the -original numbered quadrants rather than the astronomically-named -quadrants introduced into many BASIC versions. - -This game is now an open-source project; see the project -site. - -After I launched the Berlios project, Stas Sergeev contacted me -me. We worked together to merge in his changes. - -Modifications I've made: - - - -I converted the flat-text SST.DOC file to XML-Docbook so it can be -webbed. (That's what you're reading now.) - - -The command-help code needed a rewrite because the flat-text form of -the documentation is now generated from XML and doesn't have the -easily recognizable section delimiters it used to. I wrote a script -to filter that flat-text form into an sst.doc that's easy to parse for -command descriptions, and changed some logic in sst.c to match. - - -I've cleaned up a lot of grubby FORTRANisms in the code internals -- -used sizeof(), replaced magic numeric constants with #defines, -that sort of thing. - - -I fixed a surprising number of typos in the code and documentation. - - -All the game state now lives in one big structure that can be -written to and read from disk as one blob. The write gives it an -an identifiable magic number and the thaw logic checks for same. - - -I made the internal pager work, nd in the process got rid of a number -of platform dependencies in the code. - - -The HELP/CALL/SOS command is now MAYDAY. SOS and CALL are still accepted. - - - -Here are some good pages on the history of Star Trek games: - - - -http://www.dunnington.u-net.com/public/startrek/ - - -http://www3.sympatico.ca/maury/games/space/star_trek.html - - -http://www.cactus.org/%7Enystrom/startrek.html - - - - -Authors' Acknowledgments - -These are the original acknowledgments by Dave Matuszek and Paul -Reynolds: - -The authors would like to thank Professor Michael Duggan for his -encouragement and administrative assistance with the development of -the Star Trek game, without which it might never have been completed. - -Much credit is due to Patrick McGehearty and Rich Cohen, who assisted -with the original design of the game and contributed greatly to its -conceptual development. - -Thanks are also due to Carl Strange, Hardy Tichenor and Steven Bruell -for their assistance with certain coding problems. - -This game was inspired by and rather loosely based on an earlier -game, programmed in the BASIC language, by Jim Korp and Grady Hicks. -It is the authors' understanding that the BASIC game was in turn -derived from a still earlier version in use at Penn State University. - - -References - - -Star Trek (the original television -series), produced and directed by Gene Rodenberry. - -Star Trek (the animated -television series), produced by Gene Rodenberry and directed by Hal -Sutherland. Also excellent, and not just kiddie fare. If you enjoyed -the original series you should enjoy this one (unless you have some -sort of a hangup about watching cartoons). - -The Making of Star Trek, by -Steven E. Whitfield and Gene Rodenberry. The best and most complete -readily available book about Star Trek. (Ballantine -Books) - -The World of Star Trek, by -David Gerrold. Similiar in scope to the above book. -(Bantam) - -The Star Trek Guide, third revision 4/17/67, by Gene -Roddenberry. The original writer's guide for the television -series, but less comprehensive than (3) above. -(Norway Productions) - -The Trouble With Tribbles, by -David Gerrold. Includes the complete script of this popular show. -(Ballantine Books) - -Star Trek, Star Trek -2, ..., Star Trek 9, by James -Blish. The original shows in short story form. -(Bantam) - -Spock Must Die, by James Blish. -An original novel, but rather similar to the show The Enemy -Within. (Bantam) - -Model kits of the Enterprise and a Klingon -Battle-Cruiser by AMT Corporation are available at most hobby -shops. - - - - - + + + + + +Super Star Trek + + + + David + Matuzsek + + + Paul + Reynolds + + + Tom + Almy + + + Stas + Sergeev + + + Eric + Steven + Raymond + + + + +Permission is hereby granted for the copying, distribution, +modification and use of this program and associated documentation +for recreational purposes, provided that all references to the +authors are retained. However, permission is not and will not be +granted for the sale or promotional use of this program or program +documentation, or for use in any situation in which profit may be +considered an objective, since it is the desire of the authors to +respect the copyrights of the originators of Star Trek. + + + + + + + SSSSS U U PPPPP EEEEE RRRRR + S U U P P E R R + SSSSS U U PPPPP EEEE RRRRR + S U U P E R R + SSSSS UUUUU P EEEEE R R + + + SSSSSSS TTTTTTTT A RRRRRRR + SSSSSSSS TTTTTTTT AAA RRRRRRRR + SS TT AAA RR RR + SSSSSSS TT AA AA RR RR + SSSSSSS TT AA AA RRRRRRRR + SS TT AAAAAAA RRRRRRR + SS TT AAAAAAA RR RR + SSSSSSSS TT AA AA RR RR + SSSSSSS TT AA AA RR RR + + + + TTTTTTTT RRRRRRR EEEEEEEEE KK KK + TTTTTTTT RRRRRRRR EEEEEEEEE KK KK + TT RR RR EE KK KK + TT RR RR EEEEEE KKKKKK + TT RRRRRRRR EEEEEE KKKKK + TT RRRRRRR EE KK KK + TT RR RR EE KK KK + TT RR RR EEEEEEEEE KK KK + TT RR RR EEEEEEEEE KK KK + + + Produced For Your Enjoyment + + By + + David Matuszek + and + Paul Reynolds + + With Modifications By + Don Smith + + Resurrected By + Tom Almy + + Curses Interface By + Stas Sergeev + + SST 2K polishing by + Eric S. Raymond + + + +Introduction +The Organian Peace Treaty has collapsed, and the Federation is at war +with the Klingon Empire. Joining the Klingons against the Federation +are the members of the Romulan Star Empire. As commander of the +Starship U.S.S. Enterprise, your job is to wipe out the Klingon +invasion fleet and make the galaxy safe for democracy. + +Your battleground is the entire galaxy, which for convenience is +divided up into eight rows of eight quadrants each, like a +checkerboard. Rows are numbered from top to bottom, and columns are +numbered left to right, so quadrant 1 - 8 would be in the upper right +hand corner of the galaxy. + +During battle you will be concerned only with those enemies that +occupy the same quadrant as yourself. Quadrants are divided up into +sectors: ten rows of ten sectors each. Sectors are numbered in the +same way as quadrants, so the sector in the upper right corner is +sector 1 - 10. You have a short-range scanner which allows you to +look at the entire quadrant in a single display. + +Enemies recharge during your absence. If you leave a quadrant +containing a weakened enemy, when you return to that quadrant he will +be strong again. Also, each time you enter a quadrant, the positions +of everthing in the quadrant (except your ship) are randomized, to +save you the trouble of trying to remember where everything in the +quadrant is. Notice that this refers only to the positions of things +in the quadrant—the numbers of each kind of thing are not changed +(except for black holes and the Super-commander, which move around +the galaxy). If you kill something, it stays dead. + +The Romulans are not as serious a threat to the Federation as the +Klingons. For one thing, there are not as many of them. For +another, the Romulans are not as treacherous. However, Romulans are +not to be trifled with, especially when you are in violation of the +Romulan Neutral Zone. + +There are two kinds of Klingons: Ordinary Klingons, which are +bad enough, and Klingon Commanders, which are even worse. Commanders +are about three times stronger than ordinary Klingons. Commanders are +more resistant to your weapons. Commanders can move about during +battle while Ordinary Klingons stay put. And finally, Commanders have +a thing called a long-range tractor beam which they can +use, at random intervals, to yank you away from what you are doing +into their quadrant, to do battle with them. There is also a special +commander, called the Super-commander. This character +is so bad he is reserved for the Good, Expert, and Emeritus games. +Fortunately, there is just one Super-commander in a game. In addition +to the undesirable traits of Commanders, he can move from quadrant to +quadrant at will, seeking out and destroying your starbases and any +helpful planets he runs across. He also has a spy planted aboard your +ship, giving him valuable information about your condition. Using +this information, he can do dastardly things like tractor beam your +ship when you are in bad shape. And once you've been tractor beamed +by the Super-commander — + +But the advantages are not all on the side of the enemy. Your ship +is more powerful, and has better weapons. Besides, in the this +galaxy there are from two to five starbases, at which you can stop to +refuel and lick your wounds, safe from phaser attack or tractor +beams. But you had best not dally there too long, since time is not +on your side. The Klingons are not just after you; they are +attacking the entire Federation. There is always a finite time +left, which is how much longer the Federation can hold out if you +just sit on your fat behind and do nothing. As you wipe out +Klingons, you reduce the rate at which the invasion fleet weakens the +Federation, and so the time left until the Federation collapses may +actually increase. Since Klingons are the main threat to the +Federation, the Romulans do not figure into the time left. In +fact, you need not kill all the Romulans to win. If you can get all +the Klingons, the Federation will abide forever, and you have won the +game. + +Space is vast, and it takes precious time to move from one place to +another. In comparison, other things happen so quickly that we +assume the take no time at all. Two ways that time can pass are when +you move, or when you issue a command to sit still and rest for a +period of time. You will sometimes want to do the latter, since the +various devices aboard your starship may be damaged and require time +to repair. Of course, repairs can be made more quickly at a starbase +than than can in flight. + +In addition to Klingons, Romulans, and starbases, the galaxy +contains (surprise) stars. Mostly, stars are a nuisance and just get +in your way. You can trigger a star into going nova by shooting one +of your photon torpedoes at it. When a star novas, it does a lot of +dammage to anything immediately adjacent to it. If another star is +adjacent to a nova, it too will go nova. Stars may also occasionally +go supernova; a supernova in a quadrant destroys everything in the +quadrant andmakes the quadrant permanently uninhabitable. You may +jump over a quadrant containing a supernova when you +move, but you should not stop there. + +Supernovas may happen spontaneously, without provocation. If a +supernova occurs in the same quadrant you are in, your starship has an +emergency automatic override which picks some random +direction and some random warp factor, and tries to throw you clear of +the supernova. If the supernova occurs in some other quadrant, you +just get a warning message from starfleet about it (provided, of +course, that your subspace radio is working). + +Also a few planets are scattered through the galaxy. These can +sometimes be a great help since some of them will have dilithium +crystals, which are capable of replenishing the ship's energy +supply. You can either beam down to the planet surface using the +transporter, or take the shuttle craft Galileo. + +Finally, each quadrant will contain from zero to three black +holes. These can deflect or swallow torpedoes passing near them. They +also swallow enemy ships knocked into them. If your ship enters one +— + +Star Trek is a rich game, full of detail. These instructions are +written at a moderate level—no attempt has been made fully to +describe everything about the game, but there is quite a bit more +here than you need to get started. If you are new to the game, just +get a rough idea of the kinds of commands available, and start +playing. After a game or two you will have learned everthing +important, and the detailed command descriptions which follow will be +a lot more meaningful to you. + +You have weapons: phasers and photon torpedoes. You have a defense: +deflector shields. You can look at things: long-range scaners, +short-range scanners, and a star chart. You can move about, under +warp drive or impulse power. You can also dock at a starbase, rest +while repairs are being made, abandon ship, self destruct, or give up +and start a new game. + +The Klingons are waiting. + + +How To Issue Commands + +When the game is waiting for you to enter a command it will +print out + + + COMMAND> + + +You may then type in your command. All you have to remember for each +command is the mnemonic. For example, if you want to move straight up +one quadrant, you can type in the mnemonic (case insensitive) + + + move + + +and the computer will prompt you with + + + Manual or automatic- + + +Say you type in manual. The computer then responds + + + X and Y displacements- + + +Now you type in 0 1 which specifies an X movement of zero and a Y +movement of one. + +When you have learned the commands, you can avoid being prompted +simply by typing in the information without waiting to be asked for +it. For example, in the above example, you could simply type in + + + move manual 0 1 + + +and it will be done. Or you could type in + + + move manual + + +and when the computer responds with the displacement prompt, you +can type in + + + 0 1 + + +and it will understand. + +You can abbreviate most mnemonics. For move, you can use any +of + + + move mov mo m + + +successfully. For your safety, certain critical commands (such as to +abandon ship) must be written out in full. Also, in a few cases two +or more commands begin with the same letter, and in this case that +letter refers to a particular one of the commands; to get the other, +your abbreviation must be two or more characters long. This sounds +complicated, but you will learn the abbreviations qGuickly enough. + +What this all boils down to is: + + +You can abbreviate practically anything +If you forget, the computer will proompt you +If you remember, you can type it all on one line + + +If you are part way through entering a command and you change your +minde, you can cancel the command by typing -1 as one of the +parameters, with the exception of the manual move command. + +If anything is not clear to you, experiment. The worst you can do is +lose a game or two. + + +List of Commands + +Short-Range Scan + + +Mnemonic: SRSCAN +Shortest abbreviation: S +Full commands: SRSCAN + SRSCAN NO + SRSCAN CHART + + + +If you are using the screen-oriented interface, it should never +be necessary to call this command explicitly; a short-range scan will +always be present on the screen. + +The short-range scan gives you a considerable amount of information +about the quadrant your starship is in. A short-range scan is best +described by an example. + + + 1 2 3 4 5 6 7 8 9 10 + 1 * . . . . R . . . . Stardate 2516.3 + 2 . . . E . . . . . . Condition RED + 3 . . . . . * . B . . Position 5 - 1, 2 - 4 + 4 . . . S . . . . . . Life Support DAMAGED, Reserves=2.30 + 5 . . . . . . . K . . Warp Factor 5.0 + 6 . K . . . . . * . Energy 2176.24 + 7 . . . . . P . . . . Torpedoes 3 + 8 . . . . * . . . . . Shields UP, 42% 1050.0 units + 9 . * . . * . . . C . Klingons Left 12 + 10 . . . . . . . . . . Time Left 3.72 + + +The left part is a picture of the quadrant. The E at sector 2 - +4 represents the Enterprise; the B at sector 3 - 8 is a starbase. +There are ordinary Klingons (K) at sectors 5 - 8 and 6 - 2, and a +Klingon Commander (C) at 9 - 9. The (GULP) +Super-commander (S) is occupies sector 4 - 4, and a +Romulan (R) is at 1 - 6. A planet (P) is at sector 7 - 6. There are +also a large number of stars (*). The periods (.) are just empty +space—they are printed to help you get your bearings. Sector 6 +- 4 contains a black hole ( ). + +The information on the right is assorted status information. You +can get this alone with the STATUS command. The status information +will be absent if you type N after SRSCAN. Otherwise +status information will be presented. + +If you type C after SRSCAN, you will be given a +short-range scan and a Star Chart. + +Short-range scans are free. That is, they use up no energy and no +time. If you are in battle, doing a short-range scan does not give +the enemies another chance to hit you. You can safely do a +short-range scan anytime you like. + +If your short-range sensors are damaged, this command will only show +the contents of adjacent sectors. + +Status Report + + +Mnemonic: STATUS +Shortest abbreviation: ST + + +This command gives you information about the current state of your +starship as follows: + + + +STARDATE + +The current date. A stardate is the same as a day. + + + +CONDITION + +There are four possible conditions: + + + DOCKED + docked at starbase. + + + RED + in battle. + + + YELLOW + low on energy (<1000 units) + + + GREEN + none of the above + + + + + +POSITION + +Quadrant is given first, then sector + + + +LIFE SUPPOR + +If ACTIVE then life support systems are functioning +normally. If on RESERVES the number is how many stardates your +reserve food, air, etc. will last—you must get repairs made or get to +starbase before your reserves run out. + + + +WARP FACTOR + +What your warp factor is currently set to. + + + +ENERGY + +The amount of energy you have left. If it drops to zero, you die. + + + +TORPEDOES + +How many photon torpedoes you have left. + + + +SHIELDS + +Whether your shields are up or down, how strong they are +(what percentage of a hit they can deflect), and shield energy. + + + +KLINGONS LEFT + +How many of the Klingons are still out there. + + + +TIME LEFT + +How long the Federation can hold out against the +present number of Klingons; that is, how long until the end +if you do nothing in the meantime. If you kill Klingons +quickly, this number will go up—if not, it will go down. If +it reaches zero, the federation is conquered and you lose. + + + + +Status information is free—it uses no time or energy, and +if you are in battle, the Klingons are not given another chance to hit +you. + +Status information can also be obtained by doing a short-range scan. +See the SRSCAN command for details. + +Each item of information can be obtained singly by requesting it. +See REQUEST command for details. + + +Long-Range Scan + + +Mnemonic: LRSCAN +Shortest abbreviation: L + + + +If you are using the screen-oriented interface, it should never +be necessary to call this command explicitly; a long-range scan will +always be present on the screen. + +A long-range scan gives you general information about where you are +and what is around you. Here is an example output. + + + Long-range scan for Quadrant 5 - 1 + -1 107 103 + -1 316 5 + -1 105 1000 + + +This scan says that you are in row 5, column 1 of the 8 by 8 galaxy. +The numbers in the scan indicate how many of each kind of thing there +is in your quadrant and all adjacent quadrants. The digits are +interpreted as follows. + + + + + + Thousands digit: + 1000 indicates a supernova (only) + + + Hundreds digit: + number of Klingons present + + + Tens digit: + number of starbases present + + + Ones digit: + number of stars present + + + + + +For example, in your quadrant (5 - 1) the number is 316, which +indicates 3 Klingons, 1 starbase, and 6 stars. The long-range +scanner does not distinguish between ordinary Klingons and Klingon +command ships. If there is a supernova, as in the quadrant below and +to your right (quadrant 6 - 2), there is nothing else in the +quadrant. + +Romulans possess a cloaking device which prevents +their detection by long-range scan. Because of this fact, Starfleet +Command is never sure how many Romulans are out there. +When you kill the last Klingon, the remaining Romulans surrender to +the Federation. + +Planets are also undetectable by long-range scan. The only way to +detect a planet is to find it in your current quadrant with the +short-range sensors. + +Since you are in column 1, there are no quadrants to your left. The +minus ones indicate the negative energy barrier at the edge of the +galaxy, which you are not permitted to cross. + +Long-range scans are free. They use up no energy or time, and can be +done safely regardless of battle conditions. + +Star Chart + + +Mnemonic: CHART +Shortest abbreviation: C + + +As you proceed in the game, you learn more and more about what things +are where in the galaxy. When ever you first do a scan in a quadrant, +telemetry sensors are ejected which will report any changes in the +quadrant(s) back to your ship, providing the sub-space radio is +working. Spock will enter this information in the chart. If the radio +is not working, Spock can only enter new information discovered from +scans, and information in other quadrants may be obsolete. + +The chart looks like an 8 by 8 array of numbers. These numbers are +interpreted exactly as they are on a long-range scan. A period (.) in +place of a digit means you do not know that information yet. For +example, ... means you know nothing about the quadrant, while .1. +menas you know it contains a base, but an unknown number of Klingons +and stars. + +Looking at the star chart is a free operation. It costs neither time +nor energy, and can be done safely whether in or out of battle. + + +Damage Report + + +Mnemonic: DAMAGES +Shortest abbreviation: DA + + +At any time you may ask for a damage report to find out what devices +are damaged and how long it will take to repair them. Naturally, +repairs proceed faster at a starbase. + +If you suffer damages while moving, it is possible that a subsequent +damage report will not show any damage. This happens if the time +spent on the move exceeds the repair time, since in this case the +damaged devices were fixed en route. + +Damage reports are free. They use no energy or time, and can be done +safely even in the midst of battle. + + +Move Under Warp Drive + + +Mnemonic: MOVE +Shortest abbreviation: M +Full command: MOVE MANUAL <displacement> + MOVE AUTOMATIC <destination> + + +This command is the usual way to move from one place to another +within the galaxy. You move under warp drive, according to the +current warp factor (see WARP FACTOR). + +There are two command modes for movement: MANUAL and AUTOMATIC. +The manual mode requires the following format: + + + MOVE MANUAL <deltax> <deltay> + + +<deltax> and <deltay> are the horizontal and vertical +displacements for your starship, in quadrants; a displacement of one +sector is 0.1 quadrants. Specifying <deltax> and <deltay> +causes your ship to move in a straight line to the specified +destination. If <deltay> is omitted, it is assumed zero. For +example, the shortest possible command to move one sector to the right +would be + + + M M .1 + + +The following examples of manual movement refer to the short-range +scan shown earlier. + + + Destination Sector Manual Movement command + 3 - 1 M M -.3 -.1 + 2 - 1 M M -.3 + 1 - 2 M M -.2 .1 + 1 - 4 M M 0 .1 + (leaving quadrant) M M 0 .2 + + +The automatic mode is as follows: + + + MOVE AUTOMATIC <qrow> <qcol> <srow> <scol> + + +<para>where <qrow> and <qcol> are the row and column +numbers of the destination quadrant, and <srow> and <scol> +are the row and column numbers of the destination sector in that +quadrant. This command also moves your ship in a straight line path +to the destination. For moving within a quadrant, <qrow> and +<qcol> may be omitted. For example, to move to sector 2 - 9 in +the current quadrant, the shortest command would be + + + M A 2 9 + + +To move to quadrant 3 - 7, sector 5 - 8, type + + + M A 3 7 5 8 + + +and it will be done. In automatic mode, either two or four numbers +must be supplied. + +Automatic mode utilizes the ship's battle computer. If the +computer is damaged, manual movement must be used. + +If warp engines are damaged less than 10 stardates (undocked) you can +still go warp 4. + +It uses time and energy to move. How much time and how much energy +depends on your current warp factor, the distance you move, and +whether your shields are up. The higher the warp factor, the faster +you move, but higher warp factors require more energy. You may move +with your shields up, but this doubles the energy required. + +You can move within a quadrant without being attacked if you just +entered the quadrant or have been attacked since your last move +command. This enables you to move and hit them before they +retaliate. + + +Warp Factor + + +Mnemonic: WARP +Shortest abbreviation: W +Full command: WARP <number> + + +Your warp factor controls the speed of your starship. The larger the +warp factor, the faster you go and the more energy you use. + +Your minimum warp factor is 1.0 and your maximum warp factor is 10.0 +(which is 100 times as fast and uses 1000 times as much energy). At +speeds above warp 6 there is some danger of causing damage to your +warp engines; this damage is larger at higher warp factors and also +depends on how far you go at that warp factor. + +At exactly warp 10 there is some probability of entering a +so-called time warp and being thrown foward or backward +in time. The farther you go at warp 10, the greater is the +probability of entering the time warp. + + +Impulse Engines + + +Mnemonic: IMPULSE +Shortest abbreviation: I +Full command: IMPULSE MANUAL <displacement> + IMPULSE AUTOMATIC <destination> + + +The impulse engines give you a way to move when your warp engines are +damaged. They move you at a speed of 0.95 sectors per stardate, +which is the equivalent of a warp factor of about 0.975, so they are +much too slow to use except in emergencies. + +Movement commands are indicated just as in the MOVE command. + +The impulse engines require 20 units of energy to engage, plus 10 +units per sector (100 units per quadrant) traveled. It does not cost +extra to move with the shields up. + + +Deflector Shields + + +Mnemonic: SHIELDS +Shortest abbreviation: SH +Full commands: SHIELDS UP + SHIELDS DOWN + SHIELDS TRANSFER <amount of energy to transfer> + + +Your deflector shields are a defensive device to protect you from +Klingon attacks (and nearby novas). As the shields protect you, they +gradually weaken. A shield strength of 75%, for example, means that +the next time a Klingon hits you, your shields will deflect 75% of +the hit, and let 25% get through to hurt you. + +It costs 50 units of energy to raise shields, nothing to lower them. +You may move with your shields up; this costs nothing under impulse +power, but doubles the energy required for warp drive. + +Each time you raise or lower your shields, the Klingons have another +chance to attack. Since shields do not raise and lower +instantaneously, the hits you receive will be intermediate between +what they would be if the shields were completely up or completely +down. + +You may not fire phasers through your shields. However you may use +the high-speed shield control to lower shields, fire phasers, and +raise the shields again before the Klingons can react. Since rapid +lowering and raising of the shields requires more energy than normal +speed operation, it costs you 200 units of energy to activate this +control. It is automatically activated when you fire phasers while +shields are up. You may fire photon torpedoes, but they may be +deflected considerably from their intended course as they pass +through the shields (depending on shield strength). + +You may transfer energy beteen the ship's energy (given as +Energy in the status) and the shields. Thee word +TRANSFER may be abbreviated T. The +ammount of energy to transfer is the number of units of energy you +wish to take from the ship's energy and put into the shields. If you +specify an negative number, energy is drained from the shields to the +ship. Transfering energy constitutes a turn. If you transfer energy +to the shields while you are under attack, they will be at the new +energy level when you are next hit. + +Enemy torpedoes hitting your ship explode on your shields (if they +are up) and have essentially the same effect as phaser hits. + + +Phasers + + +Mnemonic: PHASERS +Shortest abbreviation: P +Full commands: PHASERS AUTOMATIC <AMOUNT TO FIRE> <NO> + PHASERS <AMOUNT TO FIRE> <NO> + PHASERS MANUAL <NO> <AMOUNT 1> <AMOUNT 2>...<AMOUNT N> + + +Phasers are energy weapons. As you fire phasers at Klingons, you +specify an amount to fire which is drawn from your +energy reserves. The amount of total hit required to kill an enemy is +partly random. but also depends on skill level. + +The average hit required to kill an ordinary Klingon varies from 200 +units in the Novice game to 250 units in the Emeritus game. +Commanders normally require from 600 (Novice) to 700 (Emeritus). The +Super-commander requres from 875 (Good) to 1000 (Emeritus). Romulans +require an average of 350 (Novice) to 450 (Emeritus). + +Hits on enemies are cumulative, as long as you don't leave the +quadrant. + +In general, not all that you fire will reach the Klingons. The +farther away they are, the less phaser energy will reach them. If a +Klingon is adjacent to you, he will receive about 90% of the phaser +energy directed at him; a Klingon 5 sectors away will receive about +60% and a Klingon 10 sectors away will receive about 35%. There is +some randomness involved, so these figures are not exact. Phasers +have no effect beyond the boundaries of the quadrant you are in. + +Phasers may overheat (and be damaged) if you fire too large a burst +at once. Firing up to 1500 units is safe. From 1500 on up the +probability of overheat increases with the amount fired. + +If phaser firing is automatic, the computer decides how to +divide up your <amount to fire> among the Klingons present. If +phaser firing is manual, you specify how much energy to fire at each +Klingon present (nearest first), rather than just specifying a total +amount. You can abreviate MANUAL and +AUTOMATIC to one or more letters; if you mention +neither, automatic fire is usually assumed. + +Battle computer information is available by firing phasers manually, +and allowing the computer to prompt you. If you enter zero for the +amount to fire at each enemy, you will get a complete report, without +cost. The battle computer will tell you how much phaser energy to +fire at each enemy for a sure kill. This information appears in +parentheses prior to the prompt for each enemy. Since the amount is +computed from sensor data, if either the computer or the S.R. sensors +are damaged, this information will be unavailable, and phasers must +be fired manually. + +A safety interlock prevents phasers from being fired through +the shields. If this were not so, the shields would contain your fire +and you would fry yourself. However, you may utilize the +high-speed shield control to drop shields, fire +phasers, and raise shields before the enemy can react. Since it takes +more energy to work the shields rapidly with a shot, it costs you 200 +units of energy each time you activate this control. It is +automatically activated when you fire phasers while the shields are +up. By specifying the <no> option, shields are not raised after +firing. + +Phasers have no effect on starbases (which are shielded) or on +stars. + + +Report + + +Mnemonic: REPORT +Shortest abbreviation: REP + + +This command supplies you with information about the state of the +current game. Its purpose is to remind you of things that you have +learned during play, but may have forgotten, and cannot otherwise +retrieve if you are not playing at a hard-copy terminal. + +You are told the following things: + + +The length and skill level of the game you are playing +The original number of Klingons +How many Klingons you have destroyed +Whether the Super-Commander has been destroyed +How many bases have been destroyed +How many bases are left +What bases (if any) are under attack; your subspace radio +must have been working since the attack to get this +information. +How many casualties you have suffered +How many times you have called for help. + + +This same information is automatically given to you when you start to +play a frozen game. + + +Computer + + +Mnemonic: COMPUTER +Shortest abbreviation: CO + + +This command allows using the ship's computer (if functional) to +calculate travel times and energy usage. + + +Photon Torpedoes + + +Mnemonic: PHOTONS +Shortest abbreviation: PHO +Full commands: PHOTONS <NUMBER> <TARG1> <TARG2> <TARG3> + + +Photon torpedoes are projectile weapons—you either hit what you aim +at, or you don't. There are no partial hits. + +One photon torpedo will usually kill one ordinary Klingon, but it +usually takes about two for a Klingon Commander. Photon torpedoes +can also blow up stars and starbases, if you aren't careful. + +You may fire photon torpedoes singly, or in bursts of two or three. +Each torpedo is individually targetable. The computer will prompt +you, asking for the target sector for each torpedo. Alternately, you +may specify each target in the command line. + +Photon torpedoes cannot be aimed precisely—there is always some +randomness involved in the direction they go. Photon torpedoes may +be fired with your shields up, but as they pass through the shields +they are randomly deflected from their intended course even more. + +Photon torpedoes are proximity-fused. The closer they explode to the +enemy, the more damage they do. There is a hit window about one +sector wide. If the torpedo misses the hit window, it does not +explode and the enemy is unaffected. Photon torpedoes are only +effective within the quadrant. They have no effect on things in +adjacent quadrants. + +If more than one torpedo is fired and only one target sector is +specified, all torpedoes are fired at that sector. For example, to +fire two torpedoes at sector 3 - 4, you type + + + PHO 2 3 4 (or) PHO 2 3 4 3 4 + + +To fire torpedoes at, consecutively, sectors 2 - 6, 1 - 10, and 4 - +7, type + + + PHO 3 2 6 1 10 4 7 + + +There is no restriction to fire directly at a sector. For example, +you can enter + + + PHO 1 3 2.5 + + +to aim between two sectors. However, sector numbers must be 1 to 10 +inclusive. + + +Dock at Starbase + + +Mnemonic: DOCK +Shortest abbreviation: D + + +You may dock your starship whenever you are in one of the eight +sector positions immediately adjacent to a starbase. When you dock, +your starship is resupplied with energy, shield energy photon +torpedoes, and life support reserves. Repairs also proceed faster at +starbase, so if some of your devices are damaged, you may wish to stay +at base (by using the REST command) until they are +fixed. If your ship has more than its normal maximum energy (which +can happen if you've loaded crystals) the ship's energy is not +changed. + +You may not dock while in standard orbit around a planet. + +Starbases have their own deflector shields, so you are completely +safe from phaser attack while docked. You are also safe from +long-range tractor beams. + +Starbases also have both short and long range sensors, which you can +use if yours are broken. There's also a subspace radio to get +information about happenings in the galaxy. Mr. Spock will update the +star chart if your ask for it while docked and your own radio is dead. + + +Rest + + +Mnemonic: REST +Shortest abbreviation: R +Full command: REST <NUMBER OF STARDATES> + + +This command simply allows the specified number of stardates to go +by. This is useful if you have suffered damages and wish to wait +until repairs are made before you go back into battle. + +It is not generally advisable to rest while you are under attack by +Klingons. + + +Call Starbase for Help + + +Mnemonic: CALL +(No abbreviation) + + +[Originally, this command was called HELP, but +these days it might be misinterpreted as built-in +documentation!] + +When you get into serious trouble, you may call starbase for +help. Starbases have a device called a long-range transporter +beam which they can use to teleport you to base. This works +by dematerializing your starship at its current position and +re-materializing it adjacent to the nearest starbase. Teleportation +is instantaneous, and starbase supplies the required energy—all +you have to do is let them know (via subspace radio) that you need to +be rescued. + +This command should be employed only when absolutely necessary. In +the first place, calling for help is an admission on your part that +you got yourself into something you cannot get yourself out of, and +you are heavily penalized for this in the final scoring. Secondly, +the long-range transporter beam is not reliable—starbase can always +manage to dematerialize your starship, but (depending on distance) +may or may not be able to re-materialize you again. The long-range +transporter beam has no absolute maximum range; if you are in the +same quadrant as a starbase, you have a good chance (about 90%) of +re-materializing successfully. your chances drop to roughly 50-50 at +just over 3 quadrants. + + +Abandon Ship + + +Mnemonic: ABANDON +(no abbreviation) + + +You may abandon the Enterprise if necessary. If there is still a +starbase in the galaxy, you will be sent there and put in charge of a +weaker ship, the Faerie Queene. + +The Faerie Queene cannot be abandoned. + + +Self-Destruct + + +Mnemonic: DESTRUCT +(no abbreviation) + + +You may self-destruct, thus killing yourself and ending the game. If +there are nearby Klingons, you may take a few of them with you (the +more energy you have left, the bigger the bang). + +In order to self-destruct you must remember the password you typed in +at the beginning of the game. + + +Quit Game + + +Mnemonic: QUIT +(no abbreviation) + + +Immediately cancel the current game; no conclusion is reached. You +will be given an opportunity to start a new game or to leave the Star +Trek program. + + +Sensor-Scan + + +Mnemonic: SENSORS +Shortest abbreviation: SE + + +Utilizing the short-range sensors, science officer Spock gives you a +readout on any planet in your quadrant. Planets come in three +classes: M, N, and O. Only class M planets have earth-like +conditions. Spock informs you if the planet has any dilithium +crystals. Sensor scans are free. + + +Enter Standard Orbit + + +Mnemonic: ORBIT +Shortest abbreviation: O + + +To land on a planet you must first be in standard orbit. You achieve +this in a manner similar to docking at starbase. Moving to one of +the eight sector positions immediately adjacent to the planet, you +give the orbit command which puts your ship into standard orbit about +the planet. Since this is a maneuver, a small amount of time is +used; negligible energy is required. If enemies are present, they +will attack. + + +Transporter Travel + + +Mnemonic: TRANSPORT +Shortest abbreviation: T + + +The transporter is a device which can convert any physical object +into energy, beam the energy through space, and reconstruct the +physical object at some destination. Transporting is one way to land +on a planet. Since the transporter has a limited range, you must be +in standard orbit to beam down to a planet. Shields must be down +while transporting. + +The transport command is used to beam a landing party onto a planet +to mine dilithium crystals. Each time the command is given the +landing party (which you lead) moves from the ship to the planet, or +vice-versa. + +You are advised against needless transporting, since like all +devices, the transporter will sometimes malfunction. + +The transporter consumes negligible time and energy. Its use does +not constitute a turn. + + +Shuttle Craft + + +Mnemonic: SHUTTLE +Shortest abbreviation: SHU + + +An alternate way to travel to and from planets. Because of limited +range, you must be in standard orbit to use the shuttle craft, named +"Galileo". Shields must be down. + +Unlike transporting, use of the shuttle craft does constitute a +turn since time is consumed. The time naturally +depends on orbit altitude, and is equal to 3.0e-5 times altitude. +Shuttling uses no ship energy. + +You should use the same travel device going from the planet to the +ship as you use to go from the ship to the planet. However it is +possible to transport to the planet and have the Galileo crew come +and pick your landing party up, or to take the Galileo to the planet +and then transport back, leaving the shuttle craft on the planet. + + +Mine Dilithium Crystals + + +Mnemonic: MINE +Shortest abbreviation: MI + + +Once you and your mining party are on the surface of a planet which +has dilithium crystals, this command will dig them for you. + +Mining requires time and constitutes a turn. No +energy is used. Class M planets require 0.1 to 0.3 stardates to mine. +Class N planets take twice as long, and class O planets take three +times as long. + +Dilithium crystals contain enormous energy in a form that is readily +released in the ship's power system. It is an excellent idea to mine +them whenever possible, for use in emergencies. You keep the +crystals until the game is over or you abandon ship when not at a +starbase. + + +Load Dilithium Crystals + + +Mnemonic: CRYSTALS +Shortest abbreviation: CR + + +This is a very powerful command which should be used with caution. +Once you have dilithium crystals aboard ship, this command will +instruct engineering officer Scott and Mr. Spock to place a raw +dilithium crystal into the power channel of the ship's +matter-antimatter converter. When it works, this command will +greatly boost the ship's energy. + +Because the crystals are raw and impure, instabilities can occur in +the power channel. Usually Scotty can control these. When he +cannot, the results are disastrous. Scotty will use those crystals +that appear to be most stable first. + +Since using raw dilithium crystals for this purpose entails +considerable risk, Starfleet Regulations allow its use only during +"condition yellow". No time or energy is used. + + +Planet Report + + +Mnemonic: PLANETS +Shortest abbreviation: PL + + +Mr. Spock presents you a list of the available information on planets +in the galaxy. Since planets do not show up on long-range scans, the +only way to obtain this information is with the SENSORS command. + + +Freeze + + +Mnemonic: FREEZE +(no abbreviation) +Full command: FREEZE <FILE NAME> + + +The purpose of the FREEZE command is to allow a player to save the +current state of the game, so that it can be finished later. A +plaque may not be generated from a frozen game. A file with the +specified <file name> and type '.TRK' is created (if necessary) in +the current directory, and all pertinent information about the game +is written to that file. The game may be continued as usual or be +terminated at the user's option. + +To restart a game created by the FREEZE command, +the user need only type FROZEN in response to the +initial question about the type of game desired, followed by the +<file name>. + +NOTE: A tournament game is like a frozen game, +with the following differences. (1) Tournament games always start +from the beginning, while a frozen game can start at any point. (2) +Tournament games require only that the player remember the name or +number of the tournament, while the information about a frozen game +must be kept on a file. Tournament games can be frozen, but then they +behave like regular frozen games. + +A point worth noting is that 'FREEZE' does not save the seed for the +random number generator, so that identical actions after restarting +the same frozen game can lead to different results. However, +identical actions after starting a given tournament game always lead +to the same results. + + +Request + + +Mnemonic: REQUEST +Shortest abbreviation: REQ +Full command: REQUEST <ITEM> + + +This command allows you to get any single piece of information +from the <STATUS> command. <ITEM> specifies which +information as follows: + + + + + + Information + Mnemonic for <item> + Shortest Abbreviation + + + +STARDATE DATE D +CONDITION CONDITION C +POSITION POSITION P +LIFE SUPPORTLSUPPORT L +WARP FACTOR WARPFACTORW +ENERGY ENERGY E +TORPEDOES TORPEDOES T +SHIELDS SHIELDS S +KLINGONS LEFTKLINGONS K +TIME LEFT TIME TI + + + + + +Experimental Death Ray + + +Mnemonic: DEATHRAY +(No abbreviation) + + +This command should be used only in those desperate cases where +you have absolutely no alternative. The death ray uses energy to +rearrange matter. Unfortunately, its working principles are not yet +thoroughly understood, and the results are highly +unpredictable. + +The only good thing that can result is the destruction of all +enemies in your current quadrant. This will happen about 70% of the +time. Only enemies are destroyed; starbases, stars, and planets are +unaffected. + +Constituting the remaining 30% are results varying from bad to +fatal. + +The death ray requires no energy or time, but if you survive, enemies +will hit you. + +The Faerie Queene has no death ray. + +If the death ray is damaged in its use, it must be totally replaced. +This can only be done at starbase. Because it is a very complex +device, it takes 9.99 stardates at base to replace the death ray. +The death ray cannot be repaired in flight. + + +Launch Deep Space Probe + + +Mnemonic: PROBE +Shortest abbreviation: PR +Full command: PROBE <ARMED> MANUAL <displacement> + PROBE <ARMED> AUTOMATIC <destination> + + +The Enterprise carries a limited number of Long Range Probes. These +fly to the end of the galaxy and report back a count of the number of +important things found in each quadrant through which it went. The +probe flies at warp 10, and therefore uses time during its flight. +Results are reported immediately via subspace radio and are recorded +in the star chart. + +The probe can also be armed with a NOVAMAX warhead. When launched +with the warhead armed, the probe flies the same except as soon as it +reaches the target location, it detonates the warhead in the heart of +a star, causing a supernova and destroying everything in the +quadrant. It then flies no further. There must be a star in the +target quadrant for the NOVAMAX to function. + +The probe can fly around objects in a galaxy, but is destroyed if it +enters a quadrant containing a supernova, or if it leaves the galaxy. + +The target location is specified in the same manner as the MOVE +command, however for automatic movement, if only one pair of +coordinates are specified they are assumed to be the quadrant and not +the sector in the current quadrant! + +The Faerie Queene has no probes. + + +Emergency Exit + + +Mnemonic: EMEXIT +Shortest abbreviation: E + + +This command provides a quick way to exit from the game when you +observe a Klingon battle cruiser approaching your terminal. Its +effect is to freeze the game on the file 'EMSAVE.TRK' in your current +directory, erase the screen, and exit. + +Of course, you do lose the chance to get a plaque when you use this +maneuver. + + +Ask for Help + + +Mnemonic: HELP +Full command: HELP <command> + + +This command reads the appropriate section from the SST.DOC file, +providing the file is in the current directory. + + + +Miscellaneous Notes + +Starbases can be attacked by either commanders or by the +Super-Commander. When this happens, you will be +notified by subspace radio, provided it is working. The message will +inform you how long the base under attack can last. Since the +Super-Commander is more powerful than an ordinary +commander, he can destroy a base more quickly. + +The Super-Commander 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. + +Scattered through the galaxy are certain zones of control, +collectively designated the Romulan Neutral Zone. Any +quadrant which contains Romulans without Klingons is part of the +Neutral Zone, except if a base is present. Since Romulans do not show +on either the long-range scan or the star chart, it is easy for you to +stumble into this zone. When you do, if your subspace radio is +working, you will receive a warning message from the Romulan, politely +asking you to leave. + +In general, Romulans are a galactic nuisance. + +The high-speed shield control is fairly reliable, but it has been +known to malfunction. + +You can observe the galactic movements of the +Super-Commander on the star chart, provided he is in +territory you have scanned and your subspace radio is working. + +Periodically, you will receive intelligence reports from +starfleet command, indicating the current quadrant of the +Super-Commander. Your subspace radio must be working, +of course. + +Each quadrant will contain from 0 to 3 black holes. Torpedoes +entering a black hole disappear. In fact, anything entering a black +hole disappears, permanently. If you can displace an enemy into one, +he is a goner. Black holes do not necessarily remain in a quadrant. +they are transient phenomena. + +Commanders will ram your ship, killing themselves and inflicting +heavy damage to you, if they should happen to decide to advance into +your sector. + +You can get a list of commands by typing +COMMANDS. + + +Scoring + +Scoring is fairly simple. You get points for good things, and you +lose points for bad things. + +You gain— + + +10 points for each ordinary Klingon you kill, +50 points for each commander you kill, +200 points for killing the Super-Commander, +20 points for each Romulan killed, +1 point for each Romulan captured. + +100 times your average Klingon/stardate kill rate. If you lose +the game, your kill rate is based on a minimum of 5 stardates. + + +You get a bonus if you win the game, based on your rating: +Novice=100, Fair=200, Good=300, Expert=400, Emeritus=500. + + + +You lose— + + +200 points if you get yourself killed, +100 points for each starbase you destroy, +100 points for each starship you lose, +45 points for each time you had to call for help, +10 points for each planet you destroyed, +5 points for each star you destroyed, and +1 point for each casualty you incurred. + + +In addition to your score, you may also be promoted one grade in rank +if you play well enough. Promotion is based primarily on your +Klingon/stardate kill rate, since this is the best indicator of +whether you are ready to go on to the next higher rating. However, +if you have lost 100 or more points in penalties, the required kill +rate goes up. Normally, the required kill rate is 0.1 * skill * +(skill + 1.0) + 0.1, where skill ranges from 1 for Novice to 5 for +Emeritus. + +You can be promoted from any level. There is a special +promotion available if you go beyond the Expert range. +You can also have a certificate of merit printed with your name, date, +and Klingon kill rate, provided you are promoted from either the +Expert or Emeritus levels. This +plaque requires a 132 column printer. You may need +print the certificate to a file, import it into your word processor, +selecting Courier 8pt font, and then print in landscape +orientation. + +You should probably start out at the novice level, even if you are +already familiar with one of the other versions of the Star Trek +game—but, of course, the level of game you play is up to you. If +you want to start at the Expert level, go ahead. It's your funeral. +The emeritus game is strictly for masochists. + + +Handy Reference Page + + + ABBREV FULL COMMAND DEVICE USED + ------ ------------ ----------- + ABANDON ABANDON shuttle craft + C CHART (none) + CALL CALL (for help) subspace radio + CO COMPUTER computer + CR CRYSTALS (none) + DA DAMAGES (none) + DEATHRAY DEATHRAY (none) + DESTRUCT DESTRUCT computer + D DOCK (none) + E EMEXIT (none) + FREEZE FREEZE <FILE NAME> (none) + I IMPULSE <MANUAL> <DISPLACEMENT> impulse engines + IMPULSE AUTOMATIC <DESTINATION> impulse engines and computer + L LRSCAN long-range sensors + MI MINE (none) + M MOVE <MANUAL> <DISPLACEMENT> warp engines + MOVE AUTOMATIC <DESTINATION> warp engines and computer + O ORBIT warp or impulse engines + P PHASERS <TOTAL AMOUNT> phasers and computer + PHASERS AUTOMATIC <TOTAL AMOUNT> phasers, computer, sr sensors + PHASERS MANUAL <AMT1> <AMT2> ... phasers + PHO PHOTONS <NUMBER> <TARGETS> torpedo tubes + PL PLANETS (none) + PR PROBE <ARMED> <MANUAL> <DISPLACEMENT> probe launcher, radio + PROBE <ARMED> AUTOMATIC <DESTINATION> launcher, radio, computer + REP REPORT (none) + REQ REQUEST (none) + R REST <NUMBER OF STARDATES> (none) + QUIT QUIT (none) + S SRSCAN <NO or CHART> short-range sensors + SE SENSORS short-range sensors + SH SHIELDS <UP, DOWN, or TRANSFER> deflector shields + SHU SHUTTLE shuttle craft + ST STATUS (none) + T TRANSPORT transporter + W WARP <FACTOR> (none) + + L. R. Scan: thousands digit: supernova + hundreds digit: Klingons + tens digit: starbases + ones digit: stars + period (.): digit not known (star chart only) + +Courses are given in manual mode in X - Y displacements; in automatic + mode as destination quadrant and/or sector. Manual mode is default. +Distances are given in quadrants. A distance of one sector is 0.1 quadrant. +Ordinary Klingons have about 400 units of energy, Commanders about + 1200. Romulans normally have about 800 units of energy, and the + (GULP) "Super-Commander" has about 1800. +Phaser fire diminishes to about 60 percent at 5 sectors. Up to 1500 + units may be fired in a single burst without danger of overheat. +Warp 6 is the fastest safe speed. At higher speeds, engine damage + may occur. At warp 10 you may enter a time warp. +Shields cost 50 units of energy to raise, and double the power + requirements of moving under warp drive. Engaging the high-speed + shield control requires 200 units of energy. +Warp drive requires (distance)*(warp factor cubed) units of energy + to travel at a speed of (warp factor squared)/10 quadrants per stardate. +Impulse engines require 20 units to warm up, plus 100 units per + quadrant. Speed is just under one sector per stardate. + + + +Game History and Modifications + +Tom Almy's story + +Back in (about) 1977 I got a copy of this Super Star Trek game for +the CDC 6600 mainframe computer. Someone had converted it to PDP-11 +Fortran but couldn't get it to run because of its size. I modified +the program to use overlays and managed to shoehorn it in on the 56k +byte machine. + +I liked the game so much I put some time into fixing bugs, mainly +what could be called continuity errors and loopholes in the game's +logic. We even played a couple tournaments. + +In 1979, I lost access to that PDP-11. I did save the source code +listing. In 1995, missing that old friend, I started converting the +program into portable ANSI C. It's been slow, tedious work that took +over a year to accomplish. + +In early 1997, I got the bright idea to look for references to +Super Star Trek on the World Wide Web. There weren't +many hits, but there was one that came up with 1979 Fortran sources! +This version had a few additional features that mine didn't have, +however mine had some feature it didn't have. So I merged its features +that I liked. I also took a peek at the DECUS version (a port, less +sources, to the PDP-10), and some other variations. + +Modifications I made: + +Compared to original version, I've changed the +help command to call and the +terminate command to quit to better +match user expectations. The DECUS version apparently made those +changes as well as changing freeze to +save. However I like freeze. + +I added EMEXIT from the 1979 version. + +That later version also mentions srscan and lrscan working when +docked (using the starbase's scanners), so I made some changes here +to do this (and indicating that fact to the player), and then +realized the base would have a subspace radio as well — doing a +Chart when docked updates the star chart, and all radio reports will +be heard. The Dock command will also give a report if a base is under +attack. + +It also had some added logic to spread the initial positioning of +bases. That made sense to add because most people abort games with +bad base placement. + +The experimental deathray originally had only a 5% chance of success, +but could be used repeatedly. I guess after a couple years of use, it +was less experimental because the 1979 version had a 70% success +rate. However it was prone to breaking after use. I upgraded the +deathray, but kept the original set of failure modes (great humor!). + +I put in the Tholian Web code from the 1979 version. + +I added code so that Romulans and regular Klingons could move in +advanced games. I re-enabled the code which allows enemy ships to +ram the Enterprise; it had never worked right. The 1979 version +seems to have it all fixed up, but I'm still not overly happy with +the algorithm. + +The DECUS version had a Deep Space Probe. Looked like a good idea +so I implemented it based on its description. + + +Stas Sergeev's story + +I started from an older Tom Almy version and added features I had +seen in mainframe variants of the game, I wrote a screen-oriented +interface for it based on the curses library. + + + +The Space Thingy can be shoved, if you ram it, and can fire back if +fired upon. + + +The Tholian can be hit with phasers. + + +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). + + +SCom can't escape from you if no more enemies remain (without this, + chasing SCom can take an eternity). + + +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) + + +Secret password is now autogenerated. + + +Victory plaque is adjusted for A4 paper rather than 132-column greenbar +:-) + + +Phasers now tells you how much energy needed, but only if the computer +is alive. + + +Planets are auto-scanned when you enter the quadrant. + + +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. + + +Ramming a black hole is no longer instant death. There is a +chance you might get timewarped instead. + + +"freeze" command reverts to "save", most people will understand this +better anyway. + + +Screen-oriented interface, with sensor scans always up. + + + + +Eric Raymond's story + +I played the FORTRAN version of this game in the mid-1970s on a +DEC minicomputer. In the late 1980s Dave Matuszek and I became +friends; I was vaguely aware that he had had something to do with the +original Star Trek game. In October 2004, sitting in Dave's living +room, we got to talking about the game and I realized it would make a +great exhibit for the Retrocomputing Museum. + +A few quick web searches later we found Tom Almy's page. We +downloaded his code and Dave verified that that it was a direct +descendent of UT Super Star Trek — even though it had been translated +to C, he was able to recognize names and techniques from the FORTRAN +version. + +Thus, this game is a cousin of Eric Allman's BSD Trek game, which is +also derived from UT Super Star Trek. However, this one has had a lot +more stuff folded into it over the years — deep space probes, +dilithium mining, the Tholian Web, and so forth. + +One signature trait of this group of variants is that the sectors are +10x10 rather than the 8x8 in Mike Mayfield's 1972 original and its +BASIC descendants) Also, you set courses and firing directions with +rectangular rather than polar coordinates. It also preserves the +original numbered quadrants rather than the astronomically-named +quadrants introduced into many BASIC versions. + +This game is now an open-source project; see the project +site. + +After I launched the Berlios project, Stas Sergeev contacted me +me. We worked together to merge in his changes. + +Modifications I've made: + + + +I converted the flat-text SST.DOC file to XML-Docbook so it can be +webbed. (That's what you're reading now.) + + +The command-help code needed a rewrite because the flat-text form of +the documentation is now generated from XML and doesn't have the +easily recognizable section delimiters it used to. I wrote a script +to filter that flat-text form into an sst.doc that's easy to parse for +command descriptions, and changed some logic in sst.c to match. + + +I've cleaned up a lot of grubby FORTRANisms in the code internals -- +used sizeof(), replaced magic numeric constants with #defines, +that sort of thing. + + +I fixed a surprising number of typos in the code and documentation. + + +All the game state now lives in one big structure that can be +written to and read from disk as one blob. The write gives it an +an identifiable magic number and the thaw logic checks for same. + + +I made the internal pager work, nd in the process got rid of a number +of platform dependencies in the code. + + +The HELP/CALL/SOS command is now MAYDAY. SOS and CALL are still accepted. + + + +Here are some good pages on the history of Star Trek games: + + + +http://www.dunnington.u-net.com/public/startrek/ + + +http://www3.sympatico.ca/maury/games/space/star_trek.html + + +http://www.cactus.org/%7Enystrom/startrek.html + + + + +Authors' Acknowledgments + +These are the original acknowledgments by Dave Matuszek and Paul +Reynolds: + +The authors would like to thank Professor Michael Duggan for his +encouragement and administrative assistance with the development of +the Star Trek game, without which it might never have been completed. + +Much credit is due to Patrick McGehearty and Rich Cohen, who assisted +with the original design of the game and contributed greatly to its +conceptual development. + +Thanks are also due to Carl Strange, Hardy Tichenor and Steven Bruell +for their assistance with certain coding problems. + +This game was inspired by and rather loosely based on an earlier +game, programmed in the BASIC language, by Jim Korp and Grady Hicks. +It is the authors' understanding that the BASIC game was in turn +derived from a still earlier version in use at Penn State University. + + +References + + +Star Trek (the original television +series), produced and directed by Gene Rodenberry. + +Star Trek (the animated +television series), produced by Gene Rodenberry and directed by Hal +Sutherland. Also excellent, and not just kiddie fare. If you enjoyed +the original series you should enjoy this one (unless you have some +sort of a hangup about watching cartoons). + +The Making of Star Trek, by +Steven E. Whitfield and Gene Rodenberry. The best and most complete +readily available book about Star Trek. (Ballantine +Books) + +The World of Star Trek, by +David Gerrold. Similiar in scope to the above book. +(Bantam) + +The Star Trek Guide, third revision 4/17/67, by Gene +Roddenberry. The original writer's guide for the television +series, but less comprehensive than (3) above. +(Norway Productions) + +The Trouble With Tribbles, by +David Gerrold. Includes the complete script of this popular show. +(Ballantine Books) + +Star Trek, Star Trek +2, ..., Star Trek 9, by James +Blish. The original shows in short story form. +(Bantam) + +Spock Must Die, by James Blish. +An original novel, but rather similar to the show The Enemy +Within. (Bantam) + +Model kits of the Enterprise and a Klingon +Battle-Cruiser by AMT Corporation are available at most hobby +shops. + + + + + -- 2.31.1 From 332c6482c6a33c591de1dbcbd66f45f3a8fff499 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 4 Feb 2005 23:59:11 +0000 Subject: [PATCH 04/16] Get rid of c_printf(). --- io.c | 14 -------------- reports.c | 22 +++++++++++----------- sst.h | 1 - 3 files changed, 11 insertions(+), 26 deletions(-) diff --git a/io.c b/io.c index d59a509..4ad1c77 100644 --- a/io.c +++ b/io.c @@ -290,20 +290,6 @@ void prouts(char *fmt, ...) { #endif /* SERGEEV */ } -void c_printf (char *format, ... ) -{ - char buffer[BUFSIZ]; /* Well, BUFSIZ is from ncurses... */ - va_list argp; - va_start(argp,format); - vsprintf(buffer,format,argp); - va_end(argp); -#ifdef SERGEEV - waddstr(conio_scr,buffer); -#else - proutn(buffer); -#endif /* SERGEEV */ -} - void cgetline(char *line, int max) { if (curses) { #ifndef SERGEEV diff --git a/reports.c b/reports.c index f866a7b..49bc7fe 100644 --- a/reports.c +++ b/reports.c @@ -167,9 +167,9 @@ void chart(int nn) { char *cp; chew(); if (stdamtim != 1e30 && stdamtim != game.state.date && condit == IHDOCKED) { - c_printf("Spock- \"I revised the Star Chart from the starbase's records.\"\n\r"); + proutn("Spock- \"I revised the Star Chart from the starbase's records.\"\n\r"); } - if (nn == 0) c_printf(" STAR CHART FOR THE KNOWN GALAXY\n\r"); + if (nn == 0) proutn(" STAR CHART FOR THE KNOWN GALAXY\n\r"); if (stdamtim != 1e30) { if (condit == IHDOCKED) { /* We are docked, so restore chart from base information */ @@ -186,10 +186,10 @@ void chart(int nn) { prout(" 1 2 3 4 5 6 7 8"); for (i = 1; i <= 8; i++) { - c_printf("%d |", i); + proutn("%d |", i); for (j = 1; j <= 8; j++) { char buf[4]; - c_printf(" "); + proutn(" "); if (game.starch[i][j] < 0) strcpy(buf, ".1."); else if (game.starch[i][j] == 0) @@ -218,10 +218,10 @@ void chart(int nn) { for (cp = buf; cp < buf + sizeof(buf); cp++) if (*cp == '0') *cp = '.'; - c_printf(buf); + proutn(buf); } - c_printf(" |"); - if (i<8) c_printf("\n\r"); + proutn(" |"); + if (i<8) proutn("\n\r"); } prout(""); /* flush output */ } @@ -244,13 +244,13 @@ int srscan(int l) { else prout(" [Using Base's sensors]"); } - else c_printf(" Short-range scan\n\r"); + else proutn(" Short-range scan\n\r"); if (goodScan) game.starch[quadx][quady] = game.damage[DRADIO]>0.0 ? game.state.galaxy[quadx][quady]+1000:1; scan(); if (isit("chart")) nn = TRUE; if (isit("no")) rightside = FALSE; chew(); - c_printf(" 1 2 3 4 5 6 7 8 9 10\n\r"); + proutn(" 1 2 3 4 5 6 7 8 9 10\n\r"); break; case SCAN_REQUEST: while (scan() == IHEOL) @@ -292,7 +292,7 @@ int srscan(int l) { if (game.quad[i][j]!=ship) highvideo(); } if (game.quad[i][j] & 128) highvideo(); - c_printf("%c ",game.quad[i][j] & 127); + proutn("%c ",game.quad[i][j] & 127); textcolor(LIGHTGRAY); } else @@ -360,7 +360,7 @@ int srscan(int l) { break; } } - if (i<10) c_printf("\n\r"); + if (i<10) proutn("\n\r"); if (k!=0) return(goodScan); } prout(""); diff --git a/sst.h b/sst.h index 4c1db0a..14150a1 100644 --- a/sst.h +++ b/sst.h @@ -443,7 +443,6 @@ void cgetline(char *, int); void waitfor(void); void setpassword(void); void commandhook(char *, int); -void c_printf (char *format, ... ); void makechart(void); void enqueue(char *s); -- 2.31.1 From 634c187043cf4af8328069b8c1fe410efab2e4c7 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 5 Feb 2005 06:42:05 +0000 Subject: [PATCH 05/16] Hide a structure. --- io.c | 15 +++++++++------ sst.h | 4 ---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/io.c b/io.c index 4ad1c77..025aa16 100644 --- a/io.c +++ b/io.c @@ -23,12 +23,15 @@ static int curses = TRUE; #endif /* SERGEEV */ #ifdef SERGEEV -wnd wnds[6]={{1,1,80,25}, /* FULLSCREEN_WINDOW */ - {1,1,25,12}, /* LEFTUPPER_WINDOW */ - {26,2,80,12}, /* SRSCAN_WINDOW */ - {65,1,80,10}, /* LRSCAN_WINDOW */ - {1,13,80,23}, /* LOWER_WINDOW */ - {1,24,80,25}, /* BOTTOM_WINDOW */ +typedef struct { + int wndleft,wndtop,wndright,wndbottom; +} wnd; +static wnd wnds[6]={{1,1,80,25}, /* FULLSCREEN_WINDOW */ + {1,1,25,12}, /* LEFTUPPER_WINDOW */ + {26,2,80,12}, /* SRSCAN_WINDOW */ + {65,1,80,10}, /* LRSCAN_WINDOW */ + {1,13,80,23}, /* LOWER_WINDOW */ + {1,24,80,25}, /* BOTTOM_WINDOW */ }; short curwnd; #endif /* SERGEEV */ diff --git a/sst.h b/sst.h index 14150a1..31fd2f4 100644 --- a/sst.h +++ b/sst.h @@ -452,10 +452,6 @@ void enqueue(char *s); #define SCAN_STATUS 3 #define SCAN_NO_LEFTSIDE 4 -typedef struct { - int wndleft,wndtop,wndright,wndbottom; -} wnd; -extern wnd wnds[6]; /* these need to track io.c:wnd */ #define FULLSCREEN_WINDOW 0 #define LEFTUPPER_WINDOW 1 -- 2.31.1 From 14c898877ad4032c54f25ce683ac916a73c660b2 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 5 Feb 2005 17:23:38 +0000 Subject: [PATCH 06/16] Guard against nasty surprises when building with -DESERGEEV off. --- conio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conio.c b/conio.c index 9f51c31..8c33917 100644 --- a/conio.c +++ b/conio.c @@ -305,20 +305,24 @@ void textmode (int mode) int wherex (void) { +#ifdef SERGEEV int y; int x; getyx(conio_scr,y,x); x++; return(x); +#endif /* SERGEEV */ } int wherey (void) { +#ifdef SERGEEV int y; int x; getyx(conio_scr,y,x); y++; return(y); +#endif /* SERGEEV */ } void window (int left,int top,int right,int bottom) -- 2.31.1 From 0a31c313ea8de3a84cfb94d4f431d7502b149598 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 5 Feb 2005 17:43:19 +0000 Subject: [PATCH 07/16] First half of runtime merge. --- conio.c | 89 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/conio.c b/conio.c index 8c33917..32cbb8c 100644 --- a/conio.c +++ b/conio.c @@ -122,20 +122,20 @@ char *cgets (char *str) /* ugly function :-( */ void clreol (void) /* clear to end of line -- can be a no-op in tty mode */ { -#ifdef SERGEEV - wclrtoeol(conio_scr); - wrefresh(conio_scr); -#endif /* SERGEEV */ + if (conio_scr) { + wclrtoeol(conio_scr); + wrefresh(conio_scr); + } } void clrscr (void) /* clear screen -- can be a no-op in tty mode */ { -#ifdef SERGEEV - wclear(conio_scr); - wmove(conio_scr,0,0); - wrefresh(conio_scr); -#endif /* SERGEEV */ + if (conio_scr) { + wclear(conio_scr); + wmove(conio_scr,0,0); + wrefresh(conio_scr); + } } int cprintf (char *format, ... ) @@ -147,12 +147,11 @@ int cprintf (char *format, ... ) vsprintf(buffer,format,argp); va_end(argp); -#ifdef SERGEEV - i=waddstr(conio_scr,buffer); - wrefresh(conio_scr); -#else - i=printf(buffer); -#endif /* SERGEEV */ + if (conio_scr) { + i=waddstr(conio_scr,buffer); + wrefresh(conio_scr); + } else + i=printf(buffer); return(i); } @@ -224,20 +223,20 @@ void gettextinfo(struct text_info *inforec) void gotoxy (int x, int y) /* address cursor -- OK for this to be a no-op in TTY mode */ { -#ifdef SERGEEV - y--; - x--; - wmove(conio_scr,y,x); - wrefresh(conio_scr); -#endif /* SERGEEV */ + if (conio_scr) { + y--; + x--; + wmove(conio_scr,y,x); + wrefresh(conio_scr); + } } void highvideo (void) { -#ifdef SERGEEV - textcolor(15); /* White */ - textbackground(0); /* Black */ -#endif /* SERGEEV */ + if (conio_scr) { + textcolor(15); /* White */ + textbackground(0); /* Black */ + } } void insline (void) @@ -291,11 +290,11 @@ void textbackground (int color) void textcolor (int color) { -#ifdef SERGEEV - fgc=color; - color=(bgc*16)+fgc; - docolor(color); -#endif /* SERGEEV */ + if (conio_scr) { + fgc=color; + color=(bgc*16)+fgc; + docolor(color); + } } void textmode (int mode) @@ -305,24 +304,26 @@ void textmode (int mode) int wherex (void) { -#ifdef SERGEEV - int y; - int x; - getyx(conio_scr,y,x); - x++; - return(x); -#endif /* SERGEEV */ + if (conio_scr) { + int y; + int x; + getyx(conio_scr,y,x); + x++; + return(x); + } + return (0); } int wherey (void) { -#ifdef SERGEEV - int y; - int x; - getyx(conio_scr,y,x); - y++; - return(y); -#endif /* SERGEEV */ + if (conio_scr) { + int y; + int x; + getyx(conio_scr,y,x); + y++; + return(y); + } + return (0); } void window (int left,int top,int right,int bottom) -- 2.31.1 From e4a5aba24b9db10449c830ac1dee3f4040caf533 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 5 Feb 2005 18:10:01 +0000 Subject: [PATCH 08/16] Simplify the starchart code. --- reports.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/reports.c b/reports.c index 49bc7fe..cbbf1ff 100644 --- a/reports.c +++ b/reports.c @@ -188,29 +188,12 @@ void chart(int nn) { for (i = 1; i <= 8; i++) { proutn("%d |", i); for (j = 1; j <= 8; j++) { - char buf[4]; + char buf[4]; proutn(" "); if (game.starch[i][j] < 0) strcpy(buf, ".1."); else if (game.starch[i][j] == 0) strcpy(buf, "..."); - else if (game.starch[i][j] > 999) - if ((i==quadx)&&(j==quady)){ - gotoxy(wherex()-1,wherey()); - if (game.starch[i][i]<2000) - sprintf(buf, "%03d", game.starch[i][j]-1000); - else - strcpy(buf, "***"); - } - else - if (game.starch[i][j]<2000) - sprintf(buf, "%03d", game.starch[i][j]-1000); - else - strcpy(buf, "***"); - else if ((i==quadx)&&(j==quady)){ - gotoxy(wherex()-1,wherey()); - sprintf(buf, "%03d", game.state.galaxy[i][j]); - } else if (game.state.galaxy[i][j]>=1000) strcpy(buf, "***"); else -- 2.31.1 From c5c08c8b43daf955ad447af2b72ade2f8579b0d2 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 5 Feb 2005 18:41:54 +0000 Subject: [PATCH 09/16] Move cursor restoration into io.c. --- battle.c | 11 ++++------- io.c | 4 ++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/battle.c b/battle.c index 5389821..7904338 100644 --- a/battle.c +++ b/battle.c @@ -175,7 +175,6 @@ void ram(int ibumpd, int ienm, int ix, int iy) { void torpedo(double course, double r, int inx, int iny, double *hit, int wait, int i, int n) { int l, iquad=0, ix=0, iy=0, jx=0, jy=0, shoved=0, ll; - int crx,cry; double ac=course + 0.25*r; double angle = (15.0-ac)*0.5235988; @@ -187,10 +186,10 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i if (fabs(deltay) > bigger) bigger = fabs(deltay); deltax /= bigger; deltay /= bigger; - crx=wherex(); - cry=wherey(); - if (game.damage[DSRSENS]==0 || condit==IHDOCKED) setwnd(LEFTUPPER_WINDOW); - else setwnd(LOWER_WINDOW); + if (game.damage[DSRSENS]==0 || condit==IHDOCKED) + setwnd(LEFTUPPER_WINDOW); + else + setwnd(LOWER_WINDOW); /* Loop to move a single torpedo */ for (l=1; l <= 15; l++) { x += deltax; @@ -205,7 +204,6 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i if (iquad==IHDOT) continue; /* hit something */ setwnd(LOWER_WINDOW); - gotoxy(crx,cry); switch(iquad) { case IHE: /* Hit our ship */ case IHF: @@ -402,7 +400,6 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i } if(curwnd!=LOWER_WINDOW) { setwnd(LOWER_WINDOW); - gotoxy(crx,cry); } if (shoved) { game.quad[jx][jy]=iquad; diff --git a/io.c b/io.c index 025aa16..d87d097 100644 --- a/io.c +++ b/io.c @@ -415,6 +415,9 @@ void tracktorpedo(int x, int y, int ix, int iy, int wait, int l, int i, int n, i proutn("%d - %d ", (int)x, (int)y); #else if (game.damage[DSRSENS]==0 || condit==IHDOCKED) { + int crx, cry; + crx = wherex(); + cry = wherey(); drawmaps(2); delay((wait!=1)*400); gotoxy(iy*2+3,ix+2); @@ -437,6 +440,7 @@ void tracktorpedo(int x, int y, int ix, int iy, int wait, int l, int i, int n, i lowvideo(); _setcursortype(_NORMALCURSOR); } + gotoxy(crx, cry); } else { proutn("%d - %d ", (int)x, (int)y); } -- 2.31.1 From 4db9f58f3d225517845712696e3c58a16e4fb19c Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 5 Feb 2005 21:58:43 +0000 Subject: [PATCH 10/16] Add a TODO. --- TODO | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO b/TODO index bca0eba..f896c30 100644 --- a/TODO +++ b/TODO @@ -8,3 +8,4 @@ IMPULSE, PHOTONS, ABANDON, LRSCAN, WARP, SHIELDS, DESTRUCT CHART, REST, DOCK, QUIT, and DAMAGE were in the original non-"super" version. +* Add a field to the report indicating whether we have dilithium. -- 2.31.1 From 89e52d61fcf689e15a8f831dea084a33ceaa8217 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 5 Feb 2005 22:23:50 +0000 Subject: [PATCH 11/16] This completely merges the line-oriented and screen I/O managers, except it doesn't do color. --- TODO | 9 + battle.c | 3 +- io.c | 599 ++++++++++++++++++++++-------------------------------- makefile | 12 +- moving.c | 1 - reports.c | 9 +- setup.c | 1 - sst.c | 8 +- sst.h | 32 ++- 9 files changed, 287 insertions(+), 387 deletions(-) diff --git a/TODO b/TODO index f896c30..ae961f4 100644 --- a/TODO +++ b/TODO @@ -9,3 +9,12 @@ REST, DOCK, QUIT, and DAMAGE were in the original non-"super" version. * Add a field to the report indicating whether we have dilithium. + +* Look: + +Track for torpedo number 1- 6 - 5 7 - 6 8 - 7 ***Commander at Sector 8 - 7 damaged-- displaced by blast to Sector 9 - 8 + +Track for torpedo number 2- 6 - 5 7 - 6 8 - 6 +9 - 7 +***Commander at Sector 9 - 8 destroyed. +COMMAND> diff --git a/battle.c b/battle.c index 7904338..df13148 100644 --- a/battle.c +++ b/battle.c @@ -1,5 +1,4 @@ #include -#include "conio.h" #include "sst.h" void doshield(int i) { @@ -187,7 +186,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i deltax /= bigger; deltay /= bigger; if (game.damage[DSRSENS]==0 || condit==IHDOCKED) - setwnd(LEFTUPPER_WINDOW); + setwnd(SRSCAN_WINDOW); else setwnd(LOWER_WINDOW); /* Loop to move a single torpedo */ diff --git a/io.c b/io.c index d87d097..54b109b 100644 --- a/io.c +++ b/io.c @@ -1,4 +1,3 @@ -#define _GNU_SOURCE #include #include #include @@ -8,323 +7,222 @@ #include #include -#include "conio.h" #include "sst.h" #include "sstlinux.h" -#ifndef SERGEEV static int linecount; /* for paging */ -static int screenheight = 24, screenwidth = 80; -#endif /* SERGEEV */ -#ifndef SERGEEV -static int curses = FALSE; -#else /* SERGEEV */ static int curses = TRUE; -#endif /* SERGEEV */ -#ifdef SERGEEV -typedef struct { - int wndleft,wndtop,wndright,wndbottom; -} wnd; -static wnd wnds[6]={{1,1,80,25}, /* FULLSCREEN_WINDOW */ - {1,1,25,12}, /* LEFTUPPER_WINDOW */ - {26,2,80,12}, /* SRSCAN_WINDOW */ - {65,1,80,10}, /* LRSCAN_WINDOW */ - {1,13,80,23}, /* LOWER_WINDOW */ - {1,24,80,25}, /* BOTTOM_WINDOW */ -}; -short curwnd; -#endif /* SERGEEV */ +WINDOW *curwnd; -#ifndef SERGEEV -static void outro(int sig) { +static void outro(void) /* wrap up, either normally or due to signal */ +{ if (curses) { clear(); + curs_set(1); (void)refresh(); (void)resetterm(); //(void)echo(); (void)endwin(); + putchar('\n'); } } -static void fastexit(int sig) { - outro(sig); - putchar('\n'); - exit(0); -} -#endif /* SERGEEV */ - -void iostart(int usecurses) { -#ifdef SERGEEV - initconio(); - textattr(7); - clrscr(); - setwnd(FULLSCREEN_WINDOW); -#else - (void) signal(SIGINT, fastexit); - (void) signal(SIGINT, fastexit); -#ifdef SIGIOT - (void) signal(SIGIOT,fastexit); /* for assert(3) */ -#endif /* SIGIOT */ - if(signal(SIGQUIT,SIG_IGN) != SIG_IGN) - (void)signal(SIGQUIT,fastexit); - - if ((curses = usecurses)) { - (void)initscr(); +void iostart(int usecurses) +{ + if ((curses = usecurses)) { + if (atexit(outro)){ + fprintf(stderr,"Unable to register outro(), exiting...\n"); + exit(1); + } + (void)initscr(); #ifdef KEY_MIN - keypad(stdscr, TRUE); + keypad(stdscr, TRUE); #endif /* KEY_MIN */ - (void)saveterm(); - (void)nonl(); - (void)cbreak(); - //(void)noecho(); - scrollok(stdscr, TRUE); - getmaxyx(stdscr, screenheight, screenwidth); - } else { - char *LINES = getenv("LINES"); - if (LINES) - screenheight = atoi(LINES); - } -#endif /* SERGEEV */ + (void)saveterm(); + (void)nonl(); + (void)cbreak(); + //(void)noecho(); + FULLSCREEN_WINDOW = stdscr; + SRSCAN_WINDOW = newwin(12, 25, 0, 0); + REPORT_WINDOW = newwin(10, 0, 1, 25); + LRSCAN_WINDOW = newwin(10, 0, 0, 64); + LOWER_WINDOW = newwin(0, 0, 12, 0); + BOTTOM_WINDOW = newwin(1, 0, LINES-1, 0); + scrollok(LOWER_WINDOW, TRUE); + } } -void ioend(void) { -#ifndef SERGEEV - outro(0); -#endif /* SERGEEV */ -} -void waitfor(void) { +void waitfor(void) /* wait for user action -- OK to do nothing if on a TTY */ -#ifdef SERGEEV - getche(); -#endif /* SERGEEV */ +{ + if (curses) + getch(); } -void pause_game(int i) { - char *prompt; -#ifndef SERGEEV - char buf[BUFSIZ]; -#else /* SERGEEV */ - drawmaps(0); - setwnd(BOTTOM_WINDOW); -#endif /* SERGEEV */ - if (i==1) { - if (skill > 2) - prompt = "[ANOUNCEMENT ARRIVING...]"; - else - prompt = "[IMPORTANT ANNOUNCEMENT ARRIVING -- PRESS ENTER TO CONTINUE]"; - } - else { - if (skill > 2) - prompt = "[CONTINUE?]"; - else - prompt = "[PRESS ENTER TO CONTINUE]"; +void pause_game(int i) +{ + char *prompt; + char buf[BUFSIZ]; + if (i==1) { + if (skill > 2) + prompt = "[ANOUNCEMENT ARRIVING...]"; + else + prompt = "[IMPORTANT ANNOUNCEMENT ARRIVING -- PRESS ENTER TO CONTINUE]"; + } + else { + if (skill > 2) + prompt = "[CONTINUE?]"; + else + prompt = "[PRESS ENTER TO CONTINUE]"; - } -#ifndef SERGEEV - if (curses) { - waddch(stdscr, '\n'); - waddstr(stdscr, prompt); - wgetnstr(stdscr, buf, sizeof(buf)); - wclear(stdscr); - wrefresh(stdscr); - } else { + } + if (curses) { + drawmaps(0); + setwnd(BOTTOM_WINDOW); + wclear(BOTTOM_WINDOW); + waddstr(BOTTOM_WINDOW, prompt); + wgetnstr(BOTTOM_WINDOW, buf, sizeof(buf)); + wclear(BOTTOM_WINDOW); + wrefresh(BOTTOM_WINDOW); + setwnd(LOWER_WINDOW); + } else { + putchar('\n'); + proutn(prompt); + fgets(buf, sizeof(buf), stdin); + if (i != 0) { + int j; + for (j = 0; j < 24; j++) putchar('\n'); - proutn(prompt); - fgets(buf, sizeof(buf), stdin); - if (i != 0) { - /* much more in that old-TTY spirit to throw linefeeds */ - int j; - for (j = 0; j < screenheight; j++) - putchar('\n'); - } - linecount = 0; } -#else /* SERGEEV */ - proutn(prompt); - getche(); - clrscr(); - setwnd(LOWER_WINDOW); - clrscr(); -#endif /* SERGEEV */ + linecount = 0; + } } -void skip(int i) { -#ifndef SERGEEV +void skip(int i) +{ while (i-- > 0) { if (curses) { - int y, x; - getyx(stdscr, y, x); - if (y == screenheight-1) - pause_game(0); - else - waddch(stdscr, '\n'); + proutn("\n\r"); } else { linecount++; - if (linecount >= screenheight) + if (linecount >= 24) pause_game(0); else putchar('\n'); } -#else /* SERGEEV */ - while (i-- > 0) proutn("\n\r"); -#endif /* SERGEEV */ + } } -static void vproutn(char *fmt, va_list ap) { -#ifdef SERGEEV - char *s, *p; - vasprintf(&s, fmt, ap); - p=s; - if ((curwnd==LOWER_WINDOW)&&(wherey()==wnds[curwnd].wndbottom-wnds[curwnd].wndtop)){ - if (strchr(s,'\n')) { - p=strchr(s,'\n'); - p[0]=0; - cprintf("%s",s); - p++; - pause_game(0); - } -#endif /* SERGEEV */ +static void vproutn(char *fmt, va_list ap) +{ + if (curses) { + vwprintw(curwnd, fmt, ap); + wrefresh(curwnd); } -#ifdef SERGEEV - if ((curwnd==LOWER_WINDOW)&&(wherey()>wnds[curwnd].wndbottom-wnds[curwnd].wndtop+1)) - cprintf("\r"); -// setwnd(curwnd); - if (strchr(s,'\n') || strchr(s,'\r')) clreol(); - cprintf("%s",p); - free(s); -#endif /* SERGEEV */ + else + vprintf(fmt, ap); } -void proutn(char *fmt, ...) { +void proutn(char *fmt, ...) +{ va_list ap; va_start(ap, fmt); -#ifndef SERGEEV - if (curses) { - vw_printw(stdscr, fmt, ap); - wrefresh(stdscr); - } else - vprintf(fmt, ap); -#else /* SERGEEV */ vproutn(fmt, ap); -#endif /* SERGEEV */ va_end(ap); } -void prout(char *fmt, ...) { +void prout(char *fmt, ...) +{ va_list ap; va_start(ap, fmt); -#ifndef SERGEEV - if (curses) { - vw_printw(stdscr, fmt, ap); - wrefresh(stdscr); - } else - vprintf(fmt, ap); -#else /* SERGEEV */ vproutn(fmt, ap); -#endif /* SERGEEV */ va_end(ap); skip(1); } -void proutc(char *line) { - line[strlen(line)-1] = '\0'; -#ifndef SERGEEV - if (curses) - waddstr(stdscr, line); - else - fputs(line, stdout); -#else /* SERGEEV */ - cputs(line); -#endif /* SERGEEV */ - skip(1); -} - -#ifdef SERGEEV -static void prchr(char *s){ - char str[2]; - strncpy(str,s,1); - str[1]=0; - proutn(str); -} - -static void vprouts(char *fmt, va_list ap) { - char *s, *p; - vasprintf(&s, fmt, ap); - p=s; - while (*p) { - prchr(p++); - delay(30); - } - free(s); -} -#endif /* SERGEEV */ - -void prouts(char *fmt, ...) { -#ifndef SERGEEV - clock_t endTime; - char *s, buf[BUFSIZ]; - /* print slowly! */ - va_list ap; - va_start(ap, fmt); - vsprintf(buf, fmt, ap); - va_end(ap); - skip(1); - for (s = buf; *s; s++) { - endTime = clock() + CLOCKS_PER_SEC*0.05; - while (clock() < endTime) continue; - if (curses) { - waddch(stdscr, *s); - wrefresh(stdscr); - } - else { - putchar(*s); - fflush(stdout); - } - } -#else /* SERGEEV */ +void prouts(char *fmt, ...) +/* print slowly! */ +{ + clock_t endTime; + char *s, buf[BUFSIZ]; va_list ap; va_start(ap, fmt); - vprouts(fmt, ap); + vsprintf(buf, fmt, ap); va_end(ap); -#endif /* SERGEEV */ + skip(1); + for (s = buf; *s; s++) { + endTime = clock() + CLOCKS_PER_SEC*0.05; + while (clock() < endTime) continue; + if (curses) { + waddch(curwnd, *s); + wrefresh(curwnd); + } + else { + putchar(*s); + fflush(stdout); + } + } } -void cgetline(char *line, int max) { +void cgetline(char *line, int max) +{ if (curses) { -#ifndef SERGEEV - wgetnstr(stdscr, line, max); - wrefresh(stdscr); -#else /* SERGEEV */ - line[0]=max-1; - cgets(line); - memmove(line,&line[2],max-3); -#endif /* SERGEEV */ + wgetnstr(curwnd, line, max); + strcat(line, "\n"); + wrefresh(curwnd); } else { fgets(line, max, stdin); - line[strlen(line)-1] = '\0'; } + line[strlen(line)-1] = '\0'; } -void setwnd(short wndnum){ +void setwnd(WINDOW *wnd) /* change windows -- OK for this to be a no-op in tty mode */ -#ifdef SERGEEV - int cury; - cury=wherey()+wnds[curwnd].wndtop-wnds[wndnum].wndtop; - if ((curwnd==FULLSCREEN_WINDOW)&&(wndnum!=FULLSCREEN_WINDOW)) 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 */ +{ + if (curses) { + curwnd=wnd; + curs_set(wnd == FULLSCREEN_WINDOW || wnd == LOWER_WINDOW); + } +} + +void clreol (void) +/* clear to end of line -- can be a no-op in tty mode */ +{ + if (curses) { + wclrtoeol(curwnd); + wrefresh(curwnd); + } } +void clrscr (void) +/* clear screen -- can be a no-op in tty mode */ +{ + if (curses) { + wclear(curwnd); + wmove(curwnd,0,0); + wrefresh(curwnd); + } +} + +void textcolor (int color) +{ + if (curses) { + wattroff(curwnd, A_REVERSE); + // FIXME + } +} + +void highvideo (void) +{ + if (curses) { + attron(A_REVERSE); + } +} + void commandhook(char *cmd, int before) { } @@ -332,144 +230,131 @@ void commandhook(char *cmd, int before) { * Things past this point have policy implications. */ -void drawmaps(short l) { +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(LEFTUPPER_WINDOW); - gotoxy(1,1); - enqueue("no"); - srscan(SCAN_FULL); - if (l!=2){ - setwnd(SRSCAN_WINDOW); - clrscr(); - srscan(SCAN_NO_LEFTSIDE); - setwnd(LRSCAN_WINDOW); - clrscr(); - enqueue("l"); - lrscan(); - _setcursortype(_NORMALCURSOR); - } -#endif /* SERGEEV */ +{ + if (curses) { + if (l == 1) + sensor(); + if (l != 2) { + setwnd(SRSCAN_WINDOW); + wmove(curwnd, 0, 0); + enqueue("no"); + srscan(SCAN_FULL); + setwnd(REPORT_WINDOW); + wclear(REPORT_WINDOW); + wmove(REPORT_WINDOW, 0, 0); + srscan(SCAN_NO_LEFTSIDE); + setwnd(LRSCAN_WINDOW); + wclear(LRSCAN_WINDOW); + wmove(LRSCAN_WINDOW, 0, 0); + enqueue("l"); + lrscan(); + } + } } void boom(int ii, int jj) /* enemy fall down, go boom */ { -#ifdef SERGEEV - int crx, cry; - crx=wherex(); - cry=wherey(); - setwnd(LEFTUPPER_WINDOW); - drawmaps(2); - gotoxy(jj*2+3,ii+2); - highvideo(); - proutn("%c", game.quad[ii][jj]); - gotoxy(wherex()-1,wherey()); - sound(500); - delay(1000); - nosound(); - lowvideo(); - proutn("%c", game.quad[ii][jj]); - setwnd(LOWER_WINDOW); - gotoxy(crx,cry); - _setcursortype(_NORMALCURSOR); - delay(500); -#endif /* SERGEEV */ + if (curses) { + setwnd(SRSCAN_WINDOW); + drawmaps(2); + wmove(SRSCAN_WINDOW, ii*2+3, jj+2); + wattron(SRSCAN_WINDOW, A_REVERSE); + waddch(SRSCAN_WINDOW, game.quad[ii][jj]); + wrefresh(SRSCAN_WINDOW); + sound(500); + delay(1000); + nosound(); + wmove(SRSCAN_WINDOW, ii*2+3, jj+2); + wattroff(SRSCAN_WINDOW, A_REVERSE); + waddch(SRSCAN_WINDOW, game.quad[ii][jj]); + wrefresh(SRSCAN_WINDOW); + setwnd(LOWER_WINDOW); + delay(500); + } } void warble(void) /* sound and visual effects for teleportation */ { -#ifdef SERGEEV - int posx, posy; - posx=wherex(); - posy=wherey(); - drawmaps(1); - setwnd(LOWER_WINDOW); - gotoxy(posx,posy); - sound(50); - delay(1000); - nosound(); -#else - prouts(" . . . . . "); -#endif /* SERGEEV */ + if (curses) { + drawmaps(1); + setwnd(LOWER_WINDOW); + sound(50); + delay(1000); + nosound(); + } else + prouts(" . . . . . "); } void tracktorpedo(int x, int y, int ix, int iy, int wait, int l, int i, int n, int iquad) /* torpedo-track animation */ { -#ifndef SERGEEV - if (l == 1) { - if (n != 1) { + if (!curses) { + if (l == 1) { + if (n != 1) { + skip(1); + proutn("Track for torpedo number %d- ", i); + } + else { + skip(1); + proutn("Torpedo track- "); + } + } else if (l==4 || l==9) skip(1); - proutn("Track for torpedo number %d- ", i); - } - else { - skip(1); - proutn("Torpedo track- "); - } - } else if (l==4 || l==9) - skip(1); - proutn("%d - %d ", (int)x, (int)y); -#else - if (game.damage[DSRSENS]==0 || condit==IHDOCKED) { - int crx, cry; - crx = wherex(); - cry = wherey(); - drawmaps(2); - delay((wait!=1)*400); - gotoxy(iy*2+3,ix+2); - if ((game.quad[ix][iy]==IHDOT)||(game.quad[ix][iy]==IHBLANK)){ - game.quad[ix][iy]='+'; - drawmaps(2); - game.quad[ix][iy]=iquad; - sound(l*10); - delay(100); - nosound(); - } - else { - game.quad[ix][iy]|=128; + proutn("%d - %d ", (int)x, (int)y); + } else { + if (game.damage[DSRSENS]==0 || condit==IHDOCKED) { drawmaps(2); - game.quad[ix][iy]=iquad; - _setcursortype(_NOCURSOR); - sound(500); - delay(1000); - nosound(); - lowvideo(); - _setcursortype(_NORMALCURSOR); + delay((wait!=1)*400); + if ((game.quad[ix][iy]==IHDOT)||(game.quad[ix][iy]==IHBLANK)){ + game.quad[ix][iy]='+'; + drawmaps(2); + game.quad[ix][iy]=iquad; + sound(l*10); + delay(100); + nosound(); + } + else { + game.quad[ix][iy] |= DAMAGED; + drawmaps(2); + game.quad[ix][iy]=iquad; + sound(500); + delay(1000); + nosound(); + wattroff(curwnd, A_REVERSE); + } + } else { + proutn("%d - %d ", (int)x, (int)y); } - gotoxy(crx, cry); - } else { - proutn("%d - %d ", (int)x, (int)y); } -#endif /* SERGEEV */ } -void makechart(void) { -#ifdef SERGEEV - _setcursortype(_NOCURSOR); - setwnd(LOWER_WINDOW); - clrscr(); - chart(0); - _setcursortype(_NORMALCURSOR); -#endif /* SERGEEV */ +void makechart(void) +{ + if (curses) { + setwnd(LOWER_WINDOW); + wclear(LOWER_WINDOW); + chart(0); + } } -void setpassword(void) { -#ifndef SERGEEV +void setpassword(void) +{ + if (!curses) { while (TRUE) { - scan(); - strcpy(game.passwd, citem); - chew(); - if (*game.passwd != 0) break; - proutn("Please type in a secret password-"); + scan(); + strcpy(game.passwd, citem); + chew(); + if (*game.passwd != 0) break; + proutn("Please type in a secret password-"); } -#else + } else { int i; for(i=0;i<3;i++) game.passwd[i]=(char)(97+(int)(Rand()*25)); game.passwd[3]=0; -#endif /* SERGEEV */ + } } diff --git a/makefile b/makefile index 78afa1c..4aa098e 100644 --- a/makefile +++ b/makefile @@ -7,7 +7,7 @@ CFLAGS= -O1 -g -Wall -DSSTDOC='"/usr/share/doc/sst/sst.doc"' .c.o: $(CC) $(CFLAGS) -c $< -CFILES= sst.c finish.c reports.c setup.c moving.c battle.c events.c ai.c planets.c io.c sstlinux.c conio.c +CFILES= sst.c finish.c reports.c setup.c moving.c battle.c events.c ai.c planets.c io.c sstlinux.c OFILES= $(CFILES:.c=.o) HFILES=sst.h DOCS = README sst-doc.xml sst.xml sst-layer.xsl TODO @@ -18,16 +18,16 @@ SOURCES= $(CFILES) $(HFILES) $(DOCS) sst.doc sst.6 makehelp.py makefile sst.spec all: sst sst.doc ai.o: ai.c sst.h -battle.o: battle.c conio.h sst.h +battle.o: battle.c sst.h conio.o: conio.c conio.h events.o: events.c sst.h finish.o: finish.c sst.h -io.o: io.c conio.h sst.h -moving.o: moving.c sstlinux.h conio.h sst.h +io.o: io.c sst.h +moving.o: moving.c sstlinux.h sst.h planets.o: planets.c sst.h reports.o: reports.c sst.h conio.h -setup.o: setup.c conio.h sst.h -sst.o: sst.c conio.h sstlinux.h sst.h +setup.o: setup.c sst.h +sst.o: sst.c sstlinux.h sst.h sstlinux.o: sstlinux.c sstlinux.h sst: $(OFILES) diff --git a/moving.c b/moving.c index 17f3a22..1797e1e 100644 --- a/moving.c +++ b/moving.c @@ -1,6 +1,5 @@ #include #include "sstlinux.h" -#include "conio.h" #include "sst.h" static void getcd(int, int); diff --git a/reports.c b/reports.c index cbbf1ff..54c73d9 100644 --- a/reports.c +++ b/reports.c @@ -2,7 +2,6 @@ #include #include #include -#include "conio.h" void attakreport(int l) { if (!l) { @@ -272,10 +271,12 @@ int srscan(int l) { case IHDOCKED: textcolor(LIGHTGRAY); break; case IHDEAD: textcolor(WHITE); } - if (game.quad[i][j]!=ship) highvideo(); + if (game.quad[i][j] != ship) + highvideo(); } - if (game.quad[i][j] & 128) highvideo(); - proutn("%c ",game.quad[i][j] & 127); + if (game.quad[i][j] & DAMAGED) + highvideo(); + proutn("%c ",game.quad[i][j] & ~DAMAGED); textcolor(LIGHTGRAY); } else diff --git a/setup.c b/setup.c index 4df8709..51089b6 100644 --- a/setup.c +++ b/setup.c @@ -1,6 +1,5 @@ #include #include -#include "conio.h" #include "sst.h" #ifdef __linux__ diff --git a/sst.c b/sst.c index 9e48a03..dc26b35 100644 --- a/sst.c +++ b/sst.c @@ -2,7 +2,6 @@ #include #include #include -#include "conio.h" #include "sstlinux.h" #include "sst.h" @@ -260,7 +259,7 @@ static void helpme(void) { while (fgets(linebuf, sizeof(linebuf),fp)) { if (strstr(linebuf, "******")) break; - proutc(linebuf); + proutn(linebuf); } fclose(fp); } @@ -493,6 +492,8 @@ int main(int argc, char **argv) { strcat(line, " "); } while (TRUE) { /* Play a game */ + setwnd(FULLSCREEN_WINDOW); + clrscr(); prelim(); setup(line[0] == '\0'); if (alldone) { @@ -513,11 +514,8 @@ int main(int argc, char **argv) { } proutn("Do you want to play again? "); if (!ja()) break; - setwnd(FULLSCREEN_WINDOW); - clrscr(); } skip(1); - ioend(); prout("May the Great Bird of the Galaxy roost upon your home planet."); return 0; } diff --git a/sst.h b/sst.h index 31fd2f4..cf44c73 100644 --- a/sst.h +++ b/sst.h @@ -2,6 +2,7 @@ #include #include #include +#include #ifndef INCLUDED #define EXTERN extern #else @@ -61,7 +62,7 @@ typedef struct { #define SSTMAGIC "SST2.0\n" -EXTERN short curwnd; +EXTERN WINDOW *curwnd; EXTERN struct { char magic[sizeof(SSTMAGIC)]; @@ -418,7 +419,6 @@ void snova(int, int); void scom(int *); void hittem(double *); void prouts(char *, ...); -void proutc(char *); int isit(char *); void preport(void); void orbit(void); @@ -434,8 +434,7 @@ void attakreport(int); void movetho(void); void probe(void); void iostart(int); -void ioend(void); -void setwnd(short); +void setwnd(WINDOW *); void warble(void); void boom(int ii, int jj); void tracktorpedo(int x, int y, int ix, int iy, int wait, int l, int i, int n, int iquad); @@ -452,10 +451,21 @@ void enqueue(char *s); #define SCAN_STATUS 3 #define SCAN_NO_LEFTSIDE 4 -/* these need to track io.c:wnd */ -#define FULLSCREEN_WINDOW 0 -#define LEFTUPPER_WINDOW 1 -#define SRSCAN_WINDOW 2 -#define LRSCAN_WINDOW 3 -#define LOWER_WINDOW 4 -#define BOTTOM_WINDOW 5 +WINDOW *FULLSCREEN_WINDOW; +WINDOW *SRSCAN_WINDOW; +WINDOW *REPORT_WINDOW; +WINDOW *LRSCAN_WINDOW; +WINDOW *LOWER_WINDOW; +WINDOW *BOTTOM_WINDOW; + +extern void clreol(void); +extern void clrscr(void); +extern void textcolor(int color); +extern void highvideo(void); + +enum COLORS { + BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY, + DARKGRAY, LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA, YELLOW, WHITE +}; + +#define DAMAGED 128 /* marker for damaged ship in starmap */ -- 2.31.1 From 292e2af0061f1a0e6c466f5ea067ffaed19c48f1 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 5 Feb 2005 22:37:56 +0000 Subject: [PATCH 12/16] No longer needed. --- conio.c | 350 -------------------------------------------------------- 1 file changed, 350 deletions(-) delete mode 100644 conio.c diff --git a/conio.c b/conio.c deleted file mode 100644 index 32cbb8c..0000000 --- a/conio.c +++ /dev/null @@ -1,350 +0,0 @@ -/**************************************************************************** - * This is the implementation file for conio.h - a conio.h for Linux. * - * It uses ncurses and some internal functions of Linux to simulate the * - * I/O-functions. * - * This is copyright (c) 1996,97 by Fractor / Mental eXPlosion (MXP) * - * Use and distribution is only allowed if you follow the terms of the * - * GNU Library Public License Version 2. * - * Since this work is based on ncurses please read its copyright notices as * - * well ! * - * Look into the readme to this file for further information. * - * Thanx to SubZero / MXP for his little tutorial on the curses library ! * - * Many thanks to Mark Hahn and Rich Cochran for solving the inpw and inpd * - * mega-bug !!! * - * Watch out for other MXP releases, too ! * - * Send bugreports to: fractor@germanymail.com * - ****************************************************************************/ - -#define _ISOC99_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include "conio.h" - -static attr_t txtattr,oldattr; -static int fgc,bgc; -char color_warning=1; -int directvideo; -WINDOW *conio_scr; - -/* Some internals... */ -static int colortab(int a) /* convert LINUX Color code to DOS-standard */ -{ - switch(a) { - case 0 : return COLOR_BLACK; - case 1 : return COLOR_BLUE; - case 2 : return COLOR_GREEN; - case 3 : return COLOR_CYAN; - case 4 : return COLOR_RED; - case 5 : return COLOR_MAGENTA; - case 6 : return COLOR_YELLOW; - case 7 : return COLOR_WHITE; - } - return COLOR_BLACK; -} - -static void docolor (int color) /* Set DOS-like text mode colors */ -{ - wattrset(conio_scr,0); /* My curses-version needs this ... */ - if ((color&128)==128) txtattr=A_BLINK; else txtattr=A_NORMAL; - if ((color&15)>7) txtattr|=A_STANDOUT; else txtattr|=A_NORMAL; - txtattr|=COLOR_PAIR((1+(color&7)+(color&112)) >> 1); - if (((color&127)==15) | ((color&127)==7)) txtattr=COLOR_PAIR(0); - if (((color&127)==127) | ((color&127)==119)) txtattr=COLOR_PAIR(8); - wattron(conio_scr,txtattr); - wattron(conio_scr,COLOR_PAIR(1+(color&7)+((color&112)>>1))); -} - -/* Call this before any call to linux conio - except the port functions ! */ -void initconio (void) -{ - int x,y; - short pair; - if (atexit(doneconio)){ - fprintf(stderr,"Unable to register doneconio(), exiting...\n"); - exit(1); - } - initscr(); - start_color(); -// attr_get(&oldattr,&pair,NULL); - nonl(); - raw(); - if (!has_colors() & (color_warning>-1)) - fprintf(stderr,"Attention: A color terminal may be required to run this application !\n"); - noecho(); - conio_scr=newwin(0,0,0,0); - keypad(conio_scr,TRUE); - meta(conio_scr,TRUE); - idlok(conio_scr,TRUE); - scrollok(conio_scr,TRUE); - /* Color initialization */ - for (y=0;y<=7;y++) - for (x=0;x<=7;x++) - init_pair((8*y)+x+1, colortab(x), colortab(y)); - wattr_get(conio_scr,&txtattr,&pair,NULL); - bgc=0; - textcolor(7); - textbackground(0); -} - -/* Call this on exiting your program */ -void doneconio (void) -{ - endwin(); -} - -/* Here it starts... */ -void _setcursortype (int cur_t) -{ - curs_set(cur_t); - wrefresh(conio_scr); -} - -char *cgets (char *str) /* ugly function :-( */ -{ - char strng[257]; - unsigned char i=2; - echo(); - strncpy(strng,str,1); - wgetnstr(conio_scr,&strng[2],(int) strng[0]); - while (strng[i]!=0) i++; - i=i-2; - strng[1]=i; - memcpy(str,strng,i+3); - noecho(); - return(&str[2]); -} - -void clreol (void) -/* clear to end of line -- can be a no-op in tty mode */ -{ - if (conio_scr) { - wclrtoeol(conio_scr); - wrefresh(conio_scr); - } -} - -void clrscr (void) -/* clear screen -- can be a no-op in tty mode */ -{ - if (conio_scr) { - wclear(conio_scr); - wmove(conio_scr,0,0); - wrefresh(conio_scr); - } -} - -int cprintf (char *format, ... ) -{ - int i; - char buffer[BUFSIZ]; /* Well, BUFSIZ is from ncurses... */ - va_list argp; - va_start(argp,format); - vsprintf(buffer,format,argp); - va_end(argp); - - if (conio_scr) { - i=waddstr(conio_scr,buffer); - wrefresh(conio_scr); - } else - i=printf(buffer); - return(i); -} - -void cputs (char *str) -{ - waddstr(conio_scr,str); - wrefresh(conio_scr); -} - -int cscanf (const char *format, ...) -{ - int i; - char buffer[BUFSIZ]; /* See cprintf */ - va_list argp; - echo(); - if (wgetstr(conio_scr,buffer)==ERR) return(-1); - va_start(argp,format); - i=vsscanf(buffer,format,argp); - va_end(argp); - noecho(); - return(i); -} - -void delline (void) -{ - wdeleteln(conio_scr); - wrefresh(conio_scr); -} - -int getche (void) -{ - int i; - echo(); - i=wgetch(conio_scr); - if (i==-1) i=0; - noecho(); - return(i); -} - -void gettextinfo(struct text_info *inforec) -{ - short pair; - unsigned char xp,yp; - unsigned char x1,x2,y1,y2; - attr_t dattr,dnattr,a; /* The "d" stands for DOS */ - getyx(conio_scr,yp,xp); - getbegyx(conio_scr,y1,x1); - getmaxyx(conio_scr,y2,x2); - dattr=(bgc*16)+fgc; - wattr_get(conio_scr,&a,&pair,NULL); - if (a==(a & A_BLINK)) dattr=dattr+128; - dnattr=oldattr; /* Well, this cannot be right, - because we don't know the COLORPAIR values from before initconio() !*/ - inforec->winleft=x1+1; - inforec->wintop=y1+1; - if (x1==0) x2--; - if (y1==0) y2--; - inforec->winright=x1+x2+1; - inforec->winbottom=y1+y2+1; - inforec->curx=xp+1; - inforec->cury=yp+1; - inforec->screenheight=y2+1; - inforec->screenwidth=x2+1; - inforec->currmode=3; /* This is C80 */ - inforec->normattr=dnattr; /* Don't use this ! */ - inforec->attribute=dattr; -} - -void gotoxy (int x, int y) -/* address cursor -- OK for this to be a no-op in TTY mode */ -{ - if (conio_scr) { - y--; - x--; - wmove(conio_scr,y,x); - wrefresh(conio_scr); - } -} - -void highvideo (void) -{ - if (conio_scr) { - textcolor(15); /* White */ - textbackground(0); /* Black */ - } -} - -void insline (void) -{ - winsertln(conio_scr); - wrefresh(conio_scr); -} - -int kbhit (void) -{ - int i; - nodelay(conio_scr,TRUE); - i=wgetch(conio_scr); - nodelay(conio_scr,FALSE); - if (i==-1) i=0; - return(i); -} - -void lowvideo (void) -{ - textbackground(0); /* Black */ - textcolor(8); /* Should be darkgray */ -} - -void normvideo (void) -{ - wattrset(conio_scr,oldattr); -} - -int putch (int c) -{ - if (waddch(conio_scr,c)!=ERR) { - wrefresh(conio_scr); - return(c); - } - return(0); -} - -void textattr (int attr) -{ - docolor(attr); -} - -void textbackground (int color) -{ - bgc=color; - color=(bgc*16)+fgc; - docolor(color); -} - - -void textcolor (int color) -{ - if (conio_scr) { - fgc=color; - color=(bgc*16)+fgc; - docolor(color); - } -} - -void textmode (int mode) -{ - /* Ignored */ -} - -int wherex (void) -{ - if (conio_scr) { - int y; - int x; - getyx(conio_scr,y,x); - x++; - return(x); - } - return (0); -} - -int wherey (void) -{ - if (conio_scr) { - int y; - int x; - getyx(conio_scr,y,x); - y++; - return(y); - } - return (0); -} - -void window (int left,int top,int right,int bottom) -{ - int nlines,ncols; - delwin(conio_scr); - top--; - left--; - right--; - bottom--; - nlines=bottom-top; - ncols=right-left; - if (top==0) nlines++; - if (left==0) ncols++; - if ((nlines<1) | (ncols<1)) return; - conio_scr=newwin(nlines,ncols,top,left); - keypad(conio_scr,TRUE); - meta(conio_scr,TRUE); - idlok(conio_scr,TRUE); - scrollok(conio_scr,TRUE); - wrefresh(conio_scr); -} - -/* Linux is cool */ -- 2.31.1 From 0dd845a602e289a5b3e5cd60a8cc2a7c4cbbbd5f Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 5 Feb 2005 23:24:02 +0000 Subject: [PATCH 13/16] Correct the prompt-setting. --- battle.c | 10 ++-- io.c | 139 +++++++++++++++++++++++++++++++++++++++++------------- moving.c | 6 +-- reports.c | 6 +-- sst.c | 16 +++---- sst.h | 11 +++-- 6 files changed, 130 insertions(+), 58 deletions(-) diff --git a/battle.c b/battle.c index df13148..0f760d9 100644 --- a/battle.c +++ b/battle.c @@ -186,9 +186,9 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i deltax /= bigger; deltay /= bigger; if (game.damage[DSRSENS]==0 || condit==IHDOCKED) - setwnd(SRSCAN_WINDOW); + setwnd(srscan_window); else - setwnd(LOWER_WINDOW); + setwnd(message_window); /* Loop to move a single torpedo */ for (l=1; l <= 15; l++) { x += deltax; @@ -202,7 +202,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i wait = 1; if (iquad==IHDOT) continue; /* hit something */ - setwnd(LOWER_WINDOW); + setwnd(message_window); switch(iquad) { case IHE: /* Hit our ship */ case IHF: @@ -397,8 +397,8 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i } break; } - if(curwnd!=LOWER_WINDOW) { - setwnd(LOWER_WINDOW); + if(curwnd!=message_window) { + setwnd(message_window); } if (shoved) { game.quad[jx][jy]=iquad; diff --git a/io.c b/io.c index 54b109b..6899ab0 100644 --- a/io.c +++ b/io.c @@ -32,6 +32,7 @@ static void outro(void) void iostart(int usecurses) { if ((curses = usecurses)) { + if (atexit(outro)){ fprintf(stderr,"Unable to register outro(), exiting...\n"); exit(1); @@ -43,14 +44,30 @@ void iostart(int usecurses) (void)saveterm(); (void)nonl(); (void)cbreak(); +#ifdef FOO + { + int background = COLOR_WHITE; + start_color(); + init_pair(COLOR_BLACK, COLOR_BLACK, background); + init_pair(COLOR_GREEN, COLOR_GREEN, background); + init_pair(COLOR_RED, COLOR_RED, background); + init_pair(COLOR_CYAN, COLOR_CYAN, background); + init_pair(COLOR_WHITE, COLOR_WHITE, background); + init_pair(COLOR_MAGENTA, COLOR_MAGENTA, background); + init_pair(COLOR_BLUE, COLOR_BLUE, background); + init_pair(COLOR_YELLOW, COLOR_YELLOW, background); + } +#endif /* A_COLOR */ //(void)noecho(); - FULLSCREEN_WINDOW = stdscr; - SRSCAN_WINDOW = newwin(12, 25, 0, 0); + fullscreen_window = stdscr; + srscan_window = newwin(12, 25, 0, 0); REPORT_WINDOW = newwin(10, 0, 1, 25); - LRSCAN_WINDOW = newwin(10, 0, 0, 64); - LOWER_WINDOW = newwin(0, 0, 12, 0); - BOTTOM_WINDOW = newwin(1, 0, LINES-1, 0); - scrollok(LOWER_WINDOW, TRUE); + lrscan_window = newwin(10, 0, 0, 64); + message_window = newwin(0, 0, 12, 0); + prompt_window = newwin(1, 0, LINES-1, 0); + scrollok(message_window, TRUE); + setwnd(fullscreen_window); + textcolor(DEFAULT); } } @@ -81,13 +98,13 @@ void pause_game(int i) } if (curses) { drawmaps(0); - setwnd(BOTTOM_WINDOW); - wclear(BOTTOM_WINDOW); - waddstr(BOTTOM_WINDOW, prompt); - wgetnstr(BOTTOM_WINDOW, buf, sizeof(buf)); - wclear(BOTTOM_WINDOW); - wrefresh(BOTTOM_WINDOW); - setwnd(LOWER_WINDOW); + setwnd(prompt_window); + wclear(prompt_window); + waddstr(prompt_window, prompt); + wgetnstr(prompt_window, buf, sizeof(buf)); + wclear(prompt_window); + wrefresh(prompt_window); + setwnd(message_window); } else { putchar('\n'); proutn(prompt); @@ -185,7 +202,7 @@ void setwnd(WINDOW *wnd) { if (curses) { curwnd=wnd; - curs_set(wnd == FULLSCREEN_WINDOW || wnd == LOWER_WINDOW); + curs_set(wnd == fullscreen_window || wnd == message_window || wnd == prompt_window); } } @@ -212,14 +229,68 @@ void textcolor (int color) { if (curses) { wattroff(curwnd, A_REVERSE); - // FIXME - } +#ifdef FOO + switch(color) { + case DEFAULT: + wattrset(curwnd, 0); + break; + case BLACK: + wattron(curwnd, COLOR_PAIR(BLACK)); + break; + case BLUE: + wattron(curwnd, COLOR_PAIR(BLUE)); + break; + case GREEN: + wattron(curwnd, COLOR_PAIR(GREEN)); + break; + case CYAN: + wattron(curwnd, COLOR_PAIR(CYAN)); + break; + case RED: + wattron(curwnd, COLOR_PAIR(RED)); + break; + case MAGENTA: + wattron(curwnd, COLOR_PAIR(MAGENTA)); + break; + case BROWN: + wattron(curwnd, COLOR_PAIR(YELLOW)); + break; + case LIGHTGRAY: + wattron(curwnd, COLOR_PAIR(WHITE)); + break; + case DARKGRAY: + wattron(curwnd, COLOR_PAIR(BLACK) | A_BOLD); + break; + case LIGHTBLUE: + wattron(curwnd, COLOR_PAIR(BLUE) | A_BOLD); + break; + case LIGHTGREEN: + wattron(curwnd, COLOR_PAIR(GREEN) | A_BOLD); + break; + case LIGHTCYAN: + wattron(curwnd, COLOR_PAIR(CYAN) | A_BOLD); + break; + case LIGHTRED: + wattron(curwnd, COLOR_PAIR(RED) | A_BOLD); + break; + case LIGHTMAGENTA: + wattron(curwnd, COLOR_PAIR(MAGENTA) | A_BOLD); + break; + case YELLOW: + wattron(curwnd, COLOR_PAIR(YELLOW) | A_BOLD); + break; + case WHITE: + wattron(curwnd, COLOR_PAIR(WHITE) | A_BOLD); + break; + } +#endif /* FOO */ + } } void highvideo (void) { if (curses) { - attron(A_REVERSE); + wattron(curwnd, A_REVERSE); } } @@ -237,7 +308,7 @@ void drawmaps(short l) if (l == 1) sensor(); if (l != 2) { - setwnd(SRSCAN_WINDOW); + setwnd(srscan_window); wmove(curwnd, 0, 0); enqueue("no"); srscan(SCAN_FULL); @@ -245,9 +316,9 @@ void drawmaps(short l) wclear(REPORT_WINDOW); wmove(REPORT_WINDOW, 0, 0); srscan(SCAN_NO_LEFTSIDE); - setwnd(LRSCAN_WINDOW); - wclear(LRSCAN_WINDOW); - wmove(LRSCAN_WINDOW, 0, 0); + setwnd(lrscan_window); + wclear(lrscan_window); + wmove(lrscan_window, 0, 0); enqueue("l"); lrscan(); } @@ -258,20 +329,20 @@ void boom(int ii, int jj) /* enemy fall down, go boom */ { if (curses) { - setwnd(SRSCAN_WINDOW); + setwnd(srscan_window); drawmaps(2); - wmove(SRSCAN_WINDOW, ii*2+3, jj+2); - wattron(SRSCAN_WINDOW, A_REVERSE); - waddch(SRSCAN_WINDOW, game.quad[ii][jj]); - wrefresh(SRSCAN_WINDOW); + wmove(srscan_window, ii*2+3, jj+2); + wattron(srscan_window, A_REVERSE); + waddch(srscan_window, game.quad[ii][jj]); + wrefresh(srscan_window); sound(500); delay(1000); nosound(); - wmove(SRSCAN_WINDOW, ii*2+3, jj+2); - wattroff(SRSCAN_WINDOW, A_REVERSE); - waddch(SRSCAN_WINDOW, game.quad[ii][jj]); - wrefresh(SRSCAN_WINDOW); - setwnd(LOWER_WINDOW); + wmove(srscan_window, ii*2+3, jj+2); + wattroff(srscan_window, A_REVERSE); + waddch(srscan_window, game.quad[ii][jj]); + wrefresh(srscan_window); + setwnd(message_window); delay(500); } } @@ -281,7 +352,7 @@ void warble(void) { if (curses) { drawmaps(1); - setwnd(LOWER_WINDOW); + setwnd(message_window); sound(50); delay(1000); nosound(); @@ -335,8 +406,8 @@ void tracktorpedo(int x, int y, int ix, int iy, int wait, int l, int i, int n, i void makechart(void) { if (curses) { - setwnd(LOWER_WINDOW); - wclear(LOWER_WINDOW); + setwnd(message_window); + wclear(message_window); chart(0); } } diff --git a/moving.c b/moving.c index 1797e1e..887977a 100644 --- a/moving.c +++ b/moving.c @@ -986,16 +986,16 @@ void help(void) { textcolor(RED); prout("fails."); delay(500); - textcolor(LIGHTGRAY); + textcolor(DEFAULT); } if (l > 3) { finish(FMATERIALIZE); return; } game.quad[ix][iy]=ship; - textcolor(WHITE); + textcolor(GREEN); prout("succeeds."); - textcolor(LIGHTGRAY); + textcolor(DEFAULT); dock(0); skip(1); prout("Lt. Uhura- \"Captain, we made it!\""); diff --git a/reports.c b/reports.c index 54c73d9..98721c6 100644 --- a/reports.c +++ b/reports.c @@ -268,8 +268,8 @@ int srscan(int l) { case IHRED: textcolor(RED); break; case IHGREEN: textcolor(GREEN); break; case IHYELLOW: textcolor(YELLOW); break; - case IHDOCKED: textcolor(LIGHTGRAY); break; - case IHDEAD: textcolor(WHITE); + case IHDOCKED: textcolor(CYAN); break; + case IHDEAD: textcolor(BROWN); } if (game.quad[i][j] != ship) highvideo(); @@ -277,7 +277,7 @@ int srscan(int l) { if (game.quad[i][j] & DAMAGED) highvideo(); proutn("%c ",game.quad[i][j] & ~DAMAGED); - textcolor(LIGHTGRAY); + textcolor(DEFAULT); } else proutn("- "); diff --git a/sst.c b/sst.c index dc26b35..55cdaea 100644 --- a/sst.c +++ b/sst.c @@ -199,11 +199,11 @@ static void helpme(void) { key = scan(); while (TRUE) { if (key == IHEOL) { - setwnd(BOTTOM_WINDOW); + setwnd(prompt_window); proutn("Help on what command? "); key = scan(); } - setwnd(LOWER_WINDOW); + setwnd(message_window); if (key == IHEOL) return; for (i = 0; i < NUMCOMMANDS; i++) { if (strcasecmp(commands[i].name, citem)==0) { @@ -271,7 +271,7 @@ void enqueue(char *s) { static void makemoves(void) { int i, hitme; clrscr(); - setwnd(LOWER_WINDOW); + setwnd(message_window); while (TRUE) { /* command loop */ drawmaps(1); while (TRUE) { /* get a command */ @@ -280,7 +280,7 @@ static void makemoves(void) { Time = 0.0; i = -1; chew(); - setwnd(BOTTOM_WINDOW); + setwnd(prompt_window); clrscr(); proutn("COMMAND> "); if (scan() == IHEOL) { @@ -289,7 +289,7 @@ static void makemoves(void) { } ididit=0; clrscr(); - setwnd(LOWER_WINDOW); + setwnd(message_window); clrscr(); for (i=0; i < ABANDON; i++) if (isit(commands[i].name)) { @@ -492,7 +492,7 @@ int main(int argc, char **argv) { strcat(line, " "); } while (TRUE) { /* Play a game */ - setwnd(FULLSCREEN_WINDOW); + setwnd(fullscreen_window); clrscr(); prelim(); setup(line[0] == '\0'); @@ -618,9 +618,9 @@ int scan(void) { } cgetline(line, sizeof(line)); fflush(stdin); - if (curwnd==BOTTOM_WINDOW){ + if (curwnd==prompt_window){ clrscr(); - setwnd(LOWER_WINDOW); + setwnd(message_window); clrscr(); } linep = line; diff --git a/sst.h b/sst.h index cf44c73..8a1f44d 100644 --- a/sst.h +++ b/sst.h @@ -451,12 +451,12 @@ void enqueue(char *s); #define SCAN_STATUS 3 #define SCAN_NO_LEFTSIDE 4 -WINDOW *FULLSCREEN_WINDOW; -WINDOW *SRSCAN_WINDOW; +WINDOW *fullscreen_window; +WINDOW *srscan_window; WINDOW *REPORT_WINDOW; -WINDOW *LRSCAN_WINDOW; -WINDOW *LOWER_WINDOW; -WINDOW *BOTTOM_WINDOW; +WINDOW *lrscan_window; +WINDOW *message_window; +WINDOW *prompt_window; extern void clreol(void); extern void clrscr(void); @@ -464,6 +464,7 @@ extern void textcolor(int color); extern void highvideo(void); enum COLORS { + DEFAULT, BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY, DARKGRAY, LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA, YELLOW, WHITE }; -- 2.31.1 From 2ca70710fc39e85aac386ec041318369d148f5ce Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 5 Feb 2005 23:39:05 +0000 Subject: [PATCH 14/16] Dilithium crystal indicator. --- TODO | 9 --------- battle.c | 3 ++- reports.c | 2 ++ sst-doc.xml | 3 +++ 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index ae961f4..f896c30 100644 --- a/TODO +++ b/TODO @@ -9,12 +9,3 @@ REST, DOCK, QUIT, and DAMAGE were in the original non-"super" version. * Add a field to the report indicating whether we have dilithium. - -* Look: - -Track for torpedo number 1- 6 - 5 7 - 6 8 - 7 ***Commander at Sector 8 - 7 damaged-- displaced by blast to Sector 9 - 8 - -Track for torpedo number 2- 6 - 5 7 - 6 8 - 6 -9 - 7 -***Commander at Sector 9 - 8 destroyed. -COMMAND> diff --git a/battle.c b/battle.c index 0f760d9..9b35e4f 100644 --- a/battle.c +++ b/battle.c @@ -203,6 +203,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i if (iquad==IHDOT) continue; /* hit something */ setwnd(message_window); + prout(""); /* start new line after text track */ switch(iquad) { case IHE: /* Hit our ship */ case IHF: @@ -319,7 +320,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i plnetx = plnety = 0; game.quad[ix][iy] = IHDOT; if (landed==1) { - /* captain parishes on planet */ + /* captain perishes on planet */ finish(FDPLANET); } return; diff --git a/reports.c b/reports.c index 98721c6..bdb0e94 100644 --- a/reports.c +++ b/reports.c @@ -321,6 +321,8 @@ int srscan(int l) { break; case 6: proutn("Energy %.2f", energy); + if (icrystl) + proutn(" (crystals on board)"); break; case 7: proutn("Torpedoes %d", torps); diff --git a/sst-doc.xml b/sst-doc.xml index 1a74780..fd03ba6 100644 --- a/sst-doc.xml +++ b/sst-doc.xml @@ -1757,6 +1757,9 @@ of platform dependencies in the code. The HELP/CALL/SOS command is now MAYDAY. SOS and CALL are still accepted. + +Status report now indicates if dilithium crystals arre on board. + Here are some good pages on the history of Star Trek games: -- 2.31.1 From aba642f488174f640e8099f07d46f0a64dbb5052 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 6 Feb 2005 00:06:05 +0000 Subject: [PATCH 15/16] Better command suppression. --- battle.c | 2 +- reports.c | 2 +- sst-doc.xml | 24 +++++++++---- sst.c | 97 ++++++++++++++++++++++++++++------------------------- 4 files changed, 70 insertions(+), 55 deletions(-) diff --git a/battle.c b/battle.c index 9b35e4f..e405471 100644 --- a/battle.c +++ b/battle.c @@ -203,7 +203,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i if (iquad==IHDOT) continue; /* hit something */ setwnd(message_window); - prout(""); /* start new line after text track */ + skip(1); /* start new line after text track */ switch(iquad) { case IHE: /* Hit our ship */ case IHF: diff --git a/reports.c b/reports.c index bdb0e94..bca7bb7 100644 --- a/reports.c +++ b/reports.c @@ -322,7 +322,7 @@ int srscan(int l) { case 6: proutn("Energy %.2f", energy); if (icrystl) - proutn(" (crystals on board)"); + proutn(" (have crystals)"); break; case 7: proutn("Torpedoes %d", torps); diff --git a/sst-doc.xml b/sst-doc.xml index fd03ba6..852c462 100644 --- a/sst-doc.xml +++ b/sst-doc.xml @@ -326,9 +326,9 @@ Full commands: SRSCAN -If you are using the screen-oriented interface, it should never -be necessary to call this command explicitly; a short-range scan will -always be present on the screen. +If you are using the screen-oriented interface, this command is +suppressed; instead, a short-range scan will always be present on the +screen. The short-range scan gives you a considerable amount of information about the quadrant your starship is in. A short-range scan is best @@ -381,6 +381,11 @@ Mnemonic: STATUS Shortest abbreviation: ST + +If you are using the screen-oriented interface, this command is +suppressed; instead, a full status report will always be present on the +screen. + This command gives you information about the current state of your starship as follows: @@ -491,10 +496,10 @@ Mnemonic: LRSCAN Shortest abbreviation: L - -If you are using the screen-oriented interface, it should never -be necessary to call this command explicitly; a long-range scan will -always be present on the screen. + +If you are using the screen-oriented interface, this command is +suppressed; instead, a long-range scan will always be present on the +screen. A long-range scan gives you general information about where you are and what is around you. Here is an example output. @@ -1257,6 +1262,11 @@ Shortest abbreviation: REQ Full command: REQUEST <ITEM> + +If you are using the screen-oriented interface, this command is +suppressed; instead, a full status report will always be present on the +screen. + This command allows you to get any single piece of information from the <STATUS> command. <ITEM> specifies which information as follows: diff --git a/sst.c b/sst.c index 55cdaea..89e069d 100644 --- a/sst.c +++ b/sst.c @@ -89,10 +89,13 @@ Eric Raymond's changes: 1. "sos" and "call" becomes "mayday", "freeze" and "save" are both good. + 2. Status report now indicates when dilithium crystals are on board. + */ /* the input queue */ static char line[128], *linep = line; +static usecurses = TRUE; static struct { @@ -100,91 +103,94 @@ static struct int value; } commands[] = { -#define SRSCAN 1 +#define SRSCAN 0 {"SRSCAN", SRSCAN}, -#define STATUS 2 +#define STATUS 1 {"STATUS", STATUS}, -#define REQUEST 3 +#define REQUEST 2 {"REQUEST", REQUEST}, -#define LRSCAN 4 +#define LRSCAN 3 {"LRSCAN", LRSCAN}, -#define PHASERS 5 +#define PHASERS 4 {"PHASERS", PHASERS}, -#define TORPEDO 6 +#define TORPEDO 5 {"TORPEDO", TORPEDO}, {"PHOTONS", TORPEDO}, -#define MOVE 7 +#define MOVE 6 {"MOVE", MOVE}, -#define SHIELDS 8 +#define SHIELDS 7 {"SHIELDS", SHIELDS}, -#define DOCK 9 +#define DOCK 8 {"DOCK", DOCK}, -#define DAMAGES 10 +#define DAMAGES 9 {"DAMAGES", DAMAGES}, -#define CHART 11 +#define CHART 10 {"CHART", CHART}, -#define IMPULSE 12 +#define IMPULSE 11 {"IMPULSE", IMPULSE}, -#define REST 13 +#define REST 12 {"REST", REST}, -#define WARP 14 +#define WARP 13 {"WARP", WARP}, -#define SCORE 15 +#define SCORE 14 {"SCORE", SCORE}, -#define SENSORS 16 +#define SENSORS 15 {"SENSORS", SENSORS}, -#define ORBIT 17 +#define ORBIT 16 {"ORBIT", ORBIT}, -#define TRANSPORT 18 +#define TRANSPORT 17 {"TRANSPORT", TRANSPORT}, -#define MINE 19 +#define MINE 18 {"MINE", MINE}, -#define CRYSTALS 20 +#define CRYSTALS 19 {"CRYSTALS", CRYSTALS}, -#define SHUTTLE 21 +#define SHUTTLE 20 {"SHUTTLE", SHUTTLE}, -#define PLANETS 22 +#define PLANETS 21 {"PLANETS", PLANETS}, -#define REPORT 23 +#define REPORT 22 {"REPORT", REPORT}, -#define COMPUTER 24 +#define COMPUTER 23 {"COMPUTER", COMPUTER}, -#define COMMANDS 25 +#define COMMANDS 24 {"COMMANDS", COMMANDS}, -#define EMEXIT 26 +#define EMEXIT 25 {"EMEXIT", EMEXIT}, -#define PROBE 27 +#define PROBE 26 {"PROBE", PROBE}, -#define SAVE 28 +#define SAVE 27 {"SAVE", SAVE}, {"FREEZE", SAVE}, -#define ABANDON 29 +#define ABANDON 28 {"ABANDON", ABANDON}, -#define DESTRUCT 30 +#define DESTRUCT 29 {"DESTRUCT", DESTRUCT}, -#define DEATHRAY 31 +#define DEATHRAY 30 {"DEATHRAY", DEATHRAY}, -#define DEBUGCMD 32 +#define DEBUGCMD 31 {"DEBUG", DEBUGCMD}, -#define MAYDAY 33 +#define MAYDAY 32 {"MAYDAY", MAYDAY}, {"SOS", MAYDAY}, {"CALL", MAYDAY}, -#define QUIT 34 +#define QUIT 33 {"QUIT", QUIT}, -#define HELP 35 +#define HELP 34 {"HELP", HELP}, }; #define NUMCOMMANDS sizeof(commands)/sizeof(commands[0]) -static void listCommands(int x) { - int i; - prout("LEGAL COMMANDS ARE:"); - for (i = 0; i < NUMCOMMANDS; i++) { - proutn("%-12s ", commands[i].name); - if (i % 5 == 4) +#define MIN_CURSES_COMMAND PHASERS /* might change someday */ + +static void listCommands(int usecurses) { + int i, k = 0; + proutn("LEGAL COMMANDS ARE:"); + for (i = usecurses ? MIN_CURSES_COMMAND : 0; i < NUMCOMMANDS; i++) { + if (k % 5 == 0) skip(1); + proutn("%-12s ", commands[i].name); + k++; } skip(1); } @@ -214,7 +220,7 @@ static void helpme(void) { if (i != NUMCOMMANDS) break; skip(1); prout("Valid commands:"); - listCommands(FALSE); + listCommands(usecurses); key = IHEOL; chew(); skip(1); @@ -303,8 +309,7 @@ static void makemoves(void) { break; } if (i < NUMCOMMANDS) break; - - listCommands(TRUE); + listCommands(usecurses); } commandhook(commands[i].name, TRUE); switch (i) { /* command switch */ @@ -393,7 +398,7 @@ static void makemoves(void) { eta(); break; case COMMANDS: - listCommands(TRUE); + listCommands(usecurses); break; case EMEXIT: // Emergency exit clrscr(); // Hide screen @@ -470,7 +475,7 @@ static void makemoves(void) { int main(int argc, char **argv) { - int i, option, usecurses = TRUE; + int i, option; while ((option = getopt(argc, argv, "t")) != -1) { switch (option) { -- 2.31.1 From 706a411473a8f5b9c2fd80c0a9f866ba2bef1d24 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 6 Feb 2005 00:06:43 +0000 Subject: [PATCH 16/16] Update the TODO. --- TODO | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index f896c30..b8fb268 100644 --- a/TODO +++ b/TODO @@ -8,4 +8,5 @@ IMPULSE, PHOTONS, ABANDON, LRSCAN, WARP, SHIELDS, DESTRUCT CHART, REST, DOCK, QUIT, and DAMAGE were in the original non-"super" version. -* Add a field to the report indicating whether we have dilithium. +* Fix the color support. + -- 2.31.1