+#ifdef SERGEEV
+#include <conio.h>
+#include "sstlinux.h"
+#endif /* SERGEEV */
#include <unistd.h>
#include "sst.h"
(iy-game.ky[l])*(double)(iy-game.ky[l]));
game.kavgd[l] = 0.5 * (finald+game.kdist[l]);
}
+#ifdef SERGEEV
+ if (skill > 3 && klhere > 0 && game.state.galaxy[quadx][quady] != 1000)
+ attack(0);
+#else
if (game.state.galaxy[quadx][quady] != 1000) attack(0);
+#endif /* SERGEEV */
if (alldone) return;
}
/* compute final position -- new quadrant and sector */
finish(FNEG3);
return;
}
- prout("\nYOU HAVE ATTEMPTED TO CROSS THE NEGATIVE ENERGY BARRIER\n"
- "AT THE EDGE OF THE GALAXY. THE THIRD TIME YOU TRY THIS,\n"
- "YOU WILL BE DESTROYED.\n");
+ prout("\n\rYOU HAVE ATTEMPTED TO CROSS THE NEGATIVE ENERGY BARRIER\n\r"
+ "AT THE EDGE OF THE GALAXY. THE THIRD TIME YOU TRY THIS,\n\r"
+ "YOU WILL BE DESTROYED.\n\r");
}
/* Compute final position in new quadrant */
if (trbeam) return; /* Don't bother if we are to be beamed */
if (!isprobe) {
if (itemp) {
if (iprompt) {
- proutn("Helmsman Sulu- \"Course locked in for %s.\"",
+ prout("Helmsman Sulu- \"Course locked in for %s.\"",
cramlc(sector, irows, icols));
}
}
double ddist, xdist, probf;
int line = 0, l, ix, iy;
#ifdef SERGEEV
- int pox, posy;
+ int posx, posy;
#endif /* SERGEEV */
chew();
proutn("");
crmshp();
prout(" dematerializes.");
-#ifdef SERGEEV
sectx=0;
for (l = 1; l <= 5; l++) {
ix = basex+3.0*Rand()-1;
finish(FMATERIALIZE);
return;
}
-#endif /* SERGEEV */
/* Give starbase three chances to rematerialize starship */
probf = pow((1.0 - pow(0.98,ddist)), 0.33333333);
for (l = 1; l <= 3; l++) {
proutn(" attempt to re-materialize ");
crmshp();
prouts(" . . . . . ");
+#ifdef SERGEEV
+ posx=wherex();
+ posy=wherey();
+ drawmaps(1);
+ setwnd(4);
+ gotoxy(posx,posy);
+ sound(50);
+ delay(1000);
+ nosound();
+#endif /* SERGEEV */
if (Rand() > probf) break;
+#ifdef SERGEEV
+ switch (l){
+ case 1: game.quad[ix][iy]=IHMATER1;
+ break;
+ case 2: game.quad[ix][iy]=IHMATER2;
+ break;
+ case 3: game.quad[ix][iy]=IHQUEST;
+ break;
+ }
+ textcolor(RED);
+#endif /* SERGEEV */
prout("fails.");
+#ifdef SERGEEV
+ delay(500);
+ textcolor(LIGHTGRAY);
+#endif /* SERGEEV */
}
if (l > 3) {
finish(FMATERIALIZE);
return;
}
- /* Rematerialization attempt should succeed if can get adj to base */
- for (l = 1; l <= 5; l++) {
- ix = basex+3.0*Rand()-1;
- iy = basey+3.0*Rand()-1;
- if (ix>=1 && ix<=10 && iy>=1 && iy<=10 && game.quad[ix][iy]==IHDOT) {
- /* found one -- finish up */
- prout("succeeds.");
- sectx=ix;
- secty=iy;
- game.quad[ix][iy]=ship;
- dock(0);
- skip(1);
- prout("Lt. Uhura- \"Captain, we made it!\"");
- return;
- }
- }
- finish(FMATERIALIZE);
- return;
+ game.quad[ix][iy]=ship;
+#ifdef SERGEEV
+ textcolor(WHITE);
+#endif /* SERGEEV */
+ prout("succeeds.");
+#ifdef SERGEEV
+ textcolor(LIGHTGRAY);
+#endif /* SERGEEV */
+ dock(0);
+ skip(1);
+ prout("Lt. Uhura- \"Captain, we made it!\"");
}