Frame 1
function gameSave() {
trace("saved");
var _local1 = SharedObject.getLocal("bomb_it");
var _local2 = {playerName1:playerName1, playerName2:playerName2, highScore_arr:highScore_arr};
_local1.data.myObj = _local2;
}
function upDateStageNum(stageNum) {
stageNum_str = "";
if (stageNum < 10) {
stageNum_str = stageNum_str + "0";
}
stageNum_str = stageNum_str + stageNum;
}
fscommand ("allowscale", false);
fscommand ("showmenu", false);
qualityNum = 1;
life0 = 3;
var totalPlayer = 0;
myLSO = SharedObject.getLocal("bomb_it");
if (myLSO.data.myObj == undefined) {
trace("first play");
playerName1 = "";
playerName2 = "";
highScore_arr = [["cpu", 100], ["cpu", 137728], ["cpu", 50000], ["cpu", 40000], ["cpu", 30000], ["cpu", 20000], ["cpu", 10000], ["cpu", 5000], ["cpu", 3000], ["cpu", 1000]];
gameSave();
} else {
trace("loaded");
var myObj = myLSO.data.myObj;
playerName1 = myObj.playerName1;
playerName2 = myObj.playerName2;
highScore_arr = myObj.highScore_arr.slice();
}
Frame 3
stop();
if (bgMusic_sound == undefined) {
soundon = true;
bgMusic_sound = new Sound(this);
bgMusic_sound.attachSound("Bombit_-_mainscreen");
bgMusic_sound.start();
bgMusic_sound.onSoundComplete = function () {
if (soundon) {
this.start();
}
};
}
delete p1;
delete p2;
p1 = undefined;
p2 = undefined;
Frame 8
function mov(p, dx) {
if (p.setDown) {
return(0);
}
if (totalPlayer == 2) {
var _local3 = this["p" + (3 - p.id)];
do {
p.heroId = p.heroId + dx;
if (p.heroId <= 0) {
p.heroId = 4;
} else if (p.heroId > 4) {
p.heroId = 1;
}
} while (p.heroId == _local3.heroId);
} else {
p.heroId = p.heroId + dx;
if (p.heroId <= 0) {
p.heroId = 4;
} else if (p.heroId > 4) {
p.heroId = 1;
}
}
var _local4 = this["p_pointer" + p.id];
_local4.delayTime = 2;
_local4.heroId = p.heroId;
_local4.p.gotoAndStop(((p.id - 1) * 4) + p.heroId);
_local4.arrow.gotoAndStop(p.heroId);
_local4._x = this["hero" + p.heroId]._x;
}
var heroNum = 1;
while (heroNum <= 4) {
this["heroObj" + heroNum] = {heroId:0, life:1, totalBomb:1, totalScore:0, score:0, killScore:0, timeScore:0, toolScore:0, brickScore:0, bonus:0};
var hero = this["hero" + heroNum];
if (heroNum <= totalPlayer) {
var p = this["p" + heroNum];
var p_pointer = this.attachMovie("p_pointer", "p_pointer" + heroNum, heroNum, {heroId:0, delayTime:2, _xscale:200, _yscale:200, _y:hero._y});
p_pointer.onEnterFrame = function () {
if ((--this.delayTime) <= 0) {
this.delayTime = 100;
this._parent["\u773C\u76AE" + this.heroId].gotoAndPlay(2);
}
};
}
heroNum++;
}
Key.addListener(this);
totalSetDown = 0;
if (totalPlayer == 1) {
heroObj1.life = 3;
p1 = {setDown:false, id:1, heroId:0, key0:37, key1:38, key2:39, key3:40, fireKey:32};
mov(p1, 1);
this.onKeyUp = function () {
switch (Key.getCode()) {
case p1.key0 :
case p1.key1 :
mov(p1, -1);
return;
case p1.key2 :
case p1.key3 :
mov(p1, 1);
return;
case p1.fireKey :
gotoAndStop ("game");
}
};
} else {
heroObj1.life = 3;
heroObj2.life = 3;
p1 = {setDown:false, id:1, heroId:0, key0:65, key1:87, key2:68, key3:83, fireKey:32};
p2 = {setDown:false, id:2, heroId:0, key0:37, key1:38, key2:39, key3:40, fireKey:13};
mov(p1, 1);
mov(p2, 1);
this.onKeyUp = function () {
switch (Key.getCode()) {
case p1.key0 :
case p1.key1 :
mov(p1, -1);
return;
case p1.key2 :
case p1.key3 :
mov(p1, 1);
return;
case p1.fireKey :
if (p1.setDown == false) {
p1.setDown = true;
p_pointer1.gotoAndStop(1);
if ((++totalSetDown) == totalPlayer) {
gotoAndStop ("game");
}
}
return;
case p2.key0 :
case p2.key1 :
mov(p2, -1);
return;
case p2.key2 :
case p2.key3 :
mov(p2, 1);
return;
case p2.fireKey :
if (p2.setDown != false) {
break;
}
p2.setDown = true;
p_pointer2.gotoAndStop(1);
if ((++totalSetDown) != totalPlayer) {
break;
}
gotoAndStop ("game");
}
};
}
specialToolName_array = ["\u706B\u7BAD", "\u5730\u96F7", "\u624B\u69B4\u5F39", "\u6C7D\u5F39", "\u51B0\u7BAD", "\u706B\u7130\u7BAD"];
specialToolId = 6;
bgMusic_array = ["Bombit_-_level_1", "Bombit_-_level_2", "Bombit_-_level_3", "Bombit_-_level_4"];
bgMusicId = 4;
Frame 9
stageNum = 0;
var heroNum = 1;
while (heroNum <= 4) {
var heroObj = this["heroObj" + heroNum];
heroObj.totalScore = 0;
if (heroNum <= totalPlayer) {
heroObj.life = 3;
} else {
heroObj.life = 1;
}
heroNum++;
}
p_pointer1.removeMovieClip();
p_pointer2.removeMovieClip();
bgMusic_sound.stop();
Key.removeListener(this);
quality_mc.gotoAndStop(qualityNum);
if (soundon) {
soundon_mc.stop();
} else {
soundon_mc.nextFrame();
}
switch (varHard) {
case "easy" :
totalStage = 15;
break;
case "normal" :
totalStage = 20;
break;
case "hard" :
totalStage = 25;
}
trace((("varHard=" + varHard) + ",totalStage=") + totalStage);
Frame 10
if (soundon) {
bgMusic_sound.start();
}
Frame 11
nameOutput = "";
scoreOutput = "";
var L = highScore_arr.length;
var i = 0;
while (i < L) {
var j = i;
while (j < L) {
if (highScore_arr[i][1] < highScore_arr[j][1]) {
var temp = highScore_arr[i][0];
highScore_arr[i][0] = highScore_arr[j][0];
highScore_arr[j][0] = temp;
var temp = highScore_arr[i][1];
highScore_arr[i][1] = highScore_arr[j][1];
highScore_arr[j][1] = temp;
}
j++;
}
i++;
}
if (L > 10) {
L = 10;
}
var i = 0;
while (i < L) {
var playerName = highScore_arr[i][0];
var highScore = highScore_arr[i][1];
this["name" + (i + 1)] = playerName;
this["score" + (i + 1)] = highScore;
var j = 0;
while (j <= totalPlayer) {
if ((playerName == this["playerName" + j]) && (highScore == this["heroObj" + j].totalScore)) {
break;
}
j++;
}
if (j > totalPlayer) {
this["new" + i]._visible = false;
} else {
this["new" + i]._visible = true;
}
i++;
}
gameSave();
Frame 12
nameOutput = "";
scoreOutput = "";
var L = highScore_arr.length;
var i = 0;
while (i < L) {
var j = i;
while (j < L) {
if (highScore_arr[i][1] < highScore_arr[j][1]) {
var temp = highScore_arr[i][0];
highScore_arr[i][0] = highScore_arr[j][0];
highScore_arr[j][0] = temp;
var temp = highScore_arr[i][1];
highScore_arr[i][1] = highScore_arr[j][1];
highScore_arr[j][1] = temp;
}
j++;
}
i++;
}
if (L > 10) {
L = 10;
}
var i = 0;
while (i < L) {
var playerName = highScore_arr[i][0];
var highScore = highScore_arr[i][1];
this["name" + (i + 1)] = playerName;
this["score" + (i + 1)] = highScore;
var j = 0;
while (j <= totalPlayer) {
if ((playerName == this["playerName" + j]) && (highScore == this["heroObj" + j].totalScore)) {
break;
}
j++;
}
if (j > totalPlayer) {
this["new" + i]._visible = false;
} else {
this["new" + i]._visible = true;
}
i++;
}
gameSave();
Symbol 237 MovieClip [heroExp] Frame 1
this.attachMovie("hero" + heroId, "hero", 0);
hero.gotoAndStop("down");
this.attachMovie("brickExp", "brickExp", 1);
Symbol 237 MovieClip [heroExp] Frame 6
hero.removeMovieClip();
blackHero.gotoAndStop(heroId);
Symbol 237 MovieClip [heroExp] Frame 36
this.removeMovieClip();
Symbol 248 MovieClip [brickExp] Frame 11
this.removeMovieClip();
Symbol 279 MovieClip [heroDieSmoke] Frame 36
this.removeMovieClip();
Symbol 306 MovieClip [mine] Frame 60
stop();
Symbol 312 MovieClip Frame 22
this._parent.removeMovieClip();
Symbol 315 MovieClip [gasBomb] Frame 101
stop();
Symbol 319 MovieClip [fireEffect] Frame 40
this.removeMovieClip();
Symbol 325 MovieClip [freezeEffect] Frame 40
this.removeMovieClip();
Symbol 326 MovieClip [tool] Frame 80
gotoAndPlay (1);
Symbol 326 MovieClip [tool] Frame 101
this.removeMovieClip();
Symbol 376 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
var _local3 = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
this.gotoAndStop(int(_local3 / 10));
if (_local3 >= 100) {
delete this.onEnterFrame;
_root.play();
}
};
Symbol 391 Button
on (release) {
getURL ("http://moregames.agame.com", "_blank");
}
Symbol 407 MovieClip Frame 1
stop();
Symbol 432 Button
on (release) {
gotoAndStop ("menu2");
}
Symbol 433 Button
on (release) {
gotoAndStop ("howtoplay");
}
Symbol 434 Button
on (release) {
gotoAndStop ("highscore2");
}
Symbol 435 Button
on (release) {
getURL ("http://moregames.agame.com", "_blank");
}
Symbol 436 Button
on (release) {
getURL ("http://freegames.agame.com", "_blank");
}
Symbol 441 Button
on (release) {
getURL ("http://moregames.agame.com", "_blank");
}
Symbol 447 Button
on (release) {
if ((++_parent.qualityNum) > 3) {
_parent.qualityNum = 1;
}
gotoAndStop(_parent.qualityNum);
}
Symbol 450 MovieClip Frame 1
if (_parent.qualityNum == 1) {
stop();
_quality = "high";
} else {
gotoAndStop(_parent.qualityNum);
}
Symbol 450 MovieClip Frame 2
_quality = "medium";
Symbol 450 MovieClip Frame 3
_quality = "low";
Symbol 453 Button
on (release) {
if (_parent.soundon) {
_parent.soundon = false;
_parent.bgMusic_sound.stop();
nextFrame();
} else {
_parent.soundon = true;
prevFrame();
_parent.bgMusic_sound.start();
}
}
Symbol 455 MovieClip Frame 1
if (_parent.soundon) {
stop();
} else {
nextFrame();
}
Symbol 458 Button
on (release) {
totalPlayer = 1;
gotoAndStop ("menu3");
}
Symbol 459 Button
on (release) {
totalPlayer = 2;
gotoAndStop ("menu3");
}
Symbol 462 Button
on (release) {
varHard = "normal";
gotoAndStop ("select");
}
Symbol 463 Button
on (release) {
varHard = "hard";
gotoAndStop ("select");
}
Symbol 465 Button
on (release) {
varHard = "easy";
gotoAndStop ("select");
}
Symbol 469 Button
on (release) {
gotoAndStop ("toolInstruction");
}
Symbol 505 MovieClip Frame 1
stop();
Symbol 515 MovieClip Frame 1
gotoAndStop(_parent.totalPlayer);
Symbol 524 MovieClip Frame 1
function timeInit() {
c1 = (c2 = (c3 = (c4 = "0")));
t = 180;
upDate();
t0 = getTimer() / 1000;
pausing = false;
}
function timePause() {
if (pausing) {
pausing = false;
} else {
pausing = true;
}
}
function timeStart() {
timerInterval = setInterval(function () {
var _local2 = getTimer() / 1000;
if (pausing == false) {
t = t - (_local2 - t0);
if (t < 1) {
t = 0;
timeStop();
_parent.game.gameover("timeup");
}
upDate();
}
t0 = _local2;
}, 500);
}
function upDate() {
var _local1 = String(int(t) % 60);
var _local2 = String(int((t - _local1) / 60));
if (_local1.length < 2) {
c3 = "0";
c4 = _local1;
} else {
c3 = _local1.charAt(0);
c4 = _local1.charAt(1);
}
if (_local2.length < 2) {
c1 = "0";
c2 = _local2;
} else {
c1 = _local2.charAt(0);
c2 = _local2.charAt(1);
}
}
function timeStop() {
clearInterval(timerInterval);
}
Symbol 530 MovieClip Frame 1
stop();
Symbol 534 MovieClip Frame 1
function init() {
var _local4 = 1;
while (_local4 <= 4) {
var _local5 = _parent["heroObj" + _local4];
var _local3 = this["pan" + _local4];
_local3.gotoAndStop(_local5.heroId);
_local3.lifeMc.txt = _local5.life;
_local3.shield.tool_mc.gotoAndStop(4);
_local3.shield._visible = false;
_local3.shoe.tool_mc.gotoAndStop(6);
_local3.shoe._visible = false;
_local3.glove.tool_mc.gotoAndStop(2);
_local3.glove._visible = false;
if (_local5.life > 0) {
_local3.pan_mask.gotoAndStop(1);
} else {
_local3.pan_mask.gotoAndStop(2);
}
_local4++;
}
}
function upDate() {
var _local5 = 1;
while (_local5 <= 4) {
var _local3 = _parent["heroObj" + _local5];
var _local4 = this["pan" + _local5];
_local4.lifeMc.txt = _local3.life;
if (_local3.life == 0) {
_local4.pan_mask.gotoAndStop(2);
}
_local4.score = _local3.score;
_local4.totalBombMc.txt = _local3.totalBomb;
_local5++;
}
}
function showMc(mcName, heroNum, value) {
this["pan" + heroNum][mcName]._visible = value;
}
function mcBlink(mcName, heroNum) {
var _local2 = this["pan" + heroNum][mcName];
_local2.delayTime = 35;
_local2.onEnterFrame = function () {
if ((--this.delayTime) <= 0) {
delete this.onEnterFrame;
} else if ((this.delayTime % 10) < 5) {
this._visible = true;
} else {
this._visible = false;
}
};
}
Symbol 536 Button
on (release) {
if ((++qualityNum) > 3) {
qualityNum = 1;
}
quality_mc.gotoAndStop(qualityNum);
}
Symbol 537 Button
on (release) {
if (soundon) {
game.bgMusic_sound.stop();
soundon = false;
soundon_mc.nextFrame();
} else {
game.bgMusic_sound.start();
soundon = true;
soundon_mc.prevFrame();
}
}
Symbol 538 Button
on (release, keyPress "p") {
pause_mc.play();
game.pause();
timer.timePause();
}
on (keyPress "P") {
pause_mc.play();
game.pause();
timer.timePause();
}
Symbol 541 MovieClip Frame 1
stop();
Symbol 541 MovieClip Frame 2
stop();
Symbol 547 MovieClip Frame 1
_quality = "high";
Symbol 547 MovieClip Frame 2
_quality = "medium";
Symbol 547 MovieClip Frame 3
_quality = "low";
Symbol 560 MovieClip Frame 1
stop();
Symbol 560 MovieClip Frame 7
youWin_gra.gotoAndStop(this.varWin);
Symbol 560 MovieClip Frame 70
stop();
Key.addListener(_parent);
Symbol 561 MovieClip Frame 1
function gameover(msg) {
delete this.onKeyUp;
Key.removeListener(this);
bgMusic_sound.stop();
youWin.varWin = "";
_parent.timer.timeStop();
delete game.onEnterFrame;
pausing = true;
_parent.pause_btn.enabled = false;
_parent.music_btn.enabled = false;
var _local12 = false;
trace(msg);
switch (msg) {
case "timeup" :
youWin.varWin = "timeup";
var _local8 = 0;
var _local7 = 0;
var _local5 = 0;
while (_local5 <= 4) {
var _local6 = brickArea["hero" + _local5];
if (_local6 != undefined) {
var _local4 = _parent["heroObj" + _local5].score;
if (_local5 <= totalPlayer) {
if (_local8 < _local4) {
_local8 = _local4;
}
} else if (_local7 < _local4) {
_local7 = _local4;
}
}
_local5++;
}
if (_local8 > _local7) {
youWin.varWin = youWin.varWin + "win";
_local5 = 1;
while (_local5 <= totalPlayer) {
var _local6 = brickArea["hero" + _local5];
if (_local6 != undefined) {
var _local3 = _parent["heroObj" + _local6.heroNum];
_local3.bonus = _local3.bonus + 1000;
_local3.score = _local3.score + 1000;
_local3.totalScore = _local3.totalScore + 1000;
}
_local5++;
}
_parent.allPan.upDate();
if (_parent.stageNum == _parent.totalStage) {
pauseInterval = setInterval(function () {
_parent.stageNum++;
clearInterval(pauseInterval);
bgMusic_sound.stop();
_parent.gotoAndStop("score");
}, 5500);
this.onKeyUp = function () {
youWin.stop();
_parent.stageNum++;
clearInterval(pauseInterval);
bgMusic_sound.stop();
_parent.gotoAndStop("score");
};
} else {
_parent.stageClear = true;
pauseInterval = setInterval(function () {
clearInterval(pauseInterval);
bgMusic_sound.stop();
_parent.stageScore.gotoAndStop(totalPlayer + 1);
}, 5500);
this.onKeyUp = function () {
youWin.stop();
clearInterval(pauseInterval);
bgMusic_sound.stop();
_parent.stageScore.gotoAndStop(totalPlayer + 1);
};
}
bgMusic_sound.attachSound("Bombit_-_level_complete");
break;
}
_local5 = 1;
while (_local5 <= totalPlayer) {
var _local6 = brickArea["hero" + _local5];
if (_local6 != undefined) {
_parent["heroObj" + _local5].life--;
brickArea.attachMovie("heroExp", "heroExp" + _local6.heroNum, _local6.getDepth(), {heroId:_local6.heroId, _x:_local6._x, _y:_local6._y});
}
_local5++;
}
_parent.allPan.upDate();
case "lose" :
youWin.varWin = youWin.varWin + "lose";
_local5 = 1;
while (_local5 <= totalPlayer) {
if (_parent["heroObj" + _local5].life > 0) {
break;
}
_local5++;
}
if (_local5 <= totalPlayer) {
_parent.stageClear = false;
pauseInterval = setInterval(function () {
clearInterval(pauseInterval);
bgMusic_sound.stop();
_parent.stageScore.gotoAndStop(totalPlayer + 1);
}, 5500);
this.onKeyUp = function () {
youWin.stop();
clearInterval(pauseInterval);
bgMusic_sound.stop();
_parent.stageScore.gotoAndStop(totalPlayer + 1);
};
} else {
_local12 = true;
pauseInterval = setInterval(function () {
clearInterval(pauseInterval);
bgMusic_sound.stop();
_parent.gotoAndStop("score");
}, 5500);
this.onKeyUp = function () {
youWin.stop();
clearInterval(pauseInterval);
bgMusic_sound.stop();
_parent.gotoAndStop("score");
};
}
bgMusic_sound.attachSound("Bombit_-_mission_failed");
break;
case "win" :
_local5 = 1;
while (_local5 <= totalPlayer) {
var _local6 = brickArea["hero" + _local5];
if (_local6 != undefined) {
var _local3 = _parent["heroObj" + _local6.heroNum];
_local3.timeScore = _local3.timeScore + int(_parent.timer.t * 10);
_local3.bonus = _local3.bonus + 1000;
_local3.score = _local3.score + (_local3.bonus + _local3.timeScore);
_local3.totalScore = _local3.totalScore + (_local3.bonus + _local3.timeScore);
}
_local5++;
}
_parent.allPan.upDate();
youWin.varWin = "win";
if (_parent.stageNum == _parent.totalStage) {
pauseInterval = setInterval(function () {
_parent.stageNum++;
clearInterval(pauseInterval);
bgMusic_sound.stop();
_parent.gotoAndStop("score");
}, 5500);
this.onKeyUp = function () {
youWin.stop();
clearInterval(pauseInterval);
bgMusic_sound.stop();
_parent.gotoAndStop("score");
};
} else {
_parent.stageClear = true;
pauseInterval = setInterval(function () {
clearInterval(pauseInterval);
bgMusic_sound.stop();
_parent.stageScore.gotoAndStop(totalPlayer + 1);
}, 5500);
this.onKeyUp = function () {
youWin.stop();
clearInterval(pauseInterval);
bgMusic_sound.stop();
_parent.stageScore.gotoAndStop(totalPlayer + 1);
};
}
bgMusic_sound.attachSound("Bombit_-_level_complete");
}
youWin.play();
if (_parent.soundon) {
bgMusic_sound.start();
}
if (!_local12) {
_local5 = 1;
while (_local5 <= 4) {
var _local3 = _parent["heroObj" + _local5];
if (_local3.life == 0) {
_local3.life = 1;
if (((_local3.totalScore = _local3.totalScore - 1000)) < 0) {
_local3.totalScore = 0;
}
}
_local5++;
}
}
}
function putBomb(hero) {
if ((hero.totalBomb <= 0) || (hero.puttAble == false)) {
return(false);
}
var _local4 = (hero.y + "_") + hero.x;
if (((((bgArea["bg" + _local4].bomb != "") || (brickArea["grenade" + _local4] != undefined)) || (brickArea["rocket" + _local4] != undefined)) || (brickArea["mine" + _local4] != undefined)) || (brickArea["gasBomb" + _local4] != undefined)) {
return(false);
}
if (_parent.soundon) {
vo_sound.attachSound("putBomb.wav");
vo_sound.start();
}
_parent["heroObj" + hero.heroNum].totalBomb = --hero.totalBomb;
_parent.allPan.upDate();
var bg = bgArea[(("bg" + hero.y) + "_") + hero.x];
bg.bomb = (("bomb" + hero.y) + "_") + hero.x;
var _local5 = brickArea.attachMovie("bomb", bg.bomb, calDepth(hero.x, hero.y, brickArea.margin) - 5, {heroNum:hero.heroNum, heroId:hero.heroId, bg:bg, bombLevel:hero.bombLevel, delayTime:60, x:hero.x, y:hero.y, _x:hero.x * d, _y:hero.y * d});
_local5.onEnterFrame = function () {
if (pausing) {
return(0);
}
if (((--this.delayTime) <= 0) || (this.bg.expEnergy > 0)) {
bombExp(this.bg);
}
};
return(true);
}
function addBrickExp(x, y, heroNum) {
var bg = bgArea[(("bg" + y) + "_") + x];
var _local4 = brickArea.attachMovie("brickExp", (("brickExp" + y) + "_") + x, calDepth(x, y, brickArea.margin), {delayTime:10, bg:bg, _x:x * d, _y:y * d});
_local4.onEnterFrame = function () {
if ((--this.delayTime) <= 0) {
this.bg.expEnergy--;
this.removeMovieClip();
}
};
bg.brick = "";
bg.expEnergy++;
bg.expHeroNum = heroNum;
}
function putSpecial(hero) {
if (((hero.totalSpecial <= 0) || (hero.puttAble == false)) || (hero.moving)) {
return(false);
}
var x = hero.x;
var y = hero.y;
var bg = bgArea[(("bg" + y) + "_") + x];
if (bg.bomb != "") {
return(false);
}
var id = (hero._currentframe - 1);
var dx = xy[id][0];
var dy = xy[id][1];
switch (hero.specialToolName) {
case "\u706B\u7BAD" :
if (brickArea[(("rocket" + y) + "_") + x] != undefined) {
return(0);
}
if (_parent.soundon) {
vo_sound.attachSound("rocket.mp3");
vo_sound.start();
}
var _local12 = brickArea.attachMovie("rocket", (("rocket" + y) + "_") + x, calDepth(x, y, brickArea.margin) - 5, {hero:hero, heroNum:hero.heroNum, _x:x * d, _y:y * d, dx:dx, dy:dy, vx:0, vy:0});
_local12.gotoAndStop(id + 1);
_local12.onEnterFrame = function () {
if (pausing) {
return(0);
}
this.vx = this.vx + this.dx;
this.vy = this.vy + this.dy;
this._x = this._x + this.vx;
this._y = this._y + this.vy;
var _local6 = Math.round(this._x / d);
var _local5 = Math.round(this._y / d);
var _local8 = bgArea.getNextHighestDepth();
var _local9 = bgArea.attachMovie("rocketSmoke", "rocketSmoke" + _local8, _local8, {_x:this._x, _y:this._y});
_local9.gotoAndStop(this._currentframe);
var _local3 = 1;
while (_local3 <= 4) {
if (_local3 == this.heroNum) {
} else {
var _local4 = brickArea["hero" + _local3];
if (_local4 != undefined) {
var dx = (_local4._x - this._x);
var dy = (_local4._y - this._y);
if (((dx * dx) + (dy * dy)) < ((d * d) / 4)) {
addBrickExp(_local6, _local5, this.heroNum);
if (_parent.soundon) {
vo_sound.attachSound("exp.wav");
vo_sound.start();
}
this.removeMovieClip();
return(0);
}
}
}
_local3++;
}
var _local7 = bgArea[(("bg" + _local5) + "_") + _local6];
if ((_local7.brick == undefined) || (_local7.brick == "unbreakAble")) {
addBrickExp(_local6 - this.dx, _local5 - this.dy, this.heroNum);
if (_parent.soundon) {
vo_sound.attachSound("exp.wav");
vo_sound.start();
}
this.removeMovieClip();
return(0);
}
if ((_local7.bomb != "") || (_local7.brick != "")) {
addBrickExp(_local6, _local5, this.heroNum);
this.removeMovieClip();
return(0);
}
this.swapDepths(calDepth(_local6, _local5, brickArea.margin) - 5);
};
break;
case "\u5730\u96F7" :
if (brickArea[(("mine" + y) + "_") + x] != undefined) {
return(0);
}
if (_parent.soundon) {
vo_sound.attachSound("bibi.wav");
vo_sound.start();
}
var _local16 = brickArea.attachMovie("mine", (("mine" + y) + "_") + x, calDepth(x, y, brickArea.margin) - 5, {heroNum:hero.heroNum, bg:bg, x:x, y:y, _x:x * d, _y:y * d});
_local16.onEnterFrame = function () {
if (pausing) {
return(0);
}
var _local3 = 1;
while (_local3 <= 4) {
var _local4 = brickArea["hero" + _local3];
if (_local4 != undefined) {
var _local6 = _local4._x - this._x;
var _local5 = _local4._y - this._y;
if (_local3 == this.heroNum) {
} else if (((_local6 * _local6) + (_local5 * _local5)) < ((d * d) / 4)) {
addBrickExp(this.x, this.y, this.heroNum);
if (_parent.soundon) {
vo_sound.attachSound("exp.wav");
vo_sound.start();
}
this.removeMovieClip();
return(0);
}
}
_local3++;
}
if (this.bg.expEnergy > 0) {
addBrickExp(this.x, this.y, this.heroNum);
if (_parent.soundon) {
vo_sound.attachSound("exp.wav");
vo_sound.start();
}
this.removeMovieClip();
return(0);
}
};
break;
case "\u624B\u69B4\u5F39" :
if (brickArea[(("grenade" + y) + "_") + x] != undefined) {
return(0);
}
var _local9 = x + (dx * 2);
var _local8 = y + (dy * 2);
var bg = bgArea[(("bg" + _local8) + "_") + _local9];
if ((bg.brick == undefined) || (bg.brick == "unbreakAble")) {
return(false);
}
if (_parent.soundon) {
vo_sound.attachSound("grenade.mp3");
vo_sound.start();
}
var _local10 = brickArea.attachMovie("grenade", (("grenade" + y) + "_") + x, calDepth(x, y, brickArea.margin) - 5, {hero:hero, heroNum:hero.heroNum, bg:bg, x:_local9, y:_local8, _x:x * d, _y:y * d});
_local10.gotoAndStop(id + 1);
_local10.onEnterFrame = function () {
if (pausing) {
return(0);
}
if (this.body._currentframe == int(this.body._totalframes / 2)) {
this.swapDepths(calDepth(this.x, this.y, brickArea.margin) - 5);
}
if (this.body._currentframe == this.body._totalframes) {
addBrickExp(this.x, this.y, this.heroNum);
var _local3 = 0;
while (_local3 < 4) {
var x = (this.x + xy[_local3][0]);
var y = (this.y + xy[_local3][1]);
var _local4 = bgArea[(("bg" + y) + "_") + x];
if ((_local4.brick != undefined) && (_local4.brick != "unbreakAble")) {
addBrickExp(x, y, this.heroNum);
}
_local3++;
}
if (_parent.soundon) {
vo_sound.attachSound("exp.wav");
vo_sound.start();
}
this.removeMovieClip();
return(0);
}
};
break;
case "\u6C7D\u5F39" :
if (brickArea[(("gasBomb" + y) + "_") + x] != undefined) {
return(0);
}
if (_parent.soundon) {
}
var _local14 = brickArea.attachMovie("gasBomb", (("gasBomb" + y) + "_") + x, calDepth(x, y, brickArea.margin) - 5, {heroNum:hero.heroNum, bg:bg, x:x, y:y, _x:x * d, _y:y * d});
_local14.onEnterFrame = function () {
if (pausing) {
return(0);
}
var _local3 = 1;
while (_local3 <= 4) {
var _local2 = brickArea["hero" + _local3];
if (_local2 != undefined) {
var _local5 = _local2._x - this._x;
var _local4 = _local2._y - this._y;
if (_local3 == this.heroNum) {
} else if (((_local5 * _local5) + (_local4 * _local4)) == 0) {
_local2.slowVLevel = 20;
_local2.slowTime = 600;
delete this.onEnterFrame;
this.removeMovieClip();
return(0);
}
}
_local3++;
}
if (this.bg.expEnergy > 0) {
this.removeMovieClip();
return(0);
}
};
break;
case "\u51B0\u7BAD" :
var bg = bgArea[(("bg" + (y + dy)) + "_") + (x + dx)];
if ((bg.brick != "") || (bg.bomb != "")) {
return(false);
}
var _local11 = bgArea.getNextHighestDepth();
var _local6 = bgArea.createEmptyMovieClip("iceArea" + _local11, _local11);
_local6.x = x;
_local6.y = y;
_local6.dx = dx;
_local6.dy = dy;
_local6.id = 0;
_local6.offset = 0;
_local6.expXy = new Array();
_local6.onEnterFrame = function () {
if (pausing) {
return(0);
}
if ((++this.id) <= 12) {
if ((this.id % 4) == 0) {
this.offset++;
var _local6 = this.x + (this.dx * this.offset);
var _local5 = this.y + (this.dy * this.offset);
var _local8 = bgArea[(("bg" + _local5) + "_") + _local6];
if ((_local8.brick == "") && (_local8.bomb == "")) {
_local8.brick = (("brick" + _local5) + "_") + _local6;
this.expXy.push([_local6, _local5]);
var _local9 = brickArea.attachMovie("freezeEffect", _local8.brick, calDepth(_local6, _local5, brickArea.margin), {_x:_local6 * d, _y:_local5 * d});
_local9.onEnterFrame = function () {
var _local3 = 1;
while (_local3 <= 4) {
var _local2 = brickArea["hero" + _local3];
var _local5 = _local2._x - this._x;
var _local4 = _local2._y - this._y;
if (((_local5 * _local5) + (_local4 * _local4)) < 100) {
_local2.stopTime = 300;
}
_local3++;
}
};
} else {
this.id = 12;
}
}
} else if (this.id > 48) {
var _local7 = this.expXy.length;
var _local2 = 0;
while (_local2 < _local7) {
var _local6 = this.expXy[_local2][0];
var _local5 = this.expXy[_local2][1];
bgArea[(("bg" + _local5) + "_") + _local6].brick = "";
_local2++;
}
this.removeMovieClip();
}
};
break;
case "\u706B\u7130\u7BAD" :
var bg = bgArea[(("bg" + (y + dy)) + "_") + (x + dx)];
if ((bg.brick == undefined) || (bg.brick == "unbreakAble")) {
return(false);
}
_local11 = bgArea.getNextHighestDepth();
var _local5 = bgArea.createEmptyMovieClip("fireArea" + _local11, _local11);
_local5.x = x;
_local5.y = y;
_local5.dx = dx;
_local5.dy = dy;
_local5.id = 0;
_local5.offset = 0;
_local5.heroNum = hero.heroNum;
_local5.expXy = new Array();
_local5.onEnterFrame = function () {
if (pausing) {
return(0);
}
if ((++this.id) <= 12) {
if ((this.id % 4) == 0) {
this.offset++;
var _local5 = this.x + (this.dx * this.offset);
var _local4 = this.y + (this.dy * this.offset);
var _local6 = bgArea[(("bg" + _local4) + "_") + _local5];
if ((_local6.brick != undefined) && (_local6.brick != "unbreakAble")) {
if (_local6.bomb != "") {
bombExp(_local6);
}
if (_local6.brick != "") {
brickBreak(_local6, this.heroNum);
if (_parent.soundon) {
vo_sound.attachSound("exp.wav");
vo_sound.start();
}
}
this.expXy.push([_local5, _local4]);
_local6.expEnergy++;
_local6.expHeroNum = this.heroNum;
brickArea.attachMovie("fireEffect", (("fireEffect" + _local4) + "_") + _local5, calDepth(_local5, _local4, brickArea.margin) - 7, {_x:_local5 * d, _y:_local4 * d});
} else {
this.id = 12;
}
}
} else if (this.id > 48) {
var _local7 = this.expXy.length;
var _local3 = 0;
while (_local3 < _local7) {
var _local5 = this.expXy[_local3][0];
var _local4 = this.expXy[_local3][1];
bgArea[(("bg" + _local4) + "_") + _local5].expEnergy--;
_local3++;
}
this.removeMovieClip();
}
};
}
if ((--hero.totalSpecial) <= 0) {
hero.specialToolViewer.removeMovieClip();
}
if (hero.heroNum <= totalPlayer) {
hero.puttAble = false;
}
return(true);
}
function hurtHero(hero) {
if (hero.varShield <= 0) {
if (hero.shield) {
hero.shield = false;
_parent.allPan.showMc("shield", hero.heroNum, false);
hero.varShield = 60;
} else {
var _local3 = brickArea.attachMovie("heroDieSmoke", "heroDieSmoke" + hero.heroNum, 10000 + random(10000), {_x:hero._x, _y:hero._y});
_parent["heroObj" + hero.heroNum].life--;
_parent.allPan.upDate();
if (((--hero.life) <= 0) || (hero.heroNum <= totalPlayer)) {
brickArea.attachMovie("heroExp", "heroExp" + hero.heroNum, hero.getDepth(), {heroId:hero.heroId, _x:hero._x, _y:hero._y});
} else if (hero.heroNum > totalPlayer) {
_local3.gotoAndPlay(20);
hero.varShield = 60;
}
}
return(true);
}
return(false);
}
function bombExp(bg) {
var _local12 = brickArea[bg.bomb];
if (((_local12 == undefined) || (_local12.x != (_local12._x / d))) || (_local12.y != (_local12._y / d))) {
return(false);
}
if (_parent.soundon) {
vo_sound.attachSound("exp.wav");
vo_sound.start();
}
var _local16 = brickArea["hero" + _local12.heroNum];
_parent["heroObj" + _local16.heroNum].totalBomb = ++_local16.totalBomb;
_parent.allPan.upDate();
var depth = bgArea.getNextHighestDepth();
var _local3 = bgArea.createEmptyMovieClip((("expArea" + _local12.y) + "_") + _local12.x, depth);
_local3._x = (_local3._y = d / 2);
_local3.x0 = _local12.x;
_local3.y0 = _local12.y;
_local3.heroNum = _local12.heroNum;
_local3.heroId = _local12.heroId;
_local3.bombLevel = _local12.bombLevel;
_local3.expPos = 0;
_local3.depth = 0;
_local3.expXy = new Array();
_local12.removeMovieClip();
bg.bomb = "";
var _local5 = _local3.attachMovie("exp", (("exp" + _local3.y0) + "_") + _local3.x0, _local3.depth, {_x:_local3.x0 * d, _y:_local3.y0 * d});
bg.expEnergy++;
bg.expHeroNum = _local3.heroNum;
_local3.expXy.push([_local3.x0, _local3.y0]);
_local5.gotoAndStop(_local3.heroId);
_local3.ltrb = [true, true, true, true];
var _local4 = 0;
while (_local4 < 4) {
var _local11 = _local3.x0 + xy[_local4][0];
var _local10 = _local3.y0 + xy[_local4][1];
bg = bgArea[(("bg" + _local10) + "_") + _local11];
if ((bg == undefined) || (bg.brick == "unbreakAble")) {
_local3.ltrb[_local4] = false;
}
_local4++;
}
_local3.onEnterFrame = function () {
if (pausing) {
return(0);
}
this.expPos++;
var _local2 = 0;
while (_local2 < 4) {
if (this.ltrb[_local2]) {
var _local5 = xy[_local2][0];
var _local4 = xy[_local2][1];
var _local9 = this.x0 + (_local5 * this.expPos);
var _local8 = this.y0 + (_local4 * this.expPos);
this.depth++;
var _local3 = this.attachMovie("exp", (("exp" + _local8) + "_") + _local9, this.depth, {_x:_local9 * d, _y:_local8 * d});
this.expXy.push([_local9, _local8]);
_local3._rotation = (_local2 + 2) * 90;
var _local7 = bgArea[(("bg" + _local8) + "_") + _local9];
_local7.expEnergy++;
_local7.expHeroNum = this.heroNum;
if (_local7.brick != "") {
this.ltrb[_local2] = false;
brickBreak(_local7, this.heroNum);
}
var _local6 = bgArea[(("bg" + (_local8 + _local4)) + "_") + (_local9 + _local5)];
if (((_local6 == undefined) || (_local6.brick == "unbreakAble")) || (this.expPos >= this.bombLevel)) {
this.ltrb[_local2] = false;
}
if (this.ltrb[_local2]) {
_local3.gotoAndStop(this.heroId + 4);
} else {
_local3.gotoAndStop(this.heroId + 8);
}
}
_local2++;
}
if (this.expPos >= this.bombLevel) {
delete this.onEnterFrame;
this.delayTime = 10;
this.onEnterFrame = function () {
if (pausing) {
return(0);
}
if ((--this.delayTime) <= 0) {
var _local6 = this.expXy.length;
var _local2 = 0;
while (_local2 < _local6) {
var _local5 = this.expXy[_local2][0];
var _local4 = this.expXy[_local2][1];
var _local3 = bgArea[(("bg" + _local4) + "_") + _local5];
_local3.expEnergy--;
_local2++;
}
delete this.onEnterFrame;
this.onEnterFrame = function () {
if (pausing) {
return(0);
}
if (((this._alpha = this._alpha - 20)) < 5) {
this.removeMovieClip();
}
};
}
};
}
};
return(true);
}
function brickBreak(bg, heroNum) {
var _local4 = bg.x;
var _local3 = bg.y;
brickArea.attachMovie("brickExp", (("brickExp" + _local3) + "_") + _local4, calDepth(_local4, _local3, brickArea.margin), {_x:_local4 * d, _y:_local3 * d});
if (brickArea["hero" + heroNum] != undefined) {
var _local6 = _parent["heroObj" + heroNum];
_local6.brickScore = _local6.brickScore + brickScore;
_local6.score = _local6.score + brickScore;
_local6.totalScore = _local6.totalScore + brickScore;
_parent.allPan.upDate();
}
bg.brick = "";
if (random(100) < 65) {
var _local2 = brickArea.attachMovie("tool", (("tool" + _local3) + "_") + _local4, calDepth(_local4, _local3, brickArea.margin) - 6, {_x:_local4 * d, _y:_local3 * d});
if (random(100) < 80) {
var _local5 = random(100);
if (_local5 < 1) {
_local2.toolName = "\u751F\u547D\u52A01";
} else if (_local5 < 15) {
_local2.toolName = "\u62A2\u624B";
} else if (_local5 < 40) {
_local2.toolName = "\u70B8\u5F39\u7CD6";
} else if (_local5 < 50) {
_local2.toolName = "\u76FE\u724C";
} else if (_local5 < 75) {
_local2.toolName = "\u5A01\u529B\u836F";
} else {
_local2.toolName = "\u98DE\u978B";
}
} else {
_local2.toolName = _parent.specialToolName_array[_parent.specialToolId + random(2)];
}
_local2.tool_mc.gotoAndStop(_local2.toolName);
bg.tool = _local2._name;
}
}
function pushBomb(bg, dx, dy) {
var _local3 = brickArea[bg.bomb];
if (((((_local3 != undefined) && (bg.x == _local3.x)) && (bg.y == _local3.y)) && (_local3.x == (_local3._x / d))) && (_local3.y == (_local3._y / d))) {
_local3.movId = 0;
_local3.dx = dx;
_local3.dy = dy;
var _local4 = bgArea[(("bg" + (bg.y + dy)) + "_") + (bg.x + dx)];
if ((_local4.bomb == "") && (_local4.brick == "")) {
bg.bomb = "";
var x = (_local3.x + dx);
var y = (_local3.y + dy);
_local3._name = (("bomb" + y) + "_") + x;
_local3.swapDepths(calDepth(x, y, brickArea.margin) - 5);
_local4.bomb = _local3._name;
if (_parent.soundon) {
vo_sound.attachSound("pushBomb.mp3");
vo_sound.start();
}
_local3.onEnterFrame = function () {
if (pausing) {
return(0);
}
if ((++this.movId) < 2) {
var _local3 = this.movId / 2;
this._x = (this.x + (this.dx * _local3)) * d;
this._y = (this.y + (this.dy * _local3)) * d;
} else {
this.x = this.x + this.dx;
this.y = this.y + this.dy;
this._x = this.x * d;
this._y = this.y * d;
this.bg = bgArea[(("bg" + this.y) + "_") + this.x];
var _local2 = bgArea[(("bg" + (this.y + this.dy)) + "_") + (this.x + this.dx)];
if ((_local2.bomb == "") && (_local2.brick == "")) {
this.bg.bomb = "";
var x = (this.x + this.dx);
var y = (this.y + this.dy);
this._name = (("bomb" + y) + "_") + x;
this.swapDepths(calDepth(x, y, brickArea.margin) - 5);
_local2.bomb = this._name;
this.movId = 0;
} else {
bombExp(this.bg);
}
}
};
return(true);
}
}
return(false);
}
function movHero(hero, xyId) {
hero.dx = xy[xyId][0];
hero.dy = xy[xyId][1];
var bg = bgArea[(("bg" + (hero.y + hero.dy)) + "_") + (hero.x + hero.dx)];
hero.gotoAndStop(xyId + 1);
hero.body.stop();
if ((bg.brick == "") && ((bg.bomb == "") || (hero.pushBombAble))) {
if (bg.bomb != "") {
if (pushBomb(bg, hero.dx, hero.dy) == false) {
return(false);
}
}
hero.moving = true;
hero.movId = 0;
hero.bg = bg;
hero.body.play();
hero.onEnterFrame = function () {
if (pausing) {
return(false);
}
var _local8 = ((this.slowTime == -1) ? (this.vLevel) : (this.slowVLevel));
if ((++this.movId) < _local8) {
var _local9 = this.movId / _local8;
this._x = (this.x + (this.dx * _local9)) * d;
this._y = (this.y + (this.dy * _local9)) * d;
} else {
this.moving = false;
delete this.onEnterFrame;
this.body.stop();
this.x = this.x + this.dx;
this.y = this.y + this.dy;
this._x = this.x * d;
this._y = this.y * d;
this.swapDepths(calDepth(this.x, this.y, brickArea.margin) - this.heroNum);
if (this.bg.tool != "") {
if ((_parent.varHard == "easy") && (this.heroNum > totalPlayer)) {
return(false);
}
var _local3 = brickArea[this.bg.tool].toolName;
var _local4 = true;
switch (_local3) {
case "\u706B\u7BAD" :
if ((_parent.varHard != "hard") && (this.heroNum > totalPlayer)) {
_local4 = false;
} else {
this.totalSpecial = 2;
this.attachMovie("specialToolViewer", "specialToolViewer", 0);
this.specialToolViewer.tool.gotoAndStop(_local3);
this.specialToolName = _local3;
}
break;
case "\u5730\u96F7" :
if ((_parent.varHard != "hard") && (this.heroNum > totalPlayer)) {
_local4 = false;
} else {
this.totalSpecial = 2;
this.attachMovie("specialToolViewer", "specialToolViewer", 0);
this.specialToolViewer.tool.gotoAndStop(_local3);
this.specialToolName = _local3;
}
break;
case "\u624B\u69B4\u5F39" :
if ((_parent.varHard != "hard") && (this.heroNum > totalPlayer)) {
_local4 = false;
} else {
var _local7 = bgArea.getNextHighestDepth();
var _local10 = bgArea.attachMovie("grenade_x", "grenade_x" + _local7, _local7, {hero:this, _x:-1000});
_local10.onEnterFrame = function () {
if (pausing) {
return(0);
}
if (this.hero.specialToolName != "\u624B\u69B4\u5F39") {
this.removeMovieClip();
} else if (this.hero.totalSpecial > 0) {
if (this.hero.moving) {
this._x = -1000;
} else {
var _local2 = this.hero._currentframe - 1;
var _local4 = this.hero.x + (xy[_local2][0] * 2);
var _local3 = this.hero.y + (xy[_local2][1] * 2);
var _local5 = bgArea[(("bg" + _local3) + "_") + _local4];
if (_local5.brick == "") {
this._x = _local4 * d;
this._y = _local3 * d;
} else {
this._x = -1000;
}
}
} else {
this.removeMovieClip();
}
};
this.totalSpecial = 2;
this.attachMovie("specialToolViewer", "specialToolViewer", 0);
this.specialToolViewer.tool.gotoAndStop(_local3);
this.specialToolName = _local3;
}
break;
case "\u6C7D\u5F39" :
if ((_parent.varHard != "hard") && (this.heroNum > totalPlayer)) {
_local4 = false;
} else {
this.totalSpecial = 2;
this.attachMovie("specialToolViewer", "specialToolViewer", 0);
this.specialToolViewer.tool.gotoAndStop(_local3);
this.specialToolName = _local3;
}
break;
case "\u51B0\u7BAD" :
if ((_parent.varHard != "hard") && (this.heroNum > totalPlayer)) {
_local4 = false;
} else {
this.totalSpecial = 1;
this.attachMovie("specialToolViewer", "specialToolViewer", 0);
this.specialToolViewer.tool.gotoAndStop(_local3);
this.specialToolName = _local3;
}
break;
case "\u706B\u7130\u7BAD" :
if ((_parent.varHard != "hard") && (this.heroNum > totalPlayer)) {
_local4 = false;
} else {
this.totalSpecial = 2;
this.attachMovie("specialToolViewer", "specialToolViewer", 0);
this.specialToolViewer.tool.gotoAndStop(_local3);
this.specialToolName = _local3;
}
break;
case "\u751F\u547D\u52A01" :
_parent["heroObj" + this.heroNum].life++;
_parent.allPan.mcBlink("lifeMc", this.heroNum);
break;
case "\u62A2\u624B" :
this.pushBombAble = true;
_parent.allPan.showMc("glove", this.heroNum, true);
break;
case "\u70B8\u5F39\u7CD6" :
_parent["heroObj" + this.heroNum].totalBomb = ++this.totalBomb;
_parent.allPan.mcBlink("totalBombMc", this.heroNum);
break;
case "\u76FE\u724C" :
this.shield = true;
_parent.allPan.showMc("shield", this.heroNum, true);
break;
case "\u5A01\u529B\u836F" :
if (this.bombLevel < 10) {
this.bombLevel++;
_parent.allPan.mcBlink("bomb", this.heroNum);
}
break;
case "\u98DE\u978B" :
if ((this.heroNum > totalPlayer) && (_parent.varHard != "hard")) {
_local4 = false;
} else {
if (this.vLevel <= 3) {
break;
}
this.vLevel--;
_parent.allPan.mcBlink("shoe", this.heroNum);
}
}
if (_local4) {
brickArea[this.bg.tool].gotoAndPlay("remove");
this.bg.tool = "";
var _local5 = _parent["heroObj" + this.heroNum];
_local5.toolScore = _local5.toolScore + 100;
_local5.score = _local5.score + 100;
_local5.totalScore = _local5.totalScore + 100;
_parent.allPan.upDate();
if (_parent.soundon) {
vo_sound.attachSound("tool.wav");
vo_sound.start();
}
}
}
}
};
return(true);
}
return(false);
}
function getBgStyle(sceneStyle) {
switch (sceneStyle) {
case 0 :
return(random(3) + 1);
case 1 :
return(random(2) + 4);
case 2 :
return(random(2) + 6);
case 3 :
return(random(3) + 8);
case 4 :
return(random(2) + 11);
}
}
function getBigBrickStyle(sceneStyle) {
switch (sceneStyle) {
case 0 :
return(52);
case 1 :
return(random(2) + 53);
case 2 :
return(random(2) + 55);
case 3 :
return(57);
case 4 :
return(58);
}
}
function calDepth(x, y, margin) {
return(((y * w) + (w - x)) * margin);
}
function pause() {
if (pausing) {
pausing = false;
_parent.music_btn.enabled = true;
} else {
pausing = true;
_parent.music_btn.enabled = false;
}
}
function isSave(x0, y0) {
var _local1 = bgArea[(("bg" + y0) + "_") + x0];
if (((((_local1 == undefined) || (_local1.expEnergy > 0)) || (_local1.bomb != "")) || (_local1.brick != "")) || (bgArea[(("expArea" + y0) + "_") + x0] != undefined)) {
return(false);
}
var _local6 = 0;
while (_local6 < 4) {
var _local8 = xy[_local6][0];
var _local7 = xy[_local6][1];
var _local5 = 1;
var _local3 = x0 + _local8;
var _local2 = y0 + _local7;
_local1 = bgArea[(("bg" + _local2) + "_") + _local3];
while (true) {
if ((_local1 == undefined) || (_local1.brick != "")) {
break;
}
var _local4 = bgArea[(("expArea" + _local2) + "_") + _local3];
if (((_local1.bomb != "") && (brickArea[_local1.bomb].bombLevel >= _local5)) || ((_local4 != undefined) && (_local4.bombLevel >= _local5))) {
return(false);
}
_local3 = _local3 + _local8;
_local2 = _local2 + _local7;
_local1 = bgArea[(("bg" + _local2) + "_") + _local3];
_local5++;
}
_local6++;
}
return(true);
}
function getScore(x0, y0) {
if (!isSave(x0, y0)) {
return(-1);
}
var _local2 = 0;
var _local1 = 0;
while (_local1 < 4) {
if (isSave(x0 + xy[_local1][0], y0 + xy[_local1][1])) {
_local2++;
}
_local1++;
}
return(_local2);
}
function disorder(arr) {
var _local4 = arr.length;
var _local6 = arr[_local4 - 1];
var _local1 = 0;
while (_local1 < _local4) {
var _local3 = random(_local4);
var _local5 = arr[_local1];
arr[_local1] = arr[_local3];
arr[_local3] = _local5;
_local1++;
}
if (_local6 == arr[0]) {
var _local5 = arr[_local4 - 1];
arr[_local4 - 1] = arr[0];
arr[0] = _local5;
}
}
game = this;
for (each in brickArea) {
brickArea[each].removeMovieClip();
}
for (each in bgArea) {
bgArea[each].removeMovieClip();
}
switch (_parent.varHard) {
case "easy" :
escapeRate = 20;
brickScore = 5;
break;
case "normal" :
escapeRate = 60;
brickScore = 10;
break;
case "hard" :
escapeRate = 100;
brickScore = 15;
}
w = 15;
h = 13;
d = 30;
xy = [[-1, 0], [0, -1], [1, 0], [0, 1]];
heroXy = [[3, 3], [w - 4, 3], [3, h - 4], [w - 4, h - 4]];
if (_parent.specialToolId >= 4) {
_parent.specialToolId = 0;
disorder(_parent.specialToolName_array);
trace("specialToolName_array=" + _parent.specialToolName_array);
} else {
_parent.specialToolId = _parent.specialToolId + 2;
}
if (_parent.bgMusicId >= 3) {
_parent.bgMusicId = 0;
disorder(_parent.bgMusic_array);
trace("bgMusic_array=" + _parent.bgMusic_array);
} else {
_parent.bgMusicId++;
}
trace((_parent.specialToolName_array[_parent.specialToolId] + ",") + _parent.specialToolName_array[_parent.specialToolId + 1]);
totalPlayer = _parent.totalPlayer;
var heroNum = 1;
while (heroNum <= totalPlayer) {
game["p" + heroNum] = _parent["p" + heroNum];
_parent["heroObj" + heroNum].heroId = game["p" + heroNum].heroId;
heroNum++;
}
var heroNum = (totalPlayer + 1);
while (heroNum <= 4) {
var j = 1;
while (j <= 4) {
var k = 1;
while (k <= heroNum) {
if (_parent["heroObj" + k].heroId == j) {
break;
}
k++;
}
if (k >= heroNum) {
_parent["heroObj" + heroNum].heroId = j;
break;
}
j++;
}
heroNum++;
}
_parent.upDateStageNum(++_parent.stageNum);
game.createEmptyMovieClip("bgMusic_mc", 100);
bgMusic_sound = new Sound(bgMusic_mc);
bgMusic_sound.onSoundComplete = function () {
this.start();
};
game.createEmptyMovieClip("vo_mc", 101);
vo_sound = new Sound(vo_mc);
soundPause = false;
_parent.allPan.init();
pausing = false;
sceneStyle = random(5);
switch (sceneStyle) {
case 0 :
brickStyle = [1, 2, 3, 4, 5, 6];
unbreakAbleStyle = [7, 8, 9];
break;
case 1 :
brickStyle = [10, 11, 12];
unbreakAbleStyle = [13, 14, 15, 16, 17, 18, 19];
break;
case 2 :
brickStyle = [20, 21, 22, 23];
unbreakAbleStyle = [24, 25, 26, 27, 28, 29, 30, 31];
break;
case 3 :
brickStyle = [32, 33, 34, 35, 36, 37, 38];
unbreakAbleStyle = [39, 40, 41];
break;
case 4 :
brickStyle = [42, 43, 44, 45, 46, 47];
unbreakAbleStyle = [48, 49, 50, 51];
}
disorder(brickStyle);
disorder(unbreakAbleStyle);
bgArea.margin = 1;
var bgStyle = getBgStyle(sceneStyle);
var y = 0;
while (y < h) {
var x = 0;
while (x < w) {
var bg = bgArea.attachMovie("bg", (("bg" + y) + "_") + x, calDepth(x, y, bgArea.margin), {brick:"", bomb:"", tool:"", expEnergy:0, expHeroNum:0, x:x, y:y, _x:x * d, _y:y * d});
bg.gotoAndStop(bgStyle);
x++;
}
y++;
}
brickArea.margin = 10;
var x0 = (int(w / 2) - 1);
var y0 = (int(h / 2) - 1);
var y = y0;
while (y <= (y0 + 1)) {
var x = x0;
while (x <= (x0 + 1)) {
bgArea[(("bg" + y) + "_") + x].brick = "unbreakAble";
x++;
}
y++;
}
brick = brickArea.attachMovie("brick", (("brick" + y0) + "_") + x0, calDepth(x0, y0 + 1, brickArea.margin), {unbreakAble:true, _x:x0 * d, _y:y0 * d});
brick.gotoAndStop(getBigBrickStyle(sceneStyle));
var ranMap = new Array();
var y = 0;
while (y < h) {
var x = 0;
while (x < w) {
var i = 0;
while (i < 4) {
var heroX = heroXy[i][0];
var heroY = heroXy[i][1];
if ((x == heroX) && (y == heroY)) {
break;
}
var j = 0;
while (j < 4) {
if ((x == (heroX + xy[j][0])) && (y == (heroY + xy[j][1]))) {
break;
}
j++;
}
if (j < 4) {
break;
}
i++;
}
if (i >= 4) {
ranMap.push([x, y]);
}
x++;
}
y++;
}
var ranMapL = ranMap.length;
var i = 0;
while (i < ranMapL) {
var ran = random(ranMapL);
var temp = ranMap[i];
ranMap[i] = ranMap[ran];
ranMap[ran] = temp;
i++;
}
var aroundXy = [[-1, 0], [-1, -1], [0, -1], [1, -1], [1, 0], [1, 1], [0, 1], [-1, 1]];
var i = 0;
while (i < 4) {
var heroX = heroXy[i][0];
var heroY = heroXy[i][1];
var j = 1;
while (j < 8) {
ranMap.unshift([heroX + aroundXy[j][0], heroY + aroundXy[j][1]]);
j = j + 2;
}
i++;
}
var i = 0;
while (i < ranMapL) {
var x0 = ranMap[i][0];
var y0 = ranMap[i][1];
if (bgArea[(("bg" + y0) + "_") + x0].brick == "") {
var j = 0;
while (j < 8) {
var k1 = ((j + 1) % 8);
var k2 = ((j + 2) % 8);
if (((bgArea[(("bg" + (y0 + aroundXy[j][1])) + "_") + (x0 + aroundXy[j][0])].brick != "") && (bgArea[(("bg" + (y0 + aroundXy[k1][1])) + "_") + (x0 + aroundXy[k1][0])].brick != "")) && (bgArea[(("bg" + (y0 + aroundXy[k2][1])) + "_") + (x0 + aroundXy[k2][0])].brick != "")) {
break;
}
j = j + 2;
}
if (j >= 8) {
if (bgArea[(("bg" + y0) + "_") + (x0 - 1)].brick == "") {
var empty = true;
var totalEmpty = 1;
var totalBrick = 0;
} else {
var empty = false;
var totalEmpty = 0;
var totalBrick = 1;
}
var j = 1;
while (j < 8) {
var brick = bgArea[(("bg" + (y0 + aroundXy[j][1])) + "_") + (x0 + aroundXy[j][0])].brick;
if (empty) {
if (brick != "") {
empty = false;
totalBrick++;
}
} else if (brick == "") {
if ((j % 2) == 0) {
empty = true;
totalEmpty++;
} else {
var k = ((j + 1) % 8);
if (bgArea[(("bg" + (y0 + aroundXy[k][1])) + "_") + (x0 + aroundXy[k][0])].brick == "") {
empty = true;
totalEmpty++;
} else {
j = j + 2;
}
}
}
j++;
}
if ((totalEmpty + totalBrick) <= 3) {
bgArea[(("bg" + y0) + "_") + x0].brick = "unbreakAble";
var brick = brickArea.attachMovie("brick", (("brick" + y0) + "_") + x0, calDepth(x0, y0, brickArea.margin), {unbreakAble:true, _x:x0 * d, _y:y0 * d});
brick.gotoAndStop(unbreakAbleStyle[random(2)]);
}
}
}
i++;
}
delete ranMap;
delete aroundXy;
Key.addListener(this);
Symbol 561 MovieClip Frame 2
this.onKeyUp = function () {
var _local2 = Key.getCode();
var _local1 = 1;
while (_local1 <= totalPlayer) {
if (_local2 == game["p" + _local1].fireKey) {
brickArea["hero" + _local1].puttAble = true;
}
_local1++;
}
};
_parent.timer.timeInit();
_parent.timer.timeStart();
_parent.allPan.init();
pausing = false;
_parent.pause_btn.enabled = true;
_parent.music_btn.enabled = true;
bgMusic_sound.attachSound(_parent.bgMusic_array[_parent.bgMusicId]);
if (_parent.soundon) {
bgMusic_sound.start();
}
for (each in bgArea) {
var mc = bgArea[each];
if (mc.getDepth() > (w * h)) {
mc.removeMovieClip();
} else {
mc.expEnergy = 0;
}
}
for (each in brickArea) {
var mc = brickArea[each];
if (mc.unbreakAble != true) {
mc.removeMovieClip();
}
}
var styleL = ((4 < brickStyle.length) ? 4 : (brickStyle.length));
var y = 0;
while (y < h) {
var x = 0;
while (x < w) {
var bg = bgArea[(("bg" + y) + "_") + x];
if (bg.brick != "unbreakAble") {
bg.brick = "";
bg.bomb = "";
bg.tool = "";
bg.expHeroNum = 0;
bg.expEnergy = 0;
if (random(100) < 60) {
var brick = brickArea.attachMovie("brick", (("brick" + y) + "_") + x, calDepth(x, y, brickArea.margin), {_x:x * d, _y:y * d});
brick.gotoAndStop(brickStyle[random(styleL)]);
bg.brick = (("brick" + y) + "_") + x;
}
}
x++;
}
y++;
}
heroId = 0;
var heroNum = 1;
while (heroNum <= 4) {
var heroObj = _parent["heroObj" + heroNum];
heroObj.totalBomb = 1;
heroObj.score = 0;
heroObj.killScore = 0;
heroObj.timeScore = 0;
heroObj.toolScore = 0;
heroObj.brickScore = 0;
heroObj.bonus = 0;
var heroId = heroObj.heroId;
x0 = heroXy[heroId - 1][0];
y0 = heroXy[heroId - 1][1];
var life = heroObj.life;
if (life > 0) {
var bg = bgArea[(("bg" + y0) + "_") + x0];
brickArea[bg.brick].removeMovieClip();
bg.brick = "";
var hero = brickArea.attachMovie("hero" + heroId, "hero" + heroNum, calDepth(x0, y0, brickArea.margin) - heroNum, {puttAble:true, slowVLevel:0, stopTime:0, slowTime:-1, heroId:heroId, heroNum:heroNum, varShield:60 + random(4), life:life, prevFire:false, pushBombAble:false, shield:false, vLevel:6, bombLevel:1, totalBomb:1, moving:false, x:x0, y:y0, _x:x0 * d, _y:y0 * d});
if (heroNum <= totalPlayer) {
hero.p = game["p" + heroNum];
if (_parent.varHard == "easy") {
hero.shield = true;
_parent.allPan.showMc("shield", heroNum, true);
}
var p_pointer = hero.attachMovie("p_pointer", "p_pointer", 0, {delayTime:150});
p_pointer.p.gotoAndStop(heroId + ((heroNum - 1) * 4));
p_pointer.arrow.gotoAndStop(heroId);
p_pointer.onEnterFrame = function () {
if (pausing) {
return(0);
}
if ((--this.delayTime) <= 0) {
this.removeMovieClip();
}
};
}
hero.gotoAndStop("down");
hero.body.stop();
var i = 0;
while (i < 4) {
var x = (x0 + xy[i][0]);
var y = (y0 + xy[i][1]);
bgArea[(("bg" + y) + "_") + x].brick = "";
brickArea[(("brick" + y) + "_") + x].removeMovieClip();
i++;
}
}
heroNum++;
}
_parent.allPan.upDate();
game.onEnterFrame = function () {
if (pausing) {
return(0);
}
var _local15 = 0;
var _local16 = 0;
var _local6 = 1;
while (_local6 <= 4) {
var _local2 = brickArea["hero" + _local6];
if (_local2 != undefined) {
if (_local2.varShield > 0) {
if ((--_local2.varShield) % 2) {
_local2._alpha = 30;
} else {
_local2._alpha = 100;
}
} else {
var _local13 = bgArea[(("bg" + Math.round(_local2._y / d)) + "_") + Math.round(_local2._x / d)];
if (_local13.expEnergy > 0) {
if (_local13.expHeroNum != _local2.heroNum) {
var _local11 = _parent["heroObj" + _local13.expHeroNum];
_local11.killScore = _local11.killScore + 1000;
_local11.score = _local11.score + 1000;
_local11.totalScore = _local11.totalScore + 1000;
_parent.allPan.upDate();
}
hurtHero(_local2);
}
}
if (_local2.slowTime > 0) {
_local2.slowTime--;
}
if (_local6 <= totalPlayer) {
_local15++;
if (_local2.moving) {
if (Key.isDown(game["p" + _local6].fireKey)) {
_local2.prevFire = true;
}
} else {
if (_local2.slowTime == 0) {
trace("\u6062\u590D");
_local2.slowTime = -1;
}
if (_local2.stopTime > 0) {
_local2.stopTime--;
} else {
var _local12 = game["p" + _local6];
var _local4 = 0;
while (_local4 < 4) {
if (Key.isDown(_local12["key" + _local4])) {
movHero(_local2, _local4);
break;
}
_local4++;
}
if (Key.isDown(_local12.fireKey) || (_local2.prevFire)) {
_local2.prevFire = false;
if (_local2.totalSpecial > 0) {
putSpecial(_local2);
} else {
putBomb(_local2);
}
}
}
}
} else {
_local16++;
if (_local2.moving == false) {
if (_local2.slowTime == 0) {
trace("\u6062\u590D");
_local2.slowTime = -1;
}
if (_local2.stopTime > 0) {
_local2.stopTime--;
} else if (isSave(_local2.x, _local2.y)) {
if (random(100) < 20) {
var _local10 = 0;
var _local7 = -1;
var _local14 = random(4);
var _local4 = 0;
while (_local4 < 4) {
var _local3 = (_local14 + _local4) % 4;
var _local9 = xy[_local3][0];
var _local8 = xy[_local3][1];
var _local5 = getScore(_local2.x + _local9, _local2.y + _local8);
if (_local5 > 0) {
if (bgArea[(("bg" + (_local2.y + _local8)) + "_") + (_local2.x + _local9)].tool != "") {
_local5 = _local5 + 5;
}
_local5 = _local5 + random(3);
if (_local5 >= _local10) {
_local10 = _local5;
_local7 = _local3;
}
}
_local4++;
}
if (_local7 >= 0) {
movHero(_local2, _local7);
}
} else if (random(100) < 5) {
var _local10 = 0;
var _local7 = -1;
var _local14 = random(4);
var _local4 = 0;
while (_local4 < 4) {
var _local3 = (_local14 + _local4) % 4;
var _local9 = xy[_local3][0];
var _local8 = xy[_local3][1];
var _local5 = getScore(_local2.x + _local9, _local2.y + _local8);
if (_local5 > 0) {
if (_local5 >= _local10) {
_local10 = _local5;
_local7 = _local3;
}
}
_local4++;
}
if ((_local7 >= 0) && (_local10 >= 2)) {
if (_local2.totalSpecial > 0) {
putSpecial(_local2);
} else {
putBomb(_local2);
}
movHero(_local2, _local7);
}
}
} else if (random(100) < escapeRate) {
var _local10 = 0;
var _local7 = -1;
var _local14 = random(4);
var _local4 = 0;
while (_local4 < 4) {
var _local3 = (_local14 + _local4) % 4;
var _local5 = getScore(_local2.x + xy[_local3][0], _local2.y + xy[_local3][1]);
if (_local5 >= _local10) {
_local10 = _local5;
_local7 = _local3;
}
_local4++;
}
if (_local7 < 0) {
_local7 = random(4);
}
movHero(_local2, _local7);
}
}
}
}
_local6++;
}
if (_local15 <= 0) {
gameover("lose");
} else if (_local16 <= 0) {
gameover("win");
}
};
Symbol 561 MovieClip Frame 3
stop();
Symbol 563 Button
on (release) {
if (_parent.stageClear) {
_parent.game.gotoAndPlay(1);
} else {
_parent.game.gotoAndPlay(2);
}
gotoAndStop (1);
}
Symbol 600 MovieClip Frame 1
function f() {
hitArea.enabled = false;
if (_parent.stageClear) {
continue_mc.gotoAndStop(2);
} else {
continue_mc.gotoAndStop(1);
}
var _local3 = 1;
while (_local3 <= _parent.totalPlayer) {
var _local4 = _parent["heroObj" + _local3];
this["killScore" + _local3] = _local4.killScore;
this["destruction" + _local3] = _local4.brickScore + _local4.toolScore;
this["timeScore" + _local3] = _local4.timeScore;
this["bonus" + _local3] = _local4.bonus;
this["score" + _local3] = _local4.score;
this["totalScore" + _local3] = _local4.totalScore;
_local3++;
}
Key.addListener(this);
this.onKeyUp = function () {
if (_parent.stageClear) {
_parent.game.gotoAndPlay(1);
} else {
_parent.game.gotoAndPlay(2);
}
gotoAndStop (1);
};
}
stop();
Key.removeListener(this);
Symbol 600 MovieClip Frame 2
f();
Symbol 600 MovieClip Frame 3
f();
Symbol 611 Button
on (release) {
submit_f();
_parent.gotoAndStop("highscore");
}
Symbol 626 MovieClip Frame 1
function submit_f() {
var _local3 = 1;
while (_local3 <= _parent.totalPlayer) {
_parent.highScore_arr.push([_parent["playerName" + _local3], this["totalScore" + _local3]]);
_local3++;
}
_parent.gameSave();
}
totalScore1 = _parent.heroObj1.totalScore;
totalScore2 = _parent.heroObj2.totalScore;
if (_parent.stageNum == (_parent.totalStage + 1)) {
gameover_welldone.gotoAndStop(_parent.varHard);
switch (_parent.varHard) {
case "easy" :
_parent.varHard = "normal";
break;
case "normal" :
_parent.varHard = "hard";
}
} else {
gameover_welldone.stop();
}
gotoAndStop(_parent.totalPlayer);
Symbol 664 Button
on (release) {
gotoAndStop ("menu");
}