Symbol 99 MovieClip [Tile] Frame 1
#initclip 11
Object.registerClass("Tile", com.midasplayer.mahjonggfortuna.Tile);
#endinitclip
Symbol 102 MovieClip [ScorePopup] Frame 1
#initclip 9
Object.registerClass("ScorePopup", com.midasplayer.mahjonggfortuna.ScorePopup);
#endinitclip
Symbol 123 MovieClip [GameArea] Frame 1
#initclip 10
Object.registerClass("GameArea", com.midasplayer.mahjonggfortuna.GameArea);
#endinitclip
Symbol 141 MovieClip [__Packages.com.midasplayer.mahjonggfortuna.ScorePopup] Frame 0
class com.midasplayer.mahjonggfortuna.ScorePopup extends MovieClip
{
var startTime, scoreText, x, y, _x, _y, _alpha, removeMovieClip;
function ScorePopup () {
super();
}
function init(x, y, score) {
startTime = getTimer();
scoreText.text = score;
this.x = x;
this.y = y;
_x = x;
_y = y;
}
function onEnterFrame() {
var _local3 = getTimer() - startTime;
var _local2 = _local3 / 500;
_y = y - (Math.sqrt(_local2) * 20);
_alpha = 100 - ((((_local2 * _local2) * _local2) * _local2) * 100);
if (_local3 > 500) {
removeMovieClip();
}
}
}
Symbol 142 MovieClip [__Packages.com.midasplayer.mahjonggfortuna.GameArea] Frame 0
class com.midasplayer.mahjonggfortuna.GameArea extends MovieClip
{
var score, level, state, communicator, shuffleButton, soundButton, endGameButton, lastTime, timeWarningTime, timeLeft, lastPairTimeLeft, toReveal, nextWarning, tiles, tileArray, xLowest, xHighest, yLowest, yHighest, attachMovie, xTileCenter, yTileCenter, timeWarning, warningShouldShuffle, revealTime, scoreText, scoreShadow, levelText, levelShadow, timeText, timeShadow, random, timerMask, selectedTile, highlightTime, clickables, getNextHighestDepth;
function GameArea () {
super();
score = 0;
level = 0;
_root.debugWarning._visible = DEBUG_MODE;
state = STATE_WAIT_FOR_GAMEDATA;
communicator = new com.midasplayer.mahjonggfortuna.Communicator();
_root.infoPanel.gotoAndStop(1);
_root.infoPanel.onPress = function () {
this._parent.gameArea.clickPanel();
};
shuffleButton.onPress = function () {
this._parent.shuffleClicked();
};
soundButton.onPress = function () {
com.midasplayer.mahjonggfortuna.SoundHolder.get("selectSound").play();
this._parent.toggleSound();
};
endGameButton.onPress = function () {
com.midasplayer.mahjonggfortuna.SoundHolder.get("selectSound").play();
this._parent.endGamePressed();
};
lastTime = getTimer();
timeWarningTime = -100000;
}
function endGamePressed() {
if (state < STATE_SHOW_GAME_OVER_SCREEN) {
com.midasplayer.mahjonggfortuna.SoundHolder.get("gameMusic").stop();
com.midasplayer.mahjonggfortuna.SoundHolder.get("gameOverMusic").play();
_root.infoPanel.gotoAndStop(2);
_root.infoPanel._visible = true;
communicator.sendEndGamePressed(timeLeft);
_root.infoPanel.header.text = _global.textMappings.game_over;
_root.infoPanel.subHeader.text = "";
_root.infoPanel.scoreText.text = _global.textMappings.score;
_root.infoPanel.bonusText.text = _global.textMappings.clearance_bonus;
_root.infoPanel.totalScoreText.text = _global.textMappings.total_score;
_root.infoPanel.scoreValue.text = "" + score;
_root.infoPanel.bonusValue.text = "0";
_root.infoPanel.totalScoreValue.text = "" + score;
doGameOver();
}
}
function toggleSound() {
com.midasplayer.mahjonggfortuna.SoundHolder.toggleSound();
if (com.midasplayer.mahjonggfortuna.SoundHolder.soundOn) {
soundButton.text.text = _global.textMappings.sound_off;
} else {
soundButton.text.text = _global.textMappings.sound_on;
}
}
function startRound(level) {
if (_global.relaxMode) {
level = 0;
}
levelCount++;
com.midasplayer.mahjonggfortuna.SoundHolder.get("gameMusic").playLooping();
com.midasplayer.mahjonggfortuna.SoundHolder.get("gameMusic").setVolume(20);
lastPairTimeLeft = 999999999 /* 0x3B9AC9FF */;
this.level = level;
if (_global.relaxMode) {
setupLevel(ALTERNATIVE_EASY_LEVELS[int(Math.random() * ALTERNATIVE_EASY_LEVELS.length)]);
} else {
setupLevel(communicator.levelDatas[level]);
}
shuffle();
var _local4 = 0;
while (_local4 < toReveal.length) {
toReveal[_local4].reveal();
_local4++;
}
toReveal = undefined;
calculateClickables();
_root.infoPanel._visible = false;
timeLeft = GAME_TIME[level];
state = STATE_PLAY_GAME;
}
function setupLevel(levelData) {
var _local4 = 0;
var _local14 = false;
var _local11 = new Array((WIDTH * HEIGHT) * DEPTH);
nextWarning = 9000;
tiles = new Array((WIDTH * HEIGHT) * DEPTH);
var _local13 = 0;
while (_local13 < levelData.length) {
var _local12 = BASE_64_CHARS.indexOf(levelData.charAt(_local13));
var _local10 = 0;
while (_local10 < _local12) {
_local11[_local4] = _local14;
_local4 = _local4 + 2;
if (_local4 >= ((WIDTH * HEIGHT) * DEPTH)) {
_local4 = 1;
}
_local10++;
}
if (_local12 < 63) {
_local14 = !_local14;
}
_local13++;
}
tileArray = new Array();
var _local9 = 0;
var _local8 = 0;
xLowest = WIDTH;
xHighest = 0;
yLowest = HEIGHT;
yHighest = 0;
var _local6 = 0;
while (_local6 < DEPTH) {
var _local3 = 0;
while (_local3 < HEIGHT) {
var _local2 = 0;
while (_local2 < WIDTH) {
_local4 = (_local2 + (_local3 * WIDTH)) + ((_local6 * WIDTH) * HEIGHT);
if (_local11[_local4]) {
if (_local2 > xHighest) {
xHighest = _local2;
}
if (_local3 > yHighest) {
yHighest = _local3;
}
if (_local2 < xLowest) {
xLowest = _local2;
}
if (_local3 < yLowest) {
yLowest = _local3;
}
var _local7 = (((_local2 * HEIGHT) + (_local3 * HEIGHT)) + _local3) + ((_local6 * WIDTH) * HEIGHT);
var _local5 = attachMovie("Tile", "tile" + _local7, _local7);
_local5.init(this, _local2, _local3, _local6, _local9);
tiles[_local4] = _local5;
tileArray.push(_local5);
_local8++;
if ((_local8 == 4) || (_local9 < 8)) {
_local8 = 0;
_local9++;
}
}
_local2++;
}
_local3++;
}
_local6++;
}
xTileCenter = (xLowest + xHighest) / 2;
yTileCenter = (yLowest + yHighest) / 2;
}
function onEnterFrame() {
com.midasplayer.util.TimeVerifier.checkTime();
var _local5 = getTimer() - timeWarningTime;
if (_local5 < 2000) {
timeWarning._alpha = (100 / ((_local5 * 0.002) + 1)) - (_local5 * 0.1);
timeWarning._visible = true;
if ((_local5 > 500) && (warningShouldShuffle)) {
warningShouldShuffle = false;
com.midasplayer.mahjonggfortuna.SoundHolder.get("shuffleSound").play();
shuffle();
}
} else {
timeWarning._visible = false;
}
if (toReveal != undefined) {
while (((getTimer() - revealTime) > 5) && (toReveal.length > 0)) {
toReveal.pop().reveal();
revealTime = revealTime + 5;
}
if (toReveal.length == 0) {
toReveal = undefined;
}
}
var _local6 = getTimer();
timeLeft = timeLeft - (_local6 - lastTime);
lastTime = _local6;
scoreText.text = (_global.textMappings.score + ": ") + score;
scoreShadow.text = (_global.textMappings.score + ": ") + score;
levelText.text = _global.textMappings.level.split("{0}").join(levelCount);
levelShadow.text = _global.textMappings.level.split("{0}").join(levelCount);
switch (state) {
case STATE_WAIT_FOR_GAMEDATA :
if (DEBUG_MODE) {
_root.gameData = DEBUG_GAME_DATA;
}
if (_root.gameData != undefined) {
communicator.parseGameData(_root.gameData);
timeLeft = 10000;
state = STATE_SHOW_INTRO_SCREEN;
communicator.gameStarted();
com.midasplayer.mahjonggfortuna.SoundHolder.get("introMusic").play();
_root.infoPanel.instructionsHeader.text = _global.textMappings.game_instructions;
_root.infoPanel.instructionsText.text = _global.textMappings.game_instructions_text;
shuffleButton.text.text = _global.textMappings.shuffle;
soundButton.text.text = _global.textMappings.sound_off;
endGameButton.text.text = _global.textMappings.end_game;
timeText.text = _global.textMappings.time;
timeShadow.text = _global.textMappings.time;
random = new com.midasplayer.util.Random(communicator.randomSeed);
_root.hiderMask._visible = false;
}
break;
case STATE_SHOW_INTRO_SCREEN :
var _local7 = Math.floor(timeLeft / 1000);
_root.infoPanel.timeMeter.text = _global.textMappings.time_to_start.split("{0}").join("" + (_local7 + 1));
if (timeLeft < 0) {
startRound(0);
}
break;
case STATE_PLAY_GAME :
timerMask._yscale = (timeLeft * 100) / GAME_TIME[level];
if (selectedTile != undefined) {
_local6 = getTimer() - highlightTime;
var _local4 = 1 / ((_local6 * 0.002) + 1);
_local4 = (((Math.cos(_local6 * 0.005) * 40) + 30) * (1 - _local4)) + (100 * _local4);
selectedTile.highlight._alpha = _local4;
}
if (timeLeft < nextWarning) {
nextWarning = nextWarning - 1000;
com.midasplayer.mahjonggfortuna.SoundHolder.get("timeTickSound").play();
}
if (timeLeft < 0) {
timeLeft = 0;
roundOver();
}
break;
case STATE_SHOW_NEXT_LEVEL_SCREEN :
if ((timeLeft < 5000) && (_root.infoPanel._visible == false)) {
com.midasplayer.mahjonggfortuna.SoundHolder.get("gameMusic").stop();
com.midasplayer.mahjonggfortuna.SoundHolder.get("levelOverMusic").play();
_root.infoPanel._visible = true;
}
_local7 = Math.floor(timeLeft / 1000);
_root.infoPanel.timeMeter.text = _global.textMappings.time_to_start.split("{0}").join("" + (_local7 + 1));
if (timeLeft < 0) {
startRound(1);
}
break;
case STATE_SHOW_GAME_OVER_SCREEN :
if ((timeLeft < 8000) && (_root.infoPanel._visible == false)) {
com.midasplayer.mahjonggfortuna.SoundHolder.get("gameMusic").stop();
com.midasplayer.mahjonggfortuna.SoundHolder.get("gameOverMusic").play();
_root.infoPanel._visible = true;
}
_local7 = Math.floor(timeLeft / 1000);
_root.infoPanel.timeMeter.text = _global.textMappings.time_to_exit.split("{0}").join("" + (_local7 + 1));
if (timeLeft >= 0) {
break;
}
state = STATE_GAME_OVER;
communicator.gameQuit(0);
}
}
function isClickable(x, y, z) {
if (getTile(x, y, z) == undefined) {
return(false);
}
var _local3 = -1;
while (_local3 <= 1) {
var _local2 = -1;
while (_local2 <= 1) {
if (getTile(x + _local3, y + _local2, z + 1) != undefined) {
return(false);
}
_local2++;
}
_local3++;
}
if (isSideFree(x, y, z, -1)) {
return(true);
}
if (isSideFree(x, y, z, 1)) {
return(true);
}
return(false);
}
function isSideFree(x, y, z, side) {
return(((getTile(x + (side * 2), y - 1, z) == undefined) && (getTile(x + (side * 2), y, z) == undefined)) && (getTile(x + (side * 2), y + 1, z) == undefined));
}
function getTile(x, y, z) {
if ((((((x < 0) || (y < 0)) || (z < 0)) || (x >= WIDTH)) || (y >= HEIGHT)) || (z >= DEPTH)) {
return(undefined);
}
return(tiles[(x + (y * WIDTH)) + ((z * WIDTH) * HEIGHT)]);
}
function freeTile(x, y, z) {
if ((((((x < 0) || (y < 0)) || (z < 0)) || (x >= WIDTH)) || (y >= HEIGHT)) || (z >= DEPTH)) {
return(undefined);
}
tiles[(x + (y * WIDTH)) + ((z * WIDTH) * HEIGHT)] = undefined;
}
function shuffleClicked() {
if ((state == STATE_PLAY_GAME) && (!warningShouldShuffle)) {
communicator.sendShuffle(timeLeft);
if (calculateFreePairs() > 0) {
com.midasplayer.mahjonggfortuna.SoundHolder.get("timeTickSound").play();
timeLeft = timeLeft - 20000;
timeWarningTime = getTimer();
warningShouldShuffle = true;
showPair();
} else {
com.midasplayer.mahjonggfortuna.SoundHolder.get("shuffleSound").play();
shuffle();
}
}
}
function shuffle() {
var _local10 = Math.abs(Math.floor(Math.random() * (((WIDTH - xHighest) + xLowest) - 3))) - xLowest;
var _local9 = Math.abs(Math.floor(Math.random() * (((HEIGHT - yHighest) + yLowest) - 2))) - yLowest;
_local10 = _local10 * 13;
_local9 = _local9 * 17;
if (selectedTile != undefined) {
selectedTile.highlight._visible = false;
selectedTile = undefined;
}
var _local5 = 0;
while (_local5 < tileArray.length) {
tileArray[_local5].updatePos(_local10, _local9);
_local5++;
}
var _local8 = 0;
do {
toReveal = new Array();
_local5 = 0;
while (_local5 < tileArray.length) {
var _local2 = random.nextInt(tileArray.length - _local5) + _local5;
var _local3 = tileArray[_local5].id;
var _local4 = tileArray[_local2].id;
tileArray[_local5].setId(_local4);
tileArray[_local2].setId(_local3);
tileArray[_local5].hide();
toReveal.push(tileArray[_local5]);
_local5++;
}
_local8++;
revealTime = getTimer();
} while ((calculateFreePairs() == 0) && (_local8 < 100));
_local5 = 0;
while (_local5 < toReveal.length) {
var _local7 = toReveal[_local5];
var _local6 = random(toReveal.length);
toReveal[_local5] = toReveal[_local6];
toReveal[_local6] = _local7;
_local5++;
}
}
function refreshTilesNear(x, y, z) {
var _local5 = x - 2;
while (_local5 <= (x + 2)) {
var _local4 = y - 1;
while (_local4 <= (y + 1)) {
var _local2 = z - 1;
while (_local2 <= z) {
var _local3 = getTile(_local5, _local4, _local2);
if (_local3 != undefined) {
_local3.calculateClickable();
}
_local2++;
}
_local4++;
}
_local5++;
}
}
function calculateClickables() {
var _local2 = 0;
while (_local2 < tileArray.length) {
tileArray[_local2].calculateClickable();
_local2++;
}
}
function showPair() {
var _local4 = -1;
var _local3 = 0;
while (_local3 < freeColors.length) {
if (freeColors[_local3] >= 2) {
_local4 = _local3;
}
_local3++;
}
var _local5 = 0;
_local3 = 0;
while ((_local3 < tileArray.length) && (_local5 < 2)) {
if (tileArray[_local3].isClickable()) {
var _local2 = tileArray[_local3].id;
if (_local2 < 4) {
_local2 = 0;
} else if (_local2 < 8) {
_local2 = 1;
}
if (_local2 == _local4) {
tileArray[_local3].showMiss();
_local5++;
}
}
_local3++;
}
}
function calculateFreePairs() {
var _local3 = 0;
while (_local3 < freeColors.length) {
freeColors[_local3] = 0;
_local3++;
}
_local3 = 0;
while (_local3 < tileArray.length) {
if (tileArray[_local3].isClickable()) {
var _local2 = tileArray[_local3].id;
if (_local2 < 4) {
_local2 = 0;
} else if (_local2 < 8) {
_local2 = 1;
}
freeColors[_local2]++;
}
_local3++;
}
var _local4 = 0;
_local3 = 0;
while (_local3 < freeColors.length) {
if (freeColors[_local3] != undefined) {
_local4 = _local4 + Math.floor(freeColors[_local3] / 2);
}
_local3++;
}
return(_local4);
}
function removeTile(tile) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < tileArray.length) {
if (tileArray[_local2] != tile) {
_local3.push(tileArray[_local2]);
}
_local2++;
}
tileArray = _local3;
}
function clickTile(tile) {
clickables = 0;
if (((state == STATE_PLAY_GAME) && (!warningShouldShuffle)) && (tile.isClickable())) {
highlightTime = getTimer();
var _local5 = 0;
if (selectedTile == undefined) {
selectedTile = tile;
selectedTile.highlight._visible = true;
com.midasplayer.mahjonggfortuna.SoundHolder.get("selectSound").play();
} else if (selectedTile == tile) {
com.midasplayer.mahjonggfortuna.SoundHolder.get("deselectSound").play();
selectedTile.highlight._visible = false;
selectedTile = undefined;
} else if (!selectedTile.matches(tile)) {
com.midasplayer.mahjonggfortuna.SoundHolder.get("selectSound").play();
selectedTile.highlight._visible = false;
selectedTile = tile;
selectedTile.highlight._visible = true;
} else {
com.midasplayer.mahjonggfortuna.SoundHolder.get("selectSound").play();
com.midasplayer.mahjonggfortuna.SoundHolder.get("comboSound").play();
if (_global.relaxMode) {
timeLeft = timeLeft + 2000;
if (timeLeft > GAME_TIME[level]) {
timeLeft = GAME_TIME[level];
}
}
freeTile(tile.x, tile.y, tile.z);
freeTile(selectedTile.x, selectedTile.y, selectedTile.z);
removeTile(tile);
removeTile(selectedTile);
tile.remove();
selectedTile.remove();
refreshTilesNear(tile.x, tile.y, tile.z);
refreshTilesNear(selectedTile.x, selectedTile.y, selectedTile.z);
var _local8 = lastPairTimeLeft - timeLeft;
var _local6 = (((5000 - _local8) * SPEED_BONUS[level]) / 5000) << 0;
if (_local6 < 0) {
_local6 = 0;
}
lastPairTimeLeft = timeLeft;
selectedTile = undefined;
_local5 = TILE_SCORE[level] + _local6;
var _local7 = getNextHighestDepth();
var _local9 = attachMovie("ScorePopup", "sp" + _local7, _local7);
_local9.init(tile._x + 13, tile._y + 17, _local5);
var _local3 = 0;
while (_local3 < tileArray.length) {
if (tileArray[_local3].isClickable()) {
clickables++;
}
_local3++;
}
}
score = score + _local5;
communicator.sendPieceClick(timeLeft, tile.x, tile.y, tile.z, _local5);
if ((clickables == 1) || (tileArray.length == 0)) {
roundOver();
}
}
}
function roundOver() {
_root.infoPanel.gotoAndStop(2);
var _local4 = tileArray.length == 0;
_root.infoPanel.scoreText.text = _global.textMappings.score;
_root.infoPanel.bonusText.text = _global.textMappings.clearance_bonus;
_root.infoPanel.totalScoreText.text = _global.textMappings.total_score;
_root.infoPanel.scoreValue.text = "" + score;
if (_local4) {
score = score + LEVEL_BONUS[level];
communicator.sendLevelOver(timeLeft, _local4, LEVEL_BONUS[level]);
_root.infoPanel.bonusValue.text = "" + LEVEL_BONUS[level];
} else {
communicator.sendLevelOver(timeLeft, _local4, 0);
_root.infoPanel.bonusValue.text = "0";
}
_root.infoPanel.totalScoreValue.text = "" + score;
if (timeLeft == 0) {
_root.infoPanel.header.text = _global.textMappings.time_out;
} else if (clickables == 1) {
_root.infoPanel.header.text = _global.textMappings.no_more_moves;
} else {
_root.infoPanel.header.text = _global.textMappings.level_cleared;
}
if ((level == 0) && (!_global.shortGameMode)) {
if (_local4) {
_root.infoPanel.subHeader.text = _global.textMappings.qualify;
} else {
_root.infoPanel.subHeader.text = _global.textMappings.not_qualify;
}
} else {
_root.infoPanel.subHeader.text = _global.textMappings.game_over;
}
var _local5 = level == 1;
if (_global.shortGameMode) {
_local5 = true;
}
if (_global.relaxMode) {
_local5 = false;
}
if (_local4 && (!_local5)) {
state = STATE_SHOW_NEXT_LEVEL_SCREEN;
timeLeft = 5500;
} else {
doGameOver();
}
}
function clickPanel() {
if ((state == STATE_SHOW_GAME_OVER_SCREEN) && (timeLeft >= 1)) {
timeLeft = 0;
}
if (((state == STATE_SHOW_INTRO_SCREEN) && (timeLeft < 9500)) || ((state == STATE_SHOW_NEXT_LEVEL_SCREEN) && (timeLeft < 4500))) {
com.midasplayer.mahjonggfortuna.SoundHolder.get("introMusic").stop();
timeLeft = 0;
}
}
function doGameOver() {
state = STATE_SHOW_GAME_OVER_SCREEN;
communicator.gameEnd(score);
timeLeft = 8500;
_root.infoPanel.gotoAndStop(2);
}
static var DEBUG_MODE = true;
static var DEBUG_GAME_DATA = (((((((((((((((((((("<gamedata randomseed=\"142752034\" timelimit=\"660\" relaxMode=\"true\"><level id=\"0\">S27251272152725127215191513531519151b151917171s3..D151r232s5u3...................n4..64u4.......................B</level><level id=\"1\">p2h1h1h1b241h1h1.41f19241f1f1f1e2.32h1h1t2..82A1f1e2.31.32..82.41.41.31..91.51......,2Z132a1f11e21h132.42..82Z132a1f11c41h132.42..82Z132a1f11a61h132.42..81,131b1f11881h131.51...91f1f115b1h1..o</level>" + "<text id=\"level\">LEVEL {0}</text>") + "<text id=\"game_instructions_text\">Clear away all the tiles in the formations by finding matching pairs. Tiles cannot be covered and have to be free on one side to be removeable. If you cannot find any pairs you may shuffle the tiles at any time, but if there were open pairs left on the board you will get a time penalty.</text>") + "<text id=\"round_over\">ROUND OVER</text>") + "<text id=\"time_to_start\">TIME TO START: {0}</text>") + "<text id=\"time\">Time</text>") + "<text id=\"time_out\">TIME OUT</text>") + "<text id=\"shuffle\">Shuffle</text>") + "<text id=\"clearance_bonus\">CLEARANCE BONUS</text>") + "<text id=\"no_more_moves\">NO MORE MOVES</text>") + "<text id=\"sound_off\">Sound off</text>") + "<text id=\"game_instructions\">GAME INSTRUCTIONS</text>") + "<text id=\"time_to_exit\">TIME TO EXIT: {0}</text>") + "<text id=\"sound_on\">Sound on</text>") + "<text id=\"game_over\">GAME OVER</text>") + "<text id=\"total_score\">TOTAL SCORE</text>") + "<text id=\"not_qualify\">YOU DID NOT QUALIFY</text>") + "<text id=\"score\">SCORE</text>") + "<text id=\"qualify\">YOU QUALIFIED FOR THE NEXT LEVEL</text>") + "<text id=\"end_game\">End game</text>") + "<text id=\"level_cleared\">LEVEL CLEARED</text>") + "</gamedata>";
static var ALTERNATIVE_EASY_LEVELS = ["W2b12122b1122191112211911221812122d2.....,1e211c12111c211f1....................d2d2212181221191122111912211b22121b2..41f112c11121c112e1...................j", "K2b422544221224422212442212244222121723112e1f111f1...82c321e211a321e2..........................i4c1f1w1...................8", "S27251272152725127215191513531519151b151917171s3..D151r232s5u3...................n4..64u4.......................B", "U232.w7s5t5.13..6131t5t5u3v3v3.....61............C242Z222918188..44..5141...J2................S", ".........y2c323c2.................f1f111f1e131e1d151d1c17161311111315353b1x1t9ob,1x1x1x1r1311111315353b1x1.................Z", "C181s2r363naX8...n181X8.....32..............y1s272q5Z9...Z1t12321Y7..................r", "p2h1h1h1b241h1h1.41f19241f1f1f1e2.31.32..82.41.................N2Z132a1f11e21h132.42..82Z132a1f116a1h132.42.................p", "i1719232c3v3vah16aQ16161j16161....U16161....................x169r131t131.L141.12z5t5,131.................E", "k272n272m4548131d111f1...q272n272E272n23132n272....................A464k464l363m1116111m1116111......................J", "l2v3d1y21312..35..91.P5...................p2w3h1Y6qa61a14136316161p181a4.y1.31j2.A4.................X", ".63d131t111177111f1B131t11132..M3u11111h6.0131t11132..M3.31.w1..............Y7r13121q141...V2i7r13121q141.................W", ".........y2c323c2.................f1f111f1e131e1d151d1c17161311111315353b1x1t9ob,1x1x1x1r1311111315353b1x1.................Z", "Y1x2x2pah16av2v2w1.C1x2x2x281212121e2v2v2w1.C1y1y1y1b12121f1w1w1w1...z1................3121.....l121...N1y1y1x1x1w1w1......k", ".X262X242...E262X242K2d222..R1.5161...............e272s1t22122t1u313s131...8252c1x1d232,131..s1p171t1u12121r7s131............g", "S1h1e211h1x2w8q8q8q1112111.J1h1e211h1x2w8q8q8q1112111............................................2", "B1818161a141c121a181b2c161a141e1c242q161q161a6.v1818161a141c121a181b2c161a141e1c242q161q161a6...K1..............t191.w1P1..T191.w1P1....z1.............o", "R1b1a1a1b15211111112o9p171b111b171p13131q7.K1b1a1a1b15211111112o11511p171b111b171p171..................K1114111.....f1114111....................j", ".o1b1W1111111r1111111r7s5..z1b1W151r151r7s5..................d1a161818161q8..D2.w1a161818161q8..D2................S", "..e2.....n2.m2....y1h1y1.............c2w212q8u1u2h2w2x1v5.i2w212q8u1u2h2.41v5.U1f1b511r1.W1x1...........u", ".b331h185k177j1723211p232Y2..b241912141x1x1f1W161..D2e121C1.................V242w2..S131b151b131b151b131b151Y252.U1y1.41w1.............2", ".F17121n181p1112111r6s6t121..A17121n181p1112111r6s6t121..A17121n181p1112111..............,121v11111v1....g121v11111v1....g121v11111.............T", ".G251p342v311q8s6r7..y251p342v311q8....................v1p1.51...T1p1.57r7.................5", ".3172e1215251413161611112318111616111123181116161111251611181413274m1..9171i16151m1112131t13171i12151m1417111n1..91O1O1O1O1...................71x1x1x1..................8", "S27251272152724227224191423532419151b151917171s3..k272512721527242272241914235324191514341q3..S1915111711151252151b1l1b1..............r4..64u4..E4...c2..o4.14v2.............D", "i1719232c3v3vah16aQ16161j16161q161U1719232c3v3v9Y8q161j16161q161U1719151c3v3v4.24u1x1x1.0171.............i169r131t131k18131...89Z131t131k18131...84.31x1x1..o2w2........y", "k272n272m4548131d111f1...q272n272m4548131d111f1...q272n272V2211122b1...q272n272.g1...q272n272......h464k464l363m1116111m1116111m1116111..v464k464m181.s1116111.Z363T1118111....8181U1c1........8", ".o1a1..Q141a161.......K121e2d222d2d222d2e121e2...t121.........m31391313171131311H591115111711511915182151251215121314541525271252151b1.t313d1d313J5s7r7r7s5..5212...............v", ".Xbnb.u7..k11311917197917197,5u3v3..E5.....U1......t1..o4s8pa.tap8,4...r6....M11211t4u4v2....h4u4....P2..z", ".o535a1a616a1a535.r353..w454a1a3211123a1a373.r272.,353.,191n1.5171..0191..........4444.Z444m444V262.s444.Z282m282V262.,282m1a1m1a1.31o181..0262.........N", ".9171c1J1115111U1313131k717.....a717..21...G535....F535m353....H353.N2a525a2J262V1214121.q626.e2a525a2...o626....E626............b", "m2e121e211b1q24121213121e2414121q11881h8s121j271213121e2W2e121e211b1q2419121e2414121q117917197t121j2e121e2W2e121e211b1q241c1e241..32h1e2W2h1e2...........B121t12121.w12121s121...a121.z121....g6a161a6............N", "p2h1h1h1b241h1h1.41f19241f1f1f1e2.32h1h1t2..82A1f1e2.31.32..82.41.41.31..91.51......,2Z132a1f11e21h132.42..82Z132a1f11c41h132.42..82Z132a1f11a61h132.42..81,131b1f11881h131.51...91f1f115b1h1..o", "U232.w7s5t5.13.y232Z7s5t5t5u3.y151,131t5t5t5u3v3..V131d3d131d3d131d3v3w1x1..X3v3v3w1.P242Z222918188..44.x242Z222...b2.z141...J2...........t", "q3c142b42254422122442221244222124422212211423112536121c112e121c112e1h1.Y113d1327413214241321121241321211241324151135111f1f1h1f1h1..w112b2112362211231415123415112....x1x1......................h1x1.............d", "j143a121318121131182113111612113118121318143.0341813121811311216111311281131121813121a341,39171912411712141117124117171d3.03d17171142171114121711421917193............................k3d131b11311b131d3.x3d131b11311b131d3...........M", ".....P2w3v4n22125n12126l22125t4u3v2...712121..............12w3v4ncmdlct4u3v2..B121u121u121..I2x2x2w3p12124u3v2v2v2.32y1y1w111w111u111w1w1v2......3", "Q34143S32323U515W333..51r24142U31313W333Y151.t15151r1s191r3s333Y151.....1151.....1151...433233TcV424X242.s2a2T23232V424X242..y1a1r2s181X242.....0242.......n", "...........................P2h1d311h1x2w9p9p9p1113111.H2h1d311h1x2w9p9p9p1113111.H2h1d311h1x2w9p9p9p1113111.H2h1d311h1x2w111111111Z12121..e1w2....1", ".71b1G5N1.2121Hb.I1b1G5N1.2121Hb.I1b1G5..Ab.I1b1..........31a161818161a14181a1n1818242c1d161p181c1a1a1.I1a161818161a14181a1n1818242c1d161p181c1a1a1.I1a161818161a14181a1n1818242q161p181n1a1.I1a161818161a14181a1n181........r", "A15151l1111111111111ldl1b1d2t212F1312121o17197.c15151l1111111111111ldl1b1d2t212F1312121o17197.c1b1l1117111l1b1l1b1o1j2I1312121o171a11111............11114111.L2d1a172d1a1s1..41114111.L2d1a172d1a1s1..4181.,18111m1a1s1............h", ".71b1W1111111r1111111r1111111q9r5..11b1W1111111r1111111r1111111q9r5..11b1..x9r5............h1a161818161pao181o181o181.x2Z1a161818161pao181o181o181.x2Z1a161818161pao181o181o181.x2...........c", "n3v322r322oas2s3h3c2h3v3t7K3v322r322oas2s3h3c2h3v3t7K3v321s321p9t2s3h3c2h3v3t7.............D3.....m3.....m3.............H", "K1h1y1x1x1x1w1525211u2o262.f4.07.w151Y16271.O1o541x1n641x1n151...11x1x1x1........d4t6h197h197h197r7Y2..21h166l1x157l157l1f1n161..l4.06,141Z161p1...........j", "D121v11111v1....g121v11111v1....g121v11111v1x1w111v111v111v111............i17121n18151c16111211171a18112119181811411r6s6s6t121Y17121n18151c16111211171a18112119181811411r6s6s6t121Y17121n18151c16111211171a1814191818161r141s141s141t121...........b", "..e1618181a1219121412141c141a162629141t4..T1618181a1219121412141c141a162629141t4..T161I14171c141a162629141t4............m351p3246151b11111418111f1x1v11111v1..8351p3246151b11111418111f1x1v11111v1..8351p11115o1111141q1b191b1v11111v1..g1v3x1........G", ".f311s3u412n1251251k8p971h9..5311s231r211q1f1...C13141n1w121t1w1.............H2e121e2e1218242d221.51e2..V4u4t22181r1111111p2111462h31311p2111112..71z1x1t11111s11112p111111111q1111121...........F", "D2e121c121115141114131413111213151511111412111111111112111a14111111112111121a11141211111111111418111611111123161h211f1.j2u121115161814131112111115151111141211111111111211181114111111112111121a11141211111111111d1116111112131o211..414151k1i35121j1a1m1a121u181a1o121........................41x1x1x1x1............u", "W2b12122b1122191112211911221812122d2.....,1e211c12111c211f1....................d2d2212181221191122111912211b22121b2..41f112c11121c112e1...................j", "K2b422544221224422212442212244222121723112e1f111f1...82c321e211a321e2..........................i4c1f1w1...................8", "S27251272152725127215191513531519151b151917171s3..D151r232s5u3...................n4..64u4.......................B", "U232.w7s5t5.13..6131t5t5u3v3v3.....61............C242Z222918188..44..5141...J2................S", ".........y2c323c2.................f1f111f1e131e1d151d1c17161311111315353b1x1t9ob,1x1x1x1r1311111315353b1x1.................Z", "C181s2r363naX8...n181X8.....32..............y1s272q5Z9...Z1t12321Y7..................r", "p2h1h1h1b241h1h1.41f19241f1f1f1e2.31.32..82.41.................N2Z132a1f11e21h132.42..82Z132a1f116a1h132.42.................p", "i1719232c3v3vah16aQ16161j16161....U16161....................x169r131t131.L141.12z5t5,131.................E", "k272n272m4548131d111f1...q272n272E272n23132n272....................A464k464l363m1116111m1116111......................J", "l2v3d1y21312..35..91.P5...................p2w3h1Y6qa61a14136316161p181a4.y1.31j2.A4.................X", ".63d131t111177111f1B131t11132..M3u11111h6.0131t11132..M3.31.w1..............Y7r13121q141...V2i7r13121q141.................W", ".........y2c323c2.................f1f111f1e131e1d151d1c17161311111315353b1x1t9ob,1x1x1x1r1311111315353b1x1.................Z", "S27251272152724227224191423532419151b151917171s3..k272512721527242272241914235324191514341q3..S1915111711151252151b1l1b1..............r4..64u4..E4...c2..o4.14v2.............D", "i1719232c3v3vah16aQ16161j16161q161U1719232c3v3v9Y8q161j16161q161U1719151c3v3v4.24u1x1x1.0171.............i169r131t131k18131...89Z131t131k18131...84.31x1x1..o2w2........y", "k272n272m4548131d111f1...q272n272m4548131d111f1...q272n272V2211122b1...q272n272.g1...q272n272......h464k464l363m1116111m1116111m1116111..v464k464m181.s1116111.Z363T1118111....8181U1c1........8", ".o1a1..Q141a161.......K121e2d222d2d222d2e121e2...t121.........m31391313171131311H591115111711511915182151251215121314541525271252151b1.t313d1d313J5s7r7r7s5..5212...............v", ".Xbnb.u7..k11311917197917197,5u3v3..E5.....U1......t1..o4s8pa.tap8,4...r6....M11211t4u4v2....h4u4....P2..z", ".o535a1a616a1a535.r353..w454a1a3211123a1a373.r272.,353.,191n1.5171..0191..........4444.Z444m444V262.s444.Z282m282V262.,282m1a1m1a1.31o181..0262.........N", ".9171c1J1115111U1313131k717.....a717..21...G535....F535m353....H353.N2a525a2J262V1214121.q626.e2a525a2...o626....E626............b", "m2e121e211b1q24121213121e2414121q11881h8s121j271213121e2W2e121e211b1q2419121e2414121q117917197t121j2e121e2W2e121e211b1q241c1e241..32h1e2W2h1e2...........B121t12121.w12121s121...a121.z121....g6a161a6............N", "p2h1h1h1b241h1h1.41f19241f1f1f1e2.32h1h1t2..82A1f1e2.31.32..82.41.41.31..91.51......,2Z132a1f11e21h132.42..82Z132a1f11c41h132.42..82Z132a1f11a61h132.42..81,131b1f11881h131.51...91f1f115b1h1..o", "U232.w7s5t5.13.y232Z7s5t5t5u3.y151,131t5t5t5u3v3..V131d3d131d3d131d3v3w1x1..X3v3v3w1.P242Z222918188..44.x242Z222...b2.z141...J2...........t", "q3c142b42254422122442221244222124422212211423112536121c112e121c112e1h1.Y113d1327413214241321121241321211241324151135111f1f1h1f1h1..w112b2112362211231415123415112....x1x1......................h1x1.............d", "j143a121318121131182113111612113118121318143.0341813121811311216111311281131121813121a341,39171912411712141117124117171d3.03d17171142171114121711421917193............................k3d131b11311b131d3.x3d131b11311b131d3...........M"];
static var BASE_64_CHARS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.";
static var STATE_WAIT_FOR_GAMEDATA = 0;
static var STATE_SHOW_INTRO_SCREEN = 1;
static var STATE_PLAY_GAME = 2;
static var STATE_SHOW_NEXT_LEVEL_SCREEN = 3;
static var STATE_SHOW_GAME_OVER_SCREEN = 4;
static var STATE_GAME_OVER = 5;
static var GAME_TIME = [180000, 420000];
static var TILE_SCORE = [10, 25];
static var SPEED_BONUS = [50, 100];
static var LEVEL_BONUS = [500, 1000];
static var WIDTH = 34;
static var HEIGHT = 20;
static var DEPTH = 5;
var levelCount = 0;
var freeColors = new Array(50);
}
Symbol 143 MovieClip [__Packages.com.midasplayer.mahjonggfortuna.Communicator] Frame 0
class com.midasplayer.mahjonggfortuna.Communicator
{
var levelDatas, randomSeed;
function Communicator () {
levelDatas = new Array();
}
function gameStarted() {
fscommand ("gameStart");
}
function gameEnd(score) {
if (!hasSentGameEnd) {
hasSentGameEnd = true;
fscommand ("gameEnd", score);
}
}
function gameQuit() {
if (!hasSentGameOver) {
hasSentGameOver = true;
fscommand ("gameQuit");
}
}
function sendPieceClick(timeLeft, x, y, z, scoreGained) {
fscommand ("playData", (((((((((CMD_CLICK_PIECE + ",") + timeLeft) + " ") + x) + " ") + y) + " ") + z) + "=") + scoreGained);
}
function sendShuffle(timeLeft) {
fscommand ("playData", ((CMD_SHUFFLE + ",") + timeLeft) + "=0");
}
function sendLevelOver(timeLeft, completed, scoreGained) {
fscommand ("playData", (((((CMD_LEVEL_OVER + ",") + timeLeft) + " ") + (completed ? "true" : "false")) + "=") + scoreGained);
}
function sendEndGamePressed(timeLeft) {
fscommand ("playData", ((CMD_END_GAME_PRESSED + ",") + timeLeft) + "=0");
}
function parseGameData(gameData) {
var _local6 = new XML(_root.gameData);
_global.shortGameMode = new String(_local6.childNodes[0].attributes.mode) == "short";
_global.relaxMode = new String(_local6.childNodes[0].attributes.relaxMode) == "true";
_global.textMappings = new Object();
var _local5 = _local6.childNodes[0].childNodes;
randomSeed = new Number(_local6.childNodes[0].attributes.randomseed).valueOf();
var _local4 = 0;
while (_local4 < _local5.length) {
_root.debugText.text = _root.debugText.text + ("\r" + _local5[_local4].nodeName);
if (_local5[_local4].nodeName == "text") {
_global.textMappings[_local5[_local4].attributes.id] = new String(_local5[_local4].firstChild.nodeValue);
}
if (_local5[_local4].nodeName == "level") {
levelDatas[_local5[_local4].attributes.id] = new String(_local5[_local4].firstChild.nodeValue);
}
_local4++;
}
}
static var CMD_CLICK_PIECE = 437;
static var CMD_SHUFFLE = 920;
static var CMD_LEVEL_OVER = 179;
static var CMD_END_GAME_PRESSED = 884;
var hasSentGameEnd = false;
var hasSentGameOver = false;
}
Symbol 144 MovieClip [__Packages.com.midasplayer.mahjonggfortuna.SoundHolder] Frame 0
class com.midasplayer.mahjonggfortuna.SoundHolder
{
static var globalSound;
var soundMc, sound;
function SoundHolder (ownerMc, soundName) {
var _local2 = ownerMc.getNextHighestDepth();
soundMc = ownerMc.createEmptyMovieClip("soundMcc" + _local2, _local2);
sound = new Sound(soundMc);
sound.attachSound(soundName);
}
static function get(resourceName) {
var _local2 = soundMap[resourceName];
if ((_local2 == undefined) || (_local2 == null)) {
_local2 = new com.midasplayer.mahjonggfortuna.SoundHolder(_root, resourceName);
soundMap[resourceName] = _local2;
}
return(_local2);
}
static function toggleSound() {
if (globalSound == undefined) {
globalSound = new Sound(_root);
}
soundOn = !soundOn;
globalSound.setVolume((soundOn ? 100 : 0));
}
function setVolume(volume) {
sound.setVolume(volume);
}
function playLooping() {
sound.start(0, 9999999);
}
function stopAndPlayOffs(offs) {
sound.stop();
sound.start(offs, 0);
}
function stopAndPlay() {
sound.stop();
sound.start(0);
}
function playOffs(offs) {
sound.start(offs, 0);
}
function play() {
sound.start(0);
}
function stop() {
sound.stop();
}
static var soundMap = new Object();
static var soundOn = true;
}
Symbol 145 MovieClip [__Packages.com.midasplayer.util.TimeVerifier] Frame 0
class com.midasplayer.util.TimeVerifier
{
static var startClientTime, startGetTimer;
function TimeVerifier () {
}
static function checkTime() {
var _local2 = _root.clientTime;
if (_local2 == undefined) {
_local2 = 0;
}
var _local3 = getTimer();
if (!hasStarted) {
startClientTime = _local2;
startGetTimer = _local3;
hasStarted = true;
}
var _local4 = Math.abs(_local2 - startClientTime) - (_local3 - startGetTimer);
if ((_root.clientTime != undefined) && (_local4 > 10000)) {
if (hasWarned) {
fscommand ("playData", ("007 " + int(_local4)) + "=0");
hasWarned = true;
}
}
}
static var hasStarted = false;
static var hasWarned = false;
}
Symbol 146 MovieClip [__Packages.com.midasplayer.util.Random] Frame 0
class com.midasplayer.util.Random
{
var mta, mti, lastSeed;
function Random (aSeed) {
mta = new Array(N);
mti = N + 1;
if (aSeed != undefined) {
init_genrand(aSeed);
}
}
function set seed(s) {
init_genrand(s);
//return(seed);
}
function get seed() {
return(lastSeed);
}
function nextInt(n) {
return((genrand_int32() & 2147483647) % n);
}
function nextFloat() {
return(next(24) / 16777216);
}
function next(bits) {
if (bits < 32) {
return(genrand_int32() & ((1 << bits) - 1));
}
return(genrand_int32());
}
function init_genrand(s) {
s = int(s);
trace("Random::init_genrand(): seed=" + s);
var _local5 = getTimer();
lastSeed = s;
mta[0] = s;
var _local2 = s;
var _local3 = new com.midasplayer.util.Integer64();
mti = 1;
while (mti < N) {
_local3.init32((_local2 >>> 30) ^ _local2);
_local3.mulu32(1812433253);
_local2 = (mta[mti] = int(_local3.lsb + mti));
mti++;
}
var _local6 = getTimer();
trace(("Random::init_genrand(): initialization ~" + (_local6 - _local5)) + "ms");
}
function genrand_int32() {
var _local3 = 0;
if (mti >= N) {
if (mti == (N + 1)) {
init_genrand(5489);
}
var _local4 = getTimer();
var _local2 = 0;
_local2 = 0;
while (_local2 < (N - M)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + M] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
while (_local2 < (N - 1)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + (M - N)] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
_local3 = (mta[N - 1] & UPPER_MASK) | (mta[0] & LOWER_MASK);
mta[N - 1] = (mta[M - 1] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
mti = 0;
var _local5 = getTimer();
trace(((("Random::genrand_int32(): precalc " + N) + " new numbers ~") + (_local5 - _local4)) + "ms");
}
_local3 = mta[mti++];
_local3 = _local3 ^ (_local3 >>> 11);
_local3 = _local3 ^ ((_local3 << 7) & 2636928640);
_local3 = _local3 ^ ((_local3 << 15) & 4022730752);
_local3 = _local3 ^ (_local3 >>> 18);
return(_local3);
}
static var N = 624;
static var M = 397;
static var MATRIX_A = 2567483615;
static var UPPER_MASK = 2147483648;
static var LOWER_MASK = 2147483647;
static var mag01 = [0, 2567483615];
}
Symbol 147 MovieClip [__Packages.com.midasplayer.util.Integer64] Frame 0
class com.midasplayer.util.Integer64
{
var r, p, s;
function Integer64 (lowInt) {
r = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]];
p = [0, 0, 0, 0, 0];
s = [0, 0, 0];
if (lowInt != undefined) {
merge(lowInt);
}
}
function init(v) {
var _local2 = 0;
while (_local2 < p.length) {
p[_local2] = v.p[_local2];
_local2++;
}
}
function init32(n) {
p[0] = n & 32767;
n = n >>> 15;
p[1] = n & 32767;
n = n >>> 15;
p[2] = n & 3;
p[3] = 0;
p[4] = 0;
}
function get lsb() {
return((p[0] | (p[1] << SH)) | ((p[2] & 3) << 30));
}
function get msb() {
return((((p[2] >> 2) | ((p[3] << SH) >> 2)) | ((p[4] << (SH * 2)) >> 2)) & 2147483647);
}
function binaryShiftLeft(step) {
var _local2 = 0;
while (_local2 < step) {
shl();
_local2++;
}
}
function binaryShiftRight(step) {
var _local4 = (step / SH) >> 0;
var _local5 = step - (_local4 * SH);
var _local2 = p.length - 1;
while (_local2 > 0) {
var _local3 = 0;
while (_local3 < _local4) {
p[_local3] = p[_local3 + 1];
_local3++;
}
p[_local2--] = 0;
}
if (_local5 > 0) {
var _local3 = 0;
while (_local3 < _local5) {
shr();
_local3++;
}
}
}
function binaryNot(o) {
p[0] = p[0] ^ o.p[0];
p[1] = p[1] ^ o.p[1];
p[2] = p[2] ^ o.p[2];
p[3] = p[3] ^ o.p[3];
p[4] = p[4] ^ o.p[4];
}
function add64(o) {
var _local4 = 0;
var _local3 = 1;
var _local2 = 0;
while ((_local3 < p.length) && (o.p[_local2] != 0)) {
_local3++;
}
_local2 = 0;
while (_local2 < _local3) {
_local4 = _local4 + (p[_local2] + o.p[_local2]);
p[_local2] = _local4 & MASK;
_local4 = _local4 >> SH;
_local2++;
}
}
function add32(num) {
var _local2 = 0;
var _local5 = num & MASK;
num = num >> SH;
var _local6 = num & MASK;
num = num >> SH;
var _local4 = num & 3;
_local2 = _local2 + (p[0] + _local5);
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[1] + _local6);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[2] + _local4);
p[2] = _local2 & MASK;
}
function mulu32(num) {
var _local3 = 0;
s[0] = num & MASK;
num = num >>> 15;
s[1] = num & MASK;
num = num >>> 15;
s[2] = num & 3;
var _local2 = 0;
while (_local2 < 3) {
var _local4 = s[_local2];
_local3 = _local4 * p[0];
r[_local2][0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[1]);
r[_local2][1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[2]);
r[_local2][2] = _local3 & 3;
_local2++;
}
_local3 = r[0][0];
p[0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (r[0][1] + r[1][0]);
p[1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local3 & 3;
p[3] = 0;
p[4] = 0;
}
function mul64(o) {
var _local2 = 0;
var _local3 = 0;
while (_local3 < 5) {
var _local4 = o.p[_local3];
_local2 = _local4 * p[0];
r[_local3][0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[1]);
r[_local3][1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[2]);
r[_local3][2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[3]);
r[_local3][3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[4]);
r[_local3][4] = _local2 & MASK;
_local3++;
}
_local2 = r[0][0];
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (r[0][1] + r[1][0]);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]);
p[3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]);
p[4] = _local2 & 7;
}
function mul32(value) {
mul64(new com.midasplayer.util.Integer64(value));
}
function merge(a) {
var _local2 = 0;
while (_local2 < 3) {
p[_local2] = p[_local2] + (a & 32767);
a = a >>> 15;
_local2++;
}
return(a);
}
function shl() {
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
var _local3 = p.length;
while (_local2 < _local3) {
_local5 = (p[_local2] & 16384) >> 14;
p[_local2] = p[_local2] << 1;
p[_local2] = (p[_local2] | _local4) & 32767;
_local2++;
_local4 = _local5;
}
}
function shr() {
var _local4 = 0;
var _local3 = 0;
var _local2 = p.length - 1;
while (_local2 >= 0) {
_local4 = (p[_local2] & 1) << 14;
p[_local2] = p[_local2] >> 1;
p[_local2] = (p[_local2] | _local3) & 32767;
_local2--;
_local3 = _local4;
}
}
static var MASK = 32767;
static var SH = 15;
}
Symbol 148 MovieClip [__Packages.com.midasplayer.mahjonggfortuna.Tile] Frame 0
class com.midasplayer.mahjonggfortuna.Tile extends MovieClip
{
var gameArea, x, y, z, highlight, highlight2, highlightMiss, hider, xOffs, yOffs, _x, _y, id, gotoAndStop, removeTime, onEnterFrame, useHandCursor;
function Tile () {
super();
}
function init(gameArea, x, y, z, newId) {
this.gameArea = gameArea;
this.x = x;
this.y = y;
this.z = z;
highlight._visible = false;
highlight2._visible = false;
highlight2._alpha = 33;
highlightMiss._visible = false;
highlightMiss._alpha = 50;
hider._visible = false;
updatePos(0, 0);
setId(newId);
}
function updatePos(xOffs, yOffs) {
this.xOffs = xOffs;
this.yOffs = yOffs;
_x = ((Math.floor((x * 26) / 2) + 24) - (z * 4)) + xOffs;
_y = ((Math.floor((y * 34) / 2) + 24) - (z * 4)) + yOffs;
}
function setId(newId) {
id = newId;
gotoAndStop(newId + 1);
}
function remove() {
removeTime = getTimer();
slide = 0;
if (gameArea.isSideFree(x, y, z, -1)) {
slide = slide - 1;
}
if (gameArea.isSideFree(x, y, z, 1)) {
slide = slide + 1;
}
onEnterFrame = function () {
var _local2 = (getTimer() - this.removeTime) * 0.01;
this._xscale = 100 * (((_local2 * _local2) * 0.5) + 1);
this._yscale = 100 / (_local2 + 1);
if (this.slide == 0) {
this._x = ((((Math.floor((this.x * 26) / 2) + 24) - (this.z * 4)) - ((15 * this._xscale) / 100)) + 15) + this.xOffs;
} else if (this.slide == -1) {
this._x = ((((Math.floor((this.x * 26) / 2) + 24) - (this.z * 4)) - ((30 * this._xscale) / 100)) + 30) + this.xOffs;
}
this._y = ((((Math.floor((this.y * 34) / 2) + 24) - (this.z * 4)) - ((19 * this._yscale) / 100)) + 19) + this.yOffs;
this._alpha = 100 - (_local2 * 50);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
onPress = undefined;
}
function onDragOver() {
onRollOver();
}
function onDragOut() {
onRollOut();
}
function onRollOver() {
if (isClickable()) {
highlight2._visible = true;
}
}
function onRollOut() {
if (isClickable()) {
highlight2._visible = false;
}
}
function matches(tile) {
if (tile.id == id) {
return(true);
}
if ((tile.id < 4) && (id < 4)) {
return(true);
}
if ((((tile.id >= 4) && (tile.id < 8)) && (id >= 4)) && (id < 8)) {
return(true);
}
return(false);
}
function calculateClickable() {
useHandCursor = isClickable();
}
function onPress() {
gameArea.clickTile(this);
}
function hide() {
hider._visible = true;
highlightMiss._visible = false;
}
function showMiss() {
highlightMiss._visible = true;
}
function reveal() {
hider._visible = false;
}
function isClickable() {
return(gameArea.isClickable(x, y, z));
}
var slide = 0;
}