
C  FEED BEAR?
22140   SPK=102
       IF(IOBJ.NE.BEAR)GOTO 22150
       IF(PROP(BEAR).EQ.3)SPK=NOWAY(0)
       IF(PROP(BEAR).EQ.1.OR.PROP(BEAR).EQ.2)SPK=264
       IF(OBJ.EQ.FOOD)SPK=278
       IF(OBJ.NE.HONEY)GOTO 2011
       PROP(BEAR)=1
       FIXED(AXE)=0
       PROP(AXE)=0
       SPK=168
       CALL DSTROY(HONEY)
       GOTO 2011

C  FEED DOG?
22150   IF(IOBJ.NE.DOG)GOTO 22160
       IF(PROP(DOG).EQ.1)SPK=291
       IF(OBJ.NE.FOOD.OR.PROP(DOG).EQ.1)GOTO 2011
       SPK=249
       CALL DSTROY(FOOD)
       GOTO 2011

C  FEED WUMPUS?
22160   IF(IOBJ.NE.WUMPUS)GOTO 22170
       IF(PROP(WUMPUS).EQ.6)SPK=326
       IF(PROP(WUMPUS).EQ.0)SPK=327
       IF(OBJ.EQ.FOOD)SPK=240
       GOTO 2011

C  FEED BEES?
22170   IF(IOBJ.NE.BEES.OR.OBJ.NE.FLOWER)GOTO 2070
       IF(ENCLSD(FLOWER))CALL REMOVE(FLOWER)
       CALL DROP(FLOWER,LOC)
       FIXED(FLOWER)=-1
       PROP(FLOWER)=1
       CALL DROP(HONEY,LOC)
       CALL JUGGLE(HONEY)
       SPK=267
       PROP(HIVE)=1
       GOTO 2011
C  FILL.  BOTTLE/CASK MUST BE EMPTY, AND SOME LIQUID AVAILABLE.
C  (VASE IS NASTY & GRAIL IS CRACKED.)
12200   IF( (.NOT.HERE(BOTTLE).AND..NOT.HERE(CASK)) .OR.
     1  (HERE(BOTTLE).AND.HERE(CASK)) )GOTO 10000
       IF(PROP(CASK).EQ.1.AND.HERE(CASK))OBJ=CASK
       IF(PROP(BOTTLE).EQ.1.AND.HERE(BOTTLE))OBJ=BOTTLE
       IF(OBJ.EQ.0)GOTO 10000

C  FILL OBJ WITH IOBJ
22200   SPK=313
       IF(.NOT.VESSEL(OBJ))GOTO 2011
       IF(IOBJ.EQ.0)IOBJ=LIQLOC(LOC)
       IF(OBJ.NE.BOTTLE.AND.OBJ.NE.CASK)GOTO 22220
       K=0
       IF(OBJ.EQ.CASK)K=1
       SPK=0
       IF(IOBJ.EQ.0)SPK=304+K
       IF(LIQ(OBJ).NE.0)SPK=302+K
       IF(SPK.NE.0)GOTO 2011
       SPK=306+K
       IF(IOBJ.EQ.OIL)SPK=308+K
       IF(IOBJ.EQ.WINE)SPK=310+K
       PROP(OBJ)=MOD(LOCCON(LOC),8)/2*2
       PLACE(IOBJ+K)=-1
       CALL INSERT(IOBJ+K,OBJ)
       GOTO 2011

C  VASE.  (NASTY).
22220   IF(OBJ.NE.VASE)GOTO 22230
       SPK=144
       IF(IOBJ.EQ.0.OR..NOT.HOLDNG(VASE))GOTO 2011
       CALL RSPEAK(145)
       PROP(VASE)=2
       FIXED(VASE)=-1
       GOTO 20290

C  GRAIL OR OTHER.
22230   SPK=339
       IF(OBJ.EQ.GRAIL)SPK=298
       GOTO 2011

C  BLAST.  NO EFFECT UNLESS YOU'VE GOT DYNAMITE, WHICH IS A NEAT TRICK!

12300   IF(PROP(ROD2).GT.0.AND.CLOSED)GOTO 12310
      IF(.NOT.ISWIZ)GOTO 2011
      DO 12305 I=1,5
      IF(LOC.NE.DLOC(I))GOTO 12305
      DLOC(I)=0
      DSEEN(I)=.FALSE.
12305       CONTINUE
      GOTO 2011
12310  BONUS=133
       IF(LOC.EQ.115)BONUS=134
       IF(HERE(ROD2))BONUS=135
       CALL RSPEAK(BONUS)
       GOTO 95000
C  SCORE.

12400   SCORNG=.TRUE.
       CALL RATING(SCORE,MXSCOR,BONUS,GAVEUP,SCORNG,CLOSNG,CLOSED)
       SCORNG=.FALSE.
       PRINT 12412,SCORE,MXSCOR,TURNS
12412   FORMAT(/' If you were to quit now, you would score',I4
     1  ,' out of',I4,' using',I4,' turns.')
C       GAVEUP=YES(143,54,54)
C       GOTO 11850
      GOTO 2100

C  FEE FIE FOE FOO (AND FUM).  ADVANCE TO NEXT STATE IF GIVEN IN PROPER ORDER.
C  LOOK UP WD1 IN SECTION 3 OF VOCAB TO DETERMINE WHICH WORD WE'VE GOT.  LAST
C  WORD ZIPS THE EGGS BACK TO THE GIANT ROOM (UNLESS ALREADY THERE).

12500   K=VOCABX(VTXT(VRBX,1),4)
       SPK=42
       IF(FOOBAR.EQ.1-K)GOTO 12520
       IF(FOOBAR.NE.0)SPK=151
       GOTO 2011

12520   FOOBAR=K
       IF(K.NE.4)GOTO 2009
       FOOBAR=0
       IF(PLACE(EGGS).EQ.PLAC(EGGS)
     1  .OR.(TOTING(EGGS).AND.LOC.EQ.PLAC(EGGS)))GOTO 2011
C  BRING BACK TROLL IF WE STEAL THE EGGS BACK FROM HIM BEFORE CROSSING.
       IF(PLACE(EGGS).EQ.0.AND.PLACE(TROLL).EQ.0.AND.PROP(TROLL).EQ.0)
     1  PROP(TROLL)=1
       K=2
       IF(HERE(EGGS))K=1
       IF(LOC.EQ.PLAC(EGGS))K=0
       CALL MOVE(EGGS,PLAC(EGGS))
       CALL PSPEAK(EGGS,K)
       GOTO 2100

C  BRIEF/UNBRIEF.  INTRANSITIVE ONLY.
C  SUPPRESS LONG DESCRIPTIONS AFTER FIRST TIME.

