More magic-number chasing.
[super-star-trek.git] / planets.c
index ae7a7aad880e354214f97808eedf27afb819f99c..a46e0e2c1d4b8000b6347728d9a8b3d1c01bed50 100644 (file)
--- a/planets.c
+++ b/planets.c
@@ -22,7 +22,7 @@ static int consumeTime(void) {
        events();       /* Used to avoid if future[FSCMOVE] within time */
 //     future[FSNOVA] = asave;
        /*fails if game over, quadrant super-novas or we've moved to new quadrant*/
-       if (alldone || game.state.galaxy[quadx][quady] == 1000 || justin != 0) return 1;
+       if (alldone || game.state.galaxy[quadx][quady] == SUPERNOVA_PLACE || justin != 0) return 1;
        return 0;
 }
 
@@ -78,16 +78,10 @@ void orbit(void) {
        height = (1400.+7200.*Rand());
        prout("Sulu-  \"Entered orbit at altitude %.2f kilometers.\"", height);
        inorbit = 1;
-#ifdef SERGEEV
         ididit=1;
-#endif /* SERGEEV */
 }
 
 void sensor(void) {
-#ifdef SERGEEV
-    if (game.damage[DSRSENS] != 0.0) return;
-    if ((plnetx != 0)&&(game.state.plnets[iplnet].known == 0)) {
-#else
        skip(1);
        chew();
        if (game.damage[DSRSENS] != 0.0) {
@@ -95,24 +89,22 @@ void sensor(void) {
                return;
        }
        if (plnetx == 0) {
-               prout("No planet in this quadrant.");
-               return;
+               prout("Spock- \"No planet in this quadrant, Captain.\"");
+               return;
+       }
+       if ((plnetx != 0)&&(game.state.plnets[iplnet].known == 0)) {
+           prout("Spock-  \"Sensor scan for %s-", cramlc(quadrant, quadx, quady));
+           skip(1);
+           prout("         Planet at %s is of class %s.", 
+                  cramlc(sector, plnetx, plnety),
+                  classes[game.state.plnets[iplnet].pclass]);
+           if (game.state.plnets[iplnet].known==shuttle_down) 
+                   prout("         Sensors show Galileo still on surface.");
+           proutn("         Readings indicate");
+           if (game.state.plnets[iplnet].crystals == 0) proutn(" no");
+           prout(" dilithium crystals present.\"");
+           if (game.state.plnets[iplnet].known == unknown) game.state.plnets[iplnet].known = known;
        }
-#endif /* SERGEEV */
-       prout("Spock-  \"Sensor scan for %s-", cramlc(quadrant, quadx, quady));
-       skip(1);
-       prout("         Planet at %s is of class %s.", 
-              cramlc(sector, plnetx, plnety),
-              classes[game.state.plnets[iplnet].pclass]);
-       if (game.state.plnets[iplnet].known==shuttle_down) 
-               prout("         Sensors show Galileo still on surface.");
-       proutn("         Readings indicate");
-       if (game.state.plnets[iplnet].crystals == 0) proutn(" no");
-       prout(" dilithium crystals present.\"");
-       if (game.state.plnets[iplnet].known == unknown) game.state.plnets[iplnet].known = known;
-#ifdef SERGEEV
-    }
-#endif /* SERGEEV */
 }
 
 void beam(void) {
@@ -176,9 +168,7 @@ void beam(void) {
                skip(1);
                prout("Kirk-  \"Energize.\"");
        }
-#ifdef SERGEEV
         ididit=1;
-#endif /* SERGEEV */
        skip(1);
        prouts("WWHOOOIIIIIRRRRREEEE.E.E.  .  .  .  .   .    .");
        skip(2);
@@ -230,9 +220,7 @@ void mine(void) {
        if (consumeTime()) return;
        prout("Mining operation complete.");
        imine = 1;
-#ifdef SERGEEV
         ididit=1;
-#endif /* SERGEEV */
 }
 
 void usecrystals(void) {
@@ -282,9 +270,7 @@ void usecrystals(void) {
        prout("   are going crazy, but I think it's");
        prout("   going to work!!  Congratulations, Sir!\"");
        cryprob *= 2.0;
-#ifdef SERGEEV
        ididit=1;
-#endif /* SERGEEV */
 }
 
 void shuttle(void) {
@@ -490,8 +476,8 @@ void deathray(void) {
                proutn("Spock-  \"I believe the word is");
                prouts(" *ASTONISHING*");
                prout(" Mr. Sulu.");
-               for (i=1; i<=10; i++)
-                       for (j=1; j<=10; j++)
+               for (i=1; i<=QUADSIZE; i++)
+                       for (j=1; j<=QUADSIZE; j++)
                                if (game.quad[i][j] == IHDOT) game.quad[i][j] = IHQUEST;
                prout("  Captain, our quadrant is now infested with");
                prouts(" - - - - - -  *THINGS*.");