home *** CD-ROM | disk | FTP | other *** search
/ Pro One: Netcracker Netscape Navigator / ProOne: Netcracker Netscape Navigator.iso / pc / nc / nct02095.geo / 00101.ls < prev    next >
Encoding:
Text File  |  1997-03-19  |  6.3 KB  |  272 lines

  1. on startMovie
  2.   global WasWithIn, timeoutTimer
  3.   Set_CDcounter(9)
  4.   set WasWithIn to EMPTY
  5.   set timeoutTimer to 0
  6.   repeat with i = 20 to 25
  7.     UpdateCursors(i, 0)
  8.   end repeat
  9.   initLesson()
  10.   CheckForTagWd()
  11. end
  12.  
  13. on HideLastStep
  14.   if the castNum of sprite 32 = the number of cast "lamp_Off" then
  15.     UpdateCursors(32, 0)
  16.   end if
  17.   if Get_NEXT() = 6 then
  18.     repeat with i = 20 to 25
  19.       UpdateCursors(i, 0)
  20.     end repeat
  21.   else
  22.     if Get_NEXT() = 3 then
  23.       UpdateCursors(14, 0)
  24.     end if
  25.   end if
  26. end
  27.  
  28. on InitLamp
  29.   set the visible of sprite 33 to 0
  30.   set the visible of sprite 34 to 0
  31.   UpdateCursors(33, 0)
  32.   UpdateCursors(32, 3)
  33. end
  34.  
  35. on unSetMouseEvents
  36.   global puppetList
  37.   set puppetList to []
  38.   repeat with i = 1 to 48
  39.     add(puppetList, the puppet of sprite i)
  40.     if not (the puppet of sprite i) then
  41.       set the puppet of sprite i to 1
  42.     end if
  43.   end repeat
  44.   play frame "outLamp"
  45. end
  46.  
  47. on setMouseEvents
  48.   global puppetList
  49.   set the mouseDownScript to EMPTY
  50.   set the mouseUpScript to EMPTY
  51.   set the keyDownScript to EMPTY
  52.   set the keyUpScript to EMPTY
  53.   repeat with i = 1 to 48
  54.     if getAt(puppetList, i) = 0 then
  55.       set the puppet of sprite i to 0
  56.     end if
  57.   end repeat
  58.   play done
  59. end
  60.  
  61. on dont
  62.   dontPassEvent()
  63. end
  64.  
  65. on HandleLamp tipNum
  66.   sound stop 1
  67.   sound stop 2
  68.   if the name of cast the castNum of sprite 32 = "lamp_On" then
  69.     set the castNum of sprite 32 to the number of cast "lamp_Off"
  70.     set the visible of sprite 33 to 0
  71.     set the visible of sprite 34 to 0
  72.     UpdateCursors(34, 0)
  73.     set the castNum of sprite 34 to the number of cast "EXITLAMP"
  74.     updateStage()
  75.     unSetMouseEvents()
  76.   else
  77.     set the castNum of sprite 32 to the number of cast "lamp_On"
  78.     UpdateCursors(34, 3)
  79.     set the visible of sprite 33 to 1
  80.     set the visible of sprite 34 to 1
  81.     updateStage()
  82.     PlaySound("NCT02095.T0" & tipNum)
  83.     displayTip(34)
  84.   end if
  85.   updateStage()
  86. end
  87.  
  88. on displayTip theExitBtnSp
  89.   global exitTheLoop
  90.   set exitTheLoop to 0
  91.   set the mouseDownScript to "dont"
  92.   set the mouseUpScript to "dont"
  93.   set the keyDownScript to "dont"
  94.   set the keyUpScript to "dont"
  95.   set the exitLock to 0
  96.   repeat while not exitTheLoop
  97.     if the mouseCast = the number of cast "EXITLAMP" then
  98.       set the cursor of sprite 48 to [404, 405]
  99.     else
  100.       set the cursor of sprite 48 to [400, 401]
  101.     end if
  102.     if the mouseDown and (the mouseCast = the number of cast "EXITLAMP") then
  103.       switchExitLampButt(theExitBtnSp, "EXITLAMP_D")
  104.     end if
  105.   end repeat
  106.   set the exitLock to 1
  107.   set the cursor of sprite 48 to 0
  108.   HandleLamp()
  109. end
  110.  
  111. on switchExitLampButt spriteNum, castDown
  112.   global exitTheLoop
  113.   set flag to 0
  114.   set SaveCast to the castNum of sprite spriteNum
  115.   set flag to swapExitLampCast(spriteNum, SaveCast, castDown)
  116.   repeat while the mouseDown
  117.     set flag to swapExitLampCast(spriteNum, SaveCast, castDown)
  118.   end repeat
  119.   if flag = 1 then
  120.     set exitTheLoop to 1
  121.   end if
  122. end
  123.  
  124. on swapExitLampCast spriteNum, SaveCast, castDown
  125.   if rollOver(spriteNum) then
  126.     set the castNum of sprite spriteNum to the number of cast castDown
  127.     updateStage()
  128.     return 1
  129.   else
  130.     set the castNum of sprite spriteNum to the number of cast SaveCast
  131.     updateStage()
  132.     return 0
  133.   end if
  134. end
  135.  
  136. on TheinitCursor
  137.   initCursorCastNum()
  138.   initCursorList(1)
  139.   set CursorCastNum to getCursor(2)
  140.   cursor([CursorCastNum, CursorCastNum + 1])
  141. end
  142.  
  143. on checkScreenStatus
  144.   CheckRollOver()
  145.   CheckSnakeStatus()
  146.   go(the frame)
  147. end
  148.  
  149. on BlinkNext
  150.   global Localtimer
  151.   if (the timer > getTimer()) and not soundBusy(2) and (Localtimer < 2) then
  152.     startTimer()
  153.     if the name of cast the castNum of sprite get_NEXTSprite() = "NEXT" then
  154.       set the castNum of sprite get_NEXTSprite() to the number of cast "NEXT_E"
  155.     else
  156.       puppetSound("hilight1")
  157.       set the castNum of sprite get_NEXTSprite() to the number of cast "NEXT"
  158.       set Localtimer to Localtimer + 1
  159.     end if
  160.   end if
  161. end
  162.  
  163. on PressBtn theBtn
  164.   Set_PressedLast(theBtn)
  165.   switchButt(Get_AnsSprite() + theBtn - 1, "down" & theBtn, "HandleBtn" && theBtn)
  166. end
  167.  
  168. on GoNext
  169.   if not get_Disabled() then
  170.     sound stop 2
  171.     if Get_NEXT() = 1 then
  172.       go("t1")
  173.     else
  174.       if Get_NEXT() = 2 then
  175.         go("t2")
  176.       else
  177.         if Get_NEXT() = 3 then
  178.           UpdateCursors(14, 0)
  179.           go("t3")
  180.           InitLamp()
  181.         else
  182.           if Get_NEXT() = 4 then
  183.             go("t4")
  184.           else
  185.             if Get_NEXT() = 5 then
  186.               go("t5")
  187.               InitLamp()
  188.             else
  189.               if Get_NEXT() = 6 then
  190.                 repeat with i = 20 to 25
  191.                   UpdateCursors(i, 0)
  192.                 end repeat
  193.                 go("t6")
  194.               else
  195.                 if Get_NEXT() = 7 then
  196.                   go("t7")
  197.                 else
  198.                   if Get_NEXT() = 8 then
  199.                     go("t8")
  200.                   else
  201.                     if Get_NEXT() = 9 then
  202.                       GoNextMovie()
  203.                     end if
  204.                   end if
  205.                 end if
  206.               end if
  207.             end if
  208.           end if
  209.         end if
  210.       end if
  211.     end if
  212.     Set_NEXT(Get_NEXT() + 1)
  213.   end if
  214. end
  215.  
  216. on stopMovie
  217.   sound stop 1
  218.   unLoad()
  219.   setEmptyCursor()
  220. end
  221.  
  222. on GoNextMovie
  223.   PlaySound("GOSOUND.SO1")
  224.   SaveHilite()
  225.   Add_CDcounter(1)
  226.   set cdNum to Get_CDcounter()
  227.   set movieName to item cdNum of Get_CurrentSnakeScreens()
  228.   go("INIT" & Get_ScreenSubject(), movieName & ".GEO")
  229. end
  230.  
  231. on CheckWithIn
  232.   global WasWithIn, timeoutTimer
  233.   repeat with theTsNum = 1 to 6
  234.     if theTsNum <> WasWithIn then
  235.       if (the ticks - timeoutTimer) > 120 then
  236.         set timeoutTimer to 0
  237.         if rollOver(19 + theTsNum) then
  238.           set timeoutTimer to the ticks
  239.           set WasWithIn to theTsNum
  240.           go("t" & 15 + theTsNum)
  241.         end if
  242.       end if
  243.     end if
  244.   end repeat
  245. end
  246.  
  247. on playTheTSound theTSnd
  248.   if theTSnd = 0 then
  249.     PlaySound("NCT02095.s00")
  250.   else
  251.     if (theTSnd = 11) or (theTSnd = 10) then
  252.       PlaySound("NCT02095.s" & theTSnd)
  253.     else
  254.       PlaySound("NCT02095.s0" & theTSnd)
  255.     end if
  256.   end if
  257. end
  258.  
  259. on blinkHiLight
  260.   global Localtimer
  261.   if (the timer > getTimer()) and not soundBusy(2) and (Localtimer < 2) then
  262.     startTimer()
  263.     if the visible of sprite 14 then
  264.       set the visible of sprite 14 to 0
  265.     else
  266.       puppetSound("hilight1")
  267.       set the visible of sprite 14 to 1
  268.       set Localtimer to Localtimer + 1
  269.     end if
  270.   end if
  271. end
  272.