-L6000: if(game.dflag != 1) goto L6010;
- if(!INDEEP(game.loc) || (PCT(95) && (!CNDBIT(game.loc,4) || PCT(85)))) goto L2000;
- game.dflag=2;
- for (I=1; I<=2; I++) {
- J=1+randrange(NDWARVES-1);
- if(PCT(50))game.dloc[J]=0;
- } /* end loop */
- for (I=1; I<=NDWARVES-1; I++) {
- if(game.dloc[I] == game.loc)game.dloc[I]=DALTLC;
- game.odloc[I]=game.dloc[I];
- } /* end loop */
- RSPEAK(3);
- DROP(AXE,game.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<=NDWARVES; I++) {
- if(game.dloc[I] == 0) goto L6030;
-/* Fill TK array with all the places this dwarf might go. */
- J=1;
- KK=game.dloc[I];
- KK=KEY[KK];
- if(KK == 0) goto L6016;
-L6012: game.newloc=MOD(labs(TRAVEL[KK])/1000,1000);
- {long x = J-1;
- if(game.newloc > 300 || !INDEEP(game.newloc) || game.newloc == game.odloc[I] || (J > 1 &&
- game.newloc == TK[x]) || J >= 20 || game.newloc == game.dloc[I] ||
- FORCED(game.newloc) || (I == 6 && CNDBIT(game.newloc,3)) ||
- labs(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]=game.odloc[I];
- if(J >= 2)J=J-1;
- J=1+randrange(J);
- game.odloc[I]=game.dloc[I];
- game.dloc[I]=TK[J];
- game.dseen[I]=(game.dseen[I] && INDEEP(game.loc)) || (game.dloc[I] == game.loc || game.odloc[I] == game.loc);
- if(!game.dseen[I]) goto L6030;
- game.dloc[I]=game.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 game.place(CHEST)=0 might mean that he's
- * thrown it to the troll, but in that case he's seen the chest (game.prop=0). */
-
- if(game.loc == game.chloc || game.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 && (game.loc == PLAC[PYRAM] || game.loc == PLAC[EMRALD])) goto L6020;
- if(TOTING(J)) goto L6021;
-L6020: if(HERE(J))K=1;
- } /* end loop */
- if(game.tally == 1 && K == 0 && game.place[CHEST] == 0 && HERE(LAMP) && game.prop[LAMP]
- == 1) goto L6025;
- if(game.odloc[6] != game.dloc[6] && PCT(20))RSPEAK(127);
- goto L6030;
-
-L6021: if(game.place[CHEST] != 0) goto L6022;
-/* Install chest only once, to insure it is the last treasure in the list. */
- MOVE(CHEST,game.chloc);
- MOVE(MESSAG,game.chloc2);
-L6022: RSPEAK(128);
- /* 6023 */ for (J=50; J<=MAXTRS; J++) {
- if(J == PYRAM && (game.loc == PLAC[PYRAM] || game.loc == PLAC[EMRALD])) goto L6023;
- if(AT(J) && game.fixed[J] == 0)CARRY(J,game.loc);
- if(TOTING(J))DROP(J,game.chloc);
-L6023: /*etc*/ ;
- } /* end loop */
-L6024: game.dloc[6]=game.chloc;
- game.odloc[6]=game.chloc;
- game.dseen[6]=false;
- goto L6030;
-
-L6025: RSPEAK(186);
- MOVE(CHEST,game.chloc);
- MOVE(MESSAG,game.chloc2);
- goto L6024;
-
-/* This threatening little dwarf is in the room with him! */
-
-L6027: game.dtotal=game.dtotal+1;
- if(game.odloc[I] != game.dloc[I]) goto L6030;
- ATTACK=ATTACK+1;
- if(game.knfloc >= 0)game.knfloc=game.loc;
- if(randrange(1000) < 95*(game.dflag-2))STICK=STICK+1;
-L6030: /*etc*/ ;
- } /* end loop */