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 (game.damage[DWARPEN] != 0 && game.damage[DIMPULS] != 0) {
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 (game.damage[DSRSENS] != 0.0) {
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 (game.damage[DTRANSP] != 0) {
117 prout("Transporter damaged.");
118 if (game.damage[DSHUTTL]==0 && (game.state.plnets[game.iplnet].known==shuttle_down || game.iscraft == 1)) {
120 proutn("Spock- \"May I suggest the shuttle craft, Sir?\" ");
121 if (ja() != 0) shuttle();
127 prout(" not in standard orbit.");
130 if (game.shldup!=0) {
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 game.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(game.damage[DSHUTTL] != 0.0) {
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 prout("Shuttle craft is now serving Big Macs.");
304 prout(" not in standard orbit.");
307 if ((game.state.plnets[game.iplnet].known != shuttle_down) && game.iscraft != 1) {
308 prout("Shuttle craft not currently available.");
311 if (game.landed==-1 && game.state.plnets[game.iplnet].known==shuttle_down) {
312 prout("You will have to beam down to retrieve the shuttle craft.");
315 if (game.shldup!=0 || game.condit == IHDOCKED) {
316 prout("Shuttle craft cannot pass through shields.");
319 if (game.state.plnets[game.iplnet].known==unknown) {
320 prout("Spock- \"Captain, we have no information on this planet");
321 prout(" and Starfleet Regulations clearly state that in this situation");
322 prout(" you may not fly down.\"");
325 game.optime = 3.0e-5*game.height;
326 if (game.optime >= 0.8*game.state.remtime) {
327 prout("First Officer Spock- \"Captain, I compute that such");
328 proutn(" a maneuver would require approximately 2d%% of our",
329 (int)(100*game.optime/game.state.remtime));
330 prout("remaining time.");
331 proutn("Are you sure this is wise?\" ");
337 if (game.landed == 1) {
339 if (game.iscraft==1) {
340 /* Galileo on ship! */
341 if (game.damage[DTRANSP]==0) {
342 proutn("Spock- \"Would you rather use the transporter?\" ");
347 proutn("Shuttle crew");
350 proutn("Rescue party");
351 prout(" boards Galileo and swoops toward planet surface.");
354 if (consumeTime()) return;
355 game.state.plnets[game.iplnet].known=shuttle_down;
356 prout("Trip complete.");
360 /* Ready to go back to ship */
361 prout("You and your mining party board the");
362 prout("shuttle craft for the trip back to the Enterprise.");
364 prout("The short hop begins . . .");
365 game.state.plnets[game.iplnet].known=known;
369 if (consumeTime()) return;
377 prout("Trip complete.");
383 /* and so is Galileo */
384 prout("Mining party assembles in the hangar deck,");
385 prout("ready to board the shuttle craft \"Galileo\".");
387 prouts("The hangar doors open; the trip begins.");
391 if (consumeTime()) return;
392 game.state.plnets[game.iplnet].known = shuttle_down;
395 prout("Trip complete");
402 double dprob, r = Rand();
407 if (game.ship != IHE) {
408 prout("Ye Faerie Queene has no death ray.");
411 if (game.nenhere==0) {
412 prout("Sulu- \"But Sir, there are no enemies in this quadrant.\"");
415 if (game.damage[DDRAY] > 0.0) {
416 prout("Death Ray is damaged.");
419 prout("Spock- \"Captain, the 'Experimental Death Ray'");
420 prout(" is highly unpredictible. Considering the alternatives,");
421 proutn(" are you sure this is wise?\" ");
423 prout("Spock- \"Acknowledged.\"");
426 prouts("WHOOEE ... WHOOEE ... WHOOEE ... WHOOEE");
428 prout("Crew scrambles in emergency preparation.");
429 prout("Spock and Scotty ready the death ray and");
430 prout("prepare to channel all ship's power to the device.");
432 prout("Spock- \"Preparations complete, sir.\"");
433 prout("Kirk- \"Engage!\"");
435 prouts("WHIRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR");
438 if (game.options & OPTION_PLAIN)
441 prouts("Sulu- \"Captain! It's working!\"");
443 while (game.nenhere > 0)
444 deadkl(game.ks[1], game.quad[game.ks[1].x][game.ks[1].y],game.ks[1].x,game.ks[1].y);
445 prout("Ensign Chekov- \"Congratulations, Captain!\"");
446 if (KLINGREM == 0) finish(FWON);
447 if ((game.options & OPTION_PLAIN) == 0) {
448 prout("Spock- \"Captain, I believe the `Experimental Death Ray'");
449 if (Rand() <= 0.05) {
450 prout(" is still operational.\"");
453 prout(" has been rendered nonfunctional.\"");
454 game.damage[DDRAY] = 39.95;
459 r = Rand(); // Pick failure method
461 prouts("Sulu- \"Captain! It's working!\"");
463 prouts("***RED ALERT! RED ALERT!");
465 prout("***MATTER-ANTIMATTER IMPLOSION IMMINENT!");
467 prouts("***RED ALERT! RED A*L********************************");
470 prouts("****************** KA-BOOM!!!! *******************");
476 prouts("Sulu- \"Captain! Yagabandaghangrapl, brachriigringlanbla!\"");
478 prout("Lt. Uhura- \"Graaeek! Graaeek!\"");
480 prout("Spock- \"Fascinating! . . . All humans aboard");
481 prout(" have apparently been transformed into strange mutations.");
482 prout(" Vulcans do not seem to be affected.");
484 prout("Kirk- \"Raauch! Raauch!\"");
490 prouts("Sulu- \"Captain! It's --WHAT?!?!\"");
492 proutn("Spock- \"I believe the word is");
493 prouts(" *ASTONISHING*");
497 if (game.quad[i][j] == IHDOT) game.quad[i][j] = IHQUEST;
498 prout(" Captain, our quadrant is now infested with");
499 prouts(" - - - - - - *THINGS*.");
501 prout(" I have no logical explanation.\"");
504 prouts("Sulu- \"Captain! The Death Ray is creating tribbles!\"");
506 prout("Scotty- \"There are so many tribbles down here");
507 prout(" in Engineering, we can't move for 'em, Captain.\"");
512 char *systemname(int pindx)
514 static char *names[NINHAB] =
517 * This started out life as the BSD Trek inhabited-planets list,
518 * but I used <http://www.memory-alpha.org> to weed out planets
519 * with no references in ST:TOS and to fill it out again to the
520 * required length from "The Worlds of The Federation" list,
521 * <http://memory-alpha.org/en/wiki/The_Worlds_of_the_Federation>.
522 * Some misspellings have been silently corrected. (To be
523 * fair, there was no Web when Eric Allman did his list.)
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.
529 // Added Federation Worlds
530 "Deneva", /* TOS: "Operation -- Annihilate!" */
531 "Eminiar VII", /* TOS: "A Taste of Armageddon" */
532 "Hansen's Planet", /* TOS: "The Galileo Seven" */
533 "Taurus IV", /* TOS: "The Galileo Seven" (class G) */
534 "Aldebaran III", /* TOS: "The Deadly Years" */
535 "Vulcan (T'Khasi)", /* many episodes */
536 "Tellar Prime (Miracht)", /* TOS: "Journey to Babel" */
537 "Andoria (Fesoan)", /* several episodes */
538 "Antos IV (Doraphane)", /* TOS: "Whom Gods Destroy", "Who Mourns for Adonais?" */
539 "Catulla (Cendo-Prae)", /* TOS: "The Way to Eden" */
540 "Izar", /* TOS: "Whom Gods Destroy" */
541 "Tiburon", /* TOS: "The Way to Eden" */
542 "Merak II", /* TOS: "The Cloud Minders" */
543 "Argelius II (Nelphia)", /* TOS: "Wolf in the Fold" ("IV" in BSD) */
544 "Daran V", /* TOS: "For the World is Hollow and I Have Touched the Sky" */
545 "Medusa", /* TOS: "Is There in Truth No Beauty?" */
546 "Coridan (Desotriana)", /* TOS: "Journey to Babel" */
547 "Berengaria IV", /* TOS: "This Side of Paradise" */
548 "Capella IV (Kohath)", /* TOS: "Friday's Child" (Class G) */
549 "Gideon", /* TOS: "The Mark of Gideon" */
550 "Iotia", /* TOS: "A Piece of the Action" */
551 /* Worlds from BSD Trek */
552 //"Talos IV", /* TOS: "The Cage" (interdicted world) */
553 "Rigel II", /* TOS: "Shore Leave" ("III" in BSD) */
554 "Deneb II", /* TOS: "Wolf in the Fold" ("IV" in BSD) */
555 //"Canopus V", /* noncanonical */
556 //"Icarus I", /* noncanonical */
557 //"Prometheus II", /* noncanonical */
558 //"Omega VII", /* noncanonical */
559 //"Elysium I", /* noncanonical */
560 "Scalos IV", /* TOS: "Wink of an Eye" */
561 //"Procyon IV", /* noncanonical */
562 //"Arachnid I", /* noncanonical */
563 //"Argo VIII", /* noncanonical */
564 //"Triad III", /* noncanonical */
565 //"Echo IV", /* noncanonical */
566 //"Nimrod III", /* noncanonical */
567 //"Nemisis IV", /* noncanonical */
568 //"Centarurus I", /* noncanonical */
569 //"Kronos III", /* noncanonical */
570 //"Spectros V", /* noncanonical */
571 "Beta III", /* TOS: "The Return of the Archons" */
572 "Gamma Tranguli VI (Vaalel)", /* TOS: "The Apple" */
573 "Pyris VII", /* TOS: "Catspaw" ("III" in BSD) */
574 "Triacus", /* TOS: "And the Children Shall Lead", */
575 "Marcos XII", /* TOS: "And the Children Shall Lead", */
576 //"Kaland", /* noncanonical */
577 "Ardana", /* TOS: "The Cloud Minders" */
578 //"Stratos", /* noncanonical */
579 //"Eden", /* TOS: "The Way to Eden" (in Romulan space) */
580 //"Arrikis", /* noncanonical */
581 //"Epsilon Eridani IV", /* noncanonical */
582 "Exo III", /* TOS: "What Are Little Girls Made Of?" (Class P) */