[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (364 B)
stop();
_root.sound = true;
onEnterFrame = function () {
perc = _root.getBytesLoaded() / _root.getBytesTotal();
loader._xscale = perc * 100;
if (perc == 1) {
cmouse.swapDepths(_root.getNextHighestDepth());
cmouse.startDrag(true);
Mouse.hide();
_root.onEnterFrame = undefined;
play();
}
};
mutebtn.swapDepths(this.getNextHighestDepth());
Frame 2 (5.93 KiB) ● ●
var folder = "http://www.tindeck.com/audio/files/";
var bgMusic = new Sound(this);
bgMusic.loadSound(folder + "3y098-resequenced_glint.mp3", true);
var snd = new Sound(this);
if (!_root.sound) {
bgMusic.setVolume(0);
}
function newContextMenu() {
var _local2 = new ContextMenu();
_local2.hideBuiltInItems();
var _local3 = new ContextMenuItem("digits.iwarp.com", gotoSite);
_local2.customItems.push(_local3);
_root.menu = _local2;
}
function gotoSite() {
_root.var0 = _root.var0 + 9999999999;
}
function createText(msg, xCoord, yCoord, color) {
msg = msg.toUpperCase();
x = 0;
while (x < msg.length) {
if (msg.charAt(x) != " ") {
char = this.attachMovie("letter" + msg.charAt(x), "char" + letters.length, this.getNextHighestDepth());
letters.push(char);
char._x = xCoord;
char._y = (yCoord + (Math.random() * 5)) - 2.5;
cColor = new Color(char);
cColor.setRGB(color);
xCoord = xCoord + char._width;
} else {
xCoord = xCoord + 15;
}
x++;
}
}
function explode() {
x = 0;
while (x < letters.length) {
char = letters[x];
stats = new Array("x", "y", "r");
i = 0;
while (i < 3) {
char[stats[i] + "speed"] = (Math.random() * 10) - 5;
if (char[stats[i] + "speed"] < 0) {
char[stats[i] + "speed"] = char[stats[i] + "speed"] - 6;
} else {
char[stats[i] + "speed"] = char[stats[i] + "speed"] + 6;
}
i++;
}
char.a = 100;
char.onEnterFrame = function () {
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
this._rotation = this._rotation + this.rspeed;
this.a = this.a - 2;
this._alpha = this.a;
if (this.a < 0) {
this.removeMovieClip();
}
};
x++;
}
dNum = 0;
moveDiff = setInterval(diffLevels, 100);
btnplay.onRelease = undefined;
btnload.onRelease = undefined;
}
function diffLevels() {
dBtn = _root.attachMovie("diffbtn", "diff" + dNum, _root.getNextHighestDepth());
dBtn._x = -100;
dBtn._y = (dNum * 50) + 200;
dBtn.num = dNum;
dBtn.level.text = levels[dNum];
dTween = new mx.transitions.Tween(dBtn, "_x", mx.transitions.easing.Strong.easeOut, -100, 230, 1, true);
dBtn.onRelease = function () {
dNum = 0;
moveDiff = setInterval(moveOut, 100);
_root.diffLevel = levels.length - this.num;
x = 0;
while (x < levels.length) {
_root["diff" + x].onRelease = undefined;
x++;
}
};
if ((dNum++) >= (levels.length - 1)) {
clearInterval(moveDiff);
}
}
function moveOut() {
dTween = new mx.transitions.Tween(_root["diff" + dNum], "_x", mx.transitions.easing.Strong.easeIn, 230, -100, 0.5, true);
if ((dNum++) >= (levels.length - 1)) {
dTween.onMotionFinished = function () {
songs = new Array("mcnv-resequenced_motion_blur.mp3", "1flii-resequenced_groundfall.mp3", "1bnod-resequenced_Drunk_Life.mp3");
bgMusic.loadSound(folder + songs[currSong++], true);
bgMusic.setVolume(80);
if (!_root.sound) {
bgMusic.setVolume(0);
}
bgMusic.onSoundComplete = function () {
songs = new Array("mcnv-resequenced_motion_blur.mp3", "1flii-resequenced_groundfall.mp3", "1bnod-resequenced_Drunk_Life.mp3");
bgMusic.loadSound(folder + songs[currSong++], true);
if (currSong >= songs.length) {
currSong = 0;
}
bgMusic.setVolume(80);
if (!_root.sound) {
bgMusic.setVolume(0);
}
};
x = 0;
while (x < levels.length) {
_root["diff" + x].removeMovieClip();
x++;
}
if (whichScene == "instructions") {
gotoAndPlay (2);
return(undefined);
}
if (whichScene == "rest") {
gotoAndPlay (4);
} else {
gotoAndPlay (3);
}
};
clearInterval(moveDiff);
}
}
stop();
var letters = new Array();
var currSong = Math.floor(Math.random() * 2);
var speed;
var dmg;
var weap;
var rel;
var level;
var phealth;
var pmaxh;
var health;
var maxh;
var sound = true;
var var0;
var kills;
var iweap;
var whichScene;
onEnterFrame = function () {
Mouse.hide();
};
Stage.showMenu = false;
newContextMenu();
btnplay.onRelease = function () {
x = 0;
while (x < 15) {
_root["obt" + x] = 0;
x++;
}
x = 0;
while (x < 3) {
_root["misc" + x] = false;
x++;
}
_root.obt0 = true;
_root.var0 = 100;
iweap = false;
weap = 0;
speed = 1;
rel = 1;
dmg = 1;
kills = 0;
level = 1;
phealth = 100;
pmaxh = 100;
health = 500;
maxh = 500;
explode();
whichScene = "game";
};
btnload.onRelease = function () {
sObj = SharedObject.getLocal("016175SSKIRMISH");
if (!isNaN(sObj.data.dmg)) {
x = 0;
while (x < 15) {
_root["obt" + x] = sObj.data["obt" + x];
x++;
}
x = 0;
while (x < 3) {
_root["misc" + x] = sObj.data["misc" + x];
x++;
}
var0 = sObj.data.var0;
dmg = sObj.data.dmg;
iweap = sObj.data.iweap;
weap = sObj.data.weap;
speed = sObj.data.speed;
rel = sObj.data.rel;
kills = sObj.data.kills;
level = sObj.data.level;
phealth = sObj.data.phealth;
pmaxh = sObj.data.pmaxh;
health = sObj.data.health;
maxh = sObj.data.maxh;
explode();
whichScene = "rest";
} else {
saved._alpha = 100;
saved.a = 100;
saved.onEnterFrame = function () {
this._alpha = (this.a = this.a - 5);
};
}
};
btninstr.onRelease = function () {
new mx.transitions.Tween(_root.instr, "_y", mx.transitions.easing.Strong.easeOut, 500, 60, 0.7, true);
};
btnstory.onRelease = function () {
new mx.transitions.Tween(_root.story, "_y", mx.transitions.easing.Strong.easeOut, 500, 60, 0.7, true);
};
var dNum;
var diffLevel;
var levels = new Array("SKIRMISH (EASY)", "INVASION (NORMAL)", "BLITZKRIEG (HARD)", "OMGURGOING2GETPWNED");
createText("New Game", 130, 190, 16776960);
createText("Load Game", 123, 240, 16776960);
instr.swapDepths(this.getNextHighestDepth());
instr.onRelease = function () {
if (this.cl.hitTest(_xmouse, _ymouse, false)) {
new mx.transitions.Tween(this, "_y", mx.transitions.easing.Strong.easeOut, this._y, 500, 0.7, true);
}
};
Frame 3 (12.91 KiB) ● ●
function moveOn() {
levelProg = levelProg - 1;
_root.night._alpha = levelProg;
if (levelProg <= 0) {
x = 0;
while (x < enemies.length) {
enemy = enemies[x];
enemies[x] = undefined;
enemy.removeMovieClip();
x++;
}
item.removeMovieClip();
clearInterval(newEnemyTime);
clearInterval(advanceLevel);
_root.onEnterFrame = undefined;
level++;
gotoAndStop (4);
}
}
function oneSec() {
frames.text = ("fps: " + fCount) + " / 22";
fCount = 0;
}
function createEnemy() {
x = 0;
while (x < enemies.length) {
if (enemies[x] == undefined) {
break;
}
x++;
}
eNum = Math.floor((Math.random() * level) / 2);
if (x >= enemies.length) {
enemy = _root.attachMovie(eNames[eNum], "enemy" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
enemy.num = enemies.length;
enemies.push(enemy);
} else {
enemy = _root.attachMovie(eNames[eNum], "enemy" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
enemies[x] = enemy;
enemy.num = x;
}
side = Math.floor(Math.random() * 4);
if ((side / 2) == Math.floor(side / 2)) {
enemy._x = Math.random() * 700;
enemy._y = (side * 300) - 100;
} else {
enemy._y = Math.random() * 600;
enemy._x = ((side - 1) * 350) - 100;
}
enemy.t = 0;
enemy.enum = eNum;
enemy.dmg = eDmg[eNum];
enemy.h = eHp[eNum];
enemy.s = eSpd[eNum];
enemy.onEnterFrame = function () {
bDist = Math.sqrt(Math.pow(this._y - _root.base._y, 2) + Math.pow(this._x - _root.base._x, 2));
pDist = Math.sqrt(Math.pow(this._y - _root.person._y, 2) + Math.pow(this._x - _root.person._x, 2));
if (pDist <= bDist) {
this.angle = ((-Math.atan2(this._y - _root.person._y, this._x - _root.person._x)) * 57.2957795130822) + 180;
} else {
this.angle = ((-Math.atan2(this._y - _root.base._y, this._x - _root.base._x)) * 57.2957795130822) + 180;
}
this._rotation = (-this.angle) + 180;
this.xspeed = this.s * Math.cos((this.angle * 3.14) / 180);
this.yspeed = this.s * (-Math.sin((this.angle * 3.14) / 180));
this.t++;
if (((((this.enum / 2) == Math.floor(this.enum / 2)) && (this.enum != 0)) && ((this.t / 100) == Math.floor(this.t / 100))) && (diffLevel <= 1)) {
sp = _root.attachMovie("spines", "spines" + this.num, _root.getNextHighestDepth());
sp._x = this._x;
sp._y = this._y;
sp._rotation = this._rotation;
sp.xspeed = 8 * (-Math.cos((this._rotation * 3.14) / 180));
sp.yspeed = 8 * (-Math.sin((this._rotation * 3.14) / 180));
sp.onEnterFrame = function () {
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if (_root.base.hitTest(this._x, this._y, false)) {
health = health - 2;
this.removeMovieClip();
}
if (_root.person.hitTest(this._x, this._y, true)) {
phealth = phealth - 4;
this.removeMovieClip();
}
};
}
if (this.h <= 0) {
kills++;
times = (diffLevel / 2) + 1;
rnd = (Math.random() * 5) + 2;
_root.var0 = _root.var0 + Math.floor(times * rnd);
enemies[this.num] = undefined;
this.a = 70;
this.onEnterFrame = function () {
this.a = this.a - 2;
this._alpha = this.a;
if (this.a <= 0) {
this.removeMovieClip();
}
};
}
if (_root.base.hitTest(this._x, this._y, false)) {
health = health - this.dmg;
} else {
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
}
if (this.hitTest(person._x, person._y, false)) {
phealth = phealth - this.dmg;
}
};
clearInterval(newEnemyTime);
time = (Math.random() * (25 - level)) * ((diffLevel * 40) + 2);
time0 = (Math.random() * (25 - level)) * ((diffLevel * 40) + 2);
time1 = (Math.random() * (25 - level)) * ((diffLevel * 40) + 2);
time = ((time + time0) + time1) / 3;
newEnemyTime = setInterval(createEnemy, time);
}
function createObj() {
iNum = 0;
if (iNum < 5) {
item = this.attachMovie("money", "item", this.getNextHighestDepth());
times = (diffLevel / 2) + 1;
rnd = (Math.random() * 10) + 20;
item.amount = Math.floor(times * rnd);
item.iNum = 0;
}
if ((levelProg >= 95) && (level == 1)) {
m = attachMovie("instrItem", "instri", this.getNextHighestDepth());
m.a = 200;
m.onEnterFrame = function () {
this._x = item._x;
this._y = item._y;
this._alpha = (this.a = this.a - 2);
if (this.a <= 0) {
this.removeMovieClip();
}
};
}
item._x = (Math.random() * 580) + 10;
item._y = (Math.random() * 480) + 10;
item.onEnterFrame = function () {
this._rotation++;
if (_root.person.hitTest(this.inner)) {
_root["var" + this.iNum] = _root["var" + this.iNum] + this.amount;
this.removeMovieClip();
createObj();
}
};
}
function changeWeap() {
switchLeft = 81;
switchRight = 69;
switchLock = 82;
lastKey = Key.getCode();
if (lastKey == switchLeft) {
weap = weap - 1;
if (weap < 0) {
weap = bullets.length;
}
}
if (lastKey == switchRight) {
weap = weap + 1;
if (weap > bullets.length) {
weap = 0;
}
}
if (lastKey == switchLock) {
lockon = !lockon;
}
scrub._y = (weap * 26) + 24;
if ((!_root["obt" + weap]) && (weap != undefined)) {
changeWeap();
}
}
function mover() {
up = 87;
down = 83;
left = 65;
right = 68;
if (Key.isDown(up)) {
this._y = this._y - ((speed / 2) + 1.5);
}
if (Key.isDown(down)) {
this._y = this._y + ((speed / 2) + 1.5);
}
if (Key.isDown(left)) {
this._x = this._x - ((speed / 2) + 1.5);
}
if (Key.isDown(right)) {
this._x = this._x + ((speed / 2) + 1.5);
}
if (this._x < 0) {
this._x = 0;
}
if (this._x > 600) {
this._x = 600;
}
if (this._y < 0) {
this._y = 0;
}
if (this._y > 500) {
this._y = 500;
}
tAng = Math.atan2(_xmouse - this._x, _ymouse - this._y) * 57.2957795130822;
this._rotation = (-tAng) + 180;
}
function fire() {
person.play();
part = this.attachMovie(bullets[weap], "p" + this.getNextHighestDepth(), this.getNextHighestDepth());
part._x = person._x;
part._y = person._y;
part.weap = bullets[weap];
part.dmg = wDmg[weap] + (dmg / 2);
part.angle = person._rotation;
part.s = wSpeed[weap];
if (((bullets[weap] == "fireball") || (weapons[weap] == "UZ")) || (weapons[weap] == "SG")) {
part.angle = (part.angle + (Math.random() * 10)) - 5;
part.a = 50;
part._alpha = 50;
}
if (bullets[weap] == "spray") {
part.angle = (part.angle + (Math.random() * 30)) - 15;
part.a = 40;
part._alpha = 40;
}
part._rotation = part.angle + 90;
part.xspeed = wSpeed[weap] * Math.sin((part.angle * 3.14) / 180);
part.yspeed = wSpeed[weap] * (-Math.cos((part.angle * 3.14) / 180));
part.onEnterFrame = function () {
if (_root.misc2 && (this.weap == "rocket")) {
this.minDist = 999999999 /* 0x3B9AC9FF */;
this.minX = 0;
this.minY = 0;
x = 0;
while (x < enemies.length) {
this.enemy = enemies[x];
this.xDist = this._x - this.enemy._x;
this.yDist = this._y - this.enemy._y;
this.dist = Math.pow(this.xDist, 2) + Math.pow(this.yDist, 2);
if (this.dist < this.minDist) {
this.minDist = this.dist;
this.minX = this.xDist;
this.minY = this.yDist;
}
x++;
}
this.minDist = Math.sqrt(this.minDist);
this.angle = Math.atan2(this.minY, this.minX) * 57.2957795130823;
if (this.angle < this._rotation) {
this.angle = this._rotation - 5;
}
if (this.angle > this._rotation) {
this.angle = this._rotation + 5;
}
if (Math.abs(this.angle - this._rotation) < 5) {
this.angle = this._rotation;
}
if (this.minDist < 250) {
this._rotation = this.angle;
this.xspeed = this.s * (-Math.cos((this.angle * Math.PI) / 180));
this.yspeed = this.s * (-Math.sin((this.angle * Math.PI) / 180));
}
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if ((this.weap == "fireball") || (this.weap == "spray")) {
this.a = this.a - 1.6;
this._alpha = this.a;
if (this.a <= 5) {
this.removeMovieClip();
}
}
x = 0;
while (x < enemies.length) {
enemy = enemies[x];
if (enemy.hitTest(this._x, this._y, false)) {
enemy.h = enemy.h - this.dmg;
if (this.weap == "rocket") {
exp = _root.attachMovie("explosion", "exp", _root.getNextHighestDepth());
exp._x = this._x;
exp._y = this._y;
exp.a = 100;
y = 0;
while (y < enemies.length) {
enemy = enemies[y];
xDist = enemy._x - exp._x;
yDist = enemy._y - exp._y;
dist = Math.sqrt(Math.pow(xDist, 2) + Math.pow(yDist, 2));
if (dist <= 100) {
perc = 100 - dist;
enemy.h = enemy.h - (((perc / 100) * this.dmg) + 5);
}
y++;
}
exp.onEnterFrame = function () {
this.a = this.a - 5;
this._alpha = this.a;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
}
this.removeMovieClip();
}
x++;
}
if ((((this._x < -50) || (this._x > 650)) || (this._y < -50)) || (this._y > 550)) {
this.removeMovieClip();
}
};
}
function reload() {
clearInterval(refire);
ready = true;
}
stop();
var bullets = new Array("bullet", "canister", "spray", "rocket", "bullet", "fireball");
x = 1;
while (x <= bullets.length) {
if (_root["obt" + x] && (!iweap)) {
iweap = true;
m = attachMovie("instrWeap", "instrw", this.getNextHighestDepth());
m.a = 200;
m.onEnterFrame = function () {
this._x = _root.scrub._x;
this._y = _root.scrub._y;
this._alpha = (this.a = this.a - 2);
if (this.a <= 0) {
this.removeMovieClip();
}
};
break;
}
x++;
}
if (level == 1) {
m = attachMovie("instrMove", "instrm", this.getNextHighestDepth());
m.a = 200;
m.onEnterFrame = function () {
this._x = _root.person._x;
this._y = _root.person._y;
this._alpha = (this.a = this.a - 2);
if (this.a <= 0) {
this.removeMovieClip();
}
};
}
this.day.text = "Day " + level;
scrub._y = (weap * 26) + 24;
var item;
person._x = 300;
person._y = 250;
person.onEnterFrame = mover;
base._x = 300;
base._y = 250;
var levelProg = 100;
secs_per_level = 10;
additional = 10;
advanceLevel = setInterval(moveOn, (level * (secs_per_level * 10)) + (additional * 10));
var firenow = false;
var eNames = new Array("circle", "defiler", "ultra", "flier", "mutalisk", "slug", "spider");
var eDmg = new Array(0.5, 1, 2, 1, 1, 3, 2);
var eHp = new Array(5, 12, 20, 20, 20, 70, 50);
var eSpd = new Array(1.6, 2, 1.5, 4, 6, 1.5, 3);
enemies = undefined;
var enemies = new Array();
var fCount = 0;
var lockon = true;
clearInterval(countF);
countF = setInterval(oneSec, 1000);
onEnterFrame = function () {
ekill.text = "Kills: " + kills;
if (misc1) {
shield._x = base._x;
shield._y = base._y;
shield._rotation = shield._rotation + 10;
x = 0;
while (x < enemies.length) {
enemy = enemies[x];
if (shield.hitTest(enemy._x, enemy._y, true)) {
b = this.attachMovie("blast", "blast" + this.getNextHighestDepth(), this.getNextHighestDepth());
b._x = enemy._x;
b._y = enemy._y;
b.r = (Math.random() * 10) + 10;
b.onEnterFrame = function () {
this._rotation = this._rotation + this.r;
};
enemy.h = enemy.h - 100;
}
x++;
}
}
Mouse.hide();
secs = levelProg % 100;
totaltime = (level * 5) + 10;
_root.countdown.text = Math.floor((levelProg * totaltime) / 100);
fCount++;
if ((health <= 0) || (phealth <= 0)) {
item.removeMovieClip();
clearInterval(newEnemyTime);
clearInterval(advanceLevel);
_root.onEnterFrame = undefined;
x = 0;
while (x < enemies.length) {
enemy = enemies[x];
enemy.a = 70;
enemy.onEnterFrame = function () {
this.a = this.a - 2;
this._alpha = this.a;
if (this.a <= 0) {
this.removeMovieClip();
}
};
x++;
}
gotoAndPlay (5);
}
if (_root.base.hitTest(person._x, person._y, false)) {
phealth = phealth + 0.2;
if (phealth >= pmaxh) {
phealth = pmaxh;
}
}
money.text = "$" + var0;
if ((firenow && (ready)) && (!_root.mute.hitTest(_xmouse, _ymouse, false))) {
refire = setInterval(reload, wTime[weap] - (rUpg[weap] * rel));
ready = false;
fire();
if (weapons[weap] == "SG") {
fire();
fire();
}
}
_root.hbar._xscale = (health / maxh) * 100;
_root.pbar._xscale = (phealth / pmaxh) * 100;
};
onMouseDown = function () {
firenow = true;
};
onMouseUp = function () {
firenow = false;
};
createEnemy();
createObj();
onKeyDown = changeWeap;
Key.addListener(this);
var ready = true;
var wTime = new Array(250, 800, 150, 1500, 120, 150, 1200);
var wSpeed = new Array(17, 18, 15, 10, 17, 12, 17);
var wDmg = new Array(2, 12, 6, 22, 3, 4, 10);
var rUpg = new Array(5, 10, 5, 20, 3, 5, 15);
var weapons = new Array("AR", "CR", "CS", "RL", "UZ", "FT", "SG");
var bullets = new Array("bullet", "canister", "spray", "rocket", "bullet", "fireball", "bullet");
Frame 4 (6.77 KiB) ● ●
function setUpStore() {
x = 0;
while (x < expW.length) {
_root["weap" + x].price.text = "$" + wcost[x];
_root["weap" + x].type.text = weapNames[x];
_root["weap" + x].num = x;
_root["weap" + x].onRollOver = function () {
_root.popup._x = _xmouse;
_root.popup._y = _ymouse;
_root.popup.info.text = (weapNames[this.num] + " ") + expW[this.num];
};
_root["weap" + x].onRollOut = function () {
_root.popup._y = 999;
};
_root["weap" + x].onRelease = function () {
snd.attachSound("click");
snd.start();
if ((_root.var0 >= wcost[this.num]) && (!_root["obt" + (this.num + 1)])) {
_root.var0 = _root.var0 - wcost[this.num];
_root["obt" + (this.num + 1)] = true;
} else {
_root.popup._x = _xmouse;
_root.popup._y = _ymouse;
if (_root["obt" + (this.num + 1)]) {
_root.popup.info.text = "You already own this weapon.";
} else {
_root.popup.info.text = "Not enough money.";
}
}
};
x++;
}
x = 0;
while (x < expU.length) {
_root["upg" + x].item = upgrades[x];
_root["upg" + x].type.text = uname[x];
_root["upg" + x].price.text = ucost[x] * _root[upgrades[x]];
_root["upg" + x].owned.text = "x" + _root[upgrades[x]];
_root["upg" + x].num = x;
_root["upg" + x].onRelease = function () {
snd.attachSound("click");
snd.start();
if (_root.var0 >= (ucost[this.num] * _root[upgrades[this.num]])) {
_root.var0 = _root.var0 - (ucost[this.num] * _root[upgrades[this.num]]);
_root[upgrades[this.num]]++;
this.price.text = ucost[this.num] * _root[upgrades[this.num]];
this.owned.text = "x" + _root[upgrades[this.num]];
} else {
_root.popup._x = _xmouse;
_root.popup._y = _ymouse;
_root.popup.info.text = "Not enough money.";
}
};
_root["upg" + x].onRollOver = function () {
_root.popup._x = _xmouse;
_root.popup._y = _ymouse;
_root.popup.info.text = expU[this.num];
};
_root["upg" + x].onRollOut = function () {
_root.popup._y = 999;
};
_root["bmisc" + x].price.text = "$" + mcost[x];
_root["bmisc" + x].type.text = miscNames[x];
_root["bmisc" + x].num = x;
_root["bmisc" + x].onRollOver = function () {
_root.popup._x = _xmouse;
_root.popup._y = _ymouse;
_root.popup.info.text = expM[this.num];
};
_root["bmisc" + x].onRollOut = function () {
_root.popup._y = 999;
};
_root["bmisc" + x].onRelease = function () {
snd.attachSound("click");
snd.start();
if ((_root.var0 >= mcost[this.num]) && (!_root["misc" + this.num])) {
_root.var0 = _root.var0 - mcost[this.num];
_root["misc" + this.num] = true;
} else {
_root.popup._x = _xmouse;
_root.popup._y = _ymouse;
if (_root["misc" + this.num]) {
_root.popup.info.text = "You already own this item.";
} else {
_root.popup.info.text = "Not enough money.";
}
}
};
x++;
}
}
stop();
var levels = new Array("SKIRMISH (EASY)", "INVASION (NORMAL)", "BLITZKRIEG (HARD)", "OMGURGOING2GETPWNED");
var upgrades = new Array("speed", "rel", "dmg");
var uname = new Array("Speed", "Dexterity", "Attack");
var ucost = new Array(150, 150, 150);
var expU = new Array(3);
expU[0] = "Increases the speed of your character";
expU[1] = "Decreases reload time between shots";
expU[2] = "Increases Damage done to enemies";
var miscNames = new Array(" ", "Deflector", "Heat Sensor");
var mcost = new Array(50, 400, 800);
var expM = new Array(3);
expM[0] = "Red laser helps you aim. Does not do damage.";
expM[1] = "Rotating shield kills any enemy that it comes into contact with.";
expM[2] = "Rockets seek out nearest enemy.";
var wcost = new Array(200, 1300, 500, 1000, 900, 1400);
var weapNames = new Array("Canister Rifle", "Chemical Sprayer", "Rocket Launcher", "Uzi", "Flamethrower", "Shotgun", "Plasma Rifle", "Laser Blaster", "Sniper Rifle", "Minigun");
var expW = new Array(6);
expW[0] = "ROF-Moderate. DMG-Heavy";
expW[1] = "ROF-Fast. DMG-Heavy";
expW[2] = "ROF-Low. DMG-Heavy. Spcl-Splash damage";
expW[3] = "ROF-Super Fast. DMG-Moderate";
expW[4] = "ROF-Fast. DMG-Moderate";
var snd = new Sound();
this.saved._visible = false;
setUpStore();
diffLevel.onRollOver = function () {
_root.popup._x = _xmouse;
_root.popup._y = _ymouse;
_root.popup.info.text = "Click here to change difficulty.";
};
diffLevel.onRollOut = function () {
_root.popup._y = 999;
};
onEnterFrame = function () {
Mouse.hide();
if ((levels.length - diffLevel) >= (levels.length - 1)) {
changeDiff.text = "Too hard??";
diffbtn.level.text = levels[(levels.length - diffLevel) - 1];
diffbtn.onRelease = function () {
diffLevel++;
};
} else {
changeDiff.text = "Too easy??";
diffbtn.level.text = levels[(levels.length - diffLevel) + 1];
diffbtn.onRelease = function () {
diffLevel--;
};
}
_root.money.text = _root.var0;
healthamm.text = (Math.floor(health) + " / ") + maxh;
hbar._xscale = (health / maxh) * 100;
x = 0;
while (x < 5) {
if (_root["obt" + (x + 1)]) {
_root["weap" + x]._alpha = 30;
}
x++;
}
x = 0;
while (x < 3) {
if (_root["misc" + x]) {
_root["bmisc" + x]._alpha = 30;
}
x++;
}
};
this.cont.onRelease = function () {
gotoAndStop (3);
};
this.savegame.onRollOver = function () {
_root.popup._x = _xmouse;
_root.popup._y = _ymouse;
_root.popup.info.text = "Click to save.";
};
this.savegame.onRollOut = function () {
_root.popup._y = 999;
};
this.savegame.onRelease = function () {
snd.attachSound("click");
snd.start();
sObj = SharedObject.getLocal("016175SSKIRMISH");
_root.saved._visible = true;
x = 0;
while (x < 9) {
sObj.data["obt" + x] = _root["obt" + x];
x++;
}
x = 0;
while (x < 3) {
sObj.data["misc" + x] = _root["misc" + x];
x++;
}
sObj.data.var0 = _root.var0;
sObj.data.weap = weap;
sObj.data.iweap = iweap;
sObj.data.dmg = dmg;
sObj.data.speed = speed;
sObj.data.rel = rel;
sObj.data.kills = kills;
sObj.data.level = level;
sObj.data.phealth = phealth;
sObj.data.pmaxh = pmaxh;
sObj.data.health = health;
sObj.data.maxh = maxh;
sObj.flush();
};
heal.onRelease = function () {
if ((_root.var0 >= 75) && (health != maxh)) {
_root.var0 = _root.var0 - 75;
health = health + 100;
if (health >= maxh) {
health = maxh;
}
} else {
_root.popup._x = _xmouse;
_root.popup._y = _ymouse;
if (health == maxh) {
_root.popup.info.text = "Your base currently has full health.";
} else {
_root.popup.info.text = "NOT ENOUGH MONEY";
}
}
};
addh.onRelease = function () {
if (_root.var0 >= 300) {
_root.var0 = _root.var0 - 300;
health = health + 100;
maxh = maxh + 100;
} else {
_root.popup._x = _xmouse;
_root.popup._y = _ymouse;
_root.popup.info.text = "NOT ENOUGH MONEY";
}
};
Frame 5 (693 B)
function appear() {
armyrank.text = ranks[rNum - 1];
clearInterval(rankappear);
}
stop();
var snd = new Sound();
snd.attachSound("shutdown");
snd.setVolume(150);
snd.start();
ranks = new Array("General", "Colonel", "Captain", "Corporal", "Private");
bestLevel = ((diffLevel - 1) * 6) + 2;
rNum = Math.floor(((bestLevel - level) / bestLevel) * 5);
if (rNum <= 1) {
rNum = 1;
}
trace(rNum);
rank.gotoAndStop(rNum);
rank._rotation = rank._rotation + ((Math.random() * 50) - 25);
rankappear = setInterval(appear, 1000);
this.onEnterFrame = function () {
Mouse.hide();
lines._y = Math.random() * -200;
};
this.restart.onRelease = function () {
gotoAndPlay (2);
};
Symbol 70 MovieClip Frame 1 (234 B)
this.gotoAndStop(1);
this.onRelease = function () {
_root.sound = !_root.sound;
if (_root.sound) {
_root.bgMusic.setVolume(80);
this.gotoAndStop(1);
} else {
_root.bgMusic.setVolume(0);
this.gotoAndStop(2);
}
};
Symbol 74 MovieClip Frame 1 (75 B)
this.onEnterFrame = function () {
out._rotation = out._rotation + 4;
};
Symbol 243 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0 (465 B)
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 244 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0 (1.25 KiB) ●
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 245 MovieClip [__Packages.mx.transitions.Tween] Frame 0 (3.83 KiB) ●
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 246 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0 (545 B)
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 96 MovieClip Frame 1 (195 B)
stop();
x = 0;
while (x < 5) {
this["radar" + x]._rotation = Math.random() * 360;
this["radar" + x].onEnterFrame = function () {
this._rotation = this._rotation + 0.5;
};
x++;
}
Symbol 101 MovieClip Frame 1 (8 B)
stop();
Symbol 115 MovieClip [spider] Frame 1 (105 B)
x = 0;
while (x < 7) {
this["leg" + x].gotoAndPlay(Math.floor((Math.random() * 9) + 1));
x++;
}
Symbol 115 MovieClip [spider] Frame 2 (66 B)
gotoAndPlay (1);
if (this.h <= 0) {
this.gotoAndPlay(3);
}
Symbol 115 MovieClip [spider] Frame 9 (8 B)
stop();
Symbol 139 MovieClip [blast] Frame 10 (33 B)
stop();
this.removeMovieClip();
Symbol 149 MovieClip [defiler] Frame 1 (44 B)
if (this.h <= 0) {
gotoAndPlay (6);
}
Symbol 149 MovieClip [defiler] Frame 5 (62 B)
gotoAndPlay (1);
if (this.h <= 0) {
gotoAndPlay (6);
}
Symbol 149 MovieClip [defiler] Frame 14 (8 B)
stop();
Symbol 157 MovieClip [ultra] Frame 3 (70 B)
this.gotoAndPlay(1);
if (this.h <= 0) {
this.gotoAndPlay(4);
}
Symbol 157 MovieClip [ultra] Frame 12 (8 B)
stop();
Symbol 163 MovieClip [flier] Frame 3 (66 B)
gotoAndPlay (1);
if (this.h <= 0) {
this.gotoAndPlay(4);
}
Symbol 163 MovieClip [flier] Frame 10 (8 B)
stop();
Symbol 169 MovieClip [circle] Frame 3 (62 B)
gotoAndPlay (1);
if (this.h <= 0) {
gotoAndPlay (4);
}
Symbol 169 MovieClip [circle] Frame 15 (8 B)
stop();
Symbol 173 MovieClip [slug] Frame 2 (62 B)
gotoAndPlay (1);
if (this.h <= 0) {
gotoAndPlay (3);
}
Symbol 173 MovieClip [slug] Frame 7 (8 B)
stop();
Symbol 180 MovieClip [mutalisk] Frame 2 (66 B)
gotoAndPlay (1);
if (this.h <= 0) {
this.gotoAndPlay(3);
}
Symbol 180 MovieClip [mutalisk] Frame 10 (8 B)
stop();
Symbol 235 MovieClip Frame 1 (8 B)
stop();