offshoot of #H1820 - priests/minions vs opposite alignment (trunk only)

In #H1820, <email deleted> reported that helms
of opposite alignment didn't work for monsters.  There's never been
any attempt to implement that, and it wasn't omitted by accident, so
I wouldn't classify it as a bug.  But it does seem buggy that temple
priests and minions of <deity> would be willing to put such helms on
and risk changing allegiance to another deity.  This lets other types
of monsters still wear helms of opposite alignment as ordinary head
protection, but the explicity aligned creatures won't do so anymore.
This commit is contained in:
nethack.rankin
2009-03-01 03:49:54 +00:00
parent b71b3e920a
commit b76f8aab8d
2 changed files with 7 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)worn.c 3.5 2008/09/03 */
/* SCCS Id: @(#)worn.c 3.5 2009/02/28 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -503,6 +503,11 @@ boolean racialexception;
break;
case W_ARMH:
if (!is_helmet(obj)) continue;
/* changing alignment is not implemented for monsters;
priests and minions could change alignment but wouldn't
want to, so they reject helms of opposite alignment */
if (obj->otyp == HELM_OF_OPPOSITE_ALIGNMENT &&
(mon->ispriest || mon->isminion)) continue;
/* (flimsy exception matches polyself handling) */
if (has_horns(mon->data) && !is_flimsy(obj)) continue;
break;