minizork2-1988/volcano.zap
historicalsource a24d33a0ad Final Revision
2019-04-13 21:54:32 -04:00

463 lines
11 KiB
Plaintext

.FUNCT BALLOON-F,RARG=0,M,R,RC
EQUAL? RARG,M-LOOK \?CCL3
ZERO? BALLOON-INFLATED /?PRG18
PRINTI "The cloth bag is inflated and "
FSET? RECEPTACLE,OPENBIT \?PRG14
PRINTI "a "
PRINTD BALLOON-INFLATED
PRINTI " is burning in the"
JUMP ?PRG16
?PRG14: PRINTI "smoke leaks out of the closed"
?PRG16: PRINTI " receptacle."
JUMP ?CND4
?PRG18: PRINTI "The cloth bag is draped over the side of the basket. In the middle of the basket is a metal receptacle which is "
FSET? RECEPTACLE,OPENBIT \?PRG39
PRINTI "open"
FIRST? RECEPTACLE >RC /?BOGUS25
?BOGUS25: ZERO? RC /?PRG41
PRINTI ". A "
PRINTD RC
PRINTI " is "
EQUAL? BALLOON-INFLATED,RC \?PRG35
PRINTI "burning"
JUMP ?PRG37
?PRG35: PRINTI "nestled"
?PRG37: PRINTI " inside"
JUMP ?PRG41
?PRG39: PRINTI "closed"
?PRG41: PRINTI ". A braided wire "
?CND4: ZERO? BALLOON-TIED /?PRG48
PRINTI "connects the balloon to the hook."
JUMP ?PRG50
?PRG48: PRINTI "dangles from the basket."
?PRG50: PRINT PERIOD-CR
RTRUE
?CCL3: EQUAL? RARG,M-OBJDESC \?CCL53
PRINTI "There is a large heavy wicker basket here. A huge cloth bag is attached to the basket and "
ZERO? BALLOON-INFLATED /?PRG61
PRINTI "inflated"
JUMP ?PRG63
?PRG61: PRINTI "and draped over the side"
?PRG63: PRINTI ". A metal receptacle is fastened to the center of the basket"
ZERO? BALLOON-INFLATED /?PRG74
FSET? RECEPTACLE,OPENBIT \?PRG72
PRINTI ". In it is a burning "
PRINTD BALLOON-INFLATED
JUMP ?PRG74
?PRG72: PRINTI ". Smoke leaks from its closed lid"
?PRG74: PRINTI ". A piece of braided wire "
ZERO? BALLOON-TIED /?PRG81
PRINTR "tied to the hook holds the balloon in place."
?PRG81: PRINTR "dangles from the basket."
?CCL53: EQUAL? RARG,M-BEG \FALSE
EQUAL? PRSA,V?WALK \?CCL87
GETPT HERE,PRSO >M
ZERO? M /?PRG98
ZERO? BALLOON-TIED /?CCL93
PRINTR "You are tied to the ledge."
?CCL93: PTSIZE M
EQUAL? STACK,1 \?PEN96
SET 'BALLOON-LOC,R
?PEN96: CALL QUEUE,I-BALLOON,3
PUT STACK,0,1
RFALSE
?PRG98: PRINTR "You can't control the balloon this way."
?CCL87: EQUAL? PRSA,V?OPEN \?CCL101
ZERO? BALLOON-INFLATED /?CCL101
EQUAL? PRSO,RECEPTACLE \?CCL101
FIRST? RECEPTACLE \?CCL101
FSET RECEPTACLE,OPENBIT
PRINTI "Opening it reveals a burning "
PRINTD BALLOON-INFLATED
PRINT PERIOD-CR
RTRUE
?CCL101: EQUAL? PRSA,V?TAKE \?CCL109
EQUAL? BALLOON-INFLATED,PRSO \?CCL109
PRINTI "You don't really want to hold a burning "
PRINTD PRSO
PRINT PERIOD-CR
RTRUE
?CCL109: EQUAL? PRSA,V?PUT \?CCL115
EQUAL? PRSI,RECEPTACLE \?CCL115
FIRST? RECEPTACLE \?CCL115
PRINTR "The receptacle is already occupied."
?CCL115: EQUAL? PRSA,V?PUT \?CCL122
EQUAL? PRSI,RECEPTACLE \?CCL122
FSET PRSO,NDESCBIT
RFALSE
?CCL122: EQUAL? PRSA,V?INFLATE \FALSE
PRINTR "It takes more than words to inflate a balloon."
.FUNCT I-BALLOON
FSET? RECEPTACLE,OPENBIT \?CCL3
ZERO? BALLOON-INFLATED /?CCL3
CALL RISE-AND-SHINE
RSTACK
?CCL3: EQUAL? HERE,NARROW-LEDGE,WIDE-LEDGE \?CCL7
CALL RISE-AND-SHINE
RSTACK
?CCL7: CALL DECLINE-AND-FALL
RSTACK
.FUNCT BALLOON-BURN
PRINTI "The "
PRINTD PRSO
PRINTI " burns inside the receptacle."
CRLF
GETP PRSO,P?SIZE
MUL STACK,20
CALL QUEUE,I-BURNUP,STACK
PUT STACK,0,1
FSET PRSO,FLAMEBIT
FSET PRSO,ONBIT
FCLEAR PRSO,TAKEBIT
FCLEAR PRSO,READBIT
ZERO? BALLOON-INFLATED \TRUE
PRINTI "The cloth bag inflates as it fills with hot air."
CRLF
ZERO? LABEL-REVEALED \?CND8
MOVE BALLOON-LABEL,BALLOON
PRINTI "A label drops from the bag into the basket."
CRLF
?CND8: SET 'LABEL-REVEALED,TRUE-VALUE
SET 'BALLOON-INFLATED,PRSO
CALL QUEUE,I-BALLOON,3
PUT STACK,0,1
RTRUE
.FUNCT PUT-BALLOON,THERE,STR
EQUAL? HERE,NARROW-LEDGE,WIDE-LEDGE,VOLCANO-BOTTOM \?CND1
PRINTI "You watch as the balloon slowly "
PRINT STR
CRLF
?CND1: MOVE BALLOON,THERE
SET 'BALLOON-LOC,THERE
RETURN BALLOON-LOC
.FUNCT RISE-AND-SHINE,IN,R
IN? WINNER,BALLOON /?PRD1
PUSH 0
JUMP ?PRD2
?PRD1: PUSH 1
?PRD2: SET 'IN,STACK
CALL QUEUE,I-BALLOON,3
PUT STACK,0,1
EQUAL? BALLOON-LOC,VOLCANO-BY-WIDE-LEDGE \?CCL5
CALL INT,I-BURNUP
PUT STACK,0,0
CALL INT,I-BALLOON
PUT STACK,0,0
REMOVE BALLOON
ZERO? IN /?CCL8
CALL JIGS-UP,STR?196
JUMP ?CND6
?CCL8: EQUAL? HERE,NARROW-LEDGE,WIDE-LEDGE,VOLCANO-BOTTOM \?CND6
PRINTI "You watch the balloon drift over the rim and away on the wind."
CRLF
?CND6: SET 'BALLOON-LOC,VOLCANO-BOTTOM
RETURN BALLOON-LOC
?CCL5: CALL LKP,BALLOON-LOC,BALLOON-UPS >R
ZERO? R /?CCL13
ZERO? IN /?CCL16
PRINTI "The balloon ascends."
CRLF
CRLF
SET 'BALLOON-LOC,R
CALL GOTO,R
RSTACK
?CCL16: CALL PUT-BALLOON,R,STR?197
RSTACK
?CCL13: CALL LKP,BALLOON-LOC,BALLOON-FLOATS >R
ZERO? R /?CCL20
ZERO? IN /?CCL23
PRINTI "The balloon leaves the ledge."
CRLF
CRLF
SET 'BALLOON-LOC,R
CALL GOTO,R
RSTACK
?CCL23: CALL PUT-BALLOON,R,STR?198
FSET RECEPTACLE,OPENBIT
RTRUE
?CCL20: ZERO? IN /?CCL27
SET 'BALLOON-LOC,VOLCANO-CORE
PRINTI "The balloon rises slowly from the ground."
CRLF
CRLF
CALL GOTO,VOLCANO-CORE
RSTACK
?CCL27: CALL PUT-BALLOON,VOLCANO-CORE,STR?199
RSTACK
.FUNCT DECLINE-AND-FALL,IN,R
IN? WINNER,BALLOON /?PRD1
PUSH 0
JUMP ?PRD2
?PRD1: PUSH 1
?PRD2: SET 'IN,STACK
CALL QUEUE,I-BALLOON,3
PUT STACK,0,1
EQUAL? BALLOON-LOC,VOLCANO-CORE \?CCL5
ZERO? IN /?CCL8
SET 'BALLOON-LOC,VOLCANO-BOTTOM
ZERO? BALLOON-INFLATED /?CCL11
PRINTI "The balloon has landed."
CRLF
CRLF
CALL GOTO,VOLCANO-BOTTOM
RSTACK
?CCL11: REMOVE BALLOON
MOVE ADVENTURER,HERE
CALL INT,I-BALLOON
PUT STACK,0,0
PRINTI "The balloon smashes into dust against the volcano floor. You, miraculously, survive."
CRLF
CRLF
CALL GOTO,VOLCANO-BOTTOM
RSTACK
?CCL8: CALL PUT-BALLOON,VOLCANO-BOTTOM,STR?200
RSTACK
?CCL5: CALL LKP,BALLOON-LOC,BALLOON-DOWNS >R
ZERO? R /FALSE
ZERO? IN /?CCL20
PRINTI "The balloon descends."
CRLF
CRLF
SET 'BALLOON-LOC,R
CALL GOTO,R
RSTACK
?CCL20: CALL PUT-BALLOON,R,STR?201
RSTACK
.FUNCT LKP,ITM,TBL,CNT=0,LEN
GET TBL,0 >LEN
?PRG1: IGRTR? 'CNT,LEN /FALSE
GET TBL,CNT
EQUAL? STACK,ITM \?PRG1
EQUAL? CNT,LEN /FALSE
ADD CNT,1
GET TBL,STACK
RSTACK
.FUNCT I-BURNUP,OBJ
FIRST? RECEPTACLE >OBJ /?BOGUS1
?BOGUS1: EQUAL? HERE,BALLOON-LOC \?CND2
PRINTI "The "
PRINTD OBJ
PRINTI " has now burned out, and the cloth bag starts to deflate."
CRLF
?CND2: REMOVE OBJ
SET 'BALLOON-INFLATED,FALSE-VALUE
RTRUE
.FUNCT BRAIDED-WIRE-F
EQUAL? PRSA,V?EXAMINE,V?FIND,V?TAKE \?CCL3
CALL BCONTENTS
RSTACK
?CCL3: EQUAL? PRSA,V?TIE \?CCL5
EQUAL? PRSO,BRAIDED-WIRE \?CCL5
EQUAL? PRSI,HOOK \?CCL5
SET 'BALLOON-TIED,PRSI
CALL INT,I-BALLOON
PUT STACK,0,0
PRINTR "The balloon is fastened to the hook."
?CCL5: EQUAL? PRSA,V?UNTIE \FALSE
EQUAL? PRSO,BRAIDED-WIRE \FALSE
PRINTI "The wire is no"
ZERO? BALLOON-TIED /?PRG22
CALL QUEUE,I-BALLOON,3
PUT STACK,0,1
SET 'BALLOON-TIED,FALSE-VALUE
PRINTR "w unhooked."
?PRG22: PRINTR "t tied to anything."
.FUNCT BCONTENTS
EQUAL? PRSA,V?TAKE \?CCL3
PRINTI "The "
PRINTD PRSO
PRINTI " is an integral part of the basket and cannot be removed."
EQUAL? PRSO,BRAIDED-WIRE \?CND6
PRINTR " It might be tied, though."
?CND6: CRLF
RTRUE
?CCL3: EQUAL? PRSA,V?OPEN \?CCL11
PRINTR "The bag is enormous. You can't open it by hand."
?CCL11: EQUAL? PRSA,V?LOOK-INSIDE \?CCL15
PRINTR "It seems empty."
?CCL15: EQUAL? PRSA,V?EXAMINE \?CCL19
EQUAL? PRSO,RECEPTACLE \?CCL19
PRINTI "The receptacle is "
FSET? PRSO,OPENBIT \?PRG29
PRINTR "open."
?PRG29: PRINTR "closed."
?CCL19: EQUAL? PRSA,V?EXAMINE,V?FIND \FALSE
PRINTI "The "
PRINTD PRSO
PRINTR " is part of the basket. It may be manipulated within the basket but cannot be removed."
.FUNCT VOLCANO-BY-LEDGE-F,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "You are about "
EQUAL? HERE,VOLCANO-BY-SMALL-LEDGE \?PRG11
PRINTI "15"
JUMP ?PRG13
?PRG11: PRINTI "20"
?PRG13: PRINTI "0 feet up, "
EQUAL? HERE,VOLCANO-BY-WIDE-LEDGE \?PRG19
PRINTI "very "
?PRG19: PRINTI "near the rim of the volcano. To the "
EQUAL? HERE,VOLCANO-BY-SMALL-LEDGE \?PRG26
PRINTI "east is a narrow"
JUMP ?PRG28
?PRG26: PRINTI "west is a wide"
?PRG28: PRINTR "ledge."
.FUNCT RANDOM-BOOK-F
EQUAL? PRSA,V?PUT,V?MOVE,V?TAKE \FALSE
FSET WHITE-BOOK,TOUCHBIT
FSET PURPLE-BOOK,TOUCHBIT
FSET BLUE-BOOK,TOUCHBIT
RFALSE
.FUNCT PURPLE-BOOK-F
EQUAL? PRSA,V?READ \?CCL3
IN? STAMP,PURPLE-BOOK \?CCL3
FSET? PURPLE-BOOK,OPENBIT /?CCL3
GETP PURPLE-BOOK,P?TEXT
PRINT STACK
CRLF
CALL PERFORM,V?OPEN,PURPLE-BOOK
RTRUE
?CCL3: CALL RANDOM-BOOK-F
RSTACK
.FUNCT LEDGE-F,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "You are on a "
EQUAL? HERE,NARROW-LEDGE \?PRG11
PRINTI "small"
JUMP ?PRG13
?PRG11: PRINTI "large"
?PRG13: PRINTI " ledge high in the volcano. There is a small opening to the south"
ZERO? DUSTY-ROOM-COLLAPSED /?PRG21
EQUAL? HERE,WIDE-LEDGE \?PRG21
PRINTI " which is blocked by rubble"
?PRG21: PRINTR ". Imbedded in the rock is a small hook."
.FUNCT DUSTY-ROOM-F,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "You are in a featureless room with an exit on the north side. Imbedded in the far wall is a rusty box"
FSET? SAFE,OPENBIT /?PRG11
PRINTI ". An oblong hole has been chipped out of the front of it"
JUMP ?PRG13
?PRG11: PRINTI " whose door has been blown off"
?PRG13: PRINT PERIOD-CR
RTRUE
.FUNCT SAFE-F
EQUAL? PRSA,V?TAKE \?CCL3
EQUAL? PRSO,SAFE \?CCL3
PRINTR "The box is imbedded in the wall."
?CCL3: EQUAL? PRSA,V?CLOSE,V?OPEN \?CCL9
FSET? SAFE,OPENBIT \?CCL9
PRINTR "The box has no door!"
?CCL9: EQUAL? PRSA,V?OPEN \?CCL15
PRINTR "The box is rusted shut."
?CCL15: EQUAL? PRSA,V?CLOSE \FALSE
PRINTR "The box isn't open!"
.FUNCT SAFE-HOLE-F
EQUAL? PRSA,V?EXAMINE \FALSE
PRINTR "The hole was someone's failed attempt to chip their way into the box."
.FUNCT BRICK-F
EQUAL? PRSA,V?BURN \FALSE
REMOVE BRICK
CALL JIGS-UP,OTHER-PROPERTIES
RSTACK
.FUNCT FUSE-F
EQUAL? PRSA,V?BURN /?PRG9
EQUAL? PRSA,V?LAMP-ON \FALSE
IN? MATCH,WINNER \FALSE
FSET? MATCH,ONBIT \FALSE
?PRG9: PRINTI "The string starts to burn."
CRLF
CALL QUEUE,I-FUSE,2
PUT STACK,0,1
RTRUE
.FUNCT I-FUSE,BRICK-ROOM,F
LOC BRICK >BRICK-ROOM
IN? FUSE,BRICK \?CCL3
?PRG4: ZERO? BRICK-ROOM /FALSE
IN? BRICK-ROOM,ROOMS /?REP5
LOC BRICK-ROOM >BRICK-ROOM
JUMP ?PRG4
?REP5: MOVE EXPLOSION,BRICK-ROOM
FCLEAR BRICK-ROOM,TOUCHBIT
EQUAL? BRICK-ROOM,HERE \?CCL13
CALL JIGS-UP,OTHER-PROPERTIES
JUMP ?CND11
?CCL13: IN? BRICK,SAFE-HOLE \?PRG16
FSET SAFE-HOLE,INVISIBLE
FSET SAFE,OPENBIT
FCLEAR DUSTY-ROOM,TOUCHBIT
CALL QUEUE,I-SAFE,5
PUT STACK,0,1
?PRG16: PRINTI "There is an explosion nearby."
CRLF
FIRST? BRICK-ROOM >F \?CND11
?PRG20: FSET? F,TAKEBIT \?CND22
FSET F,INVISIBLE
?CND22: NEXT? F >F /?PRG20
?CND11: REMOVE BRICK
JUMP ?CND1
?CCL3: LOC FUSE
EQUAL? STACK,WINNER,HERE \?CND1
PRINTI "The string burns into nothingness."
CRLF
?CND1: REMOVE FUSE
RTRUE
.FUNCT BOMB?,O
EQUAL? O,BRICK \FALSE
IN? FUSE,BRICK \FALSE
CALL INT,I-FUSE
GET STACK,C-ENABLED?
ZERO? STACK /FALSE
RTRUE
.FUNCT I-SAFE
SET 'DUSTY-ROOM-COLLAPSED,TRUE-VALUE
EQUAL? HERE,DUSTY-ROOM \?CCL3
CALL JIGS-UP,STR?223
RSTACK
?CCL3: ZERO? DEAD \FALSE
PRINTR "Probably as a result of that recent explosion, an ominous rumbling indicates that a nearby room has collapsed."
.ENDI