Frame 1
fscommand ("showmenu", false);
fscommand ("trapallkeys", true);
fscommand ("allowscale", false);
lang = System.capabilities.language;
id = 419;
Total = _root.getBytesTotal();
TotalField = Total;
Percent = 1;
Instance of Symbol 454 MovieClip "bar" in Frame 1
onClipEvent (enterFrame) {
this._xscale = _root.Percent;
}
Frame 2
Load = _root.getBytesLoaded();
LoadField = Load;
Percent = int((Load / Total) * 100);
PercentField = Percent + " %";
Frame 3
if (Load < Total) {
gotoAndPlay (2);
}
Frame 4
stop();
Frame 5
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);
}
function buttonScale() {
if (this.hitTest(_xmouse, _ymouse)) {
this._xscale = (this._yscale = this._yscale + ((130 - this._yscale) / 5));
} else {
this._xscale = (this._yscale = this._yscale - ((this._yscale - 100) / 5));
}
}
function blinking() {
if ((Math.round(getTimer() / 100) % 2) == 0) {
this.transform.colorTransform = white;
} else if ((Math.round(getTimer() / 100) % 2) == 1) {
this.transform.colorTransform = defaultMissile;
}
}
fscommand ("showmenu", false);
__com_mochibot__("7801eb17", this, 10301, true);
stop();
var tipen = new Array();
var tipru = new Array();
currentTip = 0;
tipen[1] = ["Great! Now adjust the direction and power using mouse.", "Use Arrows or WASD + SHIFT to observe the terrain!", "I think piezo sphere is great when the enemy in a hollow!", "Don't forget to click after you launch the cloud and before it hits the ground!", "Stay away from allies cause the enemy can hit you all!", "The more of my health you save, the more points you get!"];
tipen[0] = ["Great! Now adjust the direction and power using mouse.", "Use Arrows or WASD + SHIFT to observe the terrain!", "It's better to throw Devil's head higher.", "Don't use Devil's heart near me and my allies!", "The enemy becomes more accurate each level.", "The more of my health you save, the more points you get!"];
tipru[1] = ["\u041E\u0442\u043B\u0438\u0447\u043D\u043E! \u0422\u0435\u043F\u0435\u0440\u044C \u0432\u044B\u0431\u0435\u0440\u0438 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0438 \u0441\u0438\u043B\u0443 \u0431\u0440\u043E\u0441\u043A\u0430 \u0438 \u043E\u0442\u043F\u0443\u0441\u0442\u0438 \u043C\u044B\u0448\u044C.", "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439 \u0441\u0442\u0440\u0435\u043B\u043A\u0438 \u0438\u043B\u0438 WASD + SHIFT \u0434\u043B\u044F \u043E\u0431\u0437\u043E\u0440\u0430 \u0442\u0435\u0440\u0440\u0438\u0442\u043E\u0440\u0438\u0438!", "\u041F\u044C\u0435\u0437\u043E\u0441\u0444\u0435\u0440\u0430 \u0445\u043E\u0440\u043E\u0448\u0430, \u043A\u043E\u0433\u0434\u0430 \u043F\u0440\u043E\u0442\u0438\u0432\u043D\u0438\u043A \u0432 \u043D\u0438\u0437\u0438\u043D\u0435.", "\u041A\u043B\u0438\u043A\u043D\u0438 \u043F\u043E\u0441\u043B\u0435 \u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u043E\u0431\u043B\u0430\u043A\u0430, \u0447\u0442\u043E\u0431\u044B \u0435\u0433\u043E \u0430\u043A\u0442\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C!", "\u0414\u0435\u0440\u0436\u0438\u0441\u044C \u043F\u043E\u0434\u0430\u043B\u044C\u0448\u0435 \u043E\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u043D\u0433\u0435\u043B\u043E\u0432, \u0442.\u043A. \u0432\u0440\u0430\u0433 \u043C\u043E\u0436\u0435\u0442 \u0430\u0442\u0430\u043A\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435\u0445 \u0432\u043C\u0435\u0441\u0442\u0435!", "\u0427\u0435\u043C \u0431\u043E\u043B\u044C\u0448\u0435 \u0436\u0438\u0437\u043D\u0438 \u043C\u043D\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0448\u044C, \u0442\u0435\u043C \u0431\u043E\u043B\u044C\u0448\u0435 \u043E\u0447\u043A\u043E\u0432 \u043F\u043E\u043B\u0443\u0447\u0438\u0448\u044C!"];
tipru[0] = ["\u041E\u0442\u043B\u0438\u0447\u043D\u043E! \u0422\u0435\u043F\u0435\u0440\u044C \u0432\u044B\u0431\u0435\u0440\u0438 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0438 \u0441\u0438\u043B\u0443 \u0431\u0440\u043E\u0441\u043A\u0430 \u0438 \u043E\u0442\u043F\u0443\u0441\u0442\u0438 \u043C\u044B\u0448\u044C.", "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439 \u0441\u0442\u0440\u0435\u043B\u043A\u0438 \u0438\u043B\u0438 WASD + SHIFT \u0434\u043B\u044F \u043E\u0431\u0437\u043E\u0440\u0430 \u0442\u0435\u0440\u0440\u0438\u0442\u043E\u0440\u0438\u0438!", "\u041B\u0443\u0447\u0448\u0435 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0442\u044C \u0413\u043E\u043B\u043E\u0432\u0443 \u0414\u044C\u044F\u0432\u043E\u043B\u0430 \u043F\u043E\u0432\u044B\u0448\u0435.", "\u041D\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439 \u0421\u0435\u0440\u0434\u0446\u0435 \u0434\u044C\u044F\u0432\u043E\u043B\u0430 \u0440\u044F\u0434\u043E\u043C \u0441\u043E \u043C\u043D\u043E\u0439!", "\u0412\u0440\u0430\u0433 \u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0441\u044F \u0432\u0441\u0435 \u0442\u043E\u0447\u043D\u0435\u0435 \u0441 \u043A\u0430\u0436\u0434\u044B\u043C \u0443\u0440\u043E\u0432\u043D\u0435\u043C.", "\u0427\u0435\u043C \u0431\u043E\u043B\u044C\u0448\u0435 \u0436\u0438\u0437\u043D\u0438 \u043C\u043D\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0448\u044C, \u0442\u0435\u043C \u0431\u043E\u043B\u044C\u0448\u0435 \u043E\u0447\u043A\u043E\u0432 \u043F\u043E\u043B\u0443\u0447\u0438\u0448\u044C!"];
var phraseen = new Array();
var phraseru = new Array();
phraseen[0] = ["Save water. Shower with your girl friend.", "Have you ever visited MADFATCAT.COM ?", "O-la-la!", "Pack it up, pack it in, Let me begin...", "If there is no god, who pops up the next kleenex?", "Reality is only an illusion that occurs due to a lack of alcohol.", "I am planning to be more spontaneous in the future."];
phraseen[1] = ["God made relatives; Thank God we can choose our friends.", "Love the neighbor. But don't get caught.", "Jesus saves sinners and redeems them for cash and valuable prizes.", "People who say you can't buy happiness just don't know where to shop.", "If at first you don't succeed skydiving is not for you.", "Have you ever visited MADFATCAT.COM ?", "Only one thing is impossible for God: To find any sense in any copyright law on the planet."];
phraseru[0] = ["\u041F\u043E\u0441\u0435\u0449\u0430\u043B \u0440\u0430\u043D\u044C\u0448\u0435 MADFATCAT.COM ?", "\u041E\u0431\u0430-\u043D\u0430!", "\u0410\u043D\u0433\u0435\u043B \u043C\u043E\u0439 \u043D\u0435\u0437\u0435\u043C\u043D\u043E\u0439, \u0442\u044B \u043F\u043E\u0432\u0441\u044E\u0434\u0443 \u0441\u043E \u043C\u043D\u043E-\u043E-\u043E\u0439...", "\u0414\u043B\u044F \u0440\u0435\u043F\u0443\u0442\u0430\u0446\u0438\u0438 \u0411\u043E\u0433\u0430 \u0431\u044B\u043B\u043E \u0431\u044B \u043B\u0443\u0447\u0448\u0435, \u0435\u0441\u043B\u0438 \u0431\u044B \u043E\u043D \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043E\u0432\u0430\u043B.", "\u041F\u043B\u0430\u0442\u043E\u043D \u043C\u043D\u0435 \u0434\u0440\u0443\u0433, \u043D\u043E \u0438\u0441\u0442\u0438\u043D\u0430 \u0432 \u0432\u0438\u043D\u0435!", "\u0412\u0430\u043C \u043F\u043E\u0441\u0442\u0430\u0432\u0438\u043B\u0438 \u043D\u043E\u0432\u0443\u044E \u043E\u0446\u0435\u043D\u043A\u0443 \u043D\u0430 \u041E\u0434\u043D\u043E\u043A\u043B\u0430\u0441\u0441\u043D\u0438\u043A\u0430\u0445.", "X-LIFESTYLE.COM - \u0442\u043E\u043B\u043A\u043E\u0432\u044B\u0439 \u0441\u0430\u0439\u0442, \u043F\u043E\u0441\u0432\u044F\u0449\u0435\u043D\u043D\u044B\u0439 \u044D\u043A\u0441\u0442\u0440\u0438\u043C\u0443."];
phraseru[1] = ["\u0418\u043B\u0438 \u0411\u0438\u0431\u043B\u0438\u044F \u043E\u0442\u0434\u0430\u043B\u0438\u0442 \u0442\u0435\u0431\u044F \u043E\u0442 \u0413\u0440\u0435\u0445\u0430, \u0438\u043B\u0438 \u0413\u0440\u0435\u0445 \u043E\u0442 \u0411\u0438\u0431\u043B\u0438\u0438!", "\u041A\u0438\u0434\u0430\u044E\u0449\u0438\u0439 \u0434\u0430 \u043F\u043E\u043F\u0430\u0434\u0435\u0442!", "\u0418\u043B\u0438 \u0435\u0449\u0435 \u0430\u043D\u0435\u043A\u0434\u043E\u0442: \u0438\u0434\u0435\u0442 \u0410\u0434\u0430\u043C \u043F\u043E \u0420\u0430\u044E, \u0431\u0430\u0446, \u0432\u044B\u043F\u0430\u043B\u043E \u0440\u0435\u0431\u0440\u043E...", "\u0411\u044B\u0432\u0430\u043B \u043D\u0430 MADFATCAT.COM ?", "\u042F \u0443\u043C\u0435\u044E \u0432\u044B\u0445\u043E\u0434\u0438\u0442\u044C \u0432 \u0430\u0441\u0442\u0440\u0430\u043B, \u043A\u043E\u0433\u0434\u0430 \u043F\u043E\u0436\u0435\u043B\u0430\u044E!", "X-LIFESTYLE.COM - \u0442\u043E\u043B\u043A\u043E\u0432\u044B\u0439 \u0441\u0430\u0439\u0442, \u043F\u043E\u0441\u0432\u044F\u0449\u0435\u043D\u043D\u044B\u0439 \u044D\u043A\u0441\u0442\u0440\u0438\u043C\u0443."];
zvuk = true;
charSpeed = 0;
ay = 1.1;
noWay = 0;
jumpSpeed = 0;
maxCharSpeed = 5;
speedPrirost = 1.2;
totalPoints = 0;
score = 0;
_damp = 0.96;
_dampX = 0.98;
missileKK = 0.005;
var missileCostKoef = new Array(2, 5, 15, 30);
var shrinesUpd = new Array();
shrinesUpd[0] = [80, 100, 100, 100];
shrinesUpd[1] = [80, 100, 100, 100];
var shrines = new Array();
shrines[0] = [80, 100, 100, 100];
shrines[1] = [80, 100, 100, 100];
shrines[2] = [75, 95, 100, 100];
shrines[3] = [70, 90, 100, 100];
shrines[4] = [65, 85, 100, 100];
shrines[5] = [60, 80, 95, 100];
shrines[6] = [55, 75, 94, 100];
shrines[7] = [50, 74, 93, 100];
shrines[8] = [45, 70, 90, 100];
shrines[9] = [40, 60, 80, 100];
shrines[10] = [30, 50, 75, 100];
var missileAmount = new Array();
missileAmount[1] = [2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0];
missileAmount[2] = [2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 2, 2, 1, 0];
missileAmount[3] = [2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 2, 2, 1, 0];
missileAmount[4] = [2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0];
missileAmount[5] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0];
missileAmount[6] = [1, 1, 3, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 0];
missileAmount[7] = [1, 2, 2, 1, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1];
missileAmount[8] = [1, 2, 2, 1, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1];
missileAmount[9] = [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1];
missileAmount[10] = [1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2, 1, 1];
var charsAmount = new Array(0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5);
availMissile = new flash.geom.ColorTransform();
availMissile.redOffset = 225;
availMissile.greenOffset = -40;
availMissile.blueOffset = -40;
white = new flash.geom.ColorTransform();
white.redOffset = 50;
white.greenOffset = 50;
white.blueOffset = 50;
defaultMissile = new flash.geom.ColorTransform();
defaultMissile.alphaMultiplier = 1;
defaultMissile.redMultiplier = 1;
defaultMissile.greenMultiplier = 1;
defaultMissile.blueMultiplier = 1;
highscores.onEnterFrame = (ng.onEnterFrame = (pg.onEnterFrame = (pmg.onEnterFrame = buttonScale)));
pmg.onRelease = function () {
getURL ("http://madfatcat.com?ref=SW2", "_blank");
};
highscores.onRelease = function () {
getURL ("http://www.madfatcat.com/highscores/" + _root.id, "_blank");
};
ng.onRelease = function () {
play();
};
MovieClip.prototype.playSound = function (snd, times) {
this.thisSound.stop();
if (snd == undefined) {
return(undefined);
}
this.thisSound = new Sound(this);
this.thisSound.attachSound(snd);
if (times == undefined) {
this.thisSound.start();
} else {
this.thisSound.start(0, times);
}
};
this.playSound("_mainMusic", 9999);
so = SharedObject.getLocal("SlingWarsAD");
if (so.data.vars.score == undefined) {
pg._visible = false;
}
pg.onPress = function () {
loadGame = true;
gotoAndStop ("gamePlay");
};
var container = this.createEmptyMovieClip("container", this.getNextHighestDepth());
var mcLoader = new MovieClipLoader();
mcLoader.loadClip("http://madfatcat.com/sw2.swf", container);
var fromServer = new LoadVars();
fromServer.load("http://www.madfatcat.com/SW2config.txt");
fromServer.onLoad = function () {
_root.showMochi = fromServer.showMochi;
};
Instance of Symbol 524 MovieClip in Frame 5
onClipEvent (load) {
if (_root.zvuk == true) {
_root.thisSound.setVolume(100);
this.gotoAndStop(1);
} else {
_root.thisSound.setVolume(0);
this.gotoAndStop(2);
}
}
on (release) {
_root.zvuk = !_root.zvuk;
if (_root.zvuk == true) {
_root.thisSound.setVolume(100);
this.gotoAndStop(1);
} else {
_root.thisSound.setVolume(0);
this.gotoAndStop(2);
}
}
Instance of Symbol 526 MovieClip in Frame 5
on (release) {
getURL ("http://madfatcat.com?ref=SW2", "_blank");
}
Instance of Symbol 528 MovieClip in Frame 5
on (release) {
_root.lang = "en";
_root.pg.gotoAndStop(_root.lang);
_root.ng.gotoAndStop(_root.lang);
_root.pmg.gotoAndStop(_root.lang);
_root.highscores.gotoAndStop(_root.lang);
}
Instance of Symbol 530 MovieClip in Frame 5
on (release) {
_root.lang = "ru";
_root.pg.gotoAndStop(_root.lang);
_root.ng.gotoAndStop(_root.lang);
_root.pmg.gotoAndStop(_root.lang);
_root.highscores.gotoAndStop(_root.lang);
}
Frame 28
angel.onEnterFrame = (demon.onEnterFrame = buttonScale);
angel.onRelease = function () {
yourCharTyp = 1;
play();
delete demon.onRelease;
delete angel.onRelease;
delete this.onEnterFrame;
this._xscale = (this._yscale = 100);
};
demon.onRelease = function () {
yourCharTyp = 0;
play();
delete demon.onRelease;
delete angel.onRelease;
delete this.onEnterFrame;
this._xscale = (this._yscale = 100);
};
level = 1;
stop();
Frame 29
stop();
pr.onEnterFrame = buttonScale;
pr.onRelease = function () {
gotoAndPlay ("chooseLevel");
};
if (yourCharTyp == 1) {
gotoAndStop ("instrAngels");
}
Frame 35
this.playSound();
play();
address = _url;
address = address.substr(0, 20);
if (((((((address != "http://madfatcat.com") && (address != "http://www.madfatcat")) && (address != "http://www.mousebrea")) && (address != "http://mousebreaker.")) && (address != "http://flashgamelice")) && (address != "http://www.flashgame")) && (address != "https://www.flashgam")) {
if (_root.showMochi != 0) {
mochi.as2.MochiAd.showInterLevelAd({id:"0c3aa2f3befffafc", res:"640x480"});
}
}
Frame 36
stop();
this.playSound("_mainMusic", 9999);
lvl.gotoAndStop(_root.lang);
if (_root.lang == "ru") {
lvl.lvl.text = "\u0423\u0440\u043E\u0432\u0435\u043D\u044C " + level;
} else {
lvl.lvl.text = "Level " + level;
}
pmg.onRelease = function () {
getURL ("http://madfatcat.com?ref=SW2", "_blank");
};
proceed.onRelease = function () {
play();
};
pmg.onEnterFrame = (proceed.onEnterFrame = buttonScale);
activePic = undefined;
if (yourCharTyp == 1) {
i = 0;
while (i <= 10) {
if (i >= level) {
_root["l" + i].rama.gotoAndStop(2);
if (activePic == undefined) {
activePic = i;
_root["l" + i].onEnterFrame = blinking;
}
}
i++;
}
} else if (yourCharTyp == 0) {
i = 0;
while (i <= 10) {
if (i >= (11 - level)) {
_root["l" + i].rama.gotoAndStop(2);
if (activePic == undefined) {
activePic = i;
_root["l" + (i - 1)].onEnterFrame = blinking;
}
}
i++;
}
}
Frame 54
function init() {
clearAll();
t0 = getTimer();
yourActive = (enemyActive = 0);
xoffset = (yoffset = 0);
yourTurn = true;
lighting = new Array();
flame = new Array();
faer = new Array();
missile = new Array();
yourChar = new Array();
enemyChar = new Array();
if (yourCharTyp == 1) {
i = level + 1;
} else {
i = 11 - level;
}
bgr.gotoAndStop(i);
bgr2.gotoAndStop(i);
fon.gotoAndStop(i);
this.createEmptyMovieClip("chars", _root.getNextHighestDepth());
this.createEmptyMovieClip("missileLayer", _root.getNextHighestDepth());
this.createEmptyMovieClip("topLayer", _root.getNextHighestDepth());
if (loadGame != true) {
for (i in missileAmount[level]) {
j = 0;
while (j < missileAmount[level][i]) {
if (i < 10) {
generateMissile(random((bgr._width / 2) - 100) + 50, i);
} else {
generateMissile((random((bgr._width / 2) - 100) + (bgr._width / 2)) + 50, i);
}
j++;
}
}
i = 0;
while (i < charsAmount[level]) {
generateChar(random((bgr._width / 2) - 200) + 100, 0);
generateChar((random((bgr._width / 2) - 200) + (bgr._width / 2)) + 100, 1);
i++;
}
activeChar = yourChar[0];
} else {
loadGame = undefined;
loadVars = new Object();
loadVars = so.data.vars;
for (i in loadVars) {
if (((typeof(loadVars[i]) == "string") || (typeof(loadVars[i]) == "number")) || (typeof(loadVars[i]) == "boolean")) {
this[i] = loadVars[i];
}
}
i = 0;
while (i < 4) {
shrines[yourCharTyp][i] = loadVars.shrines[yourCharTyp][i];
trace(loadVars.shrines[yourCharTyp][i]);
i++;
}
if (yourCharTyp == 1) {
i = level + 1;
} else {
i = 11 - level;
}
bgr.gotoAndStop(i);
bgr2.gotoAndStop(i);
fon.gotoAndStop(i);
for (i in so.data.missile) {
missile.push(missileLayer.attachMovie("missile" + so.data.missile[i].typ, so.data.missile[i].nam, missileLayer.getNextHighestDepth(), {_x:so.data.missile[i].xx, _y:so.data.missile[i].yy}));
for (j in so.data.missile[i]) {
missile[i][j] = so.data.missile[i][j];
}
}
for (i in so.data.enemyChar) {
enemyChar.push(chars.attachMovie("char" + so.data.enemyChar[i].typ, so.data.enemyChar[i].nam, chars.getNextHighestDepth(), {_x:so.data.enemyChar[i].xx, _y:so.data.enemyChar[i].yy}));
for (j in so.data.enemyChar[i]) {
enemyChar[i][j] = so.data.enemyChar[i][j];
}
if (enemyChar[i].typ == 0) {
enemyChar[i]._xscale = -enemyChar[i]._xscale;
}
enemyChar[i].onRollOver = showHealth;
enemyChar[i].onPress = hideHealth;
enemyChar[i].onRollOut = hideHealth;
}
for (i in so.data.yourChar) {
yourChar.push(chars.attachMovie("char" + so.data.yourChar[i].typ, so.data.yourChar[i].nam, chars.getNextHighestDepth(), {_x:so.data.yourChar[i].xx, _y:so.data.yourChar[i].yy}));
for (j in so.data.yourChar[i]) {
yourChar[i][j] = so.data.yourChar[i][j];
}
if (yourChar[i].typ == 0) {
yourChar[i]._xscale = -yourChar[i]._xscale;
}
yourChar[i].onRollOver = showHealth;
yourChar[i].onPress = hideHealth;
yourChar[i].onRollOut = hideHealth;
}
activeChar = yourChar[activeCharNum];
i = 0;
while (i < 4) {
shrinesUpd[yourCharTyp][i] = shrines[yourCharTyp][i];
i++;
}
}
shrines[enemyCharTyp] = shrines[level];
accuracy = 25 - (2.5 * level);
firstDamaged = undefined;
activeChar.onEnterFrame = charMove;
focusingObj = activeChar;
activeChar.currentStatus = "move";
activeChar.gotoAndStop("move");
if ((level == 1) && (currentTip == 0)) {
if (lang == "ru") {
showMsg("\u0422\u0435\u043F\u0435\u0440\u044C \u0432\u0435\u0434\u0438 \u043C\u0435\u043D\u044F \u043A \u043A\u0430\u043A\u043E\u043C\u0443-\u043D\u0438\u0431\u0443\u0434\u044C \u043E\u0440\u0443\u0436\u0438\u044E!");
} else {
showMsg("Now guide me to the weapon you would like me to use!");
}
}
this.onEnterFrame = mainMove;
i = 0;
while (i < 4) {
shrines[yourCharTyp][i] = shrinesUpd[yourCharTyp][i];
i++;
}
}
function getNearestMissile() {
activeChar.test = true;
charSpeed = 0;
noWay = 0;
jumpSpeed = 0;
activeChar.direct = undefined;
activeChar.currentStatus = undefined;
var _local1 = Array();
for (i in missile) {
position = 0;
for (ii in missile) {
if (Math.abs(missile[i]._x - activeChar._x) > Math.abs(missile[ii]._x - activeChar._x)) {
position++;
}
}
if (missile[i] != undefined) {
_local1[position] = missile[i];
}
}
activeChar.oldXX = activeChar._x;
activeChar.oldYY = activeChar._y;
iii = 0;
while (iii < _local1.length) {
nearest = _local1[iii];
testIterations = undefined;
if (((nearest.typ < 10) && (yourCharTyp == 1)) || (((nearest.typ >= 10) && (yourCharTyp == 0)) && (nearest.fromShrine != true))) {
testIterations = 0;
while (testIterations < 1800) {
activeChar.enemyMove();
if (testIterations == 2000) {
iii = _local1.length;
}
testIterations++;
}
}
activeChar._x = activeChar.oldXX;
activeChar._y = activeChar.oldYY;
iii++;
}
if (testIterations != 2001) {
i = 0;
while (i < _local1.length) {
if (((_local1[i].typ < 10) && (yourCharTyp == 1)) || (((_local1[i].typ >= 10) && (yourCharTyp == 0)) && (_local1[i].fromShrine != true))) {
nearest = _local1[i];
i = _local1.length;
}
i++;
}
}
charSpeed = 0;
noWay = 0;
jumpSpeed = 0;
activeChar.direct = undefined;
activeChar.currentStatus = undefined;
activeChar.test = false;
activeChar._x = activeChar.oldXX;
activeChar._y = activeChar.oldYY;
}
function enemyThrow() {
delete activeChar.onEnterFrame;
var _local1 = activeChar.getBounds(chars);
activeMissile._x = activeChar._x;
activeMissile._y = _local1.yMin - 20;
framesToHit = 0;
activeMissile._vyTest = activeMissile._vy;
while ((activeMissile._y <= target._y) || (activeMissile._vyTest < 0)) {
activeMissile._y = activeMissile._y + activeMissile._vyTest;
activeMissile._vyTest = activeMissile._vyTest + ay;
activeMissile._vyTest = activeMissile._vyTest * _damp;
framesToHit++;
}
activeMissile._y = _local1.yMin - 20;
activeMissile._vx = ((target._x - activeChar._x) * Math.log(_dampX)) / (Math.pow(_dampX, framesToHit) - 1);
if (activeMissile.typ == 12) {
activeMissile._vx = activeMissile._vx * 0.8;
}
if (activeMissile.typ == 2) {
activeMissile._vx = activeMissile._vx * 1.15;
}
distance = Math.abs(target._x - activeChar._x);
accur = accuracy * (distance / 1000);
activeMissile._vx = activeMissile._vx + (random(accur) - (accur / 2));
activeMissile.initialVx = activeMissile._vx;
activeMissile.initialVy = activeMissile._vy;
gameStatus = "throw";
activeMissile._kk = missileKK;
activeMissile.koef = 1;
activeMissile.ab = 20;
if (activeMissile.typ != 12) {
activeMissile.rotationSpeed = random(16) - 8;
}
if (activeMissile.typ == 11) {
activeMissile._otskokKoef = 1;
} else {
activeMissile._otskokKoef = 0.98;
}
focusingObj = activeMissile;
activeMissile.currentStatus = "throw";
activeMissile.playSound("_launch" + enemyCharTyp);
activeMissile.onEnterFrame = throwBall;
activeChar.gotoAndStop("standBy");
}
function charMove() {
if (pauseOn == true) {
return(undefined);
}
if ((Key.isDown(37) || (Key.isDown(65))) && (((Key.isDown(39) == false) && (Key.isDown(16) == false)) && (charSpeed <= 0))) {
if (charSpeed > (-maxCharSpeed)) {
charSpeed = charSpeed - speedPrirost;
}
if (direct != "left") {
direct = "left";
if (bgr.bgr.hitTest(this._x + chars._x, (this._y + 5) + chars._y, true)) {
this.gotoAndStop("move");
}
}
if (this._xscale < 0) {
this._xscale = -this._xscale;
}
}
if ((Key.isDown(39) || (Key.isDown(68))) && (((Key.isDown(37) == false) && (Key.isDown(16) == false)) && (charSpeed >= 0))) {
if (charSpeed < maxCharSpeed) {
charSpeed = charSpeed + speedPrirost;
}
if (direct != "right") {
direct = "right";
if (bgr.bgr.hitTest(this._x + chars._x, (this._y + 5) + chars._y, true)) {
this.gotoAndStop("move");
}
}
if (this._xscale > 0) {
this._xscale = -this._xscale;
}
}
if ((((Key.isDown(38) || (Key.isDown(87))) && (this.currentStatus != "jump")) && (Key.isDown(16) == false)) && (bgr.bgr.hitTest(this._x + chars._x, (this._y + 3) + chars._y, true) || (bgr.bgr.hitTest(this._x + chars._x, this._y + chars._y, true)))) {
jumpSpeed = -15;
this.gotoAndStop("jump");
this.playSound("_jump");
this.currentStatus = "jump";
this._y = this._y - 4;
}
if (((charSpeed == 0) && (this.currentStatus != "jump")) && (this.currentStatus != "throw")) {
this.gotoAndStop("standBy");
charSound.stop();
direct = undefined;
}
lastKeyCode = Key.getCode();
for (i in missile) {
if (this.hitTest(missile[i]) && (((yourCharTyp == 0) && (missile[i].typ < 10)) || ((yourCharTyp == 1) && (missile[i].typ >= 10)))) {
missile[i].transform.colorTransform = availMissile;
missile[i].avail = true;
missile[i].onMouseDown = clickOnMissile;
if (showClickTip != true) {
showClickTip = true;
if (lang == "ru") {
showMsg("\u0422\u0435\u043F\u0435\u0440\u044C \u043A\u043B\u0438\u043A\u043D\u0438 \u043D\u0430 \u043E\u0440\u0443\u0436\u0438\u0438 \u0438 \u0423\u0414\u0415\u0420\u0416\u0418\u0412\u0410\u0419 \u043A\u043D\u043E\u043F\u043A\u0443.");
} else {
showMsg("Now click on the weapon and HOLD the mouse button.");
}
}
} else {
missile[i].transform.colorTransform = defaultMissile;
missile[i].avail = false;
delete missile[i].onMouseDown;
}
}
if (bgr.bgr.hitTest(this._x + chars._x, (this._y + chars._y) + 2, true) == false) {
if (bgr.bgr.hitTest(this._x + chars._x, (this._y + chars._y) - 80, true)) {
jumpSpeed = 2;
this._y = this._y + 2;
}
this._y = this._y + jumpSpeed;
} else {
if (jumpSpeed > 0) {
jumpSpeed = 0;
}
while (bgr.bgr.hitTest(this._x + chars._x, this._y + chars._y, true)) {
this._y--;
}
if ((this.currentStatus == "jump") && (jumpSpeed >= 0)) {
this.gotoAndStop("standBy");
this.currentStatus = "standBy";
this.playSound((("_step" + this.typ) + "-") + random(4));
if (charSpeed != 0) {
this.gotoAndStop("move");
this.currentStatus = "move";
}
}
}
if (jumpSpeed < 20) {
jumpSpeed = jumpSpeed + ay;
}
this.nextPoint = new Object();
this.nextPoint.x = undefined;
this.nextPoint.y = undefined;
counter = 0;
if (charSpeed < 0) {
i = 1;
} else {
i = -1;
}
if ((charSpeed != 0) && (bgr.bgr.hitTest(this._x + chars._x, (this._y + chars._y) + 4, true))) {
this.pos = (Math.PI/2);
while (counter < 50) {
this.nextPoint.x = (Math.cos(this.pos) * maxCharSpeed) + this._x;
this.nextPoint.y = (Math.sin(this.pos) * maxCharSpeed) + this._y;
counter++;
if (bgr.bgr.hitTest(this.nextPoint.x + chars._x, this.nextPoint.y + chars._y, true) == false) {
counter = 100;
}
this.pos = this.pos + (0.0628318530717959 * i);
}
} else {
this.nextPoint.x = this._x + charSpeed;
this.nextPoint.y = this._y;
}
if ((((((bgr.bgr.hitTest(this.nextPoint.x + chars._x, this.nextPoint.y + chars._y, true) == false) && ((this._y - this.nextPoint.y) < (maxCharSpeed * 0.98))) && (bgr.bgr.hitTest((this._x + missileLayer._x) + ((maxCharSpeed * charSpeed) / Math.abs(charSpeed)), (this._y + missileLayer._y) - 80, true) == false)) && (bgr.bgr.hitTest((this._x + missileLayer._x) + ((maxCharSpeed * charSpeed) / Math.abs(charSpeed)), (this._y + missileLayer._y) - 40, true) == false)) && (((this._x + chars._x) > 20) || (this._xscale < 0))) && (((this._x + chars._x) < (Stage.width - 20)) || (this._xscale > 0))) {
this._x = this.nextPoint.x;
this._y = this.nextPoint.y;
} else {
charSpeed = 0;
}
if ((Math.abs(charSpeed) < 1) && (charSpeed != 0)) {
charSpeed = 0;
}
if (charSpeed > 0) {
charSpeed = charSpeed - 1;
} else if (charSpeed < 0) {
charSpeed = charSpeed + 1;
}
shotDelay++;
scrollScreen();
}
function clickOnMissile() {
if ((pauseOn == true) || (this.hitTest(_xmouse, _ymouse, true) == false)) {
return(undefined);
}
for (i in missile) {
missile[i].avail = false;
missile[i].transform.colorTransform = defaultMissile;
delete missile[i].onMouseDown;
}
this.transform.colorTransform = defaultMissile;
activeMissile = this;
this.currentStatus = "takeBall";
xoffset = (yoffset = 0);
activeChar.gotoAndStop("throw");
this.i = 0;
this.onEnterFrame = missileRotate;
activeChar.onEnterFrame = missileRotateChar;
_root.attachMovie("linePoint", "linePoint", _root.getNextHighestDepth(), {_x:activeChar.x, _y:activeChar.y - 90});
_root.attachMovie("throwingArrow", "throwingArrow", _root.getNextHighestDepth(), {_x:activeChar.x, _y:activeChar.y - 90});
_root.onMouseUp = releaseMissile;
if ((_root["tip" + lang][activeChar.typ][0] != undefined) && (level == 1)) {
showMsg(_root["tip" + lang][activeChar.typ][0]);
currentTip++;
_root["tip" + lang][activeChar.typ][0] = undefined;
}
delete this.onMouseDown;
}
function removeMissile(mis) {
missile[mis.num] = missile[missile.length - 1];
missile[mis.num].num = mis.num;
missile.pop();
removeMovieClip(mis);
}
function missileRotate() {
if (pauseOn == true) {
return(undefined);
}
if (activeChar.typ != yourCharTyp) {
this._vxx = 45;
this._vyy = 10;
} else {
this._vxx = ((activeChar._x + chars._x) - _xmouse) / 5;
this._vyy = (((activeChar._y + chars._y) - 90) - _ymouse) / 5;
}
this.oldX = this._x;
this._x = (Math.cos(this.i) * Math.abs(this._vxx)) + activeChar._x;
this._y = ((Math.sin(this.i) * Math.abs(this._vyy)) + activeChar._y) - 100;
this.i = this.i + 0.5;
if (((this.oldX > activeChar._x) && (this._x <= activeChar._x)) && (Math.abs(this.oldX - this._x) > 2)) {
this.playSound("_svist");
}
}
function missileRotateChar() {
if (pauseOn == true) {
return(undefined);
}
this.hand._rotation = -((activeMissile._x - activeChar._x) - 180);
this.hand._x = (activeMissile._x - activeChar._x) / 7;
this.head._rotation = (activeMissile._x - activeChar._x) / 4;
this.head._x = (activeMissile._x - activeChar._x) / 5;
this.body._rotation = (activeMissile._x - activeChar._x) / 2;
this.body._x = ((activeMissile._x - activeChar._x) / 7) + 10;
this.hand2._rotation = (activeMissile._x - activeChar._x) / 2;
this.hand2._x = ((activeMissile._x - activeChar._x) / 7) + 20;
this.hvost._x = ((activeMissile._x - activeChar._x) / 5) + 20;
this.krylo._x = ((activeMissile._x - activeChar._x) / 5) + 20;
if ((bgr.bgr.hitTest(this._x + chars._x, (this._y + 6) + chars._y, true) == false) && (Math.abs(this._x + chars._x) < 1500)) {
this._y = this._y + 5;
}
if (this.enemy != true) {
if (((Math.abs(xoffset) <= 2) && (Math.abs(yoffset) <= 2)) && (focusingObj == activeChar)) {
activeMissile._vxx = ((activeChar._x + chars._x) * 2) - _xmouse;
activeMissile._vyy = (((activeChar._y + chars._y) - 90) * 2) - _ymouse;
throwingArrow._rotation = (((-Math.atan2(_xmouse - (activeChar._x + chars._x), _ymouse - ((activeChar._y + chars._y) - 90))) * 180) / Math.PI) + 90;
throwingArrow._x = activeMissile._vxx;
throwingArrow._y = activeMissile._vyy;
linePoint.linePoint._width = Math.sqrt(((activeMissile._vxx - _xmouse) * (activeMissile._vxx - _xmouse)) + ((activeMissile._vyy - _ymouse) * (activeMissile._vyy - _ymouse)));
linePoint._rotation = (((-Math.atan2(_xmouse - (activeChar._x + chars._x), _ymouse - ((activeChar._y + chars._y) - 90))) * 180) / Math.PI) + 90;
linePoint._y = (activeChar._y + chars._y) - 90;
linePoint._x = activeChar._x + chars._x;
bgr.oldX = bgr._x;
bgr.oldY = bgr._y;
bgr2.oldX = bgr2._x;
bgr2.oldY = bgr2._y;
bgr3.oldX = bgr3._x;
bgr3.oldY = bgr3._y;
} else {
linePoint._y = -500;
throwingArrow._y = -500;
}
scrollScreen();
}
if (((((this._x + chars._x) > _xmouse) && (this._xscale > 0)) || (((this._x + chars._x) < _xmouse) && (this._xscale < 0))) && (this.typ == yourCharTyp)) {
this._xscale = -this._xscale;
}
}
function scrollScreen() {
if (pauseOn == true) {
return(undefined);
}
var _local2 = bgr.getBounds(_root);
if (Key.isDown(16)) {
if (chars.observer._x == undefined) {
chars.createEmptyMovieClip("observer", chars.getNextHighestDepth());
chars.observer._x = activeChar._x;
chars.observer._y = activeChar._y;
focusingObj = chars.observer;
}
if ((Key.isDown(37) || (Key.isDown(65))) && (((chars.observer._x + chars._x) - 14) > 100)) {
chars.observer._x = chars.observer._x - 30;
}
if ((Key.isDown(39) || (Key.isDown(68))) && (((chars.observer._x + chars._x) + 14) < (Stage.width - 100))) {
chars.observer._x = chars.observer._x + 30;
}
if ((Key.isDown(38) || (Key.isDown(87))) && (chars.observer._y > -200)) {
chars.observer._y = chars.observer._y - 30;
}
if ((Key.isDown(40) || (Key.isDown(83))) && (chars.observer._y < (Stage.height * 1.4))) {
chars.observer._y = chars.observer._y + 30;
}
} else if (chars.observer._x != undefined) {
removeMovieClip(chars.observer);
focusingObj = activeChar;
}
}
function focus() {
if (pauseOn == true) {
return(undefined);
}
xoff = chars._x;
yoff = chars._y;
if (((bgr._x < -50) || ((focusingObj._x + chars._x) > (Stage.width / 2))) && (((bgr._x + bgr._width) > (Stage.width + 50)) || ((focusingObj._x + chars._x) < (Stage.width / 2)))) {
xoffset = Math.round(((Stage.width / 2) - (focusingObj._x + xoff)) / 5);
} else {
xoffset = 0;
}
if (activeMissile != focusingObj) {
yoffset = Math.round(((Stage.height / 1.3) - (focusingObj._y + yoff)) / 5);
} else {
yoffset = Math.round(((Stage.height / 2) - (focusingObj._y + yoff)) / 5);
}
if (((bgr._x + xoffset) > 0) || (((bgr._x + bgr._width) + xoffset) < Stage.width)) {
xoffset = 0;
}
}
function scrolling() {
focus();
chars._x = chars._x + xoffset;
chars._y = chars._y + yoffset;
bgr._x = bgr._x + xoffset;
bgr._y = bgr._y + yoffset;
bgr2._x = bgr2._x + (xoffset / 3);
bgr2._y = bgr2._y + (yoffset / 3);
topLayer._x = topLayer._x + xoffset;
topLayer._y = topLayer._y + yoffset;
missileLayer._x = missileLayer._x + xoffset;
missileLayer._y = missileLayer._y + yoffset;
}
function releaseMissile() {
if (pauseOn == true) {
return(undefined);
}
if (((chars.observer._x != undefined) || (xoffset != 0)) || (yoffset != 0)) {
return(undefined);
}
if (focusingObj != activeChar) {
xoffset = (yoffset = 0);
bgr._x = bgr.oldX;
bgr._y = bgr.oldY;
bgr2._x = bgr2.oldX;
bgr2._y = bgr2.oldY;
bgr3._x = bgr3.oldX;
bgr3._y = bgr3.oldY;
chars._x = chars.oldX;
chars._y = chars.oldY;
missileLayer._x = missileLayer.oldX;
missileLayer._y = missileLayer.oldY;
var _local3 = activeChar.getBounds(_root);
activeMissile._x = activeChar._x;
activeMissile._y = _local3.yMin - 20;
}
this.playSound("_launch" + yourCharTyp);
activeChar.healthBar.removeMovieClip();
delete activeChar.onEnterFrame;
activeChar.gotoAndStop("standBy");
xoffset = (yoffset = 0);
activeMissile.onEnterFrame = throwBall;
activeMissile.oldX = activeMissile._x + missileLayer._x;
activeMissile.oldY = activeMissile._y + missileLayer._y;
focusingObj = activeMissile;
firstDamaged = undefined;
gameStatus = "throw";
activeMissile.currentStatus = "throw";
activeChar.currentStatus = "standBy";
_k = 0.05;
activeMissile._kk = missileKK;
activeMissile.koef = 1;
activeMissile.ab = 20;
activeMissile.ay = 1.1;
activeMissile._otskokKoef = 0.98;
if (activeMissile.typ != 12) {
activeMissile.rotationSpeed = random(16) - 8;
}
var _local3 = activeChar.getBounds(_root);
activeMissile._x = activeChar._x;
activeMissile._y = (_local3.yMin - missileLayer._y) - 20;
activeMissile._vx = ((activeChar._x + chars._x) - _xmouse) / 2;
activeMissile._vy = (((activeChar._y + chars._y) - 90) - _ymouse) / 2;
if (activeMissile.typ == 12) {
activeMissile.onMouseDown = function () {
this.onEnterFrame = cloudMove;
delete this.onMouseDown;
};
}
removeMovieClip(throwingArrow);
removeMovieClip(linePoint);
delete _root.onMouseUp;
}
function generateLighting(xx, yy) {
lighting.push(topLayer.attachMovie("lighting", "lighting" + lighting.length, topLayer.getNextHighestDepth()));
lighting[lighting.length - 1].onEnterFrame = lightingMove;
lighting[lighting.length - 1]._xAngle = random(314.159265358979) / 100;
lighting[lighting.length - 1]._yAngle = random(314.159265358979) / 100;
lighting[lighting.length - 1]._xSpeed = (random(12) / 100) + 0.02;
lighting[lighting.length - 1]._ySpeed = (random(12) / 100) + 0.02;
lighting[lighting.length - 1]._xRadius = random(150) + 20;
lighting[lighting.length - 1]._yRadius = random(150) + 20;
lighting[lighting.length - 1]._xxSpeed = random(6) - 3;
lighting[lighting.length - 1]._yySpeed = random(6) - 3;
lighting[lighting.length - 1].xx = xx;
lighting[lighting.length - 1].yy = yy;
lighting[lighting.length - 1].lifeCycle = random(130) + 30;
lighting[lighting.length - 1].num = length - 1;
}
function lightingMove() {
if (pauseOn == true) {
return(undefined);
}
if (this.hit != true) {
this._x = this.xx + (Math.sin(this._xAngle) * this._xRadius);
this._y = this.yy + (Math.cos(this._yAngle) * this._yRadius);
this._xAngle = this._xAngle + this._xSpeed;
this._yAngle = this._yAngle + this._ySpeed;
this.xx = this.xx + this._xxSpeed;
this.yy = this.yy + this._yySpeed;
for (i in yourChar) {
if (yourChar[i].hitTest(this._x + chars._x, this._y + chars._y, true)) {
yourChar[i].damage = yourChar[i].damage + (10 + random(6));
yourChar[i].gotoAndStop("hit");
this.hitObj = yourChar[i];
this.hit = true;
this.lifeCycle = 10;
this.playSound("_mLighting" + random(3));
}
}
for (i in enemyChar) {
if (enemyChar[i].hitTest(this._x + chars._x, this._y + chars._y, true)) {
enemyChar[i].damage = enemyChar[i].damage + (10 + random(6));
enemyChar[i].gotoAndStop("hit");
this.hitObj = enemyChar[i];
this.hit = true;
this.lifeCycle = 10;
this.playSound("_mLighting" + random(3));
}
}
} else {
this._x = this.hitObj._x;
this._y = this.hitObj._y - 40;
}
this.lifeCycle--;
if (this.lifeCycle <= 0) {
lighting[this.num] = lighting[lighting.length - 1];
lighting.pop();
if (turnOver() == true) {
timeOut = setTimeout(nextTurn, 3000);
betweenTurns();
}
removeMovieClip(this);
}
}
function winLevel() {
earnedPoints = 0;
for (i in yourChar) {
earnedPoints = earnedPoints + yourChar[i].health;
}
totalPoints = totalPoints + earnedPoints;
score = score + earnedPoints;
level++;
if (level <= 10) {
attachMovie("nextLevel", "nl", _root.getNextHighestDepth());
} else {
attachMovie("winScreen", "ws", _root.getNextHighestDepth());
this.playSound("_mainMusic", 9999);
}
}
function loseLevel() {
delete this.onEnterFrame;
delete activeChar.onEnterFrame;
clearTimeout(timeOut);
clearTimeout(timeOut2);
attachMovie("loseScreen", "ls", _root.getNextHighestDepth());
}
function clearAll() {
delete this.onEnterFrame;
removeMovieClip(chars);
removeMovieClip(missileLayer);
removeMovieClip(topLayer);
bgr._x = (bgr._y = 0);
bgr2._x = (bgr2._y = 0);
fon._x = (fon._y = 0);
}
function turnOver() {
for (i in missile) {
if ((missile[i].onEnterFrame == throwBall) || (missile[i].onEnterFrame == cloudMove)) {
return(false);
}
}
for (i in yourChar) {
if ((yourChar[i].onEnterFrame == throwBall) || (yourChar[i].onEnterFrame == cloudMove)) {
return(false);
}
}
for (i in enemyChar) {
if ((enemyChar[i].onEnterFrame == throwBall) || (enemyChar[i].onEnterFrame == cloudMove)) {
return(false);
}
}
if ((((lighting.length != 0) && (lighting.length != undefined)) || ((flame.length != 0) && (flame.length != undefined))) || ((faer.length != 0) && (faer.length != undefined))) {
return(false);
}
return(true);
}
function earthquake() {
this.bgrX = this.bgrX + xoffset;
this.bgrY = this.bgrY + yoffset;
this.charsX = this.charsX + xoffset;
this.charsY = this.charsY + yoffset;
this.missileLayerX = this.missileLayerX + xoffset;
this.missileLayerY = this.missileLayerY + yoffset;
this.bgr2X = this.bgr2X + (xoffset / 3);
this.bgr2Y = this.bgr2Y + (yoffset / 3);
this.xOffset = random(this.lifeCycle);
this.yOffset = random(this.lifeCycle);
bgr._x = this.bgrX + this.xOffset;
bgr._y = this.bgrY + this.yOffset;
topLayer._x = this.charsX + this.xOffset;
topLayer._y = this.charsY + this.yOffset;
chars._x = this.charsX + this.xOffset;
chars._y = this.charsY + this.yOffset;
missileLayer._x = this.missileLayerX + random(this.lifeCycle);
missileLayer._y = this.missileLayerY + random(this.lifeCycle);
bgr2._x = this.bgr2X + random(this.lifeCycle);
bgr2._y = this.bgr2Y + random(this.lifeCycle);
this.lifeCycle--;
if (this.lifeCycle == -1) {
delete this.onEnterFrame;
}
}
function cloudMove() {
this._vx = this._vx + ((((3 - Math.abs(this._vx)) / 20) * this._vx) / Math.abs(this._vx));
this._x = this._x + this._vx;
if (this.afterShot == undefined) {
this.afterShot = 0;
}
if (this.lifeCycle == undefined) {
this.lifeCycle = 150;
}
this.lifeCycle--;
this.afterShot++;
if (bgr.bgr.hitTest(this._x + chars._x, this._y + chars._y, true)) {
topLayer.attachMovie("smoke", "smoke", topLayer.getNextHighestDepth(), {_x:this._x, _y:this._y});
removeMissile(this);
if (turnOver() == true) {
timeOut = setTimeout(nextTurn, 3000);
betweenTurns();
} else if (firstDamaged != undefined) {
focusingObj = firstDamaged;
}
return(undefined);
}
if (this.lifeCycle <= 0) {
topLayer.attachMovie("smoke", "smoke", topLayer.getNextHighestDepth(), {_x:this._x, _y:this._y});
removeMissile(this);
if (turnOver() == true) {
timeOut = setTimeout(nextTurn, 3000);
betweenTurns();
} else if (firstDamaged != undefined) {
focusingObj = firstDamaged;
}
return(undefined);
}
if (this.afterShot >= 30) {
if (((this._x + chars._x) < 0) || ((this._x + chars._x) > Stage.width)) {
removeMissile(this);
if (turnOver() == true) {
timeOut = setTimeout(nextTurn, 3000);
betweenTurns();
}
return(undefined);
}
if (yourCharTyp == 0) {
targetArray = yourChar;
} else {
targetArray = enemyChar;
}
for (i in targetArray) {
if ((((((targetArray[i]._x + chars._x) > 0) && ((targetArray[i]._x + chars._x) < Stage.width)) && ((targetArray[i]._y + chars._y) > 0)) && ((targetArray[i]._y + chars._y) < (Stage.height + 80))) && (random(2) == 1)) {
this.afterShot = 0;
if (firstDamaged == undefined) {
firstDamaged = targetArray[i];
}
this.gotoAndPlay("explode");
this.lighting._rotation = (((-Math.atan2(targetArray[i]._x - this._x, (targetArray[i]._y - this._y) + 40)) * 180) / Math.PI) - 12;
targetArray[i]._vx = (targetArray[i]._x - this._x) / 20;
targetArray[i]._vy = -7;
targetArray[i].gotoAndStop("hit");
targetArray[i].damage = targetArray[i].damage + (17 + random(16));
ii = random(10) + 3;
iii = 0;
while (iii < ii) {
generateStar(targetArray[i]._x, targetArray[i]._y - 40);
iii++;
}
vPolet(targetArray[i]);
return(undefined);
}
}
}
}
function generateStar(xx, yy) {
lastStar = topLayer.attachMovie("star", "star" + iii, topLayer.getNextHighestDepth(), {_x:xx, _y:yy});
lastStar.onEnterFrame = starMove;
lastStar._vx = random(8) - 4;
lastStar._vy = (-random(8)) - 4;
}
function generateFire(xx, yy) {
flame.push(topLayer.attachMovie("fire", "fire" + (topLayer.getNextHighestDepth() + 1), topLayer.getNextHighestDepth(), {_x:xx, _y:yy}));
flame[flame.length - 1].onEnterFrame = burning;
flame[flame.length - 1].typ = 222;
flame[flame.length - 1].num = flame.length - 1;
flame[flame.length - 1].lifeCycle = random(35) + 10;
flame[flame.length - 1]._xscale = (flame[flame.length - 1]._yscale = random(50) + 75);
flame[flame.length - 1].playSound("_mBlood");
}
function burning() {
this._xscale = (this._yscale = this._yscale * 0.98);
for (i in enemyChar) {
if (enemyChar[i].hitTest(this)) {
enemyChar[i].damage = enemyChar[i].damage + 1;
if ((enemyChar[i].currentStatus == "standBy") || (enemyChar[i].currentStatus == "throw")) {
enemyChar[i].gotoAndStop("hit");
}
}
}
for (i in yourChar) {
if (yourChar[i].hitTest(this)) {
yourChar[i].damage = yourChar[i].damage + 1;
if ((yourChar[i].currentStatus == "standBy") || (yourChar[i].currentStatus == "throw")) {
yourChar[i].gotoAndStop("hit");
}
}
}
this.lifeCycle--;
if (this.lifeCycle <= 0) {
flame[this.num] = flame[flame.length - 1];
flame[this.num].num = this.num;
flame.pop();
if (turnOver() == true) {
timeOut = setTimeout(nextTurn, 3000);
betweenTurns();
}
removeMovieClip(this);
}
}
function starMove() {
this._x = this._x + this._vx;
this._y = this._y + this._vy;
this._vy = this._vy + 1;
}
function vPolet(target) {
target.onEnterFrame = throwBall;
if (target.fromShrine != true) {
target.currentStatus = "throw";
} else {
target.currentStatus = "standBy";
}
target.oldX = target._x;
target.oldY = target._y;
if (target.typ == 11) {
target._otskokKoef = 1;
} else {
target._otskokKoef = 0.98;
}
target.ab = 20;
}
function standBy() {
if (bgr.bgr.hitTest(this._x + chars._x, (this._y + 4) + chars._y, true) == false) {
this._y = this._y + this._vy;
this._vy = this._vy + ay;
} else {
delete this.onEnterFrame;
}
}
function betweenTurns() {
for (i in yourChar) {
yourChar[i].currentStatus = "standBy";
yourChar[i].healthBar.removeMovieClip();
if (yourChar[i].damage != 0) {
if (yourChar[i].damage >= yourChar[i].health) {
focusingObj = yourChar[i];
} else if ((focusingObj.weapon == true) || (focusingObj._x == undefined)) {
focusingObj = yourChar[i];
}
d = topLayer.attachMovie("damageAmount", "damageAmount" + yourChar[i]._name, topLayer.getNextHighestDepth(), {_x:yourChar[i]._x, _y:yourChar[i]._y - 100});
d.damageAmount.damageAmount.text = -yourChar[i].damage;
yourChar[i].health = yourChar[i].health - yourChar[i].damage;
yourChar[i].damage = 0;
if (yourChar[i].health <= 0) {
yourChar[i].gotoAndStop("death");
yourChar[i] = yourChar[yourChar.length - 1];
yourChar[i].num = i;
yourChar.pop();
}
}
}
for (i in enemyChar) {
enemyChar[i].currentStatus = "standBy";
enemyChar[i].healthBar.removeMovieClip();
if (enemyChar[i].damage != 0) {
if (enemyChar[i].damage >= enemyChar[i].health) {
focusingObj = enemyChar[i];
} else if ((focusingObj.weapon == true) || (focusingObj._x == undefined)) {
focusingObj = enemyChar[i];
}
d = topLayer.attachMovie("damageAmount", "damageAmount" + enemyChar[i]._name, topLayer.getNextHighestDepth(), {_x:enemyChar[i]._x, _y:enemyChar[i]._y - 100});
d.damageAmount.damageAmount.text = -enemyChar[i].damage;
enemyChar[i].health = enemyChar[i].health - enemyChar[i].damage;
enemyChar[i].damage = 0;
if (enemyChar[i].health <= 0) {
enemyChar[i].gotoAndStop("death");
enemyChar[i] = enemyChar[enemyChar.length - 1];
enemyChar[i].num = i;
enemyChar.pop();
}
}
}
if (activeChar.typ == 0) {
i = 1;
} else {
i = 0;
}
ii = random(100);
if (ii < shrines[i][0]) {
ii = 0 + (10 * i);
} else if (ii < shrines[i][1]) {
ii = 1 + (10 * i);
} else if (ii < shrines[i][2]) {
ii = 2 + (10 * i);
} else if (ii < shrines[i][3]) {
ii = 3 + (10 * i);
}
bgr["shrine" + i].gotoAndPlay("act");
generateMissile(bgr["shrine" + i]._x, ii);
missile[missile.length - 1]._y = missile[missile.length - 1]._y - 100;
missile[missile.length - 1]._vy = -40;
missile[missile.length - 1]._vx = (((bgr._width / 2) - 100) * Math.log(_dampX)) / (Math.pow(_dampX, 70) - 1);
if (i == 0) {
missile[missile.length - 1]._vx = random(missile[missile.length - 1]._vx - 5) + 5;
} else {
missile[missile.length - 1]._vx = (-random(missile[missile.length - 1]._vx - 5)) - 5;
}
missile[missile.length - 1].fromShrine = true;
vPolet(missile[missile.length - 1]);
if (focusingObj._parent._name != "chars") {
timeOut = setTimeout(focusOnMissile, 700);
}
}
function focusOnMissile() {
focusingObj = missile[missile.length - 1];
}
function nextTurn() {
firstDamaged = undefined;
if (yourTurn == true) {
if (yourActive < (yourChar.length - 1)) {
yourActive++;
} else {
yourActive = 0;
}
yourTurn = false;
if (enemyActive > (enemyChar.length - 1)) {
enemyActive = 0;
}
activeChar = enemyChar[enemyActive];
focusingObj = activeChar;
getNearestMissile();
activeChar.onEnterFrame = enemyMove;
activeChar.currentStatus = "move";
activeChar.gotoAndStop("move");
activeChar.noWay = 0;
activeChar.oldX = undefined;
} else {
if (enemyActive < (enemyChar.length - 1)) {
enemyActive++;
} else {
enemyActive = 0;
}
yourTurn = true;
if (yourActive > (yourChar.length - 1)) {
yourActive = 0;
}
activeChar = yourChar[yourActive];
focusingObj = activeChar;
direct = undefined;
activeChar.onEnterFrame = charMove;
if (yourChar[0].health > 0) {
saveGame();
}
if (_root["tip" + lang][yourCharTyp][currentTip] != undefined) {
showMsg(_root["tip" + lang][yourCharTyp][currentTip]);
currentTip++;
} else if (random(4) == 1) {
showMsg(_root["phrase" + lang][yourCharTyp][random(_root["phrase" + lang][yourCharTyp].length)]);
}
if (cloudMiss == true) {
cloudMiss = false;
showMsg("Don't forget to CLICK agter you launch the cloud before it hits the ground!");
}
}
jumpSpeed = 0;
charSpeed = 0;
firstDamaged = undefined;
if (yourChar.length == 0) {
loseLevel();
} else if (enemyChar.length == 0) {
winLevel();
}
}
function generateMissile(xx, typ) {
missile.push(missileLayer.attachMovie("missile" + typ, (("missile" + (missile.length - 1)) + "-") + getTimer(), missileLayer.getNextHighestDepth(), {_x:xx, _y:0}));
while (bgr.bgr.hitTest(missile[missile.length - 1]._x + missileLayer._x, missile[missile.length - 1]._y + missileLayer._y, true) == false) {
missile[missile.length - 1]._y = missile[missile.length - 1]._y + 3;
}
missile[missile.length - 1].onEnterFrame = standBy;
missile[missile.length - 1].typ = typ;
missile[missile.length - 1].koef = 1;
missile[missile.length - 1].damageKoef = 1.8;
missile[missile.length - 1].num = missile.length - 1;
if (((typ != 12) && (typ != 2)) && (typ != 1)) {
missile[missile.length - 1]._rotation = random(360) - 180;
}
missile[missile.length - 1].weapon = true;
if ((typ == 0) || (typ == 13)) {
missile[missile.length - 1].glow.gotoAndPlay(random(90));
}
}
function generateChar(xx, typ) {
if (typ == yourCharTyp) {
yourChar.push(chars.attachMovie("char" + typ, ((("char" + yourChar.length) - 1) + "-") + getTimer(), chars.getNextHighestDepth(), {_x:xx, _y:0}));
lastChar = yourChar[yourChar.length - 1];
lastChar.num = yourChar.length - 1;
} else {
enemyChar.push(chars.attachMovie("char" + typ, "char" + getTimer(), chars.getNextHighestDepth(), {_x:xx, _y:0}));
lastChar = enemyChar[enemyChar.length - 1];
lastChar.num = enemyChar.length - 1;
}
while (bgr.bgr.hitTest(lastChar._x + chars._x, (lastChar._y + chars._y) + 3, true) == false) {
lastChar._y = lastChar._y + 3;
}
lastChar.typ = typ;
if (typ == 0) {
lastChar._xscale = -lastChar._xscale;
}
lastChar.health = 100;
lastChar.damage = 0;
lastChar.currentStatus = "standBy";
lastChar.damageKoef = 0.6;
lastChar.koef = 1;
lastChar._kk = charKK;
lastChar.onRollOver = showHealth;
lastChar.onPress = hideHealth;
lastChar.onRollOut = hideHealth;
}
function showHealth() {
if (this.health <= 0) {
return(undefined);
}
this.healthBar = topLayer.attachMovie("healthBar", ("healthBar" + this.num) + this._x, topLayer.getNextHighestDepth(), {_x:this._x, _y:this._y - 105});
if (this.health > 0) {
this.healthBar.gotoAndStop(this.health);
} else {
this.healthBar.gotoAndStop(1);
}
this.healthBar.parentObj = this;
this.healthBar.onEnterFrame = function () {
this._x = this.parentObj._x;
this._y = this.parentObj._y - 105;
};
}
function hideHealth() {
this.healthBar.removeMovieClip();
}
function showMsg(msg) {
if (topLayer.messageBox._x != undefined) {
topLayer.messageBox.removeMovieClip();
}
topLayer.attachMovie("messageBox", "messageBox", topLayer.getNextHighestDepth, {_x:activeChar._x, _y:activeChar._y - 90});
topLayer.messageBox.messageBox.msg = msg;
topLayer.messageBox.onEnterFrame = msgMove;
}
function msgMove() {
this._x = this._x + ((activeChar._x - this._x) / 5);
this._y = this._y + (((activeChar._y - 90) - this._y) / 5);
this._rotation = -(activeChar._x - this._x);
}
function saveGame() {
so.data.vars = new Object();
activeCharNum = activeChar.num;
for (i in this) {
so.data.vars[i] = this[i];
}
so.data.yourChar = new Array();
so.data.enemyChar = new Array();
for (i in enemyChar) {
so.data.enemyChar[i] = new Object();
for (j in enemyChar[i]) {
so.data.enemyChar[i][j] = enemyChar[i][j];
}
so.data.enemyChar[i].xx = enemyChar[i]._x;
so.data.enemyChar[i].yy = enemyChar[i]._y;
so.data.enemyChar[i].nam = enemyChar[i]._name;
}
for (i in yourChar) {
so.data.yourChar[i] = new Object();
for (j in yourChar[i]) {
so.data.yourChar[i][j] = yourChar[i][j];
}
so.data.yourChar[i].xx = yourChar[i]._x;
so.data.yourChar[i].yy = yourChar[i]._y;
so.data.yourChar[i].nam = yourChar[i]._name;
}
so.data.missile = new Array();
for (i in missile) {
so.data.missile[i] = new Object();
for (j in missile[i]) {
so.data.missile[i][j] = missile[i][j];
}
so.data.missile[i].xx = missile[i]._x;
so.data.missile[i].yy = missile[i]._y;
so.data.missile[i].nam = missile[i]._name;
}
}
function mainMove() {
t = Math.round((getTimer() - t0) / 1000);
scrolling();
if (random(Math.round(400 / charsAmount[level])) == 1) {
i = random(yourChar.length);
if ((yourChar[i] != activeChar) && (yourChar[i].char._currentframe == 1)) {
yourChar[i].gotoAndStop("action");
}
}
if (random(Math.round(400 / charsAmount[level])) == 1) {
i = random(enemyChar.length);
if ((enemyChar[i] != activeChar) && (enemyChar[i].char._currentframe == 1)) {
enemyChar[i].gotoAndStop("action");
}
}
if (Key.isDown(32)) {
for (i in yourChar) {
trace((((yourChar[i].onEnterFrame + " ") + yourChar[i].health) + " ") + yourChar[i]._x);
}
for (i in enemyChar) {
trace((((enemyChar[i].onEnterFrame + " ") + enemyChar[i].health) + " ") + enemyChar[i]._x);
}
for (i in missile) {
trace((missile[i].onEnterFrame + " ") + missile[i]._y);
}
trace(((flame.length + " ") + lighting.length) + " ");
trace("------");
}
}
stop();
this.playSound();
if (yourCharTyp == 1) {
enemyCharTyp = 0;
} else {
enemyCharTyp = 1;
}
MovieClip.prototype.enemyMove = function () {
if (pauseOn == true) {
return(undefined);
}
if ((nearest == undefined) && (this.test != true)) {
t0 = t0 - (t * 1000);
showMsg("Cannot reach any weapon. =( Skipping...");
bgrSound.stop();
return(undefined);
}
if (this.hitTest(nearest) == false) {
if (nearest._x < this._x) {
if (charSpeed > (-maxCharSpeed)) {
charSpeed = charSpeed - speedPrirost;
}
if (this.direct != "left") {
if ((this._xscale < 0) && (Math.abs(this._x - nearest._x) > 10)) {
this._xscale = -this._xscale;
}
this.direct = "left";
if ((this.test != true) && (Math.abs(this._x - nearest._x) > 10)) {
this.gotoAndStop("move");
}
}
} else {
if (charSpeed < maxCharSpeed) {
charSpeed = charSpeed + speedPrirost;
}
if (this.direct != "right") {
if ((this._xscale > 0) && (Math.abs(this._x - nearest._x) > 10)) {
this._xscale = -this._xscale;
}
this.direct = "right";
if ((this.test != true) && (Math.abs(this._x - nearest._x) > 10)) {
this.gotoAndStop("move");
}
}
}
} else {
if (this.test == true) {
testIterations = 2000;
return(undefined);
}
if (bgr.bgr.hitTest(this._x + chars._x, (this._y + chars._y) + 4, true)) {
if (random(4) == 1) {
_root.voiceSound.stop();
_root.voiceSound.attachSound("__laugh" + you[activeChar].typ);
_root.voiceSound.start();
} else {
enemyTaunt = random(enemyTauntsAmount);
if (enemyTaunt != enemyTauntOld) {
_root.voiceSound.stop();
_root.voiceSound.attachSound((("__taunt" + enemyChars) + "-") + enemyTaunt);
_root.voiceSound.start();
enemyTauntOld = enemyTaunt;
}
}
xoffset = (yoffset = 0);
activeMissile = nearest;
activeMissile.i = 0;
var _local3 = new Array();
for (i in yourChar) {
position = 0;
for (ii in yourChar) {
if (Math.abs(yourChar[i]._x - activeChar._x) > Math.abs(yourChar[ii]._x - activeChar._x)) {
position++;
}
}
if (yourChar[i] != undefined) {
_local3[position] = yourChar[i];
}
}
target = undefined;
i = 0;
while (i < _local3.length) {
testIterations = Math.round(Math.abs(_local3[i]._x - activeChar._x) / 20);
stepX = (_local3[i]._x - activeChar._x) / testIterations;
stepY = (_local3[i]._y - activeChar._y) / testIterations;
ii = 0;
while (ii < testIterations) {
if (bgr.bgr.hitTest((activeChar._x + (stepX * ii)) + chars._x, (activeChar._y + (stepY * ii)) + chars._y, true)) {
ii = testIterations;
}
if ((ii == (testIterations - 1)) && (activeMissile.typ != 3)) {
trace("Pryamotok!");
target = _local3[i];
i = _local3.length;
}
ii++;
}
i++;
}
if (target == undefined) {
if (activeMissile.typ != 3) {
target = _local3[0];
} else if (_local3.length > 1) {
target = _local3[_local3.length - 2];
} else {
target = _local3[_local3.length - 1];
}
activeMissile._vy = (-random(65)) - 30;
if (bgr.bgr.hitTest((this._x + chars._x) - ((300 * this._xscale) / Math.abs(this._xscale)), (this._y - 300) + chars._y, true) && (activeMissile._vy > -65)) {
activeMissile._vy = activeMissile._vy + 35;
}
} else if (((activeMissile.typ == 11) || (activeMissile.typ == 2)) || (activeMissile.typ == 3)) {
activeMissile._vy = ((-random(35)) - 15) + ((target._y - this._y) / 15);
} else {
activeMissile._vy = ((-random(5)) - 2) + ((target._y - this._y) / 15);
}
if (activeMissile.typ == 12) {
activeMissile._vy = ((-random(45)) - 10) + ((target._y - this._y) / 15);
}
activeMissile.onEnterFrame = missileRotate;
timeOut = setTimeout(enemyThrow, 1300);
this.gotoAndStop("throw");
if ((target._x > this._x) && (this._xscale > 0)) {
this._xscale = -this._xscale;
} else if ((target._x < this._x) && (this._xscale < 0)) {
this._xscale = -this._xscale;
}
this.onEnterFrame = missileRotateChar;
return(undefined);
}
}
if ((bgr.bgr.hitTest((this._x + ((50 * charSpeed) / Math.abs(charSpeed))) + chars._x, (this._y - 50) + chars._y, true) || (bgr.bgr.hitTest((this._x + charSpeed) + chars._x, (this._y + 20) + chars._y, true) == false)) && (bgr.bgr.hitTest(this._x + chars._x, (this._y + 3) + chars._y, true))) {
jumpSpeed = -15;
this._y = this._y - 4;
this.currentStatus = "jump";
if (this.test != true) {
this.gotoAndStop("jump");
this.playSound("_jump");
}
}
if ((noWay >= 6) && (bgr.bgr.hitTest(this._x + chars._x, (this._y + 4) + chars._y, true))) {
this.gotoAndStop("standBy");
if (this._x == this.oldX) {
if (this.test != true) {
showMsg("I can't jump over this!! =(");
timeOut = setTimeout(nextTurn, 3000);
}
delete this.onEnterFrame;
testIterations = 1900;
return(undefined);
}
jumpSpeed = -15;
this.oldX = this._x;
this._y = this._y - 4;
this.currentStatus = "jump";
noWay = 0;
if (this.test != true) {
this.gotoAndStop("jump");
this.playSound("_jump");
}
}
if (bgr.bgr.hitTest(this._x + chars._x, (this._y + chars._y) + 2, true) == false) {
if (bgr.bgr.hitTest(this._x + chars._x, (this._y + chars._y) - 80, true)) {
jumpSpeed = 2;
this._y = this._y + 2;
}
this._y = this._y + jumpSpeed;
} else {
if (jumpSpeed > 0) {
jumpSpeed = 0;
}
while (bgr.bgr.hitTest(this._x + chars._x, this._y + chars._y, true)) {
this._y--;
}
if ((this.currentStatus == "jump") && (jumpSpeed >= 0)) {
this.gotoAndStop("standBy");
this.playSound((("_step" + this.typ) + "-") + random(4));
this.currentStatus = "standBy";
if (charSpeed != 0) {
this.gotoAndStop("move");
this.currentStatus = "move";
}
}
}
if (jumpSpeed < 20) {
jumpSpeed = jumpSpeed + ay;
}
this.nextPoint = new Object();
this.nextPoint.x = undefined;
this.nextPoint.y = undefined;
counter = 0;
if (charSpeed < 0) {
i = 1;
} else {
i = -1;
}
if ((charSpeed != 0) && (bgr.bgr.hitTest(this._x + chars._x, (this._y + chars._y) + 4, true))) {
this.pos = (Math.PI/2);
while (counter < 50) {
this.nextPoint.x = (Math.cos(this.pos) * maxCharSpeed) + this._x;
this.nextPoint.y = (Math.sin(this.pos) * maxCharSpeed) + this._y;
counter++;
if (bgr.bgr.hitTest(this.nextPoint.x + chars._x, this.nextPoint.y + chars._y, true) == false) {
counter = 100;
}
this.pos = this.pos + (0.0628318530717959 * i);
}
} else {
this.nextPoint.x = this._x + charSpeed;
this.nextPoint.y = this._y;
}
if ((((((bgr.bgr.hitTest(this.nextPoint.x + chars._x, this.nextPoint.y + chars._y, true) == false) && ((this._y - this.nextPoint.y) < (maxCharSpeed * 0.98))) && (bgr.bgr.hitTest((this._x + missileLayer._x) + ((maxCharSpeed * charSpeed) / Math.abs(charSpeed)), (this._y + missileLayer._y) - 80, true) == false)) && (bgr.bgr.hitTest((this._x + missileLayer._x) + ((maxCharSpeed * charSpeed) / Math.abs(charSpeed)), (this._y + missileLayer._y) - 40, true) == false)) && ((((this._x + chars._x) > 20) || (this._xscale < 0)) || (this.test == true))) && ((((this._x + chars._x) < (Stage.width - 20)) || (this._xscale > 0)) || (this.test == true))) {
this._x = this.nextPoint.x;
this._y = this.nextPoint.y;
} else {
charSpeed = 0;
noWay++;
}
if ((Math.abs(charSpeed) < 1) && (charSpeed != 0)) {
charSpeed = 0;
}
if (charSpeed > 0) {
charSpeed = charSpeed - 1;
} else if (charSpeed < 0) {
charSpeed = charSpeed + 1;
}
scrollScreen();
};
var myListener = new Object();
myListener.onKeyDown = function () {
if (Key.getCode() == 83) {
}
};
Key.addListener(myListener);
MovieClip.prototype.throwBall = function () {
if (pauseOn == true) {
return(undefined);
}
if (((this._x < 30) || (this._x > (bgr._width - 30))) && (this.fromShrine != true)) {
if (this._parent._name != "chars") {
removeMissile(this);
if (turnOver() == true) {
timeOut = setTimeout(nextTurn, 3000);
betweenTurns();
}
} else {
this._vx = -this._vx;
this._x = this._x + this._vx;
while (this._x <= 50) {
this._x++;
}
while (this._x >= (bgr._width - 50)) {
this._x--;
}
}
}
if ((this.typ == 10) || (this.typ == 13)) {
this._rotation = (-((Math.atan2(this._x - this.oldX, this._y - this.oldY) * 180) / Math.PI)) - 80;
} else if (this.rotationSpeed != undefined) {
this._rotation = this._rotation + this.rotationSpeed;
}
this.oldX = this._x;
this.oldY = this._y;
this.oldXactual = this._x;
this.oldYactual = this._y;
bgrXold = bgr._x;
bgrYold = bgr._y;
if ((isNaN(this._vx) == true) || (isNaN(this._vy) == true)) {
this._vx = (this._vy = 0);
}
this._x = this._x + this._vx;
this._y = this._y + this._vy;
if (((((this.typ == 12) && (bgr.bgr.hitTest(this._x + chars._x, (this._y + chars._y) + 200, true))) && (this.fromShrine != true)) && (yourTurn == false)) && (this._vy > 0)) {
this.onEnterFrame = cloudMove;
}
if (((this.typ == 2) && (this._vy > 0)) && (this.fromShrine != true)) {
if (this.betweenShots == undefined) {
this.betweenShots = 0;
}
if (this.betweenShots >= 5) {
this.betweenShots = 0;
missile.push(topLayer.attachMovie("faerok", "faerok" + getTimer(), topLayer.getNextHighestDepth(), {_x:this._x, _y:this._y}));
missile[missile.length - 1]._vx = this._vx * 0.5;
missile[missile.length - 1]._vy = this._vy + 2;
missile[missile.length - 1].typ = 22;
missile[missile.length - 1].num = missile.length - 1;
vPolet(missile[missile.length - 1]);
}
this.betweenShots++;
}
this.xxo = (this._x - this.oldXactual) / 6;
this.yyo = (this._y - this.oldYactual) / 6;
this.hit = false;
i = 0;
while (i < 6) {
if (((((((chars.hitTest((this._x + missileLayer._x) - (this.xxo * i), (this._y + missileLayer._y) - (this.yyo * i), true) && (this._parent._name != "chars")) && (this.typ != 1)) && (this.typ != 11)) && (this.typ != 12)) && (this.typ != 22)) && (this.typ != 3)) && (this.fromShrine != true)) {
this._x = this._x - (this.xxo * i);
this._y = this._y - (this.yyo * i);
for (i in yourChar) {
if (yourChar[i].hitTest(this._x + missileLayer._x, this._y + missileLayer._y, true) && (this.hit != true)) {
this.hit = true;
this.changeDir(yourChar[i]);
}
}
for (i in enemyChar) {
if (enemyChar[i].hitTest(this._x + missileLayer._x, this._y + missileLayer._y, true) && (this.hit != true)) {
this.hit = true;
this.changeDir(enemyChar[i]);
}
}
i = 20;
} else if (bgr.bgr.hitTest((this._x + missileLayer._x) - (this.xxo * i), (this._y + missileLayer._y) - (this.yyo * i), true)) {
if (this.fromShrine == true) {
this.fromShrine = false;
topLayer.attachMovie("pyl", "pyl", topLayer.getNextHighestDepth(), {_x:this._x, _y:this._y});
this.currentStatus = "standBy";
this.playSound("_fromShrine");
delete this.onEnterFrame;
return(undefined);
}
if (this.typ != 12) {
this._x = this._x - (Math.round(this.xxo) * i);
this._y = this._y - (Math.round(this.yyo) * i);
this.changeDir(bgr.bgr);
this.hit = true;
i = 20;
} else {
topLayer.attachMovie("smoke", "smoke", topLayer.getNextHighestDepth(), {_x:this._x, _y:this._y});
removeMissile(this);
cloudMiss = true;
if (turnOver() == true) {
timeOut = setTimeout(nextTurn, 3000);
betweenTurns();
}
}
if (this.typ == 22) {
generateFire(this._x, this._y);
if (focusingObj.typ == undefined) {
focusingObj = flame[0];
}
removeMissile(this);
}
}
i++;
}
this.oldVx = this._vx;
this.oldVy = this._vy;
this._vy = this._vy + ay;
this._vx = this._vx * _dampX;
this._vy = this._vy * _damp;
};
MovieClip.prototype.explodeMissile = function () {
this.currentStatus = "explode";
this.gotoAndPlay("explode");
timeOut2 = setTimeout(removeMissile, 900, this);
for (i in yourChar) {
if (this.radius.hitTest(yourChar[i]._x + chars._x, (yourChar[i]._y - 40) + chars._y, true)) {
this.ab = Math.sqrt(((yourChar[i]._x - this._x) * (yourChar[i]._x - this._x)) + (((yourChar[i]._y - 40) - this._y) * ((yourChar[i]._y - 40) - this._y)));
this.ugol = Math.acos((yourChar[i]._x - this._x) / this.ab);
yourChar[i]._vx = (Math.cos(this.ugol) * 1000) / this.ab;
yourChar[i]._vy = (Math.sin(this.ugol) * 1000) / this.ab;
yourChar[i].exploDamage = Math.round(1900 / this.ab);
if ((focusingObj.exploDamage < yourChar[i].exploDamage) || (focusingObj.damage == undefined)) {
focusingObj = yourChar[i];
}
vPolet(yourChar[i]);
if (this.typ == 3) {
yourChar[i]._vx = yourChar[i]._vx * 3;
yourChar[i]._vy = yourChar[i]._vy * 3;
yourChar[i].exploDamage = yourChar[i].exploDamage * 10;
}
yourChar[i].damage = yourChar[i].damage + yourChar[i].exploDamage;
yourChar[i].gotoAndStop("hit");
}
}
for (i in enemyChar) {
if (this.radius.hitTest(enemyChar[i]._x + chars._x, (enemyChar[i]._y - 40) + chars._y, true)) {
this.ab = Math.sqrt(((enemyChar[i]._x - this._x) * (enemyChar[i]._x - this._x)) + (((enemyChar[i]._y - 40) - this._y) * ((enemyChar[i]._y - 40) - this._y)));
this.ugol = Math.acos((enemyChar[i]._x - this._x) / this.ab);
enemyChar[i]._vx = (Math.cos(this.ugol) * 1000) / this.ab;
enemyChar[i]._vy = (Math.sin(this.ugol) * 1000) / this.ab;
vPolet(enemyChar[i]);
enemyChar[i].gotoAndStop("hit");
enemyChar[i].exploDamage = Math.round(1900 / this.ab);
if ((focusingObj.exploDamage < enemyChar[i].exploDamage) || (focusingObj.damage == undefined)) {
focusingObj = enemyChar[i];
}
if (this.typ == 3) {
enemyChar[i]._vx = enemyChar[i]._vx * 3;
enemyChar[i]._vy = enemyChar[i]._vy * 3;
enemyChar[i].exploDamage = enemyChar[i].exploDamage * 10;
}
enemyChar[i].damage = enemyChar[i].damage + enemyChar[i].exploDamage;
enemyChar[i].gotoAndStop("hit");
}
}
if (this.typ == 3) {
this.bgrX = bgr._x;
this.bgrY = bgr._y;
this.charsX = chars._x;
this.charsY = chars._y;
this.missileLayerX = missileLayer._x;
this.missileLayerY = missileLayer._y;
this.bgr2X = bgr2._x;
this.bgr2Y = bgr2._y;
this.lifeCycle = 30;
this.onEnterFrame = earthquake;
} else {
delete this.onEnterFrame;
}
if (turnOver() == true) {
timeOut = setTimeout(nextTurn, 3000);
betweenTurns();
}
};
MovieClip.prototype.changeDir = function (target) {
if (pauseOn == true) {
return(undefined);
}
if (this.ab <= 5) {
this._vx = (this._vy = 0);
this.currentStatus = "standBy";
if (this.typ == 3) {
this.explodeMissile();
} else {
delete this.onEnterFrame;
}
if (turnOver() == true) {
timeOut = setTimeout(nextTurn, 3000);
betweenTurns();
}
if (bgr.bgr.hitTest(this._x + chars._x, (this._y + 4) + chars._y, true) == false) {
this.onEnterFrame = standBy;
}
return(undefined);
}
this._x = this._x + chars._x;
this._y = this._y + chars._y;
this.oldX = this.oldX + chars._x;
this.oldY = this.oldY + chars._y;
this.lastY = this._y;
this.lastX = this._x;
i = 0;
while (target.hitTest(this.oldX, this.oldY, true)) {
this.oldY--;
}
while (((Math.abs(this.lastX - this.oldX) > 5) || (Math.abs(this.lastY - this.oldY) > 5)) || (target.hitTest(this._x, this._y, true))) {
if (target.hitTest(this._x, this._y, true)) {
this.lastY = this._y;
this.lastX = this._x;
} else {
this.oldX = this._x;
this.oldY = this._y;
}
this._y = (this.lastY + this.oldY) / 2;
this._x = (this.lastX + this.oldX) / 2;
i++;
if (i >= 10) {
this._x = this.oldX;
this._y = this.oldY;
this.lastX = this.oldX;
this.lastY = this.oldY;
}
}
this.testPoint = new Object();
if (target.hitTest(10 + this._x, 0 + this._y, true)) {
this.naezd = true;
} else {
this.naezd = false;
}
if (target._name == "bgr") {
this.pos = 0;
while (this.pos < 6.78318530717959) {
this.testPoint.x = (Math.cos(this.pos) * 10) + this._x;
this.testPoint.y = (Math.sin(this.pos) * 10) + this._y;
if (target.hitTest(this.testPoint.x, this.testPoint.y, true) && (this.naezd == false)) {
this.testPoint.x1 = this.testPoint.x;
this.testPoint.y1 = this.testPoint.y;
this.naezd = true;
} else if ((target.hitTest(this.testPoint.x, this.testPoint.y, true) == false) && (this.naezd == true)) {
this.testPoint.x2 = this.testPoint.x;
this.testPoint.y2 = this.testPoint.y;
this.naezd = false;
}
this.pos = this.pos + 0.0628318530717959;
}
} else {
this.ab = Math.sqrt((((target._y + chars._y) - this._y) * ((target._y + chars._y) - this._y)) + (((target._x + chars._x) - this._x) * ((target._x + chars._x) - this._x)));
ugol = Math.asin(((target._y + chars._y) - this._y) / this.ab);
if (this._x < (target._x + chars._x)) {
ugol = ugol + Math.PI;
}
if ((this._y > (target._y + chars._y)) && (this._x < (target._x + chars._x))) {
ugol = ugol + (Math.PI/2);
}
if ((this._y > (target._y + chars._y)) && (this._x > (target._x + chars._x))) {
ugol = ugol - 4.71238898038469;
}
this.testPoint.x1 = ((Math.cos(ugol + 0.314159265358979) * 100) + this._x) - topLayer._x;
this.testPoint.y1 = ((Math.sin(ugol + 0.314159265358979) * 100) + this._y) - topLayer._y;
this.testPoint.x2 = ((Math.cos(ugol - 0.314159265358979) * 100) + this._x) - topLayer._x;
this.testPoint.y2 = ((Math.sin(ugol - 0.314159265358979) * 100) + this._y) - topLayer._y;
if (this.typ != 0) {
target.damage = target.damage + (10 + random(11));
}
target.gotoAndStop("hit");
if (firstDamaged == undefined) {
firstDamaged = target;
}
}
this.ab = Math.sqrt((Math.abs((this.testPoint.y2 * 10) - (this.testPoint.y1 * 10)) * Math.abs((this.testPoint.y2 * 10) - (this.testPoint.y1 * 10))) + (Math.abs((this.testPoint.x2 * 10) - (this.testPoint.x1 * 10)) * Math.abs((this.testPoint.x2 * 10) - (this.testPoint.x1 * 10))));
this.angleRadians = Math.asin(Math.abs((this.testPoint.y2 * 10) - (this.testPoint.y1 * 10)) / this.ab);
if (this.testPoint.y2 > this.testPoint.y1) {
this.angleRadians = -this.angleRadians;
}
if (target.hitTest(6.12303176911189E-16 + this._x, 10 + this._y, true) == false) {
this.angleRadians = Math.PI - this.angleRadians;
}
this.ab = Math.sqrt((this._vx * this._vx) + (this._vy * this._vy));
if ((this._vx != 0) || (this._vy != 0)) {
this.ugolPadeniya = Math.acos(this._vx / this.ab);
}
if (this._vy < 0) {
this.ugolPadeniya = -this.ugolPadeniya;
}
this.ugolOtskoka = -((Math.PI/2) - (this.angleRadians * 2));
this.ugolOtskoka = this.ugolOtskoka - (this.ugolPadeniya - (Math.PI/2));
this._vx = (Math.cos(this.ugolOtskoka) * this.ab) * this._otskokKoef;
this._vy = (Math.sin(this.ugolOtskoka) * this.ab) * this._otskokKoef;
if (((Math.abs(this._vy) < 12) && (Math.abs(this._vy) > 1)) && (gameStatus == "throw")) {
this._otskokKoef = this._otskokKoef * 0.8;
}
if (Math.abs(this._vx) < 1) {
this._vx = this._vx * this.koef;
}
if ((target._name != "bgr") && (this.typ != 13)) {
this._vx = this._vx / 2;
this._vy = this._vy / 2;
target._vx = ((Math.cos(((this.ugolOtskoka + this.ugolPadeniya) / 2) + (Math.PI/2)) * this.ab) * this._otskokKoef) / 3;
target._vy = ((Math.sin(((this.ugolOtskoka + this.ugolPadeniya) / 2) + (Math.PI/2)) * this.ab) * this._otskokKoef) / 3;
vPolet(target);
}
this._x = this._x - chars._x;
this._y = this._y - chars._y;
this.oldX = this.oldX - chars._x;
this.oldY = this.oldY - chars._y;
if (this.typ == 3) {
generateFire(this._x, this._y);
this.playSound("_mHeart");
}
if (((this.typ == 0) || (this.typ == 2)) && (this.weapon == true)) {
this.explodeMissile();
return(undefined);
}
if (this.typ == 13) {
i = 0;
while (i < 3) {
generateStar(this._x, this._y);
i++;
}
i = 0;
while (i < 3) {
generateStar(this._x + 70, this._y);
i++;
}
i = 0;
while (i < 3) {
generateStar(this._x - 70, this._y);
i++;
}
i = 0;
while (i < 3) {
generateStar(this._x, this._y - 70);
i++;
}
i = 0;
while (i < 3) {
generateStar(this._x, this._y + 100);
i++;
}
this.gotoAndPlay("explode");
this.currentStatus = "explode";
timeOut2 = setTimeout(removeMissile, 900, this);
if (yourCharTyp == 0) {
targetArray = yourChar;
targetArray2 = enemyChar;
} else {
targetArray = enemyChar;
targetArray2 = yourChar;
}
for (i in targetArray) {
if (this.hitTest(targetArray[i]) && (iii != false)) {
generateChar(targetArray[i]._x, 1);
targetArray[i].healthBar.removeMovieClip();
targetArray2[targetArray2.length - 1].health = targetArray[i].health;
removeMovieClip(targetArray[i]);
targetArray[i] = targetArray[targetArray.length - 1];
targetArray[i].num = i;
targetArray.pop();
iii = false;
focusingObj = targetArray2[targetArray2.length - 1];
firstDamaged = undefined;
}
}
delete this.onEnterFrame;
if (turnOver() == true) {
timeOut = setTimeout(nextTurn, 3000);
betweenTurns();
}
return(undefined);
}
if ((this.typ == 1) && (this.weapon == true)) {
generateFire(this._x, this._y);
this.testPoint = new Object();
if (bgr.bgr.hitTest((25 + this._x) + chars._x, (0 + this._y) + chars._y, true)) {
this.naezd = true;
} else {
this.naezd = false;
}
this.pos = 0;
while (this.pos < (Math.PI*2)) {
this.testPoint.x = (Math.cos(this.pos) * 25) + this._x;
this.testPoint.y = (Math.sin(this.pos) * 25) + this._y;
if (bgr.bgr.hitTest(this.testPoint.x + chars._x, this.testPoint.y + chars._y, true) && (this.naezd == false)) {
generateFire(this.testPoint.x, this.testPoint.y);
this.naezd = true;
} else if ((bgr.bgr.hitTest(this.testPoint.x + chars._x, this.testPoint.y + chars._y, true) == false) && (this.naezd == true)) {
generateFire(this.testPoint.x, this.testPoint.y);
this.naezd = false;
}
this.pos = this.pos + 0.0628318530717959;
}
if (bgr.bgr.hitTest((30 + this._x) + chars._x, (0 + this._y) + chars._y, true)) {
this.naezd = true;
} else {
this.naezd = false;
}
this.pos = 0;
while (this.pos < (Math.PI*2)) {
this.testPoint.x = (Math.cos(this.pos) * 80) + this._x;
this.testPoint.y = (Math.sin(this.pos) * 80) + this._y;
if (bgr.bgr.hitTest(this.testPoint.x + chars._x, this.testPoint.y + chars._y, true) && (this.naezd == false)) {
generateFire(this.testPoint.x, this.testPoint.y);
this.naezd = true;
} else if ((bgr.bgr.hitTest(this.testPoint.x + chars._x, this.testPoint.y + chars._y, true) == false) && (this.naezd == true)) {
generateFire(this.testPoint.x, this.testPoint.y);
this.naezd = false;
}
this.pos = this.pos + 0.0628318530717959;
}
this.gotoAndPlay("explode");
this.currentStatus = "explode";
timeOut = setTimeout(removeMissile, 900, this);
delete this.onEnterFrame;
return(undefined);
}
if (((this.typ == 10) || (this.typ == 11)) && (this.weapon == true)) {
for (i in yourChar) {
if (this.radius.hitTest(yourChar[i]._x + chars._x, (yourChar[i]._y - 40) + chars._y, true)) {
yourChar[i]._vx = 100 / (yourChar[i]._x - this._x);
yourChar[i]._vy = 100 / ((yourChar[i]._y - 40) - this._y);
vPolet(yourChar[i]);
}
}
for (i in enemyChar) {
if (this.radius.hitTest(enemyChar[i]._x + chars._x, (enemyChar[i]._y - 40) + chars._y, true)) {
enemyChar[i]._vx = 100 / (enemyChar[i]._x - this._x);
enemyChar[i]._vy = 100 / ((enemyChar[i]._y - 40) - this._y);
vPolet(enemyChar[i]);
}
}
generateLighting(this._x, this._y);
generateLighting(this._x, this._y);
generateLighting(this._x, this._y);
generateLighting(this._x, this._y);
if ((this.typ == 10) || (this.hits == 2)) {
this.currentStatus = "explode";
this.gotoAndPlay("explode");
timeOut2 = setTimeout(removeMissile, 900, this);
delete this.onEnterFrame;
if (turnOver() == true) {
timeOut = setTimeout(nextTurn, 3000);
betweenTurns();
}
return(undefined);
}
this.playSound("_mPiezo");
if (this.hits == undefined) {
this.hits = 1;
} else {
this.hits++;
}
}
};
ttt = 0;
init();
Instance of Symbol 524 MovieClip in Frame 54
onClipEvent (load) {
if (_root.zvuk == true) {
_root.thisSound.setVolume(100);
this.gotoAndStop(1);
} else {
_root.thisSound.setVolume(0);
this.gotoAndStop(2);
}
}
on (release) {
_root.zvuk = !_root.zvuk;
if (_root.zvuk == true) {
_root.thisSound.setVolume(100);
this.gotoAndStop(1);
} else {
_root.thisSound.setVolume(0);
this.gotoAndStop(2);
}
}
Instance of Symbol 526 MovieClip in Frame 54
on (release) {
getURL ("http://madfatcat.com?ref=SW2", "_blank");
}
Symbol 33 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 36 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 39 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 42 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 45 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 47 MovieClip [loseScreen] Frame 21
highscores.onEnterFrame = (moreGames.onEnterFrame = (tryAgain.onEnterFrame = (mainMenu.onEnterFrame = _root.buttonScale)));
aaa = _root.createEmptyMovieClip("og", _root.getNextHighestDepth());
loadMovie ("http://madfatcat.com/ourGames.swf", _root.og);
tryAgain.onRelease = function () {
play();
_root.og.removeMovieClip();
};
mainMenu.onRelease = function () {
_root.gotoAndPlay("mainMenu");
_root.og.removeMovieClip();
removeMovieClip(aaa);
removeMovieClip(this._parent);
};
moreGames.onRelease = function () {
getURL ("http://madfatcat.com", "_blank");
};
highscores.onRelease = function () {
getURL ("http://www.madfatcat.com/highscores/" + _root.id, "_blank");
};
_root.clearAll();
stop();
Symbol 47 MovieClip [loseScreen] Frame 60
_root.init();
_root.og.removeMovieClip();
removeMovieClip(_root.og);
removeMovieClip(this);
removeMovieClip(aaa);
aaa.removeMovieClip();
Symbol 55 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 61 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 62 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 68 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 73 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 75 MovieClip [winScreen] Frame 21
stop();
_root.clearAll();
highscores.onEnterFrame = (mm.onEnterFrame = (pmg.onEnterFrame = _root.buttonScale));
mm.onRelease = function () {
_root.gotoAndPlay("mainMenu");
removeMovieClip(this._parent);
};
pmg.onRelease = function () {
getURL ("http://madfatcat.com", "_blank");
};
if (_root.yourCharTyp == 1) {
zast.gotoAndStop(2);
}
scoreText.gotoAndStop(_root.lang);
if (_root.lang == "ru") {
scoreText.scoreText.text = "\u0412\u0430\u0448\u0438 \u043E\u0447\u043A\u0438: " + _root.score;
} else {
scoreText.scoreText.text = "Your Score: " + _root.score;
}
Instance of Symbol 68 MovieClip "highscores" in Symbol 75 MovieClip [winScreen] Frame 21
on (release) {
if (((_root.nickName != undefined) && (_root.nickName != "")) && (_root.nickName != " ")) {
if (_root.nickName.length > 20) {
_root.nickName = _root.nickName.substr(0, 20);
}
_root.checksum = (((_root.id + _root.score) * 431) ^ 34327) >> 2;
trace(_root.checksum);
var forServer = new LoadVars();
var result_lv = new LoadVars();
forServer.nickName = _root.nickName;
forServer.checksum = _root.checksum;
forServer.score = _root.score;
forServer.id = _root.id;
forServer.sendAndLoad("http://www.madfatcat.com/highscores.php", result_lv, "POST");
this._parent.inpt._y = -200;
this._parent.highscores._y = -200;
this._parent.inp._y = -200;
getURL ("http://www.madfatcat.com/highscores/" + _root.id, "_blank");
}
this.onEnterFrame = function () {
if (result_lv.status == "ok") {
gotoAndPlay ("success");
result_lv.status = undefined;
} else if (result_lv.status == "error") {
gotoAndPlay ("error");
result_lv.status = undefined;
}
};
}
Symbol 75 MovieClip [winScreen] Frame 63
removeMovieClip(this);
Symbol 81 MovieClip Frame 1
stop();
Symbol 107 MovieClip Frame 11
stop();
Symbol 109 MovieClip [missile0] Frame 1
stop();
Symbol 109 MovieClip [missile0] Frame 2
this._rotation = 0;
damageKoef = 0.5;
this.razrivDamage();
Symbol 109 MovieClip [missile0] Frame 45
stop();
Symbol 111 MovieClip [missile1] Frame 1
stop();
Symbol 111 MovieClip [missile1] Frame 2
this._rotation = 0;
damageKoef = 0.5;
this.razrivDamage();
Symbol 111 MovieClip [missile1] Frame 45
stop();
Symbol 147 MovieClip [missile2] Frame 1
stop();
Symbol 147 MovieClip [missile2] Frame 75
removeMovieClip(this);
this.removeMovieClip();
Symbol 151 MovieClip [missile3] Frame 1
stop();
Symbol 151 MovieClip [missile3] Frame 75
removeMovieClip(this);
this.removeMovieClip();
Symbol 160 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 164 MovieClip Frame 1
stop();
Symbol 173 MovieClip [missile10] Frame 1
stop();
Symbol 173 MovieClip [missile10] Frame 8
stop();
Symbol 179 MovieClip [missile11] Frame 1
stop();
Symbol 179 MovieClip [missile11] Frame 8
stop();
Symbol 187 MovieClip [missile12] Frame 1
stop();
Symbol 195 MovieClip [star] Frame 17
removeMovieClip(this);
stop();
Symbol 198 MovieClip [missile13] Frame 1
stop();
Symbol 198 MovieClip [missile13] Frame 28
stop();
Symbol 203 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 204 MovieClip Frame 1
stop();
Symbol 215 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 218 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 227 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 230 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 237 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 242 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 245 MovieClip [nextLevel] Frame 21
function begunMove() {
if (this._parent._parent.totalPercents > 100) {
return(undefined);
}
if (this.drag == true) {
this._x = _xmouse - this._parent._x;
}
if (this._x < 0) {
this.stopDrag();
this._x = 0;
} else if (this._x > 100) {
this._x = 100;
this.stopDrag();
}
if (this._x < this.currentPercents) {
this._x = this.currentPercents;
this.stopDrag();
}
this.pointsForThisPos = (this.oldX - this.currentPercents) * this.koef;
this._parent._parent.countAvailable();
this.maxPercentsAvailable = this.oldX + Math.floor(this._parent._parent.availablePoints / this.koef);
if (this._x > this.maxPercentsAvailable) {
this._x = this.maxPercentsAvailable;
this.stopDrag();
}
this._y = 0;
this.oldX = this._x;
}
function countAvailable() {
availablePoints = (((_root.totalPoints - missile0.begun.pointsForThisPos) - missile1.begun.pointsForThisPos) - missile2.begun.pointsForThisPos) - missile3.begun.pointsForThisPos;
return(availablePoints);
}
stop();
_root.clearAll();
total.text = _root.totalPoints;
availablePoints = _root.totalPoints;
earned.gotoAndStop(_root.lang);
if (_root.lang == "ru") {
earned.earned.text = ("\u0412\u044B \u0437\u0430\u0440\u0430\u0431\u043E\u0442\u0430\u043B\u0438 " + _root.earnedPoints) + " \u043E\u0447\u043A\u043E\u0432.";
} else {
earned.earned.text = ("You earned " + _root.earnedPoints) + " Points.";
}
missile0.begun.koef = _root.missileCostKoef[0];
missile1.begun.koef = _root.missileCostKoef[1];
missile2.begun.koef = _root.missileCostKoef[2];
missile3.begun.koef = _root.missileCostKoef[3];
missile0.begun.currentPercents = _root.shrines[_root.yourCharTyp][0];
missile1.begun.currentPercents = _root.shrines[_root.yourCharTyp][1] - _root.shrines[_root.yourCharTyp][0];
missile2.begun.currentPercents = _root.shrines[_root.yourCharTyp][2] - _root.shrines[_root.yourCharTyp][1];
missile3.begun.currentPercents = _root.shrines[_root.yourCharTyp][3] - _root.shrines[_root.yourCharTyp][2];
missile0.currentPercents._width = missile0.begun.currentPercents;
missile1.currentPercents._width = missile1.begun.currentPercents;
missile2.currentPercents._width = missile2.begun.currentPercents;
missile3.currentPercents._width = missile3.begun.currentPercents;
i = 0;
while (i < 4) {
this["missile" + i].begun._x = this["missile" + i].begun.currentPercents;
this["missile" + i].begun.pointsForThisPos = 0;
i++;
}
this.onEnterFrame = function () {
countAvailable();
totalPercents = ((missile0.begun._x + missile1.begun._x) + missile2.begun._x) + missile3.begun._x;
while (totalPercents > 100) {
if (missile0.begun._x > 0) {
missile0.begun._x--;
} else if (missile1.begun._x > 0) {
missile1.begun._x--;
} else if (missile2.begun._x > 0) {
missile2.begun._x--;
}
totalPercents = ((missile0.begun._x + missile1.begun._x) + missile2.begun._x) + missile3.begun._x;
}
while (totalPercents < 100) {
if (missile2.begun.currentPercents > missile2.begun._x) {
missile2.begun._x++;
} else if (missile1.begun.currentPercents > missile1.begun._x) {
missile1.begun._x++;
} else {
missile0.begun._x++;
}
totalPercents = ((missile0.begun._x + missile1.begun._x) + missile2.begun._x) + missile3.begun._x;
}
missile0.percents.text = missile0.begun._x + "%";
missile1.percents.text = missile1.begun._x + "%";
missile2.percents.text = missile2.begun._x + "%";
missile3.percents.text = missile3.begun._x + "%";
};
missile1.begun.onPress = (missile2.begun.onPress = (missile3.begun.onPress = function () {
this._y = 0;
this.drag = true;
this.onEnterFrame = begunMove;
}));
missile1.begun.onMouseUp = (missile2.begun.onMouseUp = (missile3.begun.onMouseUp = function () {
this.stopDrag();
this.drag = false;
while ((totalPercents > 100) && (this.onEnterFrame == begunMove)) {
this._x--;
totalPercents = ((missile0.begun._x + missile1.begun._x) + missile2.begun._x) + missile3.begun._x;
}
delete this.onEnterFrame;
}));
missile1.begun.onDragOut = (missile2.begun.onDragOut = (missile3.begun.onDragOut = function () {
this._y = 0;
}));
apply.onRelease = function () {
_root.totalPoints = availablePoints;
total.text = _root.totalPoints;
_root.shrinesUpd[_root.yourCharTyp][0] = missile0.begun._x;
_root.shrinesUpd[_root.yourCharTyp][1] = _root.shrinesUpd[_root.yourCharTyp][0] + missile1.begun._x;
_root.shrinesUpd[_root.yourCharTyp][2] = _root.shrinesUpd[_root.yourCharTyp][1] + missile2.begun._x;
_root.shrinesUpd[_root.yourCharTyp][3] = _root.shrinesUpd[_root.yourCharTyp][2] + missile3.begun._x;
missile0.begun.currentPercents = _root.shrinesUpd[_root.yourCharTyp][0];
missile1.begun.currentPercents = _root.shrinesUpd[_root.yourCharTyp][1] - _root.shrinesUpd[_root.yourCharTyp][0];
missile2.begun.currentPercents = _root.shrinesUpd[_root.yourCharTyp][2] - _root.shrinesUpd[_root.yourCharTyp][1];
missile3.begun.currentPercents = _root.shrinesUpd[_root.yourCharTyp][3] - _root.shrinesUpd[_root.yourCharTyp][2];
missile0.currentPercents._width = missile0.begun.currentPercents;
missile1.currentPercents._width = missile1.begun.currentPercents;
missile2.currentPercents._width = missile2.begun.currentPercents;
missile3.currentPercents._width = missile3.begun.currentPercents;
i = 0;
while (i < 4) {
this._parent["missile" + i].begun.pointsForThisPos = 0;
i++;
}
};
apply.onEnterFrame = (proceed.onEnterFrame = _root.buttonScale);
proceed.onRelease = function () {
delete this._parent.onEnterFrame;
delete apply.onRelease;
gotoAndPlay ("pr");
};
if (_root.yourCharTyp == 1) {
gotoAndStop ("angels");
}
Symbol 245 MovieClip [nextLevel] Frame 22
earned.gotoAndStop(_root.lang);
if (_root.lang == "ru") {
earned.earned.text = ("\u0412\u044B \u0437\u0430\u0440\u0430\u0431\u043E\u0442\u0430\u043B\u0438 " + _root.earnedPoints) + " \u043E\u0447\u043A\u043E\u0432.";
} else {
earned.earned.text = ("You earned " + _root.earnedPoints) + " Points.";
}
Symbol 245 MovieClip [nextLevel] Frame 34
_root.gotoAndStop("chooseLevel");
removeMovieClip(this);
Symbol 252 MovieClip [pyl] Frame 11
removeMovieClip(this);
stop();
Symbol 259 MovieClip [razrivm3] Frame 1
damageKoef = 2.5;
this.razrivDamage();
Symbol 259 MovieClip [razrivm3] Frame 74
removeMovieClip(this);
this.removeMovieClip();
Symbol 284 MovieClip Frame 1
stop();
Symbol 284 MovieClip Frame 9
play();
Symbol 284 MovieClip Frame 23
gotoAndPlay (9);
Symbol 288 MovieClip Frame 11
_root.playSound("_step1-" + random(4));
Symbol 288 MovieClip Frame 23
_root.playSound("_step1-" + random(4));
Symbol 302 MovieClip Frame 14
_parent.gotoAndStop(1);
Symbol 308 MovieClip Frame 94
_parent.removeMovieClip();
Symbol 311 MovieClip Frame 1
if (random(3) == 1) {
gotoAndPlay ("act2");
} else if (random(3) == 2) {
gotoAndPlay ("act3");
}
Symbol 311 MovieClip Frame 56
_parent.gotoAndStop(1);
Symbol 311 MovieClip Frame 97
_parent.gotoAndStop(1);
Symbol 311 MovieClip Frame 334
_parent.gotoAndStop(1);
Symbol 312 MovieClip [char1] Frame 1
stop();
if ((_root.topLayer.messageBox._currentframe < 80) && (_root.activeChar == this)) {
char.head.gotoAndPlay(9);
}
Symbol 312 MovieClip [char1] Frame 2
if ((_root.topLayer.messageBox._currentframe < 80) && (_root.activeChar == this)) {
char.head.gotoAndPlay(9);
}
Symbol 312 MovieClip [char1] Frame 3
if ((_root.topLayer.messageBox._currentframe < 80) && (_root.activeChar == this)) {
char.head.gotoAndPlay(9);
}
Symbol 312 MovieClip [char1] Frame 4
if ((_root.topLayer.messageBox._currentframe < 80) && (_root.activeChar == this)) {
char.head.gotoAndPlay(9);
}
Symbol 312 MovieClip [char1] Frame 5
stop();
Symbol 340 MovieClip Frame 1
stop();
Symbol 340 MovieClip Frame 2
play();
Symbol 340 MovieClip Frame 9
play();
Symbol 340 MovieClip Frame 27
gotoAndPlay (9);
Symbol 352 MovieClip Frame 11
_root.playSound("_step0-" + random(4));
Symbol 352 MovieClip Frame 23
_root.playSound("_step0-" + random(4));
Symbol 363 MovieClip Frame 13
_parent.gotoAndStop(1);
Symbol 396 MovieClip Frame 81
_parent.removeMovieClip();
Symbol 409 MovieClip Frame 1
stop();
Symbol 409 MovieClip Frame 2
play();
Symbol 409 MovieClip Frame 9
play();
Symbol 409 MovieClip Frame 27
gotoAndPlay (9);
Symbol 421 MovieClip Frame 1
if (random(3) == 1) {
gotoAndPlay ("act2");
}
Symbol 421 MovieClip Frame 200
_parent.gotoAndStop("standBy");
Symbol 421 MovieClip Frame 262
_parent.gotoAndStop("standBy");
Symbol 422 MovieClip [char0] Frame 1
stop();
if ((_root.topLayer.messageBox._currentframe < 80) && (_root.activeChar == this)) {
char.head.gotoAndPlay(9);
}
Symbol 422 MovieClip [char0] Frame 2
if ((_root.topLayer.messageBox._currentframe < 80) && (_root.activeChar == this)) {
char.head.gotoAndPlay(9);
}
Symbol 422 MovieClip [char0] Frame 3
if ((_root.topLayer.messageBox._currentframe < 80) && (_root.activeChar == this)) {
char.head.gotoAndPlay(9);
}
Symbol 422 MovieClip [char0] Frame 4
if ((_root.topLayer.messageBox._currentframe < 80) && (_root.activeChar == this)) {
char.head.gotoAndPlay(9);
}
Symbol 433 MovieClip [messageBox] Frame 2
_root.activeChar.char.head.gotoAndPlay(2);
Symbol 433 MovieClip [messageBox] Frame 3
_root.activeChar.char.head.gotoAndPlay(2);
Symbol 433 MovieClip [messageBox] Frame 122
_root.activeChar.char.head.gotoAndStop(1);
Symbol 433 MovieClip [messageBox] Frame 134
removeMovieClip(this);
Symbol 441 MovieClip [damageAmount] Frame 59
removeMovieClip(this);
Symbol 442 MovieClip [smoke] Frame 15
removeMovieClip(this);
Symbol 727 MovieClip [__Packages.mochi.as2.MochiAd] Frame 0
class mochi.as2.MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("3.02 as2");
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
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 _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.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 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_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 _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
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;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
mochi.as2.MochiAd.containerNotify(clip, {id:"hostLoadPcnt", pcnt:_local2}, clip._mochiad._containerLCName);
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_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 showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
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")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
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_failed();
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;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
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) {
options.ad_failed();
_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 showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function 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;
if (_local7._url.indexOf("http") != 0) {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
}
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
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;
mochi.as2.MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new Object();
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);
}
containerNotify(clip, {id:"unload"}, clip._mochiad._containerLCName);
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++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
containerRpcResult(clip, callbackID, _local4, clip._mochiad._containerLCName);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
containerRpcResult(clip, callbackID, _local3, clip._mochiad._containerLCName);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
static function containerNotify(clip, args, lcName) {
var _local1 = clip._mochiad._mochiad_ctr.ad.app;
if (_local1.notify) {
_local1.notify(args);
} else {
new LocalConnection().send(lcName, "notify", args);
}
}
static function containerRpcResult(clip, callbackID, val, lcName) {
var _local1 = clip._mochiad._mochiad_ctr.ad.app;
if (_local1.rpcResult) {
_local1.rpcResult(callbackID, val);
} else {
new LocalConnection().send(lcName, "rpcResult", callbackID, val);
}
}
}
Symbol 478 MovieClip Frame 1
stop();
Symbol 499 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Instance of Symbol 499 MovieClip in Symbol 502 MovieClip Frame 1
on (release) {
getURL ("http://madfatcat.com?ref=SW2", "_blank");
}
Symbol 502 MovieClip Frame 157
_root.play();
Symbol 506 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 508 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 524 MovieClip Frame 1
stop();
Symbol 541 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 546 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Instance of Symbol 526 MovieClip in Symbol 546 MovieClip Frame 1
on (release) {
getURL ("http://madfatcat.com?ref=SW2", "_blank");
}
Instance of Symbol 545 MovieClip in Symbol 546 MovieClip Frame 2
on (release) {
getURL ("mailto:slingwars@madfatcat.com", "_blank");
}
Symbol 571 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 591 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 596 MovieClip Frame 1
stop();
Symbol 630 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 633 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 634 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 637 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);
Symbol 655 MovieClip Frame 1
stop();
Symbol 672 MovieClip Frame 1
stop();
Symbol 722 MovieClip Frame 1
stop();
Symbol 726 MovieClip Frame 1
stop();
gotoAndStop(_root.lang);