}
/* print escape message and move out of quadrant.
We know this if either short or long range sensors are working */
- if (game.damage[DSRSENS] == 0.0 || game.damage[DLRSENS] == 0.0 ||
+ if (!damaged(DSRSENS) || !damaged(DLRSENS) ||
game.condit == IHDOCKED) {
crmena(1, ienm, 2, game.ks[loccom]);
prout(_(" escapes to %s (and regains strength)."),
/* If SC, check with spy to see if should hi-tail it */
if (ienm==IHS &&
- (game.kpower[loccom] <= 500.0 || (game.condit==IHDOCKED && game.damage[DPHOTON]==0))) {
+ (game.kpower[loccom] <= 500.0 || (game.condit==IHDOCKED && !damaged(DPHOTON)))) {
irun = 1;
motion = -QUADSIZE;
}
forces = game.kpower[loccom]+100.0*game.nenhere+400*(nbaddys-1);
if (!game.shldup) forces += 1000; /* Good for enemy if shield is down! */
- if (game.damage[DPHASER] == 0.0 || game.damage[DPHOTON] == 0.0) {
- if (game.damage[DPHASER] != 0) /* phasers damaged */
+ if (!damaged(DPHASER) || !damaged(DPHOTON)) {
+ if (damaged(DPHASER)) /* phasers damaged */
forces += 300.0;
else
forces -= 0.2*(game.energy - 2500.0);
- if (game.damage[DPHOTON] != 0) /* photon torpedoes damaged */
+ if (damaged(DPHOTON)) /* photon torpedoes damaged */
forces += 300.0;
else
forces -= 50.0*game.torps;
game.ks[loccom].y = next.y;
game.kdist[loccom] = game.kavgd[loccom] =
sqrt(square(game.sector.x-next.x)+square(game.sector.y-next.y));
- if (game.damage[DSRSENS] == 0 || game.condit == IHDOCKED) {
+ if (!damaged(DSRSENS) || game.condit == IHDOCKED) {
proutn("***");
cramen(ienm);
proutn(_(" from %s"), cramlc(2, com));
/* destroy the planet */
DESTROY(&game.state.plnets[i]);
game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].planet = NOPLANET;
- if (game.damage[DRADIO] == 0.0 || game.condit == IHDOCKED) {
+ if (!damaged(DRADIO) || game.condit == IHDOCKED) {
if (*ipage==0) pause_game(1);
*ipage = 1;
prout(_("Lt. Uhura- \"Captain, Starfleet Intelligence reports"));
schedule(FSCDBAS, 1.0 +2.0*Rand());
if (is_scheduled(FCDBAS))
postpone(FSCDBAS, scheduled(FCDBAS)-game.state.date);
- if (game.damage[DRADIO] > 0 && game.condit != IHDOCKED)
+ if (damaged(DRADIO) && game.condit != IHDOCKED)
return; /* no warning */
game.iseenit = 1;
if (*ipage == 0) pause_game(1);
if (
!idebug &&
(Rand() > 0.2 ||
- (game.damage[DRADIO] > 0.0 && game.condit != IHDOCKED) ||
+ (damaged(DRADIO) && game.condit != IHDOCKED) ||
!game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].charted))
return;
if (*ipage==0) pause_game(1);
action = NRG;
else {
chew();
- if (game.damage[DSHIELD]) {
+ if (!damaged(DSHIELD)) {
prout(_("Shields damaged and down."));
return;
}
proutn(_("Energy to transfer to shields- "));
action = NRG;
}
- else if (game.damage[DSHIELD]) {
+ else if (damaged(DSHIELD)) {
prout(_("Shields damaged and down."));
return;
}
if (fabs(deltay) > bigger) bigger = fabs(deltay);
deltax /= bigger;
deltay /= bigger;
- if (game.damage[DSRSENS]==0 || game.condit==IHDOCKED)
+ if (!damaged(DSRSENS) || game.condit==IHDOCKED)
setwnd(srscan_window);
else
setwnd(message_window);
proutn(device[j]);
}
prout(_(" damaged."));
- if (game.damage[DSHIELD] && game.shldup) {
+ if (damaged(DSHIELD) && game.shldup) {
prout(_("***Shields knocked down."));
game.shldup=false;
}
double course = 1.90985*atan2((double)game.sector.y-jay.y, (double)jay.x-game.sector.x);
hit = 0;
proutn(_("***TORPEDO INCOMING"));
- if (game.damage[DSRSENS] <= 0.0) {
+ if (!damaged(DSRSENS)) {
proutn(_(" From "));
crmena(0, iquad, i, jay);
}
doesn't make any sense, so I've fw.xed it */
ihurt = 1;
proutn(_("%d unit hit"), (int)hit);
- if ((game.damage[DSRSENS] > 0 && itflag) || game.skill<=SKILL_FAIR) {
+ if ((damaged(DSRSENS) && itflag) || game.skill<=SKILL_FAIR) {
proutn(_(" on the "));
crmshp();
}
- if (game.damage[DSRSENS] <= 0.0 && itflag) {
+ if (!damaged(DSRSENS) && itflag) {
proutn(_(" from "));
crmena(0, iquad, i, jay);
}
skip(1);
proutn(_("Energy left %2d shields "), (int)game.energy);
if (game.shldup) proutn(_("up "));
- else if (game.damage[DSHIELD] == 0) proutn(_("down "));
+ else if (!damaged(DSHIELD)) proutn(_("down "));
else proutn(_("damaged, "));
}
prout(_("%d%%, torpedoes left %d"), percent, game.torps);
game.ididit = 0;
- if (game.damage[DPHOTON]) {
+ if (damaged(DPHOTON)) {
prout(_("Photon tubes damaged."));
chew();
return;
skip(1);
/* SR sensors and Computer */
- if (game.damage[DSRSENS]+game.damage[DCOMPTR] > 0) ipoop = 0;
+ if (damaged(DSRSENS) || damaged(DCOMPTR)) ipoop = 0;
if (game.condit == IHDOCKED) {
prout(_("Phasers can't be fired through base shields."));
chew();
return;
}
- if (game.damage[DPHASER] != 0) {
+ if (damaged(DPHASER)) {
prout(_("Phaser control damaged."));
chew();
return;
}
if (game.shldup) {
- if (game.damage[DSHCTRL]) {
+ if (damaged(DSHCTRL)) {
prout(_("High speed shield control damaged."));
chew();
return;
case FORCEMAN:
chew();
key = IHEOL;
- if (game.damage[DCOMPTR]!=0)
+ if (damaged(DCOMPTR))
prout(_("Battle comuter damaged, manual file only."));
else {
skip(1);
msgflag = 0;
rpow = 0.0;
}
- if (game.damage[DSRSENS] && !(abs(game.sector.x-aim.x) < 2 && abs(game.sector.y-aim.y) < 2) &&
+ if (damaged(DSRSENS) && !(abs(game.sector.x-aim.x) < 2 && abs(game.sector.y-aim.y) < 2) &&
(ienm == IHC || ienm == IHS)) {
cramen(ienm);
prout(_(" can't be located without short range scan."));
(1.01+0.05*Rand()) + 1.0;
kz = k;
proutn("(");
- if (game.damage[DCOMPTR]==0) proutn("%d", irec);
+ if (!damaged(DCOMPTR)) proutn("%d", irec);
else proutn("??");
proutn(") ");
proutn(_("units to fire at "));
kpow = game.kpower[kk];
w = game.ks[kk];
if (hit > 0.005) {
- if (game.damage[DSRSENS]==0)
+ if (!damaged(DSRSENS))
boom(w.x, w.y);
proutn(_("%d unit hit on "), (int)hit);
}
}
}
- radio_was_broken = (game.damage[DRADIO] != 0.0);
+ radio_was_broken = damaged(DRADIO);
for (;;) {
/* Select earliest extraneous event, evcode==0 if no events */
return;
}
/* Is life support adequate? */
- if (game.damage[DLIFSUP] && game.condit != IHDOCKED) {
+ if (damaged(DLIFSUP) && game.condit != IHDOCKED) {
if (game.lsupres < xtime && game.damage[DLIFSUP] > game.lsupres) {
finish(FLIFESUP);
return;
if (game.damage[l] > 0.0 && l != DDRAY)
game.damage[l] -= (game.damage[l]-repair > 0.0 ? repair : game.damage[l]);
/* If radio repaired, update star chart and attack reports */
- if (radio_was_broken && game.damage[DRADIO] == 0.0) {
+ if (radio_was_broken && !damaged(DRADIO)) {
prout(_("Lt. Uhura- \"Captain, the sub-space radio is working and"));
prout(_(" surveillance reports are coming in."));
skip(1);
game.condit==IHDOCKED || game.isatb==1 || game.iscate==1) return;
if (game.ientesc ||
(game.energy < 2000 && game.torps < 4 && game.shield < 1250) ||
- (game.damage[DPHASER]>0 && (game.damage[DPHOTON]>0 || game.torps < 4)) ||
- (game.damage[DSHIELD] > 0 &&
- (game.energy < 2500 || game.damage[DPHASER] > 0) &&
- (game.torps < 5 || game.damage[DPHOTON] > 0))) {
+ (damaged(DPHASER) && (damaged(DPHOTON) || game.torps < 4)) ||
+ (damaged(DSHIELD) &&
+ (game.energy < 2500 || damaged(DPHASER)) &&
+ (game.torps < 5 || damaged(DPHOTON)))) {
/* Tractor-beam her! */
istract=1;
yank = square(game.state.kscmdr.x-game.quadrant.x) + square(game.state.kscmdr.y-game.quadrant.y);
game.resting = false;
}
if (!game.shldup) {
- if (game.damage[DSHIELD]==0 && game.shield > 0) {
+ if (!damaged(DSHIELD) && game.shield > 0) {
doshield(2); /* Shldsup */
game.shldchg=0;
}
postpone(FCDBAS, scheduled(FSCDBAS)-game.state.date);
game.future[FBATTAK].date = game.future[FCDBAS].date + expran(0.3*game.intime);
game.iseenit = 0;
- if (game.damage[DRADIO] != 0.0 && game.condit != IHDOCKED)
+ if (!damaged(DRADIO) && game.condit != IHDOCKED)
break; /* No warning :-( */
game.iseenit = 1;
if (!ipage) pause_game(1);
prout(_("Spock- \"Captain, I believe the starbase has been destroyed.\""));
}
else if (game.state.rembase != 1 &&
- (game.damage[DRADIO] <= 0.0 || game.condit == IHDOCKED)) {
+ (!damaged(DRADIO) || game.condit == IHDOCKED)) {
/* Get word via subspace radio */
if (!ipage) pause_game(1);
ipage = true;
if (!VALID_QUADRANT(i, j) ||
game.state.galaxy[game.probec.x][game.probec.y].supernova) {
// Left galaxy or ran into supernova
- if (game.damage[DRADIO]==0.0 || game.condit == IHDOCKED) {
+ if (!damaged(DRADIO) || game.condit == IHDOCKED) {
if (ipage==0) pause_game(1);
ipage = 1;
skip(1);
unschedule(FDSPROB);
break;
}
- if (game.damage[DRADIO]==0.0 || game.condit == IHDOCKED) {
+ if (!damaged(DRADIO) || game.condit == IHDOCKED) {
if (ipage==0) pause_game(1);
ipage = 1;
skip(1);
pdest = &game.state.galaxy[game.probec.x][game.probec.y];
/* Update star chart if Radio is working or have access to
radio. */
- if (game.damage[DRADIO] == 0.0 || game.condit == IHDOCKED) {
+ if (!damaged(DRADIO) || game.condit == IHDOCKED) {
struct page *chp = &game.state.chart[game.probec.x][game.probec.y];
chp->klingons = pdest->klingons;
q->status = distressed;
/* tell the captain about it if we can */
- if (game.damage[DRADIO] == 0.0 || game.condit == IHDOCKED)
+ if (!damaged(DRADIO) || game.condit == IHDOCKED)
{
prout("Uhura- Captain, %s in %s reports it is under attack",
systemname(q->planet), cramlc(quadrant, w));
ev2->quadrant = ev->quadrant;
/* report the disaster if we can */
- if (game.damage[DRADIO] == 0.0 || game.condit == IHDOCKED)
+ if (!damaged(DRADIO) || game.condit == IHDOCKED)
{
prout("Uhura- We've lost contact with starsystem %s",
systemname(q->planet));
/* recompute time left */
game.state.remtime = game.state.remres/(game.state.remkl+4*game.state.remcom);
/* report the disaster if we can */
- if (game.damage[DRADIO] == 0.0 || game.condit == IHDOCKED)
+ if (!damaged(DRADIO) || game.condit == IHDOCKED)
{
if (same(game.quadrant, w)) {
prout("Spock- sensors indicate the Klingons have");
if (nq.x != game.quadrant.y || nq.y != game.quadrant.y || game.justin != 0) {
/* it isn't here, or we just entered (treat as inroute) */
- if (game.damage[DRADIO] == 0.0 || game.condit == IHDOCKED) {
+ if (!damaged(DRADIO) || game.condit == IHDOCKED) {
skip(1);
prout(_("Message from Starfleet Command Stardate %.2f"), game.state.date);
prout(_(" Supernova in %s; caution advised."),
game.state.nplankl += npdead;
}
/* mark supernova in galaxy and in star chart */
- if (same(game.quadrant, nq) || game.damage[DRADIO] == 0 || game.condit == IHDOCKED)
+ if (same(game.quadrant, nq) || !damaged(DRADIO) || game.condit == IHDOCKED)
game.state.galaxy[nq.x][nq.y].supernova = true;
/* If supernova destroys last Klingons give special message */
if (KLINGREM==0 && (nq.x != game.quadrant.x || nq.y != game.quadrant.y)) {
{
/* Finish with a BANG! */
chew();
- if (game.damage[DCOMPTR] != 0.0) {
+ if (damaged(DCOMPTR)) {
prout(_("Computer damaged; cannot execute destruct sequence."));
return;
}
skip(1);
proutn("%d - %d ", ix, iy);
} else {
- if (game.damage[DSRSENS]==0 || game.condit==IHDOCKED) {
+ if (!damaged(DSRSENS) || game.condit==IHDOCKED) {
if (i != 1 && l == 1) {
drawmaps(2);
delay(400);
game.shield = game.inshld;
game.torps = game.intorps;
game.lsupres = game.inlsr;
- if (game.damage[DRADIO] == 0.0 &&
+ if (!damaged(DRADIO) &&
(is_scheduled(FCDBAS) || game.isatb == 1) && game.iseenit == 0) {
/* get attack report from base */
prout("Lt. Uhura- \"Captain, an important message from the starbase:\"");
return;
}
while (automatic == -1) {
- if (game.damage[DCOMPTR]) {
+ if (damaged(DCOMPTR)) {
if (isprobe)
prout("Computer damaged; manual navigation only");
else
double power;
game.ididit = 0;
- if (game.damage[DIMPULS]) {
+ if (damaged(DIMPULS)) {
chew();
skip(1);
prout("Engineer Scott- \"The impulse engines are damaged, Sir.\"");
prout("Engineer Scott- \"The impulse engines are damaged, Sir.\"");
return;
}
- if (game.damage[DWARPEN] > 0.0 && game.warpfac > 4.0) {
+ if (damaged(DWARPEN) && game.warpfac > 4.0) {
chew();
skip(1);
prout("Engineer Scott- \"Sorry, Captain. Until this damage");
prout("Warp engines inoperative.");
return;
}
- if (game.damage[DWARPEN] > 0.0 && aaitem > 4.0) {
+ if (damaged(DWARPEN) && aaitem > 4.0) {
prout("Engineer Scott- \"I'm doing my best, Captain,");
prout(" but right now we can only go warp 4.\"");
return;
chew();
/* is captain on planet? */
if (game.landed==1) {
- if (game.damage[DTRANSP]) {
+ if (damaged(DTRANSP)) {
finish(FPNOVA);
return;
}
crmshp();
skip(1);
prout("safely out of quadrant.");
- if (game.damage[DRADIO] == 0.0)
+ if (!damaged(DRADIO))
game.state.galaxy[game.quadrant.x][game.quadrant.y].charted = true;
/* Try to use warp engines */
- if (game.damage[DWARPEN]) {
+ if (damaged(DWARPEN)) {
skip(1);
prout("Warp engines damaged.");
finish(FSNOVAED);
prout("Ye Faerie Queene has no deep space probes.");
return;
}
- if (game.damage[DDSP] != 0.0) {
+ if (damaged(DDSP)) {
chew();
skip(1);
prout("Engineer Scott- \"The probe launcher is damaged, Sir.\"");
if (is_scheduled(FDSPROB)) {
chew();
skip(1);
- if (game.damage[DRADIO] != 0 && game.condit != IHDOCKED) {
+ if (damaged(DRADIO) && game.condit != IHDOCKED) {
prout("Spock- \"Records show the previous probe has not yet");
prout(" reached its destination.\"");
}
prout("Lt. Uhura- \"But Captain, we're already docked.\"");
return;
}
- if (game.damage[DRADIO] != 0) {
+ if (damaged(DRADIO)) {
prout("Subspace radio damaged.");
return;
}
prout("Already in standard orbit.");
return;
}
- if (game.damage[DWARPEN] != 0 && game.damage[DIMPULS] != 0) {
+ if (damaged(DWARPEN) && damaged(DIMPULS)) {
prout("Both warp and impulse engines damaged.");
return;
}
{
skip(1);
chew();
- if (game.damage[DSRSENS] != 0.0) {
+ if (damaged(DSRSENS)) {
prout("Short range sensors damaged.");
return;
}
{
chew();
skip(1);
- if (game.damage[DTRANSP] != 0) {
+ if (damaged(DTRANSP)) {
prout("Transporter damaged.");
- if (game.damage[DSHUTTL]==0 && (game.state.plnets[game.iplnet].known==shuttle_down || game.iscraft == 1)) {
+ if (!damaged(DSHUTTL) && (game.state.plnets[game.iplnet].known==shuttle_down || game.iscraft == 1)) {
skip(1);
proutn("Spock- \"May I suggest the shuttle craft, Sir?\" ");
if (ja() != 0) shuttle();
{
chew();
skip(1);
- if(game.damage[DSHUTTL] != 0.0) {
+ if(damaged(DSHUTTL)) {
if (game.damage[DSHUTTL] == -1.0) {
if (game.inorbit && game.state.plnets[game.iplnet].known == shuttle_down)
prout("Ye Faerie Queene has no shuttle craft bay to dock it at.");
}
else if (game.damage[DSHUTTL] > 0)
prout("The Galileo is damaged.");
- else prout("Shuttle craft is now serving Big Macs.");
+ else /* game.damage[DSHUTTL] < 0 */
+ prout("Shuttle craft is now serving Big Macs.");
return;
}
if (!game.inorbit) {
/* Kirk on planet */
if (game.iscraft==1) {
/* Galileo on ship! */
- if (game.damage[DTRANSP]==0) {
+ if (!damaged(DTRANSP)) {
proutn("Spock- \"Would you rather use the transporter?\" ");
if (ja() != 0) {
beam();
prout("Sulu- \"But Sir, there are no enemies in this quadrant.\"");
return;
}
- if (game.damage[DDRAY] > 0.0) {
+ if (damaged(DDRAY)) {
prout("Death Ray is damaged.");
return;
}
prout(" destroyed, %d remaining.", game.state.rembase);
}
else prout("There are %d bases.", game.inbase);
- if (game.damage[DRADIO] == 0.0 || game.condit == IHDOCKED || game.iseenit) {
+ if (!damaged(DRADIO) || game.condit == IHDOCKED || game.iseenit) {
/* Don't report this if not seen and
either the radio is dead or not at base! */
attakreport(0);
if (game.nprobes!=1) proutn("s");
prout(".");
}
- if ((game.damage[DRADIO] == 0.0 || game.condit == IHDOCKED)
+ if ((!damaged(DRADIO) || game.condit == IHDOCKED)
&& is_scheduled(FDSPROB)) {
if (game.isarmed)
proutn("An armed deep space probe is in");
{
int x, y;
chew();
- if (game.damage[DLRSENS] != 0.0) {
+ if (damaged(DLRSENS)) {
/* Now allow base's sensors if docked */
if (game.condit != IHDOCKED) {
prout("LONG-RANGE SENSORS DAMAGED.");
if (!VALID_QUADRANT(x, y))
proutn(" -1");
else {
- if (!game.damage[DRADIO])
+ if (!damaged(DRADIO))
game.state.galaxy[x][y].charted = true;
game.state.chart[x][y].klingons = game.state.galaxy[x][y].klingons;
game.state.chart[x][y].starbase = game.state.galaxy[x][y].starbase;
chew();
for (i = 0; i < NDEVICES; i++) {
- if (game.damage[i] > 0.0) {
+ if (damaged(i)) {
if (!jdam) {
prout("DEVICE -REPAIR TIMES-");
prout(" IN FLIGHT DOCKED");
int i,j;
chew();
- if (game.damage[DRADIO] == 0.0)
+ if (!damaged(DRADIO))
rechart();
if (game.lastchart < game.state.date && game.condit == IHDOCKED) {
break;
case 4:
proutn("Life Support ");
- if (game.damage[DLIFSUP] != 0.0) {
+ if (damaged(DLIFSUP)) {
if (game.condit == IHDOCKED)
proutn("DAMAGED, Base provides");
else
break;
case 8:
proutn("Shields ");
- if (game.damage[DSHIELD] != 0)
+ if (damaged(DSHIELD))
proutn("DAMAGED,");
else if (game.shldup)
proutn("UP,");
int goodScan=true, leftside=true, rightside=true, nn=false;
switch (l) {
case SCAN_FULL: // SRSCAN
- if (game.damage[DSRSENS] != 0) {
+ if (damaged(DSRSENS)) {
/* Allow base's sensors if docked */
if (game.condit != IHDOCKED) {
prout(" S.R. SENSORS DAMAGED!");
prout(" [Using Base's sensors]");
}
else prout(" Short-range scan");
- if (goodScan && !game.damage[DRADIO]) {
+ if (goodScan && !damaged(DRADIO)) {
game.state.chart[game.quadrant.x][game.quadrant.y].klingons = game.state.galaxy[game.quadrant.x][game.quadrant.y].klingons;
game.state.chart[game.quadrant.x][game.quadrant.y].starbase = game.state.galaxy[game.quadrant.x][game.quadrant.y].starbase;
game.state.chart[game.quadrant.x][game.quadrant.y].stars = game.state.galaxy[game.quadrant.x][game.quadrant.y].stars;
int ix1, ix2, iy1, iy2;
bool wfl, prompt = false;
double ttime, twarp, tpower;
- if (game.damage[DCOMPTR] != 0.0) {
+ if (damaged(DCOMPTR)) {
prout("COMPUTER DAMAGED, USE A POCKET CALCULATOR.");
skip(1);
return;
return 0;
}
+/*
+** Abandon Ship
+**
+** The ship is abandoned. If your current ship is the Faire
+** Queene, or if your shuttlecraft is dead, you're out of
+** luck. You need the shuttlecraft in order for the captain
+** (that's you!!) to escape.
+**
+** Your crew can beam to an inhabited starsystem in the
+** quadrant, if there is one and if the transporter is working.
+** If there is no inhabited starsystem, or if the transporter
+** is out, they are left to die in outer space.
+**
+** If there are no starbases left, you are captured by the
+** Klingons, who torture you mercilessly. However, if there
+** is at least one starbase, you are returned to the
+** Federation in a prisoner of war exchange. Of course, this
+** can't happen unless you have taken some prisoners.
+**
+*/
+
void abandn(void)
{
int nb, l;
+ struct quadrant *q;
chew();
if (game.condit==IHDOCKED) {
prouts("***ALL HANDS ABANDON SHIP!");
skip(2);
prout("Captain and crew escape in shuttle craft.");
- prout("Remainder of ship's complement beam down");
- prout("to nearest habitable planet.");
if (game.state.rembase==0) {
/* Oops! no place to go... */
finish(FABANDN);
return;
}
+ q = &game.state.galaxy[game.quadrant.x][game.quadrant.y];
+ /* Dispose of crew */
+ if (!(game.options & OPTION_WORLDS) && !damaged(DTRANSP)) {
+ prout("Remainder of ship's complement beam down");
+ prout("to nearest habitable planet.");
+ } else if (q->planet != NOPLANET && !damaged(DTRANSP)) {
+ prout("Remainder of ship's complement beam down");
+ prout("to %s.", systemname(q->planet));
+ } else {
+ prout("Entire crew of %d left to die in outer space.");
+ }
+
/* If at least one base left, give 'em the Faerie Queene */
skip(1);
game.icrystl = 0; /* crystals are lost */
prout("still useable.");
if (game.icrystl!=0) prout("The dilithium crystals have been moved.");
game.imine=0;
- game.iscraft=0; /* Gallileo disappears */
+ game.iscraft=0; /* Galileo disappears */
/* Resupply ship */
game.condit=IHDOCKED;
for (l = 0; l < NDEVICES; l++)
// Check for RNZ
if (game.irhere > 0 && game.klhere == 0 && (here->planet == NOPLANET || game.state.plnets[here->planet].inhabited == UNINHABITED)) {
game.neutz = 1;
- if (game.damage[DRADIO] <= 0.0) {
+ if (!damaged(DRADIO)) {
skip(1);
prout("LT. Uhura- \"Captain, an urgent message.");
prout(" I'll put it on audio.\" CLICK");
game.kdist[game.nenhere] = game.kavgd[game.nenhere] =
sqrt(square(game.sector.x-w.x) + square(game.sector.y-w.y));
game.kpower[game.nenhere] = Rand()*6000.0 +500.0 +250.0*game.skill;
- if (game.damage[DSRSENS] == 0.0) {
+ if (!damaged(DSRSENS)) {
skip(1);
prout("MR. SPOCK- \"Captain, this is most unusual.");
prout(" Please examine your short-range scan.\"");
#define DDSP 14 // Added deep space probe
#define NDEVICES (15) // Number of devices
+#define damaged(dev) game.damage[dev] != 0.0
+
#define FOREVER 1e30
/* Define future events */