Frame 1
function fPlaySnd(n, nRepeat) {
if (nRepeat == undefined) {
nRepeat = 1;
}
_root.SoundEng.play(n, 0, nRepeat, false);
_root.SoundEng.setAllVolume(_root.nSndVol);
}
function fStopSnd(n) {
_root.SoundEng.stop(n);
}
function fStopAllSnd() {
_root.SoundEng.stopAll();
}
function fChngVol4Snd(n) {
_root.nSndVol = _root.nSndVol + n;
_root.SoundEng.setAllVolume(_root.nSndVol);
}
function fMuteAll(b) {
if (b) {
_root.SoundEng.soundOff();
_root.bSoundOn = false;
} else {
_root.SoundEng.soundOn();
_root.bSoundOn = true;
}
}
function fReSO() {
_root.soData.flush();
}
function fInitSO() {
if (_root.soData.data.rang == undefined) {
_root.soData.data.rang = 0;
}
if (_root.soData.data.score == undefined) {
_root.soData.data.score = 0;
}
if (_root.soData.data.wins == undefined) {
_root.soData.data.wins = 0;
}
if (_root.soData.data.tries == undefined) {
_root.soData.data.tries = 0;
}
_root.nUserRang = 0;
_root.nTotalScore = _root.soData.data.score;
if (_root.nTotalScore >= 1000) {
_root.winstat.quest = true;
}
_root.nWins = _root.soData.data.wins;
_root.nTries = _root.soData.data.tries;
_root.fReSO();
}
var sVer = "1.1.0.1";
var soData;
var SoundEng = (new gdp.sound.WaveEngine(1));
var nSndBtn = SoundEng.addStream("btn", false);
var nSndCard2Fond = SoundEng.addStream("card2Fond", false);
var nSndCardPlaced = SoundEng.addStream("cardPlace", false);
var nSndCardTake = SoundEng.addStream("cardTake", false);
var nSndCardThrow = SoundEng.addStream("cardThrow", false);
var nSndPreThrow = SoundEng.addStream("preThrow", false);
var bSoundOn = true;
var b2G = false;
var bGameInProgress = false;
var bAction = true;
var bPaused = false;
var nShdwAlpha = 40;
var nLevel2Upsell = 2;
var sUrl = "http://www.myplaycity.com";
var sMoreGamesLink = "http://www.myplaycity.com";
var nStavka = 200;
var nPutFondScore = 5;
var nWinScore = 50;
var n2Rang = 1000;
var nTimedMins = 10;
var nTimeBonusMult = 50;
var aRangs = new Array();
var nGameMode = -1;
var nLastGameMode = 0;
var nWins = 0;
var nTries = 0;
var nLevelsDone = 0;
var winstat = {win:false, first:true, quest:false, relaxDone:0};
var nCurrentScore = 0;
var nTotalScore = 0;
var nTimeBonus = 0;
var nSndVol = 100;
stop();
_quality = "HIGH";
aRangs = ["Beginner", "Drummer", "Sentry", "Learner", "Advanced Learner", "Street Fighter", "Warrior's Servant", "Armour-Bearer", "Security Guard", "Wrestler", "Champion", "All-round Champion", "Samurai", "Lama", "Dragon"];
b2G = true;
soData = SharedObject.getLocal("MountainOnlineData", "/");
if (soData == null) {
this.createTextField("message", this.getNextHighestDepth(), 400, 500, 100, 22);
message.autoSize = "center";
message.text = "Shared Objects are disabled - game not continue";
message.selectable = false;
message.border = true;
message.borderColor = 16711680 /* 0xFF0000 */;
b2G = false;
} else {
if (soData.data.ver != sVer) {
soData.clear();
soData.data.ver = sVer;
}
fInitSO();
}
Frame 7
gotoAndStop ("Game");
Symbol 92 MovieClip Frame 1
stop();
Symbol 99 MovieClip [wndWin] Frame 1
#initclip 69
Object.registerClass("wndWin", CWin);
#endinitclip
Symbol 114 MovieClip [c00] Frame 1
#initclip 12
Object.registerClass("c00", CCard);
#endinitclip
Symbol 117 MovieClip [c10] Frame 1
#initclip 13
Object.registerClass("c10", CCard);
#endinitclip
Symbol 120 MovieClip [c30] Frame 1
#initclip 14
Object.registerClass("c30", CCard);
#endinitclip
Symbol 123 MovieClip [c20] Frame 1
#initclip 15
Object.registerClass("c20", CCard);
#endinitclip
Symbol 126 MovieClip [c01] Frame 1
#initclip 16
Object.registerClass("c01", CCard);
#endinitclip
Symbol 129 MovieClip [c11] Frame 1
#initclip 17
Object.registerClass("c11", CCard);
#endinitclip
Symbol 132 MovieClip [c31] Frame 1
#initclip 18
Object.registerClass("c31", CCard);
#endinitclip
Symbol 135 MovieClip [c21] Frame 1
#initclip 19
Object.registerClass("c21", CCard);
#endinitclip
Symbol 141 MovieClip [c02] Frame 1
#initclip 20
Object.registerClass("c02", CCard);
#endinitclip
Symbol 144 MovieClip [c12] Frame 1
#initclip 21
Object.registerClass("c12", CCard);
#endinitclip
Symbol 147 MovieClip [c32] Frame 1
#initclip 22
Object.registerClass("c32", CCard);
#endinitclip
Symbol 150 MovieClip [c22] Frame 1
#initclip 23
Object.registerClass("c22", CCard);
#endinitclip
Symbol 153 MovieClip [c03] Frame 1
#initclip 24
Object.registerClass("c03", CCard);
#endinitclip
Symbol 156 MovieClip [c13] Frame 1
#initclip 25
Object.registerClass("c13", CCard);
#endinitclip
Symbol 159 MovieClip [c33] Frame 1
#initclip 26
Object.registerClass("c33", CCard);
#endinitclip
Symbol 162 MovieClip [c23] Frame 1
#initclip 27
Object.registerClass("c23", CCard);
#endinitclip
Symbol 165 MovieClip [c04] Frame 1
#initclip 28
Object.registerClass("c04", CCard);
#endinitclip
Symbol 168 MovieClip [c14] Frame 1
#initclip 29
Object.registerClass("c14", CCard);
#endinitclip
Symbol 171 MovieClip [c34] Frame 1
#initclip 30
Object.registerClass("c34", CCard);
#endinitclip
Symbol 174 MovieClip [c24] Frame 1
#initclip 31
Object.registerClass("c24", CCard);
#endinitclip
Symbol 177 MovieClip [c05] Frame 1
#initclip 32
Object.registerClass("c05", CCard);
#endinitclip
Symbol 180 MovieClip [c15] Frame 1
#initclip 33
Object.registerClass("c15", CCard);
#endinitclip
Symbol 183 MovieClip [c35] Frame 1
#initclip 34
Object.registerClass("c35", CCard);
#endinitclip
Symbol 186 MovieClip [c25] Frame 1
#initclip 35
Object.registerClass("c25", CCard);
#endinitclip
Symbol 189 MovieClip [c06] Frame 1
#initclip 36
Object.registerClass("c06", CCard);
#endinitclip
Symbol 192 MovieClip [c16] Frame 1
#initclip 37
Object.registerClass("c16", CCard);
#endinitclip
Symbol 195 MovieClip [c36] Frame 1
#initclip 38
Object.registerClass("c36", CCard);
#endinitclip
Symbol 198 MovieClip [c26] Frame 1
#initclip 39
Object.registerClass("c26", CCard);
#endinitclip
Symbol 201 MovieClip [c07] Frame 1
#initclip 40
Object.registerClass("c07", CCard);
#endinitclip
Symbol 204 MovieClip [c17] Frame 1
#initclip 41
Object.registerClass("c17", CCard);
#endinitclip
Symbol 206 MovieClip [c37] Frame 1
#initclip 42
Object.registerClass("c37", CCard);
#endinitclip
Symbol 209 MovieClip [c27] Frame 1
#initclip 43
Object.registerClass("c27", CCard);
#endinitclip
Symbol 212 MovieClip [c08] Frame 1
#initclip 44
Object.registerClass("c08", CCard);
#endinitclip
Symbol 215 MovieClip [c18] Frame 1
#initclip 45
Object.registerClass("c18", CCard);
#endinitclip
Symbol 218 MovieClip [c38] Frame 1
#initclip 46
Object.registerClass("c38", CCard);
#endinitclip
Symbol 221 MovieClip [c28] Frame 1
#initclip 47
Object.registerClass("c28", CCard);
#endinitclip
Symbol 224 MovieClip [c010] Frame 1
#initclip 48
Object.registerClass("c010", CCard);
#endinitclip
Symbol 227 MovieClip [c110] Frame 1
#initclip 49
Object.registerClass("c110", CCard);
#endinitclip
Symbol 230 MovieClip [c310] Frame 1
#initclip 50
Object.registerClass("c310", CCard);
#endinitclip
Symbol 233 MovieClip [c210] Frame 1
#initclip 51
Object.registerClass("c210", CCard);
#endinitclip
Symbol 236 MovieClip [c011] Frame 1
#initclip 52
Object.registerClass("c011", CCard);
#endinitclip
Symbol 239 MovieClip [c111] Frame 1
#initclip 53
Object.registerClass("c111", CCard);
#endinitclip
Symbol 242 MovieClip [c311] Frame 1
#initclip 54
Object.registerClass("c311", CCard);
#endinitclip
Symbol 245 MovieClip [c211] Frame 1
#initclip 55
Object.registerClass("c211", CCard);
#endinitclip
Symbol 248 MovieClip [c09] Frame 1
#initclip 56
Object.registerClass("c09", CCard);
#endinitclip
Symbol 251 MovieClip [c19] Frame 1
#initclip 57
Object.registerClass("c19", CCard);
#endinitclip
Symbol 254 MovieClip [c39] Frame 1
#initclip 58
Object.registerClass("c39", CCard);
#endinitclip
Symbol 257 MovieClip [c29] Frame 1
#initclip 59
Object.registerClass("c29", CCard);
#endinitclip
Symbol 260 MovieClip [c012] Frame 1
#initclip 60
Object.registerClass("c012", CCard);
#endinitclip
Symbol 263 MovieClip [c112] Frame 1
#initclip 61
Object.registerClass("c112", CCard);
#endinitclip
Symbol 266 MovieClip [c312] Frame 1
#initclip 62
Object.registerClass("c312", CCard);
#endinitclip
Symbol 269 MovieClip [c212] Frame 1
#initclip 63
Object.registerClass("c212", CCard);
#endinitclip
Symbol 308 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 1
stop();
Symbol 316 MovieClip [UIBtns] Frame 1
#initclip 64
Object.registerClass("UIBtns", CUIBtns);
#endinitclip
Symbol 339 MovieClip [Game] Frame 1
#initclip 65
Object.registerClass("Game", CGame);
#endinitclip
Instance of Symbol 338 MovieClip in Symbol 339 MovieClip [Game] Frame 1
on (release) {
getURL (_root.sMoreGamesLink, "_blank");
}
Symbol 354 MovieClip [Instructions] Frame 1
#initclip 66
Object.registerClass("Instructions", CInstr);
#endinitclip
Instance of Symbol 352 MovieClip "mcScroller" in Symbol 354 MovieClip [Instructions] Frame 1
onClipEvent (mouseMove) {
if (this._parent.bDrag) {
updateAfterEvent(mouseMove);
}
}
Symbol 370 Button
on (release) {
getURL ("http://www.myplaycity.com/free_content", "_blank");
}
Symbol 373 Button
on (release) {
getURL ("http://www.myplaycity.com/online_games", "_blank");
}
Symbol 374 MovieClip [Menu] Frame 1
#initclip 67
Object.registerClass("Menu", CMenu);
#endinitclip
Instance of Symbol 338 MovieClip in Symbol 374 MovieClip [Menu] Frame 1
on (release) {
getURL (_root.sMoreGamesLink, "_blank");
}
Symbol 377 MovieClip Frame 1
stop();
Symbol 383 MovieClip [PreLoader] Frame 1
#initclip 68
Object.registerClass("PreLoader", CPreLoader);
#endinitclip
Symbol 384 MovieClip [__Packages.gdp.sound.WaveEngine] Frame 0
class gdp.sound.WaveEngine
{
var type, stack, debugOn, mute, _mc;
function WaveEngine (type, debugOn) {
this.type = ((type == undefined) ? 1 : (type));
stack = new Object();
this.debugOn = ((type == undefined) ? false : (debugOn));
mute = false;
init();
}
function init() {
_numClass++;
_mc = _root.createEmptyMovieClip((("CWaveEngine_" + _numClass) + "_") + type, _root.getNextHighestDepth());
}
function soundOff() {
if (!mute) {
debug("soundOff()");
for (var _local2 in stack) {
stack[_local2]._oldVolume = stack[_local2].getVolume();
setVolume(_local2, 0);
}
mute = true;
}
}
function soundOn() {
if (mute) {
mute = false;
debug("soundOn()");
for (var _local3 in stack) {
var _local2 = ((stack[_local3]._oldVolume == undefined) ? 100 : (stack[_local3]._oldVolume));
setVolume(_local3, _local2);
}
}
}
function getSoundStatus() {
return(!mute);
}
function play(id, secondsOffset, loops) {
if ((id == undefined) || (stack[id] == undefined)) {
return(0);
}
if (type == 2) {
stopAll();
}
secondsOffset = ((secondsOffset == undefined) ? 0 : (secondsOffset));
loops = ((loops == undefined) ? 1 : (loops));
var _local4 = stack[id];
if (mute) {
_local4.setVolume(0);
}
if (type == 2) {
loops = 65536;
}
_local4.start(secondsOffset, loops);
debug(((((("play(" + _local4.__link) + ", ") + secondsOffset) + ", ") + loops) + ")");
}
function playAll(secondsOffset, loops, autoDelete) {
for (var _local5 in stack) {
play(_local5, secondsOffset, loops, autoDelete);
}
}
function addStream(link_name, autoDelete) {
if (link_name == undefined) {
return(0);
}
autoDelete = ((autoDelete == undefined) ? true : (autoDelete));
var _local4 = _mc.createEmptyMovieClip("attachS_" + (++_numSound), _mc.getNextHighestDepth());
var _local2 = new Sound(_local4);
_local2.attachSound(link_name);
_local2.__parent = this;
_local2.__link = link_name;
_local2.__num = _numSound;
_local2.__mc = _local4;
_local2.__autoDelete = autoDelete;
_local2.onSoundComplete = function () {
if (this.__autoDelete) {
this.__parent.deleteSound(this.__num);
}
};
debug(("addStream(" + link_name) + ")");
stack[_numSound] = _local2;
return(_local2.__num);
}
function deleteSound(id) {
if ((id == undefined) || (stack[id] == undefined)) {
return(0);
}
var _local2 = stack[id];
debug("Stack deletes a " + _local2.__link);
delete stack[id];
removeMovieClip(_local2.__mc);
}
function deleteAllSound() {
debug("deleteAllSound()");
for (var _local2 in stack) {
deleteSound(_local2);
}
}
function stop(id) {
if ((id == undefined) || (stack[id] == undefined)) {
return(0);
}
var _local3 = stack[id];
_local3.stop();
debug(("stop(" + _local3.__link) + ")");
if (_local3.__autoDelete) {
if ((id != _numSound) || (type != 2)) {
deleteSound(id);
}
}
}
function stopAll() {
debug("stopAll()");
for (var _local2 in stack) {
stop(_local2);
}
}
function setVolume(id, volume) {
if (((id == undefined) || (volume == undefined)) || (stack[id] == undefined)) {
return(0);
}
var _local2 = stack[id];
if (mute) {
_local2._oldVolume = volume;
return(0);
}
debug(((("setVolume(" + _local2.__link) + ", ") + volume) + ")");
if (_local2 != undefined) {
_local2.setVolume(volume);
}
}
function setAllVolume(volume) {
for (var _local2 in stack) {
setVolume(_local2, volume);
}
}
function debug(msg) {
if (debugOn) {
trace((type + " ") + msg);
}
}
function toString() {
return("[sound.CWaveEngine]");
}
var _numSound = 0;
static var _numClass = 0;
}
Symbol 385 MovieClip [__Packages.CCard] Frame 0
class CCard extends MovieClip
{
var _height, _width, useHandCursor, cacheAsBitmap, bThis2Fond, bDragGroup, bDrag, bFond, nDepth, getDepth, bDragDone, nX, _x, nY, _y, nClickTime, nOldFan, nFan, bDragGroupIsCorrect, _rotation, nPlaceInFan, _parent, swapDepths, startDrag, stopDrag, _droptarget, nMast, nPot, nColor;
function CCard () {
super();
nCardHeight = _height;
nCardWidth = _width;
useHandCursor = false;
cacheAsBitmap = true;
bThis2Fond = false;
bDragGroup = false;
bDrag = false;
bFond = false;
aDragGroup = [this];
nDepth = getDepth();
}
function onPress() {
if ((_root.bAction && (!bThis2Fond)) && (!bFond)) {
bDrag = true;
bDragDone = false;
nX = _x;
nY = _y;
nClickTime = getTimer();
nOldFan = nFan;
bDragGroup = false;
bDragGroupIsCorrect = true;
aDragGroup = [this];
nDepth = getDepth();
_rotation = 0;
_root.fPlaySnd(_root.nSndCardTake);
var _local3 = nPlaceInFan + 1;
while (_local3 < _parent.aCardTable[nFan].length) {
if ((_parent.aCardTable[nFan][_local3].nColor == _parent.aCardTable[nFan][_local3 - 1].nColor) || (_parent.aCardTable[nFan][_local3].nPot != (_parent.aCardTable[nFan][_local3 - 1].nPot - 1))) {
bDragGroupIsCorrect = false;
break;
}
_local3++;
}
if (nPlaceInFan != (_parent.aCardTable[nFan].length - 1)) {
_local3 = 0;
while ((nPlaceInFan + _local3) < _parent.aCardTable[nFan].length) {
aDragGroup[_local3] = _parent.aCardTable[nFan][nPlaceInFan + _local3];
aDragGroup[_local3].nDepth = aDragGroup[_local3].getDepth();
aDragGroup[_local3]._rotation = 0;
aDragGroup[_local3].swapDepths(_parent.getNextHighestDepth());
_local3++;
}
bDragGroup = true;
}
if (!bDragGroup) {
swapDepths(_parent.getNextHighestDepth());
}
nCardDiff = ((aDragGroup.length > 5) ? (((aDragGroup.length > 10) ? 8 : 10)) : 12);
_x = _parent._xmouse;
_y = ((_parent._ymouse + (nCardHeight / 2)) - nCardDiff) + 3;
startDrag(false);
}
}
function onRollOver() {
if ((((_root.bAction && (_parent._xmouse < (_parent.aCardTableX[nFan] + 15))) && (_parent._ymouse < (_parent.aCardTableY[nFan] + 5))) && (_parent._ymouse > (_parent.aCardTableY[nFan] - (nCardHeight / 2)))) && (!bFond)) {
var _local3 = nPlaceInFan + 1;
while (_local3 < _parent.aCardTable[nFan].length) {
_parent.aCardTable[nFan][_local3]._x = _parent.aCardTableX[nFan] + 13;
_local3++;
}
}
}
function onRollOut() {
if (_root.bAction && (!bFond)) {
var _local3 = nPlaceInFan + 1;
while (_local3 < _parent.aCardTable[nFan].length) {
_parent.aCardTable[nFan][_local3]._x = _parent.aCardTableX[nFan];
_local3++;
}
}
}
function onEnterFrame() {
if (bDragGroup) {
var _local2 = 1;
while (_local2 < aDragGroup.length) {
aDragGroup[_local2]._x = _x;
aDragGroup[_local2]._y = _y + (_local2 * nCardDiff);
_local2++;
}
updateAfterEvent();
}
}
function onReleaseOutside() {
if (((!bThis2Fond) && (!bFond)) && (_root.bAction)) {
fRelCheck();
}
}
function onRelease() {
if (((!bThis2Fond) && (!bFond)) && (_root.bAction)) {
fRelCheck();
}
}
function fRelCheck() {
if ((getTimer() - nClickTime) <= nClickTimeDiff) {
if (nPlaceInFan == (_parent.aCardTable[nFan].length - 1)) {
stopDrag();
if (fCheckCard()) {
return(undefined);
}
}
fCardBack();
} else {
var mcDrop2 = eval (this._droptarget);
var xod = new Array();
if (mcDrop2.nColor == undefined) {
var mX = _x;
var mY = _y;
if (((!bDragGroup) && (mY >= (_parent.nCardFondY - (nCardHeight / 2)))) && (mY <= (_parent.nCardFondY + (nCardHeight / 2)))) {
var j = -1;
var i = 0;
while (i < 4) {
if ((mX >= (_parent.aCardFondX[i] - (nCardWidth / 2))) && (mX <= (_parent.aCardFondX[i] + (nCardWidth / 2)))) {
j = i;
break;
}
i++;
}
var nFondMast = fFondMast(j);
if ((nFondMast == nMast) && (nPot == 12)) {
_parent.aCardTable[nFan].pop();
xod.push([this, nFan, nPlaceInFan, j, 0, nDepth, 1]);
nFan = j;
nPlaceInFan = 0;
bFond = true;
_x = _parent.aCardFondX[j];
_y = _parent.nCardFondY;
_parent.aCardFond[nFan] = [this];
_root.fPlaySnd(_root.nSndCard2Fond);
fAddScore(_root.nPutFondScore);
_parent.aUndoStack.splice(_parent.nUndoLevelID);
_parent.aUndoStack.push(xod);
_parent.nUndoLevelID++;
_parent.fAlignFan(nOldFan);
_root.bAction = true;
} else {
fCardBack();
}
} else if ((((mY >= _parent.nGTTop) && (mY <= _parent.nGTBottom)) && (mX >= _parent.nGTLeft)) && (mX <= _parent.nGTRight)) {
var j = -1;
var i = 0;
while (i < 13) {
if ((((mX >= (_parent.aCardTableX[i] - (nCardWidth / 2))) && (mX <= (_parent.aCardTableX[i] + (nCardWidth / 2)))) && (mY >= (_parent.aCardTableY[i] - (nCardHeight / 2)))) && (mY <= (_parent.aCardTableY[i] + (nCardHeight / 2)))) {
j = i;
break;
}
i++;
}
if (j != -1) {
if (bDragGroup && (bDragGroupIsCorrect)) {
if ((_parent.aCardTable[j][0] == undefined) && (aDragGroup[0].nPot == 11)) {
_parent.aCardTable[aDragGroup[0].nFan].splice(aDragGroup[0].nPlaceInFan);
var i = 0;
while (i < aDragGroup.length) {
xod.push([aDragGroup[i], aDragGroup[i].nFan, aDragGroup[i].nPlaceInFan, j, i, aDragGroup[i].getDepth(), 0]);
aDragGroup[i].nFan = j;
aDragGroup[i].nPlaceInFan = i;
aDragGroup[i]._x = _parent.aCardTableX[j];
aDragGroup[i]._y = _parent.aCardTableY[j];
_parent.aCardTable[j][i] = aDragGroup[i];
i++;
}
_root.fPlaySnd(_root.nSndCardPlaced);
_parent.aUndoStack.splice(_parent.nUndoLevelID);
_parent.aUndoStack.push(xod);
_parent.nUndoLevelID++;
bDragGroup = false;
aDragGroup = [undefined];
_parent.fAlignFan(nOldFan);
_parent.fAlignFan(j);
_root.bAction = true;
} else {
fCardBack();
}
} else if (!bDragGroup) {
if ((_parent.aCardTable[j][0] == undefined) && (nPot == 11)) {
_parent.aCardTable[nFan].pop();
xod.push([this, nFan, nPlaceInFan, j, 0, nDepth, 0]);
nFan = j;
nPlaceInFan = 0;
_x = _parent.aCardTableX[j];
_y = _parent.aCardTableY[j];
_parent.aCardTable[j][0] = this;
_root.fPlaySnd(_root.nSndCardPlaced);
_parent.aUndoStack.splice(_parent.nUndoLevelID);
_parent.aUndoStack.push(xod);
_parent.nUndoLevelID++;
_parent.fAlignFan(nOldFan);
_parent.fAlignFan(nFan);
_root.bAction = true;
} else {
fCardBack();
}
} else {
fCardBack();
}
} else {
fCardBack();
}
} else {
fCardBack();
}
} else if (mcDrop2.nColor == nColor) {
if ((((!bDragGroup) && (mcDrop2._y == _parent.nCardFondY)) && ((mcDrop2.nPot == (nPot - 1)) || ((mcDrop2.nPot == 12) && (nPot == 0)))) && (mcDrop2.nMast == nMast)) {
_parent.aCardTable[nFan].pop();
xod.push([this, nFan, nPlaceInFan, mcDrop2.nFan, mcDrop2.nPlaceInFan + 1, nDepth, 1]);
nFan = mcDrop2.nFan;
nPlaceInFan = mcDrop2.nPlaceInFan + 1;
bFond = true;
_x = mcDrop2._x;
_y = mcDrop2._y;
_parent.aCardFond[nFan].push(this);
_root.fPlaySnd(_root.nSndCard2Fond);
fAddScore(_root.nPutFondScore);
_parent.aUndoStack.splice(_parent.nUndoLevelID);
_parent.aUndoStack.push(xod);
_parent.nUndoLevelID++;
_parent.fAlignFan(nOldFan);
_root.bAction = true;
fCheck4Win();
} else {
fCardBack();
}
} else if (((mcDrop2.nColor != nColor) && (mcDrop2.nPot == (nPot + 1))) && (mcDrop2.nPlaceInFan == (_parent.aCardTable[mcDrop2.nFan].length - 1))) {
if (bDragGroup && (bDragGroupIsCorrect)) {
_parent.aCardTable[aDragGroup[0].nFan].splice(aDragGroup[0].nPlaceInFan);
var i = 0;
while (i < aDragGroup.length) {
xod.push([aDragGroup[i], aDragGroup[i].nFan, aDragGroup[i].nPlaceInFan, mcDrop2.nFan, (mcDrop2.nPlaceInFan + i) + 1, aDragGroup[i].nDepth, 0]);
aDragGroup[i].nFan = mcDrop2.nFan;
aDragGroup[i].nPlaceInFan = (mcDrop2.nPlaceInFan + i) + 1;
aDragGroup[i]._x = _parent.aCardTableX[aDragGroup[i].nFan];
aDragGroup[i]._y = _parent.aCardTableY[aDragGroup[i].nFan];
_parent.aCardTable[aDragGroup[i].nFan][aDragGroup[i].nPlaceInFan] = aDragGroup[i];
i++;
}
bDragGroup = false;
aDragGroup = [undefined];
_root.fPlaySnd(_root.nSndCardPlaced);
_parent.aUndoStack.splice(_parent.nUndoLevelID);
_parent.aUndoStack.push(xod);
_parent.nUndoLevelID++;
_parent.fAlignFan(nOldFan);
_parent.fAlignFan(mcDrop2.nFan);
_root.bAction = true;
} else if (!bDragGroup) {
_parent.aCardTable[nFan].pop();
xod.push([this, nFan, nPlaceInFan, mcDrop2.nFan, mcDrop2.nPlaceInFan + 1, nDepth, 0]);
nFan = mcDrop2.nFan;
nPlaceInFan = mcDrop2.nPlaceInFan + 1;
_x = _parent.aCardTableX[nFan];
_y = _parent.aCardTableY[nFan];
_parent.aCardTable[nFan][nPlaceInFan] = this;
_root.fPlaySnd(_root.nSndCardPlaced);
_parent.aUndoStack.splice(_parent.nUndoLevelID);
_parent.aUndoStack.push(xod);
_parent.nUndoLevelID++;
_parent.fAlignFan(nOldFan);
_parent.fAlignFan(mcDrop2.nFan);
_root.bAction = true;
} else {
fCardBack();
}
} else {
fCardBack();
}
stopDrag();
bDrag = false;
}
}
function fCardBack() {
if (bDragGroup) {
var _local3 = 0;
while (_local3 < aDragGroup.length) {
aDragGroup[_local3]._x = _parent.aCardTableX[aDragGroup[_local3].nFan];
aDragGroup[_local3]._y = _parent.aCardTableY[aDragGroup[_local3].nFan];
aDragGroup[_local3].swapDepths(aDragGroup[_local3].nDepth);
_local3++;
}
aDragGroup = [undefined];
bDragGroup = false;
} else {
_x = nX;
_y = nY;
swapDepths(nDepth);
}
bDrag = false;
stopDrag();
_parent.fAlignFan(nFan);
_root.bAction = true;
}
function fAddScore(n) {
if (_root.nGameMode == 0) {
_root.nCurrentScore = _root.nCurrentScore + n;
_root.nTotalScore = _root.nTotalScore + n;
_parent.fCalcRang();
}
}
function fFondMast(n) {
var _local1 = -1;
switch (n) {
case 0 :
_local1 = 2;
break;
case 1 :
_local1 = 0;
break;
case 2 :
_local1 = 3;
break;
case 3 :
_local1 = 1;
break;
}
return(_local1);
}
function fMastFond(n) {
var _local1 = -1;
switch (n) {
case 0 :
_local1 = 1;
break;
case 1 :
_local1 = 3;
break;
case 2 :
_local1 = 0;
break;
case 3 :
_local1 = 2;
}
return(_local1);
}
function fCheckCard() {
var _local2 = fMastFond(nMast);
var _local3 = _parent.aCardFond[_local2].length - 1;
var _local7 = nFan;
var _local4 = false;
if (_local3 >= 0) {
if (((_parent.aCardFond[_local2][_local3].nPot == 12) && (nPot == 0)) || (_parent.aCardFond[_local2][_local3].nPot == (nPot - 1))) {
_local4 = true;
}
} else if (nPot == 12) {
_local3 = -1;
_local4 = true;
}
if (!_local4) {
return(_local4);
}
var _local5 = new Array();
_local5.push([this, nFan, nPlaceInFan, _local2, _local3 + 1, nDepth, 1]);
nFan = _local2;
nPlaceInFan = _local3 + 1;
bFond = true;
bThis2Fond = true;
_rotation = 0;
swapDepths(_parent.getNextHighestDepth());
_parent.aCardFond[_local2].push(this);
_parent.aCardTable[_local7].pop();
_parent.aUndoStack.splice(_parent.nUndoLevelID);
_parent.aUndoStack.push(_local5);
_parent.nUndoLevelID++;
var _local6 = (-(_x - _parent.aCardFondX[_local2])) / 10;
gdp.core.base.Process.start(gdp.utils.Delegate.create(this, fThrowCard), [this, _parent.aCardFondX[_local2], _parent.nCardFondY, _x, _y, _local6, nOldFan], getTimer());
return(_local4);
}
function fThrowCard(card, newx, newy, oldx, oldy, speedX, fan, nDep) {
card._x = card._x + speedX;
card._y = (((card._x - oldx) * (newy - oldy)) / (newx - oldx)) + oldy;
if (card._y <= (newy - (nCardHeight / 20))) {
if (nDep == undefined) {
_root.fPlaySnd(_root.nSndCard2Fond);
}
card._x = newx;
card._y = newy;
if (nDep != undefined) {
card.swapDepths(nDep);
}
if (nDep == undefined) {
fAddScore(_root.nPutFondScore);
}
_parent.fAlignFan(fan);
if (nDep == undefined) {
fCheck4Win();
}
bThis2Fond = false;
_root.bAction = true;
bDrag = false;
return(0);
}
}
function fCheck4Win() {
var _local2 = 0;
while (_local2 < 4) {
if (_parent.aCardFond[_local2][_parent.aCardFond[_local2].length - 1].nPot != 11) {
return(undefined);
}
_local2++;
}
var _local3 = gdp.utils.Delegate.create(_parent, _parent.fWin);
_local3();
}
static var nCardHeight = 94.3;
static var nCardWidth = 60;
static var nCardDiff = 12;
static var nClickTimeDiff = 150;
var aDragGroup = new Array();
}
Symbol 386 MovieClip [__Packages.gdp.core.base.Process] Frame 0
class gdp.core.base.Process
{
static var PROCESSES, oListener, EventMgr;
function Process () {
}
static function init() {
PROCESSES = new Array();
oListener = new Object();
EventMgr = new gdp.events.EventManager(oListener);
bInit = true;
}
static function main() {
if (!bInit) {
init();
}
if (PROCESSES.length <= 0) {
return(0);
}
var _local1 = 0;
while (_local1 < PROCESSES.length) {
var _local2 = PROCESSES[_local1][0].apply(null, PROCESSES[_local1][1]);
if ((_local2 == KILL) || (typeof(PROCESSES[_local1][0]) != "function")) {
var _local3 = PROCESSES[_local1][2];
PROCESSES.splice(_local1--, 1);
EventMgr.dispatch("onProcessKill", _local3);
} else if (_local2 == HOLD) {
return(undefined);
}
_local1++;
}
}
static function start(ps, args, id, priority) {
if (!bInit) {
init();
}
id = id || (lastId++);
if (priority == undefined) {
PROCESSES.push([ps, args, id]);
} else {
PROCESSES.splice(priority, 0, [ps, args, id]);
}
EventMgr.dispatch("onProcessStart", args, id, priority);
return(0);
}
static function kill(ps, id) {
if (!bInit) {
init();
}
id = ((id == undefined) ? -1 : (id));
var _local1 = 0;
while (_local1 < PROCESSES.length) {
if (((PROCESSES[_local1][0] == ps) || ((PROCESSES[_local1][0].func == ps.func) && (ps.func != undefined))) && (PROCESSES[_local1][2] == id)) {
PROCESSES.splice(_local1--, 1);
}
_local1++;
}
EventMgr.dispatch("onProcessKill", id);
return(0);
}
static function killAll() {
PROCESSES = new Array();
EventMgr.dispatch("onAllProcessKill");
}
static function is(ps, id) {
id = ((id == undefined) ? -1 : (id));
var _local1 = 0;
while (_local1 < PROCESSES.length) {
if (((PROCESSES[_local1][0] == ps) || ((PROCESSES[_local1][0].func == ps.func) && (ps.func != undefined))) && (PROCESSES[_local1][2] == id)) {
return(true);
}
_local1++;
}
return(false);
}
static function toString() {
return("[CProcess] length:" + PROCESSES.length);
}
static function keepId() {
return(lastId++);
}
static function addListener() {
if (!bInit) {
init();
}
oListener.addListener.apply(oListener, arguments);
}
static function removeListener() {
if (!bInit) {
init();
}
oListener.addListener.apply(oListener, arguments);
}
static var lastId = 1;
static var KILL = 0;
static var HOLD = -1;
static var bInit = false;
}
Symbol 387 MovieClip [__Packages.gdp.events.EventManager] Frame 0
class gdp.events.EventManager extends AsBroadcaster
{
static var oLastClass;
var oClass;
function EventManager (oObj) {
super();
oClass = oObj;
AsBroadcaster.initialize(oClass);
}
function dispatch(sEventName) {
oLastClass = oClass;
oClass.broadcastMessage.apply(oClass, arguments);
}
function getListeners() {
return(oClass._listeners);
}
static function getTarget() {
return(oLastClass);
}
}
Symbol 388 MovieClip [__Packages.gdp.utils.Delegate] Frame 0
class gdp.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(oClass, fFunc, aArgs, bMerge) {
var _local2 = function () {
var _local3 = arguments.callee.target;
var _local2 = arguments.callee.func;
var _local4 = arguments.callee.bMerge;
if (_local4) {
var _local5 = gdp.utils.Delegate.merge(arguments, arguments.callee.aArgs);
} else {
var _local5 = ((arguments.length > 0) ? arguments : (arguments.callee.aArgs));
}
_local2.___nCount = arguments.callee.nCount;
return(_local2.apply(_local3, _local5));
};
_local2.type = "Delegate";
_local2.target = oClass;
_local2.func = fFunc;
_local2.nCount = ++nCount;
if (_local2.func.___aInnerValues == undefined) {
_local2.func.___aInnerValues = new Array();
}
_local2.func.___aInnerValues[nCount] = new Object();
_local2.aArgs = aArgs;
_local2.bMerge = bMerge;
return(_local2);
}
static function set(sValueName, value) {
return((arguments.caller.___aInnerValues[arguments.caller.___nCount][sValueName] = value));
}
static function get(sValueName) {
return(arguments.caller.___aInnerValues[arguments.caller.___nCount][sValueName]);
}
static function merge(aA, aB) {
var _local1 = 0;
while (_local1 < aB.length) {
aA.push(aB[_local1]);
_local1++;
}
return(aA);
}
static function clone(fDelegate) {
if ((fDelegate.target != undefined) && (fDelegate.func != undefined)) {
return(create(fDelegate.target, fDelegate.func, fDelegate.aArgs, fDelegate.bMerge));
}
return(fDelegate);
}
function createDelegate(obj) {
return(create(obj, func));
}
static var nCount = 0;
}
Symbol 389 MovieClip [__Packages.CUIBtns] Frame 0
class CUIBtns extends MovieClip
{
var mcPause, mcSnd, _parent;
function CUIBtns () {
super();
_bB = true;
mcPause.onPress = gdp.utils.Delegate.create(this, fPauseDown);
mcPause.onRelease = gdp.utils.Delegate.create(this, fPause);
mcPause.onRollOver = gdp.utils.Delegate.create(this, fPauseOver);
mcPause.onRollOut = gdp.utils.Delegate.create(this, fPauseOut);
mcSnd.onPress = gdp.utils.Delegate.create(this, fSndDown);
mcSnd.onRelease = gdp.utils.Delegate.create(this, fSnd);
mcSnd.onRollOver = gdp.utils.Delegate.create(this, fSndOver);
mcSnd.onRollOut = gdp.utils.Delegate.create(this, fSndOut);
fRefresh();
if (_parent.bIsGame == undefined) {
mcPause._visible = false;
}
mcPause.onReleaseOutside = (mcSnd.onReleaseOutside = gdp.utils.Delegate.create(this, glRef));
}
function glRef() {
_bB = true;
fRefresh();
}
function onEnterFrame() {
if (_bB && (random(3) == 0)) {
fRefresh();
}
}
function fRefresh() {
mcPause.gotoAndStop(((!_root.bPaused) ? 1 : 2));
mcSnd.gotoAndStop((_root.bSoundOn ? 1 : 2));
}
function fPause() {
if (!_root.bPaused) {
_root.fPlaySnd(_root.nSndBtn);
_root.bPaused = true;
_parent.fMoveAllCards(-1000);
_parent.attachMovie("pauseShadow2", "pauseShadow", _parent.getNextHighestDepth(), {_x:0, _y:0, _alpha:_root.nShdwAlpha});
_parent.attachMovie("wndPause", "wndPause", _parent.getNextHighestDepth(), {_x:400, _y:300});
_parent.pauseShadow.useHandCursor = false;
_parent.pauseShadow.onRelease = undefined;
_parent.keyListen.onKeyDown = gdp.utils.Delegate.create(_parent, _parent.fPauseListener);
_parent.wndPause.btnBack2Game.onRelease = gdp.utils.Delegate.create(this, fPauseBack);
_parent.wndPause.btnDOV.onRelease = function () {
_root.fPlaySnd(_root.nSndBtn);
_root.getURL(_root.sUrl, "_blank");
};
fRefresh();
} else {
fPauseBack();
}
}
function fPauseBack() {
_root.fPlaySnd(_root.nSndBtn);
_parent.pauseShadow.removeMovieClip();
_parent.wndPause.removeMovieClip();
_parent.fMoveAllCards(1000);
_parent.nLastTime = getTimer();
_parent.keyListen.onKeyDown = gdp.utils.Delegate.create(_parent, _parent.fKeys);
_root.bPaused = false;
fRefresh();
}
function fPauseOver() {
_bB = false;
fRefresh();
mcPause.gotoAndStop(((!_root.bPaused) ? 3 : 4));
}
function fPauseDown() {
mcPause.gotoAndStop(((!_root.bPaused) ? 5 : 6));
}
function fPauseOut() {
_bB = true;
}
function fSnd() {
if (_root.bSoundOn) {
_root.SoundEng.soundOff();
_root.bSoundOn = false;
mcSnd.gotoAndStop(4);
} else {
_root.SoundEng.soundOn();
_root.fPlaySnd(_root.nSndBtn);
_root.bSoundOn = true;
mcSnd.gotoAndStop(3);
}
}
function fSndOver() {
_bB = false;
fRefresh();
mcSnd.gotoAndStop((_root.bSoundOn ? 3 : 4));
}
function fSndDown() {
mcSnd.gotoAndStop((_root.bSoundOn ? 5 : 6));
}
function fSndOut() {
_bB = true;
}
var _bB = true;
}
Symbol 390 MovieClip [__Packages.CGame] Frame 0
class CGame extends MovieClip
{
var mcRang, btnMainMenu, btnUndo, btnNewGame, onLoad, dtTime, dtTitle, dtCurrent, dtTotal, dtWins, attachMovie, getNextHighestDepth, pauseShadow, upsell, wndNewGame, wndChooseGameMode, mcUI, wndPause, wndLeaveGame, nCTFan, nCTPlaceInFan, wndLoadGame, cCard, stopDrag, wndCheat;
function CGame () {
super();
mcRang.gotoAndStop(_root.nUserRang + 1);
Key.addListener(keyListen);
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fKeys);
btnMainMenu.onRelease = gdp.utils.Delegate.create(this, fExit);
btnUndo.onRelease = gdp.utils.Delegate.create(this, fUndo);
btnNewGame.onRelease = gdp.utils.Delegate.create(this, fStart);
_root.bGameInProgress = false;
onLoad = gdp.utils.Delegate.create(this, fUpsellCheck);
}
function onEnterFrame() {
if (!_root.bPaused) {
if (_root.bGameInProgress) {
nGameTime = nGameTime + (getTimer() - nLastTime);
nLastTime = getTimer();
var _local3 = Math.floor(nGameTime / 1000);
var _local5 = "";
var _local4 = "";
var _local6 = "";
var _local7 = "";
if (_local3 >= 3600) {
_local5 = String(Math.floor(_local3 / 3600)) + ":";
_local4 = ((Math.floor((_local3 - 3600) / 60) < 10) ? (("0" + Math.floor((_local3 - 3600) / 60)) + ":") : (Math.floor((_local3 - 3600) / 60) + ":"));
} else {
_local4 = Math.floor(_local3 / 60) + ":";
}
_local6 = (((_local3 % 60) < 10) ? ("0" + (_local3 % 60)) : (String(_local3 % 60)));
dtTime.text = ((_local7 + _local5) + _local4) + _local6;
}
dtTitle.text = _root.aRangs[_root.nUserRang];
dtCurrent.text = ((_root.nGameMode == 0) ? (_root.nCurrentScore) : "FunPlay");
dtTotal.text = ((_root.nGameMode == 0) ? (_root.nTotalScore) : "FunPlay");
dtWins.text = ((_root.nGameMode == 0) ? ((_root.nWins + "/") + _root.nTries) : "FunPlay");
gdp.core.base.Process.main();
}
}
function fUpsellCheck(b) {
_root.nLevelsDone++;
if (_root.winstat.relaxDone >= 10) {
attachMovie("pauseShadow", "pauseShadow", getNextHighestDepth(), {_x:400, _y:300, _height:800, _width:1000, _alpha:_root.nShdwAlpha});
attachMovie("wndUpsellScreen2", "upsell", getNextHighestDepth(), {_x:400, _y:300});
pauseShadow.useHandCursor = false;
pauseShadow.onRelease = undefined;
upsell.btnLater.onRelease = function () {
_root.fPlaySnd(_root.nSndBtn);
_root.gotoAndStop("Menu");
};
upsell.btnDOV.onRelease = function () {
_root.fPlaySnd(_root.nSndBtn);
_root.getURL("http://www.myplaycity.com/free_solitaire_galaxy", "_blank");
_root.gotoAndStop("Menu");
};
return(0);
}
if ((_root.nLevelsDone % _root.nLevel2Upsell) == 0) {
attachMovie("pauseShadow", "pauseShadow", getNextHighestDepth(), {_x:400, _y:300, _height:800, _width:1000, _alpha:_root.nShdwAlpha});
attachMovie("wndUpsellScreen", "upsell", getNextHighestDepth(), {_x:400, _y:300});
pauseShadow.useHandCursor = false;
pauseShadow.onRelease = undefined;
upsell.btnLater.onRelease = gdp.utils.Delegate.create(this, fChooseGM);
upsell.btnDOV.onRelease = function () {
_root.fPlaySnd(_root.nSndBtn);
_root.getURL("http://www.myplaycity.com/free_solitaire_galaxy", "_blank");
var _local3 = gdp.utils.Delegate.create(this._parent._parent, this._parent._parent.fChooseGM);
_local3(false);
};
} else {
fChooseGM();
}
}
function fChooseGM(b) {
_root.nLastGameMode = _root.nGameMode;
pauseShadow.removeMovieClip();
upsell.removeMovieClip();
wndNewGame.removeMovieClip();
dtTime.text = "0:00";
attachMovie("pauseShadow", "pauseShadow", getNextHighestDepth(), {_x:400, _y:300, _height:800, _width:1000, _alpha:_root.nShdwAlpha});
attachMovie("wndChooseGameMode", "wndChooseGameMode", getNextHighestDepth(), {_x:400, _y:300});
pauseShadow.useHandCursor = false;
pauseShadow.onRelease = undefined;
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fGMListener);
wndChooseGameMode.btnRelax.onRelease = gdp.utils.Delegate.create(this, fChooseRelax);
}
function fChooseRelax() {
_root.fPlaySnd(_root.nSndBtn);
pauseShadow.removeMovieClip();
wndChooseGameMode.removeMovieClip();
_root.nGameMode = 1;
nGameTime = 0;
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fKeys);
fNG();
}
function fGMListener() {
if (Key.isDown(27)) {
_root.gotoAndStop("Menu");
}
}
function fKeys() {
if ((_root.bAction && (Key.isDown(27))) && (!_root.bPaused)) {
fExit();
}
if (Key.isDown(32) && (!_root.bPaused)) {
fPreHint();
}
if ((_root.bAction && (Key.getCode() == 19)) && (!_root.bPaused)) {
_root.bPaused = true;
fMoveAllCards(-1000);
mcUI.fRefresh();
attachMovie("pauseShadow2", "pauseShadow", getNextHighestDepth(), {_x:0, _y:0, _alpha:_root.nShdwAlpha});
attachMovie("wndPause", "wndPause", getNextHighestDepth(), {_x:400, _y:300});
pauseShadow.useHandCursor = false;
pauseShadow.onRelease = undefined;
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fPauseListener);
wndPause.btnBack2Game.onRelease = gdp.utils.Delegate.create(this, fPauseBack);
wndPause.btnDOV.onRelease = function () {
_root.fPlaySnd(_root.nSndBtn);
_root.getURL("http://www.myplaycity.com/free_solitaire_galaxy", "_blank");
};
}
}
function fPauseListener() {
if ((Key.isDown(27) || (Key.isDown(13))) || (Key.getCode() == 19)) {
fPauseBack();
}
}
function fPauseBack() {
_root.fPlaySnd(_root.nSndBtn);
pauseShadow.removeMovieClip();
wndPause.removeMovieClip();
fMoveAllCards(1000);
nLastTime = getTimer();
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fKeys);
_root.bPaused = false;
}
function fExit() {
if (_root.bAction) {
_root.fPlaySnd(_root.nSndBtn);
_root.bGameInProgress = false;
_root.bPaused = true;
fMoveAllCards(-1000);
attachMovie("pauseShadow", "pauseShadow", getNextHighestDepth(), {_x:400, _y:300, _height:800, _width:1000, _alpha:_root.nShdwAlpha});
attachMovie("wndLeaveGame", "wndLeaveGame", getNextHighestDepth(), {_x:400, _y:300});
pauseShadow.useHandCursor = false;
pauseShadow.onRelease = undefined;
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fExitListener);
wndLeaveGame.btnYes.onRelease = gdp.utils.Delegate.create(this, fLeave);
wndLeaveGame.btnNo.onRelease = gdp.utils.Delegate.create(this, fNo0);
}
}
function fExitListener() {
if (Key.isDown(27)) {
fNo0();
}
if (Key.isDown(13)) {
fLeave();
}
}
function fLeave() {
_root.fPlaySnd(_root.nSndBtn);
_root.bPaused = false;
_root.bGameInProgress = false;
if (_root.nGameMode == 0) {
fCalcRang();
}
_root.nLastGameMode = _root.nGameMode;
var _local3 = _root.nGameMode;
_root.nGameMode = -1;
_root.nCurrentScore = 0;
_root.gotoAndStop(((_local3 == 0) ? "Score" : "Menu"));
}
function fNo0() {
_root.fPlaySnd(_root.nSndBtn);
pauseShadow.removeMovieClip();
wndLeaveGame.removeMovieClip();
fMoveAllCards(1000);
nLastTime = getTimer();
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fKeys);
_root.bGameInProgress = true;
_root.bPaused = false;
}
function fUndo() {
_root.fPlaySnd(_root.nSndBtn);
if ((_root.bAction && (nUndoLevelID > 0)) && (aUndoStack.length > 0)) {
var _local4 = aUndoStack[nUndoLevelID - 1];
var _local3 = 0;
while (_local3 < _local4.length) {
aCardTable[_local4[_local3][1]][_local4[_local3][2]] = _local4[_local3][0];
_local4[_local3][0].nFan = _local4[_local3][1];
_local4[_local3][0].nPlaceInFan = _local4[_local3][2];
_local4[_local3][0].bFond = false;
_local4[_local3][0]._x = aCardTableX[_local4[_local3][1]];
_local4[_local3][0]._y = aCardTableY[_local4[_local3][1]];
_local4[_local3][0].swapDepths(_local4[_local3][5]);
if ((_local3 == 0) && (_local4[_local3][6] == 0)) {
aCardTable[_local4[_local3][3]].splice(_local4[_local3][4]);
}
if (_local4[_local3][6] == 1) {
aCardFond[_local4[_local3][3]].pop();
if (_root.nGameMode == 0) {
_root.nCurrentScore = _root.nCurrentScore - _root.nPutFondScore;
_root.nTotalScore = _root.nTotalScore - _root.nPutFondScore;
}
}
_local3++;
}
fAlignFan(_local4[0][1]);
fAlignFan(_local4[0][3]);
fCalcRang();
nUndoLevelID--;
}
}
function fStart() {
if (_root.bAction) {
_root.fPlaySnd(_root.nSndBtn);
if (_root.bGameInProgress) {
_root.bGameInProgress = false;
fMoveAllCards(-1000);
attachMovie("pauseShadow", "pauseShadow", getNextHighestDepth(), {_x:400, _y:300, _height:800, _width:1000, _alpha:_root.nShdwAlpha});
attachMovie("wndNewGame", "wndNewGame", getNextHighestDepth(), {_x:400, _y:300});
pauseShadow.useHandCursor = false;
pauseShadow.onRelease = undefined;
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fStartListener);
wndNewGame.btnYes.onRelease = gdp.utils.Delegate.create(this, fYes);
wndNewGame.btnNo.onRelease = gdp.utils.Delegate.create(this, fNo);
} else {
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fKeys);
fUpsellCheck(true);
}
}
}
function fYes() {
_root.fPlaySnd(_root.nSndBtn);
keyListen.onKeyDown = undefined;
pauseShadow.removeMovieClip();
wndNewGame.removeMovieClip();
fUpsellCheck(true);
}
function fNo() {
_root.fPlaySnd(_root.nSndBtn);
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fKeys);
pauseShadow.removeMovieClip();
wndNewGame.removeMovieClip();
fMoveAllCards(1000);
nLastTime = getTimer();
_root.bGameInProgress = true;
_root.bPaused = false;
}
function fStartListener() {
if (Key.isDown(13)) {
fYes();
}
if (Key.isDown(27)) {
fNo();
}
}
function fReVars() {
var _local2 = 0;
while (_local2 < aRandomCardStack.length) {
aRandomCardStack[_local2].removeMovieClip();
_local2++;
}
aCards = new Array();
aUndoStack = new Array();
aCardFond = new Array(new Array(), new Array(), new Array(), new Array());
aRandomCardStack = new Array();
_local2 = 0;
while (_local2 < 13) {
aCardTable[_local2] = new Array();
_local2++;
}
nUndoLevelID = 0;
nCount = 0;
nLast = 0;
nCTFan = 0;
nCTPlaceInFan = 0;
nGameTime = 0;
nLastTime = 0;
bCanHint = false;
bThrowing = false;
}
function fNG() {
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fKeys);
_root.bAction = false;
btnMainMenu.enabled = (btnUndo.enabled = (btnNewGame.enabled = false));
btnMainMenu._alpha = (btnUndo._alpha = (btnNewGame._alpha = 50));
pauseShadow.removeMovieClip();
wndLoadGame.removeMovieClip();
fReVars();
var _local4 = 0;
while (_local4 < 4) {
var _local3 = 0;
while (_local3 < 13) {
aCards[(_local4 * 13) + _local3] = {m:_local4, p:_local3};
_local3++;
}
_local4++;
}
_root.nCurrentScore = 0;
_root.nTimeBonus = 0;
if (_root.nGameMode == 0) {
_root.nCurrentScore = _root.nCurrentScore - _root.nStavka;
_root.nTotalScore = _root.nTotalScore - _root.nStavka;
_root.nTries++;
fCalcRang();
}
bThrowDone = false;
_root.bGameInProgress = false;
gdp.core.base.Process.start(gdp.utils.Delegate.create(this, fRandomize), [], getTimer());
}
function fRandomize() {
while (true) {
var _local4 = random(aCards.length);
var _local2 = aCards[_local4].m;
var _local3 = aCards[_local4].p;
aRandomCardStack[nCount] = attachMovie(("c" + _local2) + _local3, ("c" + _local2) + _local3, getNextHighestDepth(), {_x:nCardNestX, _y:nCardNestY});
aRandomCardStack[nCount].nMast = _local2;
aRandomCardStack[nCount].nPot = _local3;
aRandomCardStack[nCount].nColor = (((_local2 == 0) || (_local2 == 1)) ? 0 : 1);
aCards.splice(_local4, 1);
nCount++;
if (aCards.length == 0) {
attachMovie("cCard", "cCard", getNextHighestDepth(), {_x:nCardNestX, _y:nCardNestY});
nCount = 0;
nLast = aRandomCardStack.length - 1;
aRandomCardStack[nLast]._x = nCardNestX;
aRandomCardStack[nLast]._y = nCardNestY;
bThrowing = true;
gdp.core.base.Process.start(gdp.utils.Delegate.create(this, fThrowing), [], 100);
return(0);
}
}
}
function fThrowing() {
nCount++;
if (nCount == 4) {
_root.fPlaySnd(_root.nSndCardThrow);
aRandomCardStack[nLast - 1]._x = nCardNestX;
aRandomCardStack[nLast - 1]._y = nCardNestY;
var _local3 = aRandomCardStack[nLast];
aCardTable[nCTFan][nCTPlaceInFan] = _local3;
_local3.nFan = nCTFan;
_local3.nPlaceInFan = nCTPlaceInFan;
_local3.swapDepths(getNextHighestDepth());
gdp.core.base.Process.start(gdp.utils.Delegate.create(this, fThrowCard), [nCTFan, _local3, aCardTableX[nCTFan], aCardTableY[nCTFan], Math.abs(aCardTableX[nCTFan] - nCardNestX) / 10], getTimer());
nCTFan++;
if (nCTFan > 12) {
nCTFan = 0;
nCTPlaceInFan++;
}
nLast--;
if (nLast < 0) {
cCard.removeMovieClip();
btnMainMenu.enabled = (btnUndo.enabled = (btnNewGame.enabled = true));
btnMainMenu._alpha = (btnUndo._alpha = (btnNewGame._alpha = 100));
nLastTime = getTimer();
_root.bAction = true;
_root.bGameInProgress = true;
bThrowing = false;
mcUI.fRefresh();
return(0);
}
nCount = 0;
}
}
function fFastThrowing() {
gdp.core.base.Process.kill(gdp.utils.Delegate.create(this, fThrowing), 100);
while (nLast >= 0) {
var _local3 = aRandomCardStack[nLast];
aCardTable[nCTFan][nCTPlaceInFan] = _local3;
_local3.nFan = nCTFan;
_local3.nPlaceInFan = nCTPlaceInFan;
_local3._x = aCardTableX[nCTFan];
_local3._y = aCardTableY[nCTFan];
nCTFan++;
if (nCTFan > 12) {
nCTFan = 0;
nCTPlaceInFan++;
}
nLast--;
}
_root.fPlaySnd(_root.nSndCardPlaced);
cCard.removeMovieClip();
btnMainMenu.enabled = (btnUndo.enabled = (btnNewGame.enabled = true));
btnMainMenu._alpha = (btnUndo._alpha = (btnNewGame._alpha = 100));
nLastTime = getTimer();
nCount = 0;
var _local4 = 0;
while (_local4 < 13) {
fAlignFan(_local4);
_local4++;
}
_root.bAction = true;
_root.bGameInProgress = true;
bThrowing = false;
mcUI.fRefresh();
}
function fThrowCard(fan, card, x, y, speedX) {
card._x = card._x + ((card._x < x) ? (speedX) : (-1 * speedX));
card._y = (((card._x - nCardNestX) * (y - nCardNestY)) / (x - nCardNestX)) + nCardNestY;
if (((((card._x >= (x - (card._width / 3))) && (card._x <= (x + (card._width / 3)))) && (card._y <= (y + (card._height / 3)))) && (card._y >= (y - (card._height / 3)))) || (bThrowDone)) {
card._x = x;
card._y = y;
fAlignFan(fan);
return(0);
}
}
function fAlignFan(nFanNumb) {
var _local4 = aCardTable[nFanNumb].length;
var _local5 = ((Math.floor(130 / _local4) > 20) ? 20 : (Math.floor(130 / _local4)));
var _local6 = (_local4 - 1) * _local5;
var _local2 = 0;
while (_local2 < _local4) {
aCardTable[nFanNumb][_local2]._rotation = (_local2 * _local5) - Math.floor(_local6 / 2);
aCardTable[nFanNumb][_local2]._x = aCardTableX[nFanNumb];
aCardTable[nFanNumb][_local2]._y = aCardTableY[nFanNumb] - (((_local4 - _local2) - 1) * 3);
aCardTable[nFanNumb][_local2].swapDepths(getNextHighestDepth());
_local2++;
}
}
function fPreHint() {
if (_root.bGameInProgress) {
if (!bCanHint) {
bCanHint = true;
fHint();
return(undefined);
}
bCanHint = false;
_root.bAction = true;
} else if ((!bThrowDone) && (bThrowing)) {
bThrowDone = true;
fFastThrowing();
}
}
function fHint() {
if (bCanHint) {
_root.bAction = false;
var _local5 = 0;
while (_local5 < 13) {
if (aCardTable[_local5].length > 0) {
var _local8 = aCardTable[_local5].length - 1;
var _local3 = aCardTable[_local5][_local8];
var _local4 = 0;
while (_local4 < 4) {
if (aCardFond[_local4].length > 0) {
var _local6 = aCardFond[_local4].length - 1;
if (((!_local3.bDrag) && (_local3.nMast == aCardFond[_local4][_local6].nMast)) && (((_local3.nPot == 0) && (aCardFond[_local4][_local6].nPot == 12)) || (aCardFond[_local4][_local6].nPot == (_local3.nPot - 1)))) {
var _local7 = new Array();
_local7.push([_local3, _local5, _local8, _local4, _local6 + 1, _local3.nDepth, 1]);
_local3.nFan = _local4;
_local3.nPlaceInFan = _local6 + 1;
_local3.bFond = true;
_local3._rotation = 0;
_local3.swapDepths(getNextHighestDepth());
aCardFond[_local4].push(_local3);
aCardTable[_local5].pop();
aUndoStack.splice(nUndoLevelID);
aUndoStack.push(_local7);
nUndoLevelID++;
(stopDrag());// not popped
gdp.core.base.Process.start(gdp.utils.Delegate.create(this, fHintThrow), [_local5, _local3, aCardFondX[_local4], nCardFondY, (-(aCardTableX[_local5] - aCardFondX[_local4])) / 10], getTimer());
return(undefined);
}
} else if (((!_local3.bDrag) && (_local3.nMast == aCardFondMast[_local4])) && (_local3.nPot == 12)) {
var _local7 = new Array();
_local7.push([_local3, _local5, _local8, _local4, 0, _local3.nDepth, 1]);
_local3.nFan = _local4;
_local3.nPlaceInFan = 0;
_local3.bFond = true;
_local3._rotation = 0;
_local3.swapDepths(getNextHighestDepth());
aCardFond[_local4].push(_local3);
aCardTable[_local5].pop();
aUndoStack.splice(nUndoLevelID);
aUndoStack.push(_local7);
nUndoLevelID++;
(stopDrag());// not popped
gdp.core.base.Process.start(gdp.utils.Delegate.create(this, fHintThrow), [_local5, _local3, aCardFondX[_local4], nCardFondY, (-(aCardTableX[_local5] - aCardFondX[_local4])) / 10], getTimer());
return(undefined);
}
_local4++;
}
}
_local5++;
}
bCanHint = false;
_root.bAction = true;
}
}
function fHintThrow(fan, card, x1, y1, speedX) {
card._x = card._x + speedX;
card._y = (((card._x - aCardTableX[fan]) * (y1 - aCardTableY[fan])) / (x1 - aCardTableX[fan])) + aCardTableY[fan];
if (card._y <= (y1 - (card._height / 20))) {
_root.fPlaySnd(_root.nSndCard2Fond);
if (_root.nGameMode == 0) {
_root.nCurrentScore = _root.nCurrentScore + _root.nPutFondScore;
_root.nTotalScore = _root.nTotalScore + _root.nPutFondScore;
fCalcRang();
}
card._x = x1;
card._y = y1;
fAlignFan(fan);
fWinCheck();
return(0);
}
}
function fWinCheck() {
var _local3 = 0;
while (_local3 < 4) {
if (aCardFond[_local3][aCardFond[_local3].length - 1].nPot != 11) {
fHint();
return(undefined);
}
_local3++;
}
_root.bAction = true;
fWin();
}
function fWin() {
_root.bGameInProgress = false;
_root.bPaused = false;
pauseShadow.removeMovieClip();
wndCheat.removeMovieClip();
if (_root.nGameMode == 0) {
_root.nTimeBonus = (_root.nTimedMins - Math.ceil(nGameTime / 60000)) * _root.nTimeBonusMult;
if (_root.nTimeBonus < 0) {
_root.nTimeBonus = 0;
}
_root.nCurrentScore = _root.nCurrentScore + (_root.nWinScore + _root.nTimeBonus);
_root.nTotalScore = _root.nTotalScore + (_root.nWinScore + _root.nTimeBonus);
if (_root.nTotalScore >= 1000) {
_root.winstat.quest = true;
}
_root.nWins++;
fCalcRang();
} else {
_root.winstat.relaxDone++;
}
_root.nLastGameMode = _root.nGameMode;
fReVars();
attachMovie("pauseShadow", "pauseShadow", getNextHighestDepth(), {_x:400, _y:300, _height:800, _width:1000, _alpha:_root.nShdwAlpha});
attachMovie("wndWin", "wndWin", getNextHighestDepth(), {_x:400, _y:300});
pauseShadow.useHandCursor = false;
pauseShadow.onRelease = undefined;
}
function fMoveAllCards(n) {
var _local2 = 0;
while (_local2 < aRandomCardStack.length) {
aRandomCardStack[_local2]._y = aRandomCardStack[_local2]._y + n;
_local2++;
}
}
function fRefreshUser() {
_root.soData.data.rang = _root.nUserRang;
_root.soData.data.score = _root.nTotalScore;
_root.soData.data.wins = _root.nWins;
_root.soData.data.tries = _root.nTries;
_root.fReSO();
}
function fCalcRang() {
_root.nUserRang = Math.floor(_root.nTotalScore / _root.n2Rang);
if (_root.nUserRang < 0) {
_root.nUserRang = 0;
}
if (_root.nUserRang > 14) {
_root.nUserRang = 14;
}
mcRang.gotoAndStop(_root.nUserRang + 1);
fRefreshUser();
}
var bIsGame = true;
var nGTTop = 135;
var nGTBottom = 570;
var nGTLeft = 150;
var nGTRight = 765;
var nCardNestX = 457;
var nCardNestY = 657;
var aCardFondX = [291, 368, 551, 628.6];
var nCardFondY = 67;
var aCardFondMast = [2, 0, 3, 1];
var aCardTableX = [222, 459, 698, 222, 459, 698, 222, 459, 698, 338, 582, 338, 582];
var aCardTableY = [200, 200, 200, 345, 345, 345, 490, 490, 490, 272.5, 272.5, 417.5, 417.5];
var aCardTable = new Array();
var aCardFond = new Array();
var aRandomCardStack = new Array();
var aCards = new Array();
var aUndoStack = new Array();
var nCount = 0;
var nLast = 0;
var nGameTime = 0;
var nLastTime = 0;
var nUndoLevelID = 0;
var bCanHint = false;
var bThrowDone = false;
var bThrowing = false;
var keyListen = new Object();
}
Symbol 391 MovieClip [__Packages.CInstr] Frame 0
class CInstr extends MovieClip
{
var cacheAsBitmap, btnMainMenu, btnPlay, mcScroller, dtInstr, _ymouse;
function CInstr () {
super();
cacheAsBitmap = true;
Key.addListener(keyListen);
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fKeys);
btnMainMenu.onRelease = fMMenu;
btnPlay.onRelease = fPlay;
bDrag = false;
mouseListener.onMouseWheel = gdp.utils.Delegate.create(this, fMouseWheel);
Mouse.addListener(mouseListener);
mcScroller.onMouseMove = gdp.utils.Delegate.create(this, fScrollerMove);
mcScroller.btnScroll.onPress = gdp.utils.Delegate.create(this, fBeginDrag);
mcScroller.btnScroll.onRelease = gdp.utils.Delegate.create(this, fStopDrag);
mcScroller.btnScroll.onReleaseOutside = gdp.utils.Delegate.create(this, fStopDrag);
}
function fMouseWheel(delta) {
mcScroller._y = mcScroller._y - (delta * 5);
if ((mcScroller._y > nTop) && (mcScroller._y < nFloor)) {
var _local2 = ((mcScroller._y - nTop) + mcScroller._height) / ((nFloor - nTop) + mcScroller._height);
dtInstr.scroll = int(_local2 * dtInstr.maxscroll);
if (dtInstr.scroll > dtInstr.maxscroll) {
dtInstr.scroll = dtInstr.maxscroll;
}
} else if (mcScroller._y <= nTop) {
mcScroller._y = nTop;
setPos(1);
} else if (mcScroller._y >= nFloor) {
mcScroller._y = nFloor;
setPos(dtInstr.maxscroll);
}
}
function fScrollerMove() {
if (bDrag) {
drag();
}
}
function fBeginDrag() {
bDrag = true;
}
function fStopDrag() {
bDrag = false;
}
function drag() {
if ((_ymouse > (nTop + (mcScroller._height / 2))) && (_ymouse < (nFloor + (mcScroller._height / 2)))) {
mcScroller._y = _ymouse - (mcScroller._height / 2);
var _local2 = ((mcScroller._y - nTop) + mcScroller._height) / ((nFloor - nTop) + mcScroller._height);
dtInstr.scroll = int(_local2 * dtInstr.maxscroll);
if (dtInstr.scroll > dtInstr.maxscroll) {
dtInstr.scroll = dtInstr.maxscroll;
}
} else if (_ymouse <= (nTop + (mcScroller._height / 2))) {
setPos(1);
} else if (_ymouse >= (nFloor + (mcScroller._height / 2))) {
setPos(dtInstr.maxscroll);
}
}
function setPos(num) {
var _local2 = ((((num == 1) ? 0 : (num)) * (nFloor - nTop)) / dtInstr.maxscroll) + nTop;
mcScroller._y = _local2;
dtInstr.scroll = num;
}
function fKeys() {
if (Key.isDown(27)) {
fMMenu();
}
if (Key.isDown(13)) {
fPlay();
}
}
function fPlay() {
_root.fPlaySnd(_root.nSndBtn);
_root.gotoAndStop("Game");
}
function fMMenu() {
_root.fPlaySnd(_root.nSndBtn);
_root.gotoAndStop("Menu");
}
var nTop = 80;
var nFloor = 410;
var keyListen = new Object();
var bDrag = false;
var mouseListener = new Object();
}
Symbol 392 MovieClip [__Packages.CMenu] Frame 0
class CMenu extends MovieClip
{
var btnPlay, btnInstr, btnDOV, btnMoreGames;
function CMenu () {
super();
Key.addListener(keyListen);
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fKeys);
btnPlay.onRelease = fPlay;
btnInstr.onRelease = fInstr;
btnDOV.onRelease = fDOV;
btnMoreGames.onRelease = moreGames;
}
function fKeys() {
if (Key.isDown(13)) {
fPlay();
}
}
function fPlay() {
_root.fPlaySnd(_root.nSndBtn);
_root.gotoAndStop("Game");
}
function fInstr() {
_root.fPlaySnd(_root.nSndBtn);
_root.gotoAndStop("Instr");
}
function fDOV() {
_root.fPlaySnd(_root.nSndBtn);
_root.getURL("http://www.myplaycity.com/free_solitaire_galaxy", "_blank");
}
function moreGames() {
_root.fPlaySnd(_root.nSndBtn);
_root.getURL(_root.sMoreGamesLink, "_blank");
}
var keyListen = new Object();
}
Symbol 393 MovieClip [__Packages.CPreLoader] Frame 0
class CPreLoader extends MovieClip
{
var mcLoad, t, n;
function CPreLoader () {
super();
mcLoad.gotoAndStop(1);
t = _root.getBytesTotal();
n = 0;
}
function onEnterFrame() {
var _local3 = _root.getBytesLoaded();
var _local4 = (_local3 / t) * 100;
mcLoad.gotoAndStop(Math.floor(_local4));
if ((_local3 >= t) && (_root.b2G)) {
n++;
if (n >= 5) {
_root.gotoAndStop("Menu");
}
}
}
}
Symbol 394 MovieClip [__Packages.CWin] Frame 0
class CWin extends MovieClip
{
var btnNewGame, btnMainMenu, btn, dtTotal, dtTitle, mcRang, attachMovie, getNextHighestDepth, winMsg, now, onEnterFrame, mcBG, mcTitle, mcTotal;
function CWin () {
super();
Key.addListener(keyListen);
keyListen.onKeyDown = gdp.utils.Delegate.create(this, fKeys);
btnNewGame.onRelease = fNewG;
btnMainMenu.onRelease = fMenu;
btn.onRelease = gdp.utils.Delegate.create(this, fShowAll);
if (_root.nGameMode == 0) {
_root.nCurrentScore = 0;
dtTotal.text = _root.nTotalScore;
dtTitle.text = _root.aRangs[_root.nUserRang];
mcRang.gotoAndStop(_root.nUserRang + 1);
_root.fReSO();
fSetVisStatus(false);
attachMovie("winMsg", "winMsg", getNextHighestDepth(), {_x:0, _y:0});
winMsg.dtBonus = _root.nWinScore;
winMsg.dtTimeBonus = _root.nTimeBonus;
winMsg.total = _root.nTotalScore;
now = getTimer();
onEnterFrame = function () {
if ((getTimer() - this.now) > 5000) {
this.fSetVisStatus(true);
this.winMsg.removeMovieClip();
this.onEnterFrame = undefined;
this.btn._visible = false;
}
};
} else {
dtTotal.text = _root.nTotalScore;
dtTitle.text = _root.aRangs[_root.nUserRang];
btn._visible = false;
}
}
function fShowAll() {
fSetVisStatus(true);
winMsg.removeMovieClip();
onEnterFrame = undefined;
btn._visible = false;
}
function fSetVisStatus(b) {
mcBG._visible = b;
mcRang._visible = b;
btnNewGame._visible = b;
btnMainMenu._visible = b;
mcTitle._visible = b;
mcTotal._visible = b;
dtTitle._visible = b;
dtTotal._visible = b;
}
function fKeys() {
if (Key.isDown(27)) {
fMenu();
}
if (Key.isDown(13)) {
fNewG();
}
}
function fNewG() {
_root.fPlaySnd(_root.nSndBtn);
_root.gotoAndStop("NewG");
}
function fMenu() {
_root.fPlaySnd(_root.nSndBtn);
_root.gotoAndStop("Menu");
}
var keyListen = new Object();
}