game.state.galaxy[iq.x][iq.y].supernova ||
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 (ienm == IHR)
+ return false; /* Romulans cannot escape! */
if (!irun) {
/* avoid intruding on another commander's territory */
if (ienm == IHC) {
*/
forces = game.kpower[loccom]+100.0*game.nenhere+400*(nbaddys-1);
- if (!game.shldup) forces += 1000; /* Good for enemy if shield is down! */
+ if (!game.shldup)
+ forces += 1000; /* Good for enemy if shield is down! */
if (!damaged(DPHASER) || !damaged(DPHOTON)) {
if (damaged(DPHASER)) /* phasers damaged */
forces += 300.0;
}
/* calculate preferred number of steps */
nsteps = motion < 0 ? -motion : motion;
- if (motion > 0 && nsteps > mdist) nsteps = mdist; /* don't overshoot */
- if (nsteps > QUADSIZE) nsteps = QUADSIZE; /* This shouldn't be necessary */
- if (nsteps < 1) nsteps = 1; /* This shouldn't be necessary */
+ if (motion > 0 && nsteps > mdist)
+ nsteps = mdist; /* don't overshoot */
+ if (nsteps > QUADSIZE)
+ nsteps = QUADSIZE; /* This shouldn't be necessary */
+ if (nsteps < 1)
+ nsteps = 1; /* This shouldn't be necessary */
if (idebug) {
proutn("NSTEPS = %d:", nsteps);
}
}
void moveklings(void)
-/* move a commander */
+/* Klingon tactical movement */
{
coord w;
int i;
movebaddy(w, i, game.quad[w.x][w.y]);
}
- sortkl();
+ sortklings();
}
static bool movescom(coord iq, bool flag)
game.nenhere--;
if (game.condition!=docked)
newcnd();
- sortkl();
+ sortklings();
}
/* check for a helpful planet */
for (i = 0; i < game.inplan; i++) {
return false; /* looks good! */
}
-void scom(void)
+void supercommander(void)
/* move the Super Commander */
{
int i, i2, j, ideltax, ideltay, ifindit, iwhichb;
bool flag;
if (idebug)
- prout("== SCOM");
+ prout("== SUPERCOMMANDER");
/* Decide on being active or passive */
flag = ((NKILLC+NKILLK)/(game.state.date+0.01-game.indate) < 0.1*game.skill*(game.skill+1.0) ||
break;
}
}
- if (ifindit==0) return; /* Nothing suitable -- wait until next time*/
+ if (ifindit==0)
+ return; /* Nothing suitable -- wait until next time*/
ibq = game.state.baseq[iwhichb];
/* decide how to move toward base */
ideltax = ibq.x - game.state.kscmdr.x;
ibq = game.state.baseq[i];
if (same(ibq, game.state.kscmdr) && same(game.state.kscmdr, game.battle)) {
/* attack the base */
- if (flag) return; /* no, don't attack base! */
+ if (flag)
+ return; /* no, don't attack base! */
game.iseenit = false;
game.isatb = 1;
schedule(FSCDBAS, 1.0 +2.0*Rand());
return;
}
-void movetho(void)
+void movetholian(void)
/* move the Tholian */
{
int idx, idy, im, i;
- /* Move the Tholian */
if (!game.ithere || game.justin)
return;