10 ' PYRAMID2
20 MODE 1:BORDER 0:C=0:NBC=PEEK(&BE80)+PEEK(&BE81)+PEEK(&BE82)
30 FOR i=0 TO 3:INK i,0:NEXT i
40 MEMORY &3FFF
50 LOAD"Pyramid2.cmp"
60 FOR i=0 TO 3:INK i,0:NEXT i
70 POKE &A634,&C8:POKE &A635,0:POKE &A636,0:CALL &A60B
80 POKE &C7F1,&C9:CALL &C7D0
90 CALL &A60B

100 WINDOW #1,25,36,4,19
110 INK 0,0:INK 1,3:INK 2,15:INK 3,24
120 PEN #1,3:PRINT #1:PRINT #1,"A hall":PRINT #1,"frozen":PRINT #1,"where time":PRINT #1,"seems to":PRINT #1,"stand still"
130 PRINT #1,"between":PRINT #1,"stone":PRINT #1,"and shadow":PRINT #1,"from the":PRINT #1,"heights."         

140 LOCATE 13,20:PEN 2:PRINT"WHAT WILL YOU DO ?"
150 PEN 3:LOCATE 4,21:PRINT "1-Examine    2-Shout     3-Search"
160 PEN 2:LOCATE 4,22:PRINT "4-Climb the stairs NORTH"
170 PEN 3:LOCATE 4,23:PRINT "5-Go back to desert SOUTH"
180 PEN 2:LOCATE 4,24:PRINT "6-Open the door WEST"

200 k$=INKEY$
210 IF k$="1" THEN GOTO 300
220 IF k$="2" AND C=0 THEN GOTO 400
225 IF k$="2" AND C=1 THEN GOTO 1200
230 IF k$="3" THEN GOTO 500
240 IF k$="4" THEN RUN"Pyramid6.bas"
250 IF k$="5" THEN GOTO 600
260 IF k$="6" AND PEEK(&BE84)=0 THEN GOTO 700
270 IF k$="6" AND PEEK(&BE84)=1 THEN GOTO 1000
280 IF k$<"1" OR k$>"6" THEN GOTO 200

300 MODE 1:INK 0,0:INK 1,6:INK 2,15:INK 3,24
310 PEN 3:PRINT:PRINT"Your eyes sweep the room."
320 PEN 2:PRINT:PRINT"On the floor, ancient tiles bear":PRINT"witness to a glorious past."
330 PEN 3:PRINT:PRINT"To the west, a door looks almost":PRINT"modern, as if Ikea had a":PRINT"deal with the pharaohs."
340 PEN 1:PRINT:PRINT"The anachronism pricks your neurons."
350 PEN 2:PRINT:PRINT"To the right, a steep stair rises,":PRINT"so sharp it seems to test":PRINT"your life insurance."
360 PEN 1:PRINT:PRINT"Everything breathes mystery,":PRINT"a mix of history and something":PRINT"oddly out of time."
370 PEN 3:LOCATE 15,25:INPUT" ENTER  ",en$
380 GOTO 60

400 MODE 1:INK 0,0:INK 1,6:INK 2,15:INK 3,24
410 PEN 3:PRINT:PRINT"You shout so loud you expect":PRINT"dust to fall from the ceiling..."
420 PEN 2:PRINT:PRINT"Your shout echoes in the pyramid...":PRINT"Well, 'echo' is a big word."
430 PEN 1:PRINT:PRINT"Let's say it dies in the total":PRINT"indifference of millennial stones."
440 PEN 3:PRINT:PRINT"But at least you released all":PRINT"frustration built since the":PRINT"start of this adventure!"
450 PEN 2:PRINT:PRINT"Feel free to shout again, if yelling":PRINT"is your new passion."
460 C=1:PEN 3:LOCATE 15,25:INPUT" ENTER  ",en$
470 GOTO 60

500 MODE 1:INK 0,0:INK 1,6:INK 2,15:INK 3,24
510 PEN 3:PRINT:PRINT"You inspect the room with the":PRINT"precision of a tax auditor on duty."
520 PEN 2:PRINT:PRINT"After a few minutes crawling like":PRINT"a scorpion, you find shards of":PRINT"pottery."
530 PEN 1:PRINT:PRINT"Yes, pieces of clay thousands of":PRINT"years old."
540 PEN 3:PRINT:PRINT"        Impressive, right?"
550 PEN 2:PRINT:PRINT"You wonder if TARIQ really sent you":PRINT"here for this, or just to get":PRINT"rid of you for the weekend..."
560 PEN 3:LOCATE 15,25:INPUT" ENTER  ",en$
570 GOTO 60

