MCPcopy Create free account
hub / github.com/NetHack/NetHack / water_prayer

Function water_prayer

src/pray.c:1386–1412  ·  view source on GitHub ↗

either blesses or curses water on the altar, * returns true if it found any water here. */

Source from the content-addressed store, hash-verified

1384 * returns true if it found any water here.
1385 */
1386staticfn boolean
1387water_prayer(boolean bless_water)
1388{
1389 struct obj *otmp;
1390 long changed = 0;
1391 boolean other = FALSE, bc_known = !(Blind || Hallucination);
1392
1393 for (otmp = svl.level.objects[u.ux][u.uy]; otmp; otmp = otmp->nexthere) {
1394 /* turn water into (un)holy water */
1395 if (otmp->otyp == POT_WATER
1396 && (bless_water ? !otmp->blessed : !otmp->cursed)) {
1397 otmp->blessed = bless_water;
1398 otmp->cursed = !bless_water;
1399 otmp->bknown = bc_known; /* ok to bypass set_bknown() */
1400 changed += otmp->quan;
1401 } else if (otmp->oclass == POTION_CLASS)
1402 other = TRUE;
1403 }
1404 if (!Blind && changed) {
1405 pline("%s potion%s on the altar glow%s %s for a moment.",
1406 ((other && changed > 1L) ? "Some of the"
1407 : (other ? "One of the" : "The")),
1408 ((other || changed > 1L) ? "s" : ""), (changed > 1L ? "" : "s"),
1409 (bless_water ? hcolor(NH_LIGHT_BLUE) : hcolor(NH_BLACK)));
1410 }
1411 return (boolean) (changed > 0L);
1412}
1413
1414staticfn void
1415godvoice(aligntyp g_align, const char *words)

Callers 1

prayer_doneFunction · 0.85

Calls 2

hcolorFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected