]> granicus.if.org Git - nethack/commitdiff
covetous mons vs temple priests (trunk only)
authornethack.rankin <nethack.rankin>
Thu, 13 Sep 2007 01:00:05 +0000 (01:00 +0000)
committernethack.rankin <nethack.rankin>
Thu, 13 Sep 2007 01:00:05 +0000 (01:00 +0000)
     Prevent monsters who kill other monsters to obtain the Amulet from
targetting a priest inside his temple.  Blocks players from just staying
on the Sanctum stairs while a teleporting arch-lich or Asmodeus fetchs the
Amulet from Moloch's high priest for them.  A previous post-3.4.3 change
prevented monsters from targetting the Wizard; this extends that (and
assumes that we can ignore the possibility of other temple priests ever
handling the Amulet).  The earlier patch went into the branch code, but
inhistemple() isn't available there so this one is trunk only.

doc/fixes35.0
src/wizard.c

index b52a9c58acae1a1a71644b45cf5a390fcc1e8829..4507ab579828dbe64d2a69725f3fe2d1c3571f10 100644 (file)
@@ -266,6 +266,7 @@ some variations of attempting to use open or close commands on a drawbridge
 tin contents can now sometimes be accessed on the same turn that the tin
        starts being opened; when not, the opening feedback is more accurate
 Nth adjustment of feedback when observing a pet eating
+monsters who want the Amulet won't attack temple priests to try to get it
 
 
 Platform- and/or Interface-Specific Fixes
index adc199b083649d187d75a7b693391c0ce20614e5..73d184c9bea5e6f8ce2a1617dae456d9914ffe50 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)wizard.c   3.5     2007/04/15      */
+/*     SCCS Id: @(#)wizard.c   3.5     2007/08/26      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -226,8 +226,10 @@ target_on(mask, mtmp)
            else if((otmp = on_ground(otyp)))
                return(STRAT(STRAT_GROUND, otmp->ox, otmp->oy, mask));
            else if ((mtmp2 = other_mon_has_arti(mtmp, otyp)) != 0 &&
-                   /* avoid targetting the Wizard for the Amulet */
-                   (!mtmp2->iswiz || otyp != AMULET_OF_YENDOR))
+                   /* when seeking the Amulet, avoid targetting the Wizard
+                      or temple priests (to protect Moloch's high priest) */
+                   (otyp != AMULET_OF_YENDOR ||
+                       (!mtmp2->iswiz && !inhistemple(mtmp2))))
                return(STRAT(STRAT_MONSTR, mtmp2->mx, mtmp2->my, mask));
        }
        return (unsigned long)STRAT_NONE;