iq.y = game.quadrant.y+(look.y+(QUADSIZE-1))/QUADSIZE - 1;
if (!VALID_QUADRANT(iq.x,iq.y) ||
game.state.galaxy[iq.x][iq.y].supernova ||
- game.state.galaxy[iq.x][iq.y].klingons > 8)
- return false; /* no can do -- neg energy, supernovae, or >8 Klingons */
+ game.state.galaxy[iq.x][iq.y].klingons > MAXKLQUAD-1)
+ return false; /* no can do -- neg energy, supernovae, or >MAXKLQUAD-1 Klingons */
if (ienm == IHR) return false; /* Romulans cannot escape! */
if (!irun) {
/* avoid intruding on another commander's territory */
motion -= game.skill*(2.0-square(Rand()));
}
if (idebug)
- proutn("=== MOTION = %1.2f, FORCES = %1.2f, ", motion, forces);
+ proutn("=== MOTION = %d, FORCES = %1.2f, ", motion, forces);
/* don't move if no motion */
if (motion==0) return;
/* Limit motion according to skill */
}
if (idebug)
- prout("");
+ skip(1);
/* Put commander in place within same quadrant */
game.quad[com.x][com.y] = IHDOT;
game.quad[next.x][next.y] = ienm;
if (same(iq, game.quadrant) || !VALID_QUADRANT(iq.x, iq.y) ||
game.state.galaxy[iq.x][iq.y].supernova ||
- game.state.galaxy[iq.x][iq.y].klingons > 8)
+ game.state.galaxy[iq.x][iq.y].klingons > MAXKLQUAD-1)
return 1;
if (flag) {
/* Avoid quadrants with bases if we want to avoid Enterprise */
for_starbases(i)
- if (game.state.baseq[i].x==iq.x && game.state.baseq[i].y==iq.y) return 1;
+ if (same(game.state.baseq[i], iq))
+ return true;
}
if (game.justin && !game.iscate) return true;
/* do the move */
}
/* check for a helpful planet */
for (i = 0; i < game.inplan; i++) {
- if (game.state.plnets[i].w.x==game.state.kscmdr.x && game.state.plnets[i].w.y==game.state.kscmdr.y &&
- game.state.plnets[i].crystals == 1) {
+ if (same(game.state.plnets[i].w, game.state.kscmdr) &&
+ game.state.plnets[i].crystals == present) {
/* destroy the planet */
DESTROY(&game.state.plnets[i]);
game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].planet = NOPLANET;
ibq = game.state.baseq[i];
if (same(ibq, game.quadrant) || same(ibq, game.battle) ||
game.state.galaxy[ibq.x][ibq.y].supernova ||
- game.state.galaxy[ibq.x][ibq.y].klingons > 8)
+ game.state.galaxy[ibq.x][ibq.y].klingons > MAXKLQUAD-1)
continue;
/* if there is a commander, an no other base is appropriate,
we will take the one with the commander */