#=============================================================
#
INIT
  local obj.ptr
#
# Move things to their proper places
#
   apport keys, building
   apport lamp, building
   apport grate, depression
   apport cage, cobbles
   apport rod, debris
   apport dynamite, limbo
   apport steps, pit
   apport bird, bird.chamber
   apport door, immense.n/s.passages
   apport pillow, soft
   apport snake, mtking
   apport fissure, east.of.fissure
   apport tablet, dark
   apport clam, shell
   apport oyster, limbo
   apport magazines, anteroom
   apport food, building
   apport bottle, building
   apport water, limbo
   apport oil, limbo
   apport mirror, mirror.canyon
   apport plant, west.pit
   apport stalactite, top.of.stalactite
   apport figure, east.window
   apport axe, limbo
   apport drawings, oriental
   apport pirate, limbo
   apport dragon, secret.n/e.canyon
   apport chasm, sw.of.chasm
   apport troll, sw.of.chasm
   apport bear, bear.room
   apport message, limbo
   apport volcano, breathtaker
   apport machine, mazed.140
   apport batteries, limbo
   apport carpet, soft
   apport nugget, nugget.room
   apport diamonds, west.of.fissure
   apport silver, low.n/s.passage
   apport jewelry, south.side.chamber
   apport coins, west.side.chamber
   apport chest, limbo
   apport eggs, giant.room
   apport trident, cavern
   apport vase, oriental
   apport emerald, plover
   apport pyramid, dark
   apport pearl, limbo
   apport rug, secret.n/e.canyon
   apport spices, boulders
   apport chain, bear.room
   apport dwarf0, mtking
   apport dwarf1, west.of.fissure
   apport dwarf2, reservoir
   apport dwarf3, mazea.44
   apport dwarf4, complex
   apport pirate, mazea.114
#
# Note which objects can be carried.
#
   flag keys, portable
   flag lamp, portable
   flag cage, portable
   flag rod, portable
   flag dynamite, portable
   flag bird, portable
   flag pillow, portable
   flag clam, portable
   flag oyster, portable
   flag magazines, portable
   flag food, portable
   flag bottle, portable
   flag water, portable
   flag oil, portable
   flag axe, portable
   flag batteries, portable
   flag nugget, portable
   flag diamonds, portable
   flag silver, portable
   flag jewelry, portable
   flag coins, portable
   flag chest, portable
   flag eggs, portable
   flag trident, portable
   flag vase, portable
   flag emerald, portable
   flag pyramid, portable
   flag pearl, portable
   flag spices, portable
   flag rug, portable
   flag bear, portable
   flag chain, portable
#
# Some things can be ni two places at once (at N and at N+1),
#
   flag grate, schizoid
   flag steps, schizoid
   flag fissure, schizoid
   flag figure, schizoid
   flag chasm, schizoid
   flag troll, schizoid
#
# Some liquids
#
   flag water, liquid
   flag oil, liquid
#
# Some places are naturally illuminated.
#
   flag road, lit
   flag hill, lit
   flag building, lit
   flag valley, lit
   flag forest.1, lit
   flag forest.2, lit
   flag slit, lit
   flag depression, lit
   flag in.cave, lit
   flag cobbles, lit
   flag plover, lit
   flag ne.repository, lit
   flag sw.repository, lit
   flag breathtaker, lit
#
# Some places have water or oil  available.
#
   flag road, h2o.here
   flag building, h2o.here
   flag valley, h2o.here
   flag slit, h2o.here
   flag streampit, h2o.here
   flag cavern, h2o.here
   flag reservoir, h2o.here
   flag east.pit, oil.here
#
# Mark places forbidden to the pirate.
#
   flag mazea.46, no.pirate
   flag mazea.47, no.pirate
   flag mazea.48, no.pirate
   flag mazea.54, no.pirate
   flag mazea.56, no.pirate
   flag mazea.58, no.pirate
   flag mazea.82, no.pirate
   flag mazea.85, no.pirate
   flag mazea.86, no.pirate
   flag ne.of.chasm, no.pirate
   flag corridor, no.pirate
   flag fork, no.pirate
   flag warmjunctn, no.pirate
   flag breathtaker, no.pirate
   flag boulders, no.pirate
   flag limestone, no.pirate
   flag barren, no.pirate
   flag bear.room, no.pirate
