Frame 1
var my_cm = new ContextMenu();
my_cm.hideBuiltInItems();
this.menu = my_cm;
MochiAd.showPreloaderAd({id:"7fbe4cb6e6229a47", res:"700x500"});
Frame 3
if (_root.getBytesLoaded() < _root.getBytesTotal()) {
gotoAndStop ("loading");
}
Instance of Symbol 37 MovieClip in Frame 4
//component parameters
onClipEvent (construct) {
_game_name = "revenge_of_the_stick";
score_var = "_root.disScore";
}
Frame 5
stop();
Frame 7
function globalInit() {
if (bGlobalInited) {
return(undefined);
}
sHard = "MEDIUM";
_quality = "MEDIUM";
bFistNoted = false;
bGlobalInited = true;
loadSceneMask();
initSoundArray();
loadSD();
initMusic();
initSD();
}
function loadSceneMask() {
kill(sceneMasker);
newMasker();
}
function clearScene() {
clearInterval(gameInter);
clearInterval(mcLevel.enemyInter);
var _local3 = new Array("mcLevel", "mcLayout", "mcMenu", "mcPause", "mcPass", "mcOver", "mcEnd");
for (var _local4 in _local3) {
var _local2 = _root[_local3[_local4]];
kill(_local2);
}
}
function activeGame() {
bStart = true;
bPause = false;
trace("::::\u6E38\u620F\u88AB\u6FC0\u6D3B\uFF01::::");
}
function pauseGame() {
bStart = false;
bPause = true;
trace("::::\u6E38\u620F\u6682\u505C\uFF01::::");
}
function initFreeMode() {
gold = 7500;
head = 9;
interest = 0;
}
function initNormalMode() {
gold = 60;
head = 0;
}
function initGame() {
worldx = 345;
worldy = 164;
nLevel = 1;
nMaxLevel = 50;
levelTime = 30;
gameTime = levelTime;
levelScore = 0;
score = 0;
disScore = 0;
life = 20;
if (sHard == "FREE") {
initFreeMode();
} else {
initNormalMode();
}
defaultRange = 20;
phoneHead = 3;
ruleHead = 1;
staplerHead = 2;
goldHead = 1;
interestHead = 1;
lifeHead = 2;
fistTimes = 5;
fistDamage = 20000;
fistRange = 20;
goldRate = 50;
interest = 0.05;
interestRate = 0.025;
maxInterest = 0.35;
bUseFist = false;
bBuild = false;
bPhoneUnlocked = false;
bRuleUnlocked = false;
bStaplerUnlocked = false;
bStart = false;
bPause = true;
bPass = false;
bOver = false;
bEnd = false;
bSearching = false;
bShowBar = true;
currRole = null;
selectedRole = null;
clipCost = 5;
penCost = 10;
calcCost = 20;
phoneCost = 50;
ruleCost = 60;
staplerCost = 50;
aDamage1 = new Array(10, 20, 40, 80, 160, 300);
aDamage2 = new Array(15, 30, 60, 120, 240, 350);
aDamage3 = new Array(45, 90, 160, 240, 400, 500);
aDamage4 = new Array(45, 90, 180, 300, 450, 600);
aRulePower = new Array("Weak", "Weak-Med", "Med", "Med-Strong", "Strong", "Very Strong");
aSlowRate = new Array(0.5, 0.45, 0.4, 0.35, 0.3, 0.25);
aDamage6 = new Array(35, 70, 180, 260, 400, 600);
aUpCost1 = new Array(7, 16, 32, 60, 150, clipCost);
aUpCost2 = new Array(15, 25, 50, 100, 240, penCost);
aUpCost3 = new Array(20, 40, 80, 160, 260, calcCost);
aUpCost4 = new Array(30, 50, 90, 160, 400, phoneCost);
aUpCost5 = new Array(40, 80, 160, 250, 400, ruleCost);
aUpCost6 = new Array(30, 60, 120, 220, 450, staplerCost);
aRange1 = new Array(25, 25, 25, 25, 30, 30);
aRange2 = new Array(30, 35, 40, 45, 50, 55);
aRange3 = new Array(50, 50, 50, 60, 60, 70);
aRange4 = new Array(30, 35, 30, 45, 45, 50);
aRange5 = new Array(20, 20, 20, 20, 20, 20);
aRange6 = new Array(30, 30, 35, 40, 45, 50);
aShootTime = new Array(450, 500, 450, 400, 1000, 450);
aRoleName = new Array("Paper Clip", "Pen", "Calculator", "Mobile Phone", "Ruler", "Stapler");
aSpeedType = new Array("fast", "medium", "fast", "slow", "medium", "fast");
aWeaponType = new Array("land", "land / air", "air", "land / air", "land", "land / air");
}
function loadLevel() {
atMc(this, "mcLevel", "mcLevel");
atMc(this, "mcLayout");
loadSceneMask();
}
function playGame() {
turnTo("gameScene");
clearScene();
gameReset();
loadLevel();
}
function startGame() {
activeGame();
mcLevel.enemyManage();
}
function tryAgain() {
clearInterval(mcLevel.enemyInter);
clearScene();
initGame();
gameReset();
trace((("life " + life) + " bOver ") + bOver);
turnTo("gameScene");
loadLevel();
pauseGame();
}
function continueGame() {
score = score * 0.7;
gold = gold * 0.7;
score = floor(score);
gold = floor(gold);
clearScene();
gameReset();
loadLevel();
}
function nextLevel() {
if (nLevel < nMaxLevel) {
timeBonus();
gameTime = levelTime;
nLevel = nLevel + 1;
interestGold();
gameReset();
mcLevel.initEnemy();
}
}
function timeBonus() {
var _local2 = levelTime - gameTime;
_root.score = _root.score + _local2;
}
function instructions() {
bNoted = true;
turnTo("instructions");
}
function backToFrontPage() {
turnTo("frontPage");
_root.frontAnim.gotoAndPlay("kill");
}
function initLayoutBt(mc) {
mc.btPlay.onPress = function () {
_root.playGame();
};
mc.btReturn.onPress = function () {
_root.bPause = false;
this._parent.removeMovieClip();
};
mc.btContinue.onPress = function () {
_root.continueGame();
};
mc.btTryAgain.onPress = function () {
_root.tryAgain();
};
mc.btNextLevel.onPress = function () {
_root.nextLevel();
};
mc.btInstructions.onPress = function () {
_root.instructions();
};
mc.btViewScore.onPress = function () {
viewHighscore();
};
mc.btMore.onPress = function () {
getURL ("http://www.freeworldgroup.com/", "_blank");
};
mc.btDownload.onPress = function () {
getURL ("http://www.ifungames.com", "_blank");
};
mc.btSetting.onPress = function () {
};
mc.btAddGame.onPress = function () {
getURL ("http://www.freeworldgroup.com/koalafiles.htm", "_blank");
};
mc.btMainMenu.onPress = function () {
turnTo("frontPage");
};
}
function initSoundArray() {
aSDType = new Array("aMusic", "aSound");
aMusic = new Array("mainMusic", "bossMusic");
aSound = new Array("sdBt", "sdGun", "sdInstructions");
aMuscVol = new Array();
aMuscVol.push(20, 20);
aSoundVol = new Array(20, 20, 50);
bMusicOn = true;
bSoundOn = true;
musicHolder = newMc(_root, "musicHolder");
sdHolder = newMc(_root, "sdHolder");
}
function loadSD() {
for (var _local8 in aSDType) {
var _local3 = _root[aSDType[_local8]];
var _local7 = _local3.length;
var _local2 = 0;
while (_local2 < _local7) {
var _local4 = _local3[_local2];
var _local5 = _local4 + "mc";
var _local6 = newMc(_root, _local5);
_root[_local3[_local2]] = new Sound(_local6);
_root[_local3[_local2]].attachSound(_local4);
if (_local3 == aMusic) {
_root[_local3[_local2]].setVolume(aMuscVol[_local2]);
} else if (_local3 == aSound) {
_root[_local3[_local2]].setVolume(aSoundVol[_local2]);
}
_local2++;
}
}
}
function initMusic() {
var _local4 = aMusic.length;
var _local2 = 0;
while (_local2 < _local4) {
if (bMusicOn) {
var _local3 = aMuscVol[_local2];
} else {
var _local3 = 0;
}
_root[aMusic[_local2]].setVolume(_local3);
_local2++;
}
}
function stopVoice() {
mainMusic.setVolume(20);
sdInstructions.stop();
}
function startVoice() {
mainMusic.setVolume(4);
sdInstructions.start();
}
function initSD() {
var _local4 = aSound.length;
var _local2 = 0;
while (_local2 < _local4) {
if (bSoundOn) {
var _local3 = aSoundVol[_local2];
} else {
var _local3 = 0;
}
_root[aSound[_local2]].setVolume(_local3);
_local2++;
}
}
new global.GlobalFun();
stop();
trace("::::\u8FDB\u5165\u6E38\u620F\u9996\u9875::::");
globalInit();
clearScene();
initGame();
gameReset();
trace("\u6E38\u620F\u88AB\u91CD\u7F6E");
bStart = false;
bPause = true;
bPass = false;
bOver = false;
bEnd = false;
bSearching = false;
gameTime = levelTime;
levelScore = 0;
currRole = null;
selectedRole = null;
trace((("life " + life) + " bOver ") + bOver);
initLayoutBt(this);
sdInstructions.stop();
mainMusic.stop();
mainMusic.start(0, 999);
bossMusic.stop();
stopVoice();
Instance of Symbol 613 MovieClip in Frame 7
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Frame 21
function barControl() {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
var _local2 = mcLevel.aEnemy;
var _local3 = mcLevel.aFlyEnemy;
if (_root.bShowBar) {
mcLayout.barControl.gotoAndStop("off");
_root.bShowBar = false;
for (var _local4 in _local2) {
_local2[_local4].bloodBar._visible = false;
}
for (var _local4 in _local3) {
_local3[_local4].bloodBar._visible = false;
}
} else {
mcLayout.barControl.gotoAndStop("on");
_root.bShowBar = true;
for (var _local4 in _local2) {
_local2[_local4].bloodBar._visible = true;
}
for (var _local4 in _local3) {
_local3[_local4].bloodBar._visible = true;
}
}
}
function interestGold() {
gold = gold + Math.ceil(gold * interest);
}
function loseLife() {
life = life - 1;
if (life < 0) {
life = 0;
}
}
function initTileRange(mc) {
switch (currRole) {
case "clip" :
range = aRange1[0];
break;
case "pen" :
range = aRange2[0];
break;
case "calc" :
range = aRange3[0];
break;
case "phone" :
range = aRange4[0];
break;
case "rule" :
range = aRange5[0];
break;
case "stapler" :
range = aRange6[0];
}
var _local1 = (range / defaultRange) * 100;
mc.range._xscale = _local1;
mc.range._yscale = _local1;
}
function activeNextLevelBt() {
mcLayout.mcNextLevel.gotoAndStop("on");
}
function lockNextLevelBt() {
}
function selRole(_sType) {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
_root.mcLayout.hand._visible = false;
unselFist();
currRole = _sType;
bBuild = true;
disBuyOption(_sType);
mcLayout.mcOption.bigImage.gotoAndStop(_sType);
}
function selFist(_sType) {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
if (fistTimes == 0) {
_root.mcLayout.mcFist.gotoAndStop("off");
return(undefined);
}
currRole = _sType;
bUseFist = true;
_root.mcLayout.hand._visible = true;
mcLayout.hand.gotoAndStop(2);
mcLayout.mcOption.gotoAndStop("temp");
mcLayout.mcOption.bigImage.gotoAndStop(_sType);
}
function fistKill() {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
if (fistTimes == 0) {
_root.mcLayout.mcFist.gotoAndStop("off");
return(undefined);
}
mcLayout.hand.gotoAndPlay(3);
}
function unselFist() {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
if (fistTimes == 0) {
_root.mcLayout.mcFist.gotoAndStop("off");
return(undefined);
}
currRole = null;
bUseFist = false;
}
function sell() {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
selectedRole.sell();
currRole = null;
_root.mcLevel.searchAllPath();
}
function repair() {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
selectedRole.repair();
}
function upgrade() {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
if (selectedRole.bUping) {
return(undefined);
}
if (_root.gold < selectedRole.upCost) {
_root.disSellOption();
_root.mcLayout.noteMoney.gotoAndPlay(2);
return(undefined);
}
mcLayout.mcOption.mcUpgrade.gotoAndStop("upgrade");
var _local2 = selectedRole.level;
var _local4 = _local2;
var _local3 = _local2 + 1;
var _local6 = selectedRole.aDamage[_local4];
var _local5 = selectedRole.aDamage[_local3];
if (selectedRole.type == "rule") {
var _local7 = (10 / (_local3 - _local4)) * 0.15;
} else {
var _local7 = (_local5 - _local6) * 0.15;
}
selectedRole.stUpgrade(_local7);
}
function cakeMange(_frame) {
var _local2 = mcLayout.mcOption.mcUpgrade.cake;
var _local4 = _local2.leftCake;
var _local1 = _local2.rightCake;
if (_frame <= 30) {
_local1.gotoAndStop(_frame);
} else {
_local1.gotoAndStop(30);
_local4.gotoAndStop(_frame - 30);
}
}
function overBuyFun(_type) {
Mouse.show();
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
if (!currRole) {
disBuyOption(_type);
mcLayout.mcOption.bigImage.gotoAndStop(_type);
}
}
function outBuyFun() {
if (!currRole) {
mcLayout.mcOption.gotoAndStop("temp");
}
}
function resetConvert() {
mcLayout.mcConvert.gotoAndStop("temp");
mcLayout.mcConvert.gotoAndStop("convert");
}
function disConvert() {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
with (mcLayout.mcConvert) {
if (bPhoneUnlocked) {
phone.gotoAndStop("finish");
} else if (head >= phoneHead) {
phone.gotoAndStop("on");
} else {
phone.gotoAndStop("off");
}
if (bRuleUnlocked) {
rule.gotoAndStop("finish");
} else if (head >= ruleHead) {
rule.gotoAndStop("on");
} else {
rule.gotoAndStop("off");
}
if (bStaplerUnlocked) {
stapler.gotoAndStop("finish");
} else if (head >= staplerHead) {
stapler.gotoAndStop("on");
} else {
stapler.gotoAndStop("off");
}
if (head >= goldHead) {
mcGold.gotoAndStop("on");
} else {
mcGold.gotoAndStop("off");
}
if (head >= interestHead) {
if (sHard == "FREE") {
mcInterest.gotoAndStop("locked");
} else if (interest < maxInterest) {
mcInterest.gotoAndStop("on");
} else {
mcInterest.gotoAndStop("finish");
}
} else {
mcInterest.gotoAndStop("off");
}
if (head >= lifeHead) {
mcLife.gotoAndStop("on");
} else {
mcLife.gotoAndStop("off");
}
}
}
function convertFun(_type) {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
switch (_type) {
case "phone" :
bPhoneUnlocked = true;
mcLayout.mcPhone.gotoAndStop("on");
head = head - _root.phoneHead;
resetConvert();
disConvert();
break;
case "rule" :
bRuleUnlocked = true;
mcLayout.mcRule.gotoAndStop("on");
head = head - _root.ruleHead;
resetConvert();
disConvert();
break;
case "stapler" :
bStaplerUnlocked = true;
mcLayout.mcStapler.gotoAndStop("on");
head = head - _root.staplerHead;
resetConvert();
disConvert();
break;
case "gold" :
gold = gold + goldRate;
head = head - _root.goldHead;
resetConvert();
disConvert();
break;
case "interest" :
interest = interest + interestRate;
head = head - _root.interestHead;
resetConvert();
disConvert();
break;
case "life" :
life = life + 1;
head = head - _root.lifeHead;
resetConvert();
disConvert();
}
}
function disNoteLock(_type) {
_root.mcLayout.mcOption.noteLock._visible = false;
if (_type == "phone") {
if (!_root.bPhoneUnlocked) {
_root.mcLayout.mcOption.noteLock._visible = true;
}
} else if (_type == "rule") {
if (!_root.bRuleUnlocked) {
_root.mcLayout.mcOption.noteLock._visible = true;
}
} else if (_type == "stapler") {
if (!_root.bStaplerUnlocked) {
_root.mcLayout.mcOption.noteLock._visible = true;
}
}
}
function disBuyOption(_type) {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
if (_type == "rule") {
mcLayout.mcOption.gotoAndStop("buyRule");
} else if (_type == "fist") {
mcLayout.mcOption.gotoAndStop("fist");
} else {
mcLayout.mcOption.gotoAndStop("buy");
}
disNoteLock(_type);
var _local2 = mcLayout.mcOption.mcSell;
var _local3 = mcLayout.mcOption.mcFist;
switch (_type) {
case "clip" :
cost = _root.clipCost;
roelName = aRoleName[0];
damage = aDamage1[0];
range = aRange1[0];
speedType = aSpeedType[0];
weaponType = aWeaponType[0];
break;
case "pen" :
cost = _root.penCost;
roelName = aRoleName[1];
damage = aDamage2[0];
range = aRange2[0];
speedType = aSpeedType[1];
weaponType = aWeaponType[1];
break;
case "calc" :
cost = _root.calcCost;
roelName = aRoleName[2];
damage = aDamage3[0];
range = aRange3[0];
speedType = aSpeedType[2];
weaponType = aWeaponType[2];
break;
case "phone" :
cost = _root.phoneCost;
roelName = aRoleName[3];
damage = aDamage4[0];
range = aRange4[0];
speedType = aSpeedType[3];
weaponType = aWeaponType[3];
break;
case "rule" :
cost = _root.ruleCost;
roelName = aRoleName[4];
rulePower = aRulePower[0];
range = aRange5[0];
speedType = aSpeedType[4];
weaponType = aWeaponType[4];
break;
case "stapler" :
cost = _root.staplerCost;
roelName = aRoleName[5];
damage = aDamage6[0];
range = aRange6[0];
speedType = aSpeedType[5];
weaponType = aWeaponType[5];
break;
case "fist" :
times = fistTimes;
damage = fistDamage;
range = fistRange;
weaponType = "Land / Air";
}
_local2.tName.text = roelName;
_local2.tLevel.text = 1;
_local2.tCost.text = cost;
_local2.tDamage.text = damage;
_local2.tPower.text = rulePower;
_local2.tRange.text = range;
_local2.tSpeed.text = speedType;
_local2.tType.text = weaponType;
_local3.tTimes.text = times;
_local3.tDamage.text = damage;
_local3.tRange.text = range;
_local3.tType.text = weaponType;
}
function disSellOption() {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
mcLayout.mcOption.gotoAndStop("temp");
if (selectedRole.type == "rule") {
mcLayout.mcOption.gotoAndStop("selRule");
if (selectedRole.bUping) {
_root.mcLayout.mcOption.mcUpgrade.gotoAndStop("upgrade");
}
} else {
mcLayout.mcOption.gotoAndStop("sel");
if (selectedRole.bUping) {
_root.mcLayout.mcOption.mcUpgrade.gotoAndStop("upgrade");
}
}
mcLayout.mcOption.bigImage.gotoAndStop(selectedRole.type);
disNoteLock(selectedRole.type);
var _local2 = mcLayout.mcOption.mcSell;
var _local4 = mcLayout.mcOption.mcUpgrade;
var _local7 = mcLayout.mcOption.mcRepair;
var _local5 = mcLayout.mcOption.btUpgrade;
var _local6 = mcLayout.mcOption.btRepair;
_local2.tName.text = selectedRole.roelName;
_local2.tLevel.text = selectedRole.level + 1;
_local2.tCost.text = selectedRole.cost;
_local2.tDamage.text = selectedRole.damage;
_local2.tPower.text = selectedRole.rulePower;
_local2.tRange.text = selectedRole.nRange;
_local2.tSpeed.text = selectedRole.speedType;
_local2.tType.text = selectedRole.weaponType;
var _local3 = selectedRole.level;
_local4._visible = true;
_local5._visible = true;
_local5.enabled = true;
_local7._visible = true;
_local6._visible = true;
_local6.enabled = true;
if (_local3 > 4) {
_local3 = 4;
_local4._visible = false;
_local5._visible = false;
_local5.enabled = false;
}
if (selectedRole.bUping) {
_local5._visible = false;
_local5.enabled = false;
}
if (selectedRole.blood == 100) {
_local7._visible = false;
_local6._visible = false;
_local6.enabled = false;
}
_local4.tLevel.text = _local3 + 2;
_local4.tCost.text = selectedRole.aUpCost[_local3];
_local4.tDamage.text = selectedRole.aDamage[_local3 + 1];
_local4.tPower.text = selectedRole.aRulePower[_local3 + 1];
_local4.tRange.text = selectedRole.aRange[_local3 + 1];
_local7.tCost.text = Math.ceil((((100 - selectedRole.blood) / 100) * selectedRole.cost) * 0.5);
}
function subGold(_sType) {
switch (_sType) {
case "clip" :
if (gold >= tackCost) {
gold = gold - tackCost;
}
break;
case "pen" :
if (gold >= penCost) {
gold = gold - penCost;
}
break;
case "calc" :
if (gold >= calcCost) {
gold = gold - calcCost;
}
break;
case "phone" :
if (gold >= phoneCost) {
gold = gold - phoneCost;
}
break;
case "rule" :
if (gold < ruleCost) {
break;
}
gold = gold - ruleCost;
}
}
function dcOver() {
if (bPass) {
return(undefined);
}
if (life == 0) {
bOver = true;
}
if (bOver) {
turnTo("temp");
trace(":::::::\u6E38\u620F\u7ED3\u675F::::::::");
aEnemy = mcLevel.aEnemy;
for (var _local3 in aEnemy) {
aEnemy[_local3].body.stop();
}
_root.bAllowMenu = false;
atMc(this, "mcOver");
delete onEnterFrame;
}
}
function dcPass() {
if (bOver) {
return(undefined);
}
if (nLevel == nMaxLevel) {
if (gameTime < 25) {
if (mcLevel.aEnemy.length == 0) {
bPass = true;
}
}
}
if (bPass) {
if (nLevel == nMaxLevel) {
_root.bAllowMenu = false;
atMc(this, "mcEnd");
delete onEnterFrame;
}
}
}
function dcPause() {
if (bPass) {
return(undefined);
}
if (bOver) {
return(undefined);
}
if (bEnd) {
return(undefined);
}
if (mcMenu instanceof MovieClip) {
return(undefined);
}
if (bStart) {
if (!(mcPause instanceof MovieClip)) {
pauseGame();
kill(mcPause);
atMc(this, "mcPause");
}
} else if (mcPause instanceof MovieClip) {
activeGame();
kill(mcPause);
}
}
function getGameTime() {
clearInterval(gameInter);
gameInter = setInterval(this, "getGameTime", 1000);
if (bPause) {
return(undefined);
}
if (!bStart) {
return(undefined);
}
if (gameTime > 0) {
gameTime = gameTime - 1;
} else {
nextLevel();
}
if (gameTime >= 10) {
disGameTime = gameTime;
} else {
disGameTime = "0" + gameTime;
}
}
function dcScore() {
disScore = Math.floor(score);
}
function onEnterFrame() {
dcScore();
dcOver();
dcPass();
}
stop();
trace("::::\u5F00\u59CB\u6E38\u620F::::");
gameTime = levelTime;
getGameTime();
var myLis = new Object();
bKeyDown = false;
myLis.onKeyDown = function () {
if (bKeyDown) {
return(undefined);
}
if (Key.isDown(80)) {
dcPause();
bKeyDown = true;
}
if (Key.isDown(83)) {
sell();
mcLayout.mcOption.gotoAndStop("temp");
bKeyDown = true;
}
if (Key.isDown(85)) {
upgrade();
disSellOption();
bKeyDown = true;
}
if (Key.isDown(82)) {
repair();
disSellOption();
bKeyDown = true;
}
};
myLis.onKeyUp = function () {
bKeyDown = false;
};
Key.addListener(myLis);
Symbol 5 MovieClip Frame 1
onEnterFrame = function () {
var _local4 = _root.getBytesLoaded();
var _local3 = _root.getBytesTotal();
var _local5 = int((_local4 / _local3) * 100);
num_txt.text = _local5 + "%";
if (_local4 == _local3) {
delete this.onEnterFrame;
if ((_root._mochiad instanceof MovieClip) != true) {
_root.play();
}
}
};
Symbol 9 MovieClip Frame 1
this._visible = false;
Symbol 9 MovieClip Frame 2
this._visible = true;
Symbol 9 MovieClip Frame 39
stop();
Instance of Symbol 2 MovieClip in Symbol 9 MovieClip Frame 39
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 1209 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("1.5");
}
static function showPreloaderAd(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 showTimedAd(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.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 _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 _local25 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local25);
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 _local24 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local24);
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) {
cb = parseInt(cb);
var _local4 = this._callbacks[cb];
if (!_local4) {
return(undefined);
}
delete this._callbacks[cb];
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 _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
if (_local7._url.indexOf("http") != 0) {
options.no_page = true;
}
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 _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_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 1210 MovieClip [__Packages.as.AStar] Frame 0
class as.AStar
{
var LEVEL, mc, nRow, nColumn, tileW, aTile, aO, aP, aPath, a8, ps, pe, iso, initTime, p1, p2, p3, p4, p5, p6, p7, p8;
function AStar (_mc, _nRow, _nColumn, _tileW) {
_global.initGlobalFun(this);
LEVEL = _root.mcLevel;
mc = _mc;
nRow = _nRow;
nColumn = _nColumn;
tileW = _tileW;
aTile = new Array();
aO = new Array();
aP = new Array();
aPath = new Array();
a8 = new Array("p8", "p6", "p4", "p2", "p7", "p5", "p3", "p1");
ps = new Object();
pe = new Object();
aTile = mc.aTile;
var _local5 = LEVEL.world.maxx;
var _local4 = LEVEL.world.maxz;
iso = new global.ISOView(_local5, _local4);
}
function setPs(_o) {
ps = _o;
}
function setPe(_o) {
pe = _o;
}
function reset() {
for (var _local5 in aP) {
if (!aP[_local5].bBlock) {
aP[_local5].mc.gotoAndStop("grid");
}
}
for (var _local6 in aTile) {
var _local3 = aTile[_local6];
for (var _local5 in _local3) {
var _local2 = _local3[_local5];
var _local4 = _local2.mc;
_local2.c = 1;
_local2.s = 1;
_local2.bOpen = false;
_local2.bClosed = false;
_local2.p = null;
}
}
aO = new Array();
aP = new Array();
aPath = new Array();
}
function stSearch() {
_root.bSearching = true;
if (!(ps instanceof Object)) {
getSearchTime();
_root.bSearching = false;
aPath = null;
trace(((ps.x + " ") + pe.x) + "::::\u8D77\u59CB\u70B9\u4E0D\u5B58\u5728\uFF0C\u6CA1\u6709\u53EF\u7528\u8DEF\u5F84::::");
return(undefined);
}
if (!(pe instanceof Object)) {
getSearchTime();
_root.bSearching = false;
aPath = null;
trace(((ps.x + " ") + pe.x) + "::::\u7EC8\u70B9\u4E0D\u5B58\u5728\uFF0C\u6CA1\u6709\u53EF\u7528\u8DEF\u5F84::::");
return(undefined);
}
initTime = getTimer();
ps.c = 0;
aO.push(ps);
search();
trace("::::Start Search::::");
}
function search() {
while (_root.bSearching) {
var _local5 = aO.length;
if (_local5 == 0) {
getSearchTime();
_root.bSearching = false;
aPath = null;
trace(((ps.x + " ") + pe.x) + "::::\u6CA1\u6709\u53EF\u7528\u8DEF\u5F84::::");
break;
}
var _local3 = aO[_local5 - 1];
for (var _local6 in aO) {
var _local4 = aO[_local6];
if (_local4.s < _local3.s) {
_local3 = _local4;
}
}
if (_local3 == pe) {
getSearchTime();
findPath();
_root.bSearching = false;
trace("::::\u627E\u5230\u76EE\u6807::::");
break;
}
rmvO(_local3);
addC(_local3);
dcAround(_local3);
}
}
function dcAround(_o) {
var _local7 = _o;
var _local9 = _local7.x;
var _local8 = _local7.y;
p1 = aTile[_local8 + 1][_local9];
p2 = aTile[_local8 + 1][_local9 + 1];
p3 = aTile[_local8][_local9 + 1];
p4 = aTile[_local8 - 1][_local9 + 1];
p5 = aTile[_local8 - 1][_local9];
p6 = aTile[_local8 - 1][_local9 - 1];
p7 = aTile[_local8][_local9 - 1];
p8 = aTile[_local8 + 1][_local9 - 1];
for (var _local10 in a8) {
var _local6 = a8[_local10];
var _local2 = this[_local6];
if (!(_local2 instanceof Object)) {
continue;
}
var _local3 = dcCost(_local2, _local7);
var _local5 = dcHeur(_local2);
var _local4 = _local3 + _local5;
if (_local4 >= 100000) {
continue;
}
if (_local2.bBlock) {
continue;
}
if (_local2.bOpen) {
continue;
}
if (_local2.bClosed) {
continue;
}
_local2.p = _local7;
_local2.c = _local3;
_local2.s = _local4;
addO(_local2);
}
}
function dcCost(_o, _p) {
var _local3 = _o;
var _local18 = _local3.x;
var _local15 = _local3.y;
var _local7 = _p.x;
var _local6 = _p.y;
var _local5 = _local7 - _local18;
var _local4 = _local6 - _local15;
var _local2 = 1;
if (_local5 != 0) {
if (_local4 != 0) {
_local2 = 1.41;
var _local10 = _local5 / Math.abs(_local5);
var _local12 = _local4 / Math.abs(_local4);
var _local16 = _local7 - _local10;
var _local13 = _local6;
var _local19 = aTile[_local13][_local16];
var _local14 = _local7;
var _local11 = _local6 - _local12;
var _local17 = aTile[_local11][_local14];
if (_local19.bBlock) {
_local2 = 100000 /* 0x0186A0 */;
}
if (_local17.bBlock) {
_local2 = 100000 /* 0x0186A0 */;
}
}
}
if (_local3.c != 0) {
var _local9 = _p.c + _local2;
} else {
var _local9 = 0;
}
return(_local9);
}
function dcHeur(_o) {
var _local4 = _o;
var _local9 = _local4.x;
var _local7 = _local4.y;
var _local3 = Math.abs(_local9 - pe.x);
var _local2 = Math.abs(_local7 - pe.y);
var _local6 = Math.min(_local3, _local2) * 1.41;
var _local5 = Math.max(_local3, _local2) - Math.min(_local3, _local2);
var _local8 = _local6 + _local5;
return(_local8);
}
function findPath() {
var _local2 = pe;
aP.push(_local2);
while (_local2.p != ps) {
_local2 = _local2.p;
aP.push(_local2);
}
for (var _local3 in aP) {
_local2 = aP[_local3];
aPath.push([_local2.x * tileW, (-_local2.y) * tileW]);
}
}
function getMinPath() {
return(aPath);
}
function getSearchTime() {
var _local3 = getTimer();
var _local2 = _local3 - initTime;
mc.searchTime = _local2;
}
function addO(_o) {
aO.push(_o);
_o.bOpen = true;
}
function rmvO(_o) {
var _local5 = _o;
var _local3 = aO;
var _local4 = _local3.length;
var _local2 = 0;
while (_local2 < _local4) {
if (_local5 == _local3[_local2]) {
_local3.splice(_local2, 1);
break;
}
_local2++;
}
_o.bOpen = false;
}
function addC(_o) {
_o.bClosed = true;
}
function rmvC(_o) {
_o.bClosed = false;
}
}
Symbol 1211 MovieClip [__Packages.global.ISOView] Frame 0
class global.ISOView
{
var maxx, maxz, sinTheta, cosTheta, sinAlpha, cosAlpha;
function ISOView (_maxx, _maxz) {
_global.initGlobalFun(this);
maxx = _maxx;
maxz = _maxz;
var _local4 = 30;
var _local5 = 45;
var _local3 = 0.0174532944444444;
sinTheta = Math.sin(_local4 * _local3);
cosTheta = Math.cos(_local4 * _local3);
sinAlpha = Math.sin(_local5 * _local3);
cosAlpha = Math.cos(_local5 * _local3);
}
function mapToScreen(xpp, ypp, zpp) {
var _local3 = ypp;
var _local4 = (xpp * cosAlpha) + (zpp * sinAlpha);
var _local2 = (zpp * cosAlpha) - (xpp * sinAlpha);
var _local6 = _local4;
var _local5 = (_local3 * cosTheta) - (_local2 * sinTheta);
return([_local6, _local5]);
}
function mapToIso(screenX, screenY) {
var _local2 = ((screenX / cosAlpha) - (screenY / (sinAlpha * sinTheta))) * (1 / ((cosAlpha / sinAlpha) + (sinAlpha / cosAlpha)));
var _local3 = (1 / cosAlpha) * (screenX - (_local2 * sinAlpha));
return([_local3, _local2]);
}
function dcDepth(x, y, z) {
var _local4 = 15;
x = Math.abs(x) * _local4;
y = Math.abs(y);
z = Math.abs(z) * _local4;
var _local2 = maxx;
var _local5 = maxz;
var _local9 = (_local2 * (_local5 - 1)) + x;
var _local6 = ((_local2 * (z - 1)) + x) + (_local9 * Math.abs(y));
return(Math.round(_local6));
}
}
Symbol 1212 MovieClip [__Packages.global.ISOWorld] Frame 0
class global.ISOWorld
{
var maxx, maxz, tileW, nRow, nColumn, width, height, path, aTile, iso;
function ISOWorld (_mc, _maxx, _maxz, _tileW, _nRow, _nColumn) {
_global.initGlobalFun(this);
maxx = _maxx;
maxz = _maxz;
tileW = _tileW;
nRow = _nRow;
nColumn = _nColumn;
width = maxx * tileW;
height = (-maxz) * tileW;
path = _mc;
aTile = new Array();
iso = new global.ISOView(maxx, maxz);
buildFloor();
}
function buildFloor() {
var _local10 = 0;
var _local4 = 0;
while (_local4 < nColumn) {
var _local12 = new Array();
var _local3 = 0;
while (_local3 < nRow) {
var _local7 = iso.dcDepth(_local3, _local10, _local4);
var _local8 = (("tile" + _local4) + "_") + _local3;
var _local2 = path.attachMovie("tile", _local8, _local7);
_local2.x = _local3;
_local2.y = _local10;
_local2.z = _local4;
_local2.depth = _local7;
var _local6 = {x:_local3, y:_local4, bBlock:false, mc:_local2, c:1, s:1, bClosed:false, p:null};
_local2.tileObj = _local6;
_local12.push(_local6);
var _local11 = _local3 * tileW;
var _local9 = (-_local4) * tileW;
var _local5 = iso.mapToScreen(_local11, _local10, _local9);
_local2._x = _local5[0];
_local2._y = _local5[1];
_local3++;
}
aTile.push(_local12);
_local4++;
}
}
}
Symbol 1213 MovieClip [__Packages.as.Enemy] Frame 0
class as.Enemy extends MovieClip
{
var THIS, LEVEL, range, bloodBar, normalv, highv, v, vy, g, blood, shootTime, tileW, nJumpLine, aFun, aTile, aBullet, aBossLight, aRole, aStartP, aEndP, aFirstP, bDie, bLighting, bSearched, bStSearch, aim, iso, currTilex, currTilez, isox, isoy, isoz, type, kind, splitNum, maxHitPoint, hitPoint, bonusGold, shakeInter, aPath, killArrayElem, _x, removeMovieClip, aCurrTypeArray, onEnterFrame, _y, tilex, tilez, swapDepths, gotoAndStop, damage, shootInter;
function Enemy () {
super();
_global.initGlobalFun(this);
THIS = this;
LEVEL = _root.mcLevel;
range._visible = false;
if (!_root.bShowBar) {
bloodBar._visible = false;
}
normalv = 1;
highv = 1.5;
v = normalv;
vy = 0;
g = 1;
blood = 100;
shootTime = 300;
tileW = LEVEL.world.tileW;
nJumpLine = -tileW;
aFun = new Array("toIso");
aTile = LEVEL.world.aTile;
aBullet = LEVEL.aBullet;
aBossLight = LEVEL.aBossLight;
aRole = LEVEL.aRole;
aStartP = LEVEL.aStartP;
aEndP = LEVEL.aEndP;
aFirstP = new Array();
bDie = false;
bLighting = false;
bSearched = false;
bStSearch = false;
aim = null;
iso = LEVEL.iso;
}
function initTileCoord(_currTilex, _currTilez) {
currTilex = _currTilex;
currTilez = _currTilez;
}
function initCoord(_isox, _isoy, _isoz) {
isox = _isox;
isoy = _isoy;
isoz = _isoz;
}
function initType(_type, _kind) {
type = _type;
kind = _kind;
switch (type) {
case "splitNormal" :
break;
case "normal" :
break;
case "group" :
break;
case "fast" :
initHighV();
break;
case "split" :
splitNum = 2;
break;
case "boss" :
initBoss();
break;
case "fly" :
break;
case "flyBoss" :
}
}
function initHitPoint(_hitPoint, _glod) {
maxHitPoint = _hitPoint;
hitPoint = _hitPoint;
bonusGold = _glod;
}
function initHighV() {
v = highv;
}
function slowdown(_rate) {
v = normalv * _rate;
}
function stShake() {
clearInterval(shakeInter);
shakeInter = setInterval(this, "shake", 100);
}
function stopShake() {
clearInterval(shakeInter);
}
function shake() {
var _local2 = ((Math.random() > 0.5) ? -1 : 1);
isox = isox + ((_local2 * Math.random()) * 3);
}
function resetSpeed() {
v = normalv;
}
function initComeOut() {
switch (type) {
case "splitNormal" :
activeEnemy();
aFun.push("initSplit");
break;
case "normal" :
activeEnemy();
aFun.push("comeOut");
break;
case "group" :
activeEnemy();
aFun.push("comeOut");
break;
case "fast" :
activeEnemy();
aFun.push("comeOut");
initHighV();
break;
case "split" :
activeEnemy();
aFun.push("comeOut");
splitNum = 2;
break;
case "boss" :
activeEnemy();
aFun.push("comeOut");
initBoss();
break;
case "fly" :
activeFlyEnemy();
aFun.push("flyComeOut");
break;
case "flyBoss" :
activeFlyEnemy();
aFun.push("flyComeOut");
}
}
function initSplit() {
if (aPath) {
aFun.push("mv");
killArrayElem(aFun, "initSplit");
}
}
function flying() {
var _local3 = 45;
isox = isox + (v * Math.cos(_local3 * 0.01745));
isoz = isoz + (v * Math.sin(_local3 * 0.01745));
if (_x > (680 - _root.worldx)) {
_root.loseLife();
removeMovieClip();
}
}
function flyComeOut() {
if (isox < nJumpLine) {
isox = isox + v;
}
if (isox >= nJumpLine) {
stJump();
aFun.push("flying");
killArrayElem(aFun, "flyComeOut");
}
}
function comeOut() {
if (isox < nJumpLine) {
isox = isox + v;
}
if (isox >= nJumpLine) {
stJump();
aFun.push("jump");
killArrayElem(aFun, "comeOut");
}
}
function jump() {
if (isoy < 0) {
vy = vy + g;
isox = isox + v;
isoy = isoy + vy;
} else if (isoy >= 0) {
land();
aFun.push("mv");
killArrayElem(aFun, "jump");
}
}
function stJump() {
LEVEL.bJumping = true;
}
function land() {
isoy = 0;
LEVEL.bJumping = false;
var _local3 = aStartP.length;
var _local2 = Math.floor(Math.random() * _local3);
aFirstP.push(aStartP[_local2][0], aStartP[_local2][1]);
currTilex = aFirstP[0];
currTilez = Math.abs(aFirstP[1]);
bStSearch = true;
stSearch();
}
function activeEnemy() {
LEVEL.aEnemy.push(this);
aCurrTypeArray = LEVEL.aEnemy;
}
function activeFlyEnemy() {
LEVEL.aFlyEnemy.push(this);
aCurrTypeArray = LEVEL.aFlyEnemy;
}
function pushaSearch() {
LEVEL.aSearch.push(this);
}
function stSearch() {
var _local2 = LEVEL.aUsePath.length;
if (_local2 > 0) {
setPath();
} else {
LEVEL.searchAllPath();
setPath();
}
bSearched = true;
}
function setPath() {
var _local2 = LEVEL.aUsePath.length;
var _local3 = LEVEL.aUsePath[Math.floor(Math.random() * _local2)];
aPath = _local3.slice();
}
function checkPath(_mode) {
if (!bStSearch) {
return(undefined);
}
var _local12 = true;
var _local11 = false;
if (aPath.length > 0) {
for (var _local14 in aPath) {
var _local8 = aPath[_local14];
var _local7 = _local8[0] / tileW;
var _local10 = Math.abs(_local8[1]) / tileW;
var _local9 = aTile[_local10][_local7];
if (_local9.bBlock) {
_local12 = false;
break;
}
}
} else {
_local12 = false;
}
if (!_local12) {
if (LEVEL.aUsePath.length > 0) {
trace((("\u5168\u5C40\u8DEF\u5F84\u5B58\u5728\uFF0C\u68C0\u67E5\u81EA\u5DF1\u662F\u4E0D\u662F\u5728\u5176\u4E2D " + currTilex) + " ") + currTilez);
for (var _local13 in LEVEL.aUsePath) {
var _local3 = LEVEL.aUsePath[_local13];
var _local17 = _local3.length;
var _local2 = 0;
while (_local2 < _local17) {
var _local4 = _local3[_local2];
var _local7 = currTilex * tileW;
var _local6 = (-currTilez) * tileW;
if (_local4[0] == _local7) {
if (_local4[1] == _local6) {
_local11 = true;
var _local5 = _local3.slice();
trace("aUP" + _local3);
_local5.splice(0, _local2 + 1);
aPath = _local5;
bSearched = true;
trace("\u5728\u5168\u5C40\u8DEF\u5F84\u4E2D\uFF0C\u622A\u53D6\u8DEF\u5F84" + aPath);
break;
}
}
_local2++;
}
}
}
if (!_local11) {
trace("\u4E0D\u5728\u5168\u5C40\u8DEF\u5F84\u4E2D\uFF0C\u91CD\u65B0\u5BFB\u8DEF");
var _local20 = aTile[currTilez][currTilex];
LEVEL.aStar.setPs(_local20);
var _local17 = LEVEL.aEndPUsable.length;
var _local15 = Math.floor(Math.random() * _local17);
var _local19 = LEVEL.aEndP[_local15][0];
var _local16 = LEVEL.aEndP[_local15][1];
var _local18 = aTile[_local16][_local19];
LEVEL.aStar.setPe(_local18);
LEVEL.searchPath();
if (LEVEL.aPath.length > 0) {
aPath = LEVEL.aPath.slice();
bSearched = true;
} else {
bSearched = false;
pushaSearch();
}
}
}
}
function initFrame() {
onEnterFrame = function () {
if (_root.bPause) {
return(undefined);
}
this.funManage(this, [this.aFun]);
};
}
function toIso() {
var _local2 = iso.mapToScreen(isox, isoy, isoz);
_x = _local2[0];
_y = _local2[1];
tilex = Math.floor(isox / tileW);
tilez = Math.floor(Math.abs(isoz) / tileW);
var _local3 = iso.dcDepth(tilex, 0, tilez);
_local3 = _local3 + 1;
swapDepths(_local3);
}
function mv() {
if (bDie) {
return(undefined);
}
if (aPath.length == 0) {
if (bSearched) {
_root.loseLife();
if (bDie) {
return(undefined);
}
bDie = true;
var _local4 = aCurrTypeArray;
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
if (this == _local4[_local3]) {
_local4.splice(_local3, 1);
break;
}
_local3++;
}
clearLight();
gotoAndStop("jump");
lossGold();
return(undefined);
}
return(undefined);
}
if (!aPath) {
return(undefined);
}
var _local11 = (aPath[0][0] - isox) + 10;
var _local10 = (aPath[0][1] - isoz) - 10;
var _local9 = Math.abs(_local11);
var _local8 = Math.abs(_local10);
var _local5 = Math.atan2(_local10, _local11) * 57.29578;
_local5 = _local5 % 360;
_local5 = (((_local5 % 360) < 0) ? (_local5 + 360) : (_local5));
var _local14 = Math.ceil(_local5 / 45);
gotoAndStop(_local14);
var _local7 = 2;
if (_local9 > _local7) {
var _local12 = _local11 / _local9;
if (_local8 > _local7) {
isox = isox + ((_local12 * v) * 0.7);
} else {
isox = isox + (_local12 * v);
}
}
if (_local8 > _local7) {
var _local13 = _local10 / _local8;
if (_local9 > _local7) {
isoz = isoz + ((_local13 * v) * 0.7);
} else {
isoz = isoz + (_local13 * v);
}
}
if (_local9 <= _local7) {
if (_local8 <= _local7) {
currTilex = Math.ceil(aPath[0][0] / tileW);
currTilez = Math.ceil(Math.abs(aPath[0][1] / tileW));
aPath.shift();
}
}
}
function getTileA() {
return([currTilex, currTilez]);
}
function lossBlood(_n) {
if (bDie) {
return(undefined);
}
hitPoint = hitPoint - _n;
blood = (100 * hitPoint) / maxHitPoint;
if (blood <= 0) {
hitPoint = 0;
blood = 0;
die();
} else {
bloodBar.bar._xscale = blood;
}
}
function die() {
if (bDie) {
return(undefined);
}
bDie = true;
var _local4 = aCurrTypeArray;
var _local5 = _local4.length;
var _local3 = 0;
while (_local3 < _local5) {
if (this == _local4[_local3]) {
_local4.splice(_local3, 1);
break;
}
_local3++;
}
clearLight();
if (type == "split") {
enemySplit();
}
if (type == "boss") {
_root.head = _root.head + 3;
_root.disConvert();
}
if (type == "flyBoss") {
_root.head = _root.head + 3;
_root.disConvert();
}
getGold();
gotoAndStop("die");
}
function getGold() {
_root.gold = _root.gold + bonusGold;
switch (_root.sHard) {
case "EASY" :
_root.score = _root.score + (bonusGold * 0.75);
break;
case "MEDIUM" :
_root.score = _root.score + bonusGold;
break;
case "HARD" :
_root.score = _root.score + (bonusGold * 1.25);
break;
case "INSANE" :
_root.score = _root.score + (bonusGold * 1.35);
break;
case "FREE" :
_root.score = _root.score + bonusGold;
}
}
function lossGold() {
_root.score = _root.score - 1;
if (_root.score <= 0) {
_root.score = 0;
}
}
function enemySplit() {
var _local6 = 0;
while (_local6 < splitNum) {
var _local8 = ((Math.random() > 0.5) ? 1 : -1);
var _local5 = isox + ((_local8 * Math.random()) * 12);
var _local4 = 0;
_local8 = ((Math.random() > 0.5) ? 1 : -1);
var _local3 = isoz + ((_local8 * Math.random()) * 12);
if (bStSearch) {
var _local7 = "splitNormal";
var _local2 = LEVEL.addEnemy(_local5, _local4, _local3, _local7, kind);
_local2.initTileCoord(currTilex, currTilez);
_local2.bStSearch = true;
_local2.pushaSearch();
} else {
var _local7 = "normal";
var _local2 = LEVEL.addEnemy(_local5, _local4, _local3, _local7, kind);
}
_local2.initComeOut();
_local2._xscale = 80;
_local2._yscale = 80;
_local2.initHitPoint(Math.floor(LEVEL.hitPoint * 0.7), Math.ceil(bonusGold * 0.6));
_local6++;
}
}
function initBoss() {
damage = 5;
shootInter = setInterval(this, "dcAim", shootTime);
}
function dcAim() {
var _local8 = false;
if (!(aim instanceof MovieClip)) {
aim = null;
_local8 = true;
} else {
var _local6 = aim._x + LEVEL.worldx;
var _local5 = aim._y + LEVEL.worldy;
var _local4 = range.hitTest(_local6, _local5, true);
if (!_local4) {
clearLight();
aim = null;
_local8 = true;
} else {
lightManage();
}
}
if (_local8) {
for (var _local7 in aRole) {
var _local3 = aRole[_local7];
var _local2 = _local3._parent;
var _local6 = _local2._x + LEVEL.worldx;
var _local5 = _local2._y + LEVEL.worldy;
var _local4 = range.hitTest(_local6, _local5, true);
if (_local4) {
aim = _local3;
lightManage();
break;
}
}
}
clearInterval(shootInter);
shootInter = setInterval(this, "dcAim", shootTime);
}
function clearLight() {
var _local3 = aBossLight.length;
var _local2 = 0;
while (_local2 < _local3) {
if (this == aBossLight[_local2][0]) {
aBossLight.splice(_local2, 1);
break;
}
_local2++;
}
}
function lightManage() {
clearLight();
if (bLighting) {
bLighting = false;
} else {
bLighting = true;
aim.lossBlood(damage);
aBossLight.push([this, aim]);
}
}
}
Symbol 1214 MovieClip [__Packages.as.Role] Frame 0
class as.Role extends MovieClip
{
var LEVEL, mcLight, mcTile, _parent, range, bloodBar, aFun, aDamage, aUpCost, aRange, aRole, aEnemy, aFlyEnemy, aBullet, aLight, blood, level, maxLevel, bShoot, bLighting, bSlow, bDie, bUping, body, nRange, type, cost, shootTime, roelName, speedType, weaponType, aRulePower, aSlowRate, rulePower, slowRate, damage, upCost, bullitType, _name, removeMovieClip, repairCost, upTime, upInterID, upInter, powerBar, onEnterFrame, aim, gotoAndStop, shootInter, aSlowEnemy, flyIhootInter, post, _visible;
function Role () {
super();
_global.initGlobalFun(this);
LEVEL = _root.mcLevel;
mcLight = LEVEL.mcLight;
mcTile = _parent;
range._visible = false;
bloodBar._visible = false;
aFun = new Array();
aDamage = new Array();
aUpCost = new Array();
aRange = new Array();
aRole = LEVEL.aRole;
aEnemy = LEVEL.aEnemy;
aFlyEnemy = LEVEL.aFlyEnemy;
aBullet = LEVEL.aBullet;
aLight = LEVEL.aLight;
blood = 100;
level = 0;
maxLevel = 5;
bShoot = false;
bLighting = false;
bSlow = false;
bDie = false;
bUping = false;
body.stop();
}
function initRange() {
var _local3 = (nRange / _root.defaultRange) * 100;
range._xscale = _local3;
range._yscale = _local3;
}
function initType(_type) {
type = _type;
switch (type) {
case "clip" :
cost = _root.clipCost;
aDamage = _root.aDamage1;
aUpCost = _root.aUpCost1;
aRange = _root.aRange1;
shootTime = _root.aShootTime[0];
roelName = _root.aRoleName[0];
speedType = _root.aSpeedType[0];
weaponType = _root.aWeaponType[0];
aFun.push("dcDir");
break;
case "pen" :
cost = _root.penCost;
aDamage = _root.aDamage2;
aUpCost = _root.aUpCost2;
aRange = _root.aRange2;
shootTime = _root.aShootTime[1];
roelName = _root.aRoleName[1];
speedType = _root.aSpeedType[1];
weaponType = _root.aWeaponType[1];
aFun.push("dcDir");
break;
case "calc" :
cost = _root.calcCost;
aDamage = _root.aDamage3;
aUpCost = _root.aUpCost3;
aRange = _root.aRange3;
shootTime = _root.aShootTime[2];
roelName = _root.aRoleName[2];
speedType = _root.aSpeedType[2];
weaponType = _root.aWeaponType[2];
aFun.push("dcRest");
break;
case "phone" :
cost = _root.phoneCost;
aDamage = _root.aDamage4;
aUpCost = _root.aUpCost4;
aRange = _root.aRange4;
shootTime = _root.aShootTime[3];
roelName = _root.aRoleName[3];
speedType = _root.aSpeedType[3];
weaponType = _root.aWeaponType[3];
aFun.push("dcRest");
break;
case "rule" :
cost = _root.ruleCost;
aRulePower = _root.aRulePower;
aSlowRate = _root.aSlowRate;
aUpCost = _root.aUpCost5;
aRange = _root.aRange5;
rulePower = aRulePower[level];
slowRate = aSlowRate[level];
shootTime = _root.aShootTime[4];
roelName = _root.aRoleName[4];
speedType = _root.aSpeedType[4];
weaponType = _root.aWeaponType[4];
break;
case "stapler" :
cost = _root.staplerCost;
aDamage = _root.aDamage6;
aUpCost = _root.aUpCost6;
aRange = _root.aRange6;
shootTime = _root.aShootTime[5];
roelName = _root.aRoleName[5];
speedType = _root.aSpeedType[5];
weaponType = _root.aWeaponType[5];
aFun.push("dcDir");
}
damage = aDamage[level];
upCost = aUpCost[level];
nRange = aRange[level];
initRange();
bullitType = type + "Bullit";
}
function sell() {
trace("\u5356\u4E86:" + _name);
LEVEL.currentTile = null;
_root.gold = _root.gold + Math.floor(cost * 0.7);
initTile();
removeMovieClip();
}
function repair() {
trace("\u4FEE\u590D\u4E86:" + _name);
if (blood == 100) {
return(undefined);
}
repairCost = Math.ceil((((100 - blood) / 100) * cost) * 0.5);
if (_root.gold > repairCost) {
_root.gold = _root.gold - repairCost;
_root.gold = Math.floor(_root.gold);
blood = 100;
bloodBar.bar._xscale = blood;
bloodBar._visible = false;
_root.disSellOption();
} else {
_root.mcLayout.noteMoney.gotoAndPlay(2);
}
}
function stUpgrade(T) {
trace("\u5347\u7EA7\u4E86:" + _name);
upTime = (T * 1000) / 60;
upInterID = 0;
if (level < maxLevel) {
_root.mcLayout.noteMoney.gotoAndStop(1);
_root.gold = _root.gold - upCost;
bUping = true;
range._visible = false;
mcTile.gotoAndStop("upgrade");
_root.disSellOption();
clearInterval(upInter);
upInter = setInterval(this, "upgrade", upTime);
}
}
function upgrade() {
trace(_name + "\u5347\u7EA7\u4E2D");
clearInterval(upInter);
if (upInterID == 60) {
bUping = false;
level = level + 1;
powerBar.gotoAndStop(level + 1);
cost = cost + upCost;
damage = aDamage[level];
upCost = aUpCost[level];
nRange = aRange[level];
initRange();
if (type == "rule") {
rulePower = aRulePower[level];
}
_root.disSellOption();
mcTile.gotoAndStop("block");
} else {
upInterID = upInterID + 1;
upInter = setInterval(this, "upgrade", upTime);
if (_root.selectedRole == this) {
_root.cakeMange(upInterID + 1);
}
}
}
function initFrame() {
onEnterFrame = function () {
if (_root.bPause) {
return(undefined);
}
this.funManage(this, [this.aFun]);
};
}
function dcDir() {
if (aim instanceof MovieClip) {
var _local6 = mcTile._x;
var _local4 = mcTile._y;
var _local5 = aim._x;
var _local3 = aim._y;
var _local8 = _local5 - _local6;
var _local7 = _local3 - _local4;
var _local2 = Math.atan2(_local7, _local8) * 57.29578;
_local2 = _local2 % 360;
_local2 = (((_local2 % 360) < 0) ? (_local2 + 360) : (_local2));
var _local9 = Math.ceil(_local2 / 45);
gotoAndStop(_local9);
} else {
body.stop();
}
}
function dcRest() {
if (aim instanceof MovieClip) {
gotoAndStop("attack");
} else {
gotoAndStop("rest");
}
}
function stDcEnemy() {
switch (type) {
case "clip" :
dcGEnemy();
break;
case "pen" :
dcAEnemy();
dcGEnemy();
break;
case "calc" :
dcAEnemy();
break;
case "phone" :
dcPhoneEnemy();
break;
case "rule" :
dcRuleEnemy();
break;
case "stapler" :
dcAEnemy();
dcGEnemy();
}
}
function dcRuleEnemy() {
clearInterval(shootInter);
shootInter = setInterval(this, "dcRuleEnemy", shootTime);
if (_root.bPause) {
return(undefined);
}
gotoAndStop("rest");
if (bUping) {
bSlow = false;
body.stop();
for (var _local7 in aSlowEnemy) {
aSlowEnemy[_local7].resetSpeed();
aSlowEnemy[_local7].stopShake();
}
return(undefined);
}
for (var _local7 in aSlowEnemy) {
aSlowEnemy[_local7].resetSpeed();
aSlowEnemy[_local7].stopShake();
}
aSlowEnemy = new Array();
for (var _local8 in aEnemy) {
var _local3 = aEnemy[_local8];
var _local6 = _local3._x + LEVEL.worldx;
var _local5 = _local3._y + LEVEL.worldy;
var _local4 = range.hitTest(_local6, _local5, true);
if (_local4) {
aSlowEnemy.push(_local3);
slowdown();
}
}
}
function slowdown() {
if (bSlow) {
bSlow = false;
for (var _local2 in aSlowEnemy) {
aSlowEnemy[_local2].resetSpeed();
aSlowEnemy[_local2].stopShake();
}
gotoAndStop("rest");
} else {
bSlow = true;
for (var _local3 in aSlowEnemy) {
aSlowEnemy[_local3].slowdown(slowRate);
aSlowEnemy[_local3].stShake();
}
gotoAndStop("attack");
}
}
function dcPhoneEnemy() {
clearInterval(shootInter);
shootInter = setInterval(this, "dcPhoneEnemy", shootTime);
if (_root.bPause) {
return(undefined);
}
if (bUping) {
clearLight();
bLighting = false;
aim = null;
body.stop();
return(undefined);
}
var _local9 = false;
if (!(aim instanceof MovieClip)) {
aim = null;
_local9 = true;
body.stop();
} else {
var _local6 = aim._x + LEVEL.worldx;
var _local5 = aim._y + LEVEL.worldy;
var _local4 = range.hitTest(_local6, _local5, true);
if (!_local4) {
clearLight();
aim = null;
_local9 = true;
body.stop();
} else {
lightManage();
}
}
if (_local9) {
for (var _local8 in aEnemy) {
var _local3 = aEnemy[_local8];
var _local6 = _local3._x + LEVEL.worldx;
var _local5 = _local3._y + LEVEL.worldy;
var _local4 = range.hitTest(_local6, _local5, true);
if (_local4) {
aim = _local3;
lightManage();
break;
}
}
for (var _local7 in aFlyEnemy) {
var _local3 = aFlyEnemy[_local7];
var _local6 = _local3._x + LEVEL.worldx;
var _local5 = _local3._y + LEVEL.worldy;
var _local4 = range.hitTest(_local6, _local5, true);
if (_local4) {
aim = _local3;
lightManage();
break;
}
}
}
}
function clearLight() {
var _local3 = aLight.length;
var _local2 = 0;
while (_local2 < _local3) {
if (mcTile == aLight[_local2][0]) {
aLight.splice(_local2, 1);
break;
}
_local2++;
}
}
function lightManage() {
clearLight();
if (bLighting) {
shootTime = 1400;
bLighting = false;
} else {
shootTime = 400;
bLighting = true;
aim.lossBlood(damage);
aLight.push([mcTile, aim]);
}
}
function dcAEnemy() {
clearInterval(flyIhootInter);
flyIhootInter = setInterval(this, "dcAEnemy", shootTime);
if (_root.bPause) {
return(undefined);
}
if (bUping) {
aim = null;
body.stop();
return(undefined);
}
if (aFlyEnemy.length == 0) {
body.stop();
return(undefined);
}
var _local8 = false;
if (!(aim instanceof MovieClip)) {
aim = null;
_local8 = true;
body.stop();
} else {
var _local6 = aim._x + LEVEL.worldx;
var _local5 = aim._y + LEVEL.worldy;
var _local4 = range.hitTest(_local6, _local5, true);
if (!_local4) {
aim = null;
_local8 = true;
body.stop();
} else {
shoot();
}
}
if (_local8) {
for (var _local7 in aFlyEnemy) {
var _local3 = aFlyEnemy[_local7];
var _local6 = _local3._x + LEVEL.worldx;
var _local5 = _local3._y + LEVEL.worldy;
var _local4 = range.hitTest(_local6, _local5, true);
if (_local4) {
aim = _local3;
shoot();
break;
}
}
}
}
function dcGEnemy() {
clearInterval(shootInter);
shootInter = setInterval(this, "dcGEnemy", shootTime);
if (_root.bPause) {
return(undefined);
}
if (bUping) {
aim = null;
body.stop();
return(undefined);
}
if (aEnemy.length == 0) {
return(undefined);
}
var _local8 = false;
if (!(aim instanceof MovieClip)) {
aim = null;
_local8 = true;
} else {
var _local6 = aim._x + LEVEL.worldx;
var _local5 = aim._y + LEVEL.worldy;
var _local4 = range.hitTest(_local6, _local5, true);
if (!_local4) {
aim = null;
_local8 = true;
} else {
shoot();
}
}
if (_local8) {
for (var _local7 in aEnemy) {
var _local3 = aEnemy[_local7];
var _local6 = _local3._x + LEVEL.worldx;
var _local5 = _local3._y + LEVEL.worldy;
var _local4 = range.hitTest(_local6, _local5, true);
if (_local4) {
aim = _local3;
shoot();
break;
}
}
}
}
function shoot() {
body.play();
LEVEL.bulletID = LEVEL.bulletID + 1;
if (LEVEL.bulletID > LEVEL.bulletMaxNum) {
LEVEL.bulletID = 1;
}
var _local3 = LEVEL.mcWorld.getNextHighestDepth();
var _local2 = LEVEL.mcWorld.attachMovie(bullitType, "bullet" + LEVEL.bulletID, _local3);
_local2._x = mcTile._x + post._x;
_local2._y = mcTile._y + post._y;
_local2.aim = aim;
_local2.damage = damage;
_local2.type = "role";
_local2._rotation = Math.random() * 360;
if (bullitType == "calcBullit") {
_local2.body.gotoAndStop(Math.ceil(Math.random() * 6));
}
aBullet.push(_local2);
}
function lossBlood(_n) {
blood = blood - _n;
bloodBar._visible = true;
bloodBar.bar._xscale = blood;
_root.score = _root.score - 1;
if (_root.score <= 0) {
_root.score = 0;
}
if (blood <= 0) {
die();
}
}
function die() {
if (bDie) {
return(undefined);
}
bDie = true;
initTile();
_visible = false;
onEnterFrame = null;
var _local4 = aRole.length;
var _local3 = 0;
while (_local3 < _local4) {
if (this == aRole[_local3]) {
aRole.splice(_local3, 1);
break;
}
_local3++;
}
clearLight();
if (_root.selRole == this) {
_root.outBuyFun();
_root.selRole = null;
}
removeMovieClip();
}
function initTile() {
var _local12 = LEVEL.aTile;
var _local3 = LEVEL.aStar;
mcTile.gotoAndStop("normal");
var _local14 = mcTile.tileObj;
_local14.bBlock = false;
if (_local14.bIsEnd) {
LEVEL.aEndPNoBLK.push(_local14.aEndP);
var _local6 = Math.floor(Math.random() * LEVEL.aStartP.length);
var _local9 = LEVEL.aStartP[_local6][1];
var _local10 = LEVEL.aStartP[_local6][0];
var _local11 = _local12[_local9][_local10];
_local3.setPs(_local11);
var _local8 = _local14;
_local3.setPe(_local8);
_local3.reset();
_local3.stSearch();
LEVEL.aPath = LEVEL.aStar.getMinPath();
if (LEVEL.aPath) {
LEVEL.aEndPUsable.push(_local14.aEndP);
}
trace((("\u8FD9\u4E2A\u65B9\u5757\u662F\u7EC8\u70B9\uFF1A" + _local14.aEndP) + " ") + LEVEL.aEndPNoBLK);
} else if (_local14.bIsStart) {
LEVEL.aStartP.push(_local14.aStartP);
trace("\u8FD9\u4E2A\u65B9\u5757\u662F\u8D77\u70B9\uFF1A" + _local14.aStartP);
} else {
trace("\u8FD9\u4E2A\u65B9\u5757\u662F\u666E\u901A\u70B9\uFF1A");
var _local15 = new Array();
var _local16 = LEVEL.aEndPNoBLK.length;
var _local4 = 0;
while (_local4 < _local16) {
trace("\u5FAA\u73AF\u641C\u7D22");
var _local6 = Math.floor(Math.random() * LEVEL.aStartP.length);
var _local9 = LEVEL.aStartP[_local6][1];
var _local10 = LEVEL.aStartP[_local6][0];
var _local11 = _local12[_local9][_local10];
_local3.setPs(_local11);
var _local7 = LEVEL.aEndPNoBLK[_local4][1];
var _local2 = LEVEL.aEndPNoBLK[_local4][0];
var _local8 = _local12[_local7][_local2];
_local3.setPe(_local8);
_local3.reset();
_local3.stSearch();
LEVEL.aPath = _local3.getMinPath();
if (LEVEL.aPath) {
_local15.push(LEVEL.aPath);
var _local5 = true;
for (var _local13 in LEVEL.aEndPUsable) {
if (LEVEL.aEndPUsable[_local13][0] == _local2) {
_local5 = false;
}
}
if (_local5) {
LEVEL.aEndPUsable.push([_local2, _local7]);
}
trace("aEndPNoBLK: " + LEVEL.aEndPNoBLK);
trace("aEndPUsable: " + LEVEL.aEndPUsable);
}
_local4++;
}
if (_local15.length > 0) {
LEVEL.aUsePath = _local15.slice();
}
}
}
}
Symbol 1215 MovieClip [__Packages.global.GlobalFun] Frame 0
class global.GlobalFun
{
function GlobalFun () {
initFun();
}
function initFun() {
_global.initGlobalFun = function (_mc) {
var _local2 = _mc;
_local2.turnTo = _global.turnTo;
_local2.kill = _global.kill;
_local2.nextDepth = _global.nextDepth;
_local2.atMc = _global.atMc;
_local2.atMc2 = _global.atMc2;
_local2.newMc = _global.newMc;
_local2.killInter = _global.killInter;
_local2.killArrayElem = _global.killArrayElem;
_local2.funManage = _global.funManage;
_local2.funManage2 = _global.funManage2;
_local2.fixUI2 = _global.fixUI2;
_local2.oddsManage = _global.oddsManage;
_local2.frame2Time = _global.frame2Time;
_local2.time2Frame = _global.time2Frame;
_local2.changeColor = _global.changeColor;
_local2.newFPS = _global.newFPS;
_local2.drawManage = _global.drawManage;
_local2.newMasker = _global.newMasker;
_local2.keyManage = _global.keyManage;
_local2.car2Flash = _global.car2Flash;
_local2.flash2Car = _global.flash2Car;
_local2.car2Polar = _global.car2Polar;
_local2.polar2Car = _global.polar2Car;
_local2.getCoordG = _global.getCoordG;
_local2.getCoordG2 = _global.getCoordG2;
_local2.getCoordL = _global.getCoordL;
_local2.randPole = _global.randPole;
_local2.rand = _global.rand;
_local2.intRand = _global.intRand;
_local2.floor = _global.floor;
_local2.ceil = _global.ceil;
_local2.round = _global.round;
_local2.sqrt = _global.sqrt;
_local2.abs = _global.abs;
_local2.getDis = _global.getDis;
_local2.getL2 = _global.getL2;
_local2.getL3 = _global.getL3;
_local2.sinD = _global.sinD;
_local2.cosD = _global.cosD;
_local2.atan2D = _global.atan2D;
_local2.asinD = _global.asinD;
_local2.acosD = _global.acosD;
_local2.tanD = _global.tanD;
_local2.d2r = _global.d2r;
_local2.r2d = _global.r2d;
_local2.fixAng = _global.fixAng;
_local2.getAng = _global.getAng;
_local2.getAng2 = _global.getAng2;
_local2.getOutAng = _global.getOutAng;
_local2.getRo = _global.getRo;
_local2.classRo = _global.classRo;
_local2.classRo2 = _global.classRo2;
};
_global.turnTo = function (_sFrame) {
var _local2 = _root;
_local2.gotoAndStop(_sFrame);
};
_global.kill = function (_mc) {
_mc.removeMovieClip();
if (_mc) {
_mc.swapDepths(0);
_mc.removeMovieClip();
}
};
_global.nextDepth = function (_mc) {
var _local1 = _mc.getNextHighestDepth();
return(_local1);
};
_global.atMc = function (_dir, _mc, _newName) {
var _local2 = _dir.getNextHighestDepth();
if (!_newName) {
_newName = _mc;
}
var _local1 = _dir.attachMovie(_mc, _newName, _local2);
return(_local1);
};
_global.atMc2 = function (_dir, _mc, _newName) {
var _local1 = _dir.getNextHighestDepth();
if (!_newName) {
_newName = _mc;
}
var _local2 = _dir.attachMovie(_mc, _newName + _local1, _local1);
return(_local2);
};
_global.newMc = function (_dir, _mc) {
var _local2 = _dir.getNextHighestDepth();
var _local1 = _dir.createEmptyMovieClip(_mc, _local2);
return(_local1);
};
_global.newMc2 = function (_dir, _mc) {
var _local1 = _dir.getNextHighestDepth();
var _local2 = _dir.createEmptyMovieClip(_mc + _local1, _local1);
return(_local2);
};
_global.killInter = function (_dir, _aInter) {
_dir.onUnload = function () {
for (var _local1 in _aInter) {
clearInterval(_dir[_aInter[_local1]]);
}
};
};
_global.killArrayElem = function (_a, _elem) {
var _local6 = _elem;
var _local2 = _a;
var _local5 = _local2.length;
var _local1 = 0;
var _local4 = 0;
var _local3 = false;
while (_local1 < _local5) {
if (_local6 == _local2[_local1]) {
_local4 = _local1;
_local3 = true;
break;
}
_local1++;
}
if (_local3) {
_local2.splice(_local4, 1);
}
};
_global.funManage = function (_dir, _aFun) {
var _local3 = _dir;
var _local2 = _aFun;
for (var _local5 in _local2) {
var _local1 = _local2[_local5];
for (var _local4 in _local1) {
_local3[_local1[_local4]]();
}
}
};
_global.funManage2 = function (_dir, _aFun) {
var _local6 = _dir;
var _local5 = _aFun;
for (var _local8 in _local5) {
var _local4 = _local5[_local8];
for (var _local7 in _local4) {
var _local2 = _local6[_local4[_local7]];
var _local3 = _local2.aFun;
this.funManage(_local2, [_local3]);
}
}
};
_global.fixUI2 = function () {
_root.reserved.swapDepths(-2);
_root.focusManager.swapDepths(-1);
};
_global.oddsManage = function (_dir, _aOdds, _aFun) {
var _local8 = _aOdds.length;
var _local6 = Math.random();
var _local7 = 0;
var _local2 = 0;
while (_local2 < _local8) {
var _local3 = 0;
var _local4 = _aOdds[_local2];
var _local1 = 0;
while (_local1 < _local2) {
_local3 = _local3 + _aOdds[_local1];
_local1++;
}
_local4 = _local4 + _local3;
if (_local6 >= _local3) {
if (_local6 < _local4) {
_local7 = _local2;
break;
}
}
_local2++;
}
return(_dir[_aFun[_local7]]());
};
_global.frame2Time = function (_nFrames, _FPS) {
var _local1 = (_nFrames / _FPS) * 1000;
return(_local1);
};
_global.time2Frame = function (_T, _FPS) {
var _local1 = (_T / 1000) * _FPS;
return(_local1);
};
_global.changeColor = function (_mc, _colorTrans) {
var _local1 = new Color(_mc);
_local1.setTransform(_colorTrans);
};
_global.newFPS = function (_vis) {
var mcFPS = this.newMc(_root, "mcFPS");
if (_vis == undefined) {
_vis = true;
}
if (_vis) {
mcFPS.createTextField("FPSTextField", this.nextDepth(mcFPS), 20, 10, 50, 20);
}
var fps = 0;
mcFPS.onEnterFrame = function () {
fps++;
};
mcFPS.calcFPS = function () {
if (_vis) {
mcFPS.FPSTextField.text = String("FPS: " + fps);
}
fps = 0;
};
setInterval(mcFPS, "calcFPS", 1000);
};
_global.drawManage = function (_mc, aLineStyle, aCoord, aFillColor, baseName) {
var _local7 = _mc;
_local7.lineStyle(aLineStyle[0], aLineStyle[1], aLineStyle[2]);
var _local4 = aCoord[0][0];
var _local3 = aCoord[0][1];
_local7.moveTo(_local4, _local3);
if (aFillColor) {
if (typeof(aFillColor[0]) == "number") {
_local7.beginFill(aFillColor[0], aFillColor[1]);
} else {
_local7.beginBitmapFill(aFillColor[0], aFillColor[1], aFillColor[2], aFillColor[3]);
}
}
var _local5 = 1;
var _local11 = aCoord.length;
while (_local5 < _local11) {
if (baseName) {
var _local2 = this.newMc2(_local7, baseName);
_local2.cacheAsBitmap = true;
_local2.lineStyle(aLineStyle[0], aLineStyle[1], aLineStyle[2]);
_local2.moveTo(_local4, _local3);
}
_local4 = aCoord[_local5][0];
_local3 = aCoord[_local5][1];
_local7.lineTo(_local4, _local3);
if (_local2) {
_local2.lineTo(_local4, _local3);
}
_local5++;
}
if (aFillColor) {
_local7.endFill();
}
};
_global.newMasker = function (aColor, _dir, w, h, L) {
if (!aColor) {
aColor = [0, 100];
}
if (!_dir) {
_dir = _root;
}
if (!w) {
w = Stage.width;
}
if (!h) {
h = Stage.height;
}
if (!L) {
L = 500;
}
this.kill(_dir[_dir._name + "Masker"]);
var _local7 = this.newMc(_dir, _dir._name + "Masker");
var _local12 = [[-L, -L], [w + L, -L], [w + L, 0], [-L, 0]];
var _local11 = [[-L, h], [w + L, h], [w + L, h + L], [-L, h + L]];
var _local10 = [[-L, -L], [0, -L], [0, h + L], [-L, h + L]];
var _local9 = [[w, -L], [w + L, -L], [w + L, h + L], [w, h + L]];
this.drawManage(_local7, [1, 0, 0], _local12, [aColor[0], aColor[1]]);
this.drawManage(_local7, [1, 0, 0], _local11, [aColor[0], aColor[1]]);
this.drawManage(_local7, [1, 0, 0], _local10, [aColor[0], aColor[1]]);
this.drawManage(_local7, [1, 0, 0], _local9, [aColor[0], aColor[1]]);
};
_global.keyManage = function (_dir, aKey, aFun, aExtFun) {
var keyManager = this.newMc(_dir, _dir._name + "KeyManager");
for (var _local4 in aKey) {
var _local2 = aKey[_local4];
keyManager["bDown" + _local2] = false;
}
var len = aKey.length;
keyManager.onEnterFrame = function () {
var _local2 = 0;
while (_local2 < len) {
var _local1 = aKey[_local2];
if (Key.isDown(_local1)) {
if (!keyManager["bDown" + _local1]) {
_dir[aFun[_local2][1]]();
keyManager["bDown" + _local1] = true;
}
_dir[aFun[_local2][0]]();
}
if (!Key.isDown(_local1)) {
if (keyManager["bDown" + _local1]) {
_dir[aFun[_local2][2]]();
keyManager["bDown" + _local1] = false;
}
}
_local2++;
}
_dir[aExtFun]();
};
};
_global.classMenu = function (_dir, aMenu, aFun, aExtFun) {
var _local4 = aMenu.length;
var _local3 = 0;
while (_local3 < _local4) {
var _local2 = _dir[aMenu[_local3]];
_local2.onRollOver = function () {
this.gotoAndPlay(2);
_dir[aExtFun[0]]();
};
_local2.onRollOut = function () {
this.gotoAndPlay(this._totalframes - this._currentframe);
_dir[aExtFun[1]]();
};
if (aFun) {
_local2.id = _local3;
_local2.onPress = function () {
_dir[aFun[this.id]]();
};
}
_local3++;
}
};
_global.classMenu2 = function (_dir, aMenu, aExtFun) {
var len = aMenu.length;
var _local6 = this.newMc2(_dir, "mcHit");
_local6.onEnterFrame = function () {
var _local3 = 0;
while (_local3 < len) {
var _local2 = _dir[aMenu[_local3]];
var _local4 = _local2.hitTest(_root._xmouse, _root._ymouse, true);
if (_local4) {
if (!_local2.bHited) {
_local2.gotoAndPlay(2);
_dir[aExtFun[0]]();
_local2.bHited = true;
}
} else if (_local2.bHited) {
_local2.gotoAndPlay(_local2._totalframes - _local2._currentframe);
_dir[aExtFun[1]]();
_local2.bHited = false;
}
_local3++;
}
};
};
_global.randPlay = function (_mc) {
if (!_mc.bInited) {
_mc.gotoAndPlay(this.intRand(_mc._totalframes));
_mc.bInited = true;
}
};
_global.car2Flash = function (_o) {
_o._y = _o._y * -1;
_o._rotation = _o._rotation * -1;
};
_global.flash2Car = function (_o) {
return(this.car2Flash(_o));
};
_global.car2Polar = function (x, y) {
var _local2 = Math.sqrt((x * x) + (y * y));
var _local5 = this.atan2D(y, x);
return({r:_local2, a:_local5});
};
_global.polar2Car = function (len, ang) {
var _local3 = len * this.cosD(ang);
var _local2 = len * this.sinD(ang);
return({x:_local3, y:_local2});
};
_global.getCoordG = function (_mc) {
var _local1 = {x:_mc._x, y:_mc._y};
_mc._parent.localToGlobal(_local1);
return(_local1);
};
_global.getCoordG2 = function (_mc, xx, yy) {
var _local1 = {x:xx, y:yy};
_mc.localToGlobal(_local1);
return(_local1);
};
_global.getCoordL = function (_mc, xx, yy) {
var _local1 = {x:xx, y:yy};
_mc._parent.globalToLocal(_local1);
return(_local1);
};
_global.randPole = function () {
var _local1 = ((Math.random() > 0.5) ? 1 : -1);
return(_local1);
};
_global.rand = function (_n) {
if (!_n) {
_n = 1;
}
var _local2 = Math.random() * _n;
return(_local2);
};
_global.intRand = function (_n) {
var _local1 = Math.floor(Math.random() * _n);
return(_local1);
};
_global.floor = function (_n) {
var _local1 = Math.floor(_n);
return(_local1);
};
_global.ceil = function (_n) {
var _local1 = Math.ceil(_n);
return(_local1);
};
_global.round = function (_n) {
var _local1 = Math.round(_n);
return(_local1);
};
_global.sqrt = function (_n) {
var _local1 = Math.sqrt(_n);
return(_local1);
};
_global.abs = function (_n) {
var _local1 = Math.abs(_n);
return(_local1);
};
_global.getDis = function (x1, y1, x2, y2) {
var _local2 = x2 - x1;
var _local1 = y2 - y1;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
};
_global.getL2 = function (l1, l3) {
var _local1 = Math.sqrt((l3 * l3) - (l1 * l1));
return(_local1);
};
_global.getL3 = function (l1, l2) {
var _local1 = Math.sqrt((l1 * l1) + (l2 * l2));
return(_local1);
};
_global.sinD = function (_angle) {
var _local1 = Math.sin((_angle * 3.141593) / 180);
return(_local1);
};
_global.cosD = function (_angle) {
var _local1 = Math.cos((_angle * 3.141593) / 180);
return(_local1);
};
_global.atan2D = function (y, x) {
var _local1 = Math.atan2(y, x) * 57.29578;
return(_local1);
};
_global.asinD = function (_ratio) {
var _local1 = Math.asin(_ratio) * 57.29578;
return(_local1);
};
_global.acosD = function (_ratio) {
var _local1 = Math.acos(_ratio) * 57.29578;
return(_local1);
};
_global.tanD = function (_angle) {
var _local1 = Math.tan((_angle * 3.141593) / 180);
return(_local1);
};
_global.d2r = function (_angle) {
var _local1 = _angle * 0.017453;
return(_local1);
};
_global.r2d = function (_radian) {
var _local1 = _radian * 57.29578;
return(_local1);
};
_global.fixAng = function (_ang) {
var _local1 = _ang % 360;
var _local2 = (((_local1 % 360) < 0) ? (_local1 + 360) : (_local1));
return(_local2);
};
_global.getAng = function (x1, y1, x2, y2) {
var _local1 = Math.atan2(y2 - y1, x2 - x1) * 57.29578;
return(_local1);
};
_global.getAng2 = function (_a1, _a2) {
var _local4 = this.fixAng(_a1);
var _local3 = this.fixAng(_a2);
var _local2 = this.abs(_local3 - _local4);
if (_local2 > 180) {
_local2 = 360 - _local2;
}
_local2 = this.fixAng(_local2);
return(_local2);
};
_global.getOutAng = function (_lineAng, _inAng) {
var _local1 = (_lineAng * 2) - _inAng;
return(_local1);
};
_global.getRo = function (_a1, _a2, _mod, _r, _m) {
var _local7 = this.fixAng(_a1);
var _local2 = this.fixAng(_a2);
var _local5 = _r;
var _local6 = _local7 - _local2;
var _local3 = this.abs(_local6);
if (_local3 < _m) {
return(_local2);
}
var _local4 = _local3 / _local6;
if (_local3 > 180) {
_local3 = 360 - _local3;
_local4 = -_local4;
}
if (_mod == 1) {
_local2 = _local2 + ((_local4 * _local3) * _local5);
} else {
_local2 = _local2 + (_local4 * _local5);
}
_local2 = this.fixAng(_local2);
return(_local2);
};
_global.classRo = function (xx, yy, _ang, _ox, _oy) {
var _local8 = xx;
var _local7 = yy;
var _local2 = _ang;
var _local6 = _ox;
var _local5 = _oy;
_local8 = _local8 - _local6;
_local7 = _local7 - _local5;
var _local4 = (this.cosD(_local2) * _local8) - (this.sinD(_local2) * _local7);
var _local3 = (this.cosD(_local2) * _local7) + (this.sinD(_local2) * _local8);
_local4 = _local4 + _local6;
_local3 = _local3 + _local5;
return({x:_local4, y:_local3});
};
_global.classRo2 = function (xx, yy, _mc, offsetAng) {
var _local5 = xx;
var _local4 = yy;
var _local2 = this.atan2D(_local4, _local5);
if (_mc) {
if (!offsetAng) {
offsetAng = 0;
}
_mc._rotation = _local2 + offsetAng;
}
return(_local2);
};
}
}
Symbol 15 Button
on (release) {
gotoAndStop ("submit");
}
Symbol 21 Button
on (release) {
gotoAndStop (1);
}
Symbol 31 Button
on (release) {
gotoAndStop ("submited");
}
Symbol 36 Button
on (release) {
viewHighscore();
}
Symbol 37 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;
}
if (_root.sHard == "FREE") {
this._visible = false;
}
trace(game_name);
trace(highscore);
trace("http://www.freeworldgroup.com/score/index.asp?game=" + game_name);
Symbol 37 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 17 MovieClip in Symbol 37 MovieClip Frame 3
on (release) {
}
Symbol 112 Button
on (release) {
getURL ("http://www.freeworldgroup.com/koalafiles.htm", "_blank");
}
on (rollOver) {
_root.sdBt.start();
}
Symbol 115 Button
on (release) {
getURL ("http://www.ifungames.com", "_blank");
}
on (rollOver) {
_root.sdBt.start();
}
Symbol 118 Button
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
on (rollOver) {
_root.sdBt.start();
}
Symbol 121 Button
on (release) {
viewHighscore();
}
on (rollOver) {
_root.sdBt.start();
}
Symbol 124 Button
on (release) {
_root.backToFrontPage();
}
on (rollOver) {
_root.sdBt.start();
}
Symbol 127 Button
on (release) {
_root.tryAgain();
}
on (rollOver) {
_root.sdBt.start();
}
Symbol 128 MovieClip [mcEnd] Frame 10
stop();
_root.bPause = true;
_root.mcLayout.removeMovieClip();
Instance of Symbol 37 MovieClip in Symbol 128 MovieClip [mcEnd] Frame 10
//component parameters
onClipEvent (construct) {
_game_name = "revenge_of_the_stick";
score_var = "_root.disScore";
}
Symbol 137 Button
on (release) {
if (!_root.bNoted) {
_root.bNoted = true;
_parent.gotoAndStop("start");
} else {
_parent.gotoAndPlay("gameStart");
}
}
Symbol 142 Button
on (release) {
_root.backToFrontPage();
}
Symbol 147 MovieClip Frame 1
stop();
Symbol 151 MovieClip Frame 1
stop();
Symbol 155 MovieClip Frame 1
stop();
Symbol 159 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 1
stop();
Symbol 164 MovieClip Frame 15
function initMode() {
switch (_root.sHard) {
case "EASY" :
mcEasy.gotoAndStop("on");
currMc = mcEasy;
break;
case "MEDIUM" :
mcMedium.gotoAndStop("on");
currMc = mcMedium;
break;
case "HARD" :
mcHard.gotoAndStop("on");
currMc = mcHard;
break;
case "INSANE" :
mcInsane.gotoAndStop("on");
currMc = mcInsane;
break;
case "FREE" :
mcFree.gotoAndStop("on");
currMc = mcFree;
}
}
stop();
mcEasy.onPress = function () {
currMc.gotoAndStop("off");
currMc = this;
currMc.gotoAndStop("on");
_root.sHard = "EASY";
_root.initNormalMode();
};
mcMedium.onPress = function () {
currMc.gotoAndStop("off");
currMc = this;
currMc.gotoAndStop("on");
_root.sHard = "MEDIUM";
_root.initNormalMode();
};
mcHard.onPress = function () {
currMc.gotoAndStop("off");
currMc = this;
currMc.gotoAndStop("on");
_root.sHard = "HARD";
_root.initNormalMode();
};
mcInsane.onPress = function () {
currMc.gotoAndStop("off");
currMc = this;
currMc.gotoAndStop("on");
_root.sHard = "INSANE";
_root.initNormalMode();
};
mcFree.onPress = function () {
currMc.gotoAndStop("off");
currMc = this;
currMc.gotoAndStop("on");
_root.sHard = "FREE";
_root.initFreeMode();
};
initMode();
Symbol 201 Button
on (release) {
gotoAndPlay ("background");
}
Symbol 202 Button
on (release) {
gotoAndStop ("p2");
}
Symbol 205 Button
on (release) {
_parent.gotoAndStop("warning");
}
Symbol 240 Button
on (release) {
gotoAndStop ("p1");
}
Symbol 241 Button
on (release) {
gotoAndStop ("p3");
}
Symbol 246 Button
on (release) {
gotoAndStop ("p2");
}
Symbol 260 Button
on (release) {
_parent.gotoAndStop("warning");
}
Symbol 264 Button
on (release) {
gotoAndStop ("p1");
}
Symbol 267 MovieClip Frame 1
gotoAndPlay ("background");
Symbol 267 MovieClip Frame 15
stop();
_root.stopVoice();
Symbol 267 MovieClip Frame 22
_root.stopVoice();
Symbol 267 MovieClip Frame 29
_root.stopVoice();
Symbol 267 MovieClip Frame 40
_root.startVoice();
Symbol 267 MovieClip Frame 1275
stop();
Symbol 282 Button
on (release) {
_parent.gotoAndPlay("gameStart");
}
Symbol 283 MovieClip [UI_warning] Frame 1
stop();
Symbol 284 MovieClip Frame 1
stop();
this.gotoAndStop("mode");
Symbol 284 MovieClip Frame 10
stop();
Symbol 284 MovieClip Frame 20
stop();
Symbol 284 MovieClip Frame 40
_root.stopVoice();
_root.mcLayout.gotoAndStop("start");
Symbol 284 MovieClip Frame 50
stop();
Symbol 295 MovieClip Frame 1
stop();
Symbol 295 MovieClip Frame 2
stop();
Symbol 295 MovieClip Frame 6
_root.mcLevel.fistkillEnemy();
Symbol 320 MovieClip Frame 1
btClose.onPress = function () {
_root.currRole = null;
this._parent._parent.gotoAndStop("temp");
};
Symbol 363 MovieClip Frame 1
stop();
Symbol 373 MovieClip Frame 1
btClose.onPress = function () {
_root.currRole = null;
this._parent._parent.gotoAndStop("temp");
};
Symbol 384 MovieClip Frame 1
stop();
Symbol 389 MovieClip Frame 1
stop();
Symbol 412 MovieClip Frame 1
stop();
Symbol 419 MovieClip Frame 1
btClose.onPress = function () {
_root.currRole = null;
_root.unselFist();
this._parent._parent.gotoAndStop("temp");
};
Symbol 420 MovieClip Frame 1
stop();
Symbol 420 MovieClip Frame 30
btSell.onPress = function () {
_root.sell();
_root.mcLayout.mcOption.gotoAndStop("temp");
};
btRepair.onPress = function () {
_root.repair();
_root.disSellOption();
};
btUpgrade.onPress = function () {
_root.upgrade();
_root.disSellOption();
};
Symbol 420 MovieClip Frame 40
btSell.onPress = function () {
_root.sell();
_root.mcLayout.mcOption.gotoAndStop("temp");
};
btRepair.onPress = function () {
_root.repair();
_root.disSellOption();
};
btUpgrade.onPress = function () {
_root.upgrade();
_root.disSellOption();
};
Symbol 421 MovieClip Frame 1
stop();
Symbol 424 MovieClip Frame 1
stop();
Symbol 428 MovieClip Frame 1
stop();
Symbol 451 MovieClip Frame 1
stop();
Symbol 451 MovieClip Frame 20
_parent.mcNextLevel._x = -1000;
Symbol 457 MovieClip Frame 1
stop();
Symbol 457 MovieClip Frame 2
stop();
Symbol 463 MovieClip Frame 1
stop();
Symbol 463 MovieClip Frame 2
stop();
Symbol 467 MovieClip Frame 1
stop();
Symbol 467 MovieClip Frame 2
stop();
Symbol 469 MovieClip Frame 1
if (!_parent.flash_start) {
gotoAndStop (10);
}
Symbol 469 MovieClip Frame 10
stop();
Symbol 470 MovieClip Frame 9
stop();
_parent.flash_start = true;
Symbol 474 MovieClip Frame 1
stop();
Symbol 474 MovieClip Frame 2
stop();
Symbol 476 MovieClip Frame 1
stop();
Symbol 476 MovieClip Frame 2
stop();
Symbol 478 MovieClip Frame 1
stop();
Symbol 478 MovieClip Frame 2
stop();
Symbol 480 MovieClip Frame 1
stop();
Symbol 480 MovieClip Frame 2
stop();
Symbol 481 MovieClip Frame 1
stop();
Symbol 481 MovieClip Frame 10
function quality_init() {
switch (_quality) {
case "LOW" :
bt4.gotoAndStop(2);
return;
case "MEDIUM" :
bt3.gotoAndStop(2);
return;
case "HIGH" :
bt2.gotoAndStop(2);
return;
case "BEST" :
bt1.gotoAndStop(2);
}
}
function bt_init() {
bt1.gotoAndStop(1);
bt2.gotoAndStop(1);
bt3.gotoAndStop(1);
bt4.gotoAndStop(1);
}
stop();
quality_init();
bt1.bt.onPress = function () {
bt_init();
_quality = "BEST";
quality_init();
bt1.gotoAndStop(2);
};
bt2.bt.onPress = function () {
bt_init();
_quality = "HIGH";
quality_init();
bt2.gotoAndStop(2);
};
bt3.bt.onPress = function () {
bt_init();
_quality = "MEDIUM";
quality_init();
bt3.gotoAndStop(2);
};
bt4.bt.onPress = function () {
bt_init();
_quality = "LOW";
quality_init();
bt4.gotoAndStop(2);
};
Symbol 482 MovieClip Frame 1
hit = false;
opend = false;
onEnterFrame = function () {
dcHitMenu();
dcMenu();
};
dcHitMenu = function () {
var _local2 = btQuality.hitTest(_root._xmouse, _root._ymouse, false);
if (_local2) {
hit = true;
} else {
hit = false;
}
};
dcMenu = function () {
if (hit && (!opend)) {
qualityMenu.gotoAndPlay(1);
btQuality.gotoAndStop(2);
opend = true;
}
if (!hit) {
if (opend) {
qualityMenu.gotoAndPlay(11);
opend = false;
}
btQuality.gotoAndStop(1);
}
};
if (!_root.bMusicOn) {
btMusic.gotoAndStop(2);
}
if (!_root.bSoundOn) {
btSound.gotoAndStop(2);
}
btMusic.onPress = function () {
btMusic.play();
_root.bMusicOn = !_root.bMusicOn;
_root.initMusic();
};
btSound.onPress = function () {
btSound.play();
_root.bSoundOn = !_root.bSoundOn;
_root.initSD();
};
Instance of Symbol 457 MovieClip "btMusic" in Symbol 482 MovieClip Frame 1
on (release) {
_root.setMusic(this);
}
Instance of Symbol 463 MovieClip "btSound" in Symbol 482 MovieClip Frame 1
on (release) {
_root.setSound(this);
}
Symbol 486 Button
on (rollOver) {
_root.sdBt.start();
}
Symbol 504 Button
on (release) {
_root.convertFun("phone");
}
Symbol 507 MovieClip Frame 1
stop();
Symbol 516 Button
on (release) {
_root.convertFun("rule");
}
Symbol 519 MovieClip Frame 1
stop();
Symbol 528 Button
on (release) {
_root.convertFun("stapler");
}
Symbol 531 MovieClip Frame 1
stop();
Symbol 540 Button
on (release) {
_root.convertFun("gold");
}
Symbol 541 MovieClip Frame 1
stop();
Symbol 550 MovieClip Frame 1
tInterest.text = (_root.interest * 100) + "%";
Symbol 554 Button
on (release) {
_root.convertFun("interest");
}
Symbol 557 MovieClip Frame 1
stop();
Symbol 566 Button
on (release) {
_root.convertFun("life");
}
Symbol 567 MovieClip Frame 1
stop();
Symbol 569 MovieClip Frame 1
stop();
_root.disConvert();
btClose.onPress = function () {
this._parent.gotoAndStop("temp");
};
Symbol 569 MovieClip Frame 11
stop();
Symbol 576 Button
on (rollOver) {
_root.overBuyFun("phone");
}
on (rollOut) {
_root.outBuyFun();
}
on (release) {
_root.selRole("phone");
}
Symbol 577 MovieClip Frame 1
stop();
Symbol 578 Button
on (rollOver) {
_root.overBuyFun("rule");
}
on (rollOut) {
_root.outBuyFun();
}
on (release) {
_root.selRole("rule");
}
Symbol 579 MovieClip Frame 1
stop();
Symbol 580 Button
on (rollOver) {
_root.overBuyFun("stapler");
}
on (rollOut) {
_root.outBuyFun();
}
on (release) {
_root.selRole("stapler");
}
Symbol 581 MovieClip Frame 1
stop();
Symbol 584 Button
on (rollOver) {
_root.overBuyFun("fist");
}
on (rollOut) {
_root.outBuyFun();
}
on (release) {
_root.selFist("fist");
}
Symbol 587 Button
on (rollOver) {
_root.overBuyFun("fist");
}
on (rollOut) {
_root.outBuyFun();
}
Symbol 588 MovieClip Frame 1
stop();
Symbol 591 Button
on (rollOver) {
_root.sdBt.start();
}
Symbol 594 Button
on (release) {
_root.nextLevel();
}
on (rollOver) {
_root.sdBt.start();
}
Symbol 596 Button
on (release) {
waitNote.gotoAndPlay(1);
}
Symbol 600 MovieClip Frame 1
stop();
Symbol 601 MovieClip Frame 1
stop();
Symbol 607 Button
on (rollOver) {
_root.sdBt.start();
}
Symbol 608 MovieClip [mcLayout] Frame 1
stop();
Symbol 608 MovieClip [mcLayout] Frame 10
function initLayoutBt(mc) {
with (mc) {
mcNextLevel.btStart.onPress = function () {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
_root.activeGame();
_root.startGame();
mcNextLevel.gotoAndStop("nextLevel");
};
btReset.onPress = function () {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
_root.tryAgain();
};
mcNextLevel.btNextLevel.onPress = function () {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
_root.nextLevel();
};
barControl.onPress = function () {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
_root.barControl();
};
btClip.onPress = function () {
_root.selRole("clip");
};
btClip.onRollOver = function () {
_root.overBuyFun("clip");
};
btClip.onRollOut = function () {
_root.outBuyFun();
};
btPen.onPress = function () {
_root.selRole("pen");
};
btPen.onRollOver = function () {
_root.overBuyFun("pen");
};
btPen.onRollOut = function () {
_root.outBuyFun();
};
btCalc.onPress = function () {
_root.selRole("calc");
};
btCalc.onRollOver = function () {
_root.overBuyFun("calc");
};
btCalc.onRollOut = function () {
_root.outBuyFun();
};
mcPhone.btPhoneGray.onRollOver = function () {
_root.overBuyFun("phone");
};
mcPhone.btPhoneGray.onRollOut = function () {
_root.outBuyFun();
};
mcRule.btRuleGray.onRollOver = function () {
_root.overBuyFun("rule");
};
mcRule.btRuleGray.onRollOut = function () {
_root.outBuyFun();
};
mcStapler.btStaplerGray.onRollOver = function () {
_root.overBuyFun("stapler");
};
mcStapler.btStaplerGray.onRollOut = function () {
_root.outBuyFun();
};
btPause.onPress = function () {
_root.dcPause();
};
btMenu.onPress = function () {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
_root.bPause = true;
atMc(_root, "mcMenu");
trace("\u8FD4\u56DE\u83DC\u5355!!!!");
};
}
}
initLayoutBt(this);
Symbol 611 Button
on (release) {
_root.bPause = false;
_root.mcLayout._x = 0;
this.removeMovieClip();
}
on (rollOver) {
_root.sdBt.start();
}
Symbol 614 MovieClip [mcMenu] Frame 10
stop();
_root.mcLayout._x = -1000;
Instance of Symbol 613 MovieClip in Symbol 614 MovieClip [mcMenu] Frame 10
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 666 MovieClip Frame 1
if (!inited) {
_frame = Math.floor(Math.random() * _totalframes);
gotoAndPlay(_frame);
inited = true;
}
Symbol 672 MovieClip Frame 1
if (!inited) {
_frame = Math.floor(Math.random() * _totalframes);
gotoAndPlay(_frame);
inited = true;
}
Symbol 678 MovieClip Frame 1
if (!inited) {
_frame = Math.floor(Math.random() * _totalframes);
gotoAndPlay(_frame);
inited = true;
}
Symbol 683 MovieClip Frame 10
stop();
_root.mcLayout.removeMovieClip();
Instance of Symbol 2 MovieClip in Symbol 683 MovieClip Frame 10
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 686 MovieClip [mcOver] Frame 1
stop();
_root.bPause = true;
Instance of Symbol 37 MovieClip in Symbol 686 MovieClip [mcOver] Frame 1
//component parameters
onClipEvent (construct) {
_game_name = "revenge_of_the_stick";
score_var = "_root.disScore";
}
Symbol 689 MovieClip [mcPause] Frame 1
stop();
_root.bPause = true;
btContinue.onPress = function () {
_root.continueGame();
};
btRetry.onPress = function () {
_root.tryAgain();
};
btViewScore.onPress = function () {
viewHighscore();
};
btMore.onPress = function () {
getURL ("http://www.freeworldgroup.com/", "_blank");
};
btDownload.onPress = function () {
getURL ("http://www.ifungames.com", "_blank");
};
btAddGame.onPress = function () {
getURL ("http://www.freeworldgroup.com/koalafiles.htm", "_blank");
};
btMainMenu.onPress = function () {
turnTo("main_menu");
};
Symbol 702 MovieClip Frame 1
stop();
Symbol 706 MovieClip [calcBullit] Frame 1
stop();
Symbol 706 MovieClip [calcBullit] Frame 2
play();
Symbol 706 MovieClip [calcBullit] Frame 8
stop();
this.removeMovieClip();
Symbol 712 MovieClip [clipBullit] Frame 1
stop();
Symbol 712 MovieClip [clipBullit] Frame 2
play();
Symbol 712 MovieClip [clipBullit] Frame 8
stop();
this.removeMovieClip();
Symbol 719 MovieClip [penBullit] Frame 1
stop();
Symbol 719 MovieClip [penBullit] Frame 2
play();
Symbol 719 MovieClip [penBullit] Frame 8
stop();
this.removeMovieClip();
Symbol 723 MovieClip [staplerBullit] Frame 1
stop();
Symbol 723 MovieClip [staplerBullit] Frame 2
play();
Symbol 723 MovieClip [staplerBullit] Frame 8
stop();
this.removeMovieClip();
Symbol 725 MovieClip Frame 1
_visible = false;
Symbol 764 MovieClip Frame 11
stop();
this._parent.swapDepths(0);
this._parent.removeMovieClip();
Symbol 770 MovieClip Frame 43
stop();
this._parent.removeMovieClip();
Symbol 771 MovieClip [boss] Frame 1
#initclip 18
Object.registerClass("boss", as.Enemy);
#endinitclip
stop();
Symbol 812 MovieClip Frame 43
stop();
this._parent.removeMovieClip();
Symbol 813 MovieClip [man1] Frame 1
#initclip 8
Object.registerClass("man1", as.Enemy);
#endinitclip
stop();
Symbol 813 MovieClip [man1] Frame 15
Symbol 854 MovieClip Frame 43
stop();
this._parent.removeMovieClip();
Symbol 855 MovieClip [man2] Frame 1
#initclip 9
Object.registerClass("man2", as.Enemy);
#endinitclip
stop();
Symbol 857 MovieClip [man3] Frame 1
#initclip 10
Object.registerClass("man3", as.Enemy);
#endinitclip
stop();
Symbol 858 MovieClip [man4] Frame 1
#initclip 11
Object.registerClass("man4", as.Enemy);
#endinitclip
stop();
Symbol 866 MovieClip Frame 1
stop();
Symbol 876 MovieClip [calc] Frame 1
#initclip 12
Object.registerClass("calc", as.Role);
#endinitclip
stop();
Symbol 876 MovieClip [calc] Frame 11
stop();
Symbol 902 MovieClip [clip] Frame 1
#initclip 13
Object.registerClass("clip", as.Role);
#endinitclip
stop();
Symbol 928 MovieClip [pen] Frame 1
#initclip 14
Object.registerClass("pen", as.Role);
#endinitclip
stop();
Symbol 936 MovieClip [phone] Frame 1
#initclip 15
Object.registerClass("phone", as.Role);
#endinitclip
stop();
Symbol 944 MovieClip [rule] Frame 1
#initclip 16
Object.registerClass("rule", as.Role);
#endinitclip
stop();
Symbol 970 MovieClip [stapler] Frame 1
#initclip 17
Object.registerClass("stapler", as.Role);
#endinitclip
stop();
Symbol 999 MovieClip [mcLevel] Frame 1
function levelInit() {
if (bLevelInited) {
return(undefined);
}
bLevelInited = true;
worldx = _root.worldx;
worldy = _root.worldy;
mcWorld = newMc(this, "mcWorld");
mcWorld._x = worldx;
mcWorld._y = worldy;
enemyID = 0;
bulletV = 4;
bulletID = 0;
bulletMaxNum = 999;
nEnemy = 0;
maxGroup = 1;
aRole = new Array();
aAllEnemy = new Array();
aEnemy = new Array();
aFlyEnemy = new Array();
aEnemyKind = new Array();
aSearch = new Array();
aBullet = new Array();
aLight = new Array();
aBossLight = new Array();
aLevel = new Array();
aUsePath = new Array();
createWorld();
initLevelEnemy();
initEnemy();
atMc(this, "mcLight");
mcLight._x = worldx;
mcLight._y = worldy;
atMc(this, "mcLight", "mcBossLight");
mcBossLight._x = worldx;
mcBossLight._y = worldy;
worldMasker = atMc(this, "worldMasker");
mcWorld.setMask(worldMasker);
levelInit = null;
bJumping = false;
bNextLocked = false;
startP1 = new Array(0, 10);
startP2 = new Array(0, 11);
aStartP = new Array();
aStartP.push(startP1);
aStartP.push(startP2);
endP1 = new Array(9, 0);
endP2 = new Array(10, 0);
endP3 = new Array(11, 0);
aEndP = new Array();
aEndP.push(endP1);
aEndP.push(endP2);
aEndP.push(endP3);
aEndPNoBLK = aEndP.slice();
aEndPUsable = aEndP.slice();
startTile1 = aTile[startP1[1]][startP1[0]];
startTile2 = aTile[startP2[1]][startP2[0]];
startTile1.bIsStart = true;
startTile1.aStartP = startP1;
startTile2.bIsStart = true;
startTile2.aStartP = startP2;
endTile1 = aTile[endP1[1]][endP1[0]];
endTile2 = aTile[endP2[1]][endP2[0]];
endTile3 = aTile[endP3[1]][endP3[0]];
endTile1.bIsEnd = true;
endTile1.aEndP = endP1;
endTile1.endID = 1;
endTile1.bUsable = true;
endTile2.bIsEnd = true;
endTile2.aEndP = endP2;
endTile2.endID = 2;
endTile2.bUsable = true;
endTile3.bIsEnd = true;
endTile3.aEndP = endP3;
endTile3.endID = 3;
endTile3.bUsable = true;
searchAllPath();
}
function createWorld() {
maxx = 20;
maxz = 20;
tileW = 32;
nRow = 13;
nColumn = 13;
var _local2 = 0;
world = new global.ISOWorld(mcWorld, maxx, maxz, tileW, nRow, nColumn);
aTile = world.aTile;
iso = world.iso;
aStar = new as.AStar(this, nRow, nColumn, tileW);
}
function initLevelEnemy() {
aLevel.push(["normal", 10, "man1", 20, 1]);
aLevel.push(["normal", 10, "man2", 40, 1]);
aLevel.push(["group", 10, "man1", 60, 1]);
aLevel.push(["normal", 15, "man2", 80, 1]);
aLevel.push(["split", 4, "man1", 100, 1]);
aLevel.push(["group", 10, "man2", 120, 2]);
aLevel.push(["boss", 1, "boss", 1400, 30]);
aLevel.push(["fly", 8, "man3", 100, 2]);
aLevel.push(["split", 5, "man2", 150, 2]);
aLevel.push(["normal", 15, "man2", 200, 2]);
aLevel.push(["normal", 20, "man1", 230, 3]);
aLevel.push(["fast", 8, "man2", 260, 3]);
aLevel.push(["group", 10, "man1", 290, 3]);
aLevel.push(["boss", 1, "boss", 5000, 50]);
aLevel.push(["normal", 20, "man1", 350, 3]);
aLevel.push(["fly", 12, "man3", 300, 4]);
aLevel.push(["normal", 20, "man1", 450, 4]);
aLevel.push(["split", 8, "man2", 320, 4]);
aLevel.push(["normal", 20, "man1", 550, 4]);
aLevel.push(["normal", 20, "man2", 670, 5]);
aLevel.push(["boss", 1, "boss", 10000, 80]);
aLevel.push(["split", 12, "man2", 740, 5]);
aLevel.push(["normal", 18, "man1", 810, 5]);
aLevel.push(["normal", 18, "man2", 880, 5]);
aLevel.push(["fly", 12, "man3", 950, 5]);
aLevel.push(["fast", 12, "man2", 1040, 6]);
aLevel.push(["normal", 16, "man1", 1130, 6]);
aLevel.push(["flyBoss", 1, "man4", 6500, 100]);
aLevel.push(["normal", 16, "man2", 1220, 6]);
aLevel.push(["split", 12, "man2", 1310, 6]);
aLevel.push(["normal", 18, "man1", 1410, 7]);
aLevel.push(["split", 15, "man2", 1510, 7]);
aLevel.push(["boss", 1, "boss", 16000, 100]);
aLevel.push(["normal", 18, "man2", 1710, 7]);
aLevel.push(["fast", 12, "man1", 1810, 7]);
aLevel.push(["group", 18, "man1", 2910, 8]);
aLevel.push(["normal", 18, "man1", 310, 8]);
aLevel.push(["normal", 18, "man2", 3210, 8]);
aLevel.push(["fly", 15, "man3", 3310, 8]);
aLevel.push(["boss", 1, "boss", 50000, 100]);
aLevel.push(["split", 16, "man2", 4410, 9]);
aLevel.push(["normal", 18, "man2", 4510, 9]);
aLevel.push(["fly", 18, "man3", 3610, 3]);
aLevel.push(["normal", 18, "man2", 4810, 9]);
aLevel.push(["normal", 18, "man1", 6010, 9]);
aLevel.push(["flyBoss", 2, "man4", 50000, 100]);
aLevel.push(["split", 18, "man1", 7210, 9]);
aLevel.push(["group", 18, "man2", 8010, 9]);
aLevel.push(["fast", 16, "man2", 9010, 9]);
aLevel.push(["boss", 1, "boss", 150000, 200]);
}
function initEnemy() {
nEnemy = 0;
var _local2 = _root.nLevel - 1;
nextEnemyType = aLevel[_local2 + 1][0];
thirdEnemyType = aLevel[_local2 + 2][0];
if (_local2 == (_root.nMaxLevel - 2)) {
nextEnemyType = aLevel[_local2 + 1][0];
_root.mcLayout.levelNote.gotoAndStop("second");
} else if (_local2 == (_root.nMaxLevel - 1)) {
_root.mcLayout.levelNote.gotoAndStop("final");
}
switch (_root.sHard) {
case "EASY" :
var _local3 = 0.6 + (Math.floor((_root.nLevel - 1) / 5) * 0);
break;
case "MEDIUM" :
_local3 = 1 + (Math.floor((_root.nLevel - 1) / 5) * 0);
break;
case "HARD" :
_local3 = 1 + (Math.floor((_root.nLevel - 1) / 5) * 0.01);
break;
case "INSANE" :
_local3 = 1.2 + (Math.floor((_root.nLevel - 1) / 5) * 0.02);
break;
case "FREE" :
_local3 = 1 + (Math.floor((_root.nLevel - 1) / 5) * 0.02);
}
enemyType = aLevel[_local2][0];
maxEnemyNum = aLevel[_local2][1];
enemyKind = aLevel[_local2][2];
aEnemyKind.push([enemyType, enemyKind, maxEnemyNum]);
hitPoint = aLevel[_local2][3] * _local3;
bonusGold = aLevel[_local2][4];
}
function onEnterFrame() {
mvHand();
if (_root.bPause) {
return(undefined);
}
searchManage();
bulletManage();
lightManage();
dcMaxGroup();
}
function mvHand() {
if (_root.fistTimes == 0) {
return(undefined);
}
var _local2 = _root.mcLayout.hand;
if (_root.bUseFist) {
var _local4 = mcWorld._xmouse;
var _local3 = mcWorld._ymouse;
_local2._x = _xmouse;
_local2._y = _ymouse;
}
}
function fistkillEnemy() {
var _local4 = _root.mcLayout.hand;
if (_root.fistTimes >= 1) {
_root.fistTimes = _root.fistTimes - 1;
}
for (var _local6 in aEnemy) {
var _local2 = aEnemy[_local6];
var _local3 = _local4.range.hitTest(_local2.hitA);
if (_local3) {
_local2.lossBlood(_root.fistDamage);
}
}
for (var _local5 in aFlyEnemy) {
var _local2 = aFlyEnemy[_local5];
var _local3 = _local4.range.hitTest(_local2.hitA);
if (_local3) {
_local2.lossBlood(_root.fistDamage);
}
}
trace("fist killing!!!");
}
function dcMaxGroup() {
if (!_root.bStart) {
return(undefined);
}
var _local2 = aEnemyKind.length;
if (_local2 < maxGroup) {
if (bNextLocked) {
bNextLocked = false;
_root.mcLayout.mcNextLevel.gotoAndStop("nextLevel");
}
} else if (_local2 == maxGroup) {
if (!bNextLocked) {
bNextLocked = true;
_root.mcLayout.mcNextLevel.gotoAndStop("locked");
}
}
}
function enemyManage() {
if (enemyType == "group") {
var _local13 = 200 + (Math.random() * 500);
} else {
var _local13 = 500 + (Math.random() * 900);
}
clearInterval(enemyInter);
enemyInter = setInterval(this, "enemyManage", _local13);
if (_root.bPause) {
return(undefined);
}
var _local12 = aEnemyKind.length;
var _local3 = 0;
while (_local3 < _local12) {
var _local4 = aEnemyKind[_local3][2];
if (_local4 > 0) {
var enemyType = aEnemyKind[_local3][0];
var _local11 = aEnemyKind[_local3][1];
_local4 = _local4 - 1;
aEnemyKind[_local3][2] = _local4;
_local3++;
} else {
aEnemyKind.splice(_local3, 1);
_local12 = aEnemyKind.length;
break;
}
var _local9 = 4;
var _local10 = Math.floor(Math.random() * _local9);
var _local8 = -5 * tileW;
var _local7 = -50;
var _local6 = (-10 - _local10) * tileW;
var _local5 = addEnemy(_local8, _local7, _local6, enemyType, _local11);
_local5.initComeOut();
_local5.initHitPoint(hitPoint, bonusGold);
}
}
function addEnemy(_isox, _isoy, _isoz, _type, _kind) {
enemyID = enemyID + 1;
if (enemyID > 100) {
enemyID = 1;
}
var _local2 = mcWorld.getNextHighestDepth();
var _local1 = mcWorld.attachMovie(_kind, "enemy" + enemyID, _local2, {_x:-1000});
_local1.initCoord(_isox, _isoy, _isoz);
_local1.initFrame();
_local1.initType(_type, _kind);
return(_local1);
}
function searchManage() {
if (!_root.bSearching) {
var _local2 = aSearch[0];
var _local3 = _local2.getTileA();
if (_local3) {
if (_local2.bDie) {
aSearch.shift();
return(undefined);
}
if (!(_local2 instanceof MovieClip)) {
aSearch.shift();
return(undefined);
}
_local2.checkPath();
aSearch.shift();
}
}
}
function searchPath() {
aStar.reset();
aStar.stSearch();
aPath = aStar.getMinPath();
}
function searchAllPath() {
var _local9 = new Array();
var _local10 = aEndPNoBLK.length;
var _local1 = 0;
while (_local1 < _local10) {
var _local2 = Math.floor(Math.random() * aStartP.length);
var _local5 = aStartP[_local2][1];
var _local6 = aStartP[_local2][0];
var _local7 = aTile[_local5][_local6];
aStar.setPs(_local7);
var _local8 = aEndPNoBLK[_local1][1];
var _local3 = aEndPNoBLK[_local1][0];
var _local4 = aTile[_local8][_local3];
aStar.setPe(_local4);
aStar.reset();
aStar.stSearch();
aPath = aStar.getMinPath();
if (aPath) {
_local9.push(aPath);
}
_local1++;
}
if (_local9.length > 0) {
aUsePath = _local9.slice();
}
}
function bulletManage() {
for (var _local12 in aBullet) {
var _local1 = aBullet[_local12];
var _local3 = _local1.aim;
if (_local1.type == "role") {
var _local5 = Math.atan2((_local3._y - 10) - _local1._y, _local3._x - _local1._x) * 57.29578;
} else {
var _local6 = _local1.aim._parent;
var _local5 = Math.atan2((_local6._y - 10) - _local1._y, _local6._x - _local1._x) * 57.29578;
}
var _local11 = _local1.damage;
var _local9 = bulletV * Math.cos(_local5 * 0.01745);
var _local8 = bulletV * Math.sin(_local5 * 0.01745);
_local1._x = _local1._x + _local9;
_local1._y = _local1._y + _local8;
var _local4 = false;
var _local10 = _local1.hitTest(_local3.hitA);
if (_local10) {
_local4 = true;
}
if (_local3.bDie) {
_local4 = true;
}
if (!(_local3 instanceof MovieClip)) {
_local4 = true;
}
if (!_local5) {
_local4 = true;
}
if (_local4) {
_local3.lossBlood(_local11);
var _local7 = aBullet.length;
var _local2 = 0;
while (_local2 < _local7) {
if (_local1 == aBullet[_local2]) {
aBullet.splice(_local2, 1);
break;
}
_local2++;
}
_local1.gotoAndPlay(2);
}
}
}
function lightManage() {
mcLight.clear();
mcBossLight.clear();
var _local10 = 16777215 /* 0xFFFFFF */;
for (var _local14 in aLight) {
var _local11 = aLight[_local14];
var _local12 = _local11[0];
var _local4 = _local11[1];
if (!(_local4 instanceof MovieClip)) {
return(undefined);
}
var _local8 = _local12._x + 6;
var _local6 = _local12._y - 20;
var _local7 = _local4._x;
var _local5 = _local4._y - 15;
var _local9 = true;
if (!_local7) {
_local9 = false;
}
if (!_local5) {
_local9 = false;
}
if (_local9) {
randLine(mcLight, _local8, _local6, _local7, _local5, 5, _local10);
randLine(mcLight, _local8, _local6, _local7, _local5, 15, _local10);
}
}
_local10 = 16729088 /* 0xFF4400 */;
for (var _local13 in aBossLight) {
var _local11 = aBossLight[_local13];
var _local1 = _local11[0];
var _local4 = _local11[1];
if (!(_local1 instanceof MovieClip)) {
return(undefined);
}
if (!(_local4 instanceof MovieClip)) {
return(undefined);
}
var _local8 = (_local1._x + _local1.body._x) + _local1.body.post1._x;
var _local6 = (_local1._y + _local1.body._y) + _local1.body.post1._y;
var _local7 = (_local1._x + _local1.body._x) + _local1.body.post2._x;
var _local5 = (_local1._y + _local1.body._y) + _local1.body.post2._y;
var _local3 = _local4.mcTile._x;
var _local2 = _local4.mcTile._y - 10;
if (!_local8) {
return(undefined);
}
if (!_local6) {
return(undefined);
}
if (!_local7) {
return(undefined);
}
if (!_local5) {
return(undefined);
}
randLine(mcBossLight, _local8, _local6, _local3, _local2, 5, _local10);
randLine(mcBossLight, _local8, _local6, _local3, _local2, 15, _local10);
randLine(mcBossLight, _local7, _local5, _local3, _local2, 5, _local10);
randLine(mcBossLight, _local7, _local5, _local3, _local2, 15, _local10);
}
}
function randLine(_mc, x1, y1, x2, y2, d, color) {
var _local5 = _mc;
var _local7 = x2 - x1;
var _local6 = y2 - y1;
var _local11 = getL3(_local7, _local6);
var _local8 = floor(_local11 / d);
_local7 = _local7 / _local8;
_local6 = _local6 / _local8;
_local5.moveTo(x1, y1);
_local5.lineStyle(1, color);
var _local1 = 1;
while (_local1 < _local8) {
var _local3 = (x1 + (_local7 * _local1)) + ((rand() - 0.5) * d);
var _local2 = (y1 + (_local6 * _local1)) + ((rand() - 0.5) * d);
_local5.lineTo(_local3, _local2);
_local1++;
}
_local5.lineTo(x2, y2);
}
function onMouseDown() {
changeTile();
}
function setMouseTile(_mcTile) {
mouseMcTile = _mcTile;
mouseTile = mouseMcTile.tileObj;
}
function changeTile() {
var _local4 = mouseTile;
var _local27 = mouseMcTile;
var _local21 = _root.currRole;
if (_local21 == "fist") {
if (!_root.bStart) {
return(undefined);
}
if (_root.bPause) {
return(undefined);
}
var _local29 = fistHitA.hitTest(_xmouse, _ymouse, true);
if (_local29) {
_root.fistKill();
_root.unselFist();
return(undefined);
}
}
if (_local4) {
if (_local4.bBlock == true) {
if (!currentTile.role.bUping) {
currentTile.gotoAndStop("block");
}
currentTile = _local27;
if (!currentTile.role.bUping) {
_local27.gotoAndStop("sel");
}
_root.selectedRole = _local4.role;
_root.disSellOption();
_root.currRole = null;
return(undefined);
}
if (!currentTile.role.bUping) {
currentTile.gotoAndStop("block");
}
_root.outBuyFun();
if (_local21 == null) {
return(undefined);
}
if (_root.gold < _root[_local21 + "Cost"]) {
_root.mcLayout.noteMoney.gotoAndPlay(2);
_root.mcLayout.mcOption.gotoAndStop("temp");
_root.currRole = null;
return(undefined);
}
_local4.bBlock = true;
aSearch = null;
var _local5 = 0;
while (_local5 < 2) {
var _local17 = aTile[aStartP[_local5][1]][aStartP[_local5][0]];
if (_local4 == _local17) {
if (aStartP.length > 1) {
aStartP.splice(_local5, 1);
break;
}
_local4.bBlock = false;
_root.mcLayout.noteBlock.gotoAndPlay(2);
return(undefined);
}
_local5++;
}
var _local19 = false;
var _local20 = new Array();
if (_local4.bIsEnd) {
trace("\u8FD9\u4E2A\u7816\u5757\u662F\u7EC8\u70B9\uFF01");
var _local25 = false;
for (var _local26 in aEndPUsable) {
var _local6 = aTile[aEndPUsable[_local26][1]][aEndPUsable[_local26][0]];
if (_local4 == _local6) {
_local25 = true;
}
}
if (_local25) {
if (aEndPUsable.length > 1) {
var _local8 = false;
var _local22 = aEndPUsable.length;
var _local3 = 0;
while (_local3 < _local22) {
var _local6 = aTile[aEndPUsable[_local3][1]][aEndPUsable[_local3][0]];
if (_local4 == _local6) {
_local8 = true;
break;
}
_local3++;
}
if (_local8) {
aEndPUsable.splice(_local3, 1);
}
var _local24 = false;
_local22 = aEndPNoBLK.length;
_local3 = 0;
while (_local3 < _local22) {
var _local6 = aTile[aEndPNoBLK[_local3][1]][aEndPNoBLK[_local3][0]];
if (_local4 == _local6) {
_local24 = true;
break;
}
_local3++;
}
if (_local24) {
aEndPNoBLK.splice(_local3, 1);
}
_local19 = true;
// unexpected jump
}
_local4.bBlock = false;
_root.mcLayout.noteBlock.gotoAndPlay(2);
return(undefined);
} else {
var _local24 = false;
var _local22 = aEndPNoBLK.length;
var _local3 = 0;
while (_local3 < _local22) {
var _local6 = aTile[aEndPNoBLK[_local3][1]][aEndPNoBLK[_local3][0]];
if (_local4 == _local6) {
_local24 = true;
break;
}
_local3++;
}
if (_local24) {
aEndPNoBLK.splice(_local3, 1);
}
_local19 = true;
}
trace("aEndPNoBLK: " + aEndPNoBLK);
trace("aEndPUsable: " + aEndPUsable);
} else {
trace("\u8FD9\u4E2A\u7816\u5757\u4E0D\u662F\u7EC8\u70B9\uFF01");
var _local12 = new Array();
var _local22 = aEndPNoBLK.length;
trace("\u7EC8\u70B9\u4E2A\u6570\uFF1A" + _local22);
var _local9 = 0;
while (_local9 < _local22) {
trace("\u5FAA\u73AF\u641C\u7D22");
var _local11 = Math.floor(Math.random() * aStartP.length);
var _local15 = aStartP[_local11][1];
var _local16 = aStartP[_local11][0];
var _local17 = aTile[_local15][_local16];
aStar.setPs(_local17);
var _local18 = aEndPNoBLK[_local9][1];
var _local13 = aEndPNoBLK[_local9][0];
var _local6 = aTile[_local18][_local13];
aStar.setPe(_local6);
aStar.reset();
aStar.stSearch();
aPath = aStar.getMinPath();
if (aPath) {
_local20.push(aPath);
trace("\u9053\u8DEF\u5B58\u5728");
_local19 = true;
} else {
var _local8 = false;
var _local10 = aEndPUsable.length;
var _local3 = 0;
while (_local3 < _local10) {
var _local7 = aTile[aEndPUsable[_local3][1]][aEndPUsable[_local3][0]];
if (_local6 == _local7) {
_local8 = true;
break;
}
_local3++;
}
trace("\u9053\u8DEF\u4E0D\u5B58\u5728,\u4ECEUsable\u91CC\u5220\u9664" + _local8);
if (_local8) {
aEndPUsable.splice(_local3, 1);
}
_local12.push(_local6.endID);
}
_local9++;
}
if (!_local19) {
trace("\u9053\u8DEF\u4E0D\u5B58\u5728\uFF0C\u5219\u590D\u539F!");
for (var _local28 in _local12) {
var _local14 = _local12[_local28];
aEndPUsable.push(this["endP" + _local14]);
}
_local4.bBlock = false;
_root.mcLayout.noteBlock.gotoAndPlay(2);
return(undefined);
}
}
if (!_local19) {
trace("\u9053\u8DEF\u5835\u585E!");
_local4.bBlock = false;
_root.mcLayout.noteBlock.gotoAndPlay(2);
return(undefined);
}
trace("\u9053\u8DEF\u7545\u901A!");
_root.gold = _root.gold - _root[_local21 + "Cost"];
_local27.gotoAndStop("block");
var _local23 = _local27.attachMovie(_local21, _local21, 10);
_local23.initType(_local21);
_local23.initFrame();
_local23.stDcEnemy();
_local23._y = 8;
aRole.push(_local23);
_local4.role = _local23;
_local4.mc.role = _local23;
_root.mcLayout.mcOption.gotoAndStop("temp");
_root.currRole = null;
aSearch = aEnemy.slice();
if (_local20.length > 0) {
aUsePath = _local20.slice();
}
}
}
trace("::::\u5173\u5361\u52A0\u8F7D\u6210\u529F::::");
levelInit();
Symbol 1007 Button
on (rollOver) {
_root.mcLevel.setMouseTile(this);
if (_root.gold < _root[_root.currRole + "Cost"]) {
_root.currentBt.redNote._visible = false;
_root.currentBt = this;
redNote._visible = true;
}
if (_root.currRole) {
if (_root.currRole != "fist") {
tile._visible = true;
range._visible = true;
_root.initTileRange(this);
} else {
range._visible = false;
tile._visible = false;
}
}
}
on (rollOut) {
_root.mcLevel.setMouseTile(null);
range._visible = false;
tile._visible = false;
redNote._visible = false;
}
Symbol 1014 Button
on (rollOver) {
_root.mcLevel.setMouseTile(this);
_root.currentBt.redNote._visible = false;
role.range._visible = true;
}
on (rollOut) {
_root.mcLevel.setMouseTile(null);
role.range._visible = false;
}
Symbol 1015 Button
on (rollOver) {
_root.mcLevel.setMouseTile(this);
_root.currentBt.redNote._visible = false;
role.range._visible = true;
}
on (rollOut) {
_root.mcLevel.setMouseTile(null);
role.range._visible = false;
}
Symbol 1019 Button
on (rollOver) {
_root.mcLevel.setMouseTile(this);
_root.currentBt.redNote._visible = false;
role.range._visible = true;
}
on (rollOut) {
_root.mcLevel.setMouseTile(null);
role.range._visible = false;
}
Symbol 1020 MovieClip [tile] Frame 1
stop();
bt.useHandCursor = false;
tile._visible = false;
redNote._visible = false;
range._visible = false;
Symbol 1020 MovieClip [tile] Frame 10
bt.useHandCursor = false;
Symbol 1020 MovieClip [tile] Frame 20
bt.useHandCursor = false;
Symbol 1020 MovieClip [tile] Frame 70
bt.useHandCursor = false;
Symbol 1025 MovieClip Frame 1
stop();
Symbol 1088 MovieClip Frame 340
_root.play();
Symbol 1092 Button
on (release) {
gotoAndStop ("frontPage");
}
Symbol 1101 Button
on (release) {
getURL ("http://www.freeworldgroup.com/", _blank);
}
Symbol 1105 Button
on (release) {
gotoAndStop ("credits");
}
Symbol 1112 MovieClip Frame 1
btGo.onPress = function () {
_root.nLevel = Number(tLevel.text);
_root.playGame();
};
Symbol 1119 Button
on (release) {
_root.frontAnim.gotoAndPlay("kill");
btSkip._x = -1000;
}
Symbol 1136 MovieClip Frame 10
stop();
Symbol 1141 MovieClip Frame 9
stop();
Symbol 1144 Button
on (release) {
_root.playGame();
}
on (rollOver) {
_root.sdBt.start();
}
Symbol 1148 Button
on (release) {
_root.instructions();
}
on (rollOver) {
_root.sdBt.start();
}
Symbol 1174 MovieClip Frame 12
stop();
Symbol 1180 MovieClip Frame 45
stop();
Symbol 1190 MovieClip Frame 129
_root.sdGun.start();
Symbol 1190 MovieClip Frame 136
_root.sdGun.start();
Symbol 1190 MovieClip Frame 142
_root.sdGun.start();
Symbol 1190 MovieClip Frame 147
_root.sdGun.start();
Symbol 1190 MovieClip Frame 153
_root.sdGun.start();
Symbol 1190 MovieClip Frame 160
_root.sdGun.start();
Symbol 1190 MovieClip Frame 241
_root.sdGun.start();
Symbol 1190 MovieClip Frame 306
stop();
Symbol 1195 Button
on (release) {
_root.backToFrontPage();
}
Symbol 1198 MovieClip Frame 15
stop();
Symbol 1200 Button
on (release) {
gotoAndPlay ("background");
}
Symbol 1201 Button
on (release) {
gotoAndStop ("p2");
}
Symbol 1204 Button
on (release) {
gotoAndStop ("p1");
}
Symbol 1205 Button
on (release) {
gotoAndStop ("p3");
}
Symbol 1206 Button
on (release) {
gotoAndStop ("p2");
}
Symbol 1207 Button
on (release) {
gotoAndStop ("p1");
}
Symbol 1208 MovieClip Frame 14
gotoAndPlay ("background");
Symbol 1208 MovieClip Frame 15
stop();
_root.stopVoice();
Symbol 1208 MovieClip Frame 23
_root.stopVoice();
Symbol 1208 MovieClip Frame 30
_root.stopVoice();
Symbol 1208 MovieClip Frame 40
_root.startVoice();
Symbol 1208 MovieClip Frame 1275
stop();