Frame 1
function initLoader() {
var _local2 = ((result_lv.b == undefined) ? "false" : (result_lv.b));
trace(("b ::" + _local2) + "::");
trace(("result_lv.h ::" + result_lv.h) + "::");
if (result_lv.h == "true") {
isHome = true;
}
if (_local2 == "true") {
bannedSign._alpha = 100;
} else {
this.onEnterFrame = function () {
createNewParticle();
mcLoadLogoBg.bar._xscale = 100 * (1 - (getBytesLoaded() / getBytesTotal()));
emitter._x = (mcLoadLogoBg._x + (96 - mcLoadLogoBg.bar._width)) + 15;
emitter._y = mcLoadLogoBg._y + 44;
if (getBytesLoaded() == getBytesTotal()) {
kill();
this.onEnterFrame = undefined;
if (isHome) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
};
bannedSign.onRelease = function () {
if (!isHome) {
openKingPage(LINK_TYPE_LOADER_PROGRESS);
}
};
}
}
function openKingPage(type, page) {
trace(type);
var _local4 = _root._url;
var _local3 = (((((("game=" + GAME_NAME) + "&from=") + _local4) + "&type=") + type) + "&session=") + sessionID;
if (page != undefined) {
_local3 = _local3 + ("&redirect=" + page);
}
var _local2 = "_blank";
if (isHome) {
_local2 = "_top";
}
getURL ((bounceURL + "?") + _local3, _local2);
}
function openOtherGamesLink() {
openKingPage(LINK_TYPE_OTHER_GAMES);
}
function openHighscoresLink() {
openKingPage(LINK_TYPE_HIGHSCORES, ("game/" + GAME_NAME) + "/highscores");
}
function openSignLink() {
if (!isHome) {
openKingPage(LINK_TYPE_SIGN);
}
}
function openAddToWebsiteLink() {
openKingPage(LINK_TYPE_ADD_GAME, "website_content.jsp");
}
function openLoaderMovieLink() {
openKingPage(LINK_TYPE_LOADER_MOVIE);
}
function openRightClickLink() {
openKingPage(LINK_TYPE_RIGHT_CLICK);
}
function openOfflineProtectionLink() {
openKingPage(LINK_TYPE_PROTECT);
}
function addScore(points) {
checkScore();
var _local1 = (iscore - 123) / 2;
_local1 = _local1 + points;
iscore = (_local1 * 2) + 123;
var _local2 = new md5();
checkStr = _local2.hash((((iscore + ":") + GAME_NAME) + ":") + SK);
return(_local1);
}
function resetScore() {
iscore = 123;
checkStr = null;
}
function submitInternalScore() {
checkScore();
var _local1 = (iscore - 123) / 2;
submitScore(_local1);
}
function checkScore() {
if (checkStr != null) {
var _local1 = new md5();
if (checkStr != _local1.hash((((iscore + ":") + GAME_NAME) + ":") + SK)) {
SSK = "ng41ui54hy35tdsnd6f54rews";
}
}
}
function submitScore(score) {
var _local2 = new md5();
var _local1 = _local2.hash((((score + ":") + GAME_NAME) + ":") + SSK);
try {
if (isHome) {
flash.external.ExternalInterface.call("submitScore", score, _local1);
} else {
openKingPage(LINK_TYPE_HIGHSCORES, (((("game/" + GAME_NAME) + "/submit/") + score) + ":") + _local1);
}
} catch(e:Error) {
trace(e);
}
}
function submitLevel(level) {
var _local1 = new md5();
var _local2 = _local1.hash((((level + ":") + GAME_NAME) + ":") + SSK);
try {
if (isHome) {
flash.external.ExternalInterface.call("submitLevel", level, _local2);
}
} catch(e:Error) {
trace(e);
}
}
function submitAchievement(achievement) {
var _local1 = new md5();
var _local2 = _local1.hash((((achievement + ":") + GAME_NAME) + ":") + SAK);
try {
if (isHome) {
flash.external.ExternalInterface.call("submitAchievement", achievement, _local2);
}
} catch(e:Error) {
trace(e);
}
}
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
function createNewParticle() {
var _local4 = emitter.attachMovie("libGlow", "newLibGlow", emitter.getNextHighestDepth());
var _local3 = new Particle(_local4, -10, -7, _root._width, _root._height);
_local3.setVel(randRange(minXVel, maxXVel), randRange(minYVel, maxYVel));
_local3.setSize(randRange(minSize, maxSize));
particles.push(_local3);
while (particles.length > numParticles) {
_local3 = particles.shift();
_local3.destroy();
}
var _local2 = 0;
while (_local2 < particles.length) {
particles[_local2].update();
_local2++;
}
}
function kill() {
var _local1 = 0;
while (_local1 < particles.length) {
particles[_local1].destroy();
_local1++;
}
}
function randRange(min, max) {
var _local1 = (Math.random() * (max - min)) + min;
return(_local1);
}
function moreGames() {
trace("more games!");
openOtherGamesLink();
if (!arrAch[3]) {
arrAch[3] = true;
savefile.data.arrAch = arrAch;
savefile.flush();
}
}
function areaglegames() {
getURL ("http://www.areaglegames.com", _self);
}
function pharaohgames() {
getURL ("http://www.pharaohgames.net", _self);
}
stop();
var GAME_NAME = "arctic-defense";
var MOCHI_SIGNATURE = "6491cdc96f6cb5e9";
var loadCountURL = "http://www.mygame.com/king/loadcount.jsp";
var bounceURL = "http://www.mygame.com/king/bounce.jsp";
var loadHomeParametersURL = "http://www.king.com/servlet/FreeGameServlet?action=load";
var LINK_TYPE_LOADER_MOVIE = "loader_movie";
var LINK_TYPE_LOADER_PROGRESS = "loader_progress";
var LINK_TYPE_PROTECT = "protect";
var LINK_TYPE_OTHER_GAMES = "other_games";
var LINK_TYPE_HIGHSCORES = "highscores";
var LINK_TYPE_SIGN = "sign";
var LINK_TYPE_ADD_GAME = "add_game";
var LINK_TYPE_RIGHT_CLICK = "rightclick";
var LINK_TYPE_RIGHT_CLICK = "rightclick";
var SSK = "ng43ui54hy35tdsnd6f54rews";
var SAK = "ggfd7sday923mdsfd8csfds34";
var SK = "vf78hxcsjak77cxzhjkwad87s";
var iscore = 123;
var checkStr = null;
var USER_TYPE_UNREGISTERED = 0;
var USER_TYPE_REGISTERED = 1;
var USER_TYPE_GOLD = 2;
var USER_TYPE_SUBSCRIPTION = 3;
var SessionID = "";
var gameWidth = Stage.width;
var gameHeight = Stage.height;
var isHome = false;
bannedSign._alpha = 0;
bannedSign._x = (bannedSign._y = 0);
bannedSign.bg._width = gameWidth;
bannedSign.bg._height = gameHeight;
mcLoadLogoBg._x = (gameWidth / 2) - (mcLoadLogoBg._width / 2);
mcLoadLogoBg._y = (gameHeight / 2) - (mcLoadLogoBg._height / 2);
var result_lv = new LoadVars();
result_lv.onLoad = function (success) {
_root.initLoader();
};
var my_lv = new LoadVars();
my_lv.game = GAME_NAME;
my_lv.from = _root._url;
var so = SharedObject.getLocal("session");
if (so.data.sessionID == null) {
var rnd1 = Math.floor(Math.random() * 4294967295);
var rnd2 = Math.floor(Math.random() * 4294967295);
so.data.sessionID = rnd1.toString(16) + rnd2.toString(16);
so.flush();
}
sessionID = so.data.sessionID;
my_lv.session = sessionID;
my_lv.sendAndLoad(loadCountURL, result_lv, "GET");
if (MOCHI_SIGNATURE != "") {
__com_mochibot__(MOCHI_SIGNATURE, this, 10301, true);
}
var numParticles = 20;
var minXVel = -1;
var maxXVel = 1;
var minYVel = -1;
var maxYVel = 1;
var minSize = 12;
var maxSize = 29;
var minAlpha = 10;
var maxAlpha = 20;
var particles = new Array();
var emitter = _root.createEmptyMovieClip("p_holder", _root.getNextHighestDepth());
menu = new ContextMenu();
menu.hideBuiltInItems();
menu_1 = new ContextMenuItem("Arctic Defense", pharaohgames);
menu_2 = new ContextMenuItem("Go to More Games!", moreGames, true);
menu_3 = new ContextMenuItem("Produced by:", pharaohgames, true);
menu_4 = new ContextMenuItem("Pharaoh Games", pharaohgames);
menu_5 = new ContextMenuItem("Areagle Games", areaglegames);
menu.customItems.push(menu_1);
menu.customItems.push(menu_2);
menu.customItems.push(menu_3);
menu.customItems.push(menu_4);
menu.customItems.push(menu_5);
this.menu = menu;
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
var _mochiads_game_id = "6491cdc96f6cb5e9";
mochi.as2.MochiServices.connect("6491cdc96f6cb5e9");
__com_mochibot__("0d9252ed", this, 10301, true);
Frame 2
function fireFire() {
new mx.transitions.Tween(mcKingLoader.fireLogoHolder, "_x", mx.transitions.easing.Regular.easeOut, mcKingLoader.fireLogoHolder._x, ((gameWidth / 2) - (mcKingLoader.dragonHolder._width / 2)) - 51, 1, true);
mcKingLoader.fireLogoHolder.play();
}
function showPlayBtn() {
mcKingLoader.mcPlay._x = (gameWidth / 2) - (mcKingLoader.mcPlay._width / 2);
mcKingLoader.mcPlay._y = mcKingLoader.fireLogoHolder._y + 210;
new mx.transitions.Tween(mcKingLoader.mcPlay, "_alpha", mx.transitions.easing.None.easeNone, 0, 100, 0.5, true);
mcKingLoader.mcPlay.onPress = btnOnPress;
mcKingLoader.mcPlay.onRollOver = btnOnOver;
mcKingLoader.mcPlay.onRollOut = (mcKingLoader.mcPlay.onDragOut = btnOnOut);
mcKingLoader.mcPlay.onRelease = mx.utils.Delegate.create(this, launchGame);
Delay.oneShot(this, showGlimmer, 1000);
}
function showGlimmer() {
bell.start();
mcKingLoader.mcGlim._x = mcKingLoader.fireLogoHolder_.x - mcKingLoader.mcGlim._width;
mcKingLoader.mcGlim._y = mcKingLoader.fireLogoHolder._y + 112;
var _local2 = mcKingLoader.fireLogoHolder._x - mcKingLoader.mcGlim._width;
var _local3 = (mcKingLoader.fireLogoHolder._x + mcKingLoader.fireLogoHolder._width) - 80;
var _local1 = new mx.transitions.Tween(mcKingLoader.mcGlim, "_x", mx.transitions.easing.None.easeNone, _local2, _local3, 0.5, true);
_local1.onMotionFinished = glimmerDone;
}
function glimmerDone() {
mcKingLoader.mcGlim._visible = false;
}
function btnOnOver() {
var _local2 = this;
_local2.gotoAndStop("over");
}
function btnOnOut() {
var _local2 = this;
_local2.gotoAndStop("idle");
}
function btnOnPress() {
var _local2 = this;
_local2.gotoAndStop("down");
}
function launchGame() {
gotoAndStop (3);
}
stop();
mcKingLoader.dragonHolder.attachMovie("mcDragon", "newDragon", 1);
mcKingLoader.fireLogoHolder.stop();
mcKingLoader.dragonHolder.stop();
mcKingLoader._x = (mcKingLoader._y = 0);
mcKingLoader.bg._width = gameWidth;
mcKingLoader.bg._height = gameHeight;
mcKingLoader.bg.onRelease = function () {
if (!isHome) {
openKingPage(LINK_TYPE_LOADER_MOVIE);
}
};
mcKingLoader.fireLogoHolder._x = (gameWidth - mcKingLoader.fireLogoHolder._width) - 90;
mcKingLoader.fireLogoHolder._y = ((gameHeight / 2) - (mcKingLoader.fireLogoHolder._height / 2)) - 60;
mcKingLoader.dragonHolder._x = gameWidth - mcKingLoader.dragonHolder._width;
mcKingLoader.dragonHolder._y = (gameHeight / 2) - (mcKingLoader.dragonHolder._height / 2);
mcKingLoader.mcPlay._alpha = 0;
mcKingLoader.mcPlay.useHandCursor = true;
var bell = new Sound();
bell.attachSound("sfxBell");
mcKingLoader.initAnimDriver(30, false);
trace("StartAnim");
mcKingLoader.dragonHolder.play();
Frame 3
function loadData() {
savefile = SharedObject.getLocal("ArticDefense");
if (savefile.data.scoreLevel == undefined) {
scoreLevel = new Array();
var _local1 = 0;
while (_local1 < arrFases.length) {
scoreLevel[_local1] = 0;
_local1++;
}
arrUpgs = new Array(8);
_local1 = 0;
while (_local1 < arrUpgs.length) {
arrUpgs[_local1] = false;
_local1++;
}
arrAch = new Array(6);
_local1 = 0;
while (_local1 < arrAch.length) {
arrAch[_local1] = false;
_local1++;
}
killedPeng = 0;
savefile.data.scoreLevel = scoreLevel;
savefile.data.arrUpgs = arrUpgs;
savefile.data.arrAch = arrAch;
savefile.data.killedPeng = killedPeng;
} else {
scoreLevel = savefile.data.scoreLevel;
arrUpgs = savefile.data.arrUpgs;
arrAch = savefile.data.arrAch;
killedPeng = savefile.data.killedPeng;
}
upgPoints = 0;
var _local1 = 0;
while (_local1 < scoreLevel.length) {
if (scoreLevel[_local1] != 0) {
upgPoints++;
arrFases[_local1][7] = true;
} else {
arrFases[_local1][7] = false;
}
_local1++;
}
_local1 = 0;
while (_local1 < arrUpgs.length) {
if (arrUpgs[_local1] == true) {
upgPoints = upgPoints - 3;
}
_local1++;
}
}
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
if (((domain != "pharaohgames.net") && (domain != "flashgamelicense.com")) && (domain != "mochiads.com")) {
}
var controleGeral = new Sound(this);
var mute = false;
var sndMusic = new Sound(cont_music);
sndMusic.attachSound("musica");
var sndMachine = new Sound(cont_machine);
sndMachine.attachSound("machine");
var sndSniper = new Sound(cont_sniper);
sndSniper.attachSound("sniper");
var sndShotgun = new Sound(cont_shotgun);
sndShotgun.attachSound("shotgun");
var sndGranade = new Sound(cont_granade);
sndGranade.attachSound("granade");
var sndHit = new Sound(cont_hit);
sndHit.attachSound("hit");
var sndOver = new Sound(cont_over);
sndOver.attachSound("over");
var sndPress = new Sound(cont_press);
sndPress.attachSound("press");
var sndReload = new Sound(cont_reload);
sndReload.attachSound("reload");
var sndEnd = new Sound(cont_end);
sndEnd.attachSound("end");
var sndExplo = new Sound(cont_explo);
sndExplo.attachSound("explo");
sponsor.onRelease = function () {
trace("sponsor");
openSignLink();
if (!this._parent.arrAch[3]) {
if (this._parent.inter2._currentframe == 1) {
this._parent.inter2.txt_score.text = scoreTotal + 5000;
this._parent.ac3._alpha = 100;
}
this._parent.arrAch[3] = true;
this._parent.savefile.data.arrAch = this._parent.arrAch;
this._parent.savefile.flush();
}
};
sponsor.onRollOver = function () {
sndOver.start();
this.gotoAndStop(2);
};
sponsor.onPress = function () {
sndPress.start();
};
sponsor.onReleaseOutside = (sponsor.onRollOut = function () {
this.gotoAndStop(1);
});
sponsor._visible = false;
var arrTiro;
var numTiro;
var arrPosIglus;
var arrPosTorres;
var arrTorres;
var numTorre;
var arrIglus;
var arrIni;
var contIni;
var delayTemp;
var delayIni;
var vidaIglu;
var vidaIgluTemp;
var comecou;
var torreDaVez;
var mouseOn;
var controleEspaco;
var arrEsquimos;
var arrInimigos;
var faseAtual;
var quantIni;
tabela._visible = false;
var tocaSom = false;
var arrTips = new Array("Nice try! Don't give up though! If you need help, play the tutorial level one more time, to make sure you got everything.", "Not enough mate! Try switching between eskimo's quicker and/or more often for better results.", "Those sneaky bastards! Try thinking alternative strategies before positioning your eskimos.", "They are coming right for us! Remember that you can upgrade an eskimo after every 3 levels. Use your upgrade points wisely, there is no refund for those!", "You won't let them get away with that, will you? Make them pay...", "Why so serious?", "Who needs an igloo anyway? It's not like it was cold outside...", "Ok, if you try again we promise not to tell anybody about your performance!", "We know that polar bears and penguins are not suppose to be in the same place... but really, who cares?", "After you are done dying in this level, why don't you try to complete some of the achievements?");
var arrFases = new Array(new Array(new Array(1, 2, 3, 4), new Array(1, 0), new Array(250, 150, 150, 200, 250, 250, 350, 200), 48, 200, new Array(450, 200), 20, false, "Meet the guys", new Array(false, true, false, false)), new Array(new Array(1, 2, 3), new Array(1, 3), new Array(100, 100, 300, 300, 300, 100), 48, 150, new Array(250, 250), 30, false, "Time to Play", new Array(true, true, true, true)), new Array(new Array(1, 0), new Array(1, 2, 3), new Array(275, 100), 48, 80, new Array(275, 50), 30, false, "Easy Peazy", new Array(false, false, false, true)), new Array(new Array(1, 2, 3, 4), new Array(1, 2, 3, 4, 5), new Array(130, 80, 420, 80, 130, 320, 420, 320), 48, 250, new Array(275, 200), 40, false, "Free 4 All", new Array(true, true, true, true)), new Array(new Array(3, 1, 3), new Array(1, 4), new Array(225, 100, 325, 300, 275, 200), 48, 100, new Array(275, 100, 275, 300), 35, false, "Still Standing", new Array(false, true, true, false)), new Array(new Array(1, 1), new Array(3, 0), new Array(250, 130, 250, 270), 6, 175, new Array(65, 200, 135, 200, 205, 200, 275, 200, 345, 200, 415, 200, 485, 200), 200, false, "Attack of The Seagulls", new Array(true, false, false, true)), new Array(new Array(4, 4, 4), new Array(5, 3), new Array(150, 150, 275, 150, 400, 150), 48, 75, new Array(75, 300, 175, 300, 275, 300, 375, 300, 475, 300), 60, false, "If you can't beat them, blow them up", new Array(true, false, false, false)), new Array(new Array(3, 3, 3, 3), new Array(1, 2, 3, 4), new Array(275, 130, 205, 200, 275, 270, 345, 200), 30, 120, new Array(275, 200), 40, false, "Diamond Shotgun", new Array(true, true, true, true)), new Array(new Array(2, 2, 2, 2, 2), new Array(1, 2, 3), new Array(200, 300, 190, 250, 250, 220, 310, 250, 300, 300), 18, 350, new Array(250, 300), 80, false, "Defensive", new Array(true, true, true, false)), new Array(new Array(2, 2, 1), new Array(4, 0), new Array(200, 300, 350, 300, 275, 100), 90, 60, new Array(275, 325), 40, false, "Polar Bear Pandemic", new Array(true, false, false, false)), new Array(new Array(3, 3, 1), new Array(1, 2), new Array(250, 150, 250, 250, 360, 200), 24, 100, new Array(300, 200), 30, false, "Cover All Corners", new Array(true, true, true, true)), new Array(new Array(3, 4, 2), new Array(1, 2), new Array(200, 200, 300, 250, 500, 50), 30, 150, new Array(275, 200), 40, false, "Watch My Back", new Array(true, true, true, true)), new Array(new Array(3, 3, 3), new Array(3, 0), new Array(150, 180, 275, 230, 400, 140), 6, 150, new Array(75, 300, 175, 300, 275, 300, 375, 300, 475, 300), 200, false, "Quail Hunting", new Array(true, false, false, false)), new Array(new Array(1, 2, 3), new Array(1, 2, 3, 4, 5), new Array(400, 200, 200, 300, 100, 100), 48, 200, new Array(275, 200), 50, false, "Just for fun!", new Array(true, true, true, true)), new Array(new Array(2, 2), new Array(3, 0), new Array(150, 200, 400, 200), 36, 25, new Array(275, 200), 50, false, "Gull\u2019s Eye!", new Array(true, false, false, true)), new Array(new Array(2, 1, 3), new Array(1, 2, 4, 5), new Array(400, 250, 100, 300, 450, 100), 36, 100, new Array(500, 300), 35, false, "3 Eskimo's and a Boomstick", new Array(true, true, false, false)), new Array(new Array(1, 1), new Array(3, 0), new Array(100, 150, 100, 250), 8, 120, new Array(50, 200), 100, false, "Revenge of The Seagulls", new Array(false, false, true, false)), new Array(new Array(1, 3, 4), new Array(3, 4, 2), new Array(165, 150, 385, 150, 275, 220), 24, 120, new Array(225, 120, 325, 120), 40, false, "The Last Stand", new Array(false, true, true, true)));
var scoreTotal = 0;
var upgPoints = 0;
var arrUpgs;
var scoreLevel;
var arrAch;
var killedPeng;
var savefile;
loadData();
trace(killedPeng);
stop();
Frame 4
function init(inimigo) {
var _local2 = Math.floor(Math.random() * 5) + 1;
inimigo.gotoAndStop(_local2);
inimigo.barra._visible = false;
switch (_local2) {
case 1 :
inimigo.speed = (Math.floor(Math.random() * 1) + 2) / 2;
break;
case 2 :
inimigo.speed = (Math.floor(Math.random() * 3) + 2) / 2;
break;
case 3 :
inimigo.speed = (Math.floor(Math.random() * 6) + 5) / 2;
break;
case 4 :
inimigo.speed = (Math.floor(Math.random() * 2) + 2) / 2;
break;
case 5 :
inimigo.speed = (Math.floor(Math.random() * 0) + 1) / 2;
}
if (Math.round(Math.random()) == 0) {
if (Math.round(Math.random()) == 0) {
inimigo._x = -inimigo._width;
} else {
inimigo._x = 550 + inimigo._width;
}
inimigo._y = Math.floor(Math.random() * 401);
} else {
if (Math.round(Math.random()) == 0) {
inimigo._y = -inimigo._height;
} else {
inimigo._y = 400 + inimigo._height;
}
inimigo._x = Math.floor(Math.random() * 551);
}
if (Math.round(Math.random()) == 0) {
if (Math.round(Math.random()) == 0) {
inimigo.alvo_x = -inimigo._width;
} else {
inimigo.alvo_x = 550 + inimigo._width;
}
inimigo.alvo_y = Math.floor(Math.random() * 401);
} else {
if (Math.round(Math.random()) == 0) {
inimigo.alvo_y = -inimigo._height;
} else {
inimigo.alvo_y = 400 + inimigo._height;
}
inimigo.alvo_x = Math.floor(Math.random() * 551);
}
}
stop();
sponsor._visible = true;
if (!tocaSom) {
tocaSom = true;
sndMusic.start(0, 9999);
}
btn_0.onRelease = function () {
if (firstTime == undefined) {
this._parent.savefile.data.firstTime = false;
this._parent.savefile.flush();
firstTime = false;
this._parent.gotoAndStop("tutorial");
}
this._parent.gotoAndStop("mapa");
};
btn_1.onRelease = function () {
this._parent.gotoAndStop("rank");
};
btn_2.onRelease = moreGames;
btn_4.onRelease = openAddToWebsiteLink;
btn_3.onRelease = pharaohgames;
var i = 0;
while (i < 5) {
var botao = this["btn_" + i];
botao.id = i;
botao.onRollOver = function () {
sndOver.start();
this._parent.tabela.gotoAndStop(this.id + 1);
};
botao.onReleaseOutside = (botao.onRollOut = function () {
this._parent.tabela.gotoAndStop(1);
});
botao.onPress = function () {
sndPress.start();
};
i++;
}
btnMute.onPress = function () {
sndPress.start();
};
btnMute.onRollOver = function () {
sndOver.start();
};
btnMute.onRelease = function () {
mute = !mute;
if (mute) {
controleGeral.setVolume(0);
} else {
controleGeral.setVolume(100);
}
};
var quantInis = 15;
var i = 0;
while (i < quantInis) {
init(this["ini" + i]);
i++;
}
onEnterFrame = function () {
var _local4 = 0;
while (_local4 < quantInis) {
var _local2 = this["ini" + _local4];
var _local6 = _local2.alvo_x - _local2._x;
var _local5 = _local2.alvo_y - _local2._y;
var _local3 = Math.atan2(_local5, _local6);
_local2.ent._rotation = ((_local3 * 180) / Math.PI) + 90;
vx = Math.cos(_local3) * _local2.speed;
vy = Math.sin(_local3) * _local2.speed;
_local2._x = _local2._x + vx;
_local2._y = _local2._y + vy;
if ((Math.abs(_local6) < (Math.abs(vx) + 10)) && (Math.abs(_local5) < (Math.abs(vy) + 10))) {
init(_local2);
}
_local4++;
}
};
Frame 5
stop();
delete onEnterFrame;
var arrCond = new Array(true, arrFases[0][7], arrFases[1][7], arrFases[2][7], arrFases[2][7], arrFases[3][7], arrFases[4][7], arrFases[5][7] || (arrFases[6][7]), arrFases[7][7], arrFases[8][7], arrFases[9][7], arrFases[9][7], arrFases[10][7], arrFases[11][7], arrFases[12][7], arrFases[13][7], arrFases[14][7], arrFases[15][7] || (arrFases[16][7]), arrFases[17][7]);
if (!arrAch[0]) {
var condTemp = true;
var i = 0;
while (i < 18) {
if (!arrCond[i]) {
condTemp = false;
}
i++;
}
if (condTemp) {
arrAch[0] = true;
savefile.data.arrAch = arrAch;
savefile.flush();
}
}
if (!arrAch[1]) {
var acabouTudo = true;
var i = 0;
while (i < 18) {
if (arrFases[i][7] != true) {
acabouTudo = false;
}
i++;
}
if (acabouTudo) {
arrAch[1] = true;
savefile.data.arrAch = arrAch;
savefile.flush();
}
}
if ((!arrAch[5]) && (killedPeng >= 1000)) {
arrAch[5] = true;
savefile.data.arrAch = arrAch;
savefile.flush();
}
if ((((arrAch[0] && (arrAch[1])) && (arrAch[2])) && (arrAch[3])) && (arrAch[5])) {
arrAch[4] = true;
savefile.data.arrAch = arrAch;
savefile.flush();
}
var scoreTotal = 0;
var i = 0;
while (i < scoreLevel.length) {
scoreTotal = scoreTotal + scoreLevel[i];
i++;
}
var i = 0;
while (i < arrAch.length) {
if (arrAch[i]) {
scoreTotal = scoreTotal + 5000;
}
i++;
}
if (arrCond[1]) {
fLevel._visible = false;
}
attachMovie("Interface", "inter2", 9999);
inter2._x = 275;
inter2._y = 375;
inter2.btn_score.enabled = false;
inter2.txt_score.text = scoreTotal;
goldenIgloo._visible = false;
var gold = true;
var i = 0;
while (i < arrFases.length) {
if (arrFases[i][7] != true) {
gold = false;
}
i++;
}
if (gold) {
goldenIgloo._visible = true;
}
var i = 0;
while (i < arrUpgs.length) {
botao = upSlide.tabela["up" + i];
botao.id = i;
if (arrUpgs[i] == true) {
botao.enabled = false;
botao._alpha = 30;
}
botao.onRollOver = function () {
sndOver.start();
};
botao.onPress = function () {
sndPress.start();
};
botao.onRelease = function () {
if ((arrUpgs[this.id] == false) && (upgPoints >= 3)) {
upgPoints = upgPoints - 3;
this._parent.txt_upgPoints.text = upgPoints;
arrUpgs[this.id] = true;
this.enabled = false;
this._alpha = 30;
savefile.data.arrUpgs = arrUpgs;
savefile.data.scoreLevel = scoreLevel;
savefile.flush();
if (upgPoints >= 3) {
inter2.red._visible = true;
} else {
inter2.red._visible = false;
}
}
};
i++;
}
if (upgPoints >= 3) {
inter2.red._visible = true;
} else {
inter2.red._visible = false;
}
inter2.btn_back.onRelease = function () {
this._parent._parent.inter2.unloadMovie();
this._parent._parent.gotoAndStop("menu");
};
inter2.btn_up.onRelease = function () {
upSlide.play();
};
inter2.btn_eskimos.onRelease = function () {
dataSlide.play();
};
inter2.btn_mute.onRelease = function () {
mute = !mute;
if (mute) {
controleGeral.setVolume(0);
} else {
controleGeral.setVolume(100);
}
};
inter2.btn_up.onPress = (inter2.btn_back.onPress = (inter2.btn_eskimos.onPress = (inter2.btn_mute.onPress = function () {
sndPress.start();
})));
inter2.btn_up.onRollOver = (inter2.btn_back.onRollOver = (inter2.btn_eskimos.onRollOver = (inter2.btn_mute.onRollOver = function () {
sndOver.start();
})));
tabela._visible = false;
var i = 0;
while (i < arrFases.length) {
var botao = this["btn_fase" + i];
if (!arrCond[i]) {
botao._visible = false;
}
botao.id = i;
botao.onRelease = function () {
arrEsquimos = arrFases[this.id][0];
arrInimigos = arrFases[this.id][1];
arrPosTorres = arrFases[this.id][2];
delayIni = arrFases[this.id][3];
vidaIglu = arrFases[this.id][4];
arrPosIglus = arrFases[this.id][5];
quantIni = arrFases[this.id][6];
faseAtual = this.id;
this._parent.inter2.unloadMovie();
this._parent.gotoAndStop("game");
};
botao.onPress = function () {
sndPress.start();
};
botao.onRollOver = function () {
sndOver.start();
this._parent.tabela._visible = true;
this._parent.tabela.prevScore._visible = false;
if (arrFases[this.id][7]) {
this._parent.tabela.prevScore._visible = true;
this._parent.tabela.prevScore.txt_prevScore.text = scoreLevel[this.id];
}
this._parent.tabela.txt_nome.text = arrFases[this.id][8];
var _local2 = 0;
while (_local2 < arrFases[this.id][0].length) {
this._parent.tabela["esq" + _local2].gotoAndStop(arrFases[this.id][0][_local2] + 1);
this._parent.tabela["esq" + _local2].barraAmo._visible = false;
this._parent.tabela["esq" + _local2].marca._visible = false;
_local2++;
}
_local2 = 0;
while (_local2 < arrFases[this.id][1].length) {
this._parent.tabela["ini" + _local2].gotoAndStop(arrFases[this.id][1][_local2] + 1);
this._parent.tabela["ini" + _local2].barra._visible = false;
_local2++;
}
this._parent.tabela.txt_igloos.text = "x" + (arrFases[this.id][5].length / 2);
this._parent.tabela.iglu0.gotoAndStop(2);
this._parent.tabela.vidaIglu.text = arrFases[this.id][4];
this._parent.tabela.txt_enemies.text = arrFases[this.id][6];
};
botao.onReleaseOutside = (botao.onRollOut = function () {
var _local2 = 0;
while (_local2 < arrFases[this.id][0].length) {
this._parent.tabela["esq" + _local2].gotoAndStop(1);
_local2++;
}
_local2 = 0;
while (_local2 < arrFases[this.id][1].length) {
this._parent.tabela["ini" + _local2].gotoAndStop(1);
_local2++;
}
_local2 = 0;
while (_local2 < (arrFases[this.id][5].length / 2)) {
this._parent.tabela["iglu" + _local2].gotoAndStop(1);
_local2++;
}
this._parent.tabela._visible = false;
});
i++;
}
var i = 0;
while (i < arrAch.length) {
var botao = this["ac" + i];
botao.id = i;
botao.useHandCursor = false;
if (!arrAch[i]) {
botao._alpha = 40;
}
botao.onRollOver = function () {
this._parent.txtAch.gotoAndStop(this.id + 2);
};
botao.onRollOut = (botao.onReleaseOutside = function () {
this._parent.txtAch.gotoAndStop(1);
});
i++;
}
Frame 6
function ajustaRates() {
var _local1 = 0;
while (_local1 < arrTorres.length) {
arrTorres[_local1].updateTorre();
_local1++;
}
}
stop();
var contBlood = 0;
arrTiro = new Array();
numTiro = 0;
arrTorres = new Array();
numTorre = 0;
arrIni = new Array();
contIni = 0;
arrIglus = new Array();
delayTemp = 0;
comecou = false;
mouseOn = false;
controleEspaco = false;
if (faseAtual == 0) {
attachMovie("Tuto", "tuto", 9997);
}
attachMovie("Lado", "lado", 11999);
lado._x = 275;
lado._y = 200;
if (!arrFases[faseAtual][9][0]) {
lado.lado.lado0._visible = false;
}
if (!arrFases[faseAtual][9][1]) {
lado.lado.lado1._visible = false;
}
if (!arrFases[faseAtual][9][2]) {
lado.lado.lado2._visible = false;
}
if (!arrFases[faseAtual][9][3]) {
lado.lado.lado3._visible = false;
}
var pausado = false;
var pontos = 0;
var acertos = 0;
var vidaIgloos = 0;
var iniKilled = 0;
var porc = 0;
var fim = false;
var ajuste = 0;
var iniFugiu = 0;
attachMovie("Calculo Slide", "scoreSlide", 9998);
scoreSlide._x = 275;
scoreSlide._y = 524;
attachMovie("Interface", "inter", 9999);
inter.gotoAndStop(2);
inter._x = 275;
inter._y = 375;
inter._visible = true;
inter.gotoAndStop(2);
inter.txt_quantIni.text = quantIni;
inter.btn_enemies.useHandCursor = false;
inter.btn_pausa.onRollOver = (inter.btn_mute.onRollOver = (inter.btn_back.onRollOver = function () {
sndOver.start();
}));
inter.btn_pausa.onPress = (inter.btn_mute.onPress = (inter.btn_back.onPress = function () {
sndPress.start();
}));
inter.btn_pausa.onRelease = function () {
pausado = !pausado;
var _local1 = 0;
while (_local1 < arrTiro.length) {
if (arrTiro[_local1]._currentframe == 3) {
if (pausado) {
arrTiro[_local1].explo.stop();
} else {
arrTiro[_local1].explo.play();
}
}
_local1++;
}
_local1 = 0;
while (_local1 < arrIni.length) {
if (pausado) {
arrIni[_local1].ent.stop();
arrIni[_local1].ent.explo.stop();
} else if (!arrIni[_local1].morto) {
arrIni[_local1].ent.play();
} else {
arrIni[_local1].ent.explo.play();
}
_local1++;
}
};
inter.btn_mute.onRelease = function () {
mute = !mute;
if (mute) {
controleGeral.setVolume(0);
} else {
controleGeral.setVolume(100);
}
};
trocaTorre = function () {
numTorre++;
torreDaVez.marca._visible = false;
if (numTorre >= arrTorres.length) {
numTorre = 0;
comecou = true;
}
torreDaVez = arrTorres[numTorre];
torreDaVez.marca._visible = true;
};
var i = 0;
while (i < arrPosIglus.length) {
attachMovie("Iglu", "iglu" + i, -20 - i);
arrIglus.push(this["iglu" + i]);
this["iglu" + i]._x = arrPosIglus[i];
this["iglu" + i]._y = arrPosIglus[i + 1];
this["iglu" + i].casa._rotation = Math.floor(Math.random() * 360);
this["iglu" + i].vida = vidaIglu;
i = i + 2;
}
var i = 0;
while (i < arrPosTorres.length) {
attachMovie("Torre", "torre" + i, -i);
arrTorres.push(this["torre" + i]);
this["torre" + i].init(arrEsquimos[((i + 2) / 2) - 1], arrUpgs);
this["torre" + i]._x = (550 / ((arrPosTorres.length / 2) + 1)) * ((i / 2) + 1);
this["torre" + i]._y = 50;
this["torre" + i].texto.numero.gotoAndStop(((i + 2) / 2) + 1);
if (faseAtual == 2) {
this["torre" + i]._x = this["torre" + i]._x + 60;
} else if ((faseAtual == 16) && (i == 2)) {
this["torre" + i]._y = this["torre" + i]._y - 20;
}
this["torre" + i].onPress = function () {
if ((this != torreDaVez) && (comecou)) {
torreDaVez.marca._visible = false;
torreDaVez = this;
torreDaVez.marca._visible = true;
}
};
this["torre" + i].onRollOver = function () {
this.texto._visible = true;
};
this["torre" + i].onRollOut = (this["torre" + i].onReleaseOutside = function () {
this.texto._visible = false;
});
attachMovie("Plataforma", "plat" + i, -100 + i);
this["plat" + i].ocupada = false;
this["plat" + i]._x = arrPosTorres[i];
this["plat" + i]._y = arrPosTorres[i + 1];
this["plat" + i].onRelease = function () {
if (!this.ocupada) {
if (faseAtual == 0) {
if (torreDaVez == torre0) {
tuto.gotoAndPlay(12);
} else if (torreDaVez == torre6) {
tuto.gotoAndPlay(36);
}
}
this.ocupada = true;
torreDaVez._x = this._x;
torreDaVez._y = this._y;
this._visible = false;
trocaTorre();
}
};
this["plat" + i].onPress = function () {
sndPress.start();
};
this["plat" + i].onRollOver = function () {
sndOver.start();
};
i = i + 2;
}
torreDaVez = arrTorres[0];
torreDaVez.marca._visible = true;
onMouseDown = function () {
var _local2 = true;
var _local1 = 0;
while (_local1 < arrTorres.length) {
if (((arrTorres[_local1] != torreDaVez) && (arrTorres[_local1].hitTest(_xmouse, _ymouse))) && (!arrTorres[_local1].texto.hitTest(_xmouse, _ymouse))) {
_local2 = false;
}
_local1++;
}
if (inter.contato.hitTest(_xmouse, _ymouse, true)) {
_local2 = false;
}
if (_local2) {
mouseOn = true;
}
};
onMouseUp = function () {
mouseOn = false;
};
onEnterFrame = function () {
if (comecou && (!pausado)) {
var _local1 = 0;
while (_local1 < arrIglus.length) {
if (arrIglus[_local1].vida <= 0) {
comecou = false;
inter.btn_pausa.onRelease();
scoreSlide.frameTabela = 2;
scoreSlide.tabela.gotoAndStop(scoreSlide.frameTabela);
scoreSlide.play();
sndEnd.start();
}
_local1++;
}
var _local3 = _xmouse - torreDaVez._x;
var _local2 = _ymouse - torreDaVez._y;
var _local4 = Math.atan2(_local2, _local3);
torreDaVez.ent._rotation = ((_local4 * 180) / Math.PI) - 90;
if ((Key.getCode() == 49) && (torreDaVez != arrTorres[0])) {
torreDaVez.marca._visible = false;
torreDaVez = arrTorres[0];
torreDaVez.marca._visible = true;
} else if (((Key.getCode() == 50) && (torreDaVez != arrTorres[1])) && (arrTorres[1])) {
torreDaVez.marca._visible = false;
torreDaVez = arrTorres[1];
torreDaVez.marca._visible = true;
} else if (((Key.getCode() == 51) && (torreDaVez != arrTorres[2])) && (arrTorres[2])) {
torreDaVez.marca._visible = false;
torreDaVez = arrTorres[2];
torreDaVez.marca._visible = true;
} else if (((Key.getCode() == 52) && (torreDaVez != arrTorres[3])) && (arrTorres[3])) {
torreDaVez.marca._visible = false;
torreDaVez = arrTorres[3];
torreDaVez.marca._visible = true;
} else if (((Key.getCode() == 53) && (torreDaVez != arrTorres[4])) && (arrTorres[4])) {
torreDaVez.marca._visible = false;
torreDaVez = arrTorres[4];
torreDaVez.marca._visible = true;
}
if (!controleEspaco) {
if (Key.isDown(32)) {
controleEspaco = true;
trocaTorre();
}
} else if (!Key.isDown(32)) {
controleEspaco = false;
}
if (mouseOn) {
atira();
}
ajustaRates();
gerenciaInimigos();
inter.txt_quantIni.text = (arrFases[faseAtual][6] - iniKilled) - iniFugiu;
gerenciaTiros();
if (quantIni > 0) {
if (delayTemp > delayIni) {
delayTemp = 0;
if ((faseAtual == 0) && (quantIni > 10)) {
delayTemp = delayTemp - (quantIni * 3);
}
criaInimigo();
}
delayTemp++;
} else if (arrIni.length == 0) {
comecou = false;
if (arrFases[faseAtual][7] != true) {
arrFases[faseAtual][7] = true;
upgPoints++;
}
inter.btn_pausa.onRelease();
_local1 = 0;
while (_local1 < arrIglus.length) {
vidaIgloos = vidaIgloos + arrIglus[_local1].vida;
_local1++;
}
porc = Math.floor((acertos / (numTiro - ajuste)) * 10000) / 100;
pontos = ((Math.round(10 * porc) + (iniKilled * 10)) + 5000) + (vidaIgloos * 10);
scoreSlide.frameTabela = 1;
scoreSlide.tabela.gotoAndStop(scoreSlide.frameTabela);
scoreSlide.tabela.calcula();
scoreSlide.play();
fim = true;
if (scoreLevel[faseAtual] < pontos) {
scoreLevel[faseAtual] = pontos;
}
if ((((faseAtual == 14) && (!arrAch[2])) && (porc >= 100)) && (vidaIgloos >= 25)) {
arrAch[2] = true;
savefile.data.arrAch = arrAch;
}
savefile.data.killedPeng = killedPeng;
savefile.data.scoreLevel = scoreLevel;
savefile.data.arrUpgs = arrUpgs;
savefile.flush();
sndEnd.start();
}
}
};
gerenciaTiros = function () {
var _local3 = 0;
while (_local3 < arrTiro.length) {
var _local1 = arrTiro[_local3];
vx = Math.cos(_local1.angulo) * _local1.speed;
vy = Math.sin(_local1.angulo) * _local1.speed;
_local1.range--;
if (_local1.range < 0) {
if (_local1._currentframe == 2) {
_local1.explode();
}
_local1.unloadMovie();
arrTiro.splice(_local3, 1);
} else if (((_local1._currentframe == 2) && (Math.abs(_local1._x - _local1.alvoX) < _local1.speed)) && (Math.abs(_local1._y - _local1.alvoY) < _local1.speed)) {
_local1.explode();
_local1.unloadMovie();
arrTiro.splice(_local3, 1);
} else if ((_local1._currentframe == 3) && (_local1.expOver)) {
_local1.unloadMovie();
arrTiro.splice(_local3, 1);
} else {
_local1._x = _local1._x + vx;
_local1._y = _local1._y + vy;
}
var _local2 = 0;
while (_local2 < arrIglus.length) {
if (_local1.hitTest(arrIglus[_local2]) && (_local1._currentframe != 3)) {
if (_local1._currentframe == 2) {
_local1.explode();
}
_local1.unloadMovie();
arrTiro.splice(_local3, 1);
}
_local2++;
}
_local3++;
}
};
atira = function () {
if (torreDaVez.getLiberado()) {
if ((torreDaVez.getID() == 1) || (torreDaVez.getID() == 2)) {
attachMovie("Tiro", "tiro_" + numTiro, numTiro + 100);
arrTiro.push(this["tiro_" + numTiro]);
numTiro++;
var _local3 = arrTiro[arrTiro.length - 1];
var _local5 = (Math.PI/180) * torreDaVez.ent._rotation;
_local3._x = torreDaVez._x + (Math.cos(_local5) * -8);
_local3._y = torreDaVez._y + (Math.sin(_local5) * -8);
_local3.speed = torreDaVez.getTiroSpeed();
_local3.range = torreDaVez.getRange();
_local3.dano = torreDaVez.getDano();
_local3.alvoX = (_xmouse + Math.floor((Math.random() * torreDaVez.getPrecisao()) * 2)) - torreDaVez.getPrecisao();
_local3.alvoY = (_ymouse + Math.floor((Math.random() * torreDaVez.getPrecisao()) * 2)) - torreDaVez.getPrecisao();
var _local7 = _local3.alvoX - _local3._x;
var _local6 = _local3.alvoY - _local3._y;
var _local4 = Math.atan2(_local6, _local7);
_local3._rotation = (_local4 * 180) / Math.PI;
_local3.angulo = _local4;
if (torreDaVez.getID() == 1) {
sndMachine.start();
_local3._x = _local3._x + (Math.cos(_local3.angulo) * 10);
_local3._y = _local3._y + (Math.sin(_local3.angulo) * 10);
} else {
sndSniper.start();
}
} else if (torreDaVez.getID() == 3) {
sndShotgun.start();
var _local2 = 0;
while (_local2 < torreDaVez.getCartucho()) {
attachMovie("Tiro", "tiro_" + numTiro, numTiro + 100);
arrTiro.push(this["tiro_" + numTiro]);
numTiro++;
var _local3 = arrTiro[arrTiro.length - 1];
var _local5 = (Math.PI/180) * torreDaVez.ent._rotation;
_local3._x = torreDaVez._x + (Math.cos(_local5) * -8);
_local3._y = torreDaVez._y + (Math.sin(_local5) * -8);
_local3.speed = torreDaVez.getTiroSpeed();
_local3.range = torreDaVez.getRange();
_local3.dano = torreDaVez.getDano();
_local3.alvoX = _xmouse;
_local3.alvoY = _ymouse;
var _local7 = _xmouse - _local3._x;
var _local6 = _ymouse - _local3._y;
var _local4 = Math.atan2(_local6, _local7);
if ((torreDaVez.getCartucho() - ((_local2 * torreDaVez.getCartucho()) / 2)) != 0) {
_local3.angulo = _local4 + ((Math.PI / (torreDaVez.getCartucho() - ((_local2 * torreDaVez.getCartucho()) / 2))) / 7);
} else {
_local3.angulo = _local4;
}
_local3._rotation = (_local3.angulo * 180) / Math.PI;
_local2++;
}
} else {
sndGranade.start();
attachMovie("Tiro", "tiro_" + numTiro, numTiro + 100);
arrTiro.push(this["tiro_" + numTiro]);
numTiro++;
ajuste++;
var _local3 = arrTiro[arrTiro.length - 1];
_local3.gotoAndStop(2);
var _local5 = (Math.PI/180) * torreDaVez.ent._rotation;
_local3._x = torreDaVez._x + (Math.cos(_local5) * -8);
_local3._y = torreDaVez._y + (Math.sin(_local5) * -8);
_local3.speed = torreDaVez.getTiroSpeed();
_local3.range = torreDaVez.getRange();
_local3.dano = torreDaVez.getDano();
_local3.alvoX = (_xmouse + Math.floor((Math.random() * torreDaVez.getPrecisao()) * 2)) - torreDaVez.getPrecisao();
_local3.alvoY = (_ymouse + Math.floor((Math.random() * torreDaVez.getPrecisao()) * 2)) - torreDaVez.getPrecisao();
var _local7 = _local3.alvoX - _local3._x;
var _local6 = _local3.alvoY - _local3._y;
var _local4 = Math.atan2(_local6, _local7);
_local3._rotation = (_local4 * 180) / Math.PI;
_local3.angulo = _local4;
_local3._x = _local3._x + (Math.cos(_local3.angulo) * 10);
_local3._y = _local3._y + (Math.sin(_local3.angulo) * 10);
_local3.explode = function () {
sndExplo.start();
this._parent.attachMovie("Tiro", "tiro_" + numTiro, numTiro + 100);
arrTiro.push(this._parent["tiro_" + numTiro]);
numTiro++;
var _local2 = arrTiro[arrTiro.length - 1];
_local2.gotoAndStop(3);
_local2._x = this._x;
_local2._y = this._y;
_local2.dano = torreDaVez.getDano();
};
}
}
};
criaInimigo = function () {
this.attachMovie("Inimigo", "ini_" + contIni, contIni + 1000);
arrIni.push(this["ini_" + contIni]);
var _local2 = arrIni.length - 1;
var _local4;
do {
_local4 = Math.floor(Math.random() * arrInimigos.length) + 1;
_local4 = arrInimigos[_local4 - 1];
} while (_local4 == 0);
arrIni[_local2].gotoAndStop(_local4 + 1);
switch (_local4) {
case 1 :
arrIni[_local2].speed = (Math.floor(Math.random() * 1) + 2) / 2;
arrIni[_local2].dano = 10;
arrIni[_local2].life = 10;
break;
case 2 :
arrIni[_local2].speed = (Math.floor(Math.random() * 3) + 2) / 2;
arrIni[_local2].dano = 15;
arrIni[_local2].life = 15;
break;
case 3 :
arrIni[_local2].speed = (Math.floor(Math.random() * 6) + 5) / 2;
arrIni[_local2].dano = 5;
arrIni[_local2].life = 5;
break;
case 4 :
arrIni[_local2].speed = (Math.floor(Math.random() * 2) + 2) / 2;
arrIni[_local2].dano = 25;
arrIni[_local2].life = 25;
break;
case 5 :
arrIni[_local2].speed = (Math.floor(Math.random() * 0) + 1) / 2;
arrIni[_local2].dano = 20;
arrIni[_local2].life = 45;
}
arrIni[_local2].lifeTemp = arrIni[_local2].life;
arrIni[_local2]._xscale = Math.floor(Math.random() * 50) + 70;
arrIni[_local2]._yscale = arrIni[_local2]._xscale;
arrIni[_local2].iglu = arrIglus[Math.floor(Math.random() * arrIglus.length)];
arrIni[_local2].atacando = false;
arrIni[_local2].morto = false;
arrIni[_local2].apagar = false;
arrIni[_local2].barra.gotoAndStop(3);
var _local3 = false;
do {
if (Math.round(Math.random()) == 0) {
if (Math.round(Math.random()) == 0) {
arrIni[_local2]._x = -arrIni[_local2]._width;
_local3 = arrFases[faseAtual][9][1];
} else {
arrIni[_local2]._x = 550 + arrIni[_local2]._width;
_local3 = arrFases[faseAtual][9][2];
}
arrIni[_local2]._y = Math.floor(Math.random() * 401);
} else {
if (Math.round(Math.random()) == 0) {
arrIni[_local2]._y = -arrIni[_local2]._height;
_local3 = arrFases[faseAtual][9][0];
} else {
arrIni[_local2]._y = 400 + arrIni[_local2]._height;
_local3 = arrFases[faseAtual][9][3];
}
arrIni[_local2]._x = Math.floor(Math.random() * 551);
}
} while (_local3 == false);
contIni++;
quantIni--;
};
gerenciaInimigos = function () {
var _local2 = 0;
while (_local2 < arrIni.length) {
if (arrIni[_local2].apagar == true) {
arrIni[_local2].unloadMovie();
arrIni.splice(_local2, 1);
}
var _local5 = false;
var _local3 = 0;
while (_local3 < arrTiro.length) {
if (((!arrIni[_local2].morto) && (arrIni[_local2].hitTest(arrTiro[_local3]))) && (arrTiro[_local3]._currentframe != 2)) {
if (arrTiro[_local3]._currentframe != 3) {
attachMovie("Blood", "blood" + contBlood, 12000 + contBlood);
this["blood" + contBlood]._x = arrIni[_local2]._x - ((arrIni[_local2]._x - arrTiro[_local3]._x) / 2);
this["blood" + contBlood]._y = arrIni[_local2]._y - ((arrIni[_local2]._y - arrTiro[_local3]._y) / 2);
this["blood" + contBlood]._rotation = arrTiro[_local3]._rotation - 90;
contBlood++;
}
arrIni[_local2].lifeTemp = arrIni[_local2].lifeTemp - arrTiro[_local3].dano;
arrIni[_local2].barra._width = (arrIni[_local2].lifeTemp * 40) / arrIni[_local2].life;
if (arrIni[_local2].lifeTemp <= 0) {
iniKilled++;
if (arrIni[_local2]._currentframe == 2) {
killedPeng++;
}
attachMovie("Blood", "blood" + contBlood, -100 - contBlood);
this["blood" + contBlood]._x = arrIni[_local2]._x;
this["blood" + contBlood]._y = arrIni[_local2]._y;
this["blood" + contBlood].gotoAndStop("morto" + Math.floor(Math.random() * 5));
this["blood" + contBlood]._rotation = Math.floor(Math.random() * 360);
contBlood++;
arrIni[_local2].morto = true;
arrIni[_local2].ent.gotoAndStop("death");
arrIni[_local2].barra._width = 0;
}
if (arrTiro[_local3]._currentframe == 1) {
sndHit.start();
acertos++;
arrTiro[_local3].unloadMovie();
arrTiro.splice(_local3, 1);
_local5 = true;
} else if ((arrTiro[_local3]._currentframe == 3) && (arrTiro[_local3].acertado != true)) {
arrTiro[_local3].acertado = true;
acertos++;
}
}
_local3++;
}
if ((!arrIni[_local2].morto) && (!_local5)) {
var _local7 = arrIni[_local2].iglu._x - arrIni[_local2]._x;
var _local6 = arrIni[_local2].iglu._y - arrIni[_local2]._y;
var _local4 = Math.atan2(_local6, _local7);
arrIni[_local2].ent._rotation = ((_local4 * 180) / Math.PI) + 90;
vx = Math.cos(_local4) * arrIni[_local2].speed;
vy = Math.sin(_local4) * arrIni[_local2].speed;
if (((Math.abs(_local7) < (Math.abs(vx) + 30)) && (Math.abs(_local6) < (Math.abs(vy) + 30))) && (arrIni[_local2].atacando == false)) {
arrIni[_local2].atacando = true;
arrIni[_local2].ent.gotoAndPlay("attack");
} else if (arrIni[_local2].atacando == false) {
arrIni[_local2]._x = arrIni[_local2]._x + vx;
arrIni[_local2]._y = arrIni[_local2]._y + vy;
}
}
_local2++;
}
};
passaFase = function () {
var _local2 = 0;
while (_local2 < arrTorres.length) {
arrTorres[_local2].unloadMovie();
_local2++;
}
_local2 = 0;
while (_local2 < arrTiro.length) {
arrTiro[_local2].unloadMovie();
_local2++;
}
_local2 = 0;
while (_local2 < arrIni.length) {
arrIni[_local2].unloadMovie();
_local2++;
}
_local2 = 0;
while (_local2 < arrIglus.length) {
arrIglus[_local2].unloadMovie();
_local2++;
}
inter.unloadMovie();
scoreSlide.unloadMovie();
if (faseAtual == 0) {
unloadMovie (tuto);
}
unloadMovie (lado);
killedPeng = savefile.data.killedPeng;
this.gotoAndStop("mapa");
};
inter.btn_back.onRelease = function () {
if (!fim) {
if (!pausado) {
inter.btn_pausa.onRelease();
}
scoreSlide.frameTabela = 3;
scoreSlide.tabela.gotoAndStop(scoreSlide.frameTabela);
scoreSlide.play();
}
};
Frame 7
var scoreTotal = 0;
var i = 0;
while (i < scoreLevel.length) {
scoreTotal = scoreTotal + scoreLevel[i];
i++;
}
var i = 0;
while (i < arrAch.length) {
if (arrAch[i]) {
scoreTotal = scoreTotal + 5000;
}
i++;
}
var o = {n:[1, 1, 14, 0, 8, 12, 7, 12, 10, 13, 2, 9, 7, 15, 5, 6], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var boardID = o.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:boardID, score:scoreTotal});
savefile.data.scoreLevel = undefined;
savefile.flush();
loadData();
Frame 8
gotoAndStop ("menu");
Symbol 20 MovieClip [Blood] Frame 10
removeMovieClip(this);
Symbol 39 MovieClip Frame 33
this._parent._parent.apagar = true;
this._parent.expOver = true;
Symbol 40 MovieClip [Tiro] Frame 1
stop();
Symbol 63 MovieClip [Interface] Frame 1
stop();
Symbol 68 MovieClip Frame 1
stop();
Symbol 92 MovieClip Frame 1
function calcula() {
txt_nome.text = palco.arrFases[palco.faseAtual][8];
txt_level.text = 5000;
txt_enemies.text = palco.iniKilled + " * 10";
txt_igloo.text = palco.vidaIgloos + " * 10";
txt_precision.text = palco.porc + "% * 10";
txt_total.text = palco.pontos;
}
stop();
var palco = this._parent._parent;
btn_ok.onRelease = function () {
palco.passaFase();
};
btn_ok.onPress = function () {
this._parent._parent._parent.sndPress.start();
};
btn_ok.onRollOver = function () {
this._parent._parent._parent.sndOver.start();
};
Symbol 92 MovieClip Frame 2
btn_ok.onRelease = function () {
this._parent._parent._parent.passaFase();
};
btn_ok.onPress = function () {
this._parent._parent._parent.sndPress.start();
};
btn_ok.onRollOver = function () {
this._parent._parent._parent.sndOver.start();
};
txt_frase.text = this._parent._parent.arrTips[Math.floor(Math.random() * this._parent._parent.arrTips.length)];
Symbol 92 MovieClip Frame 3
btn_ok.onRelease = function () {
this._parent._parent._parent.passaFase();
};
btn_no.onRelease = function () {
this._parent._parent._parent.pausado = false;
this._parent._parent.play();
};
btn_no.onPress = (btn_ok.onPress = function () {
this._parent._parent._parent.sndPress.start();
});
btn_no.onRollOver = (btn_ok.onRollOver = function () {
this._parent._parent._parent.sndOver.start();
});
Symbol 93 MovieClip [Calculo Slide] Frame 1
tabela.gotoAndStop(frameTabela);
stop();
Symbol 93 MovieClip [Calculo Slide] Frame 12
tabela.gotoAndStop(frameTabela);
stop();
Symbol 93 MovieClip [Calculo Slide] Frame 13
tabela.gotoAndStop(frameTabela);
Symbol 93 MovieClip [Calculo Slide] Frame 24
gotoAndStop (1);
Symbol 107 MovieClip Frame 1
stop();
Symbol 108 MovieClip [Tuto] Frame 12
stop();
Symbol 108 MovieClip [Tuto] Frame 24
texto.gotoAndStop(2);
Symbol 108 MovieClip [Tuto] Frame 36
stop();
Symbol 108 MovieClip [Tuto] Frame 48
texto.gotoAndStop(3);
Symbol 108 MovieClip [Tuto] Frame 120
texto.gotoAndStop(4);
Symbol 108 MovieClip [Tuto] Frame 192
texto.gotoAndStop(5);
Symbol 108 MovieClip [Tuto] Frame 264
texto.gotoAndStop(6);
Symbol 108 MovieClip [Tuto] Frame 336
texto.gotoAndStop(7);
Symbol 108 MovieClip [Tuto] Frame 408
texto.gotoAndStop(8);
Symbol 108 MovieClip [Tuto] Frame 480
texto.gotoAndStop(9);
Symbol 108 MovieClip [Tuto] Frame 552
texto.gotoAndStop(10);
Symbol 108 MovieClip [Tuto] Frame 624
texto.gotoAndStop(11);
Symbol 108 MovieClip [Tuto] Frame 696
texto.gotoAndStop(12);
Symbol 108 MovieClip [Tuto] Frame 767
unloadMovie (this);
Symbol 113 MovieClip [Lado] Frame 96
stop();
Symbol 119 MovieClip [mcDragon] Frame 1
Symbol 119 MovieClip [mcDragon] Frame 80
_root.fireFire();
Symbol 119 MovieClip [mcDragon] Frame 119
stop();
Instance of Symbol 122 MovieClip "spinas" in Symbol 123 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + 3);
}
Symbol 127 MovieClip Frame 1
stop();
Symbol 141 MovieClip Frame 1
stop();
Symbol 145 MovieClip Frame 1
stop();
Symbol 154 MovieClip [Torre] Frame 1
#initclip 15
Object.registerClass("Torre", TorreEditor);
#endinitclip
stop();
Symbol 154 MovieClip [Torre] Frame 2
texto._visible = false;
Symbol 154 MovieClip [Torre] Frame 3
texto.gotoAndStop(2);
texto._visible = false;
Symbol 154 MovieClip [Torre] Frame 4
texto.gotoAndStop(3);
texto._visible = false;
Symbol 154 MovieClip [Torre] Frame 5
texto.gotoAndStop(4);
texto._visible = false;
Instance of Symbol 122 MovieClip "spinas" in Symbol 156 MovieClip [Plataforma] Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + 3);
}
Symbol 166 MovieClip Frame 33
this._parent._parent.apagar = true;
this._parent.expOver = true;
Symbol 167 MovieClip Frame 12
gotoAndPlay ("walk");
Symbol 167 MovieClip Frame 29
this._parent.iglu.vida = this._parent.iglu.vida - this._parent.dano;
this._parent._parent.iniFugiu++;
this._parent.iglu.barra._width = (this._parent.iglu.vida * 60) / this._parent._parent.vidaIglu;
gotoAndStop ("death");
Symbol 167 MovieClip Frame 30
this._parent.morto = true;
Symbol 172 MovieClip Frame 19
gotoAndPlay ("walk");
Symbol 172 MovieClip Frame 40
this._parent.iglu.vida = this._parent.iglu.vida - this._parent.dano;
this._parent._parent.iniFugiu++;
this._parent.iglu.barra._width = (this._parent.iglu.vida * 60) / this._parent._parent.vidaIglu;
gotoAndStop ("death");
Symbol 172 MovieClip Frame 41
this._parent.morto = true;
Symbol 196 MovieClip Frame 18
gotoAndPlay ("walk");
Symbol 196 MovieClip Frame 43
this._parent.iglu.vida = this._parent.iglu.vida - this._parent.dano;
this._parent._parent.iniFugiu++;
this._parent.iglu.barra._width = (this._parent.iglu.vida * 60) / this._parent._parent.vidaIglu;
gotoAndStop ("death");
Symbol 196 MovieClip Frame 44
this._parent.morto = true;
Symbol 217 MovieClip Frame 21
gotoAndPlay ("walk");
Symbol 217 MovieClip Frame 38
this._parent.iglu.vida = this._parent.iglu.vida - this._parent.dano;
this._parent._parent.iniFugiu++;
this._parent.iglu.barra._width = (this._parent.iglu.vida * 60) / this._parent._parent.vidaIglu;
gotoAndStop ("death");
Symbol 217 MovieClip Frame 39
this._parent.morto = true;
Symbol 218 MovieClip [Inimigo] Frame 1
stop();
Symbol 218 MovieClip [Inimigo] Frame 2
stop();
Symbol 347 MovieClip [__Packages.md5] Frame 0
class md5
{
function md5 (b64pad, chrsz) {
if (b64pad != undefined) {
this.b64pad = b64pad;
}
if (((chrsz != undefined) && (chrsz == 8)) || (chrsz == 16)) {
this.chrsz = chrsz;
}
}
function hash(s) {
return(hex_md5(s));
}
function hex_md5(s) {
return(binl2hex(core_md5(str2binl(s), s.length * chrsz)));
}
function b64_md5(s) {
return(binl2b64(core_md5(str2binl(s), s.length * chrsz)));
}
function str_md5(s) {
return(binl2str(core_md5(str2binl(s), s.length * chrsz)));
}
function hex_hmac_md5(key, data) {
return(binl2hex(core_hmac_md5(key, data)));
}
function b64_hmac_md5(key, data) {
return(binl2b64(core_hmac_md5(key, data)));
}
function str_hmac_md5(key, data) {
return(binl2str(core_hmac_md5(key, data)));
}
function md5_cmn(q, a, b, x, s, t) {
return(safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b));
}
function md5_ff(a, b, c, d, x, s, t) {
return(md5_cmn((b & c) | ((~b) & d), a, b, x, s, t));
}
function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var _local5 = 1732584193 /* 0x67452301 */;
var _local4 = -271733879;
var _local3 = -1732584194;
var _local2 = 271733878 /* 0x10325476 */;
var _local6 = 0;
while (_local6 < x.length) {
var _local11 = _local5;
var _local10 = _local4;
var _local9 = _local3;
var _local8 = _local2;
_local5 = md5_ff(_local5, _local4, _local3, _local2, x[_local6 + 0], 7, -680876936);
_local2 = md5_ff(_local2, _local5, _local4, _local3, x[_local6 + 1], 12, -389564586);
_local3 = md5_ff(_local3, _local2, _local5, _local4, x[_local6 + 2], 17, 606105819);
_local4 = md5_ff(_local4, _local3, _local2, _local5, x[_local6 + 3], 22, -1044525330);
_local5 = md5_ff(_local5, _local4, _local3, _local2, x[_local6 + 4], 7, -176418897);
_local2 = md5_ff(_local2, _local5, _local4, _local3, x[_local6 + 5], 12, 1200080426);
_local3 = md5_ff(_local3, _local2, _local5, _local4, x[_local6 + 6], 17, -1473231341);
_local4 = md5_ff(_local4, _local3, _local2, _local5, x[_local6 + 7], 22, -45705983);
_local5 = md5_ff(_local5, _local4, _local3, _local2, x[_local6 + 8], 7, 1770035416);
_local2 = md5_ff(_local2, _local5, _local4, _local3, x[_local6 + 9], 12, -1958414417);
_local3 = md5_ff(_local3, _local2, _local5, _local4, x[_local6 + 10], 17, -42063);
_local4 = md5_ff(_local4, _local3, _local2, _local5, x[_local6 + 11], 22, -1990404162);
_local5 = md5_ff(_local5, _local4, _local3, _local2, x[_local6 + 12], 7, 1804603682);
_local2 = md5_ff(_local2, _local5, _local4, _local3, x[_local6 + 13], 12, -40341101);
_local3 = md5_ff(_local3, _local2, _local5, _local4, x[_local6 + 14], 17, -1502002290);
_local4 = md5_ff(_local4, _local3, _local2, _local5, x[_local6 + 15], 22, 1236535329);
_local5 = md5_gg(_local5, _local4, _local3, _local2, x[_local6 + 1], 5, -165796510);
_local2 = md5_gg(_local2, _local5, _local4, _local3, x[_local6 + 6], 9, -1069501632);
_local3 = md5_gg(_local3, _local2, _local5, _local4, x[_local6 + 11], 14, 643717713);
_local4 = md5_gg(_local4, _local3, _local2, _local5, x[_local6 + 0], 20, -373897302);
_local5 = md5_gg(_local5, _local4, _local3, _local2, x[_local6 + 5], 5, -701558691);
_local2 = md5_gg(_local2, _local5, _local4, _local3, x[_local6 + 10], 9, 38016083);
_local3 = md5_gg(_local3, _local2, _local5, _local4, x[_local6 + 15], 14, -660478335);
_local4 = md5_gg(_local4, _local3, _local2, _local5, x[_local6 + 4], 20, -405537848);
_local5 = md5_gg(_local5, _local4, _local3, _local2, x[_local6 + 9], 5, 568446438);
_local2 = md5_gg(_local2, _local5, _local4, _local3, x[_local6 + 14], 9, -1019803690);
_local3 = md5_gg(_local3, _local2, _local5, _local4, x[_local6 + 3], 14, -187363961);
_local4 = md5_gg(_local4, _local3, _local2, _local5, x[_local6 + 8], 20, 1163531501);
_local5 = md5_gg(_local5, _local4, _local3, _local2, x[_local6 + 13], 5, -1444681467);
_local2 = md5_gg(_local2, _local5, _local4, _local3, x[_local6 + 2], 9, -51403784);
_local3 = md5_gg(_local3, _local2, _local5, _local4, x[_local6 + 7], 14, 1735328473);
_local4 = md5_gg(_local4, _local3, _local2, _local5, x[_local6 + 12], 20, -1926607734);
_local5 = md5_hh(_local5, _local4, _local3, _local2, x[_local6 + 5], 4, -378558);
_local2 = md5_hh(_local2, _local5, _local4, _local3, x[_local6 + 8], 11, -2022574463);
_local3 = md5_hh(_local3, _local2, _local5, _local4, x[_local6 + 11], 16, 1839030562);
_local4 = md5_hh(_local4, _local3, _local2, _local5, x[_local6 + 14], 23, -35309556);
_local5 = md5_hh(_local5, _local4, _local3, _local2, x[_local6 + 1], 4, -1530992060);
_local2 = md5_hh(_local2, _local5, _local4, _local3, x[_local6 + 4], 11, 1272893353);
_local3 = md5_hh(_local3, _local2, _local5, _local4, x[_local6 + 7], 16, -155497632);
_local4 = md5_hh(_local4, _local3, _local2, _local5, x[_local6 + 10], 23, -1094730640);
_local5 = md5_hh(_local5, _local4, _local3, _local2, x[_local6 + 13], 4, 681279174);
_local2 = md5_hh(_local2, _local5, _local4, _local3, x[_local6 + 0], 11, -358537222);
_local3 = md5_hh(_local3, _local2, _local5, _local4, x[_local6 + 3], 16, -722521979);
_local4 = md5_hh(_local4, _local3, _local2, _local5, x[_local6 + 6], 23, 76029189);
_local5 = md5_hh(_local5, _local4, _local3, _local2, x[_local6 + 9], 4, -640364487);
_local2 = md5_hh(_local2, _local5, _local4, _local3, x[_local6 + 12], 11, -421815835);
_local3 = md5_hh(_local3, _local2, _local5, _local4, x[_local6 + 15], 16, 530742520);
_local4 = md5_hh(_local4, _local3, _local2, _local5, x[_local6 + 2], 23, -995338651);
_local5 = md5_ii(_local5, _local4, _local3, _local2, x[_local6 + 0], 6, -198630844);
_local2 = md5_ii(_local2, _local5, _local4, _local3, x[_local6 + 7], 10, 1126891415);
_local3 = md5_ii(_local3, _local2, _local5, _local4, x[_local6 + 14], 15, -1416354905);
_local4 = md5_ii(_local4, _local3, _local2, _local5, x[_local6 + 5], 21, -57434055);
_local5 = md5_ii(_local5, _local4, _local3, _local2, x[_local6 + 12], 6, 1700485571);
_local2 = md5_ii(_local2, _local5, _local4, _local3, x[_local6 + 3], 10, -1894986606);
_local3 = md5_ii(_local3, _local2, _local5, _local4, x[_local6 + 10], 15, -1051523);
_local4 = md5_ii(_local4, _local3, _local2, _local5, x[_local6 + 1], 21, -2054922799);
_local5 = md5_ii(_local5, _local4, _local3, _local2, x[_local6 + 8], 6, 1873313359);
_local2 = md5_ii(_local2, _local5, _local4, _local3, x[_local6 + 15], 10, -30611744);
_local3 = md5_ii(_local3, _local2, _local5, _local4, x[_local6 + 6], 15, -1560198380);
_local4 = md5_ii(_local4, _local3, _local2, _local5, x[_local6 + 13], 21, 1309151649);
_local5 = md5_ii(_local5, _local4, _local3, _local2, x[_local6 + 4], 6, -145523070);
_local2 = md5_ii(_local2, _local5, _local4, _local3, x[_local6 + 11], 10, -1120210379);
_local3 = md5_ii(_local3, _local2, _local5, _local4, x[_local6 + 2], 15, 718787259);
_local4 = md5_ii(_local4, _local3, _local2, _local5, x[_local6 + 9], 21, -343485551);
_local5 = safe_add(_local5, _local11);
_local4 = safe_add(_local4, _local10);
_local3 = safe_add(_local3, _local9);
_local2 = safe_add(_local2, _local8);
_local6 = _local6 + 16;
}
return(Array(_local5, _local4, _local3, _local2));
}
function core_hmac_md5(key, data) {
var _local3 = new Array(str2binl(key));
if (_local3.length > 16) {
_local3 = core_md5(_local3, key.length * chrsz);
}
var _local4 = new Array(16);
var _local5 = new Array(16);
var _local2 = 0;
while (_local2 < 16) {
_local4[_local2] = _local3[_local2] ^ 909522486;
_local5[_local2] = _local3[_local2] ^ 1549556828;
_local2++;
}
var _local6 = new Array(core_md5(_local4.concat(str2binl(data)), 512 + (data.length * chrsz)));
return(core_md5(_local5.concat(_local6), 640));
}
function safe_add(x, y) {
var _local1 = new Number((x & 65535) + (y & 65535));
var _local2 = new Number(((x >> 16) + (y >> 16)) + (_local1 >> 16));
return((_local2 << 16) | (_local1 & 65535));
}
function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
function str2binl(str) {
var _local4 = new Array();
var _local5 = (1 << chrsz) - 1;
var _local2 = 0;
while (_local2 < (str.length * chrsz)) {
_local4[_local2 >> 5] = _local4[_local2 >> 5] | ((str.charCodeAt(_local2 / chrsz) & _local5) << (_local2 % 32));
_local2 = _local2 + chrsz;
}
return(_local4);
}
function binl2str(bin) {
var _local4 = new String("");
var _local5 = (1 << chrsz) - 1;
var _local2 = 0;
while (_local2 < (bin.length * 32)) {
_local4 = _local4 + String.fromCharCode((bin[_local2 >> 5] >>> (_local2 % 32)) & _local5);
_local2 = _local2 + chrsz;
}
return(_local4);
}
function binl2hex(binarray) {
var _local3 = "0123456789abcdef";
var _local4 = new String("");
var _local1 = 0;
while (_local1 < (binarray.length * 4)) {
_local4 = _local4 + (_local3.charAt((binarray[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((binarray[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(_local4);
}
function binl2b64(binarray) {
var _local7 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var _local5 = new String("");
var _local3 = 0;
while (_local3 < (binarray.length * 4)) {
var _local6 = ((((binarray[_local3 >> 2] >> (8 * (_local3 % 4))) & 255) << 16) | (((binarray[(_local3 + 1) >> 2] >> (8 * ((_local3 + 1) % 4))) & 255) << 8)) | ((binarray[(_local3 + 2) >> 2] >> (8 * ((_local3 + 2) % 4))) & 255);
var _local2 = 0;
while (_local2 < 4) {
if (((_local3 * 8) + (_local2 * 6)) > (binarray.length * 32)) {
_local5 = _local5 + b64pad;
} else {
_local5 = _local5 + _local7.charAt((_local6 >> (6 * (3 - _local2))) & 63);
}
_local2++;
}
_local3 = _local3 + 3;
}
return(_local5);
}
var b64pad = new String("");
var chrsz = new Number(8);
}
Symbol 348 MovieClip [__Packages.Particle] Frame 0
class Particle
{
var _stageWidth, _stageHeight, clip, _xVel, _yVel;
function Particle (libParticle, xpos, ypos, stageWidth, stageHeight) {
_stageWidth = stageWidth;
_stageHeight = stageHeight;
clip = libParticle;
clip._x = xpos;
clip._y = ypos;
}
function setVel(xvel, yvel) {
_xVel = xvel;
_yVel = yvel;
}
function setSize(size) {
clip._width = size;
clip._height = size;
}
function setAlphaDecr(val) {
_alphaDecr = val;
}
function update() {
clip._x = clip._x + _xVel;
clip._y = clip._y + _yVel;
clip._alpha = clip._alpha - _alphaDecr;
}
function destroy() {
removeMovieClip(clip);
}
var _alphaDecr = 0;
}
Symbol 349 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.0");
}
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 get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local3 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servicesURL != undefined) {
_servicesURL = urlOptions().servicesURL;
}
allowDomains(_servicesURL);
_clip = clip.createEmptyMovieClip(_local3, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip((((_servicesURL + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
if (_root.mochiad_options) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static var _servicesURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
}
Symbol 350 MovieClip [__Packages.TorreEditor] Frame 0
class TorreEditor extends MovieClip
{
var precisao, reload, rate, amo, dano, range, radius, tiroSpeed, cartucho, ID, carregando, reloadTemp, rateTemp, amoTemp, gotoAndStop, marca, barraAmo, ent;
function TorreEditor () {
super();
}
function init(ID, up) {
switch (ID) {
case 1 :
precisao = 25;
reload = 72;
rate = 2;
amo = 50;
dano = 1;
range = 30;
radius = 50;
tiroSpeed = 10;
cartucho = 0;
if (up[0]) {
amo = amo + 10;
}
if (up[1]) {
precisao = precisao - 20;
}
break;
case 2 :
precisao = 0;
reload = 72;
rate = 48;
amo = 1;
dano = 20;
range = 100;
radius = 100;
tiroSpeed = 30;
cartucho = 0;
if (up[2]) {
reload = reload - 12;
}
if (up[3]) {
amo = amo + 1;
}
break;
case 3 :
precisao = 20;
reload = 144;
rate = 24;
amo = 7;
dano = 4;
range = 8;
radius = 30;
tiroSpeed = 15;
cartucho = 6;
if (up[4]) {
range = range + 2;
}
if (up[5]) {
reload = reload - 36;
}
break;
case 4 :
precisao = 10;
reload = 96;
rate = 20;
amo = 4;
dano = 0.5;
range = 30;
radius = 30;
tiroSpeed = 4;
cartucho = 0;
if (up[6]) {
amo = amo + 2;
}
if (!up[7]) {
break;
}
range = range + 15;
}
this.ID = ID;
carregando = false;
reloadTemp = 0;
rateTemp = 0;
amoTemp = amo;
gotoAndStop(ID + 1);
marca._visible = false;
}
function getLiberado() {
if (((amoTemp <= 0) || (rateTemp > 0)) || (carregando)) {
return(false);
}
rateTemp = rate;
amoTemp--;
if (amoTemp <= 0) {
carregando = true;
barraAmo._alpha = 50;
}
barraAmo._height = (30 / amo) * amoTemp;
return(true);
}
function updateTorre() {
if (rateTemp > 0) {
rateTemp--;
}
if (carregando) {
reloadTemp++;
barraAmo._height = (30 / reload) * reloadTemp;
if (reloadTemp >= reload) {
reloadTemp = 0;
amoTemp = amo;
carregando = false;
barraAmo._alpha = 100;
ent._parent._parent.sndReload.start();
}
}
}
function getID() {
return(ID);
}
function getCartucho() {
return(cartucho);
}
function getTiroSpeed() {
return(tiroSpeed);
}
function getPrecisao() {
return(precisao);
}
function getRange() {
return(range);
}
function getRateTemp() {
return(rateTemp);
}
function getCarregando() {
return(carregando);
}
function getRadius() {
return(radius);
}
function getDano() {
return(dano);
}
}
Symbol 351 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 352 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 353 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 354 MovieClip [__Packages.Delay] Frame 0
class Delay
{
var m_fn, m_param, m_context, m_delay, m_started, m_timerId;
function Delay (context, fn, delay) {
m_fn = fn;
m_param = new Array();
var _local3 = 3;
while (_local3 < arguments.length) {
m_param.push(arguments[_local3]);
_local3++;
}
m_context = context;
m_delay = delay;
m_started = getTimer();
m_timerId = setInterval(mx.utils.Delegate.create(this, onEvent), delay);
}
function onEvent() {
if (getTimer() >= (m_delay + m_started)) {
clearInterval(m_timerId);
m_fn.apply(m_context, m_param);
m_fn = undefined;
m_param = undefined;
}
}
static function oneShot(context, fn, delay) {
var _local3 = new Delay(context, fn, delay);
_local3.m_param = new Array();
var _local2 = 3;
while (_local2 < arguments.length) {
_local3.m_param.push(arguments[_local2]);
_local2++;
}
}
}
Symbol 355 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 356 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 357 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 358 MovieClip [__Packages.AnimDriver] Frame 0
class AnimDriver extends MovieClip
{
var fps, pauseOffset, gotoAndStop, loop, startTime, onEnterFrame, _totalframes;
function AnimDriver () {
super();
}
function initAnimDriver(p_fps) {
fps = p_fps;
pauseOffset = 0;
}
function playAnim(p_frame, p_loop) {
gotoAndStop(p_frame);
loop = p_loop;
startTime = getTimer();
onEnterFrame = mx.utils.Delegate.create(this, updateAnim);
}
function disableAnim() {
onEnterFrame = undefined;
}
function jumpTo(p_frame) {
stopAnim();
playAnim(p_frame);
}
function pauseAnim() {
pauseOffset = getTimer();
onEnterFrame = undefined;
}
function stopAnim() {
startTime = 1;
onEnterFrame = undefined;
}
function updateAnim() {
var _local3 = getTimer();
var _local4 = (1 / fps) * 1000;
var _local2 = Math.round(((_local3 - startTime) / _local4) + 1);
if (_local2 >= _totalframes) {
startTime = _local3;
_local2 = _totalframes;
if (!loop) {
stopAnim();
}
}
gotoAndStop(_local2);
}
}
Symbol 359 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if ((options.clip == null) || (options.clip == undefined)) {
options.clip = mochi.as2.MochiServices.clip;
}
if ((options.clip != mochi.as2.MochiServices.__get__clip()) || (mochi.as2.MochiServices.__get__childClip()._target == undefined)) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.connect(mochi.as2.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.as2.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.as2.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.as2.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
mochi.as2.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.as2.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.as2.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 360 MovieClip [__Packages.mochi.as2.MochiDigits] Frame 0
class mochi.as2.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 231 MovieClip Frame 73
stop();
_root.showPlayBtn();
Symbol 241 MovieClip Frame 1
stop();
Symbol 242 MovieClip [KingLoader] Frame 1
#initclip 16
Object.registerClass("KingLoader", AnimDriver);
#endinitclip
Symbol 248 MovieClip Frame 1
var somPharaoh = new Sound(snd_pharaoh);
somPharaoh.attachSound("pharaoh");
somPharaoh.setVolume(50);
onMouseDown = this._parent.pharaohgames;
Symbol 248 MovieClip Frame 12
somPharaoh.start();
Symbol 248 MovieClip Frame 84
delete onMouseDown;
this._parent.play();
Symbol 253 MovieClip Frame 1
stop();
Symbol 275 MovieClip Frame 1
stop();
Symbol 275 MovieClip Frame 2
function config() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < this._parent.scoreLevel.length) {
_local3 = _local3 + this._parent.scoreLevel[_local2];
_local2++;
}
_local2 = 0;
while (_local2 < this._parent.arrAch.length) {
if (this._parent.arrAch[_local2]) {
_local3 = _local3 + 5000;
}
_local2++;
}
score.text = _local3;
}
config();
Symbol 275 MovieClip Frame 3
logo.gotoAndStop(2);
Symbol 293 MovieClip Frame 1
stop();
Symbol 302 MovieClip Frame 1
var listener = new Object();
listener.click = function () {
_root.upSlide.play();
};
myopt.addEventListener("click", listener);
txt_upgPoints.text = this._parent._parent.upgPoints;
var i = 0;
while (i < 4) {
var atual = this["esk" + i];
atual.gotoAndStop(i + 2);
atual.marca._visible = false;
atual.barraAmo._visible = false;
atual.ent.useHandCursor = false;
atual.ent.onRollOver = function () {
this._parent.texto._visible = true;
};
atual.ent.onRollOut = (atual.ent.onReleaseOutside = function () {
this._parent.texto._visible = false;
});
i++;
}
Symbol 303 MovieClip Frame 1
stop();
Symbol 303 MovieClip Frame 12
stop();
Symbol 303 MovieClip Frame 24
gotoAndStop (1);
Symbol 329 MovieClip Frame 1
stop();
btn_prev.onRelease = function () {
this._parent.prevFrame();
};
btn_next.onRelease = function () {
this._parent.nextFrame();
};
btn_next.onPress = (btn_prev.onPress = function () {
this._parent._parent._parent.sndPress.start();
});
btn_next.onRollOver = (btn_prev.onRollOver = function () {
this._parent._parent._parent.sndOver.start();
});
btn_prev._visible = false;
var listener = new Object();
listener.click = function () {
_root.dataSlide.play();
};
myopt.addEventListener("click", listener);
Symbol 329 MovieClip Frame 2
btn_prev._visible = true;
btn_prev.onRelease = function () {
this._parent.prevFrame();
};
btn_next.onPress = (btn_prev.onPress = function () {
this._parent._parent._parent.sndPress.start();
});
btn_next.onRollOver = (btn_prev.onRollOver = function () {
this._parent._parent._parent.sndOver.start();
});
Symbol 329 MovieClip Frame 5
var listener2 = new Object();
listener2.click = function () {
_root.dataSlide.play();
};
myopt2.addEventListener("click", listener2);
Symbol 329 MovieClip Frame 8
btn_next._visible = true;
btn_next.onRelease = function () {
this._parent.nextFrame();
};
btn_next.onPress = (btn_prev.onPress = function () {
this._parent._parent._parent.sndPress.start();
});
btn_next.onRollOver = (btn_prev.onRollOver = function () {
this._parent._parent._parent.sndOver.start();
});
Symbol 329 MovieClip Frame 9
btn_next.onPress = (btn_prev.onPress = function () {
this._parent._parent._parent.sndPress.start();
});
btn_next.onRollOver = (btn_prev.onRollOver = function () {
this._parent._parent._parent.sndOver.start();
});
Symbol 330 MovieClip Frame 1
stop();
Symbol 330 MovieClip Frame 12
stop();
Symbol 330 MovieClip Frame 24
gotoAndStop (1);
Symbol 333 MovieClip Frame 1
stop();
Symbol 344 MovieClip Frame 1
iglu0._xscale = 75;
iglu0._yscale = 75;