C  NOW WE KNOW WHAT'S HAPPENING.  LET'S TELL THE POOR SUCKER ABOUT IT.

       IF(DTOTAL.EQ.0)GOTO 2000
       IF(DTOTAL.EQ.1)GOTO 75
       PRINT 67,DTOTAL
67      FORMAT(/' There are ',I1,' threatening little dwarves in the'
     1  ,' room with you!')
       GOTO 77
75      CALL RSPEAK(4)
77      IF(ATTACK.EQ.0)GOTO 2000
       IF(DFLAG.EQ.2)DFLAG=3
C  IF SAVED NOT = -1, HE BYPASSED THE "START" CALL.  DWARVES GET *VERY* MAD!
       IF(SAVED.NE.-1)DFLAG=20
       IF(ATTACK.EQ.1)GOTO 79
       PRINT 78,ATTACK
78      FORMAT(/' ',I1,' of them throw knives at you!')
       K=6
82      IF(STICK.GT.1)GOTO 83
       CALL RSPEAK(K+STICK)
       IF(STICK.EQ.0)GOTO 2000
       GOTO 84
83      PRINT 68,STICK
68      FORMAT(/' ',I1,' of them get you!')
84      OLDLC2=LOC
       GOTO 94100

79      CALL RSPEAK(5)
       K=52
       GOTO 82
C  DESCRIBE THE CURRENT LOCATION AND (MAYBE) GET NEXT COMMAND.

C  PRINT TEXT FOR CURRENT LOC.

2000    IF(LOC.EQ.0)GOTO 94100
       JKK=STEXT(LOC)
       IF(VERB.EQ.LOOK.OR.JKK.EQ.0.OR.
     1 (.NOT.TERSE.AND.MOD(ABB(LOC),ABBNUM).EQ.0) )JKK=LTEXT(LOC)
       IF((FORCED(LOC).OR..NOT.DARK(0)).AND.LOC.NE.200)GOTO 2001
       IF(LOC.NE.200.AND. (DARK(0).OR.PROP(LAMP).EQ.0
     1  .OR..NOT.ATHAND(LAMP)) )GOTO 2003
       IF(PROP(LAMP).EQ.0.OR..NOT.ATHAND(LAMP))GOTO 2020
       IF(PCT(35))GOTO 94000
       JKK=RTEXT(294)
       GOTO 2020

2003    IF(WZDARK.AND.PCT(35))GOTO 94000
       JKK=RTEXT(16)
2001    IF(HOLDNG(BEAR).AND..NOT.DARK(0))CALL RSPEAK(141)
2020    CALL SPEAK(JKK)
       K=1
       ABB(LOC)=ABB(LOC)+1
       IF(.NOT.FORCED(LOC))GOTO 2022
       CALL TRAVL(K)
       IF(KILLED)GOTO 94100
       GOTO 2

2022    ABB(LOC)=ABB(LOC)-1
       IF(LOC.EQ.Y2.AND.PCT(25).AND..NOT.CLOSNG)CALL RSPEAK(8)
       IF(LOC.EQ.147.AND.ABB(LOC).EQ.1)CALL RSPEAK(216)

C  SEE IF HE IS WASTING HIS BATTERIES OUT IN THE OPEN.
       K=0
       IF(.NOT.OUTSID(LOC).OR.PROP(LAMP).EQ.0)GOTO 2030
       K=WASTE+1
       IF(K.LE.12)GOTO 2030
       CALL RSPEAK(324)
       K=0
2030    WASTE=K

C  IF WUMPUS IS CHASING STOOGE, SEE IF WUMPUS GETS HIM.
       IF(CHASE.EQ.0)GOTO 2040
       CHASE=CHASE+1
       KK=CHASE/2
       PROP(WUMPUS)=KK
       CALL MOVE(WUMPUS,LOC)
       IF(KK.LT.5)GOTO 2040
       IF(DARK(0))CALL RSPEAK(270)
       CALL PSPEAK(WUMPUS,5)
       GOTO 94100

C  CHECK FOR RADIATION POISONING.
2040    K=1
       IF(OUTSID(LOC))K=3
       HEALTH=MIN0(HEALTH+1,100)
       IF(.NOT.HERE(RADIUM).OR.
     1 (PLACE(RADIUM).EQ.-SHIELD.AND..NOT.AJAR(SHIELD)) )GOTO 2045
       HEALTH=HEALTH-K-7
       IF(HEALTH.GE.60)GOTO 2045
       CALL RSPEAK(391+(60-HEALTH)/10)
       IF(HEALTH.LE.0)GOTO 94100
C  PRINT OUT DESCRIPTIONS OF OBJECTS AT THIS LOCATION.  IF NOT CLOSING AND
C  PROPERTY VALUE IS NEGATIVE, TALLY OFF ANOTHER TREASURE.  RUG IS SPECIAL
C  CASE; ONCE SEEN, ITS PROP IS 1 (DRAGON ON IT) TILL DRAGON IS KILLED.
C  SIMILARLY FOR CHAIN; PROP IS INITIALLY 1 (LOCKED TO BEAR).
C  LIKEWISE, FOR SWORD (MUST PROVE ELFIN ROYALTY).

2045    IF(OLDLOC.NE.188.OR.LOC.EQ.189.OR.LOC.EQ.188
     1  .OR.PROP(BOOTH).NE.1)GOTO 2021
       CALL MOVE(GNOME,0)
       PROP(BOOTH)=0
2021    IF(BLIND(0))GOTO 2100
       ABB(LOC)=ABB(LOC)+1
       I=ATLOC(LOC)
2004    IF(I.EQ.0)GOTO 2100
       OBJ=I
       IF(OBJ.GT.MAXOBJ)OBJ=OBJ-MAXOBJ
       IF(OBJ.EQ.STEPS.AND.TOTING(NUGGET))GOTO 2008
       IF(PROP(OBJ).GE.0)GOTO 2006
       IF(CLOSED)GOTO 2008
       PROP(OBJ)=0
       IF(OBJ.EQ.RUG.OR.OBJ.EQ.CHAIN.OR.OBJ.EQ.SWORD
     1  .OR.OBJ.EQ.CASK)PROP(OBJ)=1
       IF(OBJ.EQ.CLOAK.OR.OBJ.EQ.RING)PROP(OBJ)=2
       TALLY=TALLY-1
C  IF REMAINING TREASURES TOO ELUSIVE, ZAP HIS LAMP.
       IF(TALLY.EQ.TALLY2.AND.TALLY.NE.0)LIMIT=MIN0(35,LIMIT)
2006    KK=PROP(OBJ)
       IF(OBJ.EQ.STEPS.AND.LOC.EQ.FIXED(STEPS))KK=1
      CALL PSPEAK(OBJ,INTS(KK))
       CALL LOOKIN(OBJ)
2008    I=LINK(I)
       GOTO 2004

C  "I DON'T UNDERSTAND THAT!"
2060    SPK=CONFUZ(0)
       GOTO 2011

