Fuse prints
This commit is contained in:
@@ -83,7 +83,7 @@ void
|
|||||||
waste_time(struct rogue_state *rs)
|
waste_time(struct rogue_state *rs)
|
||||||
{
|
{
|
||||||
do_daemons(rs,BEFORE);
|
do_daemons(rs,BEFORE);
|
||||||
do_fuses(rs,BEFORE);
|
do_fuses(rs,BEFORE,0);
|
||||||
do_daemons(rs,AFTER);
|
do_daemons(rs,AFTER);
|
||||||
do_fuses(rs,AFTER);
|
do_fuses(rs,AFTER,0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ command(struct rogue_state *rs)
|
|||||||
* Let the daemons start up
|
* Let the daemons start up
|
||||||
*/
|
*/
|
||||||
do_daemons(rs,BEFORE);
|
do_daemons(rs,BEFORE);
|
||||||
do_fuses(rs,BEFORE);
|
do_fuses(rs,BEFORE,0);
|
||||||
while (ntimes--)
|
while (ntimes--)
|
||||||
{
|
{
|
||||||
if ( rs->replaydone != 0 )
|
if ( rs->replaydone != 0 )
|
||||||
@@ -479,7 +479,7 @@ over:
|
|||||||
fprintf(fp2,"after daemons (%c).%d seed.%llu isring.%d teleport.%d || search.%d teleport.%d\n",ch,ch,(long long)seed,ISRING(LEFT, R_SEARCH),ISRING(LEFT, R_TELEPORT),ISRING(RIGHT, R_SEARCH),ISRING(RIGHT, R_TELEPORT));
|
fprintf(fp2,"after daemons (%c).%d seed.%llu isring.%d teleport.%d || search.%d teleport.%d\n",ch,ch,(long long)seed,ISRING(LEFT, R_SEARCH),ISRING(LEFT, R_TELEPORT),ISRING(RIGHT, R_SEARCH),ISRING(RIGHT, R_TELEPORT));
|
||||||
fflush(fp2);
|
fflush(fp2);
|
||||||
}
|
}
|
||||||
do_fuses(rs,AFTER);
|
do_fuses(rs,AFTER,fp2);
|
||||||
if ( fp2 != 0 )
|
if ( fp2 != 0 )
|
||||||
{
|
{
|
||||||
fprintf(fp2,"after fuses (%c).%d seed.%llu isring.%d teleport.%d || search.%d teleport.%d\n",ch,ch,(long long)seed,ISRING(LEFT, R_SEARCH),ISRING(LEFT, R_TELEPORT),ISRING(RIGHT, R_SEARCH),ISRING(RIGHT, R_TELEPORT));
|
fprintf(fp2,"after fuses (%c).%d seed.%llu isring.%d teleport.%d || search.%d teleport.%d\n",ch,ch,(long long)seed,ISRING(LEFT, R_SEARCH),ISRING(LEFT, R_TELEPORT),ISRING(RIGHT, R_SEARCH),ISRING(RIGHT, R_TELEPORT));
|
||||||
|
|||||||
@@ -160,10 +160,22 @@ extinguish(void (*func)(struct rogue_state *rs,int))
|
|||||||
* do_fuses:
|
* do_fuses:
|
||||||
* Decrement counters and start needed fuses
|
* Decrement counters and start needed fuses
|
||||||
*/
|
*/
|
||||||
void
|
|
||||||
do_fuses(struct rogue_state *rs,int flag)
|
char *actionfunc_str(char *str,void *ptr)
|
||||||
{
|
{
|
||||||
register struct delayed_action *wire;
|
if ( ptr == (void *)runners )
|
||||||
|
strcpy(str,"runners");
|
||||||
|
else if ( ptr == (void *)doctor )
|
||||||
|
strcpy(str,"doctor");
|
||||||
|
else if ( ptr == (void *)stomach )
|
||||||
|
strcpy(str,"stomach");
|
||||||
|
else strcpy(str,"no match");
|
||||||
|
return(str);
|
||||||
|
}
|
||||||
|
void
|
||||||
|
do_fuses(struct rogue_state *rs,int flag,FILE *fp)
|
||||||
|
{
|
||||||
|
register struct delayed_action *wire; char str[64];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Step though the list
|
* Step though the list
|
||||||
@@ -175,6 +187,8 @@ do_fuses(struct rogue_state *rs,int flag)
|
|||||||
*/
|
*/
|
||||||
if (flag == wire->d_type && wire->d_time > 0 && --wire->d_time == 0)
|
if (flag == wire->d_type && wire->d_time > 0 && --wire->d_time == 0)
|
||||||
{
|
{
|
||||||
|
if ( fp != 0 )
|
||||||
|
fprintf(fp,"t.%d %d %s, ",wire->d_type,wire->d_time,actionfunc_str(str,wire->d_func));
|
||||||
wire->d_type = EMPTY;
|
wire->d_type = EMPTY;
|
||||||
(*wire->d_func)(rs,wire->d_arg);
|
(*wire->d_func)(rs,wire->d_arg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -619,7 +619,7 @@ int dist(int y1, int x1, int y2, int x2);
|
|||||||
int dist_cp(coord *c1, coord *c2);
|
int dist_cp(coord *c1, coord *c2);
|
||||||
int do_chase(struct rogue_state *rs,THING *th);
|
int do_chase(struct rogue_state *rs,THING *th);
|
||||||
void do_daemons(struct rogue_state *rs,int flag);
|
void do_daemons(struct rogue_state *rs,int flag);
|
||||||
void do_fuses(struct rogue_state *rs,int flag);
|
void do_fuses(struct rogue_state *rs,int flag,FILE *fp);
|
||||||
void do_maze(struct rogue_state *rs,struct room *rp);
|
void do_maze(struct rogue_state *rs,struct room *rp);
|
||||||
void do_motion(struct rogue_state *rs,THING *obj, int ydelta, int xdelta);
|
void do_motion(struct rogue_state *rs,THING *obj, int ydelta, int xdelta);
|
||||||
void do_move(struct rogue_state *rs,int dy, int dx);
|
void do_move(struct rogue_state *rs,int dy, int dx);
|
||||||
|
|||||||
Reference in New Issue
Block a user