X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=score.c;h=3c94f83827e3c76974ca83e66f1936653498cf5e;hb=cc927058915e82c5e544748cf0414394278af693;hp=3bf3ae04edd467a7b79fe7b6fa104ff76fde073b;hpb=db4b972fc730d4b18a4fa59af8339d260ea8fd57;p=open-adventure.git diff --git a/score.c b/score.c index 3bf3ae0..3c94f83 100644 --- a/score.c +++ b/score.c @@ -9,7 +9,7 @@ void score(long mode) /* mode is <0 if scoring, >0 if quitting, =0 if died or won */ { - long i, score = 0, mxscor = 0; + long i, k, score = 0, mxscor = 0; /* The present scoring algorithm is as follows: * Objective: Points: Present total possible: @@ -32,17 +32,16 @@ void score(long mode) /* First tally up the treasures. Must be in building and not broken. * Give the poor guy 2 points just for finding each treasure. */ - for (i=MINTRS; i<=MAXTRS; i++) { if(PTEXT[i] != 0) { - K=12; - if(i == CHEST)K=14; - if(i > CHEST)K=16; + k=12; + if(i == CHEST)k=14; + if(i > CHEST)k=16; if(game.prop[i] >= 0) score=score+2; if(game.place[i] == 3 && game.prop[i] == 0) - score=score+K-2; - mxscor=mxscor+K; + score=score+k-2; + mxscor=mxscor+k; } } @@ -52,7 +51,6 @@ void score(long mode) * indicates whether he reached the endgame. And if he got as far as * "cave closed" (indicated by "game.closed"), then bonus is zero for * mundane exits or 133, 134, 135 if he blew it (so to speak). */ - score=score+(MAXDIE-game.numdie)*10; mxscor=mxscor+MAXDIE*10; if(mode == 0)score=score+4; @@ -110,18 +108,16 @@ void score(long mode) SETPRM(3,game.turns,game.turns); RSPEAK(262); for (i=1; i<=CLSSES; i++) { - if(CVAL[i] >= score) goto L20210; - } /* end loop */ - SPK=265; - goto L25000; - -L20210: SPEAK(CTEXT[i]); - SPK=264; - if(i >= CLSSES) goto L25000; - i=CVAL[i]+1-score; - SETPRM(1,i,i); - SPK=263; -L25000: RSPEAK(SPK); + if(CVAL[i] >= score) { + SPEAK(CTEXT[i]); + i=CVAL[i]+1-score; + SETPRM(1,i,i); + RSPEAK(263); + exit(0); + } + } + RSPEAK(265); + RSPEAK(264); exit(0); }