Frame 1
_root.kongregateServices.connect();
_root.attachMovie("mochi_boards", "mochi_boards", 156);
mochi.MochiServices.connect("52c6eaa360bc3f03", mochi_boards);
var myContextMenu = new ContextMenu(menuHandler);
myContextMenu.hideBuiltInItems();
myContextMenu.builtInItems.quality = true;
menu = myContextMenu;
MochiAd.showPreGameAd({id:"52c6eaa360bc3f03", res:"650x450"});
var _mochiads_game_id = "52c6eaa360bc3f03";
Frame 2
stop();
var bytes_loaded = 0;
var bytes_total = Math.round(this.getBytesTotal());
var getPercent = 0;
var dynamic_text_string = (("0/" + bytes_total) + " bytes loaded");
var debugText;
loading_info_box.text = dynamic_text_string;
onEnterFrame = function () {
bytes_loaded = Math.round(this.getBytesLoaded());
getPercent = bytes_loaded / bytes_total;
dynamic_text_string = ((bytes_loaded + "/") + bytes_total) + " bytes loaded";
bottom_bar.loading_info_box.text = dynamic_text_string;
top_bar.percentage_loaded_box.text = (getPercent * 100) + "%";
big_blocker_bar._x = 550 + (getPercent * 535);
if (bytes_loaded == bytes_total) {
gotoAndStop ("play_button");
}
};
Frame 4
teh_awesome_button.onRelease = function () {
_root.createEmptyMovieClip("menusnd", 2056);
_root.menu_song = new Sound(menusnd);
_root.menu_song.attachSound("KeyToYourSoul");
_root.menu_song.start(0, 99999);
_root.menu_song.setVolume(100);
MochiAd.unload(_root.teh_ad_box);
removeMovieClip(teh_ad_box);
gotoAndStop ("menu_frame");
};
var menu_mute = 0;
attachMovie("teh_ad_box", "teh_ad_box", 19996, {_x:175, _y:175});
MochiAd.showClickAwayAd({id:"52c6eaa360bc3f03", clip:_root.teh_ad_box});
Frame 5
menu_block.play();
Key.removeListener(keyListener);
keyListener = new Object();
keyListener.onKeyDown = function () {
var _local1 = Key.getCode();
if (!(_local1 === 77)) {
} else if (menu_mute == 0) {
menu_mute = 1;
menu_song.stop();
} else {
menu_mute = 0;
menu_song.start(0, 99999);
}
};
Key.addListener(keyListener);
link_1.onRelease = function () {
getURL ("http://batterytime.110mb.com/", "_blank");
};
onMouseDown = function () {
};
game_song.stop();
var difficulty_level = 1;
var found_save = false;
easy_box._alpha = 100;
medium_box._alpha = 0;
hard_box._alpha = 0;
impossible_box._alpha = 0;
onEnterFrame = function () {
};
high_scores.onRelease = function () {
Mouse.show();
if (difficulty_level == 1) {
mochi.MochiScores.showLeaderboard({boardID:"a7a6a0ad24085b4f", res:"650x450", numScores:20});
}
if (difficulty_level == 2) {
mochi.MochiScores.showLeaderboard({boardID:"a7e581023f564ad7", res:"650x450", numScores:20});
}
if (difficulty_level == 3) {
mochi.MochiScores.showLeaderboard({boardID:"ef8d99a16370fdb2", res:"650x450", numScores:20});
}
if (difficulty_level == 4) {
mochi.MochiScores.showLeaderboard({boardID:"9402d6b67c587edd", res:"650x450", numScores:20});
}
};
instructions.onRelease = function () {
l_to_r.which_frame = "instructions_panel1";
l_to_r.play();
};
credits.onRelease = function () {
l_to_r.which_frame = "credits_page";
l_to_r.play();
};
play_button.onRelease = function () {
l_to_r.which_frame = "main_screen";
l_to_r.play();
};
load_game.onRelease = function () {
var _local1 = SharedObject.getLocal("TOTNeoniumSave");
if (_local1.data.ASX == undefined) {
} else {
found_save = true;
l_to_r.which_frame = "main_screen";
l_to_r.play();
}
};
easy.onRelease = function () {
easy_box._alpha = 100;
if (difficulty_level == 2) {
medium_box._alpha = 0;
}
if (difficulty_level == 3) {
hard_box._alpha = 0;
}
if (difficulty_level == 4) {
impossible_box._alpha = 0;
}
difficulty_level = 1;
};
medium.onRelease = function () {
medium_box._alpha = 100;
if (difficulty_level == 1) {
easy_box._alpha = 0;
}
if (difficulty_level == 3) {
hard_box._alpha = 0;
}
if (difficulty_level == 4) {
impossible_box._alpha = 0;
}
difficulty_level = 2;
};
hard.onRelease = function () {
hard_box._alpha = 100;
if (difficulty_level == 1) {
easy_box._alpha = 0;
}
if (difficulty_level == 2) {
medium_box._alpha = 0;
}
if (difficulty_level == 4) {
impossible_box._alpha = 0;
}
difficulty_level = 3;
};
impossible.onRelease = function () {
impossible_box._alpha = 100;
if (difficulty_level == 1) {
easy_box._alpha = 0;
}
if (difficulty_level == 3) {
hard_box._alpha = 0;
}
if (difficulty_level == 2) {
medium_box._alpha = 0;
}
difficulty_level = 4;
};
Frame 6
function XOR(tMsg, tKey, tKeyIndex) {
tEncoded = "";
i = 0;
while (i < tMsg.length) {
tEncoded = tEncoded + chr(tMsg.charCodeAt(i) ^ tKey.charCodeAt(tKeyIndex));
tKeyIndex++;
if (tKeyIndex == tKey.length) {
tKeyIndex = 0;
}
i++;
}
return(tEncoded);
}
function load_game() {
var _local2 = SharedObject.getLocal("TOTNeoniumSave");
pass = _local2.data.ASX;
pass = XOR(pass, secret_key, 0);
autofire_turret_rof = Number(XOR(_local2.data.QGO, pass, 19));
armor_piercing_level = Number(XOR(_local2.data.ANB, pass, 7));
laser_bought = Number(XOR(_local2.data.YDK, pass, 45));
current_points = Number(XOR(_local2.data.FJD, pass, 23));
displayed_points = current_points;
reload_modifier = Number(XOR(_local2.data.KAZ, pass, 0));
sniper_rifle_bought = Number(XOR(_local2.data.SPM, pass, 31));
bullet_spread_modifier = Number(XOR(_local2.data.GPB, pass, 27));
current_money = Number(XOR(_local2.data.XUF, pass, 34));
displayed_money = current_money;
autofire_damage = Number(XOR(_local2.data.SDB, pass, 20));
regen_time = Number(XOR(_local2.data.WET, pass, 39));
plasma_cannon_bought = Number(XOR(_local2.data.ZXV, pass, 14));
machine_gun_bought = Number(XOR(_local2.data.SPB, pass, 47));
points_multiplier = Number(XOR(_local2.data.VJG, pass, 32));
interest_rate = Number(XOR(_local2.data.GYE, pass, 10));
regen_amount = Number(XOR(_local2.data.XBP, pass, 41));
current_health = Number(XOR(_local2.data.QGP, pass, 25));
submachine_gun_bought = Number(XOR(_local2.data.QWV, pass, 45));
automatic_laser_bought = Number(XOR(_local2.data.HEI, pass, 31));
autofire_turret_bought = Number(XOR(_local2.data.BPM, pass, 26));
max_health = Number(XOR(_local2.data.XHG, pass, 12));
damage_multiplier = Number(XOR(_local2.data.GUI, pass, 28));
health_regen_level = Number(XOR(_local2.data.WGU, pass, 45));
vulcan_minigun_bought = Number(XOR(_local2.data.XHB, pass, 47));
current_level = Number(XOR(_local2.data.ALG, pass, 18));
difficulty_level = Number(XOR(_local2.data.DJA, pass, 39));
_local2.clear();
current_level++;
if (((((((current_level == 25) || (current_level == 26)) || (current_level == 27)) || (current_level == 33)) || (current_level == 35)) || (current_level == 36)) || (current_level == 40)) {
wave_time = 300;
} else {
wave_time = 3600;
}
_root.wave_box.text_box.text = "Wave " + current_level;
current_money = Math.round(current_money * (1 + interest_rate));
reset_stuff();
}
function save_game() {
var _local1 = SharedObject.getLocal("TOTNeoniumSave");
zx_code = "";
i = 0;
while (i < 50) {
zx_code = zx_code + chr(Math.floor(Math.random() * 300) + 1);
i++;
}
_local1.data.ASX = zx_code;
pass = XOR(zx_code, secret_key, 0);
_local1.data.QGO = XOR(autofire_turret_rof.toString(), pass, 19);
_local1.data.ANB = XOR(armor_piercing_level.toString(), pass, 7);
_local1.data.YDK = XOR(laser_bought.toString(), pass, 45);
_local1.data.FJD = XOR(current_points.toString(), pass, 23);
_local1.data.KAZ = XOR(reload_modifier.toString(), pass, 0);
_local1.data.SPM = XOR(sniper_rifle_bought.toString(), pass, 31);
_local1.data.GPB = XOR(bullet_spread_modifier.toString(), pass, 27);
_local1.data.XUF = XOR(current_money.toString(), pass, 34);
_local1.data.SDB = XOR(autofire_damage.toString(), pass, 20);
_local1.data.WET = XOR(regen_time.toString(), pass, 39);
_local1.data.ZXV = XOR(plasma_cannon_bought.toString(), pass, 14);
_local1.data.SPB = XOR(machine_gun_bought.toString(), pass, 47);
_local1.data.VJG = XOR(points_multiplier.toString(), pass, 32);
_local1.data.GYE = XOR(interest_rate.toString(), pass, 10);
_local1.data.XBP = XOR(regen_amount.toString(), pass, 41);
_local1.data.QGP = XOR(current_health.toString(), pass, 25);
_local1.data.QWV = XOR(submachine_gun_bought.toString(), pass, 45);
_local1.data.HEI = XOR(automatic_laser_bought.toString(), pass, 31);
_local1.data.BPM = XOR(autofire_turret_bought.toString(), pass, 26);
_local1.data.XHG = XOR(max_health.toString(), pass, 12);
_local1.data.GUI = XOR(damage_multiplier.toString(), pass, 28);
_local1.data.WGU = XOR(health_regen_level.toString(), pass, 45);
_local1.data.XHB = XOR(vulcan_minigun_bought.toString(), pass, 47);
_local1.data.ALG = XOR(current_level.toString(), pass, 18);
_local1.data.DJA = XOR(difficulty_level.toString(), pass, 39);
_local1.flush();
}
function create_money_box() {
attachMovie("money_display", "money_display", 3, {_x:550, _y:15});
set_money();
}
function create_health_box() {
attachMovie("reg_bar", "health_bar", 4, {_x:559, _y:38});
set_health();
}
function create_ammo_box() {
attachMovie("ammo_bar", "ammo_bar", 6, {_x:116, _y:40});
set_ammo();
}
function create_points_box() {
attachMovie("points_display", "points_display", 25837, {_x:450, _y:435});
set_points();
}
function create_multiplier_box() {
attachMovie("multiplier_display", "multiplier_display", 25838, {_x:90, _y:435});
set_multiplier();
}
function set_ammo() {
if (reloading == 0) {
ammo_bar.ammo_text.text = (current_ammo + "/") + max_ammo;
}
if (reloading == 1) {
ammo_bar.ammo_text.text = "Reloading...";
}
ammo_bar_graphical();
}
function set_health() {
health_bar.health_text.text = (current_health + "/") + max_health;
health_bar_graphical();
}
function set_money() {
money_display.text_box.text = "$" + displayed_money;
}
function set_points() {
points_display.text_box.text = "Points: " + displayed_points;
}
function set_multiplier() {
stuff = Math.round(points_multiplier * 100) / 100;
multiplier_display.text_box.text = "Multiplier: x" + stuff;
}
function add_laser_readiness(add_amt) {
laser_blast_charge = laser_blast_charge + add_amt;
if (laser_blast_charge > 100) {
laser_blast_charge = 100;
}
}
function reset_laser_bar() {
displayed_laser_blast_charge = displayed_laser_blast_charge * 0.99;
displayed_laser_blast_charge = displayed_laser_blast_charge - 0.1;
if (displayed_laser_blast_charge < 0) {
displayed_laser_blast_charge = 0;
}
laser_blast_charge = displayed_laser_blast_charge;
laser_ready_bar.insides.gotoAndStop(Math.round(displayed_laser_blast_charge));
if (displayed_laser_blast_charge == 0) {
reset_laser = 0;
}
}
function health_bar_graphical() {
teh_ratio = current_health / max_health;
teh_percent = teh_ratio * 100;
teh_frame = Math.round(teh_percent);
health_bar.health_bar_inside._xscale = teh_percent;
health_bar.health_bar_inside.gotoAndStop(100 - teh_frame);
}
function ammo_bar_graphical() {
teh_ratio = current_ammo / max_ammo;
teh_percent = teh_ratio * 100;
teh_frame = Math.round(teh_percent);
ammo_bar.ammo_bar_inside._xscale = teh_percent;
ammo_bar.ammo_bar_inside.gotoAndStop(100 - teh_frame);
}
function add_points(apoints) {
if (!isNaN(current_points + apoints)) {
current_points = current_points + apoints;
current_points = Math.round(current_points * 100) / 100;
set_points();
}
}
function update_points() {
points_difference = current_points - displayed_points;
displayed_points = displayed_points + (Math.round(points_difference * 0.1) + 1);
if (displayed_points > current_points) {
displayed_points = current_points;
}
set_points();
}
function add_money(money) {
if (!isNaN(current_money + money)) {
current_money = current_money + money;
}
}
function update_money() {
money_difference = current_money - displayed_money;
displayed_money = displayed_money + (Math.round(money_difference * 0.05) + 1);
if (displayed_money > current_money) {
displayed_money = current_money;
}
set_money();
}
function decrease_health(ouchies) {
current_health = current_health - ouchies;
if (current_health > max_health) {
current_health = max_health;
}
if (current_health <= 0) {
game_over();
}
set_health();
}
function use_bullets(bullets) {
current_ammo = current_ammo - bullets;
set_ammo();
}
function reload() {
if ((start_of_reloading == 0) && (muted == 0)) {
the_best_sound_evear = new Sound(_root);
the_best_sound_evear.attachSound(reload_sound);
the_best_sound_evear.start();
start_of_reloading = 1;
}
var _local2 = max_ammo / reload_speed;
current_ammo = current_ammo + _local2;
set_ammo();
if (current_ammo >= max_ammo) {
current_ammo = max_ammo;
reloading = 0;
set_ammo();
start_of_reloading = 0;
}
}
function set_weapon(weapon_num) {
switch (weapon_num) {
case 1 :
current_weapon = 1;
frequency = 30;
automatic_weapon = 0;
bullet_speed = 15;
weapon_base_bullet_spread = 2;
base_bullet_damage = 5;
speed_variability = 5;
max_ammo = 8;
base_reload_speed = 126;
weapon_sluggishness_modifier = 0.7;
bullet_type = "generic_bullet_red";
weapon_indicator.text_box.text = "Pistol";
current_ammo = left_over_bullets_array[1];
sound_of_bullet = "SingleShot1";
sound_of_bullet_volume = 100;
reload_sound = "LoadingSound1";
apply_modifiers();
break;
case 2 :
current_weapon = 2;
frequency = 8;
automatic_weapon = 1;
bullet_speed = 15;
weapon_base_bullet_spread = 4;
base_bullet_damage = 4;
speed_variability = 5;
max_ammo = 30;
base_reload_speed = 168;
weapon_sluggishness_modifier = 2;
bullet_type = "generic_bullet_blue";
weapon_indicator.text_box.text = "Sub-Machine Gun";
current_ammo = left_over_bullets_array[2];
sound_of_bullet = "SingleShot1";
sound_of_bullet_volume = 100;
reload_sound = "LoadingSound2";
apply_modifiers();
break;
case 3 :
current_weapon = 3;
frequency = 1;
automatic_weapon = 1;
bullet_speed = 25;
weapon_base_bullet_spread = 0;
base_bullet_damage = 100;
speed_variability = 5;
max_ammo = 1;
base_reload_speed = 168;
weapon_sluggishness_modifier = 0.3;
bullet_type = "sniper_bullet";
weapon_indicator.text_box.text = "Sniper Rifle";
current_ammo = left_over_bullets_array[3];
sound_of_bullet = "SingleShot2";
sound_of_bullet_volume = 100;
reload_sound = "LoadingSound1";
apply_modifiers();
break;
case 4 :
current_weapon = 4;
frequency = 3;
automatic_weapon = 1;
bullet_speed = 15;
weapon_base_bullet_spread = 5;
base_bullet_damage = 3;
speed_variability = 5;
max_ammo = 90;
base_reload_speed = 210;
weapon_sluggishness_modifier = 2.5;
bullet_type = "generic_bullet_yellow";
weapon_indicator.text_box.text = "Machine Gun";
current_ammo = left_over_bullets_array[4];
sound_of_bullet = "AutoShot";
sound_of_bullet_volume = 100;
reload_sound = "LoadingSound2";
apply_modifiers();
break;
case 5 :
current_weapon = 5;
frequency = 1;
automatic_weapon = 1;
bullet_speed = 15;
weapon_base_bullet_spread = 7;
base_bullet_damage = 1.5;
speed_variability = 5;
max_ammo = 400;
base_reload_speed = 300;
weapon_sluggishness_modifier = 2.5;
bullet_type = "generic_bullet_green";
weapon_indicator.text_box.text = "Vulcan Minigun";
current_ammo = left_over_bullets_array[5];
sound_of_bullet = "AutoShot";
sound_of_bullet_volume = 100;
reload_sound = "LoadingSound2";
apply_modifiers();
break;
case 6 :
current_weapon = 6;
frequency = 5;
automatic_weapon = 1;
bullet_speed = 15;
weapon_base_bullet_spread = 0.2;
base_bullet_damage = 3;
speed_variability = 5;
max_ammo = 500;
base_reload_speed = 210;
weapon_sluggishness_modifier = 0.5;
bullet_type = "laser_bullet";
weapon_indicator.text_box.text = "Automatic Laser";
current_ammo = left_over_bullets_array[6];
sound_of_bullet = "LaserShot";
sound_of_bullet_volume = 100;
reload_sound = "LoadingSound1";
apply_modifiers();
break;
case 7 :
current_weapon = 7;
frequency = 20;
automatic_weapon = 1;
bullet_speed = 5;
weapon_base_bullet_spread = 0.5;
base_bullet_damage = 20;
speed_variability = 20;
max_ammo = 50;
base_reload_speed = 180;
weapon_sluggishness_modifier = 2;
bullet_type = "laser_bullet";
weapon_indicator.text_box.text = "Plasma Cannon";
current_ammo = left_over_bullets_array[7];
sound_of_bullet = "Plasma";
sound_of_bullet_volume = 100;
reload_sound = "LoadingSound1";
apply_modifiers();
}
set_ammo();
}
function apply_modifiers() {
bullet_spread = weapon_base_bullet_spread * bullet_spread_modifier;
sluggishness = base_sluggishness * weapon_sluggishness_modifier;
reload_speed = base_reload_speed * reload_modifier;
bullet_damage = base_bullet_damage * damage_multiplier;
}
function change_weapon() {
weapon_indicator.text_box.text = "Please Wait";
ammo_bar.ammo_text.text = "Changing Weapons";
current_changing++;
teh_percent = (current_changing / change_speed) * 100;
teh_frame = Math.round(teh_percent);
ammo_bar.ammo_bar_inside._xscale = teh_percent;
ammo_bar.ammo_bar_inside.gotoAndStop(100 - teh_frame);
if (current_changing >= change_speed) {
current_changing = 0;
changing_weapons = 0;
set_weapon(changing_to);
}
}
function distance(x1, y1, x2, y2) {
teh_answer = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
return(teh_answer);
}
function advCollision(mc1, mc2) {
var _local1 = mc1.getBounds(mc1);
var _local2 = mc2.getBounds(mc1);
return((((_local1.xMin <= _local2.xMax) && (_local1.xMax >= _local2.xMin)) && (_local1.yMin <= _local2.yMax)) && (_local1.yMax >= _local2.yMin));
}
function rectangle_collision(mc1, mc2) {
return((mc1.hitTest(mc2) && (adv_collision(mc1, mc2))) && (adv_collision(mc2, mc1)));
}
function load_upgrade_menu() {
paused_var = 2;
attachMovie("upgrade_screen_frame", "upgrade_screen", 99999, {_x:325, _y:223});
upgrade_screen.done_button.onRelease = function () {
set_money();
upgrade_screen.attachMovie("button_blocker", "button_blocker", 200000, {_x:0, _y:0});
upgrade_screen.onEnterFrame = function () {
upgrade_screen._alpha = upgrade_screen._alpha - 2;
if (upgrade_screen._alpha < 0) {
paused_var = 0;
removeMovieClip(upgrade_screen);
}
};
};
upgrade_screen._alpha = 0;
upgrade_screen.onEnterFrame = function () {
if (upgrade_screen._alpha < 100) {
upgrade_screen._alpha = upgrade_screen._alpha + 2;
} else if (upgrade_screen.quality_set == 0) {
removeMovieClip(upgrade_screen.button_blocker);
upgrade_screen.quality_set = 1;
}
};
}
function onMouseDown() {
Mouse.hide();
if (paused_var == 0) {
firing = 1;
if (((((automatic_weapon == 0) && (counter >= frequency)) && (current_ammo > 0)) && (reloading == 0)) && (changing_weapons == 0)) {
use_bullets(1);
shootBullet();
firing = 0;
counter = 0;
if (current_ammo <= 0) {
reloading = 1;
}
}
if ((((automatic_weapon == 1) && (current_ammo > 0)) && (reloading == 0)) && (changing_weapons == 0)) {
counter = frequency;
}
}
}
function onMouseUp() {
firing = 0;
if (automatic_weapon == 1) {
counter = 0;
}
}
function shootBullet() {
angle = turret.barrel._rotation - 180;
start_bullet_x = turret._x + ((40 + error) * Math.cos((angle * Math.PI) / 180));
start_bullet_y = turret._y + ((40 + error) * Math.sin((angle * Math.PI) / 180));
depth_of_bullet++;
if (depth_of_bullet >= 19000) {
depth_of_bullet = 10000;
}
bullet_fired = attachMovie(bullet_type, bullet_type + depth_of_bullet, _root.getNextHighestDepth() - depth_of_bullet, {_x:start_bullet_x, _y:start_bullet_y});
if (muted == 0) {
bullet_fired.bullet_sound = new Sound(_root);
bullet_fired.bullet_sound.attachSound(sound_of_bullet);
bullet_fired.bullet_sound.setVolume(sound_of_bullet_volume);
bullet_fired.bullet_sound.start();
}
x_spread = (Math.random() - 0.5) * bullet_spread;
y_spread = (Math.random() - 0.5) * bullet_spread;
random_bullet_speed = bullet_speed + ((Math.random() - 0.5) * (bullet_speed / speed_variability));
bullet_fired.dirx = (Math.cos((angle * Math.PI) / 180) * random_bullet_speed) + x_spread;
bullet_fired.diry = (Math.sin((angle * Math.PI) / 180) * random_bullet_speed) + y_spread;
anglex = Math.atan(bullet_fired.diry / bullet_fired.dirx) / (Math.PI/180);
bullet_fired._rotation = anglex;
bullet_fired.onEnterFrame = function () {
if (paused_var == 0) {
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
}
if (((((this._x < 0) or (this._x > 700)) or tower.hitTest(this.hit_test_circle)) or ground.hitTest(this.hit_test_circle)) or stuff_stats_box.hitTest(this.hit_test_circle)) {
this.removeMovieClip();
}
i = 100;
while (i <= (100 + max_enemies)) {
if (_root["enemy" + i].enemy_sprite.hitTest(this.hit_test_circle)) {
bullet_hit_point.x = this.hit_test_circle._x;
bullet_hit_point.y = this.hit_test_circle._y;
this.localToGlobal(bullet_hit_point);
xx = bullet_hit_point.x;
yy = bullet_hit_point.y;
h = 0;
while (h < _root.bullet_particles) {
the_movieA = _root.attachMovie("bullet_particle_system", "particle" + particle_num, particle_num, {_x:xx, _y:yy, _rotation:random(360)});
numberA = random(255);
hexA = numberA.toString(16);
if (hexA.length == 1) {
hexA = "0" + hexA;
}
myColorA = ("0xFF" + hexA) + "00";
myColoredObjectA = new Color(the_movieA);
myColoredObjectA.setRGB(myColorA);
particle_num++;
if (particle_num > 22000) {
particle_num = 20000;
}
h++;
}
this.removeMovieClip();
temp = _root["enemy" + i].armor - armor_piercing_level;
if (current_weapon == 3) {
temp = temp - 5;
}
if (temp < 0) {
temp = 0;
}
_root["enemy" + i].health = _root["enemy" + i].health - (bullet_damage * Math.pow((Math.random() * 0.5) + 0.45, temp));
if (_root["enemy" + i].health <= 0) {
enemy_died(i);
}
}
i++;
}
};
}
function enemy_died(yay) {
var _local6 = false;
current_number_of_enemies--;
enemy_array[yay - 100] = 0;
where_in_list = _root["enemy" + yay].list_num;
enemy_number_list[_root["enemy" + yay].list_num] = 0;
add_money(_root["enemy" + yay].money_value);
add_points(_root["enemy" + yay].point_value * points_multiplier);
if ((laser_bought == 1) && (laser_firing == 0)) {
add_laser_readiness(_root["enemy" + yay].laser_load);
}
if (_root["enemy" + yay].teh_name == "hexagon") {
big_bad_boss--;
}
if (_root["enemy" + yay].teh_name == "octagon") {
big_bad_boss--;
game_win_x = _root["enemy" + yay]._x;
game_win_y = _root["enemy" + yay]._y;
gotoAndStop ("game_won");
}
if (_root["enemy" + yay].teh_name == "rhombus") {
_local6 = true;
rhombx = _root["enemy" + yay]._x;
rhomby = _root["enemy" + yay]._y;
}
h = 0;
while (h < _root.num_bullet_particles) {
the_movie = _root.attachMovie(_root["enemy" + yay].particle_system, "particle" + particle_num, particle_num, {_x:_root["enemy" + yay]._x, _y:_root["enemy" + yay]._y, _rotation:random(360)});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
particle_num++;
if (particle_num > 22000) {
particle_num = 20000;
}
h++;
}
points_multiplier = points_multiplier + 0.5;
set_multiplier();
_root["enemy" + yay].removeMovieClip();
if (_local6) {
_root.place_enemy(rhombx, rhomby, "splitting_rhombus_small");
_local6 = false;
}
}
function shoot_autofire_bullet(enemy_number) {
_root["enemy" + enemy_number].health = _root["enemy" + enemy_number].health - autofire_damage;
h = 0;
while (h < bullet_particles) {
the_movie = _root.attachMovie("particle_system", "particle" + particle_num, particle_num, {_x:_root["enemy" + enemy_number]._x, _y:_root["enemy" + enemy_number]._y, _rotation:random(360)});
number = random(255);
hex = number.toString(16);
myColor = "0xFFFF" + hex;
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
particle_num++;
if (particle_num > 22000) {
particle_num = 20000;
}
h++;
}
if (_root["enemy" + enemy_number].health <= 0) {
enemy_died(enemy_number);
}
}
function reorganize_list() {
i = 0;
while (i <= max_enemies) {
if (enemy_number_list[i] != 0) {
_root["enemy" + enemy_number_list[i]].list_num = 0;
enemy_number_list[0] = enemy_number_list[i];
enemy_number_list[i] = 0;
i = max_enemies;
}
i++;
}
}
function advCollision(mc1, mc2) {
var _local1 = mc1.getBounds(mc1);
var _local2 = mc2.getBounds(mc1);
return((((_local1.xMin <= _local2.xMax) && (_local1.xMax >= _local2.xMin)) && (_local1.yMin <= _local2.yMax)) && (_local1.yMax >= _local2.yMin));
}
function place_enemy(x_val, y_val, enemy_type) {
if (current_number_of_enemies < (max_enemies + 1)) {
i = 0;
while (i <= max_enemies) {
if (enemy_array[i] == 0) {
next_enemy_num = i + 100;
i = max_enemies;
}
i++;
}
where_in_list = find_next_vacant_spot_in_list();
enemy_number_list[where_in_list] = next_enemy_num;
enemy_placed = attachMovie(enemy_type, "enemy" + next_enemy_num, next_enemy_num, {_x:x_val, _y:y_val});
enemy_placed.list_num = where_in_list;
enemy_placed.numberss = next_enemy_num;
enemy_placed.particle_system = "particle_system";
enemy_array[next_enemy_num - 100] = 1;
current_number_of_enemies++;
enemy_placed.onEnterFrame = function () {
if ((((_root.epic_laser.awesome == 1) && (this.teh_name != "octagon")) && (this.teh_name != "hexagon")) && (advCollision(this.enemy_sprite, _root.epic_laser) && (advCollision(_root.epic_laser, this.enemy_sprite)))) {
this.health = this.health - laser_damage;
}
if (this.health <= 0) {
_root.enemy_died(this.numberss);
}
this.handle_frames();
if (this.hitTest(tower)) {
_root.enemy_died_tower(this.numberss);
}
};
}
}
function enemy_died_tower(yay) {
current_number_of_enemies--;
enemy_array[yay - 100] = 0;
where_in_list = _root["enemy" + yay].list_num;
enemy_number_list[_root["enemy" + yay].list_num] = 0;
decrease_health(_root["enemy" + yay].damage);
h = 0;
while (h < _root.num_bullet_particles) {
the_movie = _root.attachMovie(_root["enemy" + yay].particle_system, "particle" + particle_num, particle_num, {_x:_root["enemy" + yay]._x, _y:_root["enemy" + yay]._y, _rotation:random(360)});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
particle_num++;
if (particle_num > 22000) {
particle_num = 20000;
}
h++;
}
_root["enemy" + yay].removeMovieClip();
}
function find_next_vacant_spot_in_list() {
i = 0;
while (i <= current_number_of_enemies) {
if (enemy_number_list[i] == 0) {
return(i);
}
i++;
}
return(current_number_of_enemies + 1);
}
function rand_num(low_end, high_end) {
temp = (Math.random() * (high_end - low_end)) + low_end;
return(temp);
}
function reset_stuff() {
big_bad_boss = 0;
mini_wave = 0;
}
function determine_enemies() {
enemy_counter++;
switch (current_level) {
case 1 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 300;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
place_enemy(-40, random_y, "generic_square");
}
return;
case 2 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 240;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
if (Math.random() < 0.8) {
place_enemy(-40, random_y, "generic_square");
} else {
place_enemy(-40, random_y, "splitting_rhombus");
}
}
return;
case 3 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 200;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
if (Math.random() < 0.6) {
place_enemy(-40, random_y, "generic_square");
} else {
place_enemy(-40, random_y, "splitting_rhombus");
}
}
return;
case 4 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 150;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
if (Math.random() < 0.75) {
place_enemy(-40, random_y, "generic_square");
} else {
place_enemy(-40, random_y, "splitting_rhombus");
}
}
return;
case 5 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 180;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.15) {
place_enemy(-40, random_y, "evil_triangle");
} else if (tempA < 0.35) {
place_enemy(-40, random_y, "splitting_rhombus");
} else {
place_enemy(-40, random_y, "generic_square");
}
}
return;
case 6 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 175;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.25) {
place_enemy(-40, random_y, "evil_triangle");
} else if (tempA < 0.5) {
place_enemy(-40, random_y, "splitting_rhombus");
} else {
place_enemy(-40, random_y, "generic_square");
}
}
return;
case 7 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 150;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.4) {
place_enemy(-40, random_y, "evil_triangle");
} else if (tempA < 0.6) {
place_enemy(-40, random_y, "splitting_rhombus");
} else {
place_enemy(-40, random_y, "generic_square");
}
}
return;
case 8 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 90;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
if (Math.random() < 0.15) {
place_enemy(-40, random_y, "splitting_rhombus");
} else {
place_enemy(-40, random_y, "generic_square");
}
}
return;
case 9 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 110;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
if (Math.random() < 0.3) {
place_enemy(-40, random_y, "evil_triangle");
} else {
place_enemy(-40, random_y, "generic_square");
}
}
return;
case 10 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 150;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.15) {
place_enemy(-40, random_y, "lol_circle");
} else if (tempA < 0.4) {
place_enemy(-40, random_y, "evil_triangle");
} else {
place_enemy(-40, random_y, "generic_square");
}
}
return;
case 11 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 150;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.25) {
place_enemy(-40, random_y, "lol_circle");
} else if (tempA < 0.5) {
place_enemy(-40, random_y, "evil_triangle");
} else {
place_enemy(-40, random_y, "generic_square");
}
}
return;
case 12 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 150;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.25) {
place_enemy(-40, random_y, "lol_circle");
} else if (tempA < 0.6) {
place_enemy(-40, random_y, "evil_triangle");
} else {
place_enemy(-40, random_y, "generic_square");
}
}
return;
case 13 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 180;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
if (Math.random() < 0.25) {
place_enemy(-40, random_y, "lol_circle");
} else {
place_enemy(-40, random_y, "evil_triangle");
}
}
return;
case 14 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 180;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
if (Math.random() < 0.5) {
place_enemy(-40, random_y, "lol_circle");
} else {
place_enemy(-40, random_y, "evil_triangle");
}
}
return;
case 15 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 50;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
if (Math.random() < 0.25) {
place_enemy(-40, random_y, "splitting_rhombus");
} else {
place_enemy(-40, random_y, "generic_square");
}
}
return;
case 16 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 60;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.25) {
place_enemy(-40, random_y, "splitting_rhombus");
} else if (tempA < 0.5) {
place_enemy(-40, random_y, "evil_triangle");
} else {
place_enemy(-40, random_y, "generic_square");
}
}
return;
case 17 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 60;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.25) {
place_enemy(-40, random_y, "lol_circle");
} else if (tempA < 0.5) {
place_enemy(-40, random_y, "evil_triangle");
} else {
place_enemy(-40, random_y, "generic_square");
}
}
return;
case 18 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 120;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
if (Math.random() < 0.5) {
place_enemy(-40, random_y, "evil_triangle");
} else {
place_enemy(-40, random_y, "lol_circle");
}
}
return;
case 19 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 105;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
place_enemy(-40, random_y, "lol_circle");
}
return;
case 20 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 150;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.3) {
place_enemy(-40, random_y, "generic_square");
} else if (tempA < 0.6) {
place_enemy(-40, random_y, "evil_triangle");
} else if (tempA < 0.9) {
place_enemy(-40, random_y, "lol_circle");
} else {
place_enemy(-40, random_y, "teleporting_pentagon");
}
}
return;
case 21 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 120;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.25) {
place_enemy(-40, random_y, "generic_square");
} else if (tempA < 0.5) {
place_enemy(-40, random_y, "evil_triangle");
} else if (tempA < 0.75) {
place_enemy(-40, random_y, "lol_circle");
} else {
place_enemy(-40, random_y, "teleporting_pentagon");
}
}
return;
case 22 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 150;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
if (Math.random() < 0.5) {
place_enemy(-40, random_y, "teleporting_pentagon");
} else {
place_enemy(-40, random_y, "evil_triangle");
}
}
return;
case 23 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 120;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
if (Math.random() < 0.5) {
place_enemy(-40, random_y, "teleporting_pentagon");
} else {
place_enemy(-40, random_y, "evil_triangle");
}
}
return;
case 24 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 90;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.5) {
place_enemy(-40, random_y, "generic_square");
} else if (tempA < 0.65) {
place_enemy(-40, random_y, "evil_triangle");
} else if (tempA < 0.8) {
place_enemy(-40, random_y, "lol_circle");
} else {
place_enemy(-40, random_y, "teleporting_pentagon");
}
}
return;
case 25 :
if (((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) && (big_bad_boss == 0)) {
big_bad_boss = 1;
next_enemy_counter = rand_num(0, 2) * 120;
enemy_counter = 0;
random_y = (Math.random() * 160) + 180;
place_enemy(-40, random_y, "doom_hexagon");
}
return;
case 26 :
if (big_bad_boss == 0) {
big_bad_boss = 1;
random_y = (Math.random() * 160) + 180;
place_enemy(-40, random_y, "doom_hexagon");
} else if (((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) && (big_bad_boss == 1)) {
next_enemy_counter = rand_num(0, 2) * 180;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.5) {
place_enemy(-40, random_y, "generic_square");
} else if (tempA < 0.75) {
place_enemy(-40, random_y, "evil_triangle");
} else if (tempA < 0.9) {
place_enemy(-40, random_y, "lol_circle");
} else {
place_enemy(-40, random_y, "teleporting_pentagon");
}
}
return;
case 27 :
if (((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) && (big_bad_boss < 2)) {
big_bad_boss++;
next_enemy_counter = 600;
enemy_counter = 0;
random_y = (Math.random() * 160) + 180;
place_enemy(-40, random_y, "doom_hexagon");
}
return;
case 28 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 40;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
place_enemy(-40, random_y, "orange_missile");
}
return;
case 29 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 90;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.2) {
place_enemy(-40, random_y, "generic_square");
} else if (tempA < 0.4) {
place_enemy(-40, random_y, "evil_triangle");
} else if (tempA < 0.6) {
place_enemy(-40, random_y, "lol_circle");
} else if (tempA < 0.8) {
place_enemy(-40, random_y, "teleporting_pentagon");
} else {
place_enemy(-40, random_y, "orange_missile");
}
}
return;
case 30 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 120;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
tempA = Math.random();
if (tempA < 0.2) {
place_enemy(-40, random_y, "generic_square");
} else if (tempA < 0.35) {
place_enemy(-40, random_y, "evil_triangle");
} else if (tempA < 0.6) {
place_enemy(-40, random_y, "lol_circle");
} else if (tempA < 0.75) {
place_enemy(-40, random_y, "teleporting_pentagon");
} else if (tempA < 0.85) {
place_enemy(-40, random_y, "orange_missile");
} else {
place_enemy(-40, random_y, "gray_star");
}
}
return;
case 31 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 120;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
if (Math.random() < 0.75) {
place_enemy(-40, random_y, "generic_square");
} else {
place_enemy(-40, random_y, "gray_star");
}
}
return;
case 32 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 120;
enemy_counter = 0;
random_y = (Math.random() * 290) + 105;
tempA = Math.random();
if (tempA < 0.4) {
place_enemy(-40, random_y, "lol_circle");
} else if (tempA < 0.7) {
place_enemy(-40, random_y, "orange_missile");
} else if (tempA < 0.8) {
place_enemy(-40, random_y, "pink_missile");
} else {
place_enemy(-40, random_y, "gray_star");
}
}
return;
case 33 :
if (big_bad_boss == 0) {
big_bad_boss = 1;
random_y = (Math.random() * 160) + 180;
place_enemy(-40, random_y, "doom_hexagon");
} else if (((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) && (big_bad_boss == 1)) {
next_enemy_counter = rand_num(0, 2) * 120;
enemy_counter = 0;
random_y = (Math.random() * 290) + 105;
tempA = Math.random();
if (tempA < 0.16) {
place_enemy(-40, random_y, "generic_square");
} else if (tempA < 0.32) {
place_enemy(-40, random_y, "evil_triangle");
} else if (tempA < 0.48) {
place_enemy(-40, random_y, "lol_circle");
} else if (tempA < 0.64) {
place_enemy(-40, random_y, "teleporting_pentagon");
} else if (tempA < 0.8) {
place_enemy(-40, random_y, "gray_star");
} else {
place_enemy(-40, random_y, "orange_missile");
}
}
return;
case 34 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 45;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
place_enemy(-40, random_y, "evil_triangle");
}
return;
case 35 :
if (big_bad_boss < 3) {
big_bad_boss++;
random_y = (Math.random() * 160) + 180;
place_enemy(-40, random_y, "doom_hexagon");
} else if (((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) && (big_bad_boss == 3)) {
next_enemy_counter = rand_num(0, 2) * 120;
enemy_counter = 0;
random_y = (Math.random() * 290) + 105;
place_enemy(-40, random_y, "orange_missile");
}
return;
case 36 :
if ((big_bad_boss == 0) && (mini_wave < 3)) {
big_bad_boss++;
big_bad_boss++;
mini_wave++;
random_y = (Math.random() * 160) + 180;
place_enemy(-40, random_y, "doom_hexagon");
random_y = (Math.random() * 160) + 180;
place_enemy(-40, random_y, "doom_hexagon");
}
return;
case 37 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 90;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
place_enemy(-40, random_y, "teleporting_pentagon");
}
return;
case 38 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 120;
enemy_counter = 0;
random_y = (Math.random() * 290) + 105;
tempA = Math.random();
if (tempA < 0.33) {
place_enemy(-40, random_y, "lol_circle");
} else if (tempA < 0.66) {
place_enemy(-40, random_y, "teleporting_pentagon");
} else {
place_enemy(-40, random_y, "gray_star");
}
}
case 39 :
if ((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) {
next_enemy_counter = rand_num(0, 2) * 15;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
place_enemy(-40, random_y, "lol_circle");
}
return;
case 40 :
if ((big_bad_boss == 0) && (teh_var == 0)) {
big_bad_boss = 1;
teh_var = 1;
random_y = (Math.random() * 130) + 220;
place_enemy(-40, random_y, "boss_octagon");
} else if (((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies)) && (big_bad_boss == 1)) {
next_enemy_counter = rand_num(0, 2) * 150;
enemy_counter = 0;
random_y = (Math.random() * 290) + 105;
tempA = Math.random();
if (tempA < 0.2) {
place_enemy(-40, random_y, "lol_circle");
} else if (tempA < 0.4) {
place_enemy(-40, random_y, "teleporting_pentagon");
} else if (tempA < 0.6) {
place_enemy(-40, random_y, "evil_triangle");
} else if (tempA < 0.8) {
place_enemy(-40, random_y, "generic_square");
} else {
place_enemy(-40, random_y, "gray_star");
}
}
return;
case 1000 :
if (!((enemy_counter > next_enemy_counter) && (current_number_of_enemies < max_enemies))) {
break;
}
next_enemy_counter = rand_num(0, 2) * 15;
enemy_counter = 0;
random_y = (Math.random() * 300) + 95;
place_enemy(-40, random_y, "gray_star");
}
}
function game_over() {
gotoAndStop ("game_over");
}
Mouse.hide();
Key.removeListener(keyListener);
menu_music_playing = 0;
menu_song.stop();
createEmptyMovieClip("gamesnd", -2);
var game_song = new Sound(gamesnd);
game_song.attachSound("Aurora");
game_song.start(0, 9999);
game_song.setVolume(50);
var muted = 0;
var max_enemies = 20;
var current_points = 0;
var displayed_points = 0;
var base_sluggishness = 10;
var bullet_spread_modifier = 1;
var current_money = 0;
var displayed_money = current_money;
var current_health = 100;
var max_health = 100;
var change_speed = 60;
var reload_modifier = 1;
var armor_piercing_level = 0;
var damage_multiplier = 1;
var interest_rate = 0;
var autofire_turret_bought = 0;
var autofire_turret_rof = 0;
var autofire_damage = 0;
var health_regen_level = 0;
var regen_time = 420;
var regen_amount = 1;
var health_regen_counter = 0;
var laser_damage = 1;
var bullet_particles = 10;
var num_bullet_particles = 25;
var particle_level = 2;
var frequency = 1;
var automatic_weapon = 0;
var bullet_speed = 25;
var weapon_base_bullet_spread = 2;
var base_bullet_damage = 10;
var speed_variability = 10;
var max_ammo = 7;
var current_ammo = 7;
var base_reload_speed = 120;
var weapon_sluggishness_modifier = 1;
var bullet_type = "generic_bullet_red";
var particle_num = 20000;
var error = 2;
var firing = 0;
var reloading = 0;
var counter = frequency;
var bullet_spread = (weapon_base_bullet_spread * bullet_spread_modifier);
var sluggishness = (base_sluggishness * weapon_sluggishness_modifier);
var reload_speed = (base_reload_speed * reload_modifier);
var bullet_damage = (base_bullet_damage * damage_multiplier);
var next_enemy_num = 100;
var enemy_name = "";
var current_number_of_enemies = 0;
var enemy_array = new Array();
var enemy_number_list = new Array();
var where_in_list = 0;
var left_over_bullets_array = new Array();
var current_weapon = 0;
var changing_weapons = 0;
var current_changing = 0;
var changing_to = 1;
var depth_of_bullet = 10000;
var bullet_hit_point = new Object();
var second_bullet_hit_point = new Object();
var sound_of_bullet = "SingleShot1";
var sound_of_bullet_volume = 100;
var reload_sound = "LoadingSound1";
var start_of_reloading = 0;
var paused_var = 0;
var autofire_reload = 0;
var next_autofire_bullet = autofire_turret_rof;
var autofire_target = 0;
var laser_firing = 0;
var reset_laser = 0;
var points_multiplier = 1;
var submachine_gun_bought = 0;
var sniper_rifle_bought = 0;
var machine_gun_bought = 0;
var vulcan_minigun_bought = 0;
var automatic_laser_bought = 0;
var plasma_cannon_bought = 0;
var laser_bought = 0;
var laser_blast_charge = 0;
var displayed_laser_blast_charge = laser_blast_charge;
var temp = 0;
var current_level = 1;
var big_bad_boss = 0;
var mini_wave = 0;
var teh_var = 0;
var wave_time = 1800;
var next_wave_counter = 0;
var secret_key = "a]4\u009E(\x15\u00FD\u00D2u\u00E9\u0123\u00A9\u011C\u00DE\u00DB\u00A2u/\u0126\u00FDpJ\u00B1eG0\u00A1\u00EFNS\u00D9\u0128$J+\u00C5\u00B7\x15\u011F\u00E2\u0117K\u008ADQ\u00CA}\u010E\u0127|";
if (found_save) {
load_game();
load_upgrade_menu();
found_save == false;
}
var difficulty = "EASY";
var enemy_health_multiplier = 1.25;
var enemy_armor_addition = 0.5;
var enemy_money_multiplier = 1.25;
var enemy_damage_multiplier = 0.75;
var score_report = "EasyPoints";
var wave_num_report = "EasyWavesCompleted";
var game_finished_report = "EasyCompleted";
_root.kongregateScores.setMode("Easy Highscores");
if (difficulty_level == 2) {
enemy_health_multiplier = 1.5;
enemy_armor_addition = 1;
enemy_money_multiplier = 1;
enemy_damage_multiplier = 1;
difficulty = "MEDIUM";
_root.kongregateScores.setMode("Medium Highscores");
score_report = "MediumPoints";
wave_num_report = "MediumWavesCompleted";
game_finished_report = "MediumCompleted";
}
if (difficulty_level == 3) {
enemy_health_multiplier = 1.75;
enemy_armor_addition = 2;
enemy_money_multiplier = 0.75;
enemy_damage_multiplier = 1.5;
difficulty = "HARD";
_root.kongregateScores.setMode("Hard Highscores");
score_report = "HardPoints";
wave_num_report = "HardWavesCompleted";
game_finished_report = "HardCompleted";
}
if (difficulty_level == 4) {
enemy_health_multiplier = 2;
enemy_armor_addition = 2;
enemy_money_multiplier = 0.66;
enemy_damage_multiplier = 2;
difficulty = "IMPOSSIBLE";
_root.kongregateScores.setMode("Impossible Highscores");
score_report = "ImpossiblePoints";
wave_num_report = "ImpossibleWavesCompleted";
game_finished_report = "ImpossibleCompleted";
}
keyListener = new Object();
keyListener.onKeyDown = function () {
var _local2 = Key.getCode();
switch (_local2) {
case 49 :
if (((reloading == 0) && (changing_weapons == 0)) && (current_weapon != 1)) {
left_over_bullets_array[current_weapon] = current_ammo;
changing_weapons = 1;
changing_to = 1;
}
break;
case 50 :
if ((((submachine_gun_bought == 1) && (reloading == 0)) && (changing_weapons == 0)) && (current_weapon != 2)) {
left_over_bullets_array[current_weapon] = current_ammo;
changing_weapons = 1;
changing_to = 2;
}
break;
case 51 :
if ((((sniper_rifle_bought == 1) && (reloading == 0)) && (changing_weapons == 0)) && (current_weapon != 3)) {
left_over_bullets_array[current_weapon] = current_ammo;
changing_weapons = 1;
changing_to = 3;
}
break;
case 52 :
if ((((machine_gun_bought == 1) && (reloading == 0)) && (changing_weapons == 0)) && (current_weapon != 4)) {
left_over_bullets_array[current_weapon] = current_ammo;
changing_weapons = 1;
changing_to = 4;
}
break;
case 53 :
if ((((vulcan_minigun_bought == 1) && (reloading == 0)) && (changing_weapons == 0)) && (current_weapon != 5)) {
left_over_bullets_array[current_weapon] = current_ammo;
changing_weapons = 1;
changing_to = 5;
}
break;
case 81 :
if (((((automatic_laser_bought == 1) && (reloading == 0)) && (changing_weapons == 0)) && (current_weapon != 6)) && (paused_var == 0)) {
left_over_bullets_array[current_weapon] = current_ammo;
changing_weapons = 1;
changing_to = 6;
} else if (paused_var == 1) {
_root.gotoAndPlay("game_over");
removeMovieClip(pause_screen);
break;
}
break;
case 87 :
if ((((plasma_cannon_bought == 1) && (reloading == 0)) && (changing_weapons == 0)) && (current_weapon != 7)) {
left_over_bullets_array[current_weapon] = current_ammo;
changing_weapons = 1;
changing_to = 7;
}
break;
case 69 :
if (((laser_bought == 1) && (paused_var == 0)) && (displayed_laser_blast_charge >= 100)) {
reset_laser = 1;
attachMovie("epic_laser", "epic_laser", 15000, {_x:turret._x, _y:turret._y});
laser_firing = 1;
}
break;
case 82 :
if (((reloading == 0) && (changing_weapons == 0)) && (current_ammo != max_ammo)) {
current_ammo = 0;
reloading = 1;
}
break;
case 80 :
if (paused_var == 0) {
attachMovie("pause_screen", "pause_screen", 100002, {_x:325, _y:225});
paused_var = 1;
} else if (paused_var == 1) {
paused_var = 0;
removeMovieClip(pause_screen);
}
break;
case 77 :
if (muted == 0) {
muted = 1;
game_song.stop();
} else {
muted = 0;
game_song.start(0, 99999);
}
case 90 :
if (particle_level == 2) {
particle_level--;
bullet_particles = 5;
num_bullet_particles = 12;
} else if (particle_level == 1) {
particle_level--;
bullet_particles = 0;
num_bullet_particles = 0;
} else {
particle_level = 2;
bullet_particles = 10;
num_bullet_particles = 25;
}
}
};
Key.addListener(keyListener);
i = 0;
while (i <= max_enemies) {
enemy_array[i] = 0;
enemy_number_list[i] = 0;
i++;
}
attachMovie("crosshair", "crosshair", 100000, {_x:_xmouse, _y:_ymouse});
attachMovie("mousehair", "mousehair", 100001, {_x:_xmouse, _y:_ymouse});
attachMovie("turret", "turret", 19996, {_x:590, _y:150});
attachMovie("tower", "tower", 19998, {_x:621, _y:295});
attachMovie("ground", "ground", 19999, {_x:190, _y:525});
attachMovie("stuff_stats_box", "stuff_stats_box", 1, {_x:350, _y:15});
attachMovie("laser_ready_bar", "laser_ready_bar", 19997, {_x:620, _y:256});
attachMovie("weapon_indicator", "weapon_indicator", 5, {_x:97.5, _y:15});
attachMovie("wave_box", "wave_box", 7, {_x:323, _y:21});
left_over_bullets_array[1] = 8;
left_over_bullets_array[2] = 30;
left_over_bullets_array[3] = 1;
left_over_bullets_array[4] = 90;
left_over_bullets_array[5] = 400;
left_over_bullets_array[6] = 500;
left_over_bullets_array[7] = 50;
left_over_bullets_array[8] = 20;
set_weapon(1);
create_money_box();
create_health_box();
create_ammo_box();
create_points_box();
create_multiplier_box();
crosshair.onEnterFrame = function () {
if (paused_var == 0) {
this._x = this._x + ((_xmouse - this._x) / sluggishness);
this._y = this._y + ((_ymouse - this._y) / sluggishness);
}
if (paused_var == 2) {
this._x = _xmouse;
this._y = _ymouse;
}
};
mousehair.onEnterFrame = function () {
if ((paused_var == 0) || (paused_var == 2)) {
this._x = _xmouse;
this._y = _ymouse;
}
};
turret.onEnterFrame = function () {
if (paused_var == 0) {
mousex = crosshair._x - this._x;
mousey = (crosshair._y - this._y) * -1;
angle = Math.atan(mousey / mousex) / (Math.PI/180);
if (mousex > 0) {
angle = angle + 180;
}
this.barrel._rotation = angle * -1;
if (laser_firing == 1) {
epic_laser._rotation = angle * -1;
epic_laser._x = this._x;
epic_laser._y = this._y;
}
}
};
onEnterFrame = function () {
if (paused_var == 0) {
if ((((((firing == 1) && (automatic_weapon == 1)) && (counter == frequency)) && (current_ammo > 0)) && (reloading == 0)) && (changing_weapons == 0)) {
use_bullets(1);
counter = 0;
shootBullet();
if (current_ammo <= 0) {
reloading = 1;
}
}
if (reloading == 1) {
reload();
}
if (changing_weapons == 1) {
change_weapon();
}
counter++;
if (ASnative(800, 2) /* [Key] isDown */(2)) {
firing = 0;
}
if (autofire_turret_bought == 1) {
autofire_reload++;
if ((current_number_of_enemies != 0) && (autofire_reload > next_autofire_bullet)) {
autofire_reload = 0;
next_autofire_bullet = Math.floor(Math.random() * ((1.33 * autofire_turret_rof) - (0.66 * autofire_turret_rof))) + (0.66 * autofire_turret_rof);
temp = Math.floor(Math.random() * current_number_of_enemies);
enemy_num = enemy_number_list[temp];
if (enemy_num != 0) {
shoot_autofire_bullet(enemy_num);
}
if (enemy_number_list[0] == 0) {
reorganize_list();
}
}
}
if ((health_regen_level != 0) && (current_health < max_health)) {
health_regen_counter++;
if (health_regen_counter >= regen_time) {
health_regen_counter = 0;
current_health = current_health + regen_amount;
if (current_health > max_health) {
current_health = max_health;
}
set_health();
}
}
if (laser_blast_charge > displayed_laser_blast_charge) {
displayed_laser_blast_charge++;
laser_ready_bar.insides.gotoAndStop(Math.round(displayed_laser_blast_charge));
}
if (reset_laser == 1) {
reset_laser_bar();
}
if (displayed_money != current_money) {
update_money();
}
if (displayed_points != current_points) {
update_points();
}
if (next_wave_counter < wave_time) {
determine_enemies();
}
next_wave_counter++;
if (((next_wave_counter > wave_time) && (current_number_of_enemies == 0)) && (big_bad_boss == 0)) {
next_wave_counter = 0;
_root.kongregateStats.submit(score_report, current_points);
_root.kongregateStats.submit(wave_num_report, current_level);
save_game();
load_upgrade_menu();
current_level++;
if (((((((current_level == 25) || (current_level == 26)) || (current_level == 27)) || (current_level == 33)) || (current_level == 35)) || (current_level == 36)) || (current_level == 40)) {
wave_time = 300;
} else {
wave_time = 3600;
}
wave_box.text_box.text = "Wave " + current_level;
current_money = Math.round(current_money * (1 + interest_rate));
reset_stuff();
}
if (points_multiplier > 1.001) {
points_multiplier = points_multiplier - 0.005;
set_multiplier();
}
}
};
var enemy_counter = 0;
var next_enemy_counter = 0;
test_frame_button.onRelease = function () {
load_upgrade_menu();
};
Frame 7
menu_block.play();
onEnterFrame = function () {
};
onMouseDown = function () {
gotoAndStop ("instructions_panel2");
};
Frame 8
onEnterFrame = function () {
crosshair._x = _xmouse;
crosshair._y = _ymouse;
};
onMouseDown = function () {
gotoAndStop ("instructions_panel3");
};
Frame 9
onEnterFrame = function () {
crosshair._x = _xmouse;
crosshair._y = _ymouse;
};
onMouseDown = function () {
gotoAndStop ("instructions_panel4");
};
Frame 10
onEnterFrame = function () {
crosshair._x = _xmouse;
crosshair._y = _ymouse;
};
onMouseDown = function () {
gotoAndStop ("instructions_panel5");
};
Frame 11
onEnterFrame = function () {
crosshair._x = _xmouse;
crosshair._y = _ymouse;
};
onMouseDown = function () {
gotoAndStop ("instructions_panel6");
};
Frame 12
onEnterFrame = function () {
crosshair._x = _xmouse;
crosshair._y = _ymouse;
};
onMouseDown = function () {
gotoAndStop ("instructions_panel7");
};
Frame 13
onEnterFrame = function () {
crosshair._x = _xmouse;
crosshair._y = _ymouse;
};
onMouseDown = function () {
gotoAndStop ("instructions_panel8");
};
Frame 14
onEnterFrame = function () {
crosshair._x = _xmouse;
crosshair._y = _ymouse;
};
onMouseDown = function () {
gotoAndStop ("instructions_panel9");
};
Frame 15
onEnterFrame = function () {
crosshair._x = _xmouse;
crosshair._y = _ymouse;
};
onMouseDown = function () {
l_to_r.play();
};
Frame 16
menu_block.play();
link_3.onRelease = function () {
l_to_r.play();
};
link_1.onRelease = function () {
getURL ("http://karco.newgrounds.com/", "_blank");
};
link_2.onRelease = function () {
getURL ("http://premoeffect.newgrounds.com/", "_blank");
};
link_4.onRelease = function () {
getURL ("http://batterytime.110mb.com/", "_blank");
};
onEnterFrame = function () {
};
Frame 17
function onMouseDown() {
}
stop();
paused_var = 0;
Key.removeListener(keyListener);
onEnterFrame = function () {
crosshair._x = _xmouse;
crosshair._y = _ymouse;
_root._x = Math.random() * 10;
_root._y = Math.random() * 10;
};
attachMovie("fade_to_black", "fader", 100000, {_x:350, _y:250});
Frame 18
var save_file = SharedObject.getLocal("TOTNeoniumSave");
save_file.clear();
paused_var = 0;
game_song.stop();
_root._x = 0;
_root._y = 0;
onEnterFrame = function () {
};
Mouse.show();
for (var i in _root) {
if ((typeof(_root[i]) == "movieclip") && (_root[i]._name != "mochi_boards")) {
trace(_root[i]._name);
removeMovieClip(_root[i]);
}
}
menu_button.onRelease = function () {
menu_mute = 0;
_root.createEmptyMovieClip("menusnd", 2056);
_root.menu_song = new Sound(menusnd);
_root.menu_song.attachSound("KeyToYourSoul");
_root.menu_song.start(0, 99999);
_root.menu_song.setVolume(100);
l_to_r.play();
};
wave_text.text = "GAME OVER AT WAVE " + current_level;
final_score.text = "Final Score: " + current_points;
_root.kongregateScores.submit(current_points);
_root.kongregateStats.submit(score_report, current_points);
if (difficulty_level == 1) {
mochi.MochiScores.showLeaderboard({boardID:"a7a6a0ad24085b4f", score:current_points, res:"650x450"});
}
if (difficulty_level == 2) {
mochi.MochiScores.showLeaderboard({boardID:"a7e581023f564ad7", score:current_points, res:"650x450"});
}
if (difficulty_level == 3) {
mochi.MochiScores.showLeaderboard({boardID:"ef8d99a16370fdb2", score:current_points, res:"650x450"});
}
if (difficulty_level == 4) {
mochi.MochiScores.showLeaderboard({boardID:"9402d6b67c587edd", score:current_points, res:"650x450"});
}
Frame 19
paused_var = 3;
explosion_num = 0;
attachMovie("fade_to_white", "fader", 100000, {_x:300, _y:250});
onEnterFrame = function () {
crosshair._x = _xmouse;
crosshair._y = _ymouse;
_root._x = Math.random() * 10;
_root._y = Math.random() * 10;
explosion_num++;
if (explosion_num == 20) {
explosion_num = 0;
le_x = game_win_x + ((Math.random() - 0.5) * 100);
le_y = game_win_y + ((Math.random() - 0.5) * 100);
h = 0;
while (h < 25) {
the_movie = _root.attachMovie("particle_system", "particle" + particle_num, particle_num, {_x:le_x, _y:le_y, _rotation:random(360)});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
particle_num++;
if (particle_num > 22000) {
particle_num = 20000;
}
h++;
}
}
};
Frame 20
game_song.stop();
for (var i in _root) {
if (typeof(_root[i]) == "movieclip") {
removeMovieClip(_root[i]);
}
}
onEnterFrame = function () {
crosshair._x = _xmouse;
crosshair._y = _ymouse;
};
Frame 21
var save_file = SharedObject.getLocal("TOTNeoniumSave");
save_file.clear();
_root._x = 0;
_root._y = 0;
score_box.text = "FINAL SCORE: " + current_points;
difficulty_box.text = ("YOU HAVE SUCCESSFULLY DEFENDED THE\nTOWER FOR 40 WAVES ON " + difficulty) + "!";
_root.kongregateScores.submit(current_points);
_root.kongregateStats.submit(game_finished_report, 1);
_root.kongregateStats.submit(score_report, current_points);
_root.kongregateStats.submit(wave_num_report, current_level);
onEnterFrame = function () {
};
menu_button.onRelease = function () {
menu_mute = 0;
_root.createEmptyMovieClip("menusnd", 2056);
_root.menu_song = new Sound(menusnd);
_root.menu_song.attachSound("KeyToYourSoul");
_root.menu_song.start(0, 99999);
_root.menu_song.setVolume(100);
l_to_r.play();
};
Mouse.show();
if (difficulty_level == 1) {
mochi.MochiScores.showLeaderboard({boardID:"a7a6a0ad24085b4f", score:current_points, res:"650x450"});
}
if (difficulty_level == 2) {
mochi.MochiScores.showLeaderboard({boardID:"a7e581023f564ad7", score:current_points, res:"650x450"});
}
if (difficulty_level == 3) {
mochi.MochiScores.showLeaderboard({boardID:"ef8d99a16370fdb2", score:current_points, res:"650x450"});
}
if (difficulty_level == 4) {
mochi.MochiScores.showLeaderboard({boardID:"9402d6b67c587edd", score:current_points, res:"650x450"});
}
Frame 23
onEnterFrame = function () {
};
debugText.text = debugText;
Symbol 6 MovieClip Frame 1
stop();
Symbol 9 MovieClip [splitting_rhombus_small] Frame 1
var health = (7 * _parent.enemy_health_multiplier);
var max_health = (7 * _parent.enemy_health_multiplier);
var armor = Math.round(_parent.enemy_armor_addition / 2);
var speed = (1.75 * (Math.random() + 0.5));
var money_value = (240 * _parent.enemy_money_multiplier);
var point_value = 480;
var laser_load = 1;
var frame = 0;
var damage = Math.round(5 * _parent.enemy_damage_multiplier);
var num_particles = 25;
var actual_speed = speed;
handle_frames = function () {
if (_parent.paused_var == 0) {
actual_speed = speed;
} else {
actual_speed = 0;
}
frame = Math.round(100 * (health / max_health));
health_bar.gotoAndStop(frame);
this._x = this._x + actual_speed;
};
Symbol 10 MovieClip [splitting_rhombus] Frame 1
var health = (10 * _parent.enemy_health_multiplier);
var max_health = (10 * _parent.enemy_health_multiplier);
var armor = (1 + Math.round(_parent.enemy_armor_addition / 2));
var speed = (0.5 * (Math.random() + 0.5));
var money_value = (320 * _parent.enemy_money_multiplier);
var point_value = 1000;
var laser_load = 1;
var frame = 0;
var damage = Math.round(10 * _parent.enemy_damage_multiplier);
var teh_name = "rhombus";
var num_particles = 25;
var actual_speed = speed;
handle_frames = function () {
if (_parent.paused_var == 0) {
actual_speed = speed;
} else {
actual_speed = 0;
}
frame = Math.round(100 * (health / max_health));
health_bar.gotoAndStop(frame);
this._x = this._x + actual_speed;
};
Symbol 30 MovieClip [reg_bar_insides] Frame 1
stop();
Symbol 301 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;
}
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 302 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.35");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static function addLinkEvent(url, burl, btn, onClick) {
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
var _local3;
var _local2 = new LoadVars();
var timeout = 1500;
var t0 = getTimer();
var ping = this.createEmptyMovieClip("ping", 777);
this.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
delete this.ping;
getURL (url + s, "_blank");
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
delete this.ping;
getURL (burl, "_blank");
}
};
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
if (onClick != undefined) {
onClick();
}
};
}
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 303 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.7");
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
}
Symbol 111 MovieClip [Sound_Encapsulator] Frame 1
stop();
Symbol 114 MovieClip [flash_screen] Frame 1
_parent.changing = 1;
Symbol 114 MovieClip [flash_screen] Frame 30
_parent.changing = 0;
stop();
removeMovieClip(this);
Symbol 151 MovieClip [upgrade_screen_frame] Frame 1
attachMovie("button_blocker", "button_blocker", 2000000, {_x:0, _y:0});
var quality_set = 0;
attachMovie("real_border_fancy", "upg_scr_border", 2, {_x:0, _y:0});
var changing = 0;
var which_menu = 1;
var weapon_1_cost = 5000;
var weapon_2_cost = 10000;
var weapon_3_cost = 20000;
var weapon_4_cost = 100000;
var weapon_5_cost = 35000;
var weapon_6_cost = 40000;
var weapon_7_cost = 25000;
var weapon_8_cost = 25000;
var damage_upgrade_cost_increase = 1000;
var damage_upgrade_cost = Math.round((damage_upgrade_cost_increase * ((_parent.damage_multiplier - 1) / 0.1)) + damage_upgrade_cost_increase);
var health_upgrade_cost_increase = 1500;
var health_upgrade_cost = Math.round((health_upgrade_cost_increase * ((_parent.max_health - 100) / 25)) + health_upgrade_cost_increase);
var reload_speed_upgrade_cost_increase = 1000;
var reload_speed_upgrade_cost = Math.round((reload_speed_upgrade_cost_increase * ((1 - _parent.reload_modifier) / 0.05)) + reload_speed_upgrade_cost_increase);
var accuracy_upgrade_cost_increase = 1500;
var accuracy_upgrade_cost = Math.round((accuracy_upgrade_cost_increase * ((1 - _parent.bullet_spread_modifier) / 0.1)) + accuracy_upgrade_cost_increase);
var armor_piercing_bullets_cost = 10000;
var armor_piercing_upgrade_cost_increase = 2500;
var armor_piercing_upgrade_cost = Math.round((armor_piercing_upgrade_cost_increase * (_parent.armor_piercing_level - 1)) + armor_piercing_upgrade_cost_increase);
var interest_rate_cost_multiplier = 1.5;
var interest_rate_start_cost = 100;
var interest_rate_cost = (Math.round(Math.pow(interest_rate_cost_multiplier, (_parent.interest_rate / 0.01) + 1)) * interest_rate_start_cost);
var autofire_turret_cost = 20000;
var turret_damage_upgrade_cost_increase = 5000;
var turret_damage_upgrade_cost = Math.round((turret_damage_upgrade_cost_increase * (_parent.autofire_damage - 1)) + turret_damage_upgrade_cost_increase);
var turret_rof_upgrade_cost_increase = 2500;
var turret_rof_upgrade_cost = Math.round((turret_rof_upgrade_cost_increase * ((240 - _parent.autofire_turret_rof) / 5)) + turret_rof_upgrade_cost_increase);
money_display.text = "$" + _parent.current_money;
var ten_health_cost = 250;
var hundred_health_cost = 2250;
var thousand_health_cost = 20250;
var level_1_regen_cost = 10000;
var level_2_regen_cost = 75000;
var level_3_regen_cost = 200000;
var points_cost = 10000;
var points_earned = 100000;
updateWeaponButtons = function () {
upgr_title_bar.text = "Weapon Upgrade Menu";
if (_parent.submachine_gun_bought == 0) {
text_box_1.text = "Sub-Machine Gun (2)\nQuick firing, but low\ndamaging gun. An\nupgrade from your\npistol. $" + weapon_1_cost;
} else {
text_box_1.text = "Sub-Machine Gun (2)\nWEAPON BOUGHT";
}
if (_parent.sniper_rifle_bought == 0) {
text_box_2.text = "Sniper Rifle (3)\nExtremely accurate\nand high damaging,\nbut slow to reload.\n$" + weapon_2_cost;
} else {
text_box_2.text = "Sniper Rifle (3)\nWEAPON BOUGHT";
}
if (_parent.machine_gun_bought == 0) {
text_box_3.text = "Machine Gun (4)\nVery fast rate of fire\nand decent damage.\n$" + weapon_3_cost;
} else {
text_box_3.text = "Machine Gun (4)\nWEAPON BOUGHT";
}
if (_parent.vulcan_minigun_bought == 0) {
text_box_4.text = "Vulcan Minigun (5)\nSixty bullets per\nsecond offset the\nhigh cost of this gun.\n$" + weapon_4_cost;
} else {
text_box_4.text = "Vulcan Minigun (5)\nWEAPON BOUGHT";
}
if (_parent.automatic_laser_bought == 0) {
text_box_5.text = "Automatic Laser (Q)\nFuturistic weaponry\nthat boasts a high\nfire rate and high\ndamage. $" + weapon_5_cost;
} else {
text_box_5.text = "Automatic Laser (Q)\nWEAPON BOUGHT";
}
if (_parent.plasma_cannon_bought == 0) {
text_box_6.text = "Plasma Cannon (W)\nFires slow moving\nplasma that deal\nimmense damage.\n$" + weapon_6_cost;
} else {
text_box_6.text = "Plasma Cannon (W)\nWEAPON BOUGHT";
}
if (_parent.laser_bought == 0) {
text_box_7.text = "Charge Laser(E)\nFires a wide beam\nof energy that is\naimable. Must be\ncharged. $" + weapon_7_cost;
} else {
text_box_7.text = "Charge Laser(E)\nWEAPON BOUGHT";
}
text_box_8.text = "Damage Upgrade\nIncreases the\ndamage multiplier of\nall weapons by 0.1.\n$" + damage_upgrade_cost;
text_box_9.text = "Current Damage\nMultiplier:\n" + _parent.damage_multiplier;
};
update_stats = function () {
text_box_8.text = (((((((("Health:\n" + _parent.current_health) + "/") + _parent.max_health) + "\nReload Speed: ") + _parent.reload_modifier) + "\nAccuracy: ") + _parent.bullet_spread_modifier) + "\nAP Level: ") + _parent.armor_piercing_level;
text_box_9.text = (((("Turret Damage: " + _parent.autofire_damage) + "\nTurret ROF: ") + _parent.autofire_turret_rof) + "\n\nPoints:\n") + _parent.current_points;
};
weapon_button.onRelease = function () {
if (changing == 0) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
updateWeaponButtons();
which_menu = 1;
}
};
tower_button.onRelease = function () {
if (changing == 0) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
upgr_title_bar.text = "Tower/Turret Upgrade Menu";
text_box_1.text = "Health Upgrade\nIncreases your base\nhealth by 25.\n\n$" + health_upgrade_cost;
if (_parent.reload_modifier > 0.29) {
text_box_2.text = "Reload Speed\nDecreases your\nreload speed by 5%,\nup to a max of 75%.\n$" + reload_speed_upgrade_cost;
} else {
text_box_2.text = "RELOAD SPEED\nMAXED";
}
text_box_3.text = "Accuracy Upgrade\nDecreases the\nspread of your\nbullets.\n$" + accuracy_upgrade_cost;
if (_parent.armor_piercing_level == 0) {
text_box_4.text = "Armor Piercing\nBullets\nHelps to pass\nthrough enemy\narmor. $" + armor_piercing_bullets_cost;
} else {
text_box_4.text = "ARMOR PIERCING\nBULLETS\nPURCHASED";
}
if (_parent.armor_piercing_level == 0) {
text_box_5.text = "YOU MUST BUY\nARMOR PIERCING\nBULLETS FIRST";
} else {
text_box_5.text = "Armor Piercing\nUpgrade\nIncreases the\neffectiveness of AP\nbullets. $" + armor_piercing_upgrade_cost;
}
text_box_6.text = (((("Interest Rate\nCurrent: " + (_parent.interest_rate * 100)) + "%\nNext: ") + ((_parent.interest_rate + 0.01) * 100)) + "%\n$") + interest_rate_cost;
if (_parent.autofire_turret_bought == 1) {
text_box_7.text = "AUTOFIRE TURRET\nBOUGHT";
text_box_8.text = "Turret Damage\nUpgrade\nIncrease the damage\nof the turret.\n$" + turret_damage_upgrade_cost;
if (_parent.autofire_turret_rof > 59) {
text_box_9.text = "Turret Rate of Fire\nUpgrade\nIncreases the rate\nof fire of the turret.\n$" + turret_rof_upgrade_cost;
} else {
text_box_9.text = "TURRET RATE OF\nFIRE MAXED";
}
} else {
text_box_7.text = "Autofire Turret\nAutomatically\nfires on a random\nenemy. Can be\nupgraded. $" + autofire_turret_cost;
text_box_8.text = "YOU MUST BUY\nTHE AUTOFIRE\nTURRET FIRST";
text_box_9.text = "YOU MUST BUY\nTHE AUTOFIRE\nTURRET FIRST";
}
which_menu = 2;
}
};
repair_button.onRelease = function () {
if (changing == 0) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
upgr_title_bar.text = "Repair/Misc. Upgrades Menu";
text_box_1.text = "Repair 10 Health\n$" + ten_health_cost;
text_box_2.text = "Repair 100 Health\n$" + hundred_health_cost;
text_box_3.text = "Repair 1000 Health\n$" + thousand_health_cost;
if (_parent.health_regen_level == 0) {
text_box_4.text = "Health\nRegeneration\nLevel 1\n$" + level_1_regen_cost;
text_box_5.text = "LEVEL ONE HEALTH\nREGENERATION\nREQUIRED";
text_box_6.text = "LEVEL TWO HEALTH\nREGENERATION\nREQUIRED";
}
if (_parent.health_regen_level == 1) {
text_box_4.text = "LEVEL ONE HEALTH\nREGENERATION\nBOUGHT";
text_box_5.text = "Health\nRegeneration\nLevel 2\n$" + level_2_regen_cost;
text_box_6.text = "LEVEL TWO HEALTH\nREGENERATION\nREQUIRED";
}
if (_parent.health_regen_level == 2) {
text_box_4.text = "LEVEL ONE HEALTH\nREGENERATION\nBOUGHT";
text_box_5.text = "LEVEL TWO HEALTH\nREGENERATION\nBOUGHT";
text_box_6.text = "Health\nRegeneration\nLevel 3\n$" + level_3_regen_cost;
}
if (_parent.health_regen_level == 3) {
text_box_4.text = "LEVEL ONE HEALTH\nREGENERATION\nBOUGHT";
text_box_5.text = "LEVEL TWO HEALTH\nREGENERATION\nBOUGHT";
text_box_6.text = "LEVEL THREE\nHEALTH\nREGENERATION\nBOUGHT";
}
text_box_7.text = ((("Buy Points\n\nBuy " + points_earned) + "\npoints for\n$") + points_cost) + ".";
update_stats();
which_menu = 3;
}
};
button_1.onRelease = function () {
if (which_menu == 1) {
if ((_parent.submachine_gun_bought == 0) && (_parent.current_money >= weapon_1_cost)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.submachine_gun_bought = 1;
_parent.current_money = _parent.current_money - weapon_1_cost;
money_display.text = "$" + _parent.current_money;
text_box_1.text = "Sub-Machine Gun(2)\nWEAPON BOUGHT";
}
}
if (which_menu == 2) {
if (_parent.current_money >= health_upgrade_cost) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.current_money = _parent.current_money - health_upgrade_cost;
_parent.max_health = _parent.max_health + 25;
_parent.current_health = _parent.current_health + 25;
health_upgrade_cost = health_upgrade_cost + health_upgrade_cost_increase;
text_box_1.text = "Health Upgrade\nIncreases your base\nhealth by 25.\n\n$" + health_upgrade_cost;
money_display.text = "$" + _parent.current_money;
_parent.set_health();
}
}
if (which_menu == 3) {
if ((_parent.current_money >= ten_health_cost) && (_parent.current_health < _parent.max_health)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.current_money = _parent.current_money - ten_health_cost;
_parent.current_health = _parent.current_health + 10;
if (_parent.current_health > _parent.max_health) {
_parent.current_health = _parent.max_health;
}
money_display.text = "$" + _parent.current_money;
_parent.set_health();
update_stats();
}
}
};
button_2.onRelease = function () {
if (which_menu == 1) {
if ((_parent.sniper_rifle_bought == 0) && (_parent.current_money >= weapon_2_cost)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.sniper_rifle_bought = 1;
_parent.current_money = _parent.current_money - weapon_2_cost;
money_display.text = "$" + _parent.current_money;
text_box_2.text = "Sniper Rifle(3)\nWEAPON BOUGHT";
}
}
if (which_menu == 2) {
if ((_parent.current_money >= reload_speed_upgrade_cost) && (_parent.reload_modifier > 0.29)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.current_money = _parent.current_money - reload_speed_upgrade_cost;
_parent.reload_modifier = _parent.reload_modifier - 0.05;
reload_speed_upgrade_cost = reload_speed_upgrade_cost + reload_speed_upgrade_cost_increase;
if (_parent.reload_modifier > 0.29) {
text_box_2.text = "Reload Speed\nDecreases your\nreload speed by 5%,\nup to a max of 75%.\n$" + reload_speed_upgrade_cost;
} else {
text_box_2.text = "RELOAD SPEED\nMAXED";
}
money_display.text = "$" + _parent.current_money;
_parent.apply_modifiers();
}
}
if (which_menu == 3) {
if ((_parent.current_money >= hundred_health_cost) && (_parent.current_health < _parent.max_health)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.current_money = _parent.current_money - hundred_health_cost;
_parent.current_health = _parent.current_health + 100;
if (_parent.current_health > _parent.max_health) {
_parent.current_health = _parent.max_health;
}
_parent.set_health();
update_stats();
}
}
};
button_3.onRelease = function () {
if (which_menu == 1) {
if ((_parent.machine_gun_bought == 0) && (_parent.current_money >= weapon_3_cost)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.machine_gun_bought = 1;
_parent.current_money = _parent.current_money - weapon_3_cost;
money_display.text = "$" + _parent.current_money;
text_box_3.text = "Machine Gun(4)\nWEAPON BOUGHT";
money_display.text = "$" + _parent.current_money;
}
}
if (which_menu == 2) {
if ((_parent.current_money >= accuracy_upgrade_cost) && (_parent.bullet_spread_modifier > 0.09)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.current_money = _parent.current_money - accuracy_upgrade_cost;
_parent.bullet_spread_modifier = _parent.bullet_spread_modifier - 0.1;
accuracy_upgrade_cost = accuracy_upgrade_cost + accuracy_upgrade_cost_increase;
if (_parent.bullet_spread_modifier > 0.09) {
text_box_3.text = "Accuracy Upgrade\nDecreases the\nspread of your\nbullets.\n$" + accuracy_upgrade_cost;
} else {
text_box_3.text = "ACCURACY LEVEL\nMAXED";
}
money_display.text = "$" + _parent.current_money;
_parent.apply_modifiers();
}
}
if (which_menu == 3) {
if ((_parent.current_money >= thousand_health_cost) && (_parent.current_health < _parent.max_health)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.current_money = _parent.current_money - thousand_health_cost;
_parent.current_health = _parent.current_health + 1000;
if (_parent.current_health > _parent.max_health) {
_parent.current_health = _parent.max_health;
}
money_display.text = "$" + _parent.current_money;
_parent.set_health();
update_stats();
}
}
};
button_4.onRelease = function () {
if (which_menu == 1) {
if ((_parent.vulcan_minigun_bought == 0) && (_parent.current_money >= weapon_4_cost)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.vulcan_minigun_bought = 1;
_parent.current_money = _parent.current_money - weapon_4_cost;
money_display.text = "$" + _parent.current_money;
text_box_4.text = "Vulcan Minigun(5)\nWEAPON BOUGHT";
}
}
if (which_menu == 2) {
if ((_parent.armor_piercing_level == 0) && (_parent.current_money >= armor_piercing_bullets_cost)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.current_money = _parent.current_money - armor_piercing_bullets_cost;
_parent.armor_piercing_level = 1;
money_display.text = "$" + _parent.current_money;
text_box_4.text = "ARMOR PIERCING\nBULLETS\nPURCHASED";
armor_piercing_upgrade_cost = armor_piercing_upgrade_cost_increase;
text_box_5.text = "Armor Piercing\nUpgrade\nIncreases the\neffectiveness of AP\nbullets. $" + armor_piercing_upgrade_cost;
}
}
if (which_menu == 3) {
if ((_parent.health_regen_level == 0) && (_parent.current_money >= level_1_regen_cost)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.current_money = _parent.current_money - level_1_regen_cost;
_parent.health_regen_level = 1;
money_display.text = "$" + _parent.current_money;
text_box_4.text = "LEVEL ONE HEALTH\nREGENERATION\nBOUGHT";
text_box_5.text = "Health\nRegeneration\nLevel 2\n$" + level_2_regen_cost;
}
}
};
button_5.onRelease = function () {
if (which_menu == 1) {
if ((_parent.automatic_laser_bought == 0) && (_parent.current_money >= weapon_5_cost)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.automatic_laser_bought = 1;
_parent.current_money = _parent.current_money - weapon_5_cost;
money_display.text = "$" + _parent.current_money;
text_box_5.text = "Automatic Laser(Q)\nWEAPON BOUGHT";
}
}
if (which_menu == 2) {
if ((_parent.armor_piercing_level != 0) && (_parent.current_money >= armor_piercing_upgrade_cost)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.current_money = _parent.current_money - armor_piercing_upgrade_cost;
armor_piercing_upgrade_cost = armor_piercing_upgrade_cost + armor_piercing_upgrade_cost_increase;
_parent.armor_piercing_level++;
money_display.text = "$" + _parent.current_money;
text_box_5.text = "Armor Piercing\nUpgrade\nIncreases the\neffectiveness of AP\nbullets. $" + armor_piercing_upgrade_cost;
}
}
if (which_menu == 3) {
if ((_parent.health_regen_level == 1) && (_parent.current_money >= level_2_regen_cost)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.current_money = _parent.current_money - level_2_regen_cost;
_parent.health_regen_level = 2;
_parent.regen_time = 360;
_parent.regen_amount = 2;
money_display.text = "$" + _parent.current_money;
text_box_5.text = "LEVEL TWO HEALTH\nREGENERATION\nBOUGHT";
text_box_6.text = "Health\nRegeneration\nLevel 3\n$" + level_3_regen_cost;
}
}
};
button_6.onRelease = function () {
if (which_menu == 1) {
if ((_parent.plasma_cannon_bought == 0) && (_parent.current_money >= weapon_6_cost)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.plasma_cannon_bought = 1;
_parent.current_money = _parent.current_money - weapon_6_cost;
money_display.text = "$" + _parent.current_money;
text_box_6.text = "Plasma Cannon(W)\nWEAPON BOUGHT";
}
}
if (which_menu == 2) {
if (_parent.current_money >= interest_rate_cost) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.interest_rate = _parent.interest_rate + 0.01;
_parent.current_money = _parent.current_money - interest_rate_cost;
interest_rate_cost = Math.round(Math.pow(interest_rate_cost_multiplier, (_parent.interest_rate / 0.01) + 1)) * interest_rate_start_cost;
money_display.text = "$" + _parent.current_money;
text_box_6.text = (((("Interest Rate\nCurrent: " + (_parent.interest_rate * 100)) + "%\nNext: ") + ((_parent.interest_rate + 0.01) * 100)) + "%\n$") + interest_rate_cost;
}
}
if (which_menu == 3) {
if ((_parent.health_regen_level == 2) && (_parent.current_money >= level_3_regen_cost)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.current_money = _parent.current_money - level_3_regen_cost;
_parent.health_regen_level = 3;
_parent.regen_time = 300;
_parent.regen_amount = 4;
money_display.text = "$" + _parent.current_money;
text_box_6.text = "LEVEL THREE\nHEALTH\nREGENERATION\nBOUGHT";
}
}
};
button_7.onRelease = function () {
if (which_menu == 1) {
if ((_parent.laser_bought == 0) && (_parent.current_money >= weapon_7_cost)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.laser_bought = 1;
_parent.current_money = _parent.current_money - weapon_7_cost;
money_display.text = "$" + _parent.current_money;
text_box_7.text = "Charge Laser(E)\nWEAPON BOUGHT";
}
}
if (which_menu == 2) {
if ((_parent.current_money >= autofire_turret_cost) && (_parent.autofire_turret_bought == 0)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.autofire_turret_bought = 1;
_parent.current_money = _parent.current_money - autofire_turret_cost;
_parent.autofire_damage = 1;
_parent.autofire_turret_rof = 240;
turret_damage_upgrade_cost = turret_damage_upgrade_cost_increase;
turret_rof_upgrade_cost = turret_rof_upgrade_cost_increase;
text_box_8.text = "Turret Damage\nUpgrade\nIncrease the damage\nof the turret.\n$" + turret_damage_upgrade_cost;
text_box_9.text = "Turret Rate of Fire\nUpgrade\nIncreases the rate\nof fire of the turret.\n$" + turret_rof_upgrade_cost;
text_box_7.text = "AUTOFIRE TURRET\nBOUGHT";
money_display.text = "$" + _parent.current_money;
}
}
if (which_menu == 3) {
if (_parent.current_money >= points_cost) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.current_money = _parent.current_money - points_cost;
_parent.add_points(points_earned);
money_display.text = "$" + _parent.current_money;
update_stats();
}
}
};
button_8.onRelease = function () {
if (which_menu == 1) {
if (_parent.current_money >= damage_upgrade_cost) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.damage_multiplier = int((_parent.damage_multiplier + 0.11) * 10) / 10;
_parent.current_money = _parent.current_money - damage_upgrade_cost;
damage_upgrade_cost = damage_upgrade_cost + damage_upgrade_cost_increase;
money_display.text = "$" + _parent.current_money;
_parent.bullet_damage = _parent.base_bullet_damage * _parent.damage_multiplier;
text_box_8.text = "Damage Upgrade\nIncreases the\ndamage multiplier of\nall weapons by 0.1.\n$" + damage_upgrade_cost;
text_box_9.text = "Current Damage\nMultiplier:\n" + _parent.damage_multiplier;
}
}
if (which_menu == 2) {
if ((_parent.current_money >= turret_damage_upgrade_cost) && (_parent.autofire_turret_bought == 1)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.autofire_damage = _parent.autofire_damage + 1;
_parent.current_money = _parent.current_money - turret_damage_upgrade_cost;
turret_damage_upgrade_cost = turret_damage_upgrade_cost + turret_damage_upgrade_cost_increase;
money_display.text = "$" + _parent.current_money;
text_box_8.text = "Turret Damage\nUpgrade\nIncrease the damage\nof the turret.\n$" + turret_damage_upgrade_cost;
}
}
};
button_9.onRelease = function () {
if (which_menu == 1) {
}
if (which_menu == 2) {
if (((_parent.current_money >= turret_rof_upgrade_cost) && (_parent.autofire_turret_bought == 1)) && (_parent.autofire_turret_rof > 59)) {
attachMovie("flash_screen", "flash_screen", 1, {_x:60, _y:0});
_parent.autofire_turret_rof = _parent.autofire_turret_rof - 5;
_parent.current_money = _parent.current_money - turret_rof_upgrade_cost;
turret_rof_upgrade_cost = turret_rof_upgrade_cost + turret_rof_upgrade_cost_increase;
money_display.text = "$" + _parent.current_money;
if (_parent.autofire_turret_rof > 59) {
text_box_9.text = "Turret Rate of Fire\nUpgrade\nIncreases the rate\nof fire of the turret.\n$" + turret_rof_upgrade_cost;
} else {
text_box_9.text = "TURRET RATE OF\nFIRE MAXED";
}
}
}
};
updateWeaponButtons();
Symbol 154 MovieClip [pause_screen] Frame 1
Symbol 162 MovieClip Frame 60
_parent.go_on = 1;
this.removeMovieClip(this);
Symbol 166 MovieClip Frame 300
_parent.go_on = 1;
trace(_parent._parent.laser_firing);
_parent._parent.laser_firing = 1;
Symbol 167 MovieClip [epic_laser] Frame 1
var awesome = 1;
var go_on = 0;
_parent.reset_laser = 1;
if (_parent.muted == 0) {
var laser_buzz = new Sound();
laser_buzz.attachSound("HugeLaser");
laser_buzz.start(0, 999);
}
onEnterFrame = function () {
if (go_on == 1) {
play();
}
};
stop();
Symbol 167 MovieClip [epic_laser] Frame 2
var go_on = 0;
onEnterFrame = function () {
if (go_on == 1) {
laser_buzz.stop();
delete this.laser_buzz;
_parent.laser_firing = 0;
this.removeMovieClip(this);
}
};
stop();
Symbol 171 MovieClip [laser_ready_bar_insides] Frame 1
stop();
Symbol 175 MovieClip [particle_system] Frame 1
temp = random(4) + 1;
if (temp == 1) {
gotoAndPlay ("1");
} else if (temp == 2) {
gotoAndPlay ("2");
} else if (temp == 3) {
gotoAndPlay ("3");
} else if (temp == 4) {
gotoAndPlay ("4");
}
Symbol 175 MovieClip [particle_system] Frame 36
gotoAndStop (112);
Symbol 175 MovieClip [particle_system] Frame 56
gotoAndStop (112);
Symbol 175 MovieClip [particle_system] Frame 76
gotoAndStop (112);
Symbol 175 MovieClip [particle_system] Frame 111
gotoAndStop (112);
Symbol 177 MovieClip [bullet_particle_system] Frame 1
temp = random(4) + 1;
if (temp == 1) {
gotoAndPlay ("1");
} else if (temp == 2) {
gotoAndPlay ("2");
} else if (temp == 3) {
gotoAndPlay ("3");
} else if (temp == 4) {
gotoAndPlay ("4");
}
Symbol 177 MovieClip [bullet_particle_system] Frame 36
gotoAndStop (112);
Symbol 177 MovieClip [bullet_particle_system] Frame 56
gotoAndStop (112);
Symbol 177 MovieClip [bullet_particle_system] Frame 76
gotoAndStop (112);
Symbol 177 MovieClip [bullet_particle_system] Frame 111
gotoAndStop (112);
Symbol 180 MovieClip [generic_square] Frame 1
var health = (10 * _parent.enemy_health_multiplier);
var max_health = (10 * _parent.enemy_health_multiplier);
var armor = Math.round(_parent.enemy_armor_addition / 2);
var speed = (0.5 * (Math.random() + 0.5));
var money_value = (500 * _parent.enemy_money_multiplier);
var point_value = 1000;
var laser_load = 1;
var frame = 0;
var damage = Math.round(5 * _parent.enemy_damage_multiplier);
var num_particles = 25;
var actual_speed = speed;
handle_frames = function () {
if (_parent.paused_var == 0) {
actual_speed = speed;
} else {
actual_speed = 0;
}
frame = Math.round(100 * (health / max_health));
health_bar.gotoAndStop(frame);
this._x = this._x + actual_speed;
};
Symbol 183 MovieClip [evil_triangle] Frame 1
var health = (20 * _parent.enemy_health_multiplier);
var max_health = (20 * _parent.enemy_health_multiplier);
var armor = (2 + _parent.enemy_armor_addition);
var speed = (0.5 * (Math.random() + 0.5));
var money_value = (1000 * _parent.enemy_money_multiplier);
var point_value = 5000;
var laser_load = 1;
var frame = 0;
var damage = (10 * _parent.enemy_damage_multiplier);
var num_particles = 25;
var actual_speed = speed;
handle_frames = function () {
if (_parent.paused_var == 0) {
actual_speed = speed;
} else {
actual_speed = 0;
}
frame = Math.round(100 * (health / max_health));
health_bar.gotoAndStop(frame);
this._x = this._x + actual_speed;
};
Symbol 186 MovieClip [lol_circle] Frame 1
var health = (45 * _parent.enemy_health_multiplier);
var max_health = (45 * _parent.enemy_health_multiplier);
var armor = (3 + _parent.enemy_armor_addition);
var speed = (1 * (Math.random() + 0.5));
var money_value = (2000 * _parent.enemy_money_multiplier);
var point_value = 10000;
var laser_load = 1;
var frame = 0;
var damage = Math.round(15 * _parent.enemy_health_multiplier);
var count = 0;
var num_particles = 25;
var actual_speed = speed;
handle_frames = function () {
if (_parent.paused_var == 0) {
actual_speed = speed;
count++;
if (count > 60) {
count = 0;
actual_x_speed = Math.random() * speed;
if (Math.random() < 0.5) {
actual_y_speed = speed - actual_x_speed;
} else {
actual_y_speed = -(speed - actual_x_speed);
}
if (this._y >= 370) {
actual_y_speed = -(speed - actual_x_speed);
}
if (this._y <= 110) {
actual_y_speed = speed - actual_x_speed;
}
}
} else {
actual_x_speed = 0;
actual_y_speed = 0;
count = 60;
}
frame = Math.round(100 * (health / max_health));
health_bar.gotoAndStop(frame);
this._x = this._x + actual_x_speed;
this._y = this._y + actual_y_speed;
};
Symbol 189 MovieClip [teleporting_pentagon] Frame 1
var health = (75 * _parent.enemy_health_multiplier);
var max_health = (75 * _parent.enemy_health_multiplier);
var armor = (6 + _parent.enemy_armor_addition);
var speed = (0.5 * ((Math.random() * 0.5) + 0.75));
var money_value = (3000 * _parent.enemy_money_multiplier);
var point_value = 17500;
var laser_load = 1;
var frame = 0;
var damage = (20 * _parent.enemy_damage_multiplier);
var count = 0;
var num_particles = 25;
var actual_speed = speed;
handle_frames = function () {
if (_parent.paused_var == 0) {
count++;
if (count >= 90) {
count = 0;
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x, _y:this._y, _rotation:random(360)});
number = random(255);
hex = number.toString(16);
myColor = ("0x00" + hex) + "FF";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
}
if (count == 5) {
this._x = this._x + (90 * speed);
this._y = (Math.random() * 300) + 95;
}
}
frame = Math.round(100 * (health / max_health));
health_bar.gotoAndStop(frame);
};
Symbol 194 MovieClip [doom_hexagon] Frame 1
var health = (500 * _parent.enemy_health_multiplier);
var max_health = (500 * _parent.enemy_health_multiplier);
var armor = (10 + _parent.enemy_armor_addition);
var speed = (0.5 * ((Math.random() * 0.5) + 0.75));
var money_value = (10000 * _parent.enemy_money_multiplier);
var point_value = 100000;
var laser_load = 2;
var frame = 0;
var teh_name = "hexagon";
var next_y = ((Math.random() * 160) + 180);
var y_diff = (next_y - this._y);
var y_step = (next_y / 120);
var particle_system = "huge_particle_system";
var next_shot = (random(90) + 90);
var count = next_shot;
var num_particles = 25;
var actual_speed = speed;
handle_frames = function () {
if (_parent.paused_var == 0) {
if (this._x > 120) {
count++;
if (count >= next_shot) {
count = 0;
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 111.5, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 111.5, this._y, "pink_missile");
next_y = (Math.random() * 160) + 180;
y_diff = next_y - this._y;
next_shot = random(90) + 90;
y_step = y_diff / next_shot;
}
this._y = this._y + y_step;
} else {
this._x = this._x + speed;
}
}
frame = Math.round(100 * (health / max_health));
health_bar.gotoAndStop(frame);
};
Symbol 195 MovieClip [hexagon_shoot_particle_system] Frame 1
temp = random(4) + 1;
if (temp == 1) {
gotoAndPlay ("1");
} else if (temp == 2) {
gotoAndPlay ("2");
} else if (temp == 3) {
gotoAndPlay ("3");
} else if (temp == 4) {
gotoAndPlay ("4");
}
Symbol 195 MovieClip [hexagon_shoot_particle_system] Frame 36
gotoAndStop (112);
Symbol 195 MovieClip [hexagon_shoot_particle_system] Frame 56
gotoAndStop (112);
Symbol 195 MovieClip [hexagon_shoot_particle_system] Frame 76
gotoAndStop (112);
Symbol 195 MovieClip [hexagon_shoot_particle_system] Frame 111
gotoAndStop (112);
Instance of Symbol 175 MovieClip [particle_system] "particles" in Symbol 196 MovieClip [huge_particle_system] Frame 1
onClipEvent (load) {
this._xscale = 200;
this._xscale = 200;
}
Symbol 199 MovieClip [pink_missile] Frame 1
var health = (50 * _parent.enemy_health_multiplier);
var max_health = (50 * _parent.enemy_health_multiplier);
var armor = (2 + _parent.enemy_armor_addition);
var speed = 1;
var money_value = (1000 * _parent.enemy_money_multiplier);
var point_value = 2500;
var laser_load = 1;
var frame = 0;
var damage = Math.round(15 * _parent.enemy_damage_multiplier);
var num_particles = 25;
var actual_speed = speed;
handle_frames = function () {
if (_parent.paused_var == 0) {
speed = speed + 0.1;
actual_speed = speed;
} else {
actual_speed = 0;
}
frame = Math.round(100 * (health / max_health));
health_bar.gotoAndStop(frame);
this._x = this._x + actual_speed;
};
Symbol 200 MovieClip [orange_missile] Frame 1
var health = (20 * _parent.enemy_health_multiplier);
var max_health = (20 * _parent.enemy_health_multiplier);
var armor = (0 + _parent.enemy_armor_addition);
var speed = 0;
var money_value = (500 * _parent.enemy_money_multiplier);
var point_value = 500;
var laser_load = 0.5;
var frame = 0;
var damage = (10 * _parent.enemy_damage_multiplier);
var num_particles = 25;
var actual_speed = speed;
handle_frames = function () {
if (_parent.paused_var == 0) {
speed = speed + 0.1;
actual_speed = speed;
} else {
actual_speed = 0;
}
frame = Math.round(100 * (health / max_health));
health_bar.gotoAndStop(frame);
this._x = this._x + actual_speed;
};
Symbol 203 MovieClip [gray_star] Frame 1
var health = (4 * _parent.enemy_health_multiplier);
var max_health = (4 * _parent.enemy_health_multiplier);
var armor = (30 + _parent.enemy_armor_addition);
var speed = (0.2 * (Math.random() + 0.5));
var y_speed = (2 * (Math.random() + 0.5));
var money_value = (5000 * _parent.enemy_money_multiplier);
var point_value = 25000;
var laser_load = 1;
var frame = 0;
var damage = (20 * _parent.enemy_health_multiplier);
var num_particles = 25;
var actual_speed = speed;
handle_frames = function () {
if (_parent.paused_var == 0) {
if (this._y < 100) {
y_speed = y_speed * -1;
this._y = 100;
}
if (this._y > 380) {
y_speed = y_speed * -1;
this._y = 380;
}
this._x = this._x + speed;
this._y = this._y + y_speed;
}
frame = Math.round(100 * (health / max_health));
health_bar.gotoAndStop(frame);
};
Symbol 204 MovieClip [red_missile] Frame 1
var health = (100 * _parent.enemy_health_multiplier);
var max_health = (100 * _parent.enemy_health_multiplier);
var armor = (5 + _parent.enemy_armor_addition);
var speed = 1;
var money_value = (5000 * _parent.enemy_money_multiplier);
var point_value = 10000;
var laser_load = 1;
var frame = 0;
var damage = (20 * _parent.enemy_health_multiplier);
var num_particles = 25;
var actual_speed = speed;
handle_frames = function () {
if (_parent.paused_var == 0) {
speed = speed + 0.1;
actual_speed = speed;
} else {
actual_speed = 0;
}
frame = Math.round(100 * (health / max_health));
health_bar.gotoAndStop(frame);
this._x = this._x + actual_speed;
};
Symbol 207 MovieClip [boss_octagon] Frame 1
var health = (2000 * _parent.enemy_health_multiplier);
var max_health = (2000 * _parent.enemy_health_multiplier);
var armor = (20 + _parent.enemy_armor_addition);
var y_speed = 2;
var money_value = (1000000 * _parent.enemy_money_multiplier);
var point_value = 1000000;
var laser_load = 1;
var frame = 0;
var breather = 0;
var teh_name = "octagon";
var num_particles = 25;
var actual_speed = speed;
handle_frames = function () {
if (this._x > 70) {
if (_parent.paused_var == 0) {
if ((this._y < 130) || (this._y > 350)) {
y_speed = y_speed * -1;
}
this._y = this._y + y_speed;
play();
} else {
actual_speed = 0;
stop();
}
} else {
this._x = this._x + 2;
}
frame = Math.round(100 * (health / max_health));
health_bar.gotoAndStop(frame);
};
Symbol 207 MovieClip [boss_octagon] Frame 2
temp = random(12) + 1;
if ((breather == 1) && (Math.random() < 0.5)) {
temp = 12;
}
if (temp == 1) {
gotoAndPlay ("one_missile_cw");
breather = 1;
} else if (temp == 2) {
gotoAndPlay ("one_missile_ccw");
breather = 1;
} else if (temp == 3) {
gotoAndPlay ("quad_missile_cw");
breather = 1;
} else if (temp == 4) {
gotoAndPlay ("quad_missile_ccw");
breather = 1;
} else if (temp == 5) {
gotoAndPlay ("missile_spam_cw");
breather = 1;
} else if (temp == 6) {
gotoAndPlay ("missile_spam_ccw");
breather = 1;
} else if (temp == 7) {
gotoAndPlay ("invulnerable_cw");
breather = 1;
} else if (temp == 8) {
gotoAndPlay ("invulnerable_ccw");
breather = 1;
} else {
gotoAndPlay ("wait_time");
breather = 0;
}
Symbol 207 MovieClip [boss_octagon] Frame 50
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "red_missile");
gotoAndPlay ("random_frame");
Symbol 207 MovieClip [boss_octagon] Frame 98
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "red_missile");
gotoAndPlay ("random_frame");
Symbol 207 MovieClip [boss_octagon] Frame 111
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "pink_missile");
Symbol 207 MovieClip [boss_octagon] Frame 126
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "pink_missile");
Symbol 207 MovieClip [boss_octagon] Frame 141
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "pink_missile");
Symbol 207 MovieClip [boss_octagon] Frame 156
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "pink_missile");
gotoAndStop ("random_frame");
Symbol 207 MovieClip [boss_octagon] Frame 168
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "pink_missile");
Symbol 207 MovieClip [boss_octagon] Frame 183
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "pink_missile");
Symbol 207 MovieClip [boss_octagon] Frame 198
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "pink_missile");
Symbol 207 MovieClip [boss_octagon] Frame 213
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "pink_missile");
gotoAndStop ("random_frame");
Symbol 207 MovieClip [boss_octagon] Frame 240
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "orange_missile");
Symbol 207 MovieClip [boss_octagon] Frame 244
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "orange_missile");
Symbol 207 MovieClip [boss_octagon] Frame 248
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "orange_missile");
Symbol 207 MovieClip [boss_octagon] Frame 252
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "orange_missile");
Symbol 207 MovieClip [boss_octagon] Frame 256
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "orange_missile");
gotoAndPlay ("random_frame");
Symbol 207 MovieClip [boss_octagon] Frame 285
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "orange_missile");
Symbol 207 MovieClip [boss_octagon] Frame 289
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "orange_missile");
Symbol 207 MovieClip [boss_octagon] Frame 293
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "orange_missile");
Symbol 207 MovieClip [boss_octagon] Frame 297
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "orange_missile");
Symbol 207 MovieClip [boss_octagon] Frame 301
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "orange_missile");
gotoAndPlay ("random_frame");
Symbol 207 MovieClip [boss_octagon] Frame 307
armor = 10000;
Symbol 207 MovieClip [boss_octagon] Frame 356
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "pink_missile");
Symbol 207 MovieClip [boss_octagon] Frame 406
armor = 10;
gotoAndPlay ("random_frame");
Symbol 207 MovieClip [boss_octagon] Frame 407
armor = 10000;
Symbol 207 MovieClip [boss_octagon] Frame 456
h = 0;
while (h < _root.bullet_particles) {
the_movie = _parent.attachMovie("hexagon_shoot_particle_system", "particle" + _parent.particle_num, _parent.particle_num, {_x:this._x + 64, _y:this._y, _rotation:random(60) - 210});
number = random(130) + 125;
hex = number.toString(16);
myColor = ("0xFF" + hex) + "00";
myColoredObject = new Color(the_movie);
myColoredObject.setRGB(myColor);
_parent.particle_num++;
if (_parent.particle_num > 22000) {
_parent.particle_num = 20000;
}
h++;
}
_parent.place_enemy(this._x + 64, this._y, "pink_missile");
Symbol 207 MovieClip [boss_octagon] Frame 506
armor = 10;
gotoAndPlay ("random_frame");
Symbol 207 MovieClip [boss_octagon] Frame 576
gotoAndStop ("random_frame");
Symbol 232 MovieClip [fade_to_black] Frame 100
_parent.gotoAndStop("game_over_stats");
removeMovieClip(_parent.fader);
Symbol 237 MovieClip [left_to_right_block] Frame 1
var which_frame = "menu_frame";
stop();
Symbol 237 MovieClip [left_to_right_block] Frame 50
_parent.gotoAndStop(which_frame);
Symbol 239 MovieClip [menu_uncover_block] Frame 50
stop();
Symbol 241 MovieClip [fade_to_white] Frame 300
_parent.gotoAndStop("game_won_2");
Symbol 294 MovieClip [white_to_black] Frame 100
_parent.gotoAndStop("game_won_3");