| 953 | } |
| 954 | |
| 955 | staticfn void |
| 956 | display_trap_map(int cursed_src) |
| 957 | { |
| 958 | struct monst *mon; |
| 959 | struct trap *ttmp; |
| 960 | int door, glyph, ter_typ = TER_DETECT | (cursed_src ? TER_OBJ : TER_TRP); |
| 961 | coord cc; |
| 962 | |
| 963 | cls(); |
| 964 | |
| 965 | (void) unconstrain_map(); |
| 966 | /* show chest traps first, first buried chests then floor chests, so |
| 967 | that subsequent floor trap display will override if both types are |
| 968 | present at the same location */ |
| 969 | (void) detect_obj_traps(svl.level.buriedobjlist, TRUE, cursed_src, NULL); |
| 970 | (void) detect_obj_traps(fobj, TRUE, cursed_src, NULL); |
| 971 | for (mon = fmon; mon; mon = mon->nmon) { |
| 972 | if (DEADMONSTER(mon) || (mon->isgd && !mon->mx)) |
| 973 | continue; |
| 974 | (void) detect_obj_traps(mon->minvent, TRUE, cursed_src, NULL); |
| 975 | } |
| 976 | (void) detect_obj_traps(gi.invent, TRUE, cursed_src, NULL); |
| 977 | |
| 978 | for (ttmp = gf.ftrap; ttmp; ttmp = ttmp->ntrap) |
| 979 | sense_trap(ttmp, 0, 0, cursed_src); |
| 980 | |
| 981 | dummytrap.ttyp = TRAPPED_DOOR; |
| 982 | for (door = 0; door < gd.doorindex; door++) { |
| 983 | cc = svd.doors[door]; |
| 984 | if (levl[cc.x][cc.y].typ == SDOOR) /* can't be trapped; see above */ |
| 985 | continue; |
| 986 | if (levl[cc.x][cc.y].doormask & D_TRAPPED) { |
| 987 | dummytrap.tx = cc.x, dummytrap.ty = cc.y; |
| 988 | sense_trap(&dummytrap, cc.x, cc.y, cursed_src); |
| 989 | } |
| 990 | } |
| 991 | |
| 992 | /* redisplay hero unless sense_trap() revealed something at <ux,uy> */ |
| 993 | glyph = glyph_at(u.ux, u.uy); |
| 994 | if (!(glyph_is_trap(glyph) || glyph_is_object(glyph))) { |
| 995 | newsym(u.ux, u.uy); |
| 996 | ter_typ |= TER_MON; /* for autodescribe at <u.ux,u.uy> */ |
| 997 | } |
| 998 | You_feel("%s.", cursed_src ? "very greedy" : "entrapped"); |
| 999 | |
| 1000 | browse_map(ter_typ, cursed_src ? "gold" : "trap of interest"); |
| 1001 | |
| 1002 | map_redisplay(); |
| 1003 | } |
| 1004 | |
| 1005 | /* the detections are pulled out so they can |
| 1006 | * also be used in the crystal ball routine |
no test coverage detected