Frame 1
MochiAd.showPreGameAd({id:"d005b3547ade3a2a", res:"800x600"});
mochi.MochiServices.connect("d005b3547ade3a2a");
Frame 2
stop();
var run = true;
onEnterFrame = function () {
if (run == true) {
totaal = _root.getBytesLoaded();
laden = _root.getBytesTotal();
percentage_01 = (totaal / laden) * 100;
percentage_02 = Math.round(percentage_01);
loadtekst = percentage_02 + "%";
if (percentage_02 > 98) {
gotoAndStop (5);
loader.fade = true;
run = false;
}
}
};
Frame 5
towers_build = 0;
tower = new Array[100]();
var tower_selected;
icetowerupgrade = false;
poisontowerupgrade = false;
firetowerupgrade = false;
sound = true;
easy = false;
gold = 300;
goldtext = "gold: " + gold;
score = 0;
scoretext = "Score: " + score;
maplevel = 1;
leveltext = "Level: " + maplevel;
lifes = 20;
lifeText = "Lifes: " + lifes;
waterTowerUpg = 0;
stop();
Frame 10
stop();
Frame 11
delay = 20;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 40;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level1", "minion_level1" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (12);
}
};
Frame 12
delay = 15;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 50;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level2", "minion_level2" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (13);
}
};
Frame 13
delay = 30;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 30;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level3", "minion_level3" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + _root.lifes;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (14);
}
};
Frame 14
delay = 25;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 30;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level4", "minion_level4" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (15);
}
};
Frame 15
delay = 25;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 40;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
if (monsters_placed == 30) {
minion[monsters_placed] = _root.attachMovie("minion_level5_2", "minion_level5_2" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
delay = 40;
} else {
minion[monsters_placed] = _root.attachMovie("minion_level5_1", "minion_level5_1" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
delay = 25;
}
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (16);
}
};
Frame 16
delay = 15;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 40;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level6", "minion_level6" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (17);
}
};
Frame 17
delay = 15;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 50;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(82, 82, 512, 512, 680);
waypoint_y = new Array(65, 446, 446, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level7", "minion_level7" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (18);
}
};
Frame 18
delay = 30;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 30;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level8", "minion_level8" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (19);
}
};
Frame 19
delay = 20;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 25;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level9", "minion_level9" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (20);
}
};
Frame 20
delay = 60;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 1;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level10", "minion_level10" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (21);
}
};
Frame 21
delay = 25;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 35;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level11", "minion_level11" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (22);
}
};
Frame 22
delay = 20;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 30;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(82, 82, 512, 512, 680);
waypoint_y = new Array(65, 446, 446, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level12", "minion_level12" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (23);
}
};
Frame 23
delay = 10;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 40;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level13", "minion_level13" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (24);
}
};
Frame 24
delay = 20;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 40;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level14", "minion_level14" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (25);
}
};
Frame 25
delay = 25;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 30;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
if (monsters_placed == 23) {
minion[monsters_placed] = _root.attachMovie("minion_level15_2", "minion_level15_2" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
delay = 40;
} else {
minion[monsters_placed] = _root.attachMovie("minion_level15", "minion_level15" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
delay = 25;
}
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (26);
}
};
Frame 26
delay = 35;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 25;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level16", "minion_level16" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (27);
}
};
Frame 27
delay = 25;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 40;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level17", "minion_level17" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (28);
}
};
Frame 28
delay = 20;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 30;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(82, 82, 512, 512, 680);
waypoint_y = new Array(65, 446, 446, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level18", "minion_level18" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (29);
}
};
Frame 29
delay = 25;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 40;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
minion[monsters_placed] = _root.attachMovie("minion_level19", "minion_level19" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (30);
}
};
Frame 30
delay = 25;
new_monster = 0;
monsters_placed = 0;
monster_aantal = 60;
minion = new Array[monster_aantal]();
monsters_killed = 0;
waypoint_x = new Array(345, 345, 186, 186, 82, 82, 684, 684, 512, 512, 680);
waypoint_y = new Array(65, 320, 320, 222, 222, 446, 446, 274, 274, 63, 63);
onEnterFrame = function () {
if (monsters_placed < monster_aantal) {
new_monster++;
}
if (new_monster == delay) {
if ((((((((((((monsters_placed == 3) or (monsters_placed == 8)) or (monsters_placed == 14)) or (monsters_placed == 16)) or (monsters_placed == 23)) or (monsters_placed == 26)) or (monsters_placed == 30)) or (monsters_placed == 36)) or (monsters_placed == 38)) or (monsters_placed == 40)) or (monsters_placed == 44)) or (monsters_placed == 46)) {
minion[monstes_placed] = _root.attachMovie("minion_level20_2", "minion_level20_2" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
} else if ((((((((((monsters_placed == monsters_placed) == 6) or (monsters_placed == 15)) or (monsters_placed == 25)) or (monsters_placed == 28)) or (monsters_placed == 33)) or (monsters_placed == 39)) or (monsters_placed == 45)) or (monsters_placed == 50)) or (monsters_placed == 56)) {
minion[monsters_placed] = _root.attachMovie("minion_level20_1", "minion_level20_1" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
} else {
minion[monsters_placed] = _root.attachMovie("minion_level20_3", "minion_level20_3" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-50, _y:75});
}
trace(monsters_placed);
monsters_placed++;
new_monster = 0;
}
if (monster_aantal == monsters_killed) {
_root.gold = _root.gold + Math.round(_root.gold / 10);
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + Math.round(_root.gold / 10);
_root.score = _root.score + _root.lifes;
_root.scoretext = "Score: " + _root.score;
_root.maplevel = _root.maplevel + 1;
_root.leveltext = "Level: " + _root.maplevel;
gotoAndStop (35);
}
};
Frame 31
monsters_killed = monsters_killed - 2;
Frame 32
scorebar = "Score: " + _root.score;
var i = 0;
while (i < 70) {
_root["minion" + i].removeMovieClip();
i++;
}
var i = 0;
while (i < 150) {
_root["base" + i].removeMovieClip();
i++;
}
Frame 33
if (_root.easy == false) {
_root.score = Math.round(_root.score * 1.25);
}
scorebar = "Score: " + _root.score;
var i = 0;
while (i < 70) {
_root["minion" + i].removeMovieClip();
i++;
}
var i = 0;
while (i < 150) {
_root["base" + i].removeMovieClip();
i++;
}
Frame 34
gotoAndPlay (4);
Frame 35
if (_root.easy == false) {
_root.score = Math.round(_root.score * 1.25);
}
scorebar = "Score: " + _root.score;
var i = 0;
while (i < 70) {
_root["minion" + i].removeMovieClip();
i++;
}
var i = 0;
while (i < 150) {
_root["base" + i].removeMovieClip();
i++;
}
Frame 36
gotoAndPlay (4);
Symbol 22 MovieClip [minion_level4] Frame 1
point_to_reach = 0;
normalSpeed = 1.8;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 150;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("soldier.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 5;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 5;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "a bit faster";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 23 MovieClip [minion_level2] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 50;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("soldier.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 4;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 5;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 29 MovieClip [minion_level13] Frame 1
point_to_reach = 0;
normalSpeed = 2.8;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 270;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("spider.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 6;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 8;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "fast";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 33 MovieClip [minion_level12] Frame 1
point_to_reach = 0;
normalSpeed = 1.8;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 400;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = true;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("kraai.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 7;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 8;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "flying";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 38 MovieClip [minion_level18] Frame 1
point_to_reach = 0;
normalSpeed = 1.8;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 750;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = true;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("kraai.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 9;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 10;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "flying";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 39 MovieClip [minion_level7] Frame 1
point_to_reach = 0;
normalSpeed = 1.8;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 100;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = true;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("kraai.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 7;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 7;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "flying";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 42 MovieClip [minion_level10] Frame 1
point_to_reach = 0;
normalSpeed = 1.4;
speed = normalSpeed;
verschilx = 15;
verschily = 15;
life = 2500;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("spider.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 250;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 110;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "BOSS";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 45 MovieClip [minion_level20_3] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 1100;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("spider.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 10;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 12;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 58 MovieClip [minion_level20_2] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 1200;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("spider.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 10;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 12;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 64 MovieClip [minion_level20_1] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = 15;
verschily = 15;
life = 1500;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("soldier.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 10;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 12;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 65 MovieClip [minion_level19] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 1500;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("pig.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 10;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 12;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 66 MovieClip [minion_level15_2] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = random(15);
verschily = random(15);
life = 2200;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("pig.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 100;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 60;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "mini boss";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 70 MovieClip [minion_level17] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 1200;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("soldier.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 9;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 10;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 71 MovieClip [minion_level16] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = random(10) + 10;
verschily = random(10) + 10;
life = 1000;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("soldier.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 9;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 10;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 72 MovieClip [minion_level15] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 550;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("soldier.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 8;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 10;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 75 MovieClip [minion_level14] Frame 1
point_to_reach = 0;
normalSpeed = 1.8;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 550;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("pig.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 7;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 8;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 76 MovieClip [minion_level11] Frame 1
point_to_reach = 0;
normalSpeed = 1.8;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 480;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("pig.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 8;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 8;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "a bit faster";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 77 MovieClip [minion_level9] Frame 1
point_to_reach = 0;
normalSpeed = 2;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 340;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("soldier.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 7;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 8;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "faster";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 78 MovieClip [minion_level8] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 300;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("soldier.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 7;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 7;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "Normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 80 MovieClip [minion_level6] Frame 1
point_to_reach = 0;
normalSpeed = 2.8;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 150;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("pig.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 6;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 7;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "fast";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 81 MovieClip [minion_level3] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 100;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("pig.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 5;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 5;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 82 MovieClip [minion_level5_2] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = 15;
verschily = 15;
life = 1000;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("soldier.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 100;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 50;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "mini boss";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 83 MovieClip [minion_level5_1] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 200;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisoonDamage = 0;
poisonTimer = 0;
var snd = new Sound();
snd.attachSound("spider.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 6;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 8;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 84 MovieClip [minion_level1] Frame 1
point_to_reach = 0;
normalSpeed = 1.3;
speed = normalSpeed;
verschilx = random(30);
verschily = random(30);
life = 15;
if (_root.easy) {
life = life - Math.round(life / 4);
}
hp = life;
fly = false;
frost = false;
frostTime = 0;
poisonTimer = 0;
poisonDamage = 0;
var snd = new Sound();
snd.attachSound("spider.mp3");
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 4;
_root.goldtext = "Gold: " + _root.gold;
_root.score = _root.score + 5;
_root.scoretext = "Score: " + _root.score;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
this.onRollOver = function () {
_root.enemyhp = (("" + life) + "/") + hp;
_root.minion_info = "normal";
};
this.onRollOut = function () {
_root.enemyhp = "";
_root.minion_info = "";
};
if (frost) {
speed = normalSpeed - (normalSpeed / 3);
if (frostTime > 0) {
frostTime--;
} else {
speed = normalSpeed;
frost = false;
}
}
if (poisonTimer > 0) {
if ((((((((((((poisonTimer == 480) or (poisonTimer == 440)) or (poisonTimer == 400)) or (poisonTimer == 360)) or (poisonTimer == 320)) or (poisonTimer == 280)) or (poisonTimer == 240)) or (poisonTimer == 200)) or (poisonTimer == 160)) or (poisonTimer == 120)) or (poisonTimer == 80)) or (poisonTimer == 40)) {
life = life - poisonDamage;
}
poisonTimer--;
}
if ((this._x > 640) and (this._y < 120)) {
_root.monsters_killed++;
_root.lifes--;
_root.lifeText = "Lifes: " + _root.lifes;
if (_root.lifes == 0) {
trace("DIE");
_root.gotoAndStop(33);
}
this.removeMovieClip();
}
};
Symbol 87 MovieClip [minion] Frame 1
point_to_reach = 0;
speed = 1;
verschilx = random(30);
verschily = random(30);
life = 30;
this._name = "minion" + _root.monsters_placed;
this.onEnterFrame = function () {
dist_x = (_root.waypoint_x[point_to_reach] + verschilx) - this._x;
dist_y = (_root.waypoint_y[point_to_reach] + verschily) - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < 4) {
point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x + (speed * Math.cos(angle));
this._y = this._y + (speed * Math.sin(angle));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (life <= 0) {
_root.monsters_killed++;
_root.gold = _root.gold + 5;
_root.goldtext = "Gold: " + _root.gold;
this.removeMovieClip();
}
};
Symbol 94 MovieClip [poisonTower] Frame 1
delay = 0;
can_be_placed = false;
placed = false;
firing = false;
outofmenu = false;
hitcheck = 0;
base_range = 150;
tower_value = 75;
tower_level = 1;
tower_speed = 60;
poisonTime = 400;
poisonDamage = 8;
towerID = _root.towers_build;
tower_update = false;
tower_updateCost = 200;
tower_updatepos = true;
this._name = "base" + towerID;
var snd = new Sound();
snd.attachSound("poisonShot.mp3");
onEnterFrame = function () {
delay++;
if (delay > tower_speed) {
firing = false;
delay = 0;
}
if (hitcheck < 15) {
hitcheck++;
}
if ((placed and (!firing)) and (hitcheck == 15)) {
var _local3 = 0;
while (_local3 < (_root.monster_aantal + 1)) {
distance_from_turret_x = this._x - _root["minion" + _local3]._x;
distance_from_turret_y = this._y - _root["minion" + _local3]._y;
if ((Math.sqrt((distance_from_turret_x * distance_from_turret_x) + (distance_from_turret_y * distance_from_turret_y)) < (base_range / 2)) and (!firing)) {
firing = true;
bullet = _root.attachMovie("poisonBullet", "poisonBullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
bullet.doel = _local3;
bullet.poisonDamage = poisonDamage;
bullet.poisonTime = poisonTime;
if (_root.sound) {
snd.start(0, 1);
}
hitcheck = 0;
}
_local3++;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
this._alpha = 100;
can_be_placed = true;
var _local3 = _root.towers_build - 1;
while (_local3 > 0) {
if (_root["base" + _local3].hitTest(this)) {
this._alpha = 50;
can_be_placed = false;
}
_local3--;
}
if (((_root.cant_build.hitTest(this._x - (this._width / 2), this._y - (this._height / 2), true) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y + (this._height / 2), true)) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y - (this._height / 2), true)) or _root.cant_build.hitTest(this._x - (this._width / 2), this._y + (this._height / 2), true)) {
this._alpha = 50;
can_be_placed = false;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
onMouseDown = function () {
if (can_be_placed and (!placed)) {
placed = true;
_root.gold = _root.gold - 150;
_root.goldtext = "Gold: " + _root.gold;
}
};
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.range._alpha = 50;
_root.range._x = this._x;
_root.range._y = this._y;
_root.range._width = base_range;
_root.range._height = base_range;
}
this.onRollOut = function () {
_root.range._alpha = 0;
};
this.onPress = function () {
if (placed) {
_root.tower_selected = towerID;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
if (tower_level == 1) {
_root.tower_damage = "Damage:10 sec/8 dps";
} else {
_root.tower_damage = "Damage:10 sec/12 dps";
}
_root.tower_cost = "" + tower_updateCost;
_root.select._x = this._x;
_root.select._y = this._y;
_root.select._width = this._width + 4;
_root.select._height = this._height + 4;
_root.upgrade.cost = tower_updateCost;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
_root.sell.can = true;
}
};
if ((tower_level == 2) and tower_update) {
base_range = 150;
tower_value = 175;
tower_speed = 60;
poisonTime = 400;
poisonDamage = 12;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Damage:10 sec/12 dps";
_root.tower_cost = "max";
tower_updatepos = false;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
tower_update = false;
}
if ((this._y < 500) and (!played)) {
outofmenu = true;
}
if (((this._y > 500) and (!played)) and outofmenu) {
_root.range._x = -300;
this.removeMovieClip();
}
};
Symbol 97 MovieClip [iceTower] Frame 1
delay = 0;
can_be_placed = false;
placed = false;
firing = false;
outofmenu = false;
hitcheck = 0;
base_range = 150;
tower_value = 40;
tower_level = 1;
tower_speed = 50;
tower_freezeTime = 80;
towerID = _root.towers_build;
tower_update = false;
tower_updateCost = 80;
tower_updatepos = true;
this._name = "base" + towerID;
var snd = new Sound();
snd.attachSound("iceShot.mp3");
onEnterFrame = function () {
if (_root.waterTowerUpg == 25) {
base_range = 175;
}
if (_root.waterTowerUpg == 50) {
base_range = 200;
}
delay++;
if (delay > tower_speed) {
firing = false;
delay = 0;
}
if (hitcheck < 15) {
hitcheck++;
}
if ((placed and (!firing)) and (hitcheck == 15)) {
var _local3 = 0;
while (_local3 < (_root.monster_aantal + 1)) {
distance_from_turret_x = this._x - _root["minion" + _local3]._x;
distance_from_turret_y = this._y - _root["minion" + _local3]._y;
if (((Math.sqrt((distance_from_turret_x * distance_from_turret_x) + (distance_from_turret_y * distance_from_turret_y)) < (base_range / 2)) and (!firing)) and (_root["minion" + _local3].fly == false)) {
firing = true;
bullet = _root.attachMovie("iceBullet", "iceBullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
bullet.doel = _local3;
bullet.iceTime = tower_freezeTime;
if (_root.sound) {
snd.start(0, 1);
}
hitcheck = 0;
}
_local3++;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
this._alpha = 100;
can_be_placed = true;
var _local3 = _root.towers_build - 1;
while (_local3 > 0) {
if (_root["base" + _local3].hitTest(this)) {
this._alpha = 50;
can_be_placed = false;
}
_local3--;
}
if (((_root.cant_build.hitTest(this._x - (this._width / 2), this._y - (this._height / 2), true) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y + (this._height / 2), true)) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y - (this._height / 2), true)) or _root.cant_build.hitTest(this._x - (this._width / 2), this._y + (this._height / 2), true)) {
this._alpha = 50;
can_be_placed = false;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
onMouseDown = function () {
if (can_be_placed and (!placed)) {
placed = true;
_root.gold = _root.gold - 100;
_root.goldtext = "Gold: " + _root.gold;
}
};
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.range._alpha = 50;
_root.range._x = this._x;
_root.range._y = this._y;
_root.range._width = base_range;
_root.range._height = base_range;
}
this.onRollOut = function () {
_root.range._alpha = 0;
};
this.onPress = function () {
if (placed) {
_root.tower_selected = towerID;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
if (tower_level == 1) {
_root.tower_damage = "Freeze time: 2 sec.";
} else {
_root.tower_damage = "Freeze time: 4 sec.";
}
_root.tower_cost = "" + tower_updateCost;
_root.select._x = this._x;
_root.select._y = this._y;
_root.select._width = this._width + 4;
_root.select._height = this._height + 4;
_root.upgrade.cost = tower_updateCost;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
_root.sell.can = true;
}
};
if ((tower_level == 2) and tower_update) {
base_range = 150;
tower_value = 140;
tower_speed = 50;
tower_freezeTime = 160;
tower_updateCost = 0;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Freeze time: 4 sec.";
_root.tower_cost = "max";
tower_updatepos = false;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
tower_update = false;
}
if ((this._y < 500) and (!played)) {
outofmenu = true;
}
if (((this._y > 500) and (!played)) and outofmenu) {
_root.range._x = -300;
this.removeMovieClip();
}
};
Symbol 100 MovieClip [airTower] Frame 1
delay = 0;
can_be_placed = false;
placed = false;
firing = false;
outofmenu = false;
hitcheck = 0;
base_range = 250;
tower_value = 50;
tower_level = 1;
tower_speed = 10;
tower_damage = 40;
towerID = _root.towers_build;
tower_update = false;
tower_updateCost = 150;
tower_updatepos = true;
this._name = "base" + towerID;
var snd = new Sound();
snd.attachSound("spikeshot.mp3");
onEnterFrame = function () {
delay++;
if (delay > tower_speed) {
firing = false;
delay = 0;
}
if (hitcheck < 15) {
hitcheck++;
}
if ((placed and (!firing)) and (hitcheck == 15)) {
var _local3 = 0;
while (_local3 < (_root.monster_aantal + 1)) {
distance_from_turret_x = this._x - _root["minion" + _local3]._x;
distance_from_turret_y = this._y - _root["minion" + _local3]._y;
if (((Math.sqrt((distance_from_turret_x * distance_from_turret_x) + (distance_from_turret_y * distance_from_turret_y)) < (base_range / 2)) and (!firing)) and _root["minion" + _local3].fly) {
firing = true;
bullet = _root.attachMovie("spikeBullet", "spikeBullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
bullet.doel = _local3;
bullet.damage = tower_damage;
if (_root.sound) {
snd.start(0, 1);
}
hitcheck = 0;
}
_local3++;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
this._alpha = 100;
can_be_placed = true;
var _local3 = _root.towers_build - 1;
while (_local3 > 0) {
if (_root["base" + _local3].hitTest(this)) {
this._alpha = 50;
can_be_placed = false;
}
_local3--;
}
if (((_root.cant_build.hitTest(this._x - (this._width / 2), this._y - (this._height / 2), true) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y + (this._height / 2), true)) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y - (this._height / 2), true)) or _root.cant_build.hitTest(this._x - (this._width / 2), this._y + (this._height / 2), true)) {
this._alpha = 50;
can_be_placed = false;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
onMouseDown = function () {
if (can_be_placed and (!placed)) {
placed = true;
_root.gold = _root.gold - 100;
_root.goldtext = "Gold: " + _root.gold;
}
};
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.range._alpha = 50;
_root.range._x = this._x;
_root.range._y = this._y;
_root.range._width = base_range;
_root.range._height = base_range;
}
this.onRollOut = function () {
_root.range._alpha = 0;
};
this.onPress = function () {
if (placed) {
_root.tower_selected = towerID;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "" + tower_updateCost;
_root.select._x = this._x;
_root.select._y = this._y;
_root.select._width = this._width + 4;
_root.select._height = this._height + 4;
_root.upgrade.cost = tower_updateCost;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
_root.sell.can = true;
}
};
if ((tower_level == 2) and tower_update) {
base_range = 275;
tower_value = 125;
tower_speed = 10;
tower_damage = 88;
tower_updateCost = 250;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "" + tower_updateCost;
_root.upgrade.cost = tower_updateCost;
_root.sell.sellValue = tower_value;
tower_update = false;
}
if ((tower_level == 3) and tower_update) {
base_range = 300;
tower_value = 165;
tower_speed = 15;
tower_damage = 145;
tower_updateCost = 0;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "max";
tower_updatepos = false;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
tower_update = false;
}
if ((this._y < 500) and (!played)) {
outofmenu = true;
}
if (((this._y > 500) and (!played)) and outofmenu) {
_root.range._x = -300;
this.removeMovieClip();
}
};
Symbol 106 MovieClip [waterTower] Frame 1
delay = 0;
can_be_placed = false;
placed = false;
firing = false;
outofmenu = false;
hitcheck = 0;
base_range = 150 + _root.waterTowerUpg;
tower_value = 40;
tower_level = 1;
tower_speed = 10;
tower_damage = 8;
towerID = _root.towers_build;
tower_update = false;
tower_updateCost = 100;
tower_updatepos = true;
this._name = "base" + towerID;
var snd = new Sound();
snd.attachSound("waterShot.mp3");
onEnterFrame = function () {
if (_root.waterTowerUpg == 25) {
base_range = 175;
}
if (_root.waterTowerUpg == 50) {
base_range = 200;
}
delay++;
if (delay > tower_speed) {
firing = false;
delay = 0;
}
if (hitcheck < 15) {
hitcheck++;
}
if ((placed and (!firing)) and (hitcheck == 15)) {
var _local3 = 0;
while (_local3 < (_root.monster_aantal + 1)) {
distance_from_turret_x = this._x - _root["minion" + _local3]._x;
distance_from_turret_y = this._y - _root["minion" + _local3]._y;
if (((Math.sqrt((distance_from_turret_x * distance_from_turret_x) + (distance_from_turret_y * distance_from_turret_y)) < (base_range / 2)) and (!firing)) and (_root["minion" + _local3].fly == false)) {
firing = true;
bullet = _root.attachMovie("waterBullet", "waterBullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
bullet.doel = _local3;
bullet.damage = tower_damage;
if (_root.sound) {
snd.start(0, 1);
}
hitcheck = 0;
}
_local3++;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
this._alpha = 100;
can_be_placed = true;
var _local3 = _root.towers_build - 1;
while (_local3 > 0) {
if (_root["base" + _local3].hitTest(this)) {
this._alpha = 50;
can_be_placed = false;
}
_local3--;
}
if (((_root.cant_build.hitTest(this._x - (this._width / 2), this._y - (this._height / 2), true) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y + (this._height / 2), true)) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y - (this._height / 2), true)) or _root.cant_build.hitTest(this._x - (this._width / 2), this._y + (this._height / 2), true)) {
this._alpha = 50;
can_be_placed = false;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
onMouseDown = function () {
if (can_be_placed and (!placed)) {
placed = true;
_root.gold = _root.gold - 80;
_root.goldtext = "Gold: " + _root.gold;
}
};
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.range._alpha = 50;
_root.range._x = this._x;
_root.range._y = this._y;
_root.range._width = base_range;
_root.range._height = base_range;
}
this.onRollOut = function () {
_root.range._alpha = 0;
};
this.onPress = function () {
if (placed) {
_root.tower_selected = towerID;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "" + tower_updateCost;
_root.select._x = this._x;
_root.select._y = this._y;
_root.select._width = this._width + 4;
_root.select._height = this._height + 4;
_root.upgrade.cost = tower_updateCost;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
_root.sell.can = true;
}
};
if ((tower_level == 2) and tower_update) {
base_range = 150 + _root.waterTowerUpg;
tower_value = 90;
tower_speed = 15;
tower_damage = 18;
tower_updateCost = 150;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "" + tower_updateCost;
_root.upgrade.cost = tower_updateCost;
_root.sell.sellValue = tower_value;
tower_update = false;
}
if ((tower_level == 3) and tower_update) {
base_range = 150 + _root.waterTowerUpg;
tower_value = 165;
tower_speed = 15;
tower_damage = 35;
tower_updateCost = 0;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "max";
tower_updatepos = false;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
tower_update = false;
}
if ((this._y < 500) and (!played)) {
outofmenu = true;
}
if (((this._y > 500) and (!played)) and outofmenu) {
_root.range._x = -300;
this.removeMovieClip();
}
};
Symbol 112 MovieClip [fireTower] Frame 1
delay = 0;
can_be_placed = false;
placed = false;
firing = false;
outofmenu = false;
hitcheck = 0;
base_range = 350;
tower_value = 75;
tower_level = 1;
tower_speed = 70;
tower_damage = 80;
towerID = _root.towers_build;
tower_update = false;
tower_updateCost = 150;
tower_updatepos = true;
this._name = "base" + towerID;
var snd = new Sound();
snd.attachSound("fireShot.mp3");
onEnterFrame = function () {
delay++;
if (delay > tower_speed) {
firing = false;
delay = 0;
}
if (hitcheck < 10) {
hitcheck++;
}
if ((placed and (!firing)) and (hitcheck == 10)) {
var _local3 = 0;
while (_local3 < (_root.monster_aantal + 1)) {
distance_from_turret_x = this._x - _root["minion" + _local3]._x;
distance_from_turret_y = this._y - _root["minion" + _local3]._y;
if ((Math.sqrt((distance_from_turret_x * distance_from_turret_x) + (distance_from_turret_y * distance_from_turret_y)) < (base_range / 2)) and (!firing)) {
firing = true;
bullet = _root.attachMovie("fireBullet", "fireBullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
bullet.doel = _local3;
bullet.damage = tower_damage;
snd.start(0, 1);
hitcheck = 0;
}
_local3++;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
this._alpha = 100;
can_be_placed = true;
var _local3 = _root.towers_build - 1;
while (_local3 > 0) {
if (_root["base" + _local3].hitTest(this)) {
this._alpha = 50;
can_be_placed = false;
}
_local3--;
}
if (((_root.cant_build.hitTest(this._x - (this._width / 2), this._y - (this._height / 2), true) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y + (this._height / 2), true)) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y - (this._height / 2), true)) or _root.cant_build.hitTest(this._x - (this._width / 2), this._y + (this._height / 2), true)) {
this._alpha = 50;
can_be_placed = false;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
onMouseDown = function () {
if (can_be_placed and (!placed)) {
placed = true;
_root.gold = _root.gold - 40;
_root.goldtext = "Gold: " + _root.gold;
}
};
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.range._alpha = 50;
_root.range._x = this._x;
_root.range._y = this._y;
_root.range._width = base_range;
_root.range._height = base_range;
}
this.onRollOut = function () {
_root.range._alpha = 0;
};
this.onPress = function () {
if (placed) {
_root.tower_selected = towerID;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "" + tower_updateCost;
_root.select._x = this._x;
_root.select._y = this._y;
_root.select._width = this._width + 4;
_root.select._height = this._height + 4;
_root.upgrade.cost = tower_updateCost;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
_root.sell.can = true;
}
};
if ((tower_level == 2) and tower_update) {
base_range = 350;
tower_value = 150;
tower_speed = 70;
tower_damage = 140;
tower_updateCost = 200;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "" + tower_updateCost;
_root.upgrade.cost = tower_updateCost;
_root.sell.sellValue = tower_value;
tower_update = false;
}
if ((tower_level == 3) and tower_update) {
base_range = 350;
tower_value = 250;
tower_speed = 70;
tower_damage = 200;
tower_updateCost = 0;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "max";
tower_updatepos = false;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
tower_update = false;
}
if ((this._y < 500) and (!played)) {
outofmenu = true;
}
if (((this._y > 500) and (!played)) and outofmenu) {
_root.range._x = -300;
this.removeMovieClip();
}
};
Symbol 118 MovieClip [arcaneTower] Frame 1
delay = 0;
can_be_placed = false;
placed = false;
firing = false;
outofmenu = false;
hitcheck = 0;
base_range = 200;
tower_value = 30;
tower_level = 1;
tower_speed = 20;
tower_damage = 8;
towerID = _root.towers_build;
tower_update = false;
tower_updateCost = 100;
tower_updatepos = true;
this._name = "base" + towerID;
var snd = new Sound();
snd.attachSound("arcaneShot.mp3");
onEnterFrame = function () {
delay++;
if (delay > tower_speed) {
firing = false;
delay = 0;
}
if (hitcheck < 10) {
hitcheck++;
}
if ((placed and (!firing)) and (hitcheck == 10)) {
var _local3 = 0;
while (_local3 < (_root.monster_aantal + 1)) {
distance_from_turret_x = this._x - _root["minion" + _local3]._x;
distance_from_turret_y = this._y - _root["minion" + _local3]._y;
if ((Math.sqrt((distance_from_turret_x * distance_from_turret_x) + (distance_from_turret_y * distance_from_turret_y)) < (base_range / 2)) and (!firing)) {
firing = true;
bullet = _root.attachMovie("arcaneBullet", "arcaneBullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
bullet.doel = _local3;
bullet.damage = tower_damage;
if (_root.sound) {
snd.start(0, 1);
}
hitcheck = 0;
}
_local3++;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
this._alpha = 100;
can_be_placed = true;
var _local3 = _root.towers_build - 1;
while (_local3 > 0) {
if (_root["base" + _local3].hitTest(this)) {
this._alpha = 50;
can_be_placed = false;
}
_local3--;
}
if (((_root.cant_build.hitTest(this._x - (this._width / 2), this._y - (this._height / 2), true) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y + (this._height / 2), true)) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y - (this._height / 2), true)) or _root.cant_build.hitTest(this._x - (this._width / 2), this._y + (this._height / 2), true)) {
this._alpha = 50;
can_be_placed = false;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
onMouseDown = function () {
if (can_be_placed and (!placed)) {
placed = true;
_root.gold = _root.gold - 60;
_root.goldtext = "Gold: " + _root.gold;
}
};
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.range._alpha = 50;
_root.range._x = this._x;
_root.range._y = this._y;
_root.range._width = base_range;
_root.range._height = base_range;
}
this.onRollOut = function () {
_root.range._alpha = 0;
};
this.onPress = function () {
if (placed) {
_root.tower_selected = towerID;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "" + tower_updateCost;
_root.select._x = this._x;
_root.select._y = this._y;
_root.select._width = this._width + 4;
_root.select._height = this._height + 4;
_root.upgrade.cost = tower_updateCost;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
_root.sell.can = true;
}
};
if ((tower_level == 2) and tower_update) {
base_range = 210;
tower_value = 80;
tower_speed = 20;
tower_damage = 20;
tower_updateCost = 150;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "" + tower_updateCost;
_root.upgrade.cost = tower_updateCost;
_root.sell.sellValue = tower_value;
tower_update = false;
}
if ((tower_level == 3) and tower_update) {
base_range = 220;
tower_value = 155;
tower_speed = 20;
tower_damage = 45;
tower_updateCost = 0;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "max";
tower_updatepos = false;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
tower_update = false;
}
if ((this._y < 500) and (!played)) {
outofmenu = true;
}
if (((this._y > 500) and (!played)) and outofmenu) {
_root.range._x = -300;
this.removeMovieClip();
}
};
Symbol 119 MovieClip [base] Frame 1
delay = 0;
can_be_placed = false;
placed = false;
firing = false;
outofmenu = false;
hitcheck = 0;
base_range = 200;
tower_value = 20;
tower_level = 1;
tower_speed = 35;
tower_damage = 8;
towerID = _root.towers_build;
tower_update = false;
tower_updateCost = 50;
tower_updatepos = true;
this._name = "base" + towerID;
onEnterFrame = function () {
delay++;
if (delay > tower_speed) {
firing = false;
delay = 0;
}
if (hitcheck < 15) {
hitcheck++;
}
if ((placed and (!firing)) and (hitcheck == 15)) {
var _local3 = 0;
while (_local3 < 110) {
distance_from_turret_x = this._x - _root["minion" + _local3]._x;
distance_from_turret_y = this._y - _root["minion" + _local3]._y;
if ((Math.sqrt((distance_from_turret_x * distance_from_turret_x) + (distance_from_turret_y * distance_from_turret_y)) < (base_range / 2)) and (!firing)) {
firing = true;
bullet = _root.attachMovie("bullet", "_root.bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
bullet.doel = _local3;
bullet.damage = tower_damage;
hitcheck = 0;
}
_local3++;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
this._alpha = 100;
can_be_placed = true;
var _local3 = _root.towers_build - 1;
while (_local3 > 0) {
if (_root["base" + _local3].hitTest(this)) {
this._alpha = 50;
can_be_placed = false;
}
_local3--;
}
if (((_root.cant_build.hitTest(this._x - (this._width / 2), this._y - (this._height / 2), true) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y + (this._height / 2), true)) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y - (this._height / 2), true)) or _root.cant_build.hitTest(this._x - (this._width / 2), this._y + (this._height / 2), true)) {
this._alpha = 50;
can_be_placed = false;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
onMouseDown = function () {
if (can_be_placed and (!placed)) {
placed = true;
_root.gold = _root.gold - 40;
_root.goldtext = "Gold: " + _root.gold;
}
};
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.range._alpha = 50;
_root.range._x = this._x;
_root.range._y = this._y;
_root.range._width = base_range;
_root.range._height = base_range;
}
this.onRollOut = function () {
_root.range._alpha = 0;
};
this.onPress = function () {
if (placed) {
_root.tower_selected = towerID;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "" + tower_updateCost;
_root.select._x = this._x;
_root.select._y = this._y;
_root.select._width = this._width + 4;
_root.select._height = this._height + 4;
_root.upgrade.cost = tower_updateCost;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
}
};
if ((tower_level == 2) and tower_update) {
base_range = 210;
tower_value = 60;
tower_speed = 30;
tower_damage = 20;
tower_updateCost = 70;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "" + tower_updateCost;
_root.upgrade.cost = tower_updateCost;
_root.sell.sellValue = tower_value;
tower_update = false;
}
if ((tower_level == 3) and tower_update) {
base_range = 220;
tower_value = 125;
tower_speed = 25;
tower_damage = 45;
tower_updateCost = 0;
_root.tower_lvl = "Tower level: " + tower_level;
_root.tower_value = "" + tower_value;
_root.tower_speed = "Tower Speed: " + tower_speed;
_root.tower_range = "Tower range: " + base_range;
_root.tower_damage = "Tower damage: " + tower_damage;
_root.tower_cost = "max";
tower_updatepos = false;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = tower_value;
tower_update = false;
}
if ((this._y < 500) and (!played)) {
outofmenu = true;
}
if (((this._y > 500) and (!played)) and outofmenu) {
_root.range._x = -300;
this.removeMovieClip();
}
};
Symbol 121 MovieClip [poisonBullet] Frame 1
smokeTimer = 0;
var snd = new Sound();
snd.attachSound("poisonExplosion.mp3");
this.onEnterFrame = function () {
smokeTimer++;
if (smokeTimer > 2) {
iceSmoke = _root.attachMovie("iceSmoke", "iceSmoke" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
smokeTimer = 0;
}
if (_root["minion" + doel] == null) {
doel = doel + 2;
if (_root["minion" + doel] == null) {
this.removeMovieClip();
}
}
distance_from_turret_x = this._x - _root["minion" + doel]._x;
distance_from_turret_y = this._y - _root["minion" + doel]._y;
bulletdir = Math.atan2(distance_from_turret_y, distance_from_turret_x);
angle = Math.atan2(distance_from_turret_y, distance_from_turret_x);
this._x = this._x - (6 * Math.cos(bulletdir));
this._y = this._y - (6 * Math.sin(bulletdir));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (_root["minion" + doel].hitTest(this._x, this._y, true)) {
poisonBoom = _root.attachMovie("poisonBoom", "poisonBoom" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
poisonBoom.poisonTime = poisonTime;
poisonBoom.poisonDamage = poisonDamage;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
};
Symbol 123 MovieClip [iceBullet] Frame 1
smokeTimer = 0;
var snd = new Sound();
snd.attachSound("iceExplosion.mp3");
this.onEnterFrame = function () {
smokeTimer++;
if (smokeTimer > 2) {
iceSmoke = _root.attachMovie("iceSmoke", "iceSmoke" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
smokeTimer = 0;
}
if (_root["minion" + doel] == null) {
doel = doel + 2;
if (_root["minion" + doel] == null) {
this.removeMovieClip();
}
}
distance_from_turret_x = this._x - _root["minion" + doel]._x;
distance_from_turret_y = this._y - _root["minion" + doel]._y;
bulletdir = Math.atan2(distance_from_turret_y, distance_from_turret_x);
angle = Math.atan2(distance_from_turret_y, distance_from_turret_x);
this._x = this._x - (6 * Math.cos(bulletdir));
this._y = this._y - (6 * Math.sin(bulletdir));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (_root["minion" + doel].hitTest(this._x, this._y, true)) {
iceBoom = _root.attachMovie("iceBoom", "iceBoom" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
iceBoom.iceTime = iceTime;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
};
Symbol 125 MovieClip [waterBullet] Frame 1
smokeTimer = 0;
var snd = new Sound();
snd.attachSound("waterSplash.mp3");
this.onEnterFrame = function () {
smokeTimer++;
if (smokeTimer > 2) {
waterSmoke = _root.attachMovie("waterSmoke", "waterSmoke" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
smokeTimer = 0;
}
if (_root["minion" + doel] == null) {
doel = doel + 2;
if (_root["minion" + doel] == null) {
this.removeMovieClip();
}
}
distance_from_turret_x = this._x - _root["minion" + doel]._x;
distance_from_turret_y = this._y - _root["minion" + doel]._y;
bulletdir = Math.atan2(distance_from_turret_y, distance_from_turret_x);
angle = Math.atan2(distance_from_turret_y, distance_from_turret_x);
this._x = this._x - (6 * Math.cos(bulletdir));
this._y = this._y - (6 * Math.sin(bulletdir));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (_root["minion" + doel].hitTest(this._x, this._y, true)) {
waterBoom = _root.attachMovie("waterBoom", "waterBoom" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
waterBoom.damage = damage;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
};
Symbol 127 MovieClip [fireBullet] Frame 1
smokeTimer = 0;
var snd = new Sound();
snd.attachSound("fireExplosion.mp3");
this.onEnterFrame = function () {
smokeTimer++;
if (smokeTimer > 2) {
firesmoke = _root.attachMovie("fire_smoke", "fire_smoke" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
smokeTimer = 0;
}
this._rotation = this._rotation + 10;
if (_root["minion" + doel] == null) {
doel++;
if (_root["minion" + doel] == null) {
this.removeMovieClip();
}
}
distance_from_turret_x = this._x - _root["minion" + doel]._x;
distance_from_turret_y = this._y - _root["minion" + doel]._y;
bulletdir = Math.atan2(distance_from_turret_y, distance_from_turret_x);
this._x = this._x - (6 * Math.cos(bulletdir));
this._y = this._y - (6 * Math.sin(bulletdir));
if (_root["minion" + doel].hitTest(this._x, this._y, true)) {
fireBoom = _root.attachMovie("fireBoom", "fireBoom" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
_root["minion" + doel].life = _root["minion" + doel].life - damage;
snd.start(0, 1);
this.removeMovieClip();
}
};
Symbol 129 MovieClip [spikeBullet] Frame 1
var snd = new Sound();
snd.attachSound("spikeHit.mp3");
this.onEnterFrame = function () {
if (_root["minion" + doel] == null) {
doel++;
if (_root["minion" + doel] == null) {
this.removeMovieClip();
}
}
distance_from_turret_x = this._x - _root["minion" + doel]._x;
distance_from_turret_y = this._y - _root["minion" + doel]._y;
bulletdir = Math.atan2(distance_from_turret_y, distance_from_turret_x);
angle = Math.atan2(distance_from_turret_y, distance_from_turret_x);
this._x = this._x - (8 * Math.cos(bulletdir));
this._y = this._y - (8 * Math.sin(bulletdir));
this._rotation = ((angle / Math.PI) * 180) - 90;
if (_root["minion" + doel].hitTest(this._x, this._y, true)) {
_root["minion" + doel].life = _root["minion" + doel].life - damage;
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
};
Symbol 131 MovieClip [arcaneBullet] Frame 1
var snd = new Sound();
snd.attachSound("arcaneExplosion.mp3");
this.onEnterFrame = function () {
if (_root["minion" + doel] == null) {
doel++;
if (_root["minion" + doel] == null) {
this.removeMovieClip();
}
}
distance_from_turret_x = this._x - _root["minion" + doel]._x;
distance_from_turret_y = this._y - _root["minion" + doel]._y;
bulletdir = Math.atan2(distance_from_turret_y, distance_from_turret_x);
this._x = this._x - (6 * Math.cos(bulletdir));
this._y = this._y - (6 * Math.sin(bulletdir));
if (_root["minion" + doel].hitTest(this._x, this._y, true)) {
_root["minion" + doel].life = _root["minion" + doel].life - damage;
boom1 = _root.attachMovie("boom1", "_root.boom1" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
if (_root.sound) {
snd.start(0, 1);
}
this.removeMovieClip();
}
};
Symbol 134 MovieClip [bullet] Frame 1
gotoAndStop (2);
Symbol 134 MovieClip [bullet] Frame 2
this.onEnterFrame = function () {
this._rotation = this._rotation + 10;
if (_root["minion" + doel] == null) {
doel++;
if (_root["minion" + doel] == null) {
this.removeMovieClip();
}
}
distance_from_turret_x = this._x - _root["minion" + doel]._x;
distance_from_turret_y = this._y - _root["minion" + doel]._y;
bulletdir = Math.atan2(distance_from_turret_y, distance_from_turret_x);
this._x = this._x - (5 * Math.cos(bulletdir));
this._y = this._y - (5 * Math.sin(bulletdir));
if (_root["minion" + doel].hitTest(this._x, this._y, true)) {
_root["minion" + doel].life = _root["minion" + doel].life - damage;
boom1 = _root.attachMovie("boom1", "_root.boom1" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
this.removeMovieClip();
}
};
Symbol 138 MovieClip [poisonBoom] Frame 1
this.onEnterFrame = function () {
var _local3 = 0;
while (_local3 < (_root.monster_aantal + 1)) {
if (this.hitTest(_root["minion" + _local3])) {
if (_root["minion" + _local3].poisonTimer < 2) {
_root["minion" + _local3].poisonTimer = poisonTime;
_root["minion" + _local3].poisonDamage = poisonDamage;
}
}
_local3++;
}
};
Symbol 138 MovieClip [poisonBoom] Frame 45
this.onEnterFrame = function () {
this.removeMovieClip();
};
Symbol 140 MovieClip [iceBoom] Frame 6
this.onEnterFrame = function () {
var _local3 = 0;
while (_local3 < (_root.monster_aantal + 1)) {
if (this.hitTest(_root["minion" + _local3])) {
_root["minion" + _local3].frostTime = iceTime;
_root["minion" + _local3].frost = true;
}
_local3++;
}
};
Symbol 140 MovieClip [iceBoom] Frame 30
this.onEnterFrame = function () {
this.removeMovieClip();
};
Symbol 142 MovieClip [waterBoom] Frame 10
this.onEnterFrame = function () {
var _local3 = 0;
while (_local3 < (_root.monster_aantal + 1)) {
if (this.hitTest(_root["minion" + _local3])) {
_root["minion" + _local3].life = _root["minion" + _local3].life - damage;
}
_local3++;
}
this.removeMovieClip();
};
Symbol 144 MovieClip [fireBoom] Frame 10
this.onEnterFrame = function () {
this.removeMovieClip();
};
Symbol 146 MovieClip [boom1] Frame 10
onEnterFrame = function () {
this.removeMovieClip();
};
Symbol 148 MovieClip [iceSmoke] Frame 25
this.onEnterFrame = function () {
this.removeMovieClip();
};
Symbol 150 MovieClip [waterSmoke] Frame 20
this.onEnterFrame = function () {
this.removeMovieClip();
};
Symbol 152 MovieClip [fire_smoke] Frame 12
this.onEnterFrame = function () {
this.removeMovieClip();
};
Symbol 155 MovieClip [upgradeHouse] Frame 1
can_be_placed = false;
placed = false;
outofmenu = false;
tower_value = 75;
towerID = _root.towers_build;
tower_updatepos = false;
tower_updateCost = 0;
this._name = "base" + towerID;
upgradehouse = true;
onEnterFrame = function () {
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
this._alpha = 100;
can_be_placed = true;
var _local3 = _root.towers_build - 1;
while (_local3 > 0) {
if (_root["base" + _local3].hitTest(this)) {
this._alpha = 50;
can_be_placed = false;
}
_local3--;
}
if (((_root.cant_build.hitTest(this._x - (this._width / 2), this._y - (this._height / 2), true) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y + (this._height / 2), true)) or _root.cant_build.hitTest(this._x + (this._width / 2), this._y - (this._height / 2), true)) or _root.cant_build.hitTest(this._x - (this._width / 2), this._y + (this._height / 2), true)) {
this._alpha = 50;
can_be_placed = false;
}
}
if (!placed) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
onMouseDown = function () {
if (can_be_placed and (!placed)) {
placed = true;
_root.upgradeBTN.build = true;
_root.gold = _root.gold - 150;
_root.goldtext = "Gold: " + _root.gold;
}
};
this.onPress = function () {
if (placed) {
_root.tower_selected = towerID;
_root.tower_value = "" + tower_value;
_root.select._x = this._x;
_root.select._y = this._y;
_root.select._width = this._width + 4;
_root.select._height = this._height + 4;
_root.upgrade.cost = tower_updateCost;
_root.upgrade.upgrade_active = tower_updatepos;
_root.sell.sellValue = 0;
_root.sell.can = false;
_root.houseMenu._x = this._x;
_root.houseMenu._y = this._y;
_root.houseMenu.swapDepths(_root.getNextHighestDepth());
if (_root.houseMenu._x > 730) {
_root.houseMenu._x = 725;
}
if (_root.houseMenu._x < 70) {
_root.houseMenu._x = 75;
}
if (_root.houseMenu._y > 440) {
_root.houseMenu._y = 435;
}
if (_root.houseMenu._y < 60) {
_root.houseMenu._y = 65;
}
_root.houseMenu.moved = true;
}
};
if ((this._y < 500) and (!played)) {
outofmenu = true;
}
if (((this._y > 500) and (!played)) and outofmenu) {
_root.range._x = -300;
this.removeMovieClip();
}
};
Symbol 258 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.31");
}
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 (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 259 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.2");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function 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();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(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 _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _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);
}
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);
}
}
Symbol 260 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 162 MovieClip Frame 1
var fade;
this.onEnterFrame = function () {
this._rotation = this._rotation + 3;
if (fade) {
this._alpha = this._alpha - 6;
}
};
Symbol 169 MovieClip Frame 1
this.onPress = function () {
_root.easy = true;
_root.gotoAndStop(10);
};
Symbol 171 MovieClip Frame 1
this.onPress = function () {
_root.easy = false;
_root.gotoAndStop(10);
};
Symbol 187 MovieClip Frame 1
cost = 0;
upgrade_active = false;
onEnterFrame = function () {
if ((cost <= _root.gold) and upgrade_active) {
this._alpha = 100;
}
if ((cost > _root.gold) or (upgrade_active == false)) {
this._alpha = 50;
}
};
this.onPress = function () {
if ((cost <= _root.gold) and upgrade_active) {
_root["base" + _root.tower_selected].tower_level = _root["base" + _root.tower_selected].tower_level + 1;
_root["base" + _root.tower_selected].tower_update = true;
_root.gold = _root.gold - cost;
_root.goldtext = "Gold: " + _root.gold;
}
};
Symbol 191 MovieClip Frame 1
sellValue = 0;
can = true;
this.onPress = function () {
if (can) {
_root.gold = _root.gold + sellValue;
_root.goldtext = "Gold: " + _root.gold;
if (["base" + _root.tower_selected].upgradehouse) {
_root.upgradeBTN.build = false;
}
_root["base" + _root.tower_selected].removeMovieClip();
sellValue = 0;
_root.select._x = -100;
_root.upgrade.upgrade_active = false;
}
};
Symbol 197 MovieClip Frame 1
this.onEnterFrame = function () {
if ((_root.gold < 150) or (!_root.firetowerupgrade)) {
this._alpha = 50;
} else {
this._alpha = 100;
}
this.onRollOver = function () {
_root.towerinfoText = "Fire tower\nCost: 150\nLong range, big damage, slow firerate";
};
this.onRollOut = function () {
_root.towerinfoText = "";
};
};
this.onPress = function () {
if ((_root.gold >= 150) and _root.firetowerupgrade) {
_root.tower[_root.towers_build] = _root.attachMovie("fireTower", "fireTower" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:80, _y:80});
_root.towers_build++;
}
};
Symbol 199 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.gold < 60) {
this._alpha = 50;
} else {
this._alpha = 100;
}
this.onRollOver = function () {
_root.towerinfoText = "Arcane Tower\nCost: 60\nMedium firerate, medium damage, medium range, ground + air";
};
this.onRollOut = function () {
_root.towerinfoText = "";
};
};
this.onPress = function () {
if (_root.gold >= 60) {
_root.tower[_root.towers_build] = _root.attachMovie("arcaneTower", "arcaneTower" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:80, _y:80});
_root.towers_build++;
}
};
Symbol 202 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.gold < 80) {
this._alpha = 50;
} else {
this._alpha = 100;
}
this.onRollOver = function () {
_root.towerinfoText = "Water tower\nCost: 80\nfast firerate, small splash damage, small range, ground only";
};
this.onRollOut = function () {
_root.towerinfoText = "";
};
};
this.onPress = function () {
if (_root.gold >= 80) {
_root.tower[_root.towers_build] = _root.attachMovie("waterTower", "waterTower" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:80, _y:80});
_root.towers_build++;
}
};
Symbol 206 MovieClip Frame 1
build = false;
this.onEnterFrame = function () {
if ((_root.gold < 150) or build) {
this._alpha = 50;
} else {
this._alpha = 100;
}
this.onRollOver = function () {
_root.towerinfoText = "Upgrade house\nCost: 150\nProvides upgrades for towers.";
};
this.onRollOut = function () {
_root.towerinfoText = "";
};
};
this.onPress = function () {
if ((_root.gold >= 150) and (!build)) {
_root.tower[_root.towers_build] = _root.attachMovie("upgradeHouse", "upgradeHouse" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:80, _y:80});
_root.towers_build++;
}
};
Symbol 208 MovieClip Frame 1
moved = false;
this.onEnterFrame = function () {
if ((((_root._xmouse > (this._x + 70)) or (_root._xmouse < (this._x - 70))) or (_root._ymouse < (this._y - 60))) or (_root._ymouse > (this._y + 60))) {
this._x = -300;
_root.houseMenu.moved = true;
}
if (moved) {
_root.houseUPG_BTN._x = this._x - 65;
_root.houseUPG_BTN._y = this._y - 55;
_root.houseUPG_BTN.swapDepths(_root.getNextHighestDepth());
_root.houseUPG_BTN2._x = this._x - 35;
_root.houseUPG_BTN2._y = this._y - 55;
_root.houseUPG_BTN2.swapDepths(_root.getNextHighestDepth());
_root.houseUPG_BTN3._x = this._x - 5;
_root.houseUPG_BTN3._y = this._y - 55;
_root.houseUPG_BTN3.swapDepths(_root.getNextHighestDepth());
_root.houseUPG_BTN4._x = this._x + 25;
_root.houseUPG_BTN4._y = this._y - 55;
_root.houseUPG_BTN4.swapDepths(_root.getNextHighestDepth());
moved = false;
}
};
Symbol 209 MovieClip Frame 1
cost = 50;
upgrade = 0;
this.onEnterFrame = function () {
if ((_root.gold < cost) or (upgrade == 2)) {
this._alpha = 50;
} else {
this._alpha = 100;
}
this.onRollOver = function () {
if (upgrade < 2) {
_root.towerinfoText = (("Water tower improvement:\nCost: " + cost) + newline) + "+25 range";
} else {
_root.towerinfoText = "Fully upgraded";
}
};
this.onRollOut = function () {
_root.towerinfoText = "";
};
};
this.onPress = function () {
if ((_root.gold >= cost) and (upgrade < 2)) {
_root.waterTowerUpg = _root.waterTowerUpg + 25;
_root.gold = _root.gold - cost;
_root.goldtext = "Gold: " + _root.gold;
cost = cost + 50;
upgrade = upgrade + 1;
if (upgrade < 2) {
_root.towerinfoText = (("Water tower improvement:\nCost: " + cost) + newline) + "+25 range";
} else {
_root.towerinfoText = "Fully upgraded";
}
}
};
Symbol 211 MovieClip Frame 1
this.onEnterFrame = function () {
if ((_root.gold < 100) or (!_root.icetowerupgrade)) {
this._alpha = 50;
} else {
this._alpha = 100;
}
this.onRollOver = function () {
_root.towerinfoText = "Ice tower\nCost: 100\nslow firerate, no damage, slows enemys, ground only";
};
this.onRollOut = function () {
_root.towerinfoText = "";
};
};
this.onPress = function () {
if ((_root.gold >= 100) and _root.icetowerupgrade) {
_root.tower[_root.towers_build] = _root.attachMovie("iceTower", "iceTower" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:80, _y:80});
_root.towers_build++;
}
};
Symbol 213 MovieClip Frame 1
cost = 100;
upgrade = 0;
this.onEnterFrame = function () {
if ((_root.gold < cost) or (upgrade == 1)) {
this._alpha = 50;
} else {
this._alpha = 100;
}
this.onRollOver = function () {
if (upgrade < 1) {
_root.towerinfoText = "Unlock Ice towers\nCost: " + cost;
} else {
_root.towerinfoText = "Fully upgraded";
}
};
this.onRollOut = function () {
_root.towerinfoText = "";
};
};
this.onPress = function () {
if ((_root.gold >= cost) and (upgrade < 1)) {
_root.icetowerupgrade = true;
_root.gold = _root.gold - cost;
_root.goldtext = "Gold: " + _root.gold;
upgrade = upgrade + 1;
if (upgrade < 1) {
_root.towerinfoText = "Unlock Ice towers\nCost: " + cost;
} else {
_root.towerinfoText = "Fully upgraded";
}
}
};
Symbol 215 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.gold < 100) {
this._alpha = 50;
} else {
this._alpha = 100;
}
this.onRollOver = function () {
_root.towerinfoText = "Spike tower\nCost: 100\nfast firerate, medium damage, air only";
};
this.onRollOut = function () {
_root.towerinfoText = "";
};
};
this.onPress = function () {
if (_root.gold >= 100) {
_root.tower[_root.towers_build] = _root.attachMovie("airTower", "airTower" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:80, _y:80});
_root.towers_build++;
}
};
Symbol 217 MovieClip Frame 1
this.onEnterFrame = function () {
if ((_root.gold < 150) or (!_root.poisontowerupgrade)) {
this._alpha = 50;
} else {
this._alpha = 100;
}
this.onRollOver = function () {
_root.towerinfoText = "Poison tower\nCost: 150\nslow firerate, Damage overtime, 1 effect per minnion";
};
this.onRollOut = function () {
_root.towerinfoText = "";
};
};
this.onPress = function () {
if ((_root.gold >= 150) and _root.poisontowerupgrade) {
_root.tower[_root.towers_build] = _root.attachMovie("poisonTower", "poisonTower" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:80, _y:80});
_root.towers_build++;
}
};
Symbol 218 MovieClip Frame 1
cost = 150;
upgrade = 0;
this.onEnterFrame = function () {
if ((_root.gold < cost) or (upgrade == 1)) {
this._alpha = 50;
} else {
this._alpha = 100;
}
this.onRollOver = function () {
if (upgrade < 1) {
_root.towerinfoText = "Unlock Poison towers\nCost: " + cost;
} else {
_root.towerinfoText = "Fully upgraded";
}
};
this.onRollOut = function () {
_root.towerinfoText = "";
};
};
this.onPress = function () {
if ((_root.gold >= cost) and (upgrade < 1)) {
_root.poisontowerupgrade = true;
_root.gold = _root.gold - cost;
_root.goldtext = "Gold: " + _root.gold;
upgrade = upgrade + 1;
if (upgrade < 1) {
_root.towerinfoText = "Unlock Poison towers\nCost: " + cost;
} else {
_root.towerinfoText = "Fully upgraded";
}
}
};
Symbol 220 MovieClip Frame 1
this.onPress = function () {
if (_root.sound) {
_root.sound = false;
this._alpha = 50;
} else {
_root.sound = true;
this._alpha = 100;
}
};
Symbol 222 MovieClip Frame 1
cost = 200;
upgrade = 0;
this.onEnterFrame = function () {
if ((_root.gold < cost) or (upgrade == 1)) {
this._alpha = 50;
} else {
this._alpha = 100;
}
this.onRollOver = function () {
if (upgrade < 1) {
_root.towerinfoText = "Unlock fire towers\nCost: " + cost;
} else {
_root.towerinfoText = "Fully upgraded";
}
};
this.onRollOut = function () {
_root.towerinfoText = "";
};
};
this.onPress = function () {
if ((_root.gold >= cost) and (upgrade < 1)) {
_root.firetowerupgrade = true;
_root.gold = _root.gold - cost;
_root.goldtext = "Gold: " + _root.gold;
upgrade = upgrade + 1;
if (upgrade < 1) {
_root.towerinfoText = "Unlock fire towers\nCost: " + cost;
} else {
_root.towerinfoText = "Fully upgraded";
}
}
};
Symbol 230 MovieClip Frame 1
this.onPress = function () {
_root.gotoAndStop(11);
};
Symbol 246 MovieClip Frame 1
this.onPress = function () {
var _local2 = 0;
while (_local2 < 70) {
_root["minion" + _local2].removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < 150) {
_root["base" + _local2].removeMovieClip();
_local2++;
}
_root.monsters_placed = 70;
_root.gotoAndPlay(4);
};
Symbol 253 MovieClip Frame 1
this.onPress = function () {
mochi.MochiScores.showLeaderboard({boardID:"33a29a46ec626430", score:_root.score});
};