Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
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);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
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);
}
if (_root._url.indexOf("kongregate.com") != -1) {
_root.kongregateServices.connect();
}
__com_mochibot__("82ef2c74", this, 10301, true);
Frame 2
gotoAndStop (4);
Frame 3
if (false) {
}
Frame 4
function sound(snd) {
var _local1 = new Sound(smc);
_local1.attachSound(snd);
_local1.start();
}
function sound_mc(snd, mc, vol) {
var _local1 = new Sound(mc);
_local1.attachSound(snd);
_local1.start();
if (vol) {
_local1.setVolume(vol);
}
}
function sound_loop(snd, loop) {
var _local1 = new Sound(smc);
_local1.attachSound(snd);
_local1.start(0, loop);
}
function point_sound(snd, x, vol) {
if (!vol) {
vol = 100;
}
var _local4 = -(_root.view_x - ((_root.w * 50) / view_scale));
var _local2 = (1 - (Math.abs(x - _local4) * 0.0005)) * vol;
_local2 = _root.limit(_local2, 0, 100);
snd.setVolume(_local2);
var _local3 = (x - _local4) * 0.1;
_local3 = _root.limit(_local3, -100, 100);
snd.setPan(_local3);
}
function sound_mc_point(snd, mc, x, vol) {
var _local2 = new Sound(mc);
_local2.attachSound(snd);
if (!vol) {
vol = 100;
}
var _local5 = -(_root.view_x - ((_root.w * 50) / view_scale));
var _local3 = (1 - (Math.abs(x - _local5) * 0.0005)) * vol;
_local3 = _root.limit(_local3, 0, 100);
_local2.setVolume(_local3);
var _local4 = (x - _local5) * 0.1;
_local4 = _root.limit(_local4, -100, 100);
_local2.setPan(_local4);
_local2.start();
}
function choose3(a, b, c) {
if (random(3000) < 1000) {
return(a);
}
if (random(2000) < 1000) {
return(b);
}
return(c);
}
function get_id_1_511() {
id++;
if (id > half_depth_band) {
id = 1;
}
return(id);
}
function get_id_512_1024() {
id++;
if (id >= depth_band) {
id = half_depth_band;
}
return(id);
}
function DistPoint(x1, y1, x2, y2) {
dx = x2 - x1;
dy = y2 - y1;
var _local1 = Math.sqrt((dx * dx) + (dy * dy));
if (_local1 <= 0.01) {
_local1 = 0.01;
}
return(_local1);
}
function DistLine(x1, y1, x2, y2, x, y) {
var _local3 = y1 - y2;
var _local2 = x2 - x1;
var _local1 = (x1 * y2) - (x2 * y1);
return(((_local3 * x) + (_local2 * y)) + _local1);
}
function direct(x, y) {
return((Math.atan2(y, x) * radtodeg) + 180);
}
function direct_knight(x, y) {
return(Math.atan2(knight.gety() - y, knight.getx() - x) * radtodeg);
}
function direct_knight_rad(x, y) {
return(Math.atan2(knight.gety() - y, knight.getx() - x));
}
function interpolate(a, b, k) {
return(a + ((b - a) * k));
}
function interpolate_angle(a, b, k) {
var _local1 = b - a;
while (_local1 > 180) {
_local1 = _local1 - 360;
}
while (_local1 < -180) {
_local1 = _local1 + 360;
}
return(a + (_local1 * k));
}
function limit(x, low, hi) {
if (x < low) {
x = low;
} else if (x > hi) {
x = hi;
}
return(x);
}
function sgn(x) {
if (x > 0) {
return(1);
}
return(-1);
}
function line(x1, y1, x2, y2, c, w, a) {
drawing.lineStyle(w, c, a);
drawing.moveTo(x1, y1);
drawing.lineTo(x2, y2);
}
function collide_aabb(a, b) {
dx = (a.x + a.w) - b.x;
if (dx < 0) {
return(false);
}
dx2 = a.x - (b.x + b.w);
if (dx2 > 0) {
return(false);
}
dy = (a.y + a.h) - b.y;
if (dy < 0) {
return(false);
}
dy2 = a.y - (b.y + b.h);
if (dy2 > 0) {
return(false);
}
if (Math.abs(dy) > Math.abs(dy2)) {
dy = dy2;
}
if (Math.abs(dx) > Math.abs(dx2)) {
dx = dx2;
}
if ((Math.abs(dx) > 0.1) && (Math.abs(dy) > 0.1)) {
if ((Math.abs(dx) + 0.1) < Math.abs(dy)) {
p.x = p.x - dx;
return(true);
}
p.y = p.y - dy;
return(true);
}
return(false);
}
function collide_beam_aabb(x, y, ex, ey, _aabb, l) {
var _local14 = Math.min(x, ex);
var _local12 = Math.min(y, ey);
var _local13 = Math.max(x, ex);
var _local11 = Math.max(y, ey);
if (((_aabb.x + _aabb.w) - _local14) < 0) {
return(false);
}
if ((_aabb.x - _local13) > 0) {
return(false);
}
if (((_aabb.y + _aabb.h) - _local12) < 0) {
return(false);
}
if ((_aabb.y - _local11) > 0) {
return(false);
}
_local14 = _aabb.x;
_local12 = _aabb.y;
_local13 = _aabb.x + _aabb.w;
_local11 = _aabb.y;
var _local17 = _aabb.x;
var _local19 = _aabb.y + _aabb.h;
var _local20 = _aabb.x + _aabb.w;
var _local18 = _aabb.y + _aabb.h;
var _local10 = false;
var _local9 = false;
if (_root.DistLine(x, y, ex, ey, _local14, _local12) > 0) {
_local9 = true;
} else {
_local10 = true;
}
if (_root.DistLine(x, y, ex, ey, _local13, _local11) > 0) {
_local9 = true;
} else {
_local10 = true;
}
if (_root.DistLine(x, y, ex, ey, _local17, _local19) > 0) {
_local9 = true;
} else {
_local10 = true;
}
if (_root.DistLine(x, y, ex, ey, _local20, _local18) > 0) {
_local9 = true;
} else {
_local10 = true;
}
if (!(_local10 && (_local9))) {
return(false);
}
var _local5 = 0;
if (!l) {
l = DistPoint(x, y, ex, ey);
}
var _local15 = (ex - x) / l;
var _local16 = (-(ey - y)) / l;
_local5 = -_root.DistLine(x, y, x + _local16, y + _local15, _local14, _local12);
if ((_local5 > 0) && (_local5 < l)) {
return(true);
}
_local5 = -_root.DistLine(x, y, x + _local16, y + _local15, _local13, _local11);
if ((_local5 > 0) && (_local5 < l)) {
return(true);
}
_local5 = -_root.DistLine(x, y, x + _local16, y + _local15, _local17, _local19);
if ((_local5 > 0) && (_local5 < l)) {
return(true);
}
_local5 = -_root.DistLine(x, y, x + _local16, y + _local15, _local20, _local18);
if ((_local5 > 0) && (_local5 < l)) {
return(true);
}
return(false);
}
function InGame(x, y, rx, ry) {
if ((x + rx) < left_border) {
return(false);
}
if ((x - rx) > right_border) {
return(false);
}
if ((heady + ry) < top_border) {
return(false);
}
if ((heady - ry) > bottom_border) {
return(false);
}
return(true);
}
function print_mc(mc, str) {
var _local2 = 0;
var _local6 = "";
for (var _local5 in mc) {
if (_local2 < str.length) {
var _local1 = str.charCodeAt(_local2);
if (_local1 >= 1040) {
_local1 = _local1 - 848;
}
mc[_local5].gotoAndStop(_local1 + 1);
} else {
mc[_local5].gotoAndStop(2);
}
_local2++;
}
}
function print_int(mc, val, digits) {
var _local4 = "" + int(val);
var _local5 = _local4.length;
var _local1 = 0;
while (_local1 < digits) {
var _local3 = mc["dig" + _local1];
var _local2 = 11;
if (_local1 < _local5) {
_local2 = _local4.charCodeAt(_local1) - 47;
}
if (_local3._currentframe != _local2) {
_local3.gotoAndStop(_local2);
}
_local1++;
}
}
function push_brick(mc, type, dx, dy, area) {
if (dx == undefined) {
dx = 0;
}
if (dy == undefined) {
dy = 0;
}
if (type == undefined) {
type = 0;
}
if (area == undefined) {
area = mc;
}
x1 = int((area._x + dx) / map_w);
x2 = int(((area._x + dx) + area._width) / map_w);
y1 = int((area._y + dy) / map_h);
y2 = int(((area._y + dy) + area._height) / map_h);
var _local3;
switch (type) {
case 0 :
_local3 = new Brick(mc, type, dx, dy);
break;
case t_slope_up_right :
_local3 = new SlopeUR(mc, type, dx, dy);
break;
case t_slope_up_left :
_local3 = new SlopeUL(mc, type, dx, dy);
break;
case t_breakable :
_local3 = new BreakableBrick(mc, type, dx, dy);
}
var _local2 = y1;
while (_local2 <= y2) {
var _local1 = x1;
while (_local1 <= x2) {
if (bricks[_local1] == undefined) {
bricks[_local1] = new Array();
}
if (bricks[_local1][_local2] == undefined) {
bricks[_local1][_local2] = new Array();
}
bricks[_local1][_local2].push(_local3);
_local1++;
}
_local2++;
}
return(_local3);
}
function push_static_brick(mc, type, dx, dy, area) {
if (dx == undefined) {
dx = 0;
}
if (dy == undefined) {
dy = 0;
}
if (type == undefined) {
type = 0;
}
if (area == undefined) {
area = mc;
}
x1 = int((area._x + dx) / map_w);
x2 = int(((area._x + dx) + area._width) / map_w);
y1 = int((area._y + dy) / map_h);
y2 = int(((area._y + dy) + area._height) / map_h);
var _local3;
switch (type) {
case 0 :
_local3 = new BrickStatic(mc, type, dx, dy);
break;
case t_slope_up_right :
_local3 = new SlopeUR(mc, type, dx, dy);
break;
case t_slope_up_left :
_local3 = new SlopeUL(mc, type, dx, dy);
}
var _local2 = y1;
while (_local2 <= y2) {
var _local1 = x1;
while (_local1 <= x2) {
if (bricks[_local1] == undefined) {
bricks[_local1] = new Array();
}
if (bricks[_local1][_local2] == undefined) {
bricks[_local1][_local2] = new Array();
}
bricks[_local1][_local2].push(_local3);
_local1++;
}
_local2++;
}
}
function push_platform(mc, type, dx, dy, area) {
if (dx == undefined) {
dx = 0;
}
if (dy == undefined) {
dy = 0;
}
if (type == undefined) {
type = 0;
}
if (area == undefined) {
area = mc;
}
x1 = int((area._x + dx) / map_w);
x2 = int(((area._x + dx) + area._width) / map_w);
y1 = int((area._y + dy) / map_h);
y2 = int(((area._y + dy) + area._height) / map_h);
var _local3;
switch (type) {
case -1 :
_local3 = new PlatformNoBulletCollide(mc, type, dx, dy);
break;
case 0 :
_local3 = new Platform(mc, type, dx, dy);
break;
case t_slope_up_right :
break;
case t_slope_up_left :
_local3 = new SlopePlatformUL(mc, type, dx, dy);
}
var _local2 = y1;
while (_local2 <= y2) {
var _local1 = x1;
while (_local1 <= x2) {
if (bricks[_local1] == undefined) {
bricks[_local1] = new Array();
}
if (bricks[_local1][_local2] == undefined) {
bricks[_local1][_local2] = new Array();
}
bricks[_local1][_local2].push(_local3);
_local1++;
}
_local2++;
}
return(_local3);
}
function collide(aabb) {
p.x = 0;
p.y = 0;
var _local5 = 0;
x1 = int(aabb.x / map_w);
x2 = int((aabb.x + aabb.w) / map_w);
y1 = int(aabb.y / map_h);
y2 = int((aabb.y + aabb.h) / map_h);
n_checks = 0;
var _local4 = y1;
while (_local4 <= y2) {
var _local2 = x1;
while (_local2 <= x2) {
var _local1 = 0;
while (_local1 < bricks[_local2][_local4].length) {
if (bricks[_local2][_local4][_local1].Collide(aabb)) {
aabb.x = aabb.x + p.x;
aabb.y = aabb.y + p.y;
_local5++;
}
_local1++;
}
_local2++;
}
_local4++;
}
if (_local5 < 1) {
return(false);
}
p.x = p.x / _local5;
p.y = p.y / _local5;
return(true);
}
function collide_point(px, py) {
x = int(px / map_w);
y = int(py / map_w);
test_aabb.x = px;
test_aabb.y = py;
test_aabb.w = 1;
test_aabb.h = 1;
p.x = 0;
p.y = 0;
var _local1 = 0;
while (_local1 < bricks[x][y].length) {
if (bricks[x][y][_local1].CollidePoint(px, py)) {
bricks[x][y][_local1].Collide(test_aabb);
return(true);
}
_local1++;
}
return(false);
}
function raytrace(x, y, vx, vy, step) {
var _local9 = vx * step;
var _local8 = vy * step;
ray_length = 0;
var _local5 = 0;
while (_local5 < 700) {
if (_root.collide_point(x, y)) {
var _local2 = (_root.p.x * vx) + (_root.p.y * vy);
_local2 = -Math.abs(_local2);
x = x + (_local2 * vx);
y = y + (_local2 * vy);
ray_length = ray_length + _local2;
break;
}
if (((((x + 100) < _root.left_border) || ((x - 100) > _root.right_border)) || ((y + 100) < _root.top_border)) || ((y - 100) > _root.bottom_border)) {
break;
}
x = x + _local9;
y = y + _local8;
ray_length = ray_length + step;
_local5++;
}
_root.p.x = x;
_root.p.y = y;
}
function PushObject(obj, spawner) {
var _local2 = int(obj.x / object_map_w);
var _local3 = int(obj.y / object_map_h);
if (object_map[_local2] == undefined) {
object_map[_local2] = new Array();
}
if (object_map[_local2][_local3] == undefined) {
object_map[_local2][_local3] = new Array();
}
object_map[_local2][_local3].push(obj);
if (spawner != undefined) {
spawner.swapDepths(_root.level.getNextHighestDepth());
removeMovieClip(spawner);
}
}
function IncludeObjects() {
var _local7 = int(left_border / object_map_w) - 1;
var _local5 = int(top_border / object_map_h) - 1;
var _local6 = int(right_border / object_map_w) + 1;
var _local4 = int(bottom_border / object_map_h) + 1;
var _local2 = _local7;
while (_local2 <= _local6) {
if (object_map[_local2] != undefined) {
var _local1 = _local5;
while (_local1 <= _local4) {
var _local3 = 0;
while (_local3 < object_map[_local2][_local1].length) {
objects.push(object_map[_local2][_local1][_local3]);
objects[objects.length - 1].UnFreeze();
_local3++;
}
if (object_map[_local2][_local1].length > 0) {
object_map[_local2][_local1].splice(0, object_map[_local2][_local1].length);
}
_local1++;
}
}
_local2++;
}
}
function ExcludeObjects() {
var _local5 = int(left_border / object_map_w) - 1;
var _local3 = int(top_border / object_map_h) - 1;
var _local4 = int(right_border / object_map_w) + 1;
var _local2 = int(bottom_border / object_map_h) + 1;
var _local1 = 0;
while (_local1 < objects.length) {
ox = int(objects[_local1].x / object_map_w);
oy = int(objects[_local1].y / object_map_h);
if ((((ox < _local5) || (ox > _local4)) || (oy < _local3)) || (oy > _local2)) {
if (objects[_local1].Freeze() == undefined) {
if (objects[_local1].Alive()) {
PushObject(objects[_local1]);
} else {
delete objects[_local1];
}
objects.splice(_local1, 1);
}
}
_local1++;
}
}
function PushBullet(b) {
p_bullets.push(b);
}
function CollideBullets(aabb) {
var _local2 = 0;
p.x = 0;
p.y = 0;
var _local1 = 0;
while (_local1 < p_bullets.length) {
if (p_bullets[_local1].life > 0) {
if (p_bullets[_local1].Collide(aabb)) {
p.x = p.x * -0.5;
p.y = p.y * -0.5;
p_bullets[_local1].Hit();
_local2 = _local2 + p_bullets[_local1].damage;
}
}
_local1++;
}
return(_local2);
}
function CollideKnight(aabb) {
p.x = 0;
p.y = 0;
return(knight.CollideBody(aabb));
}
function collide_beam_knight(x, y, ex, ey, _length) {
return(collide_beam_aabb(x, y, ex, ey, knight.aabb, _length));
}
function DamageKnight(dmg, vx, vy) {
if (knight.life <= 0) {
knight.addvx(vx);
knight.addvy(vy);
return(undefined);
}
if (dmg <= 0) {
return(undefined);
}
if (!vx) {
vx = 0;
}
if (!vy) {
vy = 0;
}
damage_vx = vx;
damage_vy = vy;
knight.Damage(vx, vy, 10, dmg);
}
function HealKnight(h) {
if (knight.life <= 0) {
return(undefined);
}
knight.life = knight.life + h;
if (knight.life > 100) {
knight.life = 100;
}
}
function ExplodeKnight(x, y, r, dmg, force) {
test_aabb.x = x - r;
test_aabb.y = y - r;
test_aabb.w = r + r;
test_aabb.h = r + r;
p.x = 0;
p.y = 0;
if (knight.CollideBody(test_aabb)) {
dx = knight.getx() - x;
dy = knight.gety() - y;
l = Math.sqrt((dx * dx) + (dy * dy));
force = force / l;
dx = dx * force;
dy = dy * force;
DamageKnight(dmg, dx, dy);
}
}
function add_score(sc) {
if (!game_over) {
score = score + int(sc * score_mult);
}
}
function bonus_info(info) {
if (_bonus_info.length == 0) {
_bonus_info = info;
} else {
_bonus_info = _bonus_info + (" , " + info);
}
_bonus_info_time = 60;
}
function add_kill_combo() {
if (kill_combo_time > 0) {
kill_combo++;
if (kill_combo >= 2) {
bonus_info(kill_combo_text[kill_combo - 2]);
}
} else {
kill_combo = 1;
}
kill_combo_time = 45;
}
function add_kill_bonus(_score) {
if (!game_over) {
score = score + int(_score * score_mult);
}
}
function Quake(x, y, force) {
quake.dir = (Math.PI/2);
quake.force = quake.force + force;
quake.damping = 0.9;
quake.phase = 0;
quake.speed = (Math.PI/2);
quake.rotation = 0.2;
}
function dust(x, y, n, maxspeed) {
var _local1 = 0;
while (_local1 < n) {
objects.push(new Particle(random(4) + 1, x, y, maxspeed, 10));
_local1++;
}
}
function cable(x1, y1, x2, y2) {
var _local7 = DistPoint(x1, y1, x2, y2);
var _local4 = Math.min(Math.ceil(_local7 / 30), 20);
var _local3 = new CableDoubleAnchor(x1, y1, "cable20", _local4, _root.gravity_y * 0.5);
var _local2 = _local4;
while (_local2 < 20) {
_local3.sprite["c" + _local2]._visible = false;
_local2++;
}
_local3.SetPos1(x1, y1);
_local3.SetPos2(x2, y2);
_root.PushObject(_local3);
return(_local3);
}
function bonus(_content, x, y) {
if (_content.indexOf("gold") != -1) {
var _local8 = _content.indexOf("gold");
var _local9 = parseInt(_content.substr(_local8 + 4, 2));
var _local2 = 0;
while (_local2 < _local9) {
_root.PushObject(new BonusGold(x, y, -random(180), random(5) + 8));
_local2++;
}
}
if (_content.indexOf("heal") != -1) {
var _local8 = _content.indexOf("heal");
var _local9 = parseInt(_content.substr(_local8 + 4, 2));
var _local6 = "heal";
if ((_local9 > 25) && (_local9 <= 40)) {
_local6 = "heal_med";
}
if (_local9 > 40) {
_local6 = "heal_big";
}
_root.PushObject(new BonusHeal(x, y, _local6, _local9));
}
if (_content.indexOf("smg") != -1) {
var _local8 = _content.indexOf("smg");
var _local9 = parseInt(_content.substr(_local8 + 3, 2));
var _local7 = new BonusGun(x, y, "bonus_gun", 2, _local9);
_root.PushObject(_local7);
_local7.oldx = _local7.oldx + (random(10) - 5);
_local7.oldy = _local7.oldy + 10;
}
if (_content.indexOf("riffle") != -1) {
var _local8 = _content.indexOf("riffle");
var _local9 = parseInt(_content.substr(_local8 + 6, 2));
var _local7 = new BonusGun(x, y, "bonus_gun", 3, _local9);
_root.PushObject(_local7);
_local7.oldx = _local7.oldx + (random(10) - 5);
_local7.oldy = _local7.oldy + 10;
}
if (_content.indexOf("grenade") != -1) {
var _local8 = _content.indexOf("grenade");
var _local9 = parseInt(_content.substr(_local8 + 7, 2));
var _local7 = new BonusGun(x, y, "bonus_gun", 4, _local9);
_root.PushObject(_local7);
_local7.oldx = _local7.oldx + (random(10) - 5);
_local7.oldy = _local7.oldy + 10;
}
}
function SetBounds(_x1, _y1, _x2, _y2) {
fixed_bounds = true;
left_border = _x1;
top_border = _y1;
right_border = _x2;
bottom_border = _y2;
}
function UnSetBounds() {
fixed_bounds = false;
}
function SetCheckpoint(x, y) {
return((_root.checkpoint = new Checkpoint(x, y)));
}
function set_view(x, y) {
if (y > view_bottom._y) {
y = view_bottom._y;
}
_root._x = x;
_root._y = y;
}
function View(new_view_x, new_view_y) {
_root.view_x = (((new_view_x - (_root.w * 0.5)) / 100) * _root.view_scale) + (_root.w * 0.5);
_root.view_y = (((new_view_y - (_root.h * 0.5)) / 100) * _root.view_scale) + (_root.h * 0.5);
_root.level._xscale = (_root.level._yscale = _root.view_scale);
_root.objects_layer._xscale = _root.view_scale;
_root.objects_layer._yscale = _root.view_scale;
_root._x = int(_root.view_x);
_root._y = int(_root.view_y);
if (view_bottom) {
view_bottom._visible = false;
var _local2 = (((-view_bottom._y) / 100) * cur_scale) + _root.h;
if (_root._y < _local2) {
_root._y = _local2;
}
}
if (level.view_right) {
level.view_right._visible = false;
var _local3 = (((-level.view_right._x) / 100) * cur_scale) + _root.w;
if (_root._x < _local3) {
_root._x = _local3;
}
}
_root.view_x = new_view_x;
_root.view_y = new_view_y;
}
function actual_scale() {
var _local2 = _root.level._xscale;
return(interpolate(_local2, view_scale, 0.05));
}
function actual_root_pos() {
var _local2 = actual_scale();
_root.p.x = (((_root._x + (_root.w * 0.5)) * 100) / _local2) - (_root.w * 0.5);
_root.p.y = (((_root._y + (_root.h * 0.5)) * 100) / _local2) - (_root.h * 0.5);
}
function SmoothView(new_view_x, new_view_y, interpolation_coeff, zoom_interpolation_coeff) {
if ((new_view_x == undefined) || (new_view_y == undefined)) {
return(undefined);
}
var _local2 = _root.level._xscale;
var _local7 = view_scale != _local2;
dscale = _local2;
if (!zoom_interpolation_coeff) {
zoom_interpolation_coeff = 0.05;
}
_local2 = interpolate(_local2, view_scale, zoom_interpolation_coeff);
if (Math.abs(_local2 - _root.view_scale) <= 0.1) {
_local2 = _root.view_scale;
}
if (_local7) {
_root.level._xscale = _local2;
_root.level._yscale = _local2;
_root.objects_layer._xscale = _local2;
_root.objects_layer._yscale = _local2;
}
if (interpolation_coeff == undefined) {
interpolation_coeff = 0.85;
}
_root.view_x = _root.interpolate(_root.view_x, new_view_x, interpolation_coeff);
_root.view_y = _root.interpolate(_root.view_y, new_view_y, interpolation_coeff);
var _local10 = _root.view_x;
var _local8 = _root.view_y;
_root.view_x = (((_root.view_x - (_root.w * 0.5)) / 100) * _local2) + (_root.w * 0.5);
_root.view_y = (((_root.view_y - (_root.h * 0.5)) / 100) * _local2) + (_root.h * 0.5);
if ((_root.view_x - _root._x) > 10) {
_root._x = int(_root.view_x - 10);
}
if ((_root.view_x - _root._x) < -10) {
_root._x = int(_root.view_x + 10);
}
if ((_root.view_y - _root._y) > 10) {
_root._y = int(_root.view_y - 10);
}
if ((_root.view_y - _root._y) < -10) {
_root._y = int(_root.view_y + 10);
}
if (view_bottom) {
view_bottom._visible = false;
var _local3 = (((-view_bottom._y) / 100) * _local2) + _root.h;
if (_root._y < _local3) {
_root._y = _local3;
}
}
if (level.view_right) {
level.view_right._visible = false;
var _local4 = (((-level.view_right._x) / 100) * _local2) + _root.w;
if (_root._x < _local4) {
_root._x = _local4;
}
}
if (_root.level.view_left) {
_root.level.view_left._visible = false;
var _local5 = ((-_root.level.view_left._x) / 100) * _local2;
if (_root._x > _local5) {
_root._x = _local5;
}
}
_root.view_x = _local10;
_root.view_y = _local8;
}
function ResetBricks() {
for (var _local3 in bricks) {
for (var _local2 in bricks[_local3]) {
var _local1 = 0;
while (_local1 < bricks[_local3][_local2].length) {
delete bricks[_local3][_local2][_local1];
bricks[_local3][_local2].splice(_local1, 1);
_local1--;
_local1++;
}
delete bricks[_local3][_local2];
}
bricks[_local3].splice(_local2, 1);
delete bricks[_local3];
}
}
function ResetObjectMap() {
for (var _local3 in object_map) {
for (var _local2 in object_map[_local3]) {
var _local1 = 0;
while (_local1 < object_map[_local3][_local2].length) {
object_map[_local3][_local2][_local1].Kill();
delete object_map[_local3][_local2][_local1];
object_map[_local3][_local2].splice(_local1, 1);
_local1--;
_local1++;
}
delete object_map[_local3][_local2];
}
delete object_map[_local3];
}
object_map = [];
}
function StartGame() {
_root.id = 0;
_root.w = 720;
_root.h = 540;
_root.ammo = 0;
_root._time = 0;
_root.gravity_y = 0.68;
_root.left_border = 0;
_root.right_border = _root.w;
_root.top_border = 0;
_root.bottom_border = _root.h;
_root.pull_coeff = 1;
_root.collided_brick = null;
_root._bonus_info_time = 60;
_root._bonus_info = "start";
_root.kill_combo = 0;
_root.kill_combo_time = 0;
_root.ammo = "";
_root.damage_vx = 0;
_root.damage_vy = 0;
_root.jet_death = false;
_root.knight_dead_time = 60;
_root.knight_spawned = false;
_root.fixed_bounds = false;
_root.respawn_time = 100;
_root.checkpoint = undefined;
_root.view_scale = 100;
_root.__xmouse = _xmouse;
_root.__ymouse = _ymouse;
_root.objects_layer._xscale = 100;
_root.objects_layer._yscale = 100;
_root.wind_left = -2;
_root.wind_right = 2;
_root.level_vx = 0;
_root.lives_text = "x " + _root.lives;
_root.ui.lives_counter.gotoAndStop(_root.lives + 1);
_root.game_over = false;
quake.amplitude_x = 0;
quake.amplitude_y = 0;
quake.force = 0;
quake.damping = 0;
quake.phase = 0;
quake.dir = 0;
quake.rotation = 0;
quake.speed = 0.9;
if (knight) {
knight.Kill();
delete knight;
}
knight = new Object();
knight.getx = function () {
return(0);
};
knight.gety = function () {
return(0);
};
ResetBricks();
ResetObjectMap();
var _local2 = 0;
_local2 = 0;
while (_local2 < objects.length) {
objects[_local2].Kill();
delete objects[_local2];
objects.splice(_local2, 1);
_local2--;
_local2++;
}
_local2 = 0;
while (_local2 < p_bullets.length) {
p_bullets[_local2].Kill();
delete p_bullets[_local2];
p_bullets.splice(_local2, 1);
_local2--;
_local2++;
}
keys.splice(0, keys.length);
keys = new Array();
_local2 = 0;
while (_local2 < backgrounds.length) {
delete backgrounds[_local2];
backgrounds.splice(_local2, 1);
_local2--;
_local2++;
}
_local2 = 0;
while (_local2 < respawners.length) {
delete respawners[_local2];
respawners.splice(_local2, 1);
_local2--;
_local2++;
}
for (_local2 in objects_layer) {
removeMovieClip(_root.objects_layer[_local2]);
}
drawing.clear();
stopAllSounds();
lifts.splice(0, lifts.length);
get_id = get_id_1_511;
id = 1;
_root.onEnterFrame = UpdateGame;
_root._x = 0;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
_root.view_x = (_root.view_y = 0);
_root.view_scale = 100;
_root.ui._xscale = 100;
_root.ui._yscale = 100;
_root.ui.gotoAndStop("single");
_root.wind_x = -0.2;
_root.ragdolls_free = false;
_root.cycle_state = new Object();
_root.cycle_state.JUST_STARTED = 0;
_root.cycle_state.UPDATING_PLAYER_BULLETS = 1;
_root.cycle_state.UPDATING_OBJECTS = 2;
_root.cycle_state.UPDATING_KNIGHT = 3;
_root.cycle_state.current_state = _root.cycle_state.JUST_STARTED;
_root.onKillFocus = function () {
_root.mouse_pressed = false;
};
_root.onMouseDown = function () {
_root.mouse_pressed = true;
};
_root.onMouseUp = function () {
_root.mouse_pressed = false;
};
_root.pause_possible = true;
}
function _cash() {
var _local3 = 0;
for (var _local6 in object_map) {
for (var _local5 in object_map[_local6]) {
var _local1 = 0;
while (_local1 < object_map[_local6][_local5].length) {
trace("________");
var _local2 = object_map[_local6][_local5][_local1];
for (var _local4 in _local2) {
trace((_local4.toString() + "=") + _local2[_local4]);
}
_local3++;
if (_local3 > 10) {
return(undefined);
}
_local1++;
}
}
}
}
function UpdateGame() {
if ((Key.isDown(27) || (Key.isDown(80))) || (Key.isDown(192) && (is_offline))) {
if ((!esc_pressed) && (pause_possible)) {
if (!Key.isDown(192)) {
_root.ui.anouncer.gotoAndStop("pause");
}
esc_pressed = true;
var _local2 = 0;
while (_local2 < p_bullets.length) {
p_bullets[_local2].Pause();
_local2++;
}
_local2 = 0;
while (_local2 < objects.length) {
objects[_local2].Pause();
_local2++;
}
knight.Pause();
_local2 = 0;
while (_local2 < lifts.length) {
if (lifts[_local2].is_playing) {
lifts[_local2].stop();
}
_local2++;
}
if (!Key.isDown(192)) {
menu_controller.Pause();
}
_root.onEnterFrame = _root.Pause;
return(undefined);
}
if ((!esc_pressed) && (!pause_possible)) {
esc_pressed = true;
bonus_info("Pausing Impossible! Please Wait.");
}
} else {
esc_pressed = false;
}
if (_time == 1) {
get_id = get_id_512_1024;
id = half_depth_band;
}
_time++;
frames++;
var _local4 = new Date();
if (_local4.getSeconds() != msecs) {
fps = frames;
frames = 0;
msecs = _local4.getSeconds();
fps_text = "fps:" + fps;
}
var _local3 = 100 / _root.actual_scale();
if (!fixed_bounds) {
left_border = (-_root._x) * _local3;
right_border = (-(_root._x - _root.w)) * _local3;
top_border = (-_root._y) * _local3;
bottom_border = (-(_root._y - _root.h)) * _local3;
}
_root.cycle_state.current_state = _root.cycle_state.UPDATING_PLAYER_BULLETS;
var _local2 = 0;
while (_local2 < p_bullets.length) {
p_bullets[_local2].Update();
if (!p_bullets[_local2].Alive()) {
p_bullets[_local2].Kill();
delete p_bullets[_local2];
p_bullets.splice(_local2, 1);
_local2--;
}
_local2++;
}
_root.cycle_state.current_state = _root.cycle_state.UPDATING_OBJECTS;
IncludeObjects();
_local2 = objects.length - 1;
while (_local2 >= 0) {
objects[_local2].Update();
if (!objects[_local2].Alive()) {
objects[_local2].Kill();
delete objects[_local2];
objects.splice(_local2, 1);
}
if (_root.p == undefined) {
trace("point buf error / undefined point");
trace(objects[_local2].sprite);
_root.p = new Object();
_root.p.x = 0;
_root.p.y = 0;
}
_local2--;
}
ExcludeObjects();
_root.cycle_state.current_state = _root.cycle_state.UPDATING_KNIGHT;
_root.__xmouse = _xmouse * _local3;
_root.__ymouse = _ymouse * _local3;
_root.__xmouse = limit(_root.__xmouse, _root.knight.getx() - (_root.w * _local3), _root.knight.getx() + (_root.w * _local3));
_root.__ymouse = limit(_root.__ymouse, _root.knight.gety() - (_root.h * _local3), _root.knight.gety() + (_root.h * _local3));
knight.Update();
n_objects = "objs:" + objects.length;
ui._x = -_root._x;
ui._y = -_root._y;
_local2 = 0;
while (_local2 < backgrounds.length) {
backgrounds[_local2].Update();
_local2++;
}
wind_x = wind_x + (Math.random() - 0.5);
wind_x = limit(wind_x, wind_left, wind_right);
_bonus_info_time--;
print_mc(ui.output_text, _bonus_info);
if ((_bonus_info_time <= 0) || (_bonus_info.length > 36)) {
_bonus_info = _bonus_info.substr(1);
}
kill_combo_time--;
if (!game_over) {
if (((knight.life <= 0) && (knight_spawned)) && (!(knight instanceof Raptor))) {
_root.knight_dead_time--;
if ((_root.knight_dead_time % 60) == 0) {
bonus_info("Press Space to try again.");
}
if (Key.isDown(32) || (_root.lives == 0)) {
_root.lives--;
if (_root.lives >= 0) {
RestartCheckpoint();
_root.knight_dead_time = 60;
} else {
game_over = true;
pause_possible = false;
menu_controller.GameOver();
}
}
}
} else {
menu_controller.Update();
}
_root.ui.lives_counter.gotoAndStop(_root.lives + 1);
_root.print_int(_root.ui.score_counter, _root.score, 9);
}
function Pause() {
if (((Key.isDown(27) || (menu_controller.unpaused)) || (Key.isDown(80))) || (Key.isDown(192) && (is_offline))) {
if (!esc_pressed) {
esc_pressed = true;
var _local2 = 0;
while (_local2 < p_bullets.length) {
p_bullets[_local2].UnPause();
_local2++;
}
_local2 = 0;
while (_local2 < objects.length) {
objects[_local2].UnPause();
_local2++;
}
knight.UnPause();
menu_controller.UnPause();
_local2 = 0;
while (_local2 < lifts.length) {
if (lifts[_local2].is_playing) {
lifts[_local2].play();
}
_local2++;
}
_root.onEnterFrame = _root.UpdateGame;
return(undefined);
}
} else {
esc_pressed = false;
}
menu_controller.UpdatePause();
}
function RedirectRestartLevel() {
gotoAndStop(_root.current_level);
_root.onEnterFrame = UpdateGame;
}
function RedirectStartLevel() {
_root.onEnterFrame = UpdateGame;
}
function GotoLevel(lev) {
_root.current_level = lev;
if ((knight.life <= 0) && (knight_spawned)) {
return(undefined);
}
StartGame();
gotoAndStop(lev);
onEnterFrame = RedirectStartLevel;
}
function RestartLevel() {
StartGame();
_root.current_level = _root._currentframe;
gotoAndStop ("empty");
onEnterFrame = RedirectRestartLevel;
}
function RestartCheckpoint() {
_root.lives_text = "x " + _root.lives;
if (_root.checkpoint != undefined) {
_root.checkpoint.Restore();
} else {
RestartLevel();
}
}
function UpdateMenu() {
var _local2 = level_lock.substr(old_letter_pos + 1, 1);
if (Key.getCode() > 0) {
if (String.fromCharCode(Key.getAscii()) == _local2) {
old_letter_pos++;
if (old_letter_pos == (level_lock.length - 1)) {
menu_controller.UnlockAll();
old_letter_pos = -1;
}
} else if (String.fromCharCode(Key.getAscii()) != level_lock.substr(old_letter_pos, 1)) {
old_letter_pos = -1;
}
}
_root.menu_controller.Update();
}
function MainMenu() {
gotoAndStop ("menu");
_root._x = 0;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
_root.onEnterFrame = UpdateMenu;
stopAllSounds();
}
stop();
_quality = "LOW";
var depth_band = 32768;
var half_depth_band = int(depth_band / 2);
var degtorad = (Math.PI/180);
var radtodeg = 57.2957795130823;
var t_brick = 0;
var t_slope_up_left = 1;
var t_slope_up_right = 2;
var t_slope_down_left = 3;
var t_slope_down_right = 4;
var t_breakable = 5;
var _version = "1.02";
var objects = new Array();
var object_map = new Array();
var object_map_w = 200;
var object_map_h = 200;
var p = new Object();
p.x = 0;
p.y = 0;
var m = (new flash.geom.Matrix());
var dm = (new flash.geom.Matrix());
var test_aabb = new Object();
var persistent_buf = new Object();
var bricks = new Array();
var map_w = 200;
var map_h = 200;
var p_bullets = new Array();
var backgrounds = new Array();
var keys = new Array();
var respawners = new Array();
var lifts = new Array();
var red = new Object();
var green = new Object();
var light_orange = new Object();
var white = new Object();
var color = new Color(this);
red.ra = 100;
red.rb = 0;
red.ga = 0;
red.gb = 0;
red.ba = 0;
red.bb = 0;
red.aa = 100;
red.ab = 0;
green.ra = 100;
green.rb = 0;
green.ga = 100;
green.gb = 100;
green.ba = 100;
green.bb = 0;
green.aa = 100;
green.ab = 0;
light_orange.ra = 100;
light_orange.rb = 54;
light_orange.ga = 100;
light_orange.gb = 36;
light_orange.ba = 100;
light_orange.bb = 0;
light_orange.aa = 100;
light_orange.ab = 0;
white.ra = 100;
white.rb = 0;
white.ga = 100;
white.gb = 0;
white.ba = 100;
white.bb = 0;
white.aa = 100;
white.ab = 0;
var blue = new Object();
blue.ra = 100;
blue.rb = 30;
blue.ga = 100;
blue.gb = 30;
blue.ba = 100;
blue.bb = 100;
blue.aa = 100;
blue.ab = 0;
var quake = new Object();
var global_snd = new Sound(_root);
var menu_strings_eng = new Object();
var strings = menu_strings_eng;
var detailed_sky = true;
var difficulty = "normal";
var score_mult = 1;
var menu_controller = new MenuController(_root._menu);
var x1;
var y1;
var x2;
var y2;
var dx;
var dy;
var dx2;
var dy2;
var cables_enabled = true;
var score = 0;
var recent_ragdoll;
var level_finish_state = new PlayerState();
var current_level;
var checkpoint;
var view_scale = 100;
var last_gold;
_root.lives = 3;
_root.lives_text = "x 3";
var ragdolls_free = false;
var cycle_state;
var game_over;
var mouse_pressed;
var esc_pressed = false;
var pause_possible = true;
var is_offline = false;
if (_root._url.indexOf("file:") != -1) {
is_offline = true;
}
var kill_combo_text = new Array("Double Kill", "Multi Kill", "Mega Kill", "WTF?", "OMG!", "Mr. Anderson", "HOLYSHIT!", "MANIAC!", "SHINIGAMI!!!", "Eat vegetables", "Burning Mousepad!!", "Teh Dec0mp1l0r!", "I love FLCL ^__^!", "I'm not going to clean this mess!", "Physical laws violation!", "System.Error", "_Subject.ErrCode = INSANE", "Hell Gates Overloaded!", "universeEngine.state = SHUTING_DOWN");
menu_strings_eng.new_game = "New Game";
menu_strings_eng.highscore = "Highscore";
menu_strings_eng.options = "Options";
menu_strings_eng.credits = "Credits";
menu_strings_eng.more_games = "More Games";
menu_strings_eng.select_level = "Select level:";
menu_strings_eng.level0 = "Get ready!";
menu_strings_eng.level1 = "Level 1: Soft Landing";
menu_strings_eng.level2 = "Level 2: Two Towers";
menu_strings_eng.level3 = "Level 3: Hell Express";
menu_strings_eng.level4 = "Level 4: Serious Power";
menu_strings_eng.level5 = "Final Level: Hyperspeed";
menu_strings_eng.start_button = "START!";
menu_strings_eng.credits1 = "Programming,art,";
menu_strings_eng.credits2 = "animation:";
menu_strings_eng.credits3 = "vap(Abramenko Aleksey)";
menu_strings_eng.credits4 = "vapgames(2008)";
menu_strings_eng.options1 = "Options:";
menu_strings_eng.sound_volume = "Sound Volume:";
menu_strings_eng.detailed_sky = " Detailed Sky";
menu_strings_eng.submit = "Submit";
menu_strings_eng.main_menu = "Main Menu";
menu_strings_eng.total_score = "Total Score:";
menu_strings_eng.more_games_on = "More games on:";
menu_strings_eng.aim_and_shoot = "Aim & Shoot:";
menu_strings_eng.move = "Move:";
menu_strings_eng.switch_weapons = "Switch Weapons:";
menu_strings_eng.continue_play = "Continue (Esc/P)";
menu_strings_eng.difficulty = "Difficulty";
menu_strings_eng.normal_mode = " Normal";
menu_strings_eng.easy_mode = " Easy";
menu_strings_eng.super_easy_mode = " Super Easy";
menu_strings_eng.continue_game = "Continue";
menu_strings_eng.easy_mode_unlocked = "Easy Mode Unlocked";
menu_strings_eng.continue_on_easy = "Continue on Easy";
menu_strings_eng.loading = "Loading...";
menu_strings_eng.connection_error = "Connection Error";
_root.createEmptyMovieClip("snd2", _root.getNextHighestDepth());
var hit2 = new Sound(_root.snd2);
hit2.attachSound("snd_hit");
_root.createEmptyMovieClip("snd3", _root.getNextHighestDepth());
var snd_wind = new Sound(_root.snd3);
snd_wind.attachSound("snd_wind_loop");
_root.createEmptyMovieClip("snd4", _root.getNextHighestDepth());
var snd_coin = new Sound(_root.snd4);
snd_coin.attachSound("snd_gold");
_root.createEmptyMovieClip("smc", _root.getNextHighestDepth() + 100);
var id = 0;
get_id = get_id_1_511;
var ray_length = 0;
var msecs = 0;
var frames = 0;
var fps = 0;
var fps_text = "";
stop();
var level_lock = "moarlevels";
var old_key_code = 0;
var old_letter_pos = -1;
MainMenu();
gotoAndStop ("menu");
Frame 5
_root.menu_controller.Init(_root._menu);
Frame 6
if (false) {
}
Instance of Symbol 2275 MovieClip in Frame 8
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.2, 0));
}
Instance of Symbol 2275 MovieClip in Frame 8
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.4, 0, true));
}
Instance of Symbol 2275 MovieClip in Frame 8
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.6, 0, true));
}
Frame 8
if (false) {
}
Instance of Symbol 2275 MovieClip in Frame 10
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.2, 0));
}
Instance of Symbol 2275 MovieClip in Frame 10
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.4, 0, true));
}
Instance of Symbol 2275 MovieClip in Frame 10
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.6, 0, true));
}
Frame 10
if (false) {
}
Instance of Symbol 2537 MovieClip in Frame 12
onClipEvent (load) {
if (_root.detailed_sky) {
_root.backgrounds.push(new TileXBackground(this, 0.1, 0.2, true));
stop();
} else {
gotoAndStop (2);
}
}
Frame 12
if (false) {
}
Instance of Symbol 2711 MovieClip in Frame 14
onClipEvent (load) {
if (_root.detailed_sky) {
stop();
} else {
gotoAndStop (2);
}
_root.backgrounds.push(new TileXBackground(this, 0.125, 0));
}
Instance of Symbol 2712 MovieClip in Frame 14
onClipEvent (load) {
if (_root.detailed_sky) {
_root.backgrounds.push(new TileXBackground(this, 0.5, 0));
stop();
} else {
gotoAndStop (2);
}
}
Instance of Symbol 2537 MovieClip in Frame 14
onClipEvent (load) {
if (_root.detailed_sky) {
_root.backgrounds.push(new TileXBackground(this, 0.24, 0.01));
stop();
} else {
gotoAndStop (2);
}
}
Frame 14
if (false) {
}
Instance of Symbol 2711 MovieClip "_sky" in Frame 16
onClipEvent (load) {
stop();
_root.backgrounds.push(new TileXBackground(this, 0.125, 0));
}
Instance of Symbol 2712 MovieClip "_mountains" in Frame 16
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.5, 0));
stop();
}
Instance of Symbol 2537 MovieClip "_clouds" in Frame 16
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.24, 0.01));
stop();
}
Frame 16
if (false) {
}
Instance of Symbol 2711 MovieClip "_sky" in Frame 18
onClipEvent (load) {
if (_root.detailed_sky) {
stop();
} else {
gotoAndStop (3);
}
_root.backgrounds.push(new TileXBackground(this, 0.125, 0));
}
Instance of Symbol 2712 MovieClip "_mountains" in Frame 18
onClipEvent (load) {
if (_root.detailed_sky) {
_root.backgrounds.push(new TileXBackground(this, 0.5, 0));
stop();
} else {
gotoAndStop (2);
}
}
Frame 18
if (false) {
}
Instance of Symbol 2996 MovieClip "_sky" in Frame 20
onClipEvent (load) {
stop();
_root.backgrounds.push(new TileXBackground(this, 0.125, 0));
}
Instance of Symbol 2999 MovieClip in Frame 20
onClipEvent (load) {
_x = -500;
var back = new TileXBackground(this, 0.5, 0.05, false);
_root.backgrounds.push(back);
}
Instance of Symbol 3146 MovieClip "road_front" in Frame 20
onClipEvent (load) {
stop();
_x = -1000;
var back = new TileXBackground(this, 1.5, 1.5, false);
_root.backgrounds.push(back);
if (!_root.detailed_sky) {
gotoAndStop ("empty");
}
}
Frame 20
if (false) {
}
Symbol 4 Button
on (release) {
getURL ("http://kongregate.com/", "_blank");
}
Symbol 32 MovieClip Frame 1
var _loaded = false;
Symbol 32 MovieClip Frame 128
if (!_loaded) {
stop();
}
Symbol 32 MovieClip Frame 135
_root.play();
Symbol 40 MovieClip Frame 1
onEnterFrame = function () {
total = _root.getBytesTotal();
loaded = _root.getBytesLoaded();
percent = Math.round((loaded / total) * 100);
if (percent <= 0) {
percent = 0;
}
if (percent >= 100) {
_root.logo._loaded = true;
_root.logo.play();
onEnterFrame = 0;
}
gotoAndStop(percent);
};
stop();
_root.stop();
Symbol 3161 MovieClip [__Packages.Obj] Frame 0
class Obj
{
var x, y;
function Obj () {
x = 0;
y = 0;
}
function Update() {
}
function Alive() {
return(true);
}
function Kill() {
}
function Freeze() {
}
function UnFreeze() {
}
function UpdatePhysics() {
}
function Pause() {
}
function UnPause() {
}
}
Symbol 3162 MovieClip [__Packages.JointCollide] Frame 0
class JointCollide extends Obj
{
var x, y, oldx, oldy, mass, collided, id, sprite, aabb, life, collided_brick;
function JointCollide (__x, __y, _mass, r, spritename) {
super();
x = __x;
y = __y;
oldx = x;
oldy = y;
mass = _mass;
if (_mass == undefined) {
mass = 1000;
}
if (!r) {
r = 10;
}
collided = 0;
id = -1;
if (!spritename) {
return;
}
if ((spritename != "no") && (spritename != undefined)) {
id = _root.get_id();
sprite = _root.objects_layer.attachMovie(spritename, "j" + id, id + (_root.depth_band * 5));
sprite._x = x;
sprite._y = y;
}
aabb = new Object();
aabb.w = r + r;
aabb.h = r + r;
aabb.x = 0;
aabb.y = 0;
aabb.dx = -r;
aabb.dy = -r;
}
function Update() {
UpdatePhysics();
}
function Kill() {
life = -1;
if (sprite) {
removeMovieClip(sprite);
}
delete aabb;
}
function Alive() {
return(true);
}
function UpdatePhysics() {
var _local4 = (x - oldx) * 0.99995;
var _local3 = (y - oldy) * 0.99995;
oldx = x;
oldy = y;
x = x + _local4;
y = y + _local3;
aabb.x = x + aabb.dx;
aabb.y = y + aabb.dy;
collided = 0;
if (_root.collide(aabb)) {
if (_local3 < -1) {
if (_root.collided_brick instanceof Platform) {
_root.p.y = 0;
}
}
x = x + _root.p.x;
if (_root.p.y != 0) {
if ((_root.p.y * _local3) < 0) {
y = y + _root.p.y;
oldy = _root.interpolate(oldy, y, 0.8);
} else {
y = y + _root.p.y;
oldy = oldy + _root.p.y;
}
x = _root.interpolate(x, oldx, 0.2);
if (_root.p.y < 0) {
collided = 3;
} else {
collided = 1;
}
collided_brick = _root.collided_brick;
} else if (_root.p.x != 0) {
oldx = _root.interpolate(oldx, x, 0.8);
if (_root.p.x < 0) {
collided = 2;
} else {
collided = 4;
}
collided_brick = _root.collided_brick;
}
}
if (sprite) {
sprite._x = x;
sprite._y = y;
}
}
}
Symbol 3163 MovieClip [__Packages.Platform] Frame 0
class Platform
{
var mc, x, y, type;
function Platform (_mc, _type, _dx, _dy) {
mc = _mc;
if (_dx != undefined) {
x = _dx;
} else {
x = 0;
}
if (_dy != undefined) {
y = _dy;
} else {
y = 0;
}
if (_type != undefined) {
type = _type;
} else {
type = 0;
}
}
function Collide(aabb) {
var _local6 = (aabb.x + aabb.w) - (mc._x + x);
if (_local6 < 0) {
return(false);
}
var _local7 = aabb.x - ((mc._x + x) + mc._width);
if (_local7 > 0) {
return(false);
}
var _local3 = (aabb.y + aabb.h) - (mc._y + y);
if (_local3 < 0) {
return(false);
}
var _local5 = aabb.y - ((mc._y + y) + mc._height);
if (_local5 > 0) {
return(false);
}
if (Math.abs(_local3) > Math.abs(_local5)) {
_local3 = _local5;
}
if ((_local3 > 0) && (_local3 < mc._height)) {
_root.p.y = _root.p.y - _local3;
_root.collided_brick = this;
return(true);
}
}
function getx() {
return(mc._x + x);
}
function gety() {
return(mc._x + y);
}
function getw() {
return(mc._width);
}
function geth() {
return(mc._height);
}
function CollidePoint(px, py) {
return(false);
}
}
Symbol 3164 MovieClip [__Packages.SpinningGib] Frame 0
class SpinningGib extends JointCollide
{
var x, y, id, sprite, aabb, mass, life, ang, oldx, oldy, spin, UpdatePhysics, collided;
function SpinningGib (sprite_name, __x, __y, dir, speed, r, frame, depth) {
super();
x = __x;
y = __y;
id = _root.get_id();
if (!depth) {
depth = 12;
}
sprite = _root.objects_layer.attachMovie(sprite_name, "gi" + id, id + (_root.depth_band * depth));
sprite._x = x;
sprite._y = y;
if (frame == undefined) {
sprite.gotoAndStop(random(sprite._framesloaded) + 1);
} else {
sprite.gotoAndStop(frame);
}
aabb = new Object();
aabb.dx = -r;
aabb.dy = -r;
aabb.w = r + r;
aabb.h = r + r;
aabb.x = __x;
aabb.y = __y;
mass = 10;
life = 80 + random(40);
ang = 0;
dir = dir * _root.degtorad;
oldx = x - (speed * Math.cos(dir));
oldy = y - (speed * Math.sin(dir));
spin = _root.radtodeg / r;
}
function Update() {
y = y + _root.gravity_y;
var _local3 = x - oldx;
var _local4 = y - oldy;
sprite._rotation = ang;
ang = ang + (_local3 * spin);
UpdatePhysics();
life--;
switch (collided) {
case 0 :
break;
case 3 :
y = y - (_local4 * 0.6);
break;
case 2 :
case 4 :
x = x - (_local3 * 0.5);
}
if (_root.ragdolls_free) {
x = x + _root.ragdolls_free;
}
}
function Kill() {
life = -10000;
if (sprite) {
removeMovieClip(sprite);
}
sprite = 0;
delete aabb;
}
function Alive() {
return(life > 0);
}
function InGame() {
if ((x + 20) < _root.left_border) {
return(false);
}
if ((x - 20) > _root.right_border) {
return(false);
}
if ((y + 20) < _root.top_border) {
return(false);
}
if ((y - 20) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
if (life < 1000) {
Kill();
} else {
sprite._visible = false;
}
}
function UnFreeze() {
sprite._visible = true;
}
}
Symbol 3165 MovieClip [__Packages.Ragdoll] Frame 0
class Ragdoll extends Obj
{
var objects, sprite, life, x, y, time, jet, hitsound_reload;
function Ragdoll (__x, __y, _sprite, head, body, arm_1_1, arm_1_2, arm_2_1, arm_2_2, butt, leg_1_1, leg_1_2, leg_2_1, leg_2_2, vx, vy, _jet) {
super();
if (vy < -10) {
_root.bonus_info("LEARN TO FLY! + " + (int(-vy) * 2));
_root.add_score(int(-vy) * 2);
}
var _local10 = "c'mon u mutha fucka";
_local10 = "(~__^)db";
objects = new Array();
sprite = _sprite;
life = 100;
objects.push(new JointCollideBounce(head._x, head._y, 40, 10, "no"));
objects.push(new JointCollideBounce(body._x, body._y, 100, 10, "no"));
objects.push(new JointCollideBounce(arm_1_2._x, arm_1_2._y, 40, 10, "no"));
objects.push(new JointCollideBounce(arm_1_1._x, arm_1_1._y, 40, 10, "no"));
objects.push(new JointCollideBounce(arm_2_2._x, arm_2_2._y, 40, 10, "no"));
objects.push(new JointCollideBounce(arm_2_1._x, arm_2_1._y, 40, 10, "no"));
objects.push(new JointCollideBounce(butt._x, butt._y, 80, 10, "no"));
objects.push(new JointCollideBounce(leg_1_2._x, leg_1_2._y, 40, 10, "no"));
objects.push(new JointCollideBounce(leg_1_1._x, leg_1_1._y, 40, 10, "no"));
objects.push(new JointCollideBounce(leg_2_2._x, leg_2_2._y, 40, 10, "no"));
objects.push(new JointCollideBounce(leg_2_1._x, leg_2_1._y, 40, 10, "no"));
var _local5 = 0.95;
objects.push(new LinkSprite(objects[0], objects[1], _local5, head));
objects.push(new LinkSprite(objects[1], objects[6], _local5, body));
objects.push(new Link(objects[0], objects[6], _local5));
objects.push(new LinkSprite(objects[2], objects[3], _local5, arm_1_2));
objects.push(new LinkSprite(objects[3], objects[1], _local5, arm_1_1));
objects.push(new LinkSprite(objects[4], objects[5], _local5, arm_2_2));
objects.push(new LinkSprite(objects[5], objects[1], _local5, arm_2_1));
objects.push(new LinkSprite(objects[7], objects[8], _local5, leg_1_2));
objects.push(new LinkSprite(objects[8], objects[6], _local5, leg_1_1));
objects.push(new Link(objects[7], objects[1], _local5 * 0.25));
objects.push(new LinkSprite(objects[9], objects[10], _local5, leg_2_2));
objects.push(new LinkSprite(objects[10], objects[6], _local5, leg_2_1));
objects.push(new Link(objects[9], objects[1], _local5 * 0.25));
objects.push(new Link(objects[1], objects[8], _local5 * 0.5));
objects.push(new Link(objects[1], objects[10], _local5 * 0.5));
objects.push(new Link(objects[1], objects[2], _local5 * 0.25));
objects.push(new Link(objects[1], objects[4], _local5 * 0.25));
var _local4 = 0;
while (_local4 < objects.length) {
objects[_local4].x = objects[_local4].x + sprite._x;
objects[_local4].y = objects[_local4].y + sprite._y;
objects[_local4].oldx = objects[_local4].oldx + ((sprite._x - vx) + ((Math.random() - 0.5) * 2));
objects[_local4].oldy = objects[_local4].oldy + ((sprite._y - vy) + ((Math.random() - 0.5) * 2));
_local4++;
}
sprite._x = 0;
sprite._y = 0;
_local4 = 11;
while (_local4 < objects.length) {
objects[_local4].Render();
_local4++;
}
x = objects[1].x;
y = objects[1].y;
time = 0;
jet = _jet;
hitsound_reload = 0;
}
function Jet() {
var _local3 = objects[1].x - objects[6].x;
var _local2 = objects[1].y - objects[6].y;
objects[1].x = objects[1].x + (_local3 * 0.25);
objects[1].y = objects[1].y + (_local2 * 0.25);
if (time > 300) {
jet = false;
sprite.bod.prevFrame();
}
}
function Update() {
if (time > 500) {
return(undefined);
}
time++;
if (jet) {
Jet();
}
var _local4 = 0;
var _local5 = true;
var _local3 = 0;
while (_local3 < 11) {
objects[_local3].y = objects[_local3].y + _root.gravity_y;
objects[_local3].Update();
if (objects[_local3].collided != 3) {
_local5 = false;
}
_local4 = Math.max(_local4, objects[_local3].hit_f);
_local3++;
}
_local3 = 11;
while (_local3 < objects.length) {
objects[_local3].Update();
_local3++;
}
if ((_local4 > 10) && (hitsound_reload < 0)) {
_local4 = _local4 - 9;
_local4 = _local4 * 2.5;
_local4 = _root.limit(_local4, 10, 100);
_root.sound_mc_point("snd_hit", sprite, objects[1].x, _local4);
if (_local4 > 40) {
_root.bonus_info("SMASH! + " + int(_local4));
_root.add_score(int(_local4));
}
hitsound_reload = 10;
}
hitsound_reload--;
_local3 = 11;
while (_local3 < objects.length) {
objects[_local3].Render();
_local3++;
}
x = objects[1].x;
y = objects[1].y;
if (_root.ragdolls_free) {
addv(_root.ragdolls_free, 0, 0.2);
} else if ((time > 10) && (!jet)) {
if (_local5 || (time > 490)) {
x = (objects[1].x + objects[6].x) * 0.5;
y = (objects[1].y + objects[6].y) * 0.5;
time = 10000;
var _local9 = _root.get_id();
var _local6 = _root.objects_layer.createEmptyMovieClip("rag" + _local9, _local9 + (_root.depth_band * 1));
var _local7 = 100;
var _local8 = 100;
var _local11 = new flash.display.BitmapData(_local7, _local8, true, 0);
_local6.attachBitmap(_local11, 1, "never", false);
var _local10 = new flash.geom.Matrix();
_local10.translate((-x) + (_local7 * 0.5), (-y) + (_local8 * 0.5));
_local11.draw(sprite, _local10);
_local6._x = x - (_local7 * 0.5);
_local6._y = y - (_local8 * 0.5);
Kill();
}
}
return(_local5);
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
var _local2 = 0;
while (_local2 < objects.length) {
delete objects[_local2];
objects.splice(_local2, 1);
_local2++;
}
}
function Alive() {
return(life > -10000);
}
function InGame() {
if ((x + 100) < _root.left_border) {
return(false);
}
if ((x - 100) > _root.right_border) {
return(false);
}
if ((y + 100) < _root.top_border) {
return(false);
}
if ((y - 100) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
sprite._visible = false;
if (jet) {
jet = false;
sprite.bod.prevFrame();
}
if (_root.ragdolls_free) {
Kill();
}
}
function UnFreeze() {
sprite._visible = true;
}
function addv(vx, vy, rand) {
var _local2 = 0;
while (_local2 < 11) {
objects[_local2].x = objects[_local2].x + (vx + ((Math.random() - 0.5) * rand));
objects[_local2].y = objects[_local2].y + (vy + ((Math.random() - 0.5) * rand));
_local2++;
}
time = 0;
}
function getspeed() {
var _local3 = objects[6].x - objects[6].oldx;
var _local2 = objects[6].y - objects[6].oldy;
return(Math.sqrt((_local3 * _local3) + (_local2 * _local2)));
}
}
Symbol 3166 MovieClip [__Packages.JointCollideBounce] Frame 0
class JointCollideBounce extends Obj
{
var x, y, oldx, oldy, mass, r, collided, id, sprite, aabb, life, hit_f, collided_brick;
function JointCollideBounce (__x, __y, _mass, _r, spritename) {
super();
x = __x;
y = __y;
oldx = x;
oldy = y;
mass = _mass;
if (_mass == undefined) {
mass = 1000;
}
if (_r != undefined) {
r = _r;
} else {
r = 10;
}
collided = 0;
id = -1;
if (!spritename) {
return;
}
if (spritename != "no") {
id = _root.get_id();
sprite = _root.objects_layer.attachMovie(spritename, "j" + id, id + (_root.depth_band * 5));
sprite._x = x;
sprite._y = y;
}
aabb = new Object();
aabb.w = r + r;
aabb.h = r + r;
aabb.x = 0;
aabb.y = 0;
aabb.dx = -r;
aabb.dy = -r;
}
function Update() {
UpdatePhysics();
}
function Kill() {
life = -1;
if (sprite) {
removeMovieClip(sprite);
}
delete aabb;
}
function Alive() {
return(true);
}
function UpdatePhysics() {
var _local4 = (x - oldx) * 0.99995;
var _local3 = (y - oldy) * 0.99995;
oldx = x;
oldy = y;
_local4 = _root.limit(_local4, -40, 40);
_local3 = _root.limit(_local3, -40, 40);
x = x + _local4;
y = y + _local3;
aabb.x = x + aabb.dx;
aabb.y = y + aabb.dy;
collided = 0;
hit_f = 0;
if (_root.collide(aabb)) {
x = x + _root.p.x;
if (_local3 < -1) {
if (_root.collided_brick instanceof Platform) {
_root.p.y = 0;
}
}
if ((_root.p.y * _local3) < 0) {
y = y + _root.p.y;
} else {
y = y + _root.p.y;
oldy = oldy + _root.p.y;
}
if (_root.p.y != 0) {
if ((_root.p.y * _local3) < 0) {
oldy = _root.interpolate(oldy, y, 0.8);
}
x = _root.interpolate(x, oldx, 0.2);
if (_root.p.y < 0) {
collided = 3;
} else {
collided = 1;
}
collided_brick = _root.collided_brick;
y = y - (_local3 * 0.65);
hit_f = hit_f + Math.abs(_local3);
} else if (_root.p.x != 0) {
oldx = _root.interpolate(oldx, x, 0.8);
if (_root.p.x < 0) {
collided = 2;
} else {
collided = 4;
}
collided_brick = _root.collided_brick;
x = x - (_local4 * 0.65);
hit_f = hit_f + Math.abs(_local4);
}
}
if (sprite) {
sprite._x = x;
sprite._y = y;
}
}
}
Symbol 3167 MovieClip [__Packages.LinkSprite] Frame 0
class LinkSprite extends Obj
{
var a, b, k, r, sprite;
function LinkSprite (_a, _b, _k, _sprite) {
super();
a = _a;
b = _b;
k = _k;
r = _root.DistPoint(a.x, a.y, b.x, b.y);
sprite = _sprite;
}
function Update() {
var _local3 = b.x - a.x;
var _local2 = b.y - a.y;
var _local5 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local4 = (_local5 - r) / _local5;
_local4 = _local4 * (k / (a.mass + b.mass));
_local3 = _local3 * _local4;
_local2 = _local2 * _local4;
a.x = a.x + (b.mass * _local3);
if ((a.collided != 3) || (_local2 < 0)) {
a.y = a.y + (b.mass * _local2);
}
b.x = b.x - (a.mass * _local3);
if ((b.collided != 3) || (_local2 > 0)) {
b.y = b.y - (a.mass * _local2);
}
}
function Render() {
sprite._x = a.x;
sprite._y = a.y;
var _local4 = b.x - a.x;
var _local3 = b.y - a.y;
sprite._rotation = Math.atan2(_local3, _local4) * _root.radtodeg;
}
}
Symbol 3168 MovieClip [__Packages.Link] Frame 0
class Link extends Obj
{
var a, b, k, r;
function Link (_a, _b, _k) {
super();
a = _a;
b = _b;
k = _k;
r = _root.DistPoint(a.x, a.y, b.x, b.y);
}
function Update() {
var _local3 = b.x - a.x;
var _local2 = b.y - a.y;
var _local5 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local4 = (_local5 - r) / _local5;
_local4 = _local4 * (k / (a.mass + b.mass));
_local3 = _local3 * _local4;
_local2 = _local2 * _local4;
a.x = a.x + (b.mass * _local3);
if ((a.collided != 3) || (_local2 < 0)) {
a.y = a.y + (b.mass * _local2);
}
b.x = b.x - (a.mass * _local3);
if ((b.collided != 3) || (_local2 > 0)) {
b.y = b.y - (a.mass * _local2);
}
}
function Kill() {
}
function Alive() {
return(true);
}
}
Symbol 3169 MovieClip [__Packages.Gib] Frame 0
class Gib extends JointCollide
{
var x, y, id, sprite, aabb, mass, life, oldx, oldy, UpdatePhysics, collided;
function Gib (sprite_name, __x, __y, dir, speed, r, frame, depth) {
super();
x = __x;
y = __y;
id = _root.get_id();
if (depth == undefined) {
depth = 11;
}
sprite = _root.objects_layer.attachMovie(sprite_name, "g" + id, id + (_root.depth_band * depth));
sprite._x = x;
sprite._y = y;
if (frame == undefined) {
sprite.gotoAndStop(random(sprite._framesloaded) + 1);
} else {
sprite.gotoAndStop(frame);
}
aabb = new Object();
aabb.dx = -r;
aabb.dy = -r;
aabb.w = r + r;
aabb.h = r + r;
aabb.x = __x;
aabb.y = __y;
mass = 10;
life = 80 + random(40);
dir = dir * _root.degtorad;
oldx = x - (speed * Math.cos(dir));
oldy = y - (speed * Math.sin(dir));
}
function Update() {
y = y + _root.gravity_y;
var _local4 = x - oldx;
var _local3 = y - oldy;
sprite._rotation = Math.atan2(_local3, _local4) * _root.radtodeg;
UpdatePhysics();
life--;
switch (collided) {
case 0 :
break;
case 3 :
y = y - (_local3 * 0.6);
break;
case 2 :
case 4 :
x = x - (_local4 * 0.5);
}
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
delete aabb;
}
function Alive() {
return(life > 0);
}
function InGame() {
if ((x + 20) < _root.left_border) {
return(false);
}
if ((x - 20) > _root.right_border) {
return(false);
}
if ((y + 20) < _root.top_border) {
return(false);
}
if ((y - 20) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
Kill();
}
function UnFreeze() {
Kill();
}
}
Symbol 3170 MovieClip [__Packages.EnemyRocketDump] Frame 0
class EnemyRocketDump extends Obj
{
var x, y, id, sprite, aabb, life, speed, vx, vy;
function EnemyRocketDump (sprite_name, __x, __y, dir, _speed, r) {
super();
x = __x;
y = __y;
id = _root.get_id();
sprite = _root.objects_layer.attachMovie(sprite_name, "r" + id, id + (_root.depth_band * 12));
sprite._x = x;
sprite._y = y;
sprite._rotation = dir;
aabb = new Object();
aabb.dx = -r;
aabb.dy = -r;
aabb.w = r + r;
aabb.h = r + r;
aabb.x = __x;
aabb.y = __y;
life = 40;
speed = _speed;
dir = dir * _root.degtorad;
vx = speed * Math.cos(dir);
vy = speed * Math.sin(dir);
}
function Update() {
if (life < 0) {
return(undefined);
}
x = x + vx;
y = y + vy;
aabb.x = x + aabb.dx;
aabb.y = y + aabb.dy;
if (_root.collide(aabb)) {
x = x + _root.p.x;
y = y + _root.p.y;
Hit();
return(undefined);
}
if (_root.CollideKnight(aabb)) {
Hit();
return(undefined);
}
var _local3 = _root.GetDamage(aabb);
if (_local3 > 0) {
x = x + _root.knight.mace_vx;
y = y + _root.knight.mace_vy;
sprite.body.play();
}
_local3 = _root.CollideBullets(aabb);
if (_local3 > 0) {
x = x + (_root.p.x / 2000);
y = y + (_root.p.y / 2000);
life = life - _local3;
sprite.body.play();
}
if (life < 0) {
life = 1;
Hit();
return(undefined);
}
sprite._x = x;
sprite._y = y;
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
delete aabb;
}
function Alive() {
if ((sprite._currentframe == 31) || (life <= -10000)) {
return(false);
}
return(true);
}
function InGame() {
if ((x + 30) < _root.left_border) {
return(false);
}
if ((x - 30) > _root.right_border) {
return(false);
}
if ((y + 30) < _root.top_border) {
return(false);
}
if ((y - 30) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
Kill();
return(true);
}
function UnFreeze() {
}
function Collide(_aabb) {
if (_root.collide_aabb(_aabb, aabb)) {
return(true);
}
return(false);
}
function Hit() {
if (life < 0) {
return(undefined);
}
life = -1;
sprite._rotation = (Math.atan2(_root.p.y, _root.p.x) * _root.radtodeg) + 180;
sprite.gotoAndPlay("die");
}
}
Symbol 3171 MovieClip [__Packages.AnimSpriteFreezer] Frame 0
class AnimSpriteFreezer extends Obj
{
var sprite, x, y;
function AnimSpriteFreezer (_sprite) {
super();
sprite = _sprite;
x = sprite._x;
y = sprite._y;
if (sprite._parent != _root.level) {
x = x + sprite._parent._x;
y = y + sprite._parent._y;
}
sprite._visible = false;
}
function Freeze() {
sprite._visible = false;
sprite.stop();
}
function UnFreeze() {
sprite._visible = true;
sprite.play();
}
function Alive() {
return(true);
}
}
Symbol 3172 MovieClip [__Packages.Joint] Frame 0
class Joint extends Obj
{
var x, y, oldx, oldy, mass;
function Joint (__x, __y, _mass) {
super();
x = __x;
y = __y;
oldx = x;
oldy = y;
mass = _mass;
}
function Update() {
var _local3 = (x - oldx) * 0.85;
var _local2 = (y - oldy) * 0.85;
oldx = x;
oldy = y;
x = x + _local3;
y = y + _local2;
}
function Kill() {
}
function Alive() {
return(true);
}
}
Symbol 3173 MovieClip [__Packages.FlyBackGib] Frame 0
class FlyBackGib extends Joint
{
var x, y, sprite, life, ang, oldx, oldy, spin;
function FlyBackGib (sprite_name, __x, __y, dir, speed, r, frame, depth) {
super();
x = __x;
y = __y;
var _local4 = _root.get_id();
if (!depth) {
depth = 12;
}
sprite = _root.objects_layer.attachMovie(sprite_name, "gi" + _local4, _local4 + (_root.depth_band * depth));
sprite._x = x;
sprite._y = y;
if (frame == undefined) {
sprite.gotoAndStop(random(sprite._framesloaded) + 1);
} else {
sprite.gotoAndStop(frame);
}
life = 80 + random(40);
ang = 0;
dir = dir * _root.degtorad;
oldx = x - (speed * Math.cos(dir));
oldy = y - (speed * Math.sin(dir));
spin = _root.radtodeg / r;
}
function Update() {
y = y + _root.gravity_y;
x = x - 4;
var _local3 = (x - oldx) * 0.95;
var _local4 = (y - oldy) * 0.95;
oldx = x;
oldy = y;
x = x + _local3;
y = y + _local4;
sprite._x = x;
sprite._y = y;
sprite._rotation = ang;
ang = ang + (_local3 * spin);
life--;
}
function Kill() {
life = -10000;
if (sprite) {
removeMovieClip(sprite);
}
sprite = 0;
}
function Alive() {
return(life > 0);
}
function InGame() {
if ((x + 20) < _root.left_border) {
return(false);
}
if ((x - 20) > _root.right_border) {
return(false);
}
if ((y + 20) < _root.top_border) {
return(false);
}
if ((y - 20) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
Kill();
}
function UnFreeze() {
}
}
Symbol 3174 MovieClip [__Packages.CableDoubleAnchor] Frame 0
class CableDoubleAnchor extends Obj
{
var id, sprite, life, n, c, grav, anchor1, anchor2, objects, x, y, aabb, n_hang, hanging, aabb_recount;
function CableDoubleAnchor (__x, __y, spritename, _n, _grav, _anchor1, _anchor2, _depth) {
super();
id = _root.get_id();
if (!_depth) {
_depth = 2;
}
if (!_grav) {
_grav = _root.gravity_y;
}
sprite = _root.objects_layer.attachMovie(spritename, "ca" + id, id + (_root.depth_band * _depth));
sprite._x = 0;
sprite._y = 0;
sprite._visible = false;
life = 100;
n = _n;
c = int(n * 0.5);
grav = _grav;
anchor1 = _anchor1;
anchor2 = _anchor2;
objects = new Array();
objects.push(new JointLoFr(0, 0, 100));
var _local4 = 0;
while (_local4 < n) {
var _local5 = sprite["c" + _local4];
objects.push(new JointLoFr(_local5._x, _local5._y, 100));
_local5.gotoAndStop(_local4 + 1);
_local4++;
}
_local4 = 0;
while (_local4 < n) {
var _local5 = sprite["c" + _local4];
objects.push(new LinkSprite(objects[_local4 + 1], objects[_local4], 0.98, _local5));
objects[objects.length - 1].r = objects[objects.length - 1].r * 0.75;
_local4++;
}
n++;
_local4 = 0;
while (_local4 < n) {
objects[_local4].x = objects[_local4].x + __x;
objects[_local4].y = objects[_local4].y + __y;
objects[_local4].oldx = objects[_local4].oldx + __x;
objects[_local4].oldy = objects[_local4].oldy + __y;
_local4++;
}
sprite._x = 0;
sprite._y = 0;
if (!anchor1) {
anchor1 = new Object();
anchor1.x = objects[0].x;
anchor1.y = objects[0].y;
}
if (!anchor2) {
anchor2 = new Object();
anchor2.x = objects[n - 1].x;
anchor2.y = objects[n - 1].y;
}
x = objects[c].x;
y = objects[c].y;
_local4 = n;
while (_local4 < 19) {
sprite["c" + _local4]._visible = false;
_local4++;
}
aabb = new Object();
aabb.w = 1;
aabb.h = 1;
aabb.x = x;
aabb.y = x;
aabb.dx = 0;
aabb.dy = 0;
n_hang = -1;
hanging = false;
aabb_recount = -1;
}
function Update() {
var _local3 = 0;
while (_local3 < n) {
objects[_local3].y = objects[_local3].y + grav;
objects[_local3].x = objects[_local3].x + (_root.wind_x * 0.1);
objects[_local3].Update();
_local3++;
}
if (aabb_recount < 0) {
_local3 = 0;
while (_local3 < n) {
aabb.x = Math.min(aabb.x, objects[_local3].x);
aabb.y = Math.min(aabb.y, objects[_local3].y);
aabb.w = Math.max(aabb.w, objects[_local3].x);
aabb.h = Math.max(aabb.h, objects[_local3].y);
_local3++;
}
aabb_recount = 10;
aabb.w = aabb.w - aabb.x;
aabb.h = aabb.h - aabb.y;
}
_local3 = n;
while (_local3 < objects.length) {
objects[_local3].Update();
objects[_local3].Render();
_local3++;
}
if (anchor1) {
if (!anchor1.mc) {
SetPos1(anchor1.x, anchor1.y);
} else {
SetPosMC1(anchor1.mc);
}
}
if (anchor2) {
if (!anchor2.mc) {
SetPos2(anchor2.x, anchor2.y);
} else {
SetPosMC2(anchor2.mc);
}
}
if (_root.knight.can_hang() || (hanging)) {
if (!hanging) {
if (_root.CollideKnight(aabb)) {
var _local5 = 800;
x = _root.knight.gethangx();
y = _root.knight.gethangy();
n_hang = -1;
_local3 = 1;
while (_local3 < (n - 1)) {
var _local7 = x - objects[_local3].x;
var _local6 = y - objects[_local3].y;
var _local4 = (_local7 * _local7) + (_local6 * _local6);
if (_local4 < _local5) {
n_hang = _local3;
_local5 = _local4;
}
_local3++;
}
if (_local5 < 800) {
if (_root.knight.hang(this)) {
hanging = true;
}
}
}
} else {
var _local7 = _root.knight.gethangx() - objects[n_hang].x;
var _local6 = _root.knight.gethangy() - objects[n_hang].y;
var _local8 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local9 = _local8 * 0.4;
_root.knight.addvx((-_local7) * 0.2);
_root.knight.addvy((-_local6) * 0.2);
objects[n_hang].x = objects[n_hang].x + (_local7 * 0.75);
objects[n_hang].y = objects[n_hang].y + (_local6 * 0.75);
}
}
x = objects[c].x;
y = objects[c].y;
aabb_recount--;
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
var _local2 = 0;
while (_local2 < objects.length) {
delete objects[_local2];
objects.splice(_local2, 1);
_local2++;
}
}
function Alive() {
return(life > -10000);
}
function InGame() {
if ((x + 100) < _root.left_border) {
return(false);
}
if ((x - 100) > _root.right_border) {
return(false);
}
if ((y + 100) < _root.top_border) {
return(false);
}
if ((y - 100) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
if (hanging) {
return(true);
}
}
function UnFreeze() {
sprite._visible = true;
}
function SetPos1(__x, __y) {
objects[0].x = __x;
objects[0].y = __y;
objects[0].oldx = __x;
objects[0].oldy = __y;
if (!anchor1) {
anchor1 = new Object();
}
anchor1.x = __x;
anchor1.y = __y;
}
function SetPos2(__x, __y) {
objects[n - 1].x = __x;
objects[n - 1].y = __y;
objects[n - 1].oldx = __x;
objects[n - 1].oldy = __y;
if (!anchor2) {
anchor2 = new Object();
}
anchor2.x = __x;
anchor2.y = __y;
}
function SetPosMC1(mc) {
SetPos1(mc._x + mc._parent._x, mc._y + mc._parent._y);
anchor1.x = mc._parent._x;
anchor1.y = mc._parent._y;
anchor1.mc = mc;
}
function SetPosMC2(mc) {
SetPos2(mc._x + mc._parent._x, mc._y + mc._parent._y);
anchor2.x = mc._parent._x;
anchor2.y = mc._parent._y;
anchor2.mc = mc;
}
function unhang() {
hanging = false;
}
function get_vy() {
if (!hanging) {
return(0);
}
return(objects[n_hang].oldy - objects[n_hang].y);
}
function Play(frame_shift) {
if (!frame_shift) {
frame_shift = 1;
}
var _local2 = n;
while (_local2 < objects.length) {
var _local3 = frame_shift * (_local2 - n);
_local3 = _local3 % objects[_local2].sprite._framesloaded;
objects[_local2].sprite.gotoAndPlay(_local3 + 1);
_local2++;
}
}
function Add() {
var _local2 = sprite["c" + n];
_local2._visible = true;
var _local5 = new JointLoFr(objects[n - 1].x, objects[n - 1].y + 30, 100);
objects.splice(n, 0, _local5);
objects[objects.length - 1].sprite = _local2;
objects[objects.length - 1].r = 30;
var _local4 = sprite.c14;
_local4._visible = true;
var _local3 = new LinkSprite(objects[n], objects[n - 1], 0.98, _local4);
_local3.r = 40;
objects.push(_local3);
n++;
if (hanging) {
n_hang++;
}
}
}
Symbol 3175 MovieClip [__Packages.JointLoFr] Frame 0
class JointLoFr extends Obj
{
var x, y, oldx, oldy, mass;
function JointLoFr (__x, __y, _mass) {
super();
x = __x;
y = __y;
oldx = x;
oldy = y;
mass = _mass;
}
function Update() {
var _local3 = (x - oldx) * 0.98;
var _local2 = (y - oldy) * 0.98;
oldx = x;
oldy = y;
x = x + _local3;
y = y + _local2;
}
function Alive() {
return(true);
}
}
Symbol 3176 MovieClip [__Packages.Brick] Frame 0
class Brick
{
var mc, x, y, type;
function Brick (_mc, _type, _dx, _dy) {
mc = _mc;
if (_dx != undefined) {
x = _dx;
} else {
x = 0;
}
if (_dy != undefined) {
y = _dy;
} else {
y = 0;
}
if (_type != undefined) {
type = _type;
} else {
type = 0;
}
}
function Collide(aabb) {
var _local4 = (aabb.x + aabb.w) - (mc._x + x);
if (_local4 < 0) {
return(false);
}
var _local7 = aabb.x - ((mc._x + x) + mc._width);
if (_local7 > 0) {
return(false);
}
var _local3 = (aabb.y + aabb.h) - (mc._y + y);
if (_local3 < 0) {
return(false);
}
var _local6 = aabb.y - ((mc._y + y) + mc._height);
if (_local6 > 0) {
return(false);
}
if (Math.abs(_local3) > Math.abs(_local6)) {
_local3 = _local6;
}
if (Math.abs(_local4) > Math.abs(_local7)) {
_local4 = _local7;
}
if ((Math.abs(_local4) > 0.1) && (Math.abs(_local3) > 0.1)) {
if ((Math.abs(_local4) + 0.1) < Math.abs(_local3)) {
_root.p.x = _root.p.x - _local4;
_root.collided_brick = this;
return(true);
}
_root.p.y = _root.p.y - _local3;
_root.collided_brick = this;
return(true);
}
}
function getx() {
return(mc._x + x);
}
function gety() {
return(mc._x + y);
}
function getw() {
return(mc._width);
}
function geth() {
return(mc._height);
}
function CollidePoint(px, py) {
var _local3 = px - (mc._x + x);
if ((_local3 < 0) || (_local3 > mc._width)) {
return(false);
}
var _local2 = py - (mc._y + y);
if ((_local2 < 0) || (_local2 > mc._height)) {
return(false);
}
return(true);
}
}
Symbol 3177 MovieClip [__Packages.SlopeUL] Frame 0
class SlopeUL extends Brick
{
var mc, x, y, type, k;
function SlopeUL (_mc, _type, _dx, _dy) {
super();
mc = _mc;
if (_dx != undefined) {
x = _dx;
} else {
x = 0;
}
if (_dy != undefined) {
y = _dy;
} else {
y = 0;
}
if (_type != undefined) {
type = _type;
} else {
type = 0;
}
k = mc._height / mc._width;
}
function Collide(aabb) {
var _local5 = (aabb.x + aabb.w) - (mc._x + x);
if (_local5 < 0) {
return(false);
}
var _local6 = aabb.x - ((mc._x + x) + mc._width);
if (_local6 > 0) {
return(false);
}
var _local3 = (aabb.y + aabb.h) - (mc._y + y);
if (_local3 < 0) {
return(false);
}
var _local7 = aabb.y - ((mc._y + y) + mc._height);
if (_local7 > 0) {
return(false);
}
if ((_local6 > (-aabb.w)) || (_local7 > ((-aabb.h) + 10))) {
if (Math.abs(_local3) > Math.abs(_local7)) {
_local3 = _local7;
}
if (Math.abs(_local5) > Math.abs(_local6)) {
_local5 = _local6;
}
if ((Math.abs(_local5) > 0.1) && (Math.abs(_local3) > 0.1)) {
if ((Math.abs(_local5) + 2) < Math.abs(_local3)) {
_root.p.x = _root.p.x - _local5;
_root.collided_brick = this;
return(true);
}
_root.p.y = _root.p.y - _local3;
_root.collided_brick = this;
return(true);
}
} else {
var _local8 = ((-(_local6 + (aabb.w * 0.5))) * k) - _local3;
if (_local8 < 0) {
_root.p.y = _root.p.y + _local8;
_root.collided_brick = this;
return(true);
}
}
return(false);
}
function getx() {
return(mc._x + x);
}
function gety() {
return(mc._x + y);
}
function getw() {
return(mc._width);
}
function geth() {
return(mc._height);
}
function CollidePoint(px, py) {
var _local3 = px - (mc._x + x);
if ((_local3 < 0) || (_local3 > mc._width)) {
return(false);
}
var _local2 = py - (mc._y + y);
if ((_local2 < 0) || (_local2 > mc._height)) {
return(false);
}
var _local4 = ((-(px - ((mc._x + x) + mc._width))) * k) - _local2;
if (_local4 > 0) {
return(false);
}
return(true);
}
}
Symbol 3178 MovieClip [__Packages.SlopePlatformUL] Frame 0
class SlopePlatformUL extends Platform
{
var mc, x, y, type, k;
function SlopePlatformUL (_mc, _type, _dx, _dy) {
super();
mc = _mc;
if (_dx != undefined) {
x = _dx;
} else {
x = 0;
}
if (_dy != undefined) {
y = _dy;
} else {
y = 0;
}
if (_type != undefined) {
type = _type;
} else {
type = 0;
}
k = mc._height / mc._width;
}
function Collide(aabb) {
var _local8 = (aabb.x + aabb.w) - (mc._x + x);
if (_local8 < 0) {
return(false);
}
var _local4 = aabb.x - ((mc._x + x) + mc._width);
if (_local4 > 0) {
return(false);
}
var _local5 = (aabb.y + aabb.h) - (mc._y + y);
if (_local5 < 0) {
return(false);
}
var _local6 = aabb.y - ((mc._y + y) + mc._height);
if (_local6 > 0) {
return(false);
}
if ((_local4 > (-aabb.w)) || (_local6 > ((-aabb.h) + 10))) {
} else {
var _local7 = ((-(_local4 + (aabb.w * 0.5))) * k) - _local5;
if (_local7 < 0) {
_root.p.y = _root.p.y + _local7;
_root.collided_brick = this;
return(true);
}
}
return(false);
}
function getx() {
return(mc._x + x);
}
function gety() {
return(mc._x + y);
}
function getw() {
return(mc._width);
}
function geth() {
return(mc._height);
}
function CollidePoint(px, py) {
var _local3 = px - (mc._x + x);
if ((_local3 < 0) || (_local3 > mc._width)) {
return(false);
}
var _local2 = py - (mc._y + y);
if ((_local2 < 0) || (_local2 > mc._height)) {
return(false);
}
var _local4 = ((-(px - ((mc._x + x) + mc._width))) * k) - _local2;
if (_local4 > 0) {
return(false);
}
return(true);
}
}
Symbol 3179 MovieClip [__Packages.BreakableBrick] Frame 0
class BreakableBrick
{
var life, mc, x, y, type;
function BreakableBrick (_mc, _type, _dx, _dy) {
life = 20;
mc = _mc;
if (_dx != undefined) {
x = _dx;
} else {
x = 0;
}
if (_dy != undefined) {
y = _dy;
} else {
y = 0;
}
if (_type != undefined) {
type = _type;
} else {
type = 0;
}
}
function Break() {
var _local5 = (mc._y + y) + (mc._height * 0.5);
var _local4 = 32;
var _local3 = (mc._x + x) + _local4;
while (_local3 < (((mc._x + x) + mc._width) - _local4)) {
_root.objects.push(new SpinningGib("metal_gibs", _local3, _local5, random(360), 1, 10, random(7) + 9, 14));
_local3 = _local3 + _local4;
}
if (mc._framesloaded > 2) {
mc.gotoAndPlay("die");
} else {
mc._visible = false;
}
life = -10000;
_root.sound("snd_brick_break");
return(true);
}
function Collide(aabb) {
if (life < 0) {
return(false);
}
var _local4 = (aabb.x + aabb.w) - (mc._x + x);
if (_local4 < 0) {
return(false);
}
var _local7 = aabb.x - ((mc._x + x) + mc._width);
if (_local7 > 0) {
return(false);
}
var _local3 = (aabb.y + aabb.h) - (mc._y + y);
if (_local3 < 0) {
return(false);
}
var _local6 = aabb.y - ((mc._y + y) + mc._height);
if (_local6 > 0) {
return(false);
}
if (Math.abs(_local3) > Math.abs(_local6)) {
_local3 = _local6;
}
if (Math.abs(_local4) > Math.abs(_local7)) {
_local4 = _local7;
}
if ((Math.abs(_local4) > 0.1) && (Math.abs(_local3) > 0.1)) {
if ((Math.abs(_local4) + 0.1) < Math.abs(_local3)) {
_root.p.x = _root.p.x - _local4;
_root.collided_brick = this;
if (life > 0) {
life--;
return(true);
}
return(Break());
}
_root.p.y = _root.p.y - _local3;
_root.collided_brick = this;
if (life > 0) {
life--;
return(true);
}
return(Break());
}
}
function getx() {
return(mc._x + x);
}
function gety() {
return(mc._x + y);
}
function getw() {
return(mc._width);
}
function geth() {
return(mc._height);
}
function CollidePoint(px, py) {
if (life < 0) {
return(false);
}
var _local3 = px - (mc._x + x);
if ((_local3 < 0) || (_local3 > mc._width)) {
return(false);
}
var _local2 = py - (mc._y + y);
if ((_local2 < 0) || (_local2 > mc._height)) {
return(false);
}
return(true);
}
}
Symbol 3180 MovieClip [__Packages.PlatformNoBulletCollide] Frame 0
class PlatformNoBulletCollide extends Platform
{
var x, mc, y;
function PlatformNoBulletCollide (_mc, _type, _dx, _dy) {
super(_mc, _type, _dx, _dy);
}
function Collide(aabb) {
if (_root.cycle_state.current_state == _root.cycle_state.UPDATING_PLAYER_BULLETS) {
return(false);
}
var _local6 = (aabb.x + aabb.w) - (mc._x + x);
if (_local6 < 0) {
return(false);
}
var _local7 = aabb.x - ((mc._x + x) + mc._width);
if (_local7 > 0) {
return(false);
}
var _local3 = (aabb.y + aabb.h) - (mc._y + y);
if (_local3 < 0) {
return(false);
}
var _local5 = aabb.y - ((mc._y + y) + mc._height);
if (_local5 > 0) {
return(false);
}
if (Math.abs(_local3) > Math.abs(_local5)) {
_local3 = _local5;
}
if ((_local3 > 0) && (_local3 < mc._height)) {
_root.p.y = _root.p.y - _local3;
_root.collided_brick = this;
return(true);
}
}
}
Symbol 3181 MovieClip [__Packages.MenuController] Frame 0
class MenuController extends Obj
{
var sprite, x, y, strings, menu_mode, level_name, saved, current_level, levels_passed, unpaused, on_kongregate, portal_name, selected_level_button, score_phase, score_mode, display_score, score_increment, last_score, win, input_focused, input_modified, cursor_blink;
function MenuController (_sprite) {
super();
sprite = _sprite;
x = sprite._x;
y = sprite._y;
strings = _root.menu_strings_eng;
menu_mode = NONE;
level_name = 0;
saved = SharedObject.getLocal("intrusion_saved_data_04");
if (!saved.data.exist) {
saved.data.exist = true;
saved.data.levels_available = 1;
saved.data.level_states = new Array();
var _local4 = 0;
while (_local4 < N_LEVELS) {
saved.data.level_states.push(new PlayerState());
_local4++;
}
saved.data.sound_volume = 100;
saved.data.detailed_sky = true;
_root.detailed_sky = true;
Flush();
}
if (saved.data.levels_available == undefined) {
saved.data.levels_available = 5;
}
if (saved.data.detailed_sky == undefined) {
saved.data.detailed_sky = true;
}
if (saved.data.sound_volume == undefined) {
saved.data.sound_volume = 100;
}
if (saved.data.difficulty == undefined) {
saved.data.difficulty = "normal";
saved.data.levels_available_easy = 1;
saved.data.levels_available_super_easy = 1;
saved.data.level_states_easy = new Array();
var _local4 = 0;
while (_local4 < N_LEVELS) {
saved.data.level_states_easy.push(new PlayerState());
_local4++;
}
_local4 = 0;
while (_local4 < N_LEVELS) {
saved.data.level_states_super_easy.push(new PlayerState());
_local4++;
}
}
if (saved.data.levels_available > saved.data.levels_available_easy) {
var _local4 = saved.data.levels_available_easy;
while (_local4 <= saved.data.levels_available) {
saved.data.level_states_easy[_local4] = new PlayerState(saved.data.level_states[_local4]);
_local4++;
}
saved.data.levels_available_easy = saved.data.levels_available;
}
if (saved.data.levels_available_easy > saved.data.levels_available_super_easy) {
var _local4 = saved.data.levels_available_super_easy;
while (_local4 <= saved.data.levels_available_easy) {
saved.data.level_states_super_easy[_local4] = new PlayerState(saved.data.level_states_easy[_local4]);
_local4++;
}
saved.data.levels_available_super_easy = saved.data.levels_available_easy;
}
if (saved.data.died_once == undefined) {
saved.data.died_once = false;
}
SetDifficulty(saved.data.difficulty);
SetDetailedSky(saved.data.detailed_sky);
SetVolume(saved.data.sound_volume);
current_level = "level1";
Update = UpdateMainMenu;
levels_passed = 0;
unpaused = false;
on_kongregate = true;
if (_root._url.indexOf("kongregate.com") == -1) {
on_kongregate = false;
}
portal_name = "";
if (on_kongregate) {
portal_name = "_kongregate";
} else {
mochi.MochiServices.connect("69002742f9385b3b", _root.scoreboard_container);
var _local5 = "dafd7b6916c58978";
if (saved.data.difficulty == "easy") {
_local5 = "740e615595e90a6f";
}
mochi.MochiScores.setBoardID(_local5);
}
}
function Update() {
}
function UpdateMainMenu() {
if ((sprite._currentframe < 100) && (Key.getAscii())) {
sprite.gotoAndPlay(100);
}
if (menu_mode == OPTIONS) {
if ((Key.isDown(1) || (Key.isDown(32))) || (_root.mouse_pressed)) {
var _local3 = saved.data.sound_volume;
if (sprite.options.less.mouse_over) {
_local3 = _root.limit(_local3 - 2, 0, 100);
} else if (sprite.options.moar.mouse_over) {
_local3 = _root.limit(_local3 + 2, 0, 100);
}
if (_local3 != saved.data.sound_volume) {
SetVolume(_local3);
_root.sound("snd_bomb_activate");
}
}
}
}
function Init(_sprite) {
_root._x = 0;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
selected_level_button = 0;
if (_sprite) {
sprite = _sprite;
}
Update = UpdateMainMenu;
if (on_kongregate) {
sprite.main.gotoAndStop("kongregate");
}
SetButton(sprite.main.button1, strings.new_game, true, NewGameClick);
SetButton(sprite.main.button2, strings.highscore, true, HighscoreClick);
SetButton(sprite.main.button3, strings.options, true, OptionsClick);
SetButton(sprite.main.button4, strings.credits, true, CreditsClick);
SetButton(sprite.main.button5, strings.more_games, true, RedirectSponsor);
SetButton(sprite.main.button_continue, strings.continue_game, true, ContinueClick);
_root.print_mc(sprite.main._version, _root._version);
_root.print_mc(sprite.levels.select_level, strings.select_level);
_root.print_mc(sprite.levels.level_description, strings.level0);
SetButton(sprite.levels.start_button, strings.start_button, false, StartClick);
_root.print_mc(sprite.levels.difficulty, strings.difficulty);
SetButton(sprite.levels.button_normal, strings.normal_mode, true, SetNormal);
SetButton(sprite.levels.button_easy, strings.easy_mode, saved.data.died_once, SetEasy);
SetButton(sprite.levels.button_super_easy, strings.super_easy_mode, true, SetSuperEasy);
DisplayDifficulty(saved.data.difficulty);
_root.print_mc(sprite.options._text1, strings.options1);
_root.print_mc(sprite.options._text2, strings.sound_volume);
SetButton(sprite.options.button1, strings.detailed_sky, true, ToggleDetailedSky);
sprite.options.less.active = true;
sprite.options.moar.active = true;
_root.print_mc(sprite.options.sound_volume, "" + saved.data.sound_volume);
SetDetailedSky(saved.data.detailed_sky);
_root.print_mc(sprite.credits._text1, strings.credits1);
_root.print_mc(sprite.credits._text2, strings.credits2);
_root.print_mc(sprite.credits._text3, strings.credits3);
SetButton(sprite.credits.button1, strings.credits4, true, Redirect);
level_name = 0;
selected_level_button = 0;
menu_mode = NONE;
sprite.sponsor_logo.onRelease = RedirectSponsor;
sprite.text_loading._visible = false;
_root.print_mc(sprite.text_loading, strings.loading);
return(undefined);
}
function SetButton(button, _text, active, on_click) {
if (button._text) {
_root.print_mc(button._text, _text);
}
button.active = active;
button.on_click = on_click;
}
function NewGameClick() {
if (_root.menu_controller.menu_mode == _root.menu_controller.LEVEL_SELECT) {
return(undefined);
}
var _local2 = _root.menu_controller.sprite;
switch (_root.menu_controller.menu_mode) {
case _root.menu_controller.NONE :
_local2.gotoAndPlay("show_level_menu");
_local2.play_next = 0;
break;
case _root.menu_controller.HIGHSCORE :
_local2.gotoAndPlay("show_level_menu");
_root.menu_controller.MenuHideHighscore();
break;
case _root.menu_controller.OPTIONS :
_local2.gotoAndPlay("hide_options");
_local2.play_next = "show_level_menu";
break;
case _root.menu_controller.CREDITS :
_local2.gotoAndPlay("hide_credits");
_local2.play_next = "show_level_menu";
break;
}
_root.menu_controller.menu_mode = _root.menu_controller.LEVEL_SELECT;
}
function OptionsClick() {
if (_root.menu_controller.menu_mode == _root.menu_controller.OPTIONS) {
return(undefined);
}
var _local2 = _root.menu_controller.sprite;
switch (_root.menu_controller.menu_mode) {
case _root.menu_controller.NONE :
_local2.gotoAndPlay("show_options");
_local2.play_next = 0;
break;
case _root.menu_controller.HIGHSCORE :
_local2.gotoAndPlay("show_options");
_root.menu_controller.MenuHideHighscore();
break;
case _root.menu_controller.CREDITS :
_local2.gotoAndPlay("hide_credits");
_local2.play_next = "show_options";
break;
case _root.menu_controller.LEVEL_SELECT :
_local2.gotoAndPlay("hide_level_menu");
_local2.play_next = "show_options";
break;
}
_root.menu_controller.menu_mode = _root.menu_controller.OPTIONS;
}
function CreditsClick() {
if (_root.menu_controller.menu_mode == _root.menu_controller.CREDITS) {
return(undefined);
}
var _local2 = _root.menu_controller.sprite;
switch (_root.menu_controller.menu_mode) {
case _root.menu_controller.NONE :
_local2.gotoAndPlay("show_credits");
_local2.play_next = 0;
break;
case _root.menu_controller.HIGHSCORE :
_local2.gotoAndPlay("show_credits");
_root.menu_controller.MenuHideHighscore();
break;
case _root.menu_controller.OPTIONS :
_local2.gotoAndPlay("hide_options");
_local2.play_next = "show_credits";
break;
case _root.menu_controller.LEVEL_SELECT :
_local2.gotoAndPlay("hide_level_menu");
_local2.play_next = "show_credits";
break;
}
_root.menu_controller.menu_mode = _root.menu_controller.CREDITS;
}
function HighscoreClick() {
if (_root.menu_controller.on_kongregate) {
return(undefined);
}
if (_root.menu_controller.menu_mode == _root.menu_controller.HIGHSCORE) {
return(undefined);
}
var _local2 = _root.menu_controller.sprite;
switch (_root.menu_controller.menu_mode) {
case _root.menu_controller.NONE :
_local2.play_next = 0;
break;
case _root.menu_controller.CREDITS :
_local2.gotoAndPlay("hide_credits");
_local2.play_next = 0;
break;
case _root.menu_controller.OPTIONS :
_local2.gotoAndPlay("hide_options");
_local2.play_next = 0;
break;
case _root.menu_controller.LEVEL_SELECT :
_local2.gotoAndPlay("hide_level_menu");
_local2.play_next = 0;
break;
}
_root.menu_controller.menu_mode = _root.menu_controller.HIGHSCORE;
_local2.text_loading._visible = true;
_root.print_mc(_local2.text_loading, _root.menu_controller.strings.loading);
_root.scoreboard_container._x = 250;
_root.scoreboard_container._y = 160;
_root.scoreboard_container._visible = true;
var _local3 = new Object();
_local3.res = "400x250";
_local3.onError = _root.menu_controller.MenuConnectionError;
_local3.onClose = _root.menu_controller.MenuHideLoading;
_local3.hideDoneButton = true;
mochi.MochiScores.showLeaderboard(_local3);
}
function MenuConnectionError() {
_root._menu.text_loading._visible = true;
_root.print_mc(_root._menu.text_loading, _root.menu_controller.strings.connection_error);
}
function MenuHideLoading() {
}
function MenuHideHighscore() {
if (on_kongregate) {
return(undefined);
}
mochi.MochiScores.closeLeaderboard();
_root._menu.text_loading._visible = false;
}
function StartClick() {
_root.menu_controller.StartLevel();
}
function SetLevelButton(button, _level_name, active, on_click, description, frame_shift) {
button.active = active;
button.on_click = on_click;
button.level_name = _level_name;
button.description = description;
button.frame_shift = frame_shift;
if (active) {
button.gotoAndStop(frame_shift + 1);
} else {
button.gotoAndStop(frame_shift);
}
}
function SelectLevel(button) {
if (selected_level_button) {
selected_level_button.Deselect();
}
selected_level_button = button;
if (!level_name) {
sprite.levels.start_button.activate();
}
level_name = button.level_name;
_root.print_mc(sprite.levels.level_description, button.description);
}
function StartLevel() {
if (!level_name) {
return(undefined);
}
_root.StartGame();
current_level = level_name;
var _local3 = LevelNumber(current_level);
_root.level_finish_state = new PlayerState(saved.data.level_states[_local3 - 1]);
_root.gotoAndStop(current_level);
_root.lives = 3;
_root.score = 0;
levels_passed = 0;
unpaused = false;
if (saved.data.difficulty == "easy") {
_root.lives = 5;
}
if (saved.data.difficulty == "super_easy") {
_root.lives = 7;
}
if (!on_kongregate) {
MenuHideHighscore();
}
}
function ContinueClick() {
_root.menu_controller.ContinueLast();
}
function ContinueLast() {
if (saved.data.difficulty == "normal") {
level_name = LevelName(saved.data.levels_available);
StartLevel();
}
if (saved.data.difficulty == "easy") {
level_name = LevelName(saved.data.levels_available_easy);
StartLevel();
}
if (!on_kongregate) {
MenuHideHighscore();
}
}
function NextLevel(next_level) {
if (on_kongregate) {
if (saved.data.difficulty == "normal") {
switch (current_level) {
case "level1" :
_root.kongregateStats.submit("Level1Complete", 1);
break;
case "level2" :
_root.kongregateStats.submit("Level2Complete", 1);
break;
case "level3" :
_root.kongregateStats.submit("Level3Complete", 1);
break;
case "level4" :
_root.kongregateStats.submit("Level4Complete", 1);
}
}
if (saved.data.difficulty == "easy") {
switch (current_level) {
case "level1" :
_root.kongregateStats.submit("Level1CompleteEasy", 1);
break;
case "level2" :
_root.kongregateStats.submit("Level2CompleteEasy", 1);
break;
case "level3" :
_root.kongregateStats.submit("Level3CompleteEasy", 1);
break;
case "level4" :
_root.kongregateStats.submit("Level4CompleteEasy", 1);
}
}
}
current_level = next_level;
var _local4 = LevelNumber(current_level);
_root.level_finish_state.Save();
if (_root.level_finish_state) {
saved.data.level_states[_local4 - 1] = new PlayerState(_root.level_finish_state);
}
saved.data.level_states[_local4 - 1].Save();
_root.GotoLevel(next_level);
var _local6 = saved.data.difficulty;
if (_local6 == "normal") {
var _local5 = saved.data.levels_available;
if (_local4 > _local5) {
_local5 = _local4;
}
saved.data.levels_available = _local5;
}
if (_local6 == "easy") {
var _local5 = saved.data.levels_available_easy;
if (_local4 > _local5) {
_local5 = _local4;
}
saved.data.levels_available_easy = _local5;
}
if (_local6 == "super_easy") {
var _local5 = saved.data.levels_available_super_easy;
if (_local4 > _local5) {
_local5 = _local4;
}
saved.data.levels_available_super_easy = _local5;
}
if (saved.data.levels_available > saved.data.levels_available_easy) {
var _local3 = saved.data.levels_available_easy;
while (_local3 <= saved.data.levels_available) {
saved.data.level_states_easy[_local3] = new PlayerState(saved.data.level_states[_local3]);
_local3++;
}
saved.data.levels_available_easy = saved.data.levels_available;
}
if (saved.data.levels_available_easy > saved.data.levels_available_super_easy) {
var _local3 = saved.data.levels_available_super_easy;
while (_local3 <= saved.data.levels_available_easy) {
saved.data.level_states_super_easy[_local3] = new PlayerState(saved.data.level_states_easy[_local3]);
_local3++;
}
saved.data.levels_available_super_easy = saved.data.levels_available_easy;
}
Flush();
levels_passed++;
unpaused = false;
}
function LevelFail() {
}
function LevelNumber(_level_name) {
var _local1 = 1;
switch (_level_name) {
case "level2" :
_local1 = 2;
break;
case "level3" :
_local1 = 3;
break;
case "level4" :
_local1 = 4;
break;
case "final" :
_local1 = 5;
break;
default :
_local1 = 6;
}
return(_local1);
}
function LevelName(_level_number) {
var _local1 = "level1";
switch (_level_number) {
case 1 :
_local1 = "level1";
break;
case 2 :
_local1 = "level2";
break;
case 3 :
_local1 = "level3";
break;
case 4 :
_local1 = "level4";
break;
case 5 :
_local1 = "final";
}
return(_local1);
}
function Flush() {
saved.flush();
}
function ToggleDetailedSky() {
_root.detailed_sky = !_root.detailed_sky;
_root.menu_controller.SetDetailedSky(_root.detailed_sky);
}
function SetDetailedSky(new_value) {
_root.detailed_sky = new_value;
if (new_value) {
sprite.options.detailed_sky_checkbox.gotoAndStop("checked");
} else {
sprite.options.detailed_sky_checkbox.gotoAndStop("unchecked");
}
saved.data.detailed_sky = new_value;
Flush();
}
function SetVolume(vol) {
_root.global_snd.setVolume(vol);
_root.print_mc(sprite.options.sound_volume, "" + vol);
saved.data.sound_volume = vol;
Flush();
}
function Redirect() {
getURL ("http://vap.mirgames.ru", "_blank");
}
function RedirectSponsor() {
getURL ("http://www.kongregate.com/?gamereferral=intrusion", "_blank");
}
function Alive() {
return(true);
}
function Kill() {
}
function UpdateGameOver() {
_root.scoreboard_container._x = (-_root._x) + 180;
_root.scoreboard_container._y = (-_root._y) + 195;
_root.scoreboard_container._visible = true;
score_phase++;
switch (score_mode) {
case 0 :
_root.ui.anouncer.score_counter._visible = false;
if (score_phase >= 35) {
score_phase = 0;
score_mode = 1;
}
break;
case 1 :
_root.ui.anouncer.score_counter._visible = true;
display_score = display_score + score_increment;
if (display_score >= last_score) {
score_phase = 0;
score_mode = 2;
display_score = last_score;
_root.sound("snd_stone_boom");
if (!win) {
_root.ui.anouncer.gotoAndStop("game_over_submit" + portal_name);
} else {
_root.ui.anouncer.gotoAndStop("win_submit" + portal_name);
}
if (!on_kongregate) {
SetButton(_root.ui.anouncer.button_submit, strings.submit, true, SubmitClick);
}
SetButton(_root.ui.anouncer.button_main_menu, strings.main_menu, true, _root.MainMenu);
_root.ui.anouncer.score_blur._visible = false;
_root.print_mc(_root.ui.anouncer._text, strings.total_score);
_root.ui.anouncer.name_input.onSetFocus = FocusInput;
_root.ui.anouncer.name_input.onKillFocus = UnFocusInput;
_root.ui.anouncer.sponsor_logo.onRelease = RedirectSponsor;
SetButton(_root.ui.anouncer.button_more_games, strings.more_games_on, true, RedirectSponsor);
SetButton(_root.ui.anouncer.button_continue, strings.continue_game, true, RestartLastLevelClick);
if ((!win) && (!saved.data.died_once)) {
_root.print_mc(_root.ui.anouncer.text_easy_unlocked, strings.easy_mode_unlocked);
saved.data.died_once = true;
Flush();
} else {
_root.ui.anouncer.text_easy_unlocked._visible = false;
}
}
_root.print_int(_root.ui.anouncer.score_counter, int(display_score), 9);
_root.ui.anouncer.score_counter._x = (360 - (("" + int(display_score)).length * 28)) - _root.ui.anouncer._x;
input_focused = false;
input_modified = false;
break;
case 2 :
display_score = last_score;
_root.print_int(_root.ui.anouncer.score_counter, int(display_score), 9);
var _local3 = "";
}
cursor_blink++;
}
function GameOver(_win) {
if (_win) {
_root.ui.anouncer.gotoAndPlay("win");
if (on_kongregate) {
if (saved.data.difficulty == "normal") {
_root.kongregateStats.submit("FinalLevelComplete", 1);
if (levels_passed == 4) {
_root.kongregateStats.submit("GameComplete", 1);
}
if ((levels_passed == 4) && (_root.lives == 3)) {
_root.kongregateStats.submit("GameCompleteNoDie", 1);
}
}
if (saved.data.difficulty == "easy") {
_root.kongregateStats.submit("FinalLevelCompleteEasy", 1);
if (levels_passed == 4) {
_root.kongregateStats.submit("GameCompleteEasy", 1);
}
if ((levels_passed == 4) && (_root.lives == 3)) {
_root.kongregateStats.submit("GameCompleteNoDieEasy", 1);
}
}
}
} else {
_root.ui.anouncer.gotoAndPlay("game_over");
}
last_score = _root.score;
display_score = 0;
score_increment = last_score / 60;
score_mode = (score_phase = 0);
win = _win;
cursor_blink = 0;
unpaused = false;
if (on_kongregate) {
if (saved.data.difficulty == "normal") {
_root.kongregateScores.submit(last_score);
}
if (saved.data.difficulty == "easy") {
_root.kongregateStats.submit("HighScoreEasy", last_score);
}
if (saved.data.difficulty == "super_easy") {
_root.kongregateStats.submit("HighScoreSuperEasy", last_score);
}
}
Update = UpdateGameOver;
}
function SubmitClick() {
_root.menu_controller.Submit();
}
function Submit() {
if (on_kongregate) {
return(undefined);
}
if ((!on_kongregate) && (mochi.MochiServices.__get__connected())) {
var _local3 = new Object();
_local3.score = last_score;
_local3.onClose = HideMochiScoreboard;
_local3.onError = ErrorScoreboard;
_local3.res = "400x250";
mochi.MochiScores.showLeaderboard(_local3);
if (win) {
_root.ui.anouncer.gotoAndStop("win_submit_start");
} else {
_root.ui.anouncer.gotoAndStop("game_over_submit_start");
}
_root.print_mc(_root.ui.anouncer.text_loading, strings.loading);
}
if ((!on_kongregate) && (!mochi.MochiServices.__get__connected())) {
if (win) {
_root.ui.anouncer.gotoAndStop("win_submit_end");
} else {
_root.ui.anouncer.gotoAndStop("game_over_submit_end");
}
_root.print_mc(_root.ui.anouncer.text_loading, strings.connection_error);
}
}
function HideMochiScoreboard() {
if (_root.menu_controller.win) {
_root.ui.anouncer.gotoAndStop("win_submit_end");
} else {
_root.ui.anouncer.gotoAndStop("game_over_submit_end");
}
_root.ui.anouncer.text_loading._visible = false;
}
function ErrorScoreboard() {
if (_root.menu_controller.win) {
_root.ui.anouncer.gotoAndStop("win_submit_end");
} else {
_root.ui.anouncer.gotoAndStop("game_over_submit_end");
}
_root.print_mc(_root.ui.anouncer.text_loading, _root.menu_controller.strings.connection_error);
}
function FocusInput() {
return(undefined);
}
function UnFocusInput() {
return(undefined);
}
function Pause() {
var _local3 = saved.data.sound_volume;
_root.ui.anouncer.gotoAndStop("pause");
unpaused = false;
}
function InitPauseMenu() {
var _local3 = _root.ui.anouncer;
SetButton(_local3.button1, strings.continue_play, true, Continue);
SetButton(_local3.button2, strings.main_menu, true, _root.MainMenu);
_root.print_mc(_local3._text2, strings.sound_volume);
_local3.less.active = true;
_local3.moar.active = true;
_root.print_mc(_local3.sound_volume, "" + saved.data.sound_volume);
var _local4 = saved.data.sound_volume;
_root.print_mc(_local3.sound_volume, "" + _local4);
}
function UnPause() {
var _local3 = saved.data.sound_volume;
_root.ui.anouncer.gotoAndStop("empty");
}
function Continue() {
_root.menu_controller.unpaused = true;
}
function UpdatePause() {
var _local4 = _root.ui.anouncer;
if ((Key.isDown(1) || (Key.isDown(32))) || (_root.mouse_pressed)) {
var _local3 = saved.data.sound_volume;
if (_local4.less.mouse_over) {
_local3 = _root.limit(_local3 - 2, 0, 100);
} else if (_local4.moar.mouse_over) {
_local3 = _root.limit(_local3 + 2, 0, 100);
}
if (_local3 != saved.data.sound_volume) {
SetVolume(_local3);
_root.sound("snd_bomb_activate");
_root.print_mc(_local4.sound_volume, "" + _local3);
}
}
}
function DisplayDifficulty(dif, unlock) {
if (dif == "normal") {
sprite.levels.checkbox_normal.gotoAndStop("checked");
} else {
sprite.levels.checkbox_normal.gotoAndStop("unchecked");
}
if (dif == "easy") {
sprite.levels.checkbox_easy.gotoAndStop("checked");
} else {
sprite.levels.checkbox_easy.gotoAndStop("unchecked");
}
if (!saved.data.died_once) {
sprite.levels.checkbox_easy.gotoAndStop("inactive");
sprite.levels.button_easy.gotoAndStop("inactive");
}
var _local2 = saved.data.levels_available;
if (dif == "easy") {
_local2 = saved.data.levels_available_easy;
}
if (unlock) {
_local2 = 1000;
}
SetLevelButton(sprite.levels.button1, "level1", true, 0, strings.level1, 1);
SetLevelButton(sprite.levels.button2, "level2", _local2 > 1, 0, strings.level2, 10);
SetLevelButton(sprite.levels.button3, "level3", _local2 > 2, 0, strings.level3, 20);
SetLevelButton(sprite.levels.button4, "level4", _local2 > 3, 0, strings.level4, 30);
SetLevelButton(sprite.levels.button5, "final", _local2 > 4, 0, strings.level5, 40);
if (selected_level_button) {
var _local3 = LevelNumber(level_name);
if (dif == "normal") {
if (_local3 > saved.data.levels_available) {
_local3 = saved.data.levels_available;
}
}
if (dif == "easy") {
if (_local3 > saved.data.levels_available_easy) {
_local3 = saved.data.levels_available_easy;
}
}
sprite.levels["button" + _local3].Select();
}
}
function SetDifficulty(dif) {
saved.data.difficulty = dif;
DisplayDifficulty(dif);
_root.difficulty = dif;
_root.score_mult = 1;
if (dif == "easy") {
_root.score_mult = 0.5;
}
if (dif == "super_easy") {
_root.score_mult = 0.25;
}
if (!on_kongregate) {
var _local4 = "dafd7b6916c58978";
if (dif == "easy") {
_local4 = "740e615595e90a6f";
}
mochi.MochiScores.setBoardID(_local4);
}
Flush();
}
function SetNormal() {
_root.menu_controller.SetDifficulty("normal");
}
function SetEasy() {
_root.menu_controller.SetDifficulty("easy");
}
function SetSuperEasy() {
_root.menu_controller.SetDifficulty("super_easy");
}
function GetDifficulty() {
return(saved.data.difficulty);
}
function RestartLastLevelClick() {
_root.menu_controller.RestartLastLevel();
}
function RestartLastLevel() {
_root.lives = 3;
_root.score = 0;
levels_passed = 0;
unpaused = false;
if (saved.data.difficulty == "easy") {
_root.lives = 5;
}
if (saved.data.difficulty == "super_easy") {
_root.lives = 7;
}
_root.ui.anouncer.gotoAndStop("empty");
MenuHideHighscore();
_root.RestartLevel();
}
function UnlockedEasyModeClick() {
_root.menu_controller.UnlockedEasyMode();
}
function UnlockedEasyMode() {
SetDifficulty("easy");
saved.data.died_once = true;
Flush();
RestartLastLevel();
}
function UnlockAll() {
DisplayDifficulty(GetDifficulty(), true);
}
var N_LEVELS = 6;
var NONE = 0;
var LEVEL_SELECT = 1;
var HIGHSCORE = 2;
var OPTIONS = 3;
var CREDITS = 4;
}
Symbol 3182 MovieClip [__Packages.PlayerState] Frame 0
class PlayerState extends Obj
{
var weapons, saved, life, weapon, x, y, oldx, oldy, _skin;
function PlayerState (_state) {
super();
weapons = new Array();
weapons[1] = new Object();
weapons[1].picked = true;
weapons[1].ammo = 0;
weapons[2] = new Object();
weapons[2].picked = false;
weapons[2].ammo = 0;
weapons[3] = new Object();
weapons[3].picked = false;
weapons[3].ammo = 0;
weapons[4] = new Object();
weapons[3].picked = false;
weapons[4].ammo = 0;
saved = false;
if (_state) {
Load(_state);
}
}
function Save() {
if (!_root.knight) {
return(undefined);
}
var _local3 = 1;
while (_local3 <= 4) {
weapons[_local3].picked = _root.knight.weapons[_local3].picked;
weapons[_local3].ammo = _root.knight.weapons[_local3].ammo;
_local3++;
}
weapons[1].picked = true;
life = _root.knight.life;
weapon = _root.knight.weapon;
x = _root.knight.x;
y = _root.knight.y;
oldx = _root.knight.oldx;
oldy = _root.knight.oldy;
_skin = _root.knight._skin;
saved = true;
}
function Restore(restore_pos, restore_life) {
if (!saved) {
return(undefined);
}
weapons[1].picked = true;
var _local3 = 1;
while (_local3 <= 4) {
_root.knight.weapons[_local3].picked = weapons[_local3].picked;
_root.knight.weapons[_local3].ammo = weapons[_local3].ammo;
_local3++;
}
if ((restore_life == true) && (life > 0)) {
_root.knight.life = life;
} else {
_root.knight.life = 100;
}
_root.knight.life = 100;
_root.knight.SwitchWeapon(weapon);
if (restore_pos == true) {
_root.knight.x = x;
_root.knight.y = y;
_root.knight.oldx = oldx;
_root.knight.oldy = oldy;
}
_root.knight.Skin(_skin);
}
function Load(_state) {
if (!_state) {
return(undefined);
}
var _local2 = 1;
while (_local2 <= 4) {
weapons[_local2].picked = _state.weapons[_local2].picked;
weapons[_local2].ammo = _state.weapons[_local2].ammo;
_local2++;
}
weapons[1].picked = true;
life = _state.life;
weapon = _state.weapon;
x = _state.x;
y = _state.y;
oldx = _state.oldx;
oldy = _state.oldy;
_skin = _state._skin;
saved = true;
}
}
Symbol 3183 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.32");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 3184 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 3185 MovieClip [__Packages.Checkpoint] Frame 0
class Checkpoint extends Obj
{
var x, y, func;
function Checkpoint (__x, __y, _func) {
super();
x = __x;
y = __y;
func = _func;
}
function Restore() {
var _local3 = _root.knight;
_root.knight = new Hero(x, y, "human");
_local3.last_state.Restore(false, false);
_local3.Kill();
_root.knight.Invincibility(90);
}
}
Symbol 3186 MovieClip [__Packages.Man] Frame 0
class Man extends JointCollide
{
var x, y, oldx, oldy, _skin, weapon, depth, aabb, mass, collided, life, shot, landed, action, view_side, pain, dir, sprite, hand1, hand2, id;
function Man (__x, __y, sprite_name, _weapon, __skin, _life, _depth) {
super();
x = __x;
y = __y;
oldx = x;
oldy = y;
_skin = __skin;
weapon = _weapon;
depth = _depth;
aabb = new Object();
aabb.w = 32;
aabb.h = 70;
aabb.dx = -16;
aabb.dy = -32;
aabb.x = __x;
aabb.y = __y;
mass = 4000;
collided = 0;
life = _life;
shot = function () {
};
landed = true;
action = 0;
view_side = 1;
pain = 0;
dir = 0;
}
function Skin(s) {
for (var _local3 in sprite) {
if (sprite[_local3]._currentframe != s) {
sprite[_local3].gotoAndStop(s);
} else {
sprite[_local3].stop();
}
}
for (var _local3 in hand1) {
hand1[_local3].gotoAndStop(s);
}
for (var _local3 in hand2) {
hand2[_local3].gotoAndStop(s);
}
_skin = s;
}
function SwitchWeapon(wpn) {
if (wpn == undefined) {
return(undefined);
}
weapon = wpn;
if ((!weapon) && (wpn)) {
sprite.gotoAndPlay("stand_weapon");
Skin(_skin);
}
switch (wpn) {
case 0 :
sprite.gotoAndPlay("stand");
shot = function () {
};
Skin(_skin);
break;
case 1 :
hand1.gotoAndPlay("pistol_start");
shot = ShotPistol;
break;
case 2 :
hand1.gotoAndPlay("smg_start");
shot = ShotSmg;
break;
case 3 :
hand1.gotoAndPlay("riffle_start");
shot = ShotRiffle;
break;
case 4 :
hand1.gotoAndPlay("grenade_start");
shot = ShotGrenade;
}
}
function BarrelPos() {
_root.p.x = hand1.barrel._x;
_root.p.y = hand1.barrel._y;
_root.p = hand1.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
_root.p.y = _root.p.y - 15;
}
function ShotPistol() {
}
function ShotSmg() {
}
function ShotRiffle() {
}
function ShotGrenade() {
}
function Move(movex, movey) {
if ((movey > 0) && (landed || (action == 100))) {
if (action != 100) {
if (action != 8) {
sprite.gotoAndPlay("down");
} else {
sprite.gotoAndPlay("down_p");
}
action = 100;
aabb.h = 35;
aabb.dy = -14.5;
}
if (action != 8) {
action = 100;
return(undefined);
}
} else if (action == 100) {
sprite.gotoAndPlay("up");
if (!movex) {
action = 3;
} else {
action = 5;
}
aabb.h = 70;
aabb.dy = -32;
y = y - 17.5;
oldy = oldy - 17.5;
sprite._y = sprite._y - 17.5;
}
if (pain > 0) {
action = 8;
} else if (pain == 0) {
action = 0;
}
if (landed) {
if (movex == 0) {
if (action != 8) {
if (action != 3) {
sprite.gotoAndPlay("stand_gun");
}
action = 3;
}
} else {
var _local3 = x - oldx;
if (((_local3 * movex) < 0) || (Math.abs(_local3) < 6)) {
oldx = oldx - (movex * 3);
}
if (action != 8) {
if ((view_side * movex) < 0) {
if (action != 2) {
sprite.gotoAndPlay("run_back_gun");
action = 2;
}
} else if (action != 1) {
if (action == 5) {
sprite.gotoAndPlay("landing");
} else {
sprite.gotoAndPlay("run_gun");
}
action = 1;
}
}
}
if (movey < 0) {
oldy = y - (15 * movey);
landed = false;
}
} else {
var _local3 = x - oldx;
if (((_local3 * movex) < 0) || (Math.abs(_local3) < 6)) {
x = x + (movex * 1.5);
}
var _local4 = y - oldy;
if (action != 8) {
if (_local4 < -1) {
if (action != 4) {
sprite.gotoAndPlay("fly_up");
action = 4;
}
} else if (_local4 > 2) {
if (action != 5) {
sprite.gotoAndPlay("fly_down");
action = 5;
}
}
}
}
}
function Direct(target_x, target_y) {
if (target_x < x) {
view_side = -1;
sprite._xscale = -100;
} else {
view_side = 1;
sprite._xscale = 100;
}
dir = Math.atan2((target_y - y) + 15, target_x - x) * _root.radtodeg;
if (view_side < 0) {
hand1._rotation = 180 - dir;
hand2._rotation = 180 - dir;
} else {
hand1._rotation = dir;
hand2._rotation = dir;
}
hand2.gotoAndStop(hand1._currentframe);
}
function Update() {
}
function Kill() {
life = -10000;
delete aabb;
}
function Alive() {
if (life <= -10000) {
return(false);
}
return(true);
}
function InGame() {
if ((x + 20) < _root.left_border) {
return(false);
}
if ((x - 20) > _root.right_border) {
return(false);
}
if ((y + 50) < _root.top_border) {
return(false);
}
if ((y - 50) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
sprite._visible = false;
if (life < 0) {
life = -10000;
return(undefined);
}
}
function UnFreeze() {
if (!sprite) {
id = _root.get_id();
if (!depth) {
depth = 4;
}
sprite = _root.objects_layer.attachMovie("human", "m" + id, id + (_root.depth_band * depth));
sprite._x = x;
sprite._y = y;
if (view_side < 0) {
sprite._xscale = -100;
} else {
sprite._xscale = 100;
}
sprite._skin = _skin;
sprite.gotoAndStop(41);
hand1 = sprite.hand_front.hand;
hand2 = sprite.hand_back.hand;
hand2.stop();
Skin(_skin);
Move(0, 0);
SwitchWeapon(weapon);
}
sprite._visible = true;
}
function Die(dx, dy) {
if (dy < -20) {
dy = -20;
}
sprite.m_damage_vx = dx;
sprite.m_damage_vy = dy;
if (action == 100) {
sprite._y = sprite._y - 10;
}
if (view_side > 0) {
sprite.gotoAndStop("die_right");
} else {
sprite.gotoAndStop("die_left");
}
sprite._xscale = 100;
sprite._yscale = 100;
Skin(_skin);
Kill();
_root.add_kill_combo();
if (weapon > 1) {
var _local3;
switch (weapon) {
case 1 :
_local3 = 0;
break;
case 2 :
_local3 = 30;
break;
case 3 :
_local3 = 4;
break;
case 4 :
_local3 = 4;
}
var _local4 = new BonusGun(x, y, "bonus_gun", weapon, _local3);
_root.PushObject(_local4);
_local4.x = _local4.x + (dx * 0.7);
_local4.y = _local4.y + (dy * 0.7);
}
}
function Damage(dx, dy, p, dmg) {
pain = p;
x = x + dx;
y = y + dy;
life = life - dmg;
if (action == 100) {
sprite.gotoAndPlay("pain_down");
return(undefined);
}
if (dx < 0) {
if (view_side > 0) {
sprite.gotoAndPlay("pain_left");
} else {
sprite.gotoAndPlay("pain_right");
}
} else if (view_side < 0) {
sprite.gotoAndPlay("pain_left");
} else {
sprite.gotoAndPlay("pain_right");
}
}
function Pause() {
switch (action) {
case 1 :
case 2 :
case 3 :
case 7 :
sprite.stop();
break;
}
switch (hand1._currentframe) {
case 20 :
case 52 :
case 93 :
case 120 :
break;
default :
hand1.stop();
}
}
function UnPause() {
switch (action) {
case 1 :
case 2 :
case 3 :
case 7 :
sprite.play();
break;
}
switch (hand1._currentframe) {
case 20 :
case 52 :
case 93 :
case 120 :
break;
default :
hand1.play();
}
}
}
Symbol 3187 MovieClip [__Packages.BonusRailgun] Frame 0
class BonusRailgun extends JointCollide
{
var x, y, oldx, oldy, sprite_name, aabb, mass, collided, life, ammo, UpdatePhysics, sprite, id;
function BonusRailgun (__x, __y, _sprite_name, _ammo) {
super();
if (!__x) {
return;
}
x = __x;
y = __y;
oldx = x;
oldy = y;
sprite_name = _sprite_name;
aabb = new Object();
aabb.w = 36;
aabb.h = 36;
aabb.dx = (-aabb.w) * 0.5;
aabb.dy = (-aabb.h) * 0.5;
aabb.x = __x;
aabb.y = __y;
mass = 3000;
collided = 0;
life = 100;
ammo = _ammo;
_root.persistent_buf.recently_droped_weapon = this;
}
function Update() {
y = y + _root.gravity_y;
UpdatePhysics();
if (life <= 0) {
return(undefined);
}
if (_root.CollideKnight(aabb)) {
sprite.gotoAndPlay("die");
_root.knight.shot_func = _root.knight.railgun;
_root.knight.extra_ammo = ammo;
life = -1;
_root.ui.weapon_indicator.gotoAndPlay("show_railgun");
return(undefined);
}
}
function Kill() {
life = -1;
removeMovieClip(sprite);
delete aabb;
if (_root.persistent_buf.recently_droped_weapon == this) {
_root.persistent_buf.recently_droped_weapon = 0;
}
}
function Alive() {
if (sprite._currentframe == 34) {
return(false);
}
if (life <= -10000) {
return(false);
}
return(true);
}
function InGame() {
if ((x + 40) < _root.left_border) {
return(false);
}
if ((x - 40) > _root.right_border) {
return(false);
}
if ((y + 40) < _root.top_border) {
return(false);
}
if ((y - 40) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
sprite._visible = false;
}
function UnFreeze() {
if (!sprite) {
id = _root.get_id();
sprite = _root.objects_layer.attachMovie(sprite_name, "b" + id, id + (_root.depth_band * 5));
sprite._x = x;
sprite._y = y;
}
sprite._visible = true;
}
function Pause() {
sprite.stop();
}
function UnPause() {
if (sprite._currentframe == 20) {
sprite.gotoAndPlay(1);
} else {
sprite.play();
}
}
}
Symbol 3188 MovieClip [__Packages.BonusGun] Frame 0
class BonusGun extends BonusRailgun
{
var aabb, weapon, y, UpdatePhysics, life, sprite, ammo, id, sprite_name, x;
function BonusGun (__x, __y, _sprite_name, _weapon, _ammo) {
super(__x, __y, _sprite_name, _ammo);
aabb.h = 23;
aabb.dy = -14;
weapon = _weapon;
}
function Update() {
y = y + _root.gravity_y;
UpdatePhysics();
if (life <= 0) {
return(undefined);
}
if (_root.CollideKnight(aabb) && (_root.knight.life > 0)) {
sprite.gotoAndPlay("die");
_root.knight.PickWeapon(weapon, ammo);
life = -1;
return(undefined);
}
}
function Alive() {
return(life > 0);
}
function UnFreeze() {
if (!sprite) {
id = _root.get_id();
sprite = _root.objects_layer.attachMovie(sprite_name, "b" + id, id + (_root.depth_band * 5));
sprite._x = x;
sprite._y = y;
sprite.gun.gotoAndStop(weapon);
}
sprite._visible = true;
}
function Pause() {
sprite.stop();
}
function UnPause() {
if (sprite._currentframe == 20) {
sprite.gotoAndPlay(1);
} else {
sprite.play();
}
}
}
Symbol 3189 MovieClip [__Packages.Hero] Frame 0
class Hero extends Man
{
var UnFreeze, sprite, weapon_switch_pessed, Skin, life, scarf, weapon_switching, color, landed_on_crate, weapons, body, hanging, hook, hang_reloading, last_state, dmg_func, view_locked, old_update_func, invincible, hit_point_mult, damage_mult, ammo_mult, invincible_time, weapon, _skin, shot, hand1, barx, bary, dir, sprite_shift_x, sprite_shift_y, _ragdoll, oldx, x, oldy, y, aabb, pain, action, landed, view_side, die_x, die_y, UpdatePhysics, collided, Move, hand2, last_command, move_to_x, stick_to, stick_to_oldx, stick_to_oldy;
function Hero (__x, __y, sprite_name, weapon, _skin, _life) {
super(__x, __y, sprite_name, weapon, 1, _life, 6);
UnFreeze();
sprite._visible = true;
sprite.hero = true;
weapon_switch_pessed = false;
Skin(1);
life = 100;
scarf = new Cable(__x, __y, "scarf", 7, 0.1, 5);
weapon_switching = false;
color = new Color(sprite);
landed_on_crate = false;
weapons = new Array();
weapons[1] = new Object();
weapons[1].picked = true;
weapons[1].ammo = 0;
weapons[2] = new Object();
weapons[2].picked = false;
weapons[2].ammo = 0;
weapons[3] = new Object();
weapons[3].picked = false;
weapons[3].ammo = 0;
weapons[4] = new Object();
weapons[3].picked = false;
weapons[4].ammo = 0;
SwitchWeapon(1);
body = sprite.bod;
_root.ui.lifebar.gotoAndStop(11);
_root.knight_spawned = true;
hanging = false;
hook = 0;
hang_reloading = 0;
last_state = new PlayerState();
dmg_func = Damage;
view_locked = false;
old_update_func = Update;
invincible = false;
hit_point_mult = 1;
damage_mult = 1;
ammo_mult = 1;
if (_root.difficulty == "easy") {
hit_point_mult = 1.3;
damage_mult = 1.15;
ammo_mult = 1.3;
}
if (_root.difficulty == "super_easy") {
hit_point_mult = 1.5;
damage_mult = 1.5;
ammo_mult = 1.7;
}
}
function Invincibility(t) {
invincible_time = t;
color.setTransform(_root.blue);
invincible = true;
}
function SwitchWeapon(wpn) {
if (wpn != 1) {
if (wpn == undefined) {
return(undefined);
}
if (!weapons[wpn].picked) {
return(undefined);
}
}
weapon = wpn;
if ((!weapon) && (wpn)) {
sprite.gotoAndPlay("stand_weapon");
Skin(_skin);
}
switch (wpn) {
case 0 :
sprite.gotoAndPlay("stand");
shot = function () {
};
Skin(_skin);
break;
case 1 :
hand1.gotoAndPlay("pistol_start");
shot = ShotPistol;
break;
case 2 :
hand1.gotoAndPlay("smg_start");
shot = ShotSmg;
break;
case 3 :
hand1.gotoAndPlay("riffle_start");
shot = ShotRiffle;
break;
case 4 :
hand1.gotoAndPlay("grenade_start");
shot = ShotGrenade;
}
weapon_switching = true;
_root.ui.weapon_indicator.gotoAndStop(weapon);
hand1.ready = false;
_root.sound("snd_change_weapon");
}
function PickWeapon(wpn, ammo) {
if (!weapons[wpn].ammo) {
switch (wpn) {
case 1 :
break;
case 2 :
_root.bonus_info("SMG equiped! Press '2'");
break;
case 3 :
_root.bonus_info("BLASTER equiped! Press '3'");
break;
case 4 :
_root.bonus_info("GRENADE LOUNCHER equiped! Press '4'");
}
weapons[wpn].picked = true;
if ((weapon < wpn) || (weapons[weapon].ammo <= 0)) {
SwitchWeapon(wpn);
}
} else {
switch (wpn) {
case 1 :
break;
case 2 :
_root.bonus_info("SMG + " + ammo);
break;
case 3 :
_root.bonus_info("BLASTER + " + ammo);
break;
case 4 :
_root.bonus_info("GRENADE LOUNCHER + " + ammo);
}
}
_root.sound("snd_click");
if (weapons[wpn].ammo == undefined) {
weapons[wpn].ammo = 0;
}
weapons[wpn].ammo = weapons[wpn].ammo + int(ammo * ammo_mult);
}
function ShotPistol() {
if (!hand1.ready) {
return(undefined);
}
BarrelPos();
barx = _root.p.x;
bary = _root.p.y;
if (_root.collide_point(barx, bary)) {
return(undefined);
}
_root.p_bullets.push(new PlayerBullet("pistol_bullet", barx, bary, dir, 20, 10 * damage_mult, 8, 1000));
hand1.play();
_root.sound("snd_pistol");
}
function ShotSmg() {
if (weapons[2].ammo <= 0) {
_root.bonus_info("No Ammo!");
if (weapons[3].ammo > 0) {
SwitchWeapon(3);
} else {
SwitchWeapon(1);
}
_root.sound("snd_empty");
return(undefined);
}
if (!hand1.ready) {
return(undefined);
}
BarrelPos();
barx = _root.p.x;
bary = _root.p.y;
if (_root.collide_point(barx, bary)) {
return(undefined);
}
_root.p_bullets.push(new PlayerBullet("pistol_bullet", barx, bary, dir, 16, 10 * damage_mult, 8, 1500));
hand1.play();
_root.sound("snd_smg");
weapons[2].ammo--;
}
function ShotRiffle() {
if (weapons[3].ammo <= 0) {
_root.bonus_info("No Ammo!");
if (weapons[4].ammo > 0) {
SwitchWeapon(4);
} else if (weapons[2].ammo > 0) {
SwitchWeapon(2);
} else {
SwitchWeapon(1);
}
_root.sound("snd_empty");
return(undefined);
}
if (!hand1.ready) {
return(undefined);
}
BarrelPos();
var _local3 = dir * _root.degtorad;
var _local5 = Math.cos(_local3);
var _local4 = Math.sin(_local3);
_root.p_bullets.push(new Beam(_root.p.x, _root.p.y, "beam", _local5 * 20, _local4 * 20, 40 * damage_mult, 8));
hand1.play();
_root.sound("snd_lazer");
weapons[3].ammo--;
}
function ShotGrenade() {
if (weapons[4].ammo <= 0) {
_root.bonus_info("No Ammo!");
if (weapons[3].ammo > 0) {
SwitchWeapon(3);
} else if (weapons[2].ammo > 0) {
SwitchWeapon(2);
} else {
SwitchWeapon(1);
}
_root.sound("snd_empty");
return(undefined);
}
if (!hand1.ready) {
return(undefined);
}
BarrelPos();
var _local3 = 100;
if (ammo_mult > 1) {
_local3 = 115;
}
_root.p_bullets.push(new Grenade("grenade", _root.p.x, _root.p.y, dir, 24, _local3, 8, 50));
hand1.play();
_root.sound("snd_grenade_lounch");
weapons[4].ammo--;
}
function BarrelPos() {
_root.p.x = hand1.barrel._x;
_root.p.y = hand1.barrel._y;
_root.p = hand1.transform.matrix.transformPoint(_root.p);
_root.p = hand1._parent.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
if (view_locked) {
_root.p.x = _root.p.x + sprite_shift_x;
_root.p.y = _root.p.y + sprite_shift_y;
}
}
function Ragdolling() {
if (!_ragdoll) {
_ragdoll = _root.recent_ragdoll;
}
var _local4 = _root.limit(x - oldx, -10, 10);
var _local3 = _root.limit(y - oldy, -30, 10);
if (_ragdoll.getspeed() < 20) {
_ragdoll.addv(_local4, _local3, (Math.abs(x - oldx) + Math.abs(y - oldy)) * 0.4);
}
var _local5;
var _local6;
if (sprite && (sprite.bod._x)) {
x = sprite.bod._x;
y = sprite.bod._y;
}
if (!x) {
x = 0;
}
if (!y) {
y = 0;
}
oldx = x;
oldy = y;
aabb.x = x + aabb.dx;
aabb.y = y + aabb.dy;
if (!view_locked) {
_local5 = (-x) + (_root.w * 0.5);
_local6 = (-y) + (_root.h * 0.5);
_root.SmoothView(_local5, _local6);
}
scarf.SetPos(sprite.head._x, sprite.head._y);
scarf.Update();
pain--;
}
function JetMove(vy) {
if (vy < 0) {
body.gotoAndStop(6);
if ((y - oldy) > -8) {
oldy = oldy + 1;
}
action = 8;
if (((pain < 1000) && (pain > 999)) || (pain < 0)) {
sprite.gotoAndPlay("jetpack_fly");
pain = 1022;
}
} else {
body.gotoAndStop(5);
if (pain > 50) {
pain = -1;
if (y < oldy) {
action = 4;
}
if ((!landed) && (y > oldy)) {
sprite.gotoAndStop(112);
action = 5;
}
}
}
}
function Update() {
if (life <= 0) {
last_state.Save();
unhang();
Update = Ragdolling;
_root.damage_vx = _root.damage_vx * 2;
_root.damage_vy = _root.damage_vy * 3;
sprite.m_damage_vx = _root.damage_vx;
sprite.m_damage_vy = _root.damage_vy;
if (_root.damage_vy < -20) {
_root.damage_vy = -20;
}
sprite.hero = true;
if (view_side > 0) {
sprite.gotoAndStop("die_right");
} else {
sprite.gotoAndStop("die_left");
}
sprite._xscale = 100;
sprite._yscale = 100;
Skin(2);
aabb.w = 40;
aabb.h = 40;
aabb.dx = -20;
aabb.dy = -20;
die_x = x;
die_y = y;
_root.ui.lifebar.gotoAndStop(1);
return(undefined);
}
if ((invincible_time <= 0) && (invincible)) {
color.setTransform(_root.white);
invincible = false;
}
if ((invincible_time > 0) && (invincible_time < 50)) {
if ((invincible_time % 10) == 0) {
color.setTransform(_root.blue);
} else if (((invincible_time + 5) % 10) == 0) {
color.setTransform(_root.white);
}
}
y = y + _root.gravity_y;
UpdatePhysics();
if (y > _root.view_bottom._y) {
_root.DamageKnight(2);
}
var _local4 = 0;
var _local3 = 0;
if (Key.isDown(87) || (Key.isDown(38))) {
_local3 = _local3 - 1;
}
if (Key.isDown(65) || (Key.isDown(37))) {
_local4 = _local4 - 1;
}
if (Key.isDown(68) || (Key.isDown(39))) {
_local4 = _local4 + 1;
}
if (weapon_switching && (hand1.ready)) {
weapon_switching = false;
} else if (weapon_switching) {
hand1.play();
}
if (((Key.isDown(49) || (Key.isDown(50))) || (Key.isDown(51))) || (Key.isDown(52))) {
if (!weapon_switch_pessed) {
SwitchWeapon(int(Key.getCode()) - 48);
weapon_switch_pessed = true;
}
} else {
weapon_switch_pessed = false;
}
landed = landed_on_crate || (collided == 3);
if (landed_on_crate) {
oldy = y;
x = _root.interpolate(x, oldx, 0.2);
landed_on_crate = false;
}
if (Key.isDown(83) || (Key.isDown(40))) {
_local3 = 1;
}
if (_local3 <= 0) {
}
if (((_local3 < 0) && (hanging)) && (hang_reloading < 0)) {
oldy = y + 15;
unhang();
landed = false;
}
if (_local3 > 0) {
if (hanging) {
unhang();
}
}
if (landed) {
unhang();
}
Move(_local4, _local3);
Direct(_root.__xmouse, _root.__ymouse);
if ((((Key.isDown(1) || (_root.mouse_pressed)) || (Key.isDown(32))) && (!weapon_switch_pessed)) && (!weapon_switching)) {
shot();
}
View();
pain--;
scarf.SetPos(x, y - 20);
scarf.Update();
if (view_locked) {
sprite._x = sprite._x + sprite_shift_x;
sprite._y = sprite._y + sprite_shift_y;
scarf.sprite._x = sprite_shift_x;
scarf.sprite._y = sprite_shift_y;
}
_root.ammo = weapons[weapon].ammo;
_root.print_int(_root.ui.weapon_indicator.ammo_counter, weapons[weapon].ammo, 4);
hang_reloading--;
_root.ui.lifebar.gotoAndStop(Math.round(life / 10) + 1);
invincible_time--;
}
function Kill() {
life = -10000;
delete aabb;
scarf.Kill();
delete scarf;
}
function RemoveSprite() {
removeMovieClip(sprite);
}
function View() {
if (view_locked) {
return(undefined);
}
var _local3 = (-((x * 0.7) + (_root.__xmouse * 0.3))) + (_root.w * 0.5);
var _local4 = (-((y * 0.7) + (_root.__ymouse * 0.3))) + (_root.h * 0.5);
_root.SmoothView(_local3, _local4);
}
function Render() {
}
function CollideBody(_aabb) {
return(_root.collide_aabb(_aabb, aabb));
}
function CollideMace(_aabb) {
return(false);
}
function getx() {
return(x);
}
function gety() {
return(y);
}
function getvy() {
return(y - oldy);
}
function addvx(dx) {
x = x + dx;
}
function addvy(dy) {
y = y + dy;
}
function gethangx() {
return(x);
}
function gethangy() {
return(y - 40);
}
function Direct(target_x, target_y) {
if (target_x < x) {
view_side = -1;
sprite._xscale = -100;
} else {
view_side = 1;
sprite._xscale = 100;
}
dir = Math.atan2((target_y - y) + 15, target_x - x) * _root.radtodeg;
if (view_side < 0) {
hand1._rotation = 180 - dir;
hand2._rotation = 180 - dir;
} else {
hand1._rotation = dir;
hand2._rotation = dir;
}
if (!hanging) {
hand2.gotoAndStop(hand1._currentframe);
}
if (hanging) {
hand2._rotation = 0;
}
}
function hang(_hook) {
if (hang_reloading > 0) {
return(false);
}
if (landed) {
return(false);
}
hook = _hook;
hanging = true;
hand2.gotoAndPlay("hang");
hang_reloading = 10;
return(true);
}
function unhang() {
hook.unhang();
hanging = false;
hang_reloading = 20;
}
function can_hang() {
if ((y - oldy) < -5) {
return(false);
}
if (hanging) {
return(false);
}
if (hang_reloading > 0) {
return(false);
}
if (landed) {
return(false);
}
return(true);
}
function UpdateMovie() {
switch (last_command) {
case "sit" :
Move(0, 1);
if (!landed) {
y = y + _root.gravity_y;
UpdatePhysics();
landed = landed_on_crate || (collided == 3);
}
break;
case "run_right" :
Move(1, 0);
break;
case "run_left" :
Move(-1, 0);
break;
case "move_to" :
if (Math.abs(x - move_to_x) < 30) {
x = _root.interpolate(x, move_to_x, 0.3);
oldx = x;
} else if (x < move_to_x) {
Move(1, 0);
} else {
Move(-1, 0);
}
y = y + _root.gravity_y;
UpdatePhysics();
landed = landed_on_crate || (collided == 3);
break;
}
View();
pain--;
_root.ammo = weapons[weapon].ammo;
_root.ui.lifebar.gotoAndStop(Math.round(life / 10) + 1);
if (stick_to) {
var _local4 = stick_to._x - stick_to_oldx;
var _local3 = stick_to._y - stick_to_oldy;
x = x + _local4;
oldx = oldx + _local4;
y = y + _local3;
oldy = oldy + _local3;
stick_to_oldx = stick_to._x;
stick_to_oldy = stick_to._y;
}
sprite._x = x;
sprite._y = y;
scarf.SetPos(x, y - 20);
scarf.Update();
}
function UpdateLock() {
sprite._x = x;
sprite._y = y;
scarf.SetPos(x, y - 20);
scarf.Update();
}
function LockControls(_last_command, _stick_to, _move_to_x) {
last_command = _last_command;
stick_to = _stick_to;
stick_to_oldx = stick_to._x;
stick_to_oldy = stick_to._y;
switch (last_command) {
case "sit" :
Update = UpdateMovie;
break;
case "stand" :
Update = UpdateMovie;
break;
case "lock_all" :
Update = UpdateLock;
sprite.gotoAndStop("sit");
break;
case "lock_view" :
view_locked = true;
sprite_shift_x = 0;
sprite_shift_y = 0;
break;
case "restore_control" :
Update = old_update_func;
view_locked = false;
break;
case "move_to" :
move_to_x = _move_to_x;
Update = UpdateMovie;
break;
}
}
function Freeze() {
sprite.stop();
sprite._visible = false;
scarf.sprite._visible = false;
}
function Damage(dx, dy, p, dmg) {
dmg = dmg / hit_point_mult;
if (!invincible) {
super.Damage(dx, dy, p, dmg);
}
}
}
Symbol 3190 MovieClip [__Packages.Cable] Frame 0
class Cable extends Obj
{
var id, sprite, life, n, grav, objects, x, y;
function Cable (__x, __y, spritename, _n, _grav, _depth) {
super();
id = _root.get_id();
if (!_depth) {
_depth = 2;
}
if (!_grav) {
_grav = _root.gravity_y;
}
sprite = _root.objects_layer.attachMovie(spritename, "cb" + id, id + (_root.depth_band * _depth));
sprite._x = 0;
sprite._y = 0;
life = 100;
n = _n;
grav = _grav;
objects = new Array();
objects.push(new Joint(0, 0, 100000));
var _local4 = 0;
while (_local4 < n) {
var _local5 = sprite["c" + _local4];
objects.push(new Joint(_local5._x, _local5._y, (n - _local4) * (n - _local4)));
_local5.gotoAndStop(_local4 + 1);
_local4++;
}
_local4 = 0;
while (_local4 < n) {
var _local5 = sprite["c" + _local4];
objects.push(new CableLink(objects[_local4 + 1], objects[_local4], _local5));
_local4++;
}
n++;
_local4 = 0;
while (_local4 < n) {
objects[_local4].x = objects[_local4].x + __x;
objects[_local4].y = objects[_local4].y + __y;
objects[_local4].oldx = objects[_local4].oldx + __x;
objects[_local4].oldy = objects[_local4].oldy + __y;
_local4++;
}
sprite._x = 0;
sprite._y = 0;
}
function Update() {
var _local3 = 0;
while (_local3 < n) {
objects[_local3].y = objects[_local3].y + grav;
objects[_local3].x = objects[_local3].x + _root.wind_x;
objects[_local3].Update();
_local3++;
}
_local3 = n;
while (_local3 < objects.length) {
objects[_local3].Update();
objects[_local3].Render();
_local3++;
}
x = objects[0].x;
y = objects[0].y;
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
var _local2 = 0;
while (_local2 < objects.length) {
delete objects[_local2];
objects.splice(_local2, 1);
_local2++;
}
}
function Alive() {
return(life > -10000);
}
function InGame() {
if ((x + 100) < _root.left_border) {
return(false);
}
if ((x - 100) > _root.right_border) {
return(false);
}
if ((y + 100) < _root.top_border) {
return(false);
}
if ((y - 100) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
function SetPos(__x, __y) {
objects[0].x = __x;
objects[0].y = __y;
objects[0].oldx = __x;
objects[0].oldy = __y;
}
function GetX() {
return(objects[0].x);
}
function GetY() {
return(objects[0].y);
}
}
Symbol 3191 MovieClip [__Packages.CableLink] Frame 0
class CableLink extends Obj
{
var a, b, r, sprite;
function CableLink (_a, _b, _sprite) {
super();
a = _a;
b = _b;
r = _root.DistPoint(a.x, a.y, b.x, b.y);
sprite = _sprite;
}
function Update() {
var _local3 = b.x - a.x;
var _local2 = b.y - a.y;
var _local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local5 = (_local4 - r) / _local4;
_local3 = _local3 * _local5;
_local2 = _local2 * _local5;
a.x = a.x + _local3;
a.y = a.y + _local2;
}
function Render() {
sprite._x = a.x;
sprite._y = a.y;
var _local4 = b.x - a.x;
var _local3 = b.y - a.y;
sprite._rotation = Math.atan2(_local3, _local4) * _root.radtodeg;
}
}
Symbol 3192 MovieClip [__Packages.PlayerBullet] Frame 0
class PlayerBullet extends Obj
{
var x, y, id, sprite, aabb, life, vx, vy, damage, force;
function PlayerBullet (sprite_name, __x, __y, dir, speed, _damage, r, _force) {
super();
x = __x;
y = __y;
id = _root.get_id();
sprite = _root.objects_layer.attachMovie(sprite_name, "pb" + id, id + (_root.depth_band * 12));
sprite._x = x;
sprite._y = y;
sprite._rotation = dir;
aabb = new Object();
aabb.dx = -r;
aabb.dy = -r;
aabb.w = r + r;
aabb.h = r + r;
aabb.x = __x;
aabb.y = __y;
life = 100;
dir = dir * _root.degtorad;
vx = speed * Math.cos(dir);
vy = speed * Math.sin(dir);
damage = _damage;
force = _force;
}
function Update() {
if (life < 0) {
return(undefined);
}
x = x + vx;
y = y + vy;
aabb.x = x + aabb.dx;
aabb.y = y + aabb.dy;
if (_root.collide(aabb)) {
x = x + _root.p.x;
y = y + _root.p.y;
Hit();
}
sprite._x = x;
sprite._y = y;
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
delete aabb;
}
function Alive() {
if (((sprite._currentframe == 9) || (!InGame())) || (life <= -10000)) {
return(false);
}
return(true);
}
function InGame() {
if ((x + 30) < _root.left_border) {
return(false);
}
if ((x - 30) > _root.right_border) {
return(false);
}
if ((y + 30) < _root.top_border) {
return(false);
}
if ((y - 30) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
Kill();
}
function UnFreeze() {
Kill();
}
function Collide(_aabb) {
if (_root.collide_aabb(_aabb, aabb)) {
return(true);
}
return(false);
}
function Hit() {
if (life < 0) {
return(undefined);
}
life = -1;
sprite._rotation = (Math.atan2(_root.p.y, _root.p.x) * _root.radtodeg) + 180;
sprite.gotoAndPlay("die");
_root.p.x = vx * force;
_root.p.y = vy * force;
}
}
Symbol 3193 MovieClip [__Packages.Beam] Frame 0
class Beam extends Obj
{
var x, y, vx, vy, ex, ey, l, ny, nx, id, sprite, life, damage;
function Beam (__x, __y, spritename, _vx, _vy, _damage, r) {
super();
x = __x;
y = __y;
vx = _vx;
vy = _vy;
var _local6 = 0;
while (_local6 < 800) {
if (_root.collide_point(__x, __y)) {
__x = __x + _root.p.x;
__y = __y + _root.p.y;
break;
}
if (((((__x + 100) < _root.left_border) || ((__x - 100) > _root.right_border)) || ((__y + 100) < _root.top_border)) || ((__y - 100) > _root.bottom_border)) {
__x = __x + _root.p.x;
__y = __y + _root.p.y;
break;
}
__x = __x + _vx;
__y = __y + _vy;
_local6++;
}
ex = __x;
ey = __y;
l = _root.DistPoint(x, y, __x, __y);
ny = (ex - x) / l;
nx = (-(ey - y)) / l;
id = _root.get_id();
sprite = _root.objects_layer.attachMovie(spritename, "b" + id, id + (_root.depth_band * 8));
sprite._xscale = (l * 100) / 1040;
sprite.blendMode = "add";
sprite._x = x;
sprite._y = y;
sprite._rotation = Math.atan2(_vy, _vx) * _root.radtodeg;
life = 5;
damage = _damage;
}
function Update() {
if (life < 0) {
return(undefined);
}
if (life == 4) {
Collide = function () {
return(false);
};
}
life = life - 1;
if (life < 5) {
sprite._yscale = sprite._yscale - 20;
}
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
}
function Alive() {
return(life >= 0);
}
function InGame() {
if ((x + 20) < _root.left_border) {
return(false);
}
if ((x - 20) > _root.right_border) {
return(false);
}
if ((y + 20) < _root.top_border) {
return(false);
}
if ((y - 20) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
return(true);
}
function UnFreeze() {
Kill();
}
function Collide(_aabb) {
if (life != 4) {
return(false);
}
var _local10 = Math.min(x, ex);
var _local8 = Math.min(y, ey);
var _local9 = Math.max(x, ex);
var _local7 = Math.max(y, ey);
if (((_aabb.x + _aabb.w) - _local10) < 0) {
return(false);
}
if ((_aabb.x - _local9) > 0) {
return(false);
}
if (((_aabb.y + _aabb.h) - _local8) < 0) {
return(false);
}
if ((_aabb.y - _local7) > 0) {
return(false);
}
_local10 = _aabb.x;
_local8 = _aabb.y;
_local9 = _aabb.x + _aabb.w;
_local7 = _aabb.y;
var _local11 = _aabb.x;
var _local13 = _aabb.y + _aabb.h;
var _local14 = _aabb.x + _aabb.w;
var _local12 = _aabb.y + _aabb.h;
var _local6 = false;
var _local5 = false;
if (_root.DistLine(x, y, ex, ey, _local10, _local8) > 0) {
_local5 = true;
} else {
_local6 = true;
}
if (_root.DistLine(x, y, ex, ey, _local9, _local7) > 0) {
_local5 = true;
} else {
_local6 = true;
}
if (_root.DistLine(x, y, ex, ey, _local11, _local13) > 0) {
_local5 = true;
} else {
_local6 = true;
}
if (_root.DistLine(x, y, ex, ey, _local14, _local12) > 0) {
_local5 = true;
} else {
_local6 = true;
}
if (!(_local6 && (_local5))) {
return(false);
}
var _local4 = 0;
_local4 = -_root.DistLine(x, y, x + nx, y + ny, _local10, _local8);
if ((_local4 > 0) && (_local4 < l)) {
return(true);
}
_local4 = -_root.DistLine(x, y, x + nx, y + ny, _local9, _local7);
if ((_local4 > 0) && (_local4 < l)) {
return(true);
}
_local4 = -_root.DistLine(x, y, x + nx, y + ny, _local11, _local13);
if ((_local4 > 0) && (_local4 < l)) {
return(true);
}
_local4 = -_root.DistLine(x, y, x + nx, y + ny, _local14, _local12);
if ((_local4 > 0) && (_local4 < l)) {
return(true);
}
return(false);
}
function Hit() {
_root.p.x = vx * 1000;
_root.p.y = vy * 1000;
}
}
Symbol 3194 MovieClip [__Packages.Grenade] Frame 0
class Grenade extends JointCollide
{
var x, y, id, sprite, aabb, life, vx, vy, oldx, oldy, damage, force, exploded, collide_player, UpdatePhysics, collided, player_damage_aabb;
function Grenade (sprite_name, __x, __y, dir, speed, _damage, r, _force, _collide_player) {
super();
x = __x;
y = __y;
id = _root.get_id();
sprite = _root.objects_layer.attachMovie(sprite_name, "pb" + id, id + (_root.depth_band * 12));
sprite._x = x;
sprite._y = y;
sprite._rotation = dir;
aabb = new Object();
aabb.dx = -r;
aabb.dy = -r;
aabb.w = r + r;
aabb.h = r + r;
aabb.x = __x;
aabb.y = __y;
life = 90;
dir = dir * _root.degtorad;
vx = speed * Math.cos(dir);
vy = speed * Math.sin(dir);
oldx = x - vx;
oldy = y - vy;
damage = _damage;
force = _force;
exploded = false;
collide_player = _collide_player;
}
function Update() {
y = y + _root.gravity_y;
var _local4 = x - oldx;
var _local3 = y - oldy;
sprite._rotation = Math.atan2(_local3, _local4) * _root.radtodeg;
UpdatePhysics();
life--;
switch (collided) {
case 0 :
break;
case 3 :
y = y - (_local3 * 0.6);
break;
case 2 :
case 4 :
x = x - (_local4 * 0.5);
}
if (collided && ((Math.abs(_local4) > 5) || (Math.abs(_local3) > 5))) {
_root.sound("snd_grenade_bounce");
}
if (life <= 0) {
Explode();
return(undefined);
}
if (collide_player) {
if (_root.CollideKnight(aabb)) {
Explode();
return(undefined);
}
}
}
function Explode() {
Update = ExplosionUpdate;
Collide = ExplosionCollide;
sprite.gotoAndPlay("die");
sprite._rotation = 0;
life = 0;
aabb.x = x - 100;
aabb.y = y - 100;
aabb.w = 200;
aabb.h = 200;
_root.sound_mc_point("snd_boom", sprite, x, 100);
player_damage_aabb = new Object();
player_damage_aabb.x = x - 70;
player_damage_aabb.y = y - 70;
player_damage_aabb.w = 140;
player_damage_aabb.h = 140;
}
function ExplosionCollide(_aabb) {
if (life != 1) {
return(undefined);
}
if (_root.collide_aabb(_aabb, aabb)) {
vx = (_aabb.x + (_aabb.w * 0.5)) - x;
vy = (_aabb.y + (_aabb.h * 0.5)) - y;
var _local3 = Math.sqrt((vx * vx) + (vy * vy));
_local3 = force / _local3;
vx = vx * _local3;
vy = vy * _local3;
_root.p.x = vx * 1000;
_root.p.y = vy * 1000;
return(true);
}
return(false);
}
function ExplosionUpdate() {
if (life == 0) {
if (_root.CollideKnight(player_damage_aabb)) {
vx = _root.knight.getx() - x;
vy = _root.knight.gety() - y;
var _local3 = Math.sqrt((vx * vx) + (vy * vy));
_local3 = (force * 0.2) / _local3;
vx = vx * _local3;
vy = vy * _local3;
_root.DamageKnight(20, vx, vy);
}
}
life++;
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
delete aabb;
}
function Alive() {
if (sprite._currentframe == 21) {
return(false);
}
return(true);
}
function InGame() {
if ((x + 30) < _root.left_border) {
return(false);
}
if ((x - 30) > _root.right_border) {
return(false);
}
if ((y + 30) < _root.top_border) {
return(false);
}
if ((y - 30) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
Kill();
}
function UnFreeze() {
Kill();
}
function Collide(_aabb) {
if (_root.collide_aabb(_aabb, aabb)) {
Explode();
}
return(false);
}
function Hit() {
if (life != 1) {
return(undefined);
}
_root.p.x = vx * 1000;
_root.p.y = vy * 1000;
}
}
Symbol 3195 MovieClip [__Packages.Particle] Frame 0
class Particle extends JointCollide
{
var x, y, id, sprite, aabb, life, oldx, oldy, UpdatePhysics, collided;
function Particle (frame, __x, __y, speed, depth) {
super();
x = __x;
y = __y;
id = _root.get_id();
if (depth == undefined) {
depth = 11;
}
sprite = _root.objects_layer.attachMovie("particles", "p" + id, id + (_root.depth_band * depth));
sprite._x = x;
sprite._y = y;
sprite.gotoAndStop(frame);
aabb = new Object();
aabb.w = 1;
aabb.h = 1;
aabb.x = x;
aabb.y = y;
aabb.dx = 0;
aabb.dy = 0;
life = 30 + random(30);
oldx = (x - ((speed * Math.random()) * 2)) + speed;
oldy = (y - ((speed * Math.random()) * 2)) + speed;
}
function SetSpeed(vx, vy, rand) {
oldx = (x - vx) - ((Math.random() - 0.5) * rand);
oldy = (y - vy) - ((Math.random() - 0.5) * rand);
}
function Update() {
y = y + _root.gravity_y;
var _local4 = x - oldx;
var _local3 = y - oldy;
UpdatePhysics();
life--;
switch (collided) {
case 0 :
break;
case 3 :
y = y - (_local3 * 0.6);
break;
case 2 :
case 4 :
x = x - (_local4 * 0.5);
}
}
function Kill() {
life = -10000;
removeMovieClip(_root.objects_layer["p" + id]);
delete aabb;
}
function Alive() {
return(life > 0);
}
function InGame() {
if ((x + 20) < _root.left_border) {
return(false);
}
if ((x - 20) > _root.right_border) {
return(false);
}
if ((y + 20) < _root.top_border) {
return(false);
}
if ((y - 20) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
Kill();
}
function UnFreeze() {
Kill();
}
}
Symbol 3196 MovieClip [__Packages.SlopeUR] Frame 0
class SlopeUR extends Brick
{
var mc, x, y, type, k;
function SlopeUR (_mc, _type, _dx, _dy) {
super();
mc = _mc;
mc._y = int(mc._y);
if (_dx != undefined) {
x = _dx;
} else {
x = 0;
}
if (_dy != undefined) {
y = _dy;
} else {
y = 0;
}
if (_type != undefined) {
type = _type;
} else {
type = 0;
}
k = mc._height / mc._width;
}
function Collide(aabb) {
var _local3 = (aabb.x + aabb.w) - (mc._x + x);
if (_local3 < 0) {
return(false);
}
var _local7 = aabb.x - ((mc._x + x) + mc._width);
if (_local7 > 0) {
return(false);
}
var _local4 = (aabb.y + aabb.h) - (mc._y + y);
if (_local4 < 0) {
return(false);
}
var _local6 = aabb.y - ((mc._y + y) + mc._height);
if (_local6 > 0) {
return(false);
}
if ((_local3 < aabb.w) || (_local6 > ((-aabb.h) + 10))) {
if (Math.abs(_local4) > Math.abs(_local6)) {
_local4 = _local6;
}
if (Math.abs(_local3) > Math.abs(_local7)) {
_local3 = _local7;
}
if ((Math.abs(_local3) > 0.1) && (Math.abs(_local4) > 0.1)) {
if ((Math.abs(_local3) + 2) < Math.abs(_local4)) {
_root.p.x = _root.p.x - _local3;
_root.collided_brick = this;
return(true);
}
_root.p.y = _root.p.y - _local4;
_root.collided_brick = this;
return(true);
}
} else {
var _local8 = ((_local3 - (aabb.w * 0.5)) * k) - _local4;
if (_local8 < 0) {
_root.p.y = _root.p.y + _local8;
_root.collided_brick = this;
return(true);
}
}
return(false);
}
function getx() {
return(mc._x + x);
}
function gety() {
return(mc._x + y);
}
function getw() {
return(mc._width);
}
function geth() {
return(mc._height);
}
function CollidePoint(px, py) {
var _local3 = px - (mc._x + x);
if ((_local3 < 0) || (_local3 > mc._width)) {
return(false);
}
var _local2 = py - (mc._y + y);
if ((_local2 < 0) || (_local2 > mc._height)) {
return(false);
}
var _local4 = (_local3 * k) - _local2;
if (_local4 > 0) {
return(false);
}
return(true);
}
}
Symbol 3197 MovieClip [__Packages.Raptor] Frame 0
class Raptor extends Obj
{
var objects, foots, sprite, life, head, body, knee11, knee12, foot1, knee21, knee22, foot2, n_joints, head_link, oldx, x, oldy, y, dir, side, behavior, step_dist, reloading, color_head, color_body, activate_delay, head_exploded, body_exploded, gun, pain, aabb, gun_sound, gun_sound_started, motor_sound, mount_delay, __height, charge, landed, head_frame, no_entrance, body_dir, foot_angle, left_bound, right_bound, falltime, _mode, phase, hero, active_foot, d_foot_angle, on_die, pain_head, pain_body, activated, overstep_foot, collided;
function Raptor (__x, __y, _activate_delay) {
super();
objects = new Array();
foots = new Array();
var _local9 = 5;
var _local8 = _root.get_id();
sprite = _root.objects_layer.attachMovie("raptor", "ra" + _local8, _local8 + (_root.depth_band * _local9));
sprite._x = __x;
sprite._y = __y;
life = maxlife;
head = joint("head", 400, 40);
body = joint("body", 2000, 100);
body.aabb.dx = -100;
body.aabb.dy = -70;
body.aabb.w = 146;
body.aabb.h = 92;
knee11 = jointno("leg11", 200, 10);
knee12 = jointno("leg12", 200, 10);
foot1 = jointf("leg13", 200, 30);
knee21 = jointno("leg21", 200, 10);
knee22 = jointno("leg22", 200, 10);
foot2 = jointf("leg23", 200, 30);
n_joints = objects.length;
var _local7 = 0.95;
link("head", "body", _local7, "head");
link("leg11", "body", _local7, "leg11");
link("leg12", "leg11", _local7, "leg12");
link("leg13", "leg12", _local7, "leg13");
link("leg21", "body", _local7, "leg21");
link("leg22", "leg21", _local7, "leg22");
link("leg23", "leg22", _local7, "leg23");
head_link = link("head", "body", 0.1);
head_link.r = 1;
objects.pop();
var _local4 = 0;
while (_local4 < n_joints) {
objects[_local4].x = objects[_local4].x + __x;
objects[_local4].y = objects[_local4].y + __y;
objects[_local4].oldx = objects[_local4].oldx + __x;
objects[_local4].oldy = objects[_local4].oldy + __y;
_local4++;
}
sprite._x = 0;
sprite._y = 0;
_local4 = n_joints;
while (_local4 < objects.length) {
objects[_local4].Render();
_local4++;
}
oldx = (x = __x);
oldy = (y = __y);
dir = 0;
side = 1;
behavior = Walk;
StartWalk();
step_dist = 0;
reloading = 30;
color_head = new Color(sprite.head);
color_body = new Color(sprite.body);
if (!_activate_delay) {
_activate_delay = 0;
}
activate_delay = _activate_delay;
head_exploded = (body_exploded = false);
gun = sprite.head.gun;
if (_root.objects[_root.objects.length - 1] == this) {
_root.objects.pop();
}
pain = 0;
aabb = head.aabb;
gun_sound = new Sound(sprite.head);
gun_sound.attachSound("snd_machinegun");
gun_sound.setVolume(40);
gun_sound.stop();
gun_sound_started = false;
motor_sound = new Sound(sprite.body);
motor_sound.attachSound("snd_motor");
motor_sound.stop();
_local4 = n_joints;
while (_local4 < objects.length) {
objects[_local4].Render();
_local4++;
}
sprite.body._x = body.x;
sprite.body._y = body.y;
sprite.leg14._x = foot1.x;
sprite.leg14._y = foot1.y;
sprite.leg24._x = foot2.x;
sprite.leg24._y = foot2.y;
Update = UpdateEmpty;
mount_delay = 30;
head.Update();
__height = 250;
charge = 0;
landed = true;
head_frame = 47;
no_entrance = false;
body_dir = 0;
foot_angle = 0;
left_bound = _root.level.raptor_left_bound._x;
right_bound = _root.level.raptor_right_bound._x;
falltime = 300;
_mode = 0;
phase = 0;
}
function Update() {
}
function UpdateEmpty() {
if ((_root.CollideKnight(head.aabb) && (_root.knight.getvy() > 4)) && (!no_entrance)) {
hero = _root.knight;
sprite.head.gotoAndPlay("mount");
sprite.body.play();
Update = UpdateMount;
_root.sound("snd_tank_start");
var _local3 = 0;
while (_local3 < _root.objects.length) {
if (_root.objects[_local3] == this) {
_root.objects.splice(_local3, 1);
break;
}
_local3++;
}
_root.knight.Freeze();
_root.knight = this;
_root.ui.gotoAndStop("tank");
_root.sound("snd_squeak");
body_dir = 0;
sprite.body._rotation = body_dir + 180;
return(undefined);
}
if (no_entrance && (_root.knight.landed)) {
no_entrance = false;
}
}
function UpdateMount() {
_root.p.x = sprite.body.exhaust1._x;
_root.p.y = sprite.body.exhaust1._y;
_root.p = sprite.body.transform.matrix.transformPoint(_root.p);
_root.objects.push(new SteamParticle("black_steam", _root.p.x, _root.p.y, 180, 12, 10, 25, 1));
_root.p.x = sprite.body.exhaust2._x;
_root.p.y = sprite.body.exhaust2._y;
_root.p = sprite.body.transform.matrix.transformPoint(_root.p);
_root.objects.push(new SteamParticle("black_steam", _root.p.x, _root.p.y, 180, 12, 10, 25, 1));
mount_delay--;
if (mount_delay == 10) {
motor_sound.start(0, 9999);
}
if (mount_delay < 0) {
Update = UpdateHero;
_root.view_scale = 85;
mount_delay = 30;
head_frame = 47;
return(undefined);
}
}
function UpdateDie() {
var _local4 = 0;
landed = false;
var _local3 = 0;
while (_local3 < n_joints) {
objects[_local3].y = objects[_local3].y + _root.gravity_y;
objects[_local3].Update();
if (objects[_local3].collided == 3) {
landed = true;
}
_local4 = Math.max(_local4, objects[_local3].hit_f);
_local3++;
}
_local3 = n_joints;
while (_local3 < objects.length) {
objects[_local3].Update();
_local3++;
}
if (foots[0].Update == foots[0].Fixed) {
foots[0].Update();
}
if (foots[1].Update == foots[1].Fixed) {
foots[1].Update();
}
_local3 = n_joints;
while (_local3 < objects.length) {
objects[_local3].Render();
_local3++;
}
sprite.body._x = body.x;
sprite.body._y = body.y;
sprite.leg14._x = foot1.x;
sprite.leg14._y = foot1.y;
sprite.leg24._x = foot2.x;
sprite.leg24._y = foot2.y;
x = body.x;
y = body.y;
body_dir = body_dir * 0.8;
sprite.body._rotation = body_dir + 180;
switch (_mode) {
case 0 :
sprite.head.gotoAndPlay("open");
phase = 0;
_mode = 1;
Balance();
var _local7 = (-((x * 0.7) + (_root.__xmouse * 0.3))) + (_root.w * 0.5);
var _local8 = (-(((y + 100) * 0.7) + (_root.__ymouse * 0.3))) + (_root.h * 0.5);
_root.SmoothView(_local7, _local8);
break;
case 1 :
if (__height > 160) {
__height = __height - 4;
}
if (foots[0].collided != 3) {
foots[0].y = foots[0].y + 0.5;
} else {
foots[0].Fix();
}
if (foots[1].collided != 3) {
foots[1].y = foots[1].y + 0.5;
} else {
foots[1].Fix();
}
if (phase == 15) {
sprite.body.gotoAndPlay("die");
}
if (phase == 30) {
_root.knight = hero;
_root.knight.UnFreeze();
_root.knight.scarf.sprite._visible = true;
hero.Invincibility(90);
_root.objects.push(this);
_root.p.x = sprite.head.spawn._x;
_root.p.y = sprite.head.spawn._y;
_root.p = sprite.head.transform.matrix.transformPoint(_root.p);
hero.oldx = (hero.x = _root.p.x);
hero.oldy = (hero.y = _root.p.y);
hero.oldx = hero.oldx - 5;
hero.oldy = hero.oldy + 15;
no_entrance = true;
_root.view_scale = 100;
_root.ui.gotoAndStop("single");
motor_sound.stop();
_root.sound("snd_engine_off");
_root.sound("snd_squeak");
gun_sound.stop();
body_dir = 0;
}
if (phase == 35) {
sprite.head.gotoAndPlay("die");
phase = 0;
_mode = 2;
var _local6 = joint("body", 400, 20);
objects[9].b = _local6;
_local6.oldx = _local6.oldx - 20;
_local6.oldy = _local6.oldy + 20;
var _local5 = joint("body", 400, 20);
objects[12].b = _local5;
_local5.oldx = _local5.oldx + 20;
_local5.oldy = _local5.oldy + 20;
foots[0].UnFix();
foots[1].UnFix();
}
break;
case 2 :
}
phase++;
}
function UpdateHero() {
if (life <= 0) {
color_head.setTransform(_root.white);
color_body.setTransform(_root.white);
Update = UpdateDie;
return(undefined);
}
var _local4 = 0;
landed = false;
var _local3 = 0;
while (_local3 < n_joints) {
objects[_local3].y = objects[_local3].y + _root.gravity_y;
objects[_local3].Update();
if (objects[_local3].collided == 3) {
landed = true;
}
_local4 = Math.max(_local4, objects[_local3].hit_f);
_local3++;
}
x = body.x;
y = body.y;
Target(_root.__xmouse, _root.__ymouse);
if (Key.isDown(1) || (Key.isDown(32))) {
if (!gun_sound_started) {
gun_sound.start(0, 9999);
gun_sound_started = true;
}
Shot();
sprite.head.rotor._rotation = sprite.head.rotor._rotation + 60;
} else if (gun_sound_started) {
gun_sound.stop();
gun_sound_started = false;
}
var _local5 = 0;
var _local9 = 0;
if (__height > 120) {
if (Key.isDown(87) || (Key.isDown(38))) {
charge = 50;
Grenade();
}
}
if (_root.__xmouse > body.x) {
_root.p.x = sprite.body.__target._x;
_root.p.y = sprite.body.__target._y;
_root.p = sprite.body.transform.matrix.transformPoint(_root.p);
var _local8 = Math.atan2(_root.__ymouse - _root.p.y, _root.__xmouse - _root.p.x) * _root.radtodeg;
body_dir = _root.interpolate(body_dir, _local8, 0.05);
body_dir = _root.limit(body_dir, -30, 30);
} else {
body_dir = _root.interpolate(body_dir, 0, 0.05);
}
sprite.body._rotation = body_dir + 180;
if (Key.isDown(65) || (Key.isDown(37))) {
_local5 = _local5 - 1;
}
if (Key.isDown(68) || (Key.isDown(39))) {
_local5 = _local5 + 1;
}
if (_local5) {
if (!dir) {
dir = _local5;
StartWalk();
}
if (dir != _local5) {
}
dir = _local5;
} else if (active_foot.collided == 3) {
dir = 0;
}
if (Key.isDown(83) || (Key.isDown(40))) {
if (__height > 120) {
__height = __height - 5;
} else if (head_frame < 74) {
head_frame++;
sprite.head.gotoAndStop(head_frame);
} else if (Key.isDown(87) || (Key.isDown(38))) {
PlayerExit();
return(undefined);
}
} else {
if (__height < 250) {
__height = __height + 10;
}
if (head_frame > 47) {
head_frame--;
sprite.head.gotoAndStop(head_frame);
}
}
d_foot_angle = dir * step_ang_speed;
Balance();
Walk();
if (life <= 0) {
if (on_die) {
on_die();
on_die = 0;
}
}
body.x = body.x + 45;
body.y = body.y + 30;
head_link.Update();
body.x = body.x - 45;
body.y = body.y - 30;
_local3 = n_joints;
while (_local3 < objects.length) {
objects[_local3].Update();
_local3++;
}
if (foots[0].Update == foots[0].Fixed) {
foots[0].Update();
}
if (foots[1].Update == foots[1].Fixed) {
foots[1].Update();
}
_local3 = n_joints;
while (_local3 < objects.length) {
objects[_local3].Render();
_local3++;
}
sprite.body._x = body.x;
sprite.body._y = body.y;
sprite.leg14._x = foot1.x;
sprite.leg14._y = foot1.y;
sprite.leg24._x = foot2.x;
sprite.leg24._y = foot2.y;
reloading--;
pain_head--;
pain_body--;
activate_delay--;
pain--;
if (pain_head == 0) {
color_head.setTransform(_root.white);
}
if (pain_body == 0) {
color_body.setTransform(_root.white);
}
var _local6 = (-((x * 0.7) + (_root.__xmouse * 0.3))) + (_root.w * 0.5);
var _local7 = (-(((y + 100) * 0.7) + (_root.__ymouse * 0.3))) + (_root.h * 0.5);
_root.SmoothView(_local6, _local7);
}
function PlayerExit() {
_root.knight = hero;
_root.knight.UnFreeze();
_root.knight.scarf.sprite._visible = true;
_root.objects.push(this);
sprite.head.gotoAndPlay("empty");
_root.p.x = sprite.head.spawn._x;
_root.p.y = sprite.head.spawn._y;
_root.p = sprite.head.transform.matrix.transformPoint(_root.p);
hero.oldx = (hero.x = _root.p.x);
hero.oldy = (hero.y = _root.p.y);
hero.oldx = hero.oldx - 5;
hero.oldy = hero.oldy + 15;
Update = UpdateEmpty;
no_entrance = true;
_root.view_scale = 100;
sprite.body.gotoAndPlay("close");
_root.ui.gotoAndStop("single");
motor_sound.stop();
_root.sound("snd_engine_off");
_root.sound("snd_squeak");
gun_sound.stop();
body_dir = 0;
}
function joint(part_name, m, r) {
var _local2 = new JointCBLF(sprite[part_name]._x, sprite[part_name]._y, m, r, "no");
objects.push(_local2);
objects[objects.length - 1].id = part_name;
return(_local2);
}
function jointf(part_name, m, r) {
var _local2 = new JointCBLF(sprite[part_name]._x, sprite[part_name]._y, m, r, "no");
objects.push(_local2);
objects[objects.length - 1].id = part_name;
foots.push(_local2);
return(_local2);
}
function jointno(part_name, m, r) {
var _local2 = new JointLoFr(sprite[part_name]._x, sprite[part_name]._y, m);
objects.push(_local2);
objects[objects.length - 1].id = part_name;
return(_local2);
}
function link(name1, name2, k, part_name) {
var _local4;
var _local3;
var _local2 = 0;
while (_local2 < n_joints) {
if (objects[_local2].id == name1) {
_local4 = objects[_local2];
}
if (objects[_local2].id == name2) {
_local3 = objects[_local2];
}
if (_local4 && (_local3)) {
break;
}
_local2++;
}
var _local5;
if (k > 0) {
if (part_name) {
_local5 = new LinkSprite(_local4, _local3, k, sprite[part_name]);
} else {
_local5 = new Link(_local4, _local3, k);
}
} else {
_local5 = new LinkPush(_local4, _local3, -k);
}
objects.push(_local5);
return(_local5);
}
function AddSpeed(vx, vy, rnd) {
var _local2 = 0;
while (_local2 < n_joints) {
objects[_local2].x = objects[_local2].x + ((vx + (Math.random() * rnd)) - (rnd * 0.5));
objects[_local2].y = objects[_local2].y + ((vy + (Math.random() * rnd)) - (rnd * 0.5));
_local2++;
}
}
function Activate() {
activated = true;
}
function sort_left(a, b) {
if (a.x < b.x) {
return(1);
}
return(-1);
}
function sort_right(a, b) {
if (a.x > b.x) {
return(1);
}
return(-1);
}
function StartWalk() {
if (life <= 0) {
return(undefined);
}
if ((!active_foot) || (((foot1.x - foot2.x) * dir) < 0)) {
active_foot = foots[0];
overstep_foot = foots[1];
} else {
active_foot = foots[1];
overstep_foot = foots[0];
}
foot_angle = Math.atan2(active_foot.y - overstep_foot.y, active_foot.x - overstep_foot.x);
step_dist = 0;
d_foot_angle = dir * step_ang_speed;
active_foot.UnFix();
behavior = Walk;
}
function Balance() {
if (life <= 0) {
return(undefined);
}
if ((foot1.collided == 3) || (foot2.collided == 3)) {
var _local5 = 5;
knee11.x = knee11.x + _local5;
knee12.x = knee12.x - _local5;
objects[5].x = objects[5].x + _local5;
objects[6].x = objects[6].x - _local5;
body.oldx = _root.interpolate(body.oldx, x, 0.1);
body.oldy = _root.interpolate(body.oldy, y, 0.1);
}
if (!foots[0].collided) {
foots[0].y = foots[0].y + (_root.gravity_y * 0.5);
}
if (!foots[1].collided) {
foots[1].y = foots[1].y + (_root.gravity_y * 0.5);
}
var _local4;
var _local3 = 0;
while (_local3 < foots.length) {
if (foots[_local3].collided != 1) {
if ((foots[_local3].y > _local4) || (!_local4)) {
_local4 = foots[_local3].y;
}
}
if ((foots[_local3].collided == 3) && (foots[_local3] != active_foot)) {
foots[_local3].Fix();
}
_local3++;
}
if (_local4) {
if ((_local4 - body.y) < __height) {
body.y = body.y + (((_local4 - body.y) - __height) * 0.05);
}
body.x = body.x + ((((foot1.x + foot2.x) * 0.5) - body.x) * 0.05);
}
}
function Walk() {
if (life <= 0) {
return(undefined);
}
if (!active_foot) {
StartWalk();
} else if (overstep_foot.collided == 3) {
foot_angle = foot_angle + d_foot_angle;
step_dist = step_dist + d_foot_angle;
var _local6 = overstep_foot.x + (Math.cos(foot_angle) * step_r);
var _local5 = overstep_foot.y + (Math.sin(foot_angle) * step_r);
var _local4 = _local6 - active_foot.x;
var _local3 = _local5 - active_foot.y;
_local4 = _local4 * 0.125;
_local3 = _local3 * 0.125;
active_foot.x = active_foot.x + _local4;
active_foot.y = active_foot.y + _local3;
overstep_foot.x = overstep_foot.x - _local4;
overstep_foot.y = overstep_foot.y - _local3;
if (active_foot.x < left_bound) {
active_foot.x = left_bound;
}
if (active_foot.x > right_bound) {
active_foot.x = right_bound;
}
if ((Math.abs(step_dist) > 0.6) && (active_foot.collided == 3)) {
active_foot.Fix();
StartWalk();
_root.sound("snd_mech_hit");
}
if (Math.abs(step_dist) > 5) {
StartWalk();
}
}
}
function SetSide() {
var _local2 = n_joints;
while (_local2 < objects.length) {
if (objects[_local2].sprite) {
objects[_local2].sprite._yscale = (-side) * 100;
}
_local2++;
}
}
function Target(tx, ty) {
_root.p.x = sprite.head.gun._x;
_root.p.y = sprite.head.gun._y;
_root.p = sprite.head.transform.matrix.transformPoint(_root.p);
var _local5 = (Math.atan2(_root.p.y - ty, _root.p.x - tx) * _root.radtodeg) - 180;
var _local4 = gun._rotation;
var _local3 = (_local5 - sprite.head._rotation) - _local4;
while (_local3 > 180) {
_local3 = _local3 - 360;
}
while (_local3 < -180) {
_local3 = _local3 + 360;
}
gun._rotation = _local4 + (_local3 * 0.4);
}
function Shot() {
if (gun.ready) {
gun.gotoAndPlay("shot");
_root.p.x = gun.barrel._x;
_root.p.y = gun.barrel._y;
_root.p = gun.transform.matrix.transformPoint(_root.p);
_root.p = sprite.head.transform.matrix.transformPoint(_root.p);
var _local3 = new PlayerBullet("pistol_bullet", _root.p.x, _root.p.y, ((gun._rotation + sprite.head._rotation) + random(20)) - 10, 25, 10, 6, 1500);
_local3.sprite._yscale = 200;
_local3.aabb.dx = (_local3.aabb.dy = -15);
_local3.aabb.w = (_local3.aabb.h = 30);
_root.p_bullets.push(_local3);
}
}
function Grenade() {
if (!sprite.body.ready) {
return(undefined);
}
sprite.body.ready = false;
sprite.body.gotoAndPlay("shot");
_root.p.x = sprite.body.barrel._x;
_root.p.y = sprite.body.barrel._y;
_root.p = sprite.body.transform.matrix.transformPoint(_root.p);
_root.p_bullets.push(new TankGrenade("tank_grenade", _root.p.x, _root.p.y, body_dir, 10 + (charge * 0.5), 300, 10, 50));
body.oldx = body.oldx + (Math.cos(body_dir * _root.degtorad) * 24);
body.oldy = body.oldy + (Math.sin(body_dir * _root.degtorad) * 24);
body_dir = body_dir - 5;
charge = 0;
}
function Gibs(__x, __y, n_gibs) {
var _local2 = 0;
while (_local2 < n_gibs) {
_root.objects.push(new SpinningGib("metal_gibs", __x, __y, random(360), 15, 10, random(8) + 20, 4));
_local2++;
}
}
function Collisions() {
return(undefined);
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
var _local2 = 0;
while (_local2 < objects.length) {
delete objects[_local2];
objects.splice(_local2, 1);
_local2++;
}
}
function Alive() {
return(life > -10000);
}
function InGame() {
if ((x + 100) < _root.left_border) {
return(false);
}
if ((x - 100) > _root.right_border) {
return(false);
}
if ((y + 100) < _root.top_border) {
return(false);
}
if ((y - 100) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
if (life > 0) {
return(true);
}
if (on_die) {
return(true);
}
}
function UnFreeze() {
sprite._visible = true;
}
function addv(vx, vy, rand) {
var _local2 = 0;
while (_local2 < 11) {
objects[_local2].x = objects[_local2].x + (vx + ((Math.random() - 0.5) * rand));
objects[_local2].y = objects[_local2].y + (vy + ((Math.random() - 0.5) * rand));
_local2++;
}
}
function getspeed() {
var _local3 = objects[6].x - objects[6].oldx;
var _local2 = objects[6].y - objects[6].oldy;
return(Math.sqrt((_local3 * _local3) + (_local2 * _local2)));
}
function can_hang() {
return(false);
}
function getx() {
return(head.x);
}
function gety() {
return(head.y);
}
function getvy() {
return(head.y - head.oldy);
}
function addvx(dx) {
head.x = head.x + dx;
}
function addvy(dy) {
head.y = head.y + dy;
}
function gethangx() {
return(0);
}
function gethangy() {
return(0);
}
function RemoveSprite() {
removeMovieClip(sprite);
}
function CollideBody(_aabb) {
collided = 0;
var _local3 = _root.collide_aabb(_aabb, body.aabb);
if (_local3) {
collided = 1;
return(true);
}
_local3 = _root.collide_aabb(_aabb, head.aabb);
if (_local3) {
collided = 2;
return(true);
}
}
function PickWeapon(wpn, ammo) {
hero.PickWeapon(wpn, ammo);
}
function Invincibility(t) {
}
function Damage(dx, dy, p, dmg) {
pain = p;
life = life - dmg;
_root.ui.lifebar.gotoAndStop(int(life / 20) + 1);
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
switch (collided) {
case 1 :
body.x = body.x + dx;
body.y = body.y + dy;
pain_body = 4;
color_body.setTransform(_root.light_orange);
break;
case 2 :
head.x = head.x + dx;
head.y = head.y + dy;
pain_head = 4;
color_head.setTransform(_root.light_orange);
break;
default :
body.x = body.x + dx;
body.y = body.y + dy;
head.x = head.x + dx;
head.y = head.y + dy;
pain_body = 4;
color_body.setTransform(_root.light_orange);
pain_head = 4;
color_head.setTransform(_root.light_orange);
}
}
function Pause() {
var _local2 = sprite.head._currentframe;
if ((_local2 < 48) || (_local2 > 74)) {
switch (_local2) {
case 19 :
case 47 :
case 74 :
case 118 :
break;
default :
sprite.head.stop();
}
}
switch (sprite.body._currentframe) {
case 1 :
case 55 :
case 275 :
break;
default :
sprite.body.stop();
}
gun_sound.setVolume(0);
}
function UnPause() {
var _local2 = sprite.head._currentframe;
if ((_local2 < 48) || (_local2 > 74)) {
switch (_local2) {
case 19 :
case 47 :
case 74 :
case 118 :
break;
default :
sprite.head.play();
}
}
switch (sprite.body._currentframe) {
case 1 :
case 55 :
case 275 :
break;
default :
sprite.body.play();
}
gun_sound.setVolume(40);
}
static var reload_time = 60;
var maxlife = 1100;
var step_r = 150;
var step_ang_speed = 0.1;
}
Symbol 3198 MovieClip [__Packages.SteamParticle] Frame 0
class SteamParticle extends Obj
{
var x, y, id, sprite, aabb, life, dalpha, vx, vy;
function SteamParticle (sprite_name, __x, __y, dir, speed, r, _life, depth) {
super();
x = __x;
y = __y;
id = _root.get_id();
if (depth == undefined) {
depth = 12;
}
sprite = _root.objects_layer.attachMovie(sprite_name, "gi" + id, id + (_root.depth_band * depth));
sprite._x = x;
sprite._y = y;
aabb = new Object();
aabb.dx = -r;
aabb.dy = -r;
aabb.w = r + r;
aabb.h = r + r;
aabb.x = __x;
aabb.y = __y;
life = _life;
dalpha = -50 / life;
dir = dir * _root.degtorad;
vx = speed * Math.cos(dir);
vy = speed * Math.sin(dir);
}
function Update() {
if (life <= 0) {
return(undefined);
}
x = x + (vx + _root.wind_x);
y = y + vy;
aabb.x = x + aabb.dx;
aabb.y = y + aabb.dy;
if (_root.collide(aabb)) {
Update = function () {
};
sprite.gotoAndPlay("die");
}
sprite._alpha = sprite._alpha + dalpha;
sprite._x = x;
sprite._y = y;
life--;
}
function Kill() {
life = -10000;
if (sprite) {
removeMovieClip(sprite);
}
sprite = 0;
delete aabb;
}
function Alive() {
return((life > 0) && (sprite._currentframe != 45));
}
function InGame() {
if ((x + 20) < _root.left_border) {
return(false);
}
if ((x - 20) > _root.right_border) {
return(false);
}
if ((y + 20) < _root.top_border) {
return(false);
}
if ((y - 20) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
if (life < 1000) {
Kill();
} else {
sprite._visible = false;
}
}
function UnFreeze() {
sprite._visible = true;
}
function Pause() {
switch (sprite._currentframe) {
case 30 :
case 45 :
break;
default :
sprite.stop();
}
}
function UnPause() {
switch (sprite._currentframe) {
case 30 :
case 45 :
break;
default :
sprite.play();
}
}
}
Symbol 3199 MovieClip [__Packages.JointCBLF] Frame 0
class JointCBLF extends JointCollideBounce
{
var oldx, x, oldy, y, aabb, collided, hit_f, collided_brick, sprite, Update;
function JointCBLF (__x, __y, _mass, _r, spritename) {
super(__x, __y, _mass, _r, spritename);
}
function UpdatePhysics() {
var _local4 = (x - oldx) * 0.99995;
var _local3 = (y - oldy) * 0.99995;
oldx = x;
oldy = y;
_local4 = _root.limit(_local4, -40, 40);
_local3 = _root.limit(_local3, -40, 40);
x = x + _local4;
y = y + _local3;
aabb.x = x + aabb.dx;
aabb.y = y + aabb.dy;
collided = 0;
hit_f = 0;
if (_root.collide(aabb)) {
x = x + _root.p.x;
if (_local3 < -1) {
if (_root.collided_brick instanceof Platform) {
_root.p.y = 0;
}
}
if ((_root.p.y * _local3) < 0) {
y = y + _root.p.y;
} else {
y = y + _root.p.y;
oldy = oldy + _root.p.y;
}
if (_root.p.y != 0) {
if ((_root.p.y * _local3) < 0) {
oldy = _root.interpolate(oldy, y, 0.8);
}
x = _root.interpolate(x, oldx, 0.15);
if (_root.p.y < 0) {
collided = 3;
} else {
collided = 1;
}
collided_brick = _root.collided_brick;
y = y - (_local3 * 0.65);
hit_f = hit_f + Math.abs(_local3);
} else if (_root.p.x != 0) {
oldx = _root.interpolate(oldx, x, 0.8);
if (_root.p.x < 0) {
collided = 2;
} else {
collided = 4;
}
collided_brick = _root.collided_brick;
x = x - (_local4 * 0.65);
hit_f = hit_f + Math.abs(_local4);
}
}
if (sprite) {
sprite._x = x;
sprite._y = y;
}
}
function Fixed() {
x = oldx;
y = oldy;
}
function Fix() {
Update = Fixed;
}
function UnFix() {
Update = UpdatePhysics;
}
}
Symbol 3200 MovieClip [__Packages.LinkPush] Frame 0
class LinkPush extends Obj
{
var a, b, k, r;
function LinkPush (_a, _b, _k, spritename) {
super();
a = _a;
b = _b;
k = _k;
r = _root.DistPoint(a.x, a.y, b.x, b.y);
}
function Update() {
var _local4 = b.x - a.x;
var _local3 = b.y - a.y;
var _local6 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local5 = (_local6 - (r * _root.pull_coeff)) / _local6;
if (_local5 > 0) {
return(undefined);
}
_local5 = _local5 * (k / (a.mass + b.mass));
_local4 = _local4 * _local5;
_local3 = _local3 * _local5;
a.x = a.x + (b.mass * _local4);
a.y = a.y + (b.mass * _local3);
b.x = b.x - (a.mass * _local4);
b.y = b.y - (a.mass * _local3);
}
function Kill() {
}
function Alive() {
return(true);
}
function Angle() {
return(Math.atan2(b.y - a.y, b.x - a.x));
}
}
Symbol 3201 MovieClip [__Packages.TankGrenade] Frame 0
class TankGrenade extends JointCollide
{
var x, y, id, sprite, aabb, life, vx, vy, oldx, oldy, damage, force, exploded, UpdatePhysics, collided;
function TankGrenade (sprite_name, __x, __y, dir, speed, _damage, r, _force) {
super();
x = __x;
y = __y;
id = _root.get_id();
sprite = _root.objects_layer.attachMovie(sprite_name, "tg" + id, id + (_root.depth_band * 12));
sprite._x = x;
sprite._y = y;
sprite._rotation = dir;
aabb = new Object();
aabb.dx = -r;
aabb.dy = -r;
aabb.w = r + r;
aabb.h = r + r;
aabb.x = __x;
aabb.y = __y;
life = 90;
dir = dir * _root.degtorad;
vx = speed * Math.cos(dir);
vy = speed * Math.sin(dir);
oldx = x - vx;
oldy = y - vy;
damage = _damage;
force = _force;
exploded = false;
}
function Update() {
y = y + _root.gravity_y;
var _local4 = x - oldx;
var _local3 = y - oldy;
sprite._rotation = Math.atan2(_local3, _local4) * _root.radtodeg;
UpdatePhysics();
life--;
if ((life <= 0) || (collided)) {
Explode();
return(undefined);
}
}
function Explode() {
Update = ExplosionUpdate;
Collide = ExplosionCollide;
sprite.gotoAndPlay("die");
sprite._rotation = 0;
life = 0;
aabb.x = x - 100;
aabb.y = y - 100;
aabb.w = 250;
aabb.h = 250;
_root.sound_mc_point("snd_big_boom_debris", sprite, x, 100);
}
function ExplosionCollide(_aabb) {
if (life != 1) {
return(undefined);
}
if (_root.collide_aabb(_aabb, aabb)) {
vx = (_aabb.x + (_aabb.w * 0.5)) - x;
vy = (_aabb.y + (_aabb.h * 0.5)) - y;
var _local3 = Math.sqrt((vx * vx) + (vy * vy));
_local3 = force / _local3;
vx = vx * _local3;
vy = vy * _local3;
_root.p.x = vx * 1000;
_root.p.y = vy * 1000;
return(true);
}
return(false);
}
function ExplosionUpdate() {
life++;
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
delete aabb;
}
function Alive() {
if (sprite._currentframe == 95) {
return(false);
}
return(true);
}
function InGame() {
if ((x + 30) < _root.left_border) {
return(false);
}
if ((x - 30) > _root.right_border) {
return(false);
}
if ((y + 30) < _root.top_border) {
return(false);
}
if ((y - 30) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
Kill();
}
function UnFreeze() {
Kill();
}
function Collide(_aabb) {
if (_root.collide_aabb(_aabb, aabb)) {
Explode();
}
return(false);
}
function Hit() {
if (life != 1) {
return(undefined);
}
_root.p.x = vx * 1000;
_root.p.y = vy * 1000;
}
}
Symbol 3202 MovieClip [__Packages.BrickStatic] Frame 0
class BrickStatic
{
var x, y, type, w, h, mc;
function BrickStatic (_mc, _type, _dx, _dy) {
if (_dx != undefined) {
x = _dx + _mc._x;
} else {
x = 0;
}
if (_dy != undefined) {
y = int(_dy + _mc._y);
} else {
y = 0;
}
if (_type != undefined) {
type = _type;
} else {
type = 0;
}
w = _mc._width;
h = _mc._height;
mc = _mc;
}
function Collide(aabb) {
var _local4 = (aabb.x + aabb.w) - x;
if (_local4 < 0) {
return(false);
}
var _local7 = aabb.x - (x + w);
if (_local7 > 0) {
return(false);
}
var _local3 = (aabb.y + aabb.h) - y;
if (_local3 < 0) {
return(false);
}
var _local6 = aabb.y - (y + h);
if (_local6 > 0) {
return(false);
}
if (Math.abs(_local3) > Math.abs(_local6)) {
_local3 = _local6;
}
if (Math.abs(_local4) > Math.abs(_local7)) {
_local4 = _local7;
}
if ((Math.abs(_local4) > 0.1) && (Math.abs(_local3) > 0.1)) {
if ((Math.abs(_local4) + 3) < Math.abs(_local3)) {
_root.p.x = _root.p.x - _local4;
_root.collided_brick = this;
return(true);
}
_root.p.y = _root.p.y - _local3;
_root.collided_brick = this;
return(true);
}
}
function getx() {
return(x);
}
function gety() {
return(y);
}
function getw() {
return(w);
}
function geth() {
return(h);
}
function CollidePoint(px, py) {
var _local3 = px - x;
if ((_local3 < 0) || (_local3 > w)) {
return(false);
}
var _local2 = py - y;
if ((_local2 < 0) || (_local2 > h)) {
return(false);
}
return(true);
}
}
Symbol 3203 MovieClip [__Packages.BonusHeal] Frame 0
class BonusHeal extends BonusRailgun
{
var y, UpdatePhysics, life, aabb, sprite, ammo;
function BonusHeal (__x, __y, sprite_name, _ammo) {
super(__x, __y, sprite_name, _ammo);
}
function Update() {
y = y + _root.gravity_y;
UpdatePhysics();
if (life <= 0) {
return(undefined);
}
if (((_root.knight.life < 100) && (_root.knight.life > 0)) && (_root.knight instanceof Hero)) {
if (_root.CollideKnight(aabb)) {
sprite.gotoAndPlay("die");
_root.HealKnight(ammo);
life = -1;
return(undefined);
}
}
}
function Pause() {
sprite.stop();
}
function UnPause() {
if (sprite._currentframe == 20) {
sprite.gotoAndPlay(1);
} else {
sprite.play();
}
}
}
Symbol 3204 MovieClip [__Packages.BonusGold] Frame 0
class BonusGold extends JointCollide
{
var x, y, oldx, oldy, id, sprite, aabb, mass, collided, life, UpdatePhysics;
function BonusGold (__x, __y, dir, speed) {
super();
x = __x;
y = __y;
dir = dir * _root.degtorad;
oldx = x - (speed * Math.cos(dir));
oldy = y - (speed * Math.sin(dir));
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("gold", "g" + id, id + (_root.depth_band * 3));
sprite._x = x;
sprite._y = y;
sprite._visible = false;
aabb = new Object();
aabb.w = 32;
aabb.h = 32;
aabb.dx = (-aabb.w) * 0.5;
aabb.dy = (-aabb.h) * 0.5;
aabb.x = __x;
aabb.y = __y;
mass = 3000;
collided = 0;
life = 100;
}
function Update() {
y = y + _root.gravity_y;
UpdatePhysics();
if (collided == 3) {
if (_root.collided_brick instanceof BrickStatic) {
Update = Static;
}
}
if (_root.CollideKnight(aabb)) {
_root.add_score(100);
Update = Follow;
life = -1;
return(undefined);
}
}
function Static() {
if (_root.CollideKnight(aabb)) {
_root.add_score(100);
Update = Follow;
life = -1;
}
}
function Kill() {
life = -1;
removeMovieClip(sprite);
delete aabb;
}
function Alive() {
if (sprite._currentframe == 10) {
return(false);
}
return(true);
}
function InGame() {
if ((x + 40) < _root.left_border) {
return(false);
}
if ((x - 40) > _root.right_border) {
return(false);
}
if ((y + 40) < _root.top_border) {
return(false);
}
if ((y - 40) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
function Follow() {
if (life == -10000) {
return(undefined);
}
life = life - 1;
if (life > -10) {
return(undefined);
}
var _local4 = _root.knight.getx() - x;
var _local3 = _root.knight.gety() - y;
x = x + (_local4 * 0.5);
y = y + (_local3 * 0.5);
if ((Math.abs(_local4) < 20) && (Math.abs(_local3) < 52)) {
sprite.gotoAndPlay("die");
life = -10000;
if ((_root.snd_coin.position == 0) || (_root.snd_coin.position > 100)) {
_root.snd_coin.start(0, 1);
}
}
sprite._x = x;
sprite._y = y;
}
function Pause() {
switch (sprite._currentframe) {
case 1 :
case 10 :
break;
default :
sprite.stop();
}
sprite.body.stop();
}
function UnPause() {
switch (sprite._currentframe) {
case 1 :
case 10 :
break;
default :
sprite.play();
}
sprite.body.play();
}
}
Symbol 3205 MovieClip [__Packages.Background] Frame 0
class Background
{
var sprite, x, y, speedx, speedy;
function Background (_sprite, _speedx, _speedy) {
sprite = _sprite;
x = sprite._x;
y = sprite._y;
if (_speedy == undefined) {
_speedy = _speedx;
}
speedx = 1 - _speedx;
speedy = 1 - _speedy;
}
function Update() {
sprite._x = int(x - (_root._x * speedx));
sprite._y = int(y - (_root._y * speedy));
}
}
Symbol 3206 MovieClip [__Packages.TileXBackground] Frame 0
class TileXBackground
{
var sprite, x, y, speedx, speedy, width, height, dx, dy, wind;
function TileXBackground (_sprite, _speedx, _speedy, _wind) {
sprite = _sprite;
x = int(sprite._x);
y = int(sprite._y);
if (_speedy == undefined) {
_speedy = _speedx;
}
speedx = _speedx;
speedy = 1 - _speedy;
width = int(sprite._width / 2);
height = int(sprite._height / 2);
dx = _root._x;
dy = _root._y;
wind = _wind;
}
function Update() {
if (sprite._parent == _root.level) {
_root.actual_root_pos();
dx = dx - (_root.p.x - _root.level_vx);
if (wind) {
dx = dx - (_root.wind_x * speedx);
}
x = x - (dx * speedx);
if (x > 0) {
x = x - width;
} else if (x < (-width)) {
x = x + width;
}
sprite._x = int(x - _root.p.x);
sprite._y = int(y - (_root.p.y * speedy));
dx = _root.p.x;
} else {
_root.actual_root_pos();
dx = dx - (_root.p.x - _root.level_vx);
if (wind) {
dx = dx - (_root.wind_x * speedx);
}
x = x - (dx * speedx);
if (x > 0) {
x = x - width;
} else if (x < (-width)) {
x = x + width;
}
sprite._x = int(x - _root._x);
sprite._y = int(y - (_root._y * speedy));
dx = _root.p.x;
}
}
}
Symbol 3207 MovieClip [__Packages.Crate] Frame 0
class Crate extends JointCollide
{
var x, y, oldx, oldy, id, sprite, aabb, mass, collided, life, dm, contain, UpdatePhysics;
function Crate (__x, __y, sprite_name, sample_sprite, _life, _contain, depth) {
super();
x = __x;
y = __y;
oldx = x;
oldy = y;
id = _root.get_id();
if (!depth) {
depth = 4;
}
sprite = _root.objects_layer.attachMovie(sprite_name, "c" + id, id + (_root.depth_band * depth));
sprite._x = x;
sprite._y = y;
sprite._visible = false;
if (!sample_sprite) {
sample_sprite = sprite;
}
aabb = new Object();
aabb.w = sample_sprite._width;
aabb.h = sample_sprite._height;
aabb.dx = (-aabb.w) * 0.5;
aabb.dy = (-aabb.h) * 0.5;
aabb.x = __x;
aabb.y = __y;
sprite._width = aabb.w;
sprite._height = aabb.h;
mass = ((3000 * aabb.w) * aabb.h) / 4096;
collided = 0;
life = 100;
dm = 0.5 / ((aabb.w * aabb.h) / 4096);
life = life * ((aabb.w * aabb.h) / 4096);
if (_life != undefined) {
life = _life;
}
contain = _contain;
}
function Update() {
y = y + _root.gravity_y;
UpdatePhysics();
if (life <= 0) {
if (collided == 3) {
if (_root.collided_brick instanceof BrickStatic) {
Update = function () {
};
}
}
return(undefined);
}
var _local3 = _root.CollideBullets(aabb);
if (_local3 > 0) {
x = x + (_root.p.x / mass);
y = y + (_root.p.y / mass);
life = life - _local3;
if (life > 1000) {
_root.sound("snd_metal_bullet" + (random(3) + 1));
}
}
if (life <= 0) {
sprite.gotoAndPlay("die");
aabb.h = aabb.h * 0.25;
aabb.dy = aabb.h;
if (contain) {
_root.bonus(contain, x, y);
}
_root.add_score(50);
return(undefined);
}
if (_root.CollideKnight(aabb)) {
x = x + (_root.p.x * dm);
y = y + (_root.p.y * dm);
_root.p.x = _root.limit(_root.p.x, -5, 5);
_root.knight.addvx((-_root.p.x) * (1 - dm));
_root.knight.addvy((-_root.p.y) * (1 - dm));
if (_root.p.y > 0) {
_root.knight.landed_on_crate = true;
}
}
}
function Kill() {
life = -1;
removeMovieClip(sprite);
delete aabb;
}
function Alive() {
if (life <= -10000) {
return(false);
}
return(true);
}
function InGame() {
if ((x + 100) < _root.left_border) {
return(false);
}
if ((x - 100) > _root.right_border) {
return(false);
}
if ((y + 100) < _root.top_border) {
return(false);
}
if ((y - 100) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
sprite._visible = false;
if (life < 0) {
life = -1000;
return(undefined);
}
}
function UnFreeze() {
sprite._visible = true;
}
function Pause() {
switch (sprite._currentframe) {
case 1 :
case 24 :
break;
default :
sprite.stop();
}
}
function UnPause() {
switch (sprite._currentframe) {
case 1 :
case 24 :
break;
default :
sprite.play();
}
}
}
Symbol 3208 MovieClip [__Packages.Enemy] Frame 0
class Enemy extends Man
{
var SwitchWeapon, action_reload, vx, vy, reloading, dist, behavior, rnd_bhv, behavior_reload, destx, desty, Die, move_speed, hp, life, collided_brick, x, Move, old_behavior, hand2, hand1, y, shot, landed, action, body, sprite, _skin, oldy, pain, dir, view_side, InGame, BarrelPos, UpdatePhysics, collided, aabb, mass, Damage;
function Enemy (__x, __y, sprite_name, _weapon, _skin, _life, _behavior, depth) {
super(__x, __y, sprite_name, 1, _skin, _life, depth);
SwitchWeapon(_weapon);
action_reload = 0;
vx = (vy = 0);
reloading = 40 + random(40);
dist = 150;
switch (_behavior) {
case 0 :
behavior = Patrol;
break;
case 1 :
behavior = Agressive;
break;
case 2 :
behavior = Cowardly;
dist = 300;
break;
case 3 :
behavior = HoldPlatform;
break;
case 4 :
behavior = Random;
rnd_bhv = Agressive;
behavior_reload = 0;
break;
case 5 :
destx = (desty = 0);
behavior = JetPack;
Die = JetDie;
}
move_speed = 1;
hp = life;
if (_skin >= 22) {
move_speed = 2;
}
}
function Patrol() {
var _local2 = 0;
vy = 0;
if (collided_brick) {
if (vx < 0) {
if (collided_brick.getx() > (x - 20)) {
_local2 = 1;
}
} else if ((collided_brick.getx() + collided_brick.getw()) < (x + 20)) {
_local2 = -1;
}
}
if (_local2) {
if (random(100) < 70) {
vx = 0;
} else {
vx = _local2;
}
action_reload = 50;
} else if (action_reload <= 0) {
if (random(100) < 50) {
vx = 1;
} else {
vx = -1;
}
action_reload = 50;
}
Move((vx * 0.325) * move_speed, vy * 0.75);
}
function _move() {
vx = 1;
if (destx < x) {
vx = -1;
}
var _local2 = false;
if (collided_brick) {
if (vx < 0) {
if (collided_brick.getx() > (x - 20)) {
_local2 = true;
}
} else if ((collided_brick.getx() + collided_brick.getw()) < (x + 20)) {
_local2 = true;
}
}
if (_local2) {
vy = -1;
}
Move((vx * 0.325) * move_speed, 0);
if (Math.abs(x - destx) < 40) {
behavior = old_behavior;
}
hand2.gotoAndStop(hand1._currentframe);
}
function MoveDX(dx) {
destx = x + dx;
old_behavior = behavior;
behavior = _move;
SetSide(destx - x);
}
function Agressive() {
if ((y - _root.knight.gety()) < -350) {
Patrol();
return(undefined);
}
shot();
if ((action_reload >= 0) && (vx == 0)) {
Move(0, 0);
return(undefined);
}
if (!landed) {
Move(vx, 0);
return(undefined);
}
var _local5 = vx;
var _local3 = x - _root.knight.getx();
if (_local3 < 0) {
if (_local3 < (-dist)) {
vx = 1;
} else if (_local3 > ((-dist) + 40)) {
vx = -1;
}
} else if (_local3 > dist) {
vx = -1;
} else if (_local3 < (dist - 40)) {
vx = 1;
}
if ((vx * _local5) < 0) {
action_reload = 0;
}
var _local4 = false;
if (collided_brick) {
if (vx < 0) {
if (collided_brick.getx() > (x - 20)) {
_local4 = true;
}
} else if ((collided_brick.getx() + collided_brick.getw()) < (x + 20)) {
_local4 = true;
}
}
if ((action_reload <= 0) || (_local4)) {
action_reload = random(10) + 10;
if (_local4) {
if (random(100) < 50) {
vy = -1;
} else {
vx = (vy = 0);
}
} else if (random(100) < 10) {
vy = -1;
if (random(100) < 50) {
vx = 0;
}
} else if (random(100) < 50) {
vx = 0;
}
}
Move((vx * 0.325) * move_speed, vy * 0.75);
if (vy) {
vy = 0;
}
}
function Cowardly() {
shot();
if ((action_reload >= 0) && (vx == 0)) {
if (action_reload > 10) {
Move(0, 1);
}
return(undefined);
}
if (!landed) {
Move(vx, 0);
return(undefined);
}
var _local5 = vx;
var _local4 = x - _root.knight.getx();
if (_local4 < 0) {
if (_local4 > ((-dist) + 40)) {
vx = -1;
}
} else if (_local4 < (dist - 40)) {
vx = 1;
}
if ((vx * _local5) < 0) {
action_reload = 0;
}
var _local3 = false;
if (collided_brick) {
if (vx < 0) {
if (collided_brick.getx() > (x - 20)) {
_local3 = true;
}
} else if ((collided_brick.getx() + collided_brick.getw()) < (x + 20)) {
_local3 = true;
}
}
if ((action_reload <= 0) || (_local3)) {
action_reload = random(20) + 40;
if (_local3) {
if (random(100) < 50) {
vy = -1;
} else {
vx = (vy = 0);
}
} else if (random(100) < 10) {
vy = -1;
if (random(100) < 50) {
vx = 0;
}
}
}
Move((vx * 0.325) * move_speed, vy * 0.75);
vy = 0;
}
function Random() {
rnd_bhv();
behavior_reload--;
if (behavior_reload <= 0) {
var _local3 = x - _root.knight.getx();
if (_local3 < 400) {
if (rnd_bhv == Agressive) {
rnd_bhv = Cowardly;
} else {
rnd_bhv = Agressive;
}
} else {
rnd_bhv = Agressive;
}
dist = 150;
if (rnd_bhv == Cowardly) {
dist = 300;
}
behavior_reload = random(120);
}
}
function HoldPlatform() {
var _local3 = x - _root.knight.getx();
if (action_reload <= 0) {
var _local5 = vx;
if (_local3 < 0) {
if (_local3 < (-dist)) {
vx = 1;
} else if (_local3 > ((-dist) + 40)) {
vx = -1;
}
} else if (_local3 > dist) {
vx = -1;
} else if (_local3 < (dist - 40)) {
vx = 1;
}
if ((vx * _local5) < 0) {
action_reload = 0;
}
}
var _local4 = 0;
if (collided_brick) {
if (vx < 0) {
if (collided_brick.getx() > (x - 40)) {
_local4 = 1;
}
} else if ((collided_brick.getx() + collided_brick.getw()) < (x + 40)) {
_local4 = -1;
}
}
if ((_local4 * vx) < 0) {
vx = 0;
}
shot();
if ((y - _root.knight.gety()) < -60) {
if ((_local3 * _local4) < 0) {
reloading = 10;
}
if (_local4 || (action == 100)) {
if (!vx) {
vy = 1;
}
if (action_reload < 8) {
vy = 0;
}
if (action_reload < 0) {
vy = 0;
if (random(100) < 80) {
vx = 0;
vy = 1;
action_reload = 60;
} else {
vx = _local4;
action_reload = 40;
}
}
} else {
reloading = 10;
}
} else {
vy = 0;
if (action_reload < 0) {
if (random(100) < 10) {
vy = -1;
}
action_reload = random(10) + 10;
}
}
Move((vx * 0.325) * move_speed, vy * 0.75);
if (vy < 0) {
vy = 0;
}
}
function JetMove(vy, dy) {
body = sprite.bod;
if (vy < 0) {
body.gotoAndStop(_skin + 1);
if ((y - oldy) > -8) {
oldy = oldy + 1;
}
action = 8;
if (((pain < 1000) && (pain > 999)) || (pain < 0)) {
sprite.gotoAndPlay("jetpack_fly");
pain = 1022;
}
} else if (dy < -100) {
body.gotoAndStop(_skin);
}
}
function JetDie(dx, dy) {
_root.jet_death = true;
_skin++;
super.Die(dx * 0.5, dy * 0.2);
}
function JetPack() {
shot();
vx = 0;
vy = 0;
if (action_reload >= 0) {
destx = random(200) - 100;
if (random(100) < 50) {
destx = destx + 250;
} else {
destx = destx - 250;
}
desty = -100 - random(300);
action_reload = random(60) + 100;
}
var _local4 = x - (_root.knight.getx() + destx);
var _local3 = y - (_root.knight.gety() + desty);
if (Math.abs(_local4) > 30) {
if (_local4 > 0) {
vx = -1;
} else {
vx = 1;
}
}
if (_local3 > -30) {
vy = -1;
}
if (vy <= 0) {
JetMove(vy, _local3);
}
vy = 0;
Move(vx * 0.325, vy * 0.75);
}
function Target(_speed) {
var _local3 = _root.direct_knight(x, y - 15);
if ((_local3 - dir) > 180) {
_local3 = _local3 - 360;
} else if ((_local3 - dir) < -180) {
_local3 = _local3 + 360;
}
dir = _root.interpolate(dir, _local3, _speed);
if (_root.knight.getx() < x) {
if (view_side > 0) {
dir = 180 - dir;
}
view_side = -1;
sprite._xscale = -100;
} else {
if (view_side < 0) {
dir = 180 - dir;
}
view_side = 1;
sprite._xscale = 100;
}
if (view_side < 0) {
hand1._rotation = 180 - dir;
hand2._rotation = 180 - dir;
} else {
hand1._rotation = dir;
hand2._rotation = dir;
}
hand2.gotoAndStop(hand1._currentframe);
return(_local3);
}
function SetSide(s) {
if ((s * view_side) > 0) {
return(undefined);
}
view_side = s;
if (view_side < 0) {
sprite._xscale = -100;
} else {
sprite._xscale = 100;
}
dir = 180 - dir;
}
function ShotPistol() {
if (!InGame()) {
return(undefined);
}
Target(0.05);
if (reloading > 0) {
return(undefined);
}
BarrelPos();
_root.objects.push(new EnemyBullet("pistol_bullet", _root.p.x, _root.p.y, dir, 16, 10, 6, 5));
reloading = 30 + random(30);
hand1.play();
_root.sound_mc_point("snd_pistol", sprite, x, 100);
}
function ShotSmg() {
if (!InGame()) {
return(undefined);
}
if (reloading > 16) {
Target(0.05);
}
if ((!hand1.ready) || (reloading > 15)) {
return(undefined);
}
BarrelPos();
if ((reloading % 5) == 0) {
_root.objects.push(new EnemyBullet("pistol_bullet", _root.p.x, _root.p.y, dir, 16, 10, 6, 5));
hand1.play();
_root.sound_mc_point("snd_smg", sprite, x, 100);
}
if (reloading < 0) {
reloading = 50 + random(30);
}
}
function ShotRiffle() {
if (!InGame()) {
return(undefined);
}
Target(0.035);
if (reloading > 0) {
return(undefined);
}
BarrelPos();
var _local3 = dir * _root.degtorad;
var _local5 = Math.cos(_local3);
var _local4 = Math.sin(_local3);
_root.objects.push(new EnemyBeam(_root.p.x, _root.p.y, "beam_red", _local5 * 20, _local4 * 20, 20, 8));
reloading = 80 + random(30);
hand1.play();
_root.sound_mc_point("snd_lazer", sprite, x, 100);
}
function ShotGrenade() {
dist = 350;
if (!InGame()) {
return(undefined);
}
var _local6 = 20;
var _local4 = _root.knight.getx() - x;
var _local5 = _root.knight.gety() - y;
var _local3 = 0;
_local3 = _root.direct_knight(x, y - 15);
if ((_local3 - dir) > 180) {
_local3 = _local3 - 360;
} else if ((_local3 - dir) < -180) {
_local3 = _local3 + 360;
}
if (_local4 > 200) {
if (_local5 < -50) {
_local3 = _local3 + ((_local5 * 0.4) / ((600 - _local4) / 100));
} else {
_local3 = _local3 - (_local4 * 0.05);
}
}
if (_local4 < -200) {
if (_local5 < -50) {
_local3 = _local3 - ((_local5 * 0.4) / ((600 + _local4) / 100));
} else {
_local3 = _local3 - (_local4 * 0.05);
}
}
if ((_local3 - dir) > 180) {
_local3 = _local3 - 360;
} else if ((_local3 - dir) < -180) {
_local3 = _local3 + 360;
}
dir = _root.interpolate(dir, _local3, 0.2);
if (_root.knight.getx() < x) {
if (view_side > 0) {
dir = 180 - dir;
}
view_side = -1;
sprite._xscale = -100;
} else {
if (view_side < 0) {
dir = 180 - dir;
}
view_side = 1;
sprite._xscale = 100;
}
if (view_side < 0) {
hand1._rotation = 180 - dir;
hand2._rotation = 180 - dir;
} else {
hand1._rotation = dir;
hand2._rotation = dir;
}
hand2.gotoAndStop(hand1._currentframe);
if (reloading > 0) {
return(undefined);
}
if (Math.abs(_local3 - dir) > 20) {
return(undefined);
}
BarrelPos();
_root.p_bullets.push(new Grenade("grenade", _root.p.x, _root.p.y, dir, _local6, 40, 8, 50, true));
reloading = 110 + random(30);
hand1.play();
_root.sound_mc_point("snd_grenade_lounch", sprite, x, 100);
}
function Update() {
y = y + _root.gravity_y;
UpdatePhysics();
landed = collided == 3;
var _local3 = _root.CollideBullets(aabb);
if (_local3 > 0) {
_root.p.x = _root.p.x / mass;
_root.p.y = _root.p.y / mass;
Damage(_root.p.x, _root.p.y, 12, _local3);
}
if (life <= 0) {
Die(((_root.p.x * 4) + random(10)) - 5, ((_root.p.y * 5) + random(10)) - 5);
_root.add_kill_bonus(hp * 2);
return(undefined);
}
behavior();
action_reload--;
pain--;
reloading--;
}
}
Symbol 3209 MovieClip [__Packages.EnemyBullet] Frame 0
class EnemyBullet extends Obj
{
var x, y, id, sprite, aabb, life, vx, vy, damage, force;
function EnemyBullet (sprite_name, __x, __y, dir, speed, _damage, r, _force) {
super();
x = __x;
y = __y;
id = _root.get_id();
sprite = _root.objects_layer.attachMovie(sprite_name, "eb" + id, id + (_root.depth_band * 12));
sprite._x = x;
sprite._y = y;
sprite._rotation = dir;
aabb = new Object();
aabb.dx = -r;
aabb.dy = -r;
aabb.w = r + r;
aabb.h = r + r;
aabb.x = __x;
aabb.y = __y;
life = 100;
dir = dir * _root.degtorad;
vx = speed * Math.cos(dir);
vy = speed * Math.sin(dir);
damage = _damage;
force = _force / speed;
}
function Update() {
if (life < 0) {
return(undefined);
}
x = x + vx;
y = y + vy;
aabb.x = x + aabb.dx;
aabb.y = y + aabb.dy;
if (_root.collide(aabb)) {
x = x + _root.p.x;
y = y + _root.p.y;
Hit();
return(undefined);
}
if (_root.CollideKnight(aabb)) {
Hit();
_root.DamageKnight(damage, vx * force, vy * force);
return(undefined);
}
sprite._x = x;
sprite._y = y;
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
delete aabb;
}
function Alive() {
if (((sprite._currentframe == 9) || (!InGame())) || (life <= -10000)) {
return(false);
}
return(true);
}
function InGame() {
if ((x + 30) < _root.left_border) {
return(false);
}
if ((x - 30) > _root.right_border) {
return(false);
}
if ((y + 30) < _root.top_border) {
return(false);
}
if ((y - 30) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
Kill();
}
function UnFreeze() {
Kill();
}
function Collide(_aabb) {
if (_root.collide_aabb(_aabb, aabb)) {
return(true);
}
return(false);
}
function Hit() {
if (life < 0) {
return(undefined);
}
life = -1;
sprite._rotation = (Math.atan2(_root.p.y, _root.p.x) * _root.radtodeg) + 180;
sprite.gotoAndPlay("die");
_root.p.x = vx * 1000;
_root.p.y = vy * 1000;
sprite._x = x;
sprite._y = y;
}
}
Symbol 3210 MovieClip [__Packages.EnemyBeam] Frame 0
class EnemyBeam extends Beam
{
var life, sprite, Collide, Hit, damage, vx, vy;
function EnemyBeam (__x, __y, _vx, _vy, _damage, r) {
super(__x, __y, _vx, _vy, _damage, r);
}
function Update() {
if (life < 0) {
return(undefined);
}
life = life - 1;
if (life < 5) {
sprite._yscale = sprite._yscale - 20;
}
if (Collide(_root.knight.aabb)) {
Hit();
_root.DamageKnight(damage, vx * 0.8, vy * 0.4);
}
}
}
Symbol 3211 MovieClip [__Packages.Door] Frame 0
class Door extends Obj
{
var sprite, auto, aabb, x, y, key, frames, frame, opened, old_key_state;
function Door (_sprite, _trigger, _key, _frames, _opened, _auto) {
super();
sprite = _sprite;
auto = _auto;
aabb = new Object();
if (_trigger != undefined) {
aabb.w = _trigger._width;
aabb.h = _trigger._height;
aabb.x = _trigger._x + sprite._x;
aabb.y = _trigger._y + sprite._y;
_trigger._visible = false;
} else {
aabb.w = sprite._width;
aabb.h = sprite._height;
aabb.x = sprite._x;
aabb.y = sprite._y;
_trigger = _sprite;
}
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
key = _key;
frames = _frames;
if (_opened) {
frame = frames;
opened = true;
} else {
frame = 2;
opened = false;
}
old_key_state = false;
_root.keys[key] = false;
}
function Fixed() {
var _local3 = 0;
var _local4 = _root.keys[key];
if (((frame != 2) && (frame != frames)) || (old_key_state != _local4)) {
if (_local4) {
_local3 = 1;
} else {
_local3 = -1;
}
}
if (_local3 != 0) {
frame = frame + _local3;
frame = _root.limit(frame, 2, frames);
sprite.gotoAndStop(frame);
}
if ((frame == 2) || (frame == frames)) {
old_key_state = _local4;
}
}
function Auto() {
var _local3;
if (_root.CollideKnight(aabb)) {
_local3 = 1;
} else {
_local3 = -1;
}
}
function Update() {
Fixed();
}
function Freeze() {
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
}
Symbol 3212 MovieClip [__Packages.StunnedPlayer] Frame 0
class StunnedPlayer extends Obj
{
var id, sprite, x, y, ragdoll, stun_time, alive, scarf, on_activate;
function StunnedPlayer (__x, __y, frame, vx, vy, _stun_time) {
super();
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("stunned_player", "m" + id, id + (_root.depth_band * 6));
sprite._x = __x;
sprite._y = __y;
sprite.gotoAndStop(frame);
x = __x;
y = __y;
ragdoll = new Ragdoll(__x, __y, sprite, sprite.head, sprite.bod, sprite.a11, sprite.a12, sprite.a21, sprite.a22, sprite.but, sprite.l11, sprite.l12, sprite.l21, sprite.l22, vx, vy);
var _local4 = 11;
while (_local4 < ragdoll.objects.length) {
ragdoll.objects[_local4].sprite.gotoAndStop(1);
_local4++;
}
stun_time = _stun_time;
alive = true;
scarf = new Cable(__x, __y, "scarf", 7, 0.1, 5);
}
function Update() {
ragdoll.time = 0;
var _local3 = ragdoll.Update();
var _local4 = (-sprite.bod._x) + (_root.w * 0.5);
var _local5 = (-sprite.bod._y) + (_root.h * 0.5);
x = sprite.bod._x;
y = sprite.bod._y;
_root.SmoothView(_local4, _local5);
if (_local3 && (stun_time > 60)) {
stun_time = 60;
}
if (stun_time <= 0) {
if (stun_time < -30) {
_root.knight = new Hero(x, y + 30, "human");
ragdoll.Kill();
scarf.Kill();
delete ragdoll;
delete scarf;
alive = false;
if (on_activate) {
on_activate();
}
return(undefined);
}
ragdoll.objects[0].y = ragdoll.objects[0].y - 1;
ragdoll.objects[1].y = ragdoll.objects[1].y - 3;
ragdoll.objects[7].y = ragdoll.objects[7].y + 4;
ragdoll.objects[9].y = ragdoll.objects[9].y + 4;
}
scarf.SetPos(ragdoll.sprite.head._x, ragdoll.sprite.head._y);
scarf.Update();
stun_time--;
}
function Alive() {
return(alive);
}
var life = 100;
}
Symbol 3213 MovieClip [__Packages.BeamEmitter_test] Frame 0
class BeamEmitter_test extends Obj
{
var id, sprite, aabb, x, y, started, key;
function BeamEmitter_test (__x, __y, _key, _dx, _dy, yscale) {
super();
if (_dx == undefined) {
_dx = 0;
}
if (_dy == undefined) {
_dy = 0;
}
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("beam_emitter", "bee" + id, id + (_root.depth_band * 3));
sprite._x = __x;
sprite._y = __y;
if (yscale) {
sprite._yscale = yscale;
}
aabb = new Object();
aabb.w = 20;
aabb.h = 1024;
aabb.x = __x;
aabb.y = __y;
aabb.dx = _dx - 10;
aabb.dy = _dy - 512;
x = __x;
y = __y - 50;
started = false;
key = _key;
}
function Update() {
if (started) {
if (_root.CollideKnight(aabb)) {
if (_root.knight.getx() < x) {
_root.knight.oldx = _root.knight.oldx + 20;
} else {
_root.knight.oldx = _root.knight.oldx - 20;
}
}
if (_root.keys[key] != true) {
sprite.gotoAndStop("stop");
started = false;
}
} else if (_root.keys[key] == true) {
Start();
}
}
function Kill() {
removeMovieClip(sprite);
}
function Freeze() {
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
function Alive() {
return(true);
}
function Start() {
sprite.gotoAndPlay("start");
started = true;
}
function _Stop() {
sprite.gotoAndStop("stop");
started = false;
}
}
Symbol 3214 MovieClip [__Packages.Snowball] Frame 0
class Snowball extends Crate
{
var aabb, dm, mass, frame, sprite, falltime, y, x, UpdatePhysics, oldx, life, contain;
function Snowball (__x, __y, _life, _contain, depth) {
super(__x, __y, "snowball", undefined, 60, _contain, depth);
aabb.w = 45;
aabb.h = 38;
aabb.dx = -22;
aabb.dy = -19;
dm = 0.1;
mass = 4000;
frame = 1;
sprite.stop();
falltime = 0;
}
function Update() {
y = y + _root.gravity_y;
if (_root.ragdolls_free) {
x = x + (_root.ragdolls_free * 0.25);
}
UpdatePhysics();
frame = frame - ((x - oldx) * 0.1);
if (frame < 1) {
frame = 16;
} else if (frame > 17) {
frame = 1;
}
sprite.gotoAndStop(int(frame));
var _local5 = _root.CollideBullets(aabb);
if (_local5 > 0) {
Resize(0.95, 0.95);
x = x + (_root.p.x / mass);
y = y + (_root.p.y / mass);
life = life - _local5;
var _local4 = 0;
while (_local4 < 2) {
var _local3 = new SpinningGib("snowball", (x + random(sprite._width)) - (sprite._width * 0.5), (y + random(sprite._height)) - (sprite._height * 0.5), (-random(120)) - 30, random(10) + 5, 10);
_local3.sprite._xscale = (_local3.sprite._yscale = 10);
_root.objects.push(_local3);
_local4++;
}
}
if (life <= 0) {
if (contain) {
_root.bonus(contain, x, y);
}
_root.add_score(50);
life = -100000;
var _local4 = 0;
while (_local4 < 4) {
var _local3 = new SpinningGib("snowball", (x + random(sprite._width)) - (sprite._width * 0.5), (y + random(sprite._height)) - (sprite._height * 0.5), (-random(120)) - 30, random(10) + 5, 10);
_local3.sprite._xscale = (_local3.sprite._yscale = 10);
_root.objects.push(_local3);
_local4++;
}
return(undefined);
}
if (_root.CollideKnight(aabb)) {
x = x + (_root.p.x * dm);
y = y + (_root.p.y * dm);
if (_root.knight.getvy() > 5) {
Resize(1.01, 0.95);
}
_root.p.x = _root.limit(_root.p.x, -5, 5);
_root.knight.addvx((-_root.p.x) * (1 - dm));
_root.knight.addvy((-_root.p.y) * (1 - dm));
if (_root.p.y > 0) {
_root.knight.landed_on_crate = true;
}
}
falltime++;
}
function Resize(mw, mh) {
aabb.h = aabb.h * mw;
if (aabb.h < 20) {
aabb.h = 20;
mw = 1;
}
aabb.w = aabb.w * mw;
aabb.dx = (-aabb.w) * 0.5;
aabb.dy = (-aabb.h) * 0.5;
sprite._xscale = sprite._xscale * mw;
sprite._yscale = sprite._yscale * mh;
}
function Freeze() {
if (_root.ragdolls_free && (falltime < 200)) {
return(true);
}
sprite._visible = false;
if (life < 0) {
life = -1000;
return(undefined);
}
}
}
Symbol 3215 MovieClip [__Packages.Mine] Frame 0
class Mine extends JointCollide
{
var x, y, oldx, oldy, mass, id, sprite, color, aabb, collided, life, pain, action, action_reload, UpdatePhysics;
function Mine (__x, __y) {
super();
x = __x;
y = __y;
oldx = x;
oldy = y;
mass = 3000;
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("mine", "m" + id, id + (_root.depth_band * 4));
sprite._x = x;
sprite._y = y;
sprite.gotoAndStop("stand");
sprite._visible = false;
color = new Color(sprite);
aabb = new Object();
aabb.dx = -20;
aabb.dy = -15;
aabb.w = 44;
aabb.h = 40;
aabb.x = __x;
aabb.y = __y;
collided = 0;
life = 40;
pain = 0;
action = 0;
action_reload = 0;
}
function Update() {
if (sprite._currentframe > 28) {
return(undefined);
}
y = y + _root.gravity_y;
UpdatePhysics();
if (life <= 0) {
return(undefined);
}
var _local6 = 0;
var _local5 = 0;
switch (collided) {
case 1 :
y = y - 2;
oldy = y;
sprite._yscale = -100;
sprite._rotation = _root.interpolate(sprite._rotation, 0, 0.25);
_local6 = 1;
break;
case 2 :
x = x + 2;
oldx = x;
sprite._rotation = _root.interpolate(sprite._rotation, -90, 0.25);
_local5 = 1;
y = y - _root.gravity_y;
break;
case 4 :
x = x - 2;
oldx = x;
sprite._rotation = _root.interpolate(sprite._rotation, 90, 0.25);
_local5 = 1;
y = y - _root.gravity_y;
break;
case 3 :
y = y - 2;
oldy = y;
sprite._yscale = 100;
sprite._rotation = _root.interpolate(sprite._rotation, 0, 0.25);
_local6 = 1;
break;
case 0 :
_local6 = 0.2;
_local5 = 0;
sprite._rotation = _root.interpolate(sprite._rotation, 0, 0.25);
}
var _local7 = _root.CollideBullets(aabb);
if (_local7 > 0) {
x = x + (_root.p.x / mass);
y = y + (_root.p.y / mass);
pain = 12;
life = life - _local7;
}
if (life <= 0) {
Explode();
return(undefined);
}
if (_root.CollideKnight(aabb)) {
Explode();
return(undefined);
}
if (pain <= 0) {
var _local4 = 0;
if ((x + 10) < _root.knight.getx()) {
_local4 = 1;
}
if ((x + 10) > _root.knight.getx()) {
_local4 = -1;
}
var _local3 = 0;
if ((y + 10) < _root.knight.gety()) {
_local3 = 1;
}
if ((y + 10) > _root.knight.gety()) {
_local3 = -1;
}
if ((collided == 2) && (_local4 > 0)) {
_local3 = -1;
}
if ((collided == 4) && (_local4 < 0)) {
_local3 = -1;
}
_local3 = _local3 * _local5;
_local4 = _local4 * _local6;
if (Math.abs(x - oldx) < 8) {
x = x + _local4;
}
if (Math.abs(y - oldy) < 5) {
y = y + _local3;
}
if ((sprite._yscale == -100) && (Math.abs(x - _root.knight.getx()) < 30)) {
y = y + 5;
oldy = y;
}
if (action_reload < 0) {
if ((_local4 != 0) || (_local3 != 0)) {
if (action != 2) {
sprite.gotoAndPlay("run");
}
action = 2;
} else {
if (action != 1) {
sprite.gotoAndPlay("stand");
}
action = 1;
}
action_reload = 12;
}
if (x < _root.knight.getx()) {
sprite._xscale = 100;
} else {
sprite._xscale = -100;
}
} else if (pain >= 10) {
color.setTransform(_root.light_orange);
} else {
color.setTransform(_root.white);
}
pain--;
action_reload--;
}
function Kill() {
life = -10000;
removeMovieClip(_root.objects_layer["m" + id]);
delete aabb;
delete color;
}
function Explode() {
life = -1;
sprite.gotoAndPlay("die");
color.setTransform(_root.white);
_root.add_kill_bonus(50);
return(undefined);
}
function Alive() {
if (sprite._currentframe == 41) {
return(false);
}
return(life > -10000);
}
function InGame() {
if ((x + 100) < _root.left_border) {
return(false);
}
if ((x - 100) > _root.right_border) {
return(false);
}
if ((y + 100) < _root.top_border) {
return(false);
}
if ((y - 100) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
if (life > 0) {
sprite.stop();
}
sprite._visible = false;
}
function UnFreeze() {
if (life > 0) {
sprite.play();
}
sprite._visible = true;
}
function Pause() {
if (sprite._currentframe != 41) {
sprite.stop();
}
}
function UnPause() {
if (sprite._currentframe != 41) {
sprite.play();
}
}
}
Symbol 3216 MovieClip [__Packages.Switch] Frame 0
class Switch extends Obj
{
var sprite, aabb, x, y, key, collided, state;
function Switch (_sprite, _trigger, _key, _dx, _dy) {
super();
sprite = _sprite;
if (_dx == undefined) {
_dx = 0;
}
if (_dy == undefined) {
_dy = 0;
}
aabb = new Object();
aabb.w = _trigger._width;
aabb.h = _trigger._height;
aabb.x = _trigger._x + sprite._x;
aabb.y = _trigger._y + sprite._y;
aabb.dx = _trigger._x + _dx;
aabb.dy = _trigger._y + _dy;
_trigger._visible = false;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
key = _key;
collided = false;
state = false;
}
function Update() {
aabb.x = aabb.dx + sprite._x;
aabb.y = aabb.dy + sprite._y;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
if (_root.CollideKnight(aabb)) {
if (!collided) {
state = !state;
_root.keys[key] = state;
if (state == true) {
sprite.gotoAndPlay("on");
} else {
sprite.gotoAndPlay("off");
}
_root.sound("snd_button");
collided = true;
sprite.marker.gotoAndPlay("hide");
}
} else if (collided) {
sprite.marker.gotoAndPlay("show");
collided = false;
}
}
function Freeze() {
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
}
Symbol 3217 MovieClip [__Packages.Spawner] Frame 0
class Spawner extends Obj
{
var x, y, events, spawned_objs, delay, wait;
function Spawner (__x, __y) {
super();
x = __x;
y = __y;
events = new Array();
spawned_objs = new Array();
delay = -1;
wait = true;
}
function AddEvent(_func) {
var _local2 = events.length;
events.push(new Object());
events[_local2].func = _func;
}
function SpawnObj(obj) {
if (wait) {
spawned_objs.push(obj);
}
_root.PushObject(obj);
}
function Delay(_delay) {
delay = _delay;
}
function WaitUntilDie(w) {
wait = w;
}
function Update() {
UpdateEvents();
}
function UpdateEvents() {
delay--;
if (delay > 0) {
return(undefined);
}
var _local2 = 0;
while (_local2 < spawned_objs.length) {
if (spawned_objs[_local2].life <= 0) {
spawned_objs.splice(_local2, 1);
_local2--;
}
_local2++;
}
if ((((spawned_objs.length == 0) && (wait)) || (delay == 0)) || ((!wait) && (delay <= 0))) {
events[0].func(this);
events.splice(0, 1);
}
}
function Alive() {
return(events.length > 0);
}
function Kill() {
delete events;
delete spawned_objs;
}
}
Symbol 3218 MovieClip [__Packages.TriggerFunction] Frame 0
class TriggerFunction extends Obj
{
var sprite, aabb, x, y, func, started;
function TriggerFunction (_sprite, _func, _dx, _dy) {
super();
sprite = _sprite;
if (_dx == undefined) {
_dx = 0;
}
if (_dy == undefined) {
_dy = 0;
}
aabb = new Object();
aabb.w = sprite._width;
aabb.h = sprite._height;
aabb.x = sprite._x;
aabb.y = sprite._y;
aabb.dx = _dx;
aabb.dy = _dy;
x = (aabb.x + (aabb.w * 0.5)) + _dx;
y = (aabb.y + (aabb.h * 0.5)) + _dy;
func = _func;
started = false;
}
function Update() {
aabb.x = aabb.dx + sprite._x;
aabb.y = aabb.dy + sprite._y;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
if (!started) {
if (_root.knight.life > 0) {
if (_root.CollideKnight(aabb)) {
started = true;
func();
}
}
}
}
function Freeze() {
}
function UnFreeze() {
}
function Alive() {
return(!started);
}
}
Symbol 3219 MovieClip [__Packages.CargoShip] Frame 0
class CargoShip extends Spawner
{
var x, y, oldx, oldy, mass, id, sprite, color1, color2, aabb1, aabb2, life, life1, pain1, life2, pain2, action, action_reload, body_dir, jet1_dir, jet2_dir, jetsound, behavior, destx, desty, wind_coeff, friction, spawned_objs, UpdateEvents, on_die, events, delay, WaitUntilDie;
function CargoShip (__x, __y, sprite_name) {
super(__x, __y);
x = __x;
y = __y;
oldx = x;
oldy = y;
mass = 300000 /* 0x0493E0 */;
if (!sprite_name) {
sprite_name = "cargo_ship";
}
id = _root.get_id();
sprite = _root.objects_layer.attachMovie(sprite_name, "c" + id, id + (_root.depth_band * 4));
sprite._x = x;
sprite._y = y;
sprite.gotoAndStop("idle");
sprite._visible = false;
color1 = new Color(sprite.jet1);
color2 = new Color(sprite.jet2);
aabb1 = new Object();
aabb1.dx = -40;
aabb1.dy = -40;
aabb1.w = 80;
aabb1.h = 90;
aabb1.x = sprite.jet1._x + x;
aabb1.y = sprite.jet1._y + y;
aabb2 = new Object();
aabb2.dx = -40;
aabb2.dy = -40;
aabb2.w = 80;
aabb2.h = 90;
aabb2.x = sprite.jet2._x + x;
aabb2.y = sprite.jet2._y + y;
life = 100;
life1 = 300;
pain1 = 0;
life2 = 300;
pain2 = 0;
action = 0;
action_reload = 0;
body_dir = (jet1_dir = (jet2_dir = 0));
jetsound = new Sound(sprite);
jetsound.attachSound("snd_jet");
behavior = stand;
destx = x;
desty = y;
wind_coeff = 1;
}
function collisions() {
var _local3 = 0;
if (life1 > 0) {
_local3 = _root.CollideBullets(aabb1);
if (_local3 > 0) {
pain1 = 4;
life1 = life1 - _local3;
if (life1 <= 0) {
color1.setTransform(_root.white);
sprite.jet1.gotoAndPlay("die");
Gibs(x - 75, y);
oldx = oldx - (_root.p.x / 1000);
oldy = oldy - Math.abs(_root.p.y / 2000);
_root.add_kill_bonus(1000);
} else {
color1.setTransform(_root.light_orange);
}
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
} else if (pain1 == 0) {
color1.setTransform(_root.white);
}
}
if (life2 > 0) {
_local3 = _root.CollideBullets(aabb2);
if (_local3 > 0) {
pain2 = 4;
life2 = life2 - _local3;
if (life2 <= 0) {
color2.setTransform(_root.white);
sprite.jet2.gotoAndPlay("die");
Gibs(x + 100, y);
oldx = oldx - (_root.p.x / 1000);
oldy = oldy - Math.abs(_root.p.y / 2000);
_root.add_kill_bonus(1000);
} else {
color2.setTransform(_root.light_orange);
}
_root.sound("snd_metal_bullet" + (random(3) + 1));
} else if (pain2 == 0) {
color2.setTransform(_root.white);
}
}
}
function motion() {
var _local5 = x - destx;
var _local4 = y - desty;
var _local3 = 0;
var _local6 = 0;
if (Math.abs(_local5) > 50) {
if (_local5 < 0) {
_local3 = 0.2;
} else {
_local3 = -0.2;
}
if ((Math.abs(_local5) > 200) && ((_local3 * (x - oldx)) < 0)) {
oldx = _root.interpolate(oldx, x, 0.2);
}
}
if (Math.abs(_local4) > 50) {
if (_local4 < 0) {
_local6 = 0;
} else {
_local6 = -0.3 - _root.gravity_y;
}
} else if (_local4 > 0) {
_local6 = (-_root.gravity_y) * 0.8;
}
if (_local4 > 100) {
y = y - 2;
oldy = oldy - 2;
}
if ((Math.abs(x - oldx) > 20) && ((_local3 * (x - oldx)) > 0)) {
_local3 = 0;
}
if (friction) {
if ((_local3 * (x - oldx)) < 0) {
oldx = x;
}
if ((_local6 * (y - oldy)) < 0) {
oldy = y;
}
if (Math.abs(_local5) < 100) {
if (_local5 < 0) {
_local3 = 0.2;
} else {
_local3 = -0.2;
}
}
if (Math.abs(_local4) < 100) {
if (_local4 > 0) {
_local6 = -0.2 - _root.gravity_y;
} else {
_local6 = (-_root.gravity_y) * 0.8;
}
}
}
x = x + (_local3 + ((_root.wind_x * 0.05) * wind_coeff));
if (Math.abs(_local5) > 200) {
x = x + (_local3 * 5);
oldx = oldx + (_local3 * 5);
}
y = y + _local6;
y = y + _root.gravity_y;
_local5 = (x - oldx) * 0.995;
_local4 = (y - oldy) * 0.985;
oldx = x;
oldy = y;
x = x + _local5;
y = y + _local4;
if (_local3 != 0) {
body_dir = _root.interpolate(body_dir, _local3 * 20, 0.1);
}
var _local8 = _local3 * 0.2;
if (_local3 > 0) {
_local8 = _local3;
}
jet1_dir = _root.interpolate(jet1_dir, _local8 * 200, 0.25);
var _local7 = _local3 * 0.2;
if (_local3 < 0) {
_local7 = _local3;
}
jet2_dir = _root.interpolate(jet2_dir, _local7 * 200, 0.25);
sprite._x = x;
sprite._y = y;
sprite._rotation = body_dir;
sprite.jet1._rotation = jet1_dir - body_dir;
sprite.jet2._rotation = jet2_dir - body_dir;
_root.p.x = sprite.jet1._x;
_root.p.y = sprite.jet1._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
aabb1.x = _root.p.x + aabb1.dx;
aabb1.y = _root.p.y + aabb1.dy;
_root.p.x = sprite.jet2._x;
_root.p.y = sprite.jet2._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
aabb2.x = _root.p.x + aabb2.dx;
aabb2.y = _root.p.y + aabb2.dy;
}
function SpawnObj(obj) {
spawned_objs.push(obj);
obj.x = (obj.oldx = x);
obj.y = (obj.oldy = y + 40);
_root.PushObject(obj);
}
function SpawnObjNoDelay(obj) {
obj.x = (obj.oldx = x);
obj.y = (obj.oldy = y + 40);
_root.PushObject(obj);
}
function follow_player() {
destx = _root.knight.getx() + 100;
desty = _root.knight.gety() - 350;
UpdateEvents();
}
function follow_player_x() {
destx = _root.knight.getx() + 100;
desty = _root.interpolate(desty, _root.knight.gety() - 250, 0.05);
UpdateEvents();
}
function stand() {
UpdateEvents();
}
function wait_until_arrive() {
var _local3 = x - destx;
var _local2 = y - desty;
if ((Math.abs(_local3) <= 30) && (Math.abs(_local2) <= 60)) {
behavior = stand;
}
}
function wait_until_find() {
destx = _root.knight.getx() + 100;
desty = _root.knight.gety() - 350;
var _local3 = x - destx;
var _local4 = y - desty;
if (Math.abs(_local3) < 50) {
behavior = stand;
}
}
function find_player() {
behavior = wait_until_find;
}
function run() {
behavior = fly_away;
sprite.gotoAndPlay("forsage");
destx = destx - 5000;
}
function fly_away() {
if ((x + 1600) < _root.left_border) {
life = -100000;
}
UpdateEvents();
}
function Update() {
if (life <= 0) {
UpdateEvents();
return(undefined);
}
collisions();
if (((life1 <= 0) && (life2 <= 0)) && (on_die)) {
events = [];
spawned_objs = [];
delay = -100;
on_die(this);
on_die = 0;
sprite.gotoAndPlay("burn");
WaitUntilDie(false);
Gibs(x, y);
_root.add_kill_bonus(1000);
}
behavior();
motion();
pain1--;
pain2--;
var _local3 = 100 - (Math.abs(x - _root.knight.getx()) * 0.05);
_local3 = _root.limit(_local3, 0, 100);
jetsound.setVolume(_local3);
var _local4 = (x - _root.knight.getx()) * 0.1;
_local4 = _root.limit(_local4, -100, 100);
jetsound.setPan(_local4);
}
function Kill() {
life = -10000;
jetsound.stop();
delete jetsound;
removeMovieClip(sprite);
delete aabb1;
delete aabb2;
delete color1;
delete color2;
}
function Explode() {
life = -1;
sprite.gotoAndPlay("die");
color1.setTransform(_root.white);
color2.setTransform(_root.white);
jetsound.stop();
return(undefined);
}
function Alive() {
return(life > -10000);
}
function InGame() {
if ((x + 400) < _root.left_border) {
return(false);
}
if ((x - 400) > _root.right_border) {
return(false);
}
if ((y + 200) < _root.top_border) {
return(false);
}
if ((y - 200) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
return(true);
}
function UnFreeze() {
jetsound.setVolume(0);
jetsound.start(0, 9999);
sprite._visible = true;
}
function DropCargo() {
_root.p.x = sprite.cargo._x;
_root.p.y = sprite.cargo._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
sprite.cargo._visible = false;
_root.objects.push(new BattleCargo(_root.p.x, _root.p.y));
}
function Gibs(__x, __y) {
var _local2 = 0;
while (_local2 < 8) {
_root.objects.push(new SpinningGib("gunship_gibs", __x, __y, random(360), 15, 10, random(4) + 1, 12));
_local2++;
}
}
function Pause() {
var _local2 = sprite._currentframe;
if ((_local2 >= 36) && (_local2 != 111)) {
sprite.stop();
}
}
function UnPause() {
var _local2 = sprite._currentframe;
if ((_local2 >= 36) && (_local2 != 111)) {
sprite.play();
}
}
}
Symbol 3220 MovieClip [__Packages.BattleCargo] Frame 0
class BattleCargo extends Spawner
{
var sprite, color, x, y, life, j1, j2, l1, slowed, jump_phase, inert, damage, spawned_objs, WaitUntilDie, AddEvent, pain, UpdateEvents, delay;
function BattleCargo (__x, __y) {
super();
var _local5 = 5;
var _local4 = _root.get_id();
sprite = _root.objects_layer.attachMovie("battle_cargo", "bc" + _local4, _local4 + (_root.depth_band * _local5));
sprite._x = __x;
sprite._y = __y;
color = new Color(sprite);
x = __x;
y = __y;
life = max_life;
j1 = new JointCBLF(x, y, 4000, 60, "no");
j2 = new JointCBLF(x + 85, y, 4000, 60, "no");
l1 = new LinkSprite(j1, j2, 0.9, sprite);
slowed = false;
jump_phase = -1;
inert = 0.2 / j1.mass;
damage = 0;
load_sequence();
}
function jump(sp) {
sp.jump_phase = 0;
}
function spawn_man1(sp) {
sp.Delay(30);
return(sp.spawn_man(2, 40, random(5) + 11, 1));
}
function spawn_man2(sp) {
sp.Delay(40);
return(sp.spawn_man(2, 60, 22, 1));
}
function spawn_man3(sp) {
sp.Delay(60);
return(sp.spawn_man(3, 90, 30, 1));
}
function spawn_man4(sp) {
sp.Delay(60);
return(sp.spawn_man(3, 100, 28, 5));
}
function spawn_man5(sp) {
sp.Delay(60);
return(sp.spawn_man(4, 60, 22, 1));
}
function spawn_man(wpn, _life, _skin, bhv) {
_root.p.x = sprite.spawn._x;
_root.p.y = sprite.spawn._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local3 = new Enemy(_root.p.x, _root.p.y, "human", wpn, _skin, _life, bhv, 6);
_local3.oldx = _local3.oldx + (7 + (Math.random() * 4));
_local3.oldy = _local3.oldy + (4 + (Math.random() * 4));
spawned_objs.push(_local3);
_root.PushObject(_local3);
return(_local3);
}
function gibs(n_gibs) {
_root.p.x = sprite.body.gibs_pos._x;
_root.p.y = sprite.body.gibs_pos._y;
_root.p = sprite.body.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local3 = 0;
while (_local3 < n_gibs) {
_root.objects.push(new SpinningGib("gunship_gibs", _root.p.x, _root.p.y, -random(180), 15, 10, random(4) + 1, 12));
_local3++;
}
}
function open_door(sp) {
sp.Delay(30);
sp.sprite.body.door.gotoAndPlay("open");
}
function close_door(sp) {
sp.Delay(70);
sp.sprite.body.door.gotoAndPlay("close");
}
function __load_sequence(sp) {
sp.load_sequence();
}
function load_sequence() {
Delay(60);
WaitUntilDie(false);
AddEvent(open_door);
AddEvent(spawn_man1);
AddEvent(spawn_man1);
AddEvent(close_door);
AddEvent(jump);
AddEvent(open_door);
AddEvent(spawn_man1);
AddEvent(spawn_man1);
AddEvent(spawn_man1);
AddEvent(spawn_man1);
AddEvent(spawn_man1);
AddEvent(close_door);
AddEvent(jump);
AddEvent(open_door);
AddEvent(spawn_man2);
AddEvent(spawn_man2);
AddEvent(spawn_man2);
AddEvent(close_door);
AddEvent(jump);
AddEvent(open_door);
AddEvent(spawn_man3);
AddEvent(spawn_man3);
AddEvent(close_door);
AddEvent(jump);
AddEvent(open_door);
AddEvent(spawn_man2);
AddEvent(spawn_man2);
AddEvent(spawn_man2);
AddEvent(spawn_man5);
AddEvent(close_door);
AddEvent(jump);
AddEvent(open_door);
AddEvent(spawn_man4);
AddEvent(spawn_man4);
AddEvent(close_door);
AddEvent(jump);
AddEvent(open_door);
AddEvent(spawn_man3);
AddEvent(spawn_man3);
AddEvent(spawn_man5);
AddEvent(close_door);
AddEvent(__load_sequence);
}
function Update() {
j1.y = j1.y + _root.gravity_y;
j2.y = j2.y + _root.gravity_y;
j1.Update();
j2.Update();
l1.Update();
l1.Render();
if (life < 0) {
return(undefined);
}
if (j1.hit_f > 8) {
_root.sound_mc_point("snd_metal_hit", sprite, j1.x, 100);
}
if (j2.hit_f > 8) {
_root.sound_mc_point("snd_metal_hit", sprite, j2.x, 100);
}
sprite.beam._rotation = -sprite._rotation;
if (j2.x < (j1.x + 20)) {
j2.x = j1.x + 20;
}
x = j1.x;
y = j1.y;
if (_root.knight.getx() > (x - 50)) {
if (_root.knight.gety() < (y - 10)) {
_root.knight.oldx = _root.knight.oldx + 20;
_root.sound_mc_point("snd_zap", sprite, x, 100);
} else {
_root.knight.x = x - 50;
}
}
if (!slowed) {
if (_root.collide_point(x, y + 120)) {
sprite.gotoAndPlay("thrust");
j1.oldy = j1.y;
j2.oldy = j2.y;
slowed = true;
_root.sound_mc_point("snd_launch", sprite.left, j1.x, 100);
sprite.beam.play();
}
}
var _local4 = _root.CollideBullets(j1.aabb);
if (_local4 > 0) {
pain = 2;
j1.x = j1.x + (_root.p.x * inert);
j1.y = j1.y + (_root.p.y * inert);
life = life - _local4;
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
color.setTransform(_root.light_orange);
} else if (pain == 0) {
color.setTransform(_root.white);
}
if (damage > 0) {
gibs();
}
sprite.beam._visible = true;
if (damage > 1) {
if (random(100) < 5) {
sprite.beam._visible = false;
}
}
if ((life < (max_life * 0.67)) && (damage < 1)) {
sprite.body.gotoAndPlay("damage1");
damage = 1;
gibs(8);
_root.add_score(300);
}
if ((life < (max_life * 0.33)) && (damage < 2)) {
sprite.body.gotoAndPlay("damage2");
damage = 2;
gibs(8);
_root.add_score(1450);
}
if ((life < 0) && (damage < 3)) {
sprite.body.gotoAndPlay("die");
damage = 3;
sprite.beam._visible = false;
sprite.gotoAndStop("idle");
j1.oldy = j1.y + 10;
j2.oldy = j2.y + 10;
gibs(12);
color.setTransform(_root.white);
_root.bonus("heal30", j2.x, j2.y);
_root.bonus("riffle5", j1.x, j1.y);
_root.add_score(7000);
return(undefined);
}
var _local3 = 0;
while (_local3 < spawned_objs.length) {
if (spawned_objs[_local3].x > (x - 100)) {
spawned_objs[_local3].vx = -1;
}
_local3++;
}
if (_root.persistent_buf.recently_droped_weapon) {
if (_root.persistent_buf.recently_droped_weapon.x > (x - 50)) {
_root.persistent_buf.recently_droped_weapon.x = x - 55;
_root.persistent_buf.recently_droped_weapon.oldx = x - 45;
}
}
if (jump_phase < 0) {
UpdateEvents();
} else {
jump_phase++;
if ((jump_phase % 20) == 1) {
sprite.gotoAndPlay("jump");
j2.oldy = j2.y + 7;
_root.sound_mc_point("snd_launch", sprite.right, j2.x, 100);
}
if (((jump_phase % 20) == 6) && (jump_phase > 20)) {
j1.oldy = j1.y + 6;
j1.oldx = j1.x + 12;
_root.sound_mc_point("snd_launch", sprite, j1.x, 100);
}
if (jump_phase > 65) {
jump_phase = -1;
}
}
pain--;
}
function Freeze() {
if (life > 0) {
return(true);
}
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
function Alive() {
return(true);
}
function Delay(_delay) {
var _local3 = Math.sqrt(Math.abs(life / max_life));
_local3 = _root.limit(_local3, 0.5, 1);
delay = int(_delay * _local3);
}
function Pause() {
switch (sprite._currentframe) {
case 2 :
break;
default :
sprite.stop();
}
}
function UnPause() {
switch (sprite._currentframe) {
case 2 :
break;
default :
sprite.play();
}
}
var max_life = 2800;
}
Symbol 3221 MovieClip [__Packages.Gold] Frame 0
class Gold extends Obj
{
var x, y, life, id, sprite, aabb;
function Gold (__x, __y, r) {
super();
if (!__x) {
return;
}
x = __x;
y = __y;
life = int((r * 100) / 16);
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("gold", "g" + id, id + (_root.depth_band * 2));
sprite._x = x;
sprite._y = y;
sprite.body.gotoAndPlay((id % 8) + 1);
sprite._visible = false;
aabb = new Object();
aabb.dx = -r;
aabb.dy = -r;
aabb.w = r + r;
aabb.h = r + r;
aabb.x = __x;
aabb.y = __y;
}
function Follow() {
if (life == -10000) {
return(undefined);
}
life = life - 1;
if (life > -10) {
return(undefined);
}
var _local4 = _root.knight.getx() - x;
var _local3 = _root.knight.gety() - y;
x = x + (_local4 * 0.5);
y = y + (_local3 * 0.5);
if ((Math.abs(_local4) < 20) && (Math.abs(_local3) < 52)) {
sprite.gotoAndPlay("die");
life = -10000;
if ((_root.snd_coin.position == 0) || (_root.snd_coin.position > 100)) {
_root.snd_coin.start(0, 1);
}
}
sprite._x = x;
sprite._y = y;
}
function Update() {
if (_root.CollideKnight(aabb)) {
_root.add_score(life);
life = -1;
Update = Follow;
}
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
delete aabb;
}
function Alive() {
if (sprite._currentframe == 10) {
return(false);
}
return(true);
}
function InGame() {
if ((x + 30) < _root.left_border) {
return(false);
}
if ((x - 30) > _root.right_border) {
return(false);
}
if ((y + 30) < _root.top_border) {
return(false);
}
if ((y - 30) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
function Pause() {
switch (sprite._currentframe) {
case 1 :
case 10 :
break;
default :
sprite.stop();
}
sprite.body.stop();
}
function UnPause() {
switch (sprite._currentframe) {
case 1 :
case 10 :
break;
default :
sprite.play();
}
sprite.body.play();
}
}
Symbol 3222 MovieClip [__Packages.Saw] Frame 0
class Saw extends JointCollide
{
var x, y, oldx, oldy, mass, aabb, collided, life, pain, action, action_reload, moving, upd_func, sprite, color, UpdatePhysics, id;
function Saw (__x, __y) {
super();
x = __x;
y = __y;
oldx = x;
oldy = y;
mass = 3000;
aabb = new Object();
aabb.dx = -20;
aabb.dy = -17;
aabb.w = 40;
aabb.h = 40;
aabb.x = __x;
aabb.y = __y;
collided = 0;
life = 80;
pain = 0;
action = 0;
action_reload = 0;
moving = 0;
upd_func = stand;
}
function collisions() {
var _local4 = _root.CollideBullets(aabb);
if (_local4 > 0) {
x = x + (_root.p.x / mass);
y = y + (_root.p.y / mass);
pain = 12;
life = life - _local4;
}
if (life <= 0) {
sprite.gotoAndPlay("die");
var _local3 = 1;
while (_local3 < 4) {
_root.objects.push(new Gib("saw_gibs", (x + aabb.dx) + random(aabb.w), (y + aabb.dy) + random(aabb.h), (-random(120)) - 30, random(10) + 5, 5, _local3, 3));
_local3++;
}
_root.add_kill_bonus(100);
_root.sound("snd_metal_bullet" + (random(3) + 1));
return(undefined);
}
if (pain > 0) {
if (pain >= 10) {
color.setTransform(_root.light_orange);
} else {
color.setTransform(_root.white);
}
}
}
function accelerate() {
collisions();
if (sprite._currentframe >= 34) {
upd_func = run;
color.setTransform(_root.white);
}
}
function decelerate() {
collisions();
if (sprite._currentframe >= 65) {
upd_func = stand;
}
}
function run() {
var _local3 = 0;
var _local5 = 0;
if (collided == 3) {
_local5 = moving;
sprite.spark_b._visible = true;
} else {
sprite.spark_b._visible = false;
}
sprite.spark_l._visible = false;
sprite.spark_r._visible = false;
if (_root.p.x < 0) {
_local3 = -moving;
if (moving > 0) {
sprite.spark_r._visible = true;
} else {
sprite.spark_l._visible = true;
}
} else if (_root.p.x > 0) {
_local3 = moving;
if (moving < 0) {
sprite.spark_r._visible = true;
} else {
sprite.spark_l._visible = true;
}
}
if (Math.abs(x - oldx) < 12) {
x = x + _local5;
}
if (Math.abs(y - oldy) < 8) {
y = y + _local3;
}
if (((x - _root.knight.getx()) * moving) > 0) {
sprite.spark_l._visible = false;
sprite.spark_r._visible = false;
sprite.gotoAndPlay("stop");
moving = 0;
upd_func = decelerate;
}
if (_root.knight.pain < 0) {
if (_root.CollideKnight(aabb)) {
_local3 = -10;
if (_root.knight.getvy() < -10) {
_local3 = 0;
}
_root.DamageKnight(10, moving, _local3);
}
}
var _local6 = _root.CollideBullets(aabb);
if (_local6 > 0) {
var _local4 = (Math.atan2(_root.p.y, _root.p.x) * _root.radtodeg) - 90;
if (sprite._xscale < 0) {
_local4 = -_local4;
}
sprite.deflect._rotation = _local4;
sprite.deflect.play();
}
}
function stand() {
if (Math.abs(y - _root.knight.gety()) < 300) {
moving = 5 + (Math.random() - 0.5);
sprite._xscale = 100;
if (x > _root.knight.getx()) {
moving = -moving;
sprite._xscale = -100;
}
sprite.gotoAndPlay("start");
upd_func = accelerate;
}
}
function Update() {
y = y + _root.gravity_y;
UpdatePhysics();
if (life <= 0) {
return(undefined);
}
upd_func();
pain--;
}
function Kill() {
life = -10000;
removeMovieClip(_root.objects_layer["s" + id]);
delete aabb;
delete color;
}
function Explode() {
life = -1;
sprite.gotoAndPlay("die");
color.setTransform(_root.white);
return(undefined);
}
function Alive() {
if (sprite._currentframe > 215) {
return(false);
}
return(life > -10000);
}
function InGame() {
if ((x + 100) < _root.left_border) {
return(false);
}
if ((x - 100) > _root.right_border) {
return(false);
}
if ((y + 100) < _root.top_border) {
return(false);
}
if ((y - 100) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
if (life > 0) {
sprite.stop();
}
sprite._visible = false;
}
function UnFreeze() {
if (!sprite) {
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("saw", "s" + id, id + (_root.depth_band * 4));
sprite._x = x;
sprite._y = y;
sprite.gotoAndPlay("stand");
sprite.spark_l._visible = false;
sprite.spark_r._visible = false;
color = new Color(sprite);
} else if (life > 0) {
sprite.play();
}
sprite._visible = true;
}
function Pause() {
switch (sprite._currentframe) {
case 45 :
case 86 :
case 217 :
break;
default :
sprite.stop();
}
}
function UnPause() {
switch (sprite._currentframe) {
case 45 :
case 86 :
case 217 :
break;
default :
sprite.play();
}
}
}
Symbol 3223 MovieClip [__Packages.TriggerPersistent] Frame 0
class TriggerPersistent extends Obj
{
var sprite, aabb, x, y, func, started, collided;
function TriggerPersistent (_sprite, _func, _dx, _dy) {
super();
sprite = _sprite;
if (_dx == undefined) {
_dx = 0;
}
if (_dy == undefined) {
_dy = 0;
}
aabb = new Object();
aabb.w = sprite._width;
aabb.h = sprite._height;
aabb.x = sprite._x;
aabb.y = sprite._y;
aabb.dx = _dx;
aabb.dy = _dy;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
func = _func;
started = false;
collided = false;
}
function Update() {
aabb.x = aabb.dx + sprite._x;
aabb.y = aabb.dy + sprite._y;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
if (!started) {
if (_root.CollideKnight(aabb) && (_root.knight.life > 0)) {
if (!collided) {
collided = true;
func();
}
} else {
collided = false;
}
}
}
function Freeze() {
}
function UnFreeze() {
}
function Alive() {
return(!started);
}
}
Symbol 3224 MovieClip [__Packages.TriggerRemove] Frame 0
class TriggerRemove extends Obj
{
var sprite, aabb, x, y, mc, started;
function TriggerRemove (_sprite, _mc, _dx, _dy) {
super();
sprite = _sprite;
if (_dx == undefined) {
_dx = 0;
}
if (_dy == undefined) {
_dy = 0;
}
aabb = new Object();
aabb.w = sprite._width;
aabb.h = sprite._height;
aabb.x = sprite._x;
aabb.y = sprite._y;
aabb.dx = _dx;
aabb.dy = _dy;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
mc = _mc;
started = false;
}
function Update() {
aabb.x = aabb.dx + sprite._x;
aabb.y = aabb.dy + sprite._y;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
if (!started) {
if (_root.CollideKnight(aabb)) {
started = true;
mc.swapDepths(_root.level.getNextHighestDepth());
removeMovieClip(mc);
}
}
}
function Freeze() {
}
function UnFreeze() {
}
function Alive() {
return(!started);
}
}
Symbol 3225 MovieClip [__Packages.CheckpointFlag] Frame 0
class CheckpointFlag extends Obj
{
var sprite, aabb, x, y, func, started, player_state;
function CheckpointFlag (_sprite, _func, _dx, _dy) {
super();
sprite = _sprite;
if (_dx == undefined) {
_dx = 0;
}
if (_dy == undefined) {
_dy = 0;
}
aabb = new Object();
aabb.w = sprite._trigger._width;
aabb.h = sprite._trigger._height;
aabb.x = sprite._x;
aabb.y = sprite._y;
aabb.dx = _dx + sprite._trigger._x;
aabb.dy = _dy + sprite._trigger._y;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
func = _func;
started = false;
player_state = new PlayerState();
sprite._visible = false;
}
function Update() {
aabb.x = aabb.dx + sprite._x;
aabb.y = aabb.dy + sprite._y;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
if (!started) {
if (_root.CollideKnight(aabb) && (_root.knight.life > 0)) {
started = true;
sprite.gotoAndPlay("activate");
player_state.Save();
func();
_root.checkpoint = this;
}
}
}
function Restore() {
var _local3 = _root.knight;
_root.knight = new Hero(x, y - 90, "human");
_local3.last_state.Restore(false, false);
_local3.Kill();
}
function Freeze() {
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
function Alive() {
return(true);
}
function Pause() {
switch (sprite._currentframe) {
case 1 :
case 2 :
case 30 :
break;
default :
sprite.stop();
}
sprite.flag.stop();
}
function UnPause() {
switch (sprite._currentframe) {
case 1 :
case 2 :
case 30 :
break;
default :
sprite.play();
}
sprite.flag.play();
}
}
Symbol 3226 MovieClip [__Packages.PlayerB] Frame 0
class PlayerB extends Man
{
var sprite, weapon_switch_pessed, Skin, life, weapon_switching, color, landed_on_crate, weapons, body, jet, respawn_time, upd, scarf, x, y, weapon, _skin, shot, hand1, BarrelPos, barx, bary, dir, aabb, id, hand2, landed, action, view_side, pain, oldx, oldy, mass, Damage, Die, UpdatePhysics, collided, Move;
function PlayerB (__x, __y, sprite_name, weapon, _skin, _life) {
super(__x, __y, sprite_name, weapon, _skin, _life, 6);
sprite._visible = true;
weapon_switch_pessed = false;
Skin(_skin);
life = maxlife;
CreateScarf();
weapon_switching = false;
color = new Color(sprite);
landed_on_crate = false;
weapons = new Array();
weapons[1] = new Object();
weapons[1].picked = true;
weapons[1].ammo = 0;
weapons[2] = new Object();
weapons[2].picked = false;
weapons[2].ammo = 0;
weapons[3] = new Object();
weapons[3].picked = false;
weapons[3].ammo = 0;
weapons[4] = new Object();
weapons[3].picked = false;
weapons[4].ammo = 0;
SwitchWeapon(1);
var _local3 = 0;
for (var _local4 in sprite) {
_local3++;
if (_local3 == 6) {
body = sprite[_local4];
break;
}
}
jet = false;
respawn_time = 0;
upd = Update;
}
function CreateScarf() {
scarf = new Cable(x, y, "scarf_green", 7, 0.1, 5);
}
function SwitchWeapon(wpn) {
if (wpn == undefined) {
return(undefined);
}
if (!weapons[wpn].picked) {
return(undefined);
}
weapon = wpn;
if ((!weapon) && (wpn)) {
sprite.gotoAndPlay("stand_weapon");
Skin(_skin);
}
switch (wpn) {
case 0 :
sprite.gotoAndPlay("stand");
shot = function () {
};
Skin(_skin);
break;
case 1 :
hand1.gotoAndPlay("pistol_start");
shot = ShotPistol;
break;
case 2 :
hand1.gotoAndPlay("smg_start");
shot = ShotSmg;
break;
case 3 :
hand1.gotoAndPlay("riffle_start");
shot = ShotRiffle;
break;
case 4 :
hand1.gotoAndPlay("grenade_start");
shot = ShotGrenade;
}
weapon_switching = true;
_root.ui.weapon_indicatorb.gotoAndStop(weapon);
hand1.ready = false;
}
function PickWeapon(wpn, ammo) {
if (!weapons[wpn].ammo) {
switch (wpn) {
case 1 :
break;
case 2 :
_root.bonus_info("SMG equiped! Press '2'");
break;
case 3 :
_root.bonus_info("BLASTER equiped! Press '3'");
break;
case 4 :
_root.bonus_info("GRENADE LOUNCHER equiped! Press '4'");
}
weapons[wpn].picked = true;
SwitchWeapon(wpn);
} else {
switch (wpn) {
case 1 :
break;
case 2 :
_root.bonus_info("SMG + " + ammo);
break;
case 3 :
_root.bonus_info("BLASTER + " + ammo);
break;
case 4 :
_root.bonus_info("GRENADE LOUNCHER + " + ammo);
}
}
_root.sound("snd_click");
if (weapons[wpn].ammo == undefined) {
weapons[wpn].ammo = 0;
}
weapons[wpn].ammo = weapons[wpn].ammo + ammo;
}
function ShotPistol() {
if (!hand1.ready) {
return(undefined);
}
BarrelPos();
barx = _root.p.x;
bary = _root.p.y;
if (_root.collide_point(barx, bary)) {
return(undefined);
}
_root.objects.push(new EnemyBullet("pistol_bullet", barx, bary, dir, 20, 10, 8, 5));
hand1.play();
_root.sound("snd_pistol");
}
function ShotSmg() {
if (weapons[2].ammo <= 0) {
_root.bonus_info("No Ammo!");
SwitchWeapon(1);
return(undefined);
}
if (!hand1.ready) {
return(undefined);
}
BarrelPos();
barx = _root.p.x;
bary = _root.p.y;
if (_root.collide_point(barx, bary)) {
return(undefined);
}
_root.objects.push(new EnemyBullet("pistol_bullet", barx, bary, dir, 16, 10, 8, 1.5));
hand1.play();
_root.sound("snd_smg");
weapons[2].ammo--;
}
function ShotRiffle() {
if (weapons[3].ammo <= 0) {
_root.bonus_info("No Ammo!");
SwitchWeapon(2);
return(undefined);
}
if (!hand1.ready) {
return(undefined);
}
BarrelPos();
var _local3 = dir * _root.degtorad;
var _local5 = Math.cos(_local3);
var _local4 = Math.sin(_local3);
_root.objects.push(new EnemyBeam(_root.p.x, _root.p.y, "beam", _local5 * 20, _local4 * 20, 50, 8));
hand1.play();
_root.sound("snd_lazer");
weapons[3].ammo--;
}
function ShotGrenade() {
if (weapons[4].ammo <= 0) {
return(undefined);
}
if (!hand1.ready) {
return(undefined);
}
BarrelPos();
_root.p_bullets.push(new Grenade("grenade", _root.p.x, _root.p.y, dir, 18, 50, 8, 40));
hand1.play();
_root.sound("snd_grenade_lounch");
weapons[4].ammo--;
}
function Ragdolling() {
x = sprite.bod._x;
y = sprite.bod._y;
aabb.x = x;
aabb.y = y;
scarf.SetPos(sprite.head._x, sprite.head._y);
scarf.Update();
if (respawn_time < 0) {
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("human", "m" + id, id + (_root.depth_band * 5));
weapon_switch_pessed = false;
life = maxlife;
weapon_switching = false;
color = new Color(sprite);
landed_on_crate = false;
sprite.gotoAndPlay("spawn");
aabb.w = 32;
aabb.h = 70;
aabb.dx = -16;
aabb.dy = -32;
hand1 = sprite.hand_front.hand;
hand2 = sprite.hand_back.hand;
hand2.stop();
landed = true;
action = 0;
view_side = 1;
pain = 0;
dir = 0;
weapons[1].picked = true;
weapons[1].ammo = 0;
weapons[2].picked = false;
weapons[2].ammo = 0;
weapons[3].picked = false;
weapons[3].ammo = 0;
weapons[4].picked = false;
weapons[4].ammo = 0;
SwitchWeapon(1);
Skin(_skin);
var _local3 = 0;
for (var _local4 in sprite) {
_local3++;
if (_local3 == 6) {
body = sprite[_local4];
break;
}
}
jet = false;
var _local5 = _root.respawners[random(_root.respawners.length)];
sprite._x = (x = (oldx = (aabb.x = _local5.x)));
sprite._y = (y = (oldy = (aabb.y = _local5.y)));
Update = Respawn;
respawn_time = 14;
}
respawn_time--;
}
function Respawn() {
if (respawn_time < 0) {
Update = upd;
}
respawn_time--;
}
function JetMove(vy) {
if (vy < 0) {
body.gotoAndStop(6);
if ((y - oldy) > -8) {
oldy = oldy + 1;
}
action = 8;
if (((pain < 1000) && (pain > 999)) || (pain < 0)) {
sprite.gotoAndPlay("jetpack_fly");
pain = 1022;
}
} else {
body.gotoAndStop(5);
if (pain > 50) {
pain = -1;
if (y < oldy) {
action = 4;
}
if ((!landed) && (y > oldy)) {
sprite.gotoAndStop(112);
action = 5;
}
}
}
}
function Update() {
var _local4 = 0;
if (pain <= 0) {
_local4 = _root.GetDamage(aabb);
if (_local4 > 0) {
_root.p.x = _root.p.x / mass;
_root.p.y = _root.p.y / mass;
Damage(_root.p.x, _root.p.y, 12, _local4);
}
}
_local4 = _root.CollideBullets(aabb);
if (_local4 > 0) {
_root.p.x = _root.p.x / mass;
_root.p.y = _root.p.y / mass;
Damage(_root.p.x, _root.p.y, 12, _local4);
}
if (life <= 0) {
Update = Ragdolling;
Die(((_root.p.x * 4) + random(10)) - 5, ((_root.p.y * 5) + random(10)) - 5);
respawn_time = 100;
return(undefined);
}
y = y + _root.gravity_y;
UpdatePhysics();
if (y > _root.view_bottom._y) {
_root.DamageKnight(2);
}
var _local5 = 0;
var _local3 = 0;
if (Key.isDown(38)) {
_local3 = _local3 - 1;
}
if (Key.isDown(37)) {
_local5 = _local5 - 1;
}
if (Key.isDown(39)) {
_local5 = _local5 + 1;
}
if (Key.isDown(221)) {
dir = dir + 10;
}
if (Key.isDown(80)) {
dir = dir - 10;
}
if (weapon_switching && (hand1.ready)) {
weapon_switching = false;
_root.sound("snd_click");
} else if (weapon_switching) {
hand1.play();
}
if (((Key.isDown(49) || (Key.isDown(50))) || (Key.isDown(51))) || (Key.isDown(52))) {
if (!weapon_switch_pessed) {
SwitchWeapon(int(Key.getCode()) - 48);
weapon_switch_pessed = true;
}
} else {
weapon_switch_pessed = false;
}
landed = landed_on_crate || (collided == 3);
if (landed_on_crate) {
oldy = y;
x = _root.interpolate(x, oldx, 0.2);
landed_on_crate = false;
}
if (Key.isDown(40)) {
_local3 = 1;
}
if (jet && (_local3 <= 0)) {
JetMove(_local3);
_local3 = 0;
}
Move(_local5, _local3);
Direct(_root._xmouse, _root._ymouse);
if ((Key.isDown(219) && (!weapon_switch_pessed)) && (!weapon_switching)) {
shot();
}
pain--;
scarf.SetPos(x, y - 20);
scarf.Update();
_root.ui.lifebarb.gotoAndStop(Math.round((life * 10) / maxlife));
_root.ammob = weapons[weapon].ammo;
}
function Kill() {
}
function Alive() {
return(true);
}
function CollideBody(_aabb) {
return(_root.collide_aabb(_aabb, aabb));
}
function CollideMace(_aabb) {
return(false);
}
function Direct(target_x, target_y) {
if (Math.cos(dir * _root.degtorad) < 0) {
view_side = -1;
sprite._xscale = -100;
} else {
view_side = 1;
sprite._xscale = 100;
}
if (view_side < 0) {
hand1._rotation = 180 - dir;
hand2._rotation = 180 - dir;
} else {
hand1._rotation = dir;
hand2._rotation = dir;
}
hand2.gotoAndStop(hand1._currentframe);
}
function getx() {
return(x);
}
function gety() {
return(y);
}
function getvy() {
return(y - oldy);
}
function addvx(dx) {
x = x + dx;
}
function addvy(dy) {
y = y + dy;
}
var maxlife = 40;
}
Symbol 3227 MovieClip [__Packages.PlayerA] Frame 0
class PlayerA extends PlayerB
{
var maxlife, scarf, x, y, weapons, weapon, sprite, Skin, _skin, shot, hand1, weapon_switching, BarrelPos, barx, bary, dir, life, Ragdolling, Die, respawn_time, UpdatePhysics, weapon_switch_pessed, landed, landed_on_crate, collided, oldy, oldx, jet, JetMove, Move, Direct, pain;
function PlayerA (__x, __y, sprite_name, weapon, _skin, _life) {
super(__x, __y, sprite_name, weapon, _skin, maxlife, 6);
}
function CreateScarf() {
scarf = new Cable(x, y, "scarf", 7, 0.1, 5);
}
function SwitchWeapon(wpn) {
if (wpn == undefined) {
return(undefined);
}
if (!weapons[wpn].picked) {
return(undefined);
}
weapon = wpn;
if ((!weapon) && (wpn)) {
sprite.gotoAndPlay("stand_weapon");
Skin(_skin);
}
switch (wpn) {
case 0 :
sprite.gotoAndPlay("stand");
shot = function () {
};
Skin(_skin);
break;
case 1 :
hand1.gotoAndPlay("pistol_start");
shot = ShotPistol;
break;
case 2 :
hand1.gotoAndPlay("smg_start");
shot = ShotSmg;
break;
case 3 :
hand1.gotoAndPlay("riffle_start");
shot = ShotRiffle;
break;
case 4 :
hand1.gotoAndPlay("grenade_start");
shot = ShotGrenade;
}
weapon_switching = true;
_root.ui.weapon_indicator.gotoAndStop(weapon);
hand1.ready = false;
}
function ShotPistol() {
if (!hand1.ready) {
return(undefined);
}
BarrelPos();
barx = _root.p.x;
bary = _root.p.y;
if (_root.collide_point(barx, bary)) {
return(undefined);
}
_root.p_bullets.push(new PlayerBullet("pistol_bullet", barx, bary, dir, 20, 10, 8, 1000));
hand1.play();
_root.sound("snd_pistol");
}
function ShotSmg() {
if (weapons[2].ammo <= 0) {
_root.bonus_info("No Ammo!");
SwitchWeapon(1);
return(undefined);
}
if (!hand1.ready) {
return(undefined);
}
BarrelPos();
barx = _root.p.x;
bary = _root.p.y;
if (_root.collide_point(barx, bary)) {
return(undefined);
}
_root.p_bullets.push(new PlayerBullet("pistol_bullet", barx, bary, dir, 16, 10, 8, 1500));
hand1.play();
_root.sound("snd_smg");
weapons[2].ammo--;
}
function ShotRiffle() {
if (weapons[3].ammo <= 0) {
_root.bonus_info("No Ammo!");
SwitchWeapon(2);
return(undefined);
}
if (!hand1.ready) {
return(undefined);
}
BarrelPos();
var _local3 = dir * _root.degtorad;
var _local5 = Math.cos(_local3);
var _local4 = Math.sin(_local3);
_root.p_bullets.push(new Beam(_root.p.x, _root.p.y, "beam", _local5 * 20, _local4 * 20, 50, 8));
hand1.play();
_root.sound("snd_lazer");
weapons[3].ammo--;
}
function ShotGrenade() {
if (weapons[4].ammo <= 0) {
return(undefined);
}
if (!hand1.ready) {
return(undefined);
}
BarrelPos();
_root.p_bullets.push(new Grenade("grenade", _root.p.x, _root.p.y, dir, 18, 50, 8, 40));
hand1.play();
_root.sound("snd_grenade_lounch");
weapons[4].ammo--;
}
function Update() {
if (life <= 0) {
Update = Ragdolling;
Die((((_root.damage_vx * 1) * 4) + random(10)) - 5, (((_root.damage_vy * 1) * 5) + random(10)) - 5);
respawn_time = 100;
return(undefined);
}
y = y + _root.gravity_y;
UpdatePhysics();
if (y > _root.view_bottom._y) {
_root.DamageKnight(2);
}
var _local4 = 0;
var _local3 = 0;
if (Key.isDown(87)) {
_local3 = _local3 - 1;
}
if (Key.isDown(65)) {
_local4 = _local4 - 1;
}
if (Key.isDown(68)) {
_local4 = _local4 + 1;
}
if (Key.isDown(85)) {
dir = dir + 10;
}
if (Key.isDown(84)) {
dir = dir - 10;
}
if (weapon_switching && (hand1.ready)) {
weapon_switching = false;
_root.sound("snd_click");
} else if (weapon_switching) {
hand1.play();
}
if (((Key.isDown(49) || (Key.isDown(50))) || (Key.isDown(51))) || (Key.isDown(52))) {
if (!weapon_switch_pessed) {
SwitchWeapon(int(Key.getCode()) - 48);
weapon_switch_pessed = true;
}
} else {
weapon_switch_pessed = false;
}
landed = landed_on_crate || (collided == 3);
if (landed_on_crate) {
oldy = y;
x = _root.interpolate(x, oldx, 0.2);
landed_on_crate = false;
}
if (Key.isDown(83)) {
_local3 = 1;
}
if (jet && (_local3 <= 0)) {
JetMove(_local3);
_local3 = 0;
}
Move(_local4, _local3);
Direct(_root._xmouse, _root._ymouse);
if ((Key.isDown(89) && (!weapon_switch_pessed)) && (!weapon_switching)) {
shot();
}
pain--;
scarf.SetPos(x, y - 20);
scarf.Update();
_root.ui.lifebara.gotoAndStop(Math.round((life * 10) / maxlife));
_root.ammob = weapons[weapon].ammo;
}
}
Symbol 3228 MovieClip [__Packages.SwitchStart] Frame 0
class SwitchStart extends Obj
{
var sprite, aabb, x, y, mc, collided, state;
function SwitchStart (_sprite, _trigger, mc_name, _dx, _dy) {
super();
sprite = _sprite;
if (_dx == undefined) {
_dx = 0;
}
if (_dy == undefined) {
_dy = 0;
}
aabb = new Object();
aabb.w = _trigger._width;
aabb.h = _trigger._height;
aabb.x = _trigger._x + sprite._x;
aabb.y = _trigger._y + sprite._y;
_trigger._visible = false;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
aabb.dx = _trigger._x + _dx;
aabb.dy = _trigger._y + _dy;
mc_name = mc_name.substring(0, mc_name.length - 1);
mc = _root[mc_name];
if (!mc) {
mc = _root.level[mc_name];
}
collided = false;
state = false;
}
function Update() {
aabb.x = aabb.dx + sprite._x;
aabb.y = aabb.dy + sprite._y;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
if (_root.CollideKnight(aabb)) {
if (!collided) {
state = !state;
if (state == true) {
sprite.gotoAndPlay("on");
mc.play();
mc.is_playing = true;
} else {
sprite.gotoAndPlay("off");
mc.stop();
mc.is_playing = false;
}
_root.sound("snd_button");
collided = true;
sprite.marker.gotoAndPlay("hide");
}
} else if (collided) {
sprite.marker.gotoAndPlay("show");
collided = false;
}
}
function Freeze() {
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
}
Symbol 3229 MovieClip [__Packages.RocketBot] Frame 0
class RocketBot extends JointCollide
{
var x, y, oldx, oldy, mass, aabb, collided, life, pain, action, reloading, action_reload, UpdatePhysics, sprite, color, collided_brick, id;
function RocketBot (__x, __y) {
super();
x = __x;
y = __y;
oldx = x;
oldy = y;
mass = 8000;
aabb = new Object();
aabb.dx = -38;
aabb.dy = -22;
aabb.w = 92;
aabb.h = 80;
aabb.x = __x;
aabb.y = __y;
collided = 0;
life = 400;
pain = 0;
action = 0;
reloading = 80;
action_reload = 0;
}
function Update() {
y = y + _root.gravity_y;
UpdatePhysics();
if (life <= 0) {
return(undefined);
}
var _local6 = _root.CollideBullets(aabb);
if (_local6 > 0) {
x = x + (_root.p.x / mass);
y = y + (_root.p.y / mass);
pain = 12;
life = life - _local6;
_root.sound("snd_metal_bullet" + (random(3) + 1));
}
if (life <= 0) {
sprite.gotoAndPlay("die");
sprite.body.gotoAndPlay("pain");
color.setTransform(_root.white);
aabb.dx = -25;
aabb.w = 50;
_root.add_kill_bonus(500);
return(undefined);
}
if (pain <= 0) {
var _local3 = 0;
var _local4 = x - _root.knight.getx();
var _local5 = 240;
if (_local4 < 0) {
if (_local4 < (-_local5)) {
_local3 = 1;
} else if (_local4 > ((-_local5) + 40)) {
_local3 = -1;
}
} else if (_local4 > _local5) {
_local3 = -1;
} else if (_local4 < (_local5 - 40)) {
_local3 = 1;
}
if (collided_brick) {
if (collided_brick.getw() > 50) {
if (_local3 < 0) {
if (collided_brick.getx() > (x - 30)) {
_local3 = 0;
}
} else if ((collided_brick.getx() + collided_brick.getw()) < (x + 30)) {
_local3 = 0;
}
}
}
if (Math.abs(x - oldx) < 5) {
x = x + _local3;
}
if (action_reload < 0) {
if (_local3 != 0) {
if (action != 2) {
sprite.gotoAndPlay("run");
}
action = 2;
} else {
if (action != 1) {
sprite.gotoAndPlay("stand");
}
action = 1;
}
action_reload = 12;
}
if (x < _root.knight.getx()) {
sprite._xscale = 100;
} else {
sprite._xscale = -100;
}
} else if (pain >= 10) {
color.setTransform(_root.light_orange);
if ((action != 5) || (pain == 12)) {
sprite.body.gotoAndPlay("pain");
action = 5;
}
} else {
color.setTransform(_root.white);
}
if (reloading < 0) {
if (sprite._xscale > 0) {
_root.objects.push(new EnemyRocket("rocket", x + 60, y - 14, sprite.body._rotation, 10, 7));
} else {
_root.objects.push(new EnemyRocket("rocket", x - 60, y - 14, sprite.body._rotation - 180, 10, 7));
}
sprite.body.gotoAndPlay("recoil");
reloading = 50 + random(30);
}
reloading--;
pain--;
action_reload--;
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
delete aabb;
delete color;
}
function Alive() {
return(life > -10000);
}
function InGame() {
if ((x + 100) < _root.left_border) {
return(false);
}
if ((x - 100) > _root.right_border) {
return(false);
}
if ((y + 100) < _root.top_border) {
return(false);
}
if ((y - 100) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
sprite.stop();
sprite._visible = false;
}
function UnFreeze() {
if (!sprite) {
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("rocket_bot", "r" + id, id + (_root.depth_band * 3));
sprite._x = x;
sprite._y = y;
sprite.gotoAndStop("stand");
color = new Color(sprite);
}
reloading = 40;
if (life > 0) {
sprite.play();
}
sprite._visible = true;
}
function Pause() {
if (sprite._currentframe != 185) {
sprite.stop();
}
if (sprite.body._currentframe != 1) {
sprite.body.stop();
}
}
function UnPause() {
if (sprite._currentframe != 185) {
sprite.play();
}
if (sprite.body._currentframe != 1) {
sprite.body.play();
}
}
}
Symbol 3230 MovieClip [__Packages.EnemyRocket] Frame 0
class EnemyRocket extends Obj
{
var x, y, id, sprite, aabb, life, speed, w;
function EnemyRocket (sprite_name, __x, __y, dir, _speed, r, depth) {
super();
x = __x;
y = __y;
id = _root.get_id();
if (!depth) {
depth = 12;
}
sprite = _root.objects_layer.attachMovie(sprite_name, "r" + id, id + (_root.depth_band * depth));
sprite._x = x;
sprite._y = y;
sprite._rotation = dir;
aabb = new Object();
aabb.dx = -r;
aabb.dy = -r;
aabb.w = r + r;
aabb.h = r + r;
aabb.x = __x;
aabb.y = __y;
life = 20;
speed = _speed;
w = 0;
}
function Update() {
if (life < 0) {
return(undefined);
}
var _local3 = _root.direct_knight(x, y);
if ((_local3 - sprite._rotation) > 180) {
_local3 = _local3 - 360;
} else if ((_local3 - sprite._rotation) < -180) {
_local3 = _local3 + 360;
}
sprite._rotation = _root.interpolate(sprite._rotation, _local3, 0.05);
sprite._rotation = sprite._rotation + w;
w = w + (Math.random() - 0.5);
if (w < -3) {
w = 0;
} else if (w > 3) {
w = 0;
}
_local3 = sprite._rotation * _root.degtorad;
var _local6 = speed * Math.cos(_local3);
var _local5 = speed * Math.sin(_local3);
x = x + _local6;
y = y + _local5;
aabb.x = x + aabb.dx;
aabb.y = y + aabb.dy;
if (_root.collide(aabb)) {
x = x + _root.p.x;
y = y + _root.p.y;
Hit();
return(undefined);
}
if (_root.CollideKnight(aabb)) {
Hit();
return(undefined);
}
var _local4 = _root.CollideBullets(aabb);
if (_local4 > 0) {
x = x + (_root.p.x / 2000);
y = y + (_root.p.y / 2000);
life = life - _local4;
sprite.body.play();
}
if (life <= 0) {
life = 1;
Hit();
_root.add_kill_bonus(40);
return(undefined);
}
sprite._x = x;
sprite._y = y;
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
delete aabb;
}
function Alive() {
if ((sprite._currentframe == 32) || (life <= -10000)) {
return(false);
}
return(true);
}
function InGame() {
if ((x + 30) < _root.left_border) {
return(false);
}
if ((x - 30) > _root.right_border) {
return(false);
}
if ((y + 30) < _root.top_border) {
return(false);
}
if ((y - 30) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
return(true);
}
function UnFreeze() {
}
function Collide(_aabb) {
if (_root.collide_aabb(_aabb, aabb)) {
return(true);
}
return(false);
}
function Hit() {
if (life < 0) {
return(undefined);
}
life = -1;
sprite._rotation = (Math.atan2(_root.p.y, _root.p.x) * _root.radtodeg) + 180;
sprite.gotoAndPlay("die");
}
}
Symbol 3231 MovieClip [__Packages.JumpPad] Frame 0
class JumpPad extends Obj
{
var sprite, aabb, x, y, ang, vx, vy, reloading;
function JumpPad (_sprite, force, _dx, _dy) {
super();
sprite = _sprite;
sprite._visible = false;
if (_dx == undefined) {
_dx = 0;
}
if (_dy == undefined) {
_dy = 0;
}
aabb = new Object();
aabb.w = sprite.trigger._width;
aabb.h = sprite.trigger._height;
aabb.x = sprite.trigger._x + sprite._x;
aabb.y = sprite.trigger._y + sprite._y;
aabb.dx = ((-aabb.w) * 0.5) + _dx;
aabb.dy = ((-aabb.h) * 0.5) + _dy;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
ang = sprite._rotation;
var _local4 = (sprite._rotation - 90) * _root.degtorad;
vx = force * Math.cos(_local4);
vy = force * Math.sin(_local4);
reloading = 0;
sprite = undefined;
}
function Update() {
aabb.x = aabb.dx + sprite._x;
aabb.y = aabb.dy + sprite._y;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
if (reloading <= 0) {
if (_root.CollideKnight(aabb)) {
sprite.gotoAndPlay("jump");
reloading = 5;
_root.knight.oldx = _root.knight.getx() - vx;
_root.knight.oldy = _root.knight.gety() - vy;
}
}
reloading--;
}
function Freeze() {
sprite._visible = false;
}
function UnFreeze() {
if (!sprite) {
var _local3 = _root.get_id();
var _local4 = 5;
sprite = _root.objects_layer.attachMovie("jump_pad", "j" + _local3, _local3 + (_root.depth_band * _local4));
sprite._x = x;
sprite._y = y;
sprite.trigger._visible = false;
sprite._rotation = ang;
}
sprite._visible = true;
}
function Alive() {
return(true);
}
function Pause() {
switch (sprite._currentframe) {
case 1 :
case 2 :
break;
default :
sprite.stop();
}
}
function UnPause() {
switch (sprite._currentframe) {
case 1 :
case 2 :
break;
default :
sprite.play();
}
}
}
Symbol 3232 MovieClip [__Packages.Worm] Frame 0
class Worm extends Spawner
{
var objects, x, y, id, sprite, life, n, n_head, head, neck, tail, head_link, dir, target_speed, _time, destx, desty, headx, heady, n_shots, action_reload, damaging_aabb, aabb, drill_damage, beam_damage, head_max_life, head_life, beam_sound, drill_sound, landed, behavior, action, UpdateEvents, on_die, cable, kx, ky;
function Worm (__x, __y) {
super(__x, __y);
objects = new Array();
x = __x;
y = __y;
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("worm", "worm_boss" + id, id + (_root.depth_band * 1));
sprite._x = x;
sprite._y = y;
sprite.gotoAndStop("idle");
sprite._visible = false;
life = 100;
var _local6 = 0.95;
n = 11;
var _local4 = 0;
while (_local4 < n) {
var _local5 = sprite["node" + (_local4 + 1)];
objects.push(new JointCBLF(_local5._x, _local5._y, 200, 45, "no"));
_local4++;
}
_local4 = 0;
while (_local4 < (n - 1)) {
var _local5 = sprite["node" + (_local4 + 1)];
objects.push(new LinkSprite(objects[_local4], objects[_local4 + 1], _local6, _local5));
if (_local4 < (n - 2)) {
objects.push(new Link(objects[_local4], objects[_local4 + 2], _local6 * 0.25));
}
_local4++;
}
_local4 = 0;
while (_local4 < n) {
objects[_local4].x = objects[_local4].x + x;
objects[_local4].y = objects[_local4].y + y;
objects[_local4].oldx = objects[_local4].oldx + x;
objects[_local4].oldy = objects[_local4].oldy + y;
_local4++;
}
sprite._x = 0;
sprite._y = 0;
_local4 = n;
while (_local4 < objects.length) {
objects[_local4].Render();
_local4++;
}
x = objects[1].x;
y = objects[1].y;
n_head = 3;
head = objects[0];
neck = objects[1];
tail = objects[n - 1];
head_link = objects[n + 0];
dir = 0;
target_speed = 0.05;
_time = 0;
destx = (desty = 0);
headx = (heady = 0);
n_shots = 0;
action_reload = 0;
damaging_aabb = new Object();
damaging_aabb.w = 50;
damaging_aabb.h = 50;
damaging_aabb.dx = -25;
damaging_aabb.dy = -25;
damaging_aabb.x = x;
damaging_aabb.y = y;
aabb = new Object();
aabb.w = 80;
aabb.h = 80;
aabb.dx = -40;
aabb.dy = -40;
aabb.x = x;
aabb.y = y;
drill_damage = 10;
beam_damage = 10;
head_max_life = 800;
head_life = head_max_life;
beam_sound = new Sound(sprite);
beam_sound.attachSound("snd_beam_loop");
drill_sound = new Sound(sprite);
drill_sound.attachSound("snd_drill_loop");
}
function Target(tx, ty) {
var _local3 = tail.x - neck.x;
var _local2 = tail.y - neck.y;
_local3 = _local3 * 0.005;
if (_local2 < -10) {
_local2 = -10;
}
if (_local2 > 200) {
_local2 = 0;
} else {
_local2 = _local2 * (((-(200 - _local2)) / _local2) * 0.05);
}
if (landed) {
neck.y = neck.y + _local2;
}
Direct2(target_speed * 0.5);
}
function Direct(_sp, px, py) {
var _local3 = Math.atan2(py - head.y, px - head.x) * _root.radtodeg;
if ((_local3 - dir) > 180) {
_local3 = _local3 - 360;
} else if ((_local3 - dir) < -180) {
_local3 = _local3 + 360;
}
dir = _root.interpolate(dir, _local3, _sp);
var _local5 = Math.cos(dir * _root.degtorad) * 30;
var _local4 = Math.sin(dir * _root.degtorad) * 30;
neck.x = neck.x - _local5;
neck.y = neck.y - _local4;
head.x = head.x + (_local5 * 1.025);
head.y = head.y + (_local4 * 1.025);
}
function Direct2(_sp) {
var _local3 = _root.direct_knight(head.x, head.y);
if ((_local3 - dir) > 180) {
_local3 = _local3 - 360;
} else if ((_local3 - dir) < -180) {
_local3 = _local3 + 360;
}
if ((Math.abs(_local3 - dir) > 50) || (Math.abs(_local3 - dir) < 5)) {
dir = _root.interpolate(dir, _local3, _sp);
} else if (dir < _local3) {
dir = dir + 1;
} else {
dir = dir - 1;
}
var _local5 = Math.cos(dir * _root.degtorad) * 30;
var _local4 = Math.sin(dir * _root.degtorad) * 30;
var _local7 = (neck.x + head.x) * 0.5;
var _local6 = (neck.y + head.y) * 0.5;
neck.x = _local7 - _local5;
if (neck.collided != 3) {
neck.y = _local6 - _local4;
}
head.x = _local7 + _local5;
if (head.collided != 3) {
head.y = _local6 + _local4;
}
}
function MoveTo(px, py) {
Direct(0.1, px, py);
var _local5 = n_head;
while (_local5 < (n - 1)) {
var _local2 = objects[_local5];
var _local6 = objects[_local5 + 1];
var _local4 = _local6.x - _local2.x;
var _local3 = _local6.y - _local2.y;
var _local7 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
_local4 = _local4 * (1 / _local7);
_local3 = _local3 * (1 / _local7);
_local2.x = _local2.x - _local4;
_local2.y = _local2.y - _local3;
_local5++;
}
}
function Shot() {
Target(_root.knight.getx(), _root.knight.gety());
var _local3 = head_link.sprite._rotation;
var _local4 = sprite.beam._rotation;
if ((_local3 - _local4) > 180) {
_local3 = _local3 - 360;
} else if ((_local3 - _local4) < -180) {
_local3 = _local3 + 360;
}
sprite.beam._rotation = _root.interpolate(_local4, _local3, 0.2);
if (sprite.beam._currentframe == 25) {
beam_sound.start(0, 9999);
}
if (sprite.beam.end_shot) {
n_shots--;
beam_sound.stop();
if (n_shots <= 0) {
sprite.beam.gotoAndStop("safe");
StartDrill();
} else {
sprite.beam.gotoAndPlay(2);
}
} else {
sprite.beam.play();
if (sprite.beam.beam) {
_root.point_sound(beam_sound, head.x);
var _local9 = (180 + sprite.beam._rotation) * _root.degtorad;
var _local6 = Math.cos(_local9);
var _local5 = Math.sin(_local9);
_root.raytrace(head.x, head.y, _local6, _local5, 20);
var _local8 = _root.p.x;
var _local7 = _root.p.y;
sprite.beam.beam._xscale = (_root.ray_length * 100) / 1040;
sprite.end_glow._x = _local8;
sprite.end_glow._y = _local7 - 40;
if (sprite.beam.ready) {
if (_root.collide_beam_knight(head.x, head.y, _local8, _local7, _root.ray_length)) {
if (_root.knight.pain <= 0) {
_root.DamageKnight(beam_damage, _local6 * 10, _local5 * 10);
sprite.beam.gotoAndPlay("stop_beam");
_root.sound("snd_zap");
}
}
} else {
beam_sound.stop();
}
}
}
if (!_root.InGame(head.x, head.y, 200, 200)) {
beam_sound.stop();
sprite.beam.gotoAndStop("safe");
StartFollowPlayer();
action_reload = 100;
}
}
function StartShot(_n_shots) {
headx = (neck.x + head.x) * 0.5;
heady = (neck.y + head.y) * 0.5;
if (!InGame()) {
return(undefined);
}
behavior = Shot;
n_shots = _n_shots;
action = "shot";
}
function Drill() {
if (!sprite.beam.ready) {
Target(_root.knight.getx(), _root.knight.gety());
action_reload = drill_time;
} else {
destx = _root.knight.getx();
desty = _root.knight.gety();
MoveTo(destx, desty);
_root.p.x = -25;
_root.p.y = 0;
_root.p = sprite.beam.transform.matrix.transformPoint(_root.p);
damaging_aabb.x = _root.p.x + damaging_aabb.dx;
damaging_aabb.y = _root.p.y + damaging_aabb.dy;
if (_root.CollideKnight(damaging_aabb)) {
var _local4 = Math.cos(dir * _root.degtorad) * 10;
var _local3 = Math.sin(dir * _root.degtorad) * 10;
if (_root.knight.pain <= 0) {
_root.DamageKnight(drill_damage, _local4, _local3);
}
}
if (action_reload < 0) {
if ((Math.abs(head.x - destx) < 400) && (Math.abs(head.y - desty) < 400)) {
sprite.beam.gotoAndPlay("hide_drill");
StartShot(3);
drill_sound.stop();
}
}
}
sprite.beam._yscale = head_link.sprite._yscale;
sprite.beam._rotation = head_link.sprite._rotation;
_root.point_sound(drill_sound, head.x);
}
function StartDrill() {
sprite.end_glow._visible = false;
sprite.beam.gotoAndPlay("drill");
action = "drill";
behavior = Drill;
action_reload = drill_time;
drill_sound.start(0, 9999);
}
function StartFollowPlayer() {
sprite.end_glow._visible = false;
behavior = FollowPlayer;
}
function FollowPlayer() {
destx = _root.knight.getx();
desty = _root.knight.gety();
MoveTo(destx, desty);
if (action_reload < 0) {
if ((Math.abs(head.x - destx) < 200) && (Math.abs(head.y - desty) < 400)) {
if (action == "shot") {
StartShot(3);
} else if ((action == "drill") || (!action)) {
StartDrill();
}
}
action_reload = 20;
}
UpdateEvents();
}
function ExplodeHead() {
beam_sound.stop();
drill_sound.stop();
if (sprite.beam.ready) {
if (action == "drill") {
sprite.beam.gotoAndPlay("hide_drill");
} else if (action == "shot") {
sprite.beam.gotoAndPlay("stop_beam");
}
} else {
sprite.beam.gotoAndPlay("safe");
}
behavior = HeadExploding;
head_link.sprite.gotoAndPlay("die");
action_reload = 40;
action = "pain";
}
function HeadExploding() {
Target(neck.x, neck.y);
if (head_link.sprite._currentframe < 10) {
head_link.sprite.gotoAndPlay("die");
}
if (head_link.sprite._currentframe < 30) {
head_link.sprite.play();
}
if (action_reload <= 0) {
RemoveObj(n + 1);
RemoveObj(n);
RemoveObj(0);
n--;
n_head--;
head = objects[0];
neck = objects[1];
head_link = objects[n];
head_life = head_max_life;
StartFollowPlayer();
action = "shot";
if (n_head <= 0) {
life = -1;
var _local3 = n;
while (_local3 < objects.length) {
objects[_local3].sprite.play();
_local3 = _local3 + 2;
}
_root.sound("snd_worm_die");
}
_root.add_score(1000);
}
}
function RemoveObj(i) {
objects[i].sprite._visible = false;
delete objects[i];
objects.splice(i, 1);
}
function Update() {
landed = false;
var _local3 = 0;
while (_local3 < n) {
objects[_local3].y = objects[_local3].y + _root.gravity_y;
objects[_local3].Update();
if (objects[_local3].collided == 3) {
landed = true;
}
_local3++;
}
_local3 = n;
while (_local3 < objects.length) {
objects[_local3].Update();
_local3++;
}
_local3 = n;
while (_local3 < objects.length) {
objects[_local3].Render();
if (objects[_local3].sprite) {
if (Math.abs(objects[_local3].sprite._rotation) > 90) {
objects[_local3].sprite._yscale = -100;
} else {
objects[_local3].sprite._yscale = 100;
}
}
_local3 = _local3 + 2;
}
x = objects[1].x;
y = objects[1].y;
sprite.beam._x = head.x;
sprite.beam._y = head.y;
if (life < 0) {
return(undefined);
}
behavior();
_root.p.x = sprite.beam.body._x;
_root.p.y = sprite.beam.body._y;
_root.p = head_link.sprite.transform.matrix.transformPoint(_root.p);
aabb.x = _root.p.x + aabb.dx;
aabb.y = _root.p.y + aabb.dy;
if (action != "pain") {
var _local4 = _root.CollideBullets(aabb);
if (_local4 > 0) {
head.x = head.x + (_root.p.x / 8000);
head.y = head.y + (_root.p.y / 8000);
head_life = head_life - _local4;
if (head_life > 0) {
head_link.sprite.play();
}
_root.sound("snd_metal_bullet" + (random(3) + 1));
}
if (head_life <= 0) {
if ((n_head != 1) || (!on_die)) {
ExplodeHead();
} else {
on_die(this);
on_die = 0;
head_life = 10000;
_root.add_kill_bonus(4000);
}
}
}
action_reload--;
_time++;
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
var _local2 = 0;
while (_local2 < objects.length) {
delete objects[_local2];
objects.splice(_local2, 1);
_local2++;
}
beam_sound.stop();
}
function Alive() {
return(life > -10000);
}
function InGame() {
if ((headx + 100) < _root.left_border) {
return(false);
}
if ((headx - 100) > _root.right_border) {
return(false);
}
if ((heady + 100) < _root.top_border) {
return(false);
}
if ((heady - 100) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
if (life > 0) {
return(true);
}
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
function point1() {
return(objects[2]);
}
function point2() {
return(objects[8]);
}
function GoTo(px, py) {
sprite.end_glow._visible = false;
beam_sound.stop();
drill_sound.stop();
if (sprite.beam.ready) {
if (action == "drill") {
sprite.beam.gotoAndPlay("hide_drill");
} else if (action == "shot") {
sprite.beam.gotoAndPlay("stop_beam");
}
} else {
sprite.beam.gotoAndPlay("safe");
}
sprite.beam.ready = false;
sprite.beam._visible = false;
behavior = wait_until_arrive;
destx = px;
desty = py;
action_reload = 60;
}
function wait_until_arrive() {
MoveTo(destx, desty);
if (action_reload <= 0) {
if ((Math.abs(head.x - destx) < 200) && (Math.abs(head.y - desty) < 200)) {
GrabPlayer();
behavior = Gravizappa;
}
}
}
function GrabPlayer() {
var _local3 = 16;
cable = new CableDoubleAnchor(head.x, head.y, "orange_lightning", _local3, -0.1, 0, 0, 4);
cable.SetPos1(head.x, head.y);
cable.Play(5);
_root.PushObject(cable);
behavior = Gravizappa;
kx = _root.knight.x;
ky = _root.knight.y;
cable.SetPos2(kx, ky);
action_reload = 150;
_root.knight.stop();
_root.knight.color.setTransform(_root.blue);
action = "gravizappa";
}
function Gravizappa() {
Target(_root.knight.getx(), _root.knight.gety());
cable.SetPos1(head.x, head.y);
cable.SetPos2(_root.knight.x, _root.knight.y);
kx = _root.interpolate(kx, destx, 0.01);
ky = _root.interpolate(ky, desty - 200, 0.01);
ky = ky - 0.3;
_root.knight.x = (_root.knight.oldx = kx);
_root.knight.y = (_root.knight.oldy = ky);
if (cable.hanging) {
_root.knight.unhang();
}
_root.knight.sprite._rotation = _root.knight.sprite._rotation + 7.2;
if (action_reload <= 0) {
cable.Kill();
delete cable;
ExplodeHead();
_root.knight.sprite._rotation = 0;
_root.knight.sprite.play();
_root.knight.color.setTransform(_root.white);
_root.level.boss_room_floor.gotoAndPlay("break");
_root.UnSetBounds();
}
}
function Pause() {
switch (head_link.sprite._currentframe) {
case 1 :
case 34 :
break;
default :
head_link.sprite.stop();
}
switch (sprite.beam._currentframe) {
case 1 :
case 109 :
case 129 :
break;
default :
sprite.beam.stop();
}
}
function UnPause() {
switch (head_link.sprite._currentframe) {
case 1 :
case 34 :
break;
default :
head_link.sprite.play();
}
switch (sprite.beam._currentframe) {
case 1 :
case 109 :
case 129 :
break;
default :
sprite.beam.play();
}
}
var drill_time = 250;
}
Symbol 3233 MovieClip [__Packages.GunShip] Frame 0
class GunShip extends Spawner
{
var joint, inert, aabb_gun, aabb_rockets, x, y, life, dir, target_speed, destx, desty, gundir, behavior, cable, gun_reload, steam_reload, attack, _mode, takeoff_sequence, life_rockets, life_gun, damage_hp1, damage_hp2, damage_hp3, rockets_reload, on_no_weapons, hammer_dx, fall, rocket_w, falltime, player_left_bound, player_right_bound, sprite, turbine_sound, UpdateEvents, link1, link2, color_body, gun, color_gun, cable_length, rockets, color_rockets, left_bound, right_bound, pain_gun, pain_rockets, pain_body, hammer, hammer_sound, on_die;
function GunShip (__x, __y, _cable, __mode) {
super(__x, __y);
joint = new JointCollide(__x, __y, 10000);
inert = 0.5 / joint.mass;
joint.aabb = new Object();
joint.aabb.w = 260;
joint.aabb.h = 100;
joint.aabb.dx = -115;
joint.aabb.dy = -55;
joint.aabb.x = __x;
joint.aabb.y = __y;
aabb_gun = new Object();
aabb_gun.w = 64;
aabb_gun.h = 64;
aabb_gun.dx = -32;
aabb_gun.dy = -38;
aabb_gun.x = __x;
aabb_gun.y = __y;
aabb_rockets = new Object();
aabb_rockets.w = 90;
aabb_rockets.h = 54;
aabb_rockets.dx = -45;
aabb_rockets.dy = -26;
aabb_rockets.x = __x;
aabb_rockets.y = __y;
x = __x;
y = __y;
life = 100;
dir = 0;
target_speed = 2;
destx = __x;
desty = __y;
dir = 0;
gundir = 160;
behavior = stand;
if (_cable) {
cable = 1;
}
gun_reload = 100;
steam_reload = 0;
attack = 0;
_mode = __mode;
if (!_mode) {
_mode = 1;
}
takeoff_sequence = 0;
if ((_mode == 1) || (_mode == 3)) {
Update = UpdateSuply;
}
life_rockets = 1400;
life_gun = 1200;
life = 2000;
damage_hp1 = 1500;
damage_hp2 = 1000;
damage_hp3 = 500;
rockets_reload = 200;
on_no_weapons = GetWeapon;
hammer_dx = -300;
fall = false;
rocket_w = 10;
falltime = 0;
}
function PlayerBounds() {
if (_root.knight.getx() < player_left_bound) {
_root.knight.x = player_left_bound;
} else if (_root.knight.getx() > player_right_bound) {
_root.knight.x = player_right_bound;
}
}
function motion() {
var _local6 = joint.x - destx;
var _local5 = joint.y - desty;
var _local8 = joint.x - joint.oldx;
var _local7 = joint.y - joint.oldy;
var _local4 = 0;
var _local3 = 0;
if (Math.abs(_local6) > 60) {
if (_local6 < 0) {
_local4 = 1;
} else {
_local4 = -1;
}
_local4 = _local4 * _root.limit((Math.abs(_local6) - 60) * 0.01, 0.01, 1);
if ((_local4 * _local8) > 10) {
_local4 = 0;
}
}
if (Math.abs(_local5) > 60) {
if (_local5 < 0) {
_local3 = 1;
} else {
_local3 = -1;
}
_local3 = _local3 * _root.limit((Math.abs(_local5) - 60) * 0.005, 0.005, 1);
_local3 = _local3 - _root.gravity_y;
if ((_local3 * _local7) > 10) {
_local3 = 0;
}
}
joint.oldx = _root.interpolate(joint.oldx, joint.x, 0.04);
joint.oldy = _root.interpolate(joint.oldy, joint.y, 0.01);
joint.x = joint.x + (_local4 + (_root.wind_x * 0.05));
joint.y = joint.y + _local3;
dir = _root.interpolate(dir, (_local4 + (_root.level_vx * 0.0125)) * 20, 0.05);
sprite._rotation = dir;
sprite.gun1._rotation = (gundir - dir) + 8;
sprite.gun2._rotation = (gundir - dir) + 8;
if (steam_reload < 0) {
if (life > 1000) {
_root.objects.push(new SteamParticle("steam", x, y + 30, dir + 90, 12, 10, 25, 1));
} else if (life > 500) {
if (random(100) < 50) {
_root.objects.push(new SteamParticle("steam", x, y + 30, dir + 90, 12, 10, 25, 1));
} else {
_root.objects.push(new SteamParticle("black_steam", x, y + 30, dir + 90, 12, 10, 25, 1));
}
} else {
_root.objects.push(new SteamParticle("black_steam", x, y + 30, dir + 90, 12, 10, 25, 1));
}
steam_reload = 4;
}
steam_reload--;
_root.point_sound(turbine_sound, joint.x, 50);
}
function MoveTo(_destx, _desty) {
destx = _destx;
desty = _desty;
behavior = wait_until_arrive;
}
function wait_until_arrive() {
var _local3 = x - destx;
var _local2 = y - desty;
if ((Math.abs(_local3) <= 100) && (Math.abs(_local2) <= 100)) {
behavior = stand;
}
}
function stand() {
UpdateEvents();
}
function run() {
behavior = fly_away;
sprite.gotoAndPlay("forsage");
destx = destx - 5000;
}
function fly_away() {
if ((x + 1600) < _root.left_border) {
life = -100000;
}
UpdateEvents();
}
function Update() {
}
function UpdateSuply() {
joint.y = joint.y + _root.gravity_y;
behavior();
motion();
joint.UpdatePhysics();
x = joint.x;
y = joint.y;
if (cable) {
if (link1) {
link1.Update();
}
if (link2) {
link2.Update();
}
cable.Update();
if (cable.hanging) {
_root.knight.unhang();
}
}
var _local3 = _root.CollideBullets(joint.aabb);
if (_local3 > 0) {
joint.x = joint.x + (_root.p.x * inert);
joint.y = joint.y + (_root.p.y * inert);
life = life - _local3;
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
}
}
function Kill() {
turbine_sound.stop();
joint.Kill();
cable.Kill();
removeMovieClip(sprite);
life = -100000;
}
function Alive() {
return(life > -10000);
}
function InGame() {
if ((x + 300) < _root.left_border) {
return(false);
}
if ((x - 300) > _root.right_border) {
return(false);
}
if ((y + 200) < _root.top_border) {
return(false);
}
if ((y - 200) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
if (falltime <= 100) {
return(true);
}
sprite._visible = false;
}
function UnFreeze() {
if (!sprite) {
var _local3 = _root.get_id();
var _local4 = 3;
joint.sprite = _root.objects_layer.attachMovie("gunship", "gs" + _local3, _local3 + (_root.depth_band * _local4));
sprite = joint.sprite;
sprite._x = joint.x;
sprite._y = joint.y;
color_body = new Color(sprite);
gun = sprite.gun2;
color_gun = new Color(gun);
if (_mode == 1) {
if (cable) {
cable_length = 8;
cable = new CableDoubleAnchor(x, y, "cable_grapple", cable_length, _root.gravity_y, 0, 0, 2);
cable.anchor1 = 0;
cable.anchor2 = 0;
link1 = new Link(joint, cable.objects[0], 0.9);
link1.r = 20;
_root.objects.push(cable);
cable.UnFreeze();
}
sprite.gotoAndStop(1);
}
if (_mode == 2) {
sprite.gotoAndStop(2);
rockets = sprite.rockets;
color_rockets = new Color(rockets);
}
if (_mode == 3) {
cable_length = 8;
cable = new CableDoubleAnchor(x, y, "rope_ladder", cable_length, _root.gravity_y, 0, 0, 2);
cable.anchor1 = 0;
cable.anchor2 = 0;
link1 = new Link(joint, cable.objects[0], 0.9);
link1.r = 20;
_root.objects.push(cable);
cable.UnFreeze();
sprite.gotoAndStop(1);
}
turbine_sound = new Sound(sprite);
turbine_sound.attachSound("snd_turbine_loop");
}
if (falltime <= 100) {
turbine_sound.start(random(100) / 100, 9999);
turbine_sound.setVolume(0);
cable.Freeze = function () {
return(true);
};
}
sprite._visible = true;
}
function Grab(_joint) {
link2 = new Link(_joint, cable.objects[cable_length], 0.9);
link2.r = 20;
cable.sprite["c" + (cable_length - 1)].gotoAndPlay("grab");
}
function UnGrab() {
if (_mode == 1) {
delete link2;
link2 = 0;
cable.sprite["c" + (cable_length - 1)].gotoAndPlay("ungrab");
} else if (_mode == 3) {
cable.sprite["c" + (cable_length - 1)].man.play();
}
}
function Target(tx, ty) {
_root.p.x = gun._x;
_root.p.y = gun._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local4 = Math.atan2(ty - _root.p.y, tx - _root.p.x) * _root.radtodeg;
var _local3 = _local4 - gundir;
while (_local3 > 180) {
_local3 = _local3 - 360;
}
while (_local3 < -180) {
_local3 = _local3 + 360;
}
if (_local3 > 4) {
gundir = gundir + 0.5;
} else if (_local3 < -4) {
gundir = gundir - 0.5;
}
}
function Minigun() {
if (gun.ready) {
_root.p.x = gun.barrel._x;
_root.p.y = gun.barrel._y;
_root.p = gun.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local3 = new EnemyBullet("pistol_bullet", _root.p.x, _root.p.y, gundir, 18, 10, 6, 5);
_local3.sprite._yscale = 200;
_root.objects.push(_local3);
}
if (gun_reload <= 0) {
gun = sprite.gun2;
_root.sound("snd_minigun");
gun.play();
gun_reload = 100;
}
}
function UpdateAttack() {
joint.y = joint.y + _root.gravity_y;
behavior();
if (rockets && (life_rockets > 0)) {
if (rockets.ready) {
_root.p.x = rockets.barrel._x;
_root.p.y = rockets.barrel._y;
_root.p = rockets.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local4 = new EnemyRocket("rocket", _root.p.x, _root.p.y, dir + 180, 10, 7, 9);
_local4.w = rocket_w;
rocket_w = -rocket_w;
_root.objects.push(_local4);
gun_reload = 100;
}
if (rockets_reload < 0) {
rockets.gotoAndPlay("charge");
gun_reload = 150;
rockets_reload = 400;
if (life_gun <= 0) {
rockets_reload = 200;
}
}
}
if (life_gun > 0) {
Target(_root.knight.getx(), _root.knight.gety());
Minigun();
}
var _local3 = _root.knight.getx() + 150;
if (rockets.ready || (rockets_reload == 1)) {
destx = destx + 100;
}
var _local6 = _root.knight.gety() - 325;
_local3 = _root.limit(_local3, left_bound, right_bound);
destx = _root.interpolate(destx, _local3, 0.2);
desty = _root.interpolate(desty, _local6, 0.1);
motion();
joint.UpdatePhysics();
x = joint.x;
y = joint.y;
if (rockets) {
_root.p.x = sprite.rockets_central._x;
_root.p.y = sprite.rockets_central._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
aabb_rockets.x = _root.p.x + aabb_rockets.dx;
aabb_rockets.y = _root.p.y + aabb_rockets.dy;
rockets.x = aabb_rockets.x;
rockets.y = aabb_rockets.y;
}
_root.p.x = gun._x;
_root.p.y = gun._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
aabb_gun.x = _root.p.x + aabb_gun.dx;
aabb_gun.y = _root.p.y + aabb_gun.dy;
gun.x = aabb_rockets.x;
gun.y = aabb_rockets.y;
if (life_gun > 0) {
var _local5 = _root.CollideBullets(aabb_gun);
if (_local5 > 0) {
pain_gun = 4;
life_gun = life_gun - _local5;
color_gun.setTransform(_root.light_orange);
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
joint.x = joint.x + (_root.p.x * inert);
joint.y = joint.y + (_root.p.y * inert);
} else if (pain_gun == 0) {
color_gun.setTransform(_root.white);
}
if (life_gun <= 0) {
color_gun.setTransform(_root.white);
gun.gotoAndPlay("die");
if (rockets_reload > 200) {
rockets_reload = 200;
}
_root.add_kill_bonus(2000);
}
}
if (life_rockets > 0) {
var _local5 = _root.CollideBullets(aabb_rockets);
if (_local5 > 0) {
pain_rockets = 4;
life_rockets = life_rockets - _local5;
color_rockets.setTransform(_root.light_orange);
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
joint.x = joint.x + (_root.p.x * inert);
joint.y = joint.y + (_root.p.y * inert);
} else if (pain_rockets == 0) {
color_rockets.setTransform(_root.white);
}
if (life_rockets <= 0) {
color_rockets.setTransform(_root.white);
rockets.gotoAndPlay("die");
_root.add_kill_bonus(5000);
}
}
if (gun.destroyed && (rockets.destroyed)) {
Update = GetWeapon;
return(undefined);
}
gun_reload--;
rockets_reload--;
pain_rockets--;
pain_gun--;
PlayerBounds();
}
function Land() {
Update = Land;
sprite.turbine.stop();
sprite.gun1.gotoAndStop("idle");
sprite.gun2.gotoAndStop("idle");
sprite._rotation = (dir = 10);
joint.y = joint.y + _root.gravity_y;
joint.UpdatePhysics();
x = joint.x;
y = joint.y;
turbine_sound.setVolume(0);
takeoff_sequence = 0;
}
function Takeoff() {
Update = Takeoff;
takeoff_sequence++;
if (takeoff_sequence == 5) {
sprite.turbine.gotoAndPlay("start");
}
if (takeoff_sequence > 8) {
_root.point_sound(turbine_sound, x, _root.limit(takeoff_sequence, 0, 50));
}
if (takeoff_sequence == 30) {
sprite.gun2.gotoAndStop("spin");
}
if (takeoff_sequence == 50) {
switch (_mode) {
case 1 :
Update = UpdateSuply;
break;
case 2 :
Update = UpdateAttack;
}
}
if (_root.knight.x > (x - 150)) {
_root.knight.x = x - 150;
}
}
function GetWeapon() {
Update = GetWeapon;
joint.y = joint.y + _root.gravity_y;
destx = right_bound + 600;
desty = _root.knight.gety() - 525;
motion();
var _local5 = x - destx;
var _local4 = y - desty;
if ((Math.abs(_local5) <= 100) && (Math.abs(_local4) <= 100)) {
Melee();
Update = UpdateMelee;
return(undefined);
}
joint.UpdatePhysics();
x = joint.x;
y = joint.y;
var _local3 = _root.CollideBullets(joint.aabb);
if (_local3 > 0) {
pain_body = 4;
joint.x = joint.x + (_root.p.x * inert);
joint.y = joint.y + (_root.p.y * inert);
life = life - _local3;
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
color_body.setTransform(_root.light_orange);
} else if (pain_body == 0) {
color_body.setTransform(_root.white);
}
pain_body--;
}
function Melee() {
cable_length = 8;
cable = new CableDoubleAnchor(x, y, "spike_chain", cable_length, _root.gravity_y, 0, 0, 2);
cable.anchor1 = 0;
cable.anchor2 = 0;
link1 = new Link(joint, cable.objects[0], 0.9);
link1.r = 20;
cable.UnFreeze();
hammer = new JointCBLF(x, y + 200, 1000, 36, "no");
link2 = new LinkSprite(hammer, cable.objects[cable_length], 0.9, cable.sprite.c8);
link2.r = 55;
hammer_sound = new Sound(cable.sprite);
hammer_sound.attachSound("snd_metal_hit");
hammer_dx = -350;
}
function UpdateMelee() {
joint.y = joint.y + _root.gravity_y;
behavior();
var _local7 = _root.knight.getx() + hammer_dx;
var _local6 = _root.knight.gety() - 325;
destx = _root.interpolate(destx, _local7, 0.2);
desty = _root.interpolate(desty, _local6, 0.1);
motion();
var _local3 = x - destx;
if (Math.abs(_local3) <= 100) {
hammer_dx = -hammer_dx;
}
joint.UpdatePhysics();
x = joint.x;
y = joint.y;
hammer.y = hammer.y + _root.gravity_y;
hammer.Update();
if (hammer.hit_f > 10) {
var _local5 = _root.limit((hammer.hit_f - 5) * 10, 10, 100);
_root.point_sound(hammer_sound, hammer.x, _local5);
hammer_sound.start();
}
_local3 = _root.knight.getx() - hammer.x;
if ((_root.knight.pain <= 0) && ((_local3 * (hammer.x - hammer.oldx)) > 0)) {
if (_root.CollideKnight(hammer.aabb)) {
if (_local3 > 0) {
_root.DamageKnight(10, 20, 0);
} else {
_root.DamageKnight(10, -20, 0);
}
_root.sound("snd_hit");
}
}
link1.Update();
link2.Update();
cable.Update();
if (cable.hanging) {
_root.knight.unhang();
}
link2.Render();
var _local4 = _root.CollideBullets(joint.aabb);
if (_local4 > 0) {
pain_body = 4;
joint.x = joint.x + (_root.p.x * inert);
joint.y = joint.y + (_root.p.y * inert);
life = life - _local4;
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
color_body.setTransform(_root.light_orange);
if (life <= damage_hp1) {
sprite.gotoAndPlay("tail");
damage_hp1 = -10000;
_root.add_kill_bonus(1000);
}
if (life <= damage_hp2) {
sprite.gotoAndPlay("cocpit");
damage_hp2 = -10000;
_root.add_kill_bonus(1000);
}
if (life <= damage_hp3) {
sprite.gotoAndPlay("grapple");
damage_hp3 = -10000;
_root.add_kill_bonus(1000);
}
} else if (pain_body == 0) {
color_body.setTransform(_root.white);
}
if (life <= 0) {
sprite.gotoAndPlay("total");
if (hammer.x < (player_left_bound + 40)) {
hammer.x = player_left_bound + 40;
} else if (hammer.x > (player_right_bound - 40)) {
hammer.x = player_right_bound - 40;
}
_root.PushObject(new Crate(hammer.x, hammer.y, "hammer_static", undefined, 999999, undefined, 5));
cable.sprite.c8._visible = false;
color_body.setTransform(_root.white);
Update = UpdateFall;
_root.add_kill_bonus(10000);
return(undefined);
}
pain_body--;
}
function PilotDie() {
_root.p.x = sprite.pilot_pos._x;
_root.p.y = sprite.pilot_pos._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local6 = _root.get_id();
var _local4 = _root.objects_layer.attachMovie("stunned_player", "m" + _local6, _local6 + (_root.depth_band * 9));
_local4._x = _root.p.x;
_local4._y = _root.p.y;
_local4.gotoAndStop("pilot_left");
var _local5 = new Ragdoll(_root.p.x, _root.p.y, _local4, _local4.head, _local4.bod, _local4.a11, _local4.a12, _local4.a21, _local4.a22, _local4.but, _local4.l11, _local4.l12, _local4.l21, _local4.l22, -8, -8, false);
var _local3 = 11;
while (_local3 < _local5.objects.length) {
_local5.objects[_local3].sprite.gotoAndStop(32);
_local3++;
}
_root.PushObject(_local5);
}
function UpdateFall() {
joint.y = joint.y + _root.gravity_y;
joint.UpdatePhysics();
x = joint.x;
y = joint.y;
link1.Update();
cable.Update();
if (cable.hanging) {
_root.knight.unhang();
}
if ((!fall) && (joint.collided == 3)) {
turbine_sound.stop();
fall = true;
_root.sound("snd_metal_crash");
if (on_die) {
on_die();
}
on_die = 0;
}
dir = _root.interpolate(dir, 10, 0.05);
sprite._rotation = dir;
if (falltime == 7) {
PilotDie();
}
if (falltime == 90) {
_root.view_scale = 100;
falltime = 1000;
}
falltime++;
}
function Pause() {
switch (sprite._currentframe) {
case 1 :
case 2 :
case 45 :
case 62 :
case 80 :
case 96 :
case 117 :
break;
default :
sprite.stop();
}
switch (gun._currentframe) {
case 1 :
case 31 :
case 70 :
break;
default :
gun.stop();
}
switch (rockets._currentframe) {
case 1 :
case 180 :
break;
default :
rockets.stop();
}
}
function UnPause() {
switch (sprite._currentframe) {
case 1 :
case 2 :
case 45 :
case 62 :
case 80 :
case 96 :
case 117 :
break;
default :
sprite.play();
}
switch (gun._currentframe) {
case 1 :
case 31 :
case 70 :
break;
default :
gun.play();
}
switch (rockets._currentframe) {
case 1 :
case 180 :
break;
default :
rockets.play();
}
}
}
Symbol 3234 MovieClip [__Packages.TrainOptimisator] Frame 0
class TrainOptimisator extends Obj
{
var sprites, n, x, y, _time, speed, dist, camera_mode, sprite, train_sound, behavior, view_x, view_y, gunship;
function TrainOptimisator () {
super();
sprites = new Array();
n = 0;
x = 0;
y = 0;
_time = 0;
speed = 0;
dist = 0;
camera_mode = 0;
var _local4 = _root.get_id();
sprite = _root.objects_layer.createEmptyMovieClip("snd1" + _local4, _local4 + (_root.depth_band * 8));
train_sound = new Sound(sprite);
train_sound.attachSound("snd_train_loop");
train_sound.start(0, 9999);
}
function PushSprite(_mc) {
var _local3 = new Object();
var _local4 = _mc.getBounds(_root.level);
_local3.mc = _mc;
_local3.x = _local4.xMin;
_local3.y = _local4.yMin;
_local3.w = _local4.xMax - _local4.xMin;
_local3.h = _local4.yMax - _local4.yMin;
_local3.freezed = false;
_local3.oldframe = _mc._currentframe;
if (_local3.oldframe < 2) {
_local3.oldframe = 2;
}
sprites.push(_local3);
n++;
}
function Check(a) {
if ((a.x + a.w) < _root.left_border) {
return(false);
}
if (a.x > _root.right_border) {
return(false);
}
if ((a.y + a.h) < _root.top_border) {
return(false);
}
if (a.y > _root.bottom_border) {
return(false);
}
return(true);
}
function Update() {
if (behavior) {
behavior();
}
var _local3;
var _local4 = 0;
while (_local4 < sprites.length) {
_local3 = sprites[_local4];
if (Check(_local3)) {
if (_local3.freezed) {
_local3.mc.gotoAndPlay(2);
_local3.mc._visible = true;
_local3.freezed = false;
}
} else if (!_local3.freezed) {
_local3.mc.gotoAndStop("empty");
_local3.mc._visible = false;
_local3.freezed = true;
}
_local4++;
}
x = _root.left_border;
y = _root.top_border;
}
function Freeze() {
return(true);
}
function UnFreeze() {
}
function Alive() {
return(true);
}
function Kill() {
delete sprites;
}
function StartMinedRailScene() {
behavior = CameraMove1;
_root.knight.LockControls("lock_view");
_time = 0;
_root.view_scale = 100;
view_x = _root.view_x;
view_y = _root.view_y;
_root.pause_possible = false;
}
function CameraMove1() {
var _local3 = _root.level.mined_camera;
var _local8 = _local3._x + _local3.view_pos._x;
var _local7 = _local3._y + _local3.view_pos._y;
var _local6 = _local3._x + _local3.right_border._x;
if (_root.knight.getx() > _local6) {
_root.knight.x = _local6;
}
_time++;
view_x = view_x - speed;
var _local4 = (-_local8) + (_root.w * 0.5);
var _local5 = (-_local7) + (_root.h * 0.5);
view_y = _root.interpolate(view_y, _local5, 0.01);
var _local9 = 0.05;
switch (camera_mode) {
case 0 :
speed = speed + 0.2;
if (speed > 20) {
speed = 20;
}
if (view_x <= _local4) {
camera_mode = 1;
speed = speed + 20;
view_x = _local4;
_root.sound_loop("snd_wind_loop", 4);
}
break;
case 1 :
view_x = _local4;
_root.level_vx = speed;
speed = speed * 1.1;
if (speed > 80) {
speed = 80;
}
dist = dist + speed;
var _local11 = _root.limit((-dist) * 0.01, -100, 100);
var _local10 = _root.limit((8000 - dist) * 0.0125, 0, 100);
train_sound.setPan(_local11);
train_sound.setVolume(_local10);
if (dist > 16000) {
camera_mode = 2;
dist = 0;
gunship = new GunShip(_local8 + 2000, _local7 - 300, true, 3);
_root.objects.push(gunship);
gunship.UnFreeze();
gunship.destx = _local3._x + _local3.gunship_dest._x;
gunship.desty = _local3._y + _local3.gunship_dest._y;
}
break;
case 2 :
view_x = _local4;
_root.level_vx = speed;
speed = speed * 0.9;
if (speed < 10) {
speed = 10;
dist++;
}
if (dist > 100) {
camera_mode = 3;
_local3.play();
dist = 0;
_root.level_vx = 0;
_root.wind_left = -1;
_root.wind_right = 1;
}
break;
case 3 :
view_x = _local4;
view_y = _local5;
dist++;
if (dist > 250) {
camera_mode = 4;
gunship.UnGrab();
dist = 0;
}
break;
case 4 :
view_x = _local4;
view_y = _local5;
dist++;
if (dist > 150) {
camera_mode = 5;
gunship.desty = gunship.desty - 400;
gunship.run();
dist = 0;
}
break;
case 5 :
view_x = _local4;
view_y = _local5 + dist;
dist++;
if (dist <= 100) {
break;
}
_root.persistent_buf.back0_x = _root.backgrounds[0].x;
_root.persistent_buf.back1_x = _root.backgrounds[1].x;
_root.persistent_buf.back2_x = _root.backgrounds[2].x;
_root.level_finish_state.Save();
_root.GotoLevel("train_fall");
}
_root.SmoothView(view_x, view_y, 0.95, _local9);
}
}
Symbol 3235 MovieClip [__Packages.TriggerHideForeground] Frame 0
class TriggerHideForeground extends Obj
{
var sprite, aabb, x, y, dir_x, dir_y, mc, collided_x, collided_y, dalpha, alpha, started;
function TriggerHideForeground (_sprite, _mc, _dir_x, _dir_y, _dx, _dy) {
super();
sprite = _sprite;
if (_dx == undefined) {
_dx = 0;
}
if (_dy == undefined) {
_dy = 0;
}
aabb = new Object();
aabb.w = sprite._width;
aabb.h = sprite._height;
aabb.x = sprite._x;
aabb.y = sprite._y;
aabb.dx = _dx;
aabb.dy = _dy;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
dir_x = _dir_x;
dir_y = _dir_y;
mc = _mc;
collided_x = 0;
collided_y = 0;
dalpha = 0;
alpha = 100;
}
function Update() {
aabb.x = aabb.dx + sprite._x;
aabb.y = aabb.dy + sprite._y;
x = aabb.x + (aabb.w * 0.5);
y = aabb.y + (aabb.h * 0.5);
alpha = _root.limit(alpha + dalpha, 0, 100);
if (dalpha) {
mc._alpha = alpha;
}
if ((alpha == 100) || (alpha == 0)) {
dalpha = 0;
}
mc._visible = true;
if (_root.CollideKnight(aabb)) {
if ((dir_x * _root.p.x) < 0) {
dalpha = -10;
} else {
alpha = mc._alpha;
}
if ((dir_y * _root.p.y) < 0) {
dalpha = -10;
} else {
alpha = mc._alpha;
}
collided_x = _root.p.x;
collided_y = _root.p.y;
} else {
if ((collided_x * dir_x) > 0) {
dalpha = 10;
}
if ((collided_y * dir_y) > 0) {
dalpha = 10;
}
collided_x = 0;
collided_y = 0;
}
}
function Freeze() {
if ((mc._alpha != 100) && (mc._alpha != 0)) {
return(true);
}
if (((_root.knight.getx() - x) * dir_x) < 0) {
mc._visible = false;
}
}
function UnFreeze() {
mc._visible = true;
alpha = mc._alpha;
dalpha = 0;
}
function Alive() {
return(!started);
}
}
Symbol 3236 MovieClip [__Packages.Winch] Frame 0
class Winch extends Obj
{
var x, y, speed, min_len, max_len, cur_len, cable, old_len;
function Winch (__x, __y, _speed, _min_len, _max_len) {
super(__x, __y);
x = __x;
y = __y;
speed = _speed;
min_len = _min_len;
max_len = _max_len;
cur_len = min_len;
cable = new CableDoubleAnchor(x, y, "cable_grapple_long", cur_len, _root.gravity_y, 0, 0, 2);
cable.Add();
cur_len = (old_len = min_len + 1);
cable.SetPos1(x, y);
cable.anchor2 = 0;
}
function Update() {
cable.Update();
if (cur_len < (max_len - 1)) {
cur_len = cur_len + speed;
}
if (int(cur_len) > old_len) {
old_len = int(cur_len);
cable.Add();
}
}
function Kill() {
cable.Kill();
delete cable;
}
function Freeze() {
cable.Freeze();
}
function UnFreeze() {
cable.UnFreeze();
}
}
Symbol 3237 MovieClip [__Packages.StalkerBarrel] Frame 0
class StalkerBarrel extends Obj
{
var x, y, _time, life, steam_reload, key, started, on_stalker_die, stalker_spawned, sprite, stalker;
function StalkerBarrel (__x, __y, _key, _on_stalker_die) {
super(__x, __y);
x = __x;
y = __y;
_time = 0;
life = 100;
steam_reload = 0;
key = _key;
started = false;
on_stalker_die = _on_stalker_die;
stalker_spawned = false;
}
function Start() {
}
function Update() {
var _local3 = sprite._currentframe;
if (!started) {
if (_root.keys[key]) {
sprite.play();
started = true;
} else {
return(undefined);
}
}
if ((_local3 < 28) && (steam_reload <= 0)) {
var _local5 = x + sprite.steam1._x;
var _local4 = y + sprite.steam1._y;
_root.objects.push(new SteamParticle("steam", _local5, _local4, -120, 12, 10, 25, 5));
_local5 = x + sprite.steam2._x;
_local4 = y + sprite.steam2._y;
_root.objects.push(new SteamParticle("steam", _local5, _local4, -60, 12, 10, 25, 5));
steam_reload = 3;
} else if ((_local3 > 128) && (_local3 < 135)) {
var _local5 = x;
var _local4 = y;
_root.objects.push(new SteamParticle("steam", _local5, _local4, -60 - random(60), 12, 10, 25, 5));
steam_reload = 0;
}
if ((_local3 >= 132) && (!stalker_spawned)) {
stalker = new Stalker(x, y - 150, 100);
stalker.AddSpeed(-2, -22, 10);
_root.objects.push(stalker);
stalker.on_die = on_stalker_die;
stalker_spawned = true;
}
_time++;
steam_reload--;
}
function Alive() {
return(true);
}
function Freeze() {
if ((_time > 0) && (_time < 200)) {
return(true);
}
sprite._visible = false;
}
function UnFreeze() {
if (!sprite) {
var _local3 = _root.get_id();
sprite = _root.objects_layer.attachMovie("stalker_barrel", "stalk_bar" + _local3, _local3 + (_root.depth_band * 3));
sprite._x = x;
sprite._y = y;
}
sprite._visible = true;
}
function Pause() {
switch (sprite._currentframe) {
case 1 :
case 139 :
break;
default :
sprite.stop();
}
}
function UnPause() {
switch (sprite._currentframe) {
case 1 :
case 139 :
break;
default :
sprite.play();
}
}
}
Symbol 3238 MovieClip [__Packages.Stalker] Frame 0
class Stalker extends Obj
{
var objects, foots, sprite, life, head, tors, back, butt, n_joints, x, y, dir, side, behavior, hit_phase, hit_dir, reloading, color_head, color_tors, activate_delay, head_exploded, tors_exploded, back_exploded, on_die_delay, activated, active_foot, overstep_foot, foot_angle, step_dist, d_foot_angle, hit_y, pain_head, pain_tors, landed, on_die;
function Stalker (__x, __y, _activate_delay) {
super();
objects = new Array();
foots = new Array();
var _local9 = 5;
var _local8 = _root.get_id();
sprite = _root.objects_layer.attachMovie("stalker", "sr" + _local8, _local8 + (_root.depth_band * _local9));
sprite._x = __x;
sprite._y = __y;
life = maxlife;
var _local11 = "stalker-sama, behold.";
head = joint("head", 40, 16);
tors = joint("tors", 100, 30);
jointno("arm11", 40, 10);
jointf("arm12", 40, 10);
jointno("arm21", 40, 10);
jointf("arm22", 40, 10);
back = jointno("back", 60, 10);
butt = joint("butt", 80, 10);
jointno("leg11", 40, 10);
jointf("leg12", 40, 10);
jointno("leg21", 40, 10);
jointf("leg22", 40, 10);
n_joints = objects.length;
var _local5 = 0.95;
link("head", "tors", _local5, "head");
link("tors", "back", _local5, "tors");
link("back", "butt", _local5, "back");
link("arm12", "arm11", _local5, "arm12");
link("arm11", "tors", _local5, "arm11");
link("arm22", "arm21", _local5, "arm22");
link("arm21", "tors", _local5, "arm21");
link("leg12", "leg11", _local5, "leg12");
link("leg11", "butt", _local5, "leg11");
link("leg22", "leg21", _local5, "leg22");
link("leg21", "butt", _local5, "leg21");
link("head", "back", _local5 * 0.5);
link("tors", "butt", _local5 * 0.5);
link("leg12", "leg22", (-_local5) * 0.1).r = 50;
link("leg11", "leg21", (-_local5) * 0.1).r = 50;
var _local4 = 0;
while (_local4 < n_joints) {
objects[_local4].x = objects[_local4].x + __x;
objects[_local4].y = objects[_local4].y + __y;
objects[_local4].oldx = objects[_local4].oldx + __x;
objects[_local4].oldy = objects[_local4].oldy + __y;
_local4++;
}
sprite._x = 0;
sprite._y = 0;
_local4 = n_joints;
while (_local4 < objects.length) {
objects[_local4].Render();
_local4++;
}
x = __x;
y = __y;
dir = 0;
side = -1;
behavior = Walk;
hit_phase = 0;
hit_dir = 0;
reloading = 30;
color_head = new Color(sprite.head);
color_tors = new Color(sprite.tors);
if (!_activate_delay) {
_activate_delay = 0;
}
activate_delay = _activate_delay;
head_exploded = (tors_exploded = (back_exploded = false));
on_die_delay = 130;
}
function joint(part_name, m, r) {
var _local2 = new JointCBLF(sprite[part_name]._x, sprite[part_name]._y, m, r, "no");
objects.push(_local2);
objects[objects.length - 1].id = part_name;
return(_local2);
}
function jointf(part_name, m, r) {
var _local2 = new JointCBLF(sprite[part_name]._x, sprite[part_name]._y, m, r, "no");
objects.push(_local2);
objects[objects.length - 1].id = part_name;
foots.push(_local2);
return(_local2);
}
function jointno(part_name, m, r) {
var _local2 = new JointLoFr(sprite[part_name]._x, sprite[part_name]._y, m);
objects.push(_local2);
objects[objects.length - 1].id = part_name;
return(_local2);
}
function link(name1, name2, k, part_name) {
var _local4;
var _local3;
var _local2 = 0;
while (_local2 < n_joints) {
if (objects[_local2].id == name1) {
_local4 = objects[_local2];
}
if (objects[_local2].id == name2) {
_local3 = objects[_local2];
}
if (_local4 && (_local3)) {
break;
}
_local2++;
}
var _local5;
if (k > 0) {
if (part_name) {
_local5 = new LinkSprite(_local4, _local3, k, sprite[part_name]);
} else {
_local5 = new Link(_local4, _local3, k);
}
} else {
_local5 = new LinkPush(_local4, _local3, -k);
}
objects.push(_local5);
return(_local5);
}
function AddSpeed(vx, vy, rnd) {
var _local2 = 0;
while (_local2 < n_joints) {
objects[_local2].x = objects[_local2].x + ((vx + (Math.random() * rnd)) - (rnd * 0.5));
objects[_local2].y = objects[_local2].y + ((vy + (Math.random() * rnd)) - (rnd * 0.5));
_local2++;
}
}
function Activate() {
activated = true;
}
function sort_left(a, b) {
if (a.x < b.x) {
return(1);
}
return(-1);
}
function sort_right(a, b) {
if (a.x > b.x) {
return(1);
}
return(-1);
}
function StartWalk() {
if (life <= 0) {
return(undefined);
}
if (hit_phase > 0) {
active_foot.UnFix();
}
if (side < 0) {
foots.sort(sort_left);
} else {
foots.sort(sort_right);
}
switch (active_foot.collided) {
case 2 :
case 4 :
overstep_foot = foots[1];
break;
default :
overstep_foot = foots[3];
}
active_foot = foots[0];
foot_angle = Math.atan2(active_foot.y - overstep_foot.y, active_foot.x - overstep_foot.x);
step_dist = 0;
d_foot_angle = dir * 0.4;
active_foot.UnFix();
behavior = Walk;
hit_phase = 0;
}
function Balance() {
if (life <= 0) {
return(undefined);
}
var _local3;
var _local4;
var _local2 = 0;
while (_local2 < foots.length) {
if (foots[_local2].collided == 3) {
if ((foots[_local2].y > _local3) || (!_local3)) {
_local3 = foots[_local2].y;
}
} else if (foots[_local2].collided == 1) {
if ((foots[_local2].y < _local4) || (!_local4)) {
_local4 = foots[_local2].y;
}
}
if (foots[_local2].collided && (foots[_local2] != active_foot)) {
foots[_local2].Fix();
}
_local2++;
}
if (_local3) {
var _local5 = 150;
if ((_local3 - back.y) < _local5) {
back.y = back.y + (((_local3 - back.y) - _local5) * 0.1);
}
}
}
function Walk() {
if (life <= 0) {
return(undefined);
}
if (!active_foot) {
StartWalk();
} else if (dir) {
foot_angle = foot_angle + d_foot_angle;
step_dist = step_dist + Math.abs(d_foot_angle);
var _local3 = 80;
var _local7 = overstep_foot.x + (Math.cos(foot_angle) * _local3);
var _local5 = overstep_foot.y + (Math.sin(foot_angle) * _local3);
var _local6 = _local7 - active_foot.x;
var _local4 = _local5 - active_foot.y;
active_foot.x = active_foot.x + (_local6 * 0.25);
active_foot.y = active_foot.y + (_local4 * 0.25);
if ((step_dist > 1.2) && (active_foot.collided)) {
active_foot.Fix();
StartWalk();
_root.sound("snd_mech_step");
}
if (step_dist > 5) {
StartWalk();
}
}
}
function SetSide() {
var _local2 = n_joints;
while (_local2 < objects.length) {
if (objects[_local2].sprite) {
objects[_local2].sprite._yscale = (-side) * 100;
}
_local2++;
}
}
function Target(tx, ty) {
var _local11 = Math.atan2(head.y - ty, head.x - tx);
var _local5 = head.x - tors.x;
var _local4 = head.y - tors.y;
var _local6 = Math.atan2(-_local4, -_local5);
var _local7 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
_local5 = _local5 / _local7;
_local4 = _local4 / _local7;
var _local3 = _local11 - _local6;
while (_local3 > 3.1415) {
_local3 = _local3 - 6.283;
}
while (_local3 < -3.1415) {
_local3 = _local3 + 6.283;
}
if ((side * (tors.x - back.x)) < 0) {
_local3 = side * 2;
}
var _local10 = _local4 * _local3;
var _local9 = (-_local5) * _local3;
head.x = head.x - _local10;
head.y = head.y - _local9;
var _local8 = Math.abs(_local3) < 0.5;
if ((reloading < 20) && (_local8)) {
head.oldx = _root.interpolate(head.oldx, head.x, 0.8);
head.oldy = _root.interpolate(head.oldy, head.y, 0.8);
}
if (_local8 && (reloading <= 0)) {
_local6 = _local6 + 3.1415;
_root.objects.push(new Fireball("fireball", head.x, head.y, _local6 * _root.radtodeg, 8, 10, 15, 8));
reloading = reload_time;
sprite.head.gotoAndPlay("shot");
head.Fix();
tors.Fix();
_root.sound("snd_blaster2");
}
}
function StartHit(hx, hy) {
if (hit_phase != 0) {
return(undefined);
}
hit_y = hy;
var _local6 = 1000000 /* 0x0F4240 */;
var _local7 = 0;
var _local3 = 0;
while (_local3 < foots.length) {
var _local2 = foots.x - hx;
var _local4 = foots.y - hy;
var _local5 = (_local2 * _local2) + (_local4 * _local4);
if ((_local5 < _local6) && ((_local2 * side) > 0)) {
_local6 = _local5;
_local7 = _local3;
}
_local3++;
}
active_foot = foots[_local7];
active_foot.UnFix();
hit_phase = 0;
behavior = Hit;
head.UnFix();
tors.UnFix();
}
function Hit() {
reloading = reloading + 1;
hit_phase++;
if (hit_phase > 30) {
StartWalk();
hit_phase = 0;
return(undefined);
}
if (hit_phase < 8) {
active_foot.x = active_foot.x - (side * 4);
} else {
active_foot.x = active_foot.x + (side * 8);
active_foot.y = _root.interpolate(active_foot.y, hit_y, 0.2);
if (_root.knight.pain <= 0) {
if (_root.CollideKnight(active_foot.aabb)) {
_root.DamageKnight(5, side * 20, -4);
_root.sound("snd_hit");
return(undefined);
}
}
}
if (hit_phase > 30) {
StartWalk();
hit_phase = 0;
}
}
function Gibs(__x, __y, n_gibs) {
var _local2 = 0;
while (_local2 < n_gibs) {
_root.objects.push(new SpinningGib("metal_gibs", __x, __y, random(360), 15, 10, random(8) + 20, 4));
_local2++;
}
}
function Collisions() {
var _local4 = _root.CollideBullets(head.aabb);
if (_local4 > 0) {
pain_head = 4;
life = life - _local4;
color_head.setTransform(_root.light_orange);
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
head.x = head.x + (_root.p.x / 1000);
head.y = head.y + (_root.p.y / 1000);
} else if (pain_head == 0) {
color_head.setTransform(_root.white);
}
_local4 = _root.CollideBullets(tors.aabb);
if (_local4 > 0) {
pain_tors = 4;
life = life - _local4;
color_tors.setTransform(_root.light_orange);
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
tors.x = tors.x + (_root.p.x / 2000);
tors.y = tors.y + (_root.p.y / 2000);
} else if (pain_tors == 0) {
color_tors.setTransform(_root.white);
}
if ((life < (maxlife * 0.6)) && (!head_exploded)) {
sprite.head.head.play();
head_exploded = true;
_root.sound("snd_big_boom");
Gibs(head.x, head.y, 6);
_root.add_kill_bonus(2000);
} else if ((life < (maxlife * 0.3)) && (!tors_exploded)) {
sprite.tors.play();
tors_exploded = true;
_root.sound("snd_big_boom_debris");
Gibs(tors.x, tors.y, 7);
_root.add_kill_bonus(4000);
} else if ((life <= 0) && (!back_exploded)) {
sprite.back.play();
back_exploded = true;
_root.sound("snd_big_boom_debris");
Gibs(back.x, back.y, 8);
var _local3 = 0;
while (_local3 < foots.length) {
foots[_local3].UnFix();
_local3++;
}
head.UnFix();
tors.UnFix();
life = -100;
AddSpeed(0, -20, 4);
color_head.setTransform(_root.white);
color_tors.setTransform(_root.white);
_root.add_kill_bonus(10000);
}
}
function Update() {
var _local4 = 0;
landed = false;
var _local3 = 0;
while (_local3 < n_joints) {
objects[_local3].y = objects[_local3].y + _root.gravity_y;
objects[_local3].Update();
if (objects[_local3].collided == 3) {
landed = true;
}
_local4 = Math.max(_local4, objects[_local3].hit_f);
_local3++;
}
x = tors.x;
y = tors.y;
if ((activate_delay <= 0) && (life > 0)) {
var _local5 = _root.knight.getx() - x;
var _local6 = _root.knight.gety() - y;
var _local7 = dir;
dir = 0;
if (Math.abs(_local5) > 150) {
if (_local5 < 0) {
dir = -1;
} else {
dir = 1;
}
side = 1;
if (_local5 < 0) {
side = -1;
}
if (dir != _local7) {
StartWalk();
SetSide();
}
} else if (Math.abs(_local6) < 200) {
StartHit(_root.knight.getx(), _root.knight.gety());
}
Collisions();
Balance();
behavior();
Target(_root.knight.getx(), _root.knight.gety());
}
if (life <= 0) {
if ((on_die_delay < 0) && (on_die)) {
on_die();
on_die = 0;
}
on_die_delay--;
}
_local3 = n_joints;
while (_local3 < objects.length) {
objects[_local3].Update();
_local3++;
}
_local3 = n_joints;
while (_local3 < objects.length) {
objects[_local3].Render();
_local3++;
}
reloading--;
pain_head--;
pain_tors--;
activate_delay--;
if (reloading == (reload_time - 10)) {
head.UnFix();
tors.UnFix();
}
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
var _local2 = 0;
while (_local2 < objects.length) {
delete objects[_local2];
objects.splice(_local2, 1);
_local2++;
}
}
function Alive() {
return(life > -10000);
}
function InGame() {
if ((x + 100) < _root.left_border) {
return(false);
}
if ((x - 100) > _root.right_border) {
return(false);
}
if ((y + 100) < _root.top_border) {
return(false);
}
if ((y - 100) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
if (life > 0) {
return(true);
}
if (on_die) {
return(true);
}
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
function addv(vx, vy, rand) {
var _local2 = 0;
while (_local2 < 11) {
objects[_local2].x = objects[_local2].x + (vx + ((Math.random() - 0.5) * rand));
objects[_local2].y = objects[_local2].y + (vy + ((Math.random() - 0.5) * rand));
_local2++;
}
}
function getspeed() {
var _local3 = objects[6].x - objects[6].oldx;
var _local2 = objects[6].y - objects[6].oldy;
return(Math.sqrt((_local3 * _local3) + (_local2 * _local2)));
}
function point1() {
return(back);
}
function Pause() {
if (sprite.head._currentframe != 1) {
sprite.head.stop();
}
}
function UnPause() {
if (sprite.head._currentframe != 1) {
sprite.head.play();
}
}
static var reload_time = 60;
var maxlife = 3500;
}
Symbol 3239 MovieClip [__Packages.Fireball] Frame 0
class Fireball extends EnemyBullet
{
var sprite, InGame, life;
function Fireball (sprite_name, __x, __y, dir, speed, _damage, r, _force) {
super(sprite_name, __x, __y, dir, speed, _damage, r, _force);
}
function Alive() {
if (((sprite._currentframe == 33) || (!InGame())) || (life <= -10000)) {
return(false);
}
return(true);
}
}
Symbol 3240 MovieClip [__Packages.FallingTrain] Frame 0
class FallingTrain extends Spawner
{
var objects, x, y, id, sprite, life, n, train_speed, phase, exploded, stop_x, jump_x, loko_destroyed, camera_mode, train_sound, landed;
function FallingTrain (__x, __y) {
super(__x, __y);
objects = new Array();
x = __x;
y = __y;
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("falling_train", "train" + id, id + (_root.depth_band * 1));
sprite._x = x;
sprite._y = y;
sprite.gotoAndStop("idle");
sprite._visible = false;
life = 100;
var _local6 = 0.95;
n = 30;
var _local4 = 0;
while (_local4 < n) {
var _local5 = sprite["c" + _local4];
objects.push(new JointCBNF(_local5._x, _local5._y, 200, 10, "no"));
_local4++;
}
_local4 = 0;
while (_local4 < (n - 1)) {
var _local5 = sprite["c" + _local4];
objects.push(new LinkSprite(objects[_local4], objects[_local4 + 1], _local6, _local5));
if (_local4 < (n - 2)) {
objects.push(new Link(objects[_local4], objects[_local4 + 2], _local6 * 0.006));
}
_local4++;
}
_local4 = 0;
while (_local4 < n) {
objects[_local4].x = objects[_local4].x + x;
objects[_local4].y = objects[_local4].y + y;
objects[_local4].oldx = objects[_local4].oldx + x;
objects[_local4].oldy = objects[_local4].oldy + y;
_local4++;
}
sprite._x = 0;
sprite._y = 0;
_local4 = n;
while (_local4 < objects.length) {
objects[_local4].Render();
_local4++;
}
x = objects[1].x;
y = objects[1].y;
sprite._visible = true;
train_speed = 16;
_root.view_scale = 1000;
var _local7 = (-_root.level.camera_start._x) + (_root.w * 0.5);
var _local8 = (-_root.level.camera_start._y) + (_root.h * 0.5);
_root.View(_local7, _local8);
phase = 0;
exploded = false;
stop_x = _root.level.stop_engine._x;
jump_x = _root.level.jump_point._x;
loko_destroyed = false;
if (_root.persistent_buf.back0_x) {
_root.backgrounds[0].x = _root.persistent_buf.back0_x;
_root.backgrounds[1].x = _root.persistent_buf.back1_x;
_root.backgrounds[2].x = _root.persistent_buf.back2_x;
}
camera_mode = 0;
train_sound = new Sound(sprite);
train_sound.attachSound("snd_train_loop");
train_sound.start(0, 9999);
train_sound.setVolume(0);
_root.pause_possible = false;
}
function Update() {
landed = false;
x = objects[n - 2].x;
y = objects[n - 2].y;
_root.point_sound(train_sound, x, 40);
switch (camera_mode) {
case 0 :
_root.view_scale = _root.view_scale * 0.94;
if (_root.view_scale < 100) {
_root.view_scale = 100;
camera_mode = 1;
}
var _local5 = (-_root.level.camera_start._x) + (_root.w * 0.5);
var _local4 = (-_root.level.camera_start._y) + (_root.h * 0.5);
_root.SmoothView(_local5, _local4, 0.075, 0.95);
var _local3 = 0;
while (_local3 < n) {
objects[_local3].y = objects[_local3].y + (_root.gravity_y * 0.2);
objects[_local3].Update();
_local3++;
}
break;
case 1 :
_local3 = 0;
while (_local3 < n) {
objects[_local3].y = objects[_local3].y + (_root.gravity_y * 0.2);
objects[_local3].oldx = objects[_local3].x - train_speed;
objects[_local3].Update();
_local3++;
}
_local5 = (-x) + (_root.w * 0.5);
_local4 = (-y) + (_root.h * 0.5);
if (_local4 > -400) {
_local4 = -400;
}
_root.SmoothView(_local5, _local4, 0.065);
if ((!exploded) && (x > jump_x)) {
_root.level.rail_explode.play();
exploded = true;
}
if (x > stop_x) {
camera_mode = 2;
}
break;
case 2 :
_local3 = 0;
while (_local3 < n) {
objects[_local3].y = objects[_local3].y + (_root.gravity_y * 0.2);
objects[_local3].Update();
if (objects[_local3].x > stop_x) {
objects[_local3].level_fr = 0.5;
}
_local3++;
}
_local5 = (-x) + (_root.w * 0.5);
_local4 = (-y) + (_root.h * 0.5);
if (_local4 > -400) {
_local4 = -400;
}
_root.SmoothView(_local5, _local4, 0.075);
if ((!loko_destroyed) && (objects[n - 1].collided)) {
loko_destroyed = true;
train_sound.stop();
train_sound.setPan(0);
train_sound.setVolume(100);
sprite.c28.gotoAndPlay("destroyed");
}
if (phase <= 600) {
break;
}
_root.pause_possible = true;
_root.menu_controller.NextLevel("level4");
}
_local3 = n;
while (_local3 < objects.length) {
objects[_local3].Update();
_local3++;
}
_local3 = n;
while (_local3 < objects.length) {
objects[_local3].Render();
_local3 = _local3 + 2;
}
phase++;
}
function Alive() {
return(life > -10000);
}
function Freeze() {
if (life > 0) {
return(true);
}
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
}
Symbol 3241 MovieClip [__Packages.JointCBNF] Frame 0
class JointCBNF extends JointCollideBounce
{
var level_fr, oldx, x, oldy, y, aabb, collided, hit_f, collided_brick, sprite, Update;
function JointCBNF (__x, __y, _mass, _r, spritename, _level_fr) {
super(__x, __y, _mass, _r, spritename);
if (!_level_fr) {
_level_fr = 0;
}
level_fr = _level_fr;
}
function UpdatePhysics() {
var _local4 = x - oldx;
var _local3 = y - oldy;
oldx = x;
oldy = y;
_local4 = _root.limit(_local4, -40, 40);
_local3 = _root.limit(_local3, -40, 40);
x = x + _local4;
y = y + _local3;
aabb.x = x + aabb.dx;
aabb.y = y + aabb.dy;
collided = 0;
hit_f = 0;
if (_root.collide(aabb)) {
x = x + _root.p.x;
if (_local3 < -1) {
if (_root.collided_brick instanceof Platform) {
_root.p.y = 0;
}
}
if ((_root.p.y * _local3) < 0) {
y = y + _root.p.y;
} else {
y = y + _root.p.y;
oldy = oldy + _root.p.y;
}
if (_root.p.y != 0) {
x = _root.interpolate(x, oldx, level_fr);
if (_root.p.y < 0) {
collided = 3;
} else {
collided = 1;
}
collided_brick = _root.collided_brick;
y = y - (_local3 * 0.65);
hit_f = hit_f + Math.abs(_local3);
} else if (_root.p.x != 0) {
if (_root.p.x < 0) {
collided = 2;
} else {
collided = 4;
}
collided_brick = _root.collided_brick;
x = x - (_local4 * 0.65);
hit_f = hit_f + Math.abs(_local4);
}
}
if (sprite) {
sprite._x = x;
sprite._y = y;
}
}
function Fixed() {
x = oldx;
y = oldy;
}
function Fix() {
Update = Fixed;
}
function UnFix() {
Update = UpdatePhysics;
}
}
Symbol 3242 MovieClip [__Packages.Trajectory] Frame 0
class Trajectory extends Obj
{
var sprite, objects, current;
function Trajectory (_sprite, __name) {
super();
sprite = _sprite;
var _local5 = 0;
objects = new Array();
while (true) {
var _local3 = sprite["p" + _local5];
if (!_local3) {
break;
}
var _local4 = new Object();
_local4.x = _local3._x + sprite._x;
_local4.y = _local3._y + sprite._y;
objects.push(_local4);
_local5++;
}
current = 0;
}
function GetY(x) {
if (x < objects[current].x) {
do {
if (current <= 0) {
break;
}
current--;
} while (x <= objects[current].x);
} else if (x > objects[current + 1].x) {
do {
if (current >= (objects.length - 2)) {
break;
}
current++;
} while (x >= objects[current + 1].x);
}
var _local4 = x - objects[current].x;
var _local5 = objects[current + 1].x - objects[current].x;
_local4 = _root.limit(_local4 / _local5, 0, 1);
return(_root.interpolate(objects[current].y, objects[current + 1].y, _local4));
}
}
Symbol 3243 MovieClip [__Packages.Crane] Frame 0
class Crane extends Spawner
{
var x, y, joint, life, damage, destx, sx, sy, hammer_dx, aabb, pain, _mode, phase, AddEvent, hammer_on, hammer_vx, type, WaitUntilDie, strela_playing, sprite, UpdateEvents, spawned_objs, hammer, hammer_sound, link1, link2, cable, color, motor_sound, cart, cable_length, SpawnObj;
function Crane (__x, __y, _type) {
super();
x = __x;
y = __y;
joint = new Joint(x, y, 100000);
life = max_life;
damage = 0;
destx = x;
sx = 0;
sy = 0;
hammer_dx = -300;
aabb = new Object();
aabb.w = 70;
aabb.h = 186;
aabb.x = x - 4;
aabb.y = y + 3;
aabb.dx = 0;
aabb.dy = 0;
pain = 0;
_mode = 0;
phase = 0;
_mode = -1;
AddEvent(NextMode);
hammer_on = true;
hammer_vx = 0;
type = _type;
if (!type) {
type = 1;
}
if (type == 1) {
WaitUntilDie(true);
}
if (type == 2) {
max_life = (life = 2400);
}
strela_playing = false;
}
function NextMode(sp) {
sp._mode++;
}
function Update() {
if (!sprite) {
return(undefined);
}
StrelaPos();
UpdateEvents();
var _local3 = 0;
while (_local3 < spawned_objs.length) {
if (spawned_objs[_local3].x > ((x + sprite.spawn2._x) + 25)) {
spawned_objs[_local3].x = (x + sprite.spawn2._x) + 25;
}
_local3++;
}
joint.x = (joint.oldx = sx);
joint.y = (joint.oldy = sy - 5);
if ((sprite.ready && (life > 0)) && (hammer_on)) {
sprite.strela.play();
strela_playing = true;
} else {
strela_playing = false;
sprite.strela.stop();
}
if (life > 0) {
switch (_mode) {
case 0 :
if (_root.knight.getx() > (x - 400)) {
_mode = 1;
phase = 0;
if (type == 1) {
_root.view_scale = 75;
}
}
break;
case 1 :
if (phase > 100) {
sprite.play();
_mode = 2;
phase = 0;
}
break;
case 2 :
if (phase > 100) {
_mode = 3;
phase = 0;
if (type == 1) {
_root.view_scale = 100;
}
}
break;
case 3 :
if (phase == 200) {
_mode = 4;
AddEvent(NextMode);
SpawnMan((x + sprite.spawn2._x) - 20, y + sprite.spawn2._y, 2, 40, 32, 1).MoveDX(-280);
SpawnMan(x + sprite.spawn2._x, y + sprite.spawn2._y, 2, 40, 32, 1).MoveDX(-280);
SpawnMan((x + sprite.spawn2._x) + 20, y + sprite.spawn2._y, 2, 40, 32, 1).MoveDX(-280);
hammer_on = false;
sprite.strela.stop();
strela_playing = false;
_root.sound("snd_klaxon");
}
break;
case 4 :
phase = 0;
break;
case 5 :
if (phase <= 20) {
break;
}
_mode = 3;
phase = 0;
hammer_on = true;
}
}
phase++;
hammer.y = hammer.y + _root.gravity_y;
hammer.Update();
if (hammer.hit_f > 10) {
var _local7 = _root.limit((hammer.hit_f - 5) * 10, 10, 100);
_root.point_sound(hammer_sound, hammer.x, _local7);
hammer_sound.start();
}
if (life > 0) {
var _local4 = _root.knight.getx() - hammer.x;
if (Math.abs(hammer.x - hammer.oldx) > 2) {
if ((_root.knight.pain <= 0) && ((_local4 * (hammer.x - hammer.oldx)) > 0)) {
if (_root.CollideKnight(hammer.aabb)) {
if (_root.knight instanceof Hero) {
_root.sound("snd_hit");
if (_local4 > 0) {
_root.DamageKnight(10, 20, 0);
} else {
_root.DamageKnight(10, -20, 0);
}
_root.knight.pain = 20;
}
if (_root.knight instanceof Raptor) {
if (_local4 > 0) {
_root.DamageKnight(30, 20, 0);
} else {
_root.DamageKnight(30, -20, 0);
}
_root.knight.pain = 15;
_root.sound("snd_metal_hit");
}
}
}
}
}
link1.Update();
link2.Update();
cable.Update();
if (cable.hanging) {
_root.knight.unhang();
}
link2.Render();
if (life > 0) {
var _local5 = _root.CollideBullets(aabb);
if (_local5 > 0) {
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
color.setTransform(_root.light_orange);
pain = 2;
life = life - _local5;
if ((life < (max_life * 0.7)) && (damage <= 0)) {
sprite.door.gotoAndPlay("damage1");
damage = 1;
gibs();
_root.add_score(100);
}
if ((life < (max_life * 0.4)) && (damage <= 1)) {
sprite.door.gotoAndPlay("damage2");
damage = 2;
gibs();
_root.add_score(200);
}
if ((life <= 0) && (damage <= 2)) {
if (type == 1) {
sprite.door.gotoAndPlay("die");
var _local6 = new Enemy(x + 125, y + 100, "human", 1, 32, 60, 2, 6);
_local6.UnFreeze();
_root.objects.push(_local6);
}
if (type == 2) {
sprite.door.gotoAndPlay("die2");
sprite.gotoAndPlay("die");
if (_root.knight instanceof Raptor) {
_root.knight.right_bound = _root.level.raptor_right_bound2._x;
}
}
damage = 3;
gibs();
color.setTransform(_root.white);
sprite.operator.stop();
sprite.operator._visible = false;
_root.add_score(4000);
}
} else if (pain == 0) {
color.setTransform(_root.white);
}
pain--;
}
}
function StrelaPos() {
_root.p.x = sprite.strela.cart._x;
_root.p.y = sprite.strela.cart._y;
_root.p = sprite.strela.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
sx = _root.p.x;
sy = _root.p.y;
}
function Kill() {
motor_sound.stop();
joint.Kill();
cable.Kill();
removeMovieClip(sprite);
life = -100000;
}
function Alive() {
return(life > -10000);
}
function InGame() {
if ((x + 300) < _root.left_border) {
return(false);
}
if ((x - 300) > _root.right_border) {
return(false);
}
if ((y + 200) < _root.top_border) {
return(false);
}
if ((y - 200) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
sprite._visible = false;
}
function UnFreeze() {
if (!sprite) {
var _local3 = _root.get_id();
var _local5 = 3;
var _local4;
if (type == 1) {
_local4 = "crane2";
}
if (type == 2) {
_local4 = "crane3";
}
sprite = _root.objects_layer.attachMovie(_local4, "crn" + _local3, _local3 + (_root.depth_band * _local5));
sprite._x = x;
sprite._y = y;
cart = sprite.strela.cart;
color = new Color(sprite.door);
cable_length = 8;
cable = new CableDoubleAnchor(x, y, "spike_chain", cable_length, _root.gravity_y, 0, 0, 2);
cable.anchor1 = 0;
cable.anchor2 = 0;
cable.UnFreeze();
hammer = new JointCBLF(x - 100, y + 200, 1000, 36, "no");
link1 = new Link(joint, cable.objects[0], 0.9);
link1.r = 5;
link2 = new LinkSprite(hammer, cable.objects[cable_length], 0.9, cable.sprite.c8);
link2.r = 55;
hammer_sound = new Sound(cable.sprite);
hammer_sound.attachSound("snd_metal_hit");
if (type == 1) {
SpawnMan((x + sprite.spawn1._x) - 50, y + sprite.spawn1._y, 2, 60, 22, 1);
SpawnMan(x + sprite.spawn1._x, y + sprite.spawn1._y, 2, 60, 22, 1);
SpawnMan((x + sprite.spawn1._x) + 50, y + sprite.spawn1._y, 2, 60, 22, 2);
}
}
sprite._visible = true;
}
function gibs() {
var _local3 = aabb.y;
while (_local3 < (aabb.y + aabb.w)) {
_root.objects.push(new SpinningGib("metal_gibs", x + 30, _local3, random(180) + 90, 15, 10, random(8) + 20, 4));
_local3 = _local3 + 20;
}
}
function SpawnMan(__x, __y, wpn, _life, _skin, bhv) {
var _local2 = new Enemy(__x, __y, "human", wpn, _skin, _life, bhv, 6);
SpawnObj(_local2);
return(_local2);
}
function Pause() {
switch (sprite._currentframe) {
case 1 :
case 40 :
case 115 :
break;
default :
sprite.stop();
}
switch (sprite.door._currentframe) {
case 1 :
case 13 :
case 25 :
case 57 :
case 90 :
break;
default :
sprite.door.stop();
}
if (sprite.operator) {
sprite.operator.stop();
}
if (strela_playing) {
sprite.strela.stop();
}
}
function UnPause() {
switch (sprite._currentframe) {
case 1 :
case 40 :
case 115 :
break;
default :
sprite.play();
}
switch (sprite.door._currentframe) {
case 1 :
case 13 :
case 25 :
case 57 :
case 90 :
break;
default :
sprite.door.play();
}
if (sprite.operator) {
sprite.operator.play();
}
if (strela_playing) {
sprite.strela.play();
}
}
var min_x = -540;
var max_x = -120;
var max_life = 1800;
}
Symbol 3244 MovieClip [__Packages.Damager] Frame 0
class Damager extends Obj
{
var sprite, aabb, x, y, delay;
function Damager (_sprite, _delay, _dx, _dy) {
super();
sprite = _sprite;
if (_dx == undefined) {
_dx = 0;
}
if (_dy == undefined) {
_dy = 0;
}
aabb = new Object();
aabb.w = sprite._width;
aabb.h = sprite._height;
aabb.x = sprite._x;
aabb.y = sprite._y;
aabb.dx = _dx;
aabb.dy = _dy;
x = sprite._x;
y = sprite._y;
delay = _delay;
sprite._visible = false;
}
function Update() {
x = sprite._x;
y = sprite._y;
if (((_root.knight.pain < 0) && (delay <= 0)) && (sprite.ready)) {
_root.p.x = sprite.damage._x;
_root.p.y = sprite.damage._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
aabb.w = sprite.damage._width;
aabb.h = sprite.damage._height;
aabb.x = _root.p.x + aabb.dx;
aabb.y = _root.p.y + aabb.dy;
if (_root.CollideKnight(aabb)) {
var _local3 = -10;
if (_root.knight.getx() > x) {
_local3 = -_local3;
}
_root.DamageKnight(10, _local3, -10);
}
}
delay--;
if (delay == 0) {
sprite.play();
}
}
function Freeze() {
sprite._visible = false;
sprite.gotoAndStop(2);
}
function UnFreeze() {
sprite._visible = true;
if (delay <= 0) {
sprite.play();
}
}
function Alive() {
return(true);
}
function Pause() {
sprite.stop();
}
function UnPause() {
sprite.play();
}
}
Symbol 3245 MovieClip [__Packages.Bike] Frame 0
class Bike extends Spawner
{
var x, y, life, j1, j2, inert, damage, side, dir, destx, desty, shift_reloading, shiftx, shifty, phase, reloading, jet13_angle, jet24_angle, behavior, target_dir, motion_speed, passenger, on_die, rockets_launched, follow_trajectory, collided_time, falltime, Delay, AddEvent, sprite, jet_sound, UpdateEvents, l1, pain, color, events, spawned_objs;
function Bike (__x, __y, sequence, _on_die) {
super();
x = __x;
y = __y;
life = max_life;
j1 = new JointCBLF(x, y, 2000, 30, "no");
j1.aabb.w = 90;
j1.aabb.h = 60;
j1.aabb.dx = -45;
j1.aabb.dy = -30;
j2 = new JointCBLF(x + 105, y, 2000, 30, "no");
j2.aabb.w = 90;
j2.aabb.h = 60;
j2.aabb.dx = -45;
j2.aabb.dy = -30;
inert = 0.1 / j1.mass;
damage = 0;
side = -1;
dir = 0;
destx = x;
desty = y;
shift_reloading = 0;
shiftx = 0;
shifty = 0;
phase = 0;
reloading = 50;
jet13_angle = (jet24_angle = 0);
switch (sequence) {
case 1 :
LoadSequence1();
break;
case 2 :
LoadSequence2();
break;
case 3 :
LoadSequenceDropShot();
break;
case 4 :
LoadSequenceDropRocket();
break;
case 5 :
LoadSequenceGun();
}
behavior = stand;
target_dir = 0;
motion_speed = 1;
passenger = false;
on_die = _on_die;
rockets_launched = 0;
follow_trajectory = 0;
collided_time = 0;
falltime = 200;
}
function LoadSequenceDropShot(sp) {
if (!sp) {
sp = this;
}
sp.__load_sequence_drop_shot();
sp.behavior = sp.stand;
}
function __load_sequence_drop_shot() {
Delay(40);
AddEvent(LoadPassenger);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackPassenger);
AddEvent(LoadDropPassenger);
AddEvent(LoadRun);
AddEvent(LoadPassenger);
AddEvent(LoadArriveAttackGun);
AddEvent(LoadAttackGunUp);
AddEvent(LoadAttackGunDown);
AddEvent(LoadDropPassenger);
AddEvent(LoadRun);
AddEvent(LoadSequenceDropShot);
}
function LoadSequenceDropRocket(sp) {
if (!sp) {
sp = this;
}
sp.__load_sequence_rocket_drop();
sp.behavior = sp.stand;
}
function __load_sequence_rocket_drop() {
Delay(40);
AddEvent(LoadPassenger);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackPassenger);
AddEvent(LoadAttackRocket);
AddEvent(LoadDropPassenger);
AddEvent(LoadRun);
AddEvent(LoadPassenger);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackRocket);
AddEvent(LoadAttackPassenger);
AddEvent(LoadDropPassenger);
AddEvent(LoadRun);
AddEvent(LoadSequenceDropRocket);
}
function LoadSequenceGun(sp) {
if (!sp) {
sp = this;
}
sp.__load_sequence_gun();
sp.behavior = sp.stand;
}
function __load_sequence_gun() {
Delay(40);
AddEvent(LoadPassenger);
AddEvent(LoadArriveAttackGun);
AddEvent(LoadAttackGunUp);
AddEvent(LoadAttackGunUp);
AddEvent(LoadDropPassenger);
AddEvent(LoadRun);
AddEvent(LoadPassenger);
AddEvent(LoadFindPlayer);
AddEvent(LoadArriveAttackGun);
AddEvent(LoadAttackGunDown);
AddEvent(LoadDropPassenger);
AddEvent(LoadRun);
AddEvent(LoadSequenceGun);
}
function motion() {
var _local16 = (((j1.x - j1.oldx) + j2.x) - j2.oldx) * 0.5;
var _local15 = (((j1.y - j1.oldy) + j2.y) - j2.oldy) * 0.5;
if (collided_time < 0) {
if ((((j1.collided == 2) || (j1.collided == 4)) || (j2.collided == 2)) || (j2.collided == 4)) {
collided_time = 30;
}
}
var _local10 = destx - (x + (_local16 * 10));
var _local13 = desty - (y + (_local15 * 10));
if (collided_time > 10) {
_local10 = 0;
}
var _local8 = j2.x - j1.x;
var _local9 = -(j2.y - j1.y);
var _local14 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
_local9 = _local9 / _local14;
_local8 = _local8 / _local14;
var _local5;
var _local4;
var _local7;
var _local6;
_local4 = _root.limit(_local13 - (10 * _root.sgn(_local13)), -200, 200) / 120;
if (Math.abs(_local13) < 10) {
_local4 = (-_root.gravity_y) * 0.5;
}
_local6 = _local4;
_local5 = (_root.limit(_local10 - (20 * _root.sgn(_local10)), -200, 200) / 120) * motion_speed;
if (Math.abs(_local10) < 20) {
_local5 = 0;
}
_local7 = _local5;
var _local3;
if (!target_dir) {
_local3 = ((_local5 + _local7) * 5) - sprite._rotation;
while (_local3 > 180) {
_local3 = _local3 - 360;
}
while (_local3 < -180) {
_local3 = _local3 + 360;
}
if ((_local3 < -10) || (_local3 > 10)) {
_local3 = _local3 - (10 * _root.sgn(_local3));
_local3 = _root.limit(_local3, -60, 60) / 50;
_local4 = _local4 - (_local8 * _local3);
_local5 = _local5 - (_local9 * _local3);
_local6 = _local6 + (_local8 * _local3);
_local7 = _local7 + (_local9 * _local3);
}
} else {
_local3 = target_dir - sprite._rotation;
while (_local3 > 180) {
_local3 = _local3 - 360;
}
while (_local3 < -180) {
_local3 = _local3 + 360;
}
_local3 = _root.limit(_local3, -60, 60) / 25;
_local4 = _local4 - (_local8 * _local3);
_local5 = _local5 - (_local9 * _local3);
_local6 = _local6 + (_local8 * _local3);
_local7 = _local7 + (_local9 * _local3);
}
if (_local4 > 0) {
_local4 = 0;
}
if (_local6 > 0) {
_local6 = 0;
}
j1.x = j1.x + _local5;
j1.y = j1.y + _local4;
j2.x = j2.x + _local7;
j2.y = j2.y + _local6;
j1.oldx = _root.interpolate(j1.oldx, j1.x, 0.01);
j2.oldx = _root.interpolate(j2.oldx, j2.x, 0.01);
jet13_angle = _root.interpolate_angle(jet13_angle, ((Math.atan2(-_local4, -_local5) * _root.radtodeg) + (_local5 * 10)) + _root.level_vx, 0.1);
jet24_angle = _root.interpolate_angle(jet24_angle, ((Math.atan2(-_local6, -_local7) * _root.radtodeg) + (_local7 * 10)) + _root.level_vx, 0.1);
if (side > 0) {
sprite.jet1._rotation = (sprite.jet3._rotation = ((180 - jet13_angle) + sprite._rotation) + 20);
sprite.jet2._rotation = (sprite.jet4._rotation = ((180 - jet24_angle) + sprite._rotation) - 20);
} else {
sprite.jet1._rotation = (sprite.jet3._rotation = (jet13_angle - sprite._rotation) + 20);
sprite.jet2._rotation = (sprite.jet4._rotation = (jet24_angle - sprite._rotation) - 20);
}
var _local12 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
_local12 = _root.interpolate(sprite.jet1._xscale, _root.limit(_local12 * 200, 60, 100), 0.1);
sprite.jet1._xscale = _local12;
sprite.jet3._xscale = _local12;
var _local11 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
_local11 = _root.interpolate(sprite.jet2._xscale, _root.limit(_local11 * 200, 60, 100), 0.1);
sprite.jet2._xscale = _local11;
sprite.jet4._xscale = _local11;
_root.point_sound(jet_sound, x, 100);
}
function stand() {
UpdateEvents();
}
function wait_until_find() {
var _local3 = _root.knight.getx() + shiftx;
var _local4 = _root.knight.gety() + shifty;
destx = _local3;
desty = _local4;
var _local5 = _root.persistent_buf.aircraft_trajectory.GetY(x);
if (Math.abs(x - _local3) > 100) {
desty = _local5;
if ((y - _local5) > 100) {
destx = x + (side * 30);
return(undefined);
}
}
if ((Math.abs(x - _local3) < 100) && (Math.abs((y - 50) - _local4) < 100)) {
behavior = stand;
} else if (sprite.hand) {
sprite.hand.gotoAndStop(3);
}
}
function run() {
destx = ((_root.left_border + _root.right_border) * 0.5) + (side * 1800);
desty = _root.persistent_buf.aircraft_trajectory.GetY(x);
if (Math.abs(x - destx) < 100) {
behavior = stand;
SetSide(_root.sgn(_root.knight.getx() - x));
}
}
function attack_passenger() {
var _local6 = _root.knight.getx();
var _local5 = _root.knight.gety();
destx = (_local6 - (100 * side)) + shiftx;
if (_root.knight.landed) {
desty = (_local5 - 250) + shifty;
}
var _local3;
if (side < 0) {
_local3 = sprite.hand._rotation;
} else {
_local3 = 180 - sprite.hand._rotation;
}
_root.p.x = sprite.hand._x;
_root.p.y = sprite.hand._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local4 = _root.direct_knight(_root.p.x, _root.p.y);
if ((_local4 - _local3) > 180) {
_local4 = _local4 - 360;
} else if ((_local4 - _local3) < -180) {
_local4 = _local4 + 360;
}
_local3 = _root.interpolate(_local3, _local4, 0.06);
if (side < 0) {
sprite.hand._rotation = _local3;
} else {
sprite.hand._rotation = 180 - _local3;
}
if ((shift_reloading <= 0) && (reloading > 20)) {
shiftx = random(400) - 200;
shifty = random(70) - 35;
shift_reloading = random(100);
}
shift_reloading--;
reloading--;
UpdateEvents();
if ((!sprite.hand.ready) || (reloading > 15)) {
return(undefined);
}
if ((reloading % 5) == 0) {
_root.p.x = sprite.hand.barrel._x;
_root.p.y = sprite.hand.barrel._y;
_root.p = sprite.hand.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
_root.objects.push(new EnemyBullet("pistol_bullet", _root.p.x, _root.p.y, _local3 + sprite._rotation, 16, 10, 6, 5));
sprite.hand.play();
_root.sound_mc_point("snd_smg", sprite.hand, _root.p.x, 100);
}
if (reloading < 0) {
reloading = 50 + random(30);
}
}
function attack_gun() {
_root.p.x = sprite.gun._x;
_root.p.y = sprite.gun._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
destx = _root.knight.getx() + shiftx;
if (_root.knight.landed) {
desty = _root.knight.gety() + shifty;
}
target_dir = 0.1;
if ((Math.abs((y - 60) - desty) > 40) && (phase == 0)) {
return(undefined);
}
if (phase == 0) {
sprite.gun.gotoAndPlay("shot");
}
phase++;
if (sprite.gun.shots < 9) {
if (sprite.gun.ready) {
_root.p.x = sprite.gun.barrel._x;
_root.p.y = sprite.gun.barrel._y;
_root.p = sprite.gun.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
if (side > 0) {
_root.objects.push(new EnemyBullet("pistol_bullet", _root.p.x, _root.p.y, sprite._rotation, 16, 10, 6, 5));
} else {
_root.objects.push(new EnemyBullet("pistol_bullet", _root.p.x, _root.p.y, sprite._rotation + 180, 16, 10, 6, 5));
}
_root.sound_mc_point("snd_smg", sprite.gun, _root.p.x, 100);
j1.x = j1.x - (side * 2);
j2.x = j2.x - (side * 2);
}
} else {
sprite.gun.gotoAndStop("idle");
behavior = stand;
UpdateEvents();
target_dir = 0;
}
}
function attack_gun_up() {
_root.p.x = sprite.gun._x;
_root.p.y = sprite.gun._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
destx = _root.knight.getx() + shiftx;
if (_root.knight.landed) {
desty = _root.knight.gety() + shifty;
}
target_dir = 25 * side;
phase++;
if (phase < 50) {
return(undefined);
}
if (phase == 50) {
sprite.gun.gotoAndPlay("shot");
}
if (sprite.gun.shots < 9) {
if (sprite.gun.ready) {
_root.p.x = sprite.gun.barrel._x;
_root.p.y = sprite.gun.barrel._y;
_root.p = sprite.gun.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
if (side > 0) {
_root.objects.push(new EnemyBullet("pistol_bullet", _root.p.x, _root.p.y, sprite._rotation, 16, 10, 6, 5));
} else {
_root.objects.push(new EnemyBullet("pistol_bullet", _root.p.x, _root.p.y, sprite._rotation + 180, 16, 10, 6, 5));
}
_root.sound_mc_point("snd_smg", sprite.gun, _root.p.x, 100);
j1.x = j1.x - (side * 2);
j2.x = j2.x - (side * 2);
}
} else {
sprite.gun.gotoAndStop("idle");
behavior = stand;
UpdateEvents();
target_dir = 0;
}
}
function attack_rocket() {
_root.p.x = sprite.gun._x;
_root.p.y = sprite.gun._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
destx = _root.knight.getx() + shiftx;
if (_root.knight.landed) {
desty = _root.knight.gety() + shifty;
}
if (follow_trajectory <= 0) {
if ((y < (_root.top_border + 30)) && (phase == 0)) {
return(undefined);
}
} else if ((Math.abs((y - 60) - desty) > 40) && (phase == 0)) {
return(undefined);
}
if (phase == 0) {
sprite.rocket.gotoAndPlay("shot");
}
phase++;
if (sprite.rocket.ready) {
_root.p.x = sprite.rocket.barrel._x;
_root.p.y = sprite.rocket.barrel._y;
_root.p = sprite.rocket.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
if (side > 0) {
_root.PushObject(new BigRocket(_root.p.x, _root.p.y, sprite._rotation + 24, 10, 30, 50));
} else {
_root.PushObject(new BigRocket(_root.p.x, _root.p.y, sprite._rotation + 156, 10, 30, 50));
}
j1.x = j1.x - (side * 2);
j2.x = j2.x - (side * 2);
}
UpdateEvents();
}
function LoadFindPlayer(sp) {
if (!sp) {
sp = this;
}
sp.behavior = sp.wait_until_find;
if (_root.knight instanceof Hero) {
sp.shiftx = (-sp.side) * 100;
sp.shifty = -200;
sp.Delay(30);
} else if (_root.knight instanceof Raptor) {
sp.shiftx = (-sp.side) * 400;
sp.shifty = -100;
sp.Delay(30);
}
}
function LoadPassenger(sp) {
if (!sp) {
sp = this;
}
sp.sprite.gotoAndStop("passenger");
for (var _local3 in sp.sprite.hand) {
sp.sprite.hand[_local3].gotoAndStop(30);
}
sp.shift_reloading = 0;
sp.sprite.hand.gotoAndStop(2);
sp.phase = 0;
sp.reloading = 30;
sp.behavior = sp.stand;
sp.passenger = true;
}
function LoadDropPassenger(sp) {
if (!sp) {
sp = this;
}
sp.sprite.gotoAndStop("single");
sp.WaitUntilDie(false);
sp.SpawnMan(2, 80, 30, 4);
sp.behavior = sp.stand;
sp.Delay(40);
sp.passenger = false;
}
function LoadRun(sp) {
if (!sp) {
sp = this;
}
sp.behavior = sp.run;
}
function LoadAttackPassenger(sp) {
if (!sp) {
sp = this;
}
sp.behavior = sp.attack_passenger;
sp.Delay(200);
sp.sprite.hand.gotoAndPlay("smg_start");
}
function LoadArriveAttackGun(sp) {
if (!sp) {
sp = this;
}
sp.behavior = sp.wait_until_find;
if (_root.knight instanceof Hero) {
sp.shiftx = -300 * sp.side;
sp.shifty = -200;
} else if (_root.knight instanceof Raptor) {
sp.shiftx = (-sp.side) * 400;
sp.shifty = -100;
sp.Delay(30);
}
sp.Delay(30);
rockets_launched = 0;
}
function LoadAttackGunDown(sp) {
if (!sp) {
sp = this;
}
if (sp.damage >= 4) {
if (sp.rockets_launched <= 1) {
sp.LoadAttackRocket(sp);
sp.rockets_launched++;
} else {
sp.behavior = sp.stand;
}
return(undefined);
}
sp.behavior = sp.attack_gun;
sp.Delay(40);
sp.phase = 0;
if (_root.knight instanceof Hero) {
sp.shiftx = -250 * sp.side;
sp.shifty = -60;
} else if (_root.knight instanceof Raptor) {
sp.shiftx = (-sp.side) * 400;
sp.shifty = -10;
sp.Delay(30);
}
}
function LoadAttackGunUp(sp) {
if (!sp) {
sp = this;
}
if (sp.damage >= 4) {
if (sp.rockets_launched <= 1) {
sp.LoadAttackRocket(sp);
sp.rockets_launched++;
} else {
sp.behavior = sp.stand;
}
return(undefined);
}
sp.behavior = sp.attack_gun_up;
sp.Delay(40);
sp.phase = 0;
if (_root.knight instanceof Hero) {
sp.shiftx = -250 * sp.side;
sp.shifty = -300;
}
}
function LoadAttackRocket(sp) {
if (!sp) {
sp = this;
}
sp.behavior = sp.attack_rocket;
sp.Delay(50);
sp.phase = 0;
if (_root.knight instanceof Hero) {
sp.shiftx = -250 * sp.side;
sp.shifty = -340;
} else if (_root.knight instanceof Raptor) {
sp.shiftx = (-sp.side) * 400;
sp.shifty = -200;
sp.Delay(30);
}
}
function LoadSequence1(sp) {
if (!sp) {
sp = this;
}
sp.__load_sequence1();
sp.behavior = sp.stand;
}
function LoadSequence2(sp) {
if (!sp) {
sp = this;
}
sp.__load_sequence2();
sp.behavior = sp.stand;
}
function __load_sequence1() {
Delay(40);
AddEvent(LoadPassenger);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackPassenger);
AddEvent(LoadRun);
AddEvent(LoadPassenger);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackPassenger);
AddEvent(LoadDropPassenger);
AddEvent(LoadRun);
AddEvent(LoadArriveAttackGun);
AddEvent(LoadAttackGunUp);
AddEvent(LoadAttackGunDown);
AddEvent(LoadAttackGunDown);
AddEvent(LoadRun);
AddEvent(LoadPassenger);
AddEvent(LoadFindPlayer);
AddEvent(LoadDropPassenger);
AddEvent(LoadRun);
AddEvent(LoadArriveAttackGun);
AddEvent(LoadAttackGunDown);
AddEvent(LoadAttackGunDown);
AddEvent(LoadAttackGunUp);
AddEvent(LoadAttackGunUp);
AddEvent(LoadRun);
AddEvent(LoadPassenger);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackPassenger);
AddEvent(LoadDropPassenger);
AddEvent(LoadRun);
AddEvent(LoadFindPlayer);
AddEvent(LoadDropPassenger);
AddEvent(LoadRun);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackRocket);
AddEvent(LoadRun);
AddEvent(LoadSequence1);
}
function __load_sequence2() {
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackRocket);
AddEvent(LoadRun);
AddEvent(LoadPassenger);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackRocket);
AddEvent(LoadRun);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackRocket);
AddEvent(LoadAttackPassenger);
AddEvent(LoadDropPassenger);
AddEvent(LoadRun);
AddEvent(LoadArriveAttackGun);
AddEvent(LoadAttackGunUp);
AddEvent(LoadAttackGunDown);
AddEvent(LoadRun);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackRocket);
AddEvent(LoadAttackGunUp);
AddEvent(LoadAttackGunUp);
AddEvent(LoadAttackGunDown);
AddEvent(LoadAttackRocket);
AddEvent(LoadRun);
AddEvent(LoadPassenger);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackRocket);
AddEvent(LoadDropPassenger);
AddEvent(LoadRun);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackRocket);
AddEvent(LoadAttackRocket);
AddEvent(LoadRun);
AddEvent(LoadPassenger);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackGunUp);
AddEvent(LoadAttackRocket);
AddEvent(LoadAttackPassenger);
AddEvent(LoadAttackPassenger);
AddEvent(LoadRun);
AddEvent(LoadFindPlayer);
AddEvent(LoadDropPassenger);
AddEvent(LoadAttackRocket);
AddEvent(LoadRun);
AddEvent(LoadFindPlayer);
AddEvent(LoadAttackRocket);
AddEvent(LoadRun);
AddEvent(LoadSequence2);
}
function Update() {
x = (j1.x + j2.x) * 0.5;
y = (j1.y + j2.y) * 0.5;
if (life > 0) {
behavior();
motion();
}
j1.y = j1.y + _root.gravity_y;
j2.y = j2.y + _root.gravity_y;
j1.Update();
j2.Update();
l1.Update();
l1.Render();
if (side > 0) {
sprite._rotation = sprite._rotation - 180;
}
var _local8 = j1.hit_f + j2.hit_f;
if (_local8 > 8) {
var _local6 = _root.limit((_local8 - 5) * 10, 10, 100);
if (life > 0) {
_root.sound_mc_point("snd_metal_hit", sprite.jet3, x, _local6);
} else {
_root.sound_mc_point("snd_metal_crash", sprite.jet3, x, _local6 * 0.5);
}
}
if (life < 0) {
falltime--;
if (_root.ragdolls_free) {
j1.x = j1.x + _root.ragdolls_free;
j2.x = j2.x + _root.ragdolls_free;
} else if (((falltime < 0) && (j1.collided == 3)) && (j2.collided == 3)) {
Update = UpdateStatic;
}
return(undefined);
}
if ((j1.collided == 3) || (j2.collided == 3)) {
desty = desty - 5;
}
var _local3 = _root.CollideBullets(j1.aabb);
if (_local3 > 0) {
pain = 2;
var _local4 = _local3 * 0.1;
if (_local4 > 3) {
_local4 = 3;
}
_local4 = _local4 * inert;
_root.p.x = _root.p.x * _local4;
_root.p.y = _root.p.y * _local4;
AddSpeed(_root.p.x, _root.p.y);
life = life - _local3;
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
color.setTransform(_root.light_orange);
}
if (!_local3) {
_local3 = _root.CollideBullets(j2.aabb);
if (_local3 > 0) {
pain = 2;
var _local4 = _local3 * 0.1;
if (_local4 > 3) {
_local4 = 3;
}
_local4 = _local4 * inert;
_root.p.x = _root.p.x * _local4;
_root.p.y = _root.p.y * _local4;
AddSpeed(_root.p.x, _root.p.y);
life = life - _local3;
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
color.setTransform(_root.light_orange);
}
}
var _local7 = _root.p.x * 2;
var _local5 = _root.p.y * 2;
if ((!_local3) && (pain == 0)) {
color.setTransform(_root.white);
}
if (damage > 0) {
gibs();
}
sprite.beam._visible = true;
if (damage > 1) {
if (random(100) < 5) {
sprite.beam._visible = false;
}
}
if ((life < (max_life * 0.8)) && (damage < 1)) {
sprite.body.gotoAndPlay("damage1");
damage = 1;
gibs(8);
_root.sound_mc_point("snd_big_boom", sprite.body, x, 100);
AddSpeed((-side) * 15, _local5);
_root.add_score(30);
}
if ((life < (max_life * 0.6)) && (damage < 2)) {
sprite.body.gotoAndPlay("damage2");
damage = 2;
gibs(5, 6);
_root.sound_mc_point("snd_big_boom_debris", sprite.body, x, 100);
AddSpeed(_local7, -15);
if (!_root.ragdolls_free) {
MedBox();
}
_root.add_score(50);
}
if ((life < (max_life * 0.4)) && (damage < 3)) {
sprite.body.gotoAndPlay("damage3");
damage = 3;
gibs(5, 7);
_root.sound_mc_point("snd_big_boom", sprite.body, x, 100);
AddSpeed(side * 15, _local5);
_root.add_score(250);
}
if ((life < (max_life * 0.2)) && (damage < 4)) {
sprite.body.gotoAndPlay("damage4");
damage = 4;
gibs(5);
if ((behavior == attack_gun) || (behavior == attack_gun_up)) {
behavior = stand;
}
sprite.gun.gotoAndPlay("die");
target_dir = 0;
_root.sound_mc_point("snd_big_boom_debris", sprite.body, x, 100);
AddSpeed(_local7, -10);
_root.add_score(300);
}
if ((life <= 0) && (damage < 5)) {
life = -100;
sprite.body.gotoAndPlay("die");
damage = 5;
sprite.beam._visible = false;
sprite.gotoAndStop("idle");
AddSpeed(0, -20);
gibs(7);
color.setTransform(_root.white);
_root.sound_mc_point("snd_big_boom_debris", sprite.body, x, 100);
if (passenger) {
PilotDie();
}
sprite.gotoAndStop("empty");
PilotDie();
sprite.jet1._visible = false;
sprite.jet1.gotoAndStop(1);
sprite.jet2._visible = false;
sprite.jet2.gotoAndStop(1);
sprite.jet3._visible = false;
sprite.jet3.gotoAndStop(1);
sprite.jet4._visible = false;
sprite.jet4.gotoAndStop(1);
gib(sprite.jet1, 70 + random(40), 10, 12, 9);
gib(sprite.jet2, 70 + random(40), 10, 12, 9);
gib(sprite.rocket, 70 + random(40), 10, 12, 10);
gib(sprite.rocket, 70 + random(40), 10, 12, 10);
jet_sound.stop();
if (on_die) {
on_die();
on_die = 0;
}
_root.add_kill_bonus(1500);
return(undefined);
}
pain--;
collided_time--;
}
function UpdateStatic() {
}
function AddSpeed(vx, vy) {
j1.x = j1.x + vx;
j1.y = j1.y + vy;
j2.x = j2.x + vx;
j2.y = j2.y + vy;
}
function Freeze() {
if ((life > 0) || (falltime > 0)) {
return(true);
}
sprite._visible = false;
}
function UnFreeze() {
if (!sprite) {
var _local4 = 5;
var _local3 = _root.get_id();
sprite = _root.objects_layer.attachMovie("bike", "bk" + _local3, _local3 + (_root.depth_band * _local4));
sprite._x = x;
sprite._y = y;
color = new Color(sprite);
SetSide(_root.sgn(_root.knight.getx() - x));
jet_sound = new Sound(sprite.jet2);
jet_sound.attachSound("snd_jet");
jet_sound.setVolume(0);
jet_sound.start(0, 9999);
l1 = new LinkSprite(j1, j2, 0.9, sprite);
}
sprite._visible = true;
}
function Alive() {
return(life > -10000);
}
function Kill() {
jet_sound.stop();
delete jet_sound;
delete events;
delete spawned_objs;
delete j1;
delete j2;
removeMovieClip(sprite);
life = -100000;
}
function SetSide(_side) {
if (side != _side) {
var _local3;
_local3 = l1.a;
l1.a = l1.b;
l1.b = _local3;
_local3 = j1;
j1 = j2;
j2 = _local3;
}
side = _root.sgn(_side);
sprite._xscale = (-side) * 100;
}
function SpawnMan(wpn, _life, _skin, bhv) {
_root.p.x = sprite.spawn._x;
_root.p.y = sprite.spawn._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local3 = new Enemy(_root.p.x, _root.p.y, "human", wpn, _skin, _life, bhv, 6);
_local3.UnFreeze();
_root.objects.push(_local3);
return(_local3);
}
function gibs(n_gibs, special_gib) {
if (sprite.body.gibs_pos == undefined) {
return(undefined);
}
_root.p.x = sprite.body.gibs_pos._x;
_root.p.y = sprite.body.gibs_pos._y;
_root.p = sprite.body.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local3 = 0;
while (_local3 < n_gibs) {
_root.objects.push(new SpinningGib("gunship_gibs", _root.p.x, _root.p.y, -random(360), 15, 10, random(4) + 1, 12));
_local3++;
}
if (!special_gib) {
return(undefined);
}
var _local5 = new SpinningGib("bike_gibs", _root.p.x, _root.p.y, random(360), 4, 10, special_gib, 10);
_local5.life = 200;
_root.objects.push(_local5);
}
function gib(part, _dir, speed, r, frame) {
_root.p.x = part._x;
_root.p.y = part._y;
_root.p = sprite.body.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local3 = new SpinningGib("bike_gibs", _root.p.x, _root.p.y, _dir, speed, r, frame, 10);
_local3.life = 99999 /* 0x01869F */;
_root.objects.push(_local3);
}
function PilotDie() {
_root.p.x = sprite.spawn._x;
_root.p.y = sprite.spawn._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local6 = _root.get_id();
var _local4 = _root.objects_layer.attachMovie("stunned_player", "m" + _local6, _local6 + (_root.depth_band * 9));
_local4._x = _root.p.x;
_local4._y = _root.p.y;
if (side > 0) {
_local4.gotoAndStop("biker_right");
} else {
_local4.gotoAndStop("biker_left");
}
var _local5 = new Ragdoll(_root.p.x, _root.p.y, _local4, _local4.head, _local4.bod, _local4.a11, _local4.a12, _local4.a21, _local4.a22, _local4.but, _local4.l11, _local4.l12, _local4.l21, _local4.l22, -8 * side, -8, false);
var _local3 = 11;
while (_local3 < _local5.objects.length) {
_local5.objects[_local3].sprite.gotoAndStop(30);
_local3++;
}
_local5.UnFreeze();
_root.objects.push(_local5);
}
function MedBox() {
var _local3 = new Crate(x, y + 30, "med_box", sprite.jet1, 1, "heal50smg80", 2);
_local3.aabb.w = 40;
_local3.aabb.h = 36;
_local3.aabb.dx = -20;
_local3.aabb.dy = -18;
_local3.sprite._xscale = 100;
_local3.sprite._yscale = 100;
_root.PushObject(_local3);
}
function Pause() {
switch (sprite.gun._currentframe) {
case 1 :
case 2 :
case 25 :
break;
default :
sprite.gun.stop();
}
if (sprite.rocket._currentframe != 2) {
sprite.rocket.stop();
}
}
function UnPause() {
switch (sprite.gun._currentframe) {
case 1 :
case 2 :
case 25 :
break;
default :
sprite.gun.play();
}
if (sprite.rocket._currentframe != 2) {
sprite.rocket.play();
}
}
var max_life = 800;
}
Symbol 3246 MovieClip [__Packages.BigRocket] Frame 0
class BigRocket extends JointCBLF
{
var x, y, id, sprite, dir, aabb, life, vx, vy, oldx, oldy, damage, force, exploded, jet_sound, destroyed, color, pain, UpdatePhysics, collided, hit_f, player_damage_aabb;
function BigRocket (__x, __y, _dir, speed, _damage, _force) {
super();
x = __x;
y = __y;
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("big_rocket", "pb" + id, id + (_root.depth_band * 7));
sprite._x = x;
sprite._y = y;
sprite._rotation = _dir;
dir = _dir;
aabb = new Object();
aabb.dx = -15;
aabb.dy = -15;
aabb.w = 30;
aabb.h = 30;
aabb.x = __x;
aabb.y = __y;
life = 60;
vx = speed * Math.cos(dir * _root.degtorad);
vy = speed * Math.sin(dir * _root.degtorad);
oldx = x - vx;
oldy = y - vy;
damage = _damage;
force = _force;
exploded = false;
jet_sound = new Sound(sprite);
jet_sound.attachSound("snd_rocket_fly");
jet_sound.setVolume(0);
jet_sound.start(0, 9999);
destroyed = false;
color = new Color(sprite);
pain = 0;
}
function Update() {
y = y + (_root.gravity_y * 0.01);
var _local7 = x - oldx;
var _local5 = y - oldy;
var _local3 = _root.direct_knight(x, y);
dir = _root.interpolate_angle(dir, _local3, 0.2);
var _local4 = 0.75;
x = x + (_local4 * Math.cos(dir * _root.degtorad));
y = y + (_local4 * Math.sin(dir * _root.degtorad));
oldx = _root.interpolate(oldx, x, 0.04);
oldy = _root.interpolate(oldy, y, 0.04);
UpdatePhysics();
switch (collided) {
case 0 :
break;
case 1 :
y = y - (_local5 * 0.6);
break;
case 3 :
y = y - (_local5 * 0.6);
break;
case 2 :
case 4 :
x = x - (_local7 * 0.5);
}
if (hit_f > 5) {
var _local8 = _root.limit((hit_f - 3) * 10, 10, 100);
_root.sound_mc_point("snd_metal_hit", sprite, x, _local8);
_local3 = Math.atan2(y - oldy, x - oldx) * _root.radtodeg;
dir = _root.interpolate_angle(dir, _local3, 0.25);
}
var _local6 = _root.CollideBullets(aabb);
if (_local6 > 0) {
x = x + (_root.p.x / 12000);
y = y + (_root.p.y / 12000);
life = life - _local6;
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
color.setTransform(_root.light_orange);
pain = 3;
} else if (pain == 0) {
color.setTransform(_root.white);
}
if (life <= 0) {
destroyed = true;
Explode();
_root.add_score(50);
return(undefined);
}
if (_root.CollideKnight(aabb)) {
Explode();
return(undefined);
}
sprite._rotation = dir;
_root.point_sound(jet_sound, x, 10);
if ((sprite._rotation > -90) && (sprite._rotation < 90)) {
sprite._yscale = -100;
} else {
sprite._yscale = 100;
}
pain--;
}
function Explode() {
color.setTransform(_root.white);
jet_sound.stop();
Update = ExplosionUpdate;
Collide = ExplosionCollide;
sprite.gotoAndPlay("die");
life = 0;
aabb.x = x - 100;
aabb.y = y - 100;
aabb.w = 200;
aabb.h = 200;
_root.sound_mc_point("snd_big_boom", sprite, x, 100);
player_damage_aabb = new Object();
player_damage_aabb.x = x - 70;
player_damage_aabb.y = y - 70;
player_damage_aabb.w = 140;
player_damage_aabb.h = 140;
var _local3 = 0;
while (_local3 < 4) {
_root.objects.push(new SpinningGib("metal_gibs", x, y, random(360), 15, 10, random(8) + 20, 4));
_local3++;
}
}
function ExplosionCollide(_aabb) {
if (life != 1) {
return(undefined);
}
if (_root.collide_aabb(_aabb, aabb)) {
vx = (_aabb.x + (_aabb.w * 0.5)) - x;
vy = (_aabb.y + (_aabb.h * 0.5)) - y;
var _local3 = Math.sqrt((vx * vx) + (vy * vy));
_local3 = force / _local3;
vx = vx * _local3;
vy = vy * _local3;
_root.p.x = vx * 1000;
_root.p.y = vy * 1000;
return(true);
}
return(false);
}
function ExplosionUpdate() {
if ((life == 0) && (!destroyed)) {
if (_root.CollideKnight(player_damage_aabb)) {
vx = _root.knight.getx() - x;
vy = _root.knight.gety() - y;
var _local3 = Math.sqrt((vx * vx) + (vy * vy));
_local3 = (force * 0.2) / _local3;
vx = vx * _local3;
vy = vy * _local3;
_root.DamageKnight(20, vx, vy);
}
}
life++;
}
function Kill() {
life = -10000;
jet_sound.stop();
delete jet_sound;
removeMovieClip(sprite);
delete aabb;
}
function Alive() {
if (sprite._currentframe == 60) {
return(false);
}
return(true);
}
function InGame() {
if ((x + 30) < _root.left_border) {
return(false);
}
if ((x - 30) > _root.right_border) {
return(false);
}
if ((y + 30) < _root.top_border) {
return(false);
}
if ((y - 30) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
return(true);
}
function UnFreeze() {
}
function Collide(_aabb) {
if (_root.collide_aabb(_aabb, aabb)) {
Explode();
}
return(false);
}
function Hit() {
if (life != 1) {
return(undefined);
}
_root.p.x = vx * 1000;
_root.p.y = vy * 1000;
sprite.gotoAndPlay("die");
}
}
Symbol 3247 MovieClip [__Packages.RocketCarrier] Frame 0
class RocketCarrier extends Spawner
{
var sprite, luk_sprite, left_bound, right_bound, bottom_bound, top_bound, lounching, phase, _mode, old_rocket_y, on_rocket, last_man_time, motor_sound, colliders, n_otsek, x, y, platform, jet_sound, jet_sound_vol, view_x, view_y, checkpoint, mg1, mg2, mg3, mg1_x, mg2_x, mg3_x, spawned_objs, events, WaitUntilDie, delay, wait, Delay, life, scarf, fall_speed, fall_dist;
function RocketCarrier (__x, __y, _sprite) {
super(__x, __y);
sprite = _sprite;
var _local5 = 12;
var _local4 = _root.get_id();
luk_sprite = _root.objects_layer.attachMovie("truck_foreground", "tf" + _local4, _local4 + (_root.depth_band * _local5));
luk_sprite._x = (__x + sprite.truck._x) + 175;
luk_sprite._y = (__y + sprite.truck._y) + 3;
left_bound = _root.level.left_bound._x;
right_bound = _root.level.right_bound._x;
bottom_bound = _root.level.left_bound._y;
top_bound = _root.level.top_bound._y;
lounching = false;
_root.ragdolls_free = -0.5;
phase = 0;
_mode = 0;
old_rocket_y = sprite.rocket_pos._y;
on_rocket = false;
last_man_time = 0;
motor_sound = new Sound(sprite.truck);
motor_sound.attachSound("snd_truck_loop");
motor_sound.start(0, 9999);
_root.level.rocket_carrier = this;
colliders = new Array();
n_otsek = 3;
AddDelay(100);
AddSpawnMan(0);
AddDelay(30);
AddSpawnMan(1);
AddDelay(30);
AddSpawnMan(2);
AddWait();
AddDelay(30);
AddSpawnMan(0);
AddDelay(30);
AddSpawnMan(0);
AddDelay(60);
AddSpawnMan(2);
AddDelay(30);
AddSpawnMan(2);
AddDelay(50);
AddSugrob("heal30grenade8");
AddWait();
AddDelay(30);
AddSpawnMan(3);
AddDelay(30);
AddSpawnMan(4);
AddWait();
AddSugrob("heal30smg80");
AddBike(1);
AddWait();
AddDelay(30);
AddSpawnMan(10);
AddDelay(40);
AddSpawnMan(5);
AddDelay(40);
AddSpawnMan(6);
AddWait();
AddSugrob("heal50riffle10");
AddWait();
AddDelay(20);
AddSpawnMan(4);
AddDelay(20);
AddSpawnMan(4);
AddDelay(60);
AddSugrob("heal30riffle5");
AddSpawnMan(2);
AddDelay(20);
AddSpawnMan(2);
AddDelay(20);
AddSpawnMan(2);
AddWait();
AddDelay(40);
AddSpawnMan(9);
AddDelay(70);
AddSpawnMan(9);
AddWait();
AddDelay(20);
AddSpawnMan(5);
AddDelay(40);
AddSpawnMan(5);
AddSugrob("heal50riffle5");
AddDelay(60);
AddSpawnMan(4);
AddDelay(20);
AddSpawnMan(0);
AddDelay(20);
AddSpawnMan(0);
AddWait();
AddDelay(70);
AddSpawnMan(2);
AddDelay(20);
AddSpawnMan(8);
AddDelay(20);
AddSpawnMan(2);
AddWait();
AddSugrob("heal30smg100");
AddDelay(60);
AddLounch();
AddDelay(130);
AddSpawnMan(0);
AddDelay(30);
AddSpawnMan(0);
AddWait();
AddDelay(30);
AddSpawnMan(2);
AddDelay(30);
AddSpawnMan(2);
AddDelay(60);
AddSpawnMan(4);
AddWait();
AddMinigun();
AddDelay(160);
AddRocketEvents();
AddRocketEvents();
AddRocketEvents();
AddRocketEvents();
AddRocketEvents();
AddRocketEvents();
AddRocketEvents();
AddRocketEvents();
AddRocketEvents();
AddRocketEvents();
}
function RocketEvents() {
AddDelay(40);
AddSpawnMan(4);
AddDelay(40);
AddSpawnMan(3);
AddDelay(40);
AddSpawnMan(4);
AddWait();
AddDelay(30);
AddSpawnMan(8);
AddDelay(30);
AddSpawnMan(8);
AddMinigun();
AddDelay(60);
AddWait();
AddDelay(20);
AddSpawnMan(2);
AddDelay(20);
AddSpawnMan(2);
AddDelay(20);
AddSpawnMan(2);
AddDelay(150);
AddSpawnMan(1);
AddDelay(20);
AddSpawnMan(1);
AddDelay(20);
AddSpawnMan(1);
AddWait();
AddMinigun();
AddDelay(20);
AddMinigun();
AddDelay(30);
AddMinigun();
AddDelay(160);
AddDelay(40);
AddSpawnMan(3);
AddDelay(40);
AddSpawnMan(3);
AddDelay(40);
AddSpawnMan(1);
AddDelay(30);
AddMinigun();
AddDelay(30);
AddMinigun();
AddWait();
AddDelay(40);
AddSpawnMan(5);
AddDelay(40);
AddSpawnMan(5);
AddDelay(40);
AddSpawnMan(7);
AddWait();
AddDelay(20);
AddSpawnMan(2);
AddDelay(20);
AddSpawnMan(2);
AddDelay(20);
AddSpawnMan(2);
AddDelay(30);
AddMinigun();
AddWait();
AddRocketEvents();
}
function Update() {
UpdateEvents();
luk_sprite._x = (x + sprite.truck._x) + 175;
luk_sprite._y = (y + sprite.truck._y) + 3;
if ((_root.knight.gety() > bottom_bound) && (_root.knight.life > 0)) {
_root.knight.Damage(-10, -15, 0, 1000);
}
if (lounching) {
UpdateFly();
phase = 0;
_root.knight.LockControls("lock_view");
Update = UpdateFly;
return(undefined);
}
}
function UpdateFly() {
luk_sprite._x = (x + sprite.truck._x) + 175;
luk_sprite._y = (y + sprite.truck._y) + 3;
_root.knight.sprite_shift_x = sprite.rocket_pos._x - 643;
_root.knight.sprite_shift_y = sprite.rocket_pos._y - 260;
var _local3 = ((-sprite.view_pos._x) - x) + (_root.w * 0.5);
var _local4 = ((-sprite.view_pos._y) - y) + (_root.h * 0.5);
var _local5 = sprite.rocket_pos._y - old_rocket_y;
_root.through_clouds._x = (-_root._x) + (_root.w * 0.5);
_root.through_clouds._y = (-_root._y) + (_root.h * 0.5);
switch (_mode) {
case 0 :
if (_root.knight.getx() < _root.level.player_left_bound._x) {
_root.knight.x = _root.level.player_left_bound._x;
}
if (_root.knight.getx() > _root.level.player_right_bound._x) {
_root.knight.x = _root.level.player_right_bound._x;
}
platform.k = sprite.platform._height / sprite.platform._width;
if (_root.view_scale > 75) {
_root.view_scale = _root.view_scale - 0.5;
}
if (phase > 140) {
phase = 0;
_mode = 1;
}
_root.SmoothView(_local3, _local4, 0.075, 0.95);
break;
case 1 :
if (_root.knight.getx() < _root.level.player_left_bound._x) {
_root.knight.x = _root.level.player_left_bound._x;
}
if (_root.knight.getx() > _root.level.player_right_bound._x) {
_root.knight.x = _root.level.player_right_bound._x;
}
if (_root.view_scale > 45) {
_root.view_scale = _root.view_scale - 0.2;
}
if (phase == 40) {
jet_sound = new Sound(_root.level.rocket_stage.jet_sound);
jet_sound.attachSound("snd_rocket_fly");
jet_sound.start(0, 9999);
jet_sound_vol = 100;
}
if (phase > 100) {
phase = 0;
_mode = 2;
}
_root.SmoothView((_local3 + random(8)) - 4, (_local4 + random(8)) - 4, 1, 1);
_root.backgrounds[1].y = _root.backgrounds[1].y - (_local5 * 0.25);
_root.backgrounds[0].y = _root.backgrounds[0].y - (_local5 * 0.22);
break;
case 2 :
if (_root.knight.getx() < _root.level.player_left_bound._x) {
_root.knight.x = _root.level.player_left_bound._x;
}
if (_root.knight.getx() > _root.level.player_right_bound._x) {
_root.knight.x = _root.level.player_right_bound._x;
}
if (phase > 140) {
SwitchToRocket();
}
_root.SmoothView(_local3, _local4, 0.95, 0.95);
_root.backgrounds[1].y = _root.backgrounds[1].y - (_local5 * 0.25);
_root.backgrounds[0].y = _root.backgrounds[0].y - (_local5 * 0.22);
if (motor_sound.getVolume() > 2) {
motor_sound.setVolume(motor_sound.getVolume() - 1);
}
break;
case 3 :
_root.SmoothView(_local3, _local4, 0.95, 0.95);
_root.backgrounds[1].y = _root.backgrounds[1].y + 1;
if (phase > 20) {
sprite.play();
phase = 0;
_mode = 0;
on_rocket = true;
Update = UpdateRocket;
return(undefined);
}
if (jet_sound_vol > 20) {
jet_sound_vol = jet_sound_vol - 1;
}
jet_sound.setVolume(jet_sound_vol);
break;
}
phase++;
if (_root.backgrounds[0].y > 0) {
_root.backgrounds[0].y = 0;
}
old_rocket_y = sprite.rocket_pos._y;
}
function UpdateRocket() {
UpdateEvents();
var _local3 = _root.knight.getx();
if (_local3 > (sprite.turbulence_pos._x + x)) {
_root.knight.x = _root.knight.x - (((_local3 - sprite.turbulence_pos._x) - x) * 0.025);
} else if (_local3 < (sprite.vacuum_pos._x + x)) {
if (_root.knight.landed) {
_root.knight.x = _root.knight.x - 1.5;
} else {
_root.knight.x = _root.knight.x - 0.25;
}
}
if (_mode) {
_root.knight.x = _root.knight.x - 0.25;
}
if ((((colliders[0].life <= 0) && (colliders[1].life <= 0)) && (colliders[2].life <= 0)) && (_mode < 2)) {
_mode = 2;
phase = 0;
view_x = _root.view_x;
view_y = _root.view_y;
_root.knight.LockControls("lock_view");
sprite.otsek4.gotoAndPlay("shot");
}
switch (_mode) {
case 0 :
if (phase > 150) {
_root.knight.LockControls("restore_control");
phase = 0;
_mode = 1;
lounching = false;
checkpoint = _root.SetCheckpoint(sprite._x + sprite.respawn._x, sprite._y + sprite.respawn._y);
_root.pause_possible = true;
}
var _local4 = ((-sprite.view_pos._x) - x) + (_root.w * 0.5);
var _local5 = ((-sprite.view_pos._y) - y) + (_root.h * 0.5);
_root.SmoothView(_local4, _local5, 0.95, 0.95);
if (jet_sound_vol > 20) {
jet_sound_vol = jet_sound_vol - 1;
}
jet_sound.setVolume(jet_sound_vol);
if (_root.backgrounds[1].y < -100) {
_root.backgrounds[1].y = _root.backgrounds[1].y + 1;
}
break;
case 1 :
if (_root.view_scale < 100) {
_root.view_scale = _root.view_scale + 0.25;
}
if (_root.view_scale > 100) {
_root.view_scale = 100;
}
break;
case 2 :
if (phase > 230) {
_root.knight.LockControls("restore_control");
phase = 0;
_mode = 3;
}
if (phase < 50) {
_root.view_scale = _root.view_scale - 0.5;
}
if ((phase > 50) && (phase < 100)) {
_root.view_scale = _root.view_scale + 0.5;
}
view_x = _root.interpolate(view_x, (((-sprite.otsek4.view_pos._x) - sprite.otsek4._x) - x) + (_root.w * 0.5), 0.2);
view_y = _root.interpolate(view_y, (((-sprite.otsek4.view_pos._y) - sprite.otsek4._y) - y) + (_root.h * 0.5), 0.2);
_root.SmoothView(view_x, view_y, 0.95, 0.95);
if (_local3 < ((sprite.vacuum_pos._x + x) - 50)) {
_root.knight.x = (sprite.turbulence_pos._x + x) - 50;
}
if ((phase > 110) && (_local3 > ((sprite.turbulence_pos._x + x) - 200))) {
_root.knight.x = (sprite.turbulence_pos._x + x) - 200;
_root.knight.oldx = _root.knight.x + 2;
}
if (_local3 < ((sprite.turbulence_pos._x + x) - 800)) {
_root.knight.x = (sprite.turbulence_pos._x + x) - 800;
_root.knight.oldx = _root.knight.x - 2;
}
break;
}
CollCheck(colliders[0]);
CollCheck(colliders[1]);
CollCheck(colliders[2]);
ShotMG(mg1);
ShotMG(mg2);
ShotMG(mg3);
if (_root.level.core_boss_killed && (_root.knight.life > 0)) {
if (_local3 > ((sprite.turbulence_pos._x + x) - 200)) {
_root.knight.x = (sprite.turbulence_pos._x + x) - 200;
_root.knight.oldx = _root.knight.x + 2;
} else if (_local3 < ((sprite.turbulence_pos._x + x) - 800)) {
_root.knight.x = (sprite.turbulence_pos._x + x) - 800;
_root.knight.oldx = _root.knight.x - 2;
}
if (_root.knight.gety() > (sprite.turbulence_pos._y + y)) {
_root.knight.y = sprite.turbulence_pos._y + y;
_root.knight.oldy = _root.knight.y - 1;
}
var _local6 = (sprite._x + sprite.otsek2._x) + sprite.otsek2.player_pos._x;
_root.knight.LockControls("move_to", 0, _local6);
phase = 0;
_mode = 0;
_root.pause_possible = false;
Update = UpdatePlayerEvacuate;
return(undefined);
}
phase++;
}
function FastSwitch() {
_root.level.rocket_stage.gotoAndStop(10);
SwitchToRocket();
_root.level.rocket_stage.gotoAndStop("ready");
var _local3 = ((-sprite.view_pos._x) - x) + (_root.w * 0.5);
var _local4 = ((-sprite.view_pos._y) - y) + (_root.h * 0.5);
_root.SmoothView(_local3, _local4, 1, 1);
Update = UpdateRocket;
phase = 151;
_mode = 0;
on_rocket = true;
_root.knight.PickWeapon(4, 500);
}
function SwitchToRocket() {
motor_sound.stop();
phase = 0;
_mode = 3;
_root.level.rocket_stage._x = (sprite.view_pos._x + x) - _root.level.rocket_stage.view_pos._x;
_root.level.rocket_stage._y = (sprite.view_pos._y + y) - _root.level.rocket_stage.view_pos._y;
sprite.gotoAndStop("empty");
sprite._visible = false;
_root.level.rocket_stage.gotoAndStop("ready");
sprite = _root.level.rocket_stage;
x = sprite._x;
y = sprite._y;
_root.knight.x = (_root.knight.oldx = sprite.player_pos._x + x);
_root.knight.y = (_root.knight.oldy = sprite.player_pos._y + y);
_root.knight.LockControls("lock_all");
mg1_x = ((sprite._x + sprite.otsek1._x) + sprite.otsek1.turret._x) + 50;
mg2_x = ((sprite._x + sprite.otsek2._x) + sprite.otsek2.turret._x) + 50;
mg3_x = ((sprite._x + sprite.otsek3._x) + sprite.otsek3.turret._x) + 50;
mg1 = sprite.otsek1.turret;
mg2 = sprite.otsek2.turret;
mg3 = sprite.otsek3.turret;
_root.backgrounds[1].sprite.gotoAndStop("clouds");
_root.backgrounds[0].sprite.gotoAndStop("empty");
_root.backgrounds[1].y = -230;
_root.road_front.gotoAndStop("empty");
left_bound = sprite.left_bound._x + x;
right_bound = sprite.right_bound._x + x;
bottom_bound = sprite.left_bound._y + y;
top_bound = sprite.top_bound._y + y;
_root.view_bottom._y = _root.view_bottom._y - 1000;
_root.level.view_left._x = x + 10;
Collider(3, -6, 224, 110, sprite.otsek1);
Collider(5, -5, 238, 110, sprite.otsek2);
Collider(4, -4, 194, 110, sprite.otsek3);
_root.level.rocket_stage.gotoAndStop(2);
_root.level.view_left._x = x + 50;
spawned_objs = new Array();
}
function ShotMG(mg) {
if (!mg.ready) {
return(undefined);
}
_root.p.x = mg.barrel._x;
_root.p.y = mg.barrel._y;
_root.p = mg.transform.matrix.transformPoint(_root.p);
_root.p = mg._parent.transform.matrix.transformPoint(_root.p);
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local4 = new EnemyBullet("pistol_bullet", _root.p.x, _root.p.y, mg.dir._rotation, 18, 10, 6, 5);
_local4.sprite._yscale = 200;
_root.objects.push(_local4);
}
function AddSpawnMan(man_kind, luk) {
var _local2 = events.length;
events.push(new Object());
events[_local2]._kind = SPAWN_MAN;
events[_local2].man_kind = man_kind;
events[_local2].luk = luk;
}
function AddDelay(delay) {
var _local2 = events.length;
events.push(new Object());
events[_local2]._kind = DELAY;
events[_local2].delay = delay;
}
function AddWait() {
var _local2 = events.length;
events.push(new Object());
events[_local2]._kind = WAIT;
}
function AddSugrob(_content) {
var _local2 = events.length;
events.push(new Object());
events[_local2]._kind = SUGROB;
events[_local2]._content = _content;
}
function AddBike(side) {
var _local2 = events.length;
events.push(new Object());
events[_local2]._kind = BIKE;
events[_local2].side = side;
}
function AddLounch(side) {
var _local2 = events.length;
events.push(new Object());
events[_local2]._kind = LOUNCH;
}
function AddMinigun() {
var _local2 = events.length;
events.push(new Object());
events[_local2]._kind = MINIGUN;
}
function AddRocketEvents() {
var _local2 = events.length;
events.push(new Object());
events[_local2]._kind = ROCKETEVENTS;
}
function SpawnMan(man_kind) {
var _local10 = _root.knight.getx();
var _local14 = _root.knight.gety();
var _local5 = 100000 /* 0x0186A0 */;
var _local7;
if (!on_rocket) {
for (var _local3 in luk_sprite) {
var _local4 = luk_sprite[_local3];
if (_local4.busy) {
continue;
}
var _local6 = Math.abs((_local4._x + luk_sprite._x) - _local10);
if (_local6 < _local5) {
_local5 = _local6;
_local7 = _local4;
}
}
} else {
var _local3 = 1;
while (_local3 <= 3) {
if (colliders[_local3 - 1].life <= 0) {
} else {
var _local4 = sprite["otsek" + _local3].door;
if (_local4.busy) {
} else {
var _local6 = Math.abs((((_local4._x + 20) + sprite["otsek" + _local3]._x) + x) - _local10);
if (_local6 < _local5) {
_local5 = _local6;
_local7 = _local4;
}
}
}
_local3++;
}
}
if (!_local7) {
return(undefined);
}
var _local12;
var _local9;
var _local8;
var _local11;
switch (man_kind) {
case 0 :
_local12 = 1;
_local8 = 40;
_local9 = 32;
_local11 = 1;
break;
case 1 :
_local12 = 1;
_local8 = 40;
_local9 = 32;
_local11 = 2;
break;
case 2 :
_local12 = 2;
_local8 = 40;
_local9 = 32;
_local11 = 1;
break;
case 3 :
_local12 = 4;
_local8 = 40;
_local9 = 32;
_local11 = 1;
break;
case 4 :
_local12 = 2;
_local8 = 60;
_local9 = 22;
_local11 = 1;
break;
case 5 :
_local12 = 2;
_local8 = 60;
_local9 = 22;
_local11 = 2;
break;
case 6 :
_local12 = 3;
_local8 = 60;
_local9 = 22;
_local11 = 1;
break;
case 7 :
_local12 = 4;
_local8 = 60;
_local9 = 22;
_local11 = 1;
break;
case 8 :
_local12 = 2;
_local8 = 80;
_local9 = 28;
_local11 = 5;
break;
case 9 :
_local12 = 3;
_local8 = 80;
_local9 = 28;
_local11 = 5;
break;
case 10 :
_local12 = 4;
_local8 = 80;
_local9 = 28;
_local11 = 5;
}
var _local13;
if (!on_rocket) {
_local13 = new Enemy(_local7._x + luk_sprite._x, _local7._y + luk_sprite._y, "human", _local12, _local9, _local8, _local11, 6);
} else {
_local13 = new Enemy(((_local7._x + _local7._parent._x) + x) + 20, ((_local7._y + _local7._parent._y) + y) + 30, "human", _local12, _local9, _local8, _local11, 6);
_local13.oldy = _local13.oldy + (14 + random(5));
_local13.oldx = _local13.oldx + ((random(400) / 100) - 2);
}
_local7.man = _local13;
_local7.gotoAndPlay("shot");
WaitUntilDie(false);
spawned_objs.push(_local13);
return(_local13);
}
function Lounch() {
sprite.gotoAndPlay("lounch");
platform = _root.push_platform(sprite.platform, _root.t_slope_up_left, x, y, sprite.area);
sprite.platform._visible = false;
sprite.area._visible = false;
lounching = true;
_root.pause_possible = false;
}
function LounchBike(side) {
var _local5;
var _local4;
var _local6;
if (side == 1) {
_local5 = _root.level.bike_spawn1._x;
_local4 = _root.level.bike_spawn1._y;
_local6 = 3;
} else if (side == 2) {
_local5 = _root.level.bike_spawn2._x;
_local4 = _root.level.bike_spawn2._y;
_local6 = 4;
}
var _local3 = new Bike(_local5, _local4, _local6);
_root.objects.push(_local3);
_local3.UnFreeze();
spawned_objs.push(_local3);
WaitUntilDie(false);
}
function Minigun() {
if ((mg1.busy && (mg2.busy)) && (mg3.busy)) {
return(undefined);
}
var _local4 = _root.knight.getx();
var _local5 = _root.knight.gety();
var _local3;
if (_local4 > mg3_x) {
if (!mg3.busy) {
_local3 = mg3;
} else if (!mg2.busy) {
_local3 = mg2;
} else {
_local3 = mg1;
}
}
if ((_local4 > mg2_x) && (_local4 < mg3_x)) {
if (!mg1.busy) {
_local3 = mg1;
} else if ((random(100) < 50) && (!mg3.busy)) {
_local3 = mg3;
} else if (!mg2.busy) {
_local3 = mg2;
} else {
_local3 = mg3;
}
}
if ((_local4 > mg1_x) && (_local4 < mg2_x)) {
if (!mg3.busy) {
_local3 = mg3;
} else if ((random(100) < 50) && (!mg1.busy)) {
_local3 = mg1;
} else if (!mg2.busy) {
_local3 = mg2;
} else {
_local3 = mg1;
}
}
if (_local4 < mg1_x) {
if (!mg1.busy) {
_local3 = mg1;
} else if (!mg2.busy) {
_local3 = mg2;
} else {
_local3 = mg3;
}
}
if (!_local3) {
return(undefined);
}
if (_local4 > (((_local3._x + _local3._parent._x) + x) + 50)) {
_local3.gotoAndPlay("shot_right");
} else {
_local3.gotoAndPlay("shot_left");
}
}
function UpdateEvents() {
if (lounching) {
return(undefined);
}
delay--;
var _local3 = 0;
while (_local3 < spawned_objs.length) {
if (((!spawned_objs[_local3]) || (!spawned_objs[_local3].life)) || (spawned_objs[_local3].life <= 0)) {
spawned_objs.splice(_local3, 1);
_local3--;
} else if (!(spawned_objs[_local3] instanceof Bike)) {
if (((spawned_objs[_local3].x < left_bound) || (spawned_objs[_local3].x > right_bound)) || (spawned_objs[_local3].y > bottom_bound)) {
spawned_objs[_local3].life = -10;
spawned_objs.splice(_local3, 1);
}
}
if (spawned_objs[_local3].y < top_bound) {
spawned_objs[_local3].y = spawned_objs[_local3].y + ((top_bound - spawned_objs[_local3].y) * 0.2);
}
_local3++;
}
if (delay > 0) {
return(undefined);
}
var _local4 = 1;
switch (n_otsek) {
case 2 :
_local4 = 0.75;
break;
case 3 :
_local4 = 0.5;
}
var _local6 = 200;
var _local5 = (((spawned_objs.length == 1) && (wait)) && (last_man_time > _local6)) && (!(spawned_objs[0] instanceof Bike));
if (((((spawned_objs.length == 0) && (wait)) || (_local5)) || (delay == 0)) || ((!wait) && (delay <= 0))) {
last_man_time = 0;
switch (events[0]._kind) {
case SPAWN_MAN :
SpawnMan(events[0].man_kind);
break;
case DELAY :
Delay(int(events[0].delay * _local4) + 1);
break;
case WAIT :
WaitUntilDie(true);
break;
case SUGROB :
_root.level.sugrob._content = events[0]._content;
_root.level.sugrob.gotoAndPlay("shot");
break;
case BIKE :
LounchBike(events[0].side);
break;
case LOUNCH :
Lounch();
break;
case MINIGUN :
Minigun();
break;
case ROCKETEVENTS :
RocketEvents();
break;
default :
events[0].func(this);
}
events.splice(0, 1);
}
if ((spawned_objs.length == 1) && (wait)) {
last_man_time++;
}
}
function UnFreeze() {
}
function Freeze() {
return(true);
}
function Alive() {
return(true);
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
}
function Collider(dx, dy, w, h, spr) {
var _local2 = new Object();
colliders.push(_local2);
_local2.body_aabb = new Object();
_local2.body_aabb.w = w;
_local2.body_aabb.h = h;
_local2.body_aabb.x = (spr._x + x) + dx;
_local2.body_aabb.y = (spr._y + y) + dy;
_local2.turret_aabb = new Object();
_local2.turret_aabb.w = 104;
_local2.turret_aabb.h = 100;
_local2.turret_aabb.x = (spr._x + x) + spr.turret._x;
_local2.turret_aabb.y = ((spr._y + y) + spr.turret._y) - 100;
_local2.sprite = spr;
_local2._color = new Color(spr);
_local2.pain = 0;
_local2.life = otsek_max_life;
_local2.damage = 0;
}
function CollCheck(col) {
if (col.life <= 0) {
_root.CollideBullets(col.body_aabb);
return(undefined);
}
var _local4 = _root.CollideBullets(col.body_aabb);
if ((!_local4) && (col.sprite.turret.opened)) {
_local4 = _root.CollideBullets(col.turret_aabb);
}
if (_local4 > 0) {
col.pain = 4;
col.life = col.life - _local4;
col._color.setTransform(_root.light_orange);
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
switch (col.damage) {
case 0 :
if (col.life <= (otsek_max_life * 0.66)) {
col.sprite.gotoAndPlay("damage1");
col.damage = 1;
_root.add_score(4000);
}
break;
case 1 :
if (col.life <= (otsek_max_life * 0.33)) {
col.sprite.gotoAndPlay("damage2");
col.damage = 2;
_root.add_score(8000);
}
break;
case 2 :
if (col.life > 0) {
break;
}
col.sprite.gotoAndPlay("damage3");
col.damage = 3;
col._color.setTransform(_root.white);
n_otsek--;
_root.add_score(16000);
}
} else if (col.pain == 0) {
col._color.setTransform(_root.white);
}
col.pain--;
}
function PlayerEvacuate() {
var _local3 = (sprite._x + sprite.otsek2._x) + sprite.otsek2.player_pos._x;
_root.knight.LockControls("move_to", 0, _local3);
Update = UpdatePlayerEvacuate;
phase = 0;
_mode = 0;
}
function UpdatePlayerEvacuate() {
switch (_mode) {
case 0 :
var _local9 = (sprite._x + sprite.otsek2._x) + sprite.otsek2.player_pos._x;
if (Math.abs(_root.knight.getx() - _local9) < 10) {
sprite.otsek2.turret.gotoAndPlay("lift_player");
sprite.otsek2.gotoAndPlay("player_jump");
_root.knight.sprite._visible = false;
_root.knight.LockControls("stand", sprite.otsek2.turret.player_pos);
phase = 0;
_mode = 1;
_root.knight.LockControls("lock_all");
}
break;
case 1 :
var _local6 = (((-sprite.otsek2.camera._x) - sprite.otsek2._x) - x) + (_root.w * 0.5);
var _local7 = (((-sprite.otsek2.camera._y) - sprite.otsek2._y) - y) + (_root.h * 0.5);
_root.SmoothView(_local6, _local7, 0.35, 0.95);
if (phase > 90) {
x = (x + sprite.otsek2._x) + sprite.otsek2.player_pos._x;
y = (y + sprite.otsek2._y) + sprite.otsek2.player_pos._y;
var _local8 = 12;
var _local3 = _root.get_id();
sprite = _root.objects_layer.attachMovie("player_skydive", "psd" + _local3, _local3 + (_root.depth_band * _local8));
sprite._x = x;
sprite._y = y;
scarf = new Cable(x, y, "scarf", 7, 0.1, 5);
phase = 0;
_mode = 2;
fall_speed = 10;
fall_dist = 0;
_root.view_bottom._y = _root.view_bottom._y + 100000;
_root.sound_loop("snd_wind_loop", 9999);
}
break;
case 2 :
if (jet_sound_vol > 0) {
jet_sound_vol = jet_sound_vol - 1;
}
jet_sound.setVolume(jet_sound_vol);
if (fall_dist < 500) {
fall_speed = fall_speed + _root.gravity_y;
if (fall_speed > 50) {
fall_speed = 50;
}
y = y + fall_speed;
fall_dist = fall_dist + fall_speed;
sprite._y = y;
}
_local6 = ((-sprite.camera._x) - x) + (_root.w * 0.5);
_local7 = ((-sprite.camera._y) - y) + (_root.h * 0.5);
_root.SmoothView(_local6, _local7, 0.99, 0.95);
if (phase > 90) {
sprite.gotoAndPlay("break");
phase = 0;
_mode = 3;
}
var _local4 = sprite.scarf_dir._x - sprite.scarf._x;
var _local5 = sprite.scarf_dir._y - sprite.scarf._y;
scarf.SetPos(scarf.GetX() - _local4, scarf.GetY() - _local5);
scarf.Update();
scarf.sprite._x = (x + sprite.scarf._x) - scarf.GetX();
scarf.sprite._y = (y + sprite.scarf._y) - scarf.GetY();
break;
case 3 :
_local4 = sprite.scarf_dir._x - sprite.scarf._x;
_local5 = sprite.scarf_dir._y - sprite.scarf._y;
scarf.SetPos(scarf.GetX() - _local4, scarf.GetY() - _local5);
scarf.Update();
scarf.sprite._x = (x + sprite.scarf._x) - scarf.GetX();
scarf.sprite._y = (y + sprite.scarf._y) - scarf.GetY();
if (phase == 180) {
_root.menu_controller.GameOver(true);
}
if (phase >= 180) {
_root.menu_controller.Update();
}
if (_root.level_vx <= 5) {
break;
}
_root.level_vx = _root.level_vx * 0.975;
}
phase++;
}
function PauseOtsek(otsek) {
switch (otsek.turret._currentframe) {
case 1 :
case 2 :
case 370 :
case 400 :
case 438 :
break;
default :
otsek.turret.stop();
}
switch (otsek.door._currentframe) {
case 1 :
case 74 :
break;
default :
otsek.door.stop();
}
}
function Pause() {
if (!on_rocket) {
if (sprite._currentframe != 40) {
sprite.stop();
}
sprite.wheels.stop();
for (var _local3 in luk_sprite) {
var _local2 = luk_sprite[_local3];
switch (_local2._currentframe) {
case 1 :
case 60 :
break;
default :
_local2.stop();
}
}
} else {
PauseOtsek(sprite.otsek1);
PauseOtsek(sprite.otsek2);
PauseOtsek(sprite.otsek3);
switch (sprite.otsek4._currentframe) {
case 1 :
case 258 :
break;
default :
sprite.otsek4.stop();
}
}
}
function UnPauseOtsek(otsek) {
switch (otsek.turret._currentframe) {
case 1 :
case 2 :
case 370 :
case 400 :
case 438 :
break;
default :
otsek.turret.play();
}
switch (otsek.door._currentframe) {
case 1 :
case 74 :
break;
default :
otsek.door.play();
}
}
function UnPause() {
if (!on_rocket) {
if (sprite._currentframe != 40) {
sprite.play();
}
sprite.wheels.play();
for (var _local3 in luk_sprite) {
var _local2 = luk_sprite[_local3];
switch (_local2._currentframe) {
case 1 :
case 60 :
break;
default :
_local2.play();
}
}
} else {
UnPauseOtsek(sprite.otsek1);
UnPauseOtsek(sprite.otsek2);
UnPauseOtsek(sprite.otsek3);
switch (sprite.otsek4._currentframe) {
case 1 :
case 258 :
break;
default :
sprite.otsek4.play();
}
}
}
var otsek_max_life = 1500;
static var SPAWN_MAN = 0;
static var DELAY = 1;
static var WAIT = 2;
static var SUGROB = 3;
static var BIKE = 4;
static var LOUNCH = 5;
static var MINIGUN = 6;
static var ROCKETEVENTS = 7;
}
Symbol 3248 MovieClip [__Packages.Core] Frame 0
class Core extends Spawner
{
var objects, foots, sprite, life, head, back, butt, n_joints, leg1, leg2, gun_link, x, y, dir, side, steps, hit_phase, hit_dir, gun_reload, color_head, color_tors, activate_delay, head_exploded, tors_exploded, back_exploded, on_die_delay, gun_dir, action_reload, left_bound, right_bound, shot_mode, behavior, shot_phase, target_speed, gunx, guny, rocket_w, rockets_reload_time, rockets_reload, hit_x, hit_y, damage_aabb, _mode, phase, damage, landed, pain_head, pain_tors, targeted, overstep_foot, active_foot, foot_angle, step_dist, d_foot_angle, on_die, activated;
function Core (__x, __y, _activate_delay) {
super();
objects = new Array();
foots = new Array();
var _local9 = 5;
var _local8 = _root.get_id();
sprite = _root.objects_layer.attachMovie("core", "cr" + _local8, _local8 + (_root.depth_band * _local9));
sprite._x = __x;
sprite._y = __y;
life = maxlife;
var _local11 = "teh core. it kil u infidel. -__- 666";
head = joint("head", 70, 60);
jointno("arm11", 20, 10);
jointno("arm12", 20, 10);
jointno("arm21", 20, 10);
jointno("arm22", 20, 10);
back = jointno("back", 100, 30);
butt = jointno("butt", 80, 20);
jointf("foot1", 80, 2);
jointf("foot2", 80, 2);
n_joints = objects.length;
var _local7 = 0.95;
link("head", "back", _local7, "head");
link("back", "butt", _local7, "back");
link("arm12", "arm11", _local7, "arm12");
link("arm11", "back", _local7, "arm11");
link("arm11", "arm12", _local7 * 0.1);
link("arm22", "arm21", _local7, "arm22");
link("arm21", "back", _local7, "arm21");
leg1 = link("butt", "foot1", -_local7, "leg1");
leg2 = link("butt", "foot2", -_local7, "leg2");
link("head", "butt", _local7 * 0.5);
gun_link = link("arm12", "arm22", _local7, "gun");
gun_link.r = 100;
objects.pop();
sprite.arm12.gotoAndStop("hold");
sprite.arm22.gotoAndStop("hold");
var _local4 = 0;
while (_local4 < n_joints) {
objects[_local4].x = objects[_local4].x + __x;
objects[_local4].y = objects[_local4].y + __y;
objects[_local4].oldx = objects[_local4].oldx + __x;
objects[_local4].oldy = objects[_local4].oldy + __y;
_local4++;
}
sprite._x = 0;
sprite._y = 0;
_local4 = n_joints;
while (_local4 < objects.length) {
objects[_local4].Render();
_local4++;
}
x = __x;
y = __y;
dir = -1;
side = -1;
steps = 3;
hit_phase = 0;
hit_dir = 0;
gun_reload = 90;
color_head = new Color(sprite.head);
color_tors = new Color(sprite.tors);
if (!_activate_delay) {
_activate_delay = 0;
}
activate_delay = _activate_delay;
head_exploded = (tors_exploded = (back_exploded = false));
on_die_delay = 130;
StartWalk();
gun_dir = -180;
action_reload = 0;
left_bound = _root.level.rocket_stage.core_boss_left_bound._x + _root.level.rocket_stage._x;
right_bound = _root.level.rocket_stage.core_boss_right_bound._x + _root.level.rocket_stage._x;
shot_mode = 0;
behavior = GunAttack;
shot_phase = 0;
target_speed = 0.05;
gunx = x;
guny = y;
rocket_w = 20;
rockets_reload_time = 600;
rockets_reload = rockets_reload_time;
hit_phase = 1000;
hit_x = x;
hit_y = y;
damage_aabb = new Object();
damage_aabb.dx = -16;
damage_aabb.dy = -16;
damage_aabb.w = 32;
damage_aabb.h = 32;
damage_aabb.x = x;
damage_aabb.y = y;
_mode = 0;
phase = 0;
damage = 0;
}
function Update() {
var _local4 = 0;
landed = false;
var _local3 = 0;
while (_local3 < n_joints) {
objects[_local3].y = objects[_local3].y + _root.gravity_y;
objects[_local3].Update();
if (objects[_local3].collided == 3) {
landed = true;
}
_local4 = Math.max(_local4, objects[_local3].hit_f);
_local3++;
}
x = head.x;
y = head.y;
Collisions();
Balance();
if ((life <= gun_destroy_hp) && (damage == 0)) {
damage = 1;
gun_link.sprite.gotoAndPlay("die");
_mode = 2;
phase = 0;
back.UnFix();
behavior = HeadAttack;
rockets_reload_time = 400;
_root.add_score(10000);
return(undefined);
}
if ((life <= 0) && (damage == 1)) {
damage = 2;
sprite.head.gotoAndPlay("die");
sprite.back.gotoAndPlay("die");
_mode = 4;
phase = 0;
back.UnFix();
head.UnFix();
_root.add_score(100000);
return(undefined);
}
switch (_mode) {
case 0 :
foots[0].Fix();
foots[1].Fix();
foots[0].collided = 3;
foots[1].collided = 3;
if (phase > 4) {
phase = 0;
_mode = 1;
}
break;
case 1 :
behavior();
break;
case 2 :
if (phase > 20) {
phase = 0;
_mode = 3;
sprite.back.gotoAndPlay("damage1");
shot_mode = 0;
shot_phase = 0;
}
gun_link.Update();
gun_link.Render();
break;
case 3 :
behavior();
break;
case 4 :
if (phase < 30) {
AnimateHands();
}
if (phase > 80) {
_mode = 5;
damage = 3;
foots[0].UnFix();
foots[1].UnFix();
Update = UpdateDead;
_root.level.core_boss_killed = true;
}
break;
case 5 :
if (!_root.ragdolls_free) {
break;
}
addv(-1, 0, 0.2);
}
phase++;
if (_root.knight.getx() > (x - 50)) {
_root.knight.x = x - 50;
}
_local3 = n_joints;
while (_local3 < objects.length) {
objects[_local3].Update();
_local3++;
}
_local3 = n_joints;
while (_local3 < objects.length) {
objects[_local3].Render();
_local3++;
}
if (damage == 1) {
sprite.head._rotation = gun_dir - 90;
}
sprite.leg2._x = sprite.leg2._x - 30;
if (damage == 0) {
gun_link.Update();
gun_link.Render();
}
leg1.sprite.gotoAndStop(100 - int(_root.limit(leg1.new_r * 0.8, 0, 99)));
leg2.sprite.gotoAndStop(100 - int(_root.limit(leg2.new_r * 0.8, 0, 99)));
gun_reload--;
pain_head--;
pain_tors--;
activate_delay--;
if (gun_reload == (reload_time - 10)) {
head.UnFix();
}
if ((random(1000) < 25) && (sprite.head.mask.safe)) {
sprite.head.mask.gotoAndPlay("look_back");
}
}
function UpdateDead() {
landed = false;
var _local3 = 0;
while (_local3 < n_joints) {
objects[_local3].y = objects[_local3].y + (_root.gravity_y * 0.1);
objects[_local3].Update();
addv(-0.1, 0, 0.5);
_local3++;
}
_local3 = n_joints;
while (_local3 < objects.length) {
objects[_local3].Update();
_local3++;
}
_local3 = n_joints;
while (_local3 < objects.length) {
objects[_local3].Render();
_local3++;
}
sprite.leg2._x = sprite.leg2._x - 30;
leg1.sprite.gotoAndStop(100 - int(_root.limit(leg1.new_r * 0.8, 0, 99)));
leg2.sprite.gotoAndStop(100 - int(_root.limit(leg2.new_r * 0.8, 0, 99)));
x = head.x;
y = head.y;
}
function HeadAttack() {
if (action_reload < 0) {
action_reload = random(50) + 100;
steps = random(3) + 1;
if ((random(100) > 30) || (x < (left_bound + 50))) {
dir = 1;
var _local5 = (x - left_bound) / (right_bound - left_bound);
if (random(100) < (100 * _local5)) {
dir = -1;
}
if ((x - _root.knight.getx()) > 500) {
dir = -1;
}
if (x < left_bound) {
dir = 1;
}
if (x > right_bound) {
dir = -1;
}
StartWalk();
}
}
if (steps && (shot_mode != 1)) {
Walk();
}
var _local9 = _root.level.rocket_stage.core_boss_blast_up._y + _root.level.rocket_stage._y;
var _local8 = _root.level.rocket_stage.core_boss_blast_down._y + _root.level.rocket_stage._y;
switch (shot_mode) {
case 0 :
if (phase >= hyperblast_reload_time) {
sprite.head.mask.gotoAndPlay("hyperblast");
shot_mode = 1;
phase = 0;
steps = 0;
}
Target2(_root.knight.getx(), _root.knight.gety());
break;
case 1 :
if (phase >= 25) {
var _local3 = sprite.head._rotation - 90;
_root.p.x = sprite.head.barrel._x;
_root.p.y = sprite.head.barrel._y;
_root.p = sprite.head.transform.matrix.transformPoint(_root.p);
_root.objects.push(new HyperBlast(_root.p.x, _root.p.y, _local3, 10));
shot_mode = 2;
phase = 0;
steps = 0;
var _local7 = Math.cos(_local3 * _root.degtorad);
var _local6 = Math.sin(_local3 * _root.degtorad);
head.x = head.x + (_local7 * 10);
head.y = head.y + (_local6 * 10);
head.UnFix();
}
Target2(_root.knight.getx(), _root.knight.gety());
break;
case 2 :
if (phase >= 60) {
shot_mode = 0;
phase = 0;
}
Target2(_root.knight.getx(), _root.knight.gety());
}
var _local4 = life / gun_destroy_hp;
hyperblast_reload_time = 60 - (_local4 * 20);
rockets_reload_time = 400 - (_local4 * 100);
AnimateHands();
if (shot_mode != 1) {
if (rockets_reload < 0) {
sprite.head.rockets.gotoAndPlay("charge");
gun_reload = 200;
rockets_reload = rockets_reload_time;
action_reload = 180;
}
rockets_reload--;
if (((x - _root.knight.getx()) < 200) && (x > (left_bound + 50))) {
StartHit();
behavior = Hit;
sprite.back.gotoAndPlay("hit_no_gun");
return(undefined);
}
Rockets();
}
action_reload--;
shot_phase++;
hyperblast_reload--;
}
function Target2(tx, ty) {
var _local4 = sprite.head._x;
var _local5 = sprite.head._y;
var _local6 = (Math.atan2(_local5 - ty, _local4 - tx) * _root.radtodeg) - 180;
var _local3 = _local6 - gun_dir;
while (_local3 > 180) {
_local3 = _local3 - 360;
}
while (_local3 < -180) {
_local3 = _local3 + 360;
}
gun_dir = gun_dir + (_local3 * 0.2);
}
function GunAttack() {
if (action_reload < 0) {
action_reload = random(50) + 100;
steps = random(3) + 1;
if ((random(100) > 30) || (x < (left_bound + 50))) {
dir = 1;
var _local5 = (x - left_bound) / (right_bound - left_bound);
if (random(100) < (100 * _local5)) {
dir = -1;
}
if ((x - _root.knight.getx()) > 500) {
dir = -1;
}
if (x < left_bound) {
dir = 1;
}
if (x > right_bound) {
dir = -1;
}
StartWalk();
}
}
if (steps) {
Walk();
}
var _local4;
var _local3;
if ((shot_mode == 1) || (shot_mode == 2)) {
_root.p.x = sprite.back.__target._x;
_root.p.y = sprite.back.__target._y;
_root.p = sprite.back.transform.matrix.transformPoint(_root.p);
_local4 = _root.p.x;
_local3 = _root.p.y;
}
var _local6 = (maxlife - life) / (maxlife - gun_destroy_hp);
reload_time = 30 - (_local6 * 10);
reload_time = _root.limit(reload_time, 20, 30);
switch (shot_mode) {
case 0 :
if (targeted && (gun_reload <= 0)) {
sprite.gun.gotoAndPlay("shot");
gun_reload = reload_time;
sprite.gun.ready = true;
}
Target(_root.knight.getx(), _root.knight.gety());
if (shot_phase > 300) {
shot_phase = 0;
shot_mode = 1;
if (random(100) < 30) {
sprite.back.gotoAndStop("multishot1");
} else {
sprite.back.gotoAndStop("multishot2");
}
}
break;
case 1 :
if ((shot_phase > 30) && (targeted)) {
shot_phase = 0;
shot_mode = 2;
sprite.gun.gotoAndPlay("multishot");
sprite.back.play();
target_speed = 0.2;
back.Fix();
}
Target(_local4, _local3);
action_reload = 50;
if (steps > 1) {
steps = 1;
}
break;
case 2 :
if (shot_phase > 100) {
shot_phase = 0;
shot_mode = 0;
target_speed = 0.05;
back.UnFix();
}
Target(_local4, _local3);
action_reload = 50;
}
if ((shot_mode != 1) && (shot_mode != 2)) {
if (rockets_reload < 0) {
sprite.head.rockets.gotoAndPlay("charge");
gun_reload = 200;
rockets_reload = rockets_reload_time;
action_reload = 180;
}
rockets_reload--;
if (((x - _root.knight.getx()) < 200) && (x > (left_bound + 50))) {
StartHit();
behavior = Hit;
return(undefined);
}
}
Rockets();
action_reload--;
shot_phase++;
}
function AnimateHands() {
var _local3;
var _local4;
var _local6;
var _local5;
if ((shot_mode == 1) || (shot_mode == 2)) {
_root.p.x = sprite.head.mask.hand_pos._x;
_root.p.y = sprite.head.mask.hand_pos._y;
_root.p = sprite.head.mask.back.transform.matrix.transformPoint(_root.p);
_root.p = sprite.head.transform.matrix.transformPoint(_root.p);
_local3 = _root.p.x;
_local4 = _root.p.y;
}
if (((shot_mode != 1) && (shot_mode != 2)) || (!_local3)) {
_root.p.x = sprite.back.__target._x;
_root.p.y = sprite.back.__target._y;
_root.p = sprite.back.transform.matrix.transformPoint(_root.p);
_local3 = _root.p.x;
_local4 = _root.p.y;
}
_root.p.x = sprite.back.gun_pos._x;
_root.p.y = sprite.back.gun_pos._y;
_root.p = sprite.back.transform.matrix.transformPoint(_root.p);
_local6 = _root.p.x;
_local5 = _root.p.y;
gun_link.a.x = _root.interpolate(gun_link.a.x, _local3, 0.25);
gun_link.a.y = _root.interpolate(gun_link.a.y, _local4, 0.25);
gun_link.b.x = _root.interpolate(gun_link.a.x, _local6, 0.25);
gun_link.b.y = _root.interpolate(gun_link.a.y, _local5, 0.25);
}
function sort_left(a, b) {
if (a.x < b.x) {
return(1);
}
return(-1);
}
function sort_right(a, b) {
if (a.x > b.x) {
return(1);
}
return(-1);
}
function StartWalk() {
if (life <= 0) {
return(undefined);
}
if (dir < 0) {
foots.sort(sort_left);
} else {
foots.sort(sort_right);
}
overstep_foot = foots[1];
active_foot = foots[0];
foot_angle = Math.atan2(active_foot.y - overstep_foot.y, active_foot.x - overstep_foot.x);
step_dist = 0;
d_foot_angle = dir * step_speed;
active_foot.UnFix();
hit_phase = 0;
}
function Walk() {
if (life <= 0) {
return(undefined);
}
if (!active_foot) {
StartWalk();
} else if (dir) {
foot_angle = foot_angle + d_foot_angle;
step_dist = step_dist + Math.abs(d_foot_angle);
var _local6 = overstep_foot.x + (Math.cos(foot_angle) * step_r);
var _local4 = overstep_foot.y + ((Math.sin(foot_angle) * step_r) * 0.5);
var _local5 = _local6 - active_foot.x;
var _local3 = _local4 - active_foot.y;
active_foot.x = active_foot.x + (_local5 * 0.25);
active_foot.y = active_foot.y + (_local3 * 0.25);
if ((step_dist > 0.5) && (active_foot.collided)) {
steps--;
active_foot.Fix();
if (steps > 0) {
StartWalk();
} else {
dir = 0;
}
_root.sound("snd_mech_step");
}
if (step_dist > 5) {
StartWalk();
}
}
}
function Balance() {
if (damage == 3) {
return(undefined);
}
if (!overstep_foot.collided) {
return(undefined);
}
overstep_foot.Fix();
var _local4 = (overstep_foot.y * 0.7) + (active_foot.y * 0.3);
var _local5 = 190;
if ((_local4 - head.y) < _local5) {
head.y = head.y + (((_local4 - back.y) - _local5) * 0.2);
}
head.y = head.y - 5;
butt.y = butt.y + 5;
var _local3 = ((foots[0].x + foots[1].x) * 0.5) + (dir * 40);
back.x = _root.interpolate(back.x, _local3, 0.05);
head.x = _root.interpolate(head.x, _local3, 0.05);
}
function SetSide() {
var _local2 = n_joints;
while (_local2 < objects.length) {
if (objects[_local2].sprite) {
objects[_local2].sprite._yscale = (-side) * 100;
}
_local2++;
}
}
function Target(tx, ty) {
var _local9 = Math.cos(gun_dir * _root.degtorad);
var _local8 = Math.sin(gun_dir * _root.degtorad);
var _local5 = (_local9 * gun_link.r) * 0.5;
var _local4 = (_local8 * gun_link.r) * 0.5;
var _local7;
var _local6;
if (shot_mode == 0) {
if (objects[1].x < (objects[2].x - 10)) {
objects[1].x = objects[2].x - 10;
}
_local7 = back.x - 52;
_local6 = (back.y + 55) - (_local8 * 50);
} else {
if (objects[1].y < (objects[2].y - 5)) {
objects[1].y = objects[2].y - 5;
}
_root.p.x = sprite.back.gun_pos._x;
_root.p.y = sprite.back.gun_pos._y;
_root.p = sprite.back.transform.matrix.transformPoint(_root.p);
_local7 = _root.p.x;
_local6 = _root.p.y;
}
gunx = _root.interpolate(gunx, _local7, 0.25);
guny = _root.interpolate(guny, _local6, 0.25);
if ((gun_reload > (reload_time - 5)) && (gun_reload < reload_time)) {
gunx = gunx - ((gun_reload - reload_time) * 2);
}
var _local10 = (Math.atan2(guny - ty, gunx - tx) * _root.radtodeg) - 180;
var _local3 = _local10 - gun_dir;
while (_local3 > 180) {
_local3 = _local3 - 360;
}
while (_local3 < -180) {
_local3 = _local3 + 360;
}
gun_dir = gun_dir + (_local3 * target_speed);
gun_link.a.x = gunx - _local5;
gun_link.a.y = guny - _local4;
gun_link.b.x = gunx + _local5;
gun_link.b.y = guny + _local4;
targeted = _local3 < 10;
if (sprite.gun.ready) {
_root.p.x = sprite.gun.barrel._x;
_root.p.y = sprite.gun.barrel._y;
_root.p = sprite.gun.transform.matrix.transformPoint(_root.p);
_root.objects.push(new Fireball("fireball_red", _root.p.x, _root.p.y, gun_dir, 8, 10, 15, 8));
_root.sound("snd_blaster2");
}
sprite.gun._rotation = gun_dir;
}
function Rockets() {
if (sprite.head.rockets.ready) {
_root.p.x = sprite.head.rockets.barrel._x;
_root.p.y = sprite.head.rockets.barrel._y;
_root.p = sprite.head.rockets.transform.matrix.transformPoint(_root.p);
_root.p = sprite.head.transform.matrix.transformPoint(_root.p);
var _local3 = new EnemyRocket("rocket", _root.p.x, _root.p.y, dir + 180, 10, 7, 9);
_local3.w = rocket_w;
rocket_w = -rocket_w;
_root.objects.push(_local3);
}
}
function StartHit() {
if (((!steps) || (!overstep_foot)) || (!active_foot)) {
foots.sort(sort_left);
overstep_foot = foots[1];
active_foot = foots[0];
overstep_foot.Fix();
active_foot.UnFix();
hit_phase = 0;
}
hit_x = active_foot.x;
hit_y = active_foot.y + 10;
if (steps > 1) {
steps = 1;
}
}
function Hit() {
if (damage == 0) {
Target(_root.knight.getx(), _root.knight.gety());
}
if (damage == 1) {
AnimateHands();
}
var _local3 = 30;
if (steps && (dir)) {
Walk();
if (!steps) {
StartHit();
}
return(undefined);
}
if (steps && (!dir)) {
StartHit();
steps = 0;
return(undefined);
}
gun_reload = gun_reload + 1;
hit_phase++;
var _local6 = overstep_foot.x - 160;
var _local5 = overstep_foot.y - 80;
var _local4 = hit_phase / _local3;
if (_local4 > 1) {
_local4 = 1;
}
active_foot.x = _root.interpolate(_root.interpolate(hit_x, _local6, _local4), active_foot.x, 0.4);
active_foot.y = _root.interpolate(_root.interpolate(hit_y, _local5, _local4), active_foot.y, 0.4);
if ((hit_phase < _local3) && (hit_phase > (_local3 * 0.3))) {
damage_aabb.x = active_foot.x;
damage_aabb.y = active_foot.y;
if (_root.knight.pain <= 0) {
if (_root.CollideKnight(damage_aabb)) {
_root.DamageKnight(5, -20, -4);
_root.sound("snd_hit");
}
}
}
hit_phase++;
if (hit_phase >= (_local3 + 20)) {
hit_phase = 0;
dir = -1;
steps = 1;
action_reload = 120;
foot_angle = Math.atan2(active_foot.y - overstep_foot.y, active_foot.x - overstep_foot.x);
step_dist = 0;
d_foot_angle = dir * step_speed;
if (damage == 0) {
behavior = GunAttack;
}
if (damage == 1) {
behavior = HeadAttack;
}
return(undefined);
}
}
function Kill() {
life = -10000;
removeMovieClip(sprite);
var _local2 = 0;
while (_local2 < objects.length) {
delete objects[_local2];
objects.splice(_local2, 1);
_local2++;
}
}
function Alive() {
return(life > -10000);
}
function InGame() {
if ((x + 100) < _root.left_border) {
return(false);
}
if ((x - 100) > _root.right_border) {
return(false);
}
if ((y + 100) < _root.top_border) {
return(false);
}
if ((y - 100) > _root.bottom_border) {
return(false);
}
return(true);
}
function Freeze() {
if (life > 0) {
return(true);
}
if (on_die) {
return(true);
}
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
function addv(vx, vy, rand) {
var _local2 = 0;
while (_local2 < 11) {
objects[_local2].x = objects[_local2].x + (vx + ((Math.random() - 0.5) * rand));
objects[_local2].y = objects[_local2].y + (vy + ((Math.random() - 0.5) * rand));
_local2++;
}
}
function getspeed() {
var _local3 = objects[6].x - objects[6].oldx;
var _local2 = objects[6].y - objects[6].oldy;
return(Math.sqrt((_local3 * _local3) + (_local2 * _local2)));
}
function joint(part_name, m, r) {
var _local2 = new JointCBLF(sprite[part_name]._x, sprite[part_name]._y, m, r, "no");
objects.push(_local2);
objects[objects.length - 1].id = part_name;
return(_local2);
}
function jointf(part_name, m, r) {
var _local2 = new JointCBLF(sprite[part_name]._x, sprite[part_name]._y, m, r, "no");
objects.push(_local2);
objects[objects.length - 1].id = part_name;
foots.push(_local2);
return(_local2);
}
function jointno(part_name, m, r) {
var _local2 = new Joint(sprite[part_name]._x, sprite[part_name]._y, m);
objects.push(_local2);
objects[objects.length - 1].id = part_name;
return(_local2);
}
function link(name1, name2, k, part_name) {
var _local4;
var _local3;
var _local2 = 0;
while (_local2 < n_joints) {
if (objects[_local2].id == name1) {
_local4 = objects[_local2];
}
if (objects[_local2].id == name2) {
_local3 = objects[_local2];
}
if (_local4 && (_local3)) {
break;
}
_local2++;
}
var _local5;
if (k > 0) {
if (part_name) {
_local5 = new LinkSprite(_local4, _local3, k, sprite[part_name]);
} else {
_local5 = new Link(_local4, _local3, k);
}
} else if (part_name) {
_local5 = new LinkPush(_local4, _local3, (-k) * 0.025);
objects.push(_local5);
_local5 = new LinkSpritePull(_local4, _local3, -k, sprite[part_name]);
} else {
_local5 = new LinkPush(_local4, _local3, -k);
}
objects.push(_local5);
return(_local5);
}
function AddSpeed(vx, vy, rnd) {
var _local2 = 0;
while (_local2 < n_joints) {
objects[_local2].x = objects[_local2].x + ((vx + (Math.random() * rnd)) - (rnd * 0.5));
objects[_local2].y = objects[_local2].y + ((vy + (Math.random() * rnd)) - (rnd * 0.5));
_local2++;
}
}
function Activate() {
activated = true;
}
function Gibs(__x, __y, n_gibs) {
var _local2 = 0;
while (_local2 < n_gibs) {
_root.objects.push(new SpinningGib("metal_gibs", __x, __y, random(360), 15, 10, random(8) + 20, 4));
_local2++;
}
}
function Collisions() {
if (life <= 0) {
color_head.setTransform(_root.white);
return(undefined);
}
var _local3 = _root.CollideBullets(head.aabb);
if (_local3 > 0) {
pain_head = 4;
life = life - _local3;
color_head.setTransform(_root.light_orange);
_root.sound("snd_metal_bullet" + (random(3) + 1), 25);
head.x = head.x + (_root.p.x / 4000);
head.y = head.y + (_root.p.y / 4000);
} else if (pain_head == 0) {
color_head.setTransform(_root.white);
}
}
function Pause() {
switch (sprite.back._currentframe) {
case 1 :
case 80 :
case 160 :
case 229 :
case 275 :
case 346 :
case 401 :
case 431 :
break;
default :
sprite.back.stop();
}
switch (sprite.head._currentframe) {
case 1 :
case 66 :
break;
default :
sprite.head.stop();
}
switch (sprite.head.wings._currentframe) {
case 1 :
case 11 :
break;
default :
sprite.head.wings.stop();
}
if (sprite.head.mask._currentframe >= 118) {
sprite.head.mask.stop();
}
switch (sprite.head.rockets._currentframe) {
case 1 :
case 203 :
break;
default :
sprite.head.rockets.stop();
}
switch (sprite.gun._currentframe) {
case 1 :
case 124 :
break;
default :
sprite.gun.stop();
}
}
function UnPause() {
switch (sprite.back._currentframe) {
case 1 :
case 80 :
case 160 :
case 229 :
case 275 :
case 346 :
case 401 :
case 431 :
break;
default :
sprite.back.play();
}
switch (sprite.head._currentframe) {
case 1 :
case 66 :
break;
default :
sprite.head.play();
}
switch (sprite.head.wings._currentframe) {
case 1 :
case 11 :
break;
default :
sprite.head.wings.play();
}
if (sprite.head.mask._currentframe >= 118) {
sprite.head.mask.play();
}
switch (sprite.head.rockets._currentframe) {
case 1 :
case 203 :
break;
default :
sprite.head.rockets.play();
}
switch (sprite.gun._currentframe) {
case 1 :
case 124 :
break;
default :
sprite.gun.play();
}
}
var reload_time = 30;
var step_speed = 0.05;
var step_r = 125;
var hyperblast_reload = 100;
var hyperblast_reload_time = 60;
var maxlife = 7400;
var gun_destroy_hp = 5000;
}
Symbol 3249 MovieClip [__Packages.HyperBlast] Frame 0
class HyperBlast extends Obj
{
var x, y, sprite, aabb, damage, collided, dir, color_shift, color_background, color_level;
function HyperBlast (__x, __y, _dir, _damage) {
x = __x;
y = __y;
var _local4 = _root.get_id();
sprite = _root.objects_layer.attachMovie("hyper_blast", "hb" + _local4, _local4 + (_root.depth_band * 12));
sprite._x = x;
sprite._y = y;
sprite._rotation = _dir;
aabb = new Object();
aabb.w = sprite.damage._width;
aabb.h = sprite.damage._height;
aabb.x = x + sprite.damage._x;
aabb.y = y + sprite.damage._y;
damage = _damage;
collided = false;
dir = _dir;
_root.sound("snd_hyperblast");
color_shift = new Color(sprite._color);
color_background = new Color(_root.backgrounds[1].sprite);
color_level = new Color(_root.level);
}
function Update() {
color_background.setTransform(color_shift.getTransform());
color_level.setTransform(color_shift.getTransform());
if (!collided) {
if (sprite._start) {
_root.p.x = sprite._start._x;
_root.p.y = sprite._start._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local8 = _root.p.x;
var _local6 = _root.p.y;
_root.p.x = sprite._end._x;
_root.p.y = sprite._end._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local10 = _root.p.x;
var _local9 = _root.p.y;
var _local4 = _local10 - _local8;
var _local3 = _local9 - _local6;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local11 = 20;
_local4 = _local4 * (_local11 / _local5);
_local3 = _local3 * (_local11 / _local5);
var _local7 = _root.collide_beam_knight(_local8 - _local3, _local6 + _local4, _local10 - _local3, _local9 + _local3, _local5);
if (!_local7) {
_local7 = _root.collide_beam_knight(_local8 + _local3, _local6 - _local4, _local10 + _local3, _local9 - _local3, _local5);
}
if (_local7) {
if (!_root.knight.landed) {
_local4 = _local4 * 0.5;
}
_root.DamageKnight(damage, _local4, (_local3 * 0.5) - 10);
collided = true;
}
}
}
}
function Kill() {
removeMovieClip(sprite);
delete aabb;
}
function Alive() {
if (sprite._currentframe >= 35) {
return(false);
}
return(true);
}
function Freeze() {
return(true);
}
function UnFreeze() {
}
function Pause() {
if (sprite._currentframe != 35) {
sprite.stop();
}
}
function UnPause() {
if (sprite._currentframe != 35) {
sprite.play();
}
}
}
Symbol 3250 MovieClip [__Packages.LinkSpritePull] Frame 0
class LinkSpritePull extends Obj
{
var a, b, k, r, sprite, new_r;
function LinkSpritePull (_a, _b, _k, _sprite) {
super();
a = _a;
b = _b;
k = _k;
r = _root.DistPoint(a.x, a.y, b.x, b.y);
sprite = _sprite;
new_r = r;
}
function Update() {
var _local3 = b.x - a.x;
var _local2 = b.y - a.y;
new_r = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local4 = (new_r - r) / new_r;
if (_local4 < 0) {
return(undefined);
}
_local4 = _local4 * (k / (a.mass + b.mass));
_local3 = _local3 * _local4;
_local2 = _local2 * _local4;
a.x = a.x + (b.mass * _local3);
if ((a.collided != 3) || (_local2 < 0)) {
a.y = a.y + (b.mass * _local2);
}
b.x = b.x - (a.mass * _local3);
if ((b.collided != 3) || (_local2 > 0)) {
b.y = b.y - (a.mass * _local2);
}
}
function Render() {
sprite._x = a.x;
sprite._y = a.y;
var _local4 = b.x - a.x;
var _local3 = b.y - a.y;
sprite._rotation = Math.atan2(_local3, _local4) * _root.radtodeg;
}
}
Symbol 58 MovieClip Frame 48
var gb = new SpinningGib("metal_gibs", _parent._x, _parent._y, _rotation, 10, 15, 18, 14);
gb.life = 500;
_root.objects.push(gb);
stop();
Symbol 77 MovieClip Frame 1
stop();
Symbol 77 MovieClip Frame 2
gotoAndPlay(random(15) + 3);
Symbol 102 MovieClip Frame 12
stop();
Symbol 106 MovieClip Frame 1
stop();
Symbol 106 MovieClip Frame 7
gotoAndStop (1);
Symbol 106 MovieClip Frame 13
var i = 0;
while (i < 3) {
_root.objects.push(new SpinningGib("metal_gibs", _x, _y, random(360), 10, 10, random(16) + 1, 14));
i++;
}
Symbol 106 MovieClip Frame 19
var i = 0;
while (i < 8) {
_root.objects.push(new SpinningGib("metal_gibs", _x, _y, random(360), 20, 10, random(16) + 1, 14));
i++;
}
Symbol 106 MovieClip Frame 22
var i = 0;
while (i < 4) {
_root.objects.push(new SpinningGib("metal_gibs", _x, _y, random(360), 10, 10, random(16) + 1, 14));
i++;
}
Symbol 106 MovieClip Frame 28
var gb = new SpinningGib("metal_gibs", _x, _y, _rotation, 10, 30, 17, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 106 MovieClip Frame 34
stop();
Symbol 109 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 7
gotoAndStop (1);
Symbol 109 MovieClip Frame 13
var i = 0;
while (i < 3) {
_root.objects.push(new SpinningGib("metal_gibs", _x, _y, random(360), 10, 10, random(16) + 1, 14));
i++;
}
Symbol 109 MovieClip Frame 19
var i = 0;
while (i < 8) {
_root.objects.push(new SpinningGib("metal_gibs", _x, _y, random(360), 10, 10, random(16) + 1, 14));
i++;
}
Symbol 109 MovieClip Frame 22
var i = 0;
while (i < 4) {
_root.objects.push(new SpinningGib("metal_gibs", _x, _y, random(360), 10, 10, random(16) + 1, 14));
i++;
}
Symbol 109 MovieClip Frame 28
var gb = new SpinningGib("metal_gibs", _x, _y, _rotation, 10, 30, 17, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 109 MovieClip Frame 34
stop();
Symbol 111 MovieClip [pointer] Frame 1
_visible = false;
Symbol 111 MovieClip [pointer] Frame 2
stop();
Symbol 133 MovieClip Frame 1
stop();
ready = false;
end_shot = false;
_parent.end_glow._visible = false;
Symbol 133 MovieClip Frame 2
end_shot = false;
Symbol 133 MovieClip Frame 24
beam_h._visible = false;
beam._yscale = beam_h._yscale;
Symbol 133 MovieClip Frame 25
ready = true;
_parent.end_glow._visible = true;
beam._yscale = beam_h._yscale;
Symbol 133 MovieClip Frame 26
beam._yscale = beam_h._yscale;
Symbol 133 MovieClip Frame 27
beam._yscale = beam_h._yscale;
Symbol 133 MovieClip Frame 28
beam._yscale = beam_h._yscale;
Symbol 133 MovieClip Frame 69
ready = false;
_parent.end_glow._visible = false;
beam_h._visible = false;
beam._yscale = beam_h._yscale;
Symbol 133 MovieClip Frame 70
beam._yscale = beam_h._yscale;
Symbol 133 MovieClip Frame 71
beam._yscale = beam_h._yscale;
Symbol 133 MovieClip Frame 72
beam._yscale = beam_h._yscale;
Symbol 133 MovieClip Frame 73
beam._yscale = beam_h._yscale;
Symbol 133 MovieClip Frame 109
end_shot = true;
stop();
Symbol 133 MovieClip Frame 110
ready = false;
end_shot = false;
Symbol 133 MovieClip Frame 129
ready = true;
stop();
Symbol 133 MovieClip Frame 130
ready = false;
Symbol 133 MovieClip Frame 150
gotoAndStop ("safe");
end_shot = true;
Symbol 195 MovieClip Frame 1
flame._rotation = random(4) - 2;
Symbol 195 MovieClip Frame 2
flame._rotation = random(4) - 2;
Symbol 202 MovieClip Frame 1
_name = "bod";
Symbol 225 MovieClip Frame 1
stop();
Symbol 246 MovieClip Frame 1
stop();
Symbol 252 MovieClip Frame 174
stop();
Symbol 252 MovieClip Frame 200
gotoAndPlay ("throw_grenade");
Symbol 253 MovieClip Frame 1
stop();
Symbol 294 MovieClip Frame 1
var ready = false;
play();
Symbol 294 MovieClip Frame 20
ready = true;
stop();
Symbol 294 MovieClip Frame 21
ready = false;
Symbol 294 MovieClip Frame 27
gotoAndStop ("pistol_shot");
Symbol 294 MovieClip Frame 28
ready = false;
play();
Symbol 294 MovieClip Frame 52
ready = true;
stop();
Symbol 294 MovieClip Frame 53
ready = false;
Symbol 294 MovieClip Frame 71
gotoAndStop ("riffle_shot");
Symbol 294 MovieClip Frame 72
ready = false;
Symbol 294 MovieClip Frame 93
ready = true;
stop();
Symbol 294 MovieClip Frame 94
ready = false;
Symbol 294 MovieClip Frame 96
gotoAndStop ("smg_shot");
Symbol 294 MovieClip Frame 101
ready = false;
Symbol 294 MovieClip Frame 118
Symbol 294 MovieClip Frame 120
ready = true;
stop();
Symbol 294 MovieClip Frame 121
ready = false;
Symbol 294 MovieClip Frame 151
gotoAndStop ("grenade_shot");
Symbol 294 MovieClip Frame 158
ready = false;
Symbol 294 MovieClip Frame 167
ready = true;
stop();
Symbol 294 MovieClip Frame 177
stop();
Symbol 294 MovieClip Frame 189
gotoAndStop ("mace_shot");
Symbol 296 MovieClip [human] Frame 1
Symbol 296 MovieClip [human] Frame 20
gotoAndPlay (1);
Symbol 296 MovieClip [human] Frame 40
gotoAndPlay (21);
Symbol 296 MovieClip [human] Frame 60
gotoAndPlay (41);
Symbol 296 MovieClip [human] Frame 80
gotoAndPlay (61);
Symbol 296 MovieClip [human] Frame 100
gotoAndPlay (81);
Symbol 296 MovieClip [human] Frame 106
stop();
Symbol 296 MovieClip [human] Frame 112
stop();
Symbol 296 MovieClip [human] Frame 125
gotoAndPlay (41);
Symbol 296 MovieClip [human] Frame 135
stop();
Symbol 296 MovieClip [human] Frame 144
stop();
Symbol 296 MovieClip [human] Frame 149
gotoAndStop (154);
Symbol 296 MovieClip [human] Frame 154
stop();
Symbol 296 MovieClip [human] Frame 155
Symbol 296 MovieClip [human] Frame 160
stop();
Symbol 296 MovieClip [human] Frame 169
gotoAndStop ("sit");
Symbol 296 MovieClip [human] Frame 193
gotoAndPlay ("jetpack_fly");
Symbol 296 MovieClip [human] Frame 205
gotoAndPlay ("stand_gun");
Symbol 296 MovieClip [human] Frame 209
var rag = new Ragdoll(_x, _y, this, head, bod, a11, a12, a21, a22, but, l11, l12, l21, l22, m_damage_vx, m_damage_vy, _root.jet_death);
if (hero == true) {
_root.recent_ragdoll = rag;
}
_root.objects.push(rag);
_root.jet_death = false;
stop();
Symbol 296 MovieClip [human] Frame 215
var rag = new Ragdoll(_x, _y, this, head, bod, a11, a12, a21, a22, but, l11, l12, l21, l22, m_damage_vx, m_damage_vy, _root.jet_death);
if (hero == true) {
_root.recent_ragdoll = rag;
}
_root.objects.push(rag);
_root.jet_death = false;
stop();
Symbol 296 MovieClip [human] Frame 220
_root.PushObject(new Ragdoll(_x, _y, this, head, bod, a11, a12, a21, a22, but, l11, l12, l21, l22, _root.damage_vx, _root.damage_vy));
stop();
Symbol 296 MovieClip [human] Frame 224
_root.PushObject(new Ragdoll(_x, _y, this, head, bod, a11, a12, a21, a22, but, l11, l12, l21, l22, _root.damage_vx, _root.damage_vy));
stop();
Symbol 323 MovieClip [grenade] Frame 1
stop();
Symbol 323 MovieClip [grenade] Frame 2
if (random(100) < 50) {
_xscale = -100;
}
Symbol 323 MovieClip [grenade] Frame 21
stop();
Symbol 333 MovieClip [pistol_bullet] Frame 1
stop();
flame.gotoAndPlay(random(6) + 1);
Symbol 333 MovieClip [pistol_bullet] Frame 5
_yscale = (random(40) + 80);
_xscale = (random(40) + 80);
if (random(100) < 50) {
_yscale = (-_yscale);
}
Symbol 333 MovieClip [pistol_bullet] Frame 9
stop();
Symbol 356 MovieClip [barrel] Frame 1
stop();
Symbol 356 MovieClip [barrel] Frame 2
_root.objects.push(new Gib("saw_gibs", _x, _y - 70, (-90 + random(30)) - 15, 15, 5, 8, 3));
Symbol 356 MovieClip [barrel] Frame 18
stop();
Symbol 364 MovieClip [mine] Frame 9
gotoAndPlay (1);
Symbol 364 MovieClip [mine] Frame 20
gotoAndPlay (11);
Symbol 364 MovieClip [mine] Frame 28
_root.sound("snd_boom");
Symbol 364 MovieClip [mine] Frame 31
_root.ExplodeKnight(_x, _y, 64, 15, 10);
_root.Quake(_x, _y, 10);
_root.objects.push(new SpinningGib("saw_gibs", _x, _y, (-random(120)) - 30, random(20) + 10, 10, 4, 10));
_root.objects.push(new SpinningGib("saw_gibs", _x, _y, (-random(120)) - 30, random(20) + 10, 10, 4, 10));
_root.objects.push(new SpinningGib("saw_gibs", _x, _y, (-random(120)) - 30, random(20) + 10, 10, 4, 10));
Symbol 364 MovieClip [mine] Frame 41
stop();
Symbol 376 MovieClip Frame 1
stop();
Symbol 376 MovieClip Frame 2
Symbol 376 MovieClip Frame 10
gotoAndStop (1);
Symbol 376 MovieClip Frame 23
gotoAndStop (1);
Symbol 380 MovieClip Frame 23
stop();
Symbol 381 MovieClip [rocket_bot] Frame 25
gotoAndPlay (1);
Symbol 381 MovieClip [rocket_bot] Frame 75
gotoAndPlay (26);
Symbol 381 MovieClip [rocket_bot] Frame 82
var i = 0;
while (i < 5) {
_root.objects.push(new SpinningGib("metal_gibs", _x, _y, random(360), 10, 10, random(7) + 9, 14));
i++;
}
Symbol 381 MovieClip [rocket_bot] Frame 83
_root.objects.push(new EnemyRocketDump("rocket", _x + 60, _y - 14, -50, 12, 10));
_root.objects.push(new EnemyRocketDump("rocket", _x + 60, _y - 14, -120, 12, 10));
Symbol 381 MovieClip [rocket_bot] Frame 185
stop();
Symbol 385 MovieClip Frame 1
stop();
Symbol 389 MovieClip [rocket] Frame 19
gotoAndPlay (5);
Symbol 389 MovieClip [rocket] Frame 20
_root.sound("snd_boom");
Symbol 389 MovieClip [rocket] Frame 21
_root.ExplodeKnight(_x, _y, 40, 20, 10);
Symbol 389 MovieClip [rocket] Frame 32
stop();
Symbol 416 MovieClip Frame 1
stop();
Symbol 416 MovieClip Frame 4
stop();
Symbol 416 MovieClip Frame 7
stop();
Symbol 416 MovieClip Frame 10
stop();
Symbol 416 MovieClip Frame 13
stop();
Symbol 416 MovieClip Frame 16
stop();
Symbol 417 MovieClip [saw] Frame 45
gotoAndPlay (35);
Symbol 417 MovieClip [saw] Frame 86
gotoAndPlay (67);
Symbol 417 MovieClip [saw] Frame 89
_root.dust(_x, _y, 3, 8);
Symbol 417 MovieClip [saw] Frame 217
stop();
Symbol 421 MovieClip Frame 42
gotoAndPlay(random(10) + 43);
Symbol 421 MovieClip Frame 70
stop();
Symbol 425 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 8
gotoAndStop (1);
Symbol 427 MovieClip Frame 15
gotoAndStop (1);
Symbol 454 MovieClip [stat_gun] Frame 1
stop();
Symbol 454 MovieClip [stat_gun] Frame 72
stop();
Symbol 454 MovieClip [stat_gun] Frame 77
_root.objects.push(new Gib("saw_gibs", _x + 37, _y + 40, random(180), 4, 5, 5, 3));
_root.objects.push(new Gib("saw_gibs", _x + 37, _y + 40, random(180), 4, 5, 6, 3));
_root.objects.push(new Gib("saw_gibs", _x + 37, _y + 40, random(180), 4, 5, 7, 3));
Symbol 454 MovieClip [stat_gun] Frame 94
stop();
Symbol 454 MovieClip [stat_gun] Frame 99
_root.objects.push(new Gib("saw_gibs", _x + 37, _y - 40, -random(180), 10, 5, 5, 3));
_root.objects.push(new Gib("saw_gibs", _x + 37, _y - 40, -random(180), 10, 5, 6, 3));
_root.objects.push(new Gib("saw_gibs", _x + 37, _y - 40, -random(180), 10, 5, 7, 3));
Symbol 454 MovieClip [stat_gun] Frame 115
stop();
Symbol 454 MovieClip [stat_gun] Frame 122
stop();
Symbol 454 MovieClip [stat_gun] Frame 193
stop();
Symbol 464 MovieClip Frame 25
gotoAndPlay (10);
Symbol 464 MovieClip Frame 26
_root.sound("snd_big_boom");
Symbol 464 MovieClip Frame 39
gotoAndPlay(40 + random(7));
_root.sound("snd_alarm");
Symbol 464 MovieClip Frame 52
Symbol 464 MovieClip Frame 60
gotoAndPlay (40);
Symbol 470 MovieClip [cargo_ship] Frame 8
stop();
Symbol 470 MovieClip [cargo_ship] Frame 20
stop();
Symbol 470 MovieClip [cargo_ship] Frame 32
gotoAndStop ("idle");
Symbol 470 MovieClip [cargo_ship] Frame 63
gotoAndPlay ("burn");
Symbol 470 MovieClip [cargo_ship] Frame 111
stop();
Symbol 481 MovieClip [blood] Frame 1
_xscale = (_xscale + (random(30) - 15));
if (random(100) < 50) {
_yscale = (-_yscale);
}
Symbol 486 MovieClip Frame 46
stop();
Symbol 486 MovieClip Frame 56
stop();
Symbol 489 MovieClip Frame 1
stop();
Symbol 490 MovieClip [bonus_gun] Frame 20
gotoAndPlay (1);
Symbol 490 MovieClip [bonus_gun] Frame 21
Symbol 490 MovieClip [bonus_gun] Frame 34
stop();
Symbol 495 MovieClip [bonus_railgun] Frame 25
gotoAndPlay (15);
Symbol 495 MovieClip [bonus_railgun] Frame 34
stop();
Symbol 515 MovieClip [gold] Frame 1
stop();
Symbol 515 MovieClip [gold] Frame 10
stop();
Symbol 518 MovieClip Frame 15
stop();
Symbol 518 MovieClip Frame 25
stop();
Symbol 538 MovieClip [heal] Frame 20
gotoAndPlay (1);
Symbol 538 MovieClip [heal] Frame 21
_root.knight.color.setTransform(_root.green);
Symbol 538 MovieClip [heal] Frame 34
_root.knight.color.setTransform(_root.white);
stop();
Symbol 541 MovieClip Frame 15
stop();
Symbol 541 MovieClip Frame 25
stop();
Symbol 561 MovieClip [heal_med] Frame 20
gotoAndPlay (1);
Symbol 561 MovieClip [heal_med] Frame 21
_root.knight.color.setTransform(_root.green);
Symbol 561 MovieClip [heal_med] Frame 34
_root.knight.color.setTransform(_root.white);
stop();
Symbol 616 MovieClip Frame 1
stop();
Symbol 619 MovieClip Frame 13
stop();
Symbol 620 MovieClip [fire_bullet] Frame 1
stop();
flame.gotoAndPlay(random(6) + 1);
Symbol 620 MovieClip [fire_bullet] Frame 5
_yscale = (random(40) + 80);
_xscale = (random(40) + 80);
if (random(100) < 50) {
_yscale = (-_yscale);
}
Symbol 620 MovieClip [fire_bullet] Frame 7
_root.dust(_x, _y, 3, 5);
Symbol 620 MovieClip [fire_bullet] Frame 9
stop();
Symbol 621 MovieClip [argon_bullet] Frame 1
stop();
flame.gotoAndPlay(random(6) + 1);
Symbol 621 MovieClip [argon_bullet] Frame 5
_yscale = (random(40) + 80);
_xscale = (random(40) + 80);
if (random(100) < 50) {
_yscale = (-_yscale);
}
Symbol 621 MovieClip [argon_bullet] Frame 9
stop();
Symbol 623 MovieClip Frame 1
stop();
Symbol 623 MovieClip Frame 26
stop();
Symbol 623 MovieClip Frame 41
gotoAndStop (1);
Symbol 623 MovieClip Frame 51
gotoAndStop (1);
Symbol 626 MovieClip Frame 1
stop();
Symbol 626 MovieClip Frame 2
Symbol 626 MovieClip Frame 10
gotoAndStop (1);
Symbol 626 MovieClip Frame 17
gotoAndStop (1);
Symbol 629 MovieClip Frame 2
Symbol 629 MovieClip Frame 10
gotoAndStop (1);
Symbol 630 MovieClip [enemy_bot1] Frame 25
gotoAndPlay (1);
Symbol 630 MovieClip [enemy_bot1] Frame 75
gotoAndPlay (26);
Symbol 630 MovieClip [enemy_bot1] Frame 79
var i = 0;
while (i < 4) {
_root.objects.push(new Gib("saw_gibs", _x, _y, (-random(120)) - 30, random(4) + 4, 5, 9, 10));
i++;
}
Symbol 630 MovieClip [enemy_bot1] Frame 81
_root.dust(_x, _y, 5, 15);
Symbol 630 MovieClip [enemy_bot1] Frame 107
stop();
Symbol 646 MovieClip [crate] Frame 1
stop();
Symbol 646 MovieClip [crate] Frame 2
_root.sound_mc_point("snd_wood_break", this, _x, 100);
Symbol 646 MovieClip [crate] Frame 4
var i = 0;
while (i < 2) {
_root.objects.push(new SpinningGib("crate_gibs", (_x + random(_width)) - (_width * 0.5), (_y + random(_height)) - (_height * 0.5), (-random(120)) - 30, random(10) + 5, 10));
i++;
}
Symbol 646 MovieClip [crate] Frame 24
stop();
Symbol 653 MovieClip [beam_emitter] Frame 1
_root.push_brick(body, 0, _x, _y, body);
body._visible = false;
Symbol 653 MovieClip [beam_emitter] Frame 2
stop();
Symbol 653 MovieClip [beam_emitter] Frame 66
gotoAndPlay (14);
Symbol 674 MovieClip [jump_pad] Frame 1
gotoAndStop (2);
Symbol 674 MovieClip [jump_pad] Frame 3
_root.sound("snd_jumppad");
Symbol 674 MovieClip [jump_pad] Frame 13
gotoAndStop (2);
Symbol 708 MovieClip Frame 1
this.ready = false;
stop();
Symbol 708 MovieClip Frame 3
this.ready = true;
Symbol 708 MovieClip Frame 4
ready = false;
Symbol 708 MovieClip Frame 6
ready = true;
Symbol 708 MovieClip Frame 7
ready = false;
Symbol 708 MovieClip Frame 8
ready = true;
Symbol 708 MovieClip Frame 9
ready = false;
Symbol 708 MovieClip Frame 11
ready = true;
Symbol 708 MovieClip Frame 12
ready = false;
Symbol 708 MovieClip Frame 14
ready = true;
Symbol 708 MovieClip Frame 15
ready = false;
Symbol 708 MovieClip Frame 17
ready = true;
Symbol 708 MovieClip Frame 18
ready = false;
Symbol 708 MovieClip Frame 20
ready = true;
Symbol 708 MovieClip Frame 21
ready = false;
Symbol 708 MovieClip Frame 22
ready = true;
Symbol 708 MovieClip Frame 23
ready = false;
Symbol 708 MovieClip Frame 25
ready = true;
Symbol 708 MovieClip Frame 26
gotoAndStop (1);
ready = false;
Symbol 708 MovieClip Frame 31
stop();
Symbol 708 MovieClip Frame 41
var gb = new SpinningGib("gunship_gibs", x, y, -170, 10, 30, 6, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 708 MovieClip Frame 43
var gb = new SpinningGib("gunship_gibs", x, y, -20, 10, 30, 5, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 708 MovieClip Frame 70
destroyed = true;
stop();
Symbol 715 MovieClip Frame 4
gotoAndPlay (1);
Symbol 715 MovieClip Frame 43
gotoAndPlay (1);
Symbol 731 MovieClip [gunship_cartrige] Frame 1
ready = false;
stop();
Symbol 731 MovieClip [gunship_cartrige] Frame 45
Symbol 731 MovieClip [gunship_cartrige] Frame 51
ready = true;
Symbol 731 MovieClip [gunship_cartrige] Frame 52
ready = false;
Symbol 731 MovieClip [gunship_cartrige] Frame 63
ready = true;
Symbol 731 MovieClip [gunship_cartrige] Frame 64
ready = false;
Symbol 731 MovieClip [gunship_cartrige] Frame 75
ready = true;
Symbol 731 MovieClip [gunship_cartrige] Frame 76
ready = false;
Symbol 731 MovieClip [gunship_cartrige] Frame 87
ready = true;
Symbol 731 MovieClip [gunship_cartrige] Frame 88
ready = false;
Symbol 731 MovieClip [gunship_cartrige] Frame 99
ready = true;
Symbol 731 MovieClip [gunship_cartrige] Frame 100
ready = false;
Symbol 731 MovieClip [gunship_cartrige] Frame 110
ready = true;
Symbol 731 MovieClip [gunship_cartrige] Frame 111
ready = false;
Symbol 731 MovieClip [gunship_cartrige] Frame 116
gotoAndStop (1);
Symbol 731 MovieClip [gunship_cartrige] Frame 119
_root.objects.push(new EnemyRocketDump("rocket", x - 30, y, 160, 12, 10));
_root.objects.push(new EnemyRocketDump("rocket", x - 30, y, 180, 12, 10));
_root.objects.push(new EnemyRocketDump("rocket", x - 30, y, 200, 12, 10));
Symbol 731 MovieClip [gunship_cartrige] Frame 136
var i = 0;
while (i < 4) {
_root.objects.push(new SpinningGib("gunship_gibs", x, y, random(360), 10, 10, random(4) + 1, 4));
i++;
}
Symbol 731 MovieClip [gunship_cartrige] Frame 141
var gb = new SpinningGib("gunship_gibs", x, y, 90, 4, 30, 7, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 731 MovieClip [gunship_cartrige] Frame 149
var gb = new SpinningGib("gunship_gibs", x, y, -45, 10, 30, 8, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 731 MovieClip [gunship_cartrige] Frame 180
destroyed = true;
stop();
Symbol 766 MovieClip [gunship] Frame 1
stop();
Symbol 766 MovieClip [gunship] Frame 13
var i = 0;
while (i < 4) {
_root.objects.push(new SpinningGib("gunship_gibs", _x + 120, _y - 30, random(360), 10, 10, random(4) + 1, 4));
i++;
}
Symbol 766 MovieClip [gunship] Frame 14
var gb = new SpinningGib("gunship_gibs", _x - 21, _y + 32, 90, 4, 30, 9, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 766 MovieClip [gunship] Frame 15
var gb = new SpinningGib("gunship_gibs", _x + 120, _y - 30, 0, 4, 30, 10, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 766 MovieClip [gunship] Frame 17
_root.objects.push(new SpinningGib("gunship_gibs", _x, _y + 30, random(360), 10, 10, 13, 2));
_root.objects.push(new SpinningGib("gunship_gibs", _x, _y + 30, random(360), 10, 10, 14, 2));
_root.objects.push(new SpinningGib("gunship_gibs", _x, _y + 30, random(360), 10, 10, 15, 2));
Symbol 766 MovieClip [gunship] Frame 19
var gb = new SpinningGib("gunship_gibs", _x + 43, _y - 50, -90, 4, 30, 12, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 766 MovieClip [gunship] Frame 23
var i = 0;
while (i < 8) {
_root.objects.push(new SpinningGib("gunship_gibs", _x + 30, _y - 20, random(360), 10, 10, random(4) + 1, 4));
i++;
}
Symbol 766 MovieClip [gunship] Frame 25
var gb = new SpinningGib("gunship_gibs", _x + 43, _y - 50, -80, 4, 30, 11, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
gb = new SpinningGib("gunship_gibs", _x + 43, _y - 50, -100, 4, 30, 11, 1);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 766 MovieClip [gunship] Frame 28
var i = 0;
while (i < 3) {
_root.objects.push(new SpinningGib("gunship_gibs", _x + 30, _y - 20, random(360), 10, 10, random(4) + 1, 4));
i++;
}
Symbol 766 MovieClip [gunship] Frame 45
stop();
Symbol 766 MovieClip [gunship] Frame 53
var i = 0;
while (i < 4) {
_root.objects.push(new SpinningGib("gunship_gibs", _x + 120, _y - 30, random(360), 10, 10, random(4) + 1, 4));
i++;
}
Symbol 766 MovieClip [gunship] Frame 54
var gb = new SpinningGib("gunship_gibs", _x + 120, _y - 30, 0, 4, 30, 10, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 766 MovieClip [gunship] Frame 62
stop();
Symbol 766 MovieClip [gunship] Frame 70
var gb = new SpinningGib("gunship_gibs", _x - 21, _y + 32, 90, 4, 30, 9, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 766 MovieClip [gunship] Frame 80
stop();
Symbol 766 MovieClip [gunship] Frame 85
_root.objects.push(new SpinningGib("gunship_gibs", _x, _y + 30, random(360), 10, 10, 13, 2));
_root.objects.push(new SpinningGib("gunship_gibs", _x, _y + 30, random(360), 10, 10, 14, 2));
_root.objects.push(new SpinningGib("gunship_gibs", _x, _y + 30, random(360), 10, 10, 15, 2));
Symbol 766 MovieClip [gunship] Frame 96
stop();
Symbol 766 MovieClip [gunship] Frame 103
var gb = new SpinningGib("gunship_gibs", _x + 43, _y - 50, -90, 4, 30, 12, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 766 MovieClip [gunship] Frame 106
var i = 0;
while (i < 8) {
_root.objects.push(new SpinningGib("gunship_gibs", _x + 30, _y - 20, random(360), 10, 10, random(4) + 1, 4));
i++;
}
var gb = new SpinningGib("gunship_gibs", _x + 43, _y - 50, -80, 4, 30, 11, 4);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
gb = new SpinningGib("gunship_gibs", _x + 43, _y - 50, -100, 4, 30, 11, 1);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 766 MovieClip [gunship] Frame 108
var i = 0;
while (i < 3) {
_root.objects.push(new SpinningGib("gunship_gibs", _x + 30, _y - 20, random(360), 10, 10, random(4) + 1, 4));
i++;
}
Symbol 766 MovieClip [gunship] Frame 117
stop();
Symbol 783 MovieClip Frame 10
stop();
Symbol 783 MovieClip Frame 20
stop();
Symbol 801 MovieClip [fireball] Frame 15
gotoAndPlay (8);
Symbol 801 MovieClip [fireball] Frame 16
_root.sound("snd_zap");
Symbol 801 MovieClip [fireball] Frame 33
stop();
Symbol 817 MovieClip Frame 1
stop();
Symbol 817 MovieClip Frame 25
stop();
Symbol 822 MovieClip Frame 1
stop();
Symbol 822 MovieClip Frame 21
stop();
Symbol 827 MovieClip Frame 1
this._name = "head";
stop();
Symbol 827 MovieClip Frame 20
stop();
Symbol 828 MovieClip Frame 1
stop();
Symbol 828 MovieClip Frame 24
Symbol 828 MovieClip Frame 40
gotoAndStop ("idle");
Symbol 833 MovieClip [stalker] Frame 1
stop();
Symbol 846 MovieClip [train_foregrounds] Frame 41
gotoAndPlay (2);
Symbol 846 MovieClip [train_foregrounds] Frame 91
gotoAndPlay (52);
Symbol 851 MovieClip [steam] Frame 1
if (random(100) < 50) {
_xscale = -100;
}
Symbol 851 MovieClip [steam] Frame 30
stop();
Symbol 851 MovieClip [steam] Frame 45
stop();
Symbol 864 MovieClip [hammer_static] Frame 196
gotoAndPlay (2);
Symbol 867 MovieClip [black_steam] Frame 1
if (random(100) < 50) {
_xscale = -100;
}
Symbol 867 MovieClip [black_steam] Frame 30
stop();
Symbol 867 MovieClip [black_steam] Frame 45
stop();
Symbol 899 MovieClip Frame 1
stop();
Symbol 899 MovieClip Frame 5
_root.dust(_x, _y, 10, 20);
Symbol 899 MovieClip Frame 201
stop();
Symbol 922 MovieClip [stalker_barrel] Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
stop();
Symbol 922 MovieClip [stalker_barrel] Frame 88
var gb = new SpinningGib("stalker_barrel_gibs", _x + shield1._x, _y + shield1._y, -20, 14.8, 60, 1, 6);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 922 MovieClip [stalker_barrel] Frame 90
var gb = new SpinningGib("stalker_barrel_gibs", _x + shield2._x, _y + shield2._y, -150, 13.75, 50, 2, 5);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 922 MovieClip [stalker_barrel] Frame 95
Symbol 922 MovieClip [stalker_barrel] Frame 130
var gb = new SpinningGib("stalker_barrel_gibs", _x + shield3._x, _y + shield3._y, -80, 25, 60, 3, 5);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 922 MovieClip [stalker_barrel] Frame 139
stop();
Symbol 932 MovieClip Frame 1
ready = false;
stop();
Symbol 932 MovieClip Frame 109
ready = true;
stop();
Symbol 959 MovieClip Frame 1
stop();
var ready = true;
Symbol 959 MovieClip Frame 2
ready = false;
flame.gotoAndPlay(random(6) + 1);
Symbol 959 MovieClip Frame 3
ready = false;
Symbol 959 MovieClip Frame 4
ready = true;
Symbol 978 MovieClip Frame 1
var destroyed = false;
Symbol 978 MovieClip Frame 19
gotoAndPlay (1);
Symbol 978 MovieClip Frame 47
stop();
Symbol 978 MovieClip Frame 74
stop();
Symbol 978 MovieClip Frame 82
_parent.gib(this, 10, 100);
Symbol 978 MovieClip Frame 118
stop();
Symbol 996 MovieClip Frame 20
gotoAndPlay (7);
Symbol 1057 MovieClip Frame 1
stop();
var ready = false;
Symbol 1057 MovieClip Frame 54
gotoAndPlay ("reload");
Symbol 1057 MovieClip Frame 55
ready = true;
stop();
Symbol 1057 MovieClip Frame 115
ready = false;
Symbol 1057 MovieClip Frame 116
ready = false;
Symbol 1057 MovieClip Frame 137
_root.p.x = 45;
_root.p.y = 100;
_root.p = this.transform.matrix.transformPoint(_root.p);
var gb = new SpinningGib("raptor_gibs", _root.p.x, _root.p.y, -110, 10, 20, 1, 9);
gb.life = 100;
_root.objects.push(gb);
Symbol 1057 MovieClip Frame 156
ready = false;
Symbol 1057 MovieClip Frame 182
gotoAndStop ("charge");
Symbol 1057 MovieClip Frame 202
gotoAndStop (1);
Symbol 1057 MovieClip Frame 207
_parent._gibs(this, 3);
Symbol 1057 MovieClip Frame 208
_parent._gib(this, 7, 30);
Symbol 1057 MovieClip Frame 209
_parent._gib(this, 8, 30);
Symbol 1057 MovieClip Frame 212
_parent._gib(this, 6, 30);
_parent._gibs(this, 4);
Symbol 1057 MovieClip Frame 213
_parent._gib(this, 6, 30);
Symbol 1057 MovieClip Frame 220
_parent._gibs(this, 4);
Symbol 1057 MovieClip Frame 224
_parent._gibs(this, 4);
Symbol 1057 MovieClip Frame 275
stop();
Symbol 1070 MovieClip [raptor] Frame 1
function _gibs(sprite, n) {
_root.p.x = sprite.gibs_pos._x;
_root.p.y = sprite.gibs_pos._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
var _local2 = 0;
while (_local2 < n) {
_root.objects.push(new SpinningGib("raptor_gibs", _root.p.x, _root.p.y, random(360), 8 + (random(800) / 100), 20, random(2) + 4, 12));
_local2++;
}
}
function _gib(sprite, frame, r) {
_root.p.x = sprite.gib_pos._x;
_root.p.y = sprite.gib_pos._y;
_root.p = sprite.transform.matrix.transformPoint(_root.p);
_root.objects.push(new SpinningGib("raptor_gibs", _root.p.x, _root.p.y, random(360), random(8) + 8, r, frame, 12));
}
stop();
Symbol 1077 MovieClip [tank_grenade] Frame 1
stop();
Symbol 1077 MovieClip [tank_grenade] Frame 2
if (random(100) < 50) {
_xscale = -100;
}
Symbol 1077 MovieClip [tank_grenade] Frame 95
stop();
Symbol 1083 MovieClip Frame 1
stop();
Symbol 1083 MovieClip Frame 16
stop();
Symbol 1083 MovieClip Frame 30
stop();
Symbol 1090 MovieClip Frame 1
stop();
Symbol 1090 MovieClip Frame 46
stop();
Symbol 1090 MovieClip Frame 90
stop();
Symbol 1090 MovieClip Frame 135
stop();
Symbol 1091 MovieClip Frame 1
stop();
Symbol 1091 MovieClip Frame 75
gotoAndPlay (23);
Symbol 1092 MovieClip [battle_cargo] Frame 1
stop();
Symbol 1092 MovieClip [battle_cargo] Frame 18
gotoAndStop ("idle");
Symbol 1092 MovieClip [battle_cargo] Frame 57
gotoAndStop ("idle");
Symbol 1092 MovieClip [battle_cargo] Frame 77
gotoAndStop ("idle");
Symbol 1098 MovieClip Frame 25
gotoAndPlay (10);
Symbol 1098 MovieClip Frame 26
_root.sound("snd_big_boom");
Symbol 1098 MovieClip Frame 39
gotoAndPlay(40 + random(7));
_root.sound("snd_alarm");
Symbol 1098 MovieClip Frame 52
Symbol 1098 MovieClip Frame 60
gotoAndPlay (40);
Symbol 1104 MovieClip [cargo_ship2] Frame 8
stop();
Symbol 1104 MovieClip [cargo_ship2] Frame 20
stop();
Symbol 1104 MovieClip [cargo_ship2] Frame 32
gotoAndStop ("idle");
Symbol 1104 MovieClip [cargo_ship2] Frame 63
gotoAndPlay ("burn");
Symbol 1104 MovieClip [cargo_ship2] Frame 66
_root.sound("snd_big_boom");
Symbol 1104 MovieClip [cargo_ship2] Frame 74
_root.sound("snd_boom");
Symbol 1104 MovieClip [cargo_ship2] Frame 77
_root.sound("snd_big_boom_debris");
Symbol 1104 MovieClip [cargo_ship2] Frame 84
_root.sound("snd_big_boom");
Symbol 1104 MovieClip [cargo_ship2] Frame 90
_root.sound("snd_boom");
Symbol 1104 MovieClip [cargo_ship2] Frame 92
_root.sound("snd_big_boom_debris");
Symbol 1104 MovieClip [cargo_ship2] Frame 190
stop();
Symbol 1116 MovieClip Frame 1
Symbol 1116 MovieClip Frame 2
stop();
Symbol 1121 MovieClip Frame 1
var ready = false;
Symbol 1121 MovieClip Frame 2
stop();
Symbol 1121 MovieClip Frame 3
ready = false;
Symbol 1121 MovieClip Frame 22
_root.sound_mc_point("snd_launch", this, _parent._x, 100);
Symbol 1121 MovieClip Frame 31
ready = true;
Symbol 1121 MovieClip Frame 32
ready = false;
Symbol 1121 MovieClip Frame 50
gotoAndStop ("idle");
Symbol 1134 MovieClip Frame 1
stop();
Symbol 1134 MovieClip Frame 6
_parent.glass.gotoAndStop(2);
Symbol 1134 MovieClip Frame 15
stop();
Symbol 1134 MovieClip Frame 19
_parent.glass.gotoAndStop(3);
Symbol 1134 MovieClip Frame 29
stop();
Symbol 1134 MovieClip Frame 43
stop();
Symbol 1134 MovieClip Frame 49
_parent.glass.gotoAndStop(4);
_root.p.x = 24;
_root.p.y = -30;
_root.p = _parent.transform.matrix.transformPoint(_root.p);
var gb = new SpinningGib("bike_gibs", _root.p.x, _root.p.y, random(360), 1, 15, 8, 10);
gb.life = 100;
_root.objects.push(gb);
Symbol 1134 MovieClip Frame 57
stop();
Symbol 1134 MovieClip Frame 80
stop();
Symbol 1141 MovieClip Frame 1
var ready = false;
var shots = 0;
stop();
Symbol 1141 MovieClip Frame 2
shots = 0;
ready = false;
Symbol 1141 MovieClip Frame 4
ready = true;
Symbol 1141 MovieClip Frame 5
ready = false;
Symbol 1141 MovieClip Frame 6
shots++;
Symbol 1141 MovieClip Frame 7
ready = true;
Symbol 1141 MovieClip Frame 8
ready = false;
Symbol 1141 MovieClip Frame 9
shots++;
gotoAndPlay (3);
Symbol 1141 MovieClip Frame 20
_root.p.x = -12;
_root.p.y = 0;
_root.p = transform.matrix.transformPoint(_root.p);
_root.p = _parent.transform.matrix.transformPoint(_root.p);
var gb = new SpinningGib("bike_gibs", _root.p.x, _root.p.y, random(360), 1, 15, 5, 10);
gb.life = 99999 /* 0x01869F */;
_root.objects.push(gb);
Symbol 1141 MovieClip Frame 25
stop();
Symbol 1149 MovieClip Frame 1
stop();
Symbol 1157 MovieClip [bike] Frame 1
stop();
Symbol 1169 MovieClip [big_rocket] Frame 7
stop();
Symbol 1169 MovieClip [big_rocket] Frame 14
gotoAndStop ("idle");
Symbol 1169 MovieClip [big_rocket] Frame 60
stop();
Symbol 1174 MovieClip [med_box] Frame 1
stop();
Symbol 1174 MovieClip [med_box] Frame 3
_root.sound_mc_point("snd_metal_bullet1", this, _x, 100);
Symbol 1174 MovieClip [med_box] Frame 20
stop();
Symbol 1205 MovieClip Frame 1
_root.push_brick(b1, 0, _x + _parent._x, _y + _parent._y);
b1._visible = false;
stop();
Symbol 1205 MovieClip Frame 13
stop();
Symbol 1205 MovieClip Frame 25
stop();
Symbol 1205 MovieClip Frame 50
_root.push_platform(b2, 0, _x + _parent._x, _y + _parent._y);
b2._visible = false;
Symbol 1205 MovieClip Frame 57
stop();
Symbol 1205 MovieClip Frame 83
_root.push_platform(b2, 0, _x + _parent._x, _y + _parent._y);
b2._visible = false;
Symbol 1205 MovieClip Frame 90
stop();
Symbol 1260 MovieClip Frame 1
_root.PushObject(new AnimSpriteFreezer(this));
gotoAndStop(random(280));
Symbol 1260 MovieClip Frame 301
gotoAndPlay (2);
Symbol 1260 MovieClip Frame 342
gotoAndPlay ("blink");
Symbol 1260 MovieClip Frame 461
gotoAndPlay ("blink2");
Symbol 1260 MovieClip Frame 478
gotoAndPlay(480 + random(30));
Symbol 1260 MovieClip Frame 686
gotoAndPlay(520 + random(40));
Symbol 1266 MovieClip [crane2] Frame 1
var ready = false;
stop();
Symbol 1266 MovieClip [crane2] Frame 40
ready = true;
stop();
Symbol 1266 MovieClip [crane2] Frame 41
var ready = false;
stop();
Symbol 1266 MovieClip [crane2] Frame 80
ready = true;
stop();
Symbol 1273 MovieClip Frame 1
stop();
Symbol 1281 MovieClip Frame 1
stop();
Symbol 1284 MovieClip Frame 1
stop();
Symbol 1284 MovieClip Frame 80
stop();
Symbol 1284 MovieClip Frame 160
stop();
Symbol 1284 MovieClip Frame 229
stop();
Symbol 1284 MovieClip Frame 275
stop();
Symbol 1284 MovieClip Frame 346
stop();
Symbol 1284 MovieClip Frame 401
stop();
Symbol 1284 MovieClip Frame 431
stop();
Symbol 1319 MovieClip Frame 1
var ready = false;
stop();
Symbol 1319 MovieClip Frame 2
_parent.wings.gotoAndPlay("open");
Symbol 1319 MovieClip Frame 74
ready = true;
Symbol 1319 MovieClip Frame 75
ready = false;
Symbol 1319 MovieClip Frame 82
ready = true;
Symbol 1319 MovieClip Frame 83
ready = false;
Symbol 1319 MovieClip Frame 89
ready = true;
Symbol 1319 MovieClip Frame 90
ready = false;
Symbol 1319 MovieClip Frame 97
ready = true;
Symbol 1319 MovieClip Frame 98
ready = false;
Symbol 1319 MovieClip Frame 106
ready = true;
Symbol 1319 MovieClip Frame 107
ready = false;
Symbol 1319 MovieClip Frame 116
ready = true;
Symbol 1319 MovieClip Frame 117
ready = false;
Symbol 1319 MovieClip Frame 192
_parent.wings.gotoAndPlay("close");
Symbol 1319 MovieClip Frame 203
stop();
Symbol 1340 MovieClip Frame 1
stop();
Symbol 1340 MovieClip Frame 11
stop();
Symbol 1356 MovieClip Frame 1
var safe = true;
Symbol 1356 MovieClip Frame 10
safe = false;
Symbol 1356 MovieClip Frame 39
safe = true;
gotoAndPlay (33);
Symbol 1356 MovieClip Frame 118
safe = false;
Symbol 1356 MovieClip Frame 196
safe = false;
Symbol 1356 MovieClip Frame 221
Symbol 1359 MovieClip Frame 1
function _gibs1() {
var _local4 = _x;
var _local3 = _y;
var _local2 = 0;
while (_local2 < 10) {
_root.objects.push(new FlyBackGib("metal_gibs", _local4, _local3, random(360), 15, 10, random(8) + 20, 12));
_local2++;
}
}
function _gibs(n) {
_root.p.x = gibs_pos._x;
_root.p.y = gibs_pos._y;
_root.p = this.transform.matrix.transformPoint(_root.p);
var _local3 = 0;
while (_local3 < n) {
_root.objects.push(new FlyBackGib("metal_gibs", _root.p.x, _root.p.y, random(360), 15, 10, random(8) + 20, 12));
_local3++;
}
}
function _gib(frame, r) {
_root.p.x = gib_pos._x;
_root.p.y = gib_pos._y;
_root.p = this.transform.matrix.transformPoint(_root.p);
_root.objects.push(new FlyBackGib("rocket_gibs", _root.p.x, _root.p.y, random(360), 8, r, frame, 12));
}
stop();
Symbol 1359 MovieClip Frame 2
wings.play();
Symbol 1359 MovieClip Frame 7
_gibs(15);
Symbol 1359 MovieClip Frame 20
_gibs(15);
_gib(13, 100);
Symbol 1359 MovieClip Frame 53
_gibs(15);
_gib(12, 100);
Symbol 1359 MovieClip Frame 66
stop();
Symbol 1361 MovieClip Frame 1
stop();
Symbol 1400 MovieClip Frame 1
var ready = false;
stop();
Symbol 1400 MovieClip Frame 5
ready = true;
Symbol 1400 MovieClip Frame 6
ready = false;
Symbol 1400 MovieClip Frame 25
gotoAndStop (1);
Symbol 1400 MovieClip Frame 27
ready = true;
Symbol 1400 MovieClip Frame 28
ready = false;
Symbol 1400 MovieClip Frame 33
ready = true;
Symbol 1400 MovieClip Frame 34
ready = false;
Symbol 1400 MovieClip Frame 39
ready = true;
Symbol 1400 MovieClip Frame 40
ready = false;
Symbol 1400 MovieClip Frame 46
ready = true;
Symbol 1400 MovieClip Frame 47
ready = false;
Symbol 1400 MovieClip Frame 52
ready = true;
Symbol 1400 MovieClip Frame 53
ready = false;
Symbol 1400 MovieClip Frame 58
ready = true;
Symbol 1400 MovieClip Frame 59
ready = false;
Symbol 1400 MovieClip Frame 63
ready = true;
Symbol 1400 MovieClip Frame 64
ready = false;
Symbol 1400 MovieClip Frame 69
ready = true;
Symbol 1400 MovieClip Frame 70
ready = false;
Symbol 1400 MovieClip Frame 75
ready = true;
Symbol 1400 MovieClip Frame 76
ready = false;
Symbol 1400 MovieClip Frame 82
ready = true;
Symbol 1400 MovieClip Frame 83
ready = false;
Symbol 1400 MovieClip Frame 88
ready = true;
Symbol 1400 MovieClip Frame 89
ready = false;
Symbol 1400 MovieClip Frame 94
ready = true;
Symbol 1400 MovieClip Frame 95
ready = false;
Symbol 1400 MovieClip Frame 103
gotoAndStop (1);
Symbol 1400 MovieClip Frame 106
function _gibs(n) {
_root.p.x = gibs_pos._x;
_root.p.y = gibs_pos._y;
_root.p = this.transform.matrix.transformPoint(_root.p);
var _local3 = 0;
while (_local3 < n) {
_root.objects.push(new FlyBackGib("metal_gibs", _root.p.x, _root.p.y, random(360), 15, 10, random(8) + 20, 12));
_local3++;
}
}
_gibs(10);
Symbol 1400 MovieClip Frame 108
_parent.arm12.gotoAndStop("free");
_parent.arm22.gotoAndStop("free");
var i = 0;
while (i < 10) {
_root.objects.push(new FlyBackGib("metal_gibs", __x, __y, random(360), 15, 10, random(8) + 20, 12));
i++;
}
Symbol 1400 MovieClip Frame 124
_visible = false;
var __x = (_x - 70);
var __y = (_y - 10);
_root.objects.push(new FlyBackGib("rocket_gibs", __x, __y, random(360), 4, 150, 11, 12));
stop();
Symbol 1411 MovieClip [fireball_red] Frame 15
gotoAndPlay (8);
Symbol 1411 MovieClip [fireball_red] Frame 16
_root.sound("snd_zap");
Symbol 1411 MovieClip [fireball_red] Frame 33
stop();
Symbol 1475 MovieClip Frame 1
var busy = false;
var man;
stop();
Symbol 1475 MovieClip Frame 2
busy = true;
Symbol 1475 MovieClip Frame 29
if (man) {
_root.PushObject(man);
man = undefined;
}
Symbol 1475 MovieClip Frame 60
busy = false;
stop();
Symbol 1494 MovieClip [hyper_blast] Frame 35
stop();
Symbol 1500 MovieClip Frame 15
stop();
Symbol 1500 MovieClip Frame 25
stop();
Symbol 1520 MovieClip [heal_big] Frame 20
gotoAndPlay (1);
Symbol 1520 MovieClip [heal_big] Frame 21
_root.knight.color.setTransform(_root.green);
Symbol 1520 MovieClip [heal_big] Frame 34
_root.knight.color.setTransform(_root.white);
stop();
Symbol 1528 MovieClip [crane3] Frame 1
var ready = false;
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
stop();
Symbol 1528 MovieClip [crane3] Frame 40
ready = true;
stop();
Symbol 1528 MovieClip [crane3] Frame 41
ready = false;
Symbol 1528 MovieClip [crane3] Frame 115
stop();
Symbol 1549 MovieClip [player_skydive] Frame 10
gotoAndPlay (1);
Symbol 1549 MovieClip [player_skydive] Frame 185
gotoAndPlay (121);
Symbol 2001 MovieClip Frame 1
function activate() {
active = true;
gotoAndStop ("active");
}
var mouse_over = false;
var active;
var on_click;
this.onRollOver = function () {
if (!active) {
return(undefined);
}
play();
mouse_over = true;
};
this.onRollOut = function () {
mouse_over = false;
};
this.onPress = function () {
if (!active) {
return(undefined);
}
on_click(this);
gotoAndPlay ("click");
mouse_over = false;
};
Symbol 2001 MovieClip Frame 2
if (!active) {
gotoAndStop ("inactive");
} else if (!mouse_over) {
stop();
}
Symbol 2001 MovieClip Frame 11
gotoAndPlay (2);
Symbol 2001 MovieClip Frame 18
gotoAndPlay (2);
Symbol 2013 MovieClip Frame 1
stop();
Symbol 2018 MovieClip Frame 1
function activate() {
active = true;
gotoAndStop ("active");
}
var mouse_over = false;
var active;
var on_click;
this.onRollOver = function () {
if (!active) {
return(undefined);
}
play();
mouse_over = true;
};
this.onRollOut = function () {
mouse_over = false;
};
this.onPress = function () {
return(undefined);
};
Symbol 2018 MovieClip Frame 2
if (!active) {
gotoAndStop ("inactive");
} else if (!mouse_over) {
stop();
}
Symbol 2018 MovieClip Frame 11
gotoAndPlay (2);
Symbol 2019 MovieClip Frame 1
function activate() {
active = true;
gotoAndStop ("active");
}
var mouse_over = false;
var active;
var on_click;
this.onRollOver = function () {
if (!active) {
return(undefined);
}
play();
mouse_over = true;
};
this.onRollOut = function () {
mouse_over = false;
};
this.onPress = function () {
return(undefined);
};
Symbol 2019 MovieClip Frame 2
if (!active) {
gotoAndStop ("inactive");
} else if (!mouse_over) {
stop();
}
Symbol 2019 MovieClip Frame 11
gotoAndPlay (2);
Symbol 2024 MovieClip Frame 1
stop();
Symbol 2048 MovieClip Frame 1
function activate() {
active = true;
gotoAndStop(frame_shift + 1);
}
function Select() {
_root.menu_controller.SelectLevel(this);
gotoAndStop(frame_shift + 3);
_selected = true;
}
function Deselect() {
if (!active) {
return(undefined);
}
gotoAndStop(frame_shift + 1);
_selected = false;
}
var active;
var on_click;
var frame_shift;
var level_name;
var _selected = false;
this.onRollOver = function () {
if ((!active) || (_selected)) {
return(undefined);
}
gotoAndStop(frame_shift + 2);
};
this.onRollOut = function () {
if ((!active) || (_selected)) {
return(undefined);
}
gotoAndStop(frame_shift + 1);
};
this.onPress = function () {
if (!active) {
return(undefined);
}
_root.menu_controller.SelectLevel(this);
gotoAndStop(frame_shift + 3);
_selected = true;
};
stop();
Symbol 2049 MovieClip Frame 1
stop();
Symbol 2054 MovieClip Frame 1
stop();
Symbol 2074 MovieClip Frame 1
var play_next;
Symbol 2074 MovieClip Frame 72
_root.sound("snd_logo_boom");
Symbol 2074 MovieClip Frame 75
_root.sound("snd_logo_boom");
Symbol 2074 MovieClip Frame 78
_root.sound("snd_logo_boom");
Symbol 2074 MovieClip Frame 81
_root.sound("snd_logo_boom");
Symbol 2074 MovieClip Frame 84
_root.sound("snd_logo_boom");
Symbol 2074 MovieClip Frame 87
_root.sound("snd_logo_boom");
Symbol 2074 MovieClip Frame 90
_root.sound("snd_logo_boom");
Symbol 2074 MovieClip Frame 93
_root.sound("snd_logo_boom");
Symbol 2074 MovieClip Frame 95
_root.sound("snd_stone_boom");
Symbol 2074 MovieClip Frame 117
stop();
Symbol 2074 MovieClip Frame 132
stop();
Symbol 2074 MovieClip Frame 139
if (play_next) {
gotoAndPlay(play_next);
} else {
stop();
}
Symbol 2074 MovieClip Frame 155
stop();
Symbol 2074 MovieClip Frame 165
if (play_next) {
gotoAndPlay(play_next);
} else {
stop();
}
Symbol 2074 MovieClip Frame 184
stop();
Symbol 2074 MovieClip Frame 194
if (play_next) {
gotoAndPlay(play_next);
} else {
stop();
}
Symbol 2074 MovieClip Frame 197
gotoAndPlay ("_loop");
Symbol 2077 MovieClip Frame 2
_x = 0;
_y = 0;
stop();
Symbol 2079 MovieClip Frame 2
_x = 0;
_y = 0;
stop();
Symbol 2093 MovieClip Frame 11
stop();
Symbol 2132 MovieClip Frame 1
stop();
Symbol 2132 MovieClip Frame 39
stop();
Symbol 2185 MovieClip Frame 1
stop();
Symbol 2196 MovieClip Frame 1
_root.print_mc(_text, _root.strings.aim_and_shoot);
Symbol 2199 MovieClip Frame 1
_root.print_mc(_text, _root.strings.move);
Symbol 2201 MovieClip Frame 1
_root.print_mc(_text, _root.strings.switch_weapons);
Symbol 2206 MovieClip Frame 2
stop();
Symbol 2206 MovieClip Frame 36
score_counter._visible = false;
stop();
Symbol 2206 MovieClip Frame 38
stop();
Symbol 2206 MovieClip Frame 45
stop();
Symbol 2206 MovieClip Frame 88
score_counter._visible = false;
stop();
Symbol 2206 MovieClip Frame 90
stop();
Symbol 2206 MovieClip Frame 92
stop();
Symbol 2206 MovieClip Frame 94
stop();
Symbol 2206 MovieClip Frame 100
stop();
Symbol 2206 MovieClip Frame 564
stop();
Symbol 2206 MovieClip Frame 565
_root.menu_controller.InitPauseMenu();
Symbol 2209 MovieClip Frame 1
stop();
Symbol 2209 MovieClip Frame 39
stop();
Symbol 2213 MovieClip Frame 1
stop();
Symbol 2213 MovieClip Frame 39
stop();
Symbol 2258 MovieClip Frame 51
stop();
Symbol 2266 MovieClip Frame 1
stop();
Symbol 2272 MovieClip Frame 1
if (_root.detailed_sky) {
_root.backgrounds.push(new Background(this, 0.034, 0));
gotoAndStop (2);
} else {
_root.backgrounds.push(new Background(this, 0, 0));
gotoAndStop (4);
}
Symbol 2275 MovieClip Frame 1
if (_root.detailed_sky) {
stop();
} else {
gotoAndStop (2);
}
Symbol 2282 MovieClip Frame 1
if (_root.detailed_sky) {
_root.backgrounds.push(new TileXBackground(this, 0.8, 0));
stop();
} else {
gotoAndStop (4);
}
Symbol 2288 MovieClip Frame 1
_root.push_static_brick(this);
_visible = false;
stop();
Symbol 2292 MovieClip Frame 1
_root.push_brick(this, _root.t_slope_up_right);
_visible = false;
stop();
Symbol 2294 MovieClip Frame 1
_root.push_brick(this, _root.t_slope_up_left);
_visible = false;
stop();
Symbol 2296 MovieClip Frame 1
_root.push_platform(this);
_visible = false;
stop();
Symbol 2299 MovieClip Frame 1
var a = this._name;
this._name = "the_crate";
_root.PushObject(new Crate(_x, _y, "crate", this, 60, a), this);
stop();
Symbol 2305 MovieClip Frame 1
var a = this._name;
this._name = "the_dude";
_root.PushObject(new Enemy(_x, _y, "human", parseInt(a.substr(0, 1)), 20, 60, 5), this);
Symbol 2316 MovieClip Frame 1
_root.push_brick(st1, 0, _x, _y, st1);
_root.push_brick(st2, 0, _x, _y, st2);
st1._visible = false;
st2._visible = false;
gotoAndStop (3);
Symbol 2316 MovieClip Frame 2
stop();
Symbol 2316 MovieClip Frame 65
stop();
Symbol 2316 MovieClip Frame 90
gotoAndStop ("open");
Symbol 2327 MovieClip Frame 1
_root.push_brick(up, 0, _x, _y, up);
up._visible = false;
_root.push_brick(door, 0, _x, _y, door);
door._visible = false;
stop();
Symbol 2327 MovieClip Frame 20
stop();
Symbol 2327 MovieClip Frame 40
gotoAndStop (2);
Symbol 2331 MovieClip Frame 1
__aabb._x = _x;
__aabb._y = _y;
__aabb._width = (__aabb._width * _xscale) / 100;
__aabb._height = (__aabb._height * _yscale) / 100;
_root.push_brick(__aabb, _root.t_slope_up_left);
__aabb._visible = false;
stop();
Symbol 2334 MovieClip Frame 1
__aabb._x = _x;
__aabb._y = _y;
__aabb._width = (__aabb._width * _xscale) / 100;
__aabb._height = (__aabb._height * _yscale) / 100;
_root.push_brick(__aabb, _root.t_slope_up_right);
__aabb._visible = false;
stop();
Symbol 2338 MovieClip Frame 1
stop();
_root.lifts.push(this);
var is_playing = false;
Symbol 2338 MovieClip Frame 2
_root.sound("snd_metal_stress");
is_playing = true;
Symbol 2338 MovieClip Frame 17
_root.persistent_buf.break_cable.anchor1 = null;
Symbol 2338 MovieClip Frame 44
stop();
is_playing = false;
Symbol 2352 MovieClip Frame 1
_root.lifts.push(this);
var is_playing = true;
Symbol 2352 MovieClip Frame 3
_root.View((-_x) + 300, (-_y) + 320);
Symbol 2352 MovieClip Frame 97
_root.objects.push(new Gib("drop_rocket_door_gib", _x + 24, _y + 80, -45, 20, 5, 1, 10));
_root.dust(_x - 10, _y + 60, 8, 20);
Symbol 2352 MovieClip Frame 98
_root.objects.push(new StunnedPlayer(_x + 20, _y + 100, "eject_rocket", 8, -20, 200));
Symbol 2352 MovieClip Frame 151
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
_root.push_brick(b2, 0, _x, _y);
b2._visible = false;
_root.push_brick(b3, 0, _x, _y);
b3._visible = false;
_root.push_brick(b4, 0, _x, _y);
b4._visible = false;
_root.ui.anouncer.gotoAndPlay("controls_tip");
is_playing = false;
stop();
Symbol 2369 MovieClip Frame 2
stop();
Symbol 2370 MovieClip Frame 1
_root.push_platform(platform, 0, _x, _y, area);
_root.lifts.push(this);
var is_playing = true;
Symbol 2370 MovieClip Frame 166
gotoAndPlay (2);
Symbol 2375 MovieClip Frame 1
var n = Math.min(Math.ceil((20 * _xscale) / 100), 20);
var cb = new CableDoubleAnchor(_x, _y, "cable20", n, _root.gravity_y * 0.5);
var i = n;
while (i <= 19) {
cb.sprite["c" + i]._visible = false;
i++;
}
_root.p.x = 600;
_root.p.y = 0;
_root.p = this.transform.matrix.transformPoint(_root.p);
cb.SetPos1(_x, _y);
cb.SetPos2(_root.p.x, _root.p.y);
_root.PushObject(cb, this);
Symbol 2376 MovieClip Frame 1
_root.PushObject(new BeamEmitter_test(_x, _y, this._name, 0, 0, _yscale), this);
Symbol 2388 MovieClip Frame 1
_root.push_platform(platform, 0, _x, _y, area);
area._visible = false;
Symbol 2388 MovieClip Frame 165
stop();
Symbol 2395 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y, area);
_root.push_brick(b2, 0, _x, _y, area);
b1._visible = false;
b2._visible = false;
var stop_if_higher = true;
_root.lifts.push(this);
var is_playing = false;
gotoAndStop (2);
Symbol 2395 MovieClip Frame 3
is_playing = true;
Symbol 2395 MovieClip Frame 82
if ((_root.knight.gety() < (b1._y + _y)) && (stop_if_higher)) {
is_playing = false;
stop();
}
Symbol 2395 MovieClip Frame 83
is_playing = true;
Symbol 2395 MovieClip Frame 269
gotoAndPlay (2);
Symbol 2397 MovieClip Frame 1
var a = this._name;
this._name = "the_snowball";
_root.PushObject(new Snowball(_x, _y, 60, a), this);
stop();
Symbol 2401 MovieClip Frame 1
_slope._visible = false;
_brick._visible = false;
stop();
Symbol 2401 MovieClip Frame 2
_root.push_brick(_slope, _root.t_slope_up_left, _x, _y, _slope);
_root.push_platform(_brick, 0, _x, _y, _brick);
stop();
Symbol 2404 MovieClip Frame 1
var a = this._name;
this._name = "the_dude";
_root.PushObject(new Enemy(_x, _y, "human", parseInt(a.substr(0, 1)), random(5) + 11, 40, parseInt(a.substr(1, 1))), this);
Symbol 2406 MovieClip Frame 1
_root.PushObject(new Mine(_x, _y), this);
Symbol 2407 MovieClip Frame 10
stop();
Symbol 2407 MovieClip Frame 20
stop();
Symbol 2421 MovieClip Frame 1
_root.keys[this._name] = false;
_root.PushObject(new Switch(this, _trigger, this._name));
Symbol 2421 MovieClip Frame 11
stop();
Symbol 2421 MovieClip Frame 21
stop();
Symbol 2422 MovieClip Frame 1
var n = parseInt(this._name);
this._name = "teh_BonusHeal";
if (!n) {
n = 10;
}
var sn = "heal";
if (n > 25) {
sn = "heal_med";
}
_root.PushObject(new BonusHeal(_x, _y, sn, n), this);
Symbol 2425 MovieClip Frame 2
_visible = false;
stop();
Symbol 2426 MovieClip Frame 5
_root.PushObject(new Gold(_x, _y, _width * 0.5), this);
stop();
Symbol 2427 MovieClip Frame 1
var n = parseInt(this._name);
this._name = "teh_BonusSmg";
if (!n) {
n = 30;
}
_root.PushObject(new BonusGun(_x, _y, "bonus_gun", 2, n), this);
Symbol 2429 MovieClip Frame 1
_root.PushObject(new Saw(_x, _y), this);
Symbol 2503 MovieClip Frame 2
function Restore() {
_root.checkpoint = cp;
}
var cp = new CheckpointFlag(this, this.func);
_root.PushObject(cp);
_trigger._visible = false;
stop();
Symbol 2503 MovieClip Frame 30
stop();
Symbol 2513 MovieClip Frame 1
_root.PushObject(new Crate(_x, _y, "container", this, 999999), this);
Symbol 2514 MovieClip Frame 1
_x = 0;
_y = 0;
_xscale = 100;
_yscale = 100;
stop();
Instance of Symbol 2316 MovieClip "door2" in Symbol 2514 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new Door(this, undefined, this._name, 65, false, false));
}
Instance of Symbol 2425 MovieClip "door1_" in Symbol 2514 MovieClip Frame 1
onClipEvent (load) {
function wtf(spawner) {
spawner.Delay(40);
}
function wave1(spawner) {
var _local3 = new Enemy(_x + random(30), _y, "human", 1, random(5) + 11, 40, 1);
_local3.x = _local3.x - (10 + random(5));
_local3.y = _local3.y - 10;
_local3.MoveDX(-510 - random(20));
spawner.SpawnObj(_local3);
if (!m1) {
_parent.monitor1.gotoAndPlay("warning");
m1 = true;
_root.sound_loop("snd_alarm", 1);
}
}
function wave2(spawner) {
wave1(spawner);
wave1(spawner);
_parent.monitor2.gotoAndPlay("warning");
_root.sound_loop("snd_alarm", 2);
}
function wave3(spawner) {
wave1(spawner);
wave1(spawner);
wave1(spawner);
_root.sound_loop("snd_alarm", 3);
}
function cookie(spawner) {
_parent.door1.play();
_y = (_y + 150);
var _local3 = new Enemy(_x, _y, "human", 1, random(5) + 11, 40, 1);
_root.PushObject(_local3);
_y = (_y + 150);
_local3 = new Enemy(_x, _y, "human", 1, random(5) + 11, 40, 1);
_root.PushObject(_local3);
_parent.monitor1.gotoAndPlay(1);
_parent.monitor2.gotoAndPlay(1);
_parent.block_platform._y = -10000;
_root.sound("snd_klaxon");
}
var sp = new Spawner(_x, _y);
var m1 = false;
_parent.block_platform._visible = false;
sp.AddEvent(wtf);
sp.AddEvent(wave1);
sp.AddEvent(wave2);
sp.AddEvent(wave3);
sp.AddEvent(cookie);
_root.PushObject(sp);
var cb = _root.cable(_parent.lep1._x, _parent.lep1._y, _parent.bearer1.point1._x + _parent.bearer1._x, _parent.bearer1.point1._y + _parent.bearer1._y);
cb.SetPos1(_parent.lep1._x, _parent.lep1._y);
cb.SetPosMC2(_parent.bearer1.point1);
var cb3 = _root.cable(_parent.bearer1.point2._x + _parent.bearer1._x, _parent.bearer1.point2._y + _parent.bearer1._y, _parent.lep3._x, _parent.lep3._y);
cb3.SetPos2(_parent.lep3._x, _parent.lep3._y);
cb3.SetPosMC1(_parent.bearer1.point2);
_root.persistent_buf.break_cable = cb3;
}
Instance of Symbol 2425 MovieClip in Symbol 2514 MovieClip Frame 1
onClipEvent (load) {
function init(spawner) {
}
function hello(spawner) {
spawner.Delay(60);
_root.sound_loop("snd_alarm", 1);
spawner.behavior = spawner.follow_player;
}
function create_man1() {
var _local1 = new Enemy(_x, _y, "human", 1, random(5) + 11, 40, 1, 3);
return(_local1);
}
function delay1(spawner) {
spawner.Delay(150);
}
function wave1(spawner) {
spawner.SpawnObj(create_man1());
spawner.AddEvent(delay1);
spawner.AddEvent(wave1);
}
function wave2(spawner) {
spawner.WaitUntilDie(false);
spawner.SpawnObj(create_man1());
spawner.Delay(10);
}
function delay2(spawner) {
sp.WaitUntilDie(true);
spawner.Delay(120);
}
function run(spawner) {
spawner.run();
_root.level.bearer1.play();
_root.keys.beam1 = false;
_parent.checkpoint1.Restore();
}
function drop_ship1() {
var _local3 = new CargoShip(_x + 2000, _y, "cargo_ship2");
_local3.find_player();
_local3.WaitUntilDie(false);
_local3.AddEvent(hello);
_local3.AddEvent(wave2);
_local3.AddEvent(wave2);
_local3.AddEvent(wave2);
_local3.AddEvent(delay2);
_local3.AddEvent(wave2);
_local3.AddEvent(wave2);
_local3.AddEvent(wave2);
_local3.AddEvent(delay1);
_local3.AddEvent(run);
_local3.life2 = 10000;
_root.objects.push(_local3);
_local3.UnFreeze();
_root.keys.beam1 = true;
_root.SetCheckpoint(_parent.respawn1._x, _parent.respawn1._y);
}
_root.PushObject(new TriggerFunction(this, drop_ship1));
}
Instance of Symbol 2425 MovieClip in Symbol 2514 MovieClip Frame 1
onClipEvent (load) {
function _spawn_saw1() {
_root.PushObject(new Saw(_parent.saw_spawn1._x, _parent.saw_spawn1._y));
}
_root.PushObject(new TriggerFunction(this, _spawn_saw1));
}
Instance of Symbol 2425 MovieClip in Symbol 2514 MovieClip Frame 1
onClipEvent (load) {
function open_boss_door1() {
if (_parent.boss_door1._currentframe == 20) {
return(undefined);
}
_parent.boss_door1.gotoAndPlay("open");
}
_root.PushObject(new TriggerPersistent(this, open_boss_door1));
}
Instance of Symbol 2425 MovieClip in Symbol 2514 MovieClip Frame 1
onClipEvent (load) {
function close_boss_door1() {
_parent.boss_door1.gotoAndPlay("close");
_parent.boss_door2.gotoAndStop("close");
_root.SetCheckpoint(_parent.respawn2._x, _parent.respawn2._y);
}
_root.PushObject(new TriggerFunction(this, close_boss_door1));
}
Instance of Symbol 2425 MovieClip in Symbol 2514 MovieClip Frame 1
onClipEvent (load) {
function close_boss_door2() {
_parent.boss_door2.gotoAndPlay("close");
}
function init(spawner) {
}
function hello(spawner) {
spawner.Delay(60);
_root.sound_loop("snd_alarm", 1);
spawner.behavior = spawner.follow_player_x;
}
function _return(spawner) {
spawner.find_player();
spawner.WaitUntilDie(false);
}
function create_man1() {
var _local1 = new Enemy(_x, _y, "human", 1, random(5) + 11, 40, 1, 3);
return(_local1);
}
function create_man2() {
var _local1 = new Enemy(_x, _y, "human", 2, random(5) + 11, 40, 1, 3);
return(_local1);
}
function delay1(spawner) {
spawner.Delay(200);
}
function wave1(spawner) {
spawner.SpawnObj(create_man1());
spawner.AddEvent(delay1);
spawner.AddEvent(wave1);
}
function wave2(spawner) {
spawner.WaitUntilDie(false);
spawner.SpawnObj(create_man1());
spawner.Delay(10);
}
function present(spawner) {
spawner.WaitUntilDie(false);
spawner.SpawnObj(new Crate(_x, _y, "crate", _parent.sample_crate, 30, "heal30smg20"));
spawner.Delay(10);
}
function wave3(spawner) {
spawner.WaitUntilDie(false);
spawner.SpawnObj(create_man2());
spawner.Delay(10);
}
function delay2(spawner) {
spawner.WaitUntilDie(false);
spawner.destx = _x + 600;
spawner.behavior = spawner.stand;
spawner.Delay(100);
spawner.AddEvent(_return);
spawner.AddEvent(wave2);
spawner.AddEvent(wave2);
spawner.AddEvent(wave2);
spawner.AddEvent(wave3);
if ((attempts % 2) == 0) {
spawner.AddEvent(present);
}
attempts++;
spawner.AddEvent(delay1);
spawner.AddEvent(delay2);
}
function _hide(spawner) {
spawner.run();
_root.level.bearer1.play();
}
function _remove(spawner) {
spawner.Kill();
_parent.ship_corpse.gotoAndStop(2);
}
function explode(spawner) {
spawner.Explode();
spawner.Delay(46);
spawner.AddEvent(_remove);
spawner.body_dir = 5;
}
function _move_fall(spawner) {
spawner.destx = x1;
spawner.desty = y1;
spawner.behavior = spawner.wait_until_arrive;
spawner.AddEvent(fall);
spawner.friction = true;
}
function fall(spawner) {
spawner.destx = x2;
spawner.desty = y2;
spawner.behavior = spawner.wait_until_arrive;
spawner.AddEvent(explode);
_parent.checkpoint2.Restore();
}
function drop_ship2() {
close_boss_door2();
var _local2 = new CargoShip(_x + 2000, _y, "cargo_ship2");
_local2.find_player();
_local2.WaitUntilDie(false);
_local2.AddEvent(hello);
_local2.AddEvent(wave2);
_local2.AddEvent(wave2);
_local2.AddEvent(wave2);
_local2.AddEvent(delay1);
_local2.AddEvent(delay2);
_local2.AddEvent(run);
_local2.on_die = _move_fall;
_root.objects.push(_local2);
_local2.UnFreeze();
}
var attempts = 0;
var x1 = _parent.shipposx._x;
var y1 = _parent.shipposx._y;
var x2 = _parent.shipposy._x;
var y2 = _parent.shipposy._y;
_root.PushObject(new TriggerFunction(this, drop_ship2));
}
Instance of Symbol 2425 MovieClip in Symbol 2514 MovieClip Frame 1
onClipEvent (load) {
function open_entr(spawner) {
_parent.entr_door.gotoAndPlay("open");
}
function delay_door() {
var _local2 = new Spawner(_x, _y);
spawner.Delay(300);
_local2.AddEvent(open_entr);
_local2.WaitUntilDie(false);
_root.objects.push(_local2);
}
_root.PushObject(new TriggerFunction(this, delay_door));
var platform = _parent.end_lift.b1;
var cb = _root.cable(_parent.lift_cable._x, _parent.lift_cable._y, platform._x + _parent.end_lift._x, platform._y + _parent.end_lift._y);
cb.SetPos1(_parent.lift_cable._x, _parent.lift_cable._y);
cb.SetPosMC2(platform);
}
Instance of Symbol 2425 MovieClip in Symbol 2514 MovieClip Frame 1
onClipEvent (load) {
function _end_lift() {
_parent.end_lift.play();
_parent.end_lift.is_playing = true;
}
_parent.end_lift.stop();
_root.PushObject(new TriggerFunction(this, _end_lift));
}
Instance of Symbol 2425 MovieClip in Symbol 2514 MovieClip Frame 1
onClipEvent (load) {
function _next_level(spawner) {
_root.menu_controller.NextLevel("level2");
}
_root.PushObject(new TriggerFunction(this, _next_level));
}
Instance of Symbol 2425 MovieClip in Symbol 2514 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerRemove(this, _parent.drop_rocket));
}
Instance of Symbol 2503 MovieClip "checkpoint1" in Symbol 2514 MovieClip Frame 1
onClipEvent (load) {
}
Symbol 2524 MovieClip Frame 1
var p = new PlayerB(_x, _y, "human", 1, 4);
_root.objects.push(p);
p.UnFreeze();
this._visible = false;
Symbol 2528 MovieClip Frame 2
var r = new Object();
r.x = _x;
r.y = _y;
_root.respawners.push(r);
stop();
Symbol 2529 MovieClip Frame 1
_root.knight = new PlayerA(_x, _y, "human", 1, 1);
_root.knight.UnFreeze();
this._visible = false;
Symbol 2530 MovieClip Frame 1
_x = 0;
_y = 0;
_xscale = 100;
_yscale = 100;
Symbol 2534 MovieClip Frame 1
_root.backgrounds.push(new Background(this, 0.034, 0));
gotoAndStop (2);
Symbol 2552 MovieClip Frame 1
stop();
Symbol 2552 MovieClip Frame 13
stop();
Symbol 2561 MovieClip Frame 1
_root.push_static_brick(b2, 0, _x, _y);
_root.push_static_brick(b4, 0, _x, _y);
b2._visible = false;
b4._visible = false;
Symbol 2567 MovieClip Frame 1
_root.push_static_brick(b2, 0, _x, _y);
_root.push_static_brick(b4, 0, _x, _y);
b2._visible = false;
b4._visible = false;
Symbol 2570 MovieClip Frame 1
_root.push_static_brick(b2, 0, _x, _y);
_root.push_static_brick(b4, 0, _x, _y);
b2._visible = false;
b4._visible = false;
Symbol 2582 MovieClip Frame 1
_root.push_static_brick(b2, 0, _x, _y);
_root.push_static_brick(b4, 0, _x, _y);
b2._visible = false;
b4._visible = false;
Symbol 2590 MovieClip Frame 1
stop();
Symbol 2590 MovieClip Frame 11
gotoAndPlay (1);
Symbol 2590 MovieClip Frame 21
gotoAndPlay (11);
Symbol 2608 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
gotoAndStop (3);
Symbol 2608 MovieClip Frame 22
stop();
Symbol 2608 MovieClip Frame 42
gotoAndStop (2);
Symbol 2610 MovieClip Frame 1
_root.push_platform(this, _root.t_slope_up_left);
_visible = false;
stop();
Symbol 2613 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
gotoAndStop ("close");
Symbol 2613 MovieClip Frame 11
stop();
Symbol 2613 MovieClip Frame 22
stop();
Symbol 2613 MovieClip Frame 23
gotoAndPlay (2);
Symbol 2622 MovieClip Frame 1
_root.push_platform(platform, 0, _x, _y, area);
_root.lifts.push(this);
var is_playing = false;
gotoAndStop ("down");
Symbol 2622 MovieClip Frame 240
gotoAndPlay (2);
Symbol 2626 MovieClip Frame 1
_root.push_platform(platform, 0, _x, _y, area);
_root.lifts.push(this);
var is_playing = false;
nextFrame();
Symbol 2626 MovieClip Frame 440
gotoAndPlay (2);
Symbol 2630 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
gotoAndStop (3);
Symbol 2639 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
_root.push_brick(b3, 0, _x, _y);
b3._visible = false;
_root.push_brick(b4, 0, _x, _y);
b4._visible = false;
_parent.hor_door3.gotoAndStop("open");
gotoAndStop (2);
Symbol 2639 MovieClip Frame 4
_root.push_brick(b2, 0, _x, _y);
b2._visible = false;
Instance of Symbol 2425 MovieClip "door1_" in Symbol 2639 MovieClip Frame 4
onClipEvent (load) {
function situation2() {
_root.sound("snd_klaxon");
_parent._parent.hor_door3.gotoAndPlay("open");
var _local3 = new Enemy(x - 200, y, "human", 2, 22, 80, 4);
_local3.MoveDX(500);
_root.PushObject(_local3);
_local3 = new Enemy(x, y, "human", 2, 22, 80, 4);
_local3.MoveDX(300);
_root.PushObject(_local3);
}
_x = (_x + _parent._x);
_y = (_y + _parent._y);
x = _parent._parent.spawn5._x;
y = _parent._parent.spawn5._y;
_parent._parent.hor_door3.gotoAndStop("open");
_root.PushObject(new TriggerFunction(this, situation2));
}
Instance of Symbol 2425 MovieClip in Symbol 2639 MovieClip Frame 4
onClipEvent (load) {
_x = (_x + _parent._x);
_y = (_y + _parent._y);
_root.PushObject(new TriggerPersistent(this, _parent._parent._start_wind));
}
Instance of Symbol 2425 MovieClip in Symbol 2639 MovieClip Frame 4
onClipEvent (load) {
_x = (_x + _parent._x);
_y = (_y + _parent._y);
_root.PushObject(new TriggerPersistent(this, _parent._parent._stop_wind));
}
Instance of Symbol 2425 MovieClip in Symbol 2639 MovieClip Frame 4
onClipEvent (load) {
_x = (_x + _parent._x);
_y = (_y + _parent._y);
_root.PushObject(new TriggerPersistent(this, _parent._parent._stop_wind));
}
Instance of Symbol 2425 MovieClip in Symbol 2639 MovieClip Frame 4
onClipEvent (load) {
_x = (_x + _parent._x);
_y = (_y + _parent._y);
_root.PushObject(new TriggerPersistent(this, _parent._parent._start_wind));
}
Symbol 2643 MovieClip Frame 1
_root.push_platform(platform, 0, _x, _y, area);
_root.lifts.push(this);
var is_playing = false;
nextFrame();
Symbol 2643 MovieClip Frame 560
gotoAndPlay (2);
Symbol 2647 MovieClip Frame 1
_root.PushObject(new SwitchStart(this, _trigger, this._name));
Symbol 2647 MovieClip Frame 11
stop();
Symbol 2647 MovieClip Frame 21
stop();
Symbol 2653 MovieClip Frame 1
var n = Math.min(Math.ceil((20 * _xscale) / 100), 20);
var cb = new CableDoubleAnchor(_x, _y, "cable20", n, _root.gravity_y);
var i = n;
while (i <= 19) {
cb.sprite["c" + i]._visible = false;
i++;
}
_root.p.x = 600;
_root.p.y = 0;
_root.p = this.transform.matrix.transformPoint(_root.p);
cb.SetPos1(_x, _y);
cb.SetPos2(_root.p.x, _root.p.y);
cb.anchor2 = 0;
_root.PushObject(cb, this);
Symbol 2657 MovieClip Frame 1
_root.push_brick(this, _root.t_breakable);
stop();
Symbol 2657 MovieClip Frame 11
stop();
Symbol 2666 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
_root.push_brick(b2, 0, _x, _y);
_root.push_brick(b3, 0, _x, _y);
b2._visible = false;
b3._visible = false;
_root.lifts.push(this);
var is_playing = false;
gotoAndStop ("close");
Symbol 2666 MovieClip Frame 11
stop();
Symbol 2666 MovieClip Frame 22
stop();
Symbol 2666 MovieClip Frame 23
gotoAndPlay (2);
Symbol 2666 MovieClip Frame 24
is_playing = true;
Symbol 2666 MovieClip Frame 134
var yc = (_y + (_height * 0.5));
var dx = 32;
var xc = ((_x - 200) + dx);
while (xc < ((_x + 450) - dx)) {
_root.objects.push(new SpinningGib("metal_gibs", xc, yc, random(360), 1, 10, random(7) + 9, 14));
xc = xc + dx;
}
Symbol 2666 MovieClip Frame 151
is_playing = false;
stop();
Symbol 2670 MovieClip Frame 2
var rb = new RocketBot(_x, _y);
if (parseInt(this._name) > 0) {
rb.life = parseInt(this._name);
}
_root.PushObject(rb, this);
stop();
Symbol 2672 MovieClip Frame 1
var f = parseFloat(this._name);
if (!f) {
f = 20;
}
_root.PushObject(new JumpPad(this, f), this);
Symbol 2675 MovieClip Frame 1
_trigger._visible = false;
gotoAndStop ("off_end");
Symbol 2675 MovieClip Frame 11
stop();
Symbol 2675 MovieClip Frame 21
stop();
Symbol 2678 MovieClip Frame 1
var a = this._name;
this._name = "the_dude";
_root.PushObject(new Enemy(_x, _y, "human", parseInt(a.substr(0, 1)), 22, 60, parseInt(a.substr(1, 1))), this);
Symbol 2679 MovieClip Frame 1
var n = parseInt(this._name);
this._name = "teh_BonusSmg";
if (!n) {
n = 10;
}
_root.PushObject(new BonusGun(_x, _y, "bonus_gun", 3, n), this);
Symbol 2699 MovieClip Frame 1
stop();
Symbol 2699 MovieClip Frame 41
stop();
Symbol 2699 MovieClip Frame 51
stop();
Symbol 2703 MovieClip Frame 1
_root.lifts.push(this);
var is_playing = false;
stop();
Symbol 2703 MovieClip Frame 2
is_playing = true;
Symbol 2703 MovieClip Frame 17
function _restore_state() {
st.Restore(false, false);
}
function _train_hit() {
st = new PlayerState();
st.Save();
var _local2 = new StunnedPlayer(_root.knight.getx(), _root.knight.gety(), "right", -50, -8, 60);
_root.sound("snd_hit");
var _local3 = "mwahahah smash it. RAaaAAAaAVEEEE/ kill em allth";
_root.sound("snd_hit");
_root.knight.RemoveSprite();
_root.knight.Kill();
_root.knight = _local2;
_local2.on_activate = _restore_state;
}
var st;
_root.objects.push(new TriggerFunction(this.bumper, _train_hit, _x, _y));
Symbol 2703 MovieClip Frame 40
function _restore_state() {
st.Restore(false, false);
play();
}
function _passengers() {
loko_mc.gotoAndPlay("open");
_root.sound("snd_pneumatic");
sp.Delay(50);
sp.AddEvent(_team1);
sp.AddEvent(_team1);
sp.AddEvent(_team1);
sp.AddEvent(_team1);
_root.objects.push(sp);
}
function _team1(spawner) {
var _local2 = 2;
if (random(100) < 30) {
_local2 = 3;
}
var _local1 = new Enemy(_x, _y, "human", _local2, 22, 80, 4);
_local1.oldy = _local1.oldy + 12;
_local1.MoveDX(-200);
spawner.SpawnObj(_local1);
spawner.Delay(40);
}
function _depart() {
_root.knight.LockControls("sit", loko_mc);
gotoAndPlay ("depart");
}
_root.push_brick(sl, _root.t_slope_up_left, _x, _y);
_root.push_platform(pl, 0, _x, _y);
_root.push_brick(b1, 0, _x, _y);
_root.push_brick(b2, 0, _x, _y);
sl._visible = false;
pl._visible = false;
b1._visible = false;
b2._visible = false;
var st;
var sp = new Spawner(_x, _y);
var loko_mc = this.loko;
_root.objects.push(new TriggerFunction(this.bumper, _passengers, _x, _y));
_root.objects.push(new TriggerFunction(this.depart_trigger, _depart, _x, _y));
Symbol 2703 MovieClip Frame 54
is_playing = false;
stop();
Symbol 2703 MovieClip Frame 64
stop();
Symbol 2703 MovieClip Frame 65
is_playing = true;
Symbol 2703 MovieClip Frame 175
is_playing = false;
_root.menu_controller.NextLevel("level3");
stop();
Symbol 2706 MovieClip Frame 1
_root.knight = new Hero(_x, _y, "human");
this._visible = false;
gotoAndStop (2);
Symbol 2706 MovieClip Frame 2
_root.level_finish_state.Restore(false, true);
Symbol 2707 MovieClip Frame 1
function _start_wind(spawner) {
if (!_parent.wind_started) {
_root.snd_wind.start(0, 9999);
}
_parent.wind_started = true;
}
function _stop_wind(spawner) {
_root.snd_wind.stop();
_parent.wind_started = false;
}
_x = 0;
_y = 0;
_xscale = 100;
_yscale = 100;
wind_started = false;
stop();
Instance of Symbol 2630 MovieClip "vault_door1" in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new Door(this, undefined, this._name, 20, false, false));
}
Instance of Symbol 2608 MovieClip "_vault_door2" in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new Door(this, undefined, this._name, 20, false, false));
}
Instance of Symbol 2608 MovieClip "vault_door3" in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new Door(this, undefined, this._name, 20, false, false));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_parent.start_lift.gotoAndPlay(10);
_parent.start_lift.is_playing = true;
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
function jetpackers1(spawner) {
var _local4 = _parent.jetpacker_point1._x;
var _local3 = _parent.jetpacker_point1._y;
_root.PushObject(new Enemy(_local4, _local3, "human", 3, 20, 50, 5));
_local4 = _parent.jetpacker_point2._x;
_local3 = _parent.jetpacker_point2._y;
_root.PushObject(new Enemy(_local4, _local3, "human", 2, 20, 50, 5));
}
_root.PushObject(new TriggerFunction(this, jetpackers1));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._start_wind));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._stop_wind));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
function _v_d2_open() {
_parent._vault_door2.gotoAndPlay("open");
}
_root.PushObject(new TriggerFunction(this, _v_d2_open));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._stop_wind));
}
Instance of Symbol 2425 MovieClip "door1_" in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
function gen_pos() {
x = ((x2 - x1) * Math.random()) + x1;
}
function wtf(spawner) {
_parent.monitor1.gotoAndPlay("verification");
_parent.monitor2.gotoAndPlay("verification");
_parent.monitor3.gotoAndPlay("verification");
_parent.monitor4.gotoAndPlay("verification");
spawner.Delay(39);
spawner.AddEvent(klaxon);
_root.SetBounds(_parent.situation1_top_left._x, _parent.situation1_top_left._y, _parent.situation1_bottom_right._x, _parent.situation1_bottom_right._y);
}
function klaxon(spawner) {
_root.sound("snd_klaxon");
spawner.Delay(32);
spawner.AddEvent(warning);
}
function warning(spawner) {
_root.sound_loop("snd_alarm", 3);
spawner.Delay(30);
spawner.AddEvent(_team1);
}
function _mine(spawner) {
gen_pos();
_root.PushObject(new Mine(x, y));
spawner.Delay(40);
spawner.WaitUntilDie(true);
}
function _saw(spawner) {
gen_pos();
spawner.SpawnObj(new Saw(x, y));
}
function _present(spawner) {
gen_pos();
_root.PushObject(new Crate(cx - 10, y, "crate", _parent.box_sample, 60, "heal30"));
}
function _team1(spawner) {
if (times == 1) {
_parent.hor_door2.gotoAndPlay("open");
}
if (random(100) < 50) {
x = x1;
} else {
x = x2;
}
var _local4 = random(3) + 1;
var _local3 = new Enemy(x, y, "human", _local4, random(5) + 11, 40, 1);
_local3.MoveDX(cx - x);
spawner.SpawnObj(_local3);
spawner.WaitUntilDie(false);
if (times == 4) {
spawner.Delay(350);
spawner.AddEvent(_team2);
times = 1;
return(undefined);
}
spawner.Delay(10);
if (random(100) < 5) {
spawner.AddEvent(_saw);
spawner.Delay(10);
spawner.AddEvent(_team1);
} else {
spawner.AddEvent(_team1);
}
times++;
}
function _team2(spawner) {
if (random(100) < 50) {
x = x1;
} else {
x = x2;
}
var _local2;
if (times <= 2) {
var _local3 = random(2) + 2;
_local2 = new Enemy(cx, y, "human", _local3, 20, 60, 5);
_local2.y = _local2.y + 20;
} else {
var _local3 = random(3) + 1;
_local2 = new Enemy(x, y, "human", _local3, random(5) + 11, 40, random(4) + 1);
_local2.MoveDX(cx - x);
}
spawner.SpawnObj(_local2);
spawner.Delay(20);
spawner.WaitUntilDie(false);
if (times == 4) {
spawner.Delay(400);
spawner.AddEvent(_team3);
times = 1;
return(undefined);
}
spawner.AddEvent(_team2);
times++;
}
function _team3(spawner) {
if (random(100) < 50) {
x = x1;
} else {
x = x2;
}
var _local4 = random(2) + 2;
var _local3 = new Enemy(x, y, "human", _local4, 22, 80, 4);
_local3.MoveDX(cx - x);
spawner.WaitUntilDie(true);
spawner.SpawnObj(_local3);
spawner.Delay(20);
if ((times % 4) == 0) {
_present(spawner);
}
if (times == 4) {
spawner.Delay(-1);
spawner.AddEvent(cookie);
spawner.WaitUntilDie(true);
times = 1;
_parent.monitor1.gotoAndPlay("error");
_parent.monitor2.gotoAndPlay("error");
_parent.monitor3.gotoAndPlay("error");
_parent.monitor4.gotoAndPlay("error");
return(undefined);
}
spawner.AddEvent(_team3);
times++;
}
function cookie() {
_parent.hor_door1.gotoAndPlay("open");
_parent.vault_door1_switch.gotoAndPlay("on");
_parent.s1_ceil_limiter.gotoAndStop("end");
_root.keys.vault_door1 = true;
_root.UnSetBounds();
}
function situation1() {
sp.AddEvent(wtf);
_root.PushObject(sp);
}
var sp = new Spawner(_x, _y);
var x = 0;
var y = _parent.spawn3._y;
var x1 = _parent.spawn3._x;
var x2 = _parent.spawn4._x;
var cx = _parent.tower_middle._x;
_parent.hor_door2.gotoAndStop("open");
var times = 1;
_root.PushObject(new TriggerFunction(this, situation1));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
function close_hor_door1() {
_parent.hor_door1.gotoAndPlay("close");
_root.PushObject(new Mine(_parent.spawn1._x, _parent.spawn1._y), this);
_root.PushObject(new Mine(_parent.spawn2._x, _parent.spawn2._y), this);
_root.SetCheckpoint(_parent.tower_middle._x, _parent.tower_middle._y + 40);
}
_root.PushObject(new TriggerFunction(this, close_hor_door1));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
function _v_d2_open() {
_parent.vault_door2.gotoAndPlay("open");
}
_root.PushObject(new TriggerPersistent(this, _parent._start_wind));
_root.PushObject(new TriggerFunction(this, _v_d2_open));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._stop_wind));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
function _v_d2_open() {
_parent.vault_door2.gotoAndPlay("open");
}
_root.PushObject(new TriggerPersistent(this, _parent._start_wind));
_root.PushObject(new TriggerFunction(this, _v_d2_open));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._stop_wind));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._start_wind));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._stop_wind));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._start_wind));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
function _zoom_out() {
_root.view_scale = 50;
_root.SetBounds(_parent.boss_room_top_left._x, _parent.boss_room_top_left._y, _parent.boss_room_bottom_right._x, _parent.boss_room_bottom_right._y);
_parent.Boss();
_parent.boss_room_floor.play();
_root.SetCheckpoint(_parent.boss_room_respawn._x, _parent.boss_room_respawn._y);
}
_root.PushObject(new TriggerFunction(this, _zoom_out));
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
function _drop1(sp) {
sp.UnGrab();
gunship1.Delay(70);
gunship2.AddEvent(_drop2);
gunship2.Delay(70);
}
function _run1(sp) {
sp.run();
}
function _activate(sp) {
worm.StartFollowPlayer();
gunship2.Delay(100);
gunship2.AddEvent(_run2);
_root.objects.push(spawner);
spawner.AddEvent(_zoom_out);
spawner.Delay(70);
snd.start(0, 4);
}
function _run2(sp) {
sp.run();
}
function _drop2(sp) {
sp.UnGrab();
gunship1.AddEvent(_run1);
gunship1.Delay(20);
gunship1.MoveTo(destx - 200, desty + 100);
gunship2.AddEvent(_activate);
gunship2.Delay(50);
gunship2.MoveTo(destx + 300, desty + 100);
}
function _zoom_out() {
_root.view_scale = 60;
}
function _delay_zoom100() {
_root.view_scale = 100;
_zoom100_sp = new Spawner(_parent.boss_end_trigger._x, _parent.boss_end_trigger._y);
_zoom100_sp.AddEvent(_zoom100);
_zoom100_sp.Delay(100);
_root.objects.push(_zoom100_sp);
}
function _zoom100() {
_parent.hor_door4.play();
}
function _die(sp) {
sp.ExplodeHead();
_root.level.boss_room_floor.gotoAndPlay("break");
_root.UnSetBounds();
_root.PushObject(new TriggerFunction(_parent.boss_end_trigger, _delay_zoom100));
_parent.checkpoint2.Restore();
}
var destx = _parent.drop_point._x;
var desty = _parent.drop_point._y;
var midx = _parent.boss_room_mid._x;
var midy = _parent.boss_room_mid._y;
var gunship1 = new GunShip(_x, _y, true);
var gunship2 = new GunShip(_x + 500, _y, true);
var worm = new Worm(_x, _y + 200);
var spawner = new Spawner(destx, desty + 400);
var snd = new Sound(this);
snd.attachSound("boss_theme1");
var _zoom100_sp;
_parent.Boss = function () {
_root.objects.push(gunship1);
_root.objects.push(gunship2);
_root.objects.push(worm);
gunship1.UnFreeze();
gunship2.UnFreeze();
worm.UnFreeze();
worm.on_die = _die;
gunship1.Grab(worm.point1());
gunship2.Grab(worm.point2());
gunship1.Delay(30);
gunship1.AddEvent(_drop1);
gunship1.MoveTo(destx, desty);
gunship2.MoveTo(destx + 500, desty - 100);
};
}
Instance of Symbol 2425 MovieClip "boss_end_trigger" in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
_parent.hor_door4.gotoAndStop("open");
}
Instance of Symbol 2425 MovieClip in Symbol 2707 MovieClip Frame 1
onClipEvent (load) {
function _go_train() {
_parent.vokzal_gate.play();
_parent.train.play();
}
_root.PushObject(new TriggerFunction(this, _go_train));
}
Symbol 2712 MovieClip Frame 1
Symbol 2718 MovieClip Frame 1
stop();
Symbol 2718 MovieClip Frame 40
gotoAndPlay (1);
Symbol 2721 MovieClip Frame 1
stop();
Symbol 2721 MovieClip Frame 290
stop();
Symbol 2724 MovieClip Frame 1
var fr = (random(_framesloaded) + 1);
var depth = 20;
var id = _root.get_id();
var sprite = _root.objects_layer.attachMovie("train_foregrounds", "gr" + id, id + (_root.depth_band * depth));
sprite._x = _x;
sprite._y = _y;
sprite.gotoAndPlay(fr + 50);
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(fr);
Symbol 2724 MovieClip Frame 2
sprite.gotoAndPlay(52);
Symbol 2724 MovieClip Frame 41
gotoAndPlay (2);
Symbol 2724 MovieClip Frame 50
sprite.gotoAndStop("empty");
Symbol 2726 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 2726 MovieClip Frame 41
gotoAndPlay (2);
Symbol 2730 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 2730 MovieClip Frame 41
gotoAndPlay (2);
Symbol 2732 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 2732 MovieClip Frame 41
gotoAndPlay (2);
Symbol 2735 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 2735 MovieClip Frame 41
gotoAndPlay (2);
Symbol 2737 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 2737 MovieClip Frame 41
gotoAndPlay (2);
Symbol 2740 MovieClip Frame 1
var fr = (random(_framesloaded - 2) + 2);
var depth = 20;
var id = _root.get_id();
var sprite = _root.objects_layer.attachMovie("train_foregrounds", "gr" + id, id + (_root.depth_band * depth));
sprite._x = _x;
sprite._y = _y;
sprite.gotoAndPlay(fr);
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(fr);
Symbol 2740 MovieClip Frame 2
sprite.gotoAndPlay(2);
Symbol 2740 MovieClip Frame 41
gotoAndPlay (2);
Symbol 2740 MovieClip Frame 50
sprite.gotoAndPlay("empty");
Symbol 2741 MovieClip Frame 1
var fr = (random(_framesloaded - 2) + 2);
var depth = 20;
var id = _root.get_id();
var sprite = _root.objects_layer.attachMovie("train_foregrounds", "gr" + id, id + (_root.depth_band * depth));
sprite._x = _x;
sprite._y = _y;
sprite.gotoAndPlay(fr + 50);
_root.PushObject(new TriggerHideForeground(trigger1, sprite, 1, 1, _x, _y));
_root.PushObject(new TriggerHideForeground(trigger2, sprite, -1, 1, _x, _y));
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(fr);
Symbol 2741 MovieClip Frame 2
sprite.gotoAndPlay(52);
Symbol 2741 MovieClip Frame 41
gotoAndPlay (2);
Symbol 2741 MovieClip Frame 50
sprite.gotoAndPlay("empty");
Symbol 2743 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 2743 MovieClip Frame 41
gotoAndPlay (2);
Symbol 2746 MovieClip Frame 1
gotoAndPlay(random(_framesloaded) + 1);
Symbol 2746 MovieClip Frame 41
gotoAndPlay (2);
Symbol 2753 MovieClip Frame 1
this._name = "crane";
_root.lifts.push(this);
var is_playing = false;
stop();
Symbol 2753 MovieClip Frame 2
is_playing = true;
Symbol 2753 MovieClip Frame 566
var sx = _root.level.strela_pos._x;
var sy = _root.level.strela_pos._y;
_root.PushObject(new Winch(sx, sy, 0.1, 2, 14));
is_playing = false;
stop();
Symbol 2754 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 2754 MovieClip Frame 41
gotoAndPlay (2);
Symbol 2754 MovieClip Frame 50
_visible = true;
Symbol 2758 MovieClip Frame 1
stop();
Symbol 2758 MovieClip Frame 41
stop();
Symbol 2758 MovieClip Frame 51
stop();
Symbol 2759 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
Symbol 2759 MovieClip Frame 16
gotoAndPlay (2);
Symbol 2765 MovieClip Frame 1
function _pick() {
gotoAndStop ("picked");
_root.knight.PickWeapon(4, 12);
}
_root.PushObject(new TriggerFunction(trigger1, _pick, _x, _y));
Symbol 2765 MovieClip Frame 20
gotoAndPlay (2);
Symbol 2766 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
Symbol 2766 MovieClip Frame 16
gotoAndPlay (2);
Symbol 2768 MovieClip Frame 1
var n = parseInt(this._name);
this._name = "teh_BonusSmg";
if (!n) {
n = 8;
}
_root.PushObject(new BonusGun(_x, _y, "bonus_gun", 4, n), this);
Symbol 2772 MovieClip Frame 1
var a = this._name;
this._name = "the_dude";
_root.PushObject(new Enemy(_x, _y, "human", parseInt(a.substr(0, 1)), 28, 100, 5), this);
Symbol 2774 MovieClip Frame 1
_visible = false;
stop();
Symbol 2774 MovieClip Frame 2
stop();
Symbol 2775 MovieClip Frame 2
_root.PushObject(new StalkerBarrel(_x, _y, this._name, _parent.StartMinedRailScene), this);
stop();
Symbol 2777 MovieClip Frame 1
function StartMinedRailScene() {
train_optimisator.StartMinedRailScene();
}
_x = 0;
_y = 0;
_xscale = 100;
_yscale = 100;
_root.wind_left = -4;
_root.wind_right = -1;
_root.level_vx = 30;
var train_optimisator = new TrainOptimisator();
_root.objects.push(train_optimisator);
stop();
Instance of Symbol 2718 MovieClip in Symbol 2777 MovieClip Frame 1
onClipEvent (load) {
_x = -4096;
var back = new TileXBackground(this, 1, 1, false);
_root.backgrounds.push(back);
}
Instance of Symbol 2316 MovieClip "door2" in Symbol 2777 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new Door(this, undefined, this._name, 65, false, false));
}
Instance of Symbol 2425 MovieClip in Symbol 2777 MovieClip Frame 1
onClipEvent (load) {
function _gunship_die() {
_parent.checkpoint1.Restore();
}
var x = _parent.gunship_spawn._x;
var y = _parent.gunship_spawn._y;
var gunship = new GunShip(x, y, false, 2);
_parent.gunship = gunship;
gunship.attack = gunship.Minigun;
gunship.left_bound = _parent.gunship_left_bound._x;
gunship.right_bound = _parent.gunship_right_bound._x;
gunship.player_left_bound = _parent.player_left_bound._x;
gunship.player_right_bound = _parent.player_right_bound._x;
Boss = function () {
_root.objects.push(gunship);
gunship.UnFreeze();
gunship.Delay(30);
gunship.MoveTo(x - 400, y - 400);
gunship.Land();
gunship.on_die = _gunship_die;
_root.view_scale = 80;
};
_root.PushObject(new TriggerFunction(this, Boss));
}
Instance of Symbol 2425 MovieClip in Symbol 2777 MovieClip Frame 1
onClipEvent (load) {
function _takeoff() {
_parent.gunship.Takeoff();
_root.SetCheckpoint(_parent.respawn1._x, _parent.respawn1._y);
}
_root.PushObject(new TriggerFunction(this, _takeoff));
}
Instance of Symbol 2425 MovieClip in Symbol 2777 MovieClip Frame 1
onClipEvent (load) {
function create_man1() {
var _local1 = new Enemy(_x, _y, "human", 2, random(5) + 11, 40, 1, 3);
return(_local1);
}
function wave1(spawner) {
spawner.SpawnObj(create_man1());
spawner.Delay(10);
}
function run(spawner) {
spawner.run();
}
function _crane_start() {
var _local3 = new CargoShip(_parent.drop_ship_spawn._x, _parent.drop_ship_spawn._y);
_local3.WaitUntilDie(false);
_local3.desty = _local3.y;
_local3.destx = _local3.x - 2000;
_local3.behavior = _local3.stand;
_local3.wind_coeff = 0;
spawner.Delay(40);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(run);
_local3.life2 = 10000;
_root.objects.push(_local3);
_local3.UnFreeze();
_parent.crane_wagon.crane.play();
_root.view_scale = 75;
}
_root.PushObject(new TriggerFunction(this, _crane_start));
}
Instance of Symbol 2425 MovieClip in Symbol 2777 MovieClip Frame 1
onClipEvent (load) {
function _zoom100() {
_root.view_scale = 100;
}
_root.PushObject(new TriggerFunction(this, _zoom100));
}
Instance of Symbol 2425 MovieClip in Symbol 2777 MovieClip Frame 1
onClipEvent (load) {
function _spawn_stalker() {
_root.keys.stalker_barrel = true;
}
_root.PushObject(new TriggerFunction(this, _spawn_stalker));
}
Symbol 2781 MovieClip Frame 1
function _gibs() {
var _local2 = 0;
while (_local2 < 4) {
_root.objects.push(new SpinningGib("rail_gibs", _x + pointer._x, _y + pointer._y, random(360), 20, 6, random(4) + 1, 4));
_local2++;
}
}
stop();
Symbol 2781 MovieClip Frame 2
_root.dust(_x + pointer._x, _y + pointer._y, 10, 20);
Symbol 2781 MovieClip Frame 4
_root.dust(_x + pointer._x, _y + pointer._y, 5, 20);
_gibs();
Symbol 2781 MovieClip Frame 8
_root.dust(_x + pointer._x, _y + pointer._y, 5, 20);
_gibs();
Symbol 2781 MovieClip Frame 12
_gibs();
Symbol 2781 MovieClip Frame 14
_gibs();
Symbol 2781 MovieClip Frame 16
_gibs();
Symbol 2781 MovieClip Frame 75
stop();
Symbol 2787 MovieClip Frame 1
var depth = 20;
var id = _root.get_id();
var sprite = _root.objects_layer.attachMovie("train_foregrounds", "gr" + id, id + (_root.depth_band * depth));
sprite._x = _x;
sprite._y = _y;
sprite.gotoAndStop("rail_bridge");
Symbol 2796 MovieClip Frame 1
_root.objects.push(new FallingTrain(_x, _y));
Symbol 2796 MovieClip Frame 2
stop();
Symbol 2797 MovieClip Frame 1
_x = 0;
_y = 0;
_xscale = 100;
_yscale = 100;
_root.wind_left = -4;
_root.wind_right = -1;
_root.level_vx = 0;
stop();
Symbol 2799 MovieClip Frame 3
_root.persistent_buf.aircraft_trajectory = new Trajectory(this);
Symbol 2799 MovieClip Frame 4
stop();
Symbol 2816 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y, area);
b1._visible = false;
_root.lifts.push(this);
var is_playing = false;
gotoAndStop (2);
Symbol 2816 MovieClip Frame 3
is_playing = true;
Symbol 2816 MovieClip Frame 122
Symbol 2816 MovieClip Frame 263
is_playing = false;
stop();
Symbol 2823 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
gotoAndStop (36);
Symbol 2823 MovieClip Frame 2
stop();
Symbol 2823 MovieClip Frame 36
stop();
Symbol 2823 MovieClip Frame 92
stop();
Symbol 2885 MovieClip Frame 1
_root.lifts.push(this);
var is_playing = false;
stop();
Symbol 2885 MovieClip Frame 2
is_playing = true;
Symbol 2885 MovieClip Frame 154
is_playing = false;
_root.menu_controller.NextLevel("final");
stop();
Symbol 2898 MovieClip Frame 1
var depth = 20;
var id = _root.get_id();
var sprite = _root.objects_layer.attachMovie("train_foregrounds", "gr" + id, id + (_root.depth_band * depth));
sprite._x = _x;
sprite._y = _y;
sprite.gotoAndStop("broken_wagon");
sprite._rotation = _rotation;
stop();
Symbol 2904 MovieClip Frame 1
var depth = 20;
var id = _root.get_id();
var sprite = _root.objects_layer.attachMovie("train_foregrounds", "gr" + id, id + (_root.depth_band * depth));
sprite._x = _x;
sprite._y = _y;
sprite.gotoAndStop("broken_wagon");
sprite._rotation = _rotation;
stop();
Symbol 2920 MovieClip Frame 1
var depth = 20;
var id = _root.get_id();
var sprite = _root.objects_layer.attachMovie("train_foregrounds", "gr" + id, id + (_root.depth_band * depth));
sprite._x = _x;
sprite._y = _y;
sprite.gotoAndStop("broken_wagon");
sprite._rotation = _rotation;
stop();
Symbol 2943 MovieClip Frame 1
var sx = (_x + strela._x);
var sy = (_y + strela._y);
var cable = new CableDoubleAnchor(sx, sy + 200, "cable_grapple_long", 15, _root.gravity_y, 0, 0, 2);
_root.PushObject(cable);
cable.SetPos1(sx, sy);
cable.anchor2 = 0;
var depth = 20;
var id = _root.get_id();
var sprite = _root.objects_layer.attachMovie("train_foregrounds", "gr" + id, id + (_root.depth_band * depth));
sprite._x = _x + 372;
sprite._y = _y - 732;
sprite.gotoAndStop("strela");
stop();
Symbol 2951 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
gotoAndStop (36);
Symbol 2951 MovieClip Frame 2
stop();
Symbol 2951 MovieClip Frame 36
stop();
Symbol 2951 MovieClip Frame 92
stop();
Symbol 2957 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
Symbol 2957 MovieClip Frame 2
stop();
Symbol 2957 MovieClip Frame 36
stop();
Symbol 2966 MovieClip Frame 1
_root.PushObject(new Crane(_x, _y), this);
Symbol 2969 MovieClip Frame 1
var depth = 20;
var id = _root.get_id();
var sprite = _root.objects_layer.attachMovie("level4_foregrounds", "gr" + id, id + (_root.depth_band * depth));
sprite._x = _x;
sprite._y = _y;
sprite.gotoAndStop(parseInt(_name));
this.gotoAndStop("empty");
Symbol 2973 MovieClip Frame 1
_root.PushObject(new Crane(_x, _y, 2), this);
Symbol 2988 MovieClip Frame 1
var ready = false;
_root.PushObject(new Damager(this, parseInt(_name)));
this._name = "dm";
gotoAndStop (2);
Symbol 2988 MovieClip Frame 31
ready = true;
damage._visible = false;
Symbol 2988 MovieClip Frame 64
ready = false;
Symbol 2988 MovieClip Frame 74
gotoAndPlay (3);
Symbol 2989 MovieClip Frame 1
var a = this._name;
this._name = "the_crate";
var cr = new Crate(_x, _y, "med_box", this, 20, a);
cr.aabb.w = 40;
cr.aabb.h = 36;
cr.aabb.dx = -20;
cr.aabb.dy = -18;
cr.sprite._xscale = (cr.sprite._yscale = 100);
_root.PushObject(cr, this);
Symbol 2990 MovieClip Frame 1
_root.PushObject(new BeamEmitter_test(_x, _y, this._name, 0, 0, -100), this);
Symbol 2993 MovieClip Frame 1
_root.push_brick(this, _root.t_breakable);
stop();
Symbol 2993 MovieClip Frame 15
stop();
Symbol 2994 MovieClip Frame 2
_root.PushObject(new Raptor(_x, _y));
stop();
Symbol 2995 MovieClip Frame 1
_x = 0;
_y = 0;
_xscale = 100;
_yscale = 100;
var gate3_closed = true;
var crane2_destroyed = false;
stop();
Instance of Symbol 2316 MovieClip "door2" in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new Door(this, undefined, this._name, 65, false, false));
}
Instance of Symbol 2503 MovieClip "checkpoint1" in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
}
Instance of Symbol 2503 MovieClip "checkpoint2" in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function run(spawner) {
spawner.run();
_root.view_scale = 100;
}
function _drop(spawner) {
spawner.DropCargo();
spawner.Delay(35);
}
function _drop_battle_cargo() {
var _local4 = "aaaa >__<. i should sleep more. \"battle cargo\" wtf is that?";
var _local3 = new CargoShip(_parent.drop_ship_spawn._x, _parent.drop_ship_spawn._y, "cargo_ship2");
_local3.WaitUntilDie(false);
_local3.destx = _parent.drop_pos._x;
_local3.desty = _parent.drop_pos._y;
_local3.behavior = _local3.wait_until_arrive;
_local3.wind_coeff = 0;
_local3.AddEvent(_drop);
_local3.AddEvent(run);
_local3.life2 = 10000;
_root.objects.push(_local3);
_local3.UnFreeze();
_root.view_scale = 75;
}
_root.PushObject(new TriggerFunction(this, _drop_battle_cargo));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _stop(sp) {
sp.Delay(80);
sp.AddEvent(_drop);
stalker.Activate();
}
function _drop(sp) {
sp.UnGrab();
sp.Delay(70);
sp.AddEvent(_run);
}
function _run(sp) {
sp.run();
}
function _beam0_off() {
_root.keys.beam0 = false;
}
function _stalker() {
var _local6 = _parent.drop_pos2._x;
var _local5 = _parent.drop_pos2._y;
var _local4 = _parent.gunship_spawn._x;
var _local3 = _parent.gunship_spawn._y;
gunship = new GunShip(_local4, _local3, true, 1);
_root.objects.push(gunship);
gunship.UnFreeze();
stalker = new Stalker(_local4, _local3 + 100, 100);
_root.objects.push(stalker);
stalker.UnFreeze();
stalker.maxlife = (stalker.life = 1800);
stalker.on_die = _beam0_off;
gunship.Grab(stalker.point1());
gunship.AddEvent(_stop);
gunship.MoveTo(_local6, _local5);
_root.keys.beam0 = true;
}
var gunship;
var stalker;
_root.PushObject(new TriggerFunction(this, _stalker));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _beam1_off() {
_root.keys.beam1 = false;
_root.keys.beam0 = false;
}
function _bike_1() {
var _local5 = _parent.bike1_spawn._x;
var _local4 = _parent.bike1_spawn._y;
var _local3 = new Bike(_local5, _local4, 1, _bike_2);
_root.objects.push(_local3);
_local3.UnFreeze();
_root.keys.beam1 = true;
_root.keys.beam0 = true;
}
function _bike_2() {
var _local5 = _parent.bike1_spawn._x;
var _local4 = _parent.bike1_spawn._y;
var _local3 = new Bike(_local5, _local4, 3, _beam1_off);
_root.objects.push(_local3);
_local3.UnFreeze();
}
_root.PushObject(new TriggerFunction(this, _bike_1));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _man(__x, __y, wpn, bhv) {
_root.PushObject(new Enemy(__x, __y, "human", wpn, 22, 60, bhv));
}
function _open_gate2() {
_parent.gate2.gotoAndPlay("open");
var _local3 = _parent.station_spawn._x;
var _local2 = _parent.station_spawn._y;
_man(_local3 - 100, _local2, 2, 1);
_man(_local3, _local2, 2, 1);
_man(_local3 + 250, _local2, 2, 4);
_man(_local3 + 350, _local2, 3, 3);
}
function _bike_2() {
var _local5 = _parent.bike2_spawn._x;
var _local4 = _parent.bike2_spawn._y;
var _local3 = new Bike(_local5, _local4, 4, _open_gate2);
_root.objects.push(_local3);
_local3.UnFreeze();
}
_root.PushObject(new TriggerFunction(this, _bike_2));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _close_gate1() {
_parent.gate1.play();
_parent.station_lift.gotoAndPlay("down");
_parent.station_lift.is_playing = true;
}
_root.PushObject(new TriggerFunction(this, _close_gate1));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function create_man1() {
var _local1 = new Enemy(_x, _y, "human", 2, random(5) + 11, 40, 1, 3);
return(_local1);
}
function wave1(spawner) {
spawner.SpawnObj(create_man1());
spawner.Delay(10);
spawner.destx = spawner.destx - 50;
}
function change_pos(sp) {
switch (pos_n) {
case 0 :
sp.destx = _parent.station_drop_pos2._x;
sp.desty = _parent.station_drop_pos2._y;
break;
case 1 :
sp.destx = _parent.station_drop_pos3._x;
sp.desty = _parent.station_drop_pos3._y;
}
pos_n++;
sp.Delay(120);
}
function run(spawner) {
spawner.run();
_root.view_scale = 100;
_parent.station_lift.stop_if_higher = false;
_parent.station_lift.play();
_parent.checkpoint1.Restore();
}
function _station_desant() {
var _local3 = new CargoShip(_parent.drop_ship_spawn2._x, _parent.drop_ship_spawn2._y, "cargo_ship2");
_local3.WaitUntilDie(true);
_local3.destx = _parent.station_drop_pos1._x;
_local3.desty = _parent.station_drop_pos1._y;
_local3.behavior = _local3.wait_until_arrive;
_local3.wind_coeff = 0;
spawner.Delay(40);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(change_pos);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(change_pos);
_local3.AddEvent(wave1);
_local3.AddEvent(wave1);
_local3.AddEvent(run);
_local3.life2 = 10000;
_root.objects.push(_local3);
_local3.UnFreeze();
_parent.crane_wagon.crane.play();
_root.view_scale = 75;
_root.SetCheckpoint(_parent.station_checkpoint._x, _parent.station_checkpoint._y);
}
var pos_n = 0;
_root.PushObject(new TriggerFunction(this, _station_desant));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _restart_station_lift() {
if (_parent.station_lift._currentframe > 75) {
_parent.station_lift.play();
}
}
_root.PushObject(new TriggerPersistent(this, _close_gate1));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _repeat_bike1() {
if ((_root.knight.getx() > end_x) || (!_spawn)) {
_spawn = false;
return(undefined);
}
var _local4 = _root.knight.getx() + 8000;
var _local3 = _root.knight.gety() - 1000;
var _local2 = new Bike(_local4, _local3, 4, _repeat_bike2);
_root.objects.push(_local2);
_local2.UnFreeze();
}
function _repeat_bike2() {
if ((_root.knight.getx() > end_x) || (!_spawn)) {
_spawn = false;
return(undefined);
}
var _local4 = _root.knight.getx() + 8000;
var _local3 = _root.knight.gety() - 1000;
var _local2 = new Bike(_local4, _local3, 5, _repeat_bike1);
_root.objects.push(_local2);
_local2.UnFreeze();
}
function _bike_3() {
var _local5 = _parent.bike3_spawn._x;
var _local4 = _parent.bike3_spawn._y;
var _local3 = new Bike(_local5, _local4, 1, _repeat_bike2);
_root.objects.push(_local3);
_local3.UnFreeze();
}
var end_x = _root.level.stop_bike_attack._x;
var _spawn = true;
_root.PushObject(new TriggerFunction(this, _bike_3));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _change_bottom_border() {
_root.view_bottom._y = 357;
}
_root.PushObject(new TriggerPersistent(this, _change_bottom_border));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _change_bottom_border() {
_root.view_bottom._y = 357;
}
_root.PushObject(new TriggerPersistent(this, _change_bottom_border));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _change_bottom_border() {
_root.view_bottom._y = 355;
}
_root.PushObject(new TriggerPersistent(this, _change_bottom_border));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _change_bottom_border() {
_root.view_bottom._y = -335;
}
_root.PushObject(new TriggerPersistent(this, _change_bottom_border));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _change_bottom_border() {
_root.view_bottom._y = 357;
}
_root.PushObject(new TriggerPersistent(this, _change_bottom_border));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _close_gate3() {
if ((!_parent.gate3_closed) && (!_parent.crane2_destroyed)) {
_parent.gate3.gotoAndPlay(3);
_parent.gate3_closed = true;
}
}
_root.PushObject(new TriggerPersistent(this, _close_gate3));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _open_gate3() {
if (_parent.gate3_closed && (!_parent.crane2_destroyed)) {
_parent.gate3.play();
_parent.gate3_closed = false;
}
}
_root.PushObject(new TriggerPersistent(this, _open_gate3));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _open_gate3() {
_parent.gate3.gotoAndPlay("open");
_parent.crane2_destroyed = true;
}
_root.PushObject(new TriggerFunction(this, _open_gate3));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _open_gate4() {
_parent.gate4.gotoAndPlay("open");
}
_root.PushObject(new TriggerFunction(this, _open_gate4));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _open_gate5() {
_parent.gate4.gotoAndPlay(3);
_parent.gate5.gotoAndPlay(37);
_root.view_bottom._y = 620;
_parent.bunker_lift.play();
}
_parent.gate5.gotoAndStop(36);
_root.PushObject(new TriggerFunction(this, _open_gate5));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _change_bottom_border() {
_root.view_bottom._y = 357;
}
_root.PushObject(new TriggerPersistent(this, _change_bottom_border));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _change_bottom_border() {
_root.view_bottom._y = 357;
}
_root.PushObject(new TriggerPersistent(this, _change_bottom_border));
}
Instance of Symbol 2425 MovieClip in Symbol 2995 MovieClip Frame 1
onClipEvent (load) {
function _MZKT_GOGOGO() {
_parent.garage.play();
_root.knight.LockControls("sit", _parent.garage.player_pos);
}
_root.PushObject(new TriggerFunction(this, _MZKT_GOGOGO));
}
Symbol 2996 MovieClip Frame 2
_visible = false;
Symbol 2999 MovieClip Frame 1
stop();
Symbol 3000 MovieClip Frame 1
stop();
Symbol 3000 MovieClip Frame 6
stop();
Symbol 3040 MovieClip Frame 1
_root.objects.push(new RocketCarrier(_x, _y, this));
Symbol 3040 MovieClip Frame 40
gotoAndPlay (2);
Symbol 3040 MovieClip Frame 205
truck.play();
Symbol 3040 MovieClip Frame 380
_root.through_clouds.play();
Symbol 3040 MovieClip Frame 412
stop();
Symbol 3041 MovieClip Frame 1
var _content = "heal30smg60";
stop();
Symbol 3041 MovieClip Frame 17
var sb = new Snowball(snowball._x + _x, snowball._y + _y, 60, _content);
sb.oldx = sb.oldx + ((random(100) / 11) + 12);
sb.oldy = sb.oldy + ((random(100) / 11) + 8);
sb.UnFreeze();
_root.objects.push(sb);
Symbol 3041 MovieClip Frame 62
stop();
Symbol 3042 MovieClip Frame 3
_root.persistent_buf.aircraft_trajectory = new Trajectory(this);
Symbol 3042 MovieClip Frame 4
stop();
Symbol 3081 MovieClip Frame 1
function _gib(frame, r) {
if (!r) {
r = 30;
}
_root.p.x = gib_pos._x;
_root.p.y = gib_pos._y;
_root.p = this.transform.matrix.transformPoint(_root.p);
_root.p = _parent.transform.matrix.transformPoint(_root.p);
_root.p = _parent._parent.transform.matrix.transformPoint(_root.p);
var _local5 = new FlyBackGib("rocket_gibs", _root.p.x, _root.p.y, random(360), 8, r, frame, 12);
_root.objects.push(_local5);
}
function throw_bonus() {
_root.p.x = gib_pos._x;
_root.p.y = gib_pos._y;
_root.p = this.transform.matrix.transformPoint(_root.p);
_root.p = _parent.transform.matrix.transformPoint(_root.p);
_root.p = _parent._parent.transform.matrix.transformPoint(_root.p);
var _local4 = "heal50grenade10riffle10smg50";
_root.bonus(_local4, _root.p.x, _root.p.y);
}
var ready = false;
var busy = false;
var opened = fasle;
_root.push_brick(b1, 0, (_parent._parent._x + _parent._x) + _x, (_parent._parent._y + _parent._y) + _y);
b1._visible = false;
gotoAndStop ("idle");
Symbol 3081 MovieClip Frame 2
busy = false;
Symbol 3081 MovieClip Frame 11
busy = true;
Symbol 3081 MovieClip Frame 28
opened = true;
Symbol 3081 MovieClip Frame 88
ready = true;
Symbol 3081 MovieClip Frame 90
ready = false;
Symbol 3081 MovieClip Frame 91
ready = true;
Symbol 3081 MovieClip Frame 95
ready = false;
Symbol 3081 MovieClip Frame 96
ready = true;
Symbol 3081 MovieClip Frame 98
ready = false;
Symbol 3081 MovieClip Frame 99
ready = true;
Symbol 3081 MovieClip Frame 101
ready = false;
Symbol 3081 MovieClip Frame 102
ready = true;
Symbol 3081 MovieClip Frame 104
ready = false;
Symbol 3081 MovieClip Frame 105
ready = true;
Symbol 3081 MovieClip Frame 109
ready = false;
Symbol 3081 MovieClip Frame 110
ready = true;
Symbol 3081 MovieClip Frame 111
ready = false;
Symbol 3081 MovieClip Frame 112
ready = true;
Symbol 3081 MovieClip Frame 113
ready = false;
Symbol 3081 MovieClip Frame 164
opened = false;
Symbol 3081 MovieClip Frame 170
busy = false;
gotoAndStop ("idle");
Symbol 3081 MovieClip Frame 171
Symbol 3081 MovieClip Frame 180
busy = true;
Symbol 3081 MovieClip Frame 198
opened = true;
Symbol 3081 MovieClip Frame 258
ready = true;
Symbol 3081 MovieClip Frame 260
ready = false;
Symbol 3081 MovieClip Frame 261
ready = true;
Symbol 3081 MovieClip Frame 265
ready = false;
Symbol 3081 MovieClip Frame 266
ready = true;
Symbol 3081 MovieClip Frame 268
ready = false;
Symbol 3081 MovieClip Frame 269
ready = true;
Symbol 3081 MovieClip Frame 271
ready = false;
Symbol 3081 MovieClip Frame 272
ready = true;
Symbol 3081 MovieClip Frame 274
ready = false;
Symbol 3081 MovieClip Frame 275
ready = true;
Symbol 3081 MovieClip Frame 279
ready = false;
Symbol 3081 MovieClip Frame 280
ready = true;
Symbol 3081 MovieClip Frame 281
ready = false;
Symbol 3081 MovieClip Frame 282
ready = true;
Symbol 3081 MovieClip Frame 283
ready = false;
Symbol 3081 MovieClip Frame 324
opened = false;
Symbol 3081 MovieClip Frame 332
busy = false;
gotoAndStop ("idle");
Symbol 3081 MovieClip Frame 349
ready = false;
busy = true;
_root.push_platform(platform, 0, (_parent._parent._x + _parent._x) + _x, (_parent._parent._y + _parent._y) + _y, area);
platform._visible = false;
area._visible = false;
Symbol 3081 MovieClip Frame 356
_gib(1, 30);
busy = true;
Symbol 3081 MovieClip Frame 358
_gib(4, 60);
Symbol 3081 MovieClip Frame 359
_gib(4, 60);
Symbol 3081 MovieClip Frame 361
_gib(2);
Symbol 3081 MovieClip Frame 362
_gib(3);
Symbol 3081 MovieClip Frame 363
_gib(5, 50);
throw_bonus();
Symbol 3081 MovieClip Frame 364
_gib(1, 30);
Symbol 3081 MovieClip Frame 370
stop();
Symbol 3081 MovieClip Frame 400
stop();
Symbol 3081 MovieClip Frame 401
_root.knight.scarf.sprite._visible = false;
Symbol 3081 MovieClip Frame 438
stop();
Symbol 3106 MovieClip Frame 1
var busy;
var man;
stop();
Symbol 3106 MovieClip Frame 2
busy = true;
Symbol 3106 MovieClip Frame 35
if (man) {
_root.PushObject(man);
man = undefined;
}
Symbol 3106 MovieClip Frame 74
busy = false;
stop();
Symbol 3113 MovieClip Frame 1
stop();
Symbol 3113 MovieClip Frame 2
_parent._otsek_gibs(this, 10);
Symbol 3113 MovieClip Frame 15
stop();
Symbol 3113 MovieClip Frame 16
_parent._otsek_gibs(this, 10);
Symbol 3113 MovieClip Frame 29
stop();
Symbol 3113 MovieClip Frame 30
_parent._otsek_gibs(this, 10);
Symbol 3113 MovieClip Frame 35
_parent._otsek_gib(this, 10, 80);
Symbol 3113 MovieClip Frame 55
turret.gotoAndPlay("die");
Symbol 3113 MovieClip Frame 75
stop();
Symbol 3123 MovieClip Frame 1
stop();
Symbol 3123 MovieClip Frame 2
_parent._otsek_gibs(this, 10);
Symbol 3123 MovieClip Frame 15
stop();
Symbol 3123 MovieClip Frame 16
_parent._otsek_gibs(this, 10);
Symbol 3123 MovieClip Frame 29
stop();
Symbol 3123 MovieClip Frame 30
_parent._otsek_gibs(this, 10);
Symbol 3123 MovieClip Frame 34
_parent._otsek_gib(this, 10, 80);
Symbol 3123 MovieClip Frame 55
turret.gotoAndPlay("die");
Symbol 3123 MovieClip Frame 75
stop();
Symbol 3123 MovieClip Frame 80
Symbol 3123 MovieClip Frame 171
stop();
Symbol 3123 MovieClip Frame 180
gotoAndPlay ("gettoutta");
Symbol 3131 MovieClip Frame 1
stop();
Symbol 3131 MovieClip Frame 2
_parent._otsek_gibs(this, 10);
Symbol 3131 MovieClip Frame 15
stop();
Symbol 3131 MovieClip Frame 16
_parent._otsek_gibs(this, 10);
Symbol 3131 MovieClip Frame 29
stop();
Symbol 3131 MovieClip Frame 30
_parent._otsek_gibs(this, 10);
Symbol 3131 MovieClip Frame 34
_parent._otsek_gib(this, 10, 80);
Symbol 3131 MovieClip Frame 55
turret.gotoAndPlay("die");
Symbol 3131 MovieClip Frame 75
stop();
Symbol 3141 MovieClip Frame 1
stop();
Symbol 3141 MovieClip Frame 69
_parent._otsek_gibs(this, 20);
Symbol 3141 MovieClip Frame 130
_parent.otsek3.turret.gotoAndPlay("close");
Symbol 3141 MovieClip Frame 258
var sx = ((core_spawn_pos._x + _x) + _parent._x);
var sy = ((core_spawn_pos._y + _y) + _parent._y);
_root.PushObject(new Core(sx, sy));
stop();
Symbol 3143 MovieClip Frame 1
function _otsek_gibs(otsek, n) {
_root.p.x = otsek.gibs_pos._x;
_root.p.y = otsek.gibs_pos._y;
_root.p = otsek.transform.matrix.transformPoint(_root.p);
_root.p = this.transform.matrix.transformPoint(_root.p);
var _local3 = 0;
while (_local3 < n) {
_root.objects.push(new FlyBackGib("rocket_gibs", _root.p.x, _root.p.y, random(360), 6 + (random(400) / 100), 20, random(4) + 6, 12));
_local3++;
}
}
function _otsek_gib(otsek, frame, r) {
_root.p.x = otsek.gib_pos._x;
_root.p.y = otsek.gib_pos._y;
_root.p = otsek.transform.matrix.transformPoint(_root.p);
_root.p = this.transform.matrix.transformPoint(_root.p);
_root.objects.push(new FlyBackGib("rocket_gibs", _root.p.x, _root.p.y, random(360), 8, r, frame, 12));
}
platform1._visible = false;
platform2._visible = false;
platform3._visible = false;
stop();
Symbol 3143 MovieClip Frame 10
_root.push_platform(platform1, 0, _x, _y);
_root.push_platform(platform2, -1, _x, _y);
_root.push_platform(platform3, 0, _x, _y);
Symbol 3143 MovieClip Frame 179
stop();
Symbol 3147 MovieClip Frame 1
_x = 0;
_y = 0;
_xscale = 100;
_yscale = 100;
_root.wind_left = -4;
_root.wind_right = -1;
_root.level_vx = 20;
var rocket_carrier;
var core_boss_killed = false;
stop();
Instance of Symbol 2316 MovieClip "door2" in Symbol 3147 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new Door(this, undefined, this._name, 65, false, false));
}
Instance of Symbol 2999 MovieClip in Symbol 3147 MovieClip Frame 2
onClipEvent (load) {
_x = -500;
var back = new TileXBackground(this, 0.5, 0.5, false);
_root.backgrounds.push(back);
}
Instance of Symbol 3146 MovieClip in Symbol 3147 MovieClip Frame 2
onClipEvent (load) {
_x = -1000;
var back = new TileXBackground(this, 1, 1.5, false);
_root.backgrounds.push(back);
}
Instance of Symbol 3146 MovieClip in Symbol 3147 MovieClip Frame 3
onClipEvent (load) {
_x = -500;
var back = new TileXBackground(this, 0.5, 0.5, false);
_root.backgrounds.push(back);
}
Symbol 3160 MovieClip Frame 1
_visible = false;
stop();
Symbol 3160 MovieClip Frame 2
_visible = true;
Symbol 3160 MovieClip Frame 98
_visible = false;
stop();