fix github issue #477 - incorrect MC calculation

when wearing an amulet.  Wearing any amulet while having the
Protected attribute was conferring an amulet of guarding's +2 MC
bonus.  Mattered when Protected via worn ring(s) of protection or
wearing Mitre of Holiness or wielding Tsurugi of Muramasa for
hero, or the latter two or being a high priest[ess] for monsters.
(Being Proteced via cloak of protection already yields maximum MC,
or via amulet of guarding yields intended result.)

The fixes37.0 entry oversimplifies.

Fixes #477
This commit is contained in:
PatR
2021-03-29 10:46:29 -07:00
parent 1e9fc3ddb3
commit d007decbe8
2 changed files with 5 additions and 2 deletions

View File

@@ -902,7 +902,7 @@ magic_negation(struct monst *mon)
if (armpro > mc)
mc = armpro;
} else if ((o->owornmask & W_AMUL) != 0L) {
via_amul = TRUE;
via_amul = (o->otyp == AMULET_OF_GUARDING);
}
/* if we've already confirmed Protection, skip additional checks */
if (is_you || gotprot)
@@ -917,7 +917,8 @@ magic_negation(struct monst *mon)
}
if (gotprot) {
/* extrinsic Protection increases mc by 1; 2 for amulet */
/* extrinsic Protection increases mc by 1 (2 for amulet of guarding);
multiple sources don't provide multiple increments */
mc += via_amul ? 2 : 1;
if (mc > 3)
mc = 3;