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)
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;
}
}
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);
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;
}
if (game.prop[URN] != URN_EMPTY) {
state_change(URN, URN_DARK);
} else {
- pspeak(URN, change, URN_DARK);
+ pspeak(URN, change, URN_DARK, true);
}
} else if (obj == LAMP) {
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;
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;
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))
if (i == BIRD)
mi += 3 * game.blooded;
long packed_zzword = token_to_packed(game.zzword);
- pspeak(i, hear, mi, packed_zzword);
+ pspeak(i, hear, mi, true, packed_zzword);
spk = NO_MESSAGE;
/* FIXME: Magic number, sensitive to bird state logic */
if (i == BIRD && game.prop[i] == 5)
rspeak(spk);
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] == 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;
if (HERE(BIRD))
rspeak(spk);
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;
}
}