Frame 1
function Loading() {
GlobalTime = getTimer();
_root.onEnterFrame = LoadGame;
}
function LoadGame() {
var _local2 = 5000;
loadline._visible = true;
Load = _root.getBytesLoaded();
Total = _root.getBytesTotal();
var _local4 = getTimer() - GlobalTime;
if (Load >= ((Total * _local4) / _local2)) {
Load = (Total * _local4) / _local2;
}
var _local3 = (100 * Load) / Total;
KB.text = ((TextLoading.text + " (") + Math.floor(_local3)) + "%)";
var _local5 = loadline.line._width;
loadline._xscale = _local3;
if (Total <= Load) {
delete _root.onEnterFrame;
_root.gotoAndStop(3);
}
}
stop();
stop();
Stage.scaleMode = "noScale";
Stage.showMenu = false;
this._lockroot = true;
loadline._visible = false;
if (!Path) {
Path = "";
}
var VersionPl = String($version).split(" ")[1].split(",")[0];
var LGXML = (new GameClasses.LoadGameXML(this, "ISpyLevel.xml", "level.xml", "text.xml", Loading));
Frame 3
function TextShow(Inside, Str, l, W, H, C, WT, HT, format, underline, SC, EC, ROT, BOL) {
function Attach(STR) {
if (att) {
Inside.TEXT.attachMovie(STR + l, U, Inside.TEXT.getNextHighestDepth());
} else {
Inside.TEXT.createEmptyMovieClip(U, Inside.TEXT.getNextHighestDepth());
AttachLetter(Inside.TEXT[U], STR);
}
var _local1 = Inside.TEXT[U];
_local1._x = X;
_local1._y = Y;
if (Inside.TEXT[U]._width != undefined) {
wid = Inside.TEXT[U]._width;
X = X + (wid + W);
Len++;
}
}
function AttachLetter(InS, Str) {
InS.createTextField("TEXT", InS.getNextHighestDepth(), 0, -10, 0, 0);
InS.TEXT.multiline = true;
InS.TEXT.embedFonts = (l == "GameFont") || (l == BOL);
InS.TEXT.autoSize = "left";
InS.TEXT.selectable = false;
var format = new TextFormat();
format.font = l;
format.size = WT;
format.bold = true;
format.color = HT;
format.align = "left";
format.leftMargin = 0;
format.rightMargin = 0;
InS.TEXT.text = Str;
InS.TEXT.setTextFormat(format);
if ((InS.TEXT._width < 5) || (l == "gradient")) {
format.font = BOL;
InS.TEXT.embedFonts = true;
InS.TEXT.text = Str;
InS.TEXT.setTextFormat(format);
}
if (l == "gradient") {
var Wi = InS.TEXT._width;
var He = InS.TEXT._height;
InS.createEmptyMovieClip("s", 100);
with (InS.s) {
colors = [SC, EC];
alphas = [100, 100];
ratios = [0, 255];
lineStyle(1, 0);
matrix = {matrixType:"box", x:0, y:0, w:Wi, h:He, r:(ROT / 180) * Math.PI};
beginGradientFill("linear", colors, alphas, ratios, matrix);
moveTo(0, 0);
lineTo(0, He);
lineTo(Wi, He);
lineTo(Wi, 0);
lineTo(0, 0);
endFill();
}
InS.s._y = InS.s._y - 10;
InS.s.setMask(InS.TEXT);
}
}
if (!Inside) {
return(undefined);
}
if ((l == undefined) || (l == "0")) {
l = "GameFont";
W = -2;
H = 12;
C = 1;
WT = 18;
HT = _root.FontWhite;
}
if ((H == 0) || (H == undefined)) {
H = 12;
}
if (!BOL) {
BOL = "GameFont";
} else if (l != "gradient") {
l = BOL;
}
if (l == "BOLDFONT") {
WT = WT - 5;
}
W = W - 0.5;
if ((format == undefined) || (format == 0)) {
format = 1000;
}
Letter = 0;
var Lines = 0;
var Len = 0;
Str = Str.split("'").join("'");
Str = Str.split(""").join("\"");
var X = 0;
var Y = 0;
var L = 0;
var wid = 0;
var mc = Inside.attachMovie(Str.substr(0, 1) + l, "AAA", Inside.getNextHighestDepth(), {_x:-1000});
var att = ((mc._name != undefined) || (l == "c"));
mc.removeMovieClip();
Inside.TEXT.removeMovieClip();
Inside.createEmptyMovieClip("TEXT", Inside.getNextHighestDepth());
Inside.TEXT.Arr = new Array(Str.length);
var i = 0;
while (i < Str.length) {
var j = Str.substr(i, 1);
if (j == "|") {
if (Len > Letter) {
Letter = Len;
}
Len = 0;
if (C == 1) {
X = X / 2;
var k = 0;
while (k < Str.length) {
Inside.TEXT[(("t" + k) + "y") + L]._x = Inside.TEXT[(("t" + k) + "y") + L]._x - X;
k++;
}
} else if (C == 2) {
var k = 0;
while (k < Str.length) {
Inside.TEXT[(("t" + k) + "y") + L]._x = Inside.TEXT[(("t" + k) + "y") + L]._x - X;
k++;
}
}
L++;
X = 0;
Y = Y + H;
} else {
var U = ((("t" + i) + "y") + L);
if (j == " ") {
if (Inside.TEXT.t0y0._width > 0) {
X = X + (((Inside.TEXT.t0y0._width * 3) / 4) + W);
Len++;
}
} else if (X > format) {
var k = (i - 1);
while (k >= 0) {
if (Inside.TEXT[(("t" + k) + "y") + L]) {
X = X - (Inside.TEXT[(("t" + k) + "y") + L]._width + W);
}
Inside.TEXT[(("t" + k) + "y") + L].removeMovieClip();
Inside.TEXT[(("t" + k) + "y") + L].removeTextField();
if (Str.substr(k, 1) == " ") {
X = X - (((Inside.TEXT.t0y0._width * 3) / 4) + W);
Str = (Str.substr(0, k) + "|") + Str.substr(k + 1, Str.length);
i = k - 1;
break;
}
k--;
}
if (k < 0) {
Str = (Str.substr(0, i) + "|") + Str.substr(i + 1, Str.length);
i++;
}
} else {
Attach(String(j));
}
}
Inside.TEXT.Arr[i] = U;
i++;
}
if (C == 1) {
X = X / 2;
var k = 0;
while (k < Str.length) {
Inside.TEXT[(("t" + k) + "y") + L]._x = Inside.TEXT[(("t" + k) + "y") + L]._x - X;
k++;
}
} else if (C == 2) {
var k = 0;
while (k < Str.length) {
Inside.TEXT[(("t" + k) + "y") + L]._x = Inside.TEXT[(("t" + k) + "y") + L]._x - X;
k++;
}
}
if (Len > Letter) {
Letter = Len;
}
if (underline != null) {
HT = underline;
if (l == "gradient") {
l = BOL;
}
for (var NNN in Inside.TEXT) {
var mc1 = Inside.TEXT[NNN];
var mc2 = mc1.duplicateMovieClip(mc1._name + "S", mc1.getDepth() - 5000);
mc2._x = mc1._x + 1;
mc2._y = mc1._y + 1;
if (att) {
var Ccc = new Color(mc2);
Ccc.setRGB(underline);
} else {
AttachLetter(mc2, mc1.TEXT.text);
}
}
}
return(L);
}
function ConvertText(hint) {
Lines = 0;
var _local4 = "";
var _local2 = 0;
var _local1 = 0;
while (_local1 < hint.length) {
var _local3 = hint.substr(_local1, 1);
if (_local3 == "|") {
if (_local2 > Letter) {
Letter = _local2;
}
_local2 = 0;
_local4 = _local4 + newline;
Lines++;
} else {
_local4 = _local4 + _local3;
_local2++;
}
_local1++;
}
if (_local2 > Letter) {
Letter = _local2;
}
return(_local4);
}
function InitSpy(N) {
_root.GameStatus = "spy";
GameClasses.GFunctions.ClearAll(_root, 1, 1);
if (N == undefined) {
N = 0;
}
var _local6 = _root.ISPY_Level[N];
var _local19 = _root.createEmptyMovieClip("SPY", 50);
_local19.attachMovie("spy_fon_" + N, "spy_fon_" + N, 0);
_local19.attachMovie("spy_border_" + N, "spy_border_" + N, 1);
Ramka = _local19.attachMovie("ramka_SPY", "ramka_SPY", 2);
Items = _local19.createEmptyMovieClip("Items", 20);
FLY = _local19.createEmptyMovieClip("FLY", 30);
_root.InitHintButton(Ramka.hint, GameClasses.GFunctions.create(this, ShowSPYHint), 30000);
FLY.attachMovie("button_uzk_s", "Menu", 9, {_x:36, _y:12});
FLY.Menu.InitFunction(_root.ShowMenu);
FLY.Menu.InitText(_root.TextMenu.text);
_root.TextShow(Ramka.hint.Text, _root.TextHint.text, undefined, W, H, C, WT, HT, 1000, 0);
var _local11 = _local6[0];
var _local10 = 1;
var _local20 = _root.GetBlack(Items, 0);
_local20.onPress = FailPressSPY;
_local20._height = 300;
var _local7 = 0;
while (_local7 < _local11.length) {
var _local3 = _local11[_local7];
var _local4 = Items.attachMovie(_local3.objectId, _local3.objectId, ((_local11.length - _local7) * 2) + 10);
_local4._x = int(_local3.x) * 0.65;
_local4._y = 390 - (int(_local3.y) * 0.65);
_local4._xscale = Number(_local3.xZoom) * 100;
_local4._yscale = Number(_local3.yZoom) * 100;
_local4._rotation = -Number(_local3.angle);
_local4._visible = _local3.visible == "true";
if (_local3.splitItemId) {
_local4.offsetx = _local3.offsetx;
_local4.offsety = _local3.offsety;
_local4.splitItemId = _local3.splitItemId;
_local4.onPress = GameClasses.GFunctions.create(this, FlyToPic, _local4);
if (Ramka[_local3.splitItemId] == undefined) {
var _local9 = Ramka["e" + _local10];
_local9.attachMovie("black", "BL", 99, {_x:-30, _y:-30, _width:60, _height:60, _alpha:0});
Ramka["e" + _local10]._name = _local3.splitItemId;
Ramka["ee" + _local10]._name = _local3.splitItemId + "1";
Ramka[_local3.splitItemId + "1"].count = 0;
_local9.BL.onRollOver = GameClasses.GFunctions.create(_root, _root.ItemOver, _local9, Ramka[_local3.splitItemId + "1"]);
_local10++;
var _local5 = 0;
while (_local5 < _local6[1].length) {
if (_local6[1][_local5].Name == _local3.splitItemId) {
Ramka[_local3.splitItemId].Act = _local6[1][_local5].Act;
Ramka[_local3.splitItemId].id = _local6[1][_local5].id;
break;
}
_local5++;
}
}
Ramka[_local3.splitItemId + "1"].count++;
TextShow(Ramka[_local3.splitItemId + "1"].text, String(Ramka[_local3.splitItemId + "1"].count), "Arial", 0, 0, 1, 16, 16777215);
var _local12 = Ramka[_local3.splitItemId];
var _local8 = _local12.attachMovie(_local3.objectId, _local3.objectId, _local7, {_x:int(_local3.offsetx) * 0.65, _y:(-int(_local3.offsety)) * 0.65});
_local8._x = _local8._x + (_local8._width / 2);
_local8._y = _local8._y - (_local8._height / 2);
} else if (_local3.type == "act") {
_local4.onRollOver = ActItemOver;
_local4.onRollOut = (_local4.onReleaseOutside = ActItemOut);
}
_local4.gotoAndStop(1);
_local4.useHandCursor = false;
_local4.tabEnabled = false;
_local7++;
}
Items.earth_black.onPress = null;
delete Items.lamp_2.onPress;
_root.Hint(28);
}
function ItemOver(MC, MC1) {
var _local2 = "";
_local2 = _local2 + (_root["TextSpy_" + MC._name].text + "|");
if (MC1) {
_local2 = _local2 + ((_root.TextSpyPieces.text + " ") + MC1.count);
} else {
_local2 = _local2 + _root.TextSpyReady.text;
}
_root.ToolTip(MC.BL, _local2);
}
function FailPressSPY() {
_root.FailSPY_s.start(_root.SoundOn);
}
function ShowSPYHint() {
var _local4 = _root.ISPY_Level[0][0];
var _local5 = null;
var _local3 = 0;
while (_local3 < _local4.length) {
var _local2 = _local4[_local3].objectId;
if (((_local4[_local3].splitItemId && (Items[_local2])) && (Items[_local2]._visible == true)) && (Items[_local2].onPress)) {
_local5 = Items[_local2];
break;
}
_local3++;
}
if (_local5) {
_root.SetHint((_local5._width * 2) / 3, (_local5._height * 2) / 3, _local5);
return(true);
}
if (Items.earth_chest._visible) {
_root.SetHint(Items.earth_chest._width / 2, Items.earth_chest._height / 2, Items.earth_chest, 0, 0, 60);
Hint(43);
return(true);
}
if (Items.earth_stones._visible) {
_root.SetHint(Items.earth_stones._width / 2, Items.earth_stones._height / 2, Items.earth_stones, 0, 0, 60);
Hint(44);
return(true);
}
if (Items.earth_bush._visible) {
_root.SetHint(30, 40, Items.earth_bush, 0, 0, 60);
Hint(45);
return(true);
}
}
function ActItemOver() {
if (!this.act) {
this.act = true;
this.gotoAndPlay(2);
ToolTip(this, _root["TextSpy_" + this._name].text, 1);
}
}
function ActItemOut() {
if (this.act) {
ToolTipOut();
this.act = false;
this.gotoAndStop(1);
}
}
function GetYOf(MC) {
if (MC._name == "eath_key") {
return(260);
}
return(Ramka[MC.splitItemId][MC._name]._y + Ramka[MC.splitItemId]._y);
}
function GetXOf(MC) {
if (MC._name == "eath_key") {
return(190);
}
return(Ramka[MC.splitItemId][MC._name]._x + Ramka[MC.splitItemId]._x);
}
function FlyToPic(MC) {
clearInterval(show_key_int);
if (MC._name == "lamp_1") {
Items.lamp_2.onPress = GameClasses.GFunctions.create(this, FlyToPic, Items.lamp_2);
}
_root.FromHint();
_root.SuccessSPY_s.start(_root.SoundOn);
delete MC.onPress;
MC.SHINE.removeMovieClip();
var _local5 = new Spline(MC._x, 220 + random(80), GetXOf(MC));
var _local4 = new Spline(MC._y, 130 + random(40), GetYOf(MC));
var _local6 = new Spline(MC._rotation, 50 + random(100), 0);
var _local7 = Items.createEmptyMovieClip("C" + getTimer(), Items.getNextHighestDepth());
InitShleif(_local7, 50, _local5, _local4, 2000, 0, 0);
clearInterval(_root["flying_to" + MC._name]);
_root["flying_to" + MC._name] = setInterval(Flying, 0, _local5, _local4, _local6, MC, MC._xscale, MC._yscale, getTimer());
}
function Flying(SPx, SPy, Rot, MC, SCx, SCy, T) {
var _local3 = (getTimer() - T) / 2000;
if (_local3 >= 1) {
_local3 = 1;
clearInterval(_root["flying_to" + MC._name]);
Ramka[MC.splitItemId][MC._name].removeMovieClip();
CheckAll(Ramka[MC.splitItemId], MC);
if (MC._name != "earth_key") {
MC.removeMovieClip();
}
}
MC._xscale = SCx + ((100 - SCx) * _local3);
MC._yscale = SCy + ((100 - SCy) * _local3);
MC._x = SPx.getPoint(_local3);
MC._y = SPy.getPoint(_local3);
MC._rotation = Rot.getPoint(_local3);
}
function CheckAll(MC, MC1) {
_root.Hint(31);
Ramka[MC._name + "1"].count--;
TextShow(Ramka[MC._name + "1"].text, String(Ramka[MC._name + "1"].count), "Arial", 0, 0, 1, 16, 16777215);
_root.ItemArriveSPY_s.start(_root.SoundOn);
if (MC1._name == "earth_key") {
_root.Hint(0);
return(260);
}
if (Ramka[MC._name + "1"].count <= 0) {
_root.Hint(11);
MC.attachMovie(MC._name, "D", 10);
MC.attachMovie(MC._name, "S", 5, {_alpha:50});
var _local3 = new Color(MC.S);
_local3.setRGB(0);
Ramka[MC._name + "1"].gotoAndStop(2);
MC.Is = false;
MC.dep = MC.getDepth();
MC.x = MC._x;
MC.y = MC._y;
MC.Timer2 = getTimer() + 100;
_root.SetHint(30, 30, MC, 0, 0);
MC.attachMovie("black", "BL", 99, {_x:-30, _y:-30, _width:60, _height:60, _alpha:0});
MC.onPress = GameClasses.GFunctions.create(this, Move, MC);
MC.onRollOver = function () {
ItemOver(MC);
this.D._y = -4;
this.D._x = -3;
this.S._y = 2;
this.S._x = 2;
};
MC.onRollOut = (MC.onReleaseOutside = function () {
ToolTipOut();
this.D._y = 0;
this.D._x = 0;
this.S._y = 0;
this.S._x = 0;
});
}
}
function Move(MC) {
ToolTipOut();
if (MC.Timer2 < getTimer()) {
MC.Timer2 = getTimer() + 100;
if (_root.Hint_Arr[20] != 1) {
_root.FromHint();
}
_root.Hint(20, GameClasses.GFunctions.create(_root, _root.SetHint, (Items.earth_dragon._width * 1) / 2, (Items.earth_dragon._height * 1) / 2, Items.earth_dragon));
MC.SHINE.removeMovieClip();
var _local4 = FLY.attachMovie(MC._name, MC._name, 99, {_x:MC._x, _y:MC._y});
_local4.id = MC.id;
_local4.Act = MC.Act;
_local4.MC = MC;
Move2(_local4);
MC._visible = false;
_local4.onMouseDown = GameClasses.GFunctions.create(this, Move2, _local4);
}
}
function Move2(MC) {
MC.MC.Timer2 = getTimer() + 100;
if (!MC.Is) {
_root.ClickBonus_s.start(_root.SoundOn);
MC.Is = true;
MC.xx = 0;
MC.yy = 0;
MC.onEnterFrame = Follow;
} else if (MC.Is && (Ramka.bl.hitTest(_root._xmouse, _root._ymouse))) {
_root.ClickBonus_s.start(_root.SoundOn);
MC.MC._visible = true;
MC.removeMovieClip();
} else if (MC.Is && (Items[MC.id].act)) {
_root.addChipInChain_s.start(_root.SoundOn);
Ramka[MC._name + "1"].gotoAndStop(3);
GameClasses.GFunctions.ClearAll(MC.MC, 1, 1, 1);
_root.TextShow(MC.MC, _root.TextSolved.text, "GameFont", -3, 0, 1, 20, 7820629, 1000, 16777215);
MC.MC._visible = true;
delete MC.MC.onPress;
delete Items[MC.id].onRollOver;
delete Items[MC.id].onRollOut;
delete Items[MC.id].onReleaseOutside;
delete Ramka[MC._name].onRollOver;
delete Ramka[MC._name].onRollOut;
delete Ramka[MC._name].onReleaseOutside;
Items[MC.id].gotoAndStop(1);
ACT(MC.Act);
MC.removeMovieClip();
}
}
function ACT(Act) {
ToolTipOut();
_root.FromHint();
_root.Hint(32);
var _local2 = 0;
while (_local2 < Act.length) {
Items[Act[_local2].objectId]._visible = Act[_local2].show == "true";
if (Act[_local2].objectId == "earth_bush_rise") {
Items[Act[_local2].objectId].gotoAndPlay(1);
_root.SetHint(20, 10, Items, Items.earth_key._x, Items.earth_key._y);
} else if (Act[_local2].objectId == "earth_key") {
show_key_int = setInterval(function () {
clearInterval(show_key_int);
_root.Hint(21);
_root.SetHint(20, 10, Items, Items.earth_key._x, Items.earth_key._y);
}, 20000);
}
_local2++;
}
}
function Follow() {
this._x = _root._xmouse - this.xx;
this._y = _root._ymouse - this.yy;
}
function RestartAll() {
}
function RestartAll1() {
GameClasses.GFunctions.ClearAll(_root, 1, 1);
_root.GameLevel++;
_root.InitBooks();
}
function InitDifArr() {
Diff_Ar = [[[116, 201], [120, 282], [0, 36], [164, 43]], [[52, 261], [160, 316], [65, 62], [168, 94]], [[44, 38], [182, 75], [178, 50], [0, 29]], [[179, 93], [39, 292], [184, 81], [16, 52]]];
}
function InitDiff(N) {
_root.GameStatus = "diff";
check_diff_click = getTimer();
GameClasses.GFunctions.ClearAll(_root, 1, 1);
if (N == undefined) {
N = 0;
}
TTTNNN = N;
TotDiff = 4;
Diff_int = new Array(4);
var _local11 = _root.createEmptyMovieClip("Diff", 50);
diff_cur = _local11.attachMovie("diff_cur", "diff_cur", 9);
diff_cur.onEnterFrame = DiffFollow;
var _local7 = _local11.attachMovie("diff_bg", "bg", 0);
var _local10 = _local7.c1.attachMovie("card" + N, "C1", 0);
var _local12 = _local7.c2.attachMovie("card" + N, "C2", 0);
_local7.Menu.onPress = _root.ShowMenu;
_root.TextShow(_local7.Menu.Text, _root.TextMenu.text, undefined, W, H, C, WT, HT, 1000, 0);
_root.TextShow(_local7.hint.Text, _root.TextHint.text, undefined, W, H, C, WT, HT, 1000, 0);
_root.InitHintButton(_local7.hint, GameClasses.GFunctions.create(this, ShowDiffHint, N), 30000);
_local10.gotoAndStop("m5");
_local12.gotoAndStop("m5");
InitDifArr();
_root.Hint(17);
var _local3 = 0;
while (_local3 < 4) {
var _local4 = _local10.attachMovie(("dif_" + N) + _local3, ("d" + N) + _local3, _local3 + 5);
_local4.tabEnabled = false;
_local4._x = Diff_Ar[N][_local3][0] * 0.65;
_local4._y = (228 - (Diff_Ar[N][_local3][1] * 0.65)) - _local4._height;
_local4.onMouseDown = GameClasses.GFunctions.create(this, ActDif, _local4);
var _local6 = _local7.attachMovie("checker", "ch" + _local3, _local3 + 10, {_x:260, _y:320 - (33 * _local3)});
_local6.gotoAndStop(1);
_local3++;
}
}
function ShowDiffHint(N) {
var _local3 = 0;
while (_local3 < 4) {
var _local2 = Diff.bg.c1.C1[("d" + N) + _local3];
if (_local2._visible) {
_root.SetHint((_local2._width * 2) / 3, (_local2._height * 2) / 3, Diff.bg.c2.C2, _local2._x + (_local2._width / 2), _local2._y + (_local2._height / 2));
_root.SetHint((_local2._width * 2) / 3, (_local2._height * 2) / 3, _local2, _local2._width / 2, _local2._height / 2);
return(true);
}
_local3++;
}
}
function ActDif(MC) {
if ((((!_root.menumain) && (!_root.Game_Hint)) && (MC.hitTest(_root._xmouse, _root._ymouse) || (MC.hitTest(diff_cur.cur)))) && ((check_diff_click + 500) < getTimer())) {
_root.GoodClickDiff_s.start(_root.SoundOn);
check_diff_click = getTimer();
MC._visible = false;
TotDiff--;
var _local3 = Diff.bg["ch" + TotDiff];
var _local13 = Diff.createEmptyMovieClip("M1" + getTimer(), Diff.getNextHighestDepth());
var _local12 = Diff.createEmptyMovieClip("M2" + getTimer(), Diff.getNextHighestDepth());
var _local7 = MC._x + (MC._width / 2);
var _local5 = MC._y + (MC._height / 2);
var _local6 = _local3._x + 5;
var _local4 = _local3._y + 5;
var _local11 = new Spline(Diff.bg.c1._x + _local7, 20 + random(20), _local6);
var _local9 = new Spline(Diff.bg.c2._x + _local7, 500 - random(20), _local6);
var _local10 = new Spline(Diff.bg.c1._y + _local5, 200 + random(40), _local4);
var _local8 = new Spline(Diff.bg.c2._y + _local5, 200 + random(40), _local4);
InitShleif(_local13, 60, _local11, _local10, 3000, 0, 1, 0, 1);
InitShleif(_local12, 60, _local9, _local8, 3000, 0, 1, 0, 1);
clearInterval(Diff_int[TotDiff]);
Diff_int[TotDiff] = setInterval(ChangeDiff, 3000, _local3, TotDiff);
delete MC.onMouseDown;
}
}
function ChangeDiff(MC, TF) {
clearInterval(Diff_int[TF]);
MC.gotoAndStop(2);
if (TF == 0) {
_root.LevelComplete_s.start(_root.SoundOn);
ShowLevelComplete();
_root.GameLevel++;
clearInterval(Diff_int[0]);
Diff_int[0] = setInterval(function () {
clearInterval(Diff_int[0]);
_root.InitBooks(1);
}, 8000);
}
}
function InitShleif(MC, N, SPx, SPy, T, sx, sy, type, id) {
if (!type) {
type = "shleif";
}
var _local2 = 0;
while (_local2 < N) {
var _local1 = MC.attachMovie(type, "S" + _local2, _local2, {_x:SPx.getPoint(0), _y:SPy.getPoint(0)});
if (id) {
_local1.id = _local2;
}
_local1._xscale = random(50) + 15;
_local1._yscale = _local1._xscale;
_local1.T = getTimer();
_local1.TT = T;
_local1.SPx = SPx;
_local1.SPy = SPy;
_local1.sx = int(sx);
_local1.sy = int(sy);
_local1.onEnterFrame = RotateShleif;
_local2++;
}
}
function RotateShleif() {
if (getTimer() >= (this.T + this.TT)) {
this.removeMovieClip();
} else if (this._xscale < 10) {
this._xscale = random(50) + 15;
this._yscale = this._xscale;
var _local2 = (getTimer() - this.T) / this.TT;
if (this.id < 20) {
this._x = ((this.SPx.getPoint(_local2) + random(4)) - 2) + this.sx;
this._y = ((this.SPy.getPoint(_local2) + random(4)) - 2) + this.sy;
} else {
this._x = ((this.SPx.getPoint(_local2) + random(20)) - 10) + this.sx;
this._y = ((this.SPy.getPoint(_local2) + random(20)) - 10) + this.sy;
}
} else {
if (this.id < 20) {
this._xscale = this._xscale - (random(100) / 5);
} else {
this._xscale = this._xscale - (random(20) / 5);
}
this._yscale = this._xscale;
this._rotation = this._rotation + 1;
}
}
function DiffFollow() {
if (_root._xmouse > 260) {
this._x = (_root._xmouse - 260) + 10;
} else {
this._x = (_root._xmouse + 260) - 17;
}
this._y = _root._ymouse;
if (!(this.hitTest(this._parent.bg.c1) || (this.hitTest(this._parent.bg.c2)))) {
this._x = -1000;
}
}
function InitArrSlide() {
var _local1 = 0;
while (_local1 < 20) {
Slides_Arr[_local1] = 0;
_local1++;
}
Slides_Arr[0] = (Slides_Arr[1] = 1);
}
function SetLevel() {
if (GameLevel >= MaxLevel.value) {
ShowNag(1);
return(undefined);
}
if (GameLevel == 0) {
InitSpy();
} else if (GameLevel == 5) {
InitDiff(0);
} else if (GameLevel == 10) {
InitDiff(1);
} else if (GameLevel == 15) {
InitDiff(2);
} else if (GameLevel == 20) {
InitDiff(3);
} else {
InitRound();
}
}
function InitBooks(c) {
stopAllSounds();
GameClasses.GFunctions.ClearAll(_root, 1, 1);
_root.attachMovie("Books", "Books", 9, {Open_Book:c});
}
function InitRound() {
Make__Chain = "";
GameClasses.GFunctions.ClearAll(_root, 1, 1);
maxsx = 6;
maxsy = 4;
Chain = new Array();
Matrix = CopyMatrix(LEVELS[Level].map);
Musor = LEVELS[Level].musor;
Bonuses = LEVELS[Level].bonus;
ChangeEnergyReceiver(0);
ChangeCheckPoint(0);
BeginEnergy = FindFirstE();
CurrentI = int(BeginEnergy.i);
CurrentJ = int(BeginEnergy.j);
LastDiameter = Diameter(CurrentI, CurrentJ, CheckPoint.y, CheckPoint.x);
_root.createEmptyMovieClip("game", 10);
_root.attachMovie("black", "GameMask", 20, {_width:520, _height:390});
_root.attachMovie("gamepanel", "gamepanel", 30);
_root.createEmptyMovieClip("recarr", 40);
TIMER = gamepanel.timer;
var RTime = (int(LEVELS[0].energy[0].time) * 1000);
TIMER.onLoad = function () {
this.SetTime(RTime);
};
gamepanel.map.onPress = ShowMap;
gamepanel.Menu.onPress = ShowMenu;
game.onEnterFrame = function () {
if ((this.LastT < getTimer()) || (!this.LastT)) {
this.LastT = getTimer() + 300;
MaskTiles();
}
};
_root.TextShow(gamepanel.map.Text, _root.TextMap.text, undefined, W, H, C, WT, HT, 1000, 0);
_root.TextShow(gamepanel.sc_n, _root.TextScore.text, "GameFont", -2, 0, 2, 16, 0, 1000, 13421772);
_root.TextShow(gamepanel.level, GetLevelString(), "GameFont", -2, 13, 1, 16, 0, 1000, 13421772);
SCORE = new GameClasses.Score(gamepanel.score, int(TotalScore));
gamepanel.Menu.onLoad = function () {
this.InitText(_root.TextMenu.text);
};
game._x = (((-Matrix[0].length) * FonSize) + 520) / 2;
game._y = (((-Matrix.length) * FonSize) + 350) / 2;
recarr._x = 260;
recarr._y = 175;
recarr.attachMovie("recarr", "a", 0, {_x:1000});
recarr.a.PA = 0;
recarr._visible = false;
game.setMask(GameMask);
if (Level == 14) {
MoveField(getTimer(), 300, 0, 0);
} else {
MoveField(getTimer(), 0, 0, 0);
}
maxsx = 5;
maxsy = 3;
score = (Tiles_score = (Chain_score = 0));
DrawField();
DrawFon();
GameStatus = "play1";
if (Level < 8) {
gamepanel.b2._visible = false;
}
if (Level < 4) {
gamepanel.b1._visible = false;
}
start_s.start(SoundOn);
EnergyMove_s.startE();
}
function CanStart() {
GameStatus = "play";
if (Level == 0) {
Hint(5);
} else if (Level == 1) {
Hint(6);
} else if (Level == 2) {
Hint(13);
} else if (Level == 3) {
Hint(12);
} else if (Level == 4) {
Hint(9);
} else if (Level == 5) {
Hint(4);
} else if (Level == 6) {
Hint(15);
} else if (Level == 7) {
Hint(14);
} else if (Level == 8) {
Hint(10);
} else if (Level == 9) {
Hint(3);
}
}
function GetLevelString(C) {
var _local2 = "|";
if (C) {
_local2 = ". ";
}
return(((((TextEarth.text + ": ") + _root["TextLevel" + Math.floor(Level / 4)].text) + _local2) + TextLevel.text) + int(Level + 1));
}
function MaskTiles() {
var _local3 = int((CurrentI - SizeI) - 6);
while (_local3 <= int((CurrentI + SizeI) + 6)) {
var _local2 = int((CurrentJ - SizeJ) - 6);
while (_local2 <= int((CurrentJ + SizeJ) + 6)) {
var _local1 = game[FindName(_local3, _local2)];
if (_local1 && (!((((_local1.hitTest(GameMask) || (_local3 >= int(((CurrentI - SizeI) - 1) + LastCurrentI))) || (_local3 <= int((CurrentI + SizeI) + LastCurrentI))) || (_local2 >= int(((CurrentJ - SizeJ) - 1) + LastCurrentJ))) || (_local2 <= int((CurrentJ + SizeJ) + LastCurrentJ))))) {
_local1.Hide();
} else if (_local1 && (!_local1.active)) {
_local1.Show();
}
_local2++;
}
_local3++;
}
}
function MoveArrow(c) {
recarr._visible = true;
var _local1 = Math.atan2(CheckPoint.y - CurrentI, CheckPoint.x - CurrentJ);
if (_local1 < 0) {
_local1 = _local1 + (Math.PI*2);
}
recarr.a.A = _local1;
if (c) {
recarr.a.PA = _local1;
} else if (Math.abs(Math.sin(recarr.a.PA) - Math.sin(recarr.a.A)) < 0.2) {
recarr.a.PA = recarr.a.A;
}
recarr.a.onEnterFrame = MoveArrow2;
}
function MoveArrow2() {
if (Math.abs(recarr.a.A - recarr.a.PA) < 0.03) {
recarr.a.PA = recarr.a.A;
delete recarr.a.onEnterFrame;
} else if (recarr.a.A > recarr.a.PA) {
recarr.a.PA = recarr.a.PA + 0.03;
} else {
recarr.a.PA = recarr.a.PA - 0.03;
}
var _local1 = recarr.a.PA;
recarr.a.PA = _local1;
var _local4 = 1;
var _local3 = Math.cos(_local1) * _local4;
var _local2 = Math.sin(_local1) * _local4;
var _local5 = 0.6;
if (Math.abs(Math.tan(_local1)) < _local5) {
_local2 = (_local2 * 220) / Math.abs(_local3);
_local3 = (_local3 / Math.abs(_local3)) * 220;
} else {
_local3 = (_local3 * 135) / Math.abs(_local2);
_local2 = (_local2 / Math.abs(_local2)) * 135;
}
_local1 = (57.2957795130823 * _local1) + 90;
recarr.a._rotation = _local1;
recarr.a._x = _local3;
recarr.a._y = _local2;
}
function FindFirstE() {
var _local1 = 0;
var _local3 = 0;
while (_local3 < Matrix.length) {
var _local2 = 0;
while (_local2 < Matrix[0].length) {
if (Matrix[_local3][_local2] == "e") {
if (Math.abs(CheckPoint.x - _local2) > Math.abs(CheckPoint.y - _local3)) {
if (CheckPoint.x > _local2) {
_local1 = 0;
} else {
_local1 = 180;
}
} else if (CheckPoint.y > _local3) {
_local1 = 90;
} else {
_local1 = -90;
}
return({i:_local3, j:_local2, R:_local1});
}
_local2++;
}
_local3++;
}
}
function ChangeCheckPoint(N) {
if ((LEVELS[Level].checkpoints.length == 0) && (N == 0)) {
CheckPointN = N;
CheckPoint = {};
CheckPoint.y = int(EnergyReceiver.y - (EnergyReceiver.height / 2));
CheckPoint.x = int(EnergyReceiver.x + (EnergyReceiver.width / 2));
CheckPoint.r = 3;
MoveArrow();
}
if (LEVELS[Level].checkpoints.length > N) {
CheckPointN = N;
CheckPoint = LEVELS[Level].checkpoints[CheckPointN];
LastDiameter = Diameter(CurrentI, CurrentJ, CheckPoint.y, CheckPoint.x);
MoveArrow();
} else {
recarr._visible = false;
LastDiameter = 0;
}
}
function ChangeEnergyReceiver(N) {
EnergyReceiverN = N;
EnergyReceiver = LEVELS[Level].energy[EnergyReceiverN];
}
function GetDepth(i, j) {
return(((i * Matrix[0].length) + j) + 10000);
}
function InitFon(i, j, cc) {
if ((Matrix[i][j] != ".") && (Matrix[i][j] != undefined)) {
var _local3 = int(Matrix[i][j]);
if (cc) {
game.fon[FindName(i, j)].gotoAndStop(Matrix[i][j] + 1);
}
game.border[FindName(i, j) + "u"].removeMovieClip();
game.border[FindName(i, j) + "d"].removeMovieClip();
game.border[FindName(i, j) + "l"].removeMovieClip();
game.border[FindName(i, j) + "r"].removeMovieClip();
if (((_local3 > int(Matrix[i + 1][j])) || (Matrix[i + 1][j] == ".")) || (Matrix[i + 1][j] == undefined)) {
game.border[FindName(i, j) + "d"].removeMovieClip();
game.border.attachMovie("dborder", FindName(i, j) + "d", game.border.getNextHighestDepth(), {_x:(FonSize * j) + SX, _y:(FonSize * i) + SY});
} else if (_local3 < int(Matrix[i + 1][j])) {
game.border[FindName(i + 1, j) + "u"].removeMovieClip();
game.border.attachMovie("uborder", FindName(i + 1, j) + "u", game.border.getNextHighestDepth(), {_x:(FonSize * j) + SX, _y:(FonSize * (i + 1)) + SY});
}
if (((_local3 > int(Matrix[i - 1][j])) || (Matrix[i - 1][j] == ".")) || (Matrix[i - 1][j] == undefined)) {
game.border[FindName(i, j) + "u"].removeMovieClip();
game.border.attachMovie("uborder", FindName(i, j) + "u", game.border.getNextHighestDepth(), {_x:(FonSize * j) + SX, _y:(FonSize * i) + SY});
} else if (_local3 < int(Matrix[i - 1][j])) {
game.border[FindName(i - 1, j) + "d"].removeMovieClip();
game.border.attachMovie("dborder", FindName(i - 1, j) + "d", game.border.getNextHighestDepth(), {_x:(FonSize * j) + SX, _y:(FonSize * (i - 1)) + SY});
}
if (((_local3 > int(Matrix[i][j + 1])) || (Matrix[i][j + 1] == ".")) || (Matrix[i][j + 1] == undefined)) {
game.border[FindName(i, j) + "r"].removeMovieClip();
game.border.attachMovie("rborder", FindName(i, j) + "r", game.border.getNextHighestDepth(), {_x:(FonSize * j) + SX, _y:(FonSize * i) + SY});
} else if (_local3 < int(Matrix[i][j + 1])) {
game.border[FindName(i, j + 1) + "l"].removeMovieClip();
game.border.attachMovie("lborder", FindName(i, j + 1) + "l", game.border.getNextHighestDepth(), {_x:(FonSize * (j + 1)) + SX, _y:(FonSize * i) + SY});
}
if (((_local3 > int(Matrix[i][j - 1])) || (Matrix[i][j - 1] == ".")) || (Matrix[i][j - 1] == undefined)) {
game.border[FindName(i, j) + "l"].removeMovieClip();
game.border.attachMovie("lborder", FindName(i, j) + "l", game.border.getNextHighestDepth(), {_x:(FonSize * j) + SX, _y:(FonSize * i) + SY});
} else if (_local3 < int(Matrix[i][j - 1])) {
game.border[FindName(i, j - 1) + "r"].removeMovieClip();
game.border.attachMovie("rborder", FindName(i, j - 1) + "r", game.border.getNextHighestDepth(), {_x:(FonSize * (j - 1)) + SX, _y:(FonSize * i) + SY});
}
}
}
function DrawFon() {
var _local5 = game.fon.createEmptyMovieClip("fon", 1);
_local5._x = (_local5._y = FonSize / 2);
var _local4 = 0;
while (_local4 < Matrix.length) {
var _local3 = 0;
while (_local3 < Matrix[0].length) {
if (Matrix[_local4][_local3] == ".") {
if ((Matrix[_local4][_local3 + 1] != ".") && (Matrix[_local4][_local3 + 1] != undefined)) {
_local5.attachMovie("borderline" + elementn, "T", _local5.getNextHighestDepth(), {_x:_local3 * FonSize, _y:_local4 * FonSize, _rotation:270});
}
if ((Matrix[_local4][_local3 - 1] != ".") && (Matrix[_local4][_local3 - 1] != undefined)) {
_local5.attachMovie("borderline" + elementn, "T", _local5.getNextHighestDepth(), {_x:_local3 * FonSize, _y:_local4 * FonSize, _rotation:90});
}
if ((Matrix[_local4 + 1][_local3] != ".") && (Matrix[_local4 + 1][_local3] != undefined)) {
_local5.attachMovie("borderline" + elementn, "T", _local5.getNextHighestDepth(), {_x:_local3 * FonSize, _y:_local4 * FonSize, _rotation:0});
if ((Matrix[_local4][_local3 + 1] != ".") && (Matrix[_local4][_local3 + 1] != undefined)) {
_local5.attachMovie("bordercornerinside" + elementn, "T", _local5.getNextHighestDepth(), {_x:_local3 * FonSize, _y:_local4 * FonSize, _rotation:90});
}
if ((Matrix[_local4][_local3 - 1] != ".") && (Matrix[_local4][_local3 - 1] != undefined)) {
_local5.attachMovie("bordercornerinside" + elementn, "T", _local5.getNextHighestDepth(), {_x:_local3 * FonSize, _y:_local4 * FonSize, _rotation:180});
}
}
if ((Matrix[_local4 - 1][_local3] != ".") && (Matrix[_local4 - 1][_local3] != undefined)) {
_local5.attachMovie("borderline" + elementn, "T", _local5.getNextHighestDepth(), {_x:_local3 * FonSize, _y:_local4 * FonSize, _rotation:180});
if ((Matrix[_local4][_local3 - 1] != ".") && (Matrix[_local4][_local3 - 1] != undefined)) {
_local5.attachMovie("bordercornerinside" + elementn, "T", _local5.getNextHighestDepth(), {_x:_local3 * FonSize, _y:_local4 * FonSize, _rotation:-90});
}
if ((Matrix[_local4][_local3 + 1] != ".") && (Matrix[_local4][_local3 + 1] != undefined)) {
_local5.attachMovie("bordercornerinside" + elementn, "T", _local5.getNextHighestDepth(), {_x:_local3 * FonSize, _y:_local4 * FonSize, _rotation:0});
}
}
if ((((Matrix[_local4 - 1][_local3 - 1] != ".") && (Matrix[_local4 - 1][_local3 - 1] != undefined)) && (Matrix[_local4][_local3 - 1] == ".")) && (Matrix[_local4 - 1][_local3] == ".")) {
_local5.attachMovie("bordercorner" + elementn, "T", _local5.getNextHighestDepth(), {_x:_local3 * FonSize, _y:_local4 * FonSize, _rotation:90});
}
if ((((Matrix[_local4 - 1][_local3 + 1] != ".") && (Matrix[_local4 - 1][_local3 + 1] != undefined)) && (Matrix[_local4 - 1][_local3] == ".")) && (Matrix[_local4][_local3 + 1] == ".")) {
_local5.attachMovie("bordercorner" + elementn, "T", _local5.getNextHighestDepth(), {_x:_local3 * FonSize, _y:_local4 * FonSize, _rotation:180});
}
if ((((Matrix[_local4 + 1][_local3 + 1] != ".") && (Matrix[_local4 + 1][_local3 + 1] != undefined)) && (Matrix[_local4][_local3 + 1] == ".")) && (Matrix[_local4 + 1][_local3] == ".")) {
_local5.attachMovie("bordercorner" + elementn, "T", _local5.getNextHighestDepth(), {_x:_local3 * FonSize, _y:_local4 * FonSize, _rotation:-90});
}
if ((((Matrix[_local4 + 1][_local3 - 1] != ".") && (Matrix[_local4 + 1][_local3 - 1] != undefined)) && (Matrix[_local4][_local3 - 1] == ".")) && (Matrix[_local4 + 1][_local3] == ".")) {
_local5.attachMovie("bordercorner" + elementn, "T", _local5.getNextHighestDepth(), {_x:_local3 * FonSize, _y:_local4 * FonSize, _rotation:0});
}
}
_local3++;
}
_local4++;
}
_local5 = game.fon.createEmptyMovieClip("fond", 0);
var _local7 = game.eff.createEmptyMovieClip("fond", 0);
_local5._x = (_local5._y = (_local7._x = (_local7._y = -50)));
var _local3 = 0;
_local4 = _local3;
MaxI = (Matrix.length * FonSize) + 100;
MaxJ = (Matrix[0].length * FonSize) + 100;
while (_local4 <= MaxI) {
_local5.attachMovie("underfon" + elementn, "F", _local5.getNextHighestDepth(), {_x:_local3, _y:_local4});
_local7.attachMovie("underfon" + elementn, "F", _local7.getNextHighestDepth(), {_x:_local3, _y:_local4});
_local3 = _local3 + 256;
if (_local3 >= MaxJ) {
_local4 = _local4 + 256;
_local3 = 0;
}
}
_local7.onPress = null;
_local7.useHandCursor = false;
var _local10 = _root.createEmptyMovieClip("CENT", _root.getNextHighestDepth());
_local10._x = 260;
_local10._y = 150;
TextShow(_local10, GetLevelString(), "gradient", -2, 40, 1, 40, 0, 1000, 0, 16776960, 13421568, 90);
_local10._alpha = 0;
_local10.onEnterFrame = function () {
if (!this.VV) {
if (this._alpha < 300) {
this._alpha = this._alpha + 5;
} else {
this.VV = true;
}
} else {
this._xscale = this._xscale + 5;
this._alpha = this._alpha - 15;
if (this._alpha <= 0) {
this.removeMovieClip();
}
}
};
_local7.onEnterFrame = function () {
if (this._alpha < 5) {
delete this.onEnterFrame;
this.removeMovieClip();
CanStart();
}
this._alpha = this._alpha - 0.5;
};
}
function DrawField() {
game.createEmptyMovieClip("fon", 0);
game.createEmptyMovieClip("border", 20);
game.createEmptyMovieClip("en", 10);
game.createEmptyMovieClip("eff", 99999);
var _local13 = 0;
i = 0;
while (i < LEVELS[Level].energy.length) {
var _local8 = LEVELS[Level].energy[i];
game.eff.attachMovie("receiver1", "r" + i, i + 50, {_x:_local8.x * FonSize, _y:((_local8.y - _local8.height) + 1) * FonSize});
var _local11 = 0;
while (_local11 < _local8.height) {
var _local9 = 0;
while (_local9 < _local8.height) {
Matrix[_local8.y - _local11][_local8.x + _local9] = "r";
_local9++;
}
_local11++;
}
i++;
}
var i = 0;
while (i < Matrix.length) {
var _local12 = 0;
while (_local12 < Matrix[0].length) {
if (Matrix[i][_local12] != ".") {
var _local3 = "";
var _local10;
var _local5 = false;
var _local7 = false;
var _local6 = false;
if (Matrix[i][_local12] == "m") {
_local5 = false;
_local7 = true;
_local6 = false;
Matrix[i][_local12] = 1;
_local3 = "rock";
} else if (Matrix[i][_local12] == "+") {
_local5 = false;
_local7 = true;
_local6 = false;
Matrix[i][_local12] = 0;
_local3 = "rock";
} else if (Matrix[i][_local12] == "n") {
_local5 = true;
_local7 = true;
_local6 = false;
Matrix[i][_local12] = 1;
_local3 = "rock";
} else if (Matrix[i][_local12] == "S") {
_local5 = true;
_local7 = false;
_local6 = true;
Matrix[i][_local12] = 1;
_local3 = "stone";
} else if (Matrix[i][_local12] == "4") {
_local5 = true;
_local7 = false;
_local6 = false;
Matrix[i][_local12] = 0;
} else if (Matrix[i][_local12] == "5") {
_local5 = true;
_local7 = false;
_local6 = false;
Matrix[i][_local12] = 1;
} else if (Matrix[i][_local12] == "6") {
_local5 = true;
_local7 = false;
_local6 = false;
Matrix[i][_local12] = 2;
} else if (Matrix[i][_local12] == "7") {
_local5 = true;
_local7 = false;
_local6 = false;
Matrix[i][_local12] = 3;
} else if (((Matrix[i][_local12] == "V") || (Matrix[i][_local12] == "U")) || (Matrix[i][_local12] == "D")) {
_local3 = "bonus";
_local10 = [1, 0, 0, Bonuses[_local13++], Matrix[i][_local12]];
Matrix[i][_local12] = 0;
} else if (((Matrix[i][_local12] == "H") || (Matrix[i][_local12] == "R")) || (Matrix[i][_local12] == "L")) {
_local3 = "bonus";
_local10 = [0, 1, 0, Bonuses[_local13++], Matrix[i][_local12]];
Matrix[i][_local12] = 0;
} else if (Matrix[i][_local12] == "B") {
_local3 = "bonus";
_local10 = [1, 1, 1, Bonuses[_local13++], Matrix[i][_local12]];
Matrix[i][_local12] = 0;
} else if (Matrix[i][_local12] == "C") {
_local3 = "bonus";
_local10 = [1, 1, 0, Bonuses[_local13++], Matrix[i][_local12]];
Matrix[i][_local12] = 0;
} else if (Matrix[i][_local12] == "r") {
_local3 = "receiverfon1";
}
var _local14 = GetDepth(i, _local12);
var _local4 = game.fon.attachMovie("fon" + elementn, FindName(i, _local12), _local14, {_x:(FonSize * _local12) + SX, _y:(FonSize * i) + SY, _alpha:50});
if (_local3 == "") {
if (((Level == 0) && (i == 5)) && (((_local12 == 4) || (_local12 == 5)) || (_local12 == 6))) {
_local3 = "s1";
} else {
_local3 = GetRandomSlide(1);
if ((((Level == 0) && ((i == 4) || (i == 6))) && (((_local12 == 4) || (_local12 == 5)) || (_local12 == 6))) && (_local3 == "s1")) {
_local3 = "s2";
}
if ((((Level == 0) && (i == 5)) && ((_local12 == 3) || (_local12 == 7))) && (_local3 == "s1")) {
_local3 = "s3";
}
}
}
_local4.gotoAndStop(Number(Matrix[i][_local12]) + 1);
if (((Level == 4) && (i == 5)) && (_local12 == 18)) {
_local4.onEnterFrame = function () {
if (this._currentframe == 1) {
delete this.onEnterFrame;
}
if (this.hitTest(GameMask) && (!this.TI)) {
this.TI = TIMER.GetTime() + 30;
}
if (TIMER.GetTime() > this.TI) {
Hint(47);
delete this.onEnterFrame;
}
};
}
_local4 = game.attachMovie(_local3, FindName(i, _local12), _local14, {_x:((FonSize * _local12) + ((FonSize - Size) / 2)) + SX, _y:((FonSize * i) + ((FonSize - Size) / 2)) + SY, _alpha:MaxAlpha});
if ((Level == 0) && (_local3 == "receiverfon1")) {
_local4.onEnterFrame = function () {
if (TIMER.GetTime() > 30) {
TOOL_TIP2(_root.Text1Level.text, _root.Text1Level.x, _root.Text1Level.y);
delete this.onEnterFrame;
}
};
}
if ((_local3 != "bonus") && (_local3 != "receiverfon1")) {
_local4.InitSlide(_local3, _local7, _local5, _local6);
} else {
_local4.swapDepths(_local4.getDepth() + 10000);
_local4.bonus = true;
_local4.InitSlide(_local10);
_local4._x = _local4._x + (Size / 2);
_local4._y = _local4._y + (Size / 2);
}
if (Matrix[i][_local12] == "e") {
game.en.attachMovie("en1", FindName(i, _local12), GetDepth(i, _local12), {_x:(SX + (_local12 * FonSize)) + (FonSize / 2), _y:(SY + (i * FonSize)) + (FonSize / 2), _xscale:(FonSize / Size) * 100, _yscale:(FonSize / Size) * 100, _alpha:50});
}
}
_local12++;
}
i++;
}
var i = 0;
while (i < Matrix.length) {
var _local12 = 0;
while (_local12 < Matrix[0].length) {
InitFon(i, _local12);
_local12++;
}
i++;
}
}
function GetRandomSlide(c, j) {
var _local1 = random(4) + 1;
return("s" + _local1);
}
function MoveField(T, TT, StepI, StepJ) {
if (((Level == 4) && (game.fon[FindName(5, 18)]._currentframe > 1)) && (game._x < -200)) {
return(undefined);
}
if (((Level == 9) && (game[FindName(7, 39)].bonus)) && (game._x < -1000)) {
return(undefined);
}
if ((((Level == 12) && (game[FindName(6, 27)].bonus)) && (game._x < -600)) && (CheckPointN > 2)) {
return(undefined);
}
var _local9 = CurrentI;
var _local4 = Math.max(3, CurrentI + StepI);
var _local8 = CurrentJ;
var _local3 = CurrentJ + StepJ;
var _local2 = CheckPoint.y - _local4;
var _local1 = CheckPoint.x - _local3;
var _local7 = Math.max(Math.abs(_local2), Math.abs(_local1));
_local2 = int((maxsy * _local2) / _local7);
_local1 = int((maxsx * _local1) / _local7);
iss = ((LastCurrentI == undefined) ? (_local2) : (LastCurrentI));
jss = ((LastCurrentJ == undefined) ? (_local1) : (LastCurrentJ));
var _local5 = 165 - ((_local4 + _local2) * FonSize);
if (_local5 > 0) {
_local5 = -1;
}
var _local6 = 260 - ((_local3 + _local1) * FonSize);
if (_local6 > 0) {
_local6 = -1;
}
clearInterval(moving_field);
moving_field = setInterval(MovingField, 0, T, TT, _local9, _local4, _local8, _local3, iss, jss, _local2, _local1, game._y, game._x, _local5, _local6);
}
function MovingField(T, TT, i1, i2, j1, j2, iss, jss, is, js, fgy, fgx, lgy, lgx) {
var _local3 = getTimer();
var _local2 = 1;
if (_local3 >= (T + TT)) {
clearInterval(moving_field);
} else {
_local2 = (_local3 - T) / TT;
}
var _local1 = fgy + ((lgy - fgy) * _local2);
if ((_local1 <= 0) && (_local1 > (((-Matrix.length) + 11) * FonSize))) {
if (_local1 != game._y) {
CurrentI = i1 + ((i2 - i1) * _local2);
LastCurrentI = iss + ((is - iss) * _local2);
game._y = _local1;
}
}
if (Matrix.length < 13) {
game._y = (((-Matrix.length) * FonSize) + 350) / 2;
LastCurrentI = 0;
CurrentI = Matrix.length / 2;
}
_local1 = fgx + ((lgx - fgx) * _local2);
if ((_local1 <= 0) && (_local1 > (((-Matrix[0].length) + 16) * FonSize))) {
if (_local1 != game._x) {
game._x = _local1;
CurrentJ = j1 + ((j2 - j1) * _local2);
LastCurrentJ = jss + ((js - jss) * _local2);
}
}
if (Matrix[0].length < 18) {
game._x = (((-Matrix[0].length) * FonSize) + 520) / 2;
LastCurrentJ = 0;
CurrentJ = Matrix[0].length / 2;
}
CheckCheckPoint(CurrentI, CurrentJ);
MoveArrow(TT == 0);
if (TT == 0) {
MaskTiles();
}
if ((((LEVELS[Level].checkpoints.length - 1) <= CheckPointN) && (Math.abs((EnergyReceiver.x - CurrentJ) - LastCurrentJ) < SizeJ)) && (Math.abs((EnergyReceiver.y - CurrentI) - LastCurrentI) < SizeI)) {
recarr._visible = false;
}
updateAfterEvent();
}
function CheckCheckPoint(i, j) {
if (Diameter(i, j, CheckPoint.y, CheckPoint.x) <= int(CheckPoint.r)) {
ChangeCheckPoint(CheckPointN + 1);
}
}
function Press(chk) {
if (chk != undefined) {
this=chk;//parameter overwritten
}
_root.mouse_move.removeMovieClip();
var _local3 = 0;
while (_local3 < Hint_Light.length) {
Hint_Light[_local3].removeMovieClip();
_local3++;
}
delete Hint_Light;
TIMER.StartTimer();
if ((GameStatus == "play") && (!(this.isRock || (this.isStone)))) {
var _local5 = Chain[Chain.length - 1];
if ((_local5 == this._name) && (Make__Chain == "")) {
Chain.push(this._name);
FillFon();
} else if (((_local5 == this._name) && (Make__Chain == "hit")) && (Chain.length <= 1)) {
Make__Chain = "";
} else if ((_local5 == this._name) && (Make__Chain == "hit")) {
Make__Chain = "";
ReleaseTile();
} else if (((Chain.length > 0) && (Chain[Chain.length - 2] == this._name)) && (Make__Chain == "hit")) {
ClearFon();
Chain.pop();
FillFon();
} else if ((Chain.length > 0) && (Make__Chain == "hit")) {
var _local4 = true;
_local3 = 0;
while (_local3 < Chain.length) {
if (this._name == Chain[_local3]) {
_local4 = false;
break;
}
_local3++;
}
if (_local4) {
var _local9 = FindI(_local5);
var _local7 = FindJ(_local5);
var _local8 = FindI(this._name);
var _local6 = FindJ(this._name);
ClearFon();
if ((this.Name == game[_local5].Name) && (((Math.abs(_local9 - _local8) == 1) && ((_local7 - _local6) == 0)) || (((_local9 - _local8) == 0) && (Math.abs(_local7 - _local6) == 1)))) {
Chain.push(this._name);
} else {
Make__Chain = "";
Chain = new Array();
Chain.push(this._name);
}
FillFon();
}
} else if (Chain.length == 0) {
ClearFon();
MakeChain = true;
Chain = new Array();
Chain.push(this._name);
FillFon();
}
} else if ((GameStatus.substr(0, 8) == "actbonus") && ((GameStatus.substr(8, 1) != 1) || ((!this.isStone) && (!this.isIce)))) {
gamepanel["b" + GameStatus.substr(8, 1)].Act(this);
} else if ((GameStatus.substr(0, 9) == "actbonus1") && (((Matrix[FindI(this._name)][FindJ(this._name)] == 0) || (this.isStone)) || (this.isIce))) {
_root.Hint(38);
}
}
function NearName(Name1, Name2) {
var _local2 = FindI(Name1);
var _local1 = FindJ(Name1);
var _local5 = FindI(Name2);
var _local4 = FindJ(Name2);
var _local3 = false;
if (((!_local3) && (game[FindName(_local2, _local1)].Name == game[Name2].Name)) && ((Math.abs(_local2 - _local5) + Math.abs(_local1 - _local4)) < 2)) {
_local3 = true;
NearTile = game[FindName(_local2, _local1)];
}
if (((!_local3) && (game[FindName(_local2 - 1, _local1)].Name == game[Name2].Name)) && ((Math.abs((_local2 - 1) - _local5) + Math.abs(_local1 - _local4)) < 2)) {
_local3 = true;
NearTile = game[FindName(_local2 - 1, _local1)];
}
if (((!_local3) && (game[FindName(_local2 + 1, _local1)].Name == game[Name2].Name)) && ((Math.abs((_local2 + 1) - _local5) + Math.abs(_local1 - _local4)) < 2)) {
_local3 = true;
NearTile = game[FindName(_local2 + 1, _local1)];
}
if (((!_local3) && (game[FindName(_local2, _local1 - 1)].Name == game[Name2].Name)) && ((Math.abs(_local2 - _local5) + Math.abs((_local1 - 1) - _local4)) < 2)) {
_local3 = true;
NearTile = game[FindName(_local2, _local1 - 1)];
}
if (((!_local3) && (game[FindName(_local2, _local1 + 1)].Name == game[Name2].Name)) && ((Math.abs(_local2 - _local5) + Math.abs((_local1 + 1) - _local4)) < 2)) {
_local3 = true;
NearTile = game[FindName(_local2, _local1 + 1)];
}
if (!_local3) {
NearTile = game[FindName(_local2, _local1)];
}
return(_local3);
}
function Over(chk) {
if ((((((Make__Chain == "") && (GameMask.hitTest(_xmouse, _ymouse))) && (this.hitTest(_xmouse, _ymouse))) && (this._name != Chain[Chain.length - 1])) && (MakeChain)) && (NearName(this._name, Chain[Chain.length - 1]) || (cheat))) {
var _local4;
if (!cheat) {
_local4 = NearTile;
} else {
_local4 = this;
}
if ((_local4._name != Chain[Chain.length - 1]) && ((_local4._name != Chain[Chain.length - 2]) || (_local4.wasover < (getTimer() - 400)))) {
_local4.wasover = getTimer();
var _local3 = 0;
while (_local3 < Chain.length) {
if (_local4._name == Chain[_local3]) {
var _local2 = _local3 + 1;
while (_local2 < Chain.length) {
ClearChainFon(_local2);
_local2++;
}
Chain = Chain.slice(0, _local3);
break;
}
_local3++;
}
var _local8 = FindI(Chain[Chain.length - 1]);
var _local6 = FindJ(Chain[Chain.length - 1]);
var _local7 = FindI(_local4._name);
var _local5 = FindJ(_local4._name);
if ((Chain.length == 0) || ((Math.abs(_local8 - _local7) + Math.abs(_local6 - _local5)) < 2)) {
Chain.push(_local4._name);
}
FillFon();
}
}
}
function FindI(Name) {
var _local4;
var _local1 = Name.indexOf("Y");
var _local3 = (Name.indexOf("X") - _local1) - 1;
_local4 = Number(Name.substr(_local1 + 1, _local3));
return(_local4);
}
function FindJ(Name) {
var _local2;
var _local1 = Name.indexOf("X");
_local2 = Number(Name.substr(_local1 + 1, 2));
return(_local2);
}
function FillFon() {
var _local2 = Math.max(Chain.length - 2, 0);
while (_local2 < Chain.length) {
ClearBombing(_local2);
_local2++;
}
_root.addChipInChain_s.start(SoundOn);
_local2 = 0;
while (_local2 < Chain.length) {
game[Chain[_local2]].StartShine();
if (Chain.length > 2) {
game[Chain[_local2]].StartZZZ();
} else {
game[Chain[_local2]].StopZZZ();
}
if (_local2 != 0) {
var _local6 = FindI(Chain[_local2 - 1]);
var _local5 = FindJ(Chain[_local2 - 1]);
var _local4 = FindI(Chain[_local2]);
var _local3 = FindJ(Chain[_local2]);
AttachArrow(_local6, _local5, _local4, _local3);
} else {
var _local6 = FindI(Chain[_local2]);
var _local5 = FindJ(Chain[_local2]);
}
_local2++;
}
FillBombing();
}
function ClearFon() {
for (var _local1 in Chain) {
ClearChainFon(_local1);
}
game.eff.rays.removeMovieClip();
}
function ClearChainFon(i) {
ClearBombing(i);
game[Chain[i]].StopZZZ();
game[Chain[i]].StopShine();
game.eff[Chain[i]].removeMovieClip();
}
function FillBombing() {
game.eff.rays.removeMovieClip();
var _local7 = FindI(Chain[Chain.length - 1]);
var _local6 = FindJ(Chain[Chain.length - 1]);
var _local3 = 0;
if (Chain.length > 8) {
_local3 = 3;
} else if (Chain.length > 6) {
_local3 = 2;
} else if (Chain.length > 4) {
_local3 = 1;
}
if (_local3 > 0) {
game.eff.attachMovie("bonusrays", "rays", 999, {_x:(_local6 + 0.5) * FonSize, _y:(_local7 + 0.5) * FonSize, _width:((2 * _local3) + 1) * FonSize, _height:((2 * _local3) + 1) * FonSize});
game.eff.rays.onEnterFrame = function () {
this._rotation = random(360);
};
var _local5 = _local7 - _local3;
while (_local5 <= (_local7 + _local3)) {
var _local2 = _local6 - _local3;
while (_local2 <= (_local6 + _local3)) {
if ((Math.abs(_local5 - _local7) + Math.abs(_local2 - _local6)) <= _local3) {
var _local4 = game[FindName(_local5, _local2)];
_local4.StartZZZ();
_local4.bombed = true;
}
_local2++;
}
_local5++;
}
}
}
function ClearBombing(i) {
var _local6 = FindI(Chain[i]);
var _local5 = FindJ(Chain[i]);
var _local3 = 3;
i = _local6 - _local3;
while (i <= (_local6 + _local3)) {
var _local2 = _local5 - _local3;
while (_local2 <= (_local5 + _local3)) {
var _local1 = game[FindName(i, _local2)];
if (_local1.bombed) {
_local1.StopZZZ();
_local1.bombed = false;
}
_local2++;
}
i++;
}
game.eff.rays.removeMovieClip();
}
function BlowBombing(Name, L) {
var _local5 = FindI(Name);
var _local6 = FindJ(Name);
var _local4 = 0;
if (L > 8) {
_local4 = 3;
} else if (L > 6) {
_local4 = 2;
} else if (L > 4) {
_local4 = 1;
}
if (_local4 > 0) {
BombExplode_s.start(SoundOn);
var _local8 = game.eff.attachMovie("vzryv", "vz", game.eff.getNextHighestDepth(), {_x:game[Name]._x + 15, _y:game[Name]._y + 15, _rotation:random(300)});
_local8._xscale = (_local8._yscale = _local4 * 120);
var _local3 = _local6 - _local4;
while (_local3 <= (_local6 + _local4)) {
var _local1 = _local5 - _local4;
while (_local1 <= (_local5 + _local4)) {
if ((Math.abs(_local1 - _local5) + Math.abs(_local3 - _local6)) <= _local4) {
var _local2 = game[FindName(_local1, _local3)];
_local2.bombed = false;
if ((!_local2.isStone) && (!_local2.bonus)) {
_local2.Remove(_local1 - _local5, _local3 - _local6);
}
if (!_local2.isStone) {
ChangeFon(_local1, _local3, 0);
}
}
_local1++;
}
FallColomn(_local3);
_local3++;
}
}
CheckEnergy();
}
function ChangeFon(i, j, c) {
if (((Matrix[i][j] != "e") && (Matrix[i][j] > 0)) && (!T.isStone)) {
game.fon[FindName(i, j)].gotoAndStop((--Matrix[i][j]) + 1);
InitFon(i, j);
if (c) {
CheckEnergy();
}
}
}
function AttachArrow(i2, j2, i, j) {
if (game.eff[FindName(i, j)] == undefined) {
var _local3 = game.eff.getNextHighestDepth();
if (j2 < j) {
mc = game.eff.attachMovie("strela", FindName(i, j), _local3, {_x:((FonSize * j) + SX) + (FonSize / 2), _y:((FonSize * i) + SY) + (FonSize / 2)});
} else if (j < j2) {
mc = game.eff.attachMovie("strela", FindName(i, j), _local3, {_x:((FonSize * j) + SX) + (FonSize / 2), _y:((FonSize * i) + SY) + (FonSize / 2), _rotation:180});
} else if (i > i2) {
mc = game.eff.attachMovie("strela", FindName(i, j), _local3, {_x:((FonSize * j) + SX) + (FonSize / 2), _y:((FonSize * i) + SY) + (FonSize / 2), _rotation:90});
} else if (i2 > i) {
mc = game.eff.attachMovie("strela", FindName(i, j), _local3, {_x:((FonSize * j) + SX) + (FonSize / 2), _y:((FonSize * i) + SY) + (FonSize / 2), _rotation:270});
}
}
return(mc);
}
function ReleaseTile() {
if (MakeChain) {
if ((Chain.length > 1) && (Make__Chain == "")) {
MakeChain = false;
BlowChain();
FromHint();
StartShowHint();
} else {
Make__Chain = "hit";
}
}
}
function FindName(i, j) {
return((("sY" + i) + "X") + j);
}
function BlowChain() {
var _local1 = Chain.length;
if (_local1 > Chain_score) {
Chain_score = _local1;
}
var _local3 = _local1 > 2;
ClearFon();
FillBombing();
Make__Chain = "";
game.eff.rays.removeMovieClip();
if (_local3) {
if (!Hint_Arr[5]) {
FromHint(1);
}
clearChain_s.start(SoundOn);
var _local2 = 0;
switch (game[Chain[0]].Name.substr(1, 1)) {
case "1" :
_local2 = 1;
break;
case "4" :
_local2 = 2;
}
if ((_local2 == 1) && (Level == 4)) {
gamepanel["b" + _local2].Add(0.125 * _local1);
} else if ((_local2 == 2) && (Level == 8)) {
gamepanel["b" + _local2].Add(0.125 * _local1);
} else {
gamepanel["b" + _local2].Add(0.05 * _local1);
}
DelTile(0);
ShowScore(game[Chain[_local1 - 1]], _local1);
clearInterval(getting_hint12);
getting_hint12 = setInterval(function () {
Hint(2);
clearInterval(getting_hint12);
}, 2000);
} else {
Chain = new Array();
}
}
function ShowScore(MC, L) {
var _local1 = L * 5;
if (L > 4) {
_local1 = _local1 + 5;
}
if (L > 6) {
_local1 = _local1 + 10;
}
if (L > 8) {
_local1 = _local1 + 15;
}
score = score + _local1;
SCORE.Add(_local1);
var _local3 = game.eff.attachMovie("fly_text", "f" + getTimer(), game.eff.getNextHighestDepth(), {_x:MC._x + 15, _y:MC._y + 15});
TextShow(_local3.e, "+" + String(_local1), "GameFont", 0, 0, 1, 18, 16776960, 1000, 0);
}
function LastInLine(t) {
var _local4 = true;
var _local7 = Chain[t];
var _local5 = FindJ(_local7);
var _local2 = t + 1;
while (_local2 < Chain.length) {
if (_local5 == FindJ(Chain[_local2])) {
_local4 = false;
break;
}
_local2++;
}
if (_local4) {
var _local6 = FindI(_local7);
var _local1 = ((_local6 - Chain.length) + t) - 2;
while (_local1 < (((_local6 + Chain.length) - t) + 3)) {
if (game[FindName(_local1, _local5)].inchain) {
_local4 = false;
break;
}
_local1++;
}
}
if (_local4) {
FallColomn(_local5);
}
}
function DelTile(t) {
clearInterval(deltile);
var _local1 = Chain[t];
var _local4 = FindI(_local1);
var _local3 = FindJ(_local1);
if (game[_local1].bombed == false) {
if (game[_local1].isIce) {
game[_local1].blowIce();
} else {
game[_local1].Remove();
ChangeFon(_local4, _local3, 1);
}
LastInLine(t);
}
game.eff.attachMovie("blow", _local1, GetDepth(_local4, _local3), {_x:((FonSize * _local3) + SX) + (FonSize / 2), _y:((FonSize * _local4) + SY) + (FonSize / 2), _alpha:20});
t++;
if (t == Chain.length) {
BlowBombing(Chain[t - 1], Chain.length);
Chain = new Array();
} else {
deltile = setInterval(DelTile, DelTileTime, t);
}
}
function CheckEnergy() {
var _local9 = CurrentJ;
var _local10 = CurrentI;
var _local4 = LastDiameter;
clearInterval(endfall);
var _local8 = 0;
while (_local8 < Matrix.length) {
var _local6 = 0;
while (_local6 < Matrix[0].length) {
var _local2 = 0;
var _local3 = "1";
var _local5 = 0;
if (!((Matrix[_local8][_local6] > 0) || (Matrix[_local8][_local6] == "."))) {
if (Matrix[_local8][_local6 - 1] == "e") {
_local2 = _local2 + 1;
}
if (Matrix[_local8 - 1][_local6] == "e") {
_local2 = _local2 + 2;
}
if (Matrix[_local8][_local6 + 1] == "e") {
_local2 = _local2 + 4;
}
if (Matrix[_local8 + 1][_local6] == "e") {
_local2 = _local2 + 8;
}
}
if (_local2 != 0) {
if (((_local2 == 8) || (_local2 == 13)) || (_local2 == 9)) {
_local5 = 270;
} else if ((((_local2 == 2) || (_local2 == 6)) || (_local2 == 10)) || (_local2 == 7)) {
_local5 = 90;
} else if (((_local2 == 4) || (_local2 == 12)) || (_local2 == 14)) {
_local5 = 180;
}
if ((((_local2 == 3) || (_local2 == 6)) || (_local2 == 9)) || (_local2 == 12)) {
_local3 = "2_1";
} else if ((((_local2 == 7) || (_local2 == 11)) || (_local2 == 14)) || (_local2 == 13)) {
_local3 = "3";
} else if (_local2 == 15) {
_local3 = "4";
} else if ((_local2 == 5) || (_local2 == 10)) {
_local3 = "2_2";
}
if (game.en[FindName(_local8, _local6)] == undefined) {
Matrix[_local8][_local6] = "g";
Tiles_score++;
if (((_local8 == 5) && (_local6 == 5)) && (Level == 0)) {
Hint(1);
}
game.en.attachMovie("en" + _local3, FindName(_local8, _local6), GetDepth(_local8, _local6), {_rotation:_local5, _x:(SX + (_local6 * FonSize)) + (FonSize / 2), _y:(SY + (_local8 * FonSize)) + (FonSize / 2), _xscale:(FonSize / Size) * 100, _yscale:(FonSize / Size) * 100, _alpha:50});
if (_root.EnergyMove_s.Volume <= 80) {
_root.EnergyMove_s.Volume = _root.EnergyMove_s.Volume + 10;
}
var _local7 = Diameter(CheckPoint.y, CheckPoint.x, _local8, _local6);
if (_local7 < _local4) {
_local4 = _local7;
_local10 = _local8;
_local9 = _local6;
}
if (_local4 < (LastDiameter - MaxEnD)) {
LastDiameter = _local4 + 1;
MoveField(getTimer(), 1500, _local10 - CurrentI, _local9 - CurrentJ);
}
if (_local4 <= int(CheckPoint.r)) {
ChangeCheckPoint(CheckPointN + 1);
_local4 = LastDiameter;
}
}
}
_local6++;
}
_local8++;
}
var _local17 = false;
_local8 = 0;
while (_local8 < EnergyReceiver.height) {
var _local6 = 0;
while (_local6 < EnergyReceiver.width) {
if (Matrix[EnergyReceiver.y - _local8][EnergyReceiver.x + _local6] == "e") {
_local17 = true;
break;
}
_local6++;
}
_local8++;
}
if (_local17 && (GameStatus != "endround")) {
recarr.removeMovieClip();
TIMER.StopTimer();
ReleaseTile();
FromHint();
menumain.removeMovieClip();
map.removeMovieClip();
GameStatus = "endround";
ShowLevelComplete();
clearInterval(_root.end_round_int);
_root.LevelComplete_s.start(_root.SoundOn);
_root.end_round_int = setInterval(function () {
clearInterval(_root.end_round_int);
EndingRound();
}, 3000);
}
}
function GetBlack(MC, N, D, NA) {
if (!MC) {
MC = _root;
}
if (!N) {
N = 0;
}
if (!D) {
D = MC.getNextHighestDepth();
}
if (!NA) {
NA = "bl";
}
MC[NA].removeMovieClip();
var _local2 = MC.attachMovie("black", NA, D, {_width:520, _height:390, _alpha:N});
_local2.onPress = null;
_local2.useHandCursor = false;
return(_local2);
}
function EndingRound() {
GetBlack(game.eff, 0, 1000);
var _local1 = game.eff.r0;
_local1.rot._visible = false;
var _local2 = _local1.attachMovie("earth_bush_rise", "earth_bush_rise", 0, {_x:55, _y:15});
}
function ShowStats() {
EnergyMove_s.stop();
GetBlack(_root, 50, 122);
ReleaseTile();
FromHint();
L_C.removeMovieClip();
ClearMovie(_root, 1, 0);
stats.removeMovieClip();
stats = _root.createEmptyMovieClip("stats", 123);
stats._x = 260;
stats._y = 10;
stats.createEmptyMovieClip("headtext", 90);
stats.attachMovie("stats_div", "SD", 91, {_y:30});
var _local2 = 0;
while (_local2 < 7) {
var _local8 = stats.createEmptyMovieClip("L" + _local2, (_local2 * 3) + 1);
var _local7 = stats.createEmptyMovieClip("R" + _local2, (_local2 * 3) + 2);
_local8._y = (_local7._y = 30 + (_local2 * 27));
_local8._x = 20;
_local7._x = 25;
_local2++;
}
TextShow(stats.headtext, TextStatistics.text, "gradient", 0, 15, 1, 30, 0, 1000, 0, 16777113, 65280, 90, BOLDFONT);
var _local5 = int(TIMER.GetTime());
if (_local5 < 60) {
var _local4 = "0:";
var _local3 = _local5;
} else {
var _local4 = int(_local5 / 60) + ":";
var _local3 = _local5 % 60;
}
if (_local3 < 10) {
var _local4 = _local4 + ("0" + _local3);
} else {
var _local4 = _local4 + _local3;
}
_local5 = TIMER.GetLastTime() * 5;
score = score + _local5;
TotalScore = TotalScore + score;
var _local6 = new Array({}, {L:TextLevelTime, R:String(_local4)}, {L:TextTimeBonus, R:String(_local5)}, {L:TextChain, R:String(Chain_score)}, {L:TextTiles, R:String(Tiles_score)}, {L:TextLevelScore, R:String(score)}, {L:TextTotalScore, R:String(TotalScore)});
TIMER.DisAppear();
clearInterval(scoring);
scoring = setInterval(GetScoreString, 100, 1, _local6);
totalTime = totalTime + levelTime;
levelTime = 0;
END_ST_P = false;
bl.onPress = function () {
END_ST_P = true;
};
score = 0;
}
function GetScoreString(i, SA) {
if (!END_ST_P) {
StatValue_s.start(SoundOn);
}
clearInterval(scoring);
TextShow(stats["L" + i], SA[i].L.text, "gradient", -3, 0, 2, 20, 0, 1000, 0, 16776960, 65280, 90, BOLDFONT);
TextShow(stats["R" + i], SA[i].R, "gradient", -2, 0, 0, 22, 0, 1000, 0, 16777215, 8947967, 90, BOLDFONT);
i++;
if (i != SA.length) {
scoring = setInterval(GetScoreString, (END_ST_P ? 0 : 300), i, SA);
} else {
bl.onPress = EndRound;
var _local4 = stats.createEmptyMovieClip("TIP", 98);
_local4._y = 235 + int(_root.TextHint0.y);
_root.TextShow(_local4, (_root.TextTip.text + "|") + _root["WISE_TIP" + int(Level + 1)].text, "gradient", -2, 15, 1, 18, 0, 450, 0, 16777164, 16776960, 90, BOLDFONT);
_local4 = stats.attachMovie("button_uzk_s", "b", 99, {_y:350});
_local4.InitText(TextOk.text);
_local4.InitFunction(EndRound);
}
}
function EndRound() {
if ((((Level + 1) < int(_root.MaxLevel.value)) && (_root.NagTime.value != "0")) && (((Level + 1) % int(_root.NagTime.value)) == 0)) {
ShowNag();
} else if ((Level + 1) >= int(_root.MaxLevel.value)) {
ShowNag(1);
} else {
End_Round();
}
}
function End_Round() {
ClearMovie(_root, 1, 1);
Level++;
GameLevel++;
InitBooks(1);
}
function ShowNag(c) {
GameClasses.GFunctions.ClearAll(_root, 1, 1);
nag.removeMovieClip();
var nag = _root.attachMovie("nag", "nag", 456);
var _local6 = "";
var _local5 = "";
var _local4 = 0;
var _local3;
if (c) {
_local4 = 1;
if (_root.GameLevel >= _root.MaxLevel.value) {
_local3 = _root.TextNagComplete;
_local6 = (((_local3.text1 + "||") + _root.TextScore.text) + " ") + TotalScore;
_local5 = _local3.text2;
_root.TextShow(nag.t1, _local6, "GameFont", -2, 16, _local4, 18, _root.FontWhite, 350, 0, 0, 0, 0, BOLDFONT);
_root.TextShow(nag.t2, _local5, "GameFont", -2, 16, _local4, 18, _root.FontWhite, 350, 0, 0, 0, 0, BOLDFONT);
} else {
TotalScore = TotalScore + score;
score = 0;
_local3 = _root.TextNagNew;
_local6 = (_root.TextScore.text + " ") + int(TotalScore);
_local5 = _local3.text2;
_root.TextShow(nag.t1, _local6, "GameFont", -2, 16, _local4, 18, _root.FontWhite, 350, 0, 0, 0, 0, BOLDFONT);
_root.TextShow(nag.t2, _local5, "GameFont", -2, 16, _local4, 18, _root.FontWhite, 350, 0, 0, 0, 0, BOLDFONT);
}
nag.b1.onLoad = function () {
this.InitText(_root.TextRestart.text);
};
nag.b1.onPress = _root.NNEWGAME;
} else {
_local3 = _root.TextNagFeatures;
_local6 = _local3.text1;
_local5 = _local3.text2;
nag.b1.onLoad = function () {
this.InitText(_root.TextContinue.text);
};
nag.b1.onPress = _root.End_Round;
_root.TextShow(nag.t1, _local6, "GameFont", -2, 16, _local4, 18, 16777113, 350, 0, 0, 0, 0, BOLDFONT);
_root.TextShow(nag.t2, _local5, "GameFont", -2, 16, _local4, 18, _root.FontWhite, 350, 0, 0, 0, 0, BOLDFONT);
}
nag.t1._x = int(_local3.t1x);
nag.t2._x = int(_local3.t2x);
nag.t1._y = int(_local3.t1y);
nag.t2._y = int(_local3.t2y);
nag.b2.onPress = FunctionDownload;
nag.b2.onLoad = function () {
this.InitText(_root.TextDownload.text);
};
if (_root.NagTime.value == "0") {
nag.b2._visible = false;
nag.b1._x = nag.b1._x + 50;
}
}
function FallingSlideOld(i, j) {
var _local2 = i;
var _local4 = true;
while (_local4) {
_local2++;
if (Matrix[_local2][j] == undefined) {
_local2--;
while (Matrix[_local2][j] == ".") {
_local2--;
}
break;
}
if (game[FindName(_local2, j)]._name != undefined) {
_local2--;
while (Matrix[_local2][j] == ".") {
_local2--;
}
break;
}
}
var _local8 = GetDepth(_local2, j);
var _local6 = game[FindName(i, j)];
var _local5 = FindName(_local2, j);
_local6._name = _local5;
_local6.swapDepths(_local8);
var _local7 = getTimer();
clearInterval(_root["m" + _local5]);
_root["m" + _local5] = setInterval(FALL, 0, _local5, _local6._y, ((_local2 * FonSize) + SX) + ((FonSize - Size) / 2), _local7);
}
function FallDown() {
Fall = true;
var _local2 = 0;
while (_local2 < Chain.length) {
var _local3 = FindJ(Chain[_local2]);
clearInterval(_root["FC" + _local3]);
_root["FC" + _local3] = setInterval(FallColomn, 500, _local3);
_local2++;
}
}
function FallingSlide(i, j) {
var _local2 = Matrix.length;
var _local4 = true;
do {
if (!_local4) {
break;
}
_local2--;
} while (!((game[FindName(_local2, j)] == undefined) && (Matrix[_local2][j] != ".")));
if (_local2 < 0) {
trace((i + " ") + j);
}
var _local8 = GetDepth(_local2, j);
var _local5 = game[FindName(i, j)];
var _local6 = FindName(_local2, j);
_local5._name = _local6;
_local5.StopZZZ();
_local5.StopShine();
_local5.swapDepths(_local8);
var _local7 = getTimer();
clearInterval(_root["m" + _local6]);
_root["m" + _local6] = setInterval(FALL, 0, _local6, _local5._y, ((_local2 * FonSize) + SX) + ((FonSize - Size) / 2), _local7);
}
function FallColomn(j) {
clearInterval(_root["FC" + j]);
var _local3 = 0;
var _local8 = 0;
while (_local8 < Matrix.length) {
if ((game[FindName(_local8, j)].bonus && (game[FindName(_local8, j)].wasuse)) || (j < 0)) {
_local3 = 0;
break;
}
if (((game[FindName(_local8, j)] == undefined) && (Matrix[_local8][j] != ".")) && (Matrix[_local8][j] != undefined)) {
_local3++;
}
_local8++;
}
if (_local3) {
_local3 = 0;
_local8 = Matrix.length - 1;
while (((Matrix[_local8][j] == ".") || (game[FindName(_local8, j)].isIce)) || (game[FindName(_local8, j)].bonus)) {
_local8--;
}
while (_local8 >= 0) {
if (game[FindName(_local8, j)].isIce) {
if (_local3) {
_local3 = 0;
var _local4 = _local8 + 1;
while (_local4 < Matrix.length) {
if ((game[FindName(_local4, j)] == undefined) && (Matrix[_local4][j] != ".")) {
_local3++;
} else if (game[FindName(_local4, j)].isIce) {
break;
}
_local4++;
}
_local8++;
var _local7 = _local3 - 1;
while (_local7 >= 0) {
var _local5 = _local8 + _local7;
var _local10 = GetDepth(_local5 + 100, j);
var _local6 = GetRandomSlide(0, j);
var _local9 = game.attachMovie(_local6, FindName(_local5 + 100, j), _local10, {_x:((FonSize * j) + ((FonSize - Size) / 2)) + SX, _y:((FonSize * (_local5 - _local3)) + ((FonSize - Size) / 2)) + SY, _alpha:0});
_local9.InitSlide(_local6, _local6 == "rock");
FallingSlide(_local5 + 100, j);
_local7--;
}
}
_local3 = 0;
} else if ((game[FindName(_local8, j)] == undefined) && (Matrix[_local8][j] != ".")) {
_local3++;
} else if ((_local3 && (!game[FindName(_local8, j)].isIce)) && (!game[FindName(_local8, j)].bonus)) {
FallingSlide(_local8, j);
}
_local8--;
}
_local3 = 0;
_local8 = 0;
while (_local8 < Matrix.length) {
if ((game[FindName(_local8, j)] == undefined) && (Matrix[_local8][j] != ".")) {
_local3++;
}
_local8++;
}
if (_local3) {
_local8 = 0;
while (Matrix[_local8][j] == ".") {
_local8++;
}
var _local7 = _local3 - 1;
while (_local7 >= 0) {
var _local5 = (_local8 + _local7) - _local3;
var _local10 = GetDepth(_local5 + 100, j);
var _local6 = GetRandomSlide(0, j);
var _local9 = game.attachMovie(_local6, FindName(_local5 + 100, j), _local10, {_x:((FonSize * j) + ((FonSize - Size) / 2)) + SX, _y:((FonSize * (_local5 - _local3)) + ((FonSize - Size) / 2)) + SY, _alpha:0});
_local9.InitSlide(_local6, _local6 == "rock");
FallingSlide(_local5 + 100, j);
_local7--;
}
}
}
}
function FALL(Name, y0, Y, t0) {
Fall = true;
var _local3 = getTimer();
var _local5 = SlideFall;
var _local2 = game[Name];
_local2._y = y0 - (((_local3 - t0) * (y0 - Y)) / _local5);
if (_local2._alpha < MaxAlpha) {
_local2._alpha = ((_local3 - t0) * MaxAlpha) / _local5;
}
if (_local3 > (t0 + _local5)) {
Fall = false;
_local2._y = Y;
_local2._alpha = MaxAlpha;
_local5 = getTimer();
clearInterval(_root["m" + Name]);
}
}
function BonusFall(TJ, R) {
if (R == undefined) {
clearInterval(_root["FC" + TJ]);
_root["FC" + TJ] = setInterval(FallColomn, 100, TJ);
} else {
var _local2 = TJ - R;
while (_local2 <= (int(TJ) + int(R))) {
clearInterval(_root["FC" + _local2]);
_root["FC" + _local2] = setInterval(FallColomn, 100 * Math.abs(TJ - _local2), _local2);
_local2++;
}
}
}
function ToE(Name) {
if (_root.EnergyMove_s.Volume >= 10) {
_root.EnergyMove_s.Volume = _root.EnergyMove_s.Volume - 10;
}
Matrix[FindI(Name)][FindJ(Name)] = "e";
if (game[Name].bonus) {
game[Name].Blow();
}
clearInterval(endfall);
endfall = setInterval(CheckEnergy, 0);
}
function Diameter(i1, j1, i2, j2) {
return(Math.sqrt(((i2 - i1) * (i2 - i1)) + ((j2 - j1) * (j2 - j1))));
}
function CopyMatrix(A2) {
var _local5 = new Array();
var _local4;
var _local2 = 0;
while (_local2 < A2.length) {
_local4 = new Array();
var _local1 = 0;
while (_local1 < A2[0].length) {
_local4.push(A2[_local2][_local1]);
_local1++;
}
_local5.push(_local4);
_local2++;
}
return(_local5);
}
function ClearMovie(MC, CI, CM) {
GameClasses.GFunctions.ClearAll(MC, CM, CI);
}
function SetHint(w, h, MC, x, y, N, Na, T) {
if (!MC) {
MC = _root;
}
if (!x) {
x = 0;
}
if (!y) {
y = 0;
}
if (!h) {
h = w;
}
if (!Na) {
Na = "shleif2";
MC.SHINE.removeMovieClip();
T = 4000;
}
var _local6 = MC.createEmptyMovieClip("SHINE", MC.getNextHighestDepth());
_local6._x = x;
_local6._y = y;
_local6._alpha = ((T == 4000) ? 80 : 100);
if (!N) {
N = 30;
}
if ((w < 10) || (h < 10)) {
N = N - 10;
}
if ((w > 30) && (h > 30)) {
N = N + 20;
}
var _local4 = 0;
while (_local4 < N) {
var _local3 = _local6.attachMovie(Na, "s" + _local4, _local4);
_local3._x = w - (2 * random(w));
_local3._y = h - (2 * random(h));
_local3.w = w;
_local3.h = h;
_local3.P = T + getTimer();
_local3.TT = random(1000);
_local3.T = getTimer() - random(500);
_local3.NR = (_local3._xscale = (_local3._yscale = 50));
_local3.onEnterFrame = function () {
if (this.P >= getTimer()) {
var _local2 = (getTimer() - this.T) / this.TT;
if (_local2 >= 1) {
this.T = getTimer();
this._x = this.w - (2 * random(this.w));
this._y = this.h - (2 * random(this.h));
this.NR = (this._xscale = (this._yscale = random(50) + 50));
}
this._xscale = (this._yscale = this.NR + ((30 - this.NR) * _local2));
if (this._xscale < 0) {
this._xscale = (this._yscale = 30);
}
this._rotation = this._rotation + 2;
} else {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
_local4++;
}
}
function InitHintButton(MC, F, T) {
MC.mc.onPress = GameClasses.GFunctions.create(_root, HintPressed, MC, F, T);
MC.obvod._alpha = 100;
MC.bl._y = -42;
MC.line._y = -2;
}
function HintPressed(MC, F, T) {
if (F()) {
MC.bl._y = 0;
MC.line._y = 40;
MC.T = getTimer();
MC.TT = T;
MC.F = F;
delete MC.mc.onPress;
MC.onEnterFrame = function () {
var _local3 = (getTimer() - this.T) / this.TT;
if (_local3 >= 1) {
_root.InitHintButton(MC, this.F, this.TT);
_root.SetHint(20, 20, this, 20, 20);
_root.bonusComplete_s.start(_root.SoundOn);
delete this.onEnterFrame;
} else {
MC.bl._y = -40 * _local3;
MC.line._y = 38 - (38 * _local3);
}
};
}
}
function ShowMap() {
if (GameStatus == "play") {
TIMER.StopTimer();
_root.attachMovie("map", "map", 76);
var _local4 = Math.floor(Math.min(328 / Matrix[0].length, 246 / Matrix.length));
_root.TextShow(map.Name, GetLevelString(1), "GameFont", -2, 13, 1, 16, 0, 1000, 13421772);
var _local3 = 0;
while (_local3 < Matrix.length) {
var _local2 = 0;
while (_local2 < Matrix[0].length) {
if (Matrix[_local3][_local2] != ".") {
var _local6 = map.ins.attachMovie("black", FindName(_local3, _local2), GetDepth(_local3, _local2), {_x:_local2 * _local4, _y:_local3 * _local4, _width:_local4, _height:_local4, _alpha:40});
if (Matrix[_local3][_local2] == "e") {
var _local5 = new Color(_local6);
_local5.setRGB(3394611);
}
}
_local2++;
}
_local3++;
}
var _local10 = SizeJ - 1;
var _local11 = SizeI - 2;
map.ins._x = map.ins._x + (((328 - map.ins._width) / 2) - _local4);
map.ins._y = map.ins._y + (((246 - map.ins._height) / 2) - _local4);
if ((Level != 0) && (Level != 15)) {
map.ram._width = ((2 * _local10) * _local4) - _local4;
map.ram._height = (2 * _local11) * _local4;
map.ram._x = map.ins._x + ((((CurrentJ - _local10) + 1) + LastCurrentJ) * _local4);
map.ram._y = map.ins._y + (((CurrentI - _local11) + LastCurrentI) * _local4);
} else {
map.ram._x = 1000;
}
map.ins.attachMovie("EnergyReceiver_map", "EnergyReceiver", 19875, {_x:(EnergyReceiver.x + 1.5) * _local4, _y:(EnergyReceiver.y - 0.5) * _local4});
var _local13 = map.ins.attachMovie("map_arr", "map_arr", 19874, {_x:(BeginEnergy.j + 0.5) * _local4, _y:(BeginEnergy.i + 0.5) * _local4, _rotation:BeginEnergy.R});
_local3 = CheckPoint.y;
var _local2 = CheckPoint.x;
}
}
function ShowMenu() {
if ((!Game_Hint) && (((GameStatus == "play") || (GameStatus == "diff")) || (GameStatus == "spy"))) {
TIMER.StopTimer();
_root.attachMovie("menu", "menumain", 102);
}
}
function FunctionResume() {
_root.menumain.removeMovieClip();
}
function FunctionDownload() {
getURL (_root.DownloadLink.value, "_blank");
}
function FunctionRestartLevel() {
ClearMovie(_root, 1, 1);
SetLevel();
}
function FunctionExitLevel() {
ClearMovie(_root, 1, 1);
if (GameStatus == "spy") {
GameLevel++;
var _local2 = 0;
} else if (GameStatus == "diff") {
GameLevel++;
var _local2 = 1;
} else {
GameLevel++;
Level++;
var _local2 = 1;
}
InitBooks(_local2);
}
function FunctionSound() {
var _local1 = 0;
while (_local1 < (menu_buttons.length - 1)) {
if (menu_buttons[_local1].funct == "FSound") {
break;
}
_local1++;
}
var _local2 = menu_buttons[menu_buttons.length - 1].text;
menu_buttons[menu_buttons.length - 1].text = menu_buttons[_local1].text;
menu_buttons[_local1].text = _local2;
menumain.buttons["b" + _local1].InitText(_local2, 0, -2, "GameFont", -2, 20, 1, 20, 16777215, 1000, 0);
SoundOn = !SoundOn;
}
function FunctionNewGame() {
var _local2 = new GameClasses.GameHint(_root.createEmptyMovieClip("sSssS", 777), TextNewGame.text, 140, 150, GameClasses.GFunctions.create(_root, ShowNag, 1), FromHint);
}
function NNEWGAME() {
Level = (GameLevel = (score = 0));
InitArrSlide();
InitBooks();
}
function FromHint(c) {
if ((c || (Hint_arr[5] == 1)) || (GameStatus != "play")) {
if ((!Game_Hint.BLACK) || (Game_Hint.BLACK.onPress != null)) {
Game_Hint.removeMovieClip();
}
map.removeMovieClip();
menumain.removeMovieClip();
var _local1 = 0;
while (_local1 < Hint_Light.length) {
Hint_Light[_local1].removeMovieClip();
_local1++;
}
delete Hint_Light;
}
}
function Hint(N, F) {
clearInterval(getting_hint12);
if ((!Hint_Arr[N]) && ((!Game_Hint) || (Level == 0))) {
Hint_Arr[N] = 1;
ShowHint(N, F);
}
}
function GetHint() {
var _local5 = [];
var _local7 = 0;
var _local8 = [];
var _local4 = 0;
while (_local4 < Matrix.length) {
var _local6 = [];
var _local3 = 0;
while (_local3 < Matrix[0].length) {
_local6.push(0);
_local3++;
}
_local5.push(_local6);
_local4++;
}
_local4 = int(((CurrentI - SizeI) + LastCurrentI) + 1);
while (_local4 < int(((CurrentI + SizeI) + LastCurrentI) - 1)) {
var _local3 = int(((CurrentJ - SizeJ) + LastCurrentJ) + 1);
while (_local3 < int(((CurrentJ + SizeJ) + LastCurrentJ) - 1)) {
var _local1 = [];
if (((_local5[_local4][_local3] == 0) && (Matrix[_local4][_local3] != ".")) && (game[FindName(_local4, _local3)].Name.length < 4)) {
FindForHint(_local4, _local3, _local5, _local1);
FindForHint(_local4, _local3, _local5, _local1);
}
if ((_local1.length > _local7) && (_local1.length > 3)) {
_local7 = _local1.length;
_local8 = _local1;
}
var _local2 = 0;
while (_local2 < _local1.length) {
_local5[FindI(_local1[_local2]._name)][FindJ(_local1[_local2]._name)] = 0;
_local2++;
}
_local3++;
}
_local4++;
}
LightHint(_local8);
return(_local8);
}
function FindForHint(i, j, M, A) {
M[i][j] = 1;
var _local4 = game[FindName(i, j)];
A.push(_local4);
if ((((i >= int(((CurrentI - SizeI) + LastCurrentI) + 1)) && (i < int(((CurrentI + SizeI) + LastCurrentI) - 1))) && (j >= int(((CurrentJ - SizeJ) + LastCurrentJ) + 1))) && (j < int(((CurrentJ + SizeJ) + LastCurrentJ) - 1))) {
if ((_local4.Name == game[FindName(i, int(j + 1))].Name) && (M[i][j + 1] == 0)) {
FindForHint(i, int(j + 1), M, A);
} else if ((_local4.Name == game[FindName(i, int(j - 1))].Name) && (M[i][j - 1] == 0)) {
FindForHint(i, int(j - 1), M, A);
} else if ((_local4.Name == game[FindName(int(i + 1), j)].Name) && (M[i + 1][j] == 0)) {
FindForHint(int(i + 1), j, M, A);
} else if ((_local4.Name == game[FindName(int(i - 1), j)].Name) && (M[i - 1][j] == 0)) {
FindForHint(int(i - 1), j, M, A);
}
}
}
function LightHint(Arr) {
var _local1 = 0;
while (_local1 < Hint_Light.length) {
Hint_Light[_local1].removeMovieClip();
_local1++;
}
delete Hint_Light;
var _local8 = Arr[0];
var _local9 = false;
P = _local8;
Hint_Light = [];
_local1 = 1;
while (_local1 < Arr.length) {
if (Arr[_local1] == _local8) {
_local9 = true;
P = _local8;
} else {
N = Arr[_local1];
var _local6 = FindI(P._name);
var _local3 = FindI(N._name);
var _local4 = FindJ(P._name);
var _local2 = FindJ(N._name);
if (_local9) {
var _local5 = AttachArrow(_local3, _local2, _local6, _local4);
} else {
var _local5 = AttachArrow(_local6, _local4, _local3, _local2);
}
if (_local5) {
Hint_Light.push(_local5);
}
P = N;
}
_local1++;
}
}
function StartShowHint() {
clearInterval(getting_hint);
getting_hint = setInterval(function () {
if (((((GameStatus == "play") && (Hint_Light[1] == undefined)) && (Chain.length < 3)) && (LastCurrentI == 0)) && (LastCurrentJ == 0)) {
GetHint();
} else if (GameStatus != "play") {
clearInterval(getting_hint);
}
}, 7000);
}
function ShowHint(N, F) {
FromHint();
var _local3 = 160;
var _local2 = 100;
var _local4 = 0;
var _local7 = 0;
if (F) {
F();
F = null;
}
switch (N) {
case 0 :
Hint_Arr[N] = 0;
F = RestartAll1;
_local3 = _local3 + 20;
_local2 = _local2 + 140;
break;
case 1 :
_local3 = _local3 + 10;
_local2 = _local2 - 90;
_local4 = 5;
F = GameClasses.GFunctions.create(_root, Hint, 2);
break;
case 2 :
_local3 = _local3 - 100;
_local2 = _local2 + 20;
_local4 = -2;
_root.SetHint(45, 45, game.eff.r0, 45, 45);
break;
case 3 :
_local4 = 5;
_local3 = _local3 + 105;
_local2 = _local2 - 70;
_root.SetHint(15, 15, game[FindName(7, 8)], 15, 15);
break;
case 4 :
_local4 = 3;
_local3 = _local3 + 60;
_local2 = _local2 - 65;
_root.SetHint(15, 15, game[FindName(24, 6)], 15, 15);
break;
case 5 :
_local3 = _local3 - 25;
_local2 = _local2 - 65;
_local4 = 5;
_local7 = 1;
_root.SetHint(45, 15, game.eff, game[FindName(5, 5)]._x + 15, game[FindName(5, 5)]._y + 15);
Hint_Light = [];
_root.mouse_move.removeMovieClip();
_root.attachMovie("mouse_move", "mouse_move", 987, {_x:game[FindName(5, 4)]._x - 15, _y:game[FindName(5, 4)]._y - 18});
break;
case 6 :
_root.SetHint(15, 25, recarr.a, 0, -5);
_local4 = -2;
_local3 = _local3 - 90;
_local2 = _local2 + 20;
break;
case 7 :
_root.SetHint(TIMER._width / 2, TIMER._height / 2, TIMER, -10, 175, 80);
_local3 = _local3 - 40;
_local2 = _local2 + 50;
_local4 = -2;
break;
case 8 :
_root.SetHint(TIMER._width / 2, TIMER._height / 2, TIMER, -10, 175, 80);
_local3 = _local3 - 40;
_local2 = _local2 + 50;
_local4 = -2;
break;
case 9 :
_local4 = 5;
_local2 = _local2 + 80;
_root.SetHint(20, 20, gamepanel.b1, 20, 20);
F = GameClasses.GFunctions.create(_root, Hint, 40);
break;
case 10 :
_local4 = 5;
_local3 = _local3 + 70;
_local2 = _local2 + 110;
_root.SetHint(20, 20, gamepanel.b2, 20, 20);
break;
case 11 :
_local3 = _local3 + 100;
_local2 = _local2 + 110;
_local4 = 3;
_local7 = 1;
_root.SetHint(30, 30, Ramka.lamp, 0, 0, 60);
break;
case 12 :
_local3 = _local3 - 140;
_local2 = _local2 - 70;
_local4 = -3;
_root.SetHint(15, 15, game[FindName(7, 12)]);
break;
case 13 :
_local4 = 3;
_local3 = _local3 + 20;
_local2 = _local2 + 40;
_root.SetHint(15, 15, game[FindName(18, 3)], 15, 15);
break;
case 14 :
_local4 = 5;
_local3 = _local3 + 80;
_local2 = _local2 - 25;
_root.SetHint(15, 15, game[FindName(6, 7)], 15, 15);
break;
case 15 :
_local2 = _local2 + 135;
_local3 = _local3 - 5;
_local4 = 3;
_root.SetHint(gamepanel.map._width / 2, gamepanel.map._height / 4, gamepanel.map, 20, 20);
break;
case 16 :
LevelLose_s.start(SoundOn);
Hint_Arr[N] = 0;
F = FunctionRestartLevel;
break;
case 17 :
_local3 = _local3 + 40;
_local2 = _local2 + 10;
F = GameClasses.GFunctions.create(_root, Hint, 18);
break;
case 18 :
_local2 = _local2 + 140;
_local3 = _local3 - 140;
_local4 = -5;
_root.SetHint(20, 20, _root.Diff.bg.hint, 20, 20);
break;
case 19 :
_local2 = _local2 - 30;
_local3 = _local3 + 90;
_local4 = 5;
_root.SetHint(10, 60, _root.Diff.bg.ch3, 0, 50);
F = GameClasses.GFunctions.create(_root, Hint, 18);
break;
case 20 :
_local3 = _local3 - 120;
_local2 = _local2 + 20;
_local4 = -2;
_local7 = 1;
break;
case 21 :
_local4 = -4;
_local3 = _local3 - 80;
_local2 = _local2 + 70;
_local7 = 1;
break;
case 22 :
_local2 = _local2 + 100;
break;
case 23 :
_local2 = _local2 + 120;
break;
case 24 :
_local3 = _local3 + 100;
_local2 = _local2 + 50;
_local4 = 2;
F = GameClasses.GFunctions.create(_root, Hint, 35);
break;
case 25 :
_local3 = _local3 - 80;
_local2 = _local2 + 80;
_local4 = -3;
_local7 = 1;
_root.SetHint(_root.Books.Button_clip.playb._width / 3, _root.Books.Button_clip.playb._height / 3, _root.Books.Button_clip.playb);
break;
case 26 :
break;
case 27 :
_root.Books.Show = 1;
_root.Slides_Arr[_root.GameLevel] = 0;
_local2 = _local2 + 144;
_local3 = _local3 + 60;
F = GameClasses.GFunctions.create(_root.Books, _root.Books.Opened);
break;
case 28 :
_local3 = _local3 + 50;
F = GameClasses.GFunctions.create(_root, Hint, 29);
break;
case 29 :
_local3 = _local3 + 100;
_local2 = _local2 + 110;
_local4 = 3;
_root.SetHint(30, 30, Ramka.lamp, 0, 0, 60);
F = GameClasses.GFunctions.create(_root, Hint, 30);
break;
case 30 :
_local3 = _local3 + 20;
_local2 = _local2 + 40;
_local4 = 2;
_local7 = 1;
ShowSPYHint();
break;
case 31 :
_local7 = 1;
if (Items.lamp_1.onPress) {
_local3 = _local3 + 20;
_local2 = _local2 + 40;
_local4 = 2;
ShowSPYHint();
} else if (Items.lamp_2.onPress) {
_local3 = _local3 - 155;
_local2 = _local2 + 70;
_local4 = -3;
ShowSPYHint();
} else {
return(undefined);
}
break;
case 32 :
_local2 = _local2 + 110;
_local4 = 3;
_root.SetHint(Ramka.hint._width / 2, Ramka.hint._height / 4, Ramka.hint, 20, 20);
break;
case 33 :
_root.Books.playb.InitFunction(FromHint);
_root.Books.playb.area._y = -1000;
_root.SetHint(_root.Books.BookL_clip._width / 2, _root.Books.BookL_clip._height / 2, _root.Books.BookL_clip, _root.Books.BookL_clip._width / 2, _root.Books.BookL_clip._height / 2);
_local3 = _local3 + 105;
_local4 = 2;
_local7 = 1;
break;
case 34 :
_local3 = _local3 + 50;
_local2 = _local2 - 20;
F = GameClasses.GFunctions.create(_root, _root.SetHint, _root.Books.playb._width / 3, _root.Books.playb._height / 3, _root.Books.playb);
break;
case 35 :
_local3 = _local3 - 155;
_local2 = _local2 + 50;
_local4 = -2;
F = GameClasses.GFunctions.create(_root, Hint, 25);
break;
case 36 :
_local4 = 5;
_local2 = _local2 + 130;
break;
case 37 :
_local4 = 5;
_local3 = _local3 + 70;
_local2 = _local2 + 130;
break;
case 38 :
break;
case 39 :
break;
case 40 :
_local4 = 5;
_local3 = _local3 + 40;
_local2 = _local2 + 150;
_root.SetHint(8, 8, gamepanel.b1, 45, 35);
break;
case 41 :
return(undefined);
case 42 :
_local3 = _local3 - 5;
_local2 = _local2 - 80;
_local4 = 2;
break;
case 43 :
_local3 = _local3 - 0;
_local2 = _local2 + 0;
_local4 = 5;
Hint_Arr[N] = 0;
break;
case 44 :
_local3 = _local3 + 60;
_local2 = _local2 + 40;
_local4 = 4;
Hint_Arr[N] = 0;
break;
case 45 :
_local3 = _local3 + 95;
_local2 = _local2 + 20;
_local4 = 4;
Hint_Arr[N] = 0;
break;
case 46 :
break;
case 47 :
if (gamepanel.b1.fill >= 1) {
Hint(46);
return(undefined);
}
break;
case 48 :
}
if (_local3 || (_local2)) {
_local3 = ((_root["TextHint" + N].x == undefined) ? (_local3) : (_local3 + int(_root["TextHint" + N].x)));
_local2 = ((_root["TextHint" + N].x == undefined) ? (_local2) : (_local3 + int(_root["TextHint" + N].y)));
if (!F) {
F = _root.FromHint;
}
TIMER.StopTimer();
var _local8 = new GameClasses.GameHint(_root.createEmptyMovieClip("Game_Hint", 771), _root["TextHint" + N].text, _local3, _local2, F, null, _local4, _local7);
}
}
function ShowLevelComplete() {
var _local3 = _root.createEmptyMovieClip("L_C", 87);
_local3._x = 260;
_local3._y = 150;
TextShow(_local3, _root.TextLevelComplete.text, "gradient", 0, 0, 1, 50, 0, 1000, 0, 16777215, 16776960, 90);
_local3._xscale = (_local3._yscale = 10);
_local3.onEnterFrame = function () {
this._xscale = this._xscale + 4;
this._yscale = this._xscale;
if (this._xscale >= 100) {
delete this.onEnterFrame;
}
};
}
function InitSound() {
function AddSound(NameA, MC) {
for (var _local4 in NameA) {
_root[NameA[_local4]] = new GameClasses.GameSound(NameA[_local4], MC);
}
}
if ((!_root.SoundsClip1) || (!_root.SoundsClip2)) {
_root.createEmptyMovieClip("SoundsClip1", 198);
_root.createEmptyMovieClip("SoundsClip2", 199);
var _local3 = ["addChipInChain_s", "AddNewText_s", "BombExplode_s", "bonusComplete_s", "button_s", "clearChain_s", "ClickBonus_s", "CrossBonus_s", "DoBonus1_s", "DoBonus2_s", "FailSPY_s", "FlyAndOpenBook_s", "GoodClickDiff_s", "IceBreak_s", "ItemArriveSPY_s", "LevelComplete_s", "LevelLose_s", "ListingPage_s", "MoveHint_s", "start_s", "StatValue_s", "SuccessSPY_s", "UnlockBook_s"];
AddSound(_local3, _root.SoundsClip1);
_root.addChipInChain_s.setVolume(60);
_root.addChipInChain_s.C = 0;
_root.EnergyMove_s = new GameClasses.GameSound("EnergyMove_s", _root.SoundsClip2);
_root.EnergyMove_s.setVolume(0);
_root.EnergyMove_s.Volume = 0;
}
}
function ToolTip(MC, TXT, c) {
clearInterval(tool_tip);
tool_tip = setInterval(TOOL_TIP, 700, MC, TXT);
if (!c) {
MC.onRollOut = (MC.onReleaseOutside = ToolTipOut);
}
}
function TOOL_TIP(MC, TXT) {
clearInterval(tool_tip);
_root.attachMovie("tool_clip", "tool_clip", 888);
TextShow(tool_clip.txt, TXT, "GameFont", -2, 18, 1, 20, 16777215, 300, 0, 0, 0, 0, BOLDFONT);
var _local5 = tool_clip.txt._width;
var _local3 = tool_clip.txt._height;
tool_clip.ramka._width = _local5 + 30;
tool_clip.ramka._height = _local3 + 10;
tool_clip.ramka._x = 0;
tool_clip.ramka._y = (-_local3) - 15;
tool_clip.txt._x = (_local5 / 2) + 15;
tool_clip.txt._y = (-_local3) - 2;
tool_clip._x = _root._xmouse;
tool_clip._y = _root._ymouse;
tool_clip.onEnterFrame = function () {
var _local3 = _root._xmouse;
var _local4 = _root._ymouse;
if ((this._width + _local3) > 520) {
this._x = _local3 - this._width;
} else {
this._x = _local3;
}
this._y = _local4;
};
}
function ToolTipOut() {
clearInterval(tool_tip);
tool_clip.removeMovieClip();
}
function TOOL_TIP2(TXT, x, y) {
ToolTipOut();
_root.attachMovie("tool_clip2", "tool_clip", 888);
TextShow(tool_clip.txt, TXT, "GameFont", -3, 15, 1, 18, 16777215, 300, 0, 0, 0, 0, BOLDFONT);
var _local3 = tool_clip.txt._width;
var _local2 = tool_clip.txt._height;
tool_clip.ramka._width = _local3 + 30;
tool_clip.ramka._height = _local2 + 10;
tool_clip.ramka._x = 0;
tool_clip.ramka._y = (-_local2) - 15;
tool_clip.txt._x = (_local3 / 2) + 15;
tool_clip.txt._y = (-_local2) - 2;
tool_clip._x = x;
tool_clip._y = y;
clearInterval(tool_tip);
tool_tip = setInterval(ToolTipOut, 5000);
}
stop();
stop();
stop();
var BOLDFONT = "BOLDFONT";
var SoundOn = true;
var FontWhite = 16777215;
var GameStatus = "play";
var checkmaskinterval;
var notBlock = true;
var SizeI = 8;
var SizeJ = 10;
var MaxEnD = 3;
var CurrentI = 42;
var CurrentJ = 0;
var FonSize = 32;
var Size = 30;
var MaxAlpha = 100;
var SX = 0;
var SY = 0;
var Chain;
var MakeChain = false;
var SlideFall = 500;
var cheat = false;
var DelTileTime = 50;
var GameLevel = 0;
var Level = 0;
var Matrix;
var Musor;
var CheckPointN = 0;
var EnergyReceiverN = 0;
var CheckPoint;
var EnergyReceiver;
var LastDiameter;
var LastCurrentI;
var LastCurrentJ;
var maxsx = 6;
var maxsy = 4;
var Chain;
var elementn = 1;
var Slides_Arr = new Array(20);
var TotalScore = 0;
var TotalTime = 0;
var Hint_Arr = new Array(49);
var Make__Chain = "";
oKey = {};
oKey.onKeyDown = function () {
if (Key.isDown(35)) {
cheat = !cheat;
}
if (Key.isDown(36)) {
}
};
Key.addListener(oKey);
InitSound();
GameClasses.GFunctions.ClearAll(_root, 1, 1);
InitArrSlide();
InitBooks();
Symbol 7 MovieClip [poly] Frame 1
stop();
Symbol 691 MovieClip [__Packages.GameClasses.LoadGameXML] Frame 0
class GameClasses.LoadGameXML
{
var MCRoot, Loading, ISPYxml, LEVELxml, TEXTxml;
function LoadGameXML (MCRoot, iSPYPath, levelPath, textPath, Loading) {
this.MCRoot = MCRoot;
this.Loading = Loading;
ISPYxml = new XML();
ISPYxml.ignoreWhite = true;
ISPYxml.load(iSPYPath);
ISPYxml.onLoad = GameClasses.GFunctions.create(this, LoadSPYXML, ISPYxml);
LEVELxml = new XML();
LEVELxml.ignoreWhite = true;
LEVELxml.load(levelPath);
LEVELxml.onLoad = GameClasses.GFunctions.create(this, initcountXML, LEVELxml);
TEXTxml = new XML();
TEXTxml.ignoreWhite = true;
TEXTxml.load(textPath);
TEXTxml.onLoad = GameClasses.GFunctions.create(this, initTEXTXML, TEXTxml);
}
function initTEXTXML(ThisXML) {
MCRoot.Dialogs = new Array();
var _local13 = ThisXML.firstChild;
if (_local13 != undefined) {
var _local4 = _local13.childNodes;
var _local3 = 0;
while (_local3 < _local4.length) {
if (_local4[_local3].nodeName == "text") {
var _local9 = "";
var _local12 = _local4[_local3].attributes.id;
var _local10 = _local4[_local3].childNodes;
var _local7 = 0;
while (_local7 < _local10.length) {
_local9 = _local9 + (_local10[_local7].attributes.text + "|");
_local7++;
}
_local9 = _local9.substr(0, -1);
MCRoot[_local12] = _local9;
} else if (_local4[_local3].nodeName == "string") {
var _local8 = (MCRoot[_local4[_local3].attributes.id] = {});
for (var _local12 in _local4[_local3].attributes) {
_local8[_local12] = _local4[_local3].attributes[_local12];
}
} else if (_local4[_local3].nodeName == "menu_buttons") {
MCRoot.menu_buttons = new Array();
var _local6 = _local4[_local3].childNodes;
var _local5 = 0;
while (_local5 < _local6.length) {
var _local8 = {};
for (var _local12 in _local6[_local5].attributes) {
_local8[_local12] = _local6[_local5].attributes[_local12];
}
MCRoot.menu_buttons.push(_local8);
_local5++;
}
} else if (_local4[_local3].nodeName == "logo") {
var _local8 = {};
for (var _local12 in _local4[_local3].attributes) {
_local8[_local12] = _local4[_local3].attributes[_local12];
}
var _local11 = _root.logos.createEmptyMovieClip(_local8.name, _root.logos.getNextHighestDepth());
_local11._x = _local8.x;
_local11._y = _local8.y;
_local11.loadMovie(_local8.path);
}
_local3++;
}
if (!(--XMLCount)) {
Loading();
}
} else {
Text();
}
}
function initcountXML(ThisXML) {
var _local19 = ThisXML.firstChild;
if (_local19 != undefined) {
MCRoot.loadbar._visible = true;
var _local18 = (MCRoot.LEVELS = new Array());
var _local17 = _local19.childNodes;
var _local10 = 0;
while (_local10 < _local17.length) {
var _local7 = {};
_local7.Name = _local17[_local10].attributes.name;
var _local3 = _local17[_local10].childNodes;
var _local13 = new Array();
var _local2 = 0;
var _local8 = 0;
while (_local8 < _local3[_local2].childNodes.length) {
_local13.push(_local3[_local2].childNodes[_local8].attributes.n);
_local8++;
}
_local7.chips = _local13;
_local2++;
_local7.name = _local3[_local2].firstChild.toString();
var _local9 = new Array();
_local2++;
while (_local3[_local2].nodeName == "Line") {
var _local11 = _local3[_local2].firstChild.toString().split("");
_local9.push(_local11);
}
_local7.map = _local9;
if (_local3[_local2].nodeName == "BonusInfo") {
var _local12 = new Array();
_local8 = 0;
while (_local8 < _local3[_local2].childNodes.length) {
_local12.push(_local3[_local2].childNodes[_local8].attributes.r);
_local8++;
}
_local7.bonus = _local12;
_local2++;
}
if (_local3[_local2].nodeName == "Musor") {
var _local16 = new Array();
_local8 = 0;
while (_local8 < _local3[_local2].childNodes.length) {
_local16.push(_local3[_local2].childNodes[_local8].attributes.max);
_local8++;
}
_local7.musor = _local16;
_local2++;
}
var _local14 = new Array();
_local8 = 0;
while (_local8 < _local3[_local2].childNodes.length) {
var _local6 = {};
_local6.x = int(_local3[_local2].childNodes[_local8].attributes.x);
_local6.y = (_local9.length - int(_local3[_local2].childNodes[_local8].attributes.y)) - 1;
_local6.r = int(_local3[_local2].childNodes[_local8].attributes.r);
_local14.push(_local6);
_local8++;
}
_local7.checkpoints = _local14;
var _local15 = new Array();
_local2++;
_local8 = 1;
while (_local8 < _local3[_local2].childNodes.length) {
var _local4 = {};
var _local5 = _local3[_local2].childNodes[_local8];
_local4.x = int(_local5.firstChild.attributes.x);
_local4.y = (_local9.length - int(_local5.firstChild.attributes.y)) - 1;
_local4.width = int(_local5.firstChild.attributes.width);
_local4.height = int(_local5.firstChild.attributes.height);
_local4.time = int(_local5.childNodes[1].attributes.initTime);
_local15.push(_local4);
_local8++;
}
_local7.energy = _local15;
_local18[_local10] = _local7;
_local10++;
}
MCRoot.GlobalTime = getTimer();
if (!(--XMLCount)) {
Loading();
}
} else {
Text();
}
}
function LoadSPYXML(ThisXML) {
MCRoot.ISPY_Level = new Array();
var _local14 = ThisXML.firstChild;
if (_local14 != undefined) {
var _local12 = _local14.childNodes;
var _local8 = 0;
while (_local8 < _local12.length) {
var _local9 = new Array(2);
var _local4 = _local12[_local8].childNodes[0].childNodes;
var _local10 = new Array();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local7 = {};
for (var _local13 in _local4[_local2].attributes) {
_local7[_local13] = _local4[_local2].attributes[_local13];
}
_local10.push(_local7);
_local2++;
}
_local9[0] = _local10;
_local4 = _local12[_local8].childNodes[1].childNodes;
_local10 = new Array();
_local2 = 0;
while (_local2 < _local4.length) {
var _local5 = {};
_local5.Name = _local4[_local2].attributes.splitItemId;
_local5.id = _local4[_local2].attributes.id;
_local5.Act = [];
var _local3 = 0;
while (_local3 < _local4[_local2].childNodes.length) {
var _local6 = {};
for (var _local11 in _local4[_local2].childNodes[_local3].attributes) {
_local6[_local11] = _local4[_local2].childNodes[_local3].attributes[_local11];
}
_local5.Act.push(_local6);
_local3++;
}
_local10[_local2] = _local5;
_local2++;
}
_local9[1] = _local10;
MCRoot.ISPY_Level[_local8] = _local9;
_local8++;
}
if (!(--XMLCount)) {
Loading();
}
} else {
Text();
}
}
function Text() {
MCRoot.KB.text = "Could not find game files";
}
var XMLCount = 3;
}
Symbol 692 MovieClip [__Packages.GameClasses.GFunctions] Frame 0
class GameClasses.GFunctions extends Object
{
function GFunctions () {
super();
}
static function create() {
var _local2 = function () {
var _local2 = arguments.callee.obj;
var _local3 = arguments.callee.func;
var _local4 = arguments.callee.arg;
return(_local3.apply(_local2, _local4));
};
_local2.obj = arguments[0];
_local2.func = arguments[1];
_local2.arg = arguments.splice(2, arguments.length - 1);
return(_local2);
}
static function ClearAll(mc, M, I, III) {
for (var _local5 in mc) {
if ((((typeof(mc[_local5]) == "movieclip") && (String(mc).split(".").length < String(mc[_local5]).split(".").length)) && (_local5 != "SoundsClip1")) && (_local5 != "SoundsClip2")) {
if ((_local5 == "TEXT") && (M)) {
mc[_local5].removeMovieClip();
} else {
ClearAll(mc[_local5], M, I);
if (M) {
mc[_local5].removeMovieClip();
}
}
}
if (I) {
clearInterval(mc[_local5]);
}
}
if ((((M && (!III)) && (mc != _root)) && (mc != _root.SoundsClip1)) && (mc != _root.SoundsClip2)) {
mc.removeMovieClip();
}
if (mc == _root) {
_root.InitSound();
}
}
}
Symbol 693 MovieClip [__Packages.GameClasses.TileClass] Frame 0
class GameClasses.TileClass extends MovieClip
{
var useHandCursor, inside, ice, onPress, onMouseUp, onEnterFrame, onRollOver, onRollOut, blink, attachMovie, _name, Shine, swapDepths, getDepth;
function TileClass () {
super();
}
function InitSlide(Name, isRock, isIce, isStone) {
this.Name = Name;
this.isRock = isRock;
this.isIce = isIce;
this.isStone = isStone;
useHandCursor = false;
Hide();
}
function Hide() {
active = false;
inside.removeMovieClip();
if (isIce) {
ice.removeMovieClip();
}
onPress = null;
onMouseUp = null;
onEnterFrame = null;
onRollOver = Over;
onRollOut = Out;
}
function Over() {
if (!((isRock || (isStone)) || (isIce))) {
blink.removeMovieClip();
if (Name == "s2") {
attachMovie("blinkf", "blink", 5);
} else {
attachMovie("blink", "blink", 5);
}
}
if ((_root.GameStatus.substr(0, 9) == "actbonus2") || ((((_root.GameStatus.substr(0, 8) == "actbonus") && (!isStone)) && (!isIce)) && (_root.Matrix[_root.FindI(_name)][_root.FindJ(_name)] > 0))) {
_root.gamepanel["b" + _root.GameStatus.substr(8, 1)].Over(this);
}
}
function Out() {
if ((_root.GameStatus.substr(0, 9) == "actbonus2") || (((_root.GameStatus.substr(0, 8) == "actbonus") && (!isStone)) && (!isIce))) {
_root.gamepanel["b" + _root.GameStatus.substr(8, 1)].Out(this);
}
}
function StartZZZ() {
if ((!inchain) && (!isStone)) {
inchain = true;
inside.onEnterFrame = GameClasses.GFunctions.create(this, ZZZ);
}
}
function ZZZ() {
inside._x = 1 - (2 * Math.random());
inside._y = 1 - (2 * Math.random());
Shine._x = 1 - (2 * Math.random());
Shine._y = 1 - (2 * Math.random());
}
function StopZZZ() {
if (inchain) {
bombed = false;
inchain = false;
inside._x = 0;
inside._y = 0;
inside.onEnterFrame = null;
}
}
function Release() {
if (((!_root.menumain) && (!_root.map)) && ((!_root.Game_Hint) || (_root.Level == 0))) {
_root.ReleaseTile();
}
}
function Show() {
active = true;
if ((!isRock) && (!isStone)) {
onEnterFrame = _root.Over;
onMouseUp = Release;
}
onPress = _root.Press;
inside.removeMovieClip();
attachMovie(Name + "i", "inside", 0);
if (isIce) {
ice.removeMovieClip();
attachMovie("ice", "ice", 1);
}
if (isStone) {
ice.removeMovieClip();
}
}
function StartShine() {
if (!shine) {
shine = true;
Shine.removeMovieClip();
if (Name == "s2") {
attachMovie("whitef", "Shine", 2, {_alpha:30});
} else {
attachMovie("white", "Shine", 2, {_alpha:30});
}
}
}
function StopShine() {
if (shine) {
shine = false;
Shine.removeMovieClip();
}
}
function blowIce() {
isIce = false;
ice.removeMovieClip();
}
function Remove(i, j) {
if (isIce) {
_root.IceBreak_s.start(_root.SoundOn);
ice.removeMovieClip();
}
_root.game.fon[_name].lopata_eff.removeMovieClip();
i = int(i);
j = int(j);
onPress = null;
onMouseUp = null;
onEnterFrame = null;
onRollOver = null;
onRollOut = null;
_name = "rrr" + getTimer();
swapDepths(getDepth() - 9000);
onEnterFrame = function () {
this.inside._xscale = this.inside._xscale - 7;
this.inside._rotation = this.inside._rotation + (random(10) - 5);
var _local2 = this.inside._xscale;
this.inside._yscale = _local2;
this.inside._x = (15 - (0.15 * _local2)) + ((j * (100 - _local2)) / 10);
this.inside._y = (15 - (0.15 * _local2)) + ((i * (100 - _local2)) / 10);
if (_local2 < 5) {
this.removeMovieClip();
}
};
}
var Name = "";
var active = false;
var shine = false;
var inchain = false;
var bombed = false;
var bonus = false;
var isStone = false;
var isRock = false;
var isIce = false;
}
Symbol 694 MovieClip [__Packages.GameClasses.CrossBonus] Frame 0
class GameClasses.CrossBonus extends MovieClip
{
var cross, R, TI, _name, TJ, attachMovie, fon, body, swapDepths, moving, removeMovieClip, arr1, arr2, arr3, arr4, arr5, arr6, arr7, arr8;
function CrossBonus () {
super();
}
function InitSlide(AR) {
cross = AR;
R = Math.min(20, AR[3]);
Moving();
TI = _root.FindI(_name);
TJ = _root.FindJ(_name);
}
function Moving() {
var _local2;
if (cross[0]) {
if (cross[4] != "D") {
_local2 = attachMovie("movesmallarrowbonus", "arr1", 1, {_xscale:-100});
_local2.gotoAndPlay(random(40));
}
if (cross[4] != "U") {
_local2 = attachMovie("movesmallarrowbonus", "arr2", 2, {_rotation:180});
_local2.gotoAndPlay(random(40));
}
}
if (cross[1]) {
if (cross[4] != "L") {
_local2 = attachMovie("movesmallarrowbonus", "arr3", 3, {_xscale:-100, _rotation:90});
_local2.gotoAndPlay(random(40));
}
if (cross[4] != "R") {
_local2 = attachMovie("movesmallarrowbonus", "arr4", 4, {_rotation:270});
_local2.gotoAndPlay(random(40));
}
}
if (cross[2]) {
_local2 = attachMovie("movesmallarrowbonus", "arr5", 5, {_xscale:-100, _rotation:45});
_local2.gotoAndPlay(random(40));
_local2 = attachMovie("movesmallarrowbonus", "arr6", 6, {_rotation:235});
_local2.gotoAndPlay(random(40));
_local2 = attachMovie("movesmallarrowbonus", "arr7", 7, {_xscale:-100, _rotation:135});
_local2.gotoAndPlay(random(40));
_local2 = attachMovie("movesmallarrowbonus", "arr8", 8, {_xscale:-100, _rotation:325});
_local2.gotoAndPlay(random(40));
}
if (cross[2]) {
attachMovie("bodybonus8", "body", 100);
attachMovie("bodybonus8fon", "fon", 0);
} else if (!cross[1]) {
attachMovie("bodybonus2", "body", 100);
attachMovie("bodybonus2fon", "fon", 0);
} else if (!cross[0]) {
attachMovie("bodybonus2", "body", 100, {_rotation:90});
attachMovie("bodybonus2fon", "fon", 0, {_rotation:90});
} else {
attachMovie("bodybonus4", "body", 100);
attachMovie("bodybonus4fon", "fon", 0);
}
}
function Blow(c) {
_root.FromHint();
if (c == undefined) {
fon._visible = false;
body._visible = false;
if (wasuse) {
return(undefined);
}
_root.CrossBonus_s.start(_root.SoundOn);
c = 1;
swapDepths(_root.GetDepth(TI + 100, TJ));
wasuse = true;
for (var _local4 in this) {
if (_local4.substr(0, 3) == "arr") {
this[_local4].gotoAndStop(1);
}
}
} else {
if (cross[0]) {
if (cross[4] != "U") {
BlowTile(TI + c, TJ);
}
if (cross[4] != "D") {
BlowTile(TI - c, TJ);
}
}
if (cross[1]) {
if (cross[4] != "L") {
BlowTile(TI, TJ + c);
}
if (cross[4] != "R") {
BlowTile(TI, TJ - c);
}
}
if (cross[2]) {
BlowTile(TI + c, TJ + c);
BlowTile(TI - c, TJ - c);
BlowTile(TI - c, TJ + c);
BlowTile(TI + c, TJ - c);
}
c++;
}
if (c <= R) {
clearInterval(moving);
moving = setInterval(GameClasses.GFunctions.create(this, Blowing, getTimer(), c), 0);
} else {
if (cross[1] || (cross[2])) {
_root.BonusFall(TJ, R);
} else {
_root.BonusFall(TJ);
}
_root.CheckEnergy();
removeMovieClip();
}
}
function BlowTile(i, j) {
_root.SetHint(15, 15, _root.game.eff, _root.game[_root.FindName(i, j)]._x + 15, _root.game[_root.FindName(i, j)]._y + 15, 10, "shleif3", 500);
if ((_root.Matrix[i][j] != ".") && (_root.Matrix[i][j] != undefined)) {
var _local7 = _root.Matrix[i][j] == "e";
_root.Matrix[i][j] = Math.max(1, _root.Matrix[i][j] - 1);
var _local3 = _root.game[_root.FindName(i, j)];
var _local2 = _root.Chain;
for (var _local6 in _local2) {
if (_local2[_local6] == _local3._name) {
_root.ClearFon();
_root.Chain = [];
}
}
if (_local3.bonus && (!_local3.wasuse)) {
_local3.Blow();
_root.ChangeFon(i, j, 1);
} else {
_local3.Remove();
_root.ChangeFon(i, j, 1);
}
if (_local7) {
_root.Matrix[i][j] = "e";
}
}
}
function Blowing(T, c) {
var _local6 = 200;
var _local4 = getTimer();
var _local7 = _root.FonSize;
var _local8 = (c - 1) * _local7;
var _local10 = c * _local7;
var _local5 = 1;
if (_local4 < (T + _local6)) {
_local5 = (_local4 - T) / _local6;
} else {
clearInterval(moving);
Blow(c);
}
var _local3 = _local8 + ((_local10 - _local8) * _local5);
arr1._x = 0;
arr2._x = 0;
arr3._x = _local3;
arr4._x = -_local3;
arr5._x = _local3;
arr6._x = -_local3;
arr7._x = _local3;
arr8._x = -_local3;
arr1._y = -_local3;
arr2._y = _local3;
arr3._y = 0;
arr4._y = 0;
arr5._y = -_local3;
arr6._y = _local3;
arr7._y = _local3;
arr8._y = -_local3;
}
var bombed = false;
var bonus = true;
var wasuse = false;
var blowint = true;
}
Symbol 695 MovieClip [__Packages.GameClasses.GameBonus] Frame 0
class GameClasses.GameBonus extends MovieClip
{
var type, _name, P, onRollOver, foll, _visible, useHandCursor, onPress, up2, up1, attachMovie;
function GameBonus () {
super();
type = int(_name.substr(1, 1));
P = _root;
ToBegin();
onRollOver = ThisOver;
}
function ThisOver() {
var _local3 = _root["TextBonus" + type].text;
_local3 = _local3.split("#BonusCharged#").join(String(int(fill * 100)));
if (fill >= 1) {
_local3 = _root.TextSpyReady.text;
}
if (!foll) {
_root.ToolTip(this, _local3);
}
}
function Add(N) {
if (fill < 1) {
fill = fill + N;
if (fill >= 1) {
fill = 1;
if (_visible) {
_root.Hint(35 + type);
}
_root.bonusComplete_s.start(_root.SoundOn && (_visible));
useHandCursor = true;
onPress = Press;
_root.SetHint(20, 20, this, 20, 20);
}
if (_visible) {
_root.Hint(41);
}
up1._y = (up2._y = 38 * (1 - fill));
}
}
function Act(MC) {
var _local6 = P.FindI(MC._name);
var _local8 = P.FindJ(MC._name);
if ((type == 1) && (P.Matrix[_local6][_local8] > 0)) {
_root.DoBonus1_s.start(_root.SoundOn);
P.ChangeFon(_local6, _local8, 1);
_root.game.fon[MC._name].lopata_eff.removeMovieClip();
delete foll.onEnterFrame;
foll.removeMovieClip();
_root.GameStatus = "play";
delete onPress;
} else if ((type == 1) && (P.Matrix[_local6][_local8] == 0)) {
_root.Hint(38);
} else if (type == 2) {
_root.ClearBombing(6);
_root.Chain = [];
_root.DoBonus2_s.start(_root.SoundOn);
var _local11 = P.game.eff.attachMovie("vzryv", "vz", P.game.eff.getNextHighestDepth(), {_x:MC._x + 15, _y:MC._y + 15, _rotation:random(300), _xscale:180, _yscale:180});
var _local5 = _local8 - 2;
while (_local5 <= (_local8 + 2)) {
var _local3 = _local6 - 2;
while (_local3 <= (_local6 + 2)) {
if ((Math.abs(_local6 - _local3) + Math.abs(_local8 - _local5)) < 3) {
var _local7 = P.FindName(_local3, _local5);
var _local4 = P.game[_local7];
if (!(_local4.isStone || (_local4.bonus))) {
_local4.removeMovieClip();
}
}
_local3++;
}
P.FallColomn(_local5);
_local5++;
}
delete foll.onEnterFrame;
foll.removeMovieClip();
_root.GameStatus = "play";
delete onPress;
}
ToBegin();
}
function Over(MC) {
if (type == 2) {
_root.Chain = [0, 0, 0, 0, 0, 0, MC._name];
_root.FillBombing();
} else {
_root.game.fon[MC._name].attachMovie("lopata_eff", "lopata_eff", 99);
}
}
function Out(MC) {
if (type == 2) {
_root.ClearBombing(6);
} else {
_root.game.fon[MC._name].lopata_eff.removeMovieClip();
}
}
function ToBegin() {
useHandCursor = false;
fill = 0;
up1._y = (up2._y = 44);
}
function Press() {
_root.Chain = [];
_root.ClickBonus_s.start(_root.SoundOn);
if (_root.GameStatus == "play") {
if (_visible) {
if (type > 1) {
_root.Hint(37 + type);
}
}
_root.GameStatus = "actbonus" + type;
ToBegin();
onPress = Release;
foll.removeMovieClip();
attachMovie(("bonus" + type) + "fon", "foll", 1, {_x:_root._xmouse + 10, _y:_root._ymouse + 20});
foll.onEnterFrame = function () {
this._x = (_root._xmouse + 10) - this._parent._x;
this._y = (_root._ymouse + 20) - this._parent._y;
};
}
}
function Release() {
_root.Chain = [];
_root.ClickBonus_s.start(_root.SoundOn);
fill = 1;
_root.GameStatus = "play";
up1._y = (up2._y = -2);
onPress = Press;
delete foll.onEnterFrame;
foll.removeMovieClip();
}
var active = false;
var Full = false;
var fill = 0;
var N = 0;
}
Symbol 696 MovieClip [__Packages.GameClasses.GameTimer] Frame 0
class GameClasses.GameTimer extends MovieClip
{
var t, top, mask, Tii, onEnterFrame, B, TI, E;
function GameTimer () {
super();
t = 0;
mask._y = (top._y = scale);
Tii = getTimer();
onEnterFrame = Appear;
}
function Appear() {
var _local2 = (getTimer() - Tii) / 3000;
if (_local2 >= 1) {
_local2 = 1;
delete onEnterFrame;
StopTimer();
B = getTimer();
}
mask._y = (top._y = (1 - _local2) * scale);
}
function DisAppear() {
onEnterFrame = function () {
this.top._y = this.top._y + 4;
this.mask._y = this.top._y;
if (this.top._y >= this.scale) {
delete this.onEnterFrame;
}
};
}
function SetTime(N) {
if (TI == undefined) {
B = getTimer();
} else {
var _local2 = getTimer();
B = _local2 - ((N * (_local2 - B)) / TI);
}
E = B + N;
TI = N;
}
function StartTimer() {
if (S > 0) {
E = E + (getTimer() - S);
B = B + (getTimer() - S);
S = 0;
}
onEnterFrame = ShowTime;
}
function StopTimer() {
_root.fly.red.removeMovieClip();
clearInterval(_root.showing_hint);
if (S == 0) {
S = getTimer();
delete onEnterFrame;
}
}
function ShowTime() {
t = (getTimer() - B) / (E - B);
if (t >= 1) {
_root.Hint(16);
t = 1;
delete onEnterFrame;
if (!_root.Failed) {
_root.Failed = 1;
_root.FallDown();
}
}
if (t > 0.8) {
_root.Hint(8);
}
mask._y = (top._y = t * scale);
}
function GetLastTime() {
return(Math.ceil(((1 - t) * TI) / 1000));
}
function GetTime() {
return(Math.floor((t * TI) / 1000));
}
function CountDown() {
onEnterFrame = function () {
this.mask._y = this.mask._y + 3;
this.top._y = this.mask._y;
if (this.mask._y >= this.scale) {
this.top._y = (this.mask._y = this.scale);
delete this.onEnterFrame;
}
};
}
var S = 0;
var scale = 325;
}
Symbol 697 MovieClip [__Packages.GameClasses.GameButton] Frame 0
class GameClasses.GameButton extends MovieClip
{
var area, _name, txt, createEmptyMovieClip, _parent, _xscale, _yscale, gotoAndPlay, onPress;
function GameButton () {
super();
InitButton(area);
}
function InitFunction(F) {
this.F = F;
}
function InitText(T, x, y, l, W, H, C, WT, HT) {
this.T = T;
if (!this[_name + "_text"]) {
txt = createEmptyMovieClip(_name + "_text", _parent.getNextHighestDepth());
txt._x = 0;
txt._y = 0;
if (x != undefined) {
txt._x = txt._x + x;
} else {
txt._x = txt._x + sx;
}
if (y != undefined) {
txt._y = txt._y + y;
} else {
txt._y = txt._y + sy;
}
}
txt._xscale = 10000 / _xscale;
txt._yscale = 10000 / _yscale;
_root.TextShow(txt, T, l, W, H, C, WT, HT, 1000, 0);
}
function InitButton(B) {
gotoAndPlay("a");
if (onPress) {
F = onPress;
}
delete onPress;
B.onRollOver = function () {
this._parent.gotoAndPlay("a");
};
B.onRollOut = function () {
this._parent.gotoAndPlay("a");
};
B.onReleaseOutside = function () {
this._parent.gotoAndPlay("n");
this._parent.txt._y = this._parent.txt._y - 1;
};
B.onPress = function () {
_root.button_s.start(_root.SoundOn);
this._parent.gotoAndPlay("p");
this._parent.txt._y = this._parent.txt._y + 1;
};
B.onRelease = function () {
this._parent.F();
this._parent.gotoAndPlay("n");
this._parent.txt._y = this._parent.txt._y - 1;
};
}
var T = "O";
var F = null;
var sx = 0;
var sy = -2;
}
Symbol 698 MovieClip [__Packages.GameClasses.Books] Frame 0
class GameClasses.Books extends MovieClip
{
var bl, BookL_clip, attachMovie, createEmptyMovieClip, BOOK, Book_clip, CurrOpened, CurrCard, Arr3, p2, p1, NextI, note, Note_clip, STR, Button_clip, playb, downloadb, Show, Image_clip, DD1, Image_clipN, DDN1, DDN2, CurrText;
function Books () {
super();
bl = _root.GetBlack(this, 0, 1);
bl._visible = false;
BookL_clip = attachMovie("book_e", "BookL_clip", 10, {_x:69, _y:25});
createEmptyMovieClip("Note_clip", 19);
createEmptyMovieClip("Book_clip", 9);
BOOK = new GameClasses.Book(Book_clip, this);
if (_root.GameLevel == 0) {
_root.Hint(34);
BookL_clip.lock._visible = true;
} else {
BookL_clip.lock._visible = false;
ShowBook();
if (_root.GameLevel >= 6) {
Book_clip.onPress = GameClasses.GFunctions.create(BOOK, BOOK.Move);
}
}
if (_root.GameLevel == 1) {
_root.Hint(33);
BookL_clip.lock._visible = true;
BookL_clip.lock.onEnterFrame = function () {
if (this._currentframe < this._totalframes) {
this.gotoAndStop(this._currentframe + 1);
} else {
delete this.onEnterFrame;
}
};
}
var _local5 = Math.max(0, Math.floor((_root.GameLevel - 2) / 5));
var _local6 = "card" + _local5;
CurrOpened = (CurrCard = _local5);
if (_root.ArrBook4 == undefined) {
_root.ArrBook4 = new Array();
_root.ArrBookm4 = new Array();
InitText(_root.TextBook0.text);
InitText(_root.TextBook1.text);
InitText(_root.TextBook2.text);
InitText(_root.TextBook3.text);
}
var _local4 = 0;
while (_local4 < 4) {
if ((_local4 > CurrCard) || (_root.GameLevel == 0)) {
this["ppp" + _local4]._visible = false;
} else {
this["ppp" + _local4]._visible = true;
this["ppp" + _local4].onPress = GameClasses.GFunctions.create(this, OpenBookMark, _local4);
}
_local4++;
}
delete this["ppp" + CurrCard].onPress;
Arr3 = _root.ArrBook4[_local5];
TypeText(p2.p.p, p1.p.p, null, _local6, NextI);
p2.p.p.attachMovie("book_button", "b", 99, {_x:250, _y:348, _xscale:107, _yscale:115});
note = new GameClasses.Notebook(Note_clip, 250, 350, 1, 1);
TypeNoteText(Note_clip.p2, Note_clip.p1, STR, _local6, NextI);
Button_clip = attachMovie("book_button", "button_play", 95, {_x:515, _y:350});
Note_clip._visible = false;
Button_clip._visible = false;
playb.onPress = _root.SetLevel;
downloadb.onPress = _root.FunctionDownload;
downloadb.swapDepths(4);
Button_clip.playb.onPress = _root.SetLevel;
playb.onLoad = function () {
this.InitText(_root.TextPlay.text);
};
downloadb.onLoad = function () {
this.InitText(_root.TextDownload.text);
};
Button_clip.playb.onLoad = function () {
this.InitText(_root.TextPlay.text);
};
p2.p.p.b.playb.onLoad = function () {
this.InitText(_root.TextPlay.text);
};
p2.p.p.b.onPress = null;
p2.p.p.b.useHandCursor = false;
NextI = (_root.GameLevel - 2) % 5;
if (NextI < 0) {
NextI = 0;
}
SetText(NextI);
SetNoteText(NextI);
if (Open_Book) {
BOOK.Opened();
BookL_clip._visible = false;
}
InitBookmarks(_local5);
Note_clip["b" + CurrCard].swapDepths(1000);
}
function InitBookmarks(N) {
var _local2 = 0;
while (_local2 < 4) {
var _local3 = Note_clip.attachMovie("bookmark", "b" + _local2, _local2, {_x:((N < _local2) ? -200 : -245), _y:(_local2 * 80) + 20});
_local3.b.gotoAndStop(_local2 + 1);
if (_local2 <= CurrCard) {
_local3.onPress = GameClasses.GFunctions.create(this, OpenMark, _local2);
}
_local2++;
}
}
function OpenBookMark(N) {
OpenMark(N);
MoveBook();
}
function OpenMark(N) {
var _local5;
var _local3;
if (N != CurrOpened) {
if (N == CurrCard) {
_local3 = NextI;
_local5 = 5;
} else if (CurrOpened == CurrCard) {
_local5 = NextI;
_local3 = 5;
} else {
_local5 = 5;
_local3 = 5;
}
PrintNoteText(Note_clip.p4, Note_clip.p3, _root.ArrBook4[N][5 - _local3], "card" + N, _local3);
PrintNoteText(Note_clip.p2, Note_clip.p1, _root.ArrBook4[CurrOpened][5 - _local5], "card" + CurrOpened, _local5);
TypeText(p2.p.p, p1.p.p, _root.ArrBook4[N][5 - _local3], "card" + N, _local3 - 1);
Note_clip["b" + CurrOpened].swapDepths(CurrOpened);
Prints(Note_clip.p2.Text_clip2, _root["TextLevel" + CurrOpened].text);
CurrOpened = N;
Prints(Note_clip.p4.Text_clip2, _root["TextLevel" + CurrOpened].text);
Note_clip["b" + CurrOpened].swapDepths(1000);
note.Open(1, 1);
Block();
}
}
function ShowBook() {
bl._visible = false;
BookL_clip._visible = true;
BookL_clip.book.onPress = GameClasses.GFunctions.create(this, MoveBook);
BookL_clip.book.onRollOver = function () {
if ((this._currentframe == 1) || (this._currentframe == 60)) {
this.gotoAndPlay(2);
} else {
this.gotoAndPlay((this._totalframes - this._currentframe) + 1);
}
};
BookL_clip.book.onRollOut = (BookL_clip.book.onReleaseOutside = (BookL_clip.book.onRelease = function () {
this.gotoAndPlay((this._totalframes - this._currentframe) + 1);
}));
}
function MoveBook() {
BookL_clip._visible = false;
BOOK.Move();
bl._visible = true;
Block();
}
function SwitchBlack() {
bl.A = bl._alpha;
bl.onEnterFrame = function () {
var _local2 = ((this.A > 20) ? -1 : 1);
this._alpha = this._alpha + _local2;
if (((_local2 > 0) && (this._alpha > 30)) || ((_local2 < 0) && (this._alpha < 0))) {
delete this.onEnterFrame;
}
};
}
function ShowNote() {
bl._visible = true;
bl._alpha = 30;
Opened();
Note_clip._xscale = Book_clip.suc._xscale + 9;
Note_clip._yscale = Book_clip.suc._yscale + 1;
Note_clip._x = 274;
Note_clip._visible = true;
Button_clip._visible = true;
Note_clip._y = 43;
var _local2 = 0;
while (_local2 <= CurrCard) {
Note_clip["b" + _local2].swapDepths(_local2);
Note_clip["b" + _local2]._x = -220;
Note_clip["b" + _local2].CC = CurrOpened;
Note_clip["b" + _local2].ii = _local2;
Note_clip["b" + _local2].onEnterFrame = function () {
if (this._x <= -245) {
delete this.onEnterFrame;
if (this.CC == this.ii) {
this.swapDepths(1000);
}
} else {
this._x = this._x - 1;
}
};
_local2++;
}
}
function Opened() {
Show = int(_root.Slides_Arr[_root.GameLevel]);
_root.Slides_Arr[_root.GameLevel] = 1;
if (_root.GameLevel == 1) {
_root.Hint(24);
} else if (_root.GameLevel == 2) {
_root.Hint(27);
}
if ((NextI < 5) && (!Show)) {
ChangeText(NextI++);
SetText(NextI);
}
}
function UnShowNote() {
Block();
_root.FromHint();
SwitchBlack();
Button_clip._visible = false;
Note_clip._visible = false;
}
function M(c) {
if (c > 3) {
c = 3;
}
return("m" + int(c + 2));
}
function InitText(STR) {
var _local6 = [STR.length];
Arr3 = [];
Arr3[0] = STR;
var _local3 = 0;
while (_local3 < STR.length) {
_local6[_local3] = 0;
_local3++;
}
var _local5 = new Array(5);
_local3 = 0;
while (_local3 < 5) {
_local5[_local3] = new Array();
_local3++;
}
var _local7 = (STR.length - STR.split(" ").length) - STR.split("|").length;
STR = GetNextString(STR, 0, _local7 / 11, _local6, _local5[4]);
Arr3.push(STR);
STR = GetNextString(STR, 0, _local7 / 11, _local6, _local5[3]);
Arr3.push(STR);
STR = GetNextString(STR, 0, _local7 / 11, _local6, _local5[2]);
Arr3.push(STR);
STR = GetNextString(STR, 0, _local7 / 11, _local6, _local5[1]);
Arr3.push(STR);
STR = GetNextString(STR, 0, _local7 / 11, _local6, _local5[0]);
Arr3.push(STR);
_root.ArrBook4.push(Arr3);
_root.ArrBookm4.push(_local5);
}
function TypeText(MC1, MC2, STR, PIC, c) {
var _local3 = MC1.createEmptyMovieClip("Text_clip", 11);
var _local4 = MC1.createEmptyMovieClip("Text_clip", 111);
Image_clip = MC2.attachMovie(PIC, "c", 2);
Image_clip.gotoAndStop(M(c));
_local4._xscale = (_local4._yscale = (_local3._xscale = (_local3._yscale = (Image_clip._xscale = (Image_clip._yscale = 115)))));
_local3._x = _local3._x + 125;
_local3._y = _local3._y + 70;
_local4._x = _local4._x + 125;
_local4._y = _local4._y + 40;
Image_clip._x = 33;
Image_clip._y = 38;
DD1 = _local3.createEmptyMovieClip("DD1", 19);
if (STR == null) {
SetText(c);
} else {
Prints(_local3, STR);
}
Prints(_local4, _root["TextLevel" + CurrOpened].text);
}
function TypeNoteText(MC1, MC2, STR, PIC, c) {
var _local3 = MC1.createEmptyMovieClip("Text_clip", 11);
var _local4 = MC1.createEmptyMovieClip("Text_clip2", 111);
var _local5 = Note_clip.p4.createEmptyMovieClip("Text_clip2", 111);
Image_clipN = MC2.attachMovie(PIC, "c", 2);
Image_clipN.gotoAndStop(M(c));
_local5._xscale = (_local5._yscale = (_local4._xscale = (_local4._yscale = (_local3._xscale = (_local3._yscale = (Image_clipN._xscale = (Image_clipN._yscale = 115)))))));
_local3._x = _local3._x + 125;
_local3._y = _local3._y + 70;
_local4._x = _local4._x + 125;
_local4._y = _local4._y + 40;
_local5._x = _local5._x + 125;
_local5._y = _local5._y + 40;
Image_clipN._x = 33;
Image_clipN._y = 38;
DDN1 = _local3.createEmptyMovieClip("DDN1", 19);
DDN2 = _local3.createEmptyMovieClip("DDN2", 18);
SetNoteText(c);
Prints(_local4, _root["TextLevel" + CurrOpened].text);
}
function GetLetterText(MC, n) {
return(MC.TEXT[MC.TEXT.Arr[n]]);
}
function ChangeText(N) {
Block(4000);
_root.AddNewText_s.start(_root.SoundOn);
if (N < 5) {
Image_clipN.gotoAndPlay(M(N - 1));
Image_clipN.END = Image_clipN._currentframe + 65;
Image_clipN.onEnterFrame = function () {
if (this._currentframe == this.END) {
delete this.onEnterFrame;
} else {
this.gotoAndStop(this._currentframe + 1);
}
};
Image_clip.gotoAndStop(M(N));
DDN1._alpha = 0;
DDN2._alpha = 100;
DDN1.ttt = this;
DDN1.time = getTimer();
for (var _local5 in _root.ArrBookm4[CurrCard][N]) {
var _local3 = GetLetterText(DDN2, _root.ArrBookm4[CurrCard][N][_local5]);
_local3.X = _local3._x;
_local3.Y = _local3._y;
_local3.time = getTimer();
_local3.onEnterFrame = function () {
var _local2 = (getTimer() - this.time) / 40;
this._x = this.X + ((random(3) - 1) / 2);
this._y = this.Y + ((random(3) - 1) / 2);
if (_local2 >= 100) {
this._x = this.X;
this._y = this.Y;
delete this.onEnterFrame;
}
};
_local3 = GetLetterText(DDN1, _root.ArrBookm4[CurrCard][N][_local5]);
_local3.X = _local3._x;
_local3.Y = _local3._y;
_local3.time = getTimer();
_local3.onEnterFrame = function () {
var _local2 = (getTimer() - this.time) / 40;
this._x = this.X + ((random(3) - 1) / 4);
this._y = this.Y + ((random(3) - 1) / 4);
if (_local2 >= 100) {
this._x = this.X;
this._y = this.Y;
delete this.onEnterFrame;
}
};
}
DDN1.onEnterFrame = function () {
var _local3 = (getTimer() - this.time) / 40;
this._alpha = _local3;
this._parent.DDN2._alpha = 100 - _local3;
if (this._alpha >= 100) {
this.TEXT._x = 0;
this.TEXT._y = 0;
delete this.onEnterFrame;
this._parent.DDN2._alpha = 0;
if (this.ttt.NextI == 5) {
this.ttt.OpenNextMark();
_root.Hint(23);
} else if (this.ttt.NextI == 4) {
_root.Hint(22);
}
if (_root.GameLevel == 7) {
_root.Hint(42);
}
}
};
}
}
function OpenNextMark() {
this["ppp" + CurrCard].onPress = GameClasses.GFunctions.create(this, OpenBookMark, CurrCard);
var _local3 = ++CurrCard;
Note_clip["b" + CurrCard].onPress = GameClasses.GFunctions.create(this, OpenMark, CurrCard);
if (_local3 == 4) {
_root.Hint(26);
}
NextI = 0;
this["ppp" + CurrCard]._visible = true;
delete this["ppp" + CurrCard].onPress;
Note_clip["b" + _local3]._x = -220;
Note_clip["b" + _local3].onEnterFrame = function () {
if (this._x <= -245) {
delete this.onEnterFrame;
} else {
this._x = this._x - 1;
}
};
}
function GetNextString(STR, k1, k2, Arr2, ARRR) {
var _local6 = k1;
while (_local6 < k2) {
var _local1 = random(STR.length);
var _local3 = 0;
while ((Arr2[_local1] || (STR.substr(_local1, 1) == "|")) || (STR.substr(_local1, 1).charCodeAt() < 64)) {
_local1++;
if (_local1 >= STR.length) {
_local1 = 0;
}
_local3++;
if (_local3 >= STR.length) {
trace(">");
break;
}
}
Arr2[_local1] = 1;
var _local2 = random(STR.length);
_local3 = 0;
while ((Arr2[_local2] || (STR.substr(_local2, 1) == "|")) || (STR.substr(_local2, 1).charCodeAt() < 64)) {
_local2++;
if (_local2 >= STR.length) {
_local2 = 0;
}
_local3++;
if (_local3 >= STR.length) {
trace(">m");
break;
}
}
Arr2[_local2] = 1;
ARRR.push(_local1);
ARRR.push(_local2);
var _local8 = STR.substr(_local1, 1);
var _local7 = STR.substr(_local2, 1);
STR = (STR.substr(0, _local1) + _local7) + STR.substr(_local1 + 1, 500);
STR = (STR.substr(0, _local2) + _local8) + STR.substr(_local2 + 1, 500);
_local6++;
}
return(STR);
}
function SetText(c) {
if (c <= 5) {
Prints(DD1, Arr3[5 - c]);
CurrText = Arr3[5 - c];
}
}
function SetNoteText(c) {
if (c < 5) {
Prints(DDN1, Arr3[5 - (c + 1)]);
Prints(DDN2, Arr3[5 - c]);
DDN1._alpha = 0;
DDN2._alpha = 100;
}
}
function Prints(MC, STR) {
_root.TextShow(MC, STR, "GameFont", -3, 15, 1, 18, 6697728, 200);
}
function PrintNoteText(MC1, MC2, T, P, c) {
var _local2 = MC1.createEmptyMovieClip("Text", 11);
var _local3 = MC2.attachMovie(P, "c", 2);
_local3.gotoAndStop(M(c - 1));
_local2._xscale = (_local2._yscale = (_local3._xscale = (_local3._yscale = 115)));
_local2._x = _local2._x + 125;
_local2._y = _local2._y + 70;
_local3._x = 33;
_local3._y = 38;
Prints(_local2, T);
}
function Block(N) {
if (!N) {
N = 2000;
}
var _local3 = _root.GetBlack(this, 0, 99, "bbbblll");
_local3.T = getTimer() + N;
_local3.onEnterFrame = function () {
if (getTimer() > this.T) {
this.removeMovieClip();
}
};
}
var Open_Book = false;
}
Symbol 699 MovieClip [__Packages.GameClasses.Book] Frame 0
class GameClasses.Book
{
var THIS, suc, v, f, ft, l, m, spax, spay, spaz, spaxx, spX, spY, spasc, spx, moving;
function Book (MC, p1) {
THIS = p1;
suc = MC.createEmptyMovieClip("suc", 0);
suc._x = 260;
suc._y = 250;
suc.createEmptyMovieClip("a", 2);
suc.createEmptyMovieClip("n", 9);
suc.createEmptyMovieClip("b", 4);
v = [0, 0, 0, -175, 0, 45, -175, 273, 45, 175, 0, 45, 175, 273, 45, -175, 0, 0, -175, 273, 0, 175, 0, 0, 173, 273, 0, -175, 0, -2, 175, 0, -2];
f = [1, 2, 3, 6, 5, 8, 9, 1, 10, 2, 6, 4, 6, 2, 5, 4, 8, 3];
ft = ["front_3d", "list_left_3d", "kor_r_3d", "pages_lo_3d", "pages_so_3d", "pages_so2_3d"];
l = new GameClasses.Figure3D(suc.a, v, f, ft);
f = [4, 3, 2, 7, 8, 5, 3, 10, 1, 2, 6, 4, 6, 2, 5, 4, 8, 3];
ft = ["back_3d", "list_right_3d", "kor_l_3d", "pages_lo_3d", "pages_so_3d", "pages_so2_3d"];
m = new GameClasses.Figure3D(suc.b, v, f, ft);
InitSplines();
DRAW();
p1.p1 = suc.a.list_left_3d1;
p1.p2 = suc.b.list_right_3d1;
}
function KeyMove() {
OK.onKeyDown = GameClasses.GFunctions.create(this, KeyControl);
Key.addListener(OK);
}
function InitSplines() {
spax = new Spline(0, 90, 180, 270, 360, 450);
spay = new Spline(-180, -180, -170, -170, -170, -180);
spaz = new Spline(-90, -90, -90, -100, -90, -90);
spaxx = new Spline(0, 0, 0, 2, 5, 90);
spX = new Spline(130, 200, 300, 300, 300, 300, 275);
spY = new Spline(100, 150, 150, 150, 160, 180, 195);
spasc = new Spline();
spx = new Spline();
var _local3 = 0;
while (_local3 < 6) {
spasc.addKey(42 + (_local3 * 9));
var _local2 = Math.cos(((_local3 * 90) * Math.PI) / 180);
if ((Math.abs(_local2) > 0.05) && (_local3 < 5)) {
_local2 = _local2 / (-Math.abs(_local2));
} else {
_local2 = 0;
}
_local2 = _local2 * ((273 * (45 + (_local3 * 5))) / 200);
spx.addKey(_local2);
_local3++;
}
spx.Calculate();
spasc.Calculate();
suc._xscale = (suc._yscale = spasc.getPoint(0));
suc._x = spX.getPoint(0) + spx.getPoint(0);
suc._y = spY.getPoint(0);
}
function Opened() {
var _local2 = 1;
forward = true;
ax0 = spax.getPoint(_local2);
ay0 = spay.getPoint(_local2);
az0 = spaz.getPoint(_local2);
axx = spaxx.getPoint(_local2);
suc._xscale = (suc._yscale = spasc.getPoint(_local2));
suc._x = spx.getPoint(_local2) + spX.getPoint(_local2);
suc._y = spY.getPoint(_local2);
DRAW();
THIS.ShowNote();
}
function Move() {
_root.FlyAndOpenBook_s.start(_root.SoundOn);
THIS.UnShowNote();
forward = !forward;
clearInterval(moving);
moving = setInterval(GameClasses.GFunctions.create(this, Moving, getTimer()), 0);
}
function Moving(T) {
var _local2 = (getTimer() - T) / 1500;
if (_local2 >= 1) {
_local2 = 1;
clearInterval(moving);
if (forward) {
THIS.ShowNote();
} else {
THIS.ShowBook();
}
}
if (!forward) {
_local2 = 1 - _local2;
}
ax0 = spax.getPoint(_local2);
ay0 = spay.getPoint(_local2);
az0 = spaz.getPoint(_local2);
axx = spaxx.getPoint(_local2);
suc._xscale = (suc._yscale = spasc.getPoint(_local2));
suc._x = spx.getPoint(_local2) + spX.getPoint(_local2);
suc._y = spY.getPoint(_local2);
DRAW();
}
function DRAW() {
ax0 = ax0 % 360;
ay0 = ay0 % 360;
az0 = az0 % 360;
l.Draw(((ax0 + axx) * Math.PI) / 180, (ay0 * Math.PI) / 180, (az0 * Math.PI) / 180);
m.Draw((((-ax0) + axx) * Math.PI) / 180, ((ay0 * Math.PI) / 180) + Math.PI, (az0 * Math.PI) / 180);
SWAP();
}
function SWAP() {
if ((suc.a.front_3d0._visible == true) && (vis)) {
vis = false;
suc.a.swapDepths(suc.b);
}
if ((suc.a.front_3d0._visible == false) && (!vis)) {
vis = true;
suc.a.swapDepths(suc.b);
}
}
function KeyControl() {
if (Key.getAscii() == 100) {
trace((((((ax0 + " ") + ay0) + " ") + az0) + " ") + axx);
}
if (Key.isDown(37)) {
ay0 = ay0 - 2;
}
if (Key.isDown(39)) {
ay0 = ay0 + 2;
}
if (Key.isDown(36)) {
az0 = az0 - 2;
}
if (Key.isDown(35)) {
az0 = az0 + 2;
}
if (Key.isDown(38)) {
ax0 = ax0 + 2;
}
if (Key.isDown(40)) {
ax0 = ax0 - 2;
}
if (Key.isDown(16)) {
axx = axx + 2;
}
if (Key.isDown(17)) {
axx = axx - 2;
}
if (Key.isDown(33)) {
suc._xscale = suc._xscale + 5;
suc._yscale = suc._yscale + 5;
}
if (Key.isDown(34)) {
suc._xscale = suc._xscale - 5;
suc._yscale = suc._yscale - 5;
}
DRAW();
}
var forward = false;
var canclick = true;
var axx = 0;
var ax0 = 0;
var ay0 = -180;
var az0 = -90;
var vis = true;
var startx = 260;
var starty = 195;
var OK = {};
}
Symbol 700 MovieClip [__Packages.GameClasses.Figure3D] Frame 0
class GameClasses.Figure3D
{
var vertex, facet, textures, This, xe, ye, ze, rx, ry, xi, yi, zi, fa, fb, fc, facetc;
function Figure3D (mc, V, F, T, S) {
vertex = V;
facet = F;
textures = T;
This = mc;
Init();
Scale = S != true;
}
function Init() {
xd = 0;
yd = 0;
zd = 0;
xe = new Array();
ye = new Array();
ze = new Array();
rx = new Array();
ry = new Array();
xi = new Array();
yi = new Array();
zi = new Array();
var _local2 = 0;
while (_local2 < (vertex.length / 3)) {
xi[_local2] = vertex[_local2 * 3];
yi[_local2] = vertex[(_local2 * 3) + 1];
zi[_local2] = vertex[(_local2 * 3) + 2];
_local2++;
}
fa = new Array();
fb = new Array();
fc = new Array();
facetc = new Array(facet.length);
_local2 = 0;
while (_local2 < (facet.length / 3)) {
fa[_local2] = facet[_local2 * 3];
fb[_local2] = facet[(_local2 * 3) + 1];
fc[_local2] = facet[(_local2 * 3) + 2];
var _local4 = textures[_local2] + _local2;
This[_local4].removeMovieClip();
This.attachMovie("poly", _local4, _local2);
var _local3 = This[_local4].p.attachMovie(textures[_local2], "p", 10);
var _local5 = {};
_local5.x = (_local3._width + _local3.getBounds().xMin) / 100;
_local5.y = (_local3._height + _local3.getBounds().yMin) / 100;
facetc[_local2] = _local5;
This[_local4]._visible = 0;
_local2++;
}
}
function Rotate(ax, ay, az) {
var _local5 = new Array();
var _local4 = new Array();
var _local3 = new Array();
var _local9 = Math.sin(ax);
var _local11 = Math.cos(ax);
var _local7 = Math.sin(ay);
var _local10 = Math.cos(ay);
var _local6 = Math.sin(az);
var _local8 = Math.cos(az);
var _local2 = 0;
while (_local2 < (vertex.length / 3)) {
_local4[_local2] = (yi[_local2] * _local11) - (zi[_local2] * _local9);
_local3[_local2] = (yi[_local2] * _local9) + (zi[_local2] * _local11);
_local5[_local2] = (xi[_local2] * _local10) + (_local3[_local2] * _local7);
ze[_local2] = (_local3[_local2] * _local10) - (xi[_local2] * _local7);
xe[_local2] = (_local5[_local2] * _local8) - (_local4[_local2] * _local6);
ye[_local2] = (_local5[_local2] * _local6) + (_local4[_local2] * _local8);
_local2++;
}
Focus();
}
function Draw(ax, ay, az) {
Rotate(ax, ay, az);
var sort = new Array();
var i = 0;
while (i < (facet.length / 3)) {
var xx = rx[fa[i]];
var yy = ry[fa[i]];
var nm = (textures[i] + i);
var dx = (xx - rx[fb[i]]);
var dy = (yy - ry[fb[i]]);
var dx1 = (xx - rx[fc[i]]);
var dy1 = (yy - ry[fc[i]]);
var a2 = (1024 + (kP * Math.atan2(dy1, dx1)));
var a1 = ((3072 - (kP * Math.atan2(dy, dx))) + a2);
var f = int(4095 & (a1 + 1));
var P = This[nm].p.p;
var lx = Math.sqrt((dx * dx) + (dy * dy));
var ly = Math.sqrt((dx1 * dx1) + (dy1 * dy1));
if (Scale) {
lx = lx / facetc[i].x;
ly = ly / facetc[i].y;
}
if (f < 2049) {
with (This[nm]) {
_x = xx;
_y = yy;
_rotation = 0.087890625 * a2;
gotoAndStop(f);
P._x = -0.5;
P._y = -0.5;
P._yscale = ly + 1;
P._xscale = lx + 1;
_visible = 1;
}
} else {
This[nm]._visible = 0;
}
sort.push({z:(ze[fa[i]] + ze[fb[i]]) + ze[fc[i]], f:nm});
i++;
}
sort.sortOn("z", 18);
var i = 0;
while (i < ((facet.length / 3) - 5)) {
This[sort[i].f].swapDepths(i);
i++;
}
}
function Focus() {
var _local2 = 0;
while (_local2 < (vertex.length / 3)) {
var _local3 = 1;
rx[_local2] = (xe[_local2] + xd) * _local3;
ry[_local2] = (ye[_local2] + yd) * _local3;
_local2++;
}
}
var kP = 651.898646904403;
var Foc = 10000;
var K = 10;
var xd = 0;
var yd = 0;
var zd = 0;
var Scale = false;
}
Symbol 701 MovieClip [__Packages.Spline] Frame 0
class Spline
{
var keys;
function Spline () {
keys = new Array();
if (arguments.length > 0) {
InitSpline(arguments);
}
}
function GetKeys() {
return(keys);
}
function addKey(key) {
var _local2 = new Array(2);
_local2[0] = key;
_local2[1] = key;
keys.push(_local2);
}
function getFrame(i, t) {
return(SplineInterpolation(keys[i][0], keys[i + 1][0], keys[i][1], keys[i + 1][1], t));
}
function getGradient(i, t) {
return(GetGradient(keys[i][0], keys[i + 1][0], keys[i][1], keys[i + 1][1], t));
}
function getPoint(t) {
var _local3 = 1 / getSectors();
var _local2 = Math.floor(t / _local3);
if (_local2 >= getSectors()) {
return(keys[keys.length - 1][0]);
}
var _local4 = (t - (_local2 * _local3)) / _local3;
return(getFrame(_local2, _local4));
}
function getGlobalGradient(t) {
var _local3 = 1 / getSectors();
var _local2 = Math.floor(t / _local3);
if (_local2 >= getSectors()) {
return(keys[keys.length - 1][0]);
}
var _local4 = (t - (_local2 * _local3)) / _local3;
return(getGradient(_local2, _local4));
}
function getSectors() {
return(keys.length - 1);
}
function Calculate(cycled) {
if (cycled) {
keys.push(keys[0]);
}
var _local3;
var _local5;
var _local4;
if (cycled) {
_local3 = keys[0][0] - keys[keys.length - 2][0];
_local5 = keys[1][0] - keys[0][0];
_local4 = _local5 - _local3;
keys[0][1] = _local3 + (0.5 * _local4);
keys[keys.length - 1][1] = keys[0][1];
} else if (keys.length > 1) {
keys[0][1] = keys[1][0] - keys[0][0];
keys[keys.length - 1][1] = keys[keys.length - 1][0] - keys[keys.length - 2][0];
}
var _local2 = 1;
while (_local2 < (keys.length - 1)) {
_local3 = keys[_local2][0] - keys[_local2 - 1][0];
_local5 = keys[_local2 + 1][0] - keys[_local2][0];
_local4 = _local5 - _local3;
keys[_local2][1] = _local3 + (0.5 * _local4);
_local2++;
}
}
function SplineInterpolation(x1, x2, r1, r2, t) {
var _local1 = t * t;
var _local2 = _local1 * t;
var _local4 = (((x1 * (((2 * _local2) - (3 * _local1)) + 1)) + (r1 * ((_local2 - (2 * _local1)) + t))) + (x2 * ((-2 * _local2) + (3 * _local1)))) + (r2 * (_local2 - _local1));
return(_local4);
}
function GetGradient(x1, x2, r1, r2, t) {
var _local2 = t * t;
var _local3 = ((((6 * x1) * (_local2 - t)) + (r1 * (((3 * _local2) - (4 * t)) + 1))) + ((6 * x2) * (t - _local2))) + (r2 * ((3 * _local2) - (2 * t)));
return(_local3);
}
function InitSpline(A) {
var _local2 = 0;
while (_local2 < A.length) {
addKey(A[_local2]);
_local2++;
}
Calculate();
}
}
Symbol 702 MovieClip [__Packages.GameClasses.Notebook] Frame 0
class GameClasses.Notebook
{
var MC, W, H, Msx, Msy, Mlx, Mly, Mx, My, xd, yd, x1, y1, BookTexts, moving;
function Notebook (MC, w, h, BookTexts, l) {
this.MC = MC;
Init(w, h);
if (l) {
InitB();
}
InitPages(BookTexts);
}
function Init(w, h) {
W = w;
H = h;
MC.attachMovie("p1", "p1", 9, {_x:-W});
MC.attachMovie("p4", "p4", 10);
MC.attachMovie("p3", "p3", 40, {_x:W});
MC.attachMovie("p2", "p2", 20);
MC.attachMovie("l", "l", 30, {_x:W, _y:H});
MC.p2.l._width = (MC.p3.l._width = 1);
MC.p2.l._height = (MC.p3.l._height = 1);
MC.l.l._x = (MC.l.ll._x = (-W) * 2.5);
MC.l.l._y = (MC.l.ll._y = (MC.b._y = (MC.w._y = (-H) * 1.5)));
MC.l.l._width = (MC.l.ll._width = W * 2.5);
MC.l.l._height = (MC.l.ll._height = H * 3);
MC.p3.setMask(MC.l.l);
MC.p2.setMask(MC.l.ll);
MC.w.setMask(MC.p3.l);
MC.b.setMask(MC.p2.l);
}
function Initt(c) {
MC.w.removeMovieClip();
MC.b.removeMovieClip();
MC.attachMovie("whiteline", "w", 41);
MC.attachMovie("blackline", "b", 21);
MC.w.setMask(MC.p3.l);
MC.b.setMask(MC.p2.l);
MC.p2.l._width = (MC.p3.l._width = W);
MC.p2.l._height = (MC.p3.l._height = H);
MC.b._height = (MC.w._height = H * 3);
if (c == "d") {
MC.p2._x = 0;
MC.p3._x = W;
MC.l._x = W;
MC.l._rotation = 0;
MC.b._x = -1000;
Msx = 0;
Msy = H;
Mlx = 0;
Mly = 0;
Mx = W;
My = H;
} else if (c == "u") {
MC.p2._x = 0;
MC.p3._x = W;
MC.l._x = W;
MC.l._rotation = 0;
Msx = 0;
Msy = 0;
Mlx = 0;
Mly = H;
Mx = W;
My = 0;
} else if (c == "U") {
MC.p3._x = -2 * W;
MC.p2._x = -W;
MC.l._x = -W;
MC.l._rotation = 180;
Msx = 0;
Msy = 0;
Mlx = 0;
Mly = H;
Mx = -W;
My = 0;
} else if (c == "D") {
MC.p3._x = -2 * W;
MC.p2._x = -W;
MC.l._x = -W;
MC.l._rotation = 180;
MC.b._x = -1000;
Msx = 0;
Msy = H;
Mlx = 0;
Mly = 0;
Mx = -W;
My = H;
}
xd = Mx;
yd = My;
x1 = Mx;
y1 = My;
}
function D(x1, x2, y1, y2) {
return(Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2)));
}
function Calll(c, x, y) {
if (x == undefined) {
x1 = MC[c]._x;
y1 = MC[c]._y;
} else {
x1 = x;
y1 = y;
}
var _local5 = D(x1, Msx, y1, Msy);
if (_local5 > W) {
x1 = Msx + (((x1 - Msx) * W) / _local5);
y1 = Msy + (((y1 - Msy) * W) / _local5);
}
_local5 = D(x1, Mlx, y1, Mly);
var _local3 = D(W, 0, H, 0);
if (_local5 > _local3) {
x1 = Mlx + (((x1 - Mlx) * _local3) / _local5);
y1 = Mly + (((y1 - Mly) * _local3) / _local5);
}
var _local7 = Mx;
var _local6 = My;
var _local9 = (x1 + _local7) / 2;
var _local8 = (y1 + _local6) / 2;
MC.l._x = (MC.b._x = (MC.w._x = _local9));
MC.l._y = (MC.b._y = (MC.w._y = _local8));
var _local2 = Math.atan2(_local6 - y1, _local7 - x1);
if (c == "d") {
MC.p3._x = x1 + (H * Math.sin(2 * _local2));
MC.p3._y = y1 - (H * Math.cos(2 * _local2));
} else if (c == "u") {
MC.p3._x = x1;
MC.p3._y = y1;
} else if (c == "U") {
if (_local2 == 0) {
_local2 = Math.PI;
}
MC.p3._x = x1 - (W * Math.cos(2 * _local2));
MC.p3._y = y1 - (W * Math.sin(2 * _local2));
} else if (c == "D") {
if (_local2 == 0) {
_local2 = Math.PI;
}
MC.p3._x = x1 + (_local3 * Math.sin((2 * _local2) - Math.atan(W / H)));
MC.p3._y = y1 - (_local3 * Math.cos((2 * _local2) - Math.atan(W / H)));
}
_local2 = _local2 * 57.2957795130823;
MC.l._rotation = (MC.b._rotation = (MC.w._rotation = _local2));
MC.p3._rotation = 2 * _local2;
}
function InitPages(BookTexts) {
for (var _local3 in BookTexts) {
MC[_local3].TEXT.removeMovieClip();
MC[_local3].TEXT1.removeMovieClip();
MC[_local3].TEXT2.removeMovieClip();
if (BookTexts[_local3].value.length < 10) {
AttachArt(MC[_local3], BookTexts[_local3].value);
} else {
AttachText(MC[_local3], BookTexts[_local3].value, BookTexts[_local3].s, BookTexts[_local3].d);
}
}
}
function Open(BookTexts, dir) {
_root.ListingPage_s.start(_root.SoundOn);
this.BookTexts = BookTexts;
InitPages(BookTexts);
var _local3 = new Spline();
_local3.addKey(H);
_local3.addKey(H * 0.75);
_local3.addKey(H);
_local3.Calculate();
var _local4 = getTimer();
var _local5 = 1500;
if (dir) {
Initt("d");
} else {
Initt("D");
}
notOpening = false;
MC.onEnterFrame = GameClasses.GFunctions.create(this, Move, _local4, _local5, _local3, dir);
}
function Move(T, TT, MS, dir) {
var _local3 = getTimer();
var _local2 = 1;
if (_local3 >= (T + TT)) {
_local2 = 1;
delete MC.onEnterFrame;
ResetImage();
} else {
_local2 = (_local3 - T) / TT;
}
if (dir) {
Calll("d", W - ((2 * W) * _local2), MS.getPoint(_local2));
} else {
Calll("D", (-W) + ((2 * W) * _local2), MS.getPoint(_local2));
}
}
function ResetImage() {
MC._parent.Opened();
notOpening = true;
MC.p2.l._width = (MC.p3.l._width = 1);
MC.p2.l._height = (MC.p3.l._height = 1);
MC.w.removeMovieClip();
MC.b.removeMovieClip();
}
function InitB() {
}
function AttachText(MC, Text, show, pa) {
TypeText(MC, Text, show, pa);
}
function AttachArt(MC, Str) {
MC.createEmptyMovieClip("TEXT", 0);
MC.TEXT.a.removeMovieClip();
var _local2 = MC.TEXT.attachMovie(Str, "a", 0);
}
function TypeText(MC, arttext, show, pa) {
var _local8 = 5;
MC.TEXT1.removeMovieClip();
MC.TEXT2.removeMovieClip();
var _local3 = 0;
if (pa.p == 2) {
var _local6 = MC.createEmptyMovieClip("TEXT1", MC.getNextHighestDepth());
_local3 = _local3 + (TypeText2(_local6, pa.t, 0, pa) + 10);
_local6 = MC.createEmptyMovieClip("TEXT2", MC.getNextHighestDepth());
_local6._y = _local3;
_local3 = _local3 + TypeText2(_local6, arttext, show, pa);
} else if (pa.p == 1) {
var _local6 = MC.createEmptyMovieClip("TEXT1", MC.getNextHighestDepth());
_local3 = _local3 + TypeText2(_local6, arttext, show);
_local6 = MC.createEmptyMovieClip("TEXT2", MC.getNextHighestDepth());
_local6._alpha = 0;
_local6._y = _local3;
_local3 = _local3 + TypeText2(_local6, pa.t, 0, pa);
} else {
var _local6 = MC.createEmptyMovieClip("TEXT1", MC.getNextHighestDepth());
_local3 = _local3 + TypeText2(_local6, arttext, show, pa);
}
}
function TypeText2(MC, arttext, show, pa) {
var _local9 = 0;
arttext = arttext.split("|").join(newline);
var _local8 = W - 32;
MC._y = MC._y + 20;
MC._x = 10;
MC.createTextField("TEXT", MC.getNextHighestDepth(), 7, 0, 0, 0);
if (typeof(pa) == "number") {
_local8 = _local8 + 20;
MC._x = 0;
MC._y = MC._y + pa;
}
MC.TEXT.multiline = true;
MC.TEXT.embedFonts = true;
MC.TEXT.autoSize = "left";
MC.TEXT.selectable = false;
var _local7 = new TextFormat();
_local7.font = "GameFont";
_local7.size = 10;
_local7.leading = 0;
_local7.bold = true;
_local7.color = 7811857 /* 0x773311 */;
_local7.align = "left";
_local7.leftMargin = 0;
_local7.rightMargin = 0;
var _local4 = arttext.split(" ");
var _local5 = "";
MC.TEXT._visible = false;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local6 = (_local5 + " ") + _local4[_local2];
MC.TEXT.text = _local6;
MC.TEXT.setTextFormat(_local7);
if (MC.TEXT._width > _local8) {
_local5 = _local5 + (newline + _local4[_local2]);
} else {
_local5 = _local5 + (" " + _local4[_local2]);
}
_local2++;
}
MC.TEXT.text = _local5;
MC.TEXT.setTextFormat(_local7);
MC.TEXT._visible = true;
_local9 = MC._height;
if (show) {
notOpening = false;
MC.TEXT.text = "";
clearInterval(moving);
var _local10 = 0;
var _local11 = 8000;
moving = setInterval(GameClasses.GFunctions.create(this, TypeTextSlow, getTimer(), MC.TEXT, _local5, _local7, _local11), _local10);
}
return(_local9);
}
function TypeTextSlow(T, MC, Text, format, Time) {
var _local2 = (getTimer() - T) / Time;
notOpening = false;
if (_local2 >= 1) {
_local2 = 1;
clearInterval(moving);
notOpening = true;
}
var _local3 = Text.substr(0, int(_local2 * Text.length));
MC.text = _local3;
MC.setTextFormat(format);
}
var notOpening = true;
}
Symbol 703 MovieClip [__Packages.GameClasses.GameMenu] Frame 0
class GameClasses.GameMenu extends MovieClip
{
var buttons, head;
function GameMenu () {
super();
var _local6 = _root.menu_buttons;
var _local4 = 0;
while (_local4 < (_local6.length - 1)) {
var _local5 = buttons.attachMovie("button_shir_s", "b" + _local4, (_local4 * 3) + 1);
_local5._x = _local6[_local4].x;
_local5._y = _local6[_local4].y;
_local5.InitText(_local6[_local4].text, 0, -2, "GameFont", -2, 20, 1, 20, 16777215, 1000, 0);
_local5.InitFunction(_root["Function" + _local6[_local4].funct.substr(1, 100)]);
_local4++;
}
_root.TextShow(head, _root.TextMenu.text, "gradient", -2, 12, 1, 28, 0, 1000, 0, 16777215, 16776960, 90);
}
}
Symbol 704 MovieClip [__Packages.GameClasses.GameHint] Frame 0
class GameClasses.GameHint extends Object
{
var This, Text, X, Y, F1, F2, ramka, text, BLACK, b1, showt, b2, xs, ys;
function GameHint (This, Text, X, Y, F1, F2, K, M) {
super();
_root.blcup.removeMovieClip();
this.This = This;
this.Text = Text;
this.X = X;
this.Y = Y;
this.F1 = F1;
this.F2 = F2;
ramka = This.attachMovie("ramka_tip", "ramka", 10, {useHandCursor:false});
text = This.createEmptyMovieClip("text", 20);
_root.TextShow(text, Text, "GameFont", -3, 16, 1, 18, _root.FontWhite, 220, 0, 0, 0, 0, _root.BOLDFONT);
var _local19 = text._width;
var _local7 = text._height;
text._x = 125;
text._y = 20;
if (M != 1) {
BLACK = This.attachMovie("black", "BLACK", 0, {_x:-2000, _y:-2000, _width:4000, _height:4000, _alpha:0, useHandCursor:false});
b1 = This.attachMovie("button_uzk_s", "b1", 30);
if ((F2 == null) || (F2 == undefined)) {
BLACK.onPress = null;
clearInterval(showt);
showt = setInterval(GameClasses.GFunctions.create(this, BLclick), 2000);
b1.InitText(_root.TextOk.text);
b1._x = 125;
b1._y = _local7 + 23;
} else {
b2 = This.attachMovie("button_uzk_s", "b2", 40);
BLACK.onPress = null;
b1._x = 75;
b2._x = 185;
b1._y = (b2._y = _local7 + 23);
b1.InitText(_root.TextYes.text);
b2.InitText(_root.TextNo.text);
}
} else {
_local7 = _local7 - 25;
}
InitRamka(_local7 + 45);
b1.InitFunction(GameClasses.GFunctions.create(this, AGA));
b2.InitFunction(GameClasses.GFunctions.create(this, NEA));
This._x = X;
This._y = Y;
if ((This._y + ramka._height) > 450) {
This._y = 50;
}
var _local4 = ramka.fairy;
_local4.body.gotoAndStop(1);
_local4.head.gotoAndStop(2);
if (K < -3) {
_local4._x = _local4._x + 110;
_local4._xscale = -100;
K = K + 2;
}
if (K > 3) {
_local4._x = _local4._x + 110;
_local4._xscale = -100;
K = K - 2;
}
if (K < 0) {
ramka._xscale = -100;
ramka._x = ramka._x + 250;
}
var _local8 = Math.max(Math.abs(K), 1);
_local4.body.gotoAndStop(_local8);
if (_local8 > 1) {
_local4.head.ROT = 1;
}
_root.SetHint(3, 3, _local4.body.uk, 0, 0, 14, "shleif", 999999);
_root.MoveHint_s.start(_root.SoundOn);
}
function BLclick() {
clearInterval(showt);
BLACK.onPress = GameClasses.GFunctions.create(this, AGA);
}
function DeleteTip() {
clearInterval(showt);
GameClasses.GFunctions.ClearAll(This, 1, 1);
}
function AGA() {
DeleteTip();
F1();
}
function NEA() {
DeleteTip();
F2();
}
function InitRamka(y) {
y = y + 15;
y = Math.max(y, 99);
ramka.up._y = 0;
ramka.md._y = 19;
ramka.dw._y = y - 80;
ramka.md._height = Math.max(0, y - 99);
ramka.fairy._y = ramka.dw._y - 30;
}
function Follow() {
xs = This._x - _root._xmouse;
ys = This._y - _root._ymouse;
This.onEnterFrame = GameClasses.GFunctions.create(this, Moving);
}
function UnFollow() {
delete This.onEnterFrame;
trace((int(This._x - 160) + " ") + int(This._y - 100));
}
function Moving() {
This._x = _root._xmouse + xs;
This._y = _root._ymouse + ys;
}
}
Symbol 705 MovieClip [__Packages.GameClasses.Score] Frame 0
class GameClasses.Score
{
var ScoreText, scoring;
function Score (ScoreText, sc) {
this.ScoreText = ScoreText;
score = sc;
ScoreText._y = ScoreText._y + 2;
ScoreText._x = ScoreText._x - 1;
AddScore = 0;
ShowScore();
}
function ScoreAddScore(chk) {
var _local2 = 5;
if (chk == "y") {
_local2 = 20;
}
if (AddScore > 0) {
score = score + _local2;
AddScore = AddScore - _local2;
ShowScore();
} else {
clearInterval(scoring);
AddScore = 0;
}
}
function ShowScore() {
_root.TextShow(ScoreText, String(score), "Arial", -3, 0, 0, 12, 0, 1000, 13421772);
}
function Add(Score1, chk) {
AddScore = AddScore + Score1;
var _local2 = 10;
if (AddScore < 30) {
_local2 = 200;
} else if (AddScore < 100) {
_local2 = 20;
} else if (AddScore > 300) {
chk = "y";
}
clearInterval(scoring);
scoring = setInterval(GameClasses.GFunctions.create(this, ScoreAddScore, chk), _local2);
}
var score = 0;
var AddScore = 0;
}
Symbol 706 MovieClip [__Packages.GameClasses.GameSound] Frame 0
class GameClasses.GameSound extends Sound
{
var Nu, duration, CurrV;
function GameSound (s, MC) {
super(MC);
super.attachSound(s);
var _local3 = MC.createEmptyMovieClip(s, MC.getNextHighestDepth());
_local3.S = this;
_local3.onEnterFrame = function () {
if (this._name == "EnergyMove_s") {
if (this.S.CurrV < this.S.Volume) {
this.S.CurrV++;
this.S.setVolume(this.S.CurrV);
} else if (this.S.CurrV > this.S.Volume) {
this.S.CurrV--;
this.S.setVolume(this.S.CurrV);
}
}
if ((this.S.position <= 0) || (this.S.position >= this.S.duration)) {
this.S.Can = true;
}
};
}
function start(SoundOn, s, l) {
var _local3 = true;
_local3 = SoundOn && ((C == 1) || (Can));
if (_local3) {
Can = false;
super.start(s, l);
}
}
function startE() {
clearInterval(Nu);
Nu = setInterval(GameClasses.GFunctions.create(this, startE), duration - 100);
if (_root.SoundOn) {
if (!CurrV) {
CurrV = 0;
}
super.start();
}
}
function stop() {
clearInterval(Nu);
super.stop();
}
var C = 1;
var Can = true;
}
Symbol 35 MovieClip [fon1] Frame 1
stop();
Symbol 35 MovieClip [fon1] Frame 2
stop();
Symbol 35 MovieClip [fon1] Frame 3
stop();
Symbol 35 MovieClip [fon1] Frame 4
stop();
Symbol 46 MovieClip [en1] Frame 8
stop();
_root.ToE(this._name);
Symbol 48 MovieClip [en2_1] Frame 8
stop();
_root.ToE(this._name);
Symbol 53 MovieClip [en2_2] Frame 8
stop();
_root.ToE(this._name);
Symbol 55 MovieClip [en3] Frame 8
stop();
_root.ToE(this._name);
Symbol 60 MovieClip [en4] Frame 8
stop();
_root.ToE(this._name);
stop();
Symbol 63 MovieClip [blow] Frame 18
stop();
this.removeMovieClip();
Symbol 72 MovieClip [s1] Frame 1
#initclip 32
Object.registerClass("s1", GameClasses.TileClass);
#endinitclip
Symbol 73 MovieClip [s2] Frame 1
#initclip 17
Object.registerClass("s2", GameClasses.TileClass);
#endinitclip
Symbol 74 MovieClip [s3] Frame 1
#initclip 18
Object.registerClass("s3", GameClasses.TileClass);
#endinitclip
Symbol 75 MovieClip [s4] Frame 1
#initclip 19
Object.registerClass("s4", GameClasses.TileClass);
#endinitclip
Symbol 82 MovieClip [rock] Frame 1
#initclip 20
Object.registerClass("rock", GameClasses.TileClass);
#endinitclip
Symbol 89 MovieClip [stone] Frame 1
#initclip 21
Object.registerClass("stone", GameClasses.TileClass);
#endinitclip
Symbol 97 MovieClip [bonus] Frame 1
#initclip 22
Object.registerClass("bonus", GameClasses.CrossBonus);
#endinitclip
Symbol 110 MovieClip [bonus1] Frame 1
#initclip 23
Object.registerClass("bonus1", GameClasses.GameBonus);
#endinitclip
Symbol 116 MovieClip [bonus2] Frame 1
#initclip 24
Object.registerClass("bonus2", GameClasses.GameBonus);
#endinitclip
Symbol 137 MovieClip [timer] Frame 1
#initclip 25
Object.registerClass("timer", GameClasses.GameTimer);
#endinitclip
Symbol 145 MovieClip [button_uzk_s] Frame 1
#initclip 26
Object.registerClass("button_uzk_s", GameClasses.GameButton);
#endinitclip
Symbol 145 MovieClip [button_uzk_s] Frame 10
stop();
Symbol 145 MovieClip [button_uzk_s] Frame 18
stop();
Symbol 207 MovieClip [blink] Frame 30
this.removeMovieClip();
Symbol 215 MovieClip [earth_bush] Frame 1
stop();
Symbol 215 MovieClip [earth_bush] Frame 20
this.gotoAndPlay(2);
Symbol 226 MovieClip [earth_bush_rise] Frame 1
if ((_root.GameStatus == "endround") && (this.C == 1)) {
this.gotoAndStop(45);
} else {
this.C = 0;
}
Symbol 226 MovieClip [earth_bush_rise] Frame 41
if (_root.GameStatus == "endround") {
stop();
_root.ShowStats();
this.C = 1;
}
Symbol 226 MovieClip [earth_bush_rise] Frame 100
stop();
_root.RestartAll();
Symbol 231 MovieClip [earth_chest] Frame 1
stop();
Symbol 231 MovieClip [earth_chest] Frame 20
this.gotoAndPlay(2);
Symbol 242 MovieClip [earth_dragon] Frame 1
stop();
Symbol 242 MovieClip [earth_dragon] Frame 20
this.gotoAndPlay(2);
Symbol 258 MovieClip [earth_stones] Frame 1
stop();
Symbol 258 MovieClip [earth_stones] Frame 20
this.gotoAndPlay(2);
Symbol 343 MovieClip [checker] Frame 1
stop();
Symbol 437 MovieClip [card3] Frame 1
stop();
Symbol 437 MovieClip [card3] Frame 65
stop();
Symbol 437 MovieClip [card3] Frame 130
stop();
Symbol 437 MovieClip [card3] Frame 195
stop();
Symbol 437 MovieClip [card3] Frame 260
stop();
Symbol 452 MovieClip [card2] Frame 1
stop();
Symbol 452 MovieClip [card2] Frame 65
stop();
Symbol 452 MovieClip [card2] Frame 130
stop();
Symbol 452 MovieClip [card2] Frame 195
stop();
Symbol 452 MovieClip [card2] Frame 260
stop();
Symbol 467 MovieClip [card0] Frame 1
stop();
Symbol 467 MovieClip [card0] Frame 65
stop();
Symbol 467 MovieClip [card0] Frame 130
stop();
Symbol 467 MovieClip [card0] Frame 195
stop();
Symbol 467 MovieClip [card0] Frame 260
stop();
Symbol 482 MovieClip [card1] Frame 1
stop();
Symbol 482 MovieClip [card1] Frame 65
stop();
Symbol 482 MovieClip [card1] Frame 130
stop();
Symbol 482 MovieClip [card1] Frame 195
stop();
Symbol 482 MovieClip [card1] Frame 260
stop();
Symbol 508 MovieClip Frame 1
stop();
Symbol 508 MovieClip Frame 21
_root.UnlockBook_s.start(_root.SoundOn);
Symbol 532 MovieClip [button] Frame 1
#initclip 27
Object.registerClass("button", GameClasses.GameButton);
#endinitclip
Symbol 532 MovieClip [button] Frame 10
stop();
Symbol 532 MovieClip [button] Frame 18
stop();
Symbol 540 MovieClip [button_shir_s] Frame 1
#initclip 28
Object.registerClass("button_shir_s", GameClasses.GameButton);
#endinitclip
Symbol 540 MovieClip [button_shir_s] Frame 10
stop();
Symbol 540 MovieClip [button_shir_s] Frame 18
stop();
Symbol 541 MovieClip [Books] Frame 1
#initclip 29
Object.registerClass("Books", GameClasses.Books);
#endinitclip
Symbol 563 MovieClip [button_small] Frame 1
#initclip 30
Object.registerClass("button_small", GameClasses.GameButton);
#endinitclip
Symbol 563 MovieClip [button_small] Frame 10
stop();
Symbol 563 MovieClip [button_small] Frame 18
stop();
Symbol 570 MovieClip Frame 1
stop();
Symbol 570 MovieClip Frame 30
stop();
Symbol 570 MovieClip Frame 60
stop();
Symbol 595 MovieClip [map] Frame 1
stop();
bl.onPress = (close.onPress = function () {
this._parent.removeMovieClip();
_root.UnShowMap();
});
bl.useHandCursor = false;
Symbol 615 MovieClip Frame 1
this.gotoAndPlay(40);
Symbol 615 MovieClip Frame 51
var C = (random(7) + 2);
this.C = C;
Symbol 615 MovieClip Frame 56
this.C--;
if (this.C <= 0) {
var r = (random(20) + 30);
this._parent.k1.gotoAndPlay(r);
this._parent.k2.gotoAndPlay(r);
} else {
this._parent.k1.gotoAndPlay(52);
this._parent.k2.gotoAndPlay(52);
}
Symbol 628 MovieClip Frame 1
if ((this.was == "r") || (this.ROT == 1)) {
this.r = 2;
this.was = "l";
} else {
this.r = 3;
this.was = "r";
}
this.N = (getTimer() + random(2000)) + 500;
this.onEnterFrame = function () {
if (getTimer() > this.N) {
this.N = (getTimer() + random(2000)) + 500;
this.gotoAndStop(this.r);
}
};
Symbol 628 MovieClip Frame 2
this.r = 1;
Symbol 628 MovieClip Frame 3
this.r = 1;
Symbol 633 MovieClip [menu] Frame 1
#initclip 31
Object.registerClass("menu", GameClasses.GameMenu);
#endinitclip
bl.onPress = null;
bl.useHandCursor = false;
Symbol 634 MovieClip [fly_text] Frame 30
stop();
this.removeMovieClip();
Symbol 669 MovieClip Frame 1
stop();
Symbol 675 MovieClip [blinkf] Frame 30
this.removeMovieClip();
Symbol 683 MovieClip [vzryv] Frame 9
stop();
this.removeMovieClip();