static void getcd(bool, int);
-void imove(void)
-/* movement execution for warp, impule, supernova, and tractor-beam events */
+void imove(bool novapush)
+/* movement execution for warp, impulse, supernova, and tractor-beam events */
{
double angle, deltax, deltay, bigger, x, y,
finald, stopegy, probf;
if (!VALID_SECTOR(w.x, w.y)) {
/* Leaving quadrant -- allow final enemy attack */
/* Don't do it if being pushed by Nova */
- if (game.nenhere != 0 && game.iattak != 2) {
+ if (game.nenhere != 0 && !novapush) {
newcnd();
for_local_enemies(m) {
finald = distance(w, game.ks[m]);
game.kdist[m] = finald;
}
sortkl();
- if (!game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova && game.iattak == 0)
+ if (!game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova)
attack(false);
for_local_enemies(m) game.kavgd[m] = game.kdist[m];
}
newcnd();
- game.iattak = 0;
drawmaps(0);
setwnd(message_window);
return;
prout(_("You must first leave standard orbit."));
return;
}
- if (game.base.x==0 || abs(game.sector.x-game.base.x) > 1 || abs(game.sector.y-game.base.y) > 1) {
+ if (!is_valid(game.base) || abs(game.sector.x-game.base.x) > 1 || abs(game.sector.y-game.base.y) > 1) {
crmshp();
prout(_(" not adjacent to base."));
return;
if (ja() == false) return;
}
/* Activate impulse engines and pay the cost */
- imove();
+ imove(false);
game.ididit = true;
if (game.alldone) return;
power = 20.0 + 100.0*game.dist;
/* Activate Warp Engines and pay the cost */
- imove();
+ imove(false);
if (game.alldone) return;
game.energy -= game.dist*game.warpfac*game.warpfac*game.warpfac*(game.shldup+1);
if (game.energy <= 0) finish(FNRG);
game.isatb = 0;
unschedule(FCDBAS);
unschedule(FSCDBAS);
- game.battle.x = game.battle.y = 0;
+ invalidate(game.battle);
/* Make sure Galileo is consistant -- Snapshot may have been taken
when on planet, which would give us two Galileos! */
/* dematerialize starship */
game.quad[game.sector.x][game.sector.y]=IHDOT;
proutn(_("Starbase in %s responds--"), cramlc(quadrant, game.quadrant));
- proutn("");
crmshp();
prout(_(" dematerializes."));
game.sector.x=0;
break;
}
}
- if (game.sector.x==0){
+ if (!is_valid(game.sector)){
prout(_("You have been lost in space..."));
finish(FMATERIALIZE);
return;
return;
}
if (game.landed) {
- prout(_("You must be aboard the Enterprise."));
+ prout(_("You must be aboard the ship."));
return;
}
if (game.iscraft != onship) {
prout(_("Remainder of ship's complement beam down"));
prout(_("to %s."), systnames[q->planet]);
} else {
- prout(_("Entire crew of %d left to die in outer space."));
+ prout(_("Entire crew of %d left to die in outer space."),
+ game.state.crew);
game.casual += game.state.crew;
game.abandoned += game.state.crew;
}