Frame 1
_root.API_Settings = {movie_id:3117, enc_key:"ab5fd482a2d043a065eee645ea39ca99", debug_mode:false, movie_version:""};
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 4 MovieClip in Symbol 5 MovieClip Frame 1
onClipEvent (load) {
_root.f_InsertObject(_parent, _root.a_Platforms);
}
onClipEvent (unload) {
_root.f_RemoveObject(_parent, _root.a_Platforms);
}
Symbol 6 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 8 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 8 MovieClip [l5] Frame 2
stop();
Instance of Symbol 4 MovieClip in Symbol 10 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 11 MovieClip [l3] Frame 1
_root.f_AddWall(this, z_wall);
_root.f_AddPlatform(this, z_platform);
w2 = z_wall._width / 2;
gotoAndStop (2);
Symbol 12 MovieClip [l8] Frame 1
_root.f_AddWall(this, z_wall);
gotoAndStop (2);
Symbol 14 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 15 MovieClip [l2] Frame 1
if (!z_platform.removed) {
_root.f_AddPlatform(this, z_platform);
z_platform.slope = 0;
}
gotoAndStop (2);
Symbol 21 MovieClip Frame 1
play();
Symbol 21 MovieClip Frame 6
_parent.gotoAndStop("remove");
Symbol 25 MovieClip Frame 4
stop();
Symbol 36 MovieClip Frame 16
stop();
Symbol 51 MovieClip Frame 8
stop();
Symbol 65 MovieClip Frame 22
stop();
Symbol 74 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 66
stop();
Symbol 76 MovieClip Frame 1
stop();
Symbol 76 MovieClip Frame 2
play();
Symbol 76 MovieClip Frame 31
stop();
Symbol 88 MovieClip Frame 1
stop();
Symbol 89 MovieClip Frame 8
stop();
Symbol 94 MovieClip Frame 5
stop();
Symbol 99 MovieClip Frame 1
gotoAndStop(random(4) + 1);
Symbol 100 MovieClip Frame 32
_parent.gotoAndStop("blank");
Symbol 116 MovieClip Frame 1
gotoAndStop(random(7) + 1);
Symbol 134 MovieClip Frame 10
_parent.gotoAndStop("idle");
Symbol 135 MovieClip Frame 1
stop();
Symbol 143 MovieClip Frame 1
_root.gunshooting = false;
stop();
Symbol 143 MovieClip Frame 2
_root.gunshooting = true;
Symbol 144 MovieClip Frame 1
_root.f_SetGun(this);
Symbol 152 MovieClip Frame 1
_root.f_SetHead(this);
Symbol 163 MovieClip Frame 1
_root.f_SetFace(this);
Symbol 168 MovieClip Frame 1
_root.f_SetBody(this);
Symbol 175 MovieClip Frame 1
_root.f_SetBody(this);
Symbol 189 MovieClip Frame 1
_root.f_SetHand(this);
Symbol 215 MovieClip Frame 21
stop();
Symbol 216 MovieClip Frame 21
stop();
Symbol 228 MovieClip Frame 1
stop();
Instance of Symbol 101 MovieClip in Symbol 228 MovieClip Frame 2
onClipEvent (enterFrame) {
_root.f_ClownFireball(_parent);
}
Symbol 228 MovieClip Frame 18
stop();
Instance of Symbol 101 MovieClip in Symbol 229 MovieClip Frame 1
onClipEvent (enterFrame) {
_root.f_ClownFireball(_parent);
}
Symbol 229 MovieClip Frame 17
stop();
Symbol 230 MovieClip Frame 8
stop();
Symbol 254 MovieClip Frame 24
stop();
Symbol 272 MovieClip Frame 28
stop();
Symbol 287 MovieClip Frame 20
stop();
Symbol 300 MovieClip Frame 13
stop();
Symbol 310 MovieClip Frame 9
stop();
Symbol 315 MovieClip Frame 8
stop();
Symbol 316 MovieClip [fx] Frame 1
stop();
Instance of Symbol 16 MovieClip [empty] in Symbol 316 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 16 MovieClip [empty] in Symbol 316 MovieClip [fx] Frame 8
onClipEvent (enterFrame) {
_root.f_PixelChase(_parent);
}
Symbol 316 MovieClip [fx] Frame 10
noturn = true;
line.gotoAndStop(1);
line.line.gotoAndPlay(1);
if (!owner.goodguy) {
line.line.line.gotoAndStop(2);
}
Instance of Symbol 16 MovieClip [empty] in Symbol 316 MovieClip [fx] Frame 10
onClipEvent (enterFrame) {
_root.f_Bullet(_parent);
}
Symbol 316 MovieClip [fx] Frame 11
noturn = true;
Symbol 316 MovieClip [fx] Frame 12
noturn = true;
Symbol 316 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 316 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 316 MovieClip [fx] Frame 16
line.line.stop();
line.gotoAndPlay(2);
Instance of Symbol 101 MovieClip in Symbol 316 MovieClip [fx] Frame 17
onClipEvent (enterFrame) {
_root.f_BloodShrapnel(_parent);
}
Instance of Symbol 16 MovieClip [empty] in Symbol 316 MovieClip [fx] Frame 18
onClipEvent (enterFrame) {
_root.f_Shrapnel(_parent);
}
Instance of Symbol 215 MovieClip "body" in Symbol 316 MovieClip [fx] Frame 27
onClipEvent (enterFrame) {
_parent._x = _parent._x + _parent.force_x;
_parent._y = _parent._y + _parent.force_y;
}
Instance of Symbol 16 MovieClip [empty] in Symbol 316 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 316 MovieClip [fx] Frame 30
_root.s_explosion1.start(0, 0);
Symbol 316 MovieClip [fx] Frame 34
if (!owner.goodguy) {
body.body.gotoAndStop(2);
}
Symbol 316 MovieClip [fx] Frame 35
if (!owner.goodguy) {
body.body.gotoAndStop(2);
}
Symbol 337 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/madnessday2007.html", "_new");
}
Symbol 338 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/madnessday2008.html", "_new");
}
Symbol 340 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/madness", "_new");
}
Symbol 358 MovieClip Frame 40
stop();
Symbol 372 Button
on (press) {
gotoAndStop ("end");
_root.play();
}
Instance of Symbol 348 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 381 MovieClip Frame 1
com.Newgrounds.NewgroundsAPI.attachFlashAd(_parent[_name]);
var attachAd = function () {
com.Newgrounds.NewgroundsAPI.attachFlashAd(_parent[_name]);
};
com.Newgrounds.NewgroundsAPI.addEventListener(com.Newgrounds.NewgroundsAPI.events.ADS_APPROVED, attachAd);
background._visible = false;
Symbol 386 Button
on (release) {
this._visible = false;
}
Symbol 393 MovieClip Frame 1
_visible = false;
var checkConnection = function (event) {
if (!event.success) {
_visible = true;
gotoAndStop (3);
}
};
if (com.Newgrounds.NewgroundsAPI.isNewgrounds() || (_root.API_Settings.debug_mode)) {
com.Newgrounds.NewgroundsAPI.addEventListener(com.Newgrounds.NewgroundsAPI.events.MOVIE_CONNECTED, checkConnection);
if ((!com.Newgrounds.NewgroundsAPI.hasUserSession()) && (!_root.API_Settings.debug_mode)) {
_visible = true;
gotoAndStop (2);
}
}
com.Newgrounds.NewgroundsAPI.setMovieVersion(_root.API_Settings.movie_version);
com.Newgrounds.NewgroundsAPI.connectMovie(_root.API_Settings.movie_id, _root.API_Settings.enc_key, _root.API_Settings.debug_mode);
com.Newgrounds.NewgroundsAPI.loadMedals();
stop();
Symbol 1362 MovieClip [__Packages.com.Newgrounds.BaseN] Frame 0
class com.Newgrounds.BaseN
{
var ceiling, hashIndex, bitSize, hashVal, i;
function BaseN (hash) {
ceiling = 100000000000000;
if (hash) {
hashIndex = hash;
} else {
hashIndex = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
}
bitSize = hashIndex.length;
hashVal = new Object();
i = 0;
while (i < bitSize) {
hashVal[hashIndex.charAt(i)] = i;
i++;
}
}
function verify(s) {
if (hashVal[s] != undefined) {
return(true);
}
return(false);
}
function encode(n, minchars) {
debug.lastencode = "";
if (typeof(i) != "string") {
n = n.toString();
}
if (n.charAt(0) == "-") {
var _local3 = "-";
n = n.substring(1);
} else {
var _local3 = "";
}
if (String(n).indexOf(".") > -1) {
var _local4 = String(n).split(".", 2);
return(((_local3 + baseNEncoder(_local4[0], minchars)) + ".") + baseNEncoder(_local4[1]));
}
debug.lastencode = debug.lastencode + "\tNo decimal\r";
return(_local3 + baseNEncoder(n, minchars));
}
function decode(s) {
var _local4 = 1;
if (s.charAt(0) == "-") {
_local4 = -1;
s = s.substring(1, s.length);
}
var _local3 = s.indexOf(".");
if (_local3 > -1) {
var _local5 = Math.pow(10, baseNDecoder(s.substring(_local3 + 1, s.length)));
return((baseNDecoder(s.substring(0, _local3)) / _local5) * _local4);
}
return(baseNDecoder(s) * _local4);
}
function baseNEncoder(n, minchars) {
if (!minchars) {
minchars = 1;
}
var _local4 = "";
while (n != 0) {
n = Math.round(n);
var _local3 = n % bitSize;
if (Math.round(_local3) != _local3) {
trace((((((((("BaseN failed on " + n) + "%") + bitSize) + " = ") + _local3) + " ") + int(n)) + " ") + int(bitSize));
}
_local4 = hashIndex.charAt(_local3) + _local4;
debug.lastencode = debug.lastencode + (((((((("\t-> n:" + n) + " % bitSize:") + bitSize) + " = ") + _local3) + ", final char=") + _local4) + newline);
n = n - _local3;
n = n / bitSize;
}
if (minchars) {
while (_local4.length < minchars) {
_local4 = hashIndex.charAt(0) + _local4;
}
}
return(_local4);
}
function baseNDecoder(s) {
var _local2 = 0;
var _local6 = 0;
i = 0;
while (i < s.length) {
var _local3 = s.charAt((s.length - i) - 1);
if (_local3 == hashIndex.charAt(0)) {
var _local5 = 0;
} else {
var _local5 = hashVal[_local3] * Math.pow(bitSize, i);
}
_local2 = _local2 + _local5;
if (_local2 >= ceiling) {
_local6 = _local6 + ((_local2 - (_local2 % ceiling)) / ceiling);
_local2 = _local2 % ceiling;
}
i++;
}
if (_local6 > 0) {
_local2 = "" + _local2;
while (_local2.length < (ceiling.toString().length - 1)) {
_local2 = "0" + _local2;
}
_local2 = ("" + _local6) + _local2;
}
return(_local2);
}
var debug = new Object();
}
Symbol 1363 MovieClip [__Packages.com.Newgrounds.NewgroundsAPIError] Frame 0
class com.Newgrounds.NewgroundsAPIError
{
var message, name, alias;
function NewgroundsAPIError (error, msg) {
if (Number(error).toString() == String(error)) {
error = Number(error);
} else if (error_codes[String(error)]) {
error = error_codes[String(error)];
} else {
error = 0;
}
code = error;
message = msg;
name = error_names[error];
alias = aliases[error];
}
static function init_codes() {
var _local2 = new Object();
var _local1 = 0;
while (_local1 < aliases.length) {
_local2[aliases[_local1]] = _local1;
_local1++;
}
return(_local2);
}
static function init_names() {
var _local5 = new Array();
var _local3 = 0;
while (_local3 < aliases.length) {
var _local2 = aliases[_local3].toLowerCase().split("_");
var _local1 = 0;
while (_local1 < _local2.length) {
_local2[_local1] = _local2[_local1].substr(0, 1).toUpperCase() + _local2[_local1].substr(1, _local2[_local1].length);
for (var _local4 in always_caps) {
if (_local2[_local1].toUpperCase() == always_caps[_local4]) {
_local2[_local1] = _local2[_local1].toUpperCase();
}
}
_local1++;
}
_local5[_local3] = _local2.join(" ");
_local3++;
}
return(_local5);
}
function isError() {
return(true);
}
static var aliases = new Array("UNKNOWN_ERROR", "INVALID_API_ID", "MISSING_PARAM", "INVALID_STAT_ID", "INVALID_COMMAND_ID", "FLASH_ADS_NOT_APPROVED", "PERMISSION_DENIED", "IDENTIFICATION_REQUIRED", "INVALID_EMAIL_ADDRESS", "BANNED_USER", "SESSION_EXPIRED", "INVALID_SCORE", "INVALID_MEDAL", "INVALID_FOLDER", "FILE_NOT_FOUND", "SITE_ID_REQUIRED", "UPLOAD_IN_PROGRESS", "USER_CANCELLED", "CONFIRM_REQUEST", "CONNECTION_FAILED");
static var always_caps = new Array("API", "URL", "ID");
static var error_codes = init_codes();
static var error_names = init_names();
var code = 0;
}
Symbol 1364 MovieClip [__Packages.com.Newgrounds.NewgroundsAPI] Frame 0
class com.Newgrounds.NewgroundsAPI
{
static var version, user_email, movie_id, debug, session_id, publisher_id, timeout, connected, tracker_id, encryption_key, user_id, user_name, host, error_format, normal_format, link_format, header_format, ad_url, ad_swf_url;
function NewgroundsAPI () {
}
static function setMovieVersion(v) {
if (v) {
version = String(v);
}
}
static function setUserEmail(e) {
user_email = e;
}
static function getOfficialVersionURL() {
var _local1 = (((((GATEWAY_URL + "?tracker_id=") + movie_id) + "&command_id=") + getCommandID("loadOfficalVersion")) + "&seed=") + Math.random();
if (debug) {
_local1 = _local1 + "&debug=1";
}
return(_local1);
}
static function hasUserSession() {
if (session_id && (publisher_id)) {
return(true);
}
if (_root.NewgroundsAPI_PublisherID && (_root.NewgroundsAPI_SessionID)) {
return(true);
}
return(false);
}
static function isNewgrounds() {
return(((publisher_id == 1) || (_root.NewgroundsAPI_PublisherID == 1)) || (getHost().toLowerCase().indexOf("ungrounded.net") > -1));
}
static function hasPublisher() {
return(publisher_id || (_root.NewgroundsAPI_PublisherID));
}
static function hasUserEmail() {
if (user_email) {
return(true);
}
return(false);
}
static function connectionTimeOut() {
clearInterval(timeout);
callListener(events.MOVIE_CONNECTED, false, new com.Newgrounds.NewgroundsAPIError("CONNECTION_FAILED", "Connection to NewgroundsAPI gateway timed out."));
}
static function connectMovie(m_id, encrypt_key, debug_mode) {
if (connected) {
return(undefined);
}
var _local2 = function () {
com.Newgrounds.NewgroundsAPI.connectionTimeOut();
};
timeout = setInterval(_local2, 8000, null);
if (!m_id) {
fatalError("NewgroundsAPI.connectMovie() - missing required movie_id parameter", "connectMovie");
}
movie_id = String(m_id);
tracker_id = Number(movie_id.substring(0, movie_id.indexOf(":")));
encryption_key = encrypt_key;
debug = debug_mode;
if (_root.NewgroundsAPI_PublisherID) {
publisher_id = _root.NewgroundsAPI_PublisherID;
if (_root.NewgroundsAPI_SessionID) {
session_id = _root.NewgroundsAPI_SessionID;
}
} else {
publisher_id = 1;
session_id = null;
user_id = 0;
user_name = "Guest";
}
if (_root.NewgroundsAPI_UserName) {
user_name = _root.NewgroundsAPI_UserName;
}
if (_root.NewgroundsAPI_UserID) {
user_id = _root.NewgroundsAPI_UserID;
}
connected = true;
sendCommand("connectMovie", {host:getHost(), movie_version:version});
}
static function getHost() {
if (!host) {
var _local1 = _url;
if ((_local1.indexOf("http://") > -1) or (_local1.indexOf("https://") > -1)) {
host = _local1.split("/")[2].toLowerCase();
} else {
host = "localhost";
}
}
return(host);
}
static function loadNewgrounds() {
sendCommand("loadNewgrounds", {host:getHost()}, true);
}
static function loadMySite() {
sendCommand("loadMySite", {host:getHost()});
}
static function loadCustomLink(link) {
sendCommand("loadCustomLink", {host:getHost(), link:link}, true);
}
static function logCustomEvent(event) {
sendCommand("logCustomEvent", {host:getHost(), event:event});
}
static function postScore(score, value, get_best) {
if ((!score) or (value == undefined)) {
sendError({command_id:getCommandID("postScore")}, new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", "missing required parameter(s)"));
return(undefined);
}
sendSecureCommand("postScore", {score:score, value:value, get_best:get_best});
}
static function getTodaysScores(score, params) {
getScores(score, "t", params, "getTodaysScores");
}
static function getYesterdaysScores(score, params) {
getScores(score, "y", params, "getYesterdaysScores");
}
static function getThisWeeksScores(score, params) {
getScores(score, "w", params, "getThisWeeksScores");
}
static function getThisMonthsScores(score, params) {
getScores(score, "m", params, "getThisMonthsScores");
}
static function getThisYearsScores(score, params) {
getScores(score, "y", params, "getThisYearsScores");
}
static function getAlltimeScores(score, params) {
getScores(score, "a", params, "getAlltimeScores");
}
static function getScores(score, period, params, command_name) {
if (!score) {
sendError({command_id:getCommandID(command_name)}, new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", "missing required score name"));
return(undefined);
}
if (!params) {
params = new Object();
}
if (!hasUserSession()) {
callListener(events.SCORES_LOADED, false, new com.Newgrounds.NewgroundsAPIError("SITE_ID_REQUIRED", ("Host '" + getHost()) + "' does not have high scores enabled"));
return(undefined);
}
params.publisher_id = publisher_id;
params.period = period;
params.score = score;
if (params.user_id) {
var _local3 = period;
} else {
var _local3 = period + "-u";
}
if (score_page_counts[_local3] == undefined) {
params.request_page_count = true;
}
sendCommand("getScores", params);
}
static function unlockMedal(medal, get_score) {
if (!medal) {
sendError({command_id:getCommandID("unlockMedal")}, new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", "missing required medal name"));
return(undefined);
}
var _local1 = new Object();
_local1.medal = medal;
if (get_score) {
_local1.get_score = get_score;
}
sendSecureCommand("unlockMedal", _local1);
}
static function loadMedals() {
if (medals) {
callListener(events.MEDALS_LOADED, true, {medals:medals});
return(undefined);
}
var _local1 = new Object();
if (hasUserSession()) {
_local1.publisher_id = publisher_id;
_local1.user_id = user_id;
}
sendCommand("getMedals", _local1);
}
static function getMedals() {
return(medals);
}
static function saveLocal(save_id, save_data, size_allocation) {
if (!sharedObjects[save_id]) {
sharedObjects[save_id] = SharedObject.getLocal((("ng_ap_secure_" + movie_id) + "_") + save_id);
}
sharedObjects[save_id].data[save_id] = encodeData(save_data);
sharedObjects[save_id].flush();
}
static function loadLocal(save_id) {
if (!sharedObjects[save_id]) {
sharedObjects[save_id] = SharedObject.getLocal((("ng_ap_secure_" + movie_id) + "_") + save_id);
}
sharedObjects[save_id].flush();
if (sharedObjects[save_id].data[save_id]) {
return(decodeData(sharedObjects[save_id].data[save_id]));
}
return(null);
}
static function encodeData(data) {
return(compressHex(com.Newgrounds.RC4.encrypt(com.Newgrounds.JSON.encode(data), encryption_key)));
}
static function decodeData(base) {
return(com.Newgrounds.JSON.decode(com.Newgrounds.RC4.decrypt(uncompressHex(base), encryption_key)));
}
static function compressHex(hex_value) {
var _local5 = hex_value.length % 6;
var _local4 = "";
var _local1 = 0;
while (_local1 < hex_value.length) {
var _local2 = Number("0x" + hex_value.substr(_local1, 6));
_local4 = _local4 + compressor.encode(_local2, 4);
_local1 = _local1 + 6;
}
return(_local5 + _local4);
}
static function uncompressHex(base_value) {
var _local8 = Number(base_value.charAt(0));
var _local7 = "";
var _local3;
var _local2 = 1;
while (_local2 < base_value.length) {
var _local6 = base_value.substr(_local2, 4);
var _local5 = compressor.decode(_local6);
var _local1 = dec2hex(_local5);
if ((_local2 + 4) < base_value.length) {
_local3 = 6;
} else {
_local3 = _local8;
}
while (_local1.length < _local3) {
_local1 = "0" + _local1;
}
_local7 = _local7 + _local1;
_local2 = _local2 + 4;
}
return(_local7);
}
static function dec2hex(dec) {
var _local4 = "0123456789ABCDEF";
var _local3 = "";
while (dec > 0) {
var _local2 = dec % 16;
_local3 = _local4.charAt(_local2) + _local3;
dec = (dec - _local2) / 16;
}
return(_local3);
}
static function saveFile(folder, filename, contents, thumbnail_source) {
if (!save_file) {
save_file = new com.Newgrounds.NewgroundsAPISaveFile(movie_id, folder, filename);
save_file.setContents(contents);
if (thumbnail_source) {
save_file.setThumbnail(thumbnail_source);
}
save_file.onError = function (msg) {
var _local1 = new com.Newgrounds.NewgroundsAPIError("PERMISSION_DENIED", msg);
com.Newgrounds.NewgroundsAPI.sendError({command_id:com.Newgrounds.NewgroundsAPI.getCommandID("saveFile")}, _local1);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, false, _local1);
};
save_file.onCancel = function (msg) {
var _local1 = new com.Newgrounds.NewgroundsAPIError("USER_CANCELLED", msg);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, false, _local1);
};
save_file.submit();
} else {
var _local1 = new com.Newgrounds.NewgroundsAPIError("UPLOAD_IN_PROGRESS", "Please wait for the previous file to finish uploading");
sendError({command_id:getCommandID("saveFile")}, _local1);
callListener(events.FILE_SAVED, false, _local1);
}
}
static function checkFilePrivs(folder, filename) {
if (user_id) {
var _local1 = user_id;
} else {
var _local1 = 0;
}
var _local2 = {folder:folder, filename:filename, user_id:_local1, publisher_id:publisher_id};
sendCommand("checkFilePrivs", _local2);
}
static function finishFileSave(folder, filename, description, share, file, thumbnail) {
var _local2;
_local2 = {folder:folder, filename:filename, description:description, share:share};
var _local1;
_local1 = {file:file, thumbnail:thumbnail};
sendSecureCommand("saveFile", _local2, null, _local1);
}
static function getFiles(folder, options) {
var _local7 = {name:1, date:2, score:3};
var _local2 = {user_only:false, sort_on:"date", page:1, results_per_page:20, sort_descending:true};
var _local6 = new Array();
for (var _local10 in _local7) {
_local6.push(("'" + _local10) + "'");
}
var _local4 = new Array();
for (var _local9 in _local2) {
_local4.push(("'" + _local9) + "'");
}
if (options.sort_descending && (!_local7[options.sort_descending])) {
var _local3 = new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", (("'" + options.sort_descending) + "' is not a valid sort_on value. Valid values are: ") + _local6.join(", "));
sendError({command_id:getCommandID("getFiles")}, _local3);
delete options.sort_descending;
}
var _local8;
if (options) {
for (var _local10 in options) {
if (_local2[_local10] == undefined) {
var _local3 = new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", (("'" + _local10) + "' is not a valid option. Valid options are: ") + _local4.join(", "));
sendError({command_id:getCommandID("getFiles")}, _local3);
delete options[_local10];
} else if (typeof(options[_local10]) != typeof(_local2[_local10])) {
var _local3 = new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", (("option '" + _local10) + "' should be the following type: ") + typeof(_local2[_local10]));
sendError({command_id:getCommandID("getFiles")}, _local3);
delete options[_local10];
}
}
_local8 = options;
} else {
_local8 = new Object();
}
if (hasUserSession()) {
_local8.publisher_id = publisher_id;
_local8.user_id = user_id;
}
_local8.folder = folder;
sendCommand("getFiles", _local8);
}
static function getConfirmation(command_name, event, msg, target, confirm, cancel) {
var _local1 = new com.Newgrounds.NewgroundsAPIError("CONFIRM_REQUEST", msg);
_local1.confirm = function () {
target[confirm]();
};
_local1.cancel = function () {
target[cancel]();
};
_local1.command = getCommandID(command_name);
callListener(event, false, _local1);
}
static function doBlockHost(event) {
_root.stop();
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 " + getHost()) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var _local4 = _local2.length;
_local2 = _local2 + event.data.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 = event.data.redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format);
}
static function onNewVersionAvailable(event) {
_root.stop();
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 " + event.data.movie_version) + " is now available at:") + newline;
var _local6 = _local3.length;
_local3 = _local3 + event.data.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 = event.data.redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(_local6, _local4, link_format);
}
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 doEvent(e) {
switch (getCommandName(e.command_id)) {
case "connectMovie" :
clearInterval(timeout);
sendMessage("You have successfully connected to the Newgrounds API Gateway");
sendMessage(("Movie identified as \"" + e.movie_name) + "\"");
callListener(events.MOVIE_CONNECTED, e.success, {movie_name:e.movie_name});
var _local4 = false;
if (e.ad_status === -1) {
var _local6 = "This movie was not approved to run Flash Ads.";
sendWarning(_local6);
sendWarning(("visit " + AD_TERMS_URL) + " to view our approval guidelines");
if (!e.ad_url) {
callListener(events.ADS_APPROVED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", _local6));
} else {
_local4 = true;
}
} else if (e.ad_status === 0) {
var _local6 = "Flash Ads are currently awaiting approval.";
sendNotice(_local6);
if (!e.ad_url) {
callListener(events.ADS_APPROVED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", _local6));
} else {
_local4 = true;
}
}
if (e.ad_url) {
ad_url = unescape(e.ad_url);
if (!_local4) {
sendMessage("This movie has been approved to run Flash Ads!");
}
callListener(events.ADS_APPROVED, true);
}
if (e.deny_host) {
var _local6 = getHost() + " does not have permission to run this movie!";
sendWarning(_local6);
sendWarning("\tUpdate your API configuration to unblock " + getHost());
callListener(events.HOST_BLOCKED, true, {movie_url:unescape(e.movie_url), redirect_url:getOfficialVersionURL()});
}
if (e.movie_version) {
sendWarning("According to your API Configuration, this version is out of date.");
if (version) {
sendWarning("\tThe this movie is version " + version);
}
sendWarning("\tThe most current version is " + e.movie_version);
callListener(events.NEW_VERSION_AVAILABLE, true, {movie_version:e.movie_version, movie_url:unescape(e.movie_url), redirect_url:getOfficialVersionURL()});
}
if (e.request_portal_url) {
sendCommand("setPortalID", {portal_url:_url});
}
break;
case "logCustomEvent" :
if (e.success) {
sendMessage(("Event '" + e.event) + "' was logged.");
}
callListener(events.EVENT_LOGGED, e.success, {event:e.event});
break;
case "postScore" :
var _local7;
if (e.success) {
var _local3 = "User";
if (user_email) {
_local3 = user_email;
} else if (user_name) {
_local3 = user_name;
}
sendMessage(((((_local3 + " posted ") + e.value) + " to '") + e.score) + "'");
_local7 = {score:e.score, value:e.value, username:_local3};
}
callListener(events.SCORE_POSTED, e.success, _local7);
break;
case "getScores" :
_local7 = new Object();
if (e.user_id) {
var _local5 = e.period;
} else {
var _local5 = e.period + "-u";
}
if (e.total_pages) {
score_page_counts[_local5] = e.total_pages;
}
_local7.user_id = e.user_id;
_local7.current_page = e.current_page;
_local7.total_pages = score_page_counts[_local5];
_local7.scores = e.scores;
_local7.period = getPeriodName(e.period);
callListener(events.SCORES_LOADED, e.success, _local7);
break;
case "unlockMedal" :
if (medals) {
var _local2 = 0;
while (_local2 < medals.length) {
if (medals[_local2].medal_name === e.medal_name) {
medals[_local2].medal_unlocked = true;
break;
}
_local2++;
}
}
_local7 = {medal_name:e.medal_name, medal_value:e.medal_value, medal_difficulty:e.medal_difficulty};
callListener(events.MEDAL_UNLOCKED, e.success, _local7);
break;
case "getMedals" :
medals = e.medals;
_local7 = {medals:e.medals};
callListener(events.MEDALS_LOADED, e.success, _local7);
break;
case "getFiles" :
break;
case "getSystemFiles" :
break;
case "saveFile" :
save_file = null;
_local7 = {file_id:e.file_id, filename:e.filename, file_url:e.file_url, thumbnail:e.thumbnail, icon:e.icon};
callListener(events.FILE_SAVED, e.success, _local7);
break;
case "checkFilePrivs" :
if (save_file) {
save_file.checkPrivs(e);
} else {
_local7 = {filename:e.filename, folder:e.folder, can_read:e.can_read, can_write:e.can_write};
callListener(events.FILE_PRIVS_LOADED, e.success, _local7);
}
}
}
static function setDefaultListeners() {
var _local1 = new Array();
_local1[events.HOST_BLOCKED] = {listener:doBlockHost};
_local1[events.NEW_VERSION_AVAILABLE] = {listener:onNewVersionAvailable};
return(_local1);
}
static function addEventListener(event, listener, params) {
listeners[event] = {listener:listener, params:params};
}
static function removeEventListener(event) {
delete listeners[event];
}
static function getEventName(event) {
for (var _local2 in events) {
if (events[_local2] == event) {
return(_local2);
}
}
return(undefined);
}
static function callListener(event, success, data, target) {
echo("Fired Event: " + getEventName(event));
if (listeners[event]) {
if (data.isError()) {
listeners[event].listener({event:event, success:success, error:data, target:target}, listeners[event].params);
} else {
listeners[event].listener({event:event, success:success, data:data, target:target}, listeners[event].params);
}
}
}
static function getCommandName(id) {
return(id);
}
static function getCommandID(name) {
return(name);
}
static function getPeriodAliases() {
var _local1 = new Object();
for (var _local2 in period_aliases) {
_local1[period_aliases[_local2].alias] = _local2;
}
return(_local1);
}
static function getPeriodName(p) {
for (var _local2 in period_aliases) {
if (_local2 == p) {
return(period_aliases[_local2].name);
}
}
return(null);
}
static function getPeriodAlias(p) {
for (var _local2 in period_aliases) {
if (_local2 == p) {
return(period_aliases[_local2].alias);
}
}
return(null);
}
static function sendError(c, e) {
trace((((((("[NewgroundsAPI ERROR] :: " + getCommandName(c.command_id)) + "() - ") + e.name) + ":") + newline) + "\t\t\t\t") + e.message);
}
static function sendWarning(m, c) {
if (c) {
m = m + ((("\r[NewgroundsAPI WARNING] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
trace("[NewgroundsAPI WARNING] :: " + m);
}
static function sendNotice(m, c) {
if (c) {
m = m + ((("\r[NewgroundsAPI NOTICE] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
trace("[NewgroundsAPI NOTICE] :: " + m);
}
static function fatalError(m, c) {
if (c) {
m = m + ((("\r\tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
throw (((("***ERROR*** frame=" + _root._currentframe) + ", class=NewgroundsAPI") + newline) + newline) + m;
}
static function sendSecureCommand(command, secure_params, unsecure_params, files) {
if (((!debug) && (!hasUserSession())) && (!hasUserEmail())) {
sendError({command_id:getCommandID(command)}, new com.Newgrounds.NewgroundsAPIError("IDENTIFICATION_REQUIRED", ("You must be logged in or provide an e-mail address ( using NewgroundsAPI.setUserEmail(\"name@domain.com\"); ) to use " + command) + "()."));
return(undefined);
}
if (!command) {
fatalError("Missing command", "sendSecureCommand");
}
if (!secure_params) {
fatalError("Missing secure_params", "sendSecureCommand");
}
if (!unsecure_params) {
unsecure_params = new Object();
}
var _local2 = "";
var _local1 = 0;
while (_local1 < 16) {
_local2 = _local2 + compression_radix.charAt(Math.floor(Math.random() * compression_radix.length));
_local1++;
}
if (debug) {
secure_params.session_id = "";
} else {
secure_params.session_id = session_id;
}
secure_params.as_version = 2;
secure_params.user_email = user_email;
secure_params.publisher_id = publisher_id;
secure_params.seed = _local2;
secure_params.command_id = getCommandID(command);
var _local8 = com.Newgrounds.MD5.calculate(_local2);
var _local6 = com.Newgrounds.RC4.encrypt(com.Newgrounds.JSON.encode(secure_params), encryption_key);
var _local7 = _local8 + _local6;
unsecure_params.secure = compressHex(_local7);
sendCommand("securePacket", unsecure_params, false, files);
}
static function sendCommand(command, params, open_browser, files) {
if ((!connected) and (command != "connectMovie")) {
var _local11 = (("NewgroundsAPI." + command) + "() - NewgroundsAPI.connectMovie() must be called before this command can be called") + newline;
fatalError(_local11, "connectMovie");
}
if (open_browser) {
var _local1 = new Object();
} else {
var _local1 = new LoadVars();
}
_local1.command_id = getCommandID(command);
_local1.tracker_id = movie_id;
if (debug) {
_local1.debug = debug;
}
if (params) {
for (var _local8 in params) {
_local1[_local8] = params[_local8];
}
}
if (files) {
for (var _local8 in files) {
_local1[_local8] = files[_local8];
}
}
echo(("OUTPUT: \r" + com.Newgrounds.JSON.encode(_local1)) + newline);
if (open_browser) {
var _local5 = (GATEWAY_URL + "?seed=") + Math.random();
for (var _local8 in _local1) {
_local5 = _local5 + ((("&" + escape(_local8)) + "=") + escape(_local1[_local8]));
}
getURL (_local5, "_blank");
_local1.removeMovieClip();
} else {
var _local9 = new LoadVars();
_local9.onData = function (data) {
com.Newgrounds.NewgroundsAPI.echo(("INPUT: \r" + data) + newline);
if (data) {
var _local1 = com.Newgrounds.JSON.decode(data);
} else {
var _local1 = {success:false};
}
if (!_local1.success) {
var _local3 = new com.Newgrounds.NewgroundsAPIError(_local1.error_code, _local1.error_msg);
com.Newgrounds.NewgroundsAPI.sendError(_local1, _local3);
} else {
com.Newgrounds.NewgroundsAPI.doEvent(_local1);
}
};
var _local4 = new Array();
for (var _local7 in _local1) {
_local4.push((_local7 + "=") + escape(_local1[_local7]));
}
echo((("POST " + GATEWAY_URL) + "?") + _local4.join("&"));
_local1.sendAndLoad((GATEWAY_URL + "?seed=") + Math.random(), _local9, "POST");
}
}
static function renderAd(target) {
if (ad_swf_url) {
target.background = target.createEmptyMovieClip("background", 100);
target.background.beginFill(0);
target.background.moveTo(0, 0);
target.background.lineTo(300, 0);
target.background.lineTo(300, 250);
target.background.lineTo(0, 250);
target.background.lineTo(0, 0);
target.background.endFill();
target.mask = target.createEmptyMovieClip("mask", 101);
target.mask.beginFill(0);
target.mask.moveTo(0, 0);
target.mask.lineTo(300, 0);
target.mask.lineTo(300, 250);
target.mask.lineTo(0, 250);
target.mask.lineTo(0, 0);
target.mask.endFill();
target.clip = target.createEmptyMovieClip("clip", 102);
target.clip.ad = target.clip.createEmptyMovieClip("ad", 100);
target.clip.setMask(target.mask);
loadMovie (ad_swf_url, target.clip.ad);
callListener(events.AD_ATTACHED, true, null, target);
} else {
callListener(events.AD_ATTACHED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad"));
}
}
static function attachFlashAd(target) {
System.security.allowDomain("http://server.cpmstar.com");
System.security.allowDomain("http://www.cpmstar.com");
System.security.allowDomain("https://server.cpmstar.com");
System.security.allowDomain("https://www.cpmstar.com");
System.security.allowInsecureDomain("http://server.cpmstar.com");
System.security.allowInsecureDomain("http://www.cpmstar.com");
System.security.allowInsecureDomain("https://server.cpmstar.com");
System.security.allowInsecureDomain("https://www.cpmstar.com");
sendMessage("You may get a security sandbox violation from this ad. This is nothing to worry about!");
if (resetAdTimer()) {
if (ad_url) {
var _local1 = new LoadVars();
_local1.onData = function (data) {
if (data) {
com.Newgrounds.NewgroundsAPI.ad_swf_url = data;
} else {
com.Newgrounds.NewgroundsAPI.ad_swf_url = null;
}
com.Newgrounds.NewgroundsAPI.renderAd(target);
};
if (ad_url.indexOf("?") > -1) {
_local1.load((ad_url + "&random=") + Math.random());
} else {
_local1.load((ad_url + "?random=") + Math.random());
}
}
} else {
renderAd(target);
}
}
static function resetAdTimer() {
if (!ad_url) {
return(false);
}
var _local1 = new Date();
if (_local1.getTime() >= ad_reset) {
ad_reset = _local1.getTime() + 300000;
return(true);
}
return(false);
}
static function sendMessage(m, r) {
var _local1 = "[NewgroundsAPI] :: " + m;
if (r) {
return(_local1);
}
trace(_local1);
}
static function echo(m) {
if (do_echo) {
trace(m);
}
}
static var do_echo = false;
static var GATEWAY_URL = "http://www.ngads.com/gateway_v2.php";
static var AD_TERMS_URL = "http://www.newgrounds.com/wiki/flashads/terms/";
static var COMMANDS_WIKI_URL = "http://www.newgrounds.com/wiki/flashapi/commands/";
static var ad_reset = 0;
static var save_file = null;
static var medals = null;
static var score_page_counts = new Object();
static var compression_radix = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
static var compressor = new com.Newgrounds.BaseN(compression_radix);
static var errors = com.Newgrounds.NewgroundsAPIError.init_codes();
static var sharedObjects = new Object();
static var events = {MOVIE_CONNECTED:1, ADS_APPROVED:2, AD_ATTACHED:3, HOST_BLOCKED:4, NEW_VERSION_AVAILABLE:5, EVENT_LOGGED:6, SCORE_POSTED:7, SCORES_LOADED:8, MEDAL_UNLOCKED:9, MEDALS_LOADED:10, FILE_PRIVS_LOADED:11, FILE_SAVED:12};
static var listeners = setDefaultListeners();
static var periods = getPeriodAliases();
static var period_aliases = {t:{name:"Today", alias:"TODAY"}, p:{name:"Yesterday", alias:"YESTERDAY"}, w:{name:"This Week", alias:"THIS_WEEK"}, m:{name:"This Month", alias:"THIS_MONTH"}, y:{name:"This Year", alias:"THIS_YEAR"}, a:{name:"All-Time", alias:"ALL_TIME"}};
}
Symbol 1365 MovieClip [__Packages.com.Newgrounds.NewgroundsAPISaveFile] Frame 0
class com.Newgrounds.NewgroundsAPISaveFile
{
var tracker_id, folder, filename, contents, thumbnail, icon_url, thumbnail_url, description, scan, scanner;
function NewgroundsAPISaveFile (tracker_id, folder, filename) {
this.tracker_id = tracker_id;
this.folder = folder;
this.filename = filename;
contents = null;
thumbnail = null;
icon_url = null;
thumbnail_url = null;
}
function setDescription(description) {
this.description = description;
}
function setShared(share) {
this.share = share;
}
function setContents(contents) {
this.contents = contents;
}
function setThumbnail(thumb) {
if (thumb) {
thumbnail = thumb;
} else {
thumbnail = null;
}
}
function onError(msg) {
trace("[NewgroundsAPISaveFile ERROR] :: " + msg);
}
function onCancel(msg) {
trace("[NewgroundsAPISaveFile] :: " + msg);
}
function submit() {
scan = null;
com.Newgrounds.NewgroundsAPI.checkFilePrivs(folder, filename);
}
function checkPrivs(p) {
if (p.success) {
if (p.can_write) {
can_write = p.can_write;
if (p.exists) {
com.Newgrounds.NewgroundsAPI.getConfirmation("saveFile", com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, ("File '" + filename) + "' exists, overwrite?", this, "startFile", "cancelFile");
} else {
startFile();
}
} else {
onError("This filename is owned by another user.");
}
} else {
onError("There was a problem looking up your file's details");
}
}
function cancelFile() {
onCancel("Overwrite was cancelled");
}
function startFile() {
if (can_write) {
if (thumbnail) {
scanner = new com.Newgrounds.ImageScanner(thumbnail);
scanner.setCallback(this, "writeFile");
scanner.startScan(100, 100, true);
} else {
writeFile();
}
} else {
onError(("You cannot write to filename \"" + filename) + "\"");
}
}
function writeFile(img) {
trace("FINISHED");
com.Newgrounds.NewgroundsAPI.finishFileSave(folder, filename, description, share, com.Newgrounds.JSON.encode(contents), img);
}
var can_write = false;
var share = true;
}
Symbol 1366 MovieClip [__Packages.com.Newgrounds.ImageScanner] Frame 0
class com.Newgrounds.ImageScanner
{
var image_source, source_width, source_height, sourceBitmap, callback_target, callback_function, hash, cube, basen, xpos, ypos, pixels, busy, canvas_width, canvas_height, resizedBitmap, copyBitmap, output, draw_interval, callback_interval;
function ImageScanner (the_source) {
if (the_source) {
image_source = the_source;
} else {
image_source = _root;
}
reset();
if (typeof(image_source) == "movieclip") {
if (image_source == _root) {
source_width = Stage.width;
source_height = Stage.height;
} else {
source_width = Math.floor(image_source._width);
source_height = Math.floor(image_source._height);
}
sourceBitmap = new flash.display.BitmapData(source_width, source_height, false, 4294967295);
sourceBitmap.draw(_root);
} else if (image_source.width) {
source_width = image_source.width;
source_height = image_source.height;
sourceBitmap = image_source;
} else {
error("You can only use BitMaptData and MovieClip objects to create images");
}
}
function setCallback(target, funct) {
if (target && (funct)) {
callback_target = target;
callback_function = funct;
}
}
function reset() {
callback_target = null;
callback_function = null;
debug.bad_pixels = 0;
hash = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&";
var _local3 = Math.pow(hash.length, 2);
trace("MAX COLORS: " + _local3);
var _local2 = Math.floor(Math.pow(_local3, 0.333333333333333)) - 1;
var _local4 = Math.pow(_local2, 3);
cube = _local2;
basen = new com.Newgrounds.BaseN(hash);
xpos = 0;
ypos = 0;
pixels = 0;
busy = false;
}
function startScan(w, h, s) {
if (w) {
image_width = w;
}
if (h) {
image_height = h;
}
if (s != undefined) {
crop = s;
}
var _local7 = _root.getNextHighestDepth();
var _local6 = _root.createEmptyMovieClip("API_image_container_" + _local7, _local7);
var _local5 = _local6.createEmptyMovieClip("canvas", 100);
_local5.attachBitmap(sourceBitmap, 100);
if (crop) {
if ((image_width / source_width) > (image_height / source_height)) {
canvas_width = image_width;
canvas_height = Math.ceil(source_height * (image_width / source_width));
} else {
canvas_height = image_height;
canvas_width = Math.ceil(source_width * (image_height / source_height));
}
} else {
canvas_width = image_width;
canvas_height = image_height;
}
_local5._x = Math.round((image_width - canvas_width) / 2);
_local5._width = canvas_width;
_local5._height = canvas_height;
resizedBitmap = new flash.display.BitmapData(image_width, image_height, false, 4294967295);
resizedBitmap.draw(_local6);
_local6.removeMovieClip();
copyBitmap = new flash.display.BitmapData(image_width, image_height, false, 4294967295);
var _local3 = "" + image_width;
while (_local3.length < 3) {
_local3 = "0" + _local3;
}
var _local4 = "" + image_height;
while (_local4.length < 3) {
_local4 = "0" + _local4;
}
output = _local3 + _local4;
draw_interval = setInterval(this, "drawChunk", 10);
busy = false;
return(resizedBitmap);
}
function getBitmapData() {
return(copyBitmap);
}
function getBytesTotal() {
return((image_width * image_height) * 2);
}
function getBytesScanned() {
return(pixels * 2);
}
function drawChunk() {
if (!busy) {
busy = true;
var _local2 = 0;
while (_local2 < 250) {
if (!nextPixel()) {
clearInterval(draw_interval);
callback_interval = setInterval(this, "doCallback", 25);
busy = true;
break;
}
_local2++;
}
busy = false;
}
}
function doCallback() {
busy = false;
clearInterval(callback_interval);
if (callback_target and callback_function) {
callback_target[callback_function](output);
} else {
onScanComplete(output);
}
}
function onScanComplete(packet) {
sendMessage(("packet size: " + output.length) + " bytes", "onScanComplete");
}
function nextPixel() {
var _local15 = xpos;
var _local14 = ypos;
var _local7 = resizedBitmap.getPixel(_local15, _local14);
var _local17 = (_local7 >> 16) & 255;
var _local20 = (_local7 >> 8) & 255;
var _local16 = (_local7 >> 0) & 255;
var _local11 = Math.round(((_local17 + 1) / 256) * cube);
var _local10 = Math.round(((_local20 + 1) / 256) * cube);
var _local13 = Math.round(((_local16 + 1) / 256) * cube);
var _local12 = (((_local11 * (cube + 1)) * (cube + 1)) + (_local10 * (cube + 1))) + _local13;
var _local6 = basen.encode(_local12, 2);
output = output + _local6;
if (_local6.length != 2) {
trace("bad pixel " + _local6);
}
var _local5 = basen.decode(_local6);
var _local18 = _local5;
var _local8 = _local5 % (cube + 1);
_local5 = (_local5 - _local8) / (cube + 1);
var _local9 = _local5 % (cube + 1);
var _local19 = (_local5 - _local9) / (cube + 1);
if (((_local13 != _local8) and (_local10 != _local9)) and (_local11 != _local10)) {
debug.bad_pixels++;
trace((((((("BAD PIXEL " + debug.bad_pixels) + ") ") + _local12) + " != ") + _local18) + " ") + _local6);
trace(basen.debug.lastencode);
}
var _local2 = Math.round((_local19 / cube) * 255).toString(16);
var _local4 = Math.round((_local9 / cube) * 255).toString(16);
var _local3 = Math.round((_local8 / cube) * 255).toString(16);
while (_local2.length < 2) {
_local2 = "0" + _local2;
}
while (_local4.length < 2) {
_local4 = "0" + _local4;
}
while (_local3.length < 2) {
_local3 = "0" + _local3;
}
copyBitmap.setPixel(_local15, _local14, Number((("0x" + _local2) + _local4) + _local3));
pixels++;
if (pixels >= (image_width * image_height)) {
return(false);
}
xpos++;
if (xpos >= image_width) {
xpos = 0;
ypos++;
}
return(true);
}
function error(e, f) {
sendMessage(e, f, "ERROR");
}
function sendMessage(msg, func, type) {
var _local1 = "ImageScanner";
if (func) {
_local1 = _local1 + (("." + func) + "()");
}
if (type) {
_local1 = (type + " in ") + _local1;
}
_local1 = _local1 + (" :: " + msg);
trace(_local1);
}
var image_width = 100;
var image_height = 100;
var crop = true;
var debug = new Object();
}
Symbol 1367 MovieClip [__Packages.com.Newgrounds.JSON] Frame 0
class com.Newgrounds.JSON
{
function JSON () {
}
static function encode(arg, noquotes) {
var _local3;
var _local2;
var _local6;
var _local1 = "";
var _local4;
if (arg.isSServerVar()) {
var _local8 = "sservervariable";
} else {
var _local8 = typeof(arg);
}
switch (_local8) {
case "sservervariable" :
return("?" + arg.getEncodedValue());
case "object" :
if (arg) {
if (arg instanceof Array) {
_local2 = 0;
while (_local2 < arg.length) {
_local4 = encode(arg[_local2]);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + _local4;
_local2++;
}
return(("[" + _local1) + "]");
}
if (typeof(arg.toString) != "undefined") {
for (_local2 in arg) {
_local4 = arg[_local2];
if ((typeof(_local4) != "undefined") && (typeof(_local4) != "function")) {
_local4 = encode(_local4);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + ((encode(_local2) + ":") + _local4);
}
}
return(("{" + _local1) + "}");
}
}
return("null");
case "number" :
return((isFinite(arg) ? (String(arg)) : "null"));
case "string" :
_local6 = arg.length;
if (noquotes) {
var _local7 = "";
} else {
var _local7 = "\"";
}
_local1 = _local7;
_local2 = 0;
while (_local2 < _local6) {
_local3 = arg.charAt(_local2);
if (_local3 >= " ") {
if ((_local3 == "\\") || (_local3 == "\"")) {
_local1 = _local1 + "\\";
}
_local1 = _local1 + _local3;
} else {
switch (_local3) {
case "\b" :
_local1 = _local1 + "\\b";
break;
case "\f" :
_local1 = _local1 + "\\f";
break;
case newline :
_local1 = _local1 + "\\n";
break;
case "\r" :
_local1 = _local1 + "\\r";
break;
case "\t" :
_local1 = _local1 + "\\t";
break;
default :
_local3 = _local3.charCodeAt();
_local1 = _local1 + (("\\u00" + Math.floor(_local3 / 16).toString(16)) + (_local3 % 16).toString(16));
}
}
_local2 = _local2 + 1;
}
return(_local1 + _local7);
case "boolean" :
return(String(arg));
}
return("null");
}
static function decode(text) {
var at = 0;
var ch = " ";
var _value;
var _error = function (m) {
throw {name:"JSONError", message:m, at:at - 1, text:text};
};
var _next = function () {
ch = text.charAt(at);
at = at + 1;
return(ch);
};
var _white = function () {
while (ch) {
if (ch <= " ") {
_next();
} else if (ch == "/") {
switch (_next()) {
case "/" :
while ((_next() && (ch != newline)) && (ch != "\r")) {
}
break;
case "*" :
_next();
for(;;){
if (ch) {
if (ch == "*") {
if (_next() == "/") {
_next();
// unexpected jump
}
} else {
_next();
}
} else {
_error("Unterminated comment");
}
};
break;
default :
_error("Syntax error");
}
} else {
return;
}
}
};
var _string = function () {
var _local4;
var _local1 = "";
var _local3;
var _local2;
var _local5 = false;
if (ch == "\"") {
while (_next()) {
if (ch == "\"") {
_next();
return(_local1);
}
if (ch == "\\") {
switch (_next()) {
case "b" :
_local1 = _local1 + "\b";
break;
case "f" :
_local1 = _local1 + "\f";
break;
case "n" :
_local1 = _local1 + newline;
break;
case "r" :
_local1 = _local1 + "\r";
break;
case "t" :
_local1 = _local1 + "\t";
break;
case "u" :
_local2 = 0;
_local4 = 0;
while (_local4 < 4) {
_local3 = parseInt(_next(), 16);
if (!isFinite(_local3)) {
_local5 = true;
break;
}
_local2 = (_local2 * 16) + _local3;
_local4 = _local4 + 1;
}
if (_local5) {
_local5 = false;
break;
}
_local1 = _local1 + String.fromCharCode(_local2);
break;
default :
_local1 = _local1 + ch;
}
} else {
_local1 = _local1 + ch;
}
}
}
_error("Bad string");
};
var _array = function () {
var _local1 = [];
if (ch == "[") {
_next();
_white();
if (ch == "]") {
_next();
return(_local1);
}
while (ch) {
_local1.push(_value());
_white();
if (ch == "]") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad array");
};
var _object = function () {
var _local2;
var _local1 = {};
if (ch == "{") {
_next();
_white();
if (ch == "}") {
_next();
return(_local1);
}
while (ch) {
_local2 = _string();
_white();
if (ch != ":") {
break;
}
_next();
_local1[_local2] = _value();
_white();
if (ch == "}") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad object");
};
var _number = function () {
var _local1 = "";
var _local2;
if (ch == "-") {
_local1 = "-";
_next();
}
while ((ch >= "0") && (ch <= "9")) {
_local1 = _local1 + ch;
_next();
}
if (ch == ".") {
_local1 = _local1 + ".";
while ((_next() && (ch >= "0")) && (ch <= "9")) {
_local1 = _local1 + ch;
}
}
_local2 = 1 * _local1;
if (!isFinite(_local2)) {
_error("Bad number");
} else {
return(_local2);
}
};
var _word = function () {
switch (ch) {
case "t" :
if (((_next() == "r") && (_next() == "u")) && (_next() == "e")) {
_next();
return(true);
}
break;
case "f" :
if ((((_next() == "a") && (_next() == "l")) && (_next() == "s")) && (_next() == "e")) {
_next();
return(false);
}
break;
case "n" :
if (!(((_next() == "u") && (_next() == "l")) && (_next() == "l"))) {
break;
}
_next();
return(null);
}
_error("Syntax error");
};
_value = function () {
_white();
switch (ch) {
case "{" :
return(_object());
case "[" :
return(_array());
case "\"" :
return(_string());
case "-" :
return(_number());
}
return((((ch >= "0") && (ch <= "9")) ? (_number()) : (_word())));
};
return(_value());
}
}
Symbol 1368 MovieClip [__Packages.com.Newgrounds.RC4] Frame 0
class com.Newgrounds.RC4
{
function RC4 () {
}
static function encrypt(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToHex(_local2));
}
static function encryptbin(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(_local2);
}
static function decrypt(src, key) {
var _local3 = hexToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToStr(_local2));
}
static function initialize(pwd) {
var _local2 = 0;
var _local3;
var _local4 = pwd.length;
var _local1 = 0;
while (_local1 <= 255) {
mykey[_local1] = pwd[_local1 % _local4];
sbox[_local1] = _local1;
_local1++;
}
_local1 = 0;
while (_local1 <= 255) {
_local2 = ((_local2 + sbox[_local1]) + mykey[_local1]) % 256;
_local3 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local3;
_local1++;
}
}
static function calculate(plaintxt, psw) {
initialize(psw);
var _local1 = 0;
var _local2 = 0;
var _local9 = new Array();
var _local7;
var _local5;
var _local6;
var _local3 = 0;
while (_local3 < plaintxt.length) {
_local1 = (_local1 + 1) % 256;
_local2 = (_local2 + sbox[_local1]) % 256;
_local5 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local5;
var _local4 = (sbox[_local1] + sbox[_local2]) % 256;
_local7 = sbox[_local4];
_local6 = plaintxt[_local3] ^ _local7;
_local9.push(_local6);
_local3++;
}
return(_local9);
}
static function charsToHex(chars) {
var _local4 = new String("");
var _local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local1 = 0;
while (_local1 < chars.length) {
_local4 = _local4 + (_local3[chars[_local1] >> 4] + _local3[chars[_local1] & 15]);
_local1++;
}
return(_local4);
}
static function hexToChars(hex) {
var _local3 = new Array();
var _local1 = ((hex.substr(0, 2) == "0x") ? 2 : 0);
while (_local1 < hex.length) {
_local3.push(parseInt(hex.substr(_local1, 2), 16));
_local1 = _local1 + 2;
}
return(_local3);
}
static function charsToStr(chars) {
var _local3 = new String("");
var _local1 = 0;
while (_local1 < chars.length) {
_local3 = _local3 + String.fromCharCode(chars[_local1]);
_local1++;
}
return(_local3);
}
static function strToChars(str) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < str.length) {
_local3.push(str.charCodeAt(_local1));
_local1++;
}
return(_local3);
}
static var sbox = new Array(255);
static var mykey = new Array(255);
}
Symbol 1369 MovieClip [__Packages.com.Newgrounds.MD5] Frame 0
class com.Newgrounds.MD5
{
function MD5 () {
}
static function calculate(src) {
return(hex_md5(src));
}
static function hex_md5(src) {
return(binl2hex(core_md5(str2binl(src), src.length * 8)));
}
static function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var _local4 = 1732584193 /* 0x67452301 */;
var _local3 = -271733879;
var _local2 = -1732584194;
var _local1 = 271733878 /* 0x10325476 */;
var _local5 = 0;
while (_local5 < x.length) {
var _local10 = _local4;
var _local9 = _local3;
var _local8 = _local2;
var _local7 = _local1;
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 0], 7, -680876936);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 1], 12, -389564586);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 2], 17, 606105819);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 3], 22, -1044525330);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 4], 7, -176418897);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 5], 12, 1200080426);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 6], 17, -1473231341);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 7], 22, -45705983);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 8], 7, 1770035416);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 9], 12, -1958414417);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 10], 17, -42063);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 11], 22, -1990404162);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 12], 7, 1804603682);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 13], 12, -40341101);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 14], 17, -1502002290);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 15], 22, 1236535329);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 1], 5, -165796510);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 6], 9, -1069501632);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 11], 14, 643717713);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 0], 20, -373897302);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 5], 5, -701558691);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 10], 9, 38016083);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 15], 14, -660478335);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 4], 20, -405537848);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 9], 5, 568446438);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 14], 9, -1019803690);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 3], 14, -187363961);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 8], 20, 1163531501);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 13], 5, -1444681467);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 2], 9, -51403784);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 7], 14, 1735328473);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 12], 20, -1926607734);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 5], 4, -378558);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 8], 11, -2022574463);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 11], 16, 1839030562);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 14], 23, -35309556);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 1], 4, -1530992060);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 4], 11, 1272893353);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 7], 16, -155497632);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 10], 23, -1094730640);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 13], 4, 681279174);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 0], 11, -358537222);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 3], 16, -722521979);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 6], 23, 76029189);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 9], 4, -640364487);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 12], 11, -421815835);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 15], 16, 530742520);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 2], 23, -995338651);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 0], 6, -198630844);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 7], 10, 1126891415);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 14], 15, -1416354905);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 5], 21, -57434055);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 12], 6, 1700485571);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 3], 10, -1894986606);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 10], 15, -1051523);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 1], 21, -2054922799);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 8], 6, 1873313359);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 15], 10, -30611744);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 6], 15, -1560198380);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 13], 21, 1309151649);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 4], 6, -145523070);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 11], 10, -1120210379);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 2], 15, 718787259);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 9], 21, -343485551);
_local4 = safe_add(_local4, _local10);
_local3 = safe_add(_local3, _local9);
_local2 = safe_add(_local2, _local8);
_local1 = safe_add(_local1, _local7);
_local5 = _local5 + 16;
}
return(new Array(_local4, _local3, _local2, _local1));
}
static function md5_cmn(q, a, b, x, s, t) {
return(safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b));
}
static function md5_ff(a, b, c, d, x, s, t) {
return(md5_cmn((b & c) | ((~b) & d), a, b, x, s, t));
}
static function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
static function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
static function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
static function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
static function safe_add(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
static function str2binl(str) {
var _local3 = new Array();
var _local4 = 255;
var _local1 = 0;
while (_local1 < (str.length * 8)) {
_local3[_local1 >> 5] = _local3[_local1 >> 5] | ((str.charCodeAt(_local1 / 8) & _local4) << (_local1 % 32));
_local1 = _local1 + 8;
}
return(_local3);
}
static function binl2hex(binarray) {
var _local4 = new String("");
var _local3 = new String("0123456789abcdef");
var _local1 = 0;
while (_local1 < (binarray.length * 4)) {
_local4 = _local4 + (_local3.charAt((binarray[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((binarray[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(_local4);
}
}
Symbol 1370 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 461 MovieClip Frame 1
stop();
Symbol 470 Button
on (press) {
gotoAndPlay ("end");
}
Symbol 487 MovieClip Frame 87
gotoAndPlay (1);
Symbol 487 MovieClip Frame 88
s_titlescreen.stop();
s_static = new Sound(this);
s_static.attachSound("sound_static.wav");
s_static.start(0, 1000);
Symbol 487 MovieClip Frame 155
s_static.stop();
Symbol 487 MovieClip Frame 157
s_static.start(0, 100);
Symbol 487 MovieClip Frame 159
s_static.stop();
Symbol 487 MovieClip Frame 161
s_static.start(0, 100);
Symbol 487 MovieClip Frame 163
s_static.stop();
Symbol 487 MovieClip Frame 168
s_static.start(0, 100);
Symbol 487 MovieClip Frame 173
s_static.stop();
Symbol 487 MovieClip Frame 410
_root.nextFrame();
Symbol 494 Button
on (release) {
stopAllSounds();
getURL ("http://tomfulp.newgrounds.com", "_blank");
}
Symbol 495 Button
on (release) {
stopAllSounds();
getURL ("http://mindchamber.newgrounds.com", "_blank");
}
Symbol 496 Button
on (release) {
stopAllSounds();
getURL ("http://krinkels.newgrounds.com", "_blank");
}
Symbol 497 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/audio/listen/92334", "_blank");
}
Symbol 498 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/audio/listen/171975", "_blank");
}
Symbol 499 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/audio/listen/170120", "_blank");
}
Symbol 500 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/audio/listen/140436", "_blank");
}
Symbol 502 Button
on (release) {
stopAllSounds();
getURL ("http://mike.newgrounds.com", "_blank");
}
Symbol 569 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 577 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/store/product/madness-error-shirt", "_blank");
}
Symbol 581 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/store/product/madness-hank-shirt", "_blank");
}
Symbol 582 Button
on (release) {
stopAllSounds();
getURL ("http://www.newgrounds.com/collection/madnessday2008", "_blank");
}
Symbol 590 Button
on (release) {
stopAllSounds();
gotoAndPlay ("replay");
}
Symbol 592 MovieClip Frame 1
stop();
Symbol 592 MovieClip Frame 2
play();
Instance of Symbol 16 MovieClip [empty] in Symbol 592 MovieClip Frame 2
onClipEvent (load) {
res = 1;
_root.f_MosaicScreen(res);
}
onClipEvent (enterFrame) {
res = res + 2;
_root.f_MosaicScreen(res);
}
Symbol 592 MovieClip Frame 20
_root.f_Clear();
_root.f_BackupStats();
_root.spawnpoint = spawnpoint;
_root.gotoAndPlay(warpto);
gotoAndPlay ("fadein");
Symbol 592 MovieClip Frame 22
play();
Instance of Symbol 16 MovieClip [empty] in Symbol 592 MovieClip Frame 23
onClipEvent (load) {
res = 40;
_root.f_MosaicScreen(res);
}
onClipEvent (enterFrame) {
res = res - 2;
_root.f_MosaicScreen(res);
}
Symbol 592 MovieClip Frame 42
stop();
_root.f_MosaicScreen(0);
Symbol 592 MovieClip Frame 55
play();
Instance of Symbol 16 MovieClip [empty] in Symbol 592 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 592 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 592 MovieClip Frame 102
play();
Symbol 592 MovieClip Frame 133
stop();
Symbol 592 MovieClip Frame 134
play();
Symbol 592 MovieClip Frame 141
stop();
Symbol 592 MovieClip Frame 155
play();
_root.f_MosaicScreen(0);
Symbol 592 MovieClip Frame 362
stop();
Symbol 592 MovieClip Frame 420
_root.gotoAndStop(1);
Symbol 597 MovieClip Frame 1
gotoAndStop (2);
Symbol 597 MovieClip Frame 11
_root.s_power24.start(0, 0);
Symbol 597 MovieClip Frame 36
gotoAndStop (2);
Symbol 601 MovieClip Frame 1
stop();
Symbol 601 MovieClip Frame 2
health.health.text = _root.f_HealthText(_root.p1.health);
play();
Symbol 601 MovieClip Frame 81
stop();
Symbol 614 MovieClip Frame 1
function unlockMedal(m_name) {
clearInterval(pop_delay);
var _local1 = com.Newgrounds.NewgroundsAPI.getMedals();
var _local2 = null;
for (i in _local1) {
if (_local1[i].medal_name == m_name) {
_local2 = _local1[i];
medal_name = _local2.medal_name;
medal_value = _local2.medal_value + "pts";
com.Newgrounds.NewgroundsAPI.unlockMedal(medal_name);
pop_delay = setInterval(endDelay, 3000);
_visible = true;
gotoAndPlay (2);
break;
}
}
}
function endDelay(params) {
gotoAndPlay (10);
clearInterval(pop_delay);
}
var pop_delay;
var medal_name = "?????";
var medal_value = "???";
_visible = false;
Symbol 614 MovieClip Frame 10
var myBitmapData = flash.display.BitmapData.loadBitmap(medal_name + ".gif");
medal_icon.attachBitmap(myBitmapData, 111);
stop();
Symbol 622 MovieClip Frame 1
_quality = "medium";
i = 1;
gotoAndStop (2);
Instance of Symbol 101 MovieClip in Symbol 622 MovieClip Frame 1
onClipEvent (enterFrame) {
_root.f_Quality(_parent);
}
Symbol 622 MovieClip Frame 2
stop();
Instance of Symbol 101 MovieClip in Symbol 622 MovieClip Frame 3
onClipEvent (enterFrame) {
_root.f_Quality(_parent);
_parent.timer--;
if (_parent.timer <= 0) {
_parent.gotoAndStop("blank");
}
}
Symbol 636 MovieClip Frame 36
gotoAndPlay (1);
Symbol 641 MovieClip Frame 1
stop();
Symbol 656 MovieClip Frame 1
_root.f_AddNeutral(this);
Symbol 668 MovieClip Frame 1
stop();
Symbol 668 MovieClip Frame 2
_root.camera.prey = this;
_root.p1.wait = true;
play();
Symbol 668 MovieClip Frame 7
_root.s_elevatordoor.start(0, 0);
Symbol 668 MovieClip Frame 56
_root.f_AddNeutral(this);
Symbol 668 MovieClip Frame 75
_root.s_elevatordoor.start(0, 0);
Symbol 668 MovieClip Frame 114
_root.p1.wait = true;
_parent.chase_cam.gotoAndPlay("jebus");
stop();
Symbol 669 MovieClip Frame 1
_root.f_AddWall(this, z_wall);
z_wall.sticky = true;
gotoAndStop (2);
Symbol 675 MovieClip Frame 1
_root.f_SetHand(this);
Symbol 679 MovieClip Frame 1
_root.f_SetHand(this);
Symbol 683 MovieClip Frame 1
_root.f_SetHand(this);
Symbol 688 MovieClip Frame 1
gotoAndStop (2);
Symbol 692 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 4 MovieClip in Symbol 695 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 704 MovieClip Frame 6
stop();
Symbol 712 MovieClip Frame 4
stop();
Symbol 718 MovieClip Frame 8
_parent.gotoAndStop("stand");
Symbol 723 MovieClip Frame 1
_root.f_SetHand(this);
Symbol 726 MovieClip Frame 1
_root.f_ImpactPoint(this);
Symbol 726 MovieClip Frame 2
gotoAndPlay (1);
Symbol 727 MovieClip Frame 3
_parent.force_x = 12;
_parent.force_y = 0;
_parent.slide_x = 0;
Symbol 727 MovieClip Frame 6
if (!_parent.u_hit) {
gotoAndPlay ("finish");
}
Symbol 727 MovieClip Frame 9
play();
Symbol 727 MovieClip Frame 10
_root.f_EndPunch(_parent);
Symbol 731 MovieClip Frame 4
_root.f_SetForceX(_parent, 12);
_parent.force_y = -8;
_parent.slide_x = 12;
Symbol 731 MovieClip Frame 7
if (!_parent.u_hit) {
gotoAndPlay ("finish");
}
Symbol 731 MovieClip Frame 11
play();
Symbol 731 MovieClip Frame 13
_root.f_EndPunch(_parent);
Symbol 737 MovieClip Frame 8
if (_parent.platform == undefined) {
_parent.gotoAndStop("toss");
} else if (_parent.health <= 0) {
_parent.gotoAndStop("hitground");
} else {
_parent.gotoAndStop("stand");
}
Symbol 738 MovieClip Frame 2
stop();
Symbol 740 MovieClip Frame 2
stop();
Symbol 744 MovieClip Frame 1
_root.f_SetHand(this);
Symbol 745 MovieClip Frame 10
gotoAndPlay ("loop");
Symbol 746 MovieClip Frame 1
stop();
Instance of Symbol 16 MovieClip [empty] in Symbol 746 MovieClip Frame 2
onClipEvent (enterFrame) {
if (_parent._parent.speed_y >= 0) {
_parent.gotoAndStop(3);
}
}
Symbol 747 MovieClip Frame 2
_parent.gotoAndStop("toss2");
Symbol 758 MovieClip Frame 6
if (_parent.health <= 0) {
_parent.alive = false;
if (_parent.body_type == 3) {
gotoAndPlay ("die2");
} else {
gotoAndPlay ("die");
}
}
Symbol 758 MovieClip Frame 20
_root.f_EndPunch(_parent);
Symbol 758 MovieClip Frame 45
_root.f_RemoveEnemy(_parent);
stop();
Symbol 758 MovieClip Frame 46
_root["s_zombiedie" + (random(3) + 1)].start(0, 0);
Symbol 758 MovieClip Frame 70
_root.f_RemoveEnemy(_parent);
stop();
Symbol 758 MovieClip Frame 71
play();
Symbol 758 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 758 MovieClip Frame 117
_root.f_EndPunch(_parent);
Symbol 833 MovieClip Frame 1
s_welding = new Sound(this);
s_welding.attachSound("welding.wav");
s_welding.start(0, 0);
Instance of Symbol 101 MovieClip in Symbol 833 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 833 MovieClip Frame 95
_root.game.game.ceiling.gotoAndPlay("go");
Symbol 833 MovieClip Frame 190
s_welding.stop();
_parent._parent.phase = 10;
_parent._parent.gotoAndStop("stand");
Symbol 835 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 835 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 835 MovieClip Frame 3
_parent.explosions--;
if (_parent.explosions > 0) {
expand = expand + 10;
gotoAndPlay (1);
} else {
stop();
}
Symbol 836 MovieClip Frame 1
if (delay) {
gotoAndStop ("blank");
} else {
_root.f_InitHencher(this);
}
Symbol 836 MovieClip Frame 2
stop();
Instance of Symbol 16 MovieClip [empty] in Symbol 836 MovieClip Frame 2
onClipEvent (enterFrame) {
_root.f_OnScreenActivate(_parent);
}
Symbol 836 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 836 MovieClip Frame 4
_root.f_HencherDefaults(this);
if (head_type == 3) {
_root.zombiesound = true;
}
stop();
Instance of Symbol 16 MovieClip [empty] in Symbol 836 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 16 MovieClip [empty] in Symbol 836 MovieClip Frame 4
onClipEvent (enterFrame) {
_root.f_Hencher(_parent);
}
Instance of Symbol 16 MovieClip [empty] in Symbol 836 MovieClip Frame 4
onClipEvent (enterFrame) {
_root.f_GeneralTimers(_parent);
}
Symbol 836 MovieClip Frame 7
punching = false;
Instance of Symbol 16 MovieClip [empty] in Symbol 836 MovieClip Frame 12
onClipEvent (enterFrame) {
if (_parent.u_hit) {
_root.f_ForceSlide(_parent);
}
}
Symbol 836 MovieClip Frame 13
_root.f_DropGun(this);
Instance of Symbol 16 MovieClip [empty] in Symbol 836 MovieClip Frame 13
onClipEvent (enterFrame) {
if (!_root.f_CharJumping(_parent)) {
_root.f_ForceSlideBack(_parent);
}
}
Symbol 836 MovieClip Frame 15
_root.f_TossPose(this);
Instance of Symbol 16 MovieClip [empty] in Symbol 836 MovieClip Frame 15
onClipEvent (enterFrame) {
_root.f_Toss(_parent);
}
Symbol 836 MovieClip Frame 18
_root.f_DropGun(this);
gotoAndStop ("toss2");
Symbol 836 MovieClip Frame 24
_root.s_bodyfall3.start(0, 0);
_root.f_ShakeY(10);
Symbol 836 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 839 MovieClip Frame 1
stop();
Symbol 886 MovieClip Frame 34
_root.f_MakeZombies();
Symbol 886 MovieClip Frame 130
_root.camera.paused = true;
_root.fader.spawnpoint = 1;
_root.fader.warpto = "level1_3";
_root.fader.gotoAndPlay("fadeout");
stop();
Symbol 887 MovieClip Frame 1
head_type = 1;
gotoAndStop (2);
Instance of Symbol 16 MovieClip [empty] in Symbol 887 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 888 MovieClip Frame 1
_root.f_ObjectPush(this, _root.a_Events);
Instance of Symbol 4 MovieClip in Symbol 888 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 889 MovieClip Frame 1
gotoAndStop (2);
Symbol 914 MovieClip Frame 1
stop();
Symbol 917 MovieClip Frame 1
stop();
Symbol 930 MovieClip Frame 1
stop();
Symbol 948 MovieClip Frame 1
stop();
Symbol 955 MovieClip Frame 1
stop();
Instance of Symbol 16 MovieClip [empty] in Symbol 955 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.gunshooting) {
_parent.gotoAndStop(2);
} else {
_parent.gotoAndStop(1);
}
}
Instance of Symbol 4 MovieClip in Symbol 959 MovieClip Frame 1
onClipEvent (load) {
_parent._parent.w = _parent._width / 2;
_parent._parent.h = _parent._height;
}
Symbol 962 MovieClip Frame 12
gotoAndPlay ("loop");
Symbol 966 MovieClip Frame 1
_parent.gun.gun.gun.gotoAndStop("blank");
Symbol 966 MovieClip Frame 8
_parent.gun.gun.gun.gotoAndStop(_parent.gun_type);
play();
Symbol 966 MovieClip Frame 16
gotoAndPlay ("loop");
Symbol 968 MovieClip Frame 1
stop();
Symbol 971 MovieClip Frame 21
if (_parent.health > 0) {
_parent.gotoAndStop("stand");
} else {
_root.f_GameOver();
stop();
}
Symbol 972 MovieClip Frame 1
stop();
Symbol 972 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 16 MovieClip [empty] in Symbol 972 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 16 MovieClip [empty] in Symbol 972 MovieClip Frame 2
onClipEvent (enterFrame) {
_root.f_Controls(_parent);
}
Instance of Symbol 16 MovieClip [empty] in Symbol 972 MovieClip Frame 2
onClipEvent (enterFrame) {
_root.f_Timers(_parent);
}
Symbol 972 MovieClip Frame 4
gun.gun.gun.gotoAndStop(gun_type);
if (_xscale > 0) {
body._rotation = platform.slope;
} else {
body._rotation = -platform.slope;
}
Symbol 972 MovieClip Frame 5
gun.gun.gun.gotoAndStop(gun_type);
Symbol 972 MovieClip Frame 7
_root.f_TossPose(this);
Instance of Symbol 16 MovieClip [empty] in Symbol 972 MovieClip Frame 7
onClipEvent (enterFrame) {
_root.f_Toss(_parent);
}
Symbol 972 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 972 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 972 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 972 MovieClip Frame 11
_root.f_PY(this, 5);
Instance of Symbol 16 MovieClip [empty] in Symbol 972 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 972 MovieClip Frame 12
gun.gun.gun.gotoAndStop(gun_type);
gun.gun.gun.gun.gotoAndStop("idle");
gun.gotoAndStop(15);
Instance of Symbol 16 MovieClip [empty] in Symbol 972 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 974 MovieClip Frame 1
gotoAndStop (2);
Symbol 976 MovieClip Frame 1
gotoAndPlay (2);
Symbol 976 MovieClip Frame 90
_root.limit_top = _root.game.game.limit_top2._y;
stop();
Symbol 977 MovieClip Frame 1
stop();
Instance of Symbol 16 MovieClip [empty] in Symbol 977 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 979 MovieClip Frame 1
gotoAndStop (2);
Symbol 980 MovieClip Frame 1
stop();
Symbol 980 MovieClip Frame 2
_y = _root.p1._y;
_root.camera.prey = camera;
play();
Symbol 980 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 16 MovieClip [empty] in Symbol 980 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 980 MovieClip Frame 8
_parent.jebus.gotoAndStop("walk");
play();
Symbol 980 MovieClip Frame 26
stop();
Instance of Symbol 15 MovieClip [l2] "floor1" in Symbol 981 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 2;
}
Instance of Symbol 669 MovieClip in Symbol 981 MovieClip Frame 1
onClipEvent (load) {
z_wall.texture = 2;
}
Instance of Symbol 836 MovieClip in Symbol 981 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 836 MovieClip in Symbol 981 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 836 MovieClip in Symbol 981 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 836 MovieClip in Symbol 981 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 836 MovieClip in Symbol 981 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 836 MovieClip in Symbol 981 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 836 MovieClip in Symbol 981 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 981 MovieClip "game" in Symbol 982 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.go == true) {
_root.main();
}
}
Symbol 1003 MovieClip Frame 1
stop();
Instance of Symbol 101 MovieClip in Symbol 1003 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 1003 MovieClip Frame 2
_root.s_thwomp.start(0, 0);
play();
Symbol 1003 MovieClip Frame 49
_root.s_explosion3.start(0, 0);
Symbol 1003 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 1008 MovieClip Frame 1
gotoAndPlay(random(11) + 2);
Symbol 1008 MovieClip Frame 14
gotoAndPlay (2);
Symbol 1013 MovieClip Frame 1
_root.f_AddNeutral(this);
Symbol 1032 MovieClip Frame 1
stop();
Symbol 1033 MovieClip Frame 1
_root.f_AddNeutral(this);
Symbol 1034 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 1036 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 11 MovieClip [l3] "cannon_box" in Symbol 1037 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 2;
z_wall.texture = 2;
}
Instance of Symbol 1034 MovieClip "skylight" in Symbol 1037 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 100;
z_wall.texture = 100;
}
Instance of Symbol 11 MovieClip [l3] "cliff" in Symbol 1037 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 1;
}
Instance of Symbol 836 MovieClip in Symbol 1037 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 836 MovieClip in Symbol 1037 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 836 MovieClip in Symbol 1037 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 836 MovieClip in Symbol 1037 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 1037 MovieClip "game" in Symbol 1038 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.go == true) {
_root.main();
}
}
Symbol 1056 MovieClip Frame 1
gotoAndPlay (2);
Symbol 1056 MovieClip Frame 61
stop();
Symbol 1056 MovieClip Frame 321
stop();
Symbol 1066 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 1069 MovieClip "body" in Symbol 1070 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 1069 MovieClip in Symbol 1070 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 1080 MovieClip Frame 1
stop();
Symbol 1080 MovieClip Frame 2
play();
Symbol 1080 MovieClip Frame 106
_root.f_RemoveWall(_root.game.game.vent.z_wall);
_root.f_RemovePlatform(_root.game.game.vent.z_platform);
Symbol 1080 MovieClip Frame 109
_parent.gunner.wait = false;
stop();
Symbol 1087 MovieClip Frame 1
stop();
Instance of Symbol 1086 MovieClip in Symbol 1087 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + _root.elevator_speed);
}
Symbol 1087 MovieClip Frame 25
gotoAndPlay (1);
Symbol 1100 MovieClip Frame 1
stop();
Instance of Symbol 1086 MovieClip in Symbol 1100 MovieClip Frame 2
onClipEvent (enterFrame) {
_rotation = (_rotation + _root.elevator_speed);
}
Symbol 1103 MovieClip Frame 1
_root.f_AddNeutral(this);
stop();
Symbol 1103 MovieClip Frame 6
_root.f_RemoveWall(_root.game.game.vent.z_wall);
_root.f_RemovePlatform(_root.game.game.vent.z_platform);
play();
Symbol 1103 MovieClip Frame 11
stop();
Symbol 1105 MovieClip Frame 1
_root.f_AddNeutral(this);
gotoAndStop (2);
Symbol 1114 MovieClip Frame 1
stop();
Symbol 1114 MovieClip Frame 2
play();
Symbol 1114 MovieClip Frame 30
stop();
Symbol 1116 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 1116 MovieClip Frame 2
_root.f_RemovePlatform(_root.game.game.ramp1.z_platform);
_root.f_RemovePlatform(_root.game.game.ramp2.z_platform);
play();
Symbol 1116 MovieClip Frame 20
stop();
Instance of Symbol 16 MovieClip [empty] in Symbol 1116 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 1116 MovieClip Frame 21
s_elevator.stop();
Instance of Symbol 101 MovieClip in Symbol 1117 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.y = _parent._y;
_parent.x = _parent._x + _parent.body._x;
}
Instance of Symbol 1061 MovieClip "shaft" in Symbol 1118 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 15 MovieClip [l2] "floor1" in Symbol 1118 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 2;
}
Instance of Symbol 836 MovieClip "welder" in Symbol 1118 MovieClip Frame 1
onClipEvent (load) {
delay = true;
phase = 11;
face_type = 4;
head_type = 1;
body_type = 1;
}
Instance of Symbol 836 MovieClip "gunner" in Symbol 1118 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 836 MovieClip "zombie1" in Symbol 1118 MovieClip Frame 1
onClipEvent (load) {
delay = true;
phase = 1;
face_type = 3;
head_type = 3;
body_type = 3;
gun_type = 0;
}
Instance of Symbol 836 MovieClip "zombie2" in Symbol 1118 MovieClip Frame 1
onClipEvent (load) {
delay = true;
phase = 1;
face_type = 3;
head_type = 3;
body_type = 3;
gun_type = 0;
}
Instance of Symbol 836 MovieClip "zombie3" in Symbol 1118 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 836 MovieClip "zombie4" in Symbol 1118 MovieClip Frame 1
onClipEvent (load) {
delay = true;
phase = 1;
face_type = 3;
head_type = 3;
body_type = 3;
gun_type = 0;
}
Instance of Symbol 836 MovieClip "zombie5" in Symbol 1118 MovieClip Frame 1
onClipEvent (load) {
delay = true;
phase = 1;
face_type = 3;
head_type = 3;
body_type = 3;
gun_type = 0;
}
Instance of Symbol 836 MovieClip "zombie6" in Symbol 1118 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 1118 MovieClip "game" in Symbol 1119 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.go == true) {
_root.main();
}
}
Instance of Symbol 836 MovieClip in Symbol 1120 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
phase = 10;
}
Instance of Symbol 836 MovieClip in Symbol 1120 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
phase = 10;
}
Instance of Symbol 1120 MovieClip "game" in Symbol 1121 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.go == true) {
_root.main();
}
}
Symbol 1127 MovieClip Frame 33
gotoAndPlay (1);
Symbol 1135 MovieClip Frame 1
stop();
Symbol 1145 MovieClip Frame 1
default_y = _y;
_y = (_root.game.game.clownhead._y + 300);
stop();
Instance of Symbol 16 MovieClip [empty] in Symbol 1145 MovieClip Frame 3
onClipEvent (load) {
_root.f_ClownBody(_parent);
}
onClipEvent (enterFrame) {
_root.f_ClownBody(_parent);
}
Symbol 1177 MovieClip Frame 50
_x = (-random(2000));
Symbol 1183 MovieClip Frame 1
_root.f_AddNeutral(this);
_root.f_Depth(this, this._y + 100);
stop();
Symbol 1183 MovieClip Frame 2
_root.f_AddNeutral(_parent.dancefloor);
_root.f_Depth(_parent.dancefloor, this._y + 105);
_root.screenOverlay.start();
play();
Symbol 1183 MovieClip Frame 22
stop();
Instance of Symbol 1177 MovieClip in Symbol 1183 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1177 MovieClip in Symbol 1183 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1177 MovieClip in Symbol 1183 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1177 MovieClip in Symbol 1183 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1177 MovieClip in Symbol 1183 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1177 MovieClip in Symbol 1183 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1177 MovieClip in Symbol 1183 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1177 MovieClip in Symbol 1183 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Instance of Symbol 1177 MovieClip in Symbol 1183 MovieClip Frame 22
onClipEvent (load) {
gotoAndPlay(random(40) + 2);
}
Symbol 1190 MovieClip Frame 2
stop();
Symbol 1191 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 1200 MovieClip Frame 1
stop();
Symbol 1200 MovieClip Frame 2
play();
Symbol 1200 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 1200 MovieClip Frame 63
_root.f_EnemyShootSound();
Symbol 1200 MovieClip Frame 65
_root.f_EnemyShootSound();
Symbol 1201 MovieClip Frame 3
_parent.gotoAndStop("idle");
Symbol 1203 MovieClip Frame 1
health.text = _root.f_HealthText(_parent.health);
Symbol 1207 MovieClip Frame 1
_root.s_explosion1.start(0, 0);
Instance of Symbol 16 MovieClip [empty] in Symbol 1207 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 1207 MovieClip Frame 6
_root.s_explosion1.start(0, 0);
Symbol 1207 MovieClip Frame 13
_root.f_ShakeX(20);
_root.s_explosion3.start(0, 0);
Symbol 1207 MovieClip Frame 33
stop();
Symbol 1208 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 1208 MovieClip Frame 2
stop();
Symbol 1208 MovieClip Frame 3
if (_xscale < 0) {
status._xscale = -100;
}
Symbol 1214 MovieClip Frame 1
stop();
Symbol 1216 MovieClip Frame 1
stop();
Symbol 1251 MovieClip Frame 3
_root.f_SetForceX(_parent, 12);
_parent.force_y = 10;
Symbol 1251 MovieClip Frame 7
if (!_parent.u_hit) {
gotoAndPlay ("finish");
}
Symbol 1251 MovieClip Frame 12
play();
Symbol 1251 MovieClip Frame 24
_parent.gotoAndStop("idle");
Symbol 1254 MovieClip Frame 9
gotoAndPlay (1);
Symbol 1255 MovieClip Frame 37
_root.s_splash.start(0, 0);
Instance of Symbol 101 MovieClip "body" in Symbol 1255 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 1255 MovieClip Frame 72
stop();
Symbol 1256 MovieClip Frame 1
x = _x;
y = _y;
if (_xscale < 0) {
sign._x = sign._x + 150;
_xscale = (_xscale * -1);
}
stop();
Instance of Symbol 16 MovieClip [empty] in Symbol 1256 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 1256 MovieClip Frame 3
_xscale = 100;
Symbol 1263 MovieClip Frame 3
_parent.gotoAndStop("idle");
Symbol 1264 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 1264 MovieClip Frame 2
stop();
Symbol 1270 MovieClip Frame 1
stop();
Symbol 1270 MovieClip Frame 2
play();
Symbol 1270 MovieClip Frame 45
stop();
Symbol 1270 MovieClip Frame 46
play();
Symbol 1270 MovieClip Frame 90
_root.f_ShakeY(10);
_root.s_doorslam.start(0, 0);
Symbol 1270 MovieClip Frame 91
stop();
Symbol 1271 MovieClip Frame 1
_root.f_AddNeutral(this);
_root.f_Depth(this, (_y + _height) + 300);
door1.gotoAndStop("opened");
door2.gotoAndStop("closed");
Symbol 1272 MovieClip Frame 1
_root.f_AddNeutral(this);
Symbol 1276 MovieClip Frame 1
_root.f_AddNeutral(this);
alive = true;
stop();
Instance of Symbol 16 MovieClip [empty] in Symbol 1276 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 1283 MovieClip Frame 1
stop();
Symbol 1283 MovieClip Frame 2
play();
Symbol 1283 MovieClip Frame 7
stop();
Symbol 1283 MovieClip Frame 16
play();
Symbol 1283 MovieClip Frame 21
stop();
Symbol 1283 MovieClip Frame 28
play();
Symbol 1283 MovieClip Frame 49
stop();
Symbol 1283 MovieClip Frame 53
play();
Symbol 1283 MovieClip Frame 173
stop();
Symbol 1283 MovieClip Frame 577
gotoAndStop ("idle");
Symbol 1284 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 101 MovieClip in Symbol 1284 MovieClip Frame 3
onClipEvent (enterFrame) {
_root.f_ClownHandMove(_parent);
}
Symbol 1284 MovieClip Frame 4
play();
Symbol 1284 MovieClip Frame 6
gotoAndStop ("idle");
Symbol 1289 MovieClip Frame 1
stop();
Symbol 1290 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 101 MovieClip in Symbol 1290 MovieClip Frame 3
onClipEvent (enterFrame) {
_root.f_ClownHandMove(_parent);
}
Symbol 1290 MovieClip Frame 4
play();
Symbol 1290 MovieClip Frame 6
gotoAndStop ("idle");
Symbol 1290 MovieClip Frame 7
play();
Symbol 1290 MovieClip Frame 9
gotoAndStop ("idle");
Symbol 1292 MovieClip Frame 115
if (!busy) {
gotoAndPlay ("spin");
}
Symbol 1292 MovieClip Frame 118
busy = false;
Instance of Symbol 16 MovieClip [empty] in Symbol 1292 MovieClip Frame 160
onClipEvent (enterFrame) {
_root.f_ClownHandSmash(_parent);
}
Symbol 1292 MovieClip Frame 163
_root.s_clownswipe.start(0, 0);
Symbol 1292 MovieClip Frame 170
_parent._parent.clownhead.body.gotoAndPlay("roar");
Symbol 1292 MovieClip Frame 227
if (!busy) {
gotoAndPlay ("spin");
}
Symbol 1292 MovieClip Frame 233
busy = false;
Symbol 1292 MovieClip Frame 256
stop();
Symbol 1292 MovieClip Frame 325
gotoAndPlay ("die_loop");
Symbol 1293 MovieClip Frame 5
_parent._parent.monitor.gotoAndStop(2);
Symbol 1293 MovieClip Frame 45
_root.s_clownroar.start(0, 0);
_parent._parent.clownhead.body.gotoAndPlay("scream");
Symbol 1293 MovieClip Frame 126
if (!busy) {
gotoAndPlay ("spin");
}
Symbol 1293 MovieClip Frame 128
_root.game.game.clownhead.body.gotoAndPlay("open");
Symbol 1293 MovieClip Frame 129
busy = false;
Symbol 1293 MovieClip Frame 151
_root.s_clownfire.start(0, 0);
Instance of Symbol 16 MovieClip [empty] in Symbol 1293 MovieClip Frame 151
onClipEvent (enterFrame) {
_root.f_ClownShot(_parent);
}
Symbol 1293 MovieClip Frame 215
_root.game.game.clownhead.body.gotoAndPlay("close");
Symbol 1293 MovieClip Frame 238
if (!busy) {
gotoAndPlay ("spin");
}
Symbol 1293 MovieClip Frame 240
_root.game.game.clownhead.body.gotoAndPlay("open");
Symbol 1293 MovieClip Frame 241
busy = false;
Symbol 1293 MovieClip Frame 263
_root.s_clownfire.start(0, 0);
Instance of Symbol 16 MovieClip [empty] in Symbol 1293 MovieClip Frame 263
onClipEvent (enterFrame) {
_root.f_ClownShot(_parent);
}
Symbol 1293 MovieClip Frame 327
_root.game.game.clownhead.body.gotoAndPlay("close");
Symbol 1293 MovieClip Frame 350
if (!busy) {
gotoAndPlay ("spin");
}
Instance of Symbol 16 MovieClip [empty] in Symbol 1293 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 1293 MovieClip Frame 356
busy = false;
_root.s_clowndie.start(0, 0);
Symbol 1293 MovieClip Frame 387
_parent._parent.monitor.gotoAndStop(3);
Instance of Symbol 16 MovieClip [empty] in Symbol 1293 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 1293 MovieClip Frame 416
gotoAndPlay ("deathloop");
Symbol 1294 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 1292 MovieClip "hand1" in Symbol 1294 MovieClip Frame 3
onClipEvent (load) {
_xscale = (_xscale * -1);
}
Instance of Symbol 1293 MovieClip "clownhead" in Symbol 1294 MovieClip Frame 3
onClipEvent (load) {
_xscale = (_xscale * -1);
}
Symbol 1296 MovieClip Frame 1
gotoAndStop (2);
Symbol 1297 MovieClip Frame 1
_root.f_AddNeutral(this);
_root.camera.prey = camera;
_root.f_CameraPop();
Symbol 1297 MovieClip Frame 106
_root.target_scale = 40;
Symbol 1297 MovieClip Frame 131
_root.p1.wait = false;
_root.p1.autowalk_timer = 20;
_root.f_PY(_root.p1, 10);
_root.p1.gotoAndStop("stand");
Symbol 1297 MovieClip Frame 149
stop();
speed_y = 2;
_parent.sidewalls.door1.gotoAndPlay("close");
_root.s_elevatordoor.start(0, 0);
Instance of Symbol 101 MovieClip in Symbol 1297 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 101 MovieClip in Symbol 1297 MovieClip Frame 166
onClipEvent (enterFrame) {
_parent._x = _root.p1._x;
}
Symbol 1297 MovieClip Frame 190
_root.s_record.start(0, 0);
Symbol 1297 MovieClip Frame 220
_parent.sidewalls.door1.gotoAndPlay("open");
_parent.sidewalls.door2.gotoAndPlay("open");
_root.s_elevatordoor.start(0, 0);
Symbol 1297 MovieClip Frame 265
_parent.danger.gotoAndPlay("go");
Symbol 1297 MovieClip Frame 380
_root.s_calliope.s_calliope.setVolume(100);
_root.s_calliope.s_calliope.start(0, 1000);
Symbol 1297 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 101 MovieClip in Symbol 1297 MovieClip Frame 396
onClipEvent (enterFrame) {
_parent._x = _root.p1._x;
}
Instance of Symbol 16 MovieClip [empty] in Symbol 1297 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 1297 MovieClip Frame 425
_parent.clowndj.gotoAndStop("jump");
Instance of Symbol 101 MovieClip in Symbol 1297 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 1297 MovieClip Frame 576
stop();
Instance of Symbol 101 MovieClip in Symbol 1297 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 1306 MovieClip Frame 1
_root.f_AddNeutral(this);
gotoAndStop (2);
Symbol 1306 MovieClip Frame 3
_root.s_cursor34.start(0, 0);
play();
Symbol 1306 MovieClip Frame 40
_root.s_cursor34.start(0, 0);
Symbol 1306 MovieClip Frame 73
_root.s_cursor33.start(0, 0);
Symbol 1306 MovieClip Frame 93
_root.s_cursor33.start(0, 0);
Symbol 1306 MovieClip Frame 107
stop();
Symbol 1308 MovieClip Frame 1
gotoAndStop (2);
Symbol 1310 MovieClip Frame 1
gotoAndStop (2);
Instance of Symbol 1191 MovieClip in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
glow = _parent.glow1;
}
Instance of Symbol 1208 MovieClip "speaker1" in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
}
Instance of Symbol 1191 MovieClip in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
glow = _parent.glow4;
}
Instance of Symbol 1191 MovieClip in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
glow = _parent.glow5;
}
Instance of Symbol 1191 MovieClip in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
glow = _parent.glow6;
}
Instance of Symbol 1191 MovieClip in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
glow = _parent.glow2;
}
Instance of Symbol 1191 MovieClip in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
glow = _parent.glow3;
}
Instance of Symbol 1276 MovieClip "glow3" in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
}
Instance of Symbol 1276 MovieClip "glow1" in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
beam1._rotation = beam1._rotation + 30;
beam2._rotation = beam2._rotation + 30;
}
Instance of Symbol 1276 MovieClip "glow4" in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
beam1._rotation = beam1._rotation + 30;
beam2._rotation = beam2._rotation + 30;
_xscale = (_xscale * -1);
}
Instance of Symbol 1276 MovieClip "glow5" in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
beam1._rotation = beam1._rotation + 30;
beam2._rotation = beam2._rotation + 30;
}
Instance of Symbol 1276 MovieClip "glow6" in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
beam1._rotation = beam1._rotation + 30;
beam2._rotation = beam2._rotation + 30;
_xscale = (_xscale * -1);
}
Instance of Symbol 15 MovieClip [l2] "floor1" in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 2;
}
Instance of Symbol 669 MovieClip in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
z_wall.texture = 2;
}
Instance of Symbol 669 MovieClip in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
z_wall.texture = 2;
}
Instance of Symbol 836 MovieClip "thug1" in Symbol 1311 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 836 MovieClip in Symbol 1311 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 836 MovieClip in Symbol 1311 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 836 MovieClip in Symbol 1311 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 836 MovieClip "dance1" in Symbol 1311 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 836 MovieClip in Symbol 1311 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 836 MovieClip in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
phase = 1;
face_type = 1;
head_type = 1;
body_type = 1;
goframe = "dance3";
gotoAndStop ("activate");
}
Instance of Symbol 836 MovieClip in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
phase = 1;
face_type = 1;
head_type = 1;
body_type = 1;
goframe = "dance4";
gotoAndStop ("activate");
}
Instance of Symbol 1290 MovieClip "hand1" in Symbol 1311 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_xscale * -1);
}
Instance of Symbol 1311 MovieClip "game" in Symbol 1312 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.go == true) {
_root.main();
}
}
Symbol 1317 MovieClip Frame 1
stop();
Symbol 1328 MovieClip Frame 1
stop();
Symbol 1332 MovieClip Frame 1
y = _y;
x = _x;
stop();
Instance of Symbol 16 MovieClip [empty] in Symbol 1332 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 16 MovieClip [empty] in Symbol 1332 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 1332 MovieClip Frame 28
_root.p1.wait = true;
body_type = 1;
head_type = 1;
face_type = 1;
hand_type = 1;
Symbol 1332 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 1332 MovieClip Frame 106
_root.s_calliope.s_calliope.setVolume(0);
Symbol 1332 MovieClip Frame 136
radio.gotoAndStop(2);
_root.medal_popup.unlockMedal("A Winner is You");
Symbol 1332 MovieClip Frame 244
_root.limit_top = _root.game.game.limit_top2._y;
_root.p1.wait = true;
_root.fader.gotoAndPlay("end");
stop();
Symbol 1332 MovieClip Frame 245
_root.limit_top = _root.game.game.limit_top2._y;
stop();
Instance of Symbol 16 MovieClip [empty] in Symbol 1332 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 1333 MovieClip Frame 35
_root.arrow.gotoAndPlay("go");
stop();
Symbol 1334 MovieClip Frame 1
_root.f_AddNeutral(this);
Instance of Symbol 11 MovieClip [l3] "cliff" in Symbol 1335 MovieClip Frame 1
onClipEvent (load) {
z_platform.texture = 1;
}
Instance of Symbol 1335 MovieClip "game" in Symbol 1336 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.go == true) {
_root.main();
}
}
Symbol 1360 MovieClip Frame 1245
stop();
Symbol 1361 MovieClip Frame 1
_root.fp_fpsLimiter = undefined;
Instance of Symbol 16 MovieClip [empty] in Symbol 1361 MovieClip Frame 796
onClipEvent (enterFrame) {
_parent._xscale = _parent._xscale + 0.1;
_parent._yscale = _parent._yscale + 0.1;
}
Symbol 1361 MovieClip Frame 1242
_root.fp_fpsLimiter = _root.fpsLimiter;
_parent.gotoAndPlay("level1_4");