Frame 1
function cover() {
jmeno = "cover" + _root.getNextHighestDepth();
_root.attachMovie("cover_black", jmeno, _root.getNextHighestDepth());
_root[jmeno].onEnterFrame = function () {
this._alpha = this._alpha - 5;
if (this._alpha < 5) {
removeMovieClip(this);
}
};
}
function save_game(player_profile) {
player0 = SharedObject.getLocal(player_profile);
player0.data.level1 = _root.level1;
player0.data.level2 = _root.level2;
player0.data.level3 = _root.level3;
player0.flush();
trace("game saved");
}
function load_game(player0) {
if (player0.data.level1 != undefined) {
_root.level1 = player0.data.level1;
_root.level2 = player0.data.level2;
_root.level3 = player0.data.level3;
trace("game loaded");
}
}
function rollover2(obj) {
obj.onRollOver = function () {
obj._parent.gotoAndStop(2);
};
obj.onRollOut = function () {
obj._parent.gotoAndStop(1);
};
}
function rollover(obj) {
obj.onRollOver = function () {
obj.gotoAndStop(2);
};
obj.onRollOut = function () {
obj.gotoAndStop(1);
};
}
function postMindJoltAPIConnect(success) {
trace("[MindJoltAPI] service successfully loaded");
}
var kongregate = _global.kongregate;
kongregate.services.connect();
_root.tmp_skore = 0;
_root.kongregateStats.submit("HighScore", _root.tmp_skore);
stop();
_root.sound_playing = false;
_root.sound_volume = 100;
_root.level1 = false;
_root.level2 = false;
_root.level3 = false;
_root.snd_eff = true;
if (_root.jumpable == undefined) {
_root.jumpable = false;
} else if (_root.jumpable == false) {
_root.gotoAndStop(6);
} else {
_root.jumpable = false;
}
_root.levely = new Array();
_root.levely[1] = [true, 2, "Woods1", 5000, 0, 1];
_root.levely[2] = [true, 3, "Woods2", 5000, 0, 2];
_root.levely[3] = [true, 5, "Woods3", 6000, 0, 1];
_root.levely[4] = [true, 1, "Woods4", 8000, 0, 3];
_root.levely[5] = [true, 4, "Woods5", 5000, 0, 1];
i = 6;
while (i < 50) {
_root.levely[i] = [false, 4, "Woods5", 5000, 0, 2];
i++;
}
_root.achiev = new Array();
i = 1;
while (i < 40) {
_root.achiev[i] = ["Builder" + i, 0, 1000, 1];
i++;
}
_root.magic_bonus_const = 25;
_root.fire_bonus_const = 1;
_root.damage_bonus_const = 10;
_root.pois_bonus_const = 1;
_root.start_cash_const = 20;
_root.kill_cash_const = 1;
_root.hp_bonus_const = 5;
_root.base_gold_const = 2000;
_root.show_intro = true;
var localDomainLC = new LocalConnection();
myDomainName = localDomainLC.domain();
trace("My domain is " + myDomainName);
_root.domena = myDomainName;
_root.pro_domenu1 = "test.yuri.cz";
_root.pro_domenu2 = "yuri.cz";
_root.pro_domenu3 = "localhost1";
_root.pro_domenu4 = "www.soutez-fujitsu.cz";
_root.pro_domenu5 = "soutez-fujitsu.cz";
if (((((_root.domena == _root.pro_domenu1) || (_root.domena == _root.pro_domenu2)) || (_root.domena == _root.pro_domenu3)) || (_root.domena == _root.pro_domenu4)) || (_root.domena == _root.pro_domenu5)) {
domena_ok = true;
} else {
domena_ok = false;
}
if (domena_ok == false) {
mochi.as2.MochiAd.showPreGameAd({id:"c28351563affe705", res:"640x480"});
}
mochi.as2.MochiServices.connect("c28351563affe705");
if (domena_ok == true) {
procenta = 0;
preloader.onEnterFrame = function () {
procenta = Math.round(100 * (_root.getBytesLoaded() / _root.getBytesTotal()));
_root.loading.text = ("Loading... " + procenta) + "%";
_root.preloader._xscale = procenta;
if (procenta > 99) {
_root.gotoAndStop(2);
}
};
}
_root.first_play = 1;
var MindJoltAPI;
if (MindJoltAPI == undefined) {
System.security.allowDomain("static.mindjolt.com");
MindJoltAPI = createEmptyMovieClip("MindJoltAPI", getNextHighestDepth());
var apiPath = ((_level0.mjPath != undefined) ? (_level0.mjPath) : "http://static.mindjolt.com/api/as2/api_as2_local.swf");
var apiLoader = new MovieClipLoader();
var apiLoadListener = new Object();
apiLoader.addListener(apiLoadListener);
apiLoadListener.onLoadInit = function () {
MindJoltAPI.service.connect(postMindJoltAPIConnect);
};
apiLoadListener.onLoadError = function () {
trace("[MindJoltAPI] failed to load.");
};
apiLoader.loadClip(apiPath, MindJoltAPI);
}
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);
}
__com_mochibot__("0c7131ee", this, 10301, true);
Frame 2
stop();
function sounds(obj) {
snd = new Sound();
obj.onPress = function () {
if (_root.sound_volume == 100) {
_root.sound_volume = 0;
this.gotoAndStop(2);
} else {
_root.sound_volume = 100;
this.gotoAndStop(1);
}
};
obj.onEnterFrame = function () {
snd.setVolume(_root.sound_volume);
if (_root.sound_volume == 0) {
this.gotoAndStop(2);
} else if (_root.sound_volume == 100) {
this.gotoAndStop(1);
}
};
}
cover();
if (_root.jumpable == false) {
_root.gotoAndStop(2);
} else {
_root.jumpable = false;
}
if (_root.show_intro == true) {
_root.jumpable = true;
_root.gotoAndStop(6);
}
main_menu.new_game.onPress = function () {
_root.jumpable = true;
_root.race = 1;
_root.days = 0;
_root.start_cash_bonus = 0;
_root.cash_per_kill = 0;
_root.fire_bonus = 0;
_root.pois_bonus = 0;
_root.magic_bonus = 0;
_root.damage_bonus = 0;
_root.tower_unlocked = new Array();
i = 0;
while (i < 20) {
_root.tower_unlocked[i] = new Array();
_root.tower_unlocked[i] = [0, 1, 1, 1];
i++;
}
_root.runes = 22;
_root.runes_spent = 0;
_root.skore = 0;
_root.tower_research = new Array();
i = 0;
while (i < 20) {
_root.tower_research[i] = [0, 1, 1, 1];
i++;
}
_root.levely = new Array();
_root.levely[1] = [true, 2, "Woods1", 1000, 0, 1];
_root.levely[2] = [true, 3, "Woods2", 1000, 0, 2];
_root.levely[3] = [true, 5, "Woods3", 1000, 0, 1];
_root.levely[4] = [true, 1, "Woods4", 2000, 0, 3];
_root.levely[5] = [true, 4, "Woods5", 5000, 0, 1];
i = 6;
while (i < 50) {
_root.levely[i] = [false, 4, "Woods5", 5000, 0, 2];
i++;
}
_root.achiev = new Array();
_root.achiev[1] = ["Builder" + i, 0, 500, 1, "Build 5 towers"];
_root.achiev[2] = ["Builder" + i, 0, 1000, 1, "Build 7 towers"];
_root.achiev[3] = ["Builder" + i, 0, 2500, 2, "Build 10 towers"];
_root.achiev[4] = ["Fast Kill" + i, 0, 1000, 1, "Enemies killed fast"];
_root.achiev[5] = ["Faster Kill" + i, 0, 2000, 1, "Enemies killed faster"];
_root.achiev[6] = ["Born to die" + i, 0, 5000, 2, "Enemies killed immediately"];
i = 7;
while (i < 40) {
_root.achiev[i] = ["Builder" + i, 0, 1000, 1, "Build 5 towers"];
i++;
}
_root.jumpable = true;
_root.gotoAndStop(10);
};
main_menu.continue_game.onPress = function () {
if (_root.skore != undefined) {
_root.jumpable = true;
_root.gotoAndStop(10);
}
};
main_menu.continue_game.onEnterFrame = function () {
if (_root.skore == undefined) {
this._alpha = 70;
} else {
this._alpha = 100;
}
};
main_menu.load_game.onPress = function () {
_root.jumpable = true;
_root.gotoAndStop(4);
};
main_menu.achievments.onPress = function () {
_root.jumpable = true;
_root.gotoAndStop(5);
};
main_menu.new_intro.onRelease = function () {
_root.jumpable = true;
_root.gotoAndStop(6);
};
main_menu.new_help.onRelease = function () {
_root.jumpable = true;
_root.gotoAndStop(5);
};
main_menu.new_authors.onRelease = function () {
_root.jumpable = true;
_root.gotoAndStop(7);
};
main_menu.new_more.onRelease = function () {
getURL ("http://www.afrodita.name/", "_blank");
};
sounds(main_menu.sound_ctrl);
if (_root.sound_playing == false) {
_root.sound_playing = true;
delete snd;
snd = new Sound();
snd.attachSound("era.wav");
snd.setVolume(_root.sound_volume);
snd.start(0, 99);
}
player1 = SharedObject.getLocal("player_profile1");
load_game(player1);
rollover(main_menu.new_game);
rollover(main_menu.new_intro);
rollover(main_menu.new_authors);
rollover(main_menu.new_help);
rollover(main_menu.new_more);
Frame 3
if (_root.jumpable == false) {
_root.gotoAndStop(2);
} else {
_root.jumpable = false;
}
new_game_menu.dwarves.onPress = function () {
_root.race = 1;
_root.days = 0;
_root.start_cash_bonus = 0;
_root.cash_per_kill = 0;
_root.fire_bonus = 0;
_root.pois_bonus = 0;
_root.magic_bonus = 0;
_root.damage_bonus = 0;
_root.tower_unlocked = new Array();
i = 0;
while (i < 20) {
_root.tower_unlocked[i] = new Array();
_root.tower_unlocked[i] = [0, 1, 1, 1];
i++;
}
_root.runes = 22;
_root.runes_spent = 0;
_root.skore = 0;
_root.tower_research = new Array();
i = 0;
while (i < 20) {
_root.tower_research[i] = [0, 1, 1, 1];
i++;
}
_root.levely = new Array();
_root.levely[1] = [true, 2, "Woods1", 1000, 0, 1];
_root.levely[2] = [true, 3, "Woods2", 1000, 0, 2];
_root.levely[3] = [true, 5, "Woods3", 1000, 0, 1];
_root.levely[4] = [true, 1, "Woods4", 2000, 0, 3];
_root.levely[5] = [true, 4, "Woods5", 5000, 0, 1];
i = 6;
while (i < 50) {
_root.levely[i] = [false, 4, "Woods5", 5000, 0, 2];
i++;
}
_root.achiev = new Array();
_root.achiev[1] = ["Builder" + i, 0, 500, 1, "Build 5 towers"];
_root.achiev[2] = ["Builder" + i, 0, 1000, 1, "Build 7 towers"];
_root.achiev[3] = ["Builder" + i, 0, 2500, 2, "Build 10 towers"];
_root.achiev[4] = ["Fast Kill" + i, 0, 1000, 1, "Enemies killed fast"];
_root.achiev[5] = ["Faster Kill" + i, 0, 2000, 1, "Enemies killed faster"];
_root.achiev[6] = ["Born to die" + i, 0, 5000, 2, "Enemies killed immediately"];
i = 7;
while (i < 40) {
_root.achiev[i] = ["Builder" + i, 0, 1000, 1, "Build 5 towers"];
i++;
}
_root.jumpable = true;
_root.gotoAndStop(10);
};
back_btn.onPress = function () {
_root.jumpable = true;
_root.gotoAndStop(2);
};
Frame 4
function load_game(player, button) {
button.onPress = function () {
_root.skore = player.data.skore;
_root.gold = player.data.gold;
_root.cash_per_kill = player.data.cash_per_kill;
_root.start_cash_bonus = player.data.start_cash_bonus;
_root.fire_bonus = player.data.fire_bonus;
_root.pois_bonus = player.data.pois_bonus;
_root.magic_bonus = player.data.magic_bonus;
_root.damage_bonus = player.data.damage_bonus;
_root.race = player.data.race;
_root.levely = player.data.levely;
_root.achiev = player.data.achiev;
_root.runes = player.data.runes;
_root.tower_research = player.data.tower_research;
_root.days = player.data.days;
_root.runes_spent = player.data.runes_spent;
_root.jumpable = true;
_root.gotoAndStop(10);
};
}
function visibility(player, button) {
if (player.data.skore == undefined) {
button._visible = false;
} else {
button._visible = true;
}
}
if (_root.jumpable == false) {
_root.gotoAndStop(2);
} else {
_root.jumpable = false;
}
player1 = SharedObject.getLocal("player_profile1");
player2 = SharedObject.getLocal("player_profile2");
player3 = SharedObject.getLocal("player_profile3");
player4 = SharedObject.getLocal("player_profile4");
player5 = SharedObject.getLocal("player_profile5");
visibility(player1, load_game_btn1);
visibility(player2, load_game_btn2);
visibility(player3, load_game_btn3);
visibility(player4, load_game_btn4);
visibility(player5, load_game_btn5);
load_game(player1, load_game_btn1);
load_game(player2, load_game_btn2);
load_game(player3, load_game_btn3);
load_game(player4, load_game_btn4);
load_game(player5, load_game_btn5);
back_btn.onPress = function () {
_root.jumpable = true;
_root.gotoAndStop(2);
};
Frame 5
if (_root.jumpable == false) {
_root.gotoAndStop(2);
} else {
_root.jumpable = false;
}
back_btn.onPress = function () {
_root.jumpable = true;
_root.gotoAndStop(2);
};
Frame 6
if (_root.jumpable == false) {
_root.gotoAndStop(2);
} else {
_root.jumpable = false;
}
back_btn.onRelease = function () {
_root.jumpable = true;
_root.gotoAndStop(2);
};
_root.show_intro = false;
stop();
t = 650;
intro.onEnterFrame = function () {
t--;
if (t < 1) {
_root.jumpable = true;
_root.gotoAndStop(2);
}
};
if (_root.sound_playing == false) {
_root.sound_playing = true;
delete snd;
snd = new Sound();
snd.attachSound("era.wav");
snd.setVolume(_root.sound_volume);
snd.start(0, 99);
}
Frame 7
if (_root.jumpable == false) {
_root.gotoAndStop(2);
} else {
_root.jumpable = false;
}
back_btn.onPress = function () {
_root.jumpable = true;
_root.gotoAndStop(2);
};
Frame 8
if (_root.jumpable == false) {
_root.gotoAndStop(2);
} else {
_root.jumpable = false;
}
_root.jumpable = true;
if (domena_ok == false) {
if (_root.first_play < 1) {
_root.first_play = 0;
mochi.as2.MochiAd.showInterLevelAd({id:"c28351563affe705", res:"640x480", no_bg:true});
snd.stop();
delete snd;
} else {
_root.first_play = _root.first_play - 1;
_root.gotoAndStop(9);
}
} else {
_root.gotoAndStop(9);
}
Frame 9
if (_root.jumpable == false) {
_root.gotoAndStop(2);
} else {
_root.jumpable = false;
}
_root.jumpable = true;
_root.gotoAndStop(11);
Frame 10
cover();
if (_root.jumpable == false) {
_root.gotoAndStop(2);
} else {
_root.jumpable = false;
}
_root.start_cash_total = 0;
_root.cash_per_kill_total = 0;
_root.fire_bonus_total = 0;
_root.pois_bonus_total = 0;
_root.magic_bonus_total = 0;
_root.damage_bonus_total = 0;
_root.start_cash_total = _root.start_cash_bonus * _root.start_cash_const;
_root.cash_per_kill_total = _root.cash_per_kill * _root.kill_cash_const;
_root.fire_bonus_total = _root.fire_bonus * _root.fire_bonus_const;
_root.pois_bonus_total = _root.pois_bonus * _root.pois_bonus_const;
_root.magic_bonus_total = _root.magic_bonus * _root.magic_bonus_const;
_root.damage_bonus_total = _root.damage_bonus * _root.damage_bonus_const;
back_btn.onPress = function () {
_root.jumpable = true;
_root.gotoAndStop(2);
};
save_game_btn.onPress = function () {
_root.jumpable = true;
_root.gotoAndStop(8);
};
load_game_btn.onPress = function () {
_root.jumpable = true;
_root.gotoAndStop(4);
};
talents_btn.onPress = function () {
_root.jumpable = true;
_root.gotoAndStop(9);
};
achievments_btn.onPress = function () {
_root.jumpable = true;
_root.gotoAndStop(5);
};
snd2.stop();
delete snd2;
if (_root.sound_playing == false) {
_root.sound_playing = true;
delete snd;
snd = new Sound();
snd.attachSound("era.wav");
snd.setVolume(_root.sound_volume);
snd.start(0, 99);
}
lvl1.hardcore._visible = false;
lvl2.hardcore._visible = false;
lvl3.hardcore._visible = false;
if (_root.level1 == true) {
lvl2.locked1._visible = false;
lvl1.hardcore._visible = true;
} else {
lvl2.locked1._visible = true;
}
if (_root.level2 == true) {
lvl3.locked1._visible = false;
lvl2.hardcore._visible = true;
} else {
lvl3.locked1._visible = true;
}
if (_root.level3 == true) {
lvl3.hardcore._visible = true;
}
rollover2(lvl1.clk);
rollover2(lvl2.clk);
rollover2(lvl3.clk);
rollover(lvl1.hardcore);
rollover(lvl2.hardcore);
rollover(lvl3.hardcore);
lvl1.clk.onRelease = function () {
_root.jumpable = true;
hc = 1;
_root.act_level = 1;
_root.max_waves = 50;
_root.gotoAndStop(8);
};
lvl1.hardcore.onRelease = function () {
_root.jumpable = true;
hc = 2;
_root.act_level = 1;
_root.max_waves = 50;
_root.gotoAndStop(8);
};
lvl2.clk.onRelease = function () {
if (this._parent.locked1._visible == false) {
_root.jumpable = true;
hc = 1;
_root.act_level = 2;
_root.max_waves = 50;
_root.gotoAndStop(8);
}
};
lvl2.hardcore.onRelease = function () {
_root.jumpable = true;
hc = 2;
_root.act_level = 2;
_root.max_waves = 50;
_root.gotoAndStop(8);
};
lvl3.clk.onRelease = function () {
if (this._parent.locked1._visible == false) {
hc = 1;
_root.jumpable = true;
_root.act_level = 3;
_root.max_waves = 50;
_root.gotoAndStop(8);
}
};
lvl3.hardcore.onRelease = function () {
_root.jumpable = true;
hc = 2;
_root.act_level = 3;
_root.max_waves = 50;
_root.gotoAndStop(8);
};
Frame 11
function towerCheck(tower) {
if (tower.reloadHold <= 0) {
j = 0;
while (j < enemys.length) {
if (distance(tower, enemys[j]) < tower.range) {
tower.target = enemys[j];
tower.ableFire = true;
break;
}
j++;
}
} else {
tower.reloadHold = tower.reloadHold - _root.game_speed;
}
}
function towerFire(tower) {
tower.reloadHold = tower.reload;
tower.ableFire = false;
tower.dir.gotoAndPlay(2);
name = ("a" + tower.num) + this.getNextHighestDepth();
this.attachMovie(tower.tower_type, name, this.getNextHighestDepth());
lifeBox.swapDepths(_root.getNextHighestDepth());
dx = tower.target._x - tower._x;
dy = tower.target._y - tower._y;
angle = Math.atan2(dy, dx);
mov_x = 16 * Math.cos(angle);
mov_y = 16 * Math.sin(angle);
this[name]._rotation = (angle * 180) / Math.PI;
this[name]._x = tower._x + mov_x;
this[name]._y = tower._y + mov_y;
this[name].target = tower.target;
this[name].speed = tower.speed;
this[name].damage = tower.damage;
this[name].dmg_type = tower.tower_type;
this[name].effect = tower.effect;
this[name].eff_time = tower.eff_time;
if (_root.snd_eff == true) {
if (tower.tower_type == "bullet") {
snd = new Sound();
snd.attachSound("gun4.wav");
snd.start();
}
if (tower.tower_type == "bomb") {
snd = new Sound();
snd.attachSound("bomb.wav");
snd.start();
}
if ((tower.tower_type == "fire") || (tower.tower_type == "slow")) {
snd = new Sound();
snd.attachSound("flame.wav");
snd.start();
}
if (tower.tower_type == "flame") {
snd = new Sound();
snd.attachSound("flame.wav");
snd.start();
}
if (tower.tower_type == "shock") {
snd = new Sound();
snd.attachSound("shock.wav");
snd.start();
}
if (tower.tower_type == "poison") {
var snd = new Sound();
snd.attachSound("poison.wav");
snd.start();
}
}
this[name].onEnterFrame = function () {
dx = this.target._x - this._x;
dy = this.target._y - this._y;
angle = Math.atan2(dy, dx);
this._rotation = (angle * 180) / Math.PI;
this._x = this._x + ((Math.cos(angle) * this.speed) * _root.game_speed);
this._y = this._y + ((Math.sin(angle) * this.speed) * _root.game_speed);
if (this.target._x == undefined) {
this.removeMovieClip();
}
if (this.target.hitTest(this._x, this._y, true)) {
if (((((tower.tower_type == "bullet") || (tower.tower_type == "harpuna")) || (tower.tower_type == "arrow")) || (tower.tower_type == "crossbowArrow")) || (tower.tower_type == "balistaArrow")) {
if (this.damage > this.target.defense) {
this.target.health = this.target.health - (this.damage - this.target.defense);
}
if (tower.effect > this.target.defense) {
this.target.health = this.target.health - tower.effect;
}
if (this.target.health <= 0) {
player.gun_kills = player.gun_kills + 1;
}
name_splash = "bum" + _root.getNextHighestDepth();
_root.attachMovie("bum", name_splash, _root.getNextHighestDepth());
_root[name_splash]._x = (this._x + (Math.random() * 3)) - 3;
_root[name_splash]._y = (this._y + (Math.random() * 3)) - 3;
lifeBox.swapDepths(_root.getNextHighestDepth());
tower.xp = tower.xp + tower.xp_gain;
}
if (tower.tower_type == "bomb") {
if (this.damage > this.target.defense) {
this.target.health = this.target.health - (this.damage - this.target.defense);
if (this.target.health <= 0) {
player.bomb_kills = player.bomb_kills + 1;
}
}
tower.xp = tower.xp + tower.xp_gain;
name_splash = "splash" + _root.getNextHighestDepth();
_root.attachMovie("splash", name_splash, _root.getNextHighestDepth());
_root[name_splash]._x = (this._x + (Math.random() * 3)) - 3;
_root[name_splash]._y = (this._y + (Math.random() * 3)) - 3;
lifeBox.swapDepths(_root.getNextHighestDepth());
_root[name_splash].onEnterFrame = function () {
if (this._currentframe == 5) {
j = 0;
while (j <= levelTotal) {
if (_root["creep" + j].hitTest(this)) {
creep_name2 = _root["creep" + j];
if (tower.effect > creep_name2.defense) {
creep_name2.health = creep_name2.health - (tower.effect - creep_name2.defense);
if (creep_name2.health <= 0) {
player.bomb_kills = player.bomb_kills + 1;
}
}
}
j++;
}
}
};
}
if (tower.tower_type == "slow") {
if (this.damage > this.target.defense) {
this.target.health = this.target.health - (this.damage - this.target.defense);
}
tower.xp = tower.xp + tower.xp_gain;
if (this.target.slow < this.effect) {
this.target.slow_time = this.target.slow_time + this.eff_time;
this.target.slow = this.effect;
}
if (this.target.health <= 0) {
player.slow_kills = player.slow_kills + 1;
}
if (tower.tower_type == "slow") {
name_splash = "slow_splash" + _root.getNextHighestDepth();
_root.attachMovie("slow_splash", name_splash, _root.getNextHighestDepth());
_root[name_splash]._x = (this._x + (Math.random() * 3)) - 3;
_root[name_splash]._y = (this._y + (Math.random() * 3)) - 3;
lifeBox.swapDepths(_root.getNextHighestDepth());
_root[name_splash].onEnterFrame = function () {
if (this._currentframe == 3) {
j = 0;
while (j <= levelTotal) {
if (_root["creep" + j].hitTest(this)) {
creep_name2 = _root["creep" + j];
creep_name2.slow = tower.effect;
creep_name2.slow_time = creep_name2.slow_time + tower.eff_time;
}
j++;
}
}
};
}
}
if ((tower.tower_type == "fire") || (tower.tower_type == "flame")) {
if (this.damage > this.target.defense) {
this.target.health = this.target.health - (this.damage - this.target.defense);
}
tower.xp = tower.xp + tower.xp_gain;
if (this.target.fire_res < this.effect) {
this.target.burn = this.target.burn + (this.effect - this.target.fire_res);
this.target.burn_time = this.target.burn_time + this.eff_time;
}
if (tower.tower_type == "fire") {
name_splash = "fire_splash" + _root.getNextHighestDepth();
_root.attachMovie("fire_splash", name_splash, _root.getNextHighestDepth());
_root[name_splash]._x = (this._x + (Math.random() * 3)) - 3;
_root[name_splash]._y = (this._y + (Math.random() * 3)) - 3;
lifeBox.swapDepths(_root.getNextHighestDepth());
_root[name_splash].onEnterFrame = function () {
if (this._currentframe == 5) {
j = 0;
while (j <= levelTotal) {
if (_root["creep" + j].hitTest(this)) {
creep_name2 = _root["creep" + j];
if (tower.effect > creep_name2.fire_res) {
creep_name2.burn = creep_name2.burn + ((tower.effect - creep_name2.fire_res) / 10);
creep_name2.burn_time = creep_name2.burn_time + tower.eff_time;
}
}
j++;
}
}
};
}
}
if ((tower.tower_type == "poison") || (tower.tower_type == "flower_trn")) {
if (this.damage > this.target.defense) {
this.target.health = this.target.health - (this.damage - this.target.defense);
}
tower.xp = tower.xp + tower.xp_gain;
if (this.target.pois_res < this.effect) {
this.target.poison = this.target.poison + (this.effect - this.target.pois_res);
this.target.poison_time = this.target.poison_time + this.eff_time;
}
if (tower.tower_type == "poison") {
name_splash = "poison_splash" + _root.getNextHighestDepth();
_root.attachMovie("poison_splash", name_splash, _root.getNextHighestDepth());
_root[name_splash]._x = (this._x + (Math.random() * 3)) - 3;
_root[name_splash]._y = (this._y + (Math.random() * 3)) - 3;
lifeBox.swapDepths(_root.getNextHighestDepth());
_root[name_splash].onEnterFrame = function () {
if (this._currentframe == 5) {
j = 0;
while (j <= levelTotal) {
if (_root["creep" + j].hitTest(this)) {
creep_name2 = _root["creep" + j];
if (tower.effect > creep_name2.pois_res) {
creep_name2.poison = creep_name2.poison + ((tower.effect - creep_name2.pois_res) / 10);
creep_name2.poison_time = creep_name2.poison_time + tower.eff_time;
}
}
j++;
}
}
};
}
}
if (tower.tower_type == "shock") {
if (this.damage > this.target.defense) {
this.target.health = this.target.health - (this.damage - this.target.defense);
if (this.target.health <= 0) {
player.shock_kills = player.shock_kills + 1;
}
}
tower.xp = tower.xp + tower.xp_gain;
this.target.shock = this.effect;
this.target.shock_time = this.target.shock_time + this.eff_time;
name_splash = "shock_splash" + _root.getNextHighestDepth();
_root.attachMovie("shock_splash", name_splash, _root.getNextHighestDepth());
_root[name_splash]._x = this.target._x;
_root[name_splash]._y = this.target._y;
_root[name_splash].dur = tower.eff_time;
lifeBox.swapDepths(_root.getNextHighestDepth());
_root[name_splash].onEnterFrame = function () {
if (this.dur > 0) {
this.dur = this.dur - (0.04 * _root.game_speed);
} else if (this._currentframe < 100) {
this.removeMovieClip();
this.gotoAndPlay(100);
}
if (removeShocks == true) {
this.removeMovieClip();
}
if (_root._currentframe != 11) {
this.removeMovieClip();
}
};
}
if (tower.tower_type == "cash") {
if (this.damage > this.target.defense) {
this.target.health = this.target.health - (this.damage - this.target.defense);
}
tower.xp = tower.xp + tower.xp_gain;
name_splash = "money" + _root.getNextHighestDepth();
_root.attachMovie("money", name_cash, _root.getNextHighestDepth());
_root[name_splash]._x = (this._x + (Math.random() * 3)) - 3;
_root[name_splash]._y = (this._y + (Math.random() * 3)) - 3;
lifeBox.swapDepths(_root.getNextHighestDepth());
_root.gold = _root.gold + tower.effect;
player.gold_digger = player.gold_digger + tower.effect;
}
if (tower.tower_type == "roots") {
if (this.damage > this.target.defense) {
this.target.health = this.target.health - (this.damage - this.target.defense);
}
tower.xp = tower.xp + tower.xp_gain;
this.target.shock_time = this.target.shock_time + this.eff_time;
this.target.shock = this.effect;
name_roots = "roots_out" + _root.getNextHighestDepth();
_root.attachMovie("roots_out", name_roots, _root.getNextHighestDepth());
_root[name_roots]._x = this.target._x;
_root[name_roots]._y = this.target._y;
_root[name_roots].dur = tower.eff_time;
_root[name_roots].onEnterFrame = function () {
if (this.dur > 0) {
this.dur = this.dur - (0.04 * _root.game_speed);
} else {
this.removeMovieClip();
}
};
}
if (tower.tower_type == "magic") {
if (this.damage > this.target.defense) {
this.target.health = this.target.health - (this.damage - this.target.defense);
}
if (tower.effect > this.target.magic_res) {
this.target.health = this.target.health - (tower.effect - this.target.magic_res);
}
tower.xp = tower.xp + tower.xp_gain;
}
if (this.target.health <= 0) {
if (_root.snd_eff == true) {
snd = new Sound();
snd.attachSound("die.wav");
snd.start();
}
tower.xp = tower.xp + tower.xp_gain;
if (this.target == _root.creep_name) {
_root.creep_stats_mc.removeMovieClip();
}
name_money = "money_" + _root.getNextHighestDepth();
_root.attachMovie("money", name_money, _root.getNextHighestDepth());
_root[name_money]._x = (this._x + (Math.random() * 3)) - 3;
_root[name_money]._y = (this._y + (Math.random() * 3)) - 3;
lifeBox.swapDepths(_root.getNextHighestDepth());
_root.gold = _root.gold + (this.target.reward + player.cash_bonus);
_root.tmp_skore = _root.tmp_skore + (this.target.reward + player.cash_bonus);
player.kills = player.kills + 1;
removeEnemy(this.target);
this.target.removeMovieClip();
}
this.removeMovieClip();
}
if (tower.xp >= levels[tower.level]) {
player.levels = player.levels + 1;
tower.level++;
tower.rank.lvl_up.gotoAndPlay(2);
if (tower.tower_type == "bullet") {
tower.damage = tower.damage * 1.5;
tower.damage = Math.round(tower.damage);
tower.effect = tower.effect * 1.5;
tower.effect = Math.round(tower.effect);
}
if (tower.tower_type == "harpuna") {
tower.damage = tower.damage * 1.5;
tower.damage = Math.round(tower.damage);
tower.effect = tower.effect * 1.5;
tower.effect = Math.round(tower.effect);
}
if (tower.tower_type == "bomb") {
tower.damage = tower.damage * 1.5;
tower.damage = Math.round(tower.damage);
tower.effect = tower.effect * 1.5;
tower.effect = Math.round(tower.effect);
}
if (tower.tower_type == "slow") {
tower.damage = tower.damage * 1.5;
tower.damage = Math.round(tower.damage);
tower.effect = tower.effect * 0.9;
tower.eff_time = tower.eff_time + 0.2;
}
if ((tower.tower_type == "fire") || (tower.tower_type == "flame")) {
tower.damage = tower.damage * 1.5;
tower.damage = Math.round(tower.damage);
tower.effect = tower.effect * 1.5;
tower.effect = Math.round(tower.effect * 100) / 100;
tower.eff_time = tower.eff_time + 0.25;
}
if ((tower.tower_type == "poison") || (tower.tower_type == "flower_trn")) {
tower.damage = tower.damage * 1.5;
tower.damage = Math.round(tower.damage);
tower.effect = tower.effect * 1.25;
tower.effect = Math.round(tower.effect * 100) / 100;
tower.eff_time = tower.eff_time + 0.5;
}
if (tower.tower_type == "shock") {
tower.damage = tower.damage * 1.5;
tower.damage = Math.round(tower.damage);
tower.effect = tower.effect - 0.005;
tower.eff_time = tower.eff_time + 0.15;
}
if (tower.tower_type == "cash") {
tower.damage = tower.damage * 1.5;
tower.damage = Math.round(tower.damage);
tower.effect = tower.effect + 1;
}
if (((tower.tower_type == "arrow") || (tower.tower_type == "balistaArrow")) || (tower.tower_type == "crossbowArrow")) {
tower.damage = tower.damage * 1.5;
tower.damage = Math.round(tower.damage);
tower.effect = tower.effect * 2;
}
if (tower.tower_type == "magic") {
tower.damage = tower.damage * 1.5;
tower.damage = Math.round(tower.damage);
tower.effect = tower.effect * 2;
}
if (tower.tower_type == "roots") {
tower.damage = tower.damage * 1.5;
tower.damage = Math.round(tower.damage);
tower.eff_time = tower.eff_time + 1;
}
}
};
}
function removeEnemy(enemy) {
var _local3 = 0;
while (_local3 < enemys.length) {
if (enemys[_local3] == enemy) {
enemys.splice(_local3, 1);
}
_local3++;
}
if ((enemys.length < 1) && (levelTotal >= creeps[_root.act_level][_root.wave - 1][9])) {
levelTotal = 0;
if (_root.wave == _root.max_waves) {
lifeBox.btn_submit._visible = true;
lifeBox.btn_submit.txt.text = "Your score:\n" + _root.tmp_skore;
if (_root.act_level == 1) {
_root.kongregateStats.submit("HighScore", _root.tmp_skore);
_root.kongregateStats.submit("Level1", 1);
_root.level1 = true;
save_game("player_profile1");
}
if (_root.act_level == 2) {
_root.kongregateStats.submit("HighScore2", _root.tmp_skore);
_root.kongregateStats.submit("Level2", 1);
_root.level2 = true;
save_game("player_profile1");
}
if (_root.act_level == 3) {
_root.kongregateStats.submit("HighScore3", _root.tmp_skore);
_root.kongregateStats.submit("Level3", 1);
_root.level3 = true;
save_game("player_profile1");
}
after_level.back.onPress = function () {
_root.days = _root.days + 1;
_root.jumpable = true;
_root.gotoAndStop(10);
removeMovieClip(this._parent);
_root.placeTower = false;
_root.selectedTower = "";
_root.towerNum = -1;
towerHold.removeMovieClip();
rangeCircle.removeMovieClip();
};
} else {
sp = sp + 1;
_root.tmp_skore = _root.tmp_skore + _root.gold;
t = 1;
while (t <= numTowers) {
_root.t_name = _root["tower_" + t];
_root.t_name.xp = _root.t_name.xp + (2 + (player.xp2_u * 0.5));
towerFire(_root.t_name);
_root.t_name = "";
t++;
}
_root.tmp_skore = _root.tmp_skore + (100 * lives);
_root.wave++;
_root.max_health = Math.round(creeps[_root.act_level][_root.wave - 1][1]);
_root.creep_delay = creeps[_root.act_level][_root.wave - 1][10];
removeShocks = true;
clearInterval(spawn);
_root.prev_speed = _root.game_speed;
_root.game_speed = 0;
menu1.pause_btn.gotoAndStop(2);
menu1.pause_btn.pauza.text = "Next wave";
menu2.pause_btn.pauza.text = "Next wave";
lifeBox.wave.text = "Wave: " + _root.wave;
lifeBox.hp.text = "Enemy HP: " + _root.max_health;
"Lives: " + lives;
menu1.txt.text = "Next wave: " + creeps[_root.act_level][_root.wave - 1][12];
}
}
}
function distance(ob1, ob2) {
dx = ob2._x - ob1._x;
dy = ob2._y - ob1._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
return(dist);
}
function newCreep() {
levelTotal++;
if (levelTotal > (creeps[_root.act_level][_root.wave - 1][9] - 1)) {
clearInterval(spawn);
}
_root.max_health = creeps[_root.act_level][_root.wave - 1][1];
name = "creep" + levelTotal;
_root.attachMovie(creeps[_root.act_level][_root.wave - 1][0], name, _root.getNextHighestDepth());
lifeBox.swapDepths(_root.getNextHighestDepth());
_root[name].number = levelTotal;
_root[name]._x = waypoints[_root.act_level][0][0];
_root[name]._y = waypoints[_root.act_level][0][1] - Math.round(random(20));
_root[name].tr = 1;
_root[name].name_new = creeps[_root.act_level][_root.wave - 1][11];
_root[name].health = creeps[_root.act_level][_root.wave - 1][1];
_root[name].reward = creeps[_root.act_level][_root.wave - 1][2] + _root.cash_per_kill_total;
_root[name].base_speed = creeps[_root.act_level][_root.wave - 1][3];
_root[name].defense = creeps[_root.act_level][_root.wave - 1][4];
_root[name].fire_res = creeps[_root.act_level][_root.wave - 1][5];
_root[name].pois_res = creeps[_root.act_level][_root.wave - 1][6];
_root[name].magic_res = creeps[_root.act_level][_root.wave - 1][7];
_root[name].regen = creeps[_root.act_level][_root.wave - 1][8];
_root.creep_delay = creeps[_root.act_level][_root.wave - 1][10];
_root[name].slow = 1;
_root[name].slow_time = 0;
_root[name].burn = 0;
_root[name].burn_time = 0;
_root[name].poison = 0;
_root[name].poison_time = 0;
_root[name].shock = 0;
_root[name].shock_time = 0;
if (_root[name].regen == 0) {
_root[name].regenerace._visible = false;
} else {
_root[name].regenerace.gotoAndPlay(Math.random() * 7);
}
enemys.push(_root[name]);
_root[name].onEnterFrame = function () {
this.speed = this.base_speed;
if (this.slow_time > 0) {
this.slow_time = this.slow_time - (0.04 * _root.game_speed);
this.speed = this.speed * this.slow;
this.hp.slow._visible = true;
} else {
this.slow = 0;
this.slow_time = 0;
this.hp.slow._visible = false;
}
if ((this.burn > 0) && (this.burn_time > 0)) {
this.health = this.health - (this.burn * _root.game_speed);
this.burn_time = this.burn_time - (0.04 * _root.game_speed);
this.hp.burn._visible = true;
} else {
this.burn = 0;
this.burn_time = 0;
this.hp.burn._visible = false;
}
if ((this.poison > 0) && (this.poison_time > 0)) {
this.health = this.health - (this.poison * _root.game_speed);
this.poison_time = this.poison_time - (0.04 * _root.game_speed);
this.hp.poison._visible = true;
} else {
this.poison = 0;
this.poison_time = 0;
this.hp.poison._visible = false;
}
if (this.shock_time > 0) {
this.speed = this.shock;
this.shock_time = this.shock_time - (0.04 * _root.game_speed);
this.hp.shock._visible = true;
} else {
this.shock = 0;
this.shock_time = 0;
this.hp.shock._visible = false;
}
if (((this.health + (this.regen * _root.game_speed)) < _root.max_health) && (this.health > 0)) {
this.health = this.health + (this.regen * _root.game_speed);
}
dx = waypoints[_root.act_level][this.tr][0] - this._x;
dy = waypoints[_root.act_level][this.tr][1] - this._y;
angle = Math.atan2(dy, dx);
this._x = this._x + ((Math.cos(angle) * this.speed) * _root.game_speed);
this._y = this._y + ((Math.sin(angle) * this.speed) * _root.game_speed);
this._rotation = (angle * 180) / Math.PI;
this.hp._rotation = ((-angle) * 180) / Math.PI;
this.hp.hp._xscale = (this.health / _root.max_health) * 100;
if (this.hp.hp._xscale < 75) {
this.hp.hp.gotoAndStop(2);
}
if (this.hp.hp._xscale < 50) {
this.hp.hp.gotoAndStop(3);
}
if (this.hp.hp._xscale < 25) {
this.hp.hp.gotoAndStop(4);
}
if (this.health <= 0) {
if (_root.snd_eff == true) {
snd = new Sound();
snd.attachSound("die.wav");
snd.start();
}
if (this.number == _root.creep_name.number) {
_root.creep_stats_mc.removeMovieClip();
}
name_money = "money_" + _root.getNextHighestDepth();
_root.attachMovie("money", name_money, _root.getNextHighestDepth());
_root[name_money]._x = this._x;
_root[name_money]._y = this._y;
_root.gold = _root.gold + (this.reward + player.cash_bonus);
_root.tmp_skore = _root.tmp_skore + (this.reward + player.cash_bonus);
player.kills = player.kills + 1;
if (this.burn > 0) {
player.fire_kills = player.fire_kills + 1;
} else if (this.poison > 0) {
player.poison_kills = player.poison_kills + 1;
}
removeEnemy(this);
this.removeMovieClip();
}
if ((Math.abs(dx) < 7) && (Math.abs(dy) < 7)) {
if (this.tr == (waypoints[_root.act_level].length - 1)) {
if (this.number == _root.creep_name.number) {
_root.creep_stats_mc.removeMovieClip();
}
lives--;
_root.lifeBox.life.text = "Lives: " + lives;
name_money = "blood_" + _root.getNextHighestDepth();
_root.attachMovie("blood", name_money, _root.getNextHighestDepth());
_root[name_money]._x = (this._x + (Math.random() * 10)) - 5;
_root[name_money]._y = (this._y + (Math.random() * 10)) - 5;
if (_root.snd_eff == true) {
snd = new Sound();
snd.attachSound("die2.wav");
snd.start();
}
removeEnemy(this);
this.removeMovieClip();
if (lives <= 0) {
lifeBox.btn_submit._visible = true;
lifeBox.btn_submit.txt.text = "Your score:\n" + _root.tmp_skore;
_root.game_speed = 0;
_root.prev_speed = 0;
if (_root.act_level == 1) {
if (hc == 1) {
_root.kongregateStats.submit("HighScore", _root.tmp_skore);
} else {
_root.kongregateStats.submit("Hardcore1", _root.tmp_skore);
}
}
if (_root.act_level == 2) {
if (hc == 1) {
_root.kongregateStats.submit("HighScore2", _root.tmp_skore);
} else {
_root.kongregateStats.submit("Hardcore2", _root.tmp_skore);
}
}
if (_root.act_level == 3) {
if (hc == 1) {
_root.kongregateStats.submit("HighScore3", _root.tmp_skore);
} else {
_root.kongregateStats.submit("Hardcore3", _root.tmp_skore);
}
}
}
}
this.tr++;
if (this.tr > max_waypoint) {
max_waypoint = this.tr;
}
}
if (_root._currentframe < 11) {
removeMovieClip(this);
}
};
}
function upgRollOver(obj, nm, desc) {
obj.onRollOver = function () {
this._parent.txt.text = nm;
this._parent.txt2.text = desc;
};
}
function updateTowerStats() {
towerStats[0] = [90 + player.range_bonus, 25 + player.reload_bonus, 20 + player.damage_bonus, 9, "bullet", 25, 0, "Gun Tower", 250, "Basic gun tower", 0.12 * player.xp_bonus];
towerStats[1] = [150 + player.range_bonus, 50 + player.reload_bonus, 100 + player.damage_bonus, 10, "bullet", 100, 0, "Sniper Tower", 650, "Sniper tower", 0.2 * player.xp_bonus];
towerStats[2] = [75 + player.range_bonus, 50 + player.reload_bonus, 50 + player.damage_bonus, 6, "bomb", 35 + player.bomb_bonus, 0, "Cannon Tower", 1250, "Cannon splash effect", 0.4 * player.xp_bonus];
towerStats[3] = [100 + player.range_bonus, 12 + player.reload_bonus, 25 + player.damage_bonus, 9, "bullet", 20, 0, "Machine gun Tower", 850, "Machine gun", 0.12 * player.xp_bonus];
towerStats[4] = [80 + player.range_bonus, 45 + player.reload_bonus, 20 + player.damage_bonus, 6, "poison", 1 + player.poison_bonus, 5, "Poison Tower", 1250, "Poisons enemies, long time effect", 0.2 * player.xp_bonus];
towerStats[5] = [85 + player.range_bonus, 60 + player.reload_bonus, (35 + player.damage_bonus) + (15 * player.shock_u), 5, "shock", 0.1 + player.shock_bonus, 3 + player.shock_u, "Shock Tower", 1500, "Shock enemies so they almost can't move", 0.5 * player.xp_bonus];
towerStats[6] = [100 + player.range_bonus, 40 + player.reload_bonus, 15 + player.damage_bonus, 3, "fire", 1 + player.fire_bonus, 3, "Fire Tower", 1500, "Set enemies on fire", 0.5 * player.xp_bonus];
towerStats[7] = [100 + player.range_bonus, 50 + player.reload_bonus, 25 + player.damage_bonus, 5, "cash", 1 + player.gold_bonus, 0, "Golden Tower", 2500, "Steal money from enemies", 0.1 * player.xp_bonus];
towerStats[8] = [100 + player.range_bonus, 50 + player.reload_bonus, (25 + player.damage_bonus) + (15 * player.slow_u), 6, "slow", 0.5, 3 + player.slow2_u, "Frost Tower", 750, "Frost Tower", 0.4 * player.xp_bonus];
towerStats[9] = [85 + player.range_bonus, 15 + player.reload_bonus, 25 + player.damage_bonus, 4, "flame", 4 + player.fire_bonus, 4, "Flame tower", 4000, "flame", 0.15 * player.xp_bonus];
}
function achievment(id, obj, ach, min, bonus, nm, txt) {
if ((ach >= min) && (obj.ach == false)) {
_root.tmp_skore = _root.tmp_skore + (bonus * 10);
_root.gold = _root.gold + bonus;
obj.ach = true;
showAch(nm, bonus, id);
obj.gotoAndStop(4);
}
obj.ico.gotoAndStop(id);
obj.onRollOver = function () {
obj._parent.txt.text = ((txt + "(so far ") + ach) + ")";
obj._parent.txt1.text = "Bonus: +$" + bonus;
obj._parent.txt2.text = nm;
};
}
function checkAch() {
achievment(1, lifeBox.achievments.a1, player.kills, 1, 100, "First Blood", " Kill first enemy");
achievment(2, lifeBox.achievments.a2, player.fire_kills, 10, 100, "Fire Kills", " Kill 10 enemies with fire");
achievment(3, lifeBox.achievments.a3, player.poison_kills, 10, 100, "Poison Kills", " kill 10 enemies with poison");
achievment(4, lifeBox.achievments.a4, player.gun_kills, 10, 100, "Gun Killer", " Kill 5 enemy");
achievment(5, lifeBox.achievments.a5, player.bomb_kills, 10, 100, "Bomb killer", " Kill 10 enemy with bomb tower");
achievment(6, lifeBox.achievments.a6, player.built_towers, 7, 250, "Builder 7", " Build 7 towers");
achievment(7, lifeBox.achievments.a7, player.sold_towers, 5, 200, "Seller 5", " Sell 5 towers");
achievment(8, lifeBox.achievments.a8, player.shock_kills, 10, 200, "Shock killer", " Kill 10 enemies with shock tower");
achievment(9, lifeBox.achievments.a9, player.gold_digger, 500, 250, "Gold digger", " Earn $500 with gold tower");
achievment(10, lifeBox.achievments.a10, player.upgrades, 5, 500, "Upgrader", " Buy 5 upgrades");
achievment(11, lifeBox.achievments.a11, player.kills, 100, 250, "Second Blood", " Kill 100 enemies");
achievment(12, lifeBox.achievments.a12, player.fire_kills, 100, 500, "Fire Kills 100", " Kill 100 enemies with fire");
achievment(14, lifeBox.achievments.a13, player.poison_kills, 100, 500, "Poison Kills 100", " Kill 100 enemies with poison");
achievment(13, lifeBox.achievments.a14, player.slow_kills, 100, 500, "Frost Kills 100", " Kill 100 enemies with slow tower");
achievment(15, lifeBox.achievments.a15, player.bomb_kills, 100, 500, "Bomb killer 100", " kill 100 enemies");
achievment(16, lifeBox.achievments.a16, player.built_towers, 15, 500, "Builder 15", " build 15 towers");
achievment(17, lifeBox.achievments.a17, player.sold_towers, 10, 1000, "Seller 10", " sell 10 towers");
achievment(18, lifeBox.achievments.a18, player.shock_kills, 50, 500, "Shock killer 50", " Kill 50 enemies with shock tower");
achievment(19, lifeBox.achievments.a19, player.gold_digger, 1000, 500, "Gold digger 1000", " earn $1000 with gold towers");
achievment(20, lifeBox.achievments.a20, player.upgrades, 25, 1000, "Upgrader 25", " buy 25 upgrades");
achievment(21, lifeBox.achievments.a21, player.kills, 400, 1000, "Last Blood", " Kill 400 enemies");
achievment(22, lifeBox.achievments.a22, player.fire_kills, 250, 1000, "Fire Kills 250", " kill 250 enemies with fire");
achievment(23, lifeBox.achievments.a23, player.poison_kills, 250, 1000, "Poison Kills 250", " kill 250 enemies with poison");
achievment(24, lifeBox.achievments.a24, player.gun_kills, 250, 1000, "Gun Killer 250", " kill 250 enemies with gun tower");
achievment(25, lifeBox.achievments.a25, player.bomb_kills, 250, 1000, "Bomb killer 250", " Kill 250 enemies with bomb tower");
achievment(26, lifeBox.achievments.a26, player.built_towers, 25, 1500, "Builder 25", " Build 25 towers");
achievment(27, lifeBox.achievments.a27, player.sold_towers, 25, 1000, "Seller 25", " Sell 25 towers");
achievment(28, lifeBox.achievments.a28, player.shock_kills, 100, 2500, "Shock killer 100", " Kill 100 enemies with shock tower");
achievment(29, lifeBox.achievments.a29, player.gold_digger, 2500, 1000, "Gold digger 2500", " Earn $2500 with gold towers");
achievment(30, lifeBox.achievments.a30, player.upgrades, 100, 2500, "Upgrader 100", " Buy 100 upgrades");
achievment(31, lifeBox.achievments.a31, player.levels, 10, 250, "Level Up 10", " Level Up 10 times");
achievment(32, lifeBox.achievments.a32, player.levels, 25, 500, "Level Up 25", " Level Up 25 times");
achievment(33, lifeBox.achievments.a33, player.levels, 50, 1000, "Level Up 50", " Level Up 50 times");
achievment(34, lifeBox.achievments.a34, player.fire_u, 5, 500, "Fire Upgrades", " Upgrade fire to level 5");
achievment(35, lifeBox.achievments.a35, player.poison_u, 5, 500, "Poison upgrades", " Upgrade Poisons to level 5");
achievment(36, lifeBox.achievments.a36, player.cannon_u, 5, 500, "Cannoneer", " Upgrade Cannons to level 5");
achievment(37, lifeBox.achievments.a37, player.gold_u, 5, 500, "Gold Tower", " Upgrade Gold Tower skill to level 5");
achievment(38, lifeBox.achievments.a38, player.cash_u, 5, 500, "Collector", " Upgrade Cash from enemies to level 5");
achievment(39, lifeBox.achievments.a39, player.xp_u, 5, 500, "Skiller", " Upgrade XP gain to level 5");
achievment(40, lifeBox.achievments.a40, player.damage_u, 5, 500, "Damager", " Upgrade damage to level 5");
achievment(41, lifeBox.achievments.a41, player.xp2_u, 5, 500, "Technology", "Upgrade Automatic upgrades to level 5");
achievment(42, lifeBox.achievments.a42, player.slow_u, 5, 500, "Frosty", "Upgrade Frost tower to level 5");
achievment(43, lifeBox.achievments.a43, player.shock_u, 5, 500, "EMP", "Upgrade Shock tower to level 5");
achievment(44, lifeBox.achievments.a44, player.levels, 100, 2500, "Level Up 100", " Level Up 100 times");
achievment(45, lifeBox.achievments.a45, _root.wave, 26, 500, "Half time", "Survive 25 waves");
achievment(46, lifeBox.achievments.a46, player.built_towers, 50, 2500, "Builder 50", "Build 50 towers");
achievment(47, lifeBox.achievments.a47, _root.wave, 49, 5000, "Final round", "Get to final Boss");
achievment(48, lifeBox.achievments.a48, player.shock_kills, 250, 5000, "Shock killer 250", " Kill 250 enemies with Shock tower");
achievment(49, lifeBox.achievments.a49, player.gold_digger, 5000, 1500, "Gold digger 5000", " Earn $5000 with gold towers");
achievment(50, lifeBox.achievments.a50, player.kills, 600, 2500, "Killer", " Kill 600 enemies");
}
function showAch(txt1, bonus, num) {
lifeBox.ach.txt1.text = txt1;
lifeBox.ach.txt2.text = "+$" + bonus;
lifeBox.ach._visible = true;
lifeBox.ach.del = 50;
lifeBox.ach._alpha = 100;
lifeBox.ach.big_ico.ico.gotoAndStop(num);
}
function hideAch(obj) {
obj.onEnterFrame = function () {
this.del--;
if (this._xscale < 100) {
this._xscale = this._xscale + 10;
this._yscale = this._yscale + 10;
}
if (this._xscale > 100) {
this._xscale = 100;
this._yscale = 100;
}
if ((this._xscale > 99) && (this.del < 1)) {
this._alpha = this._alpha - 3;
}
if (this._alpha < 30) {
this._visible = false;
}
};
}
function sounds(obj) {
snd = new Sound();
obj.onPress = function () {
if (_root.sound_volume == 100) {
_root.sound_volume = 0;
this.gotoAndStop(2);
} else {
_root.sound_volume = 100;
this.gotoAndStop(1);
}
};
obj.onEnterFrame = function () {
snd.setVolume(_root.sound_volume);
if (_root.sound_volume == 0) {
this.gotoAndStop(2);
} else if (_root.sound_volume == 100) {
this.gotoAndStop(1);
}
};
}
function end_game(obj) {
obj.no.onRelease = function () {
this._parent._visible = false;
};
obj.yes.onRelease = function () {
clearInterval(spawn);
removeMovieClip(menu1);
removeMovieClip(menu2);
removeMovieClip(menu3);
removeMovieClip(w_man);
removeMovieClip(bg);
removeMovieClip(lifeBox);
rangeCircle.removeMovieClip();
_root.tower_stats_mc.removeMovieClip();
_root.tower_name = "";
_root.creep_stats_mc.removeMovieClip();
removeMovieClip(tower_on_mouse_over);
path.dispose();
_root.placeTower = false;
_root.selectedTower = "";
_root.towerNum = -1;
towerHold.removeMovieClip();
rangeCircle.removeMovieClip();
t = 1;
while (t <= numTowers) {
_root.t_name = _root["tower_" + t];
removeMovieClip(_root.t_name);
t++;
}
_root.jumpable = true;
_root.gotoAndStop(10);
};
}
function submit_game(obj) {
obj.yes.onRelease = function () {
clearInterval(spawn);
removeMovieClip(menu1);
removeMovieClip(menu2);
removeMovieClip(menu3);
removeMovieClip(w_man);
removeMovieClip(bg);
removeMovieClip(lifeBox);
rangeCircle.removeMovieClip();
_root.tower_stats_mc.removeMovieClip();
_root.tower_name = "";
_root.creep_stats_mc.removeMovieClip();
removeMovieClip(tower_on_mouse_over);
path.dispose();
_root.placeTower = false;
_root.selectedTower = "";
_root.towerNum = -1;
towerHold.removeMovieClip();
rangeCircle.removeMovieClip();
t = 1;
while (t <= numTowers) {
_root.t_name = _root["tower_" + t];
removeMovieClip(_root.t_name);
t++;
}
if (_root.act_level == 1) {
if (hc == 1) {
_root.kongregateStats.submit("HighScore", _root.tmp_skore);
MindJoltAPI.service.submitScore(_root.tmp_skore, "level1");
var _local3 = {n:[13, 2, 15, 8, 11, 6, 2, 8, 4, 11, 2, 7, 12, 7, 14, 3], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var _local4 = _local3.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:_local4, score:_root.tmp_skore});
} else {
_root.kongregateStats.submit("Hardcore1", _root.tmp_skore);
MindJoltAPI.service.submitScore(_root.tmp_skore, "hardcore1");
var _local3 = {n:[13, 13, 10, 5, 11, 8, 15, 4, 15, 12, 3, 11, 10, 4, 11, 8], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var _local4 = _local3.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:_local4, score:_root.tmp_skore});
}
} else if (_root.act_level == 2) {
if (hc == 1) {
_root.kongregateStats.submit("HighScore2", _root.tmp_skore);
MindJoltAPI.service.submitScore(_root.tmp_skore, "level2");
var _local3 = {n:[6, 9, 14, 8, 6, 15, 5, 5, 15, 9, 3, 15, 10, 9, 8, 13], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var _local4 = _local3.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:_local4, score:_root.tmp_skore});
} else {
_root.kongregateStats.submit("Hardcore2", _root.tmp_skore);
MindJoltAPI.service.submitScore(_root.tmp_skore, "hardcore2");
var _local3 = {n:[14, 4, 15, 5, 0, 4, 1, 11, 14, 7, 15, 9, 10, 12, 8, 4], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var _local4 = _local3.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:_local4, score:_root.tmp_skore});
}
} else if (_root.act_level == 3) {
if (hc == 1) {
_root.kongregateStats.submit("HighScore3", _root.tmp_skore);
MindJoltAPI.service.submitScore(_root.tmp_skore, "level3");
var _local3 = {n:[9, 11, 12, 14, 15, 15, 6, 1, 2, 13, 7, 14, 2, 14, 15, 15], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var _local4 = _local3.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:_local4, score:_root.tmp_skore});
} else {
_root.kongregateStats.submit("Hardcore3", _root.tmp_skore);
MindJoltAPI.service.submitScore(_root.tmp_skore, "hardcore3");
var _local3 = {n:[5, 3, 0, 4, 0, 3, 3, 0, 12, 3, 7, 13, 0, 10, 9, 7], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var _local4 = _local3.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:_local4, score:_root.tmp_skore});
}
}
};
obj.no.onRelease = function () {
clearInterval(spawn);
removeMovieClip(menu1);
removeMovieClip(menu2);
removeMovieClip(menu3);
removeMovieClip(w_man);
removeMovieClip(bg);
removeMovieClip(lifeBox);
rangeCircle.removeMovieClip();
_root.tower_stats_mc.removeMovieClip();
_root.tower_name = "";
_root.creep_stats_mc.removeMovieClip();
removeMovieClip(tower_on_mouse_over);
path.dispose();
_root.placeTower = false;
_root.selectedTower = "";
_root.towerNum = -1;
towerHold.removeMovieClip();
rangeCircle.removeMovieClip();
t = 1;
while (t <= numTowers) {
_root.t_name = _root["tower_" + t];
removeMovieClip(_root.t_name);
t++;
}
_root.jumpable = true;
_root.gotoAndStop(10);
};
}
if (_root.jumpable == false) {
_root.gotoAndStop(2);
} else {
_root.jumpable = false;
}
path_name = "path" + _root.act_level;
var path = flash.display.BitmapData.loadBitmap(path_name);
var towerColl = flash.display.BitmapData.loadBitmap("coll");
bg_name = "background" + _root.act_level;
this.attachMovie(bg_name, "bg", this.bg.getNextHighestDepth());
if (_root.race == 1) {
this.attachMovie("menu1", "menu1", this.getNextHighestDepth());
menu1._x = 0;
menu1._y = 420;
} else if (_root.race == 2) {
this.attachMovie("menu2", "menu2", this.getNextHighestDepth());
menu2._x = 0;
menu2._y = 390;
} else if (_root.race == 3) {
this.attachMovie("menu3", "menu3", this.getNextHighestDepth());
menu3._x = 0;
menu3._y = 390;
}
snd.stop();
delete snd;
snd = new Sound();
snd.attachSound("lvl1.wav");
snd.start(0, 99);
if (_root.act_level == 3) {
snd2 = new Sound();
snd2.attachSound("windy.wav");
snd2.setVolume(50);
snd2.start(0, 999);
}
_root.sound_playing = false;
this.attachMovie("tower_stats_onmouseover", "tower_on_mouse_over", this.getNextHighestDepth(), {_x:480, _y:30});
menu1.swapDepths(_root.getNextHighestDepth());
levels = [0, 10, 25, 50, 100, 150, 200, 300, 400, 500, 650, 800, 1000, 1100, 1250, 1350, 1500, 1750, 2000, 5000];
towers = new Array();
enemys = new Array();
creeps = new Array();
i = 1;
while (i <= 100) {
creeps[i] = new Array();
i++;
}
h = 0;
creeps[1][0] = ["creeps_2", 50 * hc, 12, 0.4, 1, 0, 0, 0, 0, 10, 3000, "Creep 1", "10 enemies, low HP"];
creeps[1][1] = ["creeps_2", 100 * hc, 13, 0.8, 10, 0, 0, 0, 0, 10, 2000, "dylina", "10 enemies with low HP & basic defense"];
creeps[1][2] = ["creeps_4", 150 * hc, 15, 0.8, 10, 0, 0, 0, 0.4, 10, 1500, "jmeno", "10 regenerating enemies"];
creeps[1][3] = ["creeps_2", 250 * hc, 16, 0.8, 20, 0, 0, 0, 0, 10, 3000, "jmeno", "10 enemies with low HP & defense skill"];
creeps[1][4] = ["creeps_4", 350 * hc, 17, 0.4, 10, 0, 0, 0, 0.2, 10, 800, "jmeno", "10 slow enemies with regeneration"];
creeps[1][5] = ["creeps_5", 550 * hc, 18, 0.5, 10, 1, 0, 0, 0, 25, 2000, "jmeno", "25 slow enemies, fire resistant"];
creeps[1][6] = ["creeps_4", 750 * hc, 19, 1.5, 1, 1, 2, 0, 0, 15, 4000, "jmeno", "15 fast enemies, poison resistant"];
creeps[1][7] = ["creeps_3", 900 * hc, 20, 0.7, 5, 2, 2, 0, 1, 20, 2000, "jmeno", "20 slow enemies with poison & fire resist"];
creeps[1][8] = ["creeps_2", 1000 * hc, 20, 0.5, 5, 1, 1, 1, 1, 40, 1000, "jmeno", "40 slow weak enemies"];
creeps[1][9] = ["creeps_boss_1", 2500 * hc, 50, 0.5, 15, 1, 1, 1, 2, 10, 5000, "Boss 1", "10x Boss 1 - high HP & regeneration & resistances"];
creeps[1][10] = ["creeps_8", 2000 * hc, 20, 0.8, 10, 1.5, 1, 10, 1, 10, 1000, "Creep 1", "10 common enemies"];
creeps[1][11] = ["creeps_9", 2500 * hc, 21, 1.25, 10, 1, 1, 10, 2, 10, 2000, "dylina", "10 fast regenerating enemies"];
creeps[1][12] = ["creeps_61", 3000 * hc, 23, 0.8, 40, 1, 1, 0, 2, 10, 1500, "jmeno", "10 common enemies with defense skill"];
creeps[1][13] = ["creeps_6", 3500 * hc, 25, 0.4, 100, 0, 0, 0, 0.1, 30, 4000, "jmeno", "30 very slow enemies with high armor"];
creeps[1][14] = ["creeps_7", 5000 * hc, 26, 1, 10, 3, 0, 0, 0.1, 10, 800, "jmeno", "10 enemies with fire resistance"];
creeps[1][15] = ["creeps_9", 7000 * hc, 27, 0.75, 10, 0, 3, 0, 2, 25, 2000, "jmeno", "25 enemies with poison resist and regeneration"];
creeps[1][16] = ["creeps_8", 9500 * hc, 28, 0.7, 15, 0, 0, 0, 0.2, 15, 3000, "jmeno", "15 slow enemies with high armor"];
creeps[1][17] = ["creeps_7", 11000 * hc, 29, 0.8, 10, 5, 0, 0, 0.2, 20, 4000, "jmeno", "20 enemies with high fire resist & low regen"];
creeps[1][18] = ["creeps_61", 13000 * hc, 30, 1, 10, 1, 1, 10, 2, 20, 2000, "jmeno", "20 strong enemies with fire, poison & defense skill, also regen"];
creeps[1][19] = ["creeps_boss_2", 50000 * hc, 100, 0.5, 10, 2, 2, 30, 4, 10, 5000, "Boss 2", "10x Boss 2 - slow, high HP & regeneration & resistances"];
creeps[1][20] = ["creeps_11", 15000 * hc, 30, 1, 10, 5, 0, 0, 0, 10, 1000, "Creep 1", "10 enemies with fire resist"];
creeps[1][21] = ["creeps_12", 17000 * hc, 30, 1.25, 10, 0, 0, 0, 0, 15, 3500, "dylina", "15 fast enemies"];
creeps[1][22] = ["creeps_10", 20000 * hc, 30, 0.5, 50, 0, 0, 0, 0.2, 25, 800, "jmeno", "25 enemies slow crowded enemies with high armor"];
creeps[1][23] = ["creeps_15", 24000 * hc, 30, 1, 40, 0, 0, 0, 4, 10, 1000, "jmeno", "10 enemies with defense skill & regeneration"];
creeps[1][24] = ["creeps_13", 28000 * hc, 30, 0.7, 20, 0, 5, 0, 0.2, 40, 3000, "jmeno", "40 enemies with poison resist"];
creeps[1][25] = ["creeps_12", 32000 * hc, 32, 1.25, 20, 0, 0, 0, 0.2, 15, 2500, "jmeno", "15 fast enemies"];
creeps[1][26] = ["creeps_10", 36000 * hc, 35, 0.7, 30, 0, 0, 0, 8, 15, 2000, "jmeno", "15 slow enemies with regeneration"];
creeps[1][27] = ["creeps_11", 40000 * hc, 37, 1, 30, 10, 0, 0, 0.2, 20, 2000, "jmeno", "20 enemies with fire resist"];
creeps[1][28] = ["creeps_15", 50000 * hc, 40, 1.34, 30, 2, 2, 2, 1, 20, 2000, "jmeno", "20 fast strong enemies"];
creeps[1][29] = ["creeps_boss_4", 100000 * hc, 100, 0.5, 150, 10, 10, 0, 16, 10, 5000, "Boss 3", "10x Boss 3 - high HP & high regeneration & high resistances"];
creeps[1][30] = ["creeps_11", 40000 * hc, 30, 1, 50, 15, 0, 0, 2, 15, 4000, "Creep 1", "15 fire resistant enemies"];
creeps[1][31] = ["creeps_13", 45000 * hc, 31, 0.8, 50, 0, 15, 0, 2, 15, 1000, "dylina", "15 poison resistant enemies"];
creeps[1][32] = ["creeps_10", 50000 * hc, 32, 1.25, 50, 0, 0, 0, 2, 15, 1500, "jmeno", "15 fast enemies"];
creeps[1][33] = ["creeps_13", 55000 * hc, 33, 0.7, 50, 0, 0, 0, 10, 15, 3000, "jmeno", "15 regenerating enemies"];
creeps[1][34] = ["creeps_10", 60000 * hc, 38, 1, 500, 0, 0, 0, 1, 15, 1000, "jmeno", "15 armored enemies"];
creeps[1][35] = ["creeps_12", 70000 * hc, 40, 1.5, 550, 2, 2, 2, 2, 15, 4000, "jmeno", "15 fast armored enemies"];
creeps[1][36] = ["creeps_13", 80000 * hc, 42, 1, 250, 10, 10, 5, 4, 15, 2000, "jmeno", "15 strong enemies"];
creeps[1][37] = ["creeps_15", 90000 * hc, 44, 0.7, 600, 5, 5, 0, 4, 20, 2000, "jmeno", "20 slow armored enemies"];
creeps[1][38] = ["creeps_11", 100000 * hc, 50, 0.6, 150, 0, 0, 0, 0, 20, 2000, "jmeno", "20 fire & poison resistant enemies"];
creeps[1][39] = ["creeps_boss_5", 500000 * hc, 200, 0.5, 500, 20, 20, 20, 32, 10, 5000, "Boss 4", "10x Boss 4 - high HP & high regeneration & high resistances & armor"];
creeps[1][40] = ["creeps_15", 150000 * hc, 40, 0.7, 250, 10, 10, 10, 8, 10, 1000, "Creep 1", "10 strong enemies"];
creeps[1][41] = ["creeps_11", 175000 * hc, 41, 0.8, 100, 1000, 10, 0, 2, 10, 2000, "dylina", "10 fire imune enemies"];
creeps[1][42] = ["creeps_12", 200000 * hc, 42, 1.25, 100, 10, 10, 10, 10, 10, 3500, "jmeno", "10 fast enemies"];
creeps[1][43] = ["creeps_10", 225000 * hc, 43, 0.8, 500, 5, 5, 5, 10, 10, 1000, "jmeno", "10 highly armored enemies"];
creeps[1][44] = ["creeps_13", 250000 * hc, 44, 0.8, 200, 0, 1000, 0, 0.1, 10, 4000, "jmeno", "10 poison imune enemies"];
creeps[1][45] = ["creeps_12", 300000 * hc, 45, 1.35, 200, 0, 0, 0, 20, 10, 2000, "jmeno", "10 fast regenerating enemies"];
creeps[1][46] = ["creeps_10", 350000 * hc, 46, 0.6, 250, 10, 10, 10, 10, 15, 2000, "jmeno", "15 slow strong enemies"];
creeps[1][47] = ["creeps_11", 400000 * hc, 47, 0.4, 10000, 10, 10, 10, 10, 10, 2000, "jmeno", "10 super armored enemies"];
creeps[1][48] = ["creeps_boss_1", 500000 * hc, 50, 0.8, 10, 10, 10, 10, 10, 20, 3000, "jmeno", "20 easy enemies before last boss ;-)"];
creeps[1][49] = ["creeps_boss_3", 10000000 * hc, 500, 0.5, 1000, 50, 50, 50, 80, 10, 5000, "Boss 5", "10xBoss 1 - high HP & high regeneration & high resistances"];
creeps[2][0] = ["creeps_2", 50 * hc, 10, 0.8, 1, 0, 0, 0, 0, 10, 1000, "Creep 1", "10 enemies, low HP"];
creeps[2][1] = ["creeps_2", 100 * hc, 11, 0.8, 10, 0, 0, 0, 0, 10, 2000, "dylina", "10 enemies with low HP & basic defense"];
creeps[2][2] = ["creeps_13", 150 * hc, 12, 0.8, 10, 0, 0, 0, 0.4, 10, 1500, "jmeno", "10 regenerating enemies"];
creeps[2][3] = ["creeps_2", 250 * hc, 13, 0.8, 20, 0, 0, 0, 0, 10, 3000, "jmeno", "10 enemies with low HP & defense skill"];
creeps[2][4] = ["creeps_13", 350 * hc, 14, 0.4, 10, 0, 0, 0, 0.2, 10, 800, "jmeno", "10 slow enemies with regeneration"];
creeps[2][5] = ["creeps_5", 550 * hc, 15, 0.5, 10, 1, 0, 0, 0, 25, 2000, "jmeno", "25 slow enemies, fire resistant"];
creeps[2][6] = ["creeps_13", 750 * hc, 16, 1.5, 1, 1, 2, 0, 0, 15, 4000, "jmeno", "15 fast enemies, poison resistant"];
creeps[2][7] = ["creeps_5", 900 * hc, 18, 0.7, 5, 2, 2, 0, 1, 20, 2000, "jmeno", "20 slow enemies with poison & fire resist"];
creeps[2][8] = ["creeps_2", 1000 * hc, 19, 0.5, 5, 1, 1, 1, 1, 40, 1000, "jmeno", "40 slow weak enemies"];
creeps[2][9] = ["creeps_3", 2500 * hc, 50, 0.5, 15, 1, 1, 1, 2, 10, 5000, "Boss 1", "10x Boss 1 - high HP & regeneration & resistances"];
creeps[2][10] = ["creeps_2", 2000 * hc, 20, 0.8, 10, 1.5, 1, 10, 1, 10, 1000, "Creep 1", "10 common enemies"];
creeps[2][11] = ["creeps_2", 2500 * hc, 22, 1.25, 10, 1, 1, 10, 2, 10, 2000, "dylina", "10 fast regenerating enemies"];
creeps[2][12] = ["creeps_4", 3000 * hc, 24, 0.8, 40, 1, 1, 0, 2, 10, 1500, "jmeno", "10 common enemies with defense skill"];
creeps[2][13] = ["creeps_2", 3500 * hc, 25, 0.4, 100, 0, 0, 0, 0.1, 30, 4000, "jmeno", "30 very slow enemies with high armor"];
creeps[2][14] = ["creeps_5", 5000 * hc, 26, 1, 10, 3, 0, 0, 0.1, 10, 800, "jmeno", "10 enemies with fire resistance"];
creeps[2][15] = ["creeps_4", 7000 * hc, 27, 0.75, 10, 0, 3, 0, 2, 25, 2000, "jmeno", "25 enemies with poison resist and regeneration"];
creeps[2][16] = ["creeps_2", 9500 * hc, 27, 0.7, 15, 0, 0, 0, 0.2, 15, 3000, "jmeno", "15 slow enemies with high armor"];
creeps[2][17] = ["creeps_5", 11000 * hc, 27, 0.8, 10, 5, 0, 0, 0.2, 20, 4000, "jmeno", "20 enemies with high fire resist & low regen"];
creeps[2][18] = ["creeps_4", 13000 * hc, 30, 1, 10, 1, 1, 10, 2, 20, 2000, "jmeno", "20 strong enemies with fire, poison & defense skill, also regen"];
creeps[2][19] = ["creeps_3", 50000 * hc, 100, 0.5, 10, 2, 2, 30, 4, 10, 5000, "Boss 2", "10x Boss 2 - slow, high HP & regeneration & resistances"];
creeps[2][20] = ["creeps_2", 15000 * hc, 25, 1, 10, 5, 0, 0, 0, 10, 1000, "Creep 1", "10 enemies with fire resist"];
creeps[2][21] = ["creeps_2", 17000 * hc, 30, 1.25, 10, 0, 0, 0, 0, 15, 3500, "dylina", "15 fast enemies"];
creeps[2][22] = ["creeps_5", 20000 * hc, 30, 0.5, 50, 0, 0, 0, 0.2, 25, 800, "jmeno", "25 enemies slow crowded enemies with high armor"];
creeps[2][23] = ["creeps_2", 24000 * hc, 30, 1, 40, 0, 0, 0, 4, 10, 1000, "jmeno", "10 enemies with defense skill & regeneration"];
creeps[2][24] = ["creeps_4", 28000 * hc, 35, 0.7, 20, 0, 5, 0, 0.2, 40, 3000, "jmeno", "40 enemies with poison resist"];
creeps[2][25] = ["creeps_2", 32000 * hc, 37, 1.25, 20, 0, 0, 0, 0.2, 15, 2500, "jmeno", "15 fast enemies"];
creeps[2][26] = ["creeps_5", 36000 * hc, 38, 0.7, 30, 0, 0, 0, 8, 15, 2000, "jmeno", "15 slow enemies with regeneration"];
creeps[2][27] = ["creeps_2", 40000 * hc, 40, 1, 30, 10, 0, 0, 0.2, 20, 2000, "jmeno", "20 enemies with fire resist"];
creeps[2][28] = ["creeps_4", 50000 * hc, 40, 1.34, 30, 2, 2, 2, 1, 20, 2000, "jmeno", "20 fast strong enemies"];
creeps[2][29] = ["creeps_3", 100000 * hc, 100, 0.5, 150, 10, 10, 0, 16, 10, 5000, "Boss 3", "10x Boss 3 - high HP & high regeneration & high resistances"];
creeps[2][30] = ["creeps_5", 40000 * hc, 35, 1, 50, 15, 0, 0, 2, 15, 4000, "Creep 1", "15 fire resistant enemies"];
creeps[2][31] = ["creeps_4", 45000 * hc, 35, 0.8, 50, 0, 15, 0, 2, 15, 1000, "dylina", "15 poison resistant enemies"];
creeps[2][32] = ["creeps_2", 50000 * hc, 35, 1.25, 50, 0, 0, 0, 2, 15, 1500, "jmeno", "15 fast enemies"];
creeps[2][33] = ["creeps_4", 55000 * hc, 35, 0.7, 50, 0, 0, 0, 10, 15, 3000, "jmeno", "15 regenerating enemies"];
creeps[2][34] = ["creeps_2", 60000 * hc, 40, 1, 500, 0, 0, 0, 1, 15, 1000, "jmeno", "15 armored enemies"];
creeps[2][35] = ["creeps_5", 70000 * hc, 40, 1.5, 550, 2, 2, 2, 2, 15, 4000, "jmeno", "15 fast armored enemies"];
creeps[2][36] = ["creeps_2", 80000 * hc, 42, 1, 250, 10, 10, 5, 4, 15, 2000, "jmeno", "15 strong enemies"];
creeps[2][37] = ["creeps_5", 90000 * hc, 44, 0.7, 600, 5, 5, 0, 4, 20, 2000, "jmeno", "20 slow armored enemies"];
creeps[2][38] = ["creeps_4", 100000 * hc, 50, 0.6, 150, 0, 0, 0, 0, 20, 2000, "jmeno", "20 fire & poison resistant enemies"];
creeps[2][39] = ["creeps_3", 500000 * hc, 200, 0.5, 500, 20, 20, 20, 32, 10, 5000, "Boss 4", "10x Boss 4 - high HP & high regeneration & high resistances & armor"];
creeps[2][40] = ["creeps_2", 150000 * hc, 40, 0.7, 250, 10, 10, 10, 8, 10, 1000, "Creep 1", "10 strong enemies"];
creeps[2][41] = ["creeps_5", 175000 * hc, 41, 0.8, 100, 1000, 10, 0, 2, 10, 2000, "dylina", "10 fire imune enemies"];
creeps[2][42] = ["creeps_5", 200000 * hc, 42, 1.25, 100, 10, 10, 10, 10, 10, 3500, "jmeno", "10 fast enemies"];
creeps[2][43] = ["creeps_2", 225000 * hc, 43, 0.8, 500, 5, 5, 5, 10, 10, 1000, "jmeno", "10 highly armored enemies"];
creeps[2][44] = ["creeps_4", 250000 * hc, 44, 0.8, 200, 0, 1000, 0, 0.1, 10, 4000, "jmeno", "10 poison imune enemies"];
creeps[2][45] = ["creeps_2", 300000 * hc, 45, 1.35, 200, 0, 0, 0, 20, 10, 2000, "jmeno", "10 fast regenerating enemies"];
creeps[2][46] = ["creeps_5", 350000 * hc, 46, 0.6, 250, 10, 10, 10, 10, 15, 2000, "jmeno", "15 slow strong enemies"];
creeps[2][47] = ["creeps_2", 400000 * hc, 47, 0.4, 10000, 10, 10, 10, 10, 10, 2000, "jmeno", "10 super armored enemies"];
creeps[2][48] = ["creeps_4", 500000 * hc, 50, 0.8, 10, 10, 10, 10, 10, 20, 3000, "jmeno", "20 easy enemies before last boss ;-)"];
creeps[2][49] = ["creeps_3", 10000000 * hc, 500, 0.5, 1000, 50, 50, 50, 80, 10, 5000, "Boss 5", "10xBoss 1 - high HP & high regeneration & high resistances"];
creeps[3][0] = ["creeps_2", 50 * hc, 11, 0.8, 1, 0, 0, 0, 0, 10, 1000, "Creep 1", "10 enemies, low HP"];
creeps[3][1] = ["creeps_2", 100 * hc, 12, 0.8, 10, 0, 0, 0, 0, 10, 2000, "dylina", "10 enemies with low HP & basic defense"];
creeps[3][2] = ["creeps_4", 150 * hc, 13, 0.8, 10, 0, 0, 0, 0.4, 10, 1500, "jmeno", "10 regenerating enemies"];
creeps[3][3] = ["creeps_2", 250 * hc, 14, 0.8, 20, 0, 0, 0, 0, 10, 3000, "jmeno", "10 enemies with low HP & defense skill"];
creeps[3][4] = ["creeps_4", 350 * hc, 15, 0.4, 10, 0, 0, 0, 0.2, 10, 800, "jmeno", "10 slow enemies with regeneration"];
creeps[3][5] = ["creeps_5", 550 * hc, 17, 0.5, 5, 1, 0, 0, 0, 25, 2000, "jmeno", "25 slow enemies, fire resistant"];
creeps[3][6] = ["creeps_4", 750 * hc, 18, 1.5, 1, 1, 2, 0, 0, 15, 4000, "jmeno", "15 fast enemies, poison resistant"];
creeps[3][7] = ["creeps_5", 900 * hc, 19, 0.7, 5, 2, 2, 0, 1, 20, 2000, "jmeno", "20 slow enemies with poison & fire resist"];
creeps[3][8] = ["creeps_2", 1000 * hc, 20, 0.5, 5, 1, 1, 1, 1, 40, 1000, "jmeno", "40 slow weak enemies"];
creeps[3][9] = ["creeps_3", 2500 * hc, 50, 0.5, 15, 1, 1, 1, 2, 10, 5000, "Boss 1", "10x Boss 1 - high HP & regeneration & resistances"];
creeps[3][10] = ["creeps_2", 2000 * hc, 25, 0.8, 10, 1.5, 1, 10, 1, 10, 1000, "Creep 1", "10 common enemies"];
creeps[3][11] = ["creeps_2", 2500 * hc, 25, 1.25, 10, 1, 1, 10, 2, 10, 2000, "dylina", "10 fast regenerating enemies"];
creeps[3][12] = ["creeps_4", 3000 * hc, 25, 0.8, 40, 1, 1, 0, 2, 10, 1500, "jmeno", "10 common enemies with defense skill"];
creeps[3][13] = ["creeps_2", 3500 * hc, 25, 0.4, 100, 0, 0, 0, 0.1, 30, 4000, "jmeno", "30 very slow enemies with high armor"];
creeps[3][14] = ["creeps_5", 5000 * hc, 25, 1, 10, 3, 0, 0, 0.1, 10, 800, "jmeno", "10 enemies with fire resistance"];
creeps[3][15] = ["creeps_4", 7000 * hc, 25, 0.75, 10, 0, 3, 0, 2, 25, 2000, "jmeno", "25 enemies with poison resist and regeneration"];
creeps[3][16] = ["creeps_2", 9500 * hc, 26, 0.7, 15, 0, 0, 0, 0.2, 15, 3000, "jmeno", "15 slow enemies with high armor"];
creeps[3][17] = ["creeps_5", 11000 * hc, 27, 0.8, 10, 5, 0, 0, 0.2, 20, 4000, "jmeno", "20 enemies with high fire resist & low regen"];
creeps[3][18] = ["creeps_4", 13000 * hc, 30, 1, 10, 1, 1, 10, 2, 20, 2000, "jmeno", "20 strong enemies with fire, poison & defense skill, also regen"];
creeps[3][19] = ["creeps_3", 50000 * hc, 100, 0.5, 10, 2, 2, 30, 4, 10, 5000, "Boss 2", "10x Boss 2 - slow, high HP & regeneration & resistances"];
creeps[3][20] = ["creeps_2", 15000 * hc, 25, 1, 10, 5, 0, 0, 0, 10, 1000, "Creep 1", "10 enemies with fire resist"];
creeps[3][21] = ["creeps_2", 17000 * hc, 25, 1.25, 10, 0, 0, 0, 0, 15, 3500, "dylina", "15 fast enemies"];
creeps[3][22] = ["creeps_5", 20000 * hc, 25, 0.5, 50, 0, 0, 0, 0.2, 25, 800, "jmeno", "25 enemies slow crowded enemies with high armor"];
creeps[3][23] = ["creeps_2", 24000 * hc, 30, 1, 40, 0, 0, 0, 4, 10, 1000, "jmeno", "10 enemies with defense skill & regeneration"];
creeps[3][24] = ["creeps_4", 28000 * hc, 30, 0.7, 20, 0, 5, 0, 0.2, 40, 3000, "jmeno", "40 enemies with poison resist"];
creeps[3][25] = ["creeps_2", 32000 * hc, 35, 1.25, 20, 0, 0, 0, 0.2, 15, 2500, "jmeno", "15 fast enemies"];
creeps[3][26] = ["creeps_5", 36000 * hc, 35, 0.7, 30, 0, 0, 0, 8, 15, 2000, "jmeno", "15 slow enemies with regeneration"];
creeps[3][27] = ["creeps_2", 40000 * hc, 40, 1, 30, 10, 0, 0, 0.2, 20, 2000, "jmeno", "20 enemies with fire resist"];
creeps[3][28] = ["creeps_4", 50000 * hc, 40, 1.34, 30, 2, 2, 2, 1, 20, 2000, "jmeno", "20 fast strong enemies"];
creeps[3][29] = ["creeps_3", 100000 * hc, 100, 0.5, 150, 10, 10, 0, 16, 10, 5000, "Boss 3", "10x Boss 3 - high HP & high regeneration & high resistances"];
creeps[3][30] = ["creeps_5", 40000 * hc, 30, 1, 50, 15, 0, 0, 2, 15, 4000, "Creep 1", "15 fire resistant enemies"];
creeps[3][31] = ["creeps_4", 45000 * hc, 31, 0.8, 50, 0, 15, 0, 2, 15, 1000, "dylina", "15 poison resistant enemies"];
creeps[3][32] = ["creeps_2", 50000 * hc, 32, 1.25, 50, 0, 0, 0, 2, 15, 1500, "jmeno", "15 fast enemies"];
creeps[3][33] = ["creeps_4", 55000 * hc, 33, 0.7, 50, 0, 0, 0, 10, 15, 3000, "jmeno", "15 regenerating enemies"];
creeps[3][34] = ["creeps_2", 60000 * hc, 38, 1, 500, 0, 0, 0, 1, 15, 1000, "jmeno", "15 armored enemies"];
creeps[3][35] = ["creeps_5", 70000 * hc, 40, 1.5, 550, 2, 2, 2, 2, 15, 4000, "jmeno", "15 fast armored enemies"];
creeps[3][36] = ["creeps_2", 80000 * hc, 42, 1, 250, 10, 10, 5, 4, 15, 2000, "jmeno", "15 strong enemies"];
creeps[3][37] = ["creeps_5", 90000 * hc, 44, 0.7, 600, 5, 5, 0, 4, 20, 2000, "jmeno", "20 slow armored enemies"];
creeps[3][38] = ["creeps_4", 100000 * hc, 50, 0.6, 150, 0, 0, 0, 0, 20, 2000, "jmeno", "20 fire & poison resistant enemies"];
creeps[3][39] = ["creeps_3", 500000 * hc, 200, 0.5, 500, 20, 20, 20, 32, 10, 5000, "Boss 4", "10x Boss 4 - high HP & high regeneration & high resistances & armor"];
creeps[3][40] = ["creeps_2", 150000 * hc, 40, 0.7, 250, 10, 10, 10, 8, 10, 1000, "Creep 1", "10 strong enemies"];
creeps[3][41] = ["creeps_5", 175000 * hc, 41, 0.8, 100, 1000, 10, 0, 2, 10, 2000, "dylina", "10 fire imune enemies"];
creeps[3][42] = ["creeps_5", 200000 * hc, 42, 1.25, 100, 10, 10, 10, 10, 10, 3500, "jmeno", "10 fast enemies"];
creeps[3][43] = ["creeps_2", 225000 * hc, 43, 0.8, 500, 5, 5, 5, 10, 10, 1000, "jmeno", "10 highly armored enemies"];
creeps[3][44] = ["creeps_4", 250000 * hc, 44, 0.8, 200, 0, 1000, 0, 0.1, 10, 4000, "jmeno", "10 poison imune enemies"];
creeps[3][45] = ["creeps_2", 300000 * hc, 45, 1.35, 200, 0, 0, 0, 20, 10, 2000, "jmeno", "10 fast regenerating enemies"];
creeps[3][46] = ["creeps_5", 350000 * hc, 46, 0.6, 250, 10, 10, 10, 10, 15, 2000, "jmeno", "15 slow strong enemies"];
creeps[3][47] = ["creeps_2", 400000 * hc, 47, 0.4, 10000, 10, 10, 10, 10, 10, 2000, "jmeno", "10 super armored enemies"];
creeps[3][48] = ["creeps_4", 500000 * hc, 50, 0.8, 10, 10, 10, 10, 10, 20, 3000, "jmeno", "20 easy enemies before last boss ;-)"];
creeps[3][49] = ["creeps_3", 10000000 * hc, 500, 0.5, 1000, 50, 50, 50, 80, 10, 5000, "Boss 5", "10xBoss 1 - high HP & high regeneration & high resistances"];
d = _root.damage_bonus_total;
f = _root.fire_bonus_total;
p = _root.pois_bonus_total;
m = _root.magic_bonus_total;
tr = new Array();
i = 0;
while (i < 20) {
tr[i] = [0, 1, 1, 1];
i++;
}
i = 1;
while (i <= 10) {
tr[i][1] = ((_root.tower_research[i][1] - 1) / 10) + 1;
tr[i][2] = 1 - ((_root.tower_research[i][2] - 1) / 10);
tr[i][3] = ((_root.tower_research[i][3] - 1) / 10) + 1;
i++;
}
player = new Object();
player.range_bonus = 0;
player.reload_bonus = 0;
player.damage_bonus = 0;
player.speed_bonus = 0;
player.fire_bonus = 0;
player.poison_bonus = 0;
player.slow_bonus = 0;
player.cash_bonus = 0;
player.shock_bonus = 0;
player.bomb_bonus = 0;
player.xp_bonus = 1;
player.gold_bonus = 0;
towerStats = new Array();
towerStats[0] = [100 + player.range_bonus, 20 + player.reload_bonus, 20 + player.damage_bonus, 10, "bullet", 10, 0, "Gun Tower", 150, "Basic gun tower", 0.1];
towerStats[1] = [150 + player.range_bonus, 30 + player.reload_bonus, 40 + player.damage_bonus, 8, "harpuna", 50, 0, "Harpun Tower", 250, "Harpun tower", 0.2];
towerStats[2] = [100 + player.range_bonus, 50 + player.reload_bonus, 50 + player.damage_bonus, 6, "bomb", 50, 0, "Cannon Tower", 500, "Cannon splash effect", 0.4];
towerStats[3] = [150 + player.range_bonus, 10 + player.reload_bonus, 25 + player.damage_bonus, 10, "bullet", 10, 0, "Machinegun Tower", 750, "Machinegun", 0.2];
towerStats[4] = [90 + player.range_bonus, 50 + player.reload_bonus, 20 + player.damage_bonus, 6, "poison", 1 + p, 5, "Poison Tower", 750, "Poisons enemies, long time effect", 0.2];
towerStats[5] = [100 + player.range_bonus, 60 + player.reload_bonus, 60 + player.damage_bonus, 5, "shock", 0.1 + m, 3, "Shock Tower", 750, "Shock enemies so they almost can't move", 0.2];
towerStats[6] = [120 + player.range_bonus, 40 + player.reload_bonus, 15 + player.damage_bonus, 3, "fire", 1 + f, 3, "Fire Tower", 400, "Fire tower", 0.5];
towerStats[7] = [100 + player.range_bonus, 25 + player.reload_bonus, 25 + player.damage_bonus, 5, "cash", 1, 0, "Golden Tower", 500, "Steal money from enemies", 0.05];
towerStats[8] = [140 + player.range_bonus, 50 + player.reload_bonus, 25 + player.damage_bonus, 6, "slow", 0.75, 3, "Slow Tower", 600, "Slow Tower", 0.02];
towerStats[9] = [70 + player.range_bonus, 15 + player.reload_bonus, 25 + player.damage_bonus, 4, "flame", 2 + f, 4, "Flame tower", 1000, "flame", 0.02];
towerStats[20] = [180, 30, 20, 8, "arrow", 10, 0, "Arrow Tower", 150, "lucistnici", 0.1];
towerStats[21] = [150, 75, 0, 8, "crossbowArrow", 50, 0, "Crossbow Tower", 250, "Harpun tower", 0.2];
towerStats[22] = [150, 30, 1, 8, "balistaArrow", 50, 0, "Balista Tower", 500, "balista", 0.4];
towerStats[23] = [80, 55, 0, 8, "flower_trn", 2, 4, "Flower Tower", 750, "kytka", 0.2];
towerStats[24] = [120, 60, 0, 8, "magic", 50, 0, "Magic Tower", 750, "mmagic", 0.2];
towerStats[25] = [100, 125, 60, 5, "roots", 0, 5, "Root Tower", 750, "Stops enemies", 0.2];
towerStats[26] = [60, 5, 5, 3, "fire", 1, 3, "Fire Tower", 400, "Fire tower", 0.5];
towerStats[27] = [100, 25, 25, 10, "cash", 1, 0, "Thief's Tower", 500, "Steal money from enemies", 0.05];
towerStats[28] = [140, 10, 25, 10, "slow", 0.75, 3, "Slow Tower", 600, "Slow Tower", 0.02];
towerStats[29] = [140, 5, 25, 4, "flame", 2, 4, "Flame tower", 1000, "flame", 0.02];
_root.tower_selected = false;
_root.tower_name = "";
placeTower = false;
numTowers = 0;
lives = 20;
_root.tmp_skore = 0;
_root.gold = (_root.base_gold_const + _root.start_cash_total) + 5000;
_root.gold = 1000;
_root.wave = 1;
_root.max_health = creeps[_root.act_level][0][1];
this.attachMovie("lifeBox", "lifeBox", this.getNextHighestDepth());
lifeBox._x = 0;
lifeBox._y = 0;
lifeBox.life.text = "Lives: " + lives;
lifeBox.wave.text = "Wave: " + _root.wave;
lifeBox.hp.text = "Enemy HP: " + _root.max_health;
waypoints = new Array();
i = 1;
while (i <= 50) {
waypoints[i] = new Array();
i++;
}
waypoints[1] = [[60, -30], [60, 360], [180, 360], [180, 120], [300, 120], [300, 60], [420, 60], [420, 360]];
waypoints[2] = [[60, -30], [60, 90], [420, 90], [420, 240], [120, 240], [120, 330], [270, 330], [270, 390]];
waypoints[3] = [[60, -30], [60, 150], [390, 150], [390, 270], [60, 270], [60, 390]];
waypoints[4] = [[240, -30], [240, 60], [60, 60], [60, 150], [420, 150], [420, 240], [60, 240], [60, 330], [450, 330]];
waypoints[5] = [[240, -30], [240, 150], [60, 150], [60, 360], [420, 360], [420, 180], [360, 180], [360, 60], [450, 60]];
levelTotal = 0;
max_waypoint = 0;
_root.game_speed = 1;
_root.creep_delay = creeps[_root.act_level][0][10];
spawn = setInterval(newCreep, _root.creep_delay);
menu1.tower1.onPress = function () {
if ((!_root.placeTower) && (_root.gold >= towerStats[0][8])) {
_root.placeTower = true;
_root.selectedTower = "bulletTower";
_root.towerNum = 0;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu1.tower2.onPress = function () {
if ((!_root.placeTower) && (_root.gold >= towerStats[1][8])) {
_root.placeTower = true;
_root.selectedTower = "harpunaTower";
_root.towerNum = 1;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu1.tower3.onPress = function () {
if ((!_root.placeTower) && (_root.gold >= towerStats[2][8])) {
_root.placeTower = true;
_root.selectedTower = "bombTower";
_root.towerNum = 2;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu1.tower4.onPress = function () {
if ((!_root.placeTower) && (_root.gold >= towerStats[3][8])) {
_root.placeTower = true;
_root.selectedTower = "machinegunTower";
_root.towerNum = 3;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu1.tower5.onPress = function () {
if ((!_root.placeTower) && (_root.gold >= towerStats[4][8])) {
_root.placeTower = true;
_root.selectedTower = "poisonTower";
_root.towerNum = 4;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu1.tower6.onPress = function () {
if ((!_root.placeTower) && (_root.gold >= towerStats[5][8])) {
_root.placeTower = true;
_root.selectedTower = "shockTower";
_root.towerNum = 5;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu1.tower7.onPress = function () {
if ((!_root.placeTower) && (_root.gold >= towerStats[6][8])) {
_root.placeTower = true;
_root.selectedTower = "fireTower";
_root.towerNum = 6;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu1.tower8.onPress = function () {
if ((!_root.placeTower) && (_root.gold >= towerStats[7][8])) {
_root.placeTower = true;
_root.selectedTower = "cashTower";
_root.towerNum = 7;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu1.tower9.onPress = function () {
if ((!_root.placeTower) && (_root.gold >= towerStats[8][8])) {
_root.placeTower = true;
_root.selectedTower = "slowTower";
_root.towerNum = 8;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu1.tower10.onPress = function () {
if ((!_root.placeTower) && (_root.gold >= towerStats[9][8])) {
_root.placeTower = true;
_root.selectedTower = "flameTower";
_root.towerNum = 9;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu2.tower21.onPress = function () {
if ((_root.game_speed && (!_root.placeTower)) && (_root.gold >= towerStats[20][8])) {
_root.placeTower = true;
_root.selectedTower = "arrowTower";
_root.towerNum = 20;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu2.tower22.onPress = function () {
if ((_root.game_speed && (!_root.placeTower)) && (_root.gold >= towerStats[21][8])) {
_root.placeTower = true;
_root.selectedTower = "crossbowTower";
_root.towerNum = 21;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu2.tower23.onPress = function () {
if ((_root.game_speed && (!_root.placeTower)) && (_root.gold >= towerStats[22][8])) {
_root.placeTower = true;
_root.selectedTower = "balistaTower";
_root.towerNum = 22;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu2.tower24.onPress = function () {
if ((_root.game_speed && (!_root.placeTower)) && (_root.gold >= towerStats[23][8])) {
_root.placeTower = true;
_root.selectedTower = "flowerTower";
_root.towerNum = 23;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu2.tower25.onPress = function () {
if ((_root.game_speed && (!_root.placeTower)) && (_root.gold >= towerStats[24][8])) {
_root.placeTower = true;
_root.selectedTower = "magicTower";
_root.towerNum = 24;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu2.tower26.onPress = function () {
if ((_root.game_speed && (!_root.placeTower)) && (_root.gold >= towerStats[25][8])) {
_root.placeTower = true;
_root.selectedTower = "rootsTower";
_root.towerNum = 25;
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth());
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.towerStats[_root.towerNum][0] * 2);
_root.attachMovie(selectedTower, "towerHold", _root.getNextHighestDepth());
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
}
};
menu1.cancel_btn.onPress = function () {
if (_root.placeTower) {
_root.placeTower = false;
_root.selectedTower = "";
_root.towerNum = -1;
towerHold.removeMovieClip();
rangeCircle.removeMovieClip();
}
};
menu2.cancel_btn.onPress = function () {
if (_root.placeTower) {
_root.placeTower = false;
_root.selectedTower = "";
_root.towerNum = -1;
towerHold.removeMovieClip();
rangeCircle.removeMovieClip();
}
};
menu2.cancel_btn.onEnterFrame = function () {
if (_root.placeTower) {
this._visible = true;
} else {
this._visible = false;
}
};
_root.prev_speed = 1;
menu1.pause_btn.onPress = function () {
removeShocks = false;
if (_root.game_speed == 0) {
menu1.pause_btn.gotoAndStop(1);
_root.game_speed = _root.prev_speed;
this.pauza.text = "PAUSE";
if (levelTotal < creeps[_root.act_level][_root.wave - 1][9]) {
spawn = setInterval(newCreep, _root.creep_delay / _root.game_speed);
}
} else {
if (levelTotal < creeps[_root.act_level][_root.wave - 1][9]) {
clearInterval(spawn);
}
_root.prev_speed = _root.game_speed;
_root.game_speed = 0;
menu1.pause_btn.gotoAndStop(2);
this.pauza.text = "PLAY";
}
};
menu2.pause_btn.onPress = function () {
removeShocks = false;
if (_root.game_speed == 0) {
_root.game_speed = _root.prev_speed;
this.pauza.text = "PAUSE";
if (levelTotal < creeps[_root.act_level][_root.wave - 1][9]) {
spawn = setInterval(newCreep, _root.creep_delay / _root.game_speed);
}
} else {
if (levelTotal < creeps[_root.act_level][_root.wave - 1][9]) {
clearInterval(spawn);
}
_root.prev_speed = _root.game_speed;
_root.game_speed = 0;
this.pauza.text = "PLAY";
}
};
menu1.speed_btn.onPress = function () {
if (_root.game_speed == 1) {
_root.game_speed = 3;
menu1.speed_btn.txt.text = "1x speed";
if (levelTotal < creeps[_root.act_level][_root.wave - 1][9]) {
clearInterval(spawn);
spawn = setInterval(newCreep, _root.creep_delay / _root.game_speed);
}
} else if (_root.game_speed == 3) {
_root.game_speed = 1;
menu1.speed_btn.txt.text = "3x speed";
if (levelTotal < creeps[_root.act_level][_root.wave - 1][9]) {
clearInterval(spawn);
spawn = setInterval(newCreep, _root.creep_delay / _root.game_speed);
}
}
};
menu2.speed_btn.onPress = function () {
if (_root.game_speed == 1) {
_root.game_speed = 3;
if (levelTotal < creeps[_root.act_level][_root.wave - 1][9]) {
clearInterval(spawn);
spawn = setInterval(newCreep, _root.creep_delay / _root.game_speed);
}
} else if (_root.game_speed == 3) {
_root.game_speed = 1;
if (levelTotal < creeps[_root.act_level][_root.wave - 1][9]) {
clearInterval(spawn);
spawn = setInterval(newCreep, _root.creep_delay / _root.game_speed);
}
}
};
menu1.tower1.onRollOver = function () {
_root.over_tower = 0;
};
menu1.tower2.onRollOver = function () {
_root.over_tower = 1;
};
menu1.tower3.onRollOver = function () {
_root.over_tower = 2;
};
menu1.tower4.onRollOver = function () {
_root.over_tower = 3;
};
menu1.tower5.onRollOver = function () {
_root.over_tower = 4;
};
menu1.tower6.onRollOver = function () {
_root.over_tower = 5;
};
menu1.tower7.onRollOver = function () {
_root.over_tower = 6;
};
menu1.tower8.onRollOver = function () {
_root.over_tower = 7;
};
menu1.tower9.onRollOver = function () {
_root.over_tower = 8;
};
menu1.tower10.onRollOver = function () {
_root.over_tower = 9;
};
menu2.tower21.onRollOver = function () {
_root.over_tower = 20;
};
menu2.tower22.onRollOver = function () {
_root.over_tower = 21;
};
menu2.tower23.onRollOver = function () {
_root.over_tower = 22;
};
menu2.tower24.onRollOver = function () {
_root.over_tower = 23;
};
menu2.tower25.onRollOver = function () {
_root.over_tower = 24;
};
menu2.tower26.onRollOver = function () {
_root.over_tower = 25;
};
menu2.tower27.onRollOver = function () {
_root.over_tower = 26;
};
menu2.tower28.onRollOver = function () {
_root.over_tower = 27;
};
menu2.tower29.onRollOver = function () {
_root.over_tower = 28;
};
menu2.tower30.onRollOver = function () {
_root.over_tower = 29;
};
tower_on_mouse_over.onEnterFrame = function () {
_root.over_range = "Range: " + _root.towerStats[_root.over_tower][0];
_root.over_reload = "Reload: " + _root.towerStats[_root.over_tower][1];
_root.over_damage = "Damage: " + _root.towerStats[_root.over_tower][2];
_root.over_speed = "Speed: " + _root.towerStats[_root.over_tower][3];
_root.over_tower_type = _root.towerStats[_root.over_tower][4];
if (_root.over_tower_type == "slow") {
_root.over_effect = ("Effect: " + towerStats[_root.over_tower][5]) + "*speed";
} else if (((((_root.over_tower_type == "bullet") || (_root.over_tower_type == "harpuna")) || (_root.over_tower_type == "arrow")) || (_root.over_tower_type == "crossbowArrow")) || (_root.over_tower_type == "balistaArrow")) {
_root.over_effect = ("Effect: +" + towerStats[_root.over_tower][5]) + " DMG";
} else if (_root.over_tower_type == "bomb") {
_root.over_effect = ("Effect: +" + towerStats[_root.over_tower][5]) + " DMG";
} else if ((_root.over_tower_type == "fire") || (_root.over_tower_type == "flame")) {
_root.over_effect = ("Effect: " + (towerStats[_root.over_tower][5] * 25)) + "/s Fire";
} else if ((_root.over_tower_type == "poison") || (_root.over_tower_type == "flower_trn")) {
_root.over_effect = ("Effect: +" + (towerStats[_root.over_tower][5] * 25)) + "/s Poison";
} else if ((_root.over_tower_type == "shock") || (_root.over_tower_type == "roots")) {
_root.over_effect = ("Effect: " + towerStats[_root.over_tower][5]) + "*speed";
} else if (_root.over_tower_type == "cash") {
_root.over_effect = ("Effect: +" + towerStats[_root.over_tower][5]) + "$";
} else if (_root.over_tower_type == "magic") {
_root.over_effect = ("Effect: +" + towerStats[_root.over_tower][5]) + "Magic DMG";
}
_root.over_eff_time = ("Duration: " + towerStats[_root.over_tower][6]) + "s";
_root.over_name = towerStats[_root.over_tower][7];
_root.over_cost = "Cost: $" + towerStats[_root.over_tower][8];
_root.over_level = "Level: 1";
_root.over_xp = "XP: 0";
_root.over_desc = "Description: " + towerStats[_root.over_tower][9];
};
passive = 40;
menu1.tower1.onEnterFrame = function () {
if (_root.gold >= towerStats[0][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu1.tower2.onEnterFrame = function () {
if (_root.gold >= towerStats[1][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu1.tower3.onEnterFrame = function () {
if (_root.gold >= towerStats[2][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu1.tower4.onEnterFrame = function () {
if (_root.gold >= towerStats[3][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu1.tower5.onEnterFrame = function () {
if (_root.gold >= towerStats[4][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu1.tower6.onEnterFrame = function () {
if (_root.gold >= towerStats[5][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu1.tower7.onEnterFrame = function () {
if (_root.gold >= towerStats[6][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu1.tower8.onEnterFrame = function () {
if (_root.gold >= towerStats[7][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu1.tower9.onEnterFrame = function () {
if (_root.gold >= towerStats[8][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu1.tower10.onEnterFrame = function () {
if (_root.gold >= towerStats[9][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu2.tower21.onEnterFrame = function () {
if (_root.gold >= towerStats[20][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu2.tower22.onEnterFrame = function () {
if (_root.gold >= towerStats[21][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu2.tower23.onEnterFrame = function () {
if (_root.gold >= towerStats[22][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu2.tower24.onEnterFrame = function () {
if (_root.gold >= towerStats[23][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu2.tower25.onEnterFrame = function () {
if (_root.gold >= towerStats[24][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu2.tower26.onEnterFrame = function () {
if (_root.gold >= towerStats[25][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu2.tower27.onEnterFrame = function () {
if (_root.gold >= towerStats[26][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
menu2.tower28.onEnterFrame = function () {
if (_root.gold >= towerStats[27][8]) {
this._alpha = 100;
} else {
this._alpha = passive;
}
};
onMouseMove = function () {
if (placeTower) {
towerHold._x = (Math.floor(_xmouse / 30) * 30) + 15;
towerHold._y = (Math.floor(_ymouse / 30) * 30) + 15;
rangeCircle._x = towerHold._x;
rangeCircle._y = towerHold._y;
if (towerColl.hitTest(new flash.geom.Point(towerHold._x, towerHold._y), 255, path, new flash.geom.Point(0, 0), 255)) {
towerHold._alpha = 40;
} else {
towerHold._alpha = 100;
}
}
};
onMouseDown = function () {
if ((_root.tower_selected == true) && (_root._xmouse < 480)) {
rangeCircle.removeMovieClip();
_root.tower_stats_mc.removeMovieClip();
_root.tower_name = "";
}
_root.creep_stats_mc.removeMovieClip();
lifeBox.swapDepths(_root.getNextHighestDepth());
if ((((placeTower && (_ymouse < 420)) && (_ymouse > 30)) && (_xmouse < 480)) && (!towerColl.hitTest(new flash.geom.Point(towerHold._x, towerHold._y), 255, path, new flash.geom.Point(0, 0), 255))) {
numTowers++;
player.built_towers = player.built_towers + 1;
name = "tower_" + numTowers;
this.attachMovie(selectedTower, name, this.getNextHighestDepth());
lifeBox.swapDepths(_root.getNextHighestDepth());
this[name]._x = towerHold._x;
this[name]._y = towerHold._y;
this[name].num = numTowers;
this[name].range = towerStats[towerNum][0];
this[name].reload = towerStats[towerNum][1];
this[name].damage = towerStats[towerNum][2];
this[name].speed = towerStats[towerNum][3];
this[name].tower_type = towerStats[towerNum][4];
this[name].effect = towerStats[towerNum][5];
this[name].eff_time = towerStats[towerNum][6];
this[name].name = towerStats[towerNum][7];
this[name].cost = towerStats[towerNum][8];
this[name].xp = 0;
this[name].level = 1;
this[name].xp_gain = towerStats[towerNum][10];
this[name].leveltext.text = this[name].level;
this[name].reloadHold = this[name].reload;
this[name].canFire = false;
towers.push(this[name]);
placeTower = false;
_root.gold = _root.gold - this[name].cost;
towerHold.removeMovieClip();
rangeCircle.removeMovieClip();
var _local3 = new flash.geom.Matrix();
_local3.tx = this[name]._x;
_local3.ty = this[name]._y;
path.draw(this[name], _local3);
}
i = 0;
while (i <= numTowers) {
if (_root["tower_" + i].hitTest(_root._xmouse, _root._ymouse)) {
_root.tower_selected = true;
_root.tower_name = _root["tower_" + i];
_root.attachMovie("rangeCircle", "rangeCircle", _root.getNextHighestDepth(), {_x:_root.tower_name._x, _y:_root.tower_name._y});
_root.attachMovie("tower_stats_mc", "tower_stats_mc", _root.getNextHighestDepth(), {_x:480, _y:30});
lifeBox.swapDepths(_root.getNextHighestDepth());
menu1.swapDepths(_root.getNextHighestDepth());
_root.select_name = _root.tower_name.name;
_root.select_range = "Range: " + _root.tower_name.range;
_root.select_damage = "Damage: " + _root.tower_name.damage;
_root.select_reload = "Reload: " + _root.tower_name.reload;
_root.select_speed = "Speed: " + _root.tower_name.speed;
_root.select_xp = _root.tower_name.xp;
_root.select_level = _root.tower_name.level;
_root.select_effect = _root.tower_name.effect * 25;
_root.select_eff_time = _root.tower_name.eff_time;
_root.select_tower_type = _root.tower_name.tower_type;
_root.select_cost = ("Cost: $" + _root.tower_name.cost) + "";
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.tower_name.range * 2);
rangeCircle._x = _root.tower_name._x;
rangeCircle._y = _root.tower_name._y;
_root.tower_stats_mc.upg1.onPress = function () {
if (_root.gold >= _root.cost1) {
player.upgrades = player.upgrades + 1;
_root.gold = _root.gold - _root.cost1;
_root.tower_name.range = _root.tower_name.range + 10;
_root.select_range = "Range: " + _root.tower_name.range;
_root.rangeCircle._xscale = (_root.rangeCircle._yscale = _root.tower_name.range * 2);
}
};
_root.tower_stats_mc.upg2.onPress = function () {
if (_root.gold >= _root.cost2) {
player.upgrades = player.upgrades + 1;
_root.gold = _root.gold - _root.cost2;
_root.tower_name.damage = _root.tower_name.damage + 10;
_root.select_damage = "Damage: " + _root.tower_name.damage;
}
};
_root.tower_stats_mc.upg3.onPress = function () {
if (_root.tower_name.reload > 9) {
if (_root.gold >= _root.cost3) {
player.upgrades = player.upgrades + 1;
_root.gold = _root.gold - _root.cost3;
_root.tower_name.reload = _root.tower_name.reload - 2;
_root.select_reload = "Reload: " + _root.tower_name.reload;
}
}
};
_root.tower_stats_mc.upg4.onPress = function () {
if ((_root.gold >= _root.cost4) && (_root.tower_name.speed < 20)) {
player.upgrades = player.upgrades + 1;
_root.gold = _root.gold - _root.cost4;
_root.tower_name.speed = _root.tower_name.speed + 1;
_root.select_speed = "Speed: " + _root.tower_name.speed;
}
};
_root.tower_stats_mc.sell.onPress = function () {
path.dispose();
path = flash.display.BitmapData.loadBitmap(path_name);
t = 1;
while (t <= numTowers) {
if (t != _root.tower_name.num) {
_root.t_name = _root["tower_" + t];
if (_root.t_name != undefined) {
var _local2 = new flash.geom.Matrix();
_local2.tx = _root.t_name._x;
_local2.ty = _root.t_name._y;
path.draw(_root.t_name, _local2);
}
}
t++;
}
player.sold_towers = player.sold_towers + 1;
_root.gold = _root.gold + (_root.tower_name.cost / 2);
removeMovieClip(_root.tower_name);
rangeCircle.removeMovieClip();
_root.tower_stats_mc.removeMovieClip();
_root.tower_name = "";
};
}
i++;
}
j = 0;
while (j <= levelTotal) {
if (_root["creep" + j].hitTest(_root._xmouse, _root._ymouse)) {
_root.creep_name = _root["creep" + j];
_root.creep_name_new = _root.creep_name.name_new;
_root.attachMovie("creep_stats_mc", "creep_stats_mc", _root.getNextHighestDepth(), {_x:480, _y:30});
menu1.swapDepths(_root.getNextHighestDepth());
lifeBox.swapDepths(_root.getNextHighestDepth());
_root.creep_hp_max = _root.max_health;
_root.creep_hp = _root.creep_name.health;
_root.creep_burn = _root.creep_name.burn * 25;
_root.creep_poison = _root.creep_name.poison * 25;
_root.creep_speed = _root.creep_name.speed;
_root.creep_regen = ("Regeneration: " + (_root.creep_name.regen * 25)) + "/s";
_root.creep_defense = "Defense: " + (Math.round(_root.creep_name.defense * 100) / 100);
_root.creep_fire_res = "Fire resist: " + (Math.round((_root.creep_name.fire_res * 25) * 100) / 100);
_root.creep_pois_res = "Poison resist: " + (Math.round((_root.creep_name.pois_res * 25) * 100) / 100);
_root.creep_magic_res = "Magic resist: " + (Math.round(_root.creep_name.magic_res * 100) / 100);
_root.creep_name.number = j;
}
j++;
}
};
this.onEnterFrame = function () {
lifeBox.upgrades.txt1.text = "Skill points: " + sp;
_root.select_range = "Range: " + _root.tower_name.range;
_root.select_damage = "Damage: " + _root.tower_name.damage;
_root.select_reload = "Reload: " + _root.tower_name.reload;
_root.select_speed = "Speed: " + _root.tower_name.speed;
_root.select_xp = "XP: " + Math.round(_root.tower_name.xp * 10);
_root.select_level = "Level: " + _root.tower_name.level;
_root.select_cost = "Cost: $" + _root.tower_name.cost;
_root.select_cost = "Sell for: $" + (_root.tower_name.cost / 2);
if (_root.select_tower_type == "slow") {
_root.select_effect = ("Effect: " + (Math.round(_root.tower_name.effect * 1000) / 1000)) + "*speed";
} else if (((((_root.select_tower_type == "bullet") || (_root.select_tower_type == "harpuna")) || (_root.select_tower_type == "arrow")) || (_root.select_tower_type == "crossbowArrow")) || (_root.select_tower_type == "balistaArrow")) {
_root.select_effect = ("Effect: +" + _root.tower_name.effect) + " DMG";
} else if (_root.select_tower_type == "bomb") {
_root.select_effect = ("Effect: +" + _root.tower_name.effect) + " DMG";
} else if ((_root.select_tower_type == "fire") || (_root.select_tower_type == "flame")) {
_root.select_effect = ("Effect: " + Math.round(_root.tower_name.effect * 25)) + "/s Fire";
} else if ((_root.select_tower_type == "poison") || (_root.select_tower_type == "flower_trn")) {
_root.select_effect = ("Effect: " + Math.round(_root.tower_name.effect * 25)) + "/s Poison";
} else if (_root.select_tower_type == "shock") {
_root.select_effect = ("Effect: " + (Math.round(_root.tower_name.effect * 1000) / 1000)) + "*speed";
} else if (_root.select_tower_type == "cash") {
_root.select_effect = ("Effect: +" + (Math.round(_root.tower_name.effect * 1000) / 1000)) + "$";
} else if (_root.select_tower_type == "magic") {
_root.select_effect = ("Effect: +" + (Math.round(_root.tower_name.effect * 1000) / 1000)) + "Magic DMG";
}
_root.select_eff_time = ("Duration: " + _root.tower_name.eff_time) + "s";
_root.cost1 = _root.tower_name.range;
_root.cost2 = _root.tower_name.damage * 5;
_root.cost3 = (100 - _root.tower_name.reload) * 10;
_root.cost4 = _root.tower_name.speed * 25;
_root.creep_hp = (("HP: " + Math.round(_root.creep_name.health)) + "/") + _root.max_health;
_root.creep_burn = ("Burn: " + Math.round(_root.creep_name.burn * 25)) + "/s";
_root.creep_poison = ("Poison: " + Math.round(_root.creep_name.poison * 25)) + "/s";
_root.creep_speed = "Speed: " + (Math.round(_root.creep_name.speed * 1000) / 1000);
_root.creep_regen = ("Regeneration: " + (_root.creep_name.regen * 25)) + "/s";
_root.creep_defense = "Defense: " + (Math.round(_root.creep_name.defense * 100) / 100);
_root.creep_fire_res = "Fire resist: " + (Math.round((_root.creep_name.fire_res * 25) * 100) / 100);
_root.creep_pois_res = "Poison resist: " + (Math.round((_root.creep_name.pois_res * 25) * 100) / 100);
_root.creep_magic_res = "Magic resist: " + (Math.round(_root.creep_name.magic_res * 100) / 100);
_root.creep_reward = "Reward: " + (Math.round(_root.creep_name.reward * 100) / 100);
if ((_root.creep_name.health == undefined) || (isNaN(_root.creep_name.health))) {
_root.creep_stats_mc.removeMovieClip();
}
lifeBox.levelTotal.text = levelTotal;
lifeBox.skore.text = "Score: " + _root.tmp_skore;
lifeBox.gold.text = "Cash: $" + _root.gold;
lifeBox.life.text = "Lives: " + lives;
i = 0;
while (i < towers.length) {
tower = towers[i];
tower.rank.gotoAndStop(tower.level);
if (distance(tower, tower.target) < tower.range) {
dx = tower.target._x - tower._x;
dy = tower.target._y - tower._y;
angle = Math.atan2(dy, dx);
tower.dir._rotation = (angle * 180) / Math.PI;
}
towerCheck(tower);
if (tower.ableFire) {
towerFire(tower);
}
i++;
}
};
menu1.back_btn.onRelease = function () {
lifeBox.btn_end._visible = true;
};
_root.over_tower = 0;
lifeBox.achievments._visible = false;
menu1.btn_achiev.onRelease = function () {
if (lifeBox.achievments._visible == false) {
lifeBox.achievments._visible = true;
lifeBox.upgrades._visible = false;
} else {
lifeBox.achievments._visible = false;
}
};
lifeBox.achievments.hide.onRelease = function () {
if (lifeBox.achievments._visible == false) {
lifeBox.achievments._visible = true;
lifeBox.upgrades._visible = false;
} else {
lifeBox.achievments._visible = false;
}
};
lifeBox.upgrades._visible = false;
menu1.btn_upgrades.onRelease = function () {
if (lifeBox.upgrades._visible == false) {
lifeBox.upgrades._visible = true;
lifeBox.achievments._visible = false;
} else {
lifeBox.upgrades._visible = false;
}
};
lifeBox.upgrades.hide.onRelease = function () {
if (lifeBox.upgrades._visible == false) {
lifeBox.upgrades._visible = true;
lifeBox.achievments._visible = false;
} else {
lifeBox.upgrades._visible = false;
}
};
sp = 1;
lifeBox.upgrades.txt1.text = "Skill point: " + sp;
lifeBox.upgrades.u1.pts = 0;
upgRollOver(lifeBox.upgrades.u1, "Fire Upgrade", "Upgrade Fire power of all towers \n(1 point gives +10 fire damage)");
lifeBox.upgrades.u1.gotoAndStop(1);
lifeBox.upgrades.u1.onRelease = function () {
if ((sp > 0) && (this.pts < 5)) {
player.fire_u = player.fire_u + 1;
sp = sp - 1;
this.pts = this.pts + 1;
this.txt.txt.text = this.pts + "/5";
this._parent.txt1.text = "Skill points: " + sp;
player.fire_bonus = player.fire_bonus + 0.4;
t = 1;
while (t <= numTowers) {
_root.t_name = _root["tower_" + t];
if ((_root.t_name.tower_type == "fire") || (_root.t_name.tower_type == "flame")) {
_root.t_name.effect = _root.t_name.effect + 0.4;
}
_root.t_name = "";
t++;
}
updateTowerStats();
}
};
lifeBox.upgrades.u2.pts = 0;
upgRollOver(lifeBox.upgrades.u2, "Poison Upgrade", "Upgrade poison damage of all towers \n(1 point gives +10 poison damage)");
lifeBox.upgrades.u2.gotoAndStop(2);
lifeBox.upgrades.u2.onRelease = function () {
if ((sp > 0) && (this.pts < 5)) {
player.poison_u = player.poison_u + 1;
sp = sp - 1;
this.pts = this.pts + 1;
this.txt.txt.text = this.pts + "/5";
this._parent.txt1.text = "Skill points: " + sp;
player.poison_bonus = player.poison_bonus + 0.4;
t = 1;
while (t <= numTowers) {
_root.t_name = _root["tower_" + t];
if (_root.t_name.tower_type == "poison") {
_root.t_name.effect = _root.t_name.effect + 0.4;
}
_root.t_name = "";
t++;
}
updateTowerStats();
}
};
lifeBox.upgrades.u3.pts = 0;
upgRollOver(lifeBox.upgrades.u3, "Damage Upgrade", "Upgrade damage of all towers \n(1 point gives +3 damage)");
lifeBox.upgrades.u3.gotoAndStop(3);
lifeBox.upgrades.u3.onRelease = function () {
if ((sp > 0) && (this.pts < 5)) {
player.damage_u = player.damage_u + 1;
sp = sp - 1;
this.pts = this.pts + 1;
this.txt.txt.text = this.pts + "/5";
this._parent.txt1.text = "Skill points: " + sp;
player.damage_bonus = player.damage_bonus + 3;
t = 1;
while (t <= numTowers) {
_root.t_name = _root["tower_" + t];
_root.t_name.damage = _root.t_name.damage + 3;
_root.t_name = "";
t++;
}
updateTowerStats();
}
};
lifeBox.upgrades.u4.pts = 0;
upgRollOver(lifeBox.upgrades.u4, "Cannon Upgrade", "Upgrade damage of cannon towers \n(1 point gives +15 damage)");
lifeBox.upgrades.u4.gotoAndStop(4);
lifeBox.upgrades.u4.onRelease = function () {
if ((sp > 0) && (this.pts < 5)) {
player.cannon_u = player.cannon_u + 1;
sp = sp - 1;
this.pts = this.pts + 1;
this.txt.txt.text = this.pts + "/5";
this._parent.txt1.text = "Skill points: " + sp;
player.bomb_bonus = player.bomb_bonus + 15;
t = 1;
while (t <= numTowers) {
_root.t_name = _root["tower_" + t];
if (_root.t_name.tower_type == "bomb") {
_root.t_name.effect = _root.t_name.effect + 15;
}
_root.t_name = "";
t++;
}
updateTowerStats();
}
};
lifeBox.upgrades.u5.pts = 0;
upgRollOver(lifeBox.upgrades.u5, "Skill Upgrade", "Upgrade towers XP gain\n(1 point gives +5% more experience)");
lifeBox.upgrades.u5.gotoAndStop(5);
lifeBox.upgrades.u5.onRelease = function () {
if ((sp > 0) && (this.pts < 5)) {
player.xp_u = player.xp_u + 1;
sp = sp - 1;
this.pts = this.pts + 1;
this.txt.txt.text = this.pts + "/5";
this._parent.txt1.text = "Skill points: " + sp;
player.xp_bonus = player.xp_bonus + 0.05;
t = 1;
while (t <= numTowers) {
_root.t_name = _root["tower_" + t];
_root.t_name.xp_gain = _root.t_name.xp_gain * 1.05;
_root.t_name = "";
t++;
}
updateTowerStats();
}
};
lifeBox.upgrades.u6.pts = 0;
upgRollOver(lifeBox.upgrades.u6, "Gold Tower Upgrade", "Upgrade cash tower gold collecting\n(1 point gives +$1)");
lifeBox.upgrades.u6.gotoAndStop(6);
lifeBox.upgrades.u6.onRelease = function () {
if ((sp > 0) && (this.pts < 5)) {
player.gold_u = player.gold_u + 1;
sp = sp - 1;
this.pts = this.pts + 1;
this.txt.txt.text = this.pts + "/5";
this._parent.txt1.text = "Skill points: " + sp;
player.gold_bonus = player.gold_bonus + 1;
t = 1;
while (t <= numTowers) {
_root.t_name = _root["tower_" + t];
if (_root.t_name.tower_type == "cash") {
_root.t_name.effect = _root.t_name.effect + 1;
}
_root.t_name = "";
t++;
}
updateTowerStats();
}
};
lifeBox.upgrades.u7.pts = 0;
upgRollOver(lifeBox.upgrades.u7, "Cash Collecting", "Upgrade gives you more cash from killed enemies \n(+$2 cash from every killed enemy");
lifeBox.upgrades.u7.gotoAndStop(7);
lifeBox.upgrades.u7.onRelease = function () {
if ((sp > 0) && (this.pts < 5)) {
player.cash_u = player.cash_u + 1;
sp = sp - 1;
this.pts = this.pts + 1;
this.txt.txt.text = this.pts + "/5";
this._parent.txt1.text = "Skill points: " + sp;
player.cash_bonus = player.cash_bonus + 2;
updateTowerStats();
}
};
lifeBox.upgrades.u8.pts = 0;
upgRollOver(lifeBox.upgrades.u8, "Shock Tower Upgrade", "Upgrade shock tower damage\n(1 point gives +15 damage and +1 second shock duration)");
lifeBox.upgrades.u8.gotoAndStop(8);
lifeBox.upgrades.u8.onRelease = function () {
if ((sp > 0) && (this.pts < 5)) {
player.shock_u = player.shock_u + 1;
sp = sp - 1;
this.pts = this.pts + 1;
this.txt.txt.text = this.pts + "/5";
this._parent.txt1.text = "Skill points: " + sp;
t = 1;
while (t <= numTowers) {
_root.t_name = _root["tower_" + t];
if (_root.t_name.tower_type == "shock") {
_root.t_name.eff_time = _root.t_name.eff_time + 1;
_root.t_name.damage = _root.t_name.damage + 15;
}
_root.t_name = "";
t++;
}
updateTowerStats();
}
};
lifeBox.upgrades.u9.pts = 0;
upgRollOver(lifeBox.upgrades.u9, "Frost Tower Upgrade", "Upgrade frost tower damage\n(1 point gives +15 damage and +1 second slow duration)");
lifeBox.upgrades.u9.gotoAndStop(9);
lifeBox.upgrades.u9.onRelease = function () {
if ((sp > 0) && (this.pts < 5)) {
player.slow_u = player.slow_u + 1;
player.slow2_u = player.slow2_u + 1;
sp = sp - 1;
this.pts = this.pts + 1;
this.txt.txt.text = this.pts + "/5";
this._parent.txt1.text = "Skill points: " + sp;
t = 1;
while (t <= numTowers) {
_root.t_name = _root["tower_" + t];
if (_root.t_name.tower_type == "slow") {
_root.t_name.eff_time = _root.t_name.eff_time + 1;
_root.t_name.damage = _root.t_name.damage + 15;
}
_root.t_name = "";
t++;
}
updateTowerStats();
}
};
lifeBox.upgrades.u10.pts = 0;
upgRollOver(lifeBox.upgrades.u10, "Automatic upgrade system", "Your towers get more XP after each wave\n(1 point gives +1 more XP)");
lifeBox.upgrades.u10.gotoAndStop(10);
lifeBox.upgrades.u10.onRelease = function () {
if ((sp > 0) && (this.pts < 5)) {
player.xp2_u = player.xp2_u + 1;
sp = sp - 1;
this.pts = this.pts + 1;
this.txt.txt.text = this.pts + "/5";
this._parent.txt1.text = "Skill points: " + sp;
updateTowerStats();
}
};
updateTowerStats();
lifeBox.achievments.t = 25;
lifeBox.achievments.onEnterFrame = function () {
this.t = this.t - 1;
if (this.t < 1) {
this.t = 5;
if (sp > 0) {
menu1.btn_upgrades.gotoAndStop(2);
} else {
menu1.btn_upgrades.gotoAndStop(1);
}
checkAch();
}
};
player.kills = 0;
player.fire_kills = 0;
player.poison_kills = 0;
player.bomb_kills = 0;
player.gun_kills = 0;
player.built_towers = 0;
player.sold_towers = 0;
player.shock_kills = 0;
player.gold_digger = 0;
player.slow_kills = 0;
player.levels = 0;
player.upgrades = 0;
player.fire_u = 0;
player.poison_u = 0;
player.cannon_u = 0;
player.gold_u = 0;
player.cash_u = 0;
player.xp_u = 0;
player.xp2_u = 0;
player.damage_u = 0;
player.shock_u = 0;
player.slow_u = 0;
player.slow2_u = 0;
updateTowerStats();
lifeBox.achievments.a1.ach = false;
lifeBox.achievments.a2.ach = false;
lifeBox.achievments.a3.ach = false;
lifeBox.achievments.a4.ach = false;
lifeBox.achievments.a5.ach = false;
lifeBox.achievments.a6.ach = false;
lifeBox.achievments.a7.ach = false;
lifeBox.achievments.a8.ach = false;
lifeBox.achievments.a9.ach = false;
lifeBox.achievments.a10.ach = false;
lifeBox.achievments.a11.ach = false;
lifeBox.achievments.a12.ach = false;
lifeBox.achievments.a13.ach = false;
lifeBox.achievments.a14.ach = false;
lifeBox.achievments.a15.ach = false;
lifeBox.achievments.a16.ach = false;
lifeBox.achievments.a17.ach = false;
lifeBox.achievments.a18.ach = false;
lifeBox.achievments.a19.ach = false;
lifeBox.achievments.a20.ach = false;
lifeBox.achievments.a21.ach = false;
lifeBox.achievments.a22.ach = false;
lifeBox.achievments.a23.ach = false;
lifeBox.achievments.a24.ach = false;
lifeBox.achievments.a25.ach = false;
lifeBox.achievments.a26.ach = false;
lifeBox.achievments.a27.ach = false;
lifeBox.achievments.a28.ach = false;
lifeBox.achievments.a29.ach = false;
lifeBox.achievments.a30.ach = false;
lifeBox.achievments.a31.ach = false;
lifeBox.achievments.a32.ach = false;
lifeBox.achievments.a33.ach = false;
lifeBox.achievments.a34.ach = false;
lifeBox.achievments.a35.ach = false;
lifeBox.achievments.a36.ach = false;
lifeBox.achievments.a37.ach = false;
lifeBox.achievments.a38.ach = false;
lifeBox.achievments.a39.ach = false;
lifeBox.achievments.a40.ach = false;
lifeBox.achievments.a41.ach = false;
lifeBox.achievments.a42.ach = false;
lifeBox.achievments.a43.ach = false;
lifeBox.achievments.a44.ach = false;
lifeBox.achievments.a45.ach = false;
lifeBox.achievments.a46.ach = false;
lifeBox.achievments.a47.ach = false;
lifeBox.achievments.a48.ach = false;
lifeBox.achievments.a49.ach = false;
lifeBox.achievments.a50.ach = false;
lifeBox.ach._visible = false;
lifeBox.ach.del = 0;
lifeBox.ach._alpha = 100;
hideAch(lifeBox.ach);
sounds(menu1.sound_ctrl);
menu1.sound_ctrl2.onRelease = function () {
if (_root.snd_eff == true) {
_root.snd_eff = false;
} else {
_root.snd_eff = true;
}
};
menu1.sound_ctrl2.onEnterFrame = function () {
if (_root.snd_eff == false) {
this.gotoAndStop(2);
} else if (_root.snd_eff == true) {
this.gotoAndStop(1);
}
};
submit_game(lifeBox.btn_submit);
end_game(lifeBox.btn_end);
lifeBox.btn_end._visible = false;
lifeBox.btn_submit._visible = false;
lifeBox.tutorial.fr = 1;
lifeBox.tutorial.btn_next.onRelease = function () {
if (this._parent.fr < 9) {
this._parent.fr = this._parent.fr + 1;
}
this._parent.gotoAndStop(this._parent.fr);
};
lifeBox.tutorial.btn_prev.onRelease = function () {
if (this._parent.fr > 1) {
this._parent.fr = this._parent.fr - 1;
}
this._parent.gotoAndStop(this._parent.fr);
};
lifeBox.tutorial.btn_quit.onRelease = function () {
this._parent._visible = false;
};
menu1.btn_help.onRelease = function () {
if (lifeBox.tutorial._visible == false) {
lifeBox.tutorial._visible = true;
} else {
lifeBox.tutorial._visible = false;
}
};
if (_root.act_level == 1) {
lifeBox.tutorial._visible = true;
} else {
lifeBox.tutorial._visible = false;
}
cover();
Symbol 47 MovieClip Frame 1
stop();
Symbol 142 MovieClip [fire_splash] Frame 13
removeMovieClip(this);
Symbol 163 MovieClip [splash] Frame 16
removeMovieClip(this);
Symbol 171 MovieClip [poison_splash] Frame 30
removeMovieClip(this);
Symbol 175 MovieClip [bum] Frame 12
removeMovieClip(this);
Symbol 178 MovieClip [flame] Frame 9
if (_root.game_speed == 0) {
stop();
} else if (_root.game_speed == 3) {
gotoAndPlay (15);
} else {
gotoAndPlay (10);
}
Symbol 178 MovieClip [flame] Frame 19
if (_root.game_speed == 0) {
stop();
} else if (_root.game_speed == 3) {
gotoAndPlay (25);
} else {
gotoAndPlay (20);
}
Symbol 178 MovieClip [flame] Frame 29
if (_root.game_speed == 0) {
stop();
} else if (_root.game_speed == 3) {
gotoAndPlay (35);
} else {
gotoAndPlay (30);
}
Symbol 178 MovieClip [flame] Frame 39
if (_root.game_speed == 0) {
stop();
} else if (_root.game_speed == 3) {
gotoAndPlay (45);
} else {
gotoAndPlay (40);
}
Symbol 178 MovieClip [flame] Frame 49
if (_root.game_speed == 0) {
stop();
} else if (_root.game_speed == 3) {
gotoAndPlay (55);
} else {
gotoAndPlay (50);
}
Symbol 178 MovieClip [flame] Frame 59
if (_root.game_speed == 0) {
stop();
} else if (_root.game_speed == 3) {
gotoAndPlay (65);
} else {
gotoAndPlay (60);
}
Symbol 178 MovieClip [flame] Frame 69
if (_root.game_speed == 0) {
stop();
} else if (_root.game_speed == 3) {
gotoAndPlay (75);
} else {
gotoAndPlay (70);
}
Symbol 178 MovieClip [flame] Frame 80
stop();
Symbol 206 MovieClip Frame 15
stop();
Symbol 207 MovieClip [roots_out] Frame 200
removeMovieClip(this);
Symbol 277 MovieClip Frame 1
stop();
Symbol 295 MovieClip Frame 1
stop();
Symbol 326 MovieClip Frame 1
stop();
Symbol 374 MovieClip Frame 1
stop();
Symbol 390 MovieClip Frame 1
stop();
Symbol 396 MovieClip Frame 1
stop();
Symbol 400 MovieClip Frame 1
stop();
Symbol 423 MovieClip Frame 1
stop();
Symbol 429 MovieClip Frame 1
stop();
Symbol 435 MovieClip Frame 1
stop();
Symbol 442 MovieClip Frame 1
stop();
Symbol 449 MovieClip Frame 1
stop();
Symbol 457 MovieClip Frame 1
stop();
Symbol 473 MovieClip Frame 1
stop();
Symbol 480 MovieClip Frame 1
stop();
Symbol 508 MovieClip Frame 1
stop();
Symbol 515 MovieClip Frame 1
stop();
Symbol 519 MovieClip Frame 1
stop();
Symbol 529 MovieClip Frame 1
stop();
Symbol 581 MovieClip [money] Frame 37
removeMovieClip(this);
Symbol 586 MovieClip Frame 1
stop();
Symbol 601 MovieClip Frame 1
stop();
Symbol 607 MovieClip Frame 1
stop();
Symbol 612 MovieClip Frame 1
stop();
Symbol 621 MovieClip [waypoint_manager] Frame 1
this.onEnterFrame = function () {
_root.waypointss = (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((("[" + this.w1._x) + ",") + this.w1._y) + "],") + "[") + this.w2._x) + ",") + this.w2._y) + "],") + "[") + this.w3._x) + ",") + this.w3._y) + "],") + "[") + this.w4._x) + ",") + this.w4._y) + "],") + "[") + this.w5._x) + ",") + this.w5._y) + "],") + "[") + this.w6._x) + ",") + this.w6._y) + "],") + "[") + this.w7._x) + ",") + this.w7._y) + "],") + "[") + this.w8._x) + ",") + this.w8._y) + "],") + "[") + this.w9._x) + ",") + this.w9._y) + "],") + "[") + this.w10._x) + ",") + this.w10._y) + "],") + "[") + this.w11._x) + ",") + this.w11._y) + "],") + "[") + this.w12._x) + ",") + this.w12._y) + "],") + "[") + this.w13._x) + ",") + this.w13._y) + "],") + "[") + this.w14._x) + ",") + this.w14._y) + "],";
};
Instance of Symbol 618 MovieClip "w1" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w2" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w3" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w4" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w5" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w6" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w7" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w8" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w9" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w10" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w11" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w12" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w13" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Instance of Symbol 618 MovieClip "w14" in Symbol 621 MovieClip [waypoint_manager] Frame 1
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = Math.floor(_root._xmouse / 30) * 30;
this._y = Math.floor(_root._ymouse / 30) * 30;
}
Symbol 644 MovieClip [slow_splash] Frame 15
removeMovieClip(this);
Symbol 645 MovieClip [blood] Frame 16
removeMovieClip(this);
Symbol 835 MovieClip [__Packages.mochi.as2.MochiAd] Frame 0
class mochi.as2.MochiAd
{
function MochiAd () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
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 _local23 = 11000;
var _local19 = options.ad_timeout;
if (options.skip) {
_local19 = 0;
}
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 _local22 = options.color;
delete options.color;
var _local20 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local20);
_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(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local24, 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 = _local23;
chk.ad_timeout = _local19;
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;
}
};
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 _local10 = {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, _local10);
var clip = options.clip;
var _local9 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var _local3 = clip._mochiad;
_local3.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local11 = _local5[0];
var _local8 = _local5[1];
_local3._x = _local11 * 0.5;
_local3._y = _local8 * 0.5;
var chk = _local3.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local9;
chk.started = getTimer();
chk.showing = false;
_local3.lc.adLoaded = options.ad_loaded;
_local3.lc.adSkipped = options.ad_skipped;
_local3.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
_local3.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local21 = false;
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 _local12 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local12);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local6 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local6._mochiad_loaded) {
return(null);
}
var _local11 = options.depth;
delete options.depth;
var mc = _local6.createEmptyMovieClip("_mochiad", _local11);
var _local10 = _getRes(options);
options.res = (_local10[0] + "x") + _local10[1];
options.server = options.server + options.id;
delete options.id;
_local6._mochiad_loaded = true;
if (_local6._url.indexOf("http") != 0) {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
}
var _local4 = mc.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local9 = _local4.server;
delete _local4.server;
var _local13 = _allowDomains(_local9);
mc.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 _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = mc;
_local5.name = _local8;
_local5.hostname = _local13;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
mc.lc = _local5;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
_local4.lc = _local8;
_local4.st = getTimer();
if (!options.skip) {
_local4.loadMovie(_local9 + ".swf", "POST");
}
return(mc);
}
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 836 MovieClip [__Packages.mochi.as2.MochiSync] Frame 0
class mochi.as2.MochiSync
{
var _syncContainer;
function MochiSync () {
_syncContainer = {};
}
function getProp(name) {
return(_syncContainer[name]);
}
function setProp(name, value) {
if (_syncContainer[name] == value) {
return(undefined);
}
_syncContainer[name] = value;
mochi.as2.MochiServices.send("sync_propUpdate", {name:name, value:value});
}
function triggerEvent(eventType, args) {
switch (eventType) {
case SYNC_REQUEST :
mochi.as2.MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY :
_syncContainer[args.name] = args.value;
}
}
static var SYNC_REQUEST = "SyncRequest";
static var SYNC_PROPERTY = "UpdateProperty";
}
Symbol 837 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.8 as2");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
warnID(id, false);
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local6 = "_mochiservices_com_" + id;
var _local5 = new MovieClipLoader();
var _local3 = {};
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servURL) {
_servURL = urlOptions().servURL;
}
var _local4 = _servURL + _services;
if (urlOptions().servicesURL) {
_local4 = urlOptions().servicesURL;
}
allowDomains(_local4);
_clip = clip.createEmptyMovieClip(_local6, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
if (_local3.waitInterval != null) {
clearInterval(_local3.waitInterval);
}
_local3.onLoadError = loadError;
_local3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_local3.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
_local3.startTime = getTimer();
_local3.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_local3.waitInterval = setInterval(_local3, "wait", 1000);
_local5.addListener(_local3);
_local5.loadClip((((((_local4 + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options)) + "&api_version=") + getVersion(), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function loadError(target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
disconnect();
onError.apply(null, [errorCode]);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiSocial.triggerEvent(pkg.event, pkg.args);
break;
case "sync" :
mochi.as2.MochiServices.servicesSync.triggerEvent(pkg.event, pkg.args);
}
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function updateCopy(args) {
send("coins_updateCopy", args, null, null);
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
trace("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
var _local6;
if (_root._url.indexOf("mochiad_options") != -1) {
var _local2 = (_root._url.indexOf("mochiad_options") + "mochiad_options".length) + 1;
_local6 = _root._url.substr(_local2, _root._url.length);
} else if (_root.mochiad_options) {
_local6 = _root.mochiad_options;
}
if (_local6) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function warnID(bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace(("WARNING: " + (leaderboard ? "board" : "game")) + " ID is not the appropriate length");
return(undefined);
}
if (bid == "1e113c7239048b3f") {
if (leaderboard) {
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
}
return(undefined);
}
if (bid == "84993a1de4031cd8") {
if (leaderboard) {
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
}
return(undefined);
}
var _local1 = 0;
while (_local1 < bid.length) {
switch (bid.charAt(_local1)) {
case "0" :
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
break;
default :
trace("WARNING: Board ID contains illegal characters: " + bid);
return(undefined);
}
_local1++;
}
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static function setContainer(clip) {
}
static function stayOnTop(clip) {
}
static var _servURL = "http://www.mochiads.com/static/lib/services/";
static var _services = "services.swf";
static var _mochiLC = "MochiLC.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
static var servicesSync = new mochi.as2.MochiSync();
}
Symbol 838 MovieClip [__Packages.mochi.as2.MochiEventDispatcher] Frame 0
class mochi.as2.MochiEventDispatcher
{
var eventTable;
function MochiEventDispatcher () {
eventTable = {};
}
function buildDelegate(thisObject, thatObject) {
var _local2 = {thisObject:thisObject, thatObject:thatObject};
if (thatObject != undefined) {
var funct = ((typeof(thatObject) == "string") ? (thisObject[thatObject]) : (thatObject));
_local2.delegate = function (args) {
funct.call(thisObject, args);
};
} else {
_local2.delegate = thisObject;
}
return(_local2);
}
function compareDelegate(d_A, d_B) {
if ((d_A.thisObject != d_B.thisObject) || (d_A.thatObject != d_B.thatObject)) {
return(false);
}
return(true);
}
function addEventListener(event, thisObject, thatObject) {
removeEventListener(event, thisObject, thatObject);
eventTable[event].push(buildDelegate(thisObject, thatObject));
}
function removeEventListener(event, thisObject, thatObject) {
var _local3 = buildDelegate(thisObject, thatObject);
if (eventTable[event] == undefined) {
eventTable[event] = [];
return(undefined);
}
for (var _local4 in eventTable[event]) {
if (!compareDelegate(eventTable[event][_local4], _local3)) {
continue;
}
eventTable[event].splice(Number(_local4), 1);
}
}
function triggerEvent(event, args) {
if (eventTable[event] == undefined) {
return(undefined);
}
for (var _local4 in eventTable[event]) {
eventTable[event][_local4].delegate(args);
}
}
}
Symbol 839 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
function MochiEvents () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function startSession(achievementID) {
mochi.as2.MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
static function setNotifications(clip, style) {
var _local2 = {};
for (var _local3 in style) {
_local2[_local3] = style[_local3];
}
_local2.clip = clip;
mochi.as2.MochiServices.send("events_setNotifications", _local2, null, null);
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static function startPlay(tag) {
if (tag == undefined) {
tag = "gameplay";
}
mochi.as2.MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
static function endPlay() {
mochi.as2.MochiServices.send("events_clearRoundID", null, null, null);
}
static function trackEvent(tag, value) {
mochi.as2.MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
static var ACHIEVEMENT_RECEIVED = "AchievementReceived";
static var ALIGN_TOP_LEFT = "ALIGN_TL";
static var ALIGN_TOP = "ALIGN_T";
static var ALIGN_TOP_RIGHT = "ALIGN_TR";
static var ALIGN_LEFT = "ALIGN_L";
static var ALIGN_CENTER = "ALIGN_C";
static var ALIGN_RIGHT = "ALIGN_R";
static var ALIGN_BOTTOM_LEFT = "ALIGN_BL";
static var ALIGN_BOTTOM = "ALIGN_B";
static var ALIGN_BOTTOM_RIGHT = "ALIGN_BR";
static var FORMAT_SHORT = "ShortForm";
static var FORMAT_LONG = "LongForm";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 840 MovieClip [__Packages.mochi.as2.MochiSocial] Frame 0
class mochi.as2.MochiSocial
{
function MochiSocial () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("coins_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("coins_hideLoginWidget");
}
static function requestLogin() {
mochi.as2.MochiServices.send("coins_requestLogin");
}
static function getUserInfo() {
mochi.as2.MochiServices.send("coins_getUserInfo");
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("coins_saveUserProperties", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var LOGGED_IN = "LoggedIn";
static var LOGGED_OUT = "LoggedOut";
static var LOGIN_SHOW = "LoginShow";
static var LOGIN_HIDE = "LoginHide";
static var LOGIN_SHOWN = "LoginShown";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var USER_INFO = "UserInfo";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var PROPERTIES_SIZE = "PropertiesSize";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 841 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiServices.warnID(boardID, true);
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
options.clip = mochi.as2.MochiServices.clip;
if ((options.clip != mochi.as2.MochiServices.__get__clip()) || (mochi.as2.MochiServices.__get__childClip()._target == undefined)) {
mochi.as2.MochiServices.disconnect();
trace("WARNING! This application is attempting to connect to MochiServices inside a showLeaderboard call!");
trace("make sure MochiServices.connect is called as early in the application runtime as possible.");
mochi.as2.MochiServices.connect(mochi.as2.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.as2.MochiDigits) {
options.score = options.score.value;
}
var _local2 = Number(options.score);
if (isNaN(_local2)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local2 == Number.NEGATIVE_INFINITY) || (_local2 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local2) != _local2) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local2;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.as2.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
_root.jumpable = true;
_root.gotoAndStop(10);
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.as2.MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
mochi.as2.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.as2.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.as2.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 842 MovieClip [__Packages.mochi.as2.MochiDigits] Frame 0
class mochi.as2.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 671 MovieClip Frame 1
stop();
Symbol 674 MovieClip Frame 1
stop();
Symbol 677 MovieClip Frame 1
stop();
Symbol 680 MovieClip Frame 1
stop();
Symbol 682 MovieClip Frame 1
stop();
Symbol 735 MovieClip Frame 625
stop();
Symbol 760 MovieClip Frame 1
stop();
Symbol 764 MovieClip Frame 1
stop();
Symbol 767 MovieClip Frame 1
stop();
Symbol 813 MovieClip Frame 1
stop();
Symbol 820 MovieClip Frame 1
stop();
Symbol 827 MovieClip Frame 1
stop();
Symbol 832 MovieClip Frame 1
stop();