home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today (BR) Volume 2 #6 / CDRTV2N6.iso / ggmd / shared.dxr / 00761.ls < prev    next >
Encoding:
Text File  |  1996-02-02  |  15.0 KB  |  608 lines

  1. on startMovie
  2.   set the keyDownScript to "checkexit"
  3.   set the exitLock to 1
  4.   cursor(4)
  5. end
  6.  
  7. on checkexit
  8.   if the optionDown and (the key = "q") then
  9.     quit()
  10.   end if
  11.   if the commandDown and ((the key = "q") or (the key = ".")) then
  12.     go(1, "credits")
  13.   end if
  14.   if the optionDown and (the keyCode = 118) then
  15.     go(1, "credits")
  16.   end if
  17.   if the keyCode = 53 then
  18.     go(1, "credits")
  19.   end if
  20. end
  21.  
  22. on startsequence
  23.   global hidepos, thetempo, hideplaces, hidelist, numtraps, dest, destframe, WhereAmI, mysndpath, mypuppet, myloops, mloc, trappos, thecdpath, gsounddrive, trapsdone
  24.   cursor(4)
  25.   if the machineType = 256 then
  26.     set mysndpath to the pathName & "sounds\" & line 1 of field "movieinfo"
  27.   else
  28.     set mysndpath to the pathName & "sounds:" & line 1 of field "movieinfo"
  29.   end if
  30.   set myloops to value(line 2 of field "movieinfo")
  31.   set mypuppet to value(line 3 of field "movieinfo")
  32.   set mloc to line 4 of field "movieinfo"
  33.   set trappos to line 5 of field "movieinfo"
  34.   set WhereAmI to "bedroom"
  35.   set the timeoutLength to 4800
  36.   set the timeoutScript to "nothingatstart"
  37.   set the timeoutMouse to 0
  38.   puppetTempo(12)
  39.   set hideplaces to the number of lines in field "hidelist"
  40.   set hidepos to random(hideplaces)
  41.   put hidepos
  42.   set hidelist to field "hidelist"
  43.   repeat with x = 1 to the number of lines in hidelist
  44.     set y to offset(":", line x of hidelist)
  45.     delete char 1 to y of line x of hidelist
  46.   end repeat
  47.   selectdest()
  48.   if numtraps = 0 then
  49.     puppetSprite(46, 1)
  50.     set the type of sprite 46 to 0
  51.   end if
  52.   if numtraps = 5 then
  53.     set trapsdone to EMPTY
  54.   end if
  55.   repeat with x = 41 to 45
  56.     puppetSprite(x, 1)
  57.   end repeat
  58.   repeat while the soundBusy of 1
  59.   end repeat
  60. end
  61.  
  62. on readytogo
  63.   global mypuppet, thismem
  64.   randomit()
  65.   puppetSprite(mypuppet, 1)
  66.   cursor(-1)
  67. end
  68.  
  69. on endOfRun
  70.   global mypuppet
  71.   set the mouseUpScript to EMPTY
  72.   cursor(-1)
  73.   newdest()
  74.   puppetSprite(mypuppet, 0)
  75.   randomit()
  76.   updateStage()
  77.   puppetSprite(mypuppet, 1)
  78.   puppetTempo(12)
  79. end
  80.  
  81. on caught
  82.   global mypuppet, mh, mv, mymouse, mycount, trapset
  83.   cursor(200)
  84.   set the mouseUpScript to EMPTY
  85.   puppetSound("squeak")
  86.   if trapset then
  87.     puppetSprite(46, 0)
  88.   end if
  89.   set mymouse to 0
  90.   set mycount to 0
  91.   puppetSprite(mypuppet, 0)
  92.   go("caught")
  93.   puppetSprite(39, 1)
  94.   set the locH of sprite 39 to the mouseH
  95.   set the locV of sprite 39 to the mouseV
  96. end
  97.  
  98. on movetonet
  99.   global mh, mv
  100.   set mh to the mouseH
  101.   set mv to the mouseV
  102.   checkmove()
  103. end
  104.  
  105. on positionit
  106.   global mloc
  107.   set the locH of sprite 39 to value(item 1 of mloc)
  108.   set the locV of sprite 39 to value(item 2 of mloc)
  109.   updateStage()
  110.   set the timeoutLapsed to 0
  111.   unLoad()
  112. end
  113.  
  114. on hanging
  115.   global mymouse, mycount
  116.   set mycount to mycount + 1
  117.   if mycount < 6 then
  118.     if mymouse < 6 then
  119.       set mymouse to mymouse + 1
  120.     end if
  121.     if mymouse = 6 then
  122.       set mymouse to 1
  123.     end if
  124.     set the locH of sprite 39 to the mouseH
  125.     set the locV of sprite 39 to the mouseV
  126.     set the castNum of sprite 39 to the number of cast ("m" & mymouse)
  127.     updateStage()
  128.     go(the frame)
  129.   else
  130.     movetonet()
  131.     set mycount to 0
  132.   end if
  133. end
  134.  
  135. on checkmove
  136.   global mh, mv, mloc, moveh, movev
  137.   set th to value(item 1 of mloc)
  138.   set tv to value(item 2 of mloc)
  139.   set moveh to (th - mh) / 5
  140.   set movev to (tv - mv) / 5
  141. end
  142.  
  143. on movemouse
  144.   global moveh, movev, mycount, mymouse
  145.   if not (the soundBusy of 1) then
  146.     puppetSound("squeak")
  147.   end if
  148.   set mycount to mycount + 1
  149.   if mycount < 6 then
  150.     if mymouse < 6 then
  151.       set mymouse to mymouse + 1
  152.     end if
  153.     if mymouse = 6 then
  154.       set mymouse to 1
  155.     end if
  156.     set the castNum of sprite 39 to the number of cast ("m" & mymouse)
  157.     set the locH of sprite 39 to the locH of sprite 39 + moveh
  158.     set the locV of sprite 39 to the locV of sprite 39 + movev
  159.   end if
  160. end
  161.  
  162. on endofRoom
  163.   global miceCaught, mytempo, WhereAmI, trapset, music, spritelist, theselsprite, thecdpath, thehdpath
  164.   randomendsound()
  165.   set trapset to 0
  166.   set the timeoutScript to EMPTY
  167.   set miceCaught to miceCaught + 1
  168.   if miceCaught = 5 then
  169.     set mytempo to mytempo + 2
  170.   end if
  171.   if miceCaught = 10 then
  172.     set mytempo to mytempo + 2
  173.   end if
  174.   if miceCaught = 15 then
  175.     set mytempo to mytempo + 2
  176.   end if
  177.   puppetSprite(39, 0)
  178.   updateStage()
  179.   set posnum to getPos(spritelist, theselsprite)
  180.   deleteAt(spritelist, posnum)
  181.   repeat with x = 41 to 45
  182.     set the visible of sprite x to 1
  183.   end repeat
  184.   if music then
  185.     set WhereAmI to "instrum"
  186.     go(1, the pathName & "instrum")
  187.   else
  188.     set WhereAmI to "menu"
  189.     play frame "Options" of movie the pathName & "demomenu"
  190.   end if
  191. end
  192.  
  193. on randomendsound
  194.   global thecdpath, lastone
  195.   if not integerp(lastone) then
  196.     set lastone to 1
  197.   end if
  198.   set ram to lastone
  199.   repeat while lastone = ram
  200.     set ram to random(7)
  201.   end repeat
  202.   if the machineType = 256 then
  203.     sound playFile 1, the pathName & "endsound\random" & ram & ".aif"
  204.   else
  205.     sound playFile 1, the pathName & "endsound:random" & ram & ".aif"
  206.   end if
  207.   set lastone to ram
  208. end
  209.  
  210. on selectdest
  211.   global hidelist, hidepos, dest, destframe
  212.   set z to the number of items in line value(hidepos) of hidelist
  213.   set dest to value(item random(z) of line value(hidepos) of hidelist)
  214.   set destframe to "MA" & hidepos & ":" & dest
  215. end
  216.  
  217. on newdest
  218.   global hidepos, dest
  219.   set hidepos to dest
  220.   selectdest()
  221. end
  222.  
  223. on nothingatstart
  224.   global mysndpath, destframe, hidepos
  225.   go(destframe)
  226.   sound playFile 1, mysndpath & hidepos
  227. end
  228.  
  229. on nothingafterawhile
  230.   global mysndpath, destframe, hidepos
  231.   go(destframe)
  232.   sound playFile 1, mysndpath & hidepos
  233. end
  234.  
  235. on endanim
  236.   global mypuppet
  237.   puppetSprite(mypuppet, 0)
  238.   go("loop1")
  239.   updateStage()
  240.   puppetSprite(mypuppet, 1)
  241. end
  242.  
  243. on clicked
  244.   global hidepos, destframe, mytempo, mysndpath
  245.   puppetSound(0)
  246.   if (the clickOn - 29) = hidepos then
  247.     puppetTempo(mytempo)
  248.     set the timeoutLapsed to 0
  249.     go(destframe)
  250.     sound playFile 1, mysndpath & the clickOn - 29
  251.     set the mouseUpScript to "miss"
  252.     cursor([823, 824])
  253.   else
  254.     puppetTempo(12)
  255.     go("A" & the clickOn - 29)
  256.     sound playFile 1, mysndpath & the clickOn - 29
  257.   end if
  258. end
  259.  
  260. on miss
  261.   puppetSound("miss.aif")
  262. end
  263.  
  264. on randomit
  265.   global theloop, mypuppet, myloops, lastloop, prevloop
  266.   if lastloop <> prevloop then
  267.     set theloop to random(myloops)
  268.   else
  269.     if lastloop = 1 then
  270.       set theloop to 2
  271.     else
  272.       if lastloop <> 1 then
  273.         set theloop to 1
  274.       end if
  275.     end if
  276.   end if
  277.   set prevloop to lastloop
  278.   set lastloop to theloop
  279.   puppetSprite(mypuppet, 0)
  280.   go("loop" & theloop)
  281.   puppetSprite(mypuppet, 1)
  282.   set the castNum of sprite mypuppet to the number of cast ("loop" & theloop)
  283. end
  284.  
  285. on selecttrap
  286.   global numtraps, trapnum, trapsdone, trappos, mh, mv, moveh, movev, trapset
  287.   set numtraps to numtraps - 1
  288.   set trapnum to the clickOn - 40
  289.   set mytrap to the clickOn
  290.   puppetSprite(mytrap, 1)
  291.   repeat with x = 41 to 45
  292.     if x <> mytrap then
  293.       set the puppet of sprite x to 1
  294.       set the type of sprite x to 0
  295.     end if
  296.   end repeat
  297.   cursor(200)
  298.   set mh to the locH of sprite mytrap
  299.   set mv to the locV of sprite mytrap
  300.   set th to value(item 1 of trappos)
  301.   set tv to value(item 2 of trappos) + 33
  302.   set moveh to (th - mh) / 5
  303.   set movev to (tv - mv) / 5
  304.   repeat with x = 1 to 5
  305.     set the locH of sprite mytrap to the locH of sprite mytrap + moveh
  306.     set the locV of sprite mytrap to the locV of sprite mytrap + movev
  307.     updateStage()
  308.     wait(5)
  309.   end repeat
  310.   wait(30)
  311.   puppetSprite(mytrap, 0)
  312.   put trapnum & "," after trapsdone
  313.   set trapset to 1
  314.   cursor(-1)
  315.   puppetSprite(46, 1)
  316.   set the castNum of sprite 46 to the number of cast "trapmark"
  317.   set the locH of sprite 46 to th
  318.   set the locV of sprite 46 to tv - 33
  319.   repeat with x = 41 to 45
  320.     set the puppet of sprite x to 1
  321.     set the type of sprite x to 0
  322.   end repeat
  323.   set the mouseUpScript to EMPTY
  324.   updateStage()
  325. end
  326.  
  327. on runtraps
  328.   global trapsdone
  329.   puppetSprite(46, 1)
  330.   set the castNum of sprite 46 to the number of cast "traphilite"
  331.   repeat with x = 41 to 45
  332.     if not (trapsdone contains string(x - 40)) then
  333.       puppetSprite(x, 0)
  334.     end if
  335.   end repeat
  336.   go("loop1")
  337.   set the mouseUpScript to "canceltrap"
  338. end
  339.  
  340. on canceltrap
  341.   if (the clickOn < 41) or (the clickOn > 45) then
  342.     repeat with x = 41 to 45
  343.       set the puppet of sprite x to 1
  344.       set the type of sprite x to 0
  345.     end repeat
  346.     puppetSprite(46, 0)
  347.     go("loop1")
  348.     updateStage()
  349.     set the mouseUpScript to EMPTY
  350.   end if
  351. end
  352.  
  353. on checktrap msprite
  354.   global trapset, trapnum, wherefrom, trappos, thetrapsprite
  355.   set thetrapsprite to msprite
  356.   if the machineType = 256 then
  357.     wait(10)
  358.   end if
  359.   if trapset = 1 then
  360.     set the type of sprite 46 to 0
  361.     puppetSprite(msprite, 1)
  362.     set the stretch of sprite msprite to 0
  363.     set the locH of sprite msprite to value(item 1 of trappos)
  364.     set the locV of sprite msprite to value(item 2 of trappos)
  365.     if trapnum = 1 then
  366.       repeat with x = 1 to 10
  367.         set the castNum of sprite msprite to the number of cast ("1." & x)
  368.         if the mouseDown then
  369.           trapsoff()
  370.           exit
  371.         end if
  372.         updateStage()
  373.         if the machineType = 256 then
  374.           wait(10)
  375.         end if
  376.       end repeat
  377.       repeat with x = 8 to 10
  378.         set the castNum of sprite msprite to the number of cast ("1." & x)
  379.         if the mouseDown then
  380.           trapsoff()
  381.           exit
  382.         end if
  383.         updateStage()
  384.         if the machineType = 256 then
  385.           wait(10)
  386.         end if
  387.       end repeat
  388.       repeat with x = 8 to 10
  389.         set the castNum of sprite msprite to the number of cast ("1." & x)
  390.         if the mouseDown then
  391.           trapsoff()
  392.           exit
  393.         end if
  394.         updateStage()
  395.         if the machineType = 256 then
  396.           wait(10)
  397.         end if
  398.       end repeat
  399.     end if
  400.     if trapnum = 2 then
  401.       repeat with x = 1 to 11
  402.         set the castNum of sprite msprite to the number of cast ("2." & x)
  403.         if the mouseDown then
  404.           trapsoff()
  405.           exit
  406.         end if
  407.         updateStage()
  408.         if the machineType = 256 then
  409.           wait(10)
  410.         end if
  411.       end repeat
  412.     end if
  413.     if trapnum = 3 then
  414.       repeat with x = 1 to 5
  415.         set the castNum of sprite msprite to the number of cast ("3." & x)
  416.         if the mouseDown then
  417.           trapsoff()
  418.           exit
  419.         end if
  420.         updateStage()
  421.         if the machineType = 256 then
  422.           wait(10)
  423.         end if
  424.       end repeat
  425.       repeat with z = 1 to 4
  426.         repeat with x = 3 to 5
  427.           if the mouseDown then
  428.             trapsoff()
  429.             exit
  430.           end if
  431.           set the castNum of sprite msprite to the number of cast ("3." & x)
  432.           updateStage()
  433.           if the machineType = 256 then
  434.             wait(10)
  435.           end if
  436.         end repeat
  437.       end repeat
  438.     end if
  439.     if trapnum = 4 then
  440.       repeat with x = 1 to 4
  441.         set the castNum of sprite msprite to the number of cast ("4." & x)
  442.         if the mouseDown then
  443.           trapsoff()
  444.           exit
  445.         end if
  446.         updateStage()
  447.         if the machineType = 256 then
  448.           wait(10)
  449.         end if
  450.       end repeat
  451.       repeat with x = 2 to 4
  452.         set the castNum of sprite msprite to the number of cast ("4." & x)
  453.         if the mouseDown then
  454.           trapsoff()
  455.           exit
  456.         end if
  457.         updateStage()
  458.         if the machineType = 256 then
  459.           wait(10)
  460.         end if
  461.       end repeat
  462.       repeat with x = 2 to 4
  463.         set the castNum of sprite msprite to the number of cast ("4." & x)
  464.         if the mouseDown then
  465.           trapsoff()
  466.           exit
  467.         end if
  468.         updateStage()
  469.         if the machineType = 256 then
  470.           wait(10)
  471.         end if
  472.       end repeat
  473.       repeat with x = 2 to 6
  474.         set the castNum of sprite msprite to the number of cast ("4." & x)
  475.         if the mouseDown then
  476.           trapsoff()
  477.           exit
  478.         end if
  479.         updateStage()
  480.         if the machineType = 256 then
  481.           wait(10)
  482.         end if
  483.       end repeat
  484.     end if
  485.     if trapnum = 5 then
  486.       repeat with x = 1 to 9
  487.         set the castNum of sprite msprite to the number of cast ("5." & x)
  488.         if the mouseDown then
  489.           trapsoff()
  490.           exit
  491.         end if
  492.         updateStage()
  493.         if the machineType = 256 then
  494.           wait(10)
  495.         end if
  496.       end repeat
  497.     end if
  498.     puppetSprite(msprite, 0)
  499.     go(the frame + 1)
  500.     set trapset to 0
  501.   end if
  502. end
  503.  
  504. on trapsoff
  505.   global thetrapsprite, trapset
  506.   puppetSprite(thetrapsprite, 0)
  507.   go(the frame + 1)
  508.   set trapset to 0
  509.   pass()
  510. end
  511.  
  512. on canceltraps
  513.   global trapsdone
  514.   repeat with x = 1 to the number of items in trapsdone
  515.     set mytrap to 34 + value(item x of trapsdone)
  516.     puppetSprite(mytrap, 0)
  517.   end repeat
  518.   go("loop")
  519. end
  520.  
  521. on wait n
  522.   set waittime to the timer + n
  523.   repeat while the timer < waittime
  524.   end repeat
  525. end
  526.  
  527. on help
  528.   global WhereAmI, mypuppet, myhelpframe
  529.   set the timeoutLapsed to 0
  530.   if WhereAmI = "instrum" then
  531.     set myhelpframe to the frame
  532.     go("help")
  533.   end if
  534.   if WhereAmI = "bedroom" then
  535.     puppetSound(0)
  536.     puppetSprite(mypuppet, 0)
  537.     updateStage()
  538.     set the visible of sprite mypuppet to 0
  539.     go("11")
  540.     updateStage()
  541.     puppetSprite(48, 1)
  542.     set the stretch of sprite 48 to 0
  543.     set the locH of sprite 48 to 480
  544.     set the locV of sprite 48 to 345
  545.     set the castNum of sprite 48 to the number of cast "cathelp7"
  546.     updateStage()
  547.     set the movieRate of sprite 48 to 1
  548.     repeat while the movieRate of sprite 48 = 1
  549.       updateStage()
  550.       if the mouseDown then
  551.         exit repeat
  552.       end if
  553.     end repeat
  554.     set the castNum of sprite 48 to the number of cast "helpcover"
  555.     updateStage()
  556.     set the locH of sprite 48 to 800
  557.     updateStage()
  558.     puppetSprite(48, 0)
  559.     set the visible of sprite mypuppet to 1
  560.     go(the frame + 1)
  561.     puppetSprite(mypuppet, 1)
  562.     updateStage()
  563.   end if
  564.   if WhereAmI = "attic" then
  565.     puppetSound(0)
  566.     puppetSprite(48, 1)
  567.     set the stretch of sprite 48 to 0
  568.     set the locH of sprite 48 to 480
  569.     set the locV of sprite 48 to 345
  570.     set the castNum of sprite 48 to the number of cast "cathel10"
  571.     updateStage()
  572.     set the movieRate of sprite 48 to 1
  573.     repeat while the movieRate of sprite 48 = 1
  574.       updateStage()
  575.       if the mouseDown then
  576.         exit repeat
  577.       end if
  578.     end repeat
  579.     set the castNum of sprite 48 to the number of cast "helpcover"
  580.     updateStage()
  581.     set the locH of sprite 48 to 800
  582.     updateStage()
  583.     puppetSprite(48, 0)
  584.     set the visible of sprite mypuppet to 1
  585.     puppetSprite(mypuppet, 1)
  586.     updateStage()
  587.   end if
  588.   set the timeoutLapsed to 0
  589. end
  590.  
  591. on exithelp
  592.   set the castNum of sprite 48 to the number of cast "helpcover"
  593.   set the ink of sprite 48 to 36
  594.   updateStage()
  595.   puppetSprite(48, 0)
  596.   set the mouseDownScript to EMPTY
  597.   set the timeoutLapsed to 0
  598. end
  599.  
  600. on buildorchestra
  601.   global instrument, theBuild, playList, buildList, miceCaught, sprNum
  602.   set playList to []
  603.   set miceCaught to 0
  604.   set b1 to ["BASS", "DRUMS", "TRUMP1", "TRUMP2", "TROM1", "TROM2", "GUITAR", "FLUTE", "CLARIN1", "CLARIN2", "CONGAS", "PIANO", "TENOR1", "TENOR2", "TENOR3", "SAX1", "SAX2", "BARITONE", "VIBES"]
  605.   set theBuild to "BUILD1"
  606.   set buildList to b1
  607. end
  608.