# ---[ JACL LIBRARY FILE Release 12, Copyright (C) Stuart Allen 1990-2001 ]---

filter the
filter a

variable INDEX
variable OB1
variable OB2
variable OB3
variable OB4
variable OXYGEN_LEFT
variable WAY
variable DIRECTION
variable DESTINATION

constant TACL		1
constant JACL		2

constant NORTH          0
constant SOUTH          1
constant EAST           2
constant WEST           3
constant NORTHEAST      4
constant NORTHWEST      5
constant SOUTHEAST      6
constant SOUTHWEST      7
constant UP             8
constant DOWN           9
constant IN             10
constant OUT            11

synonym onto            on
synonym into            in
synonym inside          in
synonym using           with
synonym me              myself
synonym gentleman       man
synonym 1               one
synonym 2               two
synonym 3               three
synonym 4               four
synonym 5               five
synonym 6               six
synonym 7               seven
synonym 8               eight
synonym 9               nine
synonym 10              ten
synonym taek            take
synonym all             everything
synonym speak           talk
synonym depress         press
synonym w               west
synonym e               east
synonym s               south
synonym se              southeast
synonym sw              southwest
synonym n               north
synonym ne              northeast
synonym nw              northwest
synonym u               up
synonym d               down
synonym l               look
synonym beneath         under

{+push_object
if player(parent) = noun4(parent)
   if here hasnt DARK
      write <p> noun4{The}
      execute +to_direction
   else
      write "<p>You hear the footsteps nearby.^"
endif
set noun4(parent) = DESTINATION
if player(parent) = noun4(parent)
   if here hasnt DARK
      write <p> noun4{The}
      execute +from_direction
   else
      write "<p>You hear the footsteps nearby.^"
   endif
endif
}

{+to_direction
if DIRECTION = NORTH
   write " heads off to the north.</p>^"
   break
endif
if DIRECTION = NORTHEAST
   write " heads off to the northeast.</p>^"
   break
endif
if DIRECTION = EAST
   write " heads off to the east.</p>^"
   break
endif
if DIRECTION = SOUTHEAST
   write " heads off to the southeast.</p>^"
   break
endif
if DIRECTION = SOUTH
   write " heads off to the south.</p>^"
   break
endif
if DIRECTION = SOUTHWEST
   write " heads off to the southwest.</p>^"
   break
endif
if DIRECTION = WEST
   write " heads off to the west.</p>^"
   break
endif
if DIRECTION = NORTHWEST
   write " heads off to the northwest.</p>^"
   break
endif
if DIRECTION = UP
   write " heads up from here.</p>^"
   break
endif
if DIRECTION = DOWN
   write " heads down from here.</p>^"
}

{+from_direction
if DIRECTION = NORTH
   write " enters from the south.</p>^"
   break
endif
if DIRECTION = NORTHEAST
   write " enters from the southwest.</p>^"
   break
endif
if DIRECTION = EAST
   write " enters from the west.</p>^"
   break
endif
if DIRECTION = SOUTHEAST
   write " enters from the northwest.</p>^"
   break
endif
if DIRECTION = SOUTH
   write " enters from the north.</p>^"
   break
endif
if DIRECTION = SOUTHWEST
   write " enters from the northeast.</p>^"
   break
endif
if DIRECTION = WEST
   write " enters from the east.</p>^"
   break
endif
if DIRECTION = NORTHWEST
   write " enters from the southeast.</p>^"
   break
endif
if DIRECTION = UP
   write " enters from below.</p>^"
   break
endif
if DIRECTION = DOWN
   write "enters from above.</p>^"
}

{+exits
set INDEX = false
write "<p>YOU CAN GO: "
if here(north) != nowhere
   hyperlink NORTH "go+north"
   write " "
   set INDEX = true
endif
if here(south) != nowhere
   hyperlink SOUTH "go+south"
   write " "
   set INDEX = true
endif
if here(east) != nowhere
   hyperlink EAST "go+east"
   write " "
   set INDEX = true
endif
if here(west) != nowhere
   hyperlink WEST "go+west"
   write " "
   set INDEX = true
endif
if here(up) != nowhere
   hyperlink UP "go+up"
   write " "
   set INDEX = true
endif
if here(down) != nowhere
   hyperlink DOWN "go+down"
   write " "
   set INDEX = true
endif
if here(in) != nowhere
   hyperlink IN "go+in"
   write " "
   set INDEX = true
endif
if here(out) != nowhere
   hyperlink OUT "go+out"
   write " "
   set INDEX = true
endif
if here(northeast) != nowhere
   hyperlink NORTHEAST "go+northeast"
   write " "
   set INDEX = true
endif
if here(northwest) != nowhere
   hyperlink NORTHWEST "go+northwest"
   write " "
   set INDEX = true
endif
if here(southeast) != nowhere
   hyperlink SOUTHEAST "go+southeast"
   write " "
   set INDEX = true
endif
if here(southwest) != nowhere
   hyperlink SOUTHWEST "go+southwest"
   set INDEX = true
endif
if INDEX = false
   write "NOWHERE!"
endif
write "</p>^"
}

{+list_here
write "<SELECT NAME=~noun~ SIZE=5>"

set INDEX = 0
loop
  if noun3 is *here
     set INDEX + 1
  endif
endloop

if INDEX = 0
  write "<OPTION>Nothing special"
else
  loop
    if noun3 is *here
       option noun3
    endif
  endloop
endif

write "</SELECT>"
}

{+list_held
write "<SELECT NAME=~noun~ SIZE=5>"

set INDEX = 0
loop
  if noun3(parent) = player
     if noun3(mass) != scenery
        set INDEX + 1
     endif
  endif
endloop

if INDEX = 0
  write "<OPTION>Nothing at all"
else
  loop
     if noun3(parent) = player
        if noun3(mass) != scenery
           option noun3
        endif
     endif
  endloop
endif
write "</SELECT>"
}

{+darkness
if here has DARKNESS
   execute "+no_light"
   break
endif
break false
}

{+reach
if noun4 has OUT_OF_REACH
  write <p> noun4{The} " " noun4{is} " out of reach.</p>^"
  set TIME = false
  break
endif
break false
}

{+worn
if noun4 has WORN
   write "<p>You must first remove " noun4{the} .</p>^
   set TIME = false
   break
endif
break false
}

location limbo : limbo

object north_wall: north north wall
 short          the "north wall"

object south_wall: south southern wall
 short          the "south wall"

object east_wall: east eastern wall
 short          the "east wall"

object west_wall: west western wall
 short          the "west wall"

object ground: ground floor
 has            SURFACE
 short          the "ground"

grammar shake *held   >shake
grammar wave *held    >shake

{+shake
write "<p>Consider it done.</p>^"
}

grammar say xyzzy >xyzzy
grammar xyzzy     >xyzzy

{+xyzzy
write "<p>Suddenly a magical white glove appears floating in the air before "
write "you, slaps you several times across the face, then disappears.</p>^"
}

grammar verbose >verbose

{+verbose
if DISPLAY_MODE = 1
  write "<p>Display mode already set to verbose.</p>^"
  break
endif
write "<p>Display mode set to verbose.</p>^"
set DISPLAY_MODE = 1
look
}

grammar brief >brief

{+brief
if DISPLAY_MODE = 0
  write "<p>Display mode already set to brief.</p>^"
  break
endif
write "<p>Display mode set to brief.</p>^"
set DISPLAY_MODE = 0
}

grammar help *present           >help_other

{+help_other
write "<p>How did you intend to help " noun1{the} ?</p>^
}

grammar hint *present >hint

{+hint
write "<p>There is no specific hint available for " noun1{the} .</p>^
set TIME = false
}

grammar hint          >first_hint
grammar hint one      >first_hint

{+first_hint
write "<p>There is no hint available specific to this location.</p>^"
set TIME = false
}

grammar hint two      >second_hint

{+second_hint
write "<p>There is no second hint available for this location.</p>^"
set TIME = false
}

grammar hint three    >third_hint

{+third_hint
write "<p>There is no third hint available for this location.</p>^"
set TIME = false
}

grammar hint four     >fourth_hint

{+fourth_hint
write "<p>There is a maximum of three hints for each location.</p>^"
set TIME = false
}

grammar help games >help_games

{+help_games
write "<p>`GAMES' REFERS TO MODELS, SIMULATIONS AND GAMES WHICH HAVE TACTICAL "
write "AND STRATEGIC APPLICATIONS.</p>^"
}

grammar hug *present     >hug
grammar comfort *present >hug
grammar cuddle *present  >hug
grammar console *present >hug

{+hug
break +darkness
break +reach noun1
override
if noun1 hasnt ANIMATE
  write "<p>Odd.</p>^"
  break
endif
write "<p>I'm sure " noun1{the} " feel" noun1{s} " a whole lot better now.</p>^"
}

grammar kiss *present >kiss

{+kiss
break +darkness
break +reach noun1
override
write "<p>Hmmmmmm...</p>^"
}

grammar pick *present with *held >pick_with

{+pick_with
break +darkness
break +reach noun1
override
write "<p>You can't pick " noun1{the} " with " noun2{the} .</p>^
}

grammar rub *present    >rub
grammar pat *present    >rub

{+rub
break +darkness 
break +reach noun1
override
write "<p>I'm sure " noun1{the} " " noun1{is} " feeling a lot better now.</p>^"
}

grammar rub *held on *present         >rub_on

{+rub_on
break +darkness
override
proxy "rub " noun2 " with " noun1
}

grammar rub *present with *held    >rub_with

{+rub_with
break +darkness
break +reach noun1
override
write "<p>They both just get a little warmer.</p>^"
}

grammar lick *present  >lick
grammar taste *present >lick

{+lick
break +darkness
break +reach noun1
override
write "<p>Yeuucck!</p>^"
}

grammar pull *present >pull
grammar tug *present  >pull

{+pull
break +darkness
break +reach noun1
override
write "<p>You can't pull " noun1{the} .</p>^
}

grammar cut *present  >cut
grammar chop *present >cut
grammar stab *present >cut

{+cut
write "<p>What did you want to cut " noun1{the} " with?</p>^"
set TIME = false
}

