7 /* Finish with a BANG! */
9 if (game.damage[DCOMPTR] != 0.0) {
10 prout(_("Computer damaged; cannot execute destruct sequence."));
13 prouts(_("---WORKING---")); skip(1);
14 prouts(_("SELF-DESTRUCT-SEQUENCE-ACTIVATED")); skip(1);
15 prouts(" 10"); skip(1);
16 prouts(" 9"); skip(1);
17 prouts(" 8"); skip(1);
18 prouts(" 7"); skip(1);
19 prouts(" 6"); skip(1);
21 prout(_("ENTER-CORRECT-PASSWORD-TO-CONTINUE-"));
23 prout(_("SELF-DESTRUCT-SEQUENCE-OTHERWISE-"));
25 prout(_("SELF-DESTRUCT-SEQUENCE-WILL-BE-ABORTED"));
29 if (strcmp(game.passwd, citem) != 0) {
30 prouts(_("PASSWORD-REJECTED;"));
32 prouts(_("CONTINUITY-EFFECTED"));
36 prouts(_("PASSWORD-ACCEPTED")); skip(1);
37 prouts(" 5"); skip(1);
38 prouts(" 4"); skip(1);
39 prouts(" 3"); skip(1);
40 prouts(" 2"); skip(1);
41 prouts(" 1"); skip(1);
43 prouts(_("GOODBYE-CRUEL-WORLD"));
52 if (game.ship==IHE) prouts("***");
53 prouts(_("********* Entropy of "));
55 prouts(_(" maximized *********"));
59 if (game.nenhere != 0) {
60 double whammo = 25.0 * game.energy;
62 while (l <= game.nenhere) {
63 if (game.kpower[l]*game.kdist[l] <= whammo)
64 deadkl(game.ks[l].x,game.ks[l].x, game.quad[game.ks[l].x][game.ks[l].y], game.ks[l].x, game.ks[l].y);
72 void finish(FINTYPE ifin)
77 prout(_("It is stardate %.1f."), game.state.date);
80 case FWON: // Game has been won
81 if (game.state.nromrem != 0)
82 prout(_("The remaining %d Romulans surrender to Starfleet Command."),
85 prout(_("You have smashed the Klingon invasion fleet and saved"));
86 prout(_("the Federation."));
90 badpt = 5.0*game.state.starkl + game.casual + 10.0*game.state.nplankl +
91 45.*game.nhelp+100.*game.state.basekl;
92 if (game.ship == IHF) badpt += 100.0;
93 else if (game.ship == 0) badpt += 200.0;
94 if (badpt < 100.0) badpt = 0.0; // Close enough!
95 if (game.state.date-game.indate < 5.0 ||
96 // killsPerDate >= RateMax
97 KLINGKILLED/(game.state.date-game.indate) >=
98 0.1*game.skill*(game.skill+1.0) + 0.1 + 0.008*badpt) {
100 prout(_("In fact, you have done so well that Starfleet Command"));
101 switch (game.skill) {
103 prout(_("promotes you one step in rank from \"Novice\" to \"Fair\"."));
106 prout(_("promotes you one step in rank from \"Fair\" to \"Good\"."));
109 prout(_("promotes you one step in rank from \"Good\" to \"Expert\"."));
112 prout(_("promotes you to Commodore Emeritus."));
114 prout(_("Now that you think you're really good, try playing"));
115 prout(_("the \"Emeritus\" game. It will splatter your ego."));
119 proutn(_("Computer- "));
120 prouts(_("ERROR-ERROR-ERROR-ERROR"));
122 prouts(_(" YOUR-SKILL-HAS-EXCEEDED-THE-CAPACITY-OF-THIS-PROGRAM"));
124 prouts(_(" THIS-PROGRAM-MUST-SURVIVE"));
126 prouts(_(" THIS-PROGRAM-MUST-SURVIVE"));
128 prouts(_(" THIS-PROGRAM-MUST-SURVIVE"));
130 prouts(_(" THIS-PROGRAM-MUST?- MUST ? - SUR? ? -? VI"));
132 prout(_("Now you can retire and write your own Star Trek game!"));
136 if (game.skill >= SKILL_EXPERT) {
142 prout(_("You cannot get a citation, so..."));
144 proutn(_("Do you want your Commodore Emeritus Citation printed? "));
152 // Only grant long life if alive (original didn't!)
154 prout(_("LIVE LONG AND PROSPER."));
157 if (igotit != 0) plaque();
159 case FDEPLETE: // Federation Resources Depleted
160 prout(_("Your time has run out and the Federation has been"));
161 prout(_("conquered. Your starship is now Klingon property,"));
162 prout(_("and you are put on trial as a war criminal. On the"));
163 proutn(_("basis of your record, you are "));
164 if (KLINGREM*3.0 > INKLINGTOT) {
165 prout(_("acquitted."));
167 prout(_("LIVE LONG AND PROSPER."));
170 prout(_("found guilty and"));
171 prout(_("sentenced to death by slow torture."));
177 prout(_("Your life support reserves have run out, and"));
178 prout(_("you die of thirst, starvation, and asphyxiation."));
179 prout(_("Your starship is a derelict in space."));
182 prout(_("Your energy supply is exhausted."));
184 prout(_("Your starship is a derelict in space."));
189 prout(_("has been destroyed in battle."));
191 prout(_("Dulce et decorum est pro patria mori."));
194 prout(_("You have made three attempts to cross the negative energy"));
195 prout(_("barrier which surrounds the galaxy."));
197 prout(_("Your navigation is abominable."));
201 prout(_("Your starship has been destroyed by a nova."));
202 prout(_("That was a great shot."));
208 prout(_(" has been fried by a supernova."));
209 prout(_("...Not even cinders remain..."));
212 prout(_("You have been captured by the Klingons. If you still"));
213 prout(_("had a starbase to be returned to, you would have been"));
214 prout(_("repatriated and given another chance. Since you have"));
215 prout(_("no starbases, you will be mercilessly tortured to death."));
218 prout(_("Your starship is now an expanding cloud of subatomic particles"));
221 prout(_("Starbase was unable to re-materialize your starship."));
222 prout(_("Sic transit gloria muntdi"));
227 prout(_(" has been cremated by its own phasers."));
230 prout(_("You and your landing party have been"));
231 prout(_("converted to energy, disipating through space."));
234 prout(_("You are left with your landing party on"));
235 prout(_("a wild jungle planet inhabited by primitive cannibals."));
237 prout(_("They are very fond of \"Captain Kirk\" soup."));
239 proutn(_("Without your leadership, the "));
241 prout(_(" is destroyed."));
244 prout(_("You and your mining party perish."));
246 prout(_("That was a great shot."));
250 prout(_("The Galileo is instantly annihilated by the supernova."));
253 prout(_("You and your mining party are atomized."));
255 proutn(_("Mr. Spock takes command of the "));
258 prout(_("joins the Romulans, reigning terror on the Federation."));
261 prout(_("The shuttle craft Galileo is also caught,"));
262 prout(_("and breaks up under the strain."));
264 prout(_("Your debris is scattered for millions of miles."));
265 proutn(_("Without your leadership, the "));
267 prout(_(" is destroyed."));
270 prout(_("The mutants attack and kill Spock."));
271 prout(_("Your ship is captured by Klingons, and"));
272 prout(_("your crew is put on display in a Klingon zoo."));
275 prout(_("Tribbles consume all remaining water,"));
276 prout(_("food, and oxygen on your ship."));
278 prout(_("You die of thirst, starvation, and asphyxiation."));
279 prout(_("Your starship is a derelict in space."));
282 prout(_("Your ship is drawn to the center of the black hole."));
283 prout(_("You are crushed into extremely dense matter."));
286 if (game.ship==IHF) game.ship= 0;
287 else if (game.ship == IHE) game.ship = IHF;
290 double goodies = game.state.remres/game.inresor;
291 double baddies = (game.state.remkl + 2.0*game.state.remcom)/(game.inkling+2.0*game.incom);
292 if (goodies/baddies >= 1.0+0.5*Rand()) {
293 prout(_("As a result of your actions, a treaty with the Klingon"));
294 prout(_("Empire has been signed. The terms of the treaty are"));
295 if (goodies/baddies >= 3.0+Rand()) {
296 prout(_("favorable to the Federation."));
298 prout(_("Congratulations!"));
301 prout(_("highly unfavorable to the Federation."));
304 prout(_("The Federation will be destroyed."));
307 prout(_("Since you took the last Klingon with you, you are a"));
308 prout(_("martyr and a hero. Someday maybe they'll erect a"));
309 prout(_("statue in your memory. Rest in peace, and try not"));
310 prout(_("to think about pigeons."));
318 double timused = game.state.date - game.indate;
319 int ithperd, iwon, klship;
322 if ((timused == 0 || KLINGREM != 0) && timused < 5.0) timused = 5.0;
323 perdate = KLINGKILLED/timused;
324 ithperd = 500*perdate + 0.5;
326 if (game.gamewon) iwon = 100*game.skill;
327 if (game.ship == IHE) klship = 0;
328 else if (game.ship == IHF) klship = 1;
330 if (game.gamewon == 0) game.state.nromrem = 0; // None captured if no win
331 iscore = 10*NKILLK + 50*NKILLC + ithperd + iwon
332 - 100*game.state.basekl - 100*klship - 45*game.nhelp -5*game.state.starkl - game.casual
333 + 20*NKILLROM + 200*NKILLSC - 10*game.state.nplankl + game.state.nromrem;
334 if (game.alive == 0) iscore -= 200;
336 prout(_("Your score --"));
338 prout(_("%6d Romulans destroyed %5d"),
339 NKILLROM,20*NKILLROM);
340 if (game.state.nromrem)
341 prout(_("%6d Romulans captured %5d"),
342 game.state.nromrem, game.state.nromrem);
344 prout(_("%6d ordinary Klingons destroyed %5d"),
347 prout(_("%6d Klingon commanders destroyed %5d"),
350 prout(_("%6d Super-Commander destroyed %5d"),
351 NKILLSC, 200*NKILLSC);
353 prout(_("%6.2f Klingons per stardate %5d"),
355 if (game.state.starkl)
356 prout(_("%6d stars destroyed by your action %5d"),
357 game.state.starkl, -5*game.state.starkl);
358 if (game.state.nplankl)
359 prout(_("%6d planets destroyed by your action %5d"),
360 game.state.nplankl, -10*game.state.nplankl);
361 if (game.state.basekl)
362 prout(_("%6d bases destroyed by your action %5d"),
363 game.state.basekl, -100*game.state.basekl);
365 prout(_("%6d calls for help from starbase %5d"),
366 game.nhelp, -45*game.nhelp);
368 prout(_("%6d casualties incurred %5d"),
369 game.casual, -game.casual);
371 prout(_("%6d ship(s) lost or destroyed %5d"),
372 klship, -100*klship);
374 prout(_("Penalty for getting yourself killed -200"));
376 proutn(_("Bonus for winning "));
377 switch (game.skill) {
378 case SKILL_NOVICE: proutn(_("Novice game ")); break;
379 case SKILL_FAIR: proutn(_("Fair game ")); break;
380 case SKILL_GOOD: proutn(_("Good game ")); break;
381 case SKILL_EXPERT: proutn(_("Expert game ")); break;
382 case SKILL_EMERITUS: proutn(_("Emeritus game")); break;
387 prout(_("TOTAL SCORE %5d"), iscore);
400 proutn(_("File or device name for your plaque: "));
401 cgetline(winner, sizeof(winner));
402 fp = fopen(winner, "w");
404 prout(_("Invalid name."));
408 proutn(_("Enter name to go on plaque (up to 30 characters): "));
409 cgetline(winner, sizeof(winner));
410 /* The 38 below must be 64 for 132-column paper */
411 nskip = 38 - strlen(winner)/2;
413 fprintf(fp,"\n\n\n\n");
414 /* --------DRAW ENTERPRISE PICTURE. */
415 fprintf(fp, " EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n" );
416 fprintf(fp, " EEE E : : : E\n" );
417 fprintf(fp, " EE EEE E : : NCC-1701 : E\n");
418 fprintf(fp, "EEEEEEEEEEEEEEEE EEEEEEEEEEEEEEE : : : E\n");
419 fprintf(fp, " E EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n");
420 fprintf(fp, " EEEEEEEEE EEEEEEEEEEEEE E E\n");
421 fprintf(fp, " EEEEEEE EEEEE E E E E\n");
422 fprintf(fp, " EEE E E E E\n");
423 fprintf(fp, " E E E E\n");
424 fprintf(fp, " EEEEEEEEEEEEE E E\n");
425 fprintf(fp, " EEE : EEEEEEE EEEEEEEE\n");
426 fprintf(fp, " :E : EEEE E\n");
427 fprintf(fp, " .-E -:----- E\n");
428 fprintf(fp, " :E : E\n");
429 fprintf(fp, " EE : EEEEEEEE\n");
430 fprintf(fp, " EEEEEEEEEEEEEEEEEEEEEEE\n");
431 fprintf(fp, "\n\n\n");
432 fprintf(fp, _(" U. S. S. ENTERPRISE\n"));
433 fprintf(fp, "\n\n\n\n");
434 fprintf(fp, _(" For demonstrating outstanding ability as a starship captain\n"));
436 fprintf(fp, _(" Starfleet Command bestows to you\n"));
438 fprintf(fp,"%*s%s\n\n", nskip, "", winner);
439 fprintf(fp, _(" the rank of\n\n"));
440 fprintf(fp, _(" \"Commodore Emeritus\"\n\n"));
443 case SKILL_EXPERT: fprintf(fp,_(" Expert level\n\n")); break;
444 case SKILL_EMERITUS: fprintf(fp,_("Emeritus level\n\n")); break;
445 default: fprintf(fp,_(" Cheat level\n\n")); break;
448 timestring = ctime(&t);
449 fprintf(fp, _(" This day of %.6s %.4s, %.8s\n\n"),
450 timestring+4, timestring+20, timestring+11);
451 fprintf(fp,_(" Your score: %d\n\n"), iscore);
452 fprintf(fp,_(" Klingons per stardate: %.2f\n"), perdate);