diff --git a/include/you.h b/include/you.h index 147d38808..791517c4f 100644 --- a/include/you.h +++ b/include/you.h @@ -1,4 +1,4 @@ -/* NetHack 3.7 you.h $NHDT-Date: 1686726254 2023/06/14 07:04:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.72 $ */ +/* NetHack 3.7 you.h $NHDT-Date: 1702349061 2023/12/12 02:44:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.75 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2016. */ /* NetHack may be freely redistributed. See license for details. */ @@ -43,8 +43,8 @@ struct u_event { Bitfield(qcalled, 1); /* called by Quest leader to do task */ Bitfield(qexpelled, 1); /* expelled from the Quest dungeon */ Bitfield(qcompleted, 1); /* successfully completed Quest task */ - Bitfield(uheard_tune, 2); /* 1=know about, 2=heard passtune */ - + Bitfield(uheard_tune, 2); /* 1=know about, 2=heard passtune, 3=bridge has + * been destroyed so tune has become useless */ Bitfield(uopened_dbridge, 1); /* opened the drawbridge */ Bitfield(invoked, 1); /* invoked Gate to the Sanctum level */ Bitfield(gehennom_entered, 1); /* entered Gehennom via Valley */ diff --git a/src/dbridge.c b/src/dbridge.c index 9855ca021..e1df7429a 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 dbridge.c $NHDT-Date: 1596498153 2020/08/03 23:42:33 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.47 $ */ +/* NetHack 3.7 dbridge.c $NHDT-Date: 1702349063 2023/12/12 02:44:23 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.62 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -988,6 +988,7 @@ destroy_drawbridge(coordxy x, coordxy y) } } nokiller(); + u.uevent.uheard_tune = 3; /* bridge is gone so tune is useless */ } /*dbridge.c*/ diff --git a/src/music.c b/src/music.c index a1f4b6086..4dde9671c 100644 --- a/src/music.c +++ b/src/music.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 music.c $NHDT-Date: 1702206294 2023/12/10 11:04:54 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.101 $ */ +/* NetHack 3.7 music.c $NHDT-Date: 1702349065 2023/12/12 02:44:25 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.102 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -158,7 +158,8 @@ awaken_soldiers(struct monst* bugler /* monster that played instrument */) int distance, distm; /* distance of affected non-soldier monsters to bugler */ - distance = ((bugler == &gy.youmonst) ? u.ulevel : bugler->data->mlevel) * 30; + distance = ((bugler == &gy.youmonst) ? u.ulevel + : bugler->data->mlevel) * 30; for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) @@ -496,8 +497,8 @@ do_improvisation(struct obj* instr) itmp = *instr; itmp.oextra = (struct oextra *) 0; /* ok on this copy as instr maintains - the ptr to free at some point if - there is one */ + * the ptr to free at some point if + * there is one */ /* if won't yield special effect, make sound of mundane counterpart */ if (!do_spec || instr->spe <= 0) @@ -647,7 +648,8 @@ do_improvisation(struct obj* instr) if (!Deaf) pline("%s very attractive%s music.", - Tobjnam(instr, "produce"), same_old_song ? " and familiar" : ""); + Tobjnam(instr, "produce"), + same_old_song ? " and familiar" : ""); else You_feel("very soothing vibrations."); Hero_playnotes(obj_to_instr(&itmp), improvisation, 50); @@ -658,9 +660,11 @@ do_improvisation(struct obj* instr) do_spec &= (rn2(ACURR(A_DEX)) + u.ulevel > 25); if (!Deaf) pline("%s %s.", Yname2(instr), - (do_spec && same_old_song) ? "produces a familiar, lilting melody" - : (do_spec) ? "produces a lilting melody" - : (same_old_song) ? "twangs a familar tune" : "twangs"); + (do_spec && same_old_song) + ? "produces a familiar, lilting melody" + : (do_spec) ? "produces a lilting melody" + : (same_old_song) ? "twangs a familar tune" + : "twangs"); else You_feel("soothing vibrations."); Hero_playnotes(obj_to_instr(&itmp), improvisation, 50); @@ -714,7 +718,7 @@ do_improvisation(struct obj* instr) static char * improvised_notes(boolean *same_as_last_time) { - static const char notes[] = "ABCDEFG"; + static const char notes[7] = "ABCDEFG"; /* 7: no trailing '\0' */ /* target buffer has to be in gc.context, otherwise saving game * between improvised recitals would not be able to maintain * the same_as_last_time context. */ @@ -722,8 +726,9 @@ improvised_notes(boolean *same_as_last_time) /* You can change your tune, usually */ if (!(Unchanging && gc.context.jingle[0] != '\0')) { int i, notecount = rnd(SIZE(gc.context.jingle) - 1); /* 1 - 5 */ + for (i = 0; i < notecount; ++i) { - gc.context.jingle[i] = notes[rn2(SIZE(notes) - 1)]; /* -1 to exclude '\0' */ + gc.context.jingle[i] = ROLL_FROM(notes); } gc.context.jingle[notecount] = '\0'; *same_as_last_time = FALSE; diff --git a/src/pray.c b/src/pray.c index 387e5a434..9c1fe70ea 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 pray.c $NHDT-Date: 1699595930 2023/11/10 05:58:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.202 $ */ +/* NetHack 3.7 pray.c $NHDT-Date: 1702349066 2023/12/12 02:44:26 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.205 $ */ /* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1203,7 +1203,7 @@ pleased(aligntyp g_align) if (u.uevent.uheard_tune < 1) { godvoice(g_align, (char *) 0); SetVoice((struct monst *) 0, 0, 80, voice_deity); - verbalize("Hark, %s!", (gy.youmonst.data->mlet == S_HUMAN) + verbalize("Hark, %s!", is_human(gy.youmonst.data) ? "mortal" : "creature"); SetVoice((struct monst *) 0, 0, 80, voice_deity);