fix #H8164 - kicking altar: injury vs wrath

When kicking an altar, trigger divine wrath (minor: luck or alignment
loss) before deciding whether hero has hurt himself in the process.

Add some variation to the wrath penalty so that it can't be used to
precisely control Luck.
This commit is contained in:
PatR
2019-07-06 18:14:30 -07:00
parent e84a0625dc
commit bac3a75174
3 changed files with 16 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.85 $ $NHDT-Date: 1562456458 2019/07/06 23:40:58 $
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.86 $ $NHDT-Date: 1562462061 2019/07/07 01:14:21 $
This fixes36.3 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.2 in May 2019. Please note, however,
@@ -98,6 +98,7 @@ if an engulfer has any worn items, hero could pick them up from inside and
they wouldn't be unworn properly, eventually triggering warnings or
worse (Juiblex will wear an amulet if created with one; a shapechanger
might wear one and then turn into an engulfer)
kicking an altar ignored god's wrath if hero injured himself during the kick
Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 dokick.c $NHDT-Date: 1551920353 2019/03/07 00:59:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.131 $ */
/* NetHack 3.6 dokick.c $NHDT-Date: 1562462061 2019/07/07 01:14:21 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.133 $ */
/* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1058,9 +1058,9 @@ dokick()
if (Levitation)
goto dumb;
You("kick %s.", (Blind ? something : "the altar"));
altar_wrath(x, y);
if (!rn2(3))
goto ouch;
altar_wrath(x, y);
exercise(A_DEX, TRUE);
return 1;
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 pray.c $NHDT-Date: 1561061321 2019/06/20 20:08:41 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.115 $ */
/* NetHack 3.6 pray.c $NHDT-Date: 1562462064 2019/07/07 01:14:24 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.116 $ */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2226,13 +2226,21 @@ register int x, y;
{
aligntyp altaralign = a_align(x, y);
if (!strcmp(align_gname(altaralign), u_gname())) {
if (u.ualign.type == altaralign && u.ualign.record > -rn2(4)) {
godvoice(altaralign, "How darest thou desecrate my altar!");
(void) adjattrib(A_WIS, -1, FALSE);
u.ualign.record--;
} else {
pline("A voice (could it be %s?) whispers:", align_gname(altaralign));
pline("%s %s%s:",
!Deaf ? "A voice (could it be"
: "Despite your deafness, you seem to hear",
align_gname(altaralign),
!Deaf ? "?) whispers" : " say");
verbalize("Thou shalt pay, infidel!");
change_luck(-1);
/* higher luck is more likely to be reduced; as it approaches -5
the chance to lose another point drops down, eventually to 0 */
if (Luck > -5 && rn2(Luck + 6))
change_luck(rn2(20) ? -1 : -2);
}
}