jargon

MISHAP22.BAS

Aug 20th, 2020
2,412
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #lang "qb"
  2. Option GoSub
  3.  
  4. 'MISHAP22 Engine: font routines (QBX)
  5. 'MISER'S HOUSE ANTHOLOGY PROJECT - MISHAP22 ENGINE - MISHAP22.BAS
  6.  
  7. #DEFINE __DEBUG_PS5__
  8. '#DEFINE __DEBUG_PET__
  9.  
  10. #IFNDEF __DEBUG_PS5__
  11.     CONST H = "0123456789ABCDEF"
  12.     CONST PI = 3.141592654#
  13. #ENDIF
  14.  
  15. #IFDEF __DEBUG_PS5__
  16.     #INCLUDE ONCE "./mishap22 font routines.bas"
  17. #ENDIF
  18.  
  19. DEFINT A-Z
  20.  
  21. DECLARE FUNCTION FNA(BYVAL XX)
  22. DECLARE SUB READPATH ()
  23.  
  24. DECLARE SUB READFONT ()
  25. DECLARE SUB READHELP ()
  26. DECLARE SUB READTEXT ()
  27. DECLARE SUB READFLAG ()
  28. DECLARE SUB READROOM ()
  29. DECLARE SUB READVERB ()
  30. DECLARE SUB READNOUN ()
  31. DECLARE SUB READITEM ()
  32. DECLARE SUB WAITKEY ()
  33. DECLARE SUB ENDPROGRAM ()
  34. DECLARE SUB GAMEHUD ()
  35.  
  36. #IFNDEF __DEBUG_PS5__
  37.     DECLARE FUNCTION HEX2BYTE (BYVAL VALUE AS STRING) AS INTEGER
  38.     DECLARE SUB DRAWFONT (BYVAL TXTDAT AS STRING)
  39.     DECLARE FUNCTION INPUTFONT (BYVAL TXTDAT AS STRING) AS STRING
  40.     DECLARE SUB LOADFONT (BYVAL INDEX AS INTEGER, BYVAL HEXDAT AS STRING)
  41. #ENDIF
  42.  
  43. DECLARE FUNCTION SANITIZE$ (BYVAL CMDINPUT AS STRING)
  44. DECLARE FUNCTION STR2$ (BYVAL VALUE AS STRING,BYVAL DIGITS AS INTEGER)
  45.  
  46. 0
  47.  
  48. DIM SHARED ENDOFFILE AS STRING
  49. DIM SHARED NUL AS STRING
  50. DIM SHARED FFF AS STRING
  51. ENDOFFILE = "EOF"
  52. NUL = SPACE$(0)
  53. FFF = NUL
  54.  
  55. DIM SHARED GAMESTART AS SINGLE
  56. DIM SHARED GAMECLOCK AS SINGLE
  57.  
  58. DIM SHARED GAMEDAYS AS LONG
  59. DIM SHARED GAMEHOURS AS LONG
  60. DIM SHARED GAMEMINS AS LONG
  61. DIM SHARED GAMESECS AS LONG
  62. DIM SHARED GAMEMS AS LONG
  63. DIM SHARED GAMETURNS AS LONG
  64.  
  65. DIM SHARED PATHPATH AS STRING
  66. DIM SHARED PATHFONT AS STRING
  67. DIM SHARED PATHHELP AS STRING
  68. DIM SHARED PATHFLAG AS STRING
  69. DIM SHARED PATHTEXT AS STRING
  70. DIM SHARED PATHNOUN AS STRING
  71. DIM SHARED PATHVERB AS STRING
  72. DIM SHARED PATHITEM AS STRING
  73. DIM SHARED PATHROOM AS STRING
  74.  
  75. DIM SHARED PATHLO%
  76. DIM SHARED PATHHI%
  77. DIM SHARED PATHCUR%
  78. DIM SHARED PATHTAG AS STRING
  79.  
  80. DIM SHARED FONTLO%
  81. DIM SHARED FONTHI%
  82. DIM SHARED FONTCUR%
  83.  
  84. #IFNDEF __DEBUG_PS5__
  85.     DIM SHARED FONT%(10240)
  86. #ENDIF
  87.  
  88. DIM SHARED HELPLO%
  89. DIM SHARED HELPHI%
  90. DIM SHARED HELPCUR%
  91. DIM SHARED HELP$(255)
  92.  
  93. DIM SHARED TEXTLO%
  94. DIM SHARED TEXTHI%
  95. DIM SHARED TEXTCUR%
  96. DIM SHARED TEXT$(1023)
  97.  
  98. DIM SHARED FLAGLO%
  99. DIM SHARED FLAGHI%
  100. DIM SHARED FLAGCUR%
  101. DIM SHARED FLAG%(1023)
  102.  
  103. DIM SHARED ROOMLO%
  104. DIM SHARED ROOMHI%
  105. DIM SHARED ROOMCUR%
  106. DIM SHARED ROOMDESC%(1023)
  107. DIM SHARED ROOMWALL%(1023, 6)
  108.  
  109. DIM SHARED VERBLO%
  110. DIM SHARED VERBHI%
  111. DIM SHARED VERBCUR%
  112. DIM SHARED VERB%(1023)
  113. DIM SHARED VERBALIAS%(1023)
  114.  
  115. DIM SHARED NOUNLO%
  116. DIM SHARED NOUNHI%
  117. DIM SHARED NOUNCUR%
  118. DIM SHARED NOUN%(1023)
  119. DIM SHARED NOUNALIAS%(1023)
  120. DIM SHARED NOUNITEM%(1023)
  121.  
  122. DIM SHARED ITEMLO%
  123. DIM SHARED ITEMHI%
  124. DIM SHARED ITEMCUR%
  125. DIM SHARED ITEMDESC%(1023)
  126. DIM SHARED ITEMROOM%(1023)
  127. DIM SHARED CMDINPUT AS STRING
  128. DIM SHARED CMDNOUN AS STRING
  129. DIM SHARED CMDVERB AS STRING
  130.  
  131. DIM SHARED CHARJUMP AS INTEGER
  132. DIM SHARED NOUNJUMP AS INTEGER
  133. DIM SHARED VERBJUMP AS INTEGER
  134. DIM SHARED ERRMSG AS INTEGER
  135. DIM SHARED DOORUNLOCKED AS INTEGER
  136. DIM SHARED FULLPOOL AS INTEGER
  137. DIM SHARED WALLFIRE AS INTEGER
  138. DIM SHARED JUMPMADE AS INTEGER
  139. DIM SHARED SNAKECHARMED AS INTEGER
  140. DIM SHARED ESCAPED AS INTEGER
  141. DIM SHARED VAULTOPEN AS INTEGER
  142. DIM SHARED GOODLUCK AS INTEGER
  143. DIM SHARED GAMETALLY AS LONG
  144. DIM SHARED FOUNDVAULT AS LONG
  145. DIM SHARED FOUNDCOMBO AS LONG
  146. DIM SHARED FOUNDITEMS AS LONG
  147. DIM SHARED LOOPX AS LONG
  148. DIM SHARED LOGICOR AS LONG
  149. DIM SHARED SPCPOSITION AS LONG
  150. DIM SHARED BUCKETFULL AS LONG
  151. DIM SHARED DEE AS LONG
  152. DIM SHARED PS AS LONG
  153. DIM SHARED QI AS LONG
  154.  
  155. 'DEF FNA (XX) = ITEMROOM%(ABS(NOUNITEM%(XX)))
  156. function FNA(BYVAL XX)
  157.     FNA=ITEMROOM%(ABS(NOUNITEM%(XX)))
  158. end function
  159.  
  160. 1
  161.  
  162. SCREEN 13
  163. COLOR 15
  164. CLS
  165.  
  166. READPATH
  167.  
  168. READFONT
  169. READHELP
  170.  
  171. 2
  172.  
  173. FOR HELPCUR% = HELPLO% TO HELPHI%
  174.     DRAWFONT HELP$(HELPCUR%)
  175.     IF ((HELPCUR% - HELPLO%) AND 7) = 0 AND (HELPCUR% < HELPHI%) THEN
  176.         WAITKEY
  177.     END IF
  178. NEXT
  179.  
  180. WAITKEY
  181.  
  182. DRAWFONT NUL
  183.  
  184. 5  REM COPYRIGHT (C) 1983 THE CODE WORKS
  185. 6  REM BOX 6905, SANTA BARBARA, CA 93160
  186. 7  REM
  187. 10 REM AS OF 1983 08/15 GF
  188.  
  189. 90
  190. REM GOTO 62000
  191.  
  192. 100
  193.  
  194. QI = 254
  195.  
  196. 105
  197.  
  198. 200
  199.  
  200. 210
  201.  
  202. CHARJUMP = 1
  203. NOUNJUMP = 2
  204. VERBJUMP = 3
  205. ERRMSG = 4
  206. DOORUNLOCKED = 5
  207. FULLPOOL = 6
  208. WALLFIRE = 7
  209. JUMPMADE = 8
  210. SNAKECHARMED = 9
  211. ESCAPED = 10
  212. VAULTOPEN = 11
  213. GOODLUCK = 12
  214. GAMETALLY = 13
  215. FOUNDVAULT = 14
  216. FOUNDCOMBO = 15
  217. FOUNDITEMS = 16
  218. LOOPX = 17
  219. LOGICOR = 18
  220. SPCPOSITION = 19
  221. BUCKETFULL = 20
  222. DEE = 21
  223. PS = 22
  224.  
  225. READTEXT
  226. READFLAG
  227.  
  228. 300
  229. READROOM
  230.  
  231. 500
  232. READVERB
  233.  
  234. 550
  235. READNOUN
  236.  
  237. 600
  238. READITEM
  239.  
  240. GAMESTART = TIMER
  241. GAMETURNS = -1&
  242.  
  243. 699 GOTO 14000
  244.  
  245. 700
  246. GOTO PROMPT
  247.  
  248. 1000
  249. SELECT CASE FLAG%(NOUNJUMP)
  250. CASE 0
  251.     GOTO 50000
  252. END SELECT
  253. 1002
  254. SELECT CASE NOUNITEM%(FLAG%(NOUNJUMP))
  255. CASE -1
  256.     DRAWFONT TEXT$(3)
  257.     GOTO 700
  258. END SELECT
  259. 1005
  260. SELECT CASE FNA(FLAG%(NOUNJUMP))
  261. CASE -1
  262.     DRAWFONT TEXT$(4)
  263.     GOTO 700
  264. END SELECT
  265. 1010
  266. SELECT CASE FNA(FLAG%(NOUNJUMP))
  267. CASE FLAG%(CHARJUMP)
  268. 1020
  269.     SELECT CASE ITEMROOM%(NOUNITEM%(FLAG%(NOUNJUMP)))
  270.     CASE -1
  271.         DRAWFONT TEXT$(48)
  272.     END SELECT
  273. 1030
  274.     SELECT CASE NOUNITEM%(FLAG%(NOUNJUMP))
  275.     CASE 4
  276.         DRAWFONT TEXT$(17)
  277.         FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
  278.     CASE 5
  279.         DRAWFONT TEXT$(17)
  280.         FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
  281.     CASE 6
  282.         DRAWFONT TEXT$(17)
  283.         FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
  284.     CASE 7
  285.         DRAWFONT TEXT$(17)
  286.         FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
  287.     CASE 8
  288.         DRAWFONT TEXT$(17)
  289.         FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
  290.     CASE 19
  291.         DRAWFONT TEXT$(17)
  292.         FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
  293.     END SELECT
  294. 1040
  295.     SELECT CASE FLAG%(NOUNJUMP)
  296.     CASE 2
  297.         SELECT CASE ITEMROOM%(20)
  298.         CASE -2
  299.             DRAWFONT TEXT$(18)
  300.             ITEMROOM%(20) = 0
  301.         END SELECT
  302. 1045
  303.     CASE 10
  304.         SELECT CASE ITEMROOM%(16)
  305.         CASE -2
  306.             GOTO 2200
  307.         END SELECT
  308.     END SELECT
  309. 1050
  310.     ITEMROOM%(NOUNITEM%(FLAG%(NOUNJUMP))) = -1
  311.     GOTO 700
  312. CASE ELSE
  313.     GOTO 51000
  314. END SELECT
  315.  
  316.  
  317. 2000
  318. SELECT CASE FLAG%(NOUNJUMP)
  319. CASE 0
  320.     GOTO 50000
  321. 2005
  322. CASE 13
  323.     SELECT CASE FLAG%(CHARJUMP)
  324.     CASE 5
  325.         SELECT CASE ROOMWALL%(5, 3)
  326.         CASE 0
  327.             GOTO 2100
  328.         END SELECT
  329.     END SELECT
  330. END SELECT
  331. 2010
  332. SELECT CASE NOUNITEM%(J)
  333. CASE -1
  334.     DRAWFONT TEXT$(5)
  335.     GOTO 700
  336. END SELECT
  337. 2020
  338. SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) - FLAG%(CHARJUMP)))
  339. CASE 1
  340.     SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) + 1))
  341.     CASE 1
  342.         GOTO 51000
  343.     END SELECT
  344. END SELECT
  345. 2030
  346. SELECT CASE FLAG%(NOUNJUMP)
  347. CASE 2
  348.     SELECT CASE ITEMROOM%(20)
  349.     CASE -2
  350.         GOTO 1040
  351.     END SELECT
  352. 2040
  353. CASE 10
  354.     SELECT CASE ITEMROOM%(16)
  355.     CASE -2
  356.         GOTO 2200
  357.     END SELECT
  358. END SELECT
  359. 2050
  360. DRAWFONT TEXT$(19)
  361. 2060
  362. GOTO 700
  363.  
  364.  
  365. 2100
  366. DRAWFONT TEXT$(20)
  367. 2110
  368. FLAG%(FOUNDVAULT) = 1
  369. GOTO 699
  370.  
  371. 2200
  372. DRAWFONT TEXT$(21)
  373. 2210
  374. ITEMROOM%(16) = 6
  375. GOTO 699
  376.  
  377.  
  378. 4000
  379. SELECT CASE FLAG%(NOUNJUMP)
  380. CASE 0
  381.     GOTO 50000
  382. 4002
  383. CASE 11
  384.     GOTO 4030
  385. END SELECT
  386. 4005
  387. SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) - FLAG%(CHARJUMP)))
  388. CASE 0
  389.     SELECT CASE FNA(FLAG%(NOUNJUMP))
  390.     CASE -1
  391. 4010
  392.         DRAWFONT TEXT$(22)
  393. 4011
  394. 4020
  395.         DRAWFONT TEXT$(23)
  396.         GOTO 700
  397.     END SELECT
  398. END SELECT
  399. 4030
  400. SELECT CASE FLAG%(NOUNJUMP)
  401. CASE 7
  402.     DRAWFONT TEXT$(24)
  403.     GOTO 700
  404. 4040
  405. CASE 12
  406. 4050
  407.     SELECT CASE FLAG%(CHARJUMP)
  408.     CASE 0
  409.         SELECT CASE FLAG%(DOORUNLOCKED)
  410.         CASE 0
  411.             DRAWFONT TEXT$(25)
  412.             GOTO 700
  413. 4060
  414.         CASE 1
  415.             DRAWFONT TEXT$(26)
  416.             GOTO 700
  417.         END SELECT
  418.     END SELECT
  419. 4070
  420.     REM IF FLAG%(CHARJUMP) <> 6 THEN
  421.         REM GOTO 51000
  422.     REM END IF
  423. 4080
  424. CASE 6
  425.     SELECT CASE ITEMROOM%(16)
  426.     CASE 6
  427.         DRAWFONT TEXT$(27)
  428. 4090
  429.         FLAG%(CHARJUMP) = 47
  430.         GOTO 699
  431.     END SELECT
  432.     GOTO 51000
  433. 4120
  434. CASE 13
  435. 4130
  436.     SELECT CASE ABS(SGN(ITEMROOM%(26) - FLAG%(CHARJUMP)))
  437.     CASE 1
  438.         GOTO 51000
  439.     END SELECT
  440. 4150
  441.     DRAWFONT TEXT$(28)
  442. 4155
  443.     GOTO 700
  444. 4160
  445. CASE 22
  446. 4170
  447.     SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) - FLAG%(CHARJUMP)))
  448.     CASE 1
  449.         SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) + 1))
  450.         CASE 1
  451.             GOTO 51000
  452.         END SELECT
  453.     END SELECT
  454. 4180
  455.     DRAWFONT TEXT$(29)
  456.     DRAWFONT TEXT$(30)
  457.     GOTO 700
  458. 4190
  459. CASE 27
  460. 4200
  461.     SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 5))
  462.     CASE 1
  463.         SELECT CASE FLAG%(FOUNDVAULT)
  464.         CASE 0
  465.             GOTO 51000
  466.         END SELECT
  467.     END SELECT
  468. 4210
  469.     SELECT CASE FLAG%(VAULTOPEN)
  470.     CASE 1
  471.         DRAWFONT TEXT$(31)
  472.         GOTO 700
  473.     END SELECT
  474. 4220
  475.     DRAWFONT TEXT$(32)
  476.     GOTO 700
  477. 4230
  478. CASE 16
  479.     DRAWFONT TEXT$(33)
  480.     GOTO 700
  481. 4232
  482. CASE 21
  483.     GOTO 51000
  484. END SELECT
  485. 4235
  486. SELECT CASE FLAG%(GOODLUCK)
  487. CASE 0
  488.     DRAWFONT TEXT$(34)
  489.     GOTO 700
  490. END SELECT
  491. 4240
  492. SELECT CASE ITEMROOM%(24)
  493. CASE -2
  494.     DRAWFONT TEXT$(35)
  495.     GOTO 700
  496. END SELECT
  497. 4250
  498. DRAWFONT TEXT$(36)
  499. 4260
  500. ITEMROOM%(24) = -2
  501. ITEMROOM%(25) = 21
  502. ITEMROOM%(19) = 21
  503. ITEMROOM%(17) = 21
  504. GOTO 699
  505.  
  506.  
  507. 5000
  508. SELECT CASE FLAG%(NOUNJUMP)
  509. CASE 0
  510.     GOTO 50000
  511. END SELECT
  512. 5010
  513. SELECT CASE ABS(SGN(SGN(NOUNITEM%(FLAG%(NOUNJUMP))) + 1))
  514. CASE 1
  515.     SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) - FLAG%(CHARJUMP)))
  516.     CASE 1
  517.         SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) + 1))
  518.         CASE 1
  519.             GOTO 51000
  520.         END SELECT
  521.     END SELECT
  522. END SELECT
  523. 5020
  524. SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 3))
  525. CASE 1
  526.     SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 11))
  527.     CASE 1
  528.         DRAWFONT TEXT$(37)
  529.         GOTO 700
  530.     END SELECT
  531. END SELECT
  532. 5030
  533. SELECT CASE FLAG%(NOUNJUMP)
  534. CASE 11
  535.     DRAWFONT TEXT$(38)
  536.     GOTO 700
  537. END SELECT
  538. 5040
  539. DRAWFONT TEXT$(39)
  540. DRAWFONT TEXT$(40)
  541. 5050
  542. FLAG%(FOUNDCOMBO) = 1
  543. GOTO 700
  544.  
  545.  
  546. 6000
  547. DRAWFONT TEXT$(41)
  548. 6010
  549. FLAG%(FOUNDITEMS) = 0
  550. FLAG%(LOOPX) = 1
  551. WHILE FLAG%(LOOPX) <= 27
  552. REM FOR FLAG%(LOOPX) = 1 TO 27
  553.     SELECT CASE ITEMROOM%(FLAG%(LOOPX))
  554.     CASE IS = -1
  555.         DRAWFONT TEXT$(ITEMDESC%(FLAG%(LOOPX)))
  556.         FLAG%(FOUNDITEMS) = FLAG%(FOUNDITEMS) + 1
  557. 6020
  558.         SELECT CASE FLAG%(LOOPX)
  559.         CASE 1
  560.             SELECT CASE FLAG%(BUCKETFULL)
  561.             CASE 1
  562.                 DRAWFONT TEXT$(42)
  563.             END SELECT
  564. 6025
  565.         CASE 14
  566.             DRAWFONT TEXT$(43)
  567.         END SELECT
  568.     END SELECT
  569. 6030
  570.     FLAG%(LOOPX) = FLAG%(LOOPX) + 1
  571. WEND
  572. REM NEXT FLAG%(LOOPX)
  573. SELECT CASE FLAG%(FOUNDITEMS)
  574. CASE 0
  575.     DRAWFONT TEXT$(44)
  576. END SELECT
  577. 6040
  578. GOTO 700
  579.  
  580. 6500
  581. DRAWFONT TEXT$(45)
  582. 6510
  583. FLAG%(FOUNDITEMS) = 0
  584. FLAG%(LOOPX) = 1
  585. WHILE FLAG%(LOOPX) <= 27
  586. REM FOR FLAG%(LOOPX) = 1 TO 27
  587.     SELECT CASE NOUNITEM%(FLAG%(NOUNJUMP))
  588.     CASE FLAG%(LOOPX)
  589.         FLAG%(LOGICOR) = 0
  590.         SELECT CASE ITEMROOM%(FLAG%(LOOPX))
  591.         CASE -1
  592.             FLAG%(LOGICOR) = 1
  593.         END SELECT
  594.         SELECT CASE ITEMROOM%(FLAG%(LOOPX))
  595.         CASE FLAG%(CHARJUMP)
  596.             FLAG%(LOGICOR) = FLAG%(LOGICOR) OR 1
  597.         END SELECT
  598.         SELECT CASE FLAG%(LOGICOR)
  599.         CASE 1
  600.             DRAWFONT TEXT$(ITEMDESC%(FLAG%(LOOPX)))
  601.             FLAG%(FOUNDITEMS) = FLAG%(FOUNDITEMS) + 1
  602. 6520
  603.             SELECT CASE FLAG%(LOOPX)
  604.             CASE 1
  605.                 SELECT CASE FLAG%(BUCKETFULL)
  606.                 CASE 1
  607.                     DRAWFONT TEXT$(42)
  608.                 END SELECT
  609.             END SELECT
  610. 6525
  611.             SELECT CASE FLAG%(LOOPX)
  612.             CASE 14
  613.                 DRAWFONT TEXT$(43)
  614.             END SELECT
  615.         END SELECT
  616.     END SELECT
  617. 6530
  618.     FLAG%(LOOPX) = FLAG%(LOOPX) + 1
  619. WEND
  620. REM NEXT FLAG%(LOOPX)
  621. SELECT CASE FLAG%(FOUNDITEMS)
  622. CASE 0
  623.     DRAWFONT TEXT$(46)
  624. END SELECT
  625. 6540
  626. GOTO 700
  627.  
  628.  
  629. 7000
  630. DRAWFONT TEXT$(47)
  631. 7001
  632. GOSUB 60000
  633. IF LEN(CMDINPUT) = 0 THEN
  634.     GOTO 7001
  635. END IF
  636. 7002
  637. IF UCASE$(LEFT$(CMDINPUT, 1)) <> UCASE$(LEFT$(TEXT$(49), 1)) THEN
  638.     REM DRAWFONT NUL
  639.     DRAWFONT TEXT$(48)
  640.     GOTO 700
  641. END IF
  642. 7005
  643. CLS
  644. GAMEHUD
  645. DRAWFONT NUL
  646. DRAWFONT NUL
  647. 7010
  648. DRAWFONT TEXT$(71) + STR2$(STR$(FLAG%(GAMETALLY)), 1) + TEXT$(72)
  649. 7020
  650. DRAWFONT TEXT$(73) + STR2$(STR$(FLAG%(GAMETALLY) * 20), 1) + TEXT$(74)
  651. 7030
  652. DRAWFONT TEXT$(52)
  653. SELECT CASE FLAG%(ESCAPED)
  654. CASE 0
  655.     DRAWFONT TEXT$(53)
  656. END SELECT
  657. 7040
  658. DRAWFONT TEXT$(54)
  659. SELECT CASE FLAG%(ESCAPED)
  660. CASE 1
  661.     FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
  662. END SELECT
  663. 7050
  664. SELECT CASE FLAG%(GAMETALLY) + 1
  665. CASE 0
  666.     DRAWFONT TEXT$(55)
  667. CASE 1
  668.     DRAWFONT TEXT$(56)
  669. CASE 2
  670.     DRAWFONT TEXT$(57)
  671. CASE 3
  672.     DRAWFONT TEXT$(58)
  673. CASE 4
  674.     DRAWFONT TEXT$(59)
  675. CASE 5
  676.     DRAWFONT TEXT$(60)
  677. CASE 6
  678.     DRAWFONT TEXT$(61)
  679. END SELECT
  680. 7060
  681. REM DRAWFONT TEXT$(55)
  682. REM GOTO 7120
  683. 7070
  684. REM DRAWFONT TEXT$(56)
  685. REM GOTO 7120
  686. 7075
  687. REM DRAWFONT TEXT$(57)
  688. REM GOTO 7120
  689. 7090
  690. REM DRAWFONT TEXT$(58)
  691. REM GOTO 7120
  692. 7100
  693. REM DRAWFONT TEXT$(59)
  694. REM GOTO 7120
  695. 7110
  696. REM DRAWFONT TEXT$(60)
  697. REM GOTO 7120
  698. 7115
  699. REM DRAWFONT TEXT$(61)
  700. 7120
  701. SELECT CASE ABS(SGN(FLAG%(GAMETALLY) - 6))
  702. CASE 1
  703.     DRAWFONT TEXT$(62)
  704. END SELECT
  705. 7150
  706. WAITKEY
  707. ENDPROGRAM
  708.  
  709. 8000
  710. SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) + 1))
  711. CASE 1
  712.     DRAWFONT TEXT$(63)
  713.     GOTO 700
  714. END SELECT
  715. 8010
  716. FLAG%(LOOPX) = NOUNITEM%(FLAG%(NOUNJUMP))
  717. 8015
  718. FLAG%(LOGICOR) = 0
  719. SELECT CASE SGN(FLAG%(LOOPX) - 3)
  720. CASE 1
  721.     SELECT CASE SGN(FLAG%(LOOPX) - 9)
  722.     CASE -1
  723.         FLAG%(LOGICOR) = 1
  724.     END SELECT
  725. SELECT CASE FLAG%(LOOPX)
  726. CASE 19
  727.     FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
  728. END SELECT
  729. SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
  730. CASE 1
  731.     DRAWFONT TEXT$(64)
  732.     GOTO 700
  733. END SELECT
  734.  
  735. 8020
  736. SELECT CASE FLAG%(CHARJUMP)
  737. CASE 19
  738.     SELECT CASE FLAG%(NOUNJUMP)
  739.     CASE 19
  740.         GOTO 8100
  741.     END SELECT
  742. 8030
  743. CASE 22
  744.     SELECT CASE FLAG%(NOUNJUMP)
  745.     CASE 20
  746.         GOTO 8200
  747.     END SELECT
  748. END SELECT
  749. 8040
  750. ITEMROOM%(NOUNITEM%(FLAG%(NOUNJUMP))) = FLAG%(CHARJUMP)
  751. DRAWFONT TEXT$(48)
  752. GOTO 700
  753. 8100
  754. DRAWFONT TEXT$(65)
  755. 8105
  756. 8110
  757. 8130
  758. ROOMWALL%(21, 3) = 22
  759. ITEMROOM%(12) = -2
  760. GOTO 700
  761. 8200
  762. DRAWFONT TEXT$(66)
  763. 8210
  764. DRAWFONT TEXT$(67)
  765. 8220
  766. FLAG%(GOODLUCK) = 1
  767. ITEMROOM%(11) = -2
  768. ROOMDESC%(22) = 68
  769. 8221
  770. ITEMDESC%(24) = 69
  771. GOTO 700
  772.  
  773.  
  774. 9000
  775. SELECT CASE FLAG%(NOUNJUMP)
  776. CASE 0
  777.     DRAWFONT TEXT$(70)
  778.     GOTO 700
  779. 9010
  780. CASE 14
  781.     GOTO 9100
  782. 9020
  783. CASE 15
  784.     GOTO 9200
  785. END SELECT
  786. 9030
  787. SELECT CASE SGN(FLAG%(NOUNJUMP) - 28)
  788. CASE 1
  789.     GOTO 9300
  790. END SELECT
  791. 9040
  792. DRAWFONT TEXT$(75) + RIGHT$(CMDINPUT, LEN(CMDINPUT) - FLAG%(SPCPOSITION)) + TEXT$(76)
  793. 9050
  794. DRAWFONT TEXT$(77)
  795. GOTO 700
  796. 9100
  797. FLAG%(LOGICOR) = 0
  798. SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 4))
  799. CASE 1
  800.     FLAG%(LOGICOR) = 1
  801. END SELECT
  802. SELECT CASE FLAG%(SNAKECHARMED)
  803. CASE 1
  804.     FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
  805. END SELECT
  806. SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
  807. CASE 1
  808.     DRAWFONT TEXT$(77)
  809.     GOTO 700
  810. END SELECT
  811. 9110
  812. DRAWFONT TEXT$(78)
  813. 9111
  814. 9120
  815. FLAG%(SNAKECHARMED) = 1
  816. ITEMROOM%(2) = -2
  817. ITEMROOM%(3) = 4
  818. GOTO 700
  819. 9200
  820.  
  821. FLAG%(LOGICOR) = 0
  822. SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 8))
  823. CASE 1
  824.     FLAG%(LOGICOR) = 1
  825. END SELECT
  826. SELECT CASE PORTALOPEN
  827. CASE 1
  828.     FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
  829. END SELECT
  830. SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
  831. CASE 1
  832.     DRAWFONT TEXT$(77)
  833.     GOTO 700
  834. END SELECT
  835. 9210
  836. DRAWFONT TEXT$(79)
  837. 9220
  838. PORTALOPEN = 1
  839. ROOMWALL%(8, 1) = 17
  840. ITEMROOM%(18) = 8
  841. GOTO 700
  842. 9300
  843. DRAWFONT TEXT$(80)
  844. GOTO 700
  845.  
  846. 10000
  847. SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 4))
  848. CASE 1
  849.     DRAWFONT TEXT$(10)
  850.     GOTO 700
  851. END SELECT
  852. 10010
  853. SELECT CASE ABS(SGN(ITEMROOM%(1) + 1))
  854. CASE 1
  855.     SELECT CASE ABS(SGN(ITEMROOM%(1) - FLAG%(CHARJUMP)))
  856.     CASE 1
  857.         GOTO 51000
  858.     END SELECT
  859. END SELECT
  860. 10020
  861. SELECT CASE FLAG%(BUCKETFULL)
  862. CASE 0
  863.     DRAWFONT TEXT$(81)
  864.     GOTO 700
  865. END SELECT
  866. 10030
  867. SELECT CASE FLAG%(CHARJUMP)
  868. CASE 19
  869.     DRAWFONT TEXT$(48)
  870.     GOTO 700
  871. 10040
  872. CASE 10
  873.     SELECT CASE FLAG%(WALLFIRE)
  874.     CASE 1
  875.         GOTO 10050
  876.     END SELECT
  877. END SELECT
  878. 10045
  879. DRAWFONT TEXT$(82)
  880. FLAG%(BUCKETFULL) = 0
  881. GOTO 700
  882. 10050
  883. DRAWFONT TEXT$(83)
  884. 10060
  885. FLAG%(WALLFIRE) = 0
  886. FLAG%(BUCKETFULL) = 0
  887. GOTO 699
  888.  
  889.  
  890. 11000
  891. SELECT CASE FLAG%(NOUNJUMP)
  892. CASE 0
  893.     GOTO 50000
  894. END SELECT
  895. 11010
  896. SELECT CASE NOUNITEM%(FLAG%(NOUNJUMP))
  897. CASE -1
  898.     DRAWFONT TEXT$(84)
  899.     GOTO 700
  900. END SELECT
  901. 11020
  902. SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) - FLAG%(CHARJUMP)))
  903. CASE 1
  904.     SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) + 1))
  905.     CASE 1
  906.         GOTO 51000
  907.     END SELECT
  908. END SELECT
  909. 11030
  910. SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 4))
  911. CASE 1
  912.     DRAWFONT TEXT$(84)
  913.     GOTO 700
  914. END SELECT
  915. 11040
  916. SELECT CASE FLAG%(BUCKETFULL)
  917. CASE 1
  918.     DRAWFONT TEXT$(85)
  919.     GOTO 700
  920. END SELECT
  921. 11050
  922. SELECT CASE FLAG%(CHARJUMP)
  923. CASE 25
  924.     SELECT CASE FLAG%(FULLPOOL)
  925.     CASE 1
  926.         DRAWFONT TEXT$(86)
  927.         GOTO 700
  928.     END SELECT
  929. END SELECT
  930. 11060
  931. SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 23))
  932. CASE 1
  933.     SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 19))
  934.     CASE 1
  935.         DRAWFONT TEXT$(87)
  936.         GOTO 700
  937.     END SELECT
  938. END SELECT
  939. 11070
  940. DRAWFONT TEXT$(88)
  941. FLAG%(BUCKETFULL) = 1
  942. GOTO 700
  943.  
  944.  
  945. 12000
  946. SELECT CASE FLAG%(NOUNJUMP)
  947. CASE 0
  948.     GOTO 50000
  949. END SELECT
  950. 12010
  951. SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 12))
  952. CASE 1
  953.     SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 27))
  954.     CASE 1
  955.         DRAWFONT TEXT$(89)
  956.         GOTO 700
  957.     END SELECT
  958. END SELECT
  959. 12020
  960. SELECT CASE ABS(SGN(FLAG%(CHARJUMP)))
  961. CASE 1
  962.     SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 5))
  963.     CASE 1
  964.         SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 6))
  965.         CASE 1
  966.             GOTO 51000
  967.         END SELECT
  968.     END SELECT
  969. 12030
  970. CASE 0
  971.     SELECT CASE FLAG%(NOUNJUMP)
  972.     CASE 12
  973.         GOTO 12200
  974.     END SELECT
  975. END SELECT
  976. 12040
  977. SELECT CASE FLAG%(CHARJUMP)
  978. CASE 5
  979.     SELECT CASE FLAG%(NOUNJUMP)
  980.     CASE 27
  981.         GOTO 12300
  982.     END SELECT
  983. END SELECT
  984. 12050
  985. FLAG%(LOGICOR) = 0
  986. SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 6))
  987. CASE 1
  988.     SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 12))
  989.     CASE 1
  990.         FLAG%(LOGICOR) = 1
  991.     END SELECT
  992. END SELECT
  993. SELECT CASE ITEMROOM%(16)
  994. CASE -2
  995.     FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
  996. END SELECT
  997. SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
  998. CASE 1
  999.     GOTO 51000
  1000. END SELECT
  1001. 12100
  1002. DRAWFONT TEXT$(90)
  1003. GOTO 700
  1004. 12200
  1005. SELECT CASE FLAG%(DOORUNLOCKED)
  1006. CASE 1
  1007.     DRAWFONT TEXT$(91)
  1008.     GOTO 700
  1009. END SELECT
  1010. 12210
  1011. SELECT CASE ABS(SGN(ITEMROOM%(20) + 1))
  1012. CASE 1
  1013.     DRAWFONT TEXT$(92)
  1014.     GOTO 700
  1015. END SELECT
  1016. 12220
  1017. DRAWFONT TEXT$(93)
  1018. FLAG%(DOORUNLOCKED) = 1
  1019. GOTO 699
  1020. 12300
  1021. SELECT CASE FLAG%(VAULTOPEN)
  1022. CASE 1
  1023.     DRAWFONT TEXT$(94)
  1024.     GOTO 700
  1025. END SELECT
  1026. 12305
  1027. SELECT CASE FLAG%(FOUNDVAULT)
  1028. CASE 0
  1029.     GOTO 51000
  1030. END SELECT
  1031. 12310
  1032. SELECT CASE FLAG%(FOUNDCOMBO)
  1033. CASE 0
  1034.     DRAWFONT TEXT$(95)
  1035.     GOTO 700
  1036. END SELECT
  1037. 12320
  1038. DRAWFONT TEXT$(96)
  1039. DRAWFONT TEXT$(97)
  1040. 12330
  1041. FLAG%(VAULTOPEN) = 1
  1042. ROOMWALL%(5, 3) = 46
  1043. GOTO 699
  1044.  
  1045.  
  1046. 14000
  1047. DRAWFONT TEXT$(98) + TEXT$(ROOMDESC%(FLAG%(CHARJUMP))) + TEXT$(99)
  1048. REM GOSUB 53000
  1049. REM DRAWFONT NUL
  1050. 14010
  1051. FLAG%(LOOPX) = 1
  1052. WHILE FLAG%(LOOPX) <= 28
  1053. REM FOR FLAG%(LOOPX) = 1 TO 28
  1054.     SELECT CASE ABS(SGN(ITEMROOM%(FLAG%(LOOPX)) - FLAG%(CHARJUMP)))
  1055.     CASE 1
  1056.         GOTO 14020
  1057.     END SELECT
  1058. 14011
  1059.     DRAWFONT TEXT$(100) + TEXT$(ITEMDESC%(FLAG%(LOOPX))) + TEXT$(101)
  1060.     REM DRAWFONT NUL
  1061.     REM GOSUB 53000
  1062.     REM DRAWFONT NUL
  1063. 14020
  1064.     SELECT CASE FLAG%(LOOPX)
  1065.     CASE 1
  1066.         SELECT CASE FLAG%(BUCKETFULL)
  1067.         CASE 1
  1068.             SELECT CASE ITEMROOM%(1)
  1069.             CASE FLAG%(CHARJUMP)
  1070.                 DRAWFONT TEXT$(42)
  1071.             END SELECT
  1072.         END SELECT
  1073.     END SELECT
  1074. 14030
  1075.     FLAG%(LOOPX) = FLAG%(LOOPX) + 1
  1076. WEND
  1077. REM NEXT FLAG%(LOOPX)
  1078. 14040
  1079. SELECT CASE FLAG%(CHARJUMP)
  1080. CASE 25
  1081.     SELECT CASE FLAG%(FULLPOOL)
  1082.     CASE 1
  1083.         DRAWFONT TEXT$(102)
  1084.     END SELECT
  1085. END SELECT
  1086. 14050
  1087. FLAG%(LOGICOR) = 0
  1088. SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 25))
  1089. CASE 1
  1090.     FLAG%(LOGICOR) = 1
  1091. END SELECT
  1092. SELECT CASE FLAG%(FULLPOOL)
  1093. CASE 1
  1094.     FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
  1095. END SELECT
  1096. SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
  1097. CASE 1
  1098.     GOTO 14060
  1099. END SELECT
  1100. 14055
  1101. SELECT CASE FLAG%(CHARJUMP)
  1102. CASE 25
  1103.     SELECT CASE FLAG%(POOLFULL)
  1104.     CASE 0
  1105.         SELECT CASE ITEMROOM%(7)
  1106.         CASE 48
  1107.             DRAWFONT TEXT$(103)
  1108.         END SELECT
  1109.     END SELECT
  1110. END SELECT
  1111. 14060
  1112. FLAG%(LOGICOR) = 0
  1113. SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 10))
  1114. CASE 1
  1115.     FLAG%(LOGICOR) = 1
  1116. END SELECT
  1117. SELECT CASE FLAG%(WALLFIRE)
  1118. CASE 0
  1119.     FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
  1120. END SELECT
  1121. SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
  1122. CASE 1
  1123.         GOTO 14090
  1124. END SELECT
  1125. 14070
  1126. DRAWFONT TEXT$(104)
  1127. 14080
  1128. DRAWFONT TEXT$(105)
  1129. 14090
  1130. SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 16))
  1131. CASE 1
  1132.     GOTO 14110
  1133. END SELECT
  1134. 14100
  1135. DRAWFONT TEXT$(106)
  1136. 14105
  1137. REM GOSUB 53000
  1138. REM DRAWFONT NUL
  1139. 14110
  1140. SELECT CASE FLAG%(CHARJUMP)
  1141. CASE 26
  1142.     DRAWFONT TEXT$(107)
  1143. END SELECT
  1144. CASE 23
  1145.     DRAWFONT TEXT$(108)
  1146. 14120
  1147. CASE 10
  1148.     SELECT CASE FLAG%(WALLFIRE)
  1149.     CASE 0
  1150.         DRAWFONT TEXT$(109)
  1151.     END SELECT
  1152. 14125
  1153. CASE 5
  1154.     SELECT CASE FLAG%(FOUNDVAULT)
  1155.     CASE 1
  1156.         DRAWFONT TEXT$(110)
  1157.     END SELECT
  1158. 14126
  1159.     SELECT CASE FLAG%(VAULTOPEN)
  1160.     CASE 1
  1161.         DRAWFONT TEXT$(111)
  1162.     END SELECT
  1163. 14127
  1164. CASE 0
  1165.     SELECT CASE FLAG%(DOORUNLOCKED)
  1166.     CASE 1
  1167.         DRAWFONT TEXT$(112)
  1168.     END SELECT
  1169. END SELECT
  1170. 14130
  1171.  
  1172.  
  1173. FLAG%(LOGICOR) = 0
  1174. SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 1))
  1175. CASE 1
  1176.     FLAG%(LOGICOR) = 1
  1177. END SELECT
  1178. SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 2))
  1179. CASE 1
  1180.     FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
  1181. END SELECT
  1182. SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 3))
  1183. CASE 1
  1184.     FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
  1185. END SELECT
  1186. SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 4))
  1187. CASE 1
  1188.     FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
  1189. END SELECT
  1190. SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
  1191. CASE 1
  1192.     CMDINPUT = TEXT$(141)
  1193.     SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 1))
  1194.     CASE 1
  1195.         CMDINPUT = CMDINPUT + TEXT$(295)
  1196.     END SELECT
  1197. 14140
  1198.     SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 2))
  1199.     CASE 1
  1200.         CMDINPUT = CMDINPUT + TEXT$(296)
  1201.     END SELECT
  1202. 14150
  1203.     SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 3))
  1204.     CASE 1
  1205.         CMDINPUT = CMDINPUT + TEXT$(297)
  1206.     END SELECT
  1207. 14160
  1208.     SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 4))
  1209.     CASE 1
  1210.         CMDINPUT = CMDINPUT + TEXT$(298)
  1211.     END SELECT
  1212.     DRAWFONT CMDINPUT
  1213. END SELECT
  1214. 14170
  1215. REM DRAWFONT NUL
  1216. GOTO 700
  1217.  
  1218.  
  1219. 15000
  1220. SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 8))
  1221. CASE 1
  1222.     SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 18))
  1223.     CASE 1
  1224.         SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 28))
  1225.         CASE 1
  1226.             GOTO 50000
  1227.         END SELECT
  1228.     END SELECT
  1229. END SELECT
  1230. 15010
  1231. FLAG%(LOGICOR) = 0
  1232. SELECT CASE FLAG%(NOUNJUMP)
  1233. CASE 8
  1234.     SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 48))
  1235.     CASE 1
  1236.         FLAG%(LOGICOR) = 1
  1237.     END SELECT
  1238. END SELECT
  1239. SELECT CASE FLAG%(NOUNJUMP)
  1240. CASE 28
  1241.     SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 25))
  1242.     CASE 1
  1243.         FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
  1244.     END SELECT
  1245. END SELECT
  1246. SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
  1247. CASE 1
  1248.     GOTO 51000
  1249. END SELECT
  1250. 15015
  1251. SELECT CASE FLAG%(NOUNJUMP)
  1252. CASE 18
  1253.     SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 2))
  1254.     CASE 1
  1255.         SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 27))
  1256.         CASE 1
  1257.             GOTO 51000
  1258.         END SELECT
  1259.     END SELECT
  1260. 15020
  1261. CASE 8
  1262.     FLAG%(CHARJUMP) = 25
  1263.     GOTO 699
  1264. 15030
  1265. CASE 28
  1266.     SELECT CASE FLAG%(FULLPOOL)
  1267.     CASE 1
  1268.         DRAWFONT TEXT$(102)
  1269.         GOTO 700
  1270.     END SELECT
  1271. 15040
  1272. CASE 28
  1273.     FLAG%(CHARJUMP) = 48
  1274.     GOTO 699
  1275. END SELECT
  1276. 15050
  1277. SELECT CASE FLAG%(CHARJUMP)
  1278. CASE 27
  1279.     FLAG%(CHARJUMP) = 2
  1280.     GOTO 699
  1281. END SELECT
  1282. 15060
  1283. SELECT CASE ITEMROOM%(9)
  1284. CASE -1
  1285.     GOTO 15070
  1286. END SELECT
  1287. 15061
  1288. DRAWFONT TEXT$(113)
  1289. REM GOSUB 53000
  1290. 15062
  1291. REM DRAWFONT NUL
  1292. GOTO 700
  1293. 15070
  1294. DRAWFONT TEXT$(114)
  1295. 15080
  1296. FLAG%(CHARJUMP) = 27
  1297. GOTO 699
  1298.  
  1299.  
  1300. 16000
  1301. SELECT CASE FLAG%(CHARJUMP)
  1302. CASE 0
  1303.     SELECT CASE FLAG%(DOORUNLOCKED)
  1304.     CASE 0
  1305.         DRAWFONT TEXT$(115)
  1306.         GOTO 700
  1307.     END SELECT
  1308. END SELECT
  1309. 16010
  1310. SELECT CASE ROOMWALL%(FLAG%(CHARJUMP), 1)
  1311. CASE 0
  1312.     GOTO 52000
  1313. END SELECT
  1314. 16015
  1315. SELECT CASE FLAG%(CHARJUMP)
  1316. CASE 0
  1317.     DRAWFONT TEXT$(116)
  1318. END SELECT
  1319. 16020
  1320. FLAG%(CHARJUMP) = ROOMWALL%(FLAG%(CHARJUMP), 1)
  1321. GOTO 699
  1322.  
  1323. 17000
  1324. SELECT CASE FLAG%(CHARJUMP)
  1325. CASE 10
  1326.     SELECT CASE FLAG%(WALLFIRE)
  1327.     CASE 1
  1328.         DRAWFONT TEXT$(117)
  1329.         WAITKEY
  1330.         ENDPROGRAM
  1331.     END SELECT
  1332. 17010
  1333. CASE 4
  1334.     SELECT CASE FLAG%(SNAKECHARMED)
  1335.     CASE 0
  1336.         GOTO 17060
  1337.     END SELECT
  1338. END SELECT
  1339. 17030
  1340. FLAG%(DEE) = 2
  1341. FLAG%(LOGICOR) = 0
  1342. SELECT CASE FLAG%(VERBJUMP)
  1343. CASE 21
  1344.     FLAG%(LOGICOR) = 1
  1345. CASE 22
  1346.     FLAG%(LOGICOR) = 1
  1347. END SELECT
  1348. SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
  1349. CASE 1
  1350.     FLAG%(DEE) = 3
  1351. END SELECT
  1352. 17040
  1353. SELECT CASE ROOMWALL%(FLAG%(CHARJUMP), FLAG%(DEE))
  1354. CASE 0
  1355.     GOTO 52000
  1356. END SELECT
  1357. 17050
  1358. FLAG%(CHARJUMP) = ROOMWALL%(FLAG%(CHARJUMP), FLAG%(DEE))
  1359. GOTO 699
  1360. 17060
  1361. SELECT CASE FLAG%(PS)
  1362. CASE 0
  1363.     DRAWFONT TEXT$(118)
  1364.     FLAG%(PS) = 1
  1365.     GOTO 700
  1366. END SELECT
  1367.  
  1368. 17070
  1369. DRAWFONT TEXT$(119)
  1370. DRAWFONT TEXT$(120)
  1371. WAITKEY
  1372. ENDPROGRAM
  1373.  
  1374.  
  1375. 19000
  1376. SELECT CASE ROOMWALL%(FLAG%(CHARJUMP), 4)
  1377. CASE 0
  1378.     GOTO 52000
  1379. END SELECT
  1380. 19010
  1381. FLAG%(CHARJUMP) = ROOMWALL%(FLAG%(CHARJUMP), 4)
  1382. GOTO 699
  1383. 20000
  1384. REM DRAWFONT NUL
  1385. DRAWFONT TEXT$(121)
  1386. CMDINPUT = TEXT$(122)
  1387. 20010
  1388. CMDINPUT = CMDINPUT + STR2$(STR$(FLAG%(GAMETALLY) * 20), 1) + TEXT$(74)
  1389. DRAWFONT CMDINPUT
  1390. DRAWFONT TEXT$(52)
  1391. 20020
  1392. DRAWFONT TEXT$(51)
  1393. 20030
  1394. GOSUB 60000
  1395. 20040
  1396. REM DRAWFONT NUL
  1397. IF UCASE$(LEFT$(CMDINPUT, 1)) = UCASE$(LEFT$(TEXT$(49), 1)) THEN
  1398.     GOTO 7010
  1399. END IF
  1400. 20050
  1401. IF UCASE$(LEFT$(CMDINPUT, 1)) <> UCASE$(LEFT$(TEXT$(50), 1)) THEN
  1402.     DRAWFONT TEXT$(7)
  1403.     GOTO 20020
  1404. END IF
  1405. 20060
  1406. DRAWFONT TEXT$(48)
  1407. REM DRAWFONT NUL
  1408. GOTO 700
  1409. 21000
  1410. SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 7))
  1411. CASE 1
  1412.     DRAWFONT TEXT$(8)
  1413.     GOTO 700
  1414. END SELECT
  1415. 21010
  1416. SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 26))
  1417. CASE 1
  1418.     GOTO 51000
  1419. END SELECT
  1420. 21020
  1421. 21030
  1422. DRAWFONT TEXT$(140)
  1423. 21040
  1424. FLAG%(FULLPOOL) = 1 - FLAG%(FULLPOOL)
  1425. 21050
  1426. SELECT CASE FLAG%(FULLPOOL)
  1427. CASE 0
  1428.     SELECT CASE ITEMROOM%(7)
  1429.     CASE -3
  1430.         ITEMROOM%(7) = 25
  1431.         GOTO 700
  1432.     END SELECT
  1433. 21060
  1434. CASE 1
  1435.     SELECT CASE ITEMROOM%(7)
  1436.     CASE 25
  1437.         ITEMROOM%(7) = -3
  1438.         GOTO 700
  1439.     END SELECT
  1440. END SELECT
  1441. 21070
  1442. GOTO 700
  1443. 22000
  1444. SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 27))
  1445. CASE 1
  1446.     SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 29))
  1447.     CASE 1
  1448.         SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 32))
  1449.         CASE 1
  1450.             GOTO 22050
  1451.         END SELECT
  1452.     END SELECT
  1453. END SELECT
  1454. 22010
  1455. DRAWFONT TEXT$(123)
  1456. SELECT CASE FLAG%(CHARJUMP)
  1457. CASE 27
  1458.     GOTO 22500
  1459. END SELECT
  1460. 22020
  1461. SELECT CASE ITEMROOM%(14)
  1462. CASE -1
  1463.     GOTO 22100
  1464. END SELECT
  1465. 22030
  1466. SELECT CASE ITEMROOM%(27)
  1467. CASE -1
  1468.     GOTO 22200
  1469. END SELECT
  1470. 22040
  1471. DRAWFONT TEXT$(124)
  1472. GOTO 22540
  1473. 22050
  1474. DRAWFONT TEXT$(125)
  1475. GOTO 700
  1476. 22100
  1477. DRAWFONT TEXT$(126)
  1478. GOTO 22040
  1479. 22200
  1480. DRAWFONT TEXT$(127)
  1481. 22210
  1482. SELECT CASE FLAG%(CHARJUMP)
  1483. CASE 32
  1484.     FLAG%(CHARJUMP) = 40
  1485.     GOTO 699
  1486. END SELECT
  1487. 22220
  1488. DRAWFONT TEXT$(128)
  1489. DRAWFONT TEXT$(129)
  1490. 22230
  1491. FLAG%(ESCAPED) = 1
  1492. GOTO 7010
  1493. 22500
  1494. SELECT CASE FLAG%(JUMPMADE)
  1495. CASE 1
  1496.     GOTO 22530
  1497. END SELECT
  1498. 22510
  1499. DRAWFONT TEXT$(130)
  1500. 22520
  1501. FLAG%(JUMPMADE) = 1
  1502. FLAG%(CHARJUMP) = 2
  1503. GOTO 699
  1504. 22530
  1505. DRAWFONT TEXT$(131)
  1506. 22535
  1507. 22540
  1508. DRAWFONT TEXT$(120)
  1509. WAITKEY
  1510. ENDPROGRAM
  1511.  
  1512. 24000
  1513. SELECT CASE FLAG%(CHARJUMP)
  1514. CASE 19
  1515.     DRAWFONT TEXT$(16)
  1516.     GOTO 700
  1517. END SELECT
  1518. 24010
  1519. SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 25))
  1520. CASE 1
  1521.     DRAWFONT TEXT$(9)
  1522.     GOTO 700
  1523. END SELECT
  1524. 24020
  1525. SELECT CASE FLAG%(FULLPOOL)
  1526. CASE 1
  1527.     DRAWFONT TEXT$(14)
  1528.     GOTO 700
  1529. END SELECT
  1530. 24030
  1531. DRAWFONT TEXT$(15)
  1532. GOTO 700
  1533. 25000
  1534. SELECT CASE FLAG%(NOUNJUMP)
  1535. CASE 0
  1536.     GOTO 50000
  1537. 25010
  1538. CASE 7
  1539.     DRAWFONT TEXT$(13)
  1540.     GOTO 700
  1541. END SELECT
  1542. 25020
  1543. SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 17))
  1544. CASE 1
  1545.     DRAWFONT TEXT$(10)
  1546.     GOTO 700
  1547. END SELECT
  1548. 25030
  1549. SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) - FLAG%(CHARJUMP)))
  1550. CASE 1
  1551.     SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) + 1))
  1552.     CASE 1
  1553.         GOTO 51000
  1554.     END SELECT
  1555. END SELECT
  1556. 25040
  1557. SELECT CASE ITEMROOM%(14)
  1558. CASE -2
  1559.     DRAWFONT TEXT$(11)
  1560.     GOTO 700
  1561. END SELECT
  1562. 25050
  1563. SELECT CASE ABS(SGN(ITEMROOM%(17) + 1))
  1564. CASE 1
  1565.     DRAWFONT TEXT$(12)
  1566.     GOTO 700
  1567. END SELECT
  1568. 25060
  1569. DRAWFONT TEXT$(132)
  1570. 25070
  1571. ITEMROOM%(27) = ITEMROOM%(14)
  1572. ITEMROOM%(14) = -2
  1573. NOUNITEM%(17) = 27
  1574. ITEMROOM%(17) = 0
  1575. GOTO 700
  1576.  
  1577. 50000
  1578. DRAWFONT TEXT$(FLAG%(ERRMSG))
  1579. FLAG%(ERRMSG) = (FLAG%(ERRMSG) MOD 2) + 1
  1580. GOTO 700
  1581. 51000
  1582. DRAWFONT TEXT$(133)
  1583. GOTO 700
  1584. 52000
  1585. DRAWFONT TEXT$(134)
  1586. GOTO 700
  1587. 53000
  1588. DRAWFONT CMDINPUT
  1589. RETURN
  1590. IF LEN(CMDINPUT) <= 40 THEN
  1591.     DRAWFONT CMDINPUT
  1592.     RETURN
  1593. END IF
  1594. 53005
  1595. CMDEND = 40
  1596. 53010
  1597. IF MID$(CMDINPUT, CMDEND, 1) <> " " THEN
  1598.     CMDEND = CMDEND - 1
  1599.     GOTO 53010
  1600. END IF
  1601. 53020
  1602. DRAWFONT LEFT$(CMDINPUT, CMDEND)
  1603. DRAWFONT RIGHT$(CMDINPUT, LEN(CMDINPUT) - CMDEND)
  1604. RETURN
  1605.  
  1606. 60000
  1607. GAMETURNS = GAMETURNS + 1&
  1608. CMDINPUT = INPUTFONT(NUL)
  1609. RETURN
  1610.  
  1611. PROMPT:
  1612. REM DRAWFONT NUL
  1613. GOSUB 60000
  1614. CMDVERB = NUL
  1615. CMDNOUN$ = NUL
  1616. CMDINPUT = UCASE$(SANITIZE$(CMDINPUT)) + SPACE$(1)
  1617. CMDVERB = LEFT$(CMDINPUT, INSTR(1, CMDINPUT, SPACE$(1)) - 1)
  1618. CMDINPUT = RIGHT$(CMDINPUT, LEN(CMDINPUT) - LEN(CMDVERB) - 1)
  1619. CMDINPUT = UCASE$(SANITIZE$(CMDINPUT)) + SPACE$(1)
  1620. CMDNOUN = LEFT$(CMDINPUT, INSTR(1, CMDINPUT, SPACE$(1)) - 1)
  1621. CMDINPUT = RIGHT$(CMDINPUT, LEN(CMDINPUT) - LEN(CMDNOUN) - 1)
  1622. CMDINPUT = UCASE$(SANITIZE$(CMDINPUT)) + SPACE$(1)
  1623.  
  1624. REM DRAWFONT TEXT$(135) + "[" + CMDVERB + "] " + TEXT$(136) + "[" + CMDNOUN + "]"
  1625.  
  1626. IF CMDINPUT <> SPACE$(1) THEN
  1627.     DRAWFONT TEXT$(6)
  1628.     GOTO PROMPT
  1629. END IF
  1630.  
  1631. FLAG%(LOOPX) = VERBLO%
  1632. WHILE FLAG%(LOOPX) <= VERBHI%
  1633. REM FOR FLAG%(LOOPX) = VERBLO% TO VERBHI%
  1634.     REM DRAWFONT TEXT$(VERB%(FLAG%(LOOPX)))
  1635.     IF CMDVERB = TEXT$(VERB%(FLAG%(LOOPX))) THEN
  1636.         FLAG%(VERBJUMP) = FLAG%(LOOPX)
  1637.         FLAG%(VERBJUMP) = VERBALIAS%(FLAG%(VERBJUMP))
  1638.         CMDVERB = TEXT$(VERB%(FLAG%(VERBJUMP)))
  1639.         GOTO 800
  1640.     END IF
  1641.     FLAG%(LOOPX) = FLAG%(LOOPX) + 1
  1642. WEND
  1643. REM NEXT FLAG%(LOOPX)
  1644. GOTO 50000
  1645. 800
  1646. IF LEN(CMDNOUN) = 0 THEN
  1647.     FLAG%(NOUNJUMP) = 0
  1648.     GOTO 900
  1649. ELSE
  1650.     FLAG%(LOOPX) = NOUNLO%
  1651.     WHILE FLAG%(LOOPX) <= NOUNHI%
  1652.     REM FOR FLAG%(LOOPX) = NOUNLO% TO NOUNHI%
  1653.         REM DRAWFONT TEXT$(NOUN%(FLAG%(LOOPX)))
  1654.         IF CMDNOUN = TEXT$(NOUN%(FLAG%(LOOPX))) THEN
  1655.             FLAG%(NOUNJUMP) = FLAG%(LOOPX)
  1656.             GOTO 900
  1657.         END IF
  1658.         FLAG%(NOUNJUMP) = NOUNALIAS%(FLAG%(NOUNJUMP))
  1659.         FLAG%(LOOPX) = FLAG%(LOOPX) + 1
  1660.     WEND
  1661.     REM NEXT FLAG%(LOOPX)
  1662. END IF
  1663. GOTO 50000
  1664. 900
  1665. SELECT CASE FLAG%(VERBJUMP)
  1666. CASE 1
  1667.     GOTO 1000: REM GET/TAKE
  1668. CASE 3
  1669.     GOTO 2000: REM MOVE/SLIDE/PUSH
  1670. CASE 6
  1671.     GOTO 4000: REM OPEN
  1672. CASE 7
  1673.     GOTO 5000: REM READ
  1674. CASE 8
  1675.     GOTO 6000: REM INVENTORY/I
  1676. CASE 9
  1677.     GOTO 7000: REM QUIT/Q
  1678. CASE 10
  1679.     GOTO 8000: REM DROP
  1680. CASE 11
  1681.     GOTO 9000: REM SAY
  1682. CASE 12
  1683.     GOTO 10000: REM POUR
  1684. CASE 13
  1685.     GOTO 11000: REM FILL
  1686. CASE 14
  1687.     GOTO 12000: REM UNLOCK
  1688. CASE 15
  1689.     GOTO 14000: REM LOOK
  1690. CASE 16
  1691.     GOTO 15000: REM GO
  1692. CASE 17
  1693.     GOTO 16000: REM NORTH/N
  1694. CASE 19
  1695.     GOTO 17000: REM SOUTH/S
  1696. CASE 21
  1697.     GOTO 17010: REM EAST/E
  1698. CASE 23
  1699.     GOTO 19000: REM WEST/W
  1700. CASE 25
  1701.     GOTO 20000: REM SCORE
  1702. CASE 26
  1703.     GOTO 21000: REM TURN
  1704. CASE 27
  1705.     GOTO 22000: REM JUMP
  1706. CASE 28
  1707.     GOTO 24000: REM SWIM
  1708. CASE 30
  1709.     GOTO 25000: REM FIX
  1710. CASE 32
  1711.     GOTO 6500: REM INSPECT
  1712. CASE ELSE
  1713.     GOTO 1000
  1714. END SELECT
  1715. GOTO 1000
  1716.  
  1717. #IFNDEF __DEBUG_PS5__
  1718. SUB DRAWFONT (BYVAL TXTDAT AS STRING)
  1719.     DIM X AS INTEGER
  1720.     DIM Y AS INTEGER
  1721.     DIM BUF AS STRING
  1722.     DIM LP AS LONG
  1723.     DIM RP AS LONG
  1724.     X = POS(0)
  1725.     Y = CSRLIN
  1726.     IF LEN(TXTDAT) = 0 THEN
  1727.         PRINT
  1728.         EXIT SUB
  1729.     END IF
  1730.     BUF = TXTDAT + SPACE$(1)
  1731.     DO
  1732.         IF LEN(BUF) = 0 THEN EXIT DO
  1733.         RP = 1
  1734.         WHILE RP < 42 AND RP > 0
  1735.             LP = RP
  1736.             RP = INSTR(LP + 1, BUF, SPACE$(1))
  1737.         WEND
  1738.         FOR RP = 1 TO LP - 1
  1739.             X = POS(0)
  1740.             Y = CSRLIN
  1741.             IF X < 40 THEN
  1742.                 LOCATE CSRLIN, POS(0) + 1
  1743.             ELSEIF Y < 25 THEN
  1744.                 LOCATE CSRLIN + 1, 1
  1745.             ELSE
  1746.                 LOCATE 25, 1
  1747.             END IF
  1748.             IF ASC(MID$(BUF, RP, 1)) <> 32 THEN
  1749.                 PUT ((X - 1) * 8, (Y - 1) * 8), FONT%(ASC(MID$(BUF, RP, 1)) * 40), PSET
  1750.             ELSE
  1751.                 LINE ((X - 1) * 8, (Y - 1) * 8)-(X * 8 - 1, Y * 8 - 1), 0, BF
  1752.             END IF
  1753.         NEXT
  1754.         X = POS(0)
  1755.         Y = CSRLIN
  1756.         IF Y < 25 THEN
  1757.             LOCATE CSRLIN, 1
  1758.         ELSE
  1759.             LOCATE 25, 1
  1760.         END IF
  1761.         PRINT
  1762.         BUF = RIGHT$(BUF, LEN(BUF) - LP)
  1763.     LOOP
  1764. END SUB
  1765. #ENDIF
  1766.  
  1767. SUB ENDPROGRAM
  1768.     CLS
  1769.     SCREEN 0
  1770.     WIDTH 80, 25
  1771.     COLOR 15, 0
  1772.     END
  1773. END SUB
  1774.  
  1775. SUB GAMEHUD
  1776.     DIM X AS INTEGER
  1777.     DIM Y AS INTEGER
  1778.     DIM DIF AS SINGLE
  1779.     X = POS(0)
  1780.     Y = CSRLIN
  1781.     GAMECLOCK = TIMER
  1782.     DIF = GAMECLOCK - GAMESTART
  1783.     GAMESTART = GAMECLOCK
  1784.     IF DIF < -21600! THEN
  1785.         DIF = DIF + 86400!
  1786.     ELSEIF DIF < 0! THEN
  1787.         DIF = 0!
  1788.     END IF
  1789.     DIM MS AS LONG
  1790.     DIM SECS AS LONG
  1791.     DIM MINS AS LONG
  1792.     DIM HOURS AS LONG
  1793.     DIM DAYS AS LONG
  1794.     DAYS = CLNG(DIF / 86400!)
  1795.     DIF = DIF - CSNG(86400! * DAYS)
  1796.     HOURS = CLNG(DIF / 3600!)
  1797.     DIF = DIF - CSNG(3600! * HOURS)
  1798.     MINS = CLNG(DIF / 60!)
  1799.     DIF = DIF - CSNG(3600! * MINS)
  1800.     SECS = CLNG(DIF)
  1801.     DIF = DIF - CSNG(SECS)
  1802.     MS = CLNG(DIF * 1000)
  1803.     GAMEMS = GAMEMS + MS
  1804.     IF GAMEMS > 999& THEN
  1805.         GAMESECS = GAMESECS + CLNG(GAMEMS / 1000&)
  1806.         GAMEMS = GAMEMS MOD 1000&
  1807.     END IF
  1808.     GAMESECS = GAMESECS + SECS
  1809.     IF GAMESECS > 59& THEN
  1810.         GAMEMINS = GAMEMINS + CLNG(GAMESECS / 60&)
  1811.         GAMESECS = GAMESECS MOD 60&
  1812.     END IF
  1813.     GAMEMINS = GAMEMINS + MINS
  1814.     IF GAMEMINS > 59& THEN
  1815.         GAMEHOURS = GAMEHOURS + CLNG(GAMEMINS / 60&)
  1816.         GAMEMINS = GAMEMINS MOD 60&
  1817.     END IF
  1818.     GAMEHOURS = GAMEHOURS + HOURS
  1819.     IF GAMEHOURS > 23 THEN
  1820.         GAMEDAYS = GAMEDAYS + CLNG(GAMEHOURS / 24&)
  1821.         GAMEHOURS = GAMEHOURS MOD 24&
  1822.     END IF
  1823.     LOCATE 1, 1
  1824.     DRAWFONT "Time: " + STR2$(STR$(GAMEDAYS), 5) + ":" + STR2$(STR$(GAMEHOURS), 2) + ":" + STR2$(STR$(GAMEMINS), 2) + ":" + STR2$(STR$(GAMESECS), 2) + "." + STR2$(STR$(GAMEMS), 3) + " Turns: " + STR2$(STR$(GAMETURNS), 8)
  1825.     LOCATE Y, X
  1826. END SUB
  1827.  
  1828. #IFNDEF __DEBUG_PS5__
  1829. FUNCTION HEX2BYTE (BYVAL VALUE AS STRING) as INTEGER
  1830.     'DIM H AS STRING
  1831.     'H = "0123456789ABCDEF"
  1832.     HEX2BYTE = (((INSTR(1, UCASE$(H), LEFT$(VALUE, 1)) - 1) AND 15) * 16) OR ((INSTR(1, UCASE$(H), MID$(VALUE, 2, 1)) - 1) AND 15)
  1833. END FUNCTION
  1834. #ENDIF
  1835.  
  1836. #IFNDEF __DEBUG_PS5__
  1837. FUNCTION INPUTFONT (BYVAL TXTDAT AS STRING) AS STRING
  1838.     DIM X AS INTEGER
  1839.     DIM Y AS INTEGER
  1840.     DIM C AS STRING
  1841.     DIM CI AS STRING
  1842.     DIM T AS INTEGER
  1843.     X = POS(0)
  1844.     Y = CSRLN
  1845.     C = INKEY$
  1846.     CI = ""
  1847.     PRINT
  1848.     X = POS(0)
  1849.     Y = CSRLIN - 1
  1850.     DO
  1851.         GAMEHUD
  1852.         LOCATE Y, X
  1853.         T = INT(TIMER * 4!) AND 1
  1854.         LOCATE Y, X
  1855.         DRAWFONT (CI + MID$(CHR$(254) + CHR$(255), T + 1, 1))
  1856.         C = INKEY$
  1857.         IF C = CHR$(8) AND LEN(CI) > 0 THEN
  1858.             LOCATE Y, X + LEN(CI)
  1859.             LINE ((POS(0) - 1) * 8, (CSRLIN - 1) * 8)-(POS(0) * 8 - 1, CSRLIN * 8 - 1), 0, BF
  1860.             CI = LEFT$(CI, LEN(CI) - 1)
  1861.         ELSEIF C = CHR$(13) THEN
  1862.             LOCATE Y, X + LEN(CI)
  1863.             LINE ((POS(0) - 1) * 8, (CSRLIN - 1) * 8)-(POS(0) * 8 - 1, CSRLIN * 8 - 1), 0, BF
  1864.             INPUTFONT = CI
  1865.             EXIT DO
  1866.         ELSE
  1867.             IF LEN(C) = 1 AND LEN(CI) < 38 THEN
  1868.                 IF ASC(C) >= 32 AND ASC(C) <= 127 THEN
  1869.                     CI = CI + C
  1870.                 END IF
  1871.             END IF
  1872.         END IF
  1873.     LOOP
  1874.     PRINT
  1875. END FUNCTION
  1876. #ENDIF
  1877.  
  1878. #IFNDEF __DEBUG_PS5__
  1879. SUB LOADFONT (BYVAL INDEX AS INTEGER, BYVAL HEXDAT AS STRING)
  1880.     'DIM H AS STRING
  1881.     'H = "0123456789ABCDEF"
  1882.     IF INDEX < 0 OR INDEX > 255 THEN
  1883.         EXIT SUB
  1884.     END IF
  1885.     CLS
  1886.     PALETTE 15, 0
  1887.     DIM X AS INTEGER
  1888.     DIM Y AS INTEGER
  1889.     DIM P AS INTEGER
  1890.     FOR Y = 0 TO 7
  1891.         P = ((INSTR(1, UCASE$(H), UCASE$(MID$(HEXDAT, Y * 2 + 1, 1))) - 1) AND 15) * 16
  1892.         P = P OR (INSTR(1, UCASE$(H), UCASE$(MID$(HEXDAT, Y * 2 + 2, 1))) - 1) AND 15
  1893.         LINE (0, Y)-(15, Y), 8, , P
  1894.     NEXT
  1895.     GET (8, 0)-(15, 7), FONT%(40 * INDEX)
  1896.     LINE (8, 0)-(15, 7), 0, BF
  1897.     FOR Y = 0 TO 7
  1898.         P = ((INSTR(1, UCASE$(H), UCASE$(MID$(HEXDAT, 16 + Y * 2 + 1, 1))) - 1) AND 15) * 16
  1899.         P = P OR (INSTR(1, UCASE$(H), UCASE$(MID$(HEXDAT, 16 + Y * 2 + 2, 1))) - 1) AND 15
  1900.         LINE (0, Y)-(15, Y), 7, , P
  1901.     NEXT
  1902.     PUT (8, 0), FONT%(40 * INDEX), OR
  1903.     GET (8, 0)-(15, 7), FONT%(40 * INDEX)
  1904.     PALETTE 15, (63 * 65536) OR (63 * 256) OR 63
  1905. END SUB
  1906. #ENDIF
  1907.  
  1908. SUB READFLAG
  1909.     OPEN PATHPATH + PATHFLAG FOR INPUT AS 1
  1910.     IF NOT (EOF(1)) THEN
  1911.         INPUT #1, FLAGLO%
  1912.     END IF
  1913.     IF NOT (EOF(1)) THEN
  1914.         INPUT #1, FLAGHI%
  1915.     END IF
  1916.     FLAGCUR% = FLAGLO%
  1917.     DO
  1918.         IF EOF(1) THEN EXIT DO
  1919.         INPUT #1, FFF
  1920.         IF FFF = ENDOFFILE THEN EXIT DO
  1921.         FLAGCUR% = VAL(FFF)
  1922.         IF FLAGCUR% >= FLAGLO% AND FLAGCUR% <= FLAGHI% THEN
  1923.             IF EOF(1) THEN EXIT DO
  1924.             INPUT #1, FLAG%(FLAGCUR%)
  1925.         END IF
  1926.     LOOP
  1927.     CLOSE 1
  1928. END SUB
  1929.  
  1930. SUB READFONT
  1931.     OPEN PATHPATH + PATHFONT FOR INPUT AS 1
  1932.     IF NOT (EOF(1)) THEN
  1933.         INPUT #1, FFF
  1934.         FONTLO% = HEX2BYTE(RIGHT$(FFF, 2))
  1935.     END IF
  1936.     IF NOT (EOF(1)) THEN
  1937.         INPUT #1, FFF
  1938.         FONTHI% = HEX2BYTE(RIGHT$(FFF, 2))
  1939.     END IF
  1940.     FONTCUR% = FONTLO%
  1941.     DO
  1942.         IF EOF(1) THEN EXIT DO
  1943.         INPUT #1, FFF
  1944.         IF FFF = ENDOFFILE THEN EXIT DO
  1945.         FONTCUR% = HEX2BYTE(RIGHT$(FFF, 2))
  1946.         IF FONTCUR% >= FONTLO% AND FONTCUR% <= FONTHI% THEN
  1947.             IF EOF(1) THEN EXIT DO
  1948.             INPUT #1, FFF
  1949.             LOADFONT FONTCUR%, FFF
  1950.         END IF
  1951.     LOOP
  1952.     CLOSE 1
  1953. END SUB
  1954.  
  1955. SUB READHELP
  1956.     OPEN PATHPATH + PATHHELP FOR INPUT AS 1
  1957.     IF NOT (EOF(1)) THEN
  1958.         INPUT #1, HELPLO%
  1959.     END IF
  1960.     IF NOT (EOF(1)) THEN
  1961.         INPUT #1, HELPHI%
  1962.     END IF
  1963.     HELPCUR% = HELPLO%
  1964.     DO
  1965.         IF EOF(1) THEN EXIT DO
  1966.         INPUT #1, FFF
  1967.         IF FFF = ENDOFFILE THEN EXIT DO
  1968.         HELPCUR% = VAL(FFF)
  1969.         IF HELPCUR% >= HELPLO% AND HELPCUR% <= HELPHI% THEN
  1970.             IF EOF(1) THEN EXIT DO
  1971.             INPUT #1, HELP$(HELPCUR%)
  1972.         END IF
  1973.     LOOP
  1974.     CLOSE 1
  1975. END SUB
  1976.  
  1977. SUB READITEM
  1978.     OPEN PATHPATH + PATHITEM FOR INPUT AS 1
  1979.     IF NOT (EOF(1)) THEN
  1980.         INPUT #1, ITEMLO%
  1981.     END IF
  1982.     IF NOT (EOF(1)) THEN
  1983.         INPUT #1, ITEMHI%
  1984.     END IF
  1985.     ITEMCUR% = ITEMLO%
  1986.     DO
  1987.         IF EOF(1) THEN EXIT DO
  1988.         INPUT #1, FFF
  1989.         IF FFF = ENDOFFILE THEN EXIT DO
  1990.         ITEMCUR% = VAL(FFF)
  1991.         IF ITEMCUR% >= ITEMLO% AND ITEMCUR% <= ITEMHI% THEN
  1992.             IF EOF(1) THEN EXIT DO
  1993.             INPUT #1, FFF
  1994.             ITEMDESC%(ITEMCUR%) = VAL(FFF)
  1995.             IF EOF(1) THEN EXIT DO
  1996.             INPUT #1, FFF
  1997.             ITEMROOM%(ITEMCUR%) = VAL(FFF)
  1998.         END IF
  1999.     LOOP
  2000.     CLOSE 1
  2001. END SUB
  2002.  
  2003. SUB READNOUN
  2004.     OPEN PATHPATH + PATHNOUN FOR INPUT AS 1
  2005.     IF NOT (EOF(1)) THEN
  2006.         INPUT #1, NOUNLO%
  2007.     END IF
  2008.     IF NOT (EOF(1)) THEN
  2009.         INPUT #1, NOUNHI%
  2010.     END IF
  2011.     NOUNCUR% = NOUNLO%
  2012.     DO
  2013.         IF EOF(1) THEN EXIT DO
  2014.         INPUT #1, FFF
  2015.         IF FFF = ENDOFFILE THEN EXIT DO
  2016.         NOUNCUR% = VAL(FFF)
  2017.         IF NOUNCUR% >= NOUNLO% AND NOUNCUR% <= NOUNHI% THEN
  2018.             IF EOF(1) THEN EXIT DO
  2019.             INPUT #1, FFF
  2020.             NOUN%(NOUNCUR%) = VAL(FFF)
  2021.             IF EOF(1) THEN EXIT DO
  2022.             INPUT #1, FFF
  2023.             NOUNALIAS%(NOUNCUR%) = VAL(FFF)
  2024.             IF EOF(1) THEN EXIT DO
  2025.             INPUT #1, FFF
  2026.             NOUNITEM%(NOUNCUR%) = VAL(FFF)
  2027.         END IF
  2028.     LOOP
  2029.     CLOSE 1
  2030. END SUB
  2031.  
  2032. SUB READPATH
  2033.     OPEN "./PATH.TXT" FOR INPUT AS 1
  2034.     IF NOT (EOF(1)) THEN
  2035.         INPUT #1, FFF
  2036.         PATHLO% = HEX2BYTE(RIGHT$(FFF, 2))
  2037.     END IF
  2038.     IF NOT (EOF(1)) THEN
  2039.         INPUT #1, FFF
  2040.         PATHHI% = HEX2BYTE(RIGHT$(FFF, 2))
  2041.     END IF
  2042.     PATHCUR% = PATHLO%
  2043.     DO
  2044.         IF EOF(1) THEN EXIT DO
  2045.         INPUT #1, FFF
  2046.         IF FFF = ENDOFFILE THEN EXIT DO
  2047.         PATHCUR% = HEX2BYTE(RIGHT$(FFF, 2))
  2048.         IF PATHCUR% >= PATHLO% AND PATHCUR% <= PATHHI% THEN
  2049.             IF EOF(1) THEN EXIT DO
  2050.             INPUT #1, PATHTAG
  2051.             IF EOF(1) THEN EXIT DO
  2052.             INPUT #1, FFF
  2053.             SELECT CASE PATHTAG
  2054.             CASE "PATH"
  2055.                 PATHPATH = FFF
  2056.             CASE "FONT"
  2057.                 PATHFONT = FFF
  2058.             CASE "HELP"
  2059.                 PATHHELP = FFF
  2060.             CASE "FLAG"
  2061.                 PATHFLAG = FFF
  2062.             CASE "TEXT"
  2063.                 PATHTEXT = FFF
  2064.             CASE "NOUN"
  2065.                 PATHNOUN = FFF
  2066.             CASE "VERB"
  2067.                 PATHVERB = FFF
  2068.             CASE "ITEM"
  2069.                 PATHITEM = FFF
  2070.             CASE "ROOM"
  2071.                 PATHROOM = FFF
  2072.             END SELECT
  2073.         END IF
  2074.     LOOP
  2075.     CLOSE 1
  2076. END SUB
  2077.  
  2078. SUB READROOM
  2079.     OPEN PATHPATH + PATHROOM FOR INPUT AS 1
  2080.     IF NOT (EOF(1)) THEN
  2081.         INPUT #1, ROOMLO%
  2082.     END IF
  2083.     IF NOT (EOF(1)) THEN
  2084.         INPUT #1, ROOMHI%
  2085.     END IF
  2086.     ROOMCUR% = ROOMLO%
  2087.     DO
  2088.         IF EOF(1) THEN EXIT DO
  2089.         INPUT #1, FFF
  2090.         IF FFF = ENDOFFILE THEN EXIT DO
  2091.         ROOMCUR% = VAL(FFF)
  2092.         IF ROOMCUR% >= ROOMLO% AND ROOMCUR% <= ROOMHI% THEN
  2093.             J = 1
  2094.             DO
  2095.                 IF J > 4 THEN EXIT DO
  2096.                 IF EOF(1) THEN EXIT DO
  2097.                 INPUT #1, FFF
  2098.                 REM DRAWFONT "[" + FFF + "]"
  2099.                 ROOMWALL%(ROOMCUR%, J) = VAL(FFF)
  2100.                 J = J + 1
  2101.             LOOP
  2102.             IF EOF(1) THEN EXIT DO
  2103.             INPUT #1, FFF
  2104.             ROOMDESC%(ROOMCUR%) = VAL(FFF)
  2105.         END IF
  2106.     LOOP
  2107.     CLOSE 1
  2108. END SUB
  2109.  
  2110. SUB READTEXT
  2111.     OPEN PATHPATH + PATHTEXT FOR INPUT AS 1
  2112.     IF NOT (EOF(1)) THEN
  2113.         INPUT #1, TEXTLO%
  2114.     END IF
  2115.     IF NOT (EOF(1)) THEN
  2116.         INPUT #1, TEXTHI%
  2117.     END IF
  2118.     TEXTCUR% = TEXTLO%
  2119.     DO
  2120.         IF EOF(1) THEN EXIT DO
  2121.             INPUT #1, FFF
  2122.         IF FFF = ENDOFFILE THEN EXIT DO
  2123.         TEXTCUR% = VAL(FFF)
  2124.         IF TEXTCUR% >= TEXTLO% AND TEXTCUR% <= TEXTHI% THEN
  2125.             IF EOF(1) THEN EXIT DO
  2126.             INPUT #1, TEXT$(TEXTCUR%)
  2127.         END IF
  2128.     LOOP
  2129.     CLOSE 1
  2130. END SUB
  2131.  
  2132. SUB READVERB
  2133.     OPEN PATHPATH + PATHVERB FOR INPUT AS 1
  2134.     IF NOT (EOF(1)) THEN
  2135.         INPUT #1, VERBLO%
  2136.     END IF
  2137.     IF NOT (EOF(1)) THEN
  2138.         INPUT #1, VERBHI%
  2139.     END IF
  2140.     VERBCUR% = VERBLO%
  2141.     DO
  2142.         IF EOF(1) THEN EXIT DO
  2143.         INPUT #1, FFF
  2144.         IF FFF = ENDOFFILE THEN EXIT DO
  2145.         VERBCUR% = VAL(FFF)
  2146.         IF VERBCUR% >= VERBLO% AND VERBCUR% <= VERBHI% THEN
  2147.             IF EOF(1) THEN EXIT DO
  2148.             INPUT #1, FFF
  2149.             VERB%(VERBCUR%) = VAL(FFF)
  2150.             IF EOF(1) THEN EXIT DO
  2151.             INPUT #1, FFF
  2152.             VERBALIAS%(VERBCUR%) = VAL(FFF)
  2153.         END IF
  2154.     LOOP
  2155.     CLOSE 1
  2156. END SUB
  2157.  
  2158. FUNCTION SANITIZE$ (BYVAL CMDINPUT AS STRING)
  2159.     DIM CMDI AS STRING
  2160.     CMDI = CMDINPUT
  2161.     DO
  2162.         IF LEN(CMDI) = 0 THEN
  2163.             EXIT DO
  2164.         END IF
  2165.         IF LEFT$(CMDI, 1) = SPACE$(1) THEN
  2166.             CMDI = RIGHT$(CMDI, LEN(CMDI) - 1)
  2167.         ELSE
  2168.             EXIT DO
  2169.         END IF
  2170.     LOOP
  2171.     DO
  2172.         IF LEN(CMDI) = 0 THEN
  2173.             EXIT DO
  2174.         END IF
  2175.         IF RIGHT$(CMDI, 1) = SPACE$(1) THEN
  2176.             CMDI = LEFT$(CMDI, LEN(CMDI) - 1)
  2177.         ELSE
  2178.             EXIT DO
  2179.         END IF
  2180.     LOOP
  2181.     DO
  2182.         IF LEN(CMDI) = 0 THEN
  2183.             EXIT DO
  2184.         END IF
  2185.         IF INSTR(1, CMDI, SPACE$(2)) > 0 THEN
  2186.             CMDI = LEFT$(CMDI, INSTR(1, CMDI, SPACE$(2)) - 1) + RIGHT$(CMDI, LEN(CMDI) - INSTR(1, CMDI, SPACE$(2)) - 1)
  2187.         ELSE
  2188.             EXIT DO
  2189.         END IF
  2190.     LOOP
  2191.     SANITIZE = CMDI
  2192. END FUNCTION
  2193.  
  2194. FUNCTION STR2$ (BYVAL VALUE AS STRING,BYVAL  DIGITS AS INTEGER)
  2195.     DIM RET AS STRING
  2196.     RET = VALUE
  2197.     WHILE LEFT$(RET, 1) = SPACE$(1)
  2198.         RET = RIGHT$(RET, LEN(RET) - 1)
  2199.     WEND
  2200.     WHILE LEN(RET) < DIGITS
  2201.         RET = "0" + RET
  2202.     WEND
  2203.     STR2$ = RET: REM RIGHT$(RET, DIGITS)
  2204. END FUNCTION
  2205.  
  2206. SUB WAITKEY
  2207.     FFF = INPUT$(1)
  2208. END SUB
  2209.  
  2210.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×