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

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