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 if (game.options & OPTION_TTY)
83 prout(_("Short range sensors damaged."));
86 if (!is_valid(game.plnet)) {
87 if (game.options & OPTION_TTY)
88 prout(_("Spock- \"No planet in this quadrant, Captain.\""));
91 if (game.state.planets[game.iplnet].known == unknown) {
92 prout(_("Spock- \"Sensor scan for %s-"), cramlc(quadrant, game.quadrant));
94 prout(_(" Planet at %s is of class %s."),
95 cramlc(sector,game.plnet),
96 classes[game.state.planets[game.iplnet].pclass]);
97 if (game.state.planets[game.iplnet].known==shuttle_down)
98 prout(_(" Sensors show Galileo still on surface."));
99 proutn(_(" Readings indicate"));
100 if (game.state.planets[game.iplnet].crystals != present)
102 prout(_(" dilithium crystals present.\""));
103 if (game.state.planets[game.iplnet].known == unknown)
104 game.state.planets[game.iplnet].known = known;
109 /* use the transporter */
114 if (damaged(DTRANSP)) {
115 prout(_("Transporter damaged."));
116 if (!damaged(DSHUTTL) && (game.state.planets[game.iplnet].known==shuttle_down || game.iscraft == onship)) {
118 proutn(_("Spock- \"May I suggest the shuttle craft, Sir?\" "));
126 prout(_(" not in standard orbit."));
130 prout(_("Impossible to transport through shields."));
133 if (game.state.planets[game.iplnet].known==unknown) {
134 prout(_("Spock- \"Captain, we have no information on this planet"));
135 prout(_(" and Starfleet Regulations clearly state that in this situation"));
136 prout(_(" you may not go down.\""));
139 if (!game.landed && game.state.planets[game.iplnet].crystals==absent) {
140 prout(_("Spock- \"Captain, I fail to see the logic in"));
141 prout(_(" exploring a planet with no dilithium crystals."));
142 proutn(_(" Are you sure this is wise?\" "));
148 if (!(game.options & OPTION_PLAIN)) {
149 nrgneed = 50 * game.skill + game.height / 100.0;
150 if (nrgneed > game.energy) {
151 prout(_("Engineering to bridge--"));
152 prout(_(" Captain, we don't have enough energy for transportation."));
155 if (!game.landed && nrgneed * 2 > game.energy) {
156 prout(_("Engineering to bridge--"));
157 prout(_(" Captain, we have enough energy only to transport you down to"));
158 prout(_(" the planet, but there wouldn't be an energy for the trip back."));
159 if (game.state.planets[game.iplnet].known == shuttle_down)
160 prout(_(" Although the Galileo shuttle craft may still be on a surface."));
161 proutn(_(" Are you sure this is wise?\" "));
169 /* Coming from planet */
170 if (game.state.planets[game.iplnet].known==shuttle_down) {
171 proutn(_("Spock- \"Wouldn't you rather take the Galileo?\" "));
176 prout(_("Your crew hides the Galileo to prevent capture by aliens."));
178 prout(_("Landing party assembled, ready to beam up."));
180 prout(_("Kirk whips out communicator..."));
181 prouts(_("BEEP BEEP BEEP"));
183 prout(_("\"Kirk to enterprise- Lock on coordinates...energize.\""));
186 /* Going to planet */
187 prout(_("Scotty- \"Transporter room ready, Sir.\""));
189 prout(_("Kirk and landing party prepare to beam down to planet surface."));
191 prout(_("Kirk- \"Energize.\""));
195 prouts("WWHOOOIIIIIRRRRREEEE.E.E. . . . . . .");
198 prouts("BOOOIIIOOOIIOOOOIIIOIING . . .");
200 prout(_("Scotty- \"Oh my God! I've lost them.\""));
204 prouts(". . . . . . .E.E.EEEERRRRRIIIIIOOOHWW");
205 game.landed = !game.landed;
206 game.energy -= nrgneed;
208 prout(_("Transport complete."));
209 if (game.landed && game.state.planets[game.iplnet].known==shuttle_down) {
210 prout(_("The shuttle craft Galileo is here!"));
212 if (!game.landed && game.imine) {
221 /* strip-mine a world for dilithium */
226 prout(_("Mining party not on planet."));
229 if (game.state.planets[game.iplnet].crystals == mined) {
230 prout(_("This planet has already been strip-mined for dilithium."));
233 else if (game.state.planets[game.iplnet].crystals == absent) {
234 prout(_("No dilithium crystals on this planet."));
238 prout(_("You've already mined enough crystals for this trip."));
241 if (game.icrystl && game.cryprob == 0.05) {
242 proutn(_("With all those fresh crystals aboard the "));
245 prout(_("there's no reason to mine more at this time."));
248 game.optime = (0.1+0.2*Rand())*game.state.planets[game.iplnet].pclass;
251 prout(_("Mining operation complete."));
252 game.state.planets[game.iplnet].crystals = mined;
253 game.imine = game.ididit = true;
256 void usecrystals(void)
257 /* use dilithium crystals */
263 prout(_("No dilithium crystals available."));
266 if (game.energy >= 1000) {
267 prout(_("Spock- \"Captain, Starfleet Regulations prohibit such an operation"));
268 prout(_(" except when Condition Yellow exists."));
271 prout(_("Spock- \"Captain, I must warn you that loading"));
272 prout(_(" raw dilithium crystals into the ship's power"));
273 prout(_(" system may risk a severe explosion."));
274 proutn(_(" Are you sure this is wise?\" "));
280 prout(_("Engineering Officer Scott- \"(GULP) Aye Sir."));
281 prout(_(" Mr. Spock and I will try it.\""));
283 prout(_("Spock- \"Crystals in place, Sir."));
284 prout(_(" Ready to activate circuit.\""));
286 prouts(_("Scotty- \"Keep your fingers crossed, Sir!\""));
288 if (Rand() <= game.cryprob) {
289 prouts(_(" \"Activating now! - - No good! It's***"));
291 prouts(_("***RED ALERT! RED A*L********************************"));
294 prouts(_("****************** KA-BOOM!!!! *******************"));
299 game.energy += 5000.0*(1.0 + 0.9*Rand());
300 prouts(_(" \"Activating now! - - "));
301 prout(_("The instruments"));
302 prout(_(" are going crazy, but I think it's"));
303 prout(_(" going to work!! Congratulations, Sir!\""));
309 /* use shuttlecraft for planetary jaunt */
313 if(damaged(DSHUTTL)) {
314 if (game.damage[DSHUTTL] == -1.0) {
315 if (game.inorbit && game.state.planets[game.iplnet].known == shuttle_down)
316 prout(_("Ye Faerie Queene has no shuttle craft bay to dock it at."));
318 prout(_("Ye Faerie Queene had no shuttle craft."));
320 else if (game.damage[DSHUTTL] > 0)
321 prout(_("The Galileo is damaged."));
322 else /* game.damage[DSHUTTL] < 0 */
323 prout(_("Shuttle craft is now serving Big Macs."));
328 prout(_(" not in standard orbit."));
331 if ((game.state.planets[game.iplnet].known != shuttle_down) && game.iscraft != onship) {
332 prout(_("Shuttle craft not currently available."));
335 if (!game.landed && game.state.planets[game.iplnet].known==shuttle_down) {
336 prout(_("You will have to beam down to retrieve the shuttle craft."));
339 if (game.shldup || game.condition == docked) {
340 prout(_("Shuttle craft cannot pass through shields."));
343 if (game.state.planets[game.iplnet].known==unknown) {
344 prout(_("Spock- \"Captain, we have no information on this planet"));
345 prout(_(" and Starfleet Regulations clearly state that in this situation"));
346 prout(_(" you may not fly down.\""));
349 game.optime = 3.0e-5*game.height;
350 if (game.optime >= 0.8*game.state.remtime) {
351 prout(_("First Officer Spock- \"Captain, I compute that such"));
352 proutn(_(" a maneuver would require approximately %2d%% of our"),
353 (int)(100*game.optime/game.state.remtime));
354 prout(_("remaining time."));
355 proutn(_("Are you sure this is wise?\" "));
363 if (game.iscraft == onship) {
364 /* Galileo on ship! */
365 if (!damaged(DTRANSP)) {
366 proutn(_("Spock- \"Would you rather use the transporter?\" "));
371 proutn(_("Shuttle crew"));
374 proutn(_("Rescue party"));
375 prout(_(" boards Galileo and swoops toward planet surface."));
376 game.iscraft = offship;
380 game.state.planets[game.iplnet].known=shuttle_down;
381 prout(_("Trip complete."));
385 /* Ready to go back to ship */
386 prout(_("You and your mining party board the"));
387 prout(_("shuttle craft for the trip back to the Enterprise."));
389 prouts(_("The short hop begins . . ."));
391 game.state.planets[game.iplnet].known=known;
397 game.iscraft = onship;
404 prout(_("Trip complete."));
410 /* and so is Galileo */
411 prout(_("Mining party assembles in the hangar deck,"));
412 prout(_("ready to board the shuttle craft \"Galileo\"."));
414 prouts(_("The hangar doors open; the trip begins."));
417 game.iscraft = offship;
420 game.state.planets[game.iplnet].known = shuttle_down;
423 prout(_("Trip complete."));
429 /* use the big zapper */
431 double dprob, r = Rand();
436 if (game.ship != IHE) {
437 prout(_("Ye Faerie Queene has no death ray."));
440 if (game.nenhere==0) {
441 prout(_("Sulu- \"But Sir, there are no enemies in this quadrant.\""));
444 if (damaged(DDRAY)) {
445 prout(_("Death Ray is damaged."));
448 prout(_("Spock- \"Captain, the 'Experimental Death Ray'"));
449 prout(_(" is highly unpredictible. Considering the alternatives,"));
450 proutn(_(" are you sure this is wise?\" "));
453 prout(_("Spock- \"Acknowledged.\""));
456 prouts(_("WHOOEE ... WHOOEE ... WHOOEE ... WHOOEE"));
458 prout(_("Crew scrambles in emergency preparation."));
459 prout(_("Spock and Scotty ready the death ray and"));
460 prout(_("prepare to channel all ship's power to the device."));
462 prout(_("Spock- \"Preparations complete, sir.\""));
463 prout(_("Kirk- \"Engage!\""));
465 prouts(_("WHIRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"));
468 if (game.options & OPTION_PLAIN)
471 prouts(_("Sulu- \"Captain! It's working!\""));
473 while (game.nenhere > 0)
474 deadkl(game.ks[1], game.quad[game.ks[1].x][game.ks[1].y],game.ks[1]);
475 prout(_("Ensign Chekov- \"Congratulations, Captain!\""));
476 if ((game.state.remkl + game.state.remcom + game.state.nscrem) == 0)
478 if ((game.options & OPTION_PLAIN) == 0) {
479 prout(_("Spock- \"Captain, I believe the `Experimental Death Ray'"));
480 if (Rand() <= 0.05) {
481 prout(_(" is still operational.\""));
484 prout(_(" has been rendered nonfunctional.\""));
485 game.damage[DDRAY] = 39.95;
490 r = Rand(); // Pick failure method
492 prouts(_("Sulu- \"Captain! It's working!\""));
494 prouts(_("***RED ALERT! RED ALERT!"));
496 prout(_("***MATTER-ANTIMATTER IMPLOSION IMMINENT!"));
498 prouts(_("***RED ALERT! RED A*L********************************"));
501 prouts(_("****************** KA-BOOM!!!! *******************"));
507 prouts(_("Sulu- \"Captain! Yagabandaghangrapl, brachriigringlanbla!\""));
509 prout(_("Lt. Uhura- \"Graaeek! Graaeek!\""));
511 prout(_("Spock- \"Fascinating! . . . All humans aboard"));
512 prout(_(" have apparently been transformed into strange mutations."));
513 prout(_(" Vulcans do not seem to be affected."));
515 prout(_("Kirk- \"Raauch! Raauch!\""));
521 prouts(_("Sulu- \"Captain! It's --WHAT?!?!\""));
523 proutn(_("Spock- \"I believe the word is"));
524 prouts(_(" *ASTONISHING*"));
525 prout(_(" Mr. Sulu."));
526 for (i = 1; i <= QUADSIZE; i++)
527 for (j = 1; j <= QUADSIZE; j++)
528 if (game.quad[i][j] == IHDOT)
529 game.quad[i][j] = IHQUEST;
530 prout(_(" Captain, our quadrant is now infested with"));
531 prouts(_(" - - - - - - *THINGS*."));
533 prout(_(" I have no logical explanation.\""));
536 prouts(_("Sulu- \"Captain! The Death Ray is creating tribbles!\""));
538 prout(_("Scotty- \"There are so many tribbles down here"));
539 prout(_(" in Engineering, we can't move for 'em, Captain.\""));