]> granicus.if.org Git - nethack/commitdiff
Merge branch 'NetHack-3.6'
authornhmall <nhmall@nethack.org>
Mon, 10 Jun 2019 12:05:46 +0000 (08:05 -0400)
committernhmall <nhmall@nethack.org>
Mon, 10 Jun 2019 12:05:46 +0000 (08:05 -0400)
1  2 
include/extern.h
src/do_name.c
src/mhitm.c
src/muse.c
src/read.c

Simple merge
diff --cc src/do_name.c
Simple merge
diff --cc src/mhitm.c
index c50e25b2758fca62085c7b1c65fb8a42e68cac32,7d436ac849597d19cb8091fc0469862ca57ad000..4ec1355205b81a2570ae21af90ed3d6a83214518
@@@ -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 9bf71d8d165af09a91a51a12ec58840556d53947,499febc6575be5e704aa25de36f812ffd139fc8f..d1ee5472a6b7ab1f0ac282557e71a7b102325224
@@@ -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));
          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 */
diff --cc src/read.c
index f242d1f14850fbcdbccaec4dfb8a16c96513cc39,cd924bf1576f623e97b6189b7625790675541ed5..56d28e18b90a19f7c4d6e315c4f46b92b0dcea30
@@@ -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;