X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=planets.c;h=5ea7479ec97ca992c662ba888b25533cb4c99ba2;hp=057fb84dbd1cd3bdd0af04efb5c707e12dda6ef4;hb=8629b4a298e31f81ba0db0debb4796356c3966c7;hpb=e536fe754b3a9be00dcaee8f6ec50ea2d8c7a184 diff --git a/planets.c b/planets.c index 057fb84..5ea7479 100644 --- a/planets.c +++ b/planets.c @@ -1,7 +1,5 @@ #include "sst.h" -static int height; - static char *classes[] = {"M","N","O"}; static int consumeTime(void) @@ -71,20 +69,20 @@ void orbit(void) } if (plnetx == 0 || abs(sectx-plnetx) > 1 || abs(secty-plnety) > 1) { crmshp(); - prout(" not adjacient to planet.\n"); + prout(" not adjacent to planet.\n"); return; } Time = 0.02+0.03*Rand(); prout("Helmsman Sulu- \"Entering standard orbit, Sir.\""); newcnd(); if (consumeTime()) return; - height = (1400.+7200.*Rand()); - prout("Sulu- \"Entered orbit at altitude %.2f kilometers.\"", height); + game.height = (1400.0+7200.0*Rand()); + prout("Sulu- \"Entered orbit at altitude %.2f kilometers.\"", game.height); inorbit = 1; ididit=1; } -void sensor(int force) +void sensor(void) { skip(1); chew(); @@ -92,11 +90,11 @@ void sensor(int force) prout("Short range sensors damaged."); return; } - if (!plnetx && ((game.state.plnets[iplnet].known == unknown || force))) { + if (!plnetx && (game.options & OPTION_TTY)) { prout("Spock- \"No planet in this quadrant, Captain.\""); return; } - if ((plnetx != 0)&&(game.state.plnets[iplnet].known == unknown)) { + if ((plnetx != 0)&& (game.state.plnets[iplnet].known == unknown)) { prout("Spock- \"Sensor scan for %s-", cramlc(quadrant, quadx, quady)); skip(1); prout(" Planet at %s is of class %s.", @@ -319,7 +317,7 @@ void shuttle(void) prout(" you may not fly down.\""); return; } - Time = 3.0e-5*height; + Time = 3.0e-5*game.height; if (Time >= 0.8*game.state.remtime) { prout("First Officer Spock- \"Captain, I compute that such"); proutn(" a maneuver would require approximately 2d%% of our", @@ -484,8 +482,8 @@ void deathray(void) proutn("Spock- \"I believe the word is"); prouts(" *ASTONISHING*"); prout(" Mr. Sulu."); - for (i=1; i<=QUADSIZE; i++) - for (j=1; j<=QUADSIZE; j++) + for_sectors(i) + for_sectors(j) if (game.quad[i][j] == IHDOT) game.quad[i][j] = IHQUEST; prout(" Captain, our quadrant is now infested with"); prouts(" - - - - - - *THINGS*.");