prout("Spock- \"Planet report follows, Captain.\"");\r
skip(1);\r
for (i = 1; i <= inplan; i++) {\r
- if (game.state.plnets[i].known\r
+ if (game.state.plnets[i].known != unknown\r
#ifdef DEBUG\r
|| ( idebug && game.state.plnets[i].x !=0)\r
#endif\r
) {\r
iknow = 1;\r
#ifdef DEBUG\r
- if (idebug && game.state.plnets[i].known==0) proutn("(Unknown) ");\r
+ if (idebug && game.state.plnets[i].known==unknown) proutn("(Unknown) ");\r
#endif\r
cramlc(1, game.state.plnets[i].x, game.state.plnets[i].y);\r
proutn(" class ");\r
proutn(" ");\r
if (game.state.plnets[i].crystals == 0) proutn("no ");\r
prout("dilithium crystals present.");\r
- if (game.state.plnets[i].known==2) \r
+ if (game.state.plnets[i].known==shuttle_down) \r
prout(" Shuttle Craft Galileo on surface.");\r
}\r
}\r
proutn(" is of class ");\r
proutn(classes[game.state.plnets[iplnet].pclass]);\r
prout(".");\r
- if (game.state.plnets[iplnet].known==2) \r
+ if (game.state.plnets[iplnet].known==shuttle_down) \r
prout(" Sensors show Galileo still on surface.");\r
proutn(" Readings indicate");\r
if (game.state.plnets[iplnet].crystals == 0) proutn(" no");\r
prout(" dilithium crystals present.\"");\r
- if (game.state.plnets[iplnet].known == 0) game.state.plnets[iplnet].known = 1;\r
+ if (game.state.plnets[iplnet].known == unknown) game.state.plnets[iplnet].known = known;\r
return;\r
}\r
\r
skip(1);\r
if (game.damage[DTRANSP] != 0) {\r
prout("Transporter damaged.");\r
- if (game.damage[DSHUTTL]==0 && (game.state.plnets[iplnet].known==2 || iscraft == 1)) {\r
+ if (game.damage[DSHUTTL]==0 && (game.state.plnets[iplnet].known==shuttle_down || iscraft == 1)) {\r
skip(1);\r
prout("Spock- \"May I suggest the shuttle craft, Sir?\" ");\r
if (ja() != 0) shuttle();\r
prout("Impossible to transport through shields.");\r
return;\r
}\r
- if (game.state.plnets[iplnet].known==0) {\r
+ if (game.state.plnets[iplnet].known==unknown) {\r
prout("Spock- \"Captain, we have no information on this planet");\r
prout(" and Starfleet Regulations clearly state that in this situation");\r
prout(" you may not go down.\"");\r
}\r
if (landed==1) {\r
/* Coming from planet */\r
- if (game.state.plnets[iplnet].known==2) {\r
+ if (game.state.plnets[iplnet].known==shuttle_down) {\r
proutn("Spock- \"Wouldn't you rather take the Galileo?\" ");\r
if (ja() != 0) {\r
chew();\r
skip(2);\r
prout("Transport complete.");\r
landed = -landed;\r
- if (landed==1 && game.state.plnets[iplnet].known==2) {\r
+ if (landed==1 && game.state.plnets[iplnet].known==shuttle_down) {\r
prout("The shuttle craft Galileo is here!");\r
}\r
if (landed!=1 && imine==1) {\r
ididit = 0;\r
if(game.damage[DSHUTTL] != 0.0) {\r
if (game.damage[DSHUTTL] == -1.0) {\r
- if (inorbit && game.state.plnets[iplnet].known == 2)\r
+ if (inorbit && game.state.plnets[iplnet].known == shuttle_down)\r
prout("Ye Faerie Queene has no shuttle craft bay to dock it at.");\r
else\r
prout("Ye Faerie Queene had no shuttle craft.");\r
prout(" not in standard orbit.");\r
return;\r
}\r
- if ((game.state.plnets[iplnet].known != 2) && iscraft != 1) {\r
+ if ((game.state.plnets[iplnet].known != shuttle_down) && iscraft != 1) {\r
prout("Shuttle craft not currently available.");\r
return;\r
}\r
- if (landed==-1 && game.state.plnets[iplnet].known==2) {\r
+ if (landed==-1 && game.state.plnets[iplnet].known==shuttle_down) {\r
prout("You will have to beam down to retrieve the shuttle craft.");\r
return;\r
}\r
prout("Shuttle craft cannot pass through shields.");\r
return;\r
}\r
- if (game.state.plnets[iplnet].known==0) {\r
+ if (game.state.plnets[iplnet].known==unknown) {\r
prout("Spock- \"Captain, we have no information on this planet");\r
prout(" and Starfleet Regulations clearly state that in this situation");\r
prout(" you may not fly down.\"");\r
iscraft = 0;\r
skip(1);\r
if (consumeTime()) return;\r
- game.state.plnets[iplnet].known=2;\r
+ game.state.plnets[iplnet].known=shuttle_down;\r
prout("Trip complete.");\r
return;\r
}\r
prout("shuttle craft for the trip back to the Enterprise.");\r
skip(1);\r
prout("The short hop begins . . .");\r
- game.state.plnets[iplnet].known=1;\r
+ game.state.plnets[iplnet].known=known;\r
icraft = 1;\r
skip(1);\r
landed = -1;\r
icraft = 1;\r
iscraft = 0;\r
if (consumeTime()) return;\r
- game.state.plnets[iplnet].known = 2;\r
+ game.state.plnets[iplnet].known = shuttle_down;\r
landed = 1;\r
icraft = 0;\r
prout("Trip complete");\r
#define NEVENTS (8)\r
\r
typedef struct {\r
- int x; /* Quadrant location of planet */\r
- int y;\r
- int pclass; /* class M, N, or O (1, 2, or 3) */\r
- int crystals; /* has crystals */\r
- int known; /* =1 contents known, =2 shuttle on this planet */\r
+ int x; /* Quadrant location of planet */\r
+ int y;\r
+ int pclass; /* class M, N, or O (1, 2, or 3) */\r
+ int crystals; /* has crystals */\r
+ enum {unknown, known, shuttle_down} known;\r
} planet;\r
\r
typedef struct {\r
// original names. Gee, I could have done this with the d structure,\r
// but I just didn't think of it back when I started.\r
\r
-EXTERN struct foo2 {\r
+EXTERN struct {\r
snapshot state;\r
snapshot snapsht;\r
char quad[11][11]; // contents of our quadrant\r