icas = 10.0+20.0*Rand();
prout(_("***Sickbay reports %d casualties"), icas);
game.casual += icas;
+ game.state.crew -= icas;
for (l=0; l < NDEVICES; l++) {
if (l == DDRAY)
continue; // Don't damage deathray
if (absorb > game.shield) absorb = game.shield;
game.shield -= absorb;
hit -= hitsh;
- if (game.condit==IHDOCKED) dock(0);
+ if (game.condit==IHDOCKED) dock(false);
if (propor > 0.1 && hit < 0.005*game.energy) continue;
}
/* It's a hit -- print out hit size */
atackd = 1; /* We weren't going to check casualties, etc. if
shields were down for some strange reason. This
- doesn't make any sense, so I've fw.xed it */
+ doesn't make any sense, so I've fixed it */
ihurt = 1;
proutn(_("%d unit hit"), (int)hit);
if ((damaged(DSRSENS) && itflag) || game.skill<=SKILL_FAIR) {
fry(hit);
game.energy -= hit;
if (game.condit==IHDOCKED)
- dock(0);
+ dock(false);
}
if (game.energy <= 0) {
/* Returning home upon your shield, not with it... */
prout(_("Mc Coy- \"Sickbay to bridge. We suffered %d casualties"), icas);
prout(_(" in that last attack.\""));
game.casual += icas;
+ game.state.crew -= icas;
}
}
/* After attack, reset average distance to enemies */
skip(1);
prout(_("McCoy to bridge- \"Severe radiation burns, Jim."));
prout(_(" %d casualties so far.\""), icas);
- game.casual -= icas;
+ game.casual += icas;
+ game.state.crew -= icas;
}
skip(1);
prout(_("Phaser energy dispersed by shields."));
finish(FDEPLETE);
return;
}
+ /* Any crew left alive? */
+ if (game.state.crew <=0) {
+ finish(FCREW);
+ return;
+ }
/* Is life support adequate? */
if (damaged(DLIFSUP) && game.condit != IHDOCKED) {
if (game.lsupres < xtime && game.damage[DLIFSUP] > game.lsupres) {
if (game.alive) {
double badpt;
badpt = 5.0*game.state.starkl + game.casual + 10.0*game.state.nplankl +
- 45.*game.nhelp+100.*game.state.basekl;
+ 45.*game.nhelp+100.*game.state.basekl+3.*game.abandoned;
if (game.ship == IHF) badpt += 100.0;
else if (game.ship == 0) badpt += 200.0;
if (badpt < 100.0) badpt = 0.0; // Close enough!
prout(_("Your ship is drawn to the center of the black hole."));
prout(_("You are crushed into extremely dense matter."));
break;
+ case FCREW:
+ prout(_("Your last crew member has died."));
+ break;
}
if (game.ship==IHF) game.ship= 0;
else if (game.ship == IHE) game.ship = IHF;
if (game.casual)
prout(_("%6d casualties incurred %5d"),
game.casual, -game.casual);
+ if (game.abandoned)
+ prout(_("%6d crew abandoned in space %5d"),
+ game.abandoned, -3*game.abandoned);
if (klship)
prout(_("%6d ship(s) lost or destroyed %5d"),
klship, -100*klship);
return;
}
-void dock(int l)
+void dock(bool verbose)
{
chew();
- if (game.condit == IHDOCKED && l) {
+ if (game.condit == IHDOCKED && verbose) {
prout(_("Already docked."));
return;
}
return;
}
game.condit = IHDOCKED;
- if (l) prout(_("Docked."));
+ if (verbose) prout(_("Docked."));
game.ididit=1;
if (game.energy < game.inenrg) game.energy = game.inenrg;
game.shield = game.inshld;
game.torps = game.intorps;
game.lsupres = game.inlsr;
+ game.state.crew = FULLCREW;
if (!damaged(DRADIO) &&
(is_scheduled(FCDBAS) || game.isatb == 1) && game.iseenit == 0) {
/* get attack report from base */
}
else {
if ((key = scan()) == IHEOL) {
- proutn("File name: ");
+ proutn(_("File name: "));
key = scan();
}
if (key != IHALPHA) {
}
}
if ((fp = fopen(citem, "wb")) == NULL) {
- proutn("Can't freeze game as file ");
+ proutn(_("Can't freeze game as file "));
proutn(citem);
skip(1);
return;
prout("to %s.", systemname(q->planet));
} else {
prout("Entire crew of %d left to die in outer space.");
+ game.casual += game.state.crew;
+ game.abandoned += game.state.crew;
}
/* If at least one base left, give 'em the Faerie Queene */
}
/* Get new commission */
game.quad[game.sector.x][game.sector.y] = game.ship = IHF;
+ game.state.crew = FULLCREW;
prout("Starfleet puts you in command of another ship,");
prout("the Faerie Queene, which is antiquated but,");
prout("still useable.");
// Prepare the Enterprise
game.alldone = game.gamewon = 0;
game.ship = IHE;
+ game.state.crew = FULLCREW;
game.energy = game.inenrg = 5000.0;
game.shield = game.inshld = 2500.0;
game.shldchg = 0;
// Set up assorted game parameters
game.battle.x = game.battle.y = 0;
game.state.date = game.indate = 100.0*(int)(31.0*Rand()+20.0);
- game.nkinks = game.nhelp = game.casual = 0;
+ game.nkinks = game.nhelp = game.casual = game.abandoned = 0;
game.resting = false;
game.isatb = game.iscate = game.imine = game.icrystl = game.icraft = game.state.nplankl = 0;
game.state.starkl = game.state.basekl = 0;
type is "plain" or "almy".)
6. User input is now logged so we can do regression testing.
+
+ 7. More BSD-Trek features: You can now lose if your entire crew
+ dies in battle. When abandoning ship in a game with inhabited
+ worlds enabled, they must have one in the quadrant to beam down
+ to; otherwise they die in space and this counts heavily against
+ your score. Docking at a starbase replenishes your crew.
*/
/* the input queue */
typedef struct {
int snap, // snapshot taken
+ crew, // crew complement
+#define FULLCREW 428 /* BSD Trek was 387, that's wrong */
remkl, // remaining klingons
remcom, // remaining commanders
nscrem, // remaining super commanders
condit, // condition (red/yellow/green/docked)
torps, // number of torpedoes
ship, // ship type -- 'E' is Enterprise
+ abandoned, // count of crew abandoned in space
length, // length of game
skill, // skill level
klhere, // klingons here
FNEG3, FNOVA, FSNOVAED, FABANDN, FDILITHIUM,
FMATERIALIZE, FPHASER, FLOST, FMINING, FDPLANET,
FPNOVA, FSSC, FSTRACTOR, FDRAY, FTRIBBLE,
- FHOLE} FINTYPE ;
+ FHOLE, FCREW} FINTYPE ;
enum loctype {neither, quadrant, sector};
#define IHR 'R'
void photon(void);
void warp(bool);
void doshield(int);
-void dock(int);
+void dock(bool);
void dreprt(void);
void chart(int);
void rechart(void);