shield += aaitem;\r
energy -= aaitem;\r
return;\r
+ case NONE:; /* avoid gcc warning */\r
}\r
}\r
\r
case IHC: type = 2.0; break;\r
case IHS: type = 2.5; break;\r
case IHT: type = 0.5; break;\r
+ case IHQUEST: type = 4.0; break;\r
}\r
proutn(ibumpd ? " rammed by " : " rams ");\r
crmena(0, ienm, 2, ix, iy);\r
}\r
shldup = 0;\r
if (game.state.remkl) {\r
- pause(2);\r
+ pause_game(2);\r
dreprt();\r
}\r
else finish(FWON);\r
*hit = fabs(*hit);\r
newcnd(); /* undock */\r
/* We may be displaced. */\r
- if (landed==1) return; /* Cheat if on a planet */\r
+ if (landed==1 || condit==IHDOCKED) return; /* Cheat if on a planet */\r
ang = angle + 2.5*(Rand()-0.5);\r
temp = fabs(sin(ang));\r
if (fabs(cos(ang)) > temp) temp = fabs(cos(ang));\r
prout(" damaged but not destroyed.");\r
return;\r
}\r
- prout(" damaged--");\r
+ proutn(" damaged--");\r
game.kx[ll] = jx;\r
game.ky[ll] = jy;\r
shoved = 1;\r
break;\r
case IHB: /* Hit a base */\r
+ skip(1);\r
prout("***STARBASE DESTROYED..");\r
if (game.starch[quadx][quady] < 0) game.starch[quadx][quady] = 0;\r
for (ll=1; ll<=game.state.rembase; ll++) {\r
prout(" unaffected by photon blast.");\r
return;\r
case IHQUEST: /* Hit a thingy */\r
+ if (Rand()>0.7) { // Used to be certain death \r
skip(1);\r
prouts("AAAAIIIIEEEEEEEEAAAAAAAAUUUUUGGGGGHHHHHHHHHHHH!!!");\r
skip(1);\r
prouts(" HACK! HACK! HACK! *CHOKE!* ");\r
skip(1);\r
proutn("Mr. Spock-");\r
- prouts(" \"Facinating!\"");\r
+ prouts(" \"Fascinating!\"");\r
skip(1);\r
- game.quad[ix][iy] = IHDOT;\r
- return;\r
+ deadkl(ix, iy, iquad, ix, iy);\r
+ } else {\r
+ /*\r
+ * Stas Sergeev added the possibility that\r
+ * you can shove the Thingy.\r
+ */\r
+ iqengry=1;\r
+ shoved=1;\r
+ }\r
+ return;\r
case IHBLANK: /* Black hole */\r
skip(1);\r
crmena(1, IHBLANK, 2, ix, iy);\r
prout("***Torpedo absorbed by Tholian web.");\r
return;\r
case IHT: /* Hit a Tholian */\r
- skip(1);\r
- crmena(1, IHT, 2, ix, iy);\r
h1 = 700.0 + 100.0*Rand() -\r
1000.0*sqrt(square(ix-inx)+square(iy-iny))*\r
fabs(sin(bullseye-angle));\r
ithx = ithy = 0;\r
return;\r
}\r
+ skip(1);\r
+ crmena(1, IHT, 2, ix, iy);\r
if (Rand() > 0.05) {\r
prout(" survives photon blast.");\r
return;\r
prout(" disappears.");\r
game.quad[ix][iy] = IHWEB;\r
ithere = ithx = ithy = 0;\r
+ nenhere--;\r
{\r
int dum, my;\r
dropin(IHBLANK, &dum, &my);\r
\r
static void fry(double hit) {\r
double ncrit, extradm;\r
- int ktr=1, l, ll, j, cdam[6], crptr;\r
+ int ktr=1, l, ll, j, cdam[NDEVICES+1], crptr;\r
\r
/* a critical hit occured */\r
if (hit < (275.0-25.0*skill)*(1.0+0.5*Rand())) return;\r
ncrit = 1.0 + hit/(500.0+100.0*Rand());\r
proutn("***CRITICAL HIT--");\r
/* Select devices and cause damage */\r
- for (l = 1; l <= ncrit; l++) {\r
+ for (l = 1; l <= ncrit && l <= NDEVICES; l++) {\r
do {\r
j = NDEVICES*Rand()+1.0;\r
/* Cheat to prevent shuttle damage unless on ship */\r
neutz = 0;\r
return;\r
}\r
- if (((comhere || ishere) && (justin == 0)) || skill == 5) movcom();\r
- if (nenhere==0) return;\r
+ if ((((comhere || ishere) && (justin == 0)) || skill == 5)&&(k!=0)) movcom();\r
+ if (nenhere==0 || (nenhere==1 && iqhere && iqengry==0)) return;\r
pfac = 1.0/inshld;\r
if (shldchg == 1) chgfac = 0.25+0.5*Rand();\r
skip(1);\r
jx = game.kx[l];\r
jy = game.ky[l];\r
iquad = game.quad[jx][jy];\r
+ if (iquad==IHT || (iquad==IHQUEST && !iqengry)) continue;\r
itflag = (iquad == IHK && r > 0.0005) || k == 0 ||\r
(iquad==IHC && r > 0.015) ||\r
(iquad==IHR && r > 0.3) ||\r
- (iquad==IHS && r > 0.07);\r
+ (iquad==IHS && r > 0.07) ||\r
+ (iquad==IHQUEST && r > 0.05);\r
if (itflag) {\r
/* Enemy uses phasers */\r
if (condit == IHDOCKED) continue; /* Don't waste the effort! */\r
crmena(0, iquad, i, jx, jy);\r
}\r
attempt = 1;\r
- prout("--");\r
+ prout(" ");\r
r = (Rand()+Rand())*0.5 -0.5;\r
r += 0.002*game.kpower[l]*r;\r
torpedo(course, r, jx, jy, &hit);\r
alldone) return; /* Supernova or finished */\r
if (hit == 0) continue;\r
}\r
- if (shldup != 0 || shldchg != 0) {\r
+ if (shldup != 0 || shldchg != 0 || condit==IHDOCKED) {\r
/* shields will take hits */\r
- double absorb, hitsh, propor = pfac*shield;\r
+ double absorb, hitsh, propor = pfac*shield*(condit==IHDOCKED ? 2.1 : 1.0);\r
if(propor < 0.1) propor = 0.1;\r
hitsh = propor*chgfac*hit+1.0;\r
atackd=1;\r
/* Killed a Tholian */\r
ithere = 0;\r
}\r
+ else if (type == IHQUEST) {\r
+ /* Killed a Thingy */\r
+ iqhere=iqengry=thingx=thingy=0;\r
+ }\r
else {\r
/* Some type of a Klingon */\r
game.state.galaxy[quadx][quady] -= 100;\r
\r
game.state.remtime = game.state.remres/(game.state.remkl + 4*game.state.remcom);\r
\r
- if (type == IHT) return;\r
-\r
/* Remove enemy ship from arrays describing local conditions */\r
-\r
+ if (game.future[FCDBAS] < 1e30 && batx==quadx && baty==quady && type==IHC)\r
+ game.future[FCDBAS] = 1e30;\r
for (i=1; i<=nenhere; i++)\r
if (game.kx[i]==ix && game.ky[i]==iy) break;\r
nenhere--;\r
skip(1);\r
prout("Spock- \"Bridge to sickbay. Dr. McCoy,");\r
prout(" I recommend an immediate review of");\r
- prout(" the Captain's psychological profile.");\r
+ prout(" the Captain's psychological profile.\"");\r
chew();\r
return 1;\r
}\r
chew();\r
prout("Maximum of 3 torpedoes per burst.");\r
key = IHEOL;\r
+ return;\r
}\r
if (n <= torps) break;\r
chew();\r
int kz = 0, k=1, i; /* Cheating inhibitor */\r
int ifast=0, no=0, ipoop=1, msgflag = 1;\r
enum {NOTSET, MANUAL, FORCEMAN, AUTOMATIC} automode = NOTSET;\r
- int key;\r
+ int key=0;\r
\r
skip(1);\r
/* SR sensors and Computer */\r
key = scan();\r
}\r
if (key != IHREAL && nenhere != 0) {\r
- prout("Phasers locked on target. Energy available = %.2f", ifast?energy-200.0:energy);\r
+ prout("Phasers locked on target. Energy available: %.2f", ifast?energy-200.0:energy);\r
}\r
do {\r
while (key != IHREAL) {\r
}\r
if (aaitem < 0) {\r
/* abort out */\r
- ididit = 0;\r
chew();\r
return;\r
}\r
chew();\r
return;\r
}\r
- if (key == IHALPHA & isit("no")) {\r
+ if (key == IHALPHA && isit("no")) {\r
no = 1;\r
}\r
energy -= rpow;\r
else\r
proutn("Very small hit on ");\r
ienm = game.quad[ii][jj];\r
+ if (ienm==IHQUEST) iqengry=1;\r
crmena(0,ienm,2,ii,jj);\r
skip(1);\r
if (kpow == 0) {\r