- 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: game.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: game.newloc=MOD(IABS(TRAVEL[KK])/1000,1000);
- {long x = J-1;
- if(game.newloc > 300 || !INDEEP(game.newloc) || game.newloc == ODLOC[I] || (J > 1 &&
- game.newloc == TK[x]) || J >= 20 || game.newloc == DLOC[I] ||
- FORCED(game.newloc) || (I == 6 && CNDBIT(game.newloc,3)) ||
- IABS(TRAVEL[KK])/1000000 == 100) goto L6014;}
- TK[J]=game.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: game.dtotal=game.dtotal+1;
- if(ODLOC[I] != DLOC[I]) goto L6030;
- ATTACK=ATTACK+1;
- if(game.knfloc >= 0)game.knfloc=LOC;
- if(RAN(1000) < 95*(game.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(game.dtotal == 0) goto L2000;
- SETPRM(1,game.dtotal,0);
- RSPEAK(4+1/game.dtotal);
- if(ATTACK == 0) goto L2000;
- if(game.dflag == 2)game.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;
- game.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],game.abbnum) == 0 || KK == 0)KK=LTEXT[LOC];
- if(FORCED(LOC) || !DARK(0)) goto L2001;
- if(game.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) && !game.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(game.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;
- game.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 game.clock1 unless well into cave (and not at Y2). */
-
-L2603: if(!game.closed) goto L2605;
- if(PROP[OYSTER] < 0 && TOTING(OYSTER))PSPEAK(OYSTER,1);
- for (I=1; I<=100; I++) {
- if(TOTING(I) && PROP[I] < 0)PROP[I]= -1-PROP[I];
- } /* end loop */
-L2605: game.wzdark=DARK(0);
- if(game.knfloc > 0 && game.knfloc != LOC)game.knfloc=0;
- I=RAN(1);
- GETIN(cmdin, WD1,WD1X,WD2,WD2X);
-
-/* Every input, check "game.foobar" flag. If zero, nothing's going on. If pos,
- * make neg. If neg, he skipped a word, so make it zero. */
-
-L2607: game.foobar=(game.foobar>0 ? -game.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)game.clock1=game.clock1-1;
- if(game.clock1 == 0) goto L10000;
- if(game.clock1 < 0)game.clock2=game.clock2-1;
- if(game.clock2 == 0) goto L11000;
- if(PROP[LAMP] == 1)game.limit=game.limit-1;
- if(game.limit <= 30 && HERE(BATTER) && PROP[BATTER] == 0 && HERE(LAMP)) goto
- L12000;
- if(game.limit == 0) goto L12400;
- if(game.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;
- game.iwest=game.iwest+1;
- if(game.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(cmdin, I)) {
- case 2: return;
- 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
- *
- * Given the current location in "LOC", and a motion verb number in
- * "K", put the new location in "game.newloc". The current loc is
- * saved in "game.oldloc" in case he wants to retreat. The current
- * game.oldloc is saved in game.oldlc2, in case he dies. (if he
- * does, game.newloc will be limbo, and game.oldloc will be what
- * killed him, so we need game.oldlc2, which is the last place he was
- * safe.) */
-
-L8: KK=KEY[LOC];
- game.newloc=LOC;
- if(KK == 0)BUG(26);
- if(K == NUL) return;
- if(K == BACK) goto L20;
- if(K == LOOK) goto L30;
- if(K == CAVE) goto L40;
- game.oldlc2=game.oldloc;
- game.oldloc=LOC;
-
-L9: LL=IABS(TRAVEL[KK]);
- if(MOD(LL,1000) == 1 || MOD(LL,1000) == K) goto L10;
- if(TRAVEL[KK] < 0) goto L50;
- KK=KK+1;
- goto L9;
-
-L10: LL=LL/1000;
-L11: game.newloc=LL/1000;
- K=MOD(game.newloc,100);
- if(game.newloc <= 300) goto L13;
- if(PROP[K] != game.newloc/100-3) goto L16;
-L12: if(TRAVEL[KK] < 0)BUG(25);
- KK=KK+1;
- game.newloc=IABS(TRAVEL[KK])/1000;
- if(game.newloc == LL) goto L12;
- LL=game.newloc;
- goto L11;
-
-L13: if(game.newloc <= 100) goto L14;
- if(TOTING(K) || (game.newloc > 200 && AT(K))) goto L16;
- goto L12;
-
-L14: if(game.newloc != 0 && !PCT(game.newloc)) goto L12;
-L16: game.newloc=MOD(LL,1000);
- if(game.newloc <= 300) return;
- if(game.newloc <= 500) goto L30000;
- RSPEAK(game.newloc-500);
- game.newloc=LOC;
- return;
-
-/* Special motions come here. Labelling convention: statement numbers NNNXX
- * (XX=00-99) are used for special case number NNN (NNN=301-500). */
-
-L30000: game.newloc=game.newloc-300;
- switch (game.newloc) { case 1: goto L30100; case 2: goto L30200; case 3: goto
- L30300; }
- BUG(20);
-
-/* Travel 301. Plover-alcove passage. Can carry only emerald. Note: travel
- * table must include "useless" entries going through passage, which can never
- * be used for actual motion, but can be spotted by "go back". */
-
-L30100: game.newloc=99+100-LOC;
- if(game.holdng == 0 || (game.holdng == 1 && TOTING(EMRALD))) return;
- game.newloc=LOC;
- RSPEAK(117);
- return;
-
-/* 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
- * dropped it, go back and pretend he wasn't carrying it after all. */
-
-L30200: DROP(EMRALD,LOC);
- goto L12;
-
-/* Travel 303. Troll bridge. Must be done only as special motion so that
- * dwarves won't wander across and encounter the bear. (They won't follow the
- * player there because that region is forbidden to the pirate.) If
- * PROP(TROLL)=1, he's crossed since paying, so step out and block him.
- * (standard travel entries check for PROP(TROLL)=0.) Special stuff for bear. */
-
-L30300: if(PROP[TROLL] != 1) goto L30310;
- PSPEAK(TROLL,1);
- PROP[TROLL]=0;
- MOVE(TROLL2,0);
- MOVE(TROLL2+100,0);
- MOVE(TROLL,PLAC[TROLL]);
- MOVE(TROLL+100,FIXD[TROLL]);
- JUGGLE(CHASM);
- game.newloc=LOC;
- return;
-
-L30310: game.newloc=PLAC[TROLL]+FIXD[TROLL]-LOC;
- if(PROP[TROLL] == 0)PROP[TROLL]=1;
- if(!TOTING(BEAR)) return;
- RSPEAK(162);
- PROP[CHASM]=1;
- PROP[TROLL]=2;
- DROP(BEAR,game.newloc);
- FIXED[BEAR]= -1;
- PROP[BEAR]=3;
- game.oldlc2=game.newloc;
- goto L99;
-
-/* End of specials. */
-
-/* Handle "go back". Look for verb which goes from LOC to game.oldloc, or to game.oldlc2
- * If game.oldloc has forced-motion. K2 saves entry -> forced loc -> previous loc. */
-
-L20: K=game.oldloc;
- if(FORCED(K))K=game.oldlc2;
- game.oldlc2=game.oldloc;
- game.oldloc=LOC;
- K2=0;
- if(K == LOC)K2=91;
- if(CNDBIT(LOC,4))K2=274;
- if(K2 == 0) goto L21;
- RSPEAK(K2);
- return;
-
-L21: LL=MOD((IABS(TRAVEL[KK])/1000),1000);
- if(LL == K) goto L25;
- if(LL > 300) goto L22;
- J=KEY[LL];
- if(FORCED(LL) && MOD((IABS(TRAVEL[J])/1000),1000) == K)K2=KK;
-L22: if(TRAVEL[KK] < 0) goto L23;
- KK=KK+1;
- goto L21;
-
-L23: KK=K2;
- if(KK != 0) goto L25;
- RSPEAK(140);
- return;
-
-L25: K=MOD(IABS(TRAVEL[KK]),1000);
- KK=KEY[LOC];
- goto L9;
-
-/* Look. Can't give more detail. Pretend it wasn't dark (though it may "now"
- * be dark) so he won't fall into a pit while staring into the gloom. */
-
-L30: if(game.detail < 3)RSPEAK(15);
- game.detail=game.detail+1;
- game.wzdark=false;
- ABB[LOC]=0;
- return;
-
-/* Cave. Different messages depending on whether above ground. */
-
-L40: K=58;
- if(OUTSID(LOC) && LOC != 8)K=57;
- RSPEAK(K);
- return;
-
-/* Non-applicable motion. Various messages depending on word given. */
-
-L50: SPK=12;
- if(K >= 43 && K <= 50)SPK=52;
- if(K == 29 || K == 30)SPK=52;
- if(K == 7 || K == 36 || K == 37)SPK=10;
- if(K == 11 || K == 19)SPK=11;
- if(VERB == FIND || VERB == INVENT)SPK=59;
- if(K == 62 || K == 65)SPK=42;
- if(K == 17)SPK=80;
- RSPEAK(SPK);
- return;
-
-
-
-