STATIC_DCL int FDECL(passivemm, (struct monst *, struct monst *,
BOOLEAN_P, int));
-/* Needed for the special case of monsters wielding vorpal blades (rare).
- * If we use this a lot it should probably be a parameter to mdamagem()
- * instead of a global variable.
- */
-static int dieroll;
- /* returns mon_nam(mon) relative to other_mon; normal name unless they're
- the same, in which case the reference is to {him|her|it} self */
- STATIC_OVL char *
- mon_nam_too(outbuf, mon, other_mon)
- char *outbuf;
- struct monst *mon, *other_mon;
- {
- if (mon != other_mon)
- Strcpy(outbuf, mon_nam(mon));
- else
- switch (pronoun_gender(mon, FALSE)) {
- case 0:
- Strcpy(outbuf, "himself");
- break;
- case 1:
- Strcpy(outbuf, "herself");
- break;
- default:
- Strcpy(outbuf, "itself");
- break;
- }
- return outbuf;
- }
-
STATIC_OVL void
noises(magr, mattk)
register struct monst *magr;
struct attack *mattk;
{
const char *fmt;
- char buf[BUFSZ], mdef_name[BUFSZ];
+ char buf[BUFSZ];
- if (vis) {
+ if (g.vis) {
if (!canspotmon(magr))
map_invisible(magr->mx, magr->my);
if (!canspotmon(mdef))
register struct monst *magr, *mdef;
struct attack *mattk;
{
- if (vis) {
+ if (g.vis) {
int compat;
- char buf[BUFSZ], mdef_name[BUFSZ];
+ char buf[BUFSZ];
if (!canspotmon(magr))
map_invisible(magr->mx, magr->my);
(void) rloc(mtmp, TRUE);
return 2;
case MUSE_WAN_TELEPORTATION:
- zap_oseen = oseen;
+ g.zap_oseen = oseen;
- mzapmsg(mtmp, otmp, FALSE);
- otmp->spe--;
+ mzapwand(mtmp, otmp, FALSE);
- m_using = TRUE;
+ g.m_using = TRUE;
mbhit(mtmp, rn1(8, 6), mbhitm, bhito, otmp);
/* monster learns that teleportation isn't useful here */
- if (level.flags.noteleport)
+ if (g.level.flags.noteleport)
mtmp->mtrapseen |= (1 << (TELEP_TRAP - 1));
- m_using = FALSE;
+ g.m_using = FALSE;
return 2;
case MUSE_SCR_TELEPORTATION: {
int obj_is_cursed = otmp->cursed;
case MUSE_WAN_COLD:
case MUSE_WAN_LIGHTNING:
case MUSE_WAN_MAGIC_MISSILE:
- mzapmsg(mtmp, otmp, FALSE);
- otmp->spe--;
+ mzapwand(mtmp, otmp, FALSE);
if (oseen)
makeknown(otmp->otyp);
- m_using = TRUE;
+ g.m_using = TRUE;
buzz((int) (-30 - (otmp->otyp - WAN_MAGIC_MISSILE)),
(otmp->otyp == WAN_MAGIC_MISSILE) ? 2 : 6, mtmp->mx, mtmp->my,
sgn(mtmp->mux - mtmp->mx), sgn(mtmp->muy - mtmp->my));
return (DEADMONSTER(mtmp)) ? 1 : 2;
case MUSE_FIRE_HORN:
case MUSE_FROST_HORN:
- if (oseen) {
- makeknown(otmp->otyp);
- pline("%s plays a %s!", Monnam(mtmp), xname(otmp));
- } else
- You_hear("a horn being played.");
- otmp->spe--;
+ mplayhorn(mtmp, otmp, FALSE);
- m_using = TRUE;
+ g.m_using = TRUE;
buzz(-30 - ((otmp->otyp == FROST_HORN) ? AD_COLD - 1 : AD_FIRE - 1),
rn1(6, 6), mtmp->mx, mtmp->my, sgn(mtmp->mux - mtmp->mx),
sgn(mtmp->muy - mtmp->my));
return (DEADMONSTER(mtmp)) ? 1 : 2;
case MUSE_WAN_TELEPORTATION:
case MUSE_WAN_STRIKING:
- zap_oseen = oseen;
+ g.zap_oseen = oseen;
- mzapmsg(mtmp, otmp, FALSE);
- otmp->spe--;
+ mzapwand(mtmp, otmp, FALSE);
- m_using = TRUE;
+ g.m_using = TRUE;
mbhit(mtmp, rn1(8, 6), mbhitm, bhito, otmp);
- m_using = FALSE;
+ g.m_using = FALSE;
return 2;
case MUSE_SCR_EARTH: {
/* TODO: handle steeds */
or vision issues (line-of-sight, invisibility, blindness) */
if (d->hidden && !canspotmon(mtmp)) {
int count = couldsee(mx, my) ? 8 : 4;
-- char saveviz = viz_array[my][mx];
++ char saveviz = g.viz_array[my][mx];
if (!flags.sparkle)
count /= 2;
-- viz_array[my][mx] |= (IN_SIGHT | COULD_SEE);
++ g.viz_array[my][mx] |= (IN_SIGHT | COULD_SEE);
flash_glyph_at(mx, my, mon_to_glyph(mtmp, newsym_rn2), count);
-- viz_array[my][mx] = saveviz;
++ g.viz_array[my][mx] = saveviz;
newsym(mx, my);
}
madeany = TRUE;