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.
This commit is contained in:
cohrs
2003-05-25 03:47:31 +00:00
parent dce0e0cb33
commit 1d2b62de95
2 changed files with 11 additions and 2 deletions

View 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

View 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;