static void state_change(long obj, long state)
{
game.prop[obj] = state;
- pspeak(obj, change, state);
+ pspeak(obj, change, state, true);
}
static int attack(struct command_t *command)
{
vocab_t verb = command->verb;
vocab_t obj = command->obj;
+
long spk = actions[verb].message;
- if (obj == 0 || obj == INTRANSITIVE) {
- if (atdwrf(game.loc) > 0)
+ if (obj == NO_OBJECT || obj == INTRANSITIVE) {
+ int changes = 0;
+ if (atdwrf(game.loc) > 0) {
obj = DWARF;
- if (HERE(SNAKE))
- obj = obj * NOBJECTS + SNAKE;
- if (AT(DRAGON) && game.prop[DRAGON] == DRAGON_BARS)
- obj = obj * NOBJECTS + DRAGON;
- if (AT(TROLL))
- obj = obj * NOBJECTS + TROLL;
- if (AT(OGRE))
- obj = obj * NOBJECTS + OGRE;
- if (HERE(BEAR) && game.prop[BEAR] == UNTAMED_BEAR)
- obj = obj * NOBJECTS + BEAR;
- if (obj > NOBJECTS)
- return GO_UNKNOWN;
- if (obj == 0) {
+ ++changes;
+ }
+ if (HERE(SNAKE)) {
+ obj = SNAKE;
+ ++changes;
+ }
+ if (AT(DRAGON) && game.prop[DRAGON] == DRAGON_BARS) {
+ obj = DRAGON;
+ ++changes;
+ }
+ if (AT(TROLL)) {
+ obj = TROLL;
+ ++changes;
+ }
+ if (AT(OGRE)) {
+ obj = OGRE;
+ ++changes;
+ }
+ if (HERE(BEAR) && game.prop[BEAR] == UNTAMED_BEAR) {
+ obj = BEAR;
+ ++changes;
+ }
+ /* check for low-priority targets */
+ if (obj == NO_OBJECT) {
/* Can't attack bird or machine by throwing axe. */
- if (HERE(BIRD) && verb != THROW)
+ if (HERE(BIRD) && verb != THROW) {
obj = BIRD;
- if (HERE(VEND) && verb != THROW)
- obj = obj * NOBJECTS + VEND;
+ ++changes;
+ }
+ if (HERE(VEND) && verb != THROW) {
+ obj = VEND;
+ ++changes;
+ }
/* Clam and oyster both treated as clam for intransitive case;
* no harm done. */
- if (HERE(CLAM) || HERE(OYSTER))
- obj = NOBJECTS * obj + CLAM;
- if (obj > NOBJECTS)
- return GO_UNKNOWN;
+ if (HERE(CLAM) || HERE(OYSTER)) {
+ obj = CLAM;
+ ++changes;
+ }
}
+ if (changes >= 2)
+ return GO_UNKNOWN;
+
}
if (obj == BIRD) {
- spk = UNHAPPY_BIRD;
if (game.closed) {
- rspeak(spk);
+ rspeak(UNHAPPY_BIRD);
return GO_CLEAROBJ;
}
DESTROY(BIRD);
return GO_CLEAROBJ;
}
- if (obj == 0)
+ if (obj == NO_OBJECT)
spk = NO_TARGET;
if (obj == CLAM || obj == OYSTER)
spk = SHELL_IMPERVIOUS;
static int bigwords(token_t foo)
/* FEE FIE FOE FOO (AND FUM). Advance to next state if given in proper order.
- * Look up foo in section 3 of vocab to determine which word we've got. Last
- * word zips the eggs back to the giant room (unless already there). */
+ * Look up foo in special section of vocab to determine which word we've got.
+ * Last word zips the eggs back to the giant room (unless already there). */
{
- //int k = vocab(foo, 3);
char word[6];
packed_to_token(foo, word);
int k = (int) get_special_vocab_id(word);
if (game.loc == objects[EGGS].plac)
k = EGGS_HERE;
move(EGGS, objects[EGGS].plac);
- pspeak(EGGS, look, k);
+ pspeak(EGGS, look, k, true);
return GO_CLEAROBJ;
}
}
static int bivalve(token_t verb, token_t obj)
/* Clam/oyster actions */
{
- int spk;
bool is_oyster = (obj == OYSTER);
- 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) {
DESTROY(CLAM);
drop(OYSTER, game.loc);
drop(PEARL, LOC_CULDESAC);
}
- rspeak(spk);
+ rspeak(is_oyster ? OYSTER_OPENS : PEARL_FALLS);
return GO_CLEAROBJ;
}
if (obj == BOTTLE && LIQUID() != 0)
game.place[LIQUID()] = CARRIED;
if (GSTONE(obj) && game.prop[obj] != 0) {
- game.prop[obj] = 0;
+ game.prop[obj] = STATE_GROUND;
game.prop[CAVITY] = CAVITY_EMPTY;
}
rspeak(OK_MAN);
} else if (obj == COINS && HERE(VEND)) {
DESTROY(COINS);
drop(BATTERY, game.loc);
- pspeak(BATTERY, look, FRESH_BATTERIES);
+ pspeak(BATTERY, look, FRESH_BATTERIES, true);
return GO_CLEAROBJ;
} else if (obj == BIRD && AT(DRAGON) && game.prop[DRAGON] == DRAGON_BARS) {
rspeak(BIRD_BURNT);
return GO_CLEAROBJ;
} else if (obj == BEAR && AT(TROLL)) {
rspeak(TROLL_SCAMPERS);
- move(TROLL, 0);
- move(TROLL + NOBJECTS, 0);
+ move(TROLL, LOC_NOWHERE);
+ move(TROLL + NOBJECTS, LOC_NOWHERE);
move(TROLL2, objects[TROLL].plac);
move(TROLL2 + NOBJECTS, objects[TROLL].fixd);
juggle(CHASM);
game.prop[VASE] = VASE_BROKEN;
if (AT(PILLOW))
game.prop[VASE] = VASE_WHOLE;
- pspeak(VASE, look, game.prop[VASE] + 1);
+ pspeak(VASE, look, game.prop[VASE] + 1, true);
if (game.prop[VASE] != VASE_WHOLE)
game.fixed[VASE] = -1;
}
/* Drink. If no object, assume water and look for it here. If water is in
* the bottle, drink that, else must be at a water loc, so drink stream. */
{
- int spk = actions[verb].message;
- if (obj == 0 && LIQLOC(game.loc) != WATER && (LIQUID() != WATER || !HERE(BOTTLE)))
+ if (obj == NO_OBJECT && LIQLOC(game.loc) != WATER && (LIQUID() != WATER || !HERE(BOTTLE)))
return GO_UNKNOWN;
if (obj != BLOOD) {
- if (obj != 0 && obj != WATER)
- spk = RIDICULOUS_ATTEMPT;
- if (spk != RIDICULOUS_ATTEMPT && LIQUID() == WATER && HERE(BOTTLE)) {
+ if (obj != NO_OBJECT && obj != WATER) {
+ rspeak(RIDICULOUS_ATTEMPT);
+ } else if (LIQUID() == WATER && HERE(BOTTLE)) {
game.prop[BOTTLE] = EMPTY_BOTTLE;
game.place[WATER] = LOC_NOWHERE;
- spk = BOTTLE_EMPTY;
+ rspeak(BOTTLE_EMPTY);
+ } else {
+ rspeak(actions[verb].message);
}
- rspeak(spk);
} else {
DESTROY(BLOOD);
state_change(DRAGON, DRAGON_BLOODLESS);
/* Eat. Intransitive: assume food if present, else ask what. Transitive: food
* ok, some things lose appetite, rest are ridiculous. */
{
- int spk = actions[verb].message;
if (obj == INTRANSITIVE) {
if (!HERE(FOOD))
return GO_UNKNOWN;
DESTROY(FOOD);
- 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;
}
- rspeak(spk);
+ if (obj == FOOD) {
+ DESTROY(FOOD);
+ rspeak(THANKS_DELICIOUS);
+ return GO_CLEAROBJ;
+ }
+ if (obj == BIRD || obj == SNAKE || obj == CLAM || obj == OYSTER || obj ==
+ DWARF || obj == DRAGON || obj == TROLL || obj == BEAR || obj ==
+ OGRE) {
+ rspeak(LOST_APPETITE);
+ return GO_CLEAROBJ;
+ }
+ rspeak(actions[verb].message);
return GO_CLEAROBJ;
}
static int extinguish(token_t verb, int obj)
/* Extinguish. Lamp, urn, dragon/volcano (nice try). */
{
- int spk = actions[verb].message;
if (obj == INTRANSITIVE) {
if (HERE(LAMP) && game.prop[LAMP] == LAMP_BRIGHT)
obj = LAMP;
- if (HERE(URN) && game.prop[URN] == 2)
- obj = obj * NOBJECTS + URN;
- if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS)
+ if (HERE(URN) && game.prop[URN] == URN_LIT)
+ obj = URN;
+ if (obj == INTRANSITIVE ||
+ (HERE(LAMP) && game.prop[LAMP] == LAMP_BRIGHT &&
+ HERE(URN) && game.prop[URN] == URN_LIT))
return GO_UNKNOWN;
}
if (obj == URN) {
- game.prop[URN] = game.prop[URN] / 2;
- spk = URN_DARK;
+ if (game.prop[URN] != URN_EMPTY) {
+ state_change(URN, URN_DARK);
+ } else {
+ pspeak(URN, change, URN_DARK, true);
+ }
+
} else if (obj == LAMP) {
state_change(LAMP, LAMP_DARK);
- spk = DARK(game.loc) ? PITCH_DARK : NO_MESSAGE;
- } else if (obj == DRAGON || obj == VOLCANO)
- spk = BEYOND_POWER;
- rspeak(spk);
+ rspeak(DARK(game.loc) ? PITCH_DARK : NO_MESSAGE);
+ } else if (obj == DRAGON || obj == VOLCANO) {
+ rspeak(BEYOND_POWER);
+
+ } else {
+ rspeak(actions[verb].message);
+ }
return GO_CLEAROBJ;
}
return (discard(verb, obj, true));
} else if (obj == URN) {
spk = FULL_URN;
- if (game.prop[URN] != 0) {
+ if (game.prop[URN] != URN_EMPTY) {
rspeak(spk);
return GO_CLEAROBJ;
}
game.place[k] = LOC_NOWHERE;
game.prop[BOTTLE] = EMPTY_BOTTLE;
if (k == OIL)
- game.prop[URN] = 1;
+ game.prop[URN] = URN_DARK;
spk = WATER_URN + game.prop[URN];
rspeak(spk);
return GO_CLEAROBJ;
- } else if (obj != 0 && obj != BOTTLE) {
+ } else if (obj != NO_OBJECT && obj != BOTTLE) {
rspeak(spk);
return GO_CLEAROBJ;
- } else if (obj == 0 && !HERE(BOTTLE))
+ } else if (obj == NO_OBJECT && !HERE(BOTTLE))
return GO_UNKNOWN;
spk = BOTTLED_WATER;
if (LIQLOC(game.loc) == 0)
spk = NO_LIQUID;
- if (HERE(URN) && game.prop[URN] != 0)
+ if (HERE(URN) && game.prop[URN] != URN_EMPTY)
spk = URN_NOPOUR;
if (LIQUID() != 0)
spk = BOTTLE_FULL;
static int fly(token_t verb, token_t obj)
/* Fly. Snide remarks unless hovering rug is here. */
{
- int spk = actions[verb].message;
if (obj == INTRANSITIVE) {
- if (game.prop[RUG] != RUG_HOVER)
- spk = RUG_NOTHING2;
- if (!HERE(RUG))
- spk = FLAP_ARMS;
- if (spk == RUG_NOTHING2 || spk == FLAP_ARMS) {
- rspeak(spk);
+ if (!HERE(RUG)) {
+ rspeak(FLAP_ARMS);
+ return GO_CLEAROBJ;
+ }
+ if (game.prop[RUG] != RUG_HOVER) {
+ rspeak(RUG_NOTHING2);
return GO_CLEAROBJ;
}
obj = RUG;
}
if (obj != RUG) {
- rspeak(spk);
+ rspeak(actions[verb].message);
return GO_CLEAROBJ;
}
- spk = RUG_NOTHING1;
if (game.prop[RUG] != RUG_HOVER) {
- rspeak(spk);
+ rspeak(RUG_NOTHING1);
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;
- spk = RUG_GOES;
- if (game.prop[SAPPH] >= 0)
- spk = RUG_RETURNS;
- rspeak(spk);
+
+ if (game.prop[SAPPH] >= 0) {
+ rspeak(RUG_RETURNS);
+ } else {
+ rspeak(RUG_GOES);
+ }
return GO_TERMINATE;
}
continue;
if (spk == NO_CARRY)
rspeak(NOW_HOLDING);
- game.blklin = false;
- pspeak(i, touch, -1);
- game.blklin = true;
+ pspeak(i, touch, -1, false);
spk = NO_MESSAGE;
}
if (TOTING(BEAR))
static int light(token_t verb, token_t obj)
/* Light. Applicable only to lamp and urn. */
{
- int spk = actions[verb].message;
if (obj == INTRANSITIVE) {
if (HERE(LAMP) && game.prop[LAMP] == LAMP_DARK && game.limit >= 0)
obj = LAMP;
- if (HERE(URN) && game.prop[URN] == 1)
- obj = obj * NOBJECTS + URN;
- if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS)
+ if (HERE(URN) && game.prop[URN] == URN_DARK)
+ obj = URN;
+ if (obj == INTRANSITIVE ||
+ (HERE(LAMP) && game.prop[LAMP] == LAMP_DARK && game.limit >= 0 &&
+ HERE(URN) && game.prop[URN] == URN_DARK))
return GO_UNKNOWN;
}
if (obj == URN) {
- if (game.prop[URN] == 0) {
- rspeak(URN_EMPTY);
- } else {
- game.prop[URN] = 2;
- rspeak(URN_LIT);
- }
+ state_change(URN, game.prop[URN] == URN_EMPTY ? URN_EMPTY : URN_LIT);
return GO_CLEAROBJ;
} else {
if (obj != LAMP) {
- rspeak(spk);
+ rspeak(actions[verb].message);
return GO_CLEAROBJ;
}
- spk = LAMP_OUT;
if (game.limit < 0) {
- rspeak(spk);
+ rspeak(LAMP_OUT);
return GO_CLEAROBJ;
}
state_change(LAMP, LAMP_BRIGHT);
static int listen(void)
/* Listen. Intransitive only. Print stuff based on objsnd/locsnd. */
{
- long k;
- int spk = ALL_SILENT;
- k = locations[game.loc].sound;
- if (k != SILENT) {
- rspeak(k);
- if (locations[game.loc].loud)
- return GO_CLEAROBJ;
- else
- spk = NO_MESSAGE;
+ long sound = locations[game.loc].sound;
+ if (sound != SILENT) {
+ rspeak(sound);
+ if (!locations[game.loc].loud)
+ rspeak(NO_MESSAGE);
+ return GO_CLEAROBJ;
}
for (int i = 1; i <= NOBJECTS; i++) {
if (!HERE(i) || objects[i].sounds[0] == NULL || game.prop[i] < 0)
if (i == BIRD)
mi += 3 * game.blooded;
long packed_zzword = token_to_packed(game.zzword);
- pspeak(i, hear, mi, packed_zzword);
- spk = NO_MESSAGE;
+ pspeak(i, hear, mi, true, packed_zzword);
+ rspeak(NO_MESSAGE);
/* FIXME: Magic number, sensitive to bird state logic */
if (i == BIRD && game.prop[i] == 5)
DESTROY(BIRD);
+ return GO_CLEAROBJ;
}
- rspeak(spk);
+ rspeak(ALL_SILENT);
return GO_CLEAROBJ;
}
static int lock(token_t verb, token_t obj)
/* Lock, unlock, no object given. Assume various things if present. */
{
- int spk = actions[verb].message;
if (obj == INTRANSITIVE) {
- spk = NOTHING_LOCKED;
if (HERE(CLAM))
obj = CLAM;
if (HERE(OYSTER))
obj = DOOR;
if (AT(GRATE))
obj = GRATE;
- if (obj != 0 && HERE(CHAIN))
- return GO_UNKNOWN;
if (HERE(CHAIN))
obj = CHAIN;
- if (obj == 0 || obj == INTRANSITIVE) {
- rspeak(spk);
+ if (obj == NO_OBJECT || obj == INTRANSITIVE) {
+ rspeak(NOTHING_LOCKED);
return GO_CLEAROBJ;
}
}
/* Lock, unlock object. Special stuff for opening clam/oyster
* and for chain. */
+ int spk = actions[verb].message;
if (obj == CLAM || obj == OYSTER)
return bivalve(verb, obj);
if (obj == DOOR)
- spk = RUSTY_DOOR;
- if (obj == DOOR && game.prop[DOOR] == 1)
- spk = OK_MAN;
+ spk = (game.prop[DOOR] == DOOR_UNRUSTED) ? OK_MAN : RUSTY_DOOR;
if (obj == CAGE)
spk = NO_LOCK;
if (obj == KEYS)
/* Pour. If no object, or object is bottle, assume contents of bottle.
* special tests for pouring water or oil on plant or rusty door. */
{
- int spk = actions[verb].message;
- if (obj == BOTTLE || obj == 0)
+ if (obj == BOTTLE || obj == NO_OBJECT)
obj = LIQUID();
- if (obj == 0)
+ if (obj == NO_OBJECT)
return GO_UNKNOWN;
if (!TOTING(obj)) {
- rspeak(spk);
+ rspeak(actions[verb].message);
return GO_CLEAROBJ;
}
- spk = CANT_POUR;
+
if (obj != OIL && obj != WATER) {
- rspeak(spk);
+ rspeak(CANT_POUR);
return GO_CLEAROBJ;
}
- if (HERE(URN) && game.prop[URN] == 0)
+ if (HERE(URN) && game.prop[URN] == URN_EMPTY)
return fill(verb, URN);
game.prop[BOTTLE] = EMPTY_BOTTLE;
game.place[obj] = LOC_NOWHERE;
- spk = GROUND_WET;
if (!(AT(PLANT) || AT(DOOR))) {
- rspeak(spk);
+ rspeak(GROUND_WET);
return GO_CLEAROBJ;
}
if (!AT(DOOR)) {
- spk = SHAKING_LEAVES;
if (obj != WATER) {
- rspeak(spk);
+ rspeak(SHAKING_LEAVES);
return GO_CLEAROBJ;
}
- pspeak(PLANT, look, game.prop[PLANT] + 3);
+ pspeak(PLANT, look, game.prop[PLANT] + 3, true);
game.prop[PLANT] = MOD(game.prop[PLANT] + 1, 3);
game.prop[PLANT2] = game.prop[PLANT];
return GO_MOVE;
} else if (objects[command.obj].texts[0] == NULL || game.prop[command.obj] < 0) {
rspeak(actions[command.verb].message);
} else
- pspeak(command.obj, study, game.prop[command.obj]);
+ pspeak(command.obj, study, game.prop[command.obj], true);
return GO_CLEAROBJ;
}
rspeak(NOTHING_HAPPENS);
return GO_CLEAROBJ;
} else {
- pspeak(RESER, look, game.prop[RESER] + 1);
+ pspeak(RESER, look, game.prop[RESER] + 1, true);
game.prop[RESER] = 1 - game.prop[RESER];
if (AT(RESER))
return GO_CLEAROBJ;
static int rub(token_t verb, token_t obj)
/* Rub. Yields various snide remarks except for lit urn. */
{
- int spk = actions[verb].message;
- if (obj != LAMP)
- spk = PECULIAR_NOTHING;
- if (obj == URN && game.prop[URN] == 2) {
+ if (obj == URN && game.prop[URN] == URN_LIT) {
DESTROY(URN);
drop(AMBER, game.loc);
- game.prop[AMBER] = 1;
+ game.prop[AMBER] = AMBER_IN_ROCK;
--game.tally;
drop(CAVITY, game.loc);
- spk = URN_GENIES;
+ rspeak(URN_GENIES);
+ } else if (obj != LAMP) {
+ rspeak(PECULIAR_NOTHING);
+ } else {
+ rspeak(actions[verb].message);
}
- rspeak(spk);
return GO_CLEAROBJ;
}
b = command->wd2x;
command->wd1 = command->wd2;
}
- //int wd = vocab(command->wd1, -1);
char word1[6];
packed_to_token(command->wd1, word1);
int wd = (int) get_vocab_id(word1);
/* FIXME: magic numbers */
- if (wd == XYZZY || wd == PLUGH || wd == PLOVER || wd == ACTION_WORD(GIANTWORDS) || wd == ACTION_WORD(PART)) {
+ if (wd == MOTION_WORD(XYZZY) || wd == MOTION_WORD(PLUGH) || wd == MOTION_WORD(PLOVER) || wd == ACTION_WORD(GIANTWORDS) || wd == ACTION_WORD(PART)) {
/* FIXME: scribbles on the interpreter's command block */
wordclear(&command->wd2);
return GO_LOOKUP;
* (Only way to do so!) Axe also special for dragon, bear, and
* troll. Treasures special for troll. */
{
- int spk = actions[command->verb].message;
if (TOTING(ROD2) && command->obj == ROD && !TOTING(ROD))
command->obj = ROD2;
if (!TOTING(command->obj)) {
- rspeak(spk);
+ rspeak(actions[command->verb].message);
return GO_CLEAROBJ;
}
if (objects[command->obj].is_treasure && AT(TROLL)) {
- spk = TROLL_SATISFIED;
/* Snarf a treasure for the troll. */
- drop(command->obj, 0);
- move(TROLL, 0);
- move(TROLL + NOBJECTS, 0);
+ drop(command->obj, LOC_NOWHERE);
+ move(TROLL, LOC_NOWHERE);
+ move(TROLL + NOBJECTS, LOC_NOWHERE);
drop(TROLL2, objects[TROLL].plac);
drop(TROLL2 + NOBJECTS, objects[TROLL].fixd);
juggle(CHASM);
- rspeak(spk);
+ rspeak(TROLL_SATISFIED);
return GO_CLEAROBJ;
}
if (command->obj == FOOD && HERE(BEAR)) {
if (command->obj != AXE)
return (discard(command->verb, command->obj, false));
else {
- int i = atdwrf(game.loc);
- if (i <= 0) {
+ if (atdwrf(game.loc) <= 0) {
if (AT(DRAGON) && game.prop[DRAGON] == DRAGON_BARS)
return throw_support(DRAGON_SCALES);
if (AT(TROLL))
/* This'll teach him to throw the axe at the bear! */
drop(AXE, game.loc);
game.fixed[AXE] = -1;
- game.prop[AXE] = 1;
juggle(BEAR);
- rspeak(AXE_LOST);
+ state_change(AXE, AXE_LOST);
return GO_CLEAROBJ;
}
- command->obj = 0;
+ command->obj = NO_OBJECT;
return (attack(command));
}
if (randrange(NDWARVES + 1) < game.dflag) {
return throw_support(DWARF_DODGES);
} else {
+ long i = atdwrf(game.loc);
game.dseen[i] = false;
game.dloc[i] = 0;
return throw_support((++game.dkill == 1)
static int wave(token_t verb, token_t obj)
/* Wave. No effect unless waving rod at fissure or at bird. */
{
- int spk = actions[verb].message;
- if ((!TOTING(obj)) && (obj != ROD || !TOTING(ROD2)))
- spk = ARENT_CARRYING;
if (obj != ROD ||
!TOTING(obj) ||
(!HERE(BIRD) && (game.closng || !AT(FISSURE)))) {
- rspeak(spk);
+ rspeak(((!TOTING(obj)) && (obj != ROD || !TOTING(ROD2))) ? ARENT_CARRYING : actions[verb].message);
return GO_CLEAROBJ;
}
- /* FIXME: Arithemetic on property values */
- if (HERE(BIRD))
- spk = FREE_FLY + MOD(game.prop[BIRD], 2);
- if (spk == FREE_FLY && game.loc == game.place[STEPS] && game.prop[JADE] < 0) {
+
+ if (game.prop[BIRD] == BIRD_UNCAGED && game.loc == game.place[STEPS] && game.prop[JADE] < 0) {
drop(JADE, game.loc);
game.prop[JADE] = 0;
--game.tally;
- spk = NECKLACE_FLY;
- rspeak(spk);
+ rspeak(NECKLACE_FLY);
return GO_CLEAROBJ;
} else {
if (game.closed) {
- rspeak(spk);
+ rspeak((game.prop[BIRD] == BIRD_CAGED) ? CAGE_FLY : FREE_FLY);
return GO_DWARFWAKE;
}
if (game.closng || !AT(FISSURE)) {
- rspeak(spk);
+ rspeak((game.prop[BIRD] == BIRD_CAGED) ? CAGE_FLY : FREE_FLY);
return GO_CLEAROBJ;
}
if (HERE(BIRD))
- rspeak(spk);
+ rspeak((game.prop[BIRD] == BIRD_CAGED) ? CAGE_FLY : FREE_FLY);
+
+ /* FIXME: Arithemetic on property values */
game.prop[FISSURE] = 1 - game.prop[FISSURE];
- pspeak(FISSURE, look, 2 - game.prop[FISSURE]);
+ pspeak(FISSURE, look, 2 - game.prop[FISSURE], true);
return GO_CLEAROBJ;
}
}
* unless verb is "say", which snarfs arbitrary second word.
*/
{
- token_t spk = actions[command->verb].message;
-
if (command->part == unknown) {
/* Analyse an object word. See if the thing is here, whether
* we've got a verb yet, and so on. Object must be here
/* FALL THROUGH */;
} else if (command->obj == KNIFE && game.knfloc == game.loc) {
game.knfloc = -1;
- spk = KNIVES_VANISH;
- rspeak(spk);
+ rspeak(KNIVES_VANISH);
return GO_CLEAROBJ;
} else if (command->obj == ROD && HERE(ROD2)) {
command->obj = ROD2;
case TAME:
return GO_UNKNOWN;
case GO: {
- rspeak(spk);
+ rspeak(actions[command->verb].message);
return GO_CLEAROBJ;
}
case ATTACK:
case WAVE:
return wave(command->verb, command->obj);
case TAME: {
- rspeak(spk);
+ rspeak(actions[command->verb].message);
return GO_CLEAROBJ;
}
case GO: {
- rspeak(spk);
+ rspeak(actions[command->verb].message);
return GO_CLEAROBJ;
}
case ATTACK:
case THROW:
return throw (command);
case QUIT: {
- rspeak(spk);
+ rspeak(actions[command->verb].message);
return GO_CLEAROBJ;
}
case FIND:
blast();
return GO_CLEAROBJ;
case SCORE: {
- rspeak(spk);
+ rspeak(actions[command->verb].message);
return GO_CLEAROBJ;
}
case GIANTWORDS: {
- rspeak(spk);
+ rspeak(actions[command->verb].message);
return GO_CLEAROBJ;
}
case BRIEF: {
- rspeak(spk);
+ rspeak(actions[command->verb].message);
return GO_CLEAROBJ;
}
case READ:
case WAKE:
return wake(command->verb, command->obj);
case SAVE: {
- rspeak(spk);
+ rspeak(actions[command->verb].message);
return GO_CLEAROBJ;
}
case RESUME: {
- rspeak(spk);
+ rspeak(actions[command->verb].message);
return GO_CLEAROBJ;
}
case FLY:
return fly(command->verb, command->obj);
case LISTEN: {
- rspeak(spk);
+ rspeak(actions[command->verb].message);
return GO_CLEAROBJ;
}
case PART: