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 */
83 if (damaged(DSRSENS)) {
84 prout(_("Short range sensors damaged."));
87 if (!game.plnet.x && (game.options & OPTION_TTY)) {
88 prout(_("Spock- \"No planet in this quadrant, Captain.\""));
91 if ((game.plnet.x != 0)&& (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 */
113 if (damaged(DTRANSP)) {
114 prout(_("Transporter damaged."));
115 if (!damaged(DSHUTTL) && (game.state.planets[game.iplnet].known==shuttle_down || game.iscraft == onship)) {
117 proutn(_("Spock- \"May I suggest the shuttle craft, Sir?\" "));
125 prout(_(" not in standard orbit."));
129 prout(_("Impossible to transport through shields."));
132 if (game.state.planets[game.iplnet].known==unknown) {
133 prout(_("Spock- \"Captain, we have no information on this planet"));
134 prout(_(" and Starfleet Regulations clearly state that in this situation"));
135 prout(_(" you may not go down.\""));
139 /* Coming from planet */
140 if (game.state.planets[game.iplnet].known==shuttle_down) {
141 proutn(_("Spock- \"Wouldn't you rather take the Galileo?\" "));
146 prout(_("Your crew hides the Galileo to prevent capture by aliens."));
148 prout(_("Landing party assembled, ready to beam up."));
150 prout(_("Kirk whips out communicator..."));
151 prouts(_("BEEP BEEP BEEP"));
153 prout(_("\"Kirk to enterprise- Lock on coordinates...energize.\""));
156 /* Going to planet */
157 if (game.state.planets[game.iplnet].crystals==absent) {
158 prout(_("Spock- \"Captain, I fail to see the logic in"));
159 prout(_(" exploring a planet with no dilithium crystals."));
160 proutn(_(" Are you sure this is wise?\" "));
166 prout(_("Scotty- \"Transporter room ready, Sir.\""));
168 prout(_("Kirk and landing party prepare to beam down to planet surface."));
170 prout(_("Kirk- \"Energize.\""));
174 prouts("WWHOOOIIIIIRRRRREEEE.E.E. . . . . . .");
177 prouts("BOOOIIIOOOIIOOOOIIIOIING . . .");
179 prout(_("Scotty- \"Oh my God! I've lost them.\""));
183 prouts(". . . . . . .E.E.EEEERRRRRIIIIIOOOHWW");
185 prout(_("Transport complete."));
186 game.landed = !game.landed;
187 if (game.landed && game.state.planets[game.iplnet].known==shuttle_down) {
188 prout(_("The shuttle craft Galileo is here!"));
190 if (!game.landed && game.imine) {
199 /* strip-mine a world for dilithium */
204 prout(_("Mining party not on planet."));
207 if (game.state.planets[game.iplnet].crystals == mined) {
208 prout(_("This planet has already been strip-mined for dilithium."));
211 else if (game.state.planets[game.iplnet].crystals == absent) {
212 prout(_("No dilithium crystals on this planet."));
216 prout(_("You've already mined enough crystals for this trip."));
219 if (game.icrystl && game.cryprob == 0.05) {
220 proutn(_("With all those fresh crystals aboard the "));
223 prout(_("there's no reason to mine more at this time."));
226 game.optime = (0.1+0.2*Rand())*game.state.planets[game.iplnet].pclass;
229 prout(_("Mining operation complete."));
230 game.state.planets[game.iplnet].crystals = mined;
231 game.imine = game.ididit = true;
234 void usecrystals(void)
235 /* use dilithium crystals */
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!\""));
287 /* use shuttlecraft for planetary jaunt */
291 if(damaged(DSHUTTL)) {
292 if (game.damage[DSHUTTL] == -1.0) {
293 if (game.inorbit && game.state.planets[game.iplnet].known == shuttle_down)
294 prout(_("Ye Faerie Queene has no shuttle craft bay to dock it at."));
296 prout(_("Ye Faerie Queene had no shuttle craft."));
298 else if (game.damage[DSHUTTL] > 0)
299 prout(_("The Galileo is damaged."));
300 else /* game.damage[DSHUTTL] < 0 */
301 prout(_("Shuttle craft is now serving Big Macs."));
306 prout(_(" not in standard orbit."));
309 if ((game.state.planets[game.iplnet].known != shuttle_down) && game.iscraft != onship) {
310 prout(_("Shuttle craft not currently available."));
313 if (!game.landed && game.state.planets[game.iplnet].known==shuttle_down) {
314 prout(_("You will have to beam down to retrieve the shuttle craft."));
317 if (game.shldup || game.condition == docked) {
318 prout(_("Shuttle craft cannot pass through shields."));
321 if (game.state.planets[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?\" "));
341 if (game.iscraft == onship) {
342 /* Galileo on ship! */
343 if (!damaged(DTRANSP)) {
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."));
354 game.iscraft = offship;
358 game.state.planets[game.iplnet].known=shuttle_down;
359 prout(_("Trip complete."));
363 /* Ready to go back to ship */
364 prout(_("You and your mining party board the"));
365 prout(_("shuttle craft for the trip back to the Enterprise."));
367 prout(_("The short hop begins . . ."));
368 game.state.planets[game.iplnet].known=known;
374 game.iscraft = onship;
381 prout(_("Trip complete."));
387 /* and so is Galileo */
388 prout(_("Mining party assembles in the hangar deck,"));
389 prout(_("ready to board the shuttle craft \"Galileo\"."));
391 prouts(_("The hangar doors open; the trip begins."));
394 game.iscraft = offship;
397 game.state.planets[game.iplnet].known = shuttle_down;
400 prout(_("Trip complete."));
406 /* use the big zapper */
408 double dprob, r = Rand();
413 if (game.ship != IHE) {
414 prout(_("Ye Faerie Queene has no death ray."));
417 if (game.nenhere==0) {
418 prout(_("Sulu- \"But Sir, there are no enemies in this quadrant.\""));
421 if (damaged(DDRAY)) {
422 prout(_("Death Ray is damaged."));
425 prout(_("Spock- \"Captain, the 'Experimental Death Ray'"));
426 prout(_(" is highly unpredictible. Considering the alternatives,"));
427 proutn(_(" are you sure this is wise?\" "));
430 prout(_("Spock- \"Acknowledged.\""));
433 prouts(_("WHOOEE ... WHOOEE ... WHOOEE ... WHOOEE"));
435 prout(_("Crew scrambles in emergency preparation."));
436 prout(_("Spock and Scotty ready the death ray and"));
437 prout(_("prepare to channel all ship's power to the device."));
439 prout(_("Spock- \"Preparations complete, sir.\""));
440 prout(_("Kirk- \"Engage!\""));
442 prouts(_("WHIRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"));
445 if (game.options & OPTION_PLAIN)
448 prouts(_("Sulu- \"Captain! It's working!\""));
450 while (game.nenhere > 0)
451 deadkl(game.ks[1], game.quad[game.ks[1].x][game.ks[1].y],game.ks[1]);
452 prout(_("Ensign Chekov- \"Congratulations, Captain!\""));
455 if ((game.options & OPTION_PLAIN) == 0) {
456 prout(_("Spock- \"Captain, I believe the `Experimental Death Ray'"));
457 if (Rand() <= 0.05) {
458 prout(_(" is still operational.\""));
461 prout(_(" has been rendered nonfunctional.\""));
462 game.damage[DDRAY] = 39.95;
467 r = Rand(); // Pick failure method
469 prouts(_("Sulu- \"Captain! It's working!\""));
471 prouts(_("***RED ALERT! RED ALERT!"));
473 prout(_("***MATTER-ANTIMATTER IMPLOSION IMMINENT!"));
475 prouts(_("***RED ALERT! RED A*L********************************"));
478 prouts(_("****************** KA-BOOM!!!! *******************"));
484 prouts(_("Sulu- \"Captain! Yagabandaghangrapl, brachriigringlanbla!\""));
486 prout(_("Lt. Uhura- \"Graaeek! Graaeek!\""));
488 prout(_("Spock- \"Fascinating! . . . All humans aboard"));
489 prout(_(" have apparently been transformed into strange mutations."));
490 prout(_(" Vulcans do not seem to be affected."));
492 prout(_("Kirk- \"Raauch! Raauch!\""));
498 prouts(_("Sulu- \"Captain! It's --WHAT?!?!\""));
500 proutn(_("Spock- \"I believe the word is"));
501 prouts(_(" *ASTONISHING*"));
502 prout(_(" Mr. Sulu."));
503 for (i = 1; i <= QUADSIZE; i++)
504 for (j = 1; j <= QUADSIZE; j++)
505 if (game.quad[i][j] == IHDOT)
506 game.quad[i][j] = IHQUEST;
507 prout(_(" Captain, our quadrant is now infested with"));
508 prouts(_(" - - - - - - *THINGS*."));
510 prout(_(" I have no logical explanation.\""));
513 prouts(_("Sulu- \"Captain! The Death Ray is creating tribbles!\""));
515 prout(_("Scotty- \"There are so many tribbles down here"));
516 prout(_(" in Engineering, we can't move for 'em, Captain.\""));