Frame 1
NewgroundsAPI.connectMovie(3117);
NewgroundsAPI.addCustomLink(1, "Madness Day 2008");
NewgroundsAPI.addCustomLink(2, "Madness Day 2007");
NewgroundsAPI.addCustomLink(3, "Madness");
stop();
Frame 3
body.s_titlescreen = new Sound(body);
body.s_titlescreen.attachSound("171975_TitleScreen.wav");
body.s_titlescreen.start(0, 1000);
stop();
Frame 4
function f_PunchSound() {
this["s_punch" + (random(2) + 1)].start(0, 0);
}
function f_MakeZombies() {
for (n in a_EnemiesLog) {
var _local1 = a_EnemiesLog[n];
_local1.body.gotoAndPlay("zombie");
}
}
function f_ShakeY(value) {
if (shake_y < value) {
shake_y = value;
}
}
function f_ShakeX(value) {
if (shake_x < value) {
shake_x = value;
}
}
function f_DamagePlayer(value) {
p1.health = p1.health - value;
if (p1.health <= 0) {
p1.alive = false;
p1.health = 0;
}
health.gotoAndPlay(2);
}
function f_Quality(zone) {
if (Key.isDown(81)) {
if (!zone.active) {
zone.active = true;
zone.timer = 90;
if (zone.i == 1) {
_quality = "low";
zone.i = 2;
zone.gotoAndStop("l");
} else if (zone.i == 2) {
_quality = "high";
zone.i = 3;
zone.gotoAndStop("h");
} else {
zone.i = 1;
_quality = "medium";
zone.gotoAndStop("m");
}
}
} else {
zone.active = false;
}
}
function f_SetForceX(zone, force_x) {
if (zone._xscale > 0) {
zone.force_x = force_x;
} else {
zone.force_x = -force_x;
}
}
function f_HealthBeam(zone) {
if (Math.abs(zone._x - p1.x) < 100) {
if (p1.y < zone._y) {
if (p1.y >= (zone._y - 300)) {
f_Health(p1, 1);
var _local2 = 60 + random(40);
var _local3 = f_FX((zone._x - 70) + random(140), zone._y - 20, zone._y - 5, "pixel_health", _local2, _local2);
_local3.speed_y = -(4 + random(14));
}
}
}
}
function f_GetPlayerClip(zone) {
if (zone._parent._parent.container) {
return(zone._parent);
}
if (zone._parent._parent._parent.container) {
return(zone._parent._parent);
}
if (zone._parent._parent._parent._parent.container) {
return(zone._parent._parent._parent);
}
if (zone._parent._parent._parent._parent._parent.container) {
return(zone._parent._parent._parent._parent);
}
if (zone._parent._parent._parent._parent._parent._parent.container) {
return(zone._parent._parent._parent._parent._parent);
}
if (zone._parent._parent._parent._parent._parent._parent._parent.container) {
return(zone._parent._parent._parent._parent._parent._parent);
}
if (zone._parent._parent._parent._parent._parent._parent._parent._parent.container) {
return(zone._parent._parent._parent._parent._parent._parent._parent);
}
}
function f_SetGun(zone) {
var _local1 = f_GetPlayerClip(zone);
zone.gotoAndStop(_local1.gun_type);
}
function f_SetFace(zone) {
var _local1 = f_GetPlayerClip(zone);
zone.gotoAndStop(_local1.face_type);
}
function f_SetBody(zone) {
var _local1 = f_GetPlayerClip(zone);
zone.gotoAndStop(_local1.body_type);
}
function f_SetHand(zone) {
var _local1 = f_GetPlayerClip(zone);
if (_local1.hasgun) {
zone.gotoAndStop(100);
} else {
zone.gotoAndStop(_local1.body_type);
}
}
function f_SetHead(zone) {
var _local1 = f_GetPlayerClip(zone);
zone.gotoAndStop(_local1.head_type);
}
function f_Gun(zone) {
var _local1 = f_GetPlayerClip(zone);
zone.gotoAndStop(_local1.gun_type);
}
function f_Thruster(zone) {
var _local1 = f_GetPlayerClip(zone);
zone.gotoAndStop(_local1.thruster_type);
}
function f_InRange(zone, x_range, y_range) {
if (Math.abs(zone.x - zone.prey.x) <= x_range) {
if (Math.abs(zone.y - zone.prey.y) <= y_range) {
return(true);
}
}
return(false);
}
function f_EnemiesWait() {
for (n in a_Enemies) {
var _local1 = a_Enemies[n];
_local1.wait = true;
}
}
function f_EnemiesWaitEnd() {
for (n in a_Enemies) {
var _local1 = a_Enemies[n];
_local1.wait = false;
}
}
function f_MakeShockwave(zone, u_size) {
u_point.x = 0;
u_point.y = 0;
zone.localToGlobal(u_point);
f_Shockwave(u_point.x, u_point.y, u_size, 20, 80);
}
function f_DownRes(zone) {
zone.res_timer = int(20 - (((zone.health / zone.health_max) * 100) * 0.2));
}
function f_DashTrail(zone) {
if (zone._xscale > 0) {
var _local3 = zone.x - 50;
} else {
var _local3 = zone.x + 50;
}
var _local2 = zone.y - 30;
if (random(2) == 1) {
var _local4 = 80 + random(20);
} else {
var _local4 = -(80 + random(20));
}
f_FX(_local3, (_local2 - 30) + random(60), zone.y - 1, "dashtrail", 100, _local4);
}
function f_PlayerCrackOut(zone) {
zone.crack_timer--;
if (zone.crack_timer <= 0) {
zone.nojumpanim = false;
zone.dashbreak = false;
zone.gotoAndStop("stand");
return(undefined);
}
f_DashTrail(zone);
if (Key.isDown(zone.b_left)) {
if (zone.left_timer <= 0) {
zone.left_last2 = zone.left_timer;
zone.left_timer = 1;
} else {
zone.left_timer++;
}
} else if (zone.left_timer > 0) {
zone.left_last = zone.left_timer;
zone.left_timer = 0;
} else {
zone.left_timer--;
}
if (Key.isDown(zone.b_right)) {
if (zone.right_timer <= 0) {
zone.right_last2 = zone.right_timer;
zone.right_timer = 1;
} else {
zone.right_timer++;
}
} else if (zone.right_timer > 0) {
zone.right_last = zone.right_timer;
zone.right_timer = 0;
} else {
zone.right_timer--;
}
if ((zone.left_timer > 0) and (zone.left_timer > zone.right_timer)) {
if (zone._xscale > 0) {
f_FlipChar(zone);
}
}
if ((zone.right_timer > 0) and (zone.right_timer > zone.left_timer)) {
if (zone._xscale < 0) {
f_FlipChar(zone);
}
}
f_CheckJump(zone);
if (f_CharJumping(zone)) {
zone.body._rotation = zone.speed_y;
} else {
zone.body._rotation = 0;
}
if (zone._xscale > 0) {
f_MoveH(zone, 30);
} else {
f_MoveH(zone, -30);
}
var _local3 = 1;
while (_local3 <= 4) {
var _local2 = game.game["crate" + _local3];
if (Math.abs(zone.y - _local2.y) < 15) {
if (zone._xscale > 0) {
if ((zone.x < _local2.x) and ((zone.x + 60) > (_local2.x - (_local2._width / 2)))) {
f_CrateExplode(_local2);
}
} else if ((zone.x > _local2.x) and ((zone.x - 60) < (_local2.x + (_local2._width / 2)))) {
f_CrateExplode(_local2);
}
}
_local3++;
}
}
function f_DiagonalSpringboard(zone) {
var _local3 = false;
for (n in a_Enemies) {
var _local2 = a_Enemies[n];
if (_local2.platform) {
if (Math.abs(_local2.x - zone._x) < (zone._width / 2)) {
if (_local2.y <= zone._y) {
if (_local2.y >= (zone._y - zone._height)) {
if (zone._xscale > 0) {
_local3 = true;
if (_local2._xscale < 0) {
_local2._xscale = _local2._xscale * -1;
}
f_ForceJump(_local2, 20, -38);
} else {
if (_local2._xscale > 0) {
_local2._xscale = _local2._xscale * -1;
}
f_ForceJump(_local2, -20, -38);
}
}
}
}
}
}
for (n in a_Players) {
var _local2 = a_Players[n];
if (_local2.platform) {
if (Math.abs(_local2.x - zone._x) < (zone._width / 2)) {
if (_local2.y <= zone._y) {
if (_local2.y >= (zone._y - zone._height)) {
if (zone._xscale > 0) {
_local3 = true;
if (_local2._xscale < 0) {
_local2._xscale = _local2._xscale * -1;
}
f_ForceJump(_local2, 20, -38);
} else {
if (_local2._xscale > 0) {
_local2._xscale = _local2._xscale * -1;
}
f_ForceJump(_local2, -20, -38);
}
}
}
}
}
}
if (_local3) {
s_spring.start(0, 0);
zone.bumper.gotoAndPlay(2);
}
}
function f_BulletImpactSound(zone) {
if (zone.texture == 100) {
return(undefined);
}
current_hit++;
if (current_hit > 3) {
current_hit = 1;
}
if (!zone.texture) {
zone.texture = level_texture;
}
if (zone.texture == 1) {
_root["s_hit_dirt" + current_hit].start(0, 0);
} else if (zone.texture == 2) {
_root["s_hit_metal" + current_hit].start(0, 0);
} else if (zone.texture == 3) {
_root["s_hit_default" + current_hit].start(0, 0);
} else if (zone.texture == 4) {
_root["s_bullethitbody" + (random(2) + 1)].start(0, 0);
}
}
function f_Bullet(zone) {
if (zone.speed_x != 0) {
var _local3 = f_W(zone, zone.speed_x);
if (_local3 != zone.speed_x) {
zone.y = zone.y + zone.speed_y;
zone._y = zone.y;
zone.x = zone.x + zone.speed_x;
zone._x = zone.x;
f_BulletImpactSound(zone.wall_pt);
zone.gotoAndStop("explosion_small");
return(undefined);
}
for (n in a_Slopes) {
var _local4 = a_Slopes[n];
var _local2 = _local4.w;
var _local7 = _local4.h;
var _local6 = _local4.x;
var _local5 = _local4.y;
if (((zone.x + (zone._width / 2)) >= (_local6 - _local2)) and ((zone.x - (zone._width / 2)) <= (_local6 + _local2))) {
if ((zone.y <= _local5) and (zone.y >= (_local5 - _local7))) {
if (_local4.incline) {
var _local11 = 1 - ((zone.y - _local5) / _local7);
var _local12 = _local6 + (_local2 * _local11);
_local11 = (zone.x - (_local6 - _local2)) / (_local2 * 2);
var _local8 = _local5 - (_local7 * _local11);
} else {
var _local11 = 1 - (Math.abs(zone.y - _local5) / _local7);
var _local12 = (_local6 - _local2) + ((_local2 * 2) * _local11);
_local11 = 1 - ((zone.x - (_local6 - _local2)) / (_local2 * 2));
var _local8 = _local5 - (_local7 * _local11);
}
if (zone.y > _local8) {
if (zone.y < (_local8 + (Math.abs(zone.speed_x) * 3))) {
if ((_local4.incline and (zone._xscale > 0)) or ((!_local4.incline) and (zone._xscale < 0))) {
f_BulletImpactSound(_local4);
zone.gotoAndStop("explosion_small");
return(undefined);
}
}
}
}
}
}
zone.x = zone.x + zone.speed_x;
zone._x = zone.x;
}
if (zone.speed_y < 0) {
if (f_BulletWallAbove(zone, zone.speed_y)) {
zone.y = zone.y + zone.speed_y;
zone._y = zone.y;
f_BulletImpactSound(zone.wall_pt);
zone.gotoAndStop("explosion_small");
return(undefined);
}
zone.y = zone.y + zone.speed_y;
zone._y = zone.y;
} else if (zone.speed_y > 0) {
if (f_PY(zone, zone.speed_y, false)) {
f_BulletImpactSound(zone.platform);
zone.gotoAndStop("explosion_small");
return(undefined);
}
zone.y = zone.y + zone.speed_y;
zone._y = zone.y;
}
if (zone.owner.goodguy or zone.hitall) {
for (n in a_Enemies) {
var _local3 = a_Enemies[n];
if (f_ImpactCheck(zone, _local3, zone.x, zone.y, zone.w, zone.h)) {
zone.gotoAndStop("remove");
if (zone.x < _local3.x) {
var _local9 = _local3.x - random(_local3.zone._width / 2);
} else {
var _local9 = _local3.x + random(_local3.zone._width / 2);
}
var _local10 = f_FX(_local9, zone.y, _local3.y + 5, "explosion2_small", 100, 100);
_local10.owner = zone;
f_BulletImpactSound(_local3);
return(undefined);
}
}
}
if (!zone.owner.goodguy) {
for (n in a_Players) {
var _local3 = a_Players[n];
if (f_ImpactCheck(zone, _local3, zone.x, zone.y, zone.w, zone.h)) {
zone.gotoAndStop("remove");
if (zone.x < _local3.x) {
var _local9 = _local3.x - random(_local3.zone._width / 2);
} else {
var _local9 = _local3.x + random(_local3.zone._width / 2);
}
var _local10 = f_FX(_local9, zone.y, _local3.y + 5, "explosion2_small", 100, 100);
_local10.owner = zone;
f_BulletImpactSound(_local3);
return(undefined);
}
}
}
if (((zone.x + game_x) + (zone.w * 2)) < 0) {
if (zone.speed_x < 0) {
zone.gotoAndStop("remove");
}
} else if (((zone.x + game_x) - (zone.w * 2)) > screenWidth) {
if (zone.speed_x > 0) {
zone.gotoAndStop("remove");
}
} else if ((zone.y + game_y) < 0) {
if (zone.speed_y < 0) {
zone.gotoAndStop("remove");
}
} else if (((zone.y + game_y) - zone.h) > screenHeight) {
if (zone.speed_y > 0) {
zone.gotoAndStop("remove");
}
}
}
function f_BulletWallAbove(zone, u_speed) {
var _local4 = false;
for (n in a_Walls) {
var _local2 = a_Walls[n];
pw = _local2.w;
ph = _local2.h;
px = _local2.x;
py = _local2.y;
if (((zone.y - zone.h) + u_speed) <= py) {
if (((zone.y + u_speed) >= (py - ph)) or ((zone.y - zone.h) > py)) {
if ((zone.x - zone.w) < (px + pw)) {
if ((zone.x + zone.w) > (px - pw)) {
zone.wall_pt = _local2;
return(true);
}
}
}
}
}
return(false);
}
function f_ParryBullet(zone) {
zone.owner = p1;
zone.hitall = false;
zone.success = false;
zone.speed_x = zone.speed_x * -1;
zone.speed_y = zone.speed_y * -1;
zone._xscale = zone._xscale * -1;
zone.damage_val = zone.damage_val * 1.5;
}
function f_BodyFallSound() {
_root["s_bodyfall" + (random(5) + 1)].start(0, 0);
}
function f_Shoot(zone) {
u_point.x = 0;
u_point.y = 0;
zone.localToGlobal(u_point);
var _local4 = (u_point.x * u_scale) - game_x;
var _local3 = (u_point.y * u_scale) - game_y;
var _local1 = f_FX(_local4, _local3, _local3, zone._parent.bullet_type, 100, 100);
_local1.fp_Parry = f_ParryBullet;
_local1.x = _local1._x;
_local1.y = _local1._y;
_local1.h = _local1._height;
_local1.y = _local1.y + (_local1.h / 2);
_local1._y = _local1.y;
_local1.damage_val = zone._parent.damage_val;
_local1.w = 10;
_local1.w2 = 2;
_local1.owner = zone._parent;
if (zone._parent.force_y != 0) {
_local1.speed_x = zone._parent.force_x;
_local1.speed_y = zone._parent.force_y;
} else {
_local1.speed_x = zone._parent.force_x * Math.cos(PI * zone._parent._parent._rotation);
_local1.speed_y = zone._parent.force_x * Math.sin(PI * zone._parent._parent._rotation);
}
if (_local1.speed_x < 0) {
_local1._xscale = _local1._xscale * -1;
}
}
function f_EnemyShootSound() {
_root["s_enemy_shoot" + (random(4) + 1)].start(0, 0);
}
function f_EnemyBulletPreset(zone, x, y, speed_x, speed_y, damage_val) {
var _local1 = f_FX(x, y, y + 1, "bullet1", 100, 100);
_local1.x = x;
_local1.y = y;
_local1.h = _local1._height;
_local1.w = 10;
_local1.w2 = 2;
if (damage_val) {
_local1.damage_val = damage_val;
} else {
_local1.damage_val = 1;
}
_local1.hitall = true;
_local1.owner = zone;
_local1.speed_x = speed_x;
_local1.speed_y = speed_y;
_local1.force_x = speed_x / 2;
_local1.force_y = speed_y;
_local1.bullet = true;
if (speed_x < 0) {
_local1._xscale = _local1._xscale * -1;
}
return(_local1);
}
function f_EnemyBullet(zone) {
u_point.x = 0;
u_point.y = 0;
zone.gun.gun.localToGlobal(u_point);
var _local4 = (u_point.x * u_scale) - game_x;
var _local3 = (u_point.y * u_scale) - game_y;
var _local1 = f_FX(_local4, _local3, zone.y - 1, "bullet1", 100, 100);
_local1.x = _local1._x;
_local1.y = _local1._y;
_local1.h = _local1._height;
_local1.w = 10;
_local1.w2 = 2;
_local1.damage_val = zone.damage_val;
_local1.owner = zone;
_local1.speed_y = 0;
_local1.speed_x = 0;
_local1.bullet = true;
_local1.speed_x = 35 * Math.cos(PI * zone.gun.gun._rotation);
_local1.speed_y = 35 * Math.sin(PI * zone.gun.gun._rotation);
_local1.speed_x = _local1.speed_x + ((random(6) - 3) * 0.2);
_local1.speed_y = _local1.speed_y + ((random(6) - 3) * 0.2);
_local1.body._rotation = zone.gun.gun._rotation;
_local1.line._rotation = zone.gun.gun._rotation;
if (zone._xscale < 0) {
_local1._xscale = _local1._xscale * -1;
_local1.speed_x = _local1.speed_x * -1;
}
_local1.force_x = _local1.speed_x / 2;
_local1.force_y = _local1.speed_y;
if (_local1.force_y > -10) {
_local1.force_y = -10;
}
_local1.speed_x = _local1.speed_x * 3;
_local1.speed_y = _local1.speed_y * 3;
_local1.x = _local1.x - _local1.speed_x;
_local1.y = _local1.y - _local1.speed_y;
_local1._x = _local1.x;
_local1._y = _local1.y;
f_Bullet(_local1);
_local1.speed_x = _local1.speed_x / 3;
_local1.speed_y = _local1.speed_y / 3;
f_EnemyShootSound();
}
function f_TestBullet(zone) {
u_point.x = 0;
u_point.y = 0;
zone.gun.gun.localToGlobal(u_point);
var _local4 = (u_point.x * u_scale) - game_x;
var _local3 = (u_point.y * u_scale) - game_y;
var _local1 = f_FX(_local4, _local3, zone.y - 1, "bullet1", 100, 100);
_local1.x = _local1._x;
_local1.y = _local1._y;
_local1.h = _local1._height;
_local1.w = 10;
_local1.w2 = 2;
_local1.damage_val = zone.damage_val;
_local1.owner = zone;
_local1.speed_y = 0;
_local1.speed_x = 0;
_local1.bullet = true;
_local1.speed_x = 35 * Math.cos(PI * zone.gun.gun._rotation);
_local1.speed_y = 35 * Math.sin(PI * zone.gun.gun._rotation);
_local1.speed_x = _local1.speed_x + ((random(6) - 3) * 0.2);
_local1.speed_y = _local1.speed_y + ((random(6) - 3) * 0.2);
_local1.body._rotation = zone.gun.gun._rotation;
_local1.line._rotation = zone.gun.gun._rotation;
if (zone._xscale < 0) {
_local1._xscale = _local1._xscale * -1;
_local1.speed_x = _local1.speed_x * -1;
}
_local1.speed_x = _local1.speed_x * 2;
_local1.speed_y = _local1.speed_y * 2.5;
_local1.x = _local1.x - _local1.speed_x;
_local1.y = _local1.y - _local1.speed_y;
_local1._x = _local1.x;
_local1._y = _local1.y;
f_Bullet(_local1);
_local1.speed_x = _local1.speed_x / 2;
_local1.speed_y = _local1.speed_y / 2.5;
_local1.force_x = _local1.speed_x / 2;
_local1.force_y = _local1.speed_y;
}
function f_Flash() {
game.game.flash._x = p1.x;
game.game.flash._y = p1.y;
game.game.flash.gotoAndPlay(2);
}
function f_SoulRockBreaker() {
rockbreaker = 1;
}
function f_SoulChronicDash() {
chronicdead = true;
chronicdash = 1;
}
function f_GrabSoul(zone) {
if (Math.abs(zone.x - p1.x) < 50) {
if (Math.abs(zone.y - p1.y) < 40) {
zone.fp_Soul();
zone.gotoAndStop("blank");
}
}
}
function f_PickupItem(zone) {
for (n in a_Players) {
var _local2 = a_Players[n];
if (Math.abs(zone.x - _local2.x) < 50) {
if (Math.abs(zone.y - _local2.y) < 40) {
zone.fp_Pickup(_local2, zone);
zone.active = false;
f_ObjectPop(zone, a_Items);
zone.gotoAndStop("blank");
return(undefined);
}
}
}
for (n in a_Enemies) {
var _local2 = a_Enemies[n];
if (_local2.picksup) {
if (Math.abs(zone.x - _local2.x) < 50) {
if (Math.abs(zone.y - _local2.y) < 40) {
zone.fp_Pickup(_local2, zone);
zone.active = false;
f_ObjectPop(zone, a_Items);
zone.gotoAndStop("blank");
return(undefined);
}
}
}
}
}
function f_PickupDefense(u_p, zone) {
u_p.defense++;
_root[zone.tracker] = true;
}
function f_PickupAttack(u_p, zone) {
u_p.attack++;
_root[zone.tracker] = true;
}
function f_PickupHealthMaxUp(u_p, zone) {
u_p.health_max = u_p.health_max + 25;
u_p.health = zone.health_max;
hud.health.bg._xscale = u_p.health_max;
hud.health.outline._xscale = u_p.health_max;
hud.health.edge._x = u_p.health_max;
_root[zone.tracker] = true;
}
function f_PickupManaMaxUp(u_p, zone) {
u_p.mana_max = u_p.mana_max + 25;
u_p.mana = u_p.mana_max;
hud.mana.bg._xscale = u_p.mana_max;
hud.mana.outline._xscale = u_p.mana_max;
hud.mana.edge._x = u_p.mana_max;
_root[zone.tracker] = true;
}
function f_PickupCrack(zone) {
if (zone == chronic) {
zone.phase = 4;
zone.nojumpanim = true;
zone.crack_timer = 360;
zone.prey = p1;
zone.punch_type = 1;
zone.force_x = 40;
zone.force_y = -15;
f_FacePrey(zone);
zone.gotoAndStop("crackout");
} else {
zone.nojumpanim = true;
zone.crack_timer = 120;
zone.dashbreak = true;
zone.punch_type = 1;
zone.force_x = 40;
zone.force_y = -15;
zone.gotoAndStop("crackout");
}
}
function f_OffScreen(zone) {
if (((zone.x + game_x) + (zone.w * 2)) < 0) {
return(true);
}
if (((zone.x + game_x) - (zone.w * 2)) > screenWidth) {
return(true);
}
if ((zone.y + game_y) < 0) {
return(true);
}
if (((zone.y + game_y) - zone.h) > screenHeight) {
return(true);
}
return(false);
}
function f_ColorSwap(zone, u_color) {
CharacterColor = new Color(zone);
CharacterColor.setTransform(u_color);
}
function f_NewColor(u_color) {
u_color.ra = 100;
u_color.ga = 100;
u_color.ba = 100;
u_color.aa = 100;
u_color.rb = 0;
u_color.gb = 0;
u_color.bb = 0;
u_color.ab = 0;
}
function f_FlipChar(u_flipchar) {
u_flipchar._xscale = u_flipchar._xscale * -1;
}
function f_PushChar(zone, new_push_speed, u_p) {
var _local4 = 0;
if (!u_p.inrecursion) {
if (((zone.y - zone.h) + 1) <= u_p.y) {
if ((zone.y - 1) >= (u_p.y - u_p.h)) {
if ((zone.x + zone.w) <= u_p.x) {
if (((zone.x + zone.w) + new_push_speed) > (u_p.x - u_p.w)) {
new_push_speed = int(f_MoveH(u_p, new_push_speed) + _local4);
f_UpdateWall(u_p, u_p.z_wall);
f_MovePlatformH(u_p, new_push_speed);
}
} else if ((zone.x - zone.w) >= u_p.x) {
if (((zone.x - zone.w) + new_push_speed) < (u_p.x + u_p.w)) {
new_push_speed = int(f_MoveH(u_p, new_push_speed) - _local4);
f_UpdateWall(u_p, u_p.z_wall);
f_MovePlatformH(u_p, new_push_speed);
}
}
}
}
}
return(new_push_speed);
}
function f_CheckPush(zone, push_speed) {
var _local1 = push_speed;
for (n in a_Players) {
var _local2 = a_Players[n];
_local1 = f_PushChar(zone, _local1, _local2);
}
for (n in a_Enemies) {
var _local2 = a_Enemies[n];
if (_local2 != zone) {
_local1 = f_PushChar(zone, _local1, _local2);
}
}
return(_local1);
}
function f_CheckEnemiesPush(zone, speed) {
if (zone.pushesenemies) {
if (!zone.dashing) {
if (!zone.tossed) {
for (n in a_EnemiesPush) {
var _local1 = a_EnemiesPush[n];
if (_local1.platform or (!zone.platform)) {
if ((!_local1.onground) and _local1.alive) {
if ((zone.y - zone.h) < _local1.y) {
if (zone.y > (_local1.y - (_local1.h / 2))) {
if ((!_local1.platform) or zone.punching) {
var _local5 = _local1.x;
var _local4 = _local1.x;
} else {
var _local5 = _local1.x - _local1.w;
var _local4 = _local1.x + _local1.w;
}
if ((zone.x < _local5) and ((zone.x + speed) > (_local1.x - _local1.w))) {
if (_local1.platform or zone.punching) {
f_MoveH(_local1, speed);
}
} else if ((zone.x > _local4) and ((zone.x + speed) < (_local1.x + _local1.w))) {
if (_local1.platform or zone.punching) {
f_MoveH(_local1, speed);
}
}
}
}
}
}
}
}
}
}
}
function f_MoveH(zone, speed) {
zone.hitwall = false;
speed = f_W(zone, speed);
f_CheckEnemiesPush(zone, speed);
zone.x = zone.x + speed;
zone._x = zone.x;
if (zone.z_wall) {
f_UpdateWall(zone, zone.z_wall);
}
f_PH(zone, speed);
return(speed);
}
function f_MoveV(zone, speed) {
zone.y = zone.y + speed;
zone._y = zone.y;
if ((!zone.platform) and zone.prevplatformy) {
f_Depth(zone, zone.prevplatformy);
} else {
f_Depth(zone, zone.y);
}
if (zone.z_platform) {
f_MovePlatformV(zone, speed);
}
if (zone.z_wall) {
f_UpdateWall(zone, zone.z_wall);
}
}
function f_DropGun(zone) {
if (zone.hasgun) {
zone.hasgun = false;
zone.prey = p1;
if (zone._xscale > 0) {
var _local5 = -(3 + random(6));
} else {
var _local5 = 3 + random(6);
}
var _local4 = -(8 + random(10));
var _local3 = _root.f_ShrapnelGeneral(zone.x, zone.y - 70, zone.y + 1, _local5, _local4, "gun1");
_local3.bounce_limit = 2;
_local3.gun_type = zone.gun_type;
_local3._xscale = zone._xscale;
_local3.owner = zone;
_local3.fp_ShrapnelEnd = _root.f_ShrapnelExplode;
zone.phase = 1;
zone.gun.gun.gun.gotoAndStop("blank");
zone.gun_type = 100;
}
}
function f_ImpactCheck(zone, u_temp, x, y, w, h) {
if (u_temp.alive and u_temp.active) {
if ((((!u_temp.nohit) and (!u_temp.onground)) and (u_temp.invincible_timer <= 0)) and (u_temp != zone.owner)) {
var _local5 = u_temp._x + u_temp.zone._x;
var _local4 = u_temp._y + u_temp.zone._y;
var _local6 = u_temp.zone._width / 2;
var _local10 = u_temp.zone._height;
if ((y + h) >= (_local4 - _local10)) {
if ((y - h) <= _local4) {
if ((x + w) >= (_local5 - _local6)) {
if ((x - w) <= (_local5 + _local6)) {
if (zone.owner.attribute_poison) {
if (u_temp.poison_timer <= 0) {
u_temp.poison_timer = 30;
} else {
return(false);
}
}
var _local7 = random(40) + 110;
var _local16 = "impact" + (random(2) + 1);
if (zone._parent.fx_pt) {
u_point.x = 0;
u_point.y = 0;
zone._parent.fx_pt.localToGlobal(u_point);
var _local13 = (u_point.x * u_scale) - game_x;
var _local14 = (u_point.y * u_scale) - game_y;
} else {
var _local13 = (x - 10) + random(20);
var _local14 = ((y - (h / 2)) - 5) + random(10);
}
if (zone.y > u_temp.y) {
var _local11 = zone.y + 5;
} else {
var _local11 = u_temp.y + 5;
}
if (u_temp.bloodtype > 0) {
_local7 = random(30) + 70;
var _local3 = f_FX(_local13, u_temp.y, _local11, "blood2", _local7, _local7);
}
_local3.body._y = -60;
_local3.speed_x = 4 + random(6);
if (u_temp._xscale < 0) {
_local3.speed_x = _local3.speed_x * -1;
}
_local3.speed_y = -(1 + random(10));
_local3.gravity = 0.5;
if (zone.owner == p1) {
if (zone.owner.platform == undefined) {
if (zone.ladder == undefined) {
if (zone.speed_y > 0) {
if (zone.owner.speed_y > 1) {
zone.owner.speed_y = 1;
}
}
}
}
} else if (!zone.bullet) {
zone.owner.wait_timer = 30;
}
shake_x = 3;
shake_y = 3;
u_temp.impact_x = x;
u_temp.impact_y = y;
u_temp.hitby = zone;
u_temp.hit_damage_val = zone.damage_val;
u_temp.force_x = u_temp.hitby.force_x;
u_temp.force_y = u_temp.hitby.force_y;
zone.success = true;
u_temp.prev_hit_timer = 2;
u_temp.fp_Hit1(u_temp);
return(zone.success);
}
}
}
}
}
}
return(false);
}
function f_ImpactPoint(zone) {
u_point.x = 0;
u_point.y = 0;
zone.localToGlobal(u_point);
var _local4 = (u_point.x * u_scale) - game_x;
var _local3 = (u_point.y * u_scale) - game_y;
var _local6 = (zone._width / 2) * (zone._parent._xscale / 100);
var _local5 = (zone._height / 2) * (zone._parent._yscale / 100);
zone.owner = zone._parent._parent;
zone.owner.u_hit = false;
zone.force_x = zone.owner.force_x;
zone.force_y = zone.owner.force_y;
zone.noturn = zone.owner.noturn;
zone.damage_val = zone.owner.damage_val;
zone.x = zone.owner.x;
zone.y = zone.owner.y;
if (zone.owner._xscale > 0) {
if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
} else if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
if (zone._parent._parent == p1) {
if (rockbreaker > 0) {
if (zone._parent.fx_pt) {
u_point.x = 0;
u_point.y = 0;
zone._parent.fx_pt.localToGlobal(u_point);
var _local9 = (((u_point.x * u_scale) - game_x) - 10) + random(20);
var _local8 = (((u_point.y * u_scale) - game_y) - 5) + random(10);
} else {
var _local9 = (_local4 - 10) + random(20);
var _local8 = (_local3 - 5) + random(10);
}
var _local7 = random(30) + 80;
f_FX(_local9, _local8, zone.y - 1, "pixelhit", _local7, _local7);
}
}
if (zone.owner.goodguy or zone.owner.hitall) {
for (n in a_Enemies) {
var _local2 = a_Enemies[n];
if (_local2 != zone._parent._parent) {
u_hit = f_ImpactCheck(zone, _local2, _local4, _local3, _local6, _local5);
if (u_hit) {
zone.owner.u_hit = true;
}
}
}
}
if (!zone._parent._parent.goodguy) {
for (n in a_Players) {
var _local2 = a_Players[n];
u_hit = f_ImpactCheck(zone, _local2, _local4, _local3, _local6, _local5);
if (u_hit) {
zone.owner.u_hit = true;
}
}
}
if (zone.owner.u_hit and (zone.owner == p1)) {
f_PunchSound();
if (Math.abs(zone.owner.force_x) > Math.abs(zone.owner.force_y)) {
shake_x = Math.abs(zone.owner.force_x) * 0.5;
shake_y = Math.abs(zone.owner.force_x) * 0.5;
} else {
shake_x = Math.abs(zone.owner.force_y) * 0.5;
shake_y = Math.abs(zone.owner.force_y) * 0.5;
}
f_Slowdown(17, 2);
}
}
function f_Punch(zone) {
if (!zone.midpunch) {
if (Key.isDown(zone.b_punch1)) {
zone.gun.gun.gun.gun.gotoAndStop("shoot");
zone.bullet_timer++;
if ((zone.bullet_timer % 2) == 0) {
current_shot++;
if (current_shot > 4) {
current_shot = 1;
}
_root["s_shot" + current_shot].start(0, 0);
f_TestBullet(zone);
}
if (zone.punched1 == false) {
zone.punched1 = true;
return(undefined);
}
} else {
zone.punched1 = false;
zone.bullet_timer = 1;
zone.gun.gun.gun.gun.gotoAndStop("idle");
}
}
zone.punch1_timer--;
zone.punch2_timer--;
}
function f_ResetRotation(zone) {
zone._rotation = 0;
}
function f_LeftRightTimers(zone) {
if (Key.isDown(zone.b_left)) {
if (zone.left_timer <= 0) {
zone.left_last2 = zone.left_timer;
zone.left_timer = 1;
} else {
zone.left_timer++;
}
} else if (zone.left_timer > 0) {
zone.left_last = zone.left_timer;
zone.left_timer = 0;
} else {
zone.left_timer--;
}
if (Key.isDown(zone.b_right)) {
if (zone.right_timer <= 0) {
zone.right_last2 = zone.right_timer;
zone.right_timer = 1;
} else {
zone.right_timer++;
}
} else if (zone.right_timer > 0) {
zone.right_last = zone.right_timer;
zone.right_timer = 0;
} else {
zone.right_timer--;
}
}
function f_Walk(zone) {
zone.walking = false;
if (zone.wait) {
return(undefined);
}
f_LeftRightTimers(zone);
if ((zone.left_timer > 0) and (zone.left_timer > zone.right_timer)) {
if (zone._xscale > 0) {
f_FlipChar(zone);
zone.dashing = false;
}
if ((zone.punching == false) or (zone.platform == undefined)) {
if ((((zone.left_last < dash_timer) and (zone.left_last2 > (-dash_timer))) and (!zone.punching)) and (chronicdash > 0)) {
zone.left_last = dash_timer + 1;
zone.dashing = true;
}
if ((!zone.platform) and (zone.jump_speed_x != 0)) {
if (zone.jump_speed_x > 0) {
zone.jump_speed_x--;
if (zone.jump_speed_x < 0) {
zone.jump_speed_x = 0;
}
} else if (zone.jump_speed_x < 0) {
zone.jump_speed_x++;
if (zone.jump_speed_x > 0) {
zone.jump_speed_x = 0;
}
}
} else {
if (zone.dashing) {
zone.speed_x = zone.speed_x - 0.5;
if (zone.speed_x > 0) {
zone.speed_x = 0;
}
if (zone.speed_x <= (-zone.speed_x_dash)) {
zone.speed_x = -zone.speed_x_dash;
}
} else {
zone.speed_x = zone.speed_x - 4;
if (zone.speed_x <= (-zone.speed_x_max)) {
zone.speed_x = -zone.speed_x_max;
}
}
if (((zone.x + game_x) + zone.speed_x) > 0) {
f_MoveH(zone, zone.speed_x);
}
}
zone.walking = true;
}
} else if (zone.speed_x < 0) {
zone.speed_x++;
}
if ((zone.right_timer > 0) and (zone.right_timer > zone.left_timer)) {
if (zone._xscale < 0) {
f_FlipChar(zone);
zone.dashing = false;
}
if ((zone.punching == false) or (zone.platform == undefined)) {
if ((((zone.right_last < dash_timer) and (zone.right_last2 > (-dash_timer))) and (!zone.punching)) and (chronicdash > 0)) {
zone.right_last = dash_timer + 1;
zone.dashing = true;
}
if ((!zone.platform) and (zone.jump_speed_x != 0)) {
if (zone.jump_speed_x < 0) {
zone.jump_speed_x++;
}
} else {
if (zone.dashing) {
zone.speed_x = zone.speed_x + 0.5;
if (zone.speed_x < 0) {
zone.speed_x = 0;
}
if (zone.speed_x >= zone.speed_x_dash) {
zone.speed_x = zone.speed_x_dash;
}
} else {
zone.speed_x = zone.speed_x + 4;
if (zone.speed_x >= zone.speed_x_max) {
zone.speed_x = zone.speed_x_max;
}
}
if (((zone.x + game_x) + zone.speed_x) < screenWidth) {
f_MoveH(zone, zone.speed_x);
}
}
zone.walking = true;
}
} else if (zone.speed_x > 0) {
zone.speed_x--;
}
}
function f_ForceJump(zone, speed_x, speed_y) {
if (doublejump > 0) {
zone.jumps = doublejump + 1;
} else {
zone.jumps = 0;
}
zone.platform = undefined;
zone.jumping = true;
zone.speed_y = speed_y;
zone.jump_speed_x = speed_x;
zone.punching = false;
zone.midpunch = false;
zone.crouch = false;
if (!zone.nojumpanim) {
zone.gotoAndStop("jump1");
}
}
function f_SpringBoard(zone) {
for (n in a_Players) {
var _local1 = a_Players[n];
if (_local1.platform == zone.z_platform) {
f_ForceJump(_local1, 0, -70);
}
}
for (n in a_Enemies) {
var _local1 = a_Enemies[n];
if (_local1.platform == zone.z_platform) {
if (_local1.toss_speed_x == 0) {
f_ForceJump(_local1, 0, -70);
} else {
f_TossInit(_local1, _local1.toss_speed_x, -70);
}
}
}
}
function f_CheckJump(zone) {
if (Key.isDown(zone.b_jump)) {
if (zone.pressed_jump == false) {
if (doublejump > 0) {
if ((!zone.platform) and (!zone.ladder)) {
zone.jumps--;
} else {
zone.jumps = doublejump + 1;
}
} else {
zone.jumps = 0;
}
if (((zone.platform != undefined) or (zone.ladder != undefined)) or (zone.jumps > 0)) {
zone.pressed_jump = true;
zone.jumping = true;
if (Key.isDown(zone.b_down) and zone.platform.dropthru) {
f_FX(zone.x, zone.y, zone.y + 21, "dustpuff", 100, 100);
zone.speed_y = 1;
zone.y = zone.y + 20;
zone._y = zone.y;
f_Depth(zone, zone.y);
} else if (zone.speed_y > zone.launch) {
zone.speed_y = zone.launch;
}
zone.punching = false;
zone.midpunch = false;
zone.crouch = false;
zone.jump_speed_x = 0;
if (!zone.nojumpanim) {
if ((!zone.platform) and (!zone.ladder)) {
s_swing1.start(0, 0);
zone.gotoAndStop("jump1_mid");
zone.body.gotoAndPlay(1);
} else {
s_swing6.start(0, 0);
if (zone._xscale > 0) {
var _local2 = 100;
} else {
var _local2 = -100;
}
if (zone.speed_y < 0) {
if (Key.isDown(zone.b_left) or Key.isDown(zone.b_right)) {
f_FX(zone.x, zone.y, zone.y + 1, "jumpdust", _local2, 100);
} else {
f_FX(zone.x, zone.y, zone.y + 1, "jumpdust2", _local2, 100);
}
}
zone.gotoAndStop("jump1");
}
}
zone.platform = undefined;
zone.ladder = undefined;
}
}
} else {
zone.pressed_jump = false;
}
}
function f_WallHang(zone) {
if (Key.isDown(zone.b_jump)) {
if (zone.pressed_jump == false) {
zone.pressed_jump = true;
var _local2 = Math.abs(zone.launch) / 2;
if (zone._xscale < 0) {
_local2 = _local2 * -1;
}
zone.jumping = true;
if (Key.isDown(zone.b_down)) {
zone.speed_y = 1;
} else {
zone.speed_y = zone.launch;
}
zone.punching = false;
zone.midpunch = false;
zone.crouch = false;
zone.jump_speed_x = 0;
if (!zone.nojumpanim) {
zone.gotoAndStop("jump1");
if ((!zone.platform) and (!zone.ladder)) {
zone.body.gotoAndPlay("loop");
}
}
zone.platform = undefined;
zone.ladder = undefined;
}
} else {
zone.pressed_jump = false;
}
}
function f_EndJump(zone) {
f_GoFrame(zone, "stand");
}
function f_EndPunch(zone) {
zone.punching = false;
zone.midpunch = false;
zone.dashing = false;
zone.onground = false;
zone.jump_speed_x = 0;
if (zone.prev_hit_timer <= 0) {
if (zone.crouch) {
zone.gotoAndStop("crouch");
zone.body.gotoAndPlay("loop");
} else {
zone.gotoAndStop("stand");
}
}
}
function f_GoFrame(zone, u_frame) {
if (!zone.punching) {
zone.gotoAndStop(u_frame);
}
}
function f_MPRange(zone) {
zone.limit_left = zone._x;
zone.limit_right = (zone._x + zone.range._width) - zone.z_platform._width;
zone.total_range = zone.limit_right - zone.limit_left;
zone.speed_x_max = 15;
zone._x = zone._x + ((zone.total_range / 2) - (zone.z_platform._width / 2));
zone.x = zone._x;
}
function f_MovePlatformH(zone, u_speed) {
if (zone.z_platform != undefined) {
var _local5 = zone.z_platform.x;
f_UpdatePlatform(zone, zone.z_platform);
var _local4 = zone.z_platform.x - _local5;
for (n in a_Players) {
var _local2 = a_Players[n];
if (_local2.platform == zone.z_platform) {
f_MoveH(_local2, _local4);
}
}
for (n in a_Enemies) {
var _local1 = a_Enemies[n];
if (_local1.platform == zone.z_platform) {
f_MovePlatformH(_local1, f_MoveH(_local1, _local4));
}
}
}
}
function f_MovePlatformV(zone, u_speed) {
f_UpdatePlatform(zone, zone.z_platform);
if (zone.z_platform != undefined) {
for (n in a_Players) {
var _local1 = a_Players[n];
if (_local1.platform == zone.z_platform) {
if (u_speed < 20) {
f_MoveV(_local1, u_speed);
} else {
_local1.platform = undefined;
}
} else if (u_speed < 0) {
var _local6 = zone.z_platform.x;
var _local5 = zone.z_platform.y;
var _local7 = zone.z_platform.w;
var _local8 = zone.z_platform.h;
if (((_local1.x + _local1.w2) > (_local6 - _local7)) and ((_local1.x - _local1.w2) < (_local6 + _local7))) {
if ((_local1.y <= (_local5 - u_speed)) and (_local1.y >= (_local5 - _local8))) {
f_AssignPlatform(_local1, zone.z_platform);
_local1.speed_y = 0;
_local1.y = zone.z_platform.y;
_local1._y = _local1.y;
f_Depth(_local1, _local1.y);
_local1.prevplatformx = _local1.x;
_local1.prevplatformy = _local1.y;
}
}
}
}
for (n in a_Enemies) {
var _local4 = a_Enemies[n];
if (_local4.platform == zone.z_platform) {
if (u_speed < 5) {
f_MoveV(_local4, u_speed);
} else {
_local4.platform = undefined;
}
}
}
}
}
function f_MovingPlatform(zone) {
var _local2 = 0.75 - Math.abs(((zone.x - zone.limit_left) / zone.total_range) - 0.5);
zone.speed_x = zone.speed_x_max * _local2;
zone.x = zone.x + zone.speed_x;
zone._x = zone.x;
f_MovePlatformH(zone, zone.speed_x);
if (zone.x >= zone.limit_right) {
if (zone.speed_x_max > 0) {
zone.speed_x_max = zone.speed_x_max * -1;
}
} else if (zone.x <= zone.limit_left) {
if (zone.speed_x_max < 0) {
zone.speed_x_max = zone.speed_x_max * -1;
}
}
}
function f_WallAbove(zone, u_speed) {
var _local5 = false;
for (n in a_Walls) {
var _local2 = a_Walls[n];
if (zone != _local2._parent) {
if (zone.passwall and _local2._parent.enemypass) {
} else {
pw = _local2.w;
ph = _local2.h;
px = _local2.x;
py = _local2.y;
if (((zone.y - zone.h) + u_speed) <= py) {
if (((zone.y + u_speed) >= (py - ph)) or ((zone.y - zone.h) > py)) {
if ((zone.x - zone.w) < (px + pw)) {
if ((zone.x + zone.w) > (px - pw)) {
if (((zone.y - zone.h) <= py) and (zone.y > (py - ph))) {
if (zone.pushes and _local2.pushes) {
f_MoveV(_local2._parent, ((zone.y - zone.h) + u_speed) - _local2._parent.y);
} else if (((zone.y < py) and _local2._parent.z_platform) or (u_speed >= 0)) {
var _local4 = _local2._parent.z_platform.y - zone.y;
zone.platform = _local2._parent.z_platform;
f_MoveV(zone, _local4);
u_speed = 0;
} else {
var _local4 = ((py + zone.h) + 1) - zone.y;
if (f_PY(zone, _local4) == false) {
f_MoveV(zone, _local4);
}
}
}
zone.speed_y = 1;
zone.jumping = false;
_local5 = true;
}
}
}
}
}
}
}
return(_local5);
}
function f_WallBelow(zone) {
for (n in a_Walls) {
var _local2 = a_Walls[n];
if (zone != _local2._parent) {
if (zone.passwall and _local2._parent.enemypass) {
} else {
pw = _local2.w;
ph = _local2.h;
px = _local2.x;
py = _local2.y;
if (((zone.y - zone.h) + zone.speed_y) < (py - 1)) {
if ((zone.y + zone.speed_y) > ((py - ph) + 1)) {
if ((zone.x - zone.w) < ((px + pw) - 1)) {
if ((zone.x + zone.w) > ((px - pw) + 1)) {
if (zone.x > px) {
if (Math.abs(zone.x - ((px + pw) + zone.w)) < 50) {
zone.x = (px + pw) + zone.w;
zone._x = zone.x;
}
} else if (Math.abs(zone.x - ((px - pw) - zone.w)) < 50) {
zone.x = (px - pw) - zone.w;
zone._x = zone.x;
}
}
}
}
}
}
}
}
}
function f_MoveDust(u_object, rside) {
if (u_object.dust_timer <= 0) {
if (u_object.platform.slope == 0) {
if (rside) {
f_FX(u_object.x - (u_object.w / 2), u_object.y, u_object.y, "dust1", -100, 100);
} else {
f_FX(u_object.x + (u_object.w / 2), u_object.y, u_object.y, "dust1", 100, 100);
}
u_object.dust_timer = 10;
}
} else {
u_object.dust_timer--;
}
}
function f_W(zone, speed) {
var _local7 = speed;
var _local5 = speed;
zone.wall_pt = undefined;
for (n in a_Walls) {
var _local2 = a_Walls[n];
if (zone != _local2._parent) {
if (zone.passwall and _local2._parent.enemypass) {
} else {
var _local4 = _local2.w;
var _local10 = _local2.h;
var _local3 = _local2.x;
var _local9 = _local2.y;
if ((zone.y - zone.h) < (_local9 - 1)) {
if (zone.y >= ((_local9 - _local10) + 1)) {
if ((zone.x + zone.w) <= (_local3 + _local4)) {
if (((zone.x + zone.w) + speed) >= (_local3 - _local4)) {
if (_local2.pushes and (speed > 0)) {
if (((zone.platform != undefined) and (!zone.inrecursion)) and (!u_wall._parent.inrecursion)) {
zone.inrecursion = true;
var _local8 = (_local3 - _local4) - (zone.x + zone.w);
if (_local2._parent.weight > zone.weight) {
var _local11 = _local2._parent.weight / zone.weight;
} else {
var _local11 = 1;
}
_local5 = _local8 + int(f_MoveH(_local2._parent, (speed - _local8) / _local11));
f_UpdateWall(_local2._parent, _local2);
f_MovePlatformH(_local2._parent, _local5);
if (_local7 != 0) {
f_MoveDust(_local2._parent, true);
}
} else {
_local5 = int((_local3 - _local4) - (zone.x + zone.w));
}
} else if (speed > 0) {
zone.wall_pt = _local2;
_local5 = int((_local3 - _local4) - (zone.x + zone.w));
}
}
} else if ((zone.x - zone.w) >= (_local3 - _local4)) {
if (((zone.x - zone.w) + speed) <= (_local3 + _local4)) {
if (_local2.pushes and (speed < 0)) {
if (((zone.platform != undefined) and (!zone.inrecursion)) and (!u_wall._parent.inrecursion)) {
zone.inrecursion = true;
var _local8 = (_local3 + _local4) - (zone.x - zone.w);
if (_local2._parent.weight > zone.weight) {
var _local11 = _local2._parent.weight / zone.weight;
} else {
var _local11 = 1;
}
_local5 = _local8 + int(f_MoveH(_local2._parent, (speed - _local8) / _local11));
f_UpdateWall(_local2._parent, _local2);
f_MovePlatformH(_local2._parent, _local5);
if (_local7 != 0) {
f_MoveDust(_local2._parent, false);
}
} else {
_local5 = int((_local3 + _local4) - (zone.x - zone.w));
}
} else if (speed < 0) {
zone.wall_pt = _local2;
_local5 = int((_local3 + _local4) - (zone.x - zone.w));
}
}
} else if (((zone.x + zone.w) > (_local3 - _local4)) and ((zone.x - zone.w) < (_local3 + _local4))) {
trace("Error in f_W - Got Inside Box");
}
}
}
}
}
if (speed < 0) {
if (_local5 > _local7) {
_local7 = _local5;
}
} else if (_local5 < _local7) {
_local7 = _local5;
}
}
zone.inrecursion = false;
if (zone.pushes) {
_local7 = f_CheckPush(zone, _local7);
}
if (_local7 != speed) {
zone.hitwall = true;
}
if (Math.abs(_local7 - speed) > 40) {
_local7 = 0;
}
return(_local7);
}
function f_AssignPlatform(zone, u_p) {
zone.platform = u_p;
}
function f_PY(zone, speed, u_pass) {
r = false;
if (speed > 0) {
for (n in a_Platforms) {
var _local2 = a_Platforms[n];
if (u_pass and (!_local2.nopass)) {
} else if (zone.bullet and _local2.dropthru) {
} else {
var _local3 = _local2.w;
var _local6 = _local2.h;
var _local4 = _local2.x;
var _local5 = _local2.y;
if (((zone.x + zone.w2) > (_local4 - _local3)) and ((zone.x - zone.w2) < (_local4 + _local3))) {
if ((zone.y <= _local5) and ((zone.y + speed) >= (_local5 - _local6))) {
if (_local2.diagonal) {
if ((zone.x > (_local4 - _local3)) and (zone.x < (_local4 + _local3))) {
if (_local2.incline) {
var _local8 = (zone.x - (_local4 - _local3)) / (_local3 * 2);
var _local7 = _local5 - (_local6 * _local8);
zone.platform_percent = _local8;
} else {
var _local8 = 1 - ((zone.x - (_local4 - _local3)) / (_local3 * 2));
var _local7 = _local5 - (_local6 * _local8);
zone.platform_percent = _local8;
}
if ((zone.y <= (_local7 + 5)) and ((zone.y + speed) >= (_local7 - 5))) {
f_AssignPlatform(zone, _local2);
zone.speed_y = 0;
f_MoveV(zone, _local7 - zone.y);
zone.prevplatformx = zone.x;
zone.prevplatformy = _local7;
if (zone == p1) {
if (zone._xscale > 0) {
zone.body._rotation = zone.platform.slope;
} else {
zone.body._rotation = -zone.platform.slope;
}
}
return(true);
}
}
} else {
f_AssignPlatform(zone, _local2);
if (zone.bullet) {
zone.y = zone.y + zone.speed_y;
zone._y = zone.y;
zone.speed_y = 0;
} else {
f_MoveV(zone, (_local5 - _local6) - zone.y);
zone.speed_y = 0;
zone.prevplatformx = zone.x;
zone.prevplatformy = zone.y;
if (_local2.springboard) {
s_spring.start(0, 0);
_local2._parent.bumper.gotoAndPlay(2);
if (zone == p1) {
f_ForceJump(zone, 0, -70);
} else if (zone.toss_speed_x == 0) {
f_ForceJump(zone, 0, -70);
} else {
f_TossInit(zone, zone.toss_speed_x, -70);
}
}
}
return(true);
}
}
}
}
}
}
if (r == false) {
f_WallBelow(zone);
}
return(r);
}
function f_PH(zone, u_speed) {
if (zone.platform != undefined) {
var _local3 = zone.platform;
var _local2 = _local3.w;
var _local5 = _local3.x;
var _local4 = _local3.y;
if (((zone.x + zone.w2) < (_local5 - _local2)) or ((zone.x - zone.w2) > (_local5 + _local2))) {
zone.platform = undefined;
zone.speed_y = 1;
if (zone.jumping == false) {
zone.speed_y = 40;
zone.y = zone.y - 20;
zone._y = zone.y;
if (!f_PY(zone, zone.speed_y)) {
zone.y = zone.y + 20;
zone._y = zone.y;
}
}
zone.speed_y = 1;
} else if (_local3.diagonal) {
if (zone.y <= _local4) {
var _local6 = _local3.h;
if (_local3.incline) {
var _local9 = (zone.x - (_local5 - _local2)) / (_local2 * 2);
var _local8 = _local4 - (_local6 * _local9);
zone.platform_percent = _local9;
} else {
var _local9 = 1 - ((zone.x - (_local5 - _local2)) / (_local2 * 2));
var _local8 = _local4 - (_local6 * _local9);
zone.platform_percent = _local9;
}
if (_local8 >= (_local4 - _local6)) {
zone.y = _local8;
zone._y = zone.y;
f_Depth(zone, zone.y);
} else {
zone.platform = undefined;
zone.speed_y = 10;
if (zone.jumping == false) {
f_PY(zone, zone.speed_y);
}
zone.speed_y = 1;
}
} else {
zone.platform = undefined;
zone.speed_y = 10;
if (zone.jumping == false) {
f_PY(zone, zone.speed_y);
}
zone.speed_y = 1;
}
}
if (!zone.platform) {
if (doublejump > 0) {
zone.jumps = doublejump + 2;
} else {
zone.jumps = 0;
}
}
} else {
for (n in a_Slopes) {
var _local3 = a_Slopes[n];
var _local2 = _local3.w;
var _local6 = _local3.h;
var _local5 = _local3.x;
var _local4 = _local3.y;
if (((zone.x + zone.w2) >= (_local5 - _local2)) and ((zone.x - zone.w2) <= (_local5 + _local2))) {
if ((zone.y <= _local4) and (zone.y >= (_local4 - _local6))) {
if (_local3.incline) {
var _local9 = 1 - ((zone.y - _local4) / _local6);
var _local7 = _local5 + (_local2 * _local9);
_local9 = (zone.x - (_local5 - _local2)) / (_local2 * 2);
var _local8 = _local4 - (_local6 * _local9);
} else {
var _local9 = 1 - (Math.abs(zone.y - _local4) / _local6);
var _local7 = (_local5 - _local2) + ((_local2 * 2) * _local9);
_local9 = 1 - ((zone.x - (_local5 - _local2)) / (_local2 * 2));
var _local8 = _local4 - (_local6 * _local9);
}
if (zone.y > _local8) {
if (zone.y < (_local8 + (Math.abs(u_speed) * 3))) {
if ((_local3.incline and (zone._xscale > 0)) or ((!_local3.incline) and (zone._xscale < 0))) {
f_MoveV(zone, _local8 - zone.y);
}
}
}
if ((((zone.x - u_speed) <= _local7) and (zone.x >= _local7)) or (((zone.x - u_speed) >= _local7) and (zone.x <= _local7))) {
zone.x = _local7;
zone._x = zone.x;
r = true;
}
}
}
}
}
}
function f_GetSlope(zone) {
var _local2 = Math.atan2(zone._parent._height, zone._parent._width) * 57.2957795130823;
if (zone.incline) {
zone.slope = -_local2;
} else {
zone.slope = _local2;
}
if (Math.abs(zone.slope) != 0) {
f_ObjectPush(zone, a_Slopes);
}
}
function f_PullUp(zone, speed) {
r = false;
for (n in a_Platforms) {
var _local2 = a_Platforms[n];
var _local6 = _local2.w;
var _local3 = _local2.h;
var _local5 = _local2.x;
var _local4 = _local2.y;
if (((zone.x + zone.w2) > (_local5 - _local6)) and ((zone.x - zone.w2) < (_local5 + _local6))) {
if (((zone.y - zone.h) >= (_local4 - _local3)) and (((zone.y - zone.h) + speed) <= (_local4 - _local3))) {
f_AssignPlatform(zone, _local2);
zone.speed_y = 0;
zone.y = _local4 - _local3;
zone._y = zone.y;
f_Depth(zone, zone.y);
r = true;
return(r);
}
}
}
return(r);
}
function f_Ladder(zone) {
var _local4 = 0;
var _local6 = false;
if (Key.isDown(zone.b_down)) {
if (zone.platform) {
if (!zone.crouch) {
zone.crouch_timer = 0;
}
zone.crouch_timer++;
_local4 = zone.speed_ladder;
_local6 = true;
}
} else {
if (zone.crouch) {
zone.crouch = false;
}
if (Key.isDown(zone.b_up)) {
_local4 = (-zone.speed_ladder) * 2;
_local6 = true;
}
}
if (_local6) {
if (zone.platform.elevator) {
if (_local4 > 0) {
zone.crouch = false;
_local4 = zone.platform.speed_y;
} else {
_local4 = -zone.platform.speed_y;
}
if ((zone.platform._parent.y + _local4) > zone.platform._parent.limit_bottom) {
_local4 = zone.platform._parent.limit_bottom - zone.platform._parent.y;
if (shake_y == 0) {
shake_y = 5;
}
} else if ((zone.platform._parent.y + _local4) < zone.platform._parent.limit_top) {
_local4 = zone.platform._parent.limit_top - zone.platform._parent.y;
if (shake_y == 0) {
shake_y = 5;
}
}
if (shake_x == 0) {
shake_x = 3;
}
f_MoveV(zone.platform._parent, _local4);
} else {
var _local5 = 1;
while (_local5 <= total_ladders) {
var _local3 = _root["ladder" + _local5];
pw = _local3.w;
ph = _local3.h;
px = _local3.x;
py = _local3.y;
if ((zone.y + _local4) <= py) {
if ((zone.y + _local4) >= (py - ph)) {
if (zone.x >= (px - pw)) {
if (zone.x <= (px + pw)) {
zone.ladder = _local3;
zone.platform = undefined;
zone.speed_x = 0;
zone.speed_y = 0;
zone.crouch = false;
if (_local4 > 0) {
zone.y = zone.y + 75;
zone._y = zone.y;
f_Depth(zone, zone.y);
}
if (_local4 > 0) {
zone.gotoAndStop("ladderdown");
} else {
zone.gotoAndStop("ladderup");
}
}
}
}
}
_local5++;
}
}
}
if (zone.crouch) {
zone.gotoAndStop("crouch");
}
}
function f_CheckLadder(zone) {
var _local2 = zone.ladder;
var _local6 = _local2.w;
var _local7 = _local2.h;
var _local5 = _local2.x;
var _local3 = _local2.y;
if (zone.punching == false) {
if (Key.isDown(zone.b_up)) {
f_MoveV(zone, -zone.speed_ladder);
if (f_PullUp(zone, -zone.speed_ladder)) {
zone.ladder = undefined;
zone.paused = true;
zone.gotoAndStop("laddertop");
} else {
zone.gotoAndStop("ladderup");
zone.body.play();
}
} else {
if (Key.isDown(zone.b_down)) {
if (f_PY(zone, zone.speed_ladder, true) == false) {
f_MoveV(zone, zone.speed_ladder);
zone.gotoAndStop("ladderdown");
zone.body.play();
// unexpected jump
}
zone.ladder = undefined;
return(undefined);
}
zone.gotoAndStop("ladderup");
zone.body.stop();
}
}
var _local4 = false;
if (zone.y <= _local3) {
if (zone.y >= (_local3 - _local7)) {
if (zone.x >= (_local5 - _local6)) {
if (zone.x <= (_local5 + _local6)) {
_local4 = true;
}
}
}
}
if (_local4 == false) {
zone.ladder = undefined;
f_Ladder(zone);
}
}
function f_GeneralTimers(zone) {
if (zone.smoke_timer > 0) {
zone.smoke_timer--;
if ((zone.smoke_timer % 2) == 0) {
var _local3 = 90 + random(50);
f_FX((zone.x - 50) + random(100), zone.y - random(100), int((zone.y - 5) + random(10)), "dustpuff", _local3, _local3);
}
}
if (zone.poison_timer > 0) {
zone.poison_timer--;
if ((zone.poison_timer % 3) == 0) {
var _local3 = 70 + random(30);
f_FX(zone.x, zone.y - random(zone.h), zone.y + 1, "poison_puff", _local3, _local3);
}
}
if (zone.prev_hit_timer > 0) {
zone.prev_hit_timer--;
}
if (zone.invincible_timer > 0) {
zone.invincible_timer--;
}
if (zone.hit_timer < 1000) {
zone.hit_timer++;
}
if (zone == p1) {
if (zone.platform) {
if (zone._rotation < zone.platform.slope) {
var _local2 = Math.abs(zone._rotation - zone.platform.slope) / 4;
if (_local2 < 10) {
_local2 = 10;
}
zone._rotation = zone._rotation + _local2;
if (zone._rotation > zone.platform.slope) {
zone._rotation = zone.platform.slope;
}
} else if (zone._rotation > zone.platform.slope) {
var _local2 = Math.abs(zone._rotation - zone.platform.slope) / 4;
if (_local2 < 10) {
_local2 = 10;
}
zone._rotation = zone._rotation - _local2;
if (zone._rotation < zone.platform.slope) {
zone._rotation = zone.platform.slope;
}
}
if (zone._xscale > 0) {
zone.body._rotation = zone.platform.slope;
} else {
zone.body._rotation = -zone.platform.slope;
}
zone._rotation = 0;
} else {
zone._rotation = 0;
}
if (zone.wait) {
zone.invincible_timer = 1;
if (zone.platform) {
zone.gotoAndStop("wait");
}
}
}
}
function f_Timers(zone) {
if (hud.health.bar._xscale < zone.health) {
hud.health.bar._xscale++;
}
if (hud.mana.bar._xscale < zone.mana) {
hud.mana.bar._xscale++;
}
f_GeneralTimers(zone);
if (zone.invincible_timer <= 0) {
if (zone.gotpixel > 0) {
zone.gotpixel--;
if (zone.gotpixel == 1) {
if (zone._xscale > 0) {
zone._xscale = 115;
} else {
zone._xscale = -115;
}
zone._yscale = 115;
f_ColorSwap(zone, color_yellow2);
} else if (zone.gotpixel == 0) {
f_ColorSwap(zone, color_default);
if (zone._xscale > 0) {
zone._xscale = 100;
} else {
zone._xscale = -100;
}
zone._yscale = 100;
}
}
}
}
function f_Controls(zone) {
if (!zone.paused) {
f_CheckJump(zone);
if (!zone.punching) {
if (zone.ladder == undefined) {
if (!zone.jumping) {
f_Ladder(zone);
}
} else {
f_CheckLadder(zone);
}
}
if (zone.freeze_timer <= 0) {
if ((!zone.crouch) and (!(zone.ladder and zone.punching))) {
f_Walk(zone);
if (zone.wall_pt) {
if (zone.wallstick > 0) {
if (zone.wall_pt.sticky) {
if ((zone.speed_y >= -5) and (!zone.platform)) {
if (((zone.x < zone.wall_pt.x) and (zone._xscale > 0)) or ((zone.x > zone.wall_pt.x) and (zone._xscale < 0))) {
zone._xscale = zone._xscale * -1;
zone.gotoAndStop("wall_idle");
return(undefined);
}
}
}
}
}
}
} else {
zone.freeze_timer--;
}
if ((zone.ladder == undefined) and (!zone.paused)) {
if ((zone.platform == undefined) or zone.jumping) {
if (zone.float_timer > 0) {
zone.float_timer--;
} else {
if (zone.jump_speed_x != 0) {
f_MoveH(zone, zone.jump_speed_x);
}
if (zone.speed_y >= 0) {
if (f_PY(zone, zone.speed_y) == false) {
f_MoveV(zone, zone.speed_y);
zone.speed_y = zone.speed_y + zone.weight;
zone.jumping = false;
f_GoFrame(zone, "jump1_mid");
} else {
zone.jump_speed_x = 0;
zone.punching = false;
zone.midpunch = false;
zone._rotation = zone.platform.slope;
f_FX(zone.x, zone.y, zone.y + 10, "dustpuff", 100, 100);
f_GoFrame(zone, "stand");
}
} else {
if ((doublejump > 0) and (zone.jumps <= doublejump)) {
f_GoFrame(zone, "jump1_mid");
} else {
f_GoFrame(zone, "jump1");
}
if (f_WallAbove(zone, zone.speed_y) == false) {
f_MoveV(zone, zone.speed_y);
}
zone.speed_y = zone.speed_y + zone.weight;
}
if (zone.speed_y > zone.speed_y_max) {
zone.speed_y = zone.speed_y_max;
}
}
} else {
zone.dashing_timer = 0;
if (zone.crouch) {
f_LeftRightTimers(zone);
if ((zone.left_timer > 0) and (zone.left_timer > zone.right_timer)) {
if (zone._xscale > 0) {
f_FlipChar(zone);
}
}
if ((zone.right_timer > 0) and (zone.right_timer > zone.left_timer)) {
if (zone._xscale < 0) {
f_FlipChar(zone);
}
}
f_GoFrame(zone, "crouch");
} else if (zone.walking) {
if (zone.dashing and ((zone.speed_x == (-zone.speed_x_dash)) or (zone.speed_x == zone.speed_x_dash))) {
f_GoFrame(zone, "dash");
} else {
f_GoFrame(zone, "walk");
}
} else if (zone.platform.diagonal) {
f_GoFrame(zone, "stand");
} else {
f_GoFrame(zone, "stand");
}
}
}
if (zone.prev_hit_timer <= 0) {
if (Key.isDown(zone.b_down)) {
if ((((!Key.isDown(zone.b_left)) and (!Key.isDown(zone.b_right))) and (!zone.platform)) or (!zone.platform)) {
zone.gun_frame = 1;
} else {
zone.gun_frame = 10;
}
} else if (Key.isDown(zone.b_up)) {
if ((!Key.isDown(zone.b_left)) and (!Key.isDown(zone.b_right))) {
zone.gun_frame = 29;
} else {
zone.gun_frame = 21;
}
} else {
zone.gun_frame = 15;
}
if (zone.gun._currentframe < zone.gun_frame) {
if (zone.gun_frame > (zone.gun._currentframe + 4)) {
zone.gun.gotoAndStop(zone.gun._currentframe + int((zone.gun_frame - zone.gun._currentframe) / 4));
} else {
zone.gun.gotoAndStop(zone.gun._currentframe + 1);
}
} else if (zone.gun._currentframe > zone.gun_frame) {
if (zone.gun_frame < (zone.gun._currentframe - 4)) {
zone.gun.gotoAndStop(zone.gun._currentframe - int((zone.gun._currentframe - zone.gun_frame) / 4));
} else {
zone.gun.gotoAndStop(zone.gun._currentframe - 1);
}
}
f_Punch(zone);
}
}
}
function f_Depth(u_char, u_depth) {
var _local2 = 200 * ((u_depth - abs_top) / abs_bottom);
if (u_char.depth_mod == undefined) {
trace("NO DEPTH: " + u_char);
}
u_char.current_depth = int((_local2 * 200) + u_char.depth_mod);
u_char.swapDepths(u_char.current_depth);
}
function f_SetDepths() {
for (n in a_Players) {
var _local1 = a_Players[n];
f_Depth(_local1, _local1.y);
}
for (n in a_Enemies) {
var _local1 = a_Enemies[n];
if (!_local1.nodepth) {
f_Depth(_local1, _local1.y);
}
}
}
function f_ClearDepth(u_char) {
u_char.swapDepths(u_char.depth_mod);
}
function f_SetDepthMod() {
current_depth_mod++;
if (current_depth_mod > depth_mod_max) {
current_depth_mod = 1;
}
return(current_depth_mod);
}
function f_AddNeutral(zone) {
zone.depth_mod = f_SetDepthMod();
f_Depth(zone, zone._y);
}
function f_PixelChase(zone) {
zone._x = zone._x + zone.speed_x;
zone._y = zone._y + zone.speed_y;
if (zone._x > p1.x) {
zone.speed_x = zone.speed_x - 1;
if (zone.speed_x < 0) {
if (zone._y > (p1.y - 50)) {
zone.speed_y = zone.speed_y - 2;
} else {
zone.speed_y = zone.speed_y + 2;
}
}
} else {
zone.speed_x = zone.speed_x + 1;
if (zone.speed_x > 0) {
if (zone._y > (p1.y - 50)) {
zone.speed_y = zone.speed_y - 2;
} else {
zone.speed_y = zone.speed_y + 2;
}
}
}
if (Math.abs(zone._x - p1.x) < 40) {
if (Math.abs(zone._y - (p1.y - 50)) < 70) {
f_Mana(p1, 1);
p1.gotpixel = 3;
f_ColorSwap(p1, color_yellow);
if (zone._xscale > 0) {
zone._xscale = 130;
} else {
zone._xscale = -130;
}
zone._yscale = 130;
zone.gotoAndStop("remove");
}
}
zone.timer--;
if (zone.timer <= 0) {
zone.gotoAndStop("remove");
} else if (zone.timer < 20) {
zone._xscale = zone._xscale - 2;
zone._yscale = zone._yscale - 2;
}
}
function f_DeRes(x, y) {
var _local2 = random(100);
var _local1 = f_FX(x, y, y, "pixel", 100 + _local2, 100 + _local2);
_local1.timer = 200;
if (p1.x < _local1._x) {
_local1.speed_x = random(10) + 3;
} else {
_local1.speed_x = -(random(10) + 3);
}
_local1.speed_y = random(20) - 10;
}
function f_PixelFly(x, y) {
var _local2 = random(200);
var _local1 = f_FX(x, y, y + 80, "pixel", 100 + _local2, 100 + _local2);
_local1.timer = 90;
if (p1._xscale > 0) {
_local1.speed_x = (p1.force_x * 2) + random(10);
} else {
_local1.speed_x = -((p1.force_x * 2) + random(10));
}
_local1.speed_y = (p1.force_y + random(10)) - 5;
}
function f_OptionalForceSlide(zone) {
if (((zone._xscale > 0) and Key.isDown(zone.b_right)) or ((zone._xscale < 0) and Key.isDown(zone.b_left))) {
f_ForceSlide(zone);
}
}
function f_ForceSlide(zone) {
if (zone._xscale > 0) {
if (((zone.x + game_x) + zone.slide_x) < screenWidth) {
f_MoveH(zone, zone.slide_x);
}
} else if (((zone.x + game_x) - zone.slide_x) > 0) {
f_MoveH(zone, -zone.slide_x);
}
zone.slide_x--;
if (zone.slide_x <= 0) {
zone.slide_x = 0;
}
if (zone.slide_y < 0) {
if (f_WallAbove(zone, zone.slide_y) == false) {
f_MoveV(zone, zone.slide_y);
}
zone.slide_y++;
}
}
function f_ForceSlideBack(zone) {
if (zone.force_x < 0) {
if (((zone.x + game_x) + zone.force_x) > 0) {
f_MoveH(zone, zone.force_x);
}
zone.force_x++;
if (zone.force_x > 0) {
zone.force_x = 0;
}
} else {
if (((zone.x + game_x) + zone.force_x) < screenWidth) {
f_MoveH(zone, zone.force_x);
}
zone.force_x--;
if (zone.force_x < 0) {
zone.force_x = 0;
}
}
}
function f_ShowVal(u_digit, u_value, u_color) {
u_value = Math.abs(u_value);
var _local3 = u_value / 100;
_local3 = Math.floor(_local3);
var _local4 = (u_value - (_local3 * 100)) / 10;
_local4 = Math.floor(_local4);
var _local6 = (u_value - (_local3 * 100)) - (_local4 * 10);
_local6 = Math.floor(_local6);
var _local1 = u_digit.body.body.body;
if (_local6 == 0) {
var _local2 = 10;
} else {
var _local2 = _local6;
}
_local1.one.gotoAndStop(_local2);
_local1.one.outline.gotoAndStop(_local2);
f_ColorSwap(_local1.one.outline, u_color);
if (u_value >= 10) {
if (_local4 == 0) {
var _local2 = 10;
} else {
var _local2 = _local4;
}
_local1.ten.gotoAndStop(_local2);
_local1.ten.outline.gotoAndStop(_local2);
f_ColorSwap(_local1.ten.outline, u_color);
if (u_value >= 100) {
if (_local3 == 0) {
var _local2 = 10;
} else {
var _local2 = _local3;
}
_local1.hundred.gotoAndStop(_local2);
_local1.hundred.outline.gotoAndStop(_local2);
f_ColorSwap(_local1.hundred.outline, u_color);
} else {
_local1.hundred.gotoAndStop("blank");
_local1.one._x = 8;
_local1.ten._x = -8;
}
} else {
_local1.ten.gotoAndStop("blank");
_local1.hundred.gotoAndStop("blank");
_local1.one._x = 0;
}
}
function f_Mana(zone, u_temp) {
zone.mana = zone.mana + u_temp;
if (zone.mana < 0) {
zone.mana = 0;
} else if (zone.mana > zone.mana_max) {
zone.mana = zone.mana_max;
}
if (zone == p1) {
hud.mana.bar._xscale = zone.mana;
}
}
function f_Health(zone, u_temp) {
zone.health = zone.health + u_temp;
if (zone.health < 0) {
zone.health = 0;
} else if (zone.health > zone.health_max) {
zone.health = zone.health_max;
}
if (zone == p1) {
hud.health.bar._xscale = zone.health;
}
}
function f_Damage(zone, damage_val) {
var _local2 = damage_val - zone.defense;
if (_local2 < 1) {
if (damage_val > 0) {
_local2 = 1;
} else {
_local2 = 0;
}
}
if (_local2 > 0) {
var _local3 = f_FX(zone.x, zone.impact_y - 50, zone.y + 200, "damage_val", 100, 100);
f_ShowVal(_local3, _local2, color_red);
if (zone._xscale > 0) {
_local3.force_x = (-zone.force_x) * 0.5;
} else {
_local3.force_x = zone.force_x * 0.5;
}
_local3.force_y = zone.force_y * 0.5;
zone.health = zone.health - _local2;
if (zone.health < 0) {
zone.health = 0;
}
if (zone == p1) {
hud.health.bar._xscale = zone.health;
hud.health.flasher._xscale = _local2;
hud.health.flasher._x = zone.health;
hud.health.flasher.gotoAndPlay(2);
}
}
}
function f_GameOver() {
if (!gameover) {
stats.health = stats.health_max;
gameover = true;
fader.warpto = "reset";
fader.spawnpoint = spawnpoint;
fader.gotoAndPlay("fadeout");
}
}
function f_HitPlayer(zone) {
var _local3 = 80 + random(30);
var _local4 = f_FX(zone.x, zone.y - 40, zone.y + 10, "impact1", _local3, _local3);
_local4._rotation = random(180);
_root.f_DamagePlayer(1);
if (!zone.hitby.bullet) {
if (Math.abs(zone.force_x) > 12) {
s_punch3.start(0, 0);
} else {
f_PunchSound();
}
}
zone.nojumpanim = false;
zone.gun.gun.gun.gun.gotoAndStop("idle");
if (zone.platform and (zone.force_y >= -10)) {
zone.force_y = -10;
}
if ((zone.hitby.x < zone.x) or (zone.hitby.force_x > 0)) {
if (!zone.hitby.noturn) {
if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
}
f_TossInit(zone, zone.force_x, zone.force_y);
} else {
if (!zone.hitby.noturn) {
if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
}
f_TossInit(zone, zone.force_x, zone.force_y);
}
}
function f_DefaultStats() {
stats = new Object();
stats.health_max = 20;
stats.health = stats.health_max;
stats.mana_max = 100;
stats.mana = 0;
stats.attack = 51;
stats.defense = 50;
}
function f_LoadStats() {
p1.health_max = stats.health_max;
p1.health = stats.health;
p1.mana_max = stats.mana_max;
p1.mana = stats.mana;
p1.attack = stats.attack;
p1.defense = stats.defense;
}
function f_BackupStats() {
stats = new Object();
stats.health_max = p1.health_max;
stats.health = p1.health;
stats.mana_max = p1.mana_max;
stats.mana = p1.mana;
stats.attack = p1.attack;
stats.defense = p1.defense;
}
function f_InitPlayer(zone) {
if (zone == p1) {
zone.b_punch1 = 65;
zone.b_punch2 = 68;
zone.b_jump = 83;
zone.b_left = 37;
zone.b_up = 38;
zone.b_right = 39;
zone.b_down = 40;
zone.x = zone._x;
zone.y = zone._y;
zone.depth_mod = p1_depth_mod;
} else if (zone == p2) {
zone.b_punch1 = 219;
zone.b_punch2 = 221;
zone.b_jump = 220;
zone.b_left = 74;
zone.b_up = 73;
zone.b_right = 76;
zone.b_down = 75;
zone.x = (screenWidth / 1.7) - game_x;
zone.y = (screenHeight / 1.7) - game_y;
zone.depth_mod = p2_depth_mod;
}
f_Depth(zone, zone.y);
zone.speed_x_max = 12;
zone.speed_x_dash = 30;
zone.speed_x = 0;
zone.speed_y = 0;
zone.speed_y_max = speed_y_max;
zone.jump_speed_x = 0;
zone.speed_ladder = 8;
zone.launch = -25;
zone.weight = 1.75;
zone.bounce = 0.25;
zone.face_type = 1;
zone.body_type = 1;
zone.head_type = 1;
zone.bounce_limit = 2;
zone.gun_type = 2;
f_LoadStats();
zone.damage_val = zone.attack;
zone.left_timer = 0;
zone.right_timer = 0;
zone.fp_Hit1 = f_HitPlayer;
zone.fp_HitGround = f_HitGround1;
zone.w2 = 2;
zone._xscale = 100;
zone._yscale = 100;
zone.goodguy = true;
zone.pushesenemies = true;
zone._x = zone.x;
zone._y = zone.y;
zone.noremove = true;
zone.platform = undefined;
zone.ladder = undefined;
zone.punching = false;
zone.active = true;
zone.alive = true;
zone.float_timer = 0;
zone.bullet_timer = 1;
zone.texture = 4;
f_PlayerPush(zone);
players++;
zone.gotoAndStop("stand");
}
function f_CreateFX() {
i = 1;
while (i <= total_fx) {
var _local3 = "fx" + i;
var _local1 = f_SetDepthMod();
game.game.attachMovie("fx", _local3, _local1);
var _local2 = game.game["fx" + i];
_local2.depth_mod = _local1;
_local2.noremove = true;
i++;
}
}
function f_CreateItems(u_temp) {
total_items = u_temp;
i = 1;
while (i <= total_items) {
u_temp = "item" + i;
var _local1 = f_SetDepthMod();
game.game.attachMovie("item", u_temp, _local1);
u_temp = game.game["item" + i];
u_temp.depth_mod = _local1;
i++;
}
}
function f_FX(fx_x, fx_y, fx_depth, fx_type, fx_xscale, fx_yscale) {
var _local1 = game.game["fx" + current_fx];
_local1._x = fx_x;
_local1._y = fx_y;
if (fx_xscale != undefined) {
_local1._xscale = fx_xscale;
} else {
_local1._xscale = 100;
}
if (fx_yscale != undefined) {
_local1._yscale = fx_yscale;
} else {
_local1._yscale = 100;
}
_local1.noturn = false;
_local1.force_x = 0;
_local1.force_y = 0;
_local1.damage_val = 0;
_local1.hitall = false;
_local1.attribute_poison = false;
_local1.bullet = false;
_local1._rotation = 0;
_local1.gotoAndStop("blank");
_local1.gotoAndStop(fx_type);
current_fx++;
if (current_fx > total_fx) {
current_fx = 1;
}
f_Depth(_local1, fx_depth);
return(_local1);
}
function f_Item(u_x, u_y, u_depth, item_type, u_xscale, u_yscale) {
var _local1 = game.game["item" + current_item];
_local1.x = u_x;
_local1.y = u_y;
_local1._x = _local1.x;
_local1._y = _local1.y;
_local1.speed_y = 0;
_local1.speed_y_max = 30;
_local1.jump_speed_x = 0;
_local1.platform = undefined;
_local1.jumping = false;
_local1.nojumpanim = true;
_local1.launch = -20;
_local1.weight = 1.5;
_local1.active = true;
if (u_xscale != undefined) {
_local1._xscale = u_xscale;
} else {
_local1._xscale = 100;
}
if (u_yscale != undefined) {
_local1._yscale = fx_yscale;
} else {
_local1._yscale = 100;
}
_local1.gotoAndStop("blank");
_local1.gotoAndStop(item_type);
_local1.w = _local1._width / 2;
_local1.w2 = _local1._width / 2;
_local1.h = _local1._height;
current_item++;
if (current_item > total_items) {
current_item = 1;
}
f_Depth(_local1, u_depth);
f_ObjectPush(_local1, a_Items);
return(_local1);
}
function f_CheckStart() {
if (Key.isDown(b_start1)) {
if (pressed_start1 == false) {
pressed_start1 = true;
if (p1.active) {
f_RemovePlayer(p1);
} else {
f_InitPlayer(p1);
}
}
} else {
pressed_start1 = false;
}
if (Key.isDown(b_start2)) {
if (pressed_start2 == false) {
pressed_start2 = true;
if (p2.active) {
f_RemovePlayer(p2);
} else {
f_InitPlayer(p2);
}
}
} else {
pressed_start2 = false;
}
if (players == 1) {
f_GetPlayer();
}
}
function f_ShrapnelExplode(zone) {
zone.gotoAndStop("explosion3");
}
function f_ShrapnelSplatter(zone) {
zone.gotoAndStop("blood1");
}
function f_ShrapnelRemove(zone) {
zone.gotoAndStop("remove");
}
function f_ShrapnelVanish(zone) {
zone.gotoAndStop("blank");
}
function f_ShrapnelRock1Split(zone) {
f_FX(zone.x, zone.y, zone.y + 1, "impact1", 100, 100);
f_ShrapnelRock2(zone.x + 15, zone.y - 5, zone.y + 1, Math.abs(zone.toss_speed_x), zone.old_speed_y * (-zone.bounce));
f_ShrapnelRock2(zone.x - 15, zone.y - 5, zone.y + 1, -Math.abs(zone.toss_speed_x), zone.old_speed_y * (-zone.bounce));
zone.gotoAndStop("remove");
}
function f_ShrapnelGeneral(x, y, u_depth, u_speed_x, u_speed_y, item) {
var _local1 = f_FX(x, y, u_depth, item, 100, 100);
_local1.x = _local1._x;
_local1.y = _local1._y;
_local1.w = 1;
_local1.w2 = 2;
_local1.h = 1;
_local1.platform = undefined;
_local1.bounces = 0;
_local1.bounce_limit = 1;
_local1.weight = 2;
_local1.bounce = 0.6;
_local1.spin = true;
_local1.speed_y = u_speed_y;
_local1.toss_speed_x = u_speed_x;
_local1.fp_ShrapnelEnd = f_ShrapnelRemove;
return(_local1);
}
function f_ShrapnelRock2(x, y, u_depth, u_speed_x, u_speed_y) {
var _local1 = f_FX(x, y, u_depth, "rock1", 50, 50);
_local1.x = _local1._x;
_local1.y = _local1._y;
_local1.w = 1;
_local1.w2 = 2;
_local1.h = 1;
_local1.platform = undefined;
_local1.bounces = 0;
_local1.bounce_limit = 1;
_local1.weight = 1.5;
_local1.bounce = 0.6;
_local1.spin = true;
_local1.speed_y = u_speed_y;
_local1.toss_speed_x = u_speed_x;
_local1.fp_ShrapnelEnd = f_ShrapnelRemove;
}
function f_ShrapnelRock1(x, y, u_depth, u_speed_x, u_speed_y) {
var _local1 = f_FX(x, y, u_depth, "rock1", 100, 100);
_local1.x = _local1._x;
_local1.y = _local1._y;
_local1.w = 1;
_local1.w2 = 2;
_local1.h = 1;
_local1.platform = undefined;
_local1.bounces = 0;
_local1.bounce_limit = 0;
_local1.weight = 2.5;
_local1.bounce = 0.5;
_local1.spin = true;
_local1.speed_y = u_speed_y;
_local1.toss_speed_x = u_speed_x;
_local1.fp_ShrapnelEnd = f_ShrapnelRock1Split;
}
function f_Shrapnel(zone) {
zone.old_speed_y = zone.speed_y;
if (zone.speed_y < 0) {
f_WallAbove(zone, zone.speed_y);
}
var _local2 = f_MoveH(zone, zone.toss_speed_x);
if (zone.spin) {
if (zone._xscale < 0) {
zone.body._rotation = zone.body._rotation - _local2;
} else {
zone.body._rotation = zone.body._rotation + _local2;
}
}
if (_local2 == 0) {
zone.toss_speed_x = zone.toss_speed_x * (-zone.bounce);
}
var _local3 = zone.y;
if (f_PY(zone, zone.speed_y) == false) {
f_MoveV(zone, zone.speed_y);
zone.speed_y = zone.speed_y + zone.weight;
} else if ((zone.old_speed_y > 4) and (zone.bounces < zone.bounce_limit)) {
zone.speed_y = zone.old_speed_y * (-zone.bounce);
zone.platform = undefined;
zone.bounces++;
} else {
zone.fp_ShrapnelEnd(zone);
}
}
function f_BloodShrapnel(zone) {
zone._x = zone._x + zone.speed_x;
zone.body._y = zone.body._y + zone.speed_y;
zone.speed_y = zone.speed_y + zone.gravity;
if (zone.body._y > 0) {
zone.gotoAndStop("blank");
}
}
function f_TossHitChar(zone, u_p) {
if (zone != u_p) {
if (u_p.platform != undefined) {
if (((zone.y - zone.h) + 1) < u_p.y) {
if (zone.y >= (u_p.y - (u_p.h / 3))) {
if ((zone.x + zone.w) > (u_p.x - u_p.w)) {
if ((zone.x - zone.w) < (u_p.x + u_p.w)) {
var _local5 = zone.x + zone.w;
var _local4 = u_p.x - u_p.w;
if ((u_p.x > zone.x) and (zone.toss_speed_x > 0)) {
u_p.x = (zone.x + zone.w) + u_p.w;
var _local3 = Math.abs(zone.toss_speed_x);
f_TossInit(u_p, _local3, -10);
} else if ((u_p.x < zone.x) and (zone.toss_speed_x < 0)) {
u_p.x = (zone.x - zone.w) - u_p.w;
var _local3 = -Math.abs(zone.toss_speed_x);
f_TossInit(u_p, _local3, -10);
}
}
}
}
}
}
}
}
function f_TossHit(zone) {
for (n in a_Players) {
var _local1 = a_Players[n];
f_TossHitChar(zone, _local1);
}
}
function f_Toss(zone) {
var _local2 = zone.speed_y;
var _local6 = zone.toss_speed_x;
var _local3 = f_MoveH(zone, zone.toss_speed_x);
if (zone.hitwall) {
if (zone.fp_HitWall(zone)) {
return(undefined);
}
}
if (zone.spin and (!zone.platform)) {
zone.body._rotation = zone.body._rotation + _local3;
} else {
zone.fp_FixRotation(zone);
}
if (zone == p1) {
var _local4 = screenWidth;
var _local5 = 0;
} else {
var _local4 = screenWidth + 100;
var _local5 = -100;
}
if (_local3 == 0) {
if (zone.pushes) {
zone.toss_speed_x = zone.toss_speed_x * -1;
} else {
zone.toss_speed_x = zone.toss_speed_x * (-zone.bounce);
}
} else if ((((zone.x - zone.w) + game_x) > _local4) or (((zone.x + zone.w) + game_x) < _local5)) {
_local3 = 0;
zone.toss_speed_x = 0;
} else {
f_MovePlatformH(zone, _local3);
zone.toss_speed_x = _local3;
}
var _local7 = zone.y;
if (f_PY(zone, zone.speed_y) == false) {
if (zone.speed_y <= 0) {
if (f_WallAbove(zone, zone.speed_y * 2) == false) {
f_MoveV(zone, zone.speed_y);
}
} else {
f_MoveV(zone, zone.speed_y);
}
zone.speed_y = zone.speed_y + zone.weight;
if (((zone.speed_y - zone.weight) <= 0) and (zone.speed_y > 0)) {
if (!zone.blocking) {
zone.gotoAndStop("fish2");
}
}
} else {
f_FX(zone.x, zone.y, zone.y + 10, "dust1", 100, 100);
if (zone.platform.diagonal) {
if (zone.bounces <= zone.temp_bounce_limit) {
s_bodyfall2.start(0, 0);
if (zone.platform.incline) {
if (zone.toss_speed_x > 0) {
zone.toss_speed_x = zone.toss_speed_x * (zone.bounce / 2);
if (_local2 <= (4 * (1 / zone.bounce))) {
_local2 = 5;
}
}
} else if (zone.toss_speed_x < 0) {
zone.toss_speed_x = zone.toss_speed_x * (zone.bounce / 2);
if (_local2 <= 4) {
_local2 = 5;
}
}
}
}
if (zone.weight >= 3) {
if (f_OnScreen(zone)) {
shake_y = 6;
}
}
if ((_local2 > 4) and (zone.bounces < zone.temp_bounce_limit)) {
zone.speed_y = _local2 * (-zone.bounce);
zone.platform = undefined;
zone.bounces++;
s_bodyfall2.start(0, 0);
if (!zone.blocking) {
zone.gotoAndStop("fish1");
}
} else {
zone.jumping = false;
}
}
if (zone.pushes) {
if (zone.speed_y >= 0) {
f_TossHit(zone);
}
}
if ((zone.speed_y == 0) and zone.platform) {
if (zone.pushes) {
if (zone.toss_speed_x > 0) {
zone.toss_speed_x = zone.toss_speed_x - 1;
if (zone.toss_speed_x < 0) {
zone.toss_speed_x = 0;
}
} else if (zone.toss_speed_x < 0) {
zone.toss_speed_x = zone.toss_speed_x + 1;
if (zone.toss_speed_x > 0) {
zone.toss_speed_x = 0;
}
} else {
zone.tossed = false;
if (zone.blocking) {
zone.blocking = false;
zone.gotoAndStop("stand");
} else {
zone.fp_HitGround(zone);
}
}
} else {
zone.tossed = false;
if (zone.blocking) {
zone.blocking = false;
zone.gotoAndStop("stand");
} else {
zone.fp_HitGround(zone);
}
}
}
}
function f_HitGround1(zone) {
f_ShakeY(5);
f_BodyFallSound();
zone.onground = true;
zone.gotoAndStop("hitground");
}
function f_HitGround2(zone) {
zone.gotoAndStop("stand");
}
function f_TossPose(zone) {
if (Math.abs(zone.speed_y) > Math.abs(zone.toss_speed_x)) {
zone.body.gotoAndStop(2);
} else {
zone.body.gotoAndStop(1);
}
}
function f_TossInit(tossee, speedx, speedy) {
tossee.toss_speed_x = speedx;
if (zone.pushes) {
if ((speedx > 0) and (speed_x < 20)) {
tossee.toss_speed_x = 20;
} else if ((speedx < 0) and (speed_x > -20)) {
tossee.toss_speed_x = -20;
}
}
tossee.rotate_speed = speedx;
tossee.speed_y = speedy;
if (speedy != 0) {
tossee.platform = undefined;
}
tossee.tossed = true;
tossee.jumping = true;
tossee.punching = false;
tossee.midpunch = false;
tossee.float_timer = 0;
tossee.bounces = 0;
if (tossee.bounce_limit >= 0) {
tossee.temp_bounce_limit = tossee.bounce_limit;
} else {
tossee.temp_bounce_limit = 1000;
}
tossee.gotoAndStop("toss");
tossee.body.gotoAndPlay(1);
}
function f_QueueFall(zone) {
zone.queue_y_speed = zone.queue_y_speed + (zone.queue_y_speed + zone.weight);
zone.speed_y = zone.queue_y_speed;
f_PY(zone, zone.speed_y);
zone.speed_y = zone.speed_y_max;
}
function f_FixRotation(zone) {
var _local2 = zone.body._rotation;
if ((_local2 > -180) and (_local2 < -90)) {
if (zone.rotate_speed > 0) {
_local2 = _local2 + zone.rotate_speed;
f_MoveH(zone, zone.rotate_speed);
f_MovePlatformH(zone, zone.rotate_speed);
f_UpdateWall(zone, zone.z_wall);
zone.rotate_speed++;
if (_local2 > -90) {
_local2 = -90;
}
} else {
_local2 = _local2 + zone.rotate_speed;
f_MoveH(zone, zone.rotate_speed);
f_MovePlatformH(zone, zone.rotate_speed);
f_UpdateWall(zone, zone.z_wall);
zone.rotate_speed--;
if (_local2 < -180) {
_local2 = -180;
}
}
zone.body._rotation = _local2;
} else if ((_local2 > -90) and (_local2 < 0)) {
if (zone.rotate_speed > 0) {
_local2 = _local2 + zone.rotate_speed;
f_MoveH(zone, zone.rotate_speed);
f_MovePlatformH(zone, zone.rotate_speed);
f_UpdateWall(zone, zone.z_wall);
zone.rotate_speed++;
if (_local2 > 0) {
_local2 = 0;
}
} else {
_local2 = _local2 + zone.rotate_speed;
f_MoveH(zone, zone.rotate_speed);
f_MovePlatformH(zone, zone.rotate_speed);
f_UpdateWall(zone, zone.z_wall);
zone.rotate_speed--;
if (_local2 < -90) {
_local2 = -90;
}
}
zone.body._rotation = _local2;
} else if ((_local2 > 0) and (_local2 < 90)) {
if (zone.rotate_speed > 0) {
_local2 = _local2 + zone.rotate_speed;
f_MoveH(zone, zone.rotate_speed);
f_MovePlatformH(zone, zone.rotate_speed);
f_UpdateWall(zone, zone.z_wall);
zone.rotate_speed++;
if (_local2 > 90) {
_local2 = 90;
}
} else {
_local2 = _local2 + zone.rotate_speed;
f_MoveH(zone, zone.rotate_speed);
f_MovePlatformH(zone, zone.rotate_speed);
f_UpdateWall(zone, zone.z_wall);
zone.rotate_speed--;
if (_local2 < 0) {
_local2 = 0;
}
}
zone.body._rotation = _local2;
} else if ((_local2 > 90) and (_local2 < 180)) {
if (zone.rotate_speed > 0) {
_local2 = _local2 + zone.rotate_speed;
f_MoveH(zone, zone.rotate_speed);
f_MovePlatformH(zone, zone.rotate_speed);
f_UpdateWall(zone, zone.z_wall);
zone.rotate_speed++;
if (_local2 > 180) {
_local2 = 180;
}
} else {
_local2 = _local2 + zone.rotate_speed;
f_MoveH(zone, zone.rotate_speed);
f_MovePlatformH(zone, zone.rotate_speed);
f_UpdateWall(zone, zone.z_wall);
zone.rotate_speed--;
if (_local2 < 90) {
_local2 = 90;
}
}
zone.body._rotation = _local2;
}
}
function f_BallCode(zone) {
zone.w = zone.z_wall.w;
if ((zone.platform == undefined) or zone.jumping) {
f_TossInit(zone, zone.toss_speed_x, 0);
} else if (zone.x > (zone.platform.x + zone.platform.w)) {
var _local3 = zone.x - (zone.platform.x + zone.platform.w);
var _local4 = _local3 / zone.w;
var _local2 = 10 * _local4;
f_MoveH(zone, _local2);
f_MovePlatformH(zone, _local2);
f_UpdateWall(zone, zone.z_wall);
zone.body._rotation = zone.body._rotation + _local2;
zone.rotate_speed = _local2;
zone.toss_speed_x = _local2;
if (zone.platform == undefined) {
f_TossInit(zone, _local2, 0);
}
} else if (zone.x < (zone.platform.x - zone.platform.w)) {
var _local3 = (zone.platform.x - zone.platform.w) - zone.x;
var _local4 = _local3 / zone.w;
var _local2 = -10 * _local4;
f_MovePlatformH(zone, f_MoveH(zone, _local2));
f_UpdateWall(zone, zone.z_wall);
zone.body._rotation = zone.body._rotation + _local2;
zone.rotate_speed = _local2;
zone.toss_speed_x = _local2;
if (zone.platform == undefined) {
f_TossInit(zone, _local2, 0);
}
} else {
f_FixRotation(zone);
}
}
function f_InitGeneral(zone) {
zone.speed_y = 0;
zone.speed_y_max = 30;
zone.active = true;
zone.alive = true;
zone.platform = undefined;
zone.hitby = undefined;
zone.nohit = false;
zone.float_timer = 0;
zone.jumping = false;
zone.x = zone._x;
zone.y = zone._y;
zone.depth_mod = f_SetDepthMod();
zone.fp_HitGround = f_HitGround1;
}
function f_InitBall(zone) {
zone.speed_x = 12;
zone.weight = 1.5;
zone.bounce = 0.8;
zone.bounce_limit = 3;
f_InitGeneral(zone);
f_AddEnemy(zone);
}
function f_InitCrate(zone) {
zone.fp_Hit1 = f_HitToss;
zone.fp_FixRotation = f_FixRotation;
zone.speed_x = 12;
zone.speed_y_max = 24;
zone.weight = 3;
zone.bounce = 0.5;
zone.bounce_limit = 1;
zone.attack = 1;
zone.defense = 1000;
f_InitGeneral(zone);
zone.fp_HitGround = f_HitGround2;
f_AddEnemy(zone);
}
function f_CheckConveyer(u_p) {
var _local2 = 1;
while (_local2 <= 4) {
u_c = game.game["conveyer" + _local2];
if (u_p.platform == u_c.z_platform) {
if ((_local2 % 2) == 0) {
if (u_p.z_platform) {
f_MovePlatformH(u_p, f_MoveH(u_p, -conveyer_speed));
} else {
f_MoveH(u_p, -conveyer_speed);
}
if (u_p.z_wall) {
f_UpdateWall(u_p, u_p.z_wall);
}
} else {
if (u_p.z_platform) {
f_MovePlatformH(u_p, f_MoveH(u_p, conveyer_speed));
} else {
f_MoveH(u_p, conveyer_speed);
}
if (u_p.z_wall) {
f_UpdateWall(u_p, u_p.z_wall);
}
}
}
_local2++;
}
}
function f_Conveyers() {
if (chronicdead) {
camera.prey = p1;
} else {
if (game.game.laser4._currentframe != 1) {
f_CameraFollow3(p1, game.game.chronic, game.game.laser4, game.game.chase_cam);
f_ScaleFollow3(p1, game.game.chronic, game.game.laser4);
} else if (game.game.laser3._currentframe != 1) {
f_CameraFollow3(p1, game.game.chronic, game.game.laser3, game.game.chase_cam);
f_ScaleFollow3(p1, game.game.chronic, game.game.laser3);
} else if (game.game.laser2._currentframe != 1) {
f_CameraFollow3(p1, game.game.chronic, game.game.laser2, game.game.chase_cam);
f_ScaleFollow3(p1, game.game.chronic, game.game.laser2);
} else if (game.game.laser1._currentframe != 1) {
f_CameraFollow3(p1, game.game.chronic, game.game.laser1, game.game.chase_cam);
f_ScaleFollow3(p1, game.game.chronic, game.game.laser1);
} else {
f_CameraFollow(p1, game.game.chronic, game.game.chase_cam);
f_ScaleFollow(p1, game.game.chronic);
}
camera.prey = game.game.chase_cam;
}
for (n in a_Players) {
var _local2 = a_Players[n];
if (_local2.platform) {
f_CheckConveyer(_local2);
}
}
for (n in a_Items) {
var _local2 = a_Items[n];
if (_local2.platform) {
f_CheckConveyer(_local2);
}
}
for (n in a_Enemies) {
var _local2 = a_Enemies[n];
if (_local2.platform and _local2.alive) {
f_CheckConveyer(_local2);
if (_local2.x > game.game.crate_remove._x) {
if (chronic.prey == _local2) {
chronic.prey = p1;
}
f_RemoveEnemy(_local2);
_local2.gotoAndStop("wait");
}
}
}
crate_timer--;
if ((crate_timer <= 0) and chronic.alive) {
var _local3 = 1;
while (_local3 <= 4) {
var _local1 = game.game["crate" + _local3];
if (!_local1.active) {
_local1.active = true;
_local1.x = game.game.crate_spawn._x;
_local1.y = game.game.crate_spawn._y;
_local1._x = _local1.x;
_local1._y = _local1.y;
_local1.toss_speed_x = 0;
_local1.toss_speed_y = 0;
current_crate++;
if (current_crate > 2) {
_local1.crate_type = 2;
if (chronic.prey == p1) {
if (chronic.phase == 3) {
chronic.prey = _local1;
}
}
current_crate = 0;
} else {
_local1.crate_type = 1;
}
_local1.gotoAndStop("init");
crate_timer = 330;
return(undefined);
}
_local3++;
}
}
}
function f_RemovePlatform(u_platform) {
for (n in a_Players) {
var _local2 = a_Players[n];
if (_local2.platform == u_platform) {
_local2.platform = undefined;
}
}
for (n in a_Enemies) {
var _local1 = a_Enemies[n];
if (_local1.platform == u_platform) {
_local1.platform = undefined;
}
}
f_ObjectPop(u_platform, a_Platforms);
}
function f_UpdatePlatform(zone, u_platform) {
u_platform.x = zone._x + (u_platform._x * (zone._xscale / 100));
u_platform.y = zone._y + (u_platform._y * (zone._yscale / 100));
}
function f_AddPlatform(zone, u_platform) {
u_platform.x = zone._x + (u_platform._x * (zone._xscale / 100));
u_platform.y = zone._y + (u_platform._y * (zone._yscale / 100));
u_platform.w = (u_platform._width / 2) * (zone._xscale / 100);
u_platform.h = u_platform._height * (zone._yscale / 100);
f_ObjectPush(u_platform, a_Platforms);
}
function f_UpdateWall(zone, u_wall) {
u_wall.x = zone._x + u_wall._x;
u_wall.y = zone._y + u_wall._y;
}
function f_AddWall(zone, u_wall) {
u_wall.x = zone._x + u_wall._x;
u_wall.y = zone._y + u_wall._y;
u_wall.w = (u_wall._width / 2) * (zone._xscale / 100);
u_wall.h = u_wall._height * (zone._yscale / 100);
zone.w = u_wall.w;
zone.h = u_wall.h;
f_ObjectPush(u_wall, a_Walls);
}
function f_RemoveWall(u_wall) {
f_ObjectPop(u_wall, a_Walls);
}
function f_AddEnemyPush(zone) {
f_ObjectPush(zone, a_EnemiesPush);
}
function f_AddLadder(zone) {
total_ladders++;
zone.id = total_ladders;
zone.x = zone._x;
zone.y = zone._y;
zone.w = zone._width / 2;
zone.h = zone._height;
_root["ladder" + total_ladders] = zone;
}
function f_AddEnemy(zone) {
total_enemies++;
zone.id = total_enemies;
zone.x = zone._x;
zone.y = zone._y;
if (zone.z_wall) {
zone.w = zone.z_wall._width / 2;
zone.h = zone.z_wall._height;
} else {
zone.w = zone._width / 2;
zone.h = zone._height;
}
zone.active = true;
a_EnemiesLog.push(zone);
f_EnemyPush(zone);
}
function f_Clear() {
a_tiles = new Array(0);
a_Platforms = new Array(0);
a_Walls = new Array(0);
a_Slopes = new Array(0);
a_Ladders = new Array(0);
a_Players = new Array(0);
a_Enemies = new Array(0);
a_EnemiesLog = new Array(0);
a_EnemiesPush = new Array();
a_Events = new Array();
a_ObjectData = new Array(0);
a_Items = new Array(0);
total_platforms = 0;
total_walls = 0;
total_ladders = 0;
total_enemies = 0;
}
function f_Blur(zone, blurx, blury, blurq) {
var _local1 = new flash.filters.BlurFilter(blurx, blury, blurq);
zone.filters = [_local1];
}
function f_Slowdown(u_rate, u_timer) {
slowdown_delay = 2;
slowdown_timer_default = u_timer;
slowdown_timer_rate = u_rate;
}
function f_LevelDefaults() {
y_expanse = game.game.abs_bottom._y - game.game.abs_top._y;
abs_bottom = game.game.abs_bottom._y;
abs_top = game.game.abs_top._y;
target_scale = 100;
u_scale = 100 / game._xscale;
p1 = game.game.p1;
camera = game.game.camera;
limit_left = undefined;
limit_right = undefined;
limit_top = undefined;
limit_bottom = undefined;
game.game.container = true;
slowdown_timer = 0;
f_CreateFX();
f_CreateItems(10);
}
function f_Level1_0Init() {
game.game.event1.warpto = "level1_1";
game.game.event1.warpspawn = 1;
game.game.bg2._x = game.game.bg2_lock._x;
game.game.bg2._y = game.game.bg2_lock._y;
var _local1 = 50;
if (spawnpoint == 1) {
p1.y = game.game.ship_platform._y;
p1._y = p1.y;
game.game.ship.gotoAndPlay("intro");
game.game.chase_cam.x = game.game.chase_cam._x;
camera.prey = game.game.intro.chase_cam;
game.game.chase_cam._x = game.game.chase_cam.x;
game.game.chase_cam.y = game.game.chase_cam._y;
} else if (spawnpoint == 2) {
p1._x = game.game.spawn2._x;
p1._y = game.game.spawn2._y;
f_InitPlayer(p1);
p1.platform = game.game.spawn2_platform.z_platform;
game.game.chase_cam.x = p1.x + 200;
p1.gotoAndStop("stand");
} else if (spawnpoint == 3) {
game.game.intro.gotoAndStop("end2");
game.game.building2.gotoAndStop(2);
_local1 = 90;
camera._x = game.game.spawn3._x - 100;
camera._y = game.game.spawn3._y;
f_CameraPop();
p1._x = game.game.spawn3._x;
p1._y = game.game.spawn3._y;
f_InitPlayer(p1);
p1._xscale = p1._xscale * -1;
camera.prey = p1;
p1.gotoAndStop("stand");
} else if (spawnpoint == 10) {
p1._x = game.game.spawn1._x;
p1._y = game.game.spawn1._y;
f_InitPlayer(p1);
p1.platform = game.game.spawn1_platform.z_platform;
game.game.chase_cam.x = p1.x + 200;
p1.gotoAndStop("stand");
}
f_CameraPop();
target_scale = _local1;
f_ScalePop();
f_CameraPop();
}
function f_Level1_1Init() {
game.game.event1.warpto = "level1_0";
game.game.event1.warpspawn = 3;
game.game.event2.warpto = "level1_2";
game.game.event2.warpspawn = 1;
game.game.event3.warpto = "level1_3";
game.game.event3.warpspawn = 2;
game.game.event4.warpto = "level1_4";
game.game.event4.warpspawn = 1;
camera._x = p1._x;
camera._y = p1._y;
f_CameraPop();
game.game.bg2._x = game.game.bg2_lock._x;
game.game.bg2._y = game.game.bg2_lock._y;
if (!got_defense1) {
var _local1 = f_Item(game.game.pow_defense1._x, game.game.pow_defense1._y, game.game.pow_defense1._y + 1, "pow_defense", 100, 100);
_local1.tracker = "got_defense1";
}
if (spawnpoint == 1) {
p1._x = game.game.spawn1._x;
p1._y = game.game.spawn1._y;
f_InitPlayer(p1);
p1.platform = game.game.spawn1_platform.z_platform;
camera.prey = p1;
p1.gotoAndStop("stand");
f_CameraPop();
} else if (spawnpoint == 2) {
rockbreaker = 1;
camera._x = game.game.spawn2._x - 100;
camera._y = game.game.spawn2._y;
f_CameraPop();
game.game.copter_intro.gotoAndStop("blank");
game.game.copter.gotoAndStop("blank");
game.game.bridge.gotoAndStop("rubble");
game.game.bridge_lights.gotoAndStop("rubble");
game.game.bridge_platform.z_platform.removed = true;
p1._x = game.game.spawn2._x;
p1._y = game.game.spawn2._y;
f_InitPlayer(p1);
p1._xscale = p1._xscale * -1;
camera.prey = p1;
f_CameraPop();
p1.gotoAndStop("stand");
} else if (spawnpoint == 3) {
rockbreaker = 1;
camera._x = game.game.spawn3._x + 100;
camera._y = game.game.spawn3._y;
f_CameraPop();
game.game.copter_intro.gotoAndStop("blank");
game.game.copter.gotoAndStop("blank");
game.game.bridge.gotoAndStop("rubble");
game.game.bridge_lights.gotoAndStop("rubble");
game.game.bridge_platform.z_platform.removed = true;
p1._x = game.game.spawn3._x;
p1._y = game.game.spawn3._y;
f_InitPlayer(p1);
p1.platform = game.game.spawn3_platform.z_platform;
camera.prey = p1;
p1.gotoAndStop("stand");
} else if (spawnpoint == 4) {
rockbreaker = 1;
camera._x = game.game.spawn4._x - 100;
camera._y = game.game.spawn4._y;
f_CameraPop();
game.game.copter_intro.gotoAndStop("blank");
game.game.copter.gotoAndStop("blank");
game.game.bridge.gotoAndStop("rubble");
game.game.bridge_lights.gotoAndStop("rubble");
game.game.bridge_platform.z_platform.removed = true;
game.game.elevator1.y = game.game.elevator1_top._y;
game.game.elevator1._y = game.game.elevator1.y;
p1._x = game.game.spawn4._x;
p1._y = game.game.spawn4._y;
f_InitPlayer(p1);
p1._xscale = p1._xscale * -1;
camera.prey = p1;
f_CameraPop();
p1.gotoAndStop("stand");
} else if (spawnpoint == 5) {
game.game.copter_intro.gotoAndStop("blank");
game.game.copter.gotoAndStop("blank");
game.game.bridge.gotoAndStop("rubble");
game.game.bridge_lights.gotoAndStop("rubble");
game.game.bridge_platform.z_platform.removed = true;
f_InitPlayer(p1);
p1.platform = game.game.ship_platform.z_platform;
camera.prey = p1;
p1.gotoAndStop("elevator");
camera._x = p1.x + 100;
camera._y = p1.y + 200;
f_CameraPop();
} else if (spawnpoint == 10) {
game.game.copter_intro.gotoAndStop("blank");
f_InitPlayer(p1);
p1.platform = game.game.ship_platform.z_platform;
camera.prey = p1;
p1.gotoAndStop("elevator");
camera._x = p1.x + 100;
camera._y = p1.y + 200;
f_CameraPop();
}
}
function f_Level1_2Init() {
currentlevel = "level1_2";
game.game.event1.warpto = "reset";
game.game.event1.warpspawn = 1;
game.game.event2.warpto = "level1_5";
game.game.event2.warpspawn = 1;
limit_left = game.game.limit_left._x;
limit_right = game.game.limit_right._x;
limit_top = game.game.limit_top._y;
limit_bottom = game.game.limit_bottom._y;
level_texture = 3;
if (spawnpoint == 1) {
camera._x = game.game.spawn1._x + 200;
camera._y = game.game.spawn1._y;
f_CameraPop();
p1._x = game.game.spawn1._x;
p1._y = game.game.spawn1._y;
f_InitPlayer(p1);
camera.prey = p1;
f_CameraPop();
target_scale = 60;
f_ScalePop();
f_CameraPop();
p1.gotoAndStop("stand");
}
s_oceanside.s_oceanside.start(0, 500);
game.game.bg2._x = game.game.bg2_lock._x;
game.game.bg2._y = game.game.bg2_lock._y;
game.game.bg3._x = game.game.bg3_lock._x;
game.game.bg3._y = game.game.bg3_lock._y;
}
function f_Level1_3Init() {
currentlevel = "level1_3";
elevatorbreak = false;
game.game.event2.warpto = "level1_4intro";
game.game.event2.warpspawn = 1;
game.game.event2.autowalk = true;
game.game.event2.autodir = 1;
limit_left = game.game.limit_left._x;
limit_right = game.game.limit_right._x;
limit_top = game.game.limit_top._y;
limit_bottom = game.game.limit_bottom._y;
level_texture = 3;
elevator_speed = 0;
if (spawnpoint == 1) {
camera._x = game.game.spawn1._x + 200;
camera._y = game.game.spawn1._y;
f_CameraPop();
p1._x = game.game.spawn1._x;
p1._y = game.game.floor1._y;
p1.platform = game.game.floor1;
f_InitPlayer(p1);
camera.prey = p1;
f_CameraPop();
target_scale = 60;
f_ScalePop();
f_CameraPop();
p1.gotoAndStop("stand");
}
}
function f_Level1_4Init() {
currentlevel = "level1_4";
game.game.event1.warpto = "level1_4";
game.game.event1.warpspawn = 1;
limit_left = game.game.limit_left._x;
limit_right = game.game.limit_right._x;
limit_top = game.game.limit_top._y;
limit_bottom = game.game.limit_bottom._y;
level_texture = 2;
elevator_speed = 0;
if (spawnpoint == 1) {
camera._x = game.game.spawn1._x + 200;
camera._y = game.game.spawn1._y;
f_CameraPop();
p1._x = game.game.spawn1._x;
p1._y = game.game.floor1._y;
p1.x = p1._x;
p1.y = p1._y;
p1.platform = game.game.floor1;
f_InitPlayer(p1);
camera.prey = p1;
f_CameraPop();
target_scale = 100;
f_ScalePop();
f_CameraPop();
p1.wait = true;
p1.gotoAndStop("wait");
}
game.game.bg3._x = game.game.bg3_lock._x;
game.game.bg3._y = game.game.bg3_lock._y;
screenOverlay.resetParameters();
screenOverlay.overlayClip = game.game.lava;
screenOverlay.overlayParent = game.game.lava;
screenOverlay.overlayColorTransform.redMultiplier = 1.5;
screenOverlay.overlayColorTransform.alphaMultiplier = 0.6;
screenOverlay.overlayFilter = new flash.filters.BlurFilter(8, 8);
screenOverlay.overlayBlendMode = "add";
screenOverlay.recursive = true;
screenOverlay.iterations = 2;
screenOverlay.scale = 0.25;
bossScreenOverlay = new ScreenOverlay(game.game.clownbody);
bossScreenOverlay.resetParameters();
bossScreenOverlay.overlayClip = game.game.clownbody;
bossScreenOverlay.overlayColorTransform.redMultiplier = 1.5;
bossScreenOverlay.overlayColorTransform.alphaMultiplier = 0.6;
bossScreenOverlay.overlayFilter = new flash.filters.BlurFilter(8, 8);
bossScreenOverlay.overlayBlendMode = "add";
bossScreenOverlay.recursive = true;
bossScreenOverlay.iterations = 2;
bossScreenOverlay.scale = 0.25;
}
function f_Level1_5Init() {
currentlevel = "level1_5";
game.game.event1.warpto = "level1_2";
game.game.event1.warpspawn = 3;
game.game.event2.otherplay = "go";
game.game.event2.other = game.game.elevator;
limit_left = game.game.limit_left._x;
limit_right = game.game.limit_right1._x;
game.game.limit_right1.next_limit = game.game.limit_right2;
game.game.limit_right2.next_limit = game.game.limit_right3;
game.game.limit_right1.gotoAndStop("on");
limit_bottom = game.game.limit_bottom._y;
level_texture = 2;
if (spawnpoint == 1) {
camera._x = game.game.spawn1._x + 200;
camera._y = game.game.spawn1._y;
f_CameraPop();
p1._x = game.game.spawn1._x;
p1._y = game.game.spawn1._y;
f_InitPlayer(p1);
camera.prey = p1;
f_CameraPop();
target_scale = 60;
f_ScalePop();
f_CameraPop();
if (p1._xscale < 0) {
p1._xscale = p1._xscale * -1;
}
p1.gun.gun.gun.gotoAndStop(p1.gun_type);
p1.gotoAndStop("jump1_mid");
p1.body.gotoAndPlay("end");
}
}
function f_MakeGlow(buffer) {
var _local1 = screenOverlay.overlayClip.transform.concatenatedMatrix;
_local1.scale(screenOverlay.scale, screenOverlay.scale);
game.game.glow._visible = true;
game.game.glow2._visible = true;
game.game.glow3._visible = true;
game.game.glow4._visible = true;
glowBuffer.draw(screenOverlay.overlayClip, _local1, new ColorTransform(), "normal", glowBuffer.rectangle);
buffer.threshold(glowBuffer, glowBuffer.rectangle, new Point(), "!=", 16711935, 0, 16777215, false);
game.game.glow._visible = false;
game.game.glow2._visible = false;
game.game.glow3._visible = false;
game.game.glow4._visible = false;
}
function f_Level1_6Init() {
currentlevel = "level1_6";
game.game.event1.warpto = "level1_6";
game.game.event1.warpspawn = 1;
limit_left = game.game.limit_left._x;
limit_right = game.game.limit_right._x;
limit_top = game.game.limit_top._y;
limit_bottom = game.game.limit_bottom._y;
level_texture = 3;
if (spawnpoint == 1) {
camera._x = game.game.spawn1._x + 200;
camera._y = game.game.spawn1._y;
f_CameraPop();
p1._x = game.game.spawn1._x;
p1._y = game.game.spawn1._y;
f_InitPlayer(p1);
camera.prey = p1;
f_CameraPop();
target_scale = 60;
f_ScalePop();
f_CameraPop();
p1.gotoAndStop("stand");
p1.x = p1._x;
p1.y = p1._y;
p1.wait = false;
p1.autowalk_timer = 30;
p1.gotoAndStop("stand");
}
game.game.bg2._x = game.game.bg2_lock._x;
game.game.bg2._y = game.game.bg2_lock._y;
game.game.bg3._x = game.game.bg3_lock._x;
game.game.bg3._y = game.game.bg3_lock._y;
}
function f_Training() {
camera._x = game.game.chase_cam._x;
camera._y = game.game.chase_cam._y;
f_CameraPop();
p1._x = game.game.spawn1._x;
p1._y = game.game.spawn1._y;
f_InitPlayer(p1);
camera.prey = game.game.chase_cam;
f_CameraPop();
p1.gotoAndStop("stand");
}
function f_rad2deg(radian) {
return(57.2957795130823 * radian);
}
function f_GameXY() {
game_x = (game._x * u_scale) + game.game._x;
game_y = (game._y * u_scale) + game.game._y;
}
function f_CameraPop() {
do {
var u_x = game_x;
var u_y = game_y;
draw();
} while ((Math.abs(u_x - game_x) > 0.1) or (Math.abs(u_y - game_y) > 0.1));
return(undefined);
}
function f_ScalePop() {
var _local1 = target_scale - game._xscale;
f_ScreenScale(_local1);
}
function f_MoveGameX(u_speed) {
game.game._x = game.game._x + u_speed;
game.game.bg2._x = game.game.bg2._x - (u_speed * ((game._xscale / 100) * 0.6));
game.game.bg3._x = game.game.bg3._x - (u_speed * ((game._xscale / 100) * 0.9));
}
function f_MoveGameY(u_speed) {
game.game._y = game.game._y + u_speed;
if (bg2vert) {
game.game.bg2._y = game.game.bg2._y - (u_speed * ((game._xscale / 100) * 0.6));
} else {
game.game.bg2._y = game.game.bg2._y - (u_speed * (game._xscale / 100));
}
if (bg3vert) {
game.game.bg3._y = game.game.bg3._y - (u_speed * ((game._xscale / 100) * 0.9));
} else {
game.game.bg3._y = game.game.bg3._y - (u_speed * (game._xscale / 100));
}
}
function draw() {
if (camera.prey == p1) {
if ((p1._xscale > 0) or (p1.jump_speed_x > 0)) {
if (((Key.isDown(p1.b_right) and (p1.right_timer >= 15)) or (p1.jump_speed_x > 0)) or ((Key.isDown(p1.b_punch1) and (!Key.isDown(p1.b_up))) and (p1._xscale > 0))) {
camera._x = p1.x + (200 * u_scale);
} else {
camera._x = p1.x + (100 * u_scale);
camera._x = p1.x;
}
} else if (((Key.isDown(p1.b_left) and (p1.left_timer >= 15)) or (p1.jump_speed_x < 0)) or ((Key.isDown(p1.b_punch1) and (!Key.isDown(p1.b_up))) and (p1._xscale < 0))) {
camera._x = p1.x - (200 * u_scale);
} else {
camera._x = p1.x - (100 * u_scale);
camera._x = p1.x;
}
if (!p1.platform) {
camera._y = (p1.y + 70) + (p1.speed_y * 1.5);
} else if (p1.crouch and (p1.crouch_timer > 30)) {
if ((camera._y + 5) < (p1.y + 300)) {
camera._y = camera._y + 5;
} else if (camera._y < p1.y) {
camera._y = p1.y;
}
} else if (p1.platform.y_mod) {
if (p1.platform.diagonal) {
camera._y = p1.y + (p1.platform.y_mod * p1.platform_percent);
} else {
camera._y = p1.y + p1.platform.y_mod;
}
} else {
camera._y = p1.y;
}
} else if (camera.prey) {
u_point.x = 0;
u_point.y = 0;
camera.prey.localToGlobal(u_point);
camera._x = int((int(u_point.x) * u_scale) - int(game_x));
camera._y = int((int(u_point.y) * u_scale) - int(game_y));
}
if (camera._y > game.game.camera_bottom._y) {
camera._y = game.game.camera_bottom._y;
}
var _local7 = false;
var _local6 = false;
if (limit_left) {
if ((camera._x - (screenWidth / 2)) < limit_left) {
camera._x = limit_left + (screenWidth / 2);
_local7 = true;
}
}
if (limit_right) {
if ((camera._x + (screenWidth / 2)) > limit_right) {
camera._x = limit_right - (screenWidth / 2);
_local6 = true;
}
}
if (_local7 and _local6) {
camera._x = limit_left + ((limit_right - limit_left) / 2);
target_scale = (screenWidthDefault / (limit_right - limit_left)) * 100;
}
if (limit_top) {
if (camera._y < limit_top) {
camera._y = limit_top;
}
}
if (limit_bottom) {
if (camera._y > limit_bottom) {
camera._y = limit_bottom;
}
}
u_point.x = 0;
u_point.y = 0;
camera.localToGlobal(u_point);
var _local3 = u_point.x;
var _local2 = u_point.y;
var _local4 = screenWidthDefault / 2;
if (Math.abs(_local4 - _local3) > 1) {
var _local5 = 20;
if ((game._xscale - target_scale) != 0) {
_local5 = 6;
}
var _local8 = (_local4 - _local3) / _local5;
f_MoveGameX(_local8 * u_scale);
} else {
f_MoveGameX(_local4 - _local3);
}
var _local1 = screenHeightDefault - (80 * (game._xscale / 100));
if (Math.abs(_local1 - _local2) > 1) {
var _local5 = 6;
if ((game._xscale - target_scale) != 0) {
_local5 = 3;
}
var _local8 = (_local1 - _local2) / _local5;
f_MoveGameY(_local8 * u_scale);
} else {
f_MoveGameY(_local1 - _local2);
}
if (shake_x != 0) {
f_MoveGameX(shake_x);
shake_x = shake_x * -1;
if (shake_x > 0) {
shake_x--;
} else {
shake_x++;
}
}
if (shake_y != 0) {
f_MoveGameY(shake_y);
shake_y = shake_y * -1;
if (shake_y > 0) {
shake_y--;
} else {
shake_y++;
}
}
f_GameXY();
ScreenOverlay.tick();
}
function f_CameraFollowX(zone, u_temp, u_cam) {
u_cam._x = zone.x + ((u_temp.x - zone.x) / 2);
}
function f_CameraFollow(zone, u_temp, u_cam) {
u_cam.x = zone.x + ((u_temp.x - zone.x) / 2);
if (zone == p1) {
if ((zone.x + game_x) > (screenWidth - 100)) {
u_cam.x = u_cam.x + ((zone.x + game_x) - (screenWidth - 100));
} else if ((zone.x + game_x) < 100) {
u_cam.x = u_cam.x + ((zone.x + game_x) - 100);
}
}
if (zone.y > u_temp.y) {
u_cam.y = zone.y;
} else {
u_cam.y = u_temp.y;
}
u_cam._x = u_cam.x;
u_cam._y = u_cam.y;
}
function f_CameraFollow3(zone, u_temp, u_temp2, u_cam) {
if (zone.x < u_temp.x) {
var _local5 = zone;
var _local6 = u_temp;
} else {
var _local5 = u_temp;
var _local6 = zone;
}
if (u_temp2.x < _local5.x) {
var _local5 = u_temp2;
} else if (u_temp2.x > _local6.x) {
var _local6 = u_temp2;
}
u_cam.x = _local5.x + ((_local6.x - _local5.x) / 2);
if (zone.y > u_temp.y) {
u_cam.y = zone.y;
} else {
u_cam.y = u_temp.y;
}
if (u_temp2.y > u_cam.y) {
u_cam.y = u_temp2.y;
}
u_cam._x = u_cam.x;
u_cam._y = u_cam.y;
}
function f_ScaleFollow(zone, u_temp) {
var _local2 = Math.abs(zone.x - u_temp.x) + (screenWidthDefault / 2);
if (_local2 > screenWidthDefault) {
target_scale = 100 * (screenWidthDefault / _local2);
} else {
target_scale = 100;
}
_local2 = (Math.abs(zone.y - u_temp.y) + (screenHeightDefault / 2)) + 100;
if (_local2 > screenHeightDefault) {
var _local1 = 100 * (screenHeightDefault / _local2);
} else {
var _local1 = 100;
}
if (_local1 < target_scale) {
target_scale = _local1;
}
if (target_scale < 1) {
target_scale = 1;
}
}
function f_ScaleFollow3(zone, u_temp, u_temp2) {
if (zone.x < u_temp.x) {
var _local9 = zone;
var _local6 = u_temp;
} else {
var _local9 = u_temp;
var _local6 = zone;
}
if (u_temp2.x < _local9.x) {
var _local9 = u_temp2;
} else if (u_temp2.x > _local6.x) {
var _local6 = u_temp2;
}
if (zone.y > u_temp.y) {
var _local7 = zone;
var _local8 = u_temp;
} else {
var _local7 = u_temp;
var _local8 = zone;
}
if (u_temp2.y > _local7.y) {
var _local7 = u_temp2;
} else if (u_temp2.y < _local8.y) {
var _local8 = u_temp2;
}
var _local5 = Math.abs(_local9.x - _local6.x) + (screenWidthDefault / 2);
if (_local5 > screenWidthDefault) {
target_scale = 100 * (screenWidthDefault / _local5);
} else {
target_scale = 100;
}
_local5 = (Math.abs(_local8.y - _local7.y) + (screenHeightDefault / 2)) + 100;
if (_local5 > screenHeightDefault) {
var _local4 = 100 * (screenHeightDefault / _local5);
} else {
var _local4 = 100;
}
if (_local4 < target_scale) {
target_scale = _local4;
}
if (target_scale < 1) {
target_scale = 1;
}
}
function f_ScreenScale(scale_speed) {
var _local2 = camera._x + game_x;
var _local1 = camera._y + game_y;
u_point.x = 0;
u_point.y = 0;
camera.localToGlobal(u_point);
_local2 = u_point.x;
_local1 = u_point.y;
game._xscale = game._xscale + scale_speed;
game._yscale = game._yscale + scale_speed;
u_scale = 100 / game._xscale;
screenHeight = screenHeightDefault * u_scale;
screenWidth = screenWidthDefault * u_scale;
f_GameXY();
u_point.x = 0;
u_point.y = 0;
camera.localToGlobal(u_point);
var _local4 = u_point.x;
var _local3 = u_point.y;
game.game._x = game.game._x + ((_local2 - _local4) * u_scale);
game.game._y = game.game._y + ((_local1 - _local3) * u_scale);
f_GameXY();
}
function main() {
for (n in a_Events) {
var _local2 = a_Events[n];
if (Math.abs(p1.x - _local2._x) < (_local2._width / 2)) {
if (p1.y < _local2._y) {
if (p1.y > (_local2._y - _local2._height)) {
if (_local2.warpto) {
p1.wait = true;
camera.paused = true;
fader.spawnpoint = _local2.warpspawn;
fader.warpto = _local2.warpto;
fader.gotoAndPlay("fadeout");
_local2.warpto = undefined;
if (_local2.autowalk) {
if (((p1._xscale > 0) and (_local2.autodir < 0)) or ((p1._xscale < 0) and (_local2.autodir > 0))) {
p1._xscale = p1._xscale * -1;
}
p1.wait = false;
p1.autowalk_timer = 600;
if (p1.platform) {
p1.gotoAndStop("autowalk");
}
p1.gun.gun.gun.gun.gotoAndStop("idle");
_local2.autowalk = false;
}
return(undefined);
}
if (_local2.camplay) {
game.game.chase_cam.gotoAndPlay(_local2.camplay);
_local2.camplay = undefined;
} else if (_local2.respawn) {
p1._x = _local2.respawn._x;
p1._y = _local2.respawn._y;
p1.x = p1._x;
p1.y = p1._y;
p1.platform = undefined;
} else if (_local2.otherplay) {
_local2.other.gotoAndPlay(_local2.otherplay);
_local2.otherplay = undefined;
}
}
}
}
}
if (camera.paused) {
return(undefined);
}
if (slowdown_delay >= 0) {
slowdown_delay--;
if (slowdown_delay == 0) {
slowdown_timer = slowdown_timer_default;
maxF = Math.round(1000 / slowdown_timer_rate);
}
}
if (slowdown_timer >= 0) {
slowdown_timer--;
if (slowdown_timer <= 0) {
maxF = 30;
}
}
if (zombiesound_timer > 0) {
zombiesound = false;
zombiesound_timer--;
} else if (zombiesound) {
zombiesound = false;
zombiesound_timer = 90;
_root["s_zombie" + (random(4) + 1)].start(0, 0);
}
if ((game._xscale - target_scale) != 0) {
if (game._xscale < (target_scale - 2)) {
var _local3 = 2;
} else if (game._xscale > (target_scale + 2)) {
var _local3 = -2;
} else {
var _local3 = target_scale - game._xscale;
}
f_ScreenScale(_local3);
}
draw();
fp_fpsLimiter();
}
function startEngine() {
go = true;
}
function f_RemovePlayer(zone) {
f_ObjectPop(zone, a_Players);
zone.active = false;
zone.gotoAndStop("blank");
players--;
if (players == 1) {
f_GetPlayer();
}
}
function f_GetPlayer() {
for (n in a_Players) {
player = a_Players[n];
}
}
function f_PlayerPush(zone) {
a_Players.push(zone);
}
function f_EnemyPush(zone) {
a_Enemies.push(zone);
}
function f_RemoveEnemy(zone) {
zone.active = false;
f_Mosaic(zone, 0);
if (zone.z_platform) {
f_RemovePlatform(zone.z_platform);
}
if (zone.z_wall) {
f_ObjectPop(zone.z_wall, a_Walls);
}
f_ObjectPop(zone, a_Enemies);
}
function f_ObjectPush(zone, a_Array) {
a_Array.push(zone);
}
function f_ObjectPop(zone, a_Array) {
for (n in a_Array) {
if (a_Array[n] == zone) {
a_Array.splice(n, 1);
return(undefined);
}
}
}
function f_SpawnPlayer(p_num, fileName) {
u_char = game.game["p" + p_num];
loadMovie (fileName, u_char);
}
function fpsLimiter() {
newT = getTimer();
while (Math.abs(newT - oldT) < maxF) {
newT = getTimer();
}
oldT = getTimer();
}
function f_FacePrey(zone) {
if (zone.x < zone.prey.x) {
if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
} else if (zone.x > zone.prey.x) {
if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
}
}
function f_ChasePrey(zone, u_range) {
if (zone.prey.isitem) {
u_range = 0;
}
var _local3 = zone.x;
if (zone.x < (zone.prey.x - u_range)) {
f_MoveH(zone, zone.speed_x);
} else if (zone.x > (zone.prey.x + u_range)) {
f_MoveH(zone, -zone.speed_x);
}
if (zone.prey.y < (zone.y - 30)) {
if (zone.x < (zone.prey.platform.x - zone.prey.platform.w)) {
if (zone.x > ((zone.prey.platform.x - zone.prey.platform.w) - 400)) {
f_CharJump(zone);
zone.jump_speed_x = zone.speed_x * 0.7;
}
} else if (zone.x > (zone.prey.platform.x + zone.prey.platform.w)) {
if (zone.x < ((zone.prey.platform.x + zone.prey.platform.w) + 400)) {
f_CharJump(zone);
zone.jump_speed_x = (-zone.speed_x) * 0.7;
}
}
}
if (zone.platform == undefined) {
f_CharJump(zone);
if (zone.prey.y > zone.y) {
zone.speed_y = 1;
}
if (zone._xscale > 0) {
zone.jump_speed_x = zone.speed_x_min;
} else {
zone.jump_speed_x = -zone.speed_x_min;
}
} else if ((_local3 == zone.x) and ((zone.prey.y < (zone.y - 30)) or (!zone.platform.dropthru))) {
f_CharJump(zone);
if (zone._xscale > 0) {
zone.jump_speed_x = zone.speed_x;
} else {
zone.jump_speed_x = -zone.speed_x;
}
} else if (zone.prey.platform and (Math.abs(zone.x - zone.prey.x) < 100)) {
if (zone.prey.y < (zone.y - 100)) {
f_CharJump(zone);
} else if ((zone.prey.y > (zone.y + 100)) and zone.platform.dropthru) {
f_CharJump(zone);
zone.y = zone.y + 20;
zone._y = zone.y;
zone.speed_y = 1;
}
}
}
function f_ChasePreyAir(zone, target_x, target_y) {
if (zone.prey.isitem) {
x_range = 0;
y_range = 0;
}
var _local3 = false;
var _local2 = false;
if (zone.x < target_x) {
zone.fly_x = zone.fly_x + zone.fly_accel;
if (zone.fly_x > zone.fly_max) {
zone.fly_x = zone.fly_max;
}
if (zone.face_target) {
if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
}
} else if (zone.x > target_x) {
zone.fly_x = zone.fly_x - zone.fly_accel;
if (zone.fly_x < (-zone.fly_max)) {
zone.fly_x = -zone.fly_max;
}
if (zone.face_target) {
if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
}
} else {
_local3 = true;
}
f_MoveH(zone, zone.fly_x);
if (zone.y > target_y) {
if (zone.fly_y > zone.fly_max) {
zone.fly_y = zone.fly_y - (zone.fly_accel * 2);
} else {
zone.fly_y = zone.fly_y - zone.fly_accel;
}
if (zone.fly_y < (-zone.fly_max)) {
zone.fly_y = -zone.fly_max;
}
} else if (zone.y < target_y) {
if (zone.fly_y < (-zone.fly_max)) {
zone.fly_y = zone.fly_y + (zone.fly_accel * 2);
} else {
zone.fly_y = zone.fly_y + zone.fly_accel;
}
if (zone.fly_y > zone.fly_max) {
zone.fly_y = zone.fly_max;
}
} else {
_local2 = true;
}
if (f_PY(zone, zone.fly_y) == false) {
if (zone.fly_y <= 0) {
if (f_WallAbove(zone, zone.fly_y * 2) == false) {
f_MoveV(zone, zone.fly_y);
}
} else {
f_MoveV(zone, zone.fly_y);
}
}
return(_local3 and _local2);
}
function f_CharJump(zone) {
zone.jumping = true;
zone.speed_y = zone.launch;
zone.jump_speed_x = 0;
zone.punching = false;
zone.midpunch = false;
zone.platform = undefined;
zone.ladder = undefined;
zone.crouch = false;
f_ResetRotation(zone);
if (!zone.nojumpanim) {
zone.gotoAndStop("jump1");
}
}
function f_CharJumping(zone) {
if ((zone.platform == undefined) or zone.jumping) {
if (zone.float_timer > 0) {
zone.float_timer--;
} else {
if (zone.speed_y >= 0) {
if (f_PY(zone, zone.speed_y) == false) {
f_MoveV(zone, zone.speed_y);
zone.speed_y = zone.speed_y + zone.weight;
if (zone.speed_y > speed_y_max) {
zone.speed_y = speed_y_max;
}
zone.jumping = false;
if (!zone.nojumpanim) {
f_GoFrame(zone, "jump1_mid");
}
} else {
zone.punching = false;
zone.midpunch = false;
if (zone.firstland) {
zone.firstland = false;
zone.gotoAndStop("stand");
} else if (zone.landanim) {
if (zone.newspawn) {
zone.gotoAndStop("stand");
} else {
zone.gotoAndStop(zone.landanim);
}
} else if (!zone.nojumpanim) {
f_GoFrame(zone, "stand");
}
}
} else {
if (f_WallAbove(zone, zone.speed_y) == false) {
f_MoveV(zone, zone.speed_y);
}
zone.speed_y = zone.speed_y + zone.weight;
if (zone.speed_y > speed_y_max) {
zone.speed_y = speed_y_max;
}
}
if (zone.speed_y > zone.speed_y_max) {
zone.speed_y = zone.speed_y_max;
}
}
if (zone.jump_speed_x != 0) {
f_MoveH(zone, zone.jump_speed_x);
}
return(true);
}
return(false);
}
function f_HitBreakWall(zone) {
if (rockbreaker > 0) {
f_Damage(zone, zone.hit_damage_val);
if (zone.health <= 0) {
_root.f_ObjectPop(this, _root.a_Walls);
_root.f_ObjectPop(this, _root.a_Enemies);
zone.active = false;
zone.alive = false;
f_ShrapnelRock1(zone.z_wall.x + 40, zone.y - 30, zone.y + 1, (zone.force_x / 2) + random(5), zone.force_y - random(4));
f_ShrapnelRock1(zone.z_wall.x - 30, zone.y - 40, zone.y + 1, -((zone.force_x / 2) + random(5)), zone.force_y - random(4));
f_ShrapnelRock1(zone.z_wall.x + 30, zone.y - 160, zone.y + 1, (zone.force_x / 2) + random(5), zone.force_y - random(4));
f_ShrapnelRock1(zone.z_wall.x - 40, zone.y - 150, zone.y + 1, -((zone.force_x / 2) + random(5)), zone.force_y - random(4));
zone.gotoAndStop("die");
} else {
if (zone.hitby._xscale < 0) {
f_ShrapnelRock1((zone.z_wall.x + zone.z_wall.w) + 5, zone.impact_y, zone.y + 1, (zone.force_x / 2) + random(5), zone.force_y - random(4));
} else {
f_ShrapnelRock1((zone.z_wall.x - zone.z_wall.w) - 5, zone.impact_y, zone.y + 1, -((zone.force_x / 2) + random(5)), zone.force_y - random(4));
}
zone.body.gotoAndPlay("shake");
zone.body.body.nextFrame();
}
}
}
function f_InitBreakWall(zone) {
zone.health_max = 6;
zone.health = zone.health_max;
zone.attack = 0;
zone.defense = 100;
zone.fp_Hit1 = f_HitBreakWall;
zone.x = zone._x;
zone.y = zone._y;
zone.active = true;
zone.alive = true;
f_AddWall(zone, zone.z_wall);
f_AddEnemy(zone);
}
function f_HitSkylight(zone) {
zone.health--;
if (zone.health <= 0) {
i = 1;
while (i <= 6) {
var _local4 = _root.f_ShrapnelGeneral((zone.x - (zone._width / 2)) + (zone._width * (i / 6)), zone.y - 150, zone.y + 1, -15 + random(30), -(12 + random(10)), "glass");
_local4.bounce_limit = 2;
_local4.fp_ShrapnelEnd = _root.f_ShrapnelVanish;
i++;
}
game.game.building.skylight.gotoAndStop(2);
game.game.skylight.active = false;
game.game.skylight.alive = false;
s_glass1.start(0, 0);
f_RemovePlatform(game.game.skylight.z_platform);
} else {
_root.f_BulletImpactSound(this);
var _local4 = _root.f_ShrapnelGeneral(zone.hitby.x, zone.y - 150, zone.y + 1, -15 + random(30), -(12 + random(10)), "glass");
_local4.bounce_limit = 2;
_local4.fp_ShrapnelEnd = _root.f_ShrapnelVanish;
}
}
function f_HitType1(zone) {
if ((zone.hitby.x > zone.x) or (zone.hitby.force_x < 0)) {
if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
} else if ((zone.hitby.x < zone.x) or (zone.hitby.force_x > 0)) {
if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
}
zone.health = zone.health - zone.hit_damage_val;
if (zone.health <= 0) {
zone.alive = false;
zone.health = 0;
if ((zone.force_y > -10) and (zone.force_y < 5)) {
zone.force_y = -10;
}
}
if ((zone.platform == undefined) or (zone.force_y < -5)) {
f_HitToss(zone);
} else if (zone.hit_timer < 30) {
zone.hit_timer = 0;
if (zone.hit_last == 1) {
zone.hit_last = 2;
zone.gotoAndStop("hit2");
} else {
zone.hit_last = 1;
zone.gotoAndStop("hit1");
}
} else {
zone.hit_timer = 0;
zone.hit_last = 1;
zone.gotoAndStop("hit1");
}
}
function f_HitType2(zone) {
f_PixelFly((zone.x + random(50)) - 25, zone.y - 100);
f_PixelFly((zone.x + random(50)) - 25, zone.y - 75);
f_PixelFly((zone.x + random(50)) - 25, zone.y - 50);
f_Damage(zone, zone.hit_damage_val);
if (zone.hitby.x > zone.x) {
if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
} else if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
if (zone.health <= 0) {
zone.gotoAndStop("die");
return(undefined);
}
}
function f_HitTypeAir(zone) {
f_PixelFly((zone.x + random(50)) - 25, zone.y - 100);
f_PixelFly((zone.x + random(50)) - 25, zone.y - 75);
f_PixelFly((zone.x + random(50)) - 25, zone.y - 50);
f_Damage(zone, zone.hit_damage_val);
if (zone.health == 0) {
zone.gotoAndStop("die");
return(undefined);
}
if (zone.hitby._xscale > 0) {
zone.fly_x = zone.force_x;
if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
} else {
zone.fly_x = -zone.force_x;
if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
}
zone.fly_y = zone.force_y;
zone.gotoAndStop("hit1");
zone.body.gotoAndPlay(1);
}
function f_HitToss(zone) {
f_TossInit(zone, zone.force_x, zone.force_y);
}
function f_HitTossDamage(zone) {
if (zone.hitby._xscale > 0) {
f_TossInit(zone, zone.force_x, zone.force_y);
} else {
f_TossInit(zone, -zone.force_x, zone.force_y);
}
zone.body.body.nextFrame();
}
function f_HitDie(zone) {
f_Damage(zone, zone.hit_damage_val);
zone.gotoAndStop("die");
}
function f_Scout(zone) {
if (!f_CharJumping(zone)) {
if (zone.scout_timer > 0) {
zone.scout_timer--;
if (zone.scout_timer <= 0) {
zone._xscale = zone._xscale * -1;
} else {
return(undefined);
}
}
if ((((zone.x + game_x) - (zone.w * 2)) > screenWidth) and (zone._xscale > 0)) {
zone._xscale = zone._xscale * -1;
} else if ((((zone.x + game_x) + (zone.w * 2)) < 0) and (zone._xscale < 0)) {
zone._xscale = zone._xscale * -1;
}
if (zone._xscale > 0) {
if (((zone.x < p1.x) and (zone.x > (p1.x - 100))) and (Math.abs(zone.y - p1.y) < 20)) {
zone.gotoAndStop("stand");
} else if ((zone.x + zone.speed_x) > ((zone.platform.x + zone.platform.w) - 75)) {
zone.scout_timer = 30;
zone.gotoAndStop("stand");
} else {
zone.gotoAndStop("walk");
if (f_MoveH(zone, zone.speed_x) != zone.speed_x) {
zone._xscale = zone._xscale * -1;
}
}
} else if (((zone.x > p1.x) and (zone.x < (p1.x + 100))) and (Math.abs(zone.y - p1.y) < 20)) {
zone.gotoAndStop("stand");
} else if ((zone.x - zone.speed_x) < ((zone.platform.x - zone.platform.w) + 75)) {
zone.scout_timer = 30;
zone.gotoAndStop("stand");
} else {
zone.gotoAndStop("walk");
if (f_MoveH(zone, -zone.speed_x) != (-zone.speed_x)) {
zone._xscale = zone._xscale * -1;
}
}
}
}
function f_Scout2(zone) {
if (!f_CharJumping(zone)) {
if (zone.scout_timer > 0) {
zone.scout_timer--;
if (zone.scout_timer <= 0) {
if (((zone.x > p1.x) and (zone._xscale > 0)) or ((zone.x < p1.x) and (zone._xscale < 0))) {
zone._xscale = zone._xscale * -1;
} else {
zone.scout_timer = 1;
}
} else {
return(undefined);
}
}
if (zone._xscale > 0) {
if (((zone.x < p1.x) and (zone.x > (p1.x - 100))) and (Math.abs(zone.y - p1.y) < 20)) {
zone.gotoAndStop("stand");
} else if ((zone.x + zone.speed_x) > ((zone.platform.x + zone.platform.w) - 75)) {
zone.scout_timer = 30;
zone.gotoAndStop("stand");
} else {
zone.gotoAndStop("walk");
if (f_MoveH(zone, zone.speed_x) != zone.speed_x) {
zone._xscale = zone._xscale * -1;
}
}
} else if (((zone.x > p1.x) and (zone.x < (p1.x + 100))) and (Math.abs(zone.y - p1.y) < 20)) {
zone.gotoAndStop("stand");
} else if ((zone.x - zone.speed_x) < ((zone.platform.x - zone.platform.w) + 75)) {
zone.scout_timer = 30;
zone.gotoAndStop("stand");
} else {
zone.gotoAndStop("walk");
if (f_MoveH(zone, -zone.speed_x) != (-zone.speed_x)) {
zone._xscale = zone._xscale * -1;
}
}
}
}
function f_ScoutAttack(zone) {
if (!f_CharJumping(zone)) {
if (zone.scout_timer <= 0) {
if (zone._xscale > 0) {
if ((zone.x + zone.speed_x) > ((zone.platform.x + zone.platform.w) - 50)) {
zone._xscale = zone._xscale * -1;
zone.gotoAndStop("stand");
} else if (f_MoveH(zone, zone.speed_x) != zone.speed_x) {
zone._xscale = zone._xscale * -1;
zone.gotoAndStop("stand");
}
} else if ((zone.x - zone.speed_x) < ((zone.platform.x - zone.platform.w) + 50)) {
zone._xscale = zone._xscale * -1;
zone.gotoAndStop("stand");
} else if (f_MoveH(zone, -zone.speed_x) != (-zone.speed_x)) {
zone._xscale = zone._xscale * -1;
zone.gotoAndStop("stand");
}
} else {
zone.scout_timer--;
}
}
}
function f_HencherDefaults(zone) {
zone.speed_x = zone.speed_x_min;
}
function f_HencherMelee(zone) {
if (Math.abs(zone.x - p1.x) < 100) {
if (((zone.x > p1.x) and (zone._xscale < 0)) or ((zone.x < p1.x) and (zone._xscale > 0))) {
if (Math.abs(zone.y - p1.y) < 10) {
zone.skipwait = false;
if (zone.hasgun) {
zone.gun.gun.gun.gun.gotoAndStop("melee");
zone.shot_total = zone.shot_total_default;
zone.shot_timer = 0;
zone.gotoAndStop("punch1");
} else if (zone.punch_timer <= 0) {
zone.punch_timer = zone.punch_timer_default;
zone.gotoAndStop("punch1");
}
}
}
}
}
function f_FlyingHencherTarget(zone) {
if (zone.x > zone.prey.x) {
zone.target_x = zone.prey.x - (200 + random(50));
} else {
zone.target_x = zone.prey.x + (200 + random(50));
}
zone.target_y = zone.prey.prevplatformy - (150 + random(100));
}
function f_EnemyShooter(zone) {
if (!_root.f_OnScreen(zone)) {
return(undefined);
}
if (zone.hasgun) {
u_point.x = 0;
u_point.y = 0;
zone.gun.localToGlobal(u_point);
zone_x = (u_point.x * u_scale) - game_x;
zone_y = (u_point.y * u_scale) - game_y;
u_x = zone.prey.x;
u_y = zone.prey.y - 50;
var _local3 = f_rad2deg(Math.atan2(u_y - zone_y, u_x - zone_x));
if (zone._xscale < 0) {
if (_local3 < 0) {
_local3 = -(180 - Math.abs(_local3));
} else {
_local3 = 180 - _local3;
}
}
zone.gun_frame = 30 - int(Math.abs((_local3 + 106) / 212) * 29);
if (zone.shot_timer <= 0) {
if (((zone.x < zone.prey.x) and (zone._xscale < 0)) or ((zone.x > zone.prey.x) and (zone._xscale > 0))) {
zone.gun_frame = 15;
if (zone._xscale > 0) {
_local3 = 0;
} else {
_local3 = 0;
}
}
var _local6 = Math.abs(zone.gun._currentframe - zone.gun_frame);
var _local7 = Math.abs(zone.gun.gun._rotation - _local3);
if (_local6 < _local7) {
var _local5 = 4 * (_local6 / _local7);
var _local4 = 4;
} else {
var _local5 = 4;
var _local4 = 4 * (_local7 / _local6);
}
if (zone.gun._currentframe < (zone.gun_frame - _local5)) {
zone.gun.gotoAndStop(zone.gun._currentframe + int(_local5));
} else if (zone.gun._currentframe > (zone.gun_frame + _local5)) {
zone.gun.gotoAndStop(zone.gun._currentframe - int(_local5));
}
if (zone.gun.gun._rotation < (_local3 - _local4)) {
zone.gun.gun._rotation = zone.gun.gun._rotation + _local4;
} else if (zone.gun.gun._rotation > (_local3 + _local4)) {
zone.gun.gun._rotation = zone.gun.gun._rotation - _local4;
} else {
var _local8 = false;
if (((zone.x < zone.prey.x) and (zone._xscale > 0)) or ((zone.x > zone.prey.x) and (zone._xscale < 0))) {
if ((Math.abs(zone.y - zone.prey.y) < zone.shot_range_y) or (Math.abs(zone.x - zone.prey.x) < zone.shot_range_x)) {
zone.gun.gun._rotation = _local3;
zone.gun.gotoAndStop(zone.gun_frame);
zone.punching = true;
zone.gotoAndStop("stand");
f_EnemyBullet(zone);
zone.gun.gun.gun.gun.gotoAndStop("shoot");
zone.shot_total--;
if (zone.shot_total > 0) {
zone.skipwait = true;
zone.shot_timer = 3;
_local8 = true;
}
}
}
if (!_local8) {
zone.gun.gun.gun.gun.gotoAndStop("idle");
zone.shot_total = zone.shot_total_default;
zone.shot_timer = 90;
zone.punching = false;
}
}
} else {
zone.shot_timer--;
}
zone.gun.gun._x = zone.gun.gun_pt._x;
zone.gun.gun._y = zone.gun.gun_pt._y;
}
}
function f_Hencher(zone) {
zone.punch_timer--;
if (!f_CharJumping(zone)) {
if (zone.wait or (zone.wait_timer > 0)) {
zone.wait_timer--;
zone.gotoAndStop("stand");
return(undefined);
}
if (zone.phase == 1) {
if (zone.hasgun) {
f_Scout(zone);
f_HencherMelee(zone);
} else {
f_FacePrey(zone);
if ((!f_InRange(zone, 80, 5000)) or ((Math.abs(zone.y - zone.prey.y) > 20) and zone.prey.platform)) {
zone.speed_x = zone.speed_x_max;
zone.gotoAndStop("run");
f_ChasePrey(zone, 80);
} else {
f_HencherMelee(zone);
}
}
} else if (zone.phase == 2) {
if (zone.attack_timer <= 0) {
zone.attack_timer = 60;
zone.wait_timer = 30;
zone.gotoAndStop("razorball");
} else {
zone.attack_timer--;
}
} else if (zone.phase == 3) {
if (f_OnScreen(zone)) {
f_EnemyShooter(zone);
if (!zone.punching) {
f_Scout2(zone);
}
}
} else if (zone.phase == 10) {
f_EnemyShooter(zone);
if (!zone.punching) {
f_Scout(zone);
f_HencherMelee(zone);
}
} else if (zone.phase == 11) {
zone.gotoAndStop("weld");
} else if (zone.phase == 12) {
zone.prey = game.game.target_pt;
zone.rapidfire++;
if (zone.rapidfire < 100) {
zone.shot_total = 2;
if ((zone.rapidfire % 3) == 0) {
zone.shot_timer = 0;
}
} else if (zone.rapidfire > 200) {
zone.rapidfire = 0;
} else {
zone.shot_total = 0;
zone.shot_timer = 1000;
zone.gun.gun.gun.gun.gotoAndStop("idle");
}
f_EnemyShooter(zone);
}
}
}
function f_GasoHit(zone) {
f_CharJumping(zone);
}
function f_EnemyDefaults(zone) {
zone.x = zone._x;
zone.y = zone._y;
if (!zone.nodepth) {
zone.depth_mod = f_SetDepthMod();
f_Depth(zone, zone.y);
}
zone.speed_x = 6;
zone.speed_y = 0;
zone.speed_y_max = speed_y_max;
zone.jump_speed_x = 0;
zone.speed_ladder = 8;
zone.launch = -38;
zone.weight = 1.75;
zone.bounce = 0.5;
zone.force_x = 0;
zone.force_y = 0;
zone.w = zone._width / 2;
zone.h = zone._height;
zone.fp_HitGround = f_HitGround1;
zone.w2 = 2;
zone.platform = undefined;
zone.ladder = undefined;
zone.punching = false;
zone.active = true;
zone.alive = true;
zone.float_timer = 0;
zone.texture = 4;
zone.prey = p1;
}
function f_InitGaso(zone) {
zone.fp_Hit1 = f_HitType1;
f_EnemyDefaults(zone);
zone.fp_HitGround = f_HitGround2;
zone.health_max = 50;
zone.health = zone.health_max;
zone.attack = 55;
zone.defense = 40;
f_AddEnemy(zone);
f_AddEnemyPush(zone);
}
function f_InitHencher(zone) {
zone.fp_Hit1 = f_HitType1;
f_EnemyDefaults(zone);
zone.fp_HitGround = f_HitGround1;
zone.health_max = 600;
zone.health = zone.health_max;
zone.bullet_type = "bullet2";
zone.attack = 55;
zone.defense = 40;
zone.damage_val = zone.attack;
zone.bloodtype = 1;
zone.fly_x = 0;
zone.fly_y = 0;
zone.fly_max = 5 + random(3);
zone.fly_accel = 0.5 + (random(20) / 100);
zone.x_range = 50 + random(60);
zone.y_range = 6 + random(60);
zone.attack_timer = 30;
zone.landanim = "land";
zone.w2 = 20;
zone.punch_timer_default = 60;
zone.punch_timer = 0;
zone.wait_timer = 0;
zone.newspawn = true;
if (zone.gun_type > 0) {
zone.hasgun = true;
if (zone.shot_range_y == undefined) {
zone.shot_range_y = 70;
zone.shot_range_x = 50;
}
if (zone.shot_timer == undefined) {
zone.shot_timer = 90;
}
if (zone.shot_total_default == undefined) {
zone.shot_total_default = 3;
}
zone.shot_total = zone.shot_total_default;
zone.gun.gun._rotation = 0;
zone.gun.gotoAndStop(15);
} else {
zone.gun_type = 100;
}
if (zone.phase == 2) {
zone.speed_x = 30;
zone.speed_x_min = 30;
zone.force_x = 10;
zone.force_y = -20;
} else {
zone.speed_x_max = 12;
zone.speed_x_min = 5;
zone.speed_x = 5;
}
if (zone.phase == 4) {
zone.thruster_type = 2;
} else {
zone.thruster_type = 1;
}
}
function f_InitWarrior(zone) {
zone.fp_Hit1 = f_HitWarrior;
zone.health_max = 100;
zone.health = zone.health_max;
zone.bullet_type = "bullet3";
zone.attack = 0;
zone.defense = 40;
zone.damage_val = zone.attack;
f_AddEnemy(zone);
}
function f_MonkeyIdle(zone) {
zone.climb_timer--;
if (zone.climb_timer <= 0) {
zone.climb_timer = 20;
zone.gotoAndStop("climb");
} else if (zone.climb_timer == 10) {
zone.force_x = -10;
zone.force_y = 10;
f_Shoot(zone.bullet);
}
}
function f_MonkeyClimb(zone) {
zone.climb_timer--;
if (zone.climb_timer <= 0) {
zone.climb_timer = 30;
zone.speed_y = zone.speed_y * -1;
zone.gotoAndStop("stand");
} else {
zone.y = zone.y + zone.speed_y;
zone._y = zone.y;
}
}
function f_InitMonkey(zone) {
zone.fp_Hit1 = f_HitDie;
f_EnemyDefaults(zone);
zone.health_max = 1;
zone.health = zone.health_max;
zone.bullet_type = "bullet1";
zone.attack = 55;
zone.defense = 30;
zone.damage_val = zone.attack;
zone.speed_y = -3;
zone.climb_timer = 1;
f_AddEnemy(zone);
}
function f_Pirhana(zone) {
var _local2 = zone.x;
if (zone._xscale > 0) {
f_MoveH(zone, zone.speed_x);
} else {
f_MoveH(zone, -zone.speed_x);
}
if (zone.x == _local2) {
zone._xscale = zone._xscale * -1;
}
}
function f_InitPirhana(zone) {
zone.fp_Hit1 = f_HitDie;
zone.health_max = 1;
zone.health = zone.health_max;
zone.attack = 55;
zone.defense = 30;
zone.damage_val = zone.attack;
zone.force_y = -10;
zone.speed_x = 10;
f_AddEnemy(zone);
}
function f_BeeWithdraw(zone) {
zone.timer--;
if (zone.timer <= 0) {
zone.fly_y = 40;
if (zone._xscale > 0) {
zone.fly_x = zone.temp_speed * 2;
} else {
zone.fly_x = (-zone.temp_speed) * 2;
}
zone.force_x = 8;
zone.force_y = 20;
zone.damage_val = zone.attack;
zone.gotoAndStop("sting");
} else {
f_MoveV(zone, zone.fly_y);
zone.fly_y++;
if (zone.fly_y > 0) {
zone.fly_y = 0;
}
f_MoveH(zone, zone.fly_x);
if (zone.fly_x > 0) {
zone.fly_x--;
if (zone.fly_x < 0) {
zone.fly_x = 0;
}
} else {
zone.fly_x++;
if (zone.fly_x > 0) {
zone.fly_x = 0;
}
}
}
}
function f_BeeSting(zone) {
f_MoveV(zone, zone.fly_y);
zone.fly_y = zone.fly_y - 4;
if (zone.fly_y < 0) {
zone.fly_y = 0;
zone.fly_x = 0;
zone.gotoAndStop("stand");
return(undefined);
}
f_MoveH(zone, zone.fly_x);
if (zone.fly_x > 0) {
zone.fly_x = zone.fly_x - 4;
if (zone.fly_x < 0) {
zone.fly_x = 0;
}
} else {
zone.fly_x = zone.fly_x + 4;
if (zone.fly_x > 0) {
zone.fly_x = 0;
}
}
}
function f_Bee(zone) {
zone.attack_timer--;
if (zone.x < zone.prey.x) {
var _local3 = zone.prey.x - zone.x_range;
} else {
var _local3 = zone.prey.x + zone.x_range;
}
if (zone.y < zone.prey.y) {
var _local2 = (zone.prey.y - (zone.prey.h / 2)) - zone.y_range;
} else {
var _local2 = (zone.prey.y - (zone.prey.h / 2)) + zone.y_range;
}
f_ChasePreyAir(zone, _local3, _local2);
if (Math.abs(zone.x - zone.prey.x) < zone.x_range) {
if (Math.abs(zone.y - (zone.prey.y - (zone.prey.h / 2))) < zone.y_range) {
if (zone.attack_timer <= 0) {
zone.attack_timer = 60 + random(60);
zone.timer = 22;
zone.fly_y = -20;
zone.temp_speed = 13 + random(10);
if (zone._xscale > 0) {
zone.fly_x = -zone.temp_speed;
} else {
zone.fly_x = zone.temp_speed;
}
zone.gotoAndStop("withdraw");
}
}
}
}
function f_InitBee(zone) {
zone.fp_Hit1 = f_HitTypeAir;
f_EnemyDefaults(zone);
zone.fly_x = 0;
zone.fly_y = 0;
zone.fly_max = 5 + random(3);
zone.fly_accel = 0.5 + (random(20) / 100);
zone.x_range = 30 + random(30);
zone.y_range = 6 + random(5);
zone.prey = p1;
zone.face_target = true;
zone.attack_timer = 60;
zone.weight = 0;
zone.health_max = 20;
zone.health = zone.health_max;
zone.attack = 55;
zone.defense = 45;
zone.climb_timer = 1;
f_AddEnemy(zone);
f_AddEnemyPush(zone);
}
function f_LadybugAttack(zone) {
if (zone._xscale > 0) {
zone.x = zone.x + zone.speed_x;
if ((zone.x + game_x) > (screenWidth + 100)) {
zone.gotoAndStop("remove");
return(undefined);
}
} else {
zone.x = zone.x - zone.speed_x;
if ((zone.x + game_x) < -100) {
zone.gotoAndStop("remove");
return(undefined);
}
}
zone._x = zone.x;
zone.speed_x++;
if (zone.speed_x > 14) {
zone.speed_x = 14;
}
}
function f_LadybugDrop(zone) {
f_FacePrey(zone);
if (zone.y < (zone.prey.y - 70)) {
zone.y = zone.y + zone.speed_y;
zone._y = zone.y;
} else {
zone.force_x = 8;
zone.force_y = -20;
zone.gotoAndStop("attack");
}
}
function f_LadybugBomb(zone) {
var _local2 = 1;
while (_local2 <= 2) {
var _local1 = game.game["bomb" + _local2];
if (!_local1.active) {
_local1.active = true;
_local1.x = zone.x;
_local1._x = _local1.x;
_local1.y = zone.y + 30;
_local1._y = _local1.y;
f_InitBomb(_local1);
_local1.bounce_limit = 0;
_local1.weight = 1;
_local1.damage_val = 56;
f_TossInit(_local1, 0, 0);
return(undefined);
}
_local2++;
}
}
function f_LadybugTarget(zone) {
if (zone.x > zone.prey.x) {
zone.target_x = zone.prey.x - (75 + random(200));
} else {
zone.target_x = zone.prey.x + (75 + random(200));
}
zone.target_y = zone.prey.prevplatformy - (150 + random(200));
}
function f_LadybugBomber(zone) {
if (zone.health <= 0) {
zone.gotoAndStop("die");
return(undefined);
}
zone.attack_timer--;
var _local2 = zone.x;
if (zone.x < zone.target_x) {
f_ChasePreyAir(zone, zone.target_x, zone.target_y);
if ((zone.x > zone.target_x) or (zone.x == _local2)) {
if (zone.attack_timer <= 0) {
zone.attack_timer = 30;
f_LadybugBomb(zone);
}
f_LadybugTarget(zone);
}
} else {
f_ChasePreyAir(zone, zone.target_x, zone.target_y);
if ((zone.x < zone.target_x) or (zone.x == _local2)) {
if (zone.attack_timer <= 0) {
zone.attack_timer = 30;
f_LadybugBomb(zone);
}
f_LadybugTarget(zone);
}
}
}
function f_InitLadybug(zone) {
zone.fp_Hit1 = f_HitDie;
f_EnemyDefaults(zone);
zone.health_max = 1;
zone.health = zone.health_max;
zone.fly_x = 0;
zone.fly_y = 0;
zone.fly_max = 6 + random(2);
zone.fly_accel = 0.5 + (random(20) / 100);
zone.prey = p1;
zone.attack_timer = 30;
zone.face_target = true;
f_LadybugTarget(zone);
zone.attack = 55;
zone.defense = 30;
zone.damage_val = zone.attack;
zone.speed_y = 20;
zone.speed_x = 0;
f_AddEnemy(zone);
}
function f_HitRabbit(zone) {
f_PixelFly((zone.x + random(50)) - 25, zone.y - 100);
f_PixelFly((zone.x + random(50)) - 25, zone.y - 75);
f_PixelFly((zone.x + random(50)) - 25, zone.y - 50);
f_Damage(zone, zone.hit_damage_val);
if (zone.health <= 0) {
zone.gotoAndStop("die");
return(undefined);
}
if (zone.platform and (zone.force_y < -5)) {
f_CharJump(zone);
zone.speed_y = zone.force_y;
if (zone.hitby.x < zone.x) {
zone.jump_speed_x = zone.force_x;
} else {
zone.jump_speed_x = -zone.force_x;
}
} else {
if (zone.hitby.x > zone.x) {
if (zone.jump_speed_x > 0) {
zone.jump_speed_x = zone.jump_speed_x * -1;
}
} else if (zone.jump_speed_x < 0) {
zone.jump_speed_x = zone.jump_speed_x * -1;
}
zone.speed_y = zone.force_y;
if (zone.speed_y > -12) {
zone.speed_y = -12;
}
}
}
function f_InitRabbit(zone) {
zone.fp_Hit1 = f_HitRabbit;
zone.health_max = 20;
zone.health = zone.health_max;
zone.prey = p1;
f_FacePrey(zone);
zone.jump_timer = 0;
zone.attack = 55;
zone.defense = 48;
zone.damage_val = zone.attack;
zone.landanim = "land";
zone.speed_y = 0;
zone.speed_x = 5;
zone.launch = -24;
f_AddEnemy(zone);
f_AddEnemyPush(zone);
}
function f_Rabbit(zone) {
if (!f_CharJumping(zone)) {
if (zone.wait) {
zone.gotoAndStop("stand");
} else {
f_FacePrey(zone);
zone.jump_timer--;
if (zone.jump_timer <= 0) {
zone.jump_timer = 30;
zone.force_x = 10;
zone.force_y = 0;
f_CharJump(zone);
if (zone._xscale > 0) {
zone.jump_speed_x = 10;
} else {
zone.jump_speed_x = -10;
}
} else {
f_ForceSlideBack(zone);
}
}
} else {
zone.force_x = 10;
zone.force_y = 0;
}
}
function f_TossedBombHit(zone) {
if (zone.hitby) {
for (n in a_Enemies) {
var _local1 = a_Enemies[n];
if (_local1.alive) {
if (zone.y < _local1.y) {
if (zone.y > (_local1.y - _local1.h)) {
if (zone.x > (_local1.x - _local1.w)) {
if (zone.x < (_local1.x + _local1.w)) {
zone.alive = false;
zone.force_x = 10 + random(5);
zone.force_y = -(15 + random(10));
zone.hitall = true;
zone.gotoAndStop("explode");
return(undefined);
}
}
}
}
}
}
}
}
function f_InitBomb(zone) {
zone.w2 = 2;
zone.speed_x = 12;
zone.weight = 1.5;
zone.bounce = 0.6;
zone.bounce_limit = 1;
zone.health_max = 100;
zone.health = zone.health_max;
zone.attack = 65;
zone.defense = 100;
zone.damage_val = zone.attack;
f_InitGeneral(zone);
zone.fp_Hit1 = f_HitToss;
zone.fp_HitGround = f_HitGround2;
f_AddEnemy(zone);
}
function f_PushOut(zone) {
if (Math.abs(p1.x - zone.x) < zone.w) {
if ((p1.y - p1.h) <= zone.y) {
if (p1.y >= (zone.y - zone.h)) {
if (p1.x > zone.x) {
f_MoveH(p1, (zone.x + zone.w) - p1.x);
} else {
f_MoveH(p1, (zone.x - zone.w) - p1.x);
}
}
}
}
}
function f_BigBot(zone) {
zone.jump_timer--;
zone.attack_timer--;
f_FacePrey(zone);
f_PushOut(zone);
if (zone.jump_timer <= 0) {
zone.jump_timer = 100;
f_CharJump(zone);
if (zone._xscale > 0) {
if (zone.x < (zone.default_x + 400)) {
if (((Math.abs(zone.x - zone.prey.x) < 300) or (Math.abs(zone.x - zone.prey.x) > 400)) and (zone.x < (zone.default_x + 300))) {
zone.jump_speed_x = 18;
} else {
zone.jump_speed_x = 9;
}
} else {
zone.jump_speed_x = -15;
}
} else if (zone.x > (zone.default_x - 400)) {
if (((Math.abs(zone.x - zone.prey.x) < 300) or (Math.abs(zone.x - zone.prey.x) > 400)) and (zone.x > (zone.default_x - 300))) {
zone.jump_speed_x = -18;
} else {
zone.jump_speed_x = -9;
}
} else {
zone.jump_speed_x = 15;
}
return(undefined);
}
if (zone.attack_timer <= 0) {
zone.attack_timer = 100;
zone.gotoAndStop("uppercut");
}
}
function f_BigBotParry(zone) {
zone.slide_x = 0;
zone.force_x = 20;
zone.gotoAndStop("land");
}
function f_InitBigBot(zone) {
zone.fp_Hit1 = f_HitType2;
zone.health_max = 16;
zone.health = zone.health_max;
zone.prey = p1;
zone.fp_Parry = f_BigBotParry;
zone.attack_timer = 100;
zone.jump_timer = 150;
zone.attack = 55;
zone.defense = 56;
zone.damage_val = zone.attack;
zone.landanim = "land";
zone.speed_y = 0;
zone.speed_x = 0;
zone.slide_x = 0;
zone.slide_y = 0;
zone.launch = -24;
f_AddEnemy(zone);
}
function f_HitFister(zone) {
f_PixelFly((zone.x + random(50)) - 25, zone.y - 100);
f_PixelFly((zone.x + random(50)) - 25, zone.y - 75);
f_PixelFly((zone.x + random(50)) - 25, zone.y - 50);
if (zone.gliding) {
if (zone.glide_speed != 0) {
if (zone._xscale > 0) {
if (zone.hitby._xscale < 0) {
zone.glide_speed = -10;
}
} else if (zone.hitby._xscale > 0) {
zone.glide_speed = 10;
}
}
} else if (zone.platform == undefined) {
if (!zone.blocking) {
zone.juggles++;
if (zone.juggles > 1) {
zone.blocking = true;
zone.gotoAndStop("airblock");
} else {
f_Damage(zone, zone.hitby.damage_val);
f_HitToss(zone);
}
}
} else if (((zone.hitby._xscale > 0) and (zone._xscale < 0)) or ((zone.hitby._xscale < 0) and (zone._xscale > 0))) {
if (!zone.punching) {
zone.gotoAndStop("block");
zone.body.gotoAndPlay(1);
}
} else {
zone.knockdowns++;
f_Damage(zone, zone.hitby.damage_val);
if (zone.health <= (zone.health_max / 2)) {
if (!missile_cinema) {
missile_cinema = true;
missiles.gotoAndPlay("go");
}
}
zone.punching = false;
if (zone.force_y > -10) {
zone.force_y = -10;
}
zone.juggles = 0;
f_HitToss(zone);
}
}
function f_InitFister(zone) {
zone.fp_Hit1 = f_HitFister;
f_EnemyDefaults(zone);
zone.speed_x = 10;
zone.weight = 1.5;
zone.bounce = 0.6;
zone.bounce_limit = 1;
zone.punch_num = 1;
zone.juggles = 0;
zone.attack = 55;
zone.defense = 45;
zone.damage_val = zone.attack;
zone.health_max = 100;
zone.health = zone.health_max;
zone.invincible_timer = 5;
zone.knockdowns = 0;
zone.fp_Soul = f_SoulRockBreaker;
f_AddEnemy(zone);
f_AddEnemyPush(zone);
zone.x = game.game.copter._x;
zone._x = zone.x;
zone.y = game.game.copter._y;
zone._y = zone.y;
game.game.chronic_cam.gotoAndStop(2);
f_TossInit(zone, random(8) - 4, -(12 + random(5)));
}
function f_FisterIdle(zone) {
f_FacePrey(zone);
zone.nohit = false;
zone.gliding = false;
if (zone.health <= 0) {
zone.alive = false;
zone.gotoAndStop("die");
return(undefined);
}
if (zone.knockdowns > 1) {
zone.knockdowns = 0;
zone.glide_speed = 0;
if (zone.health < (zone.health_max * 0.25)) {
zone.glide_count = 3;
} else if (zone.health < (zone.health_x * 0.5)) {
zone.glide_count = 2;
} else {
zone.glide_count = 1;
}
zone.gliding = true;
zone.gotoAndStop("glide_start");
} else if (zone.prey.hitby == zone) {
zone.prey.hitby = undefined;
zone.body.gotoAndStop("laugh");
} else {
zone.body.gotoAndStop("serious");
}
}
function f_Fister(zone) {
if (!f_CharJumping(zone)) {
f_FacePrey(zone);
if (Math.abs(zone.x - zone.prey.x) < 100) {
if (zone.prey.platform) {
if (zone.punch_num == 1) {
zone.punch_num = 2;
zone.gotoAndStop("punch1");
} else {
zone.punch_num = 1;
zone.gotoAndStop("punch2");
}
} else {
zone.gotoAndStop("lookup");
}
} else {
f_ChasePrey(zone, 80);
zone.gotoAndStop("walk");
}
}
}
function f_FisterGlideTurn(zone) {
zone.glide_speed = 0;
zone.glide_count--;
if (zone.glide_count > 0) {
zone.gotoAndStop("glide_turn");
} else {
zone.gliding = false;
zone.gotoAndStop("stand");
}
}
function f_FisterGlide(zone) {
if ((Math.abs(zone.x - p1.x) < 50) and (Math.abs(zone.y - p1.y) < 10)) {
zone.gliding = false;
p1.gotoAndStop("hide");
zone.gotoAndStop("asspunch");
} else if (zone._xscale > 0) {
if ((((zone.x + game_x) + zone.glide_speed) > screenWidth) or ((zone.glide_speed != 0) and (f_MoveH(zone, zone.glide_speed) == 0))) {
f_FisterGlideTurn(zone);
}
zone.glide_speed++;
} else {
if ((((zone.x + game_x) - zone.glide_speed) < 0) or ((zone.glide_speed != 0) and (f_MoveH(zone, zone.glide_speed) == 0))) {
f_FisterGlideTurn(zone);
}
zone.glide_speed--;
}
}
function f_ChronicCopterWait(zone) {
if ((zone._x + game_x) < 320) {
f_ChronicCopterInit(zone);
}
}
function f_ChronicCopterInit(zone) {
chronic_cam = game.game.chronic_cam;
chronic_cam._x = p1.x;
camera.prey = chronic_cam;
target_scale = 80;
zone.phase = 1;
zone.health_max = 1;
zone.health = zone.health_max;
zone.attack = 60;
zone.defense = 50;
zone.speed_x = 1;
zone.speed_x_max = 12;
zone.speed_y = 6;
zone.prey = p1;
limit_left = game.game.chronic_left._x;
limit_right = game.game.chronic_right._x;
game.game.fisterwall_left.gotoAndStop("add");
game.game.fisterwall_right.gotoAndStop("add");
zone._x = 1000 - game_x;
zone._y = -200 - game_y;
zone.x = zone._x;
zone.y = zone._y;
zone.gotoAndStop("idle");
}
function f_BridgeExplode() {
game.game.chronic_cam.gotoAndStop(1);
camera.prey = p1;
target_scale = 100;
f_RemovePlatform(game.game.bridge_platform.z_platform);
game.game.fisterwall_left.gotoAndStop("remove");
game.game.fisterwall_right.gotoAndStop("remove");
game.game.fister.gotoAndStop("jump1_mid");
p1.gotoAndStop("jump1_mid");
game.game.bridge.gotoAndPlay("explode");
game.game.bridge_lights.gotoAndPlay("explode");
}
function f_ChronicCopterExit(zone) {
zone.phase = 4;
target_scale = 100;
f_InitFister(game.game.fister);
}
function f_ChronicCopterBombHit(zone) {
if (zone.hitby) {
if (zone.y < game.game.copter.y) {
if (zone.x > (game.game.copter.x - (game.game.copter._width / 2))) {
if (zone.x < (game.game.copter.x + (game.game.copter._width / 2))) {
game.game.copter.health--;
if (game.game.copter.health <= 0) {
f_ChronicCopterExit(game.game.copter);
}
zone.gotoAndStop("stand");
}
}
}
}
}
function f_ChronicCopterBomb(zone) {
var _local2 = 1;
while (_local2 <= 2) {
var _local1 = game.game["bomb" + _local2];
if (!_local1.active) {
_local1.active = true;
_local1.x = zone.x;
_local1._x = _local1.x;
_local1.y = zone.y;
_local1._y = _local1.y;
f_InitBomb(_local1);
f_TossInit(_local1, random(8) - 4, -(12 + random(5)));
return(undefined);
}
_local2++;
}
}
function f_ChronicCopterChase(zone) {
if (zone.x < (zone.prey.x - 30)) {
zone.speed_x++;
} else if (zone.x > (zone.prey.x + 30)) {
zone.speed_x--;
} else if (zone.speed_x > 0) {
zone.speed_x--;
} else if (zone.speed_x < 0) {
zone.speed_x++;
}
if (zone.speed_x > zone.speed_x_max) {
zone.speed_x = zone.speed_x_max;
} else if (zone.speed_x < (-zone.speed_x_max)) {
zone.speed_x = -zone.speed_x_max;
}
zone.body._rotation = zone.speed_x;
zone.x = zone.x + zone.speed_x;
zone._x = zone.x;
}
function f_ChronicCopterBop(zone) {
if (zone.down) {
zone.speed_y = zone.speed_y + 0.2;
zone.y = zone.y + zone.speed_y;
if (zone.speed_y > 2) {
zone.down = false;
}
} else {
zone.speed_y = zone.speed_y - 0.2;
zone.y = zone.y + zone.speed_y;
if (zone.speed_y < -2) {
zone.down = true;
}
}
zone.y = zone.y + zone.speed_y;
zone._y = zone.y;
}
function f_ChronicCopter(zone) {
chronic_cam._x = p1.x;
switch (zone.phase) {
case 1 :
f_ChronicCopterChase(zone);
if ((zone.y + game_y) < 250) {
zone.y = zone.y + zone.speed_y;
zone._y = zone.y;
} else {
zone.bomb_timer = 1;
zone.y_default = zone.y;
zone.speed_y = 1;
zone.down = true;
zone.phase = 2;
}
break;
case 2 :
f_ChronicCopterBop(zone);
zone.bomb_timer--;
if (zone.bomb_timer <= 0) {
zone.bomb_timer = 60;
f_ChronicCopterBomb(zone);
}
f_ChronicCopterChase(zone);
break;
case 3 :
f_ChronicCopterBop(zone);
break;
case 4 :
zone.speed_x--;
zone.x = zone.x + zone.speed_x;
zone._x = zone.x;
if ((zone.x + game_x) < -500) {
zone.gotoAndStop("blank");
}
break;
default :
trace("Error");
}
}
function f_OnScreen(zone) {
if ((zone.x + game_x) < (screenWidth + (zone.w * 2))) {
if ((zone.x + game_x) > ((-zone.w) * 2)) {
if ((zone.y + game_y) > -10) {
if ((zone.y + game_y) < ((screenHeight + zone.h) + 10)) {
return(true);
}
}
}
}
return(false);
}
function f_OnScreenActivate(zone) {
if (f_OnScreen(zone)) {
zone.gotoAndStop("activate");
}
}
function f_InitChronic(zone) {
zone.fp_Hit1 = f_HitType1;
f_EnemyDefaults(zone);
zone.speed_x = 10;
zone.speed_x_min = 10;
zone.speed_dash_x = 20;
zone.speed_turbo_x = 40;
zone.weight = 1.5;
zone.bounce = 0.6;
zone.bounce_limit = 1;
zone.punch_num = 1;
zone.phase = 3;
zone.health_max = 100;
zone.health_max = 1;
zone.health = zone.health_max;
zone.attack = 55;
zone.defense = 50;
zone.knockdowns = 0;
zone.fp_Soul = f_SoulChronicDash;
zone.hitall = true;
zone.picksup = true;
f_AddEnemy(zone);
f_AddEnemyPush(zone);
chronic = zone;
zone.x = zone._x;
zone._x = zone.x;
zone.y = zone._y;
zone._y = zone.y;
zone.gotoAndStop("stand");
}
function f_Chronic(zone) {
if (zone.health <= 0) {
zone.alive = false;
zone.gotoAndStop("die");
return(undefined);
}
if (!zone.prey.active) {
zone.prey = p1;
}
if (zone.dash_timer > 0) {
zone.dash_timer--;
}
if (zone.slap_timer > 0) {
zone.slap_timer--;
}
if (zone.laser_timer > 0) {
zone.laser_timer--;
}
switch (zone.phase) {
case 1 :
if (!f_CharJumping(zone)) {
f_FacePrey(zone);
f_ChasePrey(zone, 80);
zone.gotoAndStop("walk");
}
break;
case 2 :
zone.running = true;
zone.turbo = true;
f_ChronicRoam(zone);
break;
case 3 :
if ((zone.prey.y >= (zone.y - 200)) and (zone.prey.y <= (zone.y + 100))) {
if ((zone.dash_timer <= 0) and (zone.prey == p1)) {
if (Math.abs(zone.y - zone.prey.y) < 10) {
if (Math.abs(zone.x - zone.prey.x) < 100) {
zone.speed_y = 0;
zone.slide_x = 40;
zone.slide_y = 0;
zone.dash_timer = 30;
zone.dashing = true;
zone.gotoAndStop("dash");
return(undefined);
}
}
} else if ((zone.slap_timer <= 0) and (zone.prey == p1)) {
if (Math.abs(zone.y - zone.prey.y) < 10) {
if (Math.abs(zone.x - zone.prey.x) < 200) {
zone.slap_timer = 45;
zone.platform = undefined;
zone.jumping = true;
zone.speed_y = -10;
if (zone._xscale > 0) {
zone.jump_speed_x = 20;
} else {
zone.jump_speed_x = -20;
}
zone.punching = false;
zone.midpunch = false;
zone.crouch = false;
zone.punch_type = 1;
zone.force_x = 20;
zone.force_y = -15;
zone.gotoAndStop("slap");
return(undefined);
}
}
}
f_ChronicCrateAttack(zone);
} else {
if (zone.prey.y < zone.y) {
zone.up = true;
} else {
zone.up = false;
}
zone.running = true;
f_ChronicRoam(zone);
}
break;
case 4 :
f_CrackOut(zone);
break;
default :
trace("Error");
}
}
function f_ChronicCrateAttack(zone) {
if (!f_CharJumping(zone)) {
f_FacePrey(zone);
f_ChasePrey(zone, 80);
var _local3 = 1;
while (_local3 <= 4) {
var _local2 = game.game["crate" + _local3];
if (_local2.active) {
if (Math.abs(_local2.y - zone.y) < 10) {
if (zone._xscale > 0) {
if ((zone.x < _local2.x) and (zone.x > (_local2.x - 160))) {
zone.gotoAndStop("shove");
return(undefined);
}
} else if ((zone.x > _local2.x) and (zone.x < (_local2.x + 160))) {
zone.gotoAndStop("shove");
return(undefined);
}
}
}
_local3++;
}
zone.gotoAndStop("walk");
}
}
function f_CrackOut(zone) {
zone.crack_timer--;
if (zone.crack_timer <= 0) {
zone.nojumpanim = false;
zone.phase = 3;
if (u_hit) {
zone.platform = undefined;
zone.jumping = true;
zone.speed_y = -6;
zone.gotoAndStop("slap");
} else {
zone.gotoAndStop("stand");
}
return(undefined);
}
f_DashTrail(zone);
if (!f_CharJumping(zone)) {
zone.body._rotation = 0;
if (zone.prey.y > (zone.y + 100)) {
if (zone.platform._parent == game.game.conveyer3) {
if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
} else if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
} else if (zone.prey.y < (zone.y - 200)) {
if ((zone.platform._parent == game.game.conveyer3) or (zone.platform._parent == game.game.conveyer1)) {
if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
} else if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
} else if (Math.abs(zone.x - zone.prey.x) > 700) {
f_FacePrey(zone);
}
if (zone._xscale > 0) {
var _local4 = zone.x;
zone.jump_speed_x = 40;
f_MoveH(zone, zone.jump_speed_x);
if (zone.x == _local4) {
zone._xscale = zone._xscale * -1;
}
var _local3 = 1;
while (_local3 <= 4) {
var _local2 = game.game["crate" + _local3];
if (_local2.active) {
if ((zone.x < _local2.x) and (zone.x > (_local2.x - 350))) {
if ((((p1.x > (_local2.x - 300)) and (p1.x < _local2.x)) and (p1.y < (zone.y + 10))) and (p1.y > (zone.y - 200))) {
if (Math.abs(zone.y - _local2.y) < 10) {
if ((zone.x + 80) > (_local2.x - (_local2._width / 2))) {
f_CrateExplode(_local2);
}
}
} else if (zone.platform) {
if (Math.abs(zone.y - _local2.y) < 10) {
f_CharJump(zone);
zone.speed_y = zone.launch - 5;
zone.jump_speed_x = 40;
return(undefined);
}
}
}
}
_local3++;
}
} else {
var _local4 = zone.x;
zone.jump_speed_x = -40;
f_MoveH(zone, zone.jump_speed_x);
if (zone.x == _local4) {
zone._xscale = zone._xscale * -1;
}
var _local3 = 1;
while (_local3 <= 4) {
var _local2 = game.game["crate" + _local3];
if (_local2.active) {
if ((zone.x > _local2.x) and (zone.x < (_local2.x + 350))) {
if ((((p1.x < (_local2.x + 300)) and (p1.x > _local2.x)) and (p1.y < (zone.y + 10))) and (p1.y > (zone.y - 200))) {
if (Math.abs(zone.y - _local2.y) < 10) {
if ((zone.x + 120) < (_local2.x + (_local2._width / 2))) {
f_CrateExplode(_local2);
}
}
} else if (zone.platform) {
if (Math.abs(zone.y - _local2.y) < 10) {
f_CharJump(zone);
zone.speed_y = zone.launch - 5;
zone.jump_speed_x = -40;
return(undefined);
}
}
}
}
_local3++;
}
}
} else {
zone.body._rotation = zone.speed_y;
if (zone.speed_y > 0) {
if (zone.x > (game.game.chronic_right._x - 200)) {
zone.jump_speed_x = zone.jump_speed_x - 4;
if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
} else if (zone.x < (game.game.chronic_left._x + 200)) {
zone.jump_speed_x = zone.jump_speed_x + 4;
if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
}
}
}
}
function f_ChronicRoam(zone) {
if (!f_CharJumping(zone)) {
var _local5 = zone.x;
if (zone.prey.y > (zone.y + 100)) {
if (zone.platform._parent == game.game.conveyer3) {
if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
} else if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
} else if (zone.prey.y < (zone.y - 200)) {
if ((zone.platform._parent == game.game.conveyer3) or (zone.platform._parent == game.game.conveyer1)) {
if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
} else if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
} else {
f_FacePrey(zone);
}
if (zone.health < (zone.health_max / 2)) {
if (zone.laser_timer <= 0) {
if (zone.platform and (zone.platform != p1.platform)) {
var _local2 = true;
if (p1.platform._parent == game.game.conveyer4) {
game.game.laser4.gotoAndPlay(2);
} else if (p1.platform._parent == game.game.conveyer3) {
game.game.laser3.gotoAndPlay(2);
} else if (p1.platform._parent == game.game.conveyer2) {
game.game.laser2.gotoAndPlay(2);
} else if (p1.platform._parent == game.game.conveyer1) {
game.game.laser1.gotoAndPlay(2);
} else {
_local2 = false;
}
if (_local2) {
zone.laser_timer = 220;
zone.gotoAndStop("laser");
return(undefined);
}
}
}
}
if (zone._xscale > 0) {
if (zone.running) {
zone.jump_speed_x = zone.speed_dash_x;
f_MoveH(zone, zone.speed_dash_x);
} else {
zone.jump_speed_x = zone.speed_x;
f_MoveH(zone, zone.speed_x);
}
var _local3 = 1;
while (_local3 <= 4) {
var _local2 = game.game["crate" + _local3];
if (_local2.active) {
if ((zone.x < _local2.x) and (zone.x > (_local2.x - (200 + (zone.jump_speed_x * 5))))) {
if (zone.platform) {
if (Math.abs(zone.y - _local2.y) < 10) {
var _local4 = zone.jump_speed_x;
f_CharJump(zone);
zone.jump_speed_x = _local4;
return(undefined);
}
}
}
}
_local3++;
}
} else {
if (zone.running) {
zone.jump_speed_x = -zone.speed_dash_x;
f_MoveH(zone, zone.jump_speed_x);
} else {
zone.jump_speed_x = -zone.speed_x;
f_MoveH(zone, zone.jump_speed_x);
}
var _local3 = 1;
while (_local3 <= 4) {
var _local2 = game.game["crate" + _local3];
if (_local2.active) {
if ((zone.x > _local2.x) and (zone.x < (_local2.x + (200 + (zone.jump_speed_x * -5))))) {
if (zone.platform) {
if (Math.abs(zone.y - _local2.y) < 10) {
var _local4 = zone.jump_speed_x;
f_CharJump(zone);
zone.jump_speed_x = _local4;
return(undefined);
}
}
}
}
_local3++;
}
}
if (zone.running) {
zone.gotoAndStop("run");
} else {
zone.gotoAndStop("walk");
}
} else if (zone.speed_y > 0) {
if (zone.x > (game.game.chronic_right._x - 200)) {
zone.jump_speed_x = zone.jump_speed_x - 4;
if (zone._xscale > 0) {
zone._xscale = zone._xscale * -1;
}
} else if (zone.x < (game.game.chronic_left._x + 200)) {
zone.jump_speed_x = zone.jump_speed_x + 4;
if (zone._xscale < 0) {
zone._xscale = zone._xscale * -1;
}
}
}
}
function f_CrateExplode(zone) {
if (zone.active) {
if (!zone.force_x) {
zone.force_x = 5;
}
if (!zone.force_y) {
zone.force_y = -10;
}
f_ShrapnelRock1(zone.z_wall.x + 40, zone.y - 30, zone.y + 1, (zone.force_x / 2) + random(5), zone.force_y - random(4));
f_ShrapnelRock1(zone.z_wall.x - 30, zone.y - 40, zone.y + 1, -((zone.force_x / 2) + random(5)), zone.force_y - random(4));
f_ShrapnelRock1(zone.z_wall.x + 30, zone.y - 160, zone.y + 1, (zone.force_x / 2) + random(5), zone.force_y - random(4));
f_ShrapnelRock1(zone.z_wall.x - 40, zone.y - 150, zone.y + 1, -((zone.force_x / 2) + random(5)), zone.force_y - random(4));
if (zone.crate_type == 2) {
var _local2 = f_Item(zone.x, zone.y - 50, zone.y + 1, "crack", 100, 100);
f_CharJump(_local2);
chronic.prey = _local2;
} else {
f_FX(zone.x, zone.y, zone.y, "poison", 100, 100);
}
f_RemoveEnemy(zone);
zone.gotoAndStop("wait");
}
}
function f_CrateHitWall(zone) {
if (Math.abs(zone.toss_speed_x) > 20) {
f_CrateExplode(zone);
return(true);
}
return(false);
}
function f_InitClownDemon() {
game.game.moves.gotoAndStop("on");
zone = game.game.clownhead;
zone.nodepth = true;
_root.f_EnemyDefaults(zone);
zone.fp_Hit1 = f_HitClownHead;
zone.health_max = 400;
zone.health = zone.health_max;
zone.defense = 40;
zone.slide_x = 0;
zone.slide_y = 0;
zone.w2 = zone._width / 2;
_root.f_AddEnemy(zone);
zone.gotoAndStop("idle");
zone = game.game.hand1;
_root.f_EnemyDefaults(zone);
zone.fp_Hit1 = f_HitClownHand;
zone.health_max = 400;
zone.health = zone.health_max;
zone.defense = 40;
zone.slide_x = 0;
zone.slide_y = 0;
zone.w2 = zone._width / 2;
_root.f_AddEnemy(zone);
zone.gotoAndStop("idle");
zone = game.game.hand2;
_root.f_EnemyDefaults(zone);
zone.fp_Hit1 = f_HitClownHand;
zone.health_max = 100;
zone.health = zone.health_max;
zone.defense = 40;
zone.slide_x = 0;
zone.slide_y = 0;
zone.w2 = zone._width / 2;
_root.f_AddEnemy(zone);
zone.gotoAndStop("idle");
game.game.clownbody.timer = 0;
game.game.clownbody.gotoAndStop("on");
bossScreenOverlay.start();
game.game.clownhead.shot = 0;
bosshealth.gotoAndStop("on");
bosshealth.health.health.text = game.game.clownhead.health;
_root.f_Depth(game.game.hand1, (game.game.sidewalls._y + game.game.sidewalls._height) + 310);
_root.f_Depth(game.game.hand2, (game.game.sidewalls._y + game.game.sidewalls._height) + 310);
}
function f_HealthText(health) {
if (health < 10) {
var _local2 = "00" + health.toString();
} else if (health < 100) {
var _local2 = "0" + health.toString();
} else {
var _local2 = health;
}
return(_local2);
}
function f_HitClownHead(zone) {
zone.slide_x = zone.hitby.force_x / 2;
zone.slide_y = zone.hitby.force_y / 2;
zone.health--;
bosshealth.health.health.text = f_HealthText(zone.health);
if (zone.health <= 0) {
if (zone.alive) {
zone.body.gotoAndStop(1);
zone.alive = false;
game.game.moves.clownhead.busy = true;
game.game.clownhead.body.gotoAndStop("die");
game.game.moves.clownhead.gotoAndPlay("die");
game.game.hand1.body.gotoAndStop("die");
game.game.hand2.body.gotoAndStop("die");
game.game.moves.hand1.busy = true;
game.game.moves.hand1.gotoAndPlay("die");
game.game.moves.hand2.busy = true;
game.game.moves.hand2.gotoAndPlay("die");
}
}
zone.gotoAndPlay("hit");
}
function f_HitClownHand(zone) {
zone.slide_x = zone.hitby.force_x;
zone.slide_y = zone.hitby.force_y;
zone.gotoAndPlay("hit");
}
function f_ClownShot(zone) {
zone.shot_timer--;
if (zone.shot_timer <= 0) {
zone.shot_timer = 2;
u_point.x = 0;
u_point.y = 0;
game.game.clownhead.bullet_pt.localToGlobal(u_point);
var _local6 = (u_point.x * u_scale) - game_x;
var _local4 = (u_point.y * u_scale) - game_y;
game.game.clownhead.shot++;
if (game.game.clownhead.shot > 16) {
game.game.clownhead.shot = 1;
}
var _local1 = game.game.fireballs["e" + game.game.clownhead.shot];
_local1._xscale = 90 + random(30);
_local1._yscale = 90 + random(30);
_local1._rotation = random(180);
_local1.gotoAndPlay(2);
_local1._x = _local6 - game.game.fireballs._x;
_local1._y = _local4 - game.game.fireballs._y;
var u_scale = (100 + random(40));
_local1.body._xscale = u_scale;
_local1.body._yscale = u_scale;
var _local2 = game.game.clownhead._rotation + 90;
var _local3 = 40;
_local1.speed_x = _local3 * Math.cos(PI * _local2);
_local1.speed_y = _local3 * Math.sin(PI * _local2);
_local1._rotation = random(180);
_local1.force_x = Math.abs(_local1.speed_x / 2);
_local1.force_y = _local1.speed_y;
}
}
function f_ClownHandMove(zone) {
if (zone == game.game.clownhead) {
var _local3 = (game.game.moves._x + game.game.moves.clownhead._x) + game.game.moves.clownhead.body._x;
var _local2 = (game.game.moves._y + game.game.moves.clownhead._y) + game.game.moves.clownhead.body._y;
zone._rotation = game.game.moves.clownhead.body._rotation;
} else if (zone._xscale < 0) {
var _local3 = (game.game.moves._x + game.game.moves.hand1._x) - game.game.moves.hand1.body._x;
var _local2 = (game.game.moves._y + game.game.moves.hand1._y) + game.game.moves.hand1.body._y;
zone._rotation = -game.game.moves.hand1.body._rotation;
} else {
var _local3 = (game.game.moves._x + game.game.moves.hand2._x) + game.game.moves.hand2.body._x;
var _local2 = (game.game.moves._y + game.game.moves.hand2._y) + game.game.moves.hand2.body._y;
zone._rotation = game.game.moves.hand2.body._rotation;
}
if ((Math.abs(zone.slide_x) > 1) and (Math.abs(zone.x - _local3) < 200)) {
zone.x = zone.x + zone.slide_x;
zone.slide_x = zone.slide_x * 0.75;
} else if (Math.abs(zone.x - _local3) > 1) {
zone.x = zone.x + ((_local3 - zone.x) / 6);
} else {
zone.x = _local3;
}
if ((Math.abs(zone.slide_y) > 1) and (Math.abs(zone.y - _local2) < 200)) {
zone.y = zone.y + zone.slide_y;
zone.slide_y = zone.slide_y * 0.75;
} else if (Math.abs(zone.y - _local2) > 1) {
zone.y = zone.y + ((_local2 - zone.y) / 6);
} else {
zone.y = _local2;
}
zone._x = zone.x;
zone._y = zone.y;
}
function f_ClownBody(zone) {
if (zone._y > zone.default_y) {
zone._y = game.game.clownhead._y + 300;
if (zone._y < zone.default_y) {
zone._y = zone.default_y;
}
}
var _local3 = zone._x + zone.center._x;
var _local2 = zone._y + zone.center._y;
var _local4 = 0;
zone.hand1._x = (_local3 + ((game.game.hand1._x - _local3) * 0.9)) - zone._x;
zone.hand1._y = (_local2 + (((game.game.hand1._y - _local4) - _local2) * 0.75)) - zone._y;
zone.hand2._x = (_local3 + ((game.game.hand2._x - _local3) * 0.9)) - zone._x;
zone.hand2._y = (_local2 + (((game.game.hand2._y - _local4) - _local2) * 0.75)) - zone._y;
zone.hand3._x = (_local3 + ((game.game.hand1._x - _local3) * 0.5)) - zone._x;
zone.hand3._y = (_local2 + (((game.game.hand1._y - _local4) - _local2) * 0.25)) - zone._y;
zone.hand4._x = (_local3 + ((game.game.hand2._x - _local3) * 0.5)) - zone._x;
zone.hand4._y = (_local2 + (((game.game.hand2._y - _local4) - _local2) * 0.25)) - zone._y;
zone.body1._x = (_local3 + ((game.game.clownhead._x - _local3) * 0.25)) - zone._x;
zone.body1._y = (_local2 + ((game.game.clownhead._y - _local2) * 0.25)) - zone._y;
zone.hair._x = game.game.clownhead._x - zone._x;
zone.hair._y = (game.game.clownhead._y - 175) - zone._y;
zone.hair._rotation = game.game.clownhead._rotation;
if (game.game.clownhead.alive) {
game.game.moves._x = game.game.center_pt._x + ((game.game.p1.x - game.game.center_pt._x) * 0.25);
game.game.moves.clownhead._x = (game.game.center_pt._x + ((game.game.p1.x - game.game.center_pt._x) * 0.5)) - game.game.moves._x;
game.game.clownbody._x = game.game.moves._x;
zone.timer++;
if (zone.timer > 180) {
if ((zone.timer % 600) == 0) {
if (game.game.moves._x < game.game.center_pt._x) {
game.game.moves.clownhead.busy = true;
game.game.moves.clownhead.gotoAndPlay("attack1");
} else {
game.game.moves.clownhead.busy = true;
game.game.moves.clownhead.gotoAndPlay("attack2");
}
} else if ((zone.timer % 400) == 0) {
game.game.moves.hand2.gotoAndPlay("swipe");
} else if ((zone.timer % 200) == 0) {
game.game.moves.hand1.gotoAndPlay("swipe");
}
}
} else {
if (game.game.moves._x < (game.game.center_pt._x - 10)) {
game.game.moves._x = game.game.moves._x + 10;
} else if (game.game.moves._x > (game.game.center_pt._x + 10)) {
game.game.moves._x = game.game.moves._x - 10;
}
if ((game.game.moves.clownhead._x + game.game.moves._x) < (game.game.center_pt._x - 10)) {
game.game.moves.clownhead._x = game.game.moves.clownhead._x + 10;
} else if ((game.game.moves.clownhead._x + game.game.moves._x) > (game.game.center_pt._x + 10)) {
game.game.moves.clownhead._x = game.game.moves.clownhead._x - 10;
}
game.game.clownbody._x = game.game.center_pt._x + ((game.game.clownhead._x - game.game.center_pt._x) * 0.5);
}
}
function f_ClownFireball(zone) {
zone._x = zone._x + zone.speed_x;
zone._y = zone._y + zone.speed_y;
var _local3 = zone._x + game.game.fireballs._x;
var _local2 = zone._y + game.game.fireballs._y;
if (Math.abs(_local3 - p1.x) < (zone._width / 2)) {
if (Math.abs(_local2 - p1.y) < (zone._height / 2)) {
if (p1.invincible_timer <= 0) {
p1.force_x = 0;
p1.force_y = -20;
p1.smoke_timer = 30;
p1.fp_Hit1(p1);
p1.invincible_timer = 30;
shake_x = 10;
}
}
}
}
function f_ClownHandSmash(zone) {
if (zone._xscale < 0) {
var _local4 = game.game.hand1._x;
var _local1 = game.game.hand1._y;
var _local3 = 35;
} else {
var _local4 = game.game.hand2._x;
var _local1 = game.game.hand2._y;
var _local3 = -35;
}
var _local5 = game.game.hand1.zone._width / 2;
var _local2 = game.game.hand1.zone._height / 2;
if (Math.abs(_local4 - p1.x) < _local5) {
if ((p1.y - p1.zone._height) < (_local1 + _local2)) {
if (p1.y > (_local1 - _local2)) {
if (p1.invincible_timer <= 0) {
p1.force_x = _local3;
p1.force_y = -17;
p1.fp_Hit1(p1);
p1.invincible_timer = 30;
shake_y = 10;
s_punch3.start(0, 0);
if (zone._xscale < 0) {
game.game.hand1.gotoAndPlay("smack");
} else {
game.game.hand2.gotoAndPlay("smack");
}
}
}
}
}
}
color_green = new Object();
f_NewColor(color_green);
color_green.rb = -150;
color_green.gb = -50;
color_green.bb = -138;
color_red = new Object();
f_NewColor(color_red);
color_red.gb = -255;
color_red.bb = -255;
color_yellow = new Object();
f_NewColor(color_yellow);
color_yellow.rb = 100;
color_yellow.gb = 50;
color_yellow2 = new Object();
f_NewColor(color_yellow2);
color_yellow2.rb = 50;
color_yellow2.gb = 25;
color_invisible = new Object();
f_NewColor(color_invisible);
color_invisible.ab = -255;
color_default = new Object();
f_NewColor(color_default);
var glowBuffer = (new flash.display.BitmapData(Math.ceil(Stage.width * 0.25), Math.ceil(Stage.height * 0.25), true, 0));
PI = (Math.PI/180);
b_start1 = 49;
b_start2 = 50;
players = 0;
current_depth_mod = 0;
u_point = new Object();
total_fx = 200;
current_fx = 1;
current_item = 1;
depth_mod_max = 298;
p1_depth_mod = 296;
p2_depth_mod = 297;
conveyer_speed = 5;
dash_timer = 4;
shake_x = 0;
shake_y = 0;
rockbreaker = 0;
chronicdash = 0;
doublejump = 0;
wallstick = 0;
doublejump = 1;
got_defense1 = false;
got_defense2 = false;
screenWidthDefault = 720;
screenHeightDefault = 405;
aspectRatio = screenWidthDefault / screenHeightDefault;
scrollSpeed = 10;
scrollBuffer = 150;
screenWidth = screenWidthDefault;
screenHeight = screenHeightDefault;
screenHeightMax = screenHeightDefault + (scrollBuffer * 2);
screenWidthMax = screenWidthDefault + (scrollBuffer * 2);
speed_y_max = 30;
var screenOverlay = new ScreenOverlay();
s_spring = new Sound();
s_spring.attachSound("sound_spring.wav");
s_thwomp = new Sound();
s_thwomp.attachSound("sound_thwomp.wav");
s_swing1 = new Sound();
s_swing1.attachSound("sound_swinger1.wav");
s_swing6 = new Sound();
s_swing6.attachSound("sound_swinger6.wav");
s_zombiedie1 = new Sound();
s_zombiedie1.attachSound("sound_zombie_die1.wav");
s_zombiedie2 = new Sound();
s_zombiedie2.attachSound("sound_zombie_die2.wav");
s_zombiedie3 = new Sound();
s_zombiedie3.attachSound("sound_zombie_die3.wav");
s_zombie1 = new Sound();
s_zombie1.attachSound("sound_zombie1.wav");
s_zombie2 = new Sound();
s_zombie2.attachSound("sound_zombie2.wav");
s_zombie3 = new Sound();
s_zombie3.attachSound("sound_zombie3.wav");
s_clowndie = new Sound();
s_clowndie.attachSound("sound_clown_die.wav");
s_clownfire = new Sound();
s_clownfire.attachSound("sound_clown_fire.wav");
s_clownroar = new Sound();
s_clownroar.attachSound("sound_clown_roar.wav");
s_clownswipe = new Sound();
s_clownswipe.attachSound("sound_clown_swipe.wav");
s_explosion1 = new Sound();
s_explosion1.attachSound("sound_explosion_1.wav");
s_explosion3 = new Sound();
s_explosion3.attachSound("sound_normalexplosion3.wav");
s_bodyfall1 = new Sound();
s_bodyfall1.attachSound("sound_bodyfall1.wav");
s_bodyfall2 = new Sound();
s_bodyfall2.attachSound("sound_bodyfall2.wav");
s_bodyfall3 = new Sound();
s_bodyfall3.attachSound("sound_bodyfall3.wav");
s_bodyfall4 = new Sound();
s_bodyfall4.attachSound("sound_bodyfall4.wav");
s_bodyfall5 = new Sound();
s_bodyfall5.attachSound("sound_bodyfall5.wav");
s_glass1 = new Sound();
s_glass1.attachSound("sound_glass1.wav");
s_punch1 = new Sound();
s_punch1.attachSound("sound_punch1.wav");
s_punch2 = new Sound();
s_punch2.attachSound("sound_punch2.wav");
s_punch3 = new Sound();
s_punch3.attachSound("sound_GoodPunch3.wav");
s_shot1 = new Sound();
s_shot1.attachSound("MG_SHOT_01.wav");
s_shot2 = new Sound();
s_shot2.attachSound("MG_SHOT_02.wav");
s_shot3 = new Sound();
s_shot3.attachSound("MG_SHOT_03.wav");
s_shot4 = new Sound();
s_shot4.attachSound("MG_SHOT_04.wav");
s_enemy_shoot1 = new Sound();
s_enemy_shoot1.attachSound("sound_enemy_shoot1.wav");
s_enemy_shoot2 = new Sound();
s_enemy_shoot2.attachSound("sound_enemy_shoot2.wav");
s_enemy_shoot3 = new Sound();
s_enemy_shoot3.attachSound("sound_enemy_shoot3.wav");
s_enemy_shoot4 = new Sound();
s_enemy_shoot4.attachSound("sound_enemy_shoot4.wav");
s_bullethitbody1 = new Sound();
s_bullethitbody1.attachSound("sound_bullethitbody1.wav");
s_bullethitbody2 = new Sound();
s_bullethitbody2.attachSound("sound_bullethitbody2.wav");
current_shot = 0;
s_hit_dirt1 = new Sound();
s_hit_dirt1.attachSound("MG_GRAINYSHOT_01.wav");
s_hit_dirt2 = new Sound();
s_hit_dirt2.attachSound("MG_GRAINYSHOT_02.wav");
s_hit_dirt3 = new Sound();
s_hit_dirt3.attachSound("MG_GRAINYSHOT_03.wav");
s_hit_metal1 = new Sound();
s_hit_metal1.attachSound("MG_METALSHOT_01.wav");
s_hit_metal2 = new Sound();
s_hit_metal2.attachSound("MG_METALSHOT_02.wav");
s_hit_metal3 = new Sound();
s_hit_metal3.attachSound("MG_METALSHOT-X_02.wav");
s_hit_default1 = new Sound();
s_hit_default1.attachSound("MG_DIRTYSHOT_01.wav");
s_hit_default2 = new Sound();
s_hit_default2.attachSound("MG_DIRTYSHOT_02.wav");
s_hit_default3 = new Sound();
s_hit_default3.attachSound("MG_DIRTYSHOT_03.wav");
s_elevator = new Sound();
s_elevator.attachSound("sound_elevator.wav");
s_elevatordoor = new Sound();
s_elevatordoor.attachSound("sound_elevator_door.wav");
s_elevatorbreak = new Sound();
s_elevatorbreak.attachSound("sound_elevatorbreak.wav");
s_splash = new Sound();
s_splash.attachSound("sound_splashout.wav");
s_steam = new Sound();
s_steam.attachSound("sound_steam.wav");
s_cursor33 = new Sound();
s_cursor33.attachSound("sound_cursor33.wav");
s_cursor34 = new Sound();
s_cursor34.attachSound("sound_cursor34.wav");
s_power24 = new Sound();
s_power24.attachSound("sound_power24.wav");
s_record = new Sound();
s_record.attachSound("sound_record.wav");
s_doorslam = new Sound();
s_doorslam.attachSound("sound_doorslam.wav");
s_beams = new Sound();
s_beams.attachSound("sound_beams.wav");
s_calliope.s_calliope = new Sound(s_calliope);
s_calliope.s_calliope.attachSound("92334_Calliope_Loop.wav");
s_oceanside.s_oceanside = new Sound(s_oceanside);
s_oceanside.s_oceanside.attachSound("170120_Loop.wav");
zombiesound = false;
zombiesound_timer = 0;
current_hit = 0;
f_Clear();
f_DefaultStats();
startEngine();
spawnpoint = 1;
gotoAndPlay ("level1_2");
fader.gotoAndPlay("fadein");
oldT = getTimer();
maxF = 30;
fp_fpsLimiter = fpsLimiter;
Frame 10
_root.f_LevelDefaults();
_root.f_Level1_5Init();
stop();
Frame 11
gotoAndStop (1);
Frame 13
_root.f_LevelDefaults();
_root.f_Level1_2Init();
stop();
Frame 14
gotoAndStop (1);
Frame 16
_root.f_LevelDefaults();
_root.f_Level1_3Init();
stop();
Frame 17
gotoAndStop (1);
Frame 19
_root.f_LevelDefaults();
_root.f_Level1_5Init();
stop();
Frame 20
gotoAndStop (1);
Frame 22
_root.f_LevelDefaults();
_root.f_Level1_4Init();
stop();
Frame 23
gotoAndStop (1);
Frame 25
stop();
Frame 26
gotoAndStop (1);
Frame 28
_root.f_LevelDefaults();
_root.f_Level1_6Init();
stop();
Frame 29
gotoAndStop (1);
Frame 31
stop();
Frame 32
stopAllSounds();
gameover = false;
play();
Frame 33
if ((currentlevel == "level1_3") or (currentlevel == "level1_5")) {
s_oceanside.s_oceanside.start(0, 500);
}
gotoAndPlay(currentlevel);
Instance of Symbol 3 MovieClip in Symbol 4 MovieClip Frame 1
onClipEvent (load) {
_root.f_InsertObject(_parent, _root.a_Platforms);
}
onClipEvent (unload) {
_root.f_RemoveObject(_parent, _root.a_Platforms);
}
Symbol 5 MovieClip [l4] Frame 1
_root.f_AddPlatform(this, z_platform);
z_platform.diagonal = true;
z_platform.incline = true;
_root.f_GetSlope(z_platform);
if (z_platform.y_mod == undefined) {
z_platform.y_mod = 100;
}
gotoAndStop (2);
Symbol 7 MovieClip [l5] Frame 1
_root.f_AddPlatform(this, z_platform);
z_platform.diagonal = true;
z_platform.incline = false;
_root.f_GetSlope(z_platform);
if (z_platform.y_mod == undefined) {
z_platform.y_mod = 100;
}
Symbol 7 MovieClip [l5] Frame 2
stop();
Instance of Symbol 3 MovieClip in Symbol 9 MovieClip Frame 1
onClipEvent (load) {
_root.f_InsertObject(_parent, _root.a_Walls);
_parent._parent.w = _parent._width;
_parent._parent.h = _parent._height;
}
onClipEvent (unload) {
_root.f_RemoveObject(_parent, _root.a_Walls);
}
Symbol 10 MovieClip [l3] Frame 1
_root.f_AddWall(this, z_wall);
_root.f_AddPlatform(this, z_platform);
w2 = z_wall._width / 2;
gotoAndStop (2);
Symbol 11 MovieClip [l8] Frame 1
_root.f_AddWall(this, z_wall);
gotoAndStop (2);
Symbol 13 MovieClip [l1] Frame 1
_root.f_AddPlatform(this, z_platform);
z_platform.slope = 0;
z_platform.dropthru = true;
if (z_platform.y_mod == undefined) {
z_platform.y_mod = 100;
}
gotoAndStop (2);
Symbol 14 MovieClip [l2] Frame 1
if (!z_platform.removed) {
_root.f_AddPlatform(this, z_platform);
z_platform.slope = 0;
}
gotoAndStop (2);
Symbol 20 MovieClip Frame 1
play();
Symbol 20 MovieClip Frame 6
_parent.gotoAndStop("remove");
Symbol 24 MovieClip Frame 4
stop();
Symbol 35 MovieClip Frame 16
stop();
Symbol 50 MovieClip Frame 8
stop();
Symbol 64 MovieClip Frame 22
stop();
Symbol 73 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 66
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 2
play();
Symbol 75 MovieClip Frame 31
stop();
Symbol 87 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 8
stop();
Symbol 93 MovieClip Frame 5
stop();
Symbol 98 MovieClip Frame 1
gotoAndStop(random(4) + 1);
Symbol 99 MovieClip Frame 32
_parent.gotoAndStop("blank");
Symbol 115 MovieClip Frame 1
gotoAndStop(random(7) + 1);
Symbol 133 MovieClip Frame 10
_parent.gotoAndStop("idle");
Symbol 134 MovieClip Frame 1
stop();
Symbol 142 MovieClip Frame 1
_root.gunshooting = false;
stop();
Symbol 142 MovieClip Frame 2
_root.gunshooting = true;
Symbol 143 MovieClip Frame 1
_root.f_SetGun(this);
Symbol 151 MovieClip Frame 1
_root.f_SetHead(this);
Symbol 162 MovieClip Frame 1
_root.f_SetFace(this);
Symbol 167 MovieClip Frame 1
_root.f_SetBody(this);
Symbol 174 MovieClip Frame 1
_root.f_SetBody(this);
Symbol 188 MovieClip Frame 1
_root.f_SetHand(this);
Symbol 214 MovieClip Frame 21
stop();
Symbol 215 MovieClip Frame 21
stop();
Symbol 227 MovieClip Frame 1
stop();
Instance of Symbol 100 MovieClip in Symbol 227 MovieClip Frame 2
onClipEvent (enterFrame) {
_root.f_ClownFireball(_parent);
}
Symbol 227 MovieClip Frame 18
stop();
Instance of Symbol 100 MovieClip in Symbol 228 MovieClip Frame 1
onClipEvent (enterFrame) {
_root.f_ClownFireball(_parent);
}
Symbol 228 MovieClip Frame 17
stop();
Symbol 229 MovieClip Frame 8
stop();
Symbol 253 MovieClip Frame 24
stop();
Symbol 271 MovieClip Frame 28
stop();
Symbol 286 MovieClip Frame 20
stop();
Symbol 299 MovieClip Frame 13
stop();
Symbol 309 MovieClip Frame 9
stop();
Symbol 314 MovieClip Frame 8
stop();
Symbol 315 MovieClip [fx] Frame 1
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 315 MovieClip [fx] Frame 7
onClipEvent (load) {
y = _parent._y;
}
onClipEvent (enterFrame) {
_parent._y = _parent._y + _parent.speed_y;
if (_parent._y < (y - 300)) {
_parent.gotoAndStop("remove");
}
}
Instance of Symbol 15 MovieClip [empty] in Symbol 315 MovieClip [fx] Frame 8
onClipEvent (enterFrame) {
_root.f_PixelChase(_parent);
}
Symbol 315 MovieClip [fx] Frame 10
noturn = true;
line.gotoAndStop(1);
line.line.gotoAndPlay(1);
if (!owner.goodguy) {
line.line.line.gotoAndStop(2);
}
Instance of Symbol 15 MovieClip [empty] in Symbol 315 MovieClip [fx] Frame 10
onClipEvent (enterFrame) {
_root.f_Bullet(_parent);
}
Symbol 315 MovieClip [fx] Frame 11
noturn = true;
Symbol 315 MovieClip [fx] Frame 12
noturn = true;
Symbol 315 MovieClip [fx] Frame 14
scale = random(60) + 90;
body._xscale = scale;
body._yscale = scale;
body._rotation = random(360);
line.line.stop();
line.gotoAndPlay(2);
if (!owner.goodguy) {
body.body.gotoAndStop(2);
}
Symbol 315 MovieClip [fx] Frame 15
scale = random(60) + 90;
body._xscale = scale;
body._yscale = scale;
body._rotation = random(360);
line.line.stop();
line.gotoAndPlay(2);
Symbol 315 MovieClip [fx] Frame 16
line.line.stop();
line.gotoAndPlay(2);
Instance of Symbol 100 MovieClip in Symbol 315 MovieClip [fx] Frame 17
onClipEvent (enterFrame) {
_root.f_BloodShrapnel(_parent);
}
Instance of Symbol 15 MovieClip [empty] in Symbol 315 MovieClip [fx] Frame 18
onClipEvent (enterFrame) {
_root.f_Shrapnel(_parent);
}
Instance of Symbol 214 MovieClip "body" in Symbol 315 MovieClip [fx] Frame 27
onClipEvent (enterFrame) {
_parent._x = _parent._x + _parent.force_x;
_parent._y = _parent._y + _parent.force_y;
}
Instance of Symbol 15 MovieClip [empty] in Symbol 315 MovieClip [fx] Frame 29
onClipEvent (enterFrame) {
_root.f_Bullet(_parent);
_parent.body._xscale = _parent.body._xscale + 30;
_parent.body._yscale = _parent.body._yscale + 30;
}
Symbol 315 MovieClip [fx] Frame 30
_root.s_explosion1.start(0, 0);
Symbol 315 MovieClip [fx] Frame 34
if (!owner.goodguy) {
body.body.gotoAndStop(2);
}
Symbol 315 MovieClip [fx] Frame 35
if (!owner.goodguy) {
body.body.gotoAndStop(2);
}
Symbol 336 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/madnessday2007.html", "_new");
}
Symbol 337 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/madnessday2008.html", "_new");
}
Symbol 339 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/madness", "_new");
}
Symbol 357 MovieClip Frame 40
stop();
Symbol 372 Button
on (press) {
gotoAndStop ("end");
_root.play();
}
Instance of Symbol 347 MovieClip in Symbol 373 MovieClip Frame 1
onClipEvent (load) {
_root.stop();
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndStop("lastframe");
}
}
onClipEvent (enterFrame) {
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndPlay("loaded");
}
}
Symbol 373 MovieClip Frame 101
play();
Symbol 373 MovieClip Frame 165
stop();
Symbol 379 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 384 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 386 MovieClip Frame 1
function startAd(ngad_url) {
trace("opening " + ngad_url);
System.security.allowDomain("70.87.128.99");
System.security.allowInsecureDomain("70.87.128.99");
System.security.allowDomain("ads.shizmoo.com");
System.security.allowInsecureDomain("ads.shizmoo.com");
System.security.allowDomain("www.cpmstar.com");
System.security.allowInsecureDomain("www.cpmstar.com");
System.security.allowDomain("server.cpmstar.com");
System.security.allowInsecureDomain("server.cpmstar.com");
var ngads_redirect = new XML();
ngads_redirect.ignoreWhite = true;
ngads_redirect.onLoad = function (success) {
trace("[NEWGROUNDS FLASH ADS] :: You may get a 'Security Sandbox Violation' ... this is normal, do not freak out!");
if (success) {
ng_ad.loadMovie(ngads_redirect.toString(), "GET");
}
};
ngads_redirect.load(ngad_url);
}
if (NewgroundsAPI.getAdURL()) {
startAd(NewgroundsAPI.getAdURL());
}
NewgroundsAPI.onAdsApproved = function (ad_url) {
startAd(ad_url);
};
stop();
Symbol 1341 MovieClip [__Packages.NewgroundsAPI] Frame 0
class NewgroundsAPI
{
static var tracker_id, host, version, debug, error_format, header_format, normal_format, link_format;
function NewgroundsAPI () {
}
static function connectMovie(id) {
if (!id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else if (!tracker_id) {
SendMessage("Connecting to API gateway...");
tracker_id = id;
host = _url.split("/")[2].toLowerCase();
if (host.length < 1) {
host = "localhost";
}
var _local2 = new Object();
SendEvent(MOVIE_VIEWS);
}
}
static function setMovieVersion(movie_version) {
if (!movie_version) {
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = movie_version;
}
}
static function debugMode() {
debug = true;
}
static function addCustomEvent(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else if (!stat_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[stat_name] = CUSTOM_STATS + stat_id;
SendMessage("Created custom event: " + stat_name);
}
}
static function addCustomLink(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else if (!stat_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[stat_name] = CUSTOM_STATS + stat_id;
SendMessage((("Created custom link " + stat_id) + ": ") + stat_name);
}
}
static function loadMySite() {
SendLink(AUTHOR_SITE);
}
static function loadNewgrounds(special) {
if (special) {
var _local1 = {page:special};
}
SendLink(NEWGROUNDS, _local1);
}
static function logCustomEvent(event_name) {
if (!event_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else if (!custom_events[event_name]) {
SendError("Attempted to log undefined custom event: " + event_name);
} else {
SendEvent(custom_events[event_name]);
}
}
static function loadCustomLink(link_name) {
if (!link_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else if (!custom_links[link_name]) {
SendError("Attempted to open undefined custom link: " + link_name);
} else {
SendLink(custom_links[link_name]);
}
}
static function getAdURL() {
return(movie_options.ad_url);
}
static function getMovieURL() {
if (movie_options.movie_url) {
return(movie_options.movie_url);
}
return("Newgrounds.com");
}
static function getNewVersionURL() {
return((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + NEW_VERSION);
}
static function SendEvent(id) {
SendStat(id, false);
}
static function SendLink(id, extra) {
SendStat(id, true, extra);
}
static function ReadGatewayData(params) {
for (var _local2 in params) {
params[_local2] = unescape(params[_local2]);
movie_options[_local2] = params[_local2];
}
if (params.settings_loaded) {
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage(("Movie Identified as '" + movie_options.movie_name) + "'");
if (movie_options.message) {
SendMessage(movie_options.message);
}
if (movie_options.ad_url) {
SendMessage("Your movie has been approved to run Flash Ads");
onAdsApproved(movie_options.ad_url);
}
if (movie_options.movie_version and (movie_options.movie_version.toString() != version.toString())) {
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
onNewVersionAvailable(movie_options.movie_version, getMovieURL(), getNewVersionURL());
}
if (movie_options.deny_host) {
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
onDenyHost(host, getMovieURL(), getNewVersionURL());
}
if (movie_options.request_portal_url == 1) {
var _local4 = (((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_url);
var _local3 = new XML();
_local3.ignoreWhite = true;
_local3.load(_local4);
}
} else if (!movie_options.settings_loaded) {
SendError("Could not establish connection to the API gateway.");
}
}
static function SendStat(stat_id, open_in_browser, extra) {
if (!tracker_id) {
SendError("API calls cannot be made without a valid movie id.");
SendError("Did you remember to add the \"NewgroundsAPI.connectMovie()\" code?");
} else {
var _local7 = (((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id;
for (var _local9 in extra) {
_local7 = _local7 + ((("&" + escape(_local9)) + "=") + escape(extra[_local9]));
}
trace(_local7);
if (debug) {
_local7 = _local7 + "&debug=1";
}
if (open_in_browser) {
getURL (_local7, "_blank");
} else {
var _local10 = new XML();
_local10.ignoreWhite = true;
_local10.onLoad = function (success) {
var _local6 = new Object();
var _local3 = 0;
while (_local3 < this.firstChild.childNodes.length) {
var _local4 = this.firstChild.childNodes[_local3];
var _local5 = _local4.nodeName;
var _local2 = _local4.attributes.value;
if (_local2 == Number(_local2)) {
_local2 = Number(_local2);
}
_local6[_local5] = _local2;
_local3++;
}
NewgroundsAPI.ReadGatewayData(_local6);
};
_local10.load(_local7);
}
}
}
static function SendError(msg) {
trace("[NEWGROUNDS API ERROR] :: " + msg);
}
static function SendMessage(msg) {
trace("[NEWGROUNDS API] :: " + msg);
}
static function InitTextFormats() {
if (!error_format) {
error_format = new TextFormat();
error_format.font = "Arial Black";
error_format.size = 48;
error_format.color = 16711680 /* 0xFF0000 */;
}
if (!header_format) {
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.size = 24;
header_format.color = 16777215 /* 0xFFFFFF */;
}
if (!normal_format) {
normal_format = new TextFormat();
normal_format.font = "Arial";
normal_format.bold = true;
normal_format.size = 12;
normal_format.color = 16777215 /* 0xFFFFFF */;
}
if (!link_format) {
link_format = new TextFormat();
link_format.color = 16776960 /* 0xFFFF00 */;
link_format.underline = true;
}
}
static function onNewVersionAvailable(version, movie_url, redirect_url) {
InitTextFormats();
var _local2 = new Object();
_local2.x = Stage.width / 2;
_local2.y = Stage.height / 2;
_root.createEmptyMovieClip("NGAPI_new_version_overlay", _root.getNextHighestDepth());
_root.NGAPI_new_version_overlay.lineStyle(1, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(0, 70);
_root.NGAPI_new_version_overlay.moveTo(-10, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, -10);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(51);
_root.NGAPI_new_version_overlay.moveTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.createEmptyMovieClip("exit", 1000);
_root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100);
_root.NGAPI_new_version_overlay.exit.beginFill(0, 50);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 214, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 226, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 226, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 214, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.onMouseUp = function () {
if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) {
_root.NGAPI_new_version_overlay.removeMovieClip();
}
};
var _local3 = (("Version " + version) + " is now available at:") + newline;
var _local5 = _local3.length;
_local3 = _local3 + movie_url;
var _local4 = _local3.length;
_root.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000);
_root.NGAPI_new_version_overlay.createTextField("newversion", 100, _local2.x - 210, _local2.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = "New Version Available!";
_root.NGAPI_new_version_overlay.newversion.setTextFormat(header_format);
_root.NGAPI_new_version_overlay.createTextField("message", 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40);
_root.NGAPI_new_version_overlay.message.text = _local3;
_root.NGAPI_new_version_overlay.message.multiline = true;
_root.NGAPI_new_version_overlay.message.wordWrap = true;
_root.NGAPI_new_version_overlay.message.html = true;
_root.NGAPI_new_version_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(_local5, _local4, link_format);
}
static function onDenyHost(hostname, movie_url, redirect_url) {
InitTextFormats();
_root.createEmptyMovieClip("NGAPI_deny_host_overlay", _root.getNextHighestDepth());
_root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100);
_root.NGAPI_deny_host_overlay.beginFill(6684672);
_root.NGAPI_deny_host_overlay.moveTo(0, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, 0);
_root.NGAPI_deny_host_overlay.endFill();
var _local2 = ("This movie has not been approved for use on " + hostname) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var _local4 = _local2.length;
_local2 = _local2 + movie_url;
var _local3 = _local2.length;
_root.NGAPI_deny_host_overlay.createTextField("mousekill", 100, 0, 0, Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.createTextField("error", 101, (Stage.width - 400) / 2, (Stage.height / 2) - 100, 400, 200);
_root.NGAPI_deny_host_overlay.error.text = "ERROR!";
_root.NGAPI_deny_host_overlay.error.setTextFormat(error_format);
_root.NGAPI_deny_host_overlay.createTextField("message", 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200);
_root.NGAPI_deny_host_overlay.message.text = _local2;
_root.NGAPI_deny_host_overlay.message.multiline = true;
_root.NGAPI_deny_host_overlay.message.wordWrap = true;
_root.NGAPI_deny_host_overlay.message.html = true;
_root.NGAPI_deny_host_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format);
}
static function isInstalled() {
return(true);
}
static function onAdsApproved(ad_url) {
}
static var movie_options = new Object();
static var custom_events = new Object();
static var custom_links = new Object();
static var MOVIE_VIEWS = 1;
static var AUTHOR_SITE = 2;
static var NEWGROUNDS = 3;
static var NEW_VERSION = 4;
static var CUSTOM_STATS = 50;
static var GATEWAY_URL = "http://www.ngads.com/gateway.php";
}
Symbol 1342 MovieClip [__Packages.ScreenOverlay] Frame 0
class ScreenOverlay
{
var _scale, _scaleMatrix, _overlayParent, _normalColorTransform, _screenRectangle, _identityMatrix, _overlayMatrix, _overlayColorTransform, _overlayBlendMode, _origin, _overlayFilter, _recursive, _iterations, _overlayFunction, _drawMatrix, _drawColorTransform, _started, _overlayDisplay, _overlayContainer, _overlayClip, _overlayBuffer;
function ScreenOverlay (parent) {
if (parent == null) {
parent = _root;
}
_scale = 1;
_scaleMatrix = new flash.geom.Matrix(_scale, 0, 0, _scale, 0, 0);
_overlayParent = parent;
createBitmaps(parent);
_normalColorTransform = new flash.geom.ColorTransform();
_screenRectangle = new flash.geom.Rectangle(0, 0, Stage.width, Stage.height);
_identityMatrix = new flash.geom.Matrix();
_overlayMatrix = new flash.geom.Matrix();
_overlayColorTransform = new flash.geom.ColorTransform();
_overlayBlendMode = "normal";
_origin = new flash.geom.Point();
_overlayFilter = null;
_recursive = true;
_iterations = 1;
_overlayFunction = null;
_drawMatrix = new flash.geom.Matrix();
_drawColorTransform = new flash.geom.ColorTransform();
_screenOverlays.push(this);
}
function start() {
_started = true;
_overlayDisplay.fillRect(_screenRectangle, 0);
}
function stop() {
_started = false;
_overlayContainer._visible = false;
}
function get started() {
return(_started);
}
function get overlayClip() {
return(_overlayClip);
}
function set overlayClip(m) {
_overlayClip = m;
//return(overlayClip);
}
function get overlayMatrix() {
return(_overlayMatrix);
}
function set overlayMatrix(m) {
_overlayMatrix = m;
//return(overlayMatrix);
}
function get overlayColorTransform() {
return(_overlayColorTransform);
}
function set overlayColorTransform(c) {
_overlayColorTransform = c;
//return(overlayColorTransform);
}
function get overlayBlendMode() {
return(_overlayBlendMode);
}
function set overlayBlendMode(b) {
_overlayBlendMode = b;
//return(overlayBlendMode);
}
function get overlayFilter() {
return(_overlayFilter);
}
function set overlayFilter(f) {
_overlayFilter = f;
//return(overlayFilter);
}
function get overlayFunction() {
return(_overlayFunction);
}
function set overlayFunction(f) {
_overlayFunction = f;
//return(overlayFunction);
}
function get overlayParent() {
return(_overlayParent);
}
function set overlayParent(m) {
_overlayParent = m;
createBitmaps(_overlayParent);
//return(overlayParent);
}
function get recursive() {
return(_recursive);
}
function set recursive(b) {
_recursive = b;
//return(recursive);
}
function get iterations() {
return(_iterations);
}
function set iterations(n) {
_iterations = Math.floor(n);
if (_iterations < 1) {
_iterations = 1;
}
//return(iterations);
}
function get scale() {
return(_scale);
}
function set scale(n) {
_scale = n;
if (_scale < 0.1) {
_scale = 0.1;
}
if (_scale > 1) {
_scale = 1;
}
_scaleMatrix = new flash.geom.Matrix(_scale, 0, 0, _scale, 0, 0);
createBitmaps(_overlayParent);
//return(scale);
}
function resetParameters() {
_overlayColorTransform = new flash.geom.ColorTransform();
_overlayMatrix = new flash.geom.Matrix();
_overlayFilter = null;
_overlayBlendMode = "normal";
_overlayFunction = null;
_iterations = 1;
_recursive = true;
}
function createBitmaps(parent) {
if (_overlayDisplay) {
_overlayDisplay.dispose();
}
if (_overlayBuffer) {
_overlayBuffer.dispose();
}
if (_overlayContainer) {
_overlayContainer.removeMovieClip();
}
_overlayDisplay = new flash.display.BitmapData(Math.ceil(Stage.width * _scale), Math.ceil(Stage.height * _scale), true, 0);
_overlayBuffer = new flash.display.BitmapData(Math.ceil(Stage.width * _scale), Math.ceil(Stage.height * _scale), true, 0);
_overlayContainer = parent.createEmptyMovieClip("overlay", OVERLAY_DEPTH);
_overlayContainer.attachBitmap(_overlayDisplay, 0, "auto", true);
}
static function tick() {
var _local1 = 0;
while (_local1 < _screenOverlays.length) {
_screenOverlays[_local1].render();
_local1++;
}
}
function render() {
if (!_started) {
return(undefined);
}
var _local4 = _overlayClip.transform.concatenatedMatrix;
var _local3 = _overlayParent.transform.concatenatedMatrix;
_local3.concat(_scaleMatrix);
_local3.invert();
_overlayContainer.transform.matrix = _local3;
_local4.concat(_scaleMatrix);
_overlayDisplay.fillRect(_overlayDisplay.rectangle, 0);
if (!_recursive) {
_overlayBuffer.draw(_overlayClip, _local4, _normalColorTransform, "normal", _overlayBuffer.rectangle);
}
_drawMatrix.a = 1;
_drawMatrix.b = 0;
_drawMatrix.c = 0;
_drawMatrix.d = 1;
_drawMatrix.tx = 0;
_drawMatrix.ty = 0;
_drawColorTransform.alphaMultiplier = 1;
_drawColorTransform.redMultiplier = 1;
_drawColorTransform.greenMultiplier = 1;
_drawColorTransform.blueMultiplier = 1;
_drawColorTransform.alphaOffset = 0;
_drawColorTransform.redOffset = 0;
_drawColorTransform.greenOffset = 0;
_drawColorTransform.blueOffset = 0;
if (_overlayFunction) {
_overlayFunction(_overlayBuffer);
}
var _local2 = 0;
while (_local2 < _iterations) {
_drawMatrix.translate((-Stage.width) / 2, (-Stage.height) / 2);
_drawMatrix.concat(_overlayMatrix);
_drawMatrix.translate(Stage.width / 2, Stage.height / 2);
_drawColorTransform.concat(_overlayColorTransform);
if (_overlayFilter) {
_overlayBuffer.applyFilter(_overlayBuffer, _overlayBuffer.rectangle, _origin, _overlayFilter);
}
_overlayDisplay.draw(_overlayBuffer, _drawMatrix, _drawColorTransform, _overlayBlendMode, _overlayDisplay.rectangle);
_local2++;
}
if (_recursive) {
_overlayBuffer.fillRect(_overlayBuffer.rectangle, 0);
_overlayContainer._visible = false;
_overlayBuffer.draw(_overlayClip, _local4, _normalColorTransform, "normal", _overlayBuffer.rectangle);
_overlayBuffer.draw(_overlayDisplay, _identityMatrix, _normalColorTransform, "normal", _overlayBuffer.rectangle);
_overlayContainer._visible = true;
}
}
function cleanup() {
stop();
var _local2 = 0;
while (_local2 < _screenOverlays.length) {
if (_screenOverlays[_local2] == this) {
_screenOverlays.splice(_local2, 1);
break;
}
_local2++;
}
if (_overlayDisplay) {
_overlayDisplay.dispose();
}
if (_overlayBuffer) {
_overlayBuffer.dispose();
}
if (_overlayContainer) {
_overlayContainer.removeMovieClip();
}
_overlayDisplay = null;
_overlayBuffer = null;
_overlayContainer = null;
_overlayMatrix = null;
_drawMatrix = null;
_overlayParent = null;
_overlayColorTransform = null;
_overlayFilter = null;
_overlayFunction = null;
_normalColorTransform = null;
_identityMatrix = null;
_origin = null;
_scaleMatrix = null;
_screenRectangle = null;
}
static var _screenOverlays = [];
var OVERLAY_DEPTH = 999990;
}
Symbol 454 MovieClip Frame 1
stop();
Symbol 463 Button
on (press) {
gotoAndPlay ("end");
}
Symbol 480 MovieClip Frame 87
gotoAndPlay (1);
Symbol 480 MovieClip Frame 88
s_titlescreen.stop();
s_static = new Sound(this);
s_static.attachSound("sound_static.wav");
s_static.start(0, 1000);
Symbol 480 MovieClip Frame 155
s_static.stop();
Symbol 480 MovieClip Frame 157
s_static.start(0, 100);
Symbol 480 MovieClip Frame 159
s_static.stop();
Symbol 480 MovieClip Frame 161
s_static.start(0, 100);
Symbol 480 MovieClip Frame 163
s_static.stop();
Symbol 480 MovieClip Frame 168
s_static.start(0, 100);
Symbol 480 MovieClip Frame 173
s_static.stop();
Symbol 480 MovieClip Frame 410
_root.nextFrame();
Symbol 488 Button
on (release) {
stopAllSounds();
getURL ("http://tomfulp.newgrounds.com", "_blank");
}
Symbol 489 Button
on (release) {
stopAllSounds();
getURL ("http://mindchamber.newgrounds.com", "_blank");
}
Symbol 490 Button
on (release) {
stopAllSounds();
getURL ("http://krinkels.newgrounds.com", "_blank");
}
Symbol 491 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/audio/listen/92334", "_blank");
}
Symbol 492 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/audio/listen/171975", "_blank");
}
Symbol 493 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/audio/listen/170120", "_blank");
}
Symbol 494 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/audio/listen/140436", "_blank");
}
Symbol 496 Button
on (release) {
stopAllSounds();
getURL ("http://mike.newgrounds.com", "_blank");
}
Symbol 562 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 570 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/store/product/madness-error-shirt", "_blank");
}
Symbol 574 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/store/product/madness-hank-shirt", "_blank");
}
Symbol 575 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/collection/madnessday2008", "_blank");
}
Symbol 583 Button
on (release) {
stopAllSounds();
gotoAndPlay ("replay");
}
Symbol 584 MovieClip Frame 1
stop();
Symbol 584 MovieClip Frame 2
play();
Instance of Symbol 15 MovieClip [empty] in Symbol 584 MovieClip Frame 2
onClipEvent (load) {
res = 1;
_root.f_MosaicScreen(res);
}
onClipEvent (enterFrame) {
res = res + 2;
_root.f_MosaicScreen(res);
}
Symbol 584 MovieClip Frame 20
_root.f_Clear();
_root.f_BackupStats();
_root.spawnpoint = spawnpoint;
_root.gotoAndPlay(warpto);
gotoAndPlay ("fadein");
Symbol 584 MovieClip Frame 22
play();
Instance of Symbol 15 MovieClip [empty] in Symbol 584 MovieClip Frame 23
onClipEvent (load) {
res = 40;
_root.f_MosaicScreen(res);
}
onClipEvent (enterFrame) {
res = res - 2;
_root.f_MosaicScreen(res);
}
Symbol 584 MovieClip Frame 42
stop();
_root.f_MosaicScreen(0);
Symbol 584 MovieClip Frame 55
play();
Instance of Symbol 15 MovieClip [empty] in Symbol 584 MovieClip Frame 56
onClipEvent (load) {
if (_parent.warpto == "level1_4intro") {
u_temp = true;
}
}
onClipEvent (enterFrame) {
if (u_temp) {
u_volume = _root.s_oceanside.s_oceanside.getVolume();
_root.s_oceanside.s_oceanside.setVolume(u_volume - 2);
}
}
Symbol 584 MovieClip Frame 101
_root.screenOverlay.stop();
if (warpto == "level1_4intro") {
_root.s_oceanside.s_oceanside.stop();
}
_root.f_Clear();
_root.f_BackupStats();
if (_root.gameover) {
_root.stats.health = _root.stats.health_max;
}
_root.spawnpoint = spawnpoint;
_root.gotoAndPlay(warpto);
gotoAndPlay ("fadein");
Symbol 584 MovieClip Frame 102
play();
Symbol 584 MovieClip Frame 133
stop();
Symbol 584 MovieClip Frame 134
play();
Symbol 584 MovieClip Frame 141
stop();
Symbol 584 MovieClip Frame 155
play();
_root.f_MosaicScreen(0);
Symbol 584 MovieClip Frame 362
stop();
Symbol 584 MovieClip Frame 420
_root.gotoAndStop(1);
Symbol 589 MovieClip Frame 1
gotoAndStop (2);
Symbol 589 MovieClip Frame 11
_root.s_power24.start(0, 0);
Symbol 589 MovieClip Frame 36
gotoAndStop (2);
Symbol 593 MovieClip Frame 1
stop();
Symbol 593 MovieClip Frame 2
health.health.text = _root.f_HealthText(_root.p1.health);
play();
Symbol 593 MovieClip Frame 81
stop();
Symbol 601 MovieClip Frame 1
_quality = "medium";
i = 1;
gotoAndStop (2);
Instance of Symbol 100 MovieClip in Symbol 601 MovieClip Frame 1
onClipEvent (enterFrame) {
_root.f_Quality(_parent);
}
Symbol 601 MovieClip Frame 2
stop();
Instance of Symbol 100 MovieClip in Symbol 601 MovieClip Frame 3
onClipEvent (enterFrame) {
_root.f_Quality(_parent);
_parent.timer--;
if (_parent.timer <= 0) {
_parent.gotoAndStop("blank");
}
}
Symbol 615 MovieClip Frame 36
gotoAndPlay (1);
Symbol 620 MovieClip Frame 1
stop();
Symbol 635 MovieClip Frame 1
_root.f_AddNeutral(this);
Symbol 647 MovieClip Frame 1
stop();
Symbol 647 MovieClip Frame 2
_root.camera.prey = this;
_root.p1.wait = true;
play();
Symbol 647 MovieClip Frame 7
_root.s_elevatordoor.start(0, 0);
Symbol 647 MovieClip Frame 56
_root.f_AddNeutral(this);
Symbol 647 MovieClip Frame 75
_root.s_elevatordoor.start(0, 0);
Symbol 647 MovieClip Frame 114
_root.p1.wait = true;
_parent.chase_cam.gotoAndPlay("jebus");
stop();
Symbol 648 MovieClip Frame 1
_root.f_AddWall(this, z_wall);
z_wall.sticky = true;
gotoAndStop (2);
Symbol 654 MovieClip Frame 1
_root.f_SetHand(this);
Symbol 658 MovieClip Frame 1
_root.f_SetHand(this);
Symbol 662 MovieClip Frame 1
_root.f_SetHand(this);
Symbol 667 MovieClip Frame 1
gotoAndStop (2);
Symbol 671 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 3 MovieClip in Symbol 674 MovieClip Frame 1
onClipEvent (load) {
_root.f_InsertObject(_parent._parent, _root.a_Enemies);
_parent._parent.w = _parent._width / 2;
_parent._parent.h = _parent._height;
}
onClipEvent (unload) {
_root.f_RemoveObject(_parent._parent, _root.a_Enemies);
}
Symbol 683 MovieClip Frame 6
stop();
Symbol 691 MovieClip Frame 4
stop();
Symbol 697 MovieClip Frame 8
_parent.gotoAndStop("stand");
Symbol 702 MovieClip Frame 1
_root.f_SetHand(this);
Symbol 705 MovieClip Frame 1
_root.f_ImpactPoint(this);
Symbol 705 MovieClip Frame 2
gotoAndPlay (1);
Symbol 706 MovieClip Frame 3
_parent.force_x = 12;
_parent.force_y = 0;
_parent.slide_x = 0;
Symbol 706 MovieClip Frame 6
if (!_parent.u_hit) {
gotoAndPlay ("finish");
}
Symbol 706 MovieClip Frame 9
play();
Symbol 706 MovieClip Frame 10
_root.f_EndPunch(_parent);
Symbol 710 MovieClip Frame 4
_root.f_SetForceX(_parent, 12);
_parent.force_y = -8;
_parent.slide_x = 12;
Symbol 710 MovieClip Frame 7
if (!_parent.u_hit) {
gotoAndPlay ("finish");
}
Symbol 710 MovieClip Frame 11
play();
Symbol 710 MovieClip Frame 13
_root.f_EndPunch(_parent);
Symbol 716 MovieClip Frame 8
if (_parent.platform == undefined) {
_parent.gotoAndStop("toss");
} else if (_parent.health <= 0) {
_parent.gotoAndStop("hitground");
} else {
_parent.gotoAndStop("stand");
}
Symbol 717 MovieClip Frame 2
stop();
Symbol 719 MovieClip Frame 2
stop();
Symbol 723 MovieClip Frame 1
_root.f_SetHand(this);
Symbol 724 MovieClip Frame 10
gotoAndPlay ("loop");
Symbol 725 MovieClip Frame 1
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 725 MovieClip Frame 2
onClipEvent (enterFrame) {
if (_parent._parent.speed_y >= 0) {
_parent.gotoAndStop(3);
}
}
Symbol 726 MovieClip Frame 2
_parent.gotoAndStop("toss2");
Symbol 737 MovieClip Frame 6
if (_parent.health <= 0) {
_parent.alive = false;
if (_parent.body_type == 3) {
gotoAndPlay ("die2");
} else {
gotoAndPlay ("die");
}
}
Symbol 737 MovieClip Frame 20
_root.f_EndPunch(_parent);
Symbol 737 MovieClip Frame 45
_root.f_RemoveEnemy(_parent);
stop();
Symbol 737 MovieClip Frame 46
_root["s_zombiedie" + (random(3) + 1)].start(0, 0);
Symbol 737 MovieClip Frame 70
_root.f_RemoveEnemy(_parent);
stop();
Symbol 737 MovieClip Frame 71
play();
Symbol 737 MovieClip Frame 95
_parent.body_type = 3;
_parent.head_type = 3;
_parent.face_type = 3;
_parent.alive = true;
_parent.health = _parent.health_max;
_parent.wait = true;
Symbol 737 MovieClip Frame 117
_root.f_EndPunch(_parent);
Symbol 812 MovieClip Frame 1
s_welding = new Sound(this);
s_welding.attachSound("welding.wav");
s_welding.start(0, 0);
Instance of Symbol 100 MovieClip in Symbol 812 MovieClip Frame 2
onClipEvent (load) {
i = 1;
x = (_parent._x + _parent._parent._x) + _parent._parent._parent._x;
scale = _parent._parent._xscale / 100;
y = _parent._parent._parent._y;
}
onClipEvent (enterFrame) {
i++;
if ((i % 1) == 0) {
var u_scale = (60 + random(40));
var u_temp = _root.f_ShrapnelGeneral((x + (_parent.spark._x * scale)) - 20, y - 5, y + 1, -4 + random(8), -(8 + random(15)), "spark");
u_temp.bounce_limit = 1;
u_temp._xscale = 50 + random(50);
u_temp._yscale = 50 + random(50);
u_temp.weight = 1 + (random(100) / 100);
u_temp.fp_ShrapnelEnd = _root.f_ShrapnelVanish;
}
}
Symbol 812 MovieClip Frame 95
_root.game.game.ceiling.gotoAndPlay("go");
Symbol 812 MovieClip Frame 190
s_welding.stop();
_parent._parent.phase = 10;
_parent._parent.gotoAndStop("stand");
Symbol 814 MovieClip Frame 1
if (!init) {
init = true;
expand = 0;
}
var u_size = (80 + random(30));
_root.f_FX(((_parent.x - _parent.w) - expand) + random((_parent.w * 2) + (expand * 2)), (_parent.y + expand) - random(_parent.h + (expand * 2)), _parent.y + 10, "blood1", u_size, u_size);
Symbol 814 MovieClip Frame 2
var u_size = (80 + random(30));
_root.f_FX(((_parent.x - _parent.w) - expand) + random((_parent.w * 2) + (expand * 2)), (_parent.y + expand) - random(_parent.h + (expand * 2)), _parent.y + 10, "blood1", u_size, u_size);
Symbol 814 MovieClip Frame 3
_parent.explosions--;
if (_parent.explosions > 0) {
expand = expand + 10;
gotoAndPlay (1);
} else {
stop();
}
Symbol 815 MovieClip Frame 1
if (delay) {
gotoAndStop ("blank");
} else {
_root.f_InitHencher(this);
}
Symbol 815 MovieClip Frame 2
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 815 MovieClip Frame 2
onClipEvent (enterFrame) {
_root.f_OnScreenActivate(_parent);
}
Symbol 815 MovieClip Frame 3
if (delay) {
_root.f_InitHencher(this);
}
_root.f_AddEnemy(this);
_root.f_AddEnemyPush(this);
if (!platform) {
_root.f_PY(this, 20);
}
if (goframe) {
gotoAndStop(goframe);
} else {
gotoAndStop ("walk");
}
Symbol 815 MovieClip Frame 4
_root.f_HencherDefaults(this);
if (head_type == 3) {
_root.zombiesound = true;
}
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 815 MovieClip Frame 4
onClipEvent (enterFrame) {
_parent.gun._x = (_parent.body.gun._x * 0.5) + _parent.body._x;
_parent.gun._y = (_parent.body.gun._y * 0.5) + _parent.body._y;
}
Instance of Symbol 15 MovieClip [empty] in Symbol 815 MovieClip Frame 4
onClipEvent (enterFrame) {
_root.f_Hencher(_parent);
}
Instance of Symbol 15 MovieClip [empty] in Symbol 815 MovieClip Frame 4
onClipEvent (enterFrame) {
_root.f_GeneralTimers(_parent);
}
Symbol 815 MovieClip Frame 7
punching = false;
Instance of Symbol 15 MovieClip [empty] in Symbol 815 MovieClip Frame 12
onClipEvent (enterFrame) {
if (_parent.u_hit) {
_root.f_ForceSlide(_parent);
}
}
Symbol 815 MovieClip Frame 13
_root.f_DropGun(this);
Instance of Symbol 15 MovieClip [empty] in Symbol 815 MovieClip Frame 13
onClipEvent (enterFrame) {
if (!_root.f_CharJumping(_parent)) {
_root.f_ForceSlideBack(_parent);
}
}
Symbol 815 MovieClip Frame 15
_root.f_TossPose(this);
Instance of Symbol 15 MovieClip [empty] in Symbol 815 MovieClip Frame 15
onClipEvent (enterFrame) {
_root.f_Toss(_parent);
}
Symbol 815 MovieClip Frame 18
_root.f_DropGun(this);
gotoAndStop ("toss2");
Symbol 815 MovieClip Frame 24
_root.s_bodyfall3.start(0, 0);
_root.f_ShakeY(10);
Symbol 815 MovieClip Frame 25
explosions = 6;
if (_xscale > 0) {
var u_speed_x = (-(force_x + random(3)));
} else {
var u_speed_x = (force_x + random(3));
}
var u_speed_y = force_y;
var u_temp = _root.f_ShrapnelGeneral(x, y - 70, y + 1, u_speed_x, -20, "hencher_head");
u_temp.bounce_limit = 2;
u_temp._xscale = _xscale;
u_temp.fp_ShrapnelEnd = _root.f_ShrapnelSplatter;
var u_temp = _root.f_ShrapnelGeneral(x, y - 10, y + 1, u_speed_x * 0.75, -10, "hencher_body");
u_temp.bounce_limit = 1;
u_temp._xscale = _xscale;
u_temp.fp_ShrapnelEnd = _root.f_ShrapnelSplatter;
var u_temp = _root.f_ShrapnelGeneral(x, y, y + 1, u_speed_x * 0.75, -5, "hencher_foot");
u_temp.bounce_limit = 1;
u_temp._xscale = _xscale;
u_temp.fp_ShrapnelEnd = _root.f_ShrapnelSplatter;
var u_temp = _root.f_ShrapnelGeneral(x, y - 50, y + 1, u_speed_x * 0.75, -12, "hencher_hand");
u_temp.bounce_limit = 1;
u_temp._xscale = _xscale;
u_temp.fp_ShrapnelEnd = _root.f_ShrapnelSplatter;
_root.f_RemoveEnemy(this);
Symbol 818 MovieClip Frame 1
stop();
Symbol 865 MovieClip Frame 34
_root.f_MakeZombies();
Symbol 865 MovieClip Frame 130
_root.camera.paused = true;
_root.fader.spawnpoint = 1;
_root.fader.warpto = "level1_3";
_root.fader.gotoAndPlay("fadeout");
stop();
Symbol 866 MovieClip Frame 1
head_type = 1;
gotoAndStop (2);
Instance of Symbol 15 MovieClip [empty] in Symbol 866 MovieClip Frame 3
onClipEvent (load) {
timer = 60;
_parent._x = -100 - _root.game_x;
}
onClipEvent (enterFrame) {
if ((_parent._x + _root.game_x) < 250) {
_parent._x = _parent._x + 8;
} else {
timer--;
if (timer <= 0) {
_parent.gotoAndStop("zombies");
}
}
}
Symbol 867 MovieClip Frame 1
_root.f_ObjectPush(this, _root.a_Events);
Instance of Symbol 3 MovieClip in Symbol 867 MovieClip Frame 1
onClipEvent (load) {
_root.f_InsertObject(_parent, _root.a_Walls);
_parent._parent.w = _parent._width;
_parent._parent.h = _parent._height;
}
onClipEvent (unload) {
_root.f_RemoveObject(_parent, _root.a_Walls);
}
Symbol 868 MovieClip Frame 1
gotoAndStop (2);
Symbol 893 MovieClip Frame 1
stop();
Symbol 896 MovieClip Frame 1
stop();
Symbol 909 MovieClip Frame 1
stop();
Symbol 927 MovieClip Frame 1
stop();
Symbol 934 MovieClip Frame 1
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 934 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.gunshooting) {
_parent.gotoAndStop(2);
} else {
_parent.gotoAndStop(1);
}
}
Instance of Symbol 3 MovieClip in Symbol 938 MovieClip Frame 1
onClipEvent (load) {
_parent._parent.w = _parent._width / 2;
_parent._parent.h = _parent._height;
}
Symbol 941 MovieClip Frame 12
gotoAndPlay ("loop");
Symbol 945 MovieClip Frame 1
_parent.gun.gun.gun.gotoAndStop("blank");
Symbol 945 MovieClip Frame 8
_parent.gun.gun.gun.gotoAndStop(_parent.gun_type);
play();
Symbol 945 MovieClip Frame 16
gotoAndPlay ("loop");
Symbol 947 MovieClip Frame 1
stop();
Symbol 950 MovieClip Frame 21
if (_parent.health > 0) {
_parent.gotoAndStop("stand");
} else {
_root.f_GameOver();
stop();
}
Symbol 951 MovieClip Frame 1
stop();
Symbol 951 MovieClip Frame 2
onground = false;
gun.gun.gun.gotoAndStop(gun_type);
if (_xscale > 0) {
body._rotation = platform.slope;
} else {
body._rotation = -platform.slope;
}
if (autowalk_timer > 0) {
gun.gun.gun.gun.gotoAndStop("idle");
gun.gotoAndStop(15);
gotoAndStop ("autowalk");
}
Instance of Symbol 15 MovieClip [empty] in Symbol 951 MovieClip Frame 2
onClipEvent (enterFrame) {
_parent.gun._x = (_parent.body.gun._x * 0.5) + _parent.body._x;
_parent.gun._y = (_parent.body.gun._y * 0.5) + _parent.body._y;
}
Instance of Symbol 15 MovieClip [empty] in Symbol 951 MovieClip Frame 2
onClipEvent (enterFrame) {
_root.f_Controls(_parent);
}
Instance of Symbol 15 MovieClip [empty] in Symbol 951 MovieClip Frame 2
onClipEvent (enterFrame) {
_root.f_Timers(_parent);
}
Symbol 951 MovieClip Frame 4
gun.gun.gun.gotoAndStop(gun_type);
if (_xscale > 0) {
body._rotation = platform.slope;
} else {
body._rotation = -platform.slope;
}
Symbol 951 MovieClip Frame 5
gun.gun.gun.gotoAndStop(gun_type);
Symbol 951 MovieClip Frame 7
_root.f_TossPose(this);
Instance of Symbol 15 MovieClip [empty] in Symbol 951 MovieClip Frame 7
onClipEvent (enterFrame) {
_root.f_Toss(_parent);
}
Symbol 951 MovieClip Frame 8
gun.gun.gun.gotoAndStop(gun_type);
gun.gun.gun.gun.gotoAndStop("idle");
gun.gotoAndStop(20);
gun._x = 0;
gun._y = -20;
Symbol 951 MovieClip Frame 9
gun.gun.gun.gotoAndStop(gun_type);
gun.gun.gun.gun.gotoAndStop("idle");
gun.gotoAndStop(20);
gun._x = 0;
gun._y = -20;
Symbol 951 MovieClip Frame 10
gun.gun.gun.gotoAndStop(gun_type);
gun.gun.gun.gun.gotoAndStop("idle");
gun.gotoAndStop(20);
gun._x = 0;
gun._y = -10;
Symbol 951 MovieClip Frame 11
_root.f_PY(this, 5);
Instance of Symbol 15 MovieClip [empty] in Symbol 951 MovieClip Frame 11
onClipEvent (enterFrame) {
if (_parent.autowalk_timer > 0) {
_parent.autowalk_timer--;
_parent.gun._x = (_parent.body.gun._x * 0.5) + _parent.body._x;
_parent.gun._y = (_parent.body.gun._y * 0.5) + _parent.body._y;
if (_parent._xscale > 0) {
_root.f_MoveH(_parent, _parent.speed_x_max);
} else {
_root.f_MoveH(_parent, -_parent.speed_x_max);
}
} else {
_parent.gotoAndStop("stand");
}
}
Symbol 951 MovieClip Frame 12
gun.gun.gun.gotoAndStop(gun_type);
gun.gun.gun.gun.gotoAndStop("idle");
gun.gotoAndStop(15);
Instance of Symbol 15 MovieClip [empty] in Symbol 951 MovieClip Frame 12
onClipEvent (enterFrame) {
_parent.gun._x = (_parent.body.gun._x * 0.5) + _parent.body._x;
_parent.gun._y = (_parent.body.gun._y * 0.5) + _parent.body._y;
}
Symbol 953 MovieClip Frame 1
gotoAndStop (2);
Symbol 955 MovieClip Frame 1
gotoAndPlay (2);
Symbol 955 MovieClip Frame 90
_root.limit_top = _root.game.game.limit_top2._y;
stop();
Symbol 956 MovieClip Frame 1
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 956 MovieClip Frame 2
onClipEvent (enterFrame) {
if (((_parent._x + _root.game_x) - 100) < _root.screenWidth) {
if (_root.a_Enemies.length <= 0) {
_root.arrow.gotoAndPlay("go");
_root.limit_right = _parent.next_limit._x;
_parent.next_limit.gotoAndStop("on");
_parent.gotoAndStop("off");
}
}
}
Symbol 958 MovieClip Frame 1
gotoAndStop (2);
Symbol 959 MovieClip Frame 1
stop();
Symbol 959 MovieClip Frame 2
_y = _root.p1._y;
_root.camera.prey = camera;
play();
Symbol 959 MovieClip Frame 7
var i = 0;
for (n in _root.a_EnemiesLog) {
i++;
var u_p = _root.a_EnemiesLog[n];
if (i == 1) {
left = u_p;
} else if (u_p.x < left.x) {
left = u_p;
}
}
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 959 MovieClip Frame 7
onClipEvent (load) {
speed = 1;
}
onClipEvent (enterFrame) {
_parent.camera._x = _parent.camera._x - speed;
speed = speed + 4;
if (speed > 40) {
speed = 40;
}
var i = 0;
for (n in _root.a_EnemiesLog) {
var u_p = _root.a_EnemiesLog[n];
if ((u_p.x + _root.game_x) < (_root.screenWidth - 100)) {
if ((u_p.x + _root.game_x) > 0) {
i++;
}
}
if ((i >= 2) or ((_parent.left.x + _root.game_x) > 0)) {
_parent.gotoAndPlay("finish");
}
}
}
Symbol 959 MovieClip Frame 8
_parent.jebus.gotoAndStop("walk");
play();
Symbol 959 MovieClip Frame 26
stop();
Instance of Symbol 14 MovieClip [l2] "floor1" in Symbol 960 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 2;
}
Instance of Symbol 648 MovieClip in Symbol 960 MovieClip Frame 1
onClipEvent (load) {
z_wall.texture = 2;
}
Instance of Symbol 815 MovieClip in Symbol 960 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
gun_type = 1;
phase = 10;
face_type = 2;
head_type = 1;
body_type = 2;
shot_range_y = 400;
}
Instance of Symbol 815 MovieClip in Symbol 960 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
gun_type = 1;
phase = 10;
face_type = 2;
head_type = 1;
body_type = 2;
shot_range_y = 400;
}
Instance of Symbol 815 MovieClip in Symbol 960 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
gun_type = 1;
phase = 10;
face_type = 2;
head_type = 1;
body_type = 2;
shot_range_y = 400;
}
Instance of Symbol 815 MovieClip in Symbol 960 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
gun_type = 1;
phase = 10;
face_type = 2;
head_type = 1;
body_type = 2;
shot_range_y = 400;
shot_timer = 1;
}
Instance of Symbol 815 MovieClip in Symbol 960 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
gun_type = 1;
phase = 10;
face_type = 2;
head_type = 1;
body_type = 2;
shot_range_y = 400;
shot_timer = 5;
}
Instance of Symbol 815 MovieClip in Symbol 960 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
gun_type = 1;
phase = 10;
face_type = 2;
head_type = 1;
body_type = 2;
shot_range_y = 400;
shot_timer = 10;
}
Instance of Symbol 815 MovieClip in Symbol 960 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
gun_type = 1;
phase = 10;
face_type = 2;
head_type = 1;
body_type = 2;
shot_range_y = 400;
}
Instance of Symbol 960 MovieClip "game" in Symbol 961 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.go == true) {
_root.main();
}
}
Symbol 982 MovieClip Frame 1
stop();
Instance of Symbol 100 MovieClip in Symbol 982 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.p1.platform == _parent._parent.cannon_box.z_platform) {
if (!init) {
init = true;
_root.keys.gotoAndPlay("go");
}
_root.limit_top = _root.game.game.limit_top._y;
_root.p1.gotoAndStop("blank");
_parent.gotoAndPlay("go");
}
if (_root.p1.platform == _parent._parent.cliff.z_platform) {
_root.limit_top = _root.game.game.limit_top._y;
}
}
Symbol 982 MovieClip Frame 2
_root.s_thwomp.start(0, 0);
play();
Symbol 982 MovieClip Frame 49
_root.s_explosion3.start(0, 0);
Symbol 982 MovieClip Frame 51
_root.p1.smoke_timer = 60;
_root.p1.x = spawn1._x + _x;
_root.p1.y = spawn1._y + _y;
_root.p1._x = _root.p1.x;
_root.p1._y = _root.p1.y;
_root.f_ForceJump(_root.p1, 18, -70);
_root.p1.jumps = _root.doublejump + 1;
_root.limit_top = _root.game.game.limit_top2._y;
_root.shake_x = 20;
Symbol 987 MovieClip Frame 1
gotoAndPlay(random(11) + 2);
Symbol 987 MovieClip Frame 14
gotoAndPlay (2);
Symbol 992 MovieClip Frame 1
_root.f_AddNeutral(this);
Symbol 1011 MovieClip Frame 1
stop();
Symbol 1012 MovieClip Frame 1
_root.f_AddNeutral(this);
Symbol 1013 MovieClip Frame 1
_root.f_AddWall(this, z_wall);
_root.f_AddPlatform(this, z_platform);
this.fp_Hit1 = _root.f_HitSkylight;
health = 6;
alive = true;
texture = 2;
_root.f_AddEnemy(this);
gotoAndStop (2);
Symbol 1015 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 10 MovieClip [l3] "cannon_box" in Symbol 1016 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 2;
z_wall.texture = 2;
}
Instance of Symbol 1013 MovieClip "skylight" in Symbol 1016 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 100;
z_wall.texture = 100;
}
Instance of Symbol 10 MovieClip [l3] "cliff" in Symbol 1016 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 1;
}
Instance of Symbol 815 MovieClip in Symbol 1016 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
gun_type = 1;
phase = 10;
face_type = 2;
head_type = 1;
body_type = 2;
shot_range_y = 400;
}
Instance of Symbol 815 MovieClip in Symbol 1016 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
gun_type = 1;
phase = 10;
face_type = 2;
head_type = 1;
body_type = 2;
shot_range_y = 400;
}
Instance of Symbol 815 MovieClip in Symbol 1016 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
gun_type = 1;
phase = 3;
face_type = 2;
head_type = 1;
body_type = 2;
shot_range_y = 400;
shot_timer = 15;
}
Instance of Symbol 815 MovieClip in Symbol 1016 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
gun_type = 1;
phase = 3;
face_type = 2;
head_type = 1;
body_type = 2;
shot_range_y = 700;
shot_timer = 10;
}
Instance of Symbol 1016 MovieClip "game" in Symbol 1017 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.go == true) {
_root.main();
}
}
Symbol 1035 MovieClip Frame 1
gotoAndPlay (2);
Symbol 1035 MovieClip Frame 61
stop();
Symbol 1035 MovieClip Frame 321
stop();
Symbol 1045 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 1048 MovieClip "body" in Symbol 1049 MovieClip Frame 1
onClipEvent (enterFrame) {
_y = (_y + _root.elevator_speed);
if ((_y + _root.game_y) > 0) {
_y = (_y - 712);
}
if ((_y + _root.game_y) < -800) {
_y = (_y + 712);
}
}
Instance of Symbol 1048 MovieClip in Symbol 1049 MovieClip Frame 1
onClipEvent (enterFrame) {
_y = (_y - _root.elevator_speed);
if (((_y + _parent._y) + _root.game_y) > 0) {
_y = (_y - 712);
}
if (((_y + _parent._y) + _root.game_y) < -800) {
_y = (_y + 712);
}
}
Symbol 1059 MovieClip Frame 1
stop();
Symbol 1059 MovieClip Frame 2
play();
Symbol 1059 MovieClip Frame 106
_root.f_RemoveWall(_root.game.game.vent.z_wall);
_root.f_RemovePlatform(_root.game.game.vent.z_platform);
Symbol 1059 MovieClip Frame 109
_parent.gunner.wait = false;
stop();
Symbol 1066 MovieClip Frame 1
stop();
Instance of Symbol 1065 MovieClip in Symbol 1066 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + _root.elevator_speed);
}
Symbol 1066 MovieClip Frame 25
gotoAndPlay (1);
Symbol 1079 MovieClip Frame 1
stop();
Instance of Symbol 1065 MovieClip in Symbol 1079 MovieClip Frame 2
onClipEvent (enterFrame) {
_rotation = (_rotation + _root.elevator_speed);
}
Symbol 1082 MovieClip Frame 1
_root.f_AddNeutral(this);
stop();
Symbol 1082 MovieClip Frame 6
_root.f_RemoveWall(_root.game.game.vent.z_wall);
_root.f_RemovePlatform(_root.game.game.vent.z_platform);
play();
Symbol 1082 MovieClip Frame 11
stop();
Symbol 1084 MovieClip Frame 1
_root.f_AddNeutral(this);
gotoAndStop (2);
Symbol 1093 MovieClip Frame 1
stop();
Symbol 1093 MovieClip Frame 2
play();
Symbol 1093 MovieClip Frame 30
stop();
Symbol 1095 MovieClip Frame 1
phase = 1;
timer = 0;
shake_timer = 0;
s_elevator = new Sound(this);
s_elevator.attachSound("sound_elevator.wav");
s_elevator.start(0, 2000);
s_elevator.setVolume(0);
s_elevatorbusted = new Sound(this);
s_elevatorbusted.attachSound("sound_elevator_busted2.wav");
gotoAndPlay (2);
Symbol 1095 MovieClip Frame 2
_root.f_RemovePlatform(_root.game.game.ramp1.z_platform);
_root.f_RemovePlatform(_root.game.game.ramp2.z_platform);
play();
Symbol 1095 MovieClip Frame 20
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 1095 MovieClip Frame 20
onClipEvent (enterFrame) {
var u_volume = _parent.s_elevator.getVolume();
if (u_volume < 100) {
_parent.s_elevator.setVolume(u_volume + 1);
}
if (_root.elevatorbreak) {
max = -80;
_root.elevator_speed = _root.elevator_speed - 0.8;
if (_root.elevator_speed < 0) {
if (!sparks) {
sparks = true;
_parent._parent.sparks.gotoAndPlay("go");
}
}
var u_volume = _parent.s_elevatorbusted.getVolume();
if (u_volume < 100) {
_parent.s_elevatorbusted.setVolume(u_volume + 1);
}
} else {
max = -30;
_root.elevator_speed = _root.elevator_speed - 0.05;
}
if (_root.elevator_speed < max) {
_root.elevator_speed = max;
}
_parent.timer++;
if ((_parent.timer > 90) and (_parent.phase == 1)) {
_parent._parent.welder.gotoAndStop("activate");
_parent.phase = 2;
} else if ((_parent.timer > 260) and (_parent.phase == 2)) {
_parent._parent.gunner.gotoAndStop("activate");
_parent.phase = 3;
} else if ((_parent.timer > 300) and (_parent.phase == 3)) {
if (!_parent._parent.gunner.alive) {
_parent._parent.welder.phase = 1;
}
if (_root.a_Enemies.length <= 0) {
_parent._parent.zombie1.gotoAndStop("activate");
_parent.phase = 4;
} else {
_parent.timer = 300;
}
} else if ((_parent.timer > 400) and (_parent.phase == 4)) {
_parent._parent.zombie2.gotoAndStop("activate");
_parent._parent.zombie2.force_x = 0;
_parent._parent.zombie2.force_y = -15;
_root.f_HitToss(_parent._parent.zombie2);
_parent.phase = 5;
} else if ((_parent.timer > 450) and (_parent.phase == 5)) {
_parent._parent.zombie3.gotoAndStop("activate");
_parent.phase = 6;
} else if ((_parent.timer > 450) and (_parent.phase == 6)) {
if (_root.a_Enemies.length <= 0) {
_root.shake_x = 30;
_root.elevator_speed = 20;
_root.elevatorbreak = true;
_root.s_elevatorbreak.start(0, 0);
_parent.s_elevatorbusted.start(0, 2000);
_parent.s_elevatorbusted.setVolume(0);
_parent.phase = 7;
_parent.timer = 450;
}
} else if ((_parent.timer > 460) and (_parent.phase == 7)) {
if (_root.a_Enemies.length <= 0) {
_parent._parent.zombie4.gotoAndStop("activate");
_parent._parent.zombie4.force_x = 0;
_parent._parent.zombie4.force_y = -20;
_root.f_HitToss(_parent._parent.zombie4);
_parent.phase = 8;
} else {
_parent.timer = 460;
}
} else if ((_parent.timer > 520) and (_parent.phase == 8)) {
_parent._parent.zombie5.gotoAndStop("activate");
_parent._parent.zombie5.force_x = 0;
_parent._parent.zombie5.force_y = -15;
_root.f_HitToss(_parent._parent.zombie5);
_parent.phase = 9;
} else if ((_parent.timer > 560) and (_parent.phase == 9)) {
_parent._parent.zombie6.gotoAndStop("activate");
_parent._parent.zombie6.force_x = 0;
_parent._parent.zombie6.force_y = -25;
_root.f_HitToss(_parent._parent.zombie6);
_parent.phase = 10;
} else if (_parent.phase == 10) {
if (_root.a_Enemies.length <= 0) {
_parent.phase = 20;
}
} else if (_parent.phase == 20) {
_root.f_RemoveWall(_root.game.game.wall1.z_wall);
_root.limit_right = _root.game.game.limit_right2._x;
_root.game.game.hall.gotoAndStop("on");
_root.game.game.light1.gotoAndStop("on");
_root.game.game.elevator_room.gotoAndStop(2);
_root.game.game.elevator_roof.gotoAndStop(2);
_root.game.game.ceiling.gotoAndStop("blank");
_root.f_AddPlatform(_root.game.game.ramp1, _root.game.game.ramp1.z_platform);
_root.f_AddPlatform(_root.game.game.ramp2, _root.game.game.ramp2.z_platform);
_root.f_RemovePlatform(_root.game.game.roof1.z_platform);
_root.f_RemovePlatform(_root.game.game.roof2.z_platform);
_root.f_RemoveWall(_root.game.game.roof1.z_wall);
_root.f_RemoveWall(_root.game.game.roof2.z_wall);
_root.f_RemoveWall(_root.game.game.elevator_wall2.z_wall);
if (_root.p1.platform) {
_root.p1.force_x = 0;
_root.p1.force_y = -20;
_root.f_HitToss(_root.p1);
}
_parent._parent.welder.force_x = 0;
_parent._parent.welder.force_y = -15;
_root.f_HitToss(_parent._parent.welder);
_parent._parent.gunner.force_x = 0;
_parent._parent.gunner.force_y = -20;
_root.f_HitToss(_parent._parent.gunner);
_root.fader.gotoAndPlay("flash");
_root.shake_y = 40;
_root.elevator_speed = 0;
_root.s_explosion3.start(0, 0);
_parent._parent.sparks.gotoAndStop(1);
_root.screenOverlay.stop();
_parent.gotoAndStop("finish");
}
if ((_parent.phase >= 7) and (_parent.phase < 20)) {
if (_parent.timer > 490) {
_parent.shake_timer++;
if (_parent.shake_timer > 101) {
_parent.shake_timer = 2;
}
if ((_parent.shake_timer % 4) == 0) {
_root.shake_x = Math.abs(_root.elevator_speed) / 4;
}
}
}
}
Symbol 1095 MovieClip Frame 21
s_elevator.stop();
Instance of Symbol 100 MovieClip in Symbol 1096 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.y = _parent._y;
_parent.x = _parent._x + _parent.body._x;
}
Instance of Symbol 1040 MovieClip "shaft" in Symbol 1097 MovieClip Frame 1
onClipEvent (enterFrame) {
_y = (_y + _root.elevator_speed);
if ((_y + _root.game_y) > 0) {
_y = (_y - 830.6);
}
if ((_y + _root.game_y) < -800) {
_y = (_y + 830.6);
}
}
Instance of Symbol 14 MovieClip [l2] "floor1" in Symbol 1097 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 2;
}
Instance of Symbol 815 MovieClip "welder" in Symbol 1097 MovieClip Frame 1
onClipEvent (load) {
delay = true;
phase = 11;
face_type = 4;
head_type = 1;
body_type = 1;
}
Instance of Symbol 815 MovieClip "gunner" in Symbol 1097 MovieClip Frame 1
onClipEvent (load) {
delay = true;
_xscale = (_xscale * -1);
phase = 12;
wait = true;
face_type = 2;
head_type = 1;
body_type = 2;
gun_type = 1;
shot_range_y = 400;
rapidfire = 2;
}
Instance of Symbol 815 MovieClip "zombie1" in Symbol 1097 MovieClip Frame 1
onClipEvent (load) {
delay = true;
phase = 1;
face_type = 3;
head_type = 3;
body_type = 3;
gun_type = 0;
}
Instance of Symbol 815 MovieClip "zombie2" in Symbol 1097 MovieClip Frame 1
onClipEvent (load) {
delay = true;
phase = 1;
face_type = 3;
head_type = 3;
body_type = 3;
gun_type = 0;
}
Instance of Symbol 815 MovieClip "zombie3" in Symbol 1097 MovieClip Frame 1
onClipEvent (load) {
delay = true;
_xscale = (_xscale * -1);
phase = 1;
face_type = 3;
head_type = 3;
body_type = 3;
gun_type = 0;
}
Instance of Symbol 815 MovieClip "zombie4" in Symbol 1097 MovieClip Frame 1
onClipEvent (load) {
delay = true;
phase = 1;
face_type = 3;
head_type = 3;
body_type = 3;
gun_type = 0;
}
Instance of Symbol 815 MovieClip "zombie5" in Symbol 1097 MovieClip Frame 1
onClipEvent (load) {
delay = true;
phase = 1;
face_type = 3;
head_type = 3;
body_type = 3;
gun_type = 0;
}
Instance of Symbol 815 MovieClip "zombie6" in Symbol 1097 MovieClip Frame 1
onClipEvent (load) {
delay = true;
_xscale = (_xscale * -1);
phase = 1;
face_type = 3;
head_type = 3;
body_type = 3;
gun_type = 0;
}
Instance of Symbol 1097 MovieClip "game" in Symbol 1098 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.go == true) {
_root.main();
}
}
Instance of Symbol 815 MovieClip in Symbol 1099 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
phase = 10;
}
Instance of Symbol 815 MovieClip in Symbol 1099 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
phase = 10;
}
Instance of Symbol 1099 MovieClip "game" in Symbol 1100 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.go == true) {
_root.main();
}
}
Symbol 1106 MovieClip Frame 33
gotoAndPlay (1);
Symbol 1114 MovieClip Frame 1
stop();
Symbol 1124 MovieClip Frame 1
default_y = _y;
_y = (_root.game.game.clownhead._y + 300);
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 1124 MovieClip Frame 3
onClipEvent (load) {
_root.f_ClownBody(_parent);
}
onClipEvent (enterFrame) {
_root.f_ClownBody(_parent);
}
Symbol 1156 MovieClip Frame 50
_x = (-random(2000));
Symbol 1162 MovieClip Frame 1
_root.f_AddNeutral(this);
_root.f_Depth(this, this._y + 100);
stop();
Symbol 1162 MovieClip Frame 2
_root.f_AddNeutral(_parent.dancefloor);
_root.f_Depth(_parent.dancefloor, this._y + 105);
_root.screenOverlay.start();
play();
Symbol 1162 MovieClip Frame 22
stop();
Instance of Symbol 1156 MovieClip in Symbol 1162 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1156 MovieClip in Symbol 1162 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1156 MovieClip in Symbol 1162 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1156 MovieClip in Symbol 1162 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1156 MovieClip in Symbol 1162 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1156 MovieClip in Symbol 1162 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1156 MovieClip in Symbol 1162 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1156 MovieClip in Symbol 1162 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1156 MovieClip in Symbol 1162 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Symbol 1169 MovieClip Frame 2
stop();
Symbol 1170 MovieClip Frame 1
function f_HitType1(zone) {
zone.health--;
if (zone.health <= 0) {
_root.s_glass1.start(0, 0);
zone.glow.alive = false;
_root.f_RemoveEnemy(this);
i = 1;
while (i <= 4) {
var _local3 = _root.f_ShrapnelGeneral(_x, _y + 50, _y + 1, -15 + random(30), 2 - random(15), "glass");
_local3.bounce_limit = 2;
_local3.fp_ShrapnelEnd = _root.f_ShrapnelVanish;
i++;
}
zone.gotoAndStop(2);
} else {
_root.f_BulletImpactSound(this);
var _local3 = _root.f_ShrapnelGeneral(_x, _y + 50, _y + 1, -15 + random(30), 2 - random(15), "glass");
_local3.bounce_limit = 2;
_local3.fp_ShrapnelEnd = _root.f_ShrapnelVanish;
}
}
nodepth = true;
_root.f_EnemyDefaults(this);
fp_Hit1 = f_HitType1;
health_max = 8;
health = health_max;
defense = 40;
texture = 2;
w2 = _width / 2;
_root.f_AddEnemy(this);
stop();
Symbol 1179 MovieClip Frame 1
stop();
Symbol 1179 MovieClip Frame 2
play();
Symbol 1179 MovieClip Frame 61
_root.f_EnemyShootSound();
_root.f_ShakeY(10);
if (_parent._xscale > 0) {
x = _parent._x + _x;
mod = -1;
} else {
x = _parent._x - _x;
mod = 1;
}
y = _parent._y + _y;
rotation = 16.5;
speed_x = 35 * Math.cos(_root.PI * (-rotation));
speed_y = 35 * Math.sin(_root.PI * rotation);
u_temp = _root.f_EnemyBulletPreset(_parent, x, y, speed_x * mod, speed_y, 1);
u_temp._rotation = rotation * mod;
rotation = 23.6;
speed_x = 35 * Math.cos(_root.PI * (-rotation));
speed_y = 35 * Math.sin(_root.PI * rotation);
u_temp = _root.f_EnemyBulletPreset(_parent, x, y, speed_x * mod, speed_y, 1);
u_temp._rotation = rotation * mod;
rotation = 32.1;
speed_x = 35 * Math.cos(_root.PI * (-rotation));
speed_y = 35 * Math.sin(_root.PI * rotation);
u_temp = _root.f_EnemyBulletPreset(_parent, x, y, speed_x * mod, speed_y, 1);
u_temp._rotation = rotation * mod;
rotation = 42.3;
speed_x = 35 * Math.cos(_root.PI * (-rotation));
speed_y = 35 * Math.sin(_root.PI * rotation);
u_temp = _root.f_EnemyBulletPreset(_parent, x, y, speed_x * mod, speed_y, 1);
u_temp._rotation = rotation * mod;
rotation = 53.4;
speed_x = 35 * Math.cos(_root.PI * (-rotation));
speed_y = 35 * Math.sin(_root.PI * rotation);
u_temp = _root.f_EnemyBulletPreset(_parent, x, y, speed_x * mod, speed_y, 1);
u_temp._rotation = rotation * mod;
rotation = 75;
speed_x = 35 * Math.cos(_root.PI * (-rotation));
speed_y = 35 * Math.sin(_root.PI * rotation);
u_temp = _root.f_EnemyBulletPreset(_parent, x, y, speed_x * mod, speed_y, 1);
u_temp._rotation = rotation * mod;
rotation = 92;
speed_x = 35 * Math.cos(_root.PI * (-rotation));
speed_y = 35 * Math.sin(_root.PI * rotation);
u_temp = _root.f_EnemyBulletPreset(_parent, x, y, speed_x * mod, speed_y, 1);
u_temp._rotation = -88 * mod;
rotation = 122.6;
speed_x = 35 * Math.cos(_root.PI * (-rotation));
speed_y = 35 * Math.sin(_root.PI * rotation);
u_temp = _root.f_EnemyBulletPreset(_parent, x, y, speed_x * mod, speed_y, 1);
u_temp._rotation = -57.4 * mod;
rotation = 167.1;
speed_x = 35 * Math.cos(_root.PI * (-rotation));
speed_y = 35 * Math.sin(_root.PI * rotation);
u_temp = _root.f_EnemyBulletPreset(_parent, x, y, speed_x * mod, speed_y, 1);
u_temp._rotation = -12.9 * mod;
Symbol 1179 MovieClip Frame 63
_root.f_EnemyShootSound();
Symbol 1179 MovieClip Frame 65
_root.f_EnemyShootSound();
Symbol 1180 MovieClip Frame 3
_parent.gotoAndStop("idle");
Symbol 1182 MovieClip Frame 1
health.text = _root.f_HealthText(_parent.health);
Symbol 1186 MovieClip Frame 1
_root.s_explosion1.start(0, 0);
Instance of Symbol 15 MovieClip [empty] in Symbol 1186 MovieClip Frame 1
onClipEvent (load) {
if (_parent._parent._xscale > 0) {
mod = -1;
} else {
mod = 1;
}
timer = 1;
}
onClipEvent (enterFrame) {
var u_temp = _root.f_ShrapnelGeneral((_parent._parent._x - 40) + random(80), _parent._parent._y - random(200), _parent._parent._y, (6 + random(6)) * mod, -(15 + random(10)), "spark2");
u_temp.bounce_limit = 1;
u_temp._xscale = 100 + random(50);
u_temp._yscale = 100 + random(50);
u_temp.weight = 3 + (random(100) / 100);
u_temp.fp_ShrapnelEnd = _root.f_ShrapnelVanish;
timer++;
if ((timer % 4) == 0) {
var u_size = (110 + random(40));
_root.f_FX((_parent._parent._x - 40) + random(80), _parent._parent._y - random(200), _parent._parent._y, "dustpuff", u_size, u_size);
}
}
Symbol 1186 MovieClip Frame 6
_root.s_explosion1.start(0, 0);
Symbol 1186 MovieClip Frame 13
_root.f_ShakeX(20);
_root.s_explosion3.start(0, 0);
Symbol 1186 MovieClip Frame 33
stop();
Symbol 1187 MovieClip Frame 1
function f_HitType1(zone) {
zone.health--;
if (zone.health <= 0) {
_root.shake_x = 20;
_root.shake_y = 20;
zone.alive = false;
_root.f_RemoveEnemy(zone);
zone.gotoAndStop("die");
} else {
zone.gotoAndStop("hit1");
}
}
nodepth = true;
_root.f_EnemyDefaults(this);
fp_Hit1 = f_HitType1;
health_max = 200;
alive = true;
health = health_max;
defense = 40;
w2 = _width / 2;
_root.f_AddEnemy(this);
Symbol 1187 MovieClip Frame 2
stop();
Symbol 1187 MovieClip Frame 3
if (_xscale < 0) {
status._xscale = -100;
}
Symbol 1193 MovieClip Frame 1
stop();
Symbol 1195 MovieClip Frame 1
stop();
Symbol 1230 MovieClip Frame 3
_root.f_SetForceX(_parent, 12);
_parent.force_y = 10;
Symbol 1230 MovieClip Frame 7
if (!_parent.u_hit) {
gotoAndPlay ("finish");
}
Symbol 1230 MovieClip Frame 12
play();
Symbol 1230 MovieClip Frame 24
_parent.gotoAndStop("idle");
Symbol 1233 MovieClip Frame 9
gotoAndPlay (1);
Symbol 1234 MovieClip Frame 37
_root.s_splash.start(0, 0);
Instance of Symbol 100 MovieClip "body" in Symbol 1234 MovieClip Frame 38
onClipEvent (load) {
x = (_x + _parent._x) + _parent._parent._x;
y = (_y + _parent._y) + _parent._parent._y;
}
onClipEvent (enterFrame) {
var u_temp = _root.f_ShrapnelGeneral((x - 30) + random(60), y, y, -4 + random(8), -(24 + random(15)), "lavaglob");
u_temp.bounce_limit = 0;
u_temp._xscale = 60 + random(50);
u_temp._yscale = 60 + random(50);
u_temp.weight = 2 + (random(100) / 100);
u_temp.fp_ShrapnelEnd = _root.f_ShrapnelVanish;
}
Symbol 1234 MovieClip Frame 72
stop();
Symbol 1235 MovieClip Frame 1
x = _x;
y = _y;
if (_xscale < 0) {
sign._x = sign._x + 150;
_xscale = (_xscale * -1);
}
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 1235 MovieClip Frame 1
onClipEvent (enterFrame) {
if (Math.abs(_parent.y - _root.p1.y) < 100) {
if (Math.abs(_parent.x - _root.p1.x) < 300) {
if (_root.p1.x < _parent.x) {
_parent._xscale = _parent._xscale * -1;
}
_parent.gotoAndStop("attack1");
}
}
}
Symbol 1235 MovieClip Frame 3
_xscale = 100;
Symbol 1242 MovieClip Frame 3
_parent.gotoAndStop("idle");
Symbol 1243 MovieClip Frame 1
function f_HitType1(zone) {
if (zone.health <= 0) {
zone.alive = false;
}
zone.gotoAndStop("hit1");
}
nodepth = true;
_root.f_EnemyDefaults(this);
fp_Hit1 = f_HitType1;
health_max = 400;
health = health_max;
defense = 40;
w2 = _width / 2;
_root.f_AddEnemy(this);
Symbol 1243 MovieClip Frame 2
stop();
Symbol 1249 MovieClip Frame 1
stop();
Symbol 1249 MovieClip Frame 2
play();
Symbol 1249 MovieClip Frame 45
stop();
Symbol 1249 MovieClip Frame 46
play();
Symbol 1249 MovieClip Frame 90
_root.f_ShakeY(10);
_root.s_doorslam.start(0, 0);
Symbol 1249 MovieClip Frame 91
stop();
Symbol 1250 MovieClip Frame 1
_root.f_AddNeutral(this);
_root.f_Depth(this, (_y + _height) + 300);
door1.gotoAndStop("opened");
door2.gotoAndStop("closed");
Symbol 1251 MovieClip Frame 1
_root.f_AddNeutral(this);
Symbol 1255 MovieClip Frame 1
_root.f_AddNeutral(this);
alive = true;
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 1255 MovieClip Frame 1
onClipEvent (load) {
beam1 = _parent.beam1._rotation;
beam2 = _parent.beam2._rotation;
game_x = _root.game_x;
game_y = _root.game_y;
}
onClipEvent (enterFrame) {
if (!_parent.alive) {
_parent._alpha = _parent._alpha - 10;
_parent.beam1._rotation = _parent.beam1._rotation + 1;
_parent.beam2._rotation = _parent.beam2._rotation - 1;
if (_parent._alpha <= 0) {
_parent.gotoAndStop(2);
}
return(undefined);
}
if (_parent._xscale > 0) {
x = _parent._x + _parent.body._x;
} else {
x = _parent._x - _parent.body._x;
}
y = _parent.body._y + _parent._y;
alpha = 100;
dist_x = Math.abs(x - _root.p1.x);
dist_y = Math.abs(y - (_root.p1.y - 70));
if ((dist_x < 100) and (dist_y < 200)) {
if ((dist_x / 100) > (dist_y / 200)) {
alpha = 100 * (dist_x / 100);
} else {
alpha = 100 * (dist_y / 200);
}
if (alpha > 100) {
alpha = 100;
}
}
_parent._alpha = alpha;
_parent.beam2._rotation = ((((alpha - 100) / 4) + beam2) + ((game_x - _root.game_x) / 6)) + ((game_y - _root.game_y) / 6);
_parent.beam1._rotation = ((((alpha - 100) / -4) + beam1) + ((game_x - _root.game_x) / 6)) + ((game_y - _root.game_y) / 6);
}
Symbol 1262 MovieClip Frame 1
stop();
Symbol 1262 MovieClip Frame 2
play();
Symbol 1262 MovieClip Frame 7
stop();
Symbol 1262 MovieClip Frame 16
play();
Symbol 1262 MovieClip Frame 21
stop();
Symbol 1262 MovieClip Frame 28
play();
Symbol 1262 MovieClip Frame 49
stop();
Symbol 1262 MovieClip Frame 53
play();
Symbol 1262 MovieClip Frame 173
stop();
Symbol 1262 MovieClip Frame 577
gotoAndStop ("idle");
Symbol 1263 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 100 MovieClip in Symbol 1263 MovieClip Frame 3
onClipEvent (enterFrame) {
_root.f_ClownHandMove(_parent);
}
Symbol 1263 MovieClip Frame 4
play();
Symbol 1263 MovieClip Frame 6
gotoAndStop ("idle");
Symbol 1268 MovieClip Frame 1
stop();
Symbol 1269 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 100 MovieClip in Symbol 1269 MovieClip Frame 3
onClipEvent (enterFrame) {
_root.f_ClownHandMove(_parent);
}
Symbol 1269 MovieClip Frame 4
play();
Symbol 1269 MovieClip Frame 6
gotoAndStop ("idle");
Symbol 1269 MovieClip Frame 7
play();
Symbol 1269 MovieClip Frame 9
gotoAndStop ("idle");
Symbol 1271 MovieClip Frame 115
if (!busy) {
gotoAndPlay ("spin");
}
Symbol 1271 MovieClip Frame 118
busy = false;
Instance of Symbol 15 MovieClip [empty] in Symbol 1271 MovieClip Frame 160
onClipEvent (enterFrame) {
_root.f_ClownHandSmash(_parent);
}
Symbol 1271 MovieClip Frame 163
_root.s_clownswipe.start(0, 0);
Symbol 1271 MovieClip Frame 170
_parent._parent.clownhead.body.gotoAndPlay("roar");
Symbol 1271 MovieClip Frame 227
if (!busy) {
gotoAndPlay ("spin");
}
Symbol 1271 MovieClip Frame 233
busy = false;
Symbol 1271 MovieClip Frame 256
stop();
Symbol 1271 MovieClip Frame 325
gotoAndPlay ("die_loop");
Symbol 1272 MovieClip Frame 5
_parent._parent.monitor.gotoAndStop(2);
Symbol 1272 MovieClip Frame 45
_root.s_clownroar.start(0, 0);
_parent._parent.clownhead.body.gotoAndPlay("scream");
Symbol 1272 MovieClip Frame 126
if (!busy) {
gotoAndPlay ("spin");
}
Symbol 1272 MovieClip Frame 128
_root.game.game.clownhead.body.gotoAndPlay("open");
Symbol 1272 MovieClip Frame 129
busy = false;
Symbol 1272 MovieClip Frame 151
_root.s_clownfire.start(0, 0);
Instance of Symbol 15 MovieClip [empty] in Symbol 1272 MovieClip Frame 151
onClipEvent (enterFrame) {
_root.f_ClownShot(_parent);
}
Symbol 1272 MovieClip Frame 215
_root.game.game.clownhead.body.gotoAndPlay("close");
Symbol 1272 MovieClip Frame 238
if (!busy) {
gotoAndPlay ("spin");
}
Symbol 1272 MovieClip Frame 240
_root.game.game.clownhead.body.gotoAndPlay("open");
Symbol 1272 MovieClip Frame 241
busy = false;
Symbol 1272 MovieClip Frame 263
_root.s_clownfire.start(0, 0);
Instance of Symbol 15 MovieClip [empty] in Symbol 1272 MovieClip Frame 263
onClipEvent (enterFrame) {
_root.f_ClownShot(_parent);
}
Symbol 1272 MovieClip Frame 327
_root.game.game.clownhead.body.gotoAndPlay("close");
Symbol 1272 MovieClip Frame 350
if (!busy) {
gotoAndPlay ("spin");
}
Instance of Symbol 15 MovieClip [empty] in Symbol 1272 MovieClip Frame 352
onClipEvent (load) {
timer = 1;
}
onClipEvent (enterFrame) {
timer++;
if ((timer % 2) == 0) {
var u_scale = (80 + random(40));
_root.f_FX((_root.game.game.clownbody._x - 350) + random(700), _root.game.game.clownbody._y - random(500), _root.p1.y - 1, "explosion5", u_scale, u_scale);
}
}
Symbol 1272 MovieClip Frame 356
busy = false;
_root.s_clowndie.start(0, 0);
Symbol 1272 MovieClip Frame 387
_parent._parent.monitor.gotoAndStop(3);
Instance of Symbol 15 MovieClip [empty] in Symbol 1272 MovieClip Frame 388
onClipEvent (load) {
timer = 180;
}
onClipEvent (enterFrame) {
_parent._parent._y = _parent._parent._y + 6;
_parent._y = _parent._y - 1;
_root.game.game.clownbody._y = _root.game.game.clownbody._y + 2;
timer--;
if (timer == 0) {
_root.fader.spawnpoint = 1;
_root.fader.warpto = "level1_6";
_root.fader.gotoAndPlay("fadeout");
} else if (timer > 0) {
if ((timer % 6) == 0) {
_root.shake_x = 24;
}
}
}
Symbol 1272 MovieClip Frame 416
gotoAndPlay ("deathloop");
Symbol 1273 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 1271 MovieClip "hand1" in Symbol 1273 MovieClip Frame 3
onClipEvent (load) {
_xscale = (_xscale * -1);
}
Instance of Symbol 1272 MovieClip "clownhead" in Symbol 1273 MovieClip Frame 3
onClipEvent (load) {
_xscale = (_xscale * -1);
}
Symbol 1275 MovieClip Frame 1
gotoAndStop (2);
Symbol 1276 MovieClip Frame 1
_root.f_AddNeutral(this);
_root.camera.prey = camera;
_root.f_CameraPop();
Symbol 1276 MovieClip Frame 106
_root.target_scale = 40;
Symbol 1276 MovieClip Frame 131
_root.p1.wait = false;
_root.p1.autowalk_timer = 20;
_root.f_PY(_root.p1, 10);
_root.p1.gotoAndStop("stand");
Symbol 1276 MovieClip Frame 149
stop();
speed_y = 2;
_parent.sidewalls.door1.gotoAndPlay("close");
_root.s_elevatordoor.start(0, 0);
Instance of Symbol 100 MovieClip in Symbol 1276 MovieClip Frame 149
onClipEvent (load) {
timer = 0;
}
onClipEvent (enterFrame) {
_parent._x = _root.p1._x;
timer++;
if ((timer % 600) == 0) {
if (_parent._parent.speaker1.alive) {
_parent._parent.speaker1.laser.gotoAndPlay("go");
}
if (_parent._parent.speaker2.alive) {
_parent._parent.speaker2.laser.gotoAndPlay("go");
}
timer = 0;
_root.s_beams.start(0, 0);
} else if ((timer % 400) == 0) {
if (_parent._parent.speaker1.alive) {
_parent._parent.speaker1.laser.gotoAndPlay("go");
} else if (_parent._parent.speaker2.alive) {
_parent._parent.speaker2.laser.gotoAndPlay("go");
}
_root.s_beams.start(0, 0);
} else if ((timer % 200) == 0) {
if (_parent._parent.speaker2.alive) {
_parent._parent.speaker2.laser.gotoAndPlay("go");
} else if (_parent._parent.speaker1.alive) {
_parent._parent.speaker1.laser.gotoAndPlay("go");
}
_root.s_beams.start(0, 0);
}
if ((!_parent._parent.speaker1.alive) and (!_parent._parent.speaker2.alive)) {
_parent.gotoAndPlay("go");
}
}
Instance of Symbol 100 MovieClip in Symbol 1276 MovieClip Frame 166
onClipEvent (enterFrame) {
_parent._x = _root.p1._x;
}
Symbol 1276 MovieClip Frame 190
_root.s_record.start(0, 0);
Symbol 1276 MovieClip Frame 220
_parent.sidewalls.door1.gotoAndPlay("open");
_parent.sidewalls.door2.gotoAndPlay("open");
_root.s_elevatordoor.start(0, 0);
Symbol 1276 MovieClip Frame 265
_parent.danger.gotoAndPlay("go");
Symbol 1276 MovieClip Frame 380
_root.s_calliope.s_calliope.setVolume(100);
_root.s_calliope.s_calliope.start(0, 1000);
Symbol 1276 MovieClip Frame 393
_root.f_RemoveWall(_parent.gate1.z_wall);
_root.f_RemoveWall(_parent.gate2.z_wall);
_root.s_steam.start(0, 0);
_parent.lava.gotoAndPlay("go");
Instance of Symbol 100 MovieClip in Symbol 1276 MovieClip Frame 396
onClipEvent (enterFrame) {
_parent._x = _root.p1._x;
}
Instance of Symbol 15 MovieClip [empty] in Symbol 1276 MovieClip Frame 396
onClipEvent (load) {
active = true;
}
onClipEvent (enterFrame) {
y = _parent._y + 20;
if (active) {
if (_root.p1.y > y) {
if (_root.p1.alive) {
if (_root.p1.invincible_timer <= 0) {
_root.s_splash.start(0, 0);
_root.p1.invincible_timer = 30;
_root.f_DamagePlayer(1);
x = _root.p1.x;
y = _parent._y;
i = 1;
while (i <= 3) {
var u_temp = _root.f_ShrapnelGeneral((x - 30) + random(60), y, y, -4 + random(8), -(24 + random(15)), "lavaglob");
u_temp.bounce_limit = 0;
u_temp._xscale = 60 + random(50);
u_temp._yscale = 60 + random(50);
u_temp.weight = 2 + (random(100) / 100);
u_temp.fp_ShrapnelEnd = _root.f_ShrapnelVanish;
i++;
}
}
_root.p1.smoke_timer = 30;
if (_root.p1.health > 0) {
_root.f_ForceJump(_root.p1, 0, -50);
} else {
_root.p1.force_y = -40;
_root.p1.force_x = 0;
_root.f_HitPlayer(_root.p1);
}
} else {
active = false;
_root.f_GameOver();
}
}
}
for (n in _root.a_Enemies) {
var u_temp = _root.a_Enemies[n];
if (u_temp.y > y) {
if (u_temp.y < (y + 150)) {
if (u_temp.alive) {
if (((u_temp != _root.game.game.clownhead) and (u_temp != _root.game.game.hand1)) and (u_temp != _root.game.game.hand2)) {
_root.s_splash.start(0, 0);
u_temp.health = 0;
u_temp.force_x = 0;
u_temp.force_y = 0;
u_temp.fp_Hit1(u_temp);
x = u_temp.x;
y = _parent._y;
i = 1;
while (i <= 3) {
var u_temp = _root.f_ShrapnelGeneral((x - 30) + random(60), y, y, -4 + random(8), -(24 + random(15)), "lavaglob");
u_temp.bounce_limit = 0;
u_temp._xscale = 60 + random(50);
u_temp._yscale = 60 + random(50);
u_temp.weight = 2 + (random(100) / 100);
u_temp.fp_ShrapnelEnd = _root.f_ShrapnelVanish;
i++;
}
}
}
}
}
}
}
Symbol 1276 MovieClip Frame 425
_parent.clowndj.gotoAndStop("jump");
Instance of Symbol 100 MovieClip in Symbol 1276 MovieClip Frame 487
onClipEvent (enterFrame) {
_parent._x = _root.p1._x;
if (_parent._y > (_parent._parent.plat._y - 30)) {
_parent._y = _parent._y - _parent.speed_y;
}
}
Symbol 1276 MovieClip Frame 576
stop();
Instance of Symbol 100 MovieClip in Symbol 1276 MovieClip Frame 576
onClipEvent (enterFrame) {
_parent._x = _root.p1._x;
if (_parent._y > (_parent._parent.plat._y - 30)) {
_parent._parent.lava._y = _parent._parent.lava._y - _parent.speed_y;
_parent._y = _parent._y - _parent.speed_y;
_parent.speed_y = _parent.speed_y + 0.005;
} else if (!init) {
init = true;
_root.f_InitClownDemon();
}
}
Symbol 1285 MovieClip Frame 1
_root.f_AddNeutral(this);
gotoAndStop (2);
Symbol 1285 MovieClip Frame 3
_root.s_cursor34.start(0, 0);
play();
Symbol 1285 MovieClip Frame 40
_root.s_cursor34.start(0, 0);
Symbol 1285 MovieClip Frame 73
_root.s_cursor33.start(0, 0);
Symbol 1285 MovieClip Frame 93
_root.s_cursor33.start(0, 0);
Symbol 1285 MovieClip Frame 107
stop();
Symbol 1287 MovieClip Frame 1
gotoAndStop (2);
Symbol 1289 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 1170 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
glow = _parent.glow1;
}
Instance of Symbol 1187 MovieClip "speaker1" in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
}
Instance of Symbol 1170 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
glow = _parent.glow4;
}
Instance of Symbol 1170 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
glow = _parent.glow5;
}
Instance of Symbol 1170 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
glow = _parent.glow6;
}
Instance of Symbol 1170 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
glow = _parent.glow2;
}
Instance of Symbol 1170 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
glow = _parent.glow3;
}
Instance of Symbol 1255 MovieClip "glow3" in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
}
Instance of Symbol 1255 MovieClip "glow1" in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
beam1._rotation = beam1._rotation + 30;
beam2._rotation = beam2._rotation + 30;
}
Instance of Symbol 1255 MovieClip "glow4" in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
beam1._rotation = beam1._rotation + 30;
beam2._rotation = beam2._rotation + 30;
_xscale = (_xscale * -1);
}
Instance of Symbol 1255 MovieClip "glow5" in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
beam1._rotation = beam1._rotation + 30;
beam2._rotation = beam2._rotation + 30;
}
Instance of Symbol 1255 MovieClip "glow6" in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
beam1._rotation = beam1._rotation + 30;
beam2._rotation = beam2._rotation + 30;
_xscale = (_xscale * -1);
}
Instance of Symbol 14 MovieClip [l2] "floor1" in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 2;
}
Instance of Symbol 648 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
z_wall.texture = 2;
}
Instance of Symbol 648 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
z_wall.texture = 2;
}
Instance of Symbol 815 MovieClip "thug1" in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
gun_type = 1;
phase = 3;
face_type = 2;
head_type = 1;
body_type = 2;
shot_timer = 0;
}
Instance of Symbol 815 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
gun_type = 1;
phase = 3;
face_type = 2;
head_type = 1;
body_type = 2;
shot_timer = 0;
shot_range_y = 140;
_xscale = (_xscale * -1);
}
Instance of Symbol 815 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
gun_type = 1;
phase = 3;
face_type = 2;
head_type = 1;
body_type = 2;
shot_timer = 0;
shot_range_y = 140;
}
Instance of Symbol 815 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
gun_type = 1;
phase = 3;
face_type = 2;
head_type = 1;
body_type = 2;
shot_timer = 0;
}
Instance of Symbol 815 MovieClip "dance1" in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
phase = 1;
face_type = 1;
head_type = 1;
body_type = 1;
goframe = "dance2";
gotoAndStop ("activate");
_xscale = (_xscale * -1);
}
Instance of Symbol 815 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
phase = 1;
face_type = 1;
head_type = 1;
body_type = 1;
goframe = "dance1";
gotoAndStop ("activate");
_xscale = (_xscale * -1);
}
Instance of Symbol 815 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
phase = 1;
face_type = 1;
head_type = 1;
body_type = 1;
goframe = "dance3";
gotoAndStop ("activate");
}
Instance of Symbol 815 MovieClip in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
phase = 1;
face_type = 1;
head_type = 1;
body_type = 1;
goframe = "dance4";
gotoAndStop ("activate");
}
Instance of Symbol 1269 MovieClip "hand1" in Symbol 1290 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
}
Instance of Symbol 1290 MovieClip "game" in Symbol 1291 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.go == true) {
_root.main();
}
}
Symbol 1296 MovieClip Frame 1
stop();
Symbol 1307 MovieClip Frame 1
stop();
Symbol 1311 MovieClip Frame 1
y = _y;
x = _x;
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
timer = 1;
}
onClipEvent (enterFrame) {
timer++;
if ((timer % 4) == 0) {
_root.s_explosion1.start(0, 0);
}
if ((timer % 2) == 0) {
corner_x = _parent._parent.corner._x + _root.game_x;
corner_y = _parent._parent.corner._y + _root.game_y;
y = _parent._parent.corner._y;
if ((corner_x > 0) and (corner_y > 0)) {
if (corner_x < _root.screenWidth) {
x = _parent._parent.corner._x - random(_root.screenWidth);
} else {
left = _root.p1.x - (_root.p1.x + _root.game_x);
x = left + random(_root.screenWidth);
}
var u_scale = (80 + random(30));
y = y + random(10);
_root.f_FX(x, y, y, "explosion6", u_scale, u_scale);
}
}
if (_root.p1.y > (_parent._y - (_parent._height * 0.75))) {
if (_root.p1._xscale < 0) {
_root.p1._xscale = _root.p1._xscale * -1;
}
_root.f_ForceJump(_root.p1, 15, -20);
_root.camera.prey = _root.p1;
_root.limit_right = _root.game.game.limit_right2._x;
_root.s_spring.start(0, 0);
_parent.gotoAndPlay(2);
} else if (_root.p1.y > (_parent._y - (_parent._height * 1.5))) {
_root.camera.prey = _parent;
}
}
Instance of Symbol 15 MovieClip [empty] in Symbol 1311 MovieClip Frame 2
onClipEvent (enterFrame) {
var u_volume = (_root.s_calliope.s_calliope.getVolume() - 1);
if (u_volume < 0) {
u_volume = 0;
}
_root.s_calliope.s_calliope.setVolume(u_volume);
}
Symbol 1311 MovieClip Frame 28
_root.p1.wait = true;
body_type = 1;
head_type = 1;
face_type = 1;
hand_type = 1;
Symbol 1311 MovieClip Frame 79
_root.camera.prey = guide;
x = guide._x + _x;
if (((_root.p1._x > x) and (_root.p1._xscale > 0)) or ((_root.p1._x < x) and (_root.p1._xscale < 0))) {
_root.p1._xscale = _root.p1._xscale * -1;
}
Symbol 1311 MovieClip Frame 106
_root.s_calliope.s_calliope.setVolume(0);
Symbol 1311 MovieClip Frame 136
radio.gotoAndStop(2);
Symbol 1311 MovieClip Frame 244
_root.limit_top = _root.game.game.limit_top2._y;
_root.p1.wait = true;
_root.fader.gotoAndPlay("end");
stop();
Symbol 1311 MovieClip Frame 245
_root.limit_top = _root.game.game.limit_top2._y;
stop();
Instance of Symbol 15 MovieClip [empty] in Symbol 1311 MovieClip Frame 245
onClipEvent (load) {
timer = 1;
speed = 10;
y = _parent._parent.building._y;
}
onClipEvent (enterFrame) {
_parent._parent.building._y = _parent._parent.building._y + speed;
_parent._parent.building_box._y = _parent._parent.building_box._y + speed;
_root.f_MovePlatformV(_parent._parent.building_box, speed);
_root.f_UpdateWall(_parent._parent.building_box, _parent._parent.building_box.z_wall);
timer++;
if ((timer % 2) == 0) {
_parent._parent.building._x = _parent._parent.building._x + 2;
} else {
_parent._parent.building._x = _parent._parent.building._x - 2;
}
if (_parent._parent.building._y > ((y + _parent._parent.building.height) - 300)) {
_parent.gotoAndStop("end");
}
}
Symbol 1312 MovieClip Frame 35
_root.arrow.gotoAndPlay("go");
stop();
Symbol 1313 MovieClip Frame 1
_root.f_AddNeutral(this);
Instance of Symbol 10 MovieClip [l3] "cliff" in Symbol 1314 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 1;
}
Instance of Symbol 1314 MovieClip "game" in Symbol 1315 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.go == true) {
_root.main();
}
}
Symbol 1339 MovieClip Frame 1245
stop();
Symbol 1340 MovieClip Frame 1
_root.fp_fpsLimiter = undefined;
Instance of Symbol 15 MovieClip [empty] in Symbol 1340 MovieClip Frame 796
onClipEvent (enterFrame) {
_parent._xscale = _parent._xscale + 0.1;
_parent._yscale = _parent._yscale + 0.1;
}
Symbol 1340 MovieClip Frame 1242
_root.fp_fpsLimiter = _root.fpsLimiter;
_parent.gotoAndPlay("level1_4");