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