Frame 1
var url_id;
Frame 2
function playSound(sound) {
if (sounds == true) {
sound.start(0, 1);
}
}
function soundInfinity(sound) {
if (sounds == true) {
sound.start(0, 100);
}
}
var sClick = new Sound(this);
sClick.attachSound("click2");
var sPB = new Sound(this);
sPB.attachSound("przesuwanie_bloku");
var sPD = new Sound(this);
sPD.attachSound("podskakiwanie_dzbanu");
var sFS = new Sound(this);
sFS.attachSound("strzal_plomieniem");
var sNL = new Sound(this);
sNL.attachSound("napis_loop");
var sStart = new Sound(this);
sStart.attachSound("start");
var sGO = new Sound(this);
sGO.attachSound("game_over");
var sYW = new Sound(this);
sYW.attachSound("wygrana");
var sMPB = new Sound(this);
sMPB.attachSound("mainpage_button");
var sWP = new Sound(this);
sWP.attachSound("waz_plucie1");
var sSW = new Sound(this);
sSW.attachSound("smierc_weza");
var sPSP = new Sound(this);
sPSP.attachSound("pojawianie_sie_postaci");
var sP_S = new Sound(this);
sP_S.attachSound("pirania_s");
var sBicz1 = new Sound(this);
sBicz1.attachSound("bicz1");
var sMZ = new Sound(this);
sMZ.attachSound("miecz_zamach");
var sBicz2 = new Sound(this);
sBicz2.attachSound("bicz2");
var sPB2 = new Sound(this);
sPB2.attachSound("przesuwanie_bloku2");
var sZN = new Sound(this);
sZN.attachSound("zapadniecie_nawisu");
var sAFE = new Sound(this);
sAFE.attachSound("atak_fala_energii");
var sR1 = new Sound(this);
sR1.attachSound("strzelanie");
var sTR2 = new Sound(this);
sTR2.attachSound("trafienie2");
var sTR1 = new Sound(this);
sTR1.attachSound("trafienie1");
var sSmK = new Sound(this);
sSmK.attachSound("smierc_kobiety");
var sSmM = new Sound(this);
sSmM.attachSound("smierc_mezczyzny");
var sSkK = new Sound(this);
sSkK.attachSound("skok_kobiety");
var sSkM = new Sound(this);
sSkM.attachSound("skok_mezczyzny");
var aso = this.createEmptyMovieClip("aso0", this.getNextHighestDepth());
var sRun = new Sound(aso);
sRun.attachSound("bieganie1");
var sWalk = new Sound(aso);
sWalk.attachSound("chodzenie_ciezkie");
var sDeads = new Array(sSmM, sSmK, sSmM, sSmM, sSmM, sSmM, sSmK, sSmK, sSmM);
var sJumps = new Array(sSkM, sSkK, sSkM, sSkM, sSkM, sSkM, sSkK, sSkK, sSkM);
var sWalks = new Array(sRun, sRun, sRun, sWalk, sRun, sRun, sRun, sWalk, sRun);
var sounds = true;
var sSP = new Sound(this);
sSP.attachSound("smierc_pajaka");
var sWN = new Sound(this);
sWN.attachSound("wybuch_nietoperza1");
var sZD = new Sound(this);
sZD.attachSound("zniszczenie_dzbana");
var sZR = new Sound(this);
sZR.attachSound("zniszczenie_rzezby");
var sZB = new Sound(this);
sZB.attachSound("zniszczenie_bloku");
var sZK = new Sound(this);
sZK.attachSound("zniszczenie_klatki");
var sUB = new Sound(this);
sUB.attachSound("uderzenie_bloku");
var sBD = new Sound(this);
sBD.attachSound("blysk_diamentu");
var sBZ = new Sound(this);
sBZ.attachSound("blysk_zlota");
var sWL = new Sound(this);
sWL.attachSound("wybor_levelu");
var sMHI = new Sound(this);
sMHI.attachSound("menu_help_in");
var sMHO = new Sound(this);
sMHO.attachSound("menu_help_out");
gotoAndPlay ("startowa");
Frame 84
stop();
Frame 85
function startLoop(tempName) {
}
function stopLoop(tempName) {
}
mc_pop._visible = false;
mc_pop2._visible = false;
mc_popHelp0._visible = false;
var curFrame = "startowa";
var nFrame = "startowa";
var tab_frames = new Array("startowa", "c1", "c2", "c3", "c4", "c5", "c8", "c6", "game", "c7");
var lastLoop;
stopLoop("begin");
startLoop("begin");
sStart.onSoundComplete = function () {
sStart.start(3.87, 1);
};
var s1level = false;
var s1map = false;
var s1begin = false;
stopLoop("map");
stopLoop("level");
Frame 92
function goGame() {
stop();
curFrame = "hero_screen";
}
function gotoGame() {
clearInterval(IDGame);
gotoAndPlay ("game");
}
var heroes;
var enemies;
var w = "o1";
var x = "o2";
var y = "o3";
var z = "o4";
var zx = "d5";
var a = "sa";
var ax = "do";
var b = "dz";
var c = "ca";
var d = "di";
var m = "ma";
var n = "pn";
var p = "po";
var p2 = "p2";
var r = "sp";
var s = "st";
var l = "wa";
var actBrush = "-1";
var objective = w;
var hero = 0;
var enemy = 0;
var bckFrame = 1;
var gameMode = "";
var map_title = "";
var map_title1 = "Insane";
var map_title2 = "Jungle";
var map_title3 = "Adventure";
mc_popHelp._visible = false;
var i = 0;
while (i < fields.length) {
removeMovieClip(fields[i]);
i++;
}
if (!map1) {
var map1 = new Array();
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
}
var so = SharedObject.getLocal("myMap");
var so2 = SharedObject.getLocal("codes");
var cPointer = 0;
if (!so2.data.codes) {
so2.data.codes = new Array();
}
if (gameMode == "PLAY") {
b1._visible = false;
b2._visible = false;
b3._visible = false;
b4._visible = false;
b5._visible = false;
b6._visible = false;
b7._visible = false;
} else {
b1._visible = true;
b2._visible = true;
b3._visible = true;
b4._visible = true;
b5._visible = true;
b6._visible = true;
b7._visible = true;
}
Frame 101
mc_logo.onPress = function () {
mc_pop_warning1._visible = false;
clean();
cleanClips();
playSound(sClick);
url_id = null;
gotoAndPlay ("startowa");
};
mc_logo.onRollOver = function () {
playSound(sMPB);
mc_logo.gotoAndPlay("roll");
};
mc_logo.onRollOut = (mc_logo.onReleaseOutside = function () {
mc_logo.gotoAndPlay("rollOut");
});
Frame 117
if ((url_id != null) && (url_id != undefined)) {
mc_code._visible = false;
} else {
mc_code._visible = true;
}
Instance of Symbol 77 MovieClip in Frame 117
/* no clip actions */
Instance of Symbol 116 MovieClip in Frame 124
on (press) {
_parent.nFrame = "startowa";
_parent.playSound(_parent.sClick);
_parent.gotoAndPlay(_parent.curFrame + "_end");
}
Frame 138
playSound(sPSP);
mc_credits._visible = false;
Frame 173
mc_cloud._visible = false;
Frame 174
function roll(str, clip) {
if (str == "play") {
mc_cloud.gotoAndStop(1);
}
if (str == "build") {
mc_cloud.gotoAndStop(2);
}
mc_cloud._x = ((clip._x + clip._width) + mc_main._x) - 50;
mc_cloud._y = clip._y + mc_main._y;
mc_cloud._visible = true;
}
function out() {
mc_cloud._visible = false;
}
mc_popHelp0._visible = false;
removeMovieClip(mc_popHelp);
var contener1 = this;
var level_tab = new Array();
var thumbs_array = new Array();
var ext = ".jpg";
var odstep2 = 0;
mc_cloud.swapDepths(this.getNextHighestDepth());
Frame 201
function sendToServer2(str) {
var _local1 = 0;
while (_local1 < so2.data.codes.length) {
if (so2.data.codes[_local1] == str) {
so2.data.codes.splice(_local1, 1);
break;
}
_local1++;
}
so2.data.codes.reverse();
so2.data.codes.push(str);
so2.data.codes.reverse();
mc_code.btn_go.enabled = false;
send_lv2.sendAndLoad("http://ic.addictinggames.com/flash/xml.php?url_id=" + str, result_lv2, "POST");
}
function formatuj(twoj_string) {
var _local1 = new Array();
_local1 = twoj_string.split("%3B").join(";");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%3C").join("<");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%3E").join(">");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%2F").join("/");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%20").join(" ");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%27").join("\"");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%3F").join("?");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%2E").join(".");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%2C").join(",");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%2D").join("-");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%5B").join("[");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%5D").join("]");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%5F").join("_");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%3D").join("=");
twoj_string = _local1.toString();
return(twoj_string);
}
stop();
var tf1 = mc_code.tfCode;
tf1.onSetFocus = function (oldFocus) {
cPointer = 0;
};
var mapRet = new Array();
mapRet = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
var result_lv2 = new LoadVars();
result_lv2.onLoad = function (success) {
if (success) {
var _local5 = result_lv2.toString();
_local5 = formatuj(_local5);
var _local13 = new XML(_local5);
var _local6 = new XML(_local5);
_local6.ignoreWhite = true;
var _local8 = _local6.childNodes[0].childNodes[0].childNodes[0];
var _local9 = _local8.toString();
var _local11 = _local6.childNodes[0].childNodes[1].childNodes[0];
var _local7 = _local11.toString();
trace(_local7);
if (_local9 == "success") {
mc_code.tfCode.text = "";
mc_code.btn_go.enabled = true;
var _local4 = _local7.split(";");
map_title = _local4[0];
hero = _local4[1];
bckFrame = _local4[2];
objective = _local4[3];
trace(_local4[0] + "title");
trace(_local4[1] + "hero");
trace(_local4[2] + "bck");
trace(_local4[3] + "obj");
trace(_local4[4] + "map");
var _local10 = _local4[4];
var _local3 = new Array();
_local3 = _local10.split(",");
var _local2 = 0;
while (_local2 < _local3.length) {
trace(_local3[_local2]);
mapRet[Math.floor(_local2 / 20)][_local2 % 20] = _local3[_local2];
_local2++;
}
map1 = mapRet;
b1._visible = false;
b2._visible = false;
b3._visible = false;
b4._visible = false;
b5._visible = false;
b6._visible = false;
b7._visible = false;
gameMode = "PLAY";
nFrame = "c6";
_root.gotoAndPlay("c6");
} else {
var _local12 = mc_code.tfCode.text;
mc_code.tfCode.text = "Incorrect code. Please try again.";
mc_code.btn_go.enabled = true;
}
} else {
mc_popup.gotoAndStop("error");
mc_popup.v1 = "error connecting to server";
}
};
var send_lv2 = new LoadVars();
if ((url_id != null) && (url_id != undefined)) {
sendToServer2(url_id);
}
Frame 230
mc_pop_warning1._visible = false;
mc_popHelp0._visible = false;
removeMovieClip(mc_popHelp);
Frame 235
unlock_screen._visible = false;
gotoAndPlay(nFrame);
stopLoop("map");
stopLoop("begin");
stopLoop("level");
startLoop("level");
mini_map4._visible = false;
mini_map5._visible = false;
mc_pop_warning1._visible = false;
b_next._visible = true;
mc_popHelp0._visible = false;
removeMovieClip(mc_popHelp);
objective = -1;
hero = -1;
bckFrame = -1;
var i = 0;
while (i < thumbs_array.length) {
removeMovieClip(thumbs_array[i]);
i++;
}
Frame 258
function changeFrameOf(_brush, _frame) {
trace((("changeFrameOf:" + _brush) + ", ") + _frame);
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == _brush) {
var _local3 = getClipNumFromWsp(_local1, _local2);
fields[_local3].n1.gotoAndStop(_frame);
}
_local1++;
}
_local2++;
}
}
function firstTime() {
counter = 0;
var i = 0;
while (i < 13) {
var j = 0;
while (j < 20) {
duplicateMovieClip (sq_sym, "field" + counter, 1111 - counter);
fields[counter] = eval ("field" + counter);
fields[counter]._x = mc_map._x + (j * wid);
fields[counter]._y = mc_map._y + (i * wid);
if ((((i == 0) || (i == 12)) || (j == 0)) || (j == 19)) {
dodaj_maske(fields[counter]);
}
counter++;
j++;
}
i++;
}
}
function createMap() {
counter = 0;
var _local4 = 0;
while (_local4 < 13) {
var _local3 = 0;
while (_local3 < 20) {
fields[counter].gotoAndStop(brushToframe(map1[_local4][_local3], fields[counter], _local4, _local3));
if ((((map1[_local4][_local3] == w) || (map1[_local4][_local3] == x)) || (map1[_local4][_local3] == y)) || (map1[_local4][_local3] == z)) {
fields[counter].n1.gotoAndStop(objective);
}
if (map1[_local4][_local3] == "9") {
fields[counter].n1.gotoAndStop(hero + 1);
}
if (map1[_local4][_local3].substr(0, 1) == "e") {
fields[counter].n1.gotoAndStop(Number(map1[_local4][_local3].split("e").join("")) + 1);
trace(("gotoAndStop:" + Number(map1[_local4][_local3].split("e").join(""))) + 1);
}
fields[counter].onRelease = (fields[counter].onReleaseOutside = function () {
if (przesuwanie == true) {
actBrush = defBrush;
ruchM = false;
mc_hand.gotoAndStop("hand");
}
if (((((actBrush == "9") || (actBrush == w)) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
actBrush = "-2";
}
if (actBrush.substr(0, 1) == "e") {
actBrush = "-2";
}
polacz_klocki();
przesuwanie = false;
if (map_pointer < (map_moves.length - 1)) {
map_moves.splice(map_pointer + 1);
}
map_moves[map_moves.length] = new Array();
map_moves[map_moves.length - 1] = copyMap(map1);
map_pointer = map_moves.length - 1;
mc_undo.enabled = true;
mc_redo.enabled = true;
});
fields[counter].onRollOver = function () {
var _local4 = getK(this, fields);
var _local2 = new Array();
_local2 = getWsp(fields[_local4]);
if (((actBrush != "0") && (map1[_local2[1]][_local2[0]] != 0)) && (actBrush != "-1")) {
if (mc_hand.getDepth() != (this._parent.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this._parent.getNextHighestDepth());
}
mc_hand.gotoAndStop("hand");
mc_hand._x = this._x;
mc_hand._y = this._y;
mc_hand._visible = true;
} else if (actBrush != "0") {
mc_hand._visible = false;
}
if (map1[_local2[1]][_local2[0]] == 0) {
this.gotoAndStop(brushToframe(actBrush, null, -1, -1));
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("rope_spider");
}
if ((actBrush == "9") && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
this.n1.gotoAndStop(hero + 1);
}
if ((actBrush.substr(0, 1) == "e") && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
this.n1.gotoAndStop(enemy + 1);
}
if ((actBrush == objective) && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
var _local3 = 0;
switch (objective) {
case w :
_local3 = 1;
break;
case x :
_local3 = 2;
break;
case y :
_local3 = 3;
break;
case z :
_local3 = 4;
}
this.n1.gotoAndStop(_local3);
}
};
fields[counter].onRollOut = function () {
sq_sym._visible = false;
var _local3 = getK(this, fields);
var _local2 = new Array();
_local2 = getWsp(fields[_local3]);
if (map1[_local2[1]][_local2[0]] == 0) {
this.gotoAndStop("out");
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("liana");
}
};
fields[counter].onPress = function () {
if (actBrush != "-1") {
var _local3 = getMouseK();
var _local2 = new Array();
_local2 = getWsp(fields[_local3]);
if (((map1[_local2[1]][_local2[0]] == 0) || (actBrush == "0")) && (actBrush != "-2")) {
if ((((((map1[_local2[1]][_local2[0]].substr(0, 2) != "xe") && (map1[_local2[1]][_local2[0]].substr(0, 1) != "e")) && (map1[_local2[1]][_local2[0]] != "9")) && (map1[_local2[1]][_local2[0]] != "9x")) && (map1[_local2[1]][_local2[0]] != objective)) && (map1[_local2[1]][_local2[0]] != zx)) {
pressField(_local3);
polacz_klocki();
}
} else if (((actBrush != r) || (map1[_local2[1]][_local2[0]] != "7")) && (actBrush != 0)) {
if (map1[_local2[1]][_local2[0]] == "9x") {
przesun(_local2[0], _local2[1] + 1);
} else if (map1[_local2[1]][_local2[0]].substr(0, 2) == "xe") {
if ((map1[_local2[1]][_local2[0]] == "xe4") || (map1[_local2[1]][_local2[0]] == "xe5")) {
var _local4 = findFirstOnMap(map1[_local2[1]][_local2[0]].split("x").join(""));
var _local6 = _local4[0] - _local2[0];
var _local5 = _local4[1] - _local2[1];
przesun(_local2[0] + _local6, _local2[1] + _local5);
} else {
przesun(_local2[0], _local2[1] + 1);
}
} else if (map1[_local2[1]][_local2[0]] == zx) {
var _local4 = findFirstOnMap(objective);
var _local6 = _local4[0] - _local2[0];
var _local5 = _local4[1] - _local2[1];
przesun(_local2[0] + _local6, _local2[1] + _local5);
} else {
przesun(_local2[0], _local2[1]);
}
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("rope_spider");
pressField(_local3);
polacz_klocki();
}
}
};
if (map1[_local4][_local3] == "2") {
rysuj_mosty(Math.floor(_local3), Math.floor(_local4));
}
counter++;
_local3++;
}
_local4++;
}
polacz_klocki();
}
function pressField(nField) {
if ((actBrush != "-1") && (actBrush != "-2")) {
var _local1 = new Array();
_local1 = getWsp(fields[nField]);
var _local4 = true;
if (actBrush == "0") {
if (map1[_local1[1]][_local1[0]] == a) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
}
if ((((map1[_local1[1]][_local1[0]] == w) || (map1[_local1[1]][_local1[0]] == x)) || (map1[_local1[1]][_local1[0]] == y)) || (map1[_local1[1]][_local1[0]] == z)) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
}
if (map1[_local1[1]][_local1[0]] == "9") {
map1[_local1[1] - 1][_local1[0]] = actBrush;
}
if (map1[_local1[1]][_local1[0]].substr(0, 1) == "e") {
if ((map1[_local1[1]][_local1[0]] == "e4") || (map1[_local1[1]][_local1[0]] == "e5")) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
} else {
map1[_local1[1] - 1][_local1[0]] = actBrush;
}
}
}
if (actBrush == "9") {
if (map1[_local1[1] - 1][_local1[0]] == 0) {
_local4 = true;
} else {
_local4 = false;
}
var _local3 = 0;
while (_local3 < 13) {
if (_local4 == false) {
break;
}
var _local2 = 0;
while (_local2 < 20) {
if (map1[_local3][_local2] == "9") {
_local4 = false;
break;
}
_local2++;
}
_local3++;
}
}
if (actBrush.substr(0, 1) == "e") {
if ((actBrush == "e4") || (actBrush == "e5")) {
_local4 = Boolean(((map1[_local1[1]][_local1[0] + 1] == 0) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0]] == 0));
} else {
_local4 = Boolean(map1[_local1[1] - 1][_local1[0]] == 0);
}
}
if ((((actBrush == w) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
if (((map1[_local1[1]][_local1[0] + 1] == 0) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0]] == 0)) {
_local4 = true;
} else {
_local4 = false;
}
var _local3 = 0;
while (_local3 < 13) {
var _local2 = 0;
while (_local2 < 20) {
if ((((map1[_local3][_local2] == w) || (map1[_local3][_local2] == x)) || (map1[_local3][_local2] == y)) || (map1[_local3][_local2] == z)) {
_local4 = false;
break;
}
_local2++;
}
_local3++;
}
}
trace("mozliwe postawienie:" + _local4);
if (actBrush == a) {
if ((((((map1[_local1[1]][_local1[0]] == 0) && (map1[_local1[1]][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 2][_local1[0] + 1] == "1")) && (map1[_local1[1] + 1][_local1[0]] == 0)) && (map1[_local1[1] + 2][_local1[0]] == 1)) {
_local4 = true;
} else {
_local4 = false;
}
}
if (_local4 == true) {
if ((actBrush == r) && (map1[_local1[1]][_local1[0]] == "7")) {
map1[_local1[1]][_local1[0]] = "7a";
} else {
map1[_local1[1]][_local1[0]] = actBrush;
}
fields[nField].gotoAndStop(brushToframe(map1[_local1[1]][_local1[0]], fields[nField], _local1[1], _local1[0]));
if (actBrush == "9") {
fields[nField].n1.gotoAndStop(hero + 1);
map1[_local1[1] - 1][_local1[0]] = "9x";
}
if (actBrush.substr(0, 1) == "e") {
trace("stawiamy enemy:" + actBrush);
if ((actBrush == "e4") || (actBrush == "e5")) {
fields[nField].n1.gotoAndStop(enemy + 1);
map1[_local1[1]][_local1[0] + 1] = "x" + actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = "x" + actBrush;
map1[_local1[1] + 1][_local1[0]] = "x" + actBrush;
} else {
fields[nField].n1.gotoAndStop(enemy + 1);
map1[_local1[1] - 1][_local1[0]] = "xe" + enemy;
}
}
if (actBrush == a) {
map1[_local1[1]][_local1[0] + 1] = ax;
map1[_local1[1] + 1][_local1[0] + 1] = ax;
map1[_local1[1] + 1][_local1[0]] = ax;
}
if ((((actBrush == w) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
fields[nField].n1.gotoAndStop(actBrush);
map1[_local1[1]][_local1[0] + 1] = zx;
map1[_local1[1] + 1][_local1[0] + 1] = zx;
map1[_local1[1] + 1][_local1[0]] = zx;
}
} else {
fields[nField].gotoAndStop("out");
}
if (actBrush == "2") {
rysuj_mosty(Math.floor(_local1[0]), Math.floor(_local1[1]));
}
}
}
function getWsp(clip) {
var _local1 = new Array(2);
_local1[0] = Math.round((clip._x - mc_map._x) / wid);
_local1[1] = Math.round((clip._y - mc_map._y) / wid);
return(_local1);
}
function getK(clip, tab) {
var _local1 = 0;
while (_local1 < tab.length) {
if (clip == tab[_local1]) {
return(_local1);
}
_local1++;
}
}
function getMouseK() {
var _local1 = Math.floor((_xmouse - mc_map._x) / wid);
var _local2 = Math.floor((_ymouse - mc_map._y) / wid);
return(getClipNumFromWsp(_local1, _local2));
}
function getClipNumFromWsp(xx, yy) {
var _local1 = (yy * 20) + xx;
return(_local1);
}
function brushToframe(brush, clip, pos1, pos0) {
var _local1 = "";
if (brush.substr(0, 1) == "e") {
return("enemy");
}
switch (brush) {
case "0" :
if (clip != null) {
delete map_obj2[pos1][pos0];
map_obj2[pos1][pos0] = 0;
}
_local1 = "out";
break;
case "1" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(1, clip, -111);
}
_local1 = "1a";
break;
case "101" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(101, clip, -111);
}
_local1 = "skala";
break;
case "2" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(2, clip, -111);
}
_local1 = "kladka";
break;
case "3" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(3, clip, -111);
}
_local1 = "swamp";
break;
case "4" :
_local1 = "zapadka";
break;
case "5" :
_local1 = "chest";
break;
case "6" :
_local1 = "chestx";
break;
case "7" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(12, clip, -111);
}
_local1 = "liana";
break;
case "7a" :
_local1 = "rope_spider";
break;
case s :
_local1 = "statue";
break;
case d :
_local1 = "diamond";
break;
case b :
_local1 = "dzban";
break;
case c :
_local1 = "cage";
break;
case r :
_local1 = "spider";
break;
case "9" :
_local1 = "hero";
break;
case m :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(13, clip, -111);
}
_local1 = "magma";
break;
case n :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(7, clip, -111);
}
_local1 = "pnacze";
break;
case p :
_local1 = "posag";
break;
case p2 :
_local1 = "posag2";
break;
case r :
_local1 = "spider";
break;
case a :
_local1 = "sadzawka";
break;
case l :
_local1 = "wall";
break;
case w :
_local1 = "exit";
break;
case x :
_local1 = "exit";
break;
case y :
_local1 = "exit";
break;
case z :
_local1 = "exit";
}
return(_local1);
}
function polacz_klocki() {
var _local6 = 0;
while (_local6 < map_obj2.length) {
var _local3 = 0;
while (_local3 < map_obj2[0].length) {
var _local2 = map_obj2[_local6][_local3];
if (_local2.connected == true) {
var _local1 = new Array();
_local1[0] = _local3;
_local1[1] = _local6;
var _local8 = map_obj2[_local1[1]][_local1[0] + 1].type == _local2.type;
var _local7 = map_obj2[_local1[1]][_local1[0] - 1].type == _local2.type;
var _local4 = map_obj2[_local1[1] - 1][_local1[0]].type == _local2.type;
var _local5 = map_obj2[_local1[1] + 1][_local1[0]].type == _local2.type;
if ((((!_local8) && (!_local7)) && (!_local4)) && (!_local5)) {
_local2.clip.n1.gotoAndStop("single");
} else if ((((!_local4) && (!_local5)) && (_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right");
} else if ((((!_local4) && (!_local5)) && (!_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("left");
} else if ((((!_local4) && (!_local5)) && (_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("center");
} else if ((((!_local4) && (_local5)) && (_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("center_up");
} else if ((((!_local4) && _local5) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_up");
} else if ((((!_local4) && _local5) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_up");
} else if (((_local4 && _local5) && _local7) && _local8) {
_local2.clip.n1.gotoAndStop("center_center");
} else if (((_local4 && _local5) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_center");
} else if (((_local4 && _local5) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_center");
} else if (((_local4 && (!_local5)) && _local7) && _local8) {
_local2.clip.n1.gotoAndStop("down_center");
} else if (((_local4 && (!_local5)) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_down");
} else if (((_local4 && (!_local5)) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_down");
} else if ((((!_local4) && _local5) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_up");
} else if (((_local4 && _local5) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_center");
} else if (((_local4 && (!_local5)) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_down");
}
_local2.clip.n1.kt1._visible = false;
_local2.clip.n1.kt2._visible = false;
}
_local3++;
}
_local6++;
}
_local6 = 0;
while (_local6 < map_obj2.length) {
var _local3 = 0;
while (_local3 < map_obj2[0].length) {
var _local2 = map_obj2[_local6][_local3];
var _local1 = new Array();
_local1[0] = _local3;
_local1[1] = _local6;
if (_local2.type == 12) {
var _local8 = (map1[_local1[1]][_local1[0] + 1] == "7") || (map1[_local1[1]][_local1[0] + 1] == "7a");
var _local7 = (map1[_local1[1]][_local1[0] - 1] == "7") || (map1[_local1[1]][_local1[0] - 1] == "7a");
var _local4 = (map1[_local1[1] - 1][_local1[0]] == "7") || (map1[_local1[1] - 1][_local1[0]] == "7a");
var _local5 = (map1[_local1[1] + 1][_local1[0]] == "7") || (map1[_local1[1] + 1][_local1[0]] == "7a");
if ((!_local4) && (!_local5)) {
_local2.clip.n1.gotoAndStop("single");
} else if (_local4 && (!_local5)) {
_local2.clip.n1.gotoAndStop("down");
} else if ((!_local4) && (_local5)) {
if (map_obj2[_local1[1] + 2][_local1[0]].type == _local2.type) {
_local2.clip.n1.gotoAndStop("up");
} else {
_local2.clip.n1.gotoAndStop("single");
}
} else if (_local4 && (_local5)) {
_local2.clip.n1.gotoAndStop("center");
}
}
_local3++;
}
_local6++;
}
}
function przesun(myx, myy) {
defBrush = actBrush;
przesuwanie = true;
actBrush = map1[myy][myx];
oldPos1 = myy;
oldPos0 = myx;
mc_hand.gotoAndStop("hand_close");
}
function usun_obiekt(myobj, myx, myy) {
oldBrush = actBrush;
var _local1 = (myy * map1[0].length) + myx;
if ((map1[myy][myx] == "7a") && (pojedyncze == true)) {
actBrush = "7";
} else {
actBrush = "0";
}
pressField(_local1);
actBrush = oldBrush;
}
function rysuj_mosty(myx, myy) {
var _local4 = myx;
var _local3 = myy;
obj = map_obj2[_local3][_local4];
var _local5 = random(obj.clip.n1._totalframes) + 1;
obj.clip.n1.gotoAndStop(_local5);
do {
var _local2 = random(obj.clip.n1._totalframes) + 1;
var onceAgain = false;
var _local1 = -5;
while (_local1 < 5) {
_local1 = ((_local1 == -1) ? 0 : (_local1));
if (map_obj2[_local3][(_local4 - _local1) - 1].clip.n1._currentframe == obj.clip.n1._currentframe) {
obj.clip.n1.gotoAndStop(_local2);
onceAgain = true;
break;
}
_local1++;
}
} while (onceAgain == true);
}
function clean_creator(param) {
map_obj2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
if (param == "all") {
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
} else {
var _local3 = 0;
while (_local3 < 13) {
var _local2 = 0;
while (_local2 < 20) {
if ((((map1[_local3][_local2] != "9") && (map1[_local3][_local2] != "9x")) && (map1[_local3][_local2] != objective)) && (map1[_local3][_local2] != zx)) {
map1[_local3][_local2] = 0;
}
_local2++;
}
_local3++;
}
}
var _local1 = 0;
while (_local1 < fields.length) {
var _local4 = new Array();
_local4 = getWsp(fields[_local1]);
var _local3 = Math.floor(_local4[1]);
var _local2 = Math.floor(_local4[0]);
if (((((map1[_local3][_local2] != "9") && (map1[_local3][_local2] != "9x")) && (map1[_local3][_local2] != objective)) && (map1[_local3][_local2] != zx)) || (param == "all")) {
fields[_local1].gotoAndStop("out");
}
_local1++;
}
}
function copyMap(mapStart) {
var _local3 = new Array();
_local3 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
_local3[_local2][_local1] = mapStart[_local2][_local1];
_local1++;
}
_local2++;
}
return(_local3);
}
function cleanClips() {
var _local1 = 0;
while (_local1 < fields.length) {
removeMovieClip(fields[_local1]);
_local1++;
}
_local1 = 0;
while (_local1 < tab_masks.length) {
removeMovieClip(tab_masks[_local1]);
_local1++;
}
removeMovieClip(mc_mask);
delete fields;
removeMovieClip(mc_pop_warning);
removeMovieClip(mc_hand);
removeMovieClip(mc_pop);
removeMovieClip(mc_pop2);
removeMovieClip(mc_pop3);
mc_pop._visible = false;
}
function block(bool, array) {
var _local1 = 0;
while (_local1 < array.length) {
array[_local1].enabled = bool;
_local1++;
}
}
function dodaj_maske(clip1) {
mc_mask_big.duplicateMovieClip("mc_mask" + tab_masks.length, this.getNextHighestDepth());
tab_masks.push(eval ("mc_mask" + tab_masks.length));
clip1.setMask(tab_masks[tab_masks.length - 1]);
}
function isHeroSet() {
var _local3 = false;
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == "9") {
_local3 = true;
break;
}
_local1++;
}
if (_local3 == true) {
break;
}
_local2++;
}
return(_local3);
}
function isObjSet() {
var _local3 = false;
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if ((((map1[_local2][_local1] == "o4") || (map1[_local2][_local1] == "o3")) || (map1[_local2][_local1] == "o2")) || (map1[_local2][_local1] == "o1")) {
objective = map1[_local2][_local1];
_local3 = true;
break;
}
_local1++;
}
if (_local3 == true) {
break;
}
_local2++;
}
return(_local3);
}
function findFirstOnMap(co) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == co) {
_local3[0] = _local1;
_local3[1] = _local2;
break;
}
_local1++;
}
_local2++;
}
return(_local3);
}
stop();
stopLoop("begin");
gameMode = "EDIT";
curFrame = "c1";
b7.enabled = false;
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mini_map1.onPress = function () {
playSound(sClick);
mc_ramka._y = this._y - 3;
clean_creator("all");
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ["9x", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, w, 0], ["9", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"]];
objective = "o3";
hero = 0;
bckFrame = 4;
createMap();
actBrush = "-1";
};
mini_map2.onPress = function () {
playSound(sClick);
mc_ramka._y = this._y - 3;
clean_creator("all");
bckFrame = 4;
objective = "o1";
hero = 0;
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, "7", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, "7", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, "7", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, "7", 0, 0, 0, 0, 0, 0, 0, 0, "o1", "d5"], [0, 0, 0, 0, 0, 0, 0, 0, 0, "7", 0, 0, 0, 0, 0, 0, 0, 0, "d5", "d5"], ["2", "2", "2", "2", "2", "2", "2", 0, 0, "7", 0, 0, "2", "2", "2", "2", "2", "2", "2", "2"], [0, 0, 0, 0, 0, 0, 0, 0, 0, "7", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, "7", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, "7", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, "7", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ["9x", 0, 0, 0, 0, 0, 0, 0, 0, "7", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ["9", 0, 0, 0, 0, 0, 0, 0, 0, "7", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ["2", "2", "2", "2", "2", "2", "2", 0, 0, "7", 0, 0, "2", "2", "2", "2", "2", "2", "2", "2"]];
createMap();
actBrush = "-1";
};
var witch;
b7.onPress = (b1.onPress = (b2.onPress = (b3.onPress = (b4.onPress = (b5.onPress = (b8.onPress = (b6.onPress = function () {
var lastNFrame = nFrame;
playSound(sWL);
if (this == b1) {
if (this._parent.getNextHighestDepth() != (mc_pop_warning1.getDepth() + 2)) {
mc_pop_warning1.swapDepths(this._parent.getNextHighestDepth());
}
mc_pop_warning1._visible = true;
} else {
var i = 1;
while (i < 9) {
if (this == eval ("b" + i)) {
witch = i;
b1.gotoAndStop(1);
b2.gotoAndStop(1);
b3.gotoAndStop(1);
b4.gotoAndStop(1);
b5.gotoAndStop(1);
b6.gotoAndStop(1);
b7.gotoAndStop(1);
b8.gotoAndStop(1);
this.gotoAndStop(10);
break;
}
i++;
}
nFrame = "c" + witch;
if ((lastNFrame == "game") && (this != b6)) {
clean();
gotoAndPlay ("c8_end");
} else {
gotoAndPlay(curFrame + "_end");
}
}
})))))));
b1.gotoAndStop(10);
var map_obj2 = new Array();
map_obj2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mc_hand0.duplicateMovieClip("mc_hand", this.getNextHighestDepth());
var tab_masks = new Array();
duplicateMovieClip (mc_map, "mc_mask", this.getNextHighestDepth());
var pojedyncze = true;
stop();
var map_moves = new Array();
var map_pointer = 1;
var counter = 0;
var wid = 31;
var fields = new Array();
var ruchM = false;
sq_sym.gotoAndStop("1a");
mc_sqx.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "2";
sq_sym.gotoAndStop("kladka");
};
mc_sq.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "1";
sq_sym.gotoAndStop("1a");
};
mc_skala.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "101";
sq_sym.gotoAndStop("skala");
};
mc_sqb.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "3";
sq_sym.gotoAndStop("swamp");
};
mc_sqc.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "4";
sq_sym.gotoAndStop("zapadka");
};
mc_chest.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "5";
sq_sym.gotoAndStop("chest");
};
mc_chestx.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "6";
sq_sym.gotoAndStop("chestx");
};
mc_liana.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "7";
sq_sym.gotoAndStop("liana");
};
mc_hero.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "9";
sq_sym.gotoAndStop("hero");
};
mc_sadzawka.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = a;
sq_sym.gotoAndStop("sadzawka");
};
mc_statue.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = s;
sq_sym.gotoAndStop("statue");
};
mc_diamond.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = d;
sq_sym.gotoAndStop("diamond");
};
mc_wall.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = l;
sq_sym.gotoAndStop("wall");
};
mc_sqmagma.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = m;
sq_sym.gotoAndStop("magma");
};
mc_posag.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = p;
sq_sym.gotoAndStop("posag");
};
mc_posag2.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = p2;
sq_sym.gotoAndStop("posag2");
};
mc_exit.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
sq_sym.gotoAndStop("exit");
actBrush = objective;
};
mc_pnacze.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = n;
sq_sym.gotoAndStop("pnacze");
};
mc_dzban.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = b;
sq_sym.gotoAndStop("dzban");
};
mc_spider.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = r;
sq_sym.gotoAndStop("spider");
};
mc_rubber.onPress = function () {
playSound(sClick);
actBrush = "0";
mc_rubber.gotoAndStop(2);
};
mc_batsCage.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = c;
sq_sym.gotoAndStop("cage");
};
firstTime();
createMap();
var mDown = false;
this.onMouseDown = function () {
mDown = true;
};
this.onMouseUp = function () {
mDown = false;
};
var oldK = -1;
var oldPos1 = -1;
var oldPos0 = -1;
var myTab = new Array();
myTab.x = new Array();
myTab.y = new Array();
var opoznienie = 0;
this.onMouseMove = function () {
if (actBrush != "-1") {
var _local19 = _xmouse > mc_map._x;
var _local21 = _xmouse < (mc_map._x + mc_map._width);
var _local23 = _ymouse > mc_map._y;
var _local20 = _ymouse < (mc_map._y + mc_map._height);
var _local18 = false;
if (((_local23 && (_local20)) && (_local21)) && (_local19)) {
_local18 = true;
} else {
mc_hand._visible = false;
}
if (_local18 == true) {
var _local17 = Math.floor((_xmouse - mc_map._x) / wid);
var _local16 = Math.floor((_ymouse - mc_map._y) / wid);
var _local22 = (_local16 * map1[0].length) + _local17;
if ((((((((((map1[_local16][_local17] == "1") || (map1[_local16][_local17] == "3")) || (map1[_local16][_local17] == m)) || (map1[_local16][_local17] == n)) || (map1[_local16][_local17] == "101")) || (map1[_local16][_local17] == "7")) || (map1[_local16][_local17] == "2")) || (map1[_local16][_local17] == l)) && (przesuwanie == true)) && (ruchM == false)) {
pojedyncze = false;
myTab = new Array();
myTab.x = new Array();
myTab.y = new Array();
myTab.x[0] = _local17;
myTab.y[0] = _local16;
var _local8 = 0;
while (_local8 < myTab.x.length) {
var _local2 = myTab.y[_local8];
var _local3 = myTab.x[_local8];
br = map1[_local2][_local3];
var _local9 = map1[_local2 - 1][_local3] == br;
var _local10 = map1[_local2 + 1][_local3] == br;
var _local12 = map1[_local2][_local3 + 1] == br;
var _local11 = map1[_local2][_local3 - 1] == br;
if ((map1[_local2][_local3] == "7") || (map1[_local2][_local3] == "7a")) {
_local9 = ((map1[_local2 - 1][_local3] == br) || (map1[_local2 - 1][_local3] == (br + "a"))) || ((map1[_local2 - 1][_local3] + "a") == br);
_local10 = ((map1[_local2 + 1][_local3] == br) || (map1[_local2 + 1][_local3] == (br + "a"))) || ((map1[_local2 + 1][_local3] + "a") == br);
_local12 = false;
_local11 = false;
}
if (map1[_local2][_local3] == "2") {
_local9 = false;
_local10 = false;
}
bylo = true;
if (_local9) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == _local3) && (myTab.y[_local7] == (_local2 - 1))) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3);
myTab.y.push(_local2 - 1);
}
bylo = true;
if (_local10) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == _local3) && (myTab.y[_local7] == (_local2 + 1))) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3);
myTab.y.push(_local2 + 1);
}
bylo = true;
if (_local12) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == (_local3 + 1)) && (myTab.y[_local7] == _local2)) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3 + 1);
myTab.y.push(_local2);
}
bylo = true;
if (_local11) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == (_local3 - 1)) && (myTab.y[_local7] == _local2)) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3 - 1);
myTab.y.push(_local2);
}
_local8++;
}
ruchM = true;
}
if ((przesuwanie == true) && ((oldPos0 != _local17) || (oldPos1 != _local16))) {
if (map1[oldPos1][oldPos0] == "9") {
if (((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == (actBrush + "x"))) && (((map1[_local16 - 1][_local17] == 0) || (map1[_local16 - 1][_local17] == (actBrush + "x"))) || (map1[_local16 - 1][_local17] == "9"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if (map1[oldPos1][oldPos0].substr(0, 1) == "e") {
if (((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == ("x" + actBrush))) && (((map1[_local16 - 1][_local17] == 0) || (map1[_local16 - 1][_local17] == ("x" + actBrush))) || (map1[_local16 - 1][_local17].substr(0, 1) == "e"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if ((map1[oldPos1][oldPos0] == objective) || (map1[oldPos1][oldPos0] == zx)) {
if (((((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == zx)) && (((map1[_local16 + 1][_local17] == 0) || (map1[_local16 + 1][_local17] == zx)) || (map1[_local16 + 1][_local17] == objective))) && (((map1[_local16 + 1][_local17 + 1] == 0) || (map1[_local16 + 1][_local17 + 1] == zx)) || (map1[_local16 + 1][_local17 + 1] == objective))) && (((map1[_local16][_local17 + 1] == 0) || (map1[_local16][_local17 + 1] == zx)) || (map1[_local16][_local17 + 1] == objective))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if ((((((((((((map1[oldPos1][oldPos0] != "1") && (map1[oldPos1][oldPos0] != "3")) && (map1[oldPos1][oldPos0] != m)) && (map1[oldPos1][oldPos0] != n)) && (map1[oldPos1][oldPos0] != "101")) && (map1[oldPos1][oldPos0] != "7")) && (map1[oldPos1][oldPos0] != "2")) && (map1[oldPos1][oldPos0] != "9")) && (map1[oldPos1][oldPos0] != objective)) && (map1[oldPos1][oldPos0] != "9x")) && (map1[oldPos1][oldPos0] != zx)) && (map1[oldPos1][oldPos0] != l)) {
pojedyncze = true;
if (map1[oldPos1][oldPos0] == "7a") {
actBrush = r;
}
if ((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == (actBrush + "x"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
if ((actBrush == r) && (map1[_local16][_local17] == "7")) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
} else if ((((map1[oldPos1][oldPos0] != "9") && (map1[oldPos1][oldPos0] != objective)) && (map1[oldPos1][oldPos0] != "9x")) && (map1[oldPos1][oldPos0] != zx)) {
var _local6 = _local17 - oldPos0;
var _local5 = _local16 - oldPos1;
var _local15 = true;
var _local7 = 0;
while (_local7 < myTab.y.length) {
if ((map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] != 0) && (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] != map1[oldPos1][oldPos0])) {
_local15 = false;
break;
}
_local7++;
}
if (_local15 == true) {
var _local13 = 0;
_local7 = 0;
while (_local7 < myTab.y.length) {
if (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] == 0) {
_local13++;
}
if (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] == map1[oldPos1][oldPos0]) {
var _local4 = 0;
while (_local4 < myTab.y.length) {
if (((myTab.y[_local7] + _local5) == myTab.y[_local4]) && ((myTab.x[_local7] + _local6) == myTab.x[_local4])) {
_local13++;
break;
}
_local4++;
}
}
_local7++;
}
if (_local13 != myTab.x.length) {
_local15 = false;
}
}
if (_local15 == true) {
_local7 = 0;
while (_local7 < myTab.y.length) {
usun_obiekt(map1[myTab.y[_local7]][myTab.x[_local7]], myTab.x[_local7], myTab.y[_local7]);
_local7++;
}
_local7 = 0;
while (_local7 < myTab.y.length) {
var _local14 = ((myTab.y[_local7] + _local5) * map1[0].length) + (myTab.x[_local7] + _local6);
pressField(_local14);
myTab.y[_local7] = myTab.y[_local7] + _local5;
myTab.x[_local7] = myTab.x[_local7] + _local6;
_local7++;
}
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
przesun(_local17, _local16);
}
polacz_klocki();
}
}
if ((przesuwanie == false) && (actBrush == "0")) {
if (mc_hand.getDepth() != (this.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this.getNextHighestDepth());
}
mc_hand.gotoAndStop("rubber");
mc_hand._x = _xmouse - 15;
mc_hand._y = _ymouse - 15;
mc_hand._visible = true;
}
if ((mDown == true) && (przesuwanie == true)) {
if (mc_hand.getDepth() != (this.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this.getNextHighestDepth());
}
mc_hand.gotoAndStop("hand_close");
mc_hand._x = _xmouse - 15;
mc_hand._y = _ymouse - 15;
}
if ((mDown == true) && (przesuwanie == false)) {
_local17 = Math.floor((_xmouse - mc_map._x) / wid);
_local16 = Math.floor((_ymouse - mc_map._y) / wid);
if ((map1[_local16][_local17] == 0) || (actBrush == "0")) {
if ((((map1[_local16][_local17] != "9") && (map1[_local16][_local17] != "9x")) && (map1[_local16][_local17] != objective)) && (map1[_local16][_local17] != zx)) {
_local22 = (_local16 * map1[0].length) + _local17;
pressField(_local22);
if ((opoznienie % 4) == 0) {
polacz_klocki();
}
opoznienie++;
}
}
}
}
}
};
mc_rubber_all.onPress = function () {
playSound(sClick);
clean_creator("some");
};
mc_sadzawka.mc_rybka.stop();
mc_g2.onPress = function () {
playSound(sClick);
mc_exit.nextFrame();
};
mc_g1.onPress = function () {
playSound(sClick);
mc_exit.prevFrame();
};
changeFrameOf("9", hero + 1);
var przesuwanie = false;
mc_undo.onPress = function () {
playSound(sClick);
clean_creator("all");
map_pointer--;
map_pointer = ((map_pointer < 0) ? 0 : (map_pointer));
map1 = new Array();
map1 = copyMap(map_moves[map_pointer]);
createMap();
};
mc_redo.onPress = function () {
playSound(sClick);
clean_creator("all");
map_pointer++;
map_pointer = ((map_pointer > (map_moves.length - 1)) ? (map_moves.length - 1) : (map_pointer));
map1 = new Array();
map1 = copyMap(map_moves[map_pointer]);
createMap();
};
actBrush = "-1";
mc_scratch.b1.onPress = function () {
mc_saved.b1.enabled = true;
mc_scratch.b1.enabled = true;
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
playSound(sClick);
mc_ramka._y = this._parent._y - 3;
clean_creator("all");
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
createMap();
actBrush = "-1";
objective = -1;
hero = -1;
bckFrame = -1;
nFrame = "c2";
gotoAndPlay ("c1_end");
};
mc_saved.b1.onPress = function () {
mc_saved.b1.enabled = true;
mc_scratch.b1.enabled = true;
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
playSound(sClick);
mc_ramka._y = this._parent._y;
clean_creator("all");
mc_map.gotoAndStop(so.data.bckFrame);
mc_map._alpha = 0;
map1 = copyMap(so.data.map1);
objective = so.data.objective;
hero = so.data.hero;
bckFrame = so.data.bckFrame;
createMap();
actBrush = "-1";
};
mini_map3.onPress = function () {
playSound(sClick);
mc_ramka._y = this._y;
clean_creator("all");
bckFrame = 3;
objective = "o1";
hero = 1;
map1 = [["o1", "d5", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "1", 0, 0, 0, 0], ["d5", "d5", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "1", 0, 0, 0, 0], ["1", "1", "1", "1", "1", "1", 0, 0, 0, 0, 0, 0, 0, 0, "1", "1", 0, "1", 0, 0], [0, 0, 0, 0, 0, "1", "1", 0, 0, 0, 0, 0, 0, 0, "1", 0, 0, "1", 0, "4"], [0, 0, 0, 0, 0, 0, "1", "1", "1", 0, "1", "1", "1", "1", "1", 0, "1", "1", 0, 0], ["4", "1", "1", "1", 0, 0, 0, 0, 0, 0, "1", 0, 0, 0, "1", 0, "1", 0, 0, 0], [0, 0, 0, "1", "1", "1", "1", "1", "1", "1", "1", 0, 0, 0, 0, 0, "1", 0, "4", 0], [0, 0, 0, 0, "1", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "1", 0, 0, 0], [0, 0, 0, 0, "1", 0, "1", "1", "1", "1", "1", "1", 0, 0, 0, 0, "1", 0, 0, 0], ["1", "1", "1", 0, 0, 0, "1", 0, 0, 0, 0, "1", 0, 0, 0, 0, "1", 0, 0, "4"], ["9x", 0, "1", "1", "1", "1", "1", 0, 0, 0, 0, "1", "1", "1", "1", "1", "1", 0, 0, 0], ["9", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ["1", "1", "1", "1", "1", "1", "1", "1", "1", 0, "1", "1", "1", "1", "1", "1", "1", "1", "1", 0]];
actBrush = "-1";
createMap();
actBrush = "-1";
};
mini_map4.onPress = function () {
playSound(sClick);
mc_ramka._y = this._y - 3;
clean_creator("all");
bckFrame = 8;
objective = "o1";
hero = 2;
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, "101", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, "101", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, "101", "101", "101", "101", "101", 0, 0, "101", 0, 0, 0, 0, 0, 0, 0, "101", "101", 0], [0, 0, "101", 0, 0, 0, 0, 0, "101", "101", 0, 0, 0, 0, 0, 0, 0, 0, "101", 0], [0, 0, "101", 0, 0, 0, 0, 0, "101", 0, 0, "101", 0, 0, 0, 0, 0, 0, "101", 0], [0, 0, "101", 0, 0, 0, 0, 0, "101", 0, 0, "101", 0, 0, "101", "101", "101", "101", "101", 0], [0, 0, "101", "101", "101", 0, "101", "101", "101", 0, 0, "101", 0, 0, "101", 0, 0, 0, 0, 0], [0, 0, 0, 0, "101", 0, 0, 0, "101", 0, 0, "101", 0, 0, "101", 0, 0, 0, 0, 0], [0, 0, 0, 0, "101", 0, 0, 0, "101", 0, "101", "101", 0, 0, "101", 0, "101", "101", "101", "101"], [0, 0, 0, 0, "101", 0, 0, 0, "101", 0, "101", 0, 0, 0, "101", 0, 0, 0, 0, 0], ["9x", 0, 0, 0, "101", 0, 0, 0, 0, 0, "101", 0, 0, 0, "101", 0, 0, 0, "o1", "d5"], ["9", 0, 0, 0, "101", 0, 0, 0, 0, 0, "101", 0, 0, 0, "101", 0, 0, 0, "d5", "d5"], ["101", "101", 0, "101", "101", 0, "101", "101", "101", "101", "101", 0, 0, 0, "101", "101", "101", "101", "101", "101"]];
createMap();
actBrush = "-1";
};
mini_map5.onPress = function () {
playSound(sClick);
mc_ramka._y = this._y - 3;
clean_creator("all");
bckFrame = 5;
objective = "o1";
hero = 3;
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "1", 0, 0, 0, "wa", 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "1", 0, 0, 0, "wa", 0, 0, 0, 0, 0], ["wa", "1", "1", "1", 0, 0, 0, 0, 0, 0, "1", 0, 0, 0, "1", 0, 0, 0, 0, 0], [0, 0, 0, "1", "2", "2", "2", "2", "2", 0, "wa", 0, 0, 0, "1", 0, "2", "2", "2", "2"], [0, 0, 0, "1", 0, 0, 0, 0, 0, 0, "wa", 0, 0, 0, "1", 0, 0, 0, 0, 0], [0, 0, 0, "1", "1", "1", "1", "1", "1", "1", "1", "4", 0, "1", "1", "1", "1", "1", 0, 0], ["1", "1", "wa", "1", 0, 0, 0, 0, "wa", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, "1", 0, 0, 0, 0, "wa", 0, 0, 0, 0, 0, 0, 0, 0, 0, "2", "2"], [0, 0, 0, "1", 0, 0, 0, 0, "wa", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ["wa", "1", "1", "1", 0, "1", "1", "1", "1", "1", "1", "1", "4", "4", "4", "4", "4", "1", "1", "1"], [0, "o1", "d5", "1", 0, 0, "wa", 0, 0, 0, "wa", 0, 0, 0, 0, 0, 0, 0, 0, "9x"], [0, "d5", "d5", "1", 0, 0, "wa", 0, 0, 0, "wa", 0, 0, 0, 0, 0, 0, 0, 0, "9"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "3", "3", "3", "3", "3", "1", "1", "1"]];
createMap();
actBrush = "-1";
};
var firstAct = 0;
var tab_thumbs = new Array(mc_scratch, mc_saved, mini_map1, mini_map2, mini_map3, mini_map4, mini_map5);
mc_changer.b_down.onPress = function () {
playSound(sClick);
if (firstAct > (5 - tab_thumbs.length)) {
firstAct--;
mc_ramka._y = mc_ramka._y - 71;
if (mc_ramka._y < 120) {
mc_ramka._visible = false;
} else {
mc_ramka._visible = true;
}
var _local1 = 0;
while (_local1 < tab_thumbs.length) {
tab_thumbs[_local1]._y = tab_thumbs[_local1]._y - 71;
if (((_local1 + firstAct) >= 0) && ((_local1 + firstAct) < 5)) {
tab_thumbs[_local1]._visible = true;
} else {
tab_thumbs[_local1]._visible = false;
}
_local1++;
}
}
};
mc_changer.b_up.onPress = function () {
playSound(sClick);
if (firstAct < 0) {
firstAct++;
mc_ramka._y = mc_ramka._y + 71;
if ((mc_ramka._y > 450) || (mc_ramka._y < 130)) {
mc_ramka._visible = false;
} else {
mc_ramka._visible = true;
}
var _local1 = 0;
while (_local1 < tab_thumbs.length) {
tab_thumbs[_local1]._y = tab_thumbs[_local1]._y + 71;
if (((_local1 + firstAct) >= 0) && ((_local1 + firstAct) < 5)) {
tab_thumbs[_local1]._visible = true;
} else {
tab_thumbs[_local1]._visible = false;
}
_local1++;
}
}
};
mc_pop.swapDepths(this.getNextHighestDepth());
var tab_menu = new Array(b1, b2, b3, b4, b5, b6, b7, b_next, b_prev, mc_changer.b_down, mc_changer.b_up);
block(false, fields);
block(false, tab_menu);
mc_pop.btn_close.onPress = function () {
playSound(sClick);
mc_saved.b1.enabled = true;
mc_scratch.b1.enabled = true;
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
};
Frame 266
cleanClips();
unlock_screen._visible = true;
mc_popHelp0._visible = false;
removeMovieClip(mc_popHelp);
mc_pop_warning1._visible = false;
Frame 272
stop();
Frame 315
cleanClips();
unlock_screen._visible = false;
Key.removeListener(unlock_screen.keyListener);
Frame 320
mc_popHelp0._visible = false;
stopLoop("map");
stopLoop("begin");
startLoop("level");
removeMovieClip(mc_popHelp);
mc_pop_warning1._visible = false;
gotoAndPlay(nFrame);
Frame 325
function slideMaps() {
mc_changer.v1 = ((first_act + 5) + "/") + 9;
t1.n1.gotoAndStop(2 + first_act);
t2.n1.gotoAndStop(3 + first_act);
t3.n1.gotoAndStop(4 + first_act);
t4.n1.gotoAndStop(5 + first_act);
t5.n1.gotoAndStop(6 + first_act);
if ((((bckFrame - 1) - first_act) > 0) && (((bckFrame - 1) - first_act) < 6)) {
mc_ramka._y = eval ("t" + ((bckFrame - 1) - first_act))._y;
mc_ramka._visible = true;
} else {
mc_ramka._visible = false;
}
}
stop();
curFrame = "c2";
b_next._visible = true;
b7.enabled = false;
mc_map._alpha = 100;
var first_act = 0;
var frames_c = (t1.n1._totalframes - 1);
mc_changer.v1 = ((first_act + 1) + "/") + (frames_c - 4);
var witch;
mc_pop2._visible = false;
mc_map.gotoAndStop(bckFrame);
t1.onPress = (t2.onPress = (t3.onPress = (t4.onPress = (t5.onPress = function () {
playSound(sClick);
var i = 1;
while (i < 6) {
if (this == eval ("t" + i)) {
witch = i + first_act;
mc_map.gotoAndStop(witch + 1);
so.data.bckFrame = witch + 1;
bckFrame = witch + 1;
mc_ramka._visible = true;
mc_ramka._y = eval ("t" + ((bckFrame - 1) - first_act))._y;
mc_map._alpha = 100;
break;
}
i++;
}
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
}))));
var i = 0;
while (i < fields.length) {
removeMovieClip(fields[i]);
i++;
}
mc_ramka._y = eval ("t" + ((bckFrame - 1) - first_act))._y;
t1.n1.gotoAndStop(2);
t2.n1.gotoAndStop(3);
t3.n1.gotoAndStop(4);
t4.n1.gotoAndStop(5);
t5.n1.gotoAndStop(6);
slideMaps();
mc_changer.b_down.onPress = function () {
playSound(sClick);
if ((first_act + 5) < frames_c) {
first_act++;
slideMaps();
}
};
mc_changer.b_up.onPress = function () {
playSound(sClick);
if (first_act > 0) {
first_act--;
slideMaps();
}
};
b1.gotoAndStop(1);
b2.gotoAndStop(10);
b3.gotoAndStop(1);
b4.gotoAndStop(1);
b5.gotoAndStop(1);
b6.gotoAndStop(1);
b7.gotoAndStop(1);
b8.gotoAndStop(1);
var tab_menu = new Array(b1, b2, b3, b4, b5, b6, b7, b_next, b_prev, mc_changer.b_down, mc_changer.b_up);
trace(bckFrame);
if (bckFrame == -1) {
mc_map.gotoAndStop(1);
mc_pop.swapDepths(this.getNextHighestDepth());
block(false, fields);
block(false, tab_menu);
} else {
mc_pop._visible = false;
}
playSound(sClick);
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
Frame 353
mc_map._alpha = 0;
cleanClips();
if ((bckFrame == null) && (nFrame != "c1")) {
nFrame = "c2";
}
mc_map.enabled = false;
Frame 358
mc_popHelp0._visible = false;
stopLoop("map");
stopLoop("begin");
startLoop("level");
removeMovieClip(mc_popHelp);
mc_pop_warning1._visible = false;
gotoAndPlay(nFrame);
Frame 363
function changeFrameOf(_brush, _frame) {
trace((("changeFrameOf:" + _brush) + ", ") + _frame);
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == _brush) {
var _local3 = getClipNumFromWsp(_local1, _local2);
fields[_local3].n1.gotoAndStop(_frame);
}
_local1++;
}
_local2++;
}
}
function firstTime() {
counter = 0;
var i = 0;
while (i < 13) {
var j = 0;
while (j < 20) {
duplicateMovieClip (sq_sym, "field" + counter, 1111 - counter);
fields[counter] = eval ("field" + counter);
fields[counter]._x = mc_map._x + (j * wid);
fields[counter]._y = mc_map._y + (i * wid);
if ((((i == 0) || (i == 12)) || (j == 0)) || (j == 19)) {
dodaj_maske(fields[counter]);
}
counter++;
j++;
}
i++;
}
}
function createMap() {
counter = 0;
var _local4 = 0;
while (_local4 < 13) {
var _local3 = 0;
while (_local3 < 20) {
fields[counter].gotoAndStop(brushToframe(map1[_local4][_local3], fields[counter], _local4, _local3));
if ((((map1[_local4][_local3] == w) || (map1[_local4][_local3] == x)) || (map1[_local4][_local3] == y)) || (map1[_local4][_local3] == z)) {
fields[counter].n1.gotoAndStop(objective);
}
if (map1[_local4][_local3] == "9") {
fields[counter].n1.gotoAndStop(hero + 1);
}
if (map1[_local4][_local3].substr(0, 1) == "e") {
fields[counter].n1.gotoAndStop(Number(map1[_local4][_local3].split("e").join("")) + 1);
trace(("gotoAndStop:" + Number(map1[_local4][_local3].split("e").join(""))) + 1);
}
fields[counter].onRelease = (fields[counter].onReleaseOutside = function () {
if (przesuwanie == true) {
actBrush = defBrush;
ruchM = false;
mc_hand.gotoAndStop("hand");
}
if (((((actBrush == "9") || (actBrush == w)) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
actBrush = "-2";
}
if (actBrush.substr(0, 1) == "e") {
actBrush = "-2";
}
polacz_klocki();
przesuwanie = false;
if (map_pointer < (map_moves.length - 1)) {
map_moves.splice(map_pointer + 1);
}
map_moves[map_moves.length] = new Array();
map_moves[map_moves.length - 1] = copyMap(map1);
map_pointer = map_moves.length - 1;
mc_undo.enabled = true;
mc_redo.enabled = true;
});
fields[counter].onRollOver = function () {
var _local4 = getK(this, fields);
var _local2 = new Array();
_local2 = getWsp(fields[_local4]);
if (((actBrush != "0") && (map1[_local2[1]][_local2[0]] != 0)) && (actBrush != "-1")) {
if (mc_hand.getDepth() != (this._parent.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this._parent.getNextHighestDepth());
}
mc_hand.gotoAndStop("hand");
mc_hand._x = this._x;
mc_hand._y = this._y;
mc_hand._visible = true;
} else if (actBrush != "0") {
mc_hand._visible = false;
}
if (map1[_local2[1]][_local2[0]] == 0) {
this.gotoAndStop(brushToframe(actBrush, null, -1, -1));
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("rope_spider");
}
if ((actBrush == "9") && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
this.n1.gotoAndStop(hero + 1);
}
if ((actBrush.substr(0, 1) == "e") && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
this.n1.gotoAndStop(enemy + 1);
}
if ((actBrush == objective) && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
var _local3 = 0;
switch (objective) {
case w :
_local3 = 1;
break;
case x :
_local3 = 2;
break;
case y :
_local3 = 3;
break;
case z :
_local3 = 4;
}
this.n1.gotoAndStop(_local3);
}
};
fields[counter].onRollOut = function () {
sq_sym._visible = false;
var _local3 = getK(this, fields);
var _local2 = new Array();
_local2 = getWsp(fields[_local3]);
if (map1[_local2[1]][_local2[0]] == 0) {
this.gotoAndStop("out");
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("liana");
}
};
fields[counter].onPress = function () {
if (actBrush != "-1") {
var _local3 = getMouseK();
var _local2 = new Array();
_local2 = getWsp(fields[_local3]);
if (((map1[_local2[1]][_local2[0]] == 0) || (actBrush == "0")) && (actBrush != "-2")) {
if ((((((map1[_local2[1]][_local2[0]].substr(0, 2) != "xe") && (map1[_local2[1]][_local2[0]].substr(0, 1) != "e")) && (map1[_local2[1]][_local2[0]] != "9")) && (map1[_local2[1]][_local2[0]] != "9x")) && (map1[_local2[1]][_local2[0]] != objective)) && (map1[_local2[1]][_local2[0]] != zx)) {
pressField(_local3);
polacz_klocki();
}
} else if (((actBrush != r) || (map1[_local2[1]][_local2[0]] != "7")) && (actBrush != 0)) {
if (map1[_local2[1]][_local2[0]] == "9x") {
przesun(_local2[0], _local2[1] + 1);
} else if (map1[_local2[1]][_local2[0]].substr(0, 2) == "xe") {
if ((map1[_local2[1]][_local2[0]] == "xe4") || (map1[_local2[1]][_local2[0]] == "xe5")) {
var _local4 = findFirstOnMap(map1[_local2[1]][_local2[0]].split("x").join(""));
var _local6 = _local4[0] - _local2[0];
var _local5 = _local4[1] - _local2[1];
przesun(_local2[0] + _local6, _local2[1] + _local5);
} else {
przesun(_local2[0], _local2[1] + 1);
}
} else if (map1[_local2[1]][_local2[0]] == zx) {
var _local4 = findFirstOnMap(objective);
var _local6 = _local4[0] - _local2[0];
var _local5 = _local4[1] - _local2[1];
przesun(_local2[0] + _local6, _local2[1] + _local5);
} else {
przesun(_local2[0], _local2[1]);
}
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("rope_spider");
pressField(_local3);
polacz_klocki();
}
}
};
if (map1[_local4][_local3] == "2") {
rysuj_mosty(Math.floor(_local3), Math.floor(_local4));
}
counter++;
_local3++;
}
_local4++;
}
polacz_klocki();
}
function pressField(nField) {
if ((actBrush != "-1") && (actBrush != "-2")) {
var _local1 = new Array();
_local1 = getWsp(fields[nField]);
var _local4 = true;
if (actBrush == "0") {
if (map1[_local1[1]][_local1[0]] == a) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
}
if ((((map1[_local1[1]][_local1[0]] == w) || (map1[_local1[1]][_local1[0]] == x)) || (map1[_local1[1]][_local1[0]] == y)) || (map1[_local1[1]][_local1[0]] == z)) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
}
if (map1[_local1[1]][_local1[0]] == "9") {
map1[_local1[1] - 1][_local1[0]] = actBrush;
}
if (map1[_local1[1]][_local1[0]].substr(0, 1) == "e") {
if ((map1[_local1[1]][_local1[0]] == "e4") || (map1[_local1[1]][_local1[0]] == "e5")) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
} else {
map1[_local1[1] - 1][_local1[0]] = actBrush;
}
}
}
if (actBrush == "9") {
if (map1[_local1[1] - 1][_local1[0]] == 0) {
_local4 = true;
} else {
_local4 = false;
}
var _local3 = 0;
while (_local3 < 13) {
if (_local4 == false) {
break;
}
var _local2 = 0;
while (_local2 < 20) {
if (map1[_local3][_local2] == "9") {
_local4 = false;
break;
}
_local2++;
}
_local3++;
}
}
if (actBrush.substr(0, 1) == "e") {
if ((actBrush == "e4") || (actBrush == "e5")) {
_local4 = Boolean(((map1[_local1[1]][_local1[0] + 1] == 0) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0]] == 0));
} else {
_local4 = Boolean(map1[_local1[1] - 1][_local1[0]] == 0);
}
}
if ((((actBrush == w) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
if (((map1[_local1[1]][_local1[0] + 1] == 0) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0]] == 0)) {
_local4 = true;
} else {
_local4 = false;
}
var _local3 = 0;
while (_local3 < 13) {
var _local2 = 0;
while (_local2 < 20) {
if ((((map1[_local3][_local2] == w) || (map1[_local3][_local2] == x)) || (map1[_local3][_local2] == y)) || (map1[_local3][_local2] == z)) {
_local4 = false;
break;
}
_local2++;
}
_local3++;
}
}
trace("mozliwe postawienie:" + _local4);
if (actBrush == a) {
if ((((((map1[_local1[1]][_local1[0]] == 0) && (map1[_local1[1]][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 2][_local1[0] + 1] == "1")) && (map1[_local1[1] + 1][_local1[0]] == 0)) && (map1[_local1[1] + 2][_local1[0]] == 1)) {
_local4 = true;
} else {
_local4 = false;
}
}
if (_local4 == true) {
if ((actBrush == r) && (map1[_local1[1]][_local1[0]] == "7")) {
map1[_local1[1]][_local1[0]] = "7a";
} else {
map1[_local1[1]][_local1[0]] = actBrush;
}
fields[nField].gotoAndStop(brushToframe(map1[_local1[1]][_local1[0]], fields[nField], _local1[1], _local1[0]));
if (actBrush == "9") {
fields[nField].n1.gotoAndStop(hero + 1);
map1[_local1[1] - 1][_local1[0]] = "9x";
}
if (actBrush.substr(0, 1) == "e") {
trace("stawiamy enemy:" + actBrush);
if ((actBrush == "e4") || (actBrush == "e5")) {
fields[nField].n1.gotoAndStop(enemy + 1);
map1[_local1[1]][_local1[0] + 1] = "x" + actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = "x" + actBrush;
map1[_local1[1] + 1][_local1[0]] = "x" + actBrush;
} else {
fields[nField].n1.gotoAndStop(enemy + 1);
map1[_local1[1] - 1][_local1[0]] = "xe" + enemy;
}
}
if (actBrush == a) {
map1[_local1[1]][_local1[0] + 1] = ax;
map1[_local1[1] + 1][_local1[0] + 1] = ax;
map1[_local1[1] + 1][_local1[0]] = ax;
}
if ((((actBrush == w) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
fields[nField].n1.gotoAndStop(actBrush);
map1[_local1[1]][_local1[0] + 1] = zx;
map1[_local1[1] + 1][_local1[0] + 1] = zx;
map1[_local1[1] + 1][_local1[0]] = zx;
}
} else {
fields[nField].gotoAndStop("out");
}
if (actBrush == "2") {
rysuj_mosty(Math.floor(_local1[0]), Math.floor(_local1[1]));
}
}
}
function getWsp(clip) {
var _local1 = new Array(2);
_local1[0] = Math.round((clip._x - mc_map._x) / wid);
_local1[1] = Math.round((clip._y - mc_map._y) / wid);
return(_local1);
}
function getK(clip, tab) {
var _local1 = 0;
while (_local1 < tab.length) {
if (clip == tab[_local1]) {
return(_local1);
}
_local1++;
}
}
function getMouseK() {
var _local1 = Math.floor((_xmouse - mc_map._x) / wid);
var _local2 = Math.floor((_ymouse - mc_map._y) / wid);
return(getClipNumFromWsp(_local1, _local2));
}
function getClipNumFromWsp(xx, yy) {
var _local1 = (yy * 20) + xx;
return(_local1);
}
function brushToframe(brush, clip, pos1, pos0) {
var _local1 = "";
if (brush.substr(0, 1) == "e") {
return("enemy");
}
switch (brush) {
case "0" :
if (clip != null) {
delete map_obj2[pos1][pos0];
map_obj2[pos1][pos0] = 0;
}
_local1 = "out";
break;
case "1" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(1, clip, -111);
}
_local1 = "1a";
break;
case "101" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(101, clip, -111);
}
_local1 = "skala";
break;
case "2" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(2, clip, -111);
}
_local1 = "kladka";
break;
case "3" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(3, clip, -111);
}
_local1 = "swamp";
break;
case "4" :
_local1 = "zapadka";
break;
case "5" :
_local1 = "chest";
break;
case "6" :
_local1 = "chestx";
break;
case "7" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(12, clip, -111);
}
_local1 = "liana";
break;
case "7a" :
_local1 = "rope_spider";
break;
case s :
_local1 = "statue";
break;
case d :
_local1 = "diamond";
break;
case b :
_local1 = "dzban";
break;
case c :
_local1 = "cage";
break;
case r :
_local1 = "spider";
break;
case "9" :
_local1 = "hero";
break;
case m :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(13, clip, -111);
}
_local1 = "magma";
break;
case n :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(7, clip, -111);
}
_local1 = "pnacze";
break;
case p :
_local1 = "posag";
break;
case p2 :
_local1 = "posag2";
break;
case r :
_local1 = "spider";
break;
case a :
_local1 = "sadzawka";
break;
case l :
_local1 = "wall";
break;
case w :
_local1 = "exit";
break;
case x :
_local1 = "exit";
break;
case y :
_local1 = "exit";
break;
case z :
_local1 = "exit";
}
return(_local1);
}
function polacz_klocki() {
var _local6 = 0;
while (_local6 < map_obj2.length) {
var _local3 = 0;
while (_local3 < map_obj2[0].length) {
var _local2 = map_obj2[_local6][_local3];
if (_local2.connected == true) {
var _local1 = new Array();
_local1[0] = _local3;
_local1[1] = _local6;
var _local8 = map_obj2[_local1[1]][_local1[0] + 1].type == _local2.type;
var _local7 = map_obj2[_local1[1]][_local1[0] - 1].type == _local2.type;
var _local4 = map_obj2[_local1[1] - 1][_local1[0]].type == _local2.type;
var _local5 = map_obj2[_local1[1] + 1][_local1[0]].type == _local2.type;
if ((((!_local8) && (!_local7)) && (!_local4)) && (!_local5)) {
_local2.clip.n1.gotoAndStop("single");
} else if ((((!_local4) && (!_local5)) && (_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right");
} else if ((((!_local4) && (!_local5)) && (!_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("left");
} else if ((((!_local4) && (!_local5)) && (_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("center");
} else if ((((!_local4) && (_local5)) && (_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("center_up");
} else if ((((!_local4) && _local5) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_up");
} else if ((((!_local4) && _local5) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_up");
} else if (((_local4 && _local5) && _local7) && _local8) {
_local2.clip.n1.gotoAndStop("center_center");
} else if (((_local4 && _local5) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_center");
} else if (((_local4 && _local5) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_center");
} else if (((_local4 && (!_local5)) && _local7) && _local8) {
_local2.clip.n1.gotoAndStop("down_center");
} else if (((_local4 && (!_local5)) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_down");
} else if (((_local4 && (!_local5)) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_down");
} else if ((((!_local4) && _local5) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_up");
} else if (((_local4 && _local5) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_center");
} else if (((_local4 && (!_local5)) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_down");
}
_local2.clip.n1.kt1._visible = false;
_local2.clip.n1.kt2._visible = false;
}
_local3++;
}
_local6++;
}
_local6 = 0;
while (_local6 < map_obj2.length) {
var _local3 = 0;
while (_local3 < map_obj2[0].length) {
var _local2 = map_obj2[_local6][_local3];
var _local1 = new Array();
_local1[0] = _local3;
_local1[1] = _local6;
if (_local2.type == 12) {
var _local8 = (map1[_local1[1]][_local1[0] + 1] == "7") || (map1[_local1[1]][_local1[0] + 1] == "7a");
var _local7 = (map1[_local1[1]][_local1[0] - 1] == "7") || (map1[_local1[1]][_local1[0] - 1] == "7a");
var _local4 = (map1[_local1[1] - 1][_local1[0]] == "7") || (map1[_local1[1] - 1][_local1[0]] == "7a");
var _local5 = (map1[_local1[1] + 1][_local1[0]] == "7") || (map1[_local1[1] + 1][_local1[0]] == "7a");
if ((!_local4) && (!_local5)) {
_local2.clip.n1.gotoAndStop("single");
} else if (_local4 && (!_local5)) {
_local2.clip.n1.gotoAndStop("down");
} else if ((!_local4) && (_local5)) {
if (map_obj2[_local1[1] + 2][_local1[0]].type == _local2.type) {
_local2.clip.n1.gotoAndStop("up");
} else {
_local2.clip.n1.gotoAndStop("single");
}
} else if (_local4 && (_local5)) {
_local2.clip.n1.gotoAndStop("center");
}
}
_local3++;
}
_local6++;
}
}
function przesun(myx, myy) {
defBrush = actBrush;
przesuwanie = true;
actBrush = map1[myy][myx];
oldPos1 = myy;
oldPos0 = myx;
mc_hand.gotoAndStop("hand_close");
}
function usun_obiekt(myobj, myx, myy) {
oldBrush = actBrush;
var _local1 = (myy * map1[0].length) + myx;
if ((map1[myy][myx] == "7a") && (pojedyncze == true)) {
actBrush = "7";
} else {
actBrush = "0";
}
pressField(_local1);
actBrush = oldBrush;
}
function rysuj_mosty(myx, myy) {
var _local4 = myx;
var _local3 = myy;
obj = map_obj2[_local3][_local4];
var _local5 = random(obj.clip.n1._totalframes) + 1;
obj.clip.n1.gotoAndStop(_local5);
do {
var _local2 = random(obj.clip.n1._totalframes) + 1;
var onceAgain = false;
var _local1 = -5;
while (_local1 < 5) {
_local1 = ((_local1 == -1) ? 0 : (_local1));
if (map_obj2[_local3][(_local4 - _local1) - 1].clip.n1._currentframe == obj.clip.n1._currentframe) {
obj.clip.n1.gotoAndStop(_local2);
onceAgain = true;
break;
}
_local1++;
}
} while (onceAgain == true);
}
function clean_creator(param) {
map_obj2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
if (param == "all") {
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
} else {
var _local3 = 0;
while (_local3 < 13) {
var _local2 = 0;
while (_local2 < 20) {
if ((((map1[_local3][_local2] != "9") && (map1[_local3][_local2] != "9x")) && (map1[_local3][_local2] != objective)) && (map1[_local3][_local2] != zx)) {
map1[_local3][_local2] = 0;
}
_local2++;
}
_local3++;
}
}
var _local1 = 0;
while (_local1 < fields.length) {
var _local4 = new Array();
_local4 = getWsp(fields[_local1]);
var _local3 = Math.floor(_local4[1]);
var _local2 = Math.floor(_local4[0]);
if (((((map1[_local3][_local2] != "9") && (map1[_local3][_local2] != "9x")) && (map1[_local3][_local2] != objective)) && (map1[_local3][_local2] != zx)) || (param == "all")) {
fields[_local1].gotoAndStop("out");
}
_local1++;
}
}
function copyMap(mapStart) {
var _local3 = new Array();
_local3 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
_local3[_local2][_local1] = mapStart[_local2][_local1];
_local1++;
}
_local2++;
}
return(_local3);
}
function cleanClips() {
var _local1 = 0;
while (_local1 < fields.length) {
removeMovieClip(fields[_local1]);
_local1++;
}
_local1 = 0;
while (_local1 < tab_masks.length) {
removeMovieClip(tab_masks[_local1]);
_local1++;
}
removeMovieClip(mc_mask);
delete fields;
removeMovieClip(mc_pop_warning);
removeMovieClip(mc_hand);
removeMovieClip(mc_pop);
removeMovieClip(mc_pop2);
removeMovieClip(mc_pop3);
mc_pop._visible = false;
}
function block(bool, array) {
var _local1 = 0;
while (_local1 < array.length) {
array[_local1].enabled = bool;
_local1++;
}
}
function dodaj_maske(clip1) {
mc_mask_big.duplicateMovieClip("mc_mask" + tab_masks.length, this.getNextHighestDepth());
tab_masks.push(eval ("mc_mask" + tab_masks.length));
clip1.setMask(tab_masks[tab_masks.length - 1]);
}
function isHeroSet() {
var _local3 = false;
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == "9") {
_local3 = true;
break;
}
_local1++;
}
if (_local3 == true) {
break;
}
_local2++;
}
return(_local3);
}
function isObjSet() {
var _local3 = false;
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if ((((map1[_local2][_local1] == "o4") || (map1[_local2][_local1] == "o3")) || (map1[_local2][_local1] == "o2")) || (map1[_local2][_local1] == "o1")) {
objective = map1[_local2][_local1];
_local3 = true;
break;
}
_local1++;
}
if (_local3 == true) {
break;
}
_local2++;
}
return(_local3);
}
function findFirstOnMap(co) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == co) {
_local3[0] = _local1;
_local3[1] = _local2;
break;
}
_local1++;
}
_local2++;
}
return(_local3);
}
function popup(hero1, clip) {
var _local2 = "frame" + (hero1 + 1);
mc_cloud.gotoAndStop(_local2);
mc_cloud._x = (clip._x + clip._width) - 20;
mc_cloud._y = clip._y + 40;
mc_cloud._visible = true;
}
function slideHeroes() {
mc_changer.v1 = ((first_act + 2) + "/") + 9;
h1.gotoAndStop(1 + first_act);
h2.gotoAndStop(2 + first_act);
if ((((hero + 1) - first_act) > 0) && (((hero + 1) - first_act) < 3)) {
mc_ramka._y = eval ("h" + ((hero + 1) - first_act))._y - 12;
mc_ramka._visible = true;
} else {
mc_ramka._visible = false;
}
changeFrameOf("9", hero + 1);
if (first_act < heroes.length) {
h1.disabled_sign._visible = heroes[first_act].disabled;
h1.enabled = !heroes[first_act].disabled;
}
if ((first_act + 1) < heroes.length) {
h2.disabled_sign._visible = heroes[first_act + 1].disabled;
h2.enabled = !heroes[first_act + 1].disabled;
}
}
heroes = Hero.getHeroes();
stop();
mc_loops.gotoAndStop("stop_loop");
curFrame = "c3";
b_next._visible = true;
b7.enabled = false;
h1.gotoAndStop(1 + first_act);
h2.gotoAndStop(2 + first_act);
mc_pop2._visible = false;
var frames_c = h1._totalframes;
var first_act = 0;
slideHeroes();
var i = 0;
while (i < fields.length) {
removeMovieClip(fields[i]);
i++;
}
h1.onPress = function () {
playSound(sClick);
var _local1 = isHeroSet();
if (_local1 == false) {
actBrush = "9";
} else {
actBrush = "-2";
}
hero = 0 + first_act;
slideHeroes();
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
};
h2.onPress = function () {
var _local1 = isHeroSet();
if (_local1 == false) {
actBrush = "9";
} else {
actBrush = "-2";
}
playSound(sClick);
hero = 1 + first_act;
slideHeroes();
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
};
h1.onRollOver = function () {
popup(first_act, this);
};
h2.onRollOver = function () {
popup(first_act + 1, this);
};
h1.onRollOut = (h1.onReleaseOutside = function () {
mc_cloud._visible = false;
});
h2.onRollOut = (h2.onReleaseOutside = function () {
mc_cloud._visible = false;
});
var map_obj2 = new Array();
map_obj2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mc_hand0.duplicateMovieClip("mc_hand", this.getNextHighestDepth());
var tab_masks = new Array();
duplicateMovieClip (mc_map, "mc_mask", this.getNextHighestDepth());
var pojedyncze = true;
stop();
var map_moves = new Array();
var map_pointer = 1;
var counter = 0;
var wid = 31;
var fields = new Array();
var ruchM = false;
sq_sym.gotoAndStop("1a");
mc_sqx.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "2";
sq_sym.gotoAndStop("kladka");
};
mc_sq.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "1";
sq_sym.gotoAndStop("1a");
};
mc_skala.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "101";
sq_sym.gotoAndStop("skala");
};
mc_sqb.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "3";
sq_sym.gotoAndStop("swamp");
};
mc_sqc.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "4";
sq_sym.gotoAndStop("zapadka");
};
mc_chest.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "5";
sq_sym.gotoAndStop("chest");
};
mc_chestx.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "6";
sq_sym.gotoAndStop("chestx");
};
mc_liana.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "7";
sq_sym.gotoAndStop("liana");
};
mc_hero.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "9";
sq_sym.gotoAndStop("hero");
};
mc_sadzawka.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = a;
sq_sym.gotoAndStop("sadzawka");
};
mc_statue.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = s;
sq_sym.gotoAndStop("statue");
};
mc_diamond.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = d;
sq_sym.gotoAndStop("diamond");
};
mc_wall.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = l;
sq_sym.gotoAndStop("wall");
};
mc_sqmagma.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = m;
sq_sym.gotoAndStop("magma");
};
mc_posag.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = p;
sq_sym.gotoAndStop("posag");
};
mc_posag2.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = p2;
sq_sym.gotoAndStop("posag2");
};
mc_exit.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
sq_sym.gotoAndStop("exit");
actBrush = objective;
};
mc_pnacze.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = n;
sq_sym.gotoAndStop("pnacze");
};
mc_dzban.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = b;
sq_sym.gotoAndStop("dzban");
};
mc_spider.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = r;
sq_sym.gotoAndStop("spider");
};
mc_rubber.onPress = function () {
playSound(sClick);
actBrush = "0";
mc_rubber.gotoAndStop(2);
};
mc_batsCage.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = c;
sq_sym.gotoAndStop("cage");
};
firstTime();
createMap();
var mDown = false;
this.onMouseDown = function () {
mDown = true;
};
this.onMouseUp = function () {
mDown = false;
};
var oldK = -1;
var oldPos1 = -1;
var oldPos0 = -1;
var myTab = new Array();
myTab.x = new Array();
myTab.y = new Array();
var opoznienie = 0;
this.onMouseMove = function () {
if (actBrush != "-1") {
var _local19 = _xmouse > mc_map._x;
var _local21 = _xmouse < (mc_map._x + mc_map._width);
var _local23 = _ymouse > mc_map._y;
var _local20 = _ymouse < (mc_map._y + mc_map._height);
var _local18 = false;
if (((_local23 && (_local20)) && (_local21)) && (_local19)) {
_local18 = true;
} else {
mc_hand._visible = false;
}
if (_local18 == true) {
var _local17 = Math.floor((_xmouse - mc_map._x) / wid);
var _local16 = Math.floor((_ymouse - mc_map._y) / wid);
var _local22 = (_local16 * map1[0].length) + _local17;
if ((((((((((map1[_local16][_local17] == "1") || (map1[_local16][_local17] == "3")) || (map1[_local16][_local17] == m)) || (map1[_local16][_local17] == n)) || (map1[_local16][_local17] == "101")) || (map1[_local16][_local17] == "7")) || (map1[_local16][_local17] == "2")) || (map1[_local16][_local17] == l)) && (przesuwanie == true)) && (ruchM == false)) {
pojedyncze = false;
myTab = new Array();
myTab.x = new Array();
myTab.y = new Array();
myTab.x[0] = _local17;
myTab.y[0] = _local16;
var _local8 = 0;
while (_local8 < myTab.x.length) {
var _local2 = myTab.y[_local8];
var _local3 = myTab.x[_local8];
br = map1[_local2][_local3];
var _local9 = map1[_local2 - 1][_local3] == br;
var _local10 = map1[_local2 + 1][_local3] == br;
var _local12 = map1[_local2][_local3 + 1] == br;
var _local11 = map1[_local2][_local3 - 1] == br;
if ((map1[_local2][_local3] == "7") || (map1[_local2][_local3] == "7a")) {
_local9 = ((map1[_local2 - 1][_local3] == br) || (map1[_local2 - 1][_local3] == (br + "a"))) || ((map1[_local2 - 1][_local3] + "a") == br);
_local10 = ((map1[_local2 + 1][_local3] == br) || (map1[_local2 + 1][_local3] == (br + "a"))) || ((map1[_local2 + 1][_local3] + "a") == br);
_local12 = false;
_local11 = false;
}
if (map1[_local2][_local3] == "2") {
_local9 = false;
_local10 = false;
}
bylo = true;
if (_local9) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == _local3) && (myTab.y[_local7] == (_local2 - 1))) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3);
myTab.y.push(_local2 - 1);
}
bylo = true;
if (_local10) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == _local3) && (myTab.y[_local7] == (_local2 + 1))) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3);
myTab.y.push(_local2 + 1);
}
bylo = true;
if (_local12) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == (_local3 + 1)) && (myTab.y[_local7] == _local2)) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3 + 1);
myTab.y.push(_local2);
}
bylo = true;
if (_local11) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == (_local3 - 1)) && (myTab.y[_local7] == _local2)) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3 - 1);
myTab.y.push(_local2);
}
_local8++;
}
ruchM = true;
}
if ((przesuwanie == true) && ((oldPos0 != _local17) || (oldPos1 != _local16))) {
if (map1[oldPos1][oldPos0] == "9") {
if (((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == (actBrush + "x"))) && (((map1[_local16 - 1][_local17] == 0) || (map1[_local16 - 1][_local17] == (actBrush + "x"))) || (map1[_local16 - 1][_local17] == "9"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if (map1[oldPos1][oldPos0].substr(0, 1) == "e") {
if (((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == ("x" + actBrush))) && (((map1[_local16 - 1][_local17] == 0) || (map1[_local16 - 1][_local17] == ("x" + actBrush))) || (map1[_local16 - 1][_local17].substr(0, 1) == "e"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if ((map1[oldPos1][oldPos0] == objective) || (map1[oldPos1][oldPos0] == zx)) {
if (((((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == zx)) && (((map1[_local16 + 1][_local17] == 0) || (map1[_local16 + 1][_local17] == zx)) || (map1[_local16 + 1][_local17] == objective))) && (((map1[_local16 + 1][_local17 + 1] == 0) || (map1[_local16 + 1][_local17 + 1] == zx)) || (map1[_local16 + 1][_local17 + 1] == objective))) && (((map1[_local16][_local17 + 1] == 0) || (map1[_local16][_local17 + 1] == zx)) || (map1[_local16][_local17 + 1] == objective))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if ((((((((((((map1[oldPos1][oldPos0] != "1") && (map1[oldPos1][oldPos0] != "3")) && (map1[oldPos1][oldPos0] != m)) && (map1[oldPos1][oldPos0] != n)) && (map1[oldPos1][oldPos0] != "101")) && (map1[oldPos1][oldPos0] != "7")) && (map1[oldPos1][oldPos0] != "2")) && (map1[oldPos1][oldPos0] != "9")) && (map1[oldPos1][oldPos0] != objective)) && (map1[oldPos1][oldPos0] != "9x")) && (map1[oldPos1][oldPos0] != zx)) && (map1[oldPos1][oldPos0] != l)) {
pojedyncze = true;
if (map1[oldPos1][oldPos0] == "7a") {
actBrush = r;
}
if ((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == (actBrush + "x"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
if ((actBrush == r) && (map1[_local16][_local17] == "7")) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
} else if ((((map1[oldPos1][oldPos0] != "9") && (map1[oldPos1][oldPos0] != objective)) && (map1[oldPos1][oldPos0] != "9x")) && (map1[oldPos1][oldPos0] != zx)) {
var _local6 = _local17 - oldPos0;
var _local5 = _local16 - oldPos1;
var _local15 = true;
var _local7 = 0;
while (_local7 < myTab.y.length) {
if ((map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] != 0) && (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] != map1[oldPos1][oldPos0])) {
_local15 = false;
break;
}
_local7++;
}
if (_local15 == true) {
var _local13 = 0;
_local7 = 0;
while (_local7 < myTab.y.length) {
if (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] == 0) {
_local13++;
}
if (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] == map1[oldPos1][oldPos0]) {
var _local4 = 0;
while (_local4 < myTab.y.length) {
if (((myTab.y[_local7] + _local5) == myTab.y[_local4]) && ((myTab.x[_local7] + _local6) == myTab.x[_local4])) {
_local13++;
break;
}
_local4++;
}
}
_local7++;
}
if (_local13 != myTab.x.length) {
_local15 = false;
}
}
if (_local15 == true) {
_local7 = 0;
while (_local7 < myTab.y.length) {
usun_obiekt(map1[myTab.y[_local7]][myTab.x[_local7]], myTab.x[_local7], myTab.y[_local7]);
_local7++;
}
_local7 = 0;
while (_local7 < myTab.y.length) {
var _local14 = ((myTab.y[_local7] + _local5) * map1[0].length) + (myTab.x[_local7] + _local6);
pressField(_local14);
myTab.y[_local7] = myTab.y[_local7] + _local5;
myTab.x[_local7] = myTab.x[_local7] + _local6;
_local7++;
}
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
przesun(_local17, _local16);
}
polacz_klocki();
}
}
if ((przesuwanie == false) && (actBrush == "0")) {
if (mc_hand.getDepth() != (this.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this.getNextHighestDepth());
}
mc_hand.gotoAndStop("rubber");
mc_hand._x = _xmouse - 15;
mc_hand._y = _ymouse - 15;
mc_hand._visible = true;
}
if ((mDown == true) && (przesuwanie == true)) {
if (mc_hand.getDepth() != (this.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this.getNextHighestDepth());
}
mc_hand.gotoAndStop("hand_close");
mc_hand._x = _xmouse - 15;
mc_hand._y = _ymouse - 15;
}
if ((mDown == true) && (przesuwanie == false)) {
_local17 = Math.floor((_xmouse - mc_map._x) / wid);
_local16 = Math.floor((_ymouse - mc_map._y) / wid);
if ((map1[_local16][_local17] == 0) || (actBrush == "0")) {
if ((((map1[_local16][_local17] != "9") && (map1[_local16][_local17] != "9x")) && (map1[_local16][_local17] != objective)) && (map1[_local16][_local17] != zx)) {
_local22 = (_local16 * map1[0].length) + _local17;
pressField(_local22);
if ((opoznienie % 4) == 0) {
polacz_klocki();
}
opoznienie++;
}
}
}
}
}
};
mc_rubber_all.onPress = function () {
playSound(sClick);
clean_creator("some");
};
mc_sadzawka.mc_rybka.stop();
mc_g2.onPress = function () {
playSound(sClick);
mc_exit.nextFrame();
};
mc_g1.onPress = function () {
playSound(sClick);
mc_exit.prevFrame();
};
changeFrameOf("9", hero + 1);
var przesuwanie = false;
mc_undo.onPress = function () {
playSound(sClick);
clean_creator("all");
map_pointer--;
map_pointer = ((map_pointer < 0) ? 0 : (map_pointer));
map1 = new Array();
map1 = copyMap(map_moves[map_pointer]);
createMap();
};
mc_redo.onPress = function () {
playSound(sClick);
clean_creator("all");
map_pointer++;
map_pointer = ((map_pointer > (map_moves.length - 1)) ? (map_moves.length - 1) : (map_pointer));
map1 = new Array();
map1 = copyMap(map_moves[map_pointer]);
createMap();
};
actBrush = "-2";
mc_cloud.swapDepths(_root.getNextHighestDepth());
mc_changer.b_down.onPress = function () {
playSound(sClick);
if ((first_act + 2) < frames_c) {
first_act++;
slideHeroes();
}
};
mc_changer.b_up.onPress = function () {
playSound(sClick);
if (first_act > 0) {
first_act--;
slideHeroes();
}
};
b1.gotoAndStop(1);
b2.gotoAndStop(1);
b3.gotoAndStop(10);
b4.gotoAndStop(1);
b5.gotoAndStop(1);
b6.gotoAndStop(1);
b7.gotoAndStop(1);
b8.gotoAndStop(1);
mc_pop.swapDepths(this.getNextHighestDepth());
var tab_menu = new Array(b1, b2, b3, b4, b5, b6, b7, b_next, b_prev, mc_changer.b_down, mc_changer.b_up);
var isHero = isHeroSet();
if (isHero == false) {
block(false, fields);
block(false, tab_menu);
} else {
mc_pop._visible = false;
}
mc_pop.btn_close.onPress = function () {
playSound(sClick);
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
};
mc_cloud._visible = false;
Frame 433
cleanClips();
var isHero = isHeroSet();
delete h1.onRollOver;
delete h2.onRollOver;
if ((isHero == false) && (nFrame != "c1")) {
nFrame = "c3";
}
Frame 438
mc_popHelp0._visible = false;
stopLoop("map");
stopLoop("begin");
startLoop("level");
removeMovieClip(mc_popHelp);
mc_pop_warning1._visible = false;
gotoAndPlay(nFrame);
mc_map.enabled = false;
Frame 443
function change_obj() {
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if ((((map1[_local2][_local1] == w) || (map1[_local2][_local1] == x)) || (map1[_local2][_local1] == y)) || (map1[_local2][_local1] == z)) {
map1[_local2][_local1] = objective;
break;
}
_local1++;
}
_local2++;
}
}
function changeFrameOf(_brush, _frame) {
trace((("changeFrameOf:" + _brush) + ", ") + _frame);
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == _brush) {
var _local3 = getClipNumFromWsp(_local1, _local2);
fields[_local3].n1.gotoAndStop(_frame);
}
_local1++;
}
_local2++;
}
}
function firstTime() {
counter = 0;
var i = 0;
while (i < 13) {
var j = 0;
while (j < 20) {
duplicateMovieClip (sq_sym, "field" + counter, 1111 - counter);
fields[counter] = eval ("field" + counter);
fields[counter]._x = mc_map._x + (j * wid);
fields[counter]._y = mc_map._y + (i * wid);
if ((((i == 0) || (i == 12)) || (j == 0)) || (j == 19)) {
dodaj_maske(fields[counter]);
}
counter++;
j++;
}
i++;
}
}
function createMap() {
counter = 0;
var _local4 = 0;
while (_local4 < 13) {
var _local3 = 0;
while (_local3 < 20) {
fields[counter].gotoAndStop(brushToframe(map1[_local4][_local3], fields[counter], _local4, _local3));
if ((((map1[_local4][_local3] == w) || (map1[_local4][_local3] == x)) || (map1[_local4][_local3] == y)) || (map1[_local4][_local3] == z)) {
fields[counter].n1.gotoAndStop(objective);
}
if (map1[_local4][_local3] == "9") {
fields[counter].n1.gotoAndStop(hero + 1);
}
if (map1[_local4][_local3].substr(0, 1) == "e") {
fields[counter].n1.gotoAndStop(Number(map1[_local4][_local3].split("e").join("")) + 1);
trace(("gotoAndStop:" + Number(map1[_local4][_local3].split("e").join(""))) + 1);
}
fields[counter].onRelease = (fields[counter].onReleaseOutside = function () {
if (przesuwanie == true) {
actBrush = defBrush;
ruchM = false;
mc_hand.gotoAndStop("hand");
}
if (((((actBrush == "9") || (actBrush == w)) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
actBrush = "-2";
}
if (actBrush.substr(0, 1) == "e") {
actBrush = "-2";
}
polacz_klocki();
przesuwanie = false;
if (map_pointer < (map_moves.length - 1)) {
map_moves.splice(map_pointer + 1);
}
map_moves[map_moves.length] = new Array();
map_moves[map_moves.length - 1] = copyMap(map1);
map_pointer = map_moves.length - 1;
mc_undo.enabled = true;
mc_redo.enabled = true;
});
fields[counter].onRollOver = function () {
var _local4 = getK(this, fields);
var _local2 = new Array();
_local2 = getWsp(fields[_local4]);
if (((actBrush != "0") && (map1[_local2[1]][_local2[0]] != 0)) && (actBrush != "-1")) {
if (mc_hand.getDepth() != (this._parent.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this._parent.getNextHighestDepth());
}
mc_hand.gotoAndStop("hand");
mc_hand._x = this._x;
mc_hand._y = this._y;
mc_hand._visible = true;
} else if (actBrush != "0") {
mc_hand._visible = false;
}
if (map1[_local2[1]][_local2[0]] == 0) {
this.gotoAndStop(brushToframe(actBrush, null, -1, -1));
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("rope_spider");
}
if ((actBrush == "9") && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
this.n1.gotoAndStop(hero + 1);
}
if ((actBrush.substr(0, 1) == "e") && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
this.n1.gotoAndStop(enemy + 1);
}
if ((actBrush == objective) && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
var _local3 = 0;
switch (objective) {
case w :
_local3 = 1;
break;
case x :
_local3 = 2;
break;
case y :
_local3 = 3;
break;
case z :
_local3 = 4;
}
this.n1.gotoAndStop(_local3);
}
};
fields[counter].onRollOut = function () {
sq_sym._visible = false;
var _local3 = getK(this, fields);
var _local2 = new Array();
_local2 = getWsp(fields[_local3]);
if (map1[_local2[1]][_local2[0]] == 0) {
this.gotoAndStop("out");
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("liana");
}
};
fields[counter].onPress = function () {
if (actBrush != "-1") {
var _local3 = getMouseK();
var _local2 = new Array();
_local2 = getWsp(fields[_local3]);
if (((map1[_local2[1]][_local2[0]] == 0) || (actBrush == "0")) && (actBrush != "-2")) {
if ((((((map1[_local2[1]][_local2[0]].substr(0, 2) != "xe") && (map1[_local2[1]][_local2[0]].substr(0, 1) != "e")) && (map1[_local2[1]][_local2[0]] != "9")) && (map1[_local2[1]][_local2[0]] != "9x")) && (map1[_local2[1]][_local2[0]] != objective)) && (map1[_local2[1]][_local2[0]] != zx)) {
pressField(_local3);
polacz_klocki();
}
} else if (((actBrush != r) || (map1[_local2[1]][_local2[0]] != "7")) && (actBrush != 0)) {
if (map1[_local2[1]][_local2[0]] == "9x") {
przesun(_local2[0], _local2[1] + 1);
} else if (map1[_local2[1]][_local2[0]].substr(0, 2) == "xe") {
if ((map1[_local2[1]][_local2[0]] == "xe4") || (map1[_local2[1]][_local2[0]] == "xe5")) {
var _local4 = findFirstOnMap(map1[_local2[1]][_local2[0]].split("x").join(""));
var _local6 = _local4[0] - _local2[0];
var _local5 = _local4[1] - _local2[1];
przesun(_local2[0] + _local6, _local2[1] + _local5);
} else {
przesun(_local2[0], _local2[1] + 1);
}
} else if (map1[_local2[1]][_local2[0]] == zx) {
var _local4 = findFirstOnMap(objective);
var _local6 = _local4[0] - _local2[0];
var _local5 = _local4[1] - _local2[1];
przesun(_local2[0] + _local6, _local2[1] + _local5);
} else {
przesun(_local2[0], _local2[1]);
}
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("rope_spider");
pressField(_local3);
polacz_klocki();
}
}
};
if (map1[_local4][_local3] == "2") {
rysuj_mosty(Math.floor(_local3), Math.floor(_local4));
}
counter++;
_local3++;
}
_local4++;
}
polacz_klocki();
}
function pressField(nField) {
if ((actBrush != "-1") && (actBrush != "-2")) {
var _local1 = new Array();
_local1 = getWsp(fields[nField]);
var _local4 = true;
if (actBrush == "0") {
if (map1[_local1[1]][_local1[0]] == a) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
}
if ((((map1[_local1[1]][_local1[0]] == w) || (map1[_local1[1]][_local1[0]] == x)) || (map1[_local1[1]][_local1[0]] == y)) || (map1[_local1[1]][_local1[0]] == z)) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
}
if (map1[_local1[1]][_local1[0]] == "9") {
map1[_local1[1] - 1][_local1[0]] = actBrush;
}
if (map1[_local1[1]][_local1[0]].substr(0, 1) == "e") {
if ((map1[_local1[1]][_local1[0]] == "e4") || (map1[_local1[1]][_local1[0]] == "e5")) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
} else {
map1[_local1[1] - 1][_local1[0]] = actBrush;
}
}
}
if (actBrush == "9") {
if (map1[_local1[1] - 1][_local1[0]] == 0) {
_local4 = true;
} else {
_local4 = false;
}
var _local3 = 0;
while (_local3 < 13) {
if (_local4 == false) {
break;
}
var _local2 = 0;
while (_local2 < 20) {
if (map1[_local3][_local2] == "9") {
_local4 = false;
break;
}
_local2++;
}
_local3++;
}
}
if (actBrush.substr(0, 1) == "e") {
if ((actBrush == "e4") || (actBrush == "e5")) {
_local4 = Boolean(((map1[_local1[1]][_local1[0] + 1] == 0) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0]] == 0));
} else {
_local4 = Boolean(map1[_local1[1] - 1][_local1[0]] == 0);
}
}
if ((((actBrush == w) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
if (((map1[_local1[1]][_local1[0] + 1] == 0) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0]] == 0)) {
_local4 = true;
} else {
_local4 = false;
}
var _local3 = 0;
while (_local3 < 13) {
var _local2 = 0;
while (_local2 < 20) {
if ((((map1[_local3][_local2] == w) || (map1[_local3][_local2] == x)) || (map1[_local3][_local2] == y)) || (map1[_local3][_local2] == z)) {
_local4 = false;
break;
}
_local2++;
}
_local3++;
}
}
trace("mozliwe postawienie:" + _local4);
if (actBrush == a) {
if ((((((map1[_local1[1]][_local1[0]] == 0) && (map1[_local1[1]][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 2][_local1[0] + 1] == "1")) && (map1[_local1[1] + 1][_local1[0]] == 0)) && (map1[_local1[1] + 2][_local1[0]] == 1)) {
_local4 = true;
} else {
_local4 = false;
}
}
if (_local4 == true) {
if ((actBrush == r) && (map1[_local1[1]][_local1[0]] == "7")) {
map1[_local1[1]][_local1[0]] = "7a";
} else {
map1[_local1[1]][_local1[0]] = actBrush;
}
fields[nField].gotoAndStop(brushToframe(map1[_local1[1]][_local1[0]], fields[nField], _local1[1], _local1[0]));
if (actBrush == "9") {
fields[nField].n1.gotoAndStop(hero + 1);
map1[_local1[1] - 1][_local1[0]] = "9x";
}
if (actBrush.substr(0, 1) == "e") {
trace("stawiamy enemy:" + actBrush);
if ((actBrush == "e4") || (actBrush == "e5")) {
fields[nField].n1.gotoAndStop(enemy + 1);
map1[_local1[1]][_local1[0] + 1] = "x" + actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = "x" + actBrush;
map1[_local1[1] + 1][_local1[0]] = "x" + actBrush;
} else {
fields[nField].n1.gotoAndStop(enemy + 1);
map1[_local1[1] - 1][_local1[0]] = "xe" + enemy;
}
}
if (actBrush == a) {
map1[_local1[1]][_local1[0] + 1] = ax;
map1[_local1[1] + 1][_local1[0] + 1] = ax;
map1[_local1[1] + 1][_local1[0]] = ax;
}
if ((((actBrush == w) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
fields[nField].n1.gotoAndStop(actBrush);
map1[_local1[1]][_local1[0] + 1] = zx;
map1[_local1[1] + 1][_local1[0] + 1] = zx;
map1[_local1[1] + 1][_local1[0]] = zx;
}
} else {
fields[nField].gotoAndStop("out");
}
if (actBrush == "2") {
rysuj_mosty(Math.floor(_local1[0]), Math.floor(_local1[1]));
}
}
}
function getWsp(clip) {
var _local1 = new Array(2);
_local1[0] = Math.round((clip._x - mc_map._x) / wid);
_local1[1] = Math.round((clip._y - mc_map._y) / wid);
return(_local1);
}
function getK(clip, tab) {
var _local1 = 0;
while (_local1 < tab.length) {
if (clip == tab[_local1]) {
return(_local1);
}
_local1++;
}
}
function getMouseK() {
var _local1 = Math.floor((_xmouse - mc_map._x) / wid);
var _local2 = Math.floor((_ymouse - mc_map._y) / wid);
return(getClipNumFromWsp(_local1, _local2));
}
function getClipNumFromWsp(xx, yy) {
var _local1 = (yy * 20) + xx;
return(_local1);
}
function brushToframe(brush, clip, pos1, pos0) {
var _local1 = "";
if (brush.substr(0, 1) == "e") {
return("enemy");
}
switch (brush) {
case "0" :
if (clip != null) {
delete map_obj2[pos1][pos0];
map_obj2[pos1][pos0] = 0;
}
_local1 = "out";
break;
case "1" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(1, clip, -111);
}
_local1 = "1a";
break;
case "101" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(101, clip, -111);
}
_local1 = "skala";
break;
case "2" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(2, clip, -111);
}
_local1 = "kladka";
break;
case "3" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(3, clip, -111);
}
_local1 = "swamp";
break;
case "4" :
_local1 = "zapadka";
break;
case "5" :
_local1 = "chest";
break;
case "6" :
_local1 = "chestx";
break;
case "7" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(12, clip, -111);
}
_local1 = "liana";
break;
case "7a" :
_local1 = "rope_spider";
break;
case s :
_local1 = "statue";
break;
case d :
_local1 = "diamond";
break;
case b :
_local1 = "dzban";
break;
case c :
_local1 = "cage";
break;
case r :
_local1 = "spider";
break;
case "9" :
_local1 = "hero";
break;
case m :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(13, clip, -111);
}
_local1 = "magma";
break;
case n :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(7, clip, -111);
}
_local1 = "pnacze";
break;
case p :
_local1 = "posag";
break;
case p2 :
_local1 = "posag2";
break;
case r :
_local1 = "spider";
break;
case a :
_local1 = "sadzawka";
break;
case l :
_local1 = "wall";
break;
case w :
_local1 = "exit";
break;
case x :
_local1 = "exit";
break;
case y :
_local1 = "exit";
break;
case z :
_local1 = "exit";
}
return(_local1);
}
function polacz_klocki() {
var _local6 = 0;
while (_local6 < map_obj2.length) {
var _local3 = 0;
while (_local3 < map_obj2[0].length) {
var _local2 = map_obj2[_local6][_local3];
if (_local2.connected == true) {
var _local1 = new Array();
_local1[0] = _local3;
_local1[1] = _local6;
var _local8 = map_obj2[_local1[1]][_local1[0] + 1].type == _local2.type;
var _local7 = map_obj2[_local1[1]][_local1[0] - 1].type == _local2.type;
var _local4 = map_obj2[_local1[1] - 1][_local1[0]].type == _local2.type;
var _local5 = map_obj2[_local1[1] + 1][_local1[0]].type == _local2.type;
if ((((!_local8) && (!_local7)) && (!_local4)) && (!_local5)) {
_local2.clip.n1.gotoAndStop("single");
} else if ((((!_local4) && (!_local5)) && (_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right");
} else if ((((!_local4) && (!_local5)) && (!_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("left");
} else if ((((!_local4) && (!_local5)) && (_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("center");
} else if ((((!_local4) && (_local5)) && (_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("center_up");
} else if ((((!_local4) && _local5) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_up");
} else if ((((!_local4) && _local5) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_up");
} else if (((_local4 && _local5) && _local7) && _local8) {
_local2.clip.n1.gotoAndStop("center_center");
} else if (((_local4 && _local5) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_center");
} else if (((_local4 && _local5) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_center");
} else if (((_local4 && (!_local5)) && _local7) && _local8) {
_local2.clip.n1.gotoAndStop("down_center");
} else if (((_local4 && (!_local5)) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_down");
} else if (((_local4 && (!_local5)) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_down");
} else if ((((!_local4) && _local5) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_up");
} else if (((_local4 && _local5) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_center");
} else if (((_local4 && (!_local5)) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_down");
}
_local2.clip.n1.kt1._visible = false;
_local2.clip.n1.kt2._visible = false;
}
_local3++;
}
_local6++;
}
_local6 = 0;
while (_local6 < map_obj2.length) {
var _local3 = 0;
while (_local3 < map_obj2[0].length) {
var _local2 = map_obj2[_local6][_local3];
var _local1 = new Array();
_local1[0] = _local3;
_local1[1] = _local6;
if (_local2.type == 12) {
var _local8 = (map1[_local1[1]][_local1[0] + 1] == "7") || (map1[_local1[1]][_local1[0] + 1] == "7a");
var _local7 = (map1[_local1[1]][_local1[0] - 1] == "7") || (map1[_local1[1]][_local1[0] - 1] == "7a");
var _local4 = (map1[_local1[1] - 1][_local1[0]] == "7") || (map1[_local1[1] - 1][_local1[0]] == "7a");
var _local5 = (map1[_local1[1] + 1][_local1[0]] == "7") || (map1[_local1[1] + 1][_local1[0]] == "7a");
if ((!_local4) && (!_local5)) {
_local2.clip.n1.gotoAndStop("single");
} else if (_local4 && (!_local5)) {
_local2.clip.n1.gotoAndStop("down");
} else if ((!_local4) && (_local5)) {
if (map_obj2[_local1[1] + 2][_local1[0]].type == _local2.type) {
_local2.clip.n1.gotoAndStop("up");
} else {
_local2.clip.n1.gotoAndStop("single");
}
} else if (_local4 && (_local5)) {
_local2.clip.n1.gotoAndStop("center");
}
}
_local3++;
}
_local6++;
}
}
function przesun(myx, myy) {
defBrush = actBrush;
przesuwanie = true;
actBrush = map1[myy][myx];
oldPos1 = myy;
oldPos0 = myx;
mc_hand.gotoAndStop("hand_close");
}
function usun_obiekt(myobj, myx, myy) {
oldBrush = actBrush;
var _local1 = (myy * map1[0].length) + myx;
if ((map1[myy][myx] == "7a") && (pojedyncze == true)) {
actBrush = "7";
} else {
actBrush = "0";
}
pressField(_local1);
actBrush = oldBrush;
}
function rysuj_mosty(myx, myy) {
var _local4 = myx;
var _local3 = myy;
obj = map_obj2[_local3][_local4];
var _local5 = random(obj.clip.n1._totalframes) + 1;
obj.clip.n1.gotoAndStop(_local5);
do {
var _local2 = random(obj.clip.n1._totalframes) + 1;
var onceAgain = false;
var _local1 = -5;
while (_local1 < 5) {
_local1 = ((_local1 == -1) ? 0 : (_local1));
if (map_obj2[_local3][(_local4 - _local1) - 1].clip.n1._currentframe == obj.clip.n1._currentframe) {
obj.clip.n1.gotoAndStop(_local2);
onceAgain = true;
break;
}
_local1++;
}
} while (onceAgain == true);
}
function clean_creator(param) {
map_obj2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
if (param == "all") {
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
} else {
var _local3 = 0;
while (_local3 < 13) {
var _local2 = 0;
while (_local2 < 20) {
if ((((map1[_local3][_local2] != "9") && (map1[_local3][_local2] != "9x")) && (map1[_local3][_local2] != objective)) && (map1[_local3][_local2] != zx)) {
map1[_local3][_local2] = 0;
}
_local2++;
}
_local3++;
}
}
var _local1 = 0;
while (_local1 < fields.length) {
var _local4 = new Array();
_local4 = getWsp(fields[_local1]);
var _local3 = Math.floor(_local4[1]);
var _local2 = Math.floor(_local4[0]);
if (((((map1[_local3][_local2] != "9") && (map1[_local3][_local2] != "9x")) && (map1[_local3][_local2] != objective)) && (map1[_local3][_local2] != zx)) || (param == "all")) {
fields[_local1].gotoAndStop("out");
}
_local1++;
}
}
function copyMap(mapStart) {
var _local3 = new Array();
_local3 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
_local3[_local2][_local1] = mapStart[_local2][_local1];
_local1++;
}
_local2++;
}
return(_local3);
}
function cleanClips() {
var _local1 = 0;
while (_local1 < fields.length) {
removeMovieClip(fields[_local1]);
_local1++;
}
_local1 = 0;
while (_local1 < tab_masks.length) {
removeMovieClip(tab_masks[_local1]);
_local1++;
}
removeMovieClip(mc_mask);
delete fields;
removeMovieClip(mc_pop_warning);
removeMovieClip(mc_hand);
removeMovieClip(mc_pop);
removeMovieClip(mc_pop2);
removeMovieClip(mc_pop3);
mc_pop._visible = false;
}
function block(bool, array) {
var _local1 = 0;
while (_local1 < array.length) {
array[_local1].enabled = bool;
_local1++;
}
}
function dodaj_maske(clip1) {
mc_mask_big.duplicateMovieClip("mc_mask" + tab_masks.length, this.getNextHighestDepth());
tab_masks.push(eval ("mc_mask" + tab_masks.length));
clip1.setMask(tab_masks[tab_masks.length - 1]);
}
function isHeroSet() {
var _local3 = false;
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == "9") {
_local3 = true;
break;
}
_local1++;
}
if (_local3 == true) {
break;
}
_local2++;
}
return(_local3);
}
function isObjSet() {
var _local3 = false;
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if ((((map1[_local2][_local1] == "o4") || (map1[_local2][_local1] == "o3")) || (map1[_local2][_local1] == "o2")) || (map1[_local2][_local1] == "o1")) {
objective = map1[_local2][_local1];
_local3 = true;
break;
}
_local1++;
}
if (_local3 == true) {
break;
}
_local2++;
}
return(_local3);
}
function findFirstOnMap(co) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == co) {
_local3[0] = _local1;
_local3[1] = _local2;
break;
}
_local1++;
}
_local2++;
}
return(_local3);
}
stop();
curFrame = "c4";
b_next._visible = true;
b7.enabled = false;
mce1.gotoAndStop(1);
mce2.gotoAndStop(2);
mce3.gotoAndStop(3);
mce4.gotoAndStop(4);
mc_pop2._visible = false;
var i = 0;
while (i < fields.length) {
removeMovieClip(fields[i]);
i++;
}
mce1.onPress = function () {
playSound(sClick);
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
objective = w;
change_obj();
mc_ramka2._y = this._y - 4;
mc_ramka2.gotoAndStop(2);
changeFrameOf(objective, 1);
var _local2 = isObjSet();
if (_local2 == false) {
actBrush = objective;
} else {
actBrush = "-2";
}
};
mce2.onPress = function () {
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
playSound(sClick);
objective = x;
change_obj();
mc_ramka2._y = this._y - 4;
mc_ramka2.gotoAndStop(2);
changeFrameOf(objective, 2);
var _local2 = isObjSet();
if (_local2 == false) {
actBrush = objective;
} else {
actBrush = "-2";
}
};
mce3.onPress = function () {
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
playSound(sClick);
objective = y;
change_obj();
mc_ramka2._y = this._y - 4;
mc_ramka2.gotoAndStop(2);
changeFrameOf(objective, 3);
var _local2 = isObjSet();
if (_local2 == false) {
actBrush = objective;
} else {
actBrush = "-2";
}
};
mce4.onPress = function () {
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
playSound(sClick);
objective = z;
change_obj();
mc_ramka2._y = this._y - 4.5;
mc_ramka2.gotoAndStop(1);
changeFrameOf(objective, 4);
var _local2 = isObjSet();
if (_local2 == false) {
actBrush = objective;
} else {
actBrush = "-2";
}
};
var map_obj2 = new Array();
map_obj2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mc_hand0.duplicateMovieClip("mc_hand", this.getNextHighestDepth());
var tab_masks = new Array();
duplicateMovieClip (mc_map, "mc_mask", this.getNextHighestDepth());
var pojedyncze = true;
stop();
var map_moves = new Array();
var map_pointer = 1;
var counter = 0;
var wid = 31;
var fields = new Array();
var ruchM = false;
sq_sym.gotoAndStop("1a");
mc_sqx.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "2";
sq_sym.gotoAndStop("kladka");
};
mc_sq.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "1";
sq_sym.gotoAndStop("1a");
};
mc_skala.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "101";
sq_sym.gotoAndStop("skala");
};
mc_sqb.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "3";
sq_sym.gotoAndStop("swamp");
};
mc_sqc.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "4";
sq_sym.gotoAndStop("zapadka");
};
mc_chest.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "5";
sq_sym.gotoAndStop("chest");
};
mc_chestx.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "6";
sq_sym.gotoAndStop("chestx");
};
mc_liana.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "7";
sq_sym.gotoAndStop("liana");
};
mc_hero.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "9";
sq_sym.gotoAndStop("hero");
};
mc_sadzawka.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = a;
sq_sym.gotoAndStop("sadzawka");
};
mc_statue.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = s;
sq_sym.gotoAndStop("statue");
};
mc_diamond.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = d;
sq_sym.gotoAndStop("diamond");
};
mc_wall.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = l;
sq_sym.gotoAndStop("wall");
};
mc_sqmagma.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = m;
sq_sym.gotoAndStop("magma");
};
mc_posag.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = p;
sq_sym.gotoAndStop("posag");
};
mc_posag2.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = p2;
sq_sym.gotoAndStop("posag2");
};
mc_exit.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
sq_sym.gotoAndStop("exit");
actBrush = objective;
};
mc_pnacze.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = n;
sq_sym.gotoAndStop("pnacze");
};
mc_dzban.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = b;
sq_sym.gotoAndStop("dzban");
};
mc_spider.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = r;
sq_sym.gotoAndStop("spider");
};
mc_rubber.onPress = function () {
playSound(sClick);
actBrush = "0";
mc_rubber.gotoAndStop(2);
};
mc_batsCage.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = c;
sq_sym.gotoAndStop("cage");
};
firstTime();
createMap();
var mDown = false;
this.onMouseDown = function () {
mDown = true;
};
this.onMouseUp = function () {
mDown = false;
};
var oldK = -1;
var oldPos1 = -1;
var oldPos0 = -1;
var myTab = new Array();
myTab.x = new Array();
myTab.y = new Array();
var opoznienie = 0;
this.onMouseMove = function () {
if (actBrush != "-1") {
var _local19 = _xmouse > mc_map._x;
var _local21 = _xmouse < (mc_map._x + mc_map._width);
var _local23 = _ymouse > mc_map._y;
var _local20 = _ymouse < (mc_map._y + mc_map._height);
var _local18 = false;
if (((_local23 && (_local20)) && (_local21)) && (_local19)) {
_local18 = true;
} else {
mc_hand._visible = false;
}
if (_local18 == true) {
var _local17 = Math.floor((_xmouse - mc_map._x) / wid);
var _local16 = Math.floor((_ymouse - mc_map._y) / wid);
var _local22 = (_local16 * map1[0].length) + _local17;
if ((((((((((map1[_local16][_local17] == "1") || (map1[_local16][_local17] == "3")) || (map1[_local16][_local17] == m)) || (map1[_local16][_local17] == n)) || (map1[_local16][_local17] == "101")) || (map1[_local16][_local17] == "7")) || (map1[_local16][_local17] == "2")) || (map1[_local16][_local17] == l)) && (przesuwanie == true)) && (ruchM == false)) {
pojedyncze = false;
myTab = new Array();
myTab.x = new Array();
myTab.y = new Array();
myTab.x[0] = _local17;
myTab.y[0] = _local16;
var _local8 = 0;
while (_local8 < myTab.x.length) {
var _local2 = myTab.y[_local8];
var _local3 = myTab.x[_local8];
br = map1[_local2][_local3];
var _local9 = map1[_local2 - 1][_local3] == br;
var _local10 = map1[_local2 + 1][_local3] == br;
var _local12 = map1[_local2][_local3 + 1] == br;
var _local11 = map1[_local2][_local3 - 1] == br;
if ((map1[_local2][_local3] == "7") || (map1[_local2][_local3] == "7a")) {
_local9 = ((map1[_local2 - 1][_local3] == br) || (map1[_local2 - 1][_local3] == (br + "a"))) || ((map1[_local2 - 1][_local3] + "a") == br);
_local10 = ((map1[_local2 + 1][_local3] == br) || (map1[_local2 + 1][_local3] == (br + "a"))) || ((map1[_local2 + 1][_local3] + "a") == br);
_local12 = false;
_local11 = false;
}
if (map1[_local2][_local3] == "2") {
_local9 = false;
_local10 = false;
}
bylo = true;
if (_local9) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == _local3) && (myTab.y[_local7] == (_local2 - 1))) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3);
myTab.y.push(_local2 - 1);
}
bylo = true;
if (_local10) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == _local3) && (myTab.y[_local7] == (_local2 + 1))) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3);
myTab.y.push(_local2 + 1);
}
bylo = true;
if (_local12) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == (_local3 + 1)) && (myTab.y[_local7] == _local2)) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3 + 1);
myTab.y.push(_local2);
}
bylo = true;
if (_local11) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == (_local3 - 1)) && (myTab.y[_local7] == _local2)) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3 - 1);
myTab.y.push(_local2);
}
_local8++;
}
ruchM = true;
}
if ((przesuwanie == true) && ((oldPos0 != _local17) || (oldPos1 != _local16))) {
if (map1[oldPos1][oldPos0] == "9") {
if (((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == (actBrush + "x"))) && (((map1[_local16 - 1][_local17] == 0) || (map1[_local16 - 1][_local17] == (actBrush + "x"))) || (map1[_local16 - 1][_local17] == "9"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if (map1[oldPos1][oldPos0].substr(0, 1) == "e") {
if (((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == ("x" + actBrush))) && (((map1[_local16 - 1][_local17] == 0) || (map1[_local16 - 1][_local17] == ("x" + actBrush))) || (map1[_local16 - 1][_local17].substr(0, 1) == "e"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if ((map1[oldPos1][oldPos0] == objective) || (map1[oldPos1][oldPos0] == zx)) {
if (((((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == zx)) && (((map1[_local16 + 1][_local17] == 0) || (map1[_local16 + 1][_local17] == zx)) || (map1[_local16 + 1][_local17] == objective))) && (((map1[_local16 + 1][_local17 + 1] == 0) || (map1[_local16 + 1][_local17 + 1] == zx)) || (map1[_local16 + 1][_local17 + 1] == objective))) && (((map1[_local16][_local17 + 1] == 0) || (map1[_local16][_local17 + 1] == zx)) || (map1[_local16][_local17 + 1] == objective))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if ((((((((((((map1[oldPos1][oldPos0] != "1") && (map1[oldPos1][oldPos0] != "3")) && (map1[oldPos1][oldPos0] != m)) && (map1[oldPos1][oldPos0] != n)) && (map1[oldPos1][oldPos0] != "101")) && (map1[oldPos1][oldPos0] != "7")) && (map1[oldPos1][oldPos0] != "2")) && (map1[oldPos1][oldPos0] != "9")) && (map1[oldPos1][oldPos0] != objective)) && (map1[oldPos1][oldPos0] != "9x")) && (map1[oldPos1][oldPos0] != zx)) && (map1[oldPos1][oldPos0] != l)) {
pojedyncze = true;
if (map1[oldPos1][oldPos0] == "7a") {
actBrush = r;
}
if ((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == (actBrush + "x"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
if ((actBrush == r) && (map1[_local16][_local17] == "7")) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
} else if ((((map1[oldPos1][oldPos0] != "9") && (map1[oldPos1][oldPos0] != objective)) && (map1[oldPos1][oldPos0] != "9x")) && (map1[oldPos1][oldPos0] != zx)) {
var _local6 = _local17 - oldPos0;
var _local5 = _local16 - oldPos1;
var _local15 = true;
var _local7 = 0;
while (_local7 < myTab.y.length) {
if ((map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] != 0) && (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] != map1[oldPos1][oldPos0])) {
_local15 = false;
break;
}
_local7++;
}
if (_local15 == true) {
var _local13 = 0;
_local7 = 0;
while (_local7 < myTab.y.length) {
if (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] == 0) {
_local13++;
}
if (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] == map1[oldPos1][oldPos0]) {
var _local4 = 0;
while (_local4 < myTab.y.length) {
if (((myTab.y[_local7] + _local5) == myTab.y[_local4]) && ((myTab.x[_local7] + _local6) == myTab.x[_local4])) {
_local13++;
break;
}
_local4++;
}
}
_local7++;
}
if (_local13 != myTab.x.length) {
_local15 = false;
}
}
if (_local15 == true) {
_local7 = 0;
while (_local7 < myTab.y.length) {
usun_obiekt(map1[myTab.y[_local7]][myTab.x[_local7]], myTab.x[_local7], myTab.y[_local7]);
_local7++;
}
_local7 = 0;
while (_local7 < myTab.y.length) {
var _local14 = ((myTab.y[_local7] + _local5) * map1[0].length) + (myTab.x[_local7] + _local6);
pressField(_local14);
myTab.y[_local7] = myTab.y[_local7] + _local5;
myTab.x[_local7] = myTab.x[_local7] + _local6;
_local7++;
}
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
przesun(_local17, _local16);
}
polacz_klocki();
}
}
if ((przesuwanie == false) && (actBrush == "0")) {
if (mc_hand.getDepth() != (this.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this.getNextHighestDepth());
}
mc_hand.gotoAndStop("rubber");
mc_hand._x = _xmouse - 15;
mc_hand._y = _ymouse - 15;
mc_hand._visible = true;
}
if ((mDown == true) && (przesuwanie == true)) {
if (mc_hand.getDepth() != (this.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this.getNextHighestDepth());
}
mc_hand.gotoAndStop("hand_close");
mc_hand._x = _xmouse - 15;
mc_hand._y = _ymouse - 15;
}
if ((mDown == true) && (przesuwanie == false)) {
_local17 = Math.floor((_xmouse - mc_map._x) / wid);
_local16 = Math.floor((_ymouse - mc_map._y) / wid);
if ((map1[_local16][_local17] == 0) || (actBrush == "0")) {
if ((((map1[_local16][_local17] != "9") && (map1[_local16][_local17] != "9x")) && (map1[_local16][_local17] != objective)) && (map1[_local16][_local17] != zx)) {
_local22 = (_local16 * map1[0].length) + _local17;
pressField(_local22);
if ((opoznienie % 4) == 0) {
polacz_klocki();
}
opoznienie++;
}
}
}
}
}
};
mc_rubber_all.onPress = function () {
playSound(sClick);
clean_creator("some");
};
mc_sadzawka.mc_rybka.stop();
mc_g2.onPress = function () {
playSound(sClick);
mc_exit.nextFrame();
};
mc_g1.onPress = function () {
playSound(sClick);
mc_exit.prevFrame();
};
changeFrameOf("9", hero + 1);
var przesuwanie = false;
mc_undo.onPress = function () {
playSound(sClick);
clean_creator("all");
map_pointer--;
map_pointer = ((map_pointer < 0) ? 0 : (map_pointer));
map1 = new Array();
map1 = copyMap(map_moves[map_pointer]);
createMap();
};
mc_redo.onPress = function () {
playSound(sClick);
clean_creator("all");
map_pointer++;
map_pointer = ((map_pointer > (map_moves.length - 1)) ? (map_moves.length - 1) : (map_pointer));
map1 = new Array();
map1 = copyMap(map_moves[map_pointer]);
createMap();
};
actBrush = "-2";
switch (objective) {
case w :
mc_ramka2._y = mce1._y - 4;
mc_ramka2.gotoAndStop(2);
break;
case x :
mc_ramka2._y = mce2._y - 4;
mc_ramka2.gotoAndStop(2);
break;
case y :
mc_ramka2._y = mce3._y - 4;
mc_ramka2.gotoAndStop(2);
break;
case z :
mc_ramka2._y = mce4._y - 4.5;
mc_ramka2.gotoAndStop(1);
}
b1.gotoAndStop(1);
b2.gotoAndStop(1);
b3.gotoAndStop(1);
b4.gotoAndStop(10);
b5.gotoAndStop(1);
b6.gotoAndStop(1);
b7.gotoAndStop(1);
b8.gotoAndStop(1);
mc_pop.swapDepths(this.getNextHighestDepth());
var tab_menu = new Array(b1, b2, b3, b4, b5, b6, b7, b_next, b_prev, mc_changer.b_down, mc_changer.b_up);
var isObj = isObjSet();
if (isObj == false) {
block(false, fields);
block(false, tab_menu);
} else {
mc_pop._visible = false;
}
mc_pop.btn_close.onPress = function () {
playSound(sClick);
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
};
Frame 500
cleanClips();
var isObj = isObjSet();
if ((isObj == false) && (nFrame != "c1")) {
nFrame = "c4";
}
Frame 505
mc_popHelp0._visible = false;
stopLoop("map");
stopLoop("begin");
startLoop("level");
removeMovieClip(mc_popHelp);
mc_pop_warning1._visible = false;
gotoAndPlay(nFrame);
mc_map.enabled = false;
Frame 510
function changeFrameOf(_brush, _frame) {
trace((("changeFrameOf:" + _brush) + ", ") + _frame);
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == _brush) {
var _local3 = getClipNumFromWsp(_local1, _local2);
fields[_local3].n1.gotoAndStop(_frame);
}
_local1++;
}
_local2++;
}
}
function firstTime() {
counter = 0;
var i = 0;
while (i < 13) {
var j = 0;
while (j < 20) {
duplicateMovieClip (sq_sym, "field" + counter, 1111 - counter);
fields[counter] = eval ("field" + counter);
fields[counter]._x = mc_map._x + (j * wid);
fields[counter]._y = mc_map._y + (i * wid);
if ((((i == 0) || (i == 12)) || (j == 0)) || (j == 19)) {
dodaj_maske(fields[counter]);
}
counter++;
j++;
}
i++;
}
}
function createMap() {
counter = 0;
var _local4 = 0;
while (_local4 < 13) {
var _local3 = 0;
while (_local3 < 20) {
fields[counter].gotoAndStop(brushToframe(map1[_local4][_local3], fields[counter], _local4, _local3));
if ((((map1[_local4][_local3] == w) || (map1[_local4][_local3] == x)) || (map1[_local4][_local3] == y)) || (map1[_local4][_local3] == z)) {
fields[counter].n1.gotoAndStop(objective);
}
if (map1[_local4][_local3] == "9") {
fields[counter].n1.gotoAndStop(hero + 1);
}
if (map1[_local4][_local3].substr(0, 1) == "e") {
fields[counter].n1.gotoAndStop(Number(map1[_local4][_local3].split("e").join("")) + 1);
trace(("gotoAndStop:" + Number(map1[_local4][_local3].split("e").join(""))) + 1);
}
fields[counter].onRelease = (fields[counter].onReleaseOutside = function () {
if (przesuwanie == true) {
actBrush = defBrush;
ruchM = false;
mc_hand.gotoAndStop("hand");
}
if (((((actBrush == "9") || (actBrush == w)) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
actBrush = "-2";
}
if (actBrush.substr(0, 1) == "e") {
actBrush = "-2";
}
polacz_klocki();
przesuwanie = false;
if (map_pointer < (map_moves.length - 1)) {
map_moves.splice(map_pointer + 1);
}
map_moves[map_moves.length] = new Array();
map_moves[map_moves.length - 1] = copyMap(map1);
map_pointer = map_moves.length - 1;
mc_undo.enabled = true;
mc_redo.enabled = true;
});
fields[counter].onRollOver = function () {
var _local4 = getK(this, fields);
var _local2 = new Array();
_local2 = getWsp(fields[_local4]);
if (((actBrush != "0") && (map1[_local2[1]][_local2[0]] != 0)) && (actBrush != "-1")) {
if (mc_hand.getDepth() != (this._parent.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this._parent.getNextHighestDepth());
}
mc_hand.gotoAndStop("hand");
mc_hand._x = this._x;
mc_hand._y = this._y;
mc_hand._visible = true;
} else if (actBrush != "0") {
mc_hand._visible = false;
}
if (map1[_local2[1]][_local2[0]] == 0) {
this.gotoAndStop(brushToframe(actBrush, null, -1, -1));
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("rope_spider");
}
if ((actBrush == "9") && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
this.n1.gotoAndStop(hero + 1);
}
if ((actBrush.substr(0, 1) == "e") && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
this.n1.gotoAndStop(enemy + 1);
}
if ((actBrush == objective) && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
var _local3 = 0;
switch (objective) {
case w :
_local3 = 1;
break;
case x :
_local3 = 2;
break;
case y :
_local3 = 3;
break;
case z :
_local3 = 4;
}
this.n1.gotoAndStop(_local3);
}
};
fields[counter].onRollOut = function () {
sq_sym._visible = false;
var _local3 = getK(this, fields);
var _local2 = new Array();
_local2 = getWsp(fields[_local3]);
if (map1[_local2[1]][_local2[0]] == 0) {
this.gotoAndStop("out");
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("liana");
}
};
fields[counter].onPress = function () {
if (actBrush != "-1") {
var _local3 = getMouseK();
var _local2 = new Array();
_local2 = getWsp(fields[_local3]);
if (((map1[_local2[1]][_local2[0]] == 0) || (actBrush == "0")) && (actBrush != "-2")) {
if ((((((map1[_local2[1]][_local2[0]].substr(0, 2) != "xe") && (map1[_local2[1]][_local2[0]].substr(0, 1) != "e")) && (map1[_local2[1]][_local2[0]] != "9")) && (map1[_local2[1]][_local2[0]] != "9x")) && (map1[_local2[1]][_local2[0]] != objective)) && (map1[_local2[1]][_local2[0]] != zx)) {
pressField(_local3);
polacz_klocki();
}
} else if (((actBrush != r) || (map1[_local2[1]][_local2[0]] != "7")) && (actBrush != 0)) {
if (map1[_local2[1]][_local2[0]] == "9x") {
przesun(_local2[0], _local2[1] + 1);
} else if (map1[_local2[1]][_local2[0]].substr(0, 2) == "xe") {
if ((map1[_local2[1]][_local2[0]] == "xe4") || (map1[_local2[1]][_local2[0]] == "xe5")) {
var _local4 = findFirstOnMap(map1[_local2[1]][_local2[0]].split("x").join(""));
var _local6 = _local4[0] - _local2[0];
var _local5 = _local4[1] - _local2[1];
przesun(_local2[0] + _local6, _local2[1] + _local5);
} else {
przesun(_local2[0], _local2[1] + 1);
}
} else if (map1[_local2[1]][_local2[0]] == zx) {
var _local4 = findFirstOnMap(objective);
var _local6 = _local4[0] - _local2[0];
var _local5 = _local4[1] - _local2[1];
przesun(_local2[0] + _local6, _local2[1] + _local5);
} else {
przesun(_local2[0], _local2[1]);
}
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("rope_spider");
pressField(_local3);
polacz_klocki();
}
}
};
if (map1[_local4][_local3] == "2") {
rysuj_mosty(Math.floor(_local3), Math.floor(_local4));
}
counter++;
_local3++;
}
_local4++;
}
polacz_klocki();
}
function pressField(nField) {
if ((actBrush != "-1") && (actBrush != "-2")) {
var _local1 = new Array();
_local1 = getWsp(fields[nField]);
var _local4 = true;
if (actBrush == "0") {
if (map1[_local1[1]][_local1[0]] == a) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
}
if ((((map1[_local1[1]][_local1[0]] == w) || (map1[_local1[1]][_local1[0]] == x)) || (map1[_local1[1]][_local1[0]] == y)) || (map1[_local1[1]][_local1[0]] == z)) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
}
if (map1[_local1[1]][_local1[0]] == "9") {
map1[_local1[1] - 1][_local1[0]] = actBrush;
}
if (map1[_local1[1]][_local1[0]].substr(0, 1) == "e") {
if ((map1[_local1[1]][_local1[0]] == "e4") || (map1[_local1[1]][_local1[0]] == "e5")) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
} else {
map1[_local1[1] - 1][_local1[0]] = actBrush;
}
}
}
if (actBrush == "9") {
if (map1[_local1[1] - 1][_local1[0]] == 0) {
_local4 = true;
} else {
_local4 = false;
}
var _local3 = 0;
while (_local3 < 13) {
if (_local4 == false) {
break;
}
var _local2 = 0;
while (_local2 < 20) {
if (map1[_local3][_local2] == "9") {
_local4 = false;
break;
}
_local2++;
}
_local3++;
}
}
if (actBrush.substr(0, 1) == "e") {
if ((actBrush == "e4") || (actBrush == "e5")) {
_local4 = Boolean(((map1[_local1[1]][_local1[0] + 1] == 0) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0]] == 0));
} else {
_local4 = Boolean(map1[_local1[1] - 1][_local1[0]] == 0);
}
}
if ((((actBrush == w) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
if (((map1[_local1[1]][_local1[0] + 1] == 0) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0]] == 0)) {
_local4 = true;
} else {
_local4 = false;
}
var _local3 = 0;
while (_local3 < 13) {
var _local2 = 0;
while (_local2 < 20) {
if ((((map1[_local3][_local2] == w) || (map1[_local3][_local2] == x)) || (map1[_local3][_local2] == y)) || (map1[_local3][_local2] == z)) {
_local4 = false;
break;
}
_local2++;
}
_local3++;
}
}
trace("mozliwe postawienie:" + _local4);
if (actBrush == a) {
if ((((((map1[_local1[1]][_local1[0]] == 0) && (map1[_local1[1]][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 2][_local1[0] + 1] == "1")) && (map1[_local1[1] + 1][_local1[0]] == 0)) && (map1[_local1[1] + 2][_local1[0]] == 1)) {
_local4 = true;
} else {
_local4 = false;
}
}
if (_local4 == true) {
if ((actBrush == r) && (map1[_local1[1]][_local1[0]] == "7")) {
map1[_local1[1]][_local1[0]] = "7a";
} else {
map1[_local1[1]][_local1[0]] = actBrush;
}
fields[nField].gotoAndStop(brushToframe(map1[_local1[1]][_local1[0]], fields[nField], _local1[1], _local1[0]));
if (actBrush == "9") {
fields[nField].n1.gotoAndStop(hero + 1);
map1[_local1[1] - 1][_local1[0]] = "9x";
}
if (actBrush.substr(0, 1) == "e") {
trace("stawiamy enemy:" + actBrush);
if ((actBrush == "e4") || (actBrush == "e5")) {
fields[nField].n1.gotoAndStop(enemy + 1);
map1[_local1[1]][_local1[0] + 1] = "x" + actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = "x" + actBrush;
map1[_local1[1] + 1][_local1[0]] = "x" + actBrush;
} else {
fields[nField].n1.gotoAndStop(enemy + 1);
map1[_local1[1] - 1][_local1[0]] = "xe" + enemy;
}
}
if (actBrush == a) {
map1[_local1[1]][_local1[0] + 1] = ax;
map1[_local1[1] + 1][_local1[0] + 1] = ax;
map1[_local1[1] + 1][_local1[0]] = ax;
}
if ((((actBrush == w) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
fields[nField].n1.gotoAndStop(actBrush);
map1[_local1[1]][_local1[0] + 1] = zx;
map1[_local1[1] + 1][_local1[0] + 1] = zx;
map1[_local1[1] + 1][_local1[0]] = zx;
}
} else {
fields[nField].gotoAndStop("out");
}
if (actBrush == "2") {
rysuj_mosty(Math.floor(_local1[0]), Math.floor(_local1[1]));
}
}
}
function getWsp(clip) {
var _local1 = new Array(2);
_local1[0] = Math.round((clip._x - mc_map._x) / wid);
_local1[1] = Math.round((clip._y - mc_map._y) / wid);
return(_local1);
}
function getK(clip, tab) {
var _local1 = 0;
while (_local1 < tab.length) {
if (clip == tab[_local1]) {
return(_local1);
}
_local1++;
}
}
function getMouseK() {
var _local1 = Math.floor((_xmouse - mc_map._x) / wid);
var _local2 = Math.floor((_ymouse - mc_map._y) / wid);
return(getClipNumFromWsp(_local1, _local2));
}
function getClipNumFromWsp(xx, yy) {
var _local1 = (yy * 20) + xx;
return(_local1);
}
function brushToframe(brush, clip, pos1, pos0) {
var _local1 = "";
if (brush.substr(0, 1) == "e") {
return("enemy");
}
switch (brush) {
case "0" :
if (clip != null) {
delete map_obj2[pos1][pos0];
map_obj2[pos1][pos0] = 0;
}
_local1 = "out";
break;
case "1" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(1, clip, -111);
}
_local1 = "1a";
break;
case "101" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(101, clip, -111);
}
_local1 = "skala";
break;
case "2" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(2, clip, -111);
}
_local1 = "kladka";
break;
case "3" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(3, clip, -111);
}
_local1 = "swamp";
break;
case "4" :
_local1 = "zapadka";
break;
case "5" :
_local1 = "chest";
break;
case "6" :
_local1 = "chestx";
break;
case "7" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(12, clip, -111);
}
_local1 = "liana";
break;
case "7a" :
_local1 = "rope_spider";
break;
case s :
_local1 = "statue";
break;
case d :
_local1 = "diamond";
break;
case b :
_local1 = "dzban";
break;
case c :
_local1 = "cage";
break;
case r :
_local1 = "spider";
break;
case "9" :
_local1 = "hero";
break;
case m :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(13, clip, -111);
}
_local1 = "magma";
break;
case n :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(7, clip, -111);
}
_local1 = "pnacze";
break;
case p :
_local1 = "posag";
break;
case p2 :
_local1 = "posag2";
break;
case r :
_local1 = "spider";
break;
case a :
_local1 = "sadzawka";
break;
case l :
_local1 = "wall";
break;
case w :
_local1 = "exit";
break;
case x :
_local1 = "exit";
break;
case y :
_local1 = "exit";
break;
case z :
_local1 = "exit";
}
return(_local1);
}
function polacz_klocki() {
var _local6 = 0;
while (_local6 < map_obj2.length) {
var _local3 = 0;
while (_local3 < map_obj2[0].length) {
var _local2 = map_obj2[_local6][_local3];
if (_local2.connected == true) {
var _local1 = new Array();
_local1[0] = _local3;
_local1[1] = _local6;
var _local8 = map_obj2[_local1[1]][_local1[0] + 1].type == _local2.type;
var _local7 = map_obj2[_local1[1]][_local1[0] - 1].type == _local2.type;
var _local4 = map_obj2[_local1[1] - 1][_local1[0]].type == _local2.type;
var _local5 = map_obj2[_local1[1] + 1][_local1[0]].type == _local2.type;
if ((((!_local8) && (!_local7)) && (!_local4)) && (!_local5)) {
_local2.clip.n1.gotoAndStop("single");
} else if ((((!_local4) && (!_local5)) && (_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right");
} else if ((((!_local4) && (!_local5)) && (!_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("left");
} else if ((((!_local4) && (!_local5)) && (_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("center");
} else if ((((!_local4) && (_local5)) && (_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("center_up");
} else if ((((!_local4) && _local5) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_up");
} else if ((((!_local4) && _local5) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_up");
} else if (((_local4 && _local5) && _local7) && _local8) {
_local2.clip.n1.gotoAndStop("center_center");
} else if (((_local4 && _local5) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_center");
} else if (((_local4 && _local5) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_center");
} else if (((_local4 && (!_local5)) && _local7) && _local8) {
_local2.clip.n1.gotoAndStop("down_center");
} else if (((_local4 && (!_local5)) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_down");
} else if (((_local4 && (!_local5)) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_down");
} else if ((((!_local4) && _local5) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_up");
} else if (((_local4 && _local5) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_center");
} else if (((_local4 && (!_local5)) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_down");
}
_local2.clip.n1.kt1._visible = false;
_local2.clip.n1.kt2._visible = false;
}
_local3++;
}
_local6++;
}
_local6 = 0;
while (_local6 < map_obj2.length) {
var _local3 = 0;
while (_local3 < map_obj2[0].length) {
var _local2 = map_obj2[_local6][_local3];
var _local1 = new Array();
_local1[0] = _local3;
_local1[1] = _local6;
if (_local2.type == 12) {
var _local8 = (map1[_local1[1]][_local1[0] + 1] == "7") || (map1[_local1[1]][_local1[0] + 1] == "7a");
var _local7 = (map1[_local1[1]][_local1[0] - 1] == "7") || (map1[_local1[1]][_local1[0] - 1] == "7a");
var _local4 = (map1[_local1[1] - 1][_local1[0]] == "7") || (map1[_local1[1] - 1][_local1[0]] == "7a");
var _local5 = (map1[_local1[1] + 1][_local1[0]] == "7") || (map1[_local1[1] + 1][_local1[0]] == "7a");
if ((!_local4) && (!_local5)) {
_local2.clip.n1.gotoAndStop("single");
} else if (_local4 && (!_local5)) {
_local2.clip.n1.gotoAndStop("down");
} else if ((!_local4) && (_local5)) {
if (map_obj2[_local1[1] + 2][_local1[0]].type == _local2.type) {
_local2.clip.n1.gotoAndStop("up");
} else {
_local2.clip.n1.gotoAndStop("single");
}
} else if (_local4 && (_local5)) {
_local2.clip.n1.gotoAndStop("center");
}
}
_local3++;
}
_local6++;
}
}
function przesun(myx, myy) {
defBrush = actBrush;
przesuwanie = true;
actBrush = map1[myy][myx];
oldPos1 = myy;
oldPos0 = myx;
mc_hand.gotoAndStop("hand_close");
}
function usun_obiekt(myobj, myx, myy) {
oldBrush = actBrush;
var _local1 = (myy * map1[0].length) + myx;
if ((map1[myy][myx] == "7a") && (pojedyncze == true)) {
actBrush = "7";
} else {
actBrush = "0";
}
pressField(_local1);
actBrush = oldBrush;
}
function rysuj_mosty(myx, myy) {
var _local4 = myx;
var _local3 = myy;
obj = map_obj2[_local3][_local4];
var _local5 = random(obj.clip.n1._totalframes) + 1;
obj.clip.n1.gotoAndStop(_local5);
do {
var _local2 = random(obj.clip.n1._totalframes) + 1;
var onceAgain = false;
var _local1 = -5;
while (_local1 < 5) {
_local1 = ((_local1 == -1) ? 0 : (_local1));
if (map_obj2[_local3][(_local4 - _local1) - 1].clip.n1._currentframe == obj.clip.n1._currentframe) {
obj.clip.n1.gotoAndStop(_local2);
onceAgain = true;
break;
}
_local1++;
}
} while (onceAgain == true);
}
function clean_creator(param) {
map_obj2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
if (param == "all") {
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
} else {
var _local3 = 0;
while (_local3 < 13) {
var _local2 = 0;
while (_local2 < 20) {
if ((((map1[_local3][_local2] != "9") && (map1[_local3][_local2] != "9x")) && (map1[_local3][_local2] != objective)) && (map1[_local3][_local2] != zx)) {
map1[_local3][_local2] = 0;
}
_local2++;
}
_local3++;
}
}
var _local1 = 0;
while (_local1 < fields.length) {
var _local4 = new Array();
_local4 = getWsp(fields[_local1]);
var _local3 = Math.floor(_local4[1]);
var _local2 = Math.floor(_local4[0]);
if (((((map1[_local3][_local2] != "9") && (map1[_local3][_local2] != "9x")) && (map1[_local3][_local2] != objective)) && (map1[_local3][_local2] != zx)) || (param == "all")) {
fields[_local1].gotoAndStop("out");
}
_local1++;
}
}
function copyMap(mapStart) {
var _local3 = new Array();
_local3 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
_local3[_local2][_local1] = mapStart[_local2][_local1];
_local1++;
}
_local2++;
}
return(_local3);
}
function cleanClips() {
var _local1 = 0;
while (_local1 < fields.length) {
removeMovieClip(fields[_local1]);
_local1++;
}
_local1 = 0;
while (_local1 < tab_masks.length) {
removeMovieClip(tab_masks[_local1]);
_local1++;
}
removeMovieClip(mc_mask);
delete fields;
removeMovieClip(mc_pop_warning);
removeMovieClip(mc_hand);
removeMovieClip(mc_pop);
removeMovieClip(mc_pop2);
removeMovieClip(mc_pop3);
mc_pop._visible = false;
}
function block(bool, array) {
var _local1 = 0;
while (_local1 < array.length) {
array[_local1].enabled = bool;
_local1++;
}
}
function dodaj_maske(clip1) {
mc_mask_big.duplicateMovieClip("mc_mask" + tab_masks.length, this.getNextHighestDepth());
tab_masks.push(eval ("mc_mask" + tab_masks.length));
clip1.setMask(tab_masks[tab_masks.length - 1]);
}
function isHeroSet() {
var _local3 = false;
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == "9") {
_local3 = true;
break;
}
_local1++;
}
if (_local3 == true) {
break;
}
_local2++;
}
return(_local3);
}
function isObjSet() {
var _local3 = false;
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if ((((map1[_local2][_local1] == "o4") || (map1[_local2][_local1] == "o3")) || (map1[_local2][_local1] == "o2")) || (map1[_local2][_local1] == "o1")) {
objective = map1[_local2][_local1];
_local3 = true;
break;
}
_local1++;
}
if (_local3 == true) {
break;
}
_local2++;
}
return(_local3);
}
function findFirstOnMap(co) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == co) {
_local3[0] = _local1;
_local3[1] = _local2;
break;
}
_local1++;
}
_local2++;
}
return(_local3);
}
function pokaz_pop3(clip) {
mc_cloud._x = clip._x + clip._width;
mc_cloud._y = clip._y;
mc_cloud._visible = true;
}
stop();
curFrame = "c5";
mc_undo.enabled = false;
mc_redo.enabled = false;
b_next._visible = true;
b7.enabled = false;
var map_obj2 = new Array();
map_obj2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mc_hand0.duplicateMovieClip("mc_hand", this.getNextHighestDepth());
var tab_masks = new Array();
duplicateMovieClip (mc_map, "mc_mask", this.getNextHighestDepth());
var pojedyncze = true;
stop();
var map_moves = new Array();
var map_pointer = 1;
var counter = 0;
var wid = 31;
var fields = new Array();
var ruchM = false;
sq_sym.gotoAndStop("1a");
mc_sqx.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "2";
sq_sym.gotoAndStop("kladka");
};
mc_sq.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "1";
sq_sym.gotoAndStop("1a");
};
mc_skala.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "101";
sq_sym.gotoAndStop("skala");
};
mc_sqb.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "3";
sq_sym.gotoAndStop("swamp");
};
mc_sqc.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "4";
sq_sym.gotoAndStop("zapadka");
};
mc_chest.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "5";
sq_sym.gotoAndStop("chest");
};
mc_chestx.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "6";
sq_sym.gotoAndStop("chestx");
};
mc_liana.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "7";
sq_sym.gotoAndStop("liana");
};
mc_hero.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "9";
sq_sym.gotoAndStop("hero");
};
mc_sadzawka.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = a;
sq_sym.gotoAndStop("sadzawka");
};
mc_statue.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = s;
sq_sym.gotoAndStop("statue");
};
mc_diamond.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = d;
sq_sym.gotoAndStop("diamond");
};
mc_wall.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = l;
sq_sym.gotoAndStop("wall");
};
mc_sqmagma.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = m;
sq_sym.gotoAndStop("magma");
};
mc_posag.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = p;
sq_sym.gotoAndStop("posag");
};
mc_posag2.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = p2;
sq_sym.gotoAndStop("posag2");
};
mc_exit.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
sq_sym.gotoAndStop("exit");
actBrush = objective;
};
mc_pnacze.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = n;
sq_sym.gotoAndStop("pnacze");
};
mc_dzban.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = b;
sq_sym.gotoAndStop("dzban");
};
mc_spider.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = r;
sq_sym.gotoAndStop("spider");
};
mc_rubber.onPress = function () {
playSound(sClick);
actBrush = "0";
mc_rubber.gotoAndStop(2);
};
mc_batsCage.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = c;
sq_sym.gotoAndStop("cage");
};
firstTime();
createMap();
var mDown = false;
this.onMouseDown = function () {
mDown = true;
};
this.onMouseUp = function () {
mDown = false;
};
var oldK = -1;
var oldPos1 = -1;
var oldPos0 = -1;
var myTab = new Array();
myTab.x = new Array();
myTab.y = new Array();
var opoznienie = 0;
this.onMouseMove = function () {
if (actBrush != "-1") {
var _local19 = _xmouse > mc_map._x;
var _local21 = _xmouse < (mc_map._x + mc_map._width);
var _local23 = _ymouse > mc_map._y;
var _local20 = _ymouse < (mc_map._y + mc_map._height);
var _local18 = false;
if (((_local23 && (_local20)) && (_local21)) && (_local19)) {
_local18 = true;
} else {
mc_hand._visible = false;
}
if (_local18 == true) {
var _local17 = Math.floor((_xmouse - mc_map._x) / wid);
var _local16 = Math.floor((_ymouse - mc_map._y) / wid);
var _local22 = (_local16 * map1[0].length) + _local17;
if ((((((((((map1[_local16][_local17] == "1") || (map1[_local16][_local17] == "3")) || (map1[_local16][_local17] == m)) || (map1[_local16][_local17] == n)) || (map1[_local16][_local17] == "101")) || (map1[_local16][_local17] == "7")) || (map1[_local16][_local17] == "2")) || (map1[_local16][_local17] == l)) && (przesuwanie == true)) && (ruchM == false)) {
pojedyncze = false;
myTab = new Array();
myTab.x = new Array();
myTab.y = new Array();
myTab.x[0] = _local17;
myTab.y[0] = _local16;
var _local8 = 0;
while (_local8 < myTab.x.length) {
var _local2 = myTab.y[_local8];
var _local3 = myTab.x[_local8];
br = map1[_local2][_local3];
var _local9 = map1[_local2 - 1][_local3] == br;
var _local10 = map1[_local2 + 1][_local3] == br;
var _local12 = map1[_local2][_local3 + 1] == br;
var _local11 = map1[_local2][_local3 - 1] == br;
if ((map1[_local2][_local3] == "7") || (map1[_local2][_local3] == "7a")) {
_local9 = ((map1[_local2 - 1][_local3] == br) || (map1[_local2 - 1][_local3] == (br + "a"))) || ((map1[_local2 - 1][_local3] + "a") == br);
_local10 = ((map1[_local2 + 1][_local3] == br) || (map1[_local2 + 1][_local3] == (br + "a"))) || ((map1[_local2 + 1][_local3] + "a") == br);
_local12 = false;
_local11 = false;
}
if (map1[_local2][_local3] == "2") {
_local9 = false;
_local10 = false;
}
bylo = true;
if (_local9) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == _local3) && (myTab.y[_local7] == (_local2 - 1))) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3);
myTab.y.push(_local2 - 1);
}
bylo = true;
if (_local10) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == _local3) && (myTab.y[_local7] == (_local2 + 1))) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3);
myTab.y.push(_local2 + 1);
}
bylo = true;
if (_local12) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == (_local3 + 1)) && (myTab.y[_local7] == _local2)) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3 + 1);
myTab.y.push(_local2);
}
bylo = true;
if (_local11) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == (_local3 - 1)) && (myTab.y[_local7] == _local2)) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3 - 1);
myTab.y.push(_local2);
}
_local8++;
}
ruchM = true;
}
if ((przesuwanie == true) && ((oldPos0 != _local17) || (oldPos1 != _local16))) {
if (map1[oldPos1][oldPos0] == "9") {
if (((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == (actBrush + "x"))) && (((map1[_local16 - 1][_local17] == 0) || (map1[_local16 - 1][_local17] == (actBrush + "x"))) || (map1[_local16 - 1][_local17] == "9"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if (map1[oldPos1][oldPos0].substr(0, 1) == "e") {
if (((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == ("x" + actBrush))) && (((map1[_local16 - 1][_local17] == 0) || (map1[_local16 - 1][_local17] == ("x" + actBrush))) || (map1[_local16 - 1][_local17].substr(0, 1) == "e"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if ((map1[oldPos1][oldPos0] == objective) || (map1[oldPos1][oldPos0] == zx)) {
if (((((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == zx)) && (((map1[_local16 + 1][_local17] == 0) || (map1[_local16 + 1][_local17] == zx)) || (map1[_local16 + 1][_local17] == objective))) && (((map1[_local16 + 1][_local17 + 1] == 0) || (map1[_local16 + 1][_local17 + 1] == zx)) || (map1[_local16 + 1][_local17 + 1] == objective))) && (((map1[_local16][_local17 + 1] == 0) || (map1[_local16][_local17 + 1] == zx)) || (map1[_local16][_local17 + 1] == objective))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if ((((((((((((map1[oldPos1][oldPos0] != "1") && (map1[oldPos1][oldPos0] != "3")) && (map1[oldPos1][oldPos0] != m)) && (map1[oldPos1][oldPos0] != n)) && (map1[oldPos1][oldPos0] != "101")) && (map1[oldPos1][oldPos0] != "7")) && (map1[oldPos1][oldPos0] != "2")) && (map1[oldPos1][oldPos0] != "9")) && (map1[oldPos1][oldPos0] != objective)) && (map1[oldPos1][oldPos0] != "9x")) && (map1[oldPos1][oldPos0] != zx)) && (map1[oldPos1][oldPos0] != l)) {
pojedyncze = true;
if (map1[oldPos1][oldPos0] == "7a") {
actBrush = r;
}
if ((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == (actBrush + "x"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
if ((actBrush == r) && (map1[_local16][_local17] == "7")) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
} else if ((((map1[oldPos1][oldPos0] != "9") && (map1[oldPos1][oldPos0] != objective)) && (map1[oldPos1][oldPos0] != "9x")) && (map1[oldPos1][oldPos0] != zx)) {
var _local6 = _local17 - oldPos0;
var _local5 = _local16 - oldPos1;
var _local15 = true;
var _local7 = 0;
while (_local7 < myTab.y.length) {
if ((map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] != 0) && (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] != map1[oldPos1][oldPos0])) {
_local15 = false;
break;
}
_local7++;
}
if (_local15 == true) {
var _local13 = 0;
_local7 = 0;
while (_local7 < myTab.y.length) {
if (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] == 0) {
_local13++;
}
if (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] == map1[oldPos1][oldPos0]) {
var _local4 = 0;
while (_local4 < myTab.y.length) {
if (((myTab.y[_local7] + _local5) == myTab.y[_local4]) && ((myTab.x[_local7] + _local6) == myTab.x[_local4])) {
_local13++;
break;
}
_local4++;
}
}
_local7++;
}
if (_local13 != myTab.x.length) {
_local15 = false;
}
}
if (_local15 == true) {
_local7 = 0;
while (_local7 < myTab.y.length) {
usun_obiekt(map1[myTab.y[_local7]][myTab.x[_local7]], myTab.x[_local7], myTab.y[_local7]);
_local7++;
}
_local7 = 0;
while (_local7 < myTab.y.length) {
var _local14 = ((myTab.y[_local7] + _local5) * map1[0].length) + (myTab.x[_local7] + _local6);
pressField(_local14);
myTab.y[_local7] = myTab.y[_local7] + _local5;
myTab.x[_local7] = myTab.x[_local7] + _local6;
_local7++;
}
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
przesun(_local17, _local16);
}
polacz_klocki();
}
}
if ((przesuwanie == false) && (actBrush == "0")) {
if (mc_hand.getDepth() != (this.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this.getNextHighestDepth());
}
mc_hand.gotoAndStop("rubber");
mc_hand._x = _xmouse - 15;
mc_hand._y = _ymouse - 15;
mc_hand._visible = true;
}
if ((mDown == true) && (przesuwanie == true)) {
if (mc_hand.getDepth() != (this.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this.getNextHighestDepth());
}
mc_hand.gotoAndStop("hand_close");
mc_hand._x = _xmouse - 15;
mc_hand._y = _ymouse - 15;
}
if ((mDown == true) && (przesuwanie == false)) {
_local17 = Math.floor((_xmouse - mc_map._x) / wid);
_local16 = Math.floor((_ymouse - mc_map._y) / wid);
if ((map1[_local16][_local17] == 0) || (actBrush == "0")) {
if ((((map1[_local16][_local17] != "9") && (map1[_local16][_local17] != "9x")) && (map1[_local16][_local17] != objective)) && (map1[_local16][_local17] != zx)) {
_local22 = (_local16 * map1[0].length) + _local17;
pressField(_local22);
if ((opoznienie % 4) == 0) {
polacz_klocki();
}
opoznienie++;
}
}
}
}
}
};
mc_rubber_all.onPress = function () {
playSound(sClick);
clean_creator("some");
};
mc_sadzawka.mc_rybka.stop();
mc_g2.onPress = function () {
playSound(sClick);
mc_exit.nextFrame();
};
mc_g1.onPress = function () {
playSound(sClick);
mc_exit.prevFrame();
};
changeFrameOf("9", hero + 1);
var przesuwanie = false;
mc_undo.onPress = function () {
playSound(sClick);
clean_creator("all");
map_pointer--;
map_pointer = ((map_pointer < 0) ? 0 : (map_pointer));
map1 = new Array();
map1 = copyMap(map_moves[map_pointer]);
createMap();
};
mc_redo.onPress = function () {
playSound(sClick);
clean_creator("all");
map_pointer++;
map_pointer = ((map_pointer > (map_moves.length - 1)) ? (map_moves.length - 1) : (map_pointer));
map1 = new Array();
map1 = copyMap(map_moves[map_pointer]);
createMap();
};
mc_pop2._visible = false;
b1.gotoAndStop(1);
b2.gotoAndStop(1);
b3.gotoAndStop(1);
b4.gotoAndStop(1);
b5.gotoAndStop(10);
b6.gotoAndStop(1);
b7.gotoAndStop(1);
b8.gotoAndStop(1);
mc_pop.swapDepths(this.getNextHighestDepth());
mc_pop2.swapDepths(this.getNextHighestDepth());
btn_save_level.onPress = function () {
playSound(sClick);
mc_pop2.gotoAndStop(1);
mc_pop2._visible = true;
};
mc_pop2.b_yes.onPress = function () {
playSound(sClick);
so.data.bckFrame = bckFrame;
so.data.objective = objective;
so.data.hero = hero;
so.data.map1 = copyMap(map1);
so.flush();
this._visible = false;
mc_pop2.gotoAndStop("saved");
};
mc_pop2.b_no.onPress = function () {
playSound(sClick);
mc_pop2._visible = false;
};
mc_pop2.b_ok.onPress = function () {
playSound(sClick);
mc_pop2._visible = false;
};
mc_pop2.mc_window.useHandCursor = false;
mc_pop2.mc_window.onRollOver = function () {
};
var tab_menu = new Array(b1, b2, b3, b4, b5, b6, b7, b_next, b_prev, mc_changer.b_down, mc_changer.b_up);
var tab_thumbs5 = new Array(mc_sqx, mc_sq, mc_skala, mc_sqb, mc_sqc, mc_chest, mc_chestx, mc_liana, mc_hero, mc_sadzawka, mc_statue, mc_diamond, mc_wall, mc_sqmagma, mc_posag, mc_posag2, mc_exit, mc_snake, mc_pnacze, mc_dzban, mc_spider, mc_rubber, mc_batsCage, mc_rubber_all, b_help2, btn_save_level);
block(false, fields);
block(false, tab_thumbs5);
block(false, tab_menu);
actBrush = "-1";
mc_pop.btn_close.onPress = function () {
playSound(sClick);
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
block(true, tab_thumbs5);
actBrush = "-2";
};
mc_sqx.onRollOver = function () {
mc_cloud.gotoAndStop("kladka");
pokaz_pop3(this);
};
mc_sq.onRollOver = function () {
mc_cloud.gotoAndStop("1a");
pokaz_pop3(this);
};
mc_skala.onRollOver = function () {
mc_cloud.gotoAndStop("skala");
pokaz_pop3(this);
};
mc_sqb.onRollOver = function () {
mc_cloud.gotoAndStop("swamp");
pokaz_pop3(this);
};
mc_sqc.onRollOver = function () {
mc_cloud.gotoAndStop("zapadka");
pokaz_pop3(this);
};
mc_chest.onRollOver = function () {
mc_cloud.gotoAndStop("chest");
pokaz_pop3(this);
};
mc_chestx.onRollOver = function () {
mc_cloud.gotoAndStop("chestx");
pokaz_pop3(this);
};
mc_liana.onRollOver = function () {
mc_cloud.gotoAndStop("liana");
pokaz_pop3(this);
};
mc_hero.onRollOver = function () {
mc_cloud.gotoAndStop("hero");
pokaz_pop3(this);
};
mc_sadzawka.onRollOver = function () {
mc_cloud.gotoAndStop("sadzawka");
pokaz_pop3(this);
};
mc_statue.onRollOver = function () {
mc_cloud.gotoAndStop("statue");
pokaz_pop3(this);
};
mc_diamond.onRollOver = function () {
mc_cloud.gotoAndStop("diamond");
pokaz_pop3(this);
};
mc_wall.onRollOver = function () {
mc_cloud.gotoAndStop("wall");
pokaz_pop3(this);
};
mc_sqmagma.onRollOver = function () {
mc_cloud.gotoAndStop("magma");
pokaz_pop3(this);
};
mc_posag.onRollOver = function () {
mc_cloud.gotoAndStop("posag");
pokaz_pop3(this);
};
mc_posag2.onRollOver = function () {
mc_cloud.gotoAndStop("posag2");
pokaz_pop3(this);
};
mc_snake.onRollOver = function () {
mc_cloud.gotoAndStop("snake");
pokaz_pop3(this);
};
mc_pnacze.onRollOver = function () {
mc_cloud.gotoAndStop("pnacze");
pokaz_pop3(this);
};
mc_dzban.onRollOver = function () {
mc_cloud.gotoAndStop("dzban");
pokaz_pop3(this);
};
mc_spider.onRollOver = function () {
mc_cloud.gotoAndStop("spider");
pokaz_pop3(this);
};
mc_batsCage.onRollOver = function () {
mc_cloud.gotoAndStop("cage");
pokaz_pop3(this);
};
mc_sqx.onRollOut = (mc_sq.onRollOut = (mc_skala.onRollOut = (mc_sqb.onRollOut = (mc_sqc.onRollOut = (mc_chest.onRollOut = (mc_chestx.onRollOut = (mc_liana.onRollOut = (mc_hero.onRollOut = (mc_sadzawka.onRollOut = (mc_statue.onRollOut = (mc_diamond.onRollOut = (mc_wall.onRollOut = (mc_sqmagma.onRollOut = (mc_posag.onRollOut = (mc_posag2.onRollOut = (mc_snake.onRollOut = (mc_pnacze.onRollOut = (mc_dzban.onRollOut = (mc_spider.onRollOut = (mc_batsCage.onRollOut = function () {
mc_cloud._visible = false;
}))))))))))))))))))));
mc_sqx.onReleaseOutside = (mc_sq.onReleaseOutside = (mc_skala.onReleaseOutside = (mc_sqb.onReleaseOutside = (mc_sqc.onReleaseOutside = (mc_chest.onReleaseOutside = (mc_chestx.onReleaseOutside = (mc_liana.onReleaseOutside = (mc_hero.onReleaseOutside = (mc_sadzawka.onReleaseOutside = (mc_statue.onReleaseOutside = (mc_diamond.onReleaseOutside = (mc_wall.onReleaseOutside = (mc_sqmagma.onReleaseOutside = (mc_posag.onReleaseOutside = (mc_posag2.onReleaseOutside = (mc_snake.onReleaseOutside = (mc_pnacze.onReleaseOutside = (mc_dzban.onReleaseOutside = (mc_spider.onReleaseOutside = (mc_batsCage.onReleaseOutside = function () {
mc_cloud._visible = false;
}))))))))))))))))))));
mc_cloud.swapDepths(this.getNextHighestDepth());
Frame 540
cleanClips();
Frame 545
mc_popHelp0._visible = false;
stopLoop("map");
stopLoop("begin");
startLoop("level");
removeMovieClip(mc_popHelp);
mc_pop_warning1._visible = false;
gotoAndPlay(nFrame);
Frame 550
function changeFrameOf(_brush, _frame) {
trace((("changeFrameOf:" + _brush) + ", ") + _frame);
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == _brush) {
var _local3 = getClipNumFromWsp(_local1, _local2);
fields[_local3].n1.gotoAndStop(_frame);
}
_local1++;
}
_local2++;
}
}
function firstTime() {
counter = 0;
var i = 0;
while (i < 13) {
var j = 0;
while (j < 20) {
duplicateMovieClip (sq_sym, "field" + counter, 1111 - counter);
fields[counter] = eval ("field" + counter);
fields[counter]._x = mc_map._x + (j * wid);
fields[counter]._y = mc_map._y + (i * wid);
if ((((i == 0) || (i == 12)) || (j == 0)) || (j == 19)) {
dodaj_maske(fields[counter]);
}
counter++;
j++;
}
i++;
}
}
function createMap() {
counter = 0;
var _local4 = 0;
while (_local4 < 13) {
var _local3 = 0;
while (_local3 < 20) {
fields[counter].gotoAndStop(brushToframe(map1[_local4][_local3], fields[counter], _local4, _local3));
if ((((map1[_local4][_local3] == w) || (map1[_local4][_local3] == x)) || (map1[_local4][_local3] == y)) || (map1[_local4][_local3] == z)) {
fields[counter].n1.gotoAndStop(objective);
}
if (map1[_local4][_local3] == "9") {
fields[counter].n1.gotoAndStop(hero + 1);
}
if (map1[_local4][_local3].substr(0, 1) == "e") {
fields[counter].n1.gotoAndStop(Number(map1[_local4][_local3].split("e").join("")) + 1);
trace(("gotoAndStop:" + Number(map1[_local4][_local3].split("e").join(""))) + 1);
}
fields[counter].onRelease = (fields[counter].onReleaseOutside = function () {
if (przesuwanie == true) {
actBrush = defBrush;
ruchM = false;
mc_hand.gotoAndStop("hand");
}
if (((((actBrush == "9") || (actBrush == w)) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
actBrush = "-2";
}
if (actBrush.substr(0, 1) == "e") {
actBrush = "-2";
}
polacz_klocki();
przesuwanie = false;
if (map_pointer < (map_moves.length - 1)) {
map_moves.splice(map_pointer + 1);
}
map_moves[map_moves.length] = new Array();
map_moves[map_moves.length - 1] = copyMap(map1);
map_pointer = map_moves.length - 1;
mc_undo.enabled = true;
mc_redo.enabled = true;
});
fields[counter].onRollOver = function () {
var _local4 = getK(this, fields);
var _local2 = new Array();
_local2 = getWsp(fields[_local4]);
if (((actBrush != "0") && (map1[_local2[1]][_local2[0]] != 0)) && (actBrush != "-1")) {
if (mc_hand.getDepth() != (this._parent.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this._parent.getNextHighestDepth());
}
mc_hand.gotoAndStop("hand");
mc_hand._x = this._x;
mc_hand._y = this._y;
mc_hand._visible = true;
} else if (actBrush != "0") {
mc_hand._visible = false;
}
if (map1[_local2[1]][_local2[0]] == 0) {
this.gotoAndStop(brushToframe(actBrush, null, -1, -1));
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("rope_spider");
}
if ((actBrush == "9") && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
this.n1.gotoAndStop(hero + 1);
}
if ((actBrush.substr(0, 1) == "e") && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
this.n1.gotoAndStop(enemy + 1);
}
if ((actBrush == objective) && (map1[_local2[1]][_local2[0]] == 0)) {
var _local5 = getClipNumFromWsp(_local2[0], _local2[1]);
var _local3 = 0;
switch (objective) {
case w :
_local3 = 1;
break;
case x :
_local3 = 2;
break;
case y :
_local3 = 3;
break;
case z :
_local3 = 4;
}
this.n1.gotoAndStop(_local3);
}
};
fields[counter].onRollOut = function () {
sq_sym._visible = false;
var _local3 = getK(this, fields);
var _local2 = new Array();
_local2 = getWsp(fields[_local3]);
if (map1[_local2[1]][_local2[0]] == 0) {
this.gotoAndStop("out");
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("liana");
}
};
fields[counter].onPress = function () {
if (actBrush != "-1") {
var _local3 = getMouseK();
var _local2 = new Array();
_local2 = getWsp(fields[_local3]);
if (((map1[_local2[1]][_local2[0]] == 0) || (actBrush == "0")) && (actBrush != "-2")) {
if ((((((map1[_local2[1]][_local2[0]].substr(0, 2) != "xe") && (map1[_local2[1]][_local2[0]].substr(0, 1) != "e")) && (map1[_local2[1]][_local2[0]] != "9")) && (map1[_local2[1]][_local2[0]] != "9x")) && (map1[_local2[1]][_local2[0]] != objective)) && (map1[_local2[1]][_local2[0]] != zx)) {
pressField(_local3);
polacz_klocki();
}
} else if (((actBrush != r) || (map1[_local2[1]][_local2[0]] != "7")) && (actBrush != 0)) {
if (map1[_local2[1]][_local2[0]] == "9x") {
przesun(_local2[0], _local2[1] + 1);
} else if (map1[_local2[1]][_local2[0]].substr(0, 2) == "xe") {
if ((map1[_local2[1]][_local2[0]] == "xe4") || (map1[_local2[1]][_local2[0]] == "xe5")) {
var _local4 = findFirstOnMap(map1[_local2[1]][_local2[0]].split("x").join(""));
var _local6 = _local4[0] - _local2[0];
var _local5 = _local4[1] - _local2[1];
przesun(_local2[0] + _local6, _local2[1] + _local5);
} else {
przesun(_local2[0], _local2[1] + 1);
}
} else if (map1[_local2[1]][_local2[0]] == zx) {
var _local4 = findFirstOnMap(objective);
var _local6 = _local4[0] - _local2[0];
var _local5 = _local4[1] - _local2[1];
przesun(_local2[0] + _local6, _local2[1] + _local5);
} else {
przesun(_local2[0], _local2[1]);
}
}
if ((actBrush == r) && (map1[_local2[1]][_local2[0]] == "7")) {
this.gotoAndStop("rope_spider");
pressField(_local3);
polacz_klocki();
}
}
};
if (map1[_local4][_local3] == "2") {
rysuj_mosty(Math.floor(_local3), Math.floor(_local4));
}
counter++;
_local3++;
}
_local4++;
}
polacz_klocki();
}
function pressField(nField) {
if ((actBrush != "-1") && (actBrush != "-2")) {
var _local1 = new Array();
_local1 = getWsp(fields[nField]);
var _local4 = true;
if (actBrush == "0") {
if (map1[_local1[1]][_local1[0]] == a) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
}
if ((((map1[_local1[1]][_local1[0]] == w) || (map1[_local1[1]][_local1[0]] == x)) || (map1[_local1[1]][_local1[0]] == y)) || (map1[_local1[1]][_local1[0]] == z)) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
}
if (map1[_local1[1]][_local1[0]] == "9") {
map1[_local1[1] - 1][_local1[0]] = actBrush;
}
if (map1[_local1[1]][_local1[0]].substr(0, 1) == "e") {
if ((map1[_local1[1]][_local1[0]] == "e4") || (map1[_local1[1]][_local1[0]] == "e5")) {
map1[_local1[1]][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = actBrush;
map1[_local1[1] + 1][_local1[0]] = actBrush;
} else {
map1[_local1[1] - 1][_local1[0]] = actBrush;
}
}
}
if (actBrush == "9") {
if (map1[_local1[1] - 1][_local1[0]] == 0) {
_local4 = true;
} else {
_local4 = false;
}
var _local3 = 0;
while (_local3 < 13) {
if (_local4 == false) {
break;
}
var _local2 = 0;
while (_local2 < 20) {
if (map1[_local3][_local2] == "9") {
_local4 = false;
break;
}
_local2++;
}
_local3++;
}
}
if (actBrush.substr(0, 1) == "e") {
if ((actBrush == "e4") || (actBrush == "e5")) {
_local4 = Boolean(((map1[_local1[1]][_local1[0] + 1] == 0) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0]] == 0));
} else {
_local4 = Boolean(map1[_local1[1] - 1][_local1[0]] == 0);
}
}
if ((((actBrush == w) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
if (((map1[_local1[1]][_local1[0] + 1] == 0) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0]] == 0)) {
_local4 = true;
} else {
_local4 = false;
}
var _local3 = 0;
while (_local3 < 13) {
var _local2 = 0;
while (_local2 < 20) {
if ((((map1[_local3][_local2] == w) || (map1[_local3][_local2] == x)) || (map1[_local3][_local2] == y)) || (map1[_local3][_local2] == z)) {
_local4 = false;
break;
}
_local2++;
}
_local3++;
}
}
trace("mozliwe postawienie:" + _local4);
if (actBrush == a) {
if ((((((map1[_local1[1]][_local1[0]] == 0) && (map1[_local1[1]][_local1[0] + 1] == 0)) && (map1[_local1[1] + 1][_local1[0] + 1] == 0)) && (map1[_local1[1] + 2][_local1[0] + 1] == "1")) && (map1[_local1[1] + 1][_local1[0]] == 0)) && (map1[_local1[1] + 2][_local1[0]] == 1)) {
_local4 = true;
} else {
_local4 = false;
}
}
if (_local4 == true) {
if ((actBrush == r) && (map1[_local1[1]][_local1[0]] == "7")) {
map1[_local1[1]][_local1[0]] = "7a";
} else {
map1[_local1[1]][_local1[0]] = actBrush;
}
fields[nField].gotoAndStop(brushToframe(map1[_local1[1]][_local1[0]], fields[nField], _local1[1], _local1[0]));
if (actBrush == "9") {
fields[nField].n1.gotoAndStop(hero + 1);
map1[_local1[1] - 1][_local1[0]] = "9x";
}
if (actBrush.substr(0, 1) == "e") {
trace("stawiamy enemy:" + actBrush);
if ((actBrush == "e4") || (actBrush == "e5")) {
fields[nField].n1.gotoAndStop(enemy + 1);
map1[_local1[1]][_local1[0] + 1] = "x" + actBrush;
map1[_local1[1] + 1][_local1[0] + 1] = "x" + actBrush;
map1[_local1[1] + 1][_local1[0]] = "x" + actBrush;
} else {
fields[nField].n1.gotoAndStop(enemy + 1);
map1[_local1[1] - 1][_local1[0]] = "xe" + enemy;
}
}
if (actBrush == a) {
map1[_local1[1]][_local1[0] + 1] = ax;
map1[_local1[1] + 1][_local1[0] + 1] = ax;
map1[_local1[1] + 1][_local1[0]] = ax;
}
if ((((actBrush == w) || (actBrush == x)) || (actBrush == y)) || (actBrush == z)) {
fields[nField].n1.gotoAndStop(actBrush);
map1[_local1[1]][_local1[0] + 1] = zx;
map1[_local1[1] + 1][_local1[0] + 1] = zx;
map1[_local1[1] + 1][_local1[0]] = zx;
}
} else {
fields[nField].gotoAndStop("out");
}
if (actBrush == "2") {
rysuj_mosty(Math.floor(_local1[0]), Math.floor(_local1[1]));
}
}
}
function getWsp(clip) {
var _local1 = new Array(2);
_local1[0] = Math.round((clip._x - mc_map._x) / wid);
_local1[1] = Math.round((clip._y - mc_map._y) / wid);
return(_local1);
}
function getK(clip, tab) {
var _local1 = 0;
while (_local1 < tab.length) {
if (clip == tab[_local1]) {
return(_local1);
}
_local1++;
}
}
function getMouseK() {
var _local1 = Math.floor((_xmouse - mc_map._x) / wid);
var _local2 = Math.floor((_ymouse - mc_map._y) / wid);
return(getClipNumFromWsp(_local1, _local2));
}
function getClipNumFromWsp(xx, yy) {
var _local1 = (yy * 20) + xx;
return(_local1);
}
function brushToframe(brush, clip, pos1, pos0) {
var _local1 = "";
if (brush.substr(0, 1) == "e") {
return("enemy");
}
switch (brush) {
case "0" :
if (clip != null) {
delete map_obj2[pos1][pos0];
map_obj2[pos1][pos0] = 0;
}
_local1 = "out";
break;
case "1" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(1, clip, -111);
}
_local1 = "1a";
break;
case "101" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(101, clip, -111);
}
_local1 = "skala";
break;
case "2" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(2, clip, -111);
}
_local1 = "kladka";
break;
case "3" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(3, clip, -111);
}
_local1 = "swamp";
break;
case "4" :
_local1 = "zapadka";
break;
case "5" :
_local1 = "chest";
break;
case "6" :
_local1 = "chestx";
break;
case "7" :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(12, clip, -111);
}
_local1 = "liana";
break;
case "7a" :
_local1 = "rope_spider";
break;
case s :
_local1 = "statue";
break;
case d :
_local1 = "diamond";
break;
case b :
_local1 = "dzban";
break;
case c :
_local1 = "cage";
break;
case r :
_local1 = "spider";
break;
case "9" :
_local1 = "hero";
break;
case m :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(13, clip, -111);
}
_local1 = "magma";
break;
case n :
if (clip != null) {
map_obj2[pos1][pos0] = new Square(7, clip, -111);
}
_local1 = "pnacze";
break;
case p :
_local1 = "posag";
break;
case p2 :
_local1 = "posag2";
break;
case r :
_local1 = "spider";
break;
case a :
_local1 = "sadzawka";
break;
case l :
_local1 = "wall";
break;
case w :
_local1 = "exit";
break;
case x :
_local1 = "exit";
break;
case y :
_local1 = "exit";
break;
case z :
_local1 = "exit";
}
return(_local1);
}
function polacz_klocki() {
var _local6 = 0;
while (_local6 < map_obj2.length) {
var _local3 = 0;
while (_local3 < map_obj2[0].length) {
var _local2 = map_obj2[_local6][_local3];
if (_local2.connected == true) {
var _local1 = new Array();
_local1[0] = _local3;
_local1[1] = _local6;
var _local8 = map_obj2[_local1[1]][_local1[0] + 1].type == _local2.type;
var _local7 = map_obj2[_local1[1]][_local1[0] - 1].type == _local2.type;
var _local4 = map_obj2[_local1[1] - 1][_local1[0]].type == _local2.type;
var _local5 = map_obj2[_local1[1] + 1][_local1[0]].type == _local2.type;
if ((((!_local8) && (!_local7)) && (!_local4)) && (!_local5)) {
_local2.clip.n1.gotoAndStop("single");
} else if ((((!_local4) && (!_local5)) && (_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right");
} else if ((((!_local4) && (!_local5)) && (!_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("left");
} else if ((((!_local4) && (!_local5)) && (_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("center");
} else if ((((!_local4) && (_local5)) && (_local7)) && (_local8)) {
_local2.clip.n1.gotoAndStop("center_up");
} else if ((((!_local4) && _local5) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_up");
} else if ((((!_local4) && _local5) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_up");
} else if (((_local4 && _local5) && _local7) && _local8) {
_local2.clip.n1.gotoAndStop("center_center");
} else if (((_local4 && _local5) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_center");
} else if (((_local4 && _local5) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_center");
} else if (((_local4 && (!_local5)) && _local7) && _local8) {
_local2.clip.n1.gotoAndStop("down_center");
} else if (((_local4 && (!_local5)) && (!_local7)) && _local8) {
_local2.clip.n1.gotoAndStop("left_down");
} else if (((_local4 && (!_local5)) && _local7) && (!_local8)) {
_local2.clip.n1.gotoAndStop("right_down");
} else if ((((!_local4) && _local5) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_up");
} else if (((_local4 && _local5) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_center");
} else if (((_local4 && (!_local5)) && (!_local7)) && (!_local8)) {
_local2.clip.n1.gotoAndStop("single_down");
}
_local2.clip.n1.kt1._visible = false;
_local2.clip.n1.kt2._visible = false;
}
_local3++;
}
_local6++;
}
_local6 = 0;
while (_local6 < map_obj2.length) {
var _local3 = 0;
while (_local3 < map_obj2[0].length) {
var _local2 = map_obj2[_local6][_local3];
var _local1 = new Array();
_local1[0] = _local3;
_local1[1] = _local6;
if (_local2.type == 12) {
var _local8 = (map1[_local1[1]][_local1[0] + 1] == "7") || (map1[_local1[1]][_local1[0] + 1] == "7a");
var _local7 = (map1[_local1[1]][_local1[0] - 1] == "7") || (map1[_local1[1]][_local1[0] - 1] == "7a");
var _local4 = (map1[_local1[1] - 1][_local1[0]] == "7") || (map1[_local1[1] - 1][_local1[0]] == "7a");
var _local5 = (map1[_local1[1] + 1][_local1[0]] == "7") || (map1[_local1[1] + 1][_local1[0]] == "7a");
if ((!_local4) && (!_local5)) {
_local2.clip.n1.gotoAndStop("single");
} else if (_local4 && (!_local5)) {
_local2.clip.n1.gotoAndStop("down");
} else if ((!_local4) && (_local5)) {
if (map_obj2[_local1[1] + 2][_local1[0]].type == _local2.type) {
_local2.clip.n1.gotoAndStop("up");
} else {
_local2.clip.n1.gotoAndStop("single");
}
} else if (_local4 && (_local5)) {
_local2.clip.n1.gotoAndStop("center");
}
}
_local3++;
}
_local6++;
}
}
function przesun(myx, myy) {
defBrush = actBrush;
przesuwanie = true;
actBrush = map1[myy][myx];
oldPos1 = myy;
oldPos0 = myx;
mc_hand.gotoAndStop("hand_close");
}
function usun_obiekt(myobj, myx, myy) {
oldBrush = actBrush;
var _local1 = (myy * map1[0].length) + myx;
if ((map1[myy][myx] == "7a") && (pojedyncze == true)) {
actBrush = "7";
} else {
actBrush = "0";
}
pressField(_local1);
actBrush = oldBrush;
}
function rysuj_mosty(myx, myy) {
var _local4 = myx;
var _local3 = myy;
obj = map_obj2[_local3][_local4];
var _local5 = random(obj.clip.n1._totalframes) + 1;
obj.clip.n1.gotoAndStop(_local5);
do {
var _local2 = random(obj.clip.n1._totalframes) + 1;
var onceAgain = false;
var _local1 = -5;
while (_local1 < 5) {
_local1 = ((_local1 == -1) ? 0 : (_local1));
if (map_obj2[_local3][(_local4 - _local1) - 1].clip.n1._currentframe == obj.clip.n1._currentframe) {
obj.clip.n1.gotoAndStop(_local2);
onceAgain = true;
break;
}
_local1++;
}
} while (onceAgain == true);
}
function clean_creator(param) {
map_obj2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
if (param == "all") {
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
} else {
var _local3 = 0;
while (_local3 < 13) {
var _local2 = 0;
while (_local2 < 20) {
if ((((map1[_local3][_local2] != "9") && (map1[_local3][_local2] != "9x")) && (map1[_local3][_local2] != objective)) && (map1[_local3][_local2] != zx)) {
map1[_local3][_local2] = 0;
}
_local2++;
}
_local3++;
}
}
var _local1 = 0;
while (_local1 < fields.length) {
var _local4 = new Array();
_local4 = getWsp(fields[_local1]);
var _local3 = Math.floor(_local4[1]);
var _local2 = Math.floor(_local4[0]);
if (((((map1[_local3][_local2] != "9") && (map1[_local3][_local2] != "9x")) && (map1[_local3][_local2] != objective)) && (map1[_local3][_local2] != zx)) || (param == "all")) {
fields[_local1].gotoAndStop("out");
}
_local1++;
}
}
function copyMap(mapStart) {
var _local3 = new Array();
_local3 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
_local3[_local2][_local1] = mapStart[_local2][_local1];
_local1++;
}
_local2++;
}
return(_local3);
}
function cleanClips() {
var _local1 = 0;
while (_local1 < fields.length) {
removeMovieClip(fields[_local1]);
_local1++;
}
_local1 = 0;
while (_local1 < tab_masks.length) {
removeMovieClip(tab_masks[_local1]);
_local1++;
}
removeMovieClip(mc_mask);
delete fields;
removeMovieClip(mc_pop_warning);
removeMovieClip(mc_hand);
removeMovieClip(mc_pop);
removeMovieClip(mc_pop2);
removeMovieClip(mc_pop3);
mc_pop._visible = false;
}
function block(bool, array) {
var _local1 = 0;
while (_local1 < array.length) {
array[_local1].enabled = bool;
_local1++;
}
}
function dodaj_maske(clip1) {
mc_mask_big.duplicateMovieClip("mc_mask" + tab_masks.length, this.getNextHighestDepth());
tab_masks.push(eval ("mc_mask" + tab_masks.length));
clip1.setMask(tab_masks[tab_masks.length - 1]);
}
function isHeroSet() {
var _local3 = false;
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == "9") {
_local3 = true;
break;
}
_local1++;
}
if (_local3 == true) {
break;
}
_local2++;
}
return(_local3);
}
function isObjSet() {
var _local3 = false;
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if ((((map1[_local2][_local1] == "o4") || (map1[_local2][_local1] == "o3")) || (map1[_local2][_local1] == "o2")) || (map1[_local2][_local1] == "o1")) {
objective = map1[_local2][_local1];
_local3 = true;
break;
}
_local1++;
}
if (_local3 == true) {
break;
}
_local2++;
}
return(_local3);
}
function findFirstOnMap(co) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == co) {
_local3[0] = _local1;
_local3[1] = _local2;
break;
}
_local1++;
}
_local2++;
}
return(_local3);
}
function popup(enemy1, clip) {
var _local2 = "enemy" + (enemy1 + 1);
mc_cloud.gotoAndStop(_local2);
mc_cloud._x = (clip._x + clip._width) - 20;
mc_cloud._y = clip._y + 40;
mc_cloud._visible = true;
}
function slideEnemies(index) {
mc_changer.v1 = ((first_act + 2) + "/") + enemies.length;
h1.gotoAndStop(1 + first_act);
h2.gotoAndStop(2 + first_act);
if ((((selectedItem + 1) - first_act) > 0) && (((selectedItem + 1) - first_act) < 3)) {
mc_ramka._y = eval ("h" + ((selectedItem + 1) - first_act))._y - 12;
mc_ramka._visible = true;
} else {
mc_ramka._visible = false;
}
if (first_act < enemies.length) {
h1.disabled_sign._visible = enemies[first_act].disabled;
h1.enabled = !enemies[first_act].disabled;
}
if ((first_act + 1) < enemies.length) {
h2.disabled_sign._visible = enemies[first_act + 1].disabled;
h2.enabled = !enemies[first_act + 1].disabled;
}
trace((("enemy:" + enemy) + ", first_act:") + first_act);
}
function isEnemySet() {
var _local2 = 0;
while (_local2 < 13) {
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] == ("e" + enemy)) {
return(true);
}
_local1++;
}
_local2++;
}
return(false);
}
function getEnemyByIndex(index) {
trace("getEnemyByIndex:multiple:" + enemies[index].multiple);
return(enemies[index]);
}
function getEnemyIndex(name) {
var _local2;
name = name.split("x").join("");
name = name.split("e").join("");
trace("getEnemyIndex:" + name);
return(Number(name));
}
trace(map1);
stop();
b1.gotoAndStop(1);
b2.gotoAndStop(1);
b3.gotoAndStop(1);
b4.gotoAndStop(1);
b5.gotoAndStop(1);
b6.gotoAndStop(1);
b7.gotoAndStop(1);
b8.gotoAndStop(10);
mc_pop.swapDepths(this.getNextHighestDepth());
var tab_menu = new Array(b1, b2, b3, b4, b5, b6, b7, b8, b_next, b_prev, mc_changer.b_down, mc_changer.b_up);
var frames_c = h1._totalframes;
var first_act = 0;
var selectedItem = 0;
enemies = Enemy.getEnemies();
trace(enemies);
mc_changer._visible = Boolean(enemies.length > 2);
var lastEnemy = (enemy || -1);
mc_loops.gotoAndStop("stop_loop");
curFrame = "c8";
b_next._visible = true;
b7.enabled = false;
h1.gotoAndStop(1 + first_act);
h2.gotoAndStop(2 + first_act);
mc_pop2._visible = false;
var isEnemy = isEnemySet();
h1.disabled_sign._visible = false;
if (enemies[1]) {
h2.disabled_sign._visible = enemies[1].disabled;
h2.enabled = !enemies[1].disabled;
}
mc_changer.v1 = "2/6";
var i = 0;
while (i < fields.length) {
removeMovieClip(fields[i]);
i++;
}
h1.onPress = function () {
enemy = first_act;
selectedItem = first_act;
playSound(sClick);
if (isEnemySet() && (!enemies[enemy].multiple)) {
actBrush = "-2";
} else {
actBrush = "e" + enemy;
}
trace("actBrush:" + actBrush);
slideEnemies(1);
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
};
h2.onPress = function () {
enemy = first_act + 1;
selectedItem = first_act + 1;
if (isEnemySet() && (!enemies[enemy].multiple)) {
actBrush = "-2";
} else {
actBrush = "e" + enemy;
}
trace("actBrush:" + actBrush);
playSound(sClick);
slideEnemies(2);
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
};
h1.onRollOver = function () {
popup(first_act, this);
};
h2.onRollOver = function () {
popup(first_act + 1, this);
};
h1.onRollOut = (h1.onReleaseOutside = function () {
mc_cloud._visible = false;
});
h2.onRollOut = (h2.onReleaseOutside = function () {
mc_cloud._visible = false;
});
var map_obj2 = new Array();
map_obj2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mc_hand0.duplicateMovieClip("mc_hand", this.getNextHighestDepth());
var tab_masks = new Array();
duplicateMovieClip (mc_map, "mc_mask", this.getNextHighestDepth());
var pojedyncze = true;
stop();
var map_moves = new Array();
var map_pointer = 1;
var counter = 0;
var wid = 31;
var fields = new Array();
var ruchM = false;
sq_sym.gotoAndStop("1a");
mc_sqx.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "2";
sq_sym.gotoAndStop("kladka");
};
mc_sq.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "1";
sq_sym.gotoAndStop("1a");
};
mc_skala.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "101";
sq_sym.gotoAndStop("skala");
};
mc_sqb.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "3";
sq_sym.gotoAndStop("swamp");
};
mc_sqc.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "4";
sq_sym.gotoAndStop("zapadka");
};
mc_chest.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "5";
sq_sym.gotoAndStop("chest");
};
mc_chestx.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "6";
sq_sym.gotoAndStop("chestx");
};
mc_liana.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "7";
sq_sym.gotoAndStop("liana");
};
mc_hero.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = "9";
sq_sym.gotoAndStop("hero");
};
mc_sadzawka.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = a;
sq_sym.gotoAndStop("sadzawka");
};
mc_statue.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = s;
sq_sym.gotoAndStop("statue");
};
mc_diamond.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = d;
sq_sym.gotoAndStop("diamond");
};
mc_wall.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = l;
sq_sym.gotoAndStop("wall");
};
mc_sqmagma.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = m;
sq_sym.gotoAndStop("magma");
};
mc_posag.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = p;
sq_sym.gotoAndStop("posag");
};
mc_posag2.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = p2;
sq_sym.gotoAndStop("posag2");
};
mc_exit.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
sq_sym.gotoAndStop("exit");
actBrush = objective;
};
mc_pnacze.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = n;
sq_sym.gotoAndStop("pnacze");
};
mc_dzban.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = b;
sq_sym.gotoAndStop("dzban");
};
mc_spider.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = r;
sq_sym.gotoAndStop("spider");
};
mc_rubber.onPress = function () {
playSound(sClick);
actBrush = "0";
mc_rubber.gotoAndStop(2);
};
mc_batsCage.onPress = function () {
playSound(sClick);
mc_rubber.gotoAndStop(1);
actBrush = c;
sq_sym.gotoAndStop("cage");
};
firstTime();
createMap();
var mDown = false;
this.onMouseDown = function () {
mDown = true;
};
this.onMouseUp = function () {
mDown = false;
};
var oldK = -1;
var oldPos1 = -1;
var oldPos0 = -1;
var myTab = new Array();
myTab.x = new Array();
myTab.y = new Array();
var opoznienie = 0;
this.onMouseMove = function () {
if (actBrush != "-1") {
var _local19 = _xmouse > mc_map._x;
var _local21 = _xmouse < (mc_map._x + mc_map._width);
var _local23 = _ymouse > mc_map._y;
var _local20 = _ymouse < (mc_map._y + mc_map._height);
var _local18 = false;
if (((_local23 && (_local20)) && (_local21)) && (_local19)) {
_local18 = true;
} else {
mc_hand._visible = false;
}
if (_local18 == true) {
var _local17 = Math.floor((_xmouse - mc_map._x) / wid);
var _local16 = Math.floor((_ymouse - mc_map._y) / wid);
var _local22 = (_local16 * map1[0].length) + _local17;
if ((((((((((map1[_local16][_local17] == "1") || (map1[_local16][_local17] == "3")) || (map1[_local16][_local17] == m)) || (map1[_local16][_local17] == n)) || (map1[_local16][_local17] == "101")) || (map1[_local16][_local17] == "7")) || (map1[_local16][_local17] == "2")) || (map1[_local16][_local17] == l)) && (przesuwanie == true)) && (ruchM == false)) {
pojedyncze = false;
myTab = new Array();
myTab.x = new Array();
myTab.y = new Array();
myTab.x[0] = _local17;
myTab.y[0] = _local16;
var _local8 = 0;
while (_local8 < myTab.x.length) {
var _local2 = myTab.y[_local8];
var _local3 = myTab.x[_local8];
br = map1[_local2][_local3];
var _local9 = map1[_local2 - 1][_local3] == br;
var _local10 = map1[_local2 + 1][_local3] == br;
var _local12 = map1[_local2][_local3 + 1] == br;
var _local11 = map1[_local2][_local3 - 1] == br;
if ((map1[_local2][_local3] == "7") || (map1[_local2][_local3] == "7a")) {
_local9 = ((map1[_local2 - 1][_local3] == br) || (map1[_local2 - 1][_local3] == (br + "a"))) || ((map1[_local2 - 1][_local3] + "a") == br);
_local10 = ((map1[_local2 + 1][_local3] == br) || (map1[_local2 + 1][_local3] == (br + "a"))) || ((map1[_local2 + 1][_local3] + "a") == br);
_local12 = false;
_local11 = false;
}
if (map1[_local2][_local3] == "2") {
_local9 = false;
_local10 = false;
}
bylo = true;
if (_local9) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == _local3) && (myTab.y[_local7] == (_local2 - 1))) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3);
myTab.y.push(_local2 - 1);
}
bylo = true;
if (_local10) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == _local3) && (myTab.y[_local7] == (_local2 + 1))) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3);
myTab.y.push(_local2 + 1);
}
bylo = true;
if (_local12) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == (_local3 + 1)) && (myTab.y[_local7] == _local2)) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3 + 1);
myTab.y.push(_local2);
}
bylo = true;
if (_local11) {
bylo = false;
var _local7 = 0;
while (_local7 < myTab.x.length) {
if ((myTab.x[_local7] == (_local3 - 1)) && (myTab.y[_local7] == _local2)) {
bylo = true;
}
_local7++;
}
}
if (bylo == false) {
myTab.x.push(_local3 - 1);
myTab.y.push(_local2);
}
_local8++;
}
ruchM = true;
}
if ((przesuwanie == true) && ((oldPos0 != _local17) || (oldPos1 != _local16))) {
if (map1[oldPos1][oldPos0] == "9") {
if (((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == (actBrush + "x"))) && (((map1[_local16 - 1][_local17] == 0) || (map1[_local16 - 1][_local17] == (actBrush + "x"))) || (map1[_local16 - 1][_local17] == "9"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if (map1[oldPos1][oldPos0].substr(0, 1) == "e") {
if (((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == ("x" + actBrush))) && (((map1[_local16 - 1][_local17] == 0) || (map1[_local16 - 1][_local17] == ("x" + actBrush))) || (map1[_local16 - 1][_local17].substr(0, 1) == "e"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if ((map1[oldPos1][oldPos0] == objective) || (map1[oldPos1][oldPos0] == zx)) {
if (((((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == zx)) && (((map1[_local16 + 1][_local17] == 0) || (map1[_local16 + 1][_local17] == zx)) || (map1[_local16 + 1][_local17] == objective))) && (((map1[_local16 + 1][_local17 + 1] == 0) || (map1[_local16 + 1][_local17 + 1] == zx)) || (map1[_local16 + 1][_local17 + 1] == objective))) && (((map1[_local16][_local17 + 1] == 0) || (map1[_local16][_local17 + 1] == zx)) || (map1[_local16][_local17 + 1] == objective))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
}
if ((((((((((((map1[oldPos1][oldPos0] != "1") && (map1[oldPos1][oldPos0] != "3")) && (map1[oldPos1][oldPos0] != m)) && (map1[oldPos1][oldPos0] != n)) && (map1[oldPos1][oldPos0] != "101")) && (map1[oldPos1][oldPos0] != "7")) && (map1[oldPos1][oldPos0] != "2")) && (map1[oldPos1][oldPos0] != "9")) && (map1[oldPos1][oldPos0] != objective)) && (map1[oldPos1][oldPos0] != "9x")) && (map1[oldPos1][oldPos0] != zx)) && (map1[oldPos1][oldPos0] != l)) {
pojedyncze = true;
if (map1[oldPos1][oldPos0] == "7a") {
actBrush = r;
}
if ((map1[_local16][_local17] == 0) || (map1[_local16][_local17] == (actBrush + "x"))) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
if ((actBrush == r) && (map1[_local16][_local17] == "7")) {
usun_obiekt(map1[oldPos1][oldPos0], oldPos0, oldPos1);
pressField(_local22);
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
}
} else if ((((map1[oldPos1][oldPos0] != "9") && (map1[oldPos1][oldPos0] != objective)) && (map1[oldPos1][oldPos0] != "9x")) && (map1[oldPos1][oldPos0] != zx)) {
var _local6 = _local17 - oldPos0;
var _local5 = _local16 - oldPos1;
var _local15 = true;
var _local7 = 0;
while (_local7 < myTab.y.length) {
if ((map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] != 0) && (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] != map1[oldPos1][oldPos0])) {
_local15 = false;
break;
}
_local7++;
}
if (_local15 == true) {
var _local13 = 0;
_local7 = 0;
while (_local7 < myTab.y.length) {
if (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] == 0) {
_local13++;
}
if (map1[myTab.y[_local7] + _local5][myTab.x[_local7] + _local6] == map1[oldPos1][oldPos0]) {
var _local4 = 0;
while (_local4 < myTab.y.length) {
if (((myTab.y[_local7] + _local5) == myTab.y[_local4]) && ((myTab.x[_local7] + _local6) == myTab.x[_local4])) {
_local13++;
break;
}
_local4++;
}
}
_local7++;
}
if (_local13 != myTab.x.length) {
_local15 = false;
}
}
if (_local15 == true) {
_local7 = 0;
while (_local7 < myTab.y.length) {
usun_obiekt(map1[myTab.y[_local7]][myTab.x[_local7]], myTab.x[_local7], myTab.y[_local7]);
_local7++;
}
_local7 = 0;
while (_local7 < myTab.y.length) {
var _local14 = ((myTab.y[_local7] + _local5) * map1[0].length) + (myTab.x[_local7] + _local6);
pressField(_local14);
myTab.y[_local7] = myTab.y[_local7] + _local5;
myTab.x[_local7] = myTab.x[_local7] + _local6;
_local7++;
}
oldK = _local22;
oldPos1 = _local16;
oldPos0 = _local17;
przesun(_local17, _local16);
}
polacz_klocki();
}
}
if ((przesuwanie == false) && (actBrush == "0")) {
if (mc_hand.getDepth() != (this.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this.getNextHighestDepth());
}
mc_hand.gotoAndStop("rubber");
mc_hand._x = _xmouse - 15;
mc_hand._y = _ymouse - 15;
mc_hand._visible = true;
}
if ((mDown == true) && (przesuwanie == true)) {
if (mc_hand.getDepth() != (this.getNextHighestDepth() - 1)) {
mc_hand.swapDepths(this.getNextHighestDepth());
}
mc_hand.gotoAndStop("hand_close");
mc_hand._x = _xmouse - 15;
mc_hand._y = _ymouse - 15;
}
if ((mDown == true) && (przesuwanie == false)) {
_local17 = Math.floor((_xmouse - mc_map._x) / wid);
_local16 = Math.floor((_ymouse - mc_map._y) / wid);
if ((map1[_local16][_local17] == 0) || (actBrush == "0")) {
if ((((map1[_local16][_local17] != "9") && (map1[_local16][_local17] != "9x")) && (map1[_local16][_local17] != objective)) && (map1[_local16][_local17] != zx)) {
_local22 = (_local16 * map1[0].length) + _local17;
pressField(_local22);
if ((opoznienie % 4) == 0) {
polacz_klocki();
}
opoznienie++;
}
}
}
}
}
};
mc_rubber_all.onPress = function () {
playSound(sClick);
clean_creator("some");
};
mc_sadzawka.mc_rybka.stop();
mc_g2.onPress = function () {
playSound(sClick);
mc_exit.nextFrame();
};
mc_g1.onPress = function () {
playSound(sClick);
mc_exit.prevFrame();
};
changeFrameOf("9", hero + 1);
var przesuwanie = false;
mc_undo.onPress = function () {
playSound(sClick);
clean_creator("all");
map_pointer--;
map_pointer = ((map_pointer < 0) ? 0 : (map_pointer));
map1 = new Array();
map1 = copyMap(map_moves[map_pointer]);
createMap();
};
mc_redo.onPress = function () {
playSound(sClick);
clean_creator("all");
map_pointer++;
map_pointer = ((map_pointer > (map_moves.length - 1)) ? (map_moves.length - 1) : (map_pointer));
map1 = new Array();
map1 = copyMap(map_moves[map_pointer]);
createMap();
};
actBrush = "-2";
mc_cloud.swapDepths(_root.getNextHighestDepth());
mc_changer.b_down.onPress = function () {
playSound(sClick);
if ((first_act + 2) < frames_c) {
first_act++;
slideEnemies();
}
};
mc_changer.b_up.onPress = function () {
playSound(sClick);
if (first_act > 0) {
first_act--;
slideEnemies();
}
};
mc_pop.btn_close.onPress = function () {
playSound(sClick);
block(true, tab_menu);
block(true, fields);
mc_pop._visible = false;
};
mc_cloud._visible = false;
Frame 578
cleanClips();
gotoAndPlay(nFrame);
Frame 587
stop();
Frame 680
stop();
mc_pophelp.swapDepths(this.getNextHighestDepth());
Frame 983
goGame();
Frame 993
goGame();
Frame 994
goGame();
Frame 997
goGame();
Frame 998
goGame();
Frame 1001
goGame();
Frame 1002
goGame();
Frame 1006
goGame();
Frame 1007
goGame();
Frame 1012
goGame();
Frame 1013
goGame();
Frame 1022
goGame();
Frame 1023
goGame();
Frame 1061
goGame();
Frame 1062
goGame();
Frame 1093
goGame();
Frame 1094
goGame();
Frame 1113
mc_popHelp0._visible = false;
removeMovieClip(mc_popHelp);
gotoAndPlay ("game");
Frame 1141
cleanClips();
mc_popHelp0._visible = false;
removeMovieClip(mc_popHelp);
Frame 1146
mc_pop_warning1._visible = false;
gotoAndPlay(nFrame);
Frame 1151
stopLoop("level");
stopLoop("map");
stopLoop("begin");
startLoop("begin");
var warning = false;
var isHero = isHeroSet();
var isObj = isObjSet();
if (isHero == false) {
warning = true;
clean();
nFrame = "c3";
gotoAndPlay(nFrame);
} else if (isObj == false) {
warning = true;
clean();
nFrame = "c4";
gotoAndPlay(nFrame);
} else if (bckFrame == -1) {
clean();
warning = true;
nFrame = "c2";
gotoAndPlay(nFrame);
}
if (warning == false) {
mc_pop2._visible = false;
mc_pop_warning1._visible = false;
b_next._visible = true;
b7.enabled = false;
var i = 0;
while (i < fields.length) {
removeMovieClip(fields[i]);
i++;
}
var i = 0;
while (i < thumbs_array.length) {
removeMovieClip(thumbs_array[i]);
i++;
}
mc_popup._visible = false;
clean();
hero = Number(hero);
gotoAndStop("hero" + (Number(hero) + 1));
nFrame = "game";
b1.gotoAndStop(1);
b2.gotoAndStop(1);
b3.gotoAndStop(1);
b4.gotoAndStop(1);
b5.gotoAndStop(1);
b6.gotoAndStop(10);
b7.gotoAndStop(1);
b8.gotoAndStop(1);
if (gameMode == "PLAY") {
b1._visible = false;
b2._visible = false;
b3._visible = false;
b4._visible = false;
b5._visible = false;
b6._visible = false;
b7._visible = false;
b8._visible = false;
b_next._visible = false;
b_prev._visible = false;
}
cleanClips();
}
Frame 1161
function prawaSciana(wspx, wspy) {
if (map_obj[Math.floor(wspy)][Math.floor(wspx) + 1].przenik == false) {
return(true);
}
return(false);
}
function hideSquare(my_obj) {
playSound(sZN);
my_obj.clip.n1.gotoAndPlay("dead");
my_obj.hiden = true;
clearInterval(ID[my_obj.getID()]);
ID2[my_obj.getID()] = setInterval(showSquare, 3000, my_obj);
}
function hideObject(my_obj) {
my_obj.znikanie = true;
ID[my_obj.getID()] = setInterval(hideSquare, 1000, my_obj);
}
function showSquare(my_obj) {
my_obj.clip.n1.gotoAndPlay(1);
my_obj.znikanie = false;
my_obj.hiden = false;
new mx.transitions.Tween(my_obj.clip, "_alpha", EaseNone.None, 0, 100, 0.2, true);
clearInterval(ID2[my_obj.getID()]);
}
function fall(enemy) {
if (enemy.t == "Square") {
var _local3 = new Array(2);
_local3 = enemy.getWsp(mc_map._x, mc_map._y);
if ((map_obj[Math.floor(_local3[1])][Math.floor(_local3[0])].hiden != true) && (enemy.ground == false)) {
map_obj[Math.floor(_local3[1])][Math.floor(_local3[0])] = 0;
}
var _local1 = 0;
while (_local1 < enemy_obj.length) {
if ((((enemy.clip.hitTest(enemy_obj[_local1].clip) == true) && (enemy.ground == false)) && (enemy.clip._y < enemy_obj[_local1].clip._y)) && (Math.abs(enemy_obj[_local1].clip._x - enemy.clip._x) < (wid - 5))) {
enemy_obj[_local1].dead(_local1);
trash(enemy_obj[j].clip);
enemy_obj.splice(_local1, 1);
var j = 0;
while (j < fall_obj.length) {
if (fall_obj[j].clip == enemy_obj[_local1].clip) {
fall_obj.splice(j, 1);
}
j++;
}
}
_local1++;
}
var j = 0;
while (j < tab_chest_destroy.length) {
if (tab_chest_destroy[j].clip._y > (mc_map._y + mc_map._height)) {
destroyChest(tab_chest_destroy[j]);
}
j++;
}
if ((((enemy.clip.hitTest(mc_hero1) == true) && (enemy.ground == false)) && (Math.abs(enemy.clip._x - mc_hero1._x) < 16)) && (enemy.clip._y < mc_hero1._y)) {
dead();
}
}
var j = 0;
while (j < enemy_obj.length) {
if (enemy_obj[j].clip._y > (mc_map._y + mc_map._height)) {
enemy_obj[j].dead(j);
trash(enemy_obj[j].clip);
enemy_obj.splice(j, 1);
reload(j);
}
j++;
}
checkEnemyLand(enemy);
}
function walk(enemy) {
var _local6 = new Array();
_local6 = enemy.getWsp(mc_map._x, mc_map._y);
var _local5 = Math.floor(_local6[0]);
var _local1 = Math.floor(_local6[1]);
var _local2 = Math.round(_local6[0]);
var _local4 = 0;
if (enemy.dir == 1) {
_local4 = 1 * enemy.dir;
} else {
_local4 = (1 * enemy.dir) + 1;
}
if ((((map_obj[_local1][_local5 + _local4] == 0) || (map_obj[_local1][_local5 + _local4].przenik == true)) && (map_obj[_local1 + 1][_local5 + _local4].landing == true)) && (map_obj[_local1 + 1][_local5 + _local4].hiden == false)) {
enemy.clip._x = enemy.clip._x + (enemy.xspeed * enemy.dir);
} else if (enemy.xspeed > 0) {
var _local7 = (map_obj[_local1][_local2 + 1].przenik == false) && (map_obj[_local1 + 1][_local2 - 1].landing != true);
var _local9 = (map_obj[_local1][_local2 - 1].przenik == false) && (map_obj[_local1 + 1][_local2 + 1].landing != true);
var _local8 = (map_obj[_local1][_local2 - 1].przenik == false) && (map_obj[_local1][_local2 + 1].przenik == false);
if ((((((map_obj[_local1 + 1][_local2 - 1].landing == true) && (map_obj[_local1 + 1][_local2].landing == true)) || ((map_obj[_local1 + 1][_local2].landing == true) && (map_obj[_local1 + 1][_local2 + 1].landing == true))) && (_local7 == false)) && (_local9 == false)) && (_local8 == false)) {
enemy.dir = enemy.dir * -1;
enemy.clip._xscale = enemy.clip._xscale * -1;
}
}
}
function deadCheck() {
var _local3 = 0;
while (_local3 < enemy_obj.length) {
if (enemy_obj[_local3].type == Enemy.ROBOT) {
if (mc_hero1.nx.hitTest(enemy_obj[_local3].clip)) {
dead();
}
}
_local3++;
}
_local3 = 0;
while (_local3 < bullets_obj.length) {
if (mc_hero1.nx.hitTest(bullets_obj[_local3].clip)) {
dead();
}
_local3++;
}
_local3 = 0;
while (_local3 < tab_walls.length) {
if (mc_hero1.nx.hitTest(tab_walls[_local3].clip.n1)) {
wallDown();
dead();
}
var _local2 = 0;
while (_local2 < enemy_obj.length) {
if (enemy_obj[_local2].clip.hitTest(tab_walls[_local3].clip.n1)) {
enemy_obj[_local2].dead(_local2);
trash(enemy_obj[_local2].clip);
enemy_obj.splice(_local2, 1);
reload(_local2);
}
_local2++;
}
_local2 = 0;
while (_local2 < obj.length) {
if (obj[_local2].clip.hitTest(tab_walls[_local3].clip.n1) && (obj[_local2].canDestroy == true)) {
var _local1 = new Array();
_local1 = obj[_local2].getWsp(mc_map._x, mc_map._y);
_local1[1] = Math.floor(_local1[1]);
_local1[0] = Math.floor(_local1[0]);
map_obj[Math.floor(_local1[1])][Math.floor(_local1[0])].clip.gotoAndPlay("dead");
trash(map_obj[Math.floor(_local1[1])][Math.floor(_local1[0])].clip);
removeObjFromArray(map_obj[Math.floor(_local1[1])][Math.floor(_local1[0])], fall_obj);
removeObjFromArray(map_obj[Math.floor(_local1[1])][Math.floor(_local1[0])], obj);
delete map_obj[Math.floor(_local1[1])][Math.floor(_local1[0])];
map_obj[Math.floor(_local1[1])][Math.floor(_local1[0])] = 0;
}
_local2++;
}
_local3++;
}
_local3 = 0;
while (_local3 < rybki.length) {
if (mc_hero1.nx.hitTest(rybki[_local3].clip.mc_wpadka)) {
dead();
}
if (mc_hero1.nx.hitTest(rybki[_local3].clip.staw.mc_rybka.n1)) {
dead();
}
_local3++;
}
if (mc_hero1._y > (mc_map._y + mc_map._height)) {
dead();
}
}
function shoot(enemy) {
var pos = new Array();
pos = enemy.getWsp(mc_map._x, mc_map._y);
if (enemy.shooting) {
var i = bullets_obj.length;
var speed = (enemy.bulletSpeed || 10);
var range = 0;
duplicateMovieClip (enemy.bulletClip, "mc_bullet" + i, this.getNextHighestDepth());
var clip = eval ("mc_bullet" + i);
clip.cacheAsBitmap = true;
clip._xscale = enemy.dir * Math.abs(clip._xscale);
clip._x = enemy.clip._x + 15;
clip._y = enemy.clip._y + 10;
bullets_obj[i] = new Bullet(speed, enemy.dir, range, clip, pos[0], pos[1], mc_hit, sTR2);
playSound(enemy.shootSound);
switch (enemy.type) {
case Enemy.SENTINEL :
case Enemy.SENTINEL2 :
enemy.clip.gotoAndStop("atack");
break;
default :
enemy.clip.n1._xscale = enemy.dir * Math.abs(enemy.clip.n1._xscale);
}
bulletsID[bulletsID.length] = i;
enemy.isShooting = true;
}
if (enemy.type == 1) {
playSound(sPD);
enemy.childs++;
counter = tab_enemy.length;
duplicateMovieClip (mrd_soldier, "mrd_soldier" + counter, this.getNextHighestDepth());
tab_enemy[counter] = eval ("mrd_soldier" + counter);
tab_enemy[counter]._x = mc_map._x + (pos[0] * wid);
tab_enemy[counter]._y = mc_map._y + (pos[1] * wid);
tab_enemy[counter]._visible = true;
tab_enemy[counter].gotoAndStop("dir1");
counter2 = fall_obj.length;
fall_obj[counter2] = new Enemy(0, tab_enemy[counter], enemy_obj.length, bullet_mrd_soldier);
fall_obj[counter2].setWsp(pos[0], pos[1]);
fall_obj[counter2].setCont(cont);
counter3 = enemy_obj.length;
enemy_obj[counter3] = fall_obj[counter2];
enemy_obj[counter3].owner = enemy;
enx_obj[enemy_obj[counter3].id] = enemy_obj[counter3];
fall_obj[counter2].setHitClip(mc_poisonHit);
enemy_obj[enemy_obj.length - 1].deadSound = sSW;
enemy_obj[enemy_obj.length - 1].shootSound = sWP;
}
}
function bulletFly() {
var _local2 = 0;
while (_local2 < bulletsID.length) {
var _local3 = new Array();
var _local1 = bulletsID[_local2];
bullets_obj[_local1].clip._x = bullets_obj[_local1].clip._x + (bullets_obj[_local1].speed * bullets_obj[_local1].dir);
_local3 = bullets_obj[_local1].getWsp(mc_map._x, mc_map._y);
if (map_obj[Math.floor(_local3[1])][Math.floor(_local3[0])].przenik == false) {
destroyBullet(bullets_obj[_local1].hitClip, bullets_obj[_local1].clip, bullets_obj[_local1].deadSound);
removeMovieClip(bullets_obj[_local1].clip);
bulletsID.splice(_local2, 1);
}
if ((bullets_obj[_local1].clip._x < mc_map._x) || (bullets_obj[_local1].clip._x > (mc_map._x + mc_map._width))) {
destroyBullet(bullets_obj[_local1].hitClip, bullets_obj[_local1].clip, bullets_obj[_local1].deadSound);
removeMovieClip(bullets_obj[_local1].clip);
bulletsID.splice(_local2, 1);
}
if (mc_wave.hitTest(bullets_obj[_local1].clip) == true) {
destroyBullet(bullets_obj[_local1].hitClip, bullets_obj[_local1].clip, bullets_obj[_local1].deadSound);
removeMovieClip(bullets_obj[_local1].clip);
bulletsID.splice(_local2, 1);
}
_local2++;
}
}
function bulletFly2() {
var _local1 = 0;
while (_local1 < bullets_obj2.length) {
var _local2 = new Array();
bullets_obj2[_local1].clip._x = bullets_obj2[_local1].clip._x + (bullets_obj2[_local1].speed * bullets_obj2[_local1].dir);
_local2 = bullets_obj2[_local1].getWsp(mc_map._x, mc_map._y);
if (bullets_obj2[_local1].range && (Math.abs(bullets_obj2[_local1].clip._x - ((bullets_obj2[_local1].xpos * 31) + BOARD_LEFT)) > bullets_obj2[_local1].range)) {
removeMovieClip(bullets_obj2[_local1].clip);
bullets_obj2.splice(_local1, 1);
} else {
if (map_obj[Math.floor(_local2[1])][Math.floor(_local2[0])].przenik == false) {
destroyBullet(mc_hit, bullets_obj2[_local1].clip, bullets_obj2[_local1].deadSound);
removeMovieClip(bullets_obj2[_local1].clip);
bullets_obj2.splice(_local1, 1);
if (map_obj[Math.floor(_local2[1])][Math.floor(_local2[0])].canDestroy == true) {
playSound(map_obj[Math.floor(_local2[1])][Math.floor(_local2[0])].deadSound);
if (map_obj[Math.floor(_local2[1])][Math.floor(_local2[0])].type == 14) {
createBat(map_obj[Math.floor(_local2[1])][Math.floor(_local2[0])].clip._x, map_obj[Math.floor(_local2[1])][Math.floor(_local2[0])].clip._y);
}
map_obj[Math.floor(_local2[1])][Math.floor(_local2[0])].clip.gotoAndPlay("dead");
trash(map_obj[Math.floor(_local2[1])][Math.floor(_local2[0])].clip);
removeObjFromArray(map_obj[Math.floor(_local2[1])][Math.floor(_local2[0])], fall_obj);
removeObjFromArray(map_obj[Math.floor(_local2[1])][Math.floor(_local2[0])], obj);
delete map_obj[Math.floor(_local2[1])][Math.floor(_local2[0])];
map_obj[Math.floor(_local2[1])][Math.floor(_local2[0])] = 0;
}
}
if (((bullets_obj2[_local1].clip._x < mc_map._x) || (bullets_obj2[_local1].clip._x > ((mc_map._x + mc_map._width) - (mc_bullet._width / 2)))) || (bullets_obj2[_local1].clip._y < mc_map._y)) {
if (bullets_obj2[_local1].clip._y > mc_map._y) {
destroyBullet(mc_hit, bullets_obj2[_local1].clip, bullets_obj2[_local1].deadSound);
}
removeMovieClip(bullets_obj2[_local1].clip);
bullets_obj2.splice(_local1, 1);
}
var _local3 = 0;
while (_local3 < enemy_obj.length) {
if (bullets_obj2[_local1].clip.hitTest(enemy_obj[_local3].clip)) {
destroyBullet(mc_hit, bullets_obj2[_local1].clip, bullets_obj2[_local1].deadSound);
if (enemy_obj[_local3].hit(a1.power)) {
enemy_obj[_local3].dead(_local3);
trash(enemy_obj[_local3].clip);
enemy_obj.splice(_local3, 1);
}
reload(_local3);
removeMovieClip(bullets_obj2[_local1].clip);
bullets_obj2.splice(_local1, 1);
}
_local3++;
}
_local3 = 0;
while (_local3 < bulletsID.length) {
var _local4 = bulletsID[_local3];
if (bullets_obj2[_local1].clip.hitTest(bullets_obj[_local4].clip)) {
destroyBullet(mc_hit, bullets_obj2[_local1].clip, bullets_obj2[_local1].deadSound);
removeMovieClip(bullets_obj2[_local1].clip);
bullets_obj2.splice(_local1, 1);
removeMovieClip(bullets_obj[_local4].clip);
bulletsID.splice(_local3, 1);
}
_local3++;
}
}
_local1++;
}
}
function reload(id) {
enx_obj[id].isShooting = false;
clearInterval(IDshoot[id]);
}
function dead() {
stopAllAnimations();
playSound(sDeads[hero]);
mc_pop3.swapDepths(this.getNextHighestDepth());
mc_pop3._visible = true;
mc_pop3.gotoAndPlay(gameMode + "_loose");
mc_napis.swapDepths(this.getNextHighestDepth());
delete oef.onEnterFrame;
endGame = true;
heroFrame("dead");
}
function push(dir, ch_y, ch_x) {
xspeed = 0;
var _local1 = ((dir == "left") ? -1 : 1);
var _local6 = false;
var _local12 = new Array();
var _local7 = 0;
var _local13 = false;
do {
if (map_obj[ch_y][ch_x + (_local1 * _local7)].pushable == true) {
_local6 = false;
_local12.push(map_obj[ch_y][ch_x + (_local1 * _local7)]);
_local7++;
} else {
_local6 = true;
if (((map_obj[ch_y][ch_x + (_local1 * _local7)].przenik == false) || ((ch_x + (_local1 * _local7)) < 0)) || ((ch_x + (_local1 * _local7)) > 19)) {
_local13 = true;
}
}
} while (_local6 == false);
var _local10 = new Array(_local12.length);
var _local11 = 0;
while (_local11 < _local10.length) {
var _local9 = 0;
do {
if (map_obj[ch_y - _local9][ch_x + (_local1 * _local11)].pushable == true) {
_local6 = false;
_local9++;
} else {
_local6 = true;
}
} while (_local6 == false);
_local10[_local11] = _local9;
_local11++;
}
_local11 = 0;
while (_local11 < enemy_obj.length) {
var _local8 = new Array();
_local8 = enemy_obj[_local11].getWsp(mc_map._x, mc_map._y);
if (((_local8[0] % 1) != 0) && (dir == "left")) {
if ((ch_y == Math.floor(_local8[1])) && ((ch_x + (_local1 * _local7)) == (Math.floor(_local8[0]) + 1))) {
_local13 = true;
}
} else if ((ch_y == Math.floor(_local8[1])) && ((ch_x + (_local1 * _local7)) == Math.floor(_local8[0]))) {
_local13 = true;
}
_local11++;
}
if (_local13 == false) {
var _local15 = random(2);
if (_local15 == 0) {
playSound(sPB);
} else {
playSound(sPB2);
}
_local11 = 0;
while (_local11 < _local12.length) {
_local12[_local11].clip._x = _local12[_local11].clip._x + (_local1 * wid);
if (_local11 == 0) {
map_obj[ch_y][ch_x + (_local1 * _local11)] = 0;
}
map_obj[ch_y][ch_x + (_local1 * (_local11 + 1))] = _local12[_local11];
_local11++;
}
_local11 = 0;
while (_local11 < _local10.length) {
var _local5 = (_local10.length - 1) - _local11;
var _local4 = 1;
while (_local4 < _local10[_local5]) {
if (map_obj[ch_y - _local4][ch_x + (_local1 * (_local5 + 1))] == 0) {
map_obj[ch_y - _local4][ch_x + (_local1 * _local5)].clip._x = map_obj[ch_y - _local4][ch_x + (_local1 * _local5)].clip._x + (_local1 * wid);
map_obj[ch_y - _local4][ch_x + (_local1 * (_local5 + 1))] = map_obj[ch_y - _local4][ch_x + (_local1 * _local5)];
map_obj[ch_y - _local4][ch_x + (_local1 * _local5)] = 0;
} else {
break;
}
_local4++;
}
_local11++;
}
}
}
function falls_all() {
var _local1 = fall_obj.length - 1;
while (_local1 >= 0) {
var _local3 = new Array();
_local3 = fall_obj[_local1].getWsp(mc_map._x, mc_map._y);
var _local2 = Math.floor(_local3[0]);
var _local4 = Math.floor(_local3[1]);
if (fall_obj[_local1].t == "Enemy") {
_local2 = Math.round(_local3[0]);
}
fall(fall_obj[_local1]);
if (enemy_live == true) {
if (((map_obj[_local4 + 1][_local2].landing != true) || (map_obj[_local4 + 1][_local2].hiden == true)) && ((_local2 >= 0) || (fall_obj[_local1].t == "Square"))) {
fall_obj[_local1].ground = false;
} else {
fall_obj[_local1].ground = true;
}
}
_local1--;
}
}
function landing() {
var _local5 = new Array();
_local5 = a1.getOldPosition();
var _local1 = 0;
while (_local1 < obj.length) {
if (((((spadanie == false) || (obj[_local1].przenik == false)) && (obj[_local1].hiden == false)) && (obj[_local1].landing == true)) && (obj[_local1].type != 7)) {
if ((((((obj[_local1].clip._y - mc_hero1._y) < (5 + wid)) && (Math.abs(obj[_local1].clip._x - mc_hero1._x) < 25)) && (_local5[1] <= (obj[_local1].clip._y - wid))) && (yspeed > 0)) && ((obj[_local1].clip._y - mc_hero1._y) > 0)) {
if (obj[_local1].type == 13) {
dead();
}
mc_hero1._y = obj[_local1].clip._y - wid;
yspeed = 0;
a1.ground = true;
if (lastHFrame == "air_atack") {
if (a1.atackType == "shoot") {
xspeed = 0;
}
}
heroFrame("land");
var _local4 = new Array(2);
_local4 = a1.getWsp(mc_map._x, mc_map._y);
var _local3 = Math.floor(_local4[0]);
var _local2 = Math.floor(_local4[1] + 1);
if ((map_obj[_local2][_local3].notStable == true) && (map_obj[_local2][_local3].znikanie == false)) {
if ((_local4[0] % 1) == 0) {
hideObject(map_obj[_local2][_local3]);
} else {
hideObject(map_obj[_local2][_local3]);
if ((map_obj[_local2][_local3 + 1].notStable == true) && (map_obj[_local2][_local3 + 1].znikanie == false)) {
hideObject(map_obj[_local2][_local3 + 1]);
}
}
}
if ((map_obj[_local2][_local3 + 1].notStable == true) && (map_obj[_local2][_local3 + 1].znikanie == false)) {
if ((_local4[0] % 1) != 0) {
hideObject(map_obj[_local2][_local3 + 1]);
}
}
jumpsLeft = a1.getNJump();
break;
}
}
_local1++;
}
}
function hitWall() {
var _local8 = hei;
var _local10 = new Array();
_local10 = a1.getWsp(mc_map._x, mc_map._y);
var _local2 = map_obj.length - 1;
while (_local2 >= 0) {
var _local1 = Math.floor(_local10[0] - 1);
while (_local1 < Math.floor(_local10[0] + 2)) {
if ((map_obj[_local2][_local1].type == 13) || (map_obj[_local2][_local1].type == 7)) {
if (((mc_hero1._y >= (map_obj[_local2][_local1].clip._y - 25)) && (Math.abs(map_obj[_local2][_local1].clip._x - mc_hero1._x) < wid)) && (mc_hero1._y < (map_obj[_local2][_local1].clip._y + _local8))) {
if ((map_obj[_local2][_local1].deadly == true) && (Math.abs(map_obj[_local2][_local1].clip._x - mc_hero1._x) < (wid - 15))) {
dead();
break;
}
}
}
if ((((map_obj[_local2][_local1].przenik == false) && (map_obj[_local2][_local1].type != 13)) && (map_obj[_local2][_local1].type != 7)) && (map_obj[_local2][_local1].ground != false)) {
if (((mc_hero1._y >= (map_obj[_local2][_local1].clip._y - 25)) && (Math.abs(map_obj[_local2][_local1].clip._x - mc_hero1._x) < wid)) && (mc_hero1._y < (map_obj[_local2][_local1].clip._y + _local8))) {
var _local6 = (mc_hero1._x - map_obj[_local2][_local1].clip._x) - wid;
var _local7 = (map_obj[_local2][_local1].clip._x - mc_hero1._x) - wid;
var _local5 = (mc_hero1._y - map_obj[_local2][_local1].clip._y) - _local8;
var _local3 = new Array();
_local3 = map_obj[_local2][_local1].getWsp(mc_map._x, mc_map._y);
if (((Math.abs(_local5) < Math.abs(_local6)) && (Math.abs(_local5) < Math.abs(_local7))) && (_local5 < 0)) {
if ((map_obj[Math.floor(_local3[1] + 1)][Math.floor(_local3[0])].przenik == true) || (map_obj[Math.floor(_local3[1] + 1)][Math.floor(_local3[0])] == 0)) {
if (a1.ground == false) {
yspeed = 0;
mc_hero1._y = map_obj[Math.floor(_local3[1])][Math.floor(_local3[0])].clip._y + _local8;
break;
}
}
}
if (_local7 > _local6) {
mc_hero1._x = map_obj[_local2][_local1].clip._x - wid;
var _local4 = new Array();
_local4 = a1.getWsp(mc_map._x, mc_map._y);
if (xdir == 1) {
if ((((((a1.canClimb == true) && (a1.ground == false)) && (mc_hero1._y > (map_obj[_local2][_local1].clip._y - 15))) && (mc_hero1._y < (map_obj[_local2][_local1].clip._y + 15))) && (a1.canGrab == true)) && (lastHFrame != "air_atack")) {
yspeed = 0;
a1.isClimbing = true;
heroFrame("climb");
mc_hero1._y = map_obj[_local2][_local1].clip._y;
}
}
if ((a1.ground == true) && (map_obj[Math.floor(_local4[1])][Math.floor(_local4[0]) + 1].pushable == true)) {
if (Key.isDown(39)) {
kRightTime++;
}
if (kRightTime > 5) {
kRightTime = 0;
xspeed = 0;
push("right", Math.floor(_local4[1]), Math.floor(_local4[0]) + 1);
}
}
break;
}
if (_local7 <= _local6) {
var _local9 = prawaSciana(_local3[0], _local3[1]);
if (xdir == -1) {
if ((((((a1.canClimb == true) && (a1.ground == false)) && (mc_hero1._y > (map_obj[_local2][_local1].clip._y - 15))) && (mc_hero1._y < (map_obj[_local2][_local1].clip._y + 15))) && (a1.canGrab == true)) && (lastHFrame != "air_atack")) {
yspeed = 0;
a1.isClimbing = true;
heroFrame("climb");
mc_hero1._y = map_obj[_local2][_local1].clip._y;
}
}
if (_local9 == false) {
mc_hero1._x = map_obj[_local2][_local1].clip._x + wid;
var _local4 = new Array();
_local4 = a1.getWsp(mc_map._x, mc_map._y);
if ((a1.ground == true) && (map_obj[Math.floor(_local4[1])][Math.floor(_local4[0]) - 1].pushable == true)) {
if (Key.isDown(37)) {
kLeftTime++;
}
if (kLeftTime > 5) {
kLeftTime = 0;
xspeed = 0;
push("left", Math.floor(_local4[1]), Math.floor(_local4[0]) - 1);
}
}
break;
}
yspeed = 0;
mc_hero1._y = map_obj[_local2][_local1].clip._y + hei;
break;
}
}
}
_local1++;
}
_local2--;
}
}
function checkKeys() {
if ((Key.isDown(80) && (Key.isDown(82))) && (Key.isDown(69))) {
tfperf._visible = true;
btn_copy._visible = true;
}
if (Key.isDown(16)) {
trace(map_obj[11][4]);
}
if (!Key.isDown(32)) {
reloadSpace = true;
}
if (Key.isDown(32)) {
trace((((("canShoot:" + a1.canShoot) + ", attacking:") + attacking) + ", reloadSpace:") + reloadSpace);
if ((a1.canShoot && (attacking)) && (reloadSpace)) {
attacking = false;
}
if (rolling == true) {
var _local3 = new Array(2);
_local3 = a1.getWsp(mc_map._x, mc_map._y);
var _local2 = Math.floor(_local3[0]);
var _local1 = Math.floor(_local3[1] + 1);
if ((rolling == true) && ((map_obj[_local1 - 2][_local2].przenik == true) || (map_obj[_local1 - 2][_local2] == 0))) {
rolling = false;
}
}
if ((a1.isClimbing == false) && (a1.onLiane == false)) {
if ((((rolling == false) && (a1.canShoot == true)) && (attacking == false)) && ((reloadSpace == true) || (a1.atackType != "wave"))) {
if (a1.atackType == "shoot") {
playSound(sR1);
} else if (a1.atackType == "sword") {
} else if (a1.atackType == "wave") {
if (a1.ground == true) {
xspeed = 0;
}
}
clip._xscale = 100 * a1.getDir();
a1.canShoot = false;
clearInterval(IDa1CanShoot);
IDa1CanShoot = setInterval(a1canShoot, a1.attackSpeed);
reloadSpace = false;
if ((a1.ground == true) || (a1.atackType == "teleport")) {
heroFrame("atack");
} else {
heroFrame("air_atack");
}
}
} else {
playSound(sSkM);
jumpsLeft--;
canUp = false;
mc_hero1._y = mc_hero1._y - 1;
yspeed = -a1.getJump();
a1.canGrab = false;
a1.isClimbing = false;
a1.onLiane = false;
a1.canShoot = false;
clearInterval(IDa1CanShoot);
IDa1CanShoot = setInterval(a1canShoot, a1.attackSpeed);
clearInterval(IDa1CanClimb);
IDa1CanClimb = setInterval(a1canClimb, 500);
}
}
if (Key.isDown(37)) {
if (((!a1.isClimbing) && (!a1.onLiane)) && (!attacking)) {
xdir = -1;
mc_hero1.n1._xscale = 100 * (-a1.__get__initialDirection());
if (a1.ground == true) {
heroFrame("run");
if ((!canRun) && (rolling)) {
mc_hero1.n1.gotoAndStop("roll");
framePointer(1, mc_hero1.n1.n1);
}
}
}
}
if (Key.isDown(39)) {
if ((!a1.isClimbing) && (!a1.onLiane)) {
xdir = 1;
mc_hero1.n1._xscale = 100 * a1.__get__initialDirection();
if (a1.ground == true) {
heroFrame("run");
if ((!canRun) && (rolling)) {
mc_hero1.n1.gotoAndStop("roll");
framePointer(1, mc_hero1.n1.n1);
}
}
}
}
if (Key.isDown(38)) {
var _local3 = new Array(2);
_local3 = a1.getWsp(mc_map._x, mc_map._y);
var _local2 = Math.floor(_local3[0]);
var _local1 = Math.floor(_local3[1] + 1);
kLeftTime = 0;
kRightTime = 0;
if (((rolling == false) && (a1.isClimbing == false)) && (a1.onLiane == false)) {
if (a1.ground == true) {
if ((_local3[0] % 1) == 0) {
if (map_obj[_local1][_local2].jumpFrom == false) {
canUp = false;
} else {
canUp = true;
jumpsLeft = a1.getNJump();
}
} else if ((map_obj[_local1][_local2].jumpFrom == false) || (map_obj[_local1][_local2 + 1].jumpFrom == false)) {
canUp = false;
} else {
canUp = true;
jumpsLeft = a1.getNJump();
}
}
if (((canUp == true) && (jumpsLeft > 0)) || (((canUp == true) && (a1.ground == true)) && (attacking == false))) {
if (a1.ground == false) {
jumpsLeft--;
}
playSound(sJumps[hero]);
canUp = false;
mc_hero1._y = mc_hero1._y - 1;
yspeed = -a1.getJump();
heroFrame("jump");
}
} else {
climbUp();
}
if ((rolling == true) && ((map_obj[_local1 - 2][_local2].przenik == true) || (map_obj[_local1 - 2][_local2] == 0))) {
rolling = false;
}
}
if (!Key.isDown(38)) {
if (jumpsLeft > 0) {
canUp = true;
}
}
if (Key.isDown(40)) {
if ((a1.ground == true) && (downWasUp == true)) {
spadanie = true;
downWasUp = false;
}
if ((a1.isClimbing == true) || (a1.onLiane == true)) {
climbDown();
}
if (((((spadanie == true) && (a1.ground == true)) && (a1.special == "roll")) && (!Key.isDown(37))) && (!Key.isDown(39))) {
heroFrame("roll");
}
}
if (!Key.isDown(37)) {
kLeftTime = 0;
if ((mc_hero1.n1.running && (lastHFrame == "run")) && (xdir == LEFT)) {
lastHFrame = "run end";
mc_hero1.n1.running.gotoAndPlay("run end");
}
}
if (!Key.isDown(39)) {
kRightTime = 0;
if ((mc_hero1.n1.running && (lastHFrame == "run")) && (xdir == RIGHT)) {
lastHFrame = "run end";
mc_hero1.n1.running.gotoAndPlay("run end");
}
}
if ((!Key.isDown(37)) && (!Key.isDown(39))) {
if ((a1.isClimbing == false) && (a1.onLiane == false)) {
xdir = 0;
}
if ((canRun == false) && (rolling == true)) {
mc_hero1.n1.gotoAndStop("crouch");
mc_hero1.n1.n1.gotoAndStop(3);
rolling = true;
xspeed = 0;
}
}
if (!Key.isDown(40)) {
downWasUp = true;
spadanie = false;
}
}
function enemy_moves() {
var _local1 = 0;
while (_local1 < enemy_obj.length) {
if (enemy_obj[_local1].hitAnimation) {
return(undefined);
}
if (enemy_obj[_local1].type == 5) {
batsFly(enemy_obj[_local1]);
}
if (((enemy_obj[_local1].type == 1) && (enemy_obj[_local1].isShooting == false)) && (enemy_obj[_local1].childs < enemy_obj[_local1].maxChilds)) {
clearInterval(IDshoot[enemy_obj[_local1].id]);
enemy_obj[_local1].isShooting = true;
shoot(enemy_obj[_local1]);
enemy_obj[_local1].clip.gotoAndStop("jump");
enemy_obj[_local1].clip.n1.gotoAndPlay(1);
if (enemy_obj[_local1].childs < enemy_obj[_local1].maxChilds) {
IDshoot[enemy_obj[_local1].id] = setInterval(reload, 5000, enemy_obj[_local1].id);
}
}
if (enemy_obj[_local1].ysp > 0) {
var _local2 = new Array();
_local2 = enemy_obj[_local1].getWsp(mc_map._x, mc_map._y);
_local2[0] = Math.floor(_local2[0]);
_local2[1] = Math.round(_local2[1]);
if ((map1[_local2[1] + enemy_obj[_local1].ydir][_local2[0]] != "7") && (map1[_local2[1] + enemy_obj[_local1].ydir][_local2[0]] != "7a")) {
enemy_obj[_local1].ydif++;
if (enemy_obj[_local1].ydif == 10) {
enemy_obj[_local1].ydir = enemy_obj[_local1].ydir * -1;
enemy_obj[_local1].ydif = 0;
}
}
enemy_obj[_local1].clip._y = enemy_obj[_local1].clip._y + (enemy_obj[_local1].ysp * enemy_obj[_local1].ydir);
}
if ((!enemy_obj[_local1].isShooting) && (enemy_obj[_local1].ground)) {
var _local2 = new Array();
_local2 = a1.getWsp(mc_map._x, mc_map._y);
var _local3 = new Array();
_local3 = enemy_obj[_local1].getWsp(mc_map._x, mc_map._y);
if ((Math.abs(Math.floor(_local2[1]) - Math.floor(_local3[1])) < 2) && (enemy_obj[_local1].mainEnemy)) {
if (((_local2[0] > _local3[0]) && (enemy_obj[_local1].dir == 1)) || ((_local2[0] < _local3[0]) && (enemy_obj[_local1].dir == -1))) {
if ((_local3[0] % 1) == 0) {
enemy_obj[_local1].isShooting = true;
switch (enemy_obj[_local1].type) {
case 0 :
case Enemy.GAMBIT :
case Enemy.MAGNETO :
enemy_obj[_local1].clip.gotoAndStop("atack");
break;
case Enemy.HULK :
trace((("hulk: atakuj " + mc_hero1._x) + ", ") + enemy_obj[_local1].clip._x);
if (Math.abs(mc_hero1._x - enemy_obj[_local1].clip._x) < 75) {
enemy_obj[_local1].clip.gotoAndStop("atack");
trace("hulk: atakuje!");
} else {
enemy_obj[_local1].isShooting = false;
}
break;
default :
clearInterval(IDshoot[enemy_obj[_local1].id]);
IDshoot[enemy_obj[_local1].id] = setInterval(reload, 2000, enemy_obj[_local1].id);
shoot(enemy_obj[_local1]);
}
}
}
}
}
if ((((enemy_obj[_local1].type == 2) || (enemy_obj[_local1].type == 22)) && (enemy_obj[_local1].isShooting == false)) && (enemy_obj[_local1].ground == true)) {
var _local2 = new Array();
_local2 = a1.getWsp(mc_map._x, mc_map._y);
var _local3 = new Array();
_local3 = enemy_obj[_local1].getWsp(mc_map._x, mc_map._y);
if (((_local2[0] > _local3[0]) && (enemy_obj[_local1].dir == 1)) || ((_local2[0] < _local3[0]) && (enemy_obj[_local1].dir == -1))) {
if ((Math.abs(Math.floor(_local2[1]) - Math.floor(_local3[1])) < 2) && (enemy_obj[_local1].shooting == true)) {
if (_local2[0] > _local3[0]) {
enemy_obj[_local1].dir = 1;
}
if (_local2[0] < _local3[0]) {
enemy_obj[_local1].dir = -1;
}
clearInterval(IDshoot[enemy_obj[_local1].id]);
IDshoot[enemy_obj[_local1].id] = setInterval(reload, 2000, enemy_obj[_local1].id);
shoot(enemy_obj[_local1]);
}
}
}
if (((enemy_obj[_local1].walking == true) && (enemy_obj[_local1].ground == true)) && (enemy_obj[_local1].isShooting == false)) {
walk(enemy_obj[_local1]);
enemy_obj[_local1].clip.gotoAndStop("walk");
enemy_obj[_local1].clip.n1._xscale = enemy_obj[_local1].dir * Math.abs(enemy_obj[_local1].clip.n1._xscale);
}
if (enemy_obj[_local1].isShooting == true) {
}
_local1++;
}
}
function enemyAttack(enemy) {
trace("enemyAttack");
if (Math.abs(mc_hero1._x - enemy.clip._x) < 75) {
if (Math.abs(mc_hero1._y - enemy.clip._y) < 10) {
trace("enemyAttack: dead");
dead();
}
}
}
function checkCollect() {
var _local1 = 0;
while (_local1 < tab_col.length) {
if (mc_hero1.nx.hitTest(tab_col[_local1].n1)) {
var _local2 = new Array(2);
_local2[0] = Math.floor((tab_col[_local1]._x - mc_map._x) / 31);
_local2[1] = Math.floor((tab_col[_local1]._y - mc_map._y) / 31);
playSound(map_col[_local2[1]][_local2[0]].colSound);
tab_col[_local1].play();
tab_col.splice(_local1, 1);
}
_local1++;
}
}
function a1canShoot() {
clearInterval(IDa1CanShoot);
a1.canShoot = true;
}
function checkEnemyLand(enemy) {
enemy.setOldPosition(enemy.clip._x, enemy.clip._y);
enemy.yspeed = enemy.yspeed + gravity;
enemy_live = true;
if ((enemy.t == "Square") && (((enemy.type == 14) || (enemy.type == 5)) || (enemy.type == 6))) {
if (enemy.ground == true) {
if (((enemy.type == 5) || (enemy.type == 6)) && ((enemy.clip._y - enemy.fallFrom) >= wid)) {
playSound(sUB);
}
if (((enemy.clip._y - enemy.fallFrom) >= (wid * 3)) && (enemy.type == 14)) {
enemy_live = false;
var _local2 = new Array();
_local2 = enemy.getWsp(mc_map._x, mc_map._y);
_local2[0] = Math.floor(_local2[0]);
_local2[1] = Math.floor(_local2[1]);
destroyChest(enemy);
}
if (((enemy.clip._y - enemy.fallFrom) >= (wid * 3)) && (((enemy.type == 5) || (enemy.type == 6)) || (enemy.type == 14))) {
var _local2 = new Array();
_local2 = enemy.getWsp(mc_map._x, mc_map._y);
_local2[0] = Math.floor(_local2[0]);
_local2[1] = Math.floor(_local2[1]);
if ((map_obj[_local2[1] + 1][_local2[0]].type == 14) && (map_obj[_local2[1] + 1][_local2[0]].t == "Square")) {
destroyChest(map_obj[_local2[1] + 1][_local2[0]]);
}
}
enemy.fallFrom = enemy.clip._y;
}
}
if (enemy_live == true) {
var _local5 = new Array();
_local5 = enemy.getNewWsp(mc_map._x, mc_map._y, enemy.clip._x, enemy.clip._y + enemy.yspeed);
var _local3 = Math.floor(_local5[0]);
var _local4 = Math.floor(_local5[1] + 1);
if (enemy.t == "Enemy") {
_local3 = Math.round(_local5[0]);
}
if (((map_obj[_local4][_local3] != enemy) && (map_obj[_local4][_local3].landing == true)) && (map_obj[_local4][_local3].hiden == false)) {
if (enemy.t == "Square") {
enemy.ground = true;
}
if (((enemy.t == "Enemy") && (map_obj[_local4][_local3].przenik == true)) && (enemy.ground == true)) {
} else {
enemy.clip._y = map_obj[_local4][_local3].clip._y - wid;
}
enemy.ground = true;
enemy.yspeed = 0;
if ((enemy.t == "Square") && (enemy.ground == true)) {
map_obj[_local4 - 1][_local3] = enemy;
}
} else if (enemy.ground == false) {
enemy.clip._y = enemy.clip._y + enemy.yspeed;
}
}
}
function checkGate() {
switch (objective) {
case "o1" :
if (mc_exit1.n2._currentframe == 1) {
mc_exit1.n2.gotoAndPlay(2);
}
if (mc_hero1.nx.hitTest(mc_exit1.n1)) {
youWin();
}
break;
case "o2" :
if (tab_col.length == 0) {
if (mc_exit1.n2._currentframe == 1) {
mc_exit1.n2.gotoAndPlay(2);
}
if (mc_hero1.nx.hitTest(mc_exit1.n1)) {
youWin();
}
}
break;
case "o3" :
var _local2 = 0;
var _local1 = 0;
while (_local1 < enemy_obj.length) {
if (enemy_obj[_local1].canDestroy == false) {
_local2++;
}
_local1++;
}
if (((enemy_obj.length == 0) || (_local2 == enemy_obj.length)) && (cages_number <= 0)) {
if (mc_exit1.n2._currentframe == 1) {
mc_exit1.n2.gotoAndPlay(2);
}
if (mc_hero1.nx.hitTest(mc_exit1.n1)) {
youWin();
}
}
break;
case "o4" :
_local2 = 0;
_local1 = 0;
while (_local1 < enemy_obj.length) {
if (enemy_obj[_local1].canDestroy == false) {
_local2++;
}
_local1++;
}
if (!((((enemy_obj.length == 0) || (_local2 == enemy_obj.length)) && (tab_col.length == 0)) && (cages_number <= 0))) {
break;
}
if (mc_exit1.n2._currentframe == 1) {
mc_exit1.n2.gotoAndPlay(2);
}
if (!mc_hero1.nx.hitTest(mc_exit1.n1)) {
break;
}
youWin();
}
}
function youWin() {
mc_pop3.swapDepths(this.getNextHighestDepth());
mc_pop3._visible = true;
mc_pop3.gotoAndPlay(gameMode + "_win");
stopAllAnimations();
endGame = true;
heroFrame("win");
mc_napis.swapDepths(this.getNextHighestDepth());
delete oef.onEnterFrame;
b7.enabled = true;
}
function stopID(_id) {
clearInterval(IDshoot[_id]);
}
function startID(_id) {
IDshoot[enx_obj[_id].id] = setInterval(reload, 5000, enx_obj[_id].id);
}
function climbUp() {
if (a1.isClimbing == true) {
var _local1 = new Array();
_local1 = a1.getWsp(mc_map._x, mc_map._y);
switch (xdir) {
case 1 :
if (map_obj[Math.floor(_local1[1])][Math.floor(_local1[0]) + 1].przenik == false) {
mc_hero1._y = mc_hero1._y - 2;
framePointer(1, mc_hero1.n1.n1);
}
break;
case -1 :
if (map_obj[Math.floor(_local1[1])][Math.floor(_local1[0]) - 1].przenik != false) {
break;
}
mc_hero1._y = mc_hero1._y - 2;
framePointer(1, mc_hero1.n1.n1);
}
}
if (a1.onLiane == true) {
var _local1 = new Array();
_local1 = a1.getWsp(mc_map._x, mc_map._y);
mc_hero1._y = mc_hero1._y - 2;
framePointer(1, mc_hero1.n1.n1);
if (((map_obj[Math.floor(_local1[1] + 1)][Math.floor(_local1[0])] == 0) || ((map_obj[Math.floor(_local1[1] + 1)][Math.floor(_local1[0])].przenik == true) && (map_obj[Math.floor(_local1[1] + 1)][Math.floor(_local1[0])].liana == false))) && (map_obj[Math.floor(_local1[1])][Math.floor(_local1[0])].liana != true)) {
a1.isClimbing = false;
a1.onLiane = false;
a1.canGrab = true;
}
}
}
function climbDown() {
if (a1.isClimbing == true) {
var _local1 = new Array();
_local1 = a1.getWsp(mc_map._x, mc_map._y);
if (map_obj[Math.floor(_local1[1] + 1)][Math.floor(_local1[0])] == 0) {
switch (xdir) {
case 1 :
if (map_obj[Math.floor(_local1[1]) + 1][Math.floor(_local1[0]) + 1].przenik == false) {
mc_hero1._y = mc_hero1._y + 2;
framePointer(-1, mc_hero1.n1.n1);
} else {
a1.isClimbing = false;
}
break;
case -1 :
if (map_obj[Math.floor(_local1[1] + 1)][Math.floor(_local1[0]) - 1].przenik == false) {
mc_hero1._y = mc_hero1._y + 2;
framePointer(-1, mc_hero1.n1.n1);
} else {
a1.isClimbing = false;
}
}
} else {
mc_hero1._y = (map_obj[Math.floor(_local1[1] + 1)][Math.floor(_local1[0])].clip._y - wid) - 2;
a1.isClimbing = false;
a1.ground = true;
heroFrame("land");
}
}
if (a1.onLiane == true) {
var _local1 = new Array();
_local1 = a1.getWsp(mc_map._x, mc_map._y);
mc_hero1._y = mc_hero1._y + 2;
framePointer(-1, mc_hero1.n1.n1);
var _local3 = map_obj[Math.floor(_local1[1])][Math.floor(_local1[0])];
var _local2 = map_obj[Math.floor(_local1[1] + 1)][Math.floor(_local1[0])];
if ((map_obj[Math.floor(_local1[1] + 1)][Math.floor(_local1[0])] == 0) || (map_obj[Math.floor(_local1[1] + 2)][Math.floor(_local1[0])].landing == true)) {
a1.isClimbing = false;
a1.onLiane = false;
a1.canGrab = true;
}
}
}
function clean() {
var _local2 = 0;
while (_local2 < map1.length) {
var _local1 = 0;
while (_local1 < map1[_local2].length) {
removeMovieClip(map_col[_local2][_local1].clip);
_local1++;
}
_local2++;
}
removeMovieClip(mc_hand);
mc_map._alpha = 0;
_local2 = 0;
while (_local2 < IDshoot.length) {
clearInterval(IDshoot[_local2]);
_local2++;
}
_local2 = 0;
while (_local2 < tab_masks.length) {
removeMovieClip(tab_masks[_local2]);
_local2++;
}
_local2 = 0;
while (_local2 < tab_hits.length) {
removeMovieClip(tab_hits[_local2]);
_local2++;
}
_local2 = 0;
while (_local2 < ID.length) {
clearInterval(ID[_local2]);
_local2++;
}
_local2 = 0;
while (_local2 < ID2.length) {
clearInterval(ID2[_local2]);
_local2++;
}
_local2 = 0;
while (_local2 < bullets_obj.length) {
removeMovieClip(bullets_obj[_local2].clip);
delete bullets_obj[_local2];
_local2++;
}
_local2 = 0;
while (_local2 < liany_obj.length) {
removeMovieClip(liany[_local2]);
delete liany_obj[_local2];
_local2++;
}
_local2 = 0;
while (_local2 < obj.length) {
removeMovieClip(obj[_local2].clip);
delete obj[_local2];
_local2++;
}
_local2 = 0;
while (_local2 < fall_obj.length) {
removeMovieClip(fall_obj[_local2].clip);
delete fall_obj[_local2];
_local2++;
}
_local2 = 0;
while (_local2 < enemy_obj.length) {
removeMovieClip(enemy_obj[_local2].clip);
delete enemy_obj[_local2];
_local2++;
}
_local2 = 0;
while (_local2 < rocks.length) {
removeMovieClip(rocks[_local2]);
_local2++;
}
_local2 = 0;
while (_local2 < tab_col.length) {
removeMovieClip(tab_col[_local2]);
_local2++;
}
_local2 = 0;
while (_local2 < bullets_obj2.length) {
removeMovieClip(bullets_obj2[_local2].clip);
delete bullets_obj2[_local2];
_local2++;
}
_local2 = 0;
while (_local2 < t_trash.length) {
removeMovieClip(t_trash[_local2]);
_local2++;
}
removeMovieClip(mc_pop3);
removeMovieClip(mc_pop_help);
clearInterval(IDa1CanShoot);
removeMovieClip(mc_brief);
removeMovieClip(mc_exit1);
removeMovieClip(mc_mask);
removeMovieClip(mc_hero1);
removeMovieClip(mc_napis);
removeMovieClip(mc_timer);
delete oef.onEnterFrame;
delete tab_col;
delete bulletsID;
}
function fLiany() {
if (((a1.canClimb == true) && (a1.ground == false)) && (a1.canGrab == true)) {
var _local1 = 0;
while (_local1 < liany.length) {
if (liany[_local1].n1.hitTest(mc_hero1.nx)) {
a1.onLiane = true;
heroFrame("climb_liane");
a1.canGrab = false;
mc_hero1._x = liany[_local1]._x;
break;
}
_local1++;
}
}
}
function a1canClimb() {
clearInterval(IDa1CanClimb);
a1.canGrab = true;
}
function batsFly(enemy) {
var _local3 = enemy.xspeed;
var _local1 = new Array();
switch (enemy.xyDir) {
case 0 :
enemy.clip._y = enemy.clip._y - _local3;
_local1 = enemy.getWsp(mc_map._x, mc_map._y);
_local1[0] = Math.floor(_local1[0]);
_local1[1] = Math.floor(_local1[1]);
if (map_obj[_local1[1]][_local1[0]].przenik == false) {
enemy.clip._y = map_obj[_local1[1]][_local1[0]].clip._y + wid;
enemy.dirPlus();
}
break;
case 1 :
enemy.clip._x = enemy.clip._x + _local3;
_local1 = enemy.getWsp(mc_map._x, mc_map._y);
_local1[0] = Math.floor(_local1[0]);
_local1[1] = Math.floor(_local1[1]);
if (map_obj[_local1[1]][_local1[0] + 1].przenik == false) {
enemy.clip._x = map_obj[_local1[1]][_local1[0]].clip._x;
enemy.dirPlus();
}
break;
case 2 :
enemy.clip._y = enemy.clip._y + _local3;
_local1 = enemy.getWsp(mc_map._x, mc_map._y);
_local1[0] = Math.floor(_local1[0]);
_local1[1] = Math.floor(_local1[1]);
if (map_obj[_local1[1] + 1][_local1[0]].przenik == false) {
enemy.clip._y = map_obj[_local1[1]][_local1[0]].clip._y;
enemy.dirPlus();
}
break;
case 3 :
enemy.clip._x = enemy.clip._x - _local3;
_local1 = enemy.getWsp(mc_map._x, mc_map._y);
_local1[0] = Math.floor(_local1[0]);
_local1[1] = Math.floor(_local1[1]);
if (map_obj[_local1[1]][_local1[0]].przenik != false) {
break;
}
enemy.clip._x = map_obj[_local1[1]][_local1[0]].clip._x + wid;
enemy.dirPlus();
}
if (enemy.clip._x < mc_map._x) {
enemy.clip._x = mc_map._x;
enemy.dirPlus();
}
if (enemy.clip._x > ((mc_map._x + mc_map._width) - wid)) {
enemy.clip._x = (mc_map._x + mc_map._width) - wid;
enemy.dirPlus();
}
if (enemy.clip._y < mc_map._y) {
enemy.clip._y = mc_map._y;
enemy.dirPlus();
}
if (enemy.clip._y > ((mc_map._y + mc_map._height) - wid)) {
enemy.clip._y = (mc_map._y + mc_map._height) - wid;
enemy.dirPlus();
}
}
function createBat(myx, myy) {
var counter = tab_enemy.length;
duplicateMovieClip (mc_bat, "mc_bat" + counter, this.getNextHighestDepth());
tab_enemy[counter] = eval ("mc_bat" + counter);
tab_enemy[counter]._x = myx;
tab_enemy[counter]._y = myy;
tab_enemy[counter]._visible = true;
tab_enemy[counter].gotoAndStop("dir1");
enemy_obj[enemy_obj.length] = new Enemy(5, tab_enemy[counter], enemy_obj.length, null);
enemy_obj[enemy_obj.length - 1].setCont(cont);
enemy_obj[enemy_obj.length - 1].deadSound = sWN;
cages_number--;
}
function removeObjFromArray(myObj, myArr) {
var _local1 = 0;
while (_local1 < myArr.length) {
if (myArr[_local1] == myObj) {
myArr.splice(_local1, 1);
break;
}
_local1++;
}
}
function trash(myClip) {
t_trash[t_trash.length] = myClip;
}
function dodaj_maske(clip1) {
mc_mask_big.duplicateMovieClip("mc_mask" + tab_masks.length, this.getNextHighestDepth());
tab_masks.push(eval ("mc_mask" + tab_masks.length));
clip1.setMask(tab_masks[tab_masks.length - 1]);
}
function heroFrame(myFrame) {
if (lastHFrame == "atack") {
xspeed = 0;
}
if (myFrame == "jump") {
canRun = false;
frameToStay = 1;
mc_hero1.nx.gotoAndStop(1);
}
if (((((((canRun == false) && ((myFrame != "no_move") && (myFrame != "run"))) && (myFrame != "land")) && (attacking == false)) && (a1.isClimbing == false)) && (a1.onLiane == false)) && (endGame == false)) {
mc_hero1.n1.gotoAndStop(myFrame);
rolling = false;
hei = hei0;
lastHFrame = myFrame;
}
if (((((((canRun == true) && ((myFrame == "no_move") || (myFrame == "run"))) && (myFrame != "land")) && (attacking == false)) && (a1.isClimbing == false)) && (a1.onLiane == false)) && (endGame == false)) {
if (myFrame == "no_move") {
mc_hero1.n1.gotoAndStop(myFrame + frameToStay);
mc_hero1.nx.gotoAndStop(1);
} else {
if (lastHFrame != "run") {
soundInfinity(sWalks[hero]);
}
mc_hero1.nx.gotoAndStop(1);
mc_hero1.n1.gotoAndStop(myFrame);
frameToStay = 1;
}
rolling = false;
hei = hei0;
lastHFrame = myFrame;
}
if (((((myFrame == "land") && (canRun == false)) && (attacking == false)) && (rolling == false)) && (endGame == false)) {
mc_hero1.n1.gotoAndStop(myFrame);
lastHFrame = myFrame;
}
if ((myFrame == "atack") && (attacking == false)) {
xspeed = 0;
attacking = true;
canRun = false;
mc_hero1.n1.gotoAndStop(myFrame);
rolling = false;
hei = hei0;
lastHFrame = myFrame;
}
if ((myFrame == "air_atack") && (attacking == false)) {
attacking = true;
canRun = false;
mc_hero1.n1.gotoAndStop(myFrame);
rolling = false;
hei = hei0;
lastHFrame = myFrame;
}
if (((myFrame == "climb") && (attacking == false)) || (myFrame == "climb_liane")) {
attacking = false;
canRun = false;
mc_hero1.n1.gotoAndStop(myFrame);
lastHFrame = myFrame;
}
if ((myFrame == "roll") && (attacking == false)) {
mc_hero1.nx.gotoAndStop(2);
hei = 30;
rolling = true;
attacking = false;
canRun = false;
mc_hero1.n1.gotoAndStop("land");
lastHFrame = myFrame;
}
if (myFrame == "win") {
attacking = false;
canRun = false;
rolling = false;
mc_hero1.n1.gotoAndStop("win");
lastHFrame = myFrame;
}
if (myFrame == "dead") {
attacking = false;
canRun = false;
rolling = false;
mc_hero1.n1.gotoAndStop("dead");
lastHFrame = myFrame;
}
if (lastHFrame != "run") {
sWalks[hero].stop();
}
}
function giveRun() {
clearInterval(IDrun);
canRun = true;
}
function wallUp() {
if (bWall == false) {
bWall = true;
var _local1 = 0;
while (_local1 < tab_walls.length) {
tab_walls[_local1].ground = true;
tab_walls[_local1].przenik = false;
tab_walls[_local1].landing = true;
_local1++;
}
}
}
function wallDown() {
if (bWall == true) {
bWall = false;
var _local1 = 0;
while (_local1 < tab_walls.length) {
tab_walls[_local1].ground = false;
tab_walls[_local1].przenik = true;
tab_walls[_local1].landing = false;
_local1++;
}
}
}
function framePointer(c, clip) {
var _local1 = clip._currentframe;
_local1 = _local1 + c;
_local1 = ((_local1 < 1) ? (clip._totalframes - _local1) : (_local1));
_local1 = ((_local1 > clip._totalframes) ? 1 : (_local1));
clip.gotoAndStop(_local1);
}
function destroyBullet(myHit, myBullet, mySound) {
playSound(mySound);
var counter2 = tab_hits.length;
duplicateMovieClip (myHit, "mc_hit" + counter2, this.getNextHighestDepth());
tab_hits[counter2] = eval ("mc_hit" + counter2);
tab_hits[counter2]._x = myBullet._x;
tab_hits[counter2]._y = myBullet._y;
tab_hits[counter2].n1._xscale = myBullet._xscale;
tab_hits[counter2].gotoAndPlay(1);
}
function teleportAttack() {
trace("teleportAttack");
var _local7 = Math.ceil((mc_hero1._x - 160) / 31);
var _local3 = Math.ceil((mc_hero1._y - 135) / 31);
canRun = false;
if (n == 0) {
playSound(sMZ);
}
var _local5 = -1;
var _local4 = a1.getDir();
var _local2;
var _local1 = 0;
while (_local1 < map_obj[_local3].length) {
if (map_obj[_local3][_local1].clip && (!map_obj[_local3][_local1].przenik)) {
if ((_local4 == RIGHT) && (map_obj[_local3][_local1].clip._x > mc_hero1._x)) {
if ((!_local2) || (_local2.clip._x > map_obj[_local3][_local1].clip._x)) {
_local2 = map_obj[_local3][_local1];
}
} else if ((_local4 == LEFT) && (map_obj[_local3][_local1].clip._x < mc_hero1._x)) {
if ((!_local2) || (_local2.clip._x < map_obj[_local3][_local1].clip._x)) {
_local2 = map_obj[_local3][_local1];
}
}
}
_local1++;
}
_local1 = 0;
while (_local1 < enemy_obj.length) {
if (Math.abs((mc_hero1._y - enemy_obj[_local1].clip._y) - wid) < (wid * 1.4)) {
if ((_local4 == RIGHT) && (enemy_obj[_local1].clip._x > mc_hero1._x)) {
if ((!_local2) || (_local2.clip._x > enemy_obj[_local1].clip._x)) {
_local2 = enemy_obj[_local1];
_local5 = _local1;
}
} else if ((_local4 == LEFT) && (enemy_obj[_local1].clip._x < mc_hero1._x)) {
if ((!_local2) || (_local2.clip._x < enemy_obj[_local1].clip._x)) {
_local2 = enemy_obj[_local1];
_local5 = _local1;
}
}
}
_local1++;
}
var _local6;
if (_local2 && (Math.abs(_local2.clip._x - mc_hero1._x) < a1.attackRange)) {
trace("znaleziono:" + _local2.clip._x);
_local6 = _local2.clip._x + ((_local4 == RIGHT) ? -31 : 31);
if (_local2.canDestroy) {
if (_local5 != -1) {
if (enemy_obj[_local5].hit(a1.power)) {
enemy_obj[_local5].dead(_local5);
trash(enemy_obj[_local5].clip);
enemy_obj.splice(_local5, 1);
}
} else {
playSound(_local2.deadSound);
if (_local2.type == 14) {
createBat(_local2.clip._x, _local2.clip._y);
}
_local2.clip.gotoAndPlay("dead");
trash(_local2.clip);
removeObjFromArray(_local2, fall_obj);
removeObjFromArray(_local2, obj);
delete map_obj[_local2.ypos][_local2.xpos];
map_obj[_local2.ypos][_local2.xpos] = 0;
}
}
} else {
if (_local4 == RIGHT) {
_local6 = Math.min(mc_hero1._x + a1.attackRange, BOARD_RIGHT - 31);
} else {
_local6 = Math.max(mc_hero1._x - a1.attackRange, BOARD_LEFT);
}
trace("nie znaleziono:" + _local6);
}
mc_hero1._x = _local6;
canShoot = true;
}
function laserAttack(laserBeam) {
attacking = true;
var _local8 = Math.ceil((mc_hero1._x - 160) / 31);
var _local3 = Math.ceil((mc_hero1._y - 135) / 31);
canRun = false;
if (n == 0) {
playSound(sMZ);
}
var _local4 = a1.getDir();
var _local2;
var _local5 = -1;
var _local1 = 0;
while (_local1 < map_obj[_local3].length) {
if (map_obj[_local3][_local1].clip && (!map_obj[_local3][_local1].przenik)) {
if ((_local4 == RIGHT) && (map_obj[_local3][_local1].clip._x > mc_hero1._x)) {
trace("znalazlem po prawej");
if ((!_local2) || (_local2.clip._x > map_obj[_local3][_local1].clip._x)) {
_local2 = map_obj[_local3][_local1];
}
} else if ((_local4 == LEFT) && (map_obj[_local3][_local1].clip._x < mc_hero1._x)) {
trace("znalazlem po lewej");
if ((!_local2) || (_local2.clip._x < map_obj[_local3][_local1].clip._x)) {
_local2 = map_obj[_local3][_local1];
}
}
}
_local1++;
}
_local1 = 0;
while (_local1 < enemy_obj.length) {
if (Math.abs((mc_hero1._y - enemy_obj[_local1].clip._y) - wid) < (wid * 1.4)) {
if ((_local4 == RIGHT) && (enemy_obj[_local1].clip._x > mc_hero1._x)) {
if ((!_local2) || (_local2.clip._x > enemy_obj[_local1].clip._x)) {
_local2 = enemy_obj[_local1];
_local5 = _local1;
}
} else if ((_local4 == LEFT) && (enemy_obj[_local1].clip._x < mc_hero1._x)) {
if ((!_local2) || (_local2.clip._x < enemy_obj[_local1].clip._x)) {
_local2 = enemy_obj[_local1];
_local5 = _local1;
}
}
}
_local1++;
}
var _local10;
if (_local2) {
_local10 = _local2.clip._x + ((_local4 == RIGHT) ? 0 : 31);
if (_local2.canDestroy) {
if (_local5 != -1) {
if (enemy_obj[_local5].hit(a1.power)) {
enemy_obj[_local5].dead(_local5);
trash(enemy_obj[_local5].clip);
enemy_obj.splice(_local5, 1);
}
} else {
trace("trafilem w przeszkode");
playSound(_local2.deadSound);
if (_local2.type == 14) {
createBat(_local2.clip._x, _local2.clip._y);
}
_local2.clip.gotoAndPlay("dead");
trash(_local2.clip);
removeObjFromArray(_local2, fall_obj);
removeObjFromArray(_local2, obj);
delete map_obj[_local2.ypos][_local2.xpos];
map_obj[_local2.ypos][_local2.xpos] = 0;
}
}
} else if (_local4 == RIGHT) {
_local10 = BOARD_RIGHT;
} else {
_local10 = BOARD_LEFT;
}
var _local6 = {x:_local10, y:0};
laserBeam.globalToLocal(_local6);
laserBeam.lineStyle(1.5, 16711680, 100);
laserBeam.lineTo(_local6.x, 0);
}
function isNearest(obj, dir, item) {
if (!obj) {
return(true);
}
if (item.clip && (!item.przenik)) {
if ((dir == RIGHT) && (item.clip._x > mc_hero1._x)) {
return(obj.clip._x > item.clip._x);
}
if ((dir == LEFT) && (item.clip._x < mc_hero1._x)) {
return(obj.clip._x < item.clip._x);
}
}
return(false);
}
function swordAtack(n) {
trace("swordAtack");
attacking = true;
if (n == 0) {
playSound(sMZ);
}
var _local2 = a1.getDir();
var _local1 = 0;
while (_local1 < enemy_obj.length) {
if ((((mc_hero1._x > (enemy_obj[_local1].clip._x - (wid * 2))) && (_local2 == 1)) && (mc_hero1._x < (enemy_obj[_local1].clip._x + a1.attackRange))) && (Math.abs((mc_hero1._y - enemy_obj[_local1].clip._y) - wid) < (wid * 1.4))) {
if (enemy_obj[_local1].hit(a1.power)) {
enemy_obj[_local1].dead(_local1);
trash(enemy_obj[_local1].clip);
enemy_obj.splice(_local1, 1);
reload(_local1);
_local1--;
}
}
if ((((mc_hero1._x < (enemy_obj[_local1].clip._x + (wid * 2))) && (_local2 == -1)) && (mc_hero1._x > (enemy_obj[_local1].clip._x - a1.attackRange))) && (Math.abs((mc_hero1._y - enemy_obj[_local1].clip._y) - wid) < (wid * 1.4))) {
if (enemy_obj[_local1].hit(a1.power)) {
enemy_obj[_local1].dead(_local1);
trash(enemy_obj[_local1].clip);
enemy_obj.splice(_local1, 1);
reload(_local1);
_local1--;
}
}
_local1++;
}
_local1 = 0;
while (_local1 < tab_chest_destroy.length) {
if ((((((mc_hero1._x > (tab_chest_destroy[_local1].clip._x - (wid * 2))) && (_local2 == 1)) && (mc_hero1._x < tab_chest_destroy[_local1].clip._x)) && (Math.abs(mc_hero1._y - tab_chest_destroy[_local1].clip._y) < wid)) && (tab_chest_destroy[_local1].canDestroy == true)) && (tab_chest_destroy[_local1].t == "Square")) {
destroyChest(tab_chest_destroy[_local1]);
}
if (((((mc_hero1._x < (tab_chest_destroy[_local1].clip._x + (wid * 2))) && (_local2 == -1)) && (mc_hero1._x > tab_chest_destroy[_local1].clip._x)) && (Math.abs(mc_hero1._y - tab_chest_destroy[_local1].clip._y) < wid)) && (tab_chest_destroy[_local1].canDestroy == true)) {
destroyChest(tab_chest_destroy[_local1]);
}
_local1++;
}
}
function destroyChest(objx) {
playSound(objx.deadSound);
var _local2 = new Array(2);
_local2 = objx.getWsp(mc_map._x, mc_map._y);
_local2[1] = Math.round(_local2[1]);
_local2[0] = Math.floor(_local2[0]);
if (objx.type == 14) {
if (objx.clip._y < (mc_map._y + mc_map._height)) {
createBat(objx.clip._x, objx.clip._y);
} else {
cages_number--;
}
}
objx.clip.gotoAndPlay("dead");
trash(objx.clip);
removeObjFromArray(objx, fall_obj);
removeObjFromArray(objx, tab_chest_destroy);
removeObjFromArray(objx, obj);
map_obj[_local2[1]][_local2[0]] = 0;
}
function whipAtack() {
var _local3 = random(2);
if (_local3 == 0) {
playSound(sBicz1);
} else {
playSound(sBicz2);
}
var _local2 = a1.getDir();
var _local1 = 0;
while (_local1 < enemy_obj.length) {
if ((((mc_hero1._x > (enemy_obj[_local1].clip._x - (wid * 3))) && (_local2 == 1)) && (mc_hero1._x < enemy_obj[_local1].clip._x)) && (Math.abs(mc_hero1._y - enemy_obj[_local1].clip._y) < wid)) {
enemy_obj[_local1].dead(_local1);
trash(enemy_obj[_local1].clip);
enemy_obj.splice(_local1, 1);
reload(_local1);
_local1--;
}
if ((((mc_hero1._x < (enemy_obj[_local1].clip._x + (wid * 3))) && (_local2 == -1)) && (mc_hero1._x > enemy_obj[_local1].clip._x)) && (Math.abs(mc_hero1._y - enemy_obj[_local1].clip._y) < wid)) {
enemy_obj[_local1].dead(_local1);
trash(enemy_obj[_local1].clip);
enemy_obj.splice(_local1, 1);
reload(_local1);
_local1--;
}
_local1++;
}
_local1 = 0;
while (_local1 < tab_chest_destroy.length) {
if ((((((mc_hero1._x > (tab_chest_destroy[_local1].clip._x - (wid * 3))) && (_local2 == 1)) && (mc_hero1._x < tab_chest_destroy[_local1].clip._x)) && (Math.abs(mc_hero1._y - tab_chest_destroy[_local1].clip._y) < wid)) && (tab_chest_destroy[_local1].canDestroy == true)) && (tab_chest_destroy[_local1].t == "Square")) {
destroyChest(tab_chest_destroy[_local1]);
}
if (((((mc_hero1._x < (tab_chest_destroy[_local1].clip._x + (wid * 3))) && (_local2 == -1)) && (mc_hero1._x > tab_chest_destroy[_local1].clip._x)) && (Math.abs(mc_hero1._y - tab_chest_destroy[_local1].clip._y) < wid)) && (tab_chest_destroy[_local1].canDestroy == true)) {
destroyChest(tab_chest_destroy[_local1]);
}
_local1++;
}
}
function waveAttack() {
var _local4 = 0;
var _local3 = a1.getDir();
trace("waveAttack, getdir:" + _local3);
playSound(sAFE);
mc_wave._y = mc_hero1._y - wid;
if (_local4 == 0) {
if (_local3 == 1) {
mc_wave._visible = true;
mc_wave._xscale = 100;
mc_wave._x = mc_hero1._x + wid;
mc_wave.gotoAndPlay(1);
} else {
mc_wave._visible = true;
mc_wave._xscale = -100;
mc_wave._x = mc_hero1._x;
mc_wave.gotoAndPlay(1);
}
}
var _local5 = Math.ceil((mc_hero1._x - 160) / 31);
var _local2 = Math.ceil((mc_hero1._y - 135) / 31);
var _local6 = -1;
_local3 = a1.getDir();
var _local1 = 0;
while (_local1 < map_obj[_local2].length) {
if (map_obj[_local2][_local1].clip && (!map_obj[_local2][_local1].przenik)) {
if (((_local3 == RIGHT) && (map_obj[_local2][_local1].clip._x > mc_hero1._x)) || ((_local3 == LEFT) && (map_obj[_local2][_local1].clip._x < mc_hero1._x))) {
if (Math.abs(map_obj[_local2][_local1].clip._x - mc_hero1._x) < a1.attackRange) {
playSound(map_obj[_local2][_local1].deadSound);
map_obj[_local2][_local1].clip.gotoAndPlay("dead");
trash(map_obj[_local2][_local1].clip);
removeObjFromArray(map_obj[_local2][_local1], fall_obj);
removeObjFromArray(map_obj[_local2][_local1], obj);
delete map_obj[map_obj[_local2][_local1].ypos][map_obj[_local2][_local1].xpos];
map_obj[map_obj[_local2][_local1].ypos][map_obj[_local2][_local1].xpos] = 0;
if (map_obj[_local2][_local1].type == 14) {
createBat(map_obj[_local2][_local1].clip._x, map_obj[_local2][_local1].clip._y);
}
}
}
}
_local1++;
}
_local1 = 0;
while (_local1 < enemy_obj.length) {
if (Math.abs((mc_hero1._y - enemy_obj[_local1].clip._y) - wid) < (wid * 1.4)) {
if (((_local3 == RIGHT) && (enemy_obj[_local1].clip._x > mc_hero1._x)) || ((_local3 == LEFT) && (enemy_obj[_local1].clip._x < mc_hero1._x))) {
if (Math.abs(enemy_obj[_local1].clip._x - mc_hero1._x) < a1.attackRange) {
if (enemy_obj[_local1].hit(a1.power)) {
enemy_obj[_local1].dead(_local1);
trash(enemy_obj[_local1].clip);
enemy_obj.splice(_local1, 1);
}
}
}
}
_local1++;
}
}
function numberToTime(num) {
var _local5 = num % 60;
var _local8 = Math.floor(_local5);
var _local1 = (_local5 - _local8).toString().substr(2, 2);
var _local2 = "00";
if (_local1.length == 1) {
_local2 = "0" + _local1;
}
if (_local1.length == 2) {
_local2 = _local1;
}
var _local4 = Math.round(num) % 60;
if (_local4 < 10) {
var _local9 = "0" + _local4;
} else {
var _local9 = _local4.toString();
}
var _local3 = Math.round(num / 60);
if (_local3 < 10) {
var _local7 = "0" + _local3;
} else {
var _local7 = _local3.toString();
}
var _local10 = (((_local7 + ":") + _local9) + ":") + _local2;
return(_local10);
}
function createBitmap() {
var _local3 = "normal";
var _local4 = true;
this.createEmptyMovieClip("bmp1", this.getNextHighestDepth());
var _local2 = new Array(mc_map, mc_exit1, mc_hero1);
drawArray(_local2, bmpData1);
drawArray(tab_sq, bmpData1);
drawArray(tab_col, bmpData1);
drawArray(liany, bmpData1);
drawArray(tab_enemy, bmpData1);
addMaskFromArray(tab_push);
addMaskFromArray(tab_enemy);
dodaj_maske(mc_hero1);
bmp1.attachBitmap(bmpData1, 2, "auto", true);
bmp1._visible = false;
}
function createMatrix(myx, myy) {
var _local1 = new flash.geom.Matrix();
var _local2 = new flash.geom.Matrix();
_local2.translate(myx, myy);
_local1.concat(_local2);
_local1.scale(scaleMatrix, scaleMatrix);
return(_local1);
}
function drawArray(myArray1, bmpData1) {
var _local2 = 0;
while (_local2 < myArray1.length) {
var _local1 = myArray1[_local2];
var _local3 = new flash.geom.Matrix();
_local3 = createMatrix(_local1._x - mc_map._x, _local1._y - mc_map._y);
bmpData1.draw(_local1, _local3, null, blendMode, myRectangle, smooth);
_local2++;
}
}
function addMaskFromArray(myArray1) {
var _local1 = 0;
while (_local1 < myArray1.length) {
dodaj_maske(myArray1[_local1]);
_local1++;
}
}
function gunShoot(direction) {
var pos = new Array(2);
pos = a1.getWsp(mc_map._x, mc_map._y);
var i = bullets_obj2.length;
var clipNr = random(3000);
duplicateMovieClip (a1.bulletType || (mc_bullet), "mc_bullet2" + clipNr, this.getNextHighestDepth());
var clip = eval ("mc_bullet2" + clipNr);
if (direction) {
clip._xscale = clip._xscale * direction;
}
clip._x = mc_hero1._x + 15;
clip._y = mc_hero1._y + 10;
bullets_obj2[i] = new Bullet(a1.bulletSpeed, direction || (a1.getDir()), a1.attackRange, clip, Math.floor(pos[0]), Math.floor(pos[1]), null, sTR1);
}
function stopAllAnimations() {
var _local1 = 0;
while (_local1 < bullets_obj.length) {
bullets_obj[_local1].clip.stop();
bullets_obj[_local1].clip.n1.stop();
_local1++;
}
_local1 = 0;
while (_local1 < rybki.length) {
rybki[_local1].clip.staw.mc_rybka.stop();
_local1++;
}
_local1 = 0;
while (_local1 < tab_walls.length) {
tab_walls[_local1].clip.stop();
_local1++;
}
_local1 = 0;
while (_local1 < enemy_obj.length) {
enemy_obj[_local1].clip.n1.n1.stop();
enemy_obj[_local1].clip.n1.stop();
_local1++;
}
}
stop();
var BOARD_LEFT = 162;
var BOARD_RIGHT = 778;
var BOARD_TOP = 135;
var BOARD_BOTTOM = 535;
var startLandingPoint = -100;
var RIGHT = 1;
var LEFT = -1;
var framesForNextShoot = 0;
url_id = null;
mc_wall.gotoAndStop(1);
playSound(sMP);
startLoop("map");
stopLoop("begin");
b_next._visible = false;
b7.enabled = false;
tfperf._visible = false;
btn_copy._visible = false;
var scaleMatrix = 0.16;
var bmpData1 = (new flash.display.BitmapData(Math.floor((20 * wid) * scaleMatrix), Math.floor((13 * wid) * scaleMatrix), false, 11154244));
b7.enabled = false;
mc_wave.gotoAndStop(14);
var secondWave = false;
var fpsCounter = 0;
mc_pop3._visible = false;
mc_pop_warning1._visible = false;
mc_pop_help._visible = false;
var spidersCount = 0;
var pauseOn = false;
var enemy_live = false;
curFrame = "game";
var dirAtack = 1;
mc_map.gotoAndStop(bckFrame);
mc_map._alpha = 100;
var map_col = new Array();
var map_obj = new Array();
map_obj = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
map1x = [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 4, 4, 4, 4, 1, 1, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, d, d, 1, 0, 8, 0, 0, 1, 0, 5, 1, 1, 0, 0, 0, 0], [0, 0, 2, 2, 1, 1, 1, 1, 3, 3, 3, 0, 0, 5, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 5, 1, 0, 0, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, s, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0, 4], [0, 1, 1, 1, d, d, 5, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 9, 0, 0], [0, 0, 1, 0, 0, s, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 3, 3], [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
var mapx = new Array();
mapx = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
var mapx2 = new Array();
mapx2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
map_col = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
var cont = this;
mc_napis._visible = false;
var hei0 = 50;
var wid = 31;
var hei = 60;
var canRun = true;
var attacking = false;
var rolling = false;
var endGame = false;
var reloadSpace = false;
var frameToStay = 1;
var framePercent = 70;
var lastHFrame = "";
var gravity = 1.6;
var tarcie = 0.9;
var ID = new Array();
var ID2 = new Array();
var IDshoot = new Array();
duplicateMovieClip (mc_hero, "mc_hero1", this.getNextHighestDepth());
var a1 = new Hero(hero, mc_hero1);
duplicateMovieClip (mc_map, "mc_mask", this.getNextHighestDepth());
mc_hero1.n1._xscale = 100 * a1.__get__initialDirection();
mc_hero.stop();
mc_hero.n1.stop();
mc_hero.n1.n1.stop();
var bulletsID = new Array();
var downWasUp = true;
var xdir = 0;
var yspeed = 0;
var xspeed = 0;
var spadanie = false;
var canUp = true;
this.createEmptyMovieClip("oef", this.getNextHighestDepth());
var kLeftTime = 0;
var kRightTime = 0;
var IDa1CanShoot;
var tab_push = new Array();
var t_trash = new Array();
var tab_hits = new Array();
var tab_col = new Array();
var rocks = new Array();
var bullets_obj = new Array();
var bullets_obj2 = new Array();
var tab_walls = new Array();
var tab_sq = new Array();
var tab_enemy = new Array();
var obj = new Array();
var fall_obj = new Array();
var enemy_obj = new Array();
var tab_masks = new Array();
var enx_obj = new Array();
var rybki = new Array();
var tab_chest_destroy = new Array();
var cages_number = 0;
var liany = new Array();
var liany_obj = new Array();
trace(map1);
var i = 0;
while (i < map1.length) {
var j = 0;
while (j < map1[i].length) {
switch (map1[i][j]) {
case "1" :
var counter = tab_sq.length;
duplicateMovieClip (mc_sq, "mc_sq" + counter, this.getNextHighestDepth());
tab_sq[counter] = eval ("mc_sq" + counter);
tab_sq[counter]._x = mc_map._x + (j * wid);
tab_sq[counter]._y = mc_map._y + (i * wid);
obj[counter] = new Square(1, tab_sq[counter], counter);
obj[counter].setWsp(j, i);
map_obj[i][j] = obj[counter];
break;
case "101" :
var counter = tab_sq.length;
duplicateMovieClip (mc_sqskala, "mc_sqskala" + counter, this.getNextHighestDepth());
tab_sq[counter] = eval ("mc_sqskala" + counter);
tab_sq[counter]._x = mc_map._x + (j * wid);
tab_sq[counter]._y = mc_map._y + (i * wid);
obj[counter] = new Square(101, tab_sq[counter], counter);
obj[counter].setWsp(j, i);
map_obj[i][j] = obj[counter];
break;
case "2" :
var counter = tab_sq.length;
duplicateMovieClip (mc_sqx, "mc_sqx" + counter, this.getNextHighestDepth());
tab_sq[counter] = eval ("mc_sqx" + counter);
tab_sq[counter]._x = mc_map._x + (j * wid);
tab_sq[counter]._y = mc_map._y + (i * wid);
obj[counter] = new Square(2, tab_sq[counter], counter);
obj[counter].setWsp(j, i);
map_obj[i][j] = obj[counter];
break;
case "3" :
var counter = tab_sq.length;
duplicateMovieClip (mc_sqb, "mc_sqb" + counter, this.getNextHighestDepth());
tab_sq[counter] = eval ("mc_sqb" + counter);
tab_sq[counter]._x = mc_map._x + (j * wid);
tab_sq[counter]._y = mc_map._y + (i * wid);
obj[counter] = new Square(3, tab_sq[counter], counter);
obj[counter].setWsp(j, i);
map_obj[i][j] = obj[counter];
break;
case "4" :
var counter = tab_sq.length;
duplicateMovieClip (mc_sqc, "mc_sqc" + counter, this.getNextHighestDepth());
tab_sq[counter] = eval ("mc_sqc" + counter);
tab_sq[counter]._x = mc_map._x + (j * wid);
tab_sq[counter]._y = mc_map._y + (i * wid);
obj[obj.length] = new Square(4, tab_sq[counter], counter);
obj[obj.length - 1].setWsp(j, i);
map_obj[i][j] = obj[obj.length - 1];
break;
case "5" :
var counter = tab_sq.length;
duplicateMovieClip (mc_chest, "mc_chest" + counter, this.getNextHighestDepth());
tab_sq[counter] = eval ("mc_chest" + counter);
tab_sq[counter]._x = mc_map._x + (j * wid);
tab_sq[counter]._y = mc_map._y + (i * wid);
tab_push[tab_push.length] = tab_sq[counter];
obj[obj.length] = new Square(5, tab_sq[counter], counter);
obj[obj.length - 1].setWsp(j, i);
fall_obj[fall_obj.length] = obj[obj.length - 1];
map_obj[i][j] = obj[obj.length - 1];
map_obj[i][j].fallFrom = tab_sq[counter]._y;
break;
case "6" :
var counter = tab_sq.length;
duplicateMovieClip (mc_chestx, "mc_chestx" + counter, this.getNextHighestDepth());
tab_sq[counter] = eval ("mc_chestx" + counter);
tab_sq[counter]._x = mc_map._x + (j * wid);
tab_sq[counter]._y = mc_map._y + (i * wid);
tab_push[tab_push.length] = tab_sq[counter];
obj[obj.length] = new Square(6, tab_sq[counter], counter);
obj[obj.length - 1].setWsp(j, i);
fall_obj[fall_obj.length] = obj[obj.length - 1];
map_obj[i][j] = obj[obj.length - 1];
map_obj[i][j].fallFrom = tab_sq[counter]._y;
tab_chest_destroy.push(map_obj[i][j]);
obj[obj.length - 1].deadSound = sZB;
break;
case "7" :
var counter = liany.length;
duplicateMovieClip (mc_liana, "mc_liana" + counter, this.getNextHighestDepth());
liany[counter] = eval ("mc_liana" + counter);
liany[counter]._x = mc_map._x + (j * wid);
liany[counter]._y = mc_map._y + (i * wid);
map_obj[i][j] = new Square(12, liany[counter], counter);
liany_obj[counter] = map_obj[i][j];
break;
case "7a" :
var counter = liany.length;
duplicateMovieClip (mc_liana, "mc_liana" + counter, this.getNextHighestDepth());
liany[counter] = eval ("mc_liana" + counter);
liany[counter]._x = mc_map._x + (j * wid);
liany[counter]._y = mc_map._y + (i * wid);
map_obj[i][j] = new Square(12, liany[counter], counter);
liany_obj[counter] = map_obj[i][j];
counter = tab_enemy.length;
duplicateMovieClip (mc_spider_a, "mc_spider_a" + counter, this.getNextHighestDepth());
tab_enemy[counter] = eval ("mc_spider_a" + counter);
tab_enemy[counter]._x = mc_map._x + (j * wid);
tab_enemy[counter]._y = mc_map._y + (i * wid);
tab_enemy[counter]._visible = true;
tab_enemy[counter].gotoAndStop("pajak2");
enemy_obj[enemy_obj.length] = new Enemy(3, tab_enemy[counter], enemy_obj.length, null);
enemy_obj[enemy_obj.length - 1].deadSound = sWN;
enemy_obj[enemy_obj.length - 1].setCont(cont);
break;
case "e0" :
var counter = tab_enemy.length;
duplicateMovieClip (mrd_soldier, "mrd_soldier" + counter, this.getNextHighestDepth());
tab_enemy[counter] = eval ("mrd_soldier" + counter);
tab_enemy[counter]._x = mc_map._x + (j * wid);
tab_enemy[counter]._y = mc_map._y + (i * wid);
tab_enemy[counter]._visible = true;
tab_enemy[counter].gotoAndStop("dir1");
fall_obj[fall_obj.length] = new Enemy(Enemy.MRD, tab_enemy[counter], enemy_obj.length, bullet_mrd_soldier);
fall_obj[fall_obj.length - 1].setWsp(j, i);
fall_obj[fall_obj.length - 1].setCont(cont);
enemy_obj[enemy_obj.length] = fall_obj[fall_obj.length - 1];
enx_obj[enemy_obj[enemy_obj.length - 1].id] = enemy_obj[enemy_obj.length - 1];
tab_enemy[counter].cacheAsBitmap = true;
fall_obj[fall_obj.length - 1].setHitClip(mc_poisonHit);
enemy_obj[enemy_obj.length - 1].deadSound = sSW;
enemy_obj[enemy_obj.length - 1].shootSound = sWP;
break;
case b :
var counter = tab_enemy.length;
duplicateMovieClip (mc_dzban, "mc_dzban" + counter, this.getNextHighestDepth());
tab_enemy[counter] = eval ("mc_dzban" + counter);
tab_enemy[counter]._x = mc_map._x + (j * wid);
tab_enemy[counter]._y = mc_map._y + (i * wid);
tab_enemy[counter]._visible = true;
tab_enemy[counter].gotoAndStop("dir1");
fall_obj[fall_obj.length] = new Enemy(1, tab_enemy[counter], enemy_obj.length, null);
fall_obj[fall_obj.length - 1].setWsp(j, i);
enemy_obj[enemy_obj.length] = fall_obj[fall_obj.length - 1];
fall_obj[fall_obj.length - 1].setCont(cont);
enx_obj[enemy_obj[enemy_obj.length - 1].id] = enemy_obj[enemy_obj.length - 1];
fall_obj[fall_obj.length - 1].isShooting = true;
var _id = enemy_obj[enemy_obj.length - 1].id;
IDshoot[enx_obj[_id].id] = setInterval(reload, 5000, enx_obj[_id].id);
enemy_obj[enemy_obj.length - 1].deadSound = sZD;
break;
case c :
var counter = tab_sq.length;
duplicateMovieClip (mc_batsCage, "mc_batsCage" + counter, this.getNextHighestDepth());
tab_sq[counter] = eval ("mc_batsCage" + counter);
tab_sq[counter]._x = mc_map._x + (j * wid);
tab_sq[counter]._y = mc_map._y + (i * wid);
tab_push[tab_push.length] = tab_sq[counter];
obj[obj.length] = new Square(14, tab_sq[counter], counter);
obj[obj.length - 1].setWsp(j, i);
fall_obj[fall_obj.length] = obj[obj.length - 1];
map_obj[i][j] = obj[obj.length - 1];
map_obj[i][j].fallFrom = tab_sq[counter]._y;
tab_chest_destroy.push(map_obj[i][j]);
obj[obj.length - 1].deadSound = sZK;
cages_number++;
break;
case l :
var counter = tab_sq.length;
duplicateMovieClip (mc_wall, "mc_wall" + counter, this.getNextHighestDepth());
tab_sq[counter] = eval ("mc_wall" + counter);
tab_sq[counter]._x = mc_map._x + (j * wid);
tab_sq[counter]._y = mc_map._y + (i * wid);
obj[counter] = new Square(15, tab_sq[counter], counter);
obj[counter].setWsp(j, i);
map_obj[i][j] = obj[counter];
tab_walls[tab_walls.length] = obj[counter];
tab_sq[counter].cacheAsBitmap = true;
break;
case m :
var counter = tab_sq.length;
duplicateMovieClip (mc_sqmagma, "mc_magma" + counter, this.getNextHighestDepth());
tab_sq[counter] = eval ("mc_magma" + counter);
tab_sq[counter]._x = mc_map._x + (j * wid);
tab_sq[counter]._y = mc_map._y + (i * wid);
obj[counter] = new Square(13, tab_sq[counter], counter);
obj[counter].setWsp(j, i);
map_obj[i][j] = obj[counter];
break;
case n :
var counter = tab_sq.length;
duplicateMovieClip (mc_pnacze, "mc_pnacze" + counter, this.getNextHighestDepth());
tab_sq[counter] = eval ("mc_pnacze" + counter);
tab_sq[counter]._x = mc_map._x + (j * wid);
tab_sq[counter]._y = mc_map._y + (i * wid);
obj[counter] = new Square(7, tab_sq[counter], counter);
obj[counter].setWsp(j, i);
map_obj[i][j] = obj[counter];
break;
case p :
var counter = tab_enemy.length;
duplicateMovieClip (mc_posag, "mc_posag" + counter, this.getNextHighestDepth());
tab_enemy[counter] = eval ("mc_posag" + counter);
tab_enemy[counter]._x = mc_map._x + (j * wid);
tab_enemy[counter]._y = mc_map._y + (i * wid);
tab_enemy[counter]._visible = true;
fall_obj[fall_obj.length] = new Enemy(2, tab_enemy[counter], enemy_obj.length, mc_fireball);
fall_obj[fall_obj.length - 1].setWsp(j, i);
enemy_obj[enemy_obj.length] = fall_obj[fall_obj.length - 1];
fall_obj[fall_obj.length - 1].setCont(cont);
enx_obj[enemy_obj[enemy_obj.length - 1].id] = enemy_obj[enemy_obj.length - 1];
tab_enemy[counter].cacheAsBitmap = true;
fall_obj[fall_obj.length - 1].setHitClip(mc_fireHit);
enemy_obj[enemy_obj.length - 1].deadSound = sZR;
enemy_obj[enemy_obj.length - 1].shootSound = sFS;
break;
case p2 :
var counter = tab_enemy.length;
duplicateMovieClip (mc_2posag, "mc_2posag" + counter, this.getNextHighestDepth());
tab_enemy[counter] = eval ("mc_2posag" + counter);
tab_enemy[counter]._x = mc_map._x + (j * wid);
tab_enemy[counter]._y = mc_map._y + (i * wid);
tab_enemy[counter]._visible = true;
tab_enemy[counter].gotoAndStop("walk");
fall_obj[fall_obj.length] = new Enemy(22, tab_enemy[counter], enemy_obj.length, mc_fireball);
fall_obj[fall_obj.length - 1].setWsp(j, i);
enemy_obj[enemy_obj.length] = fall_obj[fall_obj.length - 1];
fall_obj[fall_obj.length - 1].setCont(cont);
enx_obj[enemy_obj[enemy_obj.length - 1].id] = enemy_obj[enemy_obj.length - 1];
tab_enemy[counter].cacheAsBitmap = true;
fall_obj[fall_obj.length - 1].setHitClip(mc_fireHit);
enemy_obj[enemy_obj.length - 1].deadSound = sZR;
enemy_obj[enemy_obj.length - 1].shootSound = sFS;
break;
case d :
var counter = tab_col.length;
duplicateMovieClip (mc_diamond, "mc_diamond" + counter, this.getNextHighestDepth());
tab_col[counter] = eval ("mc_diamond" + counter);
tab_col[counter]._x = mc_map._x + (j * wid);
tab_col[counter]._y = mc_map._y + (i * wid);
tab_col[counter].gotoAndStop(1);
map_col[i][j] = new Square(11, tab_col[counter], counter);
map_col[i][j].colSound = sBD;
tab_col[counter].cacheAsBitmap = true;
break;
case r :
var counter = tab_enemy.length;
duplicateMovieClip (mc_spider, "mc_spider" + counter, this.getNextHighestDepth());
tab_enemy[counter] = eval ("mc_spider" + counter);
tab_enemy[counter]._x = mc_map._x + (j * wid);
tab_enemy[counter]._y = mc_map._y + (i * wid);
tab_enemy[counter]._visible = true;
fall_obj[fall_obj.length] = new Enemy(4, tab_enemy[counter], enemy_obj.length, null);
fall_obj[fall_obj.length - 1].setWsp(j, i);
fall_obj[fall_obj.length - 1].setCont(cont);
enemy_obj[enemy_obj.length] = fall_obj[fall_obj.length - 1];
enx_obj[enemy_obj[enemy_obj.length - 1].id] = enemy_obj[enemy_obj.length - 1];
tab_enemy[counter].cacheAsBitmap = true;
enemy_obj[enemy_obj.length - 1].deadSound = sSP;
spidersCount++;
break;
case s :
var counter = tab_col.length;
duplicateMovieClip (mc_statue, "mc_statue" + counter, this.getNextHighestDepth());
tab_col[counter] = eval ("mc_statue" + counter);
tab_col[counter]._x = mc_map._x + (j * wid);
tab_col[counter]._y = mc_map._y + (i * wid);
tab_col[counter].gotoAndStop(1);
map_col[i][j] = new Square(11, tab_col[counter], counter);
map_col[i][j].colSound = sBZ;
tab_col[counter].cacheAsBitmap = true;
break;
case w :
duplicateMovieClip (mc_exit, "mc_exit1", this.getNextHighestDepth());
mc_exit1._x = mc_map._x + (j * wid);
mc_exit1._y = mc_map._y + (i * wid);
mc_exit1.gotoAndStop(objective);
break;
case x :
duplicateMovieClip (mc_exit, "mc_exit1", this.getNextHighestDepth());
mc_exit1._x = mc_map._x + (j * wid);
mc_exit1._y = mc_map._y + (i * wid);
mc_exit1.gotoAndStop(objective);
break;
case y :
duplicateMovieClip (mc_exit, "mc_exit1", this.getNextHighestDepth());
mc_exit1._x = mc_map._x + (j * wid);
mc_exit1._y = mc_map._y + (i * wid);
mc_exit1.gotoAndStop(objective);
break;
case z :
duplicateMovieClip (mc_exit, "mc_exit1", this.getNextHighestDepth());
mc_exit1._x = mc_map._x + (j * wid);
mc_exit1._y = mc_map._y + (i * wid);
mc_exit1.gotoAndStop(objective);
break;
case "9" :
a1.setOldPosition(mc_hero._x, mc_hero._y);
mc_hero1._x = mc_map._x + (j * wid);
mc_hero1._y = (mc_map._y + (i * wid)) - 2;
break;
case "e1" :
var counter = tab_enemy.length;
duplicateMovieClip (magneto, "magneto" + counter, this.getNextHighestDepth());
tab_enemy[counter] = eval ("magneto" + counter);
tab_enemy[counter]._x = mc_map._x + (j * wid);
tab_enemy[counter]._y = mc_map._y + (i * wid);
tab_enemy[counter]._visible = true;
fall_obj[fall_obj.length] = new Enemy(Enemy.MAGNETO, tab_enemy[counter], enemy_obj.length, bullet_magneto);
fall_obj[fall_obj.length - 1].setWsp(j, i);
enemy_obj[enemy_obj.length] = fall_obj[fall_obj.length - 1];
fall_obj[fall_obj.length - 1].setCont(cont);
enx_obj[enemy_obj[enemy_obj.length - 1].id] = enemy_obj[enemy_obj.length - 1];
tab_enemy[counter].cacheAsBitmap = true;
fall_obj[fall_obj.length - 1].setHitClip(mc_fireHit);
enemy_obj[enemy_obj.length - 1].deadSound = sZR;
enemy_obj[enemy_obj.length - 1].shootSound = sFS;
break;
case "e2" :
var counter = tab_enemy.length;
duplicateMovieClip (hulk, "hulk" + counter, this.getNextHighestDepth());
tab_enemy[counter] = eval ("hulk" + counter);
tab_enemy[counter]._x = mc_map._x + (j * wid);
tab_enemy[counter]._y = mc_map._y + (i * wid);
tab_enemy[counter]._visible = true;
fall_obj[fall_obj.length] = new Enemy(Enemy.HULK, tab_enemy[counter], enemy_obj.length, bullet_gambit);
fall_obj[fall_obj.length - 1].setWsp(j, i);
enemy_obj[enemy_obj.length] = fall_obj[fall_obj.length - 1];
fall_obj[fall_obj.length - 1].setCont(cont);
enx_obj[enemy_obj[enemy_obj.length - 1].id] = enemy_obj[enemy_obj.length - 1];
tab_enemy[counter].cacheAsBitmap = true;
fall_obj[fall_obj.length - 1].setHitClip(mc_fireHit);
enemy_obj[enemy_obj.length - 1].deadSound = sZR;
enemy_obj[enemy_obj.length - 1].shootSound = sFS;
break;
case "e3" :
var counter = tab_enemy.length;
duplicateMovieClip (gambit, "gambit" + counter, this.getNextHighestDepth());
tab_enemy[counter] = eval ("gambit" + counter);
tab_enemy[counter]._x = mc_map._x + (j * wid);
tab_enemy[counter]._y = mc_map._y + (i * wid);
tab_enemy[counter]._visible = true;
fall_obj[fall_obj.length] = new Enemy(Enemy.GAMBIT, tab_enemy[counter], enemy_obj.length, bullet_gambit);
fall_obj[fall_obj.length - 1].setWsp(j, i);
enemy_obj[enemy_obj.length] = fall_obj[fall_obj.length - 1];
fall_obj[fall_obj.length - 1].setCont(cont);
enx_obj[enemy_obj[enemy_obj.length - 1].id] = enemy_obj[enemy_obj.length - 1];
tab_enemy[counter].cacheAsBitmap = true;
fall_obj[fall_obj.length - 1].setHitClip(mc_fireHit);
enemy_obj[enemy_obj.length - 1].deadSound = sZR;
enemy_obj[enemy_obj.length - 1].shootSound = sFS;
break;
case "e4" :
case "e5" :
var counter = tab_enemy.length;
duplicateMovieClip (sentinel_prowler + ((map1[i][j] == "e5") ? "2" : ""), "sentinel" + counter, this.getNextHighestDepth());
tab_enemy[counter] = eval ("sentinel" + counter);
tab_enemy[counter]._x = mc_map._x + (j * wid);
tab_enemy[counter]._y = mc_map._y + (i * wid);
tab_enemy[counter]._visible = true;
fall_obj[fall_obj.length] = new Enemy(((map1[i][j] == "e5") ? (Enemy.SENTINEL2) : (Enemy.SENTINEL)), tab_enemy[counter], enemy_obj.length, bullet_sentinels);
fall_obj[fall_obj.length - 1].setWsp(j, i);
enemy_obj[enemy_obj.length] = fall_obj[fall_obj.length - 1];
fall_obj[fall_obj.length - 1].setCont(cont);
enx_obj[enemy_obj[enemy_obj.length - 1].id] = enemy_obj[enemy_obj.length - 1];
tab_enemy[counter].cacheAsBitmap = true;
fall_obj[fall_obj.length - 1].setHitClip(mc_fireHit);
enemy_obj[enemy_obj.length - 1].deadSound = sZR;
enemy_obj[enemy_obj.length - 1].shootSound = sFS;
}
j++;
}
i++;
}
var i = 0;
while (i < map1.length) {
var j = 0;
while (j < map1[i].length) {
map_col[i][j].clip.swapDepths(this.getNextHighestDepth());
if (!(map1[i][j] === a)) {
} else {
var counter = tab_sq.length;
duplicateMovieClip (mc_sadzawka, "mc_sadzawka" + counter, this.getNextHighestDepth());
tab_sq[counter] = eval ("mc_sadzawka" + counter);
tab_sq[counter]._x = mc_map._x + (j * wid);
tab_sq[counter]._y = mc_map._y + (i * wid);
tab_sq[counter].mc_ramka._visible = false;
obj[obj.length] = new Square(8, tab_sq[counter], counter);
map_obj[i][j] = obj[obj.length - 1];
rybki[rybki.length] = obj[obj.length - 1];
}
j++;
}
i++;
}
var i = 0;
while (i < obj.length) {
if (obj[i].connected == true) {
var arr = new Array();
arr = obj[i].getWsp(mc_map._x, mc_map._y);
arr[0] = Math.floor(arr[0]);
arr[1] = Math.floor(arr[1]);
var r1 = (map_obj[arr[1]][arr[0] + 1].type == obj[i].type);
var l1 = (map_obj[arr[1]][arr[0] - 1].type == obj[i].type);
var u1 = (map_obj[arr[1] - 1][arr[0]].type == obj[i].type);
var d1 = (map_obj[arr[1] + 1][arr[0]].type == obj[i].type);
if ((((!r1) && (!l1)) && (!u1)) && (!d1)) {
obj[i].clip.gotoAndStop("single");
} else if ((((!u1) && (!d1)) && (l1)) && (!r1)) {
obj[i].clip.gotoAndStop("right");
} else if ((((!u1) && (!d1)) && (!l1)) && (r1)) {
obj[i].clip.gotoAndStop("left");
} else if ((((!u1) && (!d1)) && (l1)) && (r1)) {
obj[i].clip.gotoAndStop("center");
} else if ((((!u1) && (d1)) && (l1)) && (r1)) {
obj[i].clip.gotoAndStop("center_up");
} else if ((((!u1) && (d1)) && (!l1)) && (r1)) {
obj[i].clip.gotoAndStop("left_up");
} else if ((((!u1) && (d1)) && (l1)) && (!r1)) {
obj[i].clip.gotoAndStop("right_up");
} else if (((u1 && d1) && l1) && r1) {
obj[i].clip.gotoAndStop("center_center");
} else if (((u1 && d1) && (!l1)) && r1) {
obj[i].clip.gotoAndStop("left_center");
} else if (((u1 && d1) && l1) && (!r1)) {
obj[i].clip.gotoAndStop("right_center");
} else if (((u1 && (!d1)) && l1) && r1) {
obj[i].clip.gotoAndStop("down_center");
} else if (((u1 && (!d1)) && (!l1)) && r1) {
obj[i].clip.gotoAndStop("left_down");
} else if (((u1 && (!d1)) && l1) && (!r1)) {
obj[i].clip.gotoAndStop("right_down");
} else if ((((!u1) && d1) && (!l1)) && (!r1)) {
obj[i].clip.gotoAndStop("single_up");
} else if (((u1 && d1) && (!l1)) && (!r1)) {
obj[i].clip.gotoAndStop("single_center");
} else if (((u1 && (!d1)) && (!l1)) && (!r1)) {
obj[i].clip.gotoAndStop("single_down");
}
if (obj[i].type == 3) {
var s2x2 = (((map1[arr[1] + 1][arr[0]] == obj[i].type) && (map1[arr[1] + 1][arr[0] + 1] == obj[i].type)) && (map1[arr[1]][arr[0] + 1] == obj[i].type));
var s3x1 = ((map1[arr[1]][arr[0] + 1] == obj[i].type) && (map1[arr[1]][arr[0] + 2] == obj[i].type));
bylo = mapx2[arr[1]][arr[0]] > 9;
if (s2x2 && (!bylo)) {
var k = rocks.length;
duplicateMovieClip (kt10b, "kt10_b" + k, this.getNextHighestDepth());
rocks[k] = eval ("kt10_b" + k);
rocks[k]._x = obj[i].clip._x + random(wid);
rocks[k]._y = obj[i].clip._y + random(wid);
mapx2[arr[1]][arr[0]] = 20;
mapx2[arr[1] + 1][arr[0]] = 20;
mapx2[arr[1] + 1][arr[0] + 1] = 20;
mapx2[arr[1]][arr[0] + 1] = 20;
}
bylo = false;
var k = 0;
while (k < arr[0]) {
if (mapx[arr[1]][k] == 4) {
bylo = true;
break;
}
k++;
}
if ((bylo == false) && (!u1)) {
if (random(2) == 1) {
mapx[arr[1]][arr[0]] = 4;
obj[i].clip.kt1._alpha = 100;
}
}
bylo = false;
var howMany = 0;
if ((s3x1 == true) && (mapx[arr[1]][arr[0]] != 4)) {
var k = (arr[0] + 1);
while (k < map_obj[0].length) {
if (map_obj[arr[1]][k].type == obj[i].type) {
} else {
howMany = k - arr[0];
break;
}
k++;
}
var k = 0;
while (k < arr[0]) {
if (mapx[arr[1]][k] == 5) {
bylo = true;
break;
}
k++;
}
if ((bylo == false) && (!u1)) {
mapx[arr[1]][arr[0]] = 5;
obj[i].clip.kt2._alpha = 100;
obj[i].clip.kt2._x = random(howMany) * wid;
}
}
}
if (obj[i].green == true) {
var s2row = ((((map1[arr[1]][arr[0]] == obj[i].type) && (map1[arr[1]][arr[0] + 1] == obj[i].type)) && (map1[arr[1] - 1][arr[0]] != obj[i].type)) && (map1[arr[1] - 1][arr[0] + 1] != obj[i].type));
var s3row = ((((((map1[arr[1]][arr[0]] == obj[i].type) && (map1[arr[1]][arr[0] + 1] == obj[i].type)) && (map1[arr[1]][arr[0] + 2] == obj[i].type)) && (map1[arr[1] - 1][arr[0]] != obj[i].type)) && (map1[arr[1] - 1][arr[0] + 1] != obj[i].type)) && (map1[arr[1] - 1][arr[0] + 2] != obj[i].type));
var bylo = ((mapx[arr[1]][arr[0]] == 2) || (mapx[arr[1]][arr[0]] == 3));
if (((s3row && (!u1)) && (!bylo)) && (mapx[arr[1]][arr[0] - 1] != 3)) {
obj[i].clip.kt1._alpha = 100;
mapx[arr[1]][arr[0]] = 3;
mapx[arr[1]][arr[0] + 1] = 3;
mapx[arr[1]][arr[0] + 2] = 3;
bylo = true;
obj[i].clip.kt1._x = random(wid * 2);
}
if (((s2row && (!u1)) && (!bylo)) && (mapx[arr[1]][arr[0] - 1] != 2)) {
obj[i].clip.kt2._alpha = 100;
mapx[arr[1]][arr[0]] = 2;
mapx[arr[1]][arr[0] + 1] = 2;
bylo = true;
obj[i].clip.kt2._x = random(wid);
}
var s3x2 = (((((map1[arr[1] + 1][arr[0]] == obj[i].type) && (map1[arr[1] + 1][arr[0] + 1] == obj[i].type)) && (map1[arr[1]][arr[0] + 1] == obj[i].type)) && (map1[arr[1]][arr[0] + 2] == obj[i].type)) && (map1[arr[1] + 1][arr[0] + 2] == obj[i].type));
bylo = mapx2[arr[1]][arr[0]] > 9;
if (s3x2 && (!bylo)) {
var clip;
switch (obj[i].type) {
case 1 :
clip = kt11;
break;
case 101 :
clip = kt101;
}
var k = rocks.length;
duplicateMovieClip (clip, "kt11_" + k, this.getNextHighestDepth());
rocks[k] = eval ("kt11_" + k);
rocks[k]._x = obj[i].clip._x + random(wid);
rocks[k]._y = obj[i].clip._y + random(wid);
mapx2[arr[1]][arr[0]] = 11;
mapx2[arr[1] + 1][arr[0]] = 11;
mapx2[arr[1] + 1][arr[0] + 1] = 11;
mapx2[arr[1]][arr[0] + 1] = 11;
mapx2[arr[1] + 1][arr[0] + 2] = 11;
mapx2[arr[1]][arr[0] + 2] = 11;
}
bylo = mapx2[arr[1]][arr[0]] > 9;
var s2x2 = (((map1[arr[1] + 1][arr[0]] == obj[i].type) && (map1[arr[1] + 1][arr[0] + 1] == obj[i].type)) && (map1[arr[1]][arr[0] + 1] == obj[i].type));
if (s2x2 && (!bylo)) {
var clip;
switch (obj[i].type) {
case 1 :
clip = kt10;
break;
case 101 :
clip = kt100;
}
var k = rocks.length;
duplicateMovieClip (clip, "kt10_" + k, this.getNextHighestDepth());
rocks[k] = eval ("kt10_" + k);
rocks[k]._x = obj[i].clip._x + random(wid);
rocks[k]._y = obj[i].clip._y + random(wid);
mapx2[arr[1]][arr[0]] = 10;
mapx2[arr[1] + 1][arr[0]] = 10;
mapx2[arr[1] + 1][arr[0] + 1] = 10;
mapx2[arr[1]][arr[0] + 1] = 10;
}
var s1x3 = ((map1[arr[1] + 1][arr[0]] == obj[i].type) && (map1[arr[1] + 2][arr[0]] == obj[i].type));
bylo = mapx2[arr[1]][arr[0]] > 9;
if (s1x3 && (!bylo)) {
var clip;
switch (obj[i].type) {
case 1 :
clip = kt13;
break;
case 101 :
clip = kt103;
}
var k = rocks.length;
duplicateMovieClip (clip, "kt13_" + k, this.getNextHighestDepth());
rocks[k] = eval ("kt13_" + k);
rocks[k]._x = obj[i].clip._x;
rocks[k]._y = obj[i].clip._y + random(wid * 2);
mapx2[arr[1]][arr[0]] = 13;
mapx2[arr[1] + 1][arr[0]] = 13;
mapx2[arr[1] + 2][arr[0]] = 13;
}
}
} else if (obj[i].type == 2) {
do {
var los = (random(obj[i].clip.n1._totalframes) + 1);
var onceAgain = false;
var j = 0;
while (j < 5) {
if (obj[(i - j) - 1].clip.n1._currentframe == los) {
onceAgain = true;
break;
}
j++;
}
} while (onceAgain == true);
obj[i].clip.n1.gotoAndStop(los);
}
i++;
}
var i = 0;
while (i < liany_obj.length) {
var arr = new Array();
arr = liany_obj[i].getWsp(mc_map._x, mc_map._y);
arr[0] = Math.floor(arr[0]);
arr[1] = Math.floor(arr[1]);
var r1 = (map_obj[arr[1]][arr[0] + 1].type == liany_obj[i].type);
var l1 = (map_obj[arr[1]][arr[0] - 1].type == liany_obj[i].type);
var u1 = (map_obj[arr[1] - 1][arr[0]].type == liany_obj[i].type);
var d1 = (map_obj[arr[1] + 1][arr[0]].type == liany_obj[i].type);
if ((!u1) && (!d1)) {
liany_obj[i].clip.gotoAndStop("single");
var counter = obj.length;
duplicateMovieClip (mc_liana, "mc_lianax" + counter, this.getNextHighestDepth());
var clip1 = eval ("mc_lianax" + counter);
clip1._visible = false;
obj[counter] = new Square(2, clip1, counter);
obj[counter].clip._x = mc_map._x + (arr[0] * wid);
obj[counter].clip._y = mc_map._y + (arr[1] * wid);
obj[counter].setWsp(arr[1], arr[0]);
map_obj[arr[1]][arr[0]].landing = true;
map1[arr[1] + 1][arr[0]] = "7";
} else if (u1 && (!d1)) {
liany_obj[i].clip.gotoAndStop("down");
} else if ((!u1) && (d1)) {
if (map_obj[arr[1] + 2][arr[0]].type == liany_obj[i].type) {
var counter = obj.length;
duplicateMovieClip (mc_liana, "mc_lianax" + counter, this.getNextHighestDepth());
var clip1 = eval ("mc_lianax" + counter);
clip1._visible = false;
obj[counter] = new Square(2, clip1, counter);
obj[counter].clip._x = mc_map._x + (arr[0] * wid);
obj[counter].clip._y = mc_map._y + (arr[1] * wid);
obj[counter].setWsp(arr[1], arr[0]);
liany_obj[i].clip.gotoAndStop("up");
map_obj[arr[1]][arr[0]].landing = true;
} else {
var counter = obj.length;
duplicateMovieClip (mc_liana, "mc_lianax" + counter, this.getNextHighestDepth());
var clip1 = eval ("mc_lianax" + counter);
clip1._visible = false;
obj[counter] = new Square(2, clip1, counter);
obj[counter].clip._x = mc_map._x + (arr[0] * wid);
obj[counter].clip._y = mc_map._y + (arr[1] * wid);
obj[counter].setWsp(arr[1], arr[0]);
liany_obj[i].clip.gotoAndStop("single");
map_obj[arr[1]][arr[0]].landing = true;
}
} else if (u1 && (d1)) {
liany_obj[i].clip.gotoAndStop("center");
}
i++;
}
var i = 0;
while (i < enemy_obj.length) {
enemy_obj[i].clip.swapDepths(this.getNextHighestDepth());
i++;
}
mc_exit1.cacheAsBitmap = true;
mc_hero1.swapDepths(this.getNextHighestDepth());
mc_wave.swapDepths(this.getNextHighestDepth());
mc_timer.swapDepths(this.getNextHighestDepth());
dodaj_maske(mc_wave);
createBitmap();
var my_time = 0;
oef.onEnterFrame = function () {
if (pauseOn == false) {
fpsCounter++;
mc_timer.v1 = numberToTime(fpsCounter / 25);
var _local1 = getTimer();
v1 = ((((((_local1 - my_time) + " en:") + enemy_obj.length) + " col:") + tab_col.length) + " cag:") + cages_number;
my_time = _local1;
checkKeys();
bulletFly2();
falls_all();
enemy_moves();
if ((a1.isClimbing == false) && (a1.onLiane == false)) {
xspeed = xspeed + (xdir * a1.getAccel());
xspeed = ((xspeed > a1.getSpeed()) ? (a1.getSpeed()) : (xspeed));
xspeed = ((xspeed < (-a1.getSpeed())) ? (-a1.getSpeed()) : (xspeed));
yspeed = yspeed + gravity;
if ((a1.atackType == "wave") && (lastHFrame == "air_atack")) {
a1.immortal = true;
yspeed = yspeed + 25;
}
yspeed = ((yspeed > 25) ? 25 : (yspeed));
mc_hero1._y = mc_hero1._y + yspeed;
if ((spadanie == true) && (yspeed > 5)) {
spadanie = false;
}
} else {
xspeed = 0;
yspeed = 0;
}
if (lastHFrame != "atack") {
if ((((lastHFrame == "land") || (lastHFrame == "air_atack")) && (a1.ground == true)) && ((a1.atackType == "shoot") || (a1.atackType == "whip"))) {
} else {
mc_hero1._x = mc_hero1._x + xspeed;
}
}
xspeed = xspeed * tarcie;
xspeed = ((Math.abs(xspeed) < 0.9) ? 0 : (xspeed));
if ((xspeed == 0) && (a1.ground == true)) {
heroFrame("no_move");
}
if ((xspeed != 0) && (a1.ground == true)) {
heroFrame("run");
}
deadCheck();
bulletFly();
checkCollect();
var _local2 = new Array();
_local2 = a1.getOldPosition();
landing();
fLiany();
if (mc_hero1._y != _local2[1]) {
a1.ground = false;
heroFrame("jump");
}
hitWall();
mc_hero1._x = ((mc_hero1._x < mc_map._x) ? (mc_map._x) : (mc_hero1._x));
mc_hero1._x = ((mc_hero1._x > ((mc_map._x + mc_map._width) - wid)) ? ((mc_map._x + mc_map._width) - wid) : (mc_hero1._x));
a1.setOldPosition(mc_hero._x, mc_hero1._y);
if (mc_hero1._y < (mc_map._y - 100)) {
mc_hero1._y = mc_map._y - 100;
yspeed = 0;
}
checkGate();
}
};
var ar1 = new Array();
var gg = 1;
mc_play_again.onPress = function () {
playSound(sClick);
clean();
gotoAndStop ("retry");
};
mc_back.onPress = function () {
playSound(sClick);
clean();
gotoAndStop ("c1");
};
var bWall = false;
var swordsCountAtack = 0;
btn_copy.onPress = function () {
playSound(sClick);
var _local3 = "";
_local3 = _local3 + (("bckFrame=" + bckFrame) + ";");
_local3 = _local3 + (("\nobjective='" + objective) + "';");
_local3 = _local3 + (("\nhero=" + hero) + ";");
_local3 = _local3 + "\nmap1=[";
var _local2 = 0;
while (_local2 < 13) {
_local3 = _local3 + "\n[";
var _local1 = 0;
while (_local1 < 20) {
if (map1[_local2][_local1] != 0) {
_local3 = _local3 + (("'" + map1[_local2][_local1]) + "'");
} else {
_local3 = _local3 + map1[_local2][_local1];
}
if (_local1 != 19) {
_local3 = _local3 + ",";
}
_local1++;
}
_local3 = _local3 + "],";
_local2++;
}
_local3 = _local3 + "];";
System.setClipboard(_local3);
};
var i = 0;
while (i < map_obj[0].length) {
dodaj_maske(map_obj[0][i].clip);
i++;
}
var i = 0;
while (i < map_obj[12].length) {
dodaj_maske(map_obj[12][i].clip);
i++;
}
var i = 0;
while (i < map_obj.length) {
dodaj_maske(map_obj[i][0].clip);
i++;
}
var i = 0;
while (i < map_obj.length) {
dodaj_maske(map_obj[i][19].clip);
i++;
}
b_help2.onPress = function () {
playSound(sClick);
mc_pop_help.gotoAndStop("hero" + hero);
mc_pop_help.swapDepths(this._parent.getNextHighestDepth());
mc_pop_help._visible = true;
pauseOn = true;
};
mc_pop_help.b_play.onPress = function () {
playSound(sClick);
mc_pop_help._visible = false;
pauseOn = false;
};
mc_brief.swapDepths(this.getNextHighestDepth());
mc_brief.gotoAndPlay(objective);
playSound(sNL);
Frame 1170
var i = 0;
while (i < fields.length) {
removeMovieClip(fields[i]);
i++;
}
trace("klatka_end");
clean();
Frame 1177
gotoAndPlay(nFrame);
Frame 1178
function sendToServer(_type) {
if (_type == "map") {
var _local1 = ";";
var _local2 = (((map_title1 + " ") + map_title2) + " ") + map_title3;
var _local4 = map1.join(",");
var _local3 = (((((((_local2 + _local1) + hero) + _local1) + bckFrame) + _local1) + objective) + _local1) + _local4;
send_lv.saveString = _local3;
send_lv.game_id = "5870";
send_lv.name = "";
send_lv.email = "";
send_lv.message = "";
send_lv.friendsEmail = "";
send_lv.sendAndLoad("http://ic.addictinggames.com/flash/send_vars.php", result_lv, "POST");
mc_popup.gotoAndStop("sending");
}
if (_type == "mail") {
var _local1 = ";";
var _local2 = (((map_title1 + " ") + map_title2) + " ") + map_title3;
var _local4 = map1.join(",");
var _local3 = (((((((_local2 + _local1) + hero) + _local1) + bckFrame) + _local1) + objective) + _local1) + _local4;
send_lv4.saveString = _local3;
send_lv4.game_id = "5870";
send_lv4.name = mc_popup.tfName.text;
send_lv4.email = mc_popup.tfMail.text;
send_lv4.message = mc_popup.tfMessage.text;
send_lv4.friendsEmail = mc_popup.tfFriendsMail.text;
send_lv4.sendAndLoad("http://ic.addictinggames.com/flash/send_vars.php", result_lv4, "POST");
mc_popup.gotoAndStop("sending2");
}
}
function formatuj(twoj_string) {
var _local1 = new Array();
_local1 = twoj_string.split("%3B").join(";");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%3C").join("<");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%3E").join(">");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%2F").join("/");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%20").join(" ");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%27").join("\"");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%3F").join("?");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%2E").join(".");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%2C").join(",");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%2D").join("-");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%5B").join("[");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%5D").join("]");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%5F").join("_");
twoj_string = _local1.toString();
_local1 = twoj_string.split("%3D").join("=");
twoj_string = _local1.toString();
return(twoj_string);
}
stop();
clean();
stopLoop("map");
curFrame = "c7";
b_next._visible = false;
b1.gotoAndStop(1);
b2.gotoAndStop(1);
b3.gotoAndStop(1);
b4.gotoAndStop(1);
b5.gotoAndStop(1);
b6.gotoAndStop(1);
b7.gotoAndStop(10);
b8.gotoAndStop(1);
var hash = "";
mc_pop.swapDepths(this.getNextHighestDepth());
var result_lv = new LoadVars();
var result_lv4 = new LoadVars();
result_lv.onLoad = function (success) {
mc_popup.b_send1.enabled = true;
if (success) {
var _local3 = result_lv.toString();
_local3 = formatuj(_local3);
var _local5 = new XML(_local3);
_local5.ignoreWhite = true;
var _local4 = _local5.childNodes[0].childNodes[0];
var _local2 = _local4.attributes.value.toString();
var _local6 = _local4.attributes.id.toString();
trace(_local2);
trace(_local6);
switch (_local2) {
case "success" :
hash = _local6;
mc_popup.gotoAndStop("level_sent");
mc_popup.vcode = hash;
var _local1 = 0;
while (_local1 < so2.data.codes.length) {
if (so2.data.codes[_local1] == str) {
so2.data.codes.splice(_local1, 1);
break;
}
_local1++;
}
so2.data.codes.reverse();
so2.data.codes.push(hash);
so2.data.codes.reverse();
break;
default :
mc_popup.gotoAndStop("error");
mc_popup.v1 = "Error " + _local2;
}
} else {
mc_popup.gotoAndStop("error");
mc_popup.v1 = "error connecting to server";
}
};
var send_lv = new LoadVars();
var send_lv4 = new LoadVars();
result_lv4.onLoad = function (success) {
mc_popup.b_send1.enabled = true;
if (success) {
var _local2 = result_lv.toString();
_local2 = formatuj(_local2);
var _local4 = new XML(_local2);
_local4.ignoreWhite = true;
var _local3 = _local4.childNodes[0].childNodes[0];
var _local1 = _local3.attributes.value.toString();
var _local5 = _local3.attributes.id.toString();
trace(_local1);
trace(_local5);
switch (_local1) {
case "success" :
hash = _local5;
mc_popup.gotoAndStop("mail_sent");
break;
default :
mc_popup.gotoAndStop("error");
mc_popup.v1 = "Error " + _local1;
}
} else {
mc_popup.gotoAndStop("error");
mc_popup.v1 = "error connecting to server";
}
};
mc_popup.b_send0.onPress = function () {
playSound(sClick);
mc_popup.gotoAndStop("sendFriend");
};
sendToServer("map");
Frame 1191
gotoAndPlay(nFrame);
Symbol 2043 MovieClip [__Packages.Hero] Frame 0
class Hero
{
var hType, clip, hSpeed, hAccel, hJump, hNJump, attackSpeed, atackType, attackRange, canClimb, power, bulletSpeed, bulletType, shootStartPoint, hOldX, hOldY;
function Hero (_type, _clip) {
hType = _type;
if (_clip) {
clip = _clip;
}
selectHero(_type);
clip.gotoAndStop(_type + 1);
}
function selectHero(_type) {
switch (_type) {
case WOLVERINE :
hSpeed = 5;
hAccel = 1;
hJump = 15;
hNJump = 0;
attackSpeed = 400;
atackType = "sword";
attackRange = 60;
attackSpeed = 500;
canClimb = false;
power = 10;
$direction = LEFT;
disabled = lockedHeroes[_type];
break;
case STORM :
hSpeed = 4;
hAccel = 1;
hJump = 24;
hNJump = 0;
attackSpeed = 600;
atackType = "storm";
attackRange = 320;
bulletSpeed = 15;
bulletType = "bullet_storm";
canClimb = false;
power = 6;
$direction = RIGHT;
shootStartPoint = {x:-14, y:3};
disabled = lockedHeroes[_type];
break;
case BEAST :
hSpeed = 5;
hAccel = 1;
hJump = 24;
hNJump = 0;
attackSpeed = 1000;
atackType = "wave";
attackRange = 125;
attackSpeed = 500;
canClimb = false;
power = 10;
$direction = RIGHT;
disabled = lockedHeroes[_type];
break;
case CYCLOPS :
hSpeed = 4;
hAccel = 1;
hJump = 19;
hNJump = 0;
attackSpeed = 1000;
atackType = "laser";
attackRange = 0;
bulletSpeed = 10;
power = 4;
$direction = LEFT;
disabled = lockedHeroes[_type];
break;
case ICEMAN :
hSpeed = 4;
hAccel = 1;
hJump = 19;
hNJump = 0;
attackSpeed = 600;
atackType = "shoot";
attackRange = 0;
bulletSpeed = 15;
bulletType = "bullet_ice_man";
canClimb = false;
power = 4;
$direction = LEFT;
shootStartPoint = {x:-14, y:3};
disabled = lockedHeroes[_type];
break;
case LOGAN :
hSpeed = 5;
hAccel = 1;
hJump = 15;
hNJump = 0;
atackType = "sword";
attackRange = 60;
attackSpeed = 500;
canClimb = false;
power = 10;
$direction = LEFT;
disabled = lockedHeroes[_type];
break;
case EMMAFROST :
hSpeed = 4;
hAccel = 1;
hJump = 19;
hNJump = 0;
attackSpeed = 600;
atackType = "frost";
attackRange = 0;
bulletSpeed = 15;
bulletType = "bullet_emma_frost";
canClimb = false;
power = 4;
$direction = RIGHT;
shootStartPoint = {x:-14, y:3};
disabled = lockedHeroes[_type];
break;
case SHADOWCAT :
hSpeed = 2;
hAccel = 1;
hJump = 19;
hNJump = 1;
atackType = "sword";
attackRange = 60;
attackSpeed = 500;
canClimb = false;
power = 8;
$direction = RIGHT;
disabled = lockedHeroes[_type];
break;
case NIGHTCRAWLER :
hSpeed = 4;
hAccel = 1;
hJump = 19;
hNJump = 1;
attackSpeed = 600;
atackType = "teleport";
attackRange = 212;
attackSpeed = 500;
canClimb = false;
power = 4;
$direction = LEFT;
disabled = lockedHeroes[_type];
}
}
function getSpeed() {
return(hSpeed);
}
function getAccel() {
return(hAccel);
}
function getJump() {
return(hJump);
}
function getNJump() {
return(hNJump);
}
function setOldPosition(oldX, oldY) {
hOldX = oldX;
hOldY = oldY;
}
function getOldPosition() {
var _local2 = new Array(hOldX, hOldY);
return(_local2);
}
function getWsp(start_x, start_y) {
var _local2 = new Array(2);
_local2[0] = Math.floor((10 * (clip._x - start_x)) / 31) / 10;
_local2[1] = Math.floor((10 * (clip._y - start_y)) / 31) / 10;
return(_local2);
}
function getDir() {
if (clip.n1._xscale == 100) {
return(1 * $direction);
}
return(-1 * $direction);
}
static function unlockHero(index) {
trace("unlock hero:" + index);
lockedHeroes[index] = false;
}
function get initialDirection() {
return($direction);
}
static function getHeroes() {
var _local2 = [];
var _local1 = 0;
while (_local1 < HEROES_NUMBER) {
_local2[_local1] = new Hero(_local1);
_local1++;
}
return(_local2);
}
static var WOLVERINE = 0;
static var STORM = 1;
static var BEAST = 2;
static var CYCLOPS = 3;
static var ICEMAN = 4;
static var LOGAN = 5;
static var EMMAFROST = 6;
static var SHADOWCAT = 7;
static var NIGHTCRAWLER = 8;
static var LEFT = -1;
static var RIGHT = 1;
var canShoot = true;
var isClimbing = false;
var onLiane = false;
static var lockedHeroes = [false, false, true, true, true, true, true, true, true, true];
var disabled = false;
var $direction = 1;
static var HEROES_NUMBER = 9;
var immortal = false;
var canGrab = true;
}
Symbol 2044 MovieClip [__Packages.Square] Frame 0
class Square
{
var clip, type, id, xpos, ypos, przenik, jumpFrom, notStable, canDestroy, pushable, collect, green, deadly, connected, liana, oldX, oldY;
function Square (_type, _clip, _id) {
clip = _clip;
type = _type;
id = _id;
setAtt(_type);
}
function setWsp(xpos, ypos) {
this.xpos = xpos;
this.ypos = ypos;
}
function getWsp(start_x, start_y) {
var _local2 = new Array(2);
_local2[0] = Math.floor((10 * (clip._x - start_x)) / 31) / 10;
_local2[1] = Math.floor((10 * (clip._y - start_y)) / 31) / 10;
return(_local2);
}
function setAtt(_type) {
switch (_type) {
case 1 :
przenik = false;
landing = true;
jumpFrom = true;
notStable = false;
canDestroy = false;
pushable = false;
collect = false;
green = true;
deadly = false;
connected = true;
liana = false;
ground = true;
break;
case 101 :
przenik = false;
landing = true;
jumpFrom = true;
notStable = false;
canDestroy = false;
pushable = false;
collect = false;
green = true;
deadly = false;
connected = true;
liana = false;
ground = true;
break;
case 2 :
przenik = true;
landing = true;
jumpFrom = true;
notStable = false;
canDestroy = false;
pushable = false;
collect = false;
green = false;
deadly = false;
connected = false;
liana = false;
ground = true;
break;
case 3 :
przenik = false;
landing = true;
jumpFrom = false;
notStable = false;
canDestroy = false;
pushable = false;
collect = false;
green = false;
deadly = false;
connected = true;
liana = false;
ground = true;
break;
case 4 :
przenik = true;
landing = true;
jumpFrom = true;
notStable = true;
canDestroy = false;
pushable = false;
collect = false;
green = false;
deadly = false;
connected = false;
liana = false;
ground = true;
break;
case 5 :
przenik = false;
landing = true;
jumpFrom = true;
notStable = false;
canDestroy = false;
pushable = true;
collect = false;
green = false;
deadly = false;
connected = false;
liana = false;
break;
case 6 :
przenik = false;
landing = true;
jumpFrom = true;
notStable = false;
canDestroy = true;
pushable = true;
collect = false;
green = false;
deadly = false;
connected = false;
liana = false;
break;
case 7 :
przenik = false;
landing = true;
jumpFrom = true;
notStable = false;
canDestroy = false;
pushable = false;
collect = false;
green = false;
deadly = true;
connected = true;
liana = false;
ground = true;
break;
case 8 :
przenik = true;
landing = false;
jumpFrom = false;
notStable = false;
canDestroy = false;
pushable = false;
collect = false;
green = false;
deadly = false;
connected = false;
liana = false;
ground = true;
break;
case 9 :
przenik = false;
landing = true;
jumpFrom = false;
notStable = false;
canDestroy = false;
pushable = false;
collect = false;
green = false;
deadly = false;
connected = false;
liana = false;
ground = true;
break;
case 11 :
przenik = true;
landing = false;
jumpFrom = true;
notStable = false;
canDestroy = false;
pushable = false;
collect = true;
green = false;
deadly = false;
connected = false;
liana = false;
ground = true;
break;
case 12 :
przenik = true;
landing = false;
jumpFrom = true;
notStable = false;
canDestroy = false;
pushable = false;
collect = false;
green = false;
deadly = false;
connected = false;
liana = true;
ground = true;
break;
case 13 :
przenik = false;
landing = true;
jumpFrom = false;
notStable = false;
canDestroy = false;
pushable = false;
collect = false;
green = false;
deadly = true;
connected = true;
liana = false;
ground = true;
break;
case 14 :
przenik = false;
landing = true;
jumpFrom = true;
notStable = false;
canDestroy = true;
pushable = true;
collect = false;
green = false;
deadly = false;
connected = false;
liana = false;
ground = true;
break;
case 15 :
przenik = false;
landing = true;
jumpFrom = true;
notStable = false;
canDestroy = false;
pushable = false;
collect = false;
green = false;
deadly = false;
connected = false;
liana = false;
ground = true;
}
}
function getID() {
return(id);
}
function setOldPosition(oldX, oldY) {
this.oldX = oldX;
this.oldY = oldY;
}
function getOldPosition() {
var _local2 = new Array(oldX, oldY);
return(_local2);
}
function getNewWsp(start_x, start_y, xx, yy) {
var _local1 = new Array(2);
_local1[0] = Math.floor((10 * (xx - start_x)) / 31) / 10;
_local1[1] = Math.floor((10 * (yy - start_y)) / 31) / 10;
return(_local1);
}
var t = "Square";
var landing = true;
var hiden = false;
var znikanie = false;
var yspeed = 0;
var ground = false;
}
Symbol 2045 MovieClip [__Packages.Enemy] Frame 0
class Enemy
{
var clip, type, id, bulletClip, xpos, ypos, xspeed, ysp, shooting, maxChilds, bulletSpeed, strength, cont, deadSound, hitClip;
function Enemy (_type, _clip, _id, _bulletClip) {
clip = _clip;
clip.enemy = this;
type = _type;
id = counter++;
setAtt(_type);
bulletClip = _bulletClip;
}
function setOldPosition(oldX, oldY) {
this.oldX = oldX;
this.oldY = oldY;
}
function getOldPosition() {
var _local2 = new Array(oldX, oldY);
return(_local2);
}
function setWsp(xpos, ypos) {
this.xpos = xpos;
this.ypos = ypos;
}
function getWsp(start_x, start_y) {
var _local2 = new Array(2);
_local2[0] = Math.floor((10 * (clip._x - start_x)) / 31) / 10;
_local2[1] = Math.floor((10 * (clip._y - start_y)) / 31) / 10;
return(_local2);
}
function setAtt(_type) {
switch (_type) {
case 0 :
mainEnemy = true;
walking = true;
xspeed = 2;
ysp = 0;
shooting = true;
maxChilds = 0;
bulletSpeed = 7;
disabled = lockedEnemies[_type];
strength = 4;
break;
case 1 :
walking = false;
xspeed = 0;
ysp = 0;
shooting = false;
maxChilds = 2;
break;
case 2 :
walking = false;
xspeed = 0;
ysp = 0;
shooting = true;
bulletSpeed = 7;
maxChilds = 0;
dir = (1);
break;
case 22 :
walking = false;
xspeed = 0;
ysp = 0;
shooting = true;
maxChilds = 0;
dir = (-1);
break;
case 3 :
walking = true;
xspeed = 0;
ysp = 2;
shooting = false;
maxChilds = 0;
break;
case 4 :
walking = true;
xspeed = 5;
ysp = 0;
shooting = false;
maxChilds = 0;
break;
case ROBOT :
walking = true;
xspeed = 7;
ysp = 0;
shooting = false;
maxChilds = 0;
xyDir = random(4);
break;
case MAGNETO :
mainEnemy = true;
walking = true;
xspeed = 3;
shooting = true;
maxChilds = 0;
disabled = lockedEnemies[_type];
strength = 10;
break;
case HULK :
mainEnemy = true;
walking = true;
xspeed = 3;
shooting = false;
maxChilds = 0;
disabled = lockedEnemies[_type];
strength = 15;
break;
case GAMBIT :
mainEnemy = true;
walking = true;
xspeed = 3;
shooting = true;
maxChilds = 0;
disabled = lockedEnemies[_type];
strength = 10;
break;
case SENTINEL :
disabled = lockedEnemies[_type];
mainEnemy = true;
multiple = false;
walking = false;
shooting = true;
maxChilds = 0;
disabled = lockedEnemies[_type];
strength = 4;
break;
case SENTINEL2 :
mainEnemy = true;
multiple = false;
walking = false;
shooting = true;
maxChilds = 0;
disabled = lockedEnemies[_type];
strength = 4;
direction = LEFT;
}
}
function dead(_id) {
clip.gotoAndPlay("dead");
clip.n1._xscale = dir * Math.abs(clip.n1._xscale);
owner.childs--;
if (type == 4) {
cont.spidersCount--;
}
cont.stopID(id);
if ((owner != null) && (owner.childs == (owner.maxChilds - 1))) {
cont.stopID(owner.id);
cont.startID(owner.id);
}
cont.playSound(deadSound);
}
function hit(power) {
if (hitAnimation) {
return(false);
}
if (strength && ((strength - power) > 0)) {
strength = strength - power;
clip.gotoAndPlay("hit");
hitAnimation = true;
return(false);
}
strength = 0;
return(true);
}
function hitOver() {
hitAnimation = false;
if (isShooting) {
clip.gotoAndStop("atack");
} else if (walking) {
clip.gotoAndStop("walk");
} else {
clip.gotoAndStop("stand");
}
}
function getID() {
return(id);
}
function getNewWsp(start_x, start_y, xx, yy) {
var _local1 = new Array(2);
_local1[0] = Math.floor((10 * (xx - start_x)) / 31) / 10;
_local1[1] = Math.floor((10 * (yy - start_y)) / 31) / 10;
return(_local1);
}
function setCont(_cont) {
cont = _cont;
}
function get dir() {
if (clip) {
return(((clip._xscale > 0) ? ($dir * direction) : ((-$dir) * direction)));
}
return($dir);
}
function set dir(param) {
$dir = param;
//return(dir);
}
function dirPlus() {
xyDir++;
xyDir = xyDir % 4;
}
static function unlockEnemy(index) {
trace("unlock enemy:" + index);
lockedEnemies[index] = false;
}
static function getEnemies() {
var _local2;
var _local3 = [];
var _local1 = 0;
while (_local1 < ENEMIES_NUMBER) {
_local2 = new Enemy(_local1);
if (_local2.mainEnemy) {
_local3.push(_local2);
}
_local1++;
}
return(_local3);
}
function setHitClip(_hitClip) {
hitClip = _hitClip;
}
static var RIGHT = 1;
static var LEFT = -1;
static var MRD = 0;
static var ROBOT = 5;
static var MAGNETO = 6;
static var HULK = 7;
static var GAMBIT = 8;
static var SENTINEL = 9;
static var SENTINEL2 = 10;
static var counter = 0;
var t = "Enemy";
var walking = true;
var yspeed = 0;
var oldX = -10;
var oldY = -10;
var $dir = 1;
var ydir = 1;
var ydif = 0;
var canDestroy = true;
var xyDir = -1;
var isShooting = false;
var owner = null;
var childs = 0;
var hitAnimation = false;
var multiple = false;
var mainEnemy = false;
var disabled = false;
var direction = RIGHT;
static var lockedEnemies = [false, false, false, false, false, false, false, true, true, true, true];
static var ENEMIES_NUMBER = 11;
}
Symbol 2046 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 2047 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 2048 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 2049 MovieClip [__Packages.Bullet] Frame 0
class Bullet
{
var id, speed, dir, range, clip, xpos, ypos, xpos0, ypos0, hitClip, deadSound;
function Bullet (_speed, _dir, _range, _clip, _xpos, _ypos, _hitClip, _deadSound) {
id = counter++;
speed = _speed;
dir = _dir;
range = _range;
clip = _clip;
xpos = _xpos;
ypos = _ypos;
xpos0 = _xpos;
ypos0 = _ypos;
hitClip = _hitClip;
deadSound = _deadSound;
}
function getWsp(start_x, start_y) {
var _local2 = new Array(2);
_local2[0] = Math.floor((10 * (clip._x - start_x)) / 31) / 10;
_local2[1] = Math.floor((10 * (clip._y - start_y)) / 31) / 10;
return(_local2);
}
static var counter = 0;
}
Symbol 48 Button
on (press) {
tfCode.text = _parent.so2.data.codes[_parent.cPointer];
_parent.cPointer++;
if (_parent.cPointer > (_parent.so2.data.codes.length - 1)) {
_parent.cPointer = _parent.so2.data.codes.length - 1;
}
}
Symbol 51 Button
on (press) {
_parent.cPointer = 0;
_parent.sendToServer2(tfCode.text);
}
Symbol 62 MovieClip Frame 1
function startSound() {
snd = new Sound(this);
snd.attachSound("start");
snd.start();
snd.onSoundComplete = function () {
snd.start();
};
}
function stopSound() {
snd.stop();
snd.onSoundComplete = null;
snd = null;
}
stop();
var snd = null;
startSound();
Symbol 77 MovieClip Frame 1
tf.text = "MUSIC OFF";
this.onPress = function () {
if (_parent.mc_loop2.snd) {
_parent.mc_loop2.stopSound();
tf.text = "MUSIC ON";
} else {
_parent.mc_loop2.startSound();
tf.text = "MUSIC OFF";
}
};
this.onRollOver = function () {
gotoAndStop (3);
};
this.onRollOut = function () {
gotoAndStop (2);
};
Symbol 77 MovieClip Frame 2
stop();
Symbol 78 Button
on (press) {
playSound(sMHI);
removeMovieClip(mc_popHelp);
duplicateMovieClip (mc_popHelp0, "mc_popHelp", this.getNextHighestDepth());
mc_popHelp.gotoAndStop(1);
mc_popHelp._visible = true;
}
Symbol 79 Button
on (press) {
playSound(sClick);
gameMode = "EDIT";
nFrame = "c1";
url_id - null;
gotoAndPlay(curFrame + "_end");
}
Symbol 115 MovieClip Frame 91
stop();
Symbol 150 MovieClip Frame 76
stop();
Symbol 152 MovieClip Frame 91
stop();
Symbol 154 MovieClip Frame 43
stop();
Symbol 156 MovieClip Frame 35
stop();
Symbol 159 MovieClip Frame 23
stop();
Symbol 161 MovieClip Frame 21
stop();
Symbol 166 Button
on (press) {
_parent.playSound(_parent.sClick);
_parent.gameMode = "EDIT";
_parent.mc_cloud._visible = false;
this._parent.nFrame = "c1";
this._parent.gotoAndPlay("startowa_end");
}
on (rollOver) {
_parent.roll("build", btn_build);
}
on (rollOut) {
_parent.out();
}
Symbol 167 MovieClip Frame 48
if ((_parent.url_id != null) && (_parent.url_id != undefined)) {
gotoAndStop (58);
btn_build._visible = false;
} else {
btn_build._visible = true;
}
Symbol 167 MovieClip Frame 58
stop();
Symbol 170 Button
on (press) {
mc_credits._visible = true;
playSound(sClick);
}
Symbol 174 Button
on (press) {
this._visible = false;
_parent.playSound(_parent.sMHO);
}
Symbol 241 MovieClip Frame 1
stop();
Symbol 255 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 260 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 265 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 272 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 279 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 286 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 293 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 304 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 309 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 314 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 319 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 324 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 329 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 336 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 341 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 346 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 347 MovieClip Frame 1
stop();
Symbol 347 MovieClip Frame 2
stop();
Symbol 352 MovieClip Frame 1
stop();
Symbol 360 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 363 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 366 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 373 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 380 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 383 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 386 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 393 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 398 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 403 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 408 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 411 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 414 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 419 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 426 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 429 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 430 MovieClip Frame 1
stop();
Symbol 430 MovieClip Frame 2
stop();
Symbol 433 MovieClip Frame 1
stop();
Symbol 433 MovieClip Frame 20
stop();
Symbol 469 MovieClip Frame 9
stop();
Symbol 470 MovieClip Frame 1
stop();
Symbol 470 MovieClip Frame 17
stop();
Symbol 474 MovieClip Frame 112
var rc = this._parent._parent._parent;
if (this._parent._parent != rc.mc_diamond) {
var dlugosc = rc.tab_col.length;
var los = random(1000);
if (los < (200 / dlugosc)) {
rc.playSound(rc.sBD);
}
}
Symbol 478 MovieClip Frame 1
stop();
Symbol 478 MovieClip Frame 10
stop();
removeMovieClip(this);
Symbol 483 MovieClip Frame 1
stop();
Symbol 483 MovieClip Frame 15
stop();
removeMovieClip(this);
Symbol 485 MovieClip Frame 1
stop();
Symbol 485 MovieClip Frame 48
stop();
Symbol 488 MovieClip Frame 1
stop();
Symbol 488 MovieClip Frame 21
stop();
Symbol 489 MovieClip Frame 1
stop();
Symbol 489 MovieClip Frame 21
stop();
Symbol 508 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 513 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 518 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 525 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 532 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 539 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 546 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 579 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 584 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 589 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 596 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 603 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 610 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 615 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 622 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 627 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 628 MovieClip Frame 2
stop();
Symbol 653 MovieClip Frame 1
var rs = this._parent._parent._parent;
if (this != rs.mc_sadzawka.staw.mc_rybka) {
rs.playSound(rs.sP_S);
}
Symbol 653 MovieClip Frame 23
Symbol 674 MovieClip Frame 1
stop();
Symbol 686 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 689 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 692 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 699 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 706 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 711 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 716 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 729 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 734 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 739 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 746 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 749 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 752 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 757 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 762 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 765 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 766 MovieClip Frame 1
stop();
Symbol 766 MovieClip Frame 2
stop();
Symbol 781 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 790 MovieClip Frame 1
stop();
Symbol 795 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 798 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 805 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 812 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 815 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 818 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 825 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 830 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 835 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 842 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 845 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 848 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 853 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 860 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 863 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 864 MovieClip Frame 1
stop();
Symbol 864 MovieClip Frame 2
stop();
Symbol 867 MovieClip Frame 1
stop();
Symbol 869 MovieClip Frame 1
stop();
Symbol 884 MovieClip Frame 20
_parent._parent._parent.frameToStay = 1;
Symbol 886 MovieClip Frame 1
gotoAndPlay (8);
Symbol 886 MovieClip Frame 29
gotoAndPlay ("run");
Symbol 886 MovieClip Frame 56
stop();
Symbol 888 MovieClip Frame 20
gotoAndPlay ("fly");
Symbol 889 MovieClip Frame 1
gotoAndPlay (9);
Symbol 889 MovieClip Frame 12
this._parent._parent._parent.canRun = true;
Symbol 889 MovieClip Frame 24
_parent.gotoAndStop("no_move1");
Symbol 897 MovieClip Frame 16
this._parent._parent._parent.swordAtack(0);
Symbol 897 MovieClip Frame 29
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.canRun = true;
Symbol 898 MovieClip Frame 1
gotoAndPlay (13);
Symbol 898 MovieClip Frame 23
this._parent._parent._parent.swordAtack(0);
Symbol 898 MovieClip Frame 39
this._parent._parent._parent.attacking = false;
Symbol 901 MovieClip Frame 20
stop();
Symbol 902 MovieClip Frame 1
stop();
Symbol 921 MovieClip Frame 21
_parent._parent._parent.frameToStay = 1;
Symbol 922 MovieClip Frame 25
gotoAndPlay ("run");
Symbol 923 MovieClip Frame 18
gotoAndPlay ("fly");
Symbol 924 MovieClip Frame 7
stop();
this._parent._parent._parent.canRun = true;
Symbol 925 MovieClip Frame 17
this._parent._parent._parent.gunShoot();
Symbol 925 MovieClip Frame 35
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.canRun = true;
Symbol 926 MovieClip Frame 1
gotoAndPlay (9);
Symbol 926 MovieClip Frame 20
this._parent._parent._parent.gunShoot();
Symbol 926 MovieClip Frame 38
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.canRun = true;
Symbol 928 MovieClip Frame 20
stop();
Symbol 929 MovieClip Frame 1
stop();
Symbol 944 MovieClip Frame 30
_parent._parent._parent.frameToStay = 1;
Symbol 946 MovieClip Frame 1
gotoAndPlay (8);
Symbol 946 MovieClip Frame 24
gotoAndPlay ("run");
Symbol 946 MovieClip Frame 43
stop();
Symbol 947 MovieClip Frame 18
stop();
Symbol 948 MovieClip Frame 1
gotoAndPlay (11);
Symbol 948 MovieClip Frame 14
this._parent._parent._parent.canRun = true;
Symbol 948 MovieClip Frame 25
stop();
Symbol 949 MovieClip Frame 12
this._parent._parent._parent.waveAttack();
Symbol 949 MovieClip Frame 23
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.canRun = true;
Symbol 950 MovieClip Frame 51
this._parent._parent._parent.attacking = false;
Symbol 952 MovieClip Frame 22
stop();
Symbol 953 MovieClip Frame 1
stop();
Symbol 971 MovieClip Frame 39
_parent._parent._parent.frameToStay = 1;
Symbol 972 MovieClip Frame 1
gotoAndPlay (4);
Symbol 972 MovieClip Frame 28
gotoAndPlay ("run");
Symbol 973 MovieClip Frame 21
gotoAndPlay ("fly");
Symbol 974 MovieClip Frame 1
gotoAndPlay (4);
Symbol 974 MovieClip Frame 6
this._parent._parent._parent.canRun = true;
Symbol 974 MovieClip Frame 16
_parent.gotoAndStop("no_move1");
Symbol 980 MovieClip Frame 16
this._parent._parent._parent.laserAttack(laserBeam);
Symbol 980 MovieClip Frame 23
gotoAndPlay ("laser_stop");
Symbol 980 MovieClip Frame 50
Symbol 980 MovieClip Frame 59
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.canRun = true;
Symbol 981 MovieClip Frame 1
gotoAndPlay (11);
Symbol 981 MovieClip Frame 17
this._parent._parent._parent.laserAttack(laserBeam);
Symbol 981 MovieClip Frame 23
this._parent._parent._parent.laserBeam.removeMovieClip();
Symbol 981 MovieClip Frame 27
gotoAndPlay ("laser_stop");
Symbol 981 MovieClip Frame 53
this._parent._parent._parent.canRun = true;
this._parent._parent._parent.attacking = false;
Symbol 983 MovieClip Frame 32
stop();
Symbol 984 MovieClip Frame 1
stop();
Symbol 1000 MovieClip Frame 19
_parent._parent._parent.frameToStay = 1;
Symbol 1001 MovieClip Frame 1
gotoAndPlay (3);
Symbol 1001 MovieClip Frame 23
gotoAndPlay ("run");
Symbol 1005 MovieClip Frame 18
gotoAndPlay ("fly");
Symbol 1006 MovieClip Frame 6
stop();
this._parent._parent._parent.canRun = true;
Symbol 1008 MovieClip Frame 7
this._parent._parent._parent.gunShoot();
Symbol 1008 MovieClip Frame 17
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.canRun = true;
Symbol 1009 MovieClip Frame 1
gotoAndPlay (1);
Symbol 1009 MovieClip Frame 26
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.swordAtack();
Symbol 1012 MovieClip Frame 28
stop();
Symbol 1013 MovieClip Frame 1
stop();
Symbol 1027 MovieClip Frame 19
_parent._parent._parent.frameToStay = 1;
Symbol 1028 MovieClip Frame 1
gotoAndPlay (8);
Symbol 1028 MovieClip Frame 29
gotoAndPlay ("run");
Symbol 1028 MovieClip Frame 45
_parent.gotoAndStop("no_move");
Symbol 1030 MovieClip Frame 1
gotoAndPlay (6);
Symbol 1030 MovieClip Frame 20
gotoAndPlay ("fly");
Symbol 1031 MovieClip Frame 1
gotoAndPlay (10);
Symbol 1031 MovieClip Frame 13
this._parent._parent._parent.canRun = true;
Symbol 1031 MovieClip Frame 25
_parent.gotoAndStop("no_move");
Symbol 1037 MovieClip Frame 15
this._parent._parent._parent.swordAtack(0);
Symbol 1037 MovieClip Frame 25
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.canRun = true;
Symbol 1037 MovieClip Frame 29
_parent.gotoAndStop("no_move1");
Symbol 1039 MovieClip Frame 1
gotoAndPlay (17);
Symbol 1039 MovieClip Frame 22
this._parent._parent._parent.swordAtack(0);
Symbol 1039 MovieClip Frame 39
this._parent._parent._parent.attacking = false;
Symbol 1042 MovieClip Frame 20
stop();
Symbol 1043 MovieClip Frame 1
stop();
Symbol 1064 MovieClip Frame 21
_parent._parent._parent.frameToStay = 1;
Symbol 1065 MovieClip Frame 25
gotoAndPlay ("run");
Symbol 1066 MovieClip Frame 18
gotoAndPlay ("fly");
Symbol 1067 MovieClip Frame 7
stop();
this._parent._parent._parent.canRun = true;
Symbol 1069 MovieClip Frame 14
this._parent._parent._parent.gunShoot(1);
this._parent._parent._parent.gunShoot(-1);
Symbol 1069 MovieClip Frame 32
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.canRun = true;
Symbol 1070 MovieClip Frame 1
gotoAndPlay (7);
Symbol 1070 MovieClip Frame 21
this._parent._parent._parent.gunShoot(1);
this._parent._parent._parent.gunShoot(-1);
Symbol 1070 MovieClip Frame 39
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.canRun = true;
Symbol 1072 MovieClip Frame 20
stop();
Symbol 1073 MovieClip Frame 1
stop();
Symbol 1085 MovieClip Frame 19
_parent._parent._parent.frameToStay = 1;
Symbol 1086 MovieClip Frame 1
gotoAndPlay (4);
Symbol 1086 MovieClip Frame 31
gotoAndPlay ("run");
Symbol 1086 MovieClip Frame 45
_parent.gotoAndStop("no_move");
Symbol 1087 MovieClip Frame 1
Symbol 1087 MovieClip Frame 14
gotoAndPlay ("fly");
Symbol 1088 MovieClip Frame 1
gotoAndPlay (9);
Symbol 1088 MovieClip Frame 12
this._parent._parent._parent.canRun = true;
Symbol 1088 MovieClip Frame 14
_parent.gotoAndStop("no_move");
Symbol 1089 MovieClip Frame 10
this._parent._parent._parent.swordAtack(0);
Symbol 1089 MovieClip Frame 17
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.canRun = true;
Symbol 1089 MovieClip Frame 19
_parent.gotoAndStop("no_move1");
Symbol 1090 MovieClip Frame 1
gotoAndPlay (10);
Symbol 1090 MovieClip Frame 15
this._parent._parent._parent.swordAtack(0);
Symbol 1090 MovieClip Frame 19
this._parent._parent._parent.attacking = false;
Symbol 1092 MovieClip Frame 19
stop();
Symbol 1093 MovieClip Frame 1
stop();
Symbol 1110 MovieClip Frame 20
_parent._parent._parent.frameToStay = 1;
Symbol 1127 MovieClip Frame 23
gotoAndPlay ("run");
Symbol 1131 MovieClip Frame 18
gotoAndPlay ("fly");
Symbol 1132 MovieClip Frame 6
stop();
this._parent._parent._parent.canRun = true;
this._parent._parent._parent.attacking = false;
Symbol 1133 MovieClip Frame 5
gotoAndPlay (16);
Symbol 1133 MovieClip Frame 16
this._parent._parent._parent.teleportAttack();
Symbol 1133 MovieClip Frame 26
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.canRun = true;
Symbol 1134 MovieClip Frame 1
gotoAndPlay (9);
Symbol 1134 MovieClip Frame 16
this._parent._parent._parent.teleportAttack();
Symbol 1134 MovieClip Frame 26
this._parent._parent._parent.attacking = false;
this._parent._parent._parent.canRun = true;
Symbol 1137 MovieClip Frame 28
stop();
Symbol 1138 MovieClip Frame 1
stop();
Symbol 1139 MovieClip Frame 1
stop();
Symbol 1146 MovieClip Frame 8
stop();
Symbol 1147 MovieClip Frame 1
stop();
Symbol 1147 MovieClip Frame 12
stop();
Symbol 1204 MovieClip Frame 1
stop();
Symbol 1205 MovieClip Frame 1
stop();
Symbol 1206 MovieClip Frame 1
stop();
Symbol 1208 MovieClip Frame 1
stop();
Symbol 1217 Button
on (press) {
_parent.playSound(_parent.sMHO);
removeMovieClip(this);
}
Symbol 1227 MovieClip Frame 1
stop();
var actFrame = 0;
v1 = (actFrame + 1) + " / 3";
b_next.onPress = function () {
this._parent._parent.playSound(this._parent._parent.sClick);
actFrame++;
actFrame = actFrame % 3;
v1 = (actFrame + 1) + " / 3";
gotoAndStop("frame" + (actFrame + 1));
};
b_back.onPress = function () {
this._parent._parent.playSound(this._parent._parent.sClick);
actFrame--;
actFrame = ((actFrame < 0) ? 2 : (actFrame));
v1 = (actFrame + 1) + " / 3";
this._parent.gotoAndStop("frame" + (actFrame + 1));
};
Symbol 1249 MovieClip Frame 1
stop();
Symbol 1256 Button
on (press) {
_parent.nFrame = "c1";
_parent.playSound(_parent.sClick);
this._visible = false;
_parent.gotoAndPlay(_parent.curFrame + "_end");
}
Symbol 1259 Button
on (press) {
_parent.playSound(_parent.sClick);
this._visible = false;
}
Symbol 1269 MovieClip Frame 23
stop();
Symbol 1297 Button
on (press) {
mc_pop._visible = false;
playSound(sClick);
nFrame = "unlock";
gotoAndPlay ("unlock_start");
}
Symbol 1310 MovieClip Frame 1
stop();
Symbol 1313 MovieClip Frame 1
stop();
Symbol 1316 MovieClip Frame 1
stop();
Symbol 1319 MovieClip Frame 1
stop();
Symbol 1320 Button
on (press) {
playSound(sClick);
if (curFrame == "game") {
clean();
nFrame = "c8";
play();
} else if (nFrame == "game") {
trace("xxxxxxasfafas");
clean();
nFrame = "c8";
gotoAndPlay ("c8_end");
} else {
var i = 0;
while (i < tab_frames.length) {
if (tab_frames[i] == curFrame) {
nFrame = tab_frames[i - 1];
}
i++;
}
if (curFrame != "c2") {
gotoAndPlay(curFrame + "_end");
} else {
mc_pop_warning1._visible = true;
}
}
}
Symbol 1323 MovieClip Frame 1
stop();
Symbol 1328 MovieClip Frame 1
stop();
Symbol 1329 Button
on (press) {
playSound(sClick);
if (nFrame == "game") {
clean();
}
var i = 0;
while (i < tab_frames.length) {
if (tab_frames[i] == curFrame) {
nFrame = tab_frames[i + 1];
}
i++;
}
gotoAndPlay(curFrame + "_end");
}
Symbol 1333 MovieClip Frame 1
stop();
Symbol 1333 MovieClip Frame 10
stop();
Symbol 1337 MovieClip Frame 1
stop();
Symbol 1341 Button
on (press) {
_parent.enterCode(tfCode.text);
}
Symbol 1346 Button
on (press) {
this._visible = false;
_parent._parent.playSound(_parent.sMHO);
}
Symbol 1352 Button
on (press) {
this._visible = false;
_parent._parent.playSound(_parent.sMHO);
}
Symbol 1359 Button
on (press) {
gotoAndStop (1);
_parent.playSound(_parent.sMHO);
}
Symbol 1378 MovieClip Frame 1
function checkCode(code, arr) {
var _local1 = 0;
while (_local1 < arr.length) {
if (code == arr[_local1][0]) {
trace("znalazlem kod:" + code);
return(_local1);
}
_local1++;
}
return(-1);
}
function enterCode(code) {
code = code.toUpperCase();
trace("enterCode:" + code);
var _local1 = checkCode(code, heroesCodes);
if (_local1 != -1) {
trace((heroesCodes[_local1][2] + ", ") + Hero.lockedHeroes[heroesCodes[_local1][2]]);
if (Hero.lockedHeroes[heroesCodes[_local1][2]]) {
gotoAndStop(heroesCodes[_local1][1]);
Hero.unlockHero(heroesCodes[_local1][2]);
}
return(undefined);
}
_local1 = checkCode(code, enemiesCodes);
if (_local1 != -1) {
if (Enemy.lockedEnemies[enemiesCodes[_local1][2]]) {
gotoAndStop(enemiesCodes[_local1][1]);
Enemy.unlockEnemy(enemiesCodes[_local1][2]);
if (enemiesCodes[_local1][2] == Enemy.SENTINEL) {
Enemy.unlockEnemy(Enemy.SENTINEL2);
}
}
return(undefined);
}
if (code == "CEREBRO") {
if (Enemy.lockedEnemies[Enemy.HULK] && (Hero.lockedHeroes[Hero.ICEMAN])) {
Hero.unlockHero(Hero.ICEMAN);
Enemy.unlockEnemy(Enemy.HULK);
gotoAndStop ("cerebro");
}
return(undefined);
}
unlock_fail._visible = true;
}
stop();
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (Key.isDown(13)) {
enterCode(mc_code.tfCode.text);
}
};
Key.addListener(keyListener);
var heroesCodes = [["TRUEBLUE", "beast", Hero.BEAST], ["HEARTBREAK", "cyclops", Hero.CYCLOPS], ["REVELATION", "emmafrost", Hero.EMMAFROST], ["QUICKWIT", "shadowcat", Hero.SHADOWCAT], ["HUNTED", "nightcrawler", Hero.NIGHTCRAWLER], ["HISTORY", "logan", Hero.LOGAN]];
var enemiesCodes = [["DOUBLECROSS", "gambit", Enemy.GAMBIT], ["MAGNETO", "magneto", Enemy.MAGNETO], ["FARFROMHOME", "colossus", 2], ["TRASK", "sentinel", Enemy.SENTINEL]];
unlock_fail._visible = false;
Symbol 1387 MovieClip Frame 60
stop();
Symbol 1393 MovieClip Frame 60
stop();
Symbol 1410 MovieClip Frame 1
stop();
disabled_sign._visible = false;
Symbol 1437 MovieClip Frame 1
stop();
Symbol 1492 MovieClip Frame 1
stop();
Symbol 1507 Button
on (press) {
this._visible = false;
}
Symbol 1510 MovieClip Frame 1
stop();
b_ok._visible = false;
b_yes._visible = true;
b_no._visible = true;
Symbol 1510 MovieClip Frame 10
b_ok._visible = true;
b_yes._visible = false;
b_no._visible = false;
Symbol 1511 MovieClip Frame 1
stop();
Symbol 1617 MovieClip Frame 26
bCopy.onPress = function () {
var _local2 = this._parent._parent;
_local2.playSound(_local2.sClick);
System.setClipboard(tfCode.text);
};
bDone.onPress = function () {
var _local2 = this._parent._parent;
_local2.playSound(_local2.sClick);
_local2.nFrame = "c6";
_local2.gotoAndPlay("c7_end");
};
bShare.onPress = function () {
var _local2 = this._parent._parent;
_local2.playSound(_local2.sClick);
gotoAndStop ("sendFriend");
};
Symbol 1617 MovieClip Frame 60
b_send1.onPress = function () {
var _local3 = this._parent._parent;
_local3.playSound(_local3.sClick);
_parent.sendToServer("mail");
};
bDone.onPress = function () {
var _local2 = this._parent._parent;
_local2.playSound(_local2.sClick);
_local2.nFrame = "c6";
_local2.gotoAndPlay("c7_end");
};
Symbol 1617 MovieClip Frame 71
bDone.onPress = function () {
var _local2 = this._parent._parent;
_local2.playSound(_local2.sClick);
_local2.nFrame = "c6";
_local2.gotoAndPlay("c7_end");
};
Symbol 1617 MovieClip Frame 81
bDone.onPress = function () {
var _local2 = this._parent._parent;
_local2.playSound(_local2.sClick);
_local2.nFrame = "c6";
_local2.gotoAndPlay("c7_end");
};
Symbol 1788 MovieClip Frame 10
var sc = _parent._parent.n1._xscale;
_parent._parent.gotoAndStop("stand");
Symbol 1790 MovieClip Frame 12
stop();
Symbol 1792 MovieClip Frame 1
stop();
Symbol 1792 MovieClip Frame 45
stop();
Symbol 1801 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 1816 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 1824 MovieClip Frame 1
stop();
this.gotoAndStop(random(this._totalframes) + 1);
Symbol 1827 MovieClip Frame 1
stop();
Symbol 1827 MovieClip Frame 29
gotoAndPlay (1);
Symbol 1827 MovieClip Frame 39
stop();
Symbol 1855 MovieClip Frame 14
stop();
Symbol 1856 MovieClip Frame 1
stop();
Symbol 1856 MovieClip Frame 25
stop();
Symbol 1858 MovieClip Frame 6
stop();
Symbol 1893 MovieClip Frame 1
stop();
Symbol 1893 MovieClip Frame 51
stop();
Symbol 1926 MovieClip Frame 1
mc_krysztal.gotoAndPlay(1);
Symbol 1926 MovieClip Frame 11
this._parent.wallUp();
Symbol 1926 MovieClip Frame 61
this._parent.wallDown();
Symbol 1928 MovieClip Frame 1
_parent.waveAtack(1, _parent.dirAtack);
Symbol 1928 MovieClip Frame 2
_parent.waveAtack(2, _parent.dirAtack);
Symbol 1928 MovieClip Frame 3
_parent.waveAtack(3, _parent.dirAtack);
Symbol 1928 MovieClip Frame 5
_parent.waveAtack(4, _parent.dirAtack);
Symbol 1928 MovieClip Frame 7
_parent.waveAtack(5, _parent.dirAtack);
Symbol 1928 MovieClip Frame 14
this._visible = false;
_parent.secondWave = true;
Symbol 1928 MovieClip Frame 15
stop();
Symbol 1932 MovieClip Frame 25
gotoAndPlay ("storm");
Symbol 1934 MovieClip Frame 37
gotoAndPlay ("walk");
Symbol 1934 MovieClip Frame 51
_parent.gotoAndStop("stand");
Symbol 1935 MovieClip Frame 11
_parent._parent.shoot(_parent.enemy);
Symbol 1935 MovieClip Frame 13
_parent._parent.shoot(_parent.enemy);
Symbol 1935 MovieClip Frame 15
_parent._parent.shoot(_parent.enemy);
Symbol 1935 MovieClip Frame 25
trace((_parent.enemy.isShooting + ", ") + _parent.enemy);
_parent.enemy.isShooting = false;
Symbol 1936 MovieClip Frame 21
stop();
Symbol 1937 MovieClip Frame 1
stop();
Symbol 1937 MovieClip Frame 49
enemy.hitOver();
Symbol 1937 MovieClip Frame 71
stop();
Symbol 1940 MovieClip Frame 1
stop();
Symbol 1940 MovieClip Frame 20
stop();
Symbol 1947 MovieClip Frame 1
stop();
Symbol 1947 MovieClip Frame 38
stop();
Symbol 1953 MovieClip Frame 6
stop();
Symbol 1955 MovieClip Frame 46
gotoAndPlay ("walk");
Symbol 1956 MovieClip Frame 21
_parent._parent.shoot(_parent.enemy);
Symbol 1956 MovieClip Frame 30
_parent.enemy.isShooting = false;
Symbol 1957 MovieClip Frame 27
stop();
Symbol 1958 MovieClip Frame 1
stop();
Symbol 1958 MovieClip Frame 44
enemy.hitOver();
Symbol 1958 MovieClip Frame 72
stop();
Symbol 1960 MovieClip Frame 37
gotoAndPlay ("walk");
Symbol 1960 MovieClip Frame 47
gotoAndPlay ("walk");
Symbol 1961 MovieClip Frame 6
_parent._parent.shoot(_parent.enemy);
Symbol 1961 MovieClip Frame 20
_parent.enemy.isShooting = false;
Symbol 1962 MovieClip Frame 22
stop();
Symbol 1963 MovieClip Frame 1
stop();
Symbol 1963 MovieClip Frame 44
enemy.hitOver();
Symbol 1963 MovieClip Frame 68
stop();
Symbol 1980 MovieClip Frame 8
stop();
Symbol 1987 MovieClip Frame 51
gotoAndPlay ("walk");
Symbol 1988 MovieClip Frame 1
_parent.enemy.isShooting = true;
Symbol 1988 MovieClip Frame 7
_parent._parent.enemyAttack(_parent.enemy);
Symbol 1988 MovieClip Frame 14
_parent.enemy.isShooting = false;
Symbol 1989 MovieClip Frame 21
stop();
Symbol 1990 MovieClip Frame 1
stop();
Symbol 1990 MovieClip Frame 44
enemy.hitOver();
Symbol 1990 MovieClip Frame 67
stop();
Symbol 2005 Button
on (press) {
this._visible = false;
}
Symbol 2020 MovieClip Frame 1
stop();
Symbol 2022 Button
on (press) {
_parent.playSound(_parent.sClick);
_parent.nFrame = "game";
_parent.gotoAndPlay(_parent.curFrame + "_end");
}
Symbol 2023 Button
on (press) {
_parent.playSound(_parent.sClick);
_parent.nFrame = "startowa";
_parent.gotoAndPlay(_parent.curFrame + "_end");
}
Symbol 2025 Button
on (press) {
_parent.playSound(_parent.sClick);
_parent.nFrame = "game";
_parent.gotoAndPlay(_parent.curFrame + "_end");
}
Symbol 2029 Button
on (press) {
_parent.playSound(_parent.sClick);
_parent.nFrame = "c5";
_parent.gotoAndPlay(_parent.curFrame + "_end");
}
Symbol 2030 Button
on (press) {
_parent.playSound(_parent.sClick);
_parent.nFrame = "c7";
_parent.gotoAndPlay(_parent.curFrame + "_end");
}
Symbol 2033 MovieClip Frame 1
stop();
Symbol 2033 MovieClip Frame 16
stop();
_parent.playSound(_parent.sGO);
Symbol 2033 MovieClip Frame 39
stop();
_parent.playSound(_parent.sYW);
Symbol 2033 MovieClip Frame 64
stop();
_parent.playSound(_parent.sYW);
Symbol 2033 MovieClip Frame 91
stop();
_parent.playSound(_parent.sGO);
Symbol 2042 MovieClip Frame 36
stop();
Symbol 2042 MovieClip Frame 76
stop();
Symbol 2042 MovieClip Frame 117
stop();
Symbol 2042 MovieClip Frame 156
stop();