tune notes hint

Add <Someone>'s suggestion for the expected input value to the prompt for
playing a tune, and implement handling for alternate note "H" which seems
to be used as a variation of "B" by some Europeans.  The Amiga part is
untested but "can't be wrong"(tm).
This commit is contained in:
nethack.rankin
2003-03-10 23:36:01 +00:00
parent 1a428307f3
commit 7350d4fc98
2 changed files with 18 additions and 11 deletions

View File

@@ -9,6 +9,7 @@ two invisible monsters hitting one another should not be visible
if only one monster in a monster-vs-monster fight is visible, show an I symbol if only one monster in a monster-vs-monster fight is visible, show an I symbol
for the other one whether it is an attacker or defender for the other one whether it is an attacker or defender
display "It" and not "The invisible <pet>" when an invisible pet eats food. display "It" and not "The invisible <pet>" when an invisible pet eats food.
include a hint about expected input when prompting for musical notes
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)music.c 3.4 2001/12/03 */ /* SCCS Id: @(#)music.c 3.4 2003/03/10 */
/* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -477,9 +477,7 @@ do_play_instrument(instr)
struct obj *instr; struct obj *instr;
{ {
char buf[BUFSZ], c = 'y'; char buf[BUFSZ], c = 'y';
#ifndef AMIGA char *s;
char *s;
#endif
int x,y; int x,y;
boolean ok; boolean ok;
@@ -491,14 +489,22 @@ struct obj *instr;
c = yn("Improvise?"); c = yn("Improvise?");
} }
if (c == 'n') { if (c == 'n') {
if (u.uevent.uheard_tune == 2 && yn("Play the passtune?") == 'y') if (u.uevent.uheard_tune == 2 && yn("Play the passtune?") == 'y') {
Strcpy(buf, tune); Strcpy(buf, tune);
else } else {
getlin("What tune are you playing? [what 5 notes]", buf); getlin("What tune are you playing? [5 notes, A-G]", buf);
#ifndef AMIGA (void)mungspaces(buf);
/* The AMIGA supports two octaves of notes */ /* convert to uppercase and change any "H" to the expected "B" */
for (s=buf; *s; s++) *s = highc(*s); for (s = buf; *s; s++) {
#ifndef AMIGA
*s = highc(*s);
#else
/* The AMIGA supports two octaves of notes */
if (*s == 'h') *s = 'b';
#endif #endif
if (*s == 'H') *s = 'B';
}
}
You("extract a strange sound from %s!", the(xname(instr))); You("extract a strange sound from %s!", the(xname(instr)));
#ifdef UNIX386MUSIC #ifdef UNIX386MUSIC
/* if user is at the console, play through the console speaker */ /* if user is at the console, play through the console speaker */