another update to the soundlib interface
sound_verbal(char *text, int32_t gender, int32_t tone, int32_t vol,
int32_t moreinfo);
-- NetHack will call this function when it wants to pass text of
spoken language by a character or creature within the game.
-- text is a transcript of what has been spoken.
-- gender indicates MALE or FEMALE sounding voice.
-- tone indicates the tone of the voice.
-- vol is the volume (1% - 100%) for the sound.
-- moreinfo is used to provide additional information to the soundlib.
-- there may be some accessibility uses for this function.
It may be useful for accessibility purposes too.
A preliminary implementation has been attempted for macsound to test
the interface on macOS. No tinkering of the voices has been done.
Use of the test implementation requires the following at build time with make.
WANT_SPEECH=1
That needs to be included on the make command line to enable the test code,
otherwise just the interface update is compiled in.
I don't know for certain when AVSpeechSynthesizer went into macOS, but older versions
likely don't support it, and would just leave off the WANT_SPEECH=1.
If built with WANT_SPEECH=1, the 'voices' NetHack option needs to be enabled.
It was a bit strange, when I first started up the test, to hear Asidonhopo,
the shopkeeper, talking to me as I entered his shop and interacted with him.
This commit is contained in:
26
src/apply.c
26
src/apply.c
@@ -1409,11 +1409,15 @@ use_candle(struct obj **optr)
|
||||
pline_The("new %s magically %s!", s, vtense(s, "ignite"));
|
||||
else if (!otmp->lamplit && was_lamplit)
|
||||
pline("%s out.", (obj->quan > 1L) ? "They go" : "It goes");
|
||||
if (obj->unpaid)
|
||||
if (obj->unpaid) {
|
||||
struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
|
||||
|
||||
SetVoice(shkp, 0, 80, 0);
|
||||
verbalize("You %s %s, you bought %s!",
|
||||
otmp->lamplit ? "burn" : "use",
|
||||
(obj->quan > 1L) ? "them" : "it",
|
||||
(obj->quan > 1L) ? "them" : "it");
|
||||
}
|
||||
if (obj->quan < 7L && otmp->spe == 7)
|
||||
pline("%s now has seven%s candles attached.", The(xname(otmp)),
|
||||
otmp->lamplit ? " lit" : "");
|
||||
@@ -1563,8 +1567,11 @@ catch_lit(struct obj *obj)
|
||||
if (obj->otyp == POT_OIL)
|
||||
makeknown(obj->otyp);
|
||||
if (carried(obj) && obj->unpaid && costly_spot(u.ux, u.uy)) {
|
||||
struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
|
||||
|
||||
/* if it catches while you have it, then it's your tough luck */
|
||||
check_unpaid(obj);
|
||||
SetVoice(shkp, 0, 80, 0);
|
||||
verbalize("That's in addition to the cost of %s %s, of course.",
|
||||
yname(obj),
|
||||
(obj->quan == 1L) ? "itself" : "themselves");
|
||||
@@ -1640,7 +1647,9 @@ use_lamp(struct obj *obj)
|
||||
if (obj->unpaid && costly_spot(u.ux, u.uy)
|
||||
&& obj->age == 20L * (long) objects[obj->otyp].oc_cost) {
|
||||
const char *ithem = (obj->quan > 1L) ? "them" : "it";
|
||||
struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
|
||||
|
||||
SetVoice(shkp, 0, 80, 0);
|
||||
verbalize("You burn %s, you bought %s!", ithem, ithem);
|
||||
bill_dummy_object(obj);
|
||||
}
|
||||
@@ -1685,10 +1694,13 @@ light_cocktail(struct obj **optr)
|
||||
Blind ? "" : " It gives off a dim light.");
|
||||
|
||||
if (obj->unpaid && costly_spot(u.ux, u.uy)) {
|
||||
struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
|
||||
|
||||
/* Normally, we shouldn't both partially and fully charge
|
||||
* for an item, but (Yendorian Fuel) Taxes are inevitable...
|
||||
*/
|
||||
check_unpaid(obj);
|
||||
SetVoice(shkp, 0, 80, 0);
|
||||
verbalize("That's in addition to the cost of the potion, of course.");
|
||||
bill_dummy_object(obj);
|
||||
}
|
||||
@@ -2141,12 +2153,20 @@ use_tinning_kit(struct obj *obj)
|
||||
/* Mark tinned tins. No spinach allowed... */
|
||||
set_tin_variety(can, HOMEMADE_TIN);
|
||||
if (carried(corpse)) {
|
||||
if (corpse->unpaid)
|
||||
if (corpse->unpaid) {
|
||||
struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
|
||||
|
||||
SetVoice(shkp, 0, 80, 0);
|
||||
verbalize(you_buy_it);
|
||||
}
|
||||
useup(corpse);
|
||||
} else {
|
||||
if (costly_spot(corpse->ox, corpse->oy) && !corpse->no_charge)
|
||||
if (costly_spot(corpse->ox, corpse->oy) && !corpse->no_charge) {
|
||||
struct monst *shkp = shop_keeper(*in_rooms(corpse->ox,
|
||||
corpse->oy, SHOPBASE));
|
||||
SetVoice(shkp, 0, 80, 0);
|
||||
verbalize(you_buy_it);
|
||||
}
|
||||
useupf(corpse, 1L);
|
||||
}
|
||||
(void) hold_another_object(can, "You make, but cannot pick up, %s.",
|
||||
|
||||
Reference in New Issue
Block a user