X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=src%2Ffinish.c;h=570be4e9a94b2023f2e41881b651e170f4e65a29;hp=78680d871953b89d5ef573e3ad17db178d30998a;hb=0e9bdbb882f74cad6af644e3e1b530f9ffbf5e8d;hpb=2cae1cd3feb922843b40af851f43f9e08bb18f0d diff --git a/src/finish.c b/src/finish.c index 78680d8..570be4e 100644 --- a/src/finish.c +++ b/src/finish.c @@ -2,7 +2,8 @@ #include #include -void dstrct() +void selfdestruct(void) +/* self-destruct maneuver */ { /* Finish with a BANG! */ chew(); @@ -69,7 +70,8 @@ void kaboom(void) } -void finish(FINTYPE ifin) +void finish(FINTYPE ifin) +/* end the game, with appropriate notfications */ { bool igotit = false; game.alldone = true; @@ -88,7 +90,7 @@ void finish(FINTYPE ifin) 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! @@ -139,7 +141,7 @@ void finish(FINTYPE ifin) else { proutn(_("Do you want your Commodore Emeritus Citation printed? ")); chew(); - if (ja()) { + if (ja() == true) { igotit = 1; } } @@ -278,6 +280,9 @@ void finish(FINTYPE ifin) 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; @@ -310,6 +315,7 @@ void finish(FINTYPE ifin) } void score(void) +/* compute player's score */ { double timused = game.state.date - game.indate; int ithperd, iwon, klship; @@ -366,6 +372,9 @@ void score(void) 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); @@ -386,7 +395,9 @@ void score(void) prout(_("TOTAL SCORE %5d"), iscore); } -void plaque(void) { +void plaque(void) +/* emit winner's commemmorative plaque */ +{ FILE *fp=NULL; time_t t; char *timestring;