From: cohrs Date: Sun, 25 May 2003 03:47:31 +0000 (+0000) Subject: B03005 - Canceling monsters X-Git-Tag: MOVE2GIT~1959 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d2b62de95840065b024c400e683a1a68aae611b;p=nethack B03005 - Canceling monsters 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. --- diff --git a/doc/fixes34.2 b/doc/fixes34.2 index 32bdbeee0..177a4a276 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -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 diff --git a/src/artifact.c b/src/artifact.c index 102a99d3a..0205efe6a 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -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;