home *** CD-ROM | disk | FTP | other *** search
- global gMoviePal, gActualRate, gAnimsButtons, gRunningMovie, gLstAnimPals, gLstAnimHS, gPictLocV, gCurrAnimation, gGoldenRate, gCurrentScreen
-
- on ResetAnimHS
- set gMovieAction to #None
- set gMoviePal to #PlayMoins
- set the castNum of sprite 35 to 10985
- set gAnimsButtons to []
- set gActualRate to gGoldenRate
- updateStage()
- end
-
- on FlushAllAnimationsData
- set QtyAnimPals to count(gLstAnimPals)
- if QtyAnimPals = 1 then
- MovieStop(getAt(gRunningMovie, 2))
- HideFirstPalette()
- else
- if QtyAnimPals = 2 then
- MovieStop(getAt(gRunningMovie, 2))
- HideSecondPalette()
- HideFirstPalette()
- end if
- end if
- set gMoviePal to #PlayMoins
- updateStage()
- end
-
- on PlayRalenti AnimHS, Direction
- if getAt(gRunningMovie, 1) = #stop then
- modifySpecialItemCursors(1)
- watchCursor()
- end if
- if getAt(gRunningMovie, 3) = #end then
- if Direction = #FORWARD then
- set Direction to #BACKWARD
- else
- set Direction to #FORWARD
- end if
- end if
- set ActualHS to getAt(gLstAnimHS, AnimHS)
- set HsPos to getAt(ActualHS, 1)
- set MoviePos to getAt(ActualHS, 2)
- set CastNo to getAt(ActualHS, 3)
- set QtSpriteNo to getAt(getAt(ActualHS, 4), 2)
- set PictSpriteNo to getAt(getAt(ActualHS, 4), 1)
- if gActualRate = gGoldenRate then
- set gMovieMode to #play
- else
- set gMovieMode to #SLOW
- end if
- if gMovieMode = #SLOW then
- set gMovieMode to #play
- set gActualRate to gGoldenRate
- else
- set gMovieMode to #SLOW
- set gActualRate to gGoldenRate / 2
- end if
- if Direction = #BACKWARD then
- set NewRate to -gActualRate
- else
- set NewRate to gActualRate
- end if
- set the movieRate of sprite QtSpriteNo to NewRate
- repeat while (the movieTime of sprite QtSpriteNo = the duration of cast CastNo) and (getAt(gRunningMovie, 1) = #stop)
- nothing()
- end repeat
- modifySpecialItemCursors(0)
- cursor(0)
- set gRunningMovie to [gMovieMode, AnimHS, getAt(gRunningMovie, 3)]
- end
-
- on PlayOneStep AnimHS, Direction
- set ActualHS to getAt(gLstAnimHS, AnimHS)
- set QtSpriteNo to getAt(getAt(ActualHS, 4), 2)
- set PictSpriteNo to getAt(getAt(ActualHS, 4), 1)
- set type to getAt(getAt(gLstAnimHS, AnimHS), 5)
- set ActualTime to the movieTime of sprite QtSpriteNo
- set MovieDuration to the duration of cast getAt(getAt(gLstAnimHS, getAt(gRunningMovie, 2)), 3)
- set the movieRate of sprite QtSpriteNo to 0
- if Direction = #FORWARD then
- if ActualTime < (MovieDuration - 59) then
- set the movieTime of sprite QtSpriteNo to ActualTime + 60
- else
- if type = #loop then
- set the movieTime of sprite QtSpriteNo to 0
- else
- set the movieTime of sprite QtSpriteNo to MovieDuration
- updateStage()
- end if
- end if
- else
- if Direction = #BACKWARD then
- if (ActualTime - 59) > 0 then
- set the movieTime of sprite QtSpriteNo to ActualTime - 60
- else
- if type = #loop then
- set the movieTime of sprite QtSpriteNo to MovieDuration
- else
- if getAt(gRunningMovie, 3) = #end then
- set the movieTime of sprite QtSpriteNo to 0
- updateStage()
- else
- set the movieTime of sprite QtSpriteNo to 0
- updateStage()
- end if
- end if
- end if
- else
- alert("Un mauvais paramètre a été passé à la fonction PlayOneStep:" && Direction)
- end if
- end if
- end
-
- on PlayMovie HsNo, Direction
- if getAt(gRunningMovie, 1) = #stop then
- modifySpecialItemCursors(1)
- watchCursor()
- end if
- if getAt(gRunningMovie, 3) = #end then
- if Direction = #FORWARD then
- set Direction to #BACKWARD
- else
- set Direction to #FORWARD
- end if
- end if
- set ActualHS to getAt(gLstAnimHS, HsNo)
- set QtSpriteNo to getAt(getAt(ActualHS, 4), 2)
- set PictSpriteNo to getAt(getAt(ActualHS, 4), 1)
- set HsPos to getAt(ActualHS, 1)
- set MoviePos to getAt(ActualHS, 2)
- set CastNo to getAt(ActualHS, 3)
- set MovieMode to getAt(gRunningMovie, 1)
- set NewRate to gActualRate
- if (getAt(gRunningMovie, 1) = #stop) and (getAt(gRunningMovie, 3) = #end) then
- set the movieTime of sprite QtSpriteNo to the duration of cast CastNo
- end if
- if Direction = #BACKWARD then
- set NewRate to -NewRate
- end if
- if (MovieMode = #play) or (MovieMode = #SLOW) or (MovieMode = #SLOWSTEP) then
- set gMovieMode to #pause
- SetgRunningMovie(#pause, HsNo, getAt(gRunningMovie, 3))
- set the movieRate of sprite QtSpriteNo to 0
- else
- SetgRunningMovie(#play, HsNo, getAt(gRunningMovie, 3))
- set the movieRate of sprite QtSpriteNo to NewRate
- end if
- repeat while (the movieTime of sprite QtSpriteNo = the duration of cast CastNo) and (getAt(gRunningMovie, 1) = #stop)
- nothing()
- end repeat
- modifySpecialItemCursors(0)
- cursor(0)
- end
-
- on MovieStop HsNo
- if getAt(gRunningMovie, 1) = #stop then
- return
- end if
- set ActualHS to getAt(gLstAnimHS, HsNo)
- set HsPos to getAt(ActualHS, 1)
- set MoviePos to getAt(ActualHS, 2)
- set CastNo to getAt(ActualHS, 3)
- set QtSpriteNo to getAt(getAt(ActualHS, 4), 2)
- set PictSpriteNo to getAt(getAt(ActualHS, 4), 1)
- set type to getAt(ActualHS, 5)
- set gMovieMode to #stop
- set the movieTime of sprite QtSpriteNo to 0
- set the movieRate of sprite QtSpriteNo to 0
- set the movieTime of sprite QtSpriteNo to 0
- if type = #TOGGLE then
- if getAt(gRunningMovie, 3) = #end then
- set the movieTime of sprite QtSpriteNo to the duration of cast CastNo
- else
- set the movieTime of sprite QtSpriteNo to 0
- end if
- else
- set the movieTime of sprite QtSpriteNo to 0
- end if
- set gMoviePal to #PlayMoins
- SetGoodAnimPal(#stop)
- set gActualRate to gGoldenRate
- SetgRunningMovie(#stop, HsNo, getAt(gRunningMovie, 3))
- end
-
- on DoTransitionStart AnimNo, action
- set ActualHS to getAt(gLstAnimHS, AnimNo)
- set QtSpriteNo to getAt(getAt(ActualHS, 4), 2)
- set PictSpriteNo to getAt(getAt(ActualHS, 4), 1)
- set CastNo to getAt(ActualHS, 3)
- set type to getAt(ActualHS, 5)
- set LocHLocV to getAt(ActualHS, 7)
- set gPictLocV to the locV of sprite PictSpriteNo
- set gCurrAnimation to the castNum of sprite PictSpriteNo
- PrepAnimLabels()
- set the locH of sprite QtSpriteNo to getAt(LocHLocV, 1)
- set the locV of sprite QtSpriteNo to getAt(LocHLocV, 2)
- addRAMobjects(#CastList, [CastNo])
- set the castNum of sprite QtSpriteNo to CastNo
- if (type = #loop) or (type = #OneShotStart) or (type = #button) then
- if action = #STEPBACK then
- set the visible of sprite QtSpriteNo to 0
- updateStage()
- set the movieTime of sprite QtSpriteNo to the duration of cast getAt(ActualHS, 3) - 60
- set the visible of sprite QtSpriteNo to 1
- else
- updateStage()
- set the movieTime of sprite QtSpriteNo to 0
- end if
- updateStage()
- if type = #button then
- Wait2()
- end if
- else
- if type = #OneShotEnd then
- if action = #STEPBACK then
- set the visible of sprite QtSpriteNo to 0
- updateStage()
- set the movieTime of sprite QtSpriteNo to the duration of cast getAt(ActualHS, 3) - 60
- set the visible of sprite QtSpriteNo to 1
- updateStage()
- else
- updateStage()
- set the movieTime of sprite QtSpriteNo to 0
- end if
- else
- if type = #TOGGLE then
- updateStage()
- if getAt(gRunningMovie, 3) = #start then
- set the movieTime of sprite QtSpriteNo to 0
- else
- set the movieTime of sprite QtSpriteNo to the duration of cast CastNo
- end if
- else
- alert("Type invalide d'animation dans DoTransitionStart:" && type)
- end if
- end if
- end if
- end
-
- on DoTransitionStop AnimNo
- set ActualHS to getAt(gLstAnimHS, AnimNo)
- set QtSpriteNo to getAt(getAt(ActualHS, 4), 2)
- set PictSpriteNo to getAt(getAt(ActualHS, 4), 1)
- set CastNo to getAt(ActualHS, 3)
- addRAMobjects(#CastList, [CastNo])
- set the castNum of sprite QtSpriteNo to CastNo
- set type to getAt(ActualHS, 5)
- if (type = #loop) or (type = #OneShotStart) or (type = #button) then
- set PictCastNo to getAt(getAt(ActualHS, 6), 1)
- if type = #button then
- Wait2()
- end if
- flushQuickTime(QtSpriteNo)
- set the locV of sprite PictSpriteNo to gPictLocV
- updateStage()
- set the rect of sprite 45 to the rect of sprite QtSpriteNo
- set the movieTime of sprite QtSpriteNo to 0
- updateStage()
- DrawAll(1)
- setAnimLabels()
- else
- if type = #OneShotEnd then
- flushQuickTime(QtSpriteNo)
- setAnimLabels()
- else
- if type = #TOGGLE then
- set Mode to getAt(gRunningMovie, 3)
- if Mode = #start then
- set CoupeNo to 1
- else
- if Mode = #end then
- set CoupeNo to 2
- else
- alert("État invalide d'animation dans DoTransitionStop:" && Mode)
- end if
- end if
- addRAMobjects(#CastList, [gCurrentScreen])
- set tempPictData to getAt(value(line ((CoupeNo - 1) * 15) + 2 of field gCurrentScreen), 1)
- set TempNum to getAt(tempPictData, 1)
- addRAMobjects(#CastList, [TempNum])
- set the castNum of sprite PictSpriteNo to TempNum
- set the locH of sprite PictSpriteNo to getAt(tempPictData, 2)
- set the locV of sprite PictSpriteNo to getAt(tempPictData, 3)
- flushQuickTime(QtSpriteNo)
- createCutHotSpots(CoupeNo, PictSpriteNo)
- else
- alert("Type invalide d'animation dans DoTransitionStop:" && type)
- end if
- end if
- end if
- end
-
- on flushQuickTime QtSpriteNo
- set rectTemp to the rect of sprite QtSpriteNo
- set the locV of sprite QtSpriteNo to 1000
- set the rect of sprite 45 to rectTemp
- updateStage()
- set the locV of sprite 45 to 1000
- updateStage()
- end
-
- on ActivateSlowStep AnimHS, Direction
- if getAt(gRunningMovie, 3) = #end then
- if Direction = #FORWARD then
- set Direction to #BACKWARD
- else
- set Direction to #FORWARD
- end if
- end if
- set type to getAt(getAt(gLstAnimHS, AnimHS), 5)
- set gMovieMode to getAt(gRunningMovie, 1)
- if gMovieMode <> #SLOWSTEP then
- if ValidateActivateSlowStep(AnimHS, Direction) then
- StepMovieMouseDown(AnimHS, Direction)
- setAt(gRunningMovie, 1, #SLOWSTEP)
- SetGoodAnimPal(#SLOWSTEP)
- if (gMoviePal = #PlayPlus) or (gMoviePal = #PausePlus) then
- set gMoviePal to #PlayPlus
- set the castNum of sprite 35 to 10986
- else
- set gMoviePal to #PlayMoins
- set the castNum of sprite 35 to 10985
- end if
- updateStage()
- return
- end if
- end if
- end
-
- on ValidateActivateSlowStep AnimHS, Direction
- set ActualHS to getAt(gLstAnimHS, AnimHS)
- set type to getAt(ActualHS, 5)
- if type = #loop then
- return 1
- end if
- set MovieDuration to the duration of cast getAt(ActualHS, 3)
- set ActualTime to the movieTime of sprite getAt(getAt(ActualHS, 4), 2)
- if type = #TOGGLE then
- if (Direction = #FORWARD) and (MovieDuration > ActualTime) then
- return 1
- else
- if (Direction = #BACKWARD) and (ActualTime > 0) then
- return 1
- end if
- end if
- end if
- if (type = #OneShotEnd) or (type = #OneShotStart) then
- if (Direction = #BACKWARD) and (ActualTime > 0) then
- return 1
- else
- if (Direction = #FORWARD) and (ActualTime < MovieDuration) then
- return 1
- end if
- end if
- end if
- return 0
- end
-
- on stepMovie AnimHS, Direction
- set ActualHS to getAt(gLstAnimHS, AnimHS)
- set QtSpriteNo to getAt(getAt(ActualHS, 4), 2)
- set PictSpriteNo to getAt(getAt(ActualHS, 4), 1)
- set CastNo to getAt(ActualHS, 3)
- set MovieMode to getAt(gRunningMovie, 1)
- if getAt(gRunningMovie, 3) = #end then
- if Direction = #FORWARD then
- set Direction to #BACKWARD
- else
- set Direction to #FORWARD
- end if
- end if
- set HsPos to getAt(ActualHS, 1)
- set MoviePos to getAt(ActualHS, 2)
- set CastNo to getAt(ActualHS, 3)
- if MovieMode <> #step then
- set the movieRate of sprite QtSpriteNo to 0
- SetgRunningMovie(#step, AnimHS, getAt(gRunningMovie, 3))
- end if
- PlayOneStep(AnimHS, Direction)
- end
-