static int bivalve(token_t verb, token_t obj)
/* Clam/oyster actions */
{
static int bivalve(token_t verb, token_t obj)
/* Clam/oyster actions */
{
- spk = is_oyster ? OYSTER_OPENS : PEARL_FALLS;
- if (TOTING(obj))
- spk = is_oyster ? DROP_OYSTER : DROP_CLAM;
- if (!TOTING(TRIDENT))
- spk = is_oyster ? OYSTER_OPENER : CLAM_OPENER;
- if (verb == LOCK)
- spk = HUH_MAN;
- if (spk == PEARL_FALLS) {
+ if (verb == LOCK) {
+ rspeak(HUH_MAN);
+ return GO_CLEAROBJ;
+ }
+ if (!TOTING(TRIDENT)) {
+ rspeak(is_oyster ? OYSTER_OPENER : CLAM_OPENER);
+ return GO_CLEAROBJ;
+ }
+ if (TOTING(obj)) {
+ rspeak( is_oyster ? DROP_OYSTER : DROP_CLAM);
+ return GO_CLEAROBJ;
+ }
+
+ if (!is_oyster) {
/* Eat. Intransitive: assume food if present, else ask what. Transitive: food
* ok, some things lose appetite, rest are ridiculous. */
{
/* Eat. Intransitive: assume food if present, else ask what. Transitive: food
* ok, some things lose appetite, rest are ridiculous. */
{
- spk = THANKS_DELICIOUS;
- } else {
- if (obj == FOOD) {
- DESTROY(FOOD);
- spk = THANKS_DELICIOUS;
- }
- if (obj == BIRD || obj == SNAKE || obj == CLAM || obj == OYSTER || obj ==
- DWARF || obj == DRAGON || obj == TROLL || obj == BEAR || obj ==
- OGRE)
- spk = LOST_APPETITE;
+ rspeak(THANKS_DELICIOUS);
+ return GO_CLEAROBJ;
static int fly(token_t verb, token_t obj)
/* Fly. Snide remarks unless hovering rug is here. */
{
static int fly(token_t verb, token_t obj)
/* Fly. Snide remarks unless hovering rug is here. */
{
return GO_CLEAROBJ;
}
game.oldlc2 = game.oldloc;
game.oldloc = game.loc;
/* FIXME: Arithmetic on location values */
game.newloc = game.place[RUG] + game.fixed[RUG] - game.loc;
return GO_CLEAROBJ;
}
game.oldlc2 = game.oldloc;
game.oldloc = game.loc;
/* FIXME: Arithmetic on location values */
game.newloc = game.place[RUG] + game.fixed[RUG] - game.loc;
}
for (int i = 1; i <= NOBJECTS; i++) {
if (!HERE(i) || objects[i].sounds[0] == NULL || game.prop[i] < 0)
}
for (int i = 1; i <= NOBJECTS; i++) {
if (!HERE(i) || objects[i].sounds[0] == NULL || game.prop[i] < 0)
mi += 3 * game.blooded;
long packed_zzword = token_to_packed(game.zzword);
pspeak(i, hear, mi, true, packed_zzword);
mi += 3 * game.blooded;
long packed_zzword = token_to_packed(game.zzword);
pspeak(i, hear, mi, true, packed_zzword);
/* FIXME: Magic number, sensitive to bird state logic */
if (i == BIRD && game.prop[i] == 5)
DESTROY(BIRD);
/* FIXME: Magic number, sensitive to bird state logic */
if (i == BIRD && game.prop[i] == 5)
DESTROY(BIRD);
return GO_CLEAROBJ;
}
static int lock(token_t verb, token_t obj)
/* Lock, unlock, no object given. Assume various things if present. */
{
return GO_CLEAROBJ;
}
static int lock(token_t verb, token_t obj)
/* Lock, unlock, no object given. Assume various things if present. */
{
if (obj == CLAM || obj == OYSTER)
return bivalve(verb, obj);
if (obj == DOOR)
if (obj == CLAM || obj == OYSTER)
return bivalve(verb, obj);
if (obj == DOOR)
/* Pour. If no object, or object is bottle, assume contents of bottle.
* special tests for pouring water or oil on plant or rusty door. */
{
/* Pour. If no object, or object is bottle, assume contents of bottle.
* special tests for pouring water or oil on plant or rusty door. */
{
return GO_CLEAROBJ;
}
if (HERE(URN) && game.prop[URN] == URN_EMPTY)
return fill(verb, URN);
game.prop[BOTTLE] = EMPTY_BOTTLE;
game.place[obj] = LOC_NOWHERE;
return GO_CLEAROBJ;
}
if (HERE(URN) && game.prop[URN] == URN_EMPTY)
return fill(verb, URN);
game.prop[BOTTLE] = EMPTY_BOTTLE;
game.place[obj] = LOC_NOWHERE;
return GO_CLEAROBJ;
}
pspeak(PLANT, look, game.prop[PLANT] + 3, true);
return GO_CLEAROBJ;
}
pspeak(PLANT, look, game.prop[PLANT] + 3, true);
static int wave(token_t verb, token_t obj)
/* Wave. No effect unless waving rod at fissure or at bird. */
{
static int wave(token_t verb, token_t obj)
/* Wave. No effect unless waving rod at fissure or at bird. */
{
/* FIXME: Arithemetic on property values */
game.prop[FISSURE] = 1 - game.prop[FISSURE];
pspeak(FISSURE, look, 2 - game.prop[FISSURE], true);
/* FIXME: Arithemetic on property values */
game.prop[FISSURE] = 1 - game.prop[FISSURE];
pspeak(FISSURE, look, 2 - game.prop[FISSURE], true);