Frame 1
stop();
MochiAd.showPreGameAd({id:"eafead907d083235", res:"640x480"});
mochi.MochiServices.connect("eafead907d083235");
Frame 262
function table_elemen(tower) {
var _local4 = tower.num_element1;
var _local3 = tower.num_element2;
var _local2 = tower.num_element3;
towermenu.affinity = "none";
towermenu.additional_info = "none";
tower.affinity1damage = (tower.affinity2damage = (tower.affinity3damage = (tower.effect = (tower.param1 = (tower.param2 = (tower.range_adder = (tower.speed_adder = 0)))))));
if (_local4 == 0) {
if (_local3 == 0) {
if (_local2 == 1) {
towermenu.affinity = "thunder";
}
if (_local2 == 2) {
towermenu.affinity = "thunder";
tower.speed_adder = tower._delay * 0.25;
towermenu.additional_info = "Cut reload time by 25%";
combine_list.combination_info.info002 = "Reload faster(Aff:thunder)";
}
if (_local2 == 3) {
towermenu.affinity = "thunder";
tower.effect = 9;
tower.param1 = 3 * tower.lvl;
towermenu.additional_info = tower.param1 + "% chance teleport enemy back to entrance";
combine_list.combination_info.info003 = "Teleport(Aff:thunder)";
}
}
if (_local3 == 1) {
if (_local2 == 0) {
towermenu.affinity = "water";
}
if (_local2 == 1) {
towermenu.affinity = "water";
tower.effect = 1;
tower.param1 = 50;
tower.param2 = 90;
towermenu.additional_info = ("Reduce enemy speed by " + tower.param1) + "% for 3 seconds";
combine_list.combination_info.info011 = "Slow(Aff:water)";
}
if (_local2 == 2) {
towermenu.affinity = "thunder";
tower.effect = 4;
tower.param1 = 5 * tower.lvl;
tower.param2 = 90;
towermenu.additional_info = tower.param1 + "% chance freeze enemy in 3 seconds";
combine_list.combination_info.info012 = "Freeze(Aff:thunder)";
}
}
if (_local3 == 2) {
if (_local2 == 0) {
towermenu.affinity = "water";
tower.range_adder = tower._range * 0.25;
towermenu.additional_info = "Add tower range by 25%";
combine_list.combination_info.info020 = "Add range(Aff:water)";
}
if (_local2 == 1) {
towermenu.affinity = "water";
tower.effect = 10;
towermenu.additional_info = "30% money earned after killing enemy";
combine_list.combination_info.info021 = "Wealth(Aff:water)";
}
}
if (_local3 == 3) {
towermenu.affinity = "water";
tower.effect = 13;
towermenu.additional_info = "Replenish health by half enemy damage point after killing";
combine_list.combination_info.info030 = "Life plus(Aff:water)";
}
}
if (_local4 == 1) {
if (_local3 == 0) {
if (_local2 == 0) {
towermenu.affinity = "fire";
}
if (_local2 == 1) {
towermenu.affinity = "thunder";
tower.effect = 5;
tower.param1 = tower._attack / 300;
tower.param2 = 150;
towermenu.additional_info = "Poison damage in 5 seconds, damage according to tower attack";
combine_list.combination_info.info101 = "Poison(Aff:thunder)";
}
if (_local2 == 2) {
towermenu.affinity = "thunder";
tower.effect = 14;
tower.param1 = tower._attack / 600;
tower.param2 = 150;
towermenu.additional_info = "Splash poison damage, damage according to tower attack";
combine_list.combination_info.info102 = "Splash poison(Aff:thunder)";
}
}
if (_local3 == 1) {
if (_local2 == 0) {
towermenu.affinity = "fire";
tower.effect = 2;
towermenu.additional_info = "Splash bullet";
combine_list.combination_info.info110 = "Splash(Aff:fire)";
}
if (_local2 == 1) {
towermenu.affinity = "fire";
tower.effect = 8;
tower.param1 = 2 * tower.lvl;
towermenu.additional_info = tower.param1 + "% chance of instant death";
combine_list.combination_info.info111 = "Instant death(Aff:fire)";
}
}
if (_local3 == 2) {
towermenu.affinity = "water";
tower.effect = 12;
tower.param1 = 10 * tower.lvl;
tower.param2 = 90;
towermenu.additional_info = ("Slow splash attack. Reduce enemy speed by " + tower.param1) + "% for 3 seconds";
combine_list.combination_info.info120 = "Splash slow(Aff:water)";
}
}
if (_local4 == 2) {
if (_local3 == 0) {
if (_local2 == 0) {
towermenu.affinity = "fire";
tower.effect = 6;
tower.param1 = 7 + (3 * tower.lvl);
towermenu.additional_info = tower.param1 + "% chance of double damage";
combine_list.combination_info.info200 = "Double damage(Aff:fire)";
}
if (_local2 == 1) {
towermenu.affinity = "fire";
tower.effect = 11;
tower.param1 = 3 * tower.lvl;
tower.param2 = 90;
towermenu.additional_info = tower.param1 + "% chance to plant a bomb if enemy hp below 50%";
combine_list.combination_info.info201 = "Blown away(Aff:fire)";
}
}
if (_local3 == 1) {
towermenu.affinity = "fire";
tower.effect = 15;
towermenu.additional_info = "Huge range splash";
combine_list.combination_info.info210 = "Splash2(Aff:fire)";
}
}
if (_local4 == 3) {
towermenu.affinity = "fire";
tower.effect = 7;
tower.param1 = 7 + (3 * tower.lvl);
towermenu.additional_info = tower.param1 + "% chance of triple damage";
combine_list.combination_info.info300 = "Triple damage(Aff:fire)";
}
for (var _local5 in table_array) {
my_so.data[table_array[_local5]] = combine_list.combination_info[table_array[_local5]];
}
my_so.flush();
if (towermenu.additional_info != "none") {
towermenu.additional_info = towermenu.additional_info + newline;
} else if (towermenu.affinity != "none") {
towermenu.additional_info = "";
}
if (towermenu.affinity == "thunder") {
tower.affinity1damage = -25;
tower.affinity2damage = 50;
towermenu.additional_info = towermenu.additional_info + (("+" + tower.affinity2damage) + "% dmg on water enemy\n");
towermenu.additional_info = towermenu.additional_info + (tower.affinity1damage + "% dmg on fire enemy");
}
if (towermenu.affinity == "water") {
tower.affinity1damage = 50;
tower.affinity3damage = -25;
towermenu.additional_info = towermenu.additional_info + (("+" + tower.affinity1damage) + "% dmg on fire enemy\n");
towermenu.additional_info = towermenu.additional_info + (tower.affinity3damage + "% dmg on thunder enemy");
}
if (towermenu.affinity == "fire") {
tower.affinity2damage = -25;
tower.affinity3damage = 50;
towermenu.additional_info = towermenu.additional_info + (("+" + tower.affinity3damage) + "% dmg on thunder enemy\n");
towermenu.additional_info = towermenu.additional_info + (tower.affinity2damage + "% dmg on water enemy");
}
tower.range._width = (tower.range._height = (tower._range + tower.range_adder) * 2);
tower.range._x = (tower.range._y = (-tower._range) - tower.range_adder);
tower.cacheAsBitmap = true;
}
function loopkosong() {
}
_root._quality = "MEDIUM";
_root.themode = 1;
var bgm = new Sound();
bgm.attachSound("bgm");
var blown_sound = new Sound();
blown_sound.attachSound("blown_sound");
var shot_sound = new Sound();
shot_sound.attachSound("shot_sound");
var bye = new Sound();
bye.attachSound("bye");
var enemydeath = new Sound();
enemydeath.attachSound("enemydeath");
var yo = new Sound();
yo.attachSound("yo");
var laugh = new Sound();
laugh.attachSound("laugh");
var oow = new Sound();
oow.attachSound("oow");
var yeah = new Sound();
yeah.attachSound("yeah");
var cling = new Sound();
cling.attachSound("cling");
var buysound = new Sound();
buysound.attachSound("buysound");
mute = false;
var color = 3394815;
var alpha = 0.8;
var blurX = 10;
var blurY = 10;
var strength = 3;
var quality = 3;
var inner = false;
var knockout = false;
var filter = (new flash.filters.GlowFilter(color, alpha, blurX, blurY, strength, quality, inner, knockout));
var filterArray = new Array();
filterArray.push(filter);
var filter2 = (new flash.filters.GlowFilter(0, 0, 0, 0, 0, 0, inner, knockout));
var filterArray2 = new Array();
filterArray2.push(filter2);
var table_array = new Array();
var i = 0;
while (i < 6) {
var j = 0;
while (j < 6) {
var k = 0;
while (k < 6) {
var temp = ((i + j) + k);
if ((temp > 1) && (temp < 6)) {
table_array.push((("info" + i) + j) + k);
}
k++;
}
j++;
}
i++;
}
var my_so = SharedObject.getLocal("mushroom_farm_defender", "/");
if (my_so.data.info200 == undefined) {
for (var i in table_array) {
my_so.data[table_array[i]] = "???";
}
my_so.flush();
}
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
index_enemy.animasi.filters = filterArray2;
enemy_info._visible = false;
};
mouseListener.onMouseMove = function () {
if (!game_pause) {
xmouse = _xmouse;
ymouse = _ymouse;
}
};
mouseListener.onMouseUp = function () {
if (!game_pause) {
if (draggedtower._currentframe > 7) {
if (towermenu._visible) {
var _local2 = 1;
while (_local2 < 6) {
if ((towermenu["elementbox" + _local2].hitTest(draggedtower) && (index_tower["slot" + _local2] == 6)) && (towermenu["elementbox" + _local2]._visible)) {
index_tower["slot" + _local2] = draggedtower._currentframe - 7;
index_tower["num_element" + index_tower["slot" + _local2]]++;
_root["element_count" + index_tower["slot" + _local2]]--;
cling.start(0, 1);
break;
}
_local2++;
}
table_elemen(index_tower);
}
draggedtower.gotoAndStop(7);
land.boxpointer._visible = true;
}
}
};
Mouse.addListener(mouseListener);
maxhealth = 50;
cut_tree_price = 200;
ratio_splash_damage = 0.2;
ratio_wealth_effect = 0.3;
element_name = ["Red Ruby", "Blue Pearl", "White Diamond"];
element_type = ["Fire Element", "Water Element", "Thunder Element"];
element_price = [250, 250, 250];
bullet_speed = 14;
tower_name = ["Basic ninja", "Shuriken ninja", "Ice ninja", "Poision ninja", "Instant death ninja", "Ultimate ninja"];
tower_info = ["Basic damage ninja who just can give the pirate basic damage.", "This splash damage ninja who has the area effect can hit more than one at a time", "Ninjas of this type shoot ice darts,freezing the pirates ,when this happen, the effected anemy'speed will be decreased.", "This ninja shoots poison arrows at the pirates,which slowly decreases their health for a certain time", "This ninja have a chance to kill the pirate instantly if the enemy's life is less than 50%.", "You can call this ninja Boss Ninja which is the terminator and has super execution if upgrade to max."];
tower_slot = [1, 2, 3, 1, 4, 5];
tower_max_level = [6, 6, 6, 6, 6, 6];
tower_price = [100, 400, 600, 700, 900, 1100];
tower_upgrade_price = [[100, 150, 200, 300, 500], [300, 500, 700, 900, 1100], [700, 900, 1000, 1200, 1400], [700, 800, 1200, 1300, 1500], [800, 1000, 1100, 1300, 1500], [1300, 1500, 1700, 1900, 2100]];
init_attack_tower = [10, 30, 35, 44, 10, 200];
tower_attack_upgrade = [[0, 5, 10, 10, 10, 10], [0, 25, 25, 30, 40, 50], [0, 30, 35, 35, 50, 60], [0, 30, 35, 35, 50, 70], [0, 10, 10, 15, 15, 15], [0, 100, 100, 100, 100, 125]];
init_range_tower = [100, 95, 100, 100, 100, 160];
tower_range_upgrade = [[0, 5, 5, 10, 10, 10], [0, 5, 5, 10, 10, 15], [0, 2, 3, 5, 10, 10], [0, 5, 5, 10, 10, 20], [0, 5, 5, 5, 10, 15], [0, 5, 5, 10, 10, 20]];
init_delay_tower = [25, 41, 42, 40, 44, 60];
tower_speed_upgrade = [[0, 2, 2, 2, 2, 5], [0, 4, 4, 4, 6, 8], [0, 4, 4, 4, 7, 7], [0, 4, 4, 4, 5, 8], [0, 6, 6, 6, 8, 10], [0, 5, 10, 10, 10, 10]];
delay_built = [[40, 60, 80, 90, 100, 100], [40, 60, 80, 90, 100, 100], [40, 60, 80, 90, 100, 100], [40, 60, 80, 90, 100, 100], [40, 60, 80, 90, 100, 100], [40, 60, 80, 90, 100, 100]];
tower_sell_price = new Array(6);
var i = 0;
while (i < 6) {
tower_sell_price[i] = new Array(tower_max_level[i]);
var j = 0;
while (j < tower_max_level[i]) {
tower_sell_price[i][j] = tower_price[i];
var k = 0;
while (k < j) {
tower_sell_price[i][j] = tower_sell_price[i][j] + tower_upgrade_price[i][k];
k++;
}
tower_sell_price[i][j] = Math.ceil(tower_sell_price[i][j] / 1.2);
j++;
}
i++;
}
total_wave = 300;
wave_sprite = [1, 2, 3, 4, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 5, 3, 4, 1, 2, 3, 4, 5, 4, 3, 2, 1, 5, 1, 2, 3, 4, 4, 3, 2, 1, 5, 4, 3, 2, 1, 2, 3, 4, 5, 4, 3, 2, 1, 4, 1, 2, 3, 4, 5, 4, 3, 3, 1, 5];
wave_numenemy = [11, 11, 12, 12, 16, 12, 10, 12, 10, 8, 14, 15, 12, 12, 2, 14, 8, 12, 12, 12, 8, 12, 18, 10, 3, 8, 12, 18, 14, 8, 12, 14, 12, 12, 3, 12, 10, 12, 14, 12, 8, 12, 14, 16, 3, 10, 12, 14, 16, 6, 12, 12, 14, 16, 2, 12, 8, 12, 14, 16];
wave_delay = [35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35];
wave_enemyspeed = [1.5, 1.5, 2, 2, 1.5, 2, 2.25, 2, 2, 4, 2.25, 2, 2.75, 2.25, 2, 2.75, 4.25, 2.25, 2.25, 2.5, 4.25, 2.25, 2, 2.75, 2, 4, 2.5, 2, 2.5, 3.75, 2.5, 2, 2.75, 2.5, 2, 2.5, 2.75, 3.25, 2, 2, 3.75, 2.5, 2.5, 2, 2, 2.75, 3, 3, 2.75, 4, 3, 3.2, 3.25, 2.5, 2.5, 3.5, 3, 2.75, 3, 3.25];
wave_enemyhp = new Array(total_wave);
init_wave_enemyhp = [32, 43, 57, 72, 88, 107, 128, 157, 188, 217, 261, 297, 350, 413, 1500, 575, 700, 815, 970, 1200, 1325, 1470, 1650, 1800, 3200, 1970, 2400, 2730, 3276, 3931, 3793, 4599, 5428, 6513, 20000, 7620, 8000, 8800, 9700, 10700, 11700, 12900, 13900, 14900, 40000, 15000, 17500, 19000, 22000, 24000, 26300, 29000, 32000, 35500, 120000, 40000, 46000, 52000, 58000, 64000];
wave_enemymoney = [6, 7, 8, 9, 9, 12, 15, 18, 20, 22, 25, 28, 30, 34, 200, 35, 40, 44, 50, 55, 58, 63, 68, 73, 400, 80, 90, 97, 107, 120, 130, 140, 150, 160, 650, 175, 185, 198, 212, 228, 243, 260, 278, 290, 1000, 310, 330, 350, 371, 391, 411, 431, 455, 477, 1200, 507, 557, 617, 670, 720];
wave_enemydamage = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7];
wave_enemyelemen = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3];
init_wave_timer = 1800;
init_sign_appear_timer = 1200;
Frame 263
stop();
bgm.stop();
bgm.start(0, 100000);
cash = 800;
Frame 271
function randRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
function added_wave(posx, posy) {
var _local2 = turn_container.createEmptyMovieClip("turn" + wave_number, turn_container.getNextHighestDepth());
_local2.number = wave_number;
_local2.sprite = wave_sprite[wave_number - 1];
_local2.numenemy = wave_numenemy[wave_number - 1];
enemyspawned = enemyspawned + _local2.numenemy;
_local2.maxdelay = (_local2._delay = wave_delay[wave_number - 1]);
_local2.enemyspeed = wave_enemyspeed[wave_number - 1];
_local2.enemyhp = wave_enemyhp[wave_number - 1];
_local2.enemymoney = wave_enemymoney[wave_number - 1];
_local2.enemydamage = wave_enemydamage[wave_number - 1];
_local2.enemyelemen = wave_enemyelemen[wave_number - 1];
_local2.onEnterFrame = function () {
if (!game_pause) {
if (this.numenemy > 0) {
if (this._delay > 0) {
this._delay--;
} else {
enemymove(posx, posy, this.sprite, 1, this.enemyspeed, this.enemyhp, this.enemymoney, this.enemydamage, this.enemyelemen);
this.numenemy--;
this._delay = this.maxdelay;
}
} else {
this.removeMovieClip();
}
}
};
}
function ledakan_musuh(posx, posy) {
var _local2 = land.bullet_tower.attachMovie("ledakan_mati", "bulletmc" + (bulletcounter++), land.bullet_tower.getNextHighestDepth(), {_x:posx, _y:posy, _xscale:20, _yscale:20});
_local2.onEnterFrame = function () {
if (!game_pause) {
this._xscale = this._xscale + 15;
this._yscale = this._yscale + 15;
if (this._xscale > 120) {
this._alpha = this._alpha - 20;
if (this._alpha <= 0) {
this.removeMovieClip();
}
}
}
};
}
function sell_tower_anim(posx, posy) {
var _local3 = land.bullet_tower.attachMovie("sell_anim", "bulletmc" + (bulletcounter++), land.bullet_tower.getNextHighestDepth(), {_x:posx, _y:posy});
}
function txt_effect(posx, posy, number) {
var _local2 = land.bullet_tower.attachMovie("effect_text", "bulletmc" + (bulletcounter++), land.bullet_tower.getNextHighestDepth(), {_x:posx, _y:posy});
_local2.gotoAndStop(number);
_local2.onEnterFrame = function () {
if (!game_pause) {
this._xscale = this._xscale + 10;
this._yscale = this._yscale + 10;
if (this._xscale > 150) {
this._alpha = this._alpha - 20;
if (this._xscale > 200) {
this.removeMovieClip();
}
}
}
};
}
function percikan_bullet(posx, posy) {
var _local3 = land.bullet_tower.attachMovie("percikan", "bulletmc" + (bulletcounter++), land.bullet_tower.getNextHighestDepth(), {_x:posx, _y:posy});
}
function splash_bullet(last_bullet, type_bullet) {
var _local4 = land.bullet_tower.attachMovie("splash", "bulletmc" + (bulletcounter++), land.bullet_tower.getNextHighestDepth(), {_x:last_bullet._x, _y:last_bullet._y, damage:last_bullet.damage * ratio_splash_damage, size_bullet:0, type_bullet:type_bullet});
if (type_bullet == 2) {
_local4.damage = last_bullet.maxhp / 2;
}
_local4.max_size = 170;
_local4.incrementsize = 15;
if (type_bullet == 4) {
_local4.max_size = 300;
_local4.incrementsize = 30;
}
_local4.param1 = last_bullet.param1;
_local4.param2 = last_bullet.param2;
_local4._xscale = (_local4._yscale = 0);
_local4.onEnterFrame = function () {
if (!game_pause) {
this._xscale = (this._yscale = this.size_bullet);
this.size_bullet = this.size_bullet + this.incrementsize;
if (this.size_bullet >= this.max_size) {
for (var _local4 in mc_musuh) {
if (this.hitTest(mc_musuh[_local4].animasi.body)) {
var _local3 = this._x - mc_musuh[_local4]._x;
var _local2 = this._y - mc_musuh[_local4]._y;
if (Math.sqrt((_local3 * _local3) + (_local2 * _local2)) <= ((this._height / 2) + 15)) {
if (this.type_bullet == 3) {
if (mc_musuh[_local4].poisonduration > 0) {
if (mc_musuh[_local4].poisondamage <= this.param1) {
txt_effect(mc_musuh[_local4]._x, mc_musuh[_local4]._y, "poisoned");
mc_musuh[_local4].poisondamage = this.param1;
mc_musuh[_local4].poisonduration = this.param2;
}
} else {
txt_effect(mc_musuh[_local4]._x, mc_musuh[_local4]._y, "poisoned");
mc_musuh[_local4].poisondamage = this.param1;
mc_musuh[_local4].poisonduration = this.param2;
}
continue;
}
if (this.type_bullet == 1) {
mc_musuh[_local4].hp = mc_musuh[_local4].hp - (this.damage / 4);
if (mc_musuh[_local4].slowduration > 0) {
if (mc_musuh[_local4].slowpercentage <= this.param1) {
txt_effect(mc_musuh[_local4]._x, mc_musuh[_local4]._y, "slowed");
mc_musuh[_local4].slowpercentage = this.param1;
mc_musuh[_local4].slowduration = this.param2;
}
} else {
txt_effect(mc_musuh[_local4]._x, mc_musuh[_local4]._y, "slowed");
mc_musuh[_local4].slowpercentage = this.param1;
mc_musuh[_local4].slowduration = this.param2;
}
continue;
}
mc_musuh[_local4].hp = mc_musuh[_local4].hp - this.damage;
}
}
}
this.removeMovieClip();
}
}
};
}
function bullet_tower(tower) {
shot_sound.start(0, 1);
var _local3 = land.bullet_tower.attachMovie("bulletmc", "bulletmc" + (bulletcounter++), land.bullet_tower.getNextHighestDepth(), {_x:tower._x, _y:tower._y, trip:0, maxtrip:(tower._range + tower.range_adder) + 15, enemy_target:tower.target_enemy});
_local3.tmpdir = Math.atan2(_local3._y - _local3.enemy_target._y, _local3._x - _local3.enemy_target._x);
_local3.cacheAsBitmap = true;
_local3.effect = tower.effect;
_local3.param1 = tower.param1;
_local3.param2 = tower.param2;
_local3.damage = tower._attack + Math.round((tower[("affinity" + _local3.enemy_target.elemen) + "damage"] / 100) * tower._attack);
_local3.onEnterFrame = function () {
if (!game_pause) {
var _local2 = this.enemy_target;
this.dir = Math.atan2(this._y - _local2._y, this._x - _local2._x);
if (!isNaN(this.dir)) {
this.tmpdir = this.dir;
} else {
this.dir = this.tmpdir;
}
this._x = this._x - (bullet_speed * Math.cos(this.dir));
this._y = this._y - (bullet_speed * Math.sin(this.dir));
this.trip = this.trip + bullet_speed;
if (this.hitTest(_local2.animasi.body)) {
_local2.hp = _local2.hp - this.damage;
_local2.effect = this.effect;
switch (_local2.effect) {
case 1 :
if (_local2.slowduration > 0) {
if (_local2.slowpercentage <= this.param1) {
txt_effect(this._x, this._y, "slowed");
_local2.slowpercentage = this.param1;
_local2.slowduration = this.param2;
}
} else {
txt_effect(this._x, this._y, "slowed");
_local2.slowpercentage = this.param1;
_local2.slowduration = this.param2;
}
break;
case 2 :
_local2.hp = _local2.hp + (this.damage * ratio_splash_damage);
splash_bullet(this, 0);
break;
case 4 :
if (randRange(1, 100) <= this.param1) {
txt_effect(this._x, this._y, "freeze");
_local2.freezeduration = this.param2;
}
break;
case 5 :
if (_local2.poisonduration > 0) {
if (_local2.poisondamage <= this.param1) {
txt_effect(this._x, this._y, "poisoned");
_local2.poisondamage = this.param1;
_local2.poisonduration = this.param2;
}
} else {
txt_effect(this._x, this._y, "poisoned");
_local2.poisondamage = this.param1;
_local2.poisonduration = this.param2;
}
break;
case 6 :
if (randRange(1, 100) <= this.param1) {
txt_effect(this._x, this._y, "damage2x");
_local2.hp = _local2.hp - this.damage;
}
break;
case 7 :
if (randRange(1, 100) <= this.param1) {
txt_effect(this._x, this._y, "damage3x");
_local2.hp = _local2.hp - this.damage;
_local2.hp = _local2.hp - this.damage;
}
break;
case 8 :
if (randRange(1, 100) <= this.param1) {
trace(((wave_enemyhp[wave_number - 1] / 2) + " ") + _local2.hp);
trace((_local2.enemyhp / 2) >= _local2.hp);
if (Number(wave_enemyhp[wave_number - 1] / 2) >= Number(_local2.hp)) {
txt_effect(this._x, this._y, "instantdeath");
_local2.hp = 0;
}
}
break;
case 9 :
if (randRange(1, 100) <= this.param1) {
txt_effect(this._x, this._y, "teleport");
_local2._x = point_startx;
_local2._y = 0;
_local2._dir = 1;
enemy.animasi.gotoAndStop(1);
_local2.trip = 0;
}
break;
case 10 :
if (_local2.hp <= 0) {
txt_effect(this._x, this._y, "wealth");
cash = cash + Math.floor(_local2.money * ratio_wealth_effect);
}
break;
case 11 :
if ((_local2.hp <= (_local2.maxhp / 2)) && (randRange(1, 100) <= this.param1)) {
txt_effect(this._x, this._y, "bombplanted");
_local2.blownduration = this.param2;
}
break;
case 12 :
_local2.hp = _local2.hp + (this.damage * ratio_splash_damage);
splash_bullet(this, 1);
break;
case 13 :
if (_local2.hp <= 0) {
txt_effect(this._x, this._y, "life");
health = health + Math.floor(_local2.damage / 2);
if (health > maxhealth) {
health = maxhealth;
}
}
break;
case 14 :
if (_local2.poisonduration > 0) {
if (_local2.poisondamage <= this.param1) {
txt_effect(this._x, this._y, "poisoned");
_local2.poisondamage = this.param1;
_local2.poisonduration = this.param2;
}
} else {
txt_effect(this._x, this._y, "poisoned");
_local2.poisondamage = this.param1;
_local2.poisonduration = this.param2;
}
splash_bullet(this, 3);
break;
case 15 :
splash_bullet(this, 4);
}
percikan_bullet(this._x, this._y);
this.removeMovieClip();
} else if (this.trip > this.maxtrip) {
this.removeMovieClip();
}
}
};
}
function built_tower(posx, posy, attack, range, delay, grass, sprite) {
switch (sprite) {
case 1 :
var _local4 = land.tower.attachMovie("towermc", "towermc" + towercounter, (posy * 500) + towercounter, {_x:posx, _y:posy, target_enemy:undefined, lvl:0, _attack:attack, _range:range, _delay:delay, slot1:4, slot2:4, slot3:4, num_element1:0, num_element2:0, num_element3:0, _delaycounter:0, _grass:grass});
break;
case 2 :
_local4 = land.tower.attachMovie("towermc", "towermc" + towercounter, (posy * 500) + towercounter, {_x:posx, _y:posy, target_enemy:undefined, lvl:0, _attack:attack, _range:range, _delay:delay, slot1:4, slot2:4, slot3:4, num_element1:1, num_element2:1, num_element3:0, _delaycounter:0, _grass:grass});
break;
case 3 :
_local4 = land.tower.attachMovie("towermc", "towermc" + towercounter, (posy * 500) + towercounter, {_x:posx, _y:posy, target_enemy:undefined, lvl:0, _attack:attack, _range:range, _delay:delay, slot1:4, slot2:4, slot3:4, num_element1:0, num_element2:1, num_element3:1, _delaycounter:0, _grass:grass});
break;
case 4 :
_local4 = land.tower.attachMovie("towermc", "towermc" + towercounter, (posy * 500) + towercounter, {_x:posx, _y:posy, target_enemy:undefined, lvl:0, _attack:attack, _range:range, _delay:delay, slot1:4, slot2:4, slot3:4, num_element1:1, num_element2:0, num_element3:1, _delaycounter:0, _grass:grass});
break;
case 5 :
_local4 = land.tower.attachMovie("towermc", "towermc" + towercounter, (posy * 500) + towercounter, {_x:posx, _y:posy, target_enemy:undefined, lvl:0, _attack:attack, _range:range, _delay:delay, slot1:4, slot2:4, slot3:4, num_element1:1, num_element2:1, num_element3:1, _delaycounter:0, _grass:grass});
break;
case 6 :
_local4 = land.tower.attachMovie("towermc", "towermc" + towercounter, (posy * 500) + towercounter, {_x:posx, _y:posy, target_enemy:undefined, lvl:0, _attack:attack, _range:range, _delay:delay, slot1:4, slot2:4, slot3:4, num_element1:0, num_element2:0, num_element3:0, _delaycounter:0, _grass:grass});
}
_local4.tipe = sprite;
_local4.built_counter = delay_built[sprite - 1][0];
_local4._grass.staticblocked = true;
_local4.gotoAndStop(sprite);
var _local13 = map.container.attachMovie("mapnode", "towernode" + towercounter, map.container.getNextHighestDepth(), {_x:_local4._x * scalewidth, _y:_local4._y * scaleheight});
_local4.node = _local13;
_local13.gotoAndStop(2);
towercounter++;
_local4.range._visible = false;
table_elemen(_local4);
_local4.animasi.onRollOver = function () {
if (((!game_pause) && (draggedtower._currentframe == 7)) && (this._parent.built_counter <= 0)) {
this._parent.range._visible = true;
}
};
_local4.animasi.onRollOut = (_local4.animasi.onDragOut = function () {
this._parent.range._visible = false;
});
_local4.animasi.onPress = function () {
if (((((health > 0) && (!game_pause)) && (draggedtower._currentframe == 7)) && (this._parent.built_counter <= 0)) && (_ymouse < stageheight)) {
index_tower = this._parent;
table_elemen(index_tower);
towermenu._visible = true;
towermenu.yes._visible = false;
towermenu.no._visible = false;
}
};
_local4.onEnterFrame = function () {
if (!game_pause) {
if (this.built_counter > 0) {
this.animasi.gotoAndStop(1);
this.built_counter--;
this.built_bar.red_bar._xscale = 100 - (100 * (this.built_counter / delay_built[this.tipe - 1][this.lvl]));
this.built_bar._visible = true;
this.leveltextmc._visible = false;
this._alpha = (this.built_bar.red_bar._xscale / 2) + 50;
if (this.built_counter == 0) {
yo.start(0, 1);
this.animasi.play();
this._attack = this._attack + tower_attack_upgrade[this.tipe - 1][this.lvl];
this._range = this._range + tower_range_upgrade[this.tipe - 1][this.lvl];
this._delay = this._delay - tower_speed_upgrade[this.tipe - 1][this.lvl];
this.lvl++;
table_elemen(this);
this.leveltextmc._visible = true;
this.leveltext = "lv. " + this.lvl;
this.built_bar._visible = false;
this._alpha = 100;
}
} else if (this._delaycounter <= 0) {
if (this.hitTest(mc_musuh)) {
var _local5;
var _local4 = 0;
for (var _local6 in mc_musuh) {
if (this.hitTest(mc_musuh[_local6].animasi.body)) {
var _local3 = this._x - mc_musuh[_local6]._x;
var _local2 = this._y - mc_musuh[_local6]._y;
if (Math.sqrt((_local3 * _local3) + (_local2 * _local2)) <= (this._range + this.range_adder)) {
if (_local4 < mc_musuh[_local6].trip) {
_local4 = mc_musuh[_local6].trip;
_local5 = mc_musuh[_local6];
}
}
}
}
if (_local5 != undefined) {
this.target_enemy = _local5;
bullet_tower(this);
this._delaycounter = this._delay - this.speed_adder;
}
}
} else {
this._delaycounter--;
}
}
};
}
function enemymove(posx, posy, sprite, dir, speed, hp, money, damage, elemen) {
var _local2 = land.enemy.attachMovie("enemymc", "enemymc" + enemycounter, (posy * 500) + enemycounter, {_x:posx, _y:posy, _dir:dir, _speed:speed, _initspeed:speed, maxhp:hp, hp:hp, money:money, damage:damage, elemen:elemen, _number:enemycounter, trip:0});
var _local3 = map.container.attachMovie("mapnode", "enemynode" + enemycounter, map.container.getNextHighestDepth(), {_x:_local2._x * scalewidth, _y:_local2._y * scaleheight});
enemyonscreen++;
_local3.gotoAndStop(1);
_local2.node = _local3;
enemycounter++;
_local2.gotoAndStop(sprite);
_local2.animasi.gotoAndStop(dir);
_local2.slowduration = 0;
_local2.slowpercentage = 0;
_local2.freezeduration = 0;
_local2.poisondamage = 0;
_local2.poisonduration = 0;
_local2.blownduration = -1;
_local2.clickcheck.onPress = function () {
if ((!game_pause) && (_ymouse < stageheight)) {
index_enemy = this._parent;
index_enemy.animasi.filters = filterArray;
enemy_info._visible = true;
}
};
_local2.onEnterFrame = function () {
if (!game_pause) {
if (this.hp > 0) {
if (this._x == point_startx) {
if (this._y < 5) {
this._dir = 1;
this.animasi.gotoAndStop(1);
}
}
this.hp_bar._visible = false;
if (display_info) {
this.hp_bar._visible = true;
}
this.hp_bar.blue_bar._xscale = 100 * (this.hp / this.maxhp);
this._speed = this._initspeed;
if (this.slowduration > 0) {
this._speed = this._speed - ((this._speed * this.slowpercentage) / 100);
this.slowduration--;
}
if (this.freezeduration > 0) {
this._speed = 0;
this.freezeduration--;
}
if (this.blownduration > 0) {
this.blownduration--;
this._speed = this._speed * 3.5;
}
if (this._dir == 1) {
this._y = this._y + this._speed;
}
if (this._dir == 2) {
this._x = this._x + this._speed;
}
if (this._dir == 3) {
this._y = this._y - this._speed;
}
if (this._dir == 4) {
this._x = this._x - this._speed;
}
if (this._dir == 5) {
this._y = this._y - this._speed;
}
if (this._dir == 6) {
this._x = this._x - this._speed;
}
this.trip = this.trip + this._speed;
this.node._x = this._x * scalewidth;
this.node._y = this._y * scaleheight;
if (this._y > landheight) {
oow.start(0, 1);
health = health - this.damage;
this._x = point_startx;
this._y = 0;
this.trip = 0;
this._dir = 1;
this.animasi.gotoAndStop(1);
}
if (((((this._x + land._x) > -20) && ((this._x + land._x) < 570)) && ((this._y + land._y) > -20)) && ((this._y + land._y) < 420)) {
this.swapDepths((this._y * 500) + this._number);
}
if (this.blownduration == 0) {
blown_sound.start(0, 1);
txt_effect(this._x, this._y, "blown");
this.hp = 0;
splash_bullet(this, 2);
}
if (this.poisonduration > 0) {
this.poisonduration--;
this.hp = this.hp - this.poisondamage;
}
}
if (this.hp <= 0) {
enemydeath.start(0, 1);
score = score + this.maxhp;
cash = cash + this.money;
enemyonscreen--;
enemyspawned--;
ledakan_musuh(this._x, this._y);
removeMovieClip(this.node);
removeMovieClip(this);
}
}
};
}
function maingame() {
if (!game_pause) {
if (health <= 0) {
if (gameover._currentframe == 1) {
laugh.start(0, 1);
gameover.gotoAndPlay(2);
}
}
if (wave_number < total_wave) {
wave_timer--;
wave_timer_display = Math.ceil(wave_timer / 30);
if ((wave_timer == init_sign_appear_timer) || (enemyspawned <= 0)) {
if ((next_wave_mc._currentframe == 1) || (next_wave_mc._currentframe == next_wave_mc._totalframes)) {
next_wave_mc.gotoAndPlay(2);
}
}
if (wave_timer <= 0) {
wave_number++;
added_wave(_root.point_startx, 0);
wave_timer = init_wave_timer;
next_wave_mc.play();
}
} else {
wave_timer_display = "--";
next_wave_mc._visible = false;
if (enemyonscreen <= 0) {
endingtimer--;
if (endingtimer <= 0) {
tamat = true;
if (gameover._currentframe == 1) {
gameover.gotoAndPlay(2);
}
}
} else {
endingtimer = 60;
}
}
if (mapmove) {
map.box._x = map._xmouse - (map.box._width / 2);
map.box._y = map._ymouse - (map.box._height / 2);
if (map.box._x < 0) {
map.box._x = 0;
}
if (map.box._y < 0) {
map.box._y = 0;
}
if ((map.box._x + map.box._width) > mapwidth) {
map.box._x = mapwidth - map.box._width;
}
if ((map.box._y + map.box._height) > mapheight) {
map.box._y = mapheight - map.box._height;
}
land._x = (-map.box._x) / scalewidth;
land._y = (-map.box._y) / scaleheight;
}
if (Key.isDown(72)) {
if (!hpressed) {
hpressed = true;
display_info = !display_info;
}
} else {
hpressed = false;
}
if ((Key.isDown(83) || (ymouse > 470)) && ((landheight + land._y) > stageheight)) {
land._y = land._y - scrollspeed;
if ((landheight + land._y) < stageheight) {
land._y = stageheight - landheight;
}
map.box._y = (-land._y) * scaleheight;
}
if ((Key.isDown(87) || (ymouse < 20)) && (land._y < 0)) {
land._y = land._y + scrollspeed;
if (land._y > 0) {
land._y = 0;
}
map.box._y = (-land._y) * scaleheight;
}
if ((Key.isDown(65) || (xmouse < 20)) && (land._x < 0)) {
land._x = land._x + scrollspeed;
if (land._x > 0) {
land._x = 0;
}
map.box._x = (-land._x) * scalewidth;
}
if ((Key.isDown(68) || (xmouse > 630)) && ((landwidth + land._x) > stagewidth)) {
land._x = land._x - scrollspeed;
if ((landwidth + land._x) < stagewidth) {
land._x = stagewidth - landwidth;
}
map.box._x = (-land._x) * scalewidth;
}
if (Key.isDown(32)) {
draggedtower.gotoAndStop(7);
cancelsign._visible = false;
}
}
}
stop();
score = 0;
tamat = false;
endingtimer = 60;
gameover.gotoAndStop(1);
health = maxhealth;
wave_timer = init_wave_timer;
enemyonscreen = 0;
elementbox1.gotoAndStop(1);
elementbox2.gotoAndStop(2);
elementbox3.gotoAndStop(3);
element_count1 = 0;
element_count2 = 0;
element_count3 = 0;
elementbox1.onPress = (elementbox2.onPress = (elementbox3.onPress = function () {
if ((((health > 0) && (draggedtower._currentframe == 7)) && (!game_pause)) && (_root["element_count" + this._currentframe] > 0)) {
draggedtower.gotoAndStop(this._currentframe + 7);
land.boxpointer._visible = false;
}
}));
var i = 1;
while (i < 6) {
_root["elementbox" + i].box._visible = false;
towermenu["elementbox" + i].isi = i;
i++;
}
for (var i in table_array) {
combine_list.combination_info[table_array[i]] = my_so.data[table_array[i]];
}
combine_list._visible = false;
towermenu.upgrade_info._visible = false;
towershop_info._visible = false;
elementshop_info._visible = false;
inventory_info._visible = false;
display_info = true;
enemy_info._visible = false;
enemy_info.elementbox.box._visible = false;
nextwave_info._visible = false;
nextwave_info.elementbox.box._visible = false;
next_wave_mc._visible = true;
next_wave_mc.gotoAndStop(1);
pause_menu._x = 1000;
pause_menu._y = 1000;
draggedtower.gotoAndStop(7);
startDrag (draggedtower, true);
cancelsign._visible = false;
tab_bar.gotoAndStop(1);
tower_shop._visible = true;
element_shop._visible = false;
var i = 1;
while (i < 6) {
element_shop["elementbox" + i].gotoAndStop(i);
element_shop["elementbox" + i].box._visible = false;
element_shop["element_price" + i] = "$" + element_price[i - 1];
element_shop["elementbox" + i].isi = i;
element_shop["elementbox" + i].onRollOver = function () {
if (health > 0) {
elementshop_info.element_name = element_name[this.isi - 1];
elementshop_info.element_type = element_type[this.isi - 1];
elementshop_info._visible = true;
}
};
element_shop["elementbox" + i].onRollOut = (element_shop["elementbox" + i].onDragOut = function () {
elementshop_info._visible = false;
});
element_shop["elementbox" + i].onPress = function () {
if (((health > 0) && (element_price[this.isi - 1] <= cash)) && (!game_pause)) {
buysound.start(0, 1);
cash = cash - element_price[this.isi - 1];
_root["element_count" + this.isi]++;
}
};
element_shop["elementbox" + i].onEnterFrame = function () {
this._alpha = 100;
element_shop["element_prc" + this.isi]._alpha = 100;
if (element_price[this.isi - 1] > cash) {
this._alpha = 40;
element_shop["element_prc" + this.isi]._alpha = 40;
}
};
_root["elementbox" + i].isi = i;
_root["elementbox" + i].onRollOver = function () {
if (health > 0) {
inventory_info.element_name = element_name[this.isi - 1];
inventory_info.element_type = element_type[this.isi - 1];
inventory_info._visible = true;
}
};
_root["elementbox" + i].onRollOut = (_root["elementbox" + i].onDragOut = function () {
inventory_info._visible = false;
});
_root["elementbox" + i].onEnterFrame = function () {
this._alpha = 100;
_root["element_cnt" + this.isi]._alpha = 100;
if (_root["element_count" + this.isi] <= 0) {
this._alpha = 40;
_root["element_cnt" + this.isi]._alpha = 40;
}
};
i++;
}
var i = 1;
while (i < 7) {
tower_shop["foto" + i].gotoAndStop(1);
tower_shop["foto" + i].cacheAsBitmap = true;
tower_shop["foto" + i].isi = i;
tower_shop["foto" + i].onRollOver = function () {
if (this._alpha >= 100) {
towershop_info.nama = tower_name[this.isi - 1];
towershop_info.attack = init_attack_tower[this.isi - 1];
towershop_info.range = init_range_tower[this.isi - 1];
towershop_info.shotdelay = init_delay_tower[this.isi - 1];
towershop_info.infotxt = tower_info[this.isi - 1];
towershop_info._visible = true;
}
};
tower_shop["foto" + i].onRollOut = (tower_shop["foto" + i].onDragOut = function () {
towershop_info._visible = false;
});
tower_shop["foto" + i].onPress = function () {
if (((health > 0) && (tower_price[this.isi - 1] <= cash)) && (!game_pause)) {
cancelsign._visible = true;
draggedtower.gotoAndStop(this.isi);
draggedtower.leveltextmc._visible = false;
draggedtower.built_bar._visible = false;
draggedtower.range._height = (draggedtower.range._width = init_range_tower[this.isi - 1] * 2);
draggedtower.range._x = (draggedtower.range._y = -init_range_tower[this.isi - 1]);
}
};
tower_shop["foto" + i].onEnterFrame = function () {
this._alpha = 100;
tower_shop["hrgtower" + this.isi]._alpha = 100;
if (tower_price[this.isi - 1] > cash) {
this._alpha = 40;
tower_shop["hrgtower" + this.isi]._alpha = 40;
}
};
tower_shop["harga_tower" + i] = "$" + tower_price[i - 1];
i++;
}
cuttreemenu.cut_tree_price = cut_tree_price;
cuttreemenu._visible = false;
towermenu._visible = false;
enemycounter = 0;
towercounter = 0;
bulletcounter = 0;
structurecounter = 0;
game_pause = false;
grasswidth = 50;
divgrasswidth = grasswidth / 2;
if (peta == 1) {
land.bg.attachMovie("mp1", "a", 0);
tilewidth = 21;
tileheight = 15;
landwidth = tilewidth * grasswidth;
landheight = tileheight * grasswidth;
landmap = [[-1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, 10, 1, 1, 3, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, -1, -1, -1, -1], [-1, -1, -1, -1, -2, 2, 0, 0, -1, -1, -1, -1, 0, -2, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, -1, 0, 10, 1, 3, 0, -1, -1, -1, 6, 1, 1, 3, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, 0, 0, 2, -2, 0, -1, -1, 2, 0, 0, 2, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, 0, -2, 10, 1, 3, 0, 0, 2, 0, 0, 2, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, 0, 0, 0, 0, 2, -1, -1, 2, -1, -1, 2, -1, -1, -1, -1, -1], [0, 0, 9, 1, 1, 1, 1, 1, 1, 4, -1, -1, 2, -1, -1, 2, 0, -1, -1, -1, -1], [-1, 0, 2, -2, 0, 0, 0, -2, 0, 0, 0, 0, 2, -1, -1, 2, 0, -1, -1, -1, -1], [-1, 0, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, -2, 0, 2, 0, 0, -1, -1, -1], [-1, -1, 0, -2, 0, -1, -1, 0, 0, -2, 0, 0, 0, 0, 0, 2, 0, 0, -1, -1, -1], [-1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, 0, 0, 2, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1]];
point_startx = (grasswidth * 3) - (grasswidth / 2);
land.exit_sign._x = grasswidth * 16;
land.exit_sign._y = grasswidth * 15;
}
if (peta == 2) {
land.bg.attachMovie("mp2", "a", 0);
tilewidth = 20;
tileheight = 16;
landwidth = tilewidth * grasswidth;
landheight = tileheight * grasswidth;
landmap = [[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1], [-1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 2, -1, -1, -1], [-1, -1, -1, 0, -1, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 2, 0, -1, -1], [-1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 2, 0, 0, 0], [-1, 0, 0, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, -1, -1, 2, 0, 0, 0], [-1, 0, 0, 2, -2, 0, -2, 0, 0, 0, 0, 0, 0, 2, -1, -1, 2, -2, 0, -1], [-1, -1, 0, 10, 1, 1, 1, 1, 1, 1, 3, -1, -1, 2, 0, 0, 2, -1, -1, -1], [-1, -1, 0, 0, 0, 0, -2, 0, 0, -2, 2, -1, -1, 2, -2, 0, 2, -1, -1, -1], [-1, 0, 0, 9, 1, 1, 1, 1, 1, 1, 4, -1, -1, 2, -2, 0, 2, 0, 0, -1], [-1, 0, 0, 2, 0, -2, 0, 0, 0, -1, -1, 0, -2, 2, 0, 0, 2, 0, 0, 0], [-1, -1, -1, 2, 0, 0, 0, -2, 0, -1, -1, 0, 0, 5, 1, 1, 4, -2, 0, 0], [-1, -1, -1, 10, 3, -2, 6, 1, 3, 0, 0, 0, -1, -1, -1, -1, -1, 0, -1, -1], [-1, -1, -1, -1, 10, 1, 7, -2, 10, 1, 3, 0, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1]];
point_startx = (grasswidth * 17) - (grasswidth / 2);
land.exit_sign._x = grasswidth * 11;
land.exit_sign._y = grasswidth * 16;
}
if (peta == 3) {
land.bg.attachMovie("mp3", "a", 0);
tilewidth = 20;
tileheight = 16;
landwidth = tilewidth * grasswidth;
landheight = tileheight * grasswidth;
landmap = [[-1, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, 10, 1, 3, 0, -2, -1, -1, -1, -2, -1, 0, -1, -1, -1, -1, -1], [-1, -1, -1, 0, 0, 2, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1], [-1, -1, -1, -1, 0, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, -1, -1, -1, -1], [-1, -1, -1, -1, -1, 0, 0, 0, -2, 0, 0, 0, 0, 0, -2, 2, -1, -1, -1, -1], [-1, -1, -1, -1, 0, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 0, -1, -1, -1], [-1, -1, -1, -1, 0, 2, 0, -2, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, 0, 2, 0, 0, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1], [-1, -1, -1, 0, 0, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, -1, -1, -1, -1], [-1, -1, 0, 0, 0, 0, 0, -2, 0, 0, -2, 0, 0, -2, 0, 2, -1, -1, -1, -1], [-1, 0, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, -1, -1, -1, -1], [-1, 0, 2, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1], [-1, 0, 1, -1, -1, -1, 0, 0, 6, 1, 1, 1, 1, 1, 1, 3, -1, -1, -1, 0], [-1, 0, 10, 1, 1, 1, 1, 1, 7, -2, 0, 0, 0, 0, 0, 2, -1, -1, -1, -1], [-1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1]];
point_startx = (grasswidth * 4) - (grasswidth / 2);
land.exit_sign1._x = grasswidth * 16;
land.exit_sign1._y = grasswidth * 16;
}
mapwidth = map.perimeter._width;
mapheight = map.perimeter._height;
stagewidth = 550;
stageheight = 400;
map.box._width = (mapwidth * stagewidth) / landwidth;
map.box._height = (mapheight * stageheight) / landheight;
map.box._x = ((-land._x) / stagewidth) * map.box._width;
map.box._y = ((-land._y) / stageheight) * map.box._height;
scalewidth = map.box._width / stagewidth;
scaleheight = map.box._height / stageheight;
map.perimeter.cacheAsBitmap = true;
map.box.cacheAsBitmap = true;
scrollspeed = 20;
map.useHandCursor = false;
if (mute) {
mute_but.gotoAndStop(2);
bgm.setVolume(0);
} else {
mute_but.gotoAndStop(1);
bgm.setVolume(100);
}
wave_number = 0;
enemyspawned = 0;
var mc_musuh = land.enemy;
var i = 1;
while (i < tilewidth) {
var j = 0;
while (j < tileheight) {
var grass = land.bg.attachMovie("grass", (("grass" + i) + "_") + j, land.bg.getNextHighestDepth(), {_x:(i * grasswidth) + divgrasswidth, _y:(j * grasswidth) + divgrasswidth});
if (landmap[j][i] > 0) {
grass.staticblocked = true;
var nodepath = map.container.attachMovie("mapnode", (("pathnode" + i) + "_") + j, map.container.getNextHighestDepth(), {_x:grass._x * scalewidth, _y:grass._y * scaleheight, _height:map.perimeter._height / tileheight, _width:map.perimeter._width / tilewidth});
nodepath._xscale = 120;
nodepath._yscale = 55;
nodepath.gotoAndStop(3);
nodepath.node._x = (-nodepath._width) / 2;
nodepath.node._y = (-nodepath._height) / 2;
nodepath.cacheAsBitmap = true;
}
if (landmap[j][i] <= 0) {
grass.gotoAndStop(1);
grass.staticblocked = false;
if (landmap[j][i] == -1) {
grass.staticblocked = true;
var stone = land.rockmc.attachMovie("rock", "rock" + (structurecounter++), ((j * grasswidth) + (divgrasswidth * 100)) + structurecounter, {_x:(i * grasswidth) + divgrasswidth, _y:(j * grasswidth) + divgrasswidth, cacheAsBitmap:true});
stone.gotoAndStop(randRange(1, 4));
}
if (landmap[j][i] == -2) {
grass.staticblocked = true;
if (peta == 3) {
var pohon = land.rockmc.attachMovie("pohon1", "pohon" + (structurecounter++), ((j * grasswidth) + (divgrasswidth * 100)) + structurecounter, {_x:(i * grasswidth) + divgrasswidth, _y:(j * grasswidth) + divgrasswidth, index_grass:grass, cacheAsBitmap:true});
} else {
var pohon = land.rockmc.attachMovie("pohon", "pohon" + (structurecounter++), ((j * grasswidth) + (divgrasswidth * 100)) + structurecounter, {_x:(i * grasswidth) + divgrasswidth, _y:(j * grasswidth) + divgrasswidth, index_grass:grass, cacheAsBitmap:true});
}
pohon.onRollOver = function () {
this._alpha = 60;
};
pohon.onRollOut = (pohon.onDragOut = function () {
this._alpha = 100;
});
pohon.onPress = function () {
if (((((((health > 0) && (!towermenu._visible)) && (!cuttreemenu._visible)) && (this.index_grass.staticblocked)) && (!game_pause)) && (draggedtower._currentframe == 7)) && (_ymouse < stageheight)) {
if ((this._x + land._x) > (stagewidth / 2)) {
cuttreemenu._x = (this._x + land._x) - cuttreemenu._width;
} else {
cuttreemenu._x = this._x + land._x;
}
if ((this._y + land._y) > (stageheight / 2)) {
cuttreemenu._y = (this._y + land._y) - cuttreemenu._height;
} else {
cuttreemenu._y = this._y + land._y;
}
cuttreemenu._visible = true;
if (peta == 3) {
cuttreemenu.gotoAndStop(2);
} else {
cuttreemenu.gotoAndStop(1);
}
index_tree = this;
}
};
}
} else if (landmap[j][i] < 3) {
grass.gotoAndStop((landmap[j][i] * 3) - 1);
} else if (landmap[j][i] < 7) {
grass.gotoAndStop(3);
grass._rotation = 90 * (landmap[j][i] - 3);
grass.onEnterFrame = function () {
if (this.perim.hitTest(mc_musuh)) {
for (var _local2 in mc_musuh) {
if (this.perim.hitTest(mc_musuh[_local2].animasi.perim_belok)) {
mc_musuh[_local2]._dir--;
if (mc_musuh[_local2]._dir < 1) {
mc_musuh[_local2]._dir = 4;
}
mc_musuh[_local2].animasi.gotoAndStop(mc_musuh[_local2]._dir);
mc_musuh[_local2]._x = this._x;
mc_musuh[_local2]._y = this._y;
}
}
}
};
} else if (landmap[j][i] < 11) {
grass.gotoAndStop(4);
grass._rotation = -90 * (landmap[j][i] - 7);
grass.onEnterFrame = function () {
if (this.perim.hitTest(mc_musuh)) {
for (var _local2 in mc_musuh) {
if (this.perim.hitTest(mc_musuh[_local2].animasi.perim_belok)) {
mc_musuh[_local2]._dir++;
if (mc_musuh[_local2]._dir > 4) {
mc_musuh[_local2]._dir = 1;
}
mc_musuh[_local2].animasi.gotoAndStop(mc_musuh[_local2]._dir);
mc_musuh[_local2]._x = this._x;
mc_musuh[_local2]._y = this._y;
}
}
}
};
} else {
grass.gotoAndStop(6);
}
grass.useHandCursor = false;
grass.cacheAsBitmap = true;
grass.onPress = function () {
if (((((!this.staticblocked) && (_ymouse < stageheight)) && (!game_pause)) && (tower_price[draggedtower._currentframe - 1] <= cash)) && (draggedtower._currentframe < 7)) {
cash = cash - tower_price[draggedtower._currentframe - 1];
cancelsign._visible = false;
built_tower(this._x, this._y, init_attack_tower[draggedtower._currentframe - 1], init_range_tower[draggedtower._currentframe - 1], init_delay_tower[draggedtower._currentframe - 1], this, draggedtower._currentframe);
draggedtower.gotoAndStop(7);
}
};
grass.onRollOver = function () {
land.boxpointer._x = this._x;
land.boxpointer._y = this._y;
land.boxpointer.gotoAndStop(1);
if (this.staticblocked) {
land.boxpointer.gotoAndStop(2);
}
};
grass.onRollOut = function () {
land.boxpointer._x = -1000;
land.boxpointer._y = -1000;
};
j++;
}
i++;
}
land.bg.cacheAsBitmap = true;
land.rockmc.cacheAsBitmap = true;
map.onPress = function () {
mapmove = true;
};
map.onRelease = function () {
mapmove = false;
};
map.onReleaseOutside = function () {
mapmove = false;
};
onEnterFrame = maingame;
Instance of Symbol 346 MovieClip "mute_but" in Frame 271
on (release) {
_root.mute = !_root.mute;
if (_root.mute) {
_root.mute_but.gotoAndStop(2);
_root.bgm.setVolume(0);
} else {
_root.mute_but.gotoAndStop(1);
_root.bgm.setVolume(100);
}
}
Frame 280
if (_root.themode == 1) {
score = score;
}
if (_root.themode == 2) {
score = score * 2;
}
if (_root.themode == 3) {
score = score * 5;
}
stop();
onEnterFrame = loopkosong;
mochi.MochiScores.showLeaderboard({boardID:"867935bcd182bad3", score:score});
Frame 281
_root.gotoAndPlay("theend");
Frame 289
if (_root.themode == 1) {
score = score;
}
if (_root.themode == 2) {
score = score * 2;
}
if (_root.themode == 3) {
score = score * 5;
}
stop();
onEnterFrame = loopkosong;
mochi.MochiScores.showLeaderboard({boardID:"867935bcd182bad3", score:score});
Frame 290
_root.gotoAndPlay("theend");
Frame 295
stop();
Frame 296
stop();
mochi.MochiScores.showLeaderboard({boardID:"867935bcd182bad3"});
Frame 297
_root.gotoAndPlay("opening");
Symbol 33 MovieClip [percikan] Frame 15
this.removeMovieClip();
Symbol 424 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.32");
}
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";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.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();
_rcvChannel.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 _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.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];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._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:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 425 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.6");
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
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) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
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) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
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);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
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);
}
}
Symbol 426 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.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 (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.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 166 Button
on (release) {
getURL ("http://www.flashninjaclan.com/", "_blank");
}
Symbol 176 Button
on (release) {
getURL ("http://www.flashninjaclan.com", "_blank");
}
Symbol 181 Button
on (release) {
getURL ("http://www.java-gaming.com", "_blank");
}
Symbol 183 Button
on (release) {
getURL ("http://www.flashninjaclan.com", "_blank");
}
Symbol 192 Button
on (release) {
_root.yeah.start(0, 1);
_parent.instruction = true;
_root.menu_utama.menu_utama.play();
}
Symbol 195 Button
on (release) {
_root.yo.start(0, 1);
_root.gotoAndStop("thescores");
}
Symbol 199 Button
on (release) {
getURL ("http://www.flashninjaclan.com/qqq2_strategy_games.php", "_blank");
}
Symbol 206 Button
on (release) {
_root.menu_utama.menu_utama.gotoAndStop(1);
}
Symbol 207 Button
on (release) {
_parent.play();
}
Symbol 218 MovieClip Frame 1
stop();
Symbol 218 MovieClip Frame 6
stop();
Symbol 221 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 6
stop();
Symbol 224 MovieClip Frame 1
stop();
Symbol 224 MovieClip Frame 6
stop();
Symbol 226 Button
on (rollOver) {
map1.gotoAndPlay(1);
}
on (rollOut) {
map1.gotoAndStop(1);
}
on (release) {
_root.peta = 1;
play();
}
Symbol 228 Button
on (rollOver) {
map2.gotoAndPlay(1);
}
on (rollOut) {
map2.gotoAndStop(1);
}
on (release) {
_root.peta = 2;
play();
}
Symbol 230 Button
on (rollOver) {
map3.gotoAndPlay(1);
}
on (rollOut) {
map3.gotoAndStop(1);
}
on (release) {
_root.peta = 3;
play();
}
Symbol 235 Button
on (release) {
_root.total_wave = 1000;
_root.themode = 3;
var i = 60;
while (i <= _root.total_wave) {
_root.wave_sprite.push(_root.wave_sprite[i - 60]);
_root.wave_numenemy.push(_root.wave_numenemy[i - 60]);
_root.wave_delay.push(_root.wave_delay[i - 60]);
_root.wave_enemyelemen.push(_root.wave_enemyelemen[i - 60]);
_root.wave_enemyspeed.push(_root.wave_enemyspeed[i - 1] + 0.02);
_root.init_wave_enemyhp.push(_root.init_wave_enemyhp[i - 1] * 1.06);
_root.wave_enemymoney.push(_root.wave_enemymoney[i - 1] * 1.03);
_root.wave_enemydamage.push(_root.wave_enemydamage[i - 60] + 6);
i++;
}
_root.yeah.start(0, 1);
var i = 0;
while (i < _root.total_wave) {
_root.wave_enemyhp[i] = Math.round(_root.init_wave_enemyhp[i] * 0.9);
i++;
}
_parent.play();
}
Symbol 238 Button
on (release) {
_root.themode = 2;
_root.total_wave = 50;
_root.yeah.start(0, 1);
var i = 0;
while (i < _root.total_wave) {
_root.wave_enemyhp[i] = Math.round(_root.init_wave_enemyhp[i] * 0.72);
i++;
}
_parent.play();
}
Symbol 241 Button
on (release) {
_root.themode = 1;
trace(_root.total_wave);
_root.total_wave = 40;
_root.yeah.start(0, 1);
var i = 0;
while (i < _root.total_wave) {
_root.wave_enemyhp[i] = Math.round(_root.init_wave_enemyhp[i] * 0.6);
i++;
}
_parent.play();
}
Symbol 242 MovieClip Frame 1
stop();
Symbol 242 MovieClip Frame 2
stop();
Symbol 242 MovieClip Frame 3
stop();
_parent.play();
Symbol 246 MovieClip Frame 1
stop();
instruction = false;
Symbol 246 MovieClip Frame 2
if (instruction) {
gotoAndPlay ("instruction");
}
Symbol 246 MovieClip Frame 3
stop();
Symbol 246 MovieClip Frame 4
gotoAndPlay (55);
Symbol 246 MovieClip Frame 6
stop();
Symbol 246 MovieClip Frame 7
stop();
Symbol 246 MovieClip Frame 8
_root.gotoAndStop("maingame");
Symbol 264 Button
on (release) {
if (!_root.game_pause) {
this._visible = false;
}
}
Symbol 267 Button
on (release) {
if (!_root.game_pause) {
if ((_root.cash >= _root.cut_tree_price) and _root.index_tree.index_grass.staticblocked) {
_root.cash = _root.cash - _root.cut_tree_price;
_root.index_tree.index_grass.staticblocked = false;
_root.index_tree.onEnterFrame = function () {
this._xscale = this._xscale - 10;
this._yscale = this._yscale - 10;
this._alpha = this._alpha - 10;
if (this._xscale <= 0) {
this.removeMovieClip();
}
};
this._visible = false;
}
}
}
Symbol 277 Button
on (release) {
if (!_root.game_pause) {
var tower = _root.index_tower;
if ((tower.lvl < _root.tower_max_level[tower._currentframe - 1]) and (_root.cash >= _root.tower_upgrade_price[tower._currentframe - 1][tower.lvl - 1])) {
_root.cash = _root.cash - _root.tower_upgrade_price[tower._currentframe - 1][tower.lvl - 1];
tower.built_counter = _root.delay_built[tower._currentframe - 1][tower.lvl];
this._visible = false;
trace(_root.cash);
trace(tower.lvl);
}
}
}
on (rollOut) {
upgrade_info._visible = false;
}
on (dragOut) {
upgrade_info._visible = false;
}
Symbol 280 Button
on (release) {
if (!_root.game_pause) {
yes._visible = true;
no._visible = true;
}
}
Symbol 285 Button
on (release) {
if (!_root.game_pause) {
this._visible = false;
elementbox2._visible = (elementbox3._visible = false);
}
}
Symbol 293 Button
on (release) {
if (!_root.game_pause) {
_root.bye.start(0, 1);
var tower = _root.index_tower;
_root.sell_tower_anim(tower._x, tower._y);
var i = 1;
while (i < 6) {
if (tower["slot" + i] < 6) {
_root["element_count" + tower["slot" + i]]++;
}
i++;
}
_root.cash = _root.cash + _root.tower_sell_price[tower._currentframe - 1][tower.lvl - 1];
tower._grass.staticblocked = false;
tower.node.removeMovieClip();
tower.removeMovieClip();
this._visible = false;
}
}
Symbol 298 Button
on (release) {
if (!_root.game_pause) {
yes._visible = false;
no._visible = false;
}
}
Symbol 310 MovieClip Frame 1
this.onEnterFrame = function () {
if (this._visible) {
var _local3 = _root.index_tower;
lvup_button._visible = false;
lvup_price = "";
lvup_info = "";
if (_local3.lvl < _root.tower_max_level[_local3._currentframe - 1]) {
lvup_price = "$ " + _root.tower_upgrade_price[_local3._currentframe - 1][_local3.lvl - 1];
lvup_button._visible = true;
lvup_button._alpha = 50;
if (_root.cash >= _root.tower_upgrade_price[_local3._currentframe - 1][_local3.lvl - 1]) {
lvup_button._alpha = 100;
}
}
sell_price = "$ " + _root.tower_sell_price[_local3._currentframe - 1][_local3.lvl - 1];
info = (_root.tower_name[_local3._currentframe - 1] + " lv. ") + _local3.lvl;
attack = _local3._attack;
range = _local3._range;
range_adder = _local3.range_adder;
shotdelay = _local3._delay;
speed_adder = _local3.speed_adder;
slotnumber = _root.tower_slot[_local3._currentframe - 1];
elementbox1.gotoAndStop(_local3.slot1);
elementbox2._visible = (elementbox3._visible = false);
if (slotnumber >= 2) {
elementbox2._visible = true;
elementbox2.gotoAndStop(_local3.slot2);
}
if (slotnumber > 2) {
elementbox3._visible = true;
elementbox3.gotoAndStop(_local3.slot3);
}
}
};
Symbol 315 Button
on (release) {
if ((((this._currentframe == 5) and (_root.wave_timer > 0)) and (_root.wave_number < _root.total_wave)) and (!_root.game_pause)) {
_root.yeah.start(0, 1);
_root.wave_number++;
_root.added_wave(_root.point_startx, 0);
_root.cash = _root.cash + (Math.ceil(_root.wave_timer / 30) * 2);
_root.score = _root.score + Math.ceil(_root.wave_timer / 30);
_root.wave_timer = _root.init_wave_timer;
this.play();
}
}
on (rollOver) {
_root.nextwave_info.numenemy = _root.wave_numenemy[_root.wave_number];
_root.nextwave_info.enemyspeed = _root.wave_enemyspeed[_root.wave_number];
_root.nextwave_info.enemyhp = _root.wave_enemyhp[_root.wave_number];
_root.nextwave_info.enemymoney = _root.wave_enemymoney[_root.wave_number];
_root.nextwave_info.enemydamage = _root.wave_enemydamage[_root.wave_number];
_root.nextwave_info.elementbox.gotoAndStop(_root.wave_enemyelemen[_root.wave_number]);
_root.nextwave_info._visible = true;
}
on (rollOut) {
_root.nextwave_info._visible = false;
}
on (dragOut) {
_root.nextwave_info._visible = false;
}
Symbol 316 MovieClip Frame 5
stop();
Symbol 316 MovieClip Frame 10
stop();
Symbol 353 MovieClip Frame 1
this.onEnterFrame = function () {
if (this._visible) {
var _local3 = _root.index_enemy;
if (_local3.hp == undefined) {
this._visible = false;
} else {
enemyhp = (Math.round(_local3.hp) + "/") + _local3.maxhp;
enemyspeed = _local3._speed;
enemymoney = _local3.money;
elementbox.gotoAndStop(_local3.elemen);
enemydamage = _local3.damage;
slowmc._visible = false;
if (_local3.slowduration > 0) {
slowmc._visible = true;
}
poisonmc._visible = false;
if (_local3.poisonduration > 0) {
poisonmc._visible = true;
}
bombmc._visible = false;
if (_local3.blownduration > 0) {
bombmc._visible = true;
}
}
}
};
Symbol 370 Button
on (release) {
_root._quality = "LOW";
}
Symbol 373 Button
on (release) {
_root._quality = "MEDIUM";
}
Symbol 376 Button
on (release) {
_root._quality = "HIGH";
}
Symbol 378 Button
on (release) {
if (!_root.combine_list._visible) {
yes._visible = false;
no._visible = false;
}
}
Symbol 379 Button
on (release) {
if (!_root.combine_list._visible) {
_root.gotoAndStop("opening");
}
}
Symbol 383 Button
on (release) {
if (!_root.combine_list._visible) {
yes._visible = true;
no._visible = true;
}
}
Symbol 386 Button
on (release) {
if (!_root.combine_list._visible) {
this._x = 1000;
this._y = 1000;
_root.game_pause = false;
}
}
Symbol 399 MovieClip Frame 1
_root.game_pause = true;
Symbol 399 MovieClip Frame 31
_root.game_pause = false;
_root.next_wave_mc.gotoAndPlay(1);
this._y = 1000;
this._visible = false;
this.stop();
Symbol 401 MovieClip Frame 19
if (_root.tamat) {
_root.gotoAndStop("ending");
} else if (_root.health <= 0) {
_root.gotoAndStop("gameover");
}
Symbol 404 Button
on (release) {
if ((_root.health > 0) and (!_root.gamestart._visible)) {
_root.pause_menu._x = 125.2;
_root.pause_menu._y = 90;
_root.pause_menu.yes._visible = false;
_root.pause_menu.no._visible = false;
_root.game_pause = true;
}
}
Symbol 417 Button
on (release) {
_root.gotoAndStop("opening");
}
Symbol 420 MovieClip Frame 1
stop();
submitScore.Score = _root.score;
Symbol 422 Button
on (release) {
getURL ("http://www.flashninjaclan.com/qqq2_strategy_games.php", "_blank");
}