600 MODE 1:INK 0,0:INK 1,6:INK 2,15:INK 3,24
610 PEN 3:PRINT:PRINT"You want to turn back, return":PRINT"to the Qattara desert..."
620 PEN 1:PRINT:PRINT"But the pyramid door decided":LOCATE 1,6:PRINT"differently:"
630 PEN 3:PRINT:PRINT"Solid as a rock and planted with":PRINT"tons of stone, it stubbornly":PRINT"remains closed."
640 PEN 2:PRINT:PRINT"Still, admit it would be a shame":PRINT"to give up now!"
650 PEN 3:PRINT:PRINT"Imagine TARIQ's face if you gave":PRINT"up the mission he entrusted you."
660 PEN 1:PRINT:PRINT"    So, hop hop hop, forward!"
670 PEN 2:PRINT:PRINT"The adventure lies ahead now!"
680 PEN 3:LOCATE 15,25:INPUT" ENTER  ",en$
690 GOTO 60

700 MODE 1:INK 0,0:INK 1,6:INK 2,15:INK 3,24
710 PEN 3:PRINT"You head WEST, hoping to":PRINT"discover what this door hides..."
720 PEN 1:PRINT:PRINT"But you hit a most surprising":PRINT"obstacle:"
730 PEN 2:PRINT:PRINT"Made entirely of metal, it clashes":LOCATE 1,8:PRINT"with the rest of the pyramid."
740 PEN 3:PRINT:PRINT"Three Ankh-shaped locks taunt":PEN 1:LOCATE 1,10:PRINT"Three":PEN 3:PRINT"silently."
745 IF NBC>=1 AND NBC<3 THEN GOTO 800 '1st time, partial keys
748 IF NBC=3 THEN GOTO 900 '1st time, 3 keys
750 PEN 2:PRINT:PRINT"Unless you plan to saw the metal with":PRINT"your teeth, better hope the needed":PRINT"keys are somewhere in the pyramid "
760 PRINT"to return and challenge this mysterious":PRINT"door!"
770 PEN 3:PRINT:PRINT"    Good luck on your quest!"
780 LOCATE 15,25:INPUT" ENTER  ",en$
790 POKE &BE84,1:GOTO 60

800 PEN 3:PRINT:PRINT"Alas, despite your searches in the":PRINT"pyramid, you only found";NBC;"key(s)."
810 PEN 1:LOCATE 23,15:PRINT NBC
820 PEN 2:PRINT:PRINT"You must continue exploring,":PRINT"go deeper or solve other puzzles":PRINT"then return to finally unlock":PRINT"this door!"
830 PEN 3:LOCATE 15,25:INPUT" ENTER  ",en$
840 POKE &BE84,1:GOTO 60

900 PEN 3:PRINT:PRINT"The cool thing is, by solving":PRINT"all pyramid puzzles, you already":PRINT"managed to find the three precious":LOCATE 1,16:PRINT"keys!"
910 PEN 2:LOCATE 1,18:PRINT"You insert them in their locks":PRINT"... and, miracle, the metal":PRINT"door opens with a theatrical squeak..."
920 PEN 1:PRINT:PRINT"   You step through..."
930 PEN 3:LOCATE 15,25:INPUT" ENTER  ",en$
940 RUN"Pyramid3.bas"

1000 MODE 1:INK 0,0:INK 1,6:INK 2,15:INK 3,24
1010 PEN 3:PRINT:PRINT"You approach the metal door again":PRINT"which remains stoic, silent":PRINT"and unwilling to open by itself..."
1020 IF NBC=3 THEN GOTO 1100
1030 PEN 2:PRINT:PRINT"But you must act as patient":PRINT"explorers, search each corner":PRINT"and hope to find the mysterious":PRINT"keys to finally challenge it."
1040 PEN 3:PRINT:PRINT"Currently, you only have";NBC;"key(s)":PRINT"of the 3 required."
1050 PEN 1:LOCATE 25,11:PRINT NBC
1060 Locate 1,15:PRINT"       Good luck on your quest!"
1070 PEN 3:LOCATE 15,25:INPUT" ENTER  ",en$
1080 GOTO 60

1100 PEN 2:PRINT:PRINT"The good news is, by solving":PRINT"all pyramid puzzles, you found":PRINT"the three precious keys!"
1110 PEN 3:LOCATE 1,12:PRINT"You insert them in their locks":PRINT"... and, miracle, the metal":PRINT"door opens with a theatrical squeak..."
1120 PEN 1:PRINT:PRINT:PRINT"   You step through..."
1130 PEN 3:LOCATE 15,25:INPUT" ENTER  ",en$
1140 RUN"Pyramid3.bas"

1200 MODE 1:INK 0,0:INK 1,6:INK 2,15:INK 3,24
1210 PEN 3:PRINT:PRINT"   You take a deep breath and..."
1220 PEN 1:PRINT:PRINT:PRINT"    BWAAAAAAAH ! GAAAH ! HOUHOUHOU !"
1230 PRINT:PRINT"                HONK !"
1240 PEN 2:PRINT:PRINT"Yes, you added a ";CHR$(34);"HONK";CHR$(34);" for originality."
1250 PEN 3:PRINT:PRINT:PRINT"Actually, it looks like a mix":PRINT"between Tarzan and a flush..."
1260 PEN 1:PRINT:PRINT:PRINT"         Feeling better now?"
1270 PEN 3:LOCATE 15,25:INPUT" ENTER  ",en$
1280 GOTO 60
