]> granicus.if.org Git - nethack/commitdiff
B03005 - Canceling monsters
authorcohrs <cohrs>
Sun, 25 May 2003 03:47:31 +0000 (03:47 +0000)
committercohrs <cohrs>
Sun, 25 May 2003 03:47:31 +0000 (03:47 +0000)
Since monster cancellation sticks, it doesn't makes sense for Magicbane to
cancel a monster more than once.  Tweaked the messages to deal with this fact.
I decided to not make Magicbane's random effect "intelligent", which is what
changing it to use some other attack against a canceled monster would be.

doc/fixes34.2
src/artifact.c

index 32bdbeee04448358720a773ea2194d82511ff98e..177a4a276176967a604e113f56ba8cd057523a9b 100644 (file)
@@ -76,6 +76,7 @@ choking while eating non-food always called the food "quick snack"
 short swords are not throwing weapons
 several sit-in-trap cases were unreachable
 curse candelabrum in bones, like other similar artifacts
+clear up Magicbane messages when it attempts to re-cancel a canceled monster
 
 
 Platform- and/or Interface-Specific Fixes
index 102a99d3a00746692941acba4f395f7a4ecbcf7b..0205efe6af9eaf821e1c867eea9f8c6df4990e5f 100644 (file)
@@ -766,7 +766,8 @@ char *hittee;                       /* target's name: "you" or mon_nam(mdef) */
     const char *verb;
     boolean youattack = (magr == &youmonst),
            youdefend = (mdef == &youmonst),
-           resisted = FALSE, do_stun, do_confuse, result;
+           resisted = FALSE, was_canceled = FALSE,
+           do_stun, do_confuse, result;
     int attack_indx, scare_dieroll = MB_MAX_DIEROLL / 2;
 
     result = FALSE;            /* no message given yet */
@@ -809,6 +810,11 @@ char *hittee;                      /* target's name: "you" or mon_nam(mdef) */
     verb = mb_verb[!!Hallucination][attack_indx];
     if (youattack || youdefend || vis) {
        result = TRUE;
+       /* canceling monster only happens if not already canceled */
+       if (attack_indx == MB_INDEX_CANCEL && !youdefend && mdef->mcan) {
+           was_canceled = TRUE;
+           verb = "hit"; /* doesn't change its attack to, eg stun */
+       }
        pline_The("magic-absorbing blade %s %s!",
                  vtense((const char *)0, verb), hittee);
        /* assume probing has some sort of noticeable feedback
@@ -821,7 +827,9 @@ char *hittee;                       /* target's name: "you" or mon_nam(mdef) */
     switch (attack_indx) {
     case MB_INDEX_CANCEL:
        old_uasmon = youmonst.data;
-       if (!cancel_monst(mdef, mb, youattack, FALSE, FALSE)) {
+       if (was_canceled) {
+           /* nothing left to cancel */
+       } else if (!cancel_monst(mdef, mb, youattack, FALSE, FALSE)) {
            resisted = TRUE;
        } else {
            do_stun = FALSE;