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

Function doaltarobj

src/do.c:362–390  ·  view source on GitHub ↗

obj is an object dropped on an altar */

Source from the content-addressed store, hash-verified

360
361/* obj is an object dropped on an altar */
362void
363doaltarobj(struct obj *obj)
364{
365 if (Blind)
366 return;
367
368 if (obj->oclass != COIN_CLASS) {
369 /* KMH, conduct */
370 if (!svc.context.mon_moving && !u.uconduct.gnostic++)
371 livelog_printf(LL_CONDUCT,
372 "eschewed atheism, by dropping %s on an altar",
373 doname(obj));
374 } else {
375 /* coins don't have bless/curse status */
376 obj->blessed = obj->cursed = 0;
377 }
378
379 if (obj->blessed || obj->cursed) {
380 There("is %s flash as %s %s the altar.",
381 an(hcolor(obj->blessed ? NH_AMBER : NH_BLACK)), doname(obj),
382 otense(obj, "hit"));
383 if (!Hallucination)
384 obj->bknown = 1; /* ok to bypass set_bknown() */
385 } else {
386 pline("%s %s on the altar.", Doname2(obj), otense(obj, "land"));
387 if (obj->oclass != COIN_CLASS)
388 obj->bknown = 1; /* ok to bypass set_bknown() */
389 }
390}
391
392/* If obj is neither formally identified nor informally called something
393 * already, prompt the player to call its object type. */

Callers 5

flooreffectsFunction · 0.85
dropxFunction · 0.85
hitfloorFunction · 0.85
tipcontainerFunction · 0.85
hornoplentyFunction · 0.85

Calls 8

livelog_printfFunction · 0.85
donameFunction · 0.85
ThereFunction · 0.85
anFunction · 0.85
hcolorFunction · 0.85
otenseFunction · 0.85
Doname2Function · 0.85
plineFunction · 0.70

Tested by

no test coverage detected