--- nethack-3.4.3-orig/src/mhitm.c Sun Dec 07 16:39:14 2003 +++ nethack-3.4.3-grudge/src/mhitm.c Thu Dec 11 10:09:48 2003 @@ -1308,6 +1308,20 @@ } } else tmp = 0; goto assess_dmg; + case AD_MAGM: + /* wrath of gods for attacking Oracle */ + if(resists_magm(magr)) { + if(canseemon(magr)) { + shieldeff(magr->mx, magr->my); + pline("A hail of magic missiles narrowly misses %s!",mon_nam(magr)); + } + } else { + if(canseemon(magr)) + pline(magr->data == &mons[PM_WOODCHUCK] ? "ZOT!" : + "%s is hit by magic missiles appearing from thin air!",Monnam(magr)); + goto assess_dmg; + } + break; case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */ if (mhit && !mdef->mcan && otmp) { (void) drain_item(otmp); --- nethack-3.4.3-orig/src/mon.c Sun Dec 07 16:39:14 2003 +++ nethack-3.4.3-grudge/src/mon.c Thu Dec 11 10:09:48 2003 @@ -1217,14 +1217,46 @@ struct monst *magr, /* monster that is currently deciding where to move */ *mdef; /* another monster which is next to it */ { + struct permonst *ma,*md; + + ma = magr->data; + md = mdef->data; /* supposedly purple worms are attracted to shrieking because they like to eat shriekers, so attack the latter when feasible */ - if (magr->data == &mons[PM_PURPLE_WORM] && - mdef->data == &mons[PM_SHRIEKER]) - return ALLOW_M|ALLOW_TM; - /* Various other combinations such as dog vs cat, cat vs rat, and - elf vs orc have been suggested. For the time being we don't - support those. */ + if (ma == &mons[PM_PURPLE_WORM] && + md == &mons[PM_SHRIEKER]) + return ALLOW_M|ALLOW_TM; + + /* Since the quest guardians are under siege, it makes sense to have + them fight hostiles. (But we don't want the quest leader to be in danger.) */ + if(ma->msound==MS_GUARDIAN && mdef->mpeaceful==FALSE) + return ALLOW_M|ALLOW_TM; + /* and vice versa */ + if(md->msound==MS_GUARDIAN && magr->mpeaceful==FALSE) + return ALLOW_M|ALLOW_TM; + + /* elves vs. orcs */ + if(is_elf(ma) && is_orc(md)) + return ALLOW_M|ALLOW_TM; + /* and vice versa */ + if(is_elf(md) && is_orc(ma)) + return ALLOW_M|ALLOW_TM; + + /* angels vs. demons */ + if(ma->mlet==S_ANGEL && is_demon(md)) + return ALLOW_M|ALLOW_TM; + /* and vice versa */ + if(md->mlet==S_ANGEL && is_demon(ma)) + return ALLOW_M|ALLOW_TM; + + /* woodchucks vs. The Oracle */ + if(ma == &mons[PM_WOODCHUCK] && md == &mons[PM_ORACLE]) + return ALLOW_M|ALLOW_TM; + + /* ravens like eyes */ + if(ma == &mons[PM_RAVEN] && md == &mons[PM_FLOATING_EYE]) + return ALLOW_M|ALLOW_TM; + return 0L; }