Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #lang "qb"
- Option GoSub
- 'MISHAP22 Engine: font routines (QBX)
- 'MISER'S HOUSE ANTHOLOGY PROJECT - MISHAP22 ENGINE - MISHAP22.BAS
- #DEFINE __DEBUG_PS5__
- '#DEFINE __DEBUG_PET__
- #IFNDEF __DEBUG_PS5__
- CONST H = "0123456789ABCDEF"
- CONST PI = 3.141592654#
- #ENDIF
- #IFDEF __DEBUG_PS5__
- #INCLUDE ONCE "./mishap22 font routines.bas"
- #ENDIF
- DEFINT A-Z
- DECLARE FUNCTION FNA(BYVAL XX)
- DECLARE SUB READPATH ()
- DECLARE SUB READFONT ()
- DECLARE SUB READHELP ()
- DECLARE SUB READTEXT ()
- DECLARE SUB READFLAG ()
- DECLARE SUB READROOM ()
- DECLARE SUB READVERB ()
- DECLARE SUB READNOUN ()
- DECLARE SUB READITEM ()
- DECLARE SUB WAITKEY ()
- DECLARE SUB ENDPROGRAM ()
- DECLARE SUB GAMEHUD ()
- #IFNDEF __DEBUG_PS5__
- DECLARE FUNCTION HEX2BYTE (BYVAL VALUE AS STRING) AS INTEGER
- DECLARE SUB DRAWFONT (BYVAL TXTDAT AS STRING)
- DECLARE FUNCTION INPUTFONT (BYVAL TXTDAT AS STRING) AS STRING
- DECLARE SUB LOADFONT (BYVAL INDEX AS INTEGER, BYVAL HEXDAT AS STRING)
- #ENDIF
- DECLARE FUNCTION SANITIZE$ (BYVAL CMDINPUT AS STRING)
- DECLARE FUNCTION STR2$ (BYVAL VALUE AS STRING,BYVAL DIGITS AS INTEGER)
- 0
- DIM SHARED ENDOFFILE AS STRING
- DIM SHARED NUL AS STRING
- DIM SHARED FFF AS STRING
- ENDOFFILE = "EOF"
- NUL = SPACE$(0)
- FFF = NUL
- DIM SHARED GAMESTART AS SINGLE
- DIM SHARED GAMECLOCK AS SINGLE
- DIM SHARED GAMEDAYS AS LONG
- DIM SHARED GAMEHOURS AS LONG
- DIM SHARED GAMEMINS AS LONG
- DIM SHARED GAMESECS AS LONG
- DIM SHARED GAMEMS AS LONG
- DIM SHARED GAMETURNS AS LONG
- DIM SHARED PATHPATH AS STRING
- DIM SHARED PATHFONT AS STRING
- DIM SHARED PATHHELP AS STRING
- DIM SHARED PATHFLAG AS STRING
- DIM SHARED PATHTEXT AS STRING
- DIM SHARED PATHNOUN AS STRING
- DIM SHARED PATHVERB AS STRING
- DIM SHARED PATHITEM AS STRING
- DIM SHARED PATHROOM AS STRING
- DIM SHARED PATHLO%
- DIM SHARED PATHHI%
- DIM SHARED PATHCUR%
- DIM SHARED PATHTAG AS STRING
- DIM SHARED FONTLO%
- DIM SHARED FONTHI%
- DIM SHARED FONTCUR%
- #IFNDEF __DEBUG_PS5__
- DIM SHARED FONT%(10240)
- #ENDIF
- DIM SHARED HELPLO%
- DIM SHARED HELPHI%
- DIM SHARED HELPCUR%
- DIM SHARED HELP$(255)
- DIM SHARED TEXTLO%
- DIM SHARED TEXTHI%
- DIM SHARED TEXTCUR%
- DIM SHARED TEXT$(1023)
- DIM SHARED FLAGLO%
- DIM SHARED FLAGHI%
- DIM SHARED FLAGCUR%
- DIM SHARED FLAG%(1023)
- DIM SHARED ROOMLO%
- DIM SHARED ROOMHI%
- DIM SHARED ROOMCUR%
- DIM SHARED ROOMDESC%(1023)
- DIM SHARED ROOMWALL%(1023, 6)
- DIM SHARED VERBLO%
- DIM SHARED VERBHI%
- DIM SHARED VERBCUR%
- DIM SHARED VERB%(1023)
- DIM SHARED VERBALIAS%(1023)
- DIM SHARED NOUNLO%
- DIM SHARED NOUNHI%
- DIM SHARED NOUNCUR%
- DIM SHARED NOUN%(1023)
- DIM SHARED NOUNALIAS%(1023)
- DIM SHARED NOUNITEM%(1023)
- DIM SHARED ITEMLO%
- DIM SHARED ITEMHI%
- DIM SHARED ITEMCUR%
- DIM SHARED ITEMDESC%(1023)
- DIM SHARED ITEMROOM%(1023)
- DIM SHARED CMDINPUT AS STRING
- DIM SHARED CMDNOUN AS STRING
- DIM SHARED CMDVERB AS STRING
- DIM SHARED CHARJUMP AS INTEGER
- DIM SHARED NOUNJUMP AS INTEGER
- DIM SHARED VERBJUMP AS INTEGER
- DIM SHARED ERRMSG AS INTEGER
- DIM SHARED DOORUNLOCKED AS INTEGER
- DIM SHARED FULLPOOL AS INTEGER
- DIM SHARED WALLFIRE AS INTEGER
- DIM SHARED JUMPMADE AS INTEGER
- DIM SHARED SNAKECHARMED AS INTEGER
- DIM SHARED ESCAPED AS INTEGER
- DIM SHARED VAULTOPEN AS INTEGER
- DIM SHARED GOODLUCK AS INTEGER
- DIM SHARED GAMETALLY AS LONG
- DIM SHARED FOUNDVAULT AS LONG
- DIM SHARED FOUNDCOMBO AS LONG
- DIM SHARED FOUNDITEMS AS LONG
- DIM SHARED LOOPX AS LONG
- DIM SHARED LOGICOR AS LONG
- DIM SHARED SPCPOSITION AS LONG
- DIM SHARED BUCKETFULL AS LONG
- DIM SHARED DEE AS LONG
- DIM SHARED PS AS LONG
- DIM SHARED QI AS LONG
- 'DEF FNA (XX) = ITEMROOM%(ABS(NOUNITEM%(XX)))
- function FNA(BYVAL XX)
- FNA=ITEMROOM%(ABS(NOUNITEM%(XX)))
- end function
- 1
- SCREEN 13
- COLOR 15
- CLS
- READPATH
- READFONT
- READHELP
- 2
- FOR HELPCUR% = HELPLO% TO HELPHI%
- DRAWFONT HELP$(HELPCUR%)
- IF ((HELPCUR% - HELPLO%) AND 7) = 0 AND (HELPCUR% < HELPHI%) THEN
- WAITKEY
- END IF
- NEXT
- WAITKEY
- DRAWFONT NUL
- 5 REM COPYRIGHT (C) 1983 THE CODE WORKS
- 6 REM BOX 6905, SANTA BARBARA, CA 93160
- 7 REM
- 10 REM AS OF 1983 08/15 GF
- 90
- REM GOTO 62000
- 100
- QI = 254
- 105
- 200
- 210
- CHARJUMP = 1
- NOUNJUMP = 2
- VERBJUMP = 3
- ERRMSG = 4
- DOORUNLOCKED = 5
- FULLPOOL = 6
- WALLFIRE = 7
- JUMPMADE = 8
- SNAKECHARMED = 9
- ESCAPED = 10
- VAULTOPEN = 11
- GOODLUCK = 12
- GAMETALLY = 13
- FOUNDVAULT = 14
- FOUNDCOMBO = 15
- FOUNDITEMS = 16
- LOOPX = 17
- LOGICOR = 18
- SPCPOSITION = 19
- BUCKETFULL = 20
- DEE = 21
- PS = 22
- READTEXT
- READFLAG
- 300
- READROOM
- 500
- READVERB
- 550
- READNOUN
- 600
- READITEM
- GAMESTART = TIMER
- GAMETURNS = -1&
- 699 GOTO 14000
- 700
- GOTO PROMPT
- 1000
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 0
- GOTO 50000
- END SELECT
- 1002
- SELECT CASE NOUNITEM%(FLAG%(NOUNJUMP))
- CASE -1
- DRAWFONT TEXT$(3)
- GOTO 700
- END SELECT
- 1005
- SELECT CASE FNA(FLAG%(NOUNJUMP))
- CASE -1
- DRAWFONT TEXT$(4)
- GOTO 700
- END SELECT
- 1010
- SELECT CASE FNA(FLAG%(NOUNJUMP))
- CASE FLAG%(CHARJUMP)
- 1020
- SELECT CASE ITEMROOM%(NOUNITEM%(FLAG%(NOUNJUMP)))
- CASE -1
- DRAWFONT TEXT$(48)
- END SELECT
- 1030
- SELECT CASE NOUNITEM%(FLAG%(NOUNJUMP))
- CASE 4
- DRAWFONT TEXT$(17)
- FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
- CASE 5
- DRAWFONT TEXT$(17)
- FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
- CASE 6
- DRAWFONT TEXT$(17)
- FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
- CASE 7
- DRAWFONT TEXT$(17)
- FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
- CASE 8
- DRAWFONT TEXT$(17)
- FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
- CASE 19
- DRAWFONT TEXT$(17)
- FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
- END SELECT
- 1040
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 2
- SELECT CASE ITEMROOM%(20)
- CASE -2
- DRAWFONT TEXT$(18)
- ITEMROOM%(20) = 0
- END SELECT
- 1045
- CASE 10
- SELECT CASE ITEMROOM%(16)
- CASE -2
- GOTO 2200
- END SELECT
- END SELECT
- 1050
- ITEMROOM%(NOUNITEM%(FLAG%(NOUNJUMP))) = -1
- GOTO 700
- CASE ELSE
- GOTO 51000
- END SELECT
- 2000
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 0
- GOTO 50000
- 2005
- CASE 13
- SELECT CASE FLAG%(CHARJUMP)
- CASE 5
- SELECT CASE ROOMWALL%(5, 3)
- CASE 0
- GOTO 2100
- END SELECT
- END SELECT
- END SELECT
- 2010
- SELECT CASE NOUNITEM%(J)
- CASE -1
- DRAWFONT TEXT$(5)
- GOTO 700
- END SELECT
- 2020
- SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) - FLAG%(CHARJUMP)))
- CASE 1
- SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) + 1))
- CASE 1
- GOTO 51000
- END SELECT
- END SELECT
- 2030
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 2
- SELECT CASE ITEMROOM%(20)
- CASE -2
- GOTO 1040
- END SELECT
- 2040
- CASE 10
- SELECT CASE ITEMROOM%(16)
- CASE -2
- GOTO 2200
- END SELECT
- END SELECT
- 2050
- DRAWFONT TEXT$(19)
- 2060
- GOTO 700
- 2100
- DRAWFONT TEXT$(20)
- 2110
- FLAG%(FOUNDVAULT) = 1
- GOTO 699
- 2200
- DRAWFONT TEXT$(21)
- 2210
- ITEMROOM%(16) = 6
- GOTO 699
- 4000
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 0
- GOTO 50000
- 4002
- CASE 11
- GOTO 4030
- END SELECT
- 4005
- SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) - FLAG%(CHARJUMP)))
- CASE 0
- SELECT CASE FNA(FLAG%(NOUNJUMP))
- CASE -1
- 4010
- DRAWFONT TEXT$(22)
- 4011
- 4020
- DRAWFONT TEXT$(23)
- GOTO 700
- END SELECT
- END SELECT
- 4030
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 7
- DRAWFONT TEXT$(24)
- GOTO 700
- 4040
- CASE 12
- 4050
- SELECT CASE FLAG%(CHARJUMP)
- CASE 0
- SELECT CASE FLAG%(DOORUNLOCKED)
- CASE 0
- DRAWFONT TEXT$(25)
- GOTO 700
- 4060
- CASE 1
- DRAWFONT TEXT$(26)
- GOTO 700
- END SELECT
- END SELECT
- 4070
- REM IF FLAG%(CHARJUMP) <> 6 THEN
- REM GOTO 51000
- REM END IF
- 4080
- CASE 6
- SELECT CASE ITEMROOM%(16)
- CASE 6
- DRAWFONT TEXT$(27)
- 4090
- FLAG%(CHARJUMP) = 47
- GOTO 699
- END SELECT
- GOTO 51000
- 4120
- CASE 13
- 4130
- SELECT CASE ABS(SGN(ITEMROOM%(26) - FLAG%(CHARJUMP)))
- CASE 1
- GOTO 51000
- END SELECT
- 4150
- DRAWFONT TEXT$(28)
- 4155
- GOTO 700
- 4160
- CASE 22
- 4170
- SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) - FLAG%(CHARJUMP)))
- CASE 1
- SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) + 1))
- CASE 1
- GOTO 51000
- END SELECT
- END SELECT
- 4180
- DRAWFONT TEXT$(29)
- DRAWFONT TEXT$(30)
- GOTO 700
- 4190
- CASE 27
- 4200
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 5))
- CASE 1
- SELECT CASE FLAG%(FOUNDVAULT)
- CASE 0
- GOTO 51000
- END SELECT
- END SELECT
- 4210
- SELECT CASE FLAG%(VAULTOPEN)
- CASE 1
- DRAWFONT TEXT$(31)
- GOTO 700
- END SELECT
- 4220
- DRAWFONT TEXT$(32)
- GOTO 700
- 4230
- CASE 16
- DRAWFONT TEXT$(33)
- GOTO 700
- 4232
- CASE 21
- GOTO 51000
- END SELECT
- 4235
- SELECT CASE FLAG%(GOODLUCK)
- CASE 0
- DRAWFONT TEXT$(34)
- GOTO 700
- END SELECT
- 4240
- SELECT CASE ITEMROOM%(24)
- CASE -2
- DRAWFONT TEXT$(35)
- GOTO 700
- END SELECT
- 4250
- DRAWFONT TEXT$(36)
- 4260
- ITEMROOM%(24) = -2
- ITEMROOM%(25) = 21
- ITEMROOM%(19) = 21
- ITEMROOM%(17) = 21
- GOTO 699
- 5000
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 0
- GOTO 50000
- END SELECT
- 5010
- SELECT CASE ABS(SGN(SGN(NOUNITEM%(FLAG%(NOUNJUMP))) + 1))
- CASE 1
- SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) - FLAG%(CHARJUMP)))
- CASE 1
- SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) + 1))
- CASE 1
- GOTO 51000
- END SELECT
- END SELECT
- END SELECT
- 5020
- SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 3))
- CASE 1
- SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 11))
- CASE 1
- DRAWFONT TEXT$(37)
- GOTO 700
- END SELECT
- END SELECT
- 5030
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 11
- DRAWFONT TEXT$(38)
- GOTO 700
- END SELECT
- 5040
- DRAWFONT TEXT$(39)
- DRAWFONT TEXT$(40)
- 5050
- FLAG%(FOUNDCOMBO) = 1
- GOTO 700
- 6000
- DRAWFONT TEXT$(41)
- 6010
- FLAG%(FOUNDITEMS) = 0
- FLAG%(LOOPX) = 1
- WHILE FLAG%(LOOPX) <= 27
- REM FOR FLAG%(LOOPX) = 1 TO 27
- SELECT CASE ITEMROOM%(FLAG%(LOOPX))
- CASE IS = -1
- DRAWFONT TEXT$(ITEMDESC%(FLAG%(LOOPX)))
- FLAG%(FOUNDITEMS) = FLAG%(FOUNDITEMS) + 1
- 6020
- SELECT CASE FLAG%(LOOPX)
- CASE 1
- SELECT CASE FLAG%(BUCKETFULL)
- CASE 1
- DRAWFONT TEXT$(42)
- END SELECT
- 6025
- CASE 14
- DRAWFONT TEXT$(43)
- END SELECT
- END SELECT
- 6030
- FLAG%(LOOPX) = FLAG%(LOOPX) + 1
- WEND
- REM NEXT FLAG%(LOOPX)
- SELECT CASE FLAG%(FOUNDITEMS)
- CASE 0
- DRAWFONT TEXT$(44)
- END SELECT
- 6040
- GOTO 700
- 6500
- DRAWFONT TEXT$(45)
- 6510
- FLAG%(FOUNDITEMS) = 0
- FLAG%(LOOPX) = 1
- WHILE FLAG%(LOOPX) <= 27
- REM FOR FLAG%(LOOPX) = 1 TO 27
- SELECT CASE NOUNITEM%(FLAG%(NOUNJUMP))
- CASE FLAG%(LOOPX)
- FLAG%(LOGICOR) = 0
- SELECT CASE ITEMROOM%(FLAG%(LOOPX))
- CASE -1
- FLAG%(LOGICOR) = 1
- END SELECT
- SELECT CASE ITEMROOM%(FLAG%(LOOPX))
- CASE FLAG%(CHARJUMP)
- FLAG%(LOGICOR) = FLAG%(LOGICOR) OR 1
- END SELECT
- SELECT CASE FLAG%(LOGICOR)
- CASE 1
- DRAWFONT TEXT$(ITEMDESC%(FLAG%(LOOPX)))
- FLAG%(FOUNDITEMS) = FLAG%(FOUNDITEMS) + 1
- 6520
- SELECT CASE FLAG%(LOOPX)
- CASE 1
- SELECT CASE FLAG%(BUCKETFULL)
- CASE 1
- DRAWFONT TEXT$(42)
- END SELECT
- END SELECT
- 6525
- SELECT CASE FLAG%(LOOPX)
- CASE 14
- DRAWFONT TEXT$(43)
- END SELECT
- END SELECT
- END SELECT
- 6530
- FLAG%(LOOPX) = FLAG%(LOOPX) + 1
- WEND
- REM NEXT FLAG%(LOOPX)
- SELECT CASE FLAG%(FOUNDITEMS)
- CASE 0
- DRAWFONT TEXT$(46)
- END SELECT
- 6540
- GOTO 700
- 7000
- DRAWFONT TEXT$(47)
- 7001
- GOSUB 60000
- IF LEN(CMDINPUT) = 0 THEN
- GOTO 7001
- END IF
- 7002
- IF UCASE$(LEFT$(CMDINPUT, 1)) <> UCASE$(LEFT$(TEXT$(49), 1)) THEN
- REM DRAWFONT NUL
- DRAWFONT TEXT$(48)
- GOTO 700
- END IF
- 7005
- CLS
- GAMEHUD
- DRAWFONT NUL
- DRAWFONT NUL
- 7010
- DRAWFONT TEXT$(71) + STR2$(STR$(FLAG%(GAMETALLY)), 1) + TEXT$(72)
- 7020
- DRAWFONT TEXT$(73) + STR2$(STR$(FLAG%(GAMETALLY) * 20), 1) + TEXT$(74)
- 7030
- DRAWFONT TEXT$(52)
- SELECT CASE FLAG%(ESCAPED)
- CASE 0
- DRAWFONT TEXT$(53)
- END SELECT
- 7040
- DRAWFONT TEXT$(54)
- SELECT CASE FLAG%(ESCAPED)
- CASE 1
- FLAG%(GAMETALLY) = FLAG%(GAMETALLY) + 1
- END SELECT
- 7050
- SELECT CASE FLAG%(GAMETALLY) + 1
- CASE 0
- DRAWFONT TEXT$(55)
- CASE 1
- DRAWFONT TEXT$(56)
- CASE 2
- DRAWFONT TEXT$(57)
- CASE 3
- DRAWFONT TEXT$(58)
- CASE 4
- DRAWFONT TEXT$(59)
- CASE 5
- DRAWFONT TEXT$(60)
- CASE 6
- DRAWFONT TEXT$(61)
- END SELECT
- 7060
- REM DRAWFONT TEXT$(55)
- REM GOTO 7120
- 7070
- REM DRAWFONT TEXT$(56)
- REM GOTO 7120
- 7075
- REM DRAWFONT TEXT$(57)
- REM GOTO 7120
- 7090
- REM DRAWFONT TEXT$(58)
- REM GOTO 7120
- 7100
- REM DRAWFONT TEXT$(59)
- REM GOTO 7120
- 7110
- REM DRAWFONT TEXT$(60)
- REM GOTO 7120
- 7115
- REM DRAWFONT TEXT$(61)
- 7120
- SELECT CASE ABS(SGN(FLAG%(GAMETALLY) - 6))
- CASE 1
- DRAWFONT TEXT$(62)
- END SELECT
- 7150
- WAITKEY
- ENDPROGRAM
- 8000
- SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) + 1))
- CASE 1
- DRAWFONT TEXT$(63)
- GOTO 700
- END SELECT
- 8010
- FLAG%(LOOPX) = NOUNITEM%(FLAG%(NOUNJUMP))
- 8015
- FLAG%(LOGICOR) = 0
- SELECT CASE SGN(FLAG%(LOOPX) - 3)
- CASE 1
- SELECT CASE SGN(FLAG%(LOOPX) - 9)
- CASE -1
- FLAG%(LOGICOR) = 1
- END SELECT
- SELECT CASE FLAG%(LOOPX)
- CASE 19
- FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
- END SELECT
- SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
- CASE 1
- DRAWFONT TEXT$(64)
- GOTO 700
- END SELECT
- 8020
- SELECT CASE FLAG%(CHARJUMP)
- CASE 19
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 19
- GOTO 8100
- END SELECT
- 8030
- CASE 22
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 20
- GOTO 8200
- END SELECT
- END SELECT
- 8040
- ITEMROOM%(NOUNITEM%(FLAG%(NOUNJUMP))) = FLAG%(CHARJUMP)
- DRAWFONT TEXT$(48)
- GOTO 700
- 8100
- DRAWFONT TEXT$(65)
- 8105
- 8110
- 8130
- ROOMWALL%(21, 3) = 22
- ITEMROOM%(12) = -2
- GOTO 700
- 8200
- DRAWFONT TEXT$(66)
- 8210
- DRAWFONT TEXT$(67)
- 8220
- FLAG%(GOODLUCK) = 1
- ITEMROOM%(11) = -2
- ROOMDESC%(22) = 68
- 8221
- ITEMDESC%(24) = 69
- GOTO 700
- 9000
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 0
- DRAWFONT TEXT$(70)
- GOTO 700
- 9010
- CASE 14
- GOTO 9100
- 9020
- CASE 15
- GOTO 9200
- END SELECT
- 9030
- SELECT CASE SGN(FLAG%(NOUNJUMP) - 28)
- CASE 1
- GOTO 9300
- END SELECT
- 9040
- DRAWFONT TEXT$(75) + RIGHT$(CMDINPUT, LEN(CMDINPUT) - FLAG%(SPCPOSITION)) + TEXT$(76)
- 9050
- DRAWFONT TEXT$(77)
- GOTO 700
- 9100
- FLAG%(LOGICOR) = 0
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 4))
- CASE 1
- FLAG%(LOGICOR) = 1
- END SELECT
- SELECT CASE FLAG%(SNAKECHARMED)
- CASE 1
- FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
- END SELECT
- SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
- CASE 1
- DRAWFONT TEXT$(77)
- GOTO 700
- END SELECT
- 9110
- DRAWFONT TEXT$(78)
- 9111
- 9120
- FLAG%(SNAKECHARMED) = 1
- ITEMROOM%(2) = -2
- ITEMROOM%(3) = 4
- GOTO 700
- 9200
- FLAG%(LOGICOR) = 0
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 8))
- CASE 1
- FLAG%(LOGICOR) = 1
- END SELECT
- SELECT CASE PORTALOPEN
- CASE 1
- FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
- END SELECT
- SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
- CASE 1
- DRAWFONT TEXT$(77)
- GOTO 700
- END SELECT
- 9210
- DRAWFONT TEXT$(79)
- 9220
- PORTALOPEN = 1
- ROOMWALL%(8, 1) = 17
- ITEMROOM%(18) = 8
- GOTO 700
- 9300
- DRAWFONT TEXT$(80)
- GOTO 700
- 10000
- SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 4))
- CASE 1
- DRAWFONT TEXT$(10)
- GOTO 700
- END SELECT
- 10010
- SELECT CASE ABS(SGN(ITEMROOM%(1) + 1))
- CASE 1
- SELECT CASE ABS(SGN(ITEMROOM%(1) - FLAG%(CHARJUMP)))
- CASE 1
- GOTO 51000
- END SELECT
- END SELECT
- 10020
- SELECT CASE FLAG%(BUCKETFULL)
- CASE 0
- DRAWFONT TEXT$(81)
- GOTO 700
- END SELECT
- 10030
- SELECT CASE FLAG%(CHARJUMP)
- CASE 19
- DRAWFONT TEXT$(48)
- GOTO 700
- 10040
- CASE 10
- SELECT CASE FLAG%(WALLFIRE)
- CASE 1
- GOTO 10050
- END SELECT
- END SELECT
- 10045
- DRAWFONT TEXT$(82)
- FLAG%(BUCKETFULL) = 0
- GOTO 700
- 10050
- DRAWFONT TEXT$(83)
- 10060
- FLAG%(WALLFIRE) = 0
- FLAG%(BUCKETFULL) = 0
- GOTO 699
- 11000
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 0
- GOTO 50000
- END SELECT
- 11010
- SELECT CASE NOUNITEM%(FLAG%(NOUNJUMP))
- CASE -1
- DRAWFONT TEXT$(84)
- GOTO 700
- END SELECT
- 11020
- SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) - FLAG%(CHARJUMP)))
- CASE 1
- SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) + 1))
- CASE 1
- GOTO 51000
- END SELECT
- END SELECT
- 11030
- SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 4))
- CASE 1
- DRAWFONT TEXT$(84)
- GOTO 700
- END SELECT
- 11040
- SELECT CASE FLAG%(BUCKETFULL)
- CASE 1
- DRAWFONT TEXT$(85)
- GOTO 700
- END SELECT
- 11050
- SELECT CASE FLAG%(CHARJUMP)
- CASE 25
- SELECT CASE FLAG%(FULLPOOL)
- CASE 1
- DRAWFONT TEXT$(86)
- GOTO 700
- END SELECT
- END SELECT
- 11060
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 23))
- CASE 1
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 19))
- CASE 1
- DRAWFONT TEXT$(87)
- GOTO 700
- END SELECT
- END SELECT
- 11070
- DRAWFONT TEXT$(88)
- FLAG%(BUCKETFULL) = 1
- GOTO 700
- 12000
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 0
- GOTO 50000
- END SELECT
- 12010
- SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 12))
- CASE 1
- SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 27))
- CASE 1
- DRAWFONT TEXT$(89)
- GOTO 700
- END SELECT
- END SELECT
- 12020
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP)))
- CASE 1
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 5))
- CASE 1
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 6))
- CASE 1
- GOTO 51000
- END SELECT
- END SELECT
- 12030
- CASE 0
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 12
- GOTO 12200
- END SELECT
- END SELECT
- 12040
- SELECT CASE FLAG%(CHARJUMP)
- CASE 5
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 27
- GOTO 12300
- END SELECT
- END SELECT
- 12050
- FLAG%(LOGICOR) = 0
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 6))
- CASE 1
- SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 12))
- CASE 1
- FLAG%(LOGICOR) = 1
- END SELECT
- END SELECT
- SELECT CASE ITEMROOM%(16)
- CASE -2
- FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
- END SELECT
- SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
- CASE 1
- GOTO 51000
- END SELECT
- 12100
- DRAWFONT TEXT$(90)
- GOTO 700
- 12200
- SELECT CASE FLAG%(DOORUNLOCKED)
- CASE 1
- DRAWFONT TEXT$(91)
- GOTO 700
- END SELECT
- 12210
- SELECT CASE ABS(SGN(ITEMROOM%(20) + 1))
- CASE 1
- DRAWFONT TEXT$(92)
- GOTO 700
- END SELECT
- 12220
- DRAWFONT TEXT$(93)
- FLAG%(DOORUNLOCKED) = 1
- GOTO 699
- 12300
- SELECT CASE FLAG%(VAULTOPEN)
- CASE 1
- DRAWFONT TEXT$(94)
- GOTO 700
- END SELECT
- 12305
- SELECT CASE FLAG%(FOUNDVAULT)
- CASE 0
- GOTO 51000
- END SELECT
- 12310
- SELECT CASE FLAG%(FOUNDCOMBO)
- CASE 0
- DRAWFONT TEXT$(95)
- GOTO 700
- END SELECT
- 12320
- DRAWFONT TEXT$(96)
- DRAWFONT TEXT$(97)
- 12330
- FLAG%(VAULTOPEN) = 1
- ROOMWALL%(5, 3) = 46
- GOTO 699
- 14000
- DRAWFONT TEXT$(98) + TEXT$(ROOMDESC%(FLAG%(CHARJUMP))) + TEXT$(99)
- REM GOSUB 53000
- REM DRAWFONT NUL
- 14010
- FLAG%(LOOPX) = 1
- WHILE FLAG%(LOOPX) <= 28
- REM FOR FLAG%(LOOPX) = 1 TO 28
- SELECT CASE ABS(SGN(ITEMROOM%(FLAG%(LOOPX)) - FLAG%(CHARJUMP)))
- CASE 1
- GOTO 14020
- END SELECT
- 14011
- DRAWFONT TEXT$(100) + TEXT$(ITEMDESC%(FLAG%(LOOPX))) + TEXT$(101)
- REM DRAWFONT NUL
- REM GOSUB 53000
- REM DRAWFONT NUL
- 14020
- SELECT CASE FLAG%(LOOPX)
- CASE 1
- SELECT CASE FLAG%(BUCKETFULL)
- CASE 1
- SELECT CASE ITEMROOM%(1)
- CASE FLAG%(CHARJUMP)
- DRAWFONT TEXT$(42)
- END SELECT
- END SELECT
- END SELECT
- 14030
- FLAG%(LOOPX) = FLAG%(LOOPX) + 1
- WEND
- REM NEXT FLAG%(LOOPX)
- 14040
- SELECT CASE FLAG%(CHARJUMP)
- CASE 25
- SELECT CASE FLAG%(FULLPOOL)
- CASE 1
- DRAWFONT TEXT$(102)
- END SELECT
- END SELECT
- 14050
- FLAG%(LOGICOR) = 0
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 25))
- CASE 1
- FLAG%(LOGICOR) = 1
- END SELECT
- SELECT CASE FLAG%(FULLPOOL)
- CASE 1
- FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
- END SELECT
- SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
- CASE 1
- GOTO 14060
- END SELECT
- 14055
- SELECT CASE FLAG%(CHARJUMP)
- CASE 25
- SELECT CASE FLAG%(POOLFULL)
- CASE 0
- SELECT CASE ITEMROOM%(7)
- CASE 48
- DRAWFONT TEXT$(103)
- END SELECT
- END SELECT
- END SELECT
- 14060
- FLAG%(LOGICOR) = 0
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 10))
- CASE 1
- FLAG%(LOGICOR) = 1
- END SELECT
- SELECT CASE FLAG%(WALLFIRE)
- CASE 0
- FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
- END SELECT
- SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
- CASE 1
- GOTO 14090
- END SELECT
- 14070
- DRAWFONT TEXT$(104)
- 14080
- DRAWFONT TEXT$(105)
- 14090
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 16))
- CASE 1
- GOTO 14110
- END SELECT
- 14100
- DRAWFONT TEXT$(106)
- 14105
- REM GOSUB 53000
- REM DRAWFONT NUL
- 14110
- SELECT CASE FLAG%(CHARJUMP)
- CASE 26
- DRAWFONT TEXT$(107)
- END SELECT
- CASE 23
- DRAWFONT TEXT$(108)
- 14120
- CASE 10
- SELECT CASE FLAG%(WALLFIRE)
- CASE 0
- DRAWFONT TEXT$(109)
- END SELECT
- 14125
- CASE 5
- SELECT CASE FLAG%(FOUNDVAULT)
- CASE 1
- DRAWFONT TEXT$(110)
- END SELECT
- 14126
- SELECT CASE FLAG%(VAULTOPEN)
- CASE 1
- DRAWFONT TEXT$(111)
- END SELECT
- 14127
- CASE 0
- SELECT CASE FLAG%(DOORUNLOCKED)
- CASE 1
- DRAWFONT TEXT$(112)
- END SELECT
- END SELECT
- 14130
- FLAG%(LOGICOR) = 0
- SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 1))
- CASE 1
- FLAG%(LOGICOR) = 1
- END SELECT
- SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 2))
- CASE 1
- FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
- END SELECT
- SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 3))
- CASE 1
- FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
- END SELECT
- SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 4))
- CASE 1
- FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
- END SELECT
- SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
- CASE 1
- CMDINPUT = TEXT$(141)
- SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 1))
- CASE 1
- CMDINPUT = CMDINPUT + TEXT$(295)
- END SELECT
- 14140
- SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 2))
- CASE 1
- CMDINPUT = CMDINPUT + TEXT$(296)
- END SELECT
- 14150
- SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 3))
- CASE 1
- CMDINPUT = CMDINPUT + TEXT$(297)
- END SELECT
- 14160
- SELECT CASE SGN(ROOMWALL%(FLAG%(CHARJUMP), 4))
- CASE 1
- CMDINPUT = CMDINPUT + TEXT$(298)
- END SELECT
- DRAWFONT CMDINPUT
- END SELECT
- 14170
- REM DRAWFONT NUL
- GOTO 700
- 15000
- SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 8))
- CASE 1
- SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 18))
- CASE 1
- SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 28))
- CASE 1
- GOTO 50000
- END SELECT
- END SELECT
- END SELECT
- 15010
- FLAG%(LOGICOR) = 0
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 8
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 48))
- CASE 1
- FLAG%(LOGICOR) = 1
- END SELECT
- END SELECT
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 28
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 25))
- CASE 1
- FLAG%(LOGICOR) = FLAG%(LOGICOR) + 1
- END SELECT
- END SELECT
- SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
- CASE 1
- GOTO 51000
- END SELECT
- 15015
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 18
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 2))
- CASE 1
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 27))
- CASE 1
- GOTO 51000
- END SELECT
- END SELECT
- 15020
- CASE 8
- FLAG%(CHARJUMP) = 25
- GOTO 699
- 15030
- CASE 28
- SELECT CASE FLAG%(FULLPOOL)
- CASE 1
- DRAWFONT TEXT$(102)
- GOTO 700
- END SELECT
- 15040
- CASE 28
- FLAG%(CHARJUMP) = 48
- GOTO 699
- END SELECT
- 15050
- SELECT CASE FLAG%(CHARJUMP)
- CASE 27
- FLAG%(CHARJUMP) = 2
- GOTO 699
- END SELECT
- 15060
- SELECT CASE ITEMROOM%(9)
- CASE -1
- GOTO 15070
- END SELECT
- 15061
- DRAWFONT TEXT$(113)
- REM GOSUB 53000
- 15062
- REM DRAWFONT NUL
- GOTO 700
- 15070
- DRAWFONT TEXT$(114)
- 15080
- FLAG%(CHARJUMP) = 27
- GOTO 699
- 16000
- SELECT CASE FLAG%(CHARJUMP)
- CASE 0
- SELECT CASE FLAG%(DOORUNLOCKED)
- CASE 0
- DRAWFONT TEXT$(115)
- GOTO 700
- END SELECT
- END SELECT
- 16010
- SELECT CASE ROOMWALL%(FLAG%(CHARJUMP), 1)
- CASE 0
- GOTO 52000
- END SELECT
- 16015
- SELECT CASE FLAG%(CHARJUMP)
- CASE 0
- DRAWFONT TEXT$(116)
- END SELECT
- 16020
- FLAG%(CHARJUMP) = ROOMWALL%(FLAG%(CHARJUMP), 1)
- GOTO 699
- 17000
- SELECT CASE FLAG%(CHARJUMP)
- CASE 10
- SELECT CASE FLAG%(WALLFIRE)
- CASE 1
- DRAWFONT TEXT$(117)
- WAITKEY
- ENDPROGRAM
- END SELECT
- 17010
- CASE 4
- SELECT CASE FLAG%(SNAKECHARMED)
- CASE 0
- GOTO 17060
- END SELECT
- END SELECT
- 17030
- FLAG%(DEE) = 2
- FLAG%(LOGICOR) = 0
- SELECT CASE FLAG%(VERBJUMP)
- CASE 21
- FLAG%(LOGICOR) = 1
- CASE 22
- FLAG%(LOGICOR) = 1
- END SELECT
- SELECT CASE ABS(SGN(FLAG%(LOGICOR)))
- CASE 1
- FLAG%(DEE) = 3
- END SELECT
- 17040
- SELECT CASE ROOMWALL%(FLAG%(CHARJUMP), FLAG%(DEE))
- CASE 0
- GOTO 52000
- END SELECT
- 17050
- FLAG%(CHARJUMP) = ROOMWALL%(FLAG%(CHARJUMP), FLAG%(DEE))
- GOTO 699
- 17060
- SELECT CASE FLAG%(PS)
- CASE 0
- DRAWFONT TEXT$(118)
- FLAG%(PS) = 1
- GOTO 700
- END SELECT
- 17070
- DRAWFONT TEXT$(119)
- DRAWFONT TEXT$(120)
- WAITKEY
- ENDPROGRAM
- 19000
- SELECT CASE ROOMWALL%(FLAG%(CHARJUMP), 4)
- CASE 0
- GOTO 52000
- END SELECT
- 19010
- FLAG%(CHARJUMP) = ROOMWALL%(FLAG%(CHARJUMP), 4)
- GOTO 699
- 20000
- REM DRAWFONT NUL
- DRAWFONT TEXT$(121)
- CMDINPUT = TEXT$(122)
- 20010
- CMDINPUT = CMDINPUT + STR2$(STR$(FLAG%(GAMETALLY) * 20), 1) + TEXT$(74)
- DRAWFONT CMDINPUT
- DRAWFONT TEXT$(52)
- 20020
- DRAWFONT TEXT$(51)
- 20030
- GOSUB 60000
- 20040
- REM DRAWFONT NUL
- IF UCASE$(LEFT$(CMDINPUT, 1)) = UCASE$(LEFT$(TEXT$(49), 1)) THEN
- GOTO 7010
- END IF
- 20050
- IF UCASE$(LEFT$(CMDINPUT, 1)) <> UCASE$(LEFT$(TEXT$(50), 1)) THEN
- DRAWFONT TEXT$(7)
- GOTO 20020
- END IF
- 20060
- DRAWFONT TEXT$(48)
- REM DRAWFONT NUL
- GOTO 700
- 21000
- SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 7))
- CASE 1
- DRAWFONT TEXT$(8)
- GOTO 700
- END SELECT
- 21010
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 26))
- CASE 1
- GOTO 51000
- END SELECT
- 21020
- 21030
- DRAWFONT TEXT$(140)
- 21040
- FLAG%(FULLPOOL) = 1 - FLAG%(FULLPOOL)
- 21050
- SELECT CASE FLAG%(FULLPOOL)
- CASE 0
- SELECT CASE ITEMROOM%(7)
- CASE -3
- ITEMROOM%(7) = 25
- GOTO 700
- END SELECT
- 21060
- CASE 1
- SELECT CASE ITEMROOM%(7)
- CASE 25
- ITEMROOM%(7) = -3
- GOTO 700
- END SELECT
- END SELECT
- 21070
- GOTO 700
- 22000
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 27))
- CASE 1
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 29))
- CASE 1
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 32))
- CASE 1
- GOTO 22050
- END SELECT
- END SELECT
- END SELECT
- 22010
- DRAWFONT TEXT$(123)
- SELECT CASE FLAG%(CHARJUMP)
- CASE 27
- GOTO 22500
- END SELECT
- 22020
- SELECT CASE ITEMROOM%(14)
- CASE -1
- GOTO 22100
- END SELECT
- 22030
- SELECT CASE ITEMROOM%(27)
- CASE -1
- GOTO 22200
- END SELECT
- 22040
- DRAWFONT TEXT$(124)
- GOTO 22540
- 22050
- DRAWFONT TEXT$(125)
- GOTO 700
- 22100
- DRAWFONT TEXT$(126)
- GOTO 22040
- 22200
- DRAWFONT TEXT$(127)
- 22210
- SELECT CASE FLAG%(CHARJUMP)
- CASE 32
- FLAG%(CHARJUMP) = 40
- GOTO 699
- END SELECT
- 22220
- DRAWFONT TEXT$(128)
- DRAWFONT TEXT$(129)
- 22230
- FLAG%(ESCAPED) = 1
- GOTO 7010
- 22500
- SELECT CASE FLAG%(JUMPMADE)
- CASE 1
- GOTO 22530
- END SELECT
- 22510
- DRAWFONT TEXT$(130)
- 22520
- FLAG%(JUMPMADE) = 1
- FLAG%(CHARJUMP) = 2
- GOTO 699
- 22530
- DRAWFONT TEXT$(131)
- 22535
- 22540
- DRAWFONT TEXT$(120)
- WAITKEY
- ENDPROGRAM
- 24000
- SELECT CASE FLAG%(CHARJUMP)
- CASE 19
- DRAWFONT TEXT$(16)
- GOTO 700
- END SELECT
- 24010
- SELECT CASE ABS(SGN(FLAG%(CHARJUMP) - 25))
- CASE 1
- DRAWFONT TEXT$(9)
- GOTO 700
- END SELECT
- 24020
- SELECT CASE FLAG%(FULLPOOL)
- CASE 1
- DRAWFONT TEXT$(14)
- GOTO 700
- END SELECT
- 24030
- DRAWFONT TEXT$(15)
- GOTO 700
- 25000
- SELECT CASE FLAG%(NOUNJUMP)
- CASE 0
- GOTO 50000
- 25010
- CASE 7
- DRAWFONT TEXT$(13)
- GOTO 700
- END SELECT
- 25020
- SELECT CASE ABS(SGN(FLAG%(NOUNJUMP) - 17))
- CASE 1
- DRAWFONT TEXT$(10)
- GOTO 700
- END SELECT
- 25030
- SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) - FLAG%(CHARJUMP)))
- CASE 1
- SELECT CASE ABS(SGN(FNA(FLAG%(NOUNJUMP)) + 1))
- CASE 1
- GOTO 51000
- END SELECT
- END SELECT
- 25040
- SELECT CASE ITEMROOM%(14)
- CASE -2
- DRAWFONT TEXT$(11)
- GOTO 700
- END SELECT
- 25050
- SELECT CASE ABS(SGN(ITEMROOM%(17) + 1))
- CASE 1
- DRAWFONT TEXT$(12)
- GOTO 700
- END SELECT
- 25060
- DRAWFONT TEXT$(132)
- 25070
- ITEMROOM%(27) = ITEMROOM%(14)
- ITEMROOM%(14) = -2
- NOUNITEM%(17) = 27
- ITEMROOM%(17) = 0
- GOTO 700
- 50000
- DRAWFONT TEXT$(FLAG%(ERRMSG))
- FLAG%(ERRMSG) = (FLAG%(ERRMSG) MOD 2) + 1
- GOTO 700
- 51000
- DRAWFONT TEXT$(133)
- GOTO 700
- 52000
- DRAWFONT TEXT$(134)
- GOTO 700
- 53000
- DRAWFONT CMDINPUT
- RETURN
- IF LEN(CMDINPUT) <= 40 THEN
- DRAWFONT CMDINPUT
- RETURN
- END IF
- 53005
- CMDEND = 40
- 53010
- IF MID$(CMDINPUT, CMDEND, 1) <> " " THEN
- CMDEND = CMDEND - 1
- GOTO 53010
- END IF
- 53020
- DRAWFONT LEFT$(CMDINPUT, CMDEND)
- DRAWFONT RIGHT$(CMDINPUT, LEN(CMDINPUT) - CMDEND)
- RETURN
- 60000
- GAMETURNS = GAMETURNS + 1&
- CMDINPUT = INPUTFONT(NUL)
- RETURN
- PROMPT:
- REM DRAWFONT NUL
- GOSUB 60000
- CMDVERB = NUL
- CMDNOUN$ = NUL
- CMDINPUT = UCASE$(SANITIZE$(CMDINPUT)) + SPACE$(1)
- CMDVERB = LEFT$(CMDINPUT, INSTR(1, CMDINPUT, SPACE$(1)) - 1)
- CMDINPUT = RIGHT$(CMDINPUT, LEN(CMDINPUT) - LEN(CMDVERB) - 1)
- CMDINPUT = UCASE$(SANITIZE$(CMDINPUT)) + SPACE$(1)
- CMDNOUN = LEFT$(CMDINPUT, INSTR(1, CMDINPUT, SPACE$(1)) - 1)
- CMDINPUT = RIGHT$(CMDINPUT, LEN(CMDINPUT) - LEN(CMDNOUN) - 1)
- CMDINPUT = UCASE$(SANITIZE$(CMDINPUT)) + SPACE$(1)
- REM DRAWFONT TEXT$(135) + "[" + CMDVERB + "] " + TEXT$(136) + "[" + CMDNOUN + "]"
- IF CMDINPUT <> SPACE$(1) THEN
- DRAWFONT TEXT$(6)
- GOTO PROMPT
- END IF
- FLAG%(LOOPX) = VERBLO%
- WHILE FLAG%(LOOPX) <= VERBHI%
- REM FOR FLAG%(LOOPX) = VERBLO% TO VERBHI%
- REM DRAWFONT TEXT$(VERB%(FLAG%(LOOPX)))
- IF CMDVERB = TEXT$(VERB%(FLAG%(LOOPX))) THEN
- FLAG%(VERBJUMP) = FLAG%(LOOPX)
- FLAG%(VERBJUMP) = VERBALIAS%(FLAG%(VERBJUMP))
- CMDVERB = TEXT$(VERB%(FLAG%(VERBJUMP)))
- GOTO 800
- END IF
- FLAG%(LOOPX) = FLAG%(LOOPX) + 1
- WEND
- REM NEXT FLAG%(LOOPX)
- GOTO 50000
- 800
- IF LEN(CMDNOUN) = 0 THEN
- FLAG%(NOUNJUMP) = 0
- GOTO 900
- ELSE
- FLAG%(LOOPX) = NOUNLO%
- WHILE FLAG%(LOOPX) <= NOUNHI%
- REM FOR FLAG%(LOOPX) = NOUNLO% TO NOUNHI%
- REM DRAWFONT TEXT$(NOUN%(FLAG%(LOOPX)))
- IF CMDNOUN = TEXT$(NOUN%(FLAG%(LOOPX))) THEN
- FLAG%(NOUNJUMP) = FLAG%(LOOPX)
- GOTO 900
- END IF
- FLAG%(NOUNJUMP) = NOUNALIAS%(FLAG%(NOUNJUMP))
- FLAG%(LOOPX) = FLAG%(LOOPX) + 1
- WEND
- REM NEXT FLAG%(LOOPX)
- END IF
- GOTO 50000
- 900
- SELECT CASE FLAG%(VERBJUMP)
- CASE 1
- GOTO 1000: REM GET/TAKE
- CASE 3
- GOTO 2000: REM MOVE/SLIDE/PUSH
- CASE 6
- GOTO 4000: REM OPEN
- CASE 7
- GOTO 5000: REM READ
- CASE 8
- GOTO 6000: REM INVENTORY/I
- CASE 9
- GOTO 7000: REM QUIT/Q
- CASE 10
- GOTO 8000: REM DROP
- CASE 11
- GOTO 9000: REM SAY
- CASE 12
- GOTO 10000: REM POUR
- CASE 13
- GOTO 11000: REM FILL
- CASE 14
- GOTO 12000: REM UNLOCK
- CASE 15
- GOTO 14000: REM LOOK
- CASE 16
- GOTO 15000: REM GO
- CASE 17
- GOTO 16000: REM NORTH/N
- CASE 19
- GOTO 17000: REM SOUTH/S
- CASE 21
- GOTO 17010: REM EAST/E
- CASE 23
- GOTO 19000: REM WEST/W
- CASE 25
- GOTO 20000: REM SCORE
- CASE 26
- GOTO 21000: REM TURN
- CASE 27
- GOTO 22000: REM JUMP
- CASE 28
- GOTO 24000: REM SWIM
- CASE 30
- GOTO 25000: REM FIX
- CASE 32
- GOTO 6500: REM INSPECT
- CASE ELSE
- GOTO 1000
- END SELECT
- GOTO 1000
- #IFNDEF __DEBUG_PS5__
- SUB DRAWFONT (BYVAL TXTDAT AS STRING)
- DIM X AS INTEGER
- DIM Y AS INTEGER
- DIM BUF AS STRING
- DIM LP AS LONG
- DIM RP AS LONG
- X = POS(0)
- Y = CSRLIN
- IF LEN(TXTDAT) = 0 THEN
- PRINT
- EXIT SUB
- END IF
- BUF = TXTDAT + SPACE$(1)
- DO
- IF LEN(BUF) = 0 THEN EXIT DO
- RP = 1
- WHILE RP < 42 AND RP > 0
- LP = RP
- RP = INSTR(LP + 1, BUF, SPACE$(1))
- WEND
- FOR RP = 1 TO LP - 1
- X = POS(0)
- Y = CSRLIN
- IF X < 40 THEN
- LOCATE CSRLIN, POS(0) + 1
- ELSEIF Y < 25 THEN
- LOCATE CSRLIN + 1, 1
- ELSE
- LOCATE 25, 1
- END IF
- IF ASC(MID$(BUF, RP, 1)) <> 32 THEN
- PUT ((X - 1) * 8, (Y - 1) * 8), FONT%(ASC(MID$(BUF, RP, 1)) * 40), PSET
- ELSE
- LINE ((X - 1) * 8, (Y - 1) * 8)-(X * 8 - 1, Y * 8 - 1), 0, BF
- END IF
- NEXT
- X = POS(0)
- Y = CSRLIN
- IF Y < 25 THEN
- LOCATE CSRLIN, 1
- ELSE
- LOCATE 25, 1
- END IF
- PRINT
- BUF = RIGHT$(BUF, LEN(BUF) - LP)
- LOOP
- END SUB
- #ENDIF
- SUB ENDPROGRAM
- CLS
- SCREEN 0
- WIDTH 80, 25
- COLOR 15, 0
- END
- END SUB
- SUB GAMEHUD
- DIM X AS INTEGER
- DIM Y AS INTEGER
- DIM DIF AS SINGLE
- X = POS(0)
- Y = CSRLIN
- GAMECLOCK = TIMER
- DIF = GAMECLOCK - GAMESTART
- GAMESTART = GAMECLOCK
- IF DIF < -21600! THEN
- DIF = DIF + 86400!
- ELSEIF DIF < 0! THEN
- DIF = 0!
- END IF
- DIM MS AS LONG
- DIM SECS AS LONG
- DIM MINS AS LONG
- DIM HOURS AS LONG
- DIM DAYS AS LONG
- DAYS = CLNG(DIF / 86400!)
- DIF = DIF - CSNG(86400! * DAYS)
- HOURS = CLNG(DIF / 3600!)
- DIF = DIF - CSNG(3600! * HOURS)
- MINS = CLNG(DIF / 60!)
- DIF = DIF - CSNG(3600! * MINS)
- SECS = CLNG(DIF)
- DIF = DIF - CSNG(SECS)
- MS = CLNG(DIF * 1000)
- GAMEMS = GAMEMS + MS
- IF GAMEMS > 999& THEN
- GAMESECS = GAMESECS + CLNG(GAMEMS / 1000&)
- GAMEMS = GAMEMS MOD 1000&
- END IF
- GAMESECS = GAMESECS + SECS
- IF GAMESECS > 59& THEN
- GAMEMINS = GAMEMINS + CLNG(GAMESECS / 60&)
- GAMESECS = GAMESECS MOD 60&
- END IF
- GAMEMINS = GAMEMINS + MINS
- IF GAMEMINS > 59& THEN
- GAMEHOURS = GAMEHOURS + CLNG(GAMEMINS / 60&)
- GAMEMINS = GAMEMINS MOD 60&
- END IF
- GAMEHOURS = GAMEHOURS + HOURS
- IF GAMEHOURS > 23 THEN
- GAMEDAYS = GAMEDAYS + CLNG(GAMEHOURS / 24&)
- GAMEHOURS = GAMEHOURS MOD 24&
- END IF
- LOCATE 1, 1
- 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)
- LOCATE Y, X
- END SUB
- #IFNDEF __DEBUG_PS5__
- FUNCTION HEX2BYTE (BYVAL VALUE AS STRING) as INTEGER
- 'DIM H AS STRING
- 'H = "0123456789ABCDEF"
- HEX2BYTE = (((INSTR(1, UCASE$(H), LEFT$(VALUE, 1)) - 1) AND 15) * 16) OR ((INSTR(1, UCASE$(H), MID$(VALUE, 2, 1)) - 1) AND 15)
- END FUNCTION
- #ENDIF
- #IFNDEF __DEBUG_PS5__
- FUNCTION INPUTFONT (BYVAL TXTDAT AS STRING) AS STRING
- DIM X AS INTEGER
- DIM Y AS INTEGER
- DIM C AS STRING
- DIM CI AS STRING
- DIM T AS INTEGER
- X = POS(0)
- Y = CSRLN
- C = INKEY$
- CI = ""
- PRINT
- X = POS(0)
- Y = CSRLIN - 1
- DO
- GAMEHUD
- LOCATE Y, X
- T = INT(TIMER * 4!) AND 1
- LOCATE Y, X
- DRAWFONT (CI + MID$(CHR$(254) + CHR$(255), T + 1, 1))
- C = INKEY$
- IF C = CHR$(8) AND LEN(CI) > 0 THEN
- LOCATE Y, X + LEN(CI)
- LINE ((POS(0) - 1) * 8, (CSRLIN - 1) * 8)-(POS(0) * 8 - 1, CSRLIN * 8 - 1), 0, BF
- CI = LEFT$(CI, LEN(CI) - 1)
- ELSEIF C = CHR$(13) THEN
- LOCATE Y, X + LEN(CI)
- LINE ((POS(0) - 1) * 8, (CSRLIN - 1) * 8)-(POS(0) * 8 - 1, CSRLIN * 8 - 1), 0, BF
- INPUTFONT = CI
- EXIT DO
- ELSE
- IF LEN(C) = 1 AND LEN(CI) < 38 THEN
- IF ASC(C) >= 32 AND ASC(C) <= 127 THEN
- CI = CI + C
- END IF
- END IF
- END IF
- LOOP
- PRINT
- END FUNCTION
- #ENDIF
- #IFNDEF __DEBUG_PS5__
- SUB LOADFONT (BYVAL INDEX AS INTEGER, BYVAL HEXDAT AS STRING)
- 'DIM H AS STRING
- 'H = "0123456789ABCDEF"
- IF INDEX < 0 OR INDEX > 255 THEN
- EXIT SUB
- END IF
- CLS
- PALETTE 15, 0
- DIM X AS INTEGER
- DIM Y AS INTEGER
- DIM P AS INTEGER
- FOR Y = 0 TO 7
- P = ((INSTR(1, UCASE$(H), UCASE$(MID$(HEXDAT, Y * 2 + 1, 1))) - 1) AND 15) * 16
- P = P OR (INSTR(1, UCASE$(H), UCASE$(MID$(HEXDAT, Y * 2 + 2, 1))) - 1) AND 15
- LINE (0, Y)-(15, Y), 8, , P
- NEXT
- GET (8, 0)-(15, 7), FONT%(40 * INDEX)
- LINE (8, 0)-(15, 7), 0, BF
- FOR Y = 0 TO 7
- P = ((INSTR(1, UCASE$(H), UCASE$(MID$(HEXDAT, 16 + Y * 2 + 1, 1))) - 1) AND 15) * 16
- P = P OR (INSTR(1, UCASE$(H), UCASE$(MID$(HEXDAT, 16 + Y * 2 + 2, 1))) - 1) AND 15
- LINE (0, Y)-(15, Y), 7, , P
- NEXT
- PUT (8, 0), FONT%(40 * INDEX), OR
- GET (8, 0)-(15, 7), FONT%(40 * INDEX)
- PALETTE 15, (63 * 65536) OR (63 * 256) OR 63
- END SUB
- #ENDIF
- SUB READFLAG
- OPEN PATHPATH + PATHFLAG FOR INPUT AS 1
- IF NOT (EOF(1)) THEN
- INPUT #1, FLAGLO%
- END IF
- IF NOT (EOF(1)) THEN
- INPUT #1, FLAGHI%
- END IF
- FLAGCUR% = FLAGLO%
- DO
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- IF FFF = ENDOFFILE THEN EXIT DO
- FLAGCUR% = VAL(FFF)
- IF FLAGCUR% >= FLAGLO% AND FLAGCUR% <= FLAGHI% THEN
- IF EOF(1) THEN EXIT DO
- INPUT #1, FLAG%(FLAGCUR%)
- END IF
- LOOP
- CLOSE 1
- END SUB
- SUB READFONT
- OPEN PATHPATH + PATHFONT FOR INPUT AS 1
- IF NOT (EOF(1)) THEN
- INPUT #1, FFF
- FONTLO% = HEX2BYTE(RIGHT$(FFF, 2))
- END IF
- IF NOT (EOF(1)) THEN
- INPUT #1, FFF
- FONTHI% = HEX2BYTE(RIGHT$(FFF, 2))
- END IF
- FONTCUR% = FONTLO%
- DO
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- IF FFF = ENDOFFILE THEN EXIT DO
- FONTCUR% = HEX2BYTE(RIGHT$(FFF, 2))
- IF FONTCUR% >= FONTLO% AND FONTCUR% <= FONTHI% THEN
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- LOADFONT FONTCUR%, FFF
- END IF
- LOOP
- CLOSE 1
- END SUB
- SUB READHELP
- OPEN PATHPATH + PATHHELP FOR INPUT AS 1
- IF NOT (EOF(1)) THEN
- INPUT #1, HELPLO%
- END IF
- IF NOT (EOF(1)) THEN
- INPUT #1, HELPHI%
- END IF
- HELPCUR% = HELPLO%
- DO
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- IF FFF = ENDOFFILE THEN EXIT DO
- HELPCUR% = VAL(FFF)
- IF HELPCUR% >= HELPLO% AND HELPCUR% <= HELPHI% THEN
- IF EOF(1) THEN EXIT DO
- INPUT #1, HELP$(HELPCUR%)
- END IF
- LOOP
- CLOSE 1
- END SUB
- SUB READITEM
- OPEN PATHPATH + PATHITEM FOR INPUT AS 1
- IF NOT (EOF(1)) THEN
- INPUT #1, ITEMLO%
- END IF
- IF NOT (EOF(1)) THEN
- INPUT #1, ITEMHI%
- END IF
- ITEMCUR% = ITEMLO%
- DO
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- IF FFF = ENDOFFILE THEN EXIT DO
- ITEMCUR% = VAL(FFF)
- IF ITEMCUR% >= ITEMLO% AND ITEMCUR% <= ITEMHI% THEN
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- ITEMDESC%(ITEMCUR%) = VAL(FFF)
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- ITEMROOM%(ITEMCUR%) = VAL(FFF)
- END IF
- LOOP
- CLOSE 1
- END SUB
- SUB READNOUN
- OPEN PATHPATH + PATHNOUN FOR INPUT AS 1
- IF NOT (EOF(1)) THEN
- INPUT #1, NOUNLO%
- END IF
- IF NOT (EOF(1)) THEN
- INPUT #1, NOUNHI%
- END IF
- NOUNCUR% = NOUNLO%
- DO
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- IF FFF = ENDOFFILE THEN EXIT DO
- NOUNCUR% = VAL(FFF)
- IF NOUNCUR% >= NOUNLO% AND NOUNCUR% <= NOUNHI% THEN
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- NOUN%(NOUNCUR%) = VAL(FFF)
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- NOUNALIAS%(NOUNCUR%) = VAL(FFF)
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- NOUNITEM%(NOUNCUR%) = VAL(FFF)
- END IF
- LOOP
- CLOSE 1
- END SUB
- SUB READPATH
- OPEN "./PATH.TXT" FOR INPUT AS 1
- IF NOT (EOF(1)) THEN
- INPUT #1, FFF
- PATHLO% = HEX2BYTE(RIGHT$(FFF, 2))
- END IF
- IF NOT (EOF(1)) THEN
- INPUT #1, FFF
- PATHHI% = HEX2BYTE(RIGHT$(FFF, 2))
- END IF
- PATHCUR% = PATHLO%
- DO
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- IF FFF = ENDOFFILE THEN EXIT DO
- PATHCUR% = HEX2BYTE(RIGHT$(FFF, 2))
- IF PATHCUR% >= PATHLO% AND PATHCUR% <= PATHHI% THEN
- IF EOF(1) THEN EXIT DO
- INPUT #1, PATHTAG
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- SELECT CASE PATHTAG
- CASE "PATH"
- PATHPATH = FFF
- CASE "FONT"
- PATHFONT = FFF
- CASE "HELP"
- PATHHELP = FFF
- CASE "FLAG"
- PATHFLAG = FFF
- CASE "TEXT"
- PATHTEXT = FFF
- CASE "NOUN"
- PATHNOUN = FFF
- CASE "VERB"
- PATHVERB = FFF
- CASE "ITEM"
- PATHITEM = FFF
- CASE "ROOM"
- PATHROOM = FFF
- END SELECT
- END IF
- LOOP
- CLOSE 1
- END SUB
- SUB READROOM
- OPEN PATHPATH + PATHROOM FOR INPUT AS 1
- IF NOT (EOF(1)) THEN
- INPUT #1, ROOMLO%
- END IF
- IF NOT (EOF(1)) THEN
- INPUT #1, ROOMHI%
- END IF
- ROOMCUR% = ROOMLO%
- DO
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- IF FFF = ENDOFFILE THEN EXIT DO
- ROOMCUR% = VAL(FFF)
- IF ROOMCUR% >= ROOMLO% AND ROOMCUR% <= ROOMHI% THEN
- J = 1
- DO
- IF J > 4 THEN EXIT DO
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- REM DRAWFONT "[" + FFF + "]"
- ROOMWALL%(ROOMCUR%, J) = VAL(FFF)
- J = J + 1
- LOOP
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- ROOMDESC%(ROOMCUR%) = VAL(FFF)
- END IF
- LOOP
- CLOSE 1
- END SUB
- SUB READTEXT
- OPEN PATHPATH + PATHTEXT FOR INPUT AS 1
- IF NOT (EOF(1)) THEN
- INPUT #1, TEXTLO%
- END IF
- IF NOT (EOF(1)) THEN
- INPUT #1, TEXTHI%
- END IF
- TEXTCUR% = TEXTLO%
- DO
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- IF FFF = ENDOFFILE THEN EXIT DO
- TEXTCUR% = VAL(FFF)
- IF TEXTCUR% >= TEXTLO% AND TEXTCUR% <= TEXTHI% THEN
- IF EOF(1) THEN EXIT DO
- INPUT #1, TEXT$(TEXTCUR%)
- END IF
- LOOP
- CLOSE 1
- END SUB
- SUB READVERB
- OPEN PATHPATH + PATHVERB FOR INPUT AS 1
- IF NOT (EOF(1)) THEN
- INPUT #1, VERBLO%
- END IF
- IF NOT (EOF(1)) THEN
- INPUT #1, VERBHI%
- END IF
- VERBCUR% = VERBLO%
- DO
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- IF FFF = ENDOFFILE THEN EXIT DO
- VERBCUR% = VAL(FFF)
- IF VERBCUR% >= VERBLO% AND VERBCUR% <= VERBHI% THEN
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- VERB%(VERBCUR%) = VAL(FFF)
- IF EOF(1) THEN EXIT DO
- INPUT #1, FFF
- VERBALIAS%(VERBCUR%) = VAL(FFF)
- END IF
- LOOP
- CLOSE 1
- END SUB
- FUNCTION SANITIZE$ (BYVAL CMDINPUT AS STRING)
- DIM CMDI AS STRING
- CMDI = CMDINPUT
- DO
- IF LEN(CMDI) = 0 THEN
- EXIT DO
- END IF
- IF LEFT$(CMDI, 1) = SPACE$(1) THEN
- CMDI = RIGHT$(CMDI, LEN(CMDI) - 1)
- ELSE
- EXIT DO
- END IF
- LOOP
- DO
- IF LEN(CMDI) = 0 THEN
- EXIT DO
- END IF
- IF RIGHT$(CMDI, 1) = SPACE$(1) THEN
- CMDI = LEFT$(CMDI, LEN(CMDI) - 1)
- ELSE
- EXIT DO
- END IF
- LOOP
- DO
- IF LEN(CMDI) = 0 THEN
- EXIT DO
- END IF
- IF INSTR(1, CMDI, SPACE$(2)) > 0 THEN
- CMDI = LEFT$(CMDI, INSTR(1, CMDI, SPACE$(2)) - 1) + RIGHT$(CMDI, LEN(CMDI) - INSTR(1, CMDI, SPACE$(2)) - 1)
- ELSE
- EXIT DO
- END IF
- LOOP
- SANITIZE = CMDI
- END FUNCTION
- FUNCTION STR2$ (BYVAL VALUE AS STRING,BYVAL DIGITS AS INTEGER)
- DIM RET AS STRING
- RET = VALUE
- WHILE LEFT$(RET, 1) = SPACE$(1)
- RET = RIGHT$(RET, LEN(RET) - 1)
- WEND
- WHILE LEN(RET) < DIGITS
- RET = "0" + RET
- WEND
- STR2$ = RET: REM RIGHT$(RET, DIGITS)
- END FUNCTION
- SUB WAITKEY
- FFF = INPUT$(1)
- END SUB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement