3 static char *classes[] = {"M","N","O"};
5 static int consumeTime(void)
7 /* I think most of this avoidance was caused by overlay scheme.
8 Let's see what happens if all events can occur here */
13 /* Don't worry about this */
14 if (scheduled(FTBEAM) <= game.state.date+game.optime && game.state.remcom != 0 && game.condit != IHDOCKED) {
15 /* We are about to be tractor beamed -- operation fails */
19 // asave = scheduled(FSNOVA);
20 // unschedule(FSNOVA); /* defer supernovas */
21 events(); /* Used to avoid if FSCMOVE is scheduled within time */
22 // schedule(FSNOVA, asave-game.state.time);
23 /*fails if game over, quadrant super-novas or we've moved to new quadrant*/
24 if (game.alldone || game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova || game.justin != 0) return 1;
34 prout(_("Spock- \"Planet report follows, Captain.\""));
36 for (i = 0; i < game.inplan; i++) {
37 if ((game.state.plnets[i].known != unknown
38 && game.state.plnets[i].crystals != 0)
39 || (idebug && game.state.plnets[i].w.x !=0)
42 if (idebug && game.state.plnets[i].known==unknown)
44 proutn(cramlc(quadrant, game.state.plnets[i].w));
46 proutn(classes[game.state.plnets[i].pclass]);
48 if (game.state.plnets[i].crystals <= 0) proutn(_("no "));
49 prout(_("dilithium crystals present."));
50 if (game.state.plnets[i].known==shuttle_down)
51 prout(_(" Shuttle Craft Galileo on surface."));
54 if (iknow==0) prout(_("No information available."));
62 prout(_("Already in standard orbit."));
65 if (damaged(DWARPEN) && damaged(DIMPULS)) {
66 prout(_("Both warp and impulse engines damaged."));
69 if (game.plnet.x == 0 || abs(game.sector.x-game.plnet.x) > 1 || abs(game.sector.y-game.plnet.y) > 1) {
71 prout(_(" not adjacent to planet."));
75 game.optime = 0.02+0.03*Rand();
76 prout(_("Helmsman Sulu- \"Entering standard orbit, Sir.\""));
78 if (consumeTime()) return;
79 game.height = (1400.0+7200.0*Rand());
80 prout(_("Sulu- \"Entered orbit at altitude %.2f kilometers.\""), game.height);
89 if (damaged(DSRSENS)) {
90 prout(_("Short range sensors damaged."));
93 if (!game.plnet.x && (game.options & OPTION_TTY)) {
94 prout(_("Spock- \"No planet in this quadrant, Captain.\""));
97 if ((game.plnet.x != 0)&& (game.state.plnets[game.iplnet].known == unknown)) {
98 prout(_("Spock- \"Sensor scan for %s-"), cramlc(quadrant, game.quadrant));
100 prout(_(" Planet at %s is of class %s."),
101 cramlc(sector,game.plnet),
102 classes[game.state.plnets[game.iplnet].pclass]);
103 if (game.state.plnets[game.iplnet].known==shuttle_down)
104 prout(_(" Sensors show Galileo still on surface."));
105 proutn(_(" Readings indicate"));
106 if (game.state.plnets[game.iplnet].crystals == 0) proutn(_(" no"));
107 prout(_(" dilithium crystals present.\""));
108 if (game.state.plnets[game.iplnet].known == unknown) game.state.plnets[game.iplnet].known = known;
116 if (damaged(DTRANSP)) {
117 prout(_("Transporter damaged."));
118 if (!damaged(DSHUTTL) && (game.state.plnets[game.iplnet].known==shuttle_down || game.iscraft == 1)) {
120 proutn(_("Spock- \"May I suggest the shuttle craft, Sir?\" "));
121 if (ja() == true) shuttle();
127 prout(_(" not in standard orbit."));
131 prout(_("Impossible to transport through shields."));
134 if (game.state.plnets[game.iplnet].known==unknown) {
135 prout(_("Spock- \"Captain, we have no information on this planet"));
136 prout(_(" and Starfleet Regulations clearly state that in this situation"));
137 prout(_(" you may not go down.\""));
140 if (game.landed==1) {
141 /* Coming from planet */
142 if (game.state.plnets[game.iplnet].known==shuttle_down) {
143 proutn(_("Spock- \"Wouldn't you rather take the Galileo?\" "));
148 prout(_("Your crew hides the Galileo to prevent capture by aliens."));
150 prout(_("Landing party assembled, ready to beam up."));
152 prout(_("Kirk whips out communicator..."));
153 prouts(_("BEEP BEEP BEEP"));
155 prout(_("\"Kirk to enterprise- Lock on coordinates...energize.\""));
158 /* Going to planet */
159 if (game.state.plnets[game.iplnet].crystals==0) {
160 prout(_("Spock- \"Captain, I fail to see the logic in"));
161 prout(_(" exploring a planet with no dilithium crystals."));
162 proutn(_(" Are you sure this is wise?\" "));
168 prout(_("Scotty- \"Transporter room ready, Sir.\""));
170 prout(_("Kirk and landing party prepare to beam down to planet surface."));
172 prout(_("Kirk- \"Energize.\""));
176 prouts("WWHOOOIIIIIRRRRREEEE.E.E. . . . . . .");
179 prouts("BOOOIIIOOOIIOOOOIIIOIING . . .");
181 prout(_("Scotty- \"Oh my God! I've lost them.\""));
185 prouts(". . . . . . .E.E.EEEERRRRRIIIIIOOOHWW");
187 prout(_("Transport complete."));
188 game.landed = -game.landed;
189 if (game.landed==1 && game.state.plnets[game.iplnet].known==shuttle_down) {
190 prout(_("The shuttle craft Galileo is here!"));
192 if (game.landed!=1 && game.imine==1) {
204 if (game.landed!= 1) {
205 prout(_("Mining party not on planet."));
208 if (game.state.plnets[game.iplnet].crystals == MINED) {
209 prout(_("This planet has already been strip-mined for dilithium."));
212 else if (game.state.plnets[game.iplnet].crystals == 0) {
213 prout(_("No dilithium crystals on this planet."));
216 if (game.imine == 1) {
217 prout(_("You've already mined enough crystals for this trip."));
220 if (game.icrystl == 1 && game.cryprob == 0.05) {
221 proutn(_("With all those fresh crystals aboard the "));
224 prout(_("there's no reason to mine more at this time."));
227 game.optime = (0.1+0.2*Rand())*game.state.plnets[game.iplnet].pclass;
228 if (consumeTime()) return;
229 prout(_("Mining operation complete."));
230 game.state.plnets[game.iplnet].crystals = MINED;
235 void usecrystals(void)
240 if (game.icrystl!=1) {
241 prout(_("No dilithium crystals available."));
244 if (game.energy >= 1000) {
245 prout(_("Spock- \"Captain, Starfleet Regulations prohibit such an operation"));
246 prout(_(" except when condition Yellow exists."));
249 prout(_("Spock- \"Captain, I must warn you that loading"));
250 prout(_(" raw dilithium crystals into the ship's power"));
251 prout(_(" system may risk a severe explosion."));
252 proutn(_(" Are you sure this is wise?\" "));
258 prout(_("Engineering Officer Scott- \"(GULP) Aye Sir."));
259 prout(_(" Mr. Spock and I will try it.\""));
261 prout(_("Spock- \"Crystals in place, Sir."));
262 prout(_(" Ready to activate circuit.\""));
264 prouts(_("Scotty- \"Keep your fingers crossed, Sir!\""));
266 if (Rand() <= game.cryprob) {
267 prouts(_(" \"Activating now! - - No good! It's***"));
269 prouts(_("***RED ALERT! RED A*L********************************"));
272 prouts(_("****************** KA-BOOM!!!! *******************"));
277 game.energy += 5000.0*(1.0 + 0.9*Rand());
278 prouts(_(" \"Activating now! - - "));
279 prout(_("The instruments"));
280 prout(_(" are going crazy, but I think it's"));
281 prout(_(" going to work!! Congratulations, Sir!\""));
290 if(damaged(DSHUTTL)) {
291 if (game.damage[DSHUTTL] == -1.0) {
292 if (game.inorbit && game.state.plnets[game.iplnet].known == shuttle_down)
293 prout(_("Ye Faerie Queene has no shuttle craft bay to dock it at."));
295 prout(_("Ye Faerie Queene had no shuttle craft."));
297 else if (game.damage[DSHUTTL] > 0)
298 prout(_("The Galileo is damaged."));
299 else /* game.damage[DSHUTTL] < 0 */
300 prout(_("Shuttle craft is now serving Big Macs."));
305 prout(_(" not in standard orbit."));
308 if ((game.state.plnets[game.iplnet].known != shuttle_down) && game.iscraft != 1) {
309 prout(_("Shuttle craft not currently available."));
312 if (game.landed==-1 && game.state.plnets[game.iplnet].known==shuttle_down) {
313 prout(_("You will have to beam down to retrieve the shuttle craft."));
316 if (game.shldup || game.condit == IHDOCKED) {
317 prout(_("Shuttle craft cannot pass through shields."));
320 if (game.state.plnets[game.iplnet].known==unknown) {
321 prout(_("Spock- \"Captain, we have no information on this planet"));
322 prout(_(" and Starfleet Regulations clearly state that in this situation"));
323 prout(_(" you may not fly down.\""));
326 game.optime = 3.0e-5*game.height;
327 if (game.optime >= 0.8*game.state.remtime) {
328 prout(_("First Officer Spock- \"Captain, I compute that such"));
329 proutn(_(" a maneuver would require approximately %2d%% of our"),
330 (int)(100*game.optime/game.state.remtime));
331 prout(_("remaining time."));
332 proutn(_("Are you sure this is wise?\" "));
338 if (game.landed == 1) {
340 if (game.iscraft==1) {
341 /* Galileo on ship! */
342 if (!damaged(DTRANSP)) {
343 proutn(_("Spock- \"Would you rather use the transporter?\" "));
348 proutn(_("Shuttle crew"));
351 proutn(_("Rescue party"));
352 prout(_(" boards Galileo and swoops toward planet surface."));
355 if (consumeTime()) return;
356 game.state.plnets[game.iplnet].known=shuttle_down;
357 prout(_("Trip complete."));
361 /* Ready to go back to ship */
362 prout(_("You and your mining party board the"));
363 prout(_("shuttle craft for the trip back to the Enterprise."));
365 prout(_("The short hop begins . . ."));
366 game.state.plnets[game.iplnet].known=known;
370 if (consumeTime()) return;
378 prout(_("Trip complete."));
384 /* and so is Galileo */
385 prout(_("Mining party assembles in the hangar deck,"));
386 prout(_("ready to board the shuttle craft \"Galileo\"."));
388 prouts(_("The hangar doors open; the trip begins."));
392 if (consumeTime()) return;
393 game.state.plnets[game.iplnet].known = shuttle_down;
396 prout(_("Trip complete"));
403 double dprob, r = Rand();
408 if (game.ship != IHE) {
409 prout(_("Ye Faerie Queene has no death ray."));
412 if (game.nenhere==0) {
413 prout(_("Sulu- \"But Sir, there are no enemies in this quadrant.\""));
416 if (damaged(DDRAY)) {
417 prout(_("Death Ray is damaged."));
420 prout(_("Spock- \"Captain, the 'Experimental Death Ray'"));
421 prout(_(" is highly unpredictible. Considering the alternatives,"));
422 proutn(_(" are you sure this is wise?\" "));
423 if (ja() == false) return;
424 prout(_("Spock- \"Acknowledged.\""));
427 prouts(_("WHOOEE ... WHOOEE ... WHOOEE ... WHOOEE"));
429 prout(_("Crew scrambles in emergency preparation."));
430 prout(_("Spock and Scotty ready the death ray and"));
431 prout(_("prepare to channel all ship's power to the device."));
433 prout(_("Spock- \"Preparations complete, sir.\""));
434 prout(_("Kirk- \"Engage!\""));
436 prouts(_("WHIRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"));
439 if (game.options & OPTION_PLAIN)
442 prouts(_("Sulu- \"Captain! It's working!\""));
444 while (game.nenhere > 0)
445 deadkl(game.ks[1], game.quad[game.ks[1].x][game.ks[1].y],game.ks[1].x,game.ks[1].y);
446 prout(_("Ensign Chekov- \"Congratulations, Captain!\""));
447 if (KLINGREM == 0) finish(FWON);
448 if ((game.options & OPTION_PLAIN) == 0) {
449 prout(_("Spock- \"Captain, I believe the `Experimental Death Ray'"));
450 if (Rand() <= 0.05) {
451 prout(_(" is still operational.\""));
454 prout(_(" has been rendered nonfunctional.\""));
455 game.damage[DDRAY] = 39.95;
460 r = Rand(); // Pick failure method
462 prouts(_("Sulu- \"Captain! It's working!\""));
464 prouts(_("***RED ALERT! RED ALERT!"));
466 prout(_("***MATTER-ANTIMATTER IMPLOSION IMMINENT!"));
468 prouts(_("***RED ALERT! RED A*L********************************"));
471 prouts(_("****************** KA-BOOM!!!! *******************"));
477 prouts(_("Sulu- \"Captain! Yagabandaghangrapl, brachriigringlanbla!\""));
479 prout(_("Lt. Uhura- \"Graaeek! Graaeek!\""));
481 prout(_("Spock- \"Fascinating! . . . All humans aboard"));
482 prout(_(" have apparently been transformed into strange mutations."));
483 prout(_(" Vulcans do not seem to be affected."));
485 prout(_("Kirk- \"Raauch! Raauch!\""));
491 prouts(_("Sulu- \"Captain! It's --WHAT?!?!\""));
493 proutn(_("Spock- \"I believe the word is"));
494 prouts(_(" *ASTONISHING*"));
495 prout(_(" Mr. Sulu."));
498 if (game.quad[i][j] == IHDOT) game.quad[i][j] = IHQUEST;
499 prout(_(" Captain, our quadrant is now infested with"));
500 prouts(_(" - - - - - - *THINGS*."));
502 prout(_(" I have no logical explanation.\""));
505 prouts(_("Sulu- \"Captain! The Death Ray is creating tribbles!\""));
507 prout(_("Scotty- \"There are so many tribbles down here"));
508 prout(_(" in Engineering, we can't move for 'em, Captain.\""));
513 char *systemname(int pindx)
515 static char copy[BUFSIZ];
516 /* the below array should not be static, or it won't gettextize
517 * because of the early initialization. */
518 char *names[NINHAB+1] =
521 * I used <http://www.memory-alpha.org> to find planets
522 * with references in ST:TOS. Eath and the Alpha Centauri
523 * Colony have been omitted.
525 * Some planets marked Class G and P here will be displayed as class M
526 * because of the way planets are generated. This is a known bug.
530 _("Andoria (Fesoan)"), /* several episodes */
531 _("Tellar Prime (Miracht)"), /* TOS: "Journey to Babel" */
532 _("Vulcan (T'Khasi)"), /* many episodes */
533 _("Medusa"), /* TOS: "Is There in Truth No Beauty?" */
534 _("Argelius II (Nelphia)"),/* TOS: "Wolf in the Fold" ("IV" in BSD) */
535 _("Ardana"), /* TOS: "The Cloud Minders" */
536 _("Catulla (Cendo-Prae)"), /* TOS: "The Way to Eden" */
537 _("Gideon"), /* TOS: "The Mark of Gideon" */
538 _("Aldebaran III"), /* TOS: "The Deadly Years" */
539 _("Alpha Majoris I"), /* TOS: "Wolf in the Fold" */
540 _("Altair IV"), /* TOS: "Amok Time */
541 _("Ariannus"), /* TOS: "Let That Be Your Last Battlefield" */
542 _("Benecia"), /* TOS: "The Conscience of the King" */
543 _("Beta Niobe I (Sarpeidon)"), /* TOS: "All Our Yesterdays" */
544 _("Alpha Carinae II"), /* TOS: "The Ultimate Computer" */
545 _("Capella IV (Kohath)"), /* TOS: "Friday's Child" (Class G) */
546 _("Daran V"), /* TOS: "For the World is Hollow and I Have Touched the Sky" */
547 _("Deneb II"), /* TOS: "Wolf in the Fold" ("IV" in BSD) */
548 _("Eminiar VII"), /* TOS: "A Taste of Armageddon" */
549 _("Gamma Canaris IV"), /* TOS: "Metamorphosis" */
550 _("Gamma Tranguli VI (Vaalel)"), /* TOS: "The Apple" */
551 _("Ingraham B"), /* TOS: "Operation: Annihilate" */
552 _("Janus IV"), /* TOS: "The Devil in the Dark" */
553 _("Makus III"), /* TOS: "The Galileo Seven" */
554 _("Marcos XII"), /* TOS: "And the Children Shall Lead", */
555 _("Omega IV"), /* TOS: "The Omega Glory" */
556 _("Regulus V"), /* TOS: "Amok Time */
557 _("Deneva"), /* TOS: "Operation -- Annihilate!" */
558 /* Worlds from BSD Trek */
559 _("Rigel II"), /* TOS: "Shore Leave" ("III" in BSD) */
560 _("Beta III"), /* TOS: "The Return of the Archons" */
561 _("Triacus"), /* TOS: "And the Children Shall Lead", */
562 _("Exo III"), /* TOS: "What Are Little Girls Made Of?" (Class P) */
565 _("Hansen's Planet"), /* TOS: "The Galileo Seven" */
566 _("Taurus IV"), /* TOS: "The Galileo Seven" (class G) */
567 _("Antos IV (Doraphane)"), /* TOS: "Whom Gods Destroy", "Who Mourns for Adonais?" */
568 _("Izar"), /* TOS: "Whom Gods Destroy" */
569 _("Tiburon"), /* TOS: "The Way to Eden" */
570 _("Merak II"), /* TOS: "The Cloud Minders" */
571 _("Coridan (Desotriana)"), /* TOS: "Journey to Babel" */
572 _("Iotia"), /* TOS: "A Piece of the Action" */
576 strcpy(copy, names[pindx]);