Frame 1
stop();
onEnterFrame = function () {
total = _root.getBytesTotal();
loaded = _root.getBytesLoaded();
percent = Math.round((loaded / total) * 100);
if (percent <= 0) {
percent = 0;
}
if (percent >= 100) {
play();
onEnterFrame = 0;
}
loading_bar.gotoAndStop(percent);
};
Frame 2
gotoAndStop (4);
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 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 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++;
}
}
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 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++;
}
}
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) {
score = score + sc;
}
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) {
score = score + _score;
}
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 _local7 = "heal";
if (_local9 > 25) {
_local7 = "heal_med";
}
_root.PushObject(new BonusHeal(x, y, _local7, _local9));
}
if (_content.indexOf("smg") != -1) {
var _local8 = _content.indexOf("smg");
var _local9 = parseInt(_content.substr(_local8 + 3, 2));
var _local6 = new BonusGun(x, y, "bonus_gun", 2, _local9);
_root.PushObject(_local6);
_local6.oldx = _local6.oldx + (random(10) - 5);
_local6.oldy = _local6.oldy + 10;
}
if (_content.indexOf("riffle") != -1) {
var _local8 = _content.indexOf("riffle");
var _local9 = parseInt(_content.substr(_local8 + 6, 2));
var _local6 = new BonusGun(x, y, "bonus_gun", 3, _local9);
_root.PushObject(_local6);
_local6.oldx = _local6.oldx + (random(10) - 5);
_local6.oldy = _local6.oldy + 10;
}
if (_content.indexOf("grenade") != -1) {
var _local8 = _content.indexOf("grenade");
var _local9 = parseInt(_content.substr(_local8 + 7, 2));
var _local6 = new BonusGun(x, y, "bonus_gun", 4, _local9);
_root.PushObject(_local6);
_local6.oldx = _local6.oldx + (random(10) - 5);
_local6.oldy = _local6.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) {
_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) {
var _local2 = _root.level._xscale;
var _local6 = 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 (_local6) {
_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 _local9 = _root.view_x;
var _local7 = _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;
}
}
_root.view_x = _local9;
_root.view_y = _local7;
}
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.score = 0;
_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;
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();
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;
}
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 (_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;
}
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++;
}
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);
}
_local2--;
}
ExcludeObjects();
_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--;
if ((_bonus_info_time <= 0) || (_bonus_info.length > 36)) {
_bonus_info = _bonus_info.substr(1);
}
kill_combo_time--;
if (Key.isDown(27)) {
_root.onEnterFrame = function () {
};
MainMenu();
}
if ((knight.life <= 0) && (knight_spawned)) {
_root.knight_dead_time--;
if ((_root.knight_dead_time % 60) == 0) {
bonus_info("Press Space to try again.");
}
if (Key.isDown(32)) {
_root.lives--;
if (_root.lives >= 0) {
RestartCheckpoint();
_root.knight_dead_time = 60;
} else {
_root.onEnterFrame = function () {
};
MainMenu();
}
}
}
}
function RedirectRestartLevel() {
gotoAndStop(_root.current_level);
_root.onEnterFrame = UpdateGame;
}
function RedirectStartLevel() {
level_finish_state.Restore(false, true);
_root.onEnterFrame = UpdateGame;
}
function GotoLevel(lev) {
_root.current_level = lev;
level_finish_state.Save();
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 NewGame() {
StartGame();
gotoAndStop ("level1");
_root.lives = 3;
}
function Level1() {
StartGame();
gotoAndStop ("level1");
_root.lives = 3;
}
function Level2() {
StartGame();
gotoAndStop ("level2");
_root.lives = 3;
}
function Level3() {
StartGame();
gotoAndStop ("level3");
_root.lives = 3;
}
function TrainFall() {
StartGame();
gotoAndStop ("train_fall");
_root.lives = 3;
}
function Settings() {
gotoAndStop ("menu");
_root._x = -720;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
}
function ChooseLevel() {
gotoAndStop ("menu");
_root._x = -1440;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
}
function SetMedium() {
_quality = "MEDIUM";
rad_medium.gotoAndStop(2);
rad_low.gotoAndStop(1);
}
function SetLow() {
_quality = "LOW";
rad_medium.gotoAndStop(1);
rad_low.gotoAndStop(2);
}
function ToggleSky() {
if (_root.raster_sky) {
_root.raster_sky = false;
rad_sky.gotoAndStop(1);
} else {
_root.raster_sky = true;
rad_sky.gotoAndStop(2);
}
}
function ToggleCables() {
if (_root.cables_enabled) {
_root.cables_enabled = false;
rad_cables.gotoAndStop(1);
} else {
_root.cables_enabled = true;
rad_cables.gotoAndStop(2);
}
}
function Arena1() {
StartGame();
gotoAndStop ("arena1");
_root._xscale = 50;
_root._yscale = 50;
_root.w = 1440;
_root.h = 1080;
_root.ui._xscale = 200;
_root.ui._yscale = 200;
_root.ui.gotoAndStop("hotseat");
}
function Arena2() {
}
function Redirect() {
getURL ("http://vap.mirgames.ru", "_blank");
}
function MainMenu() {
gotoAndStop ("menu");
_root._x = 0;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
btn_new_game.onRelease = NewGame;
btn_back1.onRelease = (btn_back2.onRelease = MainMenu);
btn_settings.onRelease = Settings;
rad_medium.onRelease = SetMedium;
rad_low.onRelease = SetLow;
rad_sky.onRelease = ToggleSky;
rad_cables.onRelease = ToggleCables;
btn_hotseat.onRelease = ChooseLevel;
btn_arena1.t.text = "ice arena";
btn_arena2.t.text = "metal arena";
btn_arena1.onRelease = Arena1;
btn_arena2.onRelease = Arena2;
btn_vapgames.onRelease = Redirect;
btn_level1.t.text = "level 1";
btn_level1.onRelease = Level1;
btn_level2.t.text = "level 2";
btn_level2.onRelease = Level2;
btn_level3.t.text = "level 3";
btn_level3.onRelease = Level3;
btn_train_fall.t.text = "train_fall";
btn_train_fall.onRelease = TrainFall;
if (_quality == "LOW") {
rad_medium.gotoAndStop(1);
rad_low.gotoAndStop(2);
}
if (_quality == "MEDIUM") {
rad_medium.gotoAndStop(2);
rad_low.gotoAndStop(1);
}
if (_root.raster_sky) {
rad_sky.gotoAndStop(2);
} else {
rad_sky.gotoAndStop(1);
}
if (_root.cables_enabled) {
rad_cables.gotoAndStop(2);
} else {
rad_cables.gotoAndStop(1);
}
}
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 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 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 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 raster_sky = true;
var view_scale = 100;
var last_gold;
_root.lives = 3;
_root.lives_text = "x 3";
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");
_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();
gotoAndStop ("menu");
MainMenu();
Instance of Symbol 998 MovieClip in Frame 8
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.2, 0));
}
Instance of Symbol 998 MovieClip in Frame 8
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.4, 0, true));
}
Instance of Symbol 998 MovieClip in Frame 8
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.6, 0, true));
}
Instance of Symbol 998 MovieClip in Frame 10
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.2, 0));
}
Instance of Symbol 998 MovieClip in Frame 10
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.4, 0, true));
}
Instance of Symbol 998 MovieClip in Frame 10
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.6, 0, true));
}
Instance of Symbol 1298 MovieClip in Frame 12
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.1, 0.2, true));
}
Instance of Symbol 1472 MovieClip in Frame 13
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.125, 0));
}
Instance of Symbol 1473 MovieClip in Frame 13
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.5, 0));
}
Instance of Symbol 1479 MovieClip in Frame 13
onClipEvent (load) {
var back = new TileXBackground(this, 1, 1, false);
_root.backgrounds.push(back);
}
Instance of Symbol 1298 MovieClip in Frame 13
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.24, 0.01));
}
Instance of Symbol 1472 MovieClip "_sky" in Frame 16
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.125, 0));
}
Instance of Symbol 1473 MovieClip "_mountains" in Frame 16
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.5, 0));
}
Instance of Symbol 1298 MovieClip "_clouds" in Frame 16
onClipEvent (load) {
_root.backgrounds.push(new TileXBackground(this, 0.24, 0.01));
}
Symbol 1567 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() {
}
}
Symbol 1568 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 1569 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 1570 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);
}
}
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 1571 MovieClip [__Packages.Ragdoll] Frame 0
class Ragdoll extends Obj
{
var objects, sprite, life, x, y, time, jet;
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;
}
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 > 6) && (((_root.hit2.position % _root.hit2.duration) / 2) == 0)) {
_local4 = _local4 - 5;
_local4 = _local4 * 2.5;
_local4 = _root.limit(_local4, 10, 100);
_root.hit2.setVolume(_local4);
_root.hit2.start(0, 1);
if (_local4 > 40) {
_root.bonus_info("SMASH! + " + int(_local4));
_root.add_score(int(_local4));
}
}
_local3 = 11;
while (_local3 < objects.length) {
objects[_local3].Render();
_local3++;
}
x = objects[1].x;
y = objects[1].y;
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();
}
}
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 1572 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 1573 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 1574 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 1575 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 1576 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 1577 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 1578 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 1579 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 1580 MovieClip [__Packages.SlopeUL] Frame 0
class SlopeUL extends Brick
{
var mc, x, y, type, k;
function SlopeUL (_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 _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 1581 MovieClip [__Packages.SlopePlatformUL] Frame 0
class SlopePlatformUL extends Platform
{
var mc, x, y, type, k;
function SlopePlatformUL (_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 _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 1582 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;
}
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 1583 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 1584 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 = 3;
break;
case 4 :
_local3 = 2;
}
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");
}
}
}
Symbol 1585 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;
}
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;
}
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;
}
}
Symbol 1586 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;
}
}
Symbol 1587 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, Damage, view_locked, invincible_time, weapon, _skin, shot, hand1, barx, bary, dir, _ragdoll, oldx, x, oldy, y, aabb, pain, action, landed, view_side, die_x, die_y, UpdatePhysics, collided, Move, hand2, last_command, 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(10);
_root.knight_spawned = true;
hanging = false;
hook = 0;
hang_reloading = 0;
last_state = new PlayerState();
dmg_func = Damage;
view_locked = false;
}
function Invincibility(t) {
invincible_time = t;
Damage = function () {
};
color.setTransform(_root.blue);
}
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;
_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 + 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.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!");
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, 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, 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();
_root.p_bullets.push(new Grenade("grenade", _root.p.x, _root.p.y, dir, 24, 100, 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);
}
function Ragdolling() {
if (!_ragdoll) {
_ragdoll = _root.recent_ragdoll;
}
var _local5 = (-sprite.bod._x) + (_root.w * 0.5);
var _local6 = (-sprite.bod._y) + (_root.h * 0.5);
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);
}
x = sprite.bod._x;
y = sprite.bod._y;
oldx = x;
oldy = y;
aabb.x = x + aabb.dx;
aabb.y = y + aabb.dy;
_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;
return(undefined);
}
if (invincible_time == 0) {
Damage = dmg_func;
color.setTransform(_root.white);
}
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) || (Key.isDown(32))) && (!weapon_switch_pessed)) && (!weapon_switching)) {
shot();
}
View();
pain--;
scarf.SetPos(x, y - 20);
scarf.Update();
_root.ammo = weapons[weapon].ammo;
hang_reloading--;
_root.ui.lifebar.gotoAndStop(Math.ceil(life / 10));
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() {
if (!landed) {
y = y + _root.gravity_y;
UpdatePhysics();
landed = landed_on_crate || (collided == 3);
}
switch (last_command) {
case "sit" :
Move(0, 1);
break;
case "run_right" :
Move(1, 0);
break;
case "run_left" :
Move(1, 0);
break;
}
View();
pain--;
_root.ammo = weapons[weapon].ammo;
_root.ui.lifebar.gotoAndStop(Math.ceil(life / 10));
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 LockControls(_last_command, _stick_to) {
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" :
y = y + 35;
Update = UpdateMovie;
break;
case "lock_view" :
view_locked = true;
break;
}
}
}
Symbol 1588 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;
}
}
Symbol 1589 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 1590 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 1591 MovieClip [__Packages.PlayerState] Frame 0
class PlayerState extends Obj
{
var weapons, saved, life, weapon, x, y, oldx, oldy, _skin;
function PlayerState () {
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;
}
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++;
}
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);
}
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) {
_root.knight.life = life;
} else {
_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);
}
}
Symbol 1592 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 1593 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 1594 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 1595 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 1596 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 1597 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 1598 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)) {
if (_root.CollideKnight(aabb)) {
sprite.gotoAndPlay("die");
_root.HealKnight(ammo);
life = -1;
return(undefined);
}
}
}
}
Symbol 1599 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;
}
}
Symbol 1600 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 1601 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 1602 MovieClip [__Packages.Crate] Frame 0
class Crate extends JointCollide
{
var x, y, oldx, oldy, id, sprite, aabb, mass, collided, life, dm, mdm, 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);
mdm = 0.1 / ((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.score = _root.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;
}
}
Symbol 1603 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 _local5 = 20;
var _local4 = _root.knight.getx() - x;
var _local6 = _root.knight.gety() - y;
var _local3 = 0;
if ((_local6 < -100) || (Math.abs(_local4) > 400)) {
var _local8 = (_root.gravity_y * _root.gravity_y) / 4;
var _local7 = (_local6 * _root.gravity_y) - (_local5 * _local5);
var _local13 = (_local6 * _local6) - (_local4 * _local4);
var _local9 = (_local7 * _local7) - ((4 * _local8) * _local13);
var _local10 = _root.sgn(_local4) * 3.141592;
if (_local9 >= 0) {
var _local12 = Math.sqrt(Math.abs(((-_local7) + Math.sqrt(_local9)) / (_local8 + _local8)));
var _local11 = (_local4 / _local5) / _local12;
if (Math.abs(_local11) < 1) {
_local10 = Math.acos(_local11);
}
}
_local3 = 180 - (-180 + (_local10 * _root.radtodeg));
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);
} else {
_local3 = Target(0.07);
}
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, _local5, 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 1604 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 1605 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 1606 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 1607 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 1608 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;
sprite._visible = false;
}
function Freeze() {
sprite._visible = false;
sprite.stop();
}
function UnFreeze() {
sprite._visible = true;
sprite.play();
}
function Alive() {
return(true);
}
}
Symbol 1609 MovieClip [__Packages.BeamEmitter] Frame 0
class BeamEmitter extends Obj
{
var id, sprite, aabb, x, y, started, key;
function BeamEmitter (__x, __y, _key, _dx, _dy) {
super();
if (_dx == undefined) {
_dx = 0;
}
if (_dy == undefined) {
_dy = 0;
}
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("beam_emitter", "be" + id, id + (_root.depth_band * 5));
sprite._x = __x;
sprite._y = __y;
aabb = new Object();
aabb.w = 20;
aabb.h = 1024;
aabb.x = __x;
aabb.y = __y;
aabb.dx = _dx - 10;
aabb.dy = _dy - 1024;
x = aabb.x;
y = aabb.y;
started = false;
key = _key;
}
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)) {
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 1610 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;
}
}
Symbol 1611 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 1612 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 1613 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 1614 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) {
super(__x, __y);
x = __x;
y = __y;
oldx = x;
oldy = y;
mass = 300000 /* 0x0493E0 */;
id = _root.get_id();
sprite = _root.objects_layer.attachMovie("cargo_ship", "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");
_root.dust(x - 75, y, 20, 10);
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");
_root.dust(x + 100, y, 20, 10);
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) <= 30)) {
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);
_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;
}
}
Symbol 1615 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;
}
}
Symbol 1616 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;
}
}
Symbol 1617 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 1618 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 1619 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);
}
}
Symbol 1620 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 1621 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 1622 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();
} else {
sprite.gotoAndPlay("off");
mc.stop();
}
_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 1623 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;
}
}
Symbol 1624 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.GetDamage(aabb);
if (_local4 > 0) {
x = x + _root.knight.mace_vx;
y = y + _root.knight.mace_vy;
sprite.body.play();
}
_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 1625 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);
}
}
Symbol 1626 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");
}
}
} 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");
}
}
}
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;
}
}
}
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();
}
}
var drill_time = 250;
}
Symbol 1627 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 1628 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();
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);
sprite.beam.gotoAndStop("beam_loop");
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;
}
}
}
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");
}
}
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;
}
if (life <= damage_hp2) {
sprite.gotoAndPlay("cocpit");
damage_hp2 = -10000;
}
if (life <= damage_hp3) {
sprite.gotoAndPlay("grapple");
damage_hp3 = -10000;
}
} 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;
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++;
}
}
Symbol 1629 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;
}
}
Symbol 1630 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;
}
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.GotoLevel("train_fall");
}
_root.SmoothView(view_x, view_y, 0.95, _local9);
}
}
Symbol 1631 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 1632 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 1633 MovieClip [__Packages.StalkerBarrel] Frame 0
class StalkerBarrel extends Obj
{
var x, y, _time, life, steam_reload, key, started, on_stalker_die, 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;
}
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 = new Stalker(x, y - 150, 100);
stalker.AddSpeed(-2, -22, 10);
_root.objects.push(stalker);
stalker.on_die = on_stalker_die;
}
_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;
}
}
Symbol 1634 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);
} 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);
} 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);
}
}
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)));
}
static var reload_time = 60;
var maxlife = 3500;
}
Symbol 1635 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 1636 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 1637 MovieClip [__Packages.FallingTrain] Frame 0
class FallingTrain extends Spawner
{
var objects, x, y, id, sprite, life, n, train_speed, _time, 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);
_time = 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);
}
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))) {
break;
}
loko_destroyed = true;
train_sound.stop();
train_sound.setPan(0);
train_sound.setVolume(100);
sprite.c28.gotoAndPlay("destroyed");
}
_local3 = n;
while (_local3 < objects.length) {
objects[_local3].Update();
_local3++;
}
_local3 = n;
while (_local3 < objects.length) {
objects[_local3].Render();
_local3 = _local3 + 2;
}
_time++;
}
function Alive() {
return(life > -10000);
}
function Freeze() {
if (life > 0) {
return(true);
}
sprite._visible = false;
}
function UnFreeze() {
sprite._visible = true;
}
}
Symbol 1638 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 36 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 55 MovieClip Frame 1
stop();
Symbol 55 MovieClip Frame 2
gotoAndPlay(random(15) + 3);
Symbol 80 MovieClip Frame 12
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 7
gotoAndStop (1);
Symbol 84 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 84 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 84 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 84 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 84 MovieClip Frame 34
stop();
Symbol 87 MovieClip Frame 1
stop();
Symbol 87 MovieClip Frame 7
gotoAndStop (1);
Symbol 87 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 87 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 87 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 87 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 87 MovieClip Frame 34
stop();
Symbol 89 MovieClip [pointer] Frame 1
_visible = false;
Symbol 89 MovieClip [pointer] Frame 2
stop();
Symbol 111 MovieClip Frame 1
stop();
ready = false;
end_shot = false;
_parent.end_glow._visible = false;
Symbol 111 MovieClip Frame 2
end_shot = false;
Symbol 111 MovieClip Frame 24
beam_h._visible = false;
beam._yscale = beam_h._yscale;
Symbol 111 MovieClip Frame 25
ready = true;
_parent.end_glow._visible = true;
beam._yscale = beam_h._yscale;
Symbol 111 MovieClip Frame 26
beam._yscale = beam_h._yscale;
Symbol 111 MovieClip Frame 27
beam._yscale = beam_h._yscale;
Symbol 111 MovieClip Frame 28
beam._yscale = beam_h._yscale;
Symbol 111 MovieClip Frame 69
ready = false;
_parent.end_glow._visible = false;
beam_h._visible = false;
beam._yscale = beam_h._yscale;
Symbol 111 MovieClip Frame 70
beam._yscale = beam_h._yscale;
Symbol 111 MovieClip Frame 71
beam._yscale = beam_h._yscale;
Symbol 111 MovieClip Frame 72
beam._yscale = beam_h._yscale;
Symbol 111 MovieClip Frame 73
beam._yscale = beam_h._yscale;
Symbol 111 MovieClip Frame 109
end_shot = true;
stop();
Symbol 111 MovieClip Frame 110
ready = false;
end_shot = false;
Symbol 111 MovieClip Frame 129
ready = true;
stop();
Symbol 111 MovieClip Frame 130
ready = false;
Symbol 111 MovieClip Frame 150
gotoAndStop ("safe");
end_shot = true;
Symbol 173 MovieClip Frame 1
flame._rotation = random(4) - 2;
Symbol 173 MovieClip Frame 2
flame._rotation = random(4) - 2;
Symbol 180 MovieClip Frame 1
_name = "bod";
Symbol 203 MovieClip Frame 1
stop();
Symbol 224 MovieClip Frame 1
stop();
Symbol 230 MovieClip Frame 174
stop();
Symbol 230 MovieClip Frame 200
gotoAndPlay ("throw_grenade");
Symbol 231 MovieClip Frame 1
stop();
Symbol 272 MovieClip Frame 1
var ready = false;
play();
Symbol 272 MovieClip Frame 20
ready = true;
stop();
Symbol 272 MovieClip Frame 21
ready = false;
Symbol 272 MovieClip Frame 27
gotoAndStop ("pistol_shot");
Symbol 272 MovieClip Frame 28
ready = false;
play();
Symbol 272 MovieClip Frame 52
ready = true;
stop();
Symbol 272 MovieClip Frame 53
ready = false;
Symbol 272 MovieClip Frame 71
gotoAndStop ("riffle_shot");
Symbol 272 MovieClip Frame 72
ready = false;
Symbol 272 MovieClip Frame 93
ready = true;
stop();
Symbol 272 MovieClip Frame 94
ready = false;
Symbol 272 MovieClip Frame 96
gotoAndStop ("smg_shot");
Symbol 272 MovieClip Frame 101
ready = false;
Symbol 272 MovieClip Frame 118
Symbol 272 MovieClip Frame 120
ready = true;
stop();
Symbol 272 MovieClip Frame 121
ready = false;
Symbol 272 MovieClip Frame 151
gotoAndStop ("grenade_shot");
Symbol 272 MovieClip Frame 158
ready = false;
Symbol 272 MovieClip Frame 167
ready = true;
stop();
Symbol 272 MovieClip Frame 177
stop();
Symbol 272 MovieClip Frame 189
gotoAndStop ("mace_shot");
Symbol 274 MovieClip [human] Frame 1
Symbol 274 MovieClip [human] Frame 20
gotoAndPlay (1);
Symbol 274 MovieClip [human] Frame 40
gotoAndPlay (21);
Symbol 274 MovieClip [human] Frame 60
gotoAndPlay (41);
Symbol 274 MovieClip [human] Frame 80
gotoAndPlay (61);
Symbol 274 MovieClip [human] Frame 100
gotoAndPlay (81);
Symbol 274 MovieClip [human] Frame 106
stop();
Symbol 274 MovieClip [human] Frame 112
stop();
Symbol 274 MovieClip [human] Frame 125
gotoAndPlay (41);
Symbol 274 MovieClip [human] Frame 135
stop();
Symbol 274 MovieClip [human] Frame 144
stop();
Symbol 274 MovieClip [human] Frame 149
gotoAndStop (154);
Symbol 274 MovieClip [human] Frame 154
stop();
Symbol 274 MovieClip [human] Frame 155
Symbol 274 MovieClip [human] Frame 160
stop();
Symbol 274 MovieClip [human] Frame 169
gotoAndStop ("sit");
Symbol 274 MovieClip [human] Frame 193
gotoAndPlay ("jetpack_fly");
Symbol 274 MovieClip [human] Frame 205
gotoAndPlay ("stand_gun");
Symbol 274 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.PushObject(rag);
_root.jet_death = false;
stop();
Symbol 274 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.PushObject(rag);
_root.jet_death = false;
stop();
Symbol 274 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 274 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 301 MovieClip [grenade] Frame 1
stop();
Symbol 301 MovieClip [grenade] Frame 2
if (random(100) < 50) {
_xscale = -100;
}
Symbol 301 MovieClip [grenade] Frame 21
stop();
Symbol 311 MovieClip [pistol_bullet] Frame 1
stop();
flame.gotoAndPlay(random(6) + 1);
Symbol 311 MovieClip [pistol_bullet] Frame 5
_yscale = (random(40) + 80);
_xscale = (random(40) + 80);
if (random(100) < 50) {
_yscale = (-_yscale);
}
Symbol 311 MovieClip [pistol_bullet] Frame 9
stop();
Symbol 334 MovieClip [barrel] Frame 1
stop();
Symbol 334 MovieClip [barrel] Frame 2
_root.objects.push(new Gib("saw_gibs", _x, _y - 70, (-90 + random(30)) - 15, 15, 5, 8, 3));
Symbol 334 MovieClip [barrel] Frame 18
stop();
Symbol 342 MovieClip [mine] Frame 9
gotoAndPlay (1);
Symbol 342 MovieClip [mine] Frame 20
gotoAndPlay (11);
Symbol 342 MovieClip [mine] Frame 28
_root.sound("snd_boom");
Symbol 342 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 342 MovieClip [mine] Frame 41
stop();
Symbol 351 MovieClip Frame 1
stop();
Symbol 351 MovieClip Frame 2
Symbol 351 MovieClip Frame 10
gotoAndStop (1);
Symbol 351 MovieClip Frame 23
gotoAndStop (1);
Symbol 355 MovieClip Frame 23
stop();
Symbol 356 MovieClip [rocket_bot] Frame 25
gotoAndPlay (1);
Symbol 356 MovieClip [rocket_bot] Frame 75
gotoAndPlay (26);
Symbol 356 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 356 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 356 MovieClip [rocket_bot] Frame 107
stop();
Symbol 360 MovieClip Frame 1
stop();
Symbol 364 MovieClip [rocket] Frame 19
gotoAndPlay (5);
Symbol 364 MovieClip [rocket] Frame 20
_root.sound("snd_boom");
Symbol 364 MovieClip [rocket] Frame 21
_root.ExplodeKnight(_x, _y, 40, 20, 10);
Symbol 364 MovieClip [rocket] Frame 32
stop();
Symbol 391 MovieClip Frame 1
stop();
Symbol 391 MovieClip Frame 4
stop();
Symbol 391 MovieClip Frame 7
stop();
Symbol 391 MovieClip Frame 10
stop();
Symbol 391 MovieClip Frame 13
stop();
Symbol 391 MovieClip Frame 16
stop();
Symbol 392 MovieClip [saw] Frame 45
gotoAndPlay (35);
Symbol 392 MovieClip [saw] Frame 86
gotoAndPlay (67);
Symbol 392 MovieClip [saw] Frame 89
_root.dust(_x, _y, 3, 8);
Symbol 392 MovieClip [saw] Frame 217
stop();
Symbol 396 MovieClip Frame 42
gotoAndPlay(random(10) + 43);
Symbol 396 MovieClip Frame 70
stop();
Symbol 400 MovieClip Frame 1
stop();
Symbol 402 MovieClip Frame 1
stop();
Symbol 402 MovieClip Frame 8
gotoAndStop (1);
Symbol 402 MovieClip Frame 15
gotoAndStop (1);
Symbol 429 MovieClip [stat_gun] Frame 1
stop();
Symbol 429 MovieClip [stat_gun] Frame 72
stop();
Symbol 429 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 429 MovieClip [stat_gun] Frame 94
stop();
Symbol 429 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 429 MovieClip [stat_gun] Frame 115
stop();
Symbol 429 MovieClip [stat_gun] Frame 122
stop();
Symbol 429 MovieClip [stat_gun] Frame 193
stop();
Symbol 439 MovieClip Frame 25
gotoAndPlay (10);
Symbol 439 MovieClip Frame 26
_root.sound("snd_big_boom");
Symbol 439 MovieClip Frame 39
gotoAndPlay(40 + random(7));
_root.sound("snd_alarm");
Symbol 439 MovieClip Frame 52
Symbol 439 MovieClip Frame 60
gotoAndPlay (40);
Symbol 445 MovieClip [cargo_ship] Frame 8
stop();
Symbol 445 MovieClip [cargo_ship] Frame 20
stop();
Symbol 445 MovieClip [cargo_ship] Frame 32
gotoAndStop ("idle");
Symbol 445 MovieClip [cargo_ship] Frame 63
gotoAndPlay ("burn");
Symbol 445 MovieClip [cargo_ship] Frame 111
stop();
Symbol 456 MovieClip [blood] Frame 1
_xscale = (_xscale + (random(30) - 15));
if (random(100) < 50) {
_yscale = (-_yscale);
}
Symbol 461 MovieClip Frame 46
stop();
Symbol 461 MovieClip Frame 56
stop();
Symbol 464 MovieClip Frame 1
stop();
Symbol 465 MovieClip [bonus_gun] Frame 20
gotoAndPlay (1);
Symbol 465 MovieClip [bonus_gun] Frame 21
Symbol 465 MovieClip [bonus_gun] Frame 34
stop();
Symbol 470 MovieClip [bonus_railgun] Frame 25
gotoAndPlay (15);
Symbol 470 MovieClip [bonus_railgun] Frame 34
stop();
Symbol 490 MovieClip [gold] Frame 1
stop();
Symbol 490 MovieClip [gold] Frame 10
stop();
Symbol 493 MovieClip Frame 15
stop();
Symbol 493 MovieClip Frame 25
stop();
Symbol 513 MovieClip [heal] Frame 20
gotoAndPlay (1);
Symbol 513 MovieClip [heal] Frame 21
_root.knight.color.setTransform(_root.green);
Symbol 513 MovieClip [heal] Frame 34
_root.knight.color.setTransform(_root.white);
stop();
Symbol 516 MovieClip Frame 15
stop();
Symbol 516 MovieClip Frame 25
stop();
Symbol 536 MovieClip [heal_med] Frame 20
gotoAndPlay (1);
Symbol 536 MovieClip [heal_med] Frame 21
_root.knight.color.setTransform(_root.green);
Symbol 536 MovieClip [heal_med] Frame 34
_root.knight.color.setTransform(_root.white);
stop();
Symbol 580 MovieClip Frame 1
stop();
Symbol 583 MovieClip Frame 13
stop();
Symbol 584 MovieClip [fire_bullet] Frame 1
stop();
flame.gotoAndPlay(random(6) + 1);
Symbol 584 MovieClip [fire_bullet] Frame 5
_yscale = (random(40) + 80);
_xscale = (random(40) + 80);
if (random(100) < 50) {
_yscale = (-_yscale);
}
Symbol 584 MovieClip [fire_bullet] Frame 7
_root.dust(_x, _y, 3, 5);
Symbol 584 MovieClip [fire_bullet] Frame 9
stop();
Symbol 585 MovieClip [argon_bullet] Frame 1
stop();
flame.gotoAndPlay(random(6) + 1);
Symbol 585 MovieClip [argon_bullet] Frame 5
_yscale = (random(40) + 80);
_xscale = (random(40) + 80);
if (random(100) < 50) {
_yscale = (-_yscale);
}
Symbol 585 MovieClip [argon_bullet] Frame 9
stop();
Symbol 587 MovieClip Frame 1
stop();
Symbol 587 MovieClip Frame 26
stop();
Symbol 587 MovieClip Frame 41
gotoAndStop (1);
Symbol 587 MovieClip Frame 51
gotoAndStop (1);
Symbol 590 MovieClip Frame 1
stop();
Symbol 590 MovieClip Frame 2
Symbol 590 MovieClip Frame 10
gotoAndStop (1);
Symbol 590 MovieClip Frame 17
gotoAndStop (1);
Symbol 593 MovieClip Frame 2
Symbol 593 MovieClip Frame 10
gotoAndStop (1);
Symbol 594 MovieClip [enemy_bot1] Frame 25
gotoAndPlay (1);
Symbol 594 MovieClip [enemy_bot1] Frame 75
gotoAndPlay (26);
Symbol 594 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 594 MovieClip [enemy_bot1] Frame 81
_root.dust(_x, _y, 5, 15);
Symbol 594 MovieClip [enemy_bot1] Frame 107
stop();
Symbol 610 MovieClip [crate] Frame 1
stop();
Symbol 610 MovieClip [crate] Frame 2
_root.sound("snd_wood_break");
Symbol 610 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 610 MovieClip [crate] Frame 24
stop();
Symbol 617 MovieClip [beam_emitter] Frame 1
_root.push_brick(body, 0, _x, _y, body);
body._visible = false;
Symbol 617 MovieClip [beam_emitter] Frame 2
stop();
Symbol 617 MovieClip [beam_emitter] Frame 66
gotoAndPlay (14);
Symbol 638 MovieClip [jump_pad] Frame 1
gotoAndStop (2);
Symbol 638 MovieClip [jump_pad] Frame 3
_root.sound("snd_jumppad");
Symbol 638 MovieClip [jump_pad] Frame 13
gotoAndStop (2);
Symbol 672 MovieClip Frame 1
this.ready = false;
stop();
Symbol 672 MovieClip Frame 3
this.ready = true;
Symbol 672 MovieClip Frame 4
ready = false;
Symbol 672 MovieClip Frame 6
ready = true;
Symbol 672 MovieClip Frame 7
ready = false;
Symbol 672 MovieClip Frame 8
ready = true;
Symbol 672 MovieClip Frame 9
ready = false;
Symbol 672 MovieClip Frame 11
ready = true;
Symbol 672 MovieClip Frame 12
ready = false;
Symbol 672 MovieClip Frame 14
ready = true;
Symbol 672 MovieClip Frame 15
ready = false;
Symbol 672 MovieClip Frame 17
ready = true;
Symbol 672 MovieClip Frame 18
ready = false;
Symbol 672 MovieClip Frame 20
ready = true;
Symbol 672 MovieClip Frame 21
ready = false;
Symbol 672 MovieClip Frame 22
ready = true;
Symbol 672 MovieClip Frame 23
ready = false;
Symbol 672 MovieClip Frame 25
ready = true;
Symbol 672 MovieClip Frame 26
gotoAndStop (1);
ready = false;
Symbol 672 MovieClip Frame 31
stop();
Symbol 672 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 672 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 672 MovieClip Frame 70
destroyed = true;
stop();
Symbol 679 MovieClip Frame 4
gotoAndPlay (1);
Symbol 679 MovieClip Frame 43
gotoAndPlay (1);
Symbol 695 MovieClip [gunship_cartrige] Frame 1
ready = false;
stop();
Symbol 695 MovieClip [gunship_cartrige] Frame 45
Symbol 695 MovieClip [gunship_cartrige] Frame 51
ready = true;
Symbol 695 MovieClip [gunship_cartrige] Frame 52
ready = false;
Symbol 695 MovieClip [gunship_cartrige] Frame 63
ready = true;
Symbol 695 MovieClip [gunship_cartrige] Frame 64
ready = false;
Symbol 695 MovieClip [gunship_cartrige] Frame 75
ready = true;
Symbol 695 MovieClip [gunship_cartrige] Frame 76
ready = false;
Symbol 695 MovieClip [gunship_cartrige] Frame 87
ready = true;
Symbol 695 MovieClip [gunship_cartrige] Frame 88
ready = false;
Symbol 695 MovieClip [gunship_cartrige] Frame 99
ready = true;
Symbol 695 MovieClip [gunship_cartrige] Frame 100
ready = false;
Symbol 695 MovieClip [gunship_cartrige] Frame 110
ready = true;
Symbol 695 MovieClip [gunship_cartrige] Frame 111
ready = false;
Symbol 695 MovieClip [gunship_cartrige] Frame 116
gotoAndStop (1);
Symbol 695 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 695 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 695 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 695 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 695 MovieClip [gunship_cartrige] Frame 180
destroyed = true;
stop();
Symbol 730 MovieClip [gunship] Frame 1
stop();
Symbol 730 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 730 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 730 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 730 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 730 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 730 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 730 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 730 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 730 MovieClip [gunship] Frame 45
stop();
Symbol 730 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 730 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 730 MovieClip [gunship] Frame 62
stop();
Symbol 730 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 730 MovieClip [gunship] Frame 80
stop();
Symbol 730 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 730 MovieClip [gunship] Frame 96
stop();
Symbol 730 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 730 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 730 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 730 MovieClip [gunship] Frame 117
stop();
Symbol 747 MovieClip Frame 10
stop();
Symbol 747 MovieClip Frame 20
stop();
Symbol 765 MovieClip [fireball] Frame 15
gotoAndPlay (8);
Symbol 765 MovieClip [fireball] Frame 16
_root.sound("snd_zap");
Symbol 765 MovieClip [fireball] Frame 33
stop();
Symbol 781 MovieClip Frame 1
stop();
Symbol 781 MovieClip Frame 25
stop();
Symbol 786 MovieClip Frame 1
stop();
Symbol 786 MovieClip Frame 21
stop();
Symbol 791 MovieClip Frame 1
this._name = "head";
stop();
Symbol 791 MovieClip Frame 20
stop();
Symbol 792 MovieClip Frame 1
stop();
Symbol 792 MovieClip Frame 24
Symbol 792 MovieClip Frame 40
gotoAndStop ("idle");
Symbol 797 MovieClip [stalker] Frame 1
stop();
Symbol 806 MovieClip [train_foregrounds] Frame 41
gotoAndPlay (2);
Symbol 806 MovieClip [train_foregrounds] Frame 91
gotoAndPlay (52);
Symbol 811 MovieClip [steam] Frame 1
if (random(100) < 50) {
_xscale = -100;
}
Symbol 811 MovieClip [steam] Frame 30
stop();
Symbol 811 MovieClip [steam] Frame 45
stop();
Symbol 824 MovieClip [hammer_static] Frame 196
gotoAndPlay (2);
Symbol 827 MovieClip [black_steam] Frame 1
if (random(100) < 50) {
_xscale = -100;
}
Symbol 827 MovieClip [black_steam] Frame 30
stop();
Symbol 827 MovieClip [black_steam] Frame 45
stop();
Symbol 859 MovieClip Frame 1
stop();
Symbol 859 MovieClip Frame 5
_root.dust(_x, _y, 10, 20);
Symbol 859 MovieClip Frame 201
stop();
Symbol 874 MovieClip [stalker_barrel] Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
stop();
Symbol 874 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 874 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 874 MovieClip [stalker_barrel] Frame 95
Symbol 874 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 874 MovieClip [stalker_barrel] Frame 139
stop();
Symbol 884 MovieClip Frame 1
ready = false;
stop();
Symbol 884 MovieClip Frame 109
ready = true;
stop();
Symbol 901 MovieClip Frame 1
stop();
Symbol 903 MovieClip Frame 1
stop();
Symbol 906 MovieClip Frame 1
stop();
Symbol 908 MovieClip Frame 1
stop();
Symbol 912 MovieClip Frame 1
stop();
Symbol 935 MovieClip Frame 1
stop();
Symbol 937 MovieClip Frame 2
_x = 0;
_y = 0;
stop();
Symbol 939 MovieClip Frame 2
_x = 0;
_y = 0;
stop();
Symbol 954 MovieClip Frame 10
stop();
Symbol 975 MovieClip Frame 1
stop();
Symbol 975 MovieClip Frame 39
stop();
Symbol 981 MovieClip Frame 1
stop();
Symbol 981 MovieClip Frame 39
stop();
Symbol 985 MovieClip Frame 1
stop();
Symbol 985 MovieClip Frame 39
stop();
Symbol 990 MovieClip Frame 1
stop();
Symbol 995 MovieClip Frame 1
if (_root.raster_sky) {
_root.backgrounds.push(new Background(this, 0.034, 0));
gotoAndStop (2);
} else {
_root.backgrounds.push(new Background(this, 0.001, 0));
gotoAndStop (1);
}
Symbol 998 MovieClip Frame 1
stop();
Symbol 1003 MovieClip Frame 1
_root.backgrounds.push(new TileXBackground(this, 0.8, 0));
stop();
Symbol 1010 MovieClip Frame 1
_root.push_static_brick(this);
_visible = false;
stop();
Symbol 1014 MovieClip Frame 1
_root.push_brick(this, _root.t_slope_up_right);
_visible = false;
stop();
Symbol 1016 MovieClip Frame 1
_root.push_brick(this, _root.t_slope_up_left);
_visible = false;
stop();
Symbol 1018 MovieClip Frame 1
_root.push_platform(this);
_visible = false;
stop();
Symbol 1021 MovieClip Frame 1
var a = this._name;
this._name = "the_crate";
_root.PushObject(new Crate(_x, _y, "crate", this, 60, a), this);
Symbol 1024 MovieClip Frame 1
_root.PushObject(new Crate(_x, _y, "container", this, 999999), this);
Symbol 1029 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 1039 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 1039 MovieClip Frame 20
stop();
Symbol 1039 MovieClip Frame 40
gotoAndStop (2);
Symbol 1043 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 1046 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 1051 MovieClip Frame 1
stop();
Symbol 1051 MovieClip Frame 2
_root.sound("snd_metal_stress");
Symbol 1051 MovieClip Frame 17
_root.persistent_buf.break_cable.anchor1 = null;
Symbol 1051 MovieClip Frame 44
stop();
Symbol 1066 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 1066 MovieClip Frame 2
stop();
Symbol 1066 MovieClip Frame 65
stop();
Symbol 1066 MovieClip Frame 90
gotoAndStop ("open");
Symbol 1074 MovieClip Frame 1
Symbol 1074 MovieClip Frame 3
_root.View((-_x) + 300, (-_y) + 320);
Symbol 1074 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 1074 MovieClip Frame 98
_root.objects.push(new StunnedPlayer(_x + 20, _y + 100, "eject_rocket", 8, -20, 200));
Symbol 1074 MovieClip Frame 151
stop();
_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;
Symbol 1136 MovieClip Frame 1
_root.PushObject(new AnimSpriteFreezer(this));
gotoAndStop(random(280));
Symbol 1136 MovieClip Frame 301
gotoAndPlay (2);
Symbol 1136 MovieClip Frame 342
gotoAndPlay ("blink");
Symbol 1136 MovieClip Frame 461
gotoAndPlay ("blink2");
Symbol 1136 MovieClip Frame 478
gotoAndPlay(480 + random(30));
Symbol 1136 MovieClip Frame 686
gotoAndPlay(520 + random(40));
Symbol 1142 MovieClip Frame 1
_root.push_platform(platform, 0, _x, _y, area);
this.play();
Symbol 1142 MovieClip Frame 166
gotoAndPlay (2);
Symbol 1149 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 1150 MovieClip Frame 1
_root.PushObject(new BeamEmitter(_x, _y, this._name), this);
Symbol 1157 MovieClip Frame 1
_visible = false;
stop();
Symbol 1157 MovieClip Frame 2
_root.push_brick(_slope, _root.t_slope_up_left, _x, _y, _slope);
_root.push_platform(_brick, 0, _x, _y, _brick);
_visible = true;
_brick._visible = false;
_slope._visible = false;
stop();
Symbol 1164 MovieClip Frame 1
_root.push_platform(platform, 0, _x, _y, area);
area._visible = false;
Symbol 1164 MovieClip Frame 165
stop();
Symbol 1168 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 1170 MovieClip Frame 1
_root.PushObject(new Mine(_x, _y), this);
Symbol 1171 MovieClip Frame 10
stop();
Symbol 1171 MovieClip Frame 20
stop();
Symbol 1185 MovieClip Frame 1
_root.keys[this._name] = false;
_root.PushObject(new Switch(this, _trigger, this._name));
Symbol 1185 MovieClip Frame 11
stop();
Symbol 1185 MovieClip Frame 21
stop();
Symbol 1186 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 1189 MovieClip Frame 2
_visible = false;
stop();
Symbol 1190 MovieClip Frame 5
_root.PushObject(new Gold(_x, _y, _width * 0.5), this);
stop();
Symbol 1191 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 1193 MovieClip Frame 1
_root.PushObject(new Saw(_x, _y), this);
Symbol 1267 MovieClip Frame 2
function Restore() {
_root.checkpoint = cp;
}
var cp = new CheckpointFlag(this, this.func);
_root.PushObject(cp);
_trigger._visible = false;
stop();
Symbol 1267 MovieClip Frame 30
stop();
Symbol 1277 MovieClip Frame 1
_x = 0;
_y = 0;
_xscale = 100;
_yscale = 100;
stop();
Instance of Symbol 1066 MovieClip "door2" in Symbol 1277 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new Door(this, undefined, this._name, 65, false, false));
}
Instance of Symbol 1189 MovieClip "door1_" in Symbol 1277 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 1189 MovieClip in Symbol 1277 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);
_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 1189 MovieClip in Symbol 1277 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 1189 MovieClip in Symbol 1277 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 1189 MovieClip in Symbol 1277 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 1189 MovieClip in Symbol 1277 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);
_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 1189 MovieClip in Symbol 1277 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 cb = _root.cable(_parent.lift_cable._x, _parent.lift_cable._y, _parent.end_lift.platform._x + _parent.end_lift._x, _parent.end_lift.platform._y + _parent.end_lift._y);
cb.SetPos1(_parent.lift_cable._x, _parent.lift_cable._y);
cb.SetPosMC2(_parent.end_lift.platform);
}
Instance of Symbol 1189 MovieClip in Symbol 1277 MovieClip Frame 1
onClipEvent (load) {
function _end_lift(spawner) {
_parent.end_lift.play();
}
_parent.end_lift.stop();
_root.PushObject(new TriggerFunction(this, _end_lift));
}
Instance of Symbol 1189 MovieClip in Symbol 1277 MovieClip Frame 1
onClipEvent (load) {
function _next_level(spawner) {
_root.GotoLevel("level2");
}
_root.PushObject(new TriggerFunction(this, _next_level));
}
Instance of Symbol 1189 MovieClip in Symbol 1277 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerRemove(this, _parent.drop_rocket));
}
Instance of Symbol 1267 MovieClip "checkpoint1" in Symbol 1277 MovieClip Frame 1
onClipEvent (load) {
}
Symbol 1286 MovieClip Frame 1
var p = new PlayerB(_x, _y, "human", 1, 4);
_root.objects.push(p);
p.UnFreeze();
this._visible = false;
Symbol 1289 MovieClip Frame 2
var r = new Object();
r.x = _x;
r.y = _y;
_root.respawners.push(r);
stop();
Symbol 1290 MovieClip Frame 1
_root.knight = new PlayerA(_x, _y, "human", 1, 1);
_root.knight.UnFreeze();
this._visible = false;
Symbol 1291 MovieClip Frame 1
_x = 0;
_y = 0;
_xscale = 100;
_yscale = 100;
Symbol 1295 MovieClip Frame 1
if (_root.raster_sky) {
_root.backgrounds.push(new Background(this, 0.034, 0));
gotoAndStop (2);
} else {
_root.backgrounds.push(new Background(this, 0.001, 0));
gotoAndStop (1);
}
Symbol 1306 MovieClip Frame 1
stop();
Symbol 1306 MovieClip Frame 13
stop();
Symbol 1318 MovieClip Frame 1
_root.push_static_brick(b1, 0, _x, _y);
_root.push_static_brick(b2, 0, _x, _y);
_root.push_static_brick(b3, 0, _x, _y);
_root.push_static_brick(b4, 0, _x, _y);
b1._visible = false;
b2._visible = false;
b3._visible = false;
b4._visible = false;
Symbol 1326 MovieClip Frame 1
_root.push_static_brick(b2, 0, _x, _y);
_root.push_static_brick(b3, 0, _x, _y);
_root.push_static_brick(b4, 0, _x, _y);
b2._visible = false;
b3._visible = false;
b4._visible = false;
Symbol 1329 MovieClip Frame 1
_root.push_static_brick(b1, 0, _x, _y);
_root.push_static_brick(b2, 0, _x, _y);
_root.push_static_brick(b4, 0, _x, _y);
b1._visible = false;
b2._visible = false;
b4._visible = false;
Symbol 1341 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 1349 MovieClip Frame 1
stop();
Symbol 1349 MovieClip Frame 11
gotoAndPlay (1);
Symbol 1349 MovieClip Frame 21
gotoAndPlay (11);
Symbol 1367 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
gotoAndStop (3);
Symbol 1367 MovieClip Frame 22
stop();
Symbol 1367 MovieClip Frame 42
gotoAndStop (2);
Symbol 1369 MovieClip Frame 1
_root.push_platform(this, _root.t_slope_up_left);
_visible = false;
stop();
Symbol 1372 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
gotoAndStop ("close");
Symbol 1372 MovieClip Frame 11
stop();
Symbol 1372 MovieClip Frame 22
stop();
Symbol 1372 MovieClip Frame 23
gotoAndPlay (2);
Symbol 1384 MovieClip Frame 1
_root.push_platform(platform, 0, _x, _y, area);
gotoAndStop ("down");
Symbol 1384 MovieClip Frame 240
gotoAndPlay (2);
Symbol 1389 MovieClip Frame 1
_root.push_platform(platform, 0, _x, _y, area);
nextFrame();
Symbol 1389 MovieClip Frame 440
gotoAndPlay (2);
Symbol 1393 MovieClip Frame 1
_root.push_brick(b1, 0, _x, _y);
b1._visible = false;
gotoAndStop (3);
Symbol 1402 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 1402 MovieClip Frame 4
_root.push_brick(b2, 0, _x, _y);
b2._visible = false;
Instance of Symbol 1189 MovieClip "door1_" in Symbol 1402 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 1189 MovieClip in Symbol 1402 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 1189 MovieClip in Symbol 1402 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 1189 MovieClip in Symbol 1402 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 1189 MovieClip in Symbol 1402 MovieClip Frame 4
onClipEvent (load) {
_x = (_x + _parent._x);
_y = (_y + _parent._y);
_root.PushObject(new TriggerPersistent(this, _parent._parent._start_wind));
}
Symbol 1406 MovieClip Frame 1
_root.push_platform(platform, 0, _x, _y, area);
nextFrame();
Symbol 1406 MovieClip Frame 560
gotoAndPlay (2);
Symbol 1410 MovieClip Frame 1
_root.PushObject(new SwitchStart(this, _trigger, this._name));
Symbol 1410 MovieClip Frame 11
stop();
Symbol 1410 MovieClip Frame 21
stop();
Symbol 1416 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 1420 MovieClip Frame 1
_root.push_brick(this, _root.t_breakable);
stop();
Symbol 1429 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;
gotoAndStop ("close");
Symbol 1429 MovieClip Frame 11
stop();
Symbol 1429 MovieClip Frame 22
stop();
Symbol 1429 MovieClip Frame 23
gotoAndPlay (2);
Symbol 1429 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 1429 MovieClip Frame 151
stop();
Symbol 1433 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 1435 MovieClip Frame 1
var f = parseFloat(this._name);
if (!f) {
f = 20;
}
_root.PushObject(new JumpPad(this, f), this);
Symbol 1438 MovieClip Frame 1
_trigger._visible = false;
gotoAndStop ("off_end");
Symbol 1438 MovieClip Frame 11
stop();
Symbol 1438 MovieClip Frame 21
stop();
Symbol 1441 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 1442 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 1462 MovieClip Frame 1
stop();
Symbol 1462 MovieClip Frame 41
stop();
Symbol 1462 MovieClip Frame 51
stop();
Symbol 1466 MovieClip Frame 1
stop();
Symbol 1466 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 1466 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 1466 MovieClip Frame 54
stop();
Symbol 1466 MovieClip Frame 64
stop();
Symbol 1466 MovieClip Frame 175
_root.GotoLevel("level3");
stop();
Symbol 1469 MovieClip Frame 1
_root.knight = new Hero(_x, _y, "human");
this._visible = false;
gotoAndStop (2);
Symbol 1470 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 1393 MovieClip "vault_door1" in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new Door(this, undefined, this._name, 20, false, false));
}
Instance of Symbol 1367 MovieClip "_vault_door2" in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new Door(this, undefined, this._name, 20, false, false));
}
Instance of Symbol 1367 MovieClip "vault_door3" in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new Door(this, undefined, this._name, 20, false, false));
}
Instance of Symbol 1189 MovieClip in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
}
Instance of Symbol 1189 MovieClip in Symbol 1470 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 1189 MovieClip in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._start_wind));
}
Instance of Symbol 1189 MovieClip in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._stop_wind));
}
Instance of Symbol 1189 MovieClip in Symbol 1470 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 1189 MovieClip in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._stop_wind));
}
Instance of Symbol 1189 MovieClip "door1_" in Symbol 1470 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 1189 MovieClip in Symbol 1470 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 1189 MovieClip in Symbol 1470 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 1189 MovieClip in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._stop_wind));
}
Instance of Symbol 1189 MovieClip in Symbol 1470 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 1189 MovieClip in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._stop_wind));
}
Instance of Symbol 1189 MovieClip in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._start_wind));
}
Instance of Symbol 1189 MovieClip in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._stop_wind));
}
Instance of Symbol 1189 MovieClip in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new TriggerPersistent(this, _parent._start_wind));
}
Instance of Symbol 1189 MovieClip in Symbol 1470 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 1189 MovieClip in Symbol 1470 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 1189 MovieClip "boss_end_trigger" in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
_parent.hor_door4.gotoAndStop("open");
}
Instance of Symbol 1189 MovieClip in Symbol 1470 MovieClip Frame 1
onClipEvent (load) {
function _go_train() {
_parent.vokzal_gate.play();
_parent.train.play();
}
_root.PushObject(new TriggerFunction(this, _go_train));
}
Symbol 1473 MovieClip Frame 1
stop();
Symbol 1479 MovieClip Frame 1
stop();
Symbol 1479 MovieClip Frame 40
gotoAndPlay (1);
Symbol 1482 MovieClip Frame 1
stop();
Symbol 1482 MovieClip Frame 290
stop();
Symbol 1485 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 1485 MovieClip Frame 2
sprite.gotoAndPlay(52);
Symbol 1485 MovieClip Frame 41
gotoAndPlay (2);
Symbol 1485 MovieClip Frame 50
sprite.gotoAndStop("empty");
Symbol 1487 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 1487 MovieClip Frame 41
gotoAndPlay (2);
Symbol 1491 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 1491 MovieClip Frame 41
gotoAndPlay (2);
Symbol 1493 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 1493 MovieClip Frame 41
gotoAndPlay (2);
Symbol 1496 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 1496 MovieClip Frame 41
gotoAndPlay (2);
Symbol 1498 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 1498 MovieClip Frame 41
gotoAndPlay (2);
Symbol 1501 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 1501 MovieClip Frame 2
sprite.gotoAndPlay(2);
Symbol 1501 MovieClip Frame 41
gotoAndPlay (2);
Symbol 1501 MovieClip Frame 50
sprite.gotoAndPlay("empty");
Symbol 1502 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 1502 MovieClip Frame 2
sprite.gotoAndPlay(52);
Symbol 1502 MovieClip Frame 41
gotoAndPlay (2);
Symbol 1502 MovieClip Frame 50
sprite.gotoAndPlay("empty");
Symbol 1504 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 1504 MovieClip Frame 41
gotoAndPlay (2);
Symbol 1507 MovieClip Frame 1
gotoAndPlay(random(_framesloaded) + 1);
Symbol 1507 MovieClip Frame 41
gotoAndPlay (2);
Symbol 1522 MovieClip Frame 1
this._name = "crane";
stop();
Symbol 1522 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));
stop();
Symbol 1523 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
gotoAndPlay(random(_framesloaded) + 1);
Symbol 1523 MovieClip Frame 41
gotoAndPlay (2);
Symbol 1523 MovieClip Frame 50
_visible = true;
Symbol 1527 MovieClip Frame 1
stop();
Symbol 1527 MovieClip Frame 41
stop();
Symbol 1527 MovieClip Frame 51
stop();
Symbol 1528 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
Symbol 1528 MovieClip Frame 16
gotoAndPlay (2);
Symbol 1534 MovieClip Frame 1
function _pick() {
gotoAndStop ("picked");
_root.knight.PickWeapon(4, 10);
}
_root.PushObject(new TriggerFunction(trigger1, _pick, _x, _y));
Symbol 1534 MovieClip Frame 20
gotoAndPlay (2);
Symbol 1535 MovieClip Frame 1
_parent.train_optimisator.PushSprite(this);
Symbol 1535 MovieClip Frame 16
gotoAndPlay (2);
Symbol 1537 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 1541 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 1543 MovieClip Frame 1
_visible = false;
stop();
Symbol 1543 MovieClip Frame 2
stop();
Symbol 1544 MovieClip Frame 2
_root.PushObject(new StalkerBarrel(_x, _y, this._name, _parent.StartMinedRailScene), this);
stop();
Symbol 1546 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 1479 MovieClip in Symbol 1546 MovieClip Frame 1
onClipEvent (load) {
_x = -4096;
var back = new TileXBackground(this, 1, 1, false);
_root.backgrounds.push(back);
}
Instance of Symbol 1066 MovieClip "door2" in Symbol 1546 MovieClip Frame 1
onClipEvent (load) {
_root.PushObject(new Door(this, undefined, this._name, 65, false, false));
}
Instance of Symbol 1189 MovieClip in Symbol 1546 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 1189 MovieClip in Symbol 1546 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 1189 MovieClip in Symbol 1546 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 1189 MovieClip in Symbol 1546 MovieClip Frame 1
onClipEvent (load) {
function _zoom100() {
_root.view_scale = 100;
}
_root.PushObject(new TriggerFunction(this, _zoom100));
}
Instance of Symbol 1189 MovieClip in Symbol 1546 MovieClip Frame 1
onClipEvent (load) {
function _spawn_stalker() {
_root.keys.stalker_barrel = true;
}
_root.PushObject(new TriggerFunction(this, _spawn_stalker));
}
Symbol 1550 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 1550 MovieClip Frame 2
_root.dust(_x + pointer._x, _y + pointer._y, 10, 20);
Symbol 1550 MovieClip Frame 4
_root.dust(_x + pointer._x, _y + pointer._y, 5, 20);
_gibs();
Symbol 1550 MovieClip Frame 8
_root.dust(_x + pointer._x, _y + pointer._y, 5, 20);
_gibs();
Symbol 1550 MovieClip Frame 12
_gibs();
Symbol 1550 MovieClip Frame 14
_gibs();
Symbol 1550 MovieClip Frame 16
_gibs();
Symbol 1550 MovieClip Frame 75
stop();
Symbol 1556 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 1565 MovieClip Frame 1
_root.objects.push(new FallingTrain(_x, _y));
Symbol 1565 MovieClip Frame 2
stop();
Symbol 1566 MovieClip Frame 1
_x = 0;
_y = 0;
_xscale = 100;
_yscale = 100;
_root.wind_left = -4;
_root.wind_right = -1;
_root.level_vx = 0;
stop();