home *** CD-ROM | disk | FTP | other *** search
- on setGameJuice
- global gGameSol, gFrameCounter, gNumberOfMovesLeft, gMasterMoves, gGameState, gDifficultyLevel, gInactivities
- gFrameCounter = 0
- gGameSol = EMPTY
- TEMP = "123"
- gMasterMoves = EMPTY
- theOrder = "123"
- if (gDifficultyLevel <> 1) and (random(10) > 5) then
- theOrder = "213"
- end if
- case gDifficultyLevel of
- 1:
- maxUnits = 5
- repeat with i = 1 to 3
- put random(maxUnits) into item i of gGameSol
- end repeat
- put gGameSol into field "tempStore"
- 2:
- maxUnits = 5
- baseVal = 1 + random(maxUnits)
- repeat with i = 1 to 3
- put baseVal into item i of gGameSol
- end repeat
- if theOrder = "123" then
- whichGame = value(GetResponse(1, "123456"))
- myGame = item whichGame of "102,120,112,110,121,101"
- else
- whichGame = value(GetResponse(2, "123456"))
- myGame = item whichGame of "011,012,210,211,110,112"
- end if
- repeat with i = 1 to 3
- newVal = value(item i of gGameSol) + value(char i of myGame)
- put newVal into item i of gGameSol
- end repeat
- put gGameSol into field "tempStore"
- otherwise:
- theRatio = item random(10) of "122,221,212,112,121,211,124,214,421,241"
- case theRatio of
- "122", "221", "212", "112", "121", "211":
- factor = value(char random(2) of "24")
- "124", "214", "421", "241":
- factor = random(2)
- end case
- end case
- if gDifficultyLevel = 3 then
- repeat with i = 1 to 3
- put value(char i of theRatio) * factor into item i of gGameSol
- end repeat
- end if
- put theOrder into item 4 of gGameSol
- put gGameSol into field "tempStore"
- set the textStyle of field "tempStore" to "plain"
- if gDifficultyLevel = 3 then
- set the textStyle of item value(item 1 of gMasterMoves) of field "tempStore" to "bold"
- TEMP = field("tempStore")
- end if
- gGameState = "0,0,0," & theOrder
- SaytheMixture()
- if gDifficultyLevel = 2 then
- go("load")
- end if
- set the timeoutLength to 5 * 60
- set the timeoutScript to "JuiceInactivity"
- gInactivities = VOID
- end
-