vars.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. /* vars.h -- variables for dungeon */
  2. /* These variable definitions are really ugly because they are actually
  3. * translations of FORTRAN common blocks. In the original FORTRAN source
  4. * the common blocks were included many times by each function that
  5. * needed them; I have changed this to define them all in this one file,
  6. * and include this in every source file. It's less modular, and it
  7. * makes everything slower to compile, but it's easier on me.
  8. * A few structures used only by the parsing routines are in parse.h.
  9. */
  10. #ifndef VARS_H
  11. #define VARS_H
  12. #ifndef EXTERN
  13. #define EXTERN extern
  14. #endif
  15. EXTERN struct {
  16. integer prsa, prsi, prso;
  17. logical prswon;
  18. integer prscon;
  19. } prsvec_;
  20. #define prsvec_1 prsvec_
  21. EXTERN struct {
  22. integer oflag, oact, oslot, oprep, oname;
  23. } orphs_;
  24. #define orphs_1 orphs_
  25. #define orp ((integer *)&orphs_1)
  26. EXTERN struct {
  27. integer lastit;
  28. } last_;
  29. #define last_1 last_
  30. EXTERN struct {
  31. integer winner, here;
  32. logical telflg;
  33. } play_;
  34. #define play_1 play_
  35. EXTERN struct {
  36. integer rlnt, rdesc1[200], rdesc2[200], rexit[200], ractio[200],
  37. rval[200], rflag[200];
  38. } rooms_;
  39. #define rooms_1 rooms_
  40. #define eqr ((integer *)&rooms_1 + 1)
  41. #define rrand ((integer *)&rooms_1 + 601)
  42. /* Room flags */
  43. #define RSEEN (32768)
  44. #define RLIGHT (16384)
  45. #define RLAND (8192)
  46. #define RWATER (4096)
  47. #define RAIR (2048)
  48. #define RSACRD (1024)
  49. #define RFILL (512)
  50. #define RMUNG (256)
  51. #define RBUCK (128)
  52. #define RHOUSE (64)
  53. #define RNWALL (32)
  54. #define REND (16)
  55. EXTERN const struct {
  56. integer whous, lroom, cella, mtrol, maze1, mgrat, maz15, fore1, fore3,
  57. clear, reser, strea, egypt, echor, tshaf, bshaf, mmach, dome,
  58. mtorc, carou, riddl, lld2, temp1, temp2, maint, blroo, treas,
  59. rivr1, rivr2, rivr3, mcycl, rivr4, rivr5, fchmp, falls, mbarr,
  60. mrain, pog, vlbot, vair1, vair2, vair3, vair4, ledg2, ledg3,
  61. ledg4, msafe, cager, caged, twell, bwell, alice, alism, alitr,
  62. mtree, bkent, bkvw, bktwi, bkvau, bkbox, crypt, tstrs, mrant,
  63. mreye, mra, mrb, mrc, mrg, mrd, fdoor, mrae, mrce, mrcw, mrge,
  64. mrgw, mrdw, inmir, scorr, ncorr, parap, cell, pcell, ncell, cpant,
  65. cpout, cpuzz;
  66. } rindex_
  67. #ifdef INIT
  68. = { 2, 8, 9, 10, 11, 25, 30, 31, 33, 36, 40, 42, 44, 49, 61, 76,
  69. 77, 79, 80, 83, 91, 94, 96, 97, 100, 102, 103, 107, 108, 109,
  70. 101, 112, 113, 114, 120, 119, 121, 122, 126, 127, 128, 129, 130,
  71. 131, 132, 133, 135, 140, 141, 142, 143, 144, 145, 146, 147, 148,
  72. 151, 153, 154, 155, 157, 158, 159, 160, 161, 162, 163, 164, 165,
  73. 166, 167, 171, 172, 173, 174, 176, 177, 179, 182, 183, 184, 185,
  74. 186, 188, 189, 190 }
  75. #endif
  76. ;
  77. #define rindex_1 rindex_
  78. EXTERN const struct {
  79. integer xmin, xmax, xdown, xup, xnorth, xsouth, xenter, xexit, xeast,
  80. xwest;
  81. } xsrch_
  82. #ifdef INIT
  83. = { 1024, 16384, 10240, 9216, 1024, 5120, 13312, 14336, 3072,
  84. 7168 }
  85. #endif
  86. ;
  87. #define xsrch_1 xsrch_
  88. EXTERN struct {
  89. integer olnt, odesc1[220], odesc2[220], odesco[220], oactio[220], oflag1[
  90. 220], oflag2[220], ofval[220], otval[220], osize[220], ocapac[220]
  91. , oroom[220], oadv[220], ocan[220], oread[220];
  92. } objcts_;
  93. #define objcts_1 objcts_
  94. #define eqo ((integer *)&objcts_1 + 1)
  95. EXTERN struct {
  96. integer r2lnt, oroom2[20], rroom2[20];
  97. } oroom2_;
  98. #define oroom2_1 oroom2_
  99. /* Object flags (oflags) */
  100. #define VISIBT (32768)
  101. #define READBT (16384)
  102. #define TAKEBT (8192)
  103. #define DOORBT (4096)
  104. #define TRANBT (2048)
  105. #define FOODBT (1024)
  106. #define NDSCBT (512)
  107. #define DRNKBT (256)
  108. #define CONTBT (128)
  109. #define LITEBT (64)
  110. #define VICTBT (32)
  111. #define BURNBT (16)
  112. #define FLAMBT (8)
  113. #define TOOLBT (4)
  114. #define TURNBT (2)
  115. #define ONBT (1)
  116. #define FINDBT (32768)
  117. #define SLEPBT (16384)
  118. #define SCRDBT (8192)
  119. #define TIEBT (4096)
  120. #define CLMBBT (2048)
  121. #define ACTRBT (1024)
  122. #define WEAPBT (512)
  123. #define FITEBT (256)
  124. #define VILLBT (128)
  125. #define STAGBT (64)
  126. #define TRYBT (32)
  127. #define NOCHBT (16)
  128. #define OPENBT (8)
  129. #define TCHBT (4)
  130. #define VEHBT (2)
  131. #define SCHBT (1)
  132. EXTERN const struct {
  133. integer garli, food, gunk, coal, machi, diamo, tcase, bottl, water, rope,
  134. knife, sword, lamp, blamp, rug, leave, troll, axe, rknif, keys,
  135. ice, bar, coffi, torch, tbask, fbask, irbox, ghost, trunk, bell,
  136. book, candl, match, tube, putty, wrenc, screw, cyclo, chali,
  137. thief, still, windo, grate, door, hpole, leak, rbutt, raili, pot,
  138. statu, iboat, dboat, pump, rboat, stick, buoy, shove, ballo,
  139. recep, guano, brope, hook1, hook2, safe, sslot, brick, fuse,
  140. gnome, blabe, dball, tomb, lcase, cage, rcage, spher, sqbut,
  141. flask, pool, saffr, bucke, ecake, orice, rdice, blice, robot,
  142. ftree, bills, portr, scol, zgnom, egg, begg, baubl, canar, bcana,
  143. ylwal, rdwal, pindr, rbeam, odoor, qdoor, cdoor, num1, num8,
  144. warni, cslit, gcard, stldr, hands, wall, lungs, sailo, aviat,
  145. teeth, itobj, every, valua, oplay, wnort, gwate, master;
  146. } oindex_
  147. #ifdef INIT
  148. = { 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
  149. 20, 21, 23, 30, 26, 33, 34, 35, 36, 39, 42, 45, 46, 47, 48, 51,
  150. 54, 55, 56, 57, 58, 59, 61, 62, 63, 65, 66, 71, 78, 79, 75, 85,
  151. 86, 87, 88, 89, 90, 92, 94, 96, 98, 99, 97, 101, 102, 103, 105,
  152. 107, 109, 110, 111, 112, 113, 119, 123, 124, 125, 126, 127, 132,
  153. 133, 134, 137, 138, 139, 140, 141, 142, 145, 148, 149, 151, 152,
  154. 154, 155, 156, 157, 158, 159, 161, 164, 171, 172, 173, 175, 178,
  155. 185, 186, 187, 188, 189, 200, 198, 201, 196, 202, 197, 192, 194,
  156. 195, 193, 205, 209, 215 }
  157. #endif
  158. ;
  159. #define oindex_1 oindex_
  160. EXTERN struct {
  161. integer clnt, ctick[25], cactio[25];
  162. logical cflag[25];
  163. } cevent_;
  164. #define cevent_1 cevent_
  165. #define eqc ((integer *)&cevent_1 + 1)
  166. EXTERN const struct {
  167. integer cevcur, cevmnt, cevlnt, cevmat, cevcnd, cevbal, cevbrn, cevfus,
  168. cevled, cevsaf, cevvlg, cevgno, cevbuc, cevsph, cevegh, cevfor,
  169. cevscl, cevzgi, cevzgo, cevste, cevmrs, cevpin, cevinq, cevfol;
  170. } cindex_
  171. #ifdef INIT
  172. = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
  173. 18, 19, 20, 21, 22, 23, 24 }
  174. #endif
  175. ;
  176. #define cindex_1 cindex_
  177. EXTERN struct {
  178. integer alnt, aroom[4], ascore[4], avehic[4], aobj[4], aactio[4], astren[
  179. 4], aflag[4];
  180. } advs_;
  181. #define advs_1 advs_
  182. #define eqa ((integer *)&advs_1 + 1)
  183. EXTERN const struct {
  184. integer astag;
  185. } aflags_
  186. #ifdef INIT
  187. = { 32768 }
  188. #endif
  189. ;
  190. #define aflags_1 aflags_
  191. EXTERN const struct {
  192. integer player, arobot, amastr;
  193. } aindex_
  194. #ifdef INIT
  195. = { 1, 2, 3 }
  196. #endif
  197. ;
  198. #define aindex_1 aindex_
  199. EXTERN const struct {
  200. integer cintw, deadxw, frstqw, inxw, outxw, walkiw, fightw, foow, meltw,
  201. readw, inflaw, deflaw, alarmw, exorcw, plugw, kickw, wavew,
  202. raisew, lowerw, rubw, pushw, untiew, tiew, tieupw, turnw, breatw,
  203. knockw, lookw, examiw, shakew, movew, trnonw, trnofw, openw,
  204. closew, findw, waitw, spinw, boardw, unboaw, takew, invenw, fillw,
  205. eatw, drinkw, burnw, mungw, killw, attacw, swingw, walkw, tellw,
  206. putw, dropw, givew, pourw, throww, digw, leapw, stayw, follow,
  207. hellow, lookiw, lookuw, pumpw, windw, clmbw, clmbuw, clmbdw,
  208. trntow;
  209. } vindex_
  210. #ifdef INIT
  211. = { 1, 2, 3, 4, 5, 6, 7, 8, 101, 100, 102, 103, 104, 105, 106,
  212. 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
  213. 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
  214. 133, 134, 135, 136, 137, 138, 139, 141, 140, 142, 143, 144, 145,
  215. 146, 147, 148, 89, 91, 73, 85, 151, 152, 153, 154, 155, 156, 157,
  216. 158, 159 }
  217. #endif
  218. ;
  219. #define vindex_1 vindex_
  220. EXTERN struct {
  221. logical trollf, cagesf, bucktf, caroff, carozf, lwtidf, domef, glacrf,
  222. echof, riddlf, lldf, cyclof, magicf, litldf, safef, gnomef,
  223. gnodrf, mirrmf, egyptf, onpolf, blabf, brieff, superf, buoyf,
  224. grunlf, gatef, rainbf, cagetf, empthf, deflaf, glacmf, frobzf,
  225. endgmf, badlkf, thfenf, singsf, mrpshf, mropnf, wdopnf, mr1f,
  226. mr2f, inqstf, follwf, spellf, cpoutf, cpushf;
  227. integer btief, binff, rvmnt, rvclr, rvcyc, rvsnd, rvgua, orrug, orcand,
  228. ormtch, orlamp, mdir, mloc, poleuf, quesno, nqatt, corrct, lcell,
  229. pnumb, acell, dcell, cphere;
  230. } findex_;
  231. #define findex_1 findex_
  232. #define flags ((logical *)&findex_1)
  233. #define switch_ ((integer *)&findex_1 + 46)
  234. EXTERN struct {
  235. integer dbgflg, prsflg, gdtflg;
  236. } debug_;
  237. #define debug_1 debug_
  238. EXTERN struct {
  239. integer thfpos;
  240. logical thfflg, thfact, swdact;
  241. integer swdsta;
  242. } hack_;
  243. #define hack_1 hack_
  244. EXTERN struct {
  245. integer vlnt, villns[4], vprob[4], vopps[4], vbest[4], vmelee[4];
  246. } vill_;
  247. #define vill_1 vill_
  248. #define eqv ((integer *)&vill_1 + 1)
  249. EXTERN struct {
  250. integer moves, deaths, rwscor, mxscor, mxload, ltshft, bloc, mungrm, hs,
  251. egscor, egmxsc;
  252. } state_;
  253. #define state_1 state_
  254. EXTERN struct {
  255. integer xtype, xroom1, xstrng, xactio, xobj;
  256. } curxt_;
  257. #define curxt_1 curxt_
  258. #define xflag ((integer *)&curxt_1 + 4)
  259. EXTERN const struct {
  260. integer xrmask, xdmask, xfmask, xfshft, xashft, xelnt[4], xnorm, xno,
  261. xcond, xdoor, xlflag;
  262. } xpars_
  263. #ifdef INIT
  264. = { 255, 31744, 3, 256, 256, { 1, 2, 3, 3 }, 1, 2, 3, 4, 32768 }
  265. #endif
  266. ;
  267. #define xpars_1 xpars_
  268. EXTERN struct {
  269. integer mbase, strbit;
  270. } star_;
  271. #define star_1 star_
  272. EXTERN struct {
  273. integer inlnt;
  274. char inbuf[78];
  275. } input_;
  276. #define input_1 input_
  277. EXTERN struct {
  278. integer fromdr, scolrm, scolac;
  279. const integer scoldr[8], scolwl[12];
  280. } screen_
  281. #ifdef INIT
  282. = { 0, 0, 0, { 1024, 153, 5120, 154, 3072, 152, 7168, 151 },
  283. { 151, 207, 3072, 152, 208, 7168, 153, 206, 5120, 154, 205,
  284. 1024 } }
  285. #endif
  286. ;
  287. #define screen_1 screen_
  288. EXTERN struct {
  289. integer mlnt, mrloc, rtext[1050];
  290. } rmsg_;
  291. #define rmsg_1 rmsg_
  292. EXTERN const struct {
  293. integer vmaj, vmin, vedit;
  294. } vers_
  295. #ifdef INIT
  296. = { 2, 7, 'A' }
  297. #endif
  298. ;
  299. #define vers_1 vers_
  300. EXTERN struct {
  301. integer pltime, shour, smin, ssec;
  302. } time_;
  303. #define time_1 time_
  304. EXTERN const struct {
  305. integer hfactr;
  306. } hyper_
  307. #ifdef INIT
  308. = { 500 }
  309. #endif
  310. ;
  311. #define hyper_1 hyper_
  312. EXTERN struct {
  313. integer xlnt, travel[900];
  314. } exits_;
  315. #define exits_1 exits_
  316. EXTERN struct {
  317. const integer cpdr[16], cpwl[8];
  318. integer cpvec[64];
  319. } puzzle_
  320. #ifdef INIT
  321. = { { 1024, -8, 2048, -7, 3072, 1, 4096, 9, 5120, 8, 6144, 7,
  322. 7168, -1, 8192, -9 },
  323. { 205, -8, 206, 8, 207, 1, 208, -1 },
  324. { 1, 1, 1, 1, 1, 1, 1, 1,
  325. 1, 0, -1, 0, 0, -1, 0, 1,
  326. 1, -1, 0, 1, 0, -2, 0, 1,
  327. 1, 0, 0, 0, 0, 1, 0, 1,
  328. 1, -3, 0, 0, -1, -1, 0, 1,
  329. 1, 0, 0, -1, 0, 0, 0, 1,
  330. 1, 1, 1, 0, 0, 0, 1, 1,
  331. 1, 1, 1, 1, 1, 1, 1, 1 } }
  332. #endif
  333. ;
  334. #define puzzle_1 puzzle_
  335. EXTERN const struct {
  336. const integer batdrp[9];
  337. } bats_
  338. #ifdef INIT
  339. = { 66, 67, 68, 69, 70, 71, 72, 65, 73 }
  340. #endif
  341. ;
  342. #define bats_1 bats_
  343. #endif