int spk = ALL_SILENT;
k = locations[game.loc].sound;
if (k != SILENT) {
- rspeak(labs(k));
- if (k < 0) return GO_CLEAROBJ;
- spk = NO_MESSAGE;
+ rspeak(k);
+ if (locations[game.loc].loud)
+ return GO_CLEAROBJ;
+ else
+ spk = NO_MESSAGE;
}
for (int i = 1; i <= NOBJECTS; i++) {
if (!HERE(i) || OBJSND[i] == 0 || game.prop[i] < 0)
# The optional hints field is a list of YAML references to hints
# that may be available at this location. (This is why locations
# has to follow hints.) The "sound" attribute, if present, is s
-# label for a location sound.
+# label for a location sound. If there is a "loud" attribute and
+# it is true, object sounds are drowned out at this location.
#
# arbitrary_messages: These are arguments to rspeak(). Some spans of
# these messages need to be kept adjacent and ordered (for now).
conditions: {NOARRR: true, LIT: true, DEEP: true}
hints: [*jade]
sound: TOTAL_ROAR
+ loud: true
- LOC_BOULDERS2:
description:
long: 'You are in a small chamber filled with large boulders. The walls are\nvery warm, causing the air in the room to be almost stifling from the\nheat. The only exit is a crawl heading west, through which is coming\na low rumbling.'
short: 'You''re at bottom of reservoir.'
conditions: {FLUID: true, DEEP: true}
sound: TOTAL_ROAR
+ loud: true
- LOC_RESNORTH:
description:
long: 'You are at the northern edge of the reservoir. A northwest passage\nleads sharply up from here.'
#define NEWDB_H
#include <stdio.h>
+#include <stdbool.h>
#define SILENT -1 /* no sound */
typedef struct {{
descriptions_t description;
const long sound;
+ const bool loud;
}} location_t;
typedef struct {{
.big = {},
}},
.sound = {},
+ .loud = {},
}},
"""
loc_str = ""
short_d = make_c_string(item[1]["description"]["short"])
long_d = make_c_string(item[1]["description"]["long"])
sound = item[1].get("sound", "SILENT")
- loc_str += template.format(short_d, long_d, sound)
+ loud = "true" if item[1].get("loud") else "false"
+ loc_str += template.format(short_d, long_d, sound, loud)
loc_str = loc_str[:-1] # trim trailing newline
return loc_str