home *** CD-ROM | disk | FTP | other *** search
/ Car Screensaver - Toyota / TOYOTA.iso / mjparty / vivi_ex.exe / vivi_ex.DXR / 00025.ls < prev    next >
Encoding:
Text File  |  1996-05-13  |  5.0 KB  |  226 lines

  1. on exitFrame
  2.   global gnum1
  3.   set gnum1 to 0
  4.   set sp to 14
  5.   repeat with n = 1 to 5
  6.     set alist to []
  7.     set the locV of sprite 13 to the locV of sprite sp
  8.     repeat with m = 1 to 5
  9.       set cn to the castNum of sprite sp - 120
  10.       append(alist, cn)
  11.       set sp to sp + 1
  12.     end repeat
  13.     puppetSound(3, 83)
  14.     judh(alist, n)
  15.   end repeat
  16.   set the castNum of sprite 13 to 324
  17.   set the locV of sprite 13 to 199
  18.   set sp to 14
  19.   repeat with n = 1 to 5
  20.     set alist to []
  21.     set h to the locH of sprite sp
  22.     set the locH of sprite 13 to h
  23.     repeat with m = 1 to 5
  24.       set cn to the castNum of sprite (sp + (5 * (m - 1))) - 120
  25.       append(alist, cn)
  26.     end repeat
  27.     set sp to sp + 1
  28.     puppetSound(3, 83)
  29.     judh(alist, n + 5)
  30.   end repeat
  31.   updateStage()
  32.   repeat with n = 39 to 42
  33.     puppetSprite(n, 0)
  34.   end repeat
  35.   startTimer()
  36.   repeat while the timer < 50
  37.     nothing()
  38.   end repeat
  39. end
  40.  
  41. on judh alist, lin
  42.   global gchnlist, gnum1, ghdlist
  43.   set rec to judgeh(alist)
  44.   updateStage()
  45.   set the castNum of sprite 47 to 322
  46.   set the locV of sprite 47 to 164 + (rec * 20)
  47.   set mark to getAt(ghdlist, rec)
  48.   if lin <> getAt(gchnlist, 1) then
  49.     set flg to 0
  50.   else
  51.     set flg to mark
  52.     set mark to mark * getAt(gchnlist, 2)
  53.     chanceh(mark, rec)
  54.   end if
  55.   updateStage()
  56.   startTimer()
  57.   repeat while the timer < 50
  58.     nothing()
  59.   end repeat
  60.   if rec = 10 then
  61.     set var to -1
  62.   else
  63.     set var to 1
  64.   end if
  65.   set the locV of sprite 47 to 384
  66.   set the castNum of sprite 47 to 322
  67.   if the locV of sprite 44 <> 383 then
  68.     repeat with n = 44 to 46
  69.       set the locV of sprite n to 383
  70.     end repeat
  71.   end if
  72.   repeat with c = 1 to mark
  73.     set gnum1 to gnum1 + var
  74.     if gnum1 < 0 then
  75.       set the castNum of sprite 43 to 291
  76.       set the castNum of sprite 39 to 291
  77.     else
  78.       set the castNum of sprite 43 to 292
  79.       set the castNum of sprite 39 to 292
  80.     end if
  81.     counth(abs(gnum1), 43)
  82.     counth(abs(gnum1), 39)
  83.     updateStage()
  84.     startTimer()
  85.     repeat while the timer < 2
  86.       nothing()
  87.     end repeat
  88.   end repeat
  89.   set the castNum of sprite 47 to 325
  90.   updateStage()
  91.   if flg <> 0 then
  92.     chanceh(flg, rec)
  93.   end if
  94.   set the locV of sprite 47 to 164 + (rec * 20)
  95. end
  96.  
  97. on chanceh mark, rec
  98.   repeat with n = 44 to 46
  99.     set the locV of sprite n to 163 + (20 * rec)
  100.   end repeat
  101.   counth(mark, 43)
  102.   if rec = 10 then
  103.     set the castNum of sprite 44 to 291
  104.   end if
  105. end
  106.  
  107. on counth num, sp
  108.   set b1 to num / 100
  109.   if b1 > 9 then
  110.     set b1 to 9
  111.   end if
  112.   set num to num - (b1 * 100)
  113.   set b2 to num / 10
  114.   set b3 to num - (b2 * 10)
  115.   repeat with n = 1 to 3
  116.     do("put b" & string(n) & " into num")
  117.     if num <> 0 then
  118.       exit repeat
  119.       next repeat
  120.     end if
  121.     set the castNum of sprite (sp + n) to 292
  122.   end repeat
  123.   if n = 4 then
  124.     set n to 3
  125.   end if
  126.   repeat with m = n to 3
  127.     do("set the castNum of sprite (m+sp) to (281 + b" & string(m) & ")")
  128.   end repeat
  129. end
  130.  
  131. on judgeh tlist
  132.   set handlist to [0, 0, 0, 0, 0, 0, 0, 0]
  133.   set mlist to []
  134.   set nlist to []
  135.   repeat with n = 1 to 5
  136.     append(mlist, getAt(tlist, n) / 14)
  137.     append(nlist, getAt(tlist, n) mod 14)
  138.   end repeat
  139.   sort(nlist)
  140.   sort(mlist)
  141.   set num to getAt(mlist, 1)
  142.   repeat with n = 2 to 5
  143.     if num <> getAt(mlist, n) then
  144.       exit repeat
  145.     end if
  146.   end repeat
  147.   if n = 6 then
  148.     setAt(handlist, 4, 1)
  149.   end if
  150.   set num to getAt(nlist, 1)
  151.   set rec to straighth(nlist, num)
  152.   if (rec <> 6) and (num = 1) then
  153.     set rec to straighth(nlist, 9)
  154.     if rec = 6 then
  155.       setAt(handlist, 1, 1)
  156.     end if
  157.   end if
  158.   if rec = 6 then
  159.     setAt(handlist, 5, 1)
  160.   end if
  161.   set slist to [0, 0]
  162.   set clist to [0, 0]
  163.   set pos to 0
  164.   repeat with n = 1 to 4
  165.     set num to getAt(nlist, n)
  166.     set pc to 1
  167.     repeat with m = n + 1 to 5
  168.       if (num = getAt(nlist, m)) and (getOne(slist, num) = 0) then
  169.         set pc to pc + 1
  170.         next repeat
  171.       end if
  172.       exit repeat
  173.     end repeat
  174.     if pc <> 1 then
  175.       set pos to pos + 1
  176.       setAt(clist, pos, pc)
  177.       setAt(slist, pos, num)
  178.     end if
  179.   end repeat
  180.   if (pos = 2) and (getOne(slist, 0) = 0) and ((getAt(clist, 1) + getAt(clist, 2)) = 5) then
  181.     setAt(handlist, 3, 1)
  182.     set pos to 0
  183.   end if
  184.   if pos <> 0 then
  185.     if (getAt(clist, 1) = 2) and (getAt(clist, 2) = 2) then
  186.       setAt(handlist, 7, 1)
  187.     else
  188.       if getOne(clist, 3) <> 0 then
  189.         setAt(handlist, 6, 1)
  190.       else
  191.         if getOne(clist, 4) <> 0 then
  192.           setAt(handlist, 2, 1)
  193.         else
  194.           setAt(handlist, 8, 1)
  195.         end if
  196.       end if
  197.     end if
  198.   end if
  199.   if getAt(handlist, 1) and getAt(handlist, 4) and getAt(handlist, 5) then
  200.     return 1
  201.   else
  202.     if getAt(handlist, 1) and getAt(handlist, 5) then
  203.       return 6
  204.     else
  205.       if getAt(handlist, 4) and getAt(handlist, 5) then
  206.         return 2
  207.       else
  208.         if getOne(handlist, 1) = 0 then
  209.           return 10
  210.         else
  211.           return getPos(handlist, 1) + 1
  212.         end if
  213.       end if
  214.     end if
  215.   end if
  216. end
  217.  
  218. on straighth nlist, num
  219.   repeat with n = 2 to 5
  220.     if (num + n - 1) <> getAt(nlist, n) then
  221.       exit repeat
  222.     end if
  223.   end repeat
  224.   return n
  225. end
  226.