home *** CD-ROM | disk | FTP | other *** search
- on moveMovies me
- global gOriginPoint, gCPU
- if gCPU = #PC then
- exit
- end if
- alert("Hm, we're using moveMovies() on a PC... (tsk)")
- if (the castNum of sprite 44 = 7) and (the puppet of sprite 44 = 0) then
- set move_44 to 1
- end if
- if (the castNum of sprite 45 = 7) and (the puppet of sprite 45 = 0) then
- set move_45 to 1
- end if
- if move_44 = 1 then
- set oldLoc_44 to the loc of sprite 44
- end if
- if move_45 = 1 then
- set oldLoc_45 to the loc of sprite 45
- end if
- if move_44 = 1 then
- puppetSprite(44, 1)
- end if
- if move_45 = 1 then
- puppetSprite(45, 1)
- end if
- if move_44 = 1 then
- set the loc of sprite 44 to point(-3, -3) + gOriginPoint
- end if
- if move_45 = 1 then
- set the loc of sprite 45 to point(-3, -3) + gOriginPoint
- end if
- updateStage()
- if move_44 = 1 then
- set the loc of sprite 44 to oldLoc_44
- end if
- if move_45 = 1 then
- set the loc of sprite 45 to oldLoc_45
- end if
- updateStage()
- if move_44 = 1 then
- puppetSprite(44, 0)
- end if
- if move_45 = 1 then
- puppetSprite(45, 0)
- end if
- end
-
- on showCreditScreen me, optionSwitch
- global gCPU, domainIsReady, gOriginPoint, oMemory, gAmberPath, thisCursor, lastCursor, gFadeStash, gSoundStash, gSoundsSuspended
- set endGame to 0
- set gCurrentHotspot to #None
- set thisCursor to #pointer
- set lastCursor to #bogus
- cursorDance()
- installMenu(0)
- set domainIsReady to 0
- set the keyDownScript to "creditScreenKeys(oPuppeteer)"
- if voidp(the lsForegroundData of me) then
- set creditScreen to 26
- set creditMovie to 25
- set creditButtons to [#load: 27, #quit: 30, #resume: 29, #save: 28]
- else
- set creditScreen to getaProp(the lsForegroundData of me, #creditScreen)
- set creditMovie to getaProp(the lsForegroundData of me, #creditMovie)
- set creditButtons to getaProp(the lsForegroundData of me, #creditButtons)
- if gCPU = #PC then
- set pathDelim to "\"
- end if
- if gCPU = #Mac then
- set pathDelim to ":"
- end if
- set the fileName of cast creditMovie to gAmberPath & "ROXY" & pathDelim & "movies" & pathDelim & "credits.mov"
- if getState(oStoryteller, #currentLocation) = #garageEscape then
- set endGame to 1
- set blackBar to getaProp(the lsForegroundData of me, #blackBar)
- end if
- if voidp(creditScreen) then
- put "<!> showCreditScreens( oPuppeteer ): HEY! This domain seems to lack foreground data for the credit screen!"
- exit
- end if
- end if
- set mainVideo to 44
- set movieSprite to 45
- set bgSprite to 47
- puppetSprite(bgSprite, 1)
- set buttonSprite to 48
- puppetSprite(buttonSprite, 1)
- if optionSwitch <> #endGame then
- stashVidSprite(me)
- end if
- if optionSwitch = #endGame then
- set gFadeStash to #None
- else
- gammaFade(#down, #slow)
- end if
- set gSoundStash to gSoundsSuspended
- suspendSounds(#fadeOut)
- puppetSprite(movieSprite, 1)
- if endGame = 0 then
- set the loc of sprite mainVideo to point(-1000, -1000)
- end if
- set the volume of sprite mainVideo to 0
- installMenu(0)
- if endGame = 1 then
- unLoadCast()
- end if
- if objectp(oMemory) and (gCPU = #Mac) then
- oMemory(mCompact)
- end if
- set the castNum of sprite bgSprite to creditScreen
- set the loc of sprite bgSprite to point(320, 240) + gOriginPoint
- set the movieRate of sprite movieSprite to 0
- set the sound of cast creditMovie to 1
- set the castNum of sprite movieSprite to creditMovie
- set the loc of sprite movieSprite to point(320, 240) + gOriginPoint
- if endGame = 1 then
- set the castNum of sprite buttonSprite to blackBar
- set the loc of sprite buttonSprite to point(320, 450) + gOriginPoint
- else
- set the loc of sprite buttonSprite to point(-1000, -1000) + gOriginPoint
- repeat with cNum in creditButtons
- preLoadCast(cNum)
- end repeat
- end if
- gammaFade(#up, #slow)
- set the visible of sprite movieSprite to 1
- set the volume of sprite movieSprite to 255
- wait(60)
- set the movieTime of sprite movieSprite to 0
- updateStage()
- set the movieRate of sprite movieSprite to 1
- updateStage()
- end
-
- on resumeCurrentGame me
- global gCPU, domainIsReady, oMemory, gSoundStash
- if voidp(the lsForegroundData of me) then
- set creditScreen to 26
- set creditMovie to 25
- set creditButtons to [#load: 27, #quit: 30, #resume: 29, #save: 28]
- else
- set creditScreen to getaProp(the lsForegroundData of me, #creditScreen)
- set creditMovie to getaProp(the lsForegroundData of me, #creditMovie)
- set creditButtons to getaProp(the lsForegroundData of me, #creditButtons)
- if voidp(creditScreen) then
- put "<!> showCreditScreens( oPuppeteer ): HEY! This domain seems to lack foreground data for the credit screen!"
- exit
- end if
- end if
- set movieSprite to 45
- set bgSprite to 47
- set buttonSprite to 48
- set the movieRate of sprite movieSprite to 0
- installMenu(0)
- puppetSprite(movieSprite, 0)
- set the loc of sprite bgSprite to point(-1000, -1000)
- set the loc of sprite buttonSprite to point(-1000, -1000)
- puppetSprite(bgSprite, 0)
- puppetSprite(buttonSprite, 0)
- gammaFade(#down, #slow)
- go(the frame)
- unLoadCast(creditScreen)
- unLoadCast(creditMovie)
- repeat with cNum in creditButtons
- unLoadCast(cNum)
- end repeat
- if objectp(oMemory) and (gCPU = #Mac) then
- oMemory(mCompact)
- end if
- set the visible of sprite 44 to 0
- set the visible of sprite 45 to 0
- restoreVidSprite(me)
- gammaFade(#up, #slow, #resumeGame)
- if gSoundStash = 0 then
- restoreSounds(#fadeIn)
- end if
- cursorDance()
- end
-
- on buildProfile me, param, value
- alert("Hey! The buildProfile() method isn't done yet!")
- end
-
- on loadProfile me
- alert("Hey! The loadProfile() method isn't done yet!")
- end
-
- on saveProfile me
- alert("Hey! The saveProfile() method isn't done yet!")
- end
-
- on refreshVidSprites me
- set the visible of sprite 44 to not (the visible of sprite 44)
- set the visible of sprite 45 to not (the visible of sprite 45)
- set the visible of sprite 44 to not (the visible of sprite 44)
- set the visible of sprite 45 to not (the visible of sprite 45)
- updateStage()
- end
-
- on clickOnCreditScreen me, btnName
- global gOriginPoint, oStoryteller, gDeferredTransit
- set clickLoc to point(the mouseH, the mouseV)
- if getState(oStoryteller, #currentLocation) = #garageEscape then
- fadeCredits(me, #down)
- quitGame(oStoryteller)
- else
- if voidp(the lsForegroundData of me) then
- set creditButtons to [#load: 27, #save: 28, #resume: 29, #quit: 30]
- else
- set creditButtons to getProp(the lsForegroundData of me, #creditButtons)
- end if
- set buttonSprite to 48
- set offScreen to the loc of sprite buttonSprite
- set theButton to #None
- if the paramCount = 1 then
- set buttonArea to rect(126, 395, 501, 418)
- if inside(clickLoc, buttonArea) then
- set theButton to #load
- set xCoord to getAt(clickLoc, 1)
- if xCoord > 218 then
- set theButton to #save
- end if
- if xCoord > 314 then
- set theButton to #resume
- end if
- if xCoord > 408 then
- set theButton to #quit
- end if
- else
- exit
- end if
- else
- set theButton to btnName
- end if
- set the castNum of sprite buttonSprite to getProp(creditButtons, theButton)
- if theButton = #load then
- set the loc of sprite buttonSprite to point(169, 405)
- repeat while the mouseDown
- updateStage()
- end repeat
- set the loc of sprite buttonSprite to offScreen
- fadeCredits(me, #down)
- set the keyDownScript to EMPTY
- set gDeferredTransit to "-- dontIdle"
- set loadStatus to loadSavedGame(oStoryteller)
- if loadStatus = #cancelled then
- set the keyDownScript to "creditScreenKeys(oPuppeteer)"
- fadeCredits(me, #up)
- end if
- end if
- if theButton = #save then
- set the loc of sprite buttonSprite to point(263, 405)
- repeat while the mouseDown
- updateStage()
- end repeat
- set the loc of sprite buttonSprite to offScreen
- fadeCredits(me, #down)
- saveCurrentGame(oStoryteller, #saveAs)
- fadeCredits(me, #up)
- end if
- if theButton = #resume then
- set the loc of sprite buttonSprite to point(358, 405)
- repeat while the mouseDown
- updateStage()
- end repeat
- set the loc of sprite buttonSprite to offScreen
- fadeCredits(me, #down)
- set the keyDownScript to EMPTY
- resumeCurrentGame(me)
- end if
- if theButton = #quit then
- set the loc of sprite buttonSprite to point(452, 405)
- repeat while the mouseDown
- updateStage()
- end repeat
- set the loc of sprite buttonSprite to offScreen
- fadeCredits(me, #down)
- quitGame(oStoryteller)
- end if
- set the loc of sprite buttonSprite to point(-1000, -1000) + gOriginPoint
- end if
- end
-
- on stashVidSprite me
- global gStashedVideoProps, gVidViz
- set gStashedVideoProps to [:]
- set mainVideo to 44
- set vidSprite to 45
- set movieCastNum to the castNum of sprite vidSprite
- setaProp(gStashedVideoProps, #castNum, movieCastNum)
- setaProp(gStashedVideoProps, #puppeted, the puppet of sprite vidSprite)
- setaProp(gStashedVideoProps, #visible, the visible of sprite vidSprite)
- setaProp(gStashedVideoProps, #loc, the loc of sprite vidSprite)
- setaProp(gStashedVideoProps, #ink, the ink of sprite vidSprite)
- setaProp(gStashedVideoProps, #volume, the volume of sprite vidSprite)
- setaProp(gStashedVideoProps, #startTime, the startTime of sprite vidSprite)
- setaProp(gStashedVideoProps, #stopTime, the stopTime of sprite vidSprite)
- setaProp(gStashedVideoProps, #movieTime, the movieTime of sprite vidSprite)
- setaProp(gStashedVideoProps, #movieRate, the movieRate of sprite vidSprite)
- setaProp(gStashedVideoProps, #c_directToStage, the directToStage of cast movieCastNum)
- setaProp(gStashedVideoProps, #c_loop, the loop of cast movieCastNum)
- setaProp(gStashedVideoProps, #c_pausedAtStart, the pausedAtStart of cast movieCastNum)
- setaProp(gStashedVideoProps, #c_sound, the sound of cast movieCastNum)
- setaProp(gStashedVideoProps, #mainVideoLoc, the loc of sprite mainVideo)
- setaProp(gStashedVideoProps, #mainVideoVol, the volume of sprite mainVideo)
- setaProp(gStashedVideoProps, #mainVideoVisible, the visible of sprite mainVideo)
- set gVidViz to [the visible of sprite 44, the visible of sprite 45, the movieTime of sprite 45]
- end
-
- on restoreVidSprite me
- global gStashedVideoProps, gVoid
- set mainVideo to 44
- set vidSprite to 45
- puppetSprite(vidSprite, 1)
- set movieCastNum to getProp(gStashedVideoProps, #castNum)
- set the castNum of sprite vidSprite to movieCastNum
- set the loc of sprite vidSprite to point(-1000, -1000)
- set the visible of sprite vidSprite to 0
- set the ink of sprite vidSprite to getProp(gStashedVideoProps, #ink)
- set the volume of sprite vidSprite to getProp(gStashedVideoProps, #volume)
- set the startTime of sprite vidSprite to getProp(gStashedVideoProps, #startTime)
- set the stopTime of sprite vidSprite to getProp(gStashedVideoProps, #stopTime)
- set the movieRate of sprite vidSprite to getProp(gStashedVideoProps, #movieRate)
- set the movieTime of sprite vidSprite to getProp(gStashedVideoProps, #movieTime)
- set the directToStage of cast movieCastNum to getProp(gStashedVideoProps, #c_directToStage)
- set the loop of cast movieCastNum to getProp(gStashedVideoProps, #c_loop)
- set the pausedAtStart of cast movieCastNum to getProp(gStashedVideoProps, #c_pausedAtStart)
- set the sound of cast movieCastNum to getProp(gStashedVideoProps, #c_sound)
- set the loc of sprite vidSprite to getProp(gStashedVideoProps, #loc)
- set the movieTime of sprite vidSprite to getProp(gStashedVideoProps, #movieTime)
- set the puppet of sprite vidSprite to getProp(gStashedVideoProps, #puppeted)
- set the loc of sprite mainVideo to getProp(gStashedVideoProps, #mainVideoLoc)
- set the volume of sprite mainVideo to getProp(gStashedVideoProps, #mainVideoVol)
- moveMovies(me)
- set gStashedVideoProps to gVoid
- end
-
- on fadeCredits me, upOrDown
- set movieSprite to 45
- if upOrDown = #down then
- repeat while the volume of sprite movieSprite > 10
- wait(5)
- set the volume of sprite movieSprite to the volume of sprite movieSprite * 0.80000000000000004
- updateStage()
- end repeat
- set the volume of sprite movieSprite to 0
- set the movieRate of sprite movieSprite to 0
- updateStage()
- else
- set the visible of sprite movieSprite to 1
- set the movieRate of sprite movieSprite to 1
- set the volume of sprite movieSprite to 10
- updateStage()
- repeat while the volume of sprite movieSprite < 100
- wait(5)
- set the volume of sprite movieSprite to the volume of sprite movieSprite * 1.25
- updateStage()
- end repeat
- set the volume of sprite movieSprite to 255
- updateStage()
- end if
- end
-
- on creditScreenKeys me
- if charToNum(the key) = 27 then
- dontPassEvent()
- exit
- end if
- if the commandDown then
- set foo to the key
- if "Nn" contains the key then
- nothing()
- end if
- if "Ll" contains the key then
- clickOnCreditScreen(me, #load)
- end if
- if "SsAa" contains the key then
- clickOnCreditScreen(me, #save)
- end if
- if "Qq" contains the key then
- clickOnCreditScreen(me, #quit)
- end if
- end if
- dontPassEvent()
- end
-
- on readPrefsFile me
- global gProjectorPath, gGammaLevel, gCurrentGamma, gStopTransitions, gHorsepower
- set pFileName to "AMBERpref.ini"
- set fTest to new(xtra("fileio"))
- if not objectp(fTest) then
- exit
- end if
- put "<i> looking for .INI file in '" & getOSDirectory() & "'"
- openFile(fTest, getOSDirectory() & "\" & pFileName, 1)
- if error(fTest, status(fTest)) <> "OK" then
- put "<i> hmm, problem opening prefs file: " & error(fTest, status(fTest))
- set gHorsepower to #high
- else
- set prefsField to readFile(fTest)
- closefile(fTest)
- set iDelim to the itemDelimiter
- set the itemDelimiter to "="
- set storedVolume to value(the last item in line 1 of prefsField)
- if integerp(storedVolume) then
- if (storedVolume >= 0) and (storedVolume <= 7) then
- set the soundLevel to storedVolume
- end if
- end if
- set storedTransQuality to value("#" & the last item in line 2 of prefsField)
- if getPos([#Best, #Better, #None], storedTransQuality) <> 0 then
- toggleTransitions(storedTransQuality)
- end if
- set gHorsepower to #high
- set storedHorsepower to value(the last item in line 3 of prefsField)
- put "storedHorsepower = "
- put storedHorsepower
- if storedHorsepower = 1 then
- set gHorsepower to #low
- end if
- put "gHorsepower set to " & gHorsepower
- set the itemDelimiter to iDelim
- end if
- set fTest to 0
- end
-
- on writePrefsFile me
- global gProjectorPath, gTransQuality, gHorsepower
- set pFileName to "AMBERpref.ini"
- set outFile to new(xtra("fileio"))
- if not objectp(outFile) then
- exit
- end if
- createFile(outFile, getOSDirectory() & "\" & pFileName)
- set errMsg to error(outFile, status(outFile))
- if errMsg <> "OK" then
- if errMsg = "File already exists" then
- openFile(outFile, getOSDirectory() & "\" & pFileName, 0)
- delete(outFile)
- createFile(outFile, getOSDirectory() & "\" & pFileName)
- else
- put "<!> Error creating file: " & errMsg
- end if
- end if
- openFile(outFile, getOSDirectory() & "\" & pFileName, 2)
- set errMsg to error(outFile, status(outFile))
- if errMsg <> "OK" then
- put "<!> Error opening file: " & errMsg
- end if
- set currentPrefs to "volume = " & the soundLevel & RETURN & numToChar(10) & "transition = " & gTransQuality & RETURN & numToChar(10) & "performance = " & getPos([#low, #high], gHorsepower)
- put currentPrefs
- writeString(outFile, currentPrefs)
- set errMsg to error(outFile, status(outFile))
- if errMsg <> "OK" then
- put "<!> Error writing file: " & errMsg
- end if
- closefile(outFile)
- set errMsg to error(outFile, status(outFile))
- if errMsg <> "OK" then
- put "<!> Error closing file: " & errMsg
- end if
- set outFile to 0
- end
-