-L2: if(!OUTSID(NEWLOC) || NEWLOC == 0 || !CLOSNG) goto L71;
- RSPEAK(130);
- NEWLOC=LOC;
- if(!PANIC)CLOCK2=15;
- PANIC=true;
-
-/* SEE IF A DWARF HAS SEEN HIM AND HAS COME FROM WHERE HE WANTS TO GO. IF SO,
- * THE DWARF'S BLOCKING HIS WAY. IF COMING FROM PLACE FORBIDDEN TO PIRATE
- * (DWARVES ROOTED IN PLACE) LET HIM GET OUT (AND ATTACKED). */
-
-L71: if(NEWLOC == LOC || FORCED(LOC) || CNDBIT(LOC,3)) goto L74;
- /* 73 */ for (I=1; I<=5; I++) {
- if(ODLOC[I] != NEWLOC || !DSEEN[I]) goto L73;
- NEWLOC=LOC;
- RSPEAK(2);
- goto L74;
-L73: /*etc*/ ;
- } /* end loop */
-L74: LOC=NEWLOC;
-
-/* DWARF STUFF. SEE EARLIER COMMENTS FOR DESCRIPTION OF VARIABLES. REMEMBER
- * SIXTH DWARF IS PIRATE AND IS THUS VERY DIFFERENT EXCEPT FOR MOTION RULES. */
-
-/* FIRST OFF, DON'T LET THE DWARVES FOLLOW HIM INTO A PIT OR A WALL. ACTIVATE
- * THE WHOLE MESS THE FIRST TIME HE GETS AS FAR AS THE HALL OF MISTS (LOC 15).
- * IF NEWLOC IS FORBIDDEN TO PIRATE (IN PARTICULAR, IF IT'S BEYOND THE TROLL
- * BRIDGE), BYPASS DWARF STUFF. THAT WAY PIRATE CAN'T STEAL RETURN TOLL, AND
- * DWARVES CAN'T MEET THE BEAR. ALSO MEANS DWARVES WON'T FOLLOW HIM INTO DEAD
- * END IN MAZE, BUT C'EST LA VIE. THEY'LL WAIT FOR HIM OUTSIDE THE DEAD END. */
-
- if(LOC == 0 || FORCED(LOC) || CNDBIT(NEWLOC,3)) goto L2000;
- if(DFLAG != 0) goto L6000;
- if(INDEEP(LOC))DFLAG=1;
- goto L2000;
-
-/* WHEN WE ENCOUNTER THE FIRST DWARF, WE KILL 0, 1, OR 2 OF THE 5 DWARVES. IF
- * ANY OF THE SURVIVORS IS AT LOC, REPLACE HIM WITH THE ALTERNATE. */
-
-L6000: if(DFLAG != 1) goto L6010;
- if(!INDEEP(LOC) || (PCT(95) && (!CNDBIT(LOC,4) || PCT(85)))) goto L2000;
- DFLAG=2;
- /* 6001 */ for (I=1; I<=2; I++) {
- J=1+RAN(5);
-L6001: if(PCT(50))DLOC[J]=0;
- } /* end loop */
- /* 6002 */ for (I=1; I<=5; I++) {
- if(DLOC[I] == LOC)DLOC[I]=DALTLC;
-L6002: ODLOC[I]=DLOC[I];
- } /* end loop */
- RSPEAK(3);
- DROP(AXE,LOC);
- goto L2000;
-
-/* THINGS ARE IN FULL SWING. MOVE EACH DWARF AT RANDOM, EXCEPT IF HE'S SEEN US
- * HE STICKS WITH US. DWARVES STAY DEEP INSIDE. IF WANDERING AT RANDOM,
- * THEY DON'T BACK UP UNLESS THERE'S NO ALTERNATIVE. IF THEY DON'T HAVE TO
- * MOVE, THEY ATTACK. AND, OF COURSE, DEAD DWARVES DON'T DO MUCH OF ANYTHING. */
-
-L6010: DTOTAL=0;
- ATTACK=0;
- STICK=0;
- /* 6030 */ for (I=1; I<=6; I++) {
- if(DLOC[I] == 0) goto L6030;
-/* FILL TK ARRAY WITH ALL THE PLACES THIS DWARF MIGHT GO. */
- J=1;
- KK=DLOC[I];
- KK=KEY[KK];
- if(KK == 0) goto L6016;
-L6012: NEWLOC=MOD(IABS(TRAVEL[KK])/1000,1000);
- {long x = J-1;
- if(NEWLOC > 300 || !INDEEP(NEWLOC) || NEWLOC == ODLOC[I] || (J > 1 &&
- NEWLOC == TK[x]) || J >= 20 || NEWLOC == DLOC[I] ||
- FORCED(NEWLOC) || (I == 6 && CNDBIT(NEWLOC,3)) ||
- IABS(TRAVEL[KK])/1000000 == 100) goto L6014;}
- TK[J]=NEWLOC;
- J=J+1;
-L6014: KK=KK+1;
- {long x = KK-1; if(TRAVEL[x] >= 0) goto L6012;}
-L6016: TK[J]=ODLOC[I];
- if(J >= 2)J=J-1;
- J=1+RAN(J);
- ODLOC[I]=DLOC[I];
- DLOC[I]=TK[J];
- DSEEN[I]=(DSEEN[I] && INDEEP(LOC)) || (DLOC[I] == LOC || ODLOC[I] == LOC);
- if(!DSEEN[I]) goto L6030;
- DLOC[I]=LOC;
- if(I != 6) goto L6027;
-
-/* THE PIRATE'S SPOTTED HIM. HE LEAVES HIM ALONE ONCE WE'VE FOUND CHEST. K
- * COUNTS IF A TREASURE IS HERE. IF NOT, AND TALLY=1 FOR AN UNSEEN CHEST, LET
- * THE PIRATE BE SPOTTED. NOTE THAT PLACE(CHEST)=0 MIGHT MEAN THAT HE'S
- * THROWN IT TO THE TROLL, BUT IN THAT CASE HE'S SEEN THE CHEST (PROP=0). */
-
- if(LOC == CHLOC || PROP[CHEST] >= 0) goto L6030;
- K=0;
- /* 6020 */ for (J=50; J<=MAXTRS; J++) {
-/* PIRATE WON'T TAKE PYRAMID FROM PLOVER ROOM OR DARK ROOM (TOO EASY!). */
- if(J == PYRAM && (LOC == PLAC[PYRAM] || LOC == PLAC[EMRALD])) goto L6020;
- if(TOTING(J)) goto L6021;
-L6020: if(HERE(J))K=1;
- } /* end loop */
- if(TALLY == 1 && K == 0 && PLACE[CHEST] == 0 && HERE(LAMP) && PROP[LAMP]
- == 1) goto L6025;
- if(ODLOC[6] != DLOC[6] && PCT(20))RSPEAK(127);
- goto L6030;
-
-L6021: if(PLACE[CHEST] != 0) goto L6022;
-/* INSTALL CHEST ONLY ONCE, TO INSURE IT IS THE LAST TREASURE IN THE LIST. */
- MOVE(CHEST,CHLOC);
- MOVE(MESSAG,CHLOC2);
-L6022: RSPEAK(128);
- /* 6023 */ for (J=50; J<=MAXTRS; J++) {
- if(J == PYRAM && (LOC == PLAC[PYRAM] || LOC == PLAC[EMRALD])) goto L6023;
- if(AT(J) && FIXED[J] == 0)CARRY(J,LOC);
- if(TOTING(J))DROP(J,CHLOC);
-L6023: /*etc*/ ;
- } /* end loop */
-L6024: DLOC[6]=CHLOC;
- ODLOC[6]=CHLOC;
- DSEEN[6]=false;
- goto L6030;
-
-L6025: RSPEAK(186);
- MOVE(CHEST,CHLOC);
- MOVE(MESSAG,CHLOC2);
- goto L6024;
-
-/* THIS THREATENING LITTLE DWARF IS IN THE ROOM WITH HIM! */
-
-L6027: DTOTAL=DTOTAL+1;
- if(ODLOC[I] != DLOC[I]) goto L6030;
- ATTACK=ATTACK+1;
- if(KNFLOC >= 0)KNFLOC=LOC;
- if(RAN(1000) < 95*(DFLAG-2))STICK=STICK+1;
-L6030: /*etc*/ ;
- } /* end loop */
-
-/* NOW WE KNOW WHAT'S HAPPENING. LET'S TELL THE POOR SUCKER ABOUT IT.
- * NOTE THAT VARIOUS OF THE "KNIFE" MESSAGES MUST HAVE SPECIFIC RELATIVE
- * POSITIONS IN THE RSPEAK DATABASE. */
-
- if(DTOTAL == 0) goto L2000;
- SETPRM(1,DTOTAL,0);
- RSPEAK(4+1/DTOTAL);
- if(ATTACK == 0) goto L2000;
- if(DFLAG == 2)DFLAG=3;
- SETPRM(1,ATTACK,0);
- K=6;
- if(ATTACK > 1)K=250;
- RSPEAK(K);
- SETPRM(1,STICK,0);
- RSPEAK(K+1+2/(1+STICK));
- if(STICK == 0) goto L2000;
- OLDLC2=LOC;
- goto L99;
-
-
-
-
-
-
-/* DESCRIBE THE CURRENT LOCATION AND (MAYBE) GET NEXT COMMAND. */
-
-/* PRINT TEXT FOR CURRENT LOC. */
-
-L2000: if(LOC == 0) goto L99;
- KK=STEXT[LOC];
- if(MOD(ABB[LOC],ABBNUM) == 0 || KK == 0)KK=LTEXT[LOC];
- if(FORCED(LOC) || !DARK(0)) goto L2001;
- if(WZDARK && PCT(35)) goto L90;
- KK=RTEXT[16];
-L2001: if(TOTING(BEAR))RSPEAK(141);
- SPEAK(KK);
- K=1;
- if(FORCED(LOC)) goto L8;
- if(LOC == 33 && PCT(25) && !CLOSNG)RSPEAK(7);
-
-/* PRINT OUT DESCRIPTIONS OF OBJECTS AT THIS LOCATION. IF NOT CLOSING AND
- * PROPERTY VALUE IS NEGATIVE, TALLY OFF ANOTHER TREASURE. RUG IS SPECIAL
- * CASE; ONCE SEEN, ITS PROP IS 1 (DRAGON ON IT) TILL DRAGON IS KILLED.
- * SIMILARLY FOR CHAIN; PROP IS INITIALLY 1 (LOCKED TO BEAR). THESE HACKS
- * ARE BECAUSE PROP=0 IS NEEDED TO GET FULL SCORE. */
-
- if(DARK(0)) goto L2012;
- ABB[LOC]=ABB[LOC]+1;
- I=ATLOC[LOC];
-L2004: if(I == 0) goto L2012;
- OBJ=I;
- if(OBJ > 100)OBJ=OBJ-100;
- if(OBJ == STEPS && TOTING(NUGGET)) goto L2008;
- if(PROP[OBJ] >= 0) goto L2006;
- if(CLOSED) goto L2008;
- PROP[OBJ]=0;
- if(OBJ == RUG || OBJ == CHAIN)PROP[OBJ]=1;
- TALLY=TALLY-1;
-/* NOTE: THERE USED TO BE A TEST HERE TO SEE WHETHER THE PLAYER HAD BLOWN IT
- * SO BADLY THAT HE COULD NEVER EVER SEE THE REMAINING TREASURES, AND IF SO
- * THE LAMP WAS ZAPPED TO 35 TURNS. BUT THE TESTS WERE TOO SIMPLE-MINDED;
- * THINGS LIKE KILLING THE BIRD BEFORE THE SNAKE WAS GONE (CAN NEVER SEE
- * JEWELRY), AND DOING IT "RIGHT" WAS HOPELESS. E.G., COULD CROSS TROLL
- * BRIDGE SEVERAL TIMES, USING UP ALL AVAILABLE TREASURES, BREAKING VASE,
- * USING COINS TO BUY BATTERIES, ETC., AND EVENTUALLY NEVER BE ABLE TO GET
- * ACROSS AGAIN. IF BOTTLE WERE LEFT ON FAR SIDE, COULD THEN NEVER GET EGGS
- * OR TRIDENT, AND THE EFFECTS PROPAGATE. SO THE WHOLE THING WAS FLUSHED.
- * ANYONE WHO MAKES SUCH A GROSS BLUNDER ISN'T LIKELY TO FIND EVERYTHING
- * ELSE ANYWAY (SO GOES THE RATIONALISATION). */
-L2006: KK=PROP[OBJ];
- if(OBJ == STEPS && LOC == FIXED[STEPS])KK=1;
- PSPEAK(OBJ,KK);
-L2008: I=LINK[I];
- goto L2004;
-
-L2009: K=54;
-L2010: SPK=K;
-L2011: RSPEAK(SPK);
-
-L2012: VERB=0;
- OLDOBJ=OBJ;
- OBJ=0;
-
-/* CHECK IF THIS LOC IS ELIGIBLE FOR ANY HINTS. IF BEEN HERE LONG ENOUGH,
- * BRANCH TO HELP SECTION (ON LATER PAGE). HINTS ALL COME BACK HERE EVENTUALLY
- * TO FINISH THE LOOP. IGNORE "HINTS" < 4 (SPECIAL STUFF, SEE DATABASE NOTES).
- */
-
-L2600: if(COND[LOC] < CONDS) goto L2603;
- /* 2602 */ for (HINT=1; HINT<=HNTMAX; HINT++) {
- if(HINTED[HINT]) goto L2602;
- if(!CNDBIT(LOC,HINT+10))HINTLC[HINT]= -1;
- HINTLC[HINT]=HINTLC[HINT]+1;
- if(HINTLC[HINT] >= HINTS[HINT][1]) goto L40000;
-L2602: /*etc*/ ;
- } /* end loop */
-
-/* KICK THE RANDOM NUMBER GENERATOR JUST TO ADD VARIETY TO THE CHASE. ALSO,
- * IF CLOSING TIME, CHECK FOR ANY OBJECTS BEING TOTED WITH PROP < 0 AND SET
- * THE PROP TO -1-PROP. THIS WAY OBJECTS WON'T BE DESCRIBED UNTIL THEY'VE
- * BEEN PICKED UP AND PUT DOWN SEPARATE FROM THEIR RESPECTIVE PILES. DON'T
- * TICK CLOCK1 UNLESS WELL INTO CAVE (AND NOT AT Y2). */
-
-L2603: if(!CLOSED) goto L2605;
- if(PROP[OYSTER] < 0 && TOTING(OYSTER))PSPEAK(OYSTER,1);
- /* 2604 */ for (I=1; I<=100; I++) {
-L2604: if(TOTING(I) && PROP[I] < 0)PROP[I]= -1-PROP[I];
- } /* end loop */
-L2605: WZDARK=DARK(0);
- if(KNFLOC > 0 && KNFLOC != LOC)KNFLOC=0;
- I=RAN(1);
- GETIN(WD1,WD1X,WD2,WD2X);
-
-/* 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. */
-
-L2607: FOOBAR=(FOOBAR>0 ? -FOOBAR : 0);
- TURNS=TURNS+1;
- if(TURNS != THRESH) goto L2608;
- SPEAK(TTEXT[TRNDEX]);
- TRNLUZ=TRNLUZ+TRNVAL[TRNDEX]/100000;
- TRNDEX=TRNDEX+1;
- THRESH= -1;
- if(TRNDEX <= TRNVLS)THRESH=MOD(TRNVAL[TRNDEX],100000)+1;
-L2608: if(VERB == SAY && WD2 > 0)VERB=0;
- if(VERB == SAY) goto L4090;
- if(TALLY == 0 && INDEEP(LOC) && LOC != 33)CLOCK1=CLOCK1-1;
- if(CLOCK1 == 0) goto L10000;
- if(CLOCK1 < 0)CLOCK2=CLOCK2-1;
- if(CLOCK2 == 0) goto L11000;
- if(PROP[LAMP] == 1)LIMIT=LIMIT-1;
- if(LIMIT <= 30 && HERE(BATTER) && PROP[BATTER] == 0 && HERE(LAMP)) goto
- L12000;
- if(LIMIT == 0) goto L12400;
- if(LIMIT <= 30) goto L12200;
-L19999: K=43;
- if(LIQLOC(LOC) == WATER)K=70;
- V1=VOCAB(WD1,-1);
- V2=VOCAB(WD2,-1);
- if(V1 == ENTER && (V2 == STREAM || V2 == 1000+WATER)) goto L2010;
- if(V1 == ENTER && WD2 > 0) goto L2800;
- if((V1 != 1000+WATER && V1 != 1000+OIL) || (V2 != 1000+PLANT && V2 !=
- 1000+DOOR)) goto L2610;
- {long x = V2-1000; if(AT(x))WD2=MAKEWD(16152118);}
-L2610: if(V1 == 1000+CAGE && V2 == 1000+BIRD && HERE(CAGE) &&
- HERE(BIRD))WD1=MAKEWD(301200308);
-L2620: if(WD1 != MAKEWD(23051920)) goto L2625;
- IWEST=IWEST+1;
- if(IWEST == 10)RSPEAK(17);
-L2625: if(WD1 != MAKEWD( 715) || WD2 == 0) goto L2630;
- IGO=IGO+1;
- if(IGO == 10)RSPEAK(276);
-L2630: I=VOCAB(WD1,-1);
- if(I == -1) goto L3000;
- K=MOD(I,1000);
- KQ=I/1000+1;
- switch (KQ-1) { case 0: goto L8; case 1: goto L5000; case 2: goto L4000;
- case 3: goto L2010; }
- BUG(22);
-
-/* GET SECOND WORD FOR ANALYSIS. */
-
-L2800: WD1=WD2;
- WD1X=WD2X;
- WD2=0;
- goto L2620;
-
-/* GEE, I DON'T UNDERSTAND. */
-
-L3000: SETPRM(1,WD1,WD1X);
- RSPEAK(254);
- goto L2600;
-
-/* VERB AND OBJECT ANALYSIS MOVED TO SEPARATE MODULE. */
-
-L4000: I=4000; goto Laction;
-L4090: I=4090; goto Laction;
-L5000: I=5000;
-Laction:
- switch (action(I)) {
- case 2: goto L2;
- case 8: goto L8;
- case 2000: goto L2000;
- case 2009: goto L2009;
- case 2010: goto L2010;
- case 2011: goto L2011;
- case 2012: goto L2012;
- case 2600: goto L2600;
- case 2607: goto L2607;
- case 2630: goto L2630;
- case 2800: goto L2800;
- case 8000: goto L8000;
- case 18999: goto L18999;
- case 19000: goto L19000;
- }
- BUG(99);
-
-/* RANDOM INTRANSITIVE VERBS COME HERE. CLEAR OBJ JUST IN CASE (SEE "ATTACK").
- */
-
-L8000: SETPRM(1,WD1,WD1X);
- RSPEAK(257);
- OBJ=0;
- goto L2600;
-
-/* FIGURE OUT THE NEW LOCATION