Abolish VOCWRD().

Action word mnemonics are now enums from adventure.yaml.
This commit is contained in:
Jason S. Ninneman 2017-06-26 22:07:24 -07:00
parent 2aa5f1dd61
commit 7dc8839249
5 changed files with 5 additions and 34 deletions

View file

@ -160,19 +160,11 @@ extern int restore(FILE *);
#define PCT(N) (randrange(100) < (N)) #define PCT(N) (randrange(100) < (N))
#define GSTONE(OBJ) ((OBJ) == EMERALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH) #define GSTONE(OBJ) ((OBJ) == EMERALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH)
#define FOREST(LOC) CNDBIT(LOC, COND_FOREST) #define FOREST(LOC) CNDBIT(LOC, COND_FOREST)
#define VOCWRD(LETTRS,SECT) (vocab(MAKEWD(LETTRS),SECT))
#define SPECIAL(LOC) ((LOC) > SPECIALBASE) #define SPECIAL(LOC) ((LOC) > SPECIALBASE)
#define OUTSID(LOC) (CNDBIT(LOC, COND_ABOVE) || FOREST(LOC)) #define OUTSID(LOC) (CNDBIT(LOC, COND_ABOVE) || FOREST(LOC))
#define INDEEP(LOC) ((LOC) >= LOC_MISTHALL && !OUTSID(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}; enum speechpart {unknown, intransitive, transitive};
struct command_t { struct command_t {

View file

@ -506,7 +506,7 @@ actions: !!omap
- ACT_2: - ACT_2:
message: ARENT_CARRYING message: ARENT_CARRYING
words: ['drop', 'relea', 'free', 'disca', 'dump'] words: ['drop', 'relea', 'free', 'disca', 'dump']
- ACT_3: - SAY:
message: NO_MESSAGE message: NO_MESSAGE
words: ['say', 'chant', 'sing', 'utter', 'mumbl'] words: ['say', 'chant', 'sing', 'utter', 'mumbl']
- ACT_4: - ACT_4:
@ -515,7 +515,7 @@ actions: !!omap
- ACT_5: - ACT_5:
message: NO_MESSAGE message: NO_MESSAGE
words: ['nothi'] words: ['nothi']
- ACT_6: - LOCK:
message: NOT_LOCKABLE message: NOT_LOCKABLE
words: ['lock', 'close'] words: ['lock', 'close']
- ACT_7: - ACT_7:
@ -548,16 +548,16 @@ actions: !!omap
- ACT_16: - ACT_16:
message: RUB_NOGO message: RUB_NOGO
words: ['rub'] words: ['rub']
- ACT_17: - THROW:
message: ARENT_CARRYING message: ARENT_CARRYING
words: ['throw', 'toss'] words: ['throw', 'toss']
- ACT_18: - ACT_18:
message: HUH_MAN message: HUH_MAN
words: ['quit'] words: ['quit']
- ACT_19: - FIND:
message: NEARBY message: NEARBY
words: ['find', 'where'] words: ['find', 'where']
- ACT_20: - INVENT:
message: NEARBY message: NEARBY
words: ['inven'] words: ['inven']
- ACT_21: - ACT_21:

View file

@ -13,12 +13,6 @@ struct game_t game;
long LNLENG, LNPOSN; long LNLENG, LNPOSN;
char rawbuf[LINESIZE], INLINE[LINESIZE + 1]; char rawbuf[LINESIZE], INLINE[LINESIZE + 1];
long FIND;
long INVENT;
long SAY;
long LOCK;
long THROW;
FILE *logfp = NULL, *rfp = NULL; FILE *logfp = NULL, *rfp = NULL;
bool oldstyle = false; bool oldstyle = false;
bool editline = true; bool editline = true;

9
init.c
View file

@ -72,15 +72,6 @@ void initialise(void)
game.hintlc[i] = 0; 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, /* Initialise the dwarves. game.dloc is loc of dwarves,
* hard-wired in. game.odloc is prior loc of each dwarf, * hard-wired in. game.odloc is prior loc of each dwarf,
* initially garbage. DALTLC is alternate initial loc for dwarf, * initially garbage. DALTLC is alternate initial loc for dwarf,

6
main.c
View file

@ -43,12 +43,6 @@ struct game_t game;
long LNLENG, LNPOSN; long LNLENG, LNPOSN;
char rawbuf[LINESIZE], INLINE[LINESIZE + 1]; char rawbuf[LINESIZE], INLINE[LINESIZE + 1];
long FIND;
long INVENT;
long SAY;
long LOCK;
long THROW;
FILE *logfp = NULL, *rfp = NULL; FILE *logfp = NULL, *rfp = NULL;
bool oldstyle = false; bool oldstyle = false;
bool editline = true; bool editline = true;