From 7dc88392493951baa8071c7318e6c0b086c531e9 Mon Sep 17 00:00:00 2001 From: "Jason S. Ninneman" Date: Mon, 26 Jun 2017 22:07:24 -0700 Subject: [PATCH] Abolish VOCWRD(). Action word mnemonics are now enums from adventure.yaml. --- advent.h | 8 -------- adventure.yaml | 10 +++++----- cheat.c | 6 ------ init.c | 9 --------- main.c | 6 ------ 5 files changed, 5 insertions(+), 34 deletions(-) diff --git a/advent.h b/advent.h index 4c31465..cf529ca 100644 --- a/advent.h +++ b/advent.h @@ -160,19 +160,11 @@ extern int restore(FILE *); #define PCT(N) (randrange(100) < (N)) #define GSTONE(OBJ) ((OBJ) == EMERALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH) #define FOREST(LOC) CNDBIT(LOC, COND_FOREST) -#define VOCWRD(LETTRS,SECT) (vocab(MAKEWD(LETTRS),SECT)) #define SPECIAL(LOC) ((LOC) > SPECIALBASE) #define OUTSID(LOC) (CNDBIT(LOC, COND_ABOVE) || FOREST(LOC)) #define INDEEP(LOC) ((LOC) >= LOC_MISTHALL && !OUTSID(LOC)) -/* vocabulary items */ -extern long FIND; -extern long INVENT; -extern long SAY; -extern long LOCK; -extern long THROW; - enum speechpart {unknown, intransitive, transitive}; struct command_t { diff --git a/adventure.yaml b/adventure.yaml index a8af631..53cb86c 100644 --- a/adventure.yaml +++ b/adventure.yaml @@ -506,7 +506,7 @@ actions: !!omap - ACT_2: message: ARENT_CARRYING words: ['drop', 'relea', 'free', 'disca', 'dump'] -- ACT_3: +- SAY: message: NO_MESSAGE words: ['say', 'chant', 'sing', 'utter', 'mumbl'] - ACT_4: @@ -515,7 +515,7 @@ actions: !!omap - ACT_5: message: NO_MESSAGE words: ['nothi'] -- ACT_6: +- LOCK: message: NOT_LOCKABLE words: ['lock', 'close'] - ACT_7: @@ -548,16 +548,16 @@ actions: !!omap - ACT_16: message: RUB_NOGO words: ['rub'] -- ACT_17: +- THROW: message: ARENT_CARRYING words: ['throw', 'toss'] - ACT_18: message: HUH_MAN words: ['quit'] -- ACT_19: +- FIND: message: NEARBY words: ['find', 'where'] -- ACT_20: +- INVENT: message: NEARBY words: ['inven'] - ACT_21: diff --git a/cheat.c b/cheat.c index 89b9201..844b66f 100644 --- a/cheat.c +++ b/cheat.c @@ -13,12 +13,6 @@ struct game_t game; long LNLENG, LNPOSN; char rawbuf[LINESIZE], INLINE[LINESIZE + 1]; -long FIND; -long INVENT; -long SAY; -long LOCK; -long THROW; - FILE *logfp = NULL, *rfp = NULL; bool oldstyle = false; bool editline = true; diff --git a/init.c b/init.c index 0ac3c4d..d3823db 100644 --- a/init.c +++ b/init.c @@ -72,15 +72,6 @@ void initialise(void) game.hintlc[i] = 0; } - /* Define some handy mnemonics. */ - - /* Some action verbs. */ - FIND = VOCWRD(WORD_FIND, 2); - INVENT = VOCWRD(WORD_INVENT, 2); - LOCK = VOCWRD(WORD_LOCK, 2); - SAY = VOCWRD(WORD_SAY, 2); - THROW = VOCWRD(WORD_THROW, 2); - /* Initialise the dwarves. game.dloc is loc of dwarves, * hard-wired in. game.odloc is prior loc of each dwarf, * initially garbage. DALTLC is alternate initial loc for dwarf, diff --git a/main.c b/main.c index c02bd3c..f6209d4 100644 --- a/main.c +++ b/main.c @@ -43,12 +43,6 @@ struct game_t game; long LNLENG, LNPOSN; char rawbuf[LINESIZE], INLINE[LINESIZE + 1]; -long FIND; -long INVENT; -long SAY; -long LOCK; -long THROW; - FILE *logfp = NULL, *rfp = NULL; bool oldstyle = false; bool editline = true; -- 2.31.1