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

Function angrygods

src/pray.c:703–784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

701}
702
703staticfn void
704angrygods(aligntyp resp_god)
705{
706 int maxanger, new_ublesscnt;
707
708 if (Inhell)
709 resp_god = A_NONE;
710 u.ublessed = 0; /* lose divine protection */
711
712 /* changed from tmp = u.ugangr + abs (u.uluck) -- rph */
713 /* added test for alignment diff -dlc */
714 if (resp_god != u.ualign.type)
715 maxanger = u.ualign.record / 2 + (Luck > 0 ? -Luck / 3 : -Luck);
716 else
717 maxanger = 3 * u.ugangr + ((Luck > 0 || u.ualign.record >= STRIDENT)
718 ? -Luck / 3
719 : -Luck);
720 if (maxanger < 1)
721 maxanger = 1; /* possible if bad align & good luck */
722 else if (maxanger > 15)
723 maxanger = 15; /* be reasonable */
724
725 switch (rn2(maxanger)) {
726 case 0:
727 case 1:
728 You_feel("that %s is %s.", align_gname(resp_god),
729 Hallucination ? "bummed" : "displeased");
730 break;
731 case 2:
732 case 3:
733 godvoice(resp_god, (char *) 0);
734 pline("\"Thou %s, %s.\"",
735 (ugod_is_angry() && resp_god == u.ualign.type)
736 ? "hast strayed from the path"
737 : "art arrogant",
738 gy.youmonst.data->mlet == S_HUMAN ? "mortal" : "creature");
739 SetVoice((struct monst *) 0, 0, 80, voice_deity);
740 verbalize("Thou must relearn thy lessons!");
741 (void) adjattrib(A_WIS, -1, FALSE);
742 losexp((char *) 0);
743 break;
744 case 6:
745 if (!Punished) {
746 gods_angry(resp_god);
747 punish((struct obj *) 0);
748 break;
749 }
750 FALLTHROUGH;
751 /* FALLTHRU */
752 case 4:
753 case 5:
754 gods_angry(resp_god);
755 if (!Blind && !Antimagic)
756 pline("%s glow surrounds you.", An(hcolor(NH_BLACK)));
757 if (rn2(2) || !attrcurse())
758 rndcurse();
759 break;
760 case 7:

Callers 4

gods_upsetFunction · 0.85
sacrifice_your_raceFunction · 0.85
prayer_doneFunction · 0.85

Calls 15

rn2Function · 0.85
You_feelFunction · 0.85
align_gnameFunction · 0.85
godvoiceFunction · 0.85
verbalizeFunction · 0.85
adjattribFunction · 0.85
losexpFunction · 0.85
gods_angryFunction · 0.85
punishFunction · 0.85
AnFunction · 0.85
hcolorFunction · 0.85
attrcurseFunction · 0.85

Tested by

no test coverage detected