3 static char *classes[] = {"M","N","O"};
5 static bool consumeTime(void)
6 /* abort a lengthy operation if an event interrupts it */
10 if (game.alldone || game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova || game.justin)
16 /* report on (uninhabited) planets in the galaxy */
22 prout(_("Spock- \"Planet report follows, Captain.\""));
24 for (i = 0; i < game.inplan; i++) {
25 if (game.state.planets[i].pclass == destroyed)
27 if ((game.state.planets[i].known != unknown
28 && game.state.planets[i].inhabited == UNINHABITED)
31 if (idebug && game.state.planets[i].known==unknown)
33 proutn(cramlc(quadrant, game.state.planets[i].w));
35 proutn(classes[game.state.planets[i].pclass]);
37 if (game.state.planets[i].crystals != present)
39 prout(_("dilithium crystals present."));
40 if (game.state.planets[i].known==shuttle_down)
41 prout(_(" Shuttle Craft Galileo on surface."));
45 prout(_("No information available."));
49 /* enter standard orbit */
54 prout(_("Already in standard orbit."));
57 if (damaged(DWARPEN) && damaged(DIMPULS)) {
58 prout(_("Both warp and impulse engines damaged."));
61 if (!is_valid(game.plnet) || abs(game.sector.x-game.plnet.x) > 1 || abs(game.sector.y-game.plnet.y) > 1) {
63 prout(_(" not adjacent to planet."));
67 game.optime = 0.02+0.03*Rand();
68 prout(_("Helmsman Sulu- \"Entering standard orbit, Sir.\""));
72 game.height = (1400.0+7200.0*Rand());
73 prout(_("Sulu- \"Entered orbit at altitude %.2f kilometers.\""), game.height);
79 /* examine planets in this quadrant */
81 if (damaged(DSRSENS)) {
82 prout(_("Short range sensors damaged."));
85 if (!is_valid(game.plnet) && (game.options & OPTION_TTY)) {
86 prout(_("Spock- \"No planet in this quadrant, Captain.\""));
89 if (is_valid(game.plnet) && (game.state.planets[game.iplnet].known == unknown)) {
90 prout(_("Spock- \"Sensor scan for %s-"), cramlc(quadrant, game.quadrant));
92 prout(_(" Planet at %s is of class %s."),
93 cramlc(sector,game.plnet),
94 classes[game.state.planets[game.iplnet].pclass]);
95 if (game.state.planets[game.iplnet].known==shuttle_down)
96 prout(_(" Sensors show Galileo still on surface."));
97 proutn(_(" Readings indicate"));
98 if (game.state.planets[game.iplnet].crystals != present)
100 prout(_(" dilithium crystals present.\""));
101 if (game.state.planets[game.iplnet].known == unknown)
102 game.state.planets[game.iplnet].known = known;
107 /* use the transporter */
112 if (damaged(DTRANSP)) {
113 prout(_("Transporter damaged."));
114 if (!damaged(DSHUTTL) && (game.state.planets[game.iplnet].known==shuttle_down || game.iscraft == onship)) {
116 proutn(_("Spock- \"May I suggest the shuttle craft, Sir?\" "));
124 prout(_(" not in standard orbit."));
128 prout(_("Impossible to transport through shields."));
131 if (game.state.planets[game.iplnet].known==unknown) {
132 prout(_("Spock- \"Captain, we have no information on this planet"));
133 prout(_(" and Starfleet Regulations clearly state that in this situation"));
134 prout(_(" you may not go down.\""));
137 if (!game.landed && game.state.planets[game.iplnet].crystals==absent) {
138 prout(_("Spock- \"Captain, I fail to see the logic in"));
139 prout(_(" exploring a planet with no dilithium crystals."));
140 proutn(_(" Are you sure this is wise?\" "));
146 if (!(game.options & OPTION_PLAIN)) {
147 nrgneed = 50 * game.skill + game.height / 100.0;
148 if (nrgneed > game.energy) {
149 prout(_("Engineering to bridge--"));
150 prout(_(" Captain, we don't have enough energy for transportation."));
153 if (!game.landed && nrgneed * 2 > game.energy) {
154 prout(_("Engineering to bridge--"));
155 prout(_(" Captain, we have enough energy only to transport you down to"));
156 prout(_(" the planet, but there wouldn't be an energy for the trip back."));
157 if (game.state.planets[game.iplnet].known == shuttle_down)
158 prout(_(" However, the Galileo shuttle craft may still be on a surface."));
159 proutn(_(" Are you sure this is wise?\" "));
167 /* Coming from planet */
168 if (game.state.planets[game.iplnet].known==shuttle_down) {
169 proutn(_("Spock- \"Wouldn't you rather take the Galileo?\" "));
174 prout(_("Your crew hides the Galileo to prevent capture by aliens."));
176 prout(_("Landing party assembled, ready to beam up."));
178 prout(_("Kirk whips out communicator..."));
179 prouts(_("BEEP BEEP BEEP"));
181 prout(_("\"Kirk to enterprise- Lock on coordinates...energize.\""));
184 /* Going to planet */
185 prout(_("Scotty- \"Transporter room ready, Sir.\""));
187 prout(_("Kirk and landing party prepare to beam down to planet surface."));
189 prout(_("Kirk- \"Energize.\""));
193 prouts("WWHOOOIIIIIRRRRREEEE.E.E. . . . . . .");
196 prouts("BOOOIIIOOOIIOOOOIIIOIING . . .");
198 prout(_("Scotty- \"Oh my God! I've lost them.\""));
202 prouts(". . . . . . .E.E.EEEERRRRRIIIIIOOOHWW");
203 game.landed = !game.landed;
204 game.energy -= nrgneed;
206 prout(_("Transport complete."));
207 if (game.landed && game.state.planets[game.iplnet].known==shuttle_down) {
208 prout(_("The shuttle craft Galileo is here!"));
210 if (!game.landed && game.imine) {
219 /* strip-mine a world for dilithium */
224 prout(_("Mining party not on planet."));
227 if (game.state.planets[game.iplnet].crystals == mined) {
228 prout(_("This planet has already been strip-mined for dilithium."));
231 else if (game.state.planets[game.iplnet].crystals == absent) {
232 prout(_("No dilithium crystals on this planet."));
236 prout(_("You've already mined enough crystals for this trip."));
239 if (game.icrystl && game.cryprob == 0.05) {
240 proutn(_("With all those fresh crystals aboard the "));
243 prout(_("there's no reason to mine more at this time."));
246 game.optime = (0.1+0.2*Rand())*game.state.planets[game.iplnet].pclass;
249 prout(_("Mining operation complete."));
250 game.state.planets[game.iplnet].crystals = mined;
251 game.imine = game.ididit = true;
254 void usecrystals(void)
255 /* use dilithium crystals */
261 prout(_("No dilithium crystals available."));
264 if (game.energy >= 1000) {
265 prout(_("Spock- \"Captain, Starfleet Regulations prohibit such an operation"));
266 prout(_(" except when Condition Yellow exists."));
269 prout(_("Spock- \"Captain, I must warn you that loading"));
270 prout(_(" raw dilithium crystals into the ship's power"));
271 prout(_(" system may risk a severe explosion."));
272 proutn(_(" Are you sure this is wise?\" "));
278 prout(_("Engineering Officer Scott- \"(GULP) Aye Sir."));
279 prout(_(" Mr. Spock and I will try it.\""));
281 prout(_("Spock- \"Crystals in place, Sir."));
282 prout(_(" Ready to activate circuit.\""));
284 prouts(_("Scotty- \"Keep your fingers crossed, Sir!\""));
286 if (Rand() <= game.cryprob) {
287 prouts(_(" \"Activating now! - - No good! It's***"));
289 prouts(_("***RED ALERT! RED A*L********************************"));
292 prouts(_("****************** KA-BOOM!!!! *******************"));
297 game.energy += 5000.0*(1.0 + 0.9*Rand());
298 prouts(_(" \"Activating now! - - "));
299 prout(_("The instruments"));
300 prout(_(" are going crazy, but I think it's"));
301 prout(_(" going to work!! Congratulations, Sir!\""));
307 /* use shuttlecraft for planetary jaunt */
311 if(damaged(DSHUTTL)) {
312 if (game.damage[DSHUTTL] == -1.0) {
313 if (game.inorbit && game.state.planets[game.iplnet].known == shuttle_down)
314 prout(_("Ye Faerie Queene has no shuttle craft bay to dock it at."));
316 prout(_("Ye Faerie Queene had no shuttle craft."));
318 else if (game.damage[DSHUTTL] > 0)
319 prout(_("The Galileo is damaged."));
320 else /* game.damage[DSHUTTL] < 0 */
321 prout(_("Shuttle craft is now serving Big Macs."));
326 prout(_(" not in standard orbit."));
329 if ((game.state.planets[game.iplnet].known != shuttle_down) && game.iscraft != onship) {
330 prout(_("Shuttle craft not currently available."));
333 if (!game.landed && game.state.planets[game.iplnet].known==shuttle_down) {
334 prout(_("You will have to beam down to retrieve the shuttle craft."));
337 if (game.shldup || game.condition == docked) {
338 prout(_("Shuttle craft cannot pass through shields."));
341 if (game.state.planets[game.iplnet].known==unknown) {
342 prout(_("Spock- \"Captain, we have no information on this planet"));
343 prout(_(" and Starfleet Regulations clearly state that in this situation"));
344 prout(_(" you may not fly down.\""));
347 game.optime = 3.0e-5*game.height;
348 if (game.optime >= 0.8*game.state.remtime) {
349 prout(_("First Officer Spock- \"Captain, I compute that such"));
350 proutn(_(" a maneuver would require approximately %2d%% of our"),
351 (int)(100*game.optime/game.state.remtime));
352 prout(_("remaining time."));
353 proutn(_("Are you sure this is wise?\" "));
361 if (game.iscraft == onship) {
362 /* Galileo on ship! */
363 if (!damaged(DTRANSP)) {
364 proutn(_("Spock- \"Would you rather use the transporter?\" "));
369 proutn(_("Shuttle crew"));
372 proutn(_("Rescue party"));
373 prout(_(" boards Galileo and swoops toward planet surface."));
374 game.iscraft = offship;
378 game.state.planets[game.iplnet].known=shuttle_down;
379 prout(_("Trip complete."));
383 /* Ready to go back to ship */
384 prout(_("You and your mining party board the"));
385 prout(_("shuttle craft for the trip back to the Enterprise."));
387 prouts(_("The short hop begins . . ."));
389 game.state.planets[game.iplnet].known=known;
395 game.iscraft = onship;
402 prout(_("Trip complete."));
408 /* and so is Galileo */
409 prout(_("Mining party assembles in the hangar deck,"));
410 prout(_("ready to board the shuttle craft \"Galileo\"."));
412 prouts(_("The hangar doors open; the trip begins."));
415 game.iscraft = offship;
418 game.state.planets[game.iplnet].known = shuttle_down;
421 prout(_("Trip complete."));
427 /* use the big zapper */
429 double dprob, r = Rand();
434 if (game.ship != IHE) {
435 prout(_("Ye Faerie Queene has no death ray."));
438 if (game.nenhere==0) {
439 prout(_("Sulu- \"But Sir, there are no enemies in this quadrant.\""));
442 if (damaged(DDRAY)) {
443 prout(_("Death Ray is damaged."));
446 prout(_("Spock- \"Captain, the 'Experimental Death Ray'"));
447 prout(_(" is highly unpredictible. Considering the alternatives,"));
448 proutn(_(" are you sure this is wise?\" "));
451 prout(_("Spock- \"Acknowledged.\""));
454 prouts(_("WHOOEE ... WHOOEE ... WHOOEE ... WHOOEE"));
456 prout(_("Crew scrambles in emergency preparation."));
457 prout(_("Spock and Scotty ready the death ray and"));
458 prout(_("prepare to channel all ship's power to the device."));
460 prout(_("Spock- \"Preparations complete, sir.\""));
461 prout(_("Kirk- \"Engage!\""));
463 prouts(_("WHIRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"));
466 if (game.options & OPTION_PLAIN)
469 prouts(_("Sulu- \"Captain! It's working!\""));
471 while (game.nenhere > 0)
472 deadkl(game.ks[1], game.quad[game.ks[1].x][game.ks[1].y],game.ks[1]);
473 prout(_("Ensign Chekov- \"Congratulations, Captain!\""));
474 if ((game.state.remkl + game.state.remcom + game.state.nscrem) == 0)
476 if ((game.options & OPTION_PLAIN) == 0) {
477 prout(_("Spock- \"Captain, I believe the `Experimental Death Ray'"));
478 if (Rand() <= 0.05) {
479 prout(_(" is still operational.\""));
482 prout(_(" has been rendered nonfunctional.\""));
483 game.damage[DDRAY] = 39.95;
488 r = Rand(); // Pick failure method
490 prouts(_("Sulu- \"Captain! It's working!\""));
492 prouts(_("***RED ALERT! RED ALERT!"));
494 prout(_("***MATTER-ANTIMATTER IMPLOSION IMMINENT!"));
496 prouts(_("***RED ALERT! RED A*L********************************"));
499 prouts(_("****************** KA-BOOM!!!! *******************"));
505 prouts(_("Sulu- \"Captain! Yagabandaghangrapl, brachriigringlanbla!\""));
507 prout(_("Lt. Uhura- \"Graaeek! Graaeek!\""));
509 prout(_("Spock- \"Fascinating! . . . All humans aboard"));
510 prout(_(" have apparently been transformed into strange mutations."));
511 prout(_(" Vulcans do not seem to be affected."));
513 prout(_("Kirk- \"Raauch! Raauch!\""));
519 prouts(_("Sulu- \"Captain! It's --WHAT?!?!\""));
521 proutn(_("Spock- \"I believe the word is"));
522 prouts(_(" *ASTONISHING*"));
523 prout(_(" Mr. Sulu."));
524 for (i = 1; i <= QUADSIZE; i++)
525 for (j = 1; j <= QUADSIZE; j++)
526 if (game.quad[i][j] == IHDOT)
527 game.quad[i][j] = IHQUEST;
528 prout(_(" Captain, our quadrant is now infested with"));
529 prouts(_(" - - - - - - *THINGS*."));
531 prout(_(" I have no logical explanation.\""));
534 prouts(_("Sulu- \"Captain! The Death Ray is creating tribbles!\""));
536 prout(_("Scotty- \"There are so many tribbles down here"));
537 prout(_(" in Engineering, we can't move for 'em, Captain.\""));