]> granicus.if.org Git - nethack/commitdiff
Change the rules for Elbereth erosion
authorAlex Smith <ais523@nethack4.org>
Mon, 17 Oct 2016 17:26:44 +0000 (18:26 +0100)
committerAlex Smith <ais523@nethack4.org>
Mon, 17 Oct 2016 17:26:44 +0000 (18:26 +0100)
If you attack a monster under Elbereth protection, and it wasn't
scuffed by the attack itself, then it'll be automatically removed
with an alignment penalty. It no longer fades from scaring monsters;
only from being abused to attack monsters while protected.

src/mon.c
src/monmove.c

index d0586b200bb567650d712d4f6495959b02b8a1ef..3a70ba3f883229080cc190854e8f2d3b9b105acd 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -2593,7 +2593,21 @@ setmangry(mtmp, via_attack)
 struct monst *mtmp;
 boolean via_attack;
 {
-    (void) via_attack; /* AIS: not used yet */
+    if (via_attack && sengr_at("Elbereth", u.ux, u.uy, TRUE)) {
+        You_feel("like a hypocrite.");
+        /* AIS: Yes, I know alignment penalties and bonuses aren't balanced at
+           the moment. This is about correct relative to other "small"
+           penalties; it should be fairly large, as attacking while standing on
+           an Elbereth means that you're requesting peace and then violating
+           your own request. I know 5 isn't actually large, but it's
+           intentionally larger than the 1s and 2s that are normally given for
+           this sort of thing. */
+        adjalign(-5);
+        if (!Blind)
+            pline("The engraving beneath you fades.");
+        del_engr_at(u.ux, u.uy);
+    }
+
     /* AIS: Should this be in both places, or just in wakeup()? */
     mtmp->mstrategy &= ~STRAT_WAITMASK;
     if (!mtmp->mpeaceful)
index c032db50404f1f6ecfd4cad8bc445cdd0940e05c..0b60d0c1545b2149da081172a3b9a81b12269bb4 100644 (file)
@@ -320,12 +320,6 @@ int *inrange, *nearby, *scared;
                     || (!mtmp->mpeaceful && in_your_sanctuary(mtmp, 0, 0)))) {
         *scared = 1;
         monflee(mtmp, rnd(rn2(7) ? 10 : 100), TRUE, TRUE);
-
-        /* magical protection won't last forever, so there'll be a
-         * chance of the magic being used up regardless of type */
-        if (sawscary) {
-            wipe_engr_at(seescaryx, seescaryy, 1, TRUE);
-        }
     } else
         *scared = 0;
 }