home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / EFFO / forum3.lzh / SAMPLES / MPU / transit.adl < prev    next >
Text File  |  1988-01-22  |  10KB  |  576 lines

  1. {*** TRANSITIONS ***}
  2. Hitms =
  3.     (IF ($eq ($verb) %1) THEN
  4.     (IF %2 THEN
  5.         ($move .ME %2)
  6.         ($setg GO TRUE)
  7.     )
  8.     (IF %3 THEN
  9.         (($arg 3))
  10.     )
  11.     )
  12. ;
  13.  
  14. Synvb =
  15.     (IF ($eq ($verb) %1) THEN
  16.     ($setg Verb %2)
  17.     )
  18. ;
  19.  
  20. road1(ACTION) =
  21.     (Hitms n gard1 0)
  22.     (Hitms s gard2 0)
  23.     (Hitms e road2 0)
  24.     (Hitms w road3 0)
  25. ;
  26.  
  27. road2(ACTION) = 
  28.     (Hitms n gard1 0)
  29.     (Hitms s gard2 0)
  30.     (Hitms e road6 0)
  31.     (Hitms w road1 0)
  32. ;
  33.  
  34. DropKill =
  35.     ($say "The drop would kill you.\n")
  36.     ($setg MyLoc ($loc .ME))
  37.     ($setg GO TRUE)
  38. ;
  39.  
  40. road3(ACTION) = 
  41.     (Hitms n 0 DropKill)
  42.     (Hitms s 0 DropKill)
  43.     (Hitms e road1 0)
  44.     (Hitms w road7 Entr7)
  45. ;
  46.  
  47. road4(ACTION) = 
  48.     (Hitms n farm1 0)
  49.     (Hitms s road6 0)
  50.     (Hitms e frst1 0)
  51.     (Hitms w gard1 0)
  52. ;
  53.  
  54. road5(ACTION) = 
  55.     (Hitms n road6 0)
  56.     (Hitms s town1 0)
  57.     (Hitms e frst1 0)
  58.     (Hitms w gard2 0)
  59. ;
  60.  
  61. road6(ACTION) = 
  62.     (Hitms n road4 0)
  63.     (Hitms s road5 0)
  64.     (Hitms e frst1 0)
  65.     (Hitms w road2 0)
  66. ;
  67.  
  68. road7(ACTION) =
  69.     ($miss Tress Tress East7 West7 0 0 0 0 0 0)
  70. ;
  71.  
  72. East7 = 
  73.     ($setg GO TRUE)
  74.     (IF ($not @HWY7) THEN
  75.     ($move .ME road3)
  76.      ELSE
  77.     (Dump7 ($cont road7))
  78.     ($setg HWY7 ($minus @HWY7 1))
  79.     (Get7 ($cont Roadx))
  80.     )
  81. ;
  82.  
  83. West7 =
  84.     ($setg GO TRUE)
  85.     (Dump7 ($cont road7))
  86.     ($setg HWY7 ($plus @HWY7 1))
  87.     (Get7 ($cont Roadx))
  88. ;
  89.  
  90. Dump7 =
  91.     (IF ($link %1) THEN
  92.     (Dump7 ($link %1))        { start at bottom }
  93.     )
  94.     (IF ($ne %1 .ME) THEN        { Everything else leaves }
  95.     ($setp %1 RDLOC @HWY7)        { Retain its location on HWY 7 }
  96.     ($move %1 Roadx)        { Put it in the box }
  97.     )
  98. ;
  99.  
  100. Get7 =
  101.     (IF %1 THEN
  102.     (Get7 ($link %1))
  103.     (IF ($eq ($prop %1 RDLOC) @HWY7) THEN
  104.         ($move %1 road7)
  105.     )
  106.     )
  107. ;
  108.  
  109. Entr7 =
  110.     (Dump7 ($cont road7))
  111.     ($setg HWY7 0)
  112.     (Get7 ($cont Roadx))
  113. ;
  114.  
  115. gard1(ACTION) =
  116.     (Hitms n gard1 0)
  117.     (Hitms s road1 0)
  118.     (Hitms e gard1 0)
  119.     (Hitms w gard1 0)
  120. ;
  121.  
  122. gard2(ACTION) =
  123.     (Hitms n road1 0)
  124.     (Hitms s gard2 0)
  125.     (Hitms e gard2 0)
  126.     (Hitms w gard2 0)
  127. ;
  128.  
  129. FLeave =
  130.     (IF ($pct 20) THEN
  131.     ($move .ME road6)
  132.     )
  133.     ($setg GO TRUE)
  134. ;
  135.  
  136. frst1(ACTION) =
  137.     ($miss FLeave FLeave FLeave FLeave FLeave FLeave FLeave FLeave 0 0)
  138. ;
  139.  
  140. farm1 (ACTION) =
  141.     (Synvb enter north)
  142.     (Hitms n farm2 0)
  143.     (Hitms s road4 0)
  144.     (Hitms e farm3 0)
  145.     (Hitms w farm4 0)
  146.     (Hitms ne farm3 0)
  147.     (Hitms nw farm4 0)
  148. ;
  149.  
  150. farm2 (ACTION) =
  151.     (Synvb out s)
  152.     (Synvb enter n)
  153.     (Synvb east up)
  154.     (Hitms n farm6 0)
  155.     (Hitms s farm1 0)
  156.     (Hitms up farm7 0)
  157. ;
  158.  
  159. farm3 (ACTION) =
  160.     (Hitms n farm5 0)
  161.     (Hitms s farm1 0)
  162.     (Hitms e frst1 0)
  163.     (Hitms nw farm5 0)
  164.     (Hitms sw farm1 0)
  165. ;
  166.  
  167. farm4 (ACTION) =
  168.     (Hitms n farm5 0)
  169.     (Hitms s farm1 0)
  170.     (Hitms w gard1 0)
  171.     (Hitms ne farm5 0)
  172.     (Hitms se farm1 0)
  173. ;
  174.  
  175. farm5 (ACTION) =
  176.     (Hitms e farm3 0)
  177.     (Hitms w farm4 0)
  178.     (Hitms se farm3 0)
  179.     (Hitms sw farm4 0)
  180. ;
  181.  
  182. farm6 (ACTION) =
  183.     (Hitms out farm2 0)
  184.     (Hitms s farm2 0)
  185. ;
  186.  
  187. farm7 (ACTION) =
  188.     (Hitms e farm2 0)
  189.     (Hitms d farm2 PanL)
  190. ;
  191.  
  192.  
  193. town1 (ACTION) =
  194.     (Hitms n road5 0)
  195.     (Hitms s town2 0)
  196.     (Hitms e town3 0)
  197.     (Hitms w town4 0)
  198. ;
  199.  
  200. town2 (ACTION) =
  201.     (Hitms n town1 0)
  202.     (Hitms e town5 0)
  203.     (Hitms w town6 0)
  204. ;
  205.  
  206. town3 (ACTION) =
  207.     (Hitms out town1 0)
  208.     (Hitms w town1 0)
  209. ;
  210.  
  211. town4 (ACTION) =
  212.     (Hitms e town1 0)
  213.     (Hitms out town1 0)
  214. ;
  215.  
  216. town5 (ACTION) =
  217.     (Hitms w town2 0)
  218.     (Hitms out town2 0)
  219. ;
  220.  
  221. town6 (ACTION) =
  222.     (Hitms e town2 0)
  223.     (Hitms out town2 0)
  224. ;
  225.  
  226.  
  227. cel01 (ACTION) = 
  228.     (Hitms n cel02 0)
  229.     (Hitms w cel04 0)
  230.     (Hitms u farm7 0)
  231. ;
  232.  
  233. cel02 (ACTION) =
  234.     (Hitms n cel05 0)
  235.     (Hitms s cel01 0)
  236.     (Hitms e cel20 0)
  237. ;
  238.  
  239. cel20(ACTION) =
  240.     (Hitms w cel02 0)
  241. ;
  242.  
  243. cel03 (ACTION) =
  244.     (Hitms s cel05 0)
  245.     (IF ($not ($prop dragon KILLED)) THEN
  246.     (Hitms w cel13 0)
  247.     (Hitms ne cel09 0)
  248.     (Hitms d cel09 0)
  249.     )
  250. ;
  251.  
  252. cel04 (ACTION) =
  253.     (Synvb down north)
  254.     (Hitms n cel10 0)
  255.     (Hitms e cel01 0)
  256.     (Hitms w cel08 0)
  257. ;
  258.  
  259.  
  260. MV56= ($setg Cel6x 5);
  261. MV76= ($setg Cel6x 7);
  262. MV67=
  263.     (IF ($and ($ne @Cel6x 7) ($prop dragon AWAKE) ($not ($prop dragon KILLED)))
  264.      THEN
  265.     ($say "The ice dragon blocks your attempt to cross!\n\n")
  266.      ELSE
  267.     ($move .ME cel07)
  268.     )
  269.     ($setg GO TRUE) { short circuit default error message }
  270. ;
  271.  
  272. MV65=
  273.     (IF ($and ($ne @Cel6x 5) ($prop dragon AWAKE) ($not ($prop dragon KILLED)))
  274.      THEN
  275.     ($say "The ice dragon blocks your attempt to leave!\n")
  276.      ELSE
  277.     ($move .ME cel05)
  278.     )
  279.     ($setg GO TRUE) { short circuit default error message }
  280. ;
  281.  
  282.  
  283. cel05 (ACTION) =
  284.     (Hitms n cel03 0)
  285.     (Hitms s cel02 0)
  286.     (Hitms ne cel06 MV56)
  287. ;
  288.  
  289. cel06 (ACTION) =
  290.     (Hitms e 0 MV67)
  291.     (Hitms sw 0 MV65)
  292.     (IF ($and ($not ($prop dragon KILLED))
  293.           ($prop dragon AWAKE)
  294.           ($eq ($loc .ME) cel06) {still here}
  295.     )
  296.      THEN
  297.     ($setg MyLoc -1)
  298.     )
  299. ;
  300.  
  301. cel07 (ACTION) =
  302.     (Synvb out west)
  303.     (Hitms w cel06 MV76)
  304. ;
  305.  
  306. Thirst =
  307.     (IF ($eq ($loc .ME) desert) THEN
  308.     ($say "The blazing sun is too much for you, I'm afraid.\n")
  309.     (die)
  310.     )
  311. ;
  312.  
  313. Move08 =
  314.     (IF @RBTouch THEN
  315.     (IF ($prop dragon KILLED) THEN
  316.         ($move .ME field)
  317.      ELSE
  318.         ($move .ME desert)
  319.         ($sfus .ME Thirst 10)
  320.     )
  321.      ELSE
  322.     ($say "You bump your nose against the painting.\n")
  323.     ($setg MyLoc ($loc .ME))
  324.     )
  325.     ($setg GO TRUE)
  326. ;
  327.  
  328. cel08 (ACTION) =
  329.     (Hitms e cel04 0)
  330.     (Hitms w 0 Move08)
  331. ;
  332.  
  333. Slippery =
  334.     ($say "The waterfall is to slick for you to climb.\n")
  335.     ($setg MyLoc ($loc .ME))
  336.     ($setg GO TRUE)
  337. ;
  338.  
  339. CrackEntr =
  340.     ($say "You slip through the crack in the waterfall.\n")
  341. ;
  342.  
  343. Get21 =
  344.     LOCAL t, t1;
  345.     ($setg t ($cont riverx))
  346.     (WHILE @t DO
  347.     (IF ($eq ($prop @t Loc21) @RiverLoc) THEN
  348.         ($setg t1 ($link @t))
  349.         ($move @t cel21)
  350.         ($setg t @t1)
  351.      ELSE
  352.         (Next t)
  353.     )
  354.     )
  355. ;
  356.  
  357. Dump21 =
  358.     LOCAL t, t1;
  359.     ($setg t ($cont cel21))
  360.     (WHILE @t DO
  361.     (IF ($ne @t .ME) THEN
  362.         ($setp @t Loc21 @RiverLoc)
  363.         ($setg t1 ($link @t))
  364.         ($move @t riverx)
  365.         ($setg t @t1)
  366.      ELSE
  367.         (Next t)
  368.     )
  369.     )
  370. ;
  371.  
  372. Entr21 =
  373.     ($setg RiverLoc 1)
  374.     (Get21)
  375. ;
  376.  
  377. cel09 (ACTION) =
  378.     (Hitms n cel21 Entr21)
  379.     (Hitms u 0 Slippery)
  380.     (Hitms s cel18 CrackEntr)
  381. ;
  382.  
  383. Move11 =
  384.     (IF ($prop dragon KILLED) THEN
  385.     (IF ($not ($prop wetsuit WORN)) THEN
  386.         ($say "The pit is full of water!!!\n")
  387.      ELSE
  388.         ($say "That water looks mighty dangerous.  Are you sure?  ")
  389.         (IF ($yorn) THEN
  390.         ($say
  391. "You leap into the pit and are immediately grabbed by a mighty
  392. current which pulls you down, down, down...  Soon the pressure
  393. becomes too great for you to breathe, and the last thing you
  394. remember is feeling somewhat like an elephant's footstool.\n"
  395.         )
  396.         (die)
  397.         )
  398.     )
  399.     ($setg MyLoc ($loc .ME))
  400.      ELSE
  401.     ($move .ME cel11)
  402.     )
  403.     ($setg GO TRUE)
  404. ;
  405.  
  406. cel10 (ACTION) =
  407.     (Synvb up s)
  408.     (Hitms s cel04 0)
  409.     (Hitms d 0 Move11)
  410. ;
  411.  
  412. cel11 (ACTION) =
  413.     (IF ($and @GOVERB ($not ($prop [clear crystal] LIGHT))) THEN
  414.     ($say
  415. "You trip and fall into a pit that you were unable to see in the dark!\n"
  416.     )
  417.     (die)
  418.     )
  419.     (Hitms e cel12 0)
  420.     (Hitms w cel16 0)
  421. ;
  422.  
  423. cel12 (ACTION) =
  424.     (Hitms w cel11 0)
  425. ;
  426.  
  427. WaterEntr =
  428.     (IF ($gt ($prop .ME HAS) ($prop globe WEIGH)) THEN
  429.     (IF ($not ($prop wetsuit WORN)) THEN
  430.         ($say
  431. "Whatever you're carrying drags you down into the icy waters!\n"
  432.         )
  433.         (die)
  434.     )
  435.     )
  436. ;
  437.  
  438. cel13 (ACTION) =
  439.     (IF ($eq ($verb) down) THEN
  440.     (IF ($prop cel13 HOLED) THEN
  441.         (WaterEntr)
  442.         ($say "You plunge into the icy waters!\n")
  443.         ($move .ME cel14)
  444.         ($setg GO TRUE)
  445.         ($exit 1)
  446.     )
  447.     )
  448.     (Hitms e cel03 0)
  449.     (Hitms w cel19 0)
  450. ;
  451.  
  452. Drown =
  453.     (IF ($or ($eq ($loc .ME) cel14) ($eq ($loc .ME) cel17)) THEN
  454.     (IF ($not ($prop wetsuit WORN)) THEN
  455.         ($say
  456. "You can't hold your breath any longer.  The last thing you
  457. feel is the odd sensation of water entering your lungs.\n"
  458.         )
  459.         (die)
  460.     )
  461.     )
  462. ;
  463.  
  464. cel14 (ACTION) =
  465.     (IF ($eq ($verb) up) THEN
  466.     (IF ($prop cel13 HOLED) THEN
  467.         ($say "You pop out through a hole in the ice!\n")
  468.         ($move .ME cel13)
  469.         ($setg GO TRUE)
  470.         ($exit 1)
  471.      ELSE
  472.         ($say  "You are blocked by an icy roof above!\n")
  473.      )
  474.      )
  475.     (Hitms w cel15 0)
  476.     (Hitms e cel17 0)
  477.     ($sfus .ME Drown 1)
  478. ;
  479.  
  480. cel15(ACTION) =
  481.     (Synvb up south)
  482.     (Synvb enter e)
  483.     (Hitms e cel14 WaterEntr)
  484.     (Hitms s cel16 0)
  485. ;
  486.  
  487. cel16(ACTION) =
  488.     (Synvb down north)
  489.     (Hitms n cel15 0)
  490.     (Hitms e cel11 0)
  491. ;
  492.  
  493. cel17(ACTION) =
  494.     (Hitms ne cel18 0)
  495.     (Hitms w cel14 0)
  496.     ($sfus .ME Drown 1)
  497. ;
  498.  
  499. Swim =
  500.     ($say "You dive into the icy waters.\n")
  501.     (WaterEntr)
  502. ;
  503.  
  504. cel18(ACTION) =
  505.     (Synvb enter sw)
  506.     (Hitms n cel09 0)
  507.     (Hitms sw cel17 Swim)
  508. ;
  509.  
  510. cel19(ACTION) =
  511.     (Hitms e cel13 0)
  512. ;
  513.  
  514. North21 =
  515.     (Dump21)
  516.     ($setg RiverLoc ($plus @RiverLoc 1))
  517.     ($setg GO TRUE)
  518.     ($setp cel21 SEEN FALSE)
  519.     (Get21)
  520. ;
  521.  
  522. South21 =
  523.     (Dump21)
  524.     ($setg GO TRUE)
  525.     ($setg RiverLoc ($minus @RiverLoc 1))
  526.     ($setp cel21 SEEN FALSE)
  527.     (IF ($not @RiverLoc) THEN
  528.     ($move .ME cel09)
  529.     ELSE
  530.     (Get21)
  531.     )
  532. ;
  533.  
  534. CantClimb =
  535.     ($say "The sides of the river bed are too steep for you to climb.\n")
  536.     ($setg MyLoc ($loc .ME))
  537.     ($setg GO TRUE)
  538. ;
  539.  
  540. GrateThere =
  541.     ($say "The grate blocks your attempt to move that way.\n")
  542.     ($setg MyLoc ($loc .ME))
  543.     ($setg GO TRUE)
  544. ;
  545.  
  546. cel21(ACTION) =
  547.     (IF ($eq @RiverLoc GRATELOC) THEN
  548.     ($miss South21 GrateThere CantClimb CantClimb 0 0 0 0 0 0)
  549.      ELSEIF ($eq @RiverLoc BEND1LOC) THEN
  550.     ($miss CantClimb South21 CantClimb North21 0 0 0 0 0 0)
  551.      ELSEIF ($and ($gt @RiverLoc BEND1LOC) ($lt @RiverLoc BEND2LOC)) THEN
  552.     ($miss CantClimb CantClimb South21 North21 0 0 0 0 0 0)
  553.      ELSEIF ($eq @RiverLoc BEND2LOC) THEN
  554.     ($miss CantClimb North21 South21 CantClimb 0 0 0 0 0 0)
  555.      ELSEIF ($gt @RiverLoc BEND2LOC) THEN
  556.     ($miss South21 North21 CantClimb CantClimb 0 0 0 0 0 0)
  557.      ELSE { RiverLoc < BEND1LOC }
  558.     ($miss North21 South21 CantClimb CantClimb 0 0 0 0 0 0)
  559.     )
  560. ;
  561.  
  562. desert(ACTION) =
  563.     (Hitms n desert 0)
  564.     (Hitms s desert 0)
  565.     (Hitms e desert 0)
  566.     (Hitms w desert 0)
  567.     (Hitms ne desert 0)
  568.     (Hitms nw desert 0)
  569.     (Hitms se desert 0)
  570.     (Hitms sw desert 0)
  571. ;
  572.  
  573. field(ACTION) =
  574.     (Hitms n 0 ENDGAME)
  575. ;
  576.