dmain.for 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. C DUNGEON-- MAIN PROGRAM
  2. C
  3. C COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
  4. C ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
  5. C WRITTEN BY R. M. SUPNIK
  6. C
  7. PROGRAM DUNGEO
  8. C
  9. C DECLARATIONS
  10. C
  11. C DUNGEON, PAGE 3
  12. C
  13. C 1) INITIALIZE DATA STRUCTURES
  14. C 2) PLAY GAME
  15. C
  16. IMPLICIT INTEGER (A-Z)
  17. LOGICAL INIT
  18. IF(INIT(X)) CALL GAME
  19. C !IF INIT, PLAY GAME.
  20. CALL EXIT
  21. C !DONE
  22. END
  23. BLOCK DATA
  24. IMPLICIT INTEGER (A-Z)
  25. include 'parser.h'
  26. include 'gamestat.h'
  27. include 'state.h'
  28. include 'screen.h'
  29. include 'puzzle.h'
  30. C
  31. C MISCELLANEOUS VARIABLES
  32. C
  33. CHARACTER VEDIT
  34. COMMON /STAR/ MBASE,STRBIT
  35. COMMON /VERS/ VMAJ,VMIN,VEDIT
  36. COMMON /BATS/ BATDRP(9)
  37. include 'io.h'
  38. include 'debug.h'
  39. COMMON /HYPER/ HFACTR
  40. include 'rooms.h'
  41. include 'rflag.h'
  42. include 'rindex.h'
  43. include 'exits.h'
  44. include 'curxt.h'
  45. include 'xpars.h'
  46. include 'xsrch.h'
  47. include 'objects.h'
  48. include 'oflags.h'
  49. include 'oindex.h'
  50. include 'clock.h'
  51. include 'villians.h'
  52. include 'advers.h'
  53. include 'verbs.h'
  54. include 'flags.h'
  55. C DUNGEON, PAGE 2
  56. C
  57. C DATA STATEMENTS FOR CONSTANT ARRAYS
  58. C
  59. DATA VMAJ/2/,VMIN/6/,VEDIT/'A'/
  60. C
  61. DATA SDIR/'40000'O/,SIND/'20000'O/,SSTD/'10000'O/,
  62. &SFLIP/'4000'O/,SDRIV/'2000'O/,SVMASK/'777'O/
  63. DATA VABIT/'40000'O/,VRBIT/'20000'O/,VTBIT/'10000'O/,
  64. &VCBIT/'4000'O/,VEBIT/'2000'O/,VFBIT/'1000'O/,
  65. &VPMASK/'777'O/
  66. C
  67. DATA BATDRP/66,67,68,69,70,71,72,65,73/
  68. C
  69. DATA SCOLDR/'2000'O,153,'12000'O,154,'6000'O,152,'16000'O,151/
  70. DATA SCOLWL/151,207,'6000'O,152,208,'16000'O,
  71. &153,206,'12000'O,154,205,'2000'O/
  72. C
  73. DATA HFACTR/500/
  74. C
  75. DATA CPDR/'2000'O,-8,'4000'O,-7,'6000'O,1,'10000'O,9,
  76. &'12000'O,8,'14000'O,7,'16000'O,-1,'20000'O,-9/
  77. DATA CPWL/205,-8,206,8,207,1,208,-1/
  78. DATA CPVEC/1,1,1,1,1,1,1,1,
  79. &1,0,-1,0,0,-1,0,1,
  80. &1,-1,0,1,0,-2,0,1,
  81. &1,0,0,0,0,1,0,1,
  82. &1,-3,0,0,-1,-1,0,1,
  83. &1,0,0,-1,0,0,0,1,
  84. &1,1,1,0,0,0,1,1,
  85. &1,1,1,1,1,1,1,1/
  86. C
  87. DATA CEVCUR/1/,CEVMNT/2/,CEVLNT/3/,CEVMAT/4/,
  88. &CEVCND/5/,CEVBAL/6/,CEVBRN/7/,CEVFUS/8/,
  89. &CEVLED/9/,CEVSAF/10/,CEVVLG/11/,CEVGNO/12/,
  90. &CEVBUC/13/,CEVSPH/14/,CEVEGH/15/,
  91. &CEVFOR/16/,CEVSCL/17/,CEVZGI/18/,CEVZGO/19/,
  92. &CEVSTE/20/,CEVMRS/21/,CEVPIN/22/,CEVINQ/23/,
  93. &CEVFOL/24/
  94. C
  95. DATA XRMASK/'377'O/,XDMASK/'76000'O/,XFMASK/3/
  96. DATA XFSHFT/256/,XASHFT/256/
  97. DATA XNORM/1/,XNO/2/,XCOND/3/,XDOOR/4/
  98. DATA XELNT/1,2,3,3/,XLFLAG/'100000'O/
  99. DATA XMIN/'2000'O/,XMAX/'40000'O/,XUP/'22000'O/,XDOWN/'24000'O/
  100. DATA XNORTH/'2000'O/,XSOUTH/'12000'O/,XENTER/'32000'O/,
  101. &XEXIT/'34000'O/
  102. DATA XEAST/'6000'O/,XWEST/'16000'O/
  103. C
  104. DATA PLAYER/1/,AROBOT/2/,AMASTR/3/
  105. DATA ASTAG/'100000'O/
  106. C
  107. DATA RSEEN/'100000'O/,RLIGHT/'40000'O/,RLAND/'20000'O/
  108. DATA RWATER/'10000'O/,RAIR/'4000'O/,RSACRD/'2000'O/,
  109. &RFILL/'1000'O/
  110. DATA RMUNG/'400'O/,RBUCK/'200'O/,RHOUSE/'100'O/,
  111. &RNWALL/'40'O/,REND/'20'O/
  112. C
  113. DATA WHOUS/2/,LROOM/8/,CELLA/9/
  114. DATA MTROL/10/,MAZE1/11/
  115. DATA MGRAT/25/,MAZ15/30/
  116. DATA FORE1/31/,FORE3/33/,CLEAR/36/,RESER/40/
  117. DATA STREA/42/,EGYPT/44/,ECHOR/49/
  118. DATA TSHAF/61/
  119. DATA BSHAF/76/,MMACH/77/,DOME/79/,MTORC/80/
  120. DATA CAROU/83/
  121. DATA RIDDL/91/,LLD2/94/,TEMP1/96/,TEMP2/97/,MAINT/100/
  122. DATA MCYCL/101/,BLROO/102/,TREAS/103/,RIVR1/107/,RIVR2/108/
  123. DATA RIVR3/109/
  124. DATA RIVR4/112/,RIVR5/113/,FCHMP/114/,MBARR/119/,FALLS/120/
  125. DATA MRAIN/121/,POG/122/,VLBOT/126/,VAIR1/127/,VAIR2/128/
  126. DATA VAIR3/129/,VAIR4/130/
  127. DATA LEDG2/131/,LEDG3/132/,LEDG4/133/,MSAFE/135/,CAGER/140/
  128. DATA CAGED/141/,TWELL/142/,BWELL/143/,ALICE/144/,ALISM/145/
  129. DATA ALITR/146/,MTREE/147/,BKENT/148/
  130. DATA BKVW/151/,BKTWI/153/,BKVAU/154/,BKBOX/155/
  131. DATA CRYPT/157/,TSTRS/158/,MRANT/159/
  132. DATA MREYE/160/,MRA/161/,MRB/162/,MRC/163/,MRG/164/
  133. DATA MRD/165/,FDOOR/166/,MRAE/167/
  134. DATA MRCE/171/,MRCW/172/,MRGE/173/,MRGW/174/,MRDW/176/
  135. DATA INMIR/177/,SCORR/179/
  136. DATA NCORR/182/,PARAP/183/,CELL/184/,PCELL/185/,NCELL/186/
  137. DATA CPANT/188/,CPOUT/189/
  138. DATA CPUZZ/190/
  139. C
  140. DATA CINTW/1/,DEADXW/2/,FRSTQW/3/,INXW/4/
  141. DATA OUTXW/5/,WALKIW/6/,FIGHTW/7/,FOOW/8/
  142. C
  143. DATA READW/100/,MELTW/101/
  144. DATA INFLAW/102/,DEFLAW/103/,ALARMW/104/,EXORCW/105/
  145. DATA PLUGW/106/,KICKW/107/,WAVEW/108/,RAISEW/109/,LOWERW/110/
  146. DATA RUBW/111/,PUSHW/112/,UNTIEW/113/,TIEW/114/,TIEUPW/115/
  147. DATA TURNW/116/,BREATW/117/,KNOCKW/118/,LOOKW/119/
  148. DATA EXAMIW/120/,SHAKEW/121/,MOVEW/122/,TRNONW/123/,TRNOFW/124/
  149. DATA OPENW/125/,CLOSEW/126/,FINDW/127/,WAITW/128/,SPINW/129/
  150. DATA BOARDW/130/,UNBOAW/131/,TAKEW/132/,INVENW/133/
  151. DATA FILLW/134/,EATW/135/,DRINKW/136/,BURNW/137/
  152. DATA MUNGW/138/,KILLW/139/,ATTACW/141/
  153. DATA SWINGW/140/,WALKW/142/,TELLW/143/,PUTW/144/
  154. DATA DROPW/145/,GIVEW/146/,POURW/147/,THROWW/148/
  155. C
  156. DATA DIGW/89/,LEAPW/91/,STAYW/73/,FOLLOW/85/
  157. DATA HELLOW/151/,LOOKIW/152/,LOOKUW/153/,PUMPW/154/
  158. DATA WINDW/155/,CLMBW/156/,CLMBUW/157/,CLMBDW/158/,TRNTOW/159/
  159. C
  160. DATA VISIBT/'100000'O/,READBT/'40000'O/,TAKEBT/'20000'O/,
  161. &DOORBT/'10000'O/,TRANBT/'4000'O/,FOODBT/'2000'O/,
  162. &NDSCBT/'1000'O/,DRNKBT/'400'O/, CONTBT/'200'O/,
  163. &LITEBT/'100'O/,VICTBT/'40'O/,BURNBT/'20'O/,
  164. &FLAMBT/'10'O/,TOOLBT/'4'O/,TURNBT/'2'O/,ONBT/'1'O/
  165. C
  166. DATA FINDBT/'100000'O/,SLEPBT/'40000'O/,SCRDBT/'20000'O/,
  167. &TIEBT/'10000'O/, CLMBBT/'4000'O/,ACTRBT/'2000'O/,
  168. &WEAPBT/'1000'O/,FITEBT/'400'O/, VILLBT/'200'O/,
  169. &STAGBT/'100'O/,TRYBT/'40'O/,NOCHBT/'20'O/,
  170. &OPENBT/'10'O/,TCHBT/'4'O/,VEHBT/'2'O/,SCHBT/'1'O/
  171. C
  172. DATA GARLI/2/,FOOD/3/,GUNK/4/,COAL/5/,MACHI/7/,DIAMO/8/
  173. DATA TCASE/9/,BOTTL/10/
  174. DATA WATER/11/,ROPE/12/,KNIFE/13/,SWORD/14/,LAMP/15/,BLAMP/16/
  175. DATA RUG/17/,LEAVE/18/,TROLL/19/,AXE/20/
  176. DATA RKNIF/21/,KEYS/23/,BAR/26/,ICE/30/
  177. DATA COFFI/33/,TORCH/34/,TBASK/35/,FBASK/36/,IRBOX/39/
  178. DATA GHOST/42/,TRUNK/45/,BELL/46/,BOOK/47/,CANDL/48/
  179. DATA MATCH/51/,TUBE/54/,PUTTY/55/,WRENC/56/,SCREW/57/
  180. DATA CYCLO/58/,CHALI/59/
  181. DATA THIEF/61/,STILL/62/,WINDO/63/,GRATE/65/,DOOR/66/
  182. DATA HPOLE/71/,RBUTT/79/,LEAK/78/,RAILI/75/
  183. DATA POT/85/,STATU/86/,IBOAT/87/,DBOAT/88/,PUMP/89/,RBOAT/90/
  184. DATA STICK/92/,BUOY/94/,SHOVE/96/,GUANO/97/,BALLO/98/,RECEP/99/
  185. DATA BROPE/101/,HOOK1/102/,HOOK2/103/,SAFE/105/,SSLOT/107/
  186. DATA BRICK/109/,FUSE/110/
  187. DATA GNOME/111/,BLABE/112/,DBALL/113/,TOMB/119/
  188. DATA LCASE/123/,CAGE/124/,RCAGE/125/,SPHER/126/,SQBUT/127/
  189. DATA FLASK/132/,POOL/133/,SAFFR/134/,BUCKE/137/,ORICE/139/
  190. DATA ECAKE/138/,RDICE/140/
  191. DATA BLICE/141/,ROBOT/142/,FTREE/145/,BILLS/148/,PORTR/149/
  192. DATA SCOL/151/,ZGNOM/152/,EGG/154/,BEGG/155/,BAUBL/156/
  193. DATA CANAR/157/,BCANA/158/,YLWAL/159/
  194. DATA RDWAL/161/,PINDR/164/
  195. DATA RBEAM/171/,ODOOR/172/,QDOOR/173/,CDOOR/175/
  196. DATA NUM1/178/
  197. DATA NUM8/185/,WARNI/186/,CSLIT/187/,GCARD/188/,STLDR/189/
  198. DATA ITOBJ/192/,OPLAY/193/,EVERY/194/
  199. DATA VALUA/195/,SAILO/196/,TEETH/197/,WALL/198/
  200. DATA HANDS/200/,LUNGS/201/,AVIAT/202/
  201. DATA WNORT/205/,GWATE/209/,MASTER/215/
  202. END