Log file
This commit is contained in:
@@ -25,7 +25,6 @@ command(struct rogue_state *rs)
|
|||||||
char *fp;
|
char *fp;
|
||||||
THING *mp;
|
THING *mp;
|
||||||
static char countch, direction, newcount = FALSE;
|
static char countch, direction, newcount = FALSE;
|
||||||
num_packitems(rs);
|
|
||||||
if (on(player, ISHASTE))
|
if (on(player, ISHASTE))
|
||||||
ntimes++;
|
ntimes++;
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -290,27 +290,31 @@ attack(struct rogue_state *rs,THING *mp)
|
|||||||
}
|
}
|
||||||
when 'N':
|
when 'N':
|
||||||
{
|
{
|
||||||
register THING *obj, *steal;
|
register THING *obj, *steal;
|
||||||
register int nobj;
|
register int nobj;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Nymph's steal a magic item, look through the pack
|
* Nymph's steal a magic item, look through the pack
|
||||||
* and pick out one we like.
|
* and pick out one we like.
|
||||||
*/
|
*/
|
||||||
steal = NULL;
|
steal = NULL;
|
||||||
for (nobj = 0, obj = pack; obj != NULL; obj = next(obj))
|
for (nobj = 0, obj = pack; obj != NULL; obj = next(obj))
|
||||||
if (obj != cur_armor && obj != cur_weapon
|
if (obj != cur_armor && obj != cur_weapon
|
||||||
&& obj != cur_ring[LEFT] && obj != cur_ring[RIGHT]
|
&& obj != cur_ring[LEFT] && obj != cur_ring[RIGHT]
|
||||||
&& is_magic(obj) && rnd(++nobj) == 0)
|
&& is_magic(obj) && rnd(++nobj) == 0)
|
||||||
steal = obj;
|
steal = obj;
|
||||||
if (steal != NULL)
|
if (steal != NULL)
|
||||||
{
|
{
|
||||||
remove_mon(rs,&mp->t_pos, moat(mp->t_pos.y, mp->t_pos.x), FALSE);
|
remove_mon(rs,&mp->t_pos, moat(mp->t_pos.y, mp->t_pos.x), FALSE);
|
||||||
mp=NULL;
|
mp=NULL;
|
||||||
leave_pack(rs,steal, FALSE, FALSE);
|
fprintf(stderr,"%d: (%c) hp.%d num.%d\n",counter,c,pstats.s_hpt,num_packitems(rs););
|
||||||
msg(rs,"she stole %s!", inv_name(steal, TRUE));
|
|
||||||
discard(steal);
|
leave_pack(rs,steal, FALSE, FALSE);
|
||||||
}
|
msg(rs,"she stole %s!", inv_name(steal, TRUE));
|
||||||
|
fprintf(stderr,"%d: (%c) hp.%d num.%d\n",counter,c,pstats.s_hpt,num_packitems(rs););
|
||||||
|
discard(steal);
|
||||||
|
fprintf(stderr,"%d: (%c) hp.%d num.%d\n",counter,c,pstats.s_hpt,num_packitems(rs););
|
||||||
|
}
|
||||||
}
|
}
|
||||||
otherwise:
|
otherwise:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -160,14 +160,14 @@ readchar(struct rogue_state *rs)
|
|||||||
if ( rs->ind < rs->numkeys )
|
if ( rs->ind < rs->numkeys )
|
||||||
{
|
{
|
||||||
c = rs->keystrokes[rs->ind++];
|
c = rs->keystrokes[rs->ind++];
|
||||||
if ( 0 )
|
if ( 1 )
|
||||||
{
|
{
|
||||||
static FILE *fp; static int32_t counter;
|
static FILE *fp; static int32_t counter;
|
||||||
if ( fp == 0 )
|
if ( fp == 0 )
|
||||||
fp = fopen("log","wb");
|
fp = fopen("log","wb");
|
||||||
if ( fp != 0 )
|
if ( fp != 0 )
|
||||||
{
|
{
|
||||||
fprintf(fp,"%d: (%c) hp.%d\n",counter,c,pstats.s_hpt);
|
fprintf(fp,"%d: (%c) hp.%d num.%d\n",counter,c,pstats.s_hpt,num_packitems(rs););
|
||||||
fflush(fp);
|
fflush(fp);
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,6 +167,7 @@ int32_t num_packitems(struct rogue_state *rs)
|
|||||||
{
|
{
|
||||||
fprintf(stderr,"num_packitems cant find %p\n",list);
|
fprintf(stderr,"num_packitems cant find %p\n",list);
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
return(-1);
|
||||||
}
|
}
|
||||||
if ( list->o_packch != 0 )
|
if ( list->o_packch != 0 )
|
||||||
{
|
{
|
||||||
@@ -229,24 +230,24 @@ leave_pack(struct rogue_state *rs,THING *obj, bool newobj, bool all)
|
|||||||
nobj = obj;
|
nobj = obj;
|
||||||
if (obj->o_count > 1 && !all)
|
if (obj->o_count > 1 && !all)
|
||||||
{
|
{
|
||||||
last_pick = obj;
|
last_pick = obj;
|
||||||
obj->o_count--;
|
obj->o_count--;
|
||||||
if (obj->o_group)
|
if (obj->o_group)
|
||||||
inpack++;
|
inpack++;
|
||||||
if (newobj)
|
if (newobj)
|
||||||
{
|
{
|
||||||
nobj = new_item();
|
nobj = new_item();
|
||||||
*nobj = *obj;
|
*nobj = *obj;
|
||||||
next(nobj) = NULL;
|
next(nobj) = NULL;
|
||||||
prev(nobj) = NULL;
|
prev(nobj) = NULL;
|
||||||
nobj->o_count = 1;
|
nobj->o_count = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
last_pick = NULL;
|
last_pick = NULL;
|
||||||
pack_used[obj->o_packch - 'a'] = FALSE;
|
pack_used[obj->o_packch - 'a'] = FALSE;
|
||||||
detach(pack, obj);
|
detach(pack, obj);
|
||||||
}
|
}
|
||||||
return nobj;
|
return nobj;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user