MCPcopy Index your code
hub / github.com/NetHack/NetHack / look_here

Function look_here

src/invent.c:4103–4315  ·  view source on GitHub ↗

look at what is here; if there are many objects (pile_limit or more), don't show them unless obj_cnt is 0 */

Source from the content-addressed store, hash-verified

4101/* look at what is here; if there are many objects (pile_limit or more),
4102 don't show them unless obj_cnt is 0 */
4103int
4104look_here(
4105 int obj_cnt, /* obj_cnt > 0 implies that autopickup is in progress */
4106 unsigned lookhere_flags)
4107{
4108 struct obj *otmp;
4109 struct trap *trap;
4110 const char *verb = Blind ? "feel" : "see";
4111 const char *dfeature = (char *) 0;
4112 char fbuf[BUFSZ], fbuf2[BUFSZ];
4113 winid tmpwin;
4114 boolean skip_objects, felt_cockatrice = FALSE,
4115 picked_some = (lookhere_flags & LOOKHERE_PICKED_SOME) != 0,
4116 /* skip 'dfeature' if caller used describe_decor() to show it */
4117 skip_dfeature = (lookhere_flags & LOOKHERE_SKIP_DFEATURE) != 0;
4118
4119 /* default pile_limit is 5; a value of 0 means "never skip"
4120 (and 1 effectively forces "always skip") */
4121 skip_objects = (flags.pile_limit > 0 && obj_cnt >= flags.pile_limit);
4122 if (u.uswallow) {
4123 struct monst *mtmp = u.ustuck;
4124
4125 /*
4126 * FIXME?
4127 * Engulfer's inventory can include worn items (specific case is
4128 * Juiblex being created with an amulet as random defensive item)
4129 * which will be flagged as "(being worn)". This code includes
4130 * such a worn item under the header "Contents of <mon>'s stomach",
4131 * a nifty trick for how/where to wear stuff. The situation is
4132 * rare enough to turn a blind eye.
4133 *
4134 * 3.6.3: Pickup has been changed to decline to pick up a worn
4135 * item from inside an engulfer, but if player tries, it just
4136 * says "you can't" without giving a reason why (which would be
4137 * something along the lines of "because it's worn on the outside
4138 * so is unreachable from in here...").
4139 */
4140 Sprintf(fbuf, "Contents of %s %s", s_suffix(mon_nam(mtmp)),
4141 mbodypart(mtmp, STOMACH));
4142 /* Skip "Contents of " by using fbuf index 12 */
4143 You("%s to %s what is lying in %s.", Blind ? "try" : "look around",
4144 verb, &fbuf[12]);
4145 otmp = mtmp->minvent;
4146 if (otmp) {
4147 for (; otmp; otmp = otmp->nobj) {
4148 /* If swallower is an animal, it should have become stone
4149 * but... */
4150 if (otmp->otyp == CORPSE)
4151 feel_cockatrice(otmp, FALSE);
4152 }
4153 if (Blind)
4154 Strcpy(fbuf, "You feel");
4155 Strcat(fbuf, ":");
4156 (void) display_minventory(mtmp, MINV_ALL | PICK_NONE, fbuf);
4157 } else {
4158 You("%s no objects here.", verb);
4159 }
4160 return (!!Blind ? ECMD_TIME : ECMD_OK);

Callers 3

dolookFunction · 0.85
check_hereFunction · 0.85
query_objlistFunction · 0.85

Calls 15

s_suffixFunction · 0.85
mon_namFunction · 0.85
mbodypartFunction · 0.85
YouFunction · 0.85
feel_cockatriceFunction · 0.85
display_minventoryFunction · 0.85
visible_region_atFunction · 0.85
reg_damgFunction · 0.85
t_atFunction · 0.85
ThereFunction · 0.85
anFunction · 0.85
trapnameFunction · 0.85

Tested by

no test coverage detected