From: nhmall Date: Mon, 10 Jun 2019 12:05:46 +0000 (-0400) Subject: Merge branch 'NetHack-3.6' X-Git-Tag: NetHack-3.7.0_WIP~376 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f167fe4d7e46aa7b3289aa168b64af08ad3ab94f;p=nethack Merge branch 'NetHack-3.6' --- f167fe4d7e46aa7b3289aa168b64af08ad3ab94f diff --cc src/mhitm.c index c50e25b27,7d436ac84..4ec135520 --- a/src/mhitm.c +++ b/src/mhitm.c @@@ -28,31 -33,12 +27,7 @@@ STATIC_DCL void FDECL(missmm, (struct m 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; @@@ -76,9 -62,9 +51,9 @@@ register struct monst *magr, *mdef 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)) @@@ -526,9 -512,9 +501,9 @@@ hitmm(magr, mdef, mattk 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); diff --cc src/muse.c index 9bf71d8d1,499febc65..d1ee5472a --- a/src/muse.c +++ b/src/muse.c @@@ -648,15 -697,14 +678,14 @@@ struct monst *mtmp (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; @@@ -1376,11 -1422,10 +1403,10 @@@ struct monst *mtmp 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)); @@@ -1388,13 -1433,8 +1414,8 @@@ 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)); @@@ -1402,12 -1442,11 +1423,11 @@@ 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 */ diff --cc src/read.c index f242d1f14,cd924bf15..56d28e18b --- a/src/read.c +++ b/src/read.c @@@ -2594,13 -2588,13 +2594,13 @@@ struct _create_particular_data *d 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;