X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=battle.c;h=97cea709fca529f5d140f6601c8f7fb3fb0699a4;hb=aac11e9fd173e65886e2ee33c556e84bb2859f77;hp=1f043c61d9700a1dcbccf7ce35ac1dde23e6deec;hpb=48763357ef69f0b711fc332b13e2170ab914d881;p=super-star-trek.git diff --git a/battle.c b/battle.c index 1f043c6..97cea70 100644 --- a/battle.c +++ b/battle.c @@ -1,3 +1,8 @@ +#ifdef SERGEEV +#include +#include +#include "sstlinux.h" +#endif /* SERGEEV */ #include "sst.h" void doshield(int i) { @@ -124,6 +129,7 @@ void doshield(int i) { shield += aaitem; energy -= aaitem; return; + case NONE:; /* avoid gcc warning */ } } @@ -142,6 +148,7 @@ void ram(int ibumpd, int ienm, int ix, int iy) { case IHC: type = 2.0; break; case IHS: type = 2.5; break; case IHT: type = 0.5; break; + case IHQUEST: type = 4.0; break; } proutn(ibumpd ? " rammed by " : " rams "); crmena(0, ienm, 2, ix, iy); @@ -152,11 +159,9 @@ void ram(int ibumpd, int ienm, int ix, int iy) { crmshp(); prout(" heavily damaged."); icas = 10.0+20.0*Rand(); - proutn("***Sickbay reports "); - crami(icas, 1); - prout(" casualties."); + prout("***Sickbay reports %d casualties", icas); casual += icas; - for (l=1; l <= ndevice; l++) { + for (l=1; l <= NDEVICES; l++) { if (l == DDRAY) continue; // Don't damage deathray if (game.damage[l] < 0) continue; extradm = (10.0*type*Rand()+1.0)*damfac; @@ -164,15 +169,19 @@ void ram(int ibumpd, int ienm, int ix, int iy) { } shldup = 0; if (game.state.remkl) { - pause(2); + pause_game(2); dreprt(); } else finish(FWON); return; } -void torpedo(double course, double r, int inx, int iny, double *hit) { - int l, iquad, ix, iy, jx, jy, shoved=0, ll; +void torpedo(double course, double r, int inx, int iny, double *hit, int wait) { + int l, iquad=0, ix=0, iy=0, jx=0, jy=0, shoved=0, ll; +#ifdef SERGEEV + int crx,cry; + +#endif /* SERGEEV */ double ac=course + 0.25*r; double angle = (15.0-ac)*0.5235988; double bullseye = (15.0 - course)*0.5235988; @@ -183,7 +192,12 @@ void torpedo(double course, double r, int inx, int iny, double *hit) { if (fabs(deltay) > bigger) bigger = fabs(deltay); deltax /= bigger; deltay /= bigger; - +#ifdef SERGEEV + crx=wherex(); + cry=wherey(); + if (game.damage[DSRSENS]==0 || condit==IHDOCKED) setwnd(1); + else setwnd(4); +#endif /* SERGEEV */ /* Loop to move a single torpedo */ for (l=1; l <= 15; l++) { x += deltax; @@ -192,15 +206,49 @@ void torpedo(double course, double r, int inx, int iny, double *hit) { y += deltay; iy = y + 0.5; if (iy < 1 || iy > 10) break; +#ifndef SERGEEV if (l==4 || l==9) skip(1); - cramf(x, 0, 1); - proutn(" - "); - cramf(y, 0, 1); - proutn(" "); + proutn("%d - %d ", (int)x, (int)y); iquad=game.quad[ix][iy]; +#else + iquad=game.quad[ix][iy]; + if (game.damage[DSRSENS]==0 || condit==IHDOCKED){ + drawmaps(2); + delay((wait!=1)*400); + wait=1; + gotoxy(iy*2+3,ix+2); + if ((game.quad[ix][iy]==IHDOT)||(game.quad[ix][iy]==IHBLANK)){ + game.quad[ix][iy]='+'; + drawmaps(2); + game.quad[ix][iy]=iquad; + sound(l*10); + delay(100); + nosound(); + } + else { + game.quad[ix][iy]|=128; + drawmaps(2); + game.quad[ix][iy]=iquad; + _setcursortype(_NOCURSOR); + sound(500); + delay(1000); + nosound(); + lowvideo(); + _setcursortype(_NORMALCURSOR); + } + } + else { + proutn("%d - %d ", (int)x, (int)y); + } +#endif /* SERGEEV */ if (iquad==IHDOT) continue; /* hit something */ +#ifndef SERGEEV skip(1); +#else + setwnd(4); + gotoxy(crx,cry); +#endif switch(iquad) { case IHE: /* Hit our ship */ case IHF: @@ -212,9 +260,11 @@ void torpedo(double course, double r, int inx, int iny, double *hit) { 1000.0*sqrt(square(ix-inx)+square(iy-iny))* fabs(sin(bullseye-angle)); *hit = fabs(*hit); +#ifndef SERGEEV newcnd(); /* undock */ +#endif /* SERGEEV */ /* We may be displaced. */ - if (landed==1) return; /* Cheat if on a planet */ + if (landed==1 || condit==IHDOCKED) return; /* Cheat if on a planet */ ang = angle + 2.5*(Rand()-0.5); temp = fabs(sin(ang)); if (fabs(cos(ang)) > temp) temp = fabs(cos(ang)); @@ -284,12 +334,13 @@ void torpedo(double course, double r, int inx, int iny, double *hit) { prout(" damaged but not destroyed."); return; } - prout(" damaged--"); + proutn(" damaged--"); game.kx[ll] = jx; game.ky[ll] = jy; shoved = 1; break; case IHB: /* Hit a base */ + skip(1); prout("***STARBASE DESTROYED.."); if (game.starch[quadx][quady] < 0) game.starch[quadx][quady] = 0; for (ll=1; ll<=game.state.rembase; ll++) { @@ -311,7 +362,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit) { prout(" destroyed."); game.state.nplankl++; game.state.newstuf[quadx][quady] -= 1; - game.state.plnets[iplnet] = nulplanet; + DESTROY(&game.state.plnets[iplnet]); iplnet = 0; plnetx = plnety = 0; game.quad[ix][iy] = IHDOT; @@ -329,16 +380,25 @@ void torpedo(double course, double r, int inx, int iny, double *hit) { prout(" unaffected by photon blast."); return; case IHQUEST: /* Hit a thingy */ + if (Rand()>0.7) { // Used to be certain death skip(1); prouts("AAAAIIIIEEEEEEEEAAAAAAAAUUUUUGGGGGHHHHHHHHHHHH!!!"); skip(1); prouts(" HACK! HACK! HACK! *CHOKE!* "); skip(1); proutn("Mr. Spock-"); - prouts(" \"Facinating!\""); + prouts(" \"Fascinating!\""); skip(1); - game.quad[ix][iy] = IHDOT; - return; + deadkl(ix, iy, iquad, ix, iy); + } else { + /* + * Stas Sergeev added the possibility that + * you can shove the Thingy. + */ + iqengry=1; + shoved=1; + } + return; case IHBLANK: /* Black hole */ skip(1); crmena(1, IHBLANK, 2, ix, iy); @@ -349,19 +409,24 @@ void torpedo(double course, double r, int inx, int iny, double *hit) { prout("***Torpedo absorbed by Tholian web."); return; case IHT: /* Hit a Tholian */ - skip(1); - crmena(1, IHT, 2, ix, iy); h1 = 700.0 + 100.0*Rand() - 1000.0*sqrt(square(ix-inx)+square(iy-iny))* fabs(sin(bullseye-angle)); h1 = fabs(h1); if (h1 >= 600) { +#ifndef SERGEEV prout(" destroyed."); +#endif /* SERGEEV */ game.quad[ix][iy] = IHDOT; ithere = 0; ithx = ithy = 0; +#ifdef SERGEEV + deadkl(ix, iy, iquad, ix, iy); +#endif /* SERGEEV */ return; } + skip(1); + crmena(1, IHT, 2, ix, iy); if (Rand() > 0.05) { prout(" survives photon blast."); return; @@ -369,6 +434,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit) { prout(" disappears."); game.quad[ix][iy] = IHWEB; ithere = ithx = ithy = 0; + nenhere--; { int dum, my; dropin(IHBLANK, &dum, &my); @@ -384,25 +450,31 @@ void torpedo(double course, double r, int inx, int iny, double *hit) { } break; } +#ifdef SERGEEV + if(curwnd!=4) { + setwnd(4); + gotoxy(crx,cry); + } +#endif /* SERGEEV */ if (shoved) { game.quad[jx][jy]=iquad; game.quad[ix][iy]=IHDOT; - proutn(" displaced by blast to"); - cramlc(2, jx, jy); - skip(1); + prout(" displaced by blast to %s ", cramlc(sector, jx, jy)); for (ll=1; ll<=nenhere; ll++) game.kdist[ll] = game.kavgd[ll] = sqrt(square(sectx-game.kx[ll])+square(secty-game.ky[ll])); sortkl(); return; } +#ifndef SERGEEV skip(1); +#endif /* SERGEEV */ prout("Torpedo missed."); return; } static void fry(double hit) { double ncrit, extradm; - int ktr=1, l, ll, j, cdam[6], crptr; + int ktr=1, l, ll, j, cdam[NDEVICES+1]; /* a critical hit occured */ if (hit < (275.0-25.0*skill)*(1.0+0.5*Rand())) return; @@ -410,9 +482,9 @@ static void fry(double hit) { ncrit = 1.0 + hit/(500.0+100.0*Rand()); proutn("***CRITICAL HIT--"); /* Select devices and cause damage */ - for (l = 1; l <= ncrit; l++) { + for (l = 1; l <= ncrit && l <= NDEVICES; l++) { do { - j = ndevice*Rand()+1.0; + j = NDEVICES*Rand()+1.0; /* Cheat to prevent shuttle damage unless on ship */ } while (game.damage[j] < 0.0 || (j == DSHUTTL && iscraft != 1) || j == DDRAY); @@ -454,8 +526,8 @@ void attack(int k) { neutz = 0; return; } - if (((comhere || ishere) && (justin == 0)) || skill == 5) movcom(); - if (nenhere==0) return; + if ((((comhere || ishere) && (justin == 0)) || skill == 5)&&(k!=0)) movcom(); + if (nenhere==0 || (nenhere==1 && iqhere && iqengry==0)) return; pfac = 1.0/inshld; if (shldchg == 1) chgfac = 0.25+0.5*Rand(); skip(1); @@ -470,10 +542,12 @@ void attack(int k) { jx = game.kx[l]; jy = game.ky[l]; iquad = game.quad[jx][jy]; + if (iquad==IHT || (iquad==IHQUEST && !iqengry)) continue; itflag = (iquad == IHK && r > 0.0005) || k == 0 || (iquad==IHC && r > 0.015) || (iquad==IHR && r > 0.3) || - (iquad==IHS && r > 0.07); + (iquad==IHS && r > 0.07) || + (iquad==IHQUEST && r > 0.05); if (itflag) { /* Enemy uses phasers */ if (condit == IHDOCKED) continue; /* Don't waste the effort! */ @@ -491,18 +565,18 @@ void attack(int k) { crmena(0, iquad, i, jx, jy); } attempt = 1; - prout("--"); + prout(" "); r = (Rand()+Rand())*0.5 -0.5; r += 0.002*game.kpower[l]*r; - torpedo(course, r, jx, jy, &hit); + torpedo(course, r, jx, jy, &hit, 0); if (game.state.remkl==0) finish(FWON); /* Klingons did themselves in! */ if (game.state.galaxy[quadx][quady] == 1000 || alldone) return; /* Supernova or finished */ if (hit == 0) continue; } - if (shldup != 0 || shldchg != 0) { + if (shldup != 0 || shldchg != 0 || condit==IHDOCKED) { /* shields will take hits */ - double absorb, hitsh, propor = pfac*shield; + double absorb, hitsh, propor = pfac*shield*(condit==IHDOCKED ? 2.1 : 1.0); if(propor < 0.1) propor = 0.1; hitsh = propor*chgfac*hit+1.0; atackd=1; @@ -510,6 +584,7 @@ void attack(int k) { if (absorb > shield) absorb = shield; shield -= absorb; hit -= hitsh; + if (condit==IHDOCKED) dock(0); if (propor > 0.1 && hit < 0.005*energy) continue; } /* It's a hit -- print out hit size */ @@ -517,8 +592,7 @@ void attack(int k) { shields were down for some strange reason. This doesn't make any sense, so I've fixed it */ ihurt = 1; - cramf(hit, 0, 2); - proutn(" unit hit"); + proutn("%d unit hit", (int)hit); if ((game.damage[DSRSENS] > 0 && itflag) || skill <= 2) { proutn(" on the "); crmshp(); @@ -532,8 +606,9 @@ void attack(int k) { if (hit > hitmax) hitmax = hit; hittot += hit; fry(hit); - printf("Hit %g energy %g\n", hit, energy); + prout("Hit %g energy %g", hit, energy); energy -= hit; + if (condit==IHDOCKED) dock(0); } if (energy <= 0) { /* Returning home upon your shield, not with it... */ @@ -551,25 +626,18 @@ void attack(int k) { else { /* Print message if starship suffered hit(s) */ skip(1); - proutn("Energy left "); - cramf(energy, 0, 2); - proutn(" shields "); - if (shldup) proutn("up, "); - else if (game.damage[DSHIELD] == 0) proutn("down, "); + proutn("Energy left %2d shields ", (int)energy); + if (shldup) proutn("up "); + else if (game.damage[DSHIELD] == 0) proutn("down "); else proutn("damaged, "); } - crami(percent, 1); - proutn("% torpedoes left "); - crami(torps, 1); - skip(1); + prout("%d%%, torpedoes left %d", percent, torps); /* Check if anyone was hurt */ if (hitmax >= 200 || hittot >= 500) { int icas= hittot*Rand()*0.015; if (icas >= 2) { skip(1); - proutn("Mc Coy- \"Sickbay to bridge. We suffered "); - crami(icas, 1); - prout(" casualties"); + prout("Mc Coy- \"Sickbay to bridge. We suffered %d casualties", icas); prout(" in that last attack.\""); casual += icas; } @@ -585,7 +653,10 @@ void deadkl(int ix, int iy, int type, int ixx, int iyy) { /* Added ixx and iyy allow enemy to "move" before dying */ int i,j; - + +#ifdef SERGEEV + skip(1); +#endif /* SERGEEV */ crmena(1, type, 2, ixx, iyy); /* Decide what kind of enemy it is and update approriately */ if (type == IHR) { @@ -599,6 +670,10 @@ void deadkl(int ix, int iy, int type, int ixx, int iyy) { /* Killed a Tholian */ ithere = 0; } + else if (type == IHQUEST) { + /* Killed a Thingy */ + iqhere=iqengry=thingx=thingy=0; + } else { /* Some type of a Klingon */ game.state.galaxy[quadx][quady] -= 100; @@ -637,10 +712,9 @@ void deadkl(int ix, int iy, int type, int ixx, int iyy) { game.state.remtime = game.state.remres/(game.state.remkl + 4*game.state.remcom); - if (type == IHT) return; - /* Remove enemy ship from arrays describing local conditions */ - + if (game.future[FCDBAS] < 1e30 && batx==quadx && baty==quady && type==IHC) + game.future[FCDBAS] = 1e30; for (i=1; i<=nenhere; i++) if (game.kx[i]==ix && game.ky[i]==iy) break; nenhere--; @@ -673,7 +747,7 @@ static int targetcheck(double x, double y, double *course) { skip(1); prout("Spock- \"Bridge to sickbay. Dr. McCoy,"); prout(" I recommend an immediate review of"); - prout(" the Captain's psychological profile."); + prout(" the Captain's psychological profile.\""); chew(); return 1; } @@ -705,8 +779,7 @@ void photon(void) { return; } else if (key == IHEOL) { - crami(torps,1); - prout(" torpedoes left."); + prout("%d torpedoes left.", torps); proutn("Number of torpedoes to fire- "); key = scan(); } @@ -720,6 +793,7 @@ void photon(void) { chew(); prout("Maximum of 3 torpedoes per burst."); key = IHEOL; + return; } if (n <= torps) break; chew(); @@ -758,9 +832,7 @@ void photon(void) { if (i == 1 && key == IHEOL) { /* prompt for each one */ for (i = 1; i <= n; i++) { - proutn("Target sector for torpedo number"); - crami(i, 2); - proutn("- "); + proutn("Target sector for torpedo number %d- ", i); key = scan(); if (key != IHREAL) { huh(); @@ -787,9 +859,7 @@ void photon(void) { /* misfire! */ r = (Rand()+1.2) * r; if (n>1) { - prouts("***TORPEDO NUMBER"); - crami(i, 2); - prouts(" MISFIRES."); + prouts("***TORPEDO NUMBER %d MISFIRES", i); } else prouts("***TORPEDO MISFIRES."); skip(1); @@ -802,18 +872,18 @@ void photon(void) { break; } } - if (shldup != 0 || condit == IHDOCKED) r *= 1.0 + 0.0001*shield; + if (shldup || condit == IHDOCKED) r *= 1.0 + 0.0001*shield; +#ifndef SERGEEV if (n != 1) { skip(1); - proutn("Track for torpedo number"); - crami(i, 2); - proutn("- "); + proutn("Track for torpedo number %d- ", i); } else { skip(1); proutn("Torpedo track- "); } - torpedo(course[i], r, sectx, secty, &dummy); +#endif /* SERGEEV */ + torpedo(course[i], r, sectx, secty, &dummy, i); if (alldone || game.state.galaxy[quadx][quady]==1000) return; } if (game.state.remkl==0) finish(FWON); @@ -862,9 +932,7 @@ static int checkshctrl(double rpow) { if (icas) { skip(1); prout("McCoy to bridge- \"Severe radiation burns, Jim."); - proutn(" "); - crami(icas, 1); - prout(" casualties so far.\""); + prout(" %d casualties so far.\"", icas); casual -= icas; } skip(1); @@ -876,11 +944,11 @@ static int checkshctrl(double rpow) { void phasers(void) { - double hits[21], rpow, extra, powrem, over, temp; - int kz = 0, k=1, i; /* Cheating inhibitor */ + double hits[21], rpow=0, extra, powrem, over, temp; + int kz = 0, k=1, i, irec=0; /* Cheating inhibitor */ int ifast=0, no=0, ipoop=1, msgflag = 1; enum {NOTSET, MANUAL, FORCEMAN, AUTOMATIC} automode = NOTSET; - int key; + int key=0; skip(1); /* SR sensors and Computer */ @@ -910,7 +978,6 @@ void phasers(void) { ifast = 1; } - ididit = 1; /* Original code so convoluted, I re-did it all */ while (automode==NOTSET) { key=scan(); @@ -943,7 +1010,6 @@ void phasers(void) { } else { huh(); - ididit = 0; return; } } @@ -977,27 +1043,31 @@ void phasers(void) { key = scan(); } if (key != IHREAL && nenhere != 0) { - proutn("Phasers locked on target. Energy available ="); - cramf(ifast?energy-200.0:energy,1,2); - skip(1); + prout("Phasers locked on target. Energy available: %.2f", + ifast?energy-200.0:energy,1,2); } + irec=0; do { - while (key != IHREAL) { + chew(); + if (!kz) for (i = 1; i <= nenhere; i++) + irec+=fabs(game.kpower[i])/(PHASEFAC*pow(0.90,game.kdist[i]))* + (1.01+0.05*Rand()) + 1.0; + kz=1; + proutn("(%d) units required. ", irec); chew(); - proutn("Units to fire="); + proutn("Units to fire= "); key = scan(); - } - rpow = aaitem; - if (rpow >= (ifast?energy-200:energy)) { - proutn("Energy available= "); - cramf(ifast?energy-200:energy, 1,2); + if (key!=IHREAL) return; + rpow = aaitem; + if (rpow > (ifast?energy-200:energy)) { + proutn("Energy available= %.2f", + ifast?energy-200:energy); skip(1); key = IHEOL; } - } while (rpow >= (ifast?energy-200:energy)); + } while (rpow > (ifast?energy-200:energy)); if (rpow<=0) { /* chicken out */ - ididit = 0; chew(); return; } @@ -1017,7 +1087,7 @@ void phasers(void) { for (i = 1; i <= nenhere; i++) { hits[i] = 0.0; if (powrem <= 0) continue; - hits[i] = fabs(game.kpower[i])/(phasefac*pow(0.90,game.kdist[i])); + hits[i] = fabs(game.kpower[i])/(PHASEFAC*pow(0.90,game.kdist[i])); over = (0.01 + 0.05*Rand())*hits[i]; temp = powrem; powrem -= hits[i] + over; @@ -1027,6 +1097,7 @@ void phasers(void) { } if (powrem > 0.0) extra += powrem; hittem(hits); + ididit=1; } if (extra > 0 && alldone == 0) { if (ithere) { @@ -1035,8 +1106,7 @@ void phasers(void) { prout("phaser energy."); } else { - cramf(extra, 0, 2); - prout(" expended on empty space."); + prout("%d expended on empty space.", (int)extra); } } break; @@ -1061,8 +1131,8 @@ void phasers(void) { int ii = game.kx[k], jj = game.ky[k]; int ienm = game.quad[ii][jj]; if (msgflag) { - proutn("Energy available= "); - cramf(energy-.006-(ifast?200:0), 0, 2); + proutn("Energy available= %.2f", + energy-.006-(ifast?200:0)); skip(1); msgflag = 0; rpow = 0.0; @@ -1079,14 +1149,14 @@ void phasers(void) { } if (key == IHEOL) { chew(); - if (ipoop && k > kz) { - int irec=(fabs(game.kpower[k])/(phasefac*pow(0.9,game.kdist[k])))* + if (ipoop && k > kz) + irec=(fabs(game.kpower[k])/(PHASEFAC*pow(0.9,game.kdist[k])))* (1.01+0.05*Rand()) + 1.0; - kz = k; - proutn("("); - crami(irec, 1); - proutn(") "); - } + kz = k; + proutn("("); + if (game.damage[DCOMPTR]==0) proutn("%d", irec); + else proutn("??"); + proutn(") "); proutn("units to fire at "); crmena(0, ienm, 2, ii, jj); proutn("- "); @@ -1099,7 +1169,6 @@ void phasers(void) { } if (key == IHALPHA) { huh(); - ididit = 0; return; } if (key == IHEOL) { @@ -1110,7 +1179,6 @@ void phasers(void) { } if (aaitem < 0) { /* abort out */ - ididit = 0; chew(); return; } @@ -1118,24 +1186,20 @@ void phasers(void) { rpow += aaitem; /* If total requested is too much, inform and start over */ - if (rpow >= (ifast?energy-200:energy)) { + if (rpow > (ifast?energy-200:energy)) { prout("Available energy exceeded -- try again."); chew(); - key = IHEOL; - k = 1; - msgflag = 1; - continue; + return; } key = scan(); /* scan for next value */ k++; } if (rpow == 0.0) { /* zero energy -- abort */ - ididit = 0; chew(); return; } - if (key == IHALPHA & isit("no")) { + if (key == IHALPHA && isit("no")) { no = 1; } energy -= rpow; @@ -1146,6 +1210,7 @@ void phasers(void) { } hittem(hits); ididit=1; + case NOTSET:; /* avoid gcc warning */ } /* Say shield raised or malfunction, if necessary */ if (alldone) return; @@ -1169,6 +1234,9 @@ void phasers(void) { void hittem(double *hits) { double kp, kpow, wham, hit, dustfac, kpini; +#ifdef SERGEEV + int cx, cy; +#endif /* SERGEEV */ int nenhr2=nenhere, k=1, kk=1, ii, jj, ienm; skip(1); @@ -1179,18 +1247,39 @@ void hittem(double *hits) { hit = wham*pow(dustfac,game.kdist[kk]); kpini = game.kpower[kk]; kp = fabs(kpini); - if (phasefac*hit < kp) kp = phasefac*hit; + if (PHASEFAC*hit < kp) kp = PHASEFAC*hit; game.kpower[kk] -= (game.kpower[kk] < 0 ? -kp: kp); kpow = game.kpower[kk]; ii = game.kx[kk]; jj = game.ky[kk]; if (hit > 0.005) { - cramf(hit, 0, 2); - proutn(" unit hit on "); +#ifdef SERGEEV + if (game.damage[DSRSENS]==0){ + crx=wherex(); + cry=wherey(); + setwnd(1); + drawmaps(2); + gotoxy(jj*2+3,ii+2); + highvideo(); + proutn("%c", game.quad[ii][jj]); + gotoxy(wherex()-1,wherey()); + sound(500); + delay(1000); + nosound(); + lowvideo(); + proutn("%c", game.quad[ii][jj]); + setwnd(4); + gotoxy(crx,cry); + _setcursortype(_NORMALCURSOR); + delay(500); + } +#endif /* SERGEEV */ + proutn("%d unit hit on ", (int)hit); } else proutn("Very small hit on "); ienm = game.quad[ii][jj]; + if (ienm==IHQUEST) iqengry=1; crmena(0,ienm,2,ii,jj); skip(1); if (kpow == 0) { @@ -1202,9 +1291,8 @@ void hittem(double *hits) { else /* decide whether or not to emasculate klingon */ if (kpow > 0 && Rand() >= 0.9 && kpow <= ((0.4 + 0.4*Rand())*kpini)) { - proutn("***Mr. Spock- \"Captain, the vessel at"); - cramlc(2,ii,jj); - skip(1); + prout("***Mr. Spock- \"Captain, the vessel at ", + cramlc(sector,ii,jj)); prout(" has just lost its firepower.\""); game.kpower[kk] = -kpow; }