12600   DETAIL=3
       TERSE=.FALSE.
       IF(ABBNUM.EQ.10000)GOTO 12610
       SPK=156
       ABBNUM=10000
       GOTO 2011

12610   ABBNUM=5
       SPK=374
       GOTO 2011

22600   IF(OBJ.NE.0.AND.LIVING(OBJ).AND.IOBJ.NE.0)GOTO 2011
       GOTO 2060

C  READ.  MAGAZINES IN DWARVISH, MESSAGE WE'VE SEEN, AND . . . OYSTER?

22700   IF(BLIND(0))GOTO 2011
       IF(OBJ.NE.0.AND.IOBJ.NE.0)GOTO 2060
       SPK=CONFUZ(0)
       IF(OBJ.EQ.0)OBJ=IOBJ
       IF(OBJ.EQ.BOOK.OR.OBJ.EQ.BOOK2)SPK=142
       IF(OBJ.EQ.BILLBD)SPK=361
       IF(OBJ.EQ.CARVNG)SPK=372
       IF(OBJ.EQ.MAGZIN)SPK=190
       IF(OBJ.EQ.MESSAG)SPK=191
       IF(OBJ.EQ.OYSTER.AND.HINTED(2).AND.HOLDNG(OYSTER))SPK=194
       IF(OBJ.EQ.POSTER)SPK=370
       IF(OBJ.EQ.TABLET)SPK=196
       IF(OBJ.NE.OYSTER.OR.HINTED(2).OR..NOT.HOLDNG(OYSTER)
     1  .OR..NOT.CLOSED)GOTO 2011
       HINTED(2)=YES(192,193,54)
       GOTO 2100
C  BREAK.  WORKS FOR MIRROR IN REPOSITORY AND, OF COURSE, THE
C  VASE AND BOTTLE.  ALSO, THE SWORD IS MORE BRITTLE THAN IT APPEARS.

22800   IF(OBJ.EQ.MIRROR)SPK=148
       IF(OBJ.EQ.VASE.AND.PROP(VASE).EQ.0)GOTO 22820
       IF(OBJ.EQ.BOTTLE.AND.PROP(BOTTLE).NE.3)GOTO 22840
       IF(OBJ.EQ.SWORD)GOTO 22860
       IF(OBJ.NE.MIRROR.OR..NOT.CLOSED)GOTO 2011
       CALL RSPEAK(197)
       GOTO 93000

22820   SPK=198
       PROP(VASE)=2
22830   IF(ENCLSD(OBJ))CALL REMOVE(OBJ)
       IF(HOLDNG(OBJ))CALL DROP(OBJ,LOC)
       FIXED(OBJ)=-1
       GOTO 2011

22840   SPK=231
       K=LIQ(BOTTLE)
       PROP(BOTTLE)=3
       IF(K.EQ.0)GOTO 22830
       CALL REMOVE(K)
       PLACE(K)=0
       GOTO 22830

C  HE'D BETTER NOT SLING THE SWORD AROUND!
22860   SPK=29
       IF(.NOT.HOLDNG(SWORD))GOTO 2011
       SPK=279
       PROP(SWORD)=4
       GOTO 22830

C  ERWACHE.  ONLY USE IS TO DISTURB THE DWARVES OR THE WUMPUS.
C  OTHER WUMPUS-WAKERS LINK HERE.

22900   IF(.NOT.AT(WUMPUS))GOTO 22940
       CHASE=1
       PROP(WUMPUS)=1
       SPK=276
       GOTO 2011

22940   IF(AT(DOG).AND.PROP(DOG).EQ.1)SPK=291
       IF(OBJ.NE.DWARF.OR..NOT.CLOSED)GOTO 2011
       CALL RSPEAK(199)
       GOTO 93000
