home *** CD-ROM | disk | FTP | other *** search
/ 321 GAMES / 321GAMES.iso / logic / runes / runes.exe / runes.DXR / 00067_GETDIR.ls < prev    next >
Encoding:
Text File  |  1996-07-01  |  7.3 KB  |  270 lines

  1. on GETDIR
  2.   global DR, startMovie, GRIDVAL, TEMDR, HEAD, BFALL, BCC, SOLUTIONFLAG, SOLCNT, RBCNT, BUTGRID, TEMBUTGRID, SOL, DD, SOLUTION, TEMPBOARD, THEAD, MAN, TMAN, OPT, PUZZ, UPG
  3.   set OPT to 0
  4.   dontPassEvent()
  5.   set DD to EMPTY
  6.   if (the key = "Q") or (the key = "q") then
  7.     set OPT to 5
  8.     exit
  9.   end if
  10.   if (the key = "N") or (the key = "n") then
  11.     set PUZZ to 0
  12.     set SOLUTIONFLAG to 0
  13.     set the keyUpScript to EMPTY
  14.     dontPassEvent()
  15.     go("SELECT")
  16.     exit
  17.   end if
  18.   if (the key = "r") or (the key = "R") then
  19.     set HEAD to 0
  20.     set SOLUTIONFLAG to 0
  21.     puppetSprite(34, 0)
  22.     set the keyUpScript to "GETDIR"
  23.     go("NEW")
  24.     exit
  25.   end if
  26.   if SOLUTIONFLAG = 0 then
  27.     if (the key = "o") or (the key = "O") then
  28.       set OPT to 1
  29.       exit
  30.     end if
  31.     if (the key = "D") or (the key = "d") then
  32.       play frame "DIRECTIONS"
  33.       exit
  34.     end if
  35.     if (the key = "S") or (the key = "s") then
  36.       if (UPG = 0) and (PUZZ > 3) then
  37.         go("RVONLY")
  38.       end if
  39.       if (UPG = 0) and (PUZZ > 3) then
  40.         exit
  41.       end if
  42.       set SOLUTIONFLAG to 1
  43.       set the keyUpScript to "EEMPTY"
  44.       dontPassEvent()
  45.       go("NEW")
  46.     end if
  47.   end if
  48.   if (MAN <> 0) and (BUTGRID = MAN) then
  49.     exit
  50.   end if
  51.   set BFALL to 0
  52.   set LN to -100
  53.   if (DR = 2) or (DR = 4) then
  54.     set TEMDR to DR
  55.   end if
  56.   if SOLUTIONFLAG = 0 then
  57.     set LT to the key
  58.     set LN to charToNum(LT)
  59.   end if
  60.   if SOLUTIONFLAG = 1 then
  61.     set SOLCNT to SOLCNT + 1
  62.     set DD to char SOLCNT of SOL
  63.     set DT to 1
  64.     if DD = "U" then
  65.       set LN to 30
  66.     end if
  67.     if DD = "R" then
  68.       set LN to 29
  69.     end if
  70.     if DD = "D" then
  71.       set LN to 31
  72.     end if
  73.     if DD = "L" then
  74.       set LN to 28
  75.     end if
  76.     set LT to DD
  77.   end if
  78.   if (LN = 29) and (the castNum of sprite 30 = 28) then
  79.     set the castNum of sprite 30 to 37
  80.     updateStage()
  81.     exit
  82.   end if
  83.   if (LN = 28) and (the castNum of sprite 30 = 37) then
  84.     set the castNum of sprite 30 to 28
  85.     updateStage()
  86.     exit
  87.   end if
  88.   if LN = 29 then
  89.     set DR to 2
  90.   end if
  91.   if LN = 28 then
  92.     set DR to 4
  93.   end if
  94.   if DR = 2 then
  95.     set the castNum of sprite 30 to 37
  96.   end if
  97.   if DR = 4 then
  98.     set the castNum of sprite 30 to 28
  99.   end if
  100.   ANIMATEORACLE()
  101.   if (DR = 2) and (HEAD = 0) then
  102.     if getAt(GRIDX, MAN) = getAt(GRIDX, 14) then
  103.       set DR to 0
  104.       exit
  105.     end if
  106.     if (getAt(GRIDVAL, MAN + 1) = 0) or (getAt(GRIDVAL, MAN + 1) > 14) then
  107.       WALKRIGHT()
  108.     end if
  109.   end if
  110.   if (DR = 4) and (HEAD = 0) then
  111.     if getAt(GRIDX, MAN) = getAt(GRIDX, 1) then
  112.       set DR to 0
  113.       exit
  114.     end if
  115.     if (getAt(GRIDVAL, MAN - 1) = 0) or (getAt(GRIDVAL, MAN - 1) > 14) then
  116.       WALKLEFT()
  117.     end if
  118.   end if
  119.   if (DR = 2) and (HEAD = 1) then
  120.     if getAt(GRIDX, MAN) = getAt(GRIDX, 14) then
  121.       set DR to 0
  122.       exit
  123.     end if
  124.     if ((getAt(GRIDVAL, MAN + 1) = 0) and (getAt(GRIDVAL, MAN - 13) = 0)) or ((getAt(GRIDVAL, MAN + 1) > 14) and (getAt(GRIDVAL, MAN - 13) = 0)) then
  125.       WALKRIGHTBLOCK()
  126.     end if
  127.   end if
  128.   if (DR = 4) and (HEAD = 1) then
  129.     if getAt(GRIDX, MAN) = getAt(GRIDX, 1) then
  130.       set DR to 0
  131.       exit
  132.     end if
  133.     if ((getAt(GRIDVAL, MAN - 1) = 0) and (getAt(GRIDVAL, MAN - 15) = 0)) or ((getAt(GRIDVAL, MAN - 1) > 14) and (getAt(GRIDVAL, MAN - 15) = 0)) then
  134.       WALKLEFTBLOCK()
  135.     end if
  136.   end if
  137.   if (DR = 2) and (HEAD = 1) then
  138.     if getAt(GRIDX, MAN) = getAt(GRIDX, 14) then
  139.       exit
  140.     end if
  141.     if ((getAt(GRIDVAL, MAN + 1) = 0) and (getAt(GRIDVAL, MAN - 13) <> 0)) or ((getAt(GRIDVAL, MAN + 1) > 14) and (getAt(GRIDVAL, MAN - 13) <> 0)) then
  142.       set BFALL to MAN - 14
  143.       WALKRIGHT()
  144.       set HEAD to 0
  145.     end if
  146.   end if
  147.   if (DR = 4) and (HEAD = 1) then
  148.     if getAt(GRIDX, MAN) = getAt(GRIDX, 1) then
  149.       exit
  150.     end if
  151.     if ((getAt(GRIDVAL, MAN - 1) = 0) and (getAt(GRIDVAL, MAN - 15) <> 0)) or ((getAt(GRIDVAL, MAN - 1) > 14) and (getAt(GRIDVAL, MAN - 15) <> 0)) then
  152.       set BFALL to MAN - 14
  153.       WALKLEFT()
  154.       set HEAD to 0
  155.     end if
  156.   end if
  157.   if (LN = 31) and (HEAD = 1) then
  158.     set LN to 0
  159.     if the castNum of sprite 30 = 37 then
  160.       set DR to 2
  161.     end if
  162.     if the castNum of sprite 30 = 28 then
  163.       set DR to 4
  164.     end if
  165.     if (DR = 2) and (getAt(GRIDX, MAN) <> getAt(GRIDX, 14)) then
  166.       if getAt(GRIDVAL, MAN - 13) = 0 then
  167.         DROPRIGHT()
  168.       end if
  169.     end if
  170.     if (DR = 4) and (getAt(GRIDX, MAN) <> getAt(GRIDX, 1)) then
  171.       if getAt(GRIDVAL, MAN - 15) = 0 then
  172.         DROPLEFT()
  173.       end if
  174.     end if
  175.   end if
  176.   if (LN = 31) and (HEAD = 0) and (MAN > 14) then
  177.     if getAt(GRIDVAL, MAN - 14) <> 0 then
  178.       exit
  179.     end if
  180.     if the castNum of sprite 30 = 37 then
  181.       set DR to 2
  182.     end if
  183.     if the castNum of sprite 30 = 28 then
  184.       set DR to 4
  185.     end if
  186.     if (DR = 2) and (getAt(GRIDX, MAN) <> getAt(GRIDX, 14)) then
  187.       if (getAt(GRIDVAL, MAN + 1) = 2) and (getAt(GRIDVAL, MAN - 13) = 0) then
  188.         PICKUPBLOCKRGT()
  189.       end if
  190.     end if
  191.     if (DR = 4) and (getAt(GRIDX, MAN) <> getAt(GRIDX, 1)) then
  192.       if (getAt(GRIDVAL, MAN - 1) = 2) and (getAt(GRIDVAL, MAN - 15) = 0) then
  193.         PICKUPBLOCKLFT()
  194.       end if
  195.     end if
  196.   end if
  197.   if (LN = 30) and (MAN > 14) and (HEAD = 0) then
  198.     if getAt(GRIDVAL, MAN - 14) = 0 then
  199.       if (the castNum of sprite 30 = 37) and (getAt(GRIDX, MAN) <> getAt(GRIDX, 14)) then
  200.         if (getAt(GRIDVAL, MAN - 13) = 0) or (getAt(GRIDVAL, MAN - 13) > 14) then
  201.           JUMPRIGHT()
  202.           set DR to 2
  203.           set LN to 0
  204.         end if
  205.       end if
  206.       if (the castNum of sprite 30 = 28) and (getAt(GRIDX, MAN) <> getAt(GRIDX, 1)) then
  207.         if (getAt(GRIDVAL, MAN - 15) = 0) or (getAt(GRIDVAL, MAN - 15) > 14) then
  208.           JUMPLEFT()
  209.           set DR to 4
  210.           set LN to 0
  211.         end if
  212.       end if
  213.     end if
  214.   end if
  215.   if (LN = 30) and (MAN > 14) and (HEAD = 0) then
  216.     if getAt(GRIDVAL, MAN - 14) = 0 then
  217.       if (the castNum of sprite 30 = 37) and (getAt(GRIDX, MAN) <> getAt(GRIDX, 14)) then
  218.         if getAt(GRIDVAL, MAN - 13) <> 0 then
  219.           JUMPRIGHTMISS()
  220.           set DR to 2
  221.         end if
  222.       end if
  223.       if (the castNum of sprite 30 = 28) and (getAt(GRIDX, MAN) <> getAt(GRIDX, 1)) then
  224.         if getAt(GRIDVAL, MAN - 15) <> 0 then
  225.           JUMPLEFTMISS()
  226.           set DR to 4
  227.         end if
  228.       end if
  229.     end if
  230.   end if
  231.   if (LN = 30) and (MAN > 28) and (HEAD = 1) then
  232.     if getAt(GRIDVAL, MAN - 28) = 0 then
  233.       if (the castNum of sprite 30 = 37) and (getAt(GRIDX, MAN) <> getAt(GRIDX, 14)) then
  234.         if (getAt(GRIDVAL, MAN - 27) = 0) and (getAt(GRIDVAL, MAN - 13) = 0) then
  235.           JUMPRIGHTBLOCK()
  236.           set DR to 2
  237.         end if
  238.       end if
  239.       if (the castNum of sprite 30 = 28) and (getAt(GRIDX, MAN) <> getAt(GRIDX, 1)) then
  240.         if (getAt(GRIDVAL, MAN - 29) = 0) and (getAt(GRIDVAL, MAN - 15) = 0) then
  241.           JUMPLEFTBLOCK()
  242.           set DR to 4
  243.         end if
  244.       end if
  245.     end if
  246.   end if
  247.   if MAN < 155 then
  248.     if (getAt(GRIDVAL, MAN + 14) = 0) or (getAt(GRIDVAL, MAN + 14) = 15) then
  249.       if HEAD = 0 then
  250.         MANFALL()
  251.       end if
  252.       if HEAD = 1 then
  253.         MANFALLBLOCK()
  254.       end if
  255.       if (DR = 2) or (DR = 20) then
  256.         set the castNum of sprite 30 to 37
  257.       end if
  258.       if (DR = 4) or (DR = 40) then
  259.         set the castNum of sprite 30 to 28
  260.       end if
  261.       updateStage()
  262.     end if
  263.   end if
  264.   set DR to 0
  265.   ANIMATEORACLE()
  266.   if BFALL <> 0 then
  267.     BLOCKFALLALONE()
  268.   end if
  269. end
  270.