Instance of Symbol 59 MovieClip "loading_mc" in Frame 1
onClipEvent (load) {
b = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
l = _root.getBytesLoaded();
p = (l / b) * 100;
text = Math.floor(p);
_root.loading_mc.loadingLine.colorLine._x = (((p / 100) - 1.5) * _root.loading_mc.loadingLine.colorLine._width) - 15;
if (l >= b) {
_root.gotoAndStop("init");
}
}
Frame 2
function loadSettings() {
firstLoad();
_root.style = settings.data.style;
_root.fsound = settings.data.sound;
_root.fmusic = settings.data.music;
_root.sound_music_btns();
_root.rounds = settings.data.rounds;
_root.practiceRounds = _root.rounds;
_root.base = settings.data.base;
}
function saveSettings() {
settings.data.style = _root.style;
settings.data.sound = _root.fsound;
settings.data.music = _root.fmusic;
settings.data.rounds = _root.practiceRounds;
settings.data.base = _root.base;
}
function loadScores() {
firstLoad();
_root.pHiScores = new Array();
_root.lHiScores = new Array();
var _local2 = 0;
while (_local2 < _root.numHiScores) {
_root.pHiScores.push(new Array(settings.data["pname" add _local2], settings.data["pscores" add _local2]));
_root.lHiScores.push(new Array(settings.data["lname" add _local2], settings.data["lscores" add _local2]));
_local2++;
}
}
function saveScores() {
var _local2 = 0;
while (_local2 < _root.numHiScores) {
settings.data["pname" add _local2] = _root.pHiScores[_local2][0];
settings.data["pscores" add _local2] = _root.pHiScores[_local2][1];
settings.data["lname" add _local2] = _root.lHiScores[_local2][0];
settings.data["lscores" add _local2] = _root.lHiScores[_local2][1];
_local2++;
}
}
function clearScores() {
var _local2 = 0;
while (_local2 < _root.numHiScores) {
settings.data["pname" add _local2] = defPUsers[_local2][0];
settings.data["pscores" add _local2] = defPUsers[_local2][1];
settings.data["lname" add _local2] = defLUsers[_local2][0];
settings.data["lscores" add _local2] = defLUsers[_local2][1];
_local2++;
}
}
function firstLoad() {
if (settings.data.firstLoad == undefined) {
_root.clearScores();
settings.data.firstLoad = 1;
settings.data.style = _root.styleG;
settings.data.sound = true;
settings.data.music = true;
settings.data.rounds = 1;
settings.data.base = 4;
}
}
function savePracticeSettings() {
settings.data.rounds = _root.rounds;
settings.data.base = _root.base;
}
function initRound() {
playSound("snd_newRound");
_root.frame._width = cardWidth + 5;
_root.frame._height = cardHeight + 5;
state = stPlay;
curDepth = 5;
lostRound = false;
rndPlayed++;
level = 0;
pair = false;
joker = 0;
selected = false;
selectNum = -1;
pair_first = -1;
pair_second = -1;
curPair = null;
curBeam = null;
frameCount = 0;
total = 0;
i = 0;
while (i <= base) {
total = total + (base - i);
i++;
}
house = new Array();
pairs = new Array();
beams = new Array();
curCards = new Array();
numCards = decks[base - 4][0];
numJokers = decks[base - 4][1];
offsetX = (stageX / 2) - (Math.floor(_root.base / 2) * (cardWidth + 10));
createPositions();
createCards();
createTable();
if (mode == mLevels) {
_root.rounds = _root.base - _root.trials;
}
_root.bg = _root["bg" add _root.base];
bg._visible = true;
_root.info_plate._visible = true;
_root.info_plate.rounds_lbl.text = rounds;
_root.info_plate.roundnum_lbl.text = rndPlayed;
_root.cardsLeft.num.text = numCards;
_root.roundtitle_lbl.gotoAndStop(1);
_root.roundtitle_lbl.num.text = rndPlayed;
_root.roundtitle_lbl._x = stageX / 2;
_root.roundtitle_lbl._y = stageY / 2;
_root.roundtitle_lbl.play();
_root.deck_mc._x = 27.5;
_root.back_btn._visible = true;
_root.rules_btn._visible = true;
_root.more_btn._visible = true;
_root.download_btn._visible = true;
fjoker = false;
fblow = -2;
ffly = true;
}
function createCards() {
cards = new Array();
var _local5 = 0;
while (_local5 < numJokers) {
attachMovie(style add "0", "card_mc0" add _local5, getDepth());
_root["card_mc0" add _local5]._x = -200;
_root["card_mc0" add _local5]._y = -200;
_root["card_mc0" add _local5]._width = cardWidth;
_root["card_mc0" add _local5]._height = cardHeight;
cards.push(new Card(-1, 15, _root["card_mc0" add _local5]));
_local5++;
}
if (base == 4) {
deck = 1;
} else {
deck = 2;
}
var _local3 = 0;
while (_local3 < deck) {
_local5 = 2;
while (_local5 <= 14) {
var _local4 = 0;
while (_local4 < 4) {
var _local6 = getDepth();
var _local2 = _local4 add _local5;
attachMovie(style add _local2, ("card_" add _local2) add _local3, _local6);
_root[("card_" add _local2) add _local3]._x = -200;
_root[("card_" add _local2) add _local3]._y = -200;
_root[("card_" add _local2) add _local3]._width = cardWidth;
_root[("card_" add _local2) add _local3]._height = cardHeight;
cards.push(new Card(_local4, _local5, _root[("card_" add _local2) add _local3]));
_local4++;
}
_local5++;
}
_local3++;
}
attachMovie(style add "cover", "deck_mc", getDepth());
_root.deck_mc._width = cardWidth;
_root.deck_mc._height = cardHeight;
_root.deck_mc._x = 100;
_root.deck_mc._y = (stageY - cardHeight) - 5;
attachMovie("cardsLeft_mc", "cardsLeft", getDepth());
_root.cardsLeft._x = (_root.deck_mc._x - (cardWidth / 2)) - 8;
_root.cardsLeft._y = _root.deck_mc._y - (cardHeight / 4);
attachMovie(style add "throw", "throw_twn", getDepth());
_root.throw_twn._x = _root.deck_mc._x;
_root.throw_twn._y = _root.deck_mc._y;
}
function createTable() {
var _local1 = 0;
while (_local1 < 5) {
curCards.push(throwCard(_local1));
_local1++;
}
}
function createPositions() {
var _local3 = offsetX;
var _local2 = 0;
while (_local2 <= base) {
attachMovie("position_mc", "position" add _local2, getDepth());
_root["position" add _local2]._x = _local3;
_root["position" add _local2]._y = offsetY + houseHeight;
_local3 = _local3 + houseWidth;
_local2++;
}
}
function throwAnim() {
_root.ffly = true;
_root.throw_twn._x = _root.deck_mc._x;
_root.throw_twn._y = _root.deck_mc._y;
_root.throw_twn.play();
}
function throwCard(x) {
var _local3;
if (numCards <= 0) {
return(null);
}
throwAnim();
var _local2;
_local2 = Math.round(Math.random() * 100);
_local2 = _local2 % cards.length;
while ((_local2 < numJokers) && (curCards.length < 5)) {
_local2 = Math.round(Math.random() * 100);
_local2 = _local2 % cards.length;
}
_local3 = _root.cards.splice(_local2, 1)[0];
_local3.mc._x = ((stageX / 2) - (3 * cardWidth)) + ((cardWidth + 10) * x);
_local3.mc._y = (stageY - cardHeight) - 5;
_local3.mc._visible = false;
_local3.state = Card.table;
if (_local3.suit == -1) {
_root.joker++;
if (_root.joker > 1) {
_root.fblow = -1;
} else {
oneJoker();
}
}
numCards--;
_root.cardsLeft.num.text = numCards;
if (numCards == 0) {
_root.deck_mc._x = -300;
}
countScores();
return(_local3);
}
function oneJoker() {
var _local3 = -1;
var _local2 = 0;
while (_local2 < _root.house.length) {
if (house[_local2].y > _local3) {
_local3 = house[_local2].y;
}
_local2++;
}
_root.fblow = _local3;
trace("_root.fblow = " add _root.fblow);
}
function checkFree(x, y) {
result = -1;
var _local2 = 0;
var _local1;
_local1 = 0;
while (_local1 < y) {
_local2 = _local2 + (base - _local1);
_local1++;
}
_local1 = _local2 + x;
if (y == 0) {
if ((house[_local1].sum == 0) || (house[_local1] == null)) {
result = _local1;
}
} else {
var _local4;
var _local6;
var _local5 = ((_local2 - base) + y) - 1;
_local4 = house[_local5 + x];
_local6 = house[(_local5 + x) + 1];
if ((((_local4.sum != 0) && (_local6.sum != 0)) && (_local4.covered == 1)) && ((house[_local1].sum == 0) || (house[_local1] == null))) {
result = _local1;
}
}
return(result);
}
function ofset(lvl) {
var _local1 = 0;
i = 0;
while (i < lvl) {
_local1 = _local1 + (base - i);
i++;
}
return(_local1);
}
function inHouse(pos) {
function putIn(qual) {
curPair.quality = qual;
curPair.covered = 0;
house[pos] = curPair;
d = (pos + ofset(curPair.y)) + 5;
curPair.mc.swapDepths(d);
}
result = true;
if (house[pos] == undefined) {
level++;
}
var _local3;
var _local2;
var _local1 = false;
var _local8 = ofset(curPair.y);
var _local6 = ((_local8 - base) + curPair.y) - 1;
_local3 = house[_local6 + curPair.x];
_local2 = house[(_local6 + curPair.x) + 1];
if (y == 0) {
putIn(1);
_local1 = true;
} else if (curPair.sum == 20) {
putIn(1);
_local1 = true;
} else if (pair_sum == 21) {
_local3.quality = 1;
_local2.quality = 1;
var _local7 = new Color(_local3.mc.sum);
_local7.setRGB(6710886);
_local7 = new Color(_local2.mc.sum);
_local7.setRGB(6710886);
putIn(1);
_local1 = true;
} else if ((curPair.sum <= _local3.sum) && (curPair.sum <= _local2.sum)) {
putIn(0);
_local1 = true;
} else if ((_local3.quality >= 1) && (_local2.quality >= 1)) {
putIn(0);
_local1 = true;
} else if ((_local3.quality >= 1) && (_local2.sum >= curPair.sum)) {
putIn(0);
_local1 = true;
} else if ((_local2.quality >= 1) && (_local3.sum >= curPair.sum)) {
putIn(0);
_local1 = true;
} else if ((curPair.card1.points == 11) || (curPair.card2.points == 11)) {
curPair.sum = curPair.sum - 10;
curPair.mc.sum.text = curPair.sum;
if ((curPair.sum <= _local3.sum) && (curPair.sum <= _local2.sum)) {
putIn(0);
_local1 = true;
}
}
if (!_local1) {
var _local5 = -1;
var _local4 = -1;
if (_local3.sum < curPair.sum) {
_local5 = _local6 + curPair.x;
}
if (_local2.sum < curPair.sum) {
_local4 = (_local6 + curPair.x) + 1;
}
if (house[_local5].quality == 1) {
blowPair(-1, _local4);
} else if (house[_local4].quality == 1) {
blowPair(_local5, -1);
} else {
blowPair(_local5, _local4);
}
result = false;
fthrow = true;
}
countScores();
return(result);
}
function throw2Cards() {
var _local2 = falls.length;
var _local1 = 0;
while (_local1 < _local2) {
removeMovieClip(falls.pop());
_local1++;
}
fthrow = false;
curCards[pair_first] = throwCard(pair_first);
curCards[pair_second] = throwCard(pair_second);
if (state == stPlay) {
gameState();
}
}
function canBeam() {
trace("canBeam");
var _local6 = false;
var _local1;
var _local3;
var _local5 = 0;
var _local4 = 0;
while (_local4 <= level) {
if (_local4 > 0) {
_local5 = _local5 + ((base - _local4) + 1);
}
var _local2 = 0;
while (_local2 < ((base - _local4) - 1)) {
_local1 = house[_local5 + _local2];
_local3 = house[(_local5 + _local2) + 1];
trace("house1.covered = " add _local1.covered);
trace("house1 = " add _local1);
trace("house2.covered = " add _local3.covered);
trace("house2 = " add _local3);
if (((((_local1 != null) && (_local3 != null)) && (_local1.sum != 0)) && (_local3.sum != 0)) && (_local1.covered == 0)) {
_local6 = true;
}
_local2++;
}
_local4++;
}
trace("result = " add _local6);
return(_local6);
}
function getDepth() {
if (typeof(curDepth) == "undefined") {
curDepth = 5;
}
curDepth++;
return(curDepth);
}
function blow(num) {
trace("blow " add num);
playSound("snd_blowrow");
var _local2 = 0;
if (num == -1) {
_local2 = 0;
while (_local2 < house.length) {
house[_local2].mc.removeMovieClip();
_local2++;
}
house.splice(0);
_local2 = 0;
while (_local2 < beams.length) {
beams[_local2].mc.removeMovieClip();
_local2++;
}
beams.splice(0);
_local2 = 0;
while (_local2 < base) {
house.push(new Pair(null, null));
_local2++;
}
} else {
trace("blow " add num);
_local2 = 0;
while (_local2 < house.length) {
if (house[_local2].y == num) {
if (house[_local2].sum < 21) {
house[_local2].mc.removeMovieClip();
house[_local2] = undefined;
} else {
house[_local2].covered = 0;
}
}
_local2++;
}
_local2 = 0;
while (_local2 < beams.length) {
trace((((("beam:" add _local2) add " on x:") add beams[_local2].x) add " on y:") add beams[_local2].y);
if (beams[_local2].y == num) {
trace("deliting beam");
beams[_local2].mc.removeMovieClip();
beams[_local2] = undefined;
}
_local2++;
}
if (_root.level > 0) {
_local2 = 0;
while (_local2 < house.length) {
if (house[_local2].y == num) {
_root.level--;
break;
}
_local2++;
}
}
}
fblow = -2;
countScores();
gameState();
}
function blowAnim(x, y) {
fallCount++;
attachMovie(style add "fall_twn", (style add "fall_twn") add fallCount, getDepth());
falls.push(_root[(style add "fall_twn") add fallCount]);
_root[(style add "fall_twn") add fallCount]._x = x;
_root[(style add "fall_twn") add fallCount]._y = y;
_root[(style add "fall_twn") add fallCount].play();
}
function blowPair(left, right) {
trace("blowPair");
playSound("snd_blowpair");
if (left != -1) {
if (house[left].sum == 21) {
trace("l - 21");
unCementHouse(house[((left - base) + house[left].y) - 1]);
}
if ((left > 0) && (house[left - 1].covered != 0)) {
_root[house[left - 1].beam].removeMovieClip();
house[left - 1].covered = 0;
}
_root[house[left].beam].removeMovieClip();
blowAnim(house[left].mc._x, house[left].mc._y);
house[left].mc.removeMovieClip();
var _local5 = ofset(house[left].y);
var _local4 = (((_local5 + base) - house[left].y) + house[left].x) - 1;
if ((((house[_local4].sum != 0) && (_local4 < house.length)) && (house[left].x > 0)) && ((house[_local4].y - 1) == house[left].y)) {
blowPair(_local4, -1);
}
house[left] = null;
} else {
_root[house[right - 1].beam].removeMovieClip();
house[right - 1].covered = 0;
}
if (right != -1) {
if (house[right].sum == 21) {
trace("r - 21");
unCementHouse(house[(right - base) + house[right].y]);
}
if (house[right].covered != 0) {
_root[house[right].beam].removeMovieClip();
}
blowAnim(house[right].mc._x, house[right].mc._y);
house[right].mc.removeMovieClip();
var _local5 = ofset(house[right].y);
var _local4 = ((_local5 + base) - house[right].y) + house[right].x;
if ((((house[_local4].sum != 0) && (_local4 < house.length)) && (house[right].x < ((_local5 + base) - house[right].y))) && ((house[_local4].y - 1) == house[right].y)) {
blowPair(-1, _local4);
checklevel(house[right].y);
}
house[right] = null;
}
}
function unCementHouse(h) {
h.quality = 0;
var _local1 = new Color(h.mc.sum);
_local1.setRGB(0);
if (h.sum == 20) {
_local1.setRGB(153);
}
}
function checkLevel(lev) {
var _local2 = false;
var _local1 = 0;
while (_local1 < house.length) {
if (house[_local1].y == lev) {
_local2 = true;
}
_local1++;
}
if ((!_local2) && (level == lev)) {
level--;
}
}
function newRound() {
_root.win_plate.removeMovieClip();
_root.lose_plate.removeMovieClip();
if (base == 6) {
trace("cool!");
gameOver();
return(undefined);
}
if (mode == mPractice) {
if (rndPlayed < rounds) {
removeRound();
gotoAndPlay ("game");
} else {
gameOver();
}
} else if (lostRound == false) {
if (base == 7) {
winGame();
} else {
rounds = trials;
base++;
totalRnd++;
rndPlayed = 0;
removeRound();
_root.preLevel();
}
} else if (rounds > rndPlayed) {
totalRnd++;
removeRound();
_root.preLevel();
} else {
gameOver();
}
}
function removeRound() {
info_plate._visible = false;
bg._visible = false;
_root.back_btn._visible = false;
_root.rules_btn._visible = false;
_root.more_btn._visible = false;
_root.download_btn._visible = false;
removeHouse();
removePositions();
}
function removeHouse() {
var _local2;
_local2 = 0;
while (_local2 < cards.length) {
cards[_local2].mc.removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < curCards.length) {
curCards[_local2].mc.removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < house.length) {
if (house[_local2] != undefined) {
house[_local2].mc.removeMovieClip();
}
_local2++;
}
_local2 = 0;
while (_local2 < beams.length) {
beams[_local2].mc.removeMovieClip();
_local2++;
}
cards.splice(0);
curCards.splice(0);
house.splice(0);
beams.splice(0);
_root.deck_mc.removeMovieClip();
_root.cardsLeft.removeMovieClip();
}
function removePositions() {
var _local2 = 0;
while (_local2 <= base) {
_root["position" add _local2].removeMovieClip();
_local2++;
}
_root.frame._x = -100;
_root.frame._y = -100;
}
function gameState() {
if (house.length == total) {
win();
} else if (joker > 1) {
lost(3);
} else {
_root.cardsLeft.num.text = numCards;
var _local7 = 0;
var _local6 = 0;
var _local5 = 0;
var _local2 = 0;
while (_local2 < house.length) {
if (!((house[_local2].sum == undefined) || (house[_local2].sum == 0))) {
_local7++;
if (house[_local2].covered == 1) {
_local6++;
}
}
_local2++;
}
_local2 = 0;
while (_local2 < 5) {
if (curCards[_local2] != undefined) {
_local5++;
}
_local2++;
}
if (((((total * 2) + total) - base) - ((_local7 * 2) + _local6)) > (numCards + _local5)) {
lost(1);
} else {
var _local4 = false;
_local2 = 0;
while (_local2 < 4) {
var _local3 = _local2 + 1;
while (_local3 < 5) {
if ((curCards[_local2].suit == curCards[_local3].suit) && (curCards[_local2].suit != undefined)) {
_local4 = true;
}
if ((curCards[_local2].value == curCards[_local3].value) && (curCards[_local2].value != undefined)) {
_local4 = true;
}
_local3++;
}
_local2++;
}
if ((!_local4) && (!canBeam())) {
lost(2);
}
}
}
}
function countScores() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < house.length) {
if (house[_local2].sum != undefined) {
_local3 = _local3 + house[_local2].sum;
}
_local2++;
}
_root.info_plate.scores_lbl.text = _local3;
return(_local3);
}
function playSound(snd) {
if (fsound) {
var _local2 = _root.SoundEng.addStream(snd);
_root.SoundEng.play(_local2);
}
}
function musicOnOff() {
if (fmusic) {
_root.MusicEng.soundOn();
} else {
_root.MusicEng.soundOff();
}
saveSettings();
}
function initMusic() {
var _local2 = _root.MusicEng.addStream("mus_gameplay");
_root.MusicEng.play(_local2);
_root.MusicEng.soundOff();
}
function sound_music_btns() {
if (_root.fsound) {
_root.sound_btn.gotoAndStop(1);
} else {
_root.sound_btn.gotoAndStop(2);
}
if (_root.fmusic) {
_root.music_btn.gotoAndStop(1);
} else {
_root.music_btn.gotoAndStop(2);
}
}
function clearData() {
rndPlayed = 0;
bestScore = 0;
practiceScores = 0;
levelScores = 0;
}
function ef() {
if (_root._ymouse < 480) {
mccc.makeBeam();
_root.onEnterFrame = undefined;
}
}
function win() {
playSound("snd_win");
rndWon++;
var _local4 = countScores();
var _local3 = 0;
var _local2 = 0;
while (_local2 < 5) {
if (curCards[_local2] != undefined) {
_local3++;
}
_local2++;
}
_local4 = _local4 + numCards;
_local4 = _local4 + _local3;
if (_local4 > bestScore) {
bestScore = _local4;
}
attachMovie("win_mc", "win_plate", getDepth());
if (_root.mode == _root.mPractice) {
practiceScores = practiceScores + _local4;
_root.win_plate.total.text = practiceScores;
} else {
levelScores = levelScores + _local4;
_root.win_plate.total.text = levelScores;
}
_root.win_plate.points.text = _local4;
_root.win_plate.left.text = numCards + _local3;
_root.win_plate._x = stageX / 2;
_root.win_plate._y = stageY / 2;
state = stStop;
stop();
}
function lost(cause) {
playSound("snd_lost");
lostRound = true;
var _local2 = countScores();
if (_local2 > bestScore) {
bestScore = _local2;
}
attachMovie("lose_mc", "lose_plate", getDepth());
if (mode == mPractice) {
practiceScores = practiceScores + _local2;
_root.win_plate.total.text = practiceScores;
} else {
_root.win_plate.total.text = levelScores;
}
_root.lose_plate.points.text = _local2;
_root.lose_plate._x = stageX / 2;
_root.lose_plate._y = stageY / 2;
switch (cause) {
case 0 :
break;
case 1 :
_root.lose_plate.message.text = "Not enough cards to finish the house";
break;
case 2 :
trace("joker1");
_root.lose_plate.message.text = "No move possible";
break;
case 3 :
_root.lose_plate.message.text = "Two Blowing Jokers";
}
state = stStop;
stop();
}
function gameOver() {
attachMovie("gameOver_mc", "gameOver_plate", getDepth());
if (mode == mPractice) {
_root.gameOver_plate.points.text = practiceScores;
_root.gameOver_plate.played.text = rndPlayed;
} else {
flevesPlayed = false;
_root.gameOver_plate.points.text = levelScores;
_root.gameOver_plate.played.text = totalRnd;
}
_root.gameOver_plate.won.text = rndWon;
_root.gameOver_plate.best.text = bestScore;
_root.gameOver_plate._x = stageX / 2;
_root.gameOver_plate._y = stageY / 2;
state = stStop;
}
function winGame() {
playSound("snd_win1");
attachMovie("winGame", "winGame_plate", getDepth());
if (mode == mPractice) {
_root.winGame_plate.points.text = practiceScores;
} else {
_root.winGame_plate.points.text = levelScores;
}
_root.winGame_plate.played.text = rndPlayed;
_root.winGame_plate.won.text = rndWon;
_root.winGame_plate.best.text = bestScore;
_root.winGame_plate._x = stageX / 2;
_root.winGame_plate._y = stageY / 2;
}
function pause() {
if (state == stPlay) {
state = stPause;
_root.stopTime();
} else if (state == stPause) {
state = stPlay;
_root.startTime();
}
}
function back() {
if (state != stPlay) {
return(undefined);
}
_root.win_plate.removeMovieClip();
_root.lose_plate.removeMovieClip();
state = stStop;
showPrompt("Do you want to quit this game?", ok);
}
function ok() {
_root.bg._visible = false;
_root.info_plate._visible = false;
_root.back_btn._visible = false;
_root.download_btn._visible = false;
_root.rules_btn._visible = false;
if (state == stClear) {
_root.clearScores();
_root.loadScores();
_root.showScores();
state = stStop;
} else {
removeHouse();
removePositions();
if (mode == mLevels) {
var _local2 = 0;
while (_local2 < house.length) {
if (house[_local2].sum != undefined) {
sum = sum + house[_local2].sum;
}
_local2++;
}
if (sum > bestScore) {
bestScore = sum;
}
gameOver();
} else if (_root.mode == _root.mPractice) {
_root.w_practiceMenu._visible = true;
}
}
_root._ignoreuser = fasle;
}
function cancel() {
if (state == stClear) {
state = stStop;
} else {
state = stPlay;
}
_root._ignoreuser = false;
_root.ok_cancel_mc.removeMovieClip();
}
function checkGameScores() {
_root.gameOver_plate.removeMovieClip();
_root.winGame_plate.removeMovieClip();
_root.removeRound();
_root.loadScores();
_root.preGame();
}
function practiceMode() {
_root.clearData();
_root.w_menu._visible = false;
_root.rounds = _root.practiceRounds;
_root.choseMode_mc.removeMovieClip();
_root.mode = 0;
_root.loadSettings();
_root.w_practiceMenu.rounds_lbl.text = _root.rounds;
_root.w_practiceMenu.level_lbl.text = _root.base;
_root.w_practiceMenu._visible = true;
_root.w_practiceMenu.changeTower.gotoAndStop(_root.base - 3);
}
function levelMode() {
_root.clearData();
_root.w_menu._visible = false;
_root.choseMode_mc.removeMovieClip();
_root.mode = _root.mLevels;
_root.base = 4;
_root.bestScore = 0;
_root.totalRnd = 1;
_root.rounds = 0;
_root.rndPlayed = 0;
_root.preLevel();
}
function chooseMode() {
_root.w_menu._visible = false;
_root.w_preLevel._visible = false;
_root.attachMovie("choseMode", "choseMode_mc", getDepth());
_root.choseMode_mc._x = stageX / 2;
_root.choseMode_mc._y = stageY / 2;
}
function showRules() {
_root.w_menu._visible = false;
attachMovie("rules", "rules_mc", getDepth());
_root.rules_mc._x = stageX / 2;
_root.rules_mc._y = stageY / 2;
}
function showSettings() {
_root.w_menu._visible = false;
_root.w_settings._visible = true;
}
function preGame(clip) {
removeMovieClip(clip);
w_preLevel._visible = false;
w_menu._visible = true;
}
function preLevel() {
var _local6 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
var _local5 = {ra:50, rb:50, ga:50, gb:50, ba:50, bb:50, aa:100, ab:0};
var _local2 = 4;
while (_local2 <= 7) {
_root.w_preLevel["strelka" add _local2]._visible = false;
var _local4 = new Color(_root.w_preLevel["place" add _local2]);
_local4.setTransform(_local6);
_root.w_preLevel["place" add _local2]._alpha = 100;
_local2++;
}
_root.w_preLevel._visible = true;
_root.w_preLevel["strelka" add base]._visible = true;
_root.w_preLevel["move" add (base - 4)].gotoAndStop(1);
_root.w_preLevel["move" add (base - 4)].mov.gotoAndStop(1);
_root.w_preLevel["move" add (base - 4)]._visible = true;
_root.w_preLevel["move" add (base - 4)].gotoAndPlay(1);
_root.w_preLevel["move" add (base - 4)].mov.gotoAndPlay(1);
_local2 = 4;
while (_local2 < 8) {
if (_root.base > _local2) {
var _local3 = new Color(_root.w_preLevel["place" add _local2]);
_local3.setTransform(_local5);
}
if (_root.base < _local2) {
_root.w_preLevel["place" add _local2]._alpha = 30;
}
_local2++;
}
_root.w_preLevel.trials_lbl.text = (_root.base - _root.trials) - rndPlayed;
}
function showPrompt(_text, fn, fn1) {
attachMovie("Ok_Cancel", "ok_cancel_mc", getDepth());
_root.ok_cancel_mc.txt.text = _text;
_root.ok_cancel_mc._x = stageX / 2;
_root.ok_cancel_mc._y = stageY / 2;
_root.ok_cancel_mc.ok_btn.onPress = function () {
_root._ignoreuser = false;
removeMovieClip(_root.ok_cancel_mc);
fn();
};
_root.ok_cancel_mc.cancel_btn.onPress = function () {
_root._ignoreuser = false;
if (state == stClear) {
state = stStop;
} else {
state = stPlay;
}
_root._ignoreuser = false;
_root.ok_cancel_mc.removeMovieClip();
fn1();
};
_root._ignoreuser = true;
}
function getMoreGames() {
getURL (_root.moreGamesURL, "_blank");
}
function dounloadFullVersion() {
getURL (_root.downLoadFullVersionURL, "_blank");
}
function buyGame() {
showPrompt("More levels in offline version only.\n Buy game?", _root.downLoadGame, _root.cancDownlGms());
removeRound();
}
function cancDownlGms() {
_root.numFrame_mc._visible = false;
_root.w_preLevel._visible = false;
_root.preGame(this);
}
function chooseLevel(num) {
_root.base = num;
_root.w_practiceMenu.changeTower.gotoAndStop(num - 3);
}
function chooseRounds(num) {
_root.rounds = num;
_root.practiceRounds = num;
_root.w_practiceMenu.rounds_lbl.text = num;
}
var mPractice = 0;
var mLevels = 1;
var numHiScores = 10;
var trials = 1;
var diamonds = 0;
var clubs = 1;
var hearts = 2;
var spades = 3;
var ofsetX = 200;
var offsetY = 410;
var houseWidth = 50;
var houseHeight = 60;
var cardWidth = 63.6;
var cardHeight = 100;
var shiftX = 14.6;
var stStop = 0;
var stPlay = 1;
var stPause = 2;
var stClear = 3;
var stBack = 4;
var decks = [[53, 1], [70, 2], [84, 4], [114, 7]];
var styleC = "c";
var styleE = "e";
var styleF = "f";
var styleG = "g";
var styleJ = "j";
var styleP = "p";
var moreGamesURL = "http://www.doublegames.com/?fr=castleofcardson";
var downLoadFullVersionURL = "http://www.doublegames.com/castleofcards.html?fr=castleofcardson";
var practiceScores = 0;
var levelScores = 0;
var rndPlayed = 0;
var totalRnd = 0;
var rndWon = 0;
var mode;
var base = 4;
var rounds = 1;
var total;
var lostRound;
var bestScore;
var practiceRounds;
var level;
var state;
var numCards;
var numJokers;
var cards;
var curCards;
var house;
var beams;
var selectNum;
var pHiScores;
var lHiScores;
var pair_first;
var pair_second;
var curPair;
var curBeam;
var pair;
var selected;
var beamed;
var joker;
var SoundEng = (new com.itpremium.utils.WaveEngine(1));
var MusicEng = (new com.itpremium.utils.WaveEngine(2));
var fsound = false;
var fmusic = false;
var fthrow;
var ffall;
var fblow;
var ffly;
var fmax = true;
var flevelsPlayed;
var style;
var _ignoreuser = false;
var bg;
var stageX = Stage.width;
var stageY = Stage.height;
var falls = new Array();
var fallCount = 0;
var gameDownload = new TextFormat();
var defPUsers = [["Jack", 600], ["Smith", 578], ["Tom", 546], ["Tracy", 490], ["Jane", 430], ["Kyle", 422], ["Stane", 280], ["Cole", 240], ["Larry", 238], ["John", 111]];
var defLUsers = [["Kyle", 1120], ["Smith", 1048], ["Jane", 987], ["Tracy", 714], ["Jack", 645], ["Larry", 564], ["Tom", 450], ["Cole", 445], ["Stane", 401], ["John", 385]];
settings = SharedObject.getLocal("house_of_cards_settings_v0.0");
_root.w_practiceMenu.changeTower.gotoAndStop(_root.base - 3);
_root.w_practiceMenu.rounds_lbl.text = _root.rounds;
w_practiceMenu.beginner_btn.onPress = function () {
if (_root._ignoreuser) {
return(undefined);
}
chooseLevel(4);
};
w_practiceMenu.easy_btn.onPress = function () {
if (_root._ignoreuser) {
return(undefined);
}
chooseLevel(5);
};
w_practiceMenu.start_btn.onPress = function () {
if (_root._ignoreuser) {
return(undefined);
}
_root.clearData();
_root.savePracticeSettings();
_root.w_practiceMenu._visible = false;
_root.gotoAndPlay("game");
};
w_practiceMenu.back_btn.onPress = function () {
if (_root._ignoreuser) {
return(undefined);
}
_root.w_practiceMenu._visible = false;
_root.chooseMode();
};
w_practiceMenu.round1_btn.onPress = function () {
if (_root._ignoreuser) {
return(undefined);
}
chooseRounds(1);
};
w_practiceMenu.round2_btn.onPress = function () {
if (_root._ignoreuser) {
return(undefined);
}
chooseRounds(5);
};
_root.mode = _root.mPractice;
start_btn.onPress = function () {
attachMovie("choseMode", "choseMode_mc", getDepth());
_root.choseMode_mc._x = _root.width / 2;
_root.choseMode_mc._y = _root.height / 2;
_root.choseMode_mc.practice_btn.onPress = practiceMode;
_root.choseMode_mc.level_btn.onPress = levelMode;
};
close_btn.onPress = function () {
fscommand ("quit");
};
settings_btn.onPress = function () {
attachMovie("settings_wnd", "wnd_settings", getDepth());
_root.wnd_settings._x = _root.width / 2;
_root.wnd_settings._y = _root.height / 2;
};
download_btn.onPress = function () {
getURL (_root.downLoadFullVersionURL, "_blank");
};
w_menu.min_btn.onPress = function () {
fscommand ("fullscreen", fmax);
fmax = !fmax;
if (fmax) {
_root.min_btn.gotoAndStop(2);
} else {
_root.min_btn.gotoAndStop(1);
}
};
stop();
_root.w_preLevel._visible = false;
_root.w_practiceMenu._visible = false;
_root.w_settings._visible = false;
_root.w_prompt._visible = false;
_root.bg4._visible = false;
_root.bg5._visible = false;
_root.bg6._visible = false;
_root.info_plate._visible = false;
_root.w_preLevel.move1._visible = false;
_root.w_preLevel.move2._visible = false;
_root.w_preLevel.move3._visible = false;
w_choseMode._visible = false;
_root.loadSettings();
_root.initMusic();
_root.musicOnOff();
gameDownload.url = DownloadURL;
gotoAndStop ("mode");
Instance of Symbol 487 MovieClip "sound_btn" in Frame 2
on (press) {
if (_root.sound_btn._currentframe == 1) {
_root.sound_btn.gotoAndStop(2);
} else {
_root.sound_btn.gotoAndStop(1);
}
_root.fsound = !_root.fsound;
_root.playSound("snd_on");
_root.saveSettings();
}
Instance of Symbol 491 MovieClip "music_btn" in Frame 2
on (press) {
if (_root.music_btn._currentframe == 1) {
_root.music_btn.gotoAndStop(2);
} else {
_root.music_btn.gotoAndStop(1);
}
_root.fmusic = !_root.fmusic;
_root.musicOnOff();
}
Frame 3
initRound();
Frame 4
function mainProcess() {
if (_root.fthrow && (!_root.ffall)) {
_root.throw2Cards();
}
if ((_root.fblow > -2) && (!_root.ffly)) {
_root.blow(_root.fblow);
}
}
mainProcess();
Frame 5
gotoAndPlay ("main");
Symbol 26 Button
on (release) {
this.removeMovieClip();
}
Symbol 31 Button
on (press) {
_root.getMoreGames();
}
Symbol 38 MovieClip [fthrow] Frame 9
stop();
this._x = -100;
this._y = -100;
var i = 0;
while (i < 5) {
_root.curCards[i].mc._visible = true;
i++;
}
_root.ffly = false;
Symbol 46 MovieClip [ffall_twn] Frame 1
_root.ffall = true;
Symbol 46 MovieClip [ffall_twn] Frame 17
stop();
_root.ffall = false;
Symbol 48 MovieClip [fbeam_mc] Frame 1
Symbol 518 MovieClip [__Packages.Card] Frame 0
class Card
{
var mc, suit, value, points;
function Card (s, v, _mc) {
mc = _mc;
suit = s;
value = v;
if (v < 11) {
points = v;
} else if (v < 14) {
points = 10;
} else if (v == 14) {
points = 11;
} else {
points = 0;
}
state = deck;
mc.getSt = mx.utils.Delegate.create(this, getSt);
mc.makeBeam = mx.utils.Delegate.create(this, makeBeam);
mc.onPress = press;
mc.onRollOut = makeBeamRolOut;
}
function getSt() {
return(state);
}
function pairUp(other) {
var _local2 = 0;
if ((suit == other.suit) || (value == other.value)) {
_local2 = points + other.points;
}
return(_local2);
}
function press(i) {
function unBeam() {
if (_root.beamed) {
_root.curBeam.putBack();
_root.beamed = false;
}
}
if (_root.state != _root.stPlay) {
return(undefined);
}
if (i == undefined) {
var _local3 = 0;
while (_local3 < 5) {
if ((_root.curCards[_local3].mc == this) && (getSt() == table)) {
i = _local3;
}
_local3++;
}
}
if (_root.selected == false) {
_root.selected = true;
_root.selectNum = i;
_root.frame._x = _root.curCards[_root.selectNum].mc._x + (_root.cardWidth / 2);
_root.frame._y = _root.curCards[_root.selectNum].mc._y + (_root.cardHeight / 2);
_root.curCards[i].mc.state = beam;
} else if (_root.selectNum != i) {
var _local5 = _root.curCards[_root.selectNum].pairUp(_root.curCards[i]);
if (_local5 == 0) {
unBeam();
_root.selected = true;
_root.selectNum = i;
_root.frame._x = _root.curCards[_root.selectNum].mc._x + (_root.cardWidth / 2);
_root.frame._y = _root.curCards[_root.selectNum].mc._y + (_root.cardHeight / 2);
} else {
unBeam();
_root.curPair = new Pair(_root.curCards[i], _root.curCards[_root.selectNum]);
_root.pair_sum = _local5;
_root.pair_first = _root.selectNum;
_root.pair_second = i;
_root.selected = false;
_root.frame._x = _root.undercard._x;
_root.frame._y = _root.undercard._y;
}
} else {
_root.selected = false;
unBeam();
}
}
function makeBeamRolOut() {
if ((((getSt() == table) && (_root.selected)) && (_root.canBeam())) && (!_root.beamed)) {
_root.mccc = this;
_root.onEnterFrame = _root.ef;
}
}
function makeBeam() {
_root.curBeam = new Beam(_root.curCards[_root.selectNum].value);
_root.curCards[_root.selectNum].state = beam;
_root.curCards[_root.selectNum].mc._x = _root.undercard._x;
_root.curCards[_root.selectNum].mc._y = _root.undercard._y;
_root.frame._x = _root.curCards[_root.selectNum].mc._x + (_root.cardWidth / 2);
_root.frame._y = _root.curCards[_root.selectNum].mc._y + (_root.cardHeight / 2);
_root.beamed = true;
}
static var deck = 0;
static var table = 1;
static var pair = 2;
static var house = 3;
static var beam = 4;
var state = -1;
}
Symbol 519 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 520 MovieClip [__Packages.Pair] Frame 0
class Pair
{
var card1, card2, state, sum, mc, y, x;
function Pair (c1, c2) {
_root.onEnterFrame = undefined;
card1 = c1;
card2 = c2;
state = free;
sum = 0;
if ((c1 != null) && (c2 != null)) {
sum = card1.points + card2.points;
if (sum == 22) {
sum = 12;
}
_root.attachMovie(_root.style add "pair_mc", "pair" add count, _root.getDepth());
mc = _root["pair" add count];
mc.sum.text = sum;
if (sum == 20) {
var _local3 = new Color(mc.sum);
_local3.setRGB(26265);
}
if (sum == 21) {
var _local3 = new Color(mc.sum);
_local3.setRGB(6710886);
}
mc._x = -100;
mc._y = -100;
mc.startDrag(true);
card1.mc._x = _root.undercard._x;
card1.mc._y = _root.undercard._y;
card2.mc._x = _root.undercard._x;
card2.mc._y = _root.undercard._y;
_root.pair = true;
mc.onPress = mx.utils.Delegate.create(this, press);
}
count++;
}
function killme() {
mc.stopDrag();
mc.removeMovieClip();
_root.curPair = null;
}
function canPut() {
var _local3 = -1;
y = (mc._y - _root.offsetY) + (_root.houseHeight * _root.base);
if (y > 0) {
y = _root.base - Math.floor(y / _root.houseHeight);
} else {
y = -1;
}
x = Math.round((mc._x - _root.offsetX) - (_root.shiftX * y));
if (x > 0) {
x = Math.round((x / _root.houseWidth) - 1);
} else {
x = _root.base + 1;
}
if (((y >= 0) && (y < _root.base)) && (x < (_root.base - y))) {
_local3 = _root.checkFree(x, y);
}
return(_local3);
}
function press() {
if (state == free) {
var _local3 = canPut();
if (_local3 != -1) {
mc.stopDrag();
if (_root.inHouse(_local3)) {
putPair(_local3);
state = house;
_root.selected = false;
_root.throw2Cards();
} else {
killme();
}
} else if (mc._y > _root.offsetY) {
putBack();
} else {
_root.playSound("snd_cantput");
}
}
}
function putPair(pos) {
_root.playSound("snd_putpair");
mc._y = ((_root.offsetY + _root.houseHeight) - 18) - (_root.houseHeight * y);
mc._x = ((_root.offsetX + (_root.houseWidth * (x + 1))) - 3) + (_root.shiftX * y);
card1.state = Card.house;
card2.state = Card.house;
}
function putBack() {
card1.state = Card.table;
card2.state = Card.table;
card2.mc._x = ((_root.stageX / 2) - (3 * _root.cardWidth)) + ((_root.cardWidth + 10) * _root.pair_first);
card2.mc._y = (_root.stageY - _root.cardHeight) - 5;
card1.mc._x = ((_root.stageX / 2) - (3 * _root.cardWidth)) + ((_root.cardWidth + 10) * _root.pair_second);
card1.mc._y = (_root.stageY - _root.cardHeight) - 5;
killme();
}
static var count = 0;
static var free = 0;
static var house = 1;
}
Symbol 521 MovieClip [__Packages.Beam] Frame 0
class Beam
{
var mc, y, x;
function Beam (val) {
_root.attachMovie(_root.style add "beam_mc", "beam" add count, _root.getDepth());
_root["beam" add count]._x = _root._xmouse;
_root["beam" add count]._y = _root._ymouse;
mc = _root["beam" add count];
mc._visible = false;
if (val == 15) {
joker = true;
}
mc.startDrag(true);
mc._visible = true;
mc.onPress = mx.utils.Delegate.create(this, press);
count++;
}
function press() {
var _local3 = -1;
if (mc._y > (_root.offsetY + (_root.houseHeight * 1.5))) {
_local3 = Math.floor(((mc._x - ((_root.stageX / 2) - (3 * _root.cardWidth))) + 10) / (_root.cardWidth + 10));
}
if ((_local3 > -1) && (_local3 < 5)) {
_root.curCards[_local3].press(_local3);
} else {
var _local4 = canPut();
if (_local4 != -1) {
put(_local4);
} else if (_root.beamed) {
putBack();
_root.beamed = false;
}
}
}
function putBack() {
_root.playSound("snd_cantput");
_root.curCards[_root.selectNum].state = Card.table;
_root.curCards[_root.selectNum].mc._x = ((_root.stageX / 2) - (3 * _root.cardWidth)) + ((_root.cardWidth + 10) * _root.selectNum);
_root.curCards[_root.selectNum].mc._y = (_root.stageY - _root.cardHeight) - 5;
mc.stopDrag();
mc.removeMovieClip();
_root.curBeam = null;
_root.selected = false;
_root.beamed = false;
}
function canPut() {
trace("canPut");
var _local3 = -1;
y = (mc._y - _root.offsetY) + ((_root.houseHeight + 3) * _root.base);
if (y > 0) {
y = _root.base - Math.floor(y / _root.houseHeight);
} else {
y = -1;
}
x = Math.round(((mc._x - (mc._width / 4)) - _root.offsetX) - (_root.shiftX * (y + 1)));
if (x > 0) {
x = Math.floor(x / _root.houseWidth);
} else {
x = _root.base + 1;
}
if ((y >= 0) && (x < (_root.base - y))) {
_local3 = checkFreeBeam(x, y);
}
trace("result = " add _local3);
return(_local3);
}
function checkFreeBeam(x, y) {
trace((("checkFreeBeam x=" add x) add "; y=") add y);
var _local6 = -1;
var _local8;
var _local7;
var _local9;
var _local3 = 0;
var _local2 = 0;
while (_local2 < y) {
_local3 = _local3 + (_root.base - _local2);
_local2++;
}
_local8 = _root.house[x + _local3].sum;
_local7 = _root.house[(x + _local3) + 1].sum;
_local9 = _root.house[x + _local3].covered;
trace("col1 = " add _local8);
trace("col2 = " add _local7);
trace("covered = " add _local9);
trace("x = " add x);
trace("_root.base = " add _root.base);
trace("y = " add y);
trace("ofst = " add _local3);
if ((((((_local8 != 0) && (_local8 != undefined)) && (_local7 != 0)) && (_local7 != undefined)) && (_local9 == 0)) && (x < ((_root.base - y) - 1))) {
_local6 = x + _local3;
}
trace("result = " add _local6);
return(_local6);
}
function put(pos) {
trace("put");
_root.playSound("snd_putbeam");
mc.stopDrag();
mc._y = (_root.offsetY - (y * _root.houseHeight)) - 4;
mc._x = ((_root.offsetX + (_root.houseWidth * (x + 1))) + (_root.shiftX * (y + 1))) - 3;
if (joker) {
_root.joker--;
}
_root.beams.splice(pos, 0, this);
_root.house[pos].covered = 1;
var _local4 = (_root.house[pos].mc.getDepth() + _root.base) - _root.house[pos].y;
mc.swapDepths(_local4);
_root.house[pos].beam = mc._name;
_root.curCards[_root.selectNum].state = Card.house;
_root.curCards[_root.selectNum] = _root.throwCard(_root.selectNum);
_root.selected = false;
if (_root.state == _root.stPlay) {
_root.gameState();
}
_root.beamed = false;
}
static var count = 0;
var joker = false;
}
Symbol 522 MovieClip [__Packages.com.itpremium.utils.WaveEngine] Frame 0
class com.itpremium.utils.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((("WaveEngine_" + _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, autoDelete) {
if ((id == undefined) || (stack[id] == undefined)) {
return(0);
}
if (type == 2) {
stopAll();
}
secondsOffset = ((secondsOffset == undefined) ? 0 : (secondsOffset));
loops = ((loops == undefined) ? 1 : (loops));
autoDelete = ((autoDelete == undefined) ? true : (autoDelete));
var _local3 = stack[id];
if (mute) {
_local3.setVolume(0);
} else {
_local3.setVolume(_volume);
}
if (type == 2) {
loops = 65536;
}
_local3.start(secondsOffset, loops);
debug(((((("play(" + _local3.__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 _local3 in stack) {
setVolume(_local3, volume);
}
_volume = volume;
}
function debug(msg) {
if (debugOn) {
trace((type + " ") + msg);
}
}
function toString() {
return(("[class WaveEngine::" + ((type == 1) ? "Sound" : "Music")) + "]");
}
var _numSound = 0;
var _volume = 100;
static var _numClass = 0;
}
Symbol 82 Button
on (press) {
_root.practiceMode();
}
Symbol 83 Button
on (press) {
_root.levelMode();
}
Symbol 88 Button
on (press) {
if (_root._ignoreuser) {
return(undefined);
}
_root.numFrame_mc._visible = false;
_root.w_preLevel._visible = false;
_root.preGame(this);
}
Symbol 101 Button
on (press) {
_root.bg._visible = false;
_root.checkGameScores();
}
Symbol 108 Button
on (press) {
_root.newRound();
}
Symbol 120 MovieClip [position_mc] Frame 1
Symbol 122 Button
on (press) {
if (_root._ignoreuser) {
return(undefined);
}
_root.numFrame_mc._visible = false;
_root.w_preLevel._visible = false;
_root.preGame(this);
}
Symbol 155 Button
on (press) {
if (_root._ignoreuser) {
return(undefined);
}
_root._ignoreuser = true;
_root.showPrompt("Available in offline version only.\n Download offline version?", _root.dounloadFullVersion);
}
Symbol 158 MovieClip [settings_wnd] Frame 1
_root.style = _root.styleG;
switch (_root.style) {
case _root.styleC :
selectFrame._x = classic_btn._x + 2;
break;
case _root.styleE :
selectFrame._x = erotic_btn._x + 2;
break;
case _root.styleF :
selectFrame._x = FB_btn._x + 2;
break;
case _root.styleG :
selectFrame._x = gangster_btn._x + 2;
break;
case _root.styleJ :
selectFrame._x = japan_btn._x + 2;
break;
case _root.styleP :
selectFrame._x = prehistoric_btn._x + 2;
}
ok_btn.onPress = function () {
if (_root._ignoreuser) {
return(undefined);
}
_root.saveSettings();
_root.w_settings._visible = false;
_root.w_menu._visible = true;
};
Symbol 170 MovieClip [ebeam_mc] Frame 1
Symbol 175 MovieClip [efall_twn] Frame 1
_root.ffall = true;
Symbol 175 MovieClip [efall_twn] Frame 17
stop();
_root.ffall = false;
Symbol 179 MovieClip [ethrow] Frame 9
stop();
this._x = -100;
this._y = -100;
var i = 0;
while (i < 5) {
_root.curCards[i].mc._visible = true;
i++;
}
_root.ffly = false;
Symbol 185 MovieClip [cbeam_mc] Frame 1
Symbol 190 MovieClip [cfall_twn] Frame 1
_root.ffall = true;
Symbol 190 MovieClip [cfall_twn] Frame 17
stop();
_root.ffall = false;
Symbol 193 MovieClip [cthrow] Frame 9
stop();
this._x = -100;
this._y = -100;
var i = 0;
while (i < 5) {
_root.curCards[i].mc._visible = true;
i++;
}
_root.ffly = false;
Symbol 360 MovieClip [gfall_twn] Frame 1
_root.ffall = true;
Symbol 360 MovieClip [gfall_twn] Frame 17
stop();
_root.ffall = false;
Symbol 364 MovieClip [gthrow] Frame 9
stop();
this._x = -100;
this._y = -100;
var i = 0;
while (i < 5) {
_root.curCards[i].mc._visible = true;
i++;
}
_root.ffly = false;
Symbol 373 MovieClip [jfall_twn] Frame 1
_root.ffall = true;
Symbol 373 MovieClip [jfall_twn] Frame 17
stop();
_root.ffall = false;
Symbol 377 MovieClip [jthrow] Frame 9
stop();
this._x = -100;
this._y = -100;
var i = 0;
while (i < 5) {
_root.curCards[i].mc._visible = true;
i++;
}
_root.ffly = false;
Symbol 384 MovieClip [pfall_twn] Frame 1
_root.ffall = true;
Symbol 384 MovieClip [pfall_twn] Frame 17
stop();
_root.ffall = false;
Symbol 388 MovieClip [pthrow] Frame 9
stop();
this._x = -100;
this._y = -100;
var i = 0;
while (i < 5) {
_root.curCards[i].mc._visible = true;
i++;
}
_root.ffly = false;
Symbol 393 Button
on (press) {
if (_root._ignoreuser) {
return(undefined);
}
_root.showRules();
}
Symbol 395 Button
on (press) {
if (_root._ignoreuser) {
return(undefined);
}
_root._ignoreuser = true;
_root.showPrompt("Available in offline version only.\n Download offline version?", _root.dounloadFullVersion);
}
Symbol 401 Button
on (press) {
if (_root._ignoreuser) {
return(undefined);
}
_root.showSettings();
}
Symbol 407 Button
on (press) {
_root.dounloadFullVersion();
}
Symbol 409 Button
on (press) {
if (_root._ignoreuser) {
return(undefined);
}
_root.chooseMode();
}
Symbol 414 Button
on (press) {
if (_root._ignoreuser) {
return(undefined);
}
_root._ignoreuser = true;
_root.showPrompt("Available in offline version only.\n Download offline version?", _root.dounloadFullVersion);
}
Symbol 416 Button
on (press) {
if (_root._ignoreuser) {
return(undefined);
}
_root._ignoreuser = true;
_root.showPrompt("Available in offline version only.\n Download offline version?", _root.dounloadFullVersion);
}
Symbol 421 Button
on (press) {
if (_root._ignoreuser) {
return(undefined);
}
_root._ignoreuser = true;
_root.showPrompt("Available in offline version only.\n Download offline version?", _root.dounloadFullVersion);
}
Symbol 425 Button
on (press) {
if (_root._ignoreuser) {
return(undefined);
}
_root._ignoreuser = true;
_root.showPrompt("Available in offline version only.\n Download offline version?", _root.dounloadFullVersion);
}
Symbol 464 Button
on (press) {
if (_root.flevesPlayed) {
_root.showPrompt("Do you want to stop playing levels?", _root.gameOver);
} else {
_root.showPrompt("Do you want to stop playing levels?", _root.chooseMode);
}
}
Symbol 467 Button
on (press) {
_root["strelka" add _root.base]._visible = false;
_root.w_preLevel._visible = false;
_root.initGame();
_root.gotoAndPlay("game");
_root.numFrame_mc._visible = false;
_root.flevelsPlayed = true;
if (_root.base > 4) {
var i = 4;
while (i < _root.base) {
_root["checkMark_mc" add i].removeMovieClip();
i++;
}
}
}
Symbol 471 MovieClip Frame 85
stop();
_visible = false;
Symbol 474 MovieClip Frame 50
stop();
_visible = false;
Symbol 478 MovieClip Frame 52
stop();
_visible = false;
Symbol 487 MovieClip Frame 1
stop();
Symbol 487 MovieClip Frame 2
stop();
Symbol 491 MovieClip Frame 1
stop();
Symbol 491 MovieClip Frame 2
stop();
Symbol 497 MovieClip Frame 15
stop();
Symbol 498 Button
on (press) {
_root.back();
}
Symbol 516 Button
on (press) {
_root.getMoreGames();
}
Symbol 517 Button
on (release) {
_root.attachMovie("wnd_rules1", "wnd_rules11", 321654);
}