home *** CD-ROM | disk | FTP | other *** search
/ The World of Don & Mike / DMCDROM.iso / gamedata / main.dir / 00001_MovieScript.ls next >
Encoding:
Text File  |  1995-12-13  |  7.7 KB  |  277 lines

  1. on startMovie
  2.   global ondeckObject, onDeckInk, masterList, doWhat, roomList, ToolList
  3.   duplicate(cast ondeckObject, cast 176)
  4.   set the keyDownScript to "keyWatch"
  5.   set ToolList to []
  6.   set roomList to [#boomBox, #ovenMitt]
  7.   initRoom()
  8.   set doWhat to "initRoom"
  9.   if getaProp(masterList, #boomBox) = 2 then
  10.     duplicate(cast "boomBox", cast 299)
  11.   end if
  12. end
  13.  
  14. on exitRoom
  15.   global roomList, masterList, ondeckObject, onDeckInk
  16.   set ondeckObject to the name of cast 176
  17.   set listCounter to count(roomList)
  18.   repeat with x = 1 to listCounter
  19.     set the visible of sprite (19 + x) to 1
  20.   end repeat
  21.   unLoad()
  22. end
  23.  
  24. on initRoom
  25.   global roomList, masterList
  26.   set listCounter to count(roomList)
  27.   repeat with x = 1 to listCounter
  28.     set whichItem to getAt(roomList, x)
  29.     if getaProp(masterList, whichItem) > 0 then
  30.       set the visible of sprite (29 + x) to 0
  31.     end if
  32.   end repeat
  33. end
  34.  
  35. on enterBriefcase
  36.   global masterList, visibleList
  37.   set whichItem to count(masterList)
  38.   repeat with x = 1 to whichItem
  39.     set whichChannel to 1 + x
  40.     set whatPiece to getPropAt(masterList, x)
  41.     if getaProp(masterList, whatPiece) <> 1 then
  42.       if the visible of sprite whichChannel = 1 then
  43.         append(visibleList, whichChannel)
  44.         set the visible of sprite whichChannel to 0
  45.       end if
  46.       next repeat
  47.     end if
  48.     set the visible of sprite whichChannel to 1
  49.   end repeat
  50. end
  51.  
  52. on exitBriefcase
  53.   global visibleList
  54.   repeat with x = 1 to count(visibleList)
  55.     set the visible of sprite getAt(visibleList, x) to 1
  56.   end repeat
  57. end
  58.  
  59. on followMouse
  60.   if the name of cast 176 <> "mask" then
  61.     repeat while the mouseDown
  62.       set the locV of sprite 47 to the mouseV
  63.       set the locH of sprite 47 to the mouseH
  64.       updateStage()
  65.     end repeat
  66.   end if
  67. end
  68.  
  69. on grabIcon whichIcon, whatChannel, whatProp
  70.   global dragProp
  71.   set dragProp to whatProp
  72.   set the visible of sprite whatChannel to 0
  73.   set the visible of sprite 48 to 0
  74.   duplicate(cast whichIcon, cast 300)
  75.   set the locV of sprite 48 to the mouseV
  76.   set the locH of sprite 48 to the mouseH
  77.   updateStage()
  78.   set the visible of sprite 48 to 1
  79.   repeat while the mouseDown
  80.     set the locV of sprite 48 to the mouseV
  81.     set the locH of sprite 48 to the mouseH
  82.     updateStage()
  83.   end repeat
  84. end
  85.  
  86. on checkTool whichReward
  87.   global ToolList, MatchList, frameList, masterList, tapeList, tapeFileList, tapeFlagList, seperator
  88.   set trueMatch to 0
  89.   if sprite 47 intersects 45 and (the name of cast 299 = "boomBox") then
  90.     repeat with x = 1 to count(tapeList)
  91.       if the name of cast 176 = getAt(tapeList, x) then
  92.         set tapeMatch to 1
  93.         exit repeat
  94.       end if
  95.     end repeat
  96.     if tapeMatch = 1 then
  97.       set the locV of sprite 47 to 420
  98.       set the locH of sprite 47 to 258
  99.       duplicate(cast "mask", cast 176)
  100.       updateStage()
  101.       sound playFile 2, the pathName & "sounds" & seperator & getAt(tapeFileList, x)
  102.       repeat while soundBusy(2)
  103.         nothing()
  104.       end repeat
  105.       duplicate(cast getAt(tapeList, x), cast 176)
  106.       updateStage()
  107.       setAt(tapeFlagList, x, 1)
  108.     else
  109.       set the locV of sprite 47 to 420
  110.       set the locH of sprite 47 to 258
  111.       updateStage()
  112.       randomRude()
  113.     end if
  114.   else
  115.     repeat with x = 1 to count(ToolList)
  116.       set whichSprite to getAt(MatchList, x)
  117.       set whichTool to getAt(ToolList, x)
  118.       set whichIcon to the name of cast 176
  119.       if sprite 47 intersects whichSprite and (whichIcon = whichTool) then
  120.         set trueMatch to 1
  121.         setaProp(masterList, getAt(frameList, x), 2)
  122.         set the visible of sprite whichSprite to 1
  123.         set the visible of sprite 47 to 0
  124.         set the locV of sprite 47 to 420
  125.         set the locH of sprite 47 to 258
  126.         duplicate(cast "mask", cast 176)
  127.         set the visible of sprite 47 to 1
  128.         updateStage()
  129.         go(whichReward)
  130.         randomWooHoo()
  131.         exit repeat
  132.       end if
  133.     end repeat
  134.     if trueMatch = 0 then
  135.       set the locV of sprite 47 to 420
  136.       set the locH of sprite 47 to 258
  137.       updateStage()
  138.       randomRude()
  139.     end if
  140.   end if
  141. end
  142.  
  143. on dropIcon
  144.   global masterList, dragProp, tapeList, tapeFileList, tapeFlagList, seperator
  145.   if sprite 48 intersects 45 and (the name of cast 299 = "boomBox") then
  146.     set tapeMatch to 0
  147.     repeat with x = 1 to count(tapeList)
  148.       if the name of cast 300 = getAt(tapeList, x) then
  149.         set tapeMatch to 1
  150.         exit repeat
  151.       end if
  152.     end repeat
  153.     if tapeMatch = 1 then
  154.       set the locV of sprite 48 to 441
  155.       set the locH of sprite 48 to 17
  156.       duplicate(cast "mask2", cast 300)
  157.       updateStage()
  158.       sound playFile 2, the pathName & "sounds" & seperator & getAt(tapeFileList, x)
  159.       repeat while soundBusy(2)
  160.         nothing()
  161.       end repeat
  162.       duplicate(cast getAt(tapeList, x), cast 176)
  163.       updateStage()
  164.       setAt(tapeFlagList, x, 1)
  165.       setaProp(masterList, dragProp, 1)
  166.     else
  167.       set the visible of sprite 48 to 0
  168.       set the visible of sprite the clickOn to 1
  169.       duplicate(cast "mask2", cast 300)
  170.       set the locV of sprite 48 to 441
  171.       set the locH of sprite 48 to 17
  172.       updateStage()
  173.       set the visible of sprite 48 to 1
  174.       randomRude()
  175.     end if
  176.   else
  177.     if sprite 48 intersects 46 then
  178.       set the visible of sprite 48 to 0
  179.       duplicate(cast "mask2", cast 300)
  180.       set the locV of sprite 48 to 441
  181.       set the locH of sprite 48 to 17
  182.       updateStage()
  183.       set the visible of sprite 48 to 1
  184.       setaProp(masterList, dragProp, 1)
  185.       randomWooHoo()
  186.     else
  187.       set the visible of sprite 48 to 0
  188.       set the visible of sprite the clickOn to 1
  189.       duplicate(cast "mask2", cast 300)
  190.       set the locV of sprite 48 to 441
  191.       set the locH of sprite 48 to 17
  192.       updateStage()
  193.       set the visible of sprite 48 to 1
  194.       randomRude()
  195.     end if
  196.   end if
  197. end
  198.  
  199. on randomRude
  200.   global rude1, rude2, rude3, rude4, rude5, rude6, rude7, rude8, rude9, rude10, rude11, rude12, rude13, rude14, rude15, rude16, rude17, rude18, rudeList
  201.   if soundBusy(2) then
  202.     nothing()
  203.   else
  204.     sound playFile 2, getAt(rudeList, random(18))
  205.   end if
  206. end
  207.  
  208. on randomWooHoo
  209.   global woohoo1, woohoo2, woohoo3, woohoo4, woohoo5, woohoo6, woohoo7, woohoo8, woohoo9, wooHooList
  210.   if soundBusy(2) then
  211.     nothing()
  212.   else
  213.     sound playFile 2, getAt(wooHooList, random(9))
  214.   end if
  215. end
  216.  
  217. on keyWatch
  218.   global forward, left, right
  219.   if the keyCode = 126 then
  220.     if forward = EMPTY then
  221.       randomRude()
  222.     else
  223.       go(forward)
  224.     end if
  225.   end if
  226.   if the keyCode = 123 then
  227.     puppetTransition(12, 4, 40)
  228.     go(left)
  229.   end if
  230.   if the keyCode = 124 then
  231.     puppetTransition(11, 4, 40)
  232.     go(right)
  233.   end if
  234. end
  235.  
  236. on foreButton
  237.   set the castNum of sprite the clickOn to the number of cast "fore lit"
  238.   updateStage()
  239.   repeat while the mouseDown
  240.     nothing()
  241.   end repeat
  242.   set the castNum of sprite the clickOn to the number of cast "fore arrow"
  243.   updateStage()
  244. end
  245.  
  246. on rightButton
  247.   set the castNum of sprite the clickOn to the number of cast "right lit"
  248.   updateStage()
  249.   repeat while the mouseDown
  250.     nothing()
  251.   end repeat
  252.   set the castNum of sprite the clickOn to the number of cast "right arrow"
  253.   updateStage()
  254. end
  255.  
  256. on leftButton
  257.   set the castNum of sprite the clickOn to the number of cast "left lit"
  258.   updateStage()
  259.   repeat while the mouseDown
  260.     nothing()
  261.   end repeat
  262.   set the castNum of sprite the clickOn to the number of cast "left arrow"
  263.   updateStage()
  264. end
  265.  
  266. on randomPaul
  267.   global paul1, paul2, paul3, paul4, paul5, paul6, paul7, paul8, paul9, paul10, paul11, paul12, paul13, paul14, paul15, paul16, paul17, paul18, paul19, paul20, paulList, oldSound
  268.   if random(6) = 2 then
  269.     if soundBusy(2) then
  270.       nothing()
  271.     else
  272.       set oldSound to the soundLevel
  273.       sound playFile 2, getAt(paulList, random(20))
  274.     end if
  275.   end if
  276. end
  277.