commit 8a13a4d2044264cf7427ba6a035021949788b5f1

Author: PatR <rankin@nethack.org>
Date:   Sun Dec 13 06:06:58 2015 -0800

    fix #H4066 - bug eating ring of protection

    Intrinsic protection of 0 (usually from having a gremlin steal divine
    protection, but also possible by eating a +0 ring of protection) does
    not contribute to "magic cancellation", the defense attribute that
    makes some special attacks fail.  That's intended.  Negative intrinsic
    protection (not possible from having divine protection, but turns out
    to be possible from eating negatively enchanted/charged rings of
    protection), did contribute.  That wasn't intended, so stop it.
    (Positive intrinsic protection gives a magic cancellation of 1 if worn
    armor doesn't provide any MC.)
This commit is contained in:
PatR
2015-12-13 06:15:54 -08:00
parent 4ad39ba282
commit 50065303e1
2 changed files with 4 additions and 2 deletions

View File

@@ -24,6 +24,8 @@ change dipping prompt to not ignore 'called' and 'named' attributes of item
avoid 'the unlabeled {scroll,spellbook} fades' when blank item is hit by water
wrong message given when high priest on astral plane rejects being assigned a
name (got the one for unique monsters instead of the one for priests)
negative intrinsic protection shouldn't confer MC=1, "you are warded" (not
possible from divine protection but is possible from eating rings)
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mhitu.c $NHDT-Date: 1446854230 2015/11/06 23:57:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.130 $ */
/* NetHack 3.6 mhitu.c $NHDT-Date: 1450016149 2015/12/13 14:15:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.131 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -827,7 +827,7 @@ struct monst *mon;
} else if (mc < 1) {
/* intrinsic Protection is weaker (play balance; obtaining divine
protection is too easy); it confers minimum mc 1 instead of 0 */
if ((is_you && ((HProtection && u.ublessed) || u.uspellprot))
if ((is_you && ((HProtection && u.ublessed > 0) || u.uspellprot))
/* aligned priests and angels have innate intrinsic Protection */
|| (mon->data == &mons[PM_ALIGNED_PRIEST] || is_minion(mon->data)))
mc = 1;