magicbane grammar

I don't know for sure what all the possible values of hittee passed to
Mb_hit() are, but this checks to see if it matches the name of the
mdef monster and forces the word "is" if it does.
This commit is contained in:
nethack.allison
2006-03-06 04:11:36 +00:00
parent 5deeeb89cb
commit 3e8725ed95
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -198,6 +198,7 @@ more precise probing/stethoscope feedback when engulfed
make baby long worms have lower level than full grown ones make baby long worms have lower level than full grown ones
use "your kraken" instead of "a kraken" when searching reveals a tame use "your kraken" instead of "a kraken" when searching reveals a tame
hidden monster hidden monster
Magicbane should not produce "<something> are confused" message
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+3 -1
View File
@@ -787,6 +787,7 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */
boolean youattack = (magr == &youmonst), boolean youattack = (magr == &youmonst),
youdefend = (mdef == &youmonst), youdefend = (mdef == &youmonst),
resisted = FALSE, do_stun, do_confuse, result; resisted = FALSE, do_stun, do_confuse, result;
boolean hitteename = (has_name(mdef) && !strcmpi(hittee, MNAME(mdef)));
int attack_indx, scare_dieroll = MB_MAX_DIEROLL / 2; int attack_indx, scare_dieroll = MB_MAX_DIEROLL / 2;
result = FALSE; /* no message given yet */ result = FALSE; /* no message given yet */
@@ -936,7 +937,8 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */
if (do_stun) Strcat(buf, "stunned"); if (do_stun) Strcat(buf, "stunned");
if (do_stun && do_confuse) Strcat(buf, " and "); if (do_stun && do_confuse) Strcat(buf, " and ");
if (do_confuse) Strcat(buf, "confused"); if (do_confuse) Strcat(buf, "confused");
pline("%s %s %s%c", hittee, vtense(hittee, "are"), pline("%s %s %s%c", hittee,
hitteename ? "is" : vtense(hittee, "are"),
buf, (do_stun && do_confuse) ? '!' : '.'); buf, (do_stun && do_confuse) ? '!' : '.');
} }
} }