KTAB[331], *LINES, LINK[201], LNLENG, LNPOSN,
PARMS[26], PLACE[101], PTEXT[101], RTEXT[278],
SETUP = 0, TABSIZ = 330;
KTAB[331], *LINES, LINK[201], LNLENG, LNPOSN,
PARMS[26], PLACE[101], PTEXT[101], RTEXT[278],
SETUP = 0, TABSIZ = 330;
-signed char INLINE[LINESIZE+1], MAP1[129], MAP2[129];
-signed char raw_input[LINESIZE+1];
+signed char rawbuf[LINESIZE], INLINE[LINESIZE+1], MAP1[129], MAP2[129];
long ABBNUM, ACTSPK[36], AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD, BONUS,
BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST, CHLOC, CHLOC2,
long ABBNUM, ACTSPK[36], AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD, BONUS,
BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST, CHLOC, CHLOC2,
+ score(1);
+}
+
+static bool fallback_handler(signed char *buf)
+/* fallback handler for commands not handled by FORTRANish parser */
+{
+ long sv;
+ if (sscanf(buf, "seed %ld", &sv) == 1) {
+ set_seed(sv);
+ printf("Seed set to %ld\n", sv);
+ // here we reconfigure any global game state that uses random numbers
+ ZZWORD=RNDVOC(3,0)+MESH*2;
+ return true;
+ }
+ return false;
- GETIN(cmdin, WD1,WD1X,WD2,WD2X);
+ if (!GETIN(cmdin, WD1,WD1X,WD2,WD2X))
+ return false;
/* Every input, check "FOOBAR" flag. If zero, nothing's going on. If pos,
* make neg. If neg, he skipped a word, so make it zero. */
/* Every input, check "FOOBAR" flag. If zero, nothing's going on. If pos,
* make neg. If neg, he skipped a word, so make it zero. */
/* Gee, I don't understand. */
L3000: SETPRM(1,WD1,WD1X);
/* Gee, I don't understand. */
L3000: SETPRM(1,WD1,WD1X);
- /* This is a kludge. The command parser we inherited from the base 2.5
- * barfs on numeric tokens. It will fall through to here when it sees
- * seed NNNN. Instead of barfing, go straight to the action processor
- * where it will examine the raw input. This will fo away when we get
- * rid of the obfuscated FORTRANoid input processing.
- */
- if (strncmp(raw_input, "seed", 4) == 0) {
- I=4090; K=34;
- goto Laction;
- } else {
- RSPEAK(254);
- goto L2600;
- }
+ if (fallback_handler(rawbuf))
+ return true;
+ RSPEAK(254);
+ goto L2600;
L14: if(NEWLOC != 0 && !PCT(NEWLOC)) goto L12;
L16: NEWLOC=MOD(LL,1000);
L14: if(NEWLOC != 0 && !PCT(NEWLOC)) goto L12;
L16: NEWLOC=MOD(LL,1000);
/* Special motions come here. Labelling convention: statement numbers NNNXX
* (XX=00-99) are used for special case number NNN (NNN=301-500). */
/* Special motions come here. Labelling convention: statement numbers NNNXX
* (XX=00-99) are used for special case number NNN (NNN=301-500). */
* be used for actual motion, but can be spotted by "go back". */
L30100: NEWLOC=99+100-LOC;
* be used for actual motion, but can be spotted by "go back". */
L30100: NEWLOC=99+100-LOC;
/* Travel 302. Plover transport. Drop the emerald (only use special travel if
* toting it), so he's forced to use the plover-passage to get it out. Having
/* Travel 302. Plover transport. Drop the emerald (only use special travel if
* toting it), so he's forced to use the plover-passage to get it out. Having
/* Another way we can force an end to things is by having the lamp give out.
* When it gets close, we come here to warn him. We go to 12000 if the lamp
/* Another way we can force an end to things is by having the lamp give out.
* When it gets close, we come here to warn him. We go to 12000 if the lamp