}
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 (objects[command.obj].texts[0] == NULL ||
command->verb == INVENTORY) && command->wd2 <= 0)
/* FALL THROUGH */;
else {
- rspeak(NO_SEE, command->wd1, command->wd1x);
+ sspeak(NO_SEE, command->raw1);
return GO_CLEAROBJ;
}
}
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
extern bool wordempty(token_t);
extern void wordclear(token_t *);
extern void speak(const char*, ...);
+extern void sspeak(long msg, ...);
extern void pspeak(vocab_t, enum speaktype, int, bool, ...);
extern void rspeak(vocab_t, ...);
extern void echo_input(FILE*, const char*, const char*);
- ONE_HIT: 'One of them gets you!'
- NONE_HIT: 'None of them hits you!'
- DONT_KNOW: 'Sorry, I don''t know the word "%s".'
-- WHAT_DO: 'What do you want to do with the %L%L?' # FIXME: %L%L should become %L once parsing no longer depends on packed tokens
-- NO_SEE: 'I see no %L%L here.' # FIXME: %L%L should become %L once parsing no longer depends on packed tokens
-- DO_WHAT: '%C what?'
+- WHAT_DO: 'What do you want to do with the %s?'
+- NO_SEE: 'I see no %s here.'
+- DO_WHAT: '%s what?'
- OKEY_DOKEY: 'Okay, "%s".'
- GARNERED_POINTS: 'You have garnered %d out of a possible %d points, using %d turn%S.'
- SUSPEND_WARNING: |-
#include <getopt.h>
#include <signal.h>
#include <string.h>
+#include <ctype.h>
#include "advent.h"
#include "dungeon.h"
}
if (V1 == ENTER && command.wd2 > 0) {
command.wd1 = command.wd2;
- command.wd1x = command.wd2x;
wordclear(&command.wd2);
} else {
/* FIXME: Magic numbers related to vocabulary */
/* Gee, I don't understand. */
if (fallback_handler(inputbuf))
continue;
- rspeak(DONT_KNOW, command.wd1, command.wd1x);
+ sspeak(DONT_KNOW, command.raw1);
goto L2600;
}
/* FIXME: magic numbers related to vocabulary */
case GO_WORD2:
/* Get second word for analysis. */
command.wd1 = command.wd2;
- command.wd1x = command.wd2x;
+ strcpy(command.raw1, command.raw2);
wordclear(&command.wd2);
+ command.raw2[0] = '\0';
goto L2620;
case GO_UNKNOWN:
/* Random intransitive verbs come here. Clear obj just in case
* (see attack()). */
- rspeak(DO_WHAT, command.wd1, command.wd1x);
+ command.raw1[0] = toupper(command.raw1[0]);
+ sspeak(DO_WHAT, command.raw1);
command.obj = 0;
goto L2600;
case GO_DWARFWAKE:
// pack the substrings
cmd->wd1 = token_to_packed(chunk_data[0]);
- cmd->wd1x = token_to_packed(chunk_data[1]);
cmd->wd2 = token_to_packed(chunk_data[2]);
- cmd->wd2x = token_to_packed(chunk_data[3]);
}
/* Hide the fact that wods are corrently packed longs */
*v = 0;
}
-/* I/O routines (speak, pspeak, rspeak, get_input, yes) */
+/* I/O routines (speak, pspeak, rspeak, sspeak, get_input, yes) */
void vspeak(const char* msg, bool blank, va_list ap)
{
va_end(ap);
}
+void sspeak(const long msg, ...)
+{
+ va_list ap;
+ va_start(ap, msg);
+ fputc('\n', stdout);
+ vprintf(arbitrary_messages[msg], ap);
+ fputc('\n', stdout);
+ va_end(ap);
+}
+
void pspeak(vocab_t msg, enum speaktype mode, int skip, bool blank, ...)
/* Find the skip+1st message from msg and print it. Modes are:
* feel = for inventory, what you can touch
* Attempting to extinguish an unlit urn caused it to lose its oil.
+* Unrecognized words are no longer truncated to 5 characters and
+ uppercased when they are echoed.
+
By default, advent issues "> " as a command prompt. This feature
became common in many variants after the original 350-point version,
but was never backported into Crowther & Woods's main line before now.
> find bar
-Sorry, I don't know the word "BAR".
+Sorry, I don't know the word "bar".
> carry
> frob grate
-Sorry, I don't know the word "FROB".
+Sorry, I don't know the word "frob".
> read grate
> attack
-Attac what?
+Attack what?
> kill ogre
> pour bottle
-Bottl what?
+Bottle what?
> n
> ew
-Sorry, I don't know the word "EW".
+Sorry, I don't know the word "ew".
> w
i
-Sorry, I don't know the word "I".
+Sorry, I don't know the word "i".
l
-Sorry, I don't know the word "L".
+Sorry, I don't know the word "l".
x
-Sorry, I don't know the word "X".
+Sorry, I don't know the word "x".
z
-Sorry, I don't know the word "Z".
+Sorry, I don't know the word "z".
quit
> extinguish
-Extin what?
+Extinguish what?
> look
> attack
-Attac what?
+Attack what?
> attack machine
> quit nagging
-Sorry, I don't know the word "NAGGI".
+Sorry, I don't know the word "nagging".
> nothing doing
-Sorry, I don't know the word "DOING".
+Sorry, I don't know the word "doing".
> e