projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Entirely eliminate wd1x and wd2x members of the command block.
[open-adventure.git]
/
actions.c
diff --git
a/actions.c
b/actions.c
index 95a94b821d15c888041e288d483e42933e6559b7..b079bd352f863da9e3dab42a30da543b34efa5a9 100644
(file)
--- a/
actions.c
+++ b/
actions.c
@@
-1,5
+1,6
@@
#include <stdlib.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdbool.h>
+#include <string.h>
#include "advent.h"
#include "dungeon.h"
#include "advent.h"
#include "dungeon.h"
@@
-20,11
+21,9
@@
static int attack(struct command_t *command)
vocab_t verb = command->verb;
vocab_t obj = command->obj;
vocab_t verb = command->verb;
vocab_t obj = command->obj;
- if (obj == INTRANSITIVE) {
- return GO_UNKNOWN;
- }
long spk = actions[verb].message;
long spk = actions[verb].message;
- if (obj == 0 || obj == INTRANSITIVE) {
+ if (obj == NO_OBJECT ||
+ obj == INTRANSITIVE) {
int changes = 0;
if (atdwrf(game.loc) > 0) {
obj = DWARF;
int changes = 0;
if (atdwrf(game.loc) > 0) {
obj = DWARF;
@@
-51,7
+50,7
@@
static int attack(struct command_t *command)
++changes;
}
/* check for low-priority targets */
++changes;
}
/* check for low-priority targets */
- if (obj ==
0
) {
+ if (obj ==
NO_OBJECT
) {
/* Can't attack bird or machine by throwing axe. */
if (HERE(BIRD) && verb != THROW) {
obj = BIRD;
/* Can't attack bird or machine by throwing axe. */
if (HERE(BIRD) && verb != THROW) {
obj = BIRD;
@@
-85,9
+84,10
@@
static int attack(struct command_t *command)
return GO_CLEAROBJ;
}
return GO_CLEAROBJ;
}
- if (obj ==
0
)
+ if (obj ==
NO_OBJECT
)
spk = NO_TARGET;
spk = NO_TARGET;
- if (obj == CLAM || obj == OYSTER)
+ if (obj == CLAM ||
+ obj == OYSTER)
spk = SHELL_IMPERVIOUS;
if (obj == SNAKE)
spk = SNAKE_WARNING;
spk = SHELL_IMPERVIOUS;
if (obj == SNAKE)
spk = SNAKE_WARNING;
@@
-113,7
+113,9
@@
static int attack(struct command_t *command)
game.dseen[i] = false;
}
}
game.dseen[i] = false;
}
}
- spk = (dwarves > 1) ? OGRE_PANIC1 : OGRE_PANIC2;
+ spk = (dwarves > 1) ?
+ OGRE_PANIC1 :
+ OGRE_PANIC2;
} else if (obj == BEAR) {
switch (game.prop[BEAR]) {
case UNTAMED_BEAR:
} else if (obj == BEAR) {
switch (game.prop[BEAR]) {
case UNTAMED_BEAR:
@@
-153,7
+155,8
@@
static int attack(struct command_t *command)
move(RUG, k);
drop(BLOOD, k);
for (obj = 1; obj <= NOBJECTS; obj++) {
move(RUG, k);
drop(BLOOD, k);
for (obj = 1; obj <= NOBJECTS; obj++) {
- if (game.place[obj] == objects[DRAGON].plac || game.place[obj] == objects[DRAGON].fixd)
+ if (game.place[obj] == objects[DRAGON].plac ||
+ game.place[obj] == objects[DRAGON].fixd)
move(obj, k);
}
game.loc = k;
move(obj, k);
}
game.loc = k;
@@
-169,7
+172,7
@@
static int bigwords(token_t foo)
* 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). */
{
* 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). */
{
- char word[
6
];
+ char word[
TOKLEN+1
];
packed_to_token(foo, word);
int k = (int) get_special_vocab_id(word);
int spk = NOTHING_HAPPENS;
packed_to_token(foo, word);
int k = (int) get_special_vocab_id(word);
int spk = NOTHING_HAPPENS;
@@
-185,7
+188,8
@@
static int bigwords(token_t foo)
return GO_CLEAROBJ;
}
game.foobar = 0;
return GO_CLEAROBJ;
}
game.foobar = 0;
- if (game.place[EGGS] == objects[EGGS].plac || (TOTING(EGGS) && game.loc == objects[EGGS].plac)) {
+ if (game.place[EGGS] == objects[EGGS].plac ||
+ (TOTING(EGGS) && game.loc == objects[EGGS].plac)) {
rspeak(spk);
return GO_CLEAROBJ;
} else {
rspeak(spk);
return GO_CLEAROBJ;
} else {
@@
-208,28
+212,40
@@
static int bigwords(token_t foo)
static int bivalve(token_t verb, token_t obj)
/* Clam/oyster actions */
{
static int bivalve(token_t verb, token_t obj)
/* Clam/oyster actions */
{
- int spk;
bool is_oyster = (obj == OYSTER);
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);
}
DESTROY(CLAM);
drop(OYSTER, game.loc);
drop(PEARL, LOC_CULDESAC);
}
- rspeak(spk);
+ rspeak(is_oyster ?
+ OYSTER_OPENS :
+ PEARL_FALLS);
return GO_CLEAROBJ;
}
static void blast(void)
/* Blast. No effect unless you've got dynamite, which is a neat trick! */
{
return GO_CLEAROBJ;
}
static void blast(void)
/* Blast. No effect unless you've got dynamite, which is a neat trick! */
{
- if (game.prop[ROD2] < 0 || !game.closed)
+ if (game.prop[ROD2] < 0 ||
+ !game.closed)
rspeak(REQUIRES_DYNAMITE);
else {
game.bonus = VICTORY_MESSAGE;
rspeak(REQUIRES_DYNAMITE);
else {
game.bonus = VICTORY_MESSAGE;
@@
-319,8
+335,10
@@
static int vcarry(token_t verb, token_t obj)
rspeak(spk);
return GO_CLEAROBJ;
}
rspeak(spk);
return GO_CLEAROBJ;
}
- if (obj == WATER || obj == OIL) {
- if (!HERE(BOTTLE) || LIQUID() != obj) {
+ if (obj == WATER ||
+ obj == OIL) {
+ if (!HERE(BOTTLE) ||
+ LIQUID() != obj) {
if (TOTING(BOTTLE) && game.prop[BOTTLE] == EMPTY_BOTTLE)
return (fill(verb, BOTTLE));
else {
if (TOTING(BOTTLE) && game.prop[BOTTLE] == EMPTY_BOTTLE)
return (fill(verb, BOTTLE));
else {
@@
-349,13
+367,18
@@
static int vcarry(token_t verb, token_t obj)
spk = CANNOT_CARRY;
if (TOTING(ROD))
spk = BIRD_EVADES;
spk = CANNOT_CARRY;
if (TOTING(ROD))
spk = BIRD_EVADES;
- if (spk == CANNOT_CARRY || spk == BIRD_EVADES) {
+ if (spk == CANNOT_CARRY ||
+ spk == BIRD_EVADES) {
rspeak(spk);
return GO_CLEAROBJ;
}
game.prop[BIRD] = BIRD_CAGED;
}
rspeak(spk);
return GO_CLEAROBJ;
}
game.prop[BIRD] = BIRD_CAGED;
}
- if ((obj == BIRD || obj == CAGE) && (game.prop[BIRD] == BIRD_CAGED || -1 - game.prop[BIRD] == 1))
+ /* FIXME: Arithmetic on state numbers */
+ if ((obj == BIRD ||
+ obj == CAGE) &&
+ (game.prop[BIRD] == BIRD_CAGED ||
+ -1 - game.prop[BIRD] == 1))
carry(BIRD + CAGE - obj, game.loc);
carry(obj, game.loc);
if (obj == BOTTLE && LIQUID() != 0)
carry(BIRD + CAGE - obj, game.loc);
carry(obj, game.loc);
if (obj == BOTTLE && LIQUID() != 0)
@@
-432,8
+455,8
@@
static int discard(token_t verb, token_t obj, bool just_do_it)
rspeak(GEM_FITS);
game.prop[obj] = 1;
game.prop[CAVITY] = CAVITY_FULL;
rspeak(GEM_FITS);
game.prop[obj] = 1;
game.prop[CAVITY] = CAVITY_FULL;
- if (HERE(RUG) && ((obj == EMERALD && game.prop[RUG] != RUG_HOVER) ||
(obj == RUBY &&
- game.prop[RUG] == RUG_HOVER))) {
+ if (HERE(RUG) && ((obj == EMERALD && game.prop[RUG] != RUG_HOVER) ||
+
(obj == RUBY &&
game.prop[RUG] == RUG_HOVER))) {
spk = RUG_RISES;
if (TOTING(RUG))
spk = RUG_WIGGLES;
spk = RUG_RISES;
if (TOTING(RUG))
spk = RUG_WIGGLES;
@@
-460,13
+483,14
@@
static int discard(token_t verb, token_t obj, bool just_do_it)
return GO_CLEAROBJ;
} else if (obj == BEAR && AT(TROLL)) {
rspeak(TROLL_SCAMPERS);
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[TROLL] = TROLL_GONE;
move(TROLL2, objects[TROLL].plac);
move(TROLL2 + NOBJECTS, objects[TROLL].fixd);
juggle(CHASM);
game.prop[TROLL] = TROLL_GONE;
- } else if (obj != VASE || game.loc == objects[PILLOW].plac) {
+ } else if (obj != VASE ||
+ game.loc == objects[PILLOW].plac) {
rspeak(OK_MAN);
} else {
game.prop[VASE] = VASE_BROKEN;
rspeak(OK_MAN);
} else {
game.prop[VASE] = VASE_BROKEN;
@@
-497,18
+521,19
@@
static int drink(token_t verb, token_t obj)
/* 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. */
{
/* 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. */
{
- i
nt spk = actions[verb].message;
-
if (obj == 0 && LIQLOC(game.loc) != WATER && (LIQUID() != WATER ||
!HERE(BOTTLE)))
+ i
f (obj == NO_OBJECT && LIQLOC(game.loc) != WATER && (LIQUID() != WATER ||
+
!HERE(BOTTLE)))
return GO_UNKNOWN;
if (obj != BLOOD) {
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;
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);
} else {
DESTROY(BLOOD);
state_change(DRAGON, DRAGON_BLOODLESS);
@@
-521,23
+546,31
@@
static int eat(token_t verb, token_t obj)
/* 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. */
{
- int spk = actions[verb].message;
if (obj == INTRANSITIVE) {
if (!HERE(FOOD))
return GO_UNKNOWN;
DESTROY(FOOD);
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;
}
return GO_CLEAROBJ;
}
@@
-559,13
+592,17
@@
static int extinguish(token_t verb, int obj)
if (game.prop[URN] != URN_EMPTY) {
state_change(URN, URN_DARK);
} else {
if (game.prop[URN] != URN_EMPTY) {
state_change(URN, URN_DARK);
} else {
- pspeak(URN, change, URN_DARK, true);
+
pspeak(URN, change, URN_DARK, true);
}
} else if (obj == LAMP) {
state_change(LAMP, LAMP_DARK);
}
} else if (obj == LAMP) {
state_change(LAMP, LAMP_DARK);
- rspeak(DARK(game.loc) ? PITCH_DARK : NO_MESSAGE);
- } else if (obj == DRAGON || obj == VOLCANO) {
+ rspeak(DARK(game.loc) ?
+ PITCH_DARK :
+ NO_MESSAGE);
+
+ } else if (obj == DRAGON ||
+ obj == VOLCANO) {
rspeak(BEYOND_POWER);
} else {
rspeak(BEYOND_POWER);
} else {
@@
-582,7
+619,9
@@
static int feed(token_t verb, token_t obj)
if (obj == BIRD) {
rspeak(BIRD_PINING);
return GO_CLEAROBJ;
if (obj == BIRD) {
rspeak(BIRD_PINING);
return GO_CLEAROBJ;
- } else if (obj == SNAKE || obj == DRAGON || obj == TROLL) {
+ } else if (obj == SNAKE ||
+ obj == DRAGON ||
+ obj == TROLL) {
spk = NOTHING_EDIBLE;
if (obj == DRAGON && game.prop[DRAGON] != DRAGON_BARS)
spk = RIDICULOUS_ATTEMPT;
spk = NOTHING_EDIBLE;
if (obj == DRAGON && game.prop[DRAGON] != DRAGON_BARS)
spk = RIDICULOUS_ATTEMPT;
@@
-629,7
+668,8
@@
int fill(token_t verb, token_t obj)
spk = ARENT_CARRYING;
if (LIQLOC(game.loc) == 0)
spk = FILL_INVALID;
spk = ARENT_CARRYING;
if (LIQLOC(game.loc) == 0)
spk = FILL_INVALID;
- if (LIQLOC(game.loc) == 0 || !TOTING(VASE)) {
+ if (LIQLOC(game.loc) == 0 ||
+ !TOTING(VASE)) {
rspeak(spk);
return GO_CLEAROBJ;
}
rspeak(spk);
return GO_CLEAROBJ;
}
@@
-645,7
+685,8
@@
int fill(token_t verb, token_t obj)
}
spk = FILL_INVALID;
k = LIQUID();
}
spk = FILL_INVALID;
k = LIQUID();
- if (k == 0 || !HERE(BOTTLE)) {
+ if (k == 0 ||
+ !HERE(BOTTLE)) {
rspeak(spk);
return GO_CLEAROBJ;
}
rspeak(spk);
return GO_CLEAROBJ;
}
@@
-656,10
+697,10
@@
int fill(token_t verb, token_t obj)
spk = WATER_URN + game.prop[URN];
rspeak(spk);
return GO_CLEAROBJ;
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;
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)
return GO_UNKNOWN;
spk = BOTTLED_WATER;
if (LIQLOC(game.loc) == 0)
@@
-701,36
+742,36
@@
static int find(token_t verb, token_t obj)
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. */
{
- int spk = actions[verb].message;
if (obj == INTRANSITIVE) {
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) {
return GO_CLEAROBJ;
}
obj = RUG;
}
if (obj != RUG) {
- rspeak(
spk
);
+ rspeak(
actions[verb].message
);
return GO_CLEAROBJ;
}
return GO_CLEAROBJ;
}
- spk = RUG_NOTHING1;
if (game.prop[RUG] != RUG_HOVER) {
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;
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;
}
return GO_TERMINATE;
}
@@
-739,7
+780,8
@@
static int inven(void)
{
int spk = NO_CARRY;
for (int i = 1; i <= NOBJECTS; i++) {
{
int spk = NO_CARRY;
for (int i = 1; i <= NOBJECTS; i++) {
- if (i == BEAR || !TOTING(i))
+ if (i == BEAR ||
+ !TOTING(i))
continue;
if (spk == NO_CARRY)
rspeak(NOW_HOLDING);
continue;
if (spk == NO_CARRY)
rspeak(NOW_HOLDING);
@@
-767,7
+809,9
@@
static int light(token_t verb, token_t obj)
}
if (obj == URN) {
}
if (obj == URN) {
- state_change(URN, game.prop[URN] == URN_EMPTY ? URN_EMPTY : URN_LIT);
+ state_change(URN, game.prop[URN] == URN_EMPTY ?
+ URN_EMPTY :
+ URN_LIT);
return GO_CLEAROBJ;
} else {
if (obj != LAMP) {
return GO_CLEAROBJ;
} else {
if (obj != LAMP) {
@@
-789,39
+833,37
@@
static int light(token_t verb, token_t obj)
static int listen(void)
/* Listen. Intransitive only. Print stuff based on objsnd/locsnd. */
{
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++) {
}
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)
continue;
int mi = game.prop[i];
if (i == BIRD)
mi += 3 * game.blooded;
long packed_zzword = token_to_packed(game.zzword);
pspeak(i, hear, mi, true, packed_zzword);
continue;
int mi = game.prop[i];
if (i == BIRD)
mi += 3 * game.blooded;
long packed_zzword = token_to_packed(game.zzword);
pspeak(i, hear, mi, true, packed_zzword);
-
spk = NO_MESSAGE
;
+
rspeak(NO_MESSAGE)
;
/* 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;
}
}
- 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. */
{
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) {
if (obj == INTRANSITIVE) {
- spk = NOTHING_LOCKED;
if (HERE(CLAM))
obj = CLAM;
if (HERE(OYSTER))
if (HERE(CLAM))
obj = CLAM;
if (HERE(OYSTER))
@@
-832,25
+874,26
@@
static int lock(token_t verb, token_t obj)
obj = GRATE;
if (HERE(CHAIN))
obj = CHAIN;
obj = GRATE;
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. */
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)
if (obj == CLAM || obj == OYSTER)
return bivalve(verb, obj);
if (obj == DOOR)
- spk = RUSTY_DOOR;
- if (obj == DOOR && game.prop[DOOR] == DOOR_UNRUSTED)
- spk = OK_MAN;
+ spk = (game.prop[DOOR] == DOOR_UNRUSTED) ? OK_MAN : RUSTY_DOOR;
if (obj == CAGE)
spk = NO_LOCK;
if (obj == KEYS)
spk = CANNOT_UNLOCK;
if (obj == CAGE)
spk = NO_LOCK;
if (obj == KEYS)
spk = CANNOT_UNLOCK;
- if (obj == GRATE || obj == CHAIN) {
+ if (obj == GRATE ||
+ obj == CHAIN) {
spk = NO_KEYS;
if (HERE(KEYS)) {
if (obj == CHAIN)
spk = NO_KEYS;
if (HERE(KEYS)) {
if (obj == CHAIN)
@@
-861,7
+904,9
@@
static int lock(token_t verb, token_t obj)
game.clock2 = PANICTIME;
game.panic = true;
} else {
game.clock2 = PANICTIME;
game.panic = true;
} else {
- state_change(GRATE, (verb == LOCK) ? GRATE_CLOSED : GRATE_OPEN);
+ state_change(GRATE, (verb == LOCK) ?
+ GRATE_CLOSED :
+ GRATE_OPEN);
return GO_CLEAROBJ;
}
}
return GO_CLEAROBJ;
}
}
@@
-874,41
+919,43
@@
static int pour(token_t verb, token_t obj)
/* 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. */
{
- i
nt spk = actions[verb].message;
-
if (obj == BOTTLE || obj == 0
)
+ i
f (obj == BOTTLE ||
+
obj == NO_OBJECT
)
obj = LIQUID();
obj = LIQUID();
- if (obj ==
0
)
+ if (obj ==
NO_OBJECT
)
return GO_UNKNOWN;
if (!TOTING(obj)) {
return GO_UNKNOWN;
if (!TOTING(obj)) {
- rspeak(
spk
);
+ rspeak(
actions[verb].message
);
return GO_CLEAROBJ;
}
return GO_CLEAROBJ;
}
- spk = CANT_POUR;
+
if (obj != OIL && obj != WATER) {
if (obj != OIL && obj != WATER) {
- rspeak(
spk
);
+ rspeak(
CANT_POUR
);
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;
- spk = GROUND_WET;
-
if (!(AT(PLANT) ||
AT(DOOR))) {
- rspeak(
spk
);
+ if (!(AT(PLANT) ||
+
AT(DOOR))) {
+ rspeak(
GROUND_WET
);
return GO_CLEAROBJ;
}
if (!AT(DOOR)) {
return GO_CLEAROBJ;
}
if (!AT(DOOR)) {
- spk = SHAKING_LEAVES;
if (obj != WATER) {
if (obj != WATER) {
- rspeak(
spk
);
+ rspeak(
SHAKING_LEAVES
);
return GO_CLEAROBJ;
}
return GO_CLEAROBJ;
}
+ /* FIXME: Arithmetic on state numbers */
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 {
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 {
- state_change(DOOR, (obj == OIL) ? DOOR_UNRUSTED : DOOR_RUSTED);
+ state_change(DOOR, (obj == OIL) ?
+ DOOR_UNRUSTED :
+ DOOR_RUSTED);
return GO_CLEAROBJ;
}
}
return GO_CLEAROBJ;
}
}
@@
-930,35
+977,40
@@
static int read(struct command_t command)
if (HERE(i) && objects[i].texts[0] != NULL && game.prop[i] >= 0)
command.obj = command.obj * NOBJECTS + i;
}
if (HERE(i) && objects[i].texts[0] != NULL && game.prop[i] >= 0)
command.obj = command.obj * NOBJECTS + i;
}
- if (command.obj > NOBJECTS || command.obj == 0 || DARK(game.loc))
+ if (command.obj > NOBJECTS ||
+ command.obj == 0 ||
+ DARK(game.loc))
return GO_UNKNOWN;
}
if (DARK(game.loc)) {
return GO_UNKNOWN;
}
if (DARK(game.loc)) {
-
rspeak(NO_SEE, command.wd1, command.wd1x
);
+
sspeak(NO_SEE, command.raw1
);
} else if (command.obj == OYSTER && !game.clshnt && game.closed) {
game.clshnt = yes(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]);
} else if (command.obj == OYSTER && !game.clshnt && game.closed) {
game.clshnt = yes(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]);
- } else if (objects[command.obj].texts[0] == NULL || game.prop[command.obj] < 0) {
+ } else if (objects[command.obj].texts[0] == NULL ||
+ game.prop[command.obj] < 0) {
rspeak(actions[command.verb].message);
} else
rspeak(actions[command.verb].message);
} else
- pspeak(command.obj, study, game.prop[command.obj], true);
+
pspeak(command.obj, study, game.prop[command.obj], true);
return GO_CLEAROBJ;
}
static int reservoir(void)
/* Z'ZZZ (word gets recomputed at startup; different each game). */
{
return GO_CLEAROBJ;
}
static int reservoir(void)
/* Z'ZZZ (word gets recomputed at startup; different each game). */
{
+ /* FIXME: Arithmetic on state numbers */
if (!AT(RESER) && game.loc != game.fixed[RESER] - 1) {
rspeak(NOTHING_HAPPENS);
return GO_CLEAROBJ;
} else {
if (!AT(RESER) && game.loc != game.fixed[RESER] - 1) {
rspeak(NOTHING_HAPPENS);
return GO_CLEAROBJ;
} else {
- pspeak(RESER, look, game.prop[RESER] + 1, true);
+ /* FIXME: Arithmetic on state numbers */
+ pspeak(RESER, look, game.prop[RESER] + 1, true);
game.prop[RESER] = 1 - game.prop[RESER];
if (AT(RESER))
return GO_CLEAROBJ;
else {
game.oldlc2 = game.loc;
game.prop[RESER] = 1 - game.prop[RESER];
if (AT(RESER))
return GO_CLEAROBJ;
else {
game.oldlc2 = game.loc;
- game.newloc =
0
;
+ game.newloc =
LOC_NOWHERE
;
rspeak(NOT_BRIGHT);
return GO_TERMINATE;
}
rspeak(NOT_BRIGHT);
return GO_TERMINATE;
}
@@
-968,40
+1020,44
@@
static int reservoir(void)
static int rub(token_t verb, token_t obj)
/* Rub. Yields various snide remarks except for lit urn. */
{
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] = AMBER_IN_ROCK;
--game.tally;
drop(CAVITY, game.loc);
if (obj == URN && game.prop[URN] == URN_LIT) {
DESTROY(URN);
drop(AMBER, game.loc);
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;
}
static int say(struct command_t *command)
/* Say. Echo WD2 (or WD1 if no WD2 (SAY WHAT?, etc.).) Magic words override. */
{
return GO_CLEAROBJ;
}
static int say(struct command_t *command)
/* Say. Echo WD2 (or WD1 if no WD2 (SAY WHAT?, etc.).) Magic words override. */
{
- long a = command->wd1
, b = command->wd1x
;
+ long a = command->wd1;
if (command->wd2 > 0) {
a = command->wd2;
if (command->wd2 > 0) {
a = command->wd2;
- b = command->wd2x;
command->wd1 = command->wd2;
command->wd1 = command->wd2;
+ strcpy(command->raw1, command->raw2);
}
}
- char word1[
6
];
+ char word1[
TOKLEN+1
];
packed_to_token(command->wd1, word1);
int wd = (int) get_vocab_id(word1);
/* FIXME: magic numbers */
packed_to_token(command->wd1, word1);
int wd = (int) get_vocab_id(word1);
/* FIXME: magic numbers */
- if (wd == MOTION_WORD(XYZZY) || wd == MOTION_WORD(PLUGH) || wd == MOTION_WORD(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;
}
/* FIXME: scribbles on the interpreter's command block */
wordclear(&command->wd2);
return GO_LOOKUP;
}
-
rspeak(OKEY_DOKEY, a, b
);
+
sspeak(OKEY_DOKEY, command->raw1
);
return GO_CLEAROBJ;
}
return GO_CLEAROBJ;
}
@@
-1018,23
+1074,21
@@
static int throw (struct command_t *command)
* (Only way to do so!) Axe also special for dragon, bear, and
* troll. Treasures special for troll. */
{
* (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)) {
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)) {
return GO_CLEAROBJ;
}
if (objects[command->obj].is_treasure && AT(TROLL)) {
- spk = TROLL_SATISFIED;
/* Snarf a treasure for the troll. */
/* 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);
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)) {
return GO_CLEAROBJ;
}
if (command->obj == FOOD && HERE(BEAR)) {
@@
-1045,8
+1099,7
@@
static int throw (struct command_t *command)
if (command->obj != AXE)
return (discard(command->verb, command->obj, false));
else {
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))
if (AT(DRAGON) && game.prop[DRAGON] == DRAGON_BARS)
return throw_support(DRAGON_SCALES);
if (AT(TROLL))
@@
-1057,22
+1110,23
@@
static int throw (struct command_t *command)
/* This'll teach him to throw the axe at the bear! */
drop(AXE, game.loc);
game.fixed[AXE] = -1;
/* 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);
juggle(BEAR);
-
rspeak(
AXE_LOST);
+
state_change(AXE,
AXE_LOST);
return GO_CLEAROBJ;
}
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 {
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.dseen[i] = false;
- game.dloc[i] = 0;
- return throw_support((++game.dkill == 1)
- ? DWARF_SMOKE : KILLED_DWARF);
+ game.dloc[i] = LOC_NOWHERE;
+ return throw_support((++game.dkill == 1) ?
+ DWARF_SMOKE :
+ KILLED_DWARF);
}
}
}
}
}
}
@@
-1080,7
+1134,8
@@
static int throw (struct command_t *command)
static int wake(token_t verb, token_t obj)
/* Wake. Only use is to disturb the dwarves. */
{
static int wake(token_t verb, token_t obj)
/* Wake. Only use is to disturb the dwarves. */
{
- if (obj != DWARF || !game.closed) {
+ if (obj != DWARF ||
+ !game.closed) {
rspeak(actions[verb].message);
return GO_CLEAROBJ;
} else {
rspeak(actions[verb].message);
return GO_CLEAROBJ;
} else {
@@
-1092,36
+1147,44
@@
static int wake(token_t verb, token_t obj)
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. */
{
- int spk = actions[verb].message;
- if ((!TOTING(obj)) && (obj != ROD || !TOTING(ROD2)))
- spk = ARENT_CARRYING;
if (obj != ROD ||
!TOTING(obj) ||
if (obj != ROD ||
!TOTING(obj) ||
- (!HERE(BIRD) && (game.closng || !AT(FISSURE)))) {
- rspeak(spk);
+ (!HERE(BIRD) &&
+ (game.closng ||
+ !AT(FISSURE)))) {
+ rspeak(((!TOTING(obj)) && (obj != ROD ||
+ !TOTING(ROD2))) ?
+ ARENT_CARRYING :
+ actions[verb].message);
return GO_CLEAROBJ;
}
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;
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) {
return GO_CLEAROBJ;
} else {
if (game.closed) {
- rspeak(spk);
+ rspeak((game.prop[BIRD] == BIRD_CAGED) ?
+ CAGE_FLY :
+ FREE_FLY);
return GO_DWARFWAKE;
}
return GO_DWARFWAKE;
}
- if (game.closng || !AT(FISSURE)) {
- rspeak(spk);
+ if (game.closng ||
+ !AT(FISSURE)) {
+ rspeak((game.prop[BIRD] == BIRD_CAGED) ?
+ CAGE_FLY :
+ FREE_FLY);
return GO_CLEAROBJ;
}
if (HERE(BIRD))
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], true);
return GO_CLEAROBJ;
game.prop[FISSURE] = 1 - game.prop[FISSURE];
pspeak(FISSURE, look, 2 - game.prop[FISSURE], true);
return GO_CLEAROBJ;
@@
-1133,8
+1196,6
@@
int action(struct command_t *command)
* unless verb is "say", which snarfs arbitrary second word.
*/
{
* 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
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
@@
-1146,14
+1207,22
@@
int action(struct command_t *command)
if (HERE(command->obj))
/* FALL THROUGH */;
else if (command->obj == GRATE) {
if (HERE(command->obj))
/* FALL THROUGH */;
else if (command->obj == GRATE) {
- if (game.loc == LOC_START || game.loc == LOC_VALLEY || game.loc == LOC_SLIT)
+ if (game.loc == LOC_START ||
+ game.loc == LOC_VALLEY ||
+ game.loc == LOC_SLIT) {
command->obj = DPRSSN;
command->obj = DPRSSN;
- if (game.loc == LOC_COBBLE || game.loc == LOC_DEBRIS || game.loc == LOC_AWKWARD ||
- game.loc == LOC_BIRD || game.loc == LOC_PITTOP)
+ }
+ if (game.loc == LOC_COBBLE ||
+ game.loc == LOC_DEBRIS ||
+ game.loc == LOC_AWKWARD ||
+ game.loc == LOC_BIRD ||
+ game.loc == LOC_PITTOP) {
command->obj = ENTRNC;
command->obj = ENTRNC;
+ }
} else if (command->obj == DWARF && atdwrf(game.loc) > 0)
/* FALL THROUGH */;
} else if (command->obj == DWARF && atdwrf(game.loc) > 0)
/* FALL THROUGH */;
- else if ((LIQUID() == command->obj && HERE(BOTTLE)) || command->obj == LIQLOC(game.loc))
+ else if ((LIQUID() == command->obj && HERE(BOTTLE)) ||
+ command->obj == LIQLOC(game.loc))
/* FALL THROUGH */;
else if (command->obj == OIL && HERE(URN) && game.prop[URN] != 0) {
command->obj = URN;
/* FALL THROUGH */;
else if (command->obj == OIL && HERE(URN) && game.prop[URN] != 0) {
command->obj = URN;
@@
-1163,16
+1232,16
@@
int action(struct command_t *command)
/* FALL THROUGH */;
} else if (command->obj == KNIFE && game.knfloc == game.loc) {
game.knfloc = -1;
/* 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;
/* FALL THROUGH */;
return GO_CLEAROBJ;
} else if (command->obj == ROD && HERE(ROD2)) {
command->obj = ROD2;
/* FALL THROUGH */;
- } else if ((command->verb == FIND || command->verb == INVENTORY) && command->wd2 <= 0)
+ } else if ((command->verb == FIND ||
+ command->verb == INVENTORY) && command->wd2 <= 0)
/* FALL THROUGH */;
else {
/* FALL THROUGH */;
else {
-
rspeak(NO_SEE, command->wd1, command->wd1x
);
+
sspeak(NO_SEE, command->raw1
);
return GO_CLEAROBJ;
}
return GO_CLEAROBJ;
}
@@
-1188,7
+1257,8
@@
int action(struct command_t *command)
return GO_WORD2;
if (command->verb == SAY)
command->obj = command->wd2;
return GO_WORD2;
if (command->verb == SAY)
command->obj = command->wd2;
- if (command->obj == 0 || command->obj == INTRANSITIVE) {
+ if (command->obj == 0 ||
+ command->obj == INTRANSITIVE) {
/* Analyse an intransitive verb (ie, no object given yet). */
switch (command->verb) {
case CARRY:
/* Analyse an intransitive verb (ie, no object given yet). */
switch (command->verb) {
case CARRY:
@@
-1214,7
+1284,7
@@
int action(struct command_t *command)
case TAME:
return GO_UNKNOWN;
case GO: {
case TAME:
return GO_UNKNOWN;
case GO: {
- rspeak(
spk
);
+ rspeak(
actions[command->verb].message
);
return GO_CLEAROBJ;
}
case ATTACK:
return GO_CLEAROBJ;
}
case ATTACK:
@@
-1295,11
+1365,11
@@
int action(struct command_t *command)
case WAVE:
return wave(command->verb, command->obj);
case TAME: {
case WAVE:
return wave(command->verb, command->obj);
case TAME: {
- rspeak(
spk
);
+ rspeak(
actions[command->verb].message
);
return GO_CLEAROBJ;
}
case GO: {
return GO_CLEAROBJ;
}
case GO: {
- rspeak(
spk
);
+ rspeak(
actions[command->verb].message
);
return GO_CLEAROBJ;
}
case ATTACK:
return GO_CLEAROBJ;
}
case ATTACK:
@@
-1315,7
+1385,7
@@
int action(struct command_t *command)
case THROW:
return throw (command);
case QUIT: {
case THROW:
return throw (command);
case QUIT: {
- rspeak(
spk
);
+ rspeak(
actions[command->verb].message
);
return GO_CLEAROBJ;
}
case FIND:
return GO_CLEAROBJ;
}
case FIND:
@@
-1330,15
+1400,15
@@
int action(struct command_t *command)
blast();
return GO_CLEAROBJ;
case SCORE: {
blast();
return GO_CLEAROBJ;
case SCORE: {
- rspeak(
spk
);
+ rspeak(
actions[command->verb].message
);
return GO_CLEAROBJ;
}
case GIANTWORDS: {
return GO_CLEAROBJ;
}
case GIANTWORDS: {
- rspeak(
spk
);
+ rspeak(
actions[command->verb].message
);
return GO_CLEAROBJ;
}
case BRIEF: {
return GO_CLEAROBJ;
}
case BRIEF: {
- rspeak(
spk
);
+ rspeak(
actions[command->verb].message
);
return GO_CLEAROBJ;
}
case READ:
return GO_CLEAROBJ;
}
case READ:
@@
-1348,17
+1418,17
@@
int action(struct command_t *command)
case WAKE:
return wake(command->verb, command->obj);
case SAVE: {
case WAKE:
return wake(command->verb, command->obj);
case SAVE: {
- rspeak(
spk
);
+ rspeak(
actions[command->verb].message
);
return GO_CLEAROBJ;
}
case RESUME: {
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: {
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:
return GO_CLEAROBJ;
}
case PART:
@@
-1368,7
+1438,7
@@
int action(struct command_t *command)
}
case unknown:
/* Unknown verb, couldn't deduce object - might need hint */
}
case unknown:
/* Unknown verb, couldn't deduce object - might need hint */
-
rspeak(WHAT_DO, command->wd1, command->wd1x
);
+
sspeak(WHAT_DO, command->raw1
);
return GO_CHECKHINT;
default:
BUG(SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN); // LCOV_EXCL_LINE
return GO_CHECKHINT;
default:
BUG(SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN); // LCOV_EXCL_LINE