Frame 1
function startinitiate() {
removeMovieClip(_root.holder.starfield);
_root.holder.createEmptyMovieClip("starfield", 0);
y = 0;
with (_root.holder.starfield) {
lineStyle(0, 16777215, 50);
while (y < ((Math.random() * 400) + 300)) {
curx = Math.random() * 800;
cury = Math.random() * 600;
moveTo(curx, cury);
lineTo(curx + 0.5, cury + 0.5);
y++;
}
}
y = 0;
while (y < initbase.length) {
_root["team" + initteam[y]].push(initbase[y]);
_root.newship(initbase[y], initteam[y], Math.random() * 800, Math.random() * 600, initface[y]);
y++;
}
if (_root.cheater.text == "omnipotence") {
_root.newship("_omni", "black", Math.random() * 800, Math.random() * 600, (Math.random() * Math.PI) * 2);
}
_root.cheater.text = "";
timeto = 0;
}
function newship(icon, team, xpos, ypos, facing) {
_root.holder.attachMovie(_root[icon][5] + "_icon", "dot" + x, x);
dots.push(_root.holder["dot" + x]);
_root.holder["dot" + x].attachMovie(_root[icon][5] + "_icon", "mask", 1);
_root.holder["dot" + x].mask._alpha = 20;
thiscolor = new Color(_root.holder["dot" + x].mask);
thiscolor.setRGB(_root[team]);
_root.holder.createEmptyMovieClip("health" + x, wf);
_root.holder["health" + x].ship = _root.holder["dot" + x];
_root.holder["health" + x].onEnterFrame = function () {
removeMovieClip(this.bar);
this.createEmptyMovieClip("bar", 0);
with (this.bar) {
lineStyle(0, 0, 0);
beginFill(16711680, 50);
moveTo(Math.sqrt(this.ship.hitpoints), 1);
lineTo(-Math.sqrt(this.ship.hitpoints), 1);
lineTo(-Math.sqrt(this.ship.hitpoints), -1);
lineTo(Math.sqrt(this.ship.hitpoints), -1);
lineTo(Math.sqrt(this.ship.hitpoints), 1);
}
this._x = this.ship._x;
this._y = this.ship._y - 20;
};
wf++;
_root.holder["dot" + x]._x = xpos;
_root.holder["dot" + x]._y = ypos;
_root.holder["dot" + x].angle = facing;
_root.holder["dot" + x]._rotation = (facing * 180) / Math.PI;
_root.holder["dot" + x].team = team;
_root.holder["dot" + x].timer = ticktock();
_root.holder["dot" + x].hitpoints = _root[icon][2];
_root.holder["dot" + x].shipclass = _root[icon][1];
_root.holder["dot" + x].rotspeed = _root[icon][4];
_root.holder["dot" + x].icon = icon;
_root.holder["dot" + x].totalweapons = _root[icon].length - 6;
tinkle = 0;
while (tinkle < _root.holder["dot" + x].totalweapons) {
_root.holder["dot" + x]["wt" + tinkle] = (Math.random() * 5) + 2;
tinkle++;
}
if (((_root[icon][1] != "fighter") && (_root[icon][1] != "bomber")) && (_root[icon][1] != "station")) {
_root.holder["dot" + x].onEnterFrame = function () {
y = 0;
while (y < this.totalweapons) {
this["wt" + this.y] = this["wt" + this.y] - 1;
this.y++;
y++;
}
if (this.timer == _root.time) {
angleroutine(this, this.shipclass);
wfy = 0;
while (wfy < this.totalweapons) {
if (this["wt" + wfy] < 0) {
_root.fireweapon(this, _root[icon][wfy + 6], wfy);
}
this["wt" + wfy]--;
wfy++;
}
this._rotation = (this.angle * 180) / Math.PI;
}
this._x = this._x + (Math.cos(this.angle) * _root[icon][3]);
this._y = this._y + (Math.sin(this.angle) * _root[icon][3]);
_root.checkxy(this);
};
} else if ((_root[icon][1] == "fighter") || (_root[icon][1] == "bomber")) {
_root.holder["dot" + x].onEnterFrame = function () {
y = 0;
while (y < this.totalweapons) {
this["wt" + this.y] = this["wt" + this.y] - 1;
this.y++;
y++;
}
if ((this == this.squad[0]) || (this.squad == undefined)) {
if (this.timer == _root.time) {
angleroutine(this, this.shipclass);
}
this.speed = _root[icon][3];
} else {
this.speed = _root[icon][3] + 2;
dis = _root.distance(this._width, this._height, 0, 0);
if (this == this.squad[1]) {
tox = _root.offset(this.squad[0], "x", dis * 4, 0);
toy = _root.offset(this.squad[0], "y", dis * 4, 0);
} else if (this == this.squad[2]) {
tox = _root.offset(this.squad[0], "x", dis * 2, -dis);
toy = _root.offset(this.squad[0], "y", dis * 2, -dis);
} else if (this == this.squad[3]) {
tox = _root.offset(this.squad[0], "x", dis * 2, dis);
toy = _root.offset(this.squad[0], "y", dis * 2, dis);
} else if (this == this.squad[4]) {
tox = _root.offset(this.squad[0], "x", 0, dis * 2);
toy = _root.offset(this.squad[0], "y", 0, dis * 2);
} else if (this == this.squad[5]) {
tox = _root.offset(this.squad[0], "x", 30, (-dis) * 2);
toy = _root.offset(this.squad[0], "y", 30, (-dis) * 2);
} else {
y = 5;
found = false;
while ((y < this.squad.length) && (found == false)) {
if (this == this.squad[y]) {
found = true;
} else {
y++;
}
}
tox = (Math.cos(this.squad[0].angle + ((Math.PI/4) * y)) * dis) * 10;
toy = (Math.cos(this.squad[0].angle + ((Math.PI/4) * y)) * dis) * 10;
}
this.targangle = _root.angle(tox, toy, this._x, this._y);
if (((((this.angle > (-3.14159265358979 + this.rotspeed)) && (this.angle < (Math.PI - this.rotspeed))) && ((this.targangle < (this.angle + this.rotspeed)) && (this.targangle > (this.angle - this.rotspeed)))) || ((this.angle > (Math.PI - this.rotspeed)) && ((this.targangle > (this.angle - this.rotspeed)) || (this.targangle < ((this.angle - (Math.PI*2)) + this.rotspeed))))) || ((this.angle < (-3.14159265358979 + this.rotspeed)) && ((this.targangle < (this.angle + this.rotspeed)) || (this.targangle > ((this.angle + (Math.PI*2)) - this.rotspeed))))) {
this.angle = this.targangle;
} else if ((((this.angle > 0) && ((this.targangle > this.angle) || (this.targangle < (this.angle - Math.PI)))) || ((this.angle < 0) && ((this.targangle > this.angle) && (this.targangle < (this.angle + Math.PI))))) || ((this.angle == 0) && (this.targangle > this.angle))) {
this.angle = this.angle + this.rotspeed;
} else {
this.angle = this.angle - this.rotspeed;
}
}
if (this.timer == _root.time) {
wfy = 0;
while (wfy < this.totalweapons) {
if (this["wt" + wfy] < 0) {
_root.fireweapon(this, _root[icon][wfy + 6], wfy);
}
this["wt" + wfy]--;
wfy++;
}
}
this._rotation = (this.angle * 180) / Math.PI;
if ((this.angle == targangle) && (_root.distance(tox, toy, this._x, this._y) < this.speed)) {
this._x = tox;
this._y = toy;
} else {
this._x = this._x + (Math.cos(this.angle) * this.speed);
this._y = this._y + (Math.sin(this.angle) * this.speed);
}
_root.checkxy(this);
};
} else if (_root[icon][1] == "station") {
_root.holder["dot" + x].onEnterFrame = function () {
y = 0;
while (y < this.totalweapons) {
this["wt" + this.y] = this["wt" + this.y] - 1;
this.y++;
y++;
}
if (this.timer == _root.time) {
this.angle = this.angle + _root[icon][4];
wfy = 0;
while (wfy < this.totalweapons) {
if (this["wt" + wfy] < 0) {
_root.fireweapon(this, _root[icon][wfy + 6], wfy);
}
this["wt" + wfy]--;
wfy++;
}
this._rotation = (this.angle * 180) / Math.PI;
}
};
}
x++;
return(_root.holder["dot" + (x - 1)]);
}
function distance(dx1, dy1, dx2, dy2) {
return(Math.sqrt(Math.pow(dx1 - dx2, 2) + Math.pow(dy1 - dy2, 2)));
}
function angle(x1, y1, x2, y2) {
xangle = 0;
xdis = _root.distance(x1, y1, x2, y2);
if (xdis != 0) {
if (y1 == y2) {
xymult = 1;
} else {
xymult = (y1 - y2) / Math.abs(y1 - y2);
}
xangle = Math.acos((x1 - x2) / xdis) * xymult;
}
return(xangle);
}
function offset(firer, xory, xpos, ypos) {
if (xory == "x") {
returnthis = (Math.cos(firer.angle + angle(xpos, ypos, 0, 0)) * distance(xpos, ypos, 0, 0)) + firer._x;
} else {
returnthis = (Math.sin(firer.angle + angle(xpos, ypos, 0, 0)) * distance(xpos, ypos, 0, 0)) + firer._y;
}
return(returnthis);
}
function ticktock() {
if (_root.ticktim == 0) {
_root.ticktim = 1;
} else {
_root.ticktim = 0;
}
return(_root.ticktim);
}
function removethis(item, explosion) {
if (item.squad) {
rty = 0;
found = false;
while ((rty < item.squad.length) && (found == false)) {
if (item.squad[rty] == item) {
item.squad.splice(rty, 1);
found = true;
}
rty++;
}
}
rty = 0;
found = false;
while ((rty < dots.length) && (found == false)) {
if (dots[rty] == item) {
dots.splice(rty, 1);
found = true;
}
rty++;
}
if (explosion != false) {
_root.holder.createEmptyMovieClip("bozo" + x, x);
_root.holder["bozo" + x]._x = item._x;
_root.holder["bozo" + x]._y = item._y;
y = 0;
with (_root.holder["bozo" + x]) {
rad = distance(0, 0, item._width, item._height);
moveTo(Math.cos((Math.PI * y) / 10) * distance(0, 0, item._width, item._height), Math.sin((Math.PI * y) / 10) * distance(0, 0, item._width, item._height));
lineStyle(0, 0, 0);
colors = [16777215, 16776960, 16711680];
alphas = [100, 70, 0];
ratios = [0, 180, 255];
matrix = {matrixType:"box", x:-rad, y:-rad, w:rad * 2, h:rad * 2, r:(Math.PI/2)};
beginGradientFill("radial", colors, alphas, ratios, matrix);
while (y <= 20) {
lineTo(Math.cos((Math.PI * y) / 10) * distance(0, 0, item._width, item._height), Math.sin((Math.PI * y) / 10) * distance(0, 0, item._width, item._height));
y++;
}
endFill();
}
_root.holder["bozo" + x].bleh = false;
_root.holder["bozo" + x].onEnterFrame = function () {
this._alpha = this._alpha - 20;
this._width = this._width - ((this._width * 1) / 4);
this._height = this._width;
if (this._alpha <= 0) {
removeMovieClip(this);
}
};
}
removeMovieClip(item);
x++;
}
function capfindtarget(targeter, preferedclass) {
y = 0;
found = false;
while (y < dots.length) {
if ((((_root.distance(targeter._x, targeter._y, dots[y]._x, dots[y]._y) < _root.distance(targeter._x, targeter._y, dots[found]._x, dots[found]._y)) || (found == false)) && (dots[y].team != targeter.team)) && ((dots[y].shipclass == preferedclass) || (preferedclass == undefined))) {
found = y;
}
y++;
}
if ((found == false) && (preferedclass != undefined)) {
found = capfindtarget(targeter, undefined);
}
return(found);
}
function turretcheckfire(team, xpos, ypos, dis) {
y = 0;
found = false;
while (y < dots.length) {
if ((((_root.distance(xpos, ypos, dots[y]._x, dots[y]._y) < dis) && (_root.distance(xpos, ypos, dots[y]._x, dots[y]._y) < _root.distance(xpos, ypos, dots[found]._x, dots[found]._y))) && (dots[y].team != team)) && (dots[y] != undefined)) {
found = dots[y];
}
y++;
}
return(found);
}
function checkfire(team, xpos, ypos, dis, angle, tol) {
found = false;
y = 0;
while ((y < dots.length) && (found == false)) {
if (dots[y].team != team) {
dist = _root.distance(xpos, ypos, dots[y]._x, dots[y]._y);
if ((dist < dis) && (dist != 0)) {
if (ypos == dots[y]._y) {
ymult = 1;
} else {
ymult = (dots[y]._y - ypos) / Math.abs(dots[y]._y - ypos);
}
angle2 = Math.acos((dots[y]._x - xpos) / dist) * ymult;
if (((((angle > (-3.14159265358979 + tol)) && (angle < (Math.PI - tol))) && ((angle2 < (angle + tol)) && (angle2 > (angle - tol)))) || ((angle > (Math.PI - tol)) && ((angle2 > (angle - tol)) || (angle2 < ((angle - (Math.PI*2)) + tol))))) || ((angle < (-3.14159265358979 + tol)) && ((angle2 < (angle + tol)) || (angle2 > ((angle + (Math.PI*2)) - tol))))) {
found = dots[y];
}
}
}
y++;
}
return(found);
}
function checkxy(thing) {
if (thing._x < 0) {
thing._x = 800;
}
if (thing._x > 800) {
thing._x = 0;
}
if (thing._y < 0) {
thing._y = 600;
}
if (thing._y > 600) {
thing._y = 0;
}
}
function angleroutine(thing, shipclass) {
if (thing.icon != "_carrier") {
if (shipclass == "bomber") {
shipclass = "frigate";
}
thing.curtarg = _root.capfindtarget(thing, shipclass);
if (_root.distance(dots[thing.curtarg]._x, dots[thing.curtarg]._y, thing._x, thing._y) > (_root[thing.icon][3] * 3)) {
thing.targangle = _root.angle(dots[thing.curtarg]._x, dots[thing.curtarg]._y, thing._x, thing._y);
if (((((thing.angle > (-3.14159265358979 + thing.rotspeed)) && (thing.angle < (Math.PI - thing.rotspeed))) && ((thing.targangle < (thing.angle + thing.rotspeed)) && (thing.targangle > (thing.angle - thing.rotspeed)))) || ((thing.angle > (Math.PI - thing.rotspeed)) && ((thing.targangle > (thing.angle - thing.rotspeed)) || (thing.targangle < ((thing.angle - (Math.PI*2)) + thing.rotspeed))))) || ((thing.angle < (-3.14159265358979 + thing.rotspeed)) && ((thing.targangle < (thing.angle + thing.rotspeed)) || (thing.targangle > ((thing.angle + (Math.PI*2)) - thing.rotspeed))))) {
thing.angle = thing.targangle;
} else if ((((thing.angle > 0) && ((thing.targangle > thing.angle) || (thing.targangle < (thing.angle - Math.PI)))) || ((thing.angle < 0) && ((thing.targangle > thing.angle) && (thing.targangle < (thing.angle + Math.PI))))) || ((thing.angle == 0) && (thing.targangle > thing.angle))) {
thing.angle = thing.angle + thing.rotspeed;
} else {
thing.angle = thing.angle - thing.rotspeed;
}
}
}
}
function guidlas(xpos, ypos, angle, dis, colored) {
_root.holder.createEmptyMovieClip("laser" + wf, wf);
_root.holder["laser" + wf]._x = xpos;
_root.holder["laser" + wf]._y = ypos;
with (_root.holder["laser" + wf]) {
lineStyle(0, colored, 20);
moveTo(0, 0);
lineTo(Math.cos(angle) * dis, Math.sin(angle) * dis);
}
_root.holder["laser" + wf].onEnterFrame = function () {
this.removeMovieClip();
};
wf++;
}
function detonate(xpos, ypos, damage) {
_root.holder.createEmptyMovieClip("bozo" + x, x);
_root.holder["bozo" + x]._x = xpos;
_root.holder["bozo" + x]._y = ypos;
y = 0;
with (_root.holder["bozo" + x]) {
moveTo(Math.cos((Math.PI * y) / 10) * damage, Math.sin((Math.PI * y) / 10) * damage);
lineStyle(0, 0, 0);
colors = [16776960, 16742144, 16711680];
alphas = [100, 70, 0];
ratios = [0, 180, 255];
matrix = {matrixType:"box", x:-damage, y:-damage, w:damage * 2, h:damage * 2, r:(Math.PI/2)};
beginGradientFill("radial", colors, alphas, ratios, matrix);
while (y <= 20) {
lineTo(Math.cos((Math.PI * y) / 10) * damage, Math.sin((Math.PI * y) / 10) * damage);
y++;
}
endFill();
}
_root.holder["bozo" + x].bleh = false;
_root.holder["bozo" + x].onEnterFrame = function () {
this._alpha = this._alpha - 20;
this._width = this._width - ((this._width * 1) / 4);
this._height = this._width;
if (this._alpha <= 0) {
removeMovieClip(this);
}
};
x++;
y = 0;
while (y < _root.dots.length) {
dis = distance(xpos, ypos, dots[y]._x, dots[y]._y);
if (dis < damage) {
dots[y].hitpoints = dots[y].hitpoints - (damage - Math.round(dis));
if (dots[y].hitpoints < 0) {
_root.removethis(dots[y]);
}
}
y++;
}
}
function fireweapon(firer, weapon, weaponnum) {
mount = weapon.mount;
changes = weapon.special;
trux = _root.offset(firer, "x", weapon.xpos, weapon.ypos);
truy = _root.offset(firer, "y", weapon.xpos, weapon.ypos);
firetype = _root[weapon.weapon].firetype;
if (changes == "none") {
damage = _root[weapon.weapon].damage;
range = _root[weapon.weapon].range;
recharge = _root[weapon.weapon].recharge;
col = _root[weapon.weapon].col;
scaled = _root[weapon.weapon].scaled;
speed = _root[weapon.weapon].speed;
recharge = _root[weapon.weapon].recharge;
ammo = _root[weapon.weapon].ammo;
ltype = _root[weapon.weapon].ltype;
delay = _root[weapon.weapon].delay;
} else {
if (changes.damage) {
damage = changes.damage;
} else {
damage = _root[weapon.weapon].damage;
}
if (changes.range) {
range = changes.range;
} else {
range = _root[weapon.weapon].range;
}
if (changes.recharge) {
recharge = changes.recharge;
} else {
recharge = _root[weapon.weapon].recharge;
}
if (changes.col) {
col = changes.col;
} else {
col = _root[weapon.weapon].col;
}
if (changes.scaled) {
scaled = changes.scaled;
} else {
scaled = _root[weapon.weapon].scaled;
}
if (changes.speed) {
speed = changes.speed;
} else {
speed = _root[weapon.weapon].speed;
}
if (changes.ammo) {
ammo = changes.ammo;
} else {
ammo = _root[weapon.weapon].ammo;
}
if (changes.ltype) {
ltype = changes.ltype;
} else {
ltype = _root[weapon.weapon].ltype;
}
if (changes.delay) {
delay = changes.delay;
} else {
delay = _root[weapon.weapon].delay;
}
}
if ((firetype == "regbeam") || (firetype == "ibeam")) {
if (mount == "turret") {
damage = damage * 0.75;
firee = turretcheckfire(firer.team, trux, truy, range);
} else {
range = range * 1.5;
firee = checkfire(firer.team, trux, truy, range, firer.angle + mount, 0.10471975511966);
}
if ((firee != false) && (firee._x != undefined)) {
_root.timeto = 50;
_root.holder.createEmptyMovieClip("beam" + wf, wf);
_root.holder["beam" + wf]._x = trux;
_root.holder["beam" + wf]._y = truy;
with (_root.holder["beam" + wf]) {
lineStyle(2, col, 50);
moveTo(0, 0);
targetx = ((firee._x - trux) + ((Math.random() * firee._width) / 2)) - (firee._width / 4);
targety = ((firee._y - truy) + ((Math.random() * firee._width) / 2)) - (firee._width / 4);
lineTo(targetx, targety);
if (firetype == "ibeam") {
moveTo(0, 0);
lineStyle(0, 16777215, 40);
dis = distance(targetx + firex, targety + firey, firex, firey);
angled = angle(targetx + firex, targety + firey, firex, firey);
y = 0;
while (y < (dis - 5)) {
neox = ((Math.cos(angled) * y) + (Math.random() * 5)) - 2.5;
neoy = ((Math.sin(angled) * y) + (Math.random() * 5)) - 2.5;
lineTo(neox, neoy);
y = y + (Math.random() * 3);
}
}
}
_root.holder["beam" + wf].onEnterFrame = function () {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
removeMovieClip(this);
}
};
wf++;
hitchance = 1 - (_root.distance(trux, truy, firee._x, firee._y) / (range * 2));
if (hitchance > Math.random()) {
firee.hitpoints = firee.hitpoints - ((damage * Math.round((Math.random() * 5) + 5)) / 10);
if (firee.hitpoints < 0) {
_root.removethis(firee);
}
}
firer["wt" + weaponnum] = recharge;
}
} else if ((firetype == "bomb") || (firetype == "missile")) {
if (firer["ammo" + weaponnum] == undefined) {
if ((ammo == undefined) || (ammo == 0)) {
firer["ammo" + weaponnum] = 10000;
} else {
firer["ammo" + weaponnum] = ammo;
}
}
if (firer["ammo" + weaponnum] > 0) {
if ((mount == "turret") || (firetype == "missile")) {
found = turretcheckfire(firer.team, offset(firer, "x", xpos, ypos), offset(firer, "y", xpos, ypos), range);
} else {
found = checkfire(firer.team, offset(firer, "x", xpos, ypos), offset(firer, "y", xpos, ypos), range, firer.angle + mount, 0.10471975511966);
}
if (found != false) {
_root.holder.createEmptyMovieClip("proj" + wf, wf);
miscfire.push(_root.holder["proj" + wf]);
_root.holder["proj" + wf].attachMovie(firetype + "_img", "icon", 0);
_root.holder["proj" + wf].icon._xscale = scaled * 100;
_root.holder["proj" + wf].icon._yscale = scaled * 100;
_root.holder["proj" + wf].timeout = 43;
_root.holder["proj" + wf]._x = trux;
_root.holder["proj" + wf]._y = truy;
_root.holder["proj" + wf].timer = ticktock();
_root.holder["proj" + wf].damage = damage;
_root.holder["proj" + wf].speed = speed;
_root.holder["proj" + wf].firer = firer;
_root.holder["proj" + wf].range = range;
_root.holder["proj" + wf].targeted = found;
_root.holder["proj" + wf]._rotation = (firer.angle * 180) / Math.PI;
_root.holder["proj" + wf].angle = angle(found._x, found._y, offset(firer, "x", xpos, ypos), offset(firer, "y", xpos, ypos));
if (firetype == "bomb") {
_root.holder["proj" + wf].onEnterFrame = function () {
if (this.timeout < 0) {
_root.detonate(this._x, this._y, this.damage);
removeMovieClip(this);
} else {
this.timeout--;
}
if (this.timer == _root.time) {
dis = distance(this._x, this._y, this.targeted._x, this.targeted._y);
dis2 = distance(this._x, this._y, this.firer._x, this.firer._y);
if ((dis < (this.damage / 2)) && (dis2 > ((this.damage * 4) / 5))) {
_root.detonate(this._x, this._y, this.damage);
removeMovieClip(this);
}
}
this._x = this._x + (Math.cos(this.angle) * this.speed);
this._y = this._y + (Math.sin(this.angle) * this.speed);
checkxy(this);
};
} else if (firetype == "missile") {
_root.holder["proj" + wf].onEnterFrame = function () {
if (this.timeout < 0) {
_root.detonate(this._x, this._y, this.damage);
removeMovieClip(this);
} else {
this.timeout--;
}
if (this.targeted._x == undefined) {
this.targeted = turretcheckfire(this.firer.team, this._x, this._y, range);
if (this.targeted == false) {
_root.detonate(this._x, this._y, this.damage);
removeMovieClip(this);
}
}
if (this.timer == _root.time) {
this.dis = _root.distance(this._x, this._y, this.targeted._x, this.targeted._y);
this.dis2 = _root.distance(this._x, this._y, this.firer._x, this.firer._y);
if ((this.dis < (this.damage / 2)) && (this.dis2 > ((this.damage * 4) / 5))) {
_root.detonate(this._x, this._y, this.damage);
removeMovieClip(this);
}
}
this.disto = _root.distance(this._x, this._y, this.targeted._x, this.targeted._y);
this.angle = _root.angle(this.targeted._x, this.targeted._y, this._x, this._y);
if (this.disto > this.speed) {
this._rotation = (this.angle * 180) / Math.PI;
this._x = this._x + (Math.cos(this.angle) * this.speed);
this._y = this._y + (Math.sin(this.angle) * this.speed);
} else {
this._x = this.targeted._x;
this._y = this.targeted._y;
_root.detonate(this._x, this._y, this.damage);
removeMovieClip(this);
}
checkxy(this);
};
}
wf++;
firer["wt" + weaponnum] = 5;
firer["ammo" + weaponnum]--;
_root.timeto = 50;
}
}
} else if (firetype == "flak") {
found = turretcheckfire(firer.team, offset(firer, "x", xpos, ypos), offset(firer, "y", xpos, ypos), range);
if (found != false) {
y = 0;
while (y < ammo) {
_root.detonate((found._x + (Math.random() * (found._width + 20))) - ((found._width / 2) + 10), (found._y + (Math.random() * (found._height + 20))) - ((found._height / 2) + 10), damage);
y++;
}
firer["wt" + weaponnum] = -1;
_root.timeto = 50;
}
} else if (firetype == "anti") {
col = Math.random * 255;
if (data2 == "turret") {
damage = damage * 0.666666666666667;
firee = turretcheckfire(firer.team, offset(firer, "x", xpos, ypos), offset(firer, "y", xpos, ypos), range);
} else {
range = range * 1.5;
firee = checkfire(firer.team, offset(firer, "x", xpos, ypos), offset(firer, "y", xpos, ypos), range, firer.angle, 0.10471975511966);
}
if ((firee != false) && (firee._x != undefined)) {
firex = offset(firer, "x", xpos, ypos);
firey = offset(firer, "y", xpos, ypos);
_root.timeto = 50;
_root.holder.createEmptyMovieClip("ion" + wf, wf);
_root.holder["ion" + wf]._x = firex;
_root.holder["ion" + wf]._y = firey;
with (_root.holder["ion" + wf]) {
lineStyle(2, col, 50);
moveTo(0, 0);
targetx = ((firee._x - firex) + ((Math.random() * firee._width) / 2)) - (firee._width / 4);
targety = ((firee._y - firey) + ((Math.random() * firee._width) / 2)) - (firee._width / 4);
lineTo(targetx, targety);
y = 0;
while (y < 5) {
col = Math.round((Math.random() * colran) + (255 - colran));
lineStyle(0, ("0x" + col.toString(16)) + "ffff", 70);
moveTo(0, 0);
curveTo(5 * Math.cos((Math.random() * 2) * Math.PI), 5 * Math.sin((Math.random() * 2) * Math.PI), targetx, targety);
y++;
}
}
_root.holder["ion" + wf].onEnterFrame = function () {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
removeMovieClip(this);
}
};
wf++;
hitchance = 1 - (_root.distance(firex, firey, firee._x, firee._y) / (range * 2));
if (hitchance > Math.random()) {
firee.hitpoints = firee.hitpoints - damage;
if (firee.hitpoints < 0) {
_root.removethis(firee);
}
}
firer["wt" + weaponnum] = recharge;
}
} else if (firetype == "hanger") {
if (firer["waves" + weaponnum] == undefined) {
firer["waves" + weaponnum] = 1;
}
if ((firer["ammo" + weaponnum] == 0) || (firer["ammo" + weaponnum] == undefined)) {
firer["ammo" + weaponnum] = ammo;
firer["cursqaud" + weaponnum] = _root.squadnum;
_root["squad" + _root.squadnum] = new Array();
_root.squadnum++;
}
if (Math.abs(firer["wt" + weaponnum]) > delay) {
ship = newship(ltype, firer.team, trux, truy, firer.angle + mount);
_root["squad" + firer["cursqaud" + weaponnum]].push(ship);
ship.squad = _root["squad" + firer["cursqaud" + weaponnum]];
firer["wt" + weaponnum] = 0;
firer["ammo" + weaponnum]--;
}
if (firer["ammo" + weaponnum] <= 0) {
firer["wt" + weaponnum] = recharge * firer["waves" + weaponnum];
firer["waves" + weaponnum]++;
}
}
}
function inittest() {
y = 1;
isfinished = true;
while ((y < dots.length) && (isfinished == true)) {
if (dots[y].team == dots[y - 1].team) {
y++;
} else {
isfinished = false;
}
}
if (isfinished == true) {
initrestart();
}
}
function initrestart() {
while (dots.length > 0) {
removethis(dots[0], false);
}
while (miscfire.length > 0) {
removeMovieClip(miscfire[0]);
miscfire.splice(0, 1);
}
dots = new Array();
miscfire = new Array();
_root.attachMovie("menuplus", "menu", 1);
initbase = new Array();
initteam = new Array();
initface = new Array();
teampurple = new Array();
teamblue = new Array();
teamgreen = new Array();
teamyellow = new Array();
teamred = new Array();
teamblack = new Array();
timeto = 5000000 /* 0x4C4B40 */;
}
function shiphelper() {
attachMovie("shipbuilderhelper", "helper", 100000);
_root.helper.onEnterFrame = function () {
if (Key.isDown(13)) {
removeMovieClip(_root.helper.icongraph);
_root.helper.attachMovie(_root.helper.imgname.text, "icongraph", 0);
_root.helper.icongraph._x = 100;
_root.helper.icongraph._y = 50;
_root.helper.icongraph.onRelease = function () {
trace(((((((((("{weapon:" + _root.helper.wtype.text) + ",mount:") + _root.helper.wd1.text) + ",xpos:") + _root.helper.icongraph._xmouse) + ",ypos:") + _root.helper.icongraph._ymouse) + ",special:") + _root.helper.wd2.text) + "}");
};
}
};
}
x = 1;
_root.createEmptyMovieClip("holder", 0);
_root.holder._xscale = 100;
_root.holder._yscale = _root.holder._xscale;
dots = new Array();
miscfire = new Array();
squadnum = 0;
time = 0;
wf = 100000 /* 0x0186A0 */;
timeto = 500000 /* 0x07A120 */;
purple = "0xff00ff";
teampurple = new Array();
blue = "0x0000ff";
teamblue = new Array();
green = "0x00ff00";
teamgreen = new Array();
yellow = "0xffff00";
teamyellow = new Array();
red = "0xff0000";
teamred = new Array();
black = "0x000000";
teamblack = new Array();
_root.onEnterFrame = function () {
if (time == 0) {
time = 1;
} else {
time = 0;
}
if (timeto < 0) {
timeto = 50;
inittest();
} else {
timeto--;
}
if (Key.isDown(9)) {
initrestart();
}
if (baseship._x != undefined) {
_root.holder._x = (((-baseship._x) * _root.holder._xscale) / 100) + 400;
_root.holder._y = (((-baseship._y) * _root.holder._yscale) / 100) + 300;
}
};
_root.attachMovie("menuplus", "menu", 1);
initbase = new Array();
initteam = new Array();
initface = new Array();
shiptypes = new Array("_drone", "_interceptor", "_hellspawn", "heavy_fighter", "_bomber", "heavy_bomber", "light_frigate", "heavy_frigate", "light_cruiser", "drone_frigate", "hunter_killer", "_destroyer", "heavy_cruiser", "_dreadnought", "_carrier", "_station");
_drone = new Array("_drone", "fighter", 5, 19, 0.392699081698724, "light_fighter", {weapon:"medium_laser", mount:0, xpos:0, ypos:0, special:{recharge:-1}});
_interceptor = new Array("Interceptor", "fighter", 10, 15, 0.314159265358979, "_interceptor", {weapon:"light_laser", mount:0, xpos:0, ypos:1, special:"none"}, {weapon:"light_laser", mount:0, xpos:0, ypos:-1, special:"none"}, {weapon:"light_missile", mount:0, xpos:0, ypos:0, special:{ammo:4, speed:20}});
heavy_fighter = new Array("Heavy Fighter", "fighter", 15, 10, 0.314159265358979, "heavy_fighter", {weapon:"light_laser", mount:0, xpos:0, ypos:1, special:{damage:2}}, {weapon:"light_laser", mount:0, xpos:0, ypos:-1, special:{damage:2}}, {weapon:"light_missile", mount:0, xpos:0, ypos:1, special:{ammo:4, speed:20}}, {weapon:"light_missile", mount:0, xpos:0, ypos:0, special:{ammo:4, speed:20}});
_hellspawn = new Array("Hellspawn", "fighter", 20, 10, 0.349065850398866, "_hellspawn", {weapon:"light_laser", mount:0, xpos:2, ypos:-3, special:"none"}, {weapon:"light_laser", mount:0, xpos:2, ypos:3, special:"none"}, {weapon:"light_missile", mount:0, xpos:-1, ypos:-2, special:"none"}, {weapon:"light_missile", mount:0, xpos:-1, ypos:2, special:"none"});
_bomber = new Array("Bomber", "bomber", 40, 7, 0.20943951023932, "_bomber", {weapon:"light_laser", mount:"turret", xpos:0, ypos:0, special:"none"}, {weapon:"light_bomb", mount:0, xpos:4, ypos:2, special:{range:400, speed:15}}, {weapon:"light_bomb", mount:0, xpos:4, ypos:-2, special:{range:400, speed:15}});
heavy_bomber = new Array("Heavy Bomber", "bomber", 60, 5, 0.20943951023932, "heavy_bomber", {weapon:"light_laser", mount:"turret", xpos:0, ypos:0, special:{damage:3}}, {weapon:"medium_bomb", mount:0, xpos:4, ypos:2, special:{range:400, speed:15}}, {weapon:"medium_bomb", mount:0, xpos:4, ypos:-2, special:{range:400, speed:15}});
light_frigate = new Array("Light Frigate", "frigate", 120, 3, 0.10471975511966, "light_frigate", {weapon:"medium_missile", mount:0, xpos:0, ypos:5, special:"none"}, {weapon:"medium_missile", mount:0, xpos:0, ypos:-5, special:"none"}, {weapon:"light_flak", mount:0, xpos:0, ypos:6, special:"none"}, {weapon:"light_flak", mount:0, xpos:0, ypos:-6, special:"none"}, {weapon:"light_laser", mount:"turret", xpos:5, ypos:6, special:"none"}, {weapon:"light_laser", mount:"turret", xpos:5, ypos:-6, special:"none"});
heavy_frigate = new Array("Heavy Frigate", "frigate", 150, 1.5, 0.0628318530717959, "heavy_frigate", {weapon:"heavy_ion_cannon", mount:0, xpos:13, ypos:0, special:"none"}, {weapon:"medium_laser", mount:"turret", xpos:-7, ypos:0, special:"none"}, {weapon:"light_laser", mount:0, xpos:-10.5, ypos:3, special:"none"}, {weapon:"light_laser", mount:0, xpos:-10.5, ypos:-3, special:"none"});
_carrier = new Array("Carrier", "frigate", 300, 0.6, 0.0523598775598299, "_carrier", {weapon:"medium_flak", mount:0, xpos:-3.5, ypos:10.5, special:"none"}, {weapon:"medium_flak", mount:0, xpos:-3.5, ypos:-10.5, special:"none"}, {weapon:"interceptor_wing", mount:0, xpos:24.6, ypos:7.3, special:"none"}, {weapon:"heavy_fighter_wing", mount:0, xpos:24.6, ypos:-7.3, special:"none"}, {weapon:"_bomber_wing", mount:0, xpos:24.6, ypos:-7.3, special:"none"});
light_cruiser = new Array("Light Cruise", "frigate", 350, 0.5, 0.0523598775598299, "light_cruiser", {weapon:"light_ion_cannon", mount:"turret", xpos:10, ypos:6, special:"none"}, {weapon:"light_ion_cannon", mount:"turret", xpos:4, ypos:7, special:"none"}, {weapon:"light_ion_cannon", mount:"turret", xpos:-7, ypos:5, special:"none"}, {weapon:"light_ion_cannon", mount:"turret", xpos:10, ypos:-6, special:"none"}, {weapon:"light_ion_cannon", mount:"turret", xpos:4, ypos:-7, special:"none"}, {weapon:"light_ion_cannon", mount:"turret", xpos:-7, ypos:-5, special:"none"});
drone_frigate = new Array("Drone Frigate", "frigate", 200, 1, 0.0628318530717959, "flak_frigate", {weapon:"medium_flak", mount:0, xpos:-3.5, ypos:10.5, special:"none"}, {weapon:"medium_flak", mount:0, xpos:-3.5, ypos:10.5, special:"none"}, {weapon:"_drone_wing", mount:0, xpos:0, ypos:10, special:"none"});
hunter_killer = new Array("Hunter Killer", "frigate", 200, 1.5, 0.10471975511966, "hunter_killer", {weapon:"medium_ion_cannon", mount:0, xpos:3.5, ypos:8.2, special:{recharge:60}}, {weapon:"medium_ion_cannon", mount:"turret", xpos:0, ypos:0, special:"none"}, {weapon:"medium_ion_cannon", mount:0, xpos:3.5, ypos:-8.2, special:{recharge:60}}, {weapon:"light_laser", mount:"turret", xpos:3, ypos:0, special:{damage:3}}, {weapon:"light_laser", mount:"turret", xpos:-3, ypos:0, special:{damage:3}}, {weapon:"medium_flak", mount:0, xpos:5, ypos:0, special:"none"});
_destroyer = new Array("Destroyer", "frigate", 450, 0.7, 0.0628318530717959, "_destroyer", {weapon:"medium_ion_cannon", mount:"turret", xpos:7, ypos:0, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:0, ypos:0, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:-7, ypos:0, special:"none"}, {weapon:"light_laser", mount:"turret", xpos:3, ypos:7.5, special:{damage:3}}, {weapon:"light_laser", mount:"turret", xpos:3, ypos:-7.5, special:{damage:3}}, {weapon:"interceptor_wing", mount:0, xpos:0, ypos:10, special:{ammo:3}}, {weapon:"medium_flak", mount:0, xpos:0, ypos:5, special:"none"}, {weapon:"medium_flak", mount:0, xpos:0, ypos:-5, special:"none"});
heavy_cruiser = new Array("Heavy Cruiser", "frigate", 600, 0.5, (Math.PI/90), "heavy_cruiser", {weapon:"heavy_ion_cannon", mount:"turret", xpos:-15, ypos:0, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:0, ypos:0, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:15, ypos:0, special:"none"}, {weapon:"heavy_bomb", mount:"turret", xpos:-28, ypos:3.5, special:"none"}, {weapon:"heavy_bomb", mount:"turret", xpos:-28, ypos:-3.5, special:"none"}, {weapon:"light_ion_cannon", mount:"turret", xpos:-7.5, ypos:-5.5, special:"none"}, {weapon:"light_ion_cannon", mount:"turret", xpos:-7.5, ypos:5.5, special:"none"}, {weapon:"heavy_flak", mount:"turret", xpos:7.5, ypos:3, special:"none"}, {weapon:"heavy_flak", mount:"turret", xpos:7.5, ypos:-3, special:"none"});
_omni = new Array("Omnipotence", "frigate", 4000, 3, (Math.PI/90), "_omni", {weapon:"light_ion_cannon", mount:"turret", xpos:0, ypos:0, special:{damage:1000, range:500, col:"0xffffff", recharge:-1}});
_dreadnought = new Array("Dreadnought", "frigate", 800, 0.3, 0.00872664625997165, "_dreadnought", {weapon:"antimatter_cannon", mount:0, xpos:12, ypos:8.5, special:"none"}, {weapon:"antimatter_cannon", mount:0, xpos:12, ypos:8.5, special:"none"}, {weapon:"antimatter_cannon", mount:0, xpos:12, ypos:-8.5, special:"none"}, {weapon:"medium_ion_cannon", mount:0, xpos:28.5, ypos:16.5, special:"none"}, {weapon:"medium_ion_cannon", mount:0, xpos:28.5, ypos:-16.5, special:"none"}, {weapon:"heavy_ion_cannon", mount:0, xpos:-8.5, ypos:14.5, special:"none"}, {weapon:"heavy_ion_cannon", mount:0, xpos:-8.5, ypos:-14.5, special:"none"}, {weapon:"heavy_ion_cannon", mount:0, xpos:16, ypos:19.5, special:"none"}, {weapon:"heavy_ion_cannon", mount:0, xpos:16, ypos:-19.5, special:"none"}, {weapon:"medium_ion_cannon", mount:0, xpos:1.5, ypos:18.5, special:"none"}, {weapon:"medium_ion_cannon", mount:0, xpos:1.5, ypos:-18.5, special:"none"}, {weapon:"heavy_bomb", mount:0, xpos:3.5, ypos:13, special:"none"}, {weapon:"heavy_bomb", mount:0, xpos:3.5, ypos:13, special:"none"}, {weapon:"heavy_flak", mount:0, xpos:-18, ypos:9, special:{ammo:5}}, {weapon:"heavy_flak", mount:0, xpos:-18, ypos:-9, special:{ammo:5}});
_station = new Array("Station", "station", 1000, 0, 0.00872664625997165, "_station", {weapon:"medium_ion_cannon", mount:"turret", xpos:9, ypos:-39, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:29, ypos:-27, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:39, ypos:-10, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:38, ypos:10, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:28, ypos:28, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:9, ypos:38, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:-10, ypos:39, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:-28, ypos:29, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:-39, ypos:12, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:-39, ypos:-11, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:-28, ypos:-27, special:"none"}, {weapon:"medium_ion_cannon", mount:"turret", xpos:-12, ypos:-37, special:"none"}, {weapon:"_hellspawn_wing", mount:0, xpos:0, ypos:0, special:{ammo:4}});
_shipyard = new Array("Shipyard", "frigate", 800, 0.1, 0.00436332312998582, "_shipyard", {weapon:"light_flak", mount:0, xpos:52, ypos:21, special:"none"}, {weapon:"light_flak", mount:0, xpos:-24, ypos:21, special:"none"}, {weapon:"light_flak", mount:0, xpos:-3, ypos:-6, special:"none"}, {weapon:"light_flak", mount:0, xpos:36, ypos:-7, special:"none"}, {weapon:"light_ion_cannon", mount:0, xpos:34, ypos:-22, special:{range:200}}, {weapon:"light_ion_cannon", mount:0, xpos:-28, ypos:6, special:{range:200}}, {weapon:"light_ion_cannon", mount:0, xpos:-56, ypos:7, special:{range:200}});
light_laser = {firetype:"regbeam", damage:1.5, recharge:-1, range:100, col:"0xbb0000"};
medium_laser = {firetype:"regbeam", damage:7.5, recharge:5, range:150, col:"0xbbbb00"};
heavy_laser = {firetype:"regbeam", damage:15, recharge:10, range:400, col:"0x00bb00"};
light_ion_cannon = {firetype:"ibeam", damage:15, range:200, recharge:10, col:"0x00bbbb"};
medium_ion_cannon = {firetype:"ibeam", damage:75, range:300, recharge:35, col:"0x0000bb"};
heavy_ion_cannon = {firetype:"ibeam", damage:150, range:400, recharge:60, col:"0xff00ff"};
light_bomb = {firetype:"bomb", damage:30, scaled:1, recharge:10, speed:7, range:200};
medium_bomb = {firetype:"bomb", damage:50, scaled:1.5, recharge:10, speed:7, range:200};
heavy_bomb = {firetype:"bomb", damage:70, scaled:3, recharge:10, speed:7, range:200};
light_missile = {firetype:"missile", damage:5, scaled:1, recharge:5, speed:15, range:200, ammo:0};
medium_missile = {firetype:"missile", damage:10, scaled:1.5, recharge:9, speed:10, range:200, ammo:0};
heavy_missile = {firetype:"missile", damage:20, scaled:3, recharge:15, speed:7, range:200, ammo:0};
light_flak = {firetype:"flak", damage:5, ammo:2, range:100};
medium_flak = {firetype:"flak", damage:10, ammo:2, range:100};
heavy_flak = {firetype:"flak", damage:15, ammo:2, range:200};
antimatter_cannon = {firetype:"anti", damage:400, range:400, recharge:100};
interceptor_wing = {firetype:"hanger", delay:2, ltype:"_interceptor", ammo:6, recharge:60};
heavy_fighter_wing = {firetype:"hanger", delay:2, ltype:"heavy_fighter", ammo:4, recharge:80};
_bomber_wing = {firetype:"hanger", delay:2, ltype:"_bomber", ammo:2, recharge:100};
heavy_bomber_wing = {firetype:"hanger", delay:2, ltype:"heavy_bomber", ammo:2, recharge:120};
_drone_wing = {firetype:"hanger", delay:1, ltype:"_drone", ammo:10, recharge:60};
_hellspawn_wing = {firetype:"hanger", delay:2, ltype:"_hellspawn", ammo:3, recharge:100};
Symbol 19 MovieClip [menuplus] Frame 1
function clearcur() {
y = 0;
while (y < descs.length) {
removeMovieClip(descs[y]);
y++;
}
descs.splice(0, descs.length);
_root.initbase = new Array();
_root.initteam = new Array();
_root.initface = new Array();
descs = new Array();
}
function newbutton(shiptyp, colnum) {
this.createEmptyMovieClip("button" + x, x);
thisbut = this["button" + x];
thisbut.shiptyp = shiptyp;
thisbut.team = team;
thisbut.attachMovie("buttonbase", "base", 0);
thisbut.base._height = 50;
thisbut.base._alpha = 50;
thisbut.attachMovie("buttonmask", "mask", 1);
thisbut.mask._height = 50;
thisbut.mask._alpha = 50;
this["coler" + colnum] = new Color(thisbut.mask);
this["coler" + colnum].setRGB(_root[col]);
thisbut.attachMovie("textbox", "textbox", 3);
thisbut.textbox._y = 7;
thisbut.textbox._textbox.text = _root[shiptyp][0];
thisbut.attachMovie(_root[shiptyp][5] + "_icon", "icon", 2);
if (thisbut.icon._width > thisbut.icon._height) {
scale = 50 / thisbut.icon._width;
} else {
scale = 50 / thisbut.icon._height;
}
thisbut.icon._xscale = scale * 100;
thisbut.icon._yscale = scale * 100;
thisbut.icon._x = 0;
thisbut.icon._y = -10;
x++;
thisbut.onRollOver = function () {
this._parent.infoscrn.resetships(this.shiptyp);
timeout = 100;
};
thisbut.onRelease = function () {
timeout = 100;
_root.initbase.push(this.shiptyp);
_root.initteam.push(this._parent.col);
_root.initface.push((Math.random() * Math.PI) * 2);
adddesc(_root[shiptyp][0]);
};
return(thisbut);
}
function adddesc(tit) {
this.attachMovie("textbox", "text" + x, x);
thisthing = this["text" + x];
thiscolor = new Color(thisthing);
thiscolor.setRGB(_root[col]);
thisthing._x = 750;
thisthing._y = (descs.length * 20) + 10;
thisthing._textbox.text = tit;
descs.push(thisthing);
x++;
}
function newteambutton(team) {
this.createEmptyMovieClip("button" + x, x);
thisbut = this["button" + x];
thisbut.team = team;
thisbut.attachMovie("buttonbase", "base", 0);
thisbut.base._height = 50;
thisbut.base._alpha = 50;
thisbut.attachMovie("buttonmask", "mask", 1);
thisbut.mask._height = 50;
thisbut.mask._alpha = 50;
thisbut.colored = new Color(thisbut.mask);
thisbut.colored.setRGB(_root[team]);
thisbut.attachMovie("textbox", "textbox", 3);
thisbut.textbox._y = 7;
thisbut.textbox._textbox.text = team;
x++;
thisbut.onRelease = function () {
timeout = 100;
col = this.team;
y = 0;
this._parent.infoscrn.newcol(this.team);
while (y < shiptypes.length) {
this._parent["coler" + y].setRGB(_root[this.team]);
y++;
}
};
return(thisbut);
}
shiptypes = _root.shiptypes;
teams = new Array("red", "yellow", "green", "blue", "purple");
descs = new Array();
col = "purple";
truetrue = 0;
timeout = 100;
this.onEnterFrame = function () {
if (timeout > 0) {
} else {
teehee = 0;
while (teehee < Math.floor(Math.random() * 10)) {
_root.initbase.push(shiptypes[Math.floor(Math.random() * shiptypes.length)]);
_root.initteam.push(teams[Math.floor(Math.random() * teams.length)]);
_root.initface.push((Math.random() * Math.PI) * 2);
teehee++;
}
_root.startinitiate();
removeMovieClip(this);
}
};
x = 1;
y = 0;
while (y < teams.length) {
currbut = this.newteambutton(teams[y]);
currbut._x = 60;
currbut._y = (y * 60) + 75;
y++;
}
y = 0;
truetrue = 0;
thinger = 0;
while (y < shiptypes.length) {
currbut = this.newbutton(shiptypes[y], y);
currbut._x = (truetrue * 110) + 200;
currbut._y = (thinger * 60) + 75;
thinger++;
if (thinger > 7) {
truetrue++;
thinger = 0;
}
y++;
}
this.createEmptyMovieClip("button" + x, x);
donebutton = this["button" + x];
donebutton.attachMovie("buttonbase", "base", 0);
donebutton.base._height = 50;
donebutton.base._alpha = 50;
donebutton._x = 750;
donebutton._y = 575;
donebutton.attachMovie("textbox", "textbox", 3);
donebuttontexcol = new Color(donebutton.textbox);
donebuttontexcol.setRGB(16711680);
donebutton.textbox._y = 0;
donebutton.textbox._textbox.text = "DONE";
donebutton.onRelease = function () {
_root.startinitiate();
removeMovieClip(this._parent);
};
x++;
this.createEmptyMovieClip("button" + x, x);
clearbutton = this["button" + x];
clearbutton.attachMovie("buttonbase", "base", 0);
clearbutton.base._height = 50;
clearbutton.base._alpha = 50;
clearbutton._x = 640;
clearbutton._y = 575;
clearbutton.attachMovie("textbox", "textbox", 3);
clearbuttontexcol = new Color(clearbutton.textbox);
clearbuttontexcol.setRGB(16711680);
clearbutton.textbox._y = 0;
clearbutton.textbox._textbox.text = "CLEAR";
clearbutton.onRelease = function () {
timeout = 100;
clearcur();
};
x++;
this.attachMovie("shipinfo", "infoscrn", x);
this.infoscrn._x = 500;
this.infoscrn._y = 100;
x++;
Symbol 64 MovieClip [shipinfo] Frame 1
function resetships(newship, title) {
this.w0num.text = "";
this.w0des.text = "";
this.w1num.text = "";
this.w1des.text = "";
this.w2num.text = "";
this.w2des.text = "";
this.w3num.text = "";
this.w3des.text = "";
this.w4num.text = "";
this.w4des.text = "";
this.w5num.text = "";
this.w5des.text = "";
this.shipdes.text = this[newship];
removeMovieClip("shipicon.ship");
shipicon.attachMovie(_root[newship][5] + "_icon", "ship", 0);
this.shiptitle.text = title;
this.speed.text = _root[newship][3] * 10;
this.hitpoints.text = _root[newship][2];
tfirepower = 0;
totalweapons = _root[newship].length - 6;
thisnum = 0;
i = 0;
while (i < 20) {
this["weapontype" + i] = "";
i++;
}
y = 0;
while (y < totalweapons) {
_root[newship][6 + y].weapon;
found = false;
i = 0;
while (i < thisnum) {
if (this["weapontype" + i] == _root[newship][6 + y].weapon) {
found = true;
this["weaponnums" + i] = this["weaponnums" + i] + 1;
}
i++;
}
if (found == false) {
this["weapontype" + thisnum] = _root[newship][6 + y].weapon;
this["weaponnums" + thisnum] = 1;
thisnum++;
}
y++;
}
i = 0;
while (i < thisnum) {
type0 = this["weapontype" + i].split("_");
wtype = type0.join(" ");
if (this["weaponnums" + i] == 1) {
this[("w" + i) + "num"].text = this["weaponnums" + i];
this[("w" + i) + "des"].text = wtype;
} else {
this[("w" + i) + "num"].text = this["weaponnums" + i];
this[("w" + i) + "des"].text = wtype + "s";
}
i++;
}
}
function newcol(newcoler) {
backcol.setRGB(_root[newcoler]);
}
backcol = new Color(this.infoback);
backcol.setRGB(16711935);
createEmptyMovieClip("shipicon", 1);
this.shipicon._x = 100;
this.shipicon._y = 50;
light_fighter = "a light fighter, usefull for harassing enemy fighters";
heavy_fighter = "a heavy fighter, usefull for harassing enemy fighters and bombers";
_bomber = "standard bomber, useful in anticapital ship roles, when no capital ships are available";
heavy_bomber = "heavier than the standard bomber, even more useful in anticapital ship roles";
light_frigate = "lightest capital ship, mainly used to take out enemy fighters and bombers";
heavy_frigate = "first ship designed to take on other capital ships, best used in large numbers";
light_cruiser = "light cruiser, designed to tear apart enemy bombers, and peck away at capital ships";
_destroyer = "premier vessel in any armada . . . able to take out enemy capital ships with ease";
heavy_cruiser = "heavy ship best used in anti-capital roles";
_carrier = "a haven for fighters and bombers, launches waves of two heavy and light fighter wings and one bomber wings as frequently as it can";
_dreadnought = "incredibly powerful ship capable of destroying entire fleets single handedly";
_drone = "unmanned, AI controlled drone fighter";
_interceptor = "Basic manned fighter";
_hellspawn = "Superior heavy fighter";
drone_frigate = "Frigate carrying two wings of Drones";
hunter_killer = "Most of the power of a destroyer in the hull of a frigate.";
this.onEnterFrame = function () {
this.shipicon._rotation = this.shipicon._rotation + 5;
};