C  SUSPEND.  OFFER TO EXIT LEAVING THINGS RESTARTABLE, BUT REQUIRING A DELAY
C  BEFORE RESTARTING (SO CAN'T SAVE THE WORLD BEFORE TRYING SOMETHING RISKY).
C  UPON RESTARTING, SETUP=-1 CAUSES RETURN TO 13050 TO PICK UP AGAIN.

13000   SPK=201
       IF(DEMO)GOTO 2011
       PRINT 13010,LATNCY
13010   FORMAT(/' I can suspend your adventure for you so that you can',
     1  ' resume later, but'/' you will have to wait at least',
     2  I3,' minutes before continuing.')
       IF(.NOT.YES(200,54,54))GOTO 2100
       CALL DATIME(SAVED,SAVET)
       SETUP=-1
       CALL CIAO

13050   YEA=START(0)
       SETUP=3
       VERBS(1)=NULL
       VRBX=1
       VERBS(2)=0
       OBJS(1)=0
       OBJX=0
       GOTO 2750

C  HOURS.  REPORT CURRENT NON-PRIME-TIME HOURS.

13100   CALL MSPEAK(6)
       CALL HOURS
       GOTO 2100


C  YANK.  A VARIANT OF 'CARRY'.  IN GENERAL, NOT A GOOD IDEA.
C  AT MOST, IT GETS THE CLOAK OR A COUPLE SNIDE COMMENTS.

23200   IF(TOTING(OBJ))GOTO 20200
       IF(OBJ.EQ.PLANT.OR.OBJ.EQ.SWORD.OR.OBJ.EQ.CHAIN)GOTO 20100
       SPK=205
       IF(OBJ.EQ.BEAR.AND.PROP(CHAIN).EQ.1)GOTO 2011
       IF(OBJ.EQ.CLOAK.AND.PROP(CLOAK).EQ.2)GOTO 20120
       GOTO 20100

C  WEAR: ONLY GOOD FOR JEWELS, RUBY SLIPPERS, CLOAK & CROWN.
C  BUT HE MIGHT TRY THE SWORD.  ANYTHING ELSE IS RIDICULOUS.
C  ANOTHER VARIANT OF 'CARRY'.

23300   SPK=209
       IF(OBJ.EQ.SWORD.AND.PROP(SWORD).NE.3)GOTO 2011
       IF(WORN(OBJ))GOTO 23320
23310   CALL A5TOA1(OTXT(OBJX,1),OTXT(OBJX,2),'?',TK,K)
       PRINT 23312,(TK(I),I=1,K)
23312   FORMAT(/' Just exactly how does one wear a ',20A1)
       GOTO 2100

23320   SPK=242
       IF(OBJ.EQ.CLOAK.AND.PROP(CLOAK).EQ.2)GOTO 2011
       SPK=210
       IF(OBJ.EQ.SHOES)SPK=227
       IF(WEARNG(OBJ))GOTO 2011
       PROP(OBJ)=1
       CALL BITON(OBJ,WEARBT)
       IF(ENCLSD(OBJ))CALL REMOVE(OBJ)
       IF(HOLDNG(OBJ))GOTO 2009
       GOTO 20120
C  HIT.  IF NOT PUNCHING OUT TELEPHONE, ASSUME ATTACK.

23400   IF(AT(WUMPUS).AND.PROP(WUMPUS).EQ.0)GOTO 22900
       IF(OBJ.NE.PHONE)GOTO 21200
       IF(CLOSED)GOTO 93100
       SPK=256
       IF(PROP(PHONE).EQ.2)GOTO 2011
       CALL DROP(SLUGS,LOC)
       SPK=257
       PROP(PHONE)=2
       PROP(BOOTH)=2
       GOTO 2011

C  ANSWER (TELEPHONE).  SMARTASS FOR ANYTHING ELSE.
13500   IF(LOC.NE.189.OR.PROP(PHONE).NE.0)GOTO 10000
       OBJ=PHONE
23500   IF(OBJ.NE.PHONE)GOTO 23520
       SPK=269
       IF(PROP(PHONE).NE.0)GOTO 2011
       IF(CLOSED)GOTO 93200
       SPK=261
       PROP(PHONE)=1
       PROP(BOOTH)=2
       GOTO 2011

23520   IF(OBJ.EQ.DWARF.OR.OBJ.EQ.WUMPUS.OR.OBJ.EQ.SNAKE.OR.OBJ.EQ.BEAR
     1  .OR.OBJ.EQ.DRAGON)SPK=259
       IF(OBJ.EQ.TROLL)SPK=258
       IF(OBJ.EQ.BIRD)SPK=260
       GOTO 2011
C  BLOW.  JOSHUA FIT DE BATTLE OF JERICHO, AND DE WALLS....

23600   IF(OBJ.NE.0.AND.IOBJ.NE.0)GOTO 2060
       IF(OBJ.EQ.0)OBJ=IOBJ
       IOBJ=0
       IF(OBJ.EQ.0)SPK=268
       IF(OBJ.NE.HORN)GOTO 2011
       SPK=266
       IF(OUTSID(LOC))SPK=277
       IF(.NOT.AT(WUMPUS))GOTO 23610
       IF(PROP(WUMPUS).NE.0)GOTO 2011
       CALL RSPEAK(SPK)
       GOTO 22900

23610   IF(PROP(WALL).EQ.1.OR.(LOC.NE.102.AND.LOC.NE.194))GOTO 2011
       K=196
       IF(LOC.EQ.194)K=195
       CALL RSPEAK(265)
       PROP(WALL)=1
       DO 23620 OBJ=1,MAXOBJ
       IF(PLACE(OBJ).EQ.LOC.OR.FIXED(OBJ).EQ.LOC)CALL MOVE(OBJ,K)
23620   CONTINUE
       NEWLOC=K
       GOTO 2


C  CALL.  IF NO PHONE IS HANDY, YELL.

13800   IF(.NOT.HERE(PHONE))GOTO 10000
       GOTO 23910

C  DIAL.  NO EFFECT UNLESS AT PHONE.

23900   IF(OBJ.NE.PHONE)GOTO 2011
23910   IF(CLOSED)GOTO 93200
       SPK=271
       GOTO 2011


C  PLAY.  ONLY FOR HORN OR LYRE.
24000   IF(OBJ.NE.0.AND.IOBJ.NE.0)GOTO 2060
       IF(OBJ.EQ.0)OBJ=IOBJ
       IOBJ=0
       IF(OBJ.EQ.HORN)GOTO 23600
       IF(OBJ.NE.LYRE)GOTO 2011
       SPK=287
       IF(.NOT.HERE(DOG).OR.DEAD(DOG))GOTO 2011
       PROP(DOG)=1
       CALL BITON(DOG,DEADBT)
       FIXED(AXE)=0
       PROP(AXE)=0
       SPK=288
       GOTO 2011


C  PICK/PICK UP.  CAN PICK FLOWERS & MUSHROOMS, BUT MUST 'PICK UP' EVERYTHING EL

24100   IF(OBJ.EQ.0)OBJ=IOBJ
       IOBJ=0
       IF(OBJ.EQ.FLOWER.OR.OBJ.EQ.MUSHRM)GOTO 20100
       IF(PREP.NE.0)GOTO 20100
       GOTO 2060
C  PUT DOWN: EQUIVALENT TO DROP.
C  PUT IN: IF LIQUID, MEANS 'FILL'.
C  PUT ON: WEAR OR DROP.

24200   IF(PREP.NE.0)GOTO 24210
       CALL A5TOA1(OTXT(OBJX,1),OTXT(OBJX,2),'?',TK,K)
       PRINT 24204,(TK(I),I=1,K)
24204   FORMAT(/' Where do you want to put the ',20A1)
       GOTO 2600

24210   IF(PREP.EQ.PREPIN)GOTO 24500

C  PUT ON: "WEAR" OR "PUT OBJ ON IOBJ".
24240   IF(PREP.NE.PREPON)GOTO 24250
       IF(OBJ.NE.0)GOTO 24242
       OBJ=IOBJ
       OTXT(OBJX,1)=IOTXT(IOBX,1)
       OTXT(OBJX,2)=IOTXT(IOBX,2)
       IOBJ=0
24242   IF(WORN(OBJ))GOTO 23300
       IF(IOBJ.EQ.0)GOTO 23310
       GOTO 20200

C  PUT DOWN: "DROP"
24250   IF(OBJ.EQ.0.OR.IOBJ.EQ.0)GOTO 24252
       GOTO 2070

24252   IF(OBJ.EQ.0)OBJ=IOBJ
       IOBJ=0
       GOTO 20200


C  TURN ON/OFF.

24300   IF(PREP.EQ.0)GOTO 2060
       IF(OBJ.EQ.0.AND.IOBJ.EQ.LAMP)OBJ=LAMP
       IF(OBJ.NE.LAMP)GOTO 2070
       IF(PREP.EQ.PREPON)GOTO 20700
       GOTO 20800


C  GET (NO PREP): "TAKE"
C  GET IN: "ENTER"
C  GET OUT: "LEAVE"
C****** NEEDS WORK

24400   IF(PREP.EQ.0.OR.PREP.EQ.PREPFR)GOTO 20100
       IF(OBJ.NE.0)GOTO 2060
       OBJ=IOBJ
       IOBJ=0
       PREP=0
       GOTO 20100
C  INSERT/PUT IN.

24500   IF(IOBJ.EQ.0)GOTO 10010
       SPK=NOWAY(0)
       IF(OBJ.EQ.SWORD.AND.IOBJ.EQ.ANVIL.AND.PROP(SWORD).EQ.0)SPK=350
       IF(.NOT.VESSEL(IOBJ))GOTO 2011
       ASSIGN 24510 TO RETN
       GOTO 20190

24510   IF(IOBJ.NE.BOTTLE.AND.IOBJ.NE.CASK.AND.IOBJ.NE.VASE
     1  .AND.IOBJ.NE.GRAIL.AND.(OBJ.LT.WATER.OR.OBJ.GT.WINE+1))
     2  GOTO 24515
       OBJ=IOBJ
       IOBJ=OBJS(OBJX)
       GOTO 22200

24515   SPK=252
       IF(OBJ.EQ.IOBJ)GOTO 2011
       SPK=358
       IF(.NOT.AJAR(IOBJ))GOTO 2011
       IF(IOBJ.NE.BOAT.AND.IOBJ.NE.CHEST)GOTO 24520
       IF(IOBJ.EQ.CHEST.AND.OBJ.EQ.BOAT)GOTO 2070
       GOTO 24590

C  BIRD GOES INTO CAGE AND ONLY CAGE.  CAGE HOLDS NOTHING ELSE.
C  BAR VASE & PILLOW FROM SAFE, TO FORCE PUTTING DOWN ON FLOOR.
24520   SPK=351
       IF(OBJ.EQ.BIRD.AND.IOBJ.NE.CAGE)GOTO 2011
       SPK=329
       IF(IOBJ.EQ.CAGE.AND.OBJ.NE.BIRD)GOTO 2011
       IF(OBJ.EQ.BIRD)GOTO 20120
       IF(IOBJ.EQ.SAFE.AND.(OBJ.EQ.VASE.OR.OBJ.EQ.PILLOW))GOTO 2011
       IF(IOBJ.EQ.SHIELD.AND.OBJ.NE.RADIUM)GOTO 2011
       IF(IOBJ.NE.PHONE)GOTO 24530
       IF(OBJ.NE.COINS.AND.OBJ.NE.SLUGS)GOTO 2070
       CALL DSTROY(OBJ)
       SPK=330
       GOTO 2011

24530   IF(IOBJ.NE.VEND)GOTO 24540
       IF(OBJ.NE.COINS.AND.OBJ.NE.SLUGS)GOTO 2070
       CALL DSTROY(OBJ)
       CALL MOVE(BATTER,LOC)
       IF(PROP(BATTER).NE.1)GOTO 24535
       CALL RSPEAK(317)
       PROP(VEND)=1
24535   PROP(BATTER)=0
       CALL PSPEAK(BATTER,0)
       GOTO 2100

C  PUT BATTERIES IN LAMP.
C  THERE IS A GLITCH HERE, IN THAT IF HE TRIES TO GET A THIRD SET OF
C  BATTERIES BEFORE THE SECOND SET HAS BEEN INSERTED, THE SECOND SET
C  DISAPPEARS!  ***FIX THIS SOMETIME***
24540   IF(IOBJ.NE.LAMP)GOTO 24550
       IF(OBJ.NE.BATTER.OR.PROP(BATTER).NE.0)GOTO 2070
       PROP(BATTER)=1
       IF(ENCLSD(BATTER))CALL REMOVE(BATTER)
       IF(HOLDNG(BATTER))CALL DROP(BATTER,LOC)
       LIMIT=400
       PROP(LAMP)=1
       LMWARN=.FALSE.
       SPK=188
       GOTO 2011

24550   IF(.NOT.SMALL(OBJ))GOTO 2011
24590   IF(WEARNG(OBJ))CALL BITOFF(OBJ,WEARBT)
       IF(ENCLSD(OBJ))CALL REMOVE(OBJ)
       CALL INSERT(OBJ,IOBJ)
       GOTO 2009
C  REMOVE/TAKE FROM.

24600   IF(OBJ.NE.RING.OR.PROP(RING).NE.2)GOTO 24610
       PREP=0
       IOBJ=0
       GOTO 20100

24610   SPK=343
       IF(IOBJ.NE.0)GOTO 24620
       IF(.NOT.ENCLSD(OBJ))SPK=340
       IOBJ=-PLACE(OBJ)
24620   IF(PLACE(OBJ).NE.-IOBJ)SPK=341
       IF(.NOT.AJAR(IOBJ))SPK=335
       IF(OBJ.EQ.WATER.OR.OBJ.EQ.OIL.OR.OBJ.EQ.WINE)SPK=342
       IF(.NOT.TOTING(OBJ).AND.BURDEN(0)+BURDEN(OBJ).GT.15)SPK=92
       IF(SPK.NE.343)GOTO 2011
       CALL REMOVE(OBJ)
       IF(OBJ.EQ.BIRD)GOTO 20200
       GOTO 2009


C  BURN

24700   GOTO 2011


C  GRIPE/COMPLAIN/SUGGEST.

14800   SCORNG=.TRUE.
       CALL RATING(SCORE,MXSCOR,BONUS,GAVEUP,SCORNG,CLOSNG,CLOSED)
       SCORNG=.FALSE.
       CALL GRIPE(LOC,SCORE,CLOSNG,CLOSED)
       GOTO 2011
C  LOCK.  CHAIN, GRATE, CHEST, ELFIN DOOR
C  HERE ARE THE CURRENT LOCK/UNLOCK MESSAGES & NUMBERS:
C       31      YOU HAVE NO KEYS.
C       32      IT HAS NO LOCK.
C       34      IT'S ALREADY LOCKED.
C       35      THE GRATE IS NOW LOCKED.
C       36      THE GRATE IS NOW UNLOCKED.
C       37      IT WAS ALREADY UNLOCKED.
C       55      YOU CAN'T UNLOCK THE KEYS.
C       171     The chain is now unlocked.
C       172     The chain is now locked.
C       173     There is nothing here to which the chain can be locked.
C       224     YOUR KEYS ARE ALL TOO LARGE.
C       234     The wrought-iron door is now locked.
C       235     The tiny door is now locked.
C       236     The wrought-iron door is now unlocked.
C       237     The tiny door is now unlocked.
C       375     YOU DON'T HAVE THE RIGHT KEY.
C       333     THE CHEST IS NOW LOCKED.
C       334     THE CHEST IS NOW UNLOCKED.
C       367     THE SAFE'S DOOR SWINGS SHUT.

24900   IF(HINGED(OBJ))GOTO 24905
       CALL A5TOA1(OTXT(OBJX,1),OTXT(OBJX,2),'.',TK,K)
       PRINT 24903,(TK(I),I=1,K)
24903   FORMAT(/' I don''t know how to lock or unlock the ',20A1)
       GOTO 2100

24905   SPK=375
       IF(.NOT.LOCKS(OBJ))SPK=32
       IF(LOCKED(OBJ))SPK=34
       IF(.NOT.(ATHAND(KEYS).OR.ATHAND(SKEY).OR.OBJ.EQ.SAFE))SPK=31
       IF(SPK.NE.375)GOTO 2011

C  CHAIN.
       IF(OBJ.NE.CHAIN)GOTO 24910
       IF(.NOT.ATHAND(KEYS))GOTO 2011
       SPK=173
       IF(LOC.NE.PLAC(CHAIN))GOTO 2011
       SPK=172
       PROP(CHAIN)=2
       IF(ENCLSD(CHAIN))CALL REMOVE(CHAIN)
       IF(HOLDNG(CHAIN))CALL DROP(CHAIN,LOC)
       FIXED(CHAIN)=-1
       GOTO 24990

C  CHEST.
24910   IF(OBJ.NE.CHEST)GOTO 24920
       IF(.NOT.ATHAND(KEYS))GOTO 2011
       SPK=334
       GOTO 24990

C  ELFIN DOOR.
24920   IF(OBJ.NE.TDOOR.AND.OBJ.NE.TDOOR2)GOTO 24930
       SPK=224
       IF(.NOT.TOTING(SKEY))GOTO 2011
       PROP(TDOOR)=0
       PROP(TDOOR2)=0
       SPK=234+2*PROP(TDOOR)+(TDOOR2-OBJ)
       K=TDOOR+(TDOOR2-OBJ)
       CALL BITON(K,LOCKBT)
       CALL BITOFF(K,OPENBT)
       GOTO 24990

C  GRATE.
24930   IF(OBJ.NE.GRATE)GOTO 24940
       IF(.NOT.ATHAND(KEYS))GOTO 2011
       PROP(GRATE)=0
       SPK=35
       GOTO 24990

C  SAFE.
24940   PROP(SAFE)=0
       SPK=367
C       GOTO 24990

24990   CALL BITON(OBJ,LOCKBT)
       CALL BITOFF(OBJ,OPENBT)
       GOTO 2011
C  UNLOCK.  CHAIN, GRATE, CHEST, ELFIN DOOR.

25000   SPK=55
       IF(OBJ.EQ.KEYS.OR.OBJ.EQ.SKEY)GOTO 2011
       IF(.NOT.HINGED(OBJ))GOTO 24900
       SPK=375
       IF(.NOT.LOCKED(OBJ))SPK=37
       IF(.NOT.LOCKS(OBJ))SPK=32
       IF(OBJ.EQ.SAFE)SPK=342
       IF(OBJ.EQ.SAFE.AND.(IOBJ.EQ.KEYS.OR.IOBJ.EQ.SKEY))SPK=368
       IF(.NOT.(ATHAND(KEYS).OR.ATHAND(SKEY).OR.OBJ.EQ.SAFE))SPK=31
       IF(SPK.NE.375)GOTO 2011

C  CHAIN.
       IF(OBJ.NE.CHAIN)GOTO 25020
       IF(.NOT.ATHAND(KEYS))GOTO 2011
       SPK=171
       IF(PROP(BEAR).EQ.0)SPK=41
       IF(SPK.NE.171)GOTO 2011
       PROP(CHAIN)=0
       FIXED(CHAIN)=0
       IF(PROP(BEAR).NE.3)PROP(BEAR)=2
       FIXED(BEAR)=2-PROP(BEAR)
       GOTO 25090

C  CHEST.
25020   IF(OBJ.NE.CHEST)GOTO 25030
       IF(.NOT.ATHAND(KEYS))GOTO 2011
       SPK=333
       GOTO 25090

C  ELFIN DOOR.
C  STUFF TO LOCK/UNLOCK TINY DOOR W/SPECIAL KEY.
C  THE DAMN THING IS REALLY AT FOUR PLACES, AND WE WANT THE RIGHT
C  MESSAGES IF HE ONLY HAS 'BIG' KEYS (OR NO KEYS).  ALSO, HE
C  CAN UNLOCK IT EITHER WHILE HE IS BIG OR SMALL.
25030   IF(OBJ.NE.TDOOR.AND.OBJ.NE.TDOOR2)GOTO 25040
       SPK=224
       IF(.NOT.ATHAND(SKEY))GOTO 2011
       IF(CLOSNG)GOTO 25060
       PROP(TDOOR)=1
       PROP(TDOOR2)=1
       SPK=234+2*PROP(TDOOR)+(TDOOR2-OBJ)
       K=TDOOR+(TDOOR2-OBJ)
       CALL BITOFF(K,LOCKBT)
       CALL BITON(K,OPENBT)
       GOTO 25090

C  GRATE.
25040   IF(.NOT.ATHAND(KEYS))GOTO 2011
       IF(CLOSNG)GOTO 25060
       PROP(GRATE)=1
       SPK=36

25090   CALL BITOFF(OBJ,LOCKBT)
       CALL BITON(OBJ,OPENBT)
       GOTO 2011

C  CLOSING.  NO EXIT THIS WAY.
25060   SPK=130
       IF(.NOT.PANIC)CLOCK2=15
       PANIC=.TRUE.
       GOTO 2011


C  HEALTH.  GIVE HIM A DIAGNOSIS.

25100   IF(HEALTH.LT.100)PRINT 25102,HEALTH
25102   FORMAT(/' You''re health rating is ',I2,
     1  ' out of a possible 100.')
       IF(PCT(50))SPK=349
       IF(HEALTH.GE.95)GOTO 2011
       SPK=381 + (100-HEALTH)/20
       GOTO 2011


C  LOOK.  CAN'T GIVE MORE DETAIL.  PRETEND IT WASN'T DARK (THOUGH IT MAY "NOW"
C  BE DARK) SO HE WON'T FALL INTO A PIT WHILE STARING INTO THE GLOOM.

25200   IF(OBJ.NE.0)GOTO 2060
       IF(IOBJ.NE.0)GOTO 25210
25201   IF(DETAIL.LT.3)CALL RSPEAK(15)
       DETAIL=DETAIL+1
       WZDARK=.FALSE.
       ABB(LOC)=0
       NEWLOC=LOC
       GOTO 2

C  LOOK INTO SOMETHING (A CONTAINER).
25210   IF(.NOT.VESSEL(IOBJ))GOTO 25220
       IF(.NOT.AJAR(IOBJ).AND.OPAQUE(IOBJ))GOTO 2011
       SPK=359
       IF(HOLDER(IOBJ).EQ.0)GOTO 2011
       PRINT 25212
25212   FORMAT(1H )
       CALL LOOKIN(IOBJ)
       GOTO 2100

C  LOOK AT SOMETHING.  IF WRITTEN, READ IT.
25220   IF(.NOT.PRINTD(IOBJ))GOTO 25201
       OBJ=IOBJ
       IOBJ=0
       GOTO 22700


C  COMBO: TRYING TO OPEN SAFE.  SEE COMMENTS FOR FEE FIE FOE FOO.

25300   IF(.NOT.AT(SAFE))GOTO 2060
       K=VOCABX(VTXT(VRBX,1),4)-10
       SPK=42
       IF(COMBO.EQ.1-K)GOTO 25320
       IF(COMBO.NE.0)SPK=366
       GOTO 2011

25320   COMBO=K
       SPK=371
       IF(K.NE.3)GOTO 2011
       COMBO=0
       CALL BITOFF(SAFE,LOCKBT)
       CALL BITON(SAFE,OPENBT)
       PROP(SAFE)=1
       SPK=365
       IF(PROP(BOOK).GE.0)GOTO 2011
       TALLY=TALLY-1
C  IF REMAINING TREASURES TOO ELUSIVE, ZAP HIS LAMP.
C  THIS COPIES SOME CODE LOCATED AROUND LABEL 2000.  MUST BE DONE
C  HERE SINCE BOOK IS CONTAINED IN SAFE & TALLY STUFF ONLY WORKS FOR THINGS
C  DEPOSITED AT A LOC.
       IF(TALLY.EQ.TALLY2.AND.TALLY.NE.0)LIMIT=MIN0(35,LIMIT)
       GOTO 2011
C  DUST/SWEEP.
25400   IF(.NOT.ATHAND(BRUSH))SPK=342
       IF(.NOT.AT(CARVNG).OR..NOT.ATHAND(BRUSH).OR.PROP(CARVNG).EQ.1)
     1  GOTO 2011
       PROP(CARVNG)=1
       CALL RSPEAK(363)
       SPK=372
       GOTO 2011


C  TERSE/UNTERSE.  SUPRESS ALL LONG-FORM DESCRIPTIONS.

25500   TERSE=.NOT.TERSE
       DETAIL=3
       GOTO 2009
C  WIZ STUFF

25600       IF(ISWIZ)CALL MONITR
      GOTO 2009
25700       IF(ISWIZ) CALL XMAP
      GOTO 2009
25800       IF(.NOT.ISWIZ) GOTO 2009
            WRITE(1,25801)
25801       FORMAT (1X,'LOCATION ?')
            READ (1,25802) GATLOC
25802       FORMAT (I4)
            IF ((GATLOC.GT.0).AND.(GATLOC.LE.MAXLOC))
     +       LOC=GATLOC
      GOTO 2009
25900       IF(ISWIZ) WRITE(1,25901) DLOC(DWFMAX)
25901       FORMAT(1X,'THE PIRATE IS AT LOCATION ',I4)
      GOTO 2009

C  HINTS

C  COME HERE IF HE'S BEEN LONG ENOUGH AT REQUIRED LOC(S) FOR SOME UNUSED HINT.
C  HINT NUMBER IS IN VARIABLE "HINT".  BRANCH TO QUICK TEST FOR ADDITIONAL
C  CONDITIONS, THEN COME BACK TO DO NEAT STUFF.  GOTO 40010 IF CONDITIONS ARE
C  MET AND WE WANT TO OFFER THE HINT.  GOTO 40020 TO CLEAR HINTLC BACK TO ZERO,
C  40030 TO TAKE NO ACTION YET.

40000   GOTO (40700,40800,40900,41000,41100,41200,41300,41400,41500,
     1     41600,41700),(HINT+1-HNTMIN)
C             MAZE  DARK  WITT  SWORD SLIDE CAVE1 BIRD  CAVE2 RNBOW
C             SNAKE STYX

       PRINT 40002,HINT
40002   FORMAT (' TRYING TO PRINT HINT # ',I1,/)
       CALL BUG(27)

40010   HINTLC(HINT)=0
       IF(.NOT.YES(HINTS(HINT,3),0,54))GOTO 2603
       PRINT 40012,HINTS(HINT,2)
40012   FORMAT(/' I am prepared to give you a hint, but it will cost
     1 you',    I2,' points.')
       HINTED(HINT)=YES(175,HINTS(HINT,4),54)
       IF(HINTED(HINT).AND.LIMIT.GT.30)LIMIT=LIMIT+30*HINTS(HINT,2)
40020   HINTLC(HINT)=0
40030   GOTO 2603

C  NOW FOR THE QUICK TESTS.  SEE DATABASE DESCRIPTION FOR ONE-LINE NOTES.

40700   IF(ATLOC(LOC).EQ.0.AND.ATLOC(OLDLOC).EQ.0.AND.
     1  ATLOC(OLDLC2).EQ.0.AND.BURDEN(0).GT.1)GOTO 40010
       GOTO 40020

40800   IF(PROP(EMRALD).NE.-1.AND.PROP(PYRAM).EQ.-1)GOTO 40010
       GOTO 40020

40900   GOTO 40010

41000   IF( (PROP(SWORD).EQ.1.OR.PROP(SWORD).EQ.5)
     1  .AND..NOT.TOTING(CROWN))GOTO 40010
       GOTO 40020

41100   GOTO 40010

41200   IF(PROP(GRATE).EQ.0.AND..NOT.ATHAND(KEYS))GOTO 40010
       GOTO 40020

41300   IF(HERE(BIRD).AND.ATHAND(ROD).AND.OBJ.EQ.BIRD)GOTO 40010
       GOTO 40030

41400   IF(ABB(159).EQ.0)GOTO 40010
       GOTO 40020

41500   IF(.NOT.TOTING(SHOES).OR.ABB(205).EQ.0)GOTO 40010
       GOTO 40020

41600   IF(.NOT.ATHAND(LYRE).AND.PROP(DOG).NE.1)GOTO 40010
       GOTO 40020

41700   IF(HERE(SNAKE).AND..NOT.HERE(BIRD))GOTO 40010
       GOTO 40020
C  CAVE CLOSING AND SCORING


C  THESE SECTIONS HANDLE THE CLOSING OF THE CAVE.  THE CAVE CLOSES "CLOCK1"
C  TURNS AFTER THE LAST TREASURE HAS BEEN LOCATED (INCLUDING THE PIRATE'S
C  CHEST, WHICH MAY OF COURSE NEVER SHOW UP).  NOTE THAT THE TREASURES NEED NOT
C  HAVE BEEN TAKEN YET, JUST LOCATED.  HENCE CLOCK1 MUST BE LARGE ENOUGH TO GET
C  OUT OF THE CAVE (IT ONLY TICKS WHILE INSIDE THE CAVE).  WHEN IT HITS ZERO,
C  WE BRANCH TO 90000 TO START CLOSING THE CAVE, AND THEN SIT BACK AND WAIT FOR
C  HIM TO TRY TO GET OUT.  IF HE DOESN'T WITHIN CLOCK2 TURNS, WE CLOSE THE
C  CAVE; IF HE DOES TRY, WE ASSUME HE PANICS, AND GIVE HIM A FEW ADDITIONAL
C  TURNS TO GET FRANTIC BEFORE WE CLOSE.  WHEN CLOCK2 HITS ZERO, WE BRANCH TO
C  90000 TO TRANSPORT HIM INTO THE FINAL PUZZLE.  NOTE THAT THE PUZZLE DEPENDS
C  UPON ALL SORTS OF RANDOM THINGS.  FOR INSTANCE, THERE MUST BE NO WATER OR
C  OIL, SINCE THERE ARE BEANSTALKS WHICH WE DON'T WANT TO BE ABLE TO WATER,
C  SINCE THE CODE CAN'T HANDLE IT.  ALSO, WE CAN HAVE NO KEYS, SINCE THERE IS A
C  GRATE (HAVING MOVED THE FIXED OBJECT!) THERE SEPARATING HIM FROM ALL THE
C  TREASURES.  MOST OF THESE PROBLEMS ARISE FROM THE USE OF NEGATIVE PROP
C  NUMBERS TO SUPPRESS THE OBJECT DESCRIPTIONS UNTIL HE'S ACTUALLY MOVED THE
C  OBJECTS.

C  WHEN THE FIRST WARNING COMES, WE LOCK THE GRATE, DESTROY THE BRIDGE, KILL
C  ALL THE DWARVES (AND THE PIRATE), REMOVE THE TROLL AND BEAR (UNLESS DEAD),
C  AND SET "CLOSNG" TO TRUE.  LEAVE THE DRAGON; TOO MUCH TROUBLE TO MOVE IT.
C  FROM NOW UNTIL CLOCK2 RUNS OUT, HE CANNOT UNLOCK THE GRATE, MOVE TO ANY
C  LOCATION OUTSIDE THE CAVE (LOC=BITSET(LOCCON,6)), OR CREATE THE BRIDGE.  NOR
C  RESURRECTED IF HE DIES.  NOTE THAT THE SNAKE IS ALREADY GONE, SINCE HE GOT
C  TO THE TREASURE ACCESSIBLE ONLY VIA THE HALL OF THE MT. KING.  ALSO, HE'S
C  BEEN IN GIANT ROOM (TO GET EGGS), SO WE CAN REFER TO IT.  ALSO ALSO, HE'S
C  GOTTEN THE PEARL, SO WE KNOW THE BIVALVE IS AN OYSTER.  *AND*, THE DWARVES
C  MUST HAVE BEEN ACTIVATED, SINCE WE'VE FOUND CHEST.

90000   PROP(GRATE)=0
       PROP(FISSUR)=0
       PROP(TDOOR)=0
       PROP(TDOOR2)=0
       DO 90010 I=1,6
       DSEEN(I)=.FALSE.
90010   DLOC(I)=0
       CALL MOVE(TROLL,0)
       CALL MOVE(TROLL+MAXOBJ,0)
       CALL MOVE(TROLL2,PLAC(TROLL))
       CALL MOVE(TROLL2+MAXOBJ,FIXD(TROLL))
       CALL JUGGLE(CHASM)
       IF(PROP(BEAR).NE.3)CALL DSTROY(BEAR)
       PROP(CHAIN)=0
       FIXED(CHAIN)=0
       PROP(AXE)=0
       FIXED(AXE)=0
       CALL RSPEAK(129)
       CLOCK1=-1
       CLOSNG=.TRUE.
       GOTO 19999

C  ONCE HE'S PANICKED, AND CLOCK2 HAS RUN OUT, WE COME HERE TO SET UP THE
C  STORAGE ROOM.  THE ROOM HAS TWO LOCS, HARDWIRED AS 115 (NE) AND 116 (SW).
C  AT THE NE END, WE PLACE EMPTY BOTTLES, A NURSERY OF PLANTS, A BED OF
C  OYSTERS, A PILE OF LAMPS, RODS WITH STARS, SLEEPING DWARVES, PHONE BOOTH AND
C  AT THE SW END WE PLACE GRATE OVER TREASURES, SNAKE PIT, COVEY OF CAGED BIRDS,
C  MORE RODS, AND PILLOWS.  A MIRROR STRETCHES ACROSS ONE WALL.  MANY OF THE
C  OBJECTS COME FROM KNOWN LOCATIONS AND/OR STATES (E.G. THE SNAKE IS KNOWN TO
C  HAVE BEEN DESTROYED AND NEEDN'T BE CARRIED AWAY FROM ITS OLD "PLACE"),
C  MAKING THE VARIOUS OBJECTS BE HANDLED DIFFERENTLY.  WE ALSO DROP ALL OTHER
C  OBJECTS HE MIGHT BE CARRYING (LEST HE HAVE SOME WHICH COULD CAUSE TROUBLE,
C  SUCH AS THE KEYS).  WE DESCRIBE THE FLASH OF LIGHT AND TRUNDLE BACK.
C  THE PHONE MAKES IT IMPOSSIBLE FOR THE WALDO TO FART AROUND IN THE
C  REPOSITORY TOO LONG.  WHEN CLOCK3 TICKS TO ZERO, THE PHONE STARTS
C  RINGING.  WHEN IT HITS -7, THE DWARVES WAKE UP.  IF HE FIDDLES WITH
C  THE PHONE, HE GETS ZONKED IN OTHER WAYS.

91000   PROP(BOTTLE)=PUT(BOTTLE,115,1)
       PROP(PLANT)=PUT(PLANT,115,0)
       PROP(OYSTER)=PUT(OYSTER,115,0)
       PROP(LAMP)=PUT(LAMP,115,0)
       PROP(ROD)=PUT(ROD,115,0)
       PROP(DWARF)=PUT(DWARF,115,0)
       LOC=115
       OLDLOC=115
       NEWLOC=115

C  LEAVE THE GRATE WITH NORMAL (NON-NEGATIVE PROPERTY).

       FOO=PUT(GRATE,116,0)
       PROP(SNAKE)=PUT(SNAKE,116,1)
       PROP(BIRD)=PUT(BIRD,116,1)
       PROP(CAGE)=PUT(CAGE,116,0)
       PROP(ROD2)=PUT(ROD2,116,0)
       PROP(PILLOW)=PUT(PILLOW,116,0)

       PROP(BOOTH)=PUT(BOOTH,116,-4)
       FIXED(BOOTH)=115
       PROP(PHONE)=PUT(PHONE,212,-4)

       PROP(MIRROR)=PUT(MIRROR,115,0)
       PROP(BOOK2)=PUT(BOOK2,115,0)
       FIXED(MIRROR)=116

       DO 91010 I=1,MAXOBJ
       IF(TOTING(I).AND.ENCLSD(I))CALL REMOVE(I)
91010   IF(TOTING(I))CALL DSTROY(I)

       CALL RSPEAK(132)
       CLOSED=.TRUE.
       GOTO 2
C  ANOTHER WAY WE CAN FORCE AN END TO THINGS IS BY HAVING THE LAMP GIVE OUT.
C  WHEN IT GETS CLOSE, WE COME HERE TO WARN HIM.
C  92000 IS FOR CASES OF LAMP DYING.  92400 IS WHEN IT GOES OUT,
C  AND 92600 IS IF HE'S WANDERED OUTSIDE AND THE LAMP IS USED UP, IN WHICH
C  CASE WE FORCE HIM TO GIVE UP.

92000   IF(LMWARN.OR..NOT.HERE(LAMP))GOTO 19999
       LMWARN=.TRUE.
       SPK=187
       IF(PROP(BATTER).EQ.1)SPK=323
       IF(PLACE(BATTER).EQ.0)SPK=183
       IF(PROP(VEND).EQ.1)SPK=189
       CALL RSPEAK(SPK)
       GOTO 19999

92400   LIMIT=-1
       PROP(LAMP)=0
       IF(HERE(LAMP))CALL RSPEAK(184)
       GOTO 19999

92600   CALL RSPEAK(185)
       GAVEUP=.TRUE.
       GOTO 95000

C  AND, OF COURSE, DEMO GAMES ARE ENDED BY THE WIZARD.

92800   CALL MSPEAK(1)
       GAVEUP=.TRUE.
       GOTO 95000

C  OH DEAR, HE'S DISTURBED THE DWARVES.

93000   CALL RSPEAK(136)
       GOTO 95000

C  HIT THE PHONE.  JINGLE, JANGLE, CRASH!
93100   CALL RSPEAK(282)
       GOTO 93000

C  WHOOPS.  DOWN THE CHUTE.
93200   CALL RSPEAK(283)
       GOTO 95000

C  DWARVES CAN'T SLEEP THRU ALL THIS RINGING!
93300   CALL RSPEAK(254)
       GOTO 95000
C  "YOU'RE DEAD, FRED."         "YOU DIED, CLYDE?"
C
C  IF THE CURRENT LOC IS ZERO, IT MEANS THE CLOWN GOT HIMSELF KILLED.  WE'LL
C  ALLOW THIS MAXDIE TIMES.  MAXDIE IS AUTOMATICALLY SET BASED ON THE NUMBER OF
C  SNIDE MESSAGES AVAILABLE.  EACH DEATH RESULTS IN A MESSAGE (81, 83, ETC.)
C  WHICH OFFERS REINCARNATION; IF ACCEPTED, THIS RESULTS IN MESSAGE 82, 84,
C  ETC.  THE LAST TIME, IF HE WANTS ANOTHER CHANCE, HE GETS A SNIDE REMARK AS
C  WE EXIT.  WHEN REINCARNATED, ALL OBJECTS BEING CARRIED GET DROPPED AT OLDLC2
C  (PRESUMABLY THE LAST PLACE PRIOR TO BEING KILLED) WITHOUT CHANGE OF PROPS.
C  THE LOOP RUNS BACKWARDS TO ASSURE THAT THE BIRD IS DROPPED BEFORE THE CAGE.
C  (THIS KLUGE COULD BE CHANGED ONCE WE'RE SURE ALL REFERENCES TO BIRD AND CAGE
C  ARE DONE BY KEYWORDS.)  THE LAMP IS A SPECIAL CASE (IT WOULDN'T DO TO LEAVE
C  IT IN THE CAVE).  IT IS TURNED OFF AND LEFT OUTSIDE THE BUILDING (ONLY IF HE
C  WAS CARRYING IT, OF COURSE).  HE HIMSELF IS LEFT INSIDE THE BUILDING (AND
C  HEAVEN HELP HIM IF HE TRIES TO XYZZY BACK INTO THE CAVE WITHOUT THE LAMP!).
C  OLDLOC IS ZAPPED SO HE CAN'T JUST "RETREAT".

C  THE EASIEST WAY TO GET KILLED IS TO FALL INTO A PIT IN PITCH DARKNESS.

94000   CALL RSPEAK(23)
       OLDLC2=LOC

C  OKAY, HE'S DEAD.  LET'S GET ON WITH IT.

94100   IF(CLOSNG)GOTO 94500
       YEA=YES(81+NUMDIE*2,82+NUMDIE*2,54)
       NUMDIE=NUMDIE+1
       IF(NUMDIE.EQ.MAXDIE.OR..NOT.YEA)GOTO 95000
       IF(CHASE.EQ.0)GOTO 94160

C  CHAMP WAS BEING CHASED BY WUMPUS, & DIED ANOTHER WAY.
C  PUT WUMPUS BACK TO SLEEP, IN CASE OUR HERO STILL HASN'T GOT THE CLOAK.
       CHASE=0
       PROP(WUMPUS)=0
       CALL MOVE(WUMPUS,174)
94160   IF(TOTING(LAMP))PROP(LAMP)=0
       DO 94200 J=1,MAXOBJ
       IF(.NOT.HOLDNG(J))GOTO 94200
       LOC=OLDLC2
       IF(J.EQ.LAMP)LOC=1
       CALL DROP(J,LOC)
       IF(.NOT.WEARNG(J))GOTO 94200
       PROP(J)=0
       CALL BITOFF(J,WEARBT)
94200   CONTINUE
       LOC=3
       OLDLOC=LOC
       WDX=0
       WORDS(1)=0
       CALL CLRLIN
       HEALTH=100
       GOTO 2000

C  HE DIED DURING CLOSING TIME.  NO RESURRECTION.  TALLY UP A DEATH AND EXIT.

94500   CALL RSPEAK(131)
       NUMDIE=NUMDIE+1
       GOTO 95000
C  IT'S OVER.  TALLY SCORE.

95000   CALL RATING(SCORE,MXSCOR,BONUS,GAVEUP,SCORNG,CLOSNG,CLOSED)

C  THAT SHOULD BE GOOD ENOUGH.  LET'S TELL HIM ALL ABOUT IT.

       CALL LOG(SCORE,TURNS,NUMDIE)

       PRINT 95100,SCORE,MXSCOR,TURNS
95100   FORMAT(///' You scored',I4,' out of a possible',I4,
     1  ', using',I5,' turns.')

       DO 95200 I=1,CLSSES
       IF(CVAL(I).GE.SCORE)GOTO 95210
95200   CONTINUE
       PRINT 95202
95202   FORMAT(/' You just went off my scale!!'/)
       GOTO 98000

95210   CALL SPEAK(CTEXT(I))
       IF(I.EQ.CLSSES-1)GOTO 95220
       K=CVAL(I)+1-SCORE
       KK='s.'
       IF(K.EQ.1)KK='. '
       PRINT 95212,K,KK
95212   FORMAT(/' To achieve the next higher rating, you need',I3,
     1  ' more point',A2/)
       GOTO 98000

95220   PRINT 95222
95222   FORMAT(/' To achieve the next higher rating ',
     1  'would be a neat trick!'//' CONGRATULATIONS!!'/)

C98000  STOP
98000   STOP

       END
