home *** CD-ROM | disk | FTP | other *** search
/ PC Action 1997 February / PCA0297.ISO / demos / shine / shared.dxr / 01000_rechts.ls next >
Encoding:
Text File  |  1996-08-18  |  9.7 KB  |  423 lines

  1. global t_speed, chunk, c_cursor, cLinks, cRechts, cStraight, cDown, cHand, cityLoc, mymovie, myFrame, mypuppets, myvisibility, mycastnr, stringref, colorsetting, hintlist, ckey, CDloc, mac, sep, shineHpath, cdobj, fixpal, hschwarz, mainpath, ShineID, bigmovie, c_symbols, Hymne1, Hymne2, Finger, callmovie
  2.  
  3. on startMovie
  4.   set cLinks to list(the number of cast "Handl", the number of cast "Handl.map")
  5.   set cRechts to list(the number of cast "Handr", the number of cast "Handr.map")
  6.   set cStraight to list(the number of cast "HandO", the number of cast "HandO.map")
  7.   set cDown to list(the number of cast "HandU", the number of cast "HandU.map")
  8.   set cHand to list(the number of cast "HandZu", the number of cast "HandZu.map")
  9. end
  10.  
  11. on dopause long
  12.   if not mac then
  13.     set long to integer(long / 60.0 * 100.0)
  14.   end if
  15.   startTimer()
  16.   repeat while the timer < long
  17.   end repeat
  18. end
  19.  
  20. on checksymbols key
  21.   if (key = "1") or (key = "2") or (key = "3") or (key = "4") then
  22.     set x to value(key)
  23.     if c_cursor = 0 then
  24.       set objekt to getAt(c_symbols, x)
  25.       if objekt <> 0 then
  26.         set c_cursor to objekt
  27.       end if
  28.     else
  29.       if getAt(c_symbols, x) = c_cursor then
  30.         set c_cursor to 0
  31.       else
  32.         if getAt(c_symbols, x) = 0 then
  33.           setAt(c_symbols, getPos(c_symbols, c_cursor), 0)
  34.           setAt(c_symbols, x, c_cursor)
  35.           set c_cursor to 0
  36.         end if
  37.       end if
  38.     end if
  39.   else
  40.     pass()
  41.   end if
  42. end
  43.  
  44. on idle
  45.   cursorsprites()
  46. end
  47.  
  48. on cursorsprites
  49.   repeat with i = 1 to 48
  50.     if the scriptNum of sprite i > 0 then
  51.       set t to the name of cast the scriptNum of sprite i
  52.       if c_cursor = 0 then
  53.         if t = "links" then
  54.           set the cursor of sprite i to cLinks
  55.         else
  56.           if t = "rechts" then
  57.             set the cursor of sprite i to cRechts
  58.           else
  59.             if t = "down" then
  60.               set the cursor of sprite i to cDown
  61.             else
  62.               if t = "hand" then
  63.                 set the cursor of sprite i to cHand
  64.               else
  65.                 set the cursor of sprite i to cStraight
  66.               end if
  67.             end if
  68.           end if
  69.         end if
  70.       else
  71.         set the cursor of sprite i to c_cursor
  72.       end if
  73.       next repeat
  74.     end if
  75.     set the cursor of sprite i to 0
  76.   end repeat
  77. end
  78.  
  79. on rechts exactFrame, stoptimer
  80.   puppetTransition(11, integer(t_speed) / 2, chunk, 0)
  81.   if integerp(exactFrame) then
  82.     go(exactFrame)
  83.   else
  84.     set t to the frame
  85.     set m to marker(1)
  86.     set n to marker(0)
  87.     if t < (m - 1) then
  88.       go(t + 1)
  89.     else
  90.       go(n)
  91.     end if
  92.   end if
  93. end
  94.  
  95. on links exactFrame, stoptimer
  96.   puppetTransition(12, integer(t_speed) / 2, chunk, 0)
  97.   if integerp(exactFrame) then
  98.     go(exactFrame)
  99.   else
  100.     set t to the frame
  101.     set m to marker(0)
  102.     if t > m then
  103.       go(t - 1)
  104.     else
  105.       go(marker(1) - 1)
  106.     end if
  107.   end if
  108. end
  109.  
  110. on nextmovie
  111.   if the machineType = 256 then
  112.     puppetTransition(23)
  113.   else
  114.     puppetTransition(26, 2, 22, 0)
  115.     go("BlackEnd")
  116.   end if
  117. end
  118.  
  119. on goloc loc, city
  120.   if mac then
  121.     puppetTransition(23)
  122.   else
  123.     puppetTransition(26, t_speed, integer(chunk / 2), 0)
  124.   end if
  125.   go(loc)
  126. end
  127.  
  128. on doorLeft sndNb, frameNb
  129.   puppetSound(3, sndNb)
  130.   puppetTransition(2, t_speed * 6, integer(chunk / 20), 1)
  131.   go(frameNb)
  132. end
  133.  
  134. on doorRight sndNb, frameNb
  135.   puppetSound(3, sndNb)
  136.   puppetTransition(17, t_speed * 2, integer(chunk / 15), 1)
  137.   go(frameNb)
  138. end
  139.  
  140. on doorCent sndNb, frameNb
  141.   puppetSound(3, sndNb)
  142.   puppetTransition(5, t_speed * 3, integer(chunk / 20), 1)
  143.   go(frameNb)
  144. end
  145.  
  146. on back2city
  147.   puppetTransition(26, t_speed, chunk, 1)
  148.   sound fadeOut 1, 90
  149.   sound fadeOut 2, 90
  150.   go(cityLoc, "Stadt")
  151.   sound fadeIn 1, 90
  152.   sound fadeIn 2, 90
  153. end
  154.  
  155. on checkSnd myFrame
  156. end
  157.  
  158. on unCoverDesktop
  159.   if objectp(fixpal) then
  160.     fixpal(mdispose)
  161.   end if
  162.   if objectp(hschwarz) then
  163.     hschwarz(mrevertmonitors)
  164.     hschwarz(mdispose)
  165.     closeXLib("monitors.xobj")
  166.   end if
  167. end
  168.  
  169. on killQT spriteNb
  170.   set the movieRate of sprite spriteNb to 0
  171.   go(the frame + 2)
  172. end
  173.  
  174. on patchpal
  175.   if the machineType <> 256 then
  176.     fixpal(mPatchIt)
  177.   end if
  178. end
  179.  
  180. on imovie channel
  181. end
  182.  
  183. on showbig channel, status, oben
  184.   if status = 1 then
  185.     if bigmovie = 1 then
  186.       set y to the height of sprite channel
  187.       set x to integer(the width of sprite channel * (352.0 / y))
  188.       puppetSprite(channel, 1)
  189.       set l to integer((640 - x) / 2)
  190.       spriteBox(channel, l, 4, l + x, 356)
  191.       set the visible of sprite channel to 1
  192.     else
  193.       if bigmovie = 2 then
  194.         if voidp(oben) then
  195.           set oben to 0
  196.         end if
  197.         puppetSprite(channel, 1)
  198.         set H to the height of sprite channel
  199.         set b to the width of sprite channel
  200.         set l to 320 - b
  201.         set o to 180 - H
  202.         set top to min(0, o + oben)
  203.         spriteBox(channel, l, top, l + (b * 2), top + (H * 2))
  204.         set the visible of sprite channel to 1
  205.       end if
  206.     end if
  207.     updateStage()
  208.   else
  209.     puppetSprite(channel, 0)
  210.   end if
  211. end
  212.  
  213. on showbig2 channel, status, oben
  214.   if status = 1 then
  215.     if voidp(oben) then
  216.       set oben to 0
  217.     end if
  218.     puppetSprite(channel, 1)
  219.     set H to the height of sprite channel
  220.     set b to the width of sprite channel
  221.     set l to 320 - b
  222.     set o to 180 - H
  223.     set top to min(0, o + oben)
  224.     spriteBox(channel, l, top, l + (b * 2), top + (H * 2))
  225.     set the visible of sprite channel to 1
  226.     set the movieRate of sprite channel to 1
  227.     updateStage()
  228.   else
  229.     puppetSprite(channel, 0)
  230.   end if
  231. end
  232.  
  233. on pupsoundfade vol1, vol2, ticks, mode
  234.   set volalt to the volume of sound 1
  235.   set the volume of sound 1 to vol1
  236.   updateStage()
  237.   if ticks = 0 then
  238.     repeat while soundBusy(1)
  239.     end repeat
  240.   else
  241.     set voldif to (vol2 - vol1) / ticks
  242.     set x to the timer
  243.     repeat while the timer < (x + ticks)
  244.       set the volume of sound 1 to vol1 + (voldif * (the timer - x))
  245.       updateStage()
  246.     end repeat
  247.     set the volume of sound 1 to vol2
  248.   end if
  249.   updateStage()
  250.   if mode = 1 then
  251.     puppetSound(1, 0)
  252.   end if
  253.   if mode < 2 then
  254.     set the volume of sound 1 to volalt
  255.   end if
  256.   updateStage()
  257. end
  258.  
  259. on wait num
  260.   set x to the timer
  261.   repeat while the timer < (x + num)
  262.   end repeat
  263. end
  264.  
  265. on setmsize new
  266.   global bigmovie
  267.   repeat with x = 1 to 2
  268.     set the checkMark of menuItem x of menu "Movie" to 0
  269.   end repeat
  270.   if new = 0 then
  271.     set bigmovie to 0
  272.     set the checkMark of menuItem 1 of menu "Movie" to 1
  273.   else
  274.     if new = 1 then
  275.       set bigmovie to 1
  276.       set the checkMark of menuItem 2 of menu "Movie" to 1
  277.     else
  278.       if new = 2 then
  279.         set bigmovie to 2
  280.         set the checkMark of menuItem 2 of menu "Movie" to 1
  281.       end if
  282.     end if
  283.   end if
  284. end
  285.  
  286. on changesoundl tolevel
  287.   repeat with x = 1 to 8
  288.     set the checkMark of menuItem x of menu "Sound" to 0
  289.   end repeat
  290.   set the soundLevel to tolevel
  291.   set the checkMark of menuItem (tolevel + 1) of menu "Sound" to 1
  292. end
  293.  
  294. on changeTspeed up
  295.   if up = 1 then
  296.     set t_speed to t_speed + 1
  297.   else
  298.     if t_speed > 0 then
  299.       set t_speed to t_speed - 1
  300.     end if
  301.   end if
  302. end
  303.  
  304. on changeChunk up
  305.   if up = 1 then
  306.     set chunk to chunk + 10
  307.   else
  308.     if chunk > 30 then
  309.       set chunk to chunk - 10
  310.     end if
  311.   end if
  312. end
  313.  
  314. on starttimeout
  315.   set the timeoutMouse to 0
  316.   set the timeoutKeyDown to 0
  317.   set the timeoutPlay to 0
  318.   set the timeoutLength to 60
  319.   set the timeoutScript to "mytimeout"
  320. end
  321.  
  322. on stoptimeout
  323.   set the timeoutMouse to 1
  324.   set the timeoutKeyDown to 1
  325.   set the timeoutPlay to 1
  326.   set the timeoutScript to EMPTY
  327. end
  328.  
  329. on mytimeout
  330.   global selfdtimer
  331.   set selfdtimer to selfdtimer - 1
  332.   if selfdtimer = 0 then
  333.     stoptimeout()
  334.     go(label("finish"), "Destruct")
  335.   end if
  336.   if (selfdtimer mod 60) = 0 then
  337.     puppetSound(3, the number of cast "FinPeep.aif")
  338.   else
  339.     puppetSound(3, the number of cast "FinPeep.aif")
  340.   end if
  341.   if char 1 to 6 of the movieName = "Finale" then
  342.     showselfdtimer()
  343.   else
  344.     updateStage()
  345.   end if
  346. end
  347.  
  348. on startvideo ch
  349.   set the movieRate of sprite ch to 1
  350. end
  351.  
  352. on waitvideo ch
  353.   repeat while the movieRate of sprite ch = 1
  354.     updateStage()
  355.     if the mouseDown then
  356.       set the movieRate of sprite ch to 0
  357.       updateStage()
  358.     end if
  359.   end repeat
  360. end
  361.  
  362. on button1
  363.   set me to the clickOn
  364.   set my to the castNum of sprite me
  365.   set the castNum of sprite me to my + 1
  366.   updateStage()
  367.   repeat while the mouseDown
  368.   end repeat
  369.   set the castNum of sprite me to my
  370.   updateStage()
  371. end
  372.  
  373. on makesearchpath ID
  374.   if ID = "Shine1" then
  375.     set p0 to CDloc
  376.     set p1 to CDloc & "Part1" & sep
  377.     set p1a to CDloc & "Part1" & sep & "Hotel" & sep
  378.     set p1b to CDloc & "Part1" & sep & "TCMC" & sep
  379.     set p1c to CDloc & "Part1" & sep & "TOWER" & sep
  380.     set p1d to CDloc & "Part1" & sep & "CLONE" & sep
  381.     set p1e to CDloc & "Part1" & sep & "IRRE" & sep
  382.     set p1f to CDloc & "Part1" & sep & "SPATEX" & sep
  383.     set the searchPath to [p0, p1, p1a, p1b, p1c, p1d, p1e, p1f]
  384.   else
  385.     if ID = "Shine2" then
  386.       set p1 to CDloc & "Part3" & sep
  387.       set p1a to CDloc & "Part3" & sep & "MOV" & sep
  388.       set p2 to CDloc & "Part4" & sep
  389.       set p2a to CDloc & "Part4" & sep & "irremov" & sep
  390.       set p2b to CDloc & "Part4" & sep & "mov" & sep
  391.       set p2c to CDloc & "Part4" & sep & "finale" & sep
  392.       set the searchPath to [p1, p1a, p2, p2a, p2b, p2c]
  393.     end if
  394.   end if
  395. end
  396.  
  397. on makebarobj
  398.   global barobj, h_col, v_col, shineHpath
  399.   if mac then
  400.   else
  401.     if objectp(barobj) then
  402.     else
  403.       openXLib("xsetmcol")
  404.       set barobj to xsetmcol(mnew)
  405.       set v_col to barobj(mgettextcol)
  406.       set h_col to barobj(mgetbackcol)
  407.       barobj(msetcol, 0, 16777215)
  408.     end if
  409.   end if
  410. end
  411.  
  412. on closebarobj
  413.   global barobj, h_col, v_col, shineHpath
  414.   if mac then
  415.   else
  416.     if objectp(barobj) then
  417.       barobj(msetcol, v_col, h_col)
  418.       barobj(mdispose)
  419.       closeXLib("xsetmcol")
  420.     end if
  421.   end if
  422. end
  423.