From: Eric S. Raymond Date: Mon, 19 Jun 2017 01:17:57 +0000 (-0400) Subject: No longer restricted to 6-character FORTRAN identifiers. X-Git-Tag: 1.1~238 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=fa9b6d317f5138c8a4937a14a92acf4b5928545e;p=open-adventure.git No longer restricted to 6-character FORTRAN identifiers. --- diff --git a/actions.c b/actions.c index e325890..74d6756 100644 --- a/actions.c +++ b/actions.c @@ -153,7 +153,7 @@ static int bivalve(token_t verb, token_t obj) bool is_oyster = (obj == OYSTER); spk = is_oyster ? OYSTER_OPENS : PEARL_FALLS; if (TOTING(obj))spk = is_oyster ? DROP_OYSTER : DROP_CLAM; - if (!TOTING(TRIDNT))spk = is_oyster ? OYSTER_OPENER : CLAM_OPENER; + if (!TOTING(TRIDENT))spk = is_oyster ? OYSTER_OPENER : CLAM_OPENER; if (verb == LOCK)spk = HUH_MAN; if (spk == PEARL_FALLS) { DESTROY(CLAM); @@ -346,7 +346,7 @@ static int discard(token_t verb, token_t obj, bool just_do_it) RSPEAK(GEM_FITS); game.prop[obj] = 1; game.prop[CAVITY] = 0; - if (HERE(RUG) && ((obj == EMRALD && game.prop[RUG] != 2) || (obj == RUBY && + if (HERE(RUG) && ((obj == EMERALD && game.prop[RUG] != 2) || (obj == RUBY && game.prop[RUG] == 2))) { spk = RUG_RISES; if (TOTING(RUG))spk = RUG_WIGGLES; @@ -361,8 +361,8 @@ static int discard(token_t verb, token_t obj, bool just_do_it) } } else if (obj == COINS && HERE(VEND)) { DESTROY(COINS); - DROP(BATTER, game.loc); - PSPEAK(BATTER, 0); + DROP(BATTERY, game.loc); + PSPEAK(BATTERY, 0); return GO_CLEAROBJ; } else if (obj == BIRD && AT(DRAGON) && game.prop[DRAGON] == 0) { RSPEAK(BIRD_BURNT); @@ -462,7 +462,7 @@ static int extinguish(token_t verb, int obj) game.prop[LAMP] = 0; RSPEAK(LAMP_OFF); spk = DARK(game.loc) ? PITCH_DARK : NO_MESSAGE; - } else if (obj == DRAGON || obj == VOLCAN) + } else if (obj == DRAGON || obj == VOLCANO) spk = BEYOND_POWER; RSPEAK(spk); return GO_CLEAROBJ; @@ -969,7 +969,7 @@ static int wave(token_t verb, token_t obj) if ((!TOTING(obj)) && (obj != ROD || !TOTING(ROD2)))spk = ARENT_CARRYING; if (obj != ROD || !TOTING(obj) || - (!HERE(BIRD) && (game.closng || !AT(FISSUR)))) { + (!HERE(BIRD) && (game.closng || !AT(FISSURE)))) { RSPEAK(spk); return GO_CLEAROBJ; } @@ -986,13 +986,13 @@ static int wave(token_t verb, token_t obj) RSPEAK(spk); return GO_DWARFWAKE; } - if (game.closng || !AT(FISSUR)) { + if (game.closng || !AT(FISSURE)) { RSPEAK(spk); return GO_CLEAROBJ; } if (HERE(BIRD))RSPEAK(spk); - game.prop[FISSUR] = 1 - game.prop[FISSUR]; - PSPEAK(FISSUR, 2 - game.prop[FISSUR]); + game.prop[FISSURE] = 1 - game.prop[FISSURE]; + PSPEAK(FISSURE, 2 - game.prop[FISSURE]); return GO_CLEAROBJ; } } diff --git a/advent.h b/advent.h index bc3c1cc..e461b57 100644 --- a/advent.h +++ b/advent.h @@ -147,7 +147,7 @@ extern int restore(FILE *); #define FORCED(LOC) (COND[LOC] == 2) #define DARK(DUMMY) ((!CNDBIT(game.loc,LIGHT)) && (game.prop[LAMP] == 0 || !HERE(LAMP))) #define PCT(N) (randrange(100) < (N)) -#define GSTONE(OBJ) ((OBJ) == EMRALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH) +#define GSTONE(OBJ) ((OBJ) == EMERALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH) #define FOREST(LOC) ((LOC) >= LOC_FOREST1 && (LOC) <= LOC_FOREST22) #define VOCWRD(LETTRS,SECT) (VOCAB(MAKEWD(LETTRS),SECT)) #define SPECIAL(LOC) ((LOC) > SPECIALBASE) @@ -162,15 +162,15 @@ extern int restore(FILE *); #define INDEEP(LOC) ((LOC) >= LOC_MISTHALL && !OUTSID(LOC) && (LOC) != LOC_FOOF1) /* vocabulary items */ -extern long AMBER, ATTACK, AXE, BACK, BATTER, BEAR, +extern long AMBER, ATTACK, AXE, BACK, BATTERY, BEAR, BIRD, BLOOD, BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST, CLAM, COINS, DOOR, DPRSSN, DRAGON, DWARF, EGGS, - EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD, GRATE, HINT, INVENT, - JADE, KEYS, KNIFE, LAMP, LOCK, LOOK, MAGZIN, MESSAG, MIRROR, NUGGET, NUL, - OGRE, OIL, OYSTER, PANIC, PEARL, PILLOW, PLANT, PLANT2, PYRAM, + EMERALD, ENTER, ENTRNC, FIND, FISSURE, FOOD, GRATE, HINT, INVENT, + JADE, KEYS, KNIFE, LAMP, LOCK, LOOK, MAGAZINE, MESSAG, MIRROR, NUGGET, NUL, + OGRE, OIL, OYSTER, PANIC, PEARL, PILLOW, PLANT, PLANT2, PYRAMID, RESER, ROD, ROD2, RUBY, RUG, SAPPH, SAY, SIGN, SNAKE, - STEPS, STICK, STREAM, THROW, TRIDNT, TROLL, TROLL2, - URN, VASE, VEND, VOLCAN, WATER; + STEPS, STICK, STREAM, THROW, TRIDENT, TROLL, TROLL2, + URN, VASE, VEND, VOLCANO, WATER; enum speechpart {unknown, intransitive, transitive}; diff --git a/adventure.text b/adventure.text index 290a0d0..05e3bc6 100644 --- a/adventure.text +++ b/adventure.text @@ -1219,7 +1219,7 @@ 1035 BEAR 1036 MESSA 1037 VOLCA -1037 GEYSE (SAME AS VOLCANO) +1037 GEYSE (SAME AS VOLCANOO) 1038 MACHI 1038 VENDI 1039 BATTE @@ -1256,7 +1256,7 @@ 1058 POTTE 1059 EMERA 1060 PLATI -1060 PYRAM +1060 PYRAMID 1061 PEARL 1062 RUG 1062 PERSI diff --git a/adventure.yaml b/adventure.yaml index 10d47ed..65fe2e5 100644 --- a/adventure.yaml +++ b/adventure.yaml @@ -932,9 +932,9 @@ arbitrary_messages: !!omap - LAMP_OUT: 'Your lamp has run out of power.' - PLEASE_ANSWER: 'Please answer the question.' - PIRATE_SPOTTED: 'There are faint rustling noises from the darkness behind you. As you\nturn toward them, the beam of your lamp falls across a bearded pirate.\nHe is carrying a large chest. "Shiver me timbers!" he cries, "I''ve\nbeen spotted! I''d best hie meself off to the maze to hide me chest!"\nWith that, he vanishes into the gloom.' -- GET_BATTERIES: 'Your lamp is getting dim. You''d best go back for those batteries.' -- REPLACE_BATTERIES: 'Your lamp is getting dim. I''m taking the liberty of replacing the\nbatteries.' -- MISSING_BATTERIES: 'Your lamp is getting dim, and you''re out of spare batteries. You''d\nbest start wrapping this up.' +- GET_BATTERYIES: 'Your lamp is getting dim. You''d best go back for those batteries.' +- REPLACE_BATTERYIES: 'Your lamp is getting dim. I''m taking the liberty of replacing the\nbatteries.' +- MISSING_BATTERYIES: 'Your lamp is getting dim, and you''re out of spare batteries. You''d\nbest start wrapping this up.' - REMOVE_MESSAGE: 'You sift your fingers through the dust, but succeed only in\nobliterating the cryptic message.' - OGRE_QUERY: 'Do you need help dealing with the ogre?' - CLUE_QUERY: 'Hmmm, this looks like a clue, which means it''ll cost you 10 points to\nread it. Should I go ahead and read it anyway?' diff --git a/init.c b/init.c index b2ad785..addf418 100644 --- a/init.c +++ b/init.c @@ -233,7 +233,7 @@ void initialise(void) /* Define some handy mnemonics. These correspond to object numbers. */ AXE = VOCWRD(12405, 1); - BATTER = VOCWRD(201202005, 1); + BATTERY = VOCWRD(201202005, 1); BEAR = VOCWRD(2050118, 1); BIRD = VOCWRD(2091804, 1); BLOOD = VOCWRD(212151504, 1); @@ -245,13 +245,13 @@ void initialise(void) DOOR = VOCWRD(4151518, 1); DRAGON = VOCWRD(418010715, 1); DWARF = VOCWRD(423011806, 1); - FISSUR = VOCWRD(609191921, 1); + FISSURE = VOCWRD(609191921, 1); FOOD = VOCWRD(6151504, 1); GRATE = VOCWRD(718012005, 1); KEYS = VOCWRD(11052519, 1); KNIFE = VOCWRD(1114090605, 1); LAMP = VOCWRD(12011316, 1); - MAGZIN = VOCWRD(1301070126, 1); + MAGAZINE = VOCWRD(1301070126, 1); MESSAG = VOCWRD(1305191901, 1); MIRROR = VOCWRD(1309181815, 1); OGRE = VOCWRD(15071805, 1); @@ -270,7 +270,7 @@ void initialise(void) TROLL2 = TROLL + 1; URN = VOCWRD(211814, 1); VEND = VOCWRD(1755140409, 1); - VOLCAN = VOCWRD(1765120301, 1); + VOLCANO = VOCWRD(1765120301, 1); WATER = VOCWRD(1851200518, 1); /* Objects from MINTRS through MAXTRS are treasures. Here are a few. */ @@ -279,15 +279,15 @@ void initialise(void) CHEST = VOCWRD(308051920, 1); COINS = VOCWRD(315091419, 1); EGGS = VOCWRD(5070719, 1); - EMRALD = VOCWRD(513051801, 1); + EMERALD = VOCWRD(513051801, 1); JADE = VOCWRD(10010405, 1); NUGGET = VOCWRD(7151204, 1); PEARL = VOCWRD(1605011812, 1); - PYRAM = VOCWRD(1625180113, 1); + PYRAMID = VOCWRD(1625180113, 1); RUBY = VOCWRD(18210225, 1); RUG = VOCWRD(182107, 1); SAPPH = VOCWRD(1901161608, 1); - TRIDNT = VOCWRD(2018090405, 1); + TRIDENT = VOCWRD(2018090405, 1); VASE = VOCWRD(22011905, 1); /* These are motion-verb numbers. */ diff --git a/main.c b/main.c index 0dca0d8..c4892ff 100644 --- a/main.c +++ b/main.c @@ -30,17 +30,17 @@ struct game_t game; long LNLENG, LNPOSN, PARMS[MAXPARMS + 1]; char rawbuf[LINESIZE], INLINE[LINESIZE + 1]; -long AMBER, AXE, BACK, BATTER, BEAR, BIRD, BLOOD, +long AMBER, AXE, BACK, BATTERY, BEAR, BIRD, BLOOD, BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST, CLAM, COINS, DOOR, DPRSSN, DRAGON, DWARF, EGGS, - EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD, + EMERALD, ENTER, ENTRNC, FIND, FISSURE, FOOD, GRATE, HINT, INVENT, JADE, KEYS, - KNIFE, LAMP, LOCK, LOOK, MAGZIN, + KNIFE, LAMP, LOCK, LOOK, MAGAZINE, MESSAG, MIRROR, NUGGET, NUL, OGRE, OIL, OYSTER, - PEARL, PILLOW, PLANT, PLANT2, PYRAM, RESER, ROD, ROD2, + PEARL, PILLOW, PLANT, PLANT2, PYRAMID, RESER, ROD, ROD2, RUBY, RUG, SAPPH, SAY, SIGN, SNAKE, - STEPS, STREAM, THROW, TRIDNT, TROLL, TROLL2, - URN, VASE, VEND, VOLCAN, WATER; + STEPS, STREAM, THROW, TRIDENT, TROLL, TROLL2, + URN, VASE, VEND, VOLCANO, WATER; long WD1, WD1X, WD2, WD2X; FILE *logfp = NULL, *rfp = NULL; @@ -226,7 +226,7 @@ static void checkhints(void) game.hintlc[hint] = 0; return; case 4: /* dark */ - if (game.prop[EMRALD] != -1 && game.prop[PYRAM] == -1) + if (game.prop[EMERALD] != -1 && game.prop[PYRAMID] == -1) break; game.hintlc[hint] = 0; return; @@ -294,7 +294,7 @@ static bool spotted_by_pirate(int i) for (int treasure = MINTRS; treasure <= MAXTRS; treasure++) { /* Pirate won't take pyramid from plover room or dark * room (too easy!). */ - if (treasure == PYRAM && (game.loc == PLAC[PYRAM] || game.loc == PLAC[EMRALD])) { + if (treasure == PYRAMID && (game.loc == PLAC[PYRAMID] || game.loc == PLAC[EMERALD])) { continue; } if (TOTING(treasure) || HERE(treasure)) @@ -326,7 +326,7 @@ static bool spotted_by_pirate(int i) if (robplayer) { RSPEAK(PIRATE_POUNCES); for (int treasure = MINTRS; treasure <= MAXTRS; treasure++) { - if (!(treasure == PYRAM && (game.loc == PLAC[PYRAM] || game.loc == PLAC[EMRALD]))) { + if (!(treasure == PYRAMID && (game.loc == PLAC[PYRAMID] || game.loc == PLAC[EMERALD]))) { if (AT(treasure) && game.fixed[treasure] == 0) CARRY(treasure, game.loc); if (TOTING(treasure)) @@ -660,7 +660,7 @@ L12: * actual motion, but can be spotted by "go back". */ /* FIXME: Arithmetic on location numbers */ game.newloc = 99 + 100 - game.loc; - if (game.holdng > 1 || (game.holdng == 1 && !TOTING(EMRALD))) { + if (game.holdng > 1 || (game.holdng == 1 && !TOTING(EMERALD))) { game.newloc = game.loc; RSPEAK(MUST_DROP); } @@ -670,7 +670,7 @@ L12: * special travel if toting it), so he's forced to use the * plover-passage to get it out. Having dropped it, go back and * pretend he wasn't carrying it after all. */ - DROP(EMRALD, game.loc); + DROP(EMERALD, game.loc); goto L12; case 3: /* Travel 303. Troll bridge. Must be done only as special @@ -753,7 +753,7 @@ static bool closecheck(void) * have been activated, since we've found chest. */ if (game.clock1 == 0) { game.prop[GRATE] = 0; - game.prop[FISSUR] = 0; + game.prop[FISSURE] = 0; for (int i = 1; i <= NDWARVES; i++) { game.dseen[i] = false; game.dloc[i] = 0; @@ -840,11 +840,11 @@ static void lampcheck(void) * Second is for other cases of lamp dying. 12400 is when it * goes out. Even then, he can explore outside for a while * if desired. */ - if (game.limit <= WARNTIME && HERE(BATTER) && game.prop[BATTER] == 0 && HERE(LAMP)) { - RSPEAK(REPLACE_BATTERIES); - game.prop[BATTER] = 1; - if (TOTING(BATTER)) - DROP(BATTER, game.loc); + if (game.limit <= WARNTIME && HERE(BATTERY) && game.prop[BATTERY] == 0 && HERE(LAMP)) { + RSPEAK(REPLACE_BATTERYIES); + game.prop[BATTERY] = 1; + if (TOTING(BATTERY)) + DROP(BATTERY, game.loc); game.limit = game.limit + 2500; game.lmwarn = false; } else if (game.limit == 0) { @@ -855,9 +855,9 @@ static void lampcheck(void) } else if (game.limit <= WARNTIME) { if (!game.lmwarn && HERE(LAMP)) { game.lmwarn = true; - int spk = GET_BATTERIES; - if (game.place[BATTER] == NOWHERE)spk = LAMP_DIM; - if (game.prop[BATTER] == 1)spk = MISSING_BATTERIES; + int spk = GET_BATTERYIES; + if (game.place[BATTERY] == NOWHERE)spk = LAMP_DIM; + if (game.prop[BATTERY] == 1)spk = MISSING_BATTERYIES; RSPEAK(spk); } } diff --git a/score.c b/score.c index b80104d..1bee09b 100644 --- a/score.c +++ b/score.c @@ -78,7 +78,7 @@ long score(enum termination mode) mxscor += 45; /* Did he come to Witt's End as he should? */ - if (game.place[MAGZIN] == LOC_WITTSEND) + if (game.place[MAGAZINE] == LOC_WITTSEND) score += 1; mxscor += 1;