X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fbattle.c;h=343c05a3d1cfe3644712f8205c8923546c8de082;hb=d48a2567098e4d756e0ca9d4b707bcd5867ac6c9;hp=aa5f04a7a85bc405a2119304d81e6c15f82a5ba7;hpb=c8f91a7e3437017d237a3bad0166054b97206d8d;p=super-star-trek.git diff --git a/src/battle.c b/src/battle.c index aa5f04a..343c05a 100644 --- a/src/battle.c +++ b/src/battle.c @@ -318,7 +318,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int i, int crmena(1, iquad, 2, w); prout(_(" destroyed.")); game.state.nplankl++; - game.state.galaxy[game.quadrant.x][game.quadrant.y].planet = NULL; + game.state.galaxy[game.quadrant.x][game.quadrant.y].planet = NOPLANET; DESTROY(&game.state.plnets[game.iplnet]); game.iplnet = 0; game.plnet.x = game.plnet.y = 0; @@ -328,6 +328,22 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int i, int finish(FDPLANET); } return; + case IHW: /* Hit an inhabited world -- very bad! */ + crmena(1, iquad, 2, w); + prout(_(" destroyed.")); + game.state.nworldkl++; + game.state.galaxy[game.quadrant.x][game.quadrant.y].planet = NOPLANET; + DESTROY(&game.state.plnets[game.iplnet]); + game.iplnet = 0; + game.plnet.x = game.plnet.y = 0; + game.quad[w.x][w.y] = IHDOT; + if (game.landed==1) { + /* captain perishes on planet */ + finish(FDPLANET); + } + prout("You have just destroyed an inhabited planet."); + prout("Celebratory rallies are being held on the Klingon homeworld."); + return; case IHSTAR: /* Hit a star */ if (Rand() > 0.10) { nova(w.x, w.y); @@ -469,9 +485,7 @@ void attack(int torps_ok) game.iattak = 1; if (game.alldone) return; -#ifdef DEBUG - if (game.idebug) prout("ATTACK!"); -#endif + if (idebug) prout("=== ATTACK!"); if (game.ithere) movetho();