Logfp
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
@@ -194,41 +210,43 @@ 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;
|
||||||
|
|
||||||
kill_daemon(visuals);
|
kill_daemon(visuals);
|
||||||
player.t_flags &= ~ISHALU;
|
player.t_flags &= ~ISHALU;
|
||||||
|
|
||||||
if (on(player, ISBLIND))
|
if (on(player, ISBLIND))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* undo the things
|
* undo the things
|
||||||
*/
|
*/
|
||||||
for (tp = lvl_obj; tp != NULL; tp = next(tp))
|
for (tp = lvl_obj; tp != NULL; tp = next(tp))
|
||||||
if (cansee(rs,tp->o_pos.y, tp->o_pos.x))
|
if (cansee(rs,tp->o_pos.y, tp->o_pos.x))
|
||||||
mvaddch(tp->o_pos.y, tp->o_pos.x, tp->o_type);
|
mvaddch(tp->o_pos.y, tp->o_pos.x, tp->o_type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* undo the monsters
|
* undo the monsters
|
||||||
*/
|
*/
|
||||||
seemonst = on(player, SEEMONST);
|
seemonst = on(player, SEEMONST);
|
||||||
for (tp = mlist; tp != NULL; tp = next(tp))
|
for (tp = mlist; tp != NULL; tp = next(tp))
|
||||||
{
|
{
|
||||||
move(tp->t_pos.y, tp->t_pos.x);
|
move(tp->t_pos.y, tp->t_pos.x);
|
||||||
if (cansee(rs,tp->t_pos.y, tp->t_pos.x))
|
if (cansee(rs,tp->t_pos.y, tp->t_pos.x))
|
||||||
if (!on(*tp, ISINVIS) || on(player, CANSEE))
|
if (!on(*tp, ISINVIS) || on(player, CANSEE))
|
||||||
addch(tp->t_disguise);
|
addch(tp->t_disguise);
|
||||||
else
|
else
|
||||||
addch(chat(tp->t_pos.y, tp->t_pos.x));
|
addch(chat(tp->t_pos.y, tp->t_pos.x));
|
||||||
else if (seemonst)
|
else if (seemonst)
|
||||||
{
|
{
|
||||||
standout();
|
standout();
|
||||||
addch(tp->t_type);
|
addch(tp->t_type);
|
||||||
standend();
|
standend();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
msg(rs,"Everything looks SO boring now.");
|
msg(rs,"Everything looks SO boring now.");
|
||||||
}
|
}
|
||||||
@@ -242,42 +260,44 @@ visuals(struct rogue_state *rs,int arg)
|
|||||||
{
|
{
|
||||||
register THING *tp;
|
register THING *tp;
|
||||||
register bool seemonst;
|
register bool seemonst;
|
||||||
|
|
||||||
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
|
||||||
*/
|
*/
|
||||||
for (tp = lvl_obj; tp != NULL; tp = next(tp))
|
for (tp = lvl_obj; tp != NULL; tp = next(tp))
|
||||||
if (cansee(rs,tp->o_pos.y, tp->o_pos.x))
|
if (cansee(rs,tp->o_pos.y, tp->o_pos.x))
|
||||||
mvaddch(tp->o_pos.y, tp->o_pos.x, rnd_thing());
|
mvaddch(tp->o_pos.y, tp->o_pos.x, rnd_thing());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* change the stairs
|
* change the stairs
|
||||||
*/
|
*/
|
||||||
if (!seenstairs && cansee(rs,stairs.y, stairs.x))
|
if (!seenstairs && cansee(rs,stairs.y, stairs.x))
|
||||||
mvaddch(stairs.y, stairs.x, rnd_thing());
|
mvaddch(stairs.y, stairs.x, rnd_thing());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* change the monsters
|
* change the monsters
|
||||||
*/
|
*/
|
||||||
seemonst = on(player, SEEMONST);
|
seemonst = on(player, SEEMONST);
|
||||||
for (tp = mlist; tp != NULL; tp = next(tp))
|
for (tp = mlist; tp != NULL; tp = next(tp))
|
||||||
{
|
{
|
||||||
move(tp->t_pos.y, tp->t_pos.x);
|
move(tp->t_pos.y, tp->t_pos.x);
|
||||||
if (see_monst(tp))
|
if (see_monst(tp))
|
||||||
{
|
{
|
||||||
if (tp->t_type == 'X' && tp->t_disguise != 'X')
|
if (tp->t_type == 'X' && tp->t_disguise != 'X')
|
||||||
addch(rnd_thing());
|
addch(rnd_thing());
|
||||||
else
|
else
|
||||||
addch(rnd(26) + 'A');
|
addch(rnd(26) + 'A');
|
||||||
}
|
}
|
||||||
else if (seemonst)
|
else if (seemonst)
|
||||||
{
|
{
|
||||||
standout();
|
standout();
|
||||||
addch(rnd(26) + 'A');
|
addch(rnd(26) + 'A');
|
||||||
standend();
|
standend();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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"));
|
||||||
|
|||||||
@@ -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];
|
||||||
|
|||||||
Reference in New Issue
Block a user