X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=src%2Fmoving.c;h=8495cd0d1063b2576e1bc4905891327e038ba130;hp=534c13f1e9277c63d2f3d3fd840b0db399ce573a;hb=c2847bb7511b0cf8472ba3a0a170a4fedd3b2861;hpb=c4d3d7faa3e4fe1acd11997d0a600b0e2ca93107 diff --git a/src/moving.c b/src/moving.c index 534c13f..8495cd0 100644 --- a/src/moving.c +++ b/src/moving.c @@ -4,8 +4,8 @@ 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; @@ -51,7 +51,7 @@ void imove(void) 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]); @@ -197,12 +197,11 @@ no_quad_change: 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; @@ -220,7 +219,7 @@ void dock(bool verbose) 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; @@ -477,7 +476,7 @@ void impuls(void) 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; @@ -605,7 +604,7 @@ void warp(bool timewarp) /* 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); @@ -794,7 +793,7 @@ void timwrp() 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! */ @@ -974,7 +973,6 @@ void mayday(void) /* 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; @@ -988,7 +986,7 @@ void mayday(void) break; } } - if (game.sector.x==0){ + if (!is_valid(game.sector)){ prout(_("You have been lost in space...")); finish(FMATERIALIZE); return; @@ -1084,7 +1082,7 @@ void abandn(void) return; } if (game.landed) { - prout(_("You must be aboard the Enterprise.")); + prout(_("You must be aboard the ship.")); return; } if (game.iscraft != onship) { @@ -1112,7 +1110,8 @@ void abandn(void) 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; }