X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=src%2Fbattle.c;h=78baae9eab970dbf4a127991fbf873c154c63937;hp=8f45cfbcf682f4a44568a23d08953d331d454082;hb=e56967f9f71423371cfe28a2ffa246a89042d531;hpb=321425c10831f63599c41c31e9d42bc4ec8001d0 diff --git a/src/battle.c b/src/battle.c index 8f45cfb..78baae9 100644 --- a/src/battle.c +++ b/src/battle.c @@ -239,8 +239,8 @@ void ram(bool ibumpd, feature ienm, coord w) } game.shldup = false; prout(_("***Shields are down.")); - if (KLINGREM) { - pause_game(true); + if (game.state.remkl + game.state.remcom + game.state.nscrem) { + announce(); damagereport(); } else @@ -399,7 +399,7 @@ void torpedo(double course, double r, coord in, double *hit, int i, int n) prout(_(" destroyed.")); game.state.nplankl++; q->planet = NOPLANET; - DESTROY(&game.state.planets[game.iplnet]); + game.state.planets[game.iplnet].pclass = destroyed; game.iplnet = 0; invalidate(game.plnet); game.quad[w.x][w.y] = IHDOT; @@ -413,7 +413,7 @@ void torpedo(double course, double r, coord in, double *hit, int i, int n) prout(_(" destroyed.")); game.state.nworldkl++; q->planet = NOPLANET; - DESTROY(&game.state.planets[game.iplnet]); + game.state.planets[game.iplnet].pclass = destroyed; game.iplnet = 0; invalidate(game.plnet); game.quad[w.x][w.y] = IHDOT; @@ -639,7 +639,7 @@ void attack(bool torps_ok) r = (Rand()+Rand())*0.5 -0.5; r += 0.002*game.kpower[loop]*r; torpedo(course, r, jay, &hit, 1, 1); - if (KLINGREM==0) + if ((game.state.remkl + game.state.remcom + game.state.nscrem)==0) finish(FWON); /* Klingons did themselves in! */ if (game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova || game.alldone) return; /* Supernova or finished */ @@ -789,10 +789,11 @@ void deadkl(coord w, feature type, coord mv) /* For each kind of enemy, finish message to player */ prout(_(" destroyed.")); game.quad[w.x][w.y] = IHDOT; - if (KLINGREM==0) + if ((game.state.remkl + game.state.remcom + game.state.nscrem)==0) return; - game.state.remtime = game.state.remres/(game.state.remkl + 4*game.state.remcom); + game.state.remtime = game.state.remkl + game.state.remcom > 0 ? + game.state.remres/(game.state.remkl + 4*game.state.remcom) : 99; /* Remove enemy ship from arrays describing local conditions */ if (is_scheduled(FCDBAS) && same(game.battle, game.quadrant) && type==IHC) @@ -966,7 +967,7 @@ void photon(void) if (game.alldone || game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova) return; } - if (KLINGREM==0) + if ((game.state.remkl + game.state.remcom + game.state.nscrem)==0) finish(FWON); } @@ -1368,7 +1369,7 @@ void hittem(double *hits) skip(1); if (kpow == 0) { deadkl(w, ienm, w); - if (KLINGREM==0) + if ((game.state.remkl + game.state.remcom + game.state.nscrem)==0) finish(FWON); if (game.alldone) return;