Unspk'd listen and lock commands
This commit is contained in:
parent
38970a1c98
commit
8b3ef7ca78
1 changed files with 12 additions and 17 deletions
29
actions.c
29
actions.c
|
@ -788,15 +788,12 @@ static int light(token_t verb, token_t obj)
|
||||||
static int listen(void)
|
static int listen(void)
|
||||||
/* Listen. Intransitive only. Print stuff based on objsnd/locsnd. */
|
/* Listen. Intransitive only. Print stuff based on objsnd/locsnd. */
|
||||||
{
|
{
|
||||||
long k;
|
long sound = locations[game.loc].sound;
|
||||||
int spk = ALL_SILENT;
|
if (sound != SILENT) {
|
||||||
k = locations[game.loc].sound;
|
rspeak(sound);
|
||||||
if (k != SILENT) {
|
if (!locations[game.loc].loud)
|
||||||
rspeak(k);
|
rspeak(NO_MESSAGE);
|
||||||
if (locations[game.loc].loud)
|
return GO_CLEAROBJ;
|
||||||
return GO_CLEAROBJ;
|
|
||||||
else
|
|
||||||
spk = NO_MESSAGE;
|
|
||||||
}
|
}
|
||||||
for (int i = 1; i <= NOBJECTS; i++) {
|
for (int i = 1; i <= NOBJECTS; i++) {
|
||||||
if (!HERE(i) || objects[i].sounds[0] == NULL || game.prop[i] < 0)
|
if (!HERE(i) || objects[i].sounds[0] == NULL || game.prop[i] < 0)
|
||||||
|
@ -806,21 +803,20 @@ static int listen(void)
|
||||||
mi += 3 * game.blooded;
|
mi += 3 * game.blooded;
|
||||||
long packed_zzword = token_to_packed(game.zzword);
|
long packed_zzword = token_to_packed(game.zzword);
|
||||||
pspeak(i, hear, mi, true, packed_zzword);
|
pspeak(i, hear, mi, true, packed_zzword);
|
||||||
spk = NO_MESSAGE;
|
rspeak(NO_MESSAGE);
|
||||||
/* FIXME: Magic number, sensitive to bird state logic */
|
/* FIXME: Magic number, sensitive to bird state logic */
|
||||||
if (i == BIRD && game.prop[i] == 5)
|
if (i == BIRD && game.prop[i] == 5)
|
||||||
DESTROY(BIRD);
|
DESTROY(BIRD);
|
||||||
|
return GO_CLEAROBJ;
|
||||||
}
|
}
|
||||||
rspeak(spk);
|
rspeak(ALL_SILENT);
|
||||||
return GO_CLEAROBJ;
|
return GO_CLEAROBJ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lock(token_t verb, token_t obj)
|
static int lock(token_t verb, token_t obj)
|
||||||
/* Lock, unlock, no object given. Assume various things if present. */
|
/* Lock, unlock, no object given. Assume various things if present. */
|
||||||
{
|
{
|
||||||
int spk = actions[verb].message;
|
|
||||||
if (obj == INTRANSITIVE) {
|
if (obj == INTRANSITIVE) {
|
||||||
spk = NOTHING_LOCKED;
|
|
||||||
if (HERE(CLAM))
|
if (HERE(CLAM))
|
||||||
obj = CLAM;
|
obj = CLAM;
|
||||||
if (HERE(OYSTER))
|
if (HERE(OYSTER))
|
||||||
|
@ -832,19 +828,18 @@ static int lock(token_t verb, token_t obj)
|
||||||
if (HERE(CHAIN))
|
if (HERE(CHAIN))
|
||||||
obj = CHAIN;
|
obj = CHAIN;
|
||||||
if (obj == NO_OBJECT || obj == INTRANSITIVE) {
|
if (obj == NO_OBJECT || obj == INTRANSITIVE) {
|
||||||
rspeak(spk);
|
rspeak(NOTHING_LOCKED);
|
||||||
return GO_CLEAROBJ;
|
return GO_CLEAROBJ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lock, unlock object. Special stuff for opening clam/oyster
|
/* Lock, unlock object. Special stuff for opening clam/oyster
|
||||||
* and for chain. */
|
* and for chain. */
|
||||||
|
int spk = actions[verb].message;
|
||||||
if (obj == CLAM || obj == OYSTER)
|
if (obj == CLAM || obj == OYSTER)
|
||||||
return bivalve(verb, obj);
|
return bivalve(verb, obj);
|
||||||
if (obj == DOOR)
|
if (obj == DOOR)
|
||||||
spk = RUSTY_DOOR;
|
spk = (game.prop[DOOR] == DOOR_UNRUSTED) ? OK_MAN : RUSTY_DOOR;
|
||||||
if (obj == DOOR && game.prop[DOOR] == DOOR_UNRUSTED)
|
|
||||||
spk = OK_MAN;
|
|
||||||
if (obj == CAGE)
|
if (obj == CAGE)
|
||||||
spk = NO_LOCK;
|
spk = NO_LOCK;
|
||||||
if (obj == KEYS)
|
if (obj == KEYS)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue