Frame 1
function __com_mochibot__(swfid, mc, lv) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = ((((((((((("http://" + mbc) + "/my/core.swf?mv=5&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("33d24316", this, 10301);
_root.gameStartTime = getTimer();
Frame 2
stop();
Instance of Symbol 767 MovieClip in Frame 2
onClipEvent (enterFrame) {
if (getTimer() > (_root.gameStartTime + 6000)) {
_root.gotoAndStop("sponsors");
this.unloadMovie();
} else {
gotoAndStop(Math.floor((((getTimer() - _root.gameStartTime) * 15) / 1000) % 190));
}
}
Frame 3
stop();
Instance of Symbol 751 MovieClip [window_sponsors] "sponsor_mov" in Frame 3
onClipEvent (load) {
var count = 0;
}
Frame 5
_root.framesPerSec = 0;
_root.prev_time = 0;
_root.elapsed = getTimer() - _root.prev_time;
_root.time_count = _root.time_count + _root.elapsed;
_root.prev_time = getTimer();
_root.frame_count = 0;
stop();
Instance of Symbol 773 MovieClip in Frame 5
onClipEvent (load) {
_root.fps_ticks = 0;
_root.fps_total = 0;
_root.avg_fps = 0;
_root.max_fps = 0;
_root.frame_count = 0;
_root.time_count = 0;
_root.min_fps = 9999;
}
onClipEvent (enterFrame) {
_root.elapsed = getTimer() - _root.prev_time;
_root.time_count = _root.time_count + _root.elapsed;
_root.prev_time = getTimer();
_root.frame_count++;
if (_root.time_count > 333) {
_root.time_count = 0;
_root.framesPerSec = _root.frame_count * 3;
_root.frame_count = 0;
}
if ((_root.fps_ticker++) > 50) {
if (_root.framesPerSec < _root.min_fps) {
_root.min_fps = _root.fps;
}
if (_root.framesPerSec > _root.max_fps) {
_root.max_fps = _root.fps;
}
_root.fps_ticks++;
_root.fps_total = _root.fps_total + _root.framesPerSec;
_root.avg_fps = _root.fps_total / _root.fps_ticks;
}
updateAfterEvent();
}
Instance of Symbol 775 MovieClip "mouse_spot" in Frame 5
onClipEvent (load) {
var timerMove = 0;
var timerShoot = 0;
var timerDetonate = 0;
this.unloadMovie();
}
onClipEvent (enterFrame) {
if ((timerMove--) < 0) {
_x = (random(740) + 20);
_y = (random(440) + 20);
timerMove = 20 + random(100);
}
if ((timerShoot--) < 0) {
var choice = random(6);
if (choice == 0) {
_root.game.switchToSnot();
} else if (choice == 1) {
_root.game.switchToGreese();
} else if (choice == 2) {
_root.game.switchToFire();
} else if (choice == 3) {
_root.game.switchToIce();
} else if (choice == 4) {
_root.game.switchToSteel();
timerDetonate = 50;
} else if (choice == 5) {
_root.game.switchToMeteor();
}
_root.game.shoot();
timerShoot = 50 + random(50);
}
if (timerDetonate > 0) {
if ((--timerDetonate) == 0) {
_root.game.detonateSteel();
}
}
}
Instance of Symbol 775 MovieClip "test_mouse" in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
onClipEvent (enterFrame) {
dx = _root.mouse_spot._x - _x;
dy = _root.mouse_spot._y - _y;
_x = (_x + (dx * 0.01));
_y = (_y + (dy * 0.01));
}
Frame 6
loadedBytes = _root.getBytesLoaded();
totalBytes = _root.getBytesTotal();
if (_framesloaded >= _totalframes) {
gotoAndPlay (1);
} else {
percentageOutput = int((loadedBytes / totalBytes) * 100);
_root.loading_screen.loaderBar._xscale = percentageOutput;
_root.dude_head.gotoAndStop(Math.ceil(percentageOutput));
gotoAndPlay (6);
}
Frame 7
gotoAndPlay (6);
Symbol 22 MovieClip [snot_glob] Frame 1
function step() {
_xscale = (_xscale - decayRate);
_yscale = (_yscale - decayRate);
if (_xscale < 20) {
this.unloadMovie();
}
}
Instance of Symbol 21 MovieClip in Symbol 22 MovieClip [snot_glob] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 25 MovieClip Frame 1
stop();
Symbol 26 MovieClip [oil_glob] Frame 1
function step() {
_xscale = (_xscale - decayRate);
_yscale = (_yscale - decayRate);
if (_xscale < 20) {
this.unloadMovie();
}
}
Instance of Symbol 25 MovieClip in Symbol 26 MovieClip [oil_glob] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 31 MovieClip [deflect_steel_ball] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting vx and vy: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
m_flightTime++;
vy = vy + _parent._parent.g_grav;
_y = (_y + vy);
_x = (_x + vx);
_rotation = (_rotation + 14);
if ((boundaryTimer--) < 0) {
boundaryTimer = 25;
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
}
}
xmax = _parent._parent.g_width + 10;
ymax = _parent._parent.g_ground + 10;
flameDebrisTimer = 0;
_rotation = random(360);
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
boundaryTimer = 50;
var m_flightTime = 0;
Instance of Symbol 29 MovieClip in Symbol 31 MovieClip [deflect_steel_ball] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 32 MovieClip [steel_ball_single] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting vx and vy: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
m_flightTime++;
vy = vy + _parent._parent.g_grav;
_y = (_y + vy);
_x = (_x + vx);
_rotation = (_rotation + 14);
if ((boundaryTimer--) < 0) {
boundaryTimer = 25;
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
}
testHitEnemies();
}
function testHitEnemies() {
var _local4;
var _local5 = false;
var _local3 = 0;
while ((_local3 < _parent._parent.enemies.length) && (!_local5)) {
_local4 = _parent._parent.enemies[_local3];
if (_local4.hitBox.hitTest(_x, _y, 0)) {
_local5 = true;
break;
}
_local3++;
}
if (_local5) {
if (_local4.etype == "air_ship") {
_parent._parent.woodExplosion(_x, _y, 1);
_local4.testHitTroops(this);
}
var _local8;
var _local10 = false;
if (_local4.etype != "steel") {
_local10 = true;
_local4.takeDamage(10, _x, _y);
_local8 = 50;
_parent._parent.updateRankSteel(getFlightBonus(5) + 5);
_parent._parent.playSound("bomb.wav");
} else {
_local4.takeDamage(0, _x, _y);
_local8 = 20;
_parent._parent.playSound("ching2.wav");
}
var _local7 = _parent._parent.addObj("explosion_pow", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local7._x = _x;
_local7._y = _y;
_local7._rotation = random(360);
_local7._xscale = (_local7._yscale = _local8);
if (!_local10) {
var _local6 = _parent._parent.addObj("deflect_steel_ball", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local6._x = _x;
_local6._y = _y;
var _local9 = Math.sqrt((vx * vx) + (vy * vy)) * 0.75;
var _local11 = random(360);
_local6.vx = Math.cos((Math.PI/180) * _local11) * _local9;
_local6.vy = Math.sin((Math.PI/180) * _local11) * _local9;
_local6._xscale = (_local6._yscale = _xscale);
_local6.rank = rank;
}
this.unloadMovie();
}
}
function getFlightBonus(amt) {
var _local1 = m_flightTime / 10;
if (_local1 > 4) {
_local1 = 4;
}
return(Math.ceil(_local1 * amt));
}
xmax = _parent._parent.g_width + 10;
ymax = _parent._parent.g_ground + 10;
flameDebrisTimer = 0;
_rotation = random(360);
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
boundaryTimer = 50;
var m_flightTime = 0;
Instance of Symbol 29 MovieClip in Symbol 32 MovieClip [steel_ball_single] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 33 MovieClip Frame 1
stop();
Symbol 34 MovieClip [steel_ball] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting vx and vy: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
m_flightTime++;
vy = vy + _parent._parent.g_grav;
_y = (_y + vy);
_x = (_x + vx);
_rotation = (_rotation + 4);
if ((boundaryTimer--) < 0) {
boundaryTimer = 25;
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
destroy();
}
}
testHitEnemies();
}
function testHitEnemies() {
var _local8;
var _local9 = false;
var _local4 = 0;
while ((_local4 < _parent._parent.enemies.length) && (!_local9)) {
_local8 = _parent._parent.enemies[_local4];
if (_local8.hitBox.hitTest(_x, _y, 0)) {
_local9 = true;
break;
}
_local4++;
}
if (_local9) {
var _local13 = false;
if (_local8.etype == "air_ship") {
_parent._parent.woodExplosion(_x, _y, Math.ceil(rank / 1.2));
_local8.testHitTroops(this);
}
var _local11 = 0;
var _local12 = "ching2.wav";
if (_local8.etype != "steel") {
_local12 = "bomb.wav";
_local13 = true;
_local8.takeDamage(rank, _x, _y);
_local11 = rank * 20;
_parent._parent.updateRankSteel(getFlightBonus(10) + 5);
} else {
_local12 = "ching2.wav";
_local8.takeDamage(0, _x, _y);
_local11 = 20;
}
_parent._parent.playSound(_local12);
var _local10 = _parent._parent.addObj("explosion_pow", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local10._x = _x;
_local10._y = _y;
_local10._rotation = random(360);
_local10._xscale = (_local10._yscale = _local11);
if (!_local13) {
var _local6 = 0;
while (_local6 < (rank + 1)) {
var _local3 = _parent._parent.addObj("deflect_steel_ball", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local3._x = _x;
_local3._y = _y;
var _local5 = Math.sqrt((vx * vx) + (vy * vy)) * 0.75;
var _local7 = random(360);
_local3.vx = Math.cos((Math.PI/180) * _local7) * _local5;
_local3.vy = Math.sin((Math.PI/180) * _local7) * _local5;
_local3._xscale = (_local3._yscale = _xscale);
_local3.rank = rank;
_local6++;
}
}
this.unloadMovie();
}
}
function getFlightBonus(amt) {
var _local1 = m_flightTime / 10;
if (_local1 > 4) {
_local1 = 4;
}
return(Math.ceil(_local1 * amt));
}
function destroy() {
_parent._parent.removeFromSteelBalls(this);
this.unloadMovie();
}
xmax = _parent._parent.g_width + 10;
ymax = _parent._parent.g_ground + 10;
flameDebrisTimer = 0;
_rotation = random(360);
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
boundaryTimer = 50;
loaded = false;
var m_flightTime = 0;
Instance of Symbol 33 MovieClip "body" in Symbol 34 MovieClip [steel_ball] Frame 1
onClipEvent (load) {
gotoAndStop(_parent.rank);
}
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 35 MovieClip [greese_ball] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting vx and vy: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
m_flightTime++;
vy = vy + _parent._parent.g_grav;
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if ((vx < 1E-5) && (vx > -1E-5)) {
_rotation = (_rotation + 180);
}
if ((boundaryTimer--) < 0) {
boundaryTimer = 25;
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
}
if ((flameDebrisTimer--) < 0) {
flameDebrisTimer = 0;
var _local3 = _parent._parent.addObj("oil_glob", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local3._x = _x;
_local3._y = _y;
_local3._rotation = _rotation;
_local3._xscale = (_local3._yscale = 30 + (rank * 20));
_local3.decayRate = 6;
}
testHitEnemies();
}
function testHitEnemies() {
var _local4;
var _local5 = false;
var _local3 = 0;
while ((_local3 < _parent._parent.enemies.length) && (!_local5)) {
_local4 = _parent._parent.enemies[_local3];
if (_local4.hitBox.hitTest(_x, _y, 0)) {
_local5 = true;
break;
}
_local3++;
}
if (_local5) {
_parent._parent.playSound("blood_splat.wav");
if (_local4.etype == "air_ship") {
_local4.testHitTroops(this);
}
if ((_local4.etype == "greese") || (_local4.etype == "steel")) {
_local4.takeDamage(0, _x, _y);
} else {
_parent._parent.addSticky("sticky_greese", _local4, _x, _y, 20 + (rank * 20));
_local4.takeDamage(Math.ceil(rank / 2), _x, _y);
_parent._parent.updateRankGreese(getFlightBonus(10) + 5);
}
this.unloadMovie();
}
}
function testHitTroops(obj) {
if ((obj.archer != null) && (obj.archer.hitTest(_x, _y, 0))) {
obj.archer.unloadMovie();
_parent._parent.addFlyingTroop("deb_ene_archer", _x, _y, obj.archer._xscale, obj.archer._yscale);
} else if ((obj.boss != null) && (obj.boss.hitTest(_x, _y, 0))) {
_parent._parent.updateRankGreese(getFlightBonus(10) + 5, _x, _y);
_parent._parent.addFlyingTroop("deb_ene_boss", _x, _y, obj.archer._xscale, obj.archer._yscale);
obj.boss.unloadMovie();
} else if ((obj.foot1 != null) && (obj.foot1.hitTest(_x, _y, 0))) {
_parent._parent.addFlyingTroop("deb_ene_foot", _x, _y, obj.archer._xscale, obj.archer._yscale);
obj.foot1.unloadMovie();
} else if ((obj.foot2 != null) && (obj.foot2.hitTest(_x, _y, 0))) {
_parent._parent.addFlyingTroop("deb_ene_foot", _x, _y, obj.archer._xscale, obj.archer._yscale);
obj.foot2.unloadMovie();
} else if ((obj.flagger != null) && (obj.flagger.hitTest(_x, _y, 0))) {
_parent._parent.addFlyingTroop("deb_ene_cat", _x, _y, obj.archer._xscale, obj.archer._yscale);
obj.flagger.unloadMovie();
}
}
function getFlightBonus(amt) {
var _local1 = m_flightTime / 10;
if (_local1 > 4) {
_local1 = 4;
}
return(Math.ceil(_local1 * amt));
}
xmax = _parent._parent.g_width + 10;
ymax = _parent._parent.g_ground + 10;
flameDebrisTimer = 0;
_rotation = random(360);
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
boundaryTimer = 50;
var m_flightTime = 0;
Instance of Symbol 25 MovieClip in Symbol 35 MovieClip [greese_ball] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 36 MovieClip Frame 1
stop();
Symbol 37 MovieClip [snot_ball_splat] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting vx and vy: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
vy = vy + _parent._parent.g_grav;
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if ((vx < 1E-5) && (vx > -1E-5)) {
_rotation = (_rotation + 180);
}
if ((boundaryTimer--) < 0) {
boundaryTimer = 25;
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
}
if ((flameDebrisTimer--) < 0) {
flameDebrisTimer = 0;
var _local3 = _parent._parent.addObj("snot_glob", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local3._x = _x;
_local3._y = _y;
_local3._rotation = _rotation;
_local3._xscale = (_local3._yscale = 30 + (rank * 20));
_local3.decayRate = 6;
}
if ((hitTimer--) < 0) {
testHitEnemies();
}
}
function testHitEnemies() {
var _local4;
var _local5 = false;
var _local3 = 0;
while ((_local3 < _parent._parent.enemies.length) && (!_local5)) {
_local4 = _parent._parent.enemies[_local3];
if (_local4.hitBox.hitTest(_x, _y, 0)) {
_local5 = true;
break;
}
_local3++;
}
if (_local5) {
_parent._parent.playSound("blood_splat.wav");
if (_local4.etype == "air_ship") {
_local4.testHitTroops(this);
}
if (_local4.etype != "snot") {
_parent._parent.addSticky("sticky_snot", _local4, _x, _y, 20 + (rank * 20));
_local4.takeDamage(Math.ceil(rank / 2), _x, _y);
} else {
_local4.takeDamage(0, _x, _y);
}
this.unloadMovie();
}
}
xmax = _parent._parent.g_width + 10;
ymax = _parent._parent.g_ground + 10;
flameDebrisTimer = 0;
_rotation = random(360);
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
hitTimer = 50;
boundaryTimer = 50;
Instance of Symbol 36 MovieClip in Symbol 37 MovieClip [snot_ball_splat] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 38 MovieClip [snot_ball] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting vx and vy: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
m_flightTime++;
vy = vy + _parent._parent.g_grav;
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if ((vx < 1E-5) && (vx > -1E-5)) {
_rotation = (_rotation + 180);
}
if ((boundaryTimer--) < 0) {
boundaryTimer = 25;
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
}
if ((flameDebrisTimer--) < 0) {
flameDebrisTimer = 0;
var _local3 = _parent._parent.addObj("snot_glob", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local3._x = _x;
_local3._y = _y;
_local3._rotation = _rotation;
_local3._xscale = (_local3._yscale = 30 + (rank * 20));
_local3.decayRate = 6;
}
testHitEnemies();
}
function testHitEnemies() {
var _local3;
var _local5 = false;
var _local6;
var _local4 = 0;
while ((_local4 < _parent._parent.enemies.length) && (!_local5)) {
_local3 = _parent._parent.enemies[_local4];
if (_local3.hitBox.hitTest(_x, _y, 0)) {
_local5 = true;
_local6 = _local3;
break;
}
_local4++;
}
if (_local5) {
_parent._parent.playSound("blood_splat.wav");
if (_local3.etype == "air_ship") {
_local3.testHitTroops(this);
}
if ((_local3.etype == "snot") || (_local3.etype == "fire")) {
} else if (_local3.etype == "meteor") {
_local3.takeDamage(Math.ceil(rank / 1.2), _x, _y);
_parent._parent.updateRankSnot(getFlightBonus(3) + 2);
} else if (_local3.etype == "air_ship") {
splatSnot(_local6);
} else if (_local3.etype == "steel") {
_parent._parent.addSticky("sticky_snot", _local3, _x, _y, 20 + (rank * 20));
splatSnot(_local6);
_local3.takeDamage(rank, _x, _y);
_parent._parent.updateRankSnot(getFlightBonus(30) + 10);
} else {
_parent._parent.addSticky("sticky_snot", _local3, _x, _y, 20 + (rank * 20));
splatSnot(_local6);
_local3.takeDamage(rank, _x, _y);
_parent._parent.updateRankSnot(getFlightBonus(10) + 5);
}
this.unloadMovie();
}
}
function splatSnot(obj) {
var _local2;
var _local3 = 0;
while (_local3 < rank) {
_local2 = _parent._parent.addObj("snot_ball_splat", _parent._parent.bullet_layer, _parent._parent.getNextProjectileLevel());
_local2.vx = (random(100) - 50) / 20;
_local2.vy = (-random(50)) / 20;
_local2._x = _x;
_local2._y = _y;
_local2._xscale = (_local2._yscale = _xscale / 2);
_local2.rank = 1;
_local2.owner = obj;
_local3++;
}
}
function testHitTroops(obj) {
if ((obj.archer != null) && (obj.archer.hitTest(_x, _y, 0))) {
obj.archer.unloadMovie();
_parent._parent.addFlyingTroop("deb_ene_archer", _x, _y, obj.archer._xscale, obj.archer._yscale);
} else if ((obj.boss != null) && (obj.boss.hitTest(_x, _y, 0))) {
_parent._parent.updateRankSnot(getFlightBonus(10) + 5, _x, _y);
_parent._parent.addFlyingTroop("deb_ene_boss", _x, _y, obj.archer._xscale, obj.archer._yscale);
obj.boss.unloadMovie();
} else if ((obj.foot1 != null) && (obj.foot1.hitTest(_x, _y, 0))) {
_parent._parent.addFlyingTroop("deb_ene_foot", _x, _y, obj.archer._xscale, obj.archer._yscale);
obj.foot1.unloadMovie();
} else if ((obj.foot2 != null) && (obj.foot2.hitTest(_x, _y, 0))) {
_parent._parent.addFlyingTroop("deb_ene_foot", _x, _y, obj.archer._xscale, obj.archer._yscale);
obj.foot2.unloadMovie();
} else if ((obj.flagger != null) && (obj.flagger.hitTest(_x, _y, 0))) {
_parent._parent.addFlyingTroop("deb_ene_cat", _x, _y, obj.archer._xscale, obj.archer._yscale);
obj.flagger.unloadMovie();
}
}
function getFlightBonus(amt) {
var _local1 = m_flightTime / 10;
if (_local1 > 4) {
_local1 = 4;
}
return(Math.ceil(_local1 * amt));
}
xmax = _parent._parent.g_width + 10;
ymax = _parent._parent.g_ground + 10;
flameDebrisTimer = 0;
_rotation = random(360);
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
boundaryTimer = 50;
var m_flightTime = 0;
Instance of Symbol 36 MovieClip in Symbol 38 MovieClip [snot_ball] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 41 MovieClip Frame 1
stop();
Symbol 42 MovieClip [meteor_ball] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting vx and vy: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
m_flightTime++;
vy = vy + _parent._parent.g_grav;
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if ((vx < 1E-5) && (vx > -1E-5)) {
_rotation = (_rotation + 180);
}
if ((boundaryTimer--) < 0) {
boundaryTimer = 25;
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
}
if ((flameDebrisTimer--) < 0) {
flameDebrisTimer = 0;
var _local3 = _parent._parent.addObj("smoke_2", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local3._x = _x;
_local3._y = _y;
_local3._rotation = _rotation;
_local3._xscale = (_local3._yscale = 30 + (rank * 20));
_local3.decayRate = 6;
}
testHitEnemies();
}
function testHitEnemies() {
var _local4;
var _local5 = false;
var _local3 = 0;
while ((_local3 < _parent._parent.enemies.length) && (!_local5)) {
_local4 = _parent._parent.enemies[_local3];
if (_local4.hitBox.hitTest(_x, _y, 0)) {
_local5 = true;
break;
}
_local3++;
}
if (_local5) {
_parent._parent.playSound("bomb.wav");
if (_local4.etype == "air_ship") {
_parent._parent.woodExplosion(_x, _y, Math.ceil(rank / 1.5));
_local4.testHitTroops(this);
}
if (_local4.etype != "steel") {
_local4.takeDamage(rank * 8, _x, _y);
var _local6 = _parent._parent.addObj("explosion_pow", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local6._x = _x;
_local6._y = _y;
_local6._rotation = random(360);
_local6._xscale = (_local6._yscale = rank * 30);
_parent._parent.updateRankMeteor(getFlightBonus(10) + 5);
} else {
_local4.takeDamage(rank * 4, _x, _y);
var _local6 = _parent._parent.addObj("explosion_pow", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local6._x = _x;
_local6._y = _y;
_local6._rotation = random(360);
_local6._xscale = (_local6._yscale = rank * 15);
_parent._parent.updateRankMeteor(getFlightBonus(5) + 2);
}
this.unloadMovie();
}
}
function getFlightBonus(amt) {
var _local1 = m_flightTime / 10;
if (_local1 > 4) {
_local1 = 4;
}
return(Math.ceil(_local1 * amt));
}
xmax = _parent._parent.g_width + 10;
ymax = _parent._parent.g_ground + 10;
flameDebrisTimer = 0;
_rotation = random(360);
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
boundaryTimer = 50;
var m_flightTime = 0;
Instance of Symbol 41 MovieClip in Symbol 42 MovieClip [meteor_ball] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 45 MovieClip Frame 1
stop();
Symbol 46 MovieClip [deflect_ice] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting vx and vy: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
m_flightTime++;
vy = vy + _parent._parent.g_grav;
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if ((vx < 1E-5) && (vx > -1E-5)) {
_rotation = (_rotation + 180);
}
if ((boundaryTimer--) < 0) {
boundaryTimer = 25;
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
}
if ((flameDebrisTimer--) < 0) {
flameDebrisTimer = 0;
var _local3 = _parent._parent.addObj("ice_spark", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local3._x = _x;
_local3._y = _y;
_local3._rotation = random(360);
_local3._xscale = (_local3._yscale = 30 + (rank * 20));
_local3.decayRate = 6;
}
}
xmax = _parent._parent.g_width + 10;
ymax = _parent._parent.g_ground + 10;
flameDebrisTimer = 0;
_rotation = random(360);
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
boundaryTimer = 50;
var m_flightTime = 0;
Instance of Symbol 45 MovieClip in Symbol 46 MovieClip [deflect_ice] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 49 MovieClip Frame 1
stop();
Symbol 50 MovieClip [deflect_flame] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting vx and vy: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
m_flightTime++;
vy = vy + _parent._parent.g_grav;
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if ((vx < 1E-5) && (vx > -1E-5)) {
_rotation = (_rotation + 180);
}
if ((boundaryTimer--) < 0) {
boundaryTimer = 25;
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
}
if (((_x < -10) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if ((flameDebrisTimer--) < 0) {
flameDebrisTimer = 0;
var _local3 = _parent._parent.addObj("flame_spark", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local3._x = _x;
_local3._y = _y;
_local3._rotation = _rotation;
_local3._xscale = (_local3._yscale = 30 + (rank * 20));
_local3.decayRate = 6;
}
}
xmax = _parent._parent.g_width + 10;
ymax = _parent._parent.g_ground + 10;
flameDebrisTimer = 0;
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
boundaryTimer = 50;
var m_flightTime = 0;
Instance of Symbol 49 MovieClip in Symbol 50 MovieClip [deflect_flame] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 53 MovieClip Frame 1
stop();
Symbol 54 MovieClip [smoke_raise] Frame 1
function step() {
vx = vx * 1.01;
frameCount = frameCount + frameRate;
if (frameCount >= maxFrame) {
this.unloadMovie();
} else {
anim.gotoAndStop(Math.floor(frameCount));
}
_y = (_y - vx);
}
var frameCount = 1;
var frameRate = 2;
var maxFrame = 100;
var rate = ((random(100) - 50) / 10);
var vx = 1;
Instance of Symbol 53 MovieClip "anim" in Symbol 54 MovieClip [smoke_raise] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 57 MovieClip [sticky_ice] Frame 1
function step() {
_x = (stuckTo._x + x_offset);
_y = (stuckTo._y + y_offset);
if ((timerShrink--) < 0) {
m_size = m_size * 0.99;
}
_yscale = m_size;
_xscale = m_size;
if (m_size < 10) {
destroy();
}
if ((timerDamage--) < 0) {
timerDamage = 20;
var _local1 = Math.floor(m_size * 0.2);
stuckTo.slowShooting(_local1);
trace("Slowing by: " + _local1);
}
}
function destroy() {
this.unloadMovie();
}
var timerShrink = 100;
var timerDamage = 20;
_rotation = random(360);
Instance of Symbol 56 MovieClip in Symbol 57 MovieClip [sticky_ice] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 60 MovieClip [sticky_greese] Frame 1
function step() {
_x = (stuckTo._x + x_offset);
_y = (stuckTo._y + y_offset);
m_size = m_size * 0.99;
_yscale = m_size;
_xscale = m_size;
if ((timerDamage--) < 0) {
timerDamage = 20;
if (stuckTo.etype == "snot") {
stuckTo.takeDamage(Math.floor(m_size / 5) + 5, _x, _y);
}
}
if (m_size < 10) {
destroy();
}
}
function destroy() {
this.unloadMovie();
}
var timerDamage = 20;
Instance of Symbol 59 MovieClip in Symbol 60 MovieClip [sticky_greese] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 63 MovieClip [sticky_fire] Frame 1
function step() {
_x = (stuckTo._x + x_offset);
_y = (stuckTo._y + y_offset);
if ((timerShrink--) < 0) {
m_size = m_size * 0.99;
}
_yscale = m_size;
_xscale = m_size;
if (m_size < 10) {
destroy();
}
_rotation = ((random(100) - 50) / 10);
if ((timerSmoke--) < 0) {
timerSmoke = 6;
_parent._parent.addDebris("smoke_raise", _x, _y - (_height / 2), random(360), m_size * 1.5);
}
if ((timerDamage--) < 0) {
timerDamage = 20;
if (((stuckTo.etype != "fire") && (stuckTo.etype != "steel")) && (stuckTo.etype != "meteor")) {
stuckTo.takeDamage(Math.floor(m_size / 20) + 1, _x, _y);
}
}
}
function destroy() {
this.unloadMovie();
}
var timerShrink = 100;
var timerSmoke = 0;
var timerDamage = 20;
Instance of Symbol 62 MovieClip in Symbol 63 MovieClip [sticky_fire] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 66 MovieClip [sticky_snot] Frame 1
function step() {
_x = (stuckTo._x + x_offset);
_y = (stuckTo._y + y_offset);
m_size = m_size * 0.99;
_yscale = m_size;
_xscale = m_size;
if (m_size < 10) {
destroy();
}
if ((timerDamage--) < 0) {
timerDamage = 20;
if (((stuckTo.etype != "snot") && (stuckTo.etype != "air_ship")) && (stuckTo.etype != "ice")) {
if (stuckTo.etype == "steel") {
stuckTo.takeDamage(Math.floor(m_size / 10) + 2, _x, _y);
} else {
stuckTo.takeDamage(Math.floor(m_size / 20) + 1, _x, _y);
}
}
}
}
function destroy() {
this.unloadMovie();
}
var timerDamage = 20;
Instance of Symbol 65 MovieClip in Symbol 66 MovieClip [sticky_snot] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 71 MovieClip [ammo_text_meteor] Frame 1
function step() {
if ((frameCount--) < 0) {
this.unloadMovie();
}
_y = (_y - 0.3);
}
var frameCount = 100;
Instance of Symbol 70 MovieClip in Symbol 71 MovieClip [ammo_text_meteor] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 75 MovieClip [ammo_text_greese] Frame 1
function step() {
if ((frameCount--) < 0) {
this.unloadMovie();
}
_y = (_y - 0.3);
}
var frameCount = 100;
Instance of Symbol 74 MovieClip in Symbol 75 MovieClip [ammo_text_greese] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 79 MovieClip [ammo_text_steel] Frame 1
function step() {
if ((frameCount--) < 0) {
this.unloadMovie();
}
_y = (_y - 0.3);
}
var frameCount = 100;
Instance of Symbol 78 MovieClip in Symbol 79 MovieClip [ammo_text_steel] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 83 MovieClip [ammo_text_snot] Frame 1
function step() {
if ((frameCount--) < 0) {
this.unloadMovie();
}
_y = (_y - 0.3);
}
var frameCount = 100;
Instance of Symbol 82 MovieClip in Symbol 83 MovieClip [ammo_text_snot] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 87 MovieClip [ammo_text_ice] Frame 1
function step() {
if ((frameCount--) < 0) {
this.unloadMovie();
}
_y = (_y - 0.3);
}
var frameCount = 100;
Instance of Symbol 86 MovieClip in Symbol 87 MovieClip [ammo_text_ice] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 91 MovieClip [ammo_text_fire] Frame 1
function step() {
if ((frameCount--) < 0) {
this.unloadMovie();
}
_y = (_y - 0.3);
}
var frameCount = 100;
Instance of Symbol 90 MovieClip in Symbol 91 MovieClip [ammo_text_fire] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 95 MovieClip [xp_text] Frame 1
function step() {
if ((frameCount--) < 0) {
this.unloadMovie();
}
_y = (_y - 0.5);
}
var frameCount = 75;
Instance of Symbol 94 MovieClip in Symbol 95 MovieClip [xp_text] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 99 MovieClip [dmg_text] Frame 1
function step() {
if ((frameCount--) < 0) {
this.unloadMovie();
}
_y = (_y - 0.3);
}
var frameCount = 100;
Instance of Symbol 98 MovieClip in Symbol 99 MovieClip [dmg_text] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 104 MovieClip [air_enemy] Frame 1
function step() {
m_target_x = _parent._parent.dragon_head._x;
m_target_y = _parent._parent.dragon_head._y;
var _local2 = 2;
if (!isDead()) {
updateCannon();
if ((m_target_x > _x) && (vx < _local2)) {
vx = vx + 0.05;
} else if ((m_target_x < _x) && (vx > (-_local2))) {
vx = vx - 0.05;
}
if ((m_target_y > _y) && (vy < _local2)) {
vy = vy + 0.02;
} else if ((m_target_y < _y) && (vy > (-_local2))) {
vy = vy - 0.02;
}
if (vx > 0) {
_xscale = -100;
} else {
_xscale = 100;
}
} else {
vy = vy + 0.08;
_rotation = (_rotation - 0.2);
}
updatePosition();
if (_y > (_parent._parent.g_ground + 100)) {
destroy();
}
}
function updateCannon() {
if ((shootTimer--) < 0) {
shootTimer = 300;
_parent._parent.shootAtDragon(_x, _y, 2);
}
}
function updatePosition() {
_x = (_x + vx);
_y = (_y + vy);
}
function takeDamage(amt, xp, yp) {
trace("Taking Damage");
hp = hp - amt;
if (hp < 0) {
hp = 0;
}
var _local2 = _parent._parent.addObj("dmg_text", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2._x = xp;
_local2._y = yp;
_local2.val = amt;
}
function isDead() {
return(hp == 0);
}
function setHP(num) {
hp = num;
}
function destroy() {
_parent._parent.removeEnemy(this);
}
m_target_x = 0;
m_target_y = 0;
vx = -0.6;
vy = 0;
hp = 2;
shootTimer = 300;
etype = "dragon_archer";
Instance of Symbol 101 MovieClip in Symbol 104 MovieClip [air_enemy] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 103 MovieClip "hitBox" in Symbol 104 MovieClip [air_enemy] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 107 MovieClip [ammo_box_greese] Frame 1
function step() {
_yscale = scale;
_xscale = scale;
if (_y > orig_y) {
vy = vy - 0.1;
}
if (_y <= orig_y) {
vy = vy + 0.1;
}
if ((timer--) < 0) {
scale = scale * 0.8;
} else if (scale < 100) {
scale = scale * 1.1;
}
if (scale < 10) {
destroy();
}
if (_parent._parent.dragon_head.hitTest(_x, _y, 0)) {
_parent._parent.deltaGreeseAmmo(15);
var _local2 = _parent._parent.addObj("ammo_text_greese", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2.val = "grease +15";
_local2._x = _x;
_local2._y = _y;
_parent._parent.playSound("ammo.wav");
destroy();
}
_y = (_y + vy);
}
function destroy() {
this.unloadMovie();
}
timer = 1000;
vy = -1;
orig_y = _y;
scale = 11;
Instance of Symbol 106 MovieClip in Symbol 107 MovieClip [ammo_box_greese] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 110 MovieClip [ammo_box_snot] Frame 1
function step() {
_yscale = scale;
_xscale = scale;
if (_y > orig_y) {
vy = vy - 0.1;
}
if (_y <= orig_y) {
vy = vy + 0.1;
}
if ((timer--) < 0) {
scale = scale * 0.8;
} else if (scale < 100) {
scale = scale * 1.1;
}
if (scale < 10) {
destroy();
}
if (_parent._parent.dragon_head.hitTest(_x, _y, 0)) {
_parent._parent.deltaSnotAmmo(15);
var _local2 = _parent._parent.addObj("ammo_text_snot", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2.val = "snot +15";
_local2._x = _x;
_local2._y = _y;
_parent._parent.playSound("ammo.wav");
destroy();
}
_y = (_y + vy);
}
function destroy() {
this.unloadMovie();
}
timer = 1000;
vy = -1;
orig_y = _y;
scale = 11;
Instance of Symbol 109 MovieClip in Symbol 110 MovieClip [ammo_box_snot] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 116 MovieClip [ammo_box_steel] Frame 1
function step() {
_yscale = scale;
_xscale = scale;
if (_y > orig_y) {
vy = vy - 0.1;
}
if (_y <= orig_y) {
vy = vy + 0.1;
}
if ((timer--) < 0) {
scale = scale * 0.8;
} else if (scale < 100) {
scale = scale * 1.1;
}
if (scale < 10) {
destroy();
}
if (_parent._parent.dragon_head.hitTest(_x, _y, 0)) {
_parent._parent.deltaSteelAmmo(10);
var _local2 = _parent._parent.addObj("ammo_text_steel", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2.val = "steel +10";
_local2._x = _x;
_local2._y = _y;
_parent._parent.playSound("ammo.wav");
destroy();
}
_y = (_y + vy);
}
function destroy() {
this.unloadMovie();
}
timer = 1000;
vy = -1;
orig_y = _y;
scale = 11;
Instance of Symbol 115 MovieClip in Symbol 116 MovieClip [ammo_box_steel] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 119 MovieClip [ammo_box_meteor] Frame 1
function step() {
_yscale = scale;
_xscale = scale;
if (_y > orig_y) {
vy = vy - 0.1;
}
if (_y <= orig_y) {
vy = vy + 0.1;
}
if ((timer--) < 0) {
scale = scale * 0.8;
} else if (scale < 100) {
scale = scale * 1.1;
}
if (scale < 10) {
destroy();
}
if (_parent._parent.dragon_head.hitTest(_x, _y, 0)) {
_parent._parent.deltaMeteorAmmo(20);
var _local2 = _parent._parent.addObj("ammo_text_meteor", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2.val = "meteor +20";
_local2._x = _x;
_local2._y = _y;
_parent._parent.playSound("ammo.wav");
destroy();
}
_y = (_y + vy);
}
function destroy() {
this.unloadMovie();
}
timer = 1000;
vy = -1;
orig_y = _y;
scale = 11;
Instance of Symbol 118 MovieClip in Symbol 119 MovieClip [ammo_box_meteor] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 122 MovieClip [ammo_box_ice] Frame 1
function step() {
_yscale = scale;
_xscale = scale;
if (_y > orig_y) {
vy = vy - 0.1;
}
if (_y <= orig_y) {
vy = vy + 0.1;
}
if ((timer--) < 0) {
scale = scale * 0.8;
} else if (scale < 100) {
scale = scale * 1.1;
}
if (scale < 10) {
destroy();
}
if (_parent._parent.dragon_head.hitTest(_x, _y, 0)) {
var _local3 = 15;
_parent._parent.deltaIceAmmo(15);
var _local2 = _parent._parent.addObj("ammo_text_ice", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2.val = "ice +15";
_local2._x = _x;
_local2._y = _y;
_parent._parent.playSound("ammo.wav");
destroy();
}
_y = (_y + vy);
}
function destroy() {
this.unloadMovie();
}
timer = 1000;
vy = -1;
orig_y = _y;
scale = 11;
Instance of Symbol 121 MovieClip in Symbol 122 MovieClip [ammo_box_ice] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 128 MovieClip [ammo_box_heal] Frame 1
function step() {
_yscale = scale;
_xscale = scale;
if (_y > orig_y) {
vy = vy - 0.1;
}
if (_y <= orig_y) {
vy = vy + 0.1;
}
if ((timer--) < 0) {
scale = scale * 0.8;
} else if (scale < 100) {
scale = scale * 1.1;
}
if (scale < 10) {
destroy();
}
if (_parent._parent.dragon_head.hitTest(_x, _y, 0)) {
var _local3 = _parent._parent.deltaDragonHP(20);
var _local2 = _parent._parent.addObj("dmg_text", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2.val = "hp +" + _local3;
_local2._x = _x;
_local2._y = _y;
_parent._parent.playSound("nice.wav");
destroy();
}
_y = (_y + vy);
}
function destroy() {
this.unloadMovie();
}
timer = 1000;
vy = -1;
orig_y = _y;
scale = 11;
Instance of Symbol 127 MovieClip in Symbol 128 MovieClip [ammo_box_heal] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 131 MovieClip [ammo_box_fire] Frame 1
function step() {
_yscale = scale;
_xscale = scale;
if (_y > orig_y) {
vy = vy - 0.1;
}
if (_y <= orig_y) {
vy = vy + 0.1;
}
if ((timer--) < 0) {
scale = scale * 0.8;
} else if (scale < 100) {
scale = scale * 1.1;
}
if (scale < 10) {
destroy();
}
if (_parent._parent.dragon_head.hitTest(_x, _y, 0)) {
_parent._parent.deltaFireAmmo(15);
var _local2 = _parent._parent.addObj("ammo_text_fire", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2.val = "fire +15";
_local2._x = _x;
_local2._y = _y;
_parent._parent.playSound("ammo.wav");
destroy();
}
_y = (_y + vy);
}
function destroy() {
this.unloadMovie();
}
timer = 1000;
vy = -1;
orig_y = _y;
scale = 11;
Instance of Symbol 130 MovieClip in Symbol 131 MovieClip [ammo_box_fire] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 134 MovieClip [gun_flash] Frame 1
function step() {
_alpha = (_alpha - decayRate);
if (_alpha < 0) {
this.unloadMovie();
}
}
decayRate = 5;
Instance of Symbol 133 MovieClip in Symbol 134 MovieClip [gun_flash] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 137 MovieClip Frame 1
stop();
Symbol 138 MovieClip [explosion_pow_ice] Frame 1
function step() {
frameCount = frameCount + frameRate;
if (frameCount >= maxFrame) {
this.unloadMovie();
} else {
anim.gotoAndStop(Math.floor(frameCount));
}
}
var frameCount = 1;
var frameRate = 1;
var maxFrame = 20;
anim._rotation = random(360);
Instance of Symbol 137 MovieClip "anim" in Symbol 138 MovieClip [explosion_pow_ice] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 145 Button
on (release) {
_parent._parent.closeHighScores();
}
Symbol 155 Button
on (release) {
getURL ("http://www.lostvectors.com", "_blank");
}
Instance of Symbol 162 MovieClip in Symbol 163 MovieClip [window_updates] Frame 1
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}
Symbol 168 Button
on (release) {
_parent._parent.resetGame();
}
Symbol 170 Button
on (release) {
_parent._parent.resetGame();
}
Symbol 183 Button
on (release) {
_parent._parent.loadGlobalScores();
}
Symbol 197 Button
on (release) {
_parent._parent.loadGameGuide();
}
Symbol 199 Button
on (release) {
_parent._parent.loadSponsors();
}
Symbol 201 Button
on (release) {
_parent._parent.toggleSound();
}
Symbol 203 Button
on (release) {
_parent._parent.loadHighScores();
}
Symbol 205 Button
on (release) {
_parent._parent.closeOptions();
}
Symbol 206 Button
on (release) {
_parent._parent.loadUpdates();
}
Symbol 218 MovieClip [proj_enemy_steel] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
body._rotation = body._rotation + rate;
if ((boundaryTimer--) < 0) {
boundaryTimer = 50;
if ((((_x < xmin) || (_x > xmax)) || (_y < ymin)) || (_y > ymax)) {
destroy();
}
}
_parent._parent.testHitDragon(this);
}
function takeDamage(amt, xp, yp) {
_parent._parent.addScore(50, _x, _y);
var _local2 = _parent._parent.addObj("explosion_pow", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local2._x = _x;
_local2._y = _y;
_local2._rotation = random(360);
_local2._xscale = (_local2._yscale = _xscale * 1.5);
destroy();
}
function destroy() {
_parent._parent.removeEnemy(this);
}
m_type = "steel";
rate = 11;
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
boundaryTimer = 50;
Instance of Symbol 217 MovieClip "body" in Symbol 218 MovieClip [proj_enemy_steel] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 103 MovieClip "hitBox" in Symbol 218 MovieClip [proj_enemy_steel] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 221 MovieClip Frame 1
stop();
Symbol 222 MovieClip [explosion_pow] Frame 1
function step() {
frameCount = frameCount + frameRate;
if (frameCount >= maxFrame) {
this.unloadMovie();
} else {
anim.gotoAndStop(Math.floor(frameCount));
}
}
var frameCount = 1;
var frameRate = 1;
var maxFrame = 20;
anim._rotation = random(360);
Instance of Symbol 221 MovieClip "anim" in Symbol 222 MovieClip [explosion_pow] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 228 MovieClip Frame 1
stop();
Symbol 229 MovieClip Frame 1
function setPercent(num) {
bar._width = num;
}
Symbol 230 MovieClip [air_enemy_steel] Frame 1
function updateStickies(sticky) {
trace("Updating Stickies");
if ((++m_stickyNdx) >= m_maxStickies) {
m_stickyNdx = 0;
}
trace("Sticky Array: " + m_stickies);
var _local1 = m_stickies[m_stickyNdx];
_local1.unloadMovie();
m_stickies[m_stickyNdx] = sticky;
}
function step() {
if (hp_bar._alpha > 0) {
hp_bar._alpha = hp_bar._alpha - 5;
}
if ((timeToTarget--) < 0) {
m_target_x = random(_parent._parent.g_width);
m_target_y = random(_parent._parent.g_ground);
timeToTarget = 200;
}
var _local2 = 2;
if (!isDead()) {
updateCannon();
if ((m_target_x > _x) && (vx < _local2)) {
vx = vx + 0.05;
} else if ((m_target_x < _x) && (vx > (-_local2))) {
vx = vx - 0.05;
}
if ((m_target_y > _y) && (vy < _local2)) {
vy = vy + 0.02;
} else if ((m_target_y < _y) && (vy > (-_local2))) {
vy = vy - 0.02;
}
if (vx > 0) {
_xscale = -100;
} else {
_xscale = 100;
}
} else {
vy = vy + 0.08;
_rotation = (_rotation - 0.2);
}
updatePosition();
if (_y > (_parent._parent.g_ground + 100)) {
destroy();
}
}
function updateCannon() {
if ((shootTimer--) < 0) {
shootTimer = 300;
_parent._parent.shootAtDragonProjectile(_x, _y, 2, "proj_enemy_steel");
}
}
function updatePosition() {
_x = (_x + vx);
_y = (_y + vy);
}
function takeDamage(amt, xp, yp) {
if (!killed) {
trace("Taking Damage");
hp = hp - amt;
if (hp <= 0) {
killed = true;
hp = 0;
var _local3 = _parent._parent.addObj("ammo_box_steel", _parent._parent.ammo_layer, _parent._parent.getNextAmmoLevel());
_local3._x = _x;
_local3._y = _y;
_parent._parent.addScore(500, _x, _y);
} else {
hp_bar.bar._width = (hp / max_hp) * 100;
hp_bar._alpha = 100;
}
if (_parent._parent.g_dmg_text_on) {
var _local2 = _parent._parent.addObj("dmg_text", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2._x = xp;
_local2._y = yp;
_local2.val = amt;
}
}
}
function isDead() {
return(hp == 0);
}
function setHP(num) {
hp = num;
}
function destroy() {
_parent._parent.removeEnemy(this);
}
m_target_x = 0;
m_target_y = 0;
vx = -0.6;
vy = 0;
max_hp = Math.floor(50 * (1 + (_parent._parent.g_level / 100)));
hp = max_hp;
shootTimer = 300;
etype = "steel";
timeToTarget = 0;
killed = false;
var m_maxStickies = 3;
var m_stickies = new Array(m_maxStickies);
var m_stickyNdx = 0;
Instance of Symbol 224 MovieClip in Symbol 230 MovieClip [air_enemy_steel] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 103 MovieClip "hitBox" in Symbol 230 MovieClip [air_enemy_steel] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 233 MovieClip [air_enemy_snot] Frame 1
function updateStickies(sticky) {
trace("Updating Stickies");
if ((++m_stickyNdx) >= m_maxStickies) {
m_stickyNdx = 0;
}
trace("Sticky Array: " + m_stickies);
var _local1 = m_stickies[m_stickyNdx];
_local1.unloadMovie();
m_stickies[m_stickyNdx] = sticky;
}
function step() {
if (hp_bar._alpha > 0) {
hp_bar._alpha = hp_bar._alpha - 5;
}
if ((timeToTarget--) < 0) {
m_target_x = random(_parent._parent.g_width);
m_target_y = random(_parent._parent.g_ground);
timeToTarget = 200;
}
var _local2 = 2;
if (!isDead()) {
updateCannon();
if ((m_target_x > _x) && (vx < _local2)) {
vx = vx + 0.05;
} else if ((m_target_x < _x) && (vx > (-_local2))) {
vx = vx - 0.05;
}
if ((m_target_y > _y) && (vy < _local2)) {
vy = vy + 0.02;
} else if ((m_target_y < _y) && (vy > (-_local2))) {
vy = vy - 0.02;
}
if (vx > 0) {
_xscale = -100;
} else {
_xscale = 100;
}
} else {
vy = vy + 0.08;
_rotation = (_rotation - 0.2);
}
updatePosition();
if (_y > (_parent._parent.g_ground + 100)) {
destroy();
}
}
function updateCannon() {
if ((shootTimer--) < 0) {
shootTimer = 300;
_parent._parent.shootAtDragonProjectile(_x, _y, 2, "proj_enemy_ice");
}
}
function updatePosition() {
_x = (_x + vx);
_y = (_y + vy);
}
function takeDamage(amt, xp, yp) {
if (!killed) {
trace("Taking Damage");
hp = hp - amt;
if (hp <= 0) {
killed = true;
hp = 0;
var _local3 = _parent._parent.addObj("ammo_box_snot", _parent._parent.ammo_layer, _parent._parent.getNextAmmoLevel());
_local3._x = _x;
_local3._y = _y;
_parent._parent.addScore(500, _x, _y);
} else {
hp_bar.bar._width = (hp / max_hp) * 100;
hp_bar._alpha = 100;
}
if (_parent._parent.g_dmg_text_on) {
var _local2 = _parent._parent.addObj("dmg_text", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2._x = xp;
_local2._y = yp;
_local2.val = amt;
}
}
}
function isDead() {
return(hp == 0);
}
function setHP(num) {
hp = num;
}
function destroy() {
_parent._parent.removeEnemy(this);
}
m_target_x = 0;
m_target_y = 0;
vx = -0.6;
vy = 0;
max_hp = Math.floor(50 * (1 + (_parent._parent.g_level / 100)));
hp = max_hp;
shootTimer = 300;
etype = "snot";
timeToTarget = 0;
killed = false;
var m_maxStickies = 3;
var m_stickies = new Array(m_maxStickies);
var m_stickyNdx = 0;
Instance of Symbol 232 MovieClip in Symbol 233 MovieClip [air_enemy_snot] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 103 MovieClip "hitBox" in Symbol 233 MovieClip [air_enemy_snot] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 236 MovieClip [air_enemy_meteor] Frame 1
function updateStickies(sticky) {
trace("Updating Stickies");
if ((++m_stickyNdx) >= m_maxStickies) {
m_stickyNdx = 0;
}
trace("Sticky Array: " + m_stickies);
var _local1 = m_stickies[m_stickyNdx];
_local1.unloadMovie();
m_stickies[m_stickyNdx] = sticky;
}
function step() {
if (hp_bar._alpha > 0) {
hp_bar._alpha = hp_bar._alpha - 5;
}
if ((timeToTarget--) < 0) {
m_target_x = random(_parent._parent.g_width);
m_target_y = random(_parent._parent.g_ground);
timeToTarget = 200;
}
var _local2 = 2;
if (!isDead()) {
updateCannon();
if ((m_target_x > _x) && (vx < _local2)) {
vx = vx + 0.05;
} else if ((m_target_x < _x) && (vx > (-_local2))) {
vx = vx - 0.05;
}
if ((m_target_y > _y) && (vy < _local2)) {
vy = vy + 0.02;
} else if ((m_target_y < _y) && (vy > (-_local2))) {
vy = vy - 0.02;
}
if (vx > 0) {
_xscale = -100;
} else {
_xscale = 100;
}
} else {
vy = vy + 0.08;
_rotation = (_rotation - 0.2);
}
updatePosition();
if (_y > (_parent._parent.g_ground + 100)) {
destroy();
}
}
function updateCannon() {
if ((shootTimer--) < 0) {
shootTimer = 300;
_parent._parent.shootAtDragonProjectile(_x, _y, 2, "proj_enemy_fire");
}
}
function updatePosition() {
_x = (_x + vx);
_y = (_y + vy);
}
function takeDamage(amt, xp, yp) {
if (!killed) {
trace("Taking Damage");
hp = hp - amt;
if (hp <= 0) {
killed = true;
hp = 0;
var _local3 = _parent._parent.addObj("ammo_box_meteor", _parent._parent.ammo_layer, _parent._parent.getNextAmmoLevel());
_local3._x = _x;
_local3._y = _y;
_parent._parent.addScore(600, _x, _y);
} else {
hp_bar.bar._width = (hp / max_hp) * 100;
hp_bar._alpha = 100;
}
if (_parent._parent.g_dmg_text_on) {
var _local2 = _parent._parent.addObj("dmg_text", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2._x = xp;
_local2._y = yp;
_local2.val = amt;
}
}
}
function isDead() {
return(hp == 0);
}
function setHP(num) {
hp = num;
}
function destroy() {
_parent._parent.removeEnemy(this);
}
m_target_x = 0;
m_target_y = 0;
vx = -0.6;
vy = 0;
max_hp = Math.floor(50 * (1 + (_parent._parent.g_level / 100)));
hp = max_hp;
shootTimer = 300;
etype = "meteor";
timeToTarget = 0;
killed = false;
var m_maxStickies = 3;
var m_stickies = new Array(m_maxStickies);
var m_stickyNdx = 0;
Instance of Symbol 235 MovieClip in Symbol 236 MovieClip [air_enemy_meteor] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 103 MovieClip "hitBox" in Symbol 236 MovieClip [air_enemy_meteor] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 242 MovieClip [air_enemy_ice] Frame 1
function updateStickies(sticky) {
trace("Updating Stickies");
if ((++m_stickyNdx) >= m_maxStickies) {
m_stickyNdx = 0;
}
trace("Sticky Array: " + m_stickies);
var _local1 = m_stickies[m_stickyNdx];
_local1.unloadMovie();
m_stickies[m_stickyNdx] = sticky;
}
function step() {
if (hp_bar._alpha > 0) {
hp_bar._alpha = hp_bar._alpha - 5;
}
if ((timeToTarget--) < 0) {
m_target_x = random(_parent._parent.g_width);
m_target_y = random(_parent._parent.g_ground);
timeToTarget = 200;
}
var _local2 = 2;
if (!isDead()) {
updateCannon();
if ((m_target_x > _x) && (vx < _local2)) {
vx = vx + 0.05;
} else if ((m_target_x < _x) && (vx > (-_local2))) {
vx = vx - 0.05;
}
if ((m_target_y > _y) && (vy < _local2)) {
vy = vy + 0.02;
} else if ((m_target_y < _y) && (vy > (-_local2))) {
vy = vy - 0.02;
}
if (vx > 0) {
_xscale = -100;
} else {
_xscale = 100;
}
} else {
vy = vy + 0.08;
_rotation = (_rotation - 0.2);
}
updatePosition();
if (_y > (_parent._parent.g_ground + 100)) {
destroy();
}
}
function updateCannon() {
if ((shootTimer--) < 0) {
shootTimer = 300;
_parent._parent.shootAtDragonProjectile(_x, _y, 2, "proj_enemy_ice");
}
}
function updatePosition() {
_x = (_x + vx);
_y = (_y + vy);
}
function takeDamage(amt, xp, yp) {
if (!killed) {
trace("Taking Damage");
hp = hp - amt;
if (hp <= 0) {
killed = true;
hp = 0;
var _local3 = _parent._parent.addObj("ammo_box_ice", _parent._parent.ammo_layer, _parent._parent.getNextAmmoLevel());
_local3._x = _x;
_local3._y = _y;
_parent._parent.addScore(400, _x, _y);
} else {
hp_bar.bar._width = (hp / max_hp) * 100;
hp_bar._alpha = 100;
}
if (_parent._parent.g_dmg_text_on) {
var _local2 = _parent._parent.addObj("dmg_text", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2._x = xp;
_local2._y = yp;
_local2.val = amt;
}
}
}
function isDead() {
return(hp == 0);
}
function setHP(num) {
hp = num;
}
function destroy() {
_parent._parent.removeEnemy(this);
}
m_target_x = 0;
m_target_y = 0;
vx = -0.6;
vy = 0;
max_hp = Math.floor(50 * (1 + (_parent._parent.g_level / 100)));
hp = max_hp;
shootTimer = 300;
etype = "ice";
timeToTarget = 0;
killed = false;
var m_maxStickies = 3;
var m_stickies = new Array(m_maxStickies);
var m_stickyNdx = 0;
Instance of Symbol 241 MovieClip in Symbol 242 MovieClip [air_enemy_ice] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 103 MovieClip "hitBox" in Symbol 242 MovieClip [air_enemy_ice] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 250 MovieClip [air_enemy_greese] Frame 1
function updateStickies(sticky) {
trace("Updating Stickies");
if ((++m_stickyNdx) >= m_maxStickies) {
m_stickyNdx = 0;
}
trace("Sticky Array: " + m_stickies);
var _local1 = m_stickies[m_stickyNdx];
_local1.unloadMovie();
m_stickies[m_stickyNdx] = sticky;
}
function step() {
if (hp_bar._alpha > 0) {
hp_bar._alpha = hp_bar._alpha - 5;
}
if ((timeToTarget--) < 0) {
m_target_x = random(_parent._parent.g_width);
m_target_y = random(_parent._parent.g_ground);
timeToTarget = 200;
}
var _local2 = 2;
if (!isDead()) {
updateCannon();
if ((m_target_x > _x) && (vx < _local2)) {
vx = vx + 0.05;
} else if ((m_target_x < _x) && (vx > (-_local2))) {
vx = vx - 0.05;
}
if ((m_target_y > _y) && (vy < _local2)) {
vy = vy + 0.02;
} else if ((m_target_y < _y) && (vy > (-_local2))) {
vy = vy - 0.02;
}
if (vx > 0) {
_xscale = -100;
} else {
_xscale = 100;
}
} else {
vy = vy + 0.08;
_rotation = (_rotation - 0.2);
}
updatePosition();
if (_y > (_parent._parent.g_ground + 100)) {
destroy();
}
}
function updateCannon() {
if ((shootTimer--) < 0) {
shootTimer = 300;
_parent._parent.shootAtDragonProjectile(_x, _y, 2, "proj_enemy_steel");
}
}
function updatePosition() {
_x = (_x + vx);
_y = (_y + vy);
}
function takeDamage(amt, xp, yp) {
if (!killed) {
trace("Taking Damage");
hp = hp - amt;
if (hp <= 0) {
killed = true;
hp = 0;
var _local3 = _parent._parent.addObj("ammo_box_greese", _parent._parent.ammo_layer, _parent._parent.getNextAmmoLevel());
_local3._x = _x;
_local3._y = _y;
_parent._parent.addScore(500, _x, _y);
} else {
hp_bar.bar._width = (hp / max_hp) * 100;
hp_bar._alpha = 100;
}
if (_parent._parent.g_dmg_text_on) {
var _local2 = _parent._parent.addObj("dmg_text", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2._x = xp;
_local2._y = yp;
_local2.val = amt;
}
}
}
function isDead() {
return(hp == 0);
}
function setHP(num) {
hp = num;
}
function destroy() {
_parent._parent.removeEnemy(this);
}
m_target_x = 0;
m_target_y = 0;
vx = -0.6;
vy = 0;
max_hp = Math.floor(50 * (1 + (_parent._parent.g_level / 100)));
hp = max_hp;
shootTimer = 300;
etype = "greese";
timeToTarget = 0;
killed = false;
var m_maxStickies = 3;
var m_stickies = new Array(m_maxStickies);
var m_stickyNdx = 0;
Instance of Symbol 249 MovieClip in Symbol 250 MovieClip [air_enemy_greese] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 103 MovieClip "hitBox" in Symbol 250 MovieClip [air_enemy_greese] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 258 MovieClip [air_enemy_fire] Frame 1
function updateStickies(sticky) {
trace("Updating Stickies");
if ((++m_stickyNdx) >= m_maxStickies) {
m_stickyNdx = 0;
}
trace("Sticky Array: " + m_stickies);
var _local1 = m_stickies[m_stickyNdx];
_local1.unloadMovie();
m_stickies[m_stickyNdx] = sticky;
}
function step() {
if (hp_bar._alpha > 0) {
hp_bar._alpha = hp_bar._alpha - 5;
}
if ((timeToTarget--) < 0) {
m_target_x = random(_parent._parent.g_width);
m_target_y = random(_parent._parent.g_ground);
timeToTarget = 200;
}
var _local2 = 2;
if (!isDead()) {
updateCannon();
if ((m_target_x > _x) && (vx < _local2)) {
vx = vx + 0.05;
} else if ((m_target_x < _x) && (vx > (-_local2))) {
vx = vx - 0.05;
}
if ((m_target_y > _y) && (vy < _local2)) {
vy = vy + 0.02;
} else if ((m_target_y < _y) && (vy > (-_local2))) {
vy = vy - 0.02;
}
if (vx > 0) {
_xscale = -100;
} else {
_xscale = 100;
}
} else {
vy = vy + 0.08;
_rotation = (_rotation - 0.2);
}
updatePosition();
if (_y > (_parent._parent.g_ground + 100)) {
destroy();
}
}
function updateCannon() {
if ((shootTimer--) < 0) {
shootTimer = 300;
_parent._parent.shootAtDragonProjectile(_x, _y, 2, "proj_enemy_fire");
}
}
function updatePosition() {
_x = (_x + vx);
_y = (_y + vy);
}
function takeDamage(amt, xp, yp) {
if (!killed) {
trace("Taking Damage");
hp = hp - amt;
if (hp <= 0) {
killed = true;
hp = 0;
var _local3 = _parent._parent.addObj("ammo_box_fire", _parent._parent.ammo_layer, _parent._parent.getNextAmmoLevel());
_local3._x = _x;
_local3._y = _y;
_parent._parent.addScore(500, _x, _y);
} else {
hp_bar.bar._width = (hp / max_hp) * 100;
hp_bar._alpha = 100;
}
if (_parent._parent.g_dmg_text_on) {
var _local2 = _parent._parent.addObj("dmg_text", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2._x = xp;
_local2._y = yp;
_local2.val = amt;
}
}
}
function isDead() {
return(hp == 0);
}
function setHP(num) {
hp = num;
}
function destroy() {
_parent._parent.removeEnemy(this);
}
m_target_x = 0;
m_target_y = 0;
vx = -0.6;
vy = 0;
max_hp = Math.floor(20 * (1 + (_parent._parent.g_level / 100)));
hp = max_hp;
shootTimer = 300;
etype = "fire";
killed = false;
timeToTarget = 0;
killed = false;
var m_maxStickies = 3;
var m_stickies = new Array(m_maxStickies);
var m_stickyNdx = 0;
Instance of Symbol 257 MovieClip in Symbol 258 MovieClip [air_enemy_fire] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 103 MovieClip "hitBox" in Symbol 258 MovieClip [air_enemy_fire] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 260 MovieClip [meeter_hp] Frame 1
function setPercent(num) {
bar._width = num;
}
Symbol 261 MovieClip Frame 1
stop();
Symbol 262 MovieClip [smoke_2] Frame 1
function step() {
frameCount = frameCount + frameRate;
if (frameCount >= maxFrame) {
this.unloadMovie();
} else {
anim.gotoAndStop(Math.floor(frameCount));
}
}
var frameCount = 1;
var frameRate = 2;
var maxFrame = 100;
var rate = ((random(100) - 50) / 10);
Instance of Symbol 261 MovieClip "anim" in Symbol 262 MovieClip [smoke_2] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 263 MovieClip Frame 1
stop();
Symbol 264 MovieClip [smoke] Frame 1
function step() {
frameCount = frameCount + frameRate;
if (frameCount >= maxFrame) {
this.unloadMovie();
} else {
anim.gotoAndStop(Math.floor(frameCount));
}
}
var frameCount = 1;
var frameRate = 1;
var maxFrame = 100;
var rate = ((random(100) - 50) / 10);
Instance of Symbol 263 MovieClip "anim" in Symbol 264 MovieClip [smoke] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 265 MovieClip [proj_enemy_ice] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
_rotation = (_rotation + rate);
if ((boundaryTimer--) < 0) {
boundaryTimer = 50;
if ((((_x < xmin) || (_x > xmax)) || (_y < ymin)) || (_y > ymax)) {
this.unloadMovie();
}
}
_parent._parent.testHitDragon(this);
}
function destroy() {
this.unloadMovie();
}
m_type = "ice";
rate = (random(20) - 10) / 10;
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
boundaryTimer = 50;
Instance of Symbol 56 MovieClip in Symbol 265 MovieClip [proj_enemy_ice] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 268 MovieClip in Symbol 269 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = random(360);
}
Symbol 270 MovieClip [proj_enemy_fire] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
if ((boundaryTimer--) < 0) {
boundaryTimer = 50;
if ((((_x < xmin) || (_x > xmax)) || (_y < ymin)) || (_y > ymax)) {
this.unloadMovie();
}
}
if ((flameDebrisTimer--) < 0) {
flameDebrisTimer = 3;
var _local3 = _parent._parent.addObj("smoke_1", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local3._x = _x;
_local3._y = _y;
_local3._rotation = _rotation;
_local3._xscale = (_local3._yscale = 50);
}
_parent._parent.testHitDragon(this);
}
function destroy() {
this.unloadMovie();
}
m_type = "fire";
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if ((vx < 1E-5) && (vx > -1E-5)) {
_rotation = (_rotation + 180);
}
var flameDebrisTimer = 0;
boundaryTimer = 50;
Instance of Symbol 269 MovieClip in Symbol 270 MovieClip [proj_enemy_fire] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 271 MovieClip [ice_spark] Frame 1
function step() {
_xscale = (_xscale - decayRate);
_yscale = (_yscale - decayRate);
if (_xscale < 20) {
this.unloadMovie();
}
}
Instance of Symbol 56 MovieClip in Symbol 271 MovieClip [ice_spark] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 272 MovieClip [ice_ball] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting vx and vy: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
m_flightTime++;
vy = vy + _parent._parent.g_grav;
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if ((vx < 1E-5) && (vx > -1E-5)) {
_rotation = (_rotation + 180);
}
if ((boundaryTimer--) < 0) {
boundaryTimer = 25;
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
}
if ((flameDebrisTimer--) < 0) {
flameDebrisTimer = 0;
var _local3 = _parent._parent.addObj("ice_spark", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local3._x = _x;
_local3._y = _y;
_local3._rotation = random(360);
_local3._xscale = (_local3._yscale = 30 + (rank * 20));
_local3.decayRate = 6;
}
testHitEnemies();
}
function testHitEnemies() {
var _local4;
var _local5 = false;
var _local3 = 0;
while ((_local3 < _parent._parent.enemies.length) && (!_local5)) {
_local4 = _parent._parent.enemies[_local3];
if (_local4.hitBox.hitTest(_x, _y, 0)) {
_local5 = true;
break;
}
_local3++;
}
if (_local5) {
if (_local4.etype == "air_ship") {
_parent._parent.woodExplosion(_x, _y, Math.ceil(rank / 2));
_local4.testHitTroops(this);
}
var _local11 = 0;
var _local8 = 0;
var _local7 = 0;
var _local13 = true;
var _local9 = "ching2";
if (_local4.etype == "ice") {
_local8 = 0;
_local11 = 20;
_local7 = 0;
_local9 = "ching2.wav";
_local13 = false;
} else if (_local4.etype == "fire") {
_local8 = rank * 4;
_local11 = rank * 30;
_local7 = getFlightBonus(20) + 10;
_local9 = "shoot_rocket.wav";
} else if (_local4.etype == "meteor") {
_local8 = rank * 2;
_local11 = rank * 10;
_local7 = getFlightBonus(5) + 5;
_local9 = "shoot_rocket.wav";
} else {
_local8 = rank * 4;
_local11 = rank * 20;
_local7 = getFlightBonus(10) + 5;
_local9 = "ice_shatter.wav";
_parent._parent.addSticky("sticky_ice", _local4, _x, _y, 20 + (rank * 20));
}
_parent._parent.playSound(_local9);
_local4.takeDamage(_local8, _x, _y);
var _local10 = _parent._parent.addObj("explosion_pow_ice", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local10._x = _x;
_local10._y = _y;
_local10._rotation = random(360);
_local10._xscale = (_local10._yscale = _local11);
_parent._parent.updateRankIce(_local7);
if (!_local13) {
var _local6 = _parent._parent.addObj("deflect_ice", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local6._x = _x;
_local6._y = _y;
var _local12 = Math.sqrt((vx * vx) + (vy * vy)) * 0.75;
var _local14 = random(360);
_local6.vx = Math.cos((Math.PI/180) * _local14) * _local12;
_local6.vy = Math.sin((Math.PI/180) * _local14) * _local12;
_local6._xscale = (_local6._yscale = _xscale);
_local6.rank = rank;
}
this.unloadMovie();
}
}
function getFlightBonus(amt) {
var _local1 = m_flightTime / 10;
if (_local1 > 4) {
_local1 = 4;
}
return(Math.ceil(_local1 * amt));
}
xmax = _parent._parent.g_width + 10;
ymax = _parent._parent.g_ground + 10;
flameDebrisTimer = 0;
_rotation = random(360);
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
boundaryTimer = 50;
var m_flightTime = 0;
Instance of Symbol 45 MovieClip in Symbol 272 MovieClip [ice_ball] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 273 MovieClip [flame_spark] Frame 1
function step() {
_xscale = (_xscale - decayRate);
_yscale = (_yscale - decayRate);
if (_xscale < 20) {
this.unloadMovie();
}
}
Instance of Symbol 62 MovieClip in Symbol 273 MovieClip [flame_spark] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 274 MovieClip [flame_ball] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting vx and vy: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
m_flightTime++;
vy = vy + _parent._parent.g_grav;
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if ((vx < 1E-5) && (vx > -1E-5)) {
_rotation = (_rotation + 180);
}
if ((boundaryTimer--) < 0) {
boundaryTimer = 25;
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
}
if (((_x < -10) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if ((flameDebrisTimer--) < 0) {
flameDebrisTimer = 0;
var _local3 = _parent._parent.addObj("flame_spark", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local3._x = _x;
_local3._y = _y;
_local3._rotation = _rotation;
_local3._xscale = (_local3._yscale = 30 + (rank * 20));
_local3.decayRate = 6;
}
testHitEnemies();
}
function testHitEnemies() {
var _local4;
var _local5 = false;
var _local3 = 0;
while ((_local3 < _parent._parent.enemies.length) && (!_local5)) {
_local4 = _parent._parent.enemies[_local3];
if (_local4.hitBox.hitTest(_x, _y, 0)) {
_local5 = true;
break;
}
_local3++;
}
if (_local5) {
if (_local4.etype == "air_ship") {
_parent._parent.woodExplosion(_x, _y, Math.ceil(rank / 2.5));
_local4.testHitTroops(this);
}
var _local9;
var _local8 = false;
if (_local4.etype != "fire") {
if ((((_local4.etype == "air_ship") || (_local4.etype == "dragon_archer")) || (_local4.etype == "dragon_scout")) || (_local4.etype == "greese")) {
_parent._parent.addSticky("sticky_fire", _local4, _x, _y, 20 + (rank * 20));
_local4.takeDamage(rank * 2, _x, _y);
_local9 = rank * 10;
_parent._parent.updateRankFire(getFlightBonus(10) + 5);
_local8 = true;
_parent._parent.playSound("shoot_rocket.wav");
} else if (_local4.etype == "ice") {
_local4.takeDamage(rank * 5, _x, _y);
_local9 = rank * 20;
_parent._parent.updateRankFire(getFlightBonus(20) + 10);
_local8 = true;
_parent._parent.playSound("ice_shatter.wav");
} else if (_local4.etype == "steel") {
_local9 = 10;
_parent._parent.playSound("ching2.wav");
} else {
_local4.takeDamage(rank * 2, _x, _y);
_local9 = rank * 10;
_parent._parent.updateRankFire(getFlightBonus(10) + 5);
_local8 = true;
_parent._parent.playSound("shoot_rocket.wav");
}
var _local7 = _parent._parent.addObj("explosion_pow", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local7._x = _x;
_local7._y = _y;
_local7._rotation = random(360);
_local7._xscale = (_local7._yscale = _local9);
} else {
_local4.takeDamage(0, _x, _y);
_parent._parent.playSound("ching2.wav");
}
if (!_local8) {
var _local6 = _parent._parent.addObj("deflect_flame", _parent._parent.debris_layer, _parent._parent.getNextDebrisLevel());
_local6._x = _x;
_local6._y = _y;
var _local10 = Math.sqrt((vx * vx) + (vy * vy)) * 0.75;
var _local11 = random(360);
_local6.vx = Math.cos((Math.PI/180) * _local11) * _local10;
_local6.vy = Math.sin((Math.PI/180) * _local11) * _local10;
_local6._xscale = (_local6._yscale = _xscale);
_local6.rank = rank;
}
this.unloadMovie();
}
}
function getFlightBonus(amt) {
var _local1 = m_flightTime / 10;
if (_local1 > 4) {
_local1 = 4;
}
return(Math.ceil(_local1 * amt));
}
xmax = _parent._parent.g_width + 10;
ymax = _parent._parent.g_ground + 10;
flameDebrisTimer = 0;
xmax = _parent._parent.g_width + 50;
xmin = -50;
ymin = -50;
ymax = _parent._parent.g_ground + 50;
boundaryTimer = 50;
var m_flightTime = 0;
Instance of Symbol 49 MovieClip in Symbol 274 MovieClip [flame_ball] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 275 MovieClip [flame] Frame 1
function step() {
if (_y > 500) {
_y = (_y + 0.5);
}
testHitEnemies();
}
function testHitEnemies() {
var _local4;
var _local3 = false;
trace("_parent.enemies.length: " + _parent.enemies.length);
trace("_parent.enemies: " + _parent.enemies);
var _local2 = 0;
while ((_local2 < _parent.enemies.length) || (_local3)) {
_local4 = _parent.enemies[_local2];
_local3 = _local4.hitTest(_x, _y, 0);
trace("Checking");
_local2++;
}
if (_local3) {
_parent.removeEnemy(_local4);
}
}
endx = Math.floor((_x / _root.g_terWidth) * 2);
snow_clump = _root.g_heightField[endx];
Instance of Symbol 62 MovieClip in Symbol 275 MovieClip [flame] Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 278 MovieClip [ene_dragon_scout] Frame 1
function updateStickies(sticky) {
trace("Updating Stickies");
if ((++m_stickyNdx) >= m_maxStickies) {
m_stickyNdx = 0;
}
trace("Sticky Array: " + m_stickies);
var _local1 = m_stickies[m_stickyNdx];
_local1.unloadMovie();
m_stickies[m_stickyNdx] = sticky;
}
function step() {
if (hp_bar._alpha > 0) {
hp_bar._alpha = hp_bar._alpha - 5;
}
if (isDead()) {
vy = vy + 0.08;
_rotation = (_rotation - 0.2);
} else {
updateCannon();
}
updatePosition();
if ((_x < goal_xspot) && (!isDead())) {
vx = 0;
}
if (_y > (_parent._parent.g_ground + 100)) {
destroy();
}
if (_x < -50) {
destroy();
}
}
function updateCannon() {
if ((shootTimer--) < 0) {
shootTimer = 300;
_parent._parent.shootAtDragonProjectile(_x, _y, 2, "proj_enemy_ice");
}
}
function updatePosition() {
_x = (_x + vx);
_y = (_y + vy);
}
function takeDamage(amt, xp, yp) {
if (hp > 0) {
trace("Taking Damage");
hp = hp - amt;
if (hp <= 0) {
hp = 0;
_parent._parent.addScore(200, _x, _y);
if (random(6) == 0) {
var _local3 = _parent._parent.addObj("ammo_box_heal", _parent._parent.ammo_layer, _parent._parent.getNextAmmoLevel());
_local3._x = _x;
_local3._y = _y;
}
} else {
hp_bar.bar._width = (hp / max_hp) * 100;
hp_bar._alpha = 100;
}
if (_parent._parent.g_dmg_text_on) {
var _local2 = _parent._parent.addObj("dmg_text", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2._x = xp;
_local2._y = yp;
_local2.val = amt;
}
}
}
function isDead() {
return(hp == 0);
}
function setHP(num) {
hp = num;
}
function destroy() {
_parent._parent.removeEnemy(this);
}
function slowShooting(amt) {
shootTimer = shootTimer + amt;
if (shootTimer > 500) {
shootTimer = 500;
}
}
vx = -0.8;
vy = 0;
max_hp = Math.floor(10 * (1 + (_parent._parent.g_level / 100)));
hp = max_hp;
shootTimer = 300;
etype = "dragon_scout";
var m_maxStickies = 3;
var m_stickies = new Array(m_maxStickies);
var m_stickyNdx = 0;
Instance of Symbol 277 MovieClip in Symbol 278 MovieClip [ene_dragon_scout] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 103 MovieClip "hitBox" in Symbol 278 MovieClip [ene_dragon_scout] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 281 MovieClip [ene_dragon_archer] Frame 1
function updateStickies(sticky) {
trace("Updating Stickies");
if ((++m_stickyNdx) >= m_maxStickies) {
m_stickyNdx = 0;
}
trace("Sticky Array: " + m_stickies);
var _local1 = m_stickies[m_stickyNdx];
_local1.unloadMovie();
m_stickies[m_stickyNdx] = sticky;
}
function step() {
if (hp_bar._alpha > 0) {
hp_bar._alpha = hp_bar._alpha - 5;
}
if (isDead()) {
vy = vy + 0.08;
_rotation = (_rotation - 0.2);
} else {
updateCannon();
}
updatePosition();
if ((_x < goal_xspot) && (!isDead())) {
vx = 0;
}
if (_y > (_parent._parent.g_ground + 100)) {
destroy();
}
if (_x < -50) {
destroy();
}
}
function updateCannon() {
if ((shootTimer--) < 0) {
shootTimer = 300;
_parent._parent.shootAtDragonProjectile(_x, _y, 2, "proj_enemy_fire");
}
}
function updatePosition() {
_x = (_x + vx);
_y = (_y + vy);
}
function takeDamage(amt, xp, yp) {
if (hp > 0) {
trace("Taking Damage");
hp = hp - amt;
if (hp <= 0) {
hp = 0;
_parent._parent.addScore(200, _x, _y);
if (random(6) == 0) {
var _local3 = _parent._parent.addObj("ammo_box_heal", _parent._parent.ammo_layer, _parent._parent.getNextAmmoLevel());
_local3._x = _x;
_local3._y = _y;
}
} else {
hp_bar.bar._width = (hp / max_hp) * 100;
hp_bar._alpha = 100;
}
if (_parent._parent.g_dmg_text_on) {
var _local2 = _parent._parent.addObj("dmg_text", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2._x = xp;
_local2._y = yp;
_local2.val = amt;
}
}
}
function isDead() {
return(hp == 0);
}
function setHP(num) {
hp = num;
}
function destroy() {
_parent._parent.removeEnemy(this);
}
function slowShooting(amt) {
shootTimer = shootTimer + amt;
if (shootTimer > 500) {
shootTimer = 500;
}
}
vx = -0.6;
vy = 0;
max_hp = Math.floor(20 * (1 + (_parent._parent.g_level / 100)));
hp = max_hp;
shootTimer = 300;
etype = "dragon_archer";
var m_maxStickies = 3;
var m_stickies = new Array(m_maxStickies);
var m_stickyNdx = 0;
Instance of Symbol 280 MovieClip in Symbol 281 MovieClip [ene_dragon_archer] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 103 MovieClip "hitBox" in Symbol 281 MovieClip [ene_dragon_archer] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 284 MovieClip [deb_plank_4] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
vy = vy + 0.1;
_rotation = (_rotation + (vx * 10));
if (_y > ylimit) {
this.unloadMovie();
}
}
vx = (random(100) - 50) / 50;
vy = ((-random(100)) - 20) / 50;
ylimit = _parent._parent.g_ground + 50;
Instance of Symbol 283 MovieClip in Symbol 284 MovieClip [deb_plank_4] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 287 MovieClip [deb_plank_3] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
vy = vy + 0.1;
_rotation = (_rotation + (vx * 10));
if (_y > ylimit) {
this.unloadMovie();
}
}
vx = (random(100) - 50) / 50;
vy = ((-random(100)) - 20) / 50;
ylimit = _parent._parent.g_ground + 50;
Instance of Symbol 286 MovieClip in Symbol 287 MovieClip [deb_plank_3] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 290 MovieClip [deb_plank_2] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
vy = vy + 0.1;
_rotation = (_rotation + (vx * 10));
if (_y > ylimit) {
this.unloadMovie();
}
}
vx = (random(100) - 50) / 50;
vy = ((-random(100)) - 20) / 50;
ylimit = _parent._parent.g_ground + 50;
Instance of Symbol 289 MovieClip in Symbol 290 MovieClip [deb_plank_2] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 293 MovieClip [deb_plank_1] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
vy = vy + 0.1;
_rotation = (_rotation + (vx * 10));
if (_y > ylimit) {
this.unloadMovie();
}
}
vx = (random(100) - 50) / 50;
vy = ((-random(100)) - 20) / 50;
ylimit = _parent._parent.g_ground + 50;
Instance of Symbol 292 MovieClip in Symbol 293 MovieClip [deb_plank_1] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 296 MovieClip [deb_ene_foot] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
vy = vy + 0.1;
_rotation = (_rotation + (vx * 10));
if (_y > ylimit) {
this.unloadMovie();
}
}
vx = (random(100) - 50) / 50;
vy = ((-random(200)) - 50) / 50;
ylimit = _parent._parent.g_ground + 50;
Instance of Symbol 295 MovieClip in Symbol 296 MovieClip [deb_ene_foot] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 303 MovieClip [deb_ene_cat] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
vy = vy + 0.1;
_rotation = (_rotation + (vx * 10));
if (_y > ylimit) {
this.unloadMovie();
}
}
vx = (random(100) - 50) / 50;
vy = ((-random(200)) - 50) / 50;
ylimit = _parent._parent.g_ground + 50;
Instance of Symbol 302 MovieClip in Symbol 303 MovieClip [deb_ene_cat] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 316 MovieClip Frame 1
stop();
Symbol 316 MovieClip Frame 100
stop();
gotoAndPlay (1);
Symbol 316 MovieClip Frame 121
_parent.walking = true;
trace("start walking again");
Symbol 318 MovieClip [deb_ene_boss] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
vy = vy + 0.1;
_rotation = (_rotation + (vx * 10));
if (_y > ylimit) {
this.unloadMovie();
}
}
vx = (random(100) - 50) / 50;
vy = ((-random(200)) - 50) / 50;
ylimit = _parent._parent.g_ground + 50;
Instance of Symbol 317 MovieClip in Symbol 318 MovieClip [deb_ene_boss] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Symbol 321 MovieClip [deb_ene_archer] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
vy = vy + 0.1;
_rotation = (_rotation + (vx * 10));
if (_y > ylimit) {
this.unloadMovie();
}
}
vx = (random(100) - 50) / 50;
vy = ((-random(200)) - 50) / 50;
ylimit = _parent._parent.g_ground + 50;
Instance of Symbol 320 MovieClip in Symbol 321 MovieClip [deb_ene_archer] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 323 MovieClip "hitBox" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 323 MovieClip "hitBox" in Symbol 325 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 323 MovieClip "hitBox" in Symbol 327 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 323 MovieClip "hitBox" in Symbol 328 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 333 MovieClip in Symbol 334 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent._parent._parent.g_paused) {
_rotation = (_rotation + _parent._parent._parent.blade_spin_rate);
}
}
Symbol 352 MovieClip [cannon] Frame 1
var cannons = new Array(c1, c2, c3);
c1.ctype = "proj_enemy_fire";
c2.ctype = "proj_enemy_ice";
c3.ctype = "proj_enemy_steel";
var num_cannons = 3;
var cannonNdx = random(num_cannons);
var bod = cannons[cannonNdx];
var ndx = 0;
while (ndx < num_cannons) {
if (bod != cannons[ndx]) {
cannons[ndx]._alpha = 0;
}
ndx++;
}
var ammo = bod.ctype;
Symbol 353 MovieClip [air_ship2] Frame 1
function initGuns() {
var _local2 = 0;
while (_local2 < guns.length) {
var _local3 = _parent._parent.g_level * 5;
if (_local3 > 500) {
_local3 = 500;
}
var _local4 = (random(500) + 600) - _local3;
m_maxLoadTime = _local4;
guns[_local2].timerTarget = _local4;
guns[_local2].dead = false;
_local2++;
}
}
function step() {
if (hp_bar._alpha > 0) {
hp_bar._alpha = hp_bar._alpha - 5;
}
if (isDead()) {
vy = vy + 0.08;
_rotation = (_rotation - 0.2);
if (blade_spin_rate > 5) {
blade_spin_rate = blade_spin_rate - 0.4;
}
if ((smokeTimer--) < 0) {
smokeTimer = 1;
_parent._parent.addSmoke(_x, _y);
}
} else {
stepGuns();
}
updatePosition();
if ((_x < goal_xspot) && (!isDead())) {
if (vx < 0) {
vx = vx + 0.005;
} else {
vx = 0;
}
}
if (_y > (_parent._parent.g_ground + 100)) {
destroy();
}
}
function updatePosition() {
_x = (_x + vx);
_y = (_y + vy);
}
function takeDamage(amt, xp, yp) {
trace("Taking Damage");
hp = hp - amt;
if (hp <= 0) {
hp = 0;
if ((!dead) && (random(6) == 0)) {
var _local3 = _parent._parent.addObj("ammo_box_heal", _parent._parent.ammo_layer, _parent._parent.getNextAmmoLevel());
_local3._x = _x;
_local3._y = _y;
}
if (!dead) {
_parent._parent.addScore(1000, _x, _y);
}
dead = true;
}
if (_parent._parent.g_dmg_text_on) {
var _local2 = _parent._parent.addObj("dmg_text", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2._x = xp;
_local2._y = yp;
_local2.val = amt;
}
updateHPBar();
}
function updateHPBar() {
hp_bar.bar._width = (hp / max_hp) * 100;
hp_bar._alpha = 100;
}
function isDead() {
return(hp == 0);
}
function setHP(num) {
hp = num;
}
function destroy() {
_parent._parent.removeEnemy(this);
}
function stepGuns() {
if (m_rotRate < m_max_rotRate) {
m_rotRate = m_rotRate + 0.01;
}
var _local3 = 0;
while (_local3 < guns.length) {
gun = guns[_local3];
if ((!gun.dead) && ((gun.timerTarget--) < 200)) {
if (gun.timerTarget < 0) {
var _local4 = _parent._parent.g_level * 5;
if (_local4 > 500) {
_local4 = 500;
}
var _local2 = (random(500) + 600) - _local4;
m_maxLoadTime = _local2;
if (m_bossDead) {
_local2 = _local2 * 2;
}
gun.timerTarget = _local2;
shootAtDragon(gun);
gun.bod.barrel._x = -10;
} else {
aimAtDragon(gun);
}
}
if (gun.bod.barrel._x < 15.3) {
gun.bod.barrel._x = gun.bod.barrel._x + 0.5;
}
_local3++;
}
}
function shootAtDragon(gun) {
var _local7;
var _local15;
var _local14;
var _local9;
var _local8;
var _local10 = 2;
var _local11 = 10;
var _local5 = "";
var _local2;
var _local4;
_local7 = _parent._parent.getNextProjectileLevel();
_local5 = gun.ammo;
_local9 = Math.cos((gun._rotation * Math.PI) / 180);
_local8 = Math.sin((gun._rotation * Math.PI) / 180);
_local15 = _local9 * _local10;
_local14 = _local8 * _local10;
_local2 = _parent._parent.addObj(_local5, _parent._parent.bullet_layer, _local7);
if (_local5 == "proj_enemy_steel") {
_parent._parent.addEnemy(_local2);
}
var _local12 = (_x + gun._x) + (_local9 * _local11);
var _local13 = (_y + gun._y) + (_local8 * _local11);
_local2.vx = _local15;
_local2.vy = _local14;
_local2._x = _local12;
_local2._y = _local13;
var _local6 = 100 + _parent._parent.g_level;
if (_local6 > 200) {
_local6 = 200;
}
_local2._xscale = (_local2._yscale = _local6);
_parent._parent.playSound("bomb_hit.wav");
_local7 = _parent._parent.getNextDebrisLevel();
_local4 = _parent._parent.addObj("gun_flash", _parent._parent.debris_layer, _local7);
_local4._x = _local12;
_local4._y = _local13;
_local4._rotation = gun._rotation;
}
function aimAtDragon(gun) {
var _local2 = (_x + gun._x) - _parent._parent.dragon_head._x;
var _local5 = (_y + gun._y) - _parent._parent.dragon_head._y;
var _local7 = gun._rotation;
var _local3 = 0;
var _local4 = Math.atan(_local5 / _local2);
if (_local2 > 0) {
_local3 = ((_local4 * 180) / Math.PI) + 180;
if ((_local2 > 0) && (_local5 > 0)) {
_local3 = ((_local4 * 180) / Math.PI) - 180;
}
} else {
_local3 = (_local4 * 180) / Math.PI;
}
if ((_local2 < 1E-5) && (_local2 > -1E-5)) {
_local3 = _local3 + 180;
}
gun._rotation = _parent._parent.smartRotation(_local7, _local3, m_rotRate);
}
function testHitTroops(obj) {
if ((archer != null) && (archer.hitTest(obj._x, obj._y, 0))) {
m_archerDead = true;
archer.unloadMovie();
_parent._parent.addFlyingTroop("deb_ene_archer", obj._x, obj._y, archer._xscale, archer._yscale);
_parent._parent.addScore(100, obj._x, obj._y);
} else if ((boss != null) && (boss.hitTest(obj._x, obj._y, 0))) {
m_bossDead = true;
_parent._parent.addFlyingTroop("deb_ene_boss", _x, _y, archer._xscale, archer._yscale);
boss.unloadMovie();
_parent._parent.addScore(400, obj._x, obj._y);
} else if ((foot1 != null) && (foot1.hitTest(obj._x, obj._y, 0))) {
m_foot1Dead = true;
_parent._parent.addFlyingTroop("deb_ene_foot", obj._x, obj._y, archer._xscale, archer._yscale);
foot1.unloadMovie();
_parent._parent.addScore(200, obj._x, obj._y);
} else if ((foot2 != null) && (foot2.hitTest(obj._x, obj._y, 0))) {
m_foot2Dead = true;
_parent._parent.addFlyingTroop("deb_ene_foot", obj._x, obj._y, archer._xscale, archer._yscale);
foot2.unloadMovie();
_parent._parent.addScore(200, obj._x, obj._y);
} else if ((flagger != null) && (flagger.hitTest(obj._x, obj._y, 0))) {
m_flaggerDead = true;
_parent._parent.addFlyingTroop("deb_ene_cat", obj._x, obj._y, archer._xscale, archer._yscale);
flagger.unloadMovie();
_parent._parent.addScore(100, obj._x, obj._y);
}
updateGunState();
}
function updateGunState() {
gun1.dead = m_flaggerDead && (m_foot2Dead);
gun2.dead = m_bossDead;
gun3.dead = m_archerDead && (m_foot1Dead);
if ((((m_archerDead && (m_flaggerDead)) && (m_foot2Dead)) && (m_foot1Dead)) && (m_bossDead)) {
hp = 0;
}
}
function updateStickies(sticky) {
trace("Updating Stickies");
if ((++m_stickyNdx) >= m_maxStickies) {
m_stickyNdx = 0;
}
trace("Sticky Array: " + m_stickies);
var _local1 = m_stickies[m_stickyNdx];
_local1.unloadMovie();
m_stickies[m_stickyNdx] = sticky;
}
function slowShooting(amt) {
var _local2 = 0;
while (_local2 < guns.length) {
var _local1 = guns[_local2].timerTarget;
_local1.timerTarget = _local1.timerTarget + amt;
if (_local1.timerTarget > m_maxLoadTime) {
_local1.timerTarget = m_maxLoadTime;
}
_local2++;
}
if (((m_rotRate = m_rotRate - 0.05)) < 0.5) {
m_rotRate = 0.5;
}
}
vx = -0.5;
vy = 0;
max_hp = Math.floor(100 * (1 + (_parent._parent.g_level / 50)));
hp = max_hp;
smokeTimer = 0;
goal_xspot = 100 + random(_parent._parent.g_width - 200);
blade_spin_rate = 23;
etype = "air_ship";
m_archerDead = false;
m_foot1Dead = false;
m_foot2Dead = false;
m_bossDead = false;
m_flaggerDead = false;
dead = false;
var guns = new Array(gun1, gun2, gun3);
initGuns();
var m_maxStickies = 3;
var m_stickies = new Array(m_maxStickies);
var m_stickyNdx = 0;
var m_maxLoadTime;
var m_max_rotRate = (1 + (_parent._parent.g_level / 50));
var m_rotRate = m_max_rotRate;
Instance of Symbol 335 MovieClip in Symbol 353 MovieClip [air_ship2] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 337 MovieClip "hitBox" in Symbol 353 MovieClip [air_ship2] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 354 MovieClip [air_ship] Frame 1
function initGuns() {
var _local2 = 0;
while (_local2 < guns.length) {
var _local3 = _parent._parent.g_level * 5;
if (_local3 > 500) {
_local3 = 500;
}
var _local4 = (random(500) + 600) - _local3;
m_maxLoadTime = _local4;
guns[_local2].timerTarget = _local4;
guns[_local2].dead = false;
_local2++;
}
}
function step() {
if (hp_bar._alpha > 0) {
hp_bar._alpha = hp_bar._alpha - 5;
}
if (isDead()) {
vy = vy + 0.08;
if (blade_spin_rate > 5) {
blade_spin_rate = blade_spin_rate - 0.4;
}
_rotation = (_rotation + 0.2);
if ((smokeTimer--) < 0) {
smokeTimer = 2;
_parent._parent.addSmoke(_x, _y);
}
} else {
stepGuns();
}
updatePosition();
if ((_x > goal_xspot) && (!isDead())) {
if (vx > 0) {
vx = vx - 0.005;
} else {
vx = 0;
}
}
if (_y > (_parent._parent.g_ground + 100)) {
destroy();
}
}
function updateCannon() {
if ((shootTimer--) < 0) {
shootTimer = 300;
_parent._parent.shootAtDragon(_x, _y, 2);
}
}
function updatePosition() {
_x = (_x + vx);
_y = (_y + vy);
}
function takeDamage(amt, xp, yp) {
trace("Taking Damage");
hp = hp - amt;
if (hp <= 0) {
hp = 0;
if ((!dead) && (random(6) == 0)) {
var _local3 = _parent._parent.addObj("ammo_box_heal", _parent._parent.ammo_layer, _parent._parent.getNextAmmoLevel());
_local3._x = _x;
_local3._y = _y;
}
if (!dead) {
_parent._parent.addScore(1000, _x, _y);
}
dead = true;
}
if (_parent._parent.g_dmg_text_on) {
var _local2 = _parent._parent.addObj("dmg_text", _parent._parent.score_layer, _parent._parent.getNextScoreLevel());
_local2._x = xp;
_local2._y = yp;
_local2.val = amt;
}
updateHPBar();
}
function updateHPBar() {
hp_bar.bar._width = (hp / max_hp) * 100;
hp_bar._alpha = 100;
}
function isDead() {
return(hp == 0);
}
function setHP(num) {
hp = num;
}
function destroy() {
_parent._parent.removeEnemy(this);
}
function stepGuns() {
if (m_rotRate < m_max_rotRate) {
m_rotRate = m_rotRate + 0.01;
}
var _local3 = 0;
while (_local3 < guns.length) {
gun = guns[_local3];
if ((!gun.dead) && ((gun.timerTarget--) < 200)) {
if (gun.timerTarget < 0) {
var _local4 = _parent._parent.g_level * 5;
if (_local4 > 500) {
_local4 = 500;
}
var _local2 = (random(500) + 600) - _local4;
m_maxLoadTime = _local2;
if (m_bossDead) {
_local2 = _local2 * 2;
}
gun.timerTarget = _local2;
shootAtDragon(gun);
gun.bod.barrel._x = -10;
} else {
aimAtDragon(gun);
}
}
if (gun.bod.barrel._x < 15.3) {
gun.bod.barrel._x = gun.bod.barrel._x + 0.5;
}
_local3++;
}
}
function shootAtDragon(gun) {
var _local7;
var _local15;
var _local14;
var _local9;
var _local8;
var _local10 = 2;
var _local11 = 10;
var _local5 = "";
var _local2;
var _local4;
_local7 = _parent._parent.getNextProjectileLevel();
_local5 = gun.ammo;
_local9 = Math.cos((gun._rotation * Math.PI) / 180);
_local8 = Math.sin((gun._rotation * Math.PI) / 180);
_local15 = _local9 * _local10;
_local14 = _local8 * _local10;
_local2 = _parent._parent.addObj(_local5, _parent._parent.bullet_layer, _local7);
if (_local5 == "proj_enemy_steel") {
_parent._parent.addEnemy(_local2);
}
var _local12 = (_x + gun._x) + (_local9 * _local11);
var _local13 = (_y + gun._y) + (_local8 * _local11);
_local2.vx = _local15;
_local2.vy = _local14;
_local2._x = _local12;
_local2._y = _local13;
var _local6 = 100 + _parent._parent.g_level;
if (_local6 > 200) {
_local6 = 200;
}
_local2._xscale = (_local2._yscale = _local6);
_parent._parent.playSound("bomb_hit.wav");
_local7 = _parent._parent.getNextDebrisLevel();
_local4 = _parent._parent.addObj("gun_flash", _parent._parent.debris_layer, _local7);
_local4._x = _local12;
_local4._y = _local13;
_local4._rotation = gun._rotation;
}
function aimAtDragon(gun) {
var _local2 = (_x + gun._x) - _parent._parent.dragon_head._x;
var _local5 = (_y + gun._y) - _parent._parent.dragon_head._y;
var _local7 = gun._rotation;
var _local3 = 0;
var _local4 = Math.atan(_local5 / _local2);
if (_local2 > 0) {
_local3 = ((_local4 * 180) / Math.PI) + 180;
if ((_local2 > 0) && (_local5 > 0)) {
_local3 = ((_local4 * 180) / Math.PI) - 180;
}
} else {
_local3 = (_local4 * 180) / Math.PI;
}
if ((_local2 < 1E-5) && (_local2 > -1E-5)) {
_local3 = _local3 + 180;
}
gun._rotation = _parent._parent.smartRotation(_local7, _local3, m_rotRate);
}
function testHitTroops(obj) {
if ((archer != null) && (archer.hitTest(obj._x, obj._y, 0))) {
m_archerDead = true;
archer.unloadMovie();
_parent._parent.addFlyingTroop("deb_ene_archer", obj._x, obj._y, archer._xscale, archer._yscale);
_parent._parent.addScore(100, obj._x, obj._y);
} else if ((boss != null) && (boss.hitTest(obj._x, obj._y, 0))) {
m_bossDead = true;
_parent._parent.addFlyingTroop("deb_ene_boss", _x, _y, archer._xscale, archer._yscale);
boss.unloadMovie();
_parent._parent.addScore(400, obj._x, obj._y);
} else if ((foot1 != null) && (foot1.hitTest(obj._x, obj._y, 0))) {
m_foot1Dead = true;
_parent._parent.addFlyingTroop("deb_ene_foot", obj._x, obj._y, archer._xscale, archer._yscale);
foot1.unloadMovie();
_parent._parent.addScore(200, obj._x, obj._y);
} else if ((foot2 != null) && (foot2.hitTest(obj._x, obj._y, 0))) {
m_foot2Dead = true;
_parent._parent.addFlyingTroop("deb_ene_foot", obj._x, obj._y, archer._xscale, archer._yscale);
foot2.unloadMovie();
_parent._parent.addScore(200, obj._x, obj._y);
} else if ((flagger != null) && (flagger.hitTest(obj._x, obj._y, 0))) {
m_flaggerDead = true;
_parent._parent.addFlyingTroop("deb_ene_cat", obj._x, obj._y, archer._xscale, archer._yscale);
flagger.unloadMovie();
_parent._parent.addScore(100, obj._x, obj._y);
}
updateGunState();
}
function updateGunState() {
gun1.dead = m_flaggerDead && (m_foot2Dead);
gun2.dead = m_bossDead;
gun3.dead = m_archerDead && (m_foot1Dead);
if ((((m_archerDead && (m_flaggerDead)) && (m_foot2Dead)) && (m_foot1Dead)) && (m_bossDead)) {
hp = 0;
}
}
function updateStickies(sticky) {
trace("Updating Stickies");
if ((++m_stickyNdx) >= m_maxStickies) {
m_stickyNdx = 0;
}
trace("Sticky Array: " + m_stickies);
var _local1 = m_stickies[m_stickyNdx];
_local1.unloadMovie();
m_stickies[m_stickyNdx] = sticky;
}
function slowShooting(amt) {
var _local2 = 0;
while (_local2 < guns.length) {
var _local1 = guns[_local2].timerTarget;
_local1.timerTarget = _local1.timerTarget + amt;
if (_local1.timerTarget > m_maxLoadTime) {
_local1.timerTarget = m_maxLoadTime;
}
_local2++;
}
if (((m_rotRate = m_rotRate - 0.05)) < 0.5) {
m_rotRate = 0.5;
}
}
vx = 0.5;
vy = 0;
max_hp = Math.floor(100 * (1 + (_parent._parent.g_level / 50)));
hp = max_hp;
shootTimer = 300;
smokeTimer = 0;
goal_xspot = 100 + random(_parent._parent.g_width - 200);
blade_spin_rate = 23;
etype = "air_ship";
m_archerDead = false;
m_foot1Dead = false;
m_foot2Dead = false;
m_bossDead = false;
m_flaggerDead = false;
dead = false;
var guns = new Array(gun1, gun2, gun3);
initGuns();
var m_maxStickies = 3;
var m_stickies = new Array(m_maxStickies);
var m_stickyNdx = 0;
var m_maxLoadTime;
var m_max_rotRate = (1 + (_parent._parent.g_level / 50));
var m_rotRate = m_max_rotRate;
Instance of Symbol 335 MovieClip in Symbol 354 MovieClip [air_ship] Frame 1
onClipEvent (enterFrame) {
if (!_parent._parent._parent.g_paused) {
_parent.step();
}
}
Instance of Symbol 337 MovieClip "hitBox" in Symbol 354 MovieClip [air_ship] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 366 MovieClip in Symbol 367 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 390 MovieClip "hitBox" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 392 MovieClip "hitBox_ice" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 394 MovieClip in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 396 MovieClip "hitBox_ice" in Symbol 439 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 397 MovieClip "hitBox_fire" in Symbol 439 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 396 MovieClip "hitBox_ice" in Symbol 439 MovieClip Frame 75
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 397 MovieClip "hitBox_fire" in Symbol 439 MovieClip Frame 75
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 396 MovieClip "hitBox_ice" in Symbol 439 MovieClip Frame 165
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 397 MovieClip "hitBox_fire" in Symbol 439 MovieClip Frame 165
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 440 MovieClip "hitBox" in Symbol 441 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 396 MovieClip "hitBox_ice" in Symbol 519 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 397 MovieClip "hitBox_fire" in Symbol 519 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 396 MovieClip "hitBox_ice" in Symbol 519 MovieClip Frame 75
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 397 MovieClip "hitBox_fire" in Symbol 519 MovieClip Frame 75
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 396 MovieClip "hitBox_ice" in Symbol 519 MovieClip Frame 165
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 397 MovieClip "hitBox_fire" in Symbol 519 MovieClip Frame 165
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 440 MovieClip "hitBox" in Symbol 520 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 396 MovieClip "hitBox_ice" in Symbol 590 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 397 MovieClip "hitBox_fire" in Symbol 590 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 396 MovieClip "hitBox_ice" in Symbol 590 MovieClip Frame 75
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 397 MovieClip "hitBox_fire" in Symbol 590 MovieClip Frame 75
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 396 MovieClip "hitBox_ice" in Symbol 590 MovieClip Frame 165
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 397 MovieClip "hitBox_fire" in Symbol 590 MovieClip Frame 165
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 440 MovieClip "hitBox" in Symbol 591 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 600 MovieClip "hitBox_ice" in Symbol 622 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 601 MovieClip "hitBox_fire" in Symbol 622 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 600 MovieClip "hitBox_ice" in Symbol 622 MovieClip Frame 8
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 601 MovieClip "hitBox_fire" in Symbol 622 MovieClip Frame 8
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 600 MovieClip "hitBox_ice" in Symbol 622 MovieClip Frame 17
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 601 MovieClip "hitBox_fire" in Symbol 622 MovieClip Frame 17
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 103 MovieClip "hitBox" in Symbol 623 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 634 Button
on (release) {
loadGameGuide();
}
Symbol 641 MovieClip Frame 1
stop();
Instance of Symbol 639 MovieClip in Symbol 641 MovieClip Frame 1
onClipEvent (enterFrame) {
_yscale = (20 + (12 * _parent._parent.g_rank_fire));
_xscale = (20 + (12 * _parent._parent.g_rank_fire));
}
Instance of Symbol 337 MovieClip "hitBox" in Symbol 641 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 640 MovieClip in Symbol 641 MovieClip Frame 2
onClipEvent (enterFrame) {
_yscale = (20 + (12 * _parent._parent.g_rank_fire));
_xscale = (20 + (12 * _parent._parent.g_rank_fire));
}
Symbol 648 MovieClip Frame 1
stop();
Symbol 655 MovieClip Frame 1
stop();
Symbol 656 MovieClip Frame 1
stop();
Instance of Symbol 648 MovieClip in Symbol 656 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(_parent._parent.g_rank_ice);
}
Instance of Symbol 337 MovieClip "hitBox" in Symbol 656 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 655 MovieClip in Symbol 656 MovieClip Frame 2
onClipEvent (enterFrame) {
gotoAndStop(_parent._parent.g_rank_ice);
}
Symbol 663 MovieClip Frame 1
stop();
Instance of Symbol 661 MovieClip in Symbol 663 MovieClip Frame 1
onClipEvent (enterFrame) {
_yscale = (20 + (12 * _parent._parent.g_rank_meteor));
_xscale = (20 + (12 * _parent._parent.g_rank_meteor));
}
Instance of Symbol 337 MovieClip "hitBox" in Symbol 663 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 662 MovieClip in Symbol 663 MovieClip Frame 2
onClipEvent (enterFrame) {
_yscale = (20 + (12 * _parent._parent.g_rank_meteor));
_xscale = (20 + (12 * _parent._parent.g_rank_meteor));
}
Symbol 668 MovieClip Frame 1
stop();
Instance of Symbol 666 MovieClip in Symbol 668 MovieClip Frame 1
onClipEvent (enterFrame) {
_yscale = (20 + (12 * _parent._parent.g_rank_snot));
_xscale = (20 + (12 * _parent._parent.g_rank_snot));
}
Instance of Symbol 337 MovieClip "hitBox" in Symbol 668 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 667 MovieClip in Symbol 668 MovieClip Frame 2
onClipEvent (enterFrame) {
_yscale = (20 + (12 * _parent._parent.g_rank_snot));
_xscale = (20 + (12 * _parent._parent.g_rank_snot));
}
Symbol 673 MovieClip Frame 1
stop();
Instance of Symbol 671 MovieClip in Symbol 673 MovieClip Frame 1
onClipEvent (enterFrame) {
_yscale = (20 + (12 * _parent._parent.g_rank_greese));
_xscale = (20 + (12 * _parent._parent.g_rank_greese));
}
Instance of Symbol 337 MovieClip "hitBox" in Symbol 673 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 672 MovieClip in Symbol 673 MovieClip Frame 2
onClipEvent (enterFrame) {
_yscale = (20 + (12 * _parent._parent.g_rank_greese));
_xscale = (20 + (12 * _parent._parent.g_rank_greese));
}
Symbol 679 MovieClip Frame 1
stop();
Symbol 685 MovieClip Frame 1
stop();
Symbol 686 MovieClip Frame 1
stop();
Instance of Symbol 679 MovieClip in Symbol 686 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(_parent._parent.g_rank_steel);
}
Instance of Symbol 337 MovieClip "hitBox" in Symbol 686 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 685 MovieClip in Symbol 686 MovieClip Frame 2
onClipEvent (enterFrame) {
gotoAndStop(_parent._parent.g_rank_steel);
}
Symbol 692 Button
on (keyPress "<Space>") {
detonateSteel();
}
Instance of Symbol 632 MovieClip in Symbol 707 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 708 Button
on (release) {
if (!g_halted) {
g_paused = !g_paused;
updatePauseText();
}
}
on (keyPress "p") {
if (!g_halted) {
g_paused = !g_paused;
updatePauseText();
}
}
Symbol 710 Button
on (release) {
if (!g_halted) {
loadOptions();
}
}
Symbol 714 MovieClip [missile] Frame 1
function resetRanks() {
g_rank_snot = 1;
xp_snot = 0;
xp_max_snot = g_rank_factor;
xp_bar_snot.bar._width = 0;
g_rank_fire = 1;
xp_fire = 0;
xp_max_fire = g_rank_factor;
xp_bar_fire.bar._width = 0;
g_rank_ice = 1;
xp_ice = 0;
xp_max_ice = g_rank_factor;
xp_bar_ice.bar._width = 0;
g_rank_steel = 1;
xp_steel = 0;
xp_max_steel = g_rank_factor;
xp_bar_steel.bar._width = 0;
g_rank_greese = 1;
xp_greese = 0;
xp_max_greese = g_rank_factor;
xp_bar_greese.bar._width = 0;
g_rank_meteor = 1;
xp_meteor = 0;
xp_max_meteor = g_rank_factor;
xp_bar_meteor.bar._width = 0;
}
function initGameVars() {
g_levelTimer = 2000;
g_level = 1;
g_dragon_hp = 100;
g_dragon_max_hp = 100;
g_score = 0;
resetRanks();
}
function updateDragonHPBar() {
trace("Updating HP");
dragon_hp.bar._width = (g_dragon_hp / g_dragon_max_hp) * 100;
trace("dragon_hp.bar._width = " + dragon_hp.bar._width);
}
function deltaDragonHP(amt) {
trace("Amt: " + amt);
var _local2 = 0;
if (amt < 0) {
playSound("dragon_hurt4.wav");
}
g_dragon_hp = g_dragon_hp + amt;
if (g_dragon_hp > g_dragon_max_hp) {
_local2 = g_dragon_hp - g_dragon_max_hp;
g_dragon_hp = g_dragon_max_hp;
returnVal = amt - _local2;
} else if (g_dragon_hp < 0) {
g_dragon_hp = 0;
returnVal = amt;
} else {
returnVal = amt;
}
if (g_dragon_hp <= 0) {
gameOver();
}
updateDragonHPBar();
return(returnVal);
}
function getRandomPlankDebris() {
return(plankDebris[random(plankDebris.length)]);
}
function woodExplosion(xpos, ypos, amt) {
var _local3;
var _local1;
var _local2 = 0;
while (_local2 < amt) {
_local3 = getRandomPlankDebris();
_local1 = addObj(_local3, debris_layer, getNextDebrisLevel());
_local1._x = xpos;
_local1._y = ypos;
_local1._rotation = random(360);
_local2++;
}
}
function addFlyingTroop(troop, xpos, ypos, xscale, yscale) {
var _local1;
_local1 = addObj(troop, debris_layer, getNextDebrisLevel());
_local1._x = xpos;
_local1._y = ypos;
_local1._xscale = xscale;
_local1._yscale = yscale;
_local1._rotation = random(360);
}
function getWrapNdx(val) {
temp_ndx = sndx + val;
if (temp_ndx < 0) {
temp_ndx = max_ndx + temp_ndx;
}
return(temp_ndx);
}
function updateSpine() {
if ((sndx++) >= (max_ndx - 1)) {
sndx = 0;
}
xspine[sndx] = dragon_head._x;
yspine[sndx] = dragon_head._y;
rotspin[sndx] = dragon_head._rotation;
ztwist[sndx] = dragon_head._zrot;
}
function placeOnSpine(obj) {
var _local2;
ndx = getWrapNdx(obj.offset);
obj._x = xspine[ndx];
obj._y = yspine[ndx];
obj._rotation = rotspin[ndx];
_local2 = Math.ceil((ztwist[ndx] / 360) * 170);
obj.body.gotoAndStop(_local2);
}
function shoot() {
if (((((((g_ammo_fire > 0) && (g_shoot_mode == FIRE_MODE)) || ((g_ammo_ice > 0) && (g_shoot_mode == ICE_MODE))) || ((g_ammo_greese > 0) && (g_shoot_mode == GREESE_MODE))) || ((g_ammo_steel > 0) && (g_shoot_mode == STEEL_MODE))) || ((g_ammo_snot > 0) && (g_shoot_mode == SNOT_MODE))) || ((g_ammo_meteor > 0) && (g_shoot_mode == METEOR_MODE))) {
trace("shooting");
power = 16;
rads = ((dragon_head._rotation + 180) * Math.PI) / 180;
xfactor = Math.cos(rads);
yfactor = Math.sin(rads);
lvx = power * xfactor;
lvy = power * yfactor;
lvl = getNextProjectileLevel();
var _local1;
var _local2;
if (g_shoot_mode == FIRE_MODE) {
_local1 = addObj("flame_ball", bullet_layer, lvl);
g_ammo_fire--;
_local2 = g_rank_fire;
} else if (g_shoot_mode == ICE_MODE) {
_local1 = addObj("ice_ball", bullet_layer, lvl);
g_ammo_ice--;
_local2 = g_rank_ice;
} else if (g_shoot_mode == METEOR_MODE) {
_local1 = addObj("meteor_ball", bullet_layer, lvl);
_local2 = g_rank_meteor;
g_ammo_meteor--;
} else if (g_shoot_mode == STEEL_MODE) {
_local1 = addObj("steel_ball", bullet_layer, lvl);
g_steel_balls.push(_local1);
lvx = lvx * 0.5;
lvy = lvy * 0.5;
_local2 = g_rank_steel;
g_ammo_steel--;
} else if (g_shoot_mode == SNOT_MODE) {
_local1 = addObj("snot_ball", bullet_layer, lvl);
_local2 = g_rank_snot;
g_ammo_snot--;
} else if (g_shoot_mode == GREESE_MODE) {
_local1 = addObj("greese_ball", bullet_layer, lvl);
_local2 = g_rank_greese;
g_ammo_greese--;
}
if (g_shoot_mode != STEEL_MODE) {
_local1._xscale = (_local1._yscale = 30 + (_local2 * 20));
}
_local1.rank = _local2;
_local1.vx = lvx;
_local1.vy = lvy;
_local1._x = dragon_head._x + (xfactor * 20);
_local1._y = dragon_head._y + (yfactor * 20);
_local1._rotation = dragon_head._rotation + 180;
playSound("swoosh.wav");
} else {
playSound("dragon_hurt4.wav");
}
}
function shootAtDragon(xpos, ypos, speed) {
speed = 1 + (g_level / 33);
if (speed > 3) {
speed = 3;
}
trace("shooting at dragon");
var _local5;
var _local4;
var _local3;
var _local2;
_local3 = dragon_head._x - xpos;
_local2 = dragon_head._y - ypos;
dist = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
_local5 = (_local3 / dist) * speed;
_local4 = (_local2 / dist) * speed;
lvl = getNextProjectileLevel();
p_type = "";
if (random(2) == 0) {
p_type = "proj_enemy_fire";
} else {
p_type = "proj_enemy_ice";
}
proj = addObj(p_type, bullet_layer, lvl);
proj.vx = _local5;
proj.vy = _local4;
proj._x = xpos;
proj._y = ypos;
}
function shootAtDragonProjectile(xpos, ypos, speed, p_type) {
speed = 1 + (g_level / 33);
if (speed > 3) {
speed = 3;
}
trace("shooting at dragon");
var _local5;
var _local4;
var _local3;
var _local2;
_local3 = dragon_head._x - xpos;
_local2 = dragon_head._y - ypos;
dist = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
_local5 = (_local3 / dist) * speed;
_local4 = (_local2 / dist) * speed;
if (p_type == "proj_enemy_steel") {
lvl = getNextEnemyLevel();
proj = addObj(p_type, bullet_layer, lvl);
addEnemy(proj);
} else {
lvl = getNextProjectileLevel();
proj = addObj(p_type, bullet_layer, lvl);
}
proj.vx = _local5;
proj.vy = _local4;
proj._x = xpos;
proj._y = ypos;
}
function twistDragon() {
dragon_head.switchDiff();
}
function getNextProjectileLevel() {
if ((proj_lvl++) > 15) {
proj_lvl = 1;
}
return(proj_lvl);
}
function getNextStickyLevel() {
if ((sticky_lvl++) > 15) {
sticky_lvl = 1;
}
return(sticky_lvl);
}
function addObj(obj, layer, lvl) {
temp = layer.attachMovie(obj, (obj + "_id_") + getIDNum(), lvl);
return(temp);
}
function getIDNum() {
return(id_num++);
}
function getNextEnemyLevel() {
return(ene_lvl++);
}
function addEnemy(ene) {
trace("Enemy Added");
enemies.push(ene);
}
function removeEnemy(ene) {
var _local2;
var _local3 = -1;
var _local1 = 0;
while (_local1 < enemies.length) {
_local2 = enemies[_local1];
if (_local2 == ene) {
_local3 = _local1;
break;
}
_local1++;
}
if (_local3 != -1) {
enemies.splice(_local3, 1);
}
_local2.unloadMovie();
}
function addDragonPart(obj) {
m_dragonParts.push(obj);
}
function testHitDragon(obj) {
var _local4 = false;
var _local3;
var _local1 = 0;
while ((_local1 < m_dragonParts.length) && (!_local4)) {
_local3 = m_dragonParts[_local1];
_local4 = _local3.hitBox.hitTest(obj._x, obj._y, 1);
_local1++;
}
if (_local4) {
var _local5 = 0;
var _local7 = "";
if (obj.m_type == "fire") {
if (_local3.body.hitBox_fire.hitTest(obj._x, obj._y, 1)) {
deflectObject(_local3._rotation, obj, "meteor_ball", 0);
_local5 = 20;
} else {
deltaDragonHP(-1 - Math.floor(g_level / 2));
_local5 = obj._xscale;
}
_local7 = "explosion_pow";
playSound("bomb.wav");
} else if (obj.m_type == "ice") {
if (_local3.body.hitBox_ice.hitTest(obj._x, obj._y, 1)) {
deflectObject(_local3._rotation, obj, "ice_ball", 0);
_local5 = 20;
} else {
deltaDragonHP(-1 - Math.floor(g_level / 2));
_local5 = obj._xscale;
}
_local7 = "explosion_pow_ice";
playSound("ice_shatter.wav");
} else if (obj.m_type == "steel") {
deltaDragonHP(-1 - Math.floor(g_level / 1.5));
_local7 = "explosion_pow";
_local5 = obj._xscale * 1.5;
playSound("bomb_hit.wav");
}
if (_local7 != "") {
var _local6 = addObj(_local7, debris_layer, getNextDebrisLevel());
_local6._x = obj._x;
_local6._y = obj._y;
_local6._xscale = (_local6._yscale = _local5);
_local6._rotation = random(360);
}
obj.destroy();
}
}
function deflectObject(rot, obj, projName, angleOffset) {
var _local3 = getReflectionAngle(rot, obj.vx, obj.vy);
trace("Reflect: " + _local3);
var _local5 = Math.sqrt(((obj.vx * obj.vx) + obj.vy) + obj.vy);
var _local2 = addObj(projName, bullet_layer, getNextProjectileLevel());
_local2.vx = Math.cos(((Math.PI/180) * _local3) + angleOffset) * 5;
_local2.vy = Math.sin(((Math.PI/180) * _local3) + angleOffset) * 5;
_local2.rank = 1;
_local2._x = obj._x;
_local2._y = obj._y;
playSound("ching2.wav");
}
function deltaFireAmmo(amt) {
g_ammo_fire = g_ammo_fire + amt;
if (g_ammo_fire < 0) {
g_ammo_fire = 0;
}
}
function deltaIceAmmo(amt) {
g_ammo_ice = g_ammo_ice + amt;
if (g_ammo_ice < 0) {
g_ammo_ice = 0;
}
}
function deltaGreeseAmmo(amt) {
g_ammo_greese = g_ammo_greese + amt;
if (g_ammo_greese < 0) {
g_ammo_greese = 0;
}
}
function deltaMeteorAmmo(amt) {
g_ammo_meteor = g_ammo_meteor + amt;
if (g_ammo_meteor < 0) {
g_ammo_meteor = 0;
}
}
function deltaSnotAmmo(amt) {
g_ammo_snot = g_ammo_snot + amt;
if (g_ammo_snot < 0) {
g_ammo_snot = 0;
}
}
function deltaSteelAmmo(amt) {
g_ammo_steel = g_ammo_steel + amt;
if (g_ammo_steel < 0) {
g_ammo_steel = 0;
}
}
function updateSpeed() {
trace("updating speed");
d_speed = in_speed;
d_turn_rate = d_speed * 0.3;
dragon_head.g_missile_turn_rate = d_turn_rate;
dragon_head.g_missile_speed = d_speed;
}
function getNextDebrisLevel() {
if ((debris_lvl++) > 100) {
debris_lvl = 1;
}
return(debris_lvl);
}
function getNextAmmoLevel() {
if ((ammo_lvl++) > 7) {
ammo_lvl = 1;
}
return(ammo_lvl);
}
function getNextScoreLevel() {
if ((score_lvl++) > 10) {
score_lvl = 1;
}
return(score_lvl);
}
function testHitShips(obj) {
var _local4 = false;
var _local1;
var _local3 = 0;
while ((_local3 < enemies.length) && (!_local4)) {
_local1 = enemies[_local3];
if ((_local1 != obj) && (_local1.hitTest(obj))) {
_local4 = true;
if (!_local1.isDead()) {
_local1.takeDamage(1000);
obj = addObj("explosion_pow", debris_layer, getNextDebrisLevel());
obj._x = _local1._x;
obj._y = _local1._y;
obj._rotation = random(360);
}
}
_local3++;
}
}
function addSmoke(xpos, ypos) {
var _local1 = addObj("smoke", debris_layer, getNextDebrisLevel());
_local1._x = xpos;
_local1._y = ypos;
_local1._rotation = random(360);
}
function addDebris(dType, xpos, ypos, rot, scale) {
var _local1 = addObj(dType, debris_layer, getNextDebrisLevel());
_local1._x = xpos;
_local1._y = ypos;
_local1._rotation = rot;
_local1._xscale = (_local1._yscale = scale);
return(_local1);
}
function resetButtonIndicators() {
fire_button.gotoAndStop(1);
ice_button.gotoAndStop(1);
meteor_button.gotoAndStop(1);
snot_button.gotoAndStop(1);
greese_button.gotoAndStop(1);
steel_button.gotoAndStop(1);
}
function switchToFire() {
g_shoot_mode = FIRE_MODE;
g_shoot_mode_text = "fire ball";
resetButtonIndicators();
fire_button.gotoAndStop(2);
}
function switchToIce() {
g_shoot_mode = ICE_MODE;
g_shoot_mode_text = "ice ball";
resetButtonIndicators();
ice_button.gotoAndStop(2);
}
function switchToMeteor() {
g_shoot_mode = METEOR_MODE;
g_shoot_mode_text = "meteor ball";
resetButtonIndicators();
meteor_button.gotoAndStop(2);
}
function switchToSnot() {
g_shoot_mode = SNOT_MODE;
g_shoot_mode_text = "snot ball";
resetButtonIndicators();
snot_button.gotoAndStop(2);
}
function switchToGreese() {
g_shoot_mode = GREESE_MODE;
g_shoot_mode_text = "greese ball";
resetButtonIndicators();
greese_button.gotoAndStop(2);
}
function switchToSteel() {
g_shoot_mode = STEEL_MODE;
g_shoot_mode_text = "steel ball";
resetButtonIndicators();
steel_button.gotoAndStop(2);
}
function detonateSteel() {
var _local3;
var _local5;
var _local6 = 0;
var _local2;
var _local4 = 0;
while (_local4 < g_steel_balls.length) {
_local2 = g_steel_balls[_local4];
_local3 = _local2.rank + 1;
_local5 = 360 / _local3;
if (_local3 == 7) {
lvl = getNextProjectileLevel();
proj = addObj("steel_ball_single", bullet_layer, lvl);
proj.vx = _local2.vx;
proj.vy = _local2.vy;
proj._x = _local2._x;
proj._y = _local2._y;
}
var _local1 = 0;
while (_local1 < _local3) {
addSteelBall(_local2, _local1 * _local5);
_local1++;
}
_local2.unloadMovie();
_local4++;
}
playSound("deflect.wav");
g_steel_balls = new Array();
}
function addSteelBall(tempBall, degreeOffset) {
power = 2;
rads = (((degreeOffset + tempBall._rotation) - 90) * Math.PI) / 180;
xfactor = Math.cos(rads);
yfactor = Math.sin(rads);
lvx = power * xfactor;
lvy = power * yfactor;
lvl = getNextProjectileLevel();
proj = addObj("steel_ball_single", bullet_layer, lvl);
proj.vx = lvx + tempBall.vx;
proj.vy = lvy + tempBall.vy;
proj._x = tempBall._x + (xfactor * 5);
proj._y = tempBall._y + (yfactor * 5);
}
function removeFromSteelBalls(clip) {
var _local2;
var _local3 = -1;
var _local1 = 0;
while (_local1 < g_steel_balls.length) {
_local2 = g_steel_balls[_local1];
if (_local2 == clip) {
_local3 = _local1;
break;
}
_local1++;
}
if (_local3 != -1) {
g_steel_balls.splice(_local3, 1);
}
}
function addSticky(stickyName, obj, xp, yp, sz) {
var _local3 = getNextStickyLevel();
var _local1 = addObj(stickyName, sticky_layer, _local3);
_local1.x_offset = xp - obj._x;
_local1.y_offset = yp - obj._y;
_local1.m_size = sz;
_local1._xscale = (_local1._yscale = 0);
_local1.stuckTo = obj;
_local1._x = xp;
_local1._y = yp;
_local1.stype = stickyName;
obj.updateStickies(_local1);
checkStickyReactions(obj, _local1);
}
function checkStickyReactions(obj, stick) {
var _local2;
var _local3 = 0;
while (_local3 < obj.m_stickies.length) {
_local2 = obj.m_stickies[_local3];
trace("stick type: " + stick.stype);
if (_local2 != stick) {
trace("temp type: " + _local2.stype);
trace("stick type: " + stick.stype);
if ((stick.stype == "sticky_ice") && (_local2.stype == "sticky_fire")) {
stick.m_size = (_local2.m_size = 1);
} else if ((stick.stype == "sticky_fire") && (_local2.stype == "sticky_ice")) {
stick.m_size = (_local2.m_size = 1);
} else if ((stick.stype == "sticky_fire") && (_local2.stype == "sticky_greese")) {
stick.m_size = stick.m_size * 1.5;
_local2.m_size = 1;
var _local4 = addObj("explosion_pow", debris_layer, getNextDebrisLevel());
_local4._x = stick._x;
_local4._y = stick._y;
_local4._rotation = random(360);
trace("Fire React!");
} else if ((stick.stype == "sticky_greese") && (_local2.stype == "sticky_fire")) {
_local2.m_size = _local2.m_size * 1.5;
stick.m_size = 1;
var _local4 = addObj("explosion_pow", debris_layer, getNextDebrisLevel());
_local4._x = stick._x;
_local4._y = stick._y;
_local4._rotation = random(360);
trace("Oil React!");
}
}
trace("Checking Sticky: " + _local3);
_local3++;
}
}
function updateRankSteel(amt) {
xp = g_width / 2;
yp = g_ground / 2;
trace("updating steel rank: " + amt);
if (g_rank_steel < 6) {
if (((xp_steel = xp_steel + amt)) > xp_max_steel) {
xp_steel = xp_steel - xp_max_steel;
g_rank_steel++;
xp_max_steel = g_rank_steel * g_rank_factor;
var _local1 = addObj("xp_text", score_layer, getNextScoreLevel());
_local1._x = xp;
_local1._y = yp;
_local1.val = "steel level up!";
playSound("level_up03.wav");
}
if (g_rank_steel < 6) {
xp_bar_steel.bar._width = (xp_steel / xp_max_steel) * 100;
} else {
xp_bar_steel.bar.gotoAndStop(2);
xp_bar_steel.bar._width = 100;
}
}
}
function updateRankFire(amt) {
xp = g_width / 2;
yp = g_ground / 2;
trace("updating fire rank: " + amt);
if (g_rank_fire < 6) {
if (((xp_fire = xp_fire + amt)) > xp_max_fire) {
xp_fire = xp_fire - xp_max_fire;
g_rank_fire++;
xp_max_fire = g_rank_fire * g_rank_factor;
var _local1 = addObj("xp_text", score_layer, getNextScoreLevel());
_local1._x = xp;
_local1._y = yp;
_local1.val = "fire level up!";
playSound("level_up03.wav");
}
if (g_rank_fire < 6) {
xp_bar_fire.bar._width = (xp_fire / xp_max_fire) * 100;
} else {
xp_bar_fire.bar.gotoAndStop(2);
xp_bar_fire.bar._width = 100;
}
}
}
function updateRankIce(amt) {
xp = g_width / 2;
yp = g_ground / 2;
trace("updating ice rank: " + amt);
if (g_rank_ice < 6) {
if (((xp_ice = xp_ice + amt)) > xp_max_ice) {
xp_ice = xp_ice - xp_max_ice;
g_rank_ice++;
xp_max_ice = g_rank_ice * g_rank_factor;
var _local1 = addObj("xp_text", score_layer, getNextScoreLevel());
_local1._x = xp;
_local1._y = yp;
_local1.val = "ice level up!";
playSound("level_up03.wav");
}
if (g_rank_ice < 6) {
xp_bar_ice.bar._width = (xp_ice / xp_max_ice) * 100;
} else {
xp_bar_ice.bar.gotoAndStop(2);
xp_bar_ice.bar._width = 100;
}
}
}
function updateRankSnot(amt) {
xp = g_width / 2;
yp = g_ground / 2;
trace("updating snot rank: " + amt);
if (g_rank_snot < 6) {
if (((xp_snot = xp_snot + amt)) > xp_max_snot) {
xp_snot = xp_snot - xp_max_snot;
g_rank_snot++;
xp_max_snot = g_rank_snot * g_rank_factor;
var _local1 = addObj("xp_text", score_layer, getNextScoreLevel());
_local1._x = xp;
_local1._y = yp;
_local1.val = "snot level up!";
playSound("level_up03.wav");
}
if (g_rank_snot < 6) {
xp_bar_snot.bar._width = (xp_snot / xp_max_snot) * 100;
} else {
xp_bar_snot.bar.gotoAndStop(2);
xp_bar_snot.bar._width = 100;
}
}
}
function updateRankGreese(amt) {
xp = g_width / 2;
yp = g_ground / 2;
trace("updating greese rank: " + amt);
if (g_rank_greese < 6) {
if (((xp_greese = xp_greese + amt)) > xp_max_greese) {
xp_greese = xp_greese - xp_max_greese;
g_rank_greese++;
xp_max_greese = g_rank_greese * g_rank_factor;
var _local1 = addObj("xp_text", score_layer, getNextScoreLevel());
_local1._x = xp;
_local1._y = yp;
_local1.val = "grease level up!";
playSound("level_up03.wav");
}
if (g_rank_greese < 6) {
xp_bar_greese.bar._width = (xp_greese / xp_max_greese) * 100;
} else {
xp_bar_greese.bar.gotoAndStop(2);
xp_bar_greese.bar._width = 100;
}
}
}
function updateRankMeteor(amt) {
xp = g_width / 2;
yp = g_ground / 2;
trace("updating meteor rank: " + amt);
if (g_rank_meteor < 6) {
if (((xp_meteor = xp_meteor + amt)) > xp_max_meteor) {
xp_meteor = xp_meteor - xp_max_meteor;
g_rank_meteor++;
xp_max_meteor = g_rank_meteor * g_rank_factor;
var _local1 = addObj("xp_text", score_layer, getNextScoreLevel());
_local1._x = xp;
_local1._y = yp;
_local1.val = "grease level up!";
playSound("level_up03.wav");
}
if (g_rank_meteor < 6) {
xp_bar_meteor.bar._width = (xp_meteor / xp_max_meteor) * 100;
} else {
xp_bar_meteor.bar.gotoAndStop(2);
xp_bar_meteor.bar._width = 100;
}
}
}
function getReflectionAngle(ang, pvx, pvy) {
trace("Ang: " + ang);
trace("pvx: " + pvx);
trace("pvy: " + pvy);
var _local12 = Math.cos((Math.PI/180) * ang) * 100;
var _local11 = Math.sin((Math.PI/180) * ang) * 100;
var _local17 = 0;
var _local16 = 0;
var _local5 = -_local12;
var _local9 = -_local11;
var _local1 = _local12 + (_local5 / 2);
var _local4 = _local11 + (_local9 / 2);
var _local8 = _local1 - pvx;
var _local10 = _local4 - pvy;
var _local3 = _local8 - _local1;
var _local6 = _local10 - _local4;
var _local22 = Math.sqrt((_local3 * _local3) + (_local6 * _local6));
var _local2 = 0;
if (_local5 < 0) {
_local2 = 57.2957795130823 * Math.atan(_local9 / _local5);
} else {
_local2 = 180 + (57.2957795130823 * Math.atan(_local9 / _local5));
}
var _local13 = _local2 - 90;
var _local14 = 0;
if (_local3 > 0) {
_local14 = 57.2957795130823 * Math.atan(_local6 / _local3);
} else {
_local14 = 180 + (57.2957795130823 * Math.atan(_local6 / _local3));
}
var _local18 = _local1 + (Math.cos((Math.PI/180) * _local13) * 10);
var _local19 = _local4 + (Math.sin((Math.PI/180) * _local13) * 10);
var _local15 = getAngleBetweenVectors(_local1, _local4, _local17, _local16, _local8, _local10);
var _local20 = getAngleBetweenVectors(_local1, _local4, _local8, _local10, _local18, _local19);
var _local7 = 0;
if (_local20 > 90) {
_local7 = _local2 + _local15;
} else {
_local7 = _local2 - _local15;
}
trace(("Solution: " + _local7) + 180);
return(_local7);
}
function getAngleBetweenVectors(x1, y1, x2, y2, x3, y3) {
var _local3 = x2 - x1;
var _local2 = y2 - y1;
var _local1 = x3 - x1;
var _local4 = y3 - y1;
var _local5 = (_local3 * _local1) + (_local2 * _local4);
var _local7 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local6 = Math.sqrt((_local1 * _local1) + (_local4 * _local4));
return(57.2957795130823 * Math.acos(_local5 / (_local7 * _local6)));
}
function smartRotation(currentRotation, targetRotation, rotationAmount) {
if (Math.abs(currentRotation - targetRotation) <= rotationAmount) {
currentRotation = targetRotation;
} else if (currentRotation != targetRotation) {
if ((currentRotation >= 0) && (targetRotation >= 0)) {
if (currentRotation > targetRotation) {
currentRotation = currentRotation - rotationAmount;
} else if (currentRotation < targetRotation) {
currentRotation = currentRotation + rotationAmount;
}
} else if ((currentRotation < 0) && (targetRotation < 0)) {
if (currentRotation > targetRotation) {
currentRotation = currentRotation - rotationAmount;
} else if (currentRotation < targetRotation) {
currentRotation = currentRotation + rotationAmount;
}
} else if ((currentRotation < 0) && (targetRotation >= 0)) {
if ((Math.abs(currentRotation) + Math.abs(targetRotation)) <= 180) {
currentRotation = currentRotation + rotationAmount;
} else if ((Math.abs(currentRotation) + Math.abs(targetRotation)) > 180) {
currentRotation = currentRotation - rotationAmount;
}
} else if ((currentRotation >= 0) && (targetRotation < 0)) {
if ((Math.abs(currentRotation) + Math.abs(targetRotation)) < 180) {
currentRotation = currentRotation - rotationAmount;
} else if ((Math.abs(currentRotation) + Math.abs(targetRotation)) >= 180) {
currentRotation = currentRotation + rotationAmount;
}
}
}
return(currentRotation);
}
function getRotationDirection(currentRotation, targetRotation, rotationAmount) {
dir = 0;
if (Math.abs(currentRotation - targetRotation) <= rotationAmount) {
dir = 0;
} else if (currentRotation != targetRotation) {
if ((currentRotation >= 0) && (targetRotation >= 0)) {
if (currentRotation > targetRotation) {
dir = -1;
} else if (currentRotation < targetRotation) {
dir = 1;
}
} else if ((currentRotation < 0) && (targetRotation < 0)) {
if (currentRotation > targetRotation) {
dir = -1;
} else if (currentRotation < targetRotation) {
dir = 1;
}
} else if ((currentRotation < 0) && (targetRotation >= 0)) {
if ((Math.abs(currentRotation) + Math.abs(targetRotation)) <= 180) {
dir = 1;
} else if ((Math.abs(currentRotation) + Math.abs(targetRotation)) > 180) {
dir = -1;
}
} else if ((currentRotation >= 0) && (targetRotation < 0)) {
if ((Math.abs(currentRotation) + Math.abs(targetRotation)) < 180) {
dir = -1;
} else if ((Math.abs(currentRotation) + Math.abs(targetRotation)) >= 180) {
dir = 1;
}
}
}
return(dir);
}
function nextLevel() {
g_level++;
var _local1 = addObj("xp_text", score_layer, getNextScoreLevel());
_local1._x = g_width / 2;
_local1._y = g_ground / 2;
_local1.val = ("Level " + g_level) + "!";
playSound("level_up.wav");
}
function addScore(amt, xp, yp) {
g_score = g_score + amt;
var _local1 = addObj("dmg_text", score_layer, getNextScoreLevel());
_local1._x = xp;
_local1._y = yp;
_local1.val = "" + amt;
}
function playSound(filename) {
if (g_soundOn) {
mysound = new Sound();
mysound.attachSound(filename);
mysound.start(0, 1);
}
}
function loadOptions() {
g_halted = true;
g_paused = true;
g_window = addObj("window_options", window_layer, 1);
}
function closeOptions() {
g_halted = false;
g_paused = false;
updatePauseText();
g_window.unloadMovie();
}
function loadSponsors() {
trace("loading sponsors");
g_halted = true;
g_paused = true;
g_window = addObj("window_sponsors", window_layer, 1);
}
function closeSponsors() {
loadOptions();
}
function loadHighScores() {
trace("loading high scores");
g_halted = true;
g_paused = true;
g_window = addObj("window_scores", window_layer, 1);
}
function closeHighScores() {
loadOptions();
}
function toggleSound() {
if (g_soundOn) {
g_soundOn = false;
g_sound_text = "sound: off";
} else {
g_soundOn = true;
g_sound_text = "sound: on";
}
}
function loadGameGuide() {
trace("loading game guide");
getURL ("http://www.lostvectors.com/dragon/guide.html", "_blank");
}
function loadUpdates() {
trace("loading game updates");
g_halted = true;
g_paused = true;
g_window = addObj("window_updates", window_layer, 1);
}
function gameOver() {
updatedTopScores();
trace("loading game over");
g_halted = true;
g_paused = true;
g_window = addObj("window_game_over", window_layer, 1);
}
function loadGlobalScores() {
trace("loading global high scores");
getURL ("http://www.lostvectors.com/dragon/high_scores.html", "_blank");
}
function resetGame() {
_root.gotoAndPlay("start_game");
}
function saveData() {
trace("Saving Data");
myLocalSO.data.place_score_1 = _root.place_score_1;
myLocalSO.data.place_score_2 = _root.place_score_2;
myLocalSO.data.place_score_3 = _root.place_score_3;
myLocalSO.data.place_name_1 = _root.place_name_1;
myLocalSO.data.place_name_2 = _root.place_name_2;
myLocalSO.data.place_name_3 = _root.place_name_3;
myLocalSO.data.player_name = _root.player_name;
}
function updatedTopScores() {
var _local2 = g_score;
if (_local2 > _root.place_score_1) {
_root.place_score_3 = _root.place_score_2;
_root.place_score_2 = _root.place_score_1;
_root.place_score_1 = _local2;
_root.place_name_3 = _root.place_name_2;
_root.place_name_2 = _root.place_name_1;
_root.place_name_1 = _root.player_name;
_root.end_text = "New high score! 1st Place";
} else if (_local2 > _root.place_score_2) {
_root.place_score_3 = _root.place_score_2;
_root.place_score_2 = _local2;
_root.place_name_3 = _root.place_name_2;
_root.place_name_2 = _root.player_name;
_root.end_text = "New high score! 2nd Place";
} else if (_local2 > _root.place_score_3) {
_root.place_score_3 = _local2;
_root.place_name_3 = _root.player_name;
_root.end_text = "New high score! 3rd Place";
} else if (_local2 > 500000) {
_root.end_text = "Hail his majesty! King of the night sky! Your reign of terror will not soon be forgotten!";
} else if (_local2 > 100000) {
_root.end_text = "Hail the dragon prince of terror!";
} else if (_local2 > 50000) {
_root.end_text = "You are a fearsome dragon!";
} else if (_local2 > 30000) {
_root.end_text = "You're gaining the respect of your enemies.";
} else if (_local2 > 10000) {
_root.end_text = "Ouch... maybe you should try out as a good-luck dragon.";
} else {
_root.end_text = "Noob Tip: use mouse-left click to fire :P";
}
saveData();
}
function updatePauseText() {
if (g_paused) {
g_pause_text = "play";
} else {
g_pause_text = "pause";
}
}
var g_version = "1.0.1.2";
var KEY_W = 87;
var KEY_E = 69;
var KEY_Q = 81;
var KEY_A = 65;
var KEY_S = 83;
var KEY_D = 68;
var KEY_X = 67;
var KEY_C = 88;
var KEY_J = 74;
var KEY_K = 75;
var KEY_L = 76;
var KEY_U = 85;
var KEY_SPACEBAR = 32;
var FIRE_MODE = 1;
var ICE_MODE = 2;
var METEOR_MODE = 3;
var SNOT_MODE = 4;
var GREESE_MODE = 5;
var STEEL_MODE = 6;
var g_grav = 0.1;
var max_ndx = 140;
var yspine = new Array(max_ndx);
var xspine = new Array(max_ndx);
var rotspin = new Array(max_ndx);
var ztwist = new Array(max_ndx);
var enemies = new Array();
var m_dragonParts = new Array();
var g_paused = false;
var g_halted = false;
var g_pause_text = "pause";
var g_window = null;
var sndx = 0;
var in_speed = 3.4;
var d_speed = in_speed;
var d_turn_rate = (d_speed * 0.3);
var factor = 5;
var pulling = false;
var shot_fired = false;
var g_width = 728;
var g_ground = 500;
var someListener = new Object();
someListener.onMouseDown = function () {
pulling = true;
shot_fired = false;
};
Mouse.addListener(someListener);
var someListener2 = new Object();
someListener2.onMouseUp = function () {
pulling = false;
};
Mouse.addListener(someListener2);
var g_dragon_hp = 100;
var g_dragon_max_hp = 100;
var g_ammo_fire = 100;
var g_ammo_ice = 100;
var g_ammo_meteor = 100;
var g_ammo_snot = 100;
var g_ammo_steel = 100;
var g_ammo_greese = 100;
var g_rank_snot = 1;
var xp_snot;
var xp_max_snot;
var g_rank_fire = 1;
var xp_fire;
var xp_max_fire;
var g_rank_ice = 1;
var xp_ice;
var xp_max_ice;
var g_rank_steel = 1;
var xp_steel;
var xp_max_steel;
var g_rank_greese = 1;
var xp_greese;
var xp_max_greese;
var g_rank_meteor = 1;
var xp_meteor;
var xp_max_meteor;
var g_levelTimer = 0;
var g_level = 1;
var g_score = 0;
var g_rank_factor = 1000;
var g_dmg_text_on = false;
var g_sound_text = "sound: on";
var g_soundOn = true;
initGameVars();
var g_shoot_mode = FIRE_MODE;
var g_shoot_mode_text = "fire ball";
fire_button.gotoAndStop(2);
var plankDebris = new Array("deb_plank_1", "deb_plank_2", "deb_plank_3", "deb_plank_4");
var g_steel_balls = new Array();
proj_lvl = 1;
sticky_lvl = 1;
var id_num = 2;
var ene_lvl = 1;
var debris_lvl = 1;
var ammo_lvl = 1;
var score_lvl = 1;
_root.place_score_1 = 30000;
_root.place_score_2 = 20000;
_root.place_score_3 = 10000;
_root.place_name_1 = "Falkor";
_root.place_name_2 = "Onyxia";
_root.place_name_3 = "Smaug";
_root.player_name = "noob";
myLocalSO = SharedObject.getLocal("rd002");
if (myLocalSO.data.place_score_1 != null) {
trace("Shared Object Data Found... loading data");
_root.place_score_1 = myLocalSO.data.place_score_1;
_root.place_score_2 = myLocalSO.data.place_score_2;
_root.place_score_3 = myLocalSO.data.place_score_3;
_root.place_name_1 = myLocalSO.data.place_name_1;
_root.place_name_2 = myLocalSO.data.place_name_2;
_root.place_name_3 = myLocalSO.data.place_name_3;
_root.player_name = myLocalSO.data.player_name;
} else {
trace("no object found... loading default data");
_root.first_time_playing = true;
_root.place_score_1 = 30000;
_root.place_score_2 = 20000;
_root.place_score_3 = 10000;
_root.place_name_1 = "Falkor";
_root.place_name_2 = "Onyxia";
_root.place_name_3 = "Smaug";
_root.player_name = "noob";
}
Instance of Symbol 358 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 358 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.cacheAsBitmap = true;
}
onClipEvent (enterFrame) {
if (!_parent.g_paused) {
_x = (_x - 0.1);
if (_x < 0) {
_x = 728;
}
}
}
Instance of Symbol 360 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.cacheAsBitmap = true;
}
onClipEvent (enterFrame) {
if (!_parent.g_paused) {
_x = (_x - 0.5);
if (_x < 0) {
_x = 728;
}
}
}
Instance of Symbol 362 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg15._x;
_y = _parent.seg15._y;
_rotation = _parent.seg15._rotation;
_yscale = _parent.seg15._xscale;
_xscale = _parent.seg15._xscale;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg14._x;
_y = _parent.seg14._y;
_rotation = _parent.seg14._rotation;
_yscale = _parent.seg14._xscale;
_xscale = _parent.seg14._xscale;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
onClipEvent (enterFrame) {
_x = _parent.seg13._x;
_y = _parent.seg13._y;
_yscale = _parent.seg13._xscale;
_xscale = _parent.seg13._xscale;
_rotation = _parent.seg13._rotation;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg12._x;
_y = _parent.seg12._y;
_rotation = _parent.seg12._rotation;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg11._x;
_y = _parent.seg11._y;
_rotation = _parent.seg11._rotation;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg10._x;
_y = _parent.seg10._y;
_rotation = _parent.seg10._rotation;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg9._x;
_y = _parent.seg9._y;
_rotation = _parent.seg9._rotation;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg8._x;
_y = _parent.seg8._y;
_rotation = _parent.seg8._rotation;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg7._x;
_y = _parent.seg7._y;
_rotation = _parent.seg7._rotation;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg6._x;
_y = _parent.seg6._y;
_rotation = _parent.seg6._rotation;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg5._x;
_y = _parent.seg5._y;
_rotation = _parent.seg5._rotation;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg4._x;
_y = _parent.seg4._y;
_rotation = _parent.seg4._rotation;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg3._x;
_y = _parent.seg3._y;
_rotation = _parent.seg3._rotation;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg2._x;
_y = _parent.seg2._y;
_rotation = _parent.seg2._rotation;
}
Instance of Symbol 364 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.seg1._x;
_y = _parent.seg1._y;
_rotation = _parent.seg1._rotation;
}
Instance of Symbol 369 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
this.unloadMovie();
_x = _parent.dragon_head._x;
_y = _parent.dragon_head._y;
_rotation = _parent.dragon_head._rotation;
}
Instance of Symbol 395 MovieClip "seg15" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = (-15 * _parent.factor) + 6;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 441 MovieClip "seg14" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = (-14 * _parent.factor) + 3;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 441 MovieClip "seg13" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = (-13 * _parent.factor) + 1;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 441 MovieClip "seg12" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = -12 * _parent.factor;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 441 MovieClip "seg11" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = -11 * _parent.factor;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 441 MovieClip "seg10" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = -10 * _parent.factor;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 441 MovieClip "seg9" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = -9 * _parent.factor;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 520 MovieClip "seg8" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = -8 * _parent.factor;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 441 MovieClip "seg7" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = -7 * _parent.factor;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 441 MovieClip "seg6" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = -6 * _parent.factor;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 441 MovieClip "seg5" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = -5 * _parent.factor;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 441 MovieClip "seg4" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = -4 * _parent.factor;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 591 MovieClip "seg3" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = -3 * _parent.factor;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 441 MovieClip "seg2" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
offset = -2 * _parent.factor;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 441 MovieClip "seg1" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
_parent.addDragonPart(this);
xconnect = 0;
yconnect = 0;
rotprev = 0;
_zrot = 0;
offset = -1 * _parent.factor;
targetRotation = 0;
}
onClipEvent (enterFrame) {
_parent.placeOnSpine(this);
}
Instance of Symbol 595 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
_x = _parent.seg3._x;
_y = _parent.seg3._y;
_rotation = _parent.seg3._rotation;
this.unloadMovie();
}
Instance of Symbol 599 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
_x = _parent.seg8._x;
_y = _parent.seg8._y;
_rotation = _parent.seg8._rotation;
this.unloadMovie();
}
Instance of Symbol 623 MovieClip "dragon_head" in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
function checkShooting() {
timeToShoot++;
if ((_parent.pulling && (!_parent.shot_fired)) && (_parent._ymouse < (_parent.g_ground - 50))) {
if (timeToShoot > 10) {
_parent.shot_fired = true;
timeToShoot = 1;
_parent.shoot();
}
}
}
function switchDiff() {
trace("twist");
if (zdiff == 0) {
if (_zrot >= 180) {
zdiff = -1;
} else {
zdiff = 1;
}
} else {
zdiff = zdiff * -1;
}
}
function rotateRight() {
trace("Rotating Right");
_zrot = _zrot - 6;
if (_zrot < 0) {
_zrot = 360;
}
}
function rotateLeft() {
trace("Rotating Left");
_zrot = _zrot + 6;
if (_zrot > 360) {
_zrot = 0;
}
}
_parent.addDragonPart(this);
var g_missile_turn_rate = _parent.d_turn_rate;
var g_missile_speed = _parent.d_speed;
var g_neck_width = 10;
var dist = 0;
var rotprev = 0;
var xprev = 0;
var yprev = 0;
var xcur = 0;
var ycur = 0;
var xconnect = 0;
var yconnect = 0;
var dx = 0;
var dy = 0;
var vx = 0;
var vy = 0;
var sx_factor = 0;
var sy_factor = 0;
var xsprev = _x;
var ysprev = _y;
var seg_xprev = _x;
var seg_yprev = _y;
var s_dist = 0;
var spineRotation = 0;
var timeToShoot = 9999;
var _zrot = 1;
var zdiff = 1;
var rotFact = 57.2957795130823;
var pi = Math.PI;
}
onClipEvent (enterFrame) {
if (!_parent.g_paused) {
_parent.updateSpine();
xsprev = _x;
ysprev = _y;
dx = _root._xmouse - _x;
dy = _root._ymouse - _y;
dist = Math.sqrt((dx * dx) + (dy * dy));
if (dist == 0) {
dist = dist + 0.01;
}
vx = vx + ((g_missile_turn_rate * dx) / dist);
vy = vy + ((g_missile_turn_rate * dy) / dist);
normDist = Math.sqrt((vx * vx) + (vy * vy));
vx = (g_missile_speed * vx) / normDist;
vy = (g_missile_speed * vy) / normDist;
prevDist = newDist;
newDist = dist;
radians = Math.atan(vy / vx);
rotprev = _rotation;
rads = 0;
if (vx > 0) {
rads = radians + Math.PI;
_rotation = ((radians * rotFact) + 180);
} else {
rads = radians;
_rotation = (radians * rotFact);
}
if (Key.isDown(_parent.KEY_A)) {
rotateLeft();
} else if (Key.isDown(_parent.KEY_D)) {
rotateRight();
}
body.gotoAndStop(Math.ceil((_zrot / 360) * 19));
xprev = _x;
yprev = _y;
_x = (_x + vx);
_y = (_y + vy);
xcur = _x;
ycur = _y;
checkShooting();
}
}
Instance of Symbol 626 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
var enemyTimer = 0;
var speed_timer = 0;
var max_speed = 3.4;
}
onClipEvent (enterFrame) {
if ((!_parent.g_paused) && (!_parent.g_halted)) {
var lvl = _parent.getNextEnemyLevel();
var temp;
if ((_parent.enemies.length < 5) && ((enemyTimer--) < 0)) {
enemyTimer = 300 - (_parent.g_level * 2);
if (enemyTimer < 50) {
enemyTimer = 50;
}
var choice = random(8);
if (choice == 0) {
temp = _parent.addObj("air_ship", _parent.enemy_layer, _parent.getNextEnemyLevel());
temp._y = random(300) + 100;
temp._x = -100;
} else if (choice == 1) {
temp = _parent.addObj("air_ship2", _parent.enemy_layer, _parent.getNextEnemyLevel());
temp._y = random(300) + 100;
temp._x = _parent.g_width + 100;
} else if (choice == 2) {
temp = _parent.addObj("ene_dragon_archer", _parent.enemy_layer, _parent.getNextEnemyLevel());
temp._y = random(300) + 100;
temp._x = _parent.g_width + 100;
} else if (choice == 3) {
temp = _parent.addObj("ene_dragon_scout", _parent.enemy_layer, _parent.getNextEnemyLevel());
temp._y = random(300) + 100;
temp._x = _parent.g_width + 100;
} else {
var ammo_ene = new Array("air_enemy_fire", "air_enemy_ice", "air_enemy_greese", "air_enemy_snot", "air_enemy_meteor", "air_enemy_steel");
var eName = ammo_ene[random(ammo_ene.length)];
if (random(2) == 0) {
temp = _parent.addObj(eName, _parent.enemy_layer, _parent.getNextEnemyLevel());
temp._y = random(300) + 100;
temp._x = _parent.g_width + 100;
} else {
temp = _parent.addObj(eName, _parent.enemy_layer, _parent.getNextEnemyLevel());
temp._y = random(300) + 100;
temp._x = -100;
}
}
_parent.addEnemy(temp);
}
if ((_parent.g_levelTimer--) < 0) {
_parent.g_levelTimer = 2000;
_parent.nextLevel();
if (_parent.in_speed < max_speed) {
_parent.in_speed = _parent.in_speed + 0.04;
_parent.updateSpeed();
}
}
}
}
Instance of Symbol 628 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.cacheAsBitmap = true;
}
onClipEvent (enterFrame) {
if (!_parent.g_paused) {
_x = (_x - 1.2);
if (_x < 0) {
_x = 728;
}
}
}
Instance of Symbol 630 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.cacheAsBitmap = true;
}
onClipEvent (enterFrame) {
if (!_parent.g_paused) {
_x = (_x - 3);
if (_x < 0) {
_x = 728;
}
}
}
Instance of Symbol 641 MovieClip "fire_button" in Symbol 714 MovieClip [missile] Frame 1
on (keyPress "1") {
_parent.switchToFire();
}
on (release) {
_parent.switchToFire();
}
Instance of Symbol 656 MovieClip "ice_button" in Symbol 714 MovieClip [missile] Frame 1
on (keyPress "4") {
_parent.switchToIce();
}
on (release) {
_parent.switchToIce();
}
Instance of Symbol 354 MovieClip [air_ship] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 353 MovieClip [air_ship2] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 321 MovieClip [deb_ene_archer] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 318 MovieClip [deb_ene_boss] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 293 MovieClip [deb_plank_1] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 290 MovieClip [deb_plank_2] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 287 MovieClip [deb_plank_3] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 284 MovieClip [deb_plank_4] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 281 MovieClip [ene_dragon_archer] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 278 MovieClip [ene_dragon_scout] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 275 MovieClip [flame] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 274 MovieClip [flame_ball] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 273 MovieClip [flame_spark] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 272 MovieClip [ice_ball] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 271 MovieClip [ice_spark] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 270 MovieClip [proj_enemy_fire] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 265 MovieClip [proj_enemy_ice] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 264 MovieClip [smoke] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 663 MovieClip "meteor_button" in Symbol 714 MovieClip [missile] Frame 1
on (keyPress "3") {
_parent.switchToMeteor();
}
on (release) {
_parent.switchToMeteor();
}
Instance of Symbol 668 MovieClip "snot_button" in Symbol 714 MovieClip [missile] Frame 1
on (keyPress "5") {
_parent.switchToSnot();
}
on (release) {
_parent.switchToSnot();
}
Instance of Symbol 673 MovieClip "greese_button" in Symbol 714 MovieClip [missile] Frame 1
on (keyPress "2") {
_parent.switchToGreese();
}
on (release) {
_parent.switchToGreese();
}
Instance of Symbol 686 MovieClip "steel_button" in Symbol 714 MovieClip [missile] Frame 1
on (keyPress "6") {
_parent.switchToSteel();
}
on (release) {
_parent.switchToSteel();
}
Instance of Symbol 695 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 258 MovieClip [air_enemy_fire] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 250 MovieClip [air_enemy_greese] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 242 MovieClip [air_enemy_ice] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 236 MovieClip [air_enemy_meteor] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 233 MovieClip [air_enemy_snot] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 230 MovieClip [air_enemy_steel] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 281 MovieClip [ene_dragon_archer] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 278 MovieClip [ene_dragon_scout] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 218 MovieClip [proj_enemy_steel] in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 713 MovieClip in Symbol 714 MovieClip [missile] Frame 1
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Symbol 720 Button
on (rollOver) {
ad_text = "Gamer? Good.";
}
on (release) {
getURL ("http://www.tenemag.com/", "_blank");
}
Symbol 726 Button
on (rollOver) {
ad_text = "Visit ugotgames.com for fun flash games!";
}
on (release) {
getURL ("http://ugotgames.com/", "_blank");
}
Symbol 728 Button
on (rollOver) {
ad_text = "Sponsored by Jason's cousin Mike H. (lostvectors rocks)";
}
on (release) {
getURL ("http://www.lostvectors.com/", "_blank");
}
Symbol 731 Button
on (rollOver) {
ad_text = "If I have to I'll sponsor myself.";
}
on (release) {
getURL ("http://www.lostvectors.com/", "_blank");
}
Symbol 734 Button
on (rollOver) {
ad_text = "Bigfoots Troop of Power. We Want A Zombie Tonight.";
}
on (release) {
getURL ("http://www.purevolume.com/bigfootstroopofpower", "_blank");
}
Symbol 738 Button
on (rollOver) {
ad_text = "Forbidden Entertainment";
}
on (release) {
getURL ("http://kontraband.com/", "_blank");
}
Symbol 742 Button
on (rollOver) {
ad_text = "AODASoft.net, free software for windows.";
}
on (release) {
getURL ("http://AODASoft.net/", "_blank");
}
Symbol 745 Button
on (rollOver) {
ad_text = "RedReview - cool online game and website reviews";
}
on (release) {
getURL ("http://www.redreview.net", "_blank");
}
Symbol 746 Button
on (rollOver) {
ad_text = "This square is sponsored by the close button. Be glad.";
}
on (release) {
_parent._parent.closeSponsors();
}
Symbol 750 Button
on (rollOver) {
ad_text = "More Games";
}
on (release) {
getURL ("http://www.dragongamez.com/", "_blank");
}
Instance of Symbol 161 MovieClip in Symbol 753 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = _root.bow._rotation;
}
Symbol 760 MovieClip Frame 1
function step() {
_alpha = (_alpha - 3);
if (_alpha <= 0) {
this.unloadMovie();
}
}
Instance of Symbol 759 MovieClip in Symbol 760 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 761 MovieClip Frame 100
this.unloadMovie();
Instance of Symbol 754 MovieClip in Symbol 767 MovieClip Frame 25
on (release) {
getURL ("http://www.lostvectors.com", "_blank");
}
Instance of Symbol 764 MovieClip in Symbol 767 MovieClip Frame 124
onClipEvent (load) {
vx = 0;
gx = 0.2;
bounces = 0;
_alpha = 0;
}
onClipEvent (enterFrame) {
if (bounces < 5) {
if (_alpha < 100) {
_alpha = (_alpha + 2);
}
if (_x > 130) {
_x = 130;
bounces++;
vx = vx * -0.5;
}
vx = vx + gx;
_x = (_x + vx);
}
}
Instance of Symbol 766 MovieClip in Symbol 767 MovieClip Frame 124
onClipEvent (load) {
vx = 0;
gx = -0.2;
bounces = 0;
_alpha = 0;
}
onClipEvent (enterFrame) {
if (bounces < 5) {
if (_alpha < 100) {
_alpha = (_alpha + 2);
}
if (_x < 162) {
_x = 162;
bounces++;
vx = vx * -0.5;
}
vx = vx + gx;
_x = (_x + vx);
}
}
Symbol 768 Button
on (release) {
gotoAndPlay ("start_game");
}
on (rollOver) {
sponsor_mov.ad_text = "This square is sponsored by the close button. Be glad.";
}
Instance of Symbol 162 MovieClip in Symbol 783 MovieClip Frame 1
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}