home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume10 / nethack3p9 / part23 < prev    next >
Text File  |  1990-07-12  |  60KB  |  1,903 lines

  1. Path: uunet!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!uw-beaver!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v10i068:  nethack3p9 -  display oriented dungeons & dragons (Ver. 3.0i), Part23/56
  5. Message-ID: <5926@tekred.CNA.TEK.COM>
  6. Date: 12 Jul 90 16:01:06 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1892
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 10, Issue 68
  13. Archive-name: nethack3p9/Part23
  14. Supersedes: NetHack3: Volume 7, Issue 56-93
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 23 (of 56)."
  25. # Contents:  auxil/data.base src/lev_comp.c
  26. # Wrapped by billr@saab on Wed Jul 11 17:11:25 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'auxil/data.base' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'auxil/data.base'\"
  30. else
  31. echo shar: Extracting \"'auxil/data.base'\" \(22782 characters\)
  32. sed "s/^X//" >'auxil/data.base' <<'END_OF_FILE'
  33. X    NetHack data file - version 3.0i
  34. X    demons should all come first, before the *centaur line
  35. Xbalrog
  36. X        ...  It came to the edge of the fire and the light  faded as
  37. X        if a  cloud had  bent over it.  Then  with a rush it  leaped
  38. X        the fissure.  The flames roared up to greet it, and wreathed
  39. X        about  it; and a black smoke swirled in the air. Its stream-
  40. X        ing  mane kindled,  and blazed behind it.  In its right hand
  41. X        was a  blade like a stabbing tongue of fire;  in its left it
  42. X        held a whip of many thongs.
  43. X        'Ai, ai!'  wailed Legolas. 'A Balrog!  A Balrog is come!'
  44. X               [ The Fellowship of the Ring, by J.R.R. Tolkien ]
  45. Xhorned devil
  46. X        Horned devils lack any real special abilities,  though  they
  47. X        are quite difficult to kill.
  48. Xincubus
  49. Xsuccubus
  50. X        The incubus and succubus are male and female versions of the
  51. X        same  demon, one who lies with a human for its own purposes,
  52. X        usually to the detriment of the mortals who  are  unwise  in
  53. X        their dealings with them.
  54. Xerinyes
  55. X        These female-seeming devils attack hand to hand  and  poison
  56. X        their unwary victims as well.
  57. Xmarilith
  58. X        The marilith, a type V demon, has a torso shaped  like  that
  59. X        of  a human female, and the lower body of a great snake.  It
  60. X        has multiple arms, and can freely attack with all  of  them.
  61. X        Since it is intelligent enough to use weapons, this means it
  62. X        can cause great damage.
  63. Xbarbed devil
  64. X        Barbed devils lack any real special abilities,  though  they
  65. X        are quite difficult to kill.
  66. Xvrock
  67. X        The vrock is one of the weaker forms of demon, being only  a
  68. X        type  I.   It  resembles a cross between a human being and a
  69. X        vulture and does physical damage by biting and by using  the
  70. X        claws on both its arms and feet.
  71. Xhezrou
  72. X        ``Hezrou'' is the common name for the type II demon.  It  is
  73. X        among the weaker of demons, but still quite formidable.
  74. Xbone devil
  75. X        Bone devils attack with weapons and with a great hooked tail
  76. X        which causes a loss of strength to those they sting.
  77. Xnalfeshnee
  78. X        Not only do these demons, which are of type IV, do  physical
  79. X        damage  with  their  claws and bite, but they are capable of
  80. X        using magic as well.
  81. Xice devil
  82. X        Ice devils  are  large  semi-insectoid  creatures,  who  are
  83. X        equally  at home in the fires of Hell and the cold of Limbo,
  84. X        and who can cause the traveller to feel the latter with just
  85. X        a touch of their tail.
  86. Xpit fiend
  87. X        Pit fiends are among the more powerful of devils, capable of
  88. X        attacking  twice with weapons as well as grabbing and crush-
  89. X        ing the life out of  thise  unwary  enough  to  enter  their
  90. X        domains.
  91. Xjuiblex
  92. Xjubilex
  93. X        Little is known about the Faceless Lord,  even  the  correct
  94. X        spelling  of  his name.  He does not have a physical form as
  95. X        we know it, and those who have peered into his  realm  claim
  96. X        he  is  a  slime-like  creature who swallows other creatures
  97. X        alive, spits acidic secretions, and causes  disease  in  his
  98. X        victims which can be almost instantly fatal.
  99. Xyeenoghu
  100. X        Yeenoghu, the demon lord of gnolls,  still  exists  although
  101. X        all his followers have been wiped off the face of the earth.
  102. X        He casts magic projectiles at those close to him, and a mere
  103. X        gaze  into  his  piercing  eyes  may  hopelessly confuse the
  104. X        battle-weary adventurer.
  105. Xorcus
  106. X        Orcus, Prince of the Undead, has a rams head  and  a  poison
  107. X        stinger.   He is most feared, though, for his powerful magic
  108. X        abilities.  His wand causes death to those he chooses.
  109. Xgeryon
  110. X        Geryon is an arch-devil sometimes  called  the  Wild  Beast,
  111. X        attacking  with  his claws and poison sting.  His ranking in
  112. X        Hell is rumored to be quite low.
  113. Xdispater
  114. X        Dispater is an arch-devil who rules the city of Dis.  He  is
  115. X        a powerful mage.
  116. Xbaalzebub
  117. X        Baalzebub has been known as the lord of the flies.  His bite
  118. X        drips  poison,  and a mere glance into his eyes can stun the
  119. X        hapless invader of his realm.
  120. Xasmodeus
  121. X        It is said that Asmodeus is the overlord over all  of  hell.
  122. X        His  appearance,  unlike  many  other  demons and devils, is
  123. X        human apart from his horns and tail.  He  can  freeze  flesh
  124. X        with a touch.
  125. Xdemogorgon
  126. X        Demogorgon, the prince of demons, wallows in filth  and  can
  127. X        spread  a quickly fatal illness to his victims while rending
  128. X        them.  He is a mighty spellcaster, and he can drain the life
  129. X        of mortals with a touch of his tail.
  130. X*centaur
  131. X        Of all the monsters put together by  the  Greek  imagination
  132. X        the  Centaurs (Kentauroi) constituted a class in themselves.
  133. X        Despite a strong streak  of  sensuality  in  their  make-up,
  134. X        their  normal  behaviour  was  moral, and they took a kindly
  135. X        thought of man's welfare. The attempted outrage of Nessos on
  136. X        Deianeira,  and  that  of the whole tribe of Centaurs on the
  137. X        Lapith women,  are more than offset  by the  hospitality  of
  138. X        Pholos and  by  the  wisdom of Cheiron,  physician, prophet,
  139. X        lyrist,  and the instructor of Achilles.  Further,  the Cen-
  140. X        taurs  were  peculiar in that their nature, which united the
  141. X        body of a horse with the trunk and head of a  man,  involved
  142. X        an  unthinkable  duplication  of  vital organs and important
  143. X        members.  So grotesque a combination seems almost  un-Greek.
  144. X        These  strange creatures  were said to live in the caves and
  145. X        clefts of the mountains, myths associating  them  especially
  146. X        with the hills of Thessaly and the range of Erymanthos.
  147. X                 [ Mythology of all races, Vol. 1, pp. 270-271 ]
  148. Xcockatrice
  149. X        Once in a great while, when the positions of the  stars  are
  150. X        just right, a seven-year-old rooster will lay an egg.  Then,
  151. X        along will come a snake, to coil around the egg, or a  toad,
  152. X        to  squat  upon  the  egg, keeping it warm and helping it to
  153. X        hatch.  When it hatches, out comes a creature called  basil-
  154. X        isk, or cockatrice, the most deadly of all creatures. A sin-
  155. X        gle glance from its yellow, piercing toad's eyes  will  kill
  156. X        both man  and beast.  Its power of destruction is said to be
  157. X        so great that sometimes simply to hear its  hiss  can  prove
  158. X        fatal.  Its  breath is so venomous  that it causes all vege-
  159. X        tation to wither.
  160. X    
  161. X        There is, however, one  creature  which  can  withstand  the
  162. X        basilisk's deadly gaze, and this is the weasel. No one knows
  163. X        why this is so, but although the fierce weasel can slay  the
  164. X        basilisk, it will itself be killed in the struggle.  Perhaps
  165. X        the weasel knows the basilisk's fatal weakness:  if it  ever
  166. X        sees  its own reflection in a mirror it will perish instant-
  167. X        ly.  But even a dead basilisk is dangerous, for  it is  said
  168. X        that merely touching its lifeless body can cause a person to
  169. X        sicken and die.
  170. X        [ Mythical Beasts by Deirdre Headon (The Leprechaun Library)
  171. X          and other sources ]
  172. X*dragon
  173. X        In the West  the dragon was  the  natural  enemy   of   man.
  174. X        Although  preferring  to live in bleak and desolate regions,
  175. X        whenever it was seen among men it left in its wake a   trail
  176. X        of   destruction   and disease. Yet any attempt to slay this
  177. X        beast was a perilous undertaking. For the dragon's assailant
  178. X        had  to  contend not  only  with clouds of  sulphurous fumes
  179. X        pouring from its fire-breathing nostrils, but also with  the
  180. X        thrashings  of  its  tail,  the  most   deadly  part  of its
  181. X        serpent-like body.
  182. X        [Mythical Beasts by Deirdre Headon (The Leprechaun Library)]
  183. X*elemental
  184. X        Elementals are manifestations of the  basic  nature  of  the
  185. X        universe.   There  are four known forms of elementals:  air,
  186. X        fire, water, and earth.  Some mystics  have  postulated  the
  187. X        necessity  for  a fifth type, the spirit elemental, but none
  188. X        have ever been encountered, at least on this  plane  of  ex-
  189. X        istence.
  190. X*giant
  191. Xgiant humanoid
  192. X        Giants have always walked the earth, though they are rare in
  193. X        these times.  They range in size from  little over nine feet
  194. X        to a towering twenty feet or more.  The larger ones use huge
  195. X        boulders as weapons, hurling them over large distances.  All
  196. X        types of giants share a love for men  -  roasted, boiled, or
  197. X        fried.  Their table manners are legendary.
  198. Xgnome*
  199. Xgnomish wizard
  200. X        ...  And then a gnome came by,  carrying a bundle,   an  old
  201. X        fellow three times  as large as an imp  and wearing  clothes
  202. X        of a sort, especially a hat.  And he was  clearly   just  as
  203. X        frightened   as  the  imps  though  he could not go so fast.
  204. X        Ramon Alonzo saw that there must be some great trouble  that
  205. X        was  vexing  magical  things;   and,  since gnomes speak the
  206. X        language of men, and will answer if spoken  to  gently,   he
  207. X        raised  his  hat,   and  asked  of the gnome  his name.  The
  208. X        gnome did not  stop  his  hasty  shuffle  a  moment   as  he
  209. X        answered 'Alaraba' and grabbed the rim of his hat but forgot
  210. X        to doff it.
  211. X        'What is the trouble, Alaraba?' said Ramon Alonzo.
  212. X        'White magic. Run!' said the gnome ...
  213. X                [ The Charwoman's Shadow, by Lord Dunsany. ]
  214. Xgold
  215. Xpile of gold
  216. X        A metal of characteristic yellow colour, the  most  precious
  217. X        metal  used as a common commercial medium of exchange.  Sym-
  218. X        bol, Au; at.  no. 79; at. wt. 197.2.  It is the most  malle-
  219. X        able  and  ductile  of  all metals, and very heavy (sp. gr.,
  220. X        19.3).  It is quite unalterable by heat, moisture, and  most
  221. X        corrosive  agents,  and therefore well suited for its use in
  222. X        coin and jewelry.
  223. X                [ Webster's New International Dictionary
  224. X                  of the English Language, Second Edition ]
  225. X*golem
  226. X        These creatures, not quite living but not  really  nonliving
  227. X        either,   are   created from inanimate materials by powerful
  228. X        mages or priests.
  229. Xgremlin
  230. X        The  gremlin is a highly  intelligent and  completely   evil
  231. X        creature.   It lives to torment  other creatures and will go
  232. X        to great lengths to inflict pain or cause injury.
  233. Xgrid bug
  234. X        These  electrically based creatures are  not native  to this
  235. X        universe.  They  appear to come from a world  whose  laws of
  236. X        motion are radically different from ours.
  237. Xhobbit
  238. X        Hobbits  are  an unobtrusive  but very ancient people,  more
  239. X        numerous formerly than they are today;  for they love  peace
  240. X        and quiet and good tilled earth:  a  well-ordered and  well-
  241. X        farmed countryside  was their favourite haunt.  They  do not
  242. X        and  did  not  understand  or like machines more complicated
  243. X        than a forge-bellows, a water-mill, or a handloom,  although
  244. X        they  were skillful with tools.  Even  in ancient days  they
  245. X        were, as a rule, shy of "the Big Folk", as they call us, and
  246. X        now they avoid us with dismay and are becoming hard to find.
  247. X               [ The Fellowship of the Ring, by J.R.R. Tolkien ]
  248. Xhobgoblin
  249. X        Hobgoblin. Used by the  Puritans  and  in  later  times  for
  250. X        wicked  goblin  spirits,  as in Bunyan's 'Hobgoblin nor foul
  251. X        friend', but its more correct use is for the friendly  spir-
  252. X        its  of  the brownie type.  In 'A midsummer night's dream' a
  253. X        fairy says to Shakespeare's Puck:
  254. X                Those that Hobgoblin call you, and sweet Puck,
  255. X                You do their work, and they shall have good luck:
  256. X                Are you not he?
  257. X        and obviously Puck would not wish to be called  a  hobgoblin
  258. X        if that was an ill-omened word.
  259. X        Hobgoblins are on the whole, good-humoured and ready  to  be
  260. X        helpful,  but fond of practical joking, and like most of the
  261. X        fairies rather nasty people to annoy. Boggarts hover on  the
  262. X        verge of hobgoblindom.  Bogles are just over the edge.
  263. X        One Hob mentioned by Henderson, was Hob Headless who haunted
  264. X        the  road  between Hurworth and Neasham, but could not cross
  265. X        the little river Kent, which flowed into the  Tess.  He  was
  266. X        exorcised  and  laid under a large stone by the roadside for
  267. X        ninety-nine years and a day. If anyone was so unwary  as  to
  268. X        sit  on  that stone, he would be unable to quit it for ever.
  269. X        The ninety-nine years is nearly up, so trouble may  soon  be
  270. X        heard of on the road between Hurworth and Neasham.
  271. X                     [ Katharine Briggs, A  dictionary  of Fairies ]
  272. Xhumanoid
  273. X        Humanoids  are all approximately  the size of a human,   and
  274. X        may  be  mistaken for one  at a distance.  They  are usually
  275. X        of a tribal  nature, and will  fiercely defend their  lairs.
  276. X        Usually   hostile, they  may even band  together to raid and
  277. X        pillage human settlements.
  278. Xhuman
  279. Xarcheologist
  280. Xbarbarian
  281. Xcave*man
  282. Xelf
  283. Xhealer
  284. Xknight
  285. Xpriest*
  286. Xrogue
  287. Xsamurai
  288. Xtourist
  289. Xvalkyrie
  290. Xwizard
  291. X        These strange creatures live mostly on the  surface  of  the
  292. X        earth, gathering together in societies of various forms, but
  293. X        occasionally a stray will descend into the depths and commit
  294. X        mayhem  among  the  dungeon  residents who, naturally, often
  295. X        resent the intrusion of such beasts.  They  are  capable  of
  296. X        using  weapons  and  magic,  and it is even rumored that the
  297. X        Wizard of Yendor is a member of this species.
  298. Ximp
  299. X         ... imps ... little creatures of two feet high  that  could
  300. X        gambol and jump prodigiously; ...
  301. X                 [ The Charwoman's Shadow, by Lord Dunsany ]
  302. X    
  303. X        An 'imp' is an off-shoot or cutting.  Thus an 'ymp tree' was
  304. X        a grafted tree, or one grown from a cutting, not from seed.
  305. X        'Imp' properly means a small devil, an off-shoot  of  Satan,
  306. X        but  the distinction between goblins or bogles and imps from
  307. X        hell is hard to make, and many in the  Celtic  countries  as
  308. X        well as the English Puritans regarded all fairies as devils.
  309. X        The fairies of tradition often hover  uneasily  between  the
  310. X        ghostly and the diabolic state.
  311. X                   [ Katharine Briggs, A Dictionary of Fairies ]
  312. Xjabberwock
  313. X        "Beware the Jabberwock, my son!
  314. X          The jaws that bite, the claws that catch!
  315. X        Beware the Jubjub bird, and shun
  316. X          The frumious Bandersnatch!"
  317. X        
  318. X        He took his vorpal sword in hand;
  319. X          Long time the manxome foe he sought --
  320. X        So rested he by the Tumtum tree,
  321. X          And stood awhile in thought.
  322. X        
  323. X        And, as in uffish thought he stood,
  324. X          The Jabberwock, with eyes of flame,
  325. X        Came whiffling through the tulgey wood,
  326. X          And burbled as it came!
  327. X                    [ Jabberwocky, by Lewis Carroll ]
  328. X*kobold*
  329. X        The race of kobolds are reputed to be an artificial creation
  330. X        of a master wizard (demi-god?).  They are about 3' tall with
  331. X        a vaguely dog-like face.  They bear a violent dislike of the
  332. X        Elven race, and  will go out  of their way to  cause trouble
  333. X        for Elves at any time.
  334. Xleprechaun
  335. X        The Irish Leprechaun is the Faeries' shoemaker and is  known
  336. X        under  various names  in different parts of Ireland:  Cluri-
  337. X        caune in Cork, Lurican in Kerry, Lurikeen in Kildare and Lu-
  338. X        rigadaun  in  Tipperary.  Although he works for the Faeries,
  339. X        the Leprechaun is not of the same species.  He is small, has
  340. X        dark  skin  and wears strange clothes.  His nature has some-
  341. X        thing of the manic-depressive about it:  first he  is  quite
  342. X        happy, whistling merrily as he nails a sole on to a shoe;  a
  343. X        few minutes later, he is sullen and  morose,  drunk  on  his
  344. X        home-made heather ale.  The Leprechaun's two great loves are
  345. X        tobacco and whiskey, and he is a first-rate con-man,  impos-
  346. X        sible  to  out-fox.  No  one, no matter how clever, has ever
  347. X        managed to cheat him out of his hidden pot of  gold  or  his
  348. X        magic shilling.  At the last minute he always thinks of some
  349. X        way to divert his captor's attention  and  vanishes  in  the
  350. X        twinkling  of  an eye.
  351. X                     [ A Field Guide to the Little People
  352. X                       by Nancy Arrowsmith & George Moorse ]
  353. Xleocrotta
  354. Xleu*otta
  355. X        ...the leucrocotta, a wild beast of extraordinary swiftness,
  356. X        the size of the wild ass, with the legs of a Stag, the neck,
  357. X        tail, and breast of a lion,  the head of a badger,  a cloven
  358. X        hoof, the mouth slit up as far as the ears,  and one contin-
  359. X        uous bone  instead of  teeth;  it is said,  too,  that  this
  360. X        animal can imitate the human voice.
  361. X                   [ Curious Creatures in Zoology, John Ashton ]
  362. X*lich
  363. X        Once in a great  while, an evil master wizard or priest will
  364. X        manage through use of great magics to extend his or her life
  365. X        far beyond the normal  span of a human.  The usual effect of
  366. X        this is to transform the human, over time, into an undead of
  367. X        great magical power.  A Lich  hates life in any form; even a
  368. X        touch from one of these  creatures will cause a numbing cold
  369. X        in the victim.  They all possess the capability to use magic.
  370. Xmedusa
  371. X        This hideous  creature from  ancient Greek myth was the doom
  372. X        of many a valiant adventurer.  It is said that one gaze from
  373. X        its eyes  could turn a man to stone.  One bite from the nest
  374. X        of  snakes which  crown its head could  cause instant death.
  375. X        The only  way to kill this  monstrosity is to turn its  gaze
  376. X        back upon itself.
  377. X*naga*
  378. X        The naga is a mystical creature with the body of a snake and
  379. X        the head of a man or woman.  They will fiercely  protect the
  380. X        territory they consider their own.  Some nagas can be forced
  381. X        to serve as a guardian by a spell caster of great power.
  382. X*ooze
  383. X*pudding
  384. X        These giant amoeboid creatures look like nothing  more  than
  385. X        puddles  of  slime,  but they both live and move, feeding on
  386. X        metal or wood as well as the occasional dungeon explorer  to
  387. X        supplement their diet.
  388. Xorcrist
  389. X        The  Great Goblin  gave a truly awful howl of  rage when  he
  390. X        looked  at  it,  and  all his soldiers  gnashed their teeth,
  391. X        clashed their shields,  and stamped.  They knew the sword at
  392. X        once.  It had killed hundreds of goblins in  its time,  when
  393. X        the  fair elves of Gondolin hunted them in the hills or  did
  394. X        battle  before  their  walls.  They  had called it  Orcrist,
  395. X        Goblin-cleaver, but the goblins called it simply Biter. They
  396. X        hated it and hated worse any one that carried it.
  397. X                       [ The Hobbit, by J.R.R. Tolkien ]
  398. Xpiercer
  399. X        Ye Piercer doth look like unto  a  stalactyte,  and  hangeth
  400. X        from  the  roofs of caves and caverns.  Unto the height of a
  401. X        man, and thicker than a man's thigh do  they  grow,  and  in
  402. X        groups  do they hang.  If a creature doth pass beneath them,
  403. X        they will by its heat and noise perceive it, and  fall  upon
  404. X        it  to kill and devour it, though in any other way they move
  405. X        but exceeding slow.
  406. X                           [ the Bestiary of Xygag ]
  407. Xquantum mechanic
  408. X        These creatures are not native to this universe;  they  seem
  409. X        to have strangely derived powers, and unknown motives.
  410. Xquadruped
  411. X        The woodlands and other regions  are inhabited by multitudes
  412. X        of four-legged creatures  which cannot be simply classified.
  413. X        They might not have fiery breath  or deadly stings,  but ad-
  414. X        venturers  have  nevertheless  met their end  numerous times
  415. X        due to the claws, hooves, or bites of such animals.
  416. Xrust monster
  417. X        These strange creatures live on a   diet  of  metals.   They
  418. X        will  turn  a  suit  of  armour into so much useless  rusted
  419. X        scrap in no time at all.
  420. Xsnickersnee
  421. X        Ah, never shall I forget the cry, 
  422. X            or the shriek that shrieked he,
  423. X        As I gnashed my teeth, and from my sheath
  424. X            I drew my Snickersnee!
  425. X        --Koko, Lord high executioner of Titipu
  426. X                     [ The Mikado, by Sir W.S. Gilbert ]
  427. X*soldier
  428. Xsergeant
  429. Xlieutenant
  430. Xcaptain
  431. X        The soldiers  of Yendor are  well-trained in the art of war,
  432. X        many  trained by  the wizard himself.  Some say the soldiers
  433. X        are explorers  who were  unfortunate enough  to be captured,
  434. X        and  put under the wizard's spell.  Those who have  survived
  435. X        encounters  with  soldiers   say  they  travel  together  in
  436. X        platoons,  and are fierce fighters.  Because of the  load of
  437. X        their  combat gear,  however,  one can usually run away from
  438. X        them, and doing so is considered a wise thing.
  439. Xtengu
  440. X        The tengu was the  most  troublesome  creature  of  Japanese
  441. X        legend.   Part  bird  and part man, with red beak for a nose
  442. X        and flashing eyes, the tengu was notorious for  stirring  up
  443. X        feuds  and  prolonging  enmity between families. Indeed, the
  444. X        belligerent tengus were supposed to have  been  man's  first
  445. X        instructors in the use of arms.
  446. X        [Mythical Beasts by Deirdre Headon (The Leprechaun Library)]
  447. X*unicorn
  448. Xunicorn horn
  449. X        Men have always sought the elusive unicorn, for  the  single
  450. X        twisted  horn  which projected from its forehead was thought
  451. X        to be a powerful talisman.  It was said that the unicorn had
  452. X        simply  to  dip  the tip of its horn in a muddy pool for the
  453. X        water to become pure.  Men also believed that to  drink from
  454. X        this horn was a protection against all sickness, and that if
  455. X        the horn was ground to a powder it would act as an  antidote
  456. X        to all poisons.  Less than 200 years ago in France, the horn
  457. X        of a unicorn was used in a ceremony to test the  royal  food
  458. X        for poison.
  459. X    
  460. X        Although only the size of a small horse, the  unicorn  is  a
  461. X        very  fierce  beast,  capable  of killing an elephant with a
  462. X        single thrust from its horn.  Its  fleetness  of  foot  also
  463. X        makes  this solitary creature difficult to capture. However,
  464. X        it can be tamed and captured by a maiden. Made gentle by the
  465. X        sight  of a virgin, the unicorn can be lured to lay its head
  466. X        in her lap, and in this docile mood, the maiden  may  secure
  467. X        it with a golden rope.
  468. X        [Mythical Beasts by Deirdre Headon (The Leprechaun Library)]
  469. X*long worm
  470. Xworm tooth
  471. Xcrysknife
  472. X        [The crysknife] is manufactured in two forms from teeth tak-
  473. X        en  from dead sandworms.  The two forms are "fixed" and "un-
  474. X        fixed." An unfixed  knife  requires  proximity  to  a  human
  475. X        body's  electrical  field  to prevent disintegration.  Fixed
  476. X        knives are treated for storage.  All are about  20  centime-
  477. X        ters long.
  478. X                          [ Dune, by Frank Herbert ]
  479. Xwizard of yendor
  480. X        No  one knows how old this mighty wizard is,  or from whence
  481. X        he came.  It is known that,  having lived a span far greater
  482. X        than any normal man's, he grew weary of lesser mortals;  and
  483. X        so, spurning all human company,  he forsook the dwellings of
  484. X        men  and  went to live in the depths of the  Earth.  He took
  485. X        with him the mystical artifact, the Amulet of Yendor,  which
  486. X        is said to hold great power indeed. Many have sought to find
  487. X        the  wizard and  his treasure,  but none have found  him and
  488. X        lived to tell the tale.  Woe be to the incautious adventurer
  489. X        who disturbs this mighty sorcerer!
  490. Xxan
  491. X        They sent their friend the mosquito [xan] ahead of  them  to
  492. X        find  out  what lay ahead.  "Since you are the one who sucks
  493. X        the blood of men walking along paths," they told the mosqui-
  494. X        to,  "go  and  sting the men of Xibalba."  The mosquito flew
  495. X        down the dark road to the Underworld.  Entering the house of
  496. X        the Lords of Death, he stung the first person that he saw...
  497. X    
  498. X        The mosquito stung this man as well, and when he yelled, the
  499. X        man  next  to him asked, "Gathered Blood, what's wrong?"  So
  500. X        he flew along the row stinging all the seated men  until  he
  501. X        knew the names of all twelve.
  502. X                [ Popul Vuh, as translated by Ralph Nelson ]
  503. X*zombie
  504. X        The zombi...  is a soulless human corpse,  still  dead,  but
  505. X        taken    from  the  grave  and  endowed    by  sorcery  with  a
  506. X        mechanical semblance of life, --  it is a dead body which is
  507. X        made to walk and act and move as if it were alive.
  508. X                              [ W. B. Seabrook ]
  509. Xzruty
  510. X        The zruty are  wild and gigantic beings,  living in the wil-
  511. X        dernesses of the Tatra mountains.
  512. END_OF_FILE
  513. if test 22782 -ne `wc -c <'auxil/data.base'`; then
  514.     echo shar: \"'auxil/data.base'\" unpacked with wrong size!
  515. fi
  516. # end of 'auxil/data.base'
  517. fi
  518. if test -f 'src/lev_comp.c' -a "${1}" != "-c" ; then 
  519.   echo shar: Will not clobber existing file \"'src/lev_comp.c'\"
  520. else
  521. echo shar: Extracting \"'src/lev_comp.c'\" \(33297 characters\)
  522. sed "s/^X//" >'src/lev_comp.c' <<'END_OF_FILE'
  523. X
  524. X# line 1 "lev_comp.y"
  525. X/*    SCCS Id: @(#)lev_comp.c    3.0    90/01/03
  526. X/*    Copyright (c) 1989 by Jean-Christophe Collet */
  527. X/* NetHack may be freely redistributed.  See license for details. */
  528. X
  529. X/*
  530. X * This file contains the Level Compiler code
  531. X * It may handle special mazes & special room-levels
  532. X */
  533. X
  534. X/* block some unused #defines to avoid overloading some cpp's */
  535. X#define MONDATA_H    /* comment line for pre-compiled headers */
  536. X#define MONFLAG_H    /* comment line for pre-compiled headers */
  537. X
  538. X#include "hack.h"
  539. X#include "sp_lev.h"
  540. X#ifndef O_WRONLY
  541. X# include <fcntl.h>
  542. X#endif
  543. X#ifndef O_CREAT    /* some older BSD systems do not define O_CREAT in <fcntl.h> */
  544. X# include <sys/file.h>
  545. X#endif
  546. X
  547. Xvoid FDECL(yyerror, (char *));
  548. Xvoid FDECL(yywarning, (char *));
  549. Xint NDECL(yylex);
  550. Xint NDECL(yyparse);
  551. X
  552. Xint FDECL(get_room_type, (char *));
  553. Xint FDECL(get_trap_type, (char *));
  554. Xint FDECL(get_monster_id, (char *, CHAR_P));
  555. Xint FDECL(get_object_id, (char *, CHAR_P));
  556. Xboolean FDECL(check_monster_char, (CHAR_P));
  557. Xboolean FDECL(check_object_char, (CHAR_P));
  558. Xvoid FDECL(scan_map, (char *));
  559. Xvoid NDECL(store_part);
  560. Xvoid FDECL(write_maze, (int, specialmaze *));
  561. X
  562. X#ifdef AMIGA
  563. Xchar *fgets();
  564. X# undef     fopen
  565. X# undef     printf
  566. X# undef     Printf
  567. X# define    Printf  printf
  568. X#ifndef    LATTICE
  569. X# define    memset(addr,val,len)    setmem(addr,len,val)
  570. X#endif
  571. X#endif
  572. X
  573. X#ifdef MSDOS
  574. X# undef exit
  575. Xextern void FDECL(exit, (int));
  576. X#endif
  577. X
  578. X#ifdef MACOS
  579. X# undef printf
  580. X# undef Printf
  581. X# define Printf printf
  582. X#endif
  583. X
  584. X#undef NULL
  585. X
  586. X#define MAX_REGISTERS    10
  587. X#define ERR        (-1)
  588. X
  589. Xstruct reg {
  590. X    int x1, y1;
  591. X    int x2, y2;
  592. X}        current_region;
  593. X
  594. Xstruct coord {
  595. X    int x;
  596. X    int y;
  597. X}        current_coord;
  598. X
  599. Xstruct {
  600. X    char *name;
  601. X    short type;
  602. X} trap_types[TRAPNUM-1] = {
  603. X    "monster",    MONST_TRAP,
  604. X    "statue",    STATUE_TRAP,
  605. X    "bear",        BEAR_TRAP,
  606. X    "arrow",    ARROW_TRAP,
  607. X    "dart",        DART_TRAP,
  608. X    "trapdoor",    TRAPDOOR,
  609. X    "teleport",    TELEP_TRAP,
  610. X    "pit",        PIT,
  611. X    "sleep gas",    SLP_GAS_TRAP,
  612. X    "magic",    MGTRP,
  613. X    "board",    SQBRD,
  614. X    "web",        WEB,
  615. X    "spiked pit",    SPIKED_PIT,
  616. X    "level teleport",LEVEL_TELEP,
  617. X#ifdef SPELLS
  618. X    "anti magic",    ANTI_MAGIC,
  619. X#endif
  620. X    "rust",        RUST_TRAP
  621. X#ifdef POLYSELF
  622. X    , "polymorph",    POLY_TRAP
  623. X#endif
  624. X#ifdef ARMY
  625. X    , "land mine",    LANDMINE
  626. X#endif
  627. X  };
  628. X
  629. Xstruct {
  630. X    char *name;
  631. X    int type;
  632. X} room_types[SHOPBASE-1] = {
  633. X    /* for historical reasons, room types are not contiguous numbers */
  634. X    /* (type 1 is skipped) */
  635. X    "ordinary",    OROOM,
  636. X#ifdef THRONES
  637. X    "throne",    COURT,
  638. X#endif
  639. X    "swamp",    SWAMP,
  640. X    "vault",    VAULT,
  641. X    "beehive",    BEEHIVE,
  642. X    "morgue",    MORGUE,
  643. X#ifdef ARMY
  644. X    "barracks",    BARRACKS,
  645. X#endif
  646. X    "zoo",        ZOO,
  647. X    "temple",    TEMPLE,
  648. X    "shop",        SHOPBASE,
  649. X};
  650. X
  651. Xshort db_dirs[4] = {
  652. X    DB_NORTH,
  653. X    DB_EAST,
  654. X    DB_SOUTH,
  655. X    DB_WEST
  656. X};
  657. X
  658. X#ifdef ALTARS
  659. Xstatic altar *tmpaltar[256];
  660. X#endif /* ALTARS /**/
  661. Xstatic lad *tmplad[256];
  662. Xstatic digpos *tmpdig[256];
  663. Xstatic char *tmpmap[ROWNO];
  664. Xstatic region *tmpreg[16];
  665. Xstatic door *tmpdoor[256];
  666. Xstatic trap *tmptrap[256];
  667. Xstatic monster *tmpmonst[256];
  668. Xstatic object *tmpobj[256];
  669. Xstatic drawbridge *tmpdb[256];
  670. Xstatic walk *tmpwalk[256];
  671. Xstatic mazepart *tmppart[10];
  672. Xstatic room *tmproom[MAXNROFROOMS];
  673. Xstatic specialmaze maze;
  674. X
  675. Xstatic char olist[MAX_REGISTERS], mlist[MAX_REGISTERS];
  676. Xstatic struct coord plist[MAX_REGISTERS];
  677. Xstatic int n_olist = 0, n_mlist = 0, n_plist = 0;
  678. X
  679. Xunsigned int nreg = 0, ndoor = 0, ntrap = 0, nmons = 0, nobj = 0;
  680. Xunsigned int ndb = 0, nwalk = 0, npart = 0, ndig = 0, nlad = 0;
  681. X#ifdef ALTARS
  682. Xunsigned int naltar = 0;
  683. X#endif /* ALTARS /*/
  684. X
  685. Xunsigned int max_x_map, max_y_map;
  686. X
  687. Xextern int fatal_error;
  688. Xextern char* fname;
  689. X
  690. X
  691. X# line 169 "lev_comp.y"
  692. Xtypedef union 
  693. X{
  694. X    int    i;
  695. X    char*    map;
  696. X} YYSTYPE;
  697. X# define CHAR 257
  698. X# define INTEGER 258
  699. X# define MAZE_ID 259
  700. X# define LEVEL_ID 260
  701. X# define GEOMETRY_ID 261
  702. X# define OBJECT_ID 262
  703. X# define MONSTER_ID 263
  704. X# define TRAP_ID 264
  705. X# define DOOR_ID 265
  706. X# define DRAWBRIDGE_ID 266
  707. X# define MAZEWALK_ID 267
  708. X# define REGION_ID 268
  709. X# define RANDOM_OBJECTS_ID 269
  710. X# define RANDOM_MONSTERS_ID 270
  711. X# define RANDOM_PLACES_ID 271
  712. X# define ALTAR_ID 272
  713. X# define LADDER_ID 273
  714. X# define NON_DIGGABLE_ID 274
  715. X# define ROOM_ID 275
  716. X# define DOOR_STATE 276
  717. X# define LIGHT_STATE 277
  718. X# define DIRECTION 278
  719. X# define RANDOM_TYPE 279
  720. X# define O_REGISTER 280
  721. X# define M_REGISTER 281
  722. X# define P_REGISTER 282
  723. X# define A_REGISTER 283
  724. X# define ALIGNMENT 284
  725. X# define LEFT_OR_RIGHT 285
  726. X# define CENTER 286
  727. X# define TOP_OR_BOT 287
  728. X# define ALTAR_TYPE 288
  729. X# define UP_OR_DOWN 289
  730. X# define STRING 290
  731. X# define MAP_ID 291
  732. X#define yyclearin yychar = -1
  733. X#define yyerrok yyerrflag = 0
  734. Xextern int yychar;
  735. Xextern short yyerrflag;
  736. X#ifndef YYMAXDEPTH
  737. X#define YYMAXDEPTH 150
  738. X#endif
  739. XYYSTYPE yylval, yyval;
  740. X# define YYERRCODE 256
  741. X
  742. X# line 654 "lev_comp.y"
  743. X
  744. X
  745. X/* 
  746. X * Find the type of a room in the table, knowing its name.
  747. X */
  748. X
  749. Xint
  750. Xget_room_type(s)
  751. Xchar *s;
  752. X{
  753. X    register int i;
  754. X    
  755. X    for(i=0; i < SHOPBASE -1; i++)
  756. X        if (!strcmp(s, room_types[i].name))
  757. X        return ((int) room_types[i].type);
  758. X    return ERR;
  759. X}
  760. X
  761. X/* 
  762. X * Find the type of a trap in the table, knowing its name.
  763. X */
  764. X
  765. Xint
  766. Xget_trap_type(s)
  767. Xchar *s;
  768. X{
  769. X    register int i;
  770. X    
  771. X    for(i=0; i < TRAPNUM - 1; i++)
  772. X        if(!strcmp(s,trap_types[i].name))
  773. X        return((int)trap_types[i].type);
  774. X    return ERR;
  775. X}
  776. X
  777. X/* 
  778. X * Find the index of a monster in the table, knowing its name.
  779. X */
  780. X
  781. Xint
  782. Xget_monster_id(s, c)
  783. Xchar *s;
  784. Xchar c;
  785. X{
  786. X    register int i;
  787. X    
  788. X    for(i=0; mons[i].mname[0]; i++)
  789. X        if(!strncmp(s, mons[i].mname, strlen(mons[i].mname))
  790. X           && c == mons[i].mlet)
  791. X        return i;
  792. X    return ERR;
  793. X}
  794. X
  795. X/* 
  796. X * Find the index of an object in the table, knowing its name.
  797. X */
  798. X
  799. Xint
  800. Xget_object_id(s, c)
  801. Xchar *s;
  802. Xchar c;
  803. X{
  804. X    register int i;
  805. X    
  806. X    for(i=0; i<=NROFOBJECTS;i++)
  807. X        if(objects[i].oc_name &&
  808. X           !strncmp(s, objects[i].oc_name, strlen(objects[i].oc_name))
  809. X           && c == objects[i].oc_olet)
  810. X        return i;
  811. X    return ERR;
  812. X}
  813. X
  814. X/* 
  815. X * Is the character 'c' a valid monster class ?
  816. X */
  817. X
  818. Xboolean
  819. Xcheck_monster_char(c)
  820. Xchar c;
  821. X{
  822. X    register int i;
  823. X    
  824. X    for(i=0; mons[i].mname[0]; i++)
  825. X        if( c ==  mons[i].mlet)
  826. X        return 1;
  827. X    return(0);
  828. X}
  829. X
  830. X/* 
  831. X * Is the character 'c' a valid object class ?
  832. X */
  833. X
  834. Xboolean
  835. Xcheck_object_char(c)
  836. Xchar c;
  837. X{
  838. X    register int i;
  839. X    
  840. X    for(i=0; i<=NROFOBJECTS;i++)
  841. X        if( c == objects[i].oc_olet)
  842. X        return 1;
  843. X    return 0;
  844. X}
  845. X
  846. X/* 
  847. X * Yep! LEX gives us the map in a raw mode.
  848. X * Just analyze it here.
  849. X */
  850. X
  851. Xvoid scan_map(map)
  852. Xchar *map;
  853. X{
  854. X    register int i, len;
  855. X    register char *s1, *s2;
  856. X    int max_len = 0;
  857. X    int max_hig = 0;
  858. X    
  859. X    /* First : find the max width of the map */
  860. X
  861. X    s1 = map;
  862. X    while (s1 && *s1) {
  863. X        s2 = index(s1, '\n');
  864. X        if (s2) {
  865. X            if (s2-s1 > max_len)
  866. X                max_len = s2-s1;
  867. X            s1 = s2 + 1;
  868. X        } else {
  869. X            if (strlen(s1) > max_len)
  870. X                max_len = strlen(s1);
  871. X            s1 = (char *) 0;
  872. X        }
  873. X    }
  874. X
  875. X    /* Then parse it now */
  876. X
  877. X    while (map && *map) {
  878. X        tmpmap[max_hig] = (char *) alloc(max_len);
  879. X        s1 = index(map, '\n');
  880. X        if (s1) {
  881. X            len = s1 - map;
  882. X            s1++;
  883. X        } else {
  884. X            len = strlen(map);
  885. X            s1 = map + len;
  886. X        }
  887. X        for(i=0; i<len; i++)
  888. X            switch(map[i]) {
  889. X              case '-' : tmpmap[max_hig][i] = HWALL; break;
  890. X              case '|' : tmpmap[max_hig][i] = VWALL; break;
  891. X              case '+' : tmpmap[max_hig][i] = DOOR; break;
  892. X              case 'S' : tmpmap[max_hig][i] = SDOOR; break;
  893. X              case '{' : 
  894. X#ifdef FOUNTAINS
  895. X                  tmpmap[max_hig][i] = FOUNTAIN;
  896. X#else
  897. X                  tmpmap[max_hig][i] = ROOM;
  898. X                  yywarning("Fountains are not allowed in this version!  Ignoring...");
  899. X#endif
  900. X                  break;
  901. X              case '\\' : 
  902. X#ifdef THRONES
  903. X                  tmpmap[max_hig][i] = THRONE;
  904. X#else
  905. X                  tmpmap[max_hig][i] = ROOM;
  906. X                  yywarning("Thrones are not allowed in this version!  Ignoring...");
  907. X#endif
  908. X                  break;
  909. X              case 'K' : 
  910. X#ifdef SINKS
  911. X                  tmpmap[max_hig][i] = SINK;
  912. X#else
  913. X                  tmpmap[max_hig][i] = ROOM;
  914. X                  yywarning("Sinks are not allowed in this version!  Ignoring...");
  915. X#endif
  916. X                  break;
  917. X              case '}' : tmpmap[max_hig][i] = MOAT; break;
  918. X              case '#' : tmpmap[max_hig][i] = CORR; break;
  919. X              default  : tmpmap[max_hig][i] = ROOM; break;
  920. X            }
  921. X        while(i < max_len)
  922. X            tmpmap[max_hig][i++] = ROOM;
  923. X        map = s1;
  924. X        max_hig++;
  925. X    }
  926. X
  927. X    /* Memorize boundaries */
  928. X
  929. X    max_x_map = max_len - 1;
  930. X    max_y_map = max_hig - 1;
  931. X
  932. X    /* Store the map into the mazepart structure */
  933. X
  934. X    tmppart[npart]->xsize = max_len;
  935. X    tmppart[npart]->ysize = max_hig;
  936. X    tmppart[npart]->map = (char **) alloc(max_hig*sizeof(char *));
  937. X    for(i = 0; i< max_hig; i++)
  938. X        tmppart[npart]->map[i] = tmpmap[i];
  939. X}
  940. X
  941. X/* 
  942. X * Here we want to store the maze part we just got.
  943. X */
  944. X
  945. Xvoid
  946. Xstore_part()
  947. X{
  948. X    register int i;
  949. X
  950. X    /* Ok, We got the whole part, now we store it. */
  951. X    
  952. X    /* The Regions */
  953. X
  954. X    if(tmppart[npart]->nreg = nreg) {
  955. X        tmppart[npart]->regions = (region**)alloc(sizeof(region*) * nreg);
  956. X        for(i=0;i<nreg;i++)
  957. X            tmppart[npart]->regions[i] = tmpreg[i];
  958. X    }
  959. X    nreg = 0;
  960. X
  961. X    /* the doors */
  962. X
  963. X    if(tmppart[npart]->ndoor = ndoor) {
  964. X        tmppart[npart]->doors = (door **)alloc(sizeof(door *) * ndoor);
  965. X        for(i=0;i<ndoor;i++)
  966. X            tmppart[npart]->doors[i] = tmpdoor[i];
  967. X    }
  968. X    ndoor = 0;
  969. X
  970. X    /* the traps */
  971. X
  972. X    if(tmppart[npart]->ntraps = ntrap) {
  973. X        tmppart[npart]->traps = (trap **)alloc(sizeof(trap*) * ntrap);
  974. X        for(i=0;i<ntrap;i++)
  975. X            tmppart[npart]->traps[i] = tmptrap[i];
  976. X    }
  977. X    ntrap = 0;
  978. X
  979. X    /* the monsters */
  980. X
  981. X    if(tmppart[npart]->nmonster = nmons) {
  982. X        tmppart[npart]->monsters = (monster**)alloc(sizeof(monster*)*nmons);
  983. X        for(i=0;i<nmons;i++)
  984. X            tmppart[npart]->monsters[i] = tmpmonst[i];
  985. X    }
  986. X    nmons = 0;
  987. X
  988. X    /* the objects */
  989. X
  990. X    if(tmppart[npart]->nobjects = nobj) {
  991. X        tmppart[npart]->objects = (object**)alloc(sizeof(object*)*nobj);
  992. X        for(i=0;i<nobj;i++)
  993. X            tmppart[npart]->objects[i] = tmpobj[i];
  994. X    }
  995. X    nobj = 0;
  996. X
  997. X    /* the drawbridges */
  998. X
  999. X    if(tmppart[npart]->ndrawbridge = ndb) {
  1000. X        tmppart[npart]->drawbridges = (drawbridge**)alloc(sizeof(drawbridge*)*ndb);
  1001. X        for(i=0;i<ndb;i++)
  1002. X            tmppart[npart]->drawbridges[i] = tmpdb[i];
  1003. X    }
  1004. X    ndb = 0;
  1005. X
  1006. X    /* The walkmaze directives */
  1007. X
  1008. X    if(tmppart[npart]->nwalk = nwalk) {
  1009. X        tmppart[npart]->walks = (walk**)alloc(sizeof(walk*)*nwalk);
  1010. X        for(i=0;i<nwalk;i++)
  1011. X            tmppart[npart]->walks[i] = tmpwalk[i];
  1012. X    }
  1013. X    nwalk = 0;
  1014. X
  1015. X    /* The non_diggable directives */
  1016. X
  1017. X    if(tmppart[npart]->ndig = ndig) {
  1018. X        tmppart[npart]->digs = (digpos **) alloc(sizeof(digpos*) * ndig);
  1019. X        for(i=0;i<ndig;i++)
  1020. X            tmppart[npart]->digs[i] = tmpdig[i];
  1021. X    }
  1022. X    ndig = 0;
  1023. X
  1024. X    /* The ladders */
  1025. X
  1026. X    if(tmppart[npart]->nlad = nlad) {
  1027. X        tmppart[npart]->lads = (lad **) alloc(sizeof(lad*) * nlad);
  1028. X        for(i=0;i<nlad;i++)
  1029. X            tmppart[npart]->lads[i] = tmplad[i];
  1030. X    }
  1031. X    nlad = 0;
  1032. X#ifdef ALTARS
  1033. X    /* The altars */
  1034. X
  1035. X    if(tmppart[npart]->naltar = naltar) {
  1036. X        tmppart[npart]->altars = (altar**)alloc(sizeof(altar*) * naltar);
  1037. X        for(i=0;i<naltar;i++)
  1038. X            tmppart[npart]->altars[i] = tmpaltar[i];
  1039. X    }
  1040. X    naltar = 0;
  1041. X#endif /* ALTARS /**/
  1042. X    npart++;
  1043. X    n_plist = n_mlist = n_olist = 0;
  1044. X}
  1045. X
  1046. X/* 
  1047. X * Here we write the structure of the maze in the specified file (fd).
  1048. X * Also, we have to free the memory allocated via alloc()
  1049. X */
  1050. X
  1051. Xvoid
  1052. Xwrite_maze(fd, maze)
  1053. Xint fd;
  1054. Xspecialmaze *maze;
  1055. X{
  1056. X    char c;
  1057. X    short i,j;
  1058. X    mazepart *pt;
  1059. X
  1060. X    c = 2;
  1061. X    (void) write(fd, &c, 1);    /* Header for special mazes */
  1062. X    (void) write(fd, &(maze->numpart), 1);    /* Number of parts */
  1063. X    for(i=0;i<maze->numpart;i++) {
  1064. X        pt = maze->parts[i];
  1065. X
  1066. X        /* First, write the map */
  1067. X
  1068. X        (void) write(fd, &(pt->halign), 1);
  1069. X        (void) write(fd, &(pt->valign), 1);
  1070. X        (void) write(fd, &(pt->xsize), 1);
  1071. X        (void) write(fd, &(pt->ysize), 1);
  1072. X        for(j=0;j<pt->ysize;j++) {
  1073. X            (void) write(fd, pt->map[j], pt->xsize);
  1074. X            free(pt->map[j]);
  1075. X        }
  1076. X        free(pt->map);
  1077. X
  1078. X        /* The random registers */
  1079. X        (void) write(fd, &(pt->nrobjects), 1);
  1080. X        if(pt->nrobjects) {
  1081. X            (void) write(fd, pt->robjects, pt->nrobjects);
  1082. X            free(pt->robjects);
  1083. X        }
  1084. X        (void) write(fd, &(pt->nloc), 1);
  1085. X        if(pt->nloc) {
  1086. X        (void) write(fd,pt->rloc_x, pt->nloc);
  1087. X        (void) write(fd,pt->rloc_y, pt->nloc);
  1088. X        free(pt->rloc_x);
  1089. X        free(pt->rloc_y);
  1090. X        }
  1091. X        (void) write(fd,&(pt->nrmonst), 1);
  1092. X        if(pt->nrmonst) {
  1093. X            (void) write(fd, pt->rmonst, pt->nrmonst);
  1094. X            free(pt->rmonst);
  1095. X        }
  1096. X
  1097. X        /* subrooms */
  1098. X        (void) write(fd, &(pt->nreg), 1);
  1099. X        for(j=0;j<pt->nreg;j++) {
  1100. X            (void) write(fd,(genericptr_t) pt->regions[j], sizeof(region));
  1101. X            free(pt->regions[j]);
  1102. X        }
  1103. X        if(pt->nreg > 0)
  1104. X        free(pt->regions);
  1105. X
  1106. X        /* the doors */
  1107. X        (void) write(fd,&(pt->ndoor),1);
  1108. X        for(j=0;j<pt->ndoor;j++) {
  1109. X            (void) write(fd,(genericptr_t) pt->doors[j], sizeof(door));
  1110. X            free(pt->doors[j]);
  1111. X        }
  1112. X        if (pt->ndoor > 0)
  1113. X        free(pt->doors);
  1114. X
  1115. X        /* The traps */
  1116. X        (void) write(fd,&(pt->ntraps), 1);
  1117. X        for(j=0;j<pt->ntraps;j++) {
  1118. X            (void) write(fd,(genericptr_t) pt->traps[j], sizeof(trap));
  1119. X            free(pt->traps[j]);
  1120. X        }
  1121. X        if (pt->ntraps)
  1122. X        free(pt->traps);
  1123. X
  1124. X        /* The monsters */
  1125. X        (void) write(fd, &(pt->nmonster), 1);
  1126. X        for(j=0;j<pt->nmonster;j++) {
  1127. X            (void) write(fd,(genericptr_t) pt->monsters[j], sizeof(monster));
  1128. X            free(pt->monsters[j]);
  1129. X        }
  1130. X        if (pt->nmonster > 0)
  1131. X        free(pt->monsters);
  1132. X
  1133. X        /* The objects */
  1134. X        (void) write(fd, &(pt->nobjects), 1);
  1135. X        for(j=0;j<pt->nobjects;j++) {
  1136. X            (void) write(fd,(genericptr_t) pt->objects[j], sizeof(object));
  1137. X            free(pt->objects[j]);
  1138. X        }
  1139. X        if(pt->nobjects > 0)
  1140. X        free(pt->objects);
  1141. X
  1142. X        /* The drawbridges */
  1143. X        (void) write(fd, &(pt->ndrawbridge),1);
  1144. X        for(j=0;j<pt->ndrawbridge;j++) {
  1145. X            (void) write(fd,(genericptr_t) pt->drawbridges[j], sizeof(drawbridge));
  1146. X            free(pt->drawbridges[j]);
  1147. X        }
  1148. X        if(pt->ndrawbridge > 0)
  1149. X        free(pt->drawbridges);
  1150. X
  1151. X        /* The mazewalk directives */
  1152. X        (void) write(fd, &(pt->nwalk), 1);
  1153. X        for(j=0; j<pt->nwalk; j++) {
  1154. X            (void) write(fd,(genericptr_t) pt->walks[j], sizeof(walk));
  1155. X            free(pt->walks[j]);
  1156. X        }
  1157. X        if (pt->nwalk > 0)
  1158. X        free(pt->walks);
  1159. X
  1160. X        /* The non_diggable directives */
  1161. X        (void) write(fd, &(pt->ndig), 1);
  1162. X        for(j=0;j<pt->ndig;j++) {
  1163. X            (void) write(fd,(genericptr_t) pt->digs[j], sizeof(digpos));
  1164. X            free(pt->digs[j]);
  1165. X        }
  1166. X        if (pt->ndig > 0)
  1167. X        free(pt->digs);
  1168. X
  1169. X        /* The ladders */
  1170. X        (void) write(fd, &(pt->nlad), 1);
  1171. X        for(j=0;j<pt->nlad;j++) {
  1172. X            (void) write(fd,(genericptr_t) pt->lads[j], sizeof(lad));
  1173. X            free(pt->lads[j]);
  1174. X        }
  1175. X        if (pt->nlad > 0)
  1176. X        free(pt->lads);
  1177. X#ifdef ALTARS
  1178. X        /* The altars */
  1179. X        (void) write(fd, &(pt->naltar), 1);
  1180. X        for(j=0;j<pt->naltar;j++) {
  1181. X            (void) write(fd,(genericptr_t) pt->altars[j], sizeof(altar));
  1182. X            free(pt->altars[j]);
  1183. X        }
  1184. X        if (pt->naltar > 0)
  1185. X        free(pt->altars);
  1186. X#endif /* ALTARS /**/
  1187. X        free(pt);
  1188. X    }
  1189. X}
  1190. Xshort yyexca[] ={
  1191. X-1, 1,
  1192. X    0, -1,
  1193. X    -2, 0,
  1194. X-1, 67,
  1195. X    44, 27,
  1196. X    -2, 26,
  1197. X    };
  1198. X# define YYNPROD 87
  1199. X# define YYLAST 251
  1200. Xshort yyact[]={
  1201. X
  1202. X 165, 130, 126,  91,  16,  19, 169, 146,  69,  72,
  1203. X 145,  19,  19,  19,  19, 168,  75,  74,  26,  27,
  1204. X 143, 137,  12, 138, 144, 141,  65,  87, 134,   6,
  1205. X  88,  78, 174,  80,  40,  39,  42,  41,  43,  46,
  1206. X  44, 171, 170, 156,  45,  47,  48, 148,  83,  85,
  1207. X  22,  24,  23, 135, 131, 127, 116, 105,  72,  65,
  1208. X  18,  92,  93,  86,  66,  70, 172,  63, 154, 152,
  1209. X 150, 158, 114, 110, 108,  97,  62,  61,  60,  59,
  1210. X  58,  57,  56,  55,  54,  53,  51,  50,  49,  17,
  1211. X  13,  64, 173,  71, 166, 157, 155, 153, 151, 149,
  1212. X 139, 122, 121, 119, 118, 117, 115, 113, 112, 111,
  1213. X 109, 107, 106,  68, 103,  52, 175,  90, 159,  69,
  1214. X  98,  99, 100, 101,   8,   2,  94,  84,  79,   7,
  1215. X  81,  76,  38,  37,  14,  36,  35,  34, 102,  33,
  1216. X  32,  31,  30,  29,  28, 104,  82,  77,  67,  21,
  1217. X  11,  20,  15,  10,   9,   4,   3,   1, 128, 124,
  1218. X   5, 142, 167, 140, 136, 163,  89,  73, 125,  25,
  1219. X 129, 120, 123, 132, 133,   0,   0,   0,   0,   0,
  1220. X   0,   0,   0,   0,  68,   0, 147,   0,   0,   0,
  1221. X   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  1222. X   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  1223. X   0, 160,   0, 161,   0,   0, 164, 162,   0,   0,
  1224. X   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  1225. X   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  1226. X   0,   0,   0,   0,   0,   0,   0,  95,   0,   0,
  1227. X  96 };
  1228. Xshort yypact[]={
  1229. X
  1230. X-230,-1000,-1000,-230,-1000,-239,  32,-1000,-1000,-239,
  1231. X-1000,-287,  31,-285,-1000,-219,-1000,-267,-1000,-1000,
  1232. X-228,-1000,  30,  29,  28,  71,-1000,-1000,-1000,-1000,
  1233. X-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,  27,
  1234. X  26,  25,  24,  23,  22,  21,  20,  19,  18,-198,
  1235. X  79,-199,-270,-248,-231,-249,-276, -32,  80, -32,
  1236. X -32, -32,  80,-1000,  70,-1000,-1000,-1000,-1000,-201,
  1237. X-1000,  68,-1000,-1000,-1000,-1000,  67,-1000,-1000,-1000,
  1238. X -17,  66,-1000,-1000,-1000, -18,  65,-1000,-1000,  64,
  1239. X-1000,-1000,  63,-1000,-1000,-1000, -19,  62,-202,  61,
  1240. X  60,  59,-1000,-198,  58,  57,-199,-277,-203,-278,
  1241. X-204, -32, -32,-250,-205,-256,  56,-259,-268,-282,
  1242. X-1000,  79,-211,-1000,  55,-1000,-1000, -23,  54,-1000,
  1243. X-1000, -24,-1000,-1000,  53, -25,  52,-1000,-1000,-215,
  1244. X  51,-1000,-1000,-1000, -20,-1000,-1000,-1000,  77, -32,
  1245. X-1000, -32,-1000,-249,-1000,-279,  50,-273,-216,-1000,
  1246. X-1000,-1000,-1000,-1000,-1000,-1000,-217,-1000,-1000,-1000,
  1247. X -27,  48,-1000,-226,  75,-1000 };
  1248. Xshort yypgo[]={
  1249. X
  1250. X   0, 169, 167, 166, 165,  63, 164, 163, 162, 161,
  1251. X  60, 160, 159, 158, 157, 125, 156, 155, 124, 154,
  1252. X 153, 152, 151, 150, 149,  67,  64,  65,  91,  93,
  1253. X 148, 145, 144, 143, 142, 141, 140, 139, 137, 136,
  1254. X 135, 133, 132, 131,  61, 130,  75, 128, 127,  62,
  1255. X 126 };
  1256. Xshort yyr1[]={
  1257. X
  1258. X   0,  14,  14,  15,  15,  16,  17,  11,  18,  18,
  1259. X  19,  20,  23,   1,   1,   2,   2,  21,  21,  24,
  1260. X  24,  24,  25,  25,  27,  27,  26,  31,  26,  22,
  1261. X  22,  32,  32,  32,  32,  32,  32,  32,  32,  32,
  1262. X  32,  33,  34,  35,  36,  37,  40,  41,  42,  38,
  1263. X  39,  43,  43,  43,  45,  45,  45,  12,  12,  13,
  1264. X  13,   3,   3,   4,   4,  44,  44,  44,   5,   5,
  1265. X   6,   6,   7,   7,   7,   8,   8,  50,  48,  47,
  1266. X   9,  30,  29,  28,  10,  49,  46 };
  1267. Xshort yyr2[]={
  1268. X
  1269. X   0,   0,   1,   1,   2,   1,   2,   3,   1,   2,
  1270. X   3,   2,   5,   1,   1,   1,   1,   0,   2,   3,
  1271. X   3,   3,   1,   3,   1,   3,   1,   0,   4,   0,
  1272. X   2,   1,   1,   1,   1,   1,   1,   1,   1,   1,
  1273. X   1,   7,   7,   5,   5,   7,   5,   5,   3,   7,
  1274. X   7,   1,   1,   1,   1,   1,   1,   1,   1,   1,
  1275. X   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
  1276. X   1,   1,   1,   1,   1,   1,   1,   4,   4,   4,
  1277. X   4,   1,   1,   1,   1,   5,   9 };
  1278. Xshort yychk[]={
  1279. X
  1280. X-1000, -14, -15, -16, -17, -11, 259, -15, -18, -19,
  1281. X -20, -23, 261,  58, -18, -21, 291,  58, -10, 290,
  1282. X -22, -24, 269, 271, 270,  -1, 285, 286, -32, -33,
  1283. X -34, -35, -36, -37, -38, -39, -40, -41, -42, 263,
  1284. X 262, 265, 264, 266, 268, 272, 267, 273, 274,  58,
  1285. X  58,  58,  44,  58,  58,  58,  58,  58,  58,  58,
  1286. X  58,  58,  58, -25, -28, 257, -26, -30, -49,  40,
  1287. X -27, -29, 257,  -2, 287, 286, -43, -29, 279, -47,
  1288. X 281, -45, -28, 279, -48, 280,  -5, 276, 279,  -3,
  1289. X -10, 279, -44, -49, -50, 279, 282, -46,  40, -44,
  1290. X -44, -44, -46,  44, -31, 258,  44,  44,  91,  44,
  1291. X  91,  44,  44,  44,  91,  44, 258,  44,  44,  44,
  1292. X -25,  44,  44, -27, -12, -10, 279, 258, -13, -10,
  1293. X 279, 258, -44, -44, 278, 258,  -6, 277, 279,  44,
  1294. X  -7, 284,  -9, 279, 283, 278, 289, -26, 258,  44,
  1295. X  93,  44,  93,  44,  93,  44, 258,  44,  91,  41,
  1296. X -44, -44,  -5,  -4, -10, 279,  44,  -8, 288, 279,
  1297. X 258, 258,  93,  44, 258,  41 };
  1298. Xshort yydef[]={
  1299. X
  1300. X   1,  -2,   2,   3,   5,   0,   0,   4,   6,   8,
  1301. X  17,   0,   0,   0,   9,  29,  11,   0,   7,  84,
  1302. X  10,  18,   0,   0,   0,   0,  13,  14,  30,  31,
  1303. X  32,  33,  34,  35,  36,  37,  38,  39,  40,   0,
  1304. X   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  1305. X   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  1306. X   0,   0,   0,  19,  22,  83,  20,  -2,  81,   0,
  1307. X  21,  24,  82,  12,  15,  16,   0,  51,  52,  53,
  1308. X   0,   0,  54,  55,  56,   0,   0,  68,  69,   0,
  1309. X  61,  62,   0,  65,  66,  67,   0,   0,   0,   0,
  1310. X   0,   0,  48,   0,   0,   0,   0,   0,   0,   0,
  1311. X   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  1312. X  23,   0,   0,  25,   0,  57,  58,   0,   0,  59,
  1313. X  60,   0,  43,  44,   0,   0,   0,  70,  71,   0,
  1314. X   0,  72,  73,  74,   0,  46,  47,  28,   0,   0,
  1315. X  79,   0,  78,   0,  77,   0,   0,   0,   0,  85,
  1316. X  41,  42,  45,  49,  63,  64,   0,  50,  75,  76,
  1317. X   0,   0,  80,   0,   0,  86 };
  1318. X#ifndef lint
  1319. Xstatic char yaccpar_sccsid[] = "@(#)yaccpar    4.1    (Berkeley)    2/11/83";
  1320. X#endif not lint
  1321. X
  1322. X#
  1323. X# define YYFLAG -1000
  1324. X# define YYERROR goto yyerrlab
  1325. X# define YYACCEPT return(0)
  1326. X# define YYABORT return(1)
  1327. X
  1328. X/*    parser for yacc output    */
  1329. X
  1330. X#ifdef YYDEBUG
  1331. Xint yydebug = 0; /* 1 for debugging */
  1332. X#endif
  1333. XYYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
  1334. Xint yychar = -1; /* current input token number */
  1335. Xint yynerrs = 0;  /* number of errors */
  1336. Xshort yyerrflag = 0;  /* error recovery flag */
  1337. X
  1338. Xyyparse() {
  1339. X
  1340. X    short yys[YYMAXDEPTH];
  1341. X    short yyj, yym;
  1342. X    register YYSTYPE *yypvt;
  1343. X    register short yystate, *yyps, yyn;
  1344. X    register YYSTYPE *yypv;
  1345. X    register short *yyxi;
  1346. X
  1347. X    yystate = 0;
  1348. X    yychar = -1;
  1349. X    yynerrs = 0;
  1350. X    yyerrflag = 0;
  1351. X    yyps= &yys[-1];
  1352. X    yypv= &yyv[-1];
  1353. X
  1354. X yystack:    /* put a state and value onto the stack */
  1355. X
  1356. X#ifdef YYDEBUG
  1357. X    if( yydebug  ) printf( "state %d, char 0%o\n", yystate, yychar );
  1358. X#endif
  1359. X        if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); }
  1360. X        *yyps = yystate;
  1361. X        ++yypv;
  1362. X        *yypv = yyval;
  1363. X
  1364. X yynewstate:
  1365. X
  1366. X    yyn = yypact[yystate];
  1367. X
  1368. X    if( yyn<= YYFLAG ) goto yydefault; /* simple state */
  1369. X
  1370. X    if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
  1371. X    if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
  1372. X
  1373. X    if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
  1374. X        yychar = -1;
  1375. X        yyval = yylval;
  1376. X        yystate = yyn;
  1377. X        if( yyerrflag > 0 ) --yyerrflag;
  1378. X        goto yystack;
  1379. X        }
  1380. X
  1381. X yydefault:
  1382. X    /* default state action */
  1383. X
  1384. X    if( (yyn=yydef[yystate]) == -2 ) {
  1385. X        if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
  1386. X        /* look through exception table */
  1387. X
  1388. X        for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
  1389. X
  1390. X        while( *(yyxi+=2) >= 0 ){
  1391. X            if( *yyxi == yychar ) break;
  1392. X            }
  1393. X        if( (yyn = yyxi[1]) < 0 ) return(0);   /* accept */
  1394. X        }
  1395. X
  1396. X    if( yyn == 0 ){ /* error */
  1397. X        /* error ... attempt to resume parsing */
  1398. X
  1399. X        switch( yyerrflag ){
  1400. X
  1401. X        case 0:   /* brand new error */
  1402. X
  1403. X            yyerror( "syntax error" );
  1404. X        yyerrlab:
  1405. X            ++yynerrs;
  1406. X
  1407. X        case 1:
  1408. X        case 2: /* incompletely recovered error ... try again */
  1409. X
  1410. X            yyerrflag = 3;
  1411. X
  1412. X            /* find a state where "error" is a legal shift action */
  1413. X
  1414. X            while ( yyps >= yys ) {
  1415. X               yyn = yypact[*yyps] + YYERRCODE;
  1416. X               if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
  1417. X                  yystate = yyact[yyn];  /* simulate a shift of "error" */
  1418. X                  goto yystack;
  1419. X                  }
  1420. X               yyn = yypact[*yyps];
  1421. X
  1422. X               /* the current yyps has no shift onn "error", pop stack */
  1423. X
  1424. X#ifdef YYDEBUG
  1425. X               if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
  1426. X#endif
  1427. X               --yyps;
  1428. X               --yypv;
  1429. X               }
  1430. X
  1431. X            /* there is no state on the stack with an error shift ... abort */
  1432. X
  1433. X    yyabort:
  1434. X            return(1);
  1435. X
  1436. X
  1437. X        case 3:  /* no shift yet; clobber input char */
  1438. X
  1439. X#ifdef YYDEBUG
  1440. X            if( yydebug ) printf( "error recovery discards char %d\n", yychar );
  1441. X#endif
  1442. X
  1443. X            if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
  1444. X            yychar = -1;
  1445. X            goto yynewstate;   /* try again in the same state */
  1446. X
  1447. X            }
  1448. X
  1449. X        }
  1450. X
  1451. X    /* reduction by production yyn */
  1452. X
  1453. X#ifdef YYDEBUG
  1454. X        if( yydebug ) printf("reduce %d\n",yyn);
  1455. X#endif
  1456. X        yyps -= yyr2[yyn];
  1457. X        yypvt = yypv;
  1458. X        yypv -= yyr2[yyn];
  1459. X        yyval = yypv[1];
  1460. X        yym=yyn;
  1461. X            /* consult goto table to find next state */
  1462. X        yyn = yyr1[yyn];
  1463. X        yyj = yypgo[yyn] + *yyps + 1;
  1464. X        if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
  1465. X        switch(yym){
  1466. X            
  1467. Xcase 6:
  1468. X# line 201 "lev_comp.y"
  1469. X{
  1470. X              int fout, i;
  1471. X
  1472. X              if (fatal_error > 0)
  1473. X                  fprintf(stderr,"%s : %d errors detected. No output created!\n", fname, fatal_error);
  1474. X              else {
  1475. X#ifdef MACOS
  1476. X                  OSErr    result;
  1477. X                  
  1478. X                  result = Create(CtoPstr(yypvt[-1].map), 0, CREATOR, AUXIL_TYPE);
  1479. X                  (void)PtoCstr(yypvt[-1].map);
  1480. X#endif        
  1481. X                  fout = open(yypvt[-1].map, O_WRONLY | O_CREAT
  1482. X#if defined(MSDOS) || defined(MACOS)
  1483. X                          | O_BINARY
  1484. X#endif /* MSDOS || MACOS */
  1485. X                          , 0644);
  1486. X                  if (fout < 0) {
  1487. X                      yyerror("Can't open output file!!");
  1488. X                      exit(1);
  1489. X                  }
  1490. X                  maze.numpart = npart;
  1491. X                  maze.parts = (mazepart**) alloc(sizeof(mazepart*)*npart);
  1492. X                  for(i=0;i<npart;i++)
  1493. X                      maze.parts[i] = tmppart[i];
  1494. X                  write_maze(fout, &maze);
  1495. X                  (void) close(fout);
  1496. X                  npart = 0;
  1497. X              }
  1498. X          } break;
  1499. Xcase 7:
  1500. X# line 233 "lev_comp.y"
  1501. X{
  1502. X              yyval.map = yypvt[-0].map;
  1503. X          } break;
  1504. Xcase 10:
  1505. X# line 241 "lev_comp.y"
  1506. X{
  1507. X            store_part();
  1508. X          } break;
  1509. Xcase 11:
  1510. X# line 246 "lev_comp.y"
  1511. X{
  1512. X            tmppart[npart] = (mazepart *) alloc(sizeof(mazepart));
  1513. X            tmppart[npart]->halign = yypvt[-1].i % 10;
  1514. X            tmppart[npart]->valign = yypvt[-1].i / 10;
  1515. X            tmppart[npart]->nrobjects = 0;
  1516. X            tmppart[npart]->nloc = 0;
  1517. X            tmppart[npart]->nrmonst = 0;
  1518. X            scan_map(yypvt[-0].map);
  1519. X          } break;
  1520. Xcase 12:
  1521. X# line 257 "lev_comp.y"
  1522. X{
  1523. X              yyval.i = yypvt[-2].i + ( yypvt[-0].i * 10 );
  1524. X          } break;
  1525. Xcase 19:
  1526. X# line 271 "lev_comp.y"
  1527. X{
  1528. X              if (tmppart[npart]->nrobjects)
  1529. X                  yyerror("Object registers already initialized!");
  1530. X              else {
  1531. X                  tmppart[npart]->robjects = (char *) alloc(n_olist);
  1532. X                  memcpy(tmppart[npart]->robjects, olist, n_olist);
  1533. X                  tmppart[npart]->nrobjects = n_olist;
  1534. X              }
  1535. X          } break;
  1536. Xcase 20:
  1537. X# line 281 "lev_comp.y"
  1538. X{
  1539. X              if (tmppart[npart]->nloc)
  1540. X                  yyerror("Location registers already initialized!");
  1541. X              else {
  1542. X                  register int i;
  1543. X                  tmppart[npart]->rloc_x = (char *) alloc(n_plist);
  1544. X                  tmppart[npart]->rloc_y = (char *) alloc(n_plist);
  1545. X                  for(i=0;i<n_plist;i++) {
  1546. X                      tmppart[npart]->rloc_x[i] = plist[i].x;
  1547. X                      tmppart[npart]->rloc_y[i] = plist[i].y;
  1548. X                  }
  1549. X                  tmppart[npart]->nloc = n_plist;
  1550. X              }
  1551. X          } break;
  1552. Xcase 21:
  1553. X# line 296 "lev_comp.y"
  1554. X{
  1555. X              if (tmppart[npart]->nrmonst)
  1556. X                  yyerror("Monster registers already initialized!");
  1557. X              else {
  1558. X                  tmppart[npart]->rmonst = (char *) alloc(n_mlist);
  1559. X                  memcpy(tmppart[npart]->rmonst, mlist, n_mlist);
  1560. X                  tmppart[npart]->nrmonst = n_mlist;
  1561. X              }
  1562. X          } break;
  1563. Xcase 22:
  1564. X# line 307 "lev_comp.y"
  1565. X{
  1566. X              if (n_olist < MAX_REGISTERS)
  1567. X                  olist[n_olist++] = yypvt[-0].i;
  1568. X              else
  1569. X                  yyerror("Object list too long!");
  1570. X          } break;
  1571. Xcase 23:
  1572. X# line 314 "lev_comp.y"
  1573. X{
  1574. X              if (n_olist < MAX_REGISTERS)
  1575. X                  olist[n_olist++] = yypvt[-2].i;
  1576. X              else
  1577. X                  yyerror("Object list too long!");
  1578. X          } break;
  1579. Xcase 24:
  1580. X# line 322 "lev_comp.y"
  1581. X{
  1582. X              if (n_mlist < MAX_REGISTERS)
  1583. X                  mlist[n_mlist++] = yypvt[-0].i;
  1584. X              else
  1585. X                  yyerror("Monster list too long!");
  1586. X          } break;
  1587. Xcase 25:
  1588. X# line 329 "lev_comp.y"
  1589. X{
  1590. X              if (n_mlist < MAX_REGISTERS)
  1591. X                  mlist[n_mlist++] = yypvt[-2].i;
  1592. X              else
  1593. X                  yyerror("Monster list too long!");
  1594. X          } break;
  1595. Xcase 26:
  1596. X# line 337 "lev_comp.y"
  1597. X{
  1598. X              if (n_plist < MAX_REGISTERS)
  1599. X                  plist[n_plist++] = current_coord;
  1600. X              else
  1601. X                  yyerror("Location list too long!");
  1602. X          } break;
  1603. Xcase 27:
  1604. X# line 344 "lev_comp.y"
  1605. X{
  1606. X              if (n_plist < MAX_REGISTERS)
  1607. X                  plist[n_plist++] = current_coord;
  1608. X              else
  1609. X                  yyerror("Location list too long!");
  1610. X          } break;
  1611. Xcase 41:
  1612. X# line 366 "lev_comp.y"
  1613. X{
  1614. X              int token;
  1615. X
  1616. X              tmpmonst[nmons] = (monster *) alloc(sizeof(monster));
  1617. X              tmpmonst[nmons]->x = current_coord.x;
  1618. X              tmpmonst[nmons]->y = current_coord.y;
  1619. X              tmpmonst[nmons]->class = yypvt[-4].i;
  1620. X              if (!yypvt[-2].map)
  1621. X                  tmpmonst[nmons]->id = -1;
  1622. X              else {
  1623. X                  token = get_monster_id(yypvt[-2].map, (char) yypvt[-4].i);
  1624. X                  if (token == ERR) {
  1625. X                      yywarning("Illegal monster name!  Making random monster.");
  1626. X                      tmpmonst[nmons]->id = -1;
  1627. X                  } else
  1628. X                      tmpmonst[nmons]->id = token;
  1629. X              }
  1630. X              nmons++;
  1631. X          } break;
  1632. Xcase 42:
  1633. X# line 387 "lev_comp.y"
  1634. X{
  1635. X              int token;
  1636. X
  1637. X              tmpobj[nobj] = (object *) alloc(sizeof(object));
  1638. X              tmpobj[nobj]->x = current_coord.x;
  1639. X              tmpobj[nobj]->y = current_coord.y;
  1640. X              tmpobj[nobj]->class = yypvt[-4].i;
  1641. X              if (!yypvt[-2].map)
  1642. X                  tmpobj[nobj]->id = -1;
  1643. X              else {
  1644. X                  token = get_object_id(yypvt[-2].map, (char) yypvt[-4].i);
  1645. X                  if (token == ERR) {
  1646. X                      yywarning("Illegal object name!  Making random object.");
  1647. X                      tmpobj[nobj]->id = -1;
  1648. X                  } else
  1649. X                      tmpobj[nobj]->id = token;
  1650. X              }
  1651. X              nobj++;
  1652. X          } break;
  1653. Xcase 43:
  1654. X# line 408 "lev_comp.y"
  1655. X{
  1656. X            tmpdoor[ndoor] = (door *) alloc(sizeof(door));
  1657. X            tmpdoor[ndoor]->x = current_coord.x;
  1658. X            tmpdoor[ndoor]->y = current_coord.y;
  1659. X            tmpdoor[ndoor]->mask = yypvt[-2].i;
  1660. X            ndoor++;
  1661. X          } break;
  1662. Xcase 44:
  1663. X# line 417 "lev_comp.y"
  1664. X{
  1665. X            tmptrap[ntrap] = (trap *) alloc(sizeof(trap));
  1666. X            tmptrap[ntrap]->x = current_coord.x;
  1667. X            tmptrap[ntrap]->y = current_coord.y;
  1668. X            tmptrap[ntrap]->type = yypvt[-2].i;
  1669. X            ntrap++;
  1670. X          } break;
  1671. Xcase 45:
  1672. X# line 426 "lev_comp.y"
  1673. X{
  1674. X            tmpdb[ndb] = (drawbridge *) alloc(sizeof(drawbridge));
  1675. X            tmpdb[ndb]->x = current_coord.x;
  1676. X            tmpdb[ndb]->y = current_coord.y;
  1677. X            tmpdb[ndb]->dir = db_dirs[yypvt[-2].i];
  1678. X            if ( yypvt[-0].i == D_ISOPEN )
  1679. X              tmpdb[ndb]->open = 1;
  1680. X            else if ( yypvt[-0].i == D_CLOSED )
  1681. X              tmpdb[ndb]->open = 0;
  1682. X            else
  1683. X              yyerror("A drawbridge can only be open or closed!");
  1684. X            ndb++;
  1685. X           } break;
  1686. Xcase 46:
  1687. X# line 441 "lev_comp.y"
  1688. X{
  1689. X            tmpwalk[nwalk] = (walk *) alloc(sizeof(walk));
  1690. X            tmpwalk[nwalk]->x = current_coord.x;
  1691. X            tmpwalk[nwalk]->y = current_coord.y;
  1692. X            tmpwalk[nwalk]->dir = yypvt[-0].i;
  1693. X            nwalk++;
  1694. X          } break;
  1695. Xcase 47:
  1696. X# line 450 "lev_comp.y"
  1697. X{
  1698. X            tmplad[nlad] = (lad *) alloc(sizeof(lad));
  1699. X            tmplad[nlad]->x = current_coord.x;
  1700. X            tmplad[nlad]->y = current_coord.y;
  1701. X            tmplad[nlad]->up = yypvt[-0].i;
  1702. X            nlad++;
  1703. X          } break;
  1704. Xcase 48:
  1705. X# line 459 "lev_comp.y"
  1706. X{
  1707. X            tmpdig[ndig] = (digpos *) alloc(sizeof(digpos));
  1708. X            tmpdig[ndig]->x1 = current_region.x1;
  1709. X            tmpdig[ndig]->y1 = current_region.y1;
  1710. X            tmpdig[ndig]->x2 = current_region.x2;
  1711. X            tmpdig[ndig]->y2 = current_region.y2;
  1712. X            ndig++;
  1713. X          } break;
  1714. Xcase 49:
  1715. X# line 469 "lev_comp.y"
  1716. X{
  1717. X            tmpreg[nreg] = (region *) alloc(sizeof(region));
  1718. X            tmpreg[nreg]->x1 = current_region.x1;
  1719. X            tmpreg[nreg]->y1 = current_region.y1;
  1720. X            tmpreg[nreg]->x2 = current_region.x2;
  1721. X            tmpreg[nreg]->y2 = current_region.y2;
  1722. X            tmpreg[nreg]->rlit = yypvt[-2].i;
  1723. X            tmpreg[nreg]->rtype = yypvt[-0].i;
  1724. X            nreg++;
  1725. X          } break;
  1726. Xcase 50:
  1727. X# line 481 "lev_comp.y"
  1728. X{
  1729. X#ifndef ALTARS
  1730. X            yywarning("Altars are not allowed in this version!  Ignoring...");
  1731. X#else
  1732. X            tmpaltar[naltar] = (altar *) alloc(sizeof(altar));
  1733. X            tmpaltar[naltar]->x = current_coord.x;
  1734. X            tmpaltar[naltar]->y = current_coord.y;
  1735. X            tmpaltar[naltar]->align = yypvt[-2].i;
  1736. X            tmpaltar[naltar]->shrine = yypvt[-0].i;
  1737. X            naltar++;
  1738. X#endif /* ALTARS */
  1739. X          } break;
  1740. Xcase 52:
  1741. X# line 496 "lev_comp.y"
  1742. X{
  1743. X              yyval.i = - MAX_REGISTERS - 1;
  1744. X          } break;
  1745. Xcase 55:
  1746. X# line 503 "lev_comp.y"
  1747. X{
  1748. X              yyval.i = - MAX_REGISTERS - 1;
  1749. X          } break;
  1750. Xcase 58:
  1751. X# line 510 "lev_comp.y"
  1752. X{
  1753. X              yyval.map = (char *) 0;
  1754. X          } break;
  1755. Xcase 60:
  1756. X# line 516 "lev_comp.y"
  1757. X{
  1758. X              yyval.map = (char *) 0;
  1759. X          } break;
  1760. Xcase 61:
  1761. X# line 521 "lev_comp.y"
  1762. X{
  1763. X            int token = get_trap_type(yypvt[-0].map);
  1764. X            if (token == ERR)
  1765. X                yyerror("unknown trap type!");
  1766. X            yyval.i = token;
  1767. X          } break;
  1768. Xcase 63:
  1769. X# line 530 "lev_comp.y"
  1770. X{
  1771. X            int token = get_room_type(yypvt[-0].map);
  1772. X            if (token == ERR) {
  1773. X                yywarning("Unknown room type!  Making ordinary room...");
  1774. X                yyval.i = OROOM;
  1775. X            } else
  1776. X                yyval.i = token;
  1777. X          } break;
  1778. Xcase 67:
  1779. X# line 543 "lev_comp.y"
  1780. X{
  1781. X              current_coord.x = current_coord.y = -MAX_REGISTERS-1;
  1782. X          } break;
  1783. Xcase 74:
  1784. X# line 556 "lev_comp.y"
  1785. X{
  1786. X              yyval.i = - MAX_REGISTERS - 1;
  1787. X          } break;
  1788. Xcase 77:
  1789. X# line 564 "lev_comp.y"
  1790. X{
  1791. X            if ( yypvt[-1].i >= MAX_REGISTERS ) {
  1792. X                yyerror("Register Index overflow!");
  1793. X            } else {
  1794. X                current_coord.x = current_coord.y = - yypvt[-1].i - 1;
  1795. X            }
  1796. X          } break;
  1797. Xcase 78:
  1798. X# line 573 "lev_comp.y"
  1799. X{
  1800. X            if ( yypvt[-1].i >= MAX_REGISTERS ) {
  1801. X                yyerror("Register Index overflow!");
  1802. X            } else {
  1803. X                yyval.i = - yypvt[-1].i - 1;
  1804. X            }
  1805. X          } break;
  1806. Xcase 79:
  1807. X# line 582 "lev_comp.y"
  1808. X{
  1809. X            if ( yypvt[-1].i >= MAX_REGISTERS ) {
  1810. X                yyerror("Register Index overflow!");
  1811. X            } else {
  1812. X                yyval.i = - yypvt[-1].i - 1;
  1813. X            }
  1814. X          } break;
  1815. Xcase 80:
  1816. X# line 591 "lev_comp.y"
  1817. X{
  1818. X            if ( yypvt[-1].i >= 3 ) {
  1819. X                yyerror("Register Index overflow!");
  1820. X            } else {
  1821. X                yyval.i = - yypvt[-1].i - 1;
  1822. X            }
  1823. X          } break;
  1824. Xcase 82:
  1825. X# line 602 "lev_comp.y"
  1826. X{
  1827. X            if (check_monster_char((char) yypvt[-0].i))
  1828. X                yyval.i = yypvt[-0].i ;
  1829. X            else {
  1830. X                yyerror("unknown monster class!");
  1831. X                yyval.i = ERR;
  1832. X            }
  1833. X          } break;
  1834. Xcase 83:
  1835. X# line 612 "lev_comp.y"
  1836. X{
  1837. X            char c;
  1838. X
  1839. X            c = yypvt[-0].i;
  1840. X#ifndef SPELLS
  1841. X            if ( c == '+') {
  1842. X                c = '?';
  1843. X                yywarning("Spellbooks are not allowed in this version! (converted into scroll)");
  1844. X            }
  1845. X#endif
  1846. X            if (check_object_char(c))
  1847. X                yyval.i = c;
  1848. X            else {
  1849. X                yyerror("Unknown char class!");
  1850. X                yyval.i = ERR;
  1851. X            }
  1852. X          } break;
  1853. Xcase 85:
  1854. X# line 632 "lev_comp.y"
  1855. X{
  1856. X            if (yypvt[-3].i < 0 || yypvt[-3].i > max_x_map ||
  1857. X                yypvt[-1].i < 0 || yypvt[-1].i > max_y_map)
  1858. X                yyerror("Coordinates out of map range!");
  1859. X            current_coord.x = yypvt[-3].i;
  1860. X            current_coord.y = yypvt[-1].i;
  1861. X          } break;
  1862. Xcase 86:
  1863. X# line 641 "lev_comp.y"
  1864. X{
  1865. X            if (yypvt[-7].i < 0 || yypvt[-7].i > max_x_map ||
  1866. X                yypvt[-5].i < 0 || yypvt[-5].i > max_y_map ||
  1867. X                yypvt[-3].i < 0 || yypvt[-3].i > max_x_map ||
  1868. X                yypvt[-1].i < 0 || yypvt[-1].i > max_y_map)
  1869. X                yyerror("Region out of map range!");
  1870. X            current_region.x1 = yypvt[-7].i;
  1871. X            current_region.y1 = yypvt[-5].i;
  1872. X            current_region.x2 = yypvt[-3].i;
  1873. X            current_region.y2 = yypvt[-1].i;
  1874. X          } break; 
  1875. X        }
  1876. X        goto yystack;  /* stack new state and value */
  1877. X
  1878. X    }
  1879. END_OF_FILE
  1880. if test 33297 -ne `wc -c <'src/lev_comp.c'`; then
  1881.     echo shar: \"'src/lev_comp.c'\" unpacked with wrong size!
  1882. fi
  1883. # end of 'src/lev_comp.c'
  1884. fi
  1885. echo shar: End of archive 23 \(of 56\).
  1886. cp /dev/null ark23isdone
  1887. MISSING=""
  1888. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 ; do
  1889.     if test ! -f ark${I}isdone ; then
  1890.     MISSING="${MISSING} ${I}"
  1891.     fi
  1892. done
  1893. if test "${MISSING}" = "" ; then
  1894.     echo You have unpacked all 56 archives.
  1895.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1896. else
  1897.     echo You still need to unpack the following archives:
  1898.     echo "        " ${MISSING}
  1899. fi
  1900. ##  End of shell archive.
  1901. exit 0
  1902.