fix issue #332 - mon vs mon double hit message
One monster hitting another with an artifact within the hero's view gave "<Mon1> swings his <Artifact> at <Mon2>." followed either by "<Mon1> misses <Mon2>." _or_ the two messages "<Mon1> hits <Mon2>." and "The <Artifact> hits <Mon2>." Defer the <Mon1> hits <Mon2> one when Mon1 is using an artifact and only deliver it if there is no artifact hit message. Tested but not exhaustively so.... Fixes #332
This commit is contained in:
@@ -163,6 +163,7 @@ if riding or levitating, hero could apply bullwhip downward to pull up things
|
|||||||
some monster code was checking whether pets or engulfers were eating green
|
some monster code was checking whether pets or engulfers were eating green
|
||||||
slime by checking for green slime corpse instead of glob
|
slime by checking for green slime corpse instead of glob
|
||||||
change light radius of stack of candles to square root
|
change light radius of stack of candles to square root
|
||||||
|
could get redundate "mon hits other-mon" messages when mon wields an artifact
|
||||||
|
|
||||||
|
|
||||||
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
||||||
|
|||||||
22
src/mhitm.c
22
src/mhitm.c
@@ -557,6 +557,7 @@ int dieroll;
|
|||||||
char magr_name[BUFSZ];
|
char magr_name[BUFSZ];
|
||||||
|
|
||||||
Strcpy(magr_name, Monnam(magr));
|
Strcpy(magr_name, Monnam(magr));
|
||||||
|
buf[0] = '\0';
|
||||||
switch (mattk->aatyp) {
|
switch (mattk->aatyp) {
|
||||||
case AT_BITE:
|
case AT_BITE:
|
||||||
Sprintf(buf, "%s bites", magr_name);
|
Sprintf(buf, "%s bites", magr_name);
|
||||||
@@ -580,9 +581,12 @@ int dieroll;
|
|||||||
}
|
}
|
||||||
/*FALLTHRU*/
|
/*FALLTHRU*/
|
||||||
default:
|
default:
|
||||||
Sprintf(buf, "%s hits", magr_name);
|
if (!weaponhit || !mwep || !mwep->oartifact)
|
||||||
|
Sprintf(buf, "%s hits", magr_name);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
pline("%s %s.", buf, mon_nam_too(mdef, magr));
|
if (*buf)
|
||||||
|
pline("%s %s.", buf, mon_nam_too(mdef, magr));
|
||||||
|
|
||||||
if (mon_hates_silver(mdef) && silverhit) {
|
if (mon_hates_silver(mdef) && silverhit) {
|
||||||
char *mdef_name = mon_nam_too(mdef, magr);
|
char *mdef_name = mon_nam_too(mdef, magr);
|
||||||
@@ -967,8 +971,18 @@ int dieroll;
|
|||||||
if (tmp < 1) /* is this necessary? mhitu.c has it... */
|
if (tmp < 1) /* is this necessary? mhitu.c has it... */
|
||||||
tmp = 1;
|
tmp = 1;
|
||||||
if (mwep->oartifact) {
|
if (mwep->oartifact) {
|
||||||
(void) artifact_hit(magr, mdef, mwep, &tmp, dieroll);
|
/* when magr's weapon is an artifact, caller suppressed its
|
||||||
if (DEADMONSTER(mdef))
|
usual 'hit' message in case artifact_hit() delivers one;
|
||||||
|
now we'll know and might need to deliver skipped message
|
||||||
|
(note: if there's no message there'll be no auxilliary
|
||||||
|
damage so the message here isn't coming too late) */
|
||||||
|
if (!artifact_hit(magr, mdef, mwep, &tmp, dieroll))
|
||||||
|
pline("%s hits %s.", Monnam(magr),
|
||||||
|
mon_nam_too(mdef, magr));
|
||||||
|
/* artifact_hit updates 'tmp' but doesn't inflict any
|
||||||
|
damage; however, it might cause carried items to be
|
||||||
|
destroyed and they might do so */
|
||||||
|
if (DEADMONSTER(mdef))
|
||||||
return (MM_DEF_DIED
|
return (MM_DEF_DIED
|
||||||
| (grow_up(magr, mdef) ? 0 : MM_AGR_DIED));
|
| (grow_up(magr, mdef) ? 0 : MM_AGR_DIED));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -808,6 +808,9 @@ int dieroll;
|
|||||||
|
|
||||||
if (obj->oartifact
|
if (obj->oartifact
|
||||||
&& artifact_hit(&g.youmonst, mon, obj, &tmp, dieroll)) {
|
&& artifact_hit(&g.youmonst, mon, obj, &tmp, dieroll)) {
|
||||||
|
/* artifact_hit updates 'tmp' but doesn't inflict any
|
||||||
|
damage; however, it might cause carried items to be
|
||||||
|
destroyed and they might do so */
|
||||||
if (DEADMONSTER(mon)) /* artifact killed monster */
|
if (DEADMONSTER(mon)) /* artifact killed monster */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (tmp == 0)
|
if (tmp == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user