This commit is contained in:
jl777
2019-03-13 07:14:29 -11:00
parent 01a63eb151
commit 8f18bbbed5
4 changed files with 67 additions and 43 deletions

View File

@@ -467,7 +467,7 @@ over:
ntimes++; ntimes++;
} }
if ( fp2 == 0 ) if ( fp2 == 0 )
fp2 = fopen("commands","wb"); rs->logfp = fp2 = fopen("commands","wb");
if ( fp2 != 0 ) if ( fp2 != 0 )
{ {
fprintf(fp2,"after if (%c).%d seed.%llu\n",ch,ch,(long long)seed); fprintf(fp2,"after if (%c).%d seed.%llu\n",ch,ch,(long long)seed);

View File

@@ -190,6 +190,7 @@ char *actionfunc_str(char *str,void *ptr)
else strcpy(str,"no match"); else strcpy(str,"no match");
return(str); return(str);
} }
void void
do_fuses(struct rogue_state *rs,int flag,FILE *fp) do_fuses(struct rogue_state *rs,int flag,FILE *fp)
{ {

View File

@@ -21,6 +21,8 @@ void
doctor(struct rogue_state *rs,int arg) doctor(struct rogue_state *rs,int arg)
{ {
register int lv, ohp; register int lv, ohp;
if ( rs->logfp != 0 )
fprintf(rs->logfp,"doctor\n");
lv = pstats.s_lvl; lv = pstats.s_lvl;
ohp = pstats.s_hpt; ohp = pstats.s_hpt;
@@ -52,6 +54,8 @@ doctor(struct rogue_state *rs,int arg)
void void
swander(struct rogue_state *rs,int arg) swander(struct rogue_state *rs,int arg)
{ {
if ( rs->logfp != 0 )
fprintf(rs->logfp,"swander\n");
start_daemon(rollwand, 0, BEFORE); start_daemon(rollwand, 0, BEFORE);
} }
@@ -63,6 +67,8 @@ int between = 0;
void void
rollwand(struct rogue_state *rs,int arg) rollwand(struct rogue_state *rs,int arg)
{ {
if ( rs->logfp != 0 )
fprintf(rs->logfp,"rollwand\n");
if (++between >= 4) if (++between >= 4)
{ {
if (roll(1, 6) == 4) if (roll(1, 6) == 4)
@@ -82,6 +88,8 @@ rollwand(struct rogue_state *rs,int arg)
void void
unconfuse(struct rogue_state *rs,int arg) unconfuse(struct rogue_state *rs,int arg)
{ {
if ( rs->logfp != 0 )
fprintf(rs->logfp,"unconfuse\n");
player.t_flags &= ~ISHUH; player.t_flags &= ~ISHUH;
msg(rs,"you feel less %s now", choose_str("trippy", "confused")); msg(rs,"you feel less %s now", choose_str("trippy", "confused"));
} }
@@ -94,6 +102,8 @@ void
unsee(struct rogue_state *rs,int arg) unsee(struct rogue_state *rs,int arg)
{ {
register THING *th; register THING *th;
if ( rs->logfp != 0 )
fprintf(rs->logfp,"unsee\n");
for (th = mlist; th != NULL; th = next(th)) for (th = mlist; th != NULL; th = next(th))
if (on(*th, ISINVIS) && see_monst(th)) if (on(*th, ISINVIS) && see_monst(th))
@@ -108,6 +118,8 @@ unsee(struct rogue_state *rs,int arg)
void void
sight(struct rogue_state *rs,int arg) sight(struct rogue_state *rs,int arg)
{ {
if ( rs->logfp != 0 )
fprintf(rs->logfp,"sight\n");
if (on(player, ISBLIND)) if (on(player, ISBLIND))
{ {
extinguish(sight); extinguish(sight);
@@ -126,6 +138,8 @@ sight(struct rogue_state *rs,int arg)
void void
nohaste(struct rogue_state *rs,int arg) nohaste(struct rogue_state *rs,int arg)
{ {
if ( rs->logfp != 0 )
fprintf(rs->logfp,"nohaste\n");
player.t_flags &= ~ISHASTE; player.t_flags &= ~ISHASTE;
msg(rs,"you feel yourself slowing down"); msg(rs,"you feel yourself slowing down");
} }
@@ -139,6 +153,8 @@ stomach(struct rogue_state *rs,int arg)
{ {
register int oldfood; register int oldfood;
int orig_hungry = hungry_state; int orig_hungry = hungry_state;
if ( rs->logfp != 0 )
fprintf(rs->logfp,"stomach\n");
if (food_left <= 0) if (food_left <= 0)
{ {
@@ -195,6 +211,8 @@ come_down(struct rogue_state *rs,int arg)
register THING *tp; register THING *tp;
register bool seemonst; register bool seemonst;
if ( rs->logfp != 0 )
fprintf(rs->logfp,"come_down\n");
if (!on(player, ISHALU)) if (!on(player, ISHALU))
return; return;
@@ -245,6 +263,8 @@ visuals(struct rogue_state *rs,int arg)
if (!after || (running && jump)) if (!after || (running && jump))
return; return;
if ( rs->logfp != 0 )
fprintf(rs->logfp,"visuals\n");
/* /*
* change the things * change the things
*/ */
@@ -288,6 +308,8 @@ visuals(struct rogue_state *rs,int arg)
void void
land(struct rogue_state *rs,int arg) land(struct rogue_state *rs,int arg)
{ {
if ( rs->logfp != 0 )
fprintf(rs->logfp,"land\n");
player.t_flags &= ~ISLEVIT; player.t_flags &= ~ISLEVIT;
msg(rs,choose_str("bummer! You've hit the ground", msg(rs,choose_str("bummer! You've hit the ground",
"you float gently to the ground")); "you float gently to the ground"));

View File

@@ -365,6 +365,7 @@ struct rogue_state
char *keystrokes,*keystrokeshex; char *keystrokes,*keystrokeshex;
uint32_t needflush,replaydone; uint32_t needflush,replaydone;
int32_t numkeys,ind,num,guiflag,counter,sleeptime,playersize,restoring,lastnum; int32_t numkeys,ind,num,guiflag,counter,sleeptime,playersize,restoring,lastnum;
FILE *logfp;
struct rogue_player P; struct rogue_player P;
char buffered[10000]; char buffered[10000];
uint8_t playerdata[10000]; uint8_t playerdata[10000];