home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / BlindAlleys.dxr / Internal_8.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  5.6 KB  |  209 lines

  1. global points, pootimer, win, tableau, crappo, stock, redeals
  2.  
  3. on checkwin arg
  4.   if points = (52 * 10) then
  5.     win = "yes"
  6.     pootimer = timeout("poo").new(150, #gotoit)
  7.   else
  8.     if (stock.cards.count = 0) and (redeals = 1) then
  9.       checklose()
  10.     end if
  11.   end if
  12. end
  13.  
  14. on gotoit
  15.   pootimer.forget()
  16.   go("gameover")
  17. end
  18.  
  19. on checklose
  20.   repeat with shit = 119 to 134
  21.     if sprite(shit).member.name = "empty" then
  22.       next repeat
  23.     end if
  24.     repeat with cakes = 111 to 114
  25.       if sprite(cakes).member.name = "empty" then
  26.         if getValue(sprite(shit).member.name) = 1 then
  27.           abort()
  28.         end if
  29.         next repeat
  30.       end if
  31.       if (getValue(sprite(shit).member.name) = (getValue(sprite(cakes).member.name) + 1)) and (getSuit(sprite(shit).member.name) = getSuit(sprite(cakes).member.name)) then
  32.         abort()
  33.       end if
  34.     end repeat
  35.     repeat with cakes = 1 to tableau.count
  36.       if tableau[cakes].getcardcount() = 0 then
  37.         next repeat
  38.       end if
  39.       if (getValue(sprite(shit).member.name) = (getValue(sprite(tableau[cakes].getlastcard().spnum).member.name) - 1)) and (getSuitCo(sprite(shit).member.name) <> getSuitCo(sprite(tableau[cakes].getlastcard().spnum).member.name)) then
  40.         abort()
  41.       end if
  42.     end repeat
  43.   end repeat
  44.   repeat with shit = 1 to tableau.count
  45.     if tableau[shit].getcardcount() = 0 then
  46.       abort()
  47.     end if
  48.     repeat with cakes = 111 to 114
  49.       if sprite(cakes).member.name = "empty" then
  50.         if getValue(sprite(tableau[shit].getlastcard().spnum).member.name) = 1 then
  51.           abort()
  52.         end if
  53.         next repeat
  54.       end if
  55.       if (getValue(sprite(tableau[shit].getlastcard().spnum).member.name) = (getValue(sprite(cakes).member.name) + 1)) and (getSuit(sprite(tableau[shit].getlastcard().spnum).member.name) = getSuit(sprite(cakes).member.name)) then
  56.         abort()
  57.       end if
  58.     end repeat
  59.     repeat with cakes = 1 to tableau.count
  60.       if tableau[cakes].getcardcount() = 0 then
  61.         next repeat
  62.       end if
  63.       if shit = cakes then
  64.         next repeat
  65.       end if
  66.       if (getValue(sprite(tableau[shit].getlastcard().spnum).member.name) = (getValue(sprite(tableau[cakes].getlastcard().spnum).member.name) - 1)) and (getSuitCo(sprite(tableau[shit].getlastcard().spnum).member.name) <> getSuitCo(sprite(tableau[cakes].getlastcard().spnum).member.name)) and not getduplicate() then
  67.         abort()
  68.       end if
  69.     end repeat
  70.     if sprite(tableau[shit].getlastcard().spnum).backCardEQ() then
  71.       abort()
  72.     end if
  73.   end repeat
  74.   win = "no"
  75.   pootimer = timeout("you fucked").new(130, #gotoit)
  76. end
  77.  
  78. on getValue arg
  79.   if (arg contains "hearts") or (arg contains "spades") then
  80.     return getOff(chars(arg, 1, arg.length - 7))
  81.   else
  82.     if arg contains "diamonds" then
  83.       return getOff(chars(arg, 1, arg.length - 9))
  84.     else
  85.       if arg contains "clubs" then
  86.         return getOff(chars(arg, 1, arg.length - 6))
  87.       end if
  88.     end if
  89.   end if
  90. end
  91.  
  92. on getOff numba
  93.   if numba = "ace" then
  94.     return 1
  95.   else
  96.     if numba = "two" then
  97.       return 2
  98.     else
  99.       if numba = "three" then
  100.         return 3
  101.       else
  102.         if numba = "four" then
  103.           return 4
  104.         else
  105.           if numba = "five" then
  106.             return 5
  107.           else
  108.             if numba = "six" then
  109.               return 6
  110.             else
  111.               if numba = "seven" then
  112.                 return 7
  113.               else
  114.                 if numba = "eight" then
  115.                   return 8
  116.                 else
  117.                   if numba = "nine" then
  118.                     return 9
  119.                   else
  120.                     if numba = "ten" then
  121.                       return 10
  122.                     else
  123.                       if numba = "jack" then
  124.                         return 11
  125.                       else
  126.                         if numba = "queen" then
  127.                           return 12
  128.                         else
  129.                           if numba = "king" then
  130.                             return 13
  131.                           end if
  132.                         end if
  133.                       end if
  134.                     end if
  135.                   end if
  136.                 end if
  137.               end if
  138.             end if
  139.           end if
  140.         end if
  141.       end if
  142.     end if
  143.   end if
  144. end
  145.  
  146. on getSuit arg
  147.   if arg contains "hearts" then
  148.     return #hearts
  149.   else
  150.     if arg contains "diamonds" then
  151.       return #diamonds
  152.     else
  153.       if arg contains "clubs" then
  154.         return #clubs
  155.       else
  156.         if arg contains "spades" then
  157.           return #spades
  158.         end if
  159.       end if
  160.     end if
  161.   end if
  162. end
  163.  
  164. on getSuitCo arg
  165.   if arg contains "hearts" then
  166.     return #red
  167.   else
  168.     if arg contains "diamonds" then
  169.       return #red
  170.     else
  171.       if arg contains "clubs" then
  172.         return #black
  173.       else
  174.         if arg contains "spades" then
  175.           return #black
  176.         end if
  177.       end if
  178.     end if
  179.   end if
  180. end
  181.  
  182. on getduplicate
  183.   ass = 0
  184.   repeat with hell = 1 to tableau.count
  185.     if tableau[hell].getcardcount() = 0 then
  186.       next repeat
  187.     end if
  188.     repeat with bell = 1 to tableau.count
  189.       if tableau[bell].getcardcount() = 0 then
  190.         next repeat
  191.       end if
  192.       if tableau[bell].getcardcount() >= 2 then
  193.         if (tableau[hell].getlastcard().rank = tableau[bell].cards[tableau[bell].getcardcount() - 1].rank) and (tableau[hell].getlastcard().suitcolor <> tableau[bell].cards[tableau[bell].getcardcount() - 1].suitcolor) then
  194.           ass = 1
  195.           exit repeat
  196.         end if
  197.       end if
  198.     end repeat
  199.     if ass = 1 then
  200.       exit repeat
  201.     end if
  202.   end repeat
  203.   if ass = 1 then
  204.     return 1
  205.   else
  206.     return 0
  207.   end if
  208. end
  209.