home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global RamsesWins, PlayerOneWins, PlayerTwoWins, WhoRolledLast, onIBM, timeCorrection
- set onIBM to the machineType = 256
- if onIBM then
- set timeCorrection to 30
- else
- set timeCorrection to 0
- end if
- set RamsesWins to 0
- set PlayerOneWins to 0
- set PlayerTwoWins to 0
- set WhoRolledLast to 2
- set the keyDownScript to "VolumeKeyPressed the key"
- end
-
- on checktimeFlash
- global startTime, timeCorrection
- if (the ticks - startTime) > (570 + timeCorrection) then
- go("Flash")
- end if
- end
-
- on VolumeKeyPressed QtyChar
- filterQuit(QtyChar)
- set QtyCharCode to charToNum(QtyChar)
- if (QtyCharCode >= 48) and (QtyCharCode <= 57) then
- set QtyNum to value(QtyChar)
- if QtyNum > 7 then
- set QtyNum to 7
- end if
- set the soundLevel to QtyNum
- end if
- end
-
- on filterQuit keyPressed
- global onIBM
- if onIBM then
- if the optionDown and (charToNum(keyPressed) = 27) then
- quit()
- end if
- if the commandDown and (the keyCode = 12) then
- quit()
- end if
- else
- if the commandDown and (the keyCode = 12) then
- quit()
- end if
- end if
- end
-
- on debug theString
- put theString
- end
-
- on setListOfPuppetsTo theList, trueOrFalse
- repeat with x = 1 to count(theList)
- puppetSprite(getAt(theList, x), trueOrFalse)
- end repeat
- end
-
- on PauseForThis ticksToPause
- set endTime to the ticks + ticksToPause
- set currTime to the ticks
- repeat while currTime < endTime
- set currTime to the ticks
- end repeat
- end
-
- on setCountDownTimer ticksToWait
- global endTime
- set endTime to the ticks + ticksToWait
- end
-
- on timeElapsed
- global endTime
- if the ticks > endTime then
- return 1
- else
- return 0
- end if
- end
-
- on PLaySound WhichSound
- puppetSound(WhichSound)
- updateStage()
- end
-
- on ShakeSprite
- repeat with x = 1 to 10
- set the locH of sprite the clickOn to the locH of sprite the clickOn + 10
- updateStage()
- set the locH of sprite the clickOn to the locH of sprite the clickOn - 10
- updateStage()
- end repeat
- end
-
- on playClick HowMany
- repeat with x = 1 to HowMany
- puppetSound("Click.1")
- updateStage()
- repeat while soundBusy(1)
- end repeat
- end repeat
- end
-
- on RamTaunt
- global theSenetGame, lastBoardScore, numberRamsesTaunts, ramsesTauntList
- if the computerPlayer of theSenetGame = 0 then
- exit
- end if
- repeat while soundBusy(1)
- end repeat
- if random(680) < lastBoardScore then
- if count(ramsesTauntList) = 0 then
- repeat with x = 1 to numberRamsesTaunts
- add(ramsesTauntList, x)
- end repeat
- end if
- set soundNumber to random(count(ramsesTauntList))
- set SoundFile to "RamsesTaunt." & getAt(ramsesTauntList, soundNumber)
- deleteAt(ramsesTauntList, soundNumber)
- puppetSound(SoundFile, 1)
- updateStage()
- end if
- repeat while soundBusy(1)
- end repeat
- end
-
- on RamAttack
- global theSenetGame, lastBoardScore, numberRamsesAttack, ramsesAttackList
- if the computerPlayer of theSenetGame = 0 then
- exit
- end if
- repeat while soundBusy(1)
- end repeat
- if random(680) < lastBoardScore then
- if count(ramsesAttackList) = 0 then
- repeat with x = 1 to numberRamsesAttack
- add(ramsesAttackList, x)
- end repeat
- end if
- set soundNumber to random(count(ramsesAttackList))
- set SoundFile to "RamsesAttack." & getAt(ramsesAttackList, soundNumber)
- deleteAt(ramsesAttackList, soundNumber)
- puppetSound(SoundFile, 1)
- updateStage()
- end if
- repeat while soundBusy(1)
- end repeat
- end
-
- on RamPissed
- global theSenetGame, lastBoardScore, numberRamsesPissed, ramsesPissedList
- if the computerPlayer of theSenetGame = 0 then
- exit
- end if
- repeat while soundBusy(1)
- end repeat
- if random(680) > lastBoardScore then
- if count(ramsesPissedList) = 0 then
- repeat with x = 1 to numberRamsesPissed
- add(ramsesPissedList, x)
- end repeat
- end if
- set soundNumber to random(count(ramsesPissedList))
- set SoundFile to "RamsesPissed." & getAt(ramsesPissedList, soundNumber)
- deleteAt(ramsesPissedList, soundNumber)
- puppetSound(SoundFile, 1)
- updateStage()
- end if
- repeat while soundBusy(1)
- end repeat
- end
-
- on RamYourMove
- global theSenetGame, numberRamsesYourMove, ramsesYourMoveList
- if the computerPlayer of theSenetGame = 0 then
- exit
- end if
- repeat while soundBusy(1)
- end repeat
- if random(6) = 6 then
- if count(ramsesYourMoveList) = 0 then
- repeat with x = 1 to numberRamsesYourMove
- add(ramsesYourMoveList, x)
- end repeat
- end if
- set soundNumber to random(count(ramsesYourMoveList))
- set SoundFile to "RamsesYourMove." & getAt(ramsesYourMoveList, soundNumber)
- deleteAt(ramsesYourMoveList, soundNumber)
- puppetSound(SoundFile, 1)
- updateStage()
- end if
- end
-
- on RamDontCheat
- repeat while soundBusy(1)
- end repeat
- if random(10) = 10 then
- PLaySound("Don'tCheat")
- end if
- end
-
- on HelpToggle
- puppetSound("SlideUp")
- updateStage()
- if the locV of sprite 38 = 409 then
- set VMount to 10
- else
- set VMount to -10
- end if
- repeat with x = 1 to 15
- set the locV of sprite 38 to the locV of sprite 38 + VMount
- updateStage()
- end repeat
- repeat while soundBusy(1)
- updateStage()
- end repeat
- if the locV of sprite 38 = 409 then
- puppetSound("Help.aif")
- end if
- end
-
- on PlayerToggle
- repeat while soundBusy(1)
- updateStage()
- end repeat
- puppetSound(0)
- puppetSound("SlideUp")
- updateStage()
- if the locV of sprite 39 = 409 then
- set VMount to 10
- set the visible of sprite 40 to 0
- set the visible of sprite 41 to 0
- else
- set VMount to -10
- end if
- repeat with x = 1 to 15
- set the locV of sprite 39 to the locV of sprite 39 + VMount
- updateStage()
- end repeat
- if VMount < 0 then
- set the visible of sprite 40 to 1
- set the visible of sprite 41 to 1
- end if
- updateStage()
- repeat while soundBusy(1)
- updateStage()
- end repeat
- sound stop 1
- end
-
- on EndTheGame whitePieces, blackPieces, compPlayer
- global RamsesWins, PlayerOneWins, PlayerTwoWins, returnToMovieStorage
- if compPlayer > 0 then
- if whitePieces = 0 then
- if the text of cast "Player 1" = "Light" then
- if compPlayer = 1 then
- set playerWon to 0
- else
- set playerWon to 1
- end if
- else
- if compPlayer = 2 then
- set playerWon to 0
- else
- set playerWon to 2
- end if
- end if
- else
- if the text of cast "Player 1" = "Dark" then
- if compPlayer = 1 then
- set playerWon to 0
- else
- set playerWon to 1
- end if
- else
- if compPlayer = 2 then
- set playerWon to 0
- else
- set playerWon to 2
- end if
- end if
- end if
- if playerWon = 0 then
- set RamsesWins to RamsesWins + 1
- set the text of cast "TheMsg" to "Ramses triumphs again!"
- if RamsesWins > 1 then
- puppetSound("#Ramses[2nd+++]Win.aif")
- else
- puppetSound("##RamsesWins/SFX")
- end if
- else
- if voidp(returnToMovieStorage) then
- set returnToMovieStorage to [:]
- end if
- setaProp(returnToMovieStorage, #senetBeat, 1)
- if playerWon = 1 then
- set PlayerOneWins to PlayerOneWins + 1
- else
- set PlayerTwoWins to PlayerTwoWins + 1
- end if
- set the text of cast "TheMsg" to "You beat Ramses!"
- if getaProp(returnToMovieStorage, #senetBeat) then
- puppetSound("###Ramses1stLoss.aif")
- else
- if PlayerTwoWins > 1 then
- puppetSound("YouBeatRamsesAgain")
- else
- puppetSound("###Ramses1stLoss.aif")
- end if
- end if
- end if
- updateStage()
- repeat while soundBusy(1)
- end repeat
- else
- if whitePieces = 0 then
- if the text of cast "Player 1" = "Light" then
- set playerWon to 1
- else
- set playerWon to 2
- end if
- else
- if the text of cast "Player 1" = "Dark" then
- set playerWon to 1
- else
- set playerWon to 2
- end if
- end if
- if playerWon = 1 then
- set PlayerOneWins to PlayerOneWins + 1
- set the text of cast "TheMsg" to "Player 1 wins!"
- else
- set PlayerTwoWins to PlayerTwoWins + 1
- set the text of cast "TheMsg" to "Player 2 wins!"
- end if
- puppetSound("##RamsesWins/SFX")
- updateStage()
- repeat while soundBusy(1)
- end repeat
- end if
- end
-
- on StartTheGame
- global theSenetGame, aFirstPlayerSelected, aMoveMade, gameOver, numberRamsesAttack, numberRamsesTaunts, numberRamsesPissed, numberRamsesYourMove, ramsesAttackList, ramsesTauntList, ramsesPissedList, ramsesYourMoveList
- set theSenetGame to birth(script "Senet Game Parent")
- set aFirstPlayerSelected to 0
- set aMoveMade to 1
- set numberRamsesTaunts to 21
- set numberRamsesAttack to 29
- set numberRamsesPissed to 37
- set numberRamsesYourMove to 16
- set ramsesTauntList to []
- set ramsesAttackList to []
- set ramsesPissedList to []
- set ramsesYourMoveList to []
- repeat with x = 1 to numberRamsesTaunts
- add(ramsesTauntList, x)
- end repeat
- repeat with x = 1 to numberRamsesAttack
- add(ramsesAttackList, x)
- end repeat
- repeat with x = 1 to numberRamsesPissed
- add(ramsesPissedList, x)
- end repeat
- repeat with x = 1 to numberRamsesYourMove
- add(ramsesYourMoveList, x)
- end repeat
- puppetSprite(23, 1)
- puppetSprite(24, 1)
- puppetSprite(38, 1)
- puppetSprite(39, 1)
- puppetSprite(40, 1)
- puppetSprite(41, 1)
- set the visible of sprite 40 to 0
- set the visible of sprite 41 to 0
- set the castNum of sprite 40 to the number of cast "Ramses Button Up"
- set the castNum of sprite 41 to the number of cast "Player Button Up"
- set the locH of sprite 40 to 157
- set the locV of sprite 40 to 403
- set the locH of sprite 41 to 474
- set the locV of sprite 41 to 403
- set the visible of sprite 48 to 0
- repeat with x = 4 to 18
- set the visible of sprite x to 1
- end repeat
- set the text of cast "TheMsg" to EMPTY
- repeat with x = 1 to 5
- set the visible of sprite getAt(the blackPiecesSpriteList of theSenetGame, x) to 1
- set the blend of sprite getAt(the blackPiecesSpriteList of theSenetGame, x) to 100
- set the visible of sprite getAt(the whitePiecesSpriteList of theSenetGame, x) to 1
- set the blend of sprite getAt(the whitePiecesSpriteList of theSenetGame, x) to 100
- end repeat
- set the visible of sprite 23 to 0
- set the visible of sprite 24 to 0
- end
-
- on resetDice Hloc
- global theSenetGame
- repeat with x = 1 to count(the diceSpriteList of theSenetGame)
- set the locH of sprite getAt(the diceSpriteList of theSenetGame, x) to Hloc + (x * 25)
- set the castNum of sprite getAt(the diceSpriteList of theSenetGame, x) to the number of cast "Dice Down.1"
- updateStage()
- end repeat
- end
-
- on hopPiece fromSquare, toSquare, spriteToHop
- global theSenetGame
- set fromLoc to getAt(the squareLocList of theSenetGame, fromSquare)
- set toLoc to getAt(the squareLocList of theSenetGame, toSquare)
- set fromH to getAt(fromLoc, 1)
- set fromV to getAt(fromLoc, 2)
- set toH to getAt(toLoc, 1)
- set toV to getAt(toLoc, 2)
- if toV = fromV then
- set horizon to abs(fromH - toH) / 2
- if fromH < toH then
- repeat with x = fromH to toH
- set the locH of sprite spriteToHop to x
- set the locV of sprite spriteToHop to toV - (horizon - abs(horizon - (x - fromH)))
- updateStage()
- end repeat
- else
- repeat with x = fromH down to toH
- set the locH of sprite spriteToHop to x
- set the locV of sprite spriteToHop to toV - (horizon - abs(horizon - (x - toH)))
- updateStage()
- end repeat
- end if
- else
- set horizon to abs(fromV - toV) / 2
- if fromV < toV then
- repeat with y = fromV to toV
- set the locV of sprite spriteToHop to y
- set the locH of sprite spriteToHop to toH - (horizon - abs(horizon - (y - fromV)))
- updateStage()
- end repeat
- else
- repeat with y = fromV down to toV
- set the locV of sprite spriteToHop to y
- set the locH of sprite spriteToHop to toH - (horizon - abs(horizon - (y - toV)))
- updateStage()
- end repeat
- end if
- end if
- puppetSound("click.1")
- updateStage()
- end
-