- if (nplan) {
- // If quadrant needs a planet, put it in
- for (i=0; i < inplan; i++)
- if (game.state.plnets[i].x == quadx && game.state.plnets[i].y == quady) break;
- if (i < inplan) {
- iplnet = i;
- dropin(IHP, &plnetx, &plnety);
- }
- }
- // Check for condition
- newcnd();
- // And finally the stars
- for (i = 1; i <= quadnum; i++) dropin(IHSTAR, &ix, &iy);
-
- // Check for RNZ
- if (irhere > 0 && klhere == 0) {
- neutz = 1;
- if (game.damage[DRADIO] <= 0.0) {
- skip(1);
- prout("LT. Uhura- \"Captain, an urgent message.");
- prout(" I'll put it on audio.\" CLICK");
- skip(1);
- prout("INTRUDER! YOU HAVE VIOLATED THE ROMULAN NEUTRAL ZONE.");
- prout("LEAVE AT ONCE, OR YOU WILL BE DESTROYED!");
- }
- }
-
- if (shutup==0) {
- // Put in THING if needed
- if (thingx == quadx && thingy == quady) {
- dropin(IHQUEST, &ix, &iy);
- iran8(&thingx, &thingy);
- nenhere++;
- iqhere=1;
- game.kx[nenhere] = ix;
- game.ky[nenhere] = iy;
- game.kdist[nenhere] = game.kavgd[nenhere] =
- sqrt(square(sectx-ix) + square(secty-iy));
- game.kpower[nenhere] = Rand()*6000.0 +500.0 +250.0*skill;
- if (game.damage[DSRSENS] == 0.0) {
- skip(1);
- prout("MR. SPOCK- \"Captain, this is most unusual.");
- prout(" Please examine your short-range scan.\"");
- }
- }
- }
-
- // Decide if quadrant needs a Tholian
- if ((skill < 3 && Rand() <= 0.02) || /* Lighten up if skill is low */
- (skill == 3 && Rand() <= 0.05) ||
- (skill > 3 && Rand() <= 0.08)
-#ifdef DEBUG
- || strcmp(passwd, "tholianx")==0
-#endif
- ) {
- do {
- ithx = Rand() > 0.5 ? 10 : 1;
- ithy = Rand() > 0.5 ? 10 : 1;
- } while (game.quad[ithx][ithy] != IHDOT);
- game.quad[ithx][ithy] = IHT;
- ithere = 1;
- nenhere++;
- game.kx[nenhere] = ithx;
- game.ky[nenhere] = ithy;
- game.kdist[nenhere] = game.kavgd[nenhere] =
- sqrt(square(sectx-ithx) + square(secty-ithy));
- game.kpower[nenhere] = Rand()*400.0 +100.0 +25.0*skill;
- /* Reserve unocupied corners */
- if (game.quad[1][1]==IHDOT) game.quad[1][1] = 'X';
- if (game.quad[1][10]==IHDOT) game.quad[1][10] = 'X';
- if (game.quad[10][1]==IHDOT) game.quad[10][1] = 'X';
- if (game.quad[10][10]==IHDOT) game.quad[10][10] = 'X';
- }
- sortkl();
-
- // Put in a few black holes
- for (i = 1; i <= 3; i++)
- if (Rand() > 0.5) dropin(IHBLANK, &ix, &iy);
-
- // Take out X's in corners if Tholian present
- if (ithere) {
- if (game.quad[1][1]=='X') game.quad[1][1] = IHDOT;
- if (game.quad[1][10]=='X') game.quad[1][10] = IHDOT;
- if (game.quad[10][1]=='X') game.quad[10][1] = IHDOT;
- if (game.quad[10][10]=='X') game.quad[10][10] = IHDOT;
- }
+ if (nplan) {
+ // If quadrant needs a planet, put it in
+ for (i=0; i < inplan; i++)
+ if (game.state.plnets[i].x == quadx && game.state.plnets[i].y == quady) break;
+ if (i < inplan) {
+ iplnet = i;
+ dropin(IHP, &plnetx, &plnety);
+ }
+ }
+ // Check for condition
+ newcnd();
+ // And finally the stars
+ for (i = 1; i <= game.state.galaxy[quadx][quady].stars; i++)
+ dropin(IHSTAR, &ix, &iy);
+
+ // Check for RNZ
+ if (irhere > 0 && klhere == 0) {
+ neutz = 1;
+ if (game.damage[DRADIO] <= 0.0) {
+ skip(1);
+ prout("LT. Uhura- \"Captain, an urgent message.");
+ prout(" I'll put it on audio.\" CLICK");
+ skip(1);
+ prout("INTRUDER! YOU HAVE VIOLATED THE ROMULAN NEUTRAL ZONE.");
+ prout("LEAVE AT ONCE, OR YOU WILL BE DESTROYED!");
+ }
+ }
+
+ if (shutup==0) {
+ // Put in THING if needed
+ if (thingx == quadx && thingy == quady) {
+ dropin(IHQUEST, &ix, &iy);
+ iran(GALSIZE, &thingx, &thingy);
+ nenhere++;
+ iqhere=1;
+ game.kx[nenhere] = ix;
+ game.ky[nenhere] = iy;
+ game.kdist[nenhere] = game.kavgd[nenhere] =
+ sqrt(square(sectx-ix) + square(secty-iy));
+ game.kpower[nenhere] = Rand()*6000.0 +500.0 +250.0*skill;
+ if (game.damage[DSRSENS] == 0.0) {
+ skip(1);
+ prout("MR. SPOCK- \"Captain, this is most unusual.");
+ prout(" Please examine your short-range scan.\"");
+ }
+ }
+ }
+
+ // Decide if quadrant needs a Tholian
+ if (game.options & OPTION_THOLIAN) {
+ if ((skill < SKILL_GOOD && Rand() <= 0.02) || /* Lighten up if skill is low */
+ (skill == SKILL_GOOD && Rand() <= 0.05) ||
+ (skill > SKILL_GOOD && Rand() <= 0.08)
+ #ifdef DEBUG
+ || strcmp(game.passwd, "tholianx")==0
+ #endif
+ ) {
+ do {
+ ithx = Rand() > 0.5 ? QUADSIZE : 1;
+ ithy = Rand() > 0.5 ? QUADSIZE : 1;
+ } while (game.quad[ithx][ithy] != IHDOT);
+ game.quad[ithx][ithy] = IHT;
+ ithere = 1;
+ nenhere++;
+ game.kx[nenhere] = ithx;
+ game.ky[nenhere] = ithy;
+ game.kdist[nenhere] = game.kavgd[nenhere] =
+ sqrt(square(sectx-ithx) + square(secty-ithy));
+ game.kpower[nenhere] = Rand()*400.0 +100.0 +25.0*skill;
+ /* Reserve unocupied corners */
+ if (game.quad[1][1]==IHDOT) game.quad[1][1] = 'X';
+ if (game.quad[1][QUADSIZE]==IHDOT) game.quad[1][QUADSIZE] = 'X';
+ if (game.quad[QUADSIZE][1]==IHDOT) game.quad[QUADSIZE][1] = 'X';
+ if (game.quad[QUADSIZE][QUADSIZE]==IHDOT) game.quad[QUADSIZE][QUADSIZE] = 'X';
+ }
+ }
+
+ sortkl();
+
+ // Put in a few black holes
+ for (i = 1; i <= 3; i++)
+ if (Rand() > 0.5)
+ dropin(IHBLANK, &ix, &iy);
+
+ // Take out X's in corners if Tholian present
+ if (ithere) {
+ if (game.quad[1][1]=='X') game.quad[1][1] = IHDOT;
+ if (game.quad[1][QUADSIZE]=='X') game.quad[1][QUADSIZE] = IHDOT;
+ if (game.quad[QUADSIZE][1]=='X') game.quad[QUADSIZE][1] = IHDOT;
+ if (game.quad[QUADSIZE][QUADSIZE]=='X') game.quad[QUADSIZE][QUADSIZE] = IHDOT;
+ }