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;
33 prout("Spock- \"Planet report follows, Captain.\"");
35 for (i = 0; i < game.inplan; i++) {
36 if ((game.state.plnets[i].known != unknown
37 && game.state.plnets[i].crystals != 0)
39 || ( game.idebug && game.state.plnets[i].x !=0)
44 if (game.idebug && game.state.plnets[i].known==unknown) proutn("(Unknown) ");
46 proutn(cramlc(quadrant, game.state.plnets[i].w));
48 proutn(classes[game.state.plnets[i].pclass]);
50 if (game.state.plnets[i].crystals <= 0) proutn("no ");
51 prout("dilithium crystals present.");
52 if (game.state.plnets[i].known==shuttle_down)
53 prout(" Shuttle Craft Galileo on surface.");
56 if (iknow==0) prout("No information available.");
63 if (game.inorbit!=0) {
64 prout("Already in standard orbit.");
67 if (game.damage[DWARPEN] != 0 && game.damage[DIMPULS] != 0) {
68 prout("Both warp and impulse engines damaged.");
71 if (game.plnet.x == 0 || abs(game.sector.x-game.plnet.x) > 1 || abs(game.sector.y-game.plnet.y) > 1) {
73 prout(" not adjacent to planet.");
77 game.optime = 0.02+0.03*Rand();
78 prout("Helmsman Sulu- \"Entering standard orbit, Sir.\"");
80 if (consumeTime()) return;
81 game.height = (1400.0+7200.0*Rand());
82 prout("Sulu- \"Entered orbit at altitude %.2f kilometers.\"", game.height);
91 if (game.damage[DSRSENS] != 0.0) {
92 prout("Short range sensors damaged.");
95 if (!game.plnet.x && (game.options & OPTION_TTY)) {
96 prout("Spock- \"No planet in this quadrant, Captain.\"");
99 if ((game.plnet.x != 0)&& (game.state.plnets[game.iplnet].known == unknown)) {
100 prout("Spock- \"Sensor scan for %s-", cramlc(quadrant, game.quadrant));
102 prout(" Planet at %s is of class %s.",
103 cramlc(sector,game.plnet),
104 classes[game.state.plnets[game.iplnet].pclass]);
105 if (game.state.plnets[game.iplnet].known==shuttle_down)
106 prout(" Sensors show Galileo still on surface.");
107 proutn(" Readings indicate");
108 if (game.state.plnets[game.iplnet].crystals == 0) proutn(" no");
109 prout(" dilithium crystals present.\"");
110 if (game.state.plnets[game.iplnet].known == unknown) game.state.plnets[game.iplnet].known = known;
118 if (game.damage[DTRANSP] != 0) {
119 prout("Transporter damaged.");
120 if (game.damage[DSHUTTL]==0 && (game.state.plnets[game.iplnet].known==shuttle_down || game.iscraft == 1)) {
122 proutn("Spock- \"May I suggest the shuttle craft, Sir?\" ");
123 if (ja() != 0) shuttle();
127 if (game.inorbit==0) {
129 prout(" not in standard orbit.");
132 if (game.shldup!=0) {
133 prout("Impossible to transport through shields.");
136 if (game.state.plnets[game.iplnet].known==unknown) {
137 prout("Spock- \"Captain, we have no information on this planet");
138 prout(" and Starfleet Regulations clearly state that in this situation");
139 prout(" you may not go down.\"");
142 if (game.landed==1) {
143 /* Coming from planet */
144 if (game.state.plnets[game.iplnet].known==shuttle_down) {
145 proutn("Spock- \"Wouldn't you rather take the Galileo?\" ");
150 prout("Your crew hides the Galileo to prevent capture by aliens.");
152 prout("Landing party assembled, ready to beam up.");
154 prout("Kirk whips out communicator...");
155 prouts("BEEP BEEP BEEP");
157 prout("\"Kirk to enterprise- Lock on coordinates...energize.\"");
160 /* Going to planet */
161 if (game.state.plnets[game.iplnet].crystals==0) {
162 prout("Spock- \"Captain, I fail to see the logic in");
163 prout(" exploring a planet with no dilithium crystals.");
164 proutn(" Are you sure this is wise?\" ");
170 prout("Scotty- \"Transporter room ready, Sir.\"");
172 prout("Kirk, and landing party prepare to beam down to planet surface.");
174 prout("Kirk- \"Energize.\"");
178 prouts("WWHOOOIIIIIRRRRREEEE.E.E. . . . . . .");
181 prouts("BOOOIIIOOOIIOOOOIIIOIING . . .");
183 prout("Scotty- \"Oh my God! I've lost them.\"");
187 prouts(". . . . . . .E.E.EEEERRRRRIIIIIOOOHWW");
189 prout("Transport complete.");
190 game.landed = -game.landed;
191 if (game.landed==1 && game.state.plnets[game.iplnet].known==shuttle_down) {
192 prout("The shuttle craft Galileo is here!");
194 if (game.landed!=1 && game.imine==1) {
206 if (game.landed!= 1) {
207 prout("Mining party not on planet.");
210 if (game.state.plnets[game.iplnet].crystals == MINED) {
211 prout("This planet has already been strip-mined for dilithium.");
214 else if (game.state.plnets[game.iplnet].crystals == 0) {
215 prout("No dilithium crystals on this planet.");
218 if (game.imine == 1) {
219 prout("You've already mined enough crystals for this trip.");
222 if (game.icrystl == 1 && game.cryprob == 0.05) {
223 proutn("With all those fresh crystals aboard the ");
226 prout("there's no reason to mine more at this time.");
229 game.optime = (0.1+0.2*Rand())*game.state.plnets[game.iplnet].pclass;
230 if (consumeTime()) return;
231 prout("Mining operation complete.");
232 game.state.plnets[game.iplnet].crystals = MINED;
237 void usecrystals(void)
242 if (game.icrystl!=1) {
243 prout("No dilithium crystals available.");
246 if (game.energy >= 1000) {
247 prout("Spock- \"Captain, Starfleet Regulations prohibit such an operation");
248 prout(" except when game.condition Yellow exists.");
251 prout("Spock- \"Captain, I must warn you that loading");
252 prout(" raw dilithium crystals into the ship's power");
253 prout(" system may risk a severe explosion.");
254 proutn(" Are you sure this is wise?\" ");
260 prout("Engineering Officer Scott- \"(GULP) Aye Sir.");
261 prout(" Mr. Spock and I will try it.\"");
263 prout("Spock- \"Crystals in place, Sir.");
264 prout(" Ready to activate circuit.\"");
266 prouts("Scotty- \"Keep your fingers crossed, Sir!\"");
268 if (Rand() <= game.cryprob) {
269 prouts(" \"Activating now! - - No good! It's***");
271 prouts("***RED ALERT! RED A*L********************************");
274 prouts("****************** KA-BOOM!!!! *******************");
279 game.energy += 5000.0*(1.0 + 0.9*Rand());
280 prouts(" \"Activating now! - - ");
281 prout("The instruments");
282 prout(" are going crazy, but I think it's");
283 prout(" going to work!! Congratulations, Sir!\"");
292 if(game.damage[DSHUTTL] != 0.0) {
293 if (game.damage[DSHUTTL] == -1.0) {
294 if (game.inorbit && game.state.plnets[game.iplnet].known == shuttle_down)
295 prout("Ye Faerie Queene has no shuttle craft bay to dock it at.");
297 prout("Ye Faerie Queene had no shuttle craft.");
299 else if (game.damage[DSHUTTL] > 0)
300 prout("The Galileo is damaged.");
301 else prout("Shuttle craft is now serving Big Macs.");
304 if (game.inorbit==0) {
306 prout(" not in standard orbit.");
309 if ((game.state.plnets[game.iplnet].known != shuttle_down) && game.iscraft != 1) {
310 prout("Shuttle craft not currently available.");
313 if (game.landed==-1 && game.state.plnets[game.iplnet].known==shuttle_down) {
314 prout("You will have to beam down to retrieve the shuttle craft.");
317 if (game.shldup!=0 || game.condit == IHDOCKED) {
318 prout("Shuttle craft cannot pass through shields.");
321 if (game.state.plnets[game.iplnet].known==unknown) {
322 prout("Spock- \"Captain, we have no information on this planet");
323 prout(" and Starfleet Regulations clearly state that in this situation");
324 prout(" you may not fly down.\"");
327 game.optime = 3.0e-5*game.height;
328 if (game.optime >= 0.8*game.state.remtime) {
329 prout("First Officer Spock- \"Captain, I compute that such");
330 proutn(" a maneuver would require approximately 2d%% of our",
331 (int)(100*game.optime/game.state.remtime));
332 prout("remaining time.");
333 proutn("Are you sure this is wise?\" ");
339 if (game.landed == 1) {
341 if (game.iscraft==1) {
342 /* Galileo on ship! */
343 if (game.damage[DTRANSP]==0) {
344 proutn("Spock- \"Would you rather use the transporter?\" ");
349 proutn("Shuttle crew");
352 proutn("Rescue party");
353 prout(" boards Galileo and swoops toward planet surface.");
356 if (consumeTime()) return;
357 game.state.plnets[game.iplnet].known=shuttle_down;
358 prout("Trip complete.");
362 /* Ready to go back to ship */
363 prout("You and your mining party board the");
364 prout("shuttle craft for the trip back to the Enterprise.");
366 prout("The short hop begins . . .");
367 game.state.plnets[game.iplnet].known=known;
371 if (consumeTime()) return;
379 prout("Trip complete.");
385 /* and so is Galileo */
386 prout("Mining party assembles in the hangar deck,");
387 prout("ready to board the shuttle craft \"Galileo\".");
389 prouts("The hangar doors open; the trip begins.");
393 if (consumeTime()) return;
394 game.state.plnets[game.iplnet].known = shuttle_down;
397 prout("Trip complete");
404 double dprob, r = Rand();
409 if (game.ship != IHE) {
410 prout("Ye Faerie Queene has no death ray.");
413 if (game.nenhere==0) {
414 prout("Sulu- \"But Sir, there are no enemies in this quadrant.\"");
417 if (game.damage[DDRAY] > 0.0) {
418 prout("Death Ray is damaged.");
421 prout("Spock- \"Captain, the 'Experimental Death Ray'");
422 prout(" is highly unpredictible. Considering the alternatives,");
423 proutn(" are you sure this is wise?\" ");
425 prout("Spock- \"Acknowledged.\"");
428 prouts("WHOOEE ... WHOOEE ... WHOOEE ... WHOOEE");
430 prout("Crew scrambles in emergency preparation.");
431 prout("Spock and Scotty ready the death ray and");
432 prout("prepare to channel all ship's power to the device.");
434 prout("Spock- \"Preparations complete, sir.\"");
435 prout("Kirk- \"Engage!\"");
437 prouts("WHIRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR");
440 if (game.options & OPTION_PLAIN)
443 prouts("Sulu- \"Captain! It's working!\"");
445 while (game.nenhere > 0)
446 deadkl(game.ks[1].x,game.ks[1].y,game.quad[game.ks[1].x][game.ks[1].y],game.ks[1].x,game.ks[1].y);
447 prout("Ensign Chekov- \"Congratulations, Captain!\"");
448 if (KLINGREM == 0) finish(FWON);
449 if ((game.options & OPTION_PLAIN) == 0) {
450 prout("Spock- \"Captain, I believe the `Experimental Death Ray'");
451 if (Rand() <= 0.05) {
452 prout(" is still operational.\"");
455 prout(" has been rendered nonfunctional.\"");
456 game.damage[DDRAY] = 39.95;
461 r = Rand(); // Pick failure method
463 prouts("Sulu- \"Captain! It's working!\"");
465 prouts("***RED ALERT! RED ALERT!");
467 prout("***MATTER-ANTIMATTER IMPLOSION IMMINENT!");
469 prouts("***RED ALERT! RED A*L********************************");
472 prouts("****************** KA-BOOM!!!! *******************");
478 prouts("Sulu- \"Captain! Yagabandaghangrapl, brachriigringlanbla!\"");
480 prout("Lt. Uhura- \"Graaeek! Graaeek!\"");
482 prout("Spock- \"Fascinating! . . . All humans aboard");
483 prout(" have apparently been transformed into strange mutations.");
484 prout(" Vulcans do not seem to be affected.");
486 prout("Kirk- \"Raauch! Raauch!\"");
492 prouts("Sulu- \"Captain! It's --WHAT?!?!\"");
494 proutn("Spock- \"I believe the word is");
495 prouts(" *ASTONISHING*");
499 if (game.quad[i][j] == IHDOT) game.quad[i][j] = IHQUEST;
500 prout(" Captain, our quadrant is now infested with");
501 prouts(" - - - - - - *THINGS*.");
503 prout(" I have no logical explanation.\"");
506 prouts("Sulu- \"Captain! The Death Ray is creating tribbles!\"");
508 prout("Scotty- \"There are so many tribbles down here");
509 prout(" in Engineering, we can't move for 'em, Captain.\"");
514 char *systemname(planet *planet)
516 static char *names[NINHAB] =
519 * This started out life as the BSD Trek inhabited-planets list,
520 * but I used <http://www.memory-alpha.org> to weed out planets
521 * with no references in ST:TOS and to fill it out again to the
522 * required length from "The Worlds of The Federation" list,
523 * <http://memory-alpha.org/en/wiki/The_Worlds_of_the_Federation>.
524 * Some misspellings have been silently corrected. (To be
525 * fair, there was no Web when Eric Allman did his list.)
527 * Some planets marked Class G and P here will be displayed as class M
528 * because of the way planets are generated. This is a known bug.
531 // Added Federation Worlds
532 "Deneva", /* TOS: "Operation -- Annihilate!" */
533 "Eminiar VII", /* TOS: "A Taste of Armageddon" */
534 "Hansen's Planet", /* TOS: "The Galileo Seven" */
535 "Taurus IV", /* TOS: "The Galileo Seven" (class G) */
536 "Aldebaran III", /* TOS: "The Deadly Years" */
537 "Vulcan (T'Khasi)", /* many episodes */
538 "Tellar Prime (Miracht)", /* TOS: "Journey to Babel" */
539 "Andoria (Fesoan)", /* several episodes */
540 "Antos IV (Doraphane)", /* TOS: "Whom Gods Destroy", "Who Mourns for Adonais?" */
541 "Catulla (Cendo-Prae)", /* TOS: "The Way to Eden" */
542 "Izar", /* TOS: "Whom Gods Destroy" */
543 "Tiburon", /* TOS: "The Way to Eden" */
544 "Merak II", /* TOS: "The Cloud Minders" */
545 "Argelius II (Nelphia)", /* TOS: "Wolf in the Fold" ("IV" in BSD) */
546 "Daran V", /* TOS: "For the World is Hollow and I Have Touched the Sky" */
547 "Medusa", /* TOS: "Is There in Truth No Beauty?" */
548 "Coridan (Desotriana)", /* TOS: "Journey to Babel" */
549 "Berengaria IV", /* TOS: "This Side of Paradise" */
550 "Capella IV (Kohath)", /* TOS: "Friday's Child" (Class G) */
551 "Gideon", /* TOS: "The Mark of Gideon" */
552 "Iotia", /* TOS: "A Piece of the Action" */
553 /* Worlds from BSD Trek */
554 //"Talos IV", /* TOS: "The Cage" (interdicted world) */
555 "Rigel II", /* TOS: "Shore Leave" ("III" in BSD) */
556 "Deneb II", /* TOS: "Wolf in the Fold" ("IV" in BSD) */
557 //"Canopus V", /* noncanonical */
558 //"Icarus I", /* noncanonical */
559 //"Prometheus II", /* noncanonical */
560 //"Omega VII", /* noncanonical */
561 //"Elysium I", /* noncanonical */
562 "Scalos IV", /* TOS: "Wink of an Eye" */
563 //"Procyon IV", /* noncanonical */
564 //"Arachnid I", /* noncanonical */
565 //"Argo VIII", /* noncanonical */
566 //"Triad III", /* noncanonical */
567 //"Echo IV", /* noncanonical */
568 //"Nimrod III", /* noncanonical */
569 //"Nemisis IV", /* noncanonical */
570 //"Centarurus I", /* noncanonical */
571 //"Kronos III", /* noncanonical */
572 //"Spectros V", /* noncanonical */
573 "Beta III", /* TOS: "The Return of the Archons" */
574 "Gamma Tranguli VI (Vaalel)", /* TOS: "The Apple" */
575 "Pyris VII", /* TOS: "Catspaw" ("III" in BSD) */
576 "Triacus", /* TOS: "And the Children Shall Lead", */
577 "Marcos XII", /* TOS: "And the Children Shall Lead", */
578 //"Kaland", /* noncanonical */
579 "Ardana", /* TOS: "The Cloud Minders" */
580 //"Stratos", /* noncanonical */
581 //"Eden", /* TOS: "The Way to Eden" (in Romulan space) */
582 //"Arrikis", /* noncanonical */
583 //"Epsilon Eridani IV", /* noncanonical */
584 "Exo III", /* TOS: "What Are Little Girls Made Of?" (Class P) */
587 return names[planet->inhabited];