home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / mac / FILES / EDISON.DIR / 00301_Script_rBulbExperimentMgr < prev    next >
Text File  |  1997-05-26  |  28KB  |  892 lines

  1. -- o: light bulb exp mgr
  2.  
  3. -- instanciated as gBulbExpMgr
  4.  
  5. property pRollOverStartSprite, pMercBottleSprite, pFirstBulbSprite
  6. property pMercConstraintCast, pMercMouseLeft, pMercMouseRight, pMercBottleHigh, pMercBottleLow
  7. property pBulbQTDataList, pMercStepVHList, pVacuumLevel
  8. property pLabState, pLabelTextCast, pQTSprite
  9. property pRollOverLabCastList, pRollOverBulbCastList, pLBPuppetList
  10. property pBackgroundSprite, pCoilLoadQT
  11. property pCurrentBulbNum, pCurrentBulbName, pBulbSprite, pBulbInCast, pBulbOutCast
  12. property pBulbRackSprite, pFullBulbRackCast, pSwitchSprite, pSwitchOffCast, pBurnQTNum
  13. property pBulbQTData, pBulbTimeData, pBulbVOdata, pBurnBulbFlag, pQTPath, pBurnTime
  14. property pSndPath, pOutComeVOFlag, pVO, pAttempts, pCongratFlag, pCloseUpSprite
  15. property pFirstRackBulbSprite, pVGCloseUpFlag, pResultLabelSprite
  16. property pBattZoomSprite, pVacZoomSprite, pBackOutSprite1, pPictureSprite, pNotebookSprite, pQTSprite19
  17. property pDescriptionTextCast, pInstructionTextCast
  18. property pLBExperimentRecordList, pCorrectVaccumLevel, pCorrectBulbNum
  19. property pAtVGauge, pTestingBulb, pAmbientSnd, pFilimentDescpStrCst
  20. property   pToolBarSimSprite, pToolBarBulb
  21.  
  22. property pDamnThisCrappyCode
  23.  
  24. global gJournalObj, gInterfaceMgrObj, gScoreEventObj
  25. global gMediaPat, gQTpath, gSndPath, gUtilityObj,gActiveAmbSnd
  26. --====================================
  27. on mInit me, myCastList, QTPath, SndPath
  28.   
  29.   cursor 4
  30.   sound playFile 2, gSndPath & "ELTINTR2.AIF"
  31.   -- sprite declarations
  32.   set pBackgroundSprite = 2 
  33.   set pFirstBulbSprite = 12
  34.   set pMercBottleSprite = 5
  35.   set pQTSprite = 20
  36.   set pBulbSprite = 7
  37.   set pBulbRackSprite = 3
  38.   set pSwitchSprite = 4
  39.   set pCloseUpSprite = 9
  40.   set pFirstRackBulbSprite = 12
  41.   set pResultLabelSprite = 24
  42.   set pBattZoomSprite = 13
  43.   set pVacZoomSprite = 14
  44.   set pBackOutSprite1 = 21
  45.   set pPictureSprite = 11
  46.   set pNotebookSprite = 19
  47.   set pQTSprite19 = 19
  48.   set pFilimentDescpStrCst = the number of cast "IRON"
  49.   
  50.   set pAmbientSnd =  "ELBULB.AIF"
  51.   
  52.   -- set adjustment value for mouse on mercury bottle
  53.   set shiftSizeH = 20
  54.   set shiftSizeV = 20
  55.   set pMercMouseLeft = the locH of sprite pMercBottleSprite - (the left of sprite pMercBottleSprite + 20)
  56.   set pMercMouseRight  = the locV of sprite pMercBottleSprite - (the Top of sprite pMercBottleSprite + 20)
  57.   set pMercBottleHigh = the top of sprite pBackgroundSprite + 208
  58.   set pMercBottleLow = the top of sprite pBackgroundSprite + 365
  59.   
  60.   -- cast declarations
  61.   --/ temporary measure
  62.   set pLabelTextCast = the number of cast "labelTxt"
  63.   set pDescriptionTextCast = the number of cast "descrTxt"
  64.   set pInstructionTextCast = the number of cast "instrTxt"
  65.   --/
  66.   set pMercConstraintCast = the number of cast "mercConstraintCast"
  67.   set pCoilLoadQT = the number of cast "ELTSNAPC.MOV"
  68.   set pBulbInCast = the number of cast "ELTMT1.PIC"
  69.   set pBulbOutCast = the number of cast "ELTMT2.PIC"
  70.   set pFullBulbRackCast = the number of cast "ELTRK.PIC"
  71.   set pSwitchOffCast = the number of cast "ELTSWOF.PIC"
  72.   set pBurnBulbFlag  = the number of cast "burnBulbFlag"
  73.   set pOutComeVOFlag = the number of cast "outcomeAudioFlag"
  74.   set pCongratFlag = the number of cast "congratQTFlag"
  75.   set pVGCloseUpFlag = the number of cast "vacGaugeFlag"
  76.   set pPlaceHolderCst = the number of cast "mainInterfacePlaceHolder"
  77.   
  78.   -- init lists
  79.   mInitLists (me)
  80.   set pMercStepVHList = [301:139, 329:161, 361:180, 392:200, 420:217]
  81.   -- initial state
  82.   set pVacuumLevel = 1
  83.   set pAttempts = 0
  84.   set pCurrentBulbNum = 0
  85.   
  86.   set pLBExperimentRecordList = []
  87.   set pCorrectVaccumLevel = 5
  88.   set pCorrectBulbNum = 8
  89.   
  90.   repeat with counter = 1 to 40
  91.     setAt (pLBExperimentRecordList, counter, 0)
  92.   end repeat
  93.   
  94.   set pQTPath = gQTPath
  95.   set pSndPath = gSndPath
  96.   
  97.   set pAtVGauge = false
  98.   set pTestingBulb = false
  99.   
  100.   
  101.   set pDamnThisCrappyCode = the text of cast "bulbRollOvers"
  102.   
  103.   
  104.   return (me)
  105.   
  106. end
  107. ----------------------------------------------
  108.  
  109. -------------------------------------------------------------------------------------------------------------------
  110. -- dont pay attetion to lingering highlights ... just functionality
  111. -------------------------------------------------------------------------------------------------------------------
  112. on mOperate me, whatSelection
  113.   
  114.   cursor 4
  115.   if  pTestingBulb then
  116.     
  117.     sound Stop (2)
  118.     mUnSetOneCursor (gUtilityObj, 18)
  119.     puppetSprite 21, false
  120.     puppetSprite 20, false
  121.     puppetSprite 24, false
  122.     puppetSprite 10, false
  123.     puppetSprite 16, false
  124.     updateStage
  125.     
  126.   else if pAtVGauge then mClearVacGCloseUp(me)
  127.   
  128.   if whatSelection = 1 then
  129.     
  130.     go "chooseBulb"
  131.     --PREVIOUS BULB
  132.     if pCurrentBulbNum < 2 then set NewBulb = 8
  133.     else set NewBulb = pCurrentBulbNum - 1
  134.     set pToolBarSimSprite = NewBulb + (pFirstBulbSprite - 1)
  135.     set pToolBarBulb = TRUE
  136.     set pCurrentBulbNum = NewBulb
  137.     set the text of cast pLabelTextCast = line pCurrentBulbNum of pDamnThisCrappyCode
  138.     set the text of cast pInstructionTextCast =  the text of cast  (pFilimentDescpStrCst + pCurrentBulbNum - 1)
  139.     mClearToolHilite ( gInterfaceMgrObj )
  140.     
  141.   else if whatSelection = 4 then
  142.     
  143.     --PREVIOUS MERCURY BOTTLE
  144.     if  pToolBarBulb then 
  145.       mBulbChosen(me, pToolBarSimSprite)
  146.       set the movierate of sprite 20 = 1
  147.       repeat while the movierate of sprite 20 = 1
  148.         updatestage
  149.       end repeat
  150.       mSetBulb me
  151.     end if
  152.     
  153.     if pVacuumLevel > 1 then
  154.       set NewVacuumLevel = pVacuumLevel  - 1
  155.       set WhichStepIndex = 6 - NewVacuumLevel
  156.       mToolBarVacuumMercuryMove(me, whichStepIndex)
  157.     else  go frame "LBBaseState"
  158.     mClearToolHilite ( gInterfaceMgrObj )
  159.     
  160.   else if whatSelection = 3 then
  161.     
  162.     --NEXT BULB
  163.     go "chooseBulb"
  164.     if pCurrentBulbNum > 7 then set NewBulb = 1
  165.     else set NewBulb = pCurrentBulbNum + 1
  166.     set pToolBarSimSprite = NewBulb + (pFirstBulbSprite - 1)
  167.     set pToolBarBulb = TRUE
  168.     set pCurrentBulbNum = NewBulb
  169.     set the text of cast pLabelTextCast = line pCurrentBulbNum of pDamnThisCrappyCode
  170.     set the text of cast pInstructionTextCast =  the text of cast  (pFilimentDescpStrCst + pCurrentBulbNum - 1)
  171.     mClearToolHilite ( gInterfaceMgrObj )
  172.     
  173.   else if whatSelection = 2 then
  174.     
  175.     --NEXT MERCURY BOTTLE
  176.     if  pToolBarBulb then 
  177.       mBulbChosen(me, pToolBarSimSprite)
  178.       set the movierate of sprite 20 = 1
  179.       repeat while the movierate of sprite 20 = 1
  180.         updatestage
  181.       end repeat
  182.       mSetBulb me
  183.     end if
  184.     
  185.     if pVacuumLevel < 5 then
  186.       set NewVacuumLevel = pVacuumLevel + 1
  187.       set WhichStepIndex = 6 - NewVacuumLevel
  188.       mToolBarVacuumMercuryMove(me, whichStepIndex)
  189.     else go frame "LBBaseState"
  190.     
  191.     mClearToolHilite ( gInterfaceMgrObj )
  192.   else if whatSelection = 5 then
  193.     
  194.     if  pToolBarBulb then 
  195.       mBulbChosen(me, pToolBarSimSprite)
  196.       set the movierate of sprite 20 = 1
  197.       repeat while the movierate of sprite 20 = 1
  198.         updatestage
  199.       end repeat
  200.     end if
  201.     --SWITCH ON
  202.     mFlipSwitch(me)
  203.     
  204.   else if whatSelection = 6 then
  205.     --SWITCH OFF
  206.     
  207.   end if
  208.   
  209.   cursor -1
  210.   
  211.   
  212. end mOperate
  213. -------------------------------------------------------------------------------------------------------------------
  214. on mToolBarVacuumMercuryMove me, whichStepIndex
  215.   
  216.   set tempV = getPropAt(pMercStepVHList, whichStepIndex)
  217.   set the locV of sprite pMercBottleSprite = tempV
  218.   set the locH of sprite pMercBottleSprite = getAProp(pMercStepVHList, tempV)
  219.   set pVacuumLevel = 6 - whichStepIndex
  220.   puppetsound "MERC.AIF"
  221.   updateStage
  222.   go frame "playMerc"
  223.   
  224. end mToolBarVacuumMercuryMove
  225. -------------------------------------------------------------------------------------------------------------------
  226. on mZoom me, whatSelection
  227.   
  228.   set gActiveAmbSnd = pAmbientSnd
  229.   cursor 4
  230.   if not pTestingBulb then
  231.     
  232.     if pAtVGauge then mClearVacGCloseUp(me)
  233.     if whatSelection = 1 then mBattCloseUp (me)
  234.     else if whatSelection = 2 then mVGCloseUp (me)
  235.     else if whatSelection = 3 then
  236.       --SWITCH
  237.     end if
  238.     
  239.   end if
  240.   mClearToolHilite ( gInterfaceMgrObj )
  241.   cursor -1
  242.   
  243. end mZoom
  244. -------------------------------------------------------------------------------------------------------------------
  245. on mInitLightBulbSequence me
  246.   
  247.   -- puppets
  248.   puppetSprite pMercBottleSprite, true
  249.   puppetSprite pBulbSprite, true
  250.   puppetSprite pBulbRackSprite, true
  251.   
  252.   mInformJournal(gJournalObj, #ArrivingAtBIY)
  253.   mSetToolBtns (gInterfaceMgrObj, #EBYS, me)
  254.   set gActiveAmbSnd = pAmbientSnd
  255.   cursor -1
  256.   
  257. end
  258. ----------------------------------------------
  259. on mCloseLightBulbSequence me
  260.   
  261.   set gActiveAmbSnd = pAmbientSnd
  262.   if soundBusy (2) then sound stop (2)
  263.   set the locv of sprite pQTSprite = -1000
  264.   puppetSprite pMercBottleSprite, false
  265.   puppetSprite pBulbSprite, false
  266.   puppetSprite pBulbRackSprite, false
  267.   puppetSprite pQTSprite, false
  268.   puppetSprite pResultLabelSprite, false
  269.   
  270.   -- cursors
  271.   mUnSetCursors (gUtilityObj)
  272.   
  273.   -- text
  274.   mClearText (me)
  275.   
  276.   mInformJournal(gJournalObj, #LeavingBIY)
  277.   
  278. end
  279. ----------------------------------------------------------------------------ò
  280. on mClearText me
  281.   
  282.   set the text of cast pLabelTextCast = " "
  283.   set the text of cast pDescriptionTextCast = " "
  284.   set the text of cast pInstructionTextCast = " "
  285.   
  286. end
  287. ----------------------------------------------------------------------------ò
  288. on mPlayIntro me
  289.   
  290.   sound playFile 2, pSndPath & "ELTINTR2.AIF"
  291.   
  292.   
  293. end
  294. ----------------------------------------------------------------------------ò
  295. on mSetLBState me, whichState
  296.   
  297.   set gActiveAmbSnd = pAmbientSnd
  298.   set pLabState = whichState
  299.   if (whichState = #viewLab) then 
  300.     mUnSetCursors (gUtilityObj)
  301.     mSetLBBaseCursors (me)
  302.     set the text of cast pDescriptionTextCast = " "
  303.     set the text of cast pInstructionTextCast = the text of cast "LBInstructions" 
  304.   else if (whichState = #viewBulbs) then
  305.     if soundBusy(2) then sound stop 2
  306.     mUnSetCursors (gUtilityObj)
  307.     mSetViewBulbCursors (me)
  308.   end if
  309.   
  310. end
  311. ----------------------------------------------------------------------------ò
  312. ----------------    CURSORS     -----------------------------------------------
  313. ----------------------------------------------------------------------------ò
  314. on mSetLBBaseCursors me
  315.   
  316.   set cursorList = [:]
  317.   setaprop(cursorList,pBattZoomSprite,#ZoomIn)
  318.   addProp(cursorList,pVacZoomSprite,#ZoomIn)
  319.   addProp(cursorList,pMercBottleSprite,#Operate)
  320.   addProp(cursorList,pBulbRackSprite,#Operate)
  321.   addProp(cursorList,pSwitchSprite,#Bolt)
  322.   addProp(cursorList,pPictureSprite,#Operate)
  323.   mSetCursors (gUtilityObj, cursorList)
  324.   mSetBackOutCursors (me)
  325.   
  326. end
  327. ----------------------------------------------------------------------------ò
  328. on mSetViewBulbCursors me
  329.   
  330.   set gActiveAmbSnd = pAmbientSnd
  331.   set cursorList = [:]
  332.   repeat with spriteCounter = pFirstRackBulbSprite to pFirstRackBulbSprite + 8
  333.     addProp(cursorList,spriteCounter,#Operate)
  334.   end repeat
  335.   mSetCursors (gUtilityObj, cursorList)
  336.   mSetBackOutCursors (me)
  337.   
  338. end
  339. ----------------------------------------------------------------------------ò
  340. on mSetBackOutCursors me
  341.   
  342.   set cursorList = [:]
  343.   setaprop(cursorList,pBackOutSprite1,#RETURN)
  344.   addProp(cursorList,pBackOutSprite1 + 1,#RETURN)
  345.   mSetCursors (gUtilityObj, cursorList)
  346.   
  347. end
  348. ----------------------------------------------------------------------------ò
  349. ----------------------------------------------------------------------------ò
  350. on mInitLists me
  351.   
  352.   -- lab rollOver list
  353.   set labRollOverFlag = the number of cast "wallPicture" - 1
  354.   set rollOverItems = the text of cast "labRollOvers"
  355.   
  356.   
  357.   set pRollOverLabCastList = [:]
  358.   repeat with rollCntr = 1 to the number of lines in rollOverItems
  359.     addProp(pRollOverLabCastList, rollCntr + labRollOverFlag , line rollCntr of rollOverItems)
  360.   end repeat
  361.   
  362.   -- bulb rollOver list
  363.   set bulbRollOverFlag = the number of cast "bulbRollOverFlag" - 1
  364.   set rollOverItems = the text of cast "bulbRollOvers"
  365.   set pRollOverBulbCastList = [:]
  366.   repeat with rollCntr = 1 to the number of lines in rollOverItems
  367.     addProp(pRollOverBulbCastList, rollCntr + bulbRollOverFlag , line rollCntr of rollOverItems)
  368.   end repeat
  369.   --/ Temporary Measure
  370.   set pBulbQTData = the text of cast "filiment_QTdata"
  371.   set pBulbTimeData = the text of cast "filiment_timedata"
  372.   set pBulbVOdata = the text of cast "filiment_VOdata"
  373.   
  374. end
  375. ----------------------------------------------
  376. on mCompileList me, whichDataCast
  377.   
  378.   set listData = the text of cast whichDataCast
  379.   
  380.   set tempList = [:]
  381.   
  382.   repeat with lineCnt = 2 to 9
  383.     set theProperty = value(item 1 of line lineCnt of listData)
  384.     set theOutcome = string(item 2 of line lineCnt of listData)
  385.     repeat with outcomeCnt = 3 to 6
  386.       set theOutcome = theOutcome &", " & item outcomeCnt of line lineCnt of listData
  387.     end repeat
  388.     addProp(tempList, theProperty, theOutcome)
  389.   end repeat
  390.   
  391.   return (tempList)
  392.   
  393. end
  394. ----------------------------------------------
  395. on mBulbChosen me, whichSprite 
  396.   
  397.   set pToolBarBulb = FALSE
  398.   puppetsound "BULB5.AIF"
  399.   updatestage
  400.   set pCurrentBulbNum = whichSprite - (pFirstBulbSprite - 1)
  401.   set the castNum of sprite pBulbRackSprite = pFullBulbRackCast + pCurrentBulbNum
  402.   set gActiveAmbSnd = 0
  403.   if (pCurrentBulbNum < 5) then go frame "loadCoil"
  404.   else go frame "loadLoop"
  405.   
  406. end
  407. ----------------------------------------------
  408. on mCheckRollOvers me
  409.   
  410.   
  411.   if (pLabState = #viewLab) then 
  412.     set tempText = getaProp(pRollOverLabCastList, the mouseCast)
  413.     if (not voidP(tempText)) then set the text of cast pLabelTextCast = tempText
  414.     else set the text of cast pLabelTextCast = "INCANDESCENT LIGHT BULB EXPERIMENT (1879)"
  415.   end if
  416.   
  417.   if (pLabState = #viewBulbs) then 
  418.     set tempText = getaProp(pRollOverBulbCastList, the mouseCast)
  419.     set CstOffset = getpos(pRollOverBulbCastList,tempText) - 1
  420.     if (not voidP(tempText)) then 
  421.       set the text of cast pLabelTextCast = tempText
  422.       set the text of cast pInstructionTextCast =  the text of cast  (pFilimentDescpStrCst + CstOffset)
  423.     end if
  424.   end if
  425.   
  426.   
  427.   go the frame
  428.   
  429. end
  430. ----------------------------------------------
  431. on mGrabMercBottle me
  432.   
  433.   mUnSetAllCursors( gUtilityObj )
  434.   mSetGeneralCursor ( gUtilityObj, #ClosedHand)
  435.   
  436.   set origv = the mousev
  437.   set voffset = origv - the locv of sprite pMercBottleSprite
  438.   set hoffset = the mouseh - the loch of sprite pMercBottleSprite
  439.   go "MoveMerc"
  440.   
  441.   repeat while the mousev = origv
  442.   end repeat
  443.   if soundBusy(2) then sound stop 2
  444.   set firsttime = TRUE
  445.   repeat while (the mouseDown) or firsttime
  446.     set  mousev =  (the mousev - voffset)
  447.     if mousev < 288 then set mousev = 288
  448.     else if mousev > 445 then set mousev = 445
  449.     set the locv of sprite pMercBottleSprite = mousev
  450.     set the loch of sprite pMercBottleSprite = (mousev - 445 ) * .5 + 232
  451.     updatestage
  452.     if firsttime then set firsttime = FALSE
  453.   end repeat
  454.   
  455.   cursor 4
  456.   
  457.   set whichStepIndex = (mousev - pMercBottleHigh)/((pMercBottleLow - pMercBottleHigh)/5) + 1 -- 1: elim 0
  458.   if (whichStepIndex > 5) then set whichStepIndex = 5
  459.   else if (whichStepIndex < 1) then set whichStepIndex = 1
  460.   set tempV = getPropAt(pMercStepVHList, whichStepIndex)
  461.   set the locV of sprite pMercBottleSprite = tempV
  462.   set the locH of sprite pMercBottleSprite = getAProp(pMercStepVHList, tempV)
  463.   set pVacuumLevel = 6 - whichStepIndex
  464.   
  465.   puppetsound  "MERC.AIF"
  466.   updatestage
  467.   set gActiveAmbSnd = 0
  468.   
  469. end
  470. ----------------------------------------------
  471. on mPlaySwitchQT me
  472.   
  473.   if the movieRate of sprite pQTSprite = 1 then go the frame 
  474.   
  475. end
  476. ----------------------------------------------
  477. on mFlipSwitch me
  478.   
  479.   set pTestingBulb = true
  480.   if soundBusy(2) then sound stop 2
  481.   
  482.   set pAttempts = pAttempts + 1
  483.   
  484.   sound stop 1
  485.   set gActiveAmbSnd = 0
  486.   go frame "flipSwitch"
  487.   mUnSetCursors (gUtilityObj)
  488.   
  489. end
  490. ----------------------------------------------
  491. on mPlayLoadBulbQT me
  492.   
  493.   if the movieRate of sprite pQTSprite = 1 then go the frame 
  494.   else
  495.     mSetBulb me
  496.     go frame "LBBaseState"
  497.   end if
  498.   
  499. end
  500. ----------------------------------------------
  501. on mSetBulb me
  502.   
  503.   set gActiveAmbSnd = pAmbientSnd
  504.   puppetsprite pBulbSprite, True
  505.   set the castNum of sprite pBulbSprite = pBulbInCast
  506.   
  507. end 
  508. ----------------------------------------------
  509. on mEvalResults me
  510.   
  511.   set gActiveAmbSnd = 0
  512.   -- check if all items set
  513.   if (pCurrentBulbNum<> 0) then
  514.     
  515.     --Update Experiment Record for Journal
  516.     
  517.     set RecordIndex = (pVacuumLevel - 1) * 8 + pCurrentBulbNum
  518.     setAt (pLBExperimentRecordList, RecordIndex, 1)
  519.     
  520.     -- if so set set results
  521.     set tempItem = pVacuumLevel + 1
  522.     set pBurnQTNum = item tempItem of line pCurrentBulbNum of pBulbQTData
  523.     set pBurnTime = item tempItem of line pCurrentBulbNum of pBulbTimeData 
  524.     set pVO = item tempItem of line pCurrentBulbNum of pBulbVOdata
  525.     
  526.     -- go to bulb movie frame
  527.     if (pCurrentBulbNum< 5) then go frame "turnOnCoil"
  528.     else go frame "turnOnLoop"
  529.   else 
  530.     sound playfile 2, gsndpath & "ELTHNT0.AIF"
  531.     set pTestingBulb = false
  532.     mClearToolHilite ( gInterfaceMgrObj )
  533.     go frame "LBBaseState"
  534.   end if
  535.   
  536. end
  537. ----------------------------------------------
  538. on mbulbCont me
  539.   
  540.   sound Stop (2)
  541.   mUnSetOneCursor (gUtilityObj, 18)
  542.   puppetSprite 21, false
  543.   puppetSprite 20, false
  544.   puppetSprite 24, false
  545.   puppetSprite 10, false
  546.   puppetSprite 16, false
  547.   updateStage
  548.   set pCurrentBulbNum = 0
  549.   go "Bulb cont"
  550.   
  551. end mbulbCont
  552. ----------------------------------------------
  553. on mInitBulb me
  554.   
  555.   sound stop 1
  556.   updateStage
  557.   
  558.   set gActiveAmbSnd = 0
  559.   
  560.   mSetCursors (gUtilityObj, [18:#zoomout])
  561.   mSetBackOutCursors (me )
  562.   
  563.   puppetSprite 16, true
  564.   puppetSprite pQTSprite, true
  565.   set the castNum of sprite pQTSprite = pBurnBulbFlag + pBurnQTNum
  566.   set the locH of sprite pQTsprite = 198
  567.   set the locV of sprite pQTsprite = 209
  568.   
  569.   set the movieRate of sprite pQTSprite = 1
  570.   
  571. end mInitBulb
  572. ----------------------------------------------------------------------------ò
  573. on mPlayBottleQT me
  574.   
  575.   if (the mousedown) and (the clickon = pMercBottleSprite) then
  576.     go "MoveMerc"
  577.   else if the movieRate of sprite pQTSprite = 1 then go the frame
  578.   
  579. end mPlayBottleQT
  580. ----------------------------------------------------------------------------ò
  581. on  mResetQT me
  582.   
  583.   sound stop 1
  584.   set the movieRate of sprite pQTSprite = 1
  585.   
  586. end mResetQT
  587. ----------------------------------------------------------------------------ò
  588. on mClearAndGoToBase me
  589.   
  590.   if (the movieRate of sprite pQTSprite = 1) then set the movieRate of pQTSprite = 0
  591.   if soundBusy (2) then sound stop (2)
  592.   
  593. end
  594. ----------------------------------------------------------------------------ò
  595. on mDisplayResult me
  596.   
  597.   set gActiveAmbSnd = pAmbientSnd
  598.   puppetSprite pQTSprite, false
  599.   puppetSprite pResultLabelSprite, true
  600.   set the castnum of sprite pResultLabelSprite = the number of cast "timeLitDisplayFlag" + pBurnTime
  601.   set the locV of sprite pResultLabelSprite = 400
  602.   set the locH of sprite pResultLabelSprite = 217
  603.   updateStage
  604.   
  605. end
  606. ----------------------------------------------
  607. on mPlayOutComeVO me
  608.   
  609.   
  610.   if (pVO <> 8) then  -- 8 is flagged as the correct combo
  611.     set whichVO = the name of cast (pOutComeVOFlag + pVO)
  612.     set whichVO = pSndPath & whichVO
  613.     sound playFile 2, whichVO
  614.     updateStage
  615.   else
  616.     set endticks = the ticks + 60
  617.     
  618.     repeat while ( the ticks < endticks)
  619.       updatestage
  620.     end repeat
  621.     
  622.     puppetSprite 16,false
  623.     puppetSprite pQTSprite, false
  624.     puppetSprite pResultLabelSprite, false
  625.     go frame "congrads"
  626.   end if
  627.   
  628. end
  629. ----------------------------------------------
  630. on mEjectBulb me
  631.   
  632.   puppetSprite pQTSprite, false
  633.   updateStage
  634.   
  635.   
  636. end
  637. ----------------------------------------------
  638. on mPlayCongradsVid me
  639.   
  640.   set gActiveAmbSnd = 0
  641.   sound stop 1
  642.   updatestage
  643.   
  644.   if pAttempts < 8 then set congradVidNum = 1
  645.   else if pAttempts < 15 then set congradVidNum = 2
  646.   else set congradVidNum = 3
  647.   
  648.   puppetsprite pBulbSprite, false
  649.   puppetsprite pQTSprite, true
  650.   
  651.   if congradVidNum > 1 then set the rect of sprite pQTSprite = rect (240, 140, 480, 440)
  652.   else set the rect of sprite pQTsprite = rect(260, 140, 480, 440)
  653.   set the castNum of sprite pQTSprite = pCongratFlag + congradVidNum
  654.   updatestage
  655.   set the movierate of sprite pQTsprite = 1
  656.   
  657.   
  658. end
  659. ----------------------------------------------------------------------------------------------------------
  660. on msetattempts me, howmany
  661.   
  662.   set pAttempts = howmany
  663.   
  664. end msetattempts
  665. ----------------------------------------------------------------------------------------------------------
  666. on mResetBulbs me
  667.   
  668.   sound stop 1
  669.   updatestage
  670.   set gActiveAmbSnd = 0
  671.   
  672.   puppetSprite 16, false 
  673.   puppetsprite pBulbSprite, true
  674.   set the castNum of sprite pBulbSprite = pBulbOutCast
  675.   set the castNum of sprite pBulbRackSprite = pFullBulbRackCast
  676.   mClearToolHilite ( gInterfaceMgrObj )
  677.   puppetSprite pResultLabelSprite, false
  678.   set the movieRate of sprite 23 = 1 
  679.   
  680. end
  681. ----------------------------------------------
  682. on mEndLightBulbTest me
  683.   
  684.   set pTestingBulb = false
  685.   go frame "LBBaseState"
  686.   
  687. end mEndLightBulbTest
  688. ----------------------------------------------
  689. on mEndCongradsVid me
  690.   
  691.   puppetsprite pQTSprite, false
  692.   set pTestingBulb = false
  693.   go frame "LBBaseState"
  694.   puppetsprite pBulbSprite, TRUE
  695.   
  696. end mEndCongradsVid
  697. ----------------------------------------------
  698. on mClose me
  699.   
  700.   if the casttype of cast (the castnum of sprite pQTSprite) = #DigitalVideo then
  701.     set the movierate of sprite pQTSprite = 0
  702.   end if
  703.   
  704.   set the locv of sprite pQTSprite = -1000
  705.   set the locv of sprite pBulbSprite = -1000
  706.   updatestage
  707.   
  708.   repeat with Counter = 1 to 23
  709.     puppetSprite Counter, false
  710.   end repeat
  711.   mUnSetCursors (gUtilityObj)
  712.   
  713. end
  714.  
  715. ----------------------------------------------
  716. on mPullout me
  717.   
  718.   sound stop 2
  719.   mInformJournal (gJournalObj, #LeavingBIY)
  720.   mDenyClicks ( gUtilityObj )
  721.   mClose ( me )
  722.   mGoFrameAndPullOut (gScoreEventObj, "lightpo")
  723.   
  724. end mPullout
  725. ----------------------------------------------
  726. on mVGCloseUp me
  727.   
  728.   if soundBusy(2) then sound stop 2
  729.   
  730.   mUnSetOneCursor (gUtilityObj, pBattZoomSprite)
  731.   mUnSetOneCursor (gUtilityObj, pVacZoomSprite)
  732.   
  733.   go frame "VGClose"
  734.   set the text of cast pInstructionTextCast = the text of cast "Gauge Zoom"
  735.   set the text of cast pLabelTextCast = "VACUUM GAUGE"
  736. end
  737. ----------------------------------------------
  738. on mSetVGauge me
  739.   
  740.   set pAtVGauge = true
  741.   puppetsprite pCloseUpSprite, true
  742.   updateStage
  743.   set the castNum of sprite pCloseUpSprite = pVGCloseUpFlag + pVacuumLevel
  744.   mSetCursors (gUtilityObj, [8:#zoomout])
  745.   
  746. end
  747. ----------------------------------------------
  748. on mClearVacGCloseUp me
  749.   
  750.   mUnSetCursors ( gUtilityObj )
  751.   set pAtVGauge = false
  752.   puppetSprite pCloseUpSprite, false
  753.   go frame "LBBaseState"
  754.   updateStage
  755.   mSetCursors (gUtilityObj, [21:#return,22:#return])
  756.   mSetLBBaseCursors (me, #set)
  757.   set the text of cast pInstructionTextCast = the text of cast "LBInstructions"
  758.   set the text of cast pLabelTextCast = "INCANDESCENT LIGHT BULB EXPERIMENT (1879)"
  759.   
  760. end
  761. ----------------------------------------------------------------------------ò
  762. on mBattCloseUp me
  763.   
  764.   if soundBusy(2) then sound stop 2
  765.   mUnSetOneCursor (gUtilityObj, pBattZoomSprite)
  766.   
  767.   go frame "BattClose"
  768.   set the text of cast pInstructionTextCast = the text of cast "battery zoom"
  769.   set the text of cast pLabelTextCast = "BATTERY"
  770.   mSetBackOutCursors (me )
  771.   mSetCursors (gUtilityObj, [9:#zoomout])
  772.   
  773. end
  774. ----------------------------------------------
  775. on mPlayframeQT me
  776.   
  777.   if the movieRate of sprite pQTSprite = 1 then go the frame
  778.   
  779. end
  780. ----------------------------------------------
  781. on mDisplaynotes me
  782.   
  783.   if soundBusy(2) then sound stop 2
  784.   go frame "notes"
  785.   mSetBackOutCursors (me )
  786.   
  787.   
  788. end mDisplaynotes
  789. ----------------------------------------------
  790. on mDisplayPicture me 
  791.   
  792.   if soundBusy(2) then sound stop 2
  793.   
  794.   set the text of cast pDescriptionTextCast = " "
  795.   set the text of cast pInstructionTextCast = the text of cast "BYS Edison Pict"
  796.   mUnSetCursors (gUtilityObj)
  797.   go frame "showPicture"
  798.   mSetBackOutCursors (me )
  799.   
  800. end 
  801. ----------------------------------------------------------------------------ò
  802. --------------------------------------------------------------------<<ò>>
  803. --JOURNAL RELATED METHODS
  804. --------------------------------------------------------------------<<ò>>
  805. on mSwitchToJournal me
  806.   
  807.   if soundBusy (2) then sound stop (2)
  808.   -- puppets
  809.   puppetSprite pMercBottleSprite, false
  810.   puppetSprite pBulbSprite, false
  811.   puppetSprite pBulbRackSprite, false
  812.   puppetSprite pQTSprite, false
  813.   puppetSprite pResultLabelSprite, false
  814.   puppetSprite 16, false 
  815.   
  816.   set the locv of sprite pQTSprite = -1000
  817.   
  818.   -- cursors
  819.   mUnSetCursors (gUtilityObj)
  820.   mClearText (me)
  821.   
  822.   go frame "LB_Jrnl"
  823.   
  824. end mSwitchToJournal
  825. --------------------------------------------------------------------<<ò>>
  826. on mSwitchToBIY me
  827.   
  828.   go frame "LBBaseState"
  829.   
  830.   puppetSprite pMercBottleSprite, true
  831.   set whichStepIndex = 6 - pVacuumLevel
  832.   set tempV = getPropAt(pMercStepVHList, whichStepIndex)
  833.   set the locV of sprite pMercBottleSprite = tempV
  834.   set the locH of sprite pMercBottleSprite = getAProp(pMercStepVHList, tempV)
  835.   
  836.   puppetSprite pBulbSprite, true
  837.   puppetSprite pBulbRackSprite, true
  838.   
  839.   set the castNum of sprite pBulbSprite = pBulbOutCast
  840.   set the castNum of sprite pBulbRackSprite = pFullBulbRackCast
  841.   
  842.   
  843. end mSwitchToBIY
  844. --------------------------------------------------------------------<<ò>>
  845. on mReviewExperiment me, argRowClicked, argCollumClicked
  846.   
  847.   set pVacuumLevel = argCollumClicked
  848.   set pCurrentBulbNum = argRowClicked
  849.   
  850.   go frame "LBBaseState"
  851.   puppetSprite pMercBottleSprite, true
  852.   puppetSprite pBulbSprite, true
  853.   puppetSprite pBulbRackSprite, true
  854.   -----------
  855.   --SET MERCURY BOTTLE LOCATION
  856.   set whichStepIndex = 6 - pVacuumLevel
  857.   set tempV = getPropAt(pMercStepVHList, whichStepIndex)
  858.   set the locV of sprite pMercBottleSprite = tempV
  859.   set the locH of sprite pMercBottleSprite = getAProp(pMercStepVHList, tempV)
  860.   -----------
  861.   --SET PROPER LIGHTBULB TRAY PICT
  862.   set the castNum of sprite pBulbRackSprite = pFullBulbRackCast + pCurrentBulbNum
  863.   -----------
  864.   updateStage
  865.   
  866.   if soundBusy(2) then sound stop 2
  867.   go frame "flipSwitch"
  868.   mUnSetCursors (gUtilityObj)
  869.   
  870. end mReviewExperiment
  871. --------------------------------------------------------------------<<ò>>
  872. on mDiscloseCorrectX me
  873.   
  874.   return pCorrectVaccumLevel
  875.   
  876. end mDiscloseCorrectX
  877. --------------------------------------------------------------------<<ò>>
  878. on mDiscloseCorrectY me
  879.   
  880.   return pCorrectBulbNum
  881.   
  882. end mDiscloseCorrectY
  883. --------------------------------------------------------------------<<ò>>
  884. on mDiscloseTestRecord me
  885.   
  886.   return pLBExperimentRecordList
  887.   
  888. end mDiscloseTestRecord
  889. --------------------------------------------------------------------<<ò>>
  890. --------------------------------------------------------------------<<ò>>
  891. --------------------------------------------------------------------<<ò>>
  892.