Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
System.security.allowDomain("mygame.com", "mochibot.com", "flasssh.com", "www.flasssh.com");
Stage.scaleMode = "noScale";
Stage.showMenu = false;
stop();
var result_lv = new LoadVars();
result_lv.onLoad = function (success) {
if (success) {
}
};
var my_lv = new LoadVars();
my_lv.game = "TheDominoKnight";
my_lv.from = _root._url;
my_lv.sendAndLoad("http://mygame.com/loadcount.jsp", result_lv, "GET");
this.onEnterFrame = function () {
loaderBar_mc.progressBar._width = Math.floor(((getBytesLoaded() / getBytesTotal()) * 100) * 1.2);
if (getBytesLoaded() == getBytesTotal()) {
this.onEnterFrame = undefined;
gotoAndStop (2);
}
};
loaderBar_mc.onRelease = function () {
var _local2 = _root._url;
getURL (("http://www.mygame.com/bounce.jsp?game=TheDominoKnight&from=" + _local2) + "&typ=loader_progress", "_blank");
};
__com_mochibot__("36ddd061", this, 10301, true);
Frame 2
_global.DEBUG = false;
_global.NeedLoadVars = false;
_global.DEBUGStepMode = false;
_global.DEBUGNeedTrace = false;
_global.DEBUGNeedStep = false;
_global.SiteURL = "http://www.wildsnake.com";
_global.HSServerFolder = "http://www.flasssh.com/highscore/";
_global.HSGameName = "domino";
_global.LeavesDepth = 0;
_global.Score = 0;
_global.BestScore = 0;
_global.player_name = "Player";
_global.GameInitOK = false;
_global.SoundOn = true;
_global.MusicOn = true;
_global.NextMsgIndex = 0;
_global.NextTempMovieIndex = 0;
_global.LastLevelFrame = 0;
_global.LevelFailReason = 0;
_global.StartStageNumber = 0;
_global.LevelsPerMission = 7;
_global.AddTextMessage = function (Text, BaseDepth, x, y, dAlpha, Scale, dScale, dx, dy) {
var _local4;
_local4 = _root.attachMovie("Score_Text_mc", "Score_Text_mc_tmp_" + _global.NextMsgIndex, BaseDepth + _global.NextMsgIndex);
if (x < 50) {
x = 50;
} else if (x > 595) {
x = 595;
}
if (y < 50) {
y = 50;
} else if (y > 440) {
y = 440;
}
_local4._x = x;
_local4._y = y;
_local4.dx = dx;
_local4.dy = dy;
_local4.Alpha = 100;
if (dAlpha < 0) {
_local4.dAlpha = dAlpha;
} else {
_local4.dAlpha = -3;
}
if (Scale > 0) {
_local4.Scale = Scale;
} else {
_local4.Scale = 10;
}
_local4.dScale = dScale;
_local4.Text_var = Text;
_local4._alpha = _local4.Alpha;
_local4._xscale = _local4.Scale;
_local4._yscale = _local4.Scale;
_local4.onEnterFrame = function () {
this.Alpha = this.Alpha + this.dAlpha;
if (this.Alpha <= 60) {
this._visible = false;
this.removeMovieClip();
this.onEnterFrame = null;
return(undefined);
}
this.Scale = this.Scale + this.dScale;
this._alpha = this.Alpha;
this._xscale = this.Scale;
this._yscale = this.Scale;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
};
_global.NextMsgIndex++;
if (_global.NextMsgIndex > 30) {
_global.NextMsgIndex = 0;
}
};
_global.TempMovies = new Array(16);
_global.DeleteTempMovies = function () {
var _local2;
_local2 = 0;
while (_local2 < _global.TempMovies.length) {
if (_global.TempMovies[_local2] != null) {
_global.TempMovies[_local2]._visible = false;
_global.TempMovies[_local2].removeMovieClip();
_global.TempMovies[_local2].onEnterFrame = null;
_global.TempMovies[_local2] = null;
}
_local2++;
}
};
_global.AddTempMovie = function (Name, BaseDepth, x, y, dx, dy, Alpha, dAlpha, Scale, dScale, FrameMax) {
var mc;
mc = _root.attachMovie(Name, "Temp_mc_tmp_" + _global.NextTempMovieIndex, BaseDepth + _global.NextTempMovieIndex);
_global.TempMovies[_global.NextTempMovieIndex] = mc;
mc._x = x;
mc._y = y;
mc.dx = dx;
mc.dy = dy;
mc.Alpha = Alpha;
mc.dAlpha = dAlpha;
mc.Scale = Scale;
mc.dScale = dScale;
mc.FrameMax = FrameMax;
mc.Frame = 0;
mc._alpha = Math.min(mc.Alpha, 100);
mc._xscale = mc.Scale;
mc._yscale = mc.Scale;
mc.onEnterFrame = function () {
mc.Index = _global.NextTempMovieIndex;
mc.Frame++;
this.Alpha = this.Alpha + this.dAlpha;
if ((this.Alpha < 1) || (mc.Frame >= mc.FrameMax)) {
this._visible = false;
this.removeMovieClip();
this.onEnterFrame = null;
_global.TempMovies[this.Index] = null;
return(undefined);
}
this.Scale = this.Scale + this.dScale;
this._alpha = Math.min(this.Alpha, 100);
this._xscale = this.Scale;
this._yscale = this.Scale;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
};
_global.NextTempMovieIndex++;
if (_global.NextTempMovieIndex >= 16) {
_global.NextTempMovieIndex = 0;
}
};
var VSites = new Array("http:");
var CheckOK = false;
var i;
var j;
i = 0;
while (i < VSites.length) {
j = 0;
while (j < 22) {
if (_root._url.substr(j, VSites[i].length) == VSites[i]) {
CheckOK = true;
break;
}
j++;
}
if (CheckOK) {
break;
}
i++;
}
if (CheckOK) {
stop();
} else if (_global.DEBUG) {
stop();
} else {
gotoAndStop ("protection");
}
Frame 5
Frame 6
stop();
Frame 10
function GameInit() {
if (!_global.GameInitOK) {
_global.GameInitOK = true;
Game = new CGame(this);
_global.SoundPlay = function (Ind) {
Game.Sounds.Play(Ind, 1);
};
_global.SoundStop = function (Ind) {
Game.Sounds.Stop(Ind);
};
_global.SoundPlayRollover = function () {
Game.Sounds.PlayVolume(0, 50, 1);
};
_global.SoundPlayVolume = function (Ind, Volume) {
Game.Sounds.PlayVolume(Ind, Volume, 1);
};
keyListener = new Object();
Key.addListener(keyListener);
mouseListener = new Object();
Mouse.addListener(mouseListener);
keyListener.onKeyDown = function () {
if (Key.getCode() == 32) {
Game.Plane.RotateMouse(-1);
}
if (_global.DEBUG) {
if (Key.getCode() == 49) {
Game.StartNew();
_root.gotoAndStop("NextLevel");
_root.gotoAndStop("Help");
}
if (Key.getCode() == 50) {
var _local3;
Game.StartNewLevel();
_local3 = _root._currentframe;
_root.gotoAndStop("NextLevel");
_root.gotoAndStop(_local3 + 1);
}
if (Key.getCode() == 55) {
Game.Level = Game.Level + 6;
Game.StartNewLevel();
var _local3 = _root._currentframe;
_root.gotoAndStop("NextLevel");
_root.gotoAndStop(_local3 + 7);
}
if (Key.getCode() == 51) {
Game.Level--;
Game.StartNewLevel();
var _local3 = _root._currentframe;
_root.gotoAndStop("NextLevel");
_root.gotoAndStop(_local3);
}
if (Key.getCode() == 52) {
}
if (Key.getCode() == 54) {
Game.WatchTime = Game.WatchTime + Game.WatchTimeAdd;
}
if (Key.getCode() == 56) {
Game.MaxLevelDone = 999;
}
if (Key.getCode() == 57) {
Game.MaxLevelDone = 0;
}
if (Key.getCode() == 76) {
Game.TraceObjects();
}
if (Key.getCode() == 81) {
_global.DEBUGStepMode = !_global.DEBUGStepMode;
}
if (Key.getCode() == 87) {
_global.DEBUGNeedStep = true;
}
if (Key.getCode() == 68) {
_global.DEBUGNeedTrace = !_global.DEBUGNeedTrace;
}
if (Key.getCode() == 87) {
_global.DEBUGNeedTrace = !_global.DEBUGNeedTrace;
}
}
};
mouseListener.onMouseDown = function () {
Game.OnMouseDown(_xmouse, _ymouse);
};
mouseListener.onMouseUp = function () {
Game.OnMouseUp(_xmouse, _ymouse);
};
mouseListener.onMouseWheel = function (delta) {
if (delta > 0) {
Game.Plane.RotateMouse(1);
} else if (delta < 0) {
Game.Plane.RotateMouse(-1);
}
};
this.onEnterFrame = function () {
Game.Update();
};
}
Game.Reset();
Game.Init();
}
var Game;
var keyListener;
var mouseListener;
GameInit();
stop();
var gameUrl = _root._url;
if (_root.Game.IsMissionAvail(0)) {
_root.Button_Continue._visible = true;
} else {
_root.Button_Continue._visible = false;
}
stop();
Hidden_btn_Title.onPress = function () {
_root.gotoAndStop("Help");
Hidden_btn_Title.onPress = null;
};
Frame 15
Frame 20
stop();
Frame 22
help_hard_mc.gotoAndPlay(2);
stop();
Frame 24
help_easy_mc.gotoAndPlay(2);
stop();
Frame 25
Frame 26
Frame 27
Frame 30
if (Game.State == 7) {
Game.State = 1;
} else if (Game.State == 6) {
Game.State = 1;
} else {
Game.StartNew();
}
stop();
Game.Plane.StackSpeed = 0.5;
Game.LevelTime = 60;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 0, 0, 0);
stop();
Frame 31
Game.Plane.StackSpeed = 0.5;
Game.LevelTime = 60;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 0, 0);
stop();
Frame 32
Game.Plane.StackSpeed = 0.6;
Game.LevelTime = 60;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 0, 0);
stop();
Frame 33
Game.Plane.StackSpeed = 0.6;
Game.LevelTime = 60;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 34
Game.Plane.StackSpeed = 0.6;
Game.LevelTime = 60;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 35
Game.Plane.StackSpeed = 0.6;
Game.LevelTime = 60;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 1);
stop();
Frame 36
Game.Plane.StackSpeed = 0.6;
Game.LevelTime = 60;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 1);
stop();
Frame 37
Game.Plane.StackSpeed = 0.7;
Game.LevelTime = 60;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 38
Game.Plane.StackSpeed = 0.7;
Game.LevelTime = 60;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 39
Game.Plane.StackSpeed = 0.7;
Game.LevelTime = 60;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 40
Game.Plane.StackSpeed = 0.7;
Game.LevelTime = 60;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 41
Game.Plane.StackSpeed = 0.8;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 1);
stop();
Frame 42
Game.Plane.StackSpeed = 0.9;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 43
Game.Plane.StackSpeed = 0.9;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 44
Game.Plane.StackSpeed = 0.7;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 45
Game.Plane.StackSpeed = 0.7;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 46
Game.Plane.StackSpeed = 0.75;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 47
Game.Plane.StackSpeed = 0.8;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 48
Game.Plane.StackSpeed = 0.9;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 0, 0);
stop();
Frame 49
Game.Plane.StackSpeed = 0.9;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 1);
stop();
Frame 50
Game.Plane.StackSpeed = 0.9;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 51
Game.Plane.StackSpeed = 0.8;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 1);
stop();
Frame 52
Game.Plane.StackSpeed = 0.8;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 53
Game.Plane.StackSpeed = 0.9;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 54
Game.Plane.StackSpeed = 0.9;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 1);
stop();
Frame 55
Game.Plane.StackSpeed = 1;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 56
Game.Plane.StackSpeed = 1;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 1);
stop();
Frame 57
Game.Plane.StackSpeed = 1;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 1);
stop();
Frame 58
Game.Plane.StackSpeed = 0.9;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 59
Game.Plane.StackSpeed = 0.9;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 60
Game.Plane.StackSpeed = 0.9;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 61
Game.Plane.StackSpeed = 1;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 62
Game.Plane.StackSpeed = 1;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 63
Game.Plane.StackSpeed = 1.15;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 64
Game.Plane.StackSpeed = 1.1;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 65
Game.Plane.StackSpeed = 1;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 1);
stop();
Frame 66
Game.Plane.StackSpeed = 1.05;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 1);
stop();
Frame 67
Game.Plane.StackSpeed = 1.15;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 1);
stop();
Frame 68
Game.Plane.StackSpeed = 1.2;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 69
Game.Plane.StackSpeed = 1.2;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 70
Game.Plane.StackSpeed = 1.2;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 71
Game.Plane.StackSpeed = 1.2;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 72
Game.Plane.StackSpeed = 1;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 73
Game.Plane.StackSpeed = 1.1;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 74
Game.Plane.StackSpeed = 1.2;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 75
Game.Plane.StackSpeed = 1.4;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 76
Game.Plane.StackSpeed = 1.5;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 77
Game.Plane.StackSpeed = 1.5;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1);
stop();
Frame 78
Game.Plane.StackSpeed = 1.6;
Game.Plane.SetPieceProbs(1, 1, 1, 1, 1, 1, 1);
stop();
Frame 79
Game.Plane.StackSpeed = 0.75;
Game.Plane.SetPieceProbs(0, 1, 1, 1, 1, 1, 0);
stop();
Frame 200
stop();
Frame 201
stop();
Symbol 5 MovieClip [Message_LevelFailed] Frame 6
stop();
Symbol 7 MovieClip Frame 9
stop();
Symbol 8 MovieClip [Stars1] Frame 13
stop();
Symbol 12 MovieClip [Message_LevelComplete] Frame 6
stop();
Symbol 33 MovieClip [Message_GameOver] Frame 9
stop();
Symbol 36 MovieClip [SPieceHigh] Frame 1
stop();
Symbol 36 MovieClip [SPieceHigh] Frame 2
stop();
Symbol 36 MovieClip [SPieceHigh] Frame 3
stop();
Symbol 43 Button
on (release) {
_root.Game.PauseClick();
}
Symbol 47 Button
on (release) {
_root.Game.ReplayLevel();
}
Symbol 49 Button
on (release) {
_root.Game.RestartGame();
}
Symbol 50 MovieClip [Pause_blind] Frame 10
stop();
Symbol 68 MovieClip [Hammer_Animation] Frame 6
_root.Game.HammerStrike();
Symbol 68 MovieClip [Hammer_Animation] Frame 9
_root.Game.HammerEnd();
stop();
Symbol 69 MovieClip [Stars2] Frame 13
stop();
Symbol 423 MovieClip [__Packages.CGame] Frame 0
class CGame
{
var RootMovie, Sounds, Plane, SharedState, HammerMC, PauseMC, LeavesMC, ScoreLevelStart, NumOfReplays, TrashValue, HammerValue, Score, LevelScore, MovesMaked, NumLives, SM3, MovesLeft, LevelTime;
function CGame (aRootMovie) {
var _local5;
State = 0;
RootMovie = aRootMovie;
Sounds = new CSounds(this, aRootMovie);
Plane = new CPlane(this);
SharedState = SharedObject.getLocal("DominoScores");
for (var _local3 in SharedState.data) {
}
if (SharedState.data.MaxLevelDone != null) {
MaxLevelDone = SharedState.data.MaxLevelDone;
}
if (SharedState.data.HasPass != null) {
HasPass = SharedState.data.HasPass;
}
if (SharedState.data.PlayerName != null) {
_global.player_name = SharedState.data.PlayerName;
}
HammerMC = RootMovie.attachMovie("Hammer_Animation", "Hammer_Animation_tmp", HammerDepth);
HammerMC._x = -10000;
HammerMC._y = -10000;
PauseMC = RootMovie.attachMovie("Pause_blind", "Pause_blind_tmp", PauseDepth);
PauseMC._x = 0;
PauseMC._y = 0;
PauseFrame = 1;
PauseMC.gotoAndStop(PauseFrame);
IsPause = false;
LeavesMC = RootMovie.attachMovie("leaves1_mc", "Leaves1_tmp", 6000);
LeavesMC._x = -2000;
LeavesMC._y = -2000;
LeavesMC._visible = false;
}
function PauseDraw() {
if (State != 1) {
PauseFrame = 1;
PauseMC.gotoAndStop(PauseFrame);
return(undefined);
}
if (IsPause) {
if (PauseFrame < 10) {
PauseFrame++;
PauseMC.gotoAndStop(PauseFrame);
}
} else if (PauseFrame > 1) {
PauseFrame--;
PauseMC.gotoAndStop(PauseFrame);
}
}
function PauseClick() {
if (IsPause) {
IsPause = false;
} else {
IsPause = true;
}
Sounds.MusicChange();
}
function ShowLives(NeedShow) {
if (NeedShow) {
LeavesMC._x = 312;
LeavesMC._y = 40.25;
LeavesMC._visible = true;
} else {
LeavesMC._x = -2000;
LeavesMC._y = -2000;
LeavesMC._visible = false;
}
}
function SetLeavesDepth() {
if ((RootMovie._currentframe >= 30) && (RootMovie._currentframe < 150)) {
ShowLives(true);
} else {
ShowLives(false);
}
}
function RestartGame() {
IsPause = false;
PauseFrame = 1;
PauseMC.gotoAndStop(PauseFrame);
State = 0;
Plane.Draw();
ClearPlane();
StartNew();
State = 0;
RootMovie.gotoAndStop("NextLevel");
RootMovie.gotoAndStop("Title");
SetLeavesDepth();
}
function SaveState() {
var _local4;
SharedState.data.ScoreLevelStart = ScoreLevelStart;
SharedState.data.MaxLevelDone = MaxLevelDone;
SharedState.data.HasPass = HasPass;
SharedState.data.CurrLevel = Level;
SharedState.data.NumOfReplays = NumOfReplays;
SharedState.data.GameMode = Mode;
SharedState.data.TrashValue = TrashValue;
SharedState.data.HammerValue = HammerValue;
_local4 = (ScoreLevelStart > 0) && ((State == 1) || (State == 6));
SharedState.data.GameAvail = _local4;
SharedState.data.PlayerName = _global.player_name;
for (var _local3 in SharedState.data) {
}
SharedState.flush();
}
function Init() {
Sounds.Init();
}
function Reset() {
State = 0;
Score = 0;
Level = 0;
Plane.StackPos = 0;
ClearPlane();
LevelCompleteTime = 0;
LevelFailedTime = 0;
Plane.StackPos = 0;
ScoreLevelStart = 0;
LevelScore = 0;
MovesMaked = 0;
NumLives = NumLives0;
TrashValue = TrashValue0;
HammerValue = HammerValue0;
WatchTime = 0;
SM3 = 0;
NumOfReplays = NumOfReplays0;
HasPass = true;
DrawReplaysLeft();
DrawHasPass();
DrawScore();
DrawLives();
DrawLevel();
DrawTrash();
HammerState = 0;
HammerStrikeIndex = -1;
DrawHammerValue();
StackFast = false;
IsPause = false;
}
function DrawScore() {
var _local2;
if (((State == 1) || (State == 6)) || (State == 2)) {
_local2 = "" + Score;
} else {
_local2 = "";
}
RootMovie.Message_Score.Score_var = _local2;
}
function DrawLevel() {
var _local5;
var _local3;
var _local4;
_local3 = Math.floor((Level - 1) / _global.LevelsPerMission) + 1;
if (_local3 < 1) {
_local3 = 1;
}
_local4 = ((Level - 1) % _global.LevelsPerMission) + 1;
if (_local4 < 1) {
_local4 = 1;
}
if (((State == 1) || (State == 6)) || (State == 2)) {
_local5 = (("" + _local3) + ".") + _local4;
} else {
_local5 = "";
}
RootMovie.Message_Level.Level_var = _local5;
}
function DrawMovesLeft() {
var _local2;
if (((State == 1) || (State == 6)) || (State == 2)) {
if (MovesLeft > 0) {
_local2 = "" + MovesLeft;
} else {
_local2 = "0";
}
} else {
_local2 = "";
}
RootMovie.MovesLeft_text.MovesLeft_var = _local2;
}
function DrawLives() {
var _local2;
if (((State == 1) || (State == 6)) || (State == 2)) {
if (NumLives < 0) {
_local2 = "0";
} else {
_local2 = "" + NumLives;
}
} else {
_local2 = "";
}
RootMovie.Lives_text.Lives_var = _local2;
}
function DrawTrash() {
var _local2;
_local2 = "" + TrashValue;
RootMovie.TrashBin_mc.Trash_var = _local2;
if (TrashValue > 0) {
RootMovie.TrashBin_mc.gotoAndStop(1);
} else if (RootMovie.TrashBin_mc._currentframe == 1) {
RootMovie.TrashBin_mc.play();
}
}
function DrawHammerValue() {
var _local2;
_local2 = "" + HammerValue;
RootMovie.Hammer_var = _local2;
}
function AddScore(aAdd) {
if (Mode != 0) {
aAdd = aAdd * 2;
}
Score = Score + aAdd;
DrawScore();
SM3 = SM3 + (aAdd * 3);
}
function Update() {
var _local4;
if (State == 7) {
return(undefined);
}
if (State == 6) {
State = 1;
}
Sounds.Update();
PauseDraw();
if (State != 1) {
return(undefined);
}
if (Plane.NeedSound) {
Plane.NeedSound = false;
_global.SoundPlay(6);
}
DrawHammer();
Plane.Draw();
if (IsPause) {
return(undefined);
}
if (_global.DEBUG) {
if (_global.DEBUGStepMode) {
if (_global.DEBUGNeedStep) {
_global.DEBUGNeedStep = false;
} else {
return(undefined);
}
}
}
if (LevelCompleteTime > 0) {
LevelCompleteTime++;
if (LevelCompleteTime == 30) {
if (AddEndLevelBonus()) {
if (AddEndLevelBonusFinished()) {
LevelCompleteTime = 20;
} else {
LevelCompleteTime = 28;
}
}
}
if (LevelCompleteTime > 30) {
LevelCompleteTime = 0;
NumOfReplays++;
TrashValue++;
if ((Level % 7) == 0) {
NumOfReplays = NumOfReplays + 4;
TrashValue = TrashValue + 4;
HasPass = true;
}
if (Level >= (7 * _global.LevelsPerMission)) {
State = 3;
ClearPlane();
Level = 999;
SaveState();
StartGameWin();
return(undefined);
}
StartNewLevel();
_local4 = RootMovie._currentframe;
RootMovie.gotoAndStop("NextLevel");
RootMovie.gotoAndStop(_local4 + 1);
SetLeavesDepth();
}
return(undefined);
}
if (LevelFailedTime > 0) {
LevelFailedTime++;
if (LevelFailedTime > 30) {
LevelFailedTime = 0;
State = 2;
_local4 = RootMovie._currentframe;
_global.LastLevelFrame = _local4;
ClearPlane();
SaveState();
StartGameOver();
_global.SoundPlay(8);
}
return(undefined);
}
if (WatchTime > 0) {
WatchTime--;
}
if (LevelTime0 > 0) {
if (LevelFailedTime == 0) {
var _local5;
var _local3;
_local5 = getTimer();
_local3 = _local5 - PrevFrameTime;
if (_local3 > 50) {
_local3 = 50;
}
if (_local3 > 0) {
LevelTime = LevelTime - _local3;
if (LevelTime <= 0) {
LevelTime = 0;
LevelFailedTime = 1;
DrawLevelTime();
_global.AddTextMessage("Level failed", 5000, 255, 210, -1, 100, 1, 0, 0);
return(undefined);
}
}
DrawLevelTime();
PrevFrameTime = _local5;
} else {
return(undefined);
}
}
Plane.Update();
}
function DrawHammer() {
if (IsPause) {
HammerMC._x = -10000;
HammerMC._y = -10000;
return(undefined);
}
if (HammerState == 0) {
HammerMC._x = -10000;
HammerMC._y = -10000;
} else if (HammerState == 1) {
HammerMC._x = RootMovie._xmouse + HammerMouseDX;
HammerMC._y = RootMovie._ymouse + HammerMouseDY;
}
}
function HammerStartStrike() {
HammerMC.play();
}
function HammerStrike() {
if (HammerState == 2) {
if (HammerStrikeIndex >= 0) {
Plane.ACardsStack[HammerStrikeIndex].State = 0;
_global.SoundPlay(3);
}
} else if (HammerState == 3) {
if (HammerStrikeIndex >= 0) {
Plane.HammerStrike();
_global.SoundPlay(3);
}
}
HammerStrikeIndex = -1;
}
function HammerEnd() {
if (HammerState == 0) {
return(undefined);
}
HammerStrikeIndex = -1;
if (HammerValue > 0) {
HammerState = 0;
} else {
HammerState = 0;
}
}
function HammerPress() {
if (IsPause) {
return(undefined);
}
if (State != 1) {
return(undefined);
}
if (LevelCompleteTime > 0) {
return(undefined);
}
if (LevelFailedTime > 0) {
return(undefined);
}
if (Plane.ACardMouse.State != 0) {
return(undefined);
}
if (HammerState == 0) {
if (HammerValue > 0) {
HammerValue--;
DrawHammerValue();
HammerState = 1;
HammerStrikeIndex = -1;
_global.SoundPlay(2);
}
} else if (HammerState == 1) {
HammerValue++;
DrawHammerValue();
HammerState = 0;
HammerStrikeIndex = -1;
_global.SoundPlay(2);
}
}
function OnMouseUp(x, y) {
var _local2;
StackFast = false;
if (State != 1) {
return(undefined);
}
}
function OnMouseDown(x, y) {
var _local5;
if (IsPause) {
return(undefined);
}
if (State != 1) {
return(undefined);
}
if (Plane.ACardMouse.State == 0) {
if (Plane.GetStackPiece(x, y)) {
return(undefined);
}
if (HammerState == 1) {
if (HammerHit(x, y)) {
HammerStartStrike();
} else {
_global.SoundPlay(9);
}
return(undefined);
}
if ((x <= 88) && (y <= 308)) {
StackFast = true;
} else if ((x >= 73) && (x <= 521)) {
_global.SoundPlay(9);
}
}
if (Plane.ACardMouse.State == 3) {
if ((((x >= 4) && (y >= 322)) && (x <= 85)) && (y <= 380)) {
if (TrashValue > 0) {
if (Plane.TrashTimeCurr >= Plane.TrashTime) {
TrashValue--;
DrawTrash();
Plane.TrashTimeCurr = 0;
Plane.SetCardTrash(Plane.ACardMouse.mc, Plane.ACardMouse.mcDig);
Plane.ACardMouse.State = 0;
_global.SoundPlay(13);
} else {
_global.SoundPlay(9);
}
} else {
_global.SoundPlay(9);
}
return(undefined);
}
if (Plane.PlaceCard(Plane.ACardMouse.ValUp, Plane.ACardMouse.ValDown, Plane.ACardMouse.Orient, x, y)) {
_global.SoundPlay(4);
Plane.ACardMouse.State = 0;
} else {
_global.SoundPlay(9);
}
}
}
function StartGameOver() {
if (Math.abs((Score * 3) - SM3) < 100) {
_global.Score = Score;
} else {
Score = 0;
ScoreLevelStart = 0;
_global.Score = 0;
}
if (_global.Score > _global.BestScore) {
_global.BestScore = _global.Score;
}
State = 2;
Plane.ChainEndMCIn._x = -10000;
Plane.ChainEndMCIn._y = -10000;
Plane.ChainEndMCOut._x = -10000;
Plane.ChainEndMCOut._y = -10000;
_global.SoundPlay(8);
RootMovie.gotoAndStop("GameOver");
SetLeavesDepth();
}
function StartGameWin() {
if (Math.abs((Score * 3) - SM3) < 100) {
_global.Score = Score;
} else {
Score = 0;
ScoreLevelStart = 0;
_global.Score = 0;
}
if (_global.Score > _global.BestScore) {
_global.BestScore = _global.Score;
}
State = 2;
_global.SoundPlay(8);
RootMovie.gotoAndStop("GameWin");
SetLeavesDepth();
}
function PassLevel() {
}
function StartMenu() {
}
function DeleteAllPieces() {
Plane.Clear();
}
function AddPieceMC(aMC, aType, aValueUp, aValueDown, aOrient, aColor) {
var _local2;
_local2 = Plane.AddPieceMC(aMC, aType, aValueUp, aValueDown, aOrient, aColor);
return(_local2);
}
function ClearPlane() {
SetLeavesDepth();
DeleteAllPieces();
}
function RestartLevel() {
}
function StartNewLevel() {
LevelTime = 0;
Plane.StackPos = 0;
ClearPlane();
if (MaxLevelDone < Level) {
MaxLevelDone = Level;
}
Level++;
LevelCompleteTime = 0;
LevelFailedTime = 0;
DrawLevel();
DrawTrash();
DrawHammerValue();
ScoreLevelStart = Score;
SaveState();
DrawSoundState();
Sounds.MusicChange();
}
function StartNew() {
Reset();
State = 1;
DrawScore();
DrawLives();
Level = 1;
DrawLevel();
GameOverTime = 0;
DrawReplaysLeft();
DrawHasPass();
DrawSoundState();
Sounds.MusicChange();
}
function DrawHasPass() {
if (HasPass) {
RootMovie.Button_Pass_Level.gotoAndStop(1);
RootMovie.Button_Pass_Level.Button_Pass_On.enabled = true;
} else {
RootMovie.Button_Pass_Level.gotoAndStop(2);
RootMovie.Button_Pass_Level.Button_Pass_Off.enabled = false;
}
}
function DrawReplaysLeft() {
}
function ReplayLevel() {
var _local3;
_global.DeleteTempMovies();
IsPause = false;
LevelFailedTime = 0;
DrawReplaysLeft();
DrawHasPass();
_local3 = RootMovie._currentframe;
Score = ScoreLevelStart;
DrawScore();
ClearPlane();
SM3 = Score * 3;
MovesMaked = 0;
State = 6;
RootMovie.gotoAndStop("NextLevel");
RootMovie.gotoAndStop(_local3);
SetLeavesDepth();
SaveState();
}
function IsMissionAvail(aMissionNum) {
if (aMissionNum <= 0) {
if (!SharedState.data.GameAvail) {
if ((SharedState.data.CurrLevel <= 1) || (SharedState.data.CurrLevel > 49)) {
return(false);
}
} else {
return(true);
}
}
if (aMissionNum == 1) {
return(true);
}
if (((aMissionNum - 1) * _global.LevelsPerMission) <= MaxLevelDone) {
return(true);
}
return(false);
}
function StartMission(aMissionNum) {
return(false);
}
function GetFrame(Value) {
if (Value == 0) {
return(7);
}
return(Value);
}
function SetCardOrient(aMC, aValUp, aValDown, aOrient, aScale) {
if (aOrient == 0) {
aMC._rotation = 0;
aMC._xscale = aScale;
aMC._yscale = aScale;
aMC.Dots_Up.gotoAndStop(GetFrame(aValUp));
aMC.Dots_Down.gotoAndStop(GetFrame(aValDown));
} else if (aOrient == 1) {
aMC._rotation = 90;
aMC._xscale = aScale;
aMC._yscale = -aScale;
aMC.Dots_Up.gotoAndStop(GetFrame(aValUp) + 7);
aMC.Dots_Down.gotoAndStop(GetFrame(aValDown) + 7);
} else if (aOrient == 2) {
aMC._rotation = 180;
aMC._xscale = -aScale;
aMC._yscale = -aScale;
aMC.Dots_Up.gotoAndStop(GetFrame(aValDown));
aMC.Dots_Down.gotoAndStop(GetFrame(aValUp));
} else if (aOrient == 3) {
aMC._rotation = -90;
aMC._xscale = -aScale;
aMC._yscale = aScale;
aMC.Dots_Up.gotoAndStop(GetFrame(aValDown) + 7);
aMC.Dots_Down.gotoAndStop(GetFrame(aValUp) + 7);
}
}
function TraceObjects() {
}
function DrawLevelTime() {
var _local2;
_local2 = "" + Math.floor(LevelTime * 0.001);
RootMovie.LevelTimeSec = _local2;
}
function CheckLevelEnd() {
var _local3;
var _local2;
_local3 = 1;
while (_local3 < Plane.SizeI) {
_local2 = 1;
while (_local2 < Plane.SizeJ) {
if (Plane.IsFree(_local2, _local3, -1)) {
return(false);
}
_local2++;
}
_local3++;
}
return(true);
}
function IsLevelComplete() {
var _local3;
var _local2;
var _local4;
if (Mode == 0) {
return(true);
}
_local4 = true;
_local3 = 1;
while (_local3 < Plane.SizeI) {
_local2 = 1;
while (_local2 < Plane.SizeJ) {
if ((Plane.ACells[_local3][_local2].CoinValue > 0) && (Plane.ACells[_local3][_local2].CoinValue < 100)) {
_local4 = false;
}
_local2++;
}
_local3++;
}
return(_local4);
}
function BorderDraw() {
BorderHide();
Plane.mcBorder = RootMovie.createEmptyMovieClip("Border_MC_temp", Plane.BorderDepth);
Plane.mcBorder.lineStyle(10, 6967601, 100);
Plane.mcBorder.moveTo((Plane.PlaneX + Plane.CellSizeX) - BorderDX0, (Plane.PlaneY + Plane.CellSizeY) - BorderDY0);
Plane.mcBorder.lineTo((Plane.PlaneX + Plane.CellSizeX) - BorderDX0, (Plane.PlaneY + (Plane.SizeI * Plane.CellSizeY)) + BorderDY0);
Plane.mcBorder.lineTo((Plane.PlaneX + (Plane.SizeJ * Plane.CellSizeX)) + BorderDX0, (Plane.PlaneY + (Plane.SizeI * Plane.CellSizeY)) + BorderDY0);
Plane.mcBorder.lineTo((Plane.PlaneX + (Plane.SizeJ * Plane.CellSizeX)) + BorderDX0, (Plane.PlaneY + Plane.CellSizeY) - BorderDY0);
Plane.mcBorder.lineTo((Plane.PlaneX + Plane.CellSizeX) - BorderDX0, (Plane.PlaneY + Plane.CellSizeY) - BorderDY0);
Plane.mcBorder.lineStyle(4, 8612408, 100);
Plane.mcBorder.moveTo((Plane.PlaneX + Plane.CellSizeX) - BorderDX1, (Plane.PlaneY + Plane.CellSizeY) - BorderDY1);
Plane.mcBorder.lineTo((Plane.PlaneX + Plane.CellSizeX) - BorderDX1, (Plane.PlaneY + (Plane.SizeI * Plane.CellSizeY)) + BorderDY1);
Plane.mcBorder.lineTo((Plane.PlaneX + (Plane.SizeJ * Plane.CellSizeX)) + BorderDX1, (Plane.PlaneY + (Plane.SizeI * Plane.CellSizeY)) + BorderDY1);
Plane.mcBorder.lineTo((Plane.PlaneX + (Plane.SizeJ * Plane.CellSizeX)) + BorderDX1, (Plane.PlaneY + Plane.CellSizeY) - BorderDY1);
Plane.mcBorder.lineTo((Plane.PlaneX + Plane.CellSizeX) - BorderDX1, (Plane.PlaneY + Plane.CellSizeY) - BorderDY1);
}
function ClickEasy() {
Mode = 0;
RootMovie.gotoAndStop("Game");
SetLeavesDepth();
}
function ClickHard() {
Mode = 1;
RootMovie.gotoAndStop("Game");
SetLeavesDepth();
}
function ClickContinue() {
RootMovie.gotoAndStop("Game");
if (!SharedState.data.GameAvail) {
if ((SharedState.data.CurrLevel <= 1) || (SharedState.data.CurrLevel > 49)) {
return(false);
}
SharedState.data.NumOfReplays = NumOfReplays0;
SharedState.data.ScoreLevelStart = 0;
SharedState.data.HasPass = true;
SharedState.data.TrashValue = TrashValue0;
SharedState.data.HammerValue = HammerValue0;
}
Level = SharedState.data.CurrLevel;
NumOfReplays = SharedState.data.NumOfReplays;
ScoreLevelStart = SharedState.data.ScoreLevelStart;
Score = ScoreLevelStart;
if (SharedState.data.HasPass != null) {
HasPass = SharedState.data.HasPass;
}
Mode = SharedState.data.GameMode;
TrashValue = SharedState.data.TrashValue;
HammerValue = SharedState.data.HammerValue;
SM3 = Score * 3;
State = 1;
RootMovie.gotoAndStop(29 + Level);
SetLeavesDepth();
DrawScore();
DrawLevel();
GameOverTime = 0;
DrawReplaysLeft();
DrawHasPass();
DrawSoundState();
DrawTrash();
DrawHammerValue();
State = 7;
return(true);
}
function HammerHit(x, y) {
var _local4;
var _local3;
var _local2;
_local3 = Plane.GetJ(x, y);
_local4 = Plane.GetI(x, y);
_local2 = Plane.ACells[_local4][_local3].CardInd;
_local2 = 0;
while (_local2 < Plane.ACards.length) {
if (Plane.ACards[_local2].State == 1) {
if (_local2 == Plane.PrevInputIndex) {
if (((_local3 == Plane.ACards[_local2].jUp) && (_local4 == Plane.ACards[_local2].iUp)) || ((_local3 == Plane.ACards[_local2].jDown) && (_local4 == Plane.ACards[_local2].iDown))) {
HammerState = 3;
HammerStrikeIndex = _local2;
HammerStrikeInput = true;
return(true);
}
}
if (_local2 == Plane.PrevOutputIndex) {
if (((_local3 == Plane.ACards[_local2].jUp) && (_local4 == Plane.ACards[_local2].iUp)) || ((_local3 == Plane.ACards[_local2].jDown) && (_local4 == Plane.ACards[_local2].iDown))) {
HammerState = 3;
HammerStrikeIndex = _local2;
HammerStrikeInput = false;
return(true);
}
}
}
_local2++;
}
return(false);
}
function GridSetup() {
var _local2;
var _local3;
var _local5;
var _local4;
Plane.Scale = 100;
_local2 = 100;
_local3 = 100;
if (Plane.SizeI >= 14) {
_local3 = 95;
} else if (Plane.SizeI >= 13) {
_local3 = 95;
} else if (Plane.SizeI >= 12) {
_local3 = 95;
} else if (Plane.SizeI >= 11) {
_local3 = 100;
} else if (Plane.SizeI >= 10) {
_local3 = 110;
} else if (Plane.SizeI >= 9) {
_local3 = 120;
} else if (Plane.SizeI >= 8) {
_local3 = 130;
} else if (Plane.SizeI >= 7) {
_local3 = 140;
} else if (Plane.SizeI >= 6) {
_local3 = 150;
} else {
_local3 = 160;
}
if (Plane.SizeJ >= 15) {
_local2 = 85;
} else if (Plane.SizeJ >= 14) {
_local2 = 90;
} else if (Plane.SizeJ >= 13) {
_local2 = 95;
} else if (Plane.SizeJ >= 12) {
_local2 = 100;
} else if (Plane.SizeJ >= 11) {
_local2 = 110;
} else if (Plane.SizeJ >= 10) {
_local2 = 120;
} else if (Plane.SizeJ >= 9) {
_local2 = 130;
} else if (Plane.SizeJ >= 8) {
_local2 = 140;
} else if (Plane.SizeJ >= 7) {
_local2 = 150;
} else if (Plane.SizeJ >= 6) {
_local2 = 160;
} else {
_local2 = 170;
}
Plane.Scale = Math.min(_local2, _local3);
if (MinSize > (Plane.Scale * 30)) {
MinSize = Plane.Scale * 30;
}
if (MaxSize < (Plane.Scale * 30)) {
MaxSize = Plane.Scale * 30;
}
_local5 = (Plane.CellSizeX0 * (Plane.Scale * 0.01)) * (Plane.SizeJ - 1);
_local4 = (Plane.CellSizeY0 * (Plane.Scale * 0.01)) * (Plane.SizeI - 1);
Plane.CellSizeX = Plane.CellSizeX0 * (Plane.Scale * 0.01);
Plane.CellSizeY = Plane.CellSizeY0 * (Plane.Scale * 0.01);
Plane.PlaneX = Plane.PlaneX0 + Math.floor((((Plane.PlaneX1 - Plane.PlaneX0) - _local5) * 0.5) - (Plane.CellSizeX * 1.5));
Plane.PlaneY = Plane.PlaneY0 + Math.floor((((Plane.PlaneY1 - Plane.PlaneY0) - _local4) * 0.5) - (Plane.CellSizeY * 1.5));
}
function BorderHide() {
if (Plane.mcBorder != null) {
removeMovieClip(Plane.mcBorder);
delete Plane.mcBorder;
Plane.mcBorder = null;
}
}
function AddEndLevelBonusFinished() {
var _local2;
_local2 = 0;
while (_local2 < Plane.ACards.length) {
if (Plane.ACards[_local2].State != 0) {
return(false);
}
_local2++;
}
return(true);
}
function AddEndLevelBonus() {
var _local3;
_local3 = 0;
while (_local3 < Plane.ACards.length) {
if (Plane.ACards[_local3].State != 0) {
AddScore(10);
_global.AddTempMovie("Stars1", 4000, Plane.ACards[_local3].mc._x, Plane.ACards[_local3].mc._y, 0, 0, 100, 0, 100, 0, 14);
Plane.ACards[_local3].Delete();
_global.SoundPlay(6);
return(true);
}
_local3++;
}
return(false);
}
function DrawSoundState() {
if (_global.SoundOn) {
RootMovie.Sound_mc.gotoAndStop(1);
} else {
RootMovie.Sound_mc.gotoAndStop(2);
}
if (_global.MusicOn) {
RootMovie.Music_mc.gotoAndStop(1);
} else {
RootMovie.Music_mc.gotoAndStop(2);
}
}
function DrawCardTrash() {
if (Plane.ACardTrash.mc._x >= -100) {
if (Plane.ACardTrash.mc._xscale > 0) {
Plane.ACardTrash.mc._xscale = Plane.ACardTrash.mc._xscale - 10;
} else {
Plane.ACardTrash.mc._xscale = Plane.ACardTrash.mc._xscale + 10;
}
if (Plane.ACardTrash.mc._yscale > 0) {
Plane.ACardTrash.mc._yscale = Plane.ACardTrash.mc._yscale - 10;
} else {
Plane.ACardTrash.mc._yscale = Plane.ACardTrash.mc._yscale + 10;
}
if (Plane.ACardTrash.mcDig._xscale > 0) {
Plane.ACardTrash.mcDig._xscale = Plane.ACardTrash.mcDig._xscale - 10;
} else {
Plane.ACardTrash.mcDig._xscale = Plane.ACardTrash.mcDig._xscale + 10;
}
if (Plane.ACardTrash.mcDig._yscale > 0) {
Plane.ACardTrash.mcDig._yscale = Plane.ACardTrash.mcDig._yscale - 10;
} else {
Plane.ACardTrash.mcDig._yscale = Plane.ACardTrash.mcDig._yscale + 10;
}
if (Math.abs(Plane.ACardTrash.mc._xscale) < 35) {
Plane.ACardTrash.mc._x = -10000;
Plane.ACardTrash.mc._y = -10000;
Plane.ACardTrash.mcDig._x = -10000;
Plane.ACardTrash.mcDig._y = -10000;
}
}
}
var Mode = 0;
var LevelTime0 = 0;
var StackToTrash = true;
var State = 0;
var HammerState = 0;
var HammerStrikeIndex = -1;
var HammerStrikeInput = false;
var HammerDepth = 3700;
var HammerMouseDX = 0;
var HammerMouseDY = 0;
var MaxLevelDone = 0;
var HasPass = true;
var LevelCompleteTime = 0;
var LevelFailedTime = 0;
var GameOverTime = 0;
var StackFast = false;
var WatchSpeedK = 2;
var WatchTime = 0;
var WatchTimeAdd = 240;
var IsPause = false;
var PauseFrame = 1;
var PauseDepth = 3950;
var NumOfReplays0 = 0;
var NumOfReplaysMax = 99;
var NumLives0 = 0;
var TrashValue0 = 5;
var HammerValue0 = 5;
var Level = 0;
var PrevFrameTime = 0;
var BorderDX0 = 5;
var BorderDY0 = 5;
var BorderDX1 = 5;
var BorderDY1 = 5;
var MinSize = 10000;
var MaxSize = 0;
}
Symbol 424 MovieClip [__Packages.CSounds] Frame 0
class CSounds
{
var Game, RootMovie, Music0MC, Music1MC, Music0, Music1, ASounds, ASoundsMCs;
function CSounds (aGame, aRootMovie) {
var _local2;
Game = aGame;
RootMovie = aRootMovie;
Music0MC = Game.RootMovie.createEmptyMovieClip("Music_0_temp", 2343);
Music1MC = Game.RootMovie.createEmptyMovieClip("Music_1_temp", 2344);
Music0 = new Sound(Music0MC);
Music1 = new Sound(Music1MC);
ASounds = new Array(ANames.length);
ASoundsMCs = new Array(ANames.length);
_local2 = 0;
while (_local2 < ASounds.length) {
ASoundsMCs[_local2] = Game.RootMovie.createEmptyMovieClip("Sound_0_temp_" + _local2, 2345 + _local2);
ASounds[_local2] = new Sound(ASoundsMCs[_local2]);
_local2++;
}
}
function Init() {
var _local2;
if (InitOK) {
return(undefined);
}
_local2 = 0;
while (_local2 < ASounds.length) {
ASounds[_local2].attachSound(ANames[_local2]);
_local2++;
}
Music0.attachSound(Music0Name);
Music1.attachSound(Music1Name);
MusicPlayed = false;
MusicIndex = 0;
InitOK = true;
}
function Stop(Ind) {
if ((Ind < 0) || (Ind >= ASounds.length)) {
return(undefined);
}
if (ASounds[Ind] == null) {
return(undefined);
}
ASounds[Ind].stop();
}
function Play(Ind, Loops) {
if (!_global.SoundOn) {
return(undefined);
}
if ((Ind < 0) || (Ind >= ASounds.length)) {
return(undefined);
}
if (Loops < 1) {
Loops = 1;
}
if (ASounds[Ind] == null) {
return(undefined);
}
ASounds[Ind].setVolume(100);
ASounds[Ind].start(0, Loops);
}
function PlayVolume(Ind, Volume, Loops) {
if (!_global.SoundOn) {
return(undefined);
}
if ((Ind < 0) || (Ind >= ASounds.length)) {
return(undefined);
}
if (Loops < 1) {
Loops = 1;
}
if (ASounds[Ind] == null) {
return(undefined);
}
ASounds[Ind].setVolume(Volume);
ASounds[Ind].start(0, Loops);
}
function PlayDelayed(Ind, Delay) {
if (!_global.SoundOn) {
return(undefined);
}
if ((Ind < 0) || (Ind >= ASounds.length)) {
return(undefined);
}
IndDelayed = Ind;
this.Delay = Delay;
}
function MusicChange() {
MusicIndex++;
if (MusicIndex > 1) {
MusicIndex = 0;
}
MusicPlayed = false;
Music0.stop();
Music1.stop();
}
function Update() {
if (_global.MusicOn) {
if (!MusicPlayed) {
MusicPlayed = true;
if (MusicIndex == 0) {
Music0.setVolume(70);
Music0.start(0, 1000);
} else {
Music1.setVolume(70);
Music1.start(1, 1000);
}
}
} else if (MusicPlayed) {
MusicPlayed = false;
Music0.stop();
Music1.stop();
}
if (IndDelayed >= 0) {
Delay = Delay - 0.05;
if (Delay <= 0) {
Play(IndDelayed, 1);
IndDelayed = -1;
}
}
}
var InitOK = false;
var ANames = new Array("Rollover", "MousePulse.wav", "BleepBlop.wav", "BleepBlopLo.wav", "BleepCricketHi.wav", "BleepCricketLo.wav", "bonus.wav", "BoxComplete.wav", "Lost.wav", "MenuSelect.wav", "MessageBad.wav", "MousePulse.wav", "Oow.wav", "Woo.wav");
var Music0Name = "music_0";
var Music1Name = "music_1";
var MusicPlayed = false;
var MusicIndex = 0;
var IndDelayed = -1;
var Delay = -1;
}
Symbol 425 MovieClip [__Packages.CPlane] Frame 0
class CPlane
{
var PieceProbs, ElementsMCs, SumPieceProbs, Game, ACards, ACardsStack, ChainEndMCIn, ChainEndMCOut, ACardMouse, ACardTrash, ACells, GridMCs, CurrInputI, CurrInputJ, CurrOutputI, CurrOutputJ, InputI, InputJ, OutputI, OutputJ, PrevInputI, PrevInputJ, PrevInputIndex, PrevOutputIndex, PrevOutputI, PrevOutputJ;
function CPlane (aGame) {
var _local2;
var _local3;
PieceProbs = new Array(7);
ElementsMCs = new Array(256);
SumPieceProbs = 0;
_local2 = 0;
while (_local2 < PieceProbs.length) {
PieceProbs[_local2] = 1;
SumPieceProbs = SumPieceProbs + PieceProbs[_local2];
_local2++;
}
Game = aGame;
ACards = new Array(MaxSizeI * MaxSizeJ);
_local2 = 0;
while (_local2 < ACards.length) {
ACards[_local2] = new CCard(aGame);
_local2++;
}
ACardsStack = new Array(MaxSizeStack);
_local2 = 0;
while (_local2 < ACardsStack.length) {
ACardsStack[_local2] = new CCard(aGame);
ACardsStack[_local2].Init();
ACardsStack[_local2].State = 0;
ACardsStack[_local2].mc = Game.RootMovie.attachMovie("SPiece", "SPiece_Stack_" + _local2, StackDepth + _local2);
ACardsStack[_local2].mc._x = -10000;
ACardsStack[_local2].mc._y = -10000;
ACardsStack[_local2].mcDig = Game.RootMovie.attachMovie("SPieceDig", "SPiece_Stack_Dig_" + _local2, StackDepthDig + _local2);
ACardsStack[_local2].mcDig._x = -10000;
ACardsStack[_local2].mcDig._y = -10000;
ACardsStack[_local2].Orient = 1;
ACardsStack[_local2].mcHigh = Game.RootMovie.attachMovie("SPieceHigh", "SPiece_Stack_High_" + _local2, StackDepthHigh + _local2);
ACardsStack[_local2].mcHigh._x = -10000;
ACardsStack[_local2].mcHigh._y = -10000;
_local2++;
}
ChainEndMCIn = Game.RootMovie.attachMovie("Chain_End", "Chain_End_In", ChainEndDepth);
ChainEndMCOut = Game.RootMovie.attachMovie("Chain_End", "Chain_End_Out", ChainEndDepth + 1);
ChainEndMCIn._x = -10000;
ChainEndMCIn._y = -10000;
ChainEndMCOut._x = -10000;
ChainEndMCOut._y = -10000;
ACardMouse = new CCard(aGame);
ACardTrash = new CCard(aGame);
ACardMouse.State = 0;
ACardMouse.mc = Game.RootMovie.attachMovie("SPiece", "SPiece_Mouse", MouseDepth);
ACardMouse.mc._x = -10000;
ACardMouse.mc._y = -10000;
ACardMouse.mcDig = Game.RootMovie.attachMovie("SPieceDig", "SPiece_Mouse_Dig", MouseDepthDig);
ACardMouse.mcDig._x = -10000;
ACardMouse.mcDig._y = -10000;
ACardMouse.mcHigh = Game.RootMovie.attachMovie("SPieceHigh", "SPiece_Mouse_High", MouseDepthHigh);
ACardMouse.mcHigh._x = -10000;
ACardMouse.mcHigh._y = -10000;
ACardTrash.State = 0;
ACardTrash.mc = Game.RootMovie.attachMovie("SPiece", "SPiece_Trash", TrashDepth);
ACardTrash.mc._x = -10000;
ACardTrash.mc._y = -10000;
ACardTrash.mcDig = Game.RootMovie.attachMovie("SPieceDig", "SPiece_Trash_Dig", TrashDepthDig);
ACardTrash.mcDig._x = -10000;
ACardTrash.mcDig._y = -10000;
ACardTrash.mcHigh = null;
ACells = new Array(MaxSizeI);
_local2 = 0;
while (_local2 < ACells.length) {
ACells[_local2] = new Array(MaxSizeJ);
_local3 = 0;
while (_local3 < ACells[_local2].length) {
ACells[_local2][_local3] = new CCell(aGame);
ACells[_local2][_local3].Init();
_local3++;
}
_local2++;
}
GridMCs = new Array(MaxSizeI * MaxSizeJ);
_local2 = 0;
while (_local2 < GridMCs.length) {
GridMCs[_local2] = null;
_local2++;
}
ElementsMCs = new Array(256);
_local2 = 0;
while (_local2 < ElementsMCs.length) {
ElementsMCs[_local2] = null;
_local2++;
}
}
function ElementsHide() {
var _local2;
_local2 = 0;
while (_local2 < ElementsMCs.length) {
if (ElementsMCs[_local2] != null) {
removeMovieClip(ElementsMCs[_local2]);
delete ElementsMCs[_local2];
ElementsMCs[_local2] = null;
}
_local2++;
}
}
function GridHide() {
var _local2;
_local2 = 0;
while (_local2 < GridMCs.length) {
if (GridMCs[_local2] != null) {
removeMovieClip(GridMCs[_local2]);
delete GridMCs[_local2];
GridMCs[_local2] = null;
}
_local2++;
}
}
function GridDraw() {
var _local4;
var _local3;
var _local2;
var _local5;
_local2 = 0;
GridHide();
_local4 = 1;
while (_local4 < SizeI) {
_local3 = 1;
while (_local3 < SizeJ) {
GridMCs[_local2] = Game.RootMovie.attachMovie("Grid_Cell_mc", "Grid_Cell_" + _local2, GridDepth + _local2);
GridMCs[_local2]._x = PlaneX + (_local3 * CellSizeX);
GridMCs[_local2]._y = PlaneY + (_local4 * CellSizeY);
GridMCs[_local2]._xscale = Scale;
GridMCs[_local2]._yscale = Scale;
if (((_local4 - 1) % 2) == 0) {
_local5 = (_local3 - 1) % 2;
} else {
_local5 = 2 + ((_local3 - 1) % 2);
}
GridMCs[_local2].gotoAndStop(_local5 + 1);
_local2++;
_local3++;
}
_local4++;
}
}
function StackClear() {
var _local2;
_local2 = 0;
while (_local2 < ACardsStack.length) {
ACardsStack[_local2].State = 0;
ACardsStack[_local2].Pos = 0;
ACardsStack[_local2].mc._x = -10000;
ACardsStack[_local2].mc._y = -10000;
ACardsStack[_local2].mcDig._x = -10000;
ACardsStack[_local2].mcDig._y = -10000;
ACardsStack[_local2].mcHigh._x = -10000;
ACardsStack[_local2].mcHigh._y = -10000;
_local2++;
}
}
function StackFindNext(Pos) {
var _local2;
var _local3;
_local3 = Pos + StackDY;
_local2 = 0;
while (_local2 < ACardsStack.length) {
if (ACardsStack[_local2].State != 0) {
if (!ACardsStack[_local2].Moved) {
if (ACardsStack[_local2].Pos < _local3) {
return(_local2);
}
}
}
_local2++;
}
return(-1);
}
function StackFlush() {
var _local2;
var _local3;
var _local4;
_local4 = -1;
_local3 = -1;
_local2 = 0;
while (_local2 < ACardsStack.length) {
if (ACardsStack[_local2].State != 0) {
if (ACardsStack[_local2].Pos > _local3) {
_local3 = ACardsStack[_local2].Pos;
_local4 = _local2;
}
}
_local2++;
}
if (_local4 >= 0) {
SetCardTrash(ACardsStack[_local4].mc, ACardsStack[_local4].mcDig);
ACardsStack[_local4].State = 0;
}
}
function StackUpdate() {
var _local3;
var _local8;
var _local9;
var _local10;
var _local6;
var _local5;
var _local4;
var _local7;
_local8 = 0;
_local6 = -1;
_local5 = 1000000 /* 0x0F4240 */;
_local7 = false;
_local3 = 0;
while (_local3 < ACardsStack.length) {
ACardsStack[_local3].PrevPos = ACardsStack[_local3].Pos;
_local3++;
}
_local3 = 0;
while (_local3 < ACardsStack.length) {
if (ACardsStack[_local3].State != 0) {
ACardsStack[_local3].Moved = false;
_local8++;
if (ACardsStack[_local3].Pos < _local5) {
_local5 = ACardsStack[_local3].Pos;
_local6 = _local3;
}
}
_local3++;
}
if (_local8 <= 0) {
StackCreatePiece();
} else if (_local8 >= (ACardsStack.length - 1)) {
Game.StackFast = false;
}
_local9 = StackSpeed + (StackSpeedAdd * (ACardsStack.length - _local8));
if (!Game.StackToTrash) {
_local9 = _local9 * 10;
} else if (Game.StackFast) {
_local9 = _local9 * 5;
}
if (_global.DEBUG) {
if (Game.StackFast) {
Game.RootMovie.DebugStackSpeed = ("" + _local9) + " !";
} else {
Game.RootMovie.DebugStackSpeed = "" + _local9;
}
}
if (Game.WatchTime > 0) {
StackAddFrame++;
if ((StackAddFrame % Game.WatchSpeedK) != 0) {
return(undefined);
}
}
StackPos = StackPos + _local9;
_local10 = _local9 / StackDY;
do {
if (StackPos >= 1) {
StackPos = StackPos - 1;
BeltFrame++;
if (BeltFrame > 97) {
BeltFrame = 1;
}
_local7 = true;
Game.RootMovie.belt.belt_0.gotoAndStop(BeltFrame);
Game.RootMovie.belt.belt_1.gotoAndStop(BeltFrame);
Game.RootMovie.belt.belt_2.gotoAndStop(BeltFrame);
Game.RootMovie.belt.belt_3.gotoAndStop(BeltFrame);
}
_local6 = -1;
_local5 = 1000000 /* 0x0F4240 */;
_local3 = 0;
while (_local3 < ACardsStack.length) {
if (ACardsStack[_local3].State != 0) {
ACardsStack[_local3].Moved = false;
if (ACardsStack[_local3].Pos < _local5) {
_local5 = ACardsStack[_local3].Pos;
_local6 = _local3;
}
}
_local3++;
}
if (_local6 >= 0) {
if (_local5 >= StackDY) {
if (!StackCreatePiece()) {
if (!Game.StackToTrash) {
_local3 = 0;
while (_local3 < ACardsStack.length) {
ACardsStack[_local3].Pos = ACardsStack[_local3].PrevPos;
_local3++;
}
for(;;){
if (StackPos >= 1) {
StackPos = StackPos - 1;
BeltFrame++;
if (BeltFrame > 97) {
BeltFrame = 1;
}
} else {
// unexpected jump
}
};
return(undefined);
}
if (Game.TrashValue > 0) {
StackFlush();
_global.SoundPlay(12);
Game.TrashValue--;
if (Game.HammerState == 2) {
if (_local6 == Game.HammerStrikeIndex) {
Game.HammerStrikeIndex = -1;
}
}
Game.DrawTrash();
} else if (Game.LevelFailedTime == 0) {
Game.LevelFailedTime = 1;
_global.AddTempMovie("Message_LevelFailed", 4000, 312, 220, 0, 0, 100, 0, 100, 0, 15);
_global.SoundPlay(10);
}
}
} else if (_local7) {
_local4 = _local6;
for(;;){
if (_local4 < 0) {
continue;
}
ACardsStack[_local4].Pos++;
ACardsStack[_local4].Moved = true;
_local4 = StackFindNext(ACardsStack[_local4].Pos);
};
}
}
} while (StackPos >= 1);
}
function StackCreatePiece() {
var _local2;
_local2 = 0;
while (_local2 < ACardsStack.length) {
if (ACardsStack[_local2].State == 0) {
ACardsStack[_local2].CreateRandom();
ACardsStack[_local2].State = 2;
ACardsStack[_local2].Pos = 0;
return(true);
}
_local2++;
}
return(false);
}
function StackCreatePiecesStart() {
var _local2;
StackClear();
_local2 = 0;
while (_local2 < ACardsStack.length) {
if (_local2 >= StackStartPieces) {
break;
}
if (ACardsStack[_local2].State == 0) {
ACardsStack[_local2].CreateRandom();
ACardsStack[_local2].State = 2;
ACardsStack[_local2].Pos = _local2 * StackDY;
}
_local2++;
}
}
function ChainInOutDraw() {
if (Game.LevelCompleteTime > 0) {
ChainEndMCIn._x = -10000;
ChainEndMCIn._y = -10000;
ChainEndMCOut._x = -10000;
ChainEndMCOut._y = -10000;
return(undefined);
}
if ((CurrInputI >= 0) && (CurrInputJ >= 0)) {
ChainEndMCIn._x = GetX(CurrInputJ, CurrInputI);
ChainEndMCIn._y = GetY(CurrInputJ, CurrInputI);
ChainEndMCIn._xscale = Scale;
ChainEndMCIn._yscale = Scale;
} else {
ChainEndMCIn._x = -10000;
ChainEndMCIn._y = -10000;
}
if ((CurrOutputI >= 0) && (CurrOutputJ >= 0)) {
ChainEndMCOut._x = GetX(CurrOutputJ, CurrOutputI);
ChainEndMCOut._y = GetY(CurrOutputJ, CurrOutputI);
ChainEndMCOut._xscale = Scale;
ChainEndMCOut._yscale = Scale;
} else {
ChainEndMCOut._x = -10000;
ChainEndMCOut._y = -10000;
}
if ((CurrInputI == InputI) && (CurrInputJ == InputJ)) {
ChainEndMCIn._x = -10000;
ChainEndMCIn._y = -10000;
ACells[InputI][InputJ].KeyMC.Chain_End._visible = true;
} else {
ACells[InputI][InputJ].KeyMC.Chain_End._visible = false;
}
if ((CurrOutputI == OutputI) && (CurrOutputJ == OutputJ)) {
ChainEndMCOut._x = -10000;
ChainEndMCOut._y = -10000;
ACells[OutputI][OutputJ].KeyMC.Chain_End._visible = true;
} else {
ACells[OutputI][OutputJ].KeyMC.Chain_End._visible = false;
}
}
function StackDraw() {
var _local2;
var _local7;
var _local4;
var _local3;
var _local6;
var _local5;
_local4 = GetCardKeyValue(CurrInputJ, CurrInputI);
_local3 = GetCardKeyValue(CurrOutputJ, CurrOutputI);
_local7 = 0;
_local2 = 0;
while (_local2 < ACardsStack.length) {
if (ACardsStack[_local2].State == 2) {
_local7++;
ACardsStack[_local2].mc._x = Math.floor(StackX0);
ACardsStack[_local2].mc._y = Math.floor(StackY0 + ACardsStack[_local2].Pos);
ACardsStack[_local2].mcDig._x = Math.floor(StackX0);
ACardsStack[_local2].mcDig._y = Math.floor(StackY0 + ACardsStack[_local2].Pos);
_local6 = (((_local4 < 0) && (_local3 < 0)) || (_local4 == ACardsStack[_local2].ValUp)) || (_local3 == ACardsStack[_local2].ValUp);
_local5 = (((_local4 < 0) && (_local3 < 0)) || (_local4 == ACardsStack[_local2].ValDown)) || (_local3 == ACardsStack[_local2].ValDown);
if (Game.Mode == 0) {
if (_local6 || (_local5)) {
ACardsStack[_local2].mcHigh._x = Math.floor(StackX0);
ACardsStack[_local2].mcHigh._y = Math.floor(StackY0 + ACardsStack[_local2].Pos);
if (_local6 && (_local5)) {
ACardsStack[_local2].mcHigh.gotoAndStop(1);
} else if (_local6) {
ACardsStack[_local2].mcHigh.gotoAndStop(2);
} else if (_local5) {
ACardsStack[_local2].mcHigh.gotoAndStop(3);
}
} else {
ACardsStack[_local2].mcHigh._x = -10000;
ACardsStack[_local2].mcHigh._y = -10000;
}
} else {
ACardsStack[_local2].mcHigh._x = -10000;
ACardsStack[_local2].mcHigh._y = -10000;
}
Game.SetCardOrient(ACardsStack[_local2].mc, ACardsStack[_local2].ValUp, ACardsStack[_local2].ValDown, ACardsStack[_local2].Orient, 100);
Game.SetCardOrient(ACardsStack[_local2].mcDig, ACardsStack[_local2].ValUp, ACardsStack[_local2].ValDown, ACardsStack[_local2].Orient, 100);
} else {
ACardsStack[_local2].mc._x = -10000;
ACardsStack[_local2].mc._y = -10000;
ACardsStack[_local2].mcDig._x = -10000;
ACardsStack[_local2].mcDig._y = -10000;
ACardsStack[_local2].mcHigh._x = -10000;
ACardsStack[_local2].mcHigh._y = -10000;
}
_local2++;
}
}
function GetStackPiece(x, y) {
var _local3;
var _local7;
var _local6;
var _local5;
var _local4;
_local5 = GetCardKeyValue(CurrInputJ, CurrInputI);
_local4 = GetCardKeyValue(CurrOutputJ, CurrOutputI);
_local3 = 0;
while (_local3 < ACardsStack.length) {
if (ACardsStack[_local3].State == 2) {
_local7 = x - ACardsStack[_local3].mc._x;
_local6 = y - ACardsStack[_local3].mc._y;
if ((Math.abs(_local7) <= 30) && (Math.abs(_local6) <= 15)) {
if (Game.HammerState != 0) {
if (Game.HammerState == 1) {
Game.HammerState = 2;
Game.HammerStrikeIndex = _local3;
Game.HammerStartStrike();
}
return(true);
}
if ((((((_local5 < 0) && (_local4 < 0)) || (_local5 == ACardsStack[_local3].ValUp)) || (_local5 == ACardsStack[_local3].ValDown)) || (_local4 == ACardsStack[_local3].ValUp)) || (_local4 == ACardsStack[_local3].ValDown)) {
} else {
_global.SoundPlay(9);
return(true);
}
ACardMouse.State = 3;
ACardMouse.ValUp = ACardsStack[_local3].ValUp;
ACardMouse.ValDown = ACardsStack[_local3].ValDown;
ACardMouse.Orient = ACardsStack[_local3].Orient;
ACardsStack[_local3].State = 0;
_global.SoundPlay(5);
return(true);
}
}
_local3++;
}
return(false);
}
function SetPieceProbs(p0, p1, p2, p3, p4, p5, p6) {
var _local2;
if (Game.LevelTime <= 100) {
Game.LevelTime = Game.LevelTime0;
}
SumPieceProbs = 0;
_local2 = 0;
while (_local2 < PieceProbs.length) {
PieceProbs[_local2] = 0;
_local2++;
}
if (p0 > 0) {
PieceProbs[0] = p0;
}
if (p1 > 0) {
PieceProbs[1] = p1;
}
if (p2 > 0) {
PieceProbs[2] = p2;
}
if (p3 > 0) {
PieceProbs[3] = p3;
}
if (p4 > 0) {
PieceProbs[4] = p4;
}
if (p5 > 0) {
PieceProbs[5] = p5;
}
if (p6 > 0) {
PieceProbs[6] = p6;
}
_local2 = 0;
while (_local2 < PieceProbs.length) {
SumPieceProbs = SumPieceProbs + PieceProbs[_local2];
_local2++;
}
if (SumPieceProbs <= 0) {
SumPieceProbs = 0;
_local2 = 0;
while (_local2 < PieceProbs.length) {
PieceProbs[_local2] = 1;
SumPieceProbs = SumPieceProbs + PieceProbs[_local2];
_local2++;
}
}
StackCreatePiecesStart();
}
function Clear(aGame) {
var _local2;
var _local3;
_local2 = 0;
while (_local2 < ACards.length) {
ACards[_local2].Delete();
_local2++;
}
GridHide();
Game.BorderHide();
ElementsHide();
ElementsDepthIndex = 0;
TrashTimeCurr = TrashTime;
StackClear();
ACardMouse.State = 0;
_local2 = 0;
while (_local2 < ACells.length) {
_local3 = 0;
while (_local3 < ACells[_local2].length) {
ACells[_local2][_local3].Clear();
_local3++;
}
_local2++;
}
CurrInputI = -1000;
CurrInputJ = -1000;
PrevInputI = -1000;
PrevInputJ = -1000;
PrevInputIndex = -1;
PrevOutputIndex = -1;
InputI = -1000;
InputJ = -1000;
CurrOutputI = -1000;
CurrOutputJ = -1000;
PrevOutputI = -1000;
PrevOutputJ = -1000;
OutputI = -1000;
OutputJ = -1000;
LevelEndCond = 0;
ChainEndMCIn._x = -10000;
ChainEndMCIn._y = -10000;
ChainEndMCOut._x = -10000;
ChainEndMCOut._y = -10000;
ACardMouse.mc._x = -10000;
ACardMouse.mc._y = -10000;
ACardMouse.mcDig._x = -10000;
ACardMouse.mcDig._y = -10000;
ACardMouse.mcHigh._x = -10000;
ACardMouse.mcHigh._y = -10000;
ACardTrash.mc._x = -10000;
ACardTrash.mc._y = -10000;
ACardTrash.mcDig._x = -10000;
ACardTrash.mcDig._y = -10000;
}
function GetI0(x, y) {
var _local2;
_local2 = Math.floor(y / CellSizeY0);
if (_local2 < 0) {
return(-1);
}
if (_local2 >= MaxSizeI) {
return(-1);
}
return(_local2);
}
function GetJ0(x, y) {
var _local2;
_local2 = Math.floor(x / CellSizeX0);
if (_local2 < 0) {
return(-1);
}
if (_local2 >= MaxSizeJ) {
return(-1);
}
return(_local2);
}
function GetI(x, y) {
var _local2;
_local2 = Math.floor((y - PlaneY) / CellSizeY);
if (_local2 < 1) {
return(-1);
}
if (_local2 > (SizeI - 1)) {
return(-1);
}
return(_local2);
}
function GetJ(x, y) {
var _local2;
_local2 = Math.floor((x - PlaneX) / CellSizeX);
if (_local2 < 0) {
return(-1);
}
if (_local2 > MaxSizeJ) {
return(-1);
}
return(_local2);
}
function GetIInf(x, y) {
var _local2;
_local2 = Math.floor(y / CellSizeY0);
return(_local2);
}
function GetJInf(x, y) {
var _local2;
_local2 = Math.floor(x / CellSizeX0);
return(_local2);
}
function GetX(j, i) {
var _local2;
_local2 = (PlaneX + (j * CellSizeX)) + (CellSizeX / 2);
return(_local2);
}
function GetY(j, i) {
var _local2;
_local2 = (PlaneY + (i * CellSizeY)) + (CellSizeY / 2);
return(_local2);
}
function SetGridPos(aMC) {
var _local3;
var _local4;
_local4 = GetIInf(aMC._x, aMC._y);
_local3 = GetJInf(aMC._x, aMC._y);
aMC._x = (PlaneX + (_local3 * CellSizeX)) + (CellSizeX / 2);
aMC._y = (PlaneY + (_local4 * CellSizeY)) + (CellSizeY / 2);
aMC._xscale = Scale;
aMC._yscale = Scale;
}
function SetDepth(aMC) {
var _local2;
_local2 = Game.RootMovie.createEmptyMovieClip("mc_Temp_" + ElementsDepthIndex, ElementsDepth + ElementsDepthIndex);
aMC.swapDepths(_local2);
ElementsMCs[ElementsDepthIndex] = aMC;
removeMovieClip(_local2);
_local2 = null;
ElementsDepthIndex++;
}
function AddPieceMC(aMC, aType, aValueUp, aValueDown, aOrient, aColor) {
var _local3;
var _local2;
_local3 = GetI0(aMC._x, aMC._y);
_local2 = GetJ0(aMC._x, aMC._y);
if ((_local3 < 0) || (_local2 < 0)) {
return(false);
}
if (aType == 100) {
SizeI = _local3;
SizeJ = _local2;
aMC._x = -10000;
aMC._y = -10000;
Game.GridSetup();
GridDraw();
Game.BorderDraw();
NeedSound = true;
return(true);
}
if (aType == 20) {
ACells[_local3][_local2].Init();
ACells[_local3][_local2].State0 = 20;
SetGridPos(aMC);
SetDepth(aMC);
return(true);
}
if ((aType >= 60) && (aType < 70)) {
ACells[_local3][_local2].Init();
ACells[_local3][_local2].CoinValue = aType - 59;
ACells[_local3][_local2].CoinMC = aMC;
SetGridPos(aMC);
SetDepth(aMC);
return(true);
}
if (aType == 70) {
ACells[_local3][_local2].Init();
ACells[_local3][_local2].CoinValue = 100;
ACells[_local3][_local2].CoinMC = aMC;
SetGridPos(aMC);
SetDepth(aMC);
return(true);
}
if (aType == 80) {
ACells[_local3][_local2].Init();
ACells[_local3][_local2].CoinValue = 101;
ACells[_local3][_local2].CoinMC = aMC;
SetGridPos(aMC);
SetDepth(aMC);
return(true);
}
if (aType == 10) {
ACells[_local3][_local2].Init();
ACells[_local3][_local2].State0 = 10;
ACells[_local3][_local2].Value0 = aValueUp;
ACells[_local3][_local2].Value = aValueUp;
ACells[_local3][_local2].Color = aColor;
ACells[_local3][_local2].KeyMC = aMC;
InputI = _local3;
InputJ = _local2;
CurrInputI = _local3;
CurrInputJ = _local2;
PrevInputI = _local3;
PrevInputJ = _local2;
PrevInputIndex = -1;
PrevOutputIndex = -1;
SetGridPos(aMC);
SetDepth(aMC);
return(true);
}
if (aType == 15) {
ACells[_local3][_local2].Init();
ACells[_local3][_local2].State0 = 15;
ACells[_local3][_local2].Value0 = aValueUp;
ACells[_local3][_local2].Value = aValueUp;
ACells[_local3][_local2].Color = aColor;
ACells[_local3][_local2].KeyMC = aMC;
OutputI = _local3;
OutputJ = _local2;
CurrOutputI = _local3;
CurrOutputJ = _local2;
SetGridPos(aMC);
SetDepth(aMC);
return(true);
}
if (aType == 40) {
ACells[_local3][_local2].Init();
ACells[_local3][_local2].State0 = 40;
ACells[_local3][_local2].Value0 = aValueUp;
ACells[_local3][_local2].Value = aValueUp;
ACells[_local3][_local2].Color = aColor;
ACells[_local3][_local2].KeyMC = aMC;
SetGridPos(aMC);
SetDepth(aMC);
return(true);
}
if (aType == 50) {
ACells[_local3][_local2].Init();
ACells[_local3][_local2].State0 = 50;
ACells[_local3][_local2].Value0 = aValueUp;
ACells[_local3][_local2].Color = aColor;
ACells[_local3][_local2].LockMC = aMC;
SetGridPos(aMC);
SetDepth(aMC);
return(true);
}
return(false);
}
function HideCardMouse() {
ACardMouse.mc._x = -10000;
ACardMouse.mc._y = -10000;
ACardMouse.mcDig._x = -10000;
ACardMouse.mcDig._y = -10000;
ACardMouse.mcHigh._x = -10000;
ACardMouse.mcHigh._y = -10000;
}
function HideCardTrash() {
ACardTrash.mc._x = -10000;
ACardTrash.mc._y = -10000;
ACardTrash.mcDig._x = -10000;
ACardTrash.mcDig._y = -10000;
}
function SetCardTrash(aMC, aMCDig) {
ACardTrash.mc._x = aMC._x;
ACardTrash.mc._y = aMC._y;
ACardTrash.mc._xscale = aMC._xscale;
ACardTrash.mc._yscale = aMC._yscale;
ACardTrash.mc._rotation = aMC._rotation;
ACardTrash.mcDig._x = aMCDig._x;
ACardTrash.mcDig._y = aMCDig._y;
ACardTrash.mcDig._xscale = aMCDig._xscale;
ACardTrash.mcDig._yscale = aMCDig._yscale;
ACardTrash.mcDig._rotation = aMCDig._rotation;
ACardTrash.mcDig.Dots_Up.gotoAndStop(aMCDig.Dots_Up._currentframe);
ACardTrash.mcDig.Dots_Down.gotoAndStop(aMCDig.Dots_Down._currentframe);
}
function DrawCardMouse() {
if (Game.State != 1) {
HideCardMouse();
HideCardTrash();
return(undefined);
}
if (Game.IsPause) {
HideCardMouse();
HideCardTrash();
return(undefined);
}
if (ACardMouse.State == 3) {
Game.SetCardOrient(ACardMouse.mc, ACardMouse.ValUp, ACardMouse.ValDown, ACardMouse.Orient, Scale);
if (ACardMouse.Orient == 0) {
Game.SetCardOrient(ACardMouse.mcHigh, ACardMouse.ValUp, ACardMouse.ValDown, 1, Scale);
} else if (ACardMouse.Orient == 1) {
Game.SetCardOrient(ACardMouse.mcHigh, ACardMouse.ValUp, ACardMouse.ValDown, 2, Scale);
} else if (ACardMouse.Orient == 2) {
Game.SetCardOrient(ACardMouse.mcHigh, ACardMouse.ValUp, ACardMouse.ValDown, 3, Scale);
} else if (ACardMouse.Orient == 3) {
Game.SetCardOrient(ACardMouse.mcHigh, ACardMouse.ValUp, ACardMouse.ValDown, 0, Scale);
}
Game.SetCardOrient(ACardMouse.mcDig, ACardMouse.ValUp, ACardMouse.ValDown, ACardMouse.Orient, Scale);
var _local5;
var _local2;
var _local4;
var _local3;
_local5 = GetCardKeyValue(CurrInputJ, CurrInputI);
_local2 = GetCardKeyValue(CurrOutputJ, CurrOutputI);
_local4 = (((_local5 < 0) && (_local2 < 0)) || (_local5 == ACardMouse.ValUp)) || (_local2 == ACardMouse.ValUp);
_local3 = (((_local5 < 0) && (_local2 < 0)) || (_local5 == ACardMouse.ValDown)) || (_local2 == ACardMouse.ValDown);
if ((ACardMouse.Orient == 0) || (ACardMouse.Orient == 2)) {
ACardMouse.mc._x = Game.RootMovie._xmouse + MouseDX02;
ACardMouse.mc._y = Game.RootMovie._ymouse + MouseDY02;
if (Game.Mode == 0) {
ACardMouse.mcHigh._x = Game.RootMovie._xmouse + MouseDX02;
ACardMouse.mcHigh._y = Game.RootMovie._ymouse + MouseDY02;
if (_local4 && (_local3)) {
ACardMouse.mcHigh.gotoAndStop(1);
} else if (_local4) {
if (ACardMouse.Orient == 0) {
ACardMouse.mcHigh.gotoAndStop(2);
} else {
ACardMouse.mcHigh.gotoAndStop(3);
}
} else if (_local3) {
if (ACardMouse.Orient == 0) {
ACardMouse.mcHigh.gotoAndStop(3);
} else {
ACardMouse.mcHigh.gotoAndStop(2);
}
}
} else {
ACardMouse.mcHigh._x = -10000;
ACardMouse.mcHigh._y = -10000;
}
ACardMouse.mcDig._x = Game.RootMovie._xmouse + MouseDX02;
ACardMouse.mcDig._y = Game.RootMovie._ymouse + MouseDY02;
} else {
ACardMouse.mc._x = Game.RootMovie._xmouse + MouseDX13;
ACardMouse.mc._y = Game.RootMovie._ymouse + MouseDY13;
if (Game.Mode == 0) {
if (_local4 && (_local3)) {
ACardMouse.mcHigh.gotoAndStop(1);
} else if (_local4) {
if (ACardMouse.Orient == 1) {
ACardMouse.mcHigh.gotoAndStop(2);
} else {
ACardMouse.mcHigh.gotoAndStop(3);
}
} else if (_local3) {
if (ACardMouse.Orient == 1) {
ACardMouse.mcHigh.gotoAndStop(3);
} else {
ACardMouse.mcHigh.gotoAndStop(2);
}
}
ACardMouse.mcHigh._x = Game.RootMovie._xmouse + MouseDX13;
ACardMouse.mcHigh._y = Game.RootMovie._ymouse + MouseDY13;
} else {
ACardMouse.mcHigh._x = -10000;
ACardMouse.mcHigh._y = -10000;
}
ACardMouse.mcDig._x = Game.RootMovie._xmouse + MouseDX13;
ACardMouse.mcDig._y = Game.RootMovie._ymouse + MouseDY13;
}
} else {
HideCardMouse();
}
}
function RotateMouse(Dir) {
if (Dir > 0) {
ACardMouse.Orient++;
if (ACardMouse.Orient > 3) {
ACardMouse.Orient = 0;
}
} else if (Dir < 0) {
ACardMouse.Orient--;
if (ACardMouse.Orient < 0) {
ACardMouse.Orient = 3;
}
}
}
function GetValue(j, i) {
if (j < 0) {
return(-1);
}
if (j > SizeJ) {
return(-1);
}
if (i < 0) {
return(-1);
}
if (i > SizeI) {
return(-1);
}
return(ACells[i][j].Value);
}
function GetCardValue(j, i) {
if (j < 0) {
return(-1);
}
if (j > SizeJ) {
return(-1);
}
if (i < 0) {
return(-1);
}
if (i > SizeI) {
return(-1);
}
if (ACells[i][j].State0 < 20) {
return(ACells[i][j].Value);
}
return(-1);
}
function GetCardKeyValue(j, i) {
if (j < 0) {
return(-1);
}
if (j > SizeJ) {
return(-1);
}
if (i < 0) {
return(-1);
}
if (i > SizeI) {
return(-1);
}
if ((ACells[i][j].State0 < 20) || (ACells[i][j].State0 == 40)) {
return(ACells[i][j].Value);
}
return(-1);
}
function GetKeyColor(j, i, Value) {
if (j < 0) {
return(-1);
}
if (j > SizeJ) {
return(-1);
}
if (i < 0) {
return(-1);
}
if (i > SizeI) {
return(-1);
}
if (ACells[i][j].State0 == 40) {
if (ACells[i][j].Value == Value) {
return(ACells[i][j].Color);
}
}
return(-1);
}
function IsFree(j, i, Value) {
var _local5;
if (j <= 0) {
return(false);
}
if (j >= SizeJ) {
return(false);
}
if (i <= 0) {
return(false);
}
if (i >= SizeI) {
return(false);
}
if (ACells[i][j].Value != -1) {
return(false);
}
if (ACells[i][j].State0 == 20) {
return(false);
}
if (ACells[i][j].State0 == 40) {
return(false);
}
if (ACells[i][j].State0 == 50) {
return(false);
}
if (ACells[i][j].Value0 != -1) {
if (Value != -1) {
if (ACells[i][j].Value0 != Value) {
return(false);
}
}
}
return(true);
}
function IsInConnect(j, i, Value) {
var _local2;
_local2 = GetCardValue(j - 1, i);
if (_local2 != -1) {
return(_local2);
}
_local2 = GetCardValue(j + 1, i);
if (_local2 != -1) {
return(_local2);
}
_local2 = GetCardValue(j, i - 1);
if (_local2 != -1) {
return(_local2);
}
_local2 = GetCardValue(j, i + 1);
if (_local2 != -1) {
return(_local2);
}
return(-1);
}
function IsNearKey(j, i, Value) {
var _local2;
_local2 = GetKeyColor(j - 1, i, Value);
if (_local2 != -1) {
return(_local2);
}
_local2 = GetKeyColor(j + 1, i, Value);
if (_local2 != -1) {
return(_local2);
}
_local2 = GetKeyColor(j, i - 1, Value);
if (_local2 != -1) {
return(_local2);
}
_local2 = GetKeyColor(j, i + 1, Value);
if (_local2 != -1) {
return(_local2);
}
return(-1);
}
function MoveInputToKey(j, i, Value) {
var _local2;
_local2 = GetKeyColor(j - 1, i, Value);
if (_local2 != -1) {
CurrInputJ = j - 1;
CurrInputI = i;
return(_local2);
}
_local2 = GetKeyColor(j + 1, i, Value);
if (_local2 != -1) {
CurrInputJ = j + 1;
CurrInputI = i;
return(_local2);
}
_local2 = GetKeyColor(j, i - 1, Value);
if (_local2 != -1) {
CurrInputJ = j;
CurrInputI = i - 1;
return(_local2);
}
_local2 = GetKeyColor(j, i + 1, Value);
if (_local2 != -1) {
CurrInputJ = j;
CurrInputI = i + 1;
return(_local2);
}
return(-1);
}
function MoveOutputToKey(j, i, Value) {
var _local2;
_local2 = GetKeyColor(j - 1, i, Value);
if (_local2 != -1) {
CurrOutputJ = j - 1;
CurrOutputI = i;
return(_local2);
}
_local2 = GetKeyColor(j + 1, i, Value);
if (_local2 != -1) {
CurrOutputJ = j + 1;
CurrOutputI = i;
return(_local2);
}
_local2 = GetKeyColor(j, i - 1, Value);
if (_local2 != -1) {
CurrOutputJ = j;
CurrOutputI = i - 1;
return(_local2);
}
_local2 = GetKeyColor(j, i + 1, Value);
if (_local2 != -1) {
CurrOutputJ = j;
CurrOutputI = i + 1;
return(_local2);
}
return(-1);
}
function IsInChain(j, i, Value) {
var _local6;
var _local5;
_local6 = GetCardKeyValue(CurrInputJ, CurrInputI);
_local5 = GetCardKeyValue(CurrOutputJ, CurrOutputI);
if (j <= 0) {
return(0);
}
if (j >= SizeJ) {
return(0);
}
if (i <= 0) {
return(0);
}
if (i >= SizeI) {
return(0);
}
if ((CurrInputI == (i - 1)) && (CurrInputJ == j)) {
if (_local6 == Value) {
return(1);
}
}
if ((CurrInputI == (i + 1)) && (CurrInputJ == j)) {
if (_local6 == Value) {
return(1);
}
}
if ((CurrInputI == i) && (CurrInputJ == (j - 1))) {
if (_local6 == Value) {
return(1);
}
}
if ((CurrInputI == i) && (CurrInputJ == (j + 1))) {
if (_local6 == Value) {
return(1);
}
}
if ((CurrOutputI == (i - 1)) && (CurrOutputJ == j)) {
if (_local5 == Value) {
return(2);
}
}
if ((CurrOutputI == (i + 1)) && (CurrOutputJ == j)) {
if (_local5 == Value) {
return(2);
}
}
if ((CurrOutputI == i) && (CurrOutputJ == (j - 1))) {
if (_local5 == Value) {
return(2);
}
}
if ((CurrOutputI == i) && (CurrOutputJ == (j + 1))) {
if (_local5 == Value) {
return(2);
}
}
return(0);
}
function UnlockCells(Color) {
var _local4;
var _local3;
_local4 = 0;
while (_local4 < ACells.length) {
_local3 = 0;
while (_local3 < ACells[_local4].length) {
if (ACells[_local4][_local3].State0 == 40) {
if (ACells[_local4][_local3].Color == Color) {
ACells[_local4][_local3].KeyMC.Key_mc._visible = false;
_global.AddTempMovie("Stars2", 4000, GetX(_local3, _local4), GetY(_local3, _local4), 0, 0, 100, 0, 100, 0, 14);
}
}
if (ACells[_local4][_local3].State0 == 50) {
if (ACells[_local4][_local3].Color == Color) {
_global.AddTempMovie("Stars2", 4000, GetX(_local3, _local4), GetY(_local3, _local4), 0, 0, 100, 0, 100, 0, 14);
ACells[_local4][_local3].LockMC.play();
ACells[_local4][_local3].State0 = 0;
}
}
_local3++;
}
_local4++;
}
}
function HammerStrike() {
var _local2;
_local2 = Game.HammerStrikeIndex;
if (Game.HammerStrikeInput) {
ACells[ACards[_local2].iUp][ACards[_local2].jUp].State = 0;
ACells[ACards[_local2].iDown][ACards[_local2].jDown].State = 0;
ACells[ACards[_local2].iUp][ACards[_local2].jUp].Value = -1;
ACells[ACards[_local2].iDown][ACards[_local2].jDown].Value = -1;
ACells[ACards[_local2].iUp][ACards[_local2].jUp].Ind = -1;
ACells[ACards[_local2].iDown][ACards[_local2].jDown].Ind = -1;
PrevInputIndex = ACards[_local2].PrevInputIndex;
CurrInputI = ACards[_local2].PrevInputI;
CurrInputJ = ACards[_local2].PrevInputJ;
ChainEndMCIn._x = GetX(CurrInputJ, CurrInputI);
ChainEndMCIn._y = GetY(CurrInputJ, CurrInputI);
ACards[_local2].State = 0;
ACards[_local2].mc._x = -10000;
ACards[_local2].mc._y = -10000;
ACards[_local2].mcDig._x = -10000;
ACards[_local2].mcDig._y = -10000;
} else {
ACells[ACards[_local2].iUp][ACards[_local2].jUp].State = 0;
ACells[ACards[_local2].iDown][ACards[_local2].jDown].State = 0;
ACells[ACards[_local2].iUp][ACards[_local2].jUp].Value = -1;
ACells[ACards[_local2].iDown][ACards[_local2].jDown].Value = -1;
ACells[ACards[_local2].iUp][ACards[_local2].jUp].Ind = -1;
ACells[ACards[_local2].iDown][ACards[_local2].jDown].Ind = -1;
PrevOutputIndex = ACards[_local2].PrevOutputIndex;
CurrOutputI = ACards[_local2].PrevOutputI;
CurrOutputJ = ACards[_local2].PrevOutputJ;
ChainEndMCOut._x = GetX(CurrOutputJ, CurrOutputI);
ChainEndMCOut._y = GetY(CurrOutputJ, CurrOutputI);
ACards[_local2].State = 0;
ACards[_local2].mc._x = -10000;
ACards[_local2].mc._y = -10000;
ACards[_local2].mcDig._x = -10000;
ACards[_local2].mcDig._y = -10000;
}
}
function PlaceCard(aValUp, aValDown, aOrient, x, y) {
var _local5;
var _local4;
var _local7;
var _local6;
var _local8;
var _local9;
var _local13;
var _local14;
var _local3;
var _local15;
var _local12;
_local15 = false;
_local12 = false;
if ((ACardMouse.Orient == 0) || (ACardMouse.Orient == 2)) {
x = x + MouseDX02;
y = y + MouseDY02;
} else {
x = x + MouseDX13;
y = y + MouseDY13;
}
if (aOrient == 0) {
_local4 = Math.floor((x - PlaneX) / CellSizeX);
_local6 = _local4;
if (_local4 <= 0) {
return(false);
}
if (_local4 >= SizeJ) {
return(false);
}
_local5 = Math.floor(((y - PlaneY) - (CellSizeY / 2)) / CellSizeY);
_local7 = _local5 + 1;
if (_local5 <= 0) {
return(false);
}
if (_local5 >= SizeI) {
return(false);
}
if (_local7 <= 0) {
return(false);
}
if (_local7 >= SizeI) {
return(false);
}
} else if (aOrient == 1) {
_local5 = Math.floor((y - PlaneY) / CellSizeY);
_local7 = _local5;
if (_local5 <= 0) {
return(false);
}
if (_local5 >= SizeI) {
return(false);
}
_local4 = Math.floor(((x - PlaneX) - (CellSizeX / 2)) / CellSizeX);
_local6 = _local4 + 1;
if (_local4 <= 0) {
return(false);
}
if (_local4 >= SizeJ) {
return(false);
}
if (_local6 <= 0) {
return(false);
}
if (_local6 >= SizeJ) {
return(false);
}
} else if (aOrient == 2) {
_local4 = Math.floor((x - PlaneX) / CellSizeX);
if (_local4 <= 0) {
return(false);
}
if (_local4 >= SizeJ) {
return(false);
}
_local6 = _local4;
_local7 = Math.floor(((y - PlaneY) - (CellSizeY / 2)) / CellSizeY);
_local5 = _local7 + 1;
if (_local5 <= 0) {
return(false);
}
if (_local5 >= SizeI) {
return(false);
}
if (_local7 <= 0) {
return(false);
}
if (_local7 >= SizeI) {
return(false);
}
} else if (aOrient == 3) {
_local5 = Math.floor((y - PlaneY) / CellSizeY);
_local7 = _local5;
if (_local5 <= 0) {
return(false);
}
if (_local5 >= SizeI) {
return(false);
}
_local6 = Math.floor(((x - PlaneX) - (CellSizeX / 2)) / CellSizeX);
_local4 = _local6 + 1;
if (_local4 <= 0) {
return(false);
}
if (_local4 >= SizeJ) {
return(false);
}
if (_local6 <= 0) {
return(false);
}
if (_local6 >= SizeJ) {
return(false);
}
}
if (!IsFree(_local4, _local5, aValUp)) {
return(false);
}
if (!IsFree(_local6, _local7, aValDown)) {
return(false);
}
PrevInputI = CurrInputI;
PrevInputJ = CurrInputJ;
PrevOutputI = CurrOutputI;
PrevOutputJ = CurrOutputJ;
if ((((CurrInputJ < 0) && (CurrInputI < 0)) && (CurrOutputJ < 0)) && (CurrOutputI < 0)) {
CurrInputJ = _local4;
CurrInputI = _local5;
CurrOutputJ = _local6;
CurrOutputI = _local7;
LevelEndCond = 1;
_local3 = PlaceCardPos(_local4, _local5, _local6, _local7, aValUp, aValDown, aOrient);
if (_local3 >= 0) {
return(true);
}
return(false);
}
_local8 = IsInChain(_local4, _local5, aValUp);
_local9 = IsInChain(_local6, _local7, aValDown);
_local13 = IsNearKey(_local4, _local5, aValUp);
_local14 = IsNearKey(_local6, _local7, aValDown);
if ((_local8 == 0) && (_local9 == 0)) {
return(false);
}
if (((_local8 != 0) && (_local9 != 0)) && (_local8 == _local9)) {
return(false);
}
if (_local8 == 1) {
CurrInputI = _local7;
CurrInputJ = _local6;
if (_local13 >= 0) {
if (MoveInputToKey(CurrInputJ, CurrInputI, aValUp) >= 0) {
PrevInputIndex = -1;
_local15 = true;
_global.SoundPlay(6);
}
}
if (_local14 >= 0) {
if (MoveInputToKey(CurrInputJ, CurrInputI, aValDown) >= 0) {
PrevInputIndex = -1;
_local15 = true;
_global.SoundPlay(6);
}
}
} else if (_local8 == 2) {
CurrOutputI = _local7;
CurrOutputJ = _local6;
if (_local13 >= 0) {
if (MoveOutputToKey(CurrOutputJ, CurrOutputI, aValUp) >= 0) {
PrevOutputIndex = -1;
_local12 = true;
_global.SoundPlay(6);
}
}
if (_local14 >= 0) {
if (MoveOutputToKey(CurrOutputJ, CurrOutputI, aValDown) >= 0) {
PrevOutputIndex = -1;
_local12 = true;
_global.SoundPlay(6);
}
}
}
if (_local9 == 1) {
CurrInputI = _local5;
CurrInputJ = _local4;
if (_local13 >= 0) {
if (MoveInputToKey(CurrInputJ, CurrInputI, aValUp) >= 0) {
PrevInputIndex = -1;
_local15 = true;
_global.SoundPlay(6);
}
}
if (_local14 >= 0) {
if (MoveInputToKey(CurrInputJ, CurrInputI, aValDown) >= 0) {
_local15 = true;
PrevInputIndex = -1;
_global.SoundPlay(6);
}
}
} else if (_local9 == 2) {
CurrOutputI = _local5;
CurrOutputJ = _local4;
if (_local13 >= 0) {
if (MoveOutputToKey(CurrOutputJ, CurrOutputI, aValUp) >= 0) {
PrevOutputIndex = -1;
_local12 = true;
_global.SoundPlay(6);
}
}
if (_local14 >= 0) {
if (MoveOutputToKey(CurrOutputJ, CurrOutputI, aValDown) >= 0) {
PrevOutputIndex = -1;
_local12 = true;
_global.SoundPlay(6);
}
}
}
if (_local13 >= 0) {
UnlockCells(_local13);
}
if (_local14 >= 0) {
UnlockCells(_local14);
}
_local3 = PlaceCardPos(_local4, _local5, _local6, _local7, aValUp, aValDown, aOrient);
if (_local3 >= 0) {
ACards[_local3].PrevInputI = -1;
ACards[_local3].PrevInputJ = -1;
ACards[_local3].PrevOutputI = -1;
ACards[_local3].PrevOutputJ = -1;
ACards[_local3].PrevInputIndex = -1;
ACards[_local3].PrevOutputIndex = -1;
if (_local8 == 1) {
ACards[_local3].PrevInputI = PrevInputI;
ACards[_local3].PrevInputJ = PrevInputJ;
ACards[_local3].PrevInputIndex = PrevInputIndex;
if (!_local15) {
PrevInputIndex = _local3;
}
} else if (_local8 == 2) {
ACards[_local3].PrevOutputI = PrevOutputI;
ACards[_local3].PrevOutputJ = PrevOutputJ;
ACards[_local3].PrevOutputIndex = PrevOutputIndex;
if (!_local12) {
PrevOutputIndex = _local3;
}
}
if (_local9 == 1) {
ACards[_local3].PrevInputI = PrevInputI;
ACards[_local3].PrevInputJ = PrevInputJ;
ACards[_local3].PrevInputIndex = PrevInputIndex;
if (!_local15) {
PrevInputIndex = _local3;
}
} else if (_local9 == 2) {
ACards[_local3].PrevOutputI = PrevOutputI;
ACards[_local3].PrevOutputJ = PrevOutputJ;
ACards[_local3].PrevOutputIndex = PrevOutputIndex;
if (!_local12) {
PrevOutputIndex = _local3;
}
}
if (LevelEndCond == 0) {
if (((_local8 != 0) && (_local9 != 0)) && (_local8 != _local9)) {
if (Game.LevelCompleteTime == 0) {
if (Game.IsLevelComplete()) {
Game.LevelCompleteTime = 1;
_global.AddTempMovie("Message_LevelComplete", 4000, 312, 220, 0, 0, 100, 0, 100, 0, 25);
_global.SoundPlay(7);
} else if (Game.LevelFailedTime <= 0) {
Game.LevelFailedTime = 1;
_global.AddTempMovie("Message_LevelFailed", 4000, 312, 220, 0, 0, 100, 0, 100, 0, 25);
_global.SoundPlay(10);
}
}
}
}
return(true);
}
return(false);
}
function PlaceCardPos(jUp, iUp, jDown, iDown, aValUp, aValDown, aOrient) {
var _local3;
var _local8;
var _local9;
_local8 = 0;
_local9 = false;
_local3 = 0;
while (_local3 < ACards.length) {
if (ACards[_local3].State == 0) {
ACards[_local3].State = 1;
ACards[_local3].Index = _local3;
ACards[_local3].mc = Game.RootMovie.attachMovie("SPiece", "SPiece_Plane_" + _local3, PlaneDepth + _local3);
ACards[_local3].mcDig = Game.RootMovie.attachMovie("SPieceDig", "SPiece_Plane_Dig_" + _local3, PlaneDepthDig + _local3);
ACards[_local3].jUp = jUp;
ACards[_local3].iUp = iUp;
ACards[_local3].jDown = jDown;
ACards[_local3].iDown = iDown;
ACards[_local3].mc._x = (GetX(jUp, iUp) + GetX(jDown, iDown)) / 2;
ACards[_local3].mc._y = (GetY(jUp, iUp) + GetY(jDown, iDown)) / 2;
ACards[_local3].mcDig._x = (GetX(jUp, iUp) + GetX(jDown, iDown)) / 2;
ACards[_local3].mcDig._y = (GetY(jUp, iUp) + GetY(jDown, iDown)) / 2;
Game.SetCardOrient(ACards[_local3].mc, aValUp, aValDown, aOrient, Scale);
Game.SetCardOrient(ACards[_local3].mcDig, aValUp, aValDown, aOrient, Scale);
ACells[iUp][jUp].Value = aValUp;
ACells[iDown][jDown].Value = aValDown;
ACells[iUp][jUp].State = 1;
ACells[iDown][jDown].State = 2;
ACells[iUp][jUp].CardInd = _local3;
ACells[iDown][jDown].CardInd = _local3;
if (ACells[iUp][jUp].CoinValue > 0) {
if (ACells[iUp][jUp].CoinMC != null) {
ACells[iUp][jUp].CoinMC._x = -10000;
ACells[iUp][jUp].CoinMC._y = -10000;
}
if (ACells[iUp][jUp].CoinValue <= 10) {
_local8 = _local8 + (ACells[iUp][jUp].CoinValue * 100);
_local9 = true;
_global.AddTempMovie("Stars1", 4000, GetX(jUp, iUp), GetY(jUp, iUp), 0, 0, 100, 0, 100, 0, 14);
} else if (ACells[iUp][jUp].CoinValue == 100) {
_local8 = _local8 + 100;
_local9 = true;
_global.AddTempMovie("Stars1", 4000, GetX(jUp, iUp), GetY(jUp, iUp), 0, 0, 100, 0, 100, 0, 14);
Game.WatchTime = Game.WatchTime + Game.WatchTimeAdd;
} else if (ACells[iUp][jUp].CoinValue == 101) {
_local8 = _local8 + 100;
_local9 = true;
_global.AddTempMovie("Stars1", 4000, GetX(jUp, iUp), GetY(jUp, iUp), 0, 0, 100, 0, 100, 0, 14);
Game.HammerValue++;
Game.DrawHammerValue();
}
ACells[iUp][jUp].CoinValue = 0;
}
if (ACells[iDown][jDown].CoinValue > 0) {
if (ACells[iDown][jDown].CoinMC != null) {
ACells[iDown][jDown].CoinMC._x = -10000;
ACells[iDown][jDown].CoinMC._y = -10000;
}
if (ACells[iDown][jDown].CoinValue <= 10) {
_local8 = _local8 + (ACells[iDown][jDown].CoinValue * 100);
_local9 = true;
_global.AddTempMovie("Stars1", 4000, GetX(jDown, iDown), GetY(jDown, iDown), 0, 0, 100, 0, 100, 0, 14);
} else if (ACells[iDown][jDown].CoinValue == 100) {
_local8 = _local8 + 100;
_local9 = true;
_global.AddTempMovie("Stars1", 4000, GetX(jDown, iDown), GetY(jDown, iDown), 0, 0, 100, 0, 100, 0, 14);
Game.WatchTime = Game.WatchTime + Game.WatchTimeAdd;
} else if (ACells[iDown][jDown].CoinValue == 101) {
_local8 = _local8 + 100;
_local9 = true;
_global.AddTempMovie("Stars1", 4000, GetX(jDown, iDown), GetY(jDown, iDown), 0, 0, 100, 0, 100, 0, 14);
Game.HammerValue++;
Game.DrawHammerValue();
}
ACells[iDown][jDown].CoinValue = 0;
}
_local8 = _local8 + CCard.GetCardScore(aValUp, aValDown);
Game.AddScore(_local8);
if (_local9) {
_global.SoundPlay(6);
}
_global.AddTextMessage("" + _local8, 5000, ACards[_local3].mc._x, ACards[_local3].mc._y, -9, 100, 2, 0, 0);
if (LevelEndCond == 1) {
if (Game.CheckLevelEnd()) {
if (Game.LevelCompleteTime == 0) {
Game.LevelCompleteTime = 1;
_global.SoundPlay(7);
_global.AddTempMovie("Message_LevelComplete", 4000, 312, 220, 0, 0, 100, 0, 100, 0, 25);
}
}
}
return(_local3);
}
_local3++;
}
return(-1);
}
function Draw() {
DrawCardMouse();
Game.DrawCardTrash();
StackDraw();
ChainInOutDraw();
}
function Update() {
if (Game.State == 1) {
if (TrashTimeCurr <= TrashTime) {
TrashTimeCurr++;
}
StackUpdate();
}
}
function GetKeyChainValue(jEnd, iEnd) {
var _local3;
var _local2;
_local3 = iEnd - 2;
while (_local3 <= (iEnd + 2)) {
if ((_local3 <= 0) || (_local3 >= (SizeI - 1))) {
} else {
_local2 = jEnd - 2;
while (_local2 <= (jEnd + 2)) {
if ((_local2 <= 0) || (_local2 >= (SizeJ - 1))) {
} else if ((_local3 == iEnd) && (_local2 == jEnd)) {
} else if ((Math.abs(_local3 - iEnd) + Math.abs(_local2 - jEnd)) > 3) {
} else if (ACells[_local3][_local2].State0 == 40) {
return(ACells[_local3][_local2].Value);
}
_local2++;
}
}
_local3++;
}
return(-1);
}
var NeedSound = true;
var MaxSizeI = 16;
var MaxSizeJ = 16;
var MaxSizeStack = 9;
var SizeI = 7;
var SizeJ = 7;
var GridDepth = 100;
var BorderDepth = 900;
var ElementsDepth = 1000;
var ElementsDepthIndex = 0;
var PlaneDepth = 2100;
var PlaneDepthDig = 2500;
var ChainEndDepth = 2400;
var TrashDepth = 3495;
var TrashDepthDig = 3497;
var MouseDepth = 7100;
var MouseDepthHigh = 7105;
var MouseDepthDig = 7110;
var StackDepth = 3500;
var StackDepthHigh = 3520;
var StackDepthDig = 3540;
var StackX0 = 44;
var StackY0 = -20;
var StackDX = 0;
var StackDY = 36;
var TrashTimeCurr = 1;
var TrashTime = 1;
var StackPos = 0;
var BeltFrame = 1;
var StackAddFrame = 0;
var StackSpeed = 1;
var StackStartPieces = 4;
var StackSpeedAdd = 0;
var Scale = 100;
var CellSizeX = 30;
var CellSizeY = 30;
var CellSizeX0 = 30;
var CellSizeY0 = 30;
var PlaneX = 100;
var PlaneY = 11;
var PlaneX0 = 115;
var PlaneY0 = 40;
var PlaneX1 = 525;
var PlaneY1 = 430;
var MouseDX02 = -12;
var MouseDY02 = -12;
var MouseDX13 = -12;
var MouseDY13 = -12;
var LevelEndCond = 0;
var EndPieceProb = 0.25;
var ChainPieceProb = 0.25;
}
Symbol 426 MovieClip [__Packages.CCard] Frame 0
class CCard
{
var Game, mc, mcDig, mcHigh, ValUp, ValDown, Orient, State;
function CCard (aGame) {
Game = aGame;
mc = null;
mcDig = null;
mcHigh = null;
ValUp = 0;
ValDown = 0;
Orient = 0;
}
function Delete() {
if (mc != null) {
removeMovieClip(mc);
delete mc;
mc = null;
}
if (mcDig != null) {
removeMovieClip(mcDig);
delete mcDig;
mcDig = null;
}
State = 0;
}
function CreateRandom() {
var _local2;
var _local3;
ValUp = MMath.iRandRange(0, 6);
ValDown = MMath.iRandRange(0, 6);
_local3 = Game.Plane.SumPieceProbs * Math.random();
_local2 = 0;
while (_local2 < Game.Plane.PieceProbs.length) {
if (Game.Plane.PieceProbs[_local2] > 0) {
_local3 = _local3 - Game.Plane.PieceProbs[_local2];
if (_local3 <= 0) {
ValUp = _local2;
break;
}
}
_local2++;
}
if (Math.random() < Game.Plane.EndPieceProb) {
var _local5;
_local5 = Game.Plane.GetValue(Game.Plane.CurrInputJ, Game.Plane.CurrInputI);
if (_local5 >= 0) {
ValUp = _local5;
}
}
_local3 = Game.Plane.SumPieceProbs * Math.random();
_local2 = 0;
while (_local2 < Game.Plane.PieceProbs.length) {
if (Game.Plane.PieceProbs[_local2] > 0) {
_local3 = _local3 - Game.Plane.PieceProbs[_local2];
if (_local3 <= 0) {
ValDown = _local2;
break;
}
}
_local2++;
}
if (Math.random() < Game.Plane.EndPieceProb) {
var _local5 = Game.Plane.GetValue(Game.Plane.CurrOutputJ, Game.Plane.CurrOutputI);
if (_local5 >= 0) {
ValDown = _local5;
}
}
if ((Math.abs(Game.Plane.CurrOutputJ - Game.Plane.CurrInputJ) + Math.abs(Game.Plane.CurrOutputI - Game.Plane.CurrInputI)) <= 3) {
if (Math.random() < Game.Plane.ChainPieceProb) {
if (Math.random() < 0.5) {
var _local5 = Game.Plane.GetValue(Game.Plane.CurrOutputJ, Game.Plane.CurrOutputI);
if (_local5 >= 0) {
ValDown = _local5;
}
_local5 = Game.Plane.GetValue(Game.Plane.CurrInputJ, Game.Plane.CurrInputI);
if (_local5 >= 0) {
ValUp = _local5;
}
} else {
var _local5 = Game.Plane.GetValue(Game.Plane.CurrInputJ, Game.Plane.CurrInputI);
if (_local5 >= 0) {
ValUp = _local5;
}
_local5 = Game.Plane.GetValue(Game.Plane.CurrOutputJ, Game.Plane.CurrOutputI);
if (_local5 >= 0) {
ValDown = _local5;
}
}
return(undefined);
}
}
var _local4;
_local4 = Game.Plane.GetKeyChainValue(Game.Plane.CurrInputJ, Game.Plane.CurrInputI);
if (_local4 >= 0) {
if (Math.random() < Game.Plane.ChainPieceProb) {
if (Math.random() < 0.5) {
ValDown = _local4;
var _local5 = Game.Plane.GetValue(Game.Plane.CurrInputJ, Game.Plane.CurrInputI);
if (_local5 >= 0) {
ValUp = _local5;
}
} else {
var _local5 = Game.Plane.GetValue(Game.Plane.CurrInputJ, Game.Plane.CurrInputI);
if (_local5 >= 0) {
ValUp = _local5;
}
ValDown = _local4;
}
return(undefined);
}
}
_local4 = Game.Plane.GetKeyChainValue(Game.Plane.CurrOutputJ, Game.Plane.CurrOutputI);
if (_local4 >= 0) {
if (Math.random() < Game.Plane.ChainPieceProb) {
if (Math.random() < 0.5) {
ValDown = _local4;
var _local5 = Game.Plane.GetValue(Game.Plane.CurrOutputJ, Game.Plane.CurrOutputI);
if (_local5 >= 0) {
ValUp = _local5;
}
} else {
var _local5 = Game.Plane.GetValue(Game.Plane.CurrOutputJ, Game.Plane.CurrOutputI);
if (_local5 >= 0) {
ValUp = _local5;
}
ValDown = _local4;
}
return(undefined);
}
}
}
static function GetCardScore(aValUp, aValDown) {
var _local1;
_local1 = aValUp + aValDown;
if (aValUp == 0) {
_local1 = _local1 + 7;
}
if (aValDown == 0) {
_local1 = _local1 + 7;
}
_local1 = _local1 * 10;
return(_local1);
}
}
Symbol 427 MovieClip [__Packages.MMath] Frame 0
class MMath
{
function MMath () {
}
static function iRandRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
static function fRandRange(min, max) {
var _local1 = (Math.random() * (max - min)) + min;
return(_local1);
}
}
Symbol 428 MovieClip [__Packages.CCell] Frame 0
class CCell
{
var Game, State0, State, Value0, Value, Color, CardInd, LockMC, KeyMC, CoinMC, CoinValue, Pos;
function CCell (aGame) {
Game = aGame;
}
function Init() {
State0 = 0;
State = 0;
Value0 = -1;
Value = -1;
Color = -1;
CardInd = -1;
LockMC = null;
KeyMC = null;
CoinMC = null;
CoinValue = 0;
Pos = 0;
}
function Clear() {
State0 = 0;
State = 0;
Value0 = -1;
Value = -1;
Color = -1;
CardInd = -1;
LockMC = null;
if (KeyMC != null) {
}
KeyMC = null;
CoinMC = null;
CoinValue = 0;
Pos = 0;
}
}
Symbol 126 Button
on (release) {
_parent.play();
}
Symbol 127 MovieClip Frame 1
stonesHitarea_mc.onRelease = function () {
var _local2 = _root._url;
getURL (("http://www.mygame.com/bounce.jsp?game=TheDominoKnight&from=" + _local2) + "&typ=loader_movie", "_blank");
};
Symbol 127 MovieClip Frame 79
stop();
Symbol 138 MovieClip Frame 60
_root.play();
Symbol 158 MovieClip Frame 1
stop();
Symbol 162 Button
on (release) {
getURL (("http://www.mygame.com/bounce.jsp?game=TheDominoKnight&from=" + gameUrl) + "&typ=sign", "_blank");
}
Symbol 166 Button
on (rollOver) {
_global.SoundPlayRollover();
}
on (press) {
_global.SoundPlay(1);
}
on (release) {
_global.IsContinue = true;
if (_root.Game.SharedState.data.GameMode == 1) {
gotoAndPlay ("Help_Hard");
} else {
gotoAndPlay ("Help_Easy");
}
}
Symbol 169 Button
on (rollOver) {
_global.SoundPlayRollover();
}
on (press) {
_global.SoundPlay(1);
}
on (release) {
_global.IsContinue = false;
gotoAndPlay ("Help_Easy");
}
Symbol 172 Button
on (rollOver) {
_global.SoundPlayRollover();
}
on (press) {
_global.SoundPlay(1);
}
on (release) {
_global.IsContinue = false;
gotoAndPlay ("Help_Hard");
}
Symbol 175 Button
on (rollOver) {
_global.SoundPlayRollover();
}
on (press) {
_global.SoundPlay(1);
}
on (release) {
_global.IsContinue = false;
gotoAndPlay ("Help");
}
Symbol 178 Button
on (rollOver) {
_global.SoundPlayRollover();
}
on (press) {
_global.SoundPlay(1);
}
on (release) {
getURL (("http://www.mygame.com/bounce.jsp?game=TheDominoKnight&from=" + gameUrl) + "&typ=highscores&redirect=/game/thedominoknight/highscores", "_blank");
}
Symbol 181 Button
on (rollOver) {
_global.SoundPlayRollover();
}
on (press) {
_global.SoundPlay(1);
}
on (release) {
getURL (("http://www.mygame.com/bounce.jsp?game=TheDominoKnight&from=" + gameUrl) + "&typ=other_games", "_blank");
}
Symbol 232 MovieClip Frame 1
_root.Game.AddPieceMC(this, 60, -1, -1, 0, -1);
gotoAndPlay(random(12) + 2);
Symbol 232 MovieClip Frame 14
gotoAndPlay (2);
Symbol 247 Button
on (release) {
_parent.gotoAndStop(2);
}
Symbol 248 Button
on (release) {
_root.gotoAndStop("Title");
}
Symbol 276 MovieClip Frame 1
_root.Game.AddPieceMC(this, 80, -1, -1, 0, -1);
Symbol 284 MovieClip Frame 1
Symbol 285 MovieClip Frame 1
_root.Game.AddPieceMC(this, 70, -1, -1, 0, -1);
this.gotoAndPlay(2);
Symbol 285 MovieClip Frame 25
this.gotoAndPlay(2);
Symbol 299 Button
on (release) {
_parent.gotoAndStop(1);
}
Symbol 300 MovieClip Frame 1
_root.Hammer_var = 5;
Symbol 300 MovieClip Frame 6
hammer_help.gotoAndStop(1);
_root.Hammer_var = _root.Hammer_var - 1;
Symbol 300 MovieClip Frame 11
hammer_help.gotoAndPlay(1);
Symbol 300 MovieClip Frame 36
hammer_help.gotoAndStop(1);
_root.Hammer_var = _root.Hammer_var - 1;
Symbol 300 MovieClip Frame 47
hammer_help.gotoAndPlay(1);
Symbol 300 MovieClip Frame 96
hammer_help.gotoAndStop(1);
_root.Hammer_var = _root.Hammer_var - 1;
Symbol 300 MovieClip Frame 108
hammer_help.gotoAndPlay(1);
Symbol 301 MovieClip Frame 1
stop();
Symbol 301 MovieClip Frame 2
stop();
Symbol 309 Button
on (release) {
gotoAndPlay ("out");
}
Symbol 310 MovieClip Frame 1
stop();
Symbol 310 MovieClip Frame 80
if (_global.IsContinue) {
_root.Game.ClickContinue();
} else {
_root.Game.ClickHard();
}
Symbol 312 Button
on (release) {
gotoAndPlay ("out");
}
Symbol 313 MovieClip Frame 1
stop();
Symbol 313 MovieClip Frame 80
if (_global.IsContinue) {
_root.Game.ClickContinue();
} else {
_root.Game.ClickEasy();
}
Symbol 320 MovieClip Frame 1
stop();
Symbol 320 MovieClip Frame 15
stop();
Symbol 321 MovieClip Frame 1
this.belt_0.stop();
this.belt_1.stop();
this.belt_2.stop();
this.belt_3.stop();
Symbol 322 Button
on (press) {
_root.Game.HammerPress();
}
Symbol 327 Button
on (release) {
_global.SoundOn = !_global.SoundOn;
if (_global.SoundOn) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
}
Symbol 329 Button
on (release) {
_global.SoundOn = !_global.SoundOn;
if (_global.SoundOn) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
}
Symbol 330 MovieClip Frame 1
stop();
Symbol 332 Button
on (release) {
_global.MusicOn = !_global.MusicOn;
if (_global.MusicOn) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
}
Symbol 334 Button
on (release) {
_global.MusicOn = !_global.MusicOn;
if (_global.MusicOn) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
}
Symbol 335 MovieClip Frame 1
stop();
Symbol 340 Button
on (rollOver) {
_global.SoundPlayRollover();
}
on (press) {
_global.SoundPlay(1);
}
on (release) {
_root.Game.PauseClick();
}
Symbol 348 MovieClip Frame 1
stop();
Symbol 352 MovieClip Frame 1
_root.Game.AddPieceMC(this, 100, -1, -1, 0, -1);
Symbol 354 MovieClip Frame 1
_root.Game.AddPieceMC(this, 15, 3, -1, 0, -1);
this.gotoAndStop(2);
Symbol 356 MovieClip Frame 1
_root.Game.AddPieceMC(this, 10, 1, -1, 0, -1);
this.gotoAndStop(2);
Symbol 358 MovieClip Frame 1
_root.Game.AddPieceMC(this, 10, 2, -1, 0, -1);
this.gotoAndStop(2);
Symbol 360 MovieClip Frame 1
_root.Game.AddPieceMC(this, 15, 4, -1, 0, -1);
this.gotoAndStop(2);
Symbol 362 MovieClip Frame 1
_root.Game.AddPieceMC(this, 20, -1, -1, 0, -1);
Symbol 363 MovieClip Frame 1
_root.Game.AddPieceMC(this, 15, 2, -1, 0, -1);
this.gotoAndStop(2);
Symbol 364 MovieClip Frame 1
_root.Game.AddPieceMC(this, 80, -1, -1, 0, -1);
Symbol 366 MovieClip Frame 1
_root.Game.AddPieceMC(this, 15, 5, -1, 0, -1);
this.gotoAndStop(2);
Symbol 368 MovieClip Frame 1
_root.Game.AddPieceMC(this, 50, -1, -1, 0, 0);
stop();
Symbol 368 MovieClip Frame 2
stop();
Symbol 371 MovieClip Frame 4
stop();
Symbol 377 MovieClip Frame 1
_root.Game.AddPieceMC(this, 40, 1, -1, 0, 0);
Symbol 378 MovieClip Frame 1
_root.Game.AddPieceMC(this, 10, 5, -1, 0, -1);
this.gotoAndStop(2);
Symbol 380 MovieClip Frame 1
_root.Game.AddPieceMC(this, 15, 6, -1, 0, -1);
this.gotoAndStop(2);
Symbol 381 MovieClip Frame 1
_root.Game.AddPieceMC(this, 40, 4, -1, 0, 0);
Symbol 382 MovieClip Frame 1
_root.Game.AddPieceMC(this, 10, 3, -1, 0, -1);
this.gotoAndStop(2);
Symbol 383 MovieClip Frame 1
_root.Game.AddPieceMC(this, 40, 5, -1, 0, 0);
Symbol 385 MovieClip Frame 1
_root.Game.AddPieceMC(this, 50, -1, -1, 0, 1);
stop();
Symbol 385 MovieClip Frame 2
stop();
Symbol 389 MovieClip Frame 1
_root.Game.AddPieceMC(this, 40, 5, -1, 0, 1);
Symbol 390 MovieClip Frame 1
_root.Game.AddPieceMC(this, 15, 1, -1, 0, -1);
this.gotoAndStop(2);
Symbol 391 MovieClip Frame 1
_root.Game.AddPieceMC(this, 40, 2, -1, 0, 0);
Symbol 392 MovieClip Frame 1
_root.Game.AddPieceMC(this, 40, 3, -1, 0, 0);
Symbol 393 MovieClip Frame 1
_root.Game.AddPieceMC(this, 40, 2, -1, 0, 102);
Symbol 394 MovieClip Frame 1
_root.Game.AddPieceMC(this, 40, 3, -1, 0, 103);
Symbol 395 MovieClip Frame 1
_root.Game.AddPieceMC(this, 40, 4, -1, 0, 104);
Symbol 396 MovieClip Frame 1
_root.Game.AddPieceMC(this, 40, 1, -1, 0, 101);
Symbol 397 MovieClip Frame 1
_root.Game.AddPieceMC(this, 40, 5, -1, 0, 105);
Symbol 398 MovieClip Frame 1
_root.Game.AddPieceMC(this, 40, 6, -1, 0, 106);
Symbol 399 MovieClip Frame 1
_root.Game.AddPieceMC(this, 10, 6, -1, 0, -1);
this.gotoAndStop(2);
Symbol 405 Button
on (release) {
_global.player_name = _parent.player_name;
_root.Game.SaveState();
_root.userrank = "";
loadVariablesNum ((("http://www.mygame.com/servlet/WebGameServlet?action=gameover&url=thedominoknight&points=" + _global.Score) + "&username=") + escape(_global.player_name), 0);
_root.gotoAndStop("Title");
}
Symbol 406 Button
on (release) {
_root.gotoAndStop("Title");
}
Symbol 410 Button
on (release) {
_root.gotoAndStop("Title");
}
Symbol 411 MovieClip Frame 40
if (_global.Score <= 0) {
gotoAndPlay ("NoScore");
}
Symbol 411 MovieClip Frame 41
_parent.player_name = _global.player_name;
Symbol 411 MovieClip Frame 43
stop();
Symbol 411 MovieClip Frame 48
stop();
Symbol 413 Button
on (release) {
_global.player_name = _parent.player_name;
_root.Game.SaveState();
_root.userrank = "";
loadVariablesNum ((("http://www.mygame.com/servlet/WebGameServlet?action=gameover&url=thedominoknight&points=" + _global.Score) + "&username=") + escape(_global.player_name), 0);
_root.gotoAndStop("Title");
}
Symbol 415 MovieClip Frame 40
if (_global.Score <= 0) {
gotoAndPlay ("NoScore");
}
Symbol 415 MovieClip Frame 41
_parent.player_name = _global.player_name;
Symbol 415 MovieClip Frame 43
stop();
Symbol 415 MovieClip Frame 48
stop();
Symbol 416 Button
on (release) {
getURL (("http://www.mygame.com/bounce.jsp?game=TheDominoKnight&from=" + gameUrl) + "&typ=protect&redirect=/game/thedominoknight", "_blank");
}
Symbol 422 Button
on (release) {
getURL (("http://www.mygame.com/bounce.jsp?game=TheDominoKnight&from=" + gameUrl) + "&typ=protect&redirect=/game/thedominoknight", "_blank");
}