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].known != unknown
26 && game.state.planets[i].inhabited == UNINHABITED)
27 || (idebug && game.state.planets[i].w.x !=0)
30 if (idebug && game.state.planets[i].known==unknown)
32 proutn(cramlc(quadrant, game.state.planets[i].w));
34 proutn(classes[game.state.planets[i].pclass]);
36 if (game.state.planets[i].crystals != present)
38 prout(_("dilithium crystals present."));
39 if (game.state.planets[i].known==shuttle_down)
40 prout(_(" Shuttle Craft Galileo on surface."));
44 prout(_("No information available."));
48 /* enter standard orbit */
53 prout(_("Already in standard orbit."));
56 if (damaged(DWARPEN) && damaged(DIMPULS)) {
57 prout(_("Both warp and impulse engines damaged."));
60 if (!is_valid(game.plnet) || abs(game.sector.x-game.plnet.x) > 1 || abs(game.sector.y-game.plnet.y) > 1) {
62 prout(_(" not adjacent to planet."));
66 game.optime = 0.02+0.03*Rand();
67 prout(_("Helmsman Sulu- \"Entering standard orbit, Sir.\""));
71 game.height = (1400.0+7200.0*Rand());
72 prout(_("Sulu- \"Entered orbit at altitude %.2f kilometers.\""), game.height);
78 /* examine planets in this quadrant */
82 if (damaged(DSRSENS)) {
83 prout(_("Short range sensors damaged."));
86 if (!game.plnet.x && (game.options & OPTION_TTY)) {
87 prout(_("Spock- \"No planet in this quadrant, Captain.\""));
90 if ((game.plnet.x != 0)&& (game.state.planets[game.iplnet].known == unknown)) {
91 prout(_("Spock- \"Sensor scan for %s-"), cramlc(quadrant, game.quadrant));
93 prout(_(" Planet at %s is of class %s."),
94 cramlc(sector,game.plnet),
95 classes[game.state.planets[game.iplnet].pclass]);
96 if (game.state.planets[game.iplnet].known==shuttle_down)
97 prout(_(" Sensors show Galileo still on surface."));
98 proutn(_(" Readings indicate"));
99 if (game.state.planets[game.iplnet].crystals != present)
101 prout(_(" dilithium crystals present.\""));
102 if (game.state.planets[game.iplnet].known == unknown)
103 game.state.planets[game.iplnet].known = known;
108 /* 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.\""));
138 /* Coming from planet */
139 if (game.state.planets[game.iplnet].known==shuttle_down) {
140 proutn(_("Spock- \"Wouldn't you rather take the Galileo?\" "));
145 prout(_("Your crew hides the Galileo to prevent capture by aliens."));
147 prout(_("Landing party assembled, ready to beam up."));
149 prout(_("Kirk whips out communicator..."));
150 prouts(_("BEEP BEEP BEEP"));
152 prout(_("\"Kirk to enterprise- Lock on coordinates...energize.\""));
155 /* Going to planet */
156 if (game.state.planets[game.iplnet].crystals==absent) {
157 prout(_("Spock- \"Captain, I fail to see the logic in"));
158 prout(_(" exploring a planet with no dilithium crystals."));
159 proutn(_(" Are you sure this is wise?\" "));
165 prout(_("Scotty- \"Transporter room ready, Sir.\""));
167 prout(_("Kirk and landing party prepare to beam down to planet surface."));
169 prout(_("Kirk- \"Energize.\""));
173 prouts("WWHOOOIIIIIRRRRREEEE.E.E. . . . . . .");
176 prouts("BOOOIIIOOOIIOOOOIIIOIING . . .");
178 prout(_("Scotty- \"Oh my God! I've lost them.\""));
182 prouts(". . . . . . .E.E.EEEERRRRRIIIIIOOOHWW");
184 prout(_("Transport complete."));
185 game.landed = !game.landed;
186 if (game.landed && game.state.planets[game.iplnet].known==shuttle_down) {
187 prout(_("The shuttle craft Galileo is here!"));
189 if (!game.landed && game.imine) {
198 /* strip-mine a world for dilithium */
203 prout(_("Mining party not on planet."));
206 if (game.state.planets[game.iplnet].crystals == mined) {
207 prout(_("This planet has already been strip-mined for dilithium."));
210 else if (game.state.planets[game.iplnet].crystals == absent) {
211 prout(_("No dilithium crystals on this planet."));
215 prout(_("You've already mined enough crystals for this trip."));
218 if (game.icrystl && game.cryprob == 0.05) {
219 proutn(_("With all those fresh crystals aboard the "));
222 prout(_("there's no reason to mine more at this time."));
225 game.optime = (0.1+0.2*Rand())*game.state.planets[game.iplnet].pclass;
228 prout(_("Mining operation complete."));
229 game.state.planets[game.iplnet].crystals = mined;
230 game.imine = game.ididit = true;
233 void usecrystals(void)
234 /* use dilithium crystals */
240 prout(_("No dilithium crystals available."));
243 if (game.energy >= 1000) {
244 prout(_("Spock- \"Captain, Starfleet Regulations prohibit such an operation"));
245 prout(_(" except when Condition Yellow exists."));
248 prout(_("Spock- \"Captain, I must warn you that loading"));
249 prout(_(" raw dilithium crystals into the ship's power"));
250 prout(_(" system may risk a severe explosion."));
251 proutn(_(" Are you sure this is wise?\" "));
257 prout(_("Engineering Officer Scott- \"(GULP) Aye Sir."));
258 prout(_(" Mr. Spock and I will try it.\""));
260 prout(_("Spock- \"Crystals in place, Sir."));
261 prout(_(" Ready to activate circuit.\""));
263 prouts(_("Scotty- \"Keep your fingers crossed, Sir!\""));
265 if (Rand() <= game.cryprob) {
266 prouts(_(" \"Activating now! - - No good! It's***"));
268 prouts(_("***RED ALERT! RED A*L********************************"));
271 prouts(_("****************** KA-BOOM!!!! *******************"));
276 game.energy += 5000.0*(1.0 + 0.9*Rand());
277 prouts(_(" \"Activating now! - - "));
278 prout(_("The instruments"));
279 prout(_(" are going crazy, but I think it's"));
280 prout(_(" going to work!! Congratulations, Sir!\""));
286 /* use shuttlecraft for planetary jaunt */
290 if(damaged(DSHUTTL)) {
291 if (game.damage[DSHUTTL] == -1.0) {
292 if (game.inorbit && game.state.planets[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 /* game.damage[DSHUTTL] < 0 */
300 prout(_("Shuttle craft is now serving Big Macs."));
305 prout(_(" not in standard orbit."));
308 if ((game.state.planets[game.iplnet].known != shuttle_down) && game.iscraft != onship) {
309 prout(_("Shuttle craft not currently available."));
312 if (!game.landed && game.state.planets[game.iplnet].known==shuttle_down) {
313 prout(_("You will have to beam down to retrieve the shuttle craft."));
316 if (game.shldup || game.condition == docked) {
317 prout(_("Shuttle craft cannot pass through shields."));
320 if (game.state.planets[game.iplnet].known==unknown) {
321 prout(_("Spock- \"Captain, we have no information on this planet"));
322 prout(_(" and Starfleet Regulations clearly state that in this situation"));
323 prout(_(" you may not fly down.\""));
326 game.optime = 3.0e-5*game.height;
327 if (game.optime >= 0.8*game.state.remtime) {
328 prout(_("First Officer Spock- \"Captain, I compute that such"));
329 proutn(_(" a maneuver would require approximately %2d%% of our"),
330 (int)(100*game.optime/game.state.remtime));
331 prout(_("remaining time."));
332 proutn(_("Are you sure this is wise?\" "));
340 if (game.iscraft == onship) {
341 /* Galileo on ship! */
342 if (!damaged(DTRANSP)) {
343 proutn(_("Spock- \"Would you rather use the transporter?\" "));
348 proutn(_("Shuttle crew"));
351 proutn(_("Rescue party"));
352 prout(_(" boards Galileo and swoops toward planet surface."));
353 game.iscraft = offship;
357 game.state.planets[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.planets[game.iplnet].known=known;
373 game.iscraft = onship;
380 prout(_("Trip complete."));
386 /* and so is Galileo */
387 prout(_("Mining party assembles in the hangar deck,"));
388 prout(_("ready to board the shuttle craft \"Galileo\"."));
390 prouts(_("The hangar doors open; the trip begins."));
393 game.iscraft = offship;
396 game.state.planets[game.iplnet].known = shuttle_down;
399 prout(_("Trip complete."));
405 /* use the big zapper */
407 double dprob, r = Rand();
412 if (game.ship != IHE) {
413 prout(_("Ye Faerie Queene has no death ray."));
416 if (game.nenhere==0) {
417 prout(_("Sulu- \"But Sir, there are no enemies in this quadrant.\""));
420 if (damaged(DDRAY)) {
421 prout(_("Death Ray is damaged."));
424 prout(_("Spock- \"Captain, the 'Experimental Death Ray'"));
425 prout(_(" is highly unpredictible. Considering the alternatives,"));
426 proutn(_(" are you sure this is wise?\" "));
429 prout(_("Spock- \"Acknowledged.\""));
432 prouts(_("WHOOEE ... WHOOEE ... WHOOEE ... WHOOEE"));
434 prout(_("Crew scrambles in emergency preparation."));
435 prout(_("Spock and Scotty ready the death ray and"));
436 prout(_("prepare to channel all ship's power to the device."));
438 prout(_("Spock- \"Preparations complete, sir.\""));
439 prout(_("Kirk- \"Engage!\""));
441 prouts(_("WHIRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"));
444 if (game.options & OPTION_PLAIN)
447 prouts(_("Sulu- \"Captain! It's working!\""));
449 while (game.nenhere > 0)
450 deadkl(game.ks[1], game.quad[game.ks[1].x][game.ks[1].y],game.ks[1]);
451 prout(_("Ensign Chekov- \"Congratulations, Captain!\""));
454 if ((game.options & OPTION_PLAIN) == 0) {
455 prout(_("Spock- \"Captain, I believe the `Experimental Death Ray'"));
456 if (Rand() <= 0.05) {
457 prout(_(" is still operational.\""));
460 prout(_(" has been rendered nonfunctional.\""));
461 game.damage[DDRAY] = 39.95;
466 r = Rand(); // Pick failure method
468 prouts(_("Sulu- \"Captain! It's working!\""));
470 prouts(_("***RED ALERT! RED ALERT!"));
472 prout(_("***MATTER-ANTIMATTER IMPLOSION IMMINENT!"));
474 prouts(_("***RED ALERT! RED A*L********************************"));
477 prouts(_("****************** KA-BOOM!!!! *******************"));
483 prouts(_("Sulu- \"Captain! Yagabandaghangrapl, brachriigringlanbla!\""));
485 prout(_("Lt. Uhura- \"Graaeek! Graaeek!\""));
487 prout(_("Spock- \"Fascinating! . . . All humans aboard"));
488 prout(_(" have apparently been transformed into strange mutations."));
489 prout(_(" Vulcans do not seem to be affected."));
491 prout(_("Kirk- \"Raauch! Raauch!\""));
497 prouts(_("Sulu- \"Captain! It's --WHAT?!?!\""));
499 proutn(_("Spock- \"I believe the word is"));
500 prouts(_(" *ASTONISHING*"));
501 prout(_(" Mr. Sulu."));
504 if (game.quad[i][j] == IHDOT)
505 game.quad[i][j] = IHQUEST;
506 prout(_(" Captain, our quadrant is now infested with"));
507 prouts(_(" - - - - - - *THINGS*."));
509 prout(_(" I have no logical explanation.\""));
512 prouts(_("Sulu- \"Captain! The Death Ray is creating tribbles!\""));
514 prout(_("Scotty- \"There are so many tribbles down here"));
515 prout(_(" in Engineering, we can't move for 'em, Captain.\""));