home *** CD-ROM | disk | FTP | other *** search
/ APDL Soft Rock Games / APDL_SOFTROCK.iso / trellis / src_pyr / script < prev    next >
Encoding:
Text File  |  1999-04-14  |  15.5 KB  |  391 lines

  1. The Sacred Pyramid
  2. Archimedes version
  3. (c)1991-4 Soft Rock Software
  4.  
  5. REM ********************** 1: Initialise stores, etc. *************************
  6.  
  7. REM **** Player has no light source
  8. LET Store%(0)=0
  9. LET Store%(20)=0
  10.  
  11. REM **** Weight limit and weight carried
  12. LET Store%(1)=100
  13. LET Store%(2)=0
  14.  
  15. REM **** Player start location
  16. LET Store%(3)=2
  17.  
  18. REM ********************** 2: Describe location *******************************
  19.  
  20. :movement_loop
  21.  CLS
  22. :look_loop
  23.  LOOK
  24.  
  25. REM ********************** 3: Conditions 1 ************************************
  26.  
  27. REM **** is player in desert?
  28. IF Store%(3)=1 THEN GOTO game_won
  29.  
  30. REM **** is player in trap?
  31. IF Store%(3)>=29 THEN GOTO game_over
  32.  
  33. REM **** comment on hole in 9
  34. IF Store%(3)=9 AND North%(9)=0 THEN PRINT " There is a small hole in the floor near the base of the North wall."
  35.  
  36. REM **** has player taken diamond from room 13 to room 9?
  37. IF Store%(3)=9 AND Location%(3)=0 THEN
  38.  PRINT " You can feel warmth coming from the diamond you carry. Looking down at it, you can see that it is beginning to glow. A mist forms in the air around you, and you begin to find yourself struggling more and more for each breath."''
  39.  PRINT "As the moment of death approaches you hear a deep voice in your head, saying 'You have removed the Chameleon Crystal from the Death Chamber of Atstulis. You must be punished with death...."''
  40.  PRINT " The diamond is ripped from your clutch and flies into the chamber to the North, just as you lose consciousness..."''
  41.  GOTO game_over
  42. END IF
  43.  
  44. REM **** If player has moved North to 16, roof must collapse South
  45. IF Store%(3)=16 AND North%(11)=16 THEN
  46.  PRINT " The roof of the passage to the South collapses, blocking your exit in that direction."
  47.  LET North%(11)=0
  48.  LET South%(16)=0
  49. END IF
  50.  
  51. REM **** If player has passed through secret door from 15 to 10, door must close
  52. IF Store%(3)=10 AND East%(15)=10 THEN
  53.  PRINT " The secret door through which you have just come closes with such force that the whole pyramid shakes. There is no longer an exit West."
  54.  LET East%(15)=0
  55.  LET West%(10)=0
  56. END IF
  57.  
  58. REM **** If player at 21/25 secret door at 24 closes (if open)
  59. IF (Store%(3)=21 OR Store%(3)=25) AND North%(24)=27 THEN
  60.  PRINT " The secret door in the section of passage you have just left closes, causing the whole pyramid to shudder."
  61.  LET North%(24)=0
  62.  LET South%(27)=0
  63. END IF
  64.  
  65. REM **** If player at 21/17 secret door at 28 closes (if open)
  66. IF (Store%(3)=21 OR Store%(3)=17) AND West%(28)=26 THEN
  67.  PRINT " The secret door in the section of passage you have just left closes, causing the whole pyramid to shudder."
  68.  LET West%(28)=0
  69.  LET East%(26)=0
  70. END IF     
  71.  
  72. REM **** start a new line after location descriptions
  73. PRINT '
  74.  
  75. REM ********************** 4: Player input ************************************
  76.  
  77. :dummyloop
  78. :input_loop
  79.  INPUT
  80.  IF FNSaid("QUIT") THEN
  81.   QUIT
  82.   GOTO input_loop
  83. END IF
  84.  REM **** increment counter. when this reaches 8, players eyes will be adjusted
  85.  REM      to the dark if he/she can't see.
  86.  LET Store%(20)=Store%(20)+1
  87.      
  88. REM ********************** 5: Conditions 2 ************************************
  89.  
  90. REM **** check if player's eyes adjusted to the dark.
  91. IF Store%(20)=8 AND Store%(0)=0 THEN
  92.  PRINT '"Your eyes begin to adjust to the darkness. In the gloom you can see only shadows at first, but they soon become solid shapes."''"You are now able to see!!"'
  93.  LET Store%(0)=1
  94. END IF
  95.  
  96. REM **** commands that Trellis can deal with 100% automatically
  97. IF FNSaid("EAST") OR FNSaid("WEST") OR FNSaid("UP") THEN GOTO process_command
  98. IF FNSaid("DOWN") OR FNSaid("INV") THEN GOTO process_command
  99.  
  100. REM **** at 7, walk North through waterfall
  101. IF Store%(3)=7 AND FNSaid("NORTH") THEN
  102.  PRINT "You walk into the waterfall and find that there is no wall beyond it. You pass through into another passage."'
  103.  LET Store%(3)=9
  104.  GOTO look_loop
  105. END IF
  106. IF FNSaid("NORTH") THEN GOTO process_command
  107.  
  108. REM **** at 9, walk South through waterfall
  109. IF Store%(3)=9 AND FNSaid("SOUTH") THEN
  110.  PRINT "You walk into the waterfall and find that there is no wall beyond it. You pass through into another passage."'
  111.  LET Store%(3)=7
  112.  GOTO look_loop
  113. END IF
  114. IF FNSaid("SOUTH") THEN GOTO process_command
  115.  
  116. REM **** player asks for help
  117. IF FNSaid("HELP") THEN GOTO help
  118.  
  119. REM **** if player says look, jump to look_loop (makes mentioning hole in room
  120. REM      9 occur after player walks through waterfall.)
  121. IF FNSaid("LOOK") THEN GOTO look_loop
  122.  
  123. REM **** player says wait - do nothing
  124. IF FNSaid("WAIT") THEN
  125.  PRINT "You wait. Nothing happens."'
  126.  GOTO input_loop
  127. END IF
  128.  
  129. REM **** at 9, player examines hole
  130. IF FNSaid("EXAMINE") AND FNSaid("HOLE") AND Store%(3)=9 THEN
  131.  IF North%(9)=0 THEN PRINT "The hole is about two inches in diameter. "
  132.  IF Location%(5)=0 THEN PRINT "It is just the right size for the ruby."
  133.  IF North%(9)=13 THEN PRINT "The ruby has been placed in the hole."
  134.  PRINT '
  135.  GOTO input_loop
  136. END IF
  137.  
  138. REM **** at 2, put orb on pedestal to open exit door
  139. IF (FNSaid("DROP") OR FNSaid("PUT")) AND FNSaid("ORB") AND FNSaid("PEDESTAL") THEN
  140.  IF Store%(3)<>2 OR Location%(2)<>0 THEN GOTO you_cant
  141.  DROP ORB
  142.  LET South%(2)=1
  143.  LET North%(1)=2
  144.  PRINT "The heavy stone door to the South opens. From beyond, you can see a clear blue sky. The Sun is beating down on the yellow sands of the desert."'
  145.  LET Room$(2)="You are in a passage. It is light here, due to the sunlight shining in through the door to the South, beyond which lies the desert."
  146.  GOTO input_loop
  147. END IF                                              
  148.  
  149. REM **** at 2, take orb from pedestal to close exit door
  150. IF FNSaid("GET") AND FNSaid("ORB") AND Location%(2)=2 AND Store%(3)=1 THEN
  151.  GET ORB
  152.  IF South%(2)=0 THEN GOTO input_loop
  153.  PRINT "The stone door to the South closes very quickly and with such force that the walls and floor around you shake. The sudden change from light to dark leaves you unable to see."'
  154.  LET Room$(2)="You are in a passage. It is very dark, but your eyes are suitably adjusted for you to see. The walls are a rough cut stone, and the passage is high and wide."
  155.  LET Store%(20)=0
  156.  LET Store%(0)=0
  157.  LET South%(2)=0
  158.  LET North%(1)=0
  159.  GOTO input_loop
  160. END IF
  161.  
  162. REM **** at 9, put ruby in hole to open door
  163. IF (FNSaid("DROP") OR FNSaid("PUT")) AND FNSaid("RUBY") AND FNSaid("HOLE") THEN
  164.  IF Store%(3)<>9 AND Location%(5)<>0 THEN GOTO you_cant
  165.  DROP RUBY
  166.  LET North%(9)=13
  167.  LET South%(13)=9
  168.  PRINT "You hear the sound of stone scraping against stone, as a stone door swings open to the North."'
  169.  GOTO input_loop
  170. END IF
  171.  
  172. REM **** at 9, get ruby from hole to close door
  173. IF FNSaid("GET") AND FNSaid("RUBY") AND Location%(5)=9 AND Store%(3)=9 THEN
  174.  GET RUBY
  175.  LET North%(9)=0
  176.  LET South%(13)=0                                              
  177.  PRINT "You hear the sound of stone scraping against stone, as a stone door swings closed to the North."'
  178.  GOTO input_loop
  179. END IF
  180.  
  181. REM **** Dip sword in wrong pool (at 27) - lose sword
  182. IF Store%(3)=27 AND FNSaid("DIP") AND FNSaid("SWORD") AND FNSaid("WATER") THEN
  183.  IF Location%(8)<>0 THEN GOTO you_cant
  184.  PRINT "Okay."'
  185.  PRINT "The sword gets wet. When you lift it out of the pool, the sword starts to melt. Dripping into the pool, the sword turns to water. Soon, nothing remains of it."'
  186.  LET Location%(8)=-1
  187.  GOTO input_loop
  188. END IF
  189.  
  190. REM **** Dip sword in right pool (at 26) - enchant sword
  191. IF Store%(3)=26 AND FNSaid("DIP") AND FNSaid("SWORD") AND FNSaid("WATER") THEN
  192.  IF Location%(8)<>0 THEN GOTO you_cant
  193.  PRINT "Okay."'
  194.  IF List$(8)="an enchanted sword" THEN GOTO input_loop
  195.  PRINT "The sword gets wet. When you lift it out of the pool, you realise it seems to weigh much less than before. The hilt seems to change shape to suit your hand, and something in your head tells you that it is now enchanted."'
  196.  LET List$(8)="an enchanted sword"
  197.  LET Examine$(8)="Though big, the sword is very light. The jewel studded hilt is just the right size and shape to fit comfortably in your hand. Something in your mind tells you that the sword is enchanted."
  198.  GOTO input_loop
  199. END IF
  200.  
  201. REM **** Drink water at 7,9,26,27 - all water in Pyramid is poisonous
  202. IF FNSaid("DRINK") AND FNSaid("WATER") THEN
  203.  IF Store%(3)<>9 AND Store%(3)<>13 AND Store%(3)<>26 AND Store%(3)<>27 THEN GOTO you_cant
  204.  PRINT "Okay."'"The water tastes cool and fresh."'"Suddenly, you find yourself without breath. You collapse to the floor, choking, and soon lose consciousness...."'(
  205.  GOTO game_over
  206. END IF
  207.  
  208. REM **** Take ruby at 14
  209. IF FNSaid("GET") AND FNSaid("RUBY") AND Store%(3)=14 AND Location%(5)=14 THEN
  210.  IF Location%(6)=-1 THEN GOTO process_command
  211.  PRINT "As you go to take the ruby, the ghoul lets out an ear splitting wail. The air around the ruby freezes, and you have to pull your hand back sharply."'
  212.  GOTO input_loop
  213. END IF
  214.  
  215. REM **** Fight ghoul at 14 (go to routine in section 10 to win or lose)
  216. IF FNSaid("FIGHT") AND FNSaid("GHOUL") AND Store%(3)=Location%(6) THEN
  217.  IF Location%(8)=0 AND List$(8)="an enchanted sword" THEN GOTO win_fight
  218.  GOTO lose_fight
  219. END IF                         
  220.  
  221. REM **** Read text at 10
  222. IF (FNSaid("READ") OR FNSaid("EXAMINE")) AND FNSaid("TEXT") AND Store%(3)=10 THEN
  223.  PRINT "The marks on the wall appear to have been put there by someone else who was once trapped in the Pyramid. It says:"
  224.  PRINT " 'To all who follow me. I know now how to escape from this tomb but, alas, it is too late for me for I am weak and dying. The waterfall is a door. To the North, beyond it is the Burial Chamber of Atstulis."
  225.  PRINT " In the chamber is an Orb. Take this, and place it on the pedestal in the entrance passage and you will be free. The chamber itself is locked. You will need the key to open it, a ruby."
  226.  PRINT " That, however, is protected by an evil ghoul. You need an enchanted weapon to destroy it. If you have a weapon, dip it in the holy pool to enchant it. I wish you the luck that wasn't with me.'"'
  227.  GOTO input_loop
  228. END IF
  229.  
  230.  
  231. REM **** Take staff at 15 to open door to 10
  232. IF FNSaid("TAKE") AND FNSaid("STAFF") AND Store%(3)=15 AND East%(15)=0 THEN
  233.  PRINT "You are unable to take the staff, but in trying you trigger a mechanism that opens a secret door leading East."'
  234.  LET East%(15)=10
  235.  LET West%(10)=15
  236.  GOTO input_loop
  237. END IF
  238.  
  239. REM **** Take staff at 15 to close door to 10
  240. IF FNSaid("TAKE") AND FNSaid("STAFF") AND Store%(3)=15 AND East%(15)=10 THEN
  241.  PRINT "You are unable to take the staff, but in trying you trigger a mechanism that closes the door leading East."'
  242.  LET East%(15)=0
  243.  LET West%(10)=0
  244.  GOTO input_loop
  245. END IF
  246.  
  247. REM **** Stand on slab at 28 to open door to 26
  248. IF FNSaid("STAND") AND FNSaid("SLAB") AND Store%(3)=28 AND West%(28)=0 THEN
  249.  PRINT "You hear a loud scraping noise, like stone moving against stone, and a heavy stone door opens to reveal another exit."'
  250.  LET West%(28)=26
  251.  LET East%(26)=28
  252.  GOTO input_loop
  253. END IF
  254.  
  255. REM **** Stand on slab at 24 to open door to 27
  256. IF FNSaid("STAND") AND FNSaid("SLAB") AND Store%(3)=24 AND North%(24)=0 THEN
  257.  PRINT "You hear a loud scraping noise, like stone moving against stone, and a heavy stone door opens to reveal another exit."'
  258.  LET North%(24)=27
  259.  LET South%(27)=24
  260.  GOTO input_loop
  261. END IF       
  262.  
  263. REM ********************** 6: Act on player input *****************************
  264.  
  265. :process_command
  266. COMMAND
  267.  
  268. REM ********************** 7: Loop ********************************************
  269.  
  270. IF Moved% THEN GOTO movement_loop
  271. GOTO input_loop
  272.  
  273. REM ********************** 8: End game ****************************************
  274.  
  275. :game_won
  276. PRINT '''"Congratulations."'''
  277. GOTO end_game
  278.  
  279. :game_over
  280. PRINT '''"Hard luck."'''
  281.  
  282. :end_game
  283. RESTART
  284.  
  285. REM ********************** 9: Routines ****************************************
  286.                                       
  287. REM **** player fights ghoul and wins
  288. :win_fight
  289. PRINT '"You attack the ghoul with your sword. Normally, this would be a fruitless effort, since the ghoul does not physically exist in this world, and the sword would just slice through the air as if there were nothing there."
  290. PRINT " However, because the sword is enchanted you are somehow able to strike the spirit again and again, weakening it more and more with each blow. Eventually the ghoul vanishes with a shriek. You have defeated it."'
  291. LET Location%(6)=-1
  292. GOTO input_loop
  293.  
  294. REM **** player fights ghoul and loses
  295. :lose_fight
  296. IF Location%(8)=0 THEN
  297.  PRINT '"You attack the ghoul with your sword. This turns out to be a fruitless effort as the ghoul does not physically exist in this world, and the sword is just cutting through the air with nothing to land home on."
  298. ELSE 
  299.  PRINT '"You attack the ghoul with your fists. This turns out to be a fruitless effort as the ghoul does not physically exist in this world, and you are just punching the air."
  300. END IF
  301. PRINT " The ghoul is angered by your attack, and opens it's arms. You feel a sudden, freezing cold wind which makes you shudder. The wind doesn't stop, and you can see your hands turning blue as you shiver uncontrollably."
  302. PRINT '"You fall to your knees as the wind becomes stronger and colder, and then onto your side. The last thing you remember before you black out is an evil laugh that seems to be coming from inside your head..."
  303. GOTO game_over
  304.  
  305. REM **** help routine
  306. :help
  307.  
  308. REM **** tell player to wait for eyes to adjust to dark, if need be.
  309. IF Store%(0)=0 THEN
  310.  PRINT '"Obviously, you will need to be able to see. I therefore suggest that you wait for your eyes to adjust to the dark."'
  311.  GOTO input_loop
  312. END IF
  313.  
  314. REM **** Check for other words with help command, ie player wants specific help.
  315. REM      The player can only have help with something seen or carried.
  316.  
  317. REM **** Help with Pedestal
  318. IF FNSaid("PEDESTAL") AND Store%(3)=2 THEN
  319.  PRINT "The pedestal should have an orb on it."'
  320.  GOTO input_loop
  321. END IF
  322.  
  323. REM **** Help with Orb
  324. IF FNSaid("ORB") AND (Location%(2)=Store%(3) OR Location%(2)=0) THEN
  325.  PRINT "The orb must be placed on a pedestal."'
  326.  GOTO input_loop
  327. END IF
  328.  
  329. REM **** Help with diamond
  330. IF FNSaid("DIAMOND") AND (Location%(3)=Store%(3) OR Location%(3)=0) THEN
  331.  PRINT "The diamond must remain in the burial chamber of Atstulis."'
  332.  GOTO input_loop
  333. END IF
  334.  
  335. REM **** Help with Ruby
  336. IF FNSaid("RUBY") AND (Location%(5)=Store%(3) OR Location%(5)=0) THEN
  337.  PRINT "The ruby must is the key to the burial chamber of Atstulis."'
  338.  GOTO input_loop
  339. END IF
  340.  
  341. REM **** Help with ghoul
  342. IF FNSaid("GHOUL") AND Location%(6)=Store%(3) THEN
  343.  PRINT "The ghoul must be killed with an enchanted weapon."'
  344.  GOTO input_loop
  345. END IF
  346.  
  347. REM **** Help with statue
  348. IF FNSaid("STATUE") AND Store%(3)=15 AND East%(15)=0 THEN
  349.  PRINT "The staff is the key to a secret door."'
  350.  GOTO input_loop
  351. END IF
  352.  
  353. REM **** Help with sword
  354. IF FNSaid("SWORD") AND (Location%(8)=Store%(3) OR Location%(8)=0) AND List$(8)="a sword" THEN
  355.  PRINT "The sword must be dipped in holy water."'
  356.  GOTO input_loop
  357. END IF
  358.  
  359. REM **** Help with hole
  360. IF FNSaid("HOLE") AND Store%(3)=9 THEN
  361.  PRINT "The hole was made for a ruby. It is a keyhole."'
  362.  GOTO input_loop
  363. END IF
  364.  
  365. REM **** Help with water
  366. IF FNSaid("WATER") THEN
  367.  IF Store%(3)=7 OR Store%(3)=9 THEN PRINT "The artificial waterfall is a doorway."'
  368.  IF Store%(3)=26 THEN PRINT "The water in the pool is holy water."'
  369.  IF Store%(3)=27 THEN PRINT "The water in the pool is unholy water."'
  370.  IF Store%(3)=7 OR Store%(3)=9 OR Store%(3)=26 OR Store%(3)=27 THEN GOTO input_loop
  371. END IF
  372.  
  373. REM **** help with slabs (slabs not entered by player - location checked instead)
  374. IF Store%(3)=24 OR Store%(3)=28 THEN
  375.  PRINT "The slab is a key to a secret door. It is opened with weight."'
  376.  GOTO input_loop
  377. END IF
  378.  
  379. REM **** tell player there are clues within the game. Display location number
  380. REM      to aid mapping.
  381. PRINT '"There is a major clue somewhere in the game. It tells you most of what you need to know, the rest you must work out for yourself. What I can do is help you to map the pyramid by telling you that you are in location "[Store%(3)]'
  382. GOTO input_loop
  383.  
  384. REM **** player entered command that cant be carried out.
  385. :you_cant
  386. PRINT "You can't do that."'
  387. GOTO input_loop
  388.  
  389.  
  390. STOP
  391.