if (batx==quadx && baty==quady) return 0;\r
}\r
/* don't leave if over 1000 units of energy */\r
- if (kpower[loccom] > 1000.) return 0;\r
+ if (frozen.kpower[loccom] > 1000.) return 0;\r
}\r
/* print escape message and move out of quadrant.\r
We know this if either short or long range sensors are working */\r
- if (damage[DSRSENS] == 0.0 || damage[DLRSENS] == 0.0 ||\r
+ if (frozen.damage[DSRSENS] == 0.0 || frozen.damage[DLRSENS] == 0.0 ||\r
condit == IHDOCKED) {\r
proutn("***");\r
cramen(ienm);\r
prout(" (and regains strength).");\r
}\r
/* handle local matters related to escape */\r
- kx[loccom] = kx[nenhere];\r
- ky[loccom] = ky[nenhere];\r
- kavgd[loccom] = kavgd[nenhere];\r
- kpower[loccom] = kpower[nenhere];\r
- kdist[loccom] = kdist[nenhere];\r
+ frozen.kx[loccom] = frozen.kx[nenhere];\r
+ frozen.ky[loccom] = frozen.ky[nenhere];\r
+ frozen.kavgd[loccom] = frozen.kavgd[nenhere];\r
+ frozen.kpower[loccom] = frozen.kpower[nenhere];\r
+ frozen.kdist[loccom] = frozen.kdist[nenhere];\r
klhere--;\r
nenhere--;\r
if (condit != IHDOCKED) newcnd();\r
iscate=0;\r
ientesc=0;\r
isatb=0;\r
- future[FSCMOVE]=0.2777+state.date;\r
- future[FSCDBAS]=1e30;\r
+ frozen.future[FSCMOVE]=0.2777+state.date;\r
+ frozen.future[FSCDBAS]=1e30;\r
state.isx=iqx;\r
state.isy=iqy;\r
}\r
(comhere + ishere);\r
double dist1, forces;\r
\r
- dist1 = kdist[loccom];\r
+ dist1 = frozen.kdist[loccom];\r
mdist = dist1 + 0.5; /* Nearest integer distance */\r
\r
/* If SC, check with spy to see if should hi-tail it */\r
if (ienm==IHS &&\r
- (kpower[loccom] <= 500.0 || (condit==IHDOCKED && damage[DPHOTON]==0))) {\r
+ (frozen.kpower[loccom] <= 500.0 || (condit==IHDOCKED && frozen.damage[DPHOTON]==0))) {\r
irun = 1;\r
motion = -10;\r
}\r
* Motion is limited to skill level, except for SC hi-tailing it out.\r
*/\r
\r
- forces = kpower[loccom]+100.0*nenhere+400*(nbaddys-1);\r
+ forces = frozen.kpower[loccom]+100.0*nenhere+400*(nbaddys-1);\r
if (shldup==0) forces += 1000; /* Good for enemy if shield is down! */\r
- if (damage[DPHASER] == 0.0 || damage[DPHOTON] == 0.0) {\r
- if (damage[DPHASER] != 0) /* phasers damaged */\r
+ if (frozen.damage[DPHASER] == 0.0 || frozen.damage[DPHOTON] == 0.0) {\r
+ if (frozen.damage[DPHASER] != 0) /* phasers damaged */\r
forces += 300.0;\r
else\r
forces -= 0.2*(energy - 2500.0);\r
- if (damage[DPHOTON] != 0) /* photon torpedoes damaged */\r
+ if (frozen.damage[DPHOTON] != 0) /* photon torpedoes damaged */\r
forces += 300.0;\r
else\r
forces -= 50.0*torps;\r
frozen.quad[nextx][nexty] = ienm;\r
if (nextx != comx || nexty != comy) {\r
/* it moved */\r
- kx[loccom] = nextx;\r
- ky[loccom] = nexty;\r
- kdist[loccom] = kavgd[loccom] =\r
+ frozen.kx[loccom] = nextx;\r
+ frozen.ky[loccom] = nexty;\r
+ frozen.kdist[loccom] = frozen.kavgd[loccom] =\r
sqrt(square(sectx-nextx)+square(secty-nexty));\r
- if (damage[DSRSENS] == 0 || condit == IHDOCKED) {\r
+ if (frozen.damage[DSRSENS] == 0 || condit == IHDOCKED) {\r
proutn("***");\r
cramen(ienm);\r
- if (kdist[loccom] < dist1) proutn(" advances to");\r
+ if (frozen.kdist[loccom] < dist1) proutn(" advances to");\r
else proutn(" retreats to");\r
cramlc(2, nextx, nexty);\r
skip(1);\r
/* Figure out which Klingon is the commander (or Supercommander)\r
and do move */\r
if (comhere) for (i = 1; i <= nenhere; i++) {\r
- ix = kx[i];\r
- iy = ky[i];\r
+ ix = frozen.kx[i];\r
+ iy = frozen.ky[i];\r
if (frozen.quad[ix][iy] == IHC) {\r
movebaddy(ix, iy, i, IHC);\r
break;\r
}\r
}\r
if (ishere) for (i = 1; i <= nenhere; i++) {\r
- ix = kx[i];\r
- iy = ky[i];\r
+ ix = frozen.kx[i];\r
+ iy = frozen.ky[i];\r
if (frozen.quad[ix][iy] == IHS) {\r
movebaddy(ix, iy, i, IHS);\r
break;\r
Move these last so they can base their actions on what the\r
commander(s) do. */\r
if (skill > 3) for (i = 1; i <= nenhere; i++) {\r
- ix = kx[i];\r
- iy = ky[i];\r
+ ix = frozen.kx[i];\r
+ iy = frozen.ky[i];\r
if (frozen.quad[ix][iy] == IHK || frozen.quad[ix][iy] == IHR)\r
movebaddy(ix, iy, i, frozen.quad[ix][iy]);\r
}\r
isatb=0;\r
ishere=0;\r
ientesc=0;\r
- future[FSCDBAS]=1e30;\r
+ frozen.future[FSCDBAS]=1e30;\r
for (i = 1; i <= nenhere; i++) \r
- if (frozen.quad[kx[i]][ky[i]] == IHS) break;\r
- frozen.quad[kx[i]][ky[i]] = IHDOT;\r
- kx[i] = kx[nenhere];\r
- ky[i] = ky[nenhere];\r
- kdist[i] = kdist[nenhere];\r
- kavgd[i] = kavgd[nenhere];\r
- kpower[i] = kpower[nenhere];\r
+ if (frozen.quad[frozen.kx[i]][frozen.ky[i]] == IHS) break;\r
+ frozen.quad[frozen.kx[i]][frozen.ky[i]] = IHDOT;\r
+ frozen.kx[i] = frozen.kx[nenhere];\r
+ frozen.ky[i] = frozen.ky[nenhere];\r
+ frozen.kdist[i] = frozen.kdist[nenhere];\r
+ frozen.kavgd[i] = frozen.kavgd[nenhere];\r
+ frozen.kpower[i] = frozen.kpower[nenhere];\r
klhere--;\r
nenhere--;\r
if (condit!=IHDOCKED) newcnd();\r
/* destroy the planet */\r
state.plnets[i] = nulplanet;\r
state.newstuf[state.isx][state.isy] -= 1;\r
- if (damage[DRADIO] == 0.0 || condit == IHDOCKED) {\r
+ if (frozen.damage[DRADIO] == 0.0 || condit == IHDOCKED) {\r
if (*ipage==0) pause(1);\r
*ipage = 1;\r
prout("Lt. Uhura- \"Captain, Starfleet Intelligence reports");\r
/* compute distances to starbases */\r
if (state.rembase <= 0) {\r
/* nothing left to do */\r
- future[FSCMOVE] = 1e30;\r
+ frozen.future[FSCMOVE] = 1e30;\r
return;\r
}\r
sx = state.isx;\r
}\r
/* check for a base */\r
if (state.rembase == 0) {\r
- future[FSCMOVE] = 1e30;\r
+ frozen.future[FSCMOVE] = 1e30;\r
}\r
else for (i=1; i<=state.rembase; i++) {\r
ibqx = state.baseqx[i];\r
if (flag) return; /* no, don't attack base! */\r
iseenit = 0;\r
isatb=1;\r
- future[FSCDBAS] = state.date + 1.0 +2.0*Rand();\r
- if (batx != 0) future[FSCDBAS] += future[FCDBAS]-state.date;\r
- if (damage[DRADIO] > 0 && condit != IHDOCKED)\r
+ frozen.future[FSCDBAS] = state.date + 1.0 +2.0*Rand();\r
+ if (batx != 0) frozen.future[FSCDBAS] += frozen.future[FCDBAS]-state.date;\r
+ if (frozen.damage[DRADIO] > 0 && condit != IHDOCKED)\r
return; /* no warning */\r
iseenit = 1;\r
if (*ipage == 0) pause(1);\r
skip(1);\r
prout(" reports that it is under attack from the Klingon Super-commander.");\r
proutn(" It can survive until stardate ");\r
- cramf(future[FSCDBAS], 0, 1);\r
+ cramf(frozen.future[FSCDBAS], 0, 1);\r
prout(" .\"");\r
if (resting==0) return;\r
prout("Mr. Spock- \"Captain, shall we cancel the rest period?\"");\r
idebug==0 &&\r
#endif\r
(Rand() > 0.2 ||\r
- (damage[DRADIO] > 0.0 && condit != IHDOCKED) ||\r
- starch[state.isx][state.isy] > 0))\r
+ (frozen.damage[DRADIO] > 0.0 && condit != IHDOCKED) ||\r
+ frozen.starch[state.isx][state.isy] > 0))\r
return;\r
if (*ipage==0) pause(1);\r
*ipage = 1;\r
action = NRG;\r
else {\r
chew();\r
- if (damage[DSHIELD]) {\r
+ if (frozen.damage[DSHIELD]) {\r
prout("Shields damaged and down.");\r
return;\r
}\r
proutn("Energy to transfer to shields- ");\r
action = NRG;\r
}\r
- else if (damage[DSHIELD]) {\r
+ else if (frozen.damage[DSHIELD]) {\r
prout("Shields damaged and down.");\r
return;\r
}\r
casual += icas;\r
for (l=1; l <= ndevice; l++) {\r
if (l == DDRAY) continue; // Don't damage deathray \r
- if (damage[l] < 0) continue;\r
+ if (frozen.damage[l] < 0) continue;\r
extradm = (10.0*type*Rand()+1.0)*damfac;\r
- damage[l] += Time + extradm; /* Damage for at least time of travel! */\r
+ frozen.damage[l] += Time + extradm; /* Damage for at least time of travel! */\r
}\r
shldup = 0;\r
if (state.remkl) {\r
case IHK:\r
/* find the enemy */\r
for (ll=1; ll <= nenhere; ll++)\r
- if (ix==kx[ll] && iy==ky[ll]) break;\r
- kp = fabs(kpower[ll]);\r
+ if (ix==frozen.kx[ll] && iy==frozen.ky[ll]) break;\r
+ kp = fabs(frozen.kpower[ll]);\r
h1 = 700.0 + 100.0*Rand() -\r
1000.0*sqrt(square(ix-inx)+square(iy-iny))*\r
fabs(sin(bullseye-angle));\r
h1 = fabs(h1);\r
if (kp < h1) h1 = kp;\r
- kpower[ll] -= (kpower[ll]<0 ? -h1 : h1);\r
- if (kpower[ll] == 0) {\r
+ frozen.kpower[ll] -= (frozen.kpower[ll]<0 ? -h1 : h1);\r
+ if (frozen.kpower[ll] == 0) {\r
deadkl(ix, iy, iquad, ix, iy);\r
return;\r
}\r
return;\r
}\r
prout(" damaged--");\r
- kx[ll] = jx;\r
- ky[ll] = jy;\r
+ frozen.kx[ll] = jx;\r
+ frozen.ky[ll] = jy;\r
shoved = 1;\r
break;\r
case IHB: /* Hit a base */\r
prout("***STARBASE DESTROYED..");\r
- if (starch[quadx][quady] < 0) starch[quadx][quady] = 0;\r
+ if (frozen.starch[quadx][quady] < 0) frozen.starch[quadx][quady] = 0;\r
for (ll=1; ll<=state.rembase; ll++) {\r
if (state.baseqx[ll]==quadx && state.baseqy[ll]==quady) {\r
state.baseqx[ll]=state.baseqx[state.rembase];\r
cramlc(2, jx, jy);\r
skip(1);\r
for (ll=1; ll<=nenhere; ll++)\r
- kdist[ll] = kavgd[ll] = sqrt(square(sectx-kx[ll])+square(secty-ky[ll]));\r
+ frozen.kdist[ll] = frozen.kavgd[ll] = sqrt(square(sectx-frozen.kx[ll])+square(secty-frozen.ky[ll]));\r
sortkl();\r
return;\r
}\r
do {\r
j = ndevice*Rand()+1.0;\r
/* Cheat to prevent shuttle damage unless on ship */\r
- } while (damage[j] < 0.0 || (j == DSHUTTL && iscraft != 1) ||\r
+ } while (frozen.damage[j] < 0.0 || (j == DSHUTTL && iscraft != 1) ||\r
j == DDRAY);\r
cdam[l] = j;\r
extradm = (hit*damfac)/(ncrit*(75.0+25.0*Rand()));\r
- damage[j] += extradm;\r
+ frozen.damage[j] += extradm;\r
if (l > 1) {\r
for (ll=2; ll<=l && j != cdam[ll-1]; ll++) ;\r
if (ll<=l) continue;\r
proutn(device[j]);\r
}\r
prout(" damaged.");\r
- if (damage[DSHIELD] && shldup) {\r
+ if (frozen.damage[DSHIELD] && shldup) {\r
prout("***Shields knocked down.");\r
shldup=0;\r
}\r
skip(1);\r
if (skill <= 2) i = 2;\r
for (l=1; l <= nenhere; l++) {\r
- if (kpower[l] < 0) continue; /* too weak to attack */\r
+ if (frozen.kpower[l] < 0) continue; /* too weak to attack */\r
/* compute hit strength and diminsh shield power */\r
r = Rand();\r
/* Increase chance of photon torpedos if docked or enemy energy low */\r
if (condit == IHDOCKED) r *= 0.25;\r
- if (kpower[l] < 500) r *= 0.25; \r
- jx = kx[l];\r
- jy = ky[l];\r
+ if (frozen.kpower[l] < 500) r *= 0.25; \r
+ jx = frozen.kx[l];\r
+ jy = frozen.ky[l];\r
iquad = frozen.quad[jx][jy];\r
itflag = (iquad == IHK && r > 0.0005) || k == 0 ||\r
(iquad==IHC && r > 0.015) ||\r
if (condit == IHDOCKED) continue; /* Don't waste the effort! */\r
attempt = 1; /* Attempt to attack */\r
dustfac = 0.8+0.05*Rand();\r
- hit = kpower[l]*pow(dustfac,kavgd[l]);\r
- kpower[l] *= 0.75;\r
+ hit = frozen.kpower[l]*pow(dustfac,frozen.kavgd[l]);\r
+ frozen.kpower[l] *= 0.75;\r
}\r
else { /* Enemy used photon torpedo */\r
double course = 1.90985*atan2((double)secty-jy, (double)jx-sectx);\r
hit = 0;\r
proutn("***TORPEDO INCOMING");\r
- if (damage[DSRSENS] <= 0.0) {\r
+ if (frozen.damage[DSRSENS] <= 0.0) {\r
proutn(" From ");\r
crmena(0, iquad, i, jx, jy);\r
}\r
attempt = 1;\r
prout("--");\r
r = (Rand()+Rand())*0.5 -0.5;\r
- r += 0.002*kpower[l]*r;\r
+ r += 0.002*frozen.kpower[l]*r;\r
torpedo(course, r, jx, jy, &hit);\r
if (state.remkl==0) finish(FWON); /* Klingons did themselves in! */\r
if (state.galaxy[quadx][quady] == 1000 ||\r
ihurt = 1;\r
cramf(hit, 0, 2);\r
proutn(" unit hit");\r
- if ((damage[DSRSENS] > 0 && itflag) || skill <= 2) {\r
+ if ((frozen.damage[DSRSENS] > 0 && itflag) || skill <= 2) {\r
proutn(" on the ");\r
crmshp();\r
}\r
- if (damage[DSRSENS] <= 0.0 && itflag) {\r
+ if (frozen.damage[DSRSENS] <= 0.0 && itflag) {\r
proutn(" from ");\r
crmena(0, iquad, i, jx, jy);\r
}\r
cramf(energy, 0, 2);\r
proutn(" shields ");\r
if (shldup) proutn("up, ");\r
- else if (damage[DSHIELD] == 0) proutn("down, ");\r
+ else if (frozen.damage[DSHIELD] == 0) proutn("down, ");\r
else proutn("damaged, ");\r
}\r
crami(percent, 1);\r
}\r
/* After attack, reset average distance to enemies */\r
for (l = 1; l <= nenhere; l++)\r
- kavgd[l] = kdist[l];\r
+ frozen.kavgd[l] = frozen.kdist[l];\r
sortkl();\r
return;\r
}\r
state.cx[state.remcom] = 0;\r
state.cy[state.remcom] = 0;\r
state.remcom--;\r
- future[FTBEAM] = 1e30;\r
+ frozen.future[FTBEAM] = 1e30;\r
if (state.remcom != 0)\r
- future[FTBEAM] = state.date + expran(1.0*incom/state.remcom);\r
+ frozen.future[FTBEAM] = state.date + expran(1.0*incom/state.remcom);\r
state.killc++;\r
break;\r
case IHK:\r
case IHS:\r
state.nscrem = ishere = state.isx = state.isy = isatb = iscate = 0;\r
state.nsckill = 1;\r
- future[FSCMOVE] = future[FSCDBAS] = 1e30;\r
+ frozen.future[FSCMOVE] = frozen.future[FSCDBAS] = 1e30;\r
break;\r
}\r
}\r
\r
/* For each kind of enemy, finish message to player */\r
- prout(" destroyestate.");\r
+ prout(" destroyed.");\r
frozen.quad[ix][iy] = IHDOT;\r
if (state.remkl==0) return;\r
\r
/* Remove enemy ship from arrays describing local conditions */\r
\r
for (i=1; i<=nenhere; i++)\r
- if (kx[i]==ix && ky[i]==iy) break;\r
+ if (frozen.kx[i]==ix && frozen.ky[i]==iy) break;\r
nenhere--;\r
if (i <= nenhere) {\r
for (j=i; j<=nenhere; j++) {\r
- kx[j] = kx[j+1];\r
- ky[j] = ky[j+1];\r
- kpower[j] = kpower[j+1];\r
- kavgd[j] = kdist[j] = kdist[j+1];\r
+ frozen.kx[j] = frozen.kx[j+1];\r
+ frozen.ky[j] = frozen.ky[j+1];\r
+ frozen.kpower[j] = frozen.kpower[j+1];\r
+ frozen.kavgd[j] = frozen.kdist[j] = frozen.kdist[j+1];\r
}\r
}\r
- kx[nenhere+1] = 0;\r
- ky[nenhere+1] = 0;\r
- kdist[nenhere+1] = 0;\r
- kavgd[nenhere+1] = 0;\r
- kpower[nenhere+1] = 0;\r
+ frozen.kx[nenhere+1] = 0;\r
+ frozen.ky[nenhere+1] = 0;\r
+ frozen.kdist[nenhere+1] = 0;\r
+ frozen.kavgd[nenhere+1] = 0;\r
+ frozen.kpower[nenhere+1] = 0;\r
return;\r
}\r
\r
\r
ididit = 0;\r
\r
- if (damage[DPHOTON]) {\r
+ if (frozen.damage[DPHOTON]) {\r
prout("Photon tubes damaged.");\r
chew();\r
return;\r
osuabor=1;\r
if (Rand() <= 0.2) {\r
prout("***Photon tubes damaged by misfire.");\r
- damage[DPHOTON] = damfac*(1.0+2.0*Rand());\r
+ frozen.damage[DPHOTON] = damfac*(1.0+2.0*Rand());\r
break;\r
}\r
}\r
double chekbrn = (rpow-1500.)*0.00038;\r
if (Rand() <= chekbrn) {\r
prout("Weapons officer Sulu- \"Phasers overheated, sir.\"");\r
- damage[DPHASER] = damfac*(1.0 + Rand()) * (1.0+chekbrn);\r
+ frozen.damage[DPHASER] = damfac*(1.0 + Rand()) * (1.0+chekbrn);\r
}\r
}\r
}\r
\r
skip(1);\r
/* SR sensors and Computer */\r
- if (damage[DSRSENS]+damage[DCOMPTR] > 0) ipoop = 0;\r
+ if (frozen.damage[DSRSENS]+frozen.damage[DCOMPTR] > 0) ipoop = 0;\r
if (condit == IHDOCKED) {\r
prout("Phasers can't be fired through base shields.");\r
chew();\r
return;\r
}\r
- if (damage[DPHASER] != 0) {\r
+ if (frozen.damage[DPHASER] != 0) {\r
prout("Phaser control damaged.");\r
chew();\r
return;\r
}\r
if (shldup) {\r
- if (damage[DSHCTRL]) {\r
+ if (frozen.damage[DSHCTRL]) {\r
prout("High speed shield control damaged.");\r
chew();\r
return;\r
for (i = 1; i <= nenhere; i++) {\r
hits[i] = 0.0;\r
if (powrem <= 0) continue;\r
- hits[i] = fabs(kpower[i])/(phasefac*pow(0.90,kdist[i]));\r
+ hits[i] = fabs(frozen.kpower[i])/(phasefac*pow(0.90,frozen.kdist[i]));\r
over = (0.01 + 0.05*Rand())*hits[i];\r
temp = powrem;\r
powrem -= hits[i] + over;\r
case FORCEMAN:\r
chew();\r
key = IHEOL;\r
- if (damage[DCOMPTR]!=0)\r
+ if (frozen.damage[DCOMPTR]!=0)\r
prout("Battle comuter damaged, manual file only.");\r
else {\r
skip(1);\r
case MANUAL:\r
rpow = 0.0;\r
for (k = 1; k <= nenhere;) {\r
- int ii = kx[k], jj = ky[k];\r
+ int ii = frozen.kx[k], jj = frozen.ky[k];\r
int ienm = frozen.quad[ii][jj];\r
if (msgflag) {\r
proutn("Energy available= ");\r
msgflag = 0;\r
rpow = 0.0;\r
}\r
- if (damage[DSRSENS] && !(abs(sectx-ii) < 2 && abs(secty-jj) < 2) &&\r
+ if (frozen.damage[DSRSENS] && !(abs(sectx-ii) < 2 && abs(secty-jj) < 2) &&\r
(ienm == IHC || ienm == IHS)) {\r
cramen(ienm);\r
prout(" can't be located without short range scan.");\r
if (key == IHEOL) {\r
chew();\r
if (ipoop && k > kz) {\r
- int irec=(fabs(kpower[k])/(phasefac*pow(0.9,kdist[k])))*\r
+ int irec=(fabs(frozen.kpower[k])/(phasefac*pow(0.9,frozen.kdist[k])))*\r
(1.01+0.05*Rand()) + 1.0;\r
kz = k;\r
proutn("(");\r
for (; k <= nenhr2; k++, kk++) {\r
if ((wham = hits[k])==0) continue;\r
dustfac = 0.9 + 0.01*Rand();\r
- hit = wham*pow(dustfac,kdist[kk]);\r
- kpini = kpower[kk];\r
+ hit = wham*pow(dustfac,frozen.kdist[kk]);\r
+ kpini = frozen.kpower[kk];\r
kp = fabs(kpini);\r
if (phasefac*hit < kp) kp = phasefac*hit;\r
- kpower[kk] -= (kpower[kk] < 0 ? -kp: kp);\r
- kpow = kpower[kk];\r
- ii = kx[kk];\r
- jj = ky[kk];\r
+ frozen.kpower[kk] -= (frozen.kpower[kk] < 0 ? -kp: kp);\r
+ kpow = frozen.kpower[kk];\r
+ ii = frozen.kx[kk];\r
+ jj = frozen.ky[kk];\r
if (hit > 0.005) {\r
cramf(hit, 0, 2);\r
proutn(" unit hit on ");\r
cramlc(2,ii,jj);\r
skip(1);\r
prout(" has just lost its firepower.\"");\r
- kpower[kk] = -kpow;\r
+ frozen.kpower[kk] = -kpow;\r
}\r
}\r
return;\r
if (idebug) prout("EVENTS");\r
#endif\r
\r
- if (stdamtim == 1e30 && damage[DRADIO] != 0.0) {\r
+ if (stdamtim == 1e30 && frozen.damage[DRADIO] != 0.0) {\r
/* chart will no longer be updated because radio is dead */\r
stdamtim = state.date;\r
for (i=1; i <= 8 ; i++)\r
for (j=1; j <= 8; j++)\r
- if (starch[i][j] == 1) starch[i][j] = state.galaxy[i][j]+1000;\r
+ if (frozen.starch[i][j] == 1) frozen.starch[i][j] = state.galaxy[i][j]+1000;\r
}\r
\r
for (;;) {\r
if (alldone) return;\r
datemin = fintim;\r
for (l=1; l<=NEVENTS; l++)\r
- if (future[l] <= datemin) {\r
+ if (frozen.future[l] <= datemin) {\r
line = l;\r
- datemin = future[l];\r
+ datemin = frozen.future[l];\r
}\r
xtime = datemin-state.date;\r
state.date = datemin;\r
return;\r
}\r
/* Is life support adequate? */\r
- if (damage[DLIFSUP] && condit != IHDOCKED) {\r
- if (lsupres < xtime && damage[DLIFSUP] > lsupres) {\r
+ if (frozen.damage[DLIFSUP] && condit != IHDOCKED) {\r
+ if (lsupres < xtime && frozen.damage[DLIFSUP] > lsupres) {\r
finish(FLIFESUP);\r
return;\r
}\r
lsupres -= xtime;\r
- if (damage[DLIFSUP] <= xtime) lsupres = inlsr;\r
+ if (frozen.damage[DLIFSUP] <= xtime) lsupres = inlsr;\r
}\r
/* Fix devices */\r
repair = xtime;\r
if (condit == IHDOCKED) repair /= docfac;\r
/* Don't fix Deathray here */\r
for (l=1; l<=ndevice; l++)\r
- if (damage[l] > 0.0 && l != DDRAY)\r
- damage[l] -= (damage[l]-repair > 0.0 ? repair : damage[l]);\r
+ if (frozen.damage[l] > 0.0 && l != DDRAY)\r
+ frozen.damage[l] -= (frozen.damage[l]-repair > 0.0 ? repair : frozen.damage[l]);\r
/* If radio repaired, update star chart and attack reports */\r
- if (stdamtim != 1e30 && damage[DRADIO] == 0.0) {\r
+ if (stdamtim != 1e30 && frozen.damage[DRADIO] == 0.0) {\r
stdamtim = 1e30;\r
prout("Lt. Uhura- \"Captain, the sub-space radio is working and");\r
prout(" surveillance reports are coming in.");\r
skip(1);\r
for (i=1; i <= 8 ; i++)\r
for (j=1; j <= 8; j++)\r
- if (starch[i][j] > 999) starch[i][j] = 1;\r
+ if (frozen.starch[i][j] > 999) frozen.starch[i][j] = 1;\r
if (iseenit==0) {\r
attakreport();\r
iseenit = 1;\r
if (ipage==0) pause(1);\r
ipage=1;\r
snova(0,0);\r
- future[FSNOVA] = state.date + expran(0.5*intime);\r
+ frozen.future[FSNOVA] = state.date + expran(0.5*intime);\r
if (state.galaxy[quadx][quady] == 1000) return;\r
break;\r
case FSPY: /* Check with spy to see if S.C. should tractor beam */\r
condit==IHDOCKED || isatb==1 || iscate==1) return;\r
if (ientesc ||\r
(energy < 2000 && torps < 4 && shield < 1250) ||\r
- (damage[DPHASER]>0 && (damage[DPHOTON]>0 || torps < 4)) ||\r
- (damage[DSHIELD] > 0 &&\r
- (energy < 2500 || damage[DPHASER] > 0) &&\r
- (torps < 5 || damage[DPHOTON] > 0))) {\r
+ (frozen.damage[DPHASER]>0 && (frozen.damage[DPHOTON]>0 || torps < 4)) ||\r
+ (frozen.damage[DSHIELD] > 0 &&\r
+ (energy < 2500 || frozen.damage[DPHASER] > 0) &&\r
+ (torps < 5 || frozen.damage[DPHOTON] > 0))) {\r
/* Tractor-beam her! */\r
istract=1;\r
yank = square(state.isx-quadx) + square(state.isy-quady);\r
case FTBEAM: /* Tractor beam */\r
if (line==FTBEAM) {\r
if (state.remcom == 0) {\r
- future[FTBEAM] = 1e30;\r
+ frozen.future[FTBEAM] = 1e30;\r
break;\r
}\r
i = Rand()*state.remcom+1.0;\r
yank = square(state.cx[i]-quadx) + square(state.cy[i]-quady);\r
if (istract || condit == IHDOCKED || yank == 0) {\r
/* Drats! Have to reschedule */\r
- future[FTBEAM] = state.date + Time +\r
+ frozen.future[FTBEAM] = state.date + Time +\r
expran(1.5*intime/state.remcom);\r
break;\r
}\r
if (Rand() >0.5) {\r
prout("Galileo, left on the planet surface, is captured");\r
prout("by aliens and made into a flying McDonald's.");\r
- damage[DSHUTTL] = -10;\r
+ frozen.damage[DSHUTTL] = -10;\r
iscraft = -1;\r
}\r
else {\r
resting = 0;\r
}\r
if (shldup==0) {\r
- if (damage[DSHIELD]==0 && shield > 0) {\r
+ if (frozen.damage[DSHIELD]==0 && shield > 0) {\r
doshield(2); /* Shldsup */\r
shldchg=0;\r
}\r
newqad(0);\r
/* Adjust finish time to time of tractor beaming */\r
fintim = state.date+Time;\r
- if (state.remcom <= 0) future[FTBEAM] = 1e30;\r
- else future[FTBEAM] = state.date+Time+expran(1.5*intime/state.remcom);\r
+ if (state.remcom <= 0) frozen.future[FTBEAM] = 1e30;\r
+ else frozen.future[FTBEAM] = state.date+Time+expran(1.5*intime/state.remcom);\r
break;\r
case FSNAP: /* Snapshot of the universe (for time warp) */\r
snapsht = state;\r
state.snap = 1;\r
- future[FSNAP] = state.date + expran(0.5 * intime);\r
+ frozen.future[FSNAP] = state.date + expran(0.5 * intime);\r
break;\r
case FBATTAK: /* Commander attacks starbase */\r
if (state.remcom==0 || state.rembase==0) {\r
/* no can do */\r
- future[FBATTAK] = future[FCDBAS] = 1e30;\r
+ frozen.future[FBATTAK] = frozen.future[FCDBAS] = 1e30;\r
break;\r
}\r
i = 0;\r
}\r
if (j>state.rembase) {\r
/* no match found -- try later */\r
- future[FBATTAK] = state.date + expran(0.3*intime);\r
- future[FCDBAS] = 1e30;\r
+ frozen.future[FBATTAK] = state.date + expran(0.3*intime);\r
+ frozen.future[FCDBAS] = 1e30;\r
break;\r
}\r
/* commander + starbase combination found -- launch attack */\r
batx = state.baseqx[j];\r
baty = state.baseqy[j];\r
- future[FCDBAS] = state.date+1.0+3.0*Rand();\r
+ frozen.future[FCDBAS] = state.date+1.0+3.0*Rand();\r
if (isatb) /* extra time if SC already attacking */\r
- future[FCDBAS] += future[FSCDBAS]-state.date;\r
- future[FBATTAK] = future[FCDBAS] +expran(0.3*intime);\r
+ frozen.future[FCDBAS] += frozen.future[FSCDBAS]-state.date;\r
+ frozen.future[FBATTAK] = frozen.future[FCDBAS] +expran(0.3*intime);\r
iseenit = 0;\r
- if (damage[DRADIO] != 0.0 &&\r
+ if (frozen.damage[DRADIO] != 0.0 &&\r
condit != IHDOCKED) break; /* No warning :-( */\r
iseenit = 1;\r
if (ipage==0) pause(1);\r
skip(1);\r
prout(" reports that it is under atttack and that it can");\r
proutn(" hold out only until stardate ");\r
- cramf(future[FCDBAS],1,1);\r
+ cramf(frozen.future[FCDBAS],1,1);\r
prout(".\"");\r
if (resting) {\r
skip(1);\r
}\r
break;\r
case FSCDBAS: /* Supercommander destroys base */\r
- future[FSCDBAS] = 1e30;\r
+ frozen.future[FSCDBAS] = 1e30;\r
isatb = 2;\r
if (state.galaxy[state.isx][state.isy]%100 < 10) break; /* WAS RETURN! */\r
ixhold = batx;\r
baty = state.isy;\r
case FCDBAS: /* Commander succeeds in destroying base */\r
if (line==FCDBAS) {\r
- future[FCDBAS] = 1e30;\r
+ frozen.future[FCDBAS] = 1e30;\r
/* find the lucky pair */\r
for (i = 1; i <= state.remcom; i++)\r
if (state.cx[i]==batx && state.cy[i]==baty) break;\r
}\r
/* Code merges here for any commander destroying base */\r
/* Not perfect, but will have to do */\r
- if (starch[batx][baty] == -1) starch[batx][baty] = 0;\r
+ if (frozen.starch[batx][baty] == -1) frozen.starch[batx][baty] = 0;\r
/* Handle case where base is in same quadrant as starship */\r
if (batx==quadx && baty==quady) {\r
- if (starch[batx][baty] > 999) starch[batx][baty] -= 10;\r
+ if (frozen.starch[batx][baty] > 999) frozen.starch[batx][baty] -= 10;\r
frozen.quad[basex][basey]= IHDOT;\r
basex=basey=0;\r
newcnd();\r
prout("Spock- \"Captain, I believe the starbase has been destroyestate.\"");\r
}\r
else if (state.rembase != 1 &&\r
- (damage[DRADIO] <= 0.0 || condit == IHDOCKED)) {\r
+ (frozen.damage[DRADIO] <= 0.0 || condit == IHDOCKED)) {\r
/* Get word via subspace radio */\r
if (ipage==0) pause(1);\r
ipage = 1;\r
}\r
break;\r
case FSCMOVE: /* Supercommander moves */\r
- future[FSCMOVE] = state.date+0.2777;\r
+ frozen.future[FSCMOVE] = state.date+0.2777;\r
if (ientesc+istract==0 &&\r
isatb!=1 &&\r
(iscate!=1 || justin==1)) scom(&ipage);\r
break;\r
case FDSPROB: /* Move deep space probe */\r
- future[FDSPROB] = state.date + 0.01;\r
+ frozen.future[FDSPROB] = state.date + 0.01;\r
probex += probeinx;\r
probey += probeiny;\r
i = (int)(probex/10 +0.05);\r
if (i < 1 || i > 8 || j < 1 || j > 8 ||\r
state.galaxy[probecx][probecy] == 1000) {\r
// Left galaxy or ran into supernova\r
- if (damage[DRADIO]==0.0 || condit == IHDOCKED) {\r
+ if (frozen.damage[DRADIO]==0.0 || condit == IHDOCKED) {\r
if (ipage==0) pause(1);\r
ipage = 1;\r
skip(1);\r
proutn("is no longer transmitting");\r
prout(".\"");\r
}\r
- future[FDSPROB] = 1e30;\r
+ frozen.future[FDSPROB] = 1e30;\r
break;\r
}\r
- if (damage[DRADIO]==0.0 || condit == IHDOCKED) {\r
+ if (frozen.damage[DRADIO]==0.0 || condit == IHDOCKED) {\r
if (ipage==0) pause(1);\r
ipage = 1;\r
skip(1);\r
}\r
/* Update star chart if Radio is working or have access to\r
radio. */\r
- if (damage[DRADIO] == 0.0 || condit == IHDOCKED)\r
- starch[probecx][probecy] = damage[DRADIO] > 0.0 ?\r
+ if (frozen.damage[DRADIO] == 0.0 || condit == IHDOCKED)\r
+ frozen.starch[probecx][probecy] = frozen.damage[DRADIO] > 0.0 ?\r
state.galaxy[probecx][probecy]+1000 : 1;\r
proben--; // One less to travel\r
if (proben == 0 && isarmed &&\r
state.galaxy[probecx][probecy] % 10 > 0) {\r
/* lets blow the sucker! */\r
snova(1,0);\r
- future[FDSPROB] = 1e30;\r
+ frozen.future[FDSPROB] = 1e30;\r
if (state.galaxy[quadx][quady] == 1000) return;\r
}\r
break;\r
delay -= temp;\r
/* Repair Deathray if long rest at starbase */\r
if (origTime-delay >= 9.99 && condit == IHDOCKED)\r
- damage[DDRAY] = 0.0;\r
+ frozen.damage[DDRAY] = 0.0;\r
} while (state.galaxy[quadx][quady] != 1000); // leave if quadrant supernovas\r
\r
resting = 0;\r
shield = 0.0;\r
shldup = 0;\r
prout("***Shields knocked out.");\r
- damage[DSHIELD] += 0.005*damfac*Rand()*diff;\r
+ frozen.damage[DSHIELD] += 0.005*damfac*Rand()*diff;\r
}\r
}\r
else energy -= 2000.0;\r
case IHS:\r
case IHR:\r
for (ll = 1; ll <= nenhere; ll++)\r
- if (kx[ll]==ii && ky[ll]==jj) break;\r
- kpower[ll] -= 800.0; /* If firepower is lost, die */\r
- if (kpower[ll] <= 0.0) {\r
+ if (frozen.kx[ll]==ii && frozen.ky[ll]==jj) break;\r
+ frozen.kpower[ll] -= 800.0; /* If firepower is lost, die */\r
+ if (frozen.kpower[ll] <= 0.0) {\r
deadkl(ii, jj, iquad, ii, jj);\r
break;\r
}\r
cramlc(2, newcx, newcy);\r
frozen.quad[ii][jj] = IHDOT;\r
frozen.quad[newcx][newcy] = iquad;\r
- kx[ll] = newcx;\r
- ky[ll] = newcy;\r
- kavgd[ll] = sqrt(square(sectx-newcx)+square(secty-newcy));\r
- kdist[ll] = kavgd[ll];\r
+ frozen.kx[ll] = newcx;\r
+ frozen.ky[ll] = newcy;\r
+ frozen.kavgd[ll] = sqrt(square(sectx-newcx)+square(secty-newcy));\r
+ frozen.kdist[ll] = frozen.kavgd[ll];\r
skip(1);\r
break;\r
}\r
\r
if (nqx != quady || nqy != quady || justin != 0) {\r
/* it isn't here, or we just entered (treat as inroute) */\r
- if (damage[DRADIO] == 0.0 || condit == IHDOCKED) {\r
+ if (frozen.damage[DRADIO] == 0.0 || condit == IHDOCKED) {\r
skip(1);\r
proutn("Message from Starfleet Command Stardate ");\r
cramf(state.date, 0, 1);\r
/* did in the Supercommander! */\r
state.nscrem = state.isx = state.isy = isatb = iscate = 0;\r
iscdead = 1;\r
- future[FSCMOVE] = future[FSCDBAS] = 1e30;\r
+ frozen.future[FSCMOVE] = frozen.future[FSCDBAS] = 1e30;\r
}\r
state.remkl -= kldead;\r
if (state.remcom) {\r
state.remcom--;\r
kldead--;\r
comdead++;\r
- if (state.remcom==0) future[FTBEAM] = 1e30;\r
+ if (state.remcom==0) frozen.future[FTBEAM] = 1e30;\r
break;\r
}\r
}\r
}\r
/* mark supernova in galaxy and in star chart */\r
if ((quadx == nqx && quady == nqy) ||\r
- damage[DRADIO] == 0 ||\r
+ frozen.damage[DRADIO] == 0 ||\r
condit == IHDOCKED)\r
- starch[nqx][nqy] = 1;\r
+ frozen.starch[nqx][nqy] = 1;\r
state.galaxy[nqx][nqy] = 1000;\r
/* If supernova destroys last klingons give special message */\r
if (state.remkl==0 && (nqx != quadx || nqy != quady)) {\r
void dstrct() {\r
/* Finish with a BANG! */\r
chew();\r
- if (damage[DCOMPTR] != 0.0) {\r
+ if (frozen.damage[DCOMPTR] != 0.0) {\r
prout("Computer damaged; cannot execute destruct sequence.");\r
return;\r
}\r
prout("SELF-DESTRUCT-SEQUENCE-WILL-BE-ABORTED");\r
scan();\r
chew();\r
- if (strcmp(passwd, citem) != 0) {\r
+ if (strcmp(frozen.passwd, citem) != 0) {\r
prouts("PASSWORD-REJECTED;"); skip(1);\r
prout("CONTINUITY-EFFECTED");\r
skip(1);\r
double whammo = 25.0 * energy;\r
int l=1;\r
while (l <= nenhere) {\r
- if (kpower[l]*kdist[l] <= whammo) \r
- deadkl(kx[l],ky[l], frozen.quad[kx[l]][ky[l]], kx[l], ky[l]);\r
+ if (frozen.kpower[l]*frozen.kdist[l] <= whammo) \r
+ deadkl(frozen.kx[l],frozen.ky[l], frozen.quad[frozen.kx[l]][frozen.ky[l]], frozen.kx[l], frozen.ky[l]);\r
l++;\r
}\r
}\r
deltax /= bigger;\r
\r
/* If tractor beam is to occur, don't move full distance */\r
- if (state.date+Time >= future[FTBEAM]) {\r
+ if (state.date+Time >= frozen.future[FTBEAM]) {\r
trbeam = 1;\r
condit = IHRED;\r
- dist = dist*(future[FTBEAM]-state.date)/Time + 0.1;\r
- Time = future[FTBEAM] - state.date + 1e-5;\r
+ dist = dist*(frozen.future[FTBEAM]-state.date)/Time + 0.1;\r
+ Time = frozen.future[FTBEAM] - state.date + 1e-5;\r
}\r
/* Move within the quadrant */\r
frozen.quad[sectx][secty] = IHDOT;\r
if (nenhere != 0 && iattak != 2) {\r
newcnd();\r
for (l = 1; l <= nenhere; l++) {\r
- finald = sqrt((ix-kx[l])*(double)(ix-kx[l]) +\r
- (iy-ky[l])*(double)(iy-ky[l]));\r
- kavgd[l] = 0.5 * (finald+kdist[l]);\r
+ finald = sqrt((ix-frozen.kx[l])*(double)(ix-frozen.kx[l]) +\r
+ (iy-frozen.ky[l])*(double)(iy-frozen.ky[l]));\r
+ frozen.kavgd[l] = 0.5 * (finald+frozen.kdist[l]);\r
}\r
if (state.galaxy[quadx][quady] != 1000) attack(0);\r
if (alldone) return;\r
frozen.quad[sectx][secty] = ship;\r
if (nenhere) {\r
for (l = 1; l <= nenhere; l++) {\r
- finald = sqrt((ix-kx[l])*(double)(ix-kx[l]) +\r
- (iy-ky[l])*(double)(iy-ky[l]));\r
- kavgd[l] = 0.5 * (finald+kdist[l]);\r
- kdist[l] = finald;\r
+ finald = sqrt((ix-frozen.kx[l])*(double)(ix-frozen.kx[l]) +\r
+ (iy-frozen.ky[l])*(double)(iy-frozen.ky[l]));\r
+ frozen.kavgd[l] = 0.5 * (finald+frozen.kdist[l]);\r
+ frozen.kdist[l] = finald;\r
}\r
sortkl();\r
if (state.galaxy[quadx][quady] != 1000 && iattak == 0)\r
attack(0);\r
- for (l = 1 ; l <= nenhere; l++) kavgd[l] = kdist[l];\r
+ for (l = 1 ; l <= nenhere; l++) frozen.kavgd[l] = frozen.kdist[l];\r
}\r
newcnd();\r
iattak = 0;\r
torps = intorps;\r
lsupres = inlsr;\r
if (stdamtim != 1e30 &&\r
- (future[FCDBAS] < 1e30 || isatb == 1) && iseenit == 0) {\r
+ (frozen.future[FCDBAS] < 1e30 || isatb == 1) && iseenit == 0) {\r
/* get attack report from base */\r
prout("Lt. Uhura- \"Captain, an important message from the starbase:\"");\r
attakreport();\r
return;\r
}\r
while (automatic == -1) {\r
- if (damage[DCOMPTR]) {\r
+ if (frozen.damage[DCOMPTR]) {\r
if (isprobe)\r
prout("Computer damaged; manual navigation only");\r
else\r
double power;\r
\r
ididit = 0;\r
- if (damage[DIMPULS]) {\r
+ if (frozen.damage[DIMPULS]) {\r
chew();\r
skip(1);\r
prout("Engineer Scott- \"The impulse engines are damaged, Sir.\"");\r
\r
if (i!=2) { /* Not WARPX entry */\r
ididit = 0;\r
- if (damage[DWARPEN] > 10.0) {\r
+ if (frozen.damage[DWARPEN] > 10.0) {\r
chew();\r
skip(1);\r
prout("Engineer Scott- \"The impulse engines are damaged, Sir.\"");\r
return;\r
}\r
- if (damage[DWARPEN] > 0.0 && warpfac > 4.0) {\r
+ if (frozen.damage[DWARPEN] > 0.0 && warpfac > 4.0) {\r
chew();\r
skip(1);\r
prout("Engineer Scott- \"Sorry, Captain. Until this damage");\r
Time = 10.0*dist/wfacsq;\r
if (twarp) timwrp();\r
if (blooey) {\r
- damage[DWARPEN] = damfac*(3.0*Rand()+1.0);\r
+ frozen.damage[DWARPEN] = damfac*(3.0*Rand()+1.0);\r
skip(1);\r
prout("Engineering to bridge--");\r
prout(" Scott here. The warp engines are damaged.");\r
huh();\r
return;\r
}\r
- if (damage[DWARPEN] > 10.0) {\r
+ if (frozen.damage[DWARPEN] > 10.0) {\r
prout("Warp engines inoperative.");\r
return;\r
}\r
- if (damage[DWARPEN] > 0.0 && aaitem > 4.0) {\r
+ if (frozen.damage[DWARPEN] > 0.0 && aaitem > 4.0) {\r
prout("Engineer Scott- \"I'm doing my best, Captain,\n"\r
" but right now we can only go warp 4.\"");\r
return;\r
chew();\r
/* is captain on planet? */\r
if (landed==1) {\r
- if (damage[DTRANSP]) {\r
+ if (frozen.damage[DTRANSP]) {\r
finish(FPNOVA);\r
return;\r
}\r
crmshp();\r
skip(1);\r
prout("safely out of quadrant.");\r
- starch[quadx][quady] = damage[DRADIO] > 0.0 ? state.galaxy[quadx][quady]+1000:1;\r
+ frozen.starch[quadx][quady] = frozen.damage[DRADIO] > 0.0 ? state.galaxy[quadx][quady]+1000:1;\r
\r
/* Try to use warp engines */\r
- if (damage[DWARPEN]) {\r
+ if (frozen.damage[DWARPEN]) {\r
skip(1);\r
prout("Warp engines damaged.");\r
finish(FSNOVAED);\r
state = snapsht;\r
state.snap = 0;\r
if (state.remcom) {\r
- future[FTBEAM] = state.date + expran(intime/state.remcom);\r
- future[FBATTAK] = state.date + expran(0.3*intime);\r
+ frozen.future[FTBEAM] = state.date + expran(intime/state.remcom);\r
+ frozen.future[FBATTAK] = state.date + expran(0.3*intime);\r
}\r
- future[FSNOVA] = state.date + expran(0.5*intime);\r
- future[FSNAP] = state.date +expran(0.25*state.remtime); /* next snapshot will\r
+ frozen.future[FSNOVA] = state.date + expran(0.5*intime);\r
+ frozen.future[FSNAP] = state.date +expran(0.25*state.remtime); /* next snapshot will\r
be sooner */\r
- if (state.nscrem) future[FSCMOVE] = 0.2777;\r
+ if (state.nscrem) frozen.future[FSCMOVE] = 0.2777;\r
isatb = 0;\r
- future[FCDBAS] = future[FSCDBAS] = 1e30;\r
+ frozen.future[FCDBAS] = frozen.future[FSCDBAS] = 1e30;\r
batx = baty = 0;\r
\r
/* Make sure Galileo is consistant -- Snapshot may have been taken\r
}\r
/* Likewise, if in the original time the Galileo was abandoned, but\r
was on ship earlier, it would have vanished -- lets restore it */\r
- if (iscraft==0 && gotit==0 && damage[DSHUTTL] >= 0.0) {\r
+ if (iscraft==0 && gotit==0 && frozen.damage[DSHUTTL] >= 0.0) {\r
prout("Checkov- \"Security reports the Galileo has reappeared in the dock!\"");\r
iscraft = 1;\r
}\r
\r
/* Revert star chart to earlier era, if it was known then*/\r
- if (damage[DRADIO]==0.0 || stdamtim > state.date) {\r
+ if (frozen.damage[DRADIO]==0.0 || stdamtim > state.date) {\r
for (l = 1; l <= 8; l++)\r
for (ll = 1; ll <= 8; ll++)\r
- if (starch[l][ll] > 1)\r
- starch[l][ll]=damage[DRADIO]>0.0 ? state.galaxy[l][ll]+1000 :1;\r
+ if (frozen.starch[l][ll] > 1)\r
+ frozen.starch[l][ll]=frozen.damage[DRADIO]>0.0 ? state.galaxy[l][ll]+1000 :1;\r
prout("Spock has reconstructed a correct star chart from memory");\r
- if (damage[DRADIO] > 0.0) stdamtim = state.date;\r
+ if (frozen.damage[DRADIO] > 0.0) stdamtim = state.date;\r
}\r
}\r
else {\r
cramf(Time, 1, 2);\r
prout(" stardates.");\r
/* cheat to make sure no tractor beams occur during time warp */\r
- future[FTBEAM] += Time;\r
- damage[DRADIO] += Time;\r
+ frozen.future[FTBEAM] += Time;\r
+ frozen.damage[DRADIO] += Time;\r
}\r
newqad(0);\r
}\r
prout("Ye Faerie Queene has no deep space probes.");\r
return;\r
}\r
- if (damage[DDSP] != 0.0) {\r
+ if (frozen.damage[DDSP] != 0.0) {\r
chew();\r
skip(1);\r
prout("Engineer Scott- \"The probe launcher is damaged, Sir.\"");\r
return;\r
}\r
- if (future[FDSPROB] != 1e30) {\r
+ if (frozen.future[FDSPROB] != 1e30) {\r
chew();\r
skip(1);\r
- if (damage[DRADIO] != 0 && condit != IHDOCKED) {\r
+ if (frozen.damage[DRADIO] != 0 && condit != IHDOCKED) {\r
prout("Spock- \"Records show the previous probe has not yet");\r
prout(" reached its destination.\"");\r
}\r
probey = quady*10 + secty - 1;\r
probecx = quadx;\r
probecy = quady;\r
- future[FDSPROB] = state.date + 0.01; // Time to move one sector\r
+ frozen.future[FDSPROB] = state.date + 0.01; // Time to move one sector\r
prout("Ensign Chekov- \"The deep space probe is launched, Captain.\"");\r
return;\r
}\r
prout("Lt. Uhura- \"But Captain, we're already docked.\"");\r
return;\r
}\r
- if (damage[DRADIO] != 0) {\r
+ if (frozen.damage[DRADIO] != 0) {\r
prout("Subspace radio damaged.");\r
return;\r
}\r
prout("Already in standard orbit.");\r
return;\r
}\r
- if (damage[DWARPEN] != 0 && damage[DIMPULS] != 0) {\r
+ if (frozen.damage[DWARPEN] != 0 && frozen.damage[DIMPULS] != 0) {\r
prout("Both warp and impulse engines damaged.");\r
return;\r
}\r
void sensor(void) {\r
skip(1);\r
chew();\r
- if (damage[DSRSENS] != 0.0) {\r
+ if (frozen.damage[DSRSENS] != 0.0) {\r
prout("Short range sensors damaged.");\r
return;\r
}\r
void beam(void) {\r
chew();\r
skip(1);\r
- if (damage[DTRANSP] != 0) {\r
+ if (frozen.damage[DTRANSP] != 0) {\r
prout("Transporter damaged.");\r
- if (damage[DSHUTTL]==0 && (state.plnets[iplnet].known==2 || iscraft == 1)) {\r
+ if (frozen.damage[DSHUTTL]==0 && (state.plnets[iplnet].known==2 || iscraft == 1)) {\r
skip(1);\r
prout("Spock- \"May I suggest the shuttle craft, Sir?\" ");\r
if (ja() != 0) shuttle();\r
chew();\r
skip(1);\r
ididit = 0;\r
- if(damage[DSHUTTL] != 0.0) {\r
- if (damage[DSHUTTL] == -1.0) {\r
+ if(frozen.damage[DSHUTTL] != 0.0) {\r
+ if (frozen.damage[DSHUTTL] == -1.0) {\r
if (inorbit && state.plnets[iplnet].known == 2)\r
prout("Ye Faerie Queene has no shuttle craft bay to dock it at.");\r
else\r
prout("Ye Faerie Queene had no shuttle craft.");\r
}\r
- else if (damage[DSHUTTL] > 0)\r
+ else if (frozen.damage[DSHUTTL] > 0)\r
prout("The Galileo is damaged.");\r
else prout("Shuttle craft is now serving Big Macs.");\r
return;\r
/* Kirk on planet */\r
if (iscraft==1) {\r
/* Galileo on ship! */\r
- if (damage[DTRANSP]==0) {\r
+ if (frozen.damage[DTRANSP]==0) {\r
proutn("Spock- \"Would you rather use the transporter?\" ");\r
if (ja() != 0) {\r
beam();\r
prout("Sulu- \"But Sir, there are no enemies in this quadrant.\"");\r
return;\r
}\r
- if (damage[DDRAY] > 0.0) {\r
+ if (frozen.damage[DDRAY] > 0.0) {\r
prout("Death Ray is damaged.");\r
return;\r
}\r
prouts("Sulu- \"Captain! It's working!\"");\r
skip(2);\r
while (nenhere > 0)\r
- deadkl(kx[1],ky[1],frozen.quad[kx[1]][ky[1]],kx[1],ky[1]);\r
+ deadkl(frozen.kx[1],frozen.ky[1],frozen.quad[frozen.kx[1]][frozen.ky[1]],frozen.kx[1],frozen.ky[1]);\r
prout("Ensign Chekov- \"Congratulations, Captain!\"");\r
if (state.remkl == 0) finish(FWON);\r
prout("Spock- \"Captain, I believe the `Experimental Death Ray'");\r
}\r
else {\r
prout(" has been rendered disfunctional.\"");\r
- damage[DDRAY] = 39.95;\r
+ frozen.damage[DDRAY] = 39.95;\r
}\r
return;\r
}\r
#include <string.h>\r
\r
void attakreport(void) {\r
- if (future[FCDBAS] < 1e30) {\r
+ if (frozen.future[FCDBAS] < 1e30) {\r
proutn("Starbase in ");\r
cramlc(1, batx, baty);\r
prout(" is currently under attack.");\r
proutn("It can hold out until Stardate ");\r
- cramf(future[FCDBAS], 0,1);\r
+ cramf(frozen.future[FCDBAS], 0,1);\r
prout(".");\r
}\r
if (isatb == 1) {\r
cramlc(1, state.isx, state.isy);\r
prout(" is under Super-commander attack.");\r
proutn("It can hold out until Stardate ");\r
- cramf(future[FSCDBAS], 0, 1);\r
+ cramf(frozen.future[FSCDBAS], 0, 1);\r
prout(".");\r
}\r
}\r
alldone? "were": "are now", s1, s2, s3);\r
if (skill>3 && thawed && !alldone) prout("No plaque is allowed.");\r
if (tourn) printf("This is tournament game %d.\n", tourn);\r
- if (f) printf("Your secret password is \"%s\"\n",passwd);\r
+ if (f) printf("Your secret password is \"%s\"\n",frozen.passwd);\r
printf("%d of %d Klingons have been killed",\r
state.killk+state.killc+state.nsckill, inkling);\r
if (state.killc) printf(", including %d Commander%s.\n", state.killc, state.killc==1?"":"s");\r
prout(" remaining.");\r
}\r
else printf("There are %d bases.\n", inbase);\r
- if (damage[DRADIO] == 0.0 || condit == IHDOCKED || iseenit) {\r
+ if (frozen.damage[DRADIO] == 0.0 || condit == IHDOCKED || iseenit) {\r
/* Don't report this if not seen and\r
either the radio is dead or not at base! */\r
attakreport();\r
if (nprobes!=1) proutn("s");\r
prout(".");\r
}\r
- if ((damage[DRADIO] == 0.0 || condit == IHDOCKED)&&\r
- future[FDSPROB] != 1e30) {\r
+ if ((frozen.damage[DRADIO] == 0.0 || condit == IHDOCKED)&&\r
+ frozen.future[FDSPROB] != 1e30) {\r
if (isarmed) \r
proutn("An armed deep space probe is in");\r
else\r
void lrscan(void) {\r
int x, y;\r
chew();\r
- if (damage[DLRSENS] != 0.0) {\r
+ if (frozen.damage[DLRSENS] != 0.0) {\r
/* Now allow base's sensors if docked */\r
if (condit != IHDOCKED) {\r
prout("LONG-RANGE SENSORS DAMAGED.");\r
printf(" -1");\r
else {\r
printf("%5d", state.galaxy[x][y]);\r
- starch[x][y] = damage[DRADIO] > 0 ? state.galaxy[x][y]+1000 :1;\r
+ frozen.starch[x][y] = frozen.damage[DRADIO] > 0 ? state.galaxy[x][y]+1000 :1;\r
}\r
}\r
putchar('\n');\r
chew();\r
\r
for (i = 1; i <= ndevice; i++) {\r
- if (damage[i] > 0.0) {\r
+ if (frozen.damage[i] > 0.0) {\r
if (!jdam) {\r
skip(1);\r
prout("DEVICE -REPAIR TIMES-");\r
jdam = TRUE;\r
}\r
printf(" %16s ", device[i]);\r
- cramf(damage[i]+0.05, 8, 2);\r
+ cramf(frozen.damage[i]+0.05, 8, 2);\r
proutn(" ");\r
- cramf(docfac*damage[i]+0.005, 8, 2);\r
+ cramf(docfac*frozen.damage[i]+0.005, 8, 2);\r
skip(1);\r
}\r
}\r
stdamtim = state.date;\r
for (i=1; i <= 8 ; i++)\r
for (j=1; j <= 8; j++)\r
- if (starch[i][j] == 1) starch[i][j] = state.galaxy[i][j]+1000;\r
+ if (frozen.starch[i][j] == 1) frozen.starch[i][j] = state.galaxy[i][j]+1000;\r
}\r
else {\r
proutn("(Last surveillance update ");\r
for (i = 1; i <= 8; i++) {\r
printf("%d -", i);\r
for (j = 1; j <= 8; j++) {\r
- if (starch[i][j] < 0)\r
+ if (frozen.starch[i][j] < 0)\r
printf(" .1.");\r
- else if (starch[i][j] == 0)\r
+ else if (frozen.starch[i][j] == 0)\r
printf(" ...");\r
- else if (starch[i][j] > 999)\r
- printf("%5d", starch[i][j]-1000);\r
+ else if (frozen.starch[i][j] > 999)\r
+ printf("%5d", frozen.starch[i][j]-1000);\r
else\r
printf("%5d", state.galaxy[i][j]);\r
}\r
int goodScan=TRUE;\r
switch (l) {\r
case 1: // SRSCAN\r
- if (damage[DSRSENS] != 0) {\r
+ if (frozen.damage[DSRSENS] != 0) {\r
/* Allow base's sensors if docked */\r
if (condit != IHDOCKED) {\r
prout("SHORT-RANGE SENSORS DAMAGED");\r
prout("[Using starbase's sensors]");\r
}\r
if (goodScan)\r
- starch[quadx][quady] = damage[DRADIO]>0.0 ?\r
+ frozen.starch[quadx][quady] = frozen.damage[DRADIO]>0.0 ?\r
state.galaxy[quadx][quady]+1000:1;\r
scan();\r
if (isit("chart")) nn = TRUE;\r
break;\r
case 4:\r
printf(" Life Support ");\r
- if (damage[DLIFSUP] != 0.0) {\r
+ if (frozen.damage[DLIFSUP] != 0.0) {\r
if (condit == IHDOCKED)\r
printf("DAMAGED, supported by starbase");\r
else\r
break;\r
case 8:\r
printf(" Shields ");\r
- if (damage[DSHIELD] != 0)\r
+ if (frozen.damage[DSHIELD] != 0)\r
printf("DAMAGED,");\r
else if (shldup)\r
printf("UP,");\r
int key, ix1, ix2, iy1, iy2, prompt=FALSE;\r
int wfl;\r
double ttime, twarp, tpower;\r
- if (damage[DCOMPTR] != 0.0) {\r
+ if (frozen.damage[DCOMPTR] != 0.0) {\r
prout("COMPUTER DAMAGED, USE A POCKET CALCULATOR.");\r
skip(1);\r
return;\r
if (twarp > 6.0)\r
prout("You'll be taking risks at that speed, Captain");\r
if ((isatb==1 && state.isy == ix1 && state.isx == iy1 &&\r
- future[FSCDBAS]< ttime+state.date)||\r
- (future[FCDBAS]<ttime+state.date && baty==ix1 && batx == iy1))\r
+ frozen.future[FSCDBAS]< ttime+state.date)||\r
+ (frozen.future[FCDBAS]<ttime+state.date && baty==ix1 && batx == iy1))\r
prout("The starbase there will be destroyed by then.");\r
proutn("New warp factor to try? ");\r
if (scan() == IHREAL) {\r
}\r
fwrite(&state, sizeof(state), 1, fp);\r
fwrite(&snapsht, sizeof(snapsht), 1, fp);\r
- fwrite(kx, sizeof(kx), 1, fp);\r
- fwrite(ky, sizeof(ky), 1, fp);\r
- fwrite(starch, sizeof(starch), 1, fp);\r
- fwrite(kpower, sizeof(kpower), 1, fp);\r
- fwrite(kdist, sizeof(kdist), 1, fp);\r
- fwrite(kavgd, sizeof(kavgd), 1, fp);\r
- fwrite(damage, sizeof(damage), 1, fp);\r
- fwrite(future, sizeof(future), 1, fp);\r
fwrite(&frozen, sizeof(frozen), 1, fp);\r
- fwrite(passwd, sizeof(passwd), 1, fp);\r
\r
fclose(fp);\r
\r
FILE *fp;\r
int key;\r
\r
- passwd[0] = '\0';\r
+ frozen.passwd[0] = '\0';\r
if ((key = scan()) == IHEOL) {\r
proutn("File name: ");\r
key = scan();\r
}\r
fread(&state, sizeof(state), 1, fp);\r
fread(&snapsht, sizeof(snapsht), 1, fp);\r
- fread(kx, sizeof(kx), 1, fp);\r
- fread(ky, sizeof(ky), 1, fp);\r
- fread(starch, sizeof(starch), 1, fp);\r
- fread(kpower, sizeof(kpower), 1, fp);\r
- fread(kdist, sizeof(kdist), 1, fp);\r
- fread(kavgd, sizeof(kavgd), 1, fp);\r
- fread(damage, sizeof(damage), 1, fp);\r
- fread(future, sizeof(future), 1, fp);\r
fread(&frozen, sizeof(frozen), 1, fp);\r
- fread(passwd, sizeof(passwd), 1, fp);\r
\r
fclose(fp);\r
\r
}\r
else {\r
/* Must take shuttle craft to exit */\r
- if (damage[DSHUTTL]==-1) {\r
+ if (frozen.damage[DSHUTTL]==-1) {\r
prout("Ye Faerie Queene has no shuttle craft.");\r
return;\r
}\r
- if (damage[DSHUTTL]<0) {\r
+ if (frozen.damage[DSHUTTL]<0) {\r
prout("Shuttle craft now serving Big Mac's.");\r
return;\r
}\r
- if (damage[DSHUTTL]>0) {\r
+ if (frozen.damage[DSHUTTL]>0) {\r
prout("Shuttle craft damaged.");\r
return;\r
}\r
iscraft=0; /* Gallileo disappears */\r
/* Resupply ship */\r
condit=IHDOCKED;\r
- for (l = 1; l <= ndevice; l++) damage[l] = 0.0;\r
- damage[DSHUTTL] = -1;\r
+ for (l = 1; l <= ndevice; l++) frozen.damage[l] = 0.0;\r
+ frozen.damage[DSHUTTL] = -1;\r
energy = inenrg = 3000.0;\r
shield = inshld = 1250.0;\r
torps = intorps = 6;\r
nprobes = (int)(3.0*Rand() + 2.0); /* Give them 2-4 of these wonders */\r
warpfac = 5.0;\r
wfacsq = warpfac * warpfac;\r
- for (i=0; i <= ndevice; i++) damage[i] = 0.0;\r
+ for (i=0; i <= ndevice; i++) frozen.damage[i] = 0.0;\r
// Set up assorted game parameters\r
batx = baty = 0;\r
state.date = indate = 100.0*(int)(31.0*Rand()+20.0);\r
alive = 1;\r
docfac = 0.25;\r
for (i = 1; i <= 8; i++)\r
- for (j = 1; j <= 8; j++) state.newstuf[i][j] = starch[i][j] = 0;\r
+ for (j = 1; j <= 8; j++) state.newstuf[i][j] = frozen.starch[i][j] = 0;\r
// Initialize times for extraneous events\r
- future[FSNOVA] = state.date + expran(0.5 * intime);\r
- future[FTBEAM] = state.date + expran(1.5 * (intime / state.remcom));\r
- future[FSNAP] = state.date + 1.0 + Rand(); // Force an early snapshot\r
- future[FBATTAK] = state.date + expran(0.3*intime);\r
- future[FCDBAS] = 1e30;\r
- future[FSCMOVE] = state.nscrem ? state.date+0.2777 : 1e30;\r
- future[FSCDBAS] = 1e30;\r
- future[FDSPROB] = 1e30;\r
+ frozen.future[FSNOVA] = state.date + expran(0.5 * intime);\r
+ frozen.future[FTBEAM] = state.date + expran(1.5 * (intime / state.remcom));\r
+ frozen.future[FSNAP] = state.date + 1.0 + Rand(); // Force an early snapshot\r
+ frozen.future[FBATTAK] = state.date + expran(0.3*intime);\r
+ frozen.future[FCDBAS] = 1e30;\r
+ frozen.future[FSCMOVE] = state.nscrem ? state.date+0.2777 : 1e30;\r
+ frozen.future[FSCDBAS] = 1e30;\r
+ frozen.future[FDSPROB] = 1e30;\r
// Starchart is functional\r
stdamtim = 1e30;\r
// Put stars in the galaxy\r
\r
state.baseqx[i] = ix;\r
state.baseqy[i] = iy;\r
- starch[ix][iy] = -1;\r
+ frozen.starch[ix][iy] = -1;\r
state.galaxy[ix][iy] += 10;\r
}\r
// Position ordinary Klingon Battle Cruisers\r
if (isit("frozen")) {\r
thaw();\r
chew();\r
- if (*passwd==0) continue;\r
+ if (*frozen.passwd==0) continue;\r
randomize();\r
Rand(); Rand(); Rand(); Rand();\r
if (!alldone) thawed = 1; // No plaque if not finished\r
}\r
while (TRUE) {\r
scan();\r
- strcpy(passwd, citem);\r
+ strcpy(frozen.passwd, citem);\r
chew();\r
- if (*passwd != 0) break;\r
+ if (*frozen.passwd != 0) break;\r
proutn("Please type in a secret password-");\r
}\r
#ifdef DEBUG\r
- if (strcmp(passwd, "debug")==0) idebug = 1;\r
+ if (strcmp(frozen.passwd, "debug")==0) idebug = 1;\r
#endif\r
\r
// Use parameters to generate initial values of things\r
(skill == 3 && Rand() <= 0.05) ||\r
(skill > 3 && Rand() <= 0.08)\r
#ifdef DEBUG\r
- || strcmp(passwd, "tholianx")==0\r
+ || strcmp(frozen.passwd, "tholianx")==0\r
#endif\r
) {\r
do {\r
quadnum -= 100*klhere;\r
for (i = 1; i <= klhere; i++) {\r
dropin(IHK, &ix, &iy);\r
- kx[i] = ix;\r
- ky[i] = iy;\r
- kdist[i] = kavgd[i] = sqrt(square(sectx-ix) + square(secty-iy));\r
- kpower[i] = Rand()*150.0 +300.0 +25.0*skill;\r
+ frozen.kx[i] = ix;\r
+ frozen.ky[i] = iy;\r
+ frozen.kdist[i] = frozen.kavgd[i] = sqrt(square(sectx-ix) + square(secty-iy));\r
+ frozen.kpower[i] = Rand()*150.0 +300.0 +25.0*skill;\r
}\r
// If we need a commander, promote a Klingon\r
for (i = 1; i <= state.remcom ; i++) \r
\r
if (i <= state.remcom) {\r
frozen.quad[ix][iy] = IHC;\r
- kpower[klhere] = 950.0+400.0*Rand()+50.0*skill;\r
+ frozen.kpower[klhere] = 950.0+400.0*Rand()+50.0*skill;\r
comhere = 1;\r
}\r
\r
// If we need a super-commander, promote a Klingon\r
if (quadx == state.isx && quady == state.isy) {\r
- frozen.quad[kx[1]][ky[1]] = IHS;\r
- kpower[1] = 1175.0 + 400.0*Rand() + 125.0*skill;\r
+ frozen.quad[frozen.kx[1]][frozen.ky[1]] = IHS;\r
+ frozen.kpower[1] = 1175.0 + 400.0*Rand() + 125.0*skill;\r
iscate = 1;\r
ishere = 1;\r
}\r
// Put in Romulans if needed\r
for (i = klhere+1; i <= nenhere; i++) {\r
dropin(IHR, &ix, &iy);\r
- kx[i] = ix;\r
- ky[i] = iy;\r
- kdist[i] = kavgd[i] = sqrt(square(sectx-ix) + square(secty-iy));\r
- kpower[i] = Rand()*400.0 + 450.0 + 50.0*skill;\r
+ frozen.kx[i] = ix;\r
+ frozen.ky[i] = iy;\r
+ frozen.kdist[i] = frozen.kavgd[i] = sqrt(square(sectx-ix) + square(secty-iy));\r
+ frozen.kpower[i] = Rand()*400.0 + 450.0 + 50.0*skill;\r
}\r
sortkl();\r
// If quadrant needs a starbase, put it in\r
// Check for RNZ\r
if (irhere > 0 && klhere == 0 && basex == 0) {\r
neutz = 1;\r
- if (damage[DRADIO] <= 0.0) {\r
+ if (frozen.damage[DRADIO] <= 0.0) {\r
skip(1);\r
prout("LT. Uhura- \"Captain, an urgent message.");\r
prout(" I'll put it on audio.\" CLICK");\r
if (thingx == quadx && thingy == quady) {\r
dropin(IHQUEST, &ix, &iy);\r
thingx = thingy = 0; // Transient\r
- if (damage[DSRSENS] == 0.0) {\r
+ if (frozen.damage[DSRSENS] == 0.0) {\r
skip(1);\r
prout("MR. SPOCK- \"Captain, this is most unusual.");\r
prout(" Please examine your short-range scan.\"");\r
do {\r
sw = FALSE;\r
for (j = 1; j < nenhere; j++)\r
- if (kdist[j] > kdist[j+1]) {\r
+ if (frozen.kdist[j] > frozen.kdist[j+1]) {\r
sw = TRUE;\r
- t = kdist[j];\r
- kdist[j] = kdist[j+1];\r
- kdist[j+1] = t;\r
- t = kavgd[j];\r
- kavgd[j] = kavgd[j+1];\r
- kavgd[j+1] = t;\r
- k = kx[j];\r
- kx[j] = kx[j+1];\r
- kx[j+1] = k;\r
- k = ky[j];\r
- ky[j] = ky[j+1];\r
- ky[j+1] = k;\r
- t = kpower[j];\r
- kpower[j] = kpower[j+1];\r
- kpower[j+1] = t;\r
+ t = frozen.kdist[j];\r
+ frozen.kdist[j] = frozen.kdist[j+1];\r
+ frozen.kdist[j+1] = t;\r
+ t = frozen.kavgd[j];\r
+ frozen.kavgd[j] = frozen.kavgd[j+1];\r
+ frozen.kavgd[j+1] = t;\r
+ k = frozen.kx[j];\r
+ frozen.kx[j] = frozen.kx[j+1];\r
+ frozen.kx[j+1] = k;\r
+ k = frozen.ky[j];\r
+ frozen.ky[j] = frozen.ky[j+1];\r
+ frozen.ky[j+1] = k;\r
+ t = frozen.kpower[j];\r
+ frozen.kpower[j] = frozen.kpower[j+1];\r
+ frozen.kpower[j+1] = t;\r
}\r
} while (sw);\r
}\r
// but I just didn't think of it back when I started.\r
\r
EXTERN struct foo2 {\r
- char quad[11][11]; // contents of our quadrant\r
- int inkling,\r
+ char quad[11][11]; // contents of our quadrant\r
+ double kpower[21]; // enemy energy levels\r
+ double kdist[21]; // enemy distances\r
+ double kavgd[21]; // average distances\r
+ double damage[ndevice+1]; // damage encountered\r
+ double future[NEVENTS+1]; // future events\r
+ char passwd[10]; // Self Destruct password\r
+ int kx[21]; // enemy sector locations\r
+ int ky[21];\r
+ int starch[9][9]; // star chart\r
+ /* members with macro definitions start here */\r
+ int inkling,\r
inbase,\r
incom,\r
instar,\r
#define isarmed frozen.isarmed // Probe is armed\r
#define nprobes frozen.nprobes // number of probes available\r
\r
-EXTERN int\r
- kx[21], // enemy sector locations\r
- ky[21],\r
- starch[9][9]; // star chart\r
-\r
+/* the following global state doesn't need to be saved */\r
EXTERN int fromcommandline; // Game start from command line options\r
-\r
-\r
-EXTERN char passwd[10], // Self Destruct password\r
- *device[ndevice+1];\r
-\r
+EXTERN char *device[ndevice+1];\r
EXTERN PLANETS nulplanet; // zeroed planet structure\r
-\r
-EXTERN double\r
- kpower[21], // enemy energy levels\r
- kdist[21], // enemy distances\r
- kavgd[21], // average distances\r
- damage[ndevice+1], // damage encountered\r
- future[NEVENTS+1]; // future events\r
-\r
EXTERN int iscore, iskill; // Common PLAQ\r
EXTERN double perdate;\r
\r