projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Still more application of coord type.
[super-star-trek.git]
/
src
/
finish.c
diff --git
a/src/finish.c
b/src/finish.c
index d23723b9813f4d491728a7f95815afbb7624592e..ac21d07a5480aeef5c9036abab96490b5a510de4 100644
(file)
--- a/
src/finish.c
+++ b/
src/finish.c
@@
-2,11
+2,12
@@
#include <string.h>
#include <time.h>
#include <string.h>
#include <time.h>
-void dstrct()
+void selfdestruct(void)
+/* self-destruct maneuver */
{
/* Finish with a BANG! */
chew();
{
/* Finish with a BANG! */
chew();
- if (
game.damage[DCOMPTR] != 0.0
) {
+ if (
damaged(DCOMPTR)
) {
prout(_("Computer damaged; cannot execute destruct sequence."));
return;
}
prout(_("Computer damaged; cannot execute destruct sequence."));
return;
}
@@
-61,7
+62,7
@@
void kaboom(void)
int l=1;
while (l <= game.nenhere) {
if (game.kpower[l]*game.kdist[l] <= whammo)
int l=1;
while (l <= game.nenhere) {
if (game.kpower[l]*game.kdist[l] <= whammo)
- deadkl(game.ks[l], game.quad[game.ks[l].x][game.ks[l].y], game.ks[l]
.x, game.ks[l].y
);
+ deadkl(game.ks[l], game.quad[game.ks[l].x][game.ks[l].y], game.ks[l]);
l++;
}
}
l++;
}
}
@@
-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;
{
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 +
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!
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();
else {
proutn(_("Do you want your Commodore Emeritus Citation printed? "));
chew();
- if (ja()) {
+ if (ja()
== true
) {
igotit = 1;
}
}
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;
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.ship==IHF) game.ship= 0;
else if (game.ship == IHE) game.ship = IHF;
@@
-310,6
+315,7
@@
void finish(FINTYPE ifin)
}
void score(void)
}
void score(void)
+/* compute player's score */
{
double timused = game.state.date - game.indate;
int ithperd, iwon, klship;
{
double timused = game.state.date - game.indate;
int ithperd, iwon, klship;
@@
-326,7
+332,7
@@
void score(void)
if (game.gamewon == 0) game.state.nromrem = 0; // None captured if no win
iscore = 10*NKILLK + 50*NKILLC + ithperd + iwon
- 100*game.state.basekl - 100*klship - 45*game.nhelp -5*game.state.starkl - game.casual
if (game.gamewon == 0) game.state.nromrem = 0; // None captured if no win
iscore = 10*NKILLK + 50*NKILLC + ithperd + iwon
- 100*game.state.basekl - 100*klship - 45*game.nhelp -5*game.state.starkl - game.casual
- + 20*NKILLROM + 200*NKILLSC - 10*game.state.nplankl + game.state.nromrem;
+ + 20*NKILLROM + 200*NKILLSC - 10*game.state.nplankl
- 300*game.state.nworldkl
+ game.state.nromrem;
if (game.alive == 0) iscore -= 200;
skip(2);
prout(_("Your score --"));
if (game.alive == 0) iscore -= 200;
skip(2);
prout(_("Your score --"));
@@
-354,6
+360,9
@@
void score(void)
if (game.state.nplankl)
prout(_("%6d planets destroyed by your action %5d"),
game.state.nplankl, -10*game.state.nplankl);
if (game.state.nplankl)
prout(_("%6d planets destroyed by your action %5d"),
game.state.nplankl, -10*game.state.nplankl);
+ if ((game.options & OPTION_WORLDS) && game.state.nworldkl)
+ prout(_("%6d inhabited planets destroyed by your action %5d"),
+ game.state.nplankl, -300*game.state.nworldkl);
if (game.state.basekl)
prout(_("%6d bases destroyed by your action %5d"),
game.state.basekl, -100*game.state.basekl);
if (game.state.basekl)
prout(_("%6d bases destroyed by your action %5d"),
game.state.basekl, -100*game.state.basekl);
@@
-363,6
+372,9
@@
void score(void)
if (game.casual)
prout(_("%6d casualties incurred %5d"),
game.casual, -game.casual);
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);
if (klship)
prout(_("%6d ship(s) lost or destroyed %5d"),
klship, -100*klship);
@@
-383,7
+395,9
@@
void score(void)
prout(_("TOTAL SCORE %5d"), iscore);
}
prout(_("TOTAL SCORE %5d"), iscore);
}
-void plaque(void) {
+void plaque(void)
+/* emit winner's commemmorative plaque */
+{
FILE *fp=NULL;
time_t t;
char *timestring;
FILE *fp=NULL;
time_t t;
char *timestring;