/* Attack. Assume target if unambiguous. "Throw" also links here.
* Attackable objects fall into two categories: enemies (snake,
* dwarf, etc.) and others (bird, clam, machine). Ambiguous if 2
* enemies, or no enemies but 2 others. */
{
/* Attack. Assume target if unambiguous. "Throw" also links here.
* Attackable objects fall into two categories: enemies (snake,
* dwarf, etc.) and others (bird, clam, machine). Ambiguous if 2
* enemies, or no enemies but 2 others. */
{
* fixed), move rug there (not fixed), and move him there,
* too. Then do a null motion to get new description. */
RSPEAK(BARE_HANDS_QUERY);
* fixed), move rug there (not fixed), and move him there,
* too. Then do a null motion to get new description. */
RSPEAK(BARE_HANDS_QUERY);
- GETIN(input, &WD1, &WD1X, &WD2, &WD2X);
- if (WD1 != MAKEWD(WORD_YINIT) && WD1 != MAKEWD(WORD_YES))
+ GETIN(input, &command->wd1, &command->wd1x, &command->wd2, &command->wd2x);
+ if (command->wd1 != MAKEWD(WORD_YINIT) && command->wd1 != MAKEWD(WORD_YES))
static int bigwords(token_t foo)
/* FEE FIE FOE FOO (AND FUM). Advance to next state if given in proper order.
static int bigwords(token_t foo)
/* FEE FIE FOE FOO (AND FUM). Advance to next state if given in proper order.
- return GO_CLEAROBJ;
- }
- if (OBJTXT[obj] == 0 || game.prop[obj] < 0) {
- RSPEAK(ACTSPK[verb]);
- return GO_CLEAROBJ;
- }
- if (obj == OYSTER && !game.clshnt) {
+ } else if (OBJTXT[command.obj] == 0 || game.prop[command.obj] < 0) {
+ RSPEAK(ACTSPK[command.verb]);
+ } else if (command.obj == OYSTER && !game.clshnt) {
game.clshnt = YES(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]);
game.clshnt = YES(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]);
- /* FIXME: ugly use of globals */
- SETPRM(1, WD2, WD2X);
- if (WD2 <= 0)
- SETPRM(1, WD1, WD1X);
- if (WD2 > 0)
- WD1 = WD2;
- int wd = VOCAB(WD1, -1);
+ SETPRM(1, command->wd2, command->wd2x);
+ if (command->wd2 <= 0)
+ SETPRM(1, command->wd1, command->wd1x);
+ if (command->wd2 > 0)
+ command->wd1 = command->wd2;
+ int wd = VOCAB(command->wd1, -1);
/* Throw. Same as discard unless axe. Then same as attack except
* ignore bird, and if dwarf is present then one might be killed.
* (Only way to do so!) Axe also special for dragon, bear, and
* troll. Treasures special for troll. */
{
/* Throw. Same as discard unless axe. Then same as attack except
* ignore bird, and if dwarf is present then one might be killed.
* (Only way to do so!) Axe also special for dragon, bear, and
* troll. Treasures special for troll. */
{
- int spk = ACTSPK[verb];
- if (TOTING(ROD2) && obj == ROD && !TOTING(ROD))obj = ROD2;
- if (!TOTING(obj)) {
+ int spk = ACTSPK[command->verb];
+ if (TOTING(ROD2) && command->obj == ROD && !TOTING(ROD))command->obj = ROD2;
+ if (!TOTING(command->obj)) {
MOVE(TROLL, 0);
MOVE(TROLL + NOBJECTS, 0);
DROP(TROLL2, PLAC[TROLL]);
MOVE(TROLL, 0);
MOVE(TROLL + NOBJECTS, 0);
DROP(TROLL2, PLAC[TROLL]);
- if (obj != AXE)
- return (discard(verb, obj, false));
+ if (command->obj != AXE)
+ return (discard(command->verb, command->obj, false));
/* Analyse a verb. Remember what it was, go back for object if second word
* unless verb is "say", which snarfs arbitrary second word.
*/
{
/* Analyse a verb. Remember what it was, go back for object if second word
* unless verb is "say", which snarfs arbitrary second word.
*/
{
/* Analyse an object word. See if the thing is here, whether
* we've got a verb yet, and so on. Object must be here
* unless verb is "find" or "invent(ory)" (and no new verb
/* Analyse an object word. See if the thing is here, whether
* we've got a verb yet, and so on. Object must be here
* unless verb is "find" or "invent(ory)" (and no new verb
* they are never actually dropped at any location, but might
* be here inside the bottle or urn or as a feature of the
* location. */
* they are never actually dropped at any location, but might
* be here inside the bottle or urn or as a feature of the
* location. */
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)
- if (WD2 > 0 && verb != SAY) return (2800);
- if (verb == SAY)obj = WD2;
- if (obj == 0 || obj == INTRANSITIVE) {
+ if (command->wd2 > 0 && command->verb != SAY)
+ return GO_WORD2;
+ if (command->verb == SAY)command->obj = command->wd2;
+ if (command->obj == 0 || command->obj == INTRANSITIVE) {
BUG(TRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST);
case unknown:
/* Unknown verb, couldn't deduce object - might need hint */
BUG(TRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST);
case unknown:
/* Unknown verb, couldn't deduce object - might need hint */