C  "YOU CAN'T DO THAT!"  (AN IMPOSSIBLE ACT, E.G., "OPEN SWORD", "FEED BOAT", ET
2070    SPK=NOWAY(0)
       GOTO 2011

2009    SPK=54
2011    IF(OBJ.EQ.0.OR.(OBJS(2).EQ.0.AND.IOBJS(2).EQ.0))GOTO 2015
       CALL PSPEAK(OBJ,-1)
      CALL TNOUA('     ',5)
       BLKLIN=.FALSE.
2015    CALL RSPEAK(SPK)
       BLKLIN=.TRUE.

2100    RDFLAG=.FALSE.
       IF(OBJX.EQ.0)GOTO 2110
       OBJX=OBJX+1
       IF(OBJS(OBJX).EQ.0)OBJX=0
2110    IF(OBJX.GT.0.AND.OBJS(OBJX).NE.0)GOTO 2120
       IF(IOBX.EQ.0)GOTO 2120
       IOBX=IOBX+1
       IF(IOBJS(IOBX).EQ.0)IOBX=0
       IF(IOBX.NE.0.AND.OBJS(1).NE.0)OBJX=1

2120    IF(OBJX.GT.0.OR.IOBX.GT.0)GOTO 2600
       IF(OBJS(1).NE.0)OBJX=1
       IF(IOBJS(1).NE.0)IOBX=1
       VRBX=VRBX+1
       IF(VERBS(VRBX).NE.0)GOTO 2600
       CALL CLRLIN
       RDFLAG=.TRUE.

C  CHECK IF THIS LOC IS ELIGIBLE FOR ANY HINTS.  IF BEEN HERE LONG ENOUGH,
C  BRANCH TO HELP SECTION (ON LATER PAGE).  HINTS ALL COME BACK HERE EVENTUALLY
C  TO FINISH THE LOOP.  IGNORE "HINTS" < HNTMIN (SPECIAL STUFF, SEE DATABASE
C  NOTES).

2600    DO 2602 HINT=HNTMIN,HNTMAX
       IF(HINTED(HINT))GOTO 2602
      IF(AND(LOCCON(LOC),BITS(HINT)).EQ.0)HINTLC(HINT)=-1
       HINTLC(HINT)=HINTLC(HINT)+1
       IF(HINTLC(HINT).GE.HINTS(HINT,1))GOTO 40000
2602    CONTINUE
C gotta add 2603 as we want to "GO TO" here, but compiler
C doesn't like it when we try to goto 2602 as it is part of a loop.
2603    CONTINUE

C  KICK THE RANDOM NUMBER GENERATOR JUST TO ADD VARIETY TO THE CHASE.  ALSO,
C  IF CLOSING TIME, CHECK FOR ANY OBJECTS BEING TOTED WITH PROP < 0 AND SET
C  THE PROP TO -1-PROP.  THIS WAY OBJECTS WON'T BE DESCRIBED UNTIL THEY'VE
C  BEEN PICKED UP AND PUT DOWN SEPARATE FROM THEIR RESPECTIVE PILES.  DON'T
C  TICK CLOCK1 UNLESS WELL INTO CAVE (AND NOT AT Y2).

       IF(.NOT.CLOSED)GOTO 2605
       IF(PROP(OYSTER).LT.0.AND.TOTING(OYSTER))
     1  CALL PSPEAK(OYSTER,1)
       DO 2604 I=1,MAXOBJ
2604    IF(TOTING(I).AND.PROP(I).LT.0)PROP(I)=-1-PROP(I)
2605    WZDARK=DARK(0)
       IF(KNFLOC.GT.0.AND.KNFLOC.NE.LOC)KNFLOC=0
       I=RAN(1)
       IF(.NOT.RDFLAG)GOTO 2608

C  GET A NEW INPUT CLAUSE, OR FINISH GETTING CURRENT ONE.

       CALL GETWDS
       VRBX=1
       OBJX=0
       IF(OBJS(1).NE.0)OBJX=1
       IOBX=0
       IF(IOBJS(1).NE.0)IOBX=1
       RDFLAG=.TRUE.

C  EVERY INPUT, CHECK "FOOBAR" FLAG.  IF ZERO, NOTHING'S GOING ON.  IF POS,
C  MAKE NEG.  IF NEG, HE SKIPPED A WORD, SO MAKE IT ZERO.

2608    FOOBAR=MIN0(0,-FOOBAR)
       COMBO=MIN0(0,-COMBO)
       TURNS=TURNS+1
       IF(DEMO.AND.TURNS.GE.SHORT)GOTO 92800
      IF(LOGOUT(0))GOTO 92800
C       IF(TURNS.EQ.3)CALL DATIME(XXD,XXT)
C       IF(TURNS.NE.45)GOTO 2609
C  SEE IF TIMER UUO HAS BEEN ZAPPED; IF SO, HE'S CHEATING.
C  FLUSHING THIS FOR NOW.  EATS CPU IN PA1050.  [D. LONG]
C       CALL DATIME(YYD,YYT)
C       IF(XXD.EQ.YYD.AND.XXT.EQ.YYT)SAVED=0
2609    IF(TURNS.EQ.310.AND.ABBNUM.NE.10000.AND..NOT.TERSE)
     1  CALL RSPEAK(273)

C  BUMP ALL THE RIGHT CLOCKS FOR RECONNING BATTERY LIFE AND CLOSING.

       IF(CLOSED)CLOCK3=CLOCK3-1
       IF(CLOCK3.EQ.-7)GOTO 93300
       IF(CLOCK3.NE.0)GOTO 2621
       PROP(PHONE)=0
       PROP(BOOTH)=0
       CALL RSPEAK(284)
2621    IF(TALLY.EQ.0.AND.INSIDE(LOC).AND.LOC.NE.Y2)CLOCK1=CLOCK1-1
       IF(CLOCK1.EQ.0)GOTO 90000
       IF(CLOCK1.LT.0)CLOCK2=CLOCK2-1
       IF(CLOCK2.EQ.0)GOTO 91000
C      IF(PROP(LAMP).EQ.1)LIMIT=LIMIT-1
       IF(LIMIT.EQ.0)GOTO 92400
       IF(LIMIT.LT.0.AND.OUTSID(LOC))GOTO 92600
       IF(LIMIT.LE.40)GOTO 92000

19999   VERB=VAL(VERBS(VRBX))
       OBJ=0
       IF(OBJX.NE.0)OBJ=OBJS(OBJX)
       IOBJ=0
       IF(IOBX.NE.0)IOBJ=IOBJS(IOBX)
       IF(KNFLOC.NE.LOC.OR.(OBJ.NE.KNIFE.AND.IOBJ.NE.KNIFE))GOTO 19998
       KNFLOC=-1
       SPK=116
       GOTO 2011

19998   GOTO (2750,2700,4000,2710), CLASS(VERBS(VRBX))
2700    CALL BUG(22)

2710    SPK=VERB
       GOTO 2011

C  IT IS A MOTION VERB.  ANALYZE IT & LOOP TO 2, IF NOT DEAD.
2750    CALL TRAVL(VERB)
       IF(KILLED)GOTO 94100
       GOTO 2

C  ACTION VERB 'LEAVE' (DROP) HAS NO OBJECT.
3100    CALL BUG(29)

C  VERB 'SAY' OR 'YELL' SLIPPED THROUGH WITH AN OBJECT.
3200    CALL BUG(34)

C  ANALYSE A VERB.
4000    SPK=ACTSPK(VERB)
       IF(OBJ.NE.0.OR.IOBJ.NE.0)GOTO 4090

C  ANALYSE AN INTRANSITIVE VERB (IE, NO OBJECT GIVEN YET).

       GOTO(
     9 10100,10000,10000,10400, 2009,10400,20700,20800,10000,10000,
     9  2011,21200,11300,11400,11500,10000,10000,11800,10000,12000,
     9 10000,12200,12300,12400,12500,12600,10000,10000,10000,13000,
     9 13100,10100,10000,10000,13500,23600, 3100,13800,10000,10000,
     9 10000,10000,10000,10100,10100,10100,10100,14800,10400,10400,
     9 25100,25200,25300,25400,25500,25600,25700,25800,25900),VERB
C 01-10    TAKE  DROP   SAY  OPEN  NOTH CLOSE    ON   OFF  WAVE  CALM
C 11-20    WALK  KILL  POUR   EAT DRINK   RUB THROW  QUIT  FIND INVEN
C 21-30    FEED  FILL BLAST SCORE   FOO BRIEF  READ BREAK  WAKE SUSPD
C 31-40    HOUR  YANK  WEAR   HIT ANSWR  BLOW LEAVE  YELL  DIAL  PLAY
C 41-50    PICK   PUT  TURN   GET INSRT REMOV  BURN GRIPE  LOCK UNLOK
C 51-60  HEALTH  LOOK COMBO SWEEP TERSE WIZ   MAP   GATE   PIRLOC
       CALL BUG(23)

C  ANALYSE A TRANSITIVE VERB.

4090    GOTO(
     9 20100,20200, 3200,20400, 2009,20600,20700,20800,20900, 2011,
     9  2011,21200,21300,21400,21500,21600,21700, 2011,21900,21900,
     9 22100,22200,12300, 2011, 2011,22600,22700,22800,22900, 2011,
     9  2011,23200,23300,23400,23500,23600,20200, 3200,23900,24000,
     9 24100,24200,24300,24400,24500,24600,24700, 2060,24900,25000,
     9  2060,25200, 2070,25400, 2060, 2060, 2060, 2060, 2060),VERB
C 01-10    TAKE  DROP   SAY  OPEN  NOTH CLOSE    ON   OFF  WAVE  CALM
C 11-20    WALK  KILL  POUR   EAT DRINK   RUB THROW  QUIT  FIND INVEN
C 21-30    FEED  FILL BLAST SCORE   FOO BRIEF  READ BREAK  WAKE SUSPD
C 31-40    HOUR  YANK  WEAR   HIT ANSWR  BLOW LEAVE  YELL  DIAL  PLAY
C 41-50    PICK   PUT  TURN   GET INSRT REMOV  BURN GRIPE  LOCK UNLOK
C 51-60  HEALTH  LOOK COMBO SWEEP TERSE WIZ    MAP   GATE  PIRLOC
       CALL BUG(24)
C  ROUTINES FOR PERFORMING THE VARIOUS ACTION VERBS

C  STATEMENT NUMBERS IN THIS SECTION ARE 10000 FOR INTRANSITIVE VERBS, 20000 FOR
C  TRANSITIVE, PLUS 100 TIMES THE VERB NUMBER.  MANY INTRANSITIVE VERBS USE THE
C  TRANSITIVE CODE, AND SOME VERBS USE CODE FOR OTHER VERBS, AS NOTED BELOW.

C  RANDOM INTRANSITIVE VERBS COME HERE.  CLEAR OBJ JUST IN CASE (SEE "ATTACK").

10000   CALL A5TOA1(VTXT(VRBX,1),VTXT(VRBX,2),'WHAT?',TK,K)
       PRINT 10002,(TK(I),I=1,K)
10002   FORMAT(/' ',20A1)
       OBJS(1)=0
       OBJX=0
       GOTO 2600


10010   CALL A5TOA1(VTXT(VRBX,1),VTXT(VRBX,2),'it?',TK,K)
       PRINT 10012,(TK(I),I=1,K)
10012   FORMAT(/' Where do you want to ',20A1)
       GOTO 2600


C  CONSTRUCT MSG: "I DON'T KNOW HOW TO [VERB] THE [OBJ]", AND VARIANTS.

C  CARRY, NO OBJECT GIVEN YET.  OK IF ONLY ONE OBJECT PRESENT.

10100   IF(ATLOC(LOC).EQ.0.OR.LINK(ATLOC(LOC)).NE.0.OR.BLIND(0))
     1  GOTO 10000
      L1=DWFMAX-1
       DO 10110 I=1,L1
       IF(DLOC(I).EQ.LOC.AND.DFLAG.GE.2)GOTO 10000
10110   CONTINUE
       OBJ=ATLOC(LOC)
       IF(VERB.EQ.YANK)GOTO 23200
       IF(VERB.EQ.WEAR)GOTO 23300

C  CARRY AN OBJECT.  SPECIAL CASES FOR BIRD AND CAGE (IF BIRD IN CAGE, CAN'T
C  TAKE ONE WITHOUT THE OTHER.  LIQUIDS ALSO SPECIAL, SINCE THEY DEPEND ON
C  STATUS OF BOTTLE.  ALSO VARIOUS SIDE EFFECTS, ETC.
C  "YANK" AND "WEAR" ALSO WEAVE INTO THIS CODE, SINCE THEY ARE MOSTLY
C  JUST RESTRICTED CARRY'S.

20100   IF(OBJ.EQ.BOAT)SPK=281
       IF(PLURAL(OBJ))SPK=297
       IF(PREP.NE.PREPOF)GOTO 20104
       IF(OBJ.NE.0.AND.IOBJ.NE.0)GOTO 2060
       IF(OBJ.EQ.0)OBJ=IOBJ
       IOBJ=0
       GOTO 20200

20104   IF(HOLDNG(OBJ))GOTO 2011
       ASSIGN 20106 TO RETN
       GOTO 20190

20106   IF(PREP.EQ.PREPIN)GOTO 24500
       IF(PREP.EQ.PREPFR.OR.ENCLSD(OBJ))GOTO 24600

C  THE NEXT LINES ARE FOR 'TAKING' LIQUIDS (WATER, OIL & WINE).
C  IF WE ARE HOLDING A CONTAINER (BOTTLE OR CASK), WE CAN TAKE THE
C  THE LIQUID BY FILLING THE CONTAINER.  IF THERE IS A CONTAINER NEARBY
C  HOLDING THE REQUESTED LIQUID, WE WILL PICK UP THE CONTAINER.

       IF(IOBJ.EQ.0)GOTO 20110
       SPK=313
       IF(OBJ.NE.CASK.AND.OBJ.NE.BOTTLE)GOTO 2011
       K=0
       IF(OBJ.EQ.CASK)K=1
       IOBJ=IOBJ+K
       IF(LIQ(OBJ).EQ.IOBJ)GOTO 20116
       SPK=302+K
       IF(PROP(OBJ).NE.1)GOTO 2011
       GOTO 20118

20110   IF(OBJ.NE.WATER.AND.OBJ.NE.OIL.AND.OBJ.NE.WINE)GOTO 20120
       IOBJ=OBJ
       K=0
       OBJ=BOTTLE
       IF(.NOT.HERE(BOTTLE))GOTO 20114
       IF(PROP(BOTTLE).NE.1)GOTO 20112
       IF(.NOT.HERE(CASK).OR.(HERE(CASK).AND.PROP(CASK).EQ.1))
     1  GOTO 20118
       OBJ=0
       CALL RSPEAK(304)
       GOTO 2600

20112   IF(LIQ(BOTTLE).EQ.IOBJ)GOTO 20116
20114   SPK=312
       IF(.NOT.HERE(CASK))GOTO 2011
       OBJ=CASK
       K=1
       IF(PROP(CASK).EQ.1)GOTO 20118
       IF(LIQ(CASK).EQ.IOBJ)GOTO 20116
       SPK=315
       IF(.NOT.ATHAND(BOTTLE))SPK=303
       GOTO 2011

20116   IF(.NOT.HOLDNG(OBJ))GOTO 20120
       SPK=302+K
       GOTO 2011

20118   IF(HOLDNG(OBJ))GOTO 22200
       GOTO 20120
C  *** END OF LIQUID STUFF

C  'WEAR' AND 'YANK' WEAVE IN HERE.

20120   SPK=343
       IF(OBJ.EQ.BEAR .OR. BURDEN(0)+BURDEN(OBJ).LE.15 )GOTO 20125
       SPK=92
       IF(.NOT.WEARNG(OBJ))GOTO 2011
       PROP(OBJ)=0
       CALL BITOFF(OBJ,WEARBT)
       GOTO 2011

C  CLOAK.  BIG TROUBLE AHEAD.  CAN ONLY GET HERE VIA 'YANK'.
20125   IF(OBJ.NE.CLOAK.OR.PROP(CLOAK).NE.2)GOTO 20130
       PROP(ROCKS)=1
       PROP(CLOAK)=0
       FIXED(CLOAK)=0
       CALL CARRY(CLOAK,LOC)
       CALL RSPEAK(241)
       IF(AT(WUMPUS).AND.PROP(WUMPUS).EQ.0)GOTO 22900
       GOTO 2100

C  POSTER: HIDES WALL SAFE.
20130   IF(OBJ.NE.POSTER.OR.PLACE(SAFE).NE.0)GOTO 20160
       PROP(POSTER)=1
       SPK=362
C  MOVE SAFE AND WALL CONTAINING SAFE INTO VIEW.
       CALL DROP(SAFE,LOC)
       CALL DROP(WALL2,LOC)
       GOTO 20180

C  BOAT: NEED THE POLE TO PUSH IT
20160   IF(OBJ.NE.BOAT)GOTO 20165
       SPK=218
       IF(.NOT.TOTING(POLE).AND.PLACE(POLE).NE.-BOAT)GOTO 2011
       PROP(BOAT)=1
       SPK=221
       GOTO 20180

C  BIRD: GOT TO HAVE CAGE, BUT ROD CAN'T BE AROUND TO TAKE BIRD
20165   IF(OBJ.NE.BIRD.OR.PROP(BIRD).NE.0)GOTO 20170
       SPK=26
       IF(ATHAND(ROD))GOTO 2011
       SPK=27
       IF(.NOT.HOLDNG(CAGE))GOTO 2011
       CALL INSERT(BIRD,CAGE)
       CALL BITOFF(CAGE,OPENBT)
       GOTO 2009

C  SWORD: IF IN ANVIL, NEEDS CROWN & MUST YANK.
20170   IF(OBJ.NE.SWORD.OR.PROP(SWORD).EQ.0)GOTO 20180
       IF(IOBJ.NE.0.AND.IOBJ.NE.ANVIL)GOTO 2070
       IF(VERB.EQ.YANK)GOTO 20175

C  HE WANTS THE SWORD, BUT HASN'T ESTABLISHED HIS ROYAL BLOOD, OR HE
C  HASN'T PULLED HARD ENOUGH.  OR NEITHER.

       IF(.NOT.YES(215,0,0))GOTO 2009
20175   IF(WEARNG(CROWN))GOTO 20180
       CALL PSPEAK(SWORD,2)
       IF(CLOSED)GOTO 93000
       FIXED(SWORD)=-1
       PROP(SWORD)=3
       GOTO 2100

20180   CALL CARRY(OBJ,LOC)
       IF(OBJ.EQ.POLE.OR.OBJ.EQ.SKEY.OR.OBJ.EQ.SWORD
     1  .OR.((OBJ.EQ.CLOAK.OR.OBJ.EQ.RING)
     2          .AND..NOT.WEARNG(OBJ)) )PROP(OBJ)=0
       IF(VERB.NE.YANK.OR.OBJ.EQ.SWORD)GOTO 2011
       SPK=204
       GOTO 2011


C  THIS IS A QUASI-SUBROUTINE, CALLED FROM 'TAKE' AND FROM 'INSERT', WHEN
C  THE ITEM IS NOT CURRENTLY BEING TOTED.  'RETN' IS A VARIABLE DEFINED
C  TO BE THE RETURN ADDRESS.

20190   SPK=NOWAY(0)
       IF(OBJ.EQ.PLANT.AND.PROP(PLANT).LE.0)SPK=115
       IF(OBJ.EQ.BEAR.AND.PROP(BEAR).EQ.1)SPK=169
       IF(OBJ.EQ.CHAIN.AND.PROP(BEAR).NE.0)SPK=170
       IF(OBJ.EQ.SWORD.AND.PROP(SWORD).EQ.5)SPK=208
       IF(OBJ.EQ.CLOAK.AND.PROP(CLOAK).EQ.2)SPK=242
       IF(OBJ.EQ.AXE.AND.PROP(AXE).EQ.2)SPK=246
       IF(OBJ.EQ.PHONE)SPK=251
       IF(OBJ.EQ.BEES.OR.OBJ.EQ.HIVE)SPK=295
       IF(OBJ.EQ.STICKS)SPK=296
       IF(FIXED(OBJ).NE.0)GOTO 2011
       GOTO RETN
C  DROP/DISCARD OBJECT.  "THROW" ALSO COMES HERE FOR MOST OBJECTS.
C  SPECIAL CASES FOR BIRD (MIGHT ATTACK SNAKE OR DRAGON) AND CAGE (MIGHT
C  CONTAIN BIRD) AND VASE.
C  DROP COINS IN VENDING MACHINE FOR EXTRA BATTERIES.

20200   IF(HOLDNG(ROD2).AND.OBJ.EQ.ROD.AND..NOT.HOLDNG(ROD))OBJ=ROD2
       IF(PLURAL(OBJ))SPK=105
       K=LIQ(BOTTLE)
       IF(K.EQ.OBJ)OBJ=BOTTLE
       IF(OBJ.NE.BOTTLE)K=LIQ(CASK)
       IF(OBJ.NE.BOTTLE.AND.K.EQ.OBJ)OBJ=CASK
       IF(.NOT.TOTING(OBJ))GOTO 2011
       IF(PREP.EQ.PREPIN)GOTO 24500
       IF(OBJ.NE.BIRD.OR..NOT.HERE(SNAKE))GOTO 20220
       CALL RSPEAK(30)
       IF(CLOSED)GOTO 93000
       CALL REMOVE(BIRD)
       CALL DSTROY(SNAKE)
C  SET SNAKE PROP FOR USE BY TRAVEL OPTIONS
       PROP(SNAKE)=1
       CALL DROP(BIRD,LOC)
       GOTO 2100

20220   SPK=344
       IF(VERB.EQ.LEAVE)SPK=353
       IF(VERB.EQ.THROW)SPK=352
       IF(VERB.EQ.TAKE)SPK=54
       IF(OBJ.NE.POLE.OR..NOT.HOLDNG(BOAT))GOTO 20240
       SPK=280
       GOTO 2011

20240   IF(OBJ.NE.BIRD.OR..NOT.AT(DRAGON).OR.PROP(DRAGON).NE.0)
     1  GOTO 20260
       CALL RSPEAK(154)
       CALL REMOVE(BIRD)
       CALL DSTROY(BIRD)
       IF(PLACE(SNAKE).EQ.PLAC(SNAKE))TALLY2=TALLY2+1
       GOTO 2100

20260   IF(OBJ.NE.BEAR.OR..NOT.AT(TROLL))GOTO 20270
       SPK=163
       CALL DSTROY(TROLL)
       CALL DSTROY(TROLL+MAXOBJ)
       CALL MOVE(TROLL2,PLAC(TROLL))
       CALL MOVE(TROLL2+MAXOBJ,FIXD(TROLL))
       CALL JUGGLE(CHASM)
       PROP(TROLL)=2
       GOTO 20290

20270   IF(OBJ.NE.VASE.OR.LOC.EQ.PLAC(PILLOW))GOTO 20275
       PROP(VASE)=2
       IF(AT(PILLOW))PROP(VASE)=0
       CALL PSPEAK(VASE,PROP(VASE)+1)
       IF(PROP(VASE).NE.0)FIXED(VASE)=-1
       GOTO 20290

20275   IF(OBJ.NE.FLY.OR..NOT.AT(SPIDER)) GOTO 20280
       PROP(FLY)=1
       PROP(SPIDER)=1
       SPK=379
       CALL DSTROY(FLY)
       GOTO 2011
20280   IF(WORN(OBJ).OR.OBJ.EQ.POLE.OR.OBJ.EQ.BOAT)PROP(OBJ)=0
       IF(WORN(OBJ))CALL BITOFF(OBJ,WEARBT)
       IF(OBJ.EQ.POLE)PROP(BOAT)=0
20290   IF(ENCLSD(OBJ))CALL REMOVE(OBJ)
       CALL DROP(OBJ,LOC)
       GOTO 2011
C  OPEN/CLOSE/LOCK/UNLOCK: NO OBJECT GIVEN.
C  ASSUME VARIOUS THINGS IF PRESENT.

10400   SPK=28
       K=0
       DO 10410 I=1,MAXOBJ
       IF(.NOT.(HERE(I).AND.HINGED(I)))GOTO 10410
       OBJ=I
       K=K+1
10410   CONTINUE
       IF(K.GT.1)GOTO 10000
       IF(OBJ.NE.0)GOTO 10420
       IF(VERB.EQ.LOCK.OR.VERB.EQ.UNLOCK)GOTO 2011
       GOTO 10000

10420   IF(VERB.EQ.LOCK)GOTO 24900
       IF(VERB.EQ.UNLOCK)GOTO 25000
       IF(VERB.EQ.SHUT)GOTO 20600

C  OPEN.   SPECIAL STUFF FOR OPENING CLAM/OYSTER.
C  THE FOLLOWING CAN BE OPENED WITHOUT A KEY:
C       CLAM/OYSTER, DOOR, PDOOR, BOTTLE, CASK, CAGE

20400   IF(.NOT.HINGED(OBJ))GOTO 2070
       SPK=253
       IF(OBJ.EQ.PDOOR.AND.PROP(PDOOR).EQ.1)GOTO 2011
       SPK=336
       IF(AJAR(OBJ))GOTO 2011
       IF(LOCKS(OBJ).OR.IOBJ.EQ.KEYS.OR.IOBJ.EQ.SKEY)GOTO 25000
       SPK=337
       IF(OBJ.EQ.DOOR)SPK=111
       IF(LOCKED(OBJ))GOTO 2011
       IF(OBJ.EQ.CLAM.OR.OBJ.EQ.OYSTER)GOTO 20410
       CALL BITON(OBJ,OPENBT)
       GOTO 2009

C  CLAM/OYSTER.
20410   K=0
       IF(OBJ.EQ.OYSTER)K=1
       SPK=124+K
       IF(HOLDNG(OBJ))SPK=120+K
       IF(.NOT.ATHAND(TRIDNT))SPK=122+K
       IF(IOBJ.NE.0.AND.IOBJ.NE.TRIDNT)SPK=376+K
       IF(SPK.NE.124)GOTO 2011
       CALL DSTROY(CLAM)
       CALL DROP(OYSTER,LOC)
       CALL DROP(PEARL,105)
       GOTO 2011


C  CLOSE.  SHUT.
C  THE FOLLOWING CAN BE CLOSED WITHOUT KEYS:
C       DOOR, PDOOR, BOTTLE, CASK, CAGE

20600   IF(.NOT.HINGED(OBJ))GOTO 2070
       SPK=338
       IF(.NOT.AJAR(OBJ))GOTO 2011
       IF(LOCKS(OBJ))GOTO 24900
       CALL BITOFF(OBJ,OPENBT)
       GOTO 2009
C  LIGHT LAMP

20700   IF(.NOT.ATHAND(LAMP))GOTO 2011
       SPK=184
       IF(LIMIT.LT.0)GOTO 2011
       SPK=321
       IF(PROP(LAMP).EQ.1)GOTO 2011
       PROP(LAMP)=1
       K=39
       IF(LOC.EQ.200)K=108
       CALL RSPEAK(K)
       IF(WZDARK)GOTO 2000
       GOTO 2100

C  LAMP OFF

20800   IF(.NOT.ATHAND(LAMP))GOTO 2011
       SPK=322
       IF(PROP(LAMP).EQ.0)GOTO 2011
       PROP(LAMP)=0
       CALL RSPEAK(40)
       IF(DARK(0))CALL RSPEAK(16)
       GOTO 2100

C  WAVE.  NO EFFECT UNLESS WAVING ROD AT FISSURE.

20900   IF((.NOT.HOLDNG(OBJ)).AND.(OBJ.NE.ROD.OR..NOT.HOLDNG(ROD2)))
     1  SPK=29
       IF(OBJ.NE.ROD.OR..NOT.AT(FISSUR).OR..NOT.HOLDNG(OBJ)
     1  .OR.CLOSNG)GOTO 2011
       IF(IOBJ.NE.0.AND.IOBJ.NE.FISSUR)GOTO 2011
       PROP(FISSUR)=1-PROP(FISSUR)
       CALL PSPEAK(FISSUR,2-PROP(FISSUR))
       IF(CHASE.EQ.0.OR.PROP(FISSUR).NE.0)GOTO 2100

C  DEMISE OF THE WUMPUS.  CHAMP MUST HAVE JUST CROSSED BRIDGE.

       IF((LOC.EQ.17.AND.OLDLOC.NE.27)
     1  .OR.(LOC.EQ.27.AND.OLDLOC.NE.17))GOTO 2100
       CALL RSPEAK(244)
       CHASE=0
       CALL DROP(RING,209)
       CALL MOVE(WUMPUS,209)
       PROP(WUMPUS)=6
       CALL BITON(WUMPUS,DEADBT)
       IF(PLACE(AXE).NE.PLAC(WUMPUS))GOTO 2100
       FIXED(AXE)=0
       PROP(AXE)=0
       GOTO 2100

C  ATTACK.  ASSUME TARGET IF UNAMBIGUOUS.  "THROW" ALSO LINKS HERE.  ATTACKABLE
C  OBJECTS FALL INTO TWO CATEGORIES: ENEMIES (SNAKE, DWARF, ETC.)  AND OTHERS
C  (BIRD, CLAM).  AMBIGUOUS IF TWO ENEMIES, OR IF NO ENEMIES BUT TWO OTHERS.

C  KILL OBJ WITH IOBJ.

21200       L1=DWFMAX-1
        DO 21210 DWARFN=1,L1
       IF(DLOC(DWARFN).EQ.LOC.AND.DFLAG.GE.2)GOTO 21220
21210   CONTINUE
       DWARFN=0
21220   IF(OBJ.NE.0)GOTO 21240
       IF(DWARFN.NE.0)OBJ=DWARF
       IF(HERE(SNAKE))OBJ=OBJ*MAXOBJ+SNAKE
       IF(AT(DRAGON).AND.PROP(DRAGON).EQ.0)OBJ=OBJ*MAXOBJ+DRAGON
       IF(AT(TROLL))OBJ=OBJ*MAXOBJ+TROLL
       IF(HERE(GNOME))OBJ=OBJ*MAXOBJ+GNOME
       IF(HERE(BEAR).AND.PROP(BEAR).EQ.0)OBJ=OBJ*MAXOBJ+BEAR
       IF(HERE(WUMPUS).AND.PROP(WUMPUS).EQ.0)OBJ=OBJ*MAXOBJ+WUMPUS
       IF(OBJ.GT.MAXOBJ)GOTO 10000
       IF(OBJ.NE.0)GOTO 21240
C  CAN'T ATTACK BIRD BY THROWING AXE.
       IF(HERE(BIRD).AND.VERB.NE.THROW)OBJ=BIRD
C  CLAM AND OYSTER BOTH TREATED AS CLAM FOR INTRANSITIVE CASE; NO HARM DONE.
       IF(HERE(CLAM).OR.HERE(OYSTER))OBJ=MAXOBJ*OBJ+CLAM
       IF(OBJ.GT.MAXOBJ)GOTO 10000
21240   IF(OBJ.NE.BIRD)GOTO 21245
       SPK=137
       IF(CLOSED)GOTO 2011
       CALL DSTROY(BIRD)
       PROP(BIRD)=0
       IF(PLACE(SNAKE).EQ.PLAC(SNAKE))TALLY2=TALLY2+1
       SPK=45
21245   IF(OBJ.NE.FLY)GOTO 21250
       PROP(FLY)=2
       SPK=398
       CALL DSTROY(FLY)
       GOTO 2011
21250   IF(OBJ.EQ.DWARF)GOTO 21270
       IF(OBJ.EQ.0)SPK=44
       IF(OBJ.EQ.CLAM.OR.OBJ.EQ.OYSTER)SPK=150
       IF(AT(DOG).AND.PROP(DOG).EQ.1)SPK=291
       IF(OBJ.EQ.SNAKE)SPK=46
       IF(OBJ.EQ.DRAGON.OR.(OBJ.EQ.WUMPUS.AND.PROP(WUMPUS).EQ.6))SPK=167
       IF(OBJ.EQ.TROLL)SPK=157
       IF(OBJ.EQ.BEAR)SPK=165+(PROP(BEAR)+1)/2
       IF(OBJ.EQ.GNOME)SPK=320
       IF(IOBJ.NE.AXE.OR.VERB.EQ.THROW.OR.
     1  (OBJ.NE.DOG.AND.OBJ.NE.WUMPUS.AND.OBJ.NE.DRAGON
     2   .AND.OBJ.NE.TROLL))GOTO 21253
       IOBJ=OBJ
       OBJ=IOBJS(IOBX)
       SPK=110
       GOTO 21700

21253   IF(IOBJ.NE.0.AND.IOBJ.NE.AXE)GOTO 2070
       IF(OBJ.NE.DRAGON.OR.PROP(DRAGON).NE.0)GOTO 2011

C  FUN STUFF FOR DRAGON.  IF HE INSISTS ON ATTACKING IT, WIN!  SET PROP TO DEAD,
C  MOVE DRAGON TO CENTRAL LOC (STILL FIXED), MOVE RUG THERE (NOT FIXED), AND
C  MOVE HIM THERE, TOO.  THEN DO A NULL MOTION TO GET NEW DESCRIPTION.
C  THERE IS SOME AMOUNT OF PAIN HERE, TO FORCE GETWDS TO DO THE RIGHT THING.

       CALL RSPEAK(49)
       CALL GETLIN
       WDX=0
       CALL CLRLIN
       IF(TXT(1,1).EQ.'Y'.OR.TXT(1,1).EQ.'YES')GOTO 21255
       WORDS(1)=-2
       RDFLAG=.TRUE.
       GOTO 2600

21255   CALL PSPEAK(DRAGON,1)
       CALL BITON(DRAGON,DEADBT)
       PROP(DRAGON)=2
       PROP(RUG)=0
       K=(PLAC(DRAGON)+FIXD(DRAGON))/2
       CALL MOVE(DRAGON+MAXOBJ,-1)
       CALL MOVE(RUG+MAXOBJ,0)
       CALL MOVE(DRAGON,K)
       CALL MOVE(RUG,K)
       DO 21260 OBJ=1,MAXOBJ
       IF(PLACE(OBJ).EQ.PLAC(DRAGON).OR.PLACE(OBJ).EQ.FIXD(DRAGON))
     1  CALL MOVE(OBJ,K)
21260   CONTINUE
       WORDS(1)=0
       LOC=K
       NEWLOC=K
       GOTO 2

C  HE IS ATTACKING A DWARF.  IF USING SOMETHING OTHER THAN AXE OR SWORD,
C  GOODBYE CHARLIE.  IF USING NOTHING, DON'T LET HIM.  IF USING AXE OR
C  SWORD, THE FOLLOWING ODDS PREVAIL (IF I CALCULATED THIS MESS RIGHT!)
C  (THE END OF LINE FIGURE IS THE CULULATIVE PROBABILITY OF THE EVENT):
C  .25 - HERO KILLS DWARF (.25)
C  .75 - HERO MISSES
C       .25 - HERO GETS KNIFE IN (HIS) RIBS.  DIES. (.1875)
C       .75 - HERO CAN'T MAKE A CLEAN THRUST
C               .36 - STANDOFF (.2)
C               .64 - DWARF SLASHES
C                       .61 - DWARF MISSES! (.22)
C                       .39 - DWARF KILLS HERO (.14)
C  ADVENTURER HAS 1/3 CHANCE OF GETTING NAILED, 1/4 CHANCE OF NAILING
C  DWARF.  ALL BY WAY OF ENCOURAGING HIM TO THROW THE AXE.

21270   IF(OBJ.EQ.DWARF.AND.CLOSED)GOTO 93000
       SPK=49
       IF(IOBJ.EQ.0)GOTO 2011
       SPK=355
       IF(IOBJ.NE.AXE.AND.IOBJ.NE.SWORD)GOTO 21275
       IF(PCT(25))GOTO 21753
       IF(PCT(25))GOTO 21275
       CALL RSPEAK(354)
       IF(PCT(36))GOTO 2100
       CALL RSPEAK(356)
       SPK=52
       IF(PCT(61))GOTO 2011
       SPK=53

C  HERO IS GONZO.
21275   CALL RSPEAK(SPK)
       OLDLC2=LOC
       GOTO 94100
C  POUR.  IF NO OBJECT, ASSUME LIQ IN CONTAINER, IF HOLDING ONLY ONE.
C  SPECIAL TESTS FOR POURING WATER OR OIL ON PLANT OR RUSTY DOOR.

11300   IF(.NOT.HOLDNG(BOTTLE).AND..NOT.HOLDNG(CASK))GOTO 10000
       K=LIQ(BOTTLE)
       KK=LIQ(CASK)
       IF(HOLDNG(BOTTLE).AND.K.NE.0.AND.HOLDNG(CASK)
     1  .AND.KK.NE.0)GOTO 10000
       IF(KK.NE.0.AND.HOLDNG(CASK))OBJ=CASK
       IF(K.NE.0.AND.HOLDNG(BOTTLE))OBJ=BOTTLE
       IF(OBJ.EQ.0)GOTO 10000

C  POUR OBJ FROM IOBJ.
21300   SPK=78
       IF(OBJ.NE.BOTTLE.AND.OBJ.NE.CASK)GOTO 21310
       IOBJ=OBJ
       OBJ=LIQ(IOBJ)
       SPK=316
       IF(OBJ.EQ.0)GOTO 2011
       GOTO 21320

21310   IF(OBJ.LT.WATER.OR.OBJ.GT.WINE+1)GOTO 2011
       SPK=29
       IF(.NOT.HOLDNG(BOTTLE).AND..NOT.HOLDNG(CASK))GOTO 2011
       IF(HOLDNG(BOTTLE).AND.LIQ(BOTTLE).EQ.OBJ)IOBJ=BOTTLE
       IF(HOLDNG(CASK).AND.LIQ(CASK).EQ.OBJ)IOBJ=CASK
       IF(IOBJ.EQ.0)GOTO 2011
21320   SPK=335
       IF(.NOT.AJAR(IOBJ))GOTO 2011
       IF(IOBJ.EQ.CASK)OBJ=OBJ+1
       PROP(IOBJ)=1
       CALL REMOVE(OBJ)
       PLACE(OBJ)=0
       SPK=77
       IF(IOBJ.NE.CASK)GOTO 21330
       OBJ=OBJ-1
       SPK=104
21330   IF(.NOT.(AT(PLANT).OR.AT(DOOR).OR.AT(SWORD)).OR.
     1  AT(SWORD).AND.PROP(SWORD).EQ.0)GOTO 2011

       IF(AT(DOOR))GOTO 21340
       IF(AT(SWORD))GOTO 21350
       SPK=112
       IF(OBJ.NE.WATER)GOTO 2011
       CALL PSPEAK(PLANT,PROP(PLANT)+1)
       PROP(PLANT)=MOD(PROP(PLANT)+2,6)
       PROP(PLANT2)=PROP(PLANT)/2
       NEWLOC=LOC
       GOTO 2

21340   PROP(DOOR)=0
       IF(OBJ.NE.OIL)GOTO 21341
       PROP(DOOR)=1
       CALL BITOFF(DOOR,LOCKBT)
       CALL BITON(DOOR,OPENBT)
21341   SPK=113+PROP(DOOR)
       GOTO 2011

C  IF SWORD IS ALREADY OILY, DON'T LET HIM CLEAN IT.  NO SOAP.

21350   IF(PROP(SWORD).EQ.5)GOTO 21360
       PROP(SWORD)=4
       IF(OBJ.NE.OIL)GOTO 21360
       PROP(SWORD)=5
       FIXED(SWORD)=-1
21360   SPK=206+PROP(SWORD)-4
       GOTO 2011
C  EAT.  INTRANSITIVE: ASSUME EDIBLE IF PRESENT, ELSE ASK WHAT.  TRANSITIVE:
C  FOOD/MUSHROOMS/CAKES OK, SOME THINGS LOSE APPETITE, REST ARE RIDICULOUS.
C  IF HE HAS MORE THAN ONE EDIBLE, OR NONE, 'EAT' IS AMBIGUOUS WITHOUT
C  AN EXPLICIT OBJECT.

11400   K=0
       DO 11410 I=1,MAXOBJ
       IF(.NOT.(HERE(I).AND.EDIBLE(I))) GOTO 11410
       K=K+1
       KK=I
11410   CONTINUE
       IF(K.NE.1)GOTO 10000
       OBJ=KK
       IF(OBJ.NE.FOOD.AND.OBJ.NE.HONEY)GOTO 21400
11420   IF(OBJ.EQ.HONEY)TALLY2=TALLY2+1
       CALL DSTROY(OBJ)
       SPK=72
       GOTO 2011

C  IF HE ATE THE RIGHT THING AND IS IN THE RIGHT PLACE, MOVE HIM TO
C  THE OTHER PLACE WITH ALL HIS JUNK.  OTHERWISE, NARKY MESSAGE.
21400   IF(OBJ.EQ.FOOD.OR.OBJ.EQ.HONEY)GOTO 11420
       IF(OBJ.EQ.BIRD.OR.OBJ.EQ.SNAKE.OR.OBJ.EQ.CLAM.OR.OBJ.EQ.OYSTER
     1  .OR.OBJ.EQ.FLOWER.OR.OBJ.EQ.FLY)SPK=301
       IF(OBJ.EQ.DWARF.OR.OBJ.EQ.DRAGON.OR.OBJ.EQ.TROLL
     1  .OR.OBJ.EQ.DOG.OR.OBJ.EQ.WUMPUS.OR.OBJ.EQ.BEAR
     2  .OR.OBJ.EQ.GNOME)SPK=250
       IF(OBJ.NE.MUSHRM.AND.OBJ.NE.CAKES)GOTO 2011

       K=OBJ-MUSHRM
       LL=229+K
       K=159-K
       KK=SKEY
       IF(OBJ.EQ.MUSHRM)KK=TDOOR
       IF(OBJ.EQ.MUSHRM.AND.LOC.NE.158)TALLY2=TALLY2+1
       CALL DSTROY(OBJ)
       SPK=228
       IF(.NOT. (HERE(INTS(KK)).OR.FIXED(KK).EQ.LOC) )GOTO 2011
       CALL RSPEAK(LL)
C  IF HE HASN'T TAKEN TINY KEY OFF SHELF, DON'T LET HIM GET IT FOR FREE!
       DO 21440 OBJ=1,MAXOBJ
       IF(OBJ.EQ.SKEY.AND.PROP(SKEY).EQ.1)GOTO 21440
       IF(PLACE(OBJ).EQ.PLAC(KK).AND.FIXED(OBJ).EQ.0)CALL MOVE(OBJ,K)
21440   CONTINUE
       IF(LOC.EQ.PLAC(SKEY).AND.PLACE(SKEY).EQ.PLAC(SKEY))
     1  TALLY2=TALLY2+1
       LOC=K
       NEWLOC=K
       GOTO 2
C  DRINK.  IF NO OBJECT, ASSUME WATER OR WINE AND LOOK FOR THEM HERE.
C  IF POTABLE IS IN BOTTLE OR CASK, DRINK THAT.  IF NOT, SEE IF THERE
C  IS SOMETHING DRINKABLE NEARBY (STREAM, LAKE, WINE FOUNTAIN, ETC.),
C  AND DRINK THAT.  IF HE HAS STUFF IN BOTH CONTAINERS, ASK WHICH.

C  DRINK OBJ FROM IOBJ
11500   LL=LIQLOC(LOC)
       IF(.NOT.ATHAND(BOTTLE).AND..NOT.ATHAND(CASK)
     1  .AND.LL.NE.WINE.AND.LL.NE.WATER)GOTO 10000
       K=LIQ(BOTTLE)
       KK=LIQ(CASK)
       IF(.NOT.ATHAND(BOTTLE).OR.K.EQ.0)GOTO 11520
       IF(ATHAND(CASK).AND.KK.NE.0.AND.KK.NE.K)GOTO 10000
       OBJ=K
       IOBJ=BOTTLE
       GOTO 21560

11520   IF(.NOT.ATHAND(CASK).OR.KK.EQ.0)GOTO 11540
       OBJ=KK
       IOBJ=CASK
       GOTO 21560

11540   IF(LL.EQ.0)GOTO 10000
       OBJ=LL
       IOBJ=-1
       GOTO 21560

21500   IF(OBJ.EQ.0.AND.(IOBJ.EQ.BOTTLE.OR.IOBJ.EQ.CASK))OBJ=LIQ(IOBJ)
       SPK=110
       IF(OBJ.EQ.OIL)SPK=301
       IF(OBJ.NE.WATER.AND.OBJ.NE.WINE)GOTO 2011
       IF(IOBJ.NE.0)GOTO 21560
       IF(OBJ.EQ.LIQLOC(LOC))IOBJ=-1
       IF(ATHAND(CASK).AND.OBJ.EQ.LIQ(CASK))IOBJ=CASK
       IF(ATHAND(BOTTLE).AND.OBJ.EQ.LIQ(BOTTLE))IOBJ=BOTTLE
21560   SPK=73
       IF(IOBJ.EQ.-1)GOTO 21570
       IF(IOBJ.EQ.CASK)OBJ=OBJ+1
       CALL REMOVE(OBJ)
       PLACE(OBJ)=0
       PROP(IOBJ)=1
       SPK=74
       IF(IOBJ.EQ.CASK)SPK=299
21570   IF(OBJ.EQ.WATER.OR.OBJ.EQ.WATER+1)GOTO 2011

C  UH-OH.  HE'S A WINO.  LET HIM REAP THE REWARDS OF INCONTINENCE.
C  HE'LL WANDER AROUND FOR AWHILE, THEN WAKE UP SOMEWHERE OR OTHER,
C  HAVING DROPPED MOST OF HIS STUFF.

       CALL RSPEAK(300)
       IF(PROP(LAMP).EQ.1)LIMIT=LIMIT-RAN(LIMIT)/2
       IF(LIMIT.LT.10)LIMIT=25
       K=0
       IF(PCT(15))K=49
       IF(K.EQ.0.AND.PCT(15))K=53
       IF(K.EQ.0.AND.PCT(25))K=132
       IF(K.EQ.0)K=175
       IF(OUTSID(LOC))K=5
       IF(K.EQ.LOC)GOTO 2100
       IF(HOLDNG(AXE))CALL MOVE(AXE,K)
       IF(HOLDNG(LAMP))CALL MOVE(LAMP,K)
       DO 21580 J=1,MAXOBJ
       IF(WEARNG(J))CALL BITOFF(J,WEARBT)
21580   IF(HOLDNG(J))CALL DROP(J,LOC)
       LOC=K
       NEWLOC=K
       GOTO 2





C  RUB.  YIELDS VARIOUS SNIDE REMARKS.

21600   IF(OBJ.NE.LAMP)SPK=76
       GOTO 2011
C  THROW OBJ AT IOBJ.
C  SAME AS DISCARD UNLESS AXE.  THEN SAME AS ATTACK EXCEPT IGNORE BIRD,
C  AND IF DWARF IS PRESENT THEN ONE MIGHT BE KILLED.
C  AXE ALSO SPECIAL FOR DRAGON, BEAR, DOG, WUMPUS AND TROLL.
C  TREASURES SPECIAL FOR TROLL.
C  IF THROWING FOOD AT SOMEONE WHO MIGHT BE HUNGRY, GO FEED HIM.

21700   IF(PREP.EQ.PREPDN)GOTO 24200
       IF(HOLDNG(ROD2).AND.OBJ.EQ.ROD.AND..NOT.HOLDNG(ROD))OBJ=ROD2
       IF(.NOT.HOLDNG(OBJ))GOTO 2011
       IF(OBJ.EQ.BOAT.OR.OBJ.EQ.BEAR)GOTO 2070
       DWARFN=0
       IF(IOBJ.NE.0)GOTO 21750

C  NO INDIRECT OBJ WAS SPECIFIED.  IF A DWARF IS PRESENT, ASSUME IT
C  IS THE IOBJ.  IF NOT, LOOK FOR ANY OTHER LIVING THING.  IF NO LIVING
C  THINGS PRESENT, TREAT 'THROW' AS 'DROP'.

      L1=DWFMAX-1
       DO 21710 DWARFN=1,L1
       IF(DLOC(DWARFN).EQ.LOC.AND.DFLAG.GE.2)GOTO 21718
21710   CONTINUE
       DWARFN=0

C  NO DWARVES PRESENT; FIGURE OUT PLAUSIBLE OBJECT.

       K=0
       DO 21715 I=1,MAXOBJ
       IF(.NOT. (AT(I).AND.LIVING(I)) )GOTO 21715
       IOBJ=I
       K=K+1
21715   CONTINUE
       IF(K.EQ.0)GOTO 20200

C  IT IS A BEASTIE OF SOME SORT.  IS THERE MORE THAN ONE?
C  DON'T KILL THE BIRD BY DEFAULT.

21717   IF(K.EQ.1)GOTO 21718
       CALL RSPEAK(43)
       GOTO 2600

21718   IF(IOBJ.EQ.BIRD)GOTO 20200
       IF(TREASR(OBJ).AND.AT(TROLL))IOBJ=TROLL

21750   IF(TREASR(OBJ).AND.IOBJ.EQ.TROLL)GOTO 21790
       IF(OBJ.EQ.SWORD.OR.OBJ.EQ.BOTTLE)GOTO 22800
       IF(DWARFN.NE.0)IOBJ=DWARF
       IF(EDIBLE(OBJ).AND.LIVING(IOBJ))GOTO 22100
       IF(OBJ.NE.AXE)GOTO 20200
       SPK=152
       IF(IOBJ.EQ.DRAGON.AND.PROP(DRAGON).EQ.0)GOTO 21755
       SPK=158
       IF(IOBJ.EQ.TROLL)GOTO 21755
       IF(IOBJ.NE.DWARF)GOTO 21760
       SPK=48
C  IF SAVED NOT = -1, HE BYPASSED THE "START" CALL.
       IF(RAN(3).EQ.0.OR.SAVED.NE.-1)GOTO 21755
       IF(DWARFN.NE.0)GOTO 21753
      L1=DWFMAX-1
       DO 21752 DWARFN=1,L1
       IF(DLOC(DWARFN).EQ.LOC.AND.DFLAG.GE.2)GOTO 21753
21752   CONTINUE
C  'ATTACK' WITH AXE OR SWORD LINKS IN HERE.
21753   DSEEN(DWARFN)=.FALSE.
       DLOC(DWARFN)=0
       SPK=47
       DKILL=DKILL+1
       IF(DKILL.EQ.1)SPK=149
21755   CALL RSPEAK(SPK)
       CALL DROP(AXE,LOC)
       NEWLOC=LOC
       GOTO 2

C  THIS'LL TEACH HIM TO THROW THE AXE AT THE BEAR!
21760   IF(IOBJ.NE.BEAR.OR.PROP(BEAR).NE.0)GOTO 21765
       SPK=164
       CALL DROP(AXE,LOC)
       FIXED(AXE)=-1
       PROP(AXE)=1
       CALL JUGGLE(BEAR)
       GOTO 2011

C  OR THE WUMPUS!
21765   IF(IOBJ.NE.WUMPUS.OR.PROP(WUMPUS).EQ.6)GOTO 21770
       IF(PROP(WUMPUS).EQ.6)GOTO 20200
       SPK=245
       PROP(AXE)=2
       IF(PROP(WUMPUS).EQ.0)GOTO 21780
       SPK=243
       CALL DSTROY(AXE)
       GOTO 2011

C  OR THE NICE DOGGIE!
21770   IF(IOBJ.NE.DOG.OR.PROP(DOG).EQ.1)GOTO 21790
       SPK=248
       PROP(AXE)=3
21780   CALL DROP(AXE,LOC)
       FIXED(AXE)=-1
       CALL JUGGLE(IOBJ)
       GOTO 2011

C  SNARF A TREASURE FOR THE TROLL.
21790   IF(IOBJ.NE.TROLL)GOTO 21795
       PREP=0
       IF(OBJ.EQ.CASK.AND.LIQ(CASK).NE.WINE)GOTO 20200
       SPK=159
       CALL DROP(OBJ,0)
       IF(OBJ.EQ.CASK)PLACE(WINE+1)=0
       CALL MOVE(TROLL,0)
       CALL MOVE(TROLL+MAXOBJ,0)
       CALL DROP(TROLL2,PLAC(TROLL))
       CALL DROP(TROLL2+MAXOBJ,FIXD(TROLL))
       CALL JUGGLE(CHASM)
       GOTO 2011

C  THROWING AXE AT NONE OF THE ABOVE.  ASSUME 'ATTACK'.
21795   OBJ=IOBJ
       IOBJ=OBJS(OBJX)
       GOTO 21200
C  QUIT.  INTRANSITIVE ONLY.  VERIFY INTENT AND EXIT IF THAT'S WHAT HE WANTS.

11800   GAVEUP=YES(22,54,54)
11850   IF(GAVEUP)GOTO 95000
       GOTO 2100

C  FIND.  MIGHT BE CARRYING IT, OR IT MIGHT BE HERE.  ELSE GIVE CAVEAT.

21900   IF(AT(OBJ).OR.(LIQ(BOTTLE).EQ.OBJ.AND.AT(BOTTLE))
     1  .OR.K.EQ.LIQLOC(LOC))SPK=94
      L1=DWFMAX-1
       DO 21920 I=1,L1
21920   IF(DLOC(I).EQ.LOC.AND.DFLAG.GE.2.AND.OBJ.EQ.DWARF)SPK=94
       IF(CLOSED)SPK=138
       IF(ATHAND(OBJ))SPK=24
       GOTO 2011



C  INVENTORY.  IF OBJECT, TREAT SAME AS FIND.  ELSE REPORT ON CURRENT BURDEN.
C  THERE ARE SOME FUNNY CASES, LIKE THE WEARABLE THINGS.  ALSO, BOAT
C  AND BEAR, WHICH AREN'T REALLY CARRIED.  LIST OUTER-LEVEL CONTAINERS
C  AND CONTENTS, IF CONTAINER IS OPEN OR TRANSPARENT.

12000   SPK=98
       DO 12050 I=1,MAXOBJ
       IF(I.EQ.BEAR.OR.I.EQ.BOAT.OR..NOT.HOLDNG(I))GOTO 12050
       IF(WEARNG(I))GOTO 12050
       IF(SPK.EQ.98)CALL RSPEAK(99)
       BLKLIN=.FALSE.
       CALL PSPEAK(I,-1)
       SPK=0
       IF(I.NE.BOAT)CALL LOOKIN(I)
12050   CONTINUE

C  TELL HIM WHAT HE IS WEARING.

       K=0
       DO 12060 I=1,MAXOBJ
       IF(.NOT.WEARNG(I))GOTO 12060
       IF(K.EQ.0)PRINT 12052
12052   FORMAT(1H ,'You are wearing:')
      CALL TNOUA('     ',5)
       CALL PSPEAK(I,-1)
       K=-1
12060   CONTINUE

       IF(.NOT.HOLDNG(BOAT))GOTO 12090
       CALL RSPEAK(221)
       CALL LOOKIN(BOAT)
12090   IF(HOLDNG(BEAR))SPK=141
       GOTO 2011
C  FEED.  IF BIRD, NO SEED.  SNAKE, DRAGON, TROLL: QUIP.  IF DWARF, MAKE HIM
C  MAD.  BEAR, SPECIAL.

C  CASE 1: FEED CRITTER.   *OR*
C  CASE 2: FEED CRITTER EDIBLE.
C        [** THIS CASE TRANSFORMED BY PARSER INTO CASE 3 **]
C  CASE 3: FEED EDIBLE TO CRITTER.

22100   IF(IOBJ.NE.0.AND.LIVING(IOBJ))GOTO 22120
       SPK=100
       IF(OBJ.EQ.BIRD)GOTO 2011
       IF(.NOT.LIVING(OBJ))GOTO 2070

C  SEE IF THERE IS ANYTHING EDIBLE AROUND HERE.
       KK=0
       K=0
       DO 22110 I=1,MAXOBJ
       IF(.NOT.HERE(I).OR..NOT.EDIBLE(I))GOTO 22110
       K=K+1
       KK=I
22110   CONTINUE
       IOBJ=OBJ
       OBJ=KK
       IF(K.EQ.1.OR.DEAD(IOBJ))GOTO 22120
       CALL A5TOA1(OTXT(OBJX,1),OTXT(OBJX,2),'?',TK,K)
       PRINT 22112,(TK(I),I=1,K)
22112   FORMAT (/' What do you want to feed the ',20A1)
       OBJS(1)=0
       OBJX=0
       GOTO 2600

C  FEED OBJ TO IOBJ.
22120   IF(IOBJ.NE.SNAKE.AND.IOBJ.NE.DRAGON.AND.IOBJ.NE.TROLL)GOTO 22130
       SPK=102
       IF(IOBJ.EQ.DRAGON.AND.PROP(DRAGON).NE.0)SPK=NOWAY(0)
       IF(IOBJ.EQ.TROLL)SPK=182
       IF(IOBJ.NE.SNAKE.OR.CLOSED.OR.OBJ.NE.BIRD)GOTO 2011
       SPK=101
       CALL DSTROY(BIRD)
       PROP(BIRD)=0
       TALLY2=TALLY2+1
       GOTO 2011

C  FEED DWARF?
22130   IF(IOBJ.NE.DWARF)GOTO 22140
       SPK=103
       DFLAG=DFLAG+1
       GOTO 2011
