5 int ictbeam=0, ipage=0, istract=0, line, i=0, j, k, l, ixhold=0, iyhold=0;
\r
6 double fintim = game.state.date + Time, datemin, xtime, repair, yank=0;
\r
9 if (idebug) prout("EVENTS");
\r
12 if (stdamtim == 1e30 && game.damage[DRADIO] != 0.0) {
\r
13 /* chart will no longer be updated because radio is dead */
\r
14 stdamtim = game.state.date;
\r
15 for (i=1; i <= 8 ; i++)
\r
16 for (j=1; j <= 8; j++)
\r
17 if (game.starch[i][j] == 1) game.starch[i][j] = game.state.galaxy[i][j]+1000;
\r
21 /* Select earliest extraneous event, line==0 if no events */
\r
23 if (alldone) return;
\r
25 for (l=1; l<=NEVENTS; l++)
\r
26 if (game.future[l] < datemin) {
\r
28 datemin = game.future[l];
\r
30 xtime = datemin-game.state.date;
\r
31 game.state.date = datemin;
\r
32 /* Decrement Federation resources and recompute remaining time */
\r
33 game.state.remres -= (game.state.remkl+4*game.state.remcom)*xtime;
\r
34 game.state.remtime = game.state.remres/(game.state.remkl+4*game.state.remcom);
\r
35 if (game.state.remtime <=0) {
\r
39 /* Is life support adequate? */
\r
40 if (game.damage[DLIFSUP] && condit != IHDOCKED) {
\r
41 if (lsupres < xtime && game.damage[DLIFSUP] > lsupres) {
\r
46 if (game.damage[DLIFSUP] <= xtime) lsupres = inlsr;
\r
50 if (condit == IHDOCKED) repair /= docfac;
\r
51 /* Don't fix Deathray here */
\r
52 for (l=1; l<=NDEVICES; l++)
\r
53 if (game.damage[l] > 0.0 && l != DDRAY)
\r
54 game.damage[l] -= (game.damage[l]-repair > 0.0 ? repair : game.damage[l]);
\r
55 /* If radio repaired, update star chart and attack reports */
\r
56 if (stdamtim != 1e30 && game.damage[DRADIO] == 0.0) {
\r
58 prout("Lt. Uhura- \"Captain, the sub-space radio is working and");
\r
59 prout(" surveillance reports are coming in.");
\r
61 for (i=1; i <= 8 ; i++)
\r
62 for (j=1; j <= 8; j++)
\r
63 if (game.starch[i][j] > 999) game.starch[i][j] = 1;
\r
69 prout(" The star chart is now up to date.\"");
\r
72 /* Cause extraneous event LINE to occur */
\r
75 case FSNOVA: /* Supernova */
\r
76 if (ipage==0) pause_game(1);
\r
79 game.future[FSNOVA] = game.state.date + expran(0.5*intime);
\r
80 if (game.state.galaxy[quadx][quady] == 1000) return;
\r
82 case FSPY: /* Check with spy to see if S.C. should tractor beam */
\r
83 if (game.state.nscrem == 0 ||
\r
84 ictbeam+istract > 0 ||
\r
85 condit==IHDOCKED || isatb==1 || iscate==1) return;
\r
87 (energy < 2000 && torps < 4 && shield < 1250) ||
\r
88 (game.damage[DPHASER]>0 && (game.damage[DPHOTON]>0 || torps < 4)) ||
\r
89 (game.damage[DSHIELD] > 0 &&
\r
90 (energy < 2500 || game.damage[DPHASER] > 0) &&
\r
91 (torps < 5 || game.damage[DPHOTON] > 0))) {
\r
92 /* Tractor-beam her! */
\r
94 yank = square(game.state.isx-quadx) + square(game.state.isy-quady);
\r
95 /*********TBEAM CODE***********/
\r
98 case FTBEAM: /* Tractor beam */
\r
100 if (game.state.remcom == 0) {
\r
101 game.future[FTBEAM] = 1e30;
\r
104 i = Rand()*game.state.remcom+1.0;
\r
105 yank = square(game.state.cx[i]-quadx) + square(game.state.cy[i]-quady);
\r
106 if (istract || condit == IHDOCKED || yank == 0) {
\r
107 /* Drats! Have to reschedule */
\r
108 game.future[FTBEAM] = game.state.date + Time +
\r
109 expran(1.5*intime/game.state.remcom);
\r
113 /* tractor beaming cases merge here */
\r
115 if (ipage==0) pause_game(1);
\r
117 Time = (10.0/(7.5*7.5))*yank; /* 7.5 is yank rate (warp 7.5) */
\r
122 prout(" caught in long range tractor beam--");
\r
123 /* If Kirk & Co. screwing around on planet, handle */
\r
124 atover(1); /* atover(1) is Grab */
\r
125 if (alldone) return;
\r
126 if (icraft == 1) { /* Caught in Galileo? */
\r
130 /* Check to see if shuttle is aboard */
\r
134 prout("Galileo, left on the planet surface, is captured");
\r
135 prout("by aliens and made into a flying McDonald's.");
\r
136 game.damage[DSHUTTL] = -10;
\r
140 prout("Galileo, left on the planet surface, is well hidden.");
\r
144 quadx = game.state.isx;
\r
145 quady = game.state.isy;
\r
148 quadx = game.state.cx[i];
\r
149 quady = game.state.cy[i];
\r
151 iran10(§x, §y);
\r
153 proutn(" is pulled to ");
\r
154 proutn(cramlc(quadrant, quadx, quady));
\r
156 prout(cramlc(sector, sectx, secty));
\r
158 prout("(Remainder of rest/repair period cancellegame.state.)");
\r
162 if (game.damage[DSHIELD]==0 && shield > 0) {
\r
163 doshield(2); /* Shldsup */
\r
166 else prout("(Shields not currently useable.)");
\r
169 /* Adjust finish time to time of tractor beaming */
\r
170 fintim = game.state.date+Time;
\r
172 if (game.state.remcom <= 0) game.future[FTBEAM] = 1e30;
\r
173 else game.future[FTBEAM] = game.state.date+Time+expran(1.5*intime/game.state.remcom);
\r
175 case FSNAP: /* Snapshot of the universe (for time warp) */
\r
176 game.snapsht = game.state;
\r
177 game.state.snap = 1;
\r
178 game.future[FSNAP] = game.state.date + expran(0.5 * intime);
\r
180 case FBATTAK: /* Commander attacks starbase */
\r
181 if (game.state.remcom==0 || game.state.rembase==0) {
\r
183 game.future[FBATTAK] = game.future[FCDBAS] = 1e30;
\r
187 for (j=1; j<=game.state.rembase; j++) {
\r
188 for (k=1; k<=game.state.remcom; k++)
\r
189 if (game.state.baseqx[j]==game.state.cx[k] && game.state.baseqy[j]==game.state.cy[k] &&
\r
190 (game.state.baseqx[j]!=quadx || game.state.baseqy[j]!=quady) &&
\r
191 (game.state.baseqx[j]!=game.state.isx || game.state.baseqy[j]!=game.state.isy)) {
\r
197 if (j>game.state.rembase) {
\r
198 /* no match found -- try later */
\r
199 game.future[FBATTAK] = game.state.date + expran(0.3*intime);
\r
200 game.future[FCDBAS] = 1e30;
\r
203 /* commander + starbase combination found -- launch attack */
\r
204 batx = game.state.baseqx[j];
\r
205 baty = game.state.baseqy[j];
\r
206 game.future[FCDBAS] = game.state.date+1.0+3.0*Rand();
\r
207 if (isatb) /* extra time if SC already attacking */
\r
208 game.future[FCDBAS] += game.future[FSCDBAS]-game.state.date;
\r
209 game.future[FBATTAK] = game.future[FCDBAS] +expran(0.3*intime);
\r
211 if (game.damage[DRADIO] != 0.0 &&
\r
212 condit != IHDOCKED) break; /* No warning :-( */
\r
214 if (ipage==0) pause_game(1);
\r
217 proutn("Lt. Uhura- \"Captain, the starbase in ");
\r
218 prout(cramlc(quadrant, batx, baty));
\r
219 prout(" reports that it is under attack and that it can");
\r
220 proutn(" hold out only until stardate %d",
\r
221 (int)game.future[FCDBAS]);
\r
225 proutn("Mr. Spock- \"Captain, shall we cancel the rest period?\" ");
\r
233 case FSCDBAS: /* Supercommander destroys base */
\r
234 game.future[FSCDBAS] = 1e30;
\r
236 if (game.state.galaxy[game.state.isx][game.state.isy]%100 < 10) break; /* WAS RETURN! */
\r
239 batx = game.state.isx;
\r
240 baty = game.state.isy;
\r
241 case FCDBAS: /* Commander succeeds in destroying base */
\r
242 if (line==FCDBAS) {
\r
243 game.future[FCDBAS] = 1e30;
\r
244 /* find the lucky pair */
\r
245 for (i = 1; i <= game.state.remcom; i++)
\r
246 if (game.state.cx[i]==batx && game.state.cy[i]==baty) break;
\r
247 if (i > game.state.remcom || game.state.rembase == 0 ||
\r
248 game.state.galaxy[batx][baty] % 100 < 10) {
\r
249 /* No action to take after all */
\r
254 /* Code merges here for any commander destroying base */
\r
255 /* Not perfect, but will have to do */
\r
256 if (game.starch[batx][baty] == -1) game.starch[batx][baty] = 0;
\r
257 /* Handle case where base is in same quadrant as starship */
\r
258 if (batx==quadx && baty==quady) {
\r
259 if (game.starch[batx][baty] > 999) game.starch[batx][baty] -= 10;
\r
260 game.quad[basex][basey]= IHDOT;
\r
264 prout("Spock- \"Captain, I believe the starbase has been destroyegame.state.\"");
\r
266 else if (game.state.rembase != 1 &&
\r
267 (game.damage[DRADIO] <= 0.0 || condit == IHDOCKED)) {
\r
268 /* Get word via subspace radio */
\r
269 if (ipage==0) pause_game(1);
\r
272 prout("Lt. Uhura- \"Captain, Starfleet Command reports that");
\r
273 proutn(" the starbase in ");
\r
274 proutn(cramlc(quadrant, batx, baty));
\r
275 prout(" has been destroyed by");
\r
276 if (isatb==2) prout("the Klingon Super-Commander");
\r
277 else prout("a Klingon Commander");
\r
279 /* Remove Starbase from galaxy */
\r
280 game.state.galaxy[batx][baty] -= 10;
\r
281 for (i=1; i <= game.state.rembase; i++)
\r
282 if (game.state.baseqx[i]==batx && game.state.baseqy[i]==baty) {
\r
283 game.state.baseqx[i]=game.state.baseqx[game.state.rembase];
\r
284 game.state.baseqy[i]=game.state.baseqy[game.state.rembase];
\r
286 game.state.rembase--;
\r
288 /* reinstate a commander's base attack */
\r
297 case FSCMOVE: /* Supercommander moves */
\r
298 game.future[FSCMOVE] = game.state.date+0.2777;
\r
299 if (ientesc+istract==0 &&
\r
301 (iscate!=1 || justin==1)) scom(&ipage);
\r
303 case FDSPROB: /* Move deep space probe */
\r
304 game.future[FDSPROB] = game.state.date + 0.01;
\r
305 probex += probeinx;
\r
306 probey += probeiny;
\r
307 i = (int)(probex/10 +0.05);
\r
308 j = (int)(probey/10 + 0.05);
\r
309 if (probecx != i || probecy != j) {
\r
312 if (i < 1 || i > 8 || j < 1 || j > 8 ||
\r
313 game.state.galaxy[probecx][probecy] == 1000) {
\r
314 // Left galaxy or ran into supernova
\r
315 if (game.damage[DRADIO]==0.0 || condit == IHDOCKED) {
\r
316 if (ipage==0) pause_game(1);
\r
319 proutn("Lt. Uhura- \"The deep space probe ");
\r
320 if (i < 1 ||i > 8 || j < 1 || j > 8)
\r
321 proutn("has left the galaxy");
\r
323 proutn("is no longer transmitting");
\r
326 game.future[FDSPROB] = 1e30;
\r
329 if (game.damage[DRADIO]==0.0 || condit == IHDOCKED) {
\r
330 if (ipage==0) pause_game(1);
\r
333 proutn("Lt. Uhura- \"The deep space probe is now in ");
\r
334 proutn(cramlc(quadrant, probecx, probecy));
\r
338 /* Update star chart if Radio is working or have access to
\r
340 if (game.damage[DRADIO] == 0.0 || condit == IHDOCKED)
\r
341 game.starch[probecx][probecy] = game.damage[DRADIO] > 0.0 ?
\r
342 game.state.galaxy[probecx][probecy]+1000 : 1;
\r
343 proben--; // One less to travel
\r
344 if (proben == 0 && isarmed &&
\r
345 game.state.galaxy[probecx][probecy] % 10 > 0) {
\r
346 /* lets blow the sucker! */
\r
348 game.future[FDSPROB] = 1e30;
\r
349 if (game.state.galaxy[quadx][quady] == 1000) return;
\r
359 double temp, delay, origTime;
\r
364 if (key != IHEOL) break;
\r
365 proutn("How long? ");
\r
368 if (key != IHREAL) {
\r
372 origTime = delay = aaitem;
\r
373 if (delay <= 0.0) return;
\r
374 if (delay >= game.state.remtime || nenhere != 0) {
\r
375 proutn("Are you sure? ");
\r
376 if (ja() == 0) return;
\r
379 /* Alternate resting periods (events) with attacks */
\r
383 if (delay <= 0) resting = 0;
\r
384 if (resting == 0) {
\r
385 prout("%d stardates left.", (int)game.state.remtime);
\r
388 temp = Time = delay;
\r
391 double rtime = 1.0 + Rand();
\r
392 if (rtime < temp) temp = rtime;
\r
395 if (Time < delay) attack(0);
\r
396 if (alldone) return;
\r
399 if (alldone) return;
\r
401 /* Repair Deathray if long rest at starbase */
\r
402 if (origTime-delay >= 9.99 && condit == IHDOCKED)
\r
403 game.damage[DDRAY] = 0.0;
\r
404 } while (game.state.galaxy[quadx][quady] != 1000); // leave if quadrant supernovas
\r
410 void nova(int ix, int iy) {
\r
411 static double course[] =
\r
412 {0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5};
\r
413 int bot, top, top2, hits[11][3], kount, icx, icy, mm, nn, j;
\r
414 int iquad, iquad1, i, ll, newcx, newcy, ii, jj;
\r
415 if (Rand() < 0.05) {
\r
416 /* Wow! We've supernova'ed */
\r
421 /* handle initial nova */
\r
422 game.quad[ix][iy] = IHDOT;
\r
423 crmena(1, IHSTAR, 2, ix, iy);
\r
425 game.state.galaxy[quadx][quady] -= 1;
\r
426 game.state.starkl++;
\r
428 /* Set up stack to recursively trigger adjacent stars */
\r
429 bot = top = top2 = 1;
\r
435 for (mm = bot; mm <= top; mm++)
\r
436 for (nn = 1; nn <= 3; nn++) /* nn,j represents coordinates around current */
\r
437 for (j = 1; j <= 3; j++) {
\r
438 if (j==2 && nn== 2) continue;
\r
439 ii = hits[mm][1]+nn-2;
\r
440 jj = hits[mm][2]+j-2;
\r
441 if (ii < 1 || ii > 10 || jj < 1 || jj > 10) continue;
\r
442 iquad = game.quad[ii][jj];
\r
444 // case IHDOT: /* Empty space ends reaction
\r
451 case IHSTAR: /* Affect another star */
\r
452 if (Rand() < 0.05) {
\r
453 /* This star supernovas */
\r
460 game.state.galaxy[quadx][quady] -= 1;
\r
461 game.state.starkl++;
\r
462 crmena(1, IHSTAR, 2, ii, jj);
\r
464 game.quad[ii][jj] = IHDOT;
\r
466 case IHP: /* Destroy planet */
\r
467 game.state.newstuf[quadx][quady] -= 1;
\r
468 game.state.nplankl++;
\r
469 crmena(1, IHP, 2, ii, jj);
\r
470 prout(" destroyed.");
\r
471 DESTROY(&game.state.plnets[iplnet]);
\r
472 iplnet = plnetx = plnety = 0;
\r
477 game.quad[ii][jj] = IHDOT;
\r
479 case IHB: /* Destroy base */
\r
480 game.state.galaxy[quadx][quady] -= 10;
\r
481 for (i = 1; i <= game.state.rembase; i++)
\r
482 if (game.state.baseqx[i]==quadx && game.state.baseqy[i]==quady) break;
\r
483 game.state.baseqx[i] = game.state.baseqx[game.state.rembase];
\r
484 game.state.baseqy[i] = game.state.baseqy[game.state.rembase];
\r
485 game.state.rembase--;
\r
487 game.state.basekl++;
\r
489 crmena(1, IHB, 2, ii, jj);
\r
490 prout(" destroyed.");
\r
491 game.quad[ii][jj] = IHDOT;
\r
493 case IHE: /* Buffet ship */
\r
495 prout("***Starship buffeted by nova.");
\r
497 if (shield >= 2000.0) shield -= 2000.0;
\r
499 double diff = 2000.0 - shield;
\r
503 prout("***Shields knocked out.");
\r
504 game.damage[DSHIELD] += 0.005*damfac*Rand()*diff;
\r
507 else energy -= 2000.0;
\r
512 /* add in course nova contributes to kicking starship*/
\r
513 icx += sectx-hits[mm][1];
\r
514 icy += secty-hits[mm][2];
\r
517 case IHK: /* kill klingon */
\r
518 deadkl(ii,jj,iquad, ii, jj);
\r
520 case IHC: /* Damage/destroy big enemies */
\r
523 for (ll = 1; ll <= nenhere; ll++)
\r
524 if (game.kx[ll]==ii && game.ky[ll]==jj) break;
\r
525 game.kpower[ll] -= 800.0; /* If firepower is lost, die */
\r
526 if (game.kpower[ll] <= 0.0) {
\r
527 deadkl(ii, jj, iquad, ii, jj);
\r
530 newcx = ii + ii - hits[mm][1];
\r
531 newcy = jj + jj - hits[mm][2];
\r
532 crmena(1, iquad, 2, ii, jj);
\r
533 proutn(" damaged");
\r
534 if (newcx<1 || newcx>10 || newcy<1 || newcy>10) {
\r
535 /* can't leave quadrant */
\r
539 iquad1 = game.quad[newcx][newcy];
\r
540 if (iquad1 == IHBLANK) {
\r
541 proutn(", blasted into ");
\r
542 crmena(0, IHBLANK, 2, newcx, newcy);
\r
544 deadkl(ii, jj, iquad, newcx, newcy);
\r
547 if (iquad1 != IHDOT) {
\r
548 /* can't move into something else */
\r
552 proutn(", buffeted to ");
\r
553 proutn(cramlc(sector, newcx, newcy));
\r
554 game.quad[ii][jj] = IHDOT;
\r
555 game.quad[newcx][newcy] = iquad;
\r
556 game.kx[ll] = newcx;
\r
557 game.ky[ll] = newcy;
\r
558 game.kavgd[ll] = sqrt(square(sectx-newcx)+square(secty-newcy));
\r
559 game.kdist[ll] = game.kavgd[ll];
\r
564 if (top == top2) break;
\r
568 if (kount==0) return;
\r
570 /* Starship affected by nova -- kick it away. */
\r
572 if (icx) icx = (icx < 0 ? -1 : 1);
\r
573 if (icy) icy = (icy < 0 ? -1 : 1);
\r
574 direc = course[3*(icx+1)+icy+2];
\r
575 if (direc == 0.0) dist = 0.0;
\r
576 if (dist == 0.0) return;
\r
577 Time = 10.0*dist/16.0;
\r
579 prout("Force of nova displaces starship.");
\r
580 iattak=2; /* Eliminates recursion problem */
\r
582 Time = 10.0*dist/16.0;
\r
587 void snova(int insx, int insy) {
\r
588 int comdead, nqx=0, nqy=0, nsx, nsy, num, kldead, iscdead;
\r
589 int nrmdead, npdead;
\r
597 /* NOVAMAX being used */
\r
603 /* Scheduled supernova -- select star */
\r
604 /* logic changed here so that we won't favor quadrants in top
\r
605 left of universe */
\r
606 for (nqx = 1; nqx<=8; nqx++) {
\r
607 for (nqy = 1; nqy<=8; nqy++) {
\r
608 stars += game.state.galaxy[nqx][nqy] % 10;
\r
611 if (stars == 0) return; /* nothing to supernova exists */
\r
612 num = Rand()*stars + 1;
\r
613 for (nqx = 1; nqx<=8; nqx++) {
\r
614 for (nqy = 1; nqy<=8; nqy++) {
\r
615 num -= game.state.galaxy[nqx][nqy] % 10;
\r
616 if (num <= 0) break;
\r
618 if (num <=0) break;
\r
622 proutn("Super nova here?");
\r
631 if (nqx != quady || nqy != quady || justin != 0) {
\r
632 /* it isn't here, or we just entered (treat as inroute) */
\r
633 if (game.damage[DRADIO] == 0.0 || condit == IHDOCKED) {
\r
635 prout("Message from Starfleet Command Stardate %.2f", game.state.date);
\r
636 prout(" Supernova in %s; caution advised.",
\r
637 cramlc(quadrant, nqx, nqy));
\r
641 /* we are in the quadrant! */
\r
643 num = Rand()* (game.state.galaxy[nqx][nqy]%10) + 1;
\r
644 for (nsx=1; nsx < 10; nsx++) {
\r
645 for (nsy=1; nsy < 10; nsy++) {
\r
646 if (game.quad[nsx][nsy]==IHSTAR) {
\r
661 prouts("***RED ALERT! RED ALERT!");
\r
663 prout("***Incipient supernova detected at ", cramlc(sector, nsx, nsy));
\r
666 if (square(nsx-sectx) + square(nsy-secty) <= 2.1) {
\r
667 proutn("Emergency override attempts t");
\r
668 prouts("***************");
\r
674 /* destroy any Klingons in supernovaed quadrant */
\r
675 num=game.state.galaxy[nqx][nqy];
\r
677 comdead = iscdead = 0;
\r
678 if (nqx==game.state.isx && nqy == game.state.isy) {
\r
679 /* did in the Supercommander! */
\r
680 game.state.nscrem = game.state.isx = game.state.isy = isatb = iscate = 0;
\r
682 game.future[FSCMOVE] = game.future[FSCDBAS] = 1e30;
\r
684 game.state.remkl -= kldead;
\r
685 if (game.state.remcom) {
\r
686 int maxloop = game.state.remcom, l;
\r
687 for (l = 1; l <= maxloop; l++) {
\r
688 if (game.state.cx[l] == nqx && game.state.cy[l] == nqy) {
\r
689 game.state.cx[l] = game.state.cx[game.state.remcom];
\r
690 game.state.cy[l] = game.state.cy[game.state.remcom];
\r
691 game.state.cx[game.state.remcom] = game.state.cy[game.state.remcom] = 0;
\r
692 game.state.remcom--;
\r
695 if (game.state.remcom==0) game.future[FTBEAM] = 1e30;
\r
700 /* destroy Romulans and planets in supernovaed quadrant */
\r
701 num = game.state.newstuf[nqx][nqy];
\r
702 game.state.newstuf[nqx][nqy] = 0;
\r
704 game.state.nromrem -= nrmdead;
\r
705 npdead = num - nrmdead*10;
\r
708 for (l = 0; l < inplan; l++)
\r
709 if (game.state.plnets[l].x == nqx && game.state.plnets[l].y == nqy) {
\r
710 DESTROY(&game.state.plnets[l]);
\r
713 /* Destroy any base in supernovaed quadrant */
\r
714 if (game.state.rembase) {
\r
715 int maxloop = game.state.rembase, l;
\r
716 for (l = 1; l <= maxloop; l++)
\r
717 if (game.state.baseqx[l]==nqx && game.state.baseqy[l]==nqy) {
\r
718 game.state.baseqx[l] = game.state.baseqx[game.state.rembase];
\r
719 game.state.baseqy[l] = game.state.baseqy[game.state.rembase];
\r
720 game.state.baseqx[game.state.rembase] = game.state.baseqy[game.state.rembase] = 0;
\r
721 game.state.rembase--;
\r
725 /* If starship caused supernova, tally up destruction */
\r
727 num = game.state.galaxy[nqx][nqy] % 100;
\r
728 game.state.starkl += num % 10;
\r
729 game.state.basekl += num/10;
\r
730 game.state.killk += kldead;
\r
731 game.state.killc += comdead;
\r
732 game.state.nromkl += nrmdead;
\r
733 game.state.nplankl += npdead;
\r
734 game.state.nsckill += iscdead;
\r
736 /* mark supernova in galaxy and in star chart */
\r
737 if ((quadx == nqx && quady == nqy) ||
\r
738 game.damage[DRADIO] == 0 ||
\r
739 condit == IHDOCKED)
\r
740 game.starch[nqx][nqy] = 1;
\r
741 game.state.galaxy[nqx][nqy] = 1000;
\r
742 /* If supernova destroys last klingons give special message */
\r
743 if (game.state.remkl==0 && (nqx != quadx || nqy != quady)) {
\r
745 if (insx == 0) prout("Lucky you!");
\r
746 proutn("A supernova in %s has just destroyed the last Klingons.",
\r
747 cramlc(quadrant, nqx, nqy));
\r
751 /* if some Klingons remain, continue or die in supernova */
\r
752 if (alldone) finish(FSNOVAED);
\r