Frame 1
_fglv = new LoadVars();
_fglv.gid = 257;
_fglv.url = _root._url;
_fglv.sendAndLoad("http://www.freegamesforyourwebsite.com/stats.php", _fglv, "POST");
delete _fglv;
var debug = true;
var gameID = 267;
var gameName = "evilminion";
stop();
fscommand ("showmenu", "false");
prel.onEnterFrame = function () {
prel.procent.text = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
prel.gotoAndStop(prel.procent.text);
if (Number(prel.procent.text) > 99) {
play();
delete this.onEnterFrame;
}
};
Frame 2
stop();
Frame 3
if (!okToPlay) {
gotoAndStop (2);
}
Frame 11
_quality = "HIGH";
_lockroot = true;
Stage.showMenu = false;
gotoAndPlay ("title");
Frame 21
stop();
_global.lives = 3;
_global.musicOn = true;
_global.allTimeOrphans = 0;
Instance of Symbol 674 MovieClip in Frame 21
on (release) {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=257&area=minilogo", "_blank");
}
Frame 31
stop();
Frame 41
stopAllSounds();
Frame 42
stop();
switch (_root.currentCutscene) {
case 0 :
_root.cutscenes.gotoAndStop("intro");
break;
case 1 :
_root.cutscenes.gotoAndStop("level1");
break;
case 2 :
_root.cutscenes.gotoAndStop("level2");
break;
case 3 :
_root.cutscenes.gotoAndStop("level3");
break;
case 4 :
_root.cutscenes.gotoAndStop("level4");
break;
case 5 :
_root.cutscenes.gotoAndStop("level5");
break;
case 6 :
_root.cutscenes.gotoAndStop("level6");
break;
case 7 :
_root.cutscenes.gotoAndStop("changeheart");
break;
case 8 :
_root.cutscenes.gotoAndStop("ending");
break;
default :
_root.cutscenes.gotoAndStop("init");
}
Frame 51
stopAllSounds();
Frame 52
_root.gotoAndPlay("game");
Frame 61
stop();
_root.breakout._visible = false;
_root.breakout._alpha = 100;
_root.breakin._visible = false;
_root.breakin._alpha = 100;
_root.snatched._visible = false;
_root.snatched._alpha = 100;
_root.dattack._visible = false;
_root.dattack._alpha = 100;
Frame 71
stopAllSounds();
Frame 72
stop();
Frame 81
stop();
stopAllSounds();
startoverBtn.onRelease = function () {
_global.worldID = 2;
_global.partID = 1;
_root.gotoAndPlay("title");
};
Instance of Symbol 1450 MovieClip [TMP6pbk6uzm9i] in Frame 81
//component parameters
onClipEvent (construct) {
gameID = 267;
}
Instance of Symbol 1455 MovieClip [TMP6ojzjuzm8i] in Frame 81
//component parameters
onClipEvent (construct) {
gameID = 267;
}
Symbol 5 Button
on (release) {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=257&area=loader", "_blank");
}
Symbol 66 MovieClip Frame 1
stop();
var tagctr = (random(55) + 1);
gotoAndStop(tagctr);
Symbol 67 MovieClip Frame 105
stop();
Symbol 73 MovieClip Frame 1
_root.earl223 = function (val) {
var _local3 = new Array("_", "Z", "y", "x", "W", "v", "u", "T", "s", "r", "Q", "P", "O", "n", "m", "L", "K", "j", "i", "H", "g", "F", "e", "d", "C", "B", "a");
var _local2 = "";
val1 = 0;
while (val1 < val.length) {
if (val.substr(val1, 1) == ":") {
_local2 = _local2 + ":";
} else if (Number(val.substr(val1, 2)) > 26) {
_local2 = _local2 + _local3[Number(val.substr(val1, 1))];
} else if (Number(val.substr(val1, 1)) == 0) {
_local2 = _local2 + "_";
} else {
_local2 = _local2 + _local3[Number(val.substr(val1, 2))];
val1++;
}
val1++;
}
return(_local2);
};
Symbol 80 MovieClip Frame 1
stop();
Symbol 1458 MovieClip [__Packages.Sprite] Frame 0
class Sprite extends MovieClip
{
var stop, _x, _y, _xscale, _yscale;
function Sprite () {
super();
stop();
setAction(ACTION_NONE);
}
function setAction(newAction, newActionParams) {
if (action != newAction) {
action = newAction;
initAction();
actionStart = _global.game.frame;
}
}
function getAction() {
return(action);
}
function getActionElapsed() {
return(_global.game.frame - actionStart);
}
function initAction() {
}
function actionDone() {
}
function get xy() {
return(new Vector2D(_x, _y));
}
function set xy(p) {
_x = p.x;
_y = p.y;
//return(xy);
}
function moveXY(x, y) {
_x = _x + x;
_y = _y + y;
}
function moveX(x) {
_x = _x + x;
}
function moveY(y) {
_y = _y + y;
}
function get flipX() {
return(_xscale < 0);
}
function set flipX(b) {
if (b) {
if (_xscale > 0) {
_xscale = _xscale * -1;
}
} else if (_xscale < 0) {
_xscale = _xscale * -1;
}
//return(flipX);
}
function get flipY() {
return(_yscale < 0);
}
function set flipY(b) {
if (b) {
if (_yscale > 0) {
_yscale = _yscale * -1;
}
} else if (_yscale < 0) {
_yscale = _yscale * -1;
}
//return(flipY);
}
static var ACTION_NONE = 0;
var action = ACTION_NONE;
var actionStart = 0;
}
Symbol 1459 MovieClip [__Packages.Vector2D] Frame 0
class Vector2D
{
var x, y;
function Vector2D (x, y) {
this.x = x;
this.y = y;
}
function magnitude() {
return(Math.sqrt((x * x) + (y * y)));
}
function normalize() {
var _local2 = new Vector2D();
var _local3 = magnitude();
if (_local3 == 0) {
_local2.x = 0;
_local2.y = 0;
} else {
_local2.x = x / _local3;
_local2.y = y / _local3;
}
return(_local2);
}
function normalise() {
var _local2 = new Vector2D();
var _local3 = magnitude();
if (_local3 == 0) {
_local2.x = 0;
_local2.y = 0;
} else {
_local2.x = x / _local3;
_local2.y = y / _local3;
}
return(_local2);
}
function dot(b) {
return((x * b.x) + (y * b.y));
}
function sum(b) {
var _local2 = new Vector2D();
_local2.x = x + b.x;
_local2.y = y + b.y;
return(_local2);
}
function subtract(b) {
var _local2 = new Vector2D();
_local2.x = x - b.x;
_local2.y = y - b.y;
return(_local2);
}
function scale(a) {
var _local2 = new Vector2D();
_local2.x = x * a;
_local2.y = y * a;
return(_local2);
}
function clone() {
var _local2 = new Vector2D();
_local2.x = x;
_local2.y = y;
return(_local2);
}
function distance(b) {
return(subtract(b).magnitude());
}
}
Symbol 1460 MovieClip [__Packages.Actor] Frame 0
class Actor extends Sprite
{
var solid, attachMovie, getNextHighestDepth, action, _visible, __get__flipX, __set__flipX, _x, _y;
function Actor (h, w) {
super();
height = h;
width = w;
solid = attachMovie("solid", "solid", getNextHighestDepth());
solid._visible = false;
solid._height = height * 2;
solid._width = width * 2;
}
function destroy() {
exists = false;
alive = false;
active = false;
action = Sprite.ACTION_NONE;
_visible = false;
}
function get dir() {
return((__get__flipX() ? (DIR_LEFT) : (DIR_RIGHT)));
}
function set dir(dir) {
__set__flipX(dir == DIR_LEFT);
//return(this.dir);
}
function reverseDir() {
__set__flipX(!__get__flipX());
}
function faceActor(a) {
if (a._x > _x) {
dir = (DIR_RIGHT);
} else {
dir = (DIR_LEFT);
}
}
function faceRight() {
dir = (DIR_RIGHT);
}
function faceLeft() {
dir = (DIR_LEFT);
}
function isFacing(actor) {
var _local2 = actor._x - _x;
if (_local2 > 0) {
return(dir == DIR_RIGHT);
}
if (_local2 < 0) {
return(dir == DIR_LEFT);
}
return(true);
}
function limitSpeedX() {
dx = Math.max(-MAX_SPEED, Math.min(MAX_SPEED, dx));
}
function limitSpeedY() {
dy = Math.max(-MAX_SPEED, Math.min(MAX_SPEED, dy));
}
function inRangeX(actor, range) {
return(Math.abs(_x - actor._x) <= range);
}
function inRangeY(actor, range) {
return(Math.abs(_y - actor._y) <= range);
}
function collideActor(actor) {
if (alive && (actor.alive)) {
if (collidable && (actor.collidable)) {
if ((solid != undefined) && (actor.solid != undefined)) {
return(solid.hitTest(actor.solid));
}
}
}
return(false);
}
function collideActors(list) {
if (alive && (collidable)) {
if (solid != undefined) {
var _local2;
var _local3 = 0;
while (_local3 < list.length) {
_local2 = list[_local3];
if (_local2.alive && (_local2.collidable)) {
if (_local2.solid != undefined) {
if (solid.hitTest(_local2.solid)) {
return(_local2);
}
}
}
_local3++;
}
}
}
}
function uncollideActor(actor, immobile) {
var _local4 = actor._x - _x;
if (immobile) {
var _local3 = Math.round((actor.width + width) - Math.abs(_local4));
if (_local4 > 0) {
actor.adjustX(_local3);
} else {
actor.adjustX(-_local3);
}
} else {
var _local3 = Math.round(((actor.width + width) - Math.abs(_local4)) * 0.5);
if (_local3 > 0) {
if (_local4 > 0) {
adjustX(-_local3);
actor.adjustX(_local3);
} else {
adjustX(_local3);
actor.adjustX(-_local3);
}
}
}
}
function adjustX(dist) {
if (_global.game.world.checkCollision(_x + dist, (_y + height) + 1)) {
_x = _x + dist;
if (dist > 0) {
collideRight();
} else if (dist < 0) {
collideLeft();
}
}
}
function checkGround() {
return(_global.game.world.checkCollision(_x, (_y + height) + 1));
}
function checkEdge() {
return(!_global.game.world.checkCollision(_x + (width * dir), (_y + height) + 1));
}
function checkWall() {
return(_global.game.world.checkCollision(_x + ((width + 1) * dir), _y));
}
function collideGround() {
return(_global.game.world.collideDown(this, 0, height));
}
function collideCeiling() {
return(_global.game.world.collideUp(this, 0, -height));
}
function collideRight() {
return(_global.game.world.collideRight(this, width, 0));
}
function collideLeft() {
return(_global.game.world.collideLeft(this, -width, 0));
}
function inActiveRegion() {
return(_global.game.activeRect.contains(_x, _y));
}
function accelerateX(xx) {
dx = dx + xx;
}
function accelerateY(yy) {
dy = dy + yy;
}
function decelerateX(xx) {
if (dx > 0) {
dx = Math.max(0, dx - xx);
} else {
dx = Math.min(0, dx + xx);
}
}
function decelerateY(yy) {
if (dy > 0) {
dy = Math.max(0, dy - yy);
} else {
dy = Math.min(0, dy + yy);
}
}
function takeDamage(source, amount) {
}
static var DIR_RIGHT = 1;
static var DIR_LEFT = -1;
static var MAX_SPEED = 50;
var width = 0;
var height = 0;
var exists = true;
var alive = true;
var active = true;
var collidable = true;
var health = 100;
var dx = 0;
var dy = 0;
}
Symbol 1461 MovieClip [__Packages.Character] Frame 0
class Character extends Actor
{
var _x, height, _y, collideRight, collideLeft, checkGround, collideGround, dy, collideCeiling, width;
function Character (height, width) {
super(height, width);
}
function destroy() {
super.destroy();
}
function update() {
}
function safeMoveX(dist) {
if (_global.game.world.checkCollision(_x + dist, (_y + height) + 1)) {
_x = Math.round(_x + dist);
if (dist > 0) {
collideRight();
} else if (dist < 0) {
collideLeft();
}
}
}
function unSafeMoveX(dist) {
_x = Math.round(_x + dist);
if (dist > 0) {
collideRight();
} else if (dist < 0) {
collideLeft();
}
}
function safeMoveY(dist) {
if (dist == 0) {
if (!checkGround()) {
if (!airborne) {
startFall();
}
}
} else {
_y = Math.round(_y + dist);
if (dist > 0) {
if (collideGround()) {
dy = 0;
if (airborne) {
stopFall();
}
}
} else if (dist < 0) {
if (collideCeiling()) {
dy = 0;
}
}
}
}
function bounceMoveY(dist) {
if (dist == 0) {
if (!checkGround()) {
if (!airborne) {
startFall();
}
}
} else {
_y = Math.round(_y + dist);
if (dist > 0) {
if (collideGround()) {
if (airborne && (dy < 5)) {
stopFall();
} else {
dy = dy * -0.7;
}
}
} else if (dist < 0) {
if (collideCeiling()) {
dy = dy * -0.7;
}
}
}
}
function uncollideCharacter(char, immobile) {
var _local4 = char._x - _x;
if (immobile) {
var _local3 = Math.round((char.width + width) - Math.abs(_local4));
if (_local4 > 0) {
char.safeMoveX(_local3);
} else {
char.safeMoveX(-_local3);
}
} else {
var _local3 = Math.round(((char.width + width) - Math.abs(_local4)) * 0.5);
if (_local3 > 0) {
if (_local4 > 0) {
safeMoveX(-_local3);
char.safeMoveX(_local3);
} else {
safeMoveX(_local3);
char.safeMoveX(-_local3);
}
}
}
}
function startFall() {
}
function stopFall() {
}
static var FRICTION = 3;
var airborne = true;
var busy = false;
var attacking = false;
var invulnerable = false;
}
Symbol 1462 MovieClip [__Packages.NPC] Frame 0
class NPC extends Character
{
var ai, active, inActiveRegion, alive, busy, dx, checkEdge, reverseDir, checkWall;
function NPC (h, w) {
super(h, w);
}
function destroy() {
super.destroy();
delete ai;
}
function update() {
super.update();
}
function updateActiveStatus() {
if (active && (!inActiveRegion())) {
active = false;
} else if ((!active) && (inActiveRegion())) {
active = true;
ai.reset();
ai.assess();
}
}
function startActive() {
ai.reset();
ai.assess();
}
function avoidCollisions() {
if (alive && (!busy)) {
if (dx != 0) {
if (checkEdge()) {
reverseDir();
} else if (checkWall()) {
reverseDir();
}
}
}
}
}
Symbol 1463 MovieClip [__Packages.Enemy] Frame 0
class Enemy extends NPC
{
var _alpha, collideActor, invulnerable, __set__dir, faceActor, health;
function Enemy (h, w) {
super(h, w);
_global.game.addEnemy(this);
}
function destroy() {
_alpha = 0;
super.destroy();
_global.game.removeEnemy(this);
}
function update() {
super.update();
}
function checkPlayerCollision() {
if (collideActor(_global.game.world.player)) {
handlePlayerCollision();
}
}
function checkPlayerAttack() {
if (!invulnerable) {
if (_global.game.world.player.attackCheck(this)) {
handlePlayerAttack();
}
}
}
function handlePlayerCollision() {
}
function handlePlayerAttack() {
}
function takeDamage(source, amount) {
if (source instanceof Projectile) {
if (source.dx > 0) {
__set__dir(-1);
} else if (source.dx < 0) {
__set__dir(1);
}
} else {
faceActor(source);
}
health = health - amount;
handleDamage();
}
function handleDamage() {
}
var thisisliving = true;
}
Symbol 1464 MovieClip [__Packages.Projectile] Frame 0
class Projectile extends Actor
{
var onEnterFrame, exists, active, inActiveRegion, _x, _y;
function Projectile (h, w) {
super(h, w);
_global.game.addProjectile(this);
onEnterFrame = update;
}
function destroy() {
super.destroy();
onEnterFrame = null;
_global.game.removeProjectile(this);
}
function update() {
if (!exists) {
return(undefined);
}
if (active && (!inActiveRegion())) {
active = false;
} else if ((!active) && (inActiveRegion())) {
active = true;
}
_x = _x + dx;
_y = _y + dy;
}
static function nextID() {
return(++projectileCount);
}
static var projectileCount = 0;
var armed = true;
var dx = 0;
var dy = 0;
}
Symbol 1465 MovieClip [__Packages.OliverTwisted] Frame 0
class OliverTwisted extends Enemy
{
var setAction, ai, onEnterFrame, exists, updateActiveStatus, active, busy, action, dx, __get__dir, decelerateX, airborne, accelerateY, limitSpeedX, limitSpeedY, safeMoveX, safeMoveY, dy, avoidCollisions, alive, attacking, animation, checkPlayerAttack, checkPlayerCollision, uncollideCharacter, faceActor, gotoAndStop, destroy, health;
function OliverTwisted () {
super(60, 24);
setAction(ACTION_STAND);
ai = new OliverTwistedAI(this);
onEnterFrame = update;
}
function update() {
if (!exists) {
return(undefined);
}
super.update();
updateActiveStatus();
if (active || (busy)) {
ai.update();
if (action == ACTION_RUN) {
dx = RUN_SPEED * __get__dir();
} else {
decelerateX(Character.FRICTION);
}
if (airborne) {
accelerateY(World.GRAVITY);
}
limitSpeedX();
limitSpeedY();
safeMoveX(dx);
safeMoveY(dy);
avoidCollisions();
if (alive) {
if (attacking) {
if (animation.attack != undefined) {
if (_global.game.world.player.isAttackable() && (animation.attack.hitTest(_global.game.world.player.solid))) {
_global.game.world.player.takeDamage(this, 10);
_global.game.sound.start("sfx_hit_2");
} else {
_global.game.sound.start("sfx_swoosh_2");
}
}
}
checkPlayerAttack();
checkPlayerCollision();
}
}
}
function startFall() {
setAction(ACTION_FALL);
ai.react();
}
function stopFall() {
setAction(ACTION_STAND);
ai.react();
}
function handlePlayerCollision() {
uncollideCharacter(_global.game.world.player, true);
faceActor(_global.game.world.player);
ai.react();
}
function handlePlayerAttack() {
ai.react();
}
function initAction() {
switch (action) {
case ACTION_STAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_RUN :
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("run");
break;
case ACTION_FALL :
airborne = true;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_ATTACK :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = true;
gotoAndStop("attack");
break;
case ACTION_HIT :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("hit");
break;
case ACTION_DIE :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
alive = false;
gotoAndStop("die");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_ATTACK :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_HIT :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_DIE :
destroy();
break;
}
}
function handleDamage() {
if (health > 0) {
setAction(ACTION_HIT);
} else {
setAction(ACTION_DIE);
}
}
static var ACTION_STAND = 1;
static var ACTION_RUN = 2;
static var ACTION_FALL = 3;
static var ACTION_ATTACK = 4;
static var ACTION_HIT = 5;
static var ACTION_DIE = 6;
static var ACTION_STRINGS = new Array("ACTION_NONE", "ACTION_STAND", "ACTION_RUN", "ACTION_FALL", "ACTION_ATTACK", "ACTION_HIT", "ACTION_DIE");
static var RUN_SPEED = 16;
}
Symbol 1466 MovieClip [__Packages.AI] Frame 0
class AI
{
var puppet;
function AI (char) {
puppet = char;
}
function update() {
aiDelay--;
if (aiDelay <= 0) {
if (!puppet.busy) {
assess();
}
}
}
function reset() {
aiState = 0;
aiDelay = 0;
aware = false;
}
function assess() {
resetDelay();
}
function setState(newState) {
aiState = newState;
}
function react() {
if (aiDelay > REACT_DELAY) {
aiDelay = REACT_DELAY;
}
}
function resetDelay() {
aiDelay = (DELAY_MIN + random((DELAY_MAX - DELAY_MIN) + 1)) - 1;
}
function lookOutForPlayer() {
if (isPlayerAlive()) {
if (canSeePlayer()) {
react();
}
}
}
function isPlayerAlive() {
return(_global.game.world.player.alive);
}
function canSeePlayer() {
if ((_global.game.world.player.action != 20) && (_global.game.world.player.action != 21)) {
return(inAwarenessRange());
}
return(false);
}
function inAwarenessRange() {
return(puppet.inRangeX(_global.game.world.player, AWARENESS_RANGE_X) && (puppet.inRangeY(_global.game.world.player, AWARENESS_RANGE_Y)));
}
function isFacingPlayer() {
return(puppet.isFacing(_global.game.world.player));
}
function canAttackPlayer() {
return((puppet.isFacing(_global.game.world.player) && (puppet.inRangeX(_global.game.world.player, (puppet.width + _global.game.world.player.width) + ATTACK_RANGE_X))) && (puppet.inRangeY(_global.game.world.player, ATTACK_RANGE_Y)));
}
var aiState = 0;
var aiDelay = 0;
var aware = false;
var DELAY_MIN = 30;
var DELAY_MAX = 120;
var REACT_DELAY = 10;
var ATTACK_RANGE_X = 30;
var ATTACK_RANGE_Y = 60;
var AWARENESS_RANGE_X = 400;
var AWARENESS_RANGE_Y = 250;
}
Symbol 1467 MovieClip [__Packages.OliverTwistedAI] Frame 0
class OliverTwistedAI extends AI
{
var aiState, puppet, lookOutForPlayer, isPlayerAlive, canAttackPlayer, isFacingPlayer, aware, canSeePlayer;
function OliverTwistedAI (char) {
super(char);
aiState = AISTATE_IDLE;
}
function update() {
super.update();
if (!puppet.busy) {
switch (aiState) {
case AISTATE_IDLE :
case AISTATE_WANDER :
lookOutForPlayer();
break;
case AISTATE_FLEE :
if (isPlayerAlive()) {
if (canAttackPlayer() && (random(6) == 0)) {
setState(AISTATE_ATTACK);
} else if (isFacingPlayer() && (puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_APPROACH :
if (isPlayerAlive()) {
if (canAttackPlayer() && (random(6) == 0)) {
setState(AISTATE_ATTACK);
} else if ((!isFacingPlayer()) && (!puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_ATTACK :
break;
}
}
}
function assess() {
super.assess();
if (puppet.airborne || (puppet.busy)) {
setState(AISTATE_IDLE);
} else if (aware || (canSeePlayer() && (isPlayerAlive()))) {
if ((random(5) > 2) || ((puppet.health <= 20) && (random(2) == 0))) {
setState(AISTATE_FLEE);
} else {
setState(AISTATE_APPROACH);
}
aware = true;
} else {
if (puppet.action == OliverTwisted.ACTION_STAND) {
if (random(2) == 0) {
puppet.faceLeft();
} else {
puppet.faceRight();
}
}
setState(AISTATE_IDLE);
aware = false;
}
}
function setState(newState) {
super.setState(newState);
switch (aiState) {
case AISTATE_IDLE :
puppet.setAction(OliverTwisted.ACTION_STAND);
break;
case AISTATE_WANDER :
if (random(2) == 0) {
if (puppet.checkEdge(10)) {
puppet.__set__dir(1);
} else {
puppet.__set__dir(-1);
}
} else if (puppet.checkEdge(-10)) {
puppet.__set__dir(-1);
} else {
puppet.__set__dir(1);
}
puppet.setAction(OliverTwisted.ACTION_RUN);
break;
case AISTATE_FLEE :
puppet.faceActor(_global.game.world.player);
puppet.reverseDir();
puppet.setAction(OliverTwisted.ACTION_RUN);
break;
case AISTATE_APPROACH :
puppet.faceActor(_global.game.world.player);
puppet.setAction(OliverTwisted.ACTION_RUN);
break;
case AISTATE_ATTACK :
puppet.setAction(OliverTwisted.ACTION_ATTACK);
break;
}
}
static var AISTATE_IDLE = 1;
static var AISTATE_WANDER = 2;
static var AISTATE_FLEE = 3;
static var AISTATE_APPROACH = 4;
static var AISTATE_ATTACK = 5;
static var AISTATE_STRINGS = Array("[NO STATE]", "AISTATE_IDLE", "AISTATE_WANDER", "AISTATE_FLEE", "AISTATE_APPROACH", "AISTATE_ATTACK");
}
Symbol 1468 MovieClip [__Packages.World] Frame 0
class World extends MovieClip
{
var onEnterFrame, extents, solid, origX, _x, origY, _y, bgOrigX, background, bgOrigY;
function World () {
super();
onEnterFrame = init;
}
function init() {
extents._visible = false;
solid._visible = false;
origX = _x;
origY = _y;
bgOrigX = background._x;
bgOrigY = background._y;
onEnterFrame = update;
}
function onLoad() {
}
function update() {
}
function setScroll(x, y) {
_x = x;
_y = y;
var _local2 = _x - origX;
var _local3 = _y - origY;
background._x = bgOrigX - (_local2 * 0.85);
background._y = bgOrigY - (_local3 * 0.95);
}
function checkCollision(x, y) {
return(solid.hitTest((x + _global.game._x) + _global.game.world._x, (y + _global.game._y) + _global.game.world._y, true));
}
function resolveCollision(actor, offsetX, offsetY, deltaX, deltaY) {
var _local8 = actor._x;
var _local9 = actor._y;
var _local3 = 0;
while (_local3 < 100) {
actor._x = actor._x + deltaX;
actor._y = actor._y + deltaY;
if (!checkCollision(actor._x + offsetX, actor._y + offsetY)) {
return(true);
}
_local3++;
}
actor._x = _local8;
actor._y = _local9;
return(false);
}
function collideDown(actor, offsetX, offsetY) {
if (checkCollision(actor._x + offsetX, actor._y + offsetY)) {
return(resolveCollision(actor, offsetX, offsetY, 0, -1));
}
return(false);
}
function collideUp(actor, offsetX, offsetY) {
if (checkCollision(actor._x + offsetX, actor._y + offsetY)) {
return(resolveCollision(actor, offsetX, offsetY, 0, 1));
}
return(false);
}
function collideRight(actor, offsetX, offsetY) {
if (checkCollision(actor._x + offsetX, actor._y + offsetY)) {
return(resolveCollision(actor, offsetX, offsetY, -1, 0));
}
return(false);
}
function collideLeft(actor, offsetX, offsetY) {
if (checkCollision(actor._x + offsetX, actor._y + offsetY)) {
return(resolveCollision(actor, offsetX, offsetY, 1, 0));
}
return(false);
}
static var GRAVITY = 4;
var orphansRequried = 0;
}
Symbol 1469 MovieClip [__Packages.Item] Frame 0
class Item extends Actor
{
var collideActor;
function Item (h, w) {
super(h, w);
_global.game.addItem(this);
}
function destroy() {
super.destroy();
_global.game.removeItem(this);
}
function update() {
}
function checkPlayerCollision() {
if (_global.game.world.player.alive) {
if (collideActor(_global.game.world.player)) {
handlePlayerCollision();
}
}
}
function checkPlayerAttack() {
if (_global.game.world.player.alive) {
if (_global.game.world.player.checkAttack(this)) {
handlePlayerAttack();
}
}
}
function handlePlayerCollision() {
}
function handlePlayerAttack() {
}
}
Symbol 1470 MovieClip [__Packages.HidingSpot] Frame 0
class HidingSpot extends Item
{
var setAction, onEnterFrame, checkPlayerAttack, action, gotoAndStop, gotoAndPlay, _x, _y;
function HidingSpot () {
super(20, 20);
setAction(ACTION_READY);
onEnterFrame = update;
}
function update() {
super.update();
checkPlayerAttack();
}
function handlePlayerCollision() {
}
function handlePlayerAttack() {
setAction(ACTION_BRAKE);
}
function initAction() {
switch (action) {
case ACTION_READY :
gotoAndStop("ready");
break;
case ACTION_BRAKE :
gotoAndPlay("brake");
spawnOrphan(random(1) + 1);
_global.game.sound.start("sfx_wood_1");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_BRAKE :
delete onEnterFrame;
break;
default :
}
}
function spawnOrphan(num) {
var _local5 = 0;
while (_local5 < num) {
var _local4 = Math.ceil(Math.random() * 4);
_root.game.worlds.world.attachMovie("orphan" + _local4, "orphan_" + _global.game.orphansSpawned, _root.game.worlds.world.getNextHighestDepth());
_root.game.worlds.world["orphan_" + _global.game.orphansSpawned]._x = _x;
_root.game.worlds.world["orphan_" + _global.game.orphansSpawned]._y = _y;
_global.game.orphansSpawned++;
_local5++;
}
}
static var ACTION_READY = 1;
static var ACTION_BRAKE = 2;
}
Symbol 1471 MovieClip [__Packages.TomProjectile] Frame 0
class TomProjectile extends Projectile
{
var type, setAction, _y, _x, active, armed, action, dx, _rotation, collideActors, destroy, gotoAndStop, dy, gotoAndPlay, object;
function TomProjectile () {
super(2, 2);
type = int(Math.floor(Math.random() * 6)) + 1;
trace("TomProjectile \u6784\u9020\u51FD\u6570");
setAction(ACTION_FLY);
}
function update() {
super.update();
trace(((" update throw _x=" + _x) + " _y=") + _y);
if (active) {
trace(((" throw _x=" + _x) + " _y=") + _y);
if (armed) {
if (action == ACTION_FLY) {
if (dx > 0) {
rotation = rotation + 20;
} else if (dx < 0) {
rotation = rotation - 20;
}
_rotation = rotation;
if (dx > 0) {
if ((_x - _global.game.world.player._x) > xOffset) {
onScreen = false;
}
} else if ((_global.game.world.player._x - _x) > xOffset) {
onScreen = false;
}
if (onScreen) {
var _local4 = collideActors(_global.game.enemies);
if (_local4 != null) {
_local4.takeDamage(this, 18);
armed = false;
if (type != 7) {
switch (random(4)) {
case 0 :
_global.game.sound.start("sfx_hit_1");
case 1 :
_global.game.sound.start("sfx_hit_2");
case 2 :
_global.game.sound.start("sfx_hit_3");
case 3 :
_global.game.sound.start("sfx_hit_4");
}
} else {
_global.game.sound.start("sfx_pie_splat_1");
}
setAction(ACTION_HIT);
}
}
}
}
} else {
destroy();
}
}
function initAction() {
switch (action) {
case ACTION_FLY :
gotoAndStop("fly");
break;
case ACTION_HIT :
dx = 0;
dy = 0;
gotoAndPlay("hit");
break;
}
object.gotoAndStop(type);
}
function actionDone() {
switch (action) {
case ACTION_HIT :
destroy();
break;
default :
}
}
static var ACTION_FLY = 1;
static var ACTION_HIT = 2;
var rotation = 0;
var xOffset = 460;
var onScreen = true;
}
Symbol 1472 MovieClip [__Packages.Grabbable] Frame 0
interface Grabbable
{
}
Symbol 1473 MovieClip [__Packages.EvilMinon] Frame 0
class EvilMinon extends Character implements Grabbable
{
var setAction, flasher, onEnterFrame, dx, dy, _x, _y, animation, breakFree, action, projectile, airborne, checkGround, busy, __get__dir, faceRight, faceLeft, height, collideGround, alive, collideCeiling, collideRight, collideLeft, _visible, invulnerable, grabbedDuration, grabbedBy, attacking, gotoAndStop, grabbedOrphan, health, __set__dir, faceActor;
function EvilMinon () {
super(60, 40);
setAction(ACTION_STAND);
flasher = new DamageFlasher(this);
onEnterFrame = update;
}
function debug() {
updateInput();
dx = 0;
dy = 0;
if (input_left) {
dx = dx - RUN_SPEED;
}
if (input_right) {
dx = dx + RUN_SPEED;
}
if (input_up) {
dy = dy - RUN_SPEED;
}
if (input_down) {
dy = dy + RUN_SPEED;
}
_x = Math.round(_x + dx);
_y = Math.round(_y + dy);
}
function update() {
if (_global.game.action != 7) {
if (_global.game.justUnpaused) {
animation.play();
_global.game.justUnpaused = false;
}
updateInput();
if (triggerAttack) {
if (grabbed) {
breakFree++;
} else if (grabbedOrphanCount >= 5) {
if ((action == ACTION_STAND) || ((action == ACTION_RUN) && (Math.abs(dx) < MOTION_THRESHOLD))) {
setAction(ACTION_SACK_ATTACK);
} else if (action == ACTION_RUN) {
setAction(ACTION_SACK_ATTACK);
} else if (action == ACTION_JUMP) {
setAction(ACTION_SACK_ATTACK);
} else if (action == ACTION_DUCK) {
setAction(ACTION_SACK_ATTACK);
}
} else if ((action == ACTION_STAND) || ((action == ACTION_RUN) && (Math.abs(dx) < MOTION_THRESHOLD))) {
setAction(ACTION_ATTACK);
} else if (action == ACTION_RUN) {
setAction(ACTION_RUN_ATTACK);
} else if (action == ACTION_JUMP) {
setAction(ACTION_JUMP_ATTACK);
} else if (action == ACTION_DUCK) {
setAction(ACTION_DUCK_ATTACK);
}
}
if (triggerThrow) {
if (grabbed) {
breakFree++;
} else if ((_global.worldID == 4) && (_global.partID == 3)) {
if ((projectile == null) && (pieCount > 0)) {
if ((action == ACTION_STAND) || ((action == ACTION_RUN) && (Math.abs(dx) < MOTION_THRESHOLD))) {
setAction(ACTION_THROW);
} else if (action == ACTION_RUN) {
setAction(ACTION_RUN_THROW);
} else if ((action == ACTION_JUMP) || (action == ACTION_FALL)) {
setAction(ACTION_JUMP_THROW);
} else if (action == ACTION_DUCK) {
setAction(ACTION_DUCK_THROW);
}
}
} else if (projectile == null) {
if ((action == ACTION_STAND) || ((action == ACTION_RUN) && (Math.abs(dx) < MOTION_THRESHOLD))) {
setAction(ACTION_THROW);
} else if (action == ACTION_RUN) {
setAction(ACTION_RUN_THROW);
} else if ((action == ACTION_JUMP) || (action == ACTION_FALL)) {
setAction(ACTION_JUMP_THROW);
} else if (action == ACTION_DUCK) {
setAction(ACTION_DUCK_THROW);
}
}
}
if (triggerGrab) {
if (grabbed) {
breakFree++;
} else if (!disableSack) {
}
}
disableSack = false;
if ((triggerJump && (!airborne)) && (!jumping)) {
if ((action == ACTION_STAND) || (action == ACTION_RUN)) {
if (Math.abs(dx) > MOTION_THRESHOLD) {
setAction(ACTION_RUN_JUMP);
} else if ((checkGround() || (onPlatform)) || (onRotatingPlatform)) {
setAction(ACTION_JUMP);
}
}
}
if (input_down) {
if (!grabbed) {
if ((!busy) && ((action == ACTION_STAND) || (action == ACTION_RUN))) {
setAction(ACTION_DUCK);
}
}
} else if (action == ACTION_DUCK) {
setAction(ACTION_RISE);
}
if (input_up) {
if (((!busy) && ((action == ACTION_STAND) || (action == ACTION_RUN))) && (Math.abs(dx) < MOTION_THRESHOLD)) {
}
}
if (!(input_right && (input_left))) {
if (grabbed) {
if ((input_right && (__get__dir() == Actor.DIR_LEFT)) || (input_left && (__get__dir() == Actor.DIR_RIGHT))) {
breakFree++;
}
}
if (input_right && (!busy)) {
dx = Math.min(RUN_SPEED * speedMult, dx + (ACCELERATION * speedMult));
if ((!airborne) || (dx > 0)) {
faceRight();
}
if (!airborne) {
setAction(ACTION_RUN);
}
}
if (input_left && (!busy)) {
dx = Math.max((-RUN_SPEED) * speedMult, dx - (ACCELERATION * speedMult));
if ((!airborne) || (dx < 0)) {
faceLeft();
}
if (!airborne) {
setAction(ACTION_RUN);
}
}
}
if (busy) {
if ((action != ACTION_RUN_ATTACK) && (action != ACTION_RUN_THROW)) {
if (dx > 0) {
dx = Math.max(0, dx - Character.FRICTION);
} else if (dx < 0) {
dx = Math.min(0, dx + Character.FRICTION);
}
}
} else if (!(input_left || (input_right))) {
if (dx > 0) {
dx = Math.max(0, dx - ACCELERATION);
} else if (dx < 0) {
dx = Math.min(0, dx + ACCELERATION);
}
}
if (airborne) {
dy = dy + World.GRAVITY;
}
dx = Math.max(-Actor.MAX_SPEED, Math.min(Actor.MAX_SPEED, dx));
dy = Math.max(-Actor.MAX_SPEED, Math.min(Actor.MAX_SPEED, dy));
_x = Math.round(_x + dx);
_y = Math.round(_y + dy);
if (dy == 0) {
if (!(_global.game.world.checkCollision(_x + 20, (_y + height) + 1) || (_global.game.world.checkCollision(_x - 20, (_y + height) + 1)))) {
if ((((!airborne) && (!onPlatform)) && (!onRotatingPlatform)) && (!jumping)) {
setAction(ACTION_FALL);
}
}
} else if (dy > 0) {
if ((collideGround() || (onPlatform)) || (onRotatingPlatform)) {
if (airborne) {
if (!alive) {
setAction(ACTION_DIE);
} else if ((Math.abs(dx) > MOTION_THRESHOLD) || (Math.abs(dy) < MOTION_THRESHOLD)) {
setAction(ACTION_RUN);
} else {
setAction(ACTION_LAND);
}
if (dy > 10) {
_global.game.sound.start("sfx_tom_land");
}
dy = 0;
}
}
} else if (dy < 0) {
if (collideCeiling()) {
dy = 0;
}
}
if (collideRight()) {
dx = 0;
} else if (collideLeft()) {
dx = 0;
}
if (((action == ACTION_JUMP) || (action == ACTION_RUN_JUMP)) && (dy > 0)) {
setAction(ACTION_FALL);
}
if (((((((!airborne) && (!busy)) && (action != ACTION_DUCK)) && (dx == 0)) && (dy == 0)) && (!input_right)) && (!input_left)) {
setAction(ACTION_STAND);
}
if (invulnerableDuration > 0) {
invulnerableDuration--;
if (invulnerableDuration == 0) {
_visible = true;
invulnerable = false;
} else {
_visible = (invulnerableDuration % 4) < 2;
}
}
if (grabbed) {
if (breakFree >= 10) {
stopGrabbed();
} else {
grabbedDuration++;
grabbedBy.updateGrab();
if ((grabbedDuration % 20) == 0) {
takeDamage(null, 5);
}
if ((grabbedDuration % 7) == 0) {
breakFree = Math.max(0, breakFree - 1);
}
}
}
flasher.update();
if (projectile != null) {
if (!projectile.exists) {
projectile = null;
}
}
} else {
animation.stop();
}
}
function updateWarp() {
}
function updateDie() {
}
function updateInput() {
input_right = Key.isDown(KEY_PLAYER_RIGHT);
input_left = Key.isDown(KEY_PLAYER_LEFT);
input_down = Key.isDown(KEY_PLAYER_DOWN);
triggerAttack = false;
triggerThrow = false;
triggerJump = false;
triggerGrab = false;
if ((!airborne) && (!jumping)) {
if (input_up) {
input_up = Key.isDown(KEY_PLAYER_UP);
} else if (!input_jump) {
input_up = (triggerJump = Key.isDown(KEY_PLAYER_UP));
}
if (input_jump) {
input_jump = Key.isDown(KEY_PLAYER_JUMP);
} else if (!input_up) {
input_jump = (triggerJump = Key.isDown(KEY_PLAYER_JUMP));
}
}
if (input_attack) {
input_attack = Key.isDown(KEY_PLAYER_ATTACK);
} else {
input_attack = (triggerAttack = Key.isDown(KEY_PLAYER_ATTACK));
}
if (input_throw) {
input_throw = Key.isDown(KEY_PLAYER_THROW);
} else {
input_throw = (triggerThrow = Key.isDown(KEY_PLAYER_THROW));
}
if (input_grab) {
input_grab = Key.isDown(KEY_PLAYER_GRAB);
} else {
input_grab = (triggerGrab = Key.isDown(KEY_PLAYER_GRAB));
triggerSack = false;
}
}
function updateSack() {
if (grabbedOrphanCount >= 8) {
sackSize = 4;
} else if (grabbedOrphanCount >= 5) {
sackSize = 3;
} else if (grabbedOrphanCount >= 3) {
sackSize = 2;
} else {
sackSize = 1;
}
}
function initAction() {
switch (action) {
case ACTION_STAND :
airborne = false;
jumping = false;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_ATTACK :
airborne = false;
busy = true;
attacking = true;
gotoAndStop("attack");
break;
case ACTION_THROW :
airborne = false;
busy = true;
attacking = false;
gotoAndStop("throw");
if ((_global.worldID == 4) && (_global.partID == 3)) {
pieCount--;
_global.game.hud.changeOrphansCarried(pieCount, pieMax);
}
break;
case ACTION_FALL :
airborne = true;
busy = false;
attacking = false;
gotoAndStop("fall");
break;
case ACTION_LAND :
airborne = false;
jumping = false;
busy = true;
attacking = false;
gotoAndStop("land");
break;
case ACTION_RUN :
airborne = false;
jumping = false;
busy = false;
attacking = false;
gotoAndStop("run");
break;
case ACTION_RUN_ATTACK :
airborne = false;
busy = true;
attacking = true;
gotoAndStop("run_attack");
break;
case ACTION_RUN_THROW :
airborne = false;
busy = true;
attacking = false;
gotoAndStop("run_throw");
if ((_global.worldID == 4) && (_global.partID == 3)) {
pieCount--;
_global.game.hud.changeOrphansCarried(pieCount, pieMax);
}
break;
case ACTION_RUN_JUMP :
if (random(2) == 0) {
_global.game.sound.start("sfx_tom_jump_1");
} else {
_global.game.sound.start("sfx_tom_jump_2");
}
airborne = false;
jumping = true;
busy = true;
attacking = false;
gotoAndStop("run_jump");
break;
case ACTION_RUN_LAND :
airborne = false;
jumping = false;
busy = true;
attacking = false;
gotoAndStop("run_land");
break;
case ACTION_JUMP :
if (random(2) == 0) {
_global.game.sound.start("sfx_tom_jump_1");
} else {
_global.game.sound.start("sfx_tom_jump_2");
}
airborne = false;
jumping = true;
busy = true;
attacking = false;
gotoAndStop("jump");
break;
case ACTION_JUMP_ATTACK :
airborne = true;
busy = true;
attacking = true;
jumping = true;
gotoAndStop("jump_attack");
break;
case ACTION_JUMP_THROW :
airborne = true;
busy = true;
attacking = false;
jumping = true;
gotoAndStop("jump_throw");
if ((_global.worldID == 4) && (_global.partID == 3)) {
pieCount--;
_global.game.hud.changeOrphansCarried(pieCount, pieMax);
}
break;
case ACTION_DUCK :
airborne = false;
busy = true;
attacking = false;
gotoAndStop("duck");
break;
case ACTION_DUCK_ATTACK :
airborne = false;
busy = true;
attacking = true;
gotoAndStop("duck_attack");
break;
case ACTION_DUCK_THROW :
airborne = false;
busy = true;
attacking = false;
gotoAndStop("duck_throw");
break;
case ACTION_RISE :
airborne = false;
busy = true;
attacking = false;
gotoAndStop("rise");
break;
case ACTION_HIT :
dx = -10 * __get__dir();
airborne = false;
busy = true;
attacking = false;
gotoAndStop("hit");
spawnOrphan(random(3) + 1);
break;
case ACTION_DIE :
if (grabbed) {
stopGrabbed();
}
_global.game.gameEvent_playerDeath();
_root.game.hud_timer._alpha = 0;
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = false;
alive = false;
gotoAndStop("die");
break;
case ACTION_WARP :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = false;
invulnerable = true;
invulnerableDuration = -1;
gotoAndStop("warp");
onEnterFrame = updateWarp;
break;
case ACTION_UNWARP :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("unwarp");
break;
case ACTION_GRAB :
airborne = false;
busy = true;
attacking = false;
gotoAndStop("grab");
break;
case ACTION_GRABPIE :
airborne = false;
busy = true;
attacking = false;
gotoAndStop("grabpie");
break;
case ACTION_HIDE :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("hide");
break;
case ACTION_SACK_ATTACK :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = true;
gotoAndStop("sack_attack");
break;
case Sprite.ACTION_NONE :
break;
}
updateSack();
}
function actionDone() {
switch (action) {
case ACTION_ATTACK :
setAction(ACTION_STAND);
break;
case ACTION_THROW :
setAction(ACTION_STAND);
break;
case ACTION_LAND :
setAction(ACTION_STAND);
break;
case ACTION_RUN_ATTACK :
setAction(ACTION_RUN);
break;
case ACTION_RUN_THROW :
setAction(ACTION_RUN);
break;
case ACTION_RUN_LAND :
setAction(ACTION_RUN);
break;
case ACTION_JUMP_ATTACK :
setAction(ACTION_FALL);
break;
case ACTION_JUMP_THROW :
setAction(ACTION_FALL);
break;
case ACTION_DUCK_ATTACK :
setAction(ACTION_DUCK);
animation.gotoAndStop(animation._totalframes);
updateSack();
break;
case ACTION_DUCK_THROW :
setAction(ACTION_DUCK);
animation.gotoAndStop(animation._totalframes);
updateSack();
break;
case ACTION_RISE :
setAction(ACTION_STAND);
break;
case ACTION_HIT :
setAction(ACTION_STAND);
break;
case ACTION_DIE :
break;
case ACTION_WARP :
break;
case ACTION_UNWARP :
invulnerable = false;
setAction(ACTION_FALL);
onEnterFrame = update;
break;
case ACTION_GRAB :
grabbedOrphan.destroy();
grabbedOrphan = null;
grabbedOrphanCount++;
if (grabbedOrphanCount == 5) {
triggerPowerup = true;
_global.game.sound.start("sfx_tom_laugh");
setAction(ACTION_SACK_ATTACK);
} else {
setAction(ACTION_STAND);
}
updateMultipliers();
_global.game.hud.changeOrphansCarried(grabbedOrphanCount, ORPHAN_COUNT_MAX);
break;
case ACTION_GRABPIE :
setAction(ACTION_STAND);
break;
case ACTION_HIDE :
setAction(ACTION_STAND);
break;
case ACTION_SACK_ATTACK :
setAction(ACTION_STAND);
break;
}
}
function updateMultipliers() {
speedMult = 1;
jumpMult = 1;
var _local2 = grabbedOrphanCount / ORPHAN_COUNT_MAX;
if (grabbed) {
speedMult = speedMult * 0.5;
jumpMult = jumpMult * 0.5;
}
}
function launchProjectile() {
var _local3 = 0;
var _local4 = 0;
switch (action) {
case ACTION_THROW :
_local3 = _x + (120 * __get__dir());
_local4 = _y - 40;
break;
case ACTION_RUN_THROW :
_local3 = _x + (90 * __get__dir());
_local4 = _y - 35;
break;
case ACTION_JUMP_THROW :
_local3 = _x + (90 * __get__dir());
_local4 = _y - 60;
break;
case ACTION_DUCK_THROW :
_local3 = _x + (90 * __get__dir());
_local4 = _y - 8;
}
trace((("throw something......_x=" + _x) + " _y=") + _y);
trace((("throw something......x=" + _local3) + " y=") + _local4);
projectile = TomProjectile(_global.game.newProjectile(this, "tom_projectile", _local3, _local4, __get__dir() * THROW_SPEED, 0));
}
function launchJump() {
if (!airborne) {
airborne = true;
busy = false;
dy = dy + (JUMP_SPEED * jumpMult);
}
}
function adustHealth(h) {
health = health + h;
if (health < 0) {
health = 0;
} else if (health > 100) {
health = 100;
}
flasher.start();
}
function takeDamage(source, amount) {
health = health - amount;
if (health > 0) {
if (!airborne) {
if (grabbedOrphan != null) {
grabbedOrphan.ungrab();
grabbedOrphan = null;
}
if (!grabbed) {
if (source instanceof Projectile) {
if (source.dx > 0) {
__set__dir(-1);
} else if (source.dx < 0) {
__set__dir(1);
}
} else {
faceActor(source);
}
setAction(ACTION_HIT);
}
}
} else {
setAction(ACTION_DIE);
}
if ((_global.worldID == 4) && (_global.partID == 3)) {
if (_global.game.worlds.world.orphans._currentframe < 100) {
_global.game.worlds.world.orphans.play();
}
}
flasher.start();
switch (random(4)) {
case 0 :
_global.game.sound.start("sfx_tom_hit_1");
case 1 :
_global.game.sound.start("sfx_tom_hit_2");
case 2 :
_global.game.sound.start("sfx_tom_hit_3");
case 3 :
_global.game.sound.start("sfx_tom_hit_4");
}
_global.game.hud.changeHealth(health);
}
function startWarp() {
if (!busy) {
setAction(ACTION_WARP);
_global.game.gameEvent_warp();
return(true);
}
return(false);
}
function startUnwarp() {
if (action == ACTION_WARP) {
setAction(ACTION_UNWARP);
}
}
function grabOrphan(orphan) {
if (orphan.getAction() == 6) {
disableSack = true;
if ((!busy) && (!airborne)) {
if (grabbedOrphanCount < ORPHAN_COUNT_MAX) {
grabbedOrphan = orphan;
biteMe = orphan.getType();
setAction(ACTION_GRAB);
animation.orphan.gotoAndStop(orphan.getType());
return(true);
}
if (_global.game.action != 7) {
if (grabCount <= 0) {
_global.game.sound.start("sfx_tom_grunt_1");
grabCount = 45;
}
grabCount--;
}
}
}
}
function tossOrphan(orphan) {
if (alive) {
if (attacking) {
if ((orphan.getAction() != 6) && (orphan.getAction() != 4)) {
if (animation.attack != undefined) {
if (animation.attack.hitTest(orphan)) {
switch (random(2)) {
case 0 :
_global.game.sound.start("sfx_hit_3");
case 1 :
_global.game.sound.start("sfx_hit_4");
}
return(true);
}
}
}
}
}
return(false);
}
function stompOrphan(orphan) {
if (alive) {
if (airborne && (dy > 0)) {
if (animation.hitTest(orphan)) {
if ((orphan.getAction() != 6) && (orphan.getAction() != 4)) {
dy = -24;
switch (random(2)) {
case 0 :
_global.game.sound.start("sfx_hit_3");
case 1 :
_global.game.sound.start("sfx_hit_4");
}
return(true);
}
}
}
}
return(false);
}
function stompBed() {
if (alive) {
if (airborne && (dy > 0)) {
dy = -24;
switch (random(2)) {
case 0 :
_global.game.sound.start("sfx_hit_3");
case 1 :
_global.game.sound.start("sfx_hit_4");
}
return(true);
}
}
return(false);
}
function spawnOrphan(num) {
if (getOrphanCount() < num) {
num = getOrphanCount();
}
var _local5 = 0;
while (_local5 < num) {
var _local4 = Math.ceil(Math.random() * 4);
_root.game.worlds.world.attachMovie("orphan" + _local4, "orphan_" + _global.game.orphansSpawned, _root.game.worlds.world.getNextHighestDepth());
_root.game.worlds.world["orphan_" + _global.game.orphansSpawned]._x = _x;
_root.game.worlds.world["orphan_" + _global.game.orphansSpawned]._y = _y;
_global.game.orphansSpawned++;
_local5++;
}
setOrphanCount(getOrphanCount() - num);
_global.game.hud.changeOrphansCarried(grabbedOrphanCount, ORPHAN_COUNT_MAX);
}
function handlePie() {
setAction(ACTION_GRABPIE);
if (pieCount < pieMax) {
pieCount++;
_global.game.hud.changeOrphansCarried(pieCount, pieMax);
}
}
function checkAttack(item) {
if (attacking) {
if (animation.attack != undefined) {
if (animation.attack.hitTest(item)) {
switch (random(2)) {
case 0 :
_global.game.sound.start("sfx_hit_3");
case 1 :
_global.game.sound.start("sfx_hit_4");
}
return(true);
}
}
}
return(false);
}
function revive() {
alive = true;
health = 100;
_global.game.hud.setHealth(100);
_global.game.sound.start("sfx_absinthe");
invulnerable = true;
invulnerableDuration = 60;
setAction(ACTION_STAND);
}
function isAttackable() {
return((!invulnerable) && (!(((action == ACTION_HIT) || (action == ACTION_DIE)) || (action == ACTION_WARP))));
}
function attackCheck(enemy) {
if (alive) {
if (attacking) {
if (animation.attack != undefined) {
if (animation.attack.hitTest(enemy)) {
enemy.takeDamage(this, 25);
switch (random(2)) {
case 0 :
_global.game.sound.start("sfx_hit_3");
case 1 :
_global.game.sound.start("sfx_hit_4");
}
return(true);
}
}
}
}
return(false);
}
function isPressingUp() {
return(input_up);
}
function isPressingDown() {
return(input_down);
}
function getOrphanCount() {
return(grabbedOrphanCount);
}
function setOrphanCount(i) {
grabbedOrphanCount = i;
updateMultipliers();
}
function toggleFlying() {
flying = !flying;
if (flying) {
if (grabbed) {
stopGrabbed();
}
setAction(ACTION_FALL);
invulnerable = true;
} else {
invulnerable = false;
}
}
function startGrabbed(g) {
grabbed = true;
grabbedDuration = 0;
grabbedBy = g;
breakFree = 0;
updateMultipliers();
}
function stopGrabbed() {
grabbed = false;
grabbedBy.stopGrab();
grabbedBy = null;
updateMultipliers();
}
function isGrabbed() {
return(grabbed);
}
static var ACTION_STAND = 1;
static var ACTION_ATTACK = 2;
static var ACTION_THROW = 3;
static var ACTION_FALL = 4;
static var ACTION_LAND = 5;
static var ACTION_RUN = 6;
static var ACTION_RUN_ATTACK = 7;
static var ACTION_RUN_THROW = 8;
static var ACTION_RUN_JUMP = 9;
static var ACTION_RUN_LAND = 10;
static var ACTION_JUMP = 11;
static var ACTION_JUMP_ATTACK = 12;
static var ACTION_JUMP_THROW = 13;
static var ACTION_DUCK = 14;
static var ACTION_DUCK_ATTACK = 15;
static var ACTION_DUCK_THROW = 16;
static var ACTION_RISE = 17;
static var ACTION_HIT = 18;
static var ACTION_DIE = 19;
static var ACTION_WARP = 20;
static var ACTION_UNWARP = 21;
static var ACTION_GRAB = 22;
static var ACTION_SACK_ATTACK = 23;
static var ACTION_HIDE = 24;
static var ACTION_GRABPIE = 25;
static var ACTION_STRINGS = new Array("ACTION_NONE", "ACTION_STAND", "ACTION_ATTACK", "ACTION_THROW", "ACTION_FALL", "ACTION_LAND", "ACTION_RUN", "ACTION_RUN_ATTACK", "ACTION_RUN_THROW", "ACTION_RUN_JUMP", "ACTION_RUN_LAND", "ACTION_JUMP", "ACTION_JUMP_ATTACK", "ACTION_JUMP_THROW", "ACTION_DUCK", "ACTION_DUCK_ATTACK", "ACTION_DUCK_THROW", "ACTION_RISE", "ACTION_HIT", "ACTION_DIE", "ACTION_WARP", "ACTION_UNWARP", "ACTION_GRAB", "ACTION_SACK_ATTACK", "ACTION_HIDE", "ACTION_GRABPIE");
static var KEY_PLAYER_RIGHT = 39;
static var KEY_PLAYER_LEFT = 37;
static var KEY_PLAYER_UP = 38;
static var KEY_PLAYER_DOWN = 40;
static var KEY_PLAYER_JUMP = 32;
static var KEY_PLAYER_ATTACK = 65;
static var KEY_PLAYER_THROW = 83;
static var KEY_PLAYER_GRAB = 68;
static var RUN_SPEED = 20;
static var ACCELERATION = 5;
static var JUMP_SPEED = -45;
static var THROW_SPEED = 30;
static var MOTION_THRESHOLD = 15;
static var ORPHAN_COUNT_MAX = 10;
var input_right = false;
var input_left = false;
var input_up = false;
var input_down = false;
var input_jump = false;
var input_attack = false;
var input_throw = false;
var input_grab = false;
var triggerJump = false;
var triggerAttack = false;
var triggerThrow = false;
var triggerGrab = false;
var triggerSack = false;
var disableSack = false;
var triggerPowerup = false;
var sackSize = 1;
var grabbedOrphanCount = 0;
var grabCount = 12;
var heldOrphans = new Array();
var biteMe = 1;
var pieCount = 0;
var pieMax = 10;
var invulnerableDuration = 0;
var speedMult = 1;
var jumpMult = 1;
var grabbed = false;
var flying = false;
var onPlatform = false;
var onRotatingPlatform = false;
var jumping = false;
}
Symbol 1474 MovieClip [__Packages.DamageFlasher] Frame 0
class DamageFlasher
{
var target, color, duration;
function DamageFlasher (mc) {
target = mc;
color = new Color(target);
}
function get active() {
return(duration >= 0);
}
function start() {
color.setTransform(COLOR_TRANS_FLASH);
duration = 1;
}
function update() {
if (duration == 0) {
color.setTransform(COLOR_TRANS_DEFAULT);
}
duration--;
}
static var COLOR_TRANS_DEFAULT = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
static var COLOR_TRANS_FLASH = {ra:100, rb:100, ga:100, gb:100, ba:100, bb:100, aa:100, ab:0};
}
Symbol 1475 MovieClip [__Packages.Bobby] Frame 0
class Bobby extends Enemy
{
var setAction, ai, onEnterFrame, exists, action, _alpha, _visible, destroy, updateActiveStatus, active, busy, dx, __get__dir, decelerateX, airborne, accelerateY, limitSpeedX, limitSpeedY, safeMoveX, unSafeMoveX, safeMoveY, dy, avoidCollisions, alive, attacking, animation, checkPlayerAttack, checkPlayerCollision, uncollideCharacter, faceActor, gotoAndStop, _y, health;
function Bobby () {
super(65, 40);
setAction(ACTION_STAND);
ai = new BobbyAI(this);
onEnterFrame = update;
}
function update() {
if ((!exists) && (action != ACTION_DIE)) {
_alpha = 0;
_visible = false;
destroy();
return(undefined);
}
if (exists && (_global.game.action != 7)) {
super.update();
updateActiveStatus();
if (active || (busy)) {
ai.update();
if (action == ACTION_RUN) {
dx = RUN_SPEED * __get__dir();
} else if (action == ACTION_FLEE) {
dx = ((-RUN_SPEED) * __get__dir()) * 0.8;
} else if (action == ACTION_JUMP) {
dx = (RUN_SPEED * __get__dir()) * 1.5;
} else {
decelerateX(Character.FRICTION);
}
if (airborne) {
accelerateY(World.GRAVITY);
}
limitSpeedX();
limitSpeedY();
if (!airborne) {
safeMoveX(dx);
} else {
unSafeMoveX(dx);
}
safeMoveY(dy);
avoidCollisions();
if (alive) {
if (attacking) {
if (animation.attack != undefined) {
if (_global.game.world.player.isAttackable() && (animation.attack.hitTest(_global.game.world.player.solid))) {
_global.game.world.player.takeDamage(this, 10);
_global.game.sound.start("sfx_hit_2");
} else {
_global.game.sound.start("sfx_swoosh_2");
}
}
}
checkPlayerAttack();
checkPlayerCollision();
}
}
}
}
function startFall() {
setAction(ACTION_FALL);
ai.react();
}
function stopFall() {
if (random(3) == 0) {
setAction(ACTION_RUN);
} else {
setAction(ACTION_ATTACK);
}
ai.react();
}
function handlePlayerCollision() {
uncollideCharacter(_global.game.world.player, true);
faceActor(_global.game.world.player);
ai.react();
}
function handlePlayerAttack() {
if ((action != ACTION_JUMP) && (action != ACTION_FALL)) {
ai.react();
}
}
function initAction() {
switch (action) {
case ACTION_STAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_RUN :
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("run");
break;
case ACTION_FALL :
airborne = true;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_ATTACK :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = true;
gotoAndStop("attack");
break;
case ACTION_HIT :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("hit");
break;
case ACTION_DIE :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
alive = false;
exists = false;
gotoAndStop("die");
break;
case ACTION_FLEE :
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("flee");
break;
case ACTION_JUMP :
dx = 45 * __get__dir();
if ((_y - _global.game.world.player._y) > 150) {
dy = -45;
} else {
dy = -25;
}
airborne = true;
busy = true;
attacking = false;
gotoAndStop("run");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_ATTACK :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_HIT :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_DIE :
exists = false;
destroy();
break;
}
}
function handleDamage() {
if (health > 0) {
setAction(ACTION_HIT);
} else {
setAction(ACTION_DIE);
}
}
static var ACTION_STAND = 1;
static var ACTION_RUN = 2;
static var ACTION_FALL = 3;
static var ACTION_ATTACK = 4;
static var ACTION_HIT = 5;
static var ACTION_DIE = 6;
static var ACTION_FLEE = 7;
static var ACTION_JUMP = 8;
static var ACTION_STRINGS = new Array("ACTION_NONE", "ACTION_STAND", "ACTION_RUN", "ACTION_FALL", "ACTION_ATTACK", "ACTION_HIT", "ACTION_DIE", "ACTION_FLEE");
static var RUN_SPEED = 12;
var inPursuit = false;
}
Symbol 1476 MovieClip [__Packages.BobbyAI] Frame 0
class BobbyAI extends AI
{
var aiState, puppet, lookOutForPlayer, isPlayerAlive, canAttackPlayer, isFacingPlayer, aware, canSeePlayer;
function BobbyAI (char) {
super(char);
aiState = AISTATE_IDLE;
}
function update() {
super.update();
if (!puppet.busy) {
switch (aiState) {
case AISTATE_IDLE :
case AISTATE_WANDER :
lookOutForPlayer();
break;
case AISTATE_FLEE :
puppet.faceActor(_global.game.world.player);
delayCounter++;
if (isPlayerAlive()) {
if (canAttackPlayer() && (random(6) == 0)) {
setState(AISTATE_ATTACK);
} else if (delayCounter > (6 + random(6))) {
if (random(3) == 0) {
setState(AISTATE_ATTACK);
} else {
setState(AISTATE_APPROACH);
}
assess();
} else if (delayCounter > 6) {
setState(AISTATE_JUMP);
}
} else if (delayCounter > 9) {
setState(AISTATE_APPROACH);
}
break;
case AISTATE_APPROACH :
if (isPlayerAlive()) {
if (canAttackPlayer() && (random(6) == 0)) {
setState(AISTATE_ATTACK);
} else if ((isFacingPlayer() && (puppet.inRangeX(_global.game.world.player, 200))) && (random(12) == 0)) {
setState(AISTATE_JUMP);
} else if ((!isFacingPlayer()) && (!puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_ATTACK :
break;
case AISTATE_JUMP :
if (isPlayerAlive()) {
if (isFacingPlayer() && (puppet.inRangeX(_global.game.world.player, 200))) {
setState(AISTATE_ATTACK);
}
}
break;
}
}
}
function assess() {
super.assess();
if (puppet.airborne || (puppet.busy)) {
setState(AISTATE_IDLE);
} else if (aware || (canSeePlayer() && (isPlayerAlive()))) {
if ((canSeePlayer() && (random(8) == 0)) || ((puppet.health <= 20) && (random(2) == 0))) {
setState(AISTATE_FLEE);
} else {
setState(AISTATE_APPROACH);
inPursuit = true;
}
if (!aware) {
_global.game.sound.start("sfx_police_whistle");
}
aware = true;
} else if (!inPursuit) {
if (puppet.action == Bobby.ACTION_STAND) {
if (random(2) == 0) {
puppet.faceLeft();
} else {
puppet.faceRight();
}
}
setState(AISTATE_IDLE);
aware = false;
} else {
inPursuit = false;
}
}
function setState(newState) {
super.setState(newState);
switch (aiState) {
case AISTATE_IDLE :
puppet.setAction(Bobby.ACTION_STAND);
break;
case AISTATE_WANDER :
if (!inPursuit) {
if (random(2) == 0) {
if (puppet.checkEdge(10)) {
puppet.__set__dir(1);
} else {
puppet.__set__dir(-1);
}
} else if (puppet.checkEdge(-10)) {
puppet.__set__dir(-1);
} else {
puppet.__set__dir(1);
}
}
puppet.setAction(Bobby.ACTION_RUN);
break;
case AISTATE_FLEE :
delayCounter = 0;
puppet.faceActor(_global.game.world.player);
puppet.setAction(Bobby.ACTION_FLEE);
break;
case AISTATE_APPROACH :
puppet.faceActor(_global.game.world.player);
puppet.setAction(Bobby.ACTION_RUN);
break;
case AISTATE_ATTACK :
puppet.setAction(Bobby.ACTION_ATTACK);
break;
case AISTATE_JUMP :
puppet.setAction(Bobby.ACTION_JUMP);
break;
}
}
static var AISTATE_IDLE = 1;
static var AISTATE_WANDER = 2;
static var AISTATE_FLEE = 3;
static var AISTATE_APPROACH = 4;
static var AISTATE_ATTACK = 5;
static var AISTATE_JUMP = 6;
static var AISTATE_STRINGS = Array("[NO STATE]", "AISTATE_IDLE", "AISTATE_WANDER", "AISTATE_FLEE", "AISTATE_APPROACH", "AISTATE_ATTACK", "AISTATE_JUMP");
var delayCounter = 0;
var inPursuit = false;
}
Symbol 1477 MovieClip [__Packages.Absinthe] Frame 0
class Absinthe extends Item
{
var setAction, onEnterFrame, checkPlayerCollision, action, gotoAndStop, gotoAndPlay, destroy;
function Absinthe () {
super(10, 5);
setAction(ACTION_READY);
onEnterFrame = update;
}
function update() {
super.update();
checkPlayerCollision();
}
function handlePlayerCollision() {
_global.game.world.player.adustHealth(50);
_global.game.hud.changeHealth(_global.game.world.player.health);
setAction(ACTION_PICKUP);
}
function initAction() {
switch (action) {
case ACTION_READY :
gotoAndStop("ready");
break;
case ACTION_PICKUP :
gotoAndPlay("pickup");
_global.game.sound.start("sfx_absinthe");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_PICKUP :
destroy();
break;
default :
}
}
static var ACTION_READY = 1;
static var ACTION_PICKUP = 2;
}
Symbol 1478 MovieClip [__Packages.Orphan] Frame 0
class Orphan extends NPC
{
var setAction, ai, onEnterFrame, exists, action, updateActiveStatus, active, busy, dx, __get__dir, RUN_SPEED, ORPHAN_TYPE, decelerateX, airborne, accelerateY, limitSpeedX, limitSpeedY, safeMoveX, safeMoveY, dy, unSafeMoveX, bounceMoveY, avoidCollisions, collideActor, attacking, animation, inRangeX, hitTest, gotoAndStop, getAction;
function Orphan (height, width) {
super(height, width);
setAction(ACTION_STAND);
ai = new OrphanAI(this);
onEnterFrame = update;
_global.game.addOrphan(this);
}
function destroy() {
isDead = true;
}
function update() {
if ((!exists) || (isDead)) {
return(undefined);
}
if (_global.game.action != 7) {
if (alwaysStunned) {
if (((action != ACTION_STUNNED) && (action != ACTION_FALL)) && (action != ACTION_GRABBED)) {
setAction(ACTION_STUNNED);
}
}
updateActiveStatus();
if (active || (busy)) {
ai.update();
if (action == ACTION_RUN) {
dx = RUN_SPEED * __get__dir();
} else if (ORPHAN_TYPE == 1) {
decelerateX(Character.FRICTION / 4);
} else {
decelerateX(Character.FRICTION);
}
if (airborne) {
accelerateY(World.GRAVITY);
}
limitSpeedX();
limitSpeedY();
if (!airborne) {
safeMoveX(dx);
safeMoveY(dy);
} else {
unSafeMoveX(dx);
if (ORPHAN_TYPE == 1) {
bounceMoveY(dy);
} else {
safeMoveY(dy);
}
}
avoidCollisions();
if (_global.game.world.player.alive) {
if (!_global.game.world.player.busy) {
if (collideActor(_global.game.world.player)) {
if (_global.game.world.player.grabOrphan(this)) {
switch (random(3)) {
case 0 :
_global.game.sound.start("sfx_orphan_yelp_1");
break;
case 1 :
_global.game.sound.start("sfx_orphan_yelp_2");
break;
case 2 :
_global.game.sound.start("sfx_orphan_yelp_3");
break;
case 3 :
_global.game.sound.start("sfx_orphan_yelp_4");
}
setAction(ACTION_GRABBED);
}
if (_global.game.world.player.stompOrphan(this)) {
switch (random(3)) {
case 0 :
_global.game.sound.start("sfx_orphan_yelp_1");
break;
case 1 :
_global.game.sound.start("sfx_orphan_yelp_2");
break;
case 2 :
_global.game.sound.start("sfx_orphan_yelp_3");
break;
case 3 :
_global.game.sound.start("sfx_orphan_yelp_4");
}
setAction(ACTION_STUNNED);
}
}
if (attacking) {
if (animation.attack != undefined) {
if (_global.game.world.player.isAttackable() && (animation.attack.hitTest(_global.game.world.player.solid))) {
_global.game.world.player.takeDamage(this, 5);
_global.game.sound.start("sfx_hit_2");
}
}
} else if ((ORPHAN_TYPE == 4) && (inRangeX(_global.game.world.player, 100))) {
if ((action == ACTION_RUN) || (action == ACTION_RUN)) {
if (random(3) == 0) {
}
} else if (action == ACTION_STUNNED) {
if (random(24) == 0) {
}
}
}
} else if (hitTest(_global.game.world.player)) {
if (_global.game.world.player.tossOrphan(this)) {
switch (random(3)) {
case 0 :
_global.game.sound.start("sfx_orphan_yelp_1");
break;
case 1 :
_global.game.sound.start("sfx_orphan_yelp_2");
break;
case 2 :
_global.game.sound.start("sfx_orphan_yelp_3");
break;
case 3 :
_global.game.sound.start("sfx_orphan_yelp_4");
}
setAction(ACTION_TOSSED);
}
}
}
}
}
}
function initAction() {
switch (action) {
case ACTION_STAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_RUN :
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("run");
break;
case ACTION_FALL :
airborne = true;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_GRABBED :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("grabbed");
break;
case ACTION_TOSSED :
if (ORPHAN_TYPE == 1) {
dx = (20 + random(20)) * _global.game.world.player.dir;
dy = -(60 + random(30));
} else {
dx = (30 + random(30)) * _global.game.world.player.dir;
dy = -(30 + random(30));
}
airborne = true;
busy = true;
attacking = false;
gotoAndStop("hurt");
break;
case ACTION_STUNNED :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("stunned");
break;
case ACTION_ATTACK :
dy = 0;
airborne = false;
busy = true;
attacking = true;
gotoAndStop("headbutt");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
if (!(action === ACTION_ATTACK)) {
} else {
setAction(ACTION_STAND);
ai.react();
}
}
function startFall() {
setAction(ACTION_FALL);
ai.react();
}
function stopFall() {
if (getAction() == ACTION_TOSSED) {
setAction(ACTION_STUNNED);
} else {
setAction(ACTION_STAND);
ai.react();
}
}
function makeStunned() {
alwaysStunned = true;
setAction(ACTION_STUNNED);
}
function makeAlive() {
isDead = false;
setAction(ACTION_STAND);
}
function getType() {
return(ORPHAN_TYPE);
}
function ungrab() {
ai.assess();
}
static function nextID() {
return(++spawnedOrphanCount);
}
static var ACTION_STAND = 1;
static var ACTION_RUN = 2;
static var ACTION_FALL = 3;
static var ACTION_GRABBED = 4;
static var ACTION_TOSSED = 5;
static var ACTION_STUNNED = 6;
static var ACTION_ATTACK = 7;
static var ACTION_STRINGS = new Array("ACTION_NONE", "ACTION_STAND", "ACTION_RUN", "ACTION_FALL", "ACTION_GRABBED", "ACTION_TOSSED", "ACTION_STUNNED", "ACTION_ATTACK");
var npcType = "orphan";
var isDead = false;
var alwaysStunned = false;
static var spawnedOrphanCount = 0;
}
Symbol 1479 MovieClip [__Packages.OrphanAI] Frame 0
class OrphanAI extends AI
{
var aiState, puppet, lookOutForPlayer, aware, canSeePlayer, isPlayerAlive;
function OrphanAI (char) {
super(char);
aiState = AISTATE_IDLE;
}
function update() {
super.update();
if (!puppet.busy) {
switch (aiState) {
case AISTATE_IDLE :
case AISTATE_WANDER :
lookOutForPlayer();
break;
case AISTATE_FLEE :
break;
case AISTATE_TOSS :
break;
case AISTATE_STUN :
break;
}
}
}
function assess() {
super.assess();
if (puppet.airborne || (puppet.busy)) {
setState(AISTATE_IDLE);
} else if (aware || (canSeePlayer() && (isPlayerAlive()))) {
if (puppet.inRangeX(_global.game.world.player, 100)) {
if (random(2) == 0) {
setState(AISTATE_WANDER);
} else {
setState(AISTATE_FLEE);
}
} else if (random(2) == 0) {
setState(AISTATE_IDLE);
} else {
setState(AISTATE_FLEE);
}
if (!aware) {
if (random(3) == 0) {
_global.game.sound.start("sfx_orphan_scared_1");
}
}
aware = true;
} else if (puppet.action == Orphan.ACTION_TOSSED) {
setState(AISTATE_STUN);
} else {
if (random(2) == 0) {
if (puppet.action == Orphan.ACTION_STAND) {
if (random(2) == 0) {
puppet.faceLeft();
} else {
puppet.faceRight();
}
}
setState(AISTATE_IDLE);
} else {
setState(AISTATE_WANDER);
}
aware = false;
}
}
function setState(newState) {
super.setState(newState);
switch (aiState) {
case AISTATE_IDLE :
puppet.setAction(Orphan.ACTION_STAND);
break;
case AISTATE_WANDER :
if (random(2) == 0) {
if (puppet.checkEdge(10)) {
puppet.__set__dir(1);
} else {
puppet.__set__dir(-1);
}
} else if (puppet.checkEdge(-10)) {
puppet.__set__dir(-1);
} else {
puppet.__set__dir(1);
}
puppet.setAction(Orphan.ACTION_RUN);
break;
case AISTATE_FLEE :
puppet.faceActor(_global.game.world.player);
puppet.reverseDir();
puppet.setAction(Orphan.ACTION_RUN);
break;
case AISTATE_TOSS :
puppet.faceActor(_global.game.world.player);
puppet.setAction(Orphan.ACTION_TOSSED);
break;
case AISTATE_STUN :
puppet.setAction(Orphan.ACTION_STUNNED);
break;
case AISTATE_ATTACK :
puppet.faceActor(_global.game.world.player);
puppet.setAction(Orphan.ACTION_ATTACK);
break;
}
}
static var AISTATE_IDLE = 1;
static var AISTATE_WANDER = 2;
static var AISTATE_FLEE = 3;
static var AISTATE_TOSS = 4;
static var AISTATE_STUN = 5;
static var AISTATE_ATTACK = 6;
static var AISTATE_STRINGS = Array("[NO STATE]", "AISTATE_IDLE", "AISTATE_WANDER", "AISTATE_FLEE", "AISTATE_TOSS", "AISTATE_STUN", "AISTATE_ATTACK");
}
Symbol 1480 MovieClip [__Packages.Orphan4] Frame 0
class Orphan4 extends Orphan
{
function Orphan4 () {
super(24, 15);
}
var ORPHAN_TYPE = 4;
var RUN_SPEED = 12;
}
Symbol 1481 MovieClip [__Packages.Orphan1] Frame 0
class Orphan1 extends Orphan
{
function Orphan1 () {
super(22, 15);
}
var ORPHAN_TYPE = 1;
var RUN_SPEED = 14;
}
Symbol 1482 MovieClip [__Packages.Orphan2] Frame 0
class Orphan2 extends Orphan
{
function Orphan2 () {
super(32, 15);
}
var ORPHAN_TYPE = 2;
var RUN_SPEED = 14;
}
Symbol 1483 MovieClip [__Packages.Orphan3] Frame 0
class Orphan3 extends Orphan
{
function Orphan3 () {
super(24, 15);
}
var ORPHAN_TYPE = 3;
var RUN_SPEED = 18;
}
Symbol 1484 MovieClip [__Packages.SkinnyHooker] Frame 0
class SkinnyHooker extends Enemy
{
var setAction, ai, health, onEnterFrame, exists, action, _alpha, _visible, destroy, updateActiveStatus, active, busy, dx, __get__dir, decelerateX, airborne, accelerateY, limitSpeedX, limitSpeedY, safeMoveX, safeMoveY, dy, avoidCollisions, alive, attacking, animation, checkPlayerAttack, checkPlayerCollision, uncollideCharacter, faceActor, gotoAndStop;
function SkinnyHooker () {
super(70, 30);
setAction(ACTION_STAND);
ai = new SkinnyHookerAI(this);
health = 75;
onEnterFrame = update;
}
function update() {
if ((!exists) && (action != ACTION_DIE)) {
_alpha = 0;
_visible = false;
destroy();
return(undefined);
}
if (exists && (_global.game.action != 7)) {
super.update();
updateActiveStatus();
if (active || (busy)) {
ai.update();
if (action == ACTION_RUN) {
dx = RUN_SPEED * __get__dir();
} else {
decelerateX(Character.FRICTION);
}
if (airborne) {
accelerateY(World.GRAVITY);
}
limitSpeedX();
limitSpeedY();
safeMoveX(dx);
safeMoveY(dy);
avoidCollisions();
if (alive) {
if (attacking) {
if (animation.attack != undefined) {
if (_global.game.world.player.isAttackable() && (animation.attack.hitTest(_global.game.world.player.solid))) {
_global.game.world.player.takeDamage(this, 10);
_global.game.sound.start("sfx_hit_2");
} else {
_global.game.sound.start("sfx_swoosh_2");
}
}
}
checkPlayerAttack();
checkPlayerCollision();
}
}
}
}
function startFall() {
setAction(ACTION_FALL);
ai.react();
}
function stopFall() {
setAction(ACTION_STAND);
ai.react();
}
function handlePlayerCollision() {
uncollideCharacter(_global.game.world.player, true);
faceActor(_global.game.world.player);
ai.react();
}
function handlePlayerAttack() {
ai.react();
}
function initAction() {
switch (action) {
case ACTION_STAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_RUN :
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("run");
break;
case ACTION_FALL :
airborne = true;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_ATTACK :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = true;
gotoAndStop("attack");
break;
case ACTION_HIT :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("hit");
break;
case ACTION_DIE :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
alive = false;
exists = false;
gotoAndStop("die");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_ATTACK :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_HIT :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_DIE :
exists = false;
destroy();
break;
}
}
function handleDamage() {
if (health > 0) {
setAction(ACTION_HIT);
} else {
setAction(ACTION_DIE);
}
}
static var ACTION_STAND = 1;
static var ACTION_RUN = 2;
static var ACTION_FALL = 3;
static var ACTION_ATTACK = 4;
static var ACTION_HIT = 5;
static var ACTION_DIE = 6;
static var ACTION_STRINGS = new Array("ACTION_NONE", "ACTION_STAND", "ACTION_RUN", "ACTION_FALL", "ACTION_ATTACK", "ACTION_HIT", "ACTION_DIE");
static var RUN_SPEED = 12;
}
Symbol 1485 MovieClip [__Packages.SkinnyHookerAI] Frame 0
class SkinnyHookerAI extends AI
{
var aiState, puppet, lookOutForPlayer, isPlayerAlive, canAttackPlayer, isFacingPlayer, aware, canSeePlayer;
function SkinnyHookerAI (char) {
super(char);
aiState = AISTATE_IDLE;
}
function update() {
super.update();
if (!puppet.busy) {
switch (aiState) {
case AISTATE_IDLE :
case AISTATE_WANDER :
lookOutForPlayer();
break;
case AISTATE_FLEE :
if (isPlayerAlive()) {
if (canAttackPlayer() && (random(6) == 0)) {
setState(AISTATE_ATTACK);
} else if (isFacingPlayer() && (puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_APPROACH :
if (isPlayerAlive()) {
if (canAttackPlayer() && (random(6) == 0)) {
setState(AISTATE_ATTACK);
} else if ((!isFacingPlayer()) && (!puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_ATTACK :
break;
}
}
}
function assess() {
super.assess();
if (puppet.airborne || (puppet.busy)) {
setState(AISTATE_IDLE);
} else if (aware || (canSeePlayer() && (isPlayerAlive()))) {
if ((random(5) > 2) || ((puppet.health <= 20) && (random(2) == 0))) {
setState(AISTATE_FLEE);
} else {
setState(AISTATE_APPROACH);
}
if (!aware) {
_global.game.sound.start("sfx_skinnyhooker_laugh");
}
aware = true;
} else {
if (puppet.action == SkinnyHooker.ACTION_STAND) {
if (random(2) == 0) {
puppet.faceLeft();
} else {
puppet.faceRight();
}
}
setState(AISTATE_IDLE);
aware = false;
}
}
function setState(newState) {
super.setState(newState);
switch (aiState) {
case AISTATE_IDLE :
puppet.setAction(SkinnyHooker.ACTION_STAND);
break;
case AISTATE_WANDER :
if (random(2) == 0) {
if (puppet.checkEdge(10)) {
puppet.__set__dir(1);
} else {
puppet.__set__dir(-1);
}
} else if (puppet.checkEdge(-10)) {
puppet.__set__dir(-1);
} else {
puppet.__set__dir(1);
}
puppet.setAction(SkinnyHooker.ACTION_RUN);
break;
case AISTATE_FLEE :
puppet.faceActor(_global.game.world.player);
puppet.reverseDir();
puppet.setAction(SkinnyHooker.ACTION_RUN);
break;
case AISTATE_APPROACH :
puppet.faceActor(_global.game.world.player);
puppet.setAction(SkinnyHooker.ACTION_RUN);
break;
case AISTATE_ATTACK :
puppet.setAction(SkinnyHooker.ACTION_ATTACK);
break;
}
}
static var AISTATE_IDLE = 1;
static var AISTATE_WANDER = 2;
static var AISTATE_FLEE = 3;
static var AISTATE_APPROACH = 4;
static var AISTATE_ATTACK = 5;
static var AISTATE_STRINGS = Array("[NO STATE]", "AISTATE_IDLE", "AISTATE_WANDER", "AISTATE_FLEE", "AISTATE_APPROACH", "AISTATE_ATTACK");
}
Symbol 1486 MovieClip [__Packages.Umbrella] Frame 0
class Umbrella extends Item
{
var setAction, onEnterFrame, checkPlayerCollision, _alpha, action, _visible, _x, _y, gotoAndStop, destroy, gotoAndPlay;
function Umbrella () {
super(10, 10);
setAction(ACTION_READY);
onEnterFrame = update;
}
function update() {
super.update();
checkPlayerCollision();
if (_global.game.breakTimer == true) {
_alpha = 0;
} else if (action == ACTION_READY) {
_alpha = 100;
}
}
function handlePlayerCollision() {
if ((action == ACTION_READY) && (_global.game.breakTimer == false)) {
if (_global.game.world.player.startWarp()) {
_global.game.sound.start("sfx_tom_umbrella");
_visible = false;
_alpha = 0;
_global.game.warpbackx = _x + 120;
_global.game.warpbacky = _y;
setAction(ACTION_REAPPEAR);
}
}
}
function initAction() {
switch (action) {
case ACTION_READY :
touched = false;
gotoAndStop("ready");
break;
case ACTION_PICKUP :
destroy();
break;
case ACTION_REAPPEAR :
gotoAndPlay("reappear");
_visible = true;
_alpha = 100;
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_PICKUP :
break;
case ACTION_REAPPEAR :
setAction(ACTION_READY);
break;
}
}
static var ACTION_READY = 1;
static var ACTION_PICKUP = 2;
static var ACTION_REAPPEAR = 3;
var touched = false;
}
Symbol 1487 MovieClip [__Packages.UmbrellaRed] Frame 0
class UmbrellaRed extends Item
{
var setAction, onEnterFrame, checkPlayerCollision, action, _visible, _alpha, _x, _y, gotoAndStop, gotoAndPlay, destroy;
function UmbrellaRed () {
super(10, 10);
setAction(ACTION_DISABLED);
onEnterFrame = update;
}
function update() {
super.update();
checkPlayerCollision();
if (action == ACTION_DISABLED) {
if (_global.game.breakTimer == true) {
setAction(ACTION_READY);
}
} else if (action == ACTION_READY) {
if (_global.game.breakTimer != true) {
setAction(ACTION_DISAPPEAR);
}
}
}
function handlePlayerCollision() {
if (action == ACTION_READY) {
if (_global.game.world.player.startWarp()) {
_global.game.sound.start("sfx_tom_umbrella");
_visible = false;
_alpha = 0;
_global.game.warpbackx = _x;
_global.game.warpbacky = _y;
_global.game.breakTimer = false;
_root.game.hud_timer._alpha = 0;
setAction(ACTION_DISAPPEAR);
}
}
}
function initAction() {
switch (action) {
case ACTION_READY :
touched = false;
gotoAndStop("ready");
break;
case ACTION_DISABLED :
gotoAndStop("disabled");
break;
case ACTION_DISAPPEAR :
gotoAndPlay("disappear");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_DISABLED :
setAction(ACTION_READY);
break;
case ACTION_DISAPPEAR :
_visible = false;
_alpha = 0;
update = null;
destroy();
break;
}
}
static var ACTION_READY = 1;
static var ACTION_DISABLED = 2;
static var ACTION_DISAPPEAR = 3;
var touched = false;
}
Symbol 1488 MovieClip [__Packages.Trigger] Frame 0
class Trigger extends Actor
{
var getRect, bounds, _visible, _alpha, onEnterFrame, exists, touching;
function Trigger () {
super();
var _local4 = getRect(_global.game.world);
bounds = new flash.geom.Rectangle(_local4.xMin, _local4.yMin, _local4.xMax - _local4.xMin, _local4.yMax - _local4.yMin);
_visible = false;
_alpha = 0;
onEnterFrame = update;
}
function update() {
if (!exists) {
return(undefined);
}
if (!bounds.intersects(_global.game.activeRect)) {
return(undefined);
}
if (bounds.contains(_global.game.world.player._x, _global.game.world.player._y)) {
if (!touching) {
touching = true;
count++;
activate();
}
} else if (touching) {
touching = false;
}
}
function activate() {
}
var count = 0;
}
Symbol 1489 MovieClip [__Packages.TriggerEnd] Frame 0
class TriggerEnd extends Trigger
{
var count;
function TriggerEnd () {
super();
}
function activate() {
if (_global.game.objectivesComplete()) {
if (count == 1) {
_global.game.gameEvent_endWorld();
}
} else {
count = 0;
}
}
}
Symbol 1490 MovieClip [__Packages.TriggerBreakout] Frame 0
class TriggerBreakout extends Trigger
{
var count;
function TriggerBreakout () {
super();
}
function TriggerEnd() {
super();
}
function activate() {
if (count == 1) {
if (_global.game.orphansCaught > 4) {
if (!_global.game.gameEvent_displayWarning()) {
count = 0;
}
} else {
count = 0;
}
}
}
}
Symbol 1491 MovieClip [__Packages.TriggerCamera] Frame 0
class TriggerCamera extends Trigger
{
var _name;
function TriggerCamera () {
super();
}
function TriggerEnd() {
super();
}
function activate() {
if (_name.substr(0, 8) == "camreset") {
_global.game.swapViewExtents("0");
} else {
_global.game.swapViewExtents(_name.substr(0, 1));
}
}
}
Symbol 1492 MovieClip [__Packages.TriggerTip] Frame 0
class TriggerTip extends Trigger
{
var count, _name;
function TriggerTip () {
super();
}
function TriggerEnd() {
super();
}
function activate() {
if ((count == 1) && (!_global.game.disableTip)) {
if (!_global.game.gameEvent_displayTip(_name)) {
count = 0;
}
}
}
}
Symbol 1493 MovieClip [__Packages.TriggerDodger] Frame 0
class TriggerDodger extends Trigger
{
var count;
function TriggerDodger () {
super();
}
function TriggerEnd() {
super();
}
function activate() {
if (count == 1) {
_global.game.gameEvent_spawnDodger();
}
}
}
Symbol 1494 MovieClip [__Packages.World2Part1] Frame 0
class World2Part1 extends World
{
var orphansRequried, bo_cop1, bo_cop2, bo_cop3;
function World2Part1 () {
super();
orphansRequried = 20;
trace("begin World2Part1");
}
function init() {
super.init();
}
function update() {
if (!breakOut_done) {
if (((bo_cop1 == undefined) && (bo_cop2 == undefined)) && (bo_cop3 == undefined)) {
if (_global.game.world.player.startWarp()) {
_global.game.backtogame = true;
_global.game.sound.start("sfx_tom_umbrella");
breakOut_done = true;
}
} else if (((bo_cop1.health <= 0) && (bo_cop2.health <= 0)) && (bo_cop3.health <= 0)) {
if (!endSet) {
endSet = true;
endCounter = getTimer();
} else if ((getTimer() - endCounter) > 4500) {
if (_global.game.world.player.startWarp()) {
_global.game.backtogame = true;
_global.game.sound.start("sfx_tom_umbrella");
breakOut_done = true;
}
}
}
}
}
var endSet = false;
var endCounter = 0;
var breakOut_done = false;
}
Symbol 1495 MovieClip [__Packages.World2Part2] Frame 0
class World2Part2 extends World
{
var orphansRequried, bo_orphan1, bo_orphan2, bo_orphan3, bo_orphan4, bo_orphan5;
function World2Part2 () {
super();
orphansRequried = 20;
}
function init() {
super.init();
}
function update() {
if (!breakOut_done) {
if ((((bo_orphan1.isDead && (bo_orphan2.isDead)) && (bo_orphan3.isDead)) && (bo_orphan4.isDead)) && (bo_orphan5.isDead)) {
if (_global.game.world.player.startWarp()) {
_global.game.backtogame = true;
_global.game.sound.start("sfx_tom_umbrella");
breakOut_done = true;
}
}
}
}
var breakOut_done = false;
}
Symbol 1496 MovieClip [__Packages.World2Part3] Frame 0
class World2Part3 extends World
{
var orphansRequried, bo_cop1, bo_cop2, bo_cop3;
function World2Part3 () {
super();
orphansRequried = 20;
}
function init() {
super.init();
}
function update() {
if (!breakOut_done) {
if (((bo_cop1 == undefined) && (bo_cop2 == undefined)) && (bo_cop3 == undefined)) {
if (_global.game.world.player.startWarp()) {
_global.game.backtogame = true;
_global.game.sound.start("sfx_tom_umbrella");
breakOut_done = true;
}
} else if (((bo_cop1.health <= 0) && (bo_cop2.health <= 0)) && (bo_cop3.health <= 0)) {
if (!endSet) {
endSet = true;
endCounter = getTimer();
} else if ((getTimer() - endCounter) > 4500) {
if (_global.game.world.player.startWarp()) {
_global.game.backtogame = true;
_global.game.sound.start("sfx_tom_umbrella");
breakOut_done = true;
}
}
}
}
}
var endSet = false;
var endCounter = 0;
var breakOut_done = false;
}
Symbol 1497 MovieClip [__Packages.ArtfulDodgerBoss] Frame 0
class ArtfulDodgerBoss extends Enemy
{
var setAction, ai, onEnterFrame, exists, _alpha, _visible, updateActiveStatus, active, busy, action, dx, __get__dir, decelerateX, airborne, accelerateY, limitSpeedX, limitSpeedY, safeMoveX, unSafeMoveX, safeMoveY, dy, avoidCollisions, alive, attacking, animation, checkPlayerAttack, checkPlayerCollision, faceActor, uncollideCharacter, gotoAndStop, destroy, health;
function ArtfulDodgerBoss () {
super(60, 24);
setAction(ACTION_STAND);
ai = new ArtfulDodgerBossAI(this);
onEnterFrame = update;
}
function update() {
if (!exists) {
_alpha = 0;
_visible = false;
return(undefined);
}
super.update();
updateActiveStatus();
if (active || (busy)) {
ai.update();
if (action == ACTION_RUN) {
dx = RUN_SPEED * __get__dir();
} else if (action != ACTION_JUMP) {
decelerateX(Character.FRICTION);
} else {
dx = 20 * __get__dir();
}
if (airborne) {
accelerateY(World.GRAVITY);
}
limitSpeedX();
limitSpeedY();
if (!airborne) {
safeMoveX(dx);
} else {
unSafeMoveX(dx);
}
safeMoveY(dy);
avoidCollisions();
if (alive) {
if (attacking) {
if (animation.attack != undefined) {
if (_global.game.world.player.isAttackable() && (animation.attack.hitTest(_global.game.world.player.solid))) {
_global.game.world.player.takeDamage(this, 15);
_global.game.sound.start("sfx_hit_2");
} else {
_global.game.sound.start("sfx_swoosh_2");
}
}
}
if (!airborne) {
checkPlayerAttack();
checkPlayerCollision();
}
}
}
}
function startFall() {
setAction(ACTION_FALL);
ai.react();
}
function stopFall() {
faceActor(_global.game.world.player);
setAction(ACTION_LAND);
ai.react();
}
function handlePlayerCollision() {
uncollideCharacter(_global.game.world.player, true);
faceActor(_global.game.world.player);
ai.react();
}
function handlePlayerAttack() {
ai.react();
}
function initAction() {
switch (action) {
case ACTION_STAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_RUN :
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("run");
break;
case ACTION_FALL :
airborne = true;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_ATTACK :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = true;
gotoAndStop("attack");
break;
case ACTION_HIT :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("hit");
break;
case ACTION_DIE :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
alive = false;
gotoAndStop("die");
break;
case ACTION_JUMP :
dx = 45 * __get__dir();
dy = -45;
airborne = true;
busy = true;
attacking = false;
gotoAndStop("jump");
break;
case ACTION_LAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("land");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_ATTACK :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_HIT :
if (random(2) == 0) {
setAction(ACTION_ATTACK);
} else if (random(2) == 0) {
setAction(ACTION_JUMP);
} else {
setAction(ACTION_STAND);
}
ai.react();
break;
case ACTION_JUMP :
setAction(ACTION_FALL);
ai.react();
break;
case ACTION_LAND :
if (random(2) == 0) {
setAction(ACTION_ATTACK);
} else {
setAction(ACTION_STAND);
}
ai.react();
break;
case ACTION_DIE :
destroy();
break;
}
}
function handleDamage() {
if (health > 0) {
setAction(ACTION_HIT);
} else {
setAction(ACTION_DIE);
}
}
static var ACTION_STAND = 1;
static var ACTION_RUN = 2;
static var ACTION_FALL = 3;
static var ACTION_ATTACK = 4;
static var ACTION_HIT = 5;
static var ACTION_DIE = 6;
static var ACTION_JUMP = 7;
static var ACTION_LAND = 8;
static var ACTION_STRINGS = new Array("ACTION_NONE", "ACTION_STAND", "ACTION_RUN", "ACTION_FALL", "ACTION_ATTACK", "ACTION_HIT", "ACTION_DIE", "ACTION_JUMP", "ACTION_LAND");
static var RUN_SPEED = 16;
}
Symbol 1498 MovieClip [__Packages.ArtfulDodgerBossAI] Frame 0
class ArtfulDodgerBossAI extends AI
{
var aiState, puppet, lookOutForPlayer, isPlayerAlive, canAttackPlayer, isFacingPlayer, aware, canSeePlayer;
function ArtfulDodgerBossAI (char) {
super(char);
aiState = AISTATE_IDLE;
}
function update() {
super.update();
if (!puppet.busy) {
switch (aiState) {
case AISTATE_IDLE :
case AISTATE_WANDER :
lookOutForPlayer();
break;
case AISTATE_FLEE :
if (isPlayerAlive()) {
if (canAttackPlayer()) {
setState(AISTATE_ATTACK);
} else if (isFacingPlayer() && (puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_APPROACH :
if (isPlayerAlive()) {
if (canAttackPlayer()) {
setState(AISTATE_ATTACK);
} else if ((!isFacingPlayer()) && (!puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_ATTACK :
break;
case AISTATE_EVADE :
break;
}
}
}
function assess() {
super.assess();
if (puppet.airborne || (puppet.busy)) {
if (puppet.action == HeadmasterBoss.ACTION_JUMP) {
puppet.setAction(HeadmasterBoss.ACTION_LAND);
} else {
setState(AISTATE_IDLE);
}
} else if (aware || (canSeePlayer() && (isPlayerAlive()))) {
if ((random(5) > 2) || ((puppet.health <= 20) && (random(2) == 0))) {
setState(AISTATE_FLEE);
} else if (random(5) > 2) {
setState(AISTATE_APPROACH);
} else {
setState(AISTATE_EVADE);
}
aware = true;
} else {
if (puppet.action == Headmaster.ACTION_STAND) {
if (random(2) == 0) {
puppet.faceLeft();
} else {
puppet.faceRight();
}
}
setState(AISTATE_IDLE);
aware = false;
}
}
function setState(newState) {
super.setState(newState);
switch (aiState) {
case AISTATE_IDLE :
puppet.setAction(Headmaster.ACTION_STAND);
break;
case AISTATE_WANDER :
if (random(2) == 0) {
if (puppet.checkEdge(10)) {
puppet.__set__dir(1);
} else {
puppet.__set__dir(-1);
}
} else if (puppet.checkEdge(-10)) {
puppet.__set__dir(-1);
} else {
puppet.__set__dir(1);
}
puppet.setAction(Headmaster.ACTION_RUN);
break;
case AISTATE_FLEE :
puppet.faceActor(_global.game.world.player);
puppet.reverseDir();
puppet.setAction(Headmaster.ACTION_RUN);
break;
case AISTATE_APPROACH :
puppet.faceActor(_global.game.world.player);
puppet.setAction(Headmaster.ACTION_RUN);
break;
case AISTATE_ATTACK :
puppet.setAction(Headmaster.ACTION_ATTACK);
break;
case AISTATE_EVADE :
puppet.faceActor(_global.game.world.player);
puppet.setAction(HeadmasterBoss.ACTION_JUMP);
break;
}
}
static var AISTATE_IDLE = 1;
static var AISTATE_WANDER = 2;
static var AISTATE_FLEE = 3;
static var AISTATE_APPROACH = 4;
static var AISTATE_ATTACK = 5;
static var AISTATE_EVADE = 6;
static var AISTATE_STRINGS = Array("[NO STATE]", "AISTATE_IDLE", "AISTATE_WANDER", "AISTATE_FLEE", "AISTATE_APPROACH", "AISTATE_ATTACK", "AISTATE_EVADE");
}
Symbol 1499 MovieClip [__Packages.HeadmasterBoss] Frame 0
class HeadmasterBoss extends Enemy
{
var setAction, ai, onEnterFrame, exists, action, _alpha, _visible, destroy, updateActiveStatus, active, busy, dx, __get__dir, decelerateX, airborne, accelerateY, limitSpeedX, limitSpeedY, safeMoveX, unSafeMoveX, safeMoveY, dy, avoidCollisions, alive, attacking, animation, checkPlayerAttack, checkPlayerCollision, faceActor, uncollideCharacter, gotoAndStop, health;
function HeadmasterBoss () {
super(60, 24);
setAction(ACTION_STAND);
ai = new HeadmasterBossAI(this);
onEnterFrame = update;
}
function update() {
if ((!exists) && (action != ACTION_DIE)) {
_alpha = 0;
_visible = false;
destroy();
return(undefined);
}
if (exists && (_global.game.action != 7)) {
super.update();
updateActiveStatus();
if (active || (busy)) {
ai.update();
if (action == ACTION_RUN) {
dx = RUN_SPEED * __get__dir();
} else if (action != ACTION_JUMP) {
decelerateX(Character.FRICTION);
} else {
dx = 20 * __get__dir();
}
if (airborne) {
accelerateY(World.GRAVITY);
}
limitSpeedX();
limitSpeedY();
if (!airborne) {
safeMoveX(dx);
} else {
unSafeMoveX(dx);
}
safeMoveY(dy);
avoidCollisions();
if (alive) {
if (attacking) {
if (animation.attack != undefined) {
if (_global.game.world.player.isAttackable() && (animation.attack.hitTest(_global.game.world.player.solid))) {
_global.game.world.player.takeDamage(this, 15);
_global.game.sound.start("sfx_hit_2");
} else {
_global.game.sound.start("sfx_swoosh_2");
}
}
}
if (!airborne) {
checkPlayerAttack();
checkPlayerCollision();
}
}
}
}
}
function startFall() {
setAction(ACTION_FALL);
ai.react();
}
function stopFall() {
faceActor(_global.game.world.player);
setAction(ACTION_LAND);
ai.react();
}
function handlePlayerCollision() {
uncollideCharacter(_global.game.world.player, true);
faceActor(_global.game.world.player);
ai.react();
}
function handlePlayerAttack() {
ai.react();
}
function initAction() {
switch (action) {
case ACTION_STAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_RUN :
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("run");
break;
case ACTION_FALL :
airborne = true;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_ATTACK :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = true;
gotoAndStop("attack");
break;
case ACTION_HIT :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("hit");
break;
case ACTION_DIE :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
alive = false;
exists = false;
gotoAndStop("die");
break;
case ACTION_JUMP :
dx = 45 * __get__dir();
dy = -45;
airborne = true;
busy = true;
attacking = false;
gotoAndStop("jump");
break;
case ACTION_LAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("land");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_ATTACK :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_HIT :
if (random(2) == 0) {
setAction(ACTION_ATTACK);
} else if (random(2) == 0) {
setAction(ACTION_JUMP);
} else {
setAction(ACTION_STAND);
}
ai.react();
break;
case ACTION_JUMP :
setAction(ACTION_FALL);
ai.react();
break;
case ACTION_LAND :
if (random(2) == 0) {
setAction(ACTION_ATTACK);
} else {
setAction(ACTION_STAND);
}
ai.react();
break;
case ACTION_DIE :
destroy();
break;
}
}
function handleDamage() {
if (health > 0) {
setAction(ACTION_HIT);
} else {
setAction(ACTION_DIE);
}
}
static var ACTION_STAND = 1;
static var ACTION_RUN = 2;
static var ACTION_FALL = 3;
static var ACTION_ATTACK = 4;
static var ACTION_HIT = 5;
static var ACTION_DIE = 6;
static var ACTION_JUMP = 7;
static var ACTION_LAND = 8;
static var ACTION_STRINGS = new Array("ACTION_NONE", "ACTION_STAND", "ACTION_RUN", "ACTION_FALL", "ACTION_ATTACK", "ACTION_HIT", "ACTION_DIE", "ACTION_JUMP", "ACTION_LAND");
static var RUN_SPEED = 16;
}
Symbol 1500 MovieClip [__Packages.HeadmasterBossAI] Frame 0
class HeadmasterBossAI extends AI
{
var aiState, puppet, lookOutForPlayer, isPlayerAlive, canAttackPlayer, isFacingPlayer, aware, canSeePlayer;
function HeadmasterBossAI (char) {
super(char);
aiState = AISTATE_IDLE;
}
function update() {
super.update();
if (!puppet.busy) {
switch (aiState) {
case AISTATE_IDLE :
case AISTATE_WANDER :
lookOutForPlayer();
break;
case AISTATE_FLEE :
if (isPlayerAlive()) {
if (canAttackPlayer()) {
setState(AISTATE_ATTACK);
} else if (isFacingPlayer() && (puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_APPROACH :
if (isPlayerAlive()) {
if (canAttackPlayer()) {
setState(AISTATE_ATTACK);
} else if ((!isFacingPlayer()) && (!puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_ATTACK :
break;
case AISTATE_EVADE :
break;
}
}
}
function assess() {
super.assess();
if (puppet.airborne || (puppet.busy)) {
if (puppet.action == HeadmasterBoss.ACTION_JUMP) {
puppet.setAction(HeadmasterBoss.ACTION_LAND);
} else {
setState(AISTATE_IDLE);
}
} else if (aware || (canSeePlayer() && (isPlayerAlive()))) {
if ((random(5) > 2) || ((puppet.health <= 20) && (random(2) == 0))) {
setState(AISTATE_FLEE);
} else if (random(5) > 2) {
setState(AISTATE_APPROACH);
} else {
setState(AISTATE_EVADE);
}
aware = true;
} else {
if (puppet.action == Headmaster.ACTION_STAND) {
if (random(2) == 0) {
puppet.faceLeft();
} else {
puppet.faceRight();
}
}
setState(AISTATE_IDLE);
aware = false;
}
}
function setState(newState) {
super.setState(newState);
switch (aiState) {
case AISTATE_IDLE :
puppet.setAction(Headmaster.ACTION_STAND);
break;
case AISTATE_WANDER :
if (random(2) == 0) {
if (puppet.checkEdge(10)) {
puppet.__set__dir(1);
} else {
puppet.__set__dir(-1);
}
} else if (puppet.checkEdge(-10)) {
puppet.__set__dir(-1);
} else {
puppet.__set__dir(1);
}
puppet.setAction(Headmaster.ACTION_RUN);
break;
case AISTATE_FLEE :
puppet.faceActor(_global.game.world.player);
puppet.reverseDir();
puppet.setAction(Headmaster.ACTION_RUN);
break;
case AISTATE_APPROACH :
puppet.faceActor(_global.game.world.player);
puppet.setAction(Headmaster.ACTION_RUN);
break;
case AISTATE_ATTACK :
puppet.setAction(Headmaster.ACTION_ATTACK);
break;
case AISTATE_EVADE :
puppet.faceActor(_global.game.world.player);
puppet.setAction(HeadmasterBoss.ACTION_JUMP);
break;
}
}
static var AISTATE_IDLE = 1;
static var AISTATE_WANDER = 2;
static var AISTATE_FLEE = 3;
static var AISTATE_APPROACH = 4;
static var AISTATE_ATTACK = 5;
static var AISTATE_EVADE = 6;
static var AISTATE_STRINGS = Array("[NO STATE]", "AISTATE_IDLE", "AISTATE_WANDER", "AISTATE_FLEE", "AISTATE_APPROACH", "AISTATE_ATTACK", "AISTATE_EVADE");
}
Symbol 1501 MovieClip [__Packages.Headmaster] Frame 0
class Headmaster extends Enemy
{
var setAction, ai, onEnterFrame, exists, action, _alpha, _visible, destroy, updateActiveStatus, active, busy, dx, __get__dir, decelerateX, airborne, accelerateY, limitSpeedX, limitSpeedY, safeMoveX, safeMoveY, dy, avoidCollisions, alive, attacking, animation, checkPlayerAttack, checkPlayerCollision, uncollideCharacter, faceActor, gotoAndStop, health;
function Headmaster () {
super(60, 24);
setAction(ACTION_STAND);
ai = new HeadmasterAI(this);
onEnterFrame = update;
}
function update() {
if ((!exists) && (action != ACTION_DIE)) {
_alpha = 0;
_visible = false;
destroy();
return(undefined);
}
if (exists && (_global.game.action != 7)) {
super.update();
updateActiveStatus();
if (active || (busy)) {
ai.update();
if (action == ACTION_RUN) {
dx = RUN_SPEED * __get__dir();
} else {
decelerateX(Character.FRICTION);
}
if (airborne) {
accelerateY(World.GRAVITY);
}
limitSpeedX();
limitSpeedY();
safeMoveX(dx);
safeMoveY(dy);
avoidCollisions();
if (alive) {
if (attacking) {
if (animation.attack != undefined) {
if (_global.game.world.player.isAttackable() && (animation.attack.hitTest(_global.game.world.player.solid))) {
_global.game.world.player.takeDamage(this, 10);
_global.game.sound.start("sfx_hit_2");
} else {
_global.game.sound.start("sfx_swoosh_2");
}
}
}
checkPlayerAttack();
checkPlayerCollision();
}
}
}
}
function startFall() {
setAction(ACTION_FALL);
ai.react();
}
function stopFall() {
setAction(ACTION_STAND);
ai.react();
}
function handlePlayerCollision() {
uncollideCharacter(_global.game.world.player, true);
faceActor(_global.game.world.player);
ai.react();
}
function handlePlayerAttack() {
ai.react();
}
function initAction() {
switch (action) {
case ACTION_STAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_RUN :
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("run");
break;
case ACTION_FALL :
airborne = true;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_ATTACK :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = true;
gotoAndStop("attack");
break;
case ACTION_HIT :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("hit");
break;
case ACTION_DIE :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
alive = false;
exists = false;
gotoAndStop("die");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_ATTACK :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_HIT :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_DIE :
exists = false;
destroy();
break;
}
}
function handleDamage() {
if (health > 0) {
setAction(ACTION_HIT);
} else {
setAction(ACTION_DIE);
}
}
static var ACTION_STAND = 1;
static var ACTION_RUN = 2;
static var ACTION_FALL = 3;
static var ACTION_ATTACK = 4;
static var ACTION_HIT = 5;
static var ACTION_DIE = 6;
static var ACTION_STRINGS = new Array("ACTION_NONE", "ACTION_STAND", "ACTION_RUN", "ACTION_FALL", "ACTION_ATTACK", "ACTION_HIT", "ACTION_DIE");
static var RUN_SPEED = 16;
}
Symbol 1502 MovieClip [__Packages.HeadmasterAI] Frame 0
class HeadmasterAI extends AI
{
var aiState, puppet, lookOutForPlayer, isPlayerAlive, canAttackPlayer, isFacingPlayer, aware, canSeePlayer;
function HeadmasterAI (char) {
super(char);
aiState = AISTATE_IDLE;
}
function update() {
super.update();
if (!puppet.busy) {
switch (aiState) {
case AISTATE_IDLE :
case AISTATE_WANDER :
lookOutForPlayer();
break;
case AISTATE_FLEE :
if (isPlayerAlive()) {
if (canAttackPlayer() && (random(3) == 0)) {
setState(AISTATE_ATTACK);
} else if (isFacingPlayer() && (puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_APPROACH :
if (isPlayerAlive()) {
if (canAttackPlayer() && (random(3) == 0)) {
setState(AISTATE_ATTACK);
} else if ((!isFacingPlayer()) && (!puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_ATTACK :
break;
}
}
}
function assess() {
super.assess();
if (puppet.airborne || (puppet.busy)) {
setState(AISTATE_IDLE);
} else if (aware || (canSeePlayer() && (isPlayerAlive()))) {
if ((random(5) > 2) || ((puppet.health <= 20) && (random(6) == 0))) {
setState(AISTATE_FLEE);
} else {
setState(AISTATE_APPROACH);
}
aware = true;
} else {
if (puppet.action == Headmaster.ACTION_STAND) {
puppet.faceActor(_global.game.world.player);
}
setState(AISTATE_IDLE);
aware = false;
}
}
function setState(newState) {
super.setState(newState);
switch (aiState) {
case AISTATE_IDLE :
puppet.setAction(Headmaster.ACTION_STAND);
break;
case AISTATE_WANDER :
if (random(2) == 0) {
if (puppet.checkEdge(10)) {
puppet.__set__dir(1);
} else {
puppet.__set__dir(-1);
}
} else if (puppet.checkEdge(-10)) {
puppet.__set__dir(-1);
} else {
puppet.__set__dir(1);
}
puppet.setAction(Headmaster.ACTION_RUN);
break;
case AISTATE_FLEE :
puppet.faceActor(_global.game.world.player);
puppet.reverseDir();
puppet.setAction(Headmaster.ACTION_RUN);
break;
case AISTATE_APPROACH :
puppet.faceActor(_global.game.world.player);
puppet.setAction(Headmaster.ACTION_RUN);
break;
case AISTATE_ATTACK :
puppet.setAction(Headmaster.ACTION_ATTACK);
break;
}
}
static var AISTATE_IDLE = 1;
static var AISTATE_WANDER = 2;
static var AISTATE_FLEE = 3;
static var AISTATE_APPROACH = 4;
static var AISTATE_ATTACK = 5;
static var AISTATE_STRINGS = Array("[NO STATE]", "AISTATE_IDLE", "AISTATE_WANDER", "AISTATE_FLEE", "AISTATE_APPROACH", "AISTATE_ATTACK");
}
Symbol 1503 MovieClip [__Packages.World2Part4] Frame 0
class World2Part4 extends World
{
var boss;
function World2Part4 () {
super();
boss.health = 550;
}
function init() {
super.init();
}
function update() {
if (boss == undefined) {
_global.game.gameEvent_endWorld();
} else if (boss.health <= 0) {
if (!endSet) {
endSet = true;
endCounter = getTimer();
} else if ((getTimer() - endCounter) > 4500) {
_global.game.gameEvent_endWorld();
}
}
if (!shownBossText) {
shownBossText = true;
_global.game.hud.showBossText(2);
}
}
var endSet = false;
var endCounter = 0;
var shownBossText = false;
}
Symbol 1504 MovieClip [__Packages.Brute] Frame 0
class Brute extends Enemy
{
var setAction, ai, onEnterFrame, exists, action, _alpha, _visible, destroy, updateActiveStatus, active, busy, dx, __get__dir, decelerateX, airborne, accelerateY, limitSpeedX, limitSpeedY, safeMoveX, safeMoveY, dy, avoidCollisions, alive, attacking, animation, checkPlayerAttack, checkPlayerCollision, uncollideCharacter, faceActor, gotoAndStop, health;
function Brute () {
super(60, 55);
setAction(ACTION_STAND);
ai = new BruteAI(this);
onEnterFrame = update;
}
function update() {
if ((!exists) && (action != ACTION_DIE)) {
_alpha = 0;
_visible = false;
destroy();
return(undefined);
}
if (exists && (_global.game.action != 7)) {
super.update();
updateActiveStatus();
if (active || (busy)) {
ai.update();
if (action == ACTION_RUN) {
dx = RUN_SPEED * __get__dir();
} else {
decelerateX(Character.FRICTION);
}
if (airborne) {
accelerateY(World.GRAVITY);
}
limitSpeedX();
limitSpeedY();
safeMoveX(dx);
safeMoveY(dy);
avoidCollisions();
if (alive) {
if (attacking) {
if (animation.attack != undefined) {
if (_global.game.world.player.isAttackable() && (animation.attack.hitTest(_global.game.world.player.solid))) {
_global.game.world.player.takeDamage(this, 10);
_global.game.sound.start("sfx_hit_2");
} else {
_global.game.sound.start("sfx_swoosh_2");
}
}
}
checkPlayerAttack();
checkPlayerCollision();
}
}
}
}
function startFall() {
setAction(ACTION_FALL);
ai.react();
}
function stopFall() {
setAction(ACTION_STAND);
ai.react();
}
function handlePlayerCollision() {
uncollideCharacter(_global.game.world.player, true);
faceActor(_global.game.world.player);
ai.react();
}
function handlePlayerAttack() {
ai.react();
}
function initAction() {
switch (action) {
case ACTION_STAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_RUN :
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("run");
break;
case ACTION_FALL :
airborne = true;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_ATTACK :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = true;
gotoAndStop("attack");
break;
case ACTION_HIT :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("hit");
break;
case ACTION_DIE :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
alive = false;
exists = false;
gotoAndStop("die");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_ATTACK :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_HIT :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_DIE :
exists = false;
destroy();
break;
}
}
function handleDamage() {
if (health > 0) {
setAction(ACTION_HIT);
} else {
setAction(ACTION_DIE);
}
}
static var ACTION_STAND = 1;
static var ACTION_RUN = 2;
static var ACTION_FALL = 3;
static var ACTION_ATTACK = 4;
static var ACTION_HIT = 5;
static var ACTION_DIE = 6;
static var ACTION_STRINGS = new Array("ACTION_NONE", "ACTION_STAND", "ACTION_RUN", "ACTION_FALL", "ACTION_ATTACK", "ACTION_HIT", "ACTION_DIE");
static var RUN_SPEED = 12;
}
Symbol 1505 MovieClip [__Packages.BruteAI] Frame 0
class BruteAI extends AI
{
var aiState, puppet, lookOutForPlayer, isPlayerAlive, canAttackPlayer, isFacingPlayer, aware, canSeePlayer;
function BruteAI (char) {
super(char);
aiState = AISTATE_IDLE;
}
function update() {
super.update();
if (!puppet.busy) {
switch (aiState) {
case AISTATE_IDLE :
case AISTATE_WANDER :
lookOutForPlayer();
break;
case AISTATE_FLEE :
if (isPlayerAlive()) {
if (canAttackPlayer() && (random(4) == 0)) {
setState(AISTATE_ATTACK);
} else if (isFacingPlayer() && (puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_APPROACH :
if (isPlayerAlive()) {
if (canAttackPlayer() && (random(4) == 0)) {
setState(AISTATE_ATTACK);
} else if ((!isFacingPlayer()) && (!puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_ATTACK :
break;
}
}
}
function assess() {
super.assess();
if (puppet.airborne || (puppet.busy)) {
setState(AISTATE_IDLE);
} else if (aware || (canSeePlayer() && (isPlayerAlive()))) {
if ((random(5) > 2) || ((puppet.health <= 20) && (random(2) == 0))) {
setState(AISTATE_FLEE);
} else {
setState(AISTATE_APPROACH);
}
aware = true;
} else {
if (puppet.action == Brute.ACTION_STAND) {
if (random(2) == 0) {
puppet.faceLeft();
} else {
puppet.faceRight();
}
}
setState(AISTATE_IDLE);
aware = false;
}
}
function setState(newState) {
super.setState(newState);
switch (aiState) {
case AISTATE_IDLE :
puppet.setAction(Brute.ACTION_STAND);
break;
case AISTATE_WANDER :
if (random(2) == 0) {
if (puppet.checkEdge(10)) {
puppet.__set__dir(1);
} else {
puppet.__set__dir(-1);
}
} else if (puppet.checkEdge(-10)) {
puppet.__set__dir(-1);
} else {
puppet.__set__dir(1);
}
puppet.setAction(Brute.ACTION_RUN);
break;
case AISTATE_FLEE :
puppet.faceActor(_global.game.world.player);
puppet.reverseDir();
puppet.setAction(Brute.ACTION_RUN);
break;
case AISTATE_APPROACH :
puppet.faceActor(_global.game.world.player);
puppet.setAction(Brute.ACTION_RUN);
break;
case AISTATE_ATTACK :
puppet.setAction(Brute.ACTION_ATTACK);
break;
}
}
static var AISTATE_IDLE = 1;
static var AISTATE_WANDER = 2;
static var AISTATE_FLEE = 3;
static var AISTATE_APPROACH = 4;
static var AISTATE_ATTACK = 5;
static var AISTATE_STRINGS = Array("[NO STATE]", "AISTATE_IDLE", "AISTATE_WANDER", "AISTATE_FLEE", "AISTATE_APPROACH", "AISTATE_ATTACK");
}
Symbol 1506 MovieClip [__Packages.Thug] Frame 0
class Thug extends Enemy
{
var setAction, ai, health, onEnterFrame, exists, action, _alpha, _visible, destroy, updateActiveStatus, active, busy, dx, __get__dir, decelerateX, airborne, accelerateY, limitSpeedX, limitSpeedY, safeMoveX, safeMoveY, dy, avoidCollisions, alive, attacking, animation, checkPlayerAttack, checkPlayerCollision, uncollideCharacter, faceActor, gotoAndStop;
function Thug () {
super(60, 24);
setAction(ACTION_STAND);
ai = new ThugAI(this);
health = 75;
onEnterFrame = update;
}
function update() {
if ((!exists) && (action != ACTION_DIE)) {
_alpha = 0;
_visible = false;
destroy();
return(undefined);
}
if (exists && (_global.game.action != 7)) {
super.update();
updateActiveStatus();
if (active || (busy)) {
ai.update();
if (action == ACTION_RUN) {
dx = RUN_SPEED * __get__dir();
} else {
decelerateX(Character.FRICTION);
}
if (airborne) {
accelerateY(World.GRAVITY);
}
limitSpeedX();
limitSpeedY();
safeMoveX(dx);
safeMoveY(dy);
avoidCollisions();
if (alive) {
if (attacking) {
if (animation.attack != undefined) {
if (_global.game.world.player.isAttackable() && (animation.attack.hitTest(_global.game.world.player.solid))) {
_global.game.world.player.takeDamage(this, 10);
_global.game.sound.start("sfx_hit_2");
} else {
_global.game.sound.start("sfx_swoosh_2");
}
}
}
checkPlayerAttack();
checkPlayerCollision();
}
}
}
}
function startFall() {
setAction(ACTION_FALL);
ai.react();
}
function stopFall() {
setAction(ACTION_STAND);
ai.react();
}
function handlePlayerCollision() {
uncollideCharacter(_global.game.world.player, true);
faceActor(_global.game.world.player);
ai.react();
}
function handlePlayerAttack() {
ai.react();
}
function initAction() {
switch (action) {
case ACTION_STAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_RUN :
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("run");
break;
case ACTION_FALL :
airborne = true;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_ATTACK :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = true;
gotoAndStop("attack");
break;
case ACTION_HIT :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("hit");
break;
case ACTION_DIE :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
alive = false;
exists = false;
gotoAndStop("die");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_ATTACK :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_HIT :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_DIE :
exists = false;
destroy();
break;
}
}
function handleDamage() {
if (health > 0) {
setAction(ACTION_HIT);
} else {
setAction(ACTION_DIE);
}
}
static var ACTION_STAND = 1;
static var ACTION_RUN = 2;
static var ACTION_FALL = 3;
static var ACTION_ATTACK = 4;
static var ACTION_HIT = 5;
static var ACTION_DIE = 6;
static var ACTION_STRINGS = new Array("ACTION_NONE", "ACTION_STAND", "ACTION_RUN", "ACTION_FALL", "ACTION_ATTACK", "ACTION_HIT", "ACTION_DIE");
static var RUN_SPEED = 16;
}
Symbol 1507 MovieClip [__Packages.ThugAI] Frame 0
class ThugAI extends AI
{
var aiState, puppet, lookOutForPlayer, isPlayerAlive, canAttackPlayer, isFacingPlayer, aware, canSeePlayer;
function ThugAI (char) {
super(char);
aiState = AISTATE_IDLE;
}
function update() {
super.update();
if (!puppet.busy) {
switch (aiState) {
case AISTATE_IDLE :
case AISTATE_WANDER :
lookOutForPlayer();
break;
case AISTATE_FLEE :
if (isPlayerAlive()) {
if (canAttackPlayer() && (random(6) > 2)) {
setState(AISTATE_ATTACK);
} else if (isFacingPlayer() && (puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_APPROACH :
if (isPlayerAlive()) {
if (canAttackPlayer() && (random(6) > 2)) {
setState(AISTATE_ATTACK);
} else if ((!isFacingPlayer()) && (!puppet.inRangeX(_global.game.world.player, 150))) {
assess();
}
}
break;
case AISTATE_ATTACK :
break;
}
}
}
function assess() {
super.assess();
if (puppet.airborne || (puppet.busy)) {
setState(AISTATE_IDLE);
} else if (aware || (canSeePlayer() && (isPlayerAlive()))) {
if ((random(5) > 2) || ((puppet.health <= 20) && (random(2) == 0))) {
setState(AISTATE_FLEE);
} else {
setState(AISTATE_APPROACH);
}
aware = true;
} else {
if (puppet.action == Thug.ACTION_STAND) {
if (random(2) == 0) {
puppet.faceLeft();
} else {
puppet.faceRight();
}
}
setState(AISTATE_IDLE);
aware = false;
}
}
function setState(newState) {
super.setState(newState);
switch (aiState) {
case AISTATE_IDLE :
puppet.setAction(Thug.ACTION_STAND);
break;
case AISTATE_WANDER :
if (random(2) == 0) {
if (puppet.checkEdge(10)) {
puppet.__set__dir(1);
} else {
puppet.__set__dir(-1);
}
} else if (puppet.checkEdge(-10)) {
puppet.__set__dir(-1);
} else {
puppet.__set__dir(1);
}
puppet.setAction(Thug.ACTION_RUN);
break;
case AISTATE_FLEE :
puppet.faceActor(_global.game.world.player);
puppet.reverseDir();
puppet.setAction(Thug.ACTION_RUN);
break;
case AISTATE_APPROACH :
puppet.faceActor(_global.game.world.player);
puppet.setAction(Thug.ACTION_RUN);
break;
case AISTATE_ATTACK :
puppet.setAction(Thug.ACTION_ATTACK);
break;
}
}
static var AISTATE_IDLE = 1;
static var AISTATE_WANDER = 2;
static var AISTATE_FLEE = 3;
static var AISTATE_APPROACH = 4;
static var AISTATE_ATTACK = 5;
static var AISTATE_STRINGS = Array("[NO STATE]", "AISTATE_IDLE", "AISTATE_WANDER", "AISTATE_FLEE", "AISTATE_APPROACH", "AISTATE_ATTACK");
}
Symbol 1508 MovieClip [__Packages.World3Part1] Frame 0
class World3Part1 extends World
{
var orphansRequried, bo_cop1, bo_cop2, bo_cop3;
function World3Part1 () {
super();
orphansRequried = 20;
}
function init() {
super.init();
}
function update() {
if (!breakOut_done) {
if (((bo_cop1 == undefined) && (bo_cop2 == undefined)) && (bo_cop3 == undefined)) {
if (_global.game.world.player.startWarp()) {
_global.game.backtogame = true;
_global.game.sound.start("sfx_tom_umbrella");
breakOut_done = true;
}
} else if (((bo_cop1.health <= 0) && (bo_cop2.health <= 0)) && (bo_cop3.health <= 0)) {
if (!endSet) {
endSet = true;
endCounter = getTimer();
} else if ((getTimer() - endCounter) > 4500) {
if (_global.game.world.player.startWarp()) {
_global.game.backtogame = true;
_global.game.sound.start("sfx_tom_umbrella");
breakOut_done = true;
}
}
}
}
}
var endSet = false;
var endCounter = 0;
var breakOut_done = false;
}
Symbol 1509 MovieClip [__Packages.World4Part1] Frame 0
class World4Part1 extends World
{
var orphansRequried, bo_cop1, bo_cop2, bo_cop3;
function World4Part1 () {
super();
orphansRequried = 20;
}
function init() {
super.init();
}
function update() {
if (!breakOut_done) {
if (((bo_cop1 == undefined) && (bo_cop2 == undefined)) && (bo_cop3 == undefined)) {
if (_global.game.world.player.startWarp()) {
_global.game.backtogame = true;
_global.game.sound.start("sfx_tom_umbrella");
breakOut_done = true;
}
} else if (((bo_cop1.health <= 0) && (bo_cop2.health <= 0)) && (bo_cop3.health <= 0)) {
if (!endSet) {
endSet = true;
endCounter = getTimer();
} else if ((getTimer() - endCounter) > 4500) {
if (_global.game.world.player.startWarp()) {
_global.game.backtogame = true;
_global.game.sound.start("sfx_tom_umbrella");
breakOut_done = true;
}
}
}
}
}
var endSet = false;
var endCounter = 0;
var breakOut_done = false;
}
Symbol 1510 MovieClip [__Packages.ArtfulDodgerMiniBoss] Frame 0
class ArtfulDodgerMiniBoss extends Enemy
{
var setAction, ai, onEnterFrame, exists, _alpha, _visible, updateActiveStatus, active, busy, action, dx, __get__dir, decelerateX, airborne, accelerateY, limitSpeedX, limitSpeedY, safeMoveX, unSafeMoveX, safeMoveY, dy, avoidCollisions, alive, attacking, animation, checkPlayerAttack, checkPlayerCollision, faceActor, uncollideCharacter, gotoAndStop, destroy, health;
function ArtfulDodgerMiniBoss () {
super(60, 24);
deathTimer = getTimer() + 15000;
setAction(ACTION_JUMP);
ai = new ArtfulDodgerMiniBossAI(this);
onEnterFrame = update;
}
function update() {
if (!exists) {
_alpha = 0;
_visible = false;
return(undefined);
}
if (deathTimer < getTimer()) {
setAction(ACTION_FLEE);
}
super.update();
updateActiveStatus();
if (active || (busy)) {
ai.update();
if (action == ACTION_RUN) {
dx = RUN_SPEED * __get__dir();
} else if (action != ACTION_JUMP) {
decelerateX(Character.FRICTION);
} else {
dx = 20 * __get__dir();
}
if (airborne && (action != ACTION_FLEE)) {
accelerateY(World.GRAVITY);
}
limitSpeedX();
limitSpeedY();
if (!airborne) {
safeMoveX(dx);
} else {
unSafeMoveX(dx);
}
safeMoveY(dy);
avoidCollisions();
if (alive) {
if (attacking) {
if (animation.attack != undefined) {
if (_global.game.world.player.isAttackable() && (animation.attack.hitTest(_global.game.world.player.solid))) {
_global.game.world.player.takeDamage(this, 15);
_global.game.sound.start("sfx_hit_2");
_global.game.world.player.spawnOrphan(10);
setAction(ACTION_STAND);
} else {
_global.game.sound.start("sfx_swoosh_2");
}
}
}
if (!airborne) {
checkPlayerAttack();
checkPlayerCollision();
}
}
}
}
function startFall() {
if (action == ACTION_FLEE) {
actionDone();
} else {
setAction(ACTION_FALL);
ai.react();
}
}
function stopFall() {
faceActor(_global.game.world.player);
setAction(ACTION_LAND);
ai.react();
}
function handlePlayerCollision() {
uncollideCharacter(_global.game.world.player, true);
faceActor(_global.game.world.player);
ai.react();
}
function handlePlayerAttack() {
ai.react();
}
function initAction() {
switch (action) {
case ACTION_STAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_RUN :
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("run");
break;
case ACTION_FALL :
airborne = true;
busy = false;
attacking = false;
gotoAndStop("stand");
break;
case ACTION_ATTACK :
dx = 0;
dy = 0;
airborne = false;
busy = true;
attacking = true;
gotoAndStop("attack");
break;
case ACTION_HIT :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
gotoAndStop("hit");
break;
case ACTION_DIE :
dx = -30 * __get__dir();
dy = 0;
airborne = false;
busy = true;
attacking = false;
alive = false;
gotoAndStop("die");
break;
case ACTION_JUMP :
dx = 45 * __get__dir();
dy = -45;
airborne = true;
busy = true;
attacking = false;
gotoAndStop("jump");
break;
case ACTION_LAND :
dx = 0;
dy = 0;
airborne = false;
busy = false;
attacking = false;
gotoAndStop("land");
break;
case ACTION_FLEE :
dx = 95 * __get__dir();
dy = -55;
airborne = true;
busy = true;
attacking = false;
gotoAndStop("flee");
break;
case Sprite.ACTION_NONE :
break;
}
}
function actionDone() {
switch (action) {
case ACTION_ATTACK :
setAction(ACTION_STAND);
ai.react();
break;
case ACTION_HIT :
if (random(2) == 0) {
setAction(ACTION_ATTACK);
} else if (random(2) == 0) {
setAction(ACTION_JUMP);
} else {
setAction(ACTION_STAND);
}
ai.react();
break;
case ACTION_JUMP :
setAction(ACTION_FALL);
ai.react();
break;
case ACTION_LAND :
if (random(2) == 0) {
setAction(ACTION_ATTACK);
} else {
setAction(ACTION_STAND);
}
ai.react();
break;
case ACTION_FLEE :
_global.game.sound.stop("music_action");
if (_global.musicOn) {
_global.game.sound.start(_global.game.music, 65);
}
destroy();
break;
case ACTION_DIE :
_global.game.sound.stop("music_action");
if (_global.musicOn) {
_global.game.sound.start(_global.game.music, 65);
}
destroy();
break;
}
}
function handleDamage() {
if (health > 0) {
setAction(ACTION_HIT);
} else {
setAction(ACTION_FLEE);
}
}
static var ACTION_STAND = 1;
static var ACTION_RUN = 2;
static var ACTION_FALL = 3;
static var ACTION_ATTACK = 4;
static var ACTION_HIT = 5;
static var ACTION_DIE = 6;
static var ACTION_JUMP = 7;
static var ACTION_LAND = 8;
static var ACTION_FLEE = 9;
static var ACTION_STRINGS = new Array("ACTION_NONE", "ACTION_STAND", "ACTION_RUN", "ACTION_FALL", "ACTION_ATTACK", "ACTION_HIT", "ACTION_DIE", "ACTION_JUMP", "ACTION_LAND", "ACTION_FLEE");
static var RUN_SPEED = 20;
var deathTimer = 0;
}
Symbol 1511 MovieClip [__Packages.ArtfulDodgerMiniBossAI] Frame 0
class ArtfulDodgerMiniBossAI extends AI
{
var aiState, puppet, lookOutForPlayer, isPlayerAlive, canAttackPlayer, isFacingPlayer, aware, canSeePlayer;
function ArtfulDodgerMiniBossAI (char) {
super(char);
aiState = AISTATE_IDLE;
}
function update() {
super.update();
if (!puppet.busy) {
switch (aiState) {
case AISTATE_IDLE :
case AISTATE_WANDER :
lookOutForPlayer();
break;
case AISTATE_FLEE :
if (isPlayerAlive()) {
if (canAttackPlayer()) {
setState(AISTATE_ATTACK);
} else if (isFacingPlayer() && (puppet.inRangeX(_global.game.world.player, 450))) {
assess();
}
}
break;
case AISTATE_APPROACH :
if (isPlayerAlive()) {
if (canAttackPlayer()) {
setState(AISTATE_ATTACK);
} else if ((!isFacingPlayer()) && (!puppet.inRangeX(_global.game.world.player, 450))) {
assess();
}
}
break;
case AISTATE_ATTACK :
break;
case AISTATE_EVADE :
break;
}
}
}
function assess() {
super.assess();
if (puppet.airborne || (puppet.busy)) {
if (puppet.action == HeadmasterBoss.ACTION_JUMP) {
puppet.setAction(HeadmasterBoss.ACTION_LAND);
} else {
setState(AISTATE_IDLE);
}
} else if (aware || (canSeePlayer() && (isPlayerAlive()))) {
if ((puppet.health <= 20) && (random(2) == 0)) {
setState(AISTATE_FLEE);
} else if (random(10) > 2) {
setState(AISTATE_APPROACH);
} else {
setState(AISTATE_EVADE);
}
aware = true;
} else {
if (puppet.action == Headmaster.ACTION_STAND) {
puppet.faceActor(_global.game.world.player);
}
setState(AISTATE_APPROACH);
aware = false;
}
}
function setState(newState) {
super.setState(newState);
switch (aiState) {
case AISTATE_IDLE :
puppet.setAction(Headmaster.ACTION_STAND);
break;
case AISTATE_WANDER :
if (random(2) == 0) {
if (puppet.checkEdge(10)) {
puppet.__set__dir(1);
} else {
puppet.__set__dir(-1);
}
} else if (puppet.checkEdge(-10)) {
puppet.__set__dir(-1);
} else {
puppet.__set__dir(1);
}
puppet.setAction(Headmaster.ACTION_RUN);
break;
case AISTATE_FLEE :
puppet.faceActor(_global.game.world.player);
puppet.reverseDir();
puppet.setAction(Headmaster.ACTION_RUN);
break;
case AISTATE_APPROACH :
puppet.faceActor(_global.game.world.player);
puppet.setAction(Headmaster.ACTION_RUN);
break;
case AISTATE_ATTACK :
puppet.setAction(Headmaster.ACTION_ATTACK);
break;
case AISTATE_EVADE :
puppet.faceActor(_global.game.world.player);
puppet.setAction(HeadmasterBoss.ACTION_JUMP);
break;
}
}
static var AISTATE_IDLE = 1;
static var AISTATE_WANDER = 2;
static var AISTATE_FLEE = 3;
static var AISTATE_APPROACH = 4;
static var AISTATE_ATTACK = 5;
static var AISTATE_EVADE = 6;
static var AISTATE_STRINGS = Array("[NO STATE]", "AISTATE_IDLE", "AISTATE_WANDER", "AISTATE_FLEE", "AISTATE_APPROACH", "AISTATE_ATTACK", "AISTATE_EVADE");
var AWARENESS_RANGE_X = 1200;
var AWARENESS_RANGE_Y = 800;
}
Symbol 1512 MovieClip [__Packages.Game] Frame 0
class Game extends Sprite
{
var setAction, viewRect, activeRect, viewExtents, orphans, enemies, items, projectiles, inactive, sound, music, worlds, world, onEnterFrame, exitCombo, flyCombo, snapView, hud, action, getActionElapsed, getNextHighestDepth, gotoAndStop, gotoAndPlay;
function Game () {
super();
_global.game = this;
setAction(ACTION_INIT);
viewRect = new flash.geom.Rectangle();
activeRect = new flash.geom.Rectangle();
viewExtents = new flash.geom.Rectangle();
orphans = new Array();
enemies = new Array();
items = new Array();
projectiles = new Array();
inactive = new Array();
_root.oracleText = "Defualt Oracle Text";
sound = new SoundManager(this);
sound.setVolume(100);
sound.add("sfx_hit_1", 80, false);
sound.add("sfx_hit_2", 80, false);
sound.add("sfx_hit_3", 80, false);
sound.add("sfx_hit_4", 80, false);
sound.add("sfx_orphan_yelp_1", 50, false);
sound.add("sfx_orphan_yelp_2", 50, false);
sound.add("sfx_orphan_yelp_3", 50, false);
sound.add("sfx_orphan_yelp_4", 50, false);
sound.add("sfx_police_whistle", 60, false);
sound.add("sfx_punch_1", 60, false);
sound.add("sfx_punch_2", 60, false);
sound.add("sfx_sack_open", 60, false);
sound.add("sfx_skinnyhooker_laugh", 60, false);
sound.add("sfx_swoosh_1", 40, false);
sound.add("sfx_swoosh_2", 80, false);
sound.add("sfx_tom_grunt_1", 70, false);
sound.add("sfx_tom_grunt_2", 70, false);
sound.add("sfx_tom_hit_1", 70, false);
sound.add("sfx_tom_hit_2", 70, false);
sound.add("sfx_tom_hit_3", 70, false);
sound.add("sfx_tom_hit_4", 70, false);
sound.add("sfx_tom_jump_1", 70, false);
sound.add("sfx_tom_jump_2", 70, false);
sound.add("sfx_tom_land", 70, false);
sound.add("sfx_tom_throw", 70, false);
sound.add("sfx_tom_umbrella", 70, false);
sound.add("sfx_absinthe", 50, false);
sound.add("sfx_wood_1", 40, false);
sound.add("sfx_ding", 40, false);
sound.add("sfx_glass_break_1", 40, false);
sound.add("sfx_pie_splat_1", 20, false);
sound.add("sfx_metal_door", 70, false);
sound.add("sfx_bite", 60, false);
sound.add("music_action", 30, true);
if ((_global.worldID == 1) && (_global.partID == 3)) {
music = "music_boss";
} else if ((_global.worldID == 4) && (_global.partID == 3)) {
music = "music_boss";
} else if ((_global.worldID == 3) && (_global.partID == 2)) {
music = "music_boss";
} else if (_global.worldID == 1) {
music = "music_factory";
} else if (_global.worldID == 2) {
music = "music_streets";
} else if (_global.worldID == 3) {
music = "music_orphanage";
} else if (_global.worldID == 4) {
music = "music_restaurant";
}
if (_global.musicOn) {
sound.add(music, 50, true);
}
worlds.gotoAndStop("init");
worlds.gotoAndStop((("world_" + _global.worldID) + "_") + _global.partID);
world = worlds.world;
_root.game.worlds.world.endDoor.gotoAndStop(2);
disableTip = false;
Key.addListener(this);
onEnterFrame = init;
}
function onLoad() {
}
function onUnload() {
sound.destroy();
delete sound;
}
function onKeyDown() {
var _local3 = Key.getCode();
if (exitCombo.check(_local3)) {
_root.gotoAndStop("title");
}
if (flyCombo.check(_local3)) {
world.player.toggleFlying();
}
}
function init() {
initWorld();
initHUD();
update();
sound.start(music);
onEnterFrame = update;
}
function initWorld() {
var _local2 = world.extents.getRect(world);
trace("extents.xmin=" + _local2.xMin);
trace("extents.yMin=" + _local2.yMin);
viewExtents.x = _local2.xMin;
viewExtents.y = _local2.yMin;
viewExtents.width = _local2.xMax - _local2.xMin;
viewExtents.height = _local2.yMax - _local2.yMin;
viewExtents.inflate(-HALF_WIDTH, -HALF_HEIGHT);
snapView = true;
}
function restartWorld() {
setAction(ACTION_IN);
initWorld();
}
function nextWorld() {
trace("#########function nextWorld()##############");
trace(("_global.worldID=\u3010" + _global.worldID) + "\u3011");
trace(("_global.partID=\u3010" + _global.partID) + "\u3011");
if (_global.worldID == 2) {
if (_global.partID == 4) {
_root.currentCutscene = 5;
_root.gotoAndPlay("cutscene");
} else {
_global.partID++;
_root.currentCutscene = _global.partID;
_root.gotoAndPlay("cutscene");
}
} else if (_global.worldID == 3) {
if (_global.partID == 2) {
_root.currentCutscene = 8;
_root.gotoAndPlay("cutscene");
} else {
_global.partID++;
_root.currentCutscene = _global.partID + 4;
_root.gotoAndPlay("cutscene");
}
} else {
_root.currentCutscene = 8;
_root.gotoAndPlay("cutscene");
}
}
function initHUD() {
hud.setHealth(100);
hud.setMusic(_global.musicOn);
if ((_global.worldID == 4) && (_global.partID == 3)) {
hud.changeFrame(2);
hud.changeOrphansCarried(0, 10);
} else if (_global.worldID >= 3) {
hud.changeFrame(3);
hud.changeOrphansCarried(0, EvilMinon.ORPHAN_COUNT_MAX);
hud.changeOrphansCaptured(0, world.orphansRequried);
} else {
hud.changeFrame(1);
hud.changeOrphansCarried(0, EvilMinon.ORPHAN_COUNT_MAX);
hud.changeOrphansCaptured(0, world.orphansRequried);
}
hud.setLives(_global.lives);
hud.hideLairText();
hud.hideBossText();
}
function update() {
frame++;
switch (action) {
case ACTION_INIT :
setAction(ACTION_IN);
break;
case ACTION_IN :
updateView();
break;
case ACTION_PLAY :
updateView();
if (_global.game.breakTimer) {
var _local9 = 14 - int((getTimer() - _global.game.breakTime) / 1000);
var _local10 = 99 - int(((getTimer() - _global.game.breakTime) % 1000) / 10);
if (_local9 < 0) {
_local9 = 0;
}
if (_local10 < 0) {
_local10 = 0;
}
_root.game.hud_timer._alpha = 100;
_root.game.hud_timer.time_left.text = (_local9 + ":") + _local10;
if ((getTimer() - _global.game.breakTime) > 15000) {
_root.game.hud_timer._alpha = 0;
_global.game.breakTimer = false;
_global.game.gotolair = false;
_global.game.respawnOrphans = 5;
_global.game.sound.stop("music_action");
if (_global.musicOn) {
_global.game.sound.start(_global.game.music, 65);
}
_global.game.sound.start("sfx_tom_grunt_1");
_global.game.hud.showLairText(5);
}
} else if (_global.game.respawnOrphans > 0) {
if ((getActionElapsed() % 3) == 0) {
var _local5 = false;
do {
if ((in _global.game.worlds.world) == null) {
break;
}
var _local8 = in _global.game.worlds.world;
if (typeof(_global.game.worlds.world[_local8]) == "movieclip") {
if ((_global.game.worlds.world[_local8].npcType == "orphan") && (_global.game.worlds.world[_local8].isDead)) {
_global.game.worlds.world[_local8].makeAlive();
_local5 = true;
}
}
} while (!_local5);
do {
} while ("update" != null);
orphansCaught--;
hud.changeOrphansCaptured(orphansCaught, world.orphansRequried);
_global.game.respawnOrphans--;
_global.game.sound.start("sfx_sack_open");
}
}
if (((frame % 16) == 0) || (snapView)) {
var _local6 = _global.game.world.player._x;
var _local7 = _global.game.world.player._y;
for (var _local8 in _global.game.worlds.world) {
if (typeof(_global.game.worlds.world[_local8]) == "movieclip") {
var _local4 = _local8.substr(0, 4);
if ((((((((_global.game.worlds.world[_local8].thisisliving == undefined) && (_local4 != "show")) && (_local8 != "player")) && (_local8 != "extends")) && (_local8 != "solid")) && (_local8 != "background")) && (_local8 != "foreground")) && (_local8 != "boss")) {
if (Math.abs(_global.game.worlds.world[_local8]._x - _local6) > 1400) {
_global.game.worlds.world[_local8]._visible = false;
} else if (Math.abs(_global.game.worlds.world[_local8]._y - _local7) > 1600) {
_global.game.worlds.world[_local8]._visible = false;
} else {
_global.game.worlds.world[_local8]._visible = true;
}
}
}
}
}
break;
case ACTION_DEATH :
updateView();
if (getActionElapsed() > 120) {
if (gameover) {
setAction(ACTION_OUT);
} else {
world.player.revive();
setAction(ACTION_PLAY);
}
}
break;
case ACTION_WARP :
updateView();
_global.game.world.player._visible = true;
_global.game.world.player._alpha = 100;
if (getActionElapsed() > 30) {
if ((!gotolair) && (!backtogame)) {
if (world.player.getOrphanCount() > 0) {
if ((getActionElapsed() % 3) == 0) {
_global.game.sound.start("sfx_sack_open");
orphansCaptured = world.player.getOrphanCount() - 1;
world.player.setOrphanCount(orphansCaptured);
orphansCaught++;
hud.changeOrphansCarried(orphansCaptured, EvilMinon.ORPHAN_COUNT_MAX);
hud.changeOrphansCaptured(orphansCaught, world.orphansRequried);
if (orphansCaptured <= 0) {
if (orphansCaught < world.orphansRequried) {
world.player.startUnwarp();
setAction(ACTION_PLAY);
} else {
gameEvent_displaySnatched();
world.player.startUnwarp();
setAction(ACTION_PLAY);
}
}
}
} else {
world.player.startUnwarp();
setAction(ACTION_PLAY);
}
} else if (world.player.getOrphanCount() > 0) {
if ((getActionElapsed() % 3) == 0) {
_global.game.sound.start("sfx_sack_open");
orphansCaptured = world.player.getOrphanCount() - 1;
world.player.setOrphanCount(orphansCaptured);
orphansCaught++;
hud.changeOrphansCarried(orphansCaptured, EvilMinon.ORPHAN_COUNT_MAX);
hud.changeOrphansCaptured(orphansCaught, world.orphansRequried);
if (orphansCaptured <= 0) {
if (orphansCaught < world.orphansRequried) {
setAction(ACTION_OUT);
} else {
if (backtogame) {
gameEvent_displaySnatched();
}
setAction(ACTION_OUT);
}
}
}
} else {
setAction(ACTION_OUT);
}
}
break;
case ACTION_PAUSED :
break;
case ACTION_OUT :
updateView();
}
cleanUpWorld();
}
function cleanUpWorld() {
while (inactive.length) {
var _local2 = Actor(inactive.pop());
var _local3 = _local2._name;
if (_local2.getDepth() < 0) {
_local2.swapDepths(getNextHighestDepth());
}
_local2.removeMovieClip();
}
}
function updateView() {
if (world.player.isPressingUp()) {
viewLookUpDelay++;
} else {
viewLookUpDelay = 0;
}
if (world.player.isPressingDown()) {
viewLookDownDelay++;
} else {
viewLookDownDelay = 0;
}
var _local7 = world.player.dir * 150;
var _local2 = -80;
if (world.player.airborne && (world.player.dy > -5)) {
_local2 = 80;
}
if (viewLookDownDelay > 20) {
_local2 = _local2 + (Math.round(Math.min(Math.max(0, viewLookDownDelay - 20), 40) / 40) * 100);
} else if (viewLookUpDelay > 20) {
_local2 = _local2 + (Math.round(Math.min(Math.max(0, viewLookUpDelay - 20), 40) / 40) * -100);
}
var _local4 = world.player._x + _local7;
var _local5 = world.player._y + _local2;
if (snapView) {
snapView = false;
viewX = _local4;
viewY = _local5;
} else {
var _local6 = _local4 - viewX;
var _local3 = _local5 - viewY;
if (Math.abs(_local6) < 1) {
viewX = _local4;
} else {
viewX = viewX + int(_local6 * 0.2);
}
if (Math.abs(_local3) < 1) {
viewY = _local5;
} else if (world.player.airborne) {
if (world.player.dy == 50) {
viewY = int(viewY + (_local3 * 0.2));
} else if (world.player.dy > -5) {
viewY = int(viewY + (_local3 * 0.08));
} else {
viewY = int(viewY + (_local3 * 0.04));
}
} else {
viewY = int(viewY + (_local3 * 0.2));
}
}
viewX = Math.max(viewExtents.left, Math.min(viewExtents.right, viewX));
viewY = Math.max(viewExtents.top, Math.min(viewExtents.bottom, viewY));
viewRect.left = viewX - HALF_WIDTH;
viewRect.right = viewX + HALF_WIDTH;
viewRect.top = viewY - HALF_HEIGHT;
viewRect.bottom = viewY + HALF_HEIGHT;
activeRect.left = viewRect.left - 300;
activeRect.right = viewRect.right + 300;
activeRect.top = viewRect.top - 200;
activeRect.bottom = viewRect.bottom + 200;
world.setScroll(-viewX, -viewY);
}
function newProjectile(owner, id, x, y, velx, vely) {
trace("newProjectile");
var _local3 = (id + "_") + Projectile.nextID();
trace("id=" + id);
trace("_local3=" + _local3);
world.attachMovie(id, _local3, world.getNextHighestDepth());
var _local5 = world[_local3];
var _local2 = TomProjectile(_local5);
_local2.owner = owner;
_local2._x = x;
_local2._y = y;
_local2.dx = velx;
_local2.dy = vely;
return(_local2);
}
function newOrphan(owner, id, x, y, velx, vely) {
var _local3 = (id + "_") + Orphan.nextID();
world.attachMovie(id, _local3, world.getNextHighestDepth());
var _local4 = world[_local3];
var _local2 = Orphan(_local4);
_local2._x = x;
_local2._y = y;
_local2.dx = velx;
_local2.dy = vely;
return(_local2);
}
function addEnemy(o) {
enemies.push(o);
}
function removeEnemy(o) {
var _local2 = 0;
while (_local2 < enemies.length) {
if (enemies[_local2] == o) {
inactive.push(o);
delete enemies[_local2];
enemies.splice(_local2, 1);
return(true);
}
_local2++;
}
return(false);
}
function addOprhan(o) {
orphans.push(o);
}
function removeOrphan(o) {
var _local2 = 0;
while (_local2 < orphans.length) {
if (orphans[_local2] == o) {
inactive.push(o);
delete orphans[_local2];
orphans.splice(_local2, 1);
return(true);
}
_local2++;
}
return(false);
}
function addProjectile(o) {
projectiles.push(o);
}
function removeProjectile(o) {
var _local2 = 0;
while (_local2 < projectiles.length) {
if (projectiles[_local2] == o) {
inactive.push(o);
delete projectiles[_local2];
projectiles.splice(_local2, 1);
return(true);
}
_local2++;
}
return(false);
}
function addItem(o) {
items.push(o);
}
function removeItems(o) {
var _local2 = 0;
while (_local2 < items.length) {
if (projectiles[_local2] == o) {
inactive.push(o);
delete items[_local2];
items.splice(_local2, 1);
return(true);
}
_local2++;
}
return(false);
}
function initAction() {
switch (action) {
case ACTION_INIT :
gotoAndStop("init");
break;
case ACTION_IN :
gotoAndPlay("in");
break;
case ACTION_PLAY :
gotoAndStop("play");
break;
case ACTION_DEATH :
gotoAndStop("death");
break;
case ACTION_PAUSED :
gotoAndStop("paused");
break;
case ACTION_OUT :
gotoAndPlay("out");
}
}
function actionDone() {
switch (action) {
case ACTION_IN :
setAction(ACTION_PLAY);
break;
case ACTION_PLAY :
break;
case ACTION_DEATH :
break;
case ACTION_PAUSED :
break;
case ACTION_OUT :
if (gameover) {
_root.gotoAndPlay("death");
} else if (gotolair) {
setAction(ACTION_IN);
trace("_global.worldID=" + _global.worldID);
trace("_global.partID=" + _global.partID);
if ((_global.worldID == 0) && (_global.partID == 0)) {
world.player._x = 1600;
world.player._y = -1200;
world.player.faceRight();
_global.game.hud.showLairText(3);
} else if ((_global.worldID == 1) && (_global.partID == 1)) {
world.player._x = -3000;
world.player._y = -1900;
world.player.faceRight();
_global.game.hud.showLairText(3);
} else if ((_global.worldID == 1) && (_global.partID == 2)) {
world.player._x = -3212;
world.player._y = -1750;
world.player.faceRight();
_global.game.hud.showLairText(3);
} else if ((_global.worldID == 2) && (_global.partID == 1)) {
world.player._x = -1880;
world.player._y = -610;
world.player.faceRight();
_global.game.hud.showLairText(2);
} else if ((_global.worldID == 2) && (_global.partID == 2)) {
world.player._x = -3000;
world.player._y = -1900;
world.player.faceRight();
_global.game.hud.showLairText(3);
} else if ((_global.worldID == 2) && (_global.partID == 3)) {
world.player._x = -3000;
world.player._y = -1900;
world.player.faceRight();
_global.game.hud.showLairText(2);
} else if ((_global.worldID == 3) && (_global.partID == 1)) {
world.player._x = -3000;
world.player._y = 155;
world.player.faceRight();
_global.game.hud.showLairText(1);
} else if ((_global.worldID == 4) && (_global.partID == 1)) {
world.player._x = -3000;
world.player._y = -1900;
world.player.faceRight();
_global.game.hud.showLairText(2);
}
_global.game.swapViewExtents("lair");
world.player.startUnwarp();
snapView = true;
gotolair = false;
showAllClips();
_global.game.sound.stop("music_action");
if (_global.musicOn) {
_global.game.sound.start(_global.game.music, 65);
}
} else if (backtogame) {
setAction(ACTION_IN);
world.player._x = _global.game.warpbackx;
world.player._y = _global.game.warpbacky;
world.player.faceRight();
_global.game.swapViewExtents("0");
world.player.startUnwarp();
snapView = true;
backtogame = false;
showAllClips();
} else {
nextWorld();
}
}
}
function showAllClips() {
var _local3 = _global.game.world.player._x;
var _local4 = _global.game.world.player._y;
for (var _local2 in _global.game.worlds.world) {
if (typeof(_global.game.worlds.world[_local2]) == "movieclip") {
if (((_local2 != "player") && (_local2 != "extends")) && (_local2 != "solid")) {
_global.game.worlds.world[_local2]._visible = true;
}
}
}
}
function awardPoints(points) {
score = score + points;
hud.changeScore(score);
}
function swapViewExtents(ext) {
if (ext != "0") {
var _local2 = world["extents" + ext].getRect(world);
} else {
var _local2 = world.extents.getRect(world);
}
viewExtents.x = _local2.xMin;
viewExtents.y = _local2.yMin;
viewExtents.width = _local2.xMax - _local2.xMin;
viewExtents.height = _local2.yMax - _local2.yMin;
viewExtents.inflate(-HALF_WIDTH, -HALF_HEIGHT);
}
function gameEvent_playerDeath() {
_global.lives--;
if (_global.lives < 0) {
_global.lives = 3;
gameover = true;
} else {
_global.game.hud.setLives(_global.lives);
}
setAction(ACTION_DEATH);
}
function gameEvent_endWorld() {
setAction(ACTION_OUT);
gotolair = false;
}
function gameEvent_playerSuicide() {
world.player.setActive(false);
gameover = true;
setAction(ACTION_DEATH);
}
function gameEvent_warp() {
setAction(ACTION_WARP);
}
function gameEvent_displayTip(tip) {
_root.oracleText = tip;
if (_root.oracle._currentframe == 1) {
_root.oracle.gotoAndPlay(1);
return(true);
}
return(false);
}
function gameEvent_displayWarning() {
if (!_root.breakout._visible) {
_root.breakout._x = 800;
_root.breakout._visible = true;
_root.breakout.targetx = 300;
_root.breakout.shake = false;
_global.game.sound.start("sfx_punch_1");
_root.breakout.onEnterFrame = function () {
trace("this.shake=" + this.shake);
trace("this._x=" + this.targetx);
trace("this.targetx=" + this.targetx);
if (this.shake == false) {
if (Math.abs(this._x - this.targetx) > 1) {
this._x = this._x - ((this._x - this.targetx) * 0.4);
} else {
this._x = (this.targetx - random(25)) - 25;
if (this.targetx > 0) {
this.shake = true;
_global.game.sound.start("sfx_glass_break_1");
_global.game.sound.stop(_global.game.music);
} else {
if (_global.musicOn) {
_global.game.sound.start("music_action", 70);
}
this._visible = false;
delete this.onEnterFrame;
}
}
} else if (Math.abs(this._x - this.targetx) > 1) {
this._x = this._x - ((this._x - this.targetx) * 1.85);
} else {
this._x = this.targetx + 25;
this.targetx = -400;
this.shake = false;
_global.game.sound.start("sfx_swoosh_2");
_global.game.breakTimer = true;
_global.game.breakTime = getTimer();
}
};
return(true);
}
return(false);
}
function gameEvent_displaySnatched() {
if (!_root.snatched._visible) {
_root.snatched._x = 800;
_root.snatched._visible = true;
_root.snatched.targetx = 300;
_root.snatched.shake = false;
_root.snatched.startTime = getTimer();
_global.game.sound.start("sfx_punch_1");
_root.snatched.onEnterFrame = function () {
if (this.shake == false) {
if (Math.abs(this._x - this.targetx) > 1) {
this._x = this._x - ((this._x - this.targetx) * 0.4);
} else {
this._x = (this.targetx - random(25)) - 25;
if (this.targetx > 0) {
this.shake = true;
_global.game.sound.start("sfx_glass_break_1");
} else {
this._visible = false;
delete this.onEnterFrame;
}
}
} else if (Math.abs(this._x - this.targetx) > 1) {
this._x = this._x - ((this._x - this.targetx) * 1.85);
} else if ((getTimer() - this.startTime) > 3200) {
this._x = this.targetx + 25;
this.targetx = -400;
this.shake = false;
_global.game.sound.start("sfx_swoosh_2");
}
};
return(true);
}
return(false);
}
function gameEvent_spawnDodger() {
if (!_root.dattack._visible) {
_root.dattack._x = 800;
_root.dattack._visible = true;
_root.dattack.targetx = 300;
_root.dattack.shake = false;
_root.dattack.startTime = getTimer();
_global.game.sound.start("sfx_punch_1");
_root.dattack.onEnterFrame = function () {
if (this.shake == false) {
if (Math.abs(this._x - this.targetx) > 1) {
this._x = this._x - ((this._x - this.targetx) * 0.4);
} else {
this._x = (this.targetx - random(25)) - 25;
if (this.targetx > 0) {
this.shake = true;
_global.game.sound.start("sfx_glass_break_1");
_global.game.sound.stop(_global.game.music);
} else {
_root.game.worlds.world.attachMovie("artfuldodger_miniboss", "dodger", _root.game.worlds.world.getNextHighestDepth());
_root.game.worlds.world.dodger._x = _root.game.worlds.world.player._x + 480;
_root.game.worlds.world.dodger._y = _root.game.worlds.world.player._y - 10;
_root.game.worlds.world.dodger.dir = -1;
if (_global.musicOn) {
_global.game.sound.start("music_action", 70);
}
this._visible = false;
delete this.onEnterFrame;
}
}
} else if (Math.abs(this._x - this.targetx) > 1) {
this._x = this._x - ((this._x - this.targetx) * 1.85);
} else if ((getTimer() - this.startTime) > 1600) {
this._x = this.targetx + 25;
this.targetx = -400;
this.shake = false;
_global.game.sound.start("sfx_swoosh_2");
}
};
return(true);
}
return(false);
}
function gameEvent_unPause() {
justUnpaused = true;
setAction(ACTION_PLAY);
}
function objectivesComplete() {
var _local4;
if (orphansCaught >= world.orphansRequried) {
_local4 = true;
_root.game.worlds.world.solid.levelend._y = -2566.3;
_root.game.worlds.world.endDoor.gotoAndStop(1);
} else {
_local4 = false;
_global.game.gameEvent_displayTip(("Capture " + world.orphansRequried) + " Orphans to Proceed");
}
return(_local4);
}
static var ACTION_INIT = 1;
static var ACTION_IN = 2;
static var ACTION_PLAY = 3;
static var ACTION_DEATH = 4;
static var ACTION_WARP = 5;
static var ACTION_PAUSED = 7;
static var ACTION_OUT = 8;
static var HALF_WIDTH = Stage.width / 2;
static var HALF_HEIGHT = Stage.height / 2;
var viewLookUpDelay = 0;
var viewLookDownDelay = 0;
var viewX = 0;
var viewY = 0;
var gameover = false;
var gotolair = false;
var backtogame = false;
var warpbackx = 0;
var warpbacky = 0;
var frame = 0;
var score = 0;
var orphansCaptured = 0;
var orphansCaught = 0;
var orphansNeeded = 25;
var orphansSpawned = 0;
var respawnOrphans = 0;
var orphansPies = 0;
var justUnpaused = false;
var breakTimer = false;
var breakTime = 0;
var disableTip = false;
}
Symbol 1513 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager
{
var soundArray, masterContainer, masterSound;
function SoundManager (root) {
soundArray = new Object();
masterContainer = root.createEmptyMovieClip("soundContainer", root.getNextHighestDepth());
masterSound = new Sound(masterContainer);
}
function destroy() {
removeAll();
delete masterSound;
masterContainer.removeMovieClip();
delete masterContainer;
}
function setVolume(volume) {
masterSound.setVolume(volume);
}
function add(id, volume, loop) {
if (!soundArray[id]) {
var _local3 = new SoundEffect(masterContainer, id, volume, loop);
soundArray[id] = _local3;
}
}
function start(id, relativeVolume) {
if (soundArray[id]) {
soundArray[id].start(relativeVolume);
return(true);
}
return(false);
}
function stop(id) {
if (soundArray[id]) {
soundArray[id].stop();
return(true);
}
return(false);
}
function stopAll() {
masterSound.stop();
}
function remove(id) {
if (soundArray[id]) {
soundArray[id].destroy();
delete soundArray[id];
return(true);
}
return(false);
}
function removeAll() {
for (var _local2 in soundArray) {
soundArray[_local2].destroy();
delete soundArray[_local2];
}
}
}
Symbol 1514 MovieClip [__Packages.SoundEffect] Frame 0
class SoundEffect
{
var id, volume, loop, container, sound;
function SoundEffect (_parentContainer_, _id_, _volume_, _loop_) {
id = _id_;
volume = _volume_;
loop = _loop_;
container = _parentContainer_.createEmptyMovieClip("sound_effect_" + (++counter), _parentContainer_.getNextHighestDepth());
sound = new Sound(container);
sound.attachSound(id);
sound.setVolume(volume);
sound.onSoundComplete = mx.utils.Delegate.create(this, handleSoundComplete);
container.onUnload = mx.utils.Delegate.create(this, handleContainerUnload);
}
function destroy() {
sound.stop();
delete sound;
container.removeMovieClip();
delete container;
}
function start(relativeVolume) {
if (relativeVolume == undefined) {
sound.setVolume(volume);
} else {
sound.setVolume((volume * relativeVolume) * 0.01);
}
sound.start();
playing = true;
}
function stop() {
sound.stop();
playing = false;
}
function handleSoundComplete() {
if (loop) {
sound.start();
}
}
function handleContainerUnload() {
sound.stop();
delete sound;
}
function isPlaying() {
return(playing);
}
static var counter = 0;
var loaded = false;
var playing = false;
}
Symbol 1515 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local3 = arguments.callee.target;
var _local2 = arguments.callee.func;
return(_local2.apply(_local3, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1516 MovieClip [__Packages.HUD] Frame 0
class HUD extends MovieClip
{
var ORPHAN_COUNT_LARGE_TEXT_FORMAT, ORPHAN_COUNT_SMALL_TEXT_FORMAT, onEnterFrame, heart, music, lairtext, bosstext, orphans_carried, orphans_captured, lives, score, gotoAndStop;
function HUD () {
super();
ORPHAN_COUNT_LARGE_TEXT_FORMAT = new TextFormat();
ORPHAN_COUNT_LARGE_TEXT_FORMAT.size = 24;
ORPHAN_COUNT_SMALL_TEXT_FORMAT = new TextFormat();
ORPHAN_COUNT_SMALL_TEXT_FORMAT.size = 12;
onEnterFrame = init;
}
function onLoad() {
}
function init() {
setHealth(100);
setScore(0);
setOrphansCarried(0, 0);
setOrphansCaptured(0, 0);
onEnterFrame = null;
}
function update() {
}
function setHealth(val) {
heart.beating.gotoAndStop(11 - Math.ceil(val / 10));
}
function changeHealth(val) {
setHealth(val);
heart.gotoAndPlay("take_damage");
}
function setMusic(val) {
if (val) {
music.gotoAndStop(1);
} else {
music.gotoAndStop(2);
}
}
function hideLairText() {
lairtext._visible = false;
}
function showLairText(val) {
lairtext.gotoAndStop(val);
lairtext._visible = true;
lairtext.rate = 0.2;
lairtext.delay = 2500;
lairtext._alpha = 100;
lairtext.startTime = getTimer();
lairtext.onEnterFrame = function () {
if ((getTimer() - this.startTime) > this.delay) {
this._alpha = this._alpha - (this._alpha * this.rate);
if (this._alpha < 1) {
this._alpha = 0;
this._visible = false;
delete this.onEnterFrame;
}
}
};
}
function hideBossText() {
bosstext._visible = false;
}
function showBossText(val) {
bosstext.gotoAndStop(val);
bosstext._visible = true;
bosstext.rate = 0.2;
bosstext.delay = 2500;
bosstext._alpha = 100;
bosstext.startTime = getTimer();
bosstext.onEnterFrame = function () {
if ((getTimer() - this.startTime) > this.delay) {
this._alpha = this._alpha - (this._alpha * this.rate);
if (this._alpha < 1) {
this._alpha = 0;
this._visible = false;
delete this.onEnterFrame;
}
}
};
}
function setOrphansCarried(count, max) {
orphans_carried.text = (count + " / ") + max;
var _local2;
if (max < 10) {
_local2 = 4;
} else if (max < 100) {
_local2 = 5;
} else {
_local2 = 6;
}
orphans_carried.setTextFormat(ORPHAN_COUNT_LARGE_TEXT_FORMAT);
orphans_carried.setTextFormat(orphans_carried.length - _local2, orphans_carried.length, ORPHAN_COUNT_SMALL_TEXT_FORMAT);
}
function changeOrphansCarried(count, max) {
setOrphansCarried(count, max);
}
function setOrphansCaptured(count, required) {
orphans_captured.text = (count + " / ") + required;
var _local2;
if (required < 10) {
_local2 = 4;
} else if (required < 100) {
_local2 = 5;
} else {
_local2 = 6;
}
orphans_captured.setTextFormat(ORPHAN_COUNT_LARGE_TEXT_FORMAT);
orphans_captured.setTextFormat(orphans_captured.length - _local2, orphans_captured.length, ORPHAN_COUNT_SMALL_TEXT_FORMAT);
}
function changeOrphansCaptured(count, required) {
setOrphansCaptured(count, required);
}
function setLives(val) {
lives.text = String(val);
}
function setScore(val) {
score.text = String(val);
}
function changeScore(i) {
}
function changeFrame(frm) {
gotoAndStop(frm);
}
}
Instance of Symbol 93 MovieClip "mcNotice" in Symbol 130 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 130 MovieClip Frame 120
stop();
if ((_url.indexOf("freeonlinegames.com") >= 0) && (_url.indexOf("file:") == -1)) {
_root.okToPlay = true;
_root.play();
} else if (_root.debug) {
_root.okToPlay = true;
_root.play();
} else {
_root.mcTaglines._visible = false;
mcNotice._visible = true;
}
Symbol 131 MovieClip Frame 71
stop();
var fogsound = new Sound();
fogsound.attachSound("fogaudio");
fogsound.start(0, 1);
Symbol 179 MovieClip Frame 1
stop();
Symbol 184 MovieClip [absinthe] Frame 1
#initclip 66
Object.registerClass("absinthe", Absinthe);
#endinitclip
Symbol 184 MovieClip [absinthe] Frame 25
stop();
actionDone();
Symbol 208 MovieClip Frame 4
if (random(2) == 0) {
_global.game.sound.play("Swoosh.aif");
} else {
_global.game.sound.play("Swoosh2.aif");
}
Symbol 208 MovieClip Frame 13
_parent.actionDone();
Symbol 214 MovieClip Frame 6
_parent.actionDone();
Symbol 228 MovieClip Frame 70
stop();
_parent.actionDone();
Symbol 229 MovieClip [bobby] Frame 1
#initclip 65
Object.registerClass("bobby", Bobby);
#endinitclip
Symbol 230 MovieClip [olivertwisted] Frame 1
#initclip 60
Object.registerClass("olivertwisted", OliverTwisted);
#endinitclip
Symbol 252 MovieClip [brake_barrel] Frame 1
#initclip 62
Object.registerClass("brake_barrel", HidingSpot);
#endinitclip
stop();
Symbol 252 MovieClip [brake_barrel] Frame 9
stop();
Symbol 252 MovieClip [brake_barrel] Frame 16
stop();
actionDone();
Symbol 271 MovieClip Frame 6
stop();
Symbol 272 MovieClip [brake_crate] Frame 1
#initclip 61
Object.registerClass("brake_crate", HidingSpot);
#endinitclip
stop();
Symbol 272 MovieClip [brake_crate] Frame 9
stop();
Symbol 272 MovieClip [brake_crate] Frame 16
stop();
actionDone();
Symbol 279 MovieClip Frame 1
_parent.updateSack();
Symbol 279 MovieClip Frame 30
if ((_global.game.world.player.grabbedOrphanCount > 0) && (random(2) == 0)) {
_parent.gotoAndStop("bite");
}
Symbol 279 MovieClip Frame 63
if ((_global.game.world.player.grabbedOrphanCount > 0) && (random(10) > 2)) {
_parent.gotoAndStop("bite");
}
Symbol 313 MovieClip Frame 1
_parent.updateSack();
Symbol 313 MovieClip Frame 18
_global.game.sound.start("sfx_bite");
Symbol 313 MovieClip Frame 21
_global.game.sound.start("sfx_orphan_yelp_4");
Symbol 313 MovieClip Frame 48
_parent.gotoAndStop("stand");
Symbol 322 MovieClip Frame 5
_global.game.sound.start("sfx_swoosh_2");
Symbol 322 MovieClip Frame 8
_parent.actionDone();
Symbol 334 MovieClip Frame 7
if (random(2) == 0) {
_global.game.sound.play("Swoosh.aif");
} else {
_global.game.sound.play("Swoosh2.aif");
}
Symbol 334 MovieClip Frame 10
_parent.launchProjectile();
_global.game.sound.start("sfx_swoosh_1");
Symbol 334 MovieClip Frame 14
_parent.actionDone();
Symbol 338 MovieClip Frame 4
stop();
Symbol 345 MovieClip Frame 6
_parent.actionDone();
Symbol 362 MovieClip Frame 4
_global.game.sound.start("sfx_swoosh_2");
Symbol 362 MovieClip Frame 10
_parent.actionDone();
Symbol 371 MovieClip Frame 4
_global.game.sound.start("sfx_swoosh_1");
Symbol 371 MovieClip Frame 6
_parent.launchProjectile();
Symbol 371 MovieClip Frame 10
_parent.actionDone();
Symbol 375 MovieClip Frame 3
stop();
_parent.launchJump();
Symbol 378 MovieClip Frame 3
_parent.actionDone();
Symbol 384 MovieClip Frame 5
stop();
_parent.launchJump();
Symbol 392 MovieClip Frame 2
_global.game.sound.start("sfx_swoosh_2");
Symbol 392 MovieClip Frame 8
_parent.actionDone();
Symbol 401 MovieClip Frame 3
if (random(2) == 0) {
_global.game.sound.play("Swoosh.aif");
} else {
_global.game.sound.play("Swoosh2.aif");
}
Symbol 401 MovieClip Frame 5
_parent.launchProjectile();
Symbol 401 MovieClip Frame 9
_parent.actionDone();
Symbol 406 MovieClip Frame 4
stop();
Symbol 417 MovieClip Frame 3
_global.game.sound.start("sfx_swoosh_2");
Symbol 417 MovieClip Frame 10
_parent.actionDone();
Symbol 433 MovieClip Frame 7
if (random(2) == 0) {
_global.game.sound.play("Swoosh.aif");
} else {
_global.game.sound.play("Swoosh2.aif");
}
Symbol 433 MovieClip Frame 10
_parent.launchProjectile();
Symbol 433 MovieClip Frame 15
_parent.actionDone();
Symbol 438 MovieClip Frame 4
_parent.actionDone();
Symbol 447 MovieClip Frame 13
_parent.actionDone();
Symbol 458 MovieClip Frame 23
stop();
_parent.actionDone();
Symbol 470 MovieClip Frame 19
stop();
_parent.actionDone();
Symbol 479 MovieClip Frame 16
_parent.actionDone();
Symbol 518 MovieClip Frame 1
trace("\u5230\u6211\u5566");
Symbol 536 MovieClip Frame 8
_global.game.sound.start("sfx_sack_open");
Symbol 536 MovieClip Frame 10
_global.game.sound.start("sfx_tom_grab_1");
Symbol 536 MovieClip Frame 25
_parent.actionDone();
Symbol 560 MovieClip Frame 8
_global.game.sound.start("sfx_bite");
Symbol 560 MovieClip Frame 10
_global.game.sound.start("sfx_orphan_yelp_4");
Symbol 560 MovieClip Frame 25
_global.game.sound.start("sfx_sack_open");
Symbol 560 MovieClip Frame 38
_parent.actionDone();
Symbol 570 MovieClip Frame 3
switch (random(2)) {
case 0 :
_global.game.sound.start("sfx_tom_jump_1");
break;
case 1 :
_global.game.sound.start("sfx_tom_jump_2");
}
Symbol 570 MovieClip Frame 11
_parent.actionDone();
Symbol 571 MovieClip [evilMinon] Frame 1
#initclip 64
Object.registerClass("evilMinon", EvilMinon);
#endinitclip
Symbol 583 MovieClip [tom_projectile] Frame 1
#initclip 63
Object.registerClass("tom_projectile", TomProjectile);
#endinitclip
Symbol 583 MovieClip [tom_projectile] Frame 15
trace(" i can fly......");
actionDone();
Symbol 589 Button
on (release) {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=257&area=menu", "_blank");
}
Symbol 594 Button
on (release) {
_root.gotoAndPlay("instructions");
}
Symbol 598 Button
on (release) {
_root.gotoAndPlay("instructions");
}
Symbol 602 Button
on (release) {
_root.gotoAndStop("scoreboard");
}
Instance of Symbol 627 MovieClip in Symbol 628 MovieClip Frame 1
on (release) {
this._parent._parent.play();
}
Symbol 629 MovieClip Frame 1
stop();
Symbol 629 MovieClip Frame 11
stop();
Symbol 629 MovieClip Frame 15
gotoAndStop (1);
Symbol 683 Button
on (release) {
_root.gotoAndPlay("title");
}
Symbol 684 Button
on (release) {
_root.currentCutscene = 0;
_root.gotoAndPlay("cutscene");
}
Symbol 757 MovieClip Frame 298
stop();
_parent.gotoAndStop("level1");
Symbol 762 Button
on (release) {
_global.worldID = 2;
_global.partID = 1;
gotoAndStop ("level1");
}
Symbol 775 MovieClip Frame 26
stop();
Symbol 781 Button
on (release) {
_global.worldID = 2;
_global.partID = 1;
_root.gotoAndPlay("load_game");
}
Symbol 790 MovieClip Frame 26
stop();
Symbol 794 Button
on (release) {
_global.worldID = 2;
_global.partID = 2;
_root.gotoAndPlay("load_game");
}
Symbol 803 MovieClip Frame 26
stop();
Symbol 807 Button
on (release) {
_global.worldID = 2;
_global.partID = 3;
_root.gotoAndPlay("load_game");
}
Symbol 816 MovieClip Frame 26
stop();
Symbol 820 Button
on (release) {
_global.worldID = 2;
_global.partID = 4;
_root.gotoAndPlay("load_game");
}
Symbol 829 MovieClip Frame 26
stop();
Symbol 833 Button
on (release) {
_global.worldID = 3;
_global.partID = 1;
_root.gotoAndPlay("load_game");
}
Symbol 842 MovieClip Frame 26
stop();
Symbol 846 Button
on (release) {
_global.worldID = 3;
_global.partID = 2;
_root.gotoAndPlay("load_game");
}
Symbol 854 Button
on (release) {
stopAllSounds();
this.gotoAndStop("intro");
}
Symbol 863 MovieClip Frame 1
stop();
Symbol 863 MovieClip Frame 10
stop();
stopAllSounds();
Symbol 863 MovieClip Frame 19
trace("level 1");
stop();
Symbol 863 MovieClip Frame 28
trace("level2");
stop();
Symbol 863 MovieClip Frame 39
stop();
Symbol 863 MovieClip Frame 49
stop();
Symbol 863 MovieClip Frame 58
stop();
Symbol 863 MovieClip Frame 78
stop();
startoverBtn.onRelease = function () {
_global.worldID = 2;
_global.partID = 1;
_root.gotoAndPlay("title");
};
Symbol 863 MovieClip Frame 88
stop();
Symbol 870 MovieClip Frame 15
stop();
Symbol 902 MovieClip Frame 5
stop();
Symbol 905 MovieClip Frame 19
stop();
_parent.actionDone();
Symbol 908 MovieClip Frame 2
stop();
Symbol 911 MovieClip Frame 3
_parent.actionDone();
Symbol 922 MovieClip Frame 1
if (random(2) == 0) {
_global.game.sound.play("Swoosh.aif");
} else {
_global.game.sound.play("Swoosh2.aif");
}
Symbol 922 MovieClip Frame 11
_parent.actionDone();
Symbol 929 MovieClip Frame 11
_parent.actionDone();
Symbol 945 MovieClip Frame 103
stop();
_parent.actionDone();
Symbol 946 MovieClip [artfuldodger_miniboss] Frame 1
#initclip 88
Object.registerClass("artfuldodger_miniboss", ArtfulDodgerMiniBoss);
#endinitclip
Symbol 989 MovieClip Frame 12
stop();
Symbol 990 MovieClip [orphan2] Frame 1
#initclip 69
Object.registerClass("orphan2", Orphan2);
#endinitclip
Symbol 1035 MovieClip Frame 17
stop();
Symbol 1036 MovieClip [orphan1] Frame 1
#initclip 68
Object.registerClass("orphan1", Orphan1);
#endinitclip
Symbol 1078 MovieClip Frame 15
stop();
Symbol 1079 MovieClip [orphan3] Frame 1
#initclip 70
Object.registerClass("orphan3", Orphan3);
#endinitclip
Symbol 1084 MovieClip [umbrella] Frame 1
#initclip 72
Object.registerClass("umbrella", Umbrella);
#endinitclip
Symbol 1084 MovieClip [umbrella] Frame 183
actionDone();
Symbol 1100 MovieClip Frame 5
if (random(2) == 0) {
_global.game.sound.play("Swoosh.aif");
} else {
_global.game.sound.play("Swoosh2.aif");
}
Symbol 1100 MovieClip Frame 12
_parent.actionDone();
Symbol 1104 MovieClip Frame 6
_parent.actionDone();
Symbol 1117 MovieClip Frame 102
stop();
_parent.actionDone();
Symbol 1118 MovieClip [skinnyhooker] Frame 1
#initclip 71
Object.registerClass("skinnyhooker", SkinnyHooker);
#endinitclip
Symbol 1120 MovieClip [umbrella_red] Frame 1
#initclip 73
Object.registerClass("umbrella_red", UmbrellaRed);
#endinitclip
Symbol 1120 MovieClip [umbrella_red] Frame 21
actionDone();
stop();
Symbol 1120 MovieClip [umbrella_red] Frame 30
actionDone();
Symbol 1123 MovieClip [_trigger_breakout] Frame 1
#initclip 75
Object.registerClass("_trigger_breakout", TriggerBreakout);
#endinitclip
Symbol 1124 MovieClip [trigger_camera] Frame 1
#initclip 76
Object.registerClass("trigger_camera", TriggerCamera);
#endinitclip
Symbol 1125 MovieClip [trigger_tip] Frame 1
#initclip 77
Object.registerClass("trigger_tip", TriggerTip);
#endinitclip
Symbol 1126 MovieClip [trigger_dodger] Frame 1
#initclip 78
Object.registerClass("trigger_dodger", TriggerDodger);
#endinitclip
Symbol 1133 MovieClip [trigger_end] Frame 1
#initclip 74
Object.registerClass("trigger_end", TriggerEnd);
#endinitclip
Symbol 1139 MovieClip [world2_part1] Frame 1
#initclip 79
Object.registerClass("world2_part1", World2Part1);
#endinitclip
Symbol 1142 MovieClip [orphan4] Frame 1
#initclip 67
Object.registerClass("orphan4", Orphan4);
#endinitclip
Symbol 1156 MovieClip Frame 2
if (random(2) == 0) {
_global.game.sound.play("Swoosh.aif");
} else {
_global.game.sound.play("Swoosh2.aif");
}
Symbol 1156 MovieClip Frame 10
_parent.actionDone();
Symbol 1161 MovieClip Frame 8
_parent.actionDone();
Symbol 1174 MovieClip Frame 102
stop();
_parent._alpha = 0;
_parent.actionDone();
Symbol 1175 MovieClip [brute] Frame 1
#initclip 84
Object.registerClass("brute", Brute);
#endinitclip
Symbol 1192 MovieClip Frame 3
if (random(2) == 0) {
_global.game.sound.play("Swoosh.aif");
} else {
_global.game.sound.play("Swoosh2.aif");
}
Symbol 1192 MovieClip Frame 9
_parent.actionDone();
Symbol 1199 MovieClip Frame 10
_parent.actionDone();
Symbol 1214 MovieClip Frame 87
stop();
_parent._alpha = 0;
_parent.actionDone();
Symbol 1215 MovieClip [thug] Frame 1
#initclip 85
Object.registerClass("thug", Thug);
#endinitclip
Symbol 1222 MovieClip [world2_part2] Frame 1
#initclip 80
Object.registerClass("world2_part2", World2Part2);
#endinitclip
Symbol 1231 MovieClip [world2_part3] Frame 1
#initclip 81
Object.registerClass("world2_part3", World2Part3);
#endinitclip
Symbol 1237 MovieClip [world3_part1] Frame 1
#initclip 86
Object.registerClass("world3_part1", World3Part1);
#endinitclip
Symbol 1246 MovieClip [world4_part1] Frame 1
#initclip 87
Object.registerClass("world4_part1", World4Part1);
#endinitclip
Symbol 1265 MovieClip Frame 5
stop();
Symbol 1269 MovieClip Frame 3
stop();
Symbol 1273 MovieClip Frame 3
_parent.actionDone();
Symbol 1281 MovieClip Frame 1
if (random(2) == 0) {
_global.game.sound.play("Swoosh.aif");
} else {
_global.game.sound.play("Swoosh2.aif");
}
Symbol 1281 MovieClip Frame 12
_parent.actionDone();
Symbol 1289 MovieClip Frame 11
_parent.actionDone();
Symbol 1299 MovieClip Frame 50
stop();
_parent.actionDone();
Symbol 1300 MovieClip [artfuldodger_boss] Frame 1
#initclip 82
Object.registerClass("artfuldodger_boss", ArtfulDodgerBoss);
#endinitclip
Symbol 1308 MovieClip [world2_part4] Frame 1
#initclip 83
Object.registerClass("world2_part4", World2Part4);
#endinitclip
Symbol 1321 MovieClip Frame 1
stop();
Symbol 1321 MovieClip Frame 2
stop();
Symbol 1337 MovieClip Frame 1
stop();
Symbol 1337 MovieClip Frame 2
stop();
Symbol 1337 MovieClip Frame 3
stop();
Symbol 1337 MovieClip Frame 4
stop();
Symbol 1337 MovieClip Frame 5
stop();
Symbol 1347 MovieClip Frame 1
stop();
Symbol 1347 MovieClip Frame 2
stop();
Symbol 1347 MovieClip Frame 3
stop();
Symbol 1359 MovieClip Frame 1
stop();
Symbol 1360 MovieClip Frame 1
play();
Symbol 1360 MovieClip Frame 11
gotoAndPlay (1);
Symbol 1361 MovieClip Frame 1
stop();
Symbol 1383 MovieClip [hud] Frame 1
#initclip 90
Object.registerClass("hud", HUD);
#endinitclip
stop();
Instance of Symbol 1321 MovieClip "music" in Symbol 1383 MovieClip [hud] Frame 1
on (release) {
if (this._currentframe == 1) {
this.gotoAndStop(2);
_global.musicOn = false;
_global.game.sound.stop(_global.game.music);
} else {
this.gotoAndStop(1);
_global.musicOn = true;
_global.game.sound.start(_global.game.music, 75);
}
}
Symbol 1383 MovieClip [hud] Frame 2
stop();
Symbol 1383 MovieClip [hud] Frame 3
stop();
Symbol 1389 MovieClip [game] Frame 1
#initclip 89
Object.registerClass("game", Game);
#endinitclip
Symbol 1389 MovieClip [game] Frame 40
trace("play");
actionDone();
Symbol 1389 MovieClip [game] Frame 100
actionDone();
Symbol 1399 MovieClip Frame 1
this.oHelp.text = _root.oracleText;
Symbol 1400 MovieClip Frame 70
stop();
Symbol 1403 MovieClip Frame 1
stop();
Symbol 1403 MovieClip Frame 85
gotoAndStop ("start");
Symbol 1422 MovieClip Frame 2
stop();
continueBtn.onRelease = function () {
_global.partID = 1;
_root.gotoAndPlay("load_game");
};
startoverBtn.onRelease = function () {
_global.worldID = 2;
_global.partID = 1;
_root.gotoAndPlay("title");
};
playmoreBtn.onRelease = function () {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=257&area=gameover", "_blank");
};
Symbol 1432 Button
on (press) {
sboard.dir = "up";
}
on (release) {
sboard.dir = "stop";
}
Symbol 1433 Button
on (press) {
sboard.dir = "down";
}
on (release) {
sboard.dir = "stop";
}
Symbol 1440 MovieClip Frame 1
stop();
Symbol 1440 MovieClip Frame 2
stop();
Symbol 1450 MovieClip [TMP6pbk6uzm9i] Frame 1
var arrScore = new Array();
mcScoreboard.sboard.dir = "stop";
mcScoreboard.sboard.mcScoreHolder.mcScore._visible = false;
mcLabel._visible = false;
var main = this;
xmlPlayer = new XML();
xmlPlayer.ignoreWhite = true;
xmlPlayer.onLoad = function (success) {
if (success) {
myPlayer = xmlPlayer.firstChild.childNodes;
ctr2 = 0;
while (ctr2 < myPlayer.length) {
thisPlayer = main.mcScoreboard.sboard.mcScoreHolder.mcScore.duplicateMovieClip("mcScore" + ctr2, ctr2);
thisPlayer._y = ctr2 * thisPlayer._height;
thisPlayer._visible = true;
if ((ctr2 % 2) > 0) {
thisPlayer.gotoAndStop(2);
}
thisPlayer.txtNumber.text = (ctr2 + 1) + ")";
thisPlayer.txtNickname.text = myPlayer[ctr2].attributes.player;
thisPlayer.txtScore.text = myPlayer[ctr2].attributes.score;
ctr2++;
}
main.mcScoreboard.mcLoading._visible = false;
main.mcScoreboard.sboard.mcScoreHolder.item = myPlayer.length;
main.mcScoreboard.sboard.mcScoreHolder.speedy = 0;
main.mcScoreboard.sboard.mcScoreHolder.desty = 0;
main.mcScoreboard.sboard.mcScoreHolder.onEnterFrame = function () {
if ((this.desty < 0) && (this._parent.dir == "up")) {
this.desty = this.desty + 10;
if (this.desty > 0) {
this.desty = 0;
}
}
if ((this.desty > (this._parent.mcBlock._height - (this.mcScore._height * this.item))) && (this._parent.dir == "down")) {
this.desty = this.desty - 10;
if (this.desty < (this._parent.mcBlock._height - (this.mcScore._height * this.item))) {
this.desty = this._parent.mcBlock._height - (this.mcScore._height * this.item);
}
}
this.speedy = (this.desty - this._y) + (this.speedy * 0.4);
this._y = this._y + this.speedy;
};
}
};
xmlPlayer.load(((("http://www.freeonlinegames.com/scoreboard/getTopPlayer.php?id=" + gameID) + "&rand=") + random(999999)) + "&filt=1");
Symbol 1455 MovieClip [TMP6ojzjuzm8i] Frame 1
var arrScore = new Array();
mcScoreboard.sboard.dir = "stop";
mcScoreboard.sboard.mcScoreHolder.mcScore._visible = false;
mcLabel._visible = false;
var main = this;
xmlPlayer = new XML();
xmlPlayer.ignoreWhite = true;
xmlPlayer.onLoad = function (success) {
if (success) {
myPlayer = xmlPlayer.firstChild.childNodes;
ctr2 = 0;
while (ctr2 < myPlayer.length) {
thisPlayer = main.mcScoreboard.sboard.mcScoreHolder.mcScore.duplicateMovieClip("mcScore" + ctr2, ctr2);
thisPlayer._y = ctr2 * thisPlayer._height;
thisPlayer._visible = true;
if ((ctr2 % 2) > 0) {
thisPlayer.gotoAndStop(2);
}
thisPlayer.txtNumber.text = (ctr2 + 1) + ")";
thisPlayer.txtNickname.text = myPlayer[ctr2].attributes.player;
thisPlayer.txtScore.text = myPlayer[ctr2].attributes.score;
ctr2++;
}
main.mcScoreboard.mcLoading._visible = false;
main.mcScoreboard.sboard.mcScoreHolder.item = myPlayer.length;
main.mcScoreboard.sboard.mcScoreHolder.speedy = 0;
main.mcScoreboard.sboard.mcScoreHolder.desty = 0;
main.mcScoreboard.sboard.mcScoreHolder.onEnterFrame = function () {
if ((this.desty < 0) && (this._parent.dir == "up")) {
this.desty = this.desty + 10;
if (this.desty > 0) {
this.desty = 0;
}
}
if ((this.desty > (this._parent.mcBlock._height - (this.mcScore._height * this.item))) && (this._parent.dir == "down")) {
this.desty = this.desty - 10;
if (this.desty < (this._parent.mcBlock._height - (this.mcScore._height * this.item))) {
this.desty = this._parent.mcBlock._height - (this.mcScore._height * this.item);
}
}
this.speedy = (this.desty - this._y) + (this.speedy * 0.4);
this._y = this._y + this.speedy;
};
}
};
xmlPlayer.load((("http://www.freeonlinegames.com/scoreboard/getTopPlayer.php?id=" + _root.gameID) + "&rand=") + random(999999));