| 2273 | } |
| 2274 | |
| 2275 | staticfn int |
| 2276 | prayer_done(void) /* M. Stephenson (1.0.3b) */ |
| 2277 | { |
| 2278 | aligntyp alignment = gp.p_aligntyp; |
| 2279 | |
| 2280 | u.uinvulnerable = FALSE; |
| 2281 | if (gp.p_type == -2) { |
| 2282 | /* praying at an unaligned altar, not necessarily in Gehennom */ |
| 2283 | You("%s diabolical laughter all around you...", |
| 2284 | !Deaf ? "hear" : "intuit"); |
| 2285 | wake_nearby(FALSE); |
| 2286 | adjalign(-2); |
| 2287 | exercise(A_WIS, FALSE); |
| 2288 | if (!Inhell) { |
| 2289 | /* hero's god[dess] seems to be keeping his/her head down */ |
| 2290 | pline("Nothing else happens."); /* not actually true... */ |
| 2291 | return 1; |
| 2292 | } /* else use regular Inhell result below */ |
| 2293 | } else if (gp.p_type == -1) { |
| 2294 | /* praying while poly'd into an undead creature while non-chaotic */ |
| 2295 | godvoice(alignment, |
| 2296 | (alignment == A_LAWFUL) |
| 2297 | ? "Vile creature, thou durst call upon me?" |
| 2298 | : "Walk no more, perversion of nature!"); |
| 2299 | You_feel("like you are falling apart."); |
| 2300 | /* KMH -- Gods have mastery over unchanging */ |
| 2301 | rehumanize(); |
| 2302 | /* no Half_physical_damage adjustment here */ |
| 2303 | losehp(rnd(20), "residual undead turning effect", KILLED_BY_AN); |
| 2304 | exercise(A_CON, FALSE); |
| 2305 | return 1; |
| 2306 | } |
| 2307 | if (Inhell) { |
| 2308 | pline("Since you are in Gehennom, %s can't help you.", |
| 2309 | align_gname(alignment)); |
| 2310 | /* haltingly aligned is least likely to anger */ |
| 2311 | if (u.ualign.record <= 0 || rnl(u.ualign.record)) |
| 2312 | angrygods(u.ualign.type); |
| 2313 | return 0; |
| 2314 | } |
| 2315 | |
| 2316 | if (gp.p_type == 0) { |
| 2317 | if (on_altar() && u.ualign.type != alignment) |
| 2318 | (void) water_prayer(FALSE); |
| 2319 | u.ublesscnt += rnz(250); |
| 2320 | change_luck(-3); |
| 2321 | gods_upset(u.ualign.type); |
| 2322 | } else if (gp.p_type == 1) { |
| 2323 | if (on_altar() && u.ualign.type != alignment) |
| 2324 | (void) water_prayer(FALSE); |
| 2325 | angrygods(u.ualign.type); /* naughty */ |
| 2326 | } else if (gp.p_type == 2) { |
| 2327 | if (water_prayer(FALSE)) { |
| 2328 | /* attempted water prayer on a non-coaligned altar */ |
| 2329 | u.ublesscnt += rnz(250); |
| 2330 | change_luck(-3); |
| 2331 | gods_upset(u.ualign.type); |
| 2332 | } else |
nothing calls this directly
no test coverage detected