static int quit(void)
/* Quit. Intransitive only. Verify intent and exit if that's what he wants. */
{
- if (YES(REALLY_QUIT, OK_MAN, OK_MAN))
+ if (YES(arbitrary_messages[REALLY_QUIT], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN]))
terminate(quitgame);
return GO_CLEAROBJ;
}
return GO_CLEAROBJ;
}
if (obj == OYSTER && !game.clshnt) {
- game.clshnt = YES(CLUE_QUERY, WAYOUT_CLUE, OK_MAN);
+ game.clshnt = YES(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]);
return GO_CLEAROBJ;
}
PSPEAK(obj, OBJTXT[obj] + game.prop[obj]);
extern bool GETIN(FILE *,token_t*,token_t*,token_t*,token_t*);
extern void echo_input(FILE*, char*, char*);
extern char* get_input(void);
-extern bool YES(vocab_t, vocab_t, vocab_t);
+extern bool YES(const char*, const char*, const char*);
extern long GETTXT(bool,bool,bool);
extern token_t MAKEWD(long);
extern long VOCAB(long,long);
game.loc = LOC_START;
game.limit = 330;
if (!rfp) {
- game.novice = YES(WELCOME_YOU, CAVE_NEARBY, NO_MESSAGE);
+ game.novice = YES(arbitrary_messages[WELCOME_YOU], arbitrary_messages[CAVE_NEARBY], arbitrary_messages[NO_MESSAGE]);
if (game.novice)game.limit = 1000;
} else {
restore(rfp);
/* Fall through to hint display */
game.hintlc[hint] = 0;
- if (!YES(HINTS[hint][3], NO_MESSAGE, OK_MAN))
+ if (!YES(arbitrary_messages[HINTS[hint][3]], arbitrary_messages[NO_MESSAGE], arbitrary_messages[OK_MAN]))
return;
SETPRM(1, HINTS[hint][2], HINTS[hint][2]);
RSPEAK(HINT_COST);
- game.hinted[hint] = YES(WANT_HINT, HINTS[hint][4], OK_MAN);
+ game.hinted[hint] = YES(arbitrary_messages[WANT_HINT], arbitrary_messages[HINTS[hint][4]], arbitrary_messages[OK_MAN]);
if (game.hinted[hint] && game.limit > WARNTIME)
game.limit += WARNTIME * HINTS[hint][2];
}
terminate(endgame);
}
/* FIXME: Arithmetic on message numbers */
- else if (game.numdie == MAXDIE || !YES(WATCH_IT + game.numdie * 2, WHICH_WAY + game.numdie * 2, OK_MAN))
+ else if (game.numdie == MAXDIE || !YES(arbitrary_messages[WATCH_IT + game.numdie * 2], arbitrary_messages[WHICH_WAY + game.numdie * 2], arbitrary_messages[OK_MAN]))
terminate(endgame);
else {
game.place[WATER] = game.place[OIL] = NOWHERE;
return (input);
}
-bool YES(vocab_t question, vocab_t yes_response, vocab_t no_response)
+bool YES(const char* question, const char* yes_response, const char* no_response)
/* Print message X, wait for yes/no answer. If yes, print Y and return true;
* if no, print Z and return false. */
{
bool outcome;
for (;;) {
- RSPEAK(question);
+ speak(question);
reply = get_input();
free(firstword);
if (yes == 0 || y == 0) {
- RSPEAK(yes_response);
+ speak(yes_response);
outcome = true;
break;
} else if (no == 0 || n == 0) {
- RSPEAK(no_response);
+ speak(no_response);
outcome = false;
break;
} else
FILE *fp = NULL;
RSPEAK(SUSPEND_WARNING);
- if (!YES(THIS_ACCEPTABLE, OK_MAN, OK_MAN)) return GO_CLEAROBJ;
+ if (!YES(arbitrary_messages[THIS_ACCEPTABLE], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN])) return GO_CLEAROBJ;
game.saved = game.saved + 5;
while (fp == NULL) {
if (game.loc != 1 || game.abbrev[1] != 1) {
RSPEAK(RESUME_ABANDON);
- if (!YES(THIS_ACCEPTABLE, OK_MAN, OK_MAN)) return GO_CLEAROBJ;
+ if (!YES(arbitrary_messages[THIS_ACCEPTABLE], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN])) return GO_CLEAROBJ;
}
while (fp == NULL) {