- if ((iqx==quadx && iqy==quady) ||
- iqx < 1 || iqx > GALSIZE || iqy < 1 || iqy > GALSIZE ||
- game.state.galaxy[iqx][iqy] > 899) return 1;
- if (flag) {
- /* Avoid quadrants with bases if we want to avoid Enterprise */
- for (i = 1; i <= game.state.rembase; i++)
- if (game.state.baseqx[i]==iqx && game.state.baseqy[i]==iqy) return 1;
- }
- if (justin && !iscate) return 1;
- /* do the move */
- game.state.galaxy[game.state.isx][game.state.isy] -= 100;
- game.state.isx = iqx;
- game.state.isy = iqy;
- game.state.galaxy[game.state.isx][game.state.isy] += 100;
- if (ishere) {
- /* SC has scooted, Remove him from current quadrant */
- iscate=0;
- isatb=0;
- ishere=0;
- ientesc=0;
- game.future[FSCDBAS]=1e30;
- for (i = 1; i <= nenhere; i++)
- if (game.quad[game.kx[i]][game.ky[i]] == IHS) break;
- game.quad[game.kx[i]][game.ky[i]] = IHDOT;
- game.kx[i] = game.kx[nenhere];
- game.ky[i] = game.ky[nenhere];
- game.kdist[i] = game.kdist[nenhere];
- game.kavgd[i] = game.kavgd[nenhere];
- game.kpower[i] = game.kpower[nenhere];
- klhere--;
- nenhere--;
- if (condit!=IHDOCKED) newcnd();
- sortkl();
- }
- /* check for a helpful planet */
- for (i = 0; i < inplan; i++) {
- if (game.state.plnets[i].x==game.state.isx && game.state.plnets[i].y==game.state.isy &&
- game.state.plnets[i].crystals == 1) {
- /* destroy the planet */
- DESTROY(&game.state.plnets[i]);
- game.state.newstuf[game.state.isx][game.state.isy] -= 1;
- if (game.damage[DRADIO] == 0.0 || condit == IHDOCKED) {
- if (*ipage==0) pause_game(1);
- *ipage = 1;
- prout("Lt. Uhura- \"Captain, Starfleet Intelligence reports");
- proutn(" a planet in ");
- proutn(cramlc(quadrant, game.state.isx, game.state.isy));
- prout(" has been destroyed");
- prout(" by the Super-commander.\"");
- }
- break;
- }
+ if ((iqx==quadx && iqy==quady) ||
+ !VALID_QUADRANT(iqx, iqy) ||
+ game.state.galaxy[iqx][iqy].supernova ||
+ game.state.galaxy[iqx][iqy].klingons > 8)
+ return 1;
+ if (flag) {
+ /* Avoid quadrants with bases if we want to avoid Enterprise */
+ for (i = 1; i <= game.state.rembase; i++)
+ if (game.state.baseqx[i]==iqx && game.state.baseqy[i]==iqy) return 1;
+ }
+ if (justin && !iscate) return 1;
+ /* do the move */
+ game.state.galaxy[game.state.isx][game.state.isy].klingons--;
+ game.state.isx = iqx;
+ game.state.isy = iqy;
+ game.state.galaxy[game.state.isx][game.state.isy].klingons++;
+ if (ishere) {
+ /* SC has scooted, Remove him from current quadrant */
+ iscate=0;
+ isatb=0;
+ ishere=0;
+ ientesc=0;
+ game.future[FSCDBAS]=1e30;
+ for (i = 1; i <= nenhere; i++)
+ if (game.quad[game.kx[i]][game.ky[i]] == IHS) break;
+ game.quad[game.kx[i]][game.ky[i]] = IHDOT;
+ game.kx[i] = game.kx[nenhere];
+ game.ky[i] = game.ky[nenhere];
+ game.kdist[i] = game.kdist[nenhere];
+ game.kavgd[i] = game.kavgd[nenhere];
+ game.kpower[i] = game.kpower[nenhere];
+ klhere--;
+ nenhere--;
+ if (condit!=IHDOCKED) newcnd();
+ sortkl();
+ }
+ /* check for a helpful planet */
+ for (i = 0; i < inplan; i++) {
+ if (game.state.plnets[i].x==game.state.isx && game.state.plnets[i].y==game.state.isy &&
+ game.state.plnets[i].crystals == 1) {
+ /* destroy the planet */
+ DESTROY(&game.state.plnets[i]);
+ game.state.galaxy[game.state.isx][game.state.isy].planets -= 1;
+ if (game.damage[DRADIO] == 0.0 || condit == IHDOCKED) {
+ if (*ipage==0) pause_game(1);
+ *ipage = 1;
+ prout("Lt. Uhura- \"Captain, Starfleet Intelligence reports");
+ proutn(" a planet in ");
+ proutn(cramlc(quadrant, game.state.isx, game.state.isy));
+ prout(" has been destroyed");
+ prout(" by the Super-commander.\"");
+ }
+ break;