grammar cut *present with *held       >cut_with
grammar chop *present with *held      >cut_with
grammar stab *present with *held      >cut_with

{+cut_with
break +darkness
break +reach noun1
override
if noun1 has ANIMATE
  proxy "attack " noun1 " with " noun2
  break
endif
write "<p>Vandal!</p>^"
set TIME = false
}

grammar break *present          >break
grammar kick *present           >break
grammar smash *present          >break
grammar crush *present          >break
grammar destroy *present        >break
grammar wreck *present          >break
grammar crack *present          >break
grammar tear *present           >break
grammar tear up *present        >break
grammar tear *present up        >break

{+break
break +darkness
break +reach noun1
override
write "<p>Don't be so destructive.</p>^"
set TIME = false
}

grammar clean *present        >clean
grammar wash *present         >clean
grammar wipe *present         >clean
grammar scrub *present        >clean
grammar polish *present       >clean

{+clean
break +darkness
break +reach noun1
override
if noun1 has LIQUID
  write "<p>How do you clean a liquid?</p>^"
  set TIME = false
  break
endif
override
write "<p>That's very thoughtful of you.</p>^"
}

grammar clean *present with *held     >clean_with
grammar wipe *present with *held      >clean_with
grammar scrub *present with *held     >clean_with
grammar brush *present with *held     >clean_with

{+clean_with
break +darkness
break +reach noun1
override
if noun1 has LIQUID
  write "<p>How do you clean a liquid?</p>^"
  set TIME = false
  break
endif
override
write "<p>You can't clean " noun1{the} " with " noun2{the} .</p>^
set TIME = false
}

grammar yell at *present      >yell_at
grammar scream at *present    >yell_at

{+yell_at
write "<p>Oooo, scary...</p>^"
}

grammar pay *present       >pay

{+pay
write "<p>You can't pay " noun1{the} .</p>^
}

grammar order *carried        >order
grammar buy *carried          >order
grammar order *anywhere       >order
grammar buy *anywhere         >order

{+order
write "<p>Your order appears to have fallen on deaf ears.</p>^"
}

grammar knock on *present     >knock_on
grammar tap on *present       >knock_on
grammar tap *present          >knock_on

{+knock_on
break +darkness
break +reach noun1
override
if noun1 has LIQUID
  write "<p>A wet hand is your only reward.</p>^"
  break
endif
write "<p>Devastatingly productive...</p>^"
}

grammar play *present >play

{+play
break +darkness
override
write "<p>You can't play " noun1{the} .</p>^
set TIME = false
}

grammar extract *here with *held      >take_with
grammar get *here with *held          >take_with
grammar take *here with *held         >take_with
grammar remove *present with *held    >take_with
grammar empty *present with *held     >take_with

{+take_with
proxy "fill " noun2 " with " noun1
}

grammar fill *held from *present      >fill_from

{+fill_from
break +darkness
execute +liquid noun2
if INDEX = false
  write <p> noun2{The} " " noun2{doesnt} "contain a liquid to fill " noun1{the}
  write " with.</p>^"
  set TIME = false
  break
endif
proxy "fill " noun1 " with " noun3
}

grammar fill *held with *present >fill_with

{+fill_with
break +darkness
break +reach noun2
if noun1 hasnt CONTAINER
  write <p> noun1{The} " " noun1{isnt} " a container and therefore can't be "
  write "filled.</p>^"
  break
endif
if noun1 has CLOSED
  write "<p>You can't fill " noun1{the} " while "
  if noun1 has PLURAL
    write "they are"
  else
    write "it is"
  endif
  write " closed.</p>^"
  set TIME = false
  break
endif
if noun2 hasnt LIQUID
  write "<p>You can only fill " noun1{the} " with a liquid.</p>^"
  break
endif
execute +liquidwrite noun1
if INDEX = true
  write <p> noun1{The} " already contains " noun3{the} ". If you were to also "
  write "add " noun2{the} " they would mix together.</p>^"
  set TIME = false
  break
endif
if noun1(quantity) < noun2(mass)
  write <p> noun1{The} " " noun1{isnt} " large enough to hold " 
  write noun2{the} .</p>^
  set TIME = false
  break
endif
override
write "<p>You fill " noun1{the} " with " noun2{the} .</p>^
move noun2 to noun1
}

{+liquid?
set INDEX = false
loop
  if noun3(parent) = noun4
    if noun3 has LIQUID
      set INDEX = true
      break
    endif
  endif
endloop
}

grammar fill *present >fill

{+fill
break +darkness
override
write "<p>What did you want to fill " noun1{the} " with?</p>^"
set TIME = false
}

grammar stand         >stand
grammar stand up      >stand
grammar get up        >stand

{+stand
if player has SITTING
  write "<p>Using your arms to push yourself up, you stand.</p>^"
  ensure player hasnt SITTING
  break
endif
write "<p>You are already standing.</p>^"
}

grammar sleep         >sleep

{+sleep
write "<p>There will be plenty of time for that later...</p>^"
set TIME = false
}

grammar lie on *present       >lie_on
grammar lie down on *present  >lie_on
grammar sleep on *present     >lie_on
grammar sleep in *present     >lie_on

{+lie_on
break +darkness
break +reach noun1
override
write <p> noun1{The} " " noun1{doesnt} " look like the ideal place to take a "
write "nap.</p>^"
}

grammar sit           >sit
grammar sit down      >sit

{+sit
set TIME = false
if player has SITTING
  write "<p>You are already sitting.</p>^"
  break
endif
if here has UNDER_WATER
  write "<p>While underwater?</p>^"
  break
endif
if here has ON_WATER
  write "<p>While in water?</p>^"
  break
endif
write "<p>You plonk yourself down for a moment's rest.</p>^"
ensure player has SITTING
}

grammar sit on *here  >sit_on
grammar sit in *here  >sit_on

{+sit_on
break +darkness
break +reach noun1
override
write <p> noun1{The} " " noun1{doesnt} " look very comfortable.</p>^"
}

grammar drop everything          >drop_all
grammar put everything down      >drop_all
grammar put down everything      >drop_all

{+drop_all
set TIME = false
if here has MID_WATER : here has ON_WATER
  write "<p>Dropping everything you own into the water probably isn't such "
  write "a great idea.</p>^"
  break
endif
set INDEX = 0
loop
if noun3(parent) = player
  if noun3 hasnt WORN
    if noun3(mass) < heavy
      if TIME = true
	set TOTAL_MOVES + 1
	execute +eachturn
      endif
      write "<p>You drop " noun3{the} .</p>^
      move noun3 to here
      set TIME = true
      set INDEX + 1
    endif
  else
    write "<p>You must first remove " noun3{the} .</p>^
    set TIME = false
    set INDEX + 1
  endif
endif
endloop
if INDEX = 0
  write "<p>You are not carrying anything.</p>^"
  break
}

grammar drop *held            >drop
grammar throw *held           >drop
grammar put *held down        >drop
grammar put down *held        >drop

{+drop
if noun1 has WEARABLE
  if noun1 has WORN
    write "<p>You must first remove " noun1{the} .</p>^
    set TIME = false
    break
  endif
endif
if noun1(mass) >= heavy : noun1 has LOCATION
  execute +move_scenery
  break
endif
override
if here has MID_WATER : here has ON_WATER
  write "<p>You drop " noun1{the} " which rapidly sink" noun1{s} " out of "
  write "view.</p>^"
  move noun1 to limbo
  break
endif
write "<p>You drop " noun1{the} .^
move noun1 to here
}

grammar remove everything from *present       >take_all_from
grammar take everything from *present         >take_all_from
grammar get everything from *present          >take_all_from
grammar take everything out of *present       >take_all_from
grammar get everything out of *present        >take_all_from
grammar empty *present                        >take_all_from
grammar take everything on *present           >take_all_from
grammar get everything on *present            >take_all_from
grammar take everything from on *present      >take_all_from
grammar get everything from on *present       >take_all_from
grammar take everything in *present           >take_all_from
grammar get everything in *present            >take_all_from
grammar take everything from in *present      >take_all_from
grammar get everything from in *present       >take_all_from

{+take_all_from
set TIME = false
break +darkness
break +reach noun1
override
if noun1 has ANIMATE
   write "<p>You will have to ask " noun1{the} " for anything that you
   write "want.</p>^"
   break
endif
if noun1 hasnt CONTAINER
   if noun1 hasnt SURFACE
      write "<p>There isn't anything in " noun1{the} .</p>^ 
      break
   endif
endif
if noun1 has CLOSED
   write "<p>It's going to be a bit hard to take anything from " noun1{the}
   write " while " noun1{the} " " noun1{is} " closed."</p>^
   break
endif
set INDEX = 0
loop
   if noun3(parent) = noun1
      if noun3(mass) < heavy
         if noun3 hasnt LIQUID
            if noun3(mass) <= player(quantity)
	       if TIME = true
	          set TOTAL_MOVES + 1
	          execute +eachturn
	       endif
	       execute +take_routine
	       set INDEX + 1
            else
	       write "<p>You are carrying too much to take " noun3{the} .</p>^
	       set INDEX + 1
            endif
         else
            write "<p>" noun3{The} " run" noun3{s} " through your fingers.</p>^"
            set INDEX + 1
         endif
      endif
   endif
endloop
if INDEX = 0
   write "<p>I don't see what you are referring to.</p>^"
}

grammar take everything       >take_all
grammar get everything        >take_all

{+take_all
break +darkness
set TIME = false
set INDEX = 0
loop
if noun3(parent) = here
  if noun3(mass) < heavy
    if noun3 hasnt LIQUID
      if TIME = true
	set TOTAL_MOVES + 1
	execute +eachturn
      endif
      execute +take_routine
      set INDEX + 1
    else
      write "<p>" noun3{The} " run" noun3{s} " through your fingers.</p>^"
      set INDEX + 1
    endif
  endif
endif
endloop
if INDEX = 0
  write "<p>I don't see what you are referring to.</p>^"
}

