Unify blind feel_location or newsym info single func
This commit is contained in:
@@ -306,6 +306,7 @@ E void FDECL(map_object, (struct obj *, int));
|
|||||||
E void FDECL(map_invisible, (XCHAR_P, XCHAR_P));
|
E void FDECL(map_invisible, (XCHAR_P, XCHAR_P));
|
||||||
E void FDECL(unmap_object, (int, int));
|
E void FDECL(unmap_object, (int, int));
|
||||||
E void FDECL(map_location, (int, int, int));
|
E void FDECL(map_location, (int, int, int));
|
||||||
|
E void FDECL(feel_newsym, (XCHAR_P, XCHAR_P));
|
||||||
E void FDECL(feel_location, (XCHAR_P, XCHAR_P));
|
E void FDECL(feel_location, (XCHAR_P, XCHAR_P));
|
||||||
E void FDECL(newsym, (int, int));
|
E void FDECL(newsym, (int, int));
|
||||||
E void FDECL(shieldeff, (XCHAR_P, XCHAR_P));
|
E void FDECL(shieldeff, (XCHAR_P, XCHAR_P));
|
||||||
|
|||||||
+2
-8
@@ -401,19 +401,13 @@ register struct obj *obj;
|
|||||||
case SDOOR:
|
case SDOOR:
|
||||||
You_hear(hollow_str, "door");
|
You_hear(hollow_str, "door");
|
||||||
cvt_sdoor_to_door(lev); /* ->typ = DOOR */
|
cvt_sdoor_to_door(lev); /* ->typ = DOOR */
|
||||||
if (Blind)
|
feel_newsym(rx, ry);
|
||||||
feel_location(rx, ry);
|
|
||||||
else
|
|
||||||
newsym(rx, ry);
|
|
||||||
return res;
|
return res;
|
||||||
case SCORR:
|
case SCORR:
|
||||||
You_hear(hollow_str, "passage");
|
You_hear(hollow_str, "passage");
|
||||||
lev->typ = CORR;
|
lev->typ = CORR;
|
||||||
unblock_point(rx, ry);
|
unblock_point(rx, ry);
|
||||||
if (Blind)
|
feel_newsym(rx, ry);
|
||||||
feel_location(rx, ry);
|
|
||||||
else
|
|
||||||
newsym(rx, ry);
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-4
@@ -1291,10 +1291,7 @@ struct trap *trap;
|
|||||||
|
|
||||||
trap->tseen = 1;
|
trap->tseen = 1;
|
||||||
exercise(A_WIS, TRUE);
|
exercise(A_WIS, TRUE);
|
||||||
if (Blind)
|
feel_newsym(trap->tx, trap->ty);
|
||||||
feel_location(trap->tx, trap->ty);
|
|
||||||
else
|
|
||||||
newsym(trap->tx, trap->ty);
|
|
||||||
|
|
||||||
if (levl[trap->tx][trap->ty].glyph != trap_to_glyph(trap)) {
|
if (levl[trap->tx][trap->ty].glyph != trap_to_glyph(trap)) {
|
||||||
/* There's too much clutter to see your find otherwise */
|
/* There's too much clutter to see your find otherwise */
|
||||||
|
|||||||
@@ -81,10 +81,7 @@ boolean waslit, rockit;
|
|||||||
lev->typ = (rockit ? STONE : ROOM);
|
lev->typ = (rockit ? STONE : ROOM);
|
||||||
if (dist >= 3)
|
if (dist >= 3)
|
||||||
impossible("mkcavepos called with dist %d", dist);
|
impossible("mkcavepos called with dist %d", dist);
|
||||||
if (Blind)
|
feel_newsym(x, y);
|
||||||
feel_location(x, y);
|
|
||||||
else
|
|
||||||
newsym(x, y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
@@ -437,10 +434,7 @@ dig(VOID_ARGS)
|
|||||||
|
|
||||||
if (!does_block(dpx, dpy, &levl[dpx][dpy]))
|
if (!does_block(dpx, dpy, &levl[dpx][dpy]))
|
||||||
unblock_point(dpx, dpy); /* vision: can see through */
|
unblock_point(dpx, dpy); /* vision: can see through */
|
||||||
if (Blind)
|
feel_newsym(dpx, dpy);
|
||||||
feel_location(dpx, dpy);
|
|
||||||
else
|
|
||||||
newsym(dpx, dpy);
|
|
||||||
if (digtxt && !context.digging.quiet)
|
if (digtxt && !context.digging.quiet)
|
||||||
pline1(digtxt); /* after newsym */
|
pline1(digtxt); /* after newsym */
|
||||||
if (dmgtxt)
|
if (dmgtxt)
|
||||||
|
|||||||
@@ -486,6 +486,23 @@ register struct monst *mon;
|
|||||||
show_glyph(x, y, glyph);
|
show_glyph(x, y, glyph);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* feel_newsym()
|
||||||
|
*
|
||||||
|
* When hero knows what happened to location, even when blind.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
feel_newsym(x, y)
|
||||||
|
xchar x, y;
|
||||||
|
{
|
||||||
|
if (Blind)
|
||||||
|
feel_location(x, y);
|
||||||
|
else
|
||||||
|
newsym(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* feel_location()
|
* feel_location()
|
||||||
*
|
*
|
||||||
|
|||||||
+3
-12
@@ -973,10 +973,7 @@ dokick()
|
|||||||
} else if (maploc->doormask != D_NODOOR
|
} else if (maploc->doormask != D_NODOOR
|
||||||
&& !(maploc->doormask & D_LOCKED))
|
&& !(maploc->doormask & D_LOCKED))
|
||||||
maploc->doormask = D_ISOPEN;
|
maploc->doormask = D_ISOPEN;
|
||||||
if (Blind)
|
feel_newsym(x, y); /* we know it's gone */
|
||||||
feel_location(x, y); /* we know it's gone */
|
|
||||||
else
|
|
||||||
newsym(x, y);
|
|
||||||
if (maploc->doormask == D_ISOPEN
|
if (maploc->doormask == D_ISOPEN
|
||||||
|| maploc->doormask == D_NODOOR)
|
|| maploc->doormask == D_NODOOR)
|
||||||
unblock_point(x, y); /* vision */
|
unblock_point(x, y); /* vision */
|
||||||
@@ -989,10 +986,7 @@ dokick()
|
|||||||
pline("Crash! You kick open a secret passage!");
|
pline("Crash! You kick open a secret passage!");
|
||||||
exercise(A_DEX, TRUE);
|
exercise(A_DEX, TRUE);
|
||||||
maploc->typ = CORR;
|
maploc->typ = CORR;
|
||||||
if (Blind)
|
feel_newsym(x, y); /* we know it's gone */
|
||||||
feel_location(x, y); /* we know it's gone */
|
|
||||||
else
|
|
||||||
newsym(x, y);
|
|
||||||
unblock_point(x, y); /* vision */
|
unblock_point(x, y); /* vision */
|
||||||
return 1;
|
return 1;
|
||||||
} else
|
} else
|
||||||
@@ -1267,10 +1261,7 @@ dokick()
|
|||||||
exercise(A_STR, TRUE);
|
exercise(A_STR, TRUE);
|
||||||
maploc->doormask = D_BROKEN;
|
maploc->doormask = D_BROKEN;
|
||||||
}
|
}
|
||||||
if (Blind)
|
feel_newsym(x, y); /* we know we broke it */
|
||||||
feel_location(x, y); /* we know we broke it */
|
|
||||||
else
|
|
||||||
newsym(x, y);
|
|
||||||
unblock_point(x, y); /* vision */
|
unblock_point(x, y); /* vision */
|
||||||
if (shopdoor) {
|
if (shopdoor) {
|
||||||
add_damage(x, y, 400L);
|
add_damage(x, y, 400L);
|
||||||
|
|||||||
+2
-8
@@ -648,10 +648,7 @@ int x, y;
|
|||||||
add_damage(cc.x, cc.y, 0L);
|
add_damage(cc.x, cc.y, 0L);
|
||||||
} else
|
} else
|
||||||
door->doormask = D_ISOPEN;
|
door->doormask = D_ISOPEN;
|
||||||
if (Blind)
|
feel_newsym(cc.x, cc.y); /* the hero knows she opened it */
|
||||||
feel_location(cc.x, cc.y); /* the hero knows she opened it */
|
|
||||||
else
|
|
||||||
newsym(cc.x, cc.y);
|
|
||||||
unblock_point(cc.x, cc.y); /* vision: new see through there */
|
unblock_point(cc.x, cc.y); /* vision: new see through there */
|
||||||
} else {
|
} else {
|
||||||
exercise(A_STR, TRUE);
|
exercise(A_STR, TRUE);
|
||||||
@@ -781,10 +778,7 @@ doclose()
|
|||||||
|| rn2(25) < (ACURRSTR + ACURR(A_DEX) + ACURR(A_CON)) / 3) {
|
|| rn2(25) < (ACURRSTR + ACURR(A_DEX) + ACURR(A_CON)) / 3) {
|
||||||
pline_The("door closes.");
|
pline_The("door closes.");
|
||||||
door->doormask = D_CLOSED;
|
door->doormask = D_CLOSED;
|
||||||
if (Blind)
|
feel_newsym(x, y); /* the hero knows she closed it */
|
||||||
feel_location(x, y); /* the hero knows she closed it */
|
|
||||||
else
|
|
||||||
newsym(x, y);
|
|
||||||
block_point(x, y); /* vision: no longer see there */
|
block_point(x, y); /* vision: no longer see there */
|
||||||
} else {
|
} else {
|
||||||
exercise(A_STR, TRUE);
|
exercise(A_STR, TRUE);
|
||||||
|
|||||||
+1
-4
@@ -760,10 +760,7 @@ boolean shatter;
|
|||||||
otmp = nxtobj(otmp, STATUE, TRUE);
|
otmp = nxtobj(otmp, STATUE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Blind)
|
feel_newsym(x, y);
|
||||||
feel_location(x, y);
|
|
||||||
else
|
|
||||||
newsym(x, y);
|
|
||||||
return mtmp;
|
return mtmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user