\r
static void clearscreen(void);\r
\r
-#define NUMCOMMANDS 34\r
-\r
/* Compared to original version, I've changed the "help" command to\r
"call" and the "terminate" command to "quit" to better match\r
user expectations. The DECUS version apparently made those changes\r
*/\r
\r
\r
-static char *commands[NUMCOMMANDS] = {\r
+static char *commands[] = {\r
"srscan",\r
"lrscan",\r
"phasers",\r
"quit",\r
"help"\r
};\r
+#define NUMCOMMANDS sizeof(commands)/sizeof(commands[0])\r
\r
static void listCommands(int x) {\r
prout(" SRSCAN MOVE PHASERS CALL\n"\r
warp(1);\r
break;\r
case 5: // shields\r
- sheild(1);\r
+ doshield(1);\r
if (ididit) {\r
attack(2);\r
shldchg = 0;\r
events();\r
if (alldone) break; // Events did us in\r
}\r
- if (d.galaxy[quadx][quady] == 1000) { // Galaxy went Nova!\r
+ if (game.state.galaxy[quadx][quady] == 1000) { // Galaxy went Nova!\r
atover(0);\r
continue;\r
}\r
if (hitme && justin==0) {\r
attack(2);\r
if (alldone) break;\r
- if (d.galaxy[quadx][quady] == 1000) { // went NOVA! \r
+ if (game.state.galaxy[quadx][quady] == 1000) { // went NOVA! \r
atover(0);\r
hitme = TRUE;\r
continue;\r
}\r
\r
\r
-void main(int argc, char **argv) {\r
+int main(int argc, char **argv) {\r
int i;\r
int hitme;\r
char ch;\r
case IHP: s = "Planet"; break;\r
case IHB: s = "Starbase"; break;\r
case IHBLANK: s = "Black hole"; break;\r
- case IHT: s = "Tholean"; break;\r
- case IHWEB: s = "Tholean web"; break;\r
+ case IHT: s = "Tholian"; break;\r
+ case IHWEB: s = "Tholian web"; break;\r
default: s = "Unknown??"; break;\r
}\r
proutn(s);\r
chew();\r
return IHEOL;\r
}\r
- gets(line);\r
+ fgets(line, sizeof(line), stdin);\r
+ line[strlen(line)-1] = '\0';\r
linep = line;\r
}\r
// Skip leading white space\r
key = scan();\r
if (key == IHALPHA && isit("y")) {\r
damage[i] = 10.0;\r
- if (i == DRADIO) stdamtim = d.date;\r
+ if (i == DRADIO) stdamtim = game.state.date;\r
}\r
}\r
}\r
case FSCMOVE: proutn("SC Move "); break;\r
case FSCDBAS: proutn("SC Base Destroy "); break;\r
}\r
- cramf(future[i]-d.date, 8, 2);\r
+ cramf(future[i]-game.state.date, 8, 2);\r
chew();\r
proutn(" ?");\r
key = scan();\r
if (key == IHREAL) {\r
- future[i] = d.date + aaitem;\r
+ future[i] = game.state.date + aaitem;\r
}\r
}\r
chew();\r