{+take_routine
break +reach noun3
if noun3(mass) > player(quantity)
   write "<p>You are carrying too much to take " noun3{the} .</p>^
   set TIME = false
   break
endif
break noun3.take
override
write "<p>You take " noun3{the} .</p>^
set TIME = true
move noun3 to player
ensure noun3 has TOUCHED
}

grammar take *here    >take
grammar get *here     >take

{+take
break +darkness
break +reach noun1
if player has SITTING
  write "<p>You will have to stand up first.</p>^"
  set TIME = false
  break
endif
if noun1(mass) >= heavy : noun1 has LOCATION
  execute +move_scenery
  break
endif
if noun1(mass) > player(quantity)
  write "<p>You are carrying too much to take " noun1{the} .</p>^
  set TIME = false
  break
endif
if noun1 has LIQUID
  write <p> noun1{The} " run" noun1{s} " through your fingers.</p>^"
  break
endif
override
write "<p>You take " noun1{the} .</p>^
move noun1 to player
ensure noun1 has TOUCHED
}

{+move_scenery
set TIME = false
if noun1 has LOCATION
   write "<p>That would be an impressive feat of strength.</p>^"
   break
endif
set noun3 = noun1(parent)
set INDEX = noun3
if noun3 has LOCATION
  write <p> noun1{The} " " noun1{isnt} " something that you can pick up.</p>^"
  break
endif
write <p> noun1{The} " " noun1{is} " attached to " noun3{the} .</p>^
}

grammar insert *held on *present      >insert_on
grammar put *held on *present         >insert_on

{+insert_on
break +darkness
break +reach noun2
if noun2 = noun1
  write "<p>Put " noun1{the} " on "
  if noun1 has PLURAL
    write "themselves?"
  else
    write "itself?"
  endif
  write " I don't think so.</p>^"
  set TIME = false
  break
endif
if noun2(parent) = noun1
  write "<p>I'm afraid that's just not possible.</p>^"
  set TIME = false
  break
endif
if noun1(mass) >= heavy : noun1 has LOCATION
  execute +move_scenery
  break
endif
break +worn noun1
if noun2 hasnt SURFACE
  write "<p>There isn't a flat surface on " noun2{the} .</p>^
  set TIME = false
  break
endif
if noun2(quantity) < noun1(mass)
  write "<p>There is not enough room on " noun2{the} " for " noun1{the} .</p>^
  set TIME = false
  break
endif
override
write "<p>You put " noun1{the} " on " noun2{the} .</p>^
move noun1 to noun2
}

grammar insert *held in *present      >insert_in
grammar put *held in *present         >insert_in

{+insert_in
break +darkness
break +reach noun2
if noun1(mass) >= heavy : noun1 has LOCATION
  execute +move_scenery
  break
endif
if noun2 = noun1
  write "<p>Put " noun1{the} " in "
  if noun1 has PLURAL
    write "themselves?"
  else
    write "itself?"
  endif
  write "I don't think so.</p>^"
  set TIME = false
  break
endif
if noun2(parent) = noun1
  write "<p>I'm afraid that's just not possible.</p>^"
  set TIME = false
  break
endif
break +worn noun1
if noun2 = player
  write "<p>I would ask how you intend to do that, but something tells me I "
  write "don't want to know.</p>^"
  set TIME = false
  break
endif
if noun2 hasnt CONTAINER
  write <p> noun2{The} " " noun2{isnt} " designed to receive " noun1{the} .</p>^
  set TIME = false
  break
endif
if noun2 has CLOSED
  write <p> noun2{The} " " noun2{is} " closed.</p>^"
  set TIME = false
  break
endif
if noun2(quantity) < noun1(mass)
  write "<p>There is not enough room in " noun2{the} " for " noun1{the} .</p>^
  set TIME = false
  break
endif
override
write "<p>You put " noun1{the} " in " noun2{the} .</p>^
move noun1 to noun2
}

grammar insert everything in *present >insert_all_in
grammar put everything in *present    >insert_all_in

{+insert_all_in
break +darkness
if noun1 hasnt CONTAINER
  write <p> noun1{The} " " noun1{isnt} " designed to hold things.</p>^"
  set TIME = false
  break
endif
break +reach noun1
if noun1 has CLOSED
  write <p> noun1{The} " " noun1{is} " closed.</p>^"
  set TIME = false
  break
endif
set INDEX = 0
loop
  if noun3(parent) <> player : noun3(mass) >= heavy : noun3 = noun1
    endloop
    execute +encumbered
    break
  endif
  if noun1 has WORN
    write "<p>You must first remove " noun3{the} .</p>^
    set INDEX + 1
    endloop
    break
  endif
  set OB1 = noun1
  set OB2 = noun3
  proxy "insert" noun3 " in " noun1
  set noun1 = OB1
  set noun3 = OB2
  set INDEX + 1
endloop
}

grammar insert everything on *present >insert_all_on
grammar put everything on *present    >insert_all_on

{+insert_all_on
break +darkness
if noun1 hasnt SURFACE
   write "<p>There is no flat surface on " noun1{the} " to put things.</p>^"
   set TIME = false
   break
endif
break +reach noun1
set INDEX = 0
loop
  if noun3(parent) <> player : noun3(mass) >= heavy : noun3 = noun1
     endloop
     execute +encumbered
     break
  endif
  if noun1 has WORN
     write "<p>You must first remove " noun3{the} .</p>^
     set INDEX + 1
     endloop
     break
  endif
  set OB1 = noun1
  set OB2 = noun3
  proxy "insert" noun3 " on " noun1
  set noun1 = OB1
  set noun3 = OB2
  set INDEX + 1
endloop
}

{+encumbered
if INDEX = 0
   write "<p>You are not carrying anything.</p>^"
}

grammar ask *present for *carried             >ask_for
grammar tell *present to give me *carried     >ask_for

{+ask_for
if here has UNDER_WATER
  write "<p>Talking under water isn't very easy.</p>^"
  set TIME = false
  break
endif
if noun1 hasnt ANIMATE
  write <p> noun1{The} " seem" noun1{s} " to be ignoring your request.</p>^"
  break
endif
if noun1 has DEAD
  write <p> noun1{The} " " noun1{is} " a bit too dead to respond.</p>^"
  set TIME = false
  break
endif
if noun1 = player
  write "<p>I think it might be time to take a break and get a cup of tea.</p>^"
  set TIME = false
  break
endif
if noun1 !grandof noun2
  write <p> noun1{The} " " noun1{doesnt} " seem to have " noun2{the} .</p>^
  set TIME = false
  break
endif
if noun2(mass) > player(quantity)
  write "<p>With your current load you would be unable to accept"
  write noun2{the} .</p>^
  set TIME = false
  break
endif
override
if noun1 has POSSESSIVE
   write <p> noun1{The} " refuses to give you " noun2{the} .</p>^
   break
endif
move noun2 to player
if noun2 has WORN
  write <p> noun1{The} " remove" noun1{s} " " noun2{the} " then hand" noun1{s}
  if noun2 has PLURAL
    write " them"
  else
    write " it"
  endif
  write " to you.</p>^" 
  ensure noun2 hasnt WORN
  break
endif
write <p> noun1{The} " hands you " noun2{the} .</p>^
}

grammar tell *present about *carried          >tell_about
grammar talk to *present about *carried       >tell_about
grammar tell *present about *anywhere         >tell_about
grammar talk to *present about *anywhere      >tell_about

{+tell_about
if here has UNDER_WATER
  write "<p>Talking under water isn't very easy.</p>^"
  set TIME = false
  break
endif
if noun1 hasnt ANIMATE
  write "<p>I don't think talking to " noun1{the} " is going to help somehow.</p>^"
  set TIME = false
  break
endif
if noun1 has DEAD
  write <p> noun1{The} " " noun1{is} " a bit too dead to even pretend to be "
  write "interested.</p>^"
  set TIME = false
  break
endif
if noun1 = noun2
   write "<p>I think " noun1{the} " already know" noun1{s} " more than you do.</p>^"
   set TIME = false
   break
endif
if noun1 = player
   write "<p>It's the first sign of madness you know...</p>^"
   break
endif
override
write <p> noun1{The} " seem" noun1{s} " fascinated by your story about "
write noun2{the} .</p>^
}

grammar ask *present about *carried   >ask_about
grammar ask *present about *anywhere  >ask_about

{+ask_about
if here has UNDER_WATER
  write "<p>Talking under water isn't very easy.</p>^"
  set TIME = false
  break
endif
if noun1 hasnt ANIMATE
  write "<p>I don't think talking to " noun1{the} " is going to help somehow.</p>^"
  set TIME = false
  break
endif
if noun1 has DEAD
  write <p> noun1{The} " " noun1{is} " a bit too dead to tell you anything 
  write "useful.</p>^"
  set TIME = false
  break
endif
if noun1 = player
  write "<p>It's the first sign of madness you know...</p>^"
  break
endif
override
if noun2 = noun1
  write noun1(The}
  if noun1 has PLURAL
    write " are too shy to say much.</p>^"
  else
    write " is too shy to say much.</p>^"
  endif
  break
endif
write <p> noun1{The} " reluctantly admit" noun1{s} " to knowing little about "
write noun2{the} .</p>^
}

grammar offer *held to *present     >give_to
grammar give *held to *present      >give_to

{+give_to
if noun2 hasnt ANIMATE
  write "<p>You can't give " noun1{the} " to " noun2 .</p>^
  set TIME = false
  break
endif
if noun2 = player
  write "<p>I think it might be time to take a break and get a cup of tea.</p>^"
  break
endif
break +reach noun2
if noun1(mass) >= heavy : noun1 has LOCATION
  execute +move_scenery
  break
endif
break +worn noun1
override
move noun1 to noun2
write "<p>You give " noun1{the} " to " noun2{the} .</p>^
}

grammar move *present >move
grammar push *present >move

{+move
break +darkness
break +reach noun1
if player has SITTING
   write "<p>You will have to stand up first.</p>^"
   set TIME = false
   break
endif
if noun1(mass) >= heavy : noun1 has LOCATION
  execute +move_scenery
  break
endif
if noun1 has LIQUID
  write <p> noun1{The} " run" noun1{s} " through your fingers.</p>^"
  break
endif
break +worn noun1
if noun1(parent) = player
   override
   write "<p>You juggle " noun1{the} " in your hands.</p>^"
   break
endif
override
write "<p>You move " noun1{the} " a short distance to one side.</p>^"
ensure noun1 has TOUCHED
}

