-- Heat and Temperature Object Parent Script (oHeatTemp)
property pHeatCapacityList
property pBoilingPointList
property pVapoReactionList
property pTemp1
property pTemp2
property pFuel
property pInitialPositionX
property pInitialPositionY
property pLiquidStart
property pVessel1H
property pVessel1V
property pVessel2H
property pVessel2V
property pPad
property pVessel1
property pVessel2
property pMP3
property pVesselStart
property pBoilMovieStart
property pMixMovieStart
--mCalcMix
property pTestTemp1
property pTestTemp2
property pValue1
property pValue2
property pLiquid1
--mChangeTemp1
property pBoilingFlag1
property pNewTemp1
--mChangeTemp2
property pBoilingFlag2
property pNewTemp2
--mSetLiquid
property pNowMe
property pPosition
property pMixLiquidsButton
property pAlcoholContainer
property pWaterContainer
property pWaxContainer
property pBeaker1
property pBeaker2
property pStand1QT
property pStand2QT
property pStand1QTLoop
property pStand2QTLoop
property pStand1QTTarget
property pStand2QTTarget
property pStand1QTFlag
property pStand2QTFlag
property pStand1QTH
property pStand1QTV
property pStand2QTH
property pStand2QTV
property pMeltWaxFlag
property pFirstBoilFlag1
property pFirstBoilFlag2
property pFirstFlame
property pDraggableSprite -- the sprite that gets dragged when user selects a liquid
property pFlame1
property pFlame2
property pFlameCount
property pFlame1State -- #FIRE or #OUT
property pFlame2State -- #FIRE or #OUT
property pFlameMod
property pFlameDuration
property pMixCastList
property pFirstDigit
property pDigitSprite
property pDigitWidth
property pMixTemp
property pLogs1Dig
property pLogs2Dig
property pTemp1H
property pTemp1V
property pTemp2H
property pTemp2V
property pMixH
property pMixV
property pLog1H
property pLog1V
property pLog2H
property pLog2V
property pOldMiniBurner1
property pOldMiniBurner2
property pMixButtonSprite
property pMixButtonCast
-----------------------------
on mInit me
cursor 4
set pFirstFlame = the number of cast "IHTFIR1.PIC"
set pFirstDigit = the number of cast "IHTNUM0.PIC"
set pDigitSprite = 4 -- sprite channel
set pDigitWidth = 8 -- pixels
set pMixCastList = [#IHTALWT1: the number of cast "IHTALWT1.MOV", #IHTALWT2: the number of cast "IHTALWT2.MOV", #IHTALWT3: the number of cast "IHTALWT3.MOV", #IHTALWT4: the number of cast "IHTALWT4.MOV", #IHTALWX1: the number of cast "IHTALWX1.MOV", #IHTALWX2: the number of cast "IHTALWX2.MOV", #IHTALWX3: the number of cast "IHTALWX3.MOV", #IHTALWX4: the number of cast "IHTALWX4.MOV", #IHTWXWT1: the number of cast "IHTWXWT1.MOV", #IHTWXWT2: the number of cast "IHTWXWT2.MOV", #IHTWXWT3: the number of cast "IHTWXWT3.MOV", #IHTWXWT4: the number of cast "IHTWXWT4.MOV", #IHTMEAL1: the number of cast "IHTMEAL1.MOV", #IHTMEAL2: the number of cast "IHTMEAL2.MOV", #IHTMEAL3: the number of cast "IHTMEAL3.MOV", #IHTMEAL4: the number of cast "IHTMEAL4.MOV", #IHTMEWT1: the number of cast "IHTMEWT1.MOV", #IHTMEWT2: the number of cast "IHTMEWT2.MOV", #IHTMEWT3: the number of cast "IHTMEWT3.MOV", #IHTMEWT4: the number of cast "IHTMEWT4.MOV", #IHTMEWX1: the number of cast "IHTMEWX1.MOV", #IHTMEWX2: the number of cast "IHTMEWX2.MOV", #IHTMEWX3: the number of cast "IHTMEWX3.MOV", #IHTMEWX4: the number of cast "IHTMEWX4.MOV"]
set pMixButtonSprite = 8
set pMixButtonCast = the number of cast "MixButton.Op state"
set pBeaker1 = 13
set pBeaker2 = 14
set pStand1QT = 5
set pStand2QT = 6
set pFlame1 = 23
set pFlame2 = 24
-- establish lists init
set pHeatCapacityList = [.95,1.,.8,.445]
set pBoilingPointList = [78.,100.,324.,1000.]
set pVapoReactionList = [153.,414.,40.,1000.]
-- set melting point (for wax only) init
set pMP3 = 56
-- set initial values for vessels (value indicates which liquid it contains)
set pVessel1 = 0
set pVessel2 = 0
-- set the amount of pFuel added per click
set pFuel = 10
-- set the sprite location of the top liquid container
set pLiquidStart = 17
-- set castnum of first vessel pict
set pVesselStart = the number of cast "alcohol.pict"
-- set number of first boiling movie
set pBoilMovieStart = the number of cast "IHTALBL.MOV"
-- set number of first mix movie
set pMixMovieStart = the number of cast "IHTALWT1.MOV"
-- set up lists for initial positions of liquid containers
set pInitialPositionX = [4]
set pInitialPositionY = [4]
-- set positions of vessels
set pVessel1H = 255
set pVessel1V = 224
set pVessel2H = 558
set pVessel2V = 224
-- set the tolerance for locating a container on the burner
set pPad = 40
-- set fire parameters
set pFlameMod = 1
set pFlame1State = #OUT
set pFlame2State = #OUT
set pFlameDuration = 15 -- @15fps = 1 second
set pDraggableSprite = 21
set pMixTemp = 0
set pLogs1Dig = 0
set pLogs2Dig = 0
return me
end mInit
-----------------------------
on mActivate me
-- set puppetSprites
puppetSprite pMixLiquidsButton,true
puppetSprite pAlcoholContainer,true
puppetSprite pWaterContainer,true
puppetSprite pMercuryContainer,true
puppetSprite pWaxContainer,true
puppetSprite pFlame1,true
puppetSprite pFlame2,true
set pMeltWaxFlag = #NOMELT
set pFirstBoilFlag1 = #DONTBOIL
set pFirstBoilFlag2 = #DONTBOIL
-- get QT locations for burner stands
set pStand1QTH = the locH of sprite 5 -- pStand1QT
set pStand1QTV = the locV of sprite 5 -- pStand1QT
set pStand2QTH = the locH of sprite 6 -- pStand2QT
set pStand2QTV = the locV of sprite 6 -- pStand2QT
set pStand1QTFlag = #OFF
set pStand2QTFlag = #OFF
set the puppet of sprite pStand1QT = 1
set the puppet of sprite pStand2QT = 1
-- now move the QTs out of the way
set the loc of sprite pStand1QT = point(-100, -100)
set the loc of sprite pStand2QT = point(-100, -100)
-- turn off flames
set the visible of sprite pFlame1 to false
set the visible of sprite pFlame2 to false
-- set initial temps of vessels
set pTemp1 = 35
set pTemp2 = 35
-- constrain draggable sprite
set the constraint of sprite pDraggableSprite = 3
-- set initial positions of liquid containers
repeat with x = pLiquidStart to pLiquidStart+3
setAt(pInitialPositionX,x-16,the loch of sprite x)
setAt(pInitialPositionY,x-16,the locv of sprite x)
end repeat
set pTemp1H = the locH of sprite 7
set pTemp1V = the locV of sprite 7
set pTemp2H = the locH of sprite 8
set pTemp2V = the locV of sprite 8
set pMixH = the locH of sprite 9
set pMixV = the locV of sprite 9
set pLog1H = the locH of sprite 10
set pLog1V = the locV of sprite 10
set pLog2H = the locH of sprite 11
set pLog2V = the locV of sprite 11
cursor -1
end mActivate
-----------------------------
on mClose me
puppetSprite pMixLiquidsButton,false
puppetSprite pAlcoholContainer,false
puppetSprite pWaterContainer,false
puppetSprite pMercuryContainer,false
puppetSprite pWaxContainer,false
puppetSprite pFlame1,false
puppetSprite pFlame2,false
set the visible of sprite pMixLiquidsButton to true