}
/* print escape message and move out of quadrant.
We know this if either short or long range sensors are working */
}
/* print escape message and move out of quadrant.
We know this if either short or long range sensors are working */
- crmena(1, ienm, 2, game.ks[loccom]);
+ crmena(1, ienm, sector, game.ks[loccom]);
game.state.galaxy[game.quadrant.x][game.quadrant.y].klingons--;
game.state.galaxy[iq.x][iq.y].klingons++;
if (ienm==IHS) {
game.state.galaxy[game.quadrant.x][game.quadrant.y].klingons--;
game.state.galaxy[iq.x][iq.y].klingons++;
if (ienm==IHS) {
forces = game.kpower[loccom]+100.0*game.nenhere+400*(nbaddys-1);
if (!game.shldup) forces += 1000; /* Good for enemy if shield is down! */
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.damage[DPHASER] == 0.0 || game.damage[DPHOTON] == 0.0) {
- if (game.damage[DPHASER] != 0) /* phasers damaged */
+ if (!damaged(DPHASER) || !damaged(DPHOTON)) {
+ if (damaged(DPHASER)) /* phasers damaged */
- game.kdist[loccom] = game.kavgd[loccom] =
- sqrt(square(game.sector.x-next.x)+square(game.sector.y-next.y));
- if (game.damage[DSRSENS] == 0 || game.condit == IHDOCKED) {
+ game.kdist[loccom] = game.kavgd[loccom] = distance(game.sector, next);
+ if (!damaged(DSRSENS) || game.condit == IHDOCKED) {
/* destroy the planet */
DESTROY(&game.state.plnets[i]);
game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].planet = NOPLANET;
/* destroy the planet */
DESTROY(&game.state.plnets[i]);
game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].planet = NOPLANET;
if (*ipage==0) pause_game(1);
*ipage = 1;
prout(_("Lt. Uhura- \"Captain, Starfleet Intelligence reports"));
if (*ipage==0) pause_game(1);
*ipage = 1;
prout(_("Lt. Uhura- \"Captain, Starfleet Intelligence reports"));
- ibq.x = game.state.baseq[i].x;
- ibq.y = game.state.baseq[i].y;
- bdist[i] = sqrt(square(ibq.x-sc.x) + square(ibq.y-sc.y));
+ bdist[i] = distance(game.state.baseq[i], sc);
schedule(FSCDBAS, 1.0 +2.0*Rand());
if (is_scheduled(FCDBAS))
postpone(FSCDBAS, scheduled(FCDBAS)-game.state.date);
schedule(FSCDBAS, 1.0 +2.0*Rand());
if (is_scheduled(FCDBAS))
postpone(FSCDBAS, scheduled(FCDBAS)-game.state.date);
(int)scheduled(FSCDBAS));
if (!game.resting) return;
prout(_("Mr. Spock- \"Captain, shall we cancel the rest period?\""));
(int)scheduled(FSCDBAS));
if (!game.resting) return;
prout(_("Mr. Spock- \"Captain, shall we cancel the rest period?\""));
- dropin(IHBLANK, &dummy);
- crmena(1,IHT, 2, game.tholian);
+ dropin(IHBLANK);
+ crmena(true, IHT, sector, game.tholian);