#
# Mark maze places for hinting.ue procs 
#
   flag mazea.42, in.maze
   flag mazea.43, in.maze
   flag mazea.44, in.maze
   flag mazea.45, in.maze
   flag mazea.46, in.maze
   flag mazea.47, in.maze
   flag mazea.48, in.maze
   flag mazea.49, in.maze
   flag mazea.50, in.maze
   flag mazea.51, in.maze
   flag mazea.52, in.maze
   flag mazea.53, in.maze
   flag mazea.54, in.maze
   flag mazea.55, in.maze
   flag mazea.56, in.maze
   flag mazea.80, in.maze
   flag mazea.81, in.maze
   flag mazea.82, in.maze
   flag mazea.86, in.maze
   flag mazea.87, in.maze
#
# Forbid the use of BACK in some places.
#
  flag mazea.43, no.back
  flag mazea.44, no.back
  flag mazea.45, no.back
  flag mazea.46, no.back
  flag mazea.47, no.back
  flag mazea.48, no.back
  flag mazea.49, no.back
  flag mazea.50, no.back
  flag mazea.51, no.back
  flag mazea.52, no.back
  flag mazea.53, no.back
  flag mazea.54, no.back
  flag mazea.55, no.back
  flag mazea.56, no.back
  flag mazea.by.pit, no.back
  flag mazea.58, no.back
  flag mazea.80, no.back
  flag mazea.81, no.back
  flag mazea.82, no.back
  flag mazea.83, no.back
  flag mazea.84, no.back
  flag mazea.85, no.back
  flag mazea.86, no.back
  flag mazea.87, no.back
  flag mazed.112, no.back
  flag mazea.114, no.back
  flag mazed.131, no.back
  flag mazed.132, no.back
  flag mazed.133, no.back
  flag mazed.134, no.back
  flag mazed.135, no.back
  flag mazed.136, no.back
  flag mazed.137, no.back
  flag mazed.138, no.back
  flag mazed.139, no.back
  flag mazed.140, no.back
  flag top.of.stalactite, no.back
  flag incline, no.back
  flag sw.of.chasm, no.back
  flag ne.of.chasm, no.back
  flag witts.end,no.back
  flag alcove, no.back
  flag plover, no.back
  flag dark, no.back
  flag wide.n/s.canyon, no.back
#
# What can he try opening?
#   
  flag grate, openable
  flag chain, openable
  flag door, openable
  flag oyster, openable
  flag clam, openable
#
# Note which are treasures to be collected.
#
   itobj obj.ptr
     ifinrange obj.ptr, gold, chain
       flag obj.ptr, valued
     fin
   fin
#
# Beings that can be attacked.
#
   flag dragon, mortal
   flag snake, mortal
   flag bird, mortal
   flag dwarf, mortal
   flag bear, mortal
#
# Reading matter
#
  flag tablet, readable
  flag message, readable
  flag magazines, readable
  flag oyster, readable
#
# Note freebies.
#
  flag water, freebie
  flag oil, freebie
  flag bird, freebie
#
  tie plant, plant.2
#
INIT
#
# Initialise NPCs.
#
  local dn, dcur, dloc
  apport dwarf0, mtking   
  apport dwarf1, west.of.fissure
  apport dwarf2, y2
  apport dwarf3, mazea.44
  apport dwarf4, complex
  apport pirate, mazea.114
  set daggro, 0              # NPCs not active yet
#
# Zap 0, 1 or 2 dwarfs.
#
  chance 50                  # Maybe zap a dwarf
    lda dcur, dwarf0
    random dn, 5
    add dcur, dn
    apport dcur, ylem
  fin
  chance 50                  # Maybe zap another dwarf (possibly the same one)
    lda dcur, dwarf0
    random dn, 5
    add dcur, dn
    apport dcur, ylem
  fin
#
# Odds and sods...
#
  set bottle, full.of.water  # The initial state of the bottle
  set still.to.find, 14      # Number of treasures to be found
  set lamplife, 330          # Initial lamp charge
  set abnum, 5               # Repeat long description every 5 visits
  lda locbase, road
  lda abbase, abb
#
# Go to the start location and ask whether instructions are required.
#
  goto road
  set context, q.intro
  say "_"
  call cgiquery, hi.there, q.intro, 0
#
#
##############################################################
