home *** CD-ROM | disk | FTP | other *** search
/ Internet 1996 World Exposition / park.org.s3.amazonaws.com.7z / park.org.s3.amazonaws.com / Japan / Panasonic- / funcity / tokyo / slot.dcr / 00067_Lamp.ls < prev    next >
Encoding:
Text File  |  2017-09-21  |  3.3 KB  |  152 lines

  1. on initlamp
  2.   global glptmp
  3.   repeat with i = 14 to 29
  4.     set the puppet of sprite i to 1
  5.   end repeat
  6.   set glptmp to 0
  7. end
  8.  
  9. on clearlamp
  10.   repeat with i = 14 to 29
  11.     set the puppet of sprite i to 0
  12.   end repeat
  13. end
  14.  
  15. on movelamp n
  16.   global glpl, glpr, glptmp
  17.   if n = 1 then
  18.     if glptmp = 0 then
  19.       if getAt(glpr, 4) = 0 then
  20.         repeat with i = 4 to 7
  21.           setAt(glpr, i, getAt(glpr, i + 1))
  22.         end repeat
  23.         setAt(glpr, 8, 0)
  24.       else
  25.         set glptmp to 4
  26.       end if
  27.     else
  28.       if getAt(glpr, 4) = 1 then
  29.         setAt(glpr, 4, 2)
  30.         setAt(glpr, 5, 2)
  31.       else
  32.         setAt(glpr, 4, 1)
  33.         setAt(glpr, 5, 1)
  34.       end if
  35.       set glptmp to glptmp - 1
  36.       if glptmp = 0 then
  37.         resetlamp(1)
  38.       end if
  39.     end if
  40.   else
  41.     if n = 2 then
  42.       if glptmp = 0 then
  43.         if getAt(glpr, 4) = 0 then
  44.           repeat with i = 1 to 3
  45.             setAt(glpr, i + 1, getAt(glpr, i))
  46.           end repeat
  47.         else
  48.           set glptmp to 5
  49.         end if
  50.       else
  51.         if glptmp = 1 then
  52.           if getAt(glpr, 1) <> 0 then
  53.             repeat with i = 1 to 3
  54.               setAt(glpr, 4 - i, getAt(glpr, 5 - i))
  55.             end repeat
  56.             setAt(glpr, 4, 0)
  57.           else
  58.             set glptmp to 0
  59.             resetlamp(2)
  60.           end if
  61.         else
  62.           set glptmp to glptmp - 1
  63.           set j to 1
  64.           if getAt(glpr, 1) = 1 then
  65.             set j to 2
  66.           end if
  67.           repeat with i = 1 to 4
  68.             setAt(glpr, i, j)
  69.           end repeat
  70.         end if
  71.       end if
  72.     else
  73.       if n = 3 then
  74.         set j to 0
  75.         if getAt(glpr, 1) = 0 then
  76.           set j to 1
  77.         end if
  78.         repeat with i = 1 to 8
  79.           setAt(glpr, i, j)
  80.           setAt(glpl, i, j)
  81.         end repeat
  82.       else
  83.         if n = 4 then
  84.           if glptmp < 17 then
  85.             set j to getAt(glpr, 8)
  86.             set k to getAt(glpl, 1)
  87.             repeat with i = 1 to 7
  88.               setAt(glpr, 9 - i, getAt(glpr, 8 - i))
  89.               setAt(glpl, i, getAt(glpl, i + 1))
  90.             end repeat
  91.             setAt(glpr, 1, k)
  92.             setAt(glpl, 8, j)
  93.             set glptmp to glptmp + 1
  94.           else
  95.             if glptmp < 22 then
  96.               set j to 0
  97.               if getAt(glpl, 1) = 0 then
  98.                 set j to 1
  99.               end if
  100.               repeat with i = 1 to 8
  101.                 setAt(glpr, i, j)
  102.                 setAt(glpl, i, j)
  103.               end repeat
  104.               set glptmp to glptmp + 1
  105.             else
  106.               set glptmp to 0
  107.               resetlamp(4)
  108.             end if
  109.           end if
  110.         end if
  111.       end if
  112.     end if
  113.   end if
  114. end
  115.  
  116. on resetlamp n
  117.   global glpl, glpr, glptmp
  118.   repeat with i = 1 to 8
  119.     setAt(glpr, i, 0)
  120.     setAt(glpl, i, 0)
  121.   end repeat
  122.   set glptmp to 0
  123.   if n = 1 then
  124.     setAt(glpr, 7, 1)
  125.     setAt(glpr, 8, 1)
  126.   else
  127.     if n = 2 then
  128.       setAt(glpr, 1, 1)
  129.     else
  130.       if n = 3 then
  131.       else
  132.         if n = 4 then
  133.           setAt(glpr, 1, 1)
  134.           setAt(glpr, 2, 1)
  135.           setAt(glpr, 8, 2)
  136.           setAt(glpl, 1, 1)
  137.           setAt(glpl, 7, 2)
  138.           setAt(glpl, 8, 2)
  139.         end if
  140.       end if
  141.     end if
  142.   end if
  143. end
  144.  
  145. on updatelamp
  146.   global glpl, glpr
  147.   repeat with i = 1 to 8
  148.     set the castNum of sprite (i + 21) to getAt(glpl, i) + 28
  149.     set the castNum of sprite (i + 13) to getAt(glpr, i) + 28
  150.   end repeat
  151. end
  152.