5 static char *classes[] = {"M","N","O"};
\r
7 static int consumeTime(void) {
\r
8 /* I think most of this avoidance was caused by overlay scheme.
\r
9 Let's see what happens if all events can occur here */
\r
14 /* Don't wory about this */
\r
15 if (future[FTBEAM] <= game.state.date+Time && game.state.remcom != 0 && condit != IHDOCKED) {
\r
16 /* We are about to be tractor beamed -- operation fails */
\r
20 // asave = future[FSNOVA];
\r
21 // future[FSNOVA] = 1e30; /* defer supernovas */
\r
22 events(); /* Used to avoid if future[FSCMOVE] within time */
\r
23 // future[FSNOVA] = asave;
\r
24 /*fails if game over, quadrant super-novas or we've moved to new quadrant*/
\r
25 if (alldone || game.state.galaxy[quadx][quady] == 1000 || justin != 0) return 1;
\r
29 void preport(void) {
\r
33 prout("Spock- \"Planet report follows, Captain.\"");
\r
35 for (i = 0; i < inplan; i++) {
\r
36 if (game.state.plnets[i].known != unknown
\r
38 || ( idebug && game.state.plnets[i].x !=0)
\r
43 if (idebug && game.state.plnets[i].known==unknown) proutn("(Unknown) ");
\r
45 proutn(cramlc(quadrant, game.state.plnets[i].x, game.state.plnets[i].y));
\r
47 proutn(classes[game.state.plnets[i].pclass]);
\r
49 if (game.state.plnets[i].crystals == 0) proutn("no ");
\r
50 prout("dilithium crystals present.");
\r
51 if (game.state.plnets[i].known==shuttle_down)
\r
52 prout(" Shuttle Craft Galileo on surface.");
\r
55 if (iknow==0) prout("No information available.");
\r
63 prout("Already in standard orbit.");
\r
66 if (game.damage[DWARPEN] != 0 && game.damage[DIMPULS] != 0) {
\r
67 prout("Both warp and impulse engines damaged.");
\r
70 if (plnetx == 0 || abs(sectx-plnetx) > 1 || abs(secty-plnety) > 1) {
\r
72 prout(" not adjacient to planet.\n");
\r
75 Time = 0.02+0.03*Rand();
\r
76 prout("Helmsman Sulu- \"Entering standard orbit, Sir.\"");
\r
78 if (consumeTime()) return;
\r
79 height = (1400.+7200.*Rand());
\r
80 prout("Sulu- \"Entered orbit at altitude %.2f kilometers.\"", height);
\r
88 if (game.damage[DSRSENS] != 0.0) {
\r
89 prout("Short range sensors damaged.");
\r
93 prout("No planet in this quadrant.");
\r
96 prout("Spock- \"Sensor scan for %s-", cramlc(quadrant, quadx, quady));
\r
98 prout(" Planet at %s is of class %s.",
\r
99 cramlc(sector, plnetx, plnety),
\r
100 classes[game.state.plnets[iplnet].pclass]);
\r
101 if (game.state.plnets[iplnet].known==shuttle_down)
\r
102 prout(" Sensors show Galileo still on surface.");
\r
103 proutn(" Readings indicate");
\r
104 if (game.state.plnets[iplnet].crystals == 0) proutn(" no");
\r
105 prout(" dilithium crystals present.\"");
\r
106 if (game.state.plnets[iplnet].known == unknown) game.state.plnets[iplnet].known = known;
\r
113 if (game.damage[DTRANSP] != 0) {
\r
114 prout("Transporter damaged.");
\r
115 if (game.damage[DSHUTTL]==0 && (game.state.plnets[iplnet].known==shuttle_down || iscraft == 1)) {
\r
117 prout("Spock- \"May I suggest the shuttle craft, Sir?\" ");
\r
118 if (ja() != 0) shuttle();
\r
124 prout(" not in standard orbit.");
\r
128 prout("Impossible to transport through shields.");
\r
131 if (game.state.plnets[iplnet].known==unknown) {
\r
132 prout("Spock- \"Captain, we have no information on this planet");
\r
133 prout(" and Starfleet Regulations clearly state that in this situation");
\r
134 prout(" you may not go down.\"");
\r
138 /* Coming from planet */
\r
139 if (game.state.plnets[iplnet].known==shuttle_down) {
\r
140 proutn("Spock- \"Wouldn't you rather take the Galileo?\" ");
\r
145 prout("Your crew hides the Galileo to prevent capture by aliens.");
\r
147 prout("Landing party assembled, ready to beam up.");
\r
149 prout("Kirk whips out communicator...");
\r
150 prouts("BEEP BEEP BEEP");
\r
152 prout("\"Kirk to enterprise- Lock on coordinates...energize.\"");
\r
155 /* Going to planet */
\r
156 if (game.state.plnets[iplnet].crystals==0) {
\r
157 prout("Spock- \"Captain, I fail to see the logic in");
\r
158 prout(" exploring a planet with no dilithium crystals.");
\r
159 proutn(" Are you sure this is wise?\" ");
\r
165 prout("Scotty- \"Transporter room ready, Sir.\"");
\r
167 prout("Kirk, and landing party prepare to beam down to planet surface.");
\r
169 prout("Kirk- \"Energize.\"");
\r
172 prouts("WWHOOOIIIIIRRRRREEEE.E.E. . . . . . .");
\r
174 if (Rand() > 0.98) {
\r
175 prouts("BOOOIIIOOOIIOOOOIIIOIING . . .");
\r
177 prout("Scotty- \"Oh my God! I've lost them.\"");
\r
181 prouts(". . . . . . .E.E.EEEERRRRRIIIIIOOOHWW");
\r
183 prout("Transport complete.");
\r
185 if (landed==1 && game.state.plnets[iplnet].known==shuttle_down) {
\r
186 prout("The shuttle craft Galileo is here!");
\r
188 if (landed!=1 && imine==1) {
\r
202 prout("Mining party not on planet.");
\r
205 if (game.state.plnets[iplnet].crystals == 0) {
\r
206 prout("No dilithium crystals on this planet.");
\r
210 prout("You've already mined enough crystals for this trip.");
\r
213 if (icrystl == 1 && cryprob == 0.05) {
\r
214 proutn("With all those fresh crystals aboard the ");
\r
217 prout("there's no reason to mine more at this time.");
\r
220 Time = (0.1+0.2*Rand())*game.state.plnets[iplnet].pclass;
\r
221 if (consumeTime()) return;
\r
222 prout("Mining operation complete.");
\r
227 void usecrystals(void) {
\r
232 prout("No dilithium crystals available.");
\r
235 if (energy >= 1000) {
\r
236 prout("Spock- \"Captain, Starfleet Regulations prohibit such an operation");
\r
237 prout(" except when condition Yellow exists.");
\r
240 prout("Spock- \"Captain, I must warn you that loading");
\r
241 prout(" raw dilithium crystals into the ship's power");
\r
242 prout(" system may risk a severe explosion.");
\r
243 proutn(" Are you sure this is wise?\" ");
\r
249 prout("Engineering Officer Scott- \"(GULP) Aye Sir.");
\r
250 prout(" Mr. Spock and I will try it.\"");
\r
252 prout("Spock- \"Crystals in place, Sir.");
\r
253 prout(" Ready to activate circuit.\"");
\r
255 prouts("Scotty- \"Keep your fingers crossed, Sir!\"");
\r
257 if (Rand() <= cryprob) {
\r
258 prouts(" \"Activating now! - - No good! It's***");
\r
260 prouts("***RED ALERT! RED A*L********************************");
\r
263 prouts("****************** KA-BOOM!!!! *******************");
\r
268 energy += 5000.0*(1.0 + 0.9*Rand());
\r
269 prouts(" \"Activating now! - - ");
\r
270 prout("The instruments");
\r
271 prout(" are going crazy, but I think it's");
\r
272 prout(" going to work!! Congratulations, Sir!\"");
\r
277 void shuttle(void) {
\r
282 if(game.damage[DSHUTTL] != 0.0) {
\r
283 if (game.damage[DSHUTTL] == -1.0) {
\r
284 if (inorbit && game.state.plnets[iplnet].known == shuttle_down)
\r
285 prout("Ye Faerie Queene has no shuttle craft bay to dock it at.");
\r
287 prout("Ye Faerie Queene had no shuttle craft.");
\r
289 else if (game.damage[DSHUTTL] > 0)
\r
290 prout("The Galileo is damaged.");
\r
291 else prout("Shuttle craft is now serving Big Macs.");
\r
296 prout(" not in standard orbit.");
\r
299 if ((game.state.plnets[iplnet].known != shuttle_down) && iscraft != 1) {
\r
300 prout("Shuttle craft not currently available.");
\r
303 if (landed==-1 && game.state.plnets[iplnet].known==shuttle_down) {
\r
304 prout("You will have to beam down to retrieve the shuttle craft.");
\r
307 if (shldup!=0 || condit == IHDOCKED) {
\r
308 prout("Shuttle craft cannot pass through shields.");
\r
311 if (game.state.plnets[iplnet].known==unknown) {
\r
312 prout("Spock- \"Captain, we have no information on this planet");
\r
313 prout(" and Starfleet Regulations clearly state that in this situation");
\r
314 prout(" you may not fly down.\"");
\r
317 Time = 3.0e-5*height;
\r
318 if (Time >= 0.8*game.state.remtime) {
\r
319 prout("First Officer Spock- \"Captain, I compute that such");
\r
320 proutn(" a maneuver would require approximately 2d%% of our",
\r
321 (int)(100*Time/game.state.remtime));
\r
322 prout("remaining time.");
\r
323 proutn("Are you sure this is wise?\" ");
\r
330 /* Kirk on planet */
\r
332 /* Galileo on ship! */
\r
333 if (game.damage[DTRANSP]==0) {
\r
334 proutn("Spock- \"Would you rather use the transporter?\" ");
\r
339 proutn("Shuttle crew");
\r
342 proutn("Rescue party");
\r
343 prout(" boards Galileo and swoops toward planet surface.");
\r
346 if (consumeTime()) return;
\r
347 game.state.plnets[iplnet].known=shuttle_down;
\r
348 prout("Trip complete.");
\r
352 /* Ready to go back to ship */
\r
353 prout("You and your mining party board the");
\r
354 prout("shuttle craft for the trip back to the Enterprise.");
\r
356 prout("The short hop begins . . .");
\r
357 game.state.plnets[iplnet].known=known;
\r
361 if (consumeTime()) return;
\r
369 prout("Trip complete.");
\r
375 /* and so is Galileo */
\r
376 prout("Mining party assembles in the hangar deck,");
\r
377 prout("ready to board the shuttle craft \"Galileo\".");
\r
379 prouts("The hangar doors open; the trip begins.");
\r
383 if (consumeTime()) return;
\r
384 game.state.plnets[iplnet].known = shuttle_down;
\r
387 prout("Trip complete");
\r
393 void deathray(void) {
\r
400 prout("Ye Faerie Queene has no death ray.");
\r
404 prout("Sulu- \"But Sir, there are no enemies in this quadrant.\"");
\r
407 if (game.damage[DDRAY] > 0.0) {
\r
408 prout("Death Ray is damaged.");
\r
411 prout("Spock- \"Captain, the 'Experimental Death Ray'");
\r
412 prout(" is highly unpredictible. Considering the alternatives,");
\r
413 proutn(" are you sure this is wise?\" ");
\r
414 if (ja()==0) return;
\r
415 prout("Spock- \"Acknowledged.\"");
\r
418 prouts("WHOOEE ... WHOOEE ... WHOOEE ... WHOOEE");
\r
420 prout("Crew scrambles in emergency preparation.");
\r
421 prout("Spock and Scotty ready the death ray and");
\r
422 prout("prepare to channel all ship's power to the device.");
\r
424 prout("Spock- \"Preparations complete, sir.\"");
\r
425 prout("Kirk- \"Engage!\"");
\r
427 prouts("WHIRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR");
\r
430 prouts("Sulu- \"Captain! It's working!\"");
\r
432 while (nenhere > 0)
\r
433 deadkl(game.kx[1],game.ky[1],game.quad[game.kx[1]][game.ky[1]],game.kx[1],game.ky[1]);
\r
434 prout("Ensign Chekov- \"Congratulations, Captain!\"");
\r
435 if (game.state.remkl == 0) finish(FWON);
\r
436 prout("Spock- \"Captain, I believe the `Experimental Death Ray'");
\r
437 if (Rand() <= 0.05) {
\r
438 prout(" is still operational.\"");
\r
441 prout(" has been rendered nonfunctional.\"");
\r
442 game.damage[DDRAY] = 39.95;
\r
446 r = Rand(); // Pick failure method
\r
448 prouts("Sulu- \"Captain! It's working!\"");
\r
450 prouts("***RED ALERT! RED ALERT!");
\r
452 prout("***MATTER-ANTIMATTER IMPLOSION IMMINENT!");
\r
454 prouts("***RED ALERT! RED A*L********************************");
\r
457 prouts("****************** KA-BOOM!!!! *******************");
\r
463 prouts("Sulu- \"Captain! Yagabandaghangrapl, brachriigringlanbla!\"");
\r
465 prout("Lt. Uhura- \"Graaeek! Graaeek!\"");
\r
467 prout("Spock- \"Facinating! . . . All humans aboard");
\r
468 prout(" have apparently been transformed into strange mutations.");
\r
469 prout(" Vulcans do not seem to be affected.");
\r
471 prout("Kirk- \"Raauch! Raauch!\"");
\r
477 prouts("Sulu- \"Captain! It's --WHAT?!?!\"");
\r
479 proutn("Spock- \"I believe the word is");
\r
480 prouts(" *ASTONISHING*");
\r
481 prout(" Mr. Sulu.");
\r
482 for (i=1; i<=10; i++)
\r
483 for (j=1; j<=10; j++)
\r
484 if (game.quad[i][j] == IHDOT) game.quad[i][j] = IHQUEST;
\r
485 prout(" Captain, our quadrant is now infested with");
\r
486 prouts(" - - - - - - *THINGS*.");
\r
488 prout(" I have no logical explanation.\"");
\r
491 prouts("Sulu- \"Captain! The Death Ray is creating tribbles!\"");
\r
493 prout("Scotty- \"There are so many tribbles down here");
\r
494 prout(" in Engineering, we can't move for 'em, Captain.\"");
\r