Frame 1
var my_cm = new ContextMenu();
my_cm.hideBuiltInItems();
this.menu = my_cm;
MochiAd.showPreGameAd({id:"b01fd1dd9252abab", res:"600x450"});
Frame 3
if (_root.getBytesLoaded() < _root.getBytesTotal()) {
gotoAndStop ("Loading");
}
Instance of Symbol 56 MovieClip in Frame 7
//component parameters
onClipEvent (construct) {
_game_name = "mental";
score_var = "_global.score";
}
Frame 10
function hideMenu() {
startBtn._visible = false;
instrBtn._visible = false;
settingBtn._visible = false;
viewHighBtn._visible = false;
downBtn._visible = false;
moreGameBtn._visible = false;
addSiteBtn._visible = false;
}
function unhideMenu() {
startBtn._visible = true;
instrBtn._visible = true;
settingBtn._visible = true;
viewHighBtn._visible = true;
downBtn._visible = true;
moreGameBtn._visible = true;
addSiteBtn._visible = true;
}
startBtn.onPress = function () {
_global.gameDat = SharedObject.getLocal("gameDat", "/");
if ((_global.readInstruction == "yes") || (_global.gameDat.data.recFlag)) {
gotoAndStop ("startGame");
stageRestart();
} else {
_global.gameRoot.gotoAndStop("instruction");
}
};
instrBtn.onPress = function () {
_global.gameRoot.gotoAndStop("instruction");
_global.readInstruction = "yes";
};
stop();
if (_root.sndCtrl == undefined) {
var sndCtrl = new SoundManage();
_root.sndCtrl.addSound("crashSnd", 100);
_root.sndCtrl.addSound("doorSnd", 100);
_root.sndCtrl.addSound("electricSnd", 100);
_root.sndCtrl.addSound("fallDownSnd", 100);
_root.sndCtrl.addSound("getSnd", 100);
_root.sndCtrl.addSound("hitSnd", 100);
_root.sndCtrl.addSound("punchSnd", 100);
_root.sndCtrl.addSound("seleRoleSnd", 100);
_root.sndCtrl.addSound("shoutSnd", 100);
_root.sndCtrl.addSound("slapSnd", 100);
_root.sndCtrl.addSound("teleCallSnd", 100);
_root.sndCtrl.addSound("teleConSnd", 100);
_root.sndCtrl.addSound("telePressSnd", 100);
_root.sndCtrl.addSound("walkSnd", 100);
_root.sndCtrl.addSound("dogBark", 100);
}
instrPanel._visible = false;
settingPanel._visible = false;
_global.visualQlt = "MEDIUM";
_global.gameRoot = this;
_global.secondCnt = 0;
_global.minuteCnt = 0;
_global.score = 0;
if (!_global.keySetting) {
_global.keySetting = "set1";
}
Instance of Symbol 110 MovieClip in Frame 10
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Frame 11
stop();
newBtn.onPress = function () {
_global.secondCnt = (ctnrRoor.count = 0);
_global.minuteCnt = 0;
_global.score = 0;
gotoAndStop ("gameStage1");
_global.loadGame = false;
};
continueBtn.onPress = function () {
trace("chapter " + _global.gameDat.data.chapter);
if (_global.gameDat.data.chapter == "gameStage1") {
_global.isFirstGame = "no";
gotoAndStop ("gameStage1");
} else if (_global.gameDat.data.chapter == "gameUnder") {
gotoAndStop ("gameUnder");
}
_global.loadGame = true;
};
_global.gameDat = SharedObject.getLocal("gameDat", "/");
if (!_global.gameDat.data.recFlag) {
continueBtn._visible = false;
}
Frame 12
_global.readInstruction = "yes";
stop();
Frame 13
var stageRoot = this;
function disabledSeleBtns() {
stageRoot.stateRoleSele.usePropBtn._visible = false;
stageRoot.stateRoleSele.dropPropBtn._visible = false;
}
function activateSeleBtns() {
stageRoot.stateRoleSele.usePropBtn._visible = true;
stageRoot.stateRoleSele.dropPropBtn._visible = true;
}
stageRoot.stateRoleSele.bg.onPress = function () {
trace("you click state bg");
};
stageRoot.stateRoleSele.bg.useHandCursor = false;
disabledSeleBtns();
function executeCallback() {
_global.secondCnt++;
if (_global.secondCnt == 60) {
_global.secondCnt = 1;
_global.minuteCnt++;
}
secondTxt = ((_global.secondCnt >= 10) ? (String(_global.secondCnt)) : ("0" + _global.secondCnt));
minuteTxt = ((_global.minuteCnt >= 10) ? (String(_global.minuteCnt)) : ("0" + _global.minuteCnt));
stageRoot.stateRoleSele.watch.text = (minuteTxt + ":") + secondTxt;
}
function startClock() {
intervalId = setInterval(this, "executeCallback", duration);
}
var intervalId;
var duration = 1000;
clearInterval(intervalId);
function saveData() {
_global.gameDat = SharedObject.getLocal("gameDat", "/");
_global.gameDat.clear();
_global.gameDat.data.recFlag = "true";
_global.gameDat.data.chapter = "gameStage1";
stageRoot.saveRole();
stageRoot.saveHouse();
stageRoot.saveEnemy();
stageRoot.saveEvent();
stageRoot.saveAccess();
stageRoot.saveProp();
stageRoot.saveOther();
stageRoot.saveOption();
_global.gameDat.flush();
return(true);
}
function saveRole() {
function traceData() {
trace("\nroles' record block :");
i = 0;
while (i < 3) {
trace((("role rec" + (i + 1)) + ": ") + _global.gameDat.data["roleRec" + (i + 1)]);
trace((("role tools" + (i + 1)) + ": ") + _global.gameDat.data["roleRec" + (i + 1)][3]);
i++;
}
}
i = 0;
while (i < 3) {
roleName = "role" + (i + 1);
_global.gameDat.data["roleRec" + (i + 1)] = [datPath[roleName]._x, datPath[roleName]._y, datPath[roleName].crtHouse, datPath[roleName].toolsAry.concat()];
i++;
}
_global.gameDat.flush();
}
function saveHouse() {
function traceData() {
trace("\nhouseAry block");
i = 1;
while (i <= 2) {
trace((("houseAry6" + i) + " ") + _global.gameDat.data["houseAry6" + i]);
i++;
}
i = 1;
while (i <= 3) {
trace((("houseAry5" + i) + " ") + _global.gameDat.data["houseAry5" + i]);
i++;
}
i = 1;
while (i <= 4) {
trace((("houseAry4" + i) + " ") + _global.gameDat.data["houseAry4" + i]);
i++;
}
i = 1;
while (i <= 3) {
trace((("houseAry3" + i) + " ") + _global.gameDat.data["houseAry3" + i]);
i++;
}
i = 1;
while (i <= 3) {
trace((("houseAry2" + i) + " ") + _global.gameDat.data["houseAry2" + i]);
i++;
}
i = 1;
while (i <= 4) {
trace((("houseAry1" + i) + " ") + _global.gameDat.data["houseAry1" + i]);
i++;
}
}
i = 1;
while (i <= 2) {
_global.gameDat.data["houseAry6" + i] = datPath["house6" + i].propAry.concat();
i++;
}
i = 1;
while (i <= 3) {
_global.gameDat.data["houseAry5" + i] = datPath["house5" + i].propAry.concat();
i++;
}
i = 1;
while (i <= 4) {
_global.gameDat.data["houseAry4" + i] = datPath["house4" + i].propAry.concat();
i++;
}
i = 1;
while (i <= 3) {
_global.gameDat.data["houseAry3" + i] = datPath["house3" + i].propAry.concat();
i++;
}
i = 1;
while (i <= 3) {
_global.gameDat.data["houseAry2" + i] = datPath["house2" + i].propAry.concat();
i++;
}
i = 1;
while (i <= 4) {
_global.gameDat.data["houseAry1" + i] = datPath["house1" + i].propAry.concat();
i++;
}
_global.gameDat.flush();
}
function saveEnemy() {
function traceData() {
trace("\nenemy rec block");
trace("enemyRec11 " + _global.gameDat.data.enemyRec11);
trace("enemyRec21 " + _global.gameDat.data.enemyRec21);
trace("enemyRec31 " + _global.gameDat.data.enemyRec31);
trace("enemyRec32 " + _global.gameDat.data.enemyRec32);
}
_global.gameDat.data.enemyRec11 = [datPath.enemy11._visible, datPath.enemy11.crtTask, datPath.enemy11._x, datPath.enemy11._y, datPath.enemydead11];
_global.gameDat.data.enemyRec21 = [datPath.enemy21._visible, datPath.enemy21.crtTask, datPath.enemy21._x, datPath.enemy21._y, datPath.enemydead21];
_global.gameDat.data.enemyRec31 = [datPath.enemy31._visible, datPath.enemy31.crtTask, datPath.enemy31._x, datPath.enemy31._y, datPath.enemydead31];
_global.gameDat.data.enemyRec32 = [datPath.enemy32._visible, datPath.enemy32.crtTask, datPath.enemy32._x, datPath.enemy32._y, datPath.enemydead32];
_global.gameDat.flush();
traceData();
}
function saveEvent() {
function traceData() {
trace("\nevent data block");
trace("event woodover " + _global.gameDat.data.woodover);
trace("event rope1over " + _global.gameDat.data.rope1over);
trace("event nunmberover " + _global.gameDat.data.numberover);
trace("event flowerover " + _global.gameDat.data.flowerover);
trace("event dogover " + _global.gameDat.data.dogover);
trace("event steelDoorover " + _global.gameDat.data.steelDoorover);
trace("event pipeHeadover " + _global.gameDat.data.pipeHeadover);
trace("event heavy52over " + _global.gameDat.data.heavy52over);
trace("event heavy42over " + _global.gameDat.data.heavy42over);
trace("event heavy11over " + _global.gameDat.data.heavy11over);
}
_global.gameDat.data.woodover = datPath.woodover;
_global.gameDat.data.rope1over = datPath.rope1over;
_global.gameDat.data.numberover = datPath.numberover;
_global.gameDat.data.flowerover = datPath.flowerover;
_global.gameDat.data.dogover = datPath.dogover;
_global.gameDat.data.steelDoorover = datPath.steelDoorover;
_global.gameDat.data.pipeHeadover = datPath.pipeHeadover;
_global.gameDat.data.heavy52over = datPath.heavy52over;
_global.gameDat.data.heavy42over = datPath.heavy42over;
_global.gameDat.data.heavy11over = datPath.heavy11over;
_global.gameDat.data.enemy11over = datPath.enemy11over;
_global.gameDat.data.enemy21over = datPath.enemy21over;
_global.gameDat.flush();
}
function saveAccess() {
function traceData() {
trace("\naccess block");
trace("pipe1 " + _global.gameDat.data.pipe1able);
trace("pipe3 " + _global.gameDat.data.pipe3able);
trace("pipe4 " + _global.gameDat.data.pipe4able);
trace("pipe5 " + _global.gameDat.data.pipe5able);
trace("pipe6 " + _global.gameDat.data.pipe6able);
trace("pipe7 " + _global.gameDat.data.pipe7able);
trace("doorV45 " + _global.gameDat.data.doorV45able);
trace("doorV34 " + _global.gameDat.data.doorV34able);
trace("doorV23 " + _global.gameDat.data.doorV23able);
trace("doorV12 " + _global.gameDat.data.doorV12able);
trace("doorH5_12 " + _global.gameDat.data.doorH5_12able);
trace("doorH5_23 " + _global.gameDat.data.doorH5_23able);
trace("doorH4_12 " + _global.gameDat.data.doorH4_12able);
trace("doorH3_12 " + _global.gameDat.data.doorH3_12able);
trace("doorH2_12 " + _global.gameDat.data.doorH2_12able);
trace("doorH2_23 " + _global.gameDat.data.doorH2_23able);
trace("doorH1_12 " + _global.gameDat.data.doorH1_12able);
trace("doorH1_23 " + _global.gameDat.data.doorH1_23able);
trace("doorH1_34 " + _global.gameDat.data.doorH1_34able);
trace("ladderable " + _global.gameDat.data.ladderable);
}
_global.gameDat.data.pipe1able = datPath.pipe1.accessable;
_global.gameDat.data.pipe3able = datPath.pipe3.accessable;
_global.gameDat.data.pipe4able = datPath.pipe4.accessable;
_global.gameDat.data.pipe5able = datPath.pipe5.accessable;
_global.gameDat.data.pipe6able = datPath.pipe6.accessable;
_global.gameDat.data.pipe7able = datPath.pipe7.accessable;
_global.gameDat.data.doorV45able = datPath.doorV45.accessable;
_global.gameDat.data.doorV34able = datPath.doorV34.accessable;
_global.gameDat.data.doorV23able = datPath.doorV23.accessable;
_global.gameDat.data.doorV12able = datPath.doorV12.accessable;
_global.gameDat.data.doorH5_12able = datPath.doorH5_12.accessable;
_global.gameDat.data.doorH5_23able = datPath.doorH5_23.accessable;
_global.gameDat.data.doorH4_12able = datPath.doorH4_12.accessable;
_global.gameDat.data.doorH3_12able = datPath.doorH3_12.accessable;
_global.gameDat.data.doorH2_12able = datPath.doorH2_12.accessable;
_global.gameDat.data.doorH2_23able = datPath.doorH2_23.accessable;
_global.gameDat.data.doorH1_12able = datPath.doorH1_12.accessable;
_global.gameDat.data.doorH1_23able = datPath.doorH1_23.accessable;
_global.gameDat.data.doorH1_34able = datPath.doorH1_34.accessable;
_global.gameDat.data.ladderable = datPath.ladder.accessable;
_global.gameDat.flush();
}
function saveProp() {
function traceData() {
trace("\n prop block");
trace("key1 " + _global.gameDat.data.key1Rec);
trace("key2 " + _global.gameDat.data.key2Rec);
trace("tele " + _global.gameDat.data.teleRec);
trace("number " + _global.gameDat.data.numberRec);
trace("number2 " + _global.gameDat.data.number2Rec);
trace("axe " + _global.gameDat.data.axeRec);
trace("fBullet " + _global.gameDat.data.fBulletRec);
trace("card " + _global.gameDat.data.cardRec);
}
_global.gameDat.data.key1Rec = [datPath.key1._x, datPath.key1._y, datPath.key1._visible];
_global.gameDat.data.key2Rec = [datPath.key2._x, datPath.key2._y, datPath.key2._visible];
_global.gameDat.data.teleRec = [datPath.tele._x, datPath.tele._y, datPath.tele._visible];
_global.gameDat.data.numberRec = [datPath.number._x, datPath.number._y, datPath.number._visible];
_global.gameDat.data.number2Rec = [datPath.number2._x, datPath.number2._y, datPath.number2._visible];
_global.gameDat.data.axeRec = [datPath.axe._x, datPath.axe._y, datPath.axe._visible];
_global.gameDat.data.fBulletRec = [datPath.fBullet._x, datPath.fBullet._y, datPath.fBullet._visible];
_global.gameDat.data.cardRec = [datPath.card._x, datPath.card._y, datPath.card._visible];
_global.gameDat.data.flush();
}
function saveOther() {
function traceData() {
trace("wire11Frame " + _global.gameDat.data.wire11Frame);
trace("powerFrame " + _global.gameDat.data.powerFrame);
}
_global.gameDat.data.powerIsOpen = datPath.power.isOpen;
_global.gameDat.data.wire11Frame = datPath.wire11._currentframe;
_global.gameDat.data.powerFrame = datPath.power._currentframe;
_global.gameDat.data.elemMcVisible = datPath.wire11.eleMc._visible;
_global.gameDat.flush();
}
function saveOption() {
_global.gameDat.data.secondCnt = _global.secondCnt;
_global.gameDat.data.minuteCnt = _global.minuteCnt;
_global.gameDat.data.score = _global.score;
_global.gameDat.data.viewScale = stageRoot.container._xscale;
_global.gameDat.data.containerX = stageRoot.container._x;
_global.gameDat.data.containerY = stageRoot.container._y;
_global.gameDat.data.crtRole = stageRoot.container.roleMoveCtrl.crtRole;
_global.gameDat.data.flush();
}
function loadData() {
_global.gameDat = SharedObject.getLocal("gameDat", "/");
trace("readBtn recFlag " + _global.gameDat.data.recFlag);
stageRoot.container.zoomCtrl.crtTask = "none";
stageRoot.container.zoomCtrl.onEnterFrame = null;
stageRoot.roleData();
stageRoot.houseData();
stageRoot.enemyData();
stageRoot.eventData();
stageRoot.accessData();
stageRoot.propData();
stageRoot.otherData();
stageRoot.optionData();
stageRoot.cover.unloadMovie();
}
function roleData() {
trace("role data");
i = 0;
while (i < 3) {
roleName = "role" + (i + 1);
datPath[roleName]._x = _global.gameDat.data["roleRec" + (i + 1)][0];
datPath[roleName]._y = _global.gameDat.data["roleRec" + (i + 1)][1];
datPath[roleName].crtHouse = _global.gameDat.data["roleRec" + (i + 1)][2];
datPath[roleName].toolsAry = _global.gameDat.data["roleRec" + (i + 1)][3].concat();
j = 0;
while (j < datPath[roleName].toolsAry.length) {
datPath[datPath[roleName].toolsAry[j]]._visible = false;
j++;
}
i++;
}
}
function houseData() {
i = 1;
while (i <= 2) {
datPath["house6" + i].propAry = _global.gameDat.data["houseAry6" + i].concat();
i++;
}
i = 1;
while (i <= 3) {
datPath["house5" + i].propAry = _global.gameDat.data["houseAry5" + i].concat();
i++;
}
i = 1;
while (i <= 4) {
datPath["house4" + i].propAry = _global.gameDat.data["houseAry4" + i].concat();
i++;
}
i = 1;
while (i <= 3) {
datPath["house3" + i].propAry = _global.gameDat.data["houseAry3" + i].concat();
i++;
}
i = 1;
while (i <= 3) {
datPath["house2" + i].propAry = _global.gameDat.data["houseAry2" + i].concat();
i++;
}
i = 1;
while (i <= 4) {
datPath["house1" + i].propAry = _global.gameDat.data["houseAry1" + i].concat();
i++;
}
}
function enemyData() {
_global.gameDat.data.enemyRec11 = [datPath.enemy11._visible, datPath.enemy11.crtTask, datPath.enemy11._x, datPath.enemy11._y];
trace("enemydata");
if (_global.gameDat.data.enemy11over == true) {
datPath.enemy11.unloadMovie();
datPath.enemy11Dead._visible = true;
}
datPath.enemy31._visible = _global.gameDat.data.enemyRec31[0];
datPath.enemy31.crtTask = _global.gameDat.data.enemyRec31[1];
datPath.enemy31._x = _global.gameDat.data.enemyRec31[2];
datPath.enemy31._y = _global.gameDat.data.enemyRec31[3];
datPath.enemy32._visible = _global.gameDat.data.enemyRec32[0];
datPath.enemy32.crtTask = _global.gameDat.data.enemyRec32[1];
datPath.enemy32._x = _global.gameDat.data.enemyRec32[2];
datPath.enemy32._y = _global.gameDat.data.enemyRec32[3];
}
function eventData() {
trace("event Data");
datPath.woodover = _global.gameDat.data.woodover;
datPath.rope1over = _global.gameDat.data.rope1over;
datPath.numberover = _global.gameDat.data.numberover;
datPath.flowerover = _global.gameDat.data.flowerover;
datPath.dogover = _global.gameDat.data.dogover;
datPath.steelDoorover = _global.gameDat.data.steelDoorover;
datPath.pipeHeadover = _global.gameDat.data.pipeHeadover;
datPath.heavy52over = _global.gameDat.data.heavy52over;
datPath.heavy42over = _global.gameDat.data.heavy42over;
datPath.heavy11over = _global.gameDat.data.heavy11over;
datPath.enemy11over = _global.gameDat.data.enemy11over;
datPath.enemy21over = _global.gameDat.data.enemy21over;
if (_global.gameDat.data.woodover) {
datPath.wood.unloadMovie();
datPath.axe.unloadMovie();
}
if (_global.gameDat.data.rope1over) {
datPath.rope1.unloadMovie();
datPath.pipe5._visible = true;
}
if (_global.gameDat.data.numberover) {
datPath.number.unloadMovie();
}
trace("flowerover" + _global.gameDat.data.flowerover);
if (_global.gameDat.data.flowerover) {
datPath.flower.unloadMovie();
datPath.flower0.unloadMovie();
datPath.flowerClip.gotoAndStop("end");
datPath.enemy21.unloadMovie();
}
if (_global.gameDat.data.dogover) {
datPath.dog.gotoAndStop(2);
}
if (_global.gameDat.data.steelDoorover) {
datPath.steelDoor.gotoAndStop(2);
datPath.steelDoor.ctt.gotoAndStop("end");
}
if (_global.gameDat.data.pipeHeadover) {
datPath.pipeHead.unloadMovie();
datPath.house53.propAry.push("trg53_2");
}
if (_global.gameDat.data.heavy52over) {
datPath.heavy52.unloadMovie();
}
if (_global.gameDat.data.heavy42over) {
datPath.heavy42.unloadMovie();
}
if (_global.gameDat.data.heavy11over) {
datPath.heavy11.unloadMovie();
}
}
function accessData() {
trace("accessData");
datPath.pipe1.accessable = _global.gameDat.data.pipe1able;
datPath.pipe3.accessable = _global.gameDat.data.pipe3able;
datPath.pipe4.accessable = _global.gameDat.data.pipe4able;
datPath.pipe5.accessable = _global.gameDat.data.pipe5able;
datPath.pipe6.accessable = _global.gameDat.data.pipe6able;
datPath.pipe7.accessable = _global.gameDat.data.pipe7able;
datPath.doorV45.accessable = _global.gameDat.data.doorV45able;
datPath.doorV34.accessable = _global.gameDat.data.doorV34able;
datPath.doorV23.accessable = _global.gameDat.data.doorV23able;
datPath.doorV12.accessable = _global.gameDat.data.doorV12able;
datPath.doorH5_12.accessable = _global.gameDat.data.doorH5_12able;
datPath.doorH5_23.accessable = _global.gameDat.data.doorH5_23able;
datPath.doorH4_12.accessable = _global.gameDat.data.doorH4_12able;
datPath.doorH3_12.accessable = _global.gameDat.data.doorH3_12able;
datPath.doorH2_12.accessable = _global.gameDat.data.doorH2_12able;
datPath.doorH2_23.accessable = _global.gameDat.data.doorH2_23able;
datPath.doorH1_12.accessable = _global.gameDat.data.doorH1_12able;
datPath.doorH1_23.accessable = _global.gameDat.data.doorH1_23able;
datPath.doorH1_34.accessable = _global.gameDat.data.doorH1_34able;
datPath.ladder.accessable = _global.gameDat.data.ladderable;
}
function propData() {
trace("propData");
if (_global.gameDat.data.key1Rec[0] != undefined) {
datPath.key1._x = _global.gameDat.data.key1Rec[0];
datPath.key1._y = _global.gameDat.data.key1Rec[1];
datPath.key1._visible = _global.gameDat.data.key1Rec[2];
}
if (_global.gameDat.data.key2Rec[0] != undefined) {
datPath.key2._x = _global.gameDat.data.key2Rec[0];
datPath.key2._y = _global.gameDat.data.key2Rec[1];
datPath.key2._visible = _global.gameDat.data.key2Rec[2];
}
if (_global.gameDat.data.teleRec[0] != undefined) {
datPath.tele._x = _global.gameDat.data.teleRec[0];
datPath.tele._y = _global.gameDat.data.teleRec[1];
datPath.tele._visible = _global.gameDat.data.teleRec[2];
}
if (_global.gameDat.data.numberRec[0] != undefined) {
datPath.number._x = _global.gameDat.data.numberRec[0];
datPath.number._y = _global.gameDat.data.numberRec[1];
datPath.number._visible = _global.gameDat.data.numberRec[2];
}
if (_global.gameDat.data.number2Rec[0] != undefined) {
datPath.number2._x = _global.gameDat.data.number2Rec[0];
datPath.number2._y = _global.gameDat.data.number2Rec[1];
datPath.number2._visible = _global.gameDat.data.number2Rec[2];
}
if (_global.gameDat.data.axeRec[0] != undefined) {
datPath.axe._x = _global.gameDat.data.axeRec[0];
datPath.axe._y = _global.gameDat.data.axeRec[1];
datPath.axe._visible = _global.gameDat.data.axeRec[2];
}
if (_global.gameDat.data.fBulletRec[0] != undefined) {
datPath.fBullet._x = _global.gameDat.data.fBulletRec[0];
datPath.fBullet._y = _global.gameDat.data.fBulletRec[1];
datPath.fBullet._visible = _global.gameDat.data.fBulletRec[2];
}
if (_global.gameDat.data.cardRec[0] != undefined) {
datPath.card._x = _global.gameDat.data.cardRec[0];
datPath.card._y = _global.gameDat.data.cardRec[1];
datPath.card._visible = _global.gameDat.data.cardRec[2];
}
}
function otherData() {
datPath.power.isOpen = _global.gameDat.data.powerIsOpen;
trace("--------------power.isOpen " + datPath.power.isOpen);
datPath.wire11.gotoAndStop(_global.gameDat.data.wire11Frame);
datPath.power.gotoAndStop(_global.gameDat.data.powerFrame);
if (datPath.power.isOpen == true) {
datPath.power.gotoAndStop(2);
datPath.wire11.eleMc._visible = true;
trace((("wire 11 eleMc visible now ----------" + datPath.wire11.eleMc) + " ") + datPath.wire11.eleMc._visible);
} else {
datPath.power.gotoAndStop(1);
datPath.wire11.eleMc._visible = false;
}
datPath.wire11.eleMc._visible = _global.gameDat.data.elemMcVisible;
}
function optionData() {
trace((("second and minute cnt of so:" + _global.gameDat.data.secondCnt) + " ") + _global.gameDat.data.minuteCnt);
_global.secondCnt = (ctnrRoor.count = _global.gameDat.data.secondCnt);
_global.minuteCnt = _global.gameDat.data.minuteCnt;
_global.score = _global.gameDat.data.score;
svPath.scoreTxt.text = _global.score;
datPath._xscale = (stageRoot.container._yscale = _global.gameDat.data.viewScale);
datPath._x = _global.gameDat.data.containerX;
datPath._y = _global.gameDat.data.containerY;
datPath.roleMoveCtrl.crtRole = (datPath.crtRole = _global.gameDat.data.crtRole);
svPath.gotoAndStop(_global.gameDat.data.crtRole);
datPath.toolsBoxRefresh(_global.gameDat.data.crtRole);
datPath.activatePropOEF(datPath[_global.gameDat.data.crtRole].crtHouse);
trace(_global.gameDat.data.crtRole);
}
var svPath = stageRoot.stateRoleSele;
var datPath = stageRoot.container;
trace(svPath);
svPath.saveBtn.onPress = function () {
_global.gameRoot.saveMc.gotoAndStop(2);
_global.gameRoot.container.roleMoveCtrl.ctrlAble = false;
};
svPath.clearBtn.onPress = function () {
_global.gameDat.clear();
trace(" recFlag " + _global.gameDat.data.recFlag);
};
svPath.readBtn.onPress = loadData;
function toolIDCTpress() {
this._parent.toolSele = this.crtDispTool;
stageRoot.activateSeleBtns();
i = 0;
while (i <= 4) {
stageRoot.stateRoleSele["toolIDCT" + i].light._visible = false;
i++;
}
this.light._visible = true;
}
function toolIDCTpressInit() {
i = 0;
while (i <= 4) {
stageRoot.stateRoleSele["toolIDCT" + i].onPress = stageRoot.toolIDCTpress;
stageRoot.stateRoleSele["toolIDCT" + i].light._visible = false;
i++;
}
stageRoot.stateRoleSele.qltPanel._visible = false;
stageRoot.stateRoleSele.qltPanelSwitch.onPress = function () {
if (this._parent.qltPanel._visible == true) {
this._parent.qltPanel._visible = false;
} else {
this._parent.qltPanel._visible = true;
this._parent.qltPanel.QLOW._alpha = 30;
this._parent.qltPanel.QMEDIUM._alpha = 30;
this._parent.qltPanel.QHIGH._alpha = 30;
this._parent.qltPanel.QBEST._alpha = 30;
this._parent.qltPanel["Q" + _global.visualQlt]._alpha = 100;
}
};
stageRoot.stateRoleSele.soundStop._visible = (stageRoot.stateRoleSele.musicStop._visible = false);
stageRoot.stateRoleSele.stopSoundBtn.onPress = function () {
if (stageRoot.stateRoleSele.soundStop._visible == false) {
stageRoot.stateRoleSele.soundStop._visible = true;
_global.gameRoot.sndCtrl.stopSound();
} else {
stageRoot.stateRoleSele.soundStop._visible = false;
_global.gameRoot.sndCtrl.returnSound();
}
};
stageRoot.stateRoleSele.stopMusicBtn.onPress = function () {
if (stageRoot.stateRoleSele.musicStop._visible == false) {
stageRoot.stateRoleSele.musicStop._visible = true;
_global.gameRoot.sndCtrl.stopMusic();
} else {
stageRoot.stateRoleSele.musicStop._visible = false;
_global.gameRoot.sndCtrl.returnMusic();
}
};
}
function dropTool(dropName) {
crtRole = stageRoot.container.crtRole;
crtHouse = stageRoot.container[crtRole].crtHouse;
housePropAry = stageRoot.container[crtHouse].propAry;
housePropAry.push(stageRoot.stateRoleSele.toolSele);
stageRoot.container[stageRoot.stateRoleSele.toolSele]._x = stageRoot.container[crtRole]._x;
stageRoot.container[stageRoot.stateRoleSele.toolSele]._y = stageRoot.container[crtRole]._y - 50;
stageRoot.container[stageRoot.stateRoleSele.toolSele]._visible = true;
stageRoot.container[stageRoot.stateRoleSele.toolSele].onEnterFrame = stageRoot.container[stageRoot.stateRoleSele.toolSele].orgnEnterFrame;
i = 0;
while (i < stageRoot.container[crtRole].toolsAry.length) {
if (stageRoot.container[crtRole].toolsAry[i] == stageRoot.stateRoleSele.toolSele) {
stageRoot.container[crtRole].toolsAry.splice(i, 1);
}
i++;
}
stageRoot.container.toolsBoxRefresh(crtRole);
stageRoot.disabledSeleBtns();
}
stageRoot.stateRoleSele.usePropBtn.onPress = function () {
this.crtRole = stageRoot.container.roleMoveCtrl.crtRole;
this.propRlt = stageRoot.container[this._parent.toolSele].rec[0];
this.propFuncType = stageRoot.container[this._parent.toolSele].rec[3];
xDist = Math.abs(stageRoot.container[this.propRlt]._x - stageRoot.container[this.crtRole]._x);
yDist = Math.abs(stageRoot.container[this.propRlt]._y - stageRoot.container[this.crtRole]._y);
if ((xDist > 150) || (yDist > 200)) {
stageRoot.disabledSeleBtns();
stageRoot.container.roleSay(this.crtRole, "I cannot use this here!");
return(undefined);
}
this.propFuncCtt = stageRoot.container[this.propRlt].func[1];
switch (this.propFuncType) {
case "unlock" :
stageRoot.container[this.propFuncCtt].accessable = true;
useKeyName = "useKey" + stageRoot.container[this.crtRole].crtHouse.substr(5, 2);
stageRoot.container[useKeyName].gotoAndPlay(2);
stageRoot.container[useKeyName].role.gotoAndStop(this.crtRole);
stageRoot.container[useKeyName].role.roleCtt.gotoAndPlay(2);
stageRoot.container.roleMoveCtrl.ctrlAble = false;
stageRoot.container[this.crtRole]._visible = false;
if (stageRoot.container[this.propRlt].func[3] != "none") {
stageRoot.container[stageRoot.container[this.propRlt].func[3]].onEnterFrame = stageRoot.container[stageRoot.container[this.propRlt].func[3]].orgnEnterFrame;
}
if (stageRoot.container[this.propRlt].func[2] == "disapear") {
stageRoot.container[this.propRlt].unloadMovie();
}
break;
case "clip" :
stageRoot.container[stageRoot.container[this._parent.toolSele].func[1]].apply(null);
break;
case "generate" :
stageRoot.container[stageRoot.container[this.propRlt].rec[1]].apply(null);
break;
case "shot" :
if (stageRoot.container.roleMoveCtrl.crtRole != "role2") {
stageRoot.container.roleSay(this.crtRole, "I can not use this.");
return(undefined);
}
shotPlaceName = "shotPlace" + stageRoot.container[this.crtRole].crtHouse.substr(5, 2);
shotXDist = Math.abs(stageRoot.container[shotPlaceName]._x - stageRoot.container[this.crtRole]._x);
if (shotXDist >= 50) {
break;
}
stageRoot.container["event" + shotPlaceName].apply(null);
}
stageRoot.disabledSeleBtns();
};
stageRoot.stateRoleSele.dropPropBtn.onPress = function () {
stageRoot.dropTool(this._parent.toolSele);
};
stageRoot.stateRoleSele.goMenu.onPress = function () {
stageRoot.goMenuMc.gotoAndStop(2);
};
stageRoot.stateRoleSele.zmIn.onPress = function () {
this._parent._parent.container.globalView();
};
stageRoot.stateRoleSele.zmOt.onPress = function () {
this._parent._parent.container.localView();
};
toolIDCTpressInit();
Frame 14
var stageRoot = this;
stop();
function disabledSeleBtns() {
stageRoot.stateRoleSele.usePropBtn._visible = false;
stageRoot.stateRoleSele.dropPropBtn._visible = false;
}
function activateSeleBtns() {
stageRoot.stateRoleSele.usePropBtn._visible = true;
stageRoot.stateRoleSele.dropPropBtn._visible = true;
}
stageRoot.stateRoleSele.bg.onPress = function () {
trace("you click state bg");
};
stageRoot.stateRoleSele.bg.useHandCursor = false;
disabledSeleBtns();
function executeCallback() {
_global.secondCnt++;
if (_global.secondCnt == 60) {
_global.secondCnt = 1;
_global.minuteCnt++;
}
secondTxt = ((_global.secondCnt >= 10) ? (String(_global.secondCnt)) : ("0" + _global.secondCnt));
minuteTxt = ((_global.minuteCnt >= 10) ? (String(_global.minuteCnt)) : ("0" + _global.minuteCnt));
stageRoot.stateRoleSele.watch.text = (minuteTxt + ":") + secondTxt;
}
function startClock() {
intervalId = setInterval(this, "executeCallback", duration);
}
var intervalId;
var duration = 1000;
clearInterval(intervalId);
clearInterval(intervalId);
startClock();
function saveData() {
_global.gameDat = SharedObject.getLocal("gameDat", "/");
_global.gameDat.clear();
_global.gameDat.data.recFlag = "true";
_global.gameDat.data.chapter = "gameUnder";
stageRoot.saveRole();
stageRoot.saveHouse();
stageRoot.saveEnemy();
stageRoot.saveEvent();
stageRoot.saveAccess();
stageRoot.saveProp();
stageRoot.saveOther();
stageRoot.saveOption();
_global.gameDat.flush();
return(true);
}
function saveRole() {
function traceData() {
trace("\nroles' record block :");
i = 0;
while (i < 3) {
trace((("role rec" + (i + 1)) + ": ") + _global.gameDat.data["roleRec" + (i + 1)]);
trace((("role tools" + (i + 1)) + ": ") + _global.gameDat.data["roleRec" + (i + 1)][3]);
i++;
}
}
i = 0;
while (i < 3) {
roleName = "role" + (i + 1);
_global.gameDat.data["roleRec" + (i + 1)] = [datPath[roleName]._x, datPath[roleName]._y, datPath[roleName].crtHouse, datPath[roleName].toolsAry.concat()];
i++;
}
_global.gameDat.flush();
}
function saveHouse() {
function traceData() {
trace("\nhouseAry block");
i = 1;
while (i <= 4) {
trace((("houseAry5" + i) + " ") + _global.gameDat.data["houseAry5" + i]);
i++;
}
i = 1;
while (i <= 1) {
trace((("houseAry4" + i) + " ") + _global.gameDat.data["houseAry4" + i]);
i++;
}
i = 1;
while (i <= 1) {
trace((("houseAry3" + i) + " ") + _global.gameDat.data["houseAry3" + i]);
i++;
}
i = 1;
while (i <= 1) {
trace((("houseAry2" + i) + " ") + _global.gameDat.data["houseAry2" + i]);
i++;
}
i = 1;
while (i <= 2) {
trace((("houseAry1" + i) + " ") + _global.gameDat.data["houseAry1" + i]);
i++;
}
}
i = 1;
while (i <= 4) {
_global.gameDat.data["houseAry5" + i] = datPath["house5" + i].propAry.concat();
i++;
}
i = 1;
while (i <= 1) {
_global.gameDat.data["houseAry4" + i] = datPath["house4" + i].propAry.concat();
i++;
}
i = 1;
while (i <= 1) {
_global.gameDat.data["houseAry3" + i] = datPath["house3" + i].propAry.concat();
i++;
}
i = 1;
while (i <= 1) {
_global.gameDat.data["houseAry2" + i] = datPath["house2" + i].propAry.concat();
i++;
}
i = 1;
while (i <= 2) {
_global.gameDat.data["houseAry1" + i] = datPath["house1" + i].propAry.concat();
i++;
}
_global.gameDat.flush();
}
function saveEvent() {
function traceData() {
trace("\nevent data block");
trace("event woodUnderover " + _global.gameDat.data.woodUnderover);
trace("event boltover " + _global.gameDat.data.boltover);
trace("event aotuWallH3over " + _global.gameDat.data.autoWallH3over);
trace("event steelDoorUover " + _global.gameDat.data.steelDoorUover);
trace("event switch43over " + _global.gameDat.data.switch43over);
trace("event turnplateover " + _global.gameDat.data.turnplateover);
trace("event stonesover " + _global.gameDat.data.stonesover);
trace("event keyUover " + _global.gameDat.data.keyUover);
}
_global.gameDat.data.woodUnderover = datPath.woodUnderover;
_global.gameDat.data.boltover = datPath.boltover;
_global.gameDat.data.autoWallH3over = datPath.autoWallH3over;
_global.gameDat.data.steelDoorUover = datPath.steelDoorUover;
_global.gameDat.data.switch43over = datPath.switch43over;
_global.gameDat.data.turnplateover = datPath.turnplateover;
_global.gameDat.data.stonesover = datPath.stonesover;
_global.gameDat.data.keyUover = datPath.keyUover;
_global.gameDat.flush();
traceData();
}
function saveAccess() {
function traceData() {
trace("\naccess block");
trace("pipeH12able " + _global.gameDat.data.pipeH12able);
trace("pipeH2able " + _global.gameDat.data.pipeH2able);
trace("doorV35 " + _global.gameDat.data.doorV35able);
trace("doorV13 " + _global.gameDat.data.doorV13able);
}
_global.gameDat.data.pipeH12able = datPath.pipeH12.accessable;
_global.gameDat.data.pipeH2able = datPath.pipeH2.accessable;
_global.gameDat.data.doorV45able = datPath.doorV45.accessable;
_global.gameDat.data.doorV35able = datPath.doorV35.accessable;
_global.gameDat.data.doorV13able = datPath.doorV13.accessable;
_global.gameDat.data.doorV12able = datPath.doorV12.accessable;
_global.gameDat.data.doorH5_12able = datPath.doorH5_12.accessable;
_global.gameDat.data.doorH5_23able = datPath.doorH5_23.accessable;
_global.gameDat.data.doorH5_34able = datPath.doorH5_34.accessable;
_global.gameDat.data.doorH4_12able = datPath.doorH4_12.accessable;
_global.gameDat.data.doorH4_23able = datPath.doorH4_23.accessable;
_global.gameDat.data.doorH1_12able = datPath.doorH1_12.accessable;
_global.gameDat.flush();
traceData();
}
function saveProp() {
function traceData() {
trace("\n prop block");
trace("keyURec " + _global.gameDat.data.keyURec);
trace("keyU2Rec " + _global.gameDat.data.keyU2Rec);
trace("cuvetteRec " + _global.gameDat.data.cuvetteRec);
trace("axeRec " + _global.gameDat.data.axeRec);
trace("fBulletRec " + _global.gameDat.data.fBulletRec);
}
_global.gameDat.data.keyURec = [datPath.keyU._x, datPath.keyU._y, datPath.keyU._visible];
_global.gameDat.data.keyU2Rec = [datPath.keyU2._x, datPath.keyU2._y, datPath.keyU2._visible];
_global.gameDat.data.cuvetteRec = [datPath.cuvette._x, datPath.cuvette._y, datPath.cuvette._visible];
_global.gameDat.data.axeRec = [datPath.axe._x, datPath.axe._y, datPath.axe._visible];
_global.gameDat.data.fBulletRec = [datPath.fBullet._x, datPath.fBullet._y, datPath.fBullet._visible];
_global.gameDat.data.flush();
traceData();
}
function saveOther() {
traceData();
}
function saveOption() {
_global.gameDat.data.secondCnt = _global.secondCnt;
_global.gameDat.data.minuteCnt = _global.minuteCnt;
_global.gameDat.data.score = _global.score;
_global.gameDat.data.viewScale = stageRoot.container._xscale;
_global.gameDat.data.containerX = stageRoot.container._x;
_global.gameDat.data.containerY = stageRoot.container._y;
_global.gameDat.data.crtRole = stageRoot.container.roleMoveCtrl.crtRole;
_global.gameDat.flush();
}
function loadData() {
_global.gameDat = SharedObject.getLocal("gameDat", "/");
trace("readBtn recFlag " + _global.gameDat.data.recFlag);
stageRoot.container.zoomCtrl.crtTask = "none";
stageRoot.container.zoomCtrl.onEnterFrame = null;
stageRoot.roleData();
stageRoot.houseData();
stageRoot.eventData();
stageRoot.accessData();
stageRoot.propData();
stageRoot.optionData();
stageRoot.cover.unloadMovie();
}
function roleData() {
trace("role data");
i = 0;
while (i < 3) {
roleName = "role" + (i + 1);
datPath[roleName]._x = _global.gameDat.data["roleRec" + (i + 1)][0];
datPath[roleName]._y = _global.gameDat.data["roleRec" + (i + 1)][1];
datPath[roleName].crtHouse = _global.gameDat.data["roleRec" + (i + 1)][2];
datPath[roleName].toolsAry = _global.gameDat.data["roleRec" + (i + 1)][3].concat();
j = 0;
while (j < datPath[roleName].toolsAry.length) {
datPath[datPath[roleName].toolsAry[j]]._visible = false;
j++;
}
i++;
}
}
function houseData() {
i = 1;
while (i <= 4) {
datPath["house5" + i].propAry = _global.gameDat.data["houseAry5" + i].concat();
i++;
}
i = 1;
while (i <= 1) {
datPath["house4" + i].propAry = _global.gameDat.data["houseAry4" + i].concat();
i++;
}
i = 1;
while (i <= 1) {
datPath["house3" + i].propAry = _global.gameDat.data["houseAry3" + i].concat();
i++;
}
i = 1;
while (i <= 1) {
datPath["house2" + i].propAry = _global.gameDat.data["houseAry2" + i].concat();
i++;
}
i = 1;
while (i <= 2) {
datPath["house1" + i].propAry = _global.gameDat.data["houseAry1" + i].concat();
i++;
}
}
function eventData() {
trace("event Data");
datPath.woodUnderover = _global.gameDat.data.woodUnderover;
datPath.boltover = _global.gameDat.data.boltover;
datPath.autoWallH3over = _global.gameDat.data.autoWallH3over;
datPath.steelDoorUover = _global.gameDat.data.steelDoorUover;
datPath.switch43over = _global.gameDat.data.switch43over;
datPath.turnplateover = _global.gameDat.data.turnplateover;
datPath.stonesover = _global.gameDat.data.stonesover;
datPath.keyUover = _global.gameDat.data.keyUover;
if (_global.gameDat.data.woodUnderover) {
datPath.woodUnder.unloadMovie();
datPath.axe.unloadMovie();
datPath.heavy31.unloadMovie();
}
if (_global.gameDat.data.boltover) {
datPath.bolt.unloadMovie();
datPath.cuvette.unloadMovie();
}
trace("autoWallH3over " + _global.gameDat.data.autoWallH3over);
if (_global.gameDat.data.autoWallH3over) {
datPath.autoWallH3.gotoAndStop("end");
}
if (_global.gameDat.data.steelDoorUover) {
datPath.steelDoorU.gotoAndStop("end");
}
if (_global.gameDat.data.switch43over) {
datPath.autoWallH1.gotoAndStop("end");
}
if (_global.gameDat.data.turnplateover) {
datPath.steam.gotoAndStop(2);
}
if (_global.gameDat.data.stonesover) {
datPath.stones.unloadMovie();
datPath.clearStoneMV.unloadMovie();
}
if (_global.gameDat.data.keyUover) {
datPath.keyU.unloadMovie();
}
}
function accessData() {
trace("accessData");
datPath.pipeH12.accessable = _global.gameDat.data.pipeH12able;
datPath.pipeH2.accessable = _global.gameDat.data.pipeH2able;
datPath.doorV45.accessable = _global.gameDat.data.doorV45able;
datPath.doorV35.accessable = _global.gameDat.data.doorV35able;
datPath.doorV13.accessable = _global.gameDat.data.doorV13able;
datPath.doorV12.accessable = _global.gameDat.data.doorV12able;
datPath.doorH5_12.accessable = _global.gameDat.data.doorH5_12able;
datPath.doorH5_23.accessable = _global.gameDat.data.doorH5_23able;
datPath.doorH5_34.accessable = _global.gameDat.data.doorH5_34able;
datPath.doorH4_12.accessable = _global.gameDat.data.doorH4_12able;
datPath.doorH4_23.accessable = _global.gameDat.data.doorH4_23able;
datPath.doorH1_12.accessable = _global.gameDat.data.doorH1_12able;
}
function propData() {
trace("propData");
if (_global.gameDat.data.keyURec[0] != undefined) {
datPath.keyU._x = _global.gameDat.data.keyURec[0];
datPath.keyU._y = _global.gameDat.data.keyURec[1];
datPath.keyU._visible = _global.gameDat.data.keyURec[2];
}
if (_global.gameDat.data.keyU2Rec[0] != undefined) {
datPath.keyU2._x = _global.gameDat.data.keyU2Rec[0];
datPath.keyU2._y = _global.gameDat.data.keyU2Rec[1];
datPath.keyU2._visible = _global.gameDat.data.keyU2Rec[2];
}
if (_global.gameDat.data.cuvetteRec[0] != undefined) {
datPath.cuvette._x = _global.gameDat.data.cuvetteRec[0];
datPath.cuvette._y = _global.gameDat.data.cuvetteRec[1];
datPath.cuvette._visible = _global.gameDat.data.cuvetteRec[2];
}
if (_global.gameDat.data.axeRec[0] != undefined) {
datPath.axe._x = _global.gameDat.data.axeRec[0];
datPath.axe._y = _global.gameDat.data.axeRec[1];
datPath.axe._visible = _global.gameDat.data.axeRec[2];
}
if (_global.gameDat.data.fBulletRec[0] != undefined) {
datPath.fBullet._x = _global.gameDat.data.fBulletRec[0];
datPath.fBullet._y = _global.gameDat.data.fBulletRec[1];
datPath.fBullet._visible = _global.gameDat.data.fBulletRec[2];
}
}
function otherData() {
}
function optionData() {
trace((("second and minute cnt of so:" + _global.gameDat.data.secondCnt) + " ") + _global.gameDat.data.minuteCnt);
_global.secondCnt = (ctnrRoor.count = _global.gameDat.data.secondCnt);
_global.minuteCnt = _global.gameDat.data.minuteCnt;
_global.score = _global.gameDat.data.score;
svPath.scoreTxt.text = _global.score;
datPath._xscale = (stageRoot.container._yscale = _global.gameDat.data.viewScale);
datPath._x = _global.gameDat.data.containerX;
datPath._y = _global.gameDat.data.containerY;
datPath.roleMoveCtrl.crtRole = (datPath.crtRole = _global.gameDat.data.crtRole);
svPath.gotoAndStop(_global.gameDat.data.crtRole);
datPath.toolsBoxRefresh(_global.gameDat.data.crtRole);
datPath.activatePropOEF(datPath[_global.gameDat.data.crtRole].crtHouse);
trace(_global.gameDat.data.crtRole);
}
var svPath = stageRoot.stateRoleSele;
var datPath = stageRoot.container;
svPath.saveBtn.onPress = function () {
_global.gameRoot.saveMc.gotoAndStop(2);
_global.gameRoot.container.roleMoveCtrl.ctrlAble = false;
};
svPath.clearBtn.onPress = function () {
_global.gameDat.clear();
trace(" recFlag " + _global.gameDat.data.recFlag);
};
svPath.readBtn.onPress = loadData;
function toolIDCTpress() {
this._parent.toolSele = this.crtDispTool;
stageRoot.activateSeleBtns();
i = 0;
while (i <= 4) {
stageRoot.stateRoleSele["toolIDCT" + i].light._visible = false;
i++;
}
this.light._visible = true;
}
function toolIDCTpressInit() {
i = 0;
while (i <= 4) {
stageRoot.stateRoleSele["toolIDCT" + i].onPress = stageRoot.toolIDCTpress;
stageRoot.stateRoleSele["toolIDCT" + i].light._visible = false;
i++;
}
stageRoot.stateRoleSele.qltPanel._visible = false;
stageRoot.stateRoleSele.qltPanelSwitch.onPress = function () {
if (this._parent.qltPanel._visible == true) {
this._parent.qltPanel._visible = false;
} else {
this._parent.qltPanel._visible = true;
this._parent.qltPanel.QLOW._alpha = 30;
this._parent.qltPanel.QMEDIUM._alpha = 30;
this._parent.qltPanel.QHIGH._alpha = 30;
this._parent.qltPanel.QBEST._alpha = 30;
this._parent.qltPanel["Q" + _global.visualQlt]._alpha = 100;
}
};
stageRoot.stateRoleSele.soundStop._visible = (stageRoot.stateRoleSele.musicStop._visible = false);
stageRoot.stateRoleSele.stopSoundBtn.onPress = function () {
if (stageRoot.stateRoleSele.soundStop._visible == false) {
stageRoot.stateRoleSele.soundStop._visible = true;
_global.gameRoot.sndCtrl.stopSound();
} else {
stageRoot.stateRoleSele.soundStop._visible = false;
_global.gameRoot.sndCtrl.returnSound();
}
};
stageRoot.stateRoleSele.stopMusicBtn.onPress = function () {
if (stageRoot.stateRoleSele.musicStop._visible == false) {
stageRoot.stateRoleSele.musicStop._visible = true;
_global.gameRoot.sndCtrl.stopMusic();
} else {
stageRoot.stateRoleSele.musicStop._visible = false;
_global.gameRoot.sndCtrl.returnMusic();
}
};
}
function dropTool(dropName) {
crtRole = stageRoot.container.crtRole;
crtHouse = stageRoot.container[crtRole].crtHouse;
housePropAry = stageRoot.container[crtHouse].propAry;
housePropAry.push(stageRoot.stateRoleSele.toolSele);
stageRoot.container[stageRoot.stateRoleSele.toolSele]._x = stageRoot.container[crtRole]._x;
stageRoot.container[stageRoot.stateRoleSele.toolSele]._y = stageRoot.container[crtRole]._y - 50;
stageRoot.container[stageRoot.stateRoleSele.toolSele]._visible = true;
stageRoot.container[stageRoot.stateRoleSele.toolSele].onEnterFrame = stageRoot.container[stageRoot.stateRoleSele.toolSele].orgnEnterFrame;
i = 0;
while (i < stageRoot.container[crtRole].toolsAry.length) {
if (stageRoot.container[crtRole].toolsAry[i] == stageRoot.stateRoleSele.toolSele) {
stageRoot.container[crtRole].toolsAry.splice(i, 1);
}
i++;
}
stageRoot.container.toolsBoxRefresh(crtRole);
stageRoot.disabledSeleBtns();
}
stageRoot.stateRoleSele.usePropBtn.onPress = function () {
this.crtRole = stageRoot.container.roleMoveCtrl.crtRole;
this.propRlt = stageRoot.container[this._parent.toolSele].rec[0];
this.propFuncType = stageRoot.container[this._parent.toolSele].rec[3];
xDist = Math.abs(stageRoot.container[this.propRlt]._x - stageRoot.container[this.crtRole]._x);
yDist = Math.abs(stageRoot.container[this.propRlt]._y - stageRoot.container[this.crtRole]._y);
if ((xDist > 150) || (yDist > 200)) {
stageRoot.disabledSeleBtns();
stageRoot.container.roleSay(this.crtRole, "I cannot use this here!");
return(undefined);
}
this.propFuncCtt = stageRoot.container[this.propRlt].func[1];
switch (this.propFuncType) {
case "unlock" :
stageRoot.container[this.propFuncCtt].accessable = true;
useKeyName = "useKey" + stageRoot.container[this.crtRole].crtHouse.substr(5, 2);
stageRoot.container[useKeyName].gotoAndPlay(2);
stageRoot.container[useKeyName].role.gotoAndStop(this.crtRole);
stageRoot.container[useKeyName].role.roleCtt.gotoAndPlay(2);
stageRoot.container.roleMoveCtrl.ctrlAble = false;
stageRoot.container[this.crtRole]._visible = false;
if (stageRoot.container[this.propRlt].func[3] != "none") {
stageRoot.container[stageRoot.container[this.propRlt].func[3]].onEnterFrame = stageRoot.container[stageRoot.container[this.propRlt].func[3]].orgnEnterFrame;
}
if (stageRoot.container[this.propRlt].func[2] == "disapear") {
stageRoot.container[this.propRlt].unloadMovie();
}
break;
case "clip" :
stageRoot.container[stageRoot.container[this._parent.toolSele].func[1]].apply(null);
break;
case "generate" :
stageRoot.container[stageRoot.container[this.propRlt].rec[1]].apply(null);
break;
case "shot" :
if (stageRoot.container.roleMoveCtrl.crtRole != "role2") {
stageRoot.container.roleSay(this.crtRole, "I can not use this.");
return(undefined);
}
shotPlaceName = "shotPlace" + stageRoot.container[this.crtRole].crtHouse.substr(5, 2);
shotXDist = Math.abs(stageRoot.container[shotPlaceName]._x - stageRoot.container[this.crtRole]._x);
if (shotXDist >= 50) {
break;
}
stageRoot.container["event" + shotPlaceName].apply(null);
}
stageRoot.disabledSeleBtns();
};
stageRoot.stateRoleSele.dropPropBtn.onPress = function () {
stageRoot.dropTool(this._parent.toolSele);
};
stageRoot.stateRoleSele.goMenu.onPress = function () {
stageRoot.goMenuMc.gotoAndStop(2);
};
stageRoot.stateRoleSele.zmIn.onPress = function () {
this._parent._parent.container.globalView();
};
stageRoot.stateRoleSele.zmOt.onPress = function () {
this._parent._parent.container.localView();
};
toolIDCTpressInit();
Frame 285
gotoAndStop ("gameUnder");
Frame 845
stop();
_global.score = ((_global.score + 3600) - (_global.minuteCnt * 60)) - _global.secondCnt;
totalScore.text = _global.score;
Instance of Symbol 56 MovieClip in Frame 845
//component parameters
onClipEvent (construct) {
_game_name = "mental";
score_var = "_global.score";
}
Frame 848
startBtn.onPress = function () {
gotoAndStop ("firstPage");
};
_global.gameRoot.sndCtrl.playSound("fallDownSnd");
Frame 922
_global.gameRoot.sndCtrl.playSound("doorSnd");
Frame 946
scoreMc.totalScore.text = _global.score;
Instance of Symbol 56 MovieClip in Frame 946
//component parameters
onClipEvent (construct) {
_game_name = "mental";
score_var = "_global.score";
}
Frame 956
_global.gameRoot.sndCtrl.playSound("seleRoleSnd");
Instance of Symbol 1246 MovieClip in Frame 958
//component parameters
onClipEvent (construct) {
_game_name = "mental";
score_var = "_global.score";
}
Frame 997
stop();
Frame 998
stop();
Symbol 4 MovieClip Frame 1
onPress = function () {
FWGURL();
};
this.cacheAsBitmap = true;
Symbol 7 MovieClip Frame 1
function Replace() {
if (sVariable.length == 0) {
tTxt.text = sTxt;
} else {
tTxt.variable = sVariable;
}
tTxt.autoSize = autoSize;
if (autoSize == "right") {
tTxt._x = -Math.floor(tTxt._width);
} else if (autoSize == "center") {
tTxt._x = -Math.floor(tTxt._width / 2);
} else {
tTxt._x = 0;
}
}
var sTxt;
var bBmp;
var bMultiline;
var autoSize;
var sVariable;
Replace();
this.cacheAsBitmap = bBmp;
Symbol 8 MovieClip Frame 1
_x = (Stage.width / 2);
_y = ((Stage.height / 2) - 30);
Symbol 8 MovieClip Frame 25
stop();
var rate;
var all = _root.getBytesTotal();
onEnterFrame = function () {
var _local3 = _root.getBytesLoaded();
rate = int((_local3 / all) * 100) + "%";
mLoading._alpha = Math.round(SFM.linearCycle(getTimer(), 1000, 100));
if (_local3 == all) {
delete this.onEnterFrame;
if ((_root._mochiad instanceof MovieClip) != true) {
_root.play();
}
}
};
Instance of Symbol 7 MovieClip in Symbol 8 MovieClip Frame 25
//component parameters
onClipEvent (construct) {
sTxt = "TXT";
sVariable = "_parent.rate";
autoSize = "center";
bBmp = false;
}
Instance of Symbol 7 MovieClip "mLoading" in Symbol 8 MovieClip Frame 25
//component parameters
onClipEvent (construct) {
sTxt = "Loading...";
sVariable = "";
autoSize = "center";
bBmp = false;
}
Symbol 1251 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.0");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 1252 MovieClip [__Packages.SoundManage] Frame 0
class SoundManage
{
var isMusicPlay, isSoundPlay;
function SoundManage () {
_root.createEmptyMovieClip("mysound_mc", _root.getNextHighestDepth());
_root.createEmptyMovieClip("mymusic_mc", _root.getNextHighestDepth());
soundArray[0] = new Array();
soundArray[1] = new Array();
soundArray[2] = new Array();
musicArray[0] = new Array();
musicArray[1] = new Array();
musicArray[2] = new Array();
addMusic("main_s");
if (isMusicPlay == undefined) {
isMusicPlay = true;
playMusic("main_s", 9999);
}
if (isSoundPlay == undefined) {
isSoundPlay = true;
}
}
function addSound() {
switch (arguments.length) {
case 1 :
soundArray[0].push(arguments[0]);
_root.mysound_mc.createEmptyMovieClip(arguments[0] + "_sound", _root.mysound_mc.getNextHighestDepth());
var _local4 = new Sound(_root.mysound_mc[arguments[0] + "_sound"]);
_local4.attachSound(arguments[0]);
soundArray[1].push(_local4);
soundArray[2].push(100);
break;
case 2 :
if (arguments[1] > 100) {
arguments[1] = 100;
} else if (arguments[1] < 0) {
arguments[1] = 0;
}
soundArray[0].push(arguments[0]);
_root.mysound_mc.createEmptyMovieClip(arguments[0] + "_sound", _root.mysound_mc.getNextHighestDepth());
_local4 = new Sound(_root.mysound_mc[arguments[0] + "_sound"]);
_local4.attachSound(arguments[0]);
_local4.setVolume(arguments[1]);
soundArray[1].push(_local4);
soundArray[2].push(arguments[1]);
}
}
function addMusic() {
switch (arguments.length) {
case 1 :
musicArray[0].push(arguments[0]);
_root.mymusic_mc.createEmptyMovieClip(arguments[0] + "_sound", _root.mymusic_mc.getNextHighestDepth());
var _local4 = new Sound(_root.mymusic_mc[arguments[0] + "_sound"]);
_local4.attachSound(arguments[0]);
musicArray[1].push(_local4);
musicArray[2].push(100);
break;
case 2 :
if (arguments[1] > 100) {
arguments[1] = 100;
} else if (arguments[1] < 0) {
arguments[1] = 0;
}
musicArray[0].push(arguments[0]);
_root.mymusic_mc.createEmptyMovieClip(arguments[0] + "_sound", _root.mymusic_mc.getNextHighestDepth());
_local4 = new Sound(_root.mymusic_mc[arguments[0] + "_sound"]);
_local4.attachSound(arguments[0]);
_local4.setVolume(arguments[1]);
musicArray[1].push(_local4);
musicArray[2].push(arguments[1]);
}
}
function stopSound() {
isSoundPlay = false;
var _local2 = 0;
while (_local2 <= soundArray[1].length) {
soundArray[1][_local2].setVolume(0);
_local2++;
}
}
function stopMusic() {
isMusicPlay = false;
var _local2 = 0;
while (_local2 <= musicArray[1].length) {
musicArray[1][_local2].setVolume(0);
_local2++;
}
}
function returnSound() {
isSoundPlay = true;
var _local2 = 0;
while (_local2 < soundArray[1].length) {
soundArray[1][_local2].setVolume(soundArray[2][_local2]);
_local2++;
}
}
function returnMusic() {
isMusicPlay = true;
var _local2 = 0;
while (_local2 < musicArray[1].length) {
musicArray[1][_local2].setVolume(musicArray[2][_local2]);
_local2++;
}
}
function setSoundVol() {
switch (arguments.length) {
case 1 :
if (arguments[0] > 100) {
arguments[0] = 100;
} else if (arguments[0] < 0) {
arguments[0] = 0;
}
var _local3 = 0;
while (_local3 < soundArray[1].length) {
soundArray[2][_local3] = arguments[0];
soundArray[1][_local3].setVolume(arguments[0]);
_local3++;
}
break;
case 2 :
if (arguments[1] > 100) {
arguments[1] = 100;
} else if (arguments[1] < 0) {
arguments[1] = 0;
}
_local3 = 0;
for(;;){
if (_local3 >= soundArray[0].length) {
break;
}
if (soundArray[0][_local3] == arguments[0]) {
soundArray[2][_local3] = arguments[1];
soundArray[1][_local3].setVolume(arguments[1]);
break;
}
_local3++;
};
}
}
function setMusicVol() {
switch (arguments.length) {
case 1 :
if (arguments[0] > 100) {
arguments[0] = 100;
} else if (arguments[0] < 0) {
arguments[0] = 0;
}
var _local3 = 0;
while (_local3 < musicArray[1].length) {
musicArray[2][_local3] = arguments[0];
musicArray[1][_local3].setVolume(arguments[0]);
_local3++;
}
break;
case 2 :
if (arguments[1] > 100) {
arguments[1] = 100;
} else if (arguments[1] < 0) {
arguments[1] = 0;
}
_local3 = 0;
for(;;){
if (_local3 >= musicArray[0].length) {
break;
}
if (musicArray[0][_local3] == arguments[0]) {
musicArray[2][_local3] = arguments[1];
musicArray[1][_local3].setVolume(arguments[1]);
break;
}
_local3++;
};
}
}
function playSound() {
if (isSoundPlay == true) {
switch (arguments.length) {
case 1 :
var _local3 = 0;
while (_local3 <= soundArray[0].length) {
if (soundArray[0][_local3] == arguments[0]) {
soundArray[1][_local3].start(0, 1);
break;
}
_local3++;
}
break;
case 2 :
_local3 = 0;
while (_local3 <= soundArray[0].length) {
if (soundArray[0][_local3] == arguments[0]) {
soundArray[1][_local3].start(0, arguments[1]);
break;
}
_local3++;
}
break;
case 3 :
_local3 = 0;
for(;;){
if (_local3 > soundArray[0].length) {
break;
}
if (soundArray[0][_local3] == arguments[0]) {
soundArray[1][_local3].setVolume(arguments[2]);
soundArray[1][_local3].start(0, arguments[1]);
soundArray[1][_local3].setVolume(soundArray[2][_local3]);
break;
}
_local3++;
};
}
}
}
function playMusic() {
if (isMusicPlay == true) {
switch (arguments.length) {
case 1 :
var _local3 = 0;
while (_local3 <= musicArray[0].length) {
if (musicArray[0][_local3] == arguments[0]) {
musicArray[1][_local3].start(0, 1);
break;
}
_local3++;
}
break;
case 2 :
_local3 = 0;
while (_local3 <= musicArray[0].length) {
if (musicArray[0][_local3] == arguments[0]) {
musicArray[1][_local3].start(0, arguments[1]);
break;
}
_local3++;
}
break;
case 3 :
_local3 = 0;
for(;;){
if (_local3 > musicArray[0].length) {
break;
}
if (musicArray[0][_local3] == arguments[0]) {
musicArray[1][_local3].setVolume(arguments[2]);
musicArray[1][_local3].start(0, arguments[1]);
musicArray[1][_local3].setVolume(musicArray[2][_local3]);
break;
}
_local3++;
};
}
}
}
function isTrueStopSound() {
switch (arguments.length) {
case 0 :
var _local3 = 0;
while (_local3 <= soundArray[1].length) {
soundArray[1][_local3].stop();
_local3++;
}
break;
case 1 :
_local3 = 0;
for(;;){
if (_local3 > soundArray[1].length) {
break;
}
if (soundArray[0][_local3] == arguments[0]) {
soundArray[1][_local3].stop();
}
_local3++;
};
}
}
function isTrueStopMusic() {
switch (arguments.length) {
case 0 :
var _local3 = 0;
while (_local3 <= musicArray[1].length) {
musicArray[1][_local3].stop();
_local3++;
}
break;
case 1 :
_local3 = 0;
for(;;){
if (_local3 > musicArray[1].length) {
break;
}
if (musicArray[0][_local3] == arguments[0]) {
musicArray[1][_local3].stop();
}
_local3++;
};
}
}
function clearSoundAndMusic() {
for (var _local3 in _root.mymusic_mc) {
removeMovieClip(_root.mymusic_mc[_local3]);
}
for (var _local3 in _root.mysound_mc) {
removeMovieClip(_root.mysound_mc[_local3]);
}
removeMovieClip(_root.mysound_mc);
removeMovieClip(_root.mymusic_mc);
soundArray = null;
musicArray = null;
delete soundArray;
delete musicArray;
}
var soundArray = new Array();
var musicArray = new Array();
}
Symbol 32 MovieClip Frame 1
_x = (Stage.width / 2);
_y = (Stage.height / 2);
_root.stop();
onPress = function () {
getURL ("http://www.freeworldgroup.com/", "_blank");
};
Symbol 32 MovieClip Frame 146
_root.gotoAndStop("firstPage");
Symbol 39 Button
on (release) {
gotoAndStop ("submit");
}
Symbol 54 Button
on (release) {
viewHighscore();
}
Symbol 56 MovieClip Frame 1
stop();
_global.game_name = _game_name;
var highscore = eval (score_var);
_global.viewHighscore = function () {
getURL ("http://www.freeworldgroup.com/score/index.asp?game=" + game_name, "_blank");
};
if (highscore <= 0) {
this._visible = false;
}
trace(game_name);
trace(highscore);
trace("http://www.freeworldgroup.com/score/index.asp?game=" + game_name);
Symbol 56 MovieClip Frame 3
function sendData() {
send_var.game = game_name;
send_var.score = highscore;
send_var.name = name_txt.text;
if (send_var.name == "") {
send_var.name = "guest" + int(Math.random() * 1000);
}
send_var.sendAndLoad("http://www.freeworldgroup.com/score/score.asp", load_var, "POST");
gotoAndStop ("sending");
}
stop();
gold_txt.text = highscore;
send_var = new LoadVars();
load_var = new LoadVars();
ok_btn.onRelease = sendData;
load_var.onLoad = function () {
gotoAndStop ("done");
};
Instance of Symbol 50 MovieClip "closeBtn" in Symbol 56 MovieClip Frame 3
on (press) {
trace("should gotoAndStop frame 1");
this._parent.gotoAndStop("over");
}
Symbol 75 MovieClip Frame 1
stop();
Symbol 91 Button
on (release) {
viewHighscore();
}
Symbol 96 Button
on (release) {
getURL ("http://www.ifungames.com", "_blank");
}
Symbol 101 Button
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 106 Button
on (release) {
getURL ("http://www.freeworldgroup.com/koalafiles.htm", "_blank");
}
Instance of Symbol 2 MovieClip in Symbol 110 MovieClip Frame 1
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 113 Button
on (release) {
getURL ("http://www.freeworldgroup.com/", _blank);
}
Symbol 118 Button
on (release) {
gotoAndStop ("credits");
}
Symbol 125 Button
on (press) {
_root.getURL("http://www.freeworldgroup.com/games6/gameindex/mental-showtime.htm", "_blank");
}
Symbol 130 Button
on (press) {
_root.getURL("http://www.freeworldgroup.com/games6/gameindex/the-journey.htm", "_blank");
}
Symbol 134 Button
on (press) {
_root.getURL("http://www.freeworldgroup.com/games6/gameindex/in-the-woods.htm", "_blank");
}
Symbol 197 Button
on (press) {
nextFrame();
}
Symbol 206 Button
on (press) {
_global.gameRoot.gotoAndStop("startGame");
}
Symbol 211 Button
on (press) {
prevFrame();
}
Symbol 241 MovieClip Frame 1
goMenuBtn.onPress = function () {
_global.gameRoot.gotoAndStop("firstPage");
};
stop();
Symbol 241 MovieClip Frame 3
okBtn.onPress = function () {
_global.gameRoot.gotoAndStop("startGame");
stageRestart();
};
Symbol 268 MovieClip Frame 2
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 269 MovieClip Frame 1
stop();
sDoor.stop();
Symbol 269 MovieClip Frame 2
mDoor.gotoAndPlay(2);
Symbol 269 MovieClip Frame 23
mDoor.gotoAndPlay(2);
Symbol 291 MovieClip Frame 18
stop();
Symbol 294 MovieClip Frame 1
stop();
Symbol 294 MovieClip Frame 2
door2.gotoAndPlay(2);
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 294 MovieClip Frame 42
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 294 MovieClip Frame 54
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 294 MovieClip Frame 93
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 301 MovieClip Frame 2
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 302 MovieClip Frame 1
stop();
sDoor.stop();
Symbol 302 MovieClip Frame 2
mDoor.gotoAndPlay(2);
Symbol 302 MovieClip Frame 23
mDoor.gotoAndPlay(2);
Symbol 315 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 2
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 315 MovieClip Frame 23
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 364 MovieClip Frame 1
stop();
Symbol 364 MovieClip Frame 35
stop();
Symbol 398 MovieClip Frame 93
stop();
Symbol 399 MovieClip Frame 1
stop();
Symbol 399 MovieClip Frame 94
this._parent.localView();
Symbol 413 MovieClip Frame 1
stop();
Symbol 423 MovieClip Frame 1
Symbol 424 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 1
stop();
eleMc._visible = false;
Symbol 436 MovieClip Frame 1
stop();
Symbol 436 MovieClip Frame 2
stop();
Symbol 440 MovieClip Frame 1
stop();
Symbol 440 MovieClip Frame 20
stop();
Symbol 451 MovieClip Frame 1
stop();
Symbol 455 MovieClip Frame 1
stop();
Symbol 457 MovieClip Frame 1
stop();
eleMc._visible = false;
Symbol 485 MovieClip Frame 2
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 485 MovieClip Frame 39
stop();
Symbol 486 MovieClip Frame 1
stop();
Symbol 511 MovieClip Frame 31
stop();
Symbol 515 MovieClip Frame 1
stop();
Symbol 515 MovieClip Frame 48
_global.gameRoot.sndCtrl.playSound("fallDownSnd");
_global.gameRoot.sndCtrl.playSound("shoutSnd");
Symbol 515 MovieClip Frame 54
this._parent.enemy21.unloadMovie();
this._parent.enemy21over = true;
Symbol 515 MovieClip Frame 79
stop();
this._parent.role3._visible = true;
this._parent.roleMoveCtrl.ctrlAble = true;
this._parent.localView();
Symbol 516 MovieClip Frame 1
stop();
Symbol 516 MovieClip Frame 101
stop();
this._parent.house52.propAry.push("number2");
this._parent.number2.onEnterFrame = this._parent.number2.orgnEnterFrame;
this._parent.number2._visible = true;
this._parent.localView();
this._parent.roleMoveCtrl.ctrlAble = true;
Symbol 561 MovieClip Frame 1
_global.gameRoot.sndCtrl.playSound("punchSnd");
Symbol 561 MovieClip Frame 10
_global.gameRoot.sndCtrl.playSound("punchSnd");
Symbol 561 MovieClip Frame 21
_global.gameRoot.sndCtrl.playSound("punchSnd");
Symbol 562 MovieClip Frame 1
stop();
Symbol 562 MovieClip Frame 3
_global.gameRoot.sndCtrl.playSound("dogBark");
Symbol 562 MovieClip Frame 27
_global.gameRoot.container.deadCtrl.onEnterFrame = _global.gameRoot.container.deadCtrl.orgnEnterFrame;
_global.gameRoot.container.role1._visible = false;
_global.gameRoot.sndCtrl.playSound("dogBark");
Symbol 566 MovieClip Frame 1
stop();
Symbol 572 MovieClip Frame 1
stop();
Symbol 572 MovieClip Frame 2
_global.gameRoot.sndCtrl.playSound("teleConSnd");
Symbol 572 MovieClip Frame 37
_global.gameRoot.sndCtrl.playSound("teleConSnd");
Symbol 572 MovieClip Frame 78
_global.gameRoot.sndCtrl.playSound("teleCallSnd");
Symbol 572 MovieClip Frame 102
_global.gameRoot.sndCtrl.playSound("teleCallSnd");
Symbol 572 MovieClip Frame 127
_global.gameRoot.sndCtrl.playSound("teleCallSnd");
Symbol 572 MovieClip Frame 151
_global.gameRoot.sndCtrl.playSound("teleCallSnd");
Symbol 572 MovieClip Frame 174
_global.gameRoot.sndCtrl.playSound("teleCallSnd");
Symbol 572 MovieClip Frame 183
trace(this._parent.enemy32.crtTask);
if (this._parent.enemy32.crtTask != "fight") {
this._parent.enemy32.crtTask = "changeRoom";
this._parent.enemy32.onEnterFrame = this._parent.enemy32.orgnEnterFrame;
this._parent.roleMoveCtrl.ctrlAble = true;
}
Symbol 576 MovieClip Frame 33
_global.gameRoot.sndCtrl.playSound("crashSnd");
Symbol 577 MovieClip Frame 1
stop();
Symbol 577 MovieClip Frame 47
this._parent.role3._visible = true;
this._parent.roleMoveCtrl.ctrlAble = true;
this._parent.trg53_2.onEnterFrame = this._parent.trg53_2.orgnEnterFrame;
this._parent.pipe3.accessable = true;
stop();
Symbol 619 MovieClip Frame 1
stop();
Symbol 619 MovieClip Frame 46
this._parent.trg62_2.onEnterFrame = this._parent.trg62_2.orgnEnterFrame;
this._parent.pipe5._visible = true;
this._parent.roleMoveCtrl.ctrlAble = true;
this._parent.role1._visible = true;
this._parent.house62.propAry.push("trg62_2");
Symbol 645 MovieClip Frame 50
stop();
Symbol 650 MovieClip Frame 1
stop();
Symbol 650 MovieClip Frame 44
_global.gameRoot.sndCtrl.playSound("hitSnd");
Symbol 650 MovieClip Frame 58
_global.gameRoot.sndCtrl.playSound("hitSnd");
Symbol 650 MovieClip Frame 75
this._parent.dog.gotoAndStop("dead");
this._parent.ladder.accessable = true;
this._parent.roleMoveCtrl.ctrlAble = true;
this._parent.role2._visible = true;
this._parent.dog._visible = true;
_global.gameRoot.sndCtrl.playSound("fallDownSnd");
this._parent.camaraMoveCtrl.onEnterFrame = this._parent.camaraMoveCtrl.orgnEnterFrame;
this._parent.camaraMoveCtrl.moveKind = "role";
Symbol 651 MovieClip Frame 1
stop();
Symbol 651 MovieClip Frame 47
_global.gameRoot.sndCtrl.playSound("hitSnd");
Symbol 651 MovieClip Frame 55
this._parent.house23.propAry = ["trg23_1", "trg23_2", "card"];
this._parent.steelDoor.onEnterFrame = null;
this._parent.steelDoor.gotoAndStop(2);
this._parent.roleMoveCtrl.ctrlAble = true;
this._parent.role2._visible = true;
Symbol 652 MovieClip Frame 1
stop();
Symbol 652 MovieClip Frame 58
_global.gameRoot.sndCtrl.playSound("hitSnd");
Symbol 652 MovieClip Frame 66
this._parent.eleWater11.gotoAndStop(2);
this._parent.wire11.gotoAndStop(2);
if (this._parent.power.isOpen == true) {
this._parent.eleWater11.eleMc._visible = true;
this._parent.wire11.eleMc._visible = true;
this._parent.enemy11.unloadMovie();
this._parent.enemy11Dead._visible = true;
this._parent.enemy11Dead.gotoAndPlay(2);
this._parent.enemy11over = true;
this._parent.globalView();
_global.score = _global.score + 300;
this._parent._parent.stateRoleSele.scoreTxt.text = _global.score;
}
this._parent.roleMoveCtrl.ctrlAble = true;
this._parent.role2._visible = true;
Symbol 661 MovieClip Frame 1
stop();
Symbol 661 MovieClip Frame 24
_global.gameRoot.sndCtrl.playSound("crashSnd");
Symbol 661 MovieClip Frame 38
this._parent.trg51_3.onEnterFrame = this._parent.trg51_3.orgnEnterFrame;
this._parent.doorH5_12.accessable = true;
this._parent.roleMoveCtrl.ctrlAble = true;
this._parent.role3._visible = true;
this._parent.house51.propAry.push("trg51_3");
Symbol 663 MovieClip Frame 1
stop();
Symbol 663 MovieClip Frame 2
_global.gameRoot.sndCtrl.playSound("fallDownSnd");
_global.gameRoot.sndCtrl.playSound("shoutSnd");
Symbol 663 MovieClip Frame 33
this._parent.localView();
Symbol 682 MovieClip Frame 1
stop();
Symbol 683 MovieClip Frame 1
stop();
Symbol 683 MovieClip Frame 44
this._parent[this._parent.roleMoveCtrl.crtRole]._visible = true;
this._parent.roleMoveCtrl.ctrlAble = true;
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 688 MovieClip Frame 1
stop();
Symbol 690 MovieClip Frame 1
stop();
Symbol 694 MovieClip Frame 1
stop();
Symbol 697 MovieClip Frame 1
stop();
Symbol 702 MovieClip Frame 44
this.txtCtt._visible = false;
Symbol 710 MovieClip Frame 1
stop();
Symbol 731 MovieClip Frame 1
stop();
Symbol 748 MovieClip Frame 1
stop();
Symbol 750 MovieClip Frame 1
stop();
Symbol 751 MovieClip Frame 7
_global.gameRoot.sndCtrl.playSound("walkSnd");
Symbol 751 MovieClip Frame 19
_global.gameRoot.sndCtrl.playSound("walkSnd");
Symbol 756 MovieClip Frame 1
_global.gameRoot.sndCtrl.playSound("slapSnd");
Symbol 756 MovieClip Frame 9
_global.gameRoot.sndCtrl.playSound("punchSnd");
Symbol 756 MovieClip Frame 18
_global.gameRoot.sndCtrl.playSound("fallDownSnd");
Symbol 757 MovieClip Frame 1
stop();
Symbol 759 MovieClip Frame 1
stop();
Symbol 759 MovieClip Frame 35
stop();
Symbol 780 MovieClip Frame 1
stop();
okBtn.onPress = function () {
this._parent.nextFrame();
};
back.onPress = function () {
};
back.useHandCursor = false;
Symbol 780 MovieClip Frame 4
firstStartBtn.onPress = function () {
_global.gameRoot.container.roleMoveCtrl.ctrlAble = true;
_global.gameRoot.container.firstIns.unloadMovie();
_global.gameRoot.startClock();
};
Symbol 781 MovieClip Frame 1
var ctnrRoot = this;
shouldScale = 20;
shouldTimeCnt = 20;
winEnd = "gameChapter1Win";
winRoom = "house14";
powerLight._visible = false;
function setRolesStop() {
i = 1;
while (i <= 3) {
if (ctnrRoot["role" + i].isClimb == false) {
ctnrRoot["role" + i].gotoAndStop("stop");
}
i++;
}
}
function rolePress() {
if (ctnrRoot.crtRole != undefined) {
ctnrRoot.disabledPropOEF(ctnrRoot[crtRole].crtHouse);
ctnrRoot.setRolesStop();
}
ctnrRoot.roleMoveCtrl.crtRole = this._name;
ctnrRoot._parent.stateRoleSele.gotoAndStop(this._name);
ctnrRoot.toolsBoxRefresh(this._name);
ctnrRoot.activatePropOEF(this.crtHouse);
_global.gameRoot.sndCtrl.playSound("seleRoleSnd");
if ((ctnrRoot.crtRole != this._name) && (ctnrRoot._xscale == 100)) {
ctnrRoot.camaraMoveCtrl.onEnterFrame = ctnrRoot.camaraMoveCtrl.orgnEnterFrame;
ctnrRoot.camaraMoveCtrl.moveKind = "role";
}
if (ctnrRoot.isSortRoom()) {
ctnrRoot.roleMoveCtrl.isSortFlag = true;
ctnrRoot.roleDepthSort();
}
if (ctnrRoot._xscale != 100) {
ctnrRoot.localView();
}
}
function roleSay(parRole, ctt) {
ctnrRoot[parRole].roleSay.txtCtt.txt.text = ctt;
ctnrRoot[parRole].roleSay.gotoAndPlay(1);
ctnrRoot[parRole].roleSay.txtCtt._visible = true;
if (ctnrRoot._xscale == 100) {
ctnrRoot[parRole].roleSay._xscale = (ctnrRoot[parRole].roleSay._yscale = 100);
} else {
ctnrRoot[parRole].roleSay._xscale = (ctnrRoot[parRole].roleSay._yscale = 250);
}
}
function clearToolIDCT() {
i = 0;
while (i <= 4) {
ctnrRoot._parent.stateRoleSele["toolIDCT" + i].gotoAndStop("none");
ctnrRoot._parent.stateRoleSele["toolIDCT" + i].crtDispTool = "none";
ctnrRoot._parent.stateRoleSele["toolIDCT" + i]._visible = false;
i++;
}
}
function toolsBoxRefresh(parRole) {
ctnrRoot.clearToolIDCT();
if (ctnrRoot[parRole].toolsAry.length > 0) {
ctnrRoot._parent.stateRoleSele.toolsTxt.text = "";
i = 0;
while (i < ctnrRoot[parRole].toolsAry.length) {
ctnrRoot._parent.stateRoleSele.toolsTxt.text = ctnrRoot._parent.stateRoleSele.toolsTxt.text + (ctnrRoot[parRole].toolsAry[i] + " ");
ctnrRoot._parent.stateRoleSele["toolIDCT" + i]._visible = true;
ctnrRoot._parent.stateRoleSele["toolIDCT" + i].gotoAndStop(ctnrRoot[parRole].toolsAry[i]);
ctnrRoot._parent.stateRoleSele["toolIDCT" + i].crtDispTool = ctnrRoot[parRole].toolsAry[i];
i++;
}
} else {
ctnrRoot._parent.stateRoleSele.toolsTxt.text = "have none tool";
}
}
function rolesInit(rName, rHouse) {
ctnrRoot[rName].onPress = ctnrRoot.rolePress;
ctnrRoot[rName].onRollOver = ctnrRoot.roleRollOver;
ctnrRoot[rName].crtHouse = rHouse;
ctnrRoot[rName].actKind = "none";
ctnrRoot[rName].propNearBy = "none";
ctnrRoot[rName].isNearByProp = false;
ctnrRoot[rName].toolsAry = new Array();
ctnrRoot[rName].toolsAry.splice(0);
ctnrRoot[rName].gotoAndStop("stop");
ctnrRoot[rName].roleSay.txtCtt.txt.text = "";
ctnrRoot[rName].roleSay.txtCtt._visible = false;
ctnrRoot[rName].onEnterFrame = ctnrRoot.roleEnterFrame;
ctnrRoot[rName].hitL._alpha = 0;
ctnrRoot[rName].hitR._alpha = 0;
ctnrRoot[rName].hitU1._alpha = 0;
ctnrRoot[rName].hitU2._alpha = 0;
ctnrRoot[rName].hitD1._alpha = 0;
ctnrRoot[rName].hitD2._alpha = 0;
trace((rName + " depth is ") + ctnrRoot[rName].getDepth());
}
function rolesInitAll() {
rolesInit("role1", "house51");
rolesInit("role2", "house52");
rolesInit("role3", "house22");
}
roleSpeed = 5;
clearToolIDCT();
function disabledRoleSele() {
i = 1;
while (i <= 3) {
ctnrRoot["role" + i].enabled = false;
i++;
}
}
function activateRoleSele() {
i = 1;
while (i <= 3) {
ctnrRoot["role" + i].enabled = true;
i++;
}
}
trace("accessCtrl is exist " + accessCtrl);
if (accessCtrl) {
trace("find a should killed accessCtrl");
this.accessCtrl.removeMovieClip();
}
this.createEmptyMovieClip("accessCtrl", this.getNextHighestDepth());
accessCtrl.ctrlState = "none";
accessCtrl.timeCnt = 0;
accessCtrl.timeMax = 30;
accessCtrl.orgnEnterFrame = function () {
switch (this.ctrlState) {
case "gotoAccess" :
ctnrRoot.disabledRoleSele();
getPosH = (getPosV = false);
if (ctnrRoot[crtRole]._currentframe != 2) {
ctnrRoot[crtRole].gotoAndStop(2);
}
if (Math.abs(ctnrRoot[crtRole]._x - ctnrRoot[accessNearBy]._x) < (2 * ctnrRoot.roleSpeed)) {
getPosH = true;
} else if (ctnrRoot[accessNearBy]._x > ctnrRoot[crtRole]._x) {
ctnrRoot[crtRole]._x = ctnrRoot[crtRole]._x + ctnrRoot.roleSpeed;
} else {
ctnrRoot[crtRole]._x = ctnrRoot[crtRole]._x - ctnrRoot.roleSpeed;
}
if (Math.abs(ctnrRoot[crtRole]._y - ctnrRoot[accessNearBy]._y) < (2 * ctnrRoot.roleSpeed)) {
getPosV = true;
} else if (ctnrRoot[accessNearBy]._y > ctnrRoot[crtRole]._y) {
ctnrRoot[crtRole]._y = ctnrRoot[crtRole]._y + ctnrRoot.roleSpeed;
} else {
ctnrRoot[crtRole]._y = ctnrRoot[crtRole]._y - ctnrRoot.roleSpeed;
}
if (getPosH && (getPosV)) {
this.ctrlState = "playClip";
this.timeCnt = 0;
accessPlay = ctnrRoot[accessNearBy].accessName;
ctnrRoot[accessPlay].gotoAndPlay(ctnrRoot.moveDrct);
ctnrRoot[crtRole]._visible = false;
ctnrRoot.camaraMoveCtrl.onEnterFrame = ctnrRoot.camaraMoveCtrl.orgnEnterFrame;
ctnrRoot.camaraMoveCtrl.moveKind = "trg";
ctnrRoot.roleMoveCtrl.isSortFlag = false;
}
break;
case "playClip" :
if (this.timeCnt < this.timeMax) {
this.timeCnt++;
} else {
ctnrRoot[accessPlay].gotoAndStop(1);
this.ctrlState = "none";
this.onEnterFrame = null;
this.timeCnt = 0;
ctnrRoot[crtRole]._x = ctnrRoot[rltTrg]._x;
ctnrRoot[crtRole]._y = ctnrRoot[rltTrg]._y;
ctnrRoot.disabledPropOEF(ctnrRoot[crtRole].crtHouse);
ctnrRoot[crtRole].crtHouse = ctnrRoot.nextRoom;
ctnrRoot.activatePropOEF(ctnrRoot.nextRoom);
activateRoleSele();
ctnrRoot[crtRole]._visible = true;
ctnrRoot.roleMoveCtrl.ctrlAble = true;
if (ctnrRoot.isSortRoom()) {
ctnrRoot.roleMoveCtrl.isSortFlag = true;
ctnrRoot.roleDepthSort();
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "Buddy! Let's get out of here.");
}
gameChapterWin = true;
i = 1;
while (i <= 3) {
if (ctnrRoot["role" + i].crtHouse != winRoom) {
gameChapterWin = false;
break;
}
i++;
}
if (!gameChapterWin) {
break;
}
_global.loadGame = false;
_global.gameRoot.clearInterval(intervalId);
ctnrRoot._parent.gotoAndPlay(winEnd);
}
}
};
function roleDepthSort() {
ctnrRoot.sortAry.splice(0);
ctnrRoot.sortAry.push({rName:"role1", yPos:ctnrRoot.role1._y});
ctnrRoot.sortAry.push({rName:"role2", yPos:ctnrRoot.role2._y});
ctnrRoot.sortAry.push({rName:"role3", yPos:ctnrRoot.role3._y});
ctnrRoot.sortAry.sortOn("yPos", Array.NUMERIC);
i = 0;
while (i < ctnrRoot.sortAry.length) {
ctnrRoot[ctnrRoot.sortAry[i].rName].swapDepths(ctnrRoot.depthAry[i]);
i++;
}
}
function isSortRoom() {
shouldSort = false;
i = 1;
while (i <= 3) {
if ((ctnrRoot[ctnrRoot.crtRole].crtHouse == ctnrRoot["role" + i].crtHouse) && (ctnrRoot[ctnrRoot.crtRole]._name != ("role" + i))) {
shouldSort = true;
}
i++;
}
return(shouldSort);
}
var sortAry = new Array();
var depthAry = new Array(-15790, -15760, -15727);
function setCtrlKey() {
leftKeyNO = [aryKeyCtrl1[0], aryKeyCtrl2[0]];
rightKeyNO = [aryKeyCtrl1[1], aryKeyCtrl2[1]];
downKeyNO = [aryKeyCtrl1[2], aryKeyCtrl2[2]];
upKeyNO = [aryKeyCtrl1[3], aryKeyCtrl2[3]];
zoomOutNO = [aryKeyCtrl1[4], aryKeyCtrl2[4]];
zoomInNO = [aryKeyCtrl1[5], aryKeyCtrl2[5]];
actNO = [aryKeyCtrl1[6], aryKeyCtrl2[6]];
}
function correctPower() {
trace((("power.isOpen " + ctnrRoot.power.isOpen) + " currentframe ") + ctnrRoot.power._currentframe);
if (ctnrRoot.power.isOpen == true) {
if (ctnrRoot.power._currentframe != 2) {
ctnrRoot.power.gotoAndStop(2);
ctnrRoot.powerLight._visible = true;
}
} else if (ctnrRoot.power._currentframe != 1) {
ctnrRoot.power.gotoAndStop(1);
ctnrRoot.powerlight._visible = false;
}
}
function accessSub(parRole) {
accessNearBy = ctnrRoot[parRole].propNearBy;
moveDrct = ctnrRoot[accessNearBy].accessDrct.substr(0, 2);
nextRoom = "house" + ctnrRoot[accessNearBy].accessDrct.substr(3, 2);
accessName_inSub = ctnrRoot[accessNearBy].accessName;
rltTrg = ctnrRoot[accessNearBy].rlt;
ctnrRoot.accessCtrl.timeMax = ctnrRoot[accessName_inSub].timeCnt;
if (ctnrRoot[accessName_inSub].accessable == false) {
ctnrRoot.roleSay(parRole, "I cannot enter.");
ctnrRoot.doorSd.start();
_global.gameRoot.sndCtrl.playSound("doorSnd");
return(undefined);
}
trace((((ctnrRoot[accessName_inSub].accessRole + " ") + parRole) + " ") + accessName_inSub);
if ((ctnrRoot[accessName_inSub].accessRole != "any") && (ctnrRoot[accessName_inSub].accessRole != parRole)) {
ctnrRoot.roleSay(parRole, "I'm too big to do this.");
return(undefined);
}
if (ctnrRoot.accessCtrl.timeCnt == 0) {
ctnrRoot.accessCtrl.onEnterFrame = ctnrRoot.accessCtrl.orgnEnterFrame;
ctnrRoot.accessCtrl.ctrlState = "gotoAccess";
ctnrRoot.roleMoveCtrl.ctrlAble = false;
}
}
function getPropSub(parRole) {
accessNearBy = ctnrRoot[parRole].propNearBy;
if ((ctnrRoot[accessNearBy].rec[1] == parRole) || (ctnrRoot[accessNearBy].rec[1] == "any")) {
_global.gameRoot.sndCtrl.playSound("getSnd");
ctnrRoot.roleSay(parRole, "Item picked up.");
if (ctnrRoot[parRole].toolsAry.length >= 5) {
ctnrRoot.roleSay(parRole, "I can't take any more.");
return(undefined);
}
i = 0;
while (i < ctnrRoot[parRole].toolsAry.length) {
if (ctnrRoot[parRole].toolsAry[i] == accessNearBy) {
trace("has the tool yet");
return(undefined);
}
i++;
}
ctnrRoot.delHousePropAry(ctnrRoot[parRole].crtHouse, accessNearBy);
ctnrRoot[parRole].toolsAry.push(accessNearBy);
ctnrRoot.toolsBoxRefresh(parRole);
ctnrRoot[accessNearBy]._visible = false;
ctnrRoot[accessNearBy].onEnterFrame = null;
housePropAry = ctnrRoot[ctnrRoot[parRole].crtHouse].propAry;
i = 0;
while (i < housePropAry.length) {
if (housePropAry[i] == accessNearBy) {
housePropAry.splice(i, 1);
}
i++;
}
} else {
ctnrRoot.roleSay(parRole, "I don't need it");
}
}
function usePropSub(parRole) {
usePropNearBy = ctnrRoot[parRole].propNearBy;
operator = ctnrRoot[usePropNearBy].rec[0];
trace((((usePropNearBy + " ") + operator) + " == ") + parRole);
if ((operator == parRole) || (operator == "any")) {
trace(ctnrRoot[usePropNearBy].rec[1] + "()");
ctnrRoot[ctnrRoot[usePropNearBy].rec[1]].apply(null);
}
}
ctnrRoot.roleMoveCtrl.removeMovieClip();
ctnrRoot.createEmptyMovieClip("roleMoveCtrl", ctnrRoot.getNextHighestDepth());
ctnrRoot.roleMoveCtrl.crtRole = "none";
ctnrRoot.roleMoveCtrl.ctrlAble = true;
ctnrRoot.roleMoveCtrl.isPush = false;
ctnrRoot.roleMoveCtrl.moveDrct = "none";
ctnrRoot.roleMoveCtrl.crtPressKeyCode = "none";
ctnrRoot.roleMoveCtrl.isSortFlag = false;
var aryKeyCtrl1 = new Array(65, 68, 83, 87, 88, 67, 32);
var aryKeyCtrl2 = new Array(37, 39, 40, 38, 97, 98, 96);
var aryKey = new Array();
setCtrlKey();
ctnrRoot.roleMoveCtrl.onEnterFrame = function () {
if ((this.crtRole == "none") || (this.ctrlAble == false)) {
return(undefined);
}
crtHouse = "hb" + ctnrRoot[this.crtRole].crtHouse.substr(5, 2);
houseLeft = ctnrRoot[crtHouse]._x + ctnrRoot.marginH;
houseRight = (ctnrRoot[crtHouse]._x + ctnrRoot[crtHouse]._width) - ctnrRoot.marginH;
houseBottom = (ctnrRoot[crtHouse]._y + ctnrRoot[crtHouse]._height) - ctnrRoot.marginBtm;
houseTop = (houseBottom - ctnrRoot.houseTopAt) + ctnrRoot.marginTop;
if (Key.isDown(leftKeyNO[0]) || (Key.isDown(leftKeyNO[1]))) {
if (this.isPush == false) {
ctnrRoot[this.crtRole].gotoAndStop("Left");
} else {
ctnrRoot[this.crtRole].gotoAndStop("pushL");
}
if (ctnrRoot[this.crtRole]._x > houseLeft) {
if ((ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "any") || (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "x")) {
ctnrRoot[this.crtRole]._x = ctnrRoot[this.crtRole]._x - ctnrRoot.roleSpeed;
}
if (this.isSortFlag) {
ctnrRoot.roleDepthSort();
}
}
this.moveDrct = "L";
ctnrRoot.setCamara();
return(undefined);
}
if (Key.isDown(rightKeyNO[0]) || (Key.isDown(rightKeyNO[1]))) {
if (this.isPush == false) {
ctnrRoot[this.crtRole].gotoAndStop("right");
} else {
ctnrRoot[this.crtRole].gotoAndStop("pushR");
}
if (ctnrRoot[this.crtRole]._x < houseRight) {
if ((ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "any") || (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "x")) {
ctnrRoot[this.crtRole]._x = ctnrRoot[this.crtRole]._x + ctnrRoot.roleSpeed;
}
if (this.isSortFlag) {
ctnrRoot.roleDepthSort();
}
}
this.moveDrct = "R";
ctnrRoot.setCamara();
return(undefined);
}
if (Key.isDown(downKeyNO[0]) || (Key.isDown(downKeyNO[1]))) {
if (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "any") {
ctnrRoot[this.crtRole].gotoAndStop("down");
ctnrRoot[this.crtRole].isClimb = false;
} else if (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "y") {
ctnrRoot[this.crtRole].gotoAndStop("climb");
ctnrRoot[this.crtRole].isClimb = true;
}
if (ctnrRoot[this.crtRole]._y < houseBottom) {
if ((ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "any") || (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "y")) {
ctnrRoot[this.crtRole]._y = ctnrRoot[this.crtRole]._y + ctnrRoot.roleSpeed;
}
if (this.isSortFlag) {
ctnrRoot.roleDepthSort();
}
}
this.moveDrct = "D";
ctnrRoot.setCamara();
return(undefined);
}
if (Key.isDown(upKeyNO[0]) || (Key.isDown(upKeyNO[1]))) {
if (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "any") {
ctnrRoot[this.crtRole].gotoAndStop("up");
ctnrRoot[this.crtRole].isClimb = false;
} else if (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "y") {
ctnrRoot[this.crtRole].gotoAndStop("climb");
ctnrRoot[this.crtRole].isClimb = true;
}
if (ctnrRoot[this.crtRole]._y > houseTop) {
if ((ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "any") || (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "y")) {
ctnrRoot[this.crtRole]._y = ctnrRoot[this.crtRole]._y - ctnrRoot.roleSpeed;
}
if (this.isSortFlag) {
ctnrRoot.roleDepthSort();
}
}
this.moveDrct = "U";
ctnrRoot.setCamara();
return(undefined);
}
if (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "y") {
ctnrRoot[this.crtRole].gotoAndStop("stopBack");
} else {
ctnrRoot[this.crtRole].gotoAndStop("stop");
}
this.crtPressKeyCode = "none";
};
if (keyListener == undefined) {
var keyListener = new Object();
keyListener.onKeyDown = function () {
if ((Key.getCode() == actNO[0]) || (Key.getCode() == actNO[1])) {
ctnrRoot.correctPower();
if (ctnrRoot.roleMoveCtrl.ctrlAble == false) {
return(undefined);
}
crtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (ctnrRoot[crtRole].isNearByProp == true) {
trace(ctnrRoot[crtRole].actKind);
switch (ctnrRoot[crtRole].actKind) {
case "getProp" :
ctnrRoot.getPropSub(crtRole);
break;
case "access" :
ctnrRoot.accessSub(crtRole);
break;
case "moveHeavy" :
break;
case "useProp" :
trace("should use a prop :" + ctnrRoot[crtRole].propNearBy);
sayCtt = ctnrRoot[ctnrRoot[crtRole].propNearBy].commentTxt;
sayCttF = ((sayCtt == undefined) ? "oh!!!?" : (sayCtt));
ctnrRoot.roleSay(crtRole, sayCttF);
ctnrRoot.usePropSub(crtRole);
break;
case "watch" :
sayCtt = ctnrRoot[ctnrRoot[crtRole].propNearBy].commentTxt;
sayCttF = ((sayCtt == undefined) ? "!'O'!" : (sayCtt));
ctnrRoot.roleSay(crtRole, sayCttF);
}
} else {
sayCttF = "Nothing here";
ctnrRoot.roleSay(crtRole, sayCttF);
}
return(undefined);
}
if (((Key.getCode() == zoomOutNO[0]) || (Key.getCode() == zoomOutNO[1])) && (ctnrRoot._parent.container._xscale == 100)) {
ctnrRoot.globalView();
return(undefined);
}
if (((Key.getCode() == zoomInNO[0]) || (Key.getCode() == zoomInNO[1])) && (ctnrRoot._parent.container._xscale == ctnrRoot.shouldScale)) {
ctnrRoot.localView();
return(undefined);
}
};
keyListener.onKeyUp = function () {
if ((Key.getCode() == actNO[0]) || (Key.getCode() == actNO[1])) {
ctnrRoot.clearPropNearBy();
}
i = 0;
while (i < ctnrRoot.aryKey.length) {
if (Key.getCode() == ctnrRoot.aryKey[i]) {
ctnrRoot.roleMoveCtrl.isPush = false;
if (String(Key.getCode()) == ctnrRoot.roleMoveCtrl.crtPressKeyCode) {
ctnrRoot.roleMoveCtrl.crtPressKeyCode = "none";
}
}
i++;
}
};
}
Key.addListener(keyListener);
function roomHitOrgn() {
if (_global.isZooming == false) {
var _local8 = {x:0, y:0};
var _local3 = {x:0, y:0};
var _local7 = {x:0, y:0};
var _local5 = {x:0, y:0};
var _local6 = {x:0, y:0};
var _local4 = {x:0, y:0};
ctnrRoot[ctnrRoot.crtRole].hitL.localToGlobal(_local8);
ctnrRoot[ctnrRoot.crtRole].hitR.localToGlobal(_local3);
ctnrRoot[ctnrRoot.crtRole].hitU1.localToGlobal(_local7);
ctnrRoot[ctnrRoot.crtRole].hitU2.localToGlobal(_local5);
ctnrRoot[ctnrRoot.crtRole].hitD1.localToGlobal(_local6);
ctnrRoot[ctnrRoot.crtRole].hitD2.localToGlobal(_local4);
if (this.hitTest(_local8.x, _local8.y, true)) {
ctnrRoot[crtRole]._x = ctnrRoot[crtRole]._x + ctnrRoot.roleSpeed;
trace("hit area /L");
}
if (this.hitTest(_local3.x, _local3.y, true)) {
ctnrRoot[crtRole]._x = ctnrRoot[crtRole]._x - ctnrRoot.roleSpeed;
trace("hit area R");
}
if (this.hitTest(_local7.x, _local7.y, true) || (this.hitTest(_local5.x, _local5.y, true))) {
ctnrRoot[crtRole]._y = ctnrRoot[crtRole]._y + ctnrRoot.roleSpeed;
trace("hit area U");
}
if (this.hitTest(_local6.x, _local6.y, true) || (this.hitTest(_local4.x, _local4.y, true))) {
ctnrRoot[crtRole]._y = ctnrRoot[crtRole]._y - ctnrRoot.roleSpeed;
trace("hit area D");
}
}
}
function roomHitInit() {
i = 0;
while (i < roomHitAry.length) {
ctnrRoot[roomHitAry[i]].orgnEnterFrame = ctnrRoot.roomHitOrgn;
ctnrRoot[roomHitAry[i]]._alpha = 0;
i++;
}
}
var roomHitAry = new Array("roomHit61", "roomHit62", "roomHit51", "roomHit52", "roomHit53", "roomHit41", "roomHit42", "roomHit43", "roomHit44", "roomHit31", "roomHit32", "roomHit33", "roomHit21", "roomHit22", "roomHit23", "roomHit11", "roomHit12", "roomHit13", "roomHit14");
roomHitInit();
function housePropInit(houseName) {
propAry = ctnrRoot[houseName].propAry;
i = 0;
while (i < propAry.length) {
propName = propAry[i];
ctnrRoot[propName].onEnterFrame = null;
i++;
}
}
function delHousePropAry(parHouse, parProp) {
delAry = ctnrRoot[parHouse].propAry;
i = 0;
while (i < delAry.length) {
if (delAry[i] == parProp) {
delAry.splice(i, 1);
break;
}
i++;
}
return(undefined);
}
function housePropInitAll() {
ctnrRoot.house61.propAry = new Array("trg61_1", "pipe2", "roomHit61");
ctnrRoot.house61.axis = "any";
housePropInit("house61");
ctnrRoot.house62.propAry = new Array("trg62_1", "rope1", "roomHit62");
ctnrRoot.house62.axis = "any";
housePropInit("house62");
ctnrRoot.house51.propAry = new Array("trg51_1", "trg51_2", "wood", "roomHit51");
ctnrRoot.house51.axis = "any";
housePropInit("house51");
ctnrRoot.house52.propAry = new Array("trg52_1", "trg52_2", "heavy52", "roomHit52");
ctnrRoot.house52.axis = "any";
housePropInit("house52");
ctnrRoot.house53.propAry = new Array("trg53_1", "tele", "pipeHead", "roomHit53");
ctnrRoot.house53.axis = "any";
housePropInit("house53");
ctnrRoot.house41.propAry = new Array("trg41_1", "trg41_2", "trg41_3", "flower", "roomHit41");
ctnrRoot.house41.axis = "any";
housePropInit("house41");
ctnrRoot.house42.propAry = new Array("trg42_1", "trg42_2", "trg42_3", "heavy42", "roomHit42");
ctnrRoot.house42.axis = "any";
housePropInit("house42");
ctnrRoot.house43.propAry = new Array("trg43_1", "trg43_2", "roomHit43");
ctnrRoot.house43.axis = "any";
housePropInit("house43");
ctnrRoot.house44.propAry = new Array("trg44_1", "fBullet", "roomHit44", "wood44");
ctnrRoot.house44.axis = "any";
housePropInit("house44");
ctnrRoot.house31.propAry = new Array("trg31_1", "trg31_2", "phone", "number", "enemy31", "roomHit31");
ctnrRoot.house31.axis = "any";
housePropInit("house31");
ctnrRoot.house32.propAry = new Array("trg32_1", "trg32_2", "trg32_3", "axe", "dogHole", "roomHit32", "enemy32");
ctnrRoot.house32.axis = "any";
housePropInit("house32");
ctnrRoot.house33.propAry = new Array("trg33_1", "roomHit33", "key2", "dog");
ctnrRoot.house33.axis = "any";
housePropInit("house33");
ctnrRoot.house21.propAry = new Array("trg21_1", "trg21_2", "enemy21", "roomHit21");
ctnrRoot.house21.axis = "any";
housePropInit("house21");
ctnrRoot.house22.propAry = new Array("trg22_1", "trg22_2", "trg22_3", "lock22", "power", "key1", "roomHit22", "powerCorrect");
ctnrRoot.house22.axis = "any";
housePropInit("house22");
ctnrRoot.house23.propAry = new Array("trg23_1", "trg23_2", "card", "steelDoor", "roomHit23");
ctnrRoot.house23.axis = "any";
housePropInit("house23");
ctnrRoot.house11.propAry = new Array("trg11_1", "trg11_2", "wire11", "enemy11", "heavy11", "roomHit11", "powerCorrect11");
ctnrRoot.house11.axis = "any";
housePropInit("house11");
ctnrRoot.house12.propAry = new Array("trg12_1", "trg12_2", "cardReader", "roomHit12");
ctnrRoot.house12.axis = "any";
housePropInit("house12");
ctnrRoot.house13.propAry = new Array("trg13_1", "trg13_2", "roomHit13");
ctnrRoot.house13.axis = "any";
housePropInit("house13");
ctnrRoot.house14.propAry = new Array("trg14_1", "trg14_2", "lock14", "roomHit14");
ctnrRoot.house14.axis = "any";
housePropInit("house14");
}
houseTopAt = 60;
marginH = 25;
marginBtm = 15;
marginTop = 10;
var house61 = new Object();
var house62 = new Object();
var house51 = new Object();
var house52 = new Object();
var house53 = new Object();
var house41 = new Object();
var house42 = new Object();
var house43 = new Object();
var house44 = new Object();
var house32 = new Object();
var house31 = new Object();
var house33 = new Object();
var house21 = new Object();
var house22 = new Object();
var house23 = new Object();
var house11 = new Object();
var house12 = new Object();
var house13 = new Object();
var house14 = new Object();
housePropInitAll();
function accessInit() {
trg61_1.accessDrct = "dn_51";
trg61_1.accessName = "pipe1";
trg61_1.rlt = "trg51_1";
trg62_1.accessDrct = "dn_53";
trg62_1.accessName = "pipe3";
trg62_1.rlt = "trg53_2";
trg62_2.accessDrct = "dn_44";
trg62_2.accessName = "pipe5";
trg62_2.rlt = "trg44_1";
trg51_1.accessDrct = "up_61";
trg51_1.accessName = "pipe1";
trg51_1.rlt = "trg61_1";
trg51_2.accessDrct = "dn_41";
trg51_2.accessName = "doorV45";
trg51_2.rlt = "trg41_1";
trg51_3.accessDrct = "2R_52";
trg51_3.accessName = "doorH5_12";
trg51_3.rlt = "trg52_1";
trg52_1.accessDrct = "2L_51";
trg52_1.accessName = "doorH5_12";
trg52_1.rlt = "trg51_3";
trg52_2.accessDrct = "2R_53";
trg52_2.accessName = "doorH5_23";
trg52_2.rlt = "trg53_1";
trg53_1.accessDrct = "2L_52";
trg53_1.accessName = "doorH5_23";
trg53_1.rlt = "trg52_2";
trg53_2.accessDrct = "up_62";
trg53_2.accessName = "pipe3";
trg53_2.rlt = "trg62_1";
trg41_1.accessDrct = "up_51";
trg41_1.accessName = "doorV45";
trg41_1.rlt = "trg51_2";
trg41_2.accessDrct = "2R_42";
trg41_2.accessName = "doorH4_12";
trg41_2.rlt = "trg42_1";
trg41_3.accessDrct = "dn_31";
trg41_3.accessName = "pipe6";
trg41_3.rlt = "trg31_2";
trg42_1.accessDrct = "2L_41";
trg42_1.accessName = "doorH4_12";
trg42_1.rlt = "trg41_2";
trg42_2.accessDrct = "dn_32";
trg42_2.accessName = "doorV34";
trg42_2.rlt = "trg32_3";
trg42_3.accessDrct = "up_43";
trg42_3.accessName = "pipe7";
trg42_3.rlt = "trg43_1";
trg43_1.accessDrct = "dn_42";
trg43_1.accessName = "pipe7";
trg43_1.rlt = "trg42_3";
trg43_2.accessDrct = "dn_33";
trg43_2.accessName = "ladder";
trg43_2.rlt = "trg33_1";
trg44_1.accessDrct = "up_62";
trg44_1.accessName = "pipe5";
trg44_1.rlt = "trg62_2";
trg31_2.accessDrct = "up_41";
trg31_2.accessName = "pipe6";
trg31_2.rlt = "trg41_3";
trg31_1.accessDrct = "2R_32";
trg31_1.accessName = "doorH3_12";
trg31_1.rlt = "trg32_1";
trg32_1.accessDrct = "2L_31";
trg32_1.accessName = "doorH3_12";
trg32_1.rlt = "trg31_1";
trg32_2.accessDrct = "dn_22";
trg32_2.accessName = "doorV23";
trg32_2.rlt = "trg22_2";
trg32_3.accessDrct = "up_42";
trg32_3.accessName = "doorV34";
trg32_3.rlt = "trg42_2";
trg33_1.accessDrct = "up_43";
trg33_1.accessName = "ladder";
trg33_1.rlt = "trg43_2";
trg21_1.accessDrct = "dn_11";
trg21_1.accessName = "doorV12";
trg21_1.rlt = "trg11_1";
trg21_2.accessDrct = "2R_22";
trg21_2.accessName = "doorH2_12";
trg21_2.rlt = "trg22_1";
trg22_1.accessDrct = "2L_21";
trg22_1.accessName = "doorH2_12";
trg22_1.rlt = "trg21_2";
trg22_2.accessDrct = "up_32";
trg22_2.accessName = "doorV23";
trg22_2.rlt = "trg32_2";
trg22_3.accessDrct = "2R_23";
trg22_3.accessName = "doorH2_23";
trg22_3.rlt = "trg23_1";
trg23_1.accessDrct = "2L_22";
trg23_1.accessName = "doorH2_23";
trg23_1.rlt = "trg22_3";
trg23_2.accessDrct = "dn_14";
trg23_2.accessName = "pipe4";
trg23_2.rlt = "trg14_2";
trg11_1.accessDrct = "up_21";
trg11_1.accessName = "doorV12";
trg11_1.rlt = "trg21_1";
trg11_2.accessDrct = "2R_12";
trg11_2.accessName = "doorH1_12";
trg11_2.rlt = "trg12_1";
trg12_1.accessDrct = "2L_11";
trg12_1.accessName = "doorH1_12";
trg12_1.rlt = "trg11_2";
trg12_2.accessDrct = "2R_13";
trg12_2.accessName = "doorH1_23";
trg12_2.rlt = "trg13_1";
trg13_1.accessDrct = "2L_12";
trg13_1.accessName = "doorH1_23";
trg13_1.rlt = "trg12_2";
trg13_2.accessDrct = "2R_14";
trg13_2.accessName = "doorH1_34";
trg13_2.rlt = "trg14_1";
trg14_1.accessDrct = "2L_13";
trg14_1.accessName = "doorH1_34";
trg14_1.rlt = "trg13_2";
trg14_2.accessDrct = "up_23";
trg14_2.accessName = "pipe4";
trg14_2.rlt = "trg23_2";
pipe1.accessable = true;
pipe1.accessRole = "role1";
pipe1.timeCnt = 100;
pipe3.accessable = false;
pipe3.accessRole = "role1";
pipe3.timeCnt = 100;
pipe4.accessable = true;
pipe4.accessRole = "role1";
pipe4.timeCnt = 100;
pipe5.accessable = true;
pipe5.accessRole = "role1";
pipe5.timeCnt = 100;
pipe6.accessable = true;
pipe6.accessRole = "role1";
pipe6.timeCnt = 100;
pipe7.accessable = true;
pipe7.accessRole = "role1";
pipe7.timeCnt = 100;
doorV45.accessable = true;
doorV45.accessRole = "any";
doorV45.timeCnt = 50;
doorV34.accessable = true;
doorV34.accessRole = "any";
doorV34.timeCnt = 50;
doorV23.accessable = true;
doorV23.accessRole = "any";
doorV23.timeCnt = 50;
doorV12.accessable = true;
doorV12.accessRole = "any";
doorV12.timeCnt = 50;
doorH5_12.accessable = false;
doorH5_12.accessRole = "any";
doorH5_12.timeCnt = 20;
doorH5_23.accessable = true;
doorH5_23.accessRole = "any";
doorH5_23.timeCnt = 20;
doorH4_12.accessable = true;
doorH4_12.accessRole = "any";
doorH4_12.timeCnt = 20;
doorH3_12.accessable = true;
doorH3_12.accessRole = "any";
doorH3_12.timeCnt = 20;
doorH2_12.accessable = true;
doorH2_12.accessRole = "any";
doorH2_12.timeCnt = 20;
doorH2_23.accessable = false;
doorH2_23.accessRole = "any";
doorH2_23.timeCnt = 20;
doorH1_12.accessable = true;
doorH1_12.accessRole = "any";
doorH1_12.timeCnt = 20;
doorH1_23.accessable = false;
doorH1_23.accessRole = "any";
doorH1_23.timeCnt = 20;
doorH1_34.accessable = false;
doorH1_34.accessRole = "any";
doorH1_34.timeCnt = 20;
ladder.accessable = true;
ladder.accessRole = "role1";
ladder.timeCnt = 100;
}
accessMoveDistH = 100;
accessMoveDistV = ctnrRoot.hb51._height;
accessInit();
function activatePropOEF(houseName) {
propAry = ctnrRoot[houseName].propAry;
trace("activate OEF of :" + propAry);
i = 0;
while (i < propAry.length) {
propName = propAry[i];
ctnrRoot[propName].onEnterFrame = ctnrRoot[propName].orgnEnterFrame;
ctnrRoot[propName].hintOver = false;
i++;
}
}
function disabledPropOEF(houseName) {
propAry = ctnrRoot[houseName].propAry;
i = 0;
while (i < propAry.length) {
propName = propAry[i];
ctnrRoot[propName].onEnterFrame = null;
i++;
}
}
function clearPropNearBy() {
ctnrRoot[crtRole].isNearByProp = false;
ctnrRoot[crtRole].propNearBy = "none";
ctnrRoot[crtRole].actKind = "none";
return(undefined);
}
function setPropNearBy(parName, parKind) {
ctnrRoot[crtRole].isNearByProp = true;
ctnrRoot[crtRole].propNearBy = parName;
ctnrRoot[crtRole].actKind = parKind;
return(undefined);
}
function trgEnterFrame1() {
crtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[crtRole].trgBox)) {
ctnrRoot.setPropNearBy(this._name, "access");
return(undefined);
}
if (ctnrRoot[crtRole].propNearBy == this._name) {
ctnrRoot.clearPropNearBy();
}
return(undefined);
}
function trgEnterFrame2() {
crtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[crtRole].trgBox)) {
ctnrRoot.setPropNearBy(this._name, "getProp");
return(undefined);
}
if (ctnrRoot[crtRole].propNearBy == this._name) {
ctnrRoot.clearPropNearBy();
}
return(undefined);
}
function heavyEnterFrame() {
if (this.moveOver == true) {
this.onEnterFrame = null;
return(undefined);
}
heavyCrtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[heavyCrtRole].trgBox)) {
ctnrRoot.roleMoveCtrl.isPush = true;
if (heavyCrtRole == "role3") {
this.moveCnt++;
if (this.moveCnt < this.moveMax) {
if (ctnrRoot[heavyCrtRole]._x < this._x) {
this._x = this._x + ctnrRoot.roleSpeed;
} else {
this._x = this._x - ctnrRoot.roleSpeed;
}
return(undefined);
}
this.moveOver = true;
this.onEnterFrame = null;
ctnrRoot.roleMoveCtrl.isPush = false;
ctnrRoot[this._name + "over"] = true;
if (this.shouldDisapear == true) {
this.gotoAndPlay("disapear");
}
// unexpected jump
}
if (ctnrRoot[heavyCrtRole]._x < this._x) {
ctnrRoot[heavyCrtRole]._x = ctnrRoot[heavyCrtRole]._x - ctnrRoot.roleSpeed;
} else {
ctnrRoot[heavyCrtRole]._x = ctnrRoot[heavyCrtRole]._x + ctnrRoot.roleSpeed;
}
return(undefined);
}
ctnrRoot.roleMoveCtrl.isPush = false;
}
function steelDoorEnterFrame() {
heavyCrtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[heavyCrtRole].trgBox)) {
if (ctnrRoot[heavyCrtRole]._x < this._x) {
ctnrRoot[heavyCrtRole]._x = ctnrRoot[heavyCrtRole]._x - ctnrRoot.roleSpeed;
} else {
ctnrRoot[heavyCrtRole]._x = ctnrRoot[heavyCrtRole]._x + ctnrRoot.roleSpeed;
}
return(undefined);
}
return(undefined);
}
function trgEnterFrame4() {
crtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[crtRole].trgBox)) {
ctnrRoot.setPropNearBy(this._name, "useProp");
return(undefined);
}
if (ctnrRoot[crtRole].propNearBy == this._name) {
ctnrRoot.clearPropNearBy();
}
return(undefined);
}
function trgEnterFrame5() {
crtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[crtRole].trgBox)) {
ctnrRoot.setPropNearBy(this._name, "watch");
return(undefined);
}
if (ctnrRoot[crtRole].propNearBy == this._name) {
ctnrRoot.clearPropNearBy();
}
return(undefined);
}
function dogEnterFrame() {
crtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[crtRole].trgBox)) {
ctnrRoot.roleMoveCtrl.ctrlAble = false;
this.gotoAndPlay("fight");
this.onEnterFrame = null;
return(undefined);
}
if (ctnrRoot[crtRole].propNearBy == this._name) {
ctnrRoot.clearPropNearBy();
}
return(undefined);
}
function propPress() {
accessNearBy = this._name;
parRole = ctnrRoot.roleMoveCtrl.crtRole;
trace(ctnrRoot[accessNearBy].rec[1]);
if ((this.onEnterFrame == null) || (this.onEnterFrame == undefined)) {
trace("this prop enterframe is null now ,you can't get it");
return(undefined);
}
trace(" distance of crtRole and prop :" + Math.abs(this._x - ctnrRoot[ctnrRoot.roleMoveCtrl.ctrRole]._x));
if ((Math.abs(this._x - ctnrRoot[ctnrRoot.roleMoveCtrl.ctrRole]._x) > 100) || (Math.abs(this._x - ctnrRoot[ctnrRoot.roleMoveCtrl.ctrRole]._x) > 150)) {
trace("this prop is far from you, can't get it");
return(undefined);
}
if ((ctnrRoot[accessNearBy].rec[1] == parRole) || (ctnrRoot[accessNearBy].rec[1] == "any")) {
_global.gameRoot.sndCtrl.playSound("getSnd");
ctnrRoot.roleSay(parRole, "Item picked up.");
trace("before push role1 ary " + ctnrRoot.role1.toolsAry);
i = 0;
while (i < ctnrRoot[parRole].toolsAry.length) {
if (ctnrRoot[parRole].toolsAry[i] == accessNearBy) {
trace("has the tool yet");
return(undefined);
}
i++;
}
ctnrRoot.delHousePropAry(ctnrRoot[parRole].crtHouse, accessNearBy);
ctnrRoot[parRole].toolsAry.push(accessNearBy);
ctnrRoot.toolsBoxRefresh(parRole);
ctnrRoot[accessNearBy]._visible = false;
ctnrRoot[accessNearBy].onEnterFrame = null;
housePropAry = ctnrRoot[ctnrRoot[parRole].crtHouse].propAry;
i = 0;
while (i < housePropAry.length) {
if (housePropAry[i] == accessNearBy) {
housePropAry.splice(i, 1);
}
i++;
}
} else {
ctnrRoot.roleSay(parRole, "I don't need it");
}
}
function propEnterFrameInit() {
trg61_1.orgnEnterFrame = ctnrRoot.trgEnterFrame1;
pipe2.orgnEnterFrame = ctnrRoot.trgEnterFrame5;
trg62_1.orgnEnterFrame = (trg62_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
rope1.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
pipe5._visible = false;
trg51_1.orgnEnterFrame = (trg51_2.orgnEnterFrame = (trg51_3.orgnEnterFrame = ctnrRoot.trgEnterFrame1));
key1.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
wood.orgnEnterFrame = ctnrRoot.trgEnterFrame5;
trg52_1.orgnEnterFrame = (trg52_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
heavy52.orgnEnterFrame = ctnrRoot.heavyEnterFrame;
number2.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
trg53_1.orgnEnterFrame = (trg53_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
tele.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
pipeHead.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
trg41_1.orgnEnterFrame = (trg41_2.orgnEnterFrame = (trg41_3.orgnEnterFrame = ctnrRoot.trgEnterFrame1));
flower.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
trg42_1.orgnEnterFrame = (trg42_2.orgnEnterFrame = (trg42_3.orgnEnterFrame = ctnrRoot.trgEnterFrame1));
heavy42.orgnEnterFrame = ctnrRoot.heavyEnterFrame;
trg43_1.orgnEnterFrame = (trg43_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
trg44_1.orgnEnterFrame = ctnrRoot.trgEnterFrame1;
fBullet.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
wood44.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
trg31_1.orgnEnterFrame = (trg31_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
phone.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
number.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
trg32_1.orgnEnterFrame = (trg32_2.orgnEnterFrame = (trg32_3.orgnEnterFrame = ctnrRoot.trgEnterFrame1));
axe.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
dogHole.orgnEnterFrame = ctnrRoot.trgEnterFrame5;
trg33_1.orgnEnterFrame = ctnrRoot.trgEnterFrame1;
key2.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
dog.orgnEnterFrame = ctnrRoot.dogEnterFrame;
trg21_1.orgnEnterFrame = (trg21_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
trg22_1.orgnEnterFrame = (trg22_2.orgnEnterFrame = (trg22_3.orgnEnterFrame = ctnrRoot.trgEnterFrame1));
lock22.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
power.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
powerCorrect.orgnEnterFrame = ctnrRoot.powerCorrectOEF;
power.isOpen = false;
trg23_1.orgnEnterFrame = (trg23_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
card.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
steelDoor.orgnEnterFrame = ctnrRoot.steelDoorEnterFrame;
trg11_1.orgnEnterFrame = (trg11_2.orgnEnterFrame = (trg12_1.orgnEnterFrame = (trg12_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1)));
cardReader.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
heavy11.orgnEnterFrame = ctnrRoot.heavyEnterFrame;
powerCorrect11.orgnEnterFrame = ctnrRoot.powerCorrectOEF;
trg13_1.orgnEnterFrame = (trg13_2.orgnEnterFrame = (trg14_1.orgnEnterFrame = (trg14_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1)));
lock14.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
}
function powerCorrectOEF() {
if (ctnrRoot.power.isOpen == true) {
if (ctnrRoot.power._currentframe == 1) {
trace("have correct the power light to on");
ctnrRoot.power.gotoAndStop(2);
_global.gameRoot.container.wire11.eleMc._visible = true;
trace("eleMc visible " + _global.gameRoot.container.wire11.eleMc._visible);
}
if (ctnrRoot.power._currentframe == 2) {
trace("that's all right in poweron");
}
if (_global.gameRoot.container.wire11.eleMc._visible == false) {
trace("******* eleMc is wrong so correct it");
_global.gameRoot.container.wire11.eleMc._visible = true;
}
} else {
if (ctnrRoot.power._currentframe == 2) {
trace("have correct the power light to off");
ctnrRoot.power.gotoAndStop(1);
ctnrRoot.wire11.eleMc._visible = false;
}
if (ctnrRoot.power._currentframe == 1) {
trace("that's all right in poweroff");
}
}
}
function propPressInit() {
var _local1 = new Array("trg41_3", "trg31_2", "trg44_1", "trg62_2", "trg23_2", "trg14_2", "trg43_2", "trg33_1");
number.onPress = propPress;
axe.onPress = propPress;
number2.onPress = propPress;
tele.onPress = propPress;
key1.onPress = propPress;
key2.onPress = propPress;
fBullet.onPress = propPress;
card.onPress = propPress;
nothingPress.onPress = function () {
sayCttF = "Nothing here";
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, sayCttF);
};
nothingPress.useHandCursor = false;
phone.onPress = function () {
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "Oooh telephone!");
};
wood.onPress = function () {
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "Wooden planks are blocking the door!");
};
wood44.onPress = function () {
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "Wooden planks are blocking the door!");
};
lock22.onPress = (lock14.onPress = (cardReader.onPress = function () {
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "This opens the door!");
}));
flower0.onPress = function () {
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "A heavy plant");
};
pipeHead.onPress = function () {
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "An air vent!");
};
pipe2.onPress = function () {
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "Air pipe - something small will fit inside!");
};
}
propEnterFrameInit();
heavy52.moveCnt = 0;
heavy52.moveMax = 35;
heavy52.moveOver = false;
heavy52.shouldDisapear = true;
heavy42.moveCnt = 0;
heavy42.moveMax = 15;
heavy42.moveOver = false;
heavy42.shouldDisapear = true;
heavy11.moveCnt = 0;
heavy11.moveMax = 8;
heavy11.shouldDisapear = true;
function enemyDebug() {
enemy32.crtTask = "changeRoom";
enemy32.onEnterFrame = enemy32.orgnEnterFrame;
}
enemy32.crtTask = "gard";
enemy31._visible = false;
enemy31.crtTask = "hide";
enemy11Dead._visible = false;
enemy21.gotoAndStop("none");
enemy31.gotoAndStop("none");
enemy32.gotoAndStop("none");
enemy11.gotoAndStop("none");
enemy32.orgnEnterFrame = function () {
this.xDist = false;
this.yDist = false;
trace("this.crtTask " + this.crtTask);
if (this.crtTask == "hide") {
this.onEnterFrame = null;
return(undefined);
}
if (this.crtTask == "gard") {
if (ctnrRoot.roleMoveCtrl.ctrlAble == true) {
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole].gotoAndStop("cry");
}
if (Math.abs(this._x - ctnrRoot[ctnrRoot.crtRole]._x) > 5) {
if (this._x < ctnrRoot[ctnrRoot.crtRole]._x) {
this._x = this._x + 5;
this.gotoAndStop("right");
} else {
this._x = this._x - 5;
this.gotoAndStop("left");
}
} else {
this.xDist = true;
}
if (Math.abs(this._y - ctnrRoot[ctnrRoot.crtRole]._y) > 5) {
if (this._y < ctnrRoot[ctnrRoot.crtRole]._y) {
this._y = this._y + 5;
} else {
this._y = this._y - 5;
}
} else {
this.yDist = true;
}
if (this.xDist && (this.yDist)) {
ctnrRoot[ctnrRoot.crtRole].gotoAndStop("stop");
this.crtTask = "fight";
this.gotoAndStop("fight");
ctnrRoot.deadCtrl.onEnterFrame = ctnrRoot.deadCtrl.orgnEnterFrame;
}
}
if (this.crtTask == "changeRoom") {
if (ctnrRoot.enemy31._visible == true) {
this.crtTask = "hide";
this._visible = false;
this.onEnterFrame = null;
this.gotoAndStop("none");
ctnrRoot.enemy31.onEnterFrame = ctnrRoot.enemy31.orgnEnterFrame;
ctnrRoot.enemy31.crtTask = "phone";
return(undefined);
}
if (Math.abs(this._x - ctnrRoot.trg32_1._x) > 5) {
if (this._x < ctnrRoot.trg32_1._x) {
this._x = this._x + 5;
this.gotoAndStop("right");
} else {
this._x = this._x - 5;
this.gotoAndStop("left");
}
} else {
this.xDist = true;
}
if (this.xDist) {
ctnrRoot.doorH3_12.gotoAndPlay("2L");
ctnrRoot.doorH3_12.mDoor.gotoAndPlay(2);
this.crtTask = "hide";
this._visible = false;
this.onEnterFrame = null;
this.gotoAndStop("none");
ctnrRoot.enemy31.onEnterFrame = ctnrRoot.enemy31.orgnEnterFrame;
ctnrRoot.enemy31.crtTask = "phone";
ctnrRoot.enemy31._visible = true;
}
}
};
enemy31.orgnEnterFrame = function () {
if (this.crtTask == "hide") {
this.onEnterFrame = null;
return(undefined);
}
if (this.crtTask == "phone") {
if (Math.abs(this._x - ctnrRoot.phone._x) > 5) {
if (this._x < ctnrRoot.phone._x) {
this._x = this._x + 5;
this.gotoAndStop("right");
} else {
this._x = this._x - 5;
this.gotoAndStop("left");
}
} else {
this.xDist = true;
}
if (Math.abs(this._y - 1261) > 5) {
this._y = this._y - 5;
} else {
this.yDist = true;
}
if (this.xDist && (this.yDist)) {
this._visible = false;
this.gotoAndStop("none");
this.crtTask = "receiveCall";
ctnrRoot.phone.gotoAndStop(1);
}
return(undefined);
}
if (this.crtTask == "receiveCall") {
if (ctnrRoot.phone._currentframe != 94) {
ctnrRoot.phone.nextFrame();
} else {
this.crtTask = "gard";
this._visible = true;
this.gotoAndStop("none");
if (ctnrRoot[ctnrRoot.crtRole].crtHouse != "house31") {
this.onEnterFrame = null;
}
}
return(undefined);
}
if (this.crtTask == "gard") {
this.xDist = (this.yDist = false);
if (ctnrRoot.roleMoveCtrl.ctrlAble == true) {
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole].gotoAndStop("cry");
}
if (Math.abs(this._x - ctnrRoot[ctnrRoot.crtRole]._x) > 5) {
if (this._x < ctnrRoot[ctnrRoot.crtRole]._x) {
this._x = this._x + 5;
this.gotoAndStop("right");
} else {
this._x = this._x - 5;
this.gotoAndStop("left");
}
} else {
this.xDist = true;
}
if (Math.abs(this._y - ctnrRoot[ctnrRoot.crtRole]._y) > 5) {
if (this._y < ctnrRoot[ctnrRoot.crtRole]._y) {
this._y = this._y + 5;
} else {
this._y = this._y - 5;
}
} else {
this.yDist = true;
}
if (this.xDist && (this.yDist)) {
ctnrRoot[ctnrRoot.crtRole].gotoAndStop("stop");
this.gotoAndStop("fight");
ctnrRoot.deadCtrl.onEnterFrame = ctnrRoot.deadCtrl.orgnEnterFrame;
}
}
};
enemy21.orgnEnterFrame = function () {
this.xDist = false;
this.yDist = false;
if (ctnrRoot.roleMoveCtrl.ctrlAble == true) {
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole].gotoAndStop("cry");
}
if (Math.abs(this._x - ctnrRoot[ctnrRoot.crtRole]._x) > 5) {
if (this._x < ctnrRoot[ctnrRoot.crtRole]._x) {
this._x = this._x + 5;
this.gotoAndStop("right");
} else {
this._x = this._x - 5;
this.gotoAndStop("left");
}
} else {
this.xDist = true;
}
if (Math.abs(this._y - ctnrRoot[ctnrRoot.crtRole]._y) > 5) {
if (this._y < ctnrRoot[ctnrRoot.crtRole]._y) {
this._y = this._y + 5;
} else {
this._y = this._y - 5;
}
} else {
this.yDist = true;
}
if (this.xDist && (this.yDist)) {
ctnrRoot[ctnrRoot.crtRole].gotoAndStop("stop");
this.gotoAndStop("fight");
ctnrRoot.deadCtrl.onEnterFrame = ctnrRoot.deadCtrl.orgnEnterFrame;
}
};
enemy11.orgnEnterFrame = function () {
this.xDist = false;
this.yDist = false;
if (ctnrRoot.heavy11.moveCnt != ctnrRoot.heavy11.moveMax) {
return(undefined);
}
if (ctnrRoot.roleMoveCtrl.ctrlAble == true) {
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole].gotoAndStop("cry");
}
if (Math.abs(this._x - ctnrRoot[ctnrRoot.crtRole]._x) > 5) {
if (this._x < ctnrRoot[ctnrRoot.crtRole]._x) {
this._x = this._x + 5;
this.gotoAndStop("right");
} else {
this._x = this._x - 5;
this.gotoAndStop("left");
}
} else {
this.xDist = true;
}
if (Math.abs(this._y - ctnrRoot[ctnrRoot.crtRole]._y) > 5) {
if (this._y < ctnrRoot[ctnrRoot.crtRole]._y) {
this._y = this._y + 5;
} else {
this._y = this._y - 5;
}
} else {
this.yDist = true;
}
if (this.xDist && (this.yDist)) {
ctnrRoot[ctnrRoot.crtRole].gotoAndStop("stop");
this.gotoAndStop("fight");
ctnrRoot.deadCtrl.onEnterFrame = ctnrRoot.deadCtrl.orgnEnterFrame;
}
};
function finishInit() {
enemy32over = false;
enemy31over = false;
enemy11over = false;
enemy21over = false;
heavy11over = false;
heavy52over = false;
heavy42over = false;
woodover = false;
rope1over = false;
numberover = false;
flowerover = false;
dogover = false;
steelDoorover = false;
pipeHeadover = false;
}
function usePropRltInit() {
ctnrRoot.key1.rec = new Array("lock14", "any", "1", "unlock");
ctnrRoot.tele.rec = new Array("none", "any", "n", "clip");
ctnrRoot.fBullet.rec = new Array("bulletRlt", "any", "2", "shot");
ctnrRoot.number.rec = new Array("pipe2", "role1", "1", "generate");
ctnrRoot.axe.rec = new Array("wood", "role3", "1", "clip");
ctnrRoot.key2.rec = new Array("lock22", "any", "1", "unlock");
ctnrRoot.card.rec = new Array("cardReader", "any", "1", "unlock");
var _local1 = new Array("shotPlace23", "shotPlace11", "shotPlace32");
}
function unlockPropInit() {
ctnrRoot.lock14.func = new Array("unlock", "doorH1_34", "unDisapear", "none");
ctnrRoot.lock22.func = new Array("unlock", "doorH2_23", "unDisapear", "none");
ctnrRoot.cardReader.func = new Array("unlock", "doorH1_23", "unDisapear", "none");
ctnrRoot.wood.isFinish = false;
}
function eventPropInit() {
pipeHead.rec = new Array("role3", "eventPipeHead");
rope1.rec = new Array("role1", "eventRope1");
flower.rec = new Array("role3", "eventFlower");
power.rec = new Array("any", "eventPower");
tele.func = new Array("any", "eventTeleCall");
axe.func = new Array("role3", "eventAxe");
ctnrRoot._parent.teleCall._visible = false;
}
function generatePropInit() {
number2.rec = new Array("none", "role2", "n", "clip");
number2.func = new Array("role2", "eventNumber2View");
pipe2.rec = new Array("role1", "generateNumber2", "disapear");
number2._visible = false;
}
function eventPipeHead() {
ctnrRoot.pipeHead.onEnterFrame = null;
ctnrRoot.pipeHead.unloadMovie();
ctnrRoot.openPipeHead.gotoAndPlay(2);
ctnrRoot.role3._visible = false;
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.house53.propAry.push("trg53_2");
_global.score = _global.score + 150;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
ctnrRoot.pipeHeadover = true;
}
function eventRope1() {
ctnrRoot.rope1.onEnterFrame = null;
ctnrRoot.rope1.unloadMovie();
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.role1._visible = false;
ctnrRoot.throwRope.gotoAndPlay(2);
_global.score = _global.score + 100;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
ctnrRoot.rope1over = true;
}
function eventFlower() {
ctnrRoot.flower0.unloadMovie();
ctnrRoot.flower.onEnterFrame = null;
ctnrRoot.flower.unloadMovie();
ctnrRoot.flowerClip.gotoAndPlay(2);
ctnrRoot.role3._visible = false;
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.globalView();
_global.score = _global.score + 180;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
ctnrRoot.flowerover = true;
}
function eventAxe() {
if (ctnrRoot.wood.isFinish == false) {
ctnrRoot.wood.isFinish = true;
ctnrRoot.wood.onEnterFrame = null;
ctnrRoot.wood.unloadMovie();
ctnrRoot.role3._visible = false;
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot._parent.dropTool("axe");
ctnrRoot.axe.unloadMovie();
ctnrRoot.axeMV.gotoAndPlay(2);
_global.score = _global.score + 150;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
ctnrRoot.woodover = true;
}
}
function generateNumber2() {
ctnrRoot.globalView();
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.number2Fall.gotoAndPlay(2);
ctnrRoot._parent.dropTool("number");
ctnrRoot.number.unloadMovie();
_global.score = _global.score + 300;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
ctnrRoot.numberover = true;
}
function eventNumber2View() {
ctnrRoot._parent.viewNumber2Mc.gotoAndPlay(2);
ctnrRoot._parent.teleCall._visible = false;
}
function eventTeleCall() {
ctnrRoot._parent.teleCall._visible = true;
ctnrRoot._parent.teleCall.numInput.text = "";
ctnrRoot._parent.viewNumber2Mc.gotoAndStop(1);
}
function eventshotPlace23() {
if (ctnrRoot.steelDoor._currentframe == 1) {
ctnrRoot.shotPlace23MV.gotoAndPlay(2);
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.role2._visible = false;
_global.score = _global.score + 180;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
ctnrRoot.steelDoorover = true;
}
}
function eventshotPlace11() {
if (ctnrRoot.wire11._currentframe == 1) {
ctnrRoot.shotPlace11MV.gotoAndPlay(2);
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.role2._visible = false;
ctnrRoot.globalView();
}
}
function eventshotPlace32() {
if (ctnrRoot.dog._currentframe == 1) {
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.role2._visible = false;
ctnrRoot.shotPlace32MV.gotoAndPlay(2);
ctnrRoot.dog._visible = false;
ctnrRoot.camaraMoveCtrl.moveKind = "dog";
ctnrRoot.camaraMoveCtrl.onEnterFrame = ctnrRoot.camaraMoveCtrl.orgnEnterFrame;
_global.score = _global.score + 200;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
ctnrRoot.dogover = true;
ctnrRoot.delHousePropAry("house33", "dog");
}
}
function eventPower() {
trace("function event power");
trace("power is open in eventfunction --------" + ctnrRoot.power.isOpen);
if (ctnrRoot.power.isOpen == true) {
if (ctnrRoot.wire11._currentframe == 2) {
ctnrRoot.eleWater11.eleMc._visible = false;
}
ctnrRoot.wire11.eleMc._visible = false;
ctnrRoot.wire11.eleSd.gotoAndStop(1);
ctnrRoot.power.isOpen = false;
ctnrRoot.power.gotoAndStop(1);
} else {
trace("power is off,so set it on wire11 crt frame :" + ctnrRoot.wire11._currentframe);
if (ctnrRoot.wire11._currentframe == 2) {
ctnrRoot.eleWater11.eleMc._visible = true;
ctnrRoot.wire11.eleMc._visible = true;
if (ctnrRoot.enemy11over == false) {
ctnrRoot.enemy11.unloadMovie();
ctnrRoot.enemy11Dead._visible = true;
ctnrRoot.enemy11Dead.gotoAndPlay(2);
ctnrRoot.enemy11over = true;
ctnrRoot.globalView();
_global.score = _global.score + 300;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
}
}
ctnrRoot.wire11.eleMc._visible = true;
_global.gameRoot.sndCtrl.playSound("electricSnd");
ctnrRoot.power.gotoAndStop(2);
ctnrRoot.power.isOpen = true;
ctnrRoot.wire11.eleSd.gotoAndStop(2);
}
}
function propCommentInit() {
ctnrRoot.lock14.commentTxt = "This lock opens the door";
ctnrRoot.lock22.commentTxt = "This lock opens the door";
ctnrRoot.wood.commentTxt = "Wooden planks are blocking the door!";
ctnrRoot.cardReader.commentTxt = "This opens the door.";
ctnrRoot.flower.commentTxt = "This plant is too heavy to lift.";
ctnrRoot.phone.commentTxt = "Oooh, telephone!";
ctnrRoot.pipe2.commentTxt = "Air pipe - something small will fit inside!";
ctnrRoot.pipeHead.commentTxt = "An air vent, I am too big to enter.";
ctnrRoot.power.commentTxt = "Operate the power switch";
ctnrRoot.dogHole.commentTxt = "o-oh! That's a big dog!";
ctnrRoot.wood44.commentTxt = "Wooden planks are blocking the door!";
}
function debug() {
ctnrRoot.house52.propAry.push("number2");
ctnrRoot.number2._visible = true;
house51.propAry = new Array("key1", "trg51_1", "trg51_2", "trg51_3");
house52.propAry = new Array("trg52_1", "trg52_2");
house42.propAry = new Array("trg42_1", "trg42_2", "trg42_3");
house53.propAry = new Array("trg53_1", "tele", "trg53_2");
house44.propAry = new Array("trg44_1");
house23.propAry = new Array("trg23_1", "trg23_2", "card", "steelDoor");
house32.propAry = new Array("trg32_1", "trg32_2", "trg32_3", "axe", "dogHole");
house12.propAry.push("card");
pipe3.accessable = true;
doorH5_12.accessable = true;
doorH2_23.accessable = true;
ctnrRoot.wood.onEnterFrame = null;
ctnrRoot.rolesInit("role3", "house12");
}
unlockPropInit();
usePropRltInit();
eventPropInit();
generatePropInit();
propCommentInit();
function localView() {
trace("localview" + ctnrRoot.roleMoveCtrl.crtRole);
ctnrRoot.zoomCtrl.onEnterFrame = ctnrRoot.zoomCtrl.orgnEnterFrame;
ctnrRoot.zoomCtrl.crtTask = "localView";
_global.isZooming = true;
if (ctnrRoot.roleMoveCtrl.crtRole == "none") {
ctnrRoot.zoomCtrl.px = -(ctnrRoot.role1._x - 350);
ctnrRoot.zoomCtrl.py = -(ctnrRoot.role1._y - 350);
} else {
ctnrRoot.zoomCtrl.px = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._x - 350);
ctnrRoot.zoomCtrl.py = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._y - 350);
}
}
function globalView() {
_global.isZooming = true;
ctnrRoot.zoomCtrl.onEnterFrame = ctnrRoot.zoomCtrl.orgnEnterFrame;
ctnrRoot.zoomCtrl.crtTask = "globalView";
}
function setCamara() {
if ((ctnrRoot._xscale != 100) || (ctnrRoot._yscale != 100)) {
return(undefined);
}
ctnrRoot._parent.container._x = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._x - 350);
ctnrRoot._parent.container._y = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._y - 350);
}
if (camaraMoveCtrl) {
trace("find a camaraMoveCtrl should be killed");
this.camaraMoveCtrl.removeMovieClip();
}
this.createEmptyMovieClip("camaraMoveCtrl", this.getNextHighestDepth());
camaraMoveCtrl.crtTask = "none";
camaraMoveCtrl.speed = 8;
camaraMoveCtrl.moveKind = "none";
camaraMoveCtrl.orgnEnterFrame = function () {
if ((ctnrRoot._xscale != 100) || (ctnrRoot._yscale != 100)) {
this.onEnterFrame = null;
return(undefined);
}
camaraX = (camaraY = false);
containerX = ctnrRoot._parent.container._x;
containerY = ctnrRoot._parent.container._y;
switch (this.moveKind) {
case "trg" :
relationX = -(ctnrRoot[rltTrg]._x - 350);
relationY = -(ctnrRoot[rltTrg]._y - 350);
break;
case "role" :
relationX = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._x - 350);
relationY = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._y - 350);
break;
case "dog" :
relationX = -(ctnrRoot.dog._x - 350);
relationY = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._y - 350);
}
if (containerX != relationX) {
if (Math.abs(containerX - relationX) > this.speed) {
if (containerX < relationX) {
ctnrRoot._parent.container._x = ctnrRoot._parent.container._x + this.speed;
} else if (containerX > relationX) {
ctnrRoot._parent.container._x = ctnrRoot._parent.container._x - this.speed;
}
}
}
if (containerY != ralationY) {
if (Math.abs(containerY - relationY) > this.speed) {
if (containerY < relationY) {
ctnrRoot._parent.container._y = ctnrRoot._parent.container._y + this.speed;
} else if (containerY > relationY) {
ctnrRoot._parent.container._y = ctnrRoot._parent.container._y - this.speed;
}
}
}
if ((Math.abs(containerX - relationX) < this.speed) && (Math.abs(containerY - relationY) < this.speed)) {
this.onEnterFrame = null;
}
};
this.createEmptyMovieClip("zoomCtrl", this.getNextHighestDepth());
zoomCtrl.crtTask = "none";
zoomCtrl.timeCnt = ctnrRoot.shouldTimeCnt;
zoomCtrl.timeMax = 20;
zoomCtrl.px = null;
zoomCtrl.py = null;
zoomCtrl.orgnEnterFrame = function () {
switch (this.crtTask) {
case "localView" :
if (ctnrRoot._parent.container._xscale < 100) {
ctnrRoot._parent.container._xscale = (ctnrRoot._parent.container._yscale = ctnrRoot._parent.container._yscale + 4);
if (ctnrRoot._parent.container._x < this.px) {
ctnrRoot._parent.container._x = ctnrRoot._parent.container._x + ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._x - this.px));
} else {
ctnrRoot._parent.container._x = ctnrRoot._parent.container._x - ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._x - this.px));
}
if (ctnrRoot._parent.container._y < this.py) {
ctnrRoot._parent.container._y = ctnrRoot._parent.container._y + ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._y - this.py));
} else {
ctnrRoot._parent.container._y = ctnrRoot._parent.container._y - ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._y - this.py));
}
}
this.timeCnt--;
if (this.timeCnt == 1) {
ctnrRoot._parent.container._xscale = (ctnrRoot._parent.container._yscale = 100);
ctnrRoot._parent.container._y = this.py;
ctnrRoot._parent.container._x = this.px;
_global.isZooming = false;
this.crtTask = "none";
this.timeCnt = ctnrRoot.shouldTimeCnt;
this.onEnterFrame = null;
}
break;
case "globalView" :
if (ctnrRoot._parent.container._xscale > 24) {
ctnrRoot._parent.container._xscale = (ctnrRoot._parent.container._yscale = ctnrRoot._parent.container._yscale - 4);
if (ctnrRoot._parent.container._x < 120) {
ctnrRoot._parent.container._x = ctnrRoot._parent.container._x + ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._x - 120));
} else {
ctnrRoot._parent.container._x = ctnrRoot._parent.container._x - ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._x - 120));
}
if (ctnrRoot._parent.container._y < 0) {
ctnrRoot._parent.container._y = ctnrRoot._parent.container._y + ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._y - 0));
} else {
ctnrRoot._parent.container._y = ctnrRoot._parent.container._y - ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._y - 0));
}
}
this.timeCnt--;
if (this.timeCnt != 1) {
break;
}
ctnrRoot._parent.container._xscale = (ctnrRoot._parent.container._yscale = ctnrRoot.shouldScale);
ctnrRoot._parent.container._y = 0;
ctnrRoot._parent.container._x = 120;
_global.isZooming = false;
this.crtTask = "none";
this.timeCnt = ctnrRoot.shouldTimeCnt;
this.onEnterFrame = null;
}
};
this.deadCtrl.removeMovieClip();
this.createEmptyMovieClip("deadCtrl", this.getNextHighestDepth());
deadCtrl.timeCnt = 0;
deadCtrl.timeMax = 80;
deadCtrl.orgnEnterFrame = function () {
if (this.timeCnt < this.timeMax) {
this.timeCnt++;
} else {
_root.gotoAndPlay("losePage");
this.timeCnt = 0;
this.onEnterFrame = null;
}
};
function stageRestart() {
ctnrRoot.housePropInitAll();
ctnrRoot.accessInit();
ctnrRoot.rolesInitAll();
ctnrRoot.clearToolIDCT();
ctnrRoot.propEnterFrameInit();
ctnrRoot.unlockPropInit();
ctnrRoot.usePropRltInit();
ctnrRoot.eventPropInit();
ctnrRoot.generatePropInit();
ctnrRoot.finishInit();
ctnrRoot.deadCtrl.onEnterFrame = null;
_global.gameRoot._quality = _global.visualQlt;
ctnrRoot.globalView();
_global.isZooming = false;
ctnrRoot.propPressInit();
}
power.isOpen = false;
stageRestart();
trace(_global.loadGame);
if (_global.loadGame == true) {
trace("should load game");
ctnrRoot.firstIns.unloadMovie();
_global.gameRoot.loadData();
_global.gameRoot.startClock();
} else {
trace("don't load");
_global.gameRoot.cover.unloadMovie();
_global.gameDat.clear();
if (!_global.isFirstGame) {
ctnrRoot.roleMoveCtrl.ctrlAble = false;
_global.isFirstGame = "no";
} else {
ctnrRoot.firstIns.unloadMovie();
_global.gameRoot.startClock();
}
}
Symbol 788 MovieClip Frame 1
stop();
Symbol 788 MovieClip Frame 2
stop();
this.phoneNumTa.text = this._parent.teleCall.numTxt;
closeBtn.onPress = function () {
gotoAndStop (1);
};
Symbol 838 MovieClip Frame 1
QLOW.onPress = function () {
_global.visualQlt = "LOW";
_global.gameRoot._quality = "LOW";
this._parent._visible = false;
};
QMEDIUM.onPress = function () {
_global.visualQlt = "MEDIUM";
_global.gameRoot._quality = "MEDIUM";
this._parent._visible = false;
};
QHIGH.onPress = function () {
_global.visualQlt = "HIGH";
_global.gameRoot._quality = "HIGH";
this._parent._visible = false;
};
QBEST.onPress = function () {
_global.visualQlt = "BEST";
_global.gameRoot._quality = "BEST";
this._parent._visible = false;
};
Symbol 854 MovieClip Frame 1
stop();
Symbol 870 MovieClip Frame 1
stop();
Symbol 891 MovieClip Frame 1
function phoneInit() {
i = 0;
while (i <= 9) {
this["btn" + i].onPress = function () {
this._parent.numInput.text = this._parent.numInput.text + this._name.substr(3, 1);
_global.gameRoot.sndCtrl.playSound("telePressSnd");
};
i++;
}
this.btn10.onPress = function () {
this._parent.numInput.text = this._parent.numInput.text + "*";
_global.gameRoot.sndCtrl.playSound("telePressSnd");
};
this.btn11.onPress = function () {
this._parent.numInput.text = this._parent.numInput.text + "#";
_global.gameRoot.sndCtrl.playSound("telePressSnd");
};
this.btnClear.onPress = function () {
str = this._parent.numInput.text;
len = this._parent.numInput.text.length;
str2 = str.substr(0, len - 1);
this._parent.numInput.text = str2;
_global.gameRoot.sndCtrl.playSound("telePressSnd");
};
this.numTxt = String(Math.random()).substr(2, 8);
trace(this.numTxt);
}
closeBtn.onPress = function () {
this._parent._visible = false;
};
phoneBtn.onPress = function () {
if (this._parent.numInput.text == this._parent.numTxt) {
_parent.stageRoot.container.globalView();
_parent.stageRoot.container.phoneRing.gotoAndPlay("ring");
if (_global.gameRoot.container.enemy32._visible == true) {
_global.score = _global.score + 280;
_parent.stateRoleSele.scoreTxt.text = _global.score;
}
this._parent._visible = false;
} else {
trace("you num is not right");
}
this._parent.phoneCon.start();
};
phoneInit();
Symbol 903 MovieClip Frame 1
stop();
Symbol 903 MovieClip Frame 2
yesBtn._visible = (noBtn._visible = (txt._visible = true));
saveProgress._visible = false;
yesBtn.onPress = function () {
yesBtn._visible = (noBtn._visible = (txt._visible = false));
this._parent.gotoAndPlay(3);
};
noBtn.onPress = function () {
_global.gameRoot.container.roleMoveCtrl.ctrlAble = true;
_global.gameRoot.saveMc.gotoAndStop(1);
};
back.onPress = function () {
};
back.useHandCursor = false;
stop();
Symbol 903 MovieClip Frame 5
_global.gameRoot.saveData();
Symbol 903 MovieClip Frame 80
_global.gameRoot.container.roleMoveCtrl.ctrlAble = true;
Symbol 905 MovieClip Frame 1
stop();
Symbol 905 MovieClip Frame 2
yesBtn.onPress = function () {
_global.gameRoot.goMenuMc.gotoAndStop(1);
_global.gameRoot.container.roleMoveCtrl.ctrlAble = true;
Key.removeListener(_global.gameRoot.container.keyListener);
_global.gameRoot.gotoAndStop("firstPage");
};
noBtn.onPress = function () {
_global.gameRoot.container.roleMoveCtrl.ctrlAble = true;
_global.gameRoot.goMenuMc.gotoAndStop(1);
};
back.onPress = function () {
};
back.useHandCursor = false;
stop();
Symbol 953 MovieClip Frame 17
stop();
Symbol 954 MovieClip Frame 1
stop();
Symbol 954 MovieClip Frame 2
door2.gotoAndPlay(2);
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 954 MovieClip Frame 42
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 954 MovieClip Frame 54
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 954 MovieClip Frame 93
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 957 MovieClip Frame 1
stop();
Symbol 957 MovieClip Frame 2
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 957 MovieClip Frame 39
stop();
Symbol 964 MovieClip Frame 1
stop();
Symbol 964 MovieClip Frame 2
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 964 MovieClip Frame 45
stop();
this._parent.localView();
Symbol 967 MovieClip Frame 1
stop();
Symbol 967 MovieClip Frame 2
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 967 MovieClip Frame 50
stop();
this._parent.localView();
Symbol 977 MovieClip Frame 2
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 978 MovieClip Frame 1
stop();
sDoor.stop();
Symbol 978 MovieClip Frame 2
mDoor.gotoAndPlay(2);
Symbol 978 MovieClip Frame 23
mDoor.gotoAndPlay(2);
Symbol 980 MovieClip Frame 1
stop();
sDoor.stop();
Symbol 980 MovieClip Frame 2
mDoor.gotoAndPlay(2);
Symbol 980 MovieClip Frame 23
mDoor.gotoAndPlay(2);
Symbol 981 MovieClip Frame 1
stop();
Symbol 981 MovieClip Frame 2
door2.gotoAndPlay(2);
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 981 MovieClip Frame 42
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 981 MovieClip Frame 53
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 981 MovieClip Frame 93
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 982 MovieClip Frame 1
stop();
Symbol 982 MovieClip Frame 2
door2.gotoAndPlay(2);
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 982 MovieClip Frame 42
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 982 MovieClip Frame 54
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 982 MovieClip Frame 93
_global.gameRoot.sndCtrl.playSound("doorSnd");
Symbol 994 MovieClip Frame 1
stop();
Symbol 995 MovieClip Frame 1
stop();
Symbol 995 MovieClip Frame 70
_global.gameRoot.sndCtrl.playSound("hitSnd");
Symbol 995 MovieClip Frame 95
this._parent.roleMoveCtrl.ctrlAble = true;
this._parent.role2._visible = true;
if (this._parent.autoWallH3._currentframe == 1) {
this._parent.autoWallH3.gotoAndPlay(2);
}
this._parent.autoWallH3.onEnterFrame = null;
this._parent.delHousePropAry("house31", "autoWallH3");
Symbol 996 MovieClip Frame 1
stop();
Symbol 996 MovieClip Frame 58
_global.gameRoot.sndCtrl.playSound("hitSnd");
Symbol 996 MovieClip Frame 77
this._parent.roleMoveCtrl.ctrlAble = true;
this._parent.role2._visible = true;
if (this._parent.steelDoorU._currentframe == 1) {
this._parent.steelDoorU.gotoAndPlay(2);
}
this._parent.steelDoorU.onEnterFrame = null;
this._parent.delHousePropAry("house11", "steelDoorU");
Symbol 997 MovieClip Frame 1
stop();
Symbol 997 MovieClip Frame 54
stop();
this._parent.keyU2._visible = true;
this._parent.house51.propAry.push("keyU2");
this._parent.keyU2.onEnterFrame = this._parent.keyU2.orgnEnterFrame;
this._parent.localView();
this._parent.roleMoveCtrl.ctrlAble = true;
Symbol 1004 MovieClip Frame 1
stop();
Symbol 1004 MovieClip Frame 105
stop();
this._parent.role3._visible = true;
this._parent.roleMoveCtrl.ctrlAble = true;
this._parent.doorH1_12.accessable = true;
Symbol 1005 MovieClip Frame 1
stop();
Symbol 1006 MovieClip Frame 1
stop();
Symbol 1011 MovieClip Frame 1
stop();
Symbol 1011 MovieClip Frame 50
this._parent.role1._visible = true;
this._parent.roleMoveCtrl.ctrlAble = true;
this._parent.steam.gotoAndStop(2);
this._parent.turnplate._visible = true;
Symbol 1019 MovieClip Frame 1
stop();
Symbol 1019 MovieClip Frame 24
_global.gameRoot.sndCtrl.playSound("crashSnd");
Symbol 1019 MovieClip Frame 38
this._parent.role3._visible = true;
this._parent.roleMoveCtrl.ctrlAble = true;
Symbol 1027 MovieClip Frame 1
stop();
Symbol 1027 MovieClip Frame 37
this._parent.role3._visible = true;
this._parent.roleMoveCtrl.ctrlAble = true;
if (this._parent.autoWallH1._currentframe == 1) {
this._parent.autoWallH1.gotoAndPlay(2);
}
this._parent.switch43._visible = true;
Symbol 1071 MovieClip Frame 1
stop();
Symbol 1071 MovieClip Frame 90
this._parent.role3._visible = true;
this._parent.roleMoveCtrl.ctrlAble = true;
this._parent.doorV13.accessable = true;
Symbol 1072 MovieClip Frame 1
var ctnrRoot = this;
shouldScale = 24;
shouldTimeCnt = 19;
winEnd = "gameChapter2Win";
winRoom = "house12";
function setRolesStop() {
i = 1;
while (i <= 3) {
if (ctnrRoot["role" + i].isClimb == false) {
ctnrRoot["role" + i].gotoAndStop("stop");
}
i++;
}
}
function rolePress() {
if (ctnrRoot.crtRole != undefined) {
ctnrRoot.disabledPropOEF(ctnrRoot[crtRole].crtHouse);
ctnrRoot.setRolesStop();
}
ctnrRoot.roleMoveCtrl.crtRole = this._name;
ctnrRoot._parent.stateRoleSele.gotoAndStop(this._name);
ctnrRoot.toolsBoxRefresh(this._name);
ctnrRoot.activatePropOEF(this.crtHouse);
_global.gameRoot.sndCtrl.playSound("seleRoleSnd");
if ((ctnrRoot.crtRole != this._name) && (ctnrRoot._xscale == 100)) {
ctnrRoot.camaraMoveCtrl.onEnterFrame = ctnrRoot.camaraMoveCtrl.orgnEnterFrame;
ctnrRoot.camaraMoveCtrl.moveKind = "role";
}
if (ctnrRoot.isSortRoom()) {
ctnrRoot.roleMoveCtrl.isSortFlag = true;
ctnrRoot.roleDepthSort();
}
if (ctnrRoot._xscale != 100) {
ctnrRoot.localView();
}
}
function roleSay(parRole, ctt) {
ctnrRoot[parRole].roleSay.txtCtt.txt.text = ctt;
ctnrRoot[parRole].roleSay.gotoAndPlay(1);
ctnrRoot[parRole].roleSay.txtCtt._visible = true;
if (ctnrRoot._xscale == 100) {
ctnrRoot[parRole].roleSay._xscale = (ctnrRoot[parRole].roleSay._yscale = 100);
} else {
ctnrRoot[parRole].roleSay._xscale = (ctnrRoot[parRole].roleSay._yscale = 250);
}
}
function clearToolIDCT() {
i = 0;
while (i <= 4) {
ctnrRoot._parent.stateRoleSele["toolIDCT" + i].gotoAndStop("none");
ctnrRoot._parent.stateRoleSele["toolIDCT" + i].crtDispTool = "none";
ctnrRoot._parent.stateRoleSele["toolIDCT" + i]._visible = false;
i++;
}
}
function toolsBoxRefresh(parRole) {
ctnrRoot.clearToolIDCT();
if (ctnrRoot[parRole].toolsAry.length > 0) {
ctnrRoot._parent.stateRoleSele.toolsTxt.text = "";
i = 0;
while (i < ctnrRoot[parRole].toolsAry.length) {
ctnrRoot._parent.stateRoleSele.toolsTxt.text = ctnrRoot._parent.stateRoleSele.toolsTxt.text + (ctnrRoot[parRole].toolsAry[i] + " ");
ctnrRoot._parent.stateRoleSele["toolIDCT" + i]._visible = true;
ctnrRoot._parent.stateRoleSele["toolIDCT" + i].gotoAndStop(ctnrRoot[parRole].toolsAry[i]);
ctnrRoot._parent.stateRoleSele["toolIDCT" + i].crtDispTool = ctnrRoot[parRole].toolsAry[i];
i++;
}
} else {
ctnrRoot._parent.stateRoleSele.toolsTxt.text = "have none tool";
}
}
function rolesInit(rName, rHouse) {
ctnrRoot[rName].onPress = ctnrRoot.rolePress;
ctnrRoot[rName].onRollOver = ctnrRoot.roleRollOver;
ctnrRoot[rName].crtHouse = rHouse;
ctnrRoot[rName].actKind = "none";
ctnrRoot[rName].propNearBy = "none";
ctnrRoot[rName].isNearByProp = false;
ctnrRoot[rName].toolsAry = new Array();
ctnrRoot[rName].toolsAry.splice(0);
ctnrRoot[rName].gotoAndStop("stop");
ctnrRoot[rName].roleSay.txtCtt.txt.text = "";
ctnrRoot[rName].roleSay.txtCtt._visible = false;
ctnrRoot[rName].onEnterFrame = ctnrRoot.roleEnterFrame;
ctnrRoot[rName].hitL._alpha = 0;
ctnrRoot[rName].hitR._alpha = 0;
ctnrRoot[rName].hitU1._alpha = 0;
ctnrRoot[rName].hitU2._alpha = 0;
ctnrRoot[rName].hitD1._alpha = 0;
ctnrRoot[rName].hitD2._alpha = 0;
trace((rName + " depth is ") + ctnrRoot[rName].getDepth());
}
function rolesInitAll() {
rolesInit("role1", "house11");
rolesInit("role2", "house31");
rolesInit("role3", "house54");
}
roleSpeed = 5;
rolesInitAll();
clearToolIDCT();
function disabledRoleSele() {
i = 1;
while (i <= 3) {
ctnrRoot["role" + i].enabled = false;
i++;
}
}
function activateRoleSele() {
i = 1;
while (i <= 3) {
ctnrRoot["role" + i].enabled = true;
i++;
}
}
trace("accessCtrl is exist " + accessCtrl);
if (accessCtrl) {
trace("find a should killed accessCtrl");
this.accessCtrl.removeMovieClip();
}
this.createEmptyMovieClip("accessCtrl", this.getNextHighestDepth());
accessCtrl.ctrlState = "none";
accessCtrl.timeCnt = 0;
accessCtrl.timeMax = 30;
accessCtrl.orgnEnterFrame = function () {
switch (this.ctrlState) {
case "gotoAccess" :
ctnrRoot.disabledRoleSele();
getPosH = (getPosV = false);
if (ctnrRoot[crtRole]._currentframe != 2) {
ctnrRoot[crtRole].gotoAndStop(2);
}
if (Math.abs(ctnrRoot[crtRole]._x - ctnrRoot[accessNearBy]._x) < (2 * ctnrRoot.roleSpeed)) {
getPosH = true;
} else if (ctnrRoot[accessNearBy]._x > ctnrRoot[crtRole]._x) {
ctnrRoot[crtRole]._x = ctnrRoot[crtRole]._x + ctnrRoot.roleSpeed;
} else {
ctnrRoot[crtRole]._x = ctnrRoot[crtRole]._x - ctnrRoot.roleSpeed;
}
if (Math.abs(ctnrRoot[crtRole]._y - ctnrRoot[accessNearBy]._y) < (2 * ctnrRoot.roleSpeed)) {
getPosV = true;
} else if (ctnrRoot[accessNearBy]._y > ctnrRoot[crtRole]._y) {
ctnrRoot[crtRole]._y = ctnrRoot[crtRole]._y + ctnrRoot.roleSpeed;
} else {
ctnrRoot[crtRole]._y = ctnrRoot[crtRole]._y - ctnrRoot.roleSpeed;
}
if (getPosH && (getPosV)) {
this.ctrlState = "playClip";
this.timeCnt = 0;
accessPlay = ctnrRoot[accessNearBy].accessName;
ctnrRoot[accessPlay].gotoAndPlay(ctnrRoot.moveDrct);
ctnrRoot[crtRole]._visible = false;
ctnrRoot.camaraMoveCtrl.onEnterFrame = ctnrRoot.camaraMoveCtrl.orgnEnterFrame;
ctnrRoot.camaraMoveCtrl.moveKind = "trg";
ctnrRoot.roleMoveCtrl.isSortFlag = false;
}
break;
case "playClip" :
if (this.timeCnt < this.timeMax) {
this.timeCnt++;
} else {
ctnrRoot[accessPlay].gotoAndStop(1);
this.ctrlState = "none";
this.onEnterFrame = null;
this.timeCnt = 0;
ctnrRoot[crtRole]._x = ctnrRoot[rltTrg]._x;
ctnrRoot[crtRole]._y = ctnrRoot[rltTrg]._y;
ctnrRoot.disabledPropOEF(ctnrRoot[crtRole].crtHouse);
ctnrRoot[crtRole].crtHouse = ctnrRoot.nextRoom;
ctnrRoot.activatePropOEF(ctnrRoot.nextRoom);
activateRoleSele();
ctnrRoot[crtRole]._visible = true;
ctnrRoot.roleMoveCtrl.ctrlAble = true;
if (ctnrRoot.isSortRoom()) {
ctnrRoot.roleMoveCtrl.isSortFlag = true;
ctnrRoot.roleDepthSort();
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "Buddy! Let's get out of here.");
}
gameChapterWin = true;
i = 1;
while (i <= 3) {
if (ctnrRoot["role" + i].crtHouse != winRoom) {
gameChapterWin = false;
break;
}
i++;
}
if (!gameChapterWin) {
break;
}
_global.loadGame = false;
_global.gameRoot.clearInterval(intervalId);
ctnrRoot._parent.gotoAndPlay(winEnd);
}
}
};
function roleDepthSort() {
ctnrRoot.sortAry.splice(0);
ctnrRoot.sortAry.push({rName:"role1", yPos:ctnrRoot.role1._y});
ctnrRoot.sortAry.push({rName:"role2", yPos:ctnrRoot.role2._y});
ctnrRoot.sortAry.push({rName:"role3", yPos:ctnrRoot.role3._y});
ctnrRoot.sortAry.sortOn("yPos", Array.NUMERIC);
i = 0;
while (i < ctnrRoot.sortAry.length) {
ctnrRoot[ctnrRoot.sortAry[i].rName].swapDepths(ctnrRoot.depthAry[i]);
i++;
}
}
function isSortRoom() {
shouldSort = false;
i = 1;
while (i <= 3) {
if ((ctnrRoot[ctnrRoot.crtRole].crtHouse == ctnrRoot["role" + i].crtHouse) && (ctnrRoot[ctnrRoot.crtRole]._name != ("role" + i))) {
shouldSort = true;
}
i++;
}
return(shouldSort);
}
var sortAry = new Array();
var depthAry = new Array(-15617, -15593, -15562);
function setCtrlKey() {
leftKeyNO = [aryKeyCtrl1[0], aryKeyCtrl2[0]];
rightKeyNO = [aryKeyCtrl1[1], aryKeyCtrl2[1]];
downKeyNO = [aryKeyCtrl1[2], aryKeyCtrl2[2]];
upKeyNO = [aryKeyCtrl1[3], aryKeyCtrl2[3]];
zoomOutNO = [aryKeyCtrl1[4], aryKeyCtrl2[4]];
zoomInNO = [aryKeyCtrl1[5], aryKeyCtrl2[5]];
actNO = [aryKeyCtrl1[6], aryKeyCtrl2[6]];
}
function correctPower() {
trace((("power.isOpen " + ctnrRoot.power.isOpen) + " currentframe ") + ctnrRoot.power._currentframe);
if (ctnrRoot.power.isOpen == true) {
if (ctnrRoot.power._currentframe != 2) {
ctnrRoot.power.gotoAndStop(2);
ctnrRoot.powerLight._visible = true;
}
} else if (ctnrRoot.power._currentframe != 1) {
ctnrRoot.power.gotoAndStop(1);
ctnrRoot.powerlight._visible = false;
}
}
function accessSub(parRole) {
accessNearBy = ctnrRoot[parRole].propNearBy;
moveDrct = ctnrRoot[accessNearBy].accessDrct.substr(0, 2);
nextRoom = "house" + ctnrRoot[accessNearBy].accessDrct.substr(3, 2);
accessName_inSub = ctnrRoot[accessNearBy].accessName;
rltTrg = ctnrRoot[accessNearBy].rlt;
ctnrRoot.accessCtrl.timeMax = ctnrRoot[accessName_inSub].timeCnt;
if (ctnrRoot[accessName_inSub].accessable == false) {
ctnrRoot.roleSay(parRole, "I cannot enter.");
ctnrRoot.doorSd.start();
_global.gameRoot.sndCtrl.playSound("doorSnd");
return(undefined);
}
trace((((ctnrRoot[accessName_inSub].accessRole + " ") + parRole) + " ") + accessName_inSub);
if ((ctnrRoot[accessName_inSub].accessRole != "any") && (ctnrRoot[accessName_inSub].accessRole != parRole)) {
ctnrRoot.roleSay(parRole, "I'm too big to do this.");
return(undefined);
}
if (ctnrRoot.accessCtrl.timeCnt == 0) {
ctnrRoot.accessCtrl.onEnterFrame = ctnrRoot.accessCtrl.orgnEnterFrame;
ctnrRoot.accessCtrl.ctrlState = "gotoAccess";
ctnrRoot.roleMoveCtrl.ctrlAble = false;
}
}
function getPropSub(parRole) {
accessNearBy = ctnrRoot[parRole].propNearBy;
if ((ctnrRoot[accessNearBy].rec[1] == parRole) || (ctnrRoot[accessNearBy].rec[1] == "any")) {
_global.gameRoot.sndCtrl.playSound("getSnd");
ctnrRoot.roleSay(parRole, "Item picked up.");
if (ctnrRoot[parRole].toolsAry.length >= 5) {
ctnrRoot.roleSay(parRole, "I can't take any more.");
return(undefined);
}
i = 0;
while (i < ctnrRoot[parRole].toolsAry.length) {
if (ctnrRoot[parRole].toolsAry[i] == accessNearBy) {
trace("has the tool yet");
return(undefined);
}
i++;
}
ctnrRoot.delHousePropAry(ctnrRoot[parRole].crtHouse, accessNearBy);
ctnrRoot[parRole].toolsAry.push(accessNearBy);
ctnrRoot.toolsBoxRefresh(parRole);
ctnrRoot[accessNearBy]._visible = false;
ctnrRoot[accessNearBy].onEnterFrame = null;
housePropAry = ctnrRoot[ctnrRoot[parRole].crtHouse].propAry;
i = 0;
while (i < housePropAry.length) {
if (housePropAry[i] == accessNearBy) {
housePropAry.splice(i, 1);
}
i++;
}
} else {
ctnrRoot.roleSay(parRole, "I don't need it");
}
}
function usePropSub(parRole) {
usePropNearBy = ctnrRoot[parRole].propNearBy;
operator = ctnrRoot[usePropNearBy].rec[0];
trace((((usePropNearBy + " ") + operator) + " == ") + parRole);
if ((operator == parRole) || (operator == "any")) {
trace(ctnrRoot[usePropNearBy].rec[1] + "()");
ctnrRoot[ctnrRoot[usePropNearBy].rec[1]].apply(null);
}
}
ctnrRoot.roleMoveCtrl.removeMovieClip();
ctnrRoot.createEmptyMovieClip("roleMoveCtrl", ctnrRoot.getNextHighestDepth());
ctnrRoot.roleMoveCtrl.crtRole = "none";
ctnrRoot.roleMoveCtrl.ctrlAble = true;
ctnrRoot.roleMoveCtrl.isPush = false;
ctnrRoot.roleMoveCtrl.moveDrct = "none";
ctnrRoot.roleMoveCtrl.crtPressKeyCode = "none";
ctnrRoot.roleMoveCtrl.isSortFlag = false;
var aryKeyCtrl1 = new Array(65, 68, 83, 87, 88, 67, 32);
var aryKeyCtrl2 = new Array(37, 39, 40, 38, 97, 98, 96);
var aryKey = new Array();
setCtrlKey();
ctnrRoot.roleMoveCtrl.onEnterFrame = function () {
if ((this.crtRole == "none") || (this.ctrlAble == false)) {
return(undefined);
}
crtHouse = "hb" + ctnrRoot[this.crtRole].crtHouse.substr(5, 2);
houseLeft = ctnrRoot[crtHouse]._x + ctnrRoot.marginH;
houseRight = (ctnrRoot[crtHouse]._x + ctnrRoot[crtHouse]._width) - ctnrRoot.marginH;
houseBottom = (ctnrRoot[crtHouse]._y + ctnrRoot[crtHouse]._height) - ctnrRoot.marginBtm;
houseTop = (houseBottom - ctnrRoot.houseTopAt) + ctnrRoot.marginTop;
if (Key.isDown(leftKeyNO[0]) || (Key.isDown(leftKeyNO[1]))) {
if (this.isPush == false) {
ctnrRoot[this.crtRole].gotoAndStop("Left");
} else {
ctnrRoot[this.crtRole].gotoAndStop("pushL");
}
if (ctnrRoot[this.crtRole]._x > houseLeft) {
if ((ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "any") || (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "x")) {
ctnrRoot[this.crtRole]._x = ctnrRoot[this.crtRole]._x - ctnrRoot.roleSpeed;
}
if (this.isSortFlag) {
ctnrRoot.roleDepthSort();
}
}
this.moveDrct = "L";
ctnrRoot.setCamara();
return(undefined);
}
if (Key.isDown(rightKeyNO[0]) || (Key.isDown(rightKeyNO[1]))) {
if (this.isPush == false) {
ctnrRoot[this.crtRole].gotoAndStop("right");
} else {
ctnrRoot[this.crtRole].gotoAndStop("pushR");
}
if (ctnrRoot[this.crtRole]._x < houseRight) {
if ((ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "any") || (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "x")) {
ctnrRoot[this.crtRole]._x = ctnrRoot[this.crtRole]._x + ctnrRoot.roleSpeed;
}
if (this.isSortFlag) {
ctnrRoot.roleDepthSort();
}
}
this.moveDrct = "R";
ctnrRoot.setCamara();
return(undefined);
}
if (Key.isDown(downKeyNO[0]) || (Key.isDown(downKeyNO[1]))) {
if (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "any") {
ctnrRoot[this.crtRole].gotoAndStop("down");
ctnrRoot[this.crtRole].isClimb = false;
} else if (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "y") {
ctnrRoot[this.crtRole].gotoAndStop("climb");
ctnrRoot[this.crtRole].isClimb = true;
}
if (ctnrRoot[this.crtRole]._y < houseBottom) {
if ((ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "any") || (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "y")) {
ctnrRoot[this.crtRole]._y = ctnrRoot[this.crtRole]._y + ctnrRoot.roleSpeed;
}
if (this.isSortFlag) {
ctnrRoot.roleDepthSort();
}
}
this.moveDrct = "D";
ctnrRoot.setCamara();
return(undefined);
}
if (Key.isDown(upKeyNO[0]) || (Key.isDown(upKeyNO[1]))) {
if (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "any") {
ctnrRoot[this.crtRole].gotoAndStop("up");
ctnrRoot[this.crtRole].isClimb = false;
} else if (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "y") {
ctnrRoot[this.crtRole].gotoAndStop("climb");
ctnrRoot[this.crtRole].isClimb = true;
}
if (ctnrRoot[this.crtRole]._y > houseTop) {
if ((ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "any") || (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "y")) {
ctnrRoot[this.crtRole]._y = ctnrRoot[this.crtRole]._y - ctnrRoot.roleSpeed;
}
if (this.isSortFlag) {
ctnrRoot.roleDepthSort();
}
}
this.moveDrct = "U";
ctnrRoot.setCamara();
return(undefined);
}
if (ctnrRoot[ctnrRoot[ctnrRoot.crtRole].crtHouse].axis == "y") {
ctnrRoot[this.crtRole].gotoAndStop("stopBack");
} else {
ctnrRoot[this.crtRole].gotoAndStop("stop");
}
this.crtPressKeyCode = "none";
};
if (keyListener == undefined) {
var keyListener = new Object();
keyListener.onKeyDown = function () {
if ((Key.getCode() == actNO[0]) || (Key.getCode() == actNO[1])) {
ctnrRoot.correctPower();
if (ctnrRoot.roleMoveCtrl.ctrlAble == false) {
return(undefined);
}
crtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (ctnrRoot[crtRole].isNearByProp == true) {
trace(ctnrRoot[crtRole].actKind);
switch (ctnrRoot[crtRole].actKind) {
case "getProp" :
ctnrRoot.getPropSub(crtRole);
break;
case "access" :
ctnrRoot.accessSub(crtRole);
break;
case "moveHeavy" :
break;
case "useProp" :
trace("should use a prop :" + ctnrRoot[crtRole].propNearBy);
sayCtt = ctnrRoot[ctnrRoot[crtRole].propNearBy].commentTxt;
sayCttF = ((sayCtt == undefined) ? "oh!!!?" : (sayCtt));
ctnrRoot.roleSay(crtRole, sayCttF);
ctnrRoot.usePropSub(crtRole);
break;
case "watch" :
sayCtt = ctnrRoot[ctnrRoot[crtRole].propNearBy].commentTxt;
sayCttF = ((sayCtt == undefined) ? "!'O'!" : (sayCtt));
ctnrRoot.roleSay(crtRole, sayCttF);
}
} else {
sayCttF = "Nothing here";
ctnrRoot.roleSay(crtRole, sayCttF);
}
return(undefined);
}
if (((Key.getCode() == zoomOutNO[0]) || (Key.getCode() == zoomOutNO[1])) && (ctnrRoot._parent.container._xscale == 100)) {
ctnrRoot.globalView();
return(undefined);
}
if (((Key.getCode() == zoomInNO[0]) || (Key.getCode() == zoomInNO[1])) && (ctnrRoot._parent.container._xscale == ctnrRoot.shouldScale)) {
ctnrRoot.localView();
return(undefined);
}
};
keyListener.onKeyUp = function () {
if ((Key.getCode() == actNO[0]) || (Key.getCode() == actNO[1])) {
ctnrRoot.clearPropNearBy();
}
i = 0;
while (i < ctnrRoot.aryKey.length) {
if (Key.getCode() == ctnrRoot.aryKey[i]) {
ctnrRoot.roleMoveCtrl.isPush = false;
if (String(Key.getCode()) == ctnrRoot.roleMoveCtrl.crtPressKeyCode) {
ctnrRoot.roleMoveCtrl.crtPressKeyCode = "none";
}
}
i++;
}
};
}
Key.addListener(keyListener);
function roomHitOrgn() {
if (_global.isZooming == false) {
var _local8 = {x:0, y:0};
var _local3 = {x:0, y:0};
var _local7 = {x:0, y:0};
var _local5 = {x:0, y:0};
var _local6 = {x:0, y:0};
var _local4 = {x:0, y:0};
ctnrRoot[ctnrRoot.crtRole].hitL.localToGlobal(_local8);
ctnrRoot[ctnrRoot.crtRole].hitR.localToGlobal(_local3);
ctnrRoot[ctnrRoot.crtRole].hitU1.localToGlobal(_local7);
ctnrRoot[ctnrRoot.crtRole].hitU2.localToGlobal(_local5);
ctnrRoot[ctnrRoot.crtRole].hitD1.localToGlobal(_local6);
ctnrRoot[ctnrRoot.crtRole].hitD2.localToGlobal(_local4);
if (this.hitTest(_local8.x, _local8.y, true)) {
ctnrRoot[crtRole]._x = ctnrRoot[crtRole]._x + ctnrRoot.roleSpeed;
trace("hit area /L");
}
if (this.hitTest(_local3.x, _local3.y, true)) {
ctnrRoot[crtRole]._x = ctnrRoot[crtRole]._x - ctnrRoot.roleSpeed;
trace("hit area R");
}
if (this.hitTest(_local7.x, _local7.y, true) || (this.hitTest(_local5.x, _local5.y, true))) {
ctnrRoot[crtRole]._y = ctnrRoot[crtRole]._y + ctnrRoot.roleSpeed;
trace("hit area U");
}
if (this.hitTest(_local6.x, _local6.y, true) || (this.hitTest(_local4.x, _local4.y, true))) {
ctnrRoot[crtRole]._y = ctnrRoot[crtRole]._y - ctnrRoot.roleSpeed;
trace("hit area D");
}
}
}
function roomHitInit() {
i = 0;
while (i < roomHitAry.length) {
ctnrRoot[roomHitAry[i]].orgnEnterFrame = ctnrRoot.roomHitOrgn;
ctnrRoot[roomHitAry[i]]._alpha = 0;
i++;
}
}
var roomHitAry = new Array("roomHit51", "roomHit52", "roomHit53", "roomHit54", "roomHit41", "roomHit31", "roomHit21", "roomHit11");
roomHitInit();
function housePropInit(houseName) {
propAry = ctnrRoot[houseName].propAry;
i = 0;
while (i < propAry.length) {
propName = propAry[i];
ctnrRoot[propName].onEnterFrame = null;
i++;
}
}
function delHousePropAry(parHouse, parProp) {
delAry = ctnrRoot[parHouse].propAry;
i = 0;
while (i < delAry.length) {
if (delAry[i] == parProp) {
delAry.splice(i, 1);
break;
}
i++;
}
return(undefined);
}
function housePropInitAll() {
ctnrRoot.house51.propAry = new Array("trg51_1", "trg51_2", "roomHit51", "lock51");
ctnrRoot.house51.axis = "any";
housePropInit("house51");
ctnrRoot.house52.propAry = new Array("trg52_1", "trg52_2", "roomHit52");
ctnrRoot.house52.axis = "x";
housePropInit("house52");
ctnrRoot.house53.propAry = new Array("trg53_1", "trg53_2", "trg53_3", "roomHit53", "cuvette");
ctnrRoot.house53.axis = "any";
housePropInit("house53");
ctnrRoot.house54.propAry = new Array("trg54_1", "roomHit54", "roomHit54");
ctnrRoot.house54.axis = "x";
housePropInit("house54");
ctnrRoot.house41.propAry = new Array("trg41_1", "trg41_2", "roomHit41", "switch43", "axe");
ctnrRoot.house41.axis = "any";
housePropInit("house41");
ctnrRoot.house31.propAry = new Array("trg31_1", "trg31_2", "autoWallH3", "roomHit31", "heavy31", "fBullet", "woodUnder", "bolt");
ctnrRoot.house31.axis = "any";
housePropInit("house31");
ctnrRoot.house21.propAry = new Array("trg21_1", "trg21_2", "turnplate", "roomHit21");
ctnrRoot.house21.axis = "x";
housePropInit("house21");
ctnrRoot.house11.propAry = new Array("trg11_1", "trg11_2", "trg11_3", "autoWallH1", "steelDoorU", "roomHit11", "stones", "heavy11", "keyU");
ctnrRoot.house11.axis = "any";
housePropInit("house11");
ctnrRoot.house12.propAry = new Array("trg12_1", "trg12_2", "throwWindow");
ctnrRoot.house12.axis = "y";
housePropInit("house12");
}
houseTopAt = 1450;
marginH = 0;
marginBtm = 2;
marginTop = 10;
var house51 = new Object();
var house52 = new Object();
var house53 = new Object();
var house54 = new Object();
var house41 = new Object();
var house31 = new Object();
var house21 = new Object();
var house22 = new Object();
var house11 = new Object();
var house12 = new Object();
housePropInitAll();
function accessInit() {
trg51_1.accessDrct = "dn_31";
trg51_1.accessName = "doorV35";
trg51_1.rlt = "trg31_1";
trg51_2.accessDrct = "2R_52";
trg51_2.accessName = "doorH5_12";
trg51_2.rlt = "trg52_1";
trg52_1.accessDrct = "2L_51";
trg52_1.accessName = "doorH5_12";
trg52_1.rlt = "trg51_2";
trg52_2.accessDrct = "2R_53";
trg52_2.accessName = "doorH5_23";
trg52_2.rlt = "trg53_1";
trg53_1.accessDrct = "2L_52";
trg53_1.accessName = "doorH5_23";
trg53_1.rlt = "trg52_2";
trg53_2.accessDrct = "dn_41";
trg53_2.accessName = "doorV45";
trg53_2.rlt = "trg41_1";
trg53_3.accessDrct = "2R_54";
trg53_3.accessName = "doorH5_34";
trg53_3.rlt = "trg54_1";
trg54_1.accessDrct = "2L_53";
trg54_1.accessName = "doorH5_34";
trg54_1.rlt = "trg53_3";
trg41_1.accessDrct = "up_53";
trg41_1.accessName = "doorV45";
trg41_1.rlt = "trg53_2";
trg31_1.accessDrct = "up_51";
trg31_1.accessName = "doorV35";
trg31_1.rlt = "trg51_1";
trg31_2.accessDrct = "dn_11";
trg31_2.accessName = "doorV13";
trg31_2.rlt = "trg11_1";
trg21_1.accessDrct = "dn_11";
trg21_1.accessName = "pipeH12";
trg21_1.rlt = "trg11_2";
trg21_2.accessDrct = "up_12";
trg21_2.accessName = "pipeH2";
trg21_2.rlt = "trg12_2";
trg11_1.accessDrct = "up_31";
trg11_1.accessName = "doorV13";
trg11_1.rlt = "trg31_2";
trg11_2.accessDrct = "up_21";
trg11_2.accessName = "pipeH12";
trg11_2.rlt = "trg21_1";
trg11_3.accessDrct = "2L_12";
trg11_3.accessName = "doorH1_12";
trg11_3.rlt = "trg12_1";
trg12_1.accessDrct = "2R_11";
trg12_1.accessName = "doorH1_12";
trg12_1.rlt = "trg11_3";
trg12_2.accessDrct = "dn_21";
trg12_2.accessName = "pipeH2";
trg12_2.rlt = "trg21_2";
pipeH12.accessable = true;
pipeH12.accessRole = "role1";
pipeH12.timeCnt = 100;
pipeH2.accessable = true;
pipeH2.accessRole = "role1";
pipeH2.timeCnt = 100;
doorV45.accessable = true;
doorV45.accessRole = "any";
doorV45.timeCnt = 50;
doorV35.accessable = false;
doorV35.accessRole = "any";
doorV35.timeCnt = 50;
doorV13.accessable = false;
doorV13.accessRole = "any";
doorV13.timeCnt = 50;
doorV12.accessable = true;
doorV12.accessRole = "any";
doorV12.timeCnt = 50;
doorH5_12.accessable = true;
doorH5_12.accessRole = "any";
doorH5_12.timeCnt = 20;
doorH5_23.accessable = true;
doorH5_23.accessRole = "any";
doorH5_23.timeCnt = 20;
doorH5_34.accessable = true;
doorH5_34.accessRole = "any";
doorH5_34.timeCnt = 20;
doorH4_12.accessable = true;
doorH4_12.accessRole = "any";
doorH4_12.timeCnt = 20;
doorH4_23.accessable = true;
doorH4_23.accessRole = "any";
doorH4_23.timeCnt = 20;
doorH1_12.accessable = false;
doorH1_12.accessRole = "any";
doorH1_12.timeCnt = 20;
}
accessMoveDistH = 100;
accessMoveDistV = ctnrRoot.hb51._height;
accessInit();
function activatePropOEF(houseName) {
propAry = ctnrRoot[houseName].propAry;
trace("activate OEF of :" + propAry);
i = 0;
while (i < propAry.length) {
propName = propAry[i];
ctnrRoot[propName].onEnterFrame = ctnrRoot[propName].orgnEnterFrame;
ctnrRoot[propName].hintOver = false;
i++;
}
}
function disabledPropOEF(houseName) {
propAry = ctnrRoot[houseName].propAry;
i = 0;
while (i < propAry.length) {
propName = propAry[i];
ctnrRoot[propName].onEnterFrame = null;
i++;
}
}
function clearPropNearBy() {
ctnrRoot[crtRole].isNearByProp = false;
ctnrRoot[crtRole].propNearBy = "none";
ctnrRoot[crtRole].actKind = "none";
return(undefined);
}
function setPropNearBy(parName, parKind) {
ctnrRoot[crtRole].isNearByProp = true;
ctnrRoot[crtRole].propNearBy = parName;
ctnrRoot[crtRole].actKind = parKind;
return(undefined);
}
function trgEnterFrame1() {
crtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[crtRole].trgBox)) {
ctnrRoot.setPropNearBy(this._name, "access");
return(undefined);
}
if (ctnrRoot[crtRole].propNearBy == this._name) {
ctnrRoot.clearPropNearBy();
}
return(undefined);
}
function trgEnterFrame2() {
crtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[crtRole].trgBox)) {
ctnrRoot.setPropNearBy(this._name, "getProp");
return(undefined);
}
if (ctnrRoot[crtRole].propNearBy == this._name) {
ctnrRoot.clearPropNearBy();
}
return(undefined);
}
function heavyEnterFrame() {
if (this.moveOver == true) {
this.onEnterFrame = null;
return(undefined);
}
heavyCrtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[heavyCrtRole].trgBox)) {
ctnrRoot.roleMoveCtrl.isPush = true;
if (heavyCrtRole == "role3") {
this.moveCnt++;
if (this.moveCnt < this.moveMax) {
if (ctnrRoot[heavyCrtRole]._x < this._x) {
this._x = this._x + ctnrRoot.roleSpeed;
} else {
this._x = this._x - ctnrRoot.roleSpeed;
}
return(undefined);
}
this.moveOver = true;
this.onEnterFrame = null;
ctnrRoot.roleMoveCtrl.isPush = false;
ctnrRoot[this._name + "over"] = true;
if (this.shouldDisapear == true) {
this.gotoAndPlay("disapear");
}
// unexpected jump
}
if (ctnrRoot[heavyCrtRole]._x < this._x) {
ctnrRoot[heavyCrtRole]._x = ctnrRoot[heavyCrtRole]._x - ctnrRoot.roleSpeed;
} else {
ctnrRoot[heavyCrtRole]._x = ctnrRoot[heavyCrtRole]._x + ctnrRoot.roleSpeed;
}
return(undefined);
}
ctnrRoot.roleMoveCtrl.isPush = false;
}
function steelDoorEnterFrame() {
heavyCrtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[heavyCrtRole].trgBox)) {
if (ctnrRoot[heavyCrtRole]._x < this._x) {
ctnrRoot[heavyCrtRole]._x = ctnrRoot[heavyCrtRole]._x - ctnrRoot.roleSpeed;
} else {
ctnrRoot[heavyCrtRole]._x = ctnrRoot[heavyCrtRole]._x + ctnrRoot.roleSpeed;
}
return(undefined);
}
return(undefined);
}
function trgEnterFrame4() {
crtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[crtRole].trgBox)) {
ctnrRoot.setPropNearBy(this._name, "useProp");
return(undefined);
}
if (ctnrRoot[crtRole].propNearBy == this._name) {
ctnrRoot.clearPropNearBy();
}
return(undefined);
}
function trgEnterFrame5() {
crtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[crtRole].trgBox)) {
ctnrRoot.setPropNearBy(this._name, "watch");
return(undefined);
}
if (ctnrRoot[crtRole].propNearBy == this._name) {
ctnrRoot.clearPropNearBy();
}
return(undefined);
}
function dogEnterFrame() {
crtRole = ctnrRoot.roleMoveCtrl.crtRole;
if (this.hitTest(ctnrRoot[crtRole].trgBox)) {
ctnrRoot.roleMoveCtrl.ctrlAble = false;
this.gotoAndPlay("fight");
this.onEnterFrame = null;
return(undefined);
}
if (ctnrRoot[crtRole].propNearBy == this._name) {
ctnrRoot.clearPropNearBy();
}
return(undefined);
}
function propPress() {
accessNearBy = this._name;
parRole = ctnrRoot.roleMoveCtrl.crtRole;
trace(ctnrRoot[accessNearBy].rec[1]);
if ((this.onEnterFrame == null) || (this.onEnterFrame == undefined)) {
trace("this prop enterframe is null now ,you can't get it");
return(undefined);
}
trace(" distance of crtRole and prop :" + Math.abs(this._x - ctnrRoot[ctnrRoot.roleMoveCtrl.ctrRole]._x));
if ((Math.abs(this._x - ctnrRoot[ctnrRoot.roleMoveCtrl.ctrRole]._x) > 100) || (Math.abs(this._x - ctnrRoot[ctnrRoot.roleMoveCtrl.ctrRole]._x) > 150)) {
trace("this prop is far from you, can't get it");
return(undefined);
}
if ((ctnrRoot[accessNearBy].rec[1] == parRole) || (ctnrRoot[accessNearBy].rec[1] == "any")) {
_global.gameRoot.sndCtrl.playSound("getSnd");
ctnrRoot.roleSay(parRole, "Item picked up.");
trace("before push role1 ary " + ctnrRoot.role1.toolsAry);
i = 0;
while (i < ctnrRoot[parRole].toolsAry.length) {
if (ctnrRoot[parRole].toolsAry[i] == accessNearBy) {
trace("has the tool yet");
return(undefined);
}
i++;
}
ctnrRoot.delHousePropAry(ctnrRoot[parRole].crtHouse, accessNearBy);
ctnrRoot[parRole].toolsAry.push(accessNearBy);
ctnrRoot.toolsBoxRefresh(parRole);
ctnrRoot[accessNearBy]._visible = false;
ctnrRoot[accessNearBy].onEnterFrame = null;
housePropAry = ctnrRoot[ctnrRoot[parRole].crtHouse].propAry;
i = 0;
while (i < housePropAry.length) {
if (housePropAry[i] == accessNearBy) {
housePropAry.splice(i, 1);
}
i++;
}
} else {
ctnrRoot.roleSay(parRole, "I don't need it");
}
}
function propEnterFrameInit() {
trg51_1.orgnEnterFrame = (trg51_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
keyU2.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
lock51.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
trg52_1.orgnEnterFrame = (trg52_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
trg53_1.orgnEnterFrame = (trg53_2.orgnEnterFrame = (trg53_3.orgnEnterFrame = ctnrRoot.trgEnterFrame1));
cuvette.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
trg54_1.orgnEnterFrame = ctnrRoot.trgEnterFrame1;
axe.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
trg41_1.orgnEnterFrame = (trg41_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
trg42_1.orgnEnterFrame = (trg42_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
trg43_1.orgnEnterFrame = ctnrRoot.trgEnterFrame1;
switch43.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
trg31_1.orgnEnterFrame = (trg31_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
autoWallH3.orgnEnterFrame = ctnrRoot.steelDoorEnterFrame;
fBullet.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
heavy31.orgnEnterFrame = ctnrRoot.steelDoorEnterFrame;
bolt.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
woodUnder.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
trg21_1.orgnEnterFrame = (trg21_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
turnplate.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
trg11_1.orgnEnterFrame = (trg11_2.orgnEnterFrame = (trg11_3.orgnEnterFrame = ctnrRoot.trgEnterFrame1));
keyU.orgnEnterFrame = ctnrRoot.trgEnterFrame2;
autoWallH1.orgnEnterFrame = ctnrRoot.steelDoorEnterFrame;
steelDoorU.orgnEnterFrame = ctnrRoot.steelDoorEnterFrame;
stones.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
heavy11.orgnEnterFrame = ctnrRoot.steelDoorEnterFrame;
trg12_1.orgnEnterFrame = (trg12_2.orgnEnterFrame = ctnrRoot.trgEnterFrame1);
throwWindow.orgnEnterFrame = ctnrRoot.trgEnterFrame4;
}
function propPressInit() {
keyU.onPress = propPress;
keyU2.onPress = propPress;
cuvette.onPress = propPress;
axe.onPress = propPress;
fBullet.onPress = propPress;
nothingPress.onPress = function () {
sayCttF = "Nothing here";
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, sayCttF);
};
nothingPress.useHandCursor = false;
bolt.onPress = function () {
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "Steel planks are blocking the door!");
};
woodUnder.onPress = function () {
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "Wooden planks are blocking the door!");
};
lock51.onPress = (lock14.onPress = (cardReader.onPress = function () {
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "This opens the door!");
}));
throwWindow.onPress = function () {
ctnrRoot.roleSay(ctnrRoot.roleMoveCtrl.crtRole, "Small window!");
};
}
propEnterFrameInit();
propPressInit();
function finishInit() {
ctnrRoot.woodUnderover = false;
ctnrRoot.boltover = false;
ctnrRoot.aotuWallH3over = false;
ctnrRoot.steelDoorUover = false;
ctnrRoot.switch43over = false;
ctnrRoot.turnplateover = false;
ctnrRoot.stonesover = false;
ctnrRoot.keyUover = false;
}
function usePropRltInit() {
ctnrRoot.keyU.rec = new Array("throwWindow", "any", "1", "clip");
ctnrRoot.keyU2.rec = new Array("lock51", "any", "1", "unlock");
ctnrRoot.fBullet.rec = new Array("bulletRlt", "role2", "2", "shot");
ctnrRoot.axe.rec = new Array("woodUnder", "role3", "1", "clip");
ctnrRoot.cuvette.rec = new Array("bolt", "role3", "1", "clip");
var _local1 = new Array("shotPlace31", "shotPlace11");
}
function unlockPropInit() {
ctnrRoot.lock51.func = new Array("unlock", "doorV35", "unDisapear", "none");
}
function eventPropInit() {
switch43.rec = new Array("any", "eventSwitch43");
turnplate.rec = new Array("role1", "eventTurnplate");
stones.rec = new Array("role3", "eventStones");
axe.func = new Array("role3", "eventAxe");
keyU.func = new Array("role1", "eventKeyU");
cuvette.func = new Array("role3", "eventBolt");
}
function generatePropInit() {
keyU2._visible = false;
}
function eventAxe() {
ctnrRoot.woodUnder.unloadMovie();
ctnrRoot.heavy31.unloadMovie();
ctnrRoot.role3._visible = false;
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.axe.unloadMovie();
ctnrRoot.woodBreakMV.gotoAndPlay(2);
ctnrRoot._parent.dropTool("heavy31");
ctnrRoot.woodUnderover = true;
_global.score = _global.score + 150;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
}
function eventBolt() {
trace("in event bolt");
ctnrRoot.delHousePropAry("house31", "cuvette");
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.boltMV.gotoAndPlay(2);
ctnrRoot._parent.dropTool("cuvette");
ctnrRoot.bolt.unloadMovie();
ctnrRoot.cuvette.unloadMovie();
ctnrRoot.role3._visible = false;
ctnrRoot.boltover = true;
_global.score = _global.score + 150;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
}
function eventshotPlace31() {
trace("function eventshotPlace31");
if (ctnrRoot.steam._currentframe == 2) {
ctnrRoot.globalView();
ctnrRoot.shotPlace31MV.gotoAndPlay(2);
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.role2._visible = false;
if (ctnrRoot.autoWallH3over == false) {
ctnrRoot.autoWallH3over = true;
_global.score = _global.score + 200;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
}
}
}
function eventshotPlace11() {
trace("function eventshotPlace11");
if (ctnrRoot.steelDoorU._currentframe == 1) {
ctnrRoot.globalView();
ctnrRoot.shotPlace11MV.gotoAndPlay(2);
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.role2._visible = false;
if (ctnrRoot.steelDoorUover == false) {
ctnrRoot.steelDoorUover = true;
_global.score = _global.score + 250;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
}
}
}
function eventSwitch43() {
ctnrRoot.switch43._visible = false;
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.role3._visible = false;
ctnrRoot.switch43MV.gotoAndPlay(2);
ctnrRoot.delHousePropAry("house11", "autoWallH1");
ctnrRoot.globalView();
if (ctnrRoot.switch43over == false) {
ctnrRoot.switch43over = true;
_global.score = _global.score + 230;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
}
}
function eventTurnplate() {
if (ctnrRoot.steam._currentframe == 1) {
ctnrRoot.globalView();
ctnrRoot.turnplate._visible = false;
ctnrRoot.turnplateMV.gotoAndPlay(2);
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.role1._visible = false;
ctnrRoot.delHousePropAry("house21", "turnplate");
ctnrRoot.turnplateover = true;
_global.score = _global.score + 280;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
}
}
function eventStones() {
ctnrRoot.role3._visible = false;
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot.stones.unloadMovie();
ctnrRoot.delHousePropAry("house11", "stones");
ctnrRoot.clearStoneMV.gotoAndPlay(2);
ctnrRoot.delHousePropAry("house11", "heavy11");
ctnrRoot.heavy11.unloadMovie();
ctnrRoot.stonesover = true;
_global.score = _global.score + 120;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
}
function eventKeyU() {
ctnrRoot.roleMoveCtrl.ctrlAble = false;
ctnrRoot._parent.dropTool("keyU");
ctnrRoot.keyU.unloadMovie();
ctnrRoot.throwkeyU2MV.gotoAndPlay(2);
ctnrRoot.delHousePropAry("house12", "throwWindow");
ctnrRoot.throwWindow.unloadMovie();
ctnrRoot.globalView();
if (ctnrRoot.keyUover == false) {
ctnrRoot.keyUover = true;
_global.score = _global.score + 500;
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
}
}
function propCommentInit() {
ctnrRoot.woodUnder.commentTxt = "Wooden planks are blocking the door!";
ctnrRoot.bolt.commentTxt = "Steal bars are blocking the door.";
ctnrRoot.lock51.commentTxt = "This opens the door";
ctnrRoot.throwWindow.commentTxt = "Samll window";
}
function debug() {
ctnrRoot.house52.propAry.push("number2");
ctnrRoot.number2._visible = true;
house51.propAry = new Array("key1", "trg51_1", "trg51_2", "trg51_3");
house52.propAry = new Array("trg52_1", "trg52_2");
house42.propAry = new Array("trg42_1", "trg42_2", "trg42_3");
house53.propAry = new Array("trg53_1", "tele", "trg53_2");
house44.propAry = new Array("trg44_1");
house23.propAry = new Array("trg23_1", "trg23_2", "card", "steelDoor");
house32.propAry = new Array("trg32_1", "trg32_2", "trg32_3", "axe", "dogHole");
house12.propAry.push("card");
pipe3.accessable = true;
doorH5_12.accessable = true;
doorH2_23.accessable = true;
ctnrRoot.wood.onEnterFrame = null;
ctnrRoot.rolesInit("role3", "house12");
}
unlockPropInit();
usePropRltInit();
eventPropInit();
generatePropInit();
propCommentInit();
function localView() {
trace("localview" + ctnrRoot.roleMoveCtrl.crtRole);
ctnrRoot.zoomCtrl.onEnterFrame = ctnrRoot.zoomCtrl.orgnEnterFrame;
ctnrRoot.zoomCtrl.crtTask = "localView";
_global.isZooming = true;
if (ctnrRoot.roleMoveCtrl.crtRole == "none") {
ctnrRoot.zoomCtrl.px = -(ctnrRoot.role1._x - 350);
ctnrRoot.zoomCtrl.py = -(ctnrRoot.role1._y - 350);
} else {
ctnrRoot.zoomCtrl.px = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._x - 350);
ctnrRoot.zoomCtrl.py = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._y - 350);
}
}
function globalView() {
_global.isZooming = true;
ctnrRoot.zoomCtrl.onEnterFrame = ctnrRoot.zoomCtrl.orgnEnterFrame;
ctnrRoot.zoomCtrl.crtTask = "globalView";
}
function setCamara() {
if ((ctnrRoot._xscale != 100) || (ctnrRoot._yscale != 100)) {
return(undefined);
}
ctnrRoot._parent.container._x = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._x - 350);
ctnrRoot._parent.container._y = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._y - 350);
}
if (camaraMoveCtrl) {
trace("find a camaraMoveCtrl should be killed");
this.camaraMoveCtrl.removeMovieClip();
}
this.createEmptyMovieClip("camaraMoveCtrl", this.getNextHighestDepth());
camaraMoveCtrl.crtTask = "none";
camaraMoveCtrl.speed = 8;
camaraMoveCtrl.moveKind = "none";
camaraMoveCtrl.orgnEnterFrame = function () {
if ((ctnrRoot._xscale != 100) || (ctnrRoot._yscale != 100)) {
this.onEnterFrame = null;
return(undefined);
}
camaraX = (camaraY = false);
containerX = ctnrRoot._parent.container._x;
containerY = ctnrRoot._parent.container._y;
switch (this.moveKind) {
case "trg" :
relationX = -(ctnrRoot[rltTrg]._x - 350);
relationY = -(ctnrRoot[rltTrg]._y - 350);
break;
case "role" :
relationX = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._x - 350);
relationY = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._y - 350);
break;
case "dog" :
relationX = -(ctnrRoot.dog._x - 350);
relationY = -(ctnrRoot[ctnrRoot.roleMoveCtrl.crtRole]._y - 350);
}
if (containerX != relationX) {
if (Math.abs(containerX - relationX) > this.speed) {
if (containerX < relationX) {
ctnrRoot._parent.container._x = ctnrRoot._parent.container._x + this.speed;
} else if (containerX > relationX) {
ctnrRoot._parent.container._x = ctnrRoot._parent.container._x - this.speed;
}
}
}
if (containerY != ralationY) {
if (Math.abs(containerY - relationY) > this.speed) {
if (containerY < relationY) {
ctnrRoot._parent.container._y = ctnrRoot._parent.container._y + this.speed;
} else if (containerY > relationY) {
ctnrRoot._parent.container._y = ctnrRoot._parent.container._y - this.speed;
}
}
}
if ((Math.abs(containerX - relationX) < this.speed) && (Math.abs(containerY - relationY) < this.speed)) {
this.onEnterFrame = null;
}
};
this.createEmptyMovieClip("zoomCtrl", this.getNextHighestDepth());
zoomCtrl.crtTask = "none";
zoomCtrl.timeCnt = ctnrRoot.shouldTimeCnt;
zoomCtrl.timeMax = 20;
zoomCtrl.px = null;
zoomCtrl.py = null;
zoomCtrl.orgnEnterFrame = function () {
switch (this.crtTask) {
case "localView" :
if (ctnrRoot._parent.container._xscale < 100) {
ctnrRoot._parent.container._xscale = (ctnrRoot._parent.container._yscale = ctnrRoot._parent.container._yscale + 4);
if (ctnrRoot._parent.container._x < this.px) {
ctnrRoot._parent.container._x = ctnrRoot._parent.container._x + ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._x - this.px));
} else {
ctnrRoot._parent.container._x = ctnrRoot._parent.container._x - ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._x - this.px));
}
if (ctnrRoot._parent.container._y < this.py) {
ctnrRoot._parent.container._y = ctnrRoot._parent.container._y + ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._y - this.py));
} else {
ctnrRoot._parent.container._y = ctnrRoot._parent.container._y - ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._y - this.py));
}
}
this.timeCnt--;
if (this.timeCnt == 1) {
ctnrRoot._parent.container._xscale = (ctnrRoot._parent.container._yscale = 100);
ctnrRoot._parent.container._y = this.py;
ctnrRoot._parent.container._x = this.px;
_global.isZooming = false;
this.crtTask = "none";
this.timeCnt = ctnrRoot.shouldTimeCnt;
this.onEnterFrame = null;
}
break;
case "globalView" :
if (ctnrRoot._parent.container._xscale > 24) {
ctnrRoot._parent.container._xscale = (ctnrRoot._parent.container._yscale = ctnrRoot._parent.container._yscale - 4);
if (ctnrRoot._parent.container._x < 120) {
ctnrRoot._parent.container._x = ctnrRoot._parent.container._x + ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._x - 120));
} else {
ctnrRoot._parent.container._x = ctnrRoot._parent.container._x - ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._x - 120));
}
if (ctnrRoot._parent.container._y < 0) {
ctnrRoot._parent.container._y = ctnrRoot._parent.container._y + ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._y - 0));
} else {
ctnrRoot._parent.container._y = ctnrRoot._parent.container._y - ((1 / this.timeCnt) * Math.abs(ctnrRoot._parent.container._y - 0));
}
}
this.timeCnt--;
if (this.timeCnt != 1) {
break;
}
ctnrRoot._parent.container._xscale = (ctnrRoot._parent.container._yscale = ctnrRoot.shouldScale);
ctnrRoot._parent.container._y = 0;
ctnrRoot._parent.container._x = 120;
_global.isZooming = false;
this.crtTask = "none";
this.timeCnt = ctnrRoot.shouldTimeCnt;
this.onEnterFrame = null;
}
};
this.deadCtrl.removeMovieClip();
this.createEmptyMovieClip("deadCtrl", this.getNextHighestDepth());
deadCtrl.timeCnt = 0;
deadCtrl.timeMax = 80;
deadCtrl.orgnEnterFrame = function () {
if (this.timeCnt < this.timeMax) {
this.timeCnt++;
} else {
_root.gotoAndPlay("losePage");
this.timeCnt = 0;
this.onEnterFrame = null;
}
};
ctnrRoot.halfWallAbove.swapDepths(-13000);
function stageRestart() {
trace("stage restart");
ctnrRoot.housePropInitAll();
ctnrRoot.accessInit();
ctnrRoot.rolesInitAll();
ctnrRoot.clearToolIDCT();
ctnrRoot.propEnterFrameInit();
ctnrRoot.unlockPropInit();
ctnrRoot.usePropRltInit();
ctnrRoot.eventPropInit();
ctnrRoot.generatePropInit();
ctnrRoot.finishInit();
ctnrRoot.deadCtrl.onEnterFrame = null;
ctnrRoot.camaraMoveCtrl.onEnterFrame = ctnrRoot.camaraMoveCtrl.orgnEnterFrame;
_global.gameRoot._quality = _global.visualQlt;
_global.isZooming = false;
ctnrRoot.propPressInit();
}
power.isOpen = false;
stageRestart();
trace(_global.loadGame);
if (_global.loadGame == true) {
trace("should load game");
_global.gameRoot.loadData();
} else {
trace("don't load");
_global.gameRoot.cover.unloadMovie();
ctnrRoot._parent.stateRoleSele.scoreTxt.text = _global.score;
_global.gameDat.clear();
}
Symbol 1189 Button
on (press) {
trace("you press me");
gotoAndStop ("firstPage");
}
Symbol 1241 Button
on (release) {
gotoAndStop ("submit");
}
Symbol 1246 MovieClip Frame 1
stop();
_global.game_name = _game_name;
var highscore = eval (score_var);
_global.viewHighscore = function () {
getURL ("http://www.freeworldgroup.com/score/index.asp?game=" + game_name, "_blank");
};
if (highscore <= 0) {
this._visible = false;
}
trace(game_name);
trace(highscore);
trace("http://www.freeworldgroup.com/score/index.asp?game=" + game_name);
Symbol 1246 MovieClip Frame 3
function sendData() {
send_var.game = game_name;
send_var.score = highscore;
send_var.name = name_txt.text;
if (send_var.name == "") {
send_var.name = "guest" + int(Math.random() * 1000);
}
send_var.sendAndLoad("http://www.freeworldgroup.com/score/score.asp", load_var, "POST");
gotoAndStop ("sending");
}
stop();
gold_txt.text = highscore;
send_var = new LoadVars();
load_var = new LoadVars();
ok_btn.onRelease = sendData;
load_var.onLoad = function () {
gotoAndStop ("done");
};
Instance of Symbol 50 MovieClip "closeBtn" in Symbol 1246 MovieClip Frame 3
on (press) {
trace("should gotoAndStop frame 1");
this._parent.gotoAndStop("over");
}
Symbol 1250 Button
on (press) {
gotoAndStop ("firstPage");
}