-score
This commit is contained in:
@@ -46,12 +46,14 @@ static char *rip[] = {
|
|||||||
/* VARARGS2 */
|
/* VARARGS2 */
|
||||||
|
|
||||||
void
|
void
|
||||||
score(int amount, int flags, char monst)
|
score(struct rogue_state *rs,int amount, int flags, char monst)
|
||||||
{
|
{
|
||||||
SCORE *scp;
|
SCORE *scp;
|
||||||
int i;
|
int i;
|
||||||
SCORE *sc2;
|
SCORE *sc2;
|
||||||
SCORE *top_ten, *endp;
|
SCORE *top_ten, *endp;
|
||||||
|
if ( rs->guiflag == 0 )
|
||||||
|
return;
|
||||||
# ifdef MASTER
|
# ifdef MASTER
|
||||||
int prflags = 0;
|
int prflags = 0;
|
||||||
# endif
|
# endif
|
||||||
@@ -274,7 +276,7 @@ death(struct rogue_state *rs,char monst)
|
|||||||
}
|
}
|
||||||
move(LINES - 1, 0);
|
move(LINES - 1, 0);
|
||||||
refresh();
|
refresh();
|
||||||
score(purse, amulet ? 3 : 0, monst);
|
score(rs,purse, amulet ? 3 : 0, monst);
|
||||||
rogue_bailout();
|
rogue_bailout();
|
||||||
printf("[Press return to continue]");
|
printf("[Press return to continue]");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
@@ -390,7 +392,7 @@ total_winner(struct rogue_state *rs)
|
|||||||
}
|
}
|
||||||
printw(" %5d Gold Pieces ", oldpurse);
|
printw(" %5d Gold Pieces ", oldpurse);
|
||||||
refresh();
|
refresh();
|
||||||
score(purse, 2, ' ');
|
score(rs,purse, 2, ' ');
|
||||||
my_exit(0);
|
my_exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ int rogue(int argc, char **argv, char **envp)
|
|||||||
if (strcmp(argv[1], "-s") == 0)
|
if (strcmp(argv[1], "-s") == 0)
|
||||||
{
|
{
|
||||||
noscore = TRUE;
|
noscore = TRUE;
|
||||||
score(0, -1, 0);
|
score(rs,0, -1, 0);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
else if (strcmp(argv[1], "-d") == 0)
|
else if (strcmp(argv[1], "-d") == 0)
|
||||||
@@ -602,14 +602,14 @@ quit(int sig)
|
|||||||
move(LINES - 1, 0);
|
move(LINES - 1, 0);
|
||||||
if ( rs->sleeptime != 0 )
|
if ( rs->sleeptime != 0 )
|
||||||
refresh();
|
refresh();
|
||||||
score(purse, 1, 0);
|
score(rs,purse, 1, 0);
|
||||||
flushkeystrokes(rs);
|
flushkeystrokes(rs);
|
||||||
my_exit(0);
|
my_exit(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr,"done!\n");
|
fprintf(stderr,"done!\n");
|
||||||
score(purse, 1, 0);
|
score(rs,purse, 1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -698,7 +698,7 @@ int save(int which);
|
|||||||
void save_file(struct rogue_state *rs,FILE *savef,int32_t guiflag);
|
void save_file(struct rogue_state *rs,FILE *savef,int32_t guiflag);
|
||||||
void save_game(struct rogue_state *rs);
|
void save_game(struct rogue_state *rs);
|
||||||
int save_throw(int which, THING *tp);
|
int save_throw(int which, THING *tp);
|
||||||
void score(int amount, int flags, char monst);
|
void score(struct rogue_state *rs,int amount, int flags, char monst);
|
||||||
void search(struct rogue_state *rs);
|
void search(struct rogue_state *rs);
|
||||||
void set_know(THING *obj, struct obj_info *info);
|
void set_know(THING *obj, struct obj_info *info);
|
||||||
void set_oldch(THING *tp, coord *cp);
|
void set_oldch(THING *tp, coord *cp);
|
||||||
|
|||||||
@@ -464,13 +464,13 @@ int32_t rogue_findbaton(struct CCcontract_info *cp,uint256 &playertxid,char **ke
|
|||||||
if ( myIsutxo_spent(spenttxid,gametxid,maxplayers+i+1) < 0 )
|
if ( myIsutxo_spent(spenttxid,gametxid,maxplayers+i+1) < 0 )
|
||||||
{
|
{
|
||||||
numvouts = matchtx.vout.size();
|
numvouts = matchtx.vout.size();
|
||||||
fprintf(stderr,"matches.%d numvouts.%d\n",matches,numvouts);
|
//fprintf(stderr,"matches.%d numvouts.%d\n",matches,numvouts);
|
||||||
if ( rogue_registeropretdecode(txid,playertxid,matchtx.vout[numvouts-1].scriptPubKey) == 'R' && txid == gametxid )
|
if ( rogue_registeropretdecode(txid,playertxid,matchtx.vout[numvouts-1].scriptPubKey) == 'R' && txid == gametxid )
|
||||||
{
|
{
|
||||||
if ( playertxid == zeroid || rogue_playerdata(cp,origplayergame,pk,playerdata,playertxid) == 0 )
|
if ( playertxid == zeroid || rogue_playerdata(cp,origplayergame,pk,playerdata,playertxid) == 0 )
|
||||||
{
|
{
|
||||||
txid = matchtx.GetHash();
|
txid = matchtx.GetHash();
|
||||||
fprintf(stderr,"scan forward playertxid.%s spenttxid.%s\n",playertxid.GetHex().c_str(),txid.GetHex().c_str());
|
//fprintf(stderr,"scan forward playertxid.%s spenttxid.%s\n",playertxid.GetHex().c_str(),txid.GetHex().c_str());
|
||||||
while ( CCgettxout(txid,0,1) < 0 )
|
while ( CCgettxout(txid,0,1) < 0 )
|
||||||
{
|
{
|
||||||
spenttxid = zeroid;
|
spenttxid = zeroid;
|
||||||
@@ -497,7 +497,7 @@ int32_t rogue_findbaton(struct CCcontract_info *cp,uint256 &playertxid,char **ke
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(stderr,"set baton %s\n",txid.GetHex().c_str());
|
//fprintf(stderr,"set baton %s\n",txid.GetHex().c_str());
|
||||||
batontxid = txid;
|
batontxid = txid;
|
||||||
batonvout = 0; // not vini
|
batonvout = 0; // not vini
|
||||||
// how to detect timeout, bailedout, highlander
|
// how to detect timeout, bailedout, highlander
|
||||||
@@ -797,7 +797,6 @@ UniValue rogue_finishgame(uint64_t txfee,struct CCcontract_info *cp,cJSON *param
|
|||||||
result.push_back(Pair("gametxid",gametxid.GetHex()));
|
result.push_back(Pair("gametxid",gametxid.GetHex()));
|
||||||
if ( (err= rogue_isvalidgame(cp,gameheight,gametx,buyin,maxplayers,gametxid)) == 0 )
|
if ( (err= rogue_isvalidgame(cp,gameheight,gametx,buyin,maxplayers,gametxid)) == 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"validgame\n");
|
|
||||||
if ( maxplayers == 1 )
|
if ( maxplayers == 1 )
|
||||||
mult /= 2;
|
mult /= 2;
|
||||||
if ( rogue_findbaton(cp,playertxid,&keystrokes,numkeys,regslot,playerdata,batontxid,batonvout,batonvalue,batonht,gametxid,gametx,maxplayers,myrogueaddr,numplayers) == 0 )
|
if ( rogue_findbaton(cp,playertxid,&keystrokes,numkeys,regslot,playerdata,batontxid,batonvout,batonvalue,batonht,gametxid,gametx,maxplayers,myrogueaddr,numplayers) == 0 )
|
||||||
|
|||||||
Reference in New Issue
Block a user