MCPcopy Index your code
hub / github.com/NetHack/NetHack / trapnote

Function trapnote

src/trap.c:3062–3078  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3060}
3061
3062staticfn char *
3063trapnote(struct trap *trap, boolean noprefix)
3064{
3065 static const char *const tnnames[] = {
3066 "C note", "D flat", "D note", "E flat",
3067 "E note", "F note", "F sharp", "G note",
3068 "G sharp", "A note", "B flat", "B note",
3069 };
3070 static char tnbuf[12]; /* result buffer */
3071 const char *tn;
3072
3073 tnbuf[0] = '\0';
3074 tn = tnnames[trap->tnote];
3075 if (!noprefix)
3076 (void) just_an(tnbuf, tn);
3077 return strcat(tnbuf, tn);
3078}
3079
3080/* choose a note not used by any trap on current level,
3081 ignoring ttmp; if all are in use, pick a random one */

Callers 1

trapeffect_sqky_boardFunction · 0.85

Calls 1

just_anFunction · 0.85

Tested by

no test coverage detected