Frame 1
stop();
_focusrect = false;
var moreGameLink = "http://playcow.com";
var playCowLink = "http://playcow.com";
var linkMethod = "_blank";
var showLoadingOver = false;
var twitterLink = "http://www.twitter.com/playcow";
var facebookLink = "http://www.facebook.com/pages/PlayCow/126005204300 ";
blockCellSize = 24;
initBlockLockX = 224;
initBlockLockY = 151;
numOfBlockX = 9;
numOfBlockY = 7;
mapDatSt0 = "200706000015171014050504044717161414050504440617141410000444003";
mapDatSt1 = "200607050017141416050706050710101014060507040414141410070504003";
mapDatSt2 = "200767450011101114050604040710171017070406040611101110056747003";
mapDatSt3 = "200704050045060404060704050705060404070407040404060440060407003";
mapDatSt4 = "200706050015171614067440400710101014064403444514101410064044403";
endingWay = 1;
urlTo55Shock = "";
windowTo55Shock = "_blank";
loadOutsideSound_flag = 0;
gotoPlayFrm_flag = 0;
showMakeStageBtnInTitle_flag = 0;
if (loadOutsideSound_flag == 1) {
loadMovie ("sounds_mc.swf", sounds_mc);
}
this.onEnterFrame = function () {
bytesL = this.getBytesLoaded();
bytesT = this.getBytesTotal();
bytesP = Math.round((bytesL / bytesT) * 100);
loading_mc.meter_mc.gotoAndStop(bytesP);
progress_txt.text = ((((Math.round(bytesL / 1024) + "KB / ") + Math.round(bytesT / 1024)) + "KB ") + bytesP) + "%";
if ((bytesP == 100) && (!_root.showLoadingOver)) {
loading_mc.meter_mc._visible = false;
}
if ((bytesP == 100) && (_root.showLoadingOver)) {
if (gotoPlayFrm_flag == 0) {
gotoAndStop ("title_frm");
} else if (gotoPlayFrm_flag == 1) {
gotoAndStop ("play_frm");
}
delete this.onEnterFrame;
}
};
Frame 12
_root.sounds_mc.gotoAndPlay("BTL_NORMAL_stop");
_root.sounds_mc.gotoAndPlay("LEVEL_END");
_root.sounds_mc.gotoAndPlay("BTL_NORMAL_start");
twitterBtn.onRelease = function () {
getURL (_root.twitterLink, linkMethod);
};
facebookBtn.onRelease = function () {
getURL (_root.facebookLink, linkMethod);
};
Frame 32
_root.sounds_mc.gotoAndPlay("BTL_NORMAL_stop");
moreGames.onRelease = function () {
getURL (_root.moreGameLink, _root.linkMethod);
};
Symbol 11 MovieClip Frame 1
stop();
sndObj = new Sound();
Symbol 11 MovieClip Frame 6
stop();
trace("BTL_NORMAL_START");
Symbol 11 MovieClip Frame 11
stop();
trace("BTL_NORMAL_STOP");
Symbol 11 MovieClip Frame 16
stop();
trace("JG_END");
Symbol 11 MovieClip Frame 21
stop();
trace("JG_START");
Symbol 11 MovieClip Frame 26
stop();
trace("SE_bomb1");
Symbol 11 MovieClip Frame 31
stop();
trace("SE_gongs");
Symbol 11 MovieClip Frame 36
stop();
trace("SE_kettei");
Symbol 11 MovieClip Frame 41
stop();
trace("SE_power_up");
Symbol 11 MovieClip Frame 46
stop();
trace("SE_putBomb");
Symbol 11 MovieClip Frame 51
stop();
trace("yeah~~~");
Symbol 11 MovieClip Frame 56
stop();
trace("SE");
Symbol 11 MovieClip Frame 60
stop();
Symbol 11 MovieClip Frame 61
Symbol 11 MovieClip Frame 63
stop();
Symbol 11 MovieClip Frame 64
stop();
trace("JG_START");
Symbol 20 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 211
_root.showLoadingOver = true;
Symbol 58 MovieClip Frame 1
stop();
Symbol 60 Button
on (rollOver) {
makeMapBtn_mc.gotoAndStop(2);
}
on (rollOut) {
makeMapBtn_mc.gotoAndStop(1);
}
on (release) {
_parent.gotoAndStop("makeMap_frm");
}
Symbol 66 Button
on (rollOver) {
_root.sounds_mc.gotoAndPlay("SE_select");
startBtn_mc.gotoAndStop(2);
}
on (rollOut) {
startBtn_mc.gotoAndStop(1);
}
on (release) {
_root.sounds_mc.gotoAndPlay("SE_kettei");
_parent.gotoAndStop("play_frm");
trace("go go go man man man~~~");
}
Symbol 71 Button
on (press) {
soundMark_mc.nextFrame();
}
Symbol 74 MovieClip Frame 1
function setSoundVol_func(v) {
_root.sounds_mc.sndObj.setVolume(v);
}
stop();
setSoundVol_func(100);
Symbol 74 MovieClip Frame 2
stop();
setSoundVol_func(0);
Symbol 74 MovieClip Frame 3
gotoAndStop (1);
Symbol 75 MovieClip Frame 1
stop();
Symbol 76 MovieClip Frame 1
if (_parent.showMakeStageBtnInTitle_flag == 0) {
makeMapBtn_btn.enabled = false;
makeMapBtn_mc._visible = false;
makeMapBtn_mc._x = 5000;
}
moreGames.onRelease = function () {
getURL (_root.moreGameLink, _root.linkMethod);
};
playCow._xscale = 70;
playCow._yscale = 70;
playCow.onRelease = function () {
getURL (_root.playCowLink, _root.linkMethod);
};
Instance of Symbol 74 MovieClip "soundMark_mc" in Symbol 76 MovieClip Frame 1
onClipEvent (load) {
vol = _root.sounds_mc.sndObj.getVolume();
if (vol == 0) {
gotoAndStop (2);
}
}
Symbol 76 MovieClip Frame 11
stop();
Symbol 83 MovieClip Frame 1
stop();
Symbol 83 MovieClip Frame 10
_parent.bombDisp_mc.gotoAndStop("allClear_frm");
_root.sounds_mc.gotoAndPlay("JG_END");
Symbol 83 MovieClip Frame 127
stop();
Symbol 85 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 39
_parent.fadePanel_mc.gotoAndPlay("out_frm");
Symbol 86 MovieClip Frame 54
_parent.gotoAndStop("empty_frm");
Symbol 86 MovieClip Frame 66
stop();
_parent.stNum++;
if (_parent.stNum < 5) {
_parent.textDisp_mc.gotoAndStop(1);
_parent.gotoAndPlay("play_frm");
} else {
_parent.ending_mc.gotoAndPlay(2);
}
Symbol 87 MovieClip Frame 1
stop();
Symbol 87 MovieClip Frame 2
_root.sounds_mc.gotoAndPlay("JG_END");
Symbol 87 MovieClip Frame 30
_parent.bombDisp_mc.gotoAndStop("lose_frm");
Symbol 87 MovieClip Frame 90
_parent.fadePanel_mc.gotoAndPlay("out_frm");
Symbol 87 MovieClip Frame 147
stop();
Symbol 88 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 2
_parent.initPerRound_func();
_parent.fadePanel_mc.gotoAndPlay("in_frm");
Symbol 88 MovieClip Frame 13
_parent.startCharaImg_mc.gotoAndPlay("p" + _parent.stNum);
_root.sounds_mc.gotoAndPlay("JG_START");
Symbol 88 MovieClip Frame 66
_parent.textDisp_mc.gotoAndPlay("yoi_frm");
Symbol 88 MovieClip Frame 101
tmp_array = _parent.retMainCharaLoc_func(_parent.mapDat);
k = 0;
while (k <= (_parent.bombNumInSt - 1)) {
if (_parent.playBombAI_flag == 1) {
_parent.setBombAI_func(1, k + 1);
}
k++;
}
_parent.setKeyAction_func();
mDat = _parent.mapDat;
mapDat1Ps = "";
j = 0;
while (j <= (_parent.numOfBlockV - 1)) {
i = 0;
while (i <= (_parent.numOfBlockH - 1)) {
mapDat1P = mDat.substr(i + (j * _parent.numOfBlockH), 1);
if (mapDat1P == "3") {
mapDat1P = "0";
} else if (mapDat1P == "2") {
mapDat1P = "0";
}
mapDat1Ps = mapDat1Ps + String(mapDat1P);
i++;
}
j++;
}
_parent.mapDat = mapDat1Ps;
_parent.textDisp_mc.gotoAndPlay("start_frm");
_parent.keyLock_flag = 0;
_root.sounds_mc.gotoAndPlay("BTL_NORMAL_start");
Symbol 88 MovieClip Frame 114
stop();
Symbol 110 MovieClip Frame 1
depFi_txt.text = getDepth();
stop();
Symbol 110 MovieClip Frame 8
stop();
Symbol 115 MovieClip Frame 53
gotoAndPlay (1);
Symbol 123 MovieClip Frame 1
stop();
depFi_txt.text = getDepth();
Symbol 123 MovieClip Frame 9
gotoAndStop (1);
Symbol 142 MovieClip Frame 1
stop();
Symbol 156 MovieClip Frame 20
if (_parent.deadAndRem_flag != 1) {
stop();
}
Symbol 156 MovieClip Frame 32
stop();
Symbol 159 MovieClip Frame 11
stop();
Symbol 160 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 1
stop();
Symbol 183 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 32
stop();
Symbol 202 MovieClip Frame 11
stop();
Symbol 203 MovieClip Frame 1
stop();
Symbol 205 MovieClip Frame 1
depFi_txt.text = getDepth();
if (_name == "bomb_mc") {
stop();
}
Symbol 205 MovieClip Frame 59
stop();
_parent._parent.bombEnd_func(this, charaNum, fireL, 0);
Symbol 214 MovieClip Frame 9
stop();
Symbol 231 MovieClip Frame 1
if (_name.substr(0, 4) == "fire") {
stop();
}
stop();
Symbol 232 MovieClip Frame 1
if (_name.substr(0, 4) == "fire") {
stop();
}
stop();
Symbol 244 MovieClip Frame 1
stop();
Symbol 244 MovieClip Frame 3
stop();
Symbol 244 MovieClip Frame 14
stop();
Symbol 244 MovieClip Frame 52
stop();
Symbol 244 MovieClip Frame 58
stop();
Symbol 244 MovieClip Frame 69
stop();
Symbol 244 MovieClip Frame 79
stop();
Symbol 256 MovieClip Frame 1
gotoAndStop(_parent._parent.stNum + 1);
Symbol 271 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 46
stop();
Symbol 271 MovieClip Frame 93
stop();
Symbol 271 MovieClip Frame 140
stop();
Symbol 271 MovieClip Frame 187
stop();
Symbol 271 MovieClip Frame 234
stop();
Symbol 272 MovieClip Frame 1
stop();
Symbol 272 MovieClip Frame 10
stop();
Symbol 272 MovieClip Frame 25
stop();
Symbol 272 MovieClip Frame 26
stop();
Symbol 278 Button
on (rollOver) {
_root.sounds_mc.gotoAndPlay("SE_select");
to55ShockBtn_mc.gotoAndStop(2);
}
on (rollOut) {
to55ShockBtn_mc.gotoAndStop(1);
}
on (release) {
_root.sounds_mc.gotoAndPlay("SE_kettei");
getURL (_parent._parent._parent.urlTo55Shock, _parent._parent._parent.windowTo55Shock);
}
Symbol 279 MovieClip Frame 1
stop();
Symbol 280 Button
on (rollOver) {
_root.sounds_mc.gotoAndPlay("SE_select");
toTitleBtn_mc.gotoAndStop(2);
}
on (rollOut) {
toTitleBtn_mc.gotoAndStop(1);
}
on (release) {
_root.sounds_mc.gotoAndPlay("SE_kettei");
_parent._parent._parent.gotoAndStop("title_frm");
}
Symbol 281 MovieClip Frame 1
stop();
Symbol 282 MovieClip Frame 30
stop();
if (_parent._parent._parent.endingWay == 0) {
_parent._parent.toTitleBtn_mc._visible = false;
_parent._parent.toTitleBtn_btn.enabled = false;
to55ShockBtn_mc._visible = false;
to55ShockBtn_btn.enabled = false;
} else if (_parent._parent._parent.endingWay == 1) {
toTitleBtn_mc._visible = false;
toTitleBtn_btn.enabled = false;
}
Symbol 289 MovieClip Frame 20
stop();
if (_parent._parent._parent.endingWay == 0) {
_parent._parent.toTitleBtn_mc._visible = false;
_parent._parent.toTitleBtn_btn.enabled = true;
to55ShockBtn_mc._visible = false;
to55ShockBtn_btn.enabled = false;
} else if (_parent._parent._parent.endingWay == 1) {
toTitleBtn_mc._visible = false;
toTitleBtn_btn.enabled = false;
}
Symbol 290 MovieClip Frame 1
stop();
Symbol 295 Button
on (rollOver) {
_root.sounds_mc.gotoAndPlay("SE_select");
toTitleBtn_mc.gotoAndStop(2);
}
on (rollOut) {
toTitleBtn_mc.gotoAndStop(1);
}
on (release) {
_root.sounds_mc.gotoAndPlay("SE_kettei");
_parent.gotoAndStop("title_frm");
}
Symbol 296 MovieClip Frame 1
function init_func() {
stNum = 0;
cellSize = _parent.blockCellSize;
cellStartX = _parent.initBlockLockX;
cellStartY = _parent.initBlockLockY;
numOfBlockH = _parent.numOfBlockX;
numOfBlockV = _parent.numOfBlockY;
bombNumInSt_array = [];
i = 0;
while (i <= 4) {
num = 0;
mapDat = _parent["mapDatSt" + i];
mapDatL = mapDat.length;
j = 0;
while (j <= (mapDatL - 1)) {
mapDat1P = mapDat.substr(j, 1);
if (mapDat1P == "3") {
num++;
}
j++;
}
bombNumInSt_array.push(num);
i++;
}
bomCol = ["ye", "bl", "re", "re", "bk"];
i = 0;
while (i <= 4) {
partsImgs_mc[bomCol[i]].gotoAndStop("empty");
i++;
}
charaHitAreaOffset = 0;
itemLevelMax0 = 6;
itemLevelMax1 = 6;
itemLevelMax2 = 6;
i = 0;
while (i <= 2) {
this["initSpdCharaM" + i] = 2;
this["initBombCharaM" + i] = 1;
this["initBakufuCharaM" + i] = 1;
i++;
}
burnTime = 10;
fireDepMin = 100;
fireDepMax = 500;
cFireDep = [];
i = 0;
while (i <= (numOfBlockV - 1)) {
cFireDep[i] = fireDepMin;
i++;
}
playBombAI_flag = 1;
}
function initPerRound_func() {
bombNumInSt = bombNumInSt_array[stNum];
i = 0;
while (i <= (bombNumInSt - 1)) {
duplicateMovieClip (partsImgs_mc[bomCol[stNum]], ("charaMain" + (i + 1)) + "_mc", 20000 + i);
partsImgs_mc.charaMain1_mc._x = 50;
partsImgs_mc.charaMain1_mc._y = 50;
i++;
}
mapDat = _parent["mapDatSt" + stNum];
putMapImg_func(cellSize, cellStartX, cellStartY, numOfBlockH, numOfBlockV);
putBombFlag_array = [];
j = 0;
while (j <= (numOfBlockV - 1)) {
putBombFlag_array[j] = [];
i = 0;
while (i <= (numOfBlockH - 1)) {
putBombFlag_array[j][i] = 0;
i++;
}
j++;
}
recBombMC_array = [];
j = 0;
while (j <= (numOfBlockV - 1)) {
recBombMC_array[j] = [];
i = 0;
while (i <= (numOfBlockH - 1)) {
recBombMC_array[j][i] = "";
i++;
}
j++;
}
burnMap_array = [];
j = 0;
while (j <= (numOfBlockV - 1)) {
burnMap_array[j] = [];
i = 0;
while (i <= (numOfBlockH - 1)) {
burnMap_array[j][i] = 0;
i++;
}
j++;
}
dontThroughCellFlag_array = [];
k = 0;
while (k <= bombNumInSt) {
dontThroughCellFlag_array[k] = [];
j = 0;
while (j <= (numOfBlockV - 1)) {
dontThroughCellFlag_array[k][j] = [];
i = 0;
while (i <= (numOfBlockH - 1)) {
mapDat1P = mapDat.substr(i + (j * numOfBlockH), 1);
if (((((mapDat1P == "1") || (mapDat1P == "4")) || (mapDat1P == "5")) || (mapDat1P == "6")) || (mapDat1P == "7")) {
dontThroughCellFlag_array[k][j][i] = 1;
} else {
dontThroughCellFlag_array[k][j][i] = 0;
}
i++;
}
j++;
}
k++;
}
onewayMap = [];
k = 0;
while (k <= bombNumInSt) {
onewayMap[k] = [];
j = 0;
while (j <= (numOfBlockV - 1)) {
onewayMap[k][j] = [];
i = 0;
while (i <= (numOfBlockH - 1)) {
onewayMap[k][j][i] = [0, 0];
i++;
}
j++;
}
k++;
}
recItemMapLoc_array = [];
j = 0;
while (j <= (numOfBlockV - 1)) {
recItemMapLoc_array[j] = [];
i = 0;
while (i <= (numOfBlockH - 1)) {
recItemMapLoc_array[j][i] = "";
i++;
}
j++;
}
recItemMC_array = [];
j = 0;
while (j <= (numOfBlockV - 1)) {
recItemMC_array[j] = [];
i = 0;
while (i <= (numOfBlockH - 1)) {
recItemMC_array[j][i] = "";
i++;
}
j++;
}
changeMapImg_func(mapDat, numOfBlockH, numOfBlockV);
itemLevel = [];
i = 0;
while (i <= bombNumInSt) {
itemLevel[i] = [];
itemLevel[i][0] = 0;
itemLevel[i][1] = 0;
itemLevel[i][2] = 0;
i++;
}
dispItemLevel_func(0, itemLevel[0][0], 0);
dispItemLevel_func(1, itemLevel[0][1], 0);
dispItemLevel_func(2, itemLevel[0][2], 0);
i = 0;
while (i <= bombNumInSt) {
this[("charaM" + i) + "_spd"] = this["initSpdCharaM" + i] + itemLevel[i][1];
this[("numOfPutBombM" + i) + "Max"] = this["initBombCharaM" + i] + itemLevel[i][2];
this["numOfPutBombM" + i] = 0;
this["fireLengthP" + i] = this["initBakufuCharaM" + i] + itemLevel[i][0];
i++;
}
tmp_array = retMainCharaLoc_func(mapDat);
numOfCPU = (tmp_array.length / 3) - 1;
l = tmp_array.length / 3;
i = 0;
while (i <= (l - 1)) {
charaNum = tmp_array[i * 3];
xLoc = tmp_array[(i * 3) + 1];
yLoc = tmp_array[(i * 3) + 2];
partsImgs_mc[("charaMain" + charaNum) + "_mc"]._x = cellStartX + (xLoc * cellSize);
partsImgs_mc[("charaMain" + charaNum) + "_mc"]._y = cellStartY + (yLoc * cellSize);
partsImgs_mc[("charaMain" + charaNum) + "_mc"].gotoAndStop("waitD_frm");
baseLocY = Math.floor((((this.y - cellStartY) + cellSize) - 1) / cellSize);
dep = ((yLoc * 1000) + 50) + (i * 10);
partsImgs_mc[("charaMain" + i) + "_mc"].swapDepths(dep);
i++;
}
dead_flags = [];
doneDeadFunc_flags = [];
i = 0;
while (i <= ((bombNumInSt + 1) - 1)) {
dead_flags[i] = 0;
doneDeadFunc_flags[i] = 0;
i++;
}
deadCNum_array = [];
numOfShowItem = 0;
doneDecideWinLoseFunc_flag = 0;
brokenWall_array = [];
brokenWall_arrayCnt = 0;
putBombID = 0;
}
function putMapImg_func(w, initX, initY, numOfH, numOfV) {
var _local1;
var _local2;
var _local3;
var _local4;
_local2 = 0;
while (_local2 <= (numOfV - 1)) {
_local1 = 0;
while (_local1 <= (numOfH - 1)) {
_local3 = ("m" + String(_local2)) + String(_local1);
_local4 = (1000 * _local2) + _local1;
duplicateMovieClip ("partsImgs_mc.mapImgs_mc", _local3, _local4);
partsImgs_mc[_local3]._x = initX + (_local1 * w);
partsImgs_mc[_local3]._y = initY + (_local2 * w);
_local1++;
}
_local2++;
}
partsImgs_mc.mapImgs_mc.swapDepths(partsImgs_mc.getNextHighestDepth());
removeMovieClip(partsImgs_mc.mapImgs_mc);
}
function changeMapImg_func(mapD, numOfH, numOfV) {
var _local2;
var _local1;
var _local3;
var _local6;
var _local4;
var _local5;
_local5 = 100;
_local2 = 0;
while (_local2 <= (numOfV - 1)) {
_local1 = 0;
while (_local1 <= (numOfH - 1)) {
_local3 = mapD.substr(_local1 + (_local2 * numOfH), 1);
_local6 = ("m" + String(_local2)) + String(_local1);
if ((_local3 == "2") || (_local3 == "3")) {
partsImgs_mc[_local6].gotoAndStop(1);
} else if (_local3 == "4") {
_local5 = ((1000 * _local2) + _local1) + 10;
_local5 = ((1000 * _local2) + _local1) + 10;
_local4 = ("bb" + String(_local2)) + String(_local1);
partsImgs_mc.breakableBlock_mc.duplicateMovieClip(_local4, _local5);
_local5++;
partsImgs_mc[_local4]._x = (_local1 * cellSize) + cellStartX;
partsImgs_mc[_local4]._y = (_local2 * cellSize) + cellStartY;
partsImgs_mc[_local6].gotoAndStop(1);
} else if (((_local3 == "5") || (_local3 == "6")) || (_local3 == "7")) {
if (_local3 == "5") {
recItemMapLoc_array[_local2][_local1] = 1;
} else if (_local3 == "6") {
recItemMapLoc_array[_local2][_local1] = 0;
} else if (_local3 == "7") {
recItemMapLoc_array[_local2][_local1] = 2;
}
rewriteMapDat_func(_local1, _local2, 4);
_local5 = ((1000 * _local2) + _local1) + 10;
_local5 = ((1000 * _local2) + _local1) + 10;
_local4 = ("bb" + String(_local2)) + String(_local1);
partsImgs_mc.breakableBlock_mc.duplicateMovieClip(_local4, _local5);
partsImgs_mc[_local4]._x = (_local1 * cellSize) + cellStartX;
partsImgs_mc[_local4]._y = (_local2 * cellSize) + cellStartY;
partsImgs_mc[_local6].gotoAndStop(1);
} else {
partsImgs_mc[_local6].gotoAndStop(Number(_local3) + 1);
}
_local1++;
}
_local2++;
}
}
function rewriteMapDat_func(x, y, num) {
var _local1;
var _local2;
var _local3;
_local1 = x + (y * numOfBlockH);
_local2 = mapDat.substr(0, _local1);
_local3 = mapDat.substr(_local1 + 1);
mapDat = (_local2 + String(num)) + _local3;
}
function retMainCharaLoc_func(mDat) {
var _local1;
var _local3;
var _local6;
var _local8;
var _local4;
var _local2;
var _local5;
_local2 = [];
_local5 = 1;
_local6 = numOfBlockH;
_local8 = numOfBlockV;
_local3 = 0;
while (_local3 <= (_local8 - 1)) {
_local1 = 0;
while (_local1 <= (_local6 - 1)) {
_local4 = mDat.substr(_local1 + (_local3 * _local6), 1);
if (_local4 == "3") {
_local2.push(String(_local5));
_local2.push(_local1);
_local2.push(_local3);
_local5++;
} else if (_local4 == "2") {
_local2.push("0");
_local2.push(_local1);
_local2.push(_local3);
}
_local1++;
}
_local3++;
}
return(_local2);
}
function setKeyAction_func() {
charaM0_DirL = 0;
charaM0_DirR = 0;
charaM0_DirU = 0;
charaM0_DirD = 0;
keyListener.onKeyDown = function () {
if (keyLock_flag == 0) {
if (Key.getCode() == "37") {
charaM0_DirL = -1;
charaM0_imgDir = "L";
charaM0_DirR = 0;
charaM0_DirU = 0;
charaM0_DirD = 0;
partsImgs_mc.charaMain0_mc.gotoAndStop(("walk" + charaM0_imgDir) + "_frm");
} else if (Key.getCode() == "39") {
charaM0_DirR = 1;
charaM0_DirL = 0;
charaM0_DirU = 0;
charaM0_DirD = 0;
charaM0_imgDir = "R";
partsImgs_mc.charaMain0_mc.gotoAndStop(("walk" + charaM0_imgDir) + "_frm");
} else if (Key.getCode() == "38") {
charaM0_DirU = -1;
charaM0_DirD = 0;
charaM0_DirL = 0;
charaM0_DirR = 0;
charaM0_imgDir = "U";
partsImgs_mc.charaMain0_mc.gotoAndStop(("walk" + charaM0_imgDir) + "_frm");
} else if (Key.getCode() == "40") {
charaM0_DirD = 1;
charaM0_DirU = 0;
charaM0_DirL = 0;
charaM0_DirR = 0;
charaM0_imgDir = "D";
partsImgs_mc.charaMain0_mc.gotoAndStop(("walk" + charaM0_imgDir) + "_frm");
} else if ((((Key.getCode() == "32") || (Key.getCode() == "65")) || (Key.getCode() == "129")) || (Key.getCode() == "229")) {
if (numOfPutBombM0 < numOfPutBombM0Max) {
tmp_array = retCharaLoc_func(partsImgs_mc.charaMain0_mc);
bomb_flag = putBombFlag_array[tmp_array[1]][tmp_array[0]];
if (bomb_flag == 0) {
putBombFlag_array[tmp_array[1]][tmp_array[0]] = 1;
makeBombThroughAction_func(tmp_array[0], tmp_array[1]);
checkPutNewBombAround_func(tmp_array[0], tmp_array[1]);
setOnewayMap_func(tmp_array[0], tmp_array[1], 0);
setBombMC_func(tmp_array[0], tmp_array[1], 0, fireLengthP0);
numOfPutBombM0++;
}
}
}
}
};
keyListener.onKeyUp = function () {
if (keyLock_flag == 0) {
if (Key.getCode() == 37) {
charaM0_DirL = 0;
charaM0_imgDir = "L";
} else if (Key.getCode() == 39) {
charaM0_DirR = 0;
charaM0_imgDir = "R";
} else if (Key.getCode() == 38) {
charaM0_DirU = 0;
charaM0_imgDir = "U";
} else if (Key.getCode() == 40) {
charaM0_DirD = 0;
charaM0_imgDir = "D";
}
if ((((charaM0_DirL + charaM0_DirR) + charaM0_DirU) + charaM0_DirD) == 0) {
partsImgs_mc.charaMain0_mc.gotoAndStop(("wait" + charaM0_imgDir) + "_frm");
}
}
};
Key.addListener(keyListener);
createEmptyMovieClip("charaM0Mover_mc", getNextHighestDepth());
charaM0Mover_mc.charaM0_DirH_rec = 0;
charaM0Mover_mc.charaM0_DirV_rec = 0;
charaM0Mover_mc.bomb_flag = 0;
charaM0Mover_mc.onEnterFrame = function () {
charaM0_DirH = charaM0_DirL + charaM0_DirR;
charaM0_DirV = charaM0_DirU + charaM0_DirD;
if (charaM0_DirH != 0) {
this.charaM0_DirH_rec = charaM0_DirH;
this.charaM0_DirV_rec = 0;
}
if (charaM0_DirV != 0) {
this.charaM0_DirV_rec = charaM0_DirV;
this.charaM0_DirH_rec = 0;
}
this.x_rec = partsImgs_mc.charaMain0_mc._x;
this.y_rec = partsImgs_mc.charaMain0_mc._y;
tmp = moveChara1f_func(0, this.x_rec, this.y_rec, charaM0_DirH, charaM0_DirV, charaM0_spd);
this.x = tmp[0];
this.y = tmp[1];
partsImgs_mc.charaMain0_mc._x = this.x;
partsImgs_mc.charaMain0_mc._y = this.y;
baseLocY = Math.floor((((this.y - cellStartY) + cellSize) - 1) / cellSize);
dep = (baseLocY * 1000) + 50;
partsImgs_mc.charaMain0_mc.swapDepths(dep);
};
}
function retMapDat1PFromMap(x, y) {
var _local1;
var _local2;
if ((((x < 0) || (x >= numOfBlockH)) || (y < 0)) || (y >= numOfBlockV)) {
return("");
}
_local1 = x + (y * numOfBlockH);
_local2 = mapDat.substr(_local1, 1);
return(_local2);
}
function retCharaLoc_func(mc) {
var _local1;
var _local2;
_local1 = Math.floor(((mc._x + (cellSize / 2)) - cellStartX) / cellSize);
_local2 = Math.floor(((mc._y + (cellSize / 2)) - cellStartY) / cellSize);
return([_local1, _local2]);
}
function setBombMC_func(x, y, cNum, fireL) {
var _local3;
var _local6;
var _local8;
var _local11;
var _local12;
var _local9;
_root.sounds_mc.gotoAndPlay("SE_putBomb");
_local6 = ((1000 * y) + x) + 20;
_local3 = "b" + _local6;
partsImgs_mc.bomb_mc.duplicateMovieClip(_local3, _local6);
recBombMC_array[y][x] = partsImgs_mc[_local3];
partsImgs_mc[_local3].x = x;
partsImgs_mc[_local3].y = y;
partsImgs_mc[_local3].charaNum = cNum;
partsImgs_mc[_local3].fireL = fireL;
partsImgs_mc[_local3].putBombID = putBombID++;
partsImgs_mc[_local3]._x = (x * cellSize) + cellStartX;
partsImgs_mc[_local3]._y = (y * cellSize) + cellStartY;
burnMap_array = reNewBurnMap_func(x, y, this["fireLengthP" + cNum]);
orderToAwayFromBomb_func();
}
function bombEnd_func(mc, cNum, fireL, bombFlag) {
var _local3;
var _local4;
var _local7;
var _local2;
_local3 = mc.x;
_local4 = mc.y;
_root.sounds_mc.gotoAndPlay("SE_bomb1");
removeBomb_func(_local4, _local3, mc);
setFireMC_func(_local3, _local4, cNum, fireL, bombFlag);
removeMovieClip(("checkPutNewBombAround_mc" + _local3) + _local4);
_local2 = 0;
while (_local2 <= bombNumInSt) {
onewayMap[_local2][_local4][_local3] = [0, 0];
_local2++;
}
}
function removeBomb_func(y, x, mc) {
var _local5;
var _local2;
putBombFlag_array[y][x] = 0;
_local2 = 0;
while (_local2 <= bombNumInSt) {
dontThroughCellFlag_array[_local2][y][x] = 0;
_local2++;
}
_local5 = this[("bombThroughAction_mc" + String(x)) + String(y)];
if (_local5 != undefined) {
removeMovieClip(_local5);
}
removeMovieClip(mc);
}
function setFireMC_func(x, y, cNum, fireL, bombFlag) {
var cNum;
var fireL;
var _local8;
var _local9;
var i;
var _local11;
var fireL;
var _local3;
var _local10;
var _local5;
var _local4;
var _local2;
_local8 = ("fireCnt_" + x) + y;
createEmptyMovieClip(_local8, getNextHighestDepth());
_local3 = this[_local8];
_local3.fireMCs = [];
_local3.fireMCs[0] = [];
_local3.fireMCs[1] = [];
_local3.fireMCs[2] = [];
_local3.fireMCs[3] = [];
_local3.fireMCs[4] = [];
cFireDep[y]++;
if (cFireDep[y] > fireDepMax) {
cFireDep[y] = fireDepMin;
}
_local9 = (1000 * y) + cFireDep[y];
_local8 = "fC" + _local9;
partsImgs_mc.fireC_mc.duplicateMovieClip(_local8, _local9);
_local3.fireMCs[0].push(partsImgs_mc[_local8]);
partsImgs_mc[_local8].x = x;
partsImgs_mc[_local8].y = y;
partsImgs_mc[_local8].charaNum = cNum;
partsImgs_mc[_local8]._x = (x * cellSize) + cellStartX;
partsImgs_mc[_local8]._y = (y * cellSize) + cellStartY;
i = 0;
while (i <= (fireL - 1)) {
tmpX = x - (i + 1);
tmpY = y;
tmpDir = "L";
tmpDirNum = 1;
if (!retInStage_func(tmpX, tmpY)) {
break;
}
_local4 = recBombMC_array[tmpY][tmpX];
if (_local4 != "") {
_local2 = setFirePartsMC_func(tmpDir, tmpY, tmpX, i, fireL);
_local3.fireMCs[tmpDirNum].push(_local2);
}
through_flag = dontThroughCellFlag_array[cNum][tmpY][tmpX];
if (through_flag == 1) {
break;
}
_local5 = recItemMapLoc_array[tmpY][tmpX];
if (_local5 != "") {
break;
}
_local2 = setFirePartsMC_func(tmpDir, tmpY, tmpX, i, fireL);
_local3.fireMCs[tmpDirNum].push(_local2);
i++;
}
i = 0;
while (i <= (fireL - 1)) {
tmpX = x + (i + 1);
tmpY = y;
tmpDir = "R";
tmpDirNum = 2;
if (!retInStage_func(tmpX, tmpY)) {
break;
}
_local4 = recBombMC_array[tmpY][tmpX];
if (_local4 != "") {
_local2 = setFirePartsMC_func(tmpDir, tmpY, tmpX, i, fireL);
_local3.fireMCs[tmpDirNum].push(_local2);
}
through_flag = dontThroughCellFlag_array[cNum][tmpY][tmpX];
if (through_flag == 1) {
break;
}
_local5 = recItemMapLoc_array[tmpY][tmpX];
if (_local5 != "") {
break;
}
_local2 = setFirePartsMC_func(tmpDir, tmpY, tmpX, i, fireL);
_local3.fireMCs[tmpDirNum].push(_local2);
i++;
}
i = 0;
while (i <= (fireL - 1)) {
tmpX = x;
tmpY = y - (i + 1);
tmpDir = "U";
tmpDirNum = 3;
if (!retInStage_func(tmpX, tmpY)) {
break;
}
_local4 = recBombMC_array[tmpY][tmpX];
if (_local4 != "") {
_local2 = setFirePartsMC_func(tmpDir, tmpY, tmpX, i, fireL);
_local3.fireMCs[tmpDirNum].push(_local2);
}
through_flag = dontThroughCellFlag_array[cNum][tmpY][tmpX];
if (through_flag == 1) {
break;
}
_local5 = recItemMapLoc_array[tmpY][tmpX];
if (_local5 != "") {
break;
}
_local2 = setFirePartsMC_func(tmpDir, tmpY, tmpX, i, fireL);
_local3.fireMCs[tmpDirNum].push(_local2);
i++;
}
i = 0;
while (i <= (fireL - 1)) {
tmpX = x;
tmpY = y + (i + 1);
tmpDir = "D";
tmpDirNum = 4;
if (!retInStage_func(tmpX, tmpY)) {
break;
}
_local4 = recBombMC_array[tmpY][tmpX];
if (_local4 != "") {
_local2 = setFirePartsMC_func(tmpDir, tmpY, tmpX, i, fireL);
_local3.fireMCs[tmpDirNum].push(_local2);
}
through_flag = dontThroughCellFlag_array[cNum][tmpY][tmpX];
if (through_flag == 1) {
break;
}
_local5 = recItemMapLoc_array[tmpY][tmpX];
if (_local5 != "") {
break;
}
_local2 = setFirePartsMC_func(tmpDir, tmpY, tmpX, i, fireL);
_local3.fireMCs[tmpDirNum].push(_local2);
i++;
}
this.fireMCs[0][0].gotoAndStop(2);
_local3.fSize_array = [];
i = 0;
while (i <= (burnTime - 1)) {
_local3.fSize_array[i] = 5;
i++;
}
_local3.fSize_array.splice(0, 1, 2);
_local3.fSize_array.splice(1, 1, 3);
_local3.fSize_array.splice(2, 1, 4);
_local3.fSize_array.splice(-1, 1, 2);
_local3.fSize_array.splice(-2, 1, 3);
_local3.fSize_array.splice(-3, 1, 4);
_local3.cnt = 0;
_local3.fireL = fireL;
_local3.x = x;
_local3.y = y;
_local3.cNum = cNum;
_local3.brokenWall_array = [];
_local3.onEnterFrame = function () {
if (this.cnt < burnTime) {
this.fireMCs[0][0].gotoAndStop(this.fSize_array[this.cnt]);
deadCheck_func(this.fireMCs[0][0]);
this.j = 0;
while (this.j <= 3) {
this.i = 0;
while (this.i <= this.cnt) {
if (this.i == this.cnt) {
this.addNum = 10;
} else {
this.addNum = 0;
}
this.fireMCs[this.j + 1][this.i].gotoAndStop(this.fSize_array[this.cnt] + this.addNum);
deadCheck_func(this.fireMCs[this.j + 1][this.i]);
this.i++;
}
this.j++;
}
if (this.cnt == 0) {
this.brokenWall_array = fireMid_func(this.fireMCs[0][0], this.cNum, this.fireL, 1, 0, 0, 0, this.brokenWall_array);
} else if (this.cnt == Math.floor(burnTime / 2)) {
breakWalls_func(this.brokenWall_array);
}
this.cnt++;
} else if (this.cnt >= burnTime) {
fireEnd_func(this.fireMCs[0][0]);
this.j = 0;
while (this.j <= 3) {
this.i = 0;
while (this.i <= this.cnt) {
fireEnd_func(this.fireMCs[this.j + 1][this.i]);
this.i++;
}
this.j++;
}
removeMovieClip(this);
}
};
}
function setFirePartsMC_func(dir, y, x, num, fireL) {
var _local7;
var _local4;
var _local6;
var _local2;
var _local3;
cFireDep[y]++;
if (cFireDep[y] > fireDepMax) {
cFireDep[y] = fireDepMin;
}
_local7 = (1000 * y) + cFireDep[y];
if (num == (fireL - 1)) {
_local6 = "E" + dir;
} else {
_local6 = "M" + dir;
}
_local4 = ("f" + dir) + _local7;
partsImgs_mc[("fire" + _local6) + "_mc"].duplicateMovieClip(_local4, _local7);
if (dir == "L") {
_local2 = 0;
_local3 = 0;
} else if (dir == "R") {
_local2 = cellSize;
_local3 = cellSize;
} else if (dir == "U") {
_local2 = cellSize;
_local3 = 0;
} else if (dir == "D") {
_local2 = 0;
_local3 = cellSize;
}
partsImgs_mc[_local4]._x = ((x * cellSize) + cellStartX) + _local2;
partsImgs_mc[_local4]._y = ((y * cellSize) + cellStartY) + _local3;
return(partsImgs_mc[_local4]);
}
function breakWalls_func(walls_array) {
var _local3;
var _local8;
var _local1;
var _local2;
var _local6;
var _local5;
var _local7;
_local8 = walls_array.length;
_local3 = 0;
while (_local3 <= ((_local8 / 3) - 1)) {
_local1 = walls_array[(_local3 * 3) + 0];
_local2 = walls_array[(_local3 * 3) + 1];
_local6 = walls_array[(_local3 * 3) + 2];
if (_local6 == 0) {
_local7 = ("bb" + String(_local2)) + String(_local1);
partsImgs_mc[_local7].gotoAndPlay(2);
j = 0;
while (j <= bombNumInSt) {
dontThroughCellFlag_array[j][_local2][_local1] = 0;
j++;
}
rewriteMapDat_func(_local1, _local2, 0);
_local5 = recItemMapLoc_array[_local2][_local1];
if (_local5 != "") {
if (recItemMC_array[_local2][_local1] == "") {
setItemImg_func(_local1, _local2, _local5);
makeItemHitTestMC_func(_local1, _local2);
numOfShowItem++;
}
}
} else if (_local6 == 1) {
removeMovieClip(recItemMC_array[_local2][_local1]);
recItemMapLoc_array[_local2][_local1] = "";
recItemMC_array[_local2][_local1] = "";
}
_local3++;
}
}
function retInStage_func(x, y) {
var _local1;
_local1 = true;
if ((x <= -1) || (x >= numOfBlockH)) {
_local1 = false;
}
if ((y <= -1) || (y >= numOfBlockV)) {
_local1 = false;
}
return(_local1);
}
function fireMid_func(mc, cNum, fireL, flag0, flag1, flag2, flag3, bw_array) {
var _local10;
var _local11;
var _local6;
var _local7;
var _local8;
var _local15;
var _local17;
var _local16;
var _local18;
var _local9;
var _local14;
var _local2;
var _local3;
var _local5;
_local10 = mc.x;
_local11 = mc.y;
_local9 = [];
_local6 = 0;
while (_local6 <= ((numOfCPU + 1) - 1)) {
_local9[_local6] = [];
_local9[_local6] = retCharaLoc_func(partsImgs_mc[("charaMain" + _local6) + "_mc"]);
trace("--" + _local9[_local6]);
_local6++;
}
burnMap_array[_local11][_local10] = 0;
addXa = [-1, 1, 0, 0];
addXb = [1, 1, 0, 0];
addYa = [0, 0, -1, 1];
addYb = [0, 0, 1, 1];
_local5 = 0;
while (_local5 <= 3) {
_local6 = 0;
while (_local6 <= (fireL - 1)) {
_local2 = _local10 + (((_local6 + 1) * addXa[_local5]) * addXb[_local5]);
_local3 = _local11 + (((_local6 + 1) * addYa[_local5]) * addYb[_local5]);
_local8 = retMapDat1PFromMap(_local2, _local3);
if ((_local2 < 0) || (_local2 >= numOfBlockH)) {
break;
}
if ((_local3 < 0) || (_local3 >= numOfBlockV)) {
break;
}
if (_local8 == "1") {
break;
}
burnMap_array[_local3][_local2] = 0;
findBomb_flag = putBombFlag_array[_local3][_local2];
if (findBomb_flag == 1) {
_local7 = recBombMC_array[_local3][_local2];
bombEnd_func(_local7, _local7.charaNum, _local7.fireL, 1);
}
if (_local8 == "4") {
bw_array.push(_local2);
bw_array.push(_local3);
bw_array.push(0);
break;
}
itemNum = recItemMapLoc_array[_local3][_local2];
if (itemNum != "") {
bw_array.push(_local2);
bw_array.push(_local3);
bw_array.push(1);
break;
}
_local6++;
}
_local5++;
}
this["numOfPutBombM" + cNum]--;
return(bw_array);
}
function fireEnd_func(mc) {
var _local2;
var _local3;
_local2 = mc.x;
_local3 = mc.y;
removeMovieClip(mc);
}
function makeBombThroughAction_func(x, y) {
var _local2;
var _local5;
var i;
_local2 = ("bombThroughAction_mc" + String(x)) + String(y);
createEmptyMovieClip(_local2, getNextHighestDepth());
this[_local2].bombX = x;
this[_local2].bombY = y;
this[_local2].end_flag = [];
i = 0;
while (i <= bombNumInSt) {
this[_local2].end_flag[i] = 0;
i++;
}
this[_local2].onEnterFrame = function () {
i = 0;
while (i <= bombNumInSt) {
if (this.end_flag[i] == 0) {
if (!partsImgs_mc[("charaMain" + i) + "_mc"].hitArea_mc.hitTest(recBombMC_array[this.bombY][this.bombX].hitArea_mc)) {
this.end_flag[i] = 1;
dontThroughCellFlag_array[i][this.bombY][this.bombX] = 1;
}
}
i++;
}
this.t = 0;
i = 0;
while (i <= bombNumInSt) {
this.t = this.t + this.end_flag[i];
i++;
}
if (this.t == (bombNumInSt + 1)) {
removeMovieClip(this);
}
};
}
function makeItemHitTestMC_func(x, y) {
var x;
var y;
var _local3;
var i;
_local3 = ("ItemHitTest_mc" + String(x)) + String(y);
createEmptyMovieClip(_local3, getNextHighestDepth());
this[_local3].x = x;
this[_local3].y = y;
this[_local3].onEnterFrame = function () {
i = 0;
while (i <= bombNumInSt) {
if (partsImgs_mc[("charaMain" + i) + "_mc"].hitArea_mc.hitTest(recItemMC_array[this.y][this.x])) {
_root.sounds_mc.gotoAndPlay("SE_power_up");
this.itemNum = recItemMapLoc_array[this.y][this.x];
this._parent.itemLevel[i][this.itemNum]++;
if (this._parent.itemLevel[i][this.itemNum] > this._parent["itemLevelMax" + this.itemNum]) {
this._parent.itemLevel[i][this.itemNum] = this._parent["itemLevelMax" + this.itemNum];
}
if (this.itemNum == 1) {
this._parent[("charaM" + i) + "_spd"] = this._parent["initSpdCharaM" + i] + itemLevel[i][1];
} else if (this.itemNum == 2) {
this._parent[("numOfPutBombM" + i) + "Max"] = itemLevel[i][2] + this._parent["initBombCharaM" + i];
} else if (this.itemNum == 0) {
this._parent["fireLengthP" + i] = this._parent["initBakufuCharaM" + i] + itemLevel[i][0];
}
dispItemLevel_func(this.itemNum, itemLevel[i][this.itemNum], i);
removeMovieClip(recItemMC_array[this.y][this.x]);
recItemMapLoc_array[this.y][this.x] = "";
recItemMC_array[this.y][this.x] = "";
removeMovieClip(this);
}
i++;
}
};
}
function setItemImg_func(x, y, itemNum) {
var _local2;
var _local1;
var _local3;
if (itemNum == 0) {
_local2 = "itemBakufu_mc";
} else if (itemNum == 1) {
_local2 = "itemSpeed_mc";
} else if (itemNum == 2) {
_local2 = "itemBomb_mc";
}
_local3 = ((1000 * y) + x) + 20;
_local1 = "item" + _local3;
partsImgs_mc[_local2].duplicateMovieClip(_local1, _local3);
recItemMC_array[y][x] = partsImgs_mc[_local1];
partsImgs_mc[_local1].x = x;
partsImgs_mc[_local1].y = y;
partsImgs_mc[_local1].charaNum = cNum;
partsImgs_mc[_local1]._x = (x * cellSize) + cellStartX;
partsImgs_mc[_local1]._y = (y * cellSize) + cellStartY;
}
function dispItemLevel_func(itemNum, itemLev, cNum) {
this[("indicaters" + cNum) + "_mc"][("ind" + itemNum) + "_txt"].text = itemLev + 1;
}
function dead_func(num) {
var _local1;
var _local2;
var _local4;
if (doneDeadFunc_flags[num] == 1) {
return(undefined);
}
_local2 = 0;
_local1 = 0;
while (_local1 <= (dead_flags.length - 1)) {
if (dead_flags[_local1] == 1) {
_local2++;
}
_local1++;
}
deadCNum_array.push(num);
partsImgs_mc[("charaMain" + num) + "_mc"].gotoAndStop("dead_frm");
setBombAI_func(0, num);
if (_local2 <= (dead_flags.length - 2)) {
trace("~1");
if (dead_flags[0] == 1) {
if (doneDecideWinLoseFunc_flag == 0) {
doneDecideWinLoseFunc_flag = 1;
decideWinLose_func();
}
stopAllBombMC_func();
trace("~2");
} else {
partsImgs_mc[("charaMain" + num) + "_mc"].deadAndRem_flag = 1;
trace("~3");
}
} else {
if (doneDecideWinLoseFunc_flag == 0) {
doneDecideWinLoseFunc_flag = 1;
decideWinLose_func();
trace("~4");
}
trace("~5");
stopAllBombMC_func();
}
doneDeadFunc_flags[num] = 1;
}
function decideWinLose_func() {
var i;
var tmp;
Key.removeListener(keyListener);
removeMovieClip(charaM0Mover_mc);
_root.sounds_mc.gotoAndPlay("BTL_NORMAL_stop");
_root.sounds_mc.gotoAndPlay("SE_gongs");
i = 0;
while (i <= ((bombNumInSt + 1) - 1)) {
partsImgs_mc[("charaMain" + i) + "_mc"].deadAndRem_flag = 0;
i++;
}
createEmptyMovieClip("wChecker_mc", getNextHighestDepth());
wChecker_mc.cnt = 0;
wChecker_mc.cntMax = 15;
wChecker_mc.onEnterFrame = function () {
if (this.cnt == this.cntMax) {
i = 0;
while (i <= (dead_flags.length - 1)) {
if (dead_flags[i] == 0) {
partsImgs_mc[("charaMain" + i) + "_mc"].gotoAndStop("win_frm");
setBombAI_func(0, i);
}
i++;
}
if (dead_flags[0] == 0) {
textDisp_mc.gotoAndPlay("kachi_frm");
win_mc.gotoAndPlay(2);
_root.sounds_mc.gotoAndPlay("SE_yarare");
} else if (dead_flags[0] == 1) {
this.tmp = 0;
i = 0;
while (i <= (dead_flags.length - 1)) {
this.tmp = this.tmp + dead_flags[i];
i++;
}
if (this.tmp == dead_flags.length) {
textDisp_mc.gotoAndPlay("hikiwake_frm");
lose_mc.gotoAndPlay(2);
trace("come on man 1");
_root.sounds_mc.gotoAndPlay("Failure");
} else {
textDisp_mc.gotoAndPlay("make_frm");
lose_mc.gotoAndPlay(2);
trace("come on man 2");
_root.sounds_mc.gotoAndPlay("Failure");
}
}
stopAllBombMC_func();
removeMovieClip(this);
}
this.cnt++;
};
stopAllBombMC_func();
}
function setBombAI_func(order, cNum) {
var cNum;
var _local2;
var _local3;
if (order == 1) {
_local3 = "bombAI" + cNum;
createEmptyMovieClip(_local3, getNextHighestDepth());
_local2 = this[_local3];
_local2.actState = 0;
_local2.actState0Cnt = 0;
_local2.dirStr = retRandomNumStr_f(4);
_local2.cNum = cNum;
_local2.dr = [];
_local2.cMC = partsImgs_mc[("charaMain" + _local2.cNum) + "_mc"];
_local2.onEnterFrame = function () {
actState_ta.text = this.actState;
distMap_ta.text = this.distMap.join(" , ");
if (this.actState == 0) {
this.myPos = retCharaLoc_func(this.cMC);
this.tmp = retGetItemPos_func(this.cNum, this.myPos[0], this.myPos[1]);
if (this.tmp[3] == 0) {
this.tmp = retPutBombPos_func(this.cNum, this.myPos[0], this.myPos[1]);
if (this.tmp[3] == 1) {
this.putBomb_flag = 1;
} else {
this.putBomb_flag = 0;
}
} else if (this.tmp[3] == 1) {
this.putBomb_flag = 0;
}
if (!((this.myPos[0] == this.tmp[0]) && (this.myPos[1] == this.tmp[1]))) {
this.dist = [this.tmp[0], this.tmp[1]];
this.way = this.tmp[2];
this.wayCnt = 0;
this.setParameter_flag = 1;
this.actState = 6;
} else if (this.tmp[3] == 1) {
this.actState = 2;
} else if (this.tmp[3] == 0) {
this.tmp = 0;
i = 0;
while (i <= bombNumInSt) {
this.tmp = this.tmp + this._parent["numOfPutBombM" + i];
i++;
}
if (this.tmp != 0) {
this.actState = 3;
} else {
this.actState = 4;
}
}
} else if (this.actState == 1) {
this.cMC = partsImgs_mc[("charaMain" + this.cNum) + "_mc"];
this.x_rec = this.cMC._x;
this.y_rec = this.cMC._y;
this.dirH = this._parent[("charaM" + this.cNum) + "_DirH"];
this.dirV = this._parent[("charaM" + this.cNum) + "_DirV"];
this.spd = this._parent[("charaM" + this.cNum) + "_spd"];
tmp = moveChara1f_func(this.cNum, this.x_rec, this.y_rec, this.dirH, this.dirV, this.spd);
this.x = tmp[0];
this.y = tmp[1];
this.cMC._x = this.x;
this.cMC._y = this.y;
this.baseLocY = Math.floor((((this.y - cellStartY) + cellSize) - 1) / cellSize);
this.dep = ((this.baseLocY * 1000) + 50) + (this.cNum * 10);
tmp_array = retCharaLoc_func(this.cMC);
this.xPos = tmp_array[0];
this.yPos = tmp_array[1];
if ((this.distMap[0] == this.xPos) && (this.distMap[1] == this.yPos)) {
if (this.putBomb_flag == 1) {
this.actState = 2;
this.putBomb_flag = 0;
} else {
this.actState = 3;
if (this.dr[0] == 1) {
this.drT = "R";
}
if (this.dr[0] == -1) {
this.drT = "L";
}
if (this.dr[1] == 1) {
this.drT = "D";
}
if (this.dr[1] == -1) {
this.drT = "U";
}
this.cMC.gotoAndStop(("wait" + this.drT) + "_frm");
}
} else if ((this.x_rec == this.cMC._x) && (this.y_rec == this.cMC._y)) {
this.actState0Cnt = 0;
this.actState = 0;
}
} else if (this.actState == 2) {
if (this._parent["numOfPutBombM" + this.cNum] < this._parent[("numOfPutBombM" + this.cNum) + "Max"]) {
this.tmp_array = retCharaLoc_func(this.cMC);
this.bomb_flag = putBombFlag_array[this.tmp_array[1]][this.tmp_array[0]];
if (this.bomb_flag == 0) {
putBombFlag_array[this.tmp_array[1]][this.tmp_array[0]] = 1;
makeBombThroughAction_func(this.tmp_array[0], this.tmp_array[1]);
checkPutNewBombAround_func(this.tmp_array[0], this.tmp_array[1]);
setOnewayMap_func(this.tmp_array[0], this.tmp_array[1], this.cNum);
setBombMC_func(this.tmp_array[0], this.tmp_array[1], this.cNum, this._parent["fireLengthP" + this.cNum]);
this._parent["numOfPutBombM" + this.cNum]++;
}
}
this.putBomb_flag = 0;
this.actState = 3;
} else if (this.actState == 3) {
this.myPos = retCharaLoc_func(this.cMC);
this.tmp = retSafePos_func(this.cNum, this.myPos[0], this.myPos[1], burnMap_array);
if (!((this.myPos[0] == this.tmp[0]) && (this.myPos[1] == this.tmp[1]))) {
this.waitToBombEnd_flag = 1;
this.dist = [this.tmp[0], this.tmp[1]];
this.way = this.tmp[2];
this.wayCnt = 0;
this.setParameter_flag = 1;
this.actState = 6;
} else {
this.actState = 4;
}
} else if (this.actState == 4) {
this.tmp = 0;
i = 0;
while (i <= bombNumInSt) {
this.tmp = this.tmp + this._parent["numOfPutBombM" + i];
i++;
}
if (this.tmp == 0) {
this.waitCnt = 0;
this.waitCntMax = 12;
this.actState = 5;
} else {
this.actState = 3;
}
} else if (this.actState == 5) {
if (this.waitCnt == this.waitCntMax) {
this.actState = 0;
}
this.waitCnt++;
} else if (this.actState == 6) {
this.myPos = retCharaLoc_func(this.cMC);
if (this.setParameter_flag == 1) {
this.cDirX = this.way[(3 * this.wayCnt) + 0];
this.cDirY = this.way[(3 * this.wayCnt) + 1];
this.LtoDist = this.way[(3 * this.wayCnt) + 2];
this.cDistX = this.myPos[0] + (this.cDirX * this.LtoDist);
this.cDistY = this.myPos[1] + (this.cDirY * this.LtoDist);
this.dirName = retDirXYtoName_func(this.cDirX, this.cDirY);
this.cMC.gotoAndStop(("walk" + this.dirName) + "_frm");
this.moveOrder_flag = 0;
if (this.moveOrder_cnt == undefined) {
this.moveOrder_cnt = 0;
}
this.moveOrder_cntMax = 6;
if (this.moveOrder_cnt >= this.moveOrder_cntMax) {
this.moveOrder_cnt = 0;
}
this.getCellCenter_flag = 0;
this.setParameter_flag = 0;
}
this.cLocX = this.cMC._x;
this.cLocY = this.cMC._y;
this.spd = this._parent[("charaM" + this.cNum) + "_spd"];
this.movedLoc = moveChara1f_func(this.cNum, this.cLocX, this.cLocY, this.cDirX, this.cDirY, this.spd);
this.cMC._x = this.movedLoc[0];
this.cMC._y = this.movedLoc[1];
this.baseLocY = Math.floor((((this.movedLoc[1] - cellStartY) + cellSize) - 1) / cellSize);
this.dep = ((this.baseLocY * 1000) + 50) + (this.cNum * 10);
this.cMC.swapDepths(this.dep);
if ((this.cLocX == this.movedLoc[0]) && (this.cLocY == this.movedLoc[1])) {
this.moveOrder_cnt++;
if (this.moveOrder_cnt >= this.moveOrder_cntMax) {
this.moveOrder_flag = 1;
}
}
this.myPos = retCharaLoc_func(this.cMC);
if ((this.myPos[0] == this.cDistX) && (this.myPos[1] == this.cDistY)) {
this.myPosXC = this.cMC._x + (cellSize / 2);
this.myPosYC = this.cMC._y + (cellSize / 2);
this.distCellCenterX = (cellStartX + (this.cDistX * cellSize)) + (cellSize / 2);
this.distCellCenterY = (cellStartY + (this.cDistY * cellSize)) + (cellSize / 2);
if (this.cDirY == 0) {
if (this.cDirX == 1) {
if (this.myPosXC >= this.distCellCenterX) {
this.getCellCenter_flag = 1;
}
} else if (this.cDirX == -1) {
if (this.myPosXC <= this.distCellCenterX) {
this.getCellCenter_flag = 1;
}
}
} else if (this.cDirX == 0) {
if (this.cDirY == 1) {
if (this.myPosYC >= this.distCellCenterY) {
this.getCellCenter_flag = 1;
}
} else if (this.cDirY == -1) {
if (this.myPosYC <= this.distCellCenterY) {
this.getCellCenter_flag = 1;
}
}
}
if (this.getCellCenter_flag == 1) {
this.wayCnt++;
this.setParameter_flag = 1;
if (this.wayCnt == (this.way.length / 3)) {
if (this.putBomb_flag == 0) {
if (this.waitToBombEnd_flag == 1) {
this.actState = 4;
this.dirName = retDirXYtoName_func(this.cDirX, this.cDirY);
this.cMC.gotoAndStop(("wait" + this.dirName) + "_frm");
this.waitToBombEnd_flag = 0;
} else {
this.dirName = retDirXYtoName_func(this.cDirX, this.cDirY);
this.cMC.gotoAndStop(("wait" + this.dirName) + "_frm");
this.actState0Cnt = 0;
this.actState = 0;
}
} else if (this.putBomb_flag == 1) {
this.actState = 2;
}
}
}
}
if (this.moveOrder_flag == 1) {
this.actState = 3;
}
}
};
} else if (order == 0) {
removeMovieClip("bombAI" + cNum);
}
}
function reNewBurnMap_func(bx, by, fireL) {
var _local3;
var _local4;
var _local5;
var _local9;
var _local10;
var _local7;
var _local8;
var _local1;
var _local2;
var _local6;
_local6 = [];
_local5 = 0;
while (_local5 <= (numOfBlockV - 1)) {
_local6[_local5] = [];
_local4 = 0;
while (_local4 <= (numOfBlockH - 1)) {
_local6[_local5][_local4] = burnMap_array[_local5][_local4];
_local4++;
}
_local5++;
}
_local6[by][bx] = 1;
_local9 = [-1, 1, 0, 0];
_local10 = [1, 1, 0, 0];
_local7 = [0, 0, -1, 1];
_local8 = [0, 0, 1, 1];
_local3 = 0;
while (_local3 <= 3) {
_local4 = 0;
while (_local4 <= (fireL - 1)) {
_local1 = bx + (((_local4 + 1) * _local9[_local3]) * _local10[_local3]);
_local2 = by + (((_local4 + 1) * _local7[_local3]) * _local8[_local3]);
mapDat1P = retMapDat1PFromMap(_local1, _local2);
if ((_local1 < 0) || (_local1 >= numOfBlockH)) {
break;
}
if ((_local2 < 0) || (_local2 >= numOfBlockV)) {
break;
}
if (mapDat1P == "1") {
break;
}
findBomb_flag = putBombFlag_array[_local2][_local1];
if (findBomb_flag == 1) {
break;
}
if (mapDat1P == "4") {
break;
}
_local6[_local2][_local1] = 1;
_local4++;
}
_local3++;
}
return(_local6);
}
function moveChara1f_func(cNum, x, y, dirX, dirY, spd) {
var _local17;
var _local16;
var _local1;
var _local6;
var _local18;
var _local19;
var _local24;
var _local25;
var _local26;
var _local27;
var _local3;
var _local2;
var _local8;
var _local7;
var _local15;
var _local11;
var _local12;
var _local10;
var _local13;
var _local21;
var _local22;
_local17 = x;
_local16 = y;
x = x + (spd * dirX);
y = y + (spd * dirY);
_local10 = partsImgs_mc[("charaMain" + cNum) + "_mc"];
_local3 = [];
_local2 = [];
_local3[0] = (x - cellStartX) / cellSize;
_local2[0] = (y - cellStartY) / cellSize;
_local3[1] = (x - cellStartX) / cellSize;
_local2[1] = (((y - cellStartY) - 1) + cellSize) / cellSize;
_local3[2] = (((x - cellStartX) - 1) + cellSize) / cellSize;
_local2[2] = (((y - cellStartY) - 1) + cellSize) / cellSize;
_local3[3] = (((x - cellStartX) - 1) + cellSize) / cellSize;
_local2[3] = (y - cellStartY) / cellSize;
_local1 = 0;
while (_local1 <= 3) {
_local3[_local1] = Math.floor(_local3[_local1]);
_local2[_local1] = Math.floor(_local2[_local1]);
_local1++;
}
through_flag = [];
_local1 = 0;
while (_local1 <= 3) {
through_flag[_local1] = dontThroughCellFlag_array[cNum][_local2[_local1]][_local3[_local1]];
_local1++;
}
_local6 = 0;
_local1 = 0;
while (_local1 <= 3) {
_local6 = _local6 + through_flag[_local1];
_local1++;
}
if (isNaN(_local6)) {
_local6 = 0;
}
if (_local6 != 0) {
x = _local17;
y = _local16;
_local18 = x + (cellSize / 2);
_local19 = y + (cellSize / 2);
_local24 = _local3[0] * cellSize;
_local25 = _local2[0] * cellSize;
_local1 = 0;
while (_local1 <= 3) {
if (through_flag[_local1] == 1) {
hitWallLocX = ((_local3[_local1] * cellSize) + cellStartX) + (cellSize / 2);
hitWallLocY = ((_local2[_local1] * cellSize) + cellStartY) + (cellSize / 2);
break;
}
_local1++;
}
_local8 = Math.floor((hitWallLocX - cellStartX) / cellSize);
_local7 = Math.floor((hitWallLocY - cellStartY) / cellSize);
_local15 = 5;
if (dirY != 0) {
if (_local18 <= (hitWallLocX - _local15)) {
_local8--;
if (_local8 >= 0) {
through_flag = dontThroughCellFlag_array[cNum][_local7][_local8];
if (through_flag == 0) {
x = x - spd;
_local11 = (((_local8 * cellSize) + cellStartX) + (cellSize / 2)) - (cellSize / 2);
_local12 = (((_local7 * cellSize) + cellStartY) - (cellSize / 2)) - (cellSize / 2);
if (x < _local11) {
x = _local11;
}
}
tmp_array = retCharaLoc_func(_local10);
y = (tmp_array[1] * cellSize) + cellStartY;
}
} else if (_local18 > (hitWallLocX + _local15)) {
_local8++;
if (_local8 <= (numOfBlockH - 1)) {
through_flag = dontThroughCellFlag_array[cNum][_local7][_local8];
if (through_flag == 0) {
x = x + spd;
_local11 = (((_local8 * cellSize) + cellStartX) + (cellSize / 2)) - (cellSize / 2);
_local12 = (((_local7 * cellSize) + cellStartY) - (cellSize / 2)) - (cellSize / 2);
if (x > _local11) {
x = _local11;
}
}
tmp_array = retCharaLoc_func(_local10);
y = (tmp_array[1] * cellSize) + cellStartY;
}
} else {
tmp_array = retCharaLoc_func(_local10);
y = (tmp_array[1] * cellSize) + cellStartY;
}
} else if (_local19 <= (hitWallLocY - _local15)) {
_local7--;
if (_local7 >= 0) {
through_flag = dontThroughCellFlag_array[cNum][_local7][_local8];
if (through_flag == 0) {
y = y - spd;
_local11 = (((_local8 * cellSize) + cellStartX) + (cellSize / 2)) - (cellSize / 2);
_local12 = (((_local7 * cellSize) + cellStartY) + (cellSize / 2)) - (cellSize / 2);
if (y < _local12) {
y = _local12;
}
}
tmp_array = retCharaLoc_func(_local10);
x = (tmp_array[0] * cellSize) + cellStartX;
}
} else if (_local19 >= (hitWallLocY + _local15)) {
_local7++;
if (_local7 <= (numOfBlockV - 1)) {
through_flag = dontThroughCellFlag_array[cNum][_local7][_local8];
if (through_flag == 0) {
y = y + spd;
_local11 = (((_local8 * cellSize) + cellStartX) + (cellSize / 2)) - (cellSize / 2);
_local12 = (((_local7 * cellSize) + cellStartY) + (cellSize / 2)) - (cellSize / 2);
if (y > _local12) {
y = _local12;
}
}
tmp_array = retCharaLoc_func(_local10);
x = (tmp_array[0] * cellSize) + cellStartX;
}
} else {
tmp_array = retCharaLoc_func(_local10);
x = (tmp_array[0] * cellSize) + cellStartX;
}
}
_local13 = retCharaLoc_func(_local10);
_local21 = onewayMap[cNum][_local13[1]][_local13[0]][0];
_local22 = onewayMap[cNum][_local13[1]][_local13[0]][1];
if ((_local21 + _local22) != 0) {
if (!((_local21 == dirX) && (_local22 == dirY))) {
x = _local17;
y = _local16;
}
}
if ((((cellStartX > x) || ((cellStartX + (cellSize * (numOfBlockH - 1))) < x)) || (cellStartY > y)) || ((cellStartY + (cellSize * (numOfBlockV - 1))) < y)) {
tmp_array = retCharaLoc_func(_local10);
if (dirY != 0) {
y = (tmp_array[1] * cellSize) + cellStartY;
} else {
x = (tmp_array[0] * cellSize) + cellStartX;
}
}
return([x, y]);
}
function retRandomNumStr_func(num) {
var _local3;
var _local1;
var _local8;
var _local4;
var _local10;
var _local2;
var _local5;
var _local6;
var _local7;
_local1 = "0123456789abcdef";
_local1 = _local1.substr(0, num);
_local4 = "";
_local8 = _local1.length;
_local3 = 0;
while (_local3 <= (_local8 - 1)) {
_local2 = Math.floor(Math.random() * _local1.length);
_local5 = _local1.substr(0, _local2);
_local6 = _local1.substr(_local2, 1);
_local7 = _local1.substr(_local2 + 1);
_local1 = _local5 + _local7;
_local4 = _local4 + _local6;
_local3++;
}
return(_local4);
}
function retNumToXYDir_func(num) {
var _local1;
var _local2;
_local1 = [-1, 0, 1, 0];
_local2 = [0, 1, 0, -1];
return([_local1[num], _local2[num]]);
}
function retSafePos_func(cNum, x, y, bMap_array) {
var _local5;
var _local20;
var _local16;
var _local3;
var _local4;
var _local8;
var _local7;
var _local15;
var _local6;
var _local23;
var _local24;
var _local9;
var _local14;
var _local13;
var _local11;
var _local10;
var _local12;
var _local18;
var _local17;
var _local19;
_local8 = x;
_local7 = y;
_local9 = [];
_local14 = [];
_local13 = [];
_local6 = bMap_array[y][x];
if (_local6 == 0) {
return([x, y, [0, 0, 0]]);
}
_local12 = 0;
while (_local12 <= 8) {
_local20 = retRandomNumStr_func(4);
_local5 = 0;
while (_local5 <= 7) {
_local16 = _local20.substr(_local5 % 4, 1);
tmp = retNumToXYDir_func(_local16);
_local3 = tmp[0];
_local4 = tmp[1];
if (_local12 >= 1) {
_local18 = _local11 * -1;
_local17 = _local10 * -1;
rev_flag = 0;
if ((_local3 == _local18) && (_local4 == _local17)) {
rev_flag = 1;
}
}
x = x + _local3;
y = y + _local4;
_local15 = dontThroughCellFlag_array[cNum][y][x];
if ((_local15 == 0) && (rev_flag != 1)) {
_local6 = bMap_array[y][x];
if (_local6 == 0) {
_local9.push(_local3);
_local14.push(_local4);
_local13.push(1);
_local11 = _local3;
_local10 = _local4;
_local8 = x;
_local7 = y;
_local19 = 1;
break;
}
if (_local6 == 1) {
if (_local5 >= 4) {
_local9.push(_local3);
_local14.push(_local4);
_local13.push(1);
_local11 = _local3;
_local10 = _local4;
_local8 = x;
_local7 = y;
break;
}
}
}
x = _local8;
y = _local7;
_local5++;
}
if (_local19 == 1) {
break;
}
_local12++;
}
ret = [];
_local5 = 0;
while (_local5 <= (_local9.length - 1)) {
ret.push(_local9[_local5]);
ret.push(_local14[_local5]);
ret.push(_local13[_local5]);
_local5++;
}
return([x, y, ret]);
}
function retPutBombPos_func(cNum, x, y) {
var _local5;
var _local20;
var _local16;
var _local7;
var _local8;
var _local10;
var _local9;
var _local25;
var _local30;
var _local27;
var _local26;
var _local12;
var _local14;
var _local13;
var _local22;
var _local21;
var _local19;
var _local32;
var _local31;
var _local29;
var _local18;
var _local15;
var _local17;
var _local11;
var _local28;
var _local2;
var _local24;
var _local23;
_local24 = x;
_local23 = y;
_local12 = [];
_local14 = [];
_local13 = [];
_local7 = 0;
_local8 = 0;
_local20 = retRandomNumStr_func(4);
_local19 = 0;
while (_local19 <= 7) {
dec_flag = 0;
_local10 = x;
_local9 = y;
_local5 = 0;
while (_local5 <= 3) {
_local16 = _local20.substr(_local5, 1);
tmp = retNumToXYDir_func(_local16);
_local15 = tmp[0];
_local17 = tmp[1];
x = x + _local15;
y = y + _local17;
_local18 = retMapDat1PFromMap(x, y);
if (_local18 == 4) {
dec_flag = 1;
_local22 = _local7;
_local21 = _local8;
x = _local10;
y = _local9;
break;
}
x = _local10;
y = _local9;
_local5++;
}
if (dec_flag == 1) {
_local11 = reNewBurnMap_func(x, y, this["fireLengthP" + cNum]);
k = 0;
while (k <= (numOfBlockV - 1)) {
tmp = "";
tmp = tmp + String(k);
l = 0;
while (l <= (numOfBlockH - 1)) {
if (_local11[k][l] == 0) {
if (dontThroughCellFlag_array[cNum][k][l] == 0) {
tmp = tmp + "\u00A3\u00DF";
} else {
tmp = tmp + "\u00BF\u00DA";
}
} else {
tmp = tmp + "\u00D1\u00D7";
}
l++;
}
k++;
}
tmp = retSafePos_func(cNum, x, y, _local11);
if (_local11[tmp[1]][tmp[0]] == 1) {
_local2 = checkGoTo4Dir_func(cNum, x, y, throughMap_array, _local7, _local8);
if (_local2[4] == 1) {
x = _local2[0];
y = _local2[1];
_local12.push(_local2[2]);
_local14.push(_local2[3]);
_local13.push(1);
_local7 = _local2[2];
_local8 = _local2[3];
_local10 = _local2[0];
_local9 = _local2[1];
} else {
x = _local2[0];
y = _local2[1];
}
} else {
break;
}
} else if (dec_flag == 0) {
_local2 = checkGoTo4Dir_func(cNum, x, y, throughMap_array, _local7, _local8);
if (_local2[4] == 1) {
x = _local2[0];
y = _local2[1];
_local12.push(_local2[2]);
_local14.push(_local2[3]);
_local13.push(1);
_local7 = _local2[2];
_local8 = _local2[3];
} else {
_local12 = [0];
_local14 = [0];
_local13 = [0];
x = _local24;
y = _local23;
break;
}
}
_local19++;
}
if ((x == _local24) && (y == _local23)) {
_local12 = [0];
_local14 = [0];
_local13 = [0];
}
ret = [];
_local5 = 0;
while (_local5 <= (_local12.length - 1)) {
ret.push(_local12[_local5]);
ret.push(_local14[_local5]);
ret.push(_local13[_local5]);
_local5++;
}
return([x, y, ret, dec_flag]);
}
function checkGoTo4Dir_func(cNum, x, y, thMap_array, fDirX, fDirY) {
var _local12;
var _local11;
var _local13;
var _local1;
var _local7;
var _local4;
var _local5;
var _local9;
var _local8;
var _local6;
var _local10;
_local12 = x;
_local11 = y;
_local10 = 0;
_local13 = retRandomNumStr_func(4);
_local1 = 0;
while (_local1 <= 3) {
_local7 = _local13.substr(_local1, 1);
tmp = retNumToXYDir_func(_local7);
_local4 = tmp[0];
_local5 = tmp[1];
x = x + _local4;
y = y + _local5;
_local9 = fDirX * -1;
_local8 = fDirY * -1;
_local6 = 0;
if ((_local4 == _local9) && (_local5 == _local8)) {
_local6 = 1;
}
f = dontThroughCellFlag_array[cNum][y][x];
if ((f == 0) && (_local6 != 1)) {
_local10 = 1;
break;
}
x = _local12;
y = _local11;
_local1++;
}
return([x, y, _local4, _local5, _local10]);
}
function retDirXYtoName_func(xd, yd) {
var _local6;
var _local3;
var _local2;
var _local1;
_local3 = ["L", "", "R"];
_local2 = ["U", "", "D"];
_local1 = _local3[Number(xd) + 1] + _local2[Number(yd) + 1];
_local1 = _local1.substr(0, 1);
return(_local1);
}
function orderToAwayFromBomb_func() {
var _local7;
var _local5;
var _local6;
var _local2;
var _local4;
var _local3;
_local5 = 0;
while (_local5 <= bombNumInSt) {
_local7 = retCharaLoc_func(partsImgs_mc[("charaMain" + (_local5 + 1)) + "_mc"]);
_local6 = burnMap_array[_local7[1]][_local7[0]];
bState_ta.text = _local6;
bState2_ta.text = " \u00A3\u00B0\u00A3\u00B1\u00A3\u00B2\u00A3\u00B3\u00A3\u00B4\u00A3\u00B5\u00A3\u00B6\u00A3\u00B7\u00A3\u00B8\r";
_local4 = 0;
while (_local4 <= (numOfBlockV - 1)) {
_local2 = "";
_local2 = _local2 + String(_local4);
_local3 = 0;
while (_local3 <= (numOfBlockH - 1)) {
if (burnMap_array[_local4][_local3] == 0) {
if (dontThroughCellFlag_array[_local5][_local4][_local3] == 0) {
_local2 = _local2 + "\u00A3\u00DF";
} else {
_local2 = _local2 + "\u00BF\u00DA";
}
} else {
_local2 = _local2 + "\u00D1\u00D7";
}
_local3++;
}
bState2_ta.text = bState2_ta.text + (_local2 + newline);
_local4++;
}
if (_local6 == 1) {
this["bombAI" + cNum].actState = 3;
}
_local5++;
}
}
function retGetItemPos_func(cNum, x, y) {
var _local6;
var _local19;
var _local14;
var _local11;
var _local12;
var _local17;
var _local16;
var _local32;
var _local29;
var _local25;
var _local24;
var _local3;
var _local8;
var _local7;
var _local21;
var _local20;
var _local15;
var _local31;
var _local30;
var _local28;
var _local33;
var _local9;
var _local10;
var _local27;
var _local26;
var _local4;
var _local22;
var _local23;
var _local5;
var _local13;
if (numOfShowItem == 0) {
_local3 = [0];
_local8 = [0];
_local7 = [0];
ret = [];
_local6 = 0;
while (_local6 <= (_local3.length - 1)) {
ret.push(_local3[_local6]);
ret.push(_local8[_local6]);
ret.push(_local7[_local6]);
_local6++;
}
return([x, y, ret, 0]);
}
_local22 = x;
_local23 = y;
_local3 = [];
_local8 = [];
_local7 = [];
_local11 = 0;
_local12 = 0;
_local19 = retRandomNumStr_func(4);
_local15 = 0;
while (_local15 <= 7) {
_local4 = checkGoTo4Dir_func(cNum, x, y, dontThroughCellFlag_array, _local11, _local12);
if (_local4[4] == 1) {
x = _local4[0];
y = _local4[1];
_local3.push(_local4[2]);
_local8.push(_local4[3]);
_local7.push(1);
_local11 = _local4[2];
_local12 = _local4[3];
} else {
_local3 = [0];
_local8 = [0];
_local7 = [0];
x = _local22;
y = _local23;
break;
}
dec_flag = 0;
_local17 = x;
_local16 = y;
_local6 = 0;
while (_local6 <= 3) {
_local14 = _local19.substr(_local6, 1);
tmp = retNumToXYDir_func(_local14);
_local9 = tmp[0];
_local10 = tmp[1];
x = x + _local9;
y = y + _local10;
_local13 = dontThroughCellFlag_array[cNum][y][x];
if (_local13 == 0) {
_local5 = recItemMapLoc_array[y][x];
if (((_local5 == 0) || (_local5 == 1)) || (_local5 == 2)) {
dec_flag = 1;
_local21 = _local11;
_local20 = _local12;
_local3.push(_local9);
_local8.push(_local10);
_local7.push(1);
break;
}
}
x = _local17;
y = _local16;
_local6++;
}
if (dec_flag == 1) {
break;
}
_local15++;
}
if ((x == _local22) && (y == _local23)) {
_local3 = [0];
_local8 = [0];
_local7 = [0];
}
ret = [];
_local6 = 0;
while (_local6 <= (_local3.length - 1)) {
ret.push(_local3[_local6]);
ret.push(_local8[_local6]);
ret.push(_local7[_local6]);
_local6++;
}
return([x, y, ret, dec_flag]);
}
function stopAllBombMC_func() {
var _local2;
var _local1;
_local2 = 0;
while (_local2 <= (numOfBlockV - 1)) {
_local1 = 0;
while (_local1 <= (numOfBlockH - 1)) {
recBombMC_array[_local2][_local1].stop();
_local1++;
}
_local2++;
}
}
function deadCheck_func(mc) {
var _local9;
var _local10;
var _local11;
var _local4;
var _local5;
var _local6;
var _local8;
var _local3;
var _local1;
var _local2;
if (mc == undefined) {
return(undefined);
}
_local9 = mc._x;
_local10 = mc._y;
_local11 = mc._rotation;
_local6 = [];
_local6.L = [0, 0];
_local6.C = [0, 0];
_local6.R = [-1, -1];
_local6.U = [-1, 0];
_local6.D = [0, -1];
_local8 = _local6[mc._name.substr(1, 1)];
_local4 = Math.floor(((_local9 + (cellSize / 2)) - cellStartX) / cellSize);
_local5 = Math.floor(((_local10 + (cellSize / 2)) - cellStartY) / cellSize);
_local4 = _local4 + _local8[0];
_local5 = _local5 + _local8[1];
_local2 = [];
_local1 = 0;
while (_local1 <= ((bombNumInSt + 1) - 1)) {
_local2.push(0);
_local1++;
}
_local1 = 0;
while (_local1 <= ((bombNumInSt + 1) - 1)) {
_local3 = retCharaLoc_func(partsImgs_mc[("charaMain" + _local1) + "_mc"]);
if ((_local4 == _local3[0]) && (_local5 == _local3[1])) {
_local2[_local1] = 1;
}
_local1++;
}
_local1 = 0;
while (_local1 <= (dead_flags.length - 1)) {
if (dead_flags[_local1] == 0) {
dead_flags[_local1] = _local2[_local1];
}
_local1++;
}
_local1 = 0;
while (_local1 <= (dead_flags.length - 1)) {
if (dead_flags[_local1] == 1) {
dead_func(_local1);
}
_local1++;
}
}
function retDirXYToTxt_func(dx, dy) {
var _local1;
var _local2;
dx++;
dy++;
_local1 = ["\u00D7\u00F3", "", "\u00D3\u00D2"];
_local2 = ["\u00C9\u00CF", "", "\u00CF\u00C2"];
return(_local1[dx] + _local2[dy]);
}
function retDirXYToDeg_func(dx, dy) {
var _local1;
_local1 = Math.atan2(dy, dx);
_local1 = _local1 / 0.01745329;
return(_local1);
}
function retDegToDirXY_func(deg) {
var _local1;
var _local2;
_local1 = (deg * 3.141593) / 180;
_local2 = [Math.floor(Math.cos(_local1)), Math.floor(Math.sin(_local1))];
return(_local2);
}
function setOnewayMap_func(x, y, cNum) {
var _local2;
_local2 = 0;
while (_local2 <= bombNumInSt) {
if (_local2 != cNum) {
if (_local2 == 0) {
dirX = charaM0Mover_mc.charaM0_DirH_rec;
dirY = charaM0Mover_mc.charaM0_DirV_rec;
} else {
dirX = this["bombAI" + _local2].cDirX;
dirY = this["bombAI" + _local2].cDirY;
}
onewayMap[_local2][y][x] = [dirX * -1, dirY * -1];
}
_local2++;
}
}
function checkPutNewBombAround_func(x, y) {
var x;
var y;
var _local3;
var _local2;
_local3 = ("checkPutNewBombAround_mc" + String(x)) + String(y);
createEmptyMovieClip(_local3, getNextHighestDepth());
_local2 = this[_local3];
_local2.dirX = [1, 0, -1, 0];
_local2.dirY = [0, -1, 0, 1];
_local2.cx = [];
_local2.cy = [];
i = 0;
while (i <= 3) {
_local2.cx[i] = x + _local2.dirX[i];
_local2.cy[i] = y + _local2.dirY[i];
i++;
}
_local2.x = x;
_local2.y = y;
_local2.onEnterFrame = function () {
this.i = 0;
while (this.i <= 3) {
this.put_flag = putBombFlag_array[this.cy[this.i]][this.cx[this.i]];
if (this.put_flag == 1) {
this.putBombID = recBombMC_array[this.cy[this.i]][this.cx[this.i]].putBombID;
this.putBombID_me = recBombMC_array[this.y][this.x].putBombID;
if (this.putBombID > this.putBombID_me) {
this.j = 0;
while (this.j <= (bombNumInSt - 1)) {
onewayMap[this.j][this.y][this.x] = [this.dirX[this.i], this.dirY[this.i]];
this.j++;
}
removeMovieClip(this);
break;
}
}
this.i++;
}
};
}
fadePanel_mc.gotoAndStop("in_frm");
var keyListener = new Object();
Instance of Symbol 74 MovieClip "soundMark_mc" in Symbol 296 MovieClip Frame 1
onClipEvent (load) {
vol = _root.sounds_mc.sndObj.getVolume();
if (vol == 0) {
gotoAndStop (2);
}
}
Symbol 296 MovieClip Frame 2
init_func();
Symbol 296 MovieClip Frame 3
stop();
main_mc.gotoAndPlay(2);
Symbol 297 Button
on (rollOver) {
toTitleBtn_mc.gotoAndStop(2);
}
on (rollOut) {
toTitleBtn_mc.gotoAndStop(1);
}
on (release) {
mapDat = "";
j = 0;
while (j <= (numOfV - 1)) {
i = 0;
while (i <= (numOfH - 1)) {
mcName = ("m" + String(j)) + String(i);
mapDat = mapDat + String((mapParts_mc[mcName]._currentframe - 1).toString(16));
i++;
}
j++;
}
_parent.mapDatSt0 = mapDat;
_parent.gotoAndStop("title_frm");
}
Symbol 298 Button
on (rollOver) {
dataChangeBtn_btn.gotoAndStop(2);
}
on (rollOut) {
dataChangeBtn_btn.gotoAndStop(1);
}
on (release) {
dataChangeBtn_btn.gotoAndStop(1);
btnOff_func();
mapDat = "";
j = 0;
while (j <= (numOfV - 1)) {
i = 0;
while (i <= (numOfH - 1)) {
mcName = ("m" + String(j)) + String(i);
mapDat = mapDat + String((mapParts_mc[mcName]._currentframe - 1).toString(16));
i++;
}
j++;
}
mapDatInOutPanel_mc.mapDat = mapDat;
mapDatInOutPanel_mc.gotoAndStop(2);
}
Symbol 299 MovieClip Frame 1
stop();
Symbol 300 Button
on (release) {
_parent._parent.releaseChangeMapBtn_func(this);
}
Symbol 307 Button
on (rollOver) {
closeBtn_mc.gotoAndStop(2);
}
on (rollOut) {
closeBtn_mc.gotoAndStop(1);
}
on (release) {
_parent.btnOn_func();
prevFrame();
}
Symbol 309 MovieClip Frame 1
stop();
Symbol 310 Button
on (rollOver) {
loadBtn_mc.gotoAndStop(2);
}
on (rollOut) {
loadBtn_mc.gotoAndStop(1);
}
on (release) {
mapDat = textFi_txt.text;
j = 0;
while (j <= (_parent.numOfV - 1)) {
i = 0;
while (i <= (_parent.numOfH - 1)) {
mapDat1P = mapDat.substr(i + (j * _parent.numOfH), 1);
mcName = ("m" + String(j)) + String(i);
_parent.mapParts_mc[mcName].gotoAndStop(Number(mapDat1P) + 1);
i++;
}
j++;
}
_parent.mapDat = mapDat;
}
Symbol 312 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 2
textFi_txt.text = mapDat;
textFi2_txt.text = "";
i = 0;
while (i <= 4) {
textFi2_txt.text = textFi2_txt.text + (_parent._parent["mapDatSt" + i] + newline);
i++;
}
Symbol 316 MovieClip Frame 1
function releaseChangeMapBtn_func(mc) {
var _local2;
var _local1;
_local2 = mc._name.substr(1, 1);
_local1 = mc._name.substr(2, 1);
mapParts_mc[("m" + _local2) + _local1].nextFrame();
}
function btnOn_func() {
var _local1;
j = 0;
while (j <= (numOfV - 1)) {
i = 0;
while (i <= (numOfH - 1)) {
newName = ("b" + String(j)) + String(i);
mapParts_mc[newName].btn.enabled = true;
i++;
}
j++;
}
toTitleBtn_btn.enabled = true;
dataChangeBtn_btn.enabled = true;
}
function btnOff_func() {
var _local1;
j = 0;
while (j <= (numOfV - 1)) {
i = 0;
while (i <= (numOfH - 1)) {
newName = ("b" + String(j)) + String(i);
mapParts_mc[newName].btn.enabled = false;
i++;
}
j++;
}
toTitleBtn_btn.enabled = false;
dataChangeBtn_btn.enabled = false;
}
cellSize = _parent.blockCellSize;
cellStartX = _parent.initBlockLockX;
cellStartY = _parent.initBlockLockY;
numOfH = _parent.numOfBlockX;
numOfV = _parent.numOfBlockY;
j = 0;
while (j <= (numOfV - 1)) {
i = 0;
while (i <= (numOfH - 1)) {
newName = ("m" + String(j)) + String(i);
duplicateMovieClip ("mapParts_mc.mapImgs_mc", newName, mapParts_mc.getNextHighestDepth());
mapParts_mc[newName]._x = cellStartX + (i * cellSize);
mapParts_mc[newName]._y = cellStartY + (j * cellSize);
newName = ("b" + String(j)) + String(i);
duplicateMovieClip ("mapParts_mc.changeMapBtn_mc", newName, mapParts_mc.getNextHighestDepth());
mapParts_mc[newName]._x = cellStartX + (i * cellSize);
mapParts_mc[newName]._y = cellStartY + (j * cellSize);
i++;
}
j++;
}
mapParts_mc.mapImgs_mc.swapDepths(mapParts_mc.getNextHighestDepth());
removeMovieClip(mapParts_mc.mapImgs_mc);
mapParts_mc.changeMapBtn_mc.swapDepths(mapParts_mc.getNextHighestDepth());
removeMovieClip(mapParts_mc.changeMapBtn_mc);
Symbol 316 MovieClip Frame 2
stop();