oi_know
This commit is contained in:
@@ -1338,6 +1338,7 @@ rs_read_monsters(FILE *inf, struct monster *m, int count)
|
||||
|
||||
void rogue_restoreobject(THING *o,struct rogue_packitem *item)
|
||||
{
|
||||
int32_t i;
|
||||
o->_o._o_type = item->type;
|
||||
o->_o._o_launch = item->launch;
|
||||
memcpy(o->_o._o_damage,item->damage,sizeof(item->damage));
|
||||
@@ -1350,6 +1351,25 @@ void rogue_restoreobject(THING *o,struct rogue_packitem *item)
|
||||
o->_o._o_flags = item->flags;
|
||||
o->_o._o_group = item->group;
|
||||
o->o_flags |= ISKNOW;
|
||||
switch ( item->type )
|
||||
{
|
||||
case SCROLL:
|
||||
if ( item->which < MAXSCROLLS )
|
||||
scr_info[item->which].oi_know = TRUE;
|
||||
break;
|
||||
case POTION:
|
||||
if ( item->which < MAXPOTIONS )
|
||||
pot_info[item->which].oi_know = TRUE;
|
||||
break;
|
||||
case RING:
|
||||
if ( item->which < MAXRINGS )
|
||||
ring_info[item->which].oi_know = TRUE;
|
||||
break;
|
||||
case STICK:
|
||||
if ( item->which < MAXSTICKS )
|
||||
ws_info[item->which].oi_know = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void rogue_packitemstr(char *packitemstr,struct rogue_packitem *item)
|
||||
|
||||
@@ -432,15 +432,15 @@ print_disc(struct rogue_state *rs,char type)
|
||||
obj.o_flags = 0;
|
||||
num_found = 0;
|
||||
for (i = 0; i < maxnum; i++)
|
||||
if (info[order[i]].oi_know || info[order[i]].oi_guess)
|
||||
{
|
||||
obj.o_type = type;
|
||||
obj.o_which = order[i];
|
||||
add_line(rs,"%s", inv_name(&obj, FALSE));
|
||||
num_found++;
|
||||
}
|
||||
if (info[order[i]].oi_know || info[order[i]].oi_guess)
|
||||
{
|
||||
obj.o_type = type;
|
||||
obj.o_which = order[i];
|
||||
add_line(rs,"%s", inv_name(&obj, FALSE));
|
||||
num_found++;
|
||||
}
|
||||
if (num_found == 0)
|
||||
add_line(rs,nothing(type), NULL);
|
||||
add_line(rs,nothing(type), NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -452,16 +452,16 @@ void
|
||||
set_order(int *order, int numthings)
|
||||
{
|
||||
int i, r, t;
|
||||
|
||||
|
||||
for (i = 0; i< numthings; i++)
|
||||
order[i] = i;
|
||||
|
||||
order[i] = i;
|
||||
|
||||
for (i = numthings; i > 0; i--)
|
||||
{
|
||||
r = rnd(i);
|
||||
t = order[i - 1];
|
||||
order[i - 1] = order[r];
|
||||
order[r] = t;
|
||||
r = rnd(i);
|
||||
t = order[i - 1];
|
||||
order[i - 1] = order[r];
|
||||
order[r] = t;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -624,20 +624,20 @@ nameit(THING *obj, const char *type,const char *which, struct obj_info *op,
|
||||
|
||||
if (op->oi_know || op->oi_guess)
|
||||
{
|
||||
if (obj->o_count == 1)
|
||||
sprintf(prbuf, "A %s ", type);
|
||||
else
|
||||
sprintf(prbuf, "%d %ss ", obj->o_count, type);
|
||||
pb = &prbuf[strlen(prbuf)];
|
||||
if (op->oi_know)
|
||||
sprintf(pb, "of %s%s(%s)", op->oi_name, (*prfunc)(obj), which);
|
||||
else if (op->oi_guess)
|
||||
sprintf(pb, "called %s%s(%s)", op->oi_guess, (*prfunc)(obj), which);
|
||||
if (obj->o_count == 1)
|
||||
sprintf(prbuf, "A %s ", type);
|
||||
else
|
||||
sprintf(prbuf, "%d %ss ", obj->o_count, type);
|
||||
pb = &prbuf[strlen(prbuf)];
|
||||
if (op->oi_know)
|
||||
sprintf(pb, "of %s%s(%s)", op->oi_name, (*prfunc)(obj), which);
|
||||
else if (op->oi_guess)
|
||||
sprintf(pb, "called %s%s(%s)", op->oi_guess, (*prfunc)(obj), which);
|
||||
}
|
||||
else if (obj->o_count == 1)
|
||||
sprintf(prbuf, "A%s %s %s", vowelstr((char *)which), which, type);
|
||||
sprintf(prbuf, "A%s %s %s", vowelstr((char *)which), which, type);
|
||||
else
|
||||
sprintf(prbuf, "%d %s %ss", obj->o_count, which, type);
|
||||
sprintf(prbuf, "%d %s %ss", obj->o_count, which, type);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user