-int action(FILE *input, enum speechpart part, long verb, long obj)
-/* Analyse a verb. Remember what it was, go back for object if second word
- * unless verb is "say", which snarfs arbitrary second word.
- */
-{
- int kk;
-
- if (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
- * unless verb is "find" or "invent(ory)" (and no new verb
- * yet to be analysed). Water and oil are also funny, since
- * 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 (HERE(obj))
- /* FALL THROUGH */;
- else if (obj == GRATE) {
- if (game.loc == 1 || game.loc == 4 || game.loc == 7)
- obj=DPRSSN;
- if (game.loc > 9 && game.loc < 15)
- obj=ENTRNC;
- if (obj != GRATE)
- return(8);
- }
- else if (obj == DWARF && ATDWRF(game.loc) > 0)
- /* FALL THROUGH */;
- else if ((LIQ(0) == obj && HERE(BOTTLE)) || obj == LIQLOC(game.loc))
- /* FALL THROUGH */;
- else if (obj == OIL && HERE(URN) && game.prop[URN] != 0) {
- obj=URN;
- /* FALL THROUGH */;
- }
- else if (obj == PLANT && AT(PLANT2) && game.prop[PLANT2] != 0) {
- obj=PLANT2;
- /* FALL THROUGH */;
- }
- else if (obj == KNIFE && game.knfloc == game.loc) {
- game.knfloc= -1;
- SPK=116;
- return(2011);
- }
- else if (obj == ROD && HERE(ROD2)) {
- obj=ROD2;
- /* FALL THROUGH */;
- }
- else if ((verb == FIND || verb == INVENT) && WD2 <= 0)
- /* FALL THROUGH */;
- else {
- SETPRM(1,WD1,WD1X);
- RSPEAK(256);
- return(2012);
- }
-
- if (WD2 > 0)
- return(2800);
- if (verb != 0)
- part = transitive;
- }
-
- switch(part)
- {
+static phase_codes_t wave(verb_t verb, obj_t obj) {
+ /* Wave. No effect unless waving rod at fissure or at bird. */
+ if (obj != ROD || !TOTING(obj) ||
+ (!HERE(BIRD) && (game.closng || !AT(FISSURE)))) {
+ speak(((!TOTING(obj)) && (obj != ROD || !TOTING(ROD2)))
+ ? arbitrary_messages[ARENT_CARRYING]
+ : actions[verb].message);
+ return GO_CLEAROBJ;
+ }
+
+ if (game.objects[BIRD].prop == BIRD_UNCAGED &&
+ game.loc == game.objects[STEPS].place && PROP_IS_NOTFOUND(JADE)) {
+ drop(JADE, game.loc);
+ PROP_SET_FOUND(JADE);
+ --game.tally;
+ rspeak(NECKLACE_FLY);
+ return GO_CLEAROBJ;
+ } else {
+ if (game.closed) {
+ rspeak((game.objects[BIRD].prop == BIRD_CAGED)
+ ? CAGE_FLY
+ : FREE_FLY);
+ return GO_DWARFWAKE;
+ }
+ if (game.closng || !AT(FISSURE)) {
+ rspeak((game.objects[BIRD].prop == BIRD_CAGED)
+ ? CAGE_FLY
+ : FREE_FLY);
+ return GO_CLEAROBJ;
+ }
+ if (HERE(BIRD)) {
+ rspeak((game.objects[BIRD].prop == BIRD_CAGED)
+ ? CAGE_FLY
+ : FREE_FLY);
+ }
+
+ state_change(FISSURE, game.objects[FISSURE].prop == BRIDGED
+ ? UNBRIDGED
+ : BRIDGED);
+ return GO_CLEAROBJ;
+ }
+}
+
+phase_codes_t action(command_t command) {
+ /* Analyse a verb. Remember what it was, go back for object if second
+ * word unless verb is "say", which snarfs arbitrary second word.
+ */
+ /* Previously, actions that result in a message, but don't do anything
+ * further were called "specials". Now they're handled here as normal
+ * actions. If noaction is true, then we spit out the message and return
+ */
+ if (actions[command.verb].noaction) {
+ speak(actions[command.verb].message);
+ return GO_CLEAROBJ;
+ }
+
+ 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
+ * unless verb is "find" or "invent(ory)" (and no new verb
+ * yet to be analysed). Water and oil are also funny, since
+ * 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 (HERE(command.obj)) {
+ /* FALL THROUGH */;
+ } else if (command.obj == DWARF && atdwrf(game.loc) > 0) {
+ /* FALL THROUGH */;
+ } else if (!game.closed &&
+ ((LIQUID() == command.obj && HERE(BOTTLE)) ||
+ command.obj == LIQLOC(game.loc))) {
+ /* FALL THROUGH */;
+ } else if (command.obj == OIL && HERE(URN) &&
+ game.objects[URN].prop != URN_EMPTY) {
+ command.obj = URN;
+ /* FALL THROUGH */;
+ } else if (command.obj == PLANT && AT(PLANT2) &&
+ game.objects[PLANT2].prop != PLANT_THIRSTY) {
+ command.obj = PLANT2;
+ /* FALL THROUGH */;
+ } else if (command.obj == KNIFE && game.knfloc == game.loc) {
+ game.knfloc = -1;
+ rspeak(KNIVES_VANISH);
+ return GO_CLEAROBJ;
+ } else if (command.obj == ROD && HERE(ROD2)) {
+ command.obj = ROD2;
+ /* FALL THROUGH */;
+ } else if ((command.verb == FIND ||
+ command.verb == INVENTORY) &&
+ (command.word[1].id == WORD_EMPTY ||
+ command.word[1].id == WORD_NOT_FOUND)) {
+ /* FALL THROUGH */;
+ } else {
+ sspeak(NO_SEE, command.word[0].raw);
+ return GO_CLEAROBJ;
+ }
+
+ if (command.verb != 0) {
+ command.part = transitive;
+ }
+ }
+
+ switch (command.part) {