either blesses or curses water on the altar, * returns true if it found any water here. */
| 1384 | * returns true if it found any water here. |
| 1385 | */ |
| 1386 | staticfn boolean |
| 1387 | water_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 | |
| 1414 | staticfn void |
| 1415 | godvoice(aligntyp g_align, const char *words) |
no test coverage detected