grammar read *present >read

{+read
break +darkness
write "<p>There is nothing on " noun1{the} " to read.</p>^"
}

grammar look down >look_down

{+look_down
break +darkness
if here has TIGHT_ROPE : here has MID_AIR
  write "<p>You see the ground far below.</p>^"
  break
endif
if here has ON_WATER
  write "<p>You can't see beyond the surface of the water.</p>^"
  break
endif
write "<p>You take a moment to admire your investigating feet.</p>^"
}

grammar look up *anywhere in *present         >look_up_in
grammar look for *anywhere in *present        >look_up_in

{+look_up_in
break +darkness
write "<p>You don't find any reference to " noun1{the} " in " noun2{the} .</p>^
}

grammar consult *present about *anywhere      >consult
grammar consult *present re *anywhere         >consult
grammar consult *present on *anywhere         >consult

{+consult
break +darkness
proxy "look up " noun2 " in " noun1
}

grammar feel *present  >feel
grammar touch *present >feel

{+feel
break +reach noun1
if noun1 has ANIMATE
  write "<p>I'm not so sure that would be polite.</p>^"
  break
endif
write "<p>Feels just like " noun1{list} .</p>^
}

grammar smell >smell
grammar sniff >smell

{+smell
write "<p>Nothing strikes you as out of the ordinary.</p>^"
}

grammar smell *present        >sniff
grammar sniff *present        >sniff

{+sniff
if noun1 has ANIMATE
  write "<p>I'm not so sure that would be polite.</p>^"
  break
endif
write "<p>Smells an awful lot like " noun1{list} .</p>^
}

grammar taste *present >taste
grammar lick *present  >taste

{+taste
break +reach noun1
if noun1 has ANIMATE
  write "<p>You are one sick puppy.</p>^"
  break
endif
write "<p>Tastes just like you would expect " noun1{list} " to taste.</p>^"
}

grammar look in *present      >look_in

{+look_in
break +darkness
if noun1 hasnt CONTAINER
  write "<p>There is nothing in " noun1{the} .</p>^
  break
endif
if noun1 has CLOSED
  write <p> noun1{The} " " noun1{is} " currently closed.</p>^"
  break
endif
set INDEX = 0
loop
  if noun3(parent) = noun1
     set INDEX + 1
  endif
endloop
if INDEX = 0
   write "<p>There is nothing in " noun1{the} .</p>^
   break
endif
execute +details
write "^"
}

grammar look *present         >examine
grammar look at *present      >examine
grammar look on *present      >examine
grammar examine *present      >examine
grammar x *present            >examine
grammar search *present       >examine
grammar watch *present        >examine

{+examine
break +darkness
override
if noun1 hasnt CLOSABLE
  if noun1 hasnt CONTAINER
    if noun1 hasnt SURFACE
      write "<p>There is nothing special about " noun1{the} .</p>^
      break
endall
if noun1 has CLOSABLE
  execute +details
  write "^"
  break
endif
set INDEX = 0
loop
  if noun3(parent) = noun1
    set INDEX + 1
  endif
endloop
if INDEX = 0
  write "<p>There is nothing special about " noun1{the} .</p>^
  break
endif
execute +details
write "^"
}

{+details
if noun1 has CLOSABLE
  if noun1 hasnt CLOSED
    write <p> noun1{The} " " noun1{is} " open"
  else
    write <p> noun1{The} " " noun1{is} " closed.</p>"
    break
  endif
endif
if noun1 has CONTAINER : noun1 has SURFACE
  execute +contents
  break
endif
write .</p>
}

{+contents
set INDEX = 0
loop
  if noun3(parent) = noun1
    if noun3(mass) != scenery
      set INDEX + 1
    endif
  endif
endloop
if INDEX = 0
  if noun1 has CLOSABLE
    if noun1 has CONTAINER
      write .
      break
endall
if INDEX = 0 : noun1 has CONCEALING
  break
endif
if noun1 has ANIMATE
  write <p> noun1{The} " " noun1{is} " carrying "
endif
if noun1 has SURFACE
  write "<p>On " noun1{the} " is "
endif
if noun1 has CONTAINER
  if noun1 has CLOSABLE
    write " and contains "
  else
    write <p> noun1{The} " contains "
  endif
endif
loop
  if noun3(parent) = noun1
    if noun3(mass) != scenery
      set INDEX - 1
      write noun3{list}
      execute +object_info
      execute +list_structure
      if INDEX = 0
	write .</p>
	break
      endif
    endif
  endif
endloop
}

{+first_child
set INDEX = false
loop
   if noun3(parent) = noun4 
      set INDEX = true
      break
   endall
endloop
}

{+children?
set INDEX = false
loop
  if noun3(parent) = noun4
    set INDEX = true
    break
  endif
endloop
}

grammar inv   >list_inventory
grammar list  >list_inventory

{+list_inventory
set INDEX = 0
loop
  if noun3(parent) = player
    if noun3(mass) != scenery
      set INDEX + 1
    endif
  endif
endloop
if INDEX = 0
  write "<p>You are empty-handed.</p>^"
  break
endif
write "<p>You are carrying:<BR>^"
loop
  if noun3(parent) = player
    if noun3(mass) != scenery
      write "  " noun3{list}
      execute +object_info
      write "<BR>^"
      if noun3 has CONTAINER
	if noun3 hasnt CLOSED
	  execute +object_children noun3
	endif
      endif
    endif
  endif
endloop
write "</p>"
}

{+object_children
loop
  if noun3(parent) = noun4
    if interpreter = TACL
       write "      " noun3{list}
    else
       write " - " noun3{list}
    endif
    execute +object_info
    write "<BR>^"
  endif
endloop
set noun3 = noun4
}

grammar inventory     >inventory
grammar i             >inventory

{+inventory
set INDEX = 0
loop
  if noun3(parent) = player
    if noun3(mass) != scenery
      set INDEX + 1
    endif
  endif
endloop
if INDEX = 0
   write "<p>You are empty handed.</p>^"
   break
endif
write "<p>You are carrying "
loop
  if noun3(parent) = player
    if noun3(mass) != scenery
      set INDEX - 1
      write noun3{list}
      execute +object_info
      execute +list_structure
      if INDEX = 0
	write .</p>^
	break
      endif
    endif
  endif
endloop
}

{+list_structure
if INDEX > 1
  write ", "
endif
if INDEX = 1
  write " and "
}

{+object_info
if noun3 has WORN
  write " (being worn)"
endif
if noun3 has LUMINOUS
  write " (providing light)"
endif
if noun3 has ON
  write " (on)"
endif
if noun3 has CLOSABLE
  if noun3 hasnt CLOSED
    write " (open)"
}

grammar sorry >sorry

{+sorry
write "<p>That's quite all right.</p>^"
}

grammar thanks        >thankyou
grammar thank you     >thankyou

{+thankyou
write "<p>You're welcome.</p>^"
}

grammar score >score
grammar points >score

{+score
set TIME = false
if TOTAL_MOVES = 1
  write "<p>Your score is " SCORE "% in 1 move.</p>^"
else
  write "<p>Your score is " SCORE "% in " TOTAL_MOVES " moves.</p>^"
}

grammar open *present >open

{+open
break +darkness
break +reach noun1
if noun1 has LOCKED
  write <p> noun1{The} " " noun1{is} " locked.</p>^"
  set TIME = false
  break
endif
if noun1 hasnt CLOSABLE
  write "<p>You can't open " noun1{the} .</p>^
  set TIME = false
  break
endif
if noun1 hasnt CLOSED
  write <p> noun1{The} " " noun1{is} " already open.</p>^"
  set TIME = false
  break
endif
override
ensure noun1 hasnt CLOSED
if noun1 has CONTAINER
  execute +revealing
  break
endif
write "<p>You open " noun1{the} .</p>^
}

{+revealing
set INDEX = 0
loop
  if noun3(parent) = noun1
    set INDEX + 1
  endif
endloop
write "<p>You open " noun1{the}
if INDEX = 0
   write ", which" noun1{is} " empty.</p>^"
   break
endif
write " revealing "
loop
  if noun3(parent) = noun1
    set INDEX - 1
    write noun3{list}
    execute +object_info
    execute +list_structure
    if INDEX = 0
      write .</p>^
      break
    endif
  endif
endloop
}

grammar close *present        >close
grammar shut *present         >close

{+close
break +darkness
break +reach noun1
if noun1 hasnt CLOSABLE
  write "<p>You can't close " noun1{the} .</p>^
  set TIME = false
  break
endif
break +reach noun1
if noun1 has CLOSED
  write <p> noun1{The} " " noun1{is} " already closed.</p>^"
  set TIME = false
  break
endif
override
write "<p>You close " noun1{the} .</p>^
ensure noun1 has CLOSED
}

grammar lock *present >lock

{+lock
break +darkness
break +reach noun1
if noun1 has LOCKABLE
  if noun1 has LOCKED
    write <p> noun1{The} " " noun1{is} " already locked.</p>^"
    break
  endif
endif
if noun1 has CLOSABLE
  if noun1 hasnt CLOSED
    write "<p>You can't lock " noun1{the} " while "
    if noun1 has PLURAL
      write "they are"
    else
      write "it is"
    endif
    write " open.</p>^"
    set TIME = false
    break
  endif
endif
if noun1 hasnt LOCKABLE
  write "<p>You can't lock " noun1{the} .</p>^
  break
endif
override
write "<p>What did you want to lock " noun1{the} " with?</p>^"
}

grammar lock *present with *held >lock_with

{+lock_with
break +darkness
if noun1 hasnt LOCKABLE
  write "<p>You can't lock " noun1{the} .</p>^
  set TIME = false
  break
endif
break +reach noun1
if noun1 has LOCKED
  write <p> noun1{The} " " noun1{is} " already locked.</p>^"
  break
endif
if noun1 has CLOSABLE
  if noun1 hasnt CLOSED
    write "<p>You can't lock " noun1{the} " while "
    if noun1 has PLURAL
      write "they are"
    else
      write "it is"
    endif
    write " open.</p>^"
    set TIME = false
    break
endif
override
write "<p>You can't lock " noun1{the} " with " noun2{the} .</p>^
set TIME = false
}

grammar unlock *present >unlock

{+unlock
break +darkness
if noun1 hasnt LOCKABLE
  write "<p>You can't unlock " noun1{the} .</p>^
  set TIME = false
  break
endif
break +reach noun1
if noun1 hasnt LOCKED
  write <p> noun1{The} " " noun1{is} " already unlocked.</p>^"
  set TIME = false
  break
endif
override
write "<p>What did you want to unlock " noun1{the} " with?</p>^"
}

grammar unlock *present with *held    >unlock_with
grammar open *present with *held      >unlock_with

{+unlock_with
if noun1 hasnt LOCKABLE
  write "<p>You can't unlock " noun1{the} .</p>^
  set TIME = false
  break
endif
break +reach noun1
if noun1 hasnt LOCKED
  write <p> noun1{The} " " noun1{is} " already unlocked.</p>^"
  break
endif
override
write "<p>You can't unlock " noun1{the} " with " noun2{the} .</p>^
set TIME = false
}

grammar show *held to *present        >show_to

{+show_to
break +darkness
if noun1 = noun2
  write "<p>You can't show " noun1{the} " to "
  if noun1 has PLURAL
    write "themselves."
  else
      write "itself.</p>^"
  endif
  set TIME = false
  break
endif
override
write <p> noun2{The} " " noun2{doesnt} " seem overly impressed by " noun1{the} .</p>^
}

grammar untie *present        >untie
grammar free *present         >untie
grammar undo *present         >untie

{+untie
break +darkness
write <p> noun1{The} " " noun1{is} " not tied to anything.</p>^"
set TIME = false
}

grammar tie *held     >tie
grammar attach *held  >tie

{+tie
break +darkness
write "<p>What do you want to tie " noun1{the} " to?</p>^"
set TIME to false
}

grammar tie *held to *present         >tie_to
grammar fix *held to *present         >tie_to
grammar attach *held to *present      >tie_to

{+tie_to
break +darkness
break +reach noun2
override
write "<p>You can't tie " noun1{the} " to " noun2{the} .</p>^
set TIME = false
}

grammar attack *present       >attack
grammar hit *present          >attack
grammar fight *present        >attack
grammar kill *present         >attack
grammar murder *present       >attack
grammar punch *present        >attack

{+attack
break +darkness
break +reach noun1
if noun1 has ANIMATE
  if noun1 has DEAD
    write <p> noun1{The} " " noun1{is} " already dead.</p>^"
    set TIME = false
    break
  endif
endif
override
write "<p>Attacking " noun1{the} " with your hands would have little effect.</p>^"
set TIME = false
}

grammar attack *present with *held    >attack_with
grammar hit *present with *held       >attack_with
grammar fight *present with *held     >attack_with
grammar kill *present with *held      >attack_with
grammar murder *present with *held    >attack_with
grammar punch *present with *held     >attack_with
grammar stab *present with *held      >attack_with
grammar poke *present with *held      >attack_with

{+attack_with
break +darkness
break +reach noun1
if noun2 has LIQUID
  write <p> noun2{The} " run" noun2{s} " through your fingers.</p>^"
  break
endif
break +worn noun1
if noun1 has ANIMATE
  if noun1 has DEAD
    write <p> noun1{The} " " noun1{is} " already dead.</p>^"
    set TIME = false
    break
  endif
endif
override
write "<p>Attacking " noun1{the} " with " noun2{the} " would have little "
write "effect.</p>^"
set TIME = false
}

grammar wave  >wave

{+wave
write "<p>You wave your arms around a bit.</p>^"
}

grammar wave to *present      >wave_to

{+wave_to
break +darkness
if noun1 hasnt ANIMATE
  write "<p>Not surpisingly, you get no response.</p>^"
  break
endif
write <p> noun1{The} " barely raises an eye brow.</p>^"
}

grammar jump on to *here >jump_on
grammar jump on *here    >jump_on
grammar hop on *here     >jump_on
grammar stand on *here   >jump_on

{+jump_on
break +darkness
set TIME = false
if noun1 hasnt SURFACE
  write "<p>You can't jump on " noun1{the} .</p>^
  break
endif
write "<p>This would achieve little.</p>^"
}

grammar jump over *here       >jump_over

{+jump_over
break +darkness
write "<p>You can't jump over " noun1{the} .</p>^
set TIME = false
}

grammar jump             >jump

{+jump
if here has MID_AIR
  write "<p>Not likely."
  break
endif
if here has TIGHT_ROPE
  write "<p>Something tells me that might be a bit too dangerous, not to "
  write "mention totally unnecessary.</p>^"
  break
endif
if here has UNDER_WATER : here has ON_WATER
  write "<p>While underwater?</p>^"
  break
endif
if player has SITTING
  write "<p>You would have to get up first.</p>^"
  break
endif
write "<p>Consider it done.</p>^"
}

grammar yes   >yes
grammar okay  >yes
grammar yeah  >yes

{+yes
write "<p>That was a rhetorical question.</p>^"
set TIME = false
}

grammar no >no

{+no
write "<p>That was a rhetorical question.</p>^"
set TIME = false
}

grammar why   >why
grammar why?  >why

{+why
write "<p>Because.</p>^"
set TIME = false
}

grammar blow *held at *here   >blow_at
grammar blow *held to *here   >blow_at

{+blow_at
break +darkness
write "<p>You can't blow " noun1{the} " at " noun2{the} .</p>^
set TIME = false
}

grammar throw *held at *here >throw_at
grammar throw *held to *here >throw_at

{+throw_at
break +darkness
if noun2 has ANIMATE
  write "<p>I don't think " noun2{the} " would really appreciate you throwing "
  write noun1{the} " at "
  if noun2 has FEMALE
    write "her.</p>^"
  else
    write "him.</p>^"
  endif
  set TIME = false
  break
endif
break +worn noun1
if noun2(parent) hasnt LOCATION
  write "<p>You can't throw " noun1{the} " at " noun2{the} " while "
  if noun2 has PLURAL
    write "they are"
  else
    write "it is"
  write " in something else.</p>^"
  set TIME = false
  break
endif
if noun1(mass) >= heavy : noun1 has LOCATION
  execute +move_scenery
  break
endif
override
if noun1(mass) => 20
  write <p> noun1{The}
  if noun1 has PLURAL
    write " are "
  else
    write " is "
  endif
  write "a bit too heavy to go throwing around.</p>^"
  set TIME = false
  break
endif
if here has UNDER_WATER
  write "<p>Throwing things underwater is never as easy as you might think.</p>^"
  set TIME = false
  break
endif
if here has ON_WATER
  write "<p>You throw " noun1{the} " at " noun2{the} " which "
  if noun1 has PLURAL
    write "they bounce"
  else
    write "it bounces"
  endif
  write " off, landing in the water where "
  if noun1 has PLURAL
    write "they"
  else
    write "it"
  endif
  write " rapidly sink" noun1{s} ", disappearing from sight.</p>^"
  move noun1 to limbo
  break
endif
write <p> noun1{The} " bounce" noun1{s} " off " noun2{the} " and land" noun1{s}
write " on the ground.</p>^"
move noun1 to here
}

grammar remove *present from *present         >remove_from
grammar take *present from *present           >remove_from
grammar get *present from *present            >remove_from
grammar take *present out of *present         >remove_from
grammar get *present out of *present          >remove_from
grammar take *present on *present             >remove_from
grammar get *present on *present              >remove_from

{+remove_from
break +darkness
if noun1(parent) <> noun2
  write <p> noun1{The} " " noun1{is} " not in " noun2{the} .</p>^
  set TIME = false
  break
endif
proxy "take" noun1
}

grammar remove *present       >remove
grammar take off *present     >remove
grammar doff *present         >remove

{+remove
if noun1 hasnt WORN
  if noun1(parent) = player
    write "<p>You are not wearing " noun1{the} .</p>^
    set TIME = false
    break
  endif
endif
if noun1 hasnt WORN
  proxy "take" noun1
  break
endif
if noun1(mass) > player(quantity)
  write "<p>You are carrying too much to remove " noun1{the} .</p>^
  set TIME = false
  break
endif
override
set player(quantity) - noun1(mass)
ensure noun1 hasnt WORN
write "<p>You remove " noun1{the} .</p>^
}

grammar wear *held    >wear
grammar put on *held  >wear
grammar put *held on  >wear
grammar don *held     >wear

{+wear
if noun1 hasnt WEARABLE
  write "<p>You can't wear " noun1{the} .</p>^
  set TIME = false
  break
endif
if noun1 has WORN
  write "<p>You are already wearing " noun1{the} .</p>^
  set TIME = false
  break
endif
override
set player(quantity) + noun1(mass)
ensure noun1 has WORN
write "<p>You put " noun1{the} " on.</p>^"
}

grammar talk to *present >talk_to

{+talk_to
if here has UNDER_WATER
  write "<p>Talking under water isn't very easy.</p>^"
  set TIME = false
  break
endif
if noun1 hasnt ANIMATE
  write "<p>I don't think talking to " noun1{the} " is going to help somehow.</p>^"
  set TIME = false
  break
endif
if noun1 has DEAD
  write <p> noun1{The} " " noun1{is} " a bit too dead to respond.</p>^"
  set TIME = false
  break
endif
if noun1 = player
  write "<p>It's the first sign of madness you know...</p>^"
  break
endif
override
write <p> noun1{The} " " noun1{doesnt} " appear very interested in a "
write "conversation.</p>^"
}

grammar eat *present          >eat

{+eat
break +darkness
write "<p>You can't eat " noun1{the} .</p>^
set TIME = false
}

grammar drink from *present   >drink_from
grammar sip from *present     >drink_from

{+drink_from
break +darkness
execute +liquidwrite noun1
if INDEX = true
  proxy "drink " noun3
  set TIME = false
  break
endif
write "<p>There is nothing to drink in " noun1{the} .</p>^
set TIME = false
}

grammar drink *present        >drink
grammar sip *present          >drink

{+drink
break +darkness
break +reach noun1
if noun1 hasnt LIQUID
  write "<p>You can't drink " noun1{the} .</p>^
  set TIME = false
  break
endif
override
write "<p>You drink " noun1{the} .</p>^
move noun1 to limbo
}

grammar flick *present >flick

{+flick
break +darkness
break +reach noun1
if noun1 has LIQUID
  write "<p>A wet hand is your only reward.</p>^"
  break
endif
override
write "<p>Flicking " noun1{the} " achieves nothing more than causing a sharp "
write "pain in your index finger.</p>^"
}

grammar press *present        >press
grammar poke *present         >press

{+press
break +darkness
break +reach noun1
if noun1 has LIQUID
  write "<p>A wet hand is your only reward.</p>^"
  break
endif
override
write "<p>Pressing " noun1{the} " has no discernible effect.</p>^"
}

grammar light *present with *held     >light_with
grammar burn *present with *held      >light_with
grammar ignite *present with *held    >light_with
grammar set fire to *present with *held >light_with

{+light_with
if here has UNDER_WATER
  write "<p>I don't think you are going to be lighting anything under water.</p>^"
  set TIME = false
  break
endif
break +reach noun1
if noun1 hasnt FLAMMABLE
  write <p> noun1{The} " " noun1{is} " not at all flammable.</p>^"
  set TIME = false
  break
endif
if noun2 hasnt IGNITABLE
  write "<p>I don't see how you can light " noun1{the} " using " noun2 .</p>^
  set TIME = false
  break
endif
if noun1(quantity) = 0
  write <p> noun1{The} " has run out.</p>^"
  break
endif
if noun1 has BURNING
  write <p> noun1{The} " " noun1{is} " already lit.</p>^"
  set TIME = false
  break
endif
override
write "<p>You light " noun1{the} " using " noun2 .</p>^
ensure noun1 has BURNING
ensure noun1 has LUMINOUS
}

grammar burn *present         >light
grammar light *present        >light
grammar ignite *present       >light
grammar set fire to *present  >light

{+light
if here has UNDER_WATER
  write "<p>I don't think you are going to be lighting anything under water.</p>^"
  set TIME = false
  break
endif
break +reach noun1
if noun1 has IGNITABLE
   override
   write "<p>You produce a brief flame.</p>^"
   break
endif
if noun1 hasnt FLAMMABLE
  write <p> noun1{The} " " noun1{is} " not at all flammable.</p>^"
  set TIME = false
  break
endif
if noun1 has BURNING
  write <p> noun1{The} " " noun1{is} " already alight.</p>^"
  set TIME = false
  break
endif
write "<p>What did you intent to light " noun1{the} " with?</p>^"
set TIME = false
}

grammar extinguish *present   >extinguish
grammar put out *present      >extinguish
grammar put *present out      >extinguish

{+extinguish
if noun1 hasnt BURNING
  write <p> noun1{The} " " noun1{is} " not lit.</p>^"
  set TIME = false
  break
endif
break +reach noun1
override
write "<p>You put out " noun1{the} .</p>^
ensure noun1 hasnt BURNING
ensure noun1 hasnt LUMINOUS
}

grammar swim west >swim_west

{+swim_west
if here has UNDER_WATER
  set WAY = WEST
  travel west
  break
endif
if here has ON_WATER
   set WAY = WEST
   travel west
   break
endif
write "<p>I don't see how you can swim when you are not in water.</p>^"
set TIME = false
}

grammar west      >west
grammar go west   >west
grammar walk west >west

{+west
set WAY = WEST
travel west
}

grammar swim east >swim_east

{+swim_east
if here has UNDER_WATER
  set WAY = EAST
  travel east
  break
endif
if here has ON_WATER
  set WAY = EAST
  travel east
  break
endif
write "<p>I don't see how you can swim when you are not in water.</p>^"
set TIME = false
}

grammar east      >east
grammar go east   >east
grammar walk east >east

{+east
set WAY = EAST
travel east
}

grammar swim south >swim_south

{+swim_south
if here has UNDER_WATER
  set WAY = SOUTH
  travel south
  break
endif
if here has ON_WATER
  set WAY = SOUTH
  travel south
  break
endif
write "<p>I don't see how you can swim when you are not in water.</p>^"
set TIME = false
}

grammar south      >south
grammar go south   >south
grammar walk south >south

{+south
set WAY = SOUTH
travel south
}

grammar swim southeast >swim_southeast

{+swim_southeast
if here has UNDER_WATER
  set WAY = SOUTHEAST
  travel southeast
  break
endif
if here has ON_WATER
  set WAY = SOUTHEAST
  travel southeast
  break
endif
write "<p>I don't see how you can swim when you are not in water.</p>^"
set TIME = false
}

grammar southeast      >southeast
grammar go southeast   >southeast
grammar walk southeast >southeast

{+southeast
set WAY = SOUTHEAST
travel southeast
}

grammar swim southwest >swim_southwest

{+swim_southwest
if here has UNDER_WATER
  set WAY = SOUTHWEST
  travel southwest
  break
endif
if here has ON_WATER
  set WAY = SOUTHWEST
  travel southwest
  break
endif
write "<p>I don't see how you can swim when you are not in water.</p>^"
set TIME = false
}

grammar southwest      >southwest
grammar go southwest   >southwest
grammar walk southwest >southwest

{+southwest
set WAY = SOUTHWEST
travel southwest
}

grammar swim north >swim_north

{+swim_north
if here has UNDER_WATER
  set WAY = NORTH
  travel north
  break
endif
if here has ON_WATER
  set WAY = NORTH
  travel north
  break
endif
write "<p>I don't see how you can swim when you are not in water.</p>^"
set TIME = false
}

grammar north         >north
grammar go north      >north
grammar walk north    >north

{+north
set WAY = NORTH
travel north
}

grammar swim northeast >swim_northeast

{+swim_northeast
if here has UNDER_WATER
  set WAY = NORTHEAST
  travel northeast
  break
endif
if here has ON_WATER
  set WAY = NORTHEAST
  travel northeast
  break
endif
write "<p>I don't see how you can swim when you are not in water.</p>^"
set TIME = false
}

grammar northeast             >northeast
grammar go northeast          >northeast
grammar walk northeast        >northeast

{+northeast
set WAY = NORTHEAST
travel northeast
}

grammar swim northwest >swim_northwest

{+swim_northwest
if here has UNDER_WATER
  set WAY = NORTHWEST
  travel northwest
  break
endif
if here has ON_WATER
  set WAY = NORTHWEST
  travel northwest
  break
endif
write "<p>I don't see how you can swim when you are not in water.</p>^"
set TIME = false
}

grammar northwest             >northwest
grammar go northwest          >northwest
grammar walk northwest        >northwest

{+northwest
set WAY = NORTHWEST
travel northwest
}

grammar climb up *here        >climb_up
grammar walk up *here         >climb_up
grammar go up *here           >climb_up

{+climb_up
write "<p>You can not climb up " noun1{the} .</p>^
set TIME = false
}

grammar climb down *here      >climb_down
grammar walk down *here       >climb_down
grammar go down *here         >climb_down

{+climb_down
write "<p>You can not climb down " noun1{the} .</p>^
set TIME = false
}

grammar enter *here		>enter
grammar go *here		>enter
grammar go through *here	>enter
grammar go in *here		>enter
grammar climb on *here		>enter
grammar climb in *here		>enter
grammar get in *here		>enter
grammar get on *here		>enter
grammar jump in *here		>enter

{+enter
break +reach noun1
write "<p>You can not enter " noun1{the} .</p>^
set TIME = false
}


grammar enter *anywhere		>enter_location
grammar go *anywhere		>enter_location
grammar go through *anywhere	>enter_location
grammar go to *anywhere		>enter_location
grammar go in *anywhere		>enter_location
grammar climb on *anywhere	>enter_location
grammar climb in *anywhere	>enter_location
grammar get in *anywhere	>enter_location
grammar jump in *anywhere	>enter_location
grammar get on *anywhere	>enter_location

{+enter_location
break +reach noun1
set INDEX = 0
repeat
   if here(INDEX) = noun1
      execute "+go_direction" INDEX
      break
   endif
   set INDEX + 1
until INDEX = 12
write "<p>You can not go to " noun1{the} .</p>^
set TIME = false
}

{+go_direction
if noun4 = NORTH
   proxy "go north"
   break
endif
if noun4 = NORTHEAST
   proxy "go northeast"
   break
endif
if noun4 = EAST
   proxy "go east"
   break
endif
if noun4 = SOUTHEAST
   proxy "go southeast"
   break
endif
if noun4 = SOUTH
   proxy "go south"
   break
endif
if noun4 = SOUTHWEST
   proxy "go southwest"
   break
endif
if noun4 = WEST
   proxy "go west"
   break
endif
if noun4 = NORTHWEST
   proxy "go northwest"
   break
endif
if noun4 = UP
   proxy "go up"
   break
endif
if noun4 = DOWN
   proxy "go down"
}

grammar climb *here >climb
grammar scale *here >climb

{+climb
write "<p>You can not climb up " noun1{the} .</p>^
set TIME = false
}

grammar swim in >swim_in

{+swim_in
if here has UNDER_WATER
  set WAY = IN
  travel in
  break
endif
if here has ON_WATER
  set WAY = IN
  travel in
  break
endif
write "<p>I don't see how you can swim when you are not in water.</p>^"
set TIME = false
}

grammar get in        >in
grammar climb in      >in
grammar in            >in
grammar enter         >in
grammar walk in       >in

{+in
set WAY = IN
travel in
}

grammar swim out >swim_out

{+swim_out
if here has UNDER_WATER
  set WAY = OUT
  travel out
  break
endif
if here has ON_WATER
  set WAY = OUT
  travel out
  break
endif
write "<p>I don't see how you can swim when you are not in water.</p>^"
set TIME = false
}

grammar get out       >out
grammar out           >out
grammar exit          >out
grammar leave         >out
grammar climb out     >out
grammar walk out      >out
grammar go out        >out

{+out
set WAY = OUT
travel out
}

grammar surface >swim_up
grammar swim up >swim_up

{+swim_up
if here has UNDER_WATER
  set WAY = UP
  travel up
  break
endif
if here has ON_WATER
  set WAY = UP
  travel up
  break
endif
write "<p>I don't see how you can swim when you are not in water.</p>^"
set TIME = false
}

grammar up            >up
grammar climb         >up
grammar climb up      >up
grammar jump up       >up
grammar go up         >up
grammar walk up       >up

{+up
set WAY = UP
travel up
}

grammar swim down     >swim_down
grammar dive down     >swim_down
grammar dive          >swim_down

{+swim_down
if here has UNDER_WATER
  set WAY = DOWN
  travel down
  break
endif
if here has ON_WATER
  set WAY = DOWN
  travel down
  break
endif
write "<p>I don't see how you can swim when you are not in water.</p>^"
set TIME = false
}

grammar down          >down
grammar climb down    >down
grammar jump down     >down
grammar go down       >down
grammar walk down     >down

{+down
set WAY = DOWN
travel down
}

grammar look  >look_around
grammar watch >look_around

{+look_around
break +darkness
look
}

grammar look under *present >look_under

{+look_under
break +darkness
if noun1(mass) >= heavy : noun1 has LOCATION
  write "<p>You can't see under " noun1{the} .</p>^
  set TIME = false
  break
endif
write "<p>There is nothing unusual under " noun1{the} .</p>^
}

grammar look behind *present >look_behind

{+look_behind
break +darkness
if noun1(mass) >= heavy : noun1 has LOCATION
  write "<p>You can't see behind " noun1{the} .</p>^
  set TIME = false
  break
endif
write "<p>There is nothing unusual behind " noun1{the} .</p>^
}

grammar look through *present >look_through
grammar look out *present     >look_through

{+look_through
break +darkness
write "<p>You can't look through " noun1{the} .</p>^
set TIME = false
}

grammar look through *held at *present        >look_through_at

{+look_through_at
break +darkness
proxy "look at " noun2 " through " noun1
}

grammar look at *present through *held        >look_at_through
grammar look at *present with *held           >look_at_through

{+look_at_through
break +darkness
if noun1 = noun2
  write "<p>You can't look at " noun1{the} " through "
  if noun1 has PLURAL
    write "themselves.</p>^"
  else
    write "itself.</p>^"
  set TIME = false
  break
endif
override
write "<p>You can't look at " noun1{the} " through " noun2{the} .</p>^
set TIME = false
}

grammar wait  >wait
grammar z     >wait

{+wait
write "<p>Time passes...</p>^"
}

grammar listen        >listen

{+listen
write "<p>You don't hear anything out of the ordinary.</p>^"
}

grammar listen to *present    >listen_to
grammar listen at *present    >listen_to

{+listen_to
write "<p>You don't hear anything out of the ordinary.</p>^"
}

grammar use *present          >use
grammar work *present         >use
grammar operate *present      >use

{+use
break +darkness
if noun1 has ANIMATE
  write "<p>I acknoweledge that I probably don't want to know the answer to "
  write "this question, but in what way did you want to use " noun1{the} .</p>^
  set TIME = false
  break
endif
write "<p>I'm afraid you are going to have to be a bit more specific.</p>^"
}

grammar rotate *present               >turn
grammar turn *present                 >turn
grammar twist *present                >turn
grammar spin *present                 >turn

{+turn
break +darkness
break +reach noun1
write "<p>You can't turn " noun1{the} .</p>^
set TIME = false
}

grammar turn on *present      >turn_on
grammar turn *present on      >turn_on
grammar switch on *present    >turn_on
grammar switch *present on    >turn_on

{+turn_on
if noun1 hasnt SWITCHABLE
  write "<p>You can't turn " noun1{the} " on.</p>^"
  set TIME = false
  break
endif
break +reach noun1
if noun1 has ON
  write <p> noun1{The} " " noun1{is} " already on.</p>^"
  set TIME = false
  break
endif
override
write "<p>You switch on " noun1{the} .</p>^
ensure noun1 has ON
}

grammar turn off *present   >turn_off
grammar turn *present off   >turn_off
grammar switch off *present >turn_off
grammar switch *present off >turn_off

{+turn_off
if noun1 hasnt SWITCHABLE
  write "<p>You can't turn " noun1{the} " off.</p>^"
  set TIME = false
  break
endif
break +reach noun1
if noun1 hasnt ON
  write <p> noun1{The} " " noun1{is} " already off.</p>^"
  set TIME = false
  break
endif
override
write "<p>You switch off " noun1{the} .</p>^
ensure noun1 hasnt ON
}

grammar pour *present         >pour

{+pour
break +darkness
if noun1 hasnt LIQUID
   write "<p>You can't pour " noun1{the} .</p>^
   set TIME = false
   break
endif
set noun3 = noun1(parent)
if noun3 = false : noun3(parent) <> player
  write "<p>You don't have " noun1{the} .</p>^
  set TIME = false
  break
endif
if noun3 has CLOSED
  write "<p>I don't see " noun1{the} " here.</p>^"
  set TIME = false
  break
endif
break +reach noun1
override
write "<p>You pour " noun1{the} " all over the ground.</p>^"
move noun1 to limbo
}

grammar list objects >list_objs

{+list_objs
select noun3(mass) > 0 
   write noun3{The} <BR>
next
}

grammar diag *anywhere	>diag

{+diag
set INDEX = noun1
write <p> noun1{The} ":<BR>^"
write "MASS: " noun1(mass) <BR>^
write "NUMBER: " INDEX <BR>^
write "QUANTITY: " noun1(quantity) <BR>^
set noun4 = noun1(parent)
write "PARENT: " noun4{The} <BR>^
write "HAS DARK?: "
if noun1 has DARK
   write YES<br>^
else
   write NO<br>^
endif
write "HAS DARKNESS?: "
if noun1 has DARKNESS
   write YES<br>^
else
   write NO<br>^
endif
}

grammar tip *present on *present      >pour_on
grammar tip *present down *present    >pour_on
grammar tip *present in *present      >pour_on
grammar tip *present over *present    >pour_on
grammar pour *present down *present   >pour_on
grammar pour *present on *present     >pour_on
grammar pour *present in *present     >pour_on
grammar pour *present over *present   >pour_on

{+pour_on
break +darkness
if noun1 hasnt LIQUID
  write "<p>You can't pour " noun1{the} .</p>^
  set TIME = false
  break
endif
break +reach noun1
set noun3 = noun1(parent)
if noun3 = false : noun3(parent) <> player
  write "<p>You do not have " noun1{the} .</p>^
  set TIME = false
  break
endif
if noun3 has CLOSED
  write "<p>I can't see " noun1{the} " here.</p>^"
  set TIME = false
  break
endif
break +reach noun2
override
execute +liquidwrite noun2
if INDEX = true
  write <p> noun2{The} " already contain" noun2{s} " " noun3{the} ". If you "
  write "were to also add " noun1{the} " they would mix together.</p>^"
  set TIME = false
  break
endif
if noun2 has CONTAINER
  if noun2 hasnt CLOSED
    override
    write "<p>You pour " noun1{the} " into " noun2{the} .</p>^
    move noun1 to noun2
    break
  endif
endif
if noun2(parent) > max_objects
  set noun3 = noun2(parent)
  if noun3 has CONTAINER
    if noun3 hasnt CLOSED
      write <p> noun1{the} " run" noun1{s} " off " noun2{the} " and goes into "
      write noun3 .</p>^
      move noun1 to noun3
      break
    endif
  endif
endif
write <p> noun1{The} " runs off " noun2{the} " and goes all over the ground.</p>^"
move noun1 to limbo
}

grammar blankjacl >blankjacl

{+blankjacl
write "<p>A fiendishly clever move.</p>^"
}

grammar instructions	>instructions
grammar help		>instructions

{+instructions
write "<p>Interactive fiction involves the reader in a way that static stories "
write "do not. Rather than reading sequentially from beginning to end, you "
write "control the actions of the main character by typing commands in the "
write "form of simple English sentences. Before setting out on your adventure "
write "there are a few concepts that must be explained in order for you to "
write "interact successfully with the virtual world created by the author."
write "<p>The physical space that you will be exploring is divided up into "
write "discrete units called locations. Locations may be travelled between "
write "using the "You can go:" hyperlinks or the following commands...</p>^"
write "<CENTER><TABLE WIDTH=80%><TR>"
write "<TH>Command</TH><TH>To travel</TH><TH>Command</TH><TH>To travel</TH>
write "</TR><TR>"

write "<TD>N</TD><TD>North</TD><TD>S</TD><TD>South</TD>"
write "</TR><TR>"

write "<TD>E</TD><TD>East</TD><TD>W</TD><TD>West</TD>"
write "</TR><TR>"

write "<TD>NE</TD><TD>Northeast</TD><TD>NW</TD><TD>Northwest</TD>"
write "</TR><TR>"

write "<TD>SE</TD><TD>Southeast</TD><TD>SW</TD><TD>Southwest</TD>"
write "</TR><TR>"

write "<TD>U</TD><TD>Up</TD><TD>D</TD><TD>Down</TD>"
write "</TR><TR>"

write "<TD>IN</TD><TD>In</TD><TD>OUT</TD><TD>Out</TD>"
write "</TR></TABLE></CENTER>"

write "<p>The description of each location will tell you which way you can "
write "travel from it. Be aware however that some exits may only be "
write "available under certain circumstances such as while a door is open "
write "or a bridge lowered.</p>^"

write "<p>Within these locations you will find many objects that you may "
write "manipulate. These objects may be referred to by as few "
write "or as many of their names as is required to uniquely identify it."
write "For example, if the story informs you that ~There is a silver key "
write "resting here.~ Then it may be referred to as either ~silver~, ~key~ or "
write "~silver key~. If your reference is ambiguous, such as using ~key~ "
write "when there is both a silver and a gold key in the current location "
write "then you will be prompted to be more specific.</p>^"

write "<HR>
write "<p>The next major concept of interactive fiction to understand is the "
write "way in which you interact with these objects within "
write "the locations. The main aspect of the command interface "
write "to come to grips with is the scale, in other words, how much can be "
write "achieved with a single command. As you have seen earlier, moving from "
write "one location to another requires a single command. Commands such as "
write "~find dave~ or ~go to the library~ are not valid. You must manually "
write "move around the available world to achieve these tasks yourself. For "
write "this reason, making a map as you go is highly recommended.</p>^"

write "<p>The basic sentence structures understood by the game are...</p>^"
write "<CENTER><TABLE WIDTH=80%><TR>"
write "<TD>action</TD><TD>eg. scream</TD>"
write "</TR><TR>"
write "<TD>action object</TD><TD>eg. take book</TD>"
write "</TR><TR>"
write "<TD>action object preposition object</TD><TD>eg. unlock door with key</TD>"
write "</TR><TR>"
write "</TABLE></CENTER>"

write "<p>An action does not necessarily have to be a single word. For instance, "
write "~examine rock through magnifying glass~, an example of the last "
write "syntax, may also be expressed as ~look at rock through magnifying "
write "glass~.</p>^"
write "<p>To further illustrate how much can be achieved in a single turn, "
write "consider the following list (being just some of the valid actions)...</p>^"
write "<CENTER><TABLE WIDTH=80%><TR>"
write "<TD>turn</TD><TD>read</TD><TD>pull</TD><TD>push</TD><TD>eat</TD><TD>cut</TD>"
write "</TR><TR>"
write "<TD>lock</TD><TD>unlock</TD><TD>rub</TD><TD>attack</TD><TD>taste</TD><TD>drink</TD>"
write "</TR><TR>"
write "<TD>break</TD><TD>smell</TD><TD>listen</TD><TD>pour</TD><TD>move</TD><TD>light</TD>"
write "</TR><TR>"
write "<TD>attack</TD><TD>blow</TD><TD>throw</TD><TD>wear</TD><TD>open</TD><TD>close</TD>"
write "</TR><TR>"
write "<TD>take</TD><TD>drop</TD><TD>insert</TD><TD>remove</TD>"
write "</TR></TABLE></CENTER>"
write "<p>The words ~it,~ ~them,~ ~him~ and ~her~ may be used to indicate the "
write "last appropriate object referred to in one of your commands. "
write "The words ~itself,~ ~themselves,~ ~himself~ and ~herself~ may be used "
write "to refer to the subject of the current command such as, ~ask dan about "
write "himself~.</p>^"
write "<p>The word ~all~ or ~everything~ may be used in place of an object "
write "when using one of the verbs in the bottom row of the table above.</p>^"

write "<HR>"
write "<p>However, a task such as defusing a bomb would generally not be achieved by "
write "typing ~defuse bomb~. The following is a sample transcript to give "
write "you a better idea of how this task such as this might be achieved.</p>^"
write "<p>&gt;examine bomb<BR>"
write "The bomb is about a foot square and has a small panel in its upper "
write "surface. The panel is currently closed.<BR></p>^"
write "<p>&gt;listen to bomb<BR>" 
write "The bomb is making an ominous ticking sound.<BR></p>^"
write "<p>&gt;open panel<BR>"
write "You open the panel to reveal a red wire, a green wire, a blue wire, "
write "a clock and some dynamite.<BR></p>^"
write "<p>&gt;i<BR>"
write "You are carrying a bomb manual, an insurance policy and some wire "
write "cutters.<BR><BR></p>^"
write "<p>&gt;read manual<BR>"
write "Leafing through the book you come to the page on diffusing. Seems "
write "straight forward enough, just cut the blue wire then the red one.<BR></p>^"
write "<p>&gt;cut blue wire with cutters<BR>"
write "Reaching carefully in to the bomb's casing you cut the blue wire. So "
write "far so good.<BR><BR></p>^"
write "<p>&gt;cut red wire with cutters" <BR>
write "Holding you breath you snip the red wire." <BR><BR></p>^
write "<p>&gt;listen to bomb" <BR>
write "The bomb, thankfully, is now silent." <BR><BR></p>^
write "<p>As you can see, each task you wish to achieve must be broken down "
write "into its component actions.</p>^"

write "<HR>"
write "<p>During the course of the story you may encounter other computer "
write "controlled characters. These characters may be interacted with using "
write "the following commands...</p>^"
write "<p>TALK TO &lt;character&gt;" <BR>
write "GIVE &lt;object&gt; TO &lt;character&gt;" <BR>
write "SHOW &lt;object&gt; TO &lt;character&gt;" <BR>
write "ASK &lt;character&gt; FOR &lt;object&gt;" <BR>
write "ASK &lt;character&gt; ABOUT &lt;object&gt;" <BR>
write "TELL &lt;character&gt; ABOUT &lt;object&gt;" <BR><BR></p>^

write "<p>There are also some special commands for interacting with the "
write "program rather than the world it simulates...</p>^"
write "<p><CENTER><TABLE WIDTH=80%><TR>
write "<TH>Command</TH><TH>Action</TH>"
write "</TR><TR>"
write "<TD>VERBOSE</TD><TD>always describe locations</TD>"
write "</TR><TR>"
write "<TD>BRIEF</TD><TD>only describe new locations</TD>"
write "</TR><TR>"
write "<TD>RESTART</TD><TD>start from the beginning</TD>"
write "</TR><TR>"
write "<TD>SCORE</TD><TD>display your score and rank</TD>"
write "</TR><TR>"
write "<TD>LOOK</TD><TD>describe the current location</TD>"
write "</TR><TR>"
write "<TD>SAVE</TD><TD>save the current position</TD>"
write "</TR><TR>"
write "<TD>RESTORE</TD><TD>restore a saved position</TD>"
write "</TR><TR>"
write "<TD>I</TD><TD>horizontal list of possessions</TD>"
write "</TR><TR>"
write "<TD>INV</TD><TD>vertical list of possessions</TD>"
write "</TR><TR>"
write "<TD>UNDO</TD><TD>take back last command</TD>"
write "</TR><TR>"
write "<TD>AGAIN</TD><TD>repeat the last command</TD>"
write "</TR><TR>"
write "<TD>INFO</TD><TD>display version information</TD>"
write "</TR><TR>"
write "<TD>ABOUT</TD><TD>display game information</TD>"
write "</TR></TABLE></CENTER>"
write "<p>NOTE: If you are looking for a clue relevant to a specific location, "
write "type ~hint~, ~first hint~ or ~hint one~ in that location. The first "
write "hint will be a subtle clue with ~hint two~ being more blatant and "
write "~hint three~ being exact commands to type.</p>^"

write "<HR>"
write "<p>You are now ready to embark on your first adventure into the "
write "world of interactive fiction."
write " Remember to make a map as you go and read each "
write "part carefully as vital clues may be hidden in the descriptions of the "
write "locations and objects you come across. Examining every object you can "
write "refer to is a good idea, as is saving your position often. Well, good "
write "luck, and above all have fun!</p>^"
set TIME = false
}

;                                                    SPEAKING TO OTHER OBJECTS
; ----------------------------------------------------------------------------
; Grammar statements beginning with an object must be defined last in the game
; to avoid confusion with verbs that may also be objects such as "drink drink"

grammar *present give myself *carried		>ask_for
grammar *present give *carried to myself	>ask_for
grammar *present give *carried to me		>ask_for
grammar *present give myself *anywhere		>ask_for
grammar *present give *anywhere to myself	>ask_for
grammar *present give *anywhere to me		>ask_for

grammar *present tell myself about *carried		>ask_about
grammar *present tell myself all about *carried		>ask_about
grammar *present what do you know about *carried	>ask_about
grammar *present tell myself about *anywhere		>ask_about
grammar *present tell myself all about *anywhere	>ask_about
grammar *present what do you know about *anwhere	>ask_about

grammar *present who are you		>who?
grammar *present what is your name	>who?
grammar *present what is your name?	>who?

{+who?
proxy "ask " noun1 " about " noun1
}

grammar *present sorry		>apologise
grammar *present im sorry	>apologise
grammar *present i am sorry	>apologise
grammar apologise to *present	>apologise

{+apologise
if noun1 hasnt ANIMATE
   write "<p>Kooky.</p>^"
   break
endall
write <p> noun1{the} " assure" noun1{s} " you that no apology is necessary.</p>^"
}

grammar *present thanks		>thank
grammar *present thank you	>thank
grammar thank *present		>thank

{+thank
if noun1 hasnt ANIMATE
   write "<p>Kooky.</p>^"
   break
endall
write "<p>~Don't mention it,~ "  noun1{the} " replies.</p>^"
}

grammar greet *present		>greet
grammar *present hello		>greet
grammar *present hi there	>greet
grammar *present dr		>greet
grammar *present doctor		>greet
grammar *present hi		>greet

{+greet
if here has UNDER_WATER
   write "<p>Talking under water isn't very easy.</p>^"
   set TIME = false
   break
endall
if noun1 hasnt ANIMATE
   write "<p>I don't think talking to " noun1{the} " is going to help somehow.</p>^"
   set TIME = false
   break
endall
if noun1 has DEAD 
   write <p> noun1{The} " " noun1{is} " a bit too dead to respond.</p>^"
   set TIME = false
   break
endall
if noun1 = player
   write "<p>It's the first sign of madness you know...</p>^"
   break
endall
override
write <p> noun1{The}
if noun1 has PLURAL
   write " nod.</p>^"
else
   write " nods.</p>^"
}
 
grammar *present yes	>say_yes
grammar *present okay	>say_yes
grammar *present yeah	>say_yes

{+say_yes
write <p> noun1{The} " appear" noun1{s} " to pay no attention.</p>^"
}

grammar *present no	>say_no

{+say_no
write <p> noun1{The} " appears to pay no attention.</p>^"
}

grammar *present *carried	>say_object
grammar *present *anywhere	>say_object

{+say_object
proxy "say " noun2 " to " noun1
}

grammar *anywhere >noun_only

{+noun_only
if noun1 isnt *present
   write "<p>You don't see any such thing.</p>^"
   set TIME = false
   break
endif
write "There is no verb in that sentence.</p>^"
set TIME = false
}
