Combined Code
movieClip 114 PathBox {
#initclip
Object.registerClass('PathBox', PathBox);
#endinitclip
}
movieClip 116 WarpAreaUp {
#initclip
Object.registerClass('WarpAreaUp', WarpArea);
#endinitclip
frame 1 {
this.enterDir = 'up';
}
}
movieClip 119 {
frame 1 {
this._visible = false;
}
}
movieClip 131 {
}
movieClip 158 {
}
movieClip 161 {
}
movieClip 175 {
frame 20 {
_root._AudioManager.playSound('splat_loud', 100);
_root.ngMedal.unlock('Shorty got low');
}
frame 66 {
_parent.gotoAndStop('standup');
}
}
movieClip 177 {
}
movieClip 178 {
frame 34 {
if (GameScene.current.playerReady !== undefined) {
GameScene.current.playerReady();
}
_parent.gotoAndStop('idle');
}
}
movieClip 185 {
frame 10 {
if (GameScene.current.playerPeeking !== undefined) {
GameScene.current.playerPeeking();
}
stop();
}
}
movieClip 186 {
frame 18 {
_parent.gotoAndStop('scared');
stop();
}
}
movieClip 187 {
}
movieClip 192 {
frame 72 {
_parent.gotoAndStop('idle');
}
}
movieClip 225 {
frame 16 {
_root.ngMedal.unlock('Hot Dog Buns');
}
frame 48 {
_root._AudioManager.playSound('splat_quiet', 50);
}
frame 86 {
_root._AudioManager.playSound('splat_quiet', 50);
}
frame 106 {
GameScene.current.enterConcession();
}
frame 124 {
_root._AudioManager.playSound('splat_quiet', 50);
}
frame 127 {
stop();
}
}
movieClip 260 {
frame 13 {
_root._AudioManager.playSound('splat_quiet');
}
frame 57 {
if (GameScene.current.startCrawl !== undefined) {
GameScene.current.startCrawl();
}
}
frame 95 {
if (GameScene.current.enterHole !== undefined) {
GameScene.current.enterHole();
}
}
frame 103 {
stop();
}
}
movieClip 279 {
frame 22 {
if (GameScene.current.onSausageThrow) {
GameScene.current.onSausageThrow();
}
}
frame 32 {
_parent.gotoAndStop('idle');
}
}
movieClip 286 {
frame 61 {
if (GameScene.current.onPlayerStab) {
GameScene.current.onPlayerStab();
}
}
frame 129 {
_parent.gotoAndStop('idle');
}
}
movieClip 287 {
frame 1 {
stop();
}
instance animation of movieClip 186 {
onClipEvent (enterFrame) {
GameScene.current.player._x += 20;
GameScene.current.player._y += 5;
}
}
instance animation of movieClip 186 {
onClipEvent (enterFrame) {
GameScene.current.player._x -= 9;
}
}
frame 71 {
GameScene.current.getCurrentPath();
if (typeof GameScene.current.onPlayerScared !== undefined) {
GameScene.current.onPlayerScared();
}
}
}
movieClip 288 {
frame 1 {
stop();
}
}
movieClip 289 PlayerSprite {
#initclip
Object.registerClass('PlayerSprite', PlayerSprite);
#endinitclip
frame 1 {
stop();
}
}
movieClip 291 WarpAreaRight {
#initclip
Object.registerClass('WarpAreaRight', WarpArea);
#endinitclip
frame 1 {
this.enterDir = 'right';
}
}
movieClip 293 {
frame 1 {
this._visible = false;
}
}
movieClip 294 TestScene {
#initclip
Object.registerClass('TestScene', GameScene);
#endinitclip
instance toPoop of movieClip 116 WarpAreaUp {
onClipEvent (load) {
this.gotoScene = 'PooScene';
this.gotoWarp = 'toPee';
}
}
instance toBarf of movieClip 291 WarpAreaRight {
onClipEvent (load) {
this.gotoScene = 'BarfScene';
this.gotoWarp = 'toPee';
}
}
}
movieClip 303 {
frame 52 {
if (Math.random() < 0.66) {
gotoAndPlay(1);
}
}
}
movieClip 308 {
}
movieClip 309 {
frame 1 {
stop();
}
frame 5 {
stop();
}
}
movieClip 331 VIPWalkback {
#initclip
Object.registerClass('VIPWalkback', NPC);
#endinitclip
}
movieClip 333 WarpAreaDown {
#initclip
Object.registerClass('WarpAreaDown', WarpArea);
#endinitclip
frame 1 {
this.enterDir = 'down';
}
}
// unknown tag 88 length 292
movieClip 337 debug_line {
}
movieClip 344 TextBubbles Baconcheeks scared {
#initclip
Object.registerClass('TextBubbles Baconcheeks scared', Dialogue);
#endinitclip
frame 1 {
this._visible = false;
stop();
}
}
movieClip 347 {
}
movieClip 348 TriggerBoxforFence2 {
#initclip
Object.registerClass('TriggerBoxforFence2', TriggerBox);
#endinitclip
}
movieClip 359 {
frame 1 {
stop();
if (!GameState.getState('gino-emerged')) {
this.onEnterFrame = function () {
if (_parent.player._x - this._x < 375) {
GameScene.current.locked = true;
GameScene.current.stopPlayer();
GameScene.current.player.setDir(-1);
GameState.setState('gino-emerged', 1);
this.onEnterFrame = function () {};
this.play();
}
};
}
}
frame 2 {
_root._AudioManager.playSound('gino_launch');
}
frame 42 {
stop();
_parent.gino.play();
}
}
movieClip 378 {
frame 21 {
if (!GameState.getState('gino-emerged')) {
GameScene.current.bacon_text.setBanter('trapped', [['help', 'bacon_distress'], ['back_off', 'bacon_help'], ['bad_dog', 'bacon_distress'], ['hat', 'bacon_cry']], true, false);
GameScene.current.bacon_text.playBanter('trapped', Dialogue.delay_slow, 200, function () {
GameScene.current.bacon_text.setBanter('trapped', ['bad_dog', 'help', 'back_off', 'hat', 'eep', 'help', 'back_off', 'eep'], true, false);
});
}
}
frame 212 {
if (Math.random() < 0.2) {
gotoAndPlay('loop');
}
}
}
movieClip 379 {
}
movieClip 382 {
}
movieClip 385 {
}
movieClip 388 {
}
movieClip 391 {
}
movieClip 394 {
}
movieClip 395 {
}
movieClip 396 {
frame 58 {
if (Math.random() < 0.5) {
gotoAndPlay('breath');
}
}
frame 115 {
}
frame 121 {
if (Math.random() < 0.5) {
gotoAndPlay('lunge');
}
}
}
movieClip 398 WarpAreaLeft {
#initclip
Object.registerClass('WarpAreaLeft', WarpArea);
#endinitclip
frame 1 {
this.enterDir = 'left';
}
}
movieClip 400 PointMarker {
#initclip
Object.registerClass('PointMarker', PointMarker);
#endinitclip
}
movieClip 404 {
frame 1 {
this._visible = false;
_parent.has_depth = true;
_parent.depth_at = this._y + this._parent._y;
}
}
movieClip 426 {
frame 44 {
if (Math.random() < 0.4) {
gotoAndPlay(1);
}
}
}
movieClip 430 {
frame 1 {
stop();
}
}
movieClip 440 hitBox {
#initclip
Object.registerClass('hitBox', HitBox);
#endinitclip
}
movieClip 450 {
frame 1 {
stop();
this.has_depth = true;
this.click_interactive = true;
this.inventory_interactive = true;
if (GameState.getState('gino-emerged')) {
if (GameState.getState('gino-stabbed')) {
gotoAndStop('stabbed');
} else {
gotoAndStop('active');
}
}
}
frame 8 {
_root._AudioManager.playSound('gino_land');
}
frame 12 {
_root._AudioManager.setMovieVolume(0, 0, 0, 60, true);
_root._AudioManager.playBoss();
}
frame 56 {
_parent.bacon_text.stopText();
GameScene.current.gino_text.onTextStartedObject = this;
GameScene.current.gino_text.onTextStarted = function () {
GameScene.current.gino.gino.gotoAndPlay('scream');
};
GameScene.current.gino_text.playTextArray([['you', 'gino_you'], ['took_everything', 'gino_vengeful2'], ['kill_you', 'gino_vengeful3'], ['argh', 'gino_you']], Dialogue.delay_slow, 500, 0, function () {
GameScene.current.locked = false;
this.gotoAndStop('active');
}, this);
stop();
}
frame 57 {
var banter = [['cmon', 'gino_you'], ['face_me', 'gino_vengeful'], ['vengeance', 'gino_vengeful2'], ['dance', 'gino_vengeful3']];
GameScene.current.gino_text.setBanter('idle', banter, true, false);
GameScene.current.gino_text.onTextStartedObject = this;
GameScene.current.gino_text.onTextStarted = function () {
GameScene.current.gino.gino.gotoAndPlay('scream');
};
this.onUserClick = function (point) {
if (this.gino_hitbox.contains(point)) {
GameScene.current.stopPlayer();
GameScene.current.locked = true;
GameScene.current.gino_text.playBanter('idle', Dialogue.delay_slow, 0, function () {
GameScene.current.locked = false;
GameScene.current.player.setAnimation('no');
});
return true;
} else {
if (this.hitbox.contains(point)) {
point = this.walkto2.getPoint();
if (GameScene.current.player._x > point.x + 20) {
this.action = 'nope';
GameScene.current.walkTo(null, this.walkto2.getPoint(), this);
return true;
}
GameScene.current.stopPlayer();
GameScene.current.player.setAnimation('no');
return true;
}
}
};
this.onItemDropped = function (item, point) {
if (this.gino_hitbox.contains(point)) {
if (item === 'toothpick') {
this.action = 'stab';
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
GameScene.current.stopPlayer();
GameScene.current.player.setAnimation('no');
return true;
}
};
this.onEnterFrame = function () {
var v3 = 100;
var v5 = 360;
var v6 = 600;
var v4 = Math.abs(GameScene.current.player._x - this._x);
if (v4 <= v5) {
v3 = 100;
} else {
if (v4 > v5 + v6) {
v3 = 0;
} else {
v4 -= v5;
v3 = 100 - Math.ceil((v4 / v6) * 100);
if (v3 > 100) {
v3 = 100;
} else {
if (v3 < 0) {
v3 = 0;
}
}
}
}
var v7 = Math.round((100 - v3) / 10);
_root._AudioManager.setMovieVolume(v7, 0, 0, v3);
};
this.onTriggered = function () {
if (this.action == 'stab') {
this.onEnterFrame = function () {};
GameScene.current.player.setDir(-1);
GameScene.current.player.setAnimation('stab');
GameScene.current.locked = 1;
} else {
GameScene.current.stopPlayer();
GameScene.current.player.setAnimation('no');
}
};
}
frame 67 {
_root._AudioManager.setMovieVolume(10, 0, 0, 0, true);
_root._AudioManager.playSound('splat_loud');
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
_root._AudioManager.nextScene();
GameState.setState('gino-stabbed', 1);
}
frame 94 {
GameScene.current.locked = false;
_root.ngMedal.unlock('Slayer');
}
frame 96 {
this.onUserClick = function (point) {
if (this.gino_hitbox.contains(point)) {
GameScene.current.gino_text.playText('dot_dot_dot');
return true;
} else {
if (this.hitbox.contains(point)) {
GameScene.current.locked = true;
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
}
}
};
this.onTriggered = function () {
trace('lets go!');
GameScene.sceneSetup.scene = 'endgame';
GameScene.sceneSetup.warp = null;
GameScene.fadeOut();
};
stop();
}
}
movieClip 463 TextBubbles Gino Rage {
#initclip
Object.registerClass('TextBubbles Gino Rage', Dialogue);
#endinitclip
frame 1 {
this._visible = false;
stop();
}
}
movieClip 464 {
frame 1 {
this.inventory_interactive = true;
this.onItemDropped = function (item, point) {
if (this.hitbox.contains(point)) {
if (item === 'toothpick') {
_root.ngMedal.unlock('Ewwwww');
}
}
};
}
}
movieClip 465 AlleyScene {
#initclip
Object.registerClass('AlleyScene', GameScene);
#endinitclip
frame 1 {
_root._AudioManager.playSound('dog_bark_long');
this.startCrawl = function () {
GameScene.sceneSetup.scene = 'fence';
GameScene.sceneSetup.warp = 'to_alley';
GameScene.fadeOut();
};
this.onPlayerStab = function () {
this.gino.gotoAndPlay('slain');
};
}
instance to_end of movieClip 398 WarpAreaLeft {
onClipEvent (load) {
this.is_warp = true;
this.gotoScene = 'endgame';
this.gotoWarp = 'nothing_lol';
}
}
instance holewarp of movieClip 348 TriggerBoxforFence2 {
onClipEvent (load) {
this.onTriggered = function () {
this._parent.locked = true;
this._parent.player.setDir(1);
this._parent.player.setAnimation('bucket_crawl');
};
}
}
}
movieClip 485 TextBubbles Trashcan Popcorn {
#initclip
Object.registerClass('TextBubbles Trashcan Popcorn', Dialogue);
#endinitclip
frame 1 {
this._visible = false;
this.onTextStarted = function () {
GameScene.current.crow2.popcorn.popcorn.setTalking(false);
};
this.preTextComplete = this.onTextStarted;
stop();
}
frame 2 {
GameScene.current.crow2.popcorn.popcorn.setTalking(true);
}
frame 8 {
GameScene.current.crow2.popcorn.popcorn.setTalking(true);
}
frame 18 {
GameScene.current.crow2.popcorn.popcorn.setTalking(true);
}
frame 31 {
GameScene.current.crow2.popcorn.popcorn.setTalking(true);
}
frame 37 {
GameScene.current.crow2.popcorn.popcorn.setTalking(true);
}
frame 43 {
GameScene.current.crow2.popcorn.popcorn.setTalking(true);
}
frame 53 {
GameScene.current.crow2.popcorn.popcorn.setTalking(true);
}
frame 61 {
GameScene.current.crow2.popcorn.popcorn.setTalking(true);
}
frame 70 {
GameScene.current.crow2.popcorn.popcorn.setTalking(true);
}
frame 80 {
GameScene.current.crow2.popcorn.popcorn.setTalking(true);
}
frame 91 {
GameScene.current.crow2.popcorn.popcorn.setTalking(true);
}
}
movieClip 487 item - bottlecap {
#initclip
Object.registerClass('item - bottlecap', ItemPickup);
#endinitclip
}
movieClip 501 {
}
movieClip 502 {
frame 1 {
stop();
}
frame 5 {
stop();
}
}
movieClip 509 {
frame 52 {
if (Math.random() < 0.5600000000000001) {
gotoAndPlay(1);
}
}
}
movieClip 515 Bottlepop bounce newhat {
#initclip
Object.registerClass('Bottlepop bounce newhat', NPC);
#endinitclip
frame 1 {
if (this.ready === undefined) {
this.ready = true;
this.gotoAndPlay(random(this._totalframes) + 1);
}
}
}
movieClip 516 {
frame 1 {
stop();
}
frame 5 {
stop();
}
}
movieClip 517 Bottlepop scared {
#initclip
Object.registerClass('Bottlepop scared', NPC);
#endinitclip
}
movieClip 529 {
frame 49 {
_parent.gotoAndStop('idle');
setTimeout(function () {
GameScene.current.popcorn_text.playText('thanks_pal');
}, 5);
}
}
movieClip 530 Bottlepop bounce oldhat {
#initclip
Object.registerClass('Bottlepop bounce oldhat', NPC);
#endinitclip
}
movieClip 532 {
frame 27 {
Inventory.current.addItem(GameScene.current.bottlecap, 1);
GameState.setState('got-bottlecap', 1);
Inventory.current.useItem('paperhat');
}
frame 83 {
stop();
_root.ngMedal.unlock('Frikken Cool');
_parent._parent.baconcheeks.play();
_parent._parent.onTrade();
_parent.gotoAndStop('idle_newhat');
}
}
movieClip 533 {
frame 1 {
if (GameState.getState('got-bottlecap')) {
this.gotoAndStop('idle_newhat');
} else {
if (GameState.getState('crow2-gone')) {
this.gotoAndStop('idle');
}
}
stop();
}
}
movieClip 548 {
frame 3 {
if (Math.random() < 0.6) {
_root._AudioManager.playSound(Math.random() < 0.5 ? 'caw' : 'crow2');
}
}
frame 12 {
_root._AudioManager.playSound('plink');
}
frame 20 {
if (Math.round() < 0.5) {
gotoAndPlay('small');
}
}
frame 25 {
_root._AudioManager.playSound('plink');
}
frame 33 {
if (Math.round() < 0.2) {
gotoAndPlay('small');
}
}
frame 37 {
_root._AudioManager.playSound('plink');
}
frame 89 {
if (Math.round() < 0.5) {
gotoAndPlay('wait');
}
}
}
movieClip 561 {
frame 2 {
_root._AudioManager.playSound('caw');
}
frame 19 {
_root._AudioManager.playSound('crow_fly');
}
frame 87 {
_root._AudioManager.nextScene();
_parent.popcorn.gotoAndStop('saved');
_root.ngMedal.unlock('Crow Away');
}
frame 98 {
GameScene.current.locked = false;
_parent.gotoAndStop('popcorn_only');
stop();
}
}
movieClip 570 {
}
movieClip 577 {
}
movieClip 579 {
}
movieClip 580 {
frame 1 {
stop();
}
frame 117 {
stop();
}
frame 198 {
stop();
}
}
movieClip 581 {
frame 1 {
this.click_interactive = true;
this.inventory_interactive = true;
if (!GameState.getState('crow2-gone')) {
this.inventory_interactive = true;
this.onEnterFrame = function () {
if (_parent.player._x > 523) {
--_parent.player._x;
GameScene.current.stopPlayer();
GameScene.current.player.setAnimation('no');
}
};
} else {
gotoAndStop('popcorn_only');
}
}
frame 2 {
this.onItemDropped = function (item, point) {
if (this.hitbox.contains(point)) {
if (item === 'toothpick') {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
GameScene.current.stopPlayer();
GameScene.current.player.setAnimation('no');
return true;
}
};
this.onTriggered = function () {
GameScene.current.locked = true;
GameScene.current.stopPlayer();
GameScene.current.player.setDir(1);
GameScene.current.player.setAnimation('stab');
GameScene.current.onPlayerStab = function () {
GameScene.current.crow2.gotoAndStop('poked');
};
};
var banter = [['help', 'popcorn_scream'], 'blank', ['stay_back', 'popcorn_shocked'], ['leave_me_alone', 'popcorn_defensive'], ['shoo', 'popcorn_defensive2'], ['sob', 'popcorn_sob'], 'blank', 'blank'];
GameScene.current.popcorn_text.playTextArray(banter, Dialogue.delay_slow, 500, 750);
stop();
}
frame 8 {
this.onEnterFrame = function () {};
GameScene.current.popcorn_text.stopText();
GameState.setState('crow2-gone', 1);
}
frame 18 {
this.triggermode = 'talk';
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
this.triggermode = 'talk';
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onItemDropped = function (item, point) {
if (this.hitbox.contains(point)) {
if (item === 'paperhat') {
this.triggermode = 'hat';
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
GameScene.current.stopPlayer();
GameScene.current.player.setAnimation('no');
return true;
}
};
var nohat_banter = [['handy', 'popcorn_talk'], ['cooler', 'popcorn_talk2'], ['asscrows', 'popcorn_cocky2']];
var hat_banter = [['cool', 'popcorn_wonder'], ['thanks_pal', 'popcorn_talk2']];
GameScene.current.popcorn_text.setBanter('nohat', nohat_banter);
GameScene.current.popcorn_text.setBanter('hat', hat_banter);
this.onTrade = function () {
GameScene.current.popcorn_text.playTextArray([['cool', 'popcorn_wonder']], Dialogue.delay_slow, 2000, 0, function () {
GameScene.current.player.setDir(-1);
GameScene.current.popcorn_text.playTextArray([['baconhat_1', 'bacon_intrigued'], ['baconhat_2', 'bacon_amused'], ['baconhat_3', 'bacon_giveit']], Dialogue.delay_slow, 500, 0, function () {
GameScene.current.player.setAnimation('no');
setTimeout(function () {
GameScene.current.popcorn_text.playTextArray([['baconhat_4', 'bacon_wel_well'], ['baconhat_5', 'bacon_smug2'], ['baconhat_6', 'bacon_smug']], Dialogue.delay_slow, 500, 0, function () {
GameScene.current.crow2.baconcheeks.play();
GameScene.current.locked = false;
}, this);
}, 1200);
}, this);
}, this);
};
this.onTriggered = function () {
if (this.triggermode === 'talk') {
var v2 = GameState.getState('got-bottlecap') ? 'hat' : 'nohat';
GameScene.current.popcorn_text.playBanter(v2, Dialogue.delay_normal, 500);
} else {
if (this.triggermode === 'hat') {
GameState.setState('bacon-cheeks-location', 'parking');
GameScene.current.locked = true;
GameScene.current.popcorn_text.playText(['trade', 'popcorn_question'], Dialogue.delay_slow, 500, function () {
this.popcorn.gotoAndStop('trade_hats');
}, this);
}
}
};
}
}
movieClip 588 {
frame 30 {
if (Math.random() < 0.8) {
gotoAndPlay(1);
}
}
}
movieClip 596 {
frame 5 {
GameScene.current.player.setAnimation('crow_scare');
_root._AudioManager.playSound('caw');
}
frame 23 {
_root._AudioManager.playSound('caw', 80);
}
frame 68 {
GameScene.current.locked = false;
GameScene.current.player.setAnimation('idle');
_parent.gotoAndStop('idle');
}
}
movieClip 599 {
frame 17 {
_root._AudioManager.playSound('coin_drop');
}
frame 82 {
_root._AudioManager.playSound('crow_fly');
}
frame 130 {
GameScene.current.locked = false;
_parent.gotoAndStop('off');
}
}
movieClip 600 {
frame 1 {
if (!GameState.getState('crow1-gone')) {
this.inventory_interactive = true;
this.onEnterFrame = function () {
if (_parent.player._x > 273) {
--_parent.player._x;
GameScene.current.stopPlayer();
GameScene.current.locked = 1;
this.gotoAndStop('angry');
}
};
} else {
gotoAndStop('off');
}
}
frame 2 {
this.onItemDropped = function (item, point) {
if (this.hitbox.contains(point)) {
if (item === 'penny') {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
GameScene.current.stopPlayer();
GameScene.current.player.setAnimation('no');
return true;
}
};
this.onTriggered = function () {
GameScene.current.locked = true;
Inventory.current.useItem('penny');
GameScene.current.stopPlayer();
GameScene.current.player.setDir(1);
GameScene.current.player.setAnimation('throw');
GameScene.current.onSausageThrow = function () {
GameScene.current.crow1.gotoAndStop('grab_penny');
};
};
stop();
}
frame 13 {
stop();
}
frame 19 {
GameState.setState('crow1-gone', 1);
this.onEnterFrame = function () {};
}
}
movieClip 601 trashCanScene {
#initclip
Object.registerClass('trashCanScene', GameScene);
#endinitclip
instance to_parking of movieClip 398 WarpAreaLeft {
onClipEvent (load) {
this.gotoScene = 'parking';
this.gotoWarp = 'to_trash_can';
}
}
instance bottlecap of movieClip 487 item - bottlecap {
onClipEvent (load) {
this.item_name = 'bottlecap';
this._visible = false;
}
}
}
movieClip 609 TextBubbles baconcheeks counter {
#initclip
Object.registerClass('TextBubbles baconcheeks counter', Dialogue);
#endinitclip
}
movieClip 611 {
}
movieClip 612 item - toothpick {
#initclip
Object.registerClass('item - toothpick', ItemPickup);
#endinitclip
frame 1 {
this.has_depth = true;
}
}
movieClip 615 item - penny {
#initclip
Object.registerClass('item - penny', ItemPickup);
#endinitclip
}
movieClip 620 {
}
movieClip 623 {
}
movieClip 624 {
}
movieClip 634 {
}
movieClip 646 {
frame 1 {
this.click_interactive = true;
if (GameState.getState('bacon-cheeks')) {
gotoAndStop('off');
}
stop();
}
frame 256 {
GameScene.current.locked = false;
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
_parent.player.setDir(-1);
GameScene.current.bacon_text.playBanter('banter', Dialogue.delay_normal, 500, function () {
nacho._xscale = 100;
this.playBanter();
}, this);
};
var banter = [['banter_1', 'bacon_amused'], ['banter_2', 'bacon_intrigued'], ['banter_3', 'bacon_amused2'], ['banter_4', 'bacon_smug'], ['banter_5', 'bacon_smug2'], ['banter_6', 'bacon_mock3']];
GameScene.current.bacon_text.setBanter('banter', banter);
stop();
}
frame 347 {
stop();
}
}
movieClip 651 {
frame 1 {
stop();
}
frame 2 {
_root._AudioManager.playSound('ding');
}
frame 58 {
_parent.enterElevator();
stop();
}
}
movieClip 652 {
frame 1 {
this.inventory_interactive = true;
this.click_interactive = true;
this.onItemDropped = function (item, point) {
if (this.hitbox.contains(point) || this.hitbox2.contains(point)) {
if (item === 'clubkey') {
GameState.setState('elevator-unlocked', 1);
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
}
};
this.onUserClick = function (point) {
if (GameState.getState('elevator-unlocked') && this.hitbox2.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.locked = true;
if (GameState.getState('bacon-cheeks-location') == 'counter') {
GameState.setState('bacon-cheeks-in-elevator', 1);
GameState.setState('bacon-cheeks-location', 'club');
_parent.burger.gotoAndPlay('exit');
} else {
GameState.setState('bacon-cheeks-in-elevator', 0);
}
_parent.elevator.play();
};
}
}
movieClip 662 {
}
movieClip 663 {
frame 1 {
stop();
}
frame 5 {
stop();
}
}
movieClip 666 {
frame 88 {
if (Math.random() < 0.6) {
gotoAndPlay(1);
}
}
}
movieClip 670 Recruiter {
#initclip
Object.registerClass('Recruiter', NPC);
#endinitclip
frame 1 {
stop();
}
}
movieClip 688 {
}
movieClip 689 {
frame 1 {
this.click_interactive = true;
}
frame 2 {
this.interacting = null;
this.onUserClick = function (point) {
if (this.hitbox_nacho.contains(point)) {
this.interacting = 'nacho';
GameScene.current.walkTo(null, walkto.getPoint(), this);
return true;
} else {
if (this.hitbox_popcorn.contains(point)) {
this.interacting = 'popcorn';
GameScene.current.walkTo(null, walkto.getPoint(), this);
return true;
}
}
};
this.onTriggered = function () {
_parent.player.setDir(1);
if (this.interacting == 'nacho') {
nacho.gotoAndStop('left');
GameScene.current.nacho_text.playBanter('working', Dialogue.delay_normal, 500, function () {
nacho.gotoAndStop('right');
this.playBanter();
}, this);
} else {
GameScene.current.nacho_text.playText(['tee_hee', 'popgorngirl_teehee'], Dialogue.delay_slow, 1000, function () {
this.playBanter();
}, this);
}
};
var flirting = [['flirt_1', 'nachos_flirt'], ['flirt_2', 'nachos_flirt2'], ['flirt_3', 'nachos_quiet'], ['flirt_4', 'nachos_creep'], ['flirt_5', 'nachos_flirt2'], ['flirt_6', 'nachos_creep2'], ['flirt_7', 'nachos_talk_long'], ['flirt_8', 'nachos_exclaim'], ['tee_hee', 'popgorngirl_teehee'], ['flirt_9', 'nachos_quiet'], ['flirt_10', 'nachos_creep3']];
GameScene.current.nacho_text.setBanter('flirt', flirting);
var annoyed = [['working_1', 'nachos_annoyed'], ['working_2', 'tony_what'], ['working_3', 'tony_threaten2'], ['working_4', 'nachos_annoyed']];
GameScene.current.nacho_text.setBanter('working', annoyed);
GameScene.current.nacho_text.preTextComplete = function () {
GameScene.current.nacho_popcorn.nacho.setTalking(false);
};
this.playBanter = function () {
if (this._x - _parent.player._x > 320) {
this.started = false;
return undefined;
}
nacho.gotoAndStop('right');
GameScene.current.nacho_text.playBanter('flirt', Dialogue.delay_normal, 1000, function () {
this.playBanter();
}, this);
};
this.started = false;
this.onEnterFrame = function () {
if (this.started) {
return undefined;
}
if (this._x - _parent.player._x <= 320) {
this.started = true;
this.playBanter();
}
};
stop();
}
}
movieClip 706 TextBubbles popcorn_nachocreep {
#initclip
Object.registerClass('TextBubbles popcorn_nachocreep', Dialogue);
#endinitclip
frame 1 {
stop();
}
frame 2 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 9 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 16 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 24 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 31 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 39 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 46 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 53 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 60 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 67 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 75 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 85 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 95 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
frame 105 {
GameScene.current.nacho_popcorn.nacho.setTalking(true);
}
}
movieClip 707 counteTopScene {
#initclip
Object.registerClass('counteTopScene', GameScene);
#endinitclip
frame 1 {
this.enterElevator = function () {
GameScene.sceneSetup.scene = 'elevator_down';
GameScene.sceneSetup.warp = null;
GameScene.fadeOut();
};
}
instance penny of movieClip 615 item - penny {
onClipEvent (load) {
this.item_name = 'penny';
}
}
instance toothpick of movieClip 612 item - toothpick {
onClipEvent (load) {
this.item_name = 'toothpick';
if (GameState.getState('bacon-cheeks')) {
this.hide();
} else {
this.preTrigger = function () {
_root.ngMedal.unlock('Excalibur');
_parent.player.setDir(-1);
GameScene.current.locked = true;
_parent.burger.play();
GameState.setState('bacon-cheeks-location', 'counter');
GameState.setState('bacon-cheeks', 1);
};
}
}
}
}
movieClip 709 item - gummybear {
#initclip
Object.registerClass('item - gummybear', ItemPickup);
#endinitclip
frame 1 {
this.has_depth = false;
}
}
movieClip 714 {
frame 1 {
this.click_interactive = true;
GameScene.current.locked = false;
this.onUserClick = function (point) {
if (this.hitbox_left.contains(point)) {
GameScene.current.walkTo(null, this.walkto_left.getPoint(), this);
return true;
}
if (this.hitbox_right.contains(point)) {
GameScene.current.walkTo(null, this.walkto_right.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
var v3 = this._x > _parent.player._x ? -1 : 1;
_parent.player.setDir(v3);
GameScene.current.locked = true;
_parent.player.setAnimation('bucket_crawl');
};
stop();
}
frame 3 {
_root._AudioManager.playSound('bucket_lift');
}
frame 44 {
_root._AudioManager.playSound('bucket_drop');
stop();
}
frame 46 {
_root._AudioManager.playSound('bucket_lift');
}
frame 85 {
_root._AudioManager.playSound('bucket_drop');
stop();
}
frame 87 {
_root._AudioManager.playSound('bucket_lift', 60);
}
frame 97 {
_root._AudioManager.playSound('bucket_drop');
}
frame 103 {
gotoAndStop(1);
}
frame 105 {
_root._AudioManager.playSound('bucket_lift', 60);
}
frame 115 {
_root._AudioManager.playSound('bucket_drop');
}
frame 121 {
gotoAndStop(1);
}
}
movieClip 717 Tub1Scared {
#initclip
Object.registerClass('Tub1Scared', NPC);
#endinitclip
}
movieClip 720 Tub3Scared {
#initclip
Object.registerClass('Tub3Scared', NPC);
#endinitclip
}
movieClip 725 Tub2Scared {
#initclip
Object.registerClass('Tub2Scared', NPC);
#endinitclip
}
movieClip 728 Tub1Static {
#initclip
Object.registerClass('Tub1Static', NPC);
#endinitclip
}
movieClip 733 Tub2Static {
#initclip
Object.registerClass('Tub2Static', NPC);
#endinitclip
}
movieClip 738 Tub3Static {
#initclip
Object.registerClass('Tub3Static', NPC);
#endinitclip
}
movieClip 739 {
frame 1 {
this.click_interactive = true;
this.click_target = null;
this.npcs = ['monacle', 'fez', 'scarf'];
this.talk_dirs = {'monacle': -1, 'fez': 1, 'scarf': -1};
if (GameState.getState('bear-aggro')) {
gotoAndStop('gummy');
}
}
frame 2 {
GameScene.current.doctor_text.setBanter('monacle_b4', [['time_space', 'popcorn_pondering'], ['past_present', 'popcorn_talk3'], ['too_small', 'popcorn_wonder'], ['gentleman', 'popcorn_certain']]);
GameScene.current.doctor_text.setBanter('scarf_b4', [['curling', 'popcorn_certain'], ['rain', 'popcorn_talk'], ['something', 'popcorn_wonder'], 'hmmm']);
GameScene.current.doctor_text.setBanter('fez_b4', [['favorite', 'popcorn_talk'], ['bigger', 'popcorn_certain'], ['timey', 'popcorn_insulted'], ['bowties', 'popcorn_cocky2']]);
GameScene.current.doctor_text.preTextComplete = function () {
if (GameScene.current.doctors.scarf._xscale < 0) {
GameScene.current.doctors.scarf._xscale *= -1;
}
GameScene.current.stoptalk();
};
this.onUserClick = function (point) {
var v2 = 0;
while (v2 < this.npcs.length) {
if (this['hitbox_' + this.npcs[v2]].contains(point)) {
GameScene.current.stoptalk();
GameScene.current.walkTo(null, this['walkto_' + this.npcs[v2]].getPoint(), this);
this.click_target = this.npcs[v2];
return true;
}
++v2;
}
};
this.onTriggered = function () {
_parent.player.setDir(this.talk_dirs[this.click_target]);
if (this.click_target == 'scarf') {
if (this.scarf._xscale > 0) {
this.scarf._xscale *= -1;
}
}
GameScene.current.doctor_text.playBanter(this.click_target + '_b4');
};
stop();
}
frame 15 {
GameScene.current.doctor_text.setBanter('monacle_b4', [['bothersome', 'popcorn_insulted'], ['brave', 'popcorn_shocked']]);
GameScene.current.doctor_text.setBanter('scarf_b4', [['gone', 'popcorn_shocked'], ['safe', 'popcorn_defensive3']]);
GameScene.current.doctor_text.setBanter('fez_b4', [['gethim', 'popcorn_defensive2'], ['where', 'popcorn_defensive3']]);
GameScene.current.doctor_text.preTextComplete = function () {
GameScene.current.stoptalk();
};
this.onUserClick = function (point) {
if (GameState.getState('bear-inside')) {
return undefined;
}
var v2 = 0;
while (v2 < this.npcs.length) {
GameScene.current.stoptalk();
if (this['hitbox_' + this.npcs[v2]].contains(point)) {
GameScene.current.walkTo(null, this['walkto_' + this.npcs[v2]].getPoint(), this);
this.click_target = this.npcs[v2];
return true;
}
++v2;
}
};
this.onTriggered = function () {
_parent.player.setDir(this.talk_dirs[this.click_target]);
GameScene.current.doctor_text.playBanter(this.click_target + '_b4');
};
stop();
}
}
movieClip 741 {
}
movieClip 742 {
frame 1 {
_parent.onLanded(0);
}
frame 22 {
_parent.onLanded(0);
}
frame 43 {
_parent.onLanded(0);
}
frame 64 {
_parent.onLanded(0);
}
frame 68 {
_root._AudioManager.playSound('bounce');
}
frame 86 {
_parent.onLanded(this._xscale > 0 ? -1 : 1);
}
frame 89 {
_root._AudioManager.playSound('bounce');
}
frame 112 {
_parent.onLanded(this._xscale > 0 ? 1 : -1);
}
frame 115 {
_root._AudioManager.playSound('bounce');
}
frame 144 {
this._xscale *= -1;
}
}
movieClip 748 {
frame 1 {
var taunt = GameState.getState('bear-taunt', 0);
++taunt;
if (taunt > this._totalframes) {
taunt = 1;
}
GameState.setState('bear-taunt', taunt);
trace(taunt);
if (taunt == 1) {
_root._AudioManager.playSound('gummy_never');
}
this.gotoAndStop(taunt);
}
frame 2 {
_root._AudioManager.playSound('gummy_never');
}
frame 3 {
_root._AudioManager.playSound('gummy_taunt');
}
frame 4 {
_root._AudioManager.playSound('gummy_noway');
}
frame 5 {
_root._AudioManager.playSound('gummy_suckit');
}
}
movieClip 750 {
frame 1 {
var to = setTimeout(function () {
GameScene.current.bear.bear.play();
}, Dialogue.delay_normal);
stop();
}
frame 2 {
_parent.startBouncing();
}
frame 14 {
_root._AudioManager.playSound('bounce');
}
frame 45 {
_root._AudioManager.playSound('bounce');
}
frame 73 {
_root._AudioManager.playSound('bounce');
}
frame 95 {
_parent.doEscape();
stop();
}
}
movieClip 753 {
frame 1 {
this.inventory_interactive = true;
this.has_depth = false;
this.click_interactive = true;
this.onItemDropped = function (item, point) {};
this.onUserClick = function () {};
if (GameState.getState('bear-caught')) {
this.gotoAndStop('trap_off');
} else {
if (GameState.getState('trap-set') && GameState.getState('bear-inside')) {
this.gotoAndStop('bear_trapped');
} else {
if (GameState.getState('trap-set')) {
this.gotoAndStop('trap_set');
} else {
if (GameState.getState('bear-inside')) {
this.gotoAndStop('bear_pacing');
} else {
this.gotoAndStop('off');
}
}
}
}
}
frame 2 {
this.onItemDropped = function (item, point) {
if (this.hitbox.contains(point)) {
if (item === 'mousetrap') {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
GameScene.current.stopPlayer();
GameScene.current.player.setAnimation('no');
return true;
}
};
this.onTriggered = function () {
_parent.placeTrap();
Inventory.current.useItem('mousetrap');
this.onItemDropped = function (item, point) {};
this.gotoAndStop('trap_set');
};
}
frame 10 {
this.side = 0;
this.startEscape = false;
this.onLanded = function (side) {
this.side = side;
if (this.startEscape) {
if (side === 0) {
this.doEnterFrame = null;
this.startEscape = false;
this.gotoAndStop('bear_escape');
} else {
this.bear.gotoAndPlay('to_center');
this.bear._xscale = side > 0 ? 100 : -100;
}
}
};
this.doEnterFrame = function () {
if (Math.abs(this._x - _parent.player._x) <= 320) {
GameScene.current.stopPlayer();
GameScene.current.locked = true;
this.startEscape = true;
}
};
this.onUserClick = function (point) {
if (this.hitbox_left.contains(point)) {
GameScene.current.walkTo(null, this.walkto_left.getPoint(), this);
return true;
}
if (this.hitbox_right.contains(point)) {
GameScene.current.walkTo(null, this.walkto_right.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
var v3 = this._x > _parent.player._x ? -1 : 1;
_parent.player.setDir(v3);
GameScene.current.locked = true;
_parent.player.setAnimation('bucket_crawl');
};
}
frame 22 {
this.startBouncing = function () {
bear._xscale = _parent.player._x > this._x ? 100 : -100;
};
this.doEscape = function () {
_parent.bucket.gotoAndPlay(_parent.player._x < this._x ? 'bear_right' : 'bear_left');
this.gotoAndStop('off');
};
GameState.setState('bear-inside', 0);
}
frame 43 {
_parent.gummybear.show();
}
}
movieClip 779 TextBubbles The Doctors {
#initclip
Object.registerClass('TextBubbles The Doctors', Dialogue);
#endinitclip
frame 1 {
this._visible = false;
stop();
}
frame 2 {
GameScene.current.doctors.monacle.setTalking(true);
}
frame 12 {
GameScene.current.doctors.monacle.setTalking(true);
}
frame 23 {
GameScene.current.doctors.monacle.setTalking(true);
}
frame 32 {
GameScene.current.doctors.monacle.setTalking(true);
}
frame 48 {
GameScene.current.doctors.monacle.setTalking(true);
}
frame 58 {
GameScene.current.doctors.monacle.setTalking(true);
}
frame 69 {
GameScene.current.doctors.scarf.setTalking(true);
}
frame 76 {
GameScene.current.doctors.scarf.setTalking(true);
}
frame 82 {
GameScene.current.doctors.scarf.setTalking(true);
}
frame 91 {
GameScene.current.doctors.scarf.setTalking(true);
}
frame 98 {
GameScene.current.doctors.scarf.setTalking(true);
}
frame 104 {
GameScene.current.doctors.scarf.setTalking(true);
}
frame 115 {
GameScene.current.doctors.fez.setTalking(true);
}
frame 123 {
GameScene.current.doctors.fez.setTalking(true);
}
frame 130 {
GameScene.current.doctors.fez.setTalking(true);
_root.ngMedal.unlock('Timey Wimey Thing');
}
frame 137 {
GameScene.current.doctors.fez.setTalking(true);
}
frame 145 {
GameScene.current.doctors.fez.setTalking(true);
}
frame 152 {
GameScene.current.doctors.fez.setTalking(true);
}
}
movieClip 780 popcornHouseScene {
#initclip
Object.registerClass('popcornHouseScene', GameScene);
#endinitclip
frame 1 {
this.stoptalk = function () {
GameScene.current.doctors.fez.setTalking(false);
GameScene.current.doctors.monacle.setTalking(false);
GameScene.current.doctors.scarf.setTalking(false);
};
this.enterHole = function () {
GameScene.sceneSetup.scene = 'parking';
GameScene.sceneSetup.warp = this.player._x > this.bucket._x ? 'bucket_point_right' : 'bucket_point_left';
GameScene.fadeOut();
};
this.startCrawl = function () {
this.bucket.gotoAndPlay(this.player._x > this.bucket._x ? 'open_right' : 'open_left');
};
this.placeTrap = function () {
GameState.setState('trap-set', 1);
this.hasTrap();
};
this.hasTrap = function () {
this.full_floor.active = false;
};
this.noTrap = function () {
this.full_floor.active = true;
};
this.gummybear.hide();
if (!GameState.getState('bear-caught') && GameState.getState('trap-set') && GameState.getState('bear-inside')) {
this.gummybear.show();
}
setTimeout(function () {
if (GameState.getState('trap-set')) {
GameScene.current.hasTrap();
} else {
GameScene.current.noTrap();
}
GameScene.current.initScene();
}, 5);
}
instance bear of movieClip 753 {
onClipEvent (enterFrame) {
if (this.doEnterFrame !== undefined && this.doEnterFrame) {
this.doEnterFrame();
}
}
}
instance gummybear of movieClip 709 item - gummybear {
onClipEvent (load) {
this.item_name = 'gummybear';
this.preTrigger = function () {
_root.ngMedal.unlock('Dog Catcher');
GameState.setState('bear-caught', 1);
GameScene.current.doctor_text.playText(['unsavory', 'popcorn_cocky'], Dialogue.delay_normal, 0, 500);
};
}
}
}
movieClip 781 VIPstatic {
#initclip
Object.registerClass('VIPstatic', NPC);
#endinitclip
}
movieClip 807 TextBubbles Boss Burger {
#initclip
Object.registerClass('TextBubbles Boss Burger', Dialogue);
#endinitclip
frame 1 {
this.onTextStarted = function () {
_parent.stoptalk();
};
this.preTextComplete = this.onTextStarted;
}
frame 2 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 10 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 16 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 27 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 37 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 46 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 54 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 65 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 73 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 82 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 91 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 100 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 108 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 118 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 130 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 138 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 144 {
GameScene.current.boss.gotoAndStop('talking');
_parent.shareKeys();
}
frame 152 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 162 {
GameScene.current.boss.gotoAndStop('talking');
}
frame 175 {
GameScene.current.murder_scene2.gino.setTalking(true);
}
frame 184 {
GameScene.current.murder_scene2.gino.setTalking(true);
}
frame 195 {
GameScene.current.murder_scene2.gino.setTalking(true);
}
frame 205 {
GameScene.current.murder_scene.kid.setTalking(true);
}
}
movieClip 809 item - clubkey {
#initclip
Object.registerClass('item - clubkey', ItemPickup);
#endinitclip
frame 30 {
GameState.setState('can-pickup-the-key', 1);
this.active = true;
gotoAndStop(1);
}
}
movieClip 814 {
frame 1 {
stop();
}
frame 2 {
_root._AudioManager.playSound('door');
}
frame 9 {
_parent.exitOffice();
}
frame 25 {
stop();
}
}
movieClip 822 {
frame 58 {
if (Math.random() < 0.5) {
gotoAndPlay(1);
}
}
}
movieClip 841 {
}
movieClip 842 {
frame 1 {
this.click_interactive = true;
this.banter_1 = [['want_job', 'boss_burger1'], ['okay', 'boss_burger2'], ['gino_missing', 'boss_burger1'], ['find_family', 'boss_burger2'], ['made_man', 'boss_burger3']];
this.banter_2 = [['help_me', 'boss_burger1'], ['wife_worried', 'boss_burger2'], ['little_girl', 'boss_burger3']];
this.banter_3 = [['did_good2', 'boss_burger3'], ['call_if_needed', 'boss_burger2']];
}
frame 2 {
GameScene.current.boss_text.setBanter('waiting', this.banter_2);
GameScene.current.boss_text.setBanter('happy', this.banter_3);
this.onUserClick = function (point) {
if (GameState.getState('boss-state') === 'gino_family') {
return undefined;
}
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.stoptalk();
switch (GameState.getState('boss-state', 'first')) {
case 'first':
GameState.setState('boss-state', 'waiting');
GameScene.current.locked = true;
GameScene.current.boss.gotoAndStop('talking');
GameScene.current.boss_text.playTextArray(this.banter_1, Dialogue.delay_normal, 500, 0, function () {
GameScene.current.boss.gotoAndStop('idle');
GameScene.current.locked = false;
});
break;
case 'waiting':
GameScene.current.boss.gotoAndStop('talking');
GameScene.current.boss_text.playBanter('waiting', function () {
GameScene.current.boss.gotoAndStop('idle');
});
break;
case 'happy':
GameScene.current.boss.gotoAndStop('talking');
GameScene.current.boss_text.playBanter('happy', function () {
GameScene.current.boss.gotoAndStop('idle');
});
}
};
stop();
}
}
movieClip 845 {
frame 1 {
this.click_interactive = true;
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.locked = true;
_parent.office_door.play();
};
}
}
movieClip 855 {
}
movieClip 856 {
frame 1 {
stop();
}
frame 5 {
stop();
}
}
movieClip 857 BullyStatic {
#initclip
Object.registerClass('BullyStatic', NPC);
#endinitclip
}
movieClip 867 {
}
movieClip 868 {
frame 1 {
stop();
}
frame 5 {
stop();
}
}
movieClip 881 GinoCry {
#initclip
Object.registerClass('GinoCry', NPC);
#endinitclip
}
movieClip 903 {
frame 1 {
stop();
}
frame 160 {
_parent.ginoFamMurdered();
stop();
}
}
movieClip 909 {
}
movieClip 916 {
}
movieClip 917 {
frame 1 {
stop();
}
}
movieClip 931 DaughterCry {
#initclip
Object.registerClass('DaughterCry', NPC);
#endinitclip
}
movieClip 948 {
}
movieClip 949 {
frame 1 {
stop();
}
frame 99 {
stop();
}
}
movieClip 961 {
frame 2 {
if (!GameState.getState('murder-scene-complete')) {
_root._AudioManager.playSound('gino_tortured', 60);
}
}
frame 121 {
if (!GameState.getState('murder-scene-complete')) {
_root._AudioManager.playSound('beatdown', 100);
}
}
frame 210 {
if (!GameState.getState('murder-scene-complete')) {
_root._AudioManager.playSound('gino_tortured2', 60);
}
}
frame 330 {
if (!GameState.getState('murder-scene-complete')) {
_root._AudioManager.playSound('crack', 100);
}
}
frame 370 {
if (!GameState.getState('murder-scene-complete')) {
_root._AudioManager.playSound('gino_cry', 60);
}
}
frame 490 {
if (!GameState.getState('murder-scene-complete')) {
_root._AudioManager.playSound('crack', 100);
}
}
frame 611 {
if (!GameState.getState('murder-scene-complete')) {
_root._AudioManager.playSound('smash', 100);
}
}
frame 710 {
if (!GameState.getState('murder-scene-complete')) {
_root._AudioManager.playSound('gino_cry2', 60);
}
GameState.setState('murder-scene-complete', 1);
}
frame 771 {
_root.ngMedal.unlock('Family Reunion');
}
frame 864 {
_parent.murderOver();
}
frame 1359 {
this.audio = false;
stop();
}
}
movieClip 962 officeScene {
#initclip
Object.registerClass('officeScene', GameScene);
#endinitclip
frame 1 {
this.exitOffice = function () {
GameScene.sceneSetup.scene = 'club';
GameScene.sceneSetup.warp = 'exit_office';
GameScene.fadeOut();
};
this.murder_scene._visible = (GameState.getState('boss-state') === 'gino_family') ? true : false;
this.murder_scene2._visible = (GameState.getState('boss-state') === 'gino_family') ? true : false;
this.player.setDir(-1);
}
instance clubkey of movieClip 809 item - clubkey {
onClipEvent (load) {
this.stop();
this.item_name = 'clubkey';
if (!GameState.getState('can-pickup-the-key')) {
this.hide();
}
this.preTrigger = function () {
GameState.setState('can-pickup-the-key', 0);
GameScene.current.boss.gotoAndStop('idle');
};
}
}
instance murder_sounds of movieClip 961 {
onClipEvent (load) {
this.stop();
this._visible = false;
this.audio = false;
}
}
frame 2 {
_root.ngMedal.unlock('Meet The Boss');
this.stoptalk = function () {
GameScene.current.boss.gotoAndStop('idle');
GameScene.current.murder_scene.kid.setTalking(false);
GameScene.current.murder_scene2.gino.setTalking(false);
};
if (GameState.getState('boss-state') === 'gino_family') {
GameScene.current.locked = true;
var txt = [['did_good', 'boss_burger3'], ['son_of_a', 'gino_angry'], ['now_now', 'boss_burger2'], ['nobody', 'boss_burger1'], ['no_choice', 'boss_burger4'], ['take_something', 'boss_burger3'], ['do_anything', 'gino_begging'], ['too_late', 'boss_burger1'], ['daddy', 'kid_cry']];
GameScene.current.boss_text.playTextArray(txt, Dialogue.delay_normal, 500, 1000, function () {
GameScene.current.stoptalk();
this.murder_scene.play();
GameScene.current.boss_text.playText(['kill_you_all', 'gino_vengeful'], function () {
GameScene.current.stoptalk();
this.murder_scene2.play();
}, this);
}, this);
this.ginoFamMurdered = function () {
GameScene.current.stoptalk();
this.murder_sounds._visible = true;
this.murder_sounds.audio = true;
this.murder_sounds.play();
};
this.murderOver = function () {
GameScene.current.stoptalk();
if (GameState.getState('boss-state') === 'gino_family') {
var v2 = [['sorry', 'boss_burger2'], ['keys', 'boss_burger1'], ['make_home', 'boss_burger1']];
GameScene.current.stoptalk();
GameScene.current.boss_text.playTextArray(v2, Dialogue.delay_normal, 500, 500, function () {
GameScene.current.stoptalk();
GameState.setState('boss-state', 'happy');
GameScene.current.locked = false;
}, this);
}
};
this.shareKeys = function () {
this.clubkey._visible = true;
this.clubkey.gotoAndPlay(2);
};
}
stop();
}
}
movieClip 997 TextBubbles strippers {
#initclip
Object.registerClass('TextBubbles strippers', Dialogue);
#endinitclip
frame 1 {
stop();
}
frame 2 {
GameScene.current.strippers.oragami_stripper.stripper.setTalking(true);
}
frame 10 {
GameScene.current.strippers.oragami_stripper.stripper.setTalking(true);
}
frame 19 {
GameScene.current.strippers.oragami_stripper.stripper.setTalking(true);
}
frame 28 {
GameScene.current.strippers.oragami_stripper.stripper.setTalking(true);
}
frame 37 {
GameScene.current.strippers.oragami_stripper.stripper.setTalking(true);
}
frame 46 {
GameScene.current.strippers.oragami_stripper.stripper.setTalking(true);
}
frame 52 {
GameScene.current.strippers.oragami_stripper.stripper.setTalking(true);
}
frame 58 {
GameScene.current.strippers.stripper1.setTalking(true);
}
frame 66 {
GameScene.current.strippers.stripper1.setTalking(true);
}
frame 75 {
GameScene.current.strippers.stripper2.setTalking(true);
}
frame 85 {
GameScene.current.strippers.stripper2.setTalking(true);
}
frame 94 {
GameScene.current.strippers.stripper3.setTalking(true);
}
frame 106 {
GameScene.current.strippers.stripper3.setTalking(true);
}
frame 115 {
GameScene.current.strippers.stripper4.setTalking(true);
}
frame 124 {
GameScene.current.strippers.stripper4.setTalking(true);
}
frame 135 {
GameScene.current.strippers.hostess.setTalking(true);
}
frame 145 {
GameScene.current.strippers.hostess.setTalking(true);
}
frame 154 {
GameScene.current.strippers.hostess.setTalking(true);
}
frame 166 {
GameScene.current.strippers.patron1.gotoAndPlay('wooo');
}
frame 174 {
GameScene.current.strippers.patron1.gotoAndPlay('wooo');
}
frame 182 {
GameScene.current.strippers.patron1.gotoAndPlay('wooo');
}
}
movieClip 998 item - paperhat {
#initclip
Object.registerClass('item - paperhat', ItemPickup);
#endinitclip
}
movieClip 1007 {
}
movieClip 1017 {
}
movieClip 1018 {
frame 1 {
stop();
}
frame 2 {
_root._AudioManager.playSound('door');
}
frame 10 {
_parent.enterOffice();
}
frame 20 {
stop();
}
}
movieClip 1027 {
frame 1 {
stop();
}
}
movieClip 1034 {
frame 1 {
stop();
}
}
movieClip 1035 {
frame 1 {
stop();
}
frame 2 {
_root._AudioManager.playSound('ding');
}
frame 45 {
_parent.enterElevator();
}
frame 58 {
stop();
}
}
movieClip 1044 {
frame 69 {
if (Math.random() < 0.6) {
gotoAndPlay(1);
}
}
frame 93 {
if (Math.random() < 0.3) {
gotoAndPlay('wooo');
}
}
}
movieClip 1051 {
}
movieClip 1052 {
frame 1 {
stop();
}
}
movieClip 1069 BrothelNachoGrind {
#initclip
Object.registerClass('BrothelNachoGrind', NPC);
#endinitclip
frame 1 {
if (Math.random() < 0.5) {
gotoAndPlay('reverse');
}
}
frame 40 {
if (Math.random() < 0.3) {
gotoAndPlay('wink');
}
}
frame 59 {
gotoAndPlay(1);
}
frame 85 {
gotoAndPlay(1);
}
frame 125 {
if (Math.random() < 0.3) {
gotoAndPlay('wink2');
}
}
frame 144 {
gotoAndPlay(1);
}
frame 170 {
gotoAndPlay(1);
}
}
movieClip 1077 {
}
movieClip 1078 {
frame 1 {
stop();
}
}
movieClip 1083 POrigamiDance {
#initclip
Object.registerClass('POrigamiDance', NPC);
#endinitclip
frame 1 {
if (Math.random() < 0.3) {
this._xscale *= -1;
}
}
frame 53 {
if (Math.random() < 0.5) {
gotoAndPlay(1);
}
}
}
movieClip 1088 {
}
movieClip 1092 {
}
movieClip 1099 POrigamiIdle {
#initclip
Object.registerClass('POrigamiIdle', NPC);
#endinitclip
}
movieClip 1100 {
frame 40 {
_root._AudioManager.playSound('stripper_trick');
}
frame 191 {
_root.ngMedal.unlock('Origami');
}
frame 430 {
_parent._parent.getHat();
_parent._parent.onNewHat();
}
frame 431 {
stop();
}
}
movieClip 1101 {
frame 1 {
stop();
}
}
movieClip 1114 PBrothelDance {
#initclip
Object.registerClass('PBrothelDance', NPC);
#endinitclip
}
movieClip 1121 PBrothelBounce {
#initclip
Object.registerClass('PBrothelBounce', NPC);
#endinitclip
frame 1 {
if (this.ready === undefined) {
this.ready = true;
this.gotoAndPlay(random(this._totalframes) + 1);
}
}
}
movieClip 1125 {
}
movieClip 1126 {
frame 1 {
this.inventory_interactive = true;
this.click_interactive = true;
}
instance stripper3 of movieClip 1069 BrothelNachoGrind {
onClipEvent (load) {
gotoAndPlay(Math.round(Math.random() * this._totalframes));
}
}
instance stripper2 of movieClip 1069 BrothelNachoGrind {
onClipEvent (load) {
gotoAndPlay(Math.round(Math.random() * this._totalframes));
}
}
instance stripper1 of movieClip 1114 PBrothelDance {
onClipEvent (load) {
gotoAndPlay(Math.round(Math.random() * this._totalframes));
}
}
instance stripper4 of movieClip 1114 PBrothelDance {
onClipEvent (load) {
gotoAndPlay(Math.round(Math.random() * this._totalframes));
}
}
instance hostess of movieClip 1121 PBrothelBounce {
onClipEvent (load) {
gotoAndPlay(Math.round(Math.random() * this._totalframes));
}
}
frame 2 {
var j;
var patron1_banter;
GameScene.current.dancer_text.preTextComplete = function () {
GameScene.current.strippers.oragami_stripper.stripper.setTalking(false);
GameScene.current.strippers.stripper1.setTalking(false);
GameScene.current.strippers.stripper2.setTalking(false);
GameScene.current.strippers.stripper3.setTalking(false);
GameScene.current.strippers.stripper4.setTalking(false);
GameScene.current.strippers.hostess.setTalking(false);
};
patron1_banter = [['poppy', 'popcorn_shocked'], ['wish_paper', 'popcorn_talk']];
if (!GameState.getState('bacon-cheeks-location')) {
this.oragami_stripper._y = -9999;
this.hitbox_oragami._y = -9999;
this.stripper1._y = -9999;
this.hitbox_1._y = -9999;
this.stripper4._y = -9999;
this.hitbox_4._y = -9999;
this.patron2._y = -9999;
patron1_banter = [['waiting1', 'popcorn_talk'], ['waiting2', 'popcorn_talk3']];
} else {
if (GameState.getState('bacon-cheeks-location') === 'club') {
this.stripper2._y = -9999;
this.hitbox_2._y = -9999;
this.stripper3._y = -9999;
this.hitbox_3._y = -9999;
}
}
this.triggermode = null;
this.dancers = ['1', '2', '3', '4', 'oragami'];
var banter;
banter = [['dancer1_1', 'pdancer_gogogo'], ['dancer1_2', 'pdancer_gogogo2']];
GameScene.current.dancer_text.setBanter('talk_1', banter);
banter = [['dancer2_1', 'pam_talk'], ['dancer2_2', 'pam_talk2']];
GameScene.current.dancer_text.setBanter('talk_2', banter);
banter = [['dancer3_1', 'pnacho_gogogo'], ['dancer3_2', 'pnacho_gogogo2']];
GameScene.current.dancer_text.setBanter('talk_3', banter);
banter = [['dancer4_1', 'pdancer_talk2'], ['dancer4_2', 'pdancer_gogogo2']];
GameScene.current.dancer_text.setBanter('talk_4', banter);
var hostess_banter = GameState.getState('been_to_club') ? [['hostess_1b', 'pdancer_talk2'], ['hostess_2', 'pdancer_encourage']] : [['hostess_1', 'pdancer_talk'], ['hostess_2', 'pdancer_encourage']];
GameScene.current.dancer_text.setBanter('hostess', hostess_banter);
GameScene.current.dancer_text.setBanter('patron1', patron1_banter);
banter = [['oragami_1', 'stripper_question'], ['oragami_2', 'stripper_talk'], ['oragami_3', 'stripper_talk'], ['oragami_4', 'stripper_flirt'], ['oragami_5', 'stripper_kiss']];
GameScene.current.dancer_text.setBanter('talk_oragami', banter);
this.onUserClick = function (point) {
var v4 = 0;
while (v4 < this.dancers.length) {
var v3 = this.dancers[v4];
if (this['hitbox_' + v3].contains(point)) {
this.triggermode = 'talk_' + v3;
GameScene.current.walkTo(null, this['walkto_' + v3].getPoint(), this);
return true;
}
++v4;
}
if (this.hitbox_hostess.contains(point)) {
this.triggermode = 'hostess';
GameScene.current.walkTo(null, _parent.to_club_entrance.getPoint(), this);
return true;
}
if (this.hitbox_patron1.contains(point)) {
this.triggermode = 'patron1';
GameScene.current.walkTo(null, this.walkto_patron.getPoint(), this);
return true;
}
};
this.onItemDropped = function (item, point) {
if (this.hitbox_oragami.contains(point)) {
if (item === 'poster') {
this.triggermode = 'poster';
GameScene.current.walkTo(null, this.walkto_oragami.getPoint(), this);
return true;
}
GameScene.current.stopPlayer();
GameScene.current.player.setAnimation('no');
return true;
}
};
this.onBaconCheeks = function () {
GameState.setState('bacon-cheeks-location', 'bucket');
GameScene.current.locked = false;
};
this.getHat = function () {
Inventory.current.useItem('poster');
Inventory.current.addItem(_parent.paperhat, 1);
};
this.onNewHat = function () {
if (GameState.getState('bacon-cheeks-location') === 'club') {
GameScene.current.baconcheeks.animation.play();
}
GameScene.current.dancer_text.playText(['enjoy', 'stripper_flirt'], Dialogue.delay_normal, 1000, function () {
GameScene.current.strippers.oragami_stripper.gotoAndStop(1);
if (GameState.getState('bacon-cheeks-location') === 'club') {
GameScene.current.player.setDir(-1);
GameScene.current.dancer_text.playTextArray([['baconhat_1', 'bacon_intrigued'], ['baconhat_2', 'bacon_disgusted'], ['baconhat_3', 'bacon_disgusted2'], ['baconhat_4', 'bacon_smug']], Dialogue.delay_normal, 500, 0, function () {
GameScene.current.baconcheeks.animation.play();
});
} else {
GameScene.current.locked = false;
}
}, this);
};
this.onTriggered = function () {
if (this.triggermode === 'poster') {
GameScene.current.locked = true;
GameScene.current.player.setDir(1);
_root._AudioManager.setMovieVolume(0, 0, 20, 0);
GameScene.current.dancer_text.playText(['trick', 'stripper_question'], Dialogue.delay_slow, 500, function () {
this.oragami_stripper.gotoAndStop('trick');
}, this);
} else {
if (this.triggermode === 'hostess') {
GameScene.current.player.setDir(-1);
GameScene.current.dancer_text.playBanter('hostess', Dialogue.delay_normal, 500);
GameState.setState('been_to_club', 1);
} else {
if (this.triggermode === 'patron1') {
GameScene.current.player.setDir(1);
GameScene.current.dancer_text.playBanter('patron1', Dialogue.delay_normal, 500);
} else {
GameScene.current.player.setDir(_parent.player._x > this._x ? -1 : 1);
GameScene.current.dancer_text.playBanter(this.triggermode, Dialogue.delay_normal, 500);
}
}
}
};
stop();
}
}
movieClip 1127 {
frame 1 {
this.click_interactive = true;
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.locked = true;
_parent.office_door.play();
};
}
}
movieClip 1128 {
frame 1 {
this.inventory_interactive = true;
this.click_interactive = true;
this.onItemDropped = function (item, point) {
if (this.hitbox.contains(point) || this.hitbox2.contains(point)) {
if (item === 'clubkey') {
GameState.setState('elevator-unlocked', 1);
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
}
};
this.onUserClick = function (point) {
if (GameState.getState('elevator-unlocked') && this.hitbox2.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.locked = true;
_parent.elevator.play();
};
}
}
movieClip 1129 {
frame 1 {
this.click_interactive = true;
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
_parent.exitClub();
};
}
}
movieClip 1130 {
frame 1 {
stop();
}
frame 46 {
stop();
}
frame 55 {
_root._AudioManager.setMovieVolume(0, 0, 100, 0);
}
frame 96 {
stop();
_parent._parent.strippers.onBaconCheeks();
}
}
movieClip 1131 {
}
movieClip 1144 {
instance of movieClip 1121 PBrothelBounce {
onClipEvent (load) {
gotoAndPlay(Math.round(Math.random() * this._totalframes));
}
}
instance stripper of movieClip 1121 PBrothelBounce {
onClipEvent (load) {
gotoAndPlay(Math.round(Math.random() * this._totalframes));
}
}
}
movieClip 1145 clubScene {
#initclip
Object.registerClass('clubScene', GameScene);
#endinitclip
frame 1 {
this.exitClub = function () {
GameScene.sceneSetup.scene = 'club_entrance';
GameScene.sceneSetup.warp = 'door_pos';
GameScene.fadeOut();
};
this.enterOffice = function () {
GameScene.sceneSetup.scene = 'office';
GameScene.sceneSetup.warp = null;
GameScene.fadeOut();
};
this.enterElevator = function () {
GameScene.sceneSetup.scene = 'elevator_up';
GameScene.sceneSetup.warp = null;
GameScene.fadeOut();
};
}
instance background of movieClip 1007 {
onClipEvent (load) {
this.last_frame = 0;
this.colors = ['off', 'yellow', 'red', 'blue'];
this.iv = setInterval(function () {
var v1 = random(3) + 1;
if (v1 == GameScene.current.bg.last_frame) {
++v1;
if (v1 >= 4) {
v1 = 0;
}
}
GameScene.current.background.last_frame = v1;
GameScene.current.background.gotoAndStop(GameScene.current.background.colors[v1]);
GameScene.current.foreground.gotoAndStop(GameScene.current.background.colors[v1]);
GameScene.current.office_door.door.gotoAndStop(GameScene.current.background.colors[v1]);
GameScene.current.elevator.left.gotoAndStop(GameScene.current.background.colors[v1]);
GameScene.current.elevator.right.gotoAndStop(GameScene.current.background.colors[v1]);
GameScene.current.baconcheeks.gotoAndStop(GameScene.current.background.colors[v1]);
GameScene.current.strippers.gotoAndStop(GameScene.current.background.colors[v1]);
GameScene.current.player.setColor(GameScene.current.background.colors[v1]);
}, 250);
this.stop();
}
onClipEvent (unload) {
clearInterval(this.iv);
}
}
instance baconcheeks of movieClip 1131 {
onClipEvent (load) {
if (GameState.getState('bacon-cheeks-location') != 'club') {
this._visible = false;
}
}
}
instance paperhat of movieClip 998 item - paperhat {
onClipEvent (load) {
this._visible = false;
this.item_name = 'paperhat';
}
}
}
movieClip 1148 {
frame 1 {
this.inventory_interactive = true;
this.onItemDropped = function (item, point) {
if (GameState.getState('interrogation3-over') && item === 'nachocheese' && this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
_parent.gang.onCheesed();
};
}
}
movieClip 1152 VIPsit {
#initclip
Object.registerClass('VIPsit', NPC);
#endinitclip
}
movieClip 1153 {
}
movieClip 1164 {
frame 19 {
stop();
}
}
movieClip 1166 VIPWalk {
#initclip
Object.registerClass('VIPWalk', NPC);
#endinitclip
}
movieClip 1167 {
}
movieClip 1173 {
}
movieClip 1175 {
frame 32 {
_root._AudioManager.playSound('snort_1');
}
frame 101 {
_root._AudioManager.playSound('snort_2');
}
frame 197 {
_root._AudioManager.playSound('snort_1');
}
frame 314 {
_root._AudioManager.playSound('snort_3');
}
instance of movieClip 1173 {
onClipEvent (load) {
this.xx = this._x;
this.yy = this._y;
this.fskip = 2;
}
onClipEvent (enterFrame) {
--this.fskip;
if (this.fskip < 1) {
this.fskip = 2;
this._x = this.xx + random(12) - 6;
this._y = this.yy + random(12) - 6;
}
}
}
frame 511 {
_root._AudioManager.playSound('snort_2');
}
}
movieClip 1178 {
}
movieClip 1179 {
}
movieClip 1180 {
frame 1 {
this.has_depth = true;
this.click_interactive = true;
if (GameState.getState('murder-scene-complete')) {
gotoAndStop('greg');
} else {
if (GameState.getState('gang-has-cheese')) {
gotoAndStop('gang_is_cheesing');
} else {
if (GameState.getState('interrogation3-over')) {
gotoAndStop('tony_is_back');
} else {
gotoAndStop(2);
stop();
}
}
}
}
frame 2 {
var chatter = [['worked_hard', 'nachos_quiet'], ['honest_nacho', 'tony_sincere'], ['stress_relief', 'nachos_quiet'], ['da_stuff', 'nachos_question'], 'dots', ['tube_steak', 'nachos_annoyed'], ['git_mook', 'tony_threaten2'], 'dots2'];
GameScene.current.gang_text.setBanter('bored', chatter);
GameScene.current.gang_text.onTextStarted = function () {
GameScene.current.gang.vip_l.setTalking(false);
GameScene.current.gang.vip_r.setTalking(false);
};
GameScene.current.gang_text.preTextComplete = GameScene.current.gang_text.onTextStarted;
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.player.setDir(-1);
GameScene.current.gang_text.playBanter('bored', Dialogue.delay_normal);
};
}
frame 7 {
GameScene.current.gang_text.preTextComplete = function () {
GameScene.current.gang.tony.tony.setTalking(false);
GameScene.current.gang.vip_l.setTalking(false);
GameScene.current.gang.vip_r.setTalking(false);
};
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onCheesed = function () {
this.gotoAndStop('got_the_stuff');
};
var chatter = [['you_again', 'tony_accuse'], ['no_mood', 'tony_threaten2'], ['f_outta_here', 'tony_threaten'], 'dots3'];
GameScene.current.gang_text.setBanter('nostuff', chatter);
this.onTriggered = function () {
GameScene.current.gang.tony._xscale = -100;
GameScene.current.player.setDir(-1);
GameScene.current.gang_text.playBanter('nostuff', Dialogue.delay_normal, 500, function () {
GameScene.current.gang.tony._xscale = 100;
});
};
}
frame 20 {
Inventory.current.useItem('nachocheese');
GameState.setState('gang-has-cheese', 1);
GameScene.current.gang.tony._xscale = -100;
GameScene.current.locked = true;
_root.ngMedal.unlock('Enabler');
GameScene.current.gang_text.playTextArray([['wait', 'tony_question'], ['say_so', 'tony_excited'], ['friggen_guy', 'tony_excited2']], Dialogue.delay_normal, 500, 0, function () {
this.tony._xscale = 100;
this.nextFrame();
GameScene.current.gang_text.playText(['lets_go', 'tony_leaving'], Dialogue.delay_normal, 500, function () {
this.play();
}, this);
}, this);
}
frame 178 {
GameScene.current.gang_text.preTextComplete = function () {
GameScene.current.gang.tony.setTalking(false);
};
GameScene.current.gang_text.playTextArray([['need_job', 'tony_sincere'], ['tony_triangles', 'tony_leaving']], Dialogue.delay_normal, 500, 500, function () {
this.play();
}, this);
stop();
}
frame 236 {
GameScene.current.locked = false;
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.player.setAnimation('no');
};
stop();
}
instance of movieClip 1175 {
onClipEvent (load) {
gotoAndPlay('delay');
}
}
frame 252 {
var banter = [['gummy_1', 'gummy_story1'], ['gummy_2', 'gummy_story2'], ['gummy_3', 'gummy_story3'], ['gummy_4', 'gummy_story4'], ['gummy_5', 'gummy_story5'], ['gummy_6', 'gummy_story6'], ['gummy_7', 'gummy_story7'], ['gummy_8', 'gummy_cry'], 'gummy_9', ['gummy_10', 'gummy_story8'], ['gummy_11', 'gummy_story9'], ['gummy_12', 'gummy_story10'], ['gummy_13', 'gummy_cry']];
if (!GameState.getState('met-stanley')) {
GameState.setState('met-stanley', 1);
GameScene.current.locked = true;
GameScene.current.gang_text.playTextArray(banter, Dialogue.delay_normal, 500, 500, function () {
GameScene.current.locked = false;
_root.ngMedal.unlock('Stanley');
});
} else {
GameScene.current.gang_text.playTextArray(banter, Dialogue.delay_normal, 500, 500);
}
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.stopPlayer();
GameScene.current.player.setDir(-1);
GameScene.current.player.setAnimation('no');
return true;
}
};
}
}
movieClip 1214 TextBubbles NachoGang {
#initclip
Object.registerClass('TextBubbles NachoGang', Dialogue);
#endinitclip
frame 1 {
this._visible = false;
stop();
}
frame 2 {
GameScene.current.gang.vip_r.setTalking(true);
}
frame 13 {
GameScene.current.gang.vip_r.setTalking(true);
}
frame 23 {
GameScene.current.gang.vip_r.setTalking(false);
}
frame 29 {
GameScene.current.gang.vip_r.setTalking(true);
}
frame 38 {
GameScene.current.gang.vip_l.setTalking(true);
}
frame 50 {
GameScene.current.gang.vip_l.setTalking(true);
}
frame 58 {
GameScene.current.gang.vip_l.setTalking(true);
}
frame 68 {
GameScene.current.gang.vip_l.setTalking(false);
}
frame 75 {
GameScene.current.gang.tony.tony.setTalking(true);
}
frame 85 {
GameScene.current.gang.tony.tony.setTalking(true);
}
frame 93 {
GameScene.current.gang.tony.tony.setTalking(false);
}
frame 100 {
GameScene.current.gang.tony.tony.setTalking(true);
}
frame 111 {
GameScene.current.gang.tony.tony.setTalking(true);
}
frame 117 {
GameScene.current.gang.tony.tony.setTalking(true);
}
frame 125 {
GameScene.current.gang.tony.tony.setTalking(true);
}
frame 135 {
GameScene.current.gang.tony.tony.setTalking(true);
}
frame 143 {
GameScene.current.gang.tony.setTalking(true);
}
frame 152 {
GameScene.current.gang.tony.setTalking(true);
}
}
movieClip 1215 clubAlleyScene {
#initclip
Object.registerClass('clubAlleyScene', GameScene);
#endinitclip
frame 1 {
this.stoptalk = function () {
if (GameScene.current.gang.vp_l) {
GameScene.current.gang.vp_l.setTalking(false);
}
if (GameScene.current.gang.vp_r) {
GameScene.current.gang.vp_r.setTalking(false);
}
};
}
instance to_club_entrance of movieClip 291 WarpAreaRight {
onClipEvent (load) {
this.gotoScene = 'club_entrance';
this.gotoWarp = 'to_club_alley';
}
}
}
movieClip 1224 {
}
movieClip 1232 DorBounce {
#initclip
Object.registerClass('DorBounce', NPC);
#endinitclip
frame 1 {
if (this.ready === undefined) {
this.ready = true;
this.gotoAndPlay(random(this._totalframes) + 1);
}
}
}
movieClip 1233 {
frame 1 {
if (this.ready === undefined) {
this.ready = true;
this.gotoAndPlay(random(this._totalframes) + 1);
}
}
}
movieClip 1245 {
}
movieClip 1273 {
}
movieClip 1274 {
frame 1 {
stop();
}
}
movieClip 1284 {
}
movieClip 1285 {
frame 1 {
this.click_interactive = true;
this.enterClub = function () {
GameScene.sceneSetup.scene = 'club';
GameScene.sceneSetup.warp = 'to_club_entrance';
GameScene.fadeOut();
};
if (GameState.getState('bouncer-moved')) {
gotoAndStop('open_door');
} else {
this.onUserClick = function (point) {
GameScene.current.bouncer_text.onTextStarted = function () {
GameScene.current.bouncer.bouncer.gotoAndStop(1);
};
GameScene.current.bouncer_text.preTextComplete = GameScene.current.bouncer_text.onTextStarted;
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.locked = true;
GameScene.current.player.setDir(-1);
if (GameState.getState('gang-has-cheese')) {
gotoAndStop('bouncer_move');
return undefined;
}
var v3 = GameScene.current.bouncer;
var v2 = GameScene.current.bouncer_text;
var v1 = GameState.getState('talked-to-bouncer') ? 'still_no' : 'no_invite';
GameScene.current.bouncer_text.playText([v1, 'bouncer'], function () {
GameScene.current.bouncer.bouncer.gotoAndStop(1);
GameScene.current.player.setAnimation('no');
setTimeout(function () {
var v1 = GameState.getState('talked-to-bouncer') ? 'get_in_line' : 'wait';
GameState.setState('talked-to-bouncer', 1);
GameScene.current.bouncer_text.playText([v1, 'bouncer'], function () {
GameScene.current.bouncer.bouncer.gotoAndStop(1);
GameScene.current.locked = false;
GameScene.current.walkTo(null, GameScene.current.bouncer.leaveto.getPoint());
});
}, 1000);
});
};
stop();
}
}
frame 8 {
GameScene.current.locked = true;
GameScene.current.bouncer_text.playText(['friend', 'bouncer'], Dialogue.delay_slow, 500, function () {
GameState.setState('bouncer-moved', 1);
GameScene.current.bouncer_text.playText(['go_in', 'bouncer'], function () {
GameScene.current.bouncer.play();
});
});
}
frame 25 {
this.enterClub();
stop();
}
frame 28 {
this.onUserClick = function (point) {
GameScene.current.bouncer_text.onTextStarted = function () {
GameScene.current.bouncer.bouncer.gotoAndStop(1);
};
GameScene.current.bouncer_text.preTextComplete = GameScene.current.bouncer_text.onTextStarted;
if (this.hitbox2.contains(point)) {
var v2 = (GameState.getState('boss-state') === 'happy') ? 'capo' : 'go_in2';
GameScene.current.bouncer_text.playText([v2, 'bouncer']);
GameScene.current.stopPlayer();
return true;
} else {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
}
};
this.onTriggered = function () {
this.enterClub();
};
}
}
movieClip 1296 TextBubbles bouncer {
#initclip
Object.registerClass('TextBubbles bouncer', Dialogue);
#endinitclip
frame 1 {
this._visible = false;
stop();
}
frame 2 {
GameScene.current.bouncer.bouncer.gotoAndStop('talking');
}
frame 12 {
GameScene.current.bouncer.bouncer.gotoAndStop('talking');
}
frame 19 {
GameScene.current.bouncer.bouncer.gotoAndStop('talking');
}
frame 28 {
GameScene.current.bouncer.bouncer.gotoAndStop('talking');
}
frame 39 {
GameScene.current.bouncer.bouncer.gotoAndStop('talking');
}
frame 47 {
GameScene.current.bouncer.bouncer.gotoAndStop('talking');
}
}
movieClip 1297 clubEntranceScene {
#initclip
Object.registerClass('clubEntranceScene', GameScene);
#endinitclip
frame 1 {
GameState.setState('peeked_in_fence', 0);
this.playerPeeking = function () {
this.teeth.gotoAndPlay(1);
this.teeth._visible = true;
this.player.setDir(-1);
this.player.setAnimation('dog_scare');
};
this.onPlayerScared = function () {
this.popcorn_nacho.gotoAndStop('popcorn_scared');
};
this.teethDone = function () {
this.locked = false;
this.getCurrentPath();
this.player.setAnimation('idle');
this.popcorn_nacho.gotoAndStop('popcorn_only');
this.nacho_text._visible = false;
setTimeout(function () {
GameScene.current.nacho_text._visible = true;
if (!GameState.getState('scared-popcorn1')) {
GameState.setState('scared-popcorn1', 1);
GameScene.current.nacho_text.gotoAndStop('warning');
} else {
GameScene.current.nacho_text.gotoAndStop('crazy');
}
setTimeout(function () {
GameScene.current.nacho_text._visible = false;
}, Dialogue.delay_normal);
}, 1000);
};
}
instance bg of movieClip 1224 {
onClipEvent (load) {
this.last_frame = 1;
this.iv = setInterval(function () {
var v1 = random(3) + 1;
if (v1 == GameScene.current.bg.last_frame) {
++v1;
if (v1 > 4) {
v1 = 1;
}
}
GameScene.current.bg.last_frame = v1;
GameScene.current.bg.gotoAndStop(v1);
}, 250);
this.stop();
}
onClipEvent (unload) {
clearInterval(this.iv);
}
}
instance to_concession of movieClip 291 WarpAreaRight {
onClipEvent (load) {
this.gotoScene = 'concession_front';
this.gotoWarp = 'to_club_entrance';
}
}
instance to_club_alley of movieClip 116 WarpAreaUp {
onClipEvent (load) {
this.gotoScene = 'club_alley';
this.gotoWarp = 'to_club_entrance';
}
}
}
movieClip 1302 TextBubblesBaconBucket {
#initclip
Object.registerClass('TextBubblesBaconBucket', Dialogue);
#endinitclip
frame 1 {
this._visible = false;
stop();
}
}
movieClip 1305 popcorn bucket outside {
frame 1 {
this.bearLift = function (side) {
this.onUserClick = function () {};
this.gotoAndPlay('bearlift_' + side);
};
this.sausageLift = function (side) {
this.onUserClick = function () {};
this.gotoAndPlay('sausagelift_' + side);
};
this.has_depth = true;
this.click_interactive = true;
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
if (this._x <= _parent.player._x) {
var v3 = this.walkto_right;
GameScene.current.walkTo(null, v3.getPoint(), this);
return true;
}
var v3 = this.walkto_left;
GameScene.current.walkTo(null, v3.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
var v3 = this._x > _parent.player._x ? 1 : -1;
_parent.player.setDir(v3);
GameScene.current.locked = true;
_parent.player.setAnimation('bucket_crawl');
};
stop();
}
frame 10 {
_root._AudioManager.playSound('bucket_lift', 70);
}
frame 28 {
gotoAndStop(1);
}
frame 30 {
_root._AudioManager.playSound('bucket_lift', 70);
}
frame 48 {
gotoAndStop(1);
}
frame 50 {
_root._AudioManager.playSound('bucket_lift');
}
frame 96 {
_root._AudioManager.playSound('bucket_drop');
}
frame 98 {
stop();
}
frame 100 {
_root._AudioManager.playSound('bucket_lift');
}
frame 146 {
_root._AudioManager.playSound('bucket_drop');
}
frame 148 {
stop();
}
}
movieClip 1306 item - nachocheese {
#initclip
Object.registerClass('item - nachocheese', ItemPickup);
#endinitclip
}
movieClip 1320 {
}
movieClip 1322 {
frame 52 {
if (Math.random() < 0.5600000000000001) {
gotoAndPlay(1);
}
}
}
movieClip 1325 Victim3_static {
#initclip
Object.registerClass('Victim3_static', NPC);
#endinitclip
}
movieClip 1326 {
frame 60 {
_parent.onNachoTurned();
stop();
}
frame 201 {
_parent.onNachoLeft();
stop();
}
}
movieClip 1327 {
frame 1 {
stop();
}
frame 72 {
if (GameScene.current.onBaconLeave !== undefined) {
if (GameScene.current.onBaconLeaveThis !== undefined) {
GameScene.current.onBaconLeave.call(GameScene.current.onBaconLeaveThis);
} else {
GameScene.current.onBaconLeave();
}
GameScene.current.onBaconLeave = undefined;
GameScene.current.onBaconLeaveThis = undefined;
}
stop();
}
}
movieClip 1329 Victim3_bounce {
#initclip
Object.registerClass('Victim3_bounce', NPC);
#endinitclip
}
movieClip 1330 {
frame 31 {
_parent.passTheStuff();
stop();
}
}
movieClip 1331 {
frame 1 {
this.has_depth = true;
this.click_interactive = true;
if (GameState.getState('bacon-cheeks-location') === 'parking') {
gotoAndStop('bacon');
} else {
if (!GameState.getState('interrogation2-over') || GameState.getState('interrogation3-over')) {
gotoAndStop('popcorn_only');
} else {
gotoAndStop('interrogate');
}
}
stop();
}
frame 2 {
this.interrogation = 0;
GameScene.current.nacho_text.preTextComplete = function () {
GameScene.current.popcorn_nacho.tony.setTalking(false);
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
};
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.nacho_text.stopText();
GameState.setState('interrogation3-over', 1);
GameScene.current.locked = true;
GameScene.current.player.setDir(1);
this.gotoAndStop('interrogation_over');
};
this.playBanter = function () {
var v1 = [['interrogate_1', 'tony_accuse'], ['interrogate_2', 'popcorn_defensive'], ['interrogate_3', 'tony_threaten'], ['interrogate_4', 'popcorn_defensive2'], ['interrogate_5', 'tony_threaten2'], ['interrogate_6', 'popcorn_defensive3'], 'interrogate_7'];
GameScene.current.nacho_text.playTextArray(v1, Dialogue.delay_normal, 500, 750);
};
this.playBanter();
}
frame 18 {
GameScene.current.nacho_text.stopText();
GameScene.current.nacho_text.preTextComplete = function () {
GameScene.current.popcorn_nacho.tony.tony.setTalking(false);
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
};
this.onNachoTurned = function () {
GameScene.current.nacho_text.playText(['youagain', 'tony_what'], function () {
GameScene.current.popcorn_nacho.tony.play();
});
};
this.onNachoLeft = function () {
GameScene.current.nacho_text.playText(['wtf', 'popcorn_certain'], function () {
GameScene.current.popcorn_nacho.gotoAndStop('popcorn_only');
GameScene.current.locked = false;
});
};
}
frame 34 {
GameScene.current.onBaconLeaveThis = this;
GameScene.current.onBaconLeave = function () {
this.gotoAndStop('popcorn_only');
};
GameScene.current.nacho_text.onTextStarted = function () {
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
};
GameScene.current.nacho_text.preTextComplete = GameScene.current.nacho_text.onTextStarted;
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.player.setDir(1);
GameScene.current.locked = true;
GameState.setState('bacon-cheeks-location', 'concession_front');
GameScene.current.nacho_text.playTextArray([['ugly_hat', 'bacon_disgusted2'], ['too_green', 'bacon_disgusted'], ['not_what_she', 'popcorn_cocky2'], ['whatevs', 'bacon_wel_well']], Dialogue.delay_normal, 500, 0, function () {
GameScene.current.locked = false;
GameScene.current.popcorn_nacho.bacon.play();
}, this);
};
}
frame 46 {
var banter = (!GameState.getState('interrogation3-over') || GameState.getState('popcorn3-stuff')) ? [['fumes', 'popcorn_cocky2']] : [['cool', 'popcorn_question'], ['notcop', 'popcorn_question'], ['gottatell', 'popcorn_insulted'], ['the_stuff', 'popcorn_cocky']];
GameScene.current.nacho_text.setBanter('popcorn', banter, true, true);
GameScene.current.nacho_text.preTextComplete = function () {
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
};
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.player.setDir(1);
var v2 = GameScene.current.nacho_text.playBanter('popcorn');
if (v2 === 'the_stuff') {
this.gotoAndStop('the_stuff');
GameState.setState('popcorn3-stuff', 1);
GameScene.current.nacho_text.setBanter('popcorn', [['fumes', 'popcorn_cocky2']]);
}
};
}
frame 58 {
this.passTheStuff = function () {
GameState.setState('can-pickup-the-stuff', 1);
_parent.nachocheese.show();
this.gotoAndStop('popcorn_only');
};
}
}
movieClip 1337 {
frame 1 {
stop();
}
}
movieClip 1344 {
frame 52 {
if (Math.random() < 0.5600000000000001) {
gotoAndPlay(1);
}
}
}
movieClip 1349 DaughterStatic {
#initclip
Object.registerClass('DaughterStatic', NPC);
#endinitclip
}
movieClip 1359 {
frame 52 {
if (Math.random() < 0.5600000000000001) {
gotoAndPlay(1);
}
}
}
movieClip 1364 {
}
movieClip 1365 {
frame 1 {
stop();
}
}
movieClip 1369 MomStatic {
#initclip
Object.registerClass('MomStatic', NPC);
#endinitclip
frame 30 {
if (Math.random() < 0.65) {
gotoAndPlay(1);
}
}
}
movieClip 1392 DaughterWalk {
#initclip
Object.registerClass('DaughterWalk', NPC);
#endinitclip
}
movieClip 1411 MomWalk {
#initclip
Object.registerClass('MomWalk', NPC);
#endinitclip
}
movieClip 1412 {
}
movieClip 1417 {
frame 1 {
this.has_depth = true;
this.click_interactive = true;
this.inventory_interactive = true;
setTimeout(function () {
GameScene.current.gino_family.mom.talkToPlayer = function () {
var v1 = GameScene.current.player._x > GameScene.current.gino_family._x ? 1 : -1;
GameScene.current.gino_family.mom.setDir(v1);
};
GameScene.current.gino_family.mom.talkToDaughter = function () {
GameScene.current.gino_family.mom.setDir(1);
};
GameScene.current.gino_family.mom.setDir = function (d) {
if (d > 0 && this._xscale < 0 || d < 0 && this._xscale > 0) {
this._xscale *= -1;
}
};
GameScene.current.gino_family.kid.talkToPlayer = function () {
var v1 = GameScene.current.player._x > GameScene.current.gino_family._x ? 1 : -1;
GameScene.current.gino_family.kid.setDir(v1);
};
GameScene.current.gino_family.kid.talkToMom = function () {
GameScene.current.gino_family.kid.setDir(-1);
};
GameScene.current.gino_family.kid.talkToGreg = function () {
GameScene.current.gino_family.kid.setDir(1);
};
GameScene.current.gino_family.kid.setDir = function (d) {
if (d > 0 && this._xscale < 0 || d < 0 && this._xscale > 0) {
this._xscale *= -1;
}
};
}, 5);
if (GameState.getState('family-kidnapped')) {
gotoAndStop('gone');
} else {
if (GameState.getState('boss-state') === 'waiting') {
gotoAndStop('no_puppy');
} else {
gotoAndStop('happy');
}
}
stop();
}
frame 2 {
var banter = [['hello', 'mom_hello'], ['waiting', 'mom_waiting'], ['trip', 'kid_talk'], ['spoil', 'mom_proud'], ['doggy', 'kid_talk'], ['say_hi', 'kid_talk'], ['woof', 'gummy_woof']];
GameScene.current.ginofam_text.setBanter('happy', banter);
this.onUserClick = function (point) {
if (GameState.getState('interrogation2-over') || !GameState.getState('interrogation3-over')) {
}
if (this.hitbox.contains(point)) {
GameScene.current.stoptalk();
}
if (this.hitbox.contains(point)) {
GameScene.current.stoptalk();
var v4 = this._x > _parent.player._x ? this.walkto_left : this.walkto_right;
GameScene.current.walkTo(null, v4.getPoint(), this);
return true;
}
if (this.hitbox2.contains(point)) {
GameScene.current.stoptalk();
GameScene.current.ginofam_text.playText(['woof', 'gummy_woof']);
return true;
}
};
this.onTriggered = function () {
_parent.player.setDir(this._x > _parent.player._x ? 1 : -1);
var v3 = GameScene.current.ginofam_text.playBanter('happy');
if (v3 == 'woof') {
var v4 = [['waiting', 'mom_waiting'], ['say_hi', 'kid_talk'], ['woof', 'gummy_woof']];
GameScene.current.ginofam_text.setBanter('happy', v4, false, true);
}
};
}
frame 9 {
this.action = null;
GameScene.current.ginofam_text.setBanter('long', [['gino_missing', 'mom_question_long'], ['boss_burger', 'mom_question'], ['come_dear', 'mom_talk'], ['cant_leave', 'kid_cry'], ['okay_sweetie', 'mom_talk'], ['if_only', 'mom_dejected'], ['wahhhh2', 'kid_cry']]);
GameScene.current.ginofam_text.setBanter('short', [['cant_leave', 'kid_cry'], ['wahhhh', 'kid_cry'], ['okay_sweetie', 'mom_talk'], ['want_craig', 'kid_cry'], ['if_only', 'mom_dejected']]);
this.onItemDropped = function (item, point) {
if (this.hitbox.contains(point)) {
GameScene.current.stoptalk();
if (item === 'gummybear') {
this.action = 'gummy';
GameScene.current.walkTo(null, this.walkto_right.getPoint(), this);
return true;
}
}
};
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.stoptalk();
this.action = 'talk';
if (this._x <= _parent.player._x) {
var v3 = this.walkto_right;
GameScene.current.walkTo(null, v3.getPoint(), this);
return true;
}
var v3 = this.walkto_left;
GameScene.current.walkTo(null, v3.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
if (this.action == 'gummy') {
this.onUserClick = function (point) {};
this.onItemDropped = function (item, point) {};
Inventory.current.useItem('gummybear');
_parent.player.setDir(-1);
GameScene.current.locked = true;
gotoAndStop('got_gummy');
} else {
_parent.player.setDir(this._x > _parent.player._x ? 1 : -1);
if (GameState.getState('finding-gummy')) {
GameScene.current.ginofam_text.playBanter('short', Dialogue.delay_slow, 500);
} else {
var v3 = GameScene.current.ginofam_text.playBanter('long', Dialogue.delay_slow, 500);
if (v3 === 'wahhhh2') {
GameState.setState('finding-gummy', 1);
}
}
}
};
}
instance mom of movieClip 1369 MomStatic {
onClipEvent (load) {
this.talkToPlayer = function () {
var v3 = _parent._parent.player._x > _parent._x ? 1 : -1;
this.setDir(v3);
};
this.talkToDaughter = function () {
this.setDir(1);
};
this.setDir = function (d) {
if (d > 0 && this._xscale < 0 || d < 0 && this._xscale > 0) {
this._xscale *= -1;
}
};
}
}
frame 19 {
GameState.setState('family-kidnapped', 1);
GameState.setState('boss-state', 'gino_family');
var txt = [['found_greg', 'kid_talk'], ['bless', 'mom_thankful'], ['what_say', 'mom_encourage'], ['thanks', 'kid_talk']];
GameScene.current.ginofam_text.playTextArray(txt, Dialogue.delay_normal, 500, 1000, function () {
var v2 = [['lets_go', 'mom_talk'], ['cmon', 'kid_talk']];
GameScene.current.stoptalk();
GameScene.current.ginofam_text.playTextArray(v2, Dialogue.delay_normal, 500, 500, function () {
this.play();
}, this);
}, this);
}
frame 195 {
GameScene.current.locked = false;
gotoAndStop('gone');
}
}
movieClip 1418 {
frame 2 {
_parent.can_play = true;
_parent.checkGummy();
}
frame 16 {
_parent.playBounce();
}
frame 21 {
_parent.can_play = false;
}
frame 57 {
_parent.playBounce();
}
frame 97 {
_parent.playBounce();
}
}
movieClip 1419 {
}
movieClip 1430 {
frame 1 {
this.has_depth = true;
this.click_interactive = true;
this.playBounce = function () {
var v7 = 900;
var v6 = 350;
var v8 = v7 - v6;
var v5 = Math.abs(_parent.player._x - this._x);
var v4 = 0;
if (v5 <= v6) {
v4 = 100;
} else {
if (v5 >= v7) {
v4 = 0;
} else {
var v9 = v5 - v6;
v4 = 100 - (v9 / v8) * 100;
}
}
_root._AudioManager.playSound('bounce', Math.round(v4 * 0.8));
};
if (GameState.getState('bacon-cheeks-location') === 'bucket') {
gotoAndStop('bacon');
} else {
if (GameState.getState('boss-state') === 'waiting' && !GameState.getState('bear-inside', 0)) {
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
if (this._x <= _parent.player._x) {
var v3 = this.walkto_right;
GameScene.current.walkTo(null, v3.getPoint(), this);
return true;
}
var v3 = this.walkto_left;
GameScene.current.walkTo(null, v3.getPoint(), this);
return true;
}
};
this.was_triggered = false;
this.can_play = false;
this.playGummy = function () {
var v3 = this._x > _parent.player._x ? 1 : -1;
_parent.player.setDir(v3);
this._xscale = v3 * 100;
this.play();
};
this.checkGummy = function () {
if (this.was_triggered) {
this.playGummy();
}
};
this.onTriggered = function () {
GameScene.current.locked = true;
GameState.setState('bear-inside', 1);
GameState.setState('bear-aggro', 1);
this.was_triggered = true;
if (this.can_play) {
this.playGummy();
}
};
} else {
gotoAndStop('off');
}
}
stop();
}
frame 2 {
this.playBounce();
}
frame 22 {
this.playBounce();
}
frame 41 {
this.playBounce();
}
frame 61 {
this.playBounce();
}
frame 81 {
}
frame 111 {
taunt._xscale = this._xscale;
setTimeout(function () {
GameScene.current.gummybear.play();
}, Dialogue.delay_normal);
stop();
}
frame 144 {
_parent.bucket.bearLift(this._xscale > 0 ? 'right' : 'left');
}
frame 170 {
this._xscale = 100;
if (GameState.getState('trap-set')) {
gotoAndPlay('trapped');
}
}
frame 171 {
_root._AudioManager.playSound('popcorn_scream');
}
frame 232 {
GameScene.current.locked = false;
stop();
}
frame 233 {
_root._AudioManager.playSound('mousetrap');
_root._AudioManager.nextScene();
}
frame 255 {
GameState.setState('bear-aggro', 0);
}
frame 280 {
_root._AudioManager.playSound('gummy_yeow');
}
frame 336 {
GameScene.current.locked = false;
stop();
}
frame 345 {
GameScene.current.bacon_text.preTextComplete = function () {
GameScene.current.gummybear.bacon.setTalking(false);
};
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.player.setDir(1);
GameScene.current.locked = true;
GameState.setState('bacon-cheeks-location', 'hidden');
GameScene.current.bacon_text.playTextArray([['dont_go', 'bacon_mock'], ['ugly_hats', 'bacon_disgusted'], ['like_you', 'bacon_amused']], Dialogue.delay_normal, 500, 0, function () {
GameScene.current.locked = false;
this.play();
}, this);
};
stop();
}
frame 424 {
gotoAndStop('off');
}
}
movieClip 1453 TextBubbles popcorn_nacho3 {
#initclip
Object.registerClass('TextBubbles popcorn_nacho3', Dialogue);
#endinitclip
frame 1 {
GameScene.current.popcorn_nacho.tony.setTalking(true);
}
frame 12 {
GameScene.current.popcorn_nacho.tony.setTalking(true);
}
frame 24 {
GameScene.current.popcorn_nacho.tony.setTalking(true);
}
frame 36 {
}
frame 48 {
GameScene.current.popcorn_nacho.tony.tony.setTalking(true);
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
}
frame 56 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 68 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 80 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 92 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 100 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 109 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 118 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 124 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 131 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 140 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
}
movieClip 1478 TextBubblesGinos Family {
#initclip
Object.registerClass('TextBubblesGinos Family', Dialogue);
#endinitclip
frame 1 {
this._visible = false;
stop();
}
frame 2 {
GameScene.current.gino_family.mom.setTalking(true);
GameScene.current.gino_family.mom.talkToPlayer();
}
frame 10 {
GameScene.current.gino_family.mom.setTalking(true);
GameScene.current.gino_family.mom.talkToPlayer();
}
frame 17 {
GameScene.current.gino_family.mom.setTalking(true);
GameScene.current.gino_family.mom.talkToPlayer();
}
frame 24 {
GameScene.current.gino_family.mom.setTalking(true);
GameScene.current.gino_family.mom.talkToPlayer();
}
frame 35 {
GameScene.current.gino_family.mom.setTalking(true);
GameScene.current.gino_family.mom.talkToPlayer();
}
frame 46 {
GameScene.current.gino_family.mom.setTalking(true);
GameScene.current.gino_family.mom.talkToDaughter();
}
frame 56 {
GameScene.current.gino_family.mom.setTalking(true);
GameScene.current.gino_family.mom.talkToDaughter();
}
frame 67 {
GameScene.current.gino_family.mom.setTalking(true);
}
frame 74 {
GameScene.current.gino_family.mom.setTalking(true);
}
frame 80 {
GameScene.current.gino_family.mom.setTalking(true);
}
frame 88 {
GameScene.current.gino_family.mom.setTalking(true);
}
frame 97 {
GameScene.current.gino_family.kid.setTalking(true);
GameScene.current.gino_family.kid.talkToPlayer();
}
frame 103 {
GameScene.current.gino_family.kid.setTalking(true);
GameScene.current.gino_family.kid.talkToPlayer();
}
frame 110 {
GameScene.current.gino_family.kid.setTalking(true);
GameScene.current.gino_family.kid.talkToGreg();
}
frame 118 {
GameScene.current.gino_family.kid.setTalking(true);
}
frame 128 {
GameScene.current.gino_family.kid.setTalking(true);
}
frame 135 {
GameScene.current.gino_family.kid.setTalking(true);
}
frame 143 {
GameScene.current.gino_family.kid.setTalking(true);
}
frame 151 {
GameScene.current.gino_family.kid.setTalking(true);
}
frame 159 {
GameScene.current.gino_family.kid.setTalking(true);
}
frame 168 {
GameScene.current.gino_family.kid.setTalking(true);
}
frame 180 {
_root.ngMedal.unlock('Woof');
}
}
movieClip 1479 parkingScene {
#initclip
Object.registerClass('parkingScene', GameScene);
#endinitclip
instance background of movieClip 1320 {
onClipEvent (load) {
this.stop();
this.fskip = 0;
}
onClipEvent (enterFrame) {
++this.fskip;
if (this.fskip >= 4) {
this.gotoAndStop(random(4) + 1);
this.fskip = 0;
}
}
}
instance to_concession of movieClip 398 WarpAreaLeft {
onClipEvent (load) {
this.gotoScene = 'concession_front';
this.gotoWarp = 'to_parking';
}
}
instance to_trash_can of movieClip 291 WarpAreaRight {
onClipEvent (load) {
this.gotoScene = 'trash_can';
this.gotoWarp = 'to_parking';
}
}
instance nachocheese of movieClip 1306 item - nachocheese {
onClipEvent (load) {
this.item_name = 'nachocheese';
if (!GameState.getState('can-pickup-the-stuff')) {
this.hide();
}
this.preTrigger = function () {
GameState.setState('can-pickup-the-stuff', 0);
_root.ngMedal.unlock('The Stuff');
};
}
}
instance bucket_point_left of movieClip 400 PointMarker {
onClipEvent (load) {
this.playerDir = -1;
}
}
instance bucket_point_right of movieClip 400 PointMarker {
onClipEvent (load) {
this.playerDir = 1;
}
}
frame 2 {
this.stoptalk = function () {
GameScene.current.gino_family.kid.setTalking(false);
GameScene.current.gino_family.mom.setTalking(false);
};
this.enterHole = function () {
GameScene.sceneSetup.scene = 'bucket_house';
GameScene.sceneSetup.warp = this.player._x > this.bucket._x ? 'exit_right' : 'exit_left';
GameScene.fadeOut();
};
this.startCrawl = function () {
this.bucket.sausageLift(this.player._x > this.bucket._x ? 'right' : 'left');
};
GameScene.current.ginofam_text.preTextComplete = function () {
GameScene.current.stoptalk();
};
GameScene.current.ginofam_text.onTextStarted = GameScene.current.ginofam_text.preTextComplete;
stop();
}
}
movieClip 1480 TriggerBoxforFence {
#initclip
Object.registerClass('TriggerBoxforFence', TriggerBox);
#endinitclip
}
movieClip 1484 {
frame 90 {
if (Math.random() < 0.4) {
gotoAndPlay(1);
}
}
}
movieClip 1485 item - poster {
#initclip
Object.registerClass('item - poster', ItemPickup);
#endinitclip
}
movieClip 1492 {
frame 1 {
this._visible = false;
stop();
}
frame 2 {
_root._AudioManager.playSound('dog_snap', 100);
_root.ngMedal.unlock('Jump Scare');
}
frame 84 {
_parent.teethDone();
}
}
movieClip 1494 {
frame 1 {
this.inventory_interactive = true;
this.onItemDropped = function (item, point) {
if (this.hitbox.contains(point)) {
if (item === 'bottlecap') {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
GameScene.current.stopPlayer();
GameScene.current.player.setAnimation('no');
return true;
}
};
this.onTriggered = function () {
GameScene.current.player.setDir(-1);
GameScene.current.player.setAnimation('throw');
GameState.setState('bacon-cheeks-location', 'alley');
GameState.setState('alley-open', 1);
Inventory.current.useItem('bottlecap');
GameScene.current.locked = 1;
};
stop();
}
frame 11 {
_root._AudioManager.playSound('coin_drop');
}
frame 32 {
_parent.baconcheeks.play();
}
frame 38 {
stop();
}
}
movieClip 1503 {
frame 1 {
stop();
}
frame 2 {
_root._AudioManager.playSound('bacon_charge');
}
frame 153 {
_root._AudioManager.playSound('woosh_fx');
}
frame 172 {
_root.ngMedal.unlock('Bacon Treats');
}
frame 236 {
_root._AudioManager.playSound('dog_bark');
}
frame 269 {
GameScene.current.nacho_text.playText('crazy', Dialogue.delay_slow, 0, function () {
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
});
GameScene.current.locked = false;
stop();
}
}
movieClip 1506 Victim2_scared {
#initclip
Object.registerClass('Victim2_scared', NPC);
#endinitclip
}
movieClip 1507 {
frame 60 {
_parent.onNachoTurned();
stop();
}
frame 201 {
_parent.onNachoLeft();
stop();
}
}
movieClip 1508 Victim2_static {
#initclip
Object.registerClass('Victim2_static', NPC);
#endinitclip
}
movieClip 1510 Victim2_bounce {
#initclip
Object.registerClass('Victim2_bounce', NPC);
#endinitclip
}
movieClip 1511 {
frame 1 {
this.has_depth = true;
this.click_interactive = true;
if (GameState.getState('interrogation1-over')) {
gotoAndStop('popcorn_only');
} else {
gotoAndStop('interrogate');
}
stop();
}
frame 2 {
this.interrogation = 0;
GameScene.current.nacho_text.preTextComplete = function () {
GameScene.current.popcorn_nacho.tony.setTalking(false);
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
};
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.nacho_text.stopText();
GameState.setState('interrogation1-over', 1);
GameScene.current.locked = true;
GameScene.current.player.setDir(-1);
this.gotoAndStop('interrogation_over');
};
this.playBanter = function () {
var v1 = [['interrogate_1', 'tony_accuse'], ['interrogate_2', 'popcorn_defensive'], ['interrogate_3', 'tony_threaten'], ['interrogate_4', 'popcorn_defensive2'], ['interrogate_5', 'tony_threaten2'], ['interrogate_6', 'popcorn_defensive3'], 'interrogate_7'];
GameScene.current.nacho_text.playTextArray(v1, Dialogue.delay_normal, 500, 750);
};
this.playBanter();
}
frame 18 {
GameScene.current.nacho_text.stopText();
GameScene.current.nacho_text.preTextComplete = function () {
GameScene.current.popcorn_nacho.tony.tony.setTalking(false);
};
this.onNachoTurned = function () {
GameScene.current.nacho_text.playText(['mook', 'tony_what'], Dialogue.delay_slow, function () {
GameScene.current.popcorn_nacho.tony.play();
});
};
this.onNachoLeft = function () {
GameScene.current.nacho_text.playText(['jerk', 'popcorn_wonder'], function () {
GameScene.current.popcorn_nacho.gotoAndStop('popcorn_only');
GameScene.current.locked = false;
});
};
}
frame 34 {
GameScene.current.nacho_text.stopText();
}
frame 48 {
this.onUserClick = function (point) {
GameScene.current.nacho_text.preTextComplete = function () {
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
};
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
GameScene.current.nacho_text.setBanter('banter1', [['creeps', 'popcorn_defensive3'], ['otherside', 'popcorn_wonder'], ['mother_in_law', 'popcorn_talk3']]);
GameScene.current.nacho_text.setBanter('banter2', [['creeps', 'popcorn_defensive3'], ['otherside', 'popcorn_wonder'], ['whatstuff', 'popcorn_pondering'], ['mother_in_law', 'popcorn_talk3']]);
GameScene.current.nacho_text.setBanter('banter3', [['bacon_guy', 'popcorn_insulted'], ['bacon_hole', 'popcorn_pondering']]);
this.onTriggered = function () {
GameScene.current.player.setDir(-1);
if (GameState.getState('inventory-nachocheese')) {
GameScene.current.nacho_text.playText(['you_stuff', 'popcorn_question']);
GameState.setState('popcorn1-text', 0);
GameState.setState('popcorn1-sawstuff', 1);
return undefined;
}
if (GameState.getState('bacon-cheeks-location') === 'concession_front') {
GameScene.current.nacho_text.playBanter('banter3', Dialogue.delay_normal, 500);
} else {
if (GameState.getState('popcorn1-sawstuff')) {
GameScene.current.nacho_text.playBanter('banter1', Dialogue.delay_normal, 500);
} else {
GameScene.current.nacho_text.playBanter('banter2', Dialogue.delay_normal, 500);
}
}
};
}
}
movieClip 1533 TextBubbles popcorn_nacho1 {
#initclip
Object.registerClass('TextBubbles popcorn_nacho1', Dialogue);
#endinitclip
frame 2 {
GameScene.current.popcorn_nacho.tony.setTalking(true);
}
frame 12 {
GameScene.current.popcorn_nacho.tony.setTalking(true);
}
frame 24 {
GameScene.current.popcorn_nacho.tony.setTalking(true);
}
frame 36 {
}
frame 48 {
GameScene.current.popcorn_nacho.tony.tony.setTalking(true);
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
}
frame 56 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 68 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 80 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 92 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 98 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 106 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 113 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 120 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 129 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 138 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
}
movieClip 1534 fenceScene {
#initclip
Object.registerClass('fenceScene', GameScene);
#endinitclip
frame 1 {
GameState.setState('peeked_in_fence', 0);
this.onSausageThrow = function () {
hole.play();
};
this.playerPeeking = function () {
if (!GameState.getState('alley-open')) {
this.teeth.gotoAndPlay(1);
this.teeth._visible = true;
this.player.setDir(-1);
this.player.setAnimation('dog_scare');
} else {
GameScene.sceneSetup.scene = 'alley';
GameScene.sceneSetup.warp = 'to_fence';
GameScene.fadeOut();
}
};
this.onPlayerScared = function () {
this.popcorn_nacho.gotoAndStop('popcorn_scared');
};
this.teethDone = function () {
this.locked = false;
this.getCurrentPath();
this.player.setAnimation('idle');
this.popcorn_nacho.gotoAndStop('popcorn_only');
this.nacho_text._visible = false;
setTimeout(function () {
if (!GameState.getState('scared-popcorn1')) {
GameState.setState('scared-popcorn1', 1);
GameScene.current.nacho_text.playText(['warning', 'popcorn_warning'], Dialogue.delay_slow, 0, function () {
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
});
} else {
GameScene.current.nacho_text.playText(['crazy', 'popcorn_shocked'], Dialogue.delay_slow, 0, function () {
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
});
}
}, 1000);
};
}
instance poster of movieClip 1485 item - poster {
onClipEvent (load) {
this.item_name = 'poster';
}
}
instance of movieClip 1480 TriggerBoxforFence {
onClipEvent (load) {
this.onTriggered = function () {
this._parent.player.setDir(1);
if (!GameState.getState('alley-open') && GameState.getState('peeked_in_fence')) {
this._parent.player.setAnimation('no');
} else {
GameState.setState('peeked_in_fence', 1);
this._parent.locked = true;
this._parent.player.setAnimation('fencepeek');
}
};
}
}
instance to_concession of movieClip 291 WarpAreaRight {
onClipEvent (load) {
this.gotoScene = 'concession_front';
this.gotoWarp = 'to_fence';
}
}
}
movieClip 1535 TriggerBox_concessiondoor {
#initclip
Object.registerClass('TriggerBox_concessiondoor', TriggerBox);
#endinitclip
}
movieClip 1544 {
}
movieClip 1547 {
}
movieClip 1548 {
frame 1 {
this.click_interactive = true;
if (GameState.getState('bacon-cheeks-location') !== 'concession_front') {
gotoAndStop('off');
}
}
frame 2 {
this.click_interactive = true;
GameScene.current.nacho_text.setBanter('bacon', [['I_cant', 'bacon_mock5'], ['stupi_hat', 'bacon_mock3'], ['umm', 'bacon_wel_well'], ['dont_want', 'bacon_amused'], ['garbage', 'bacon_disgusted'], ['give_it', 'bacon_giveit'], ['get_rid', 'bacon_smug'], 'bacon_dots'], true);
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.player.setDir(1);
GameScene.current.nacho_text.playBanter('bacon', Dialogue.delay_normal, 500);
};
stop();
}
}
movieClip 1551 Victim1_scared {
#initclip
Object.registerClass('Victim1_scared', NPC);
#endinitclip
}
movieClip 1552 {
frame 60 {
_parent.onNachoTurned();
stop();
}
frame 137 {
_parent.onNachoLeft();
stop();
}
}
movieClip 1553 Victim1_static {
#initclip
Object.registerClass('Victim1_static', NPC);
#endinitclip
}
movieClip 1555 Victim1_bounce {
#initclip
Object.registerClass('Victim1_bounce', NPC);
#endinitclip
}
movieClip 1556 {
frame 1 {
this.has_depth = false;
this.click_interactive = true;
if (!GameState.getState('interrogation1-over') || GameState.getState('interrogation2-over')) {
gotoAndStop('popcorn_only');
} else {
gotoAndStop('interrogate');
}
stop();
}
frame 2 {
this.interrogation = 0;
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.nacho_text.stopText();
GameState.setState('interrogation2-over', 1);
GameScene.current.locked = true;
GameScene.current.player.setDir(1);
this.gotoAndStop('interrogation_over');
};
GameScene.current.nacho_text.preTextComplete = function () {
GameScene.current.popcorn_nacho.tony.setTalking(false);
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
};
this.playBanter = function () {
var v1 = [['interrogate_1', 'tony_accuse'], ['interrogate_2', 'popcorn_defensive'], ['interrogate_3', 'tony_threaten'], ['interrogate_4', 'popcorn_defensive2'], ['interrogate_5', 'tony_threaten2'], ['interrogate_6', 'popcorn_defensive3'], 'interrogate_7'];
GameScene.current.nacho_text.playTextArray(v1, Dialogue.delay_normal, 500, 750);
};
this.playBanter();
}
frame 18 {
GameScene.current.nacho_text.stopText();
GameScene.current.nacho_text.preTextComplete = function () {
GameScene.current.popcorn_nacho.tony.tony.setTalking(false);
};
this.onNachoTurned = function () {
GameScene.current.nacho_text.playText(['youagain', 'tony_what'], Dialogue.delay_slow, 500, function () {
GameScene.current.popcorn_nacho.tony.play();
});
};
this.onNachoLeft = function () {
_root.textTimeout = setTimeout(function () {
GameScene.current.nacho_text.playText(['wtf', 'popcorn_wonder'], Dialogue.delay_slow, 500, function () {
GameScene.current.popcorn_nacho.gotoAndStop('popcorn_only');
GameScene.current.locked = false;
});
}, 1000);
};
}
frame 34 {
GameScene.current.nacho_text.setBanter('popcorn', [['poppin', 'popcorn_insulted'], ['navy', 'popcorn_talk_long'], ['tall', 'popcorn_pondering'], ['goaway', 'popcorn_wonder']], true);
GameScene.current.nacho_text.preTextComplete = function () {
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
};
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
};
this.onTriggered = function () {
GameScene.current.player.setDir(1);
if (GameState.getState('inventory-nachocheese')) {
GameScene.current.nacho_text.playText(['you_stuff', 'popcorn_wonder']);
} else {
var v1 = GameScene.current.nacho_text.playBanter('popcorn');
if (v1 == 'goaway') {
GameScene.current.nacho_text.setBanter('popcorn', [['goaway', 'popcorn_wonder']], true, true);
}
}
};
}
}
movieClip 1583 TextBubbles popcorn_nacho2 {
#initclip
Object.registerClass('TextBubbles popcorn_nacho2', Dialogue);
#endinitclip
frame 1 {
stop();
}
frame 2 {
GameScene.current.popcorn_nacho.tony.setTalking(true);
}
frame 12 {
GameScene.current.popcorn_nacho.tony.setTalking(true);
}
frame 24 {
GameScene.current.popcorn_nacho.tony.setTalking(true);
}
frame 48 {
GameScene.current.popcorn_nacho.tony.tony.setTalking(true);
GameScene.current.popcorn_nacho.popcorn.setTalking(false);
}
frame 56 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 68 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 80 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 92 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 99 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 108 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 114 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
frame 121 {
GameScene.current.popcorn_nacho.popcorn.setTalking(true);
}
}
movieClip 1584 concessionOutside {
#initclip
Object.registerClass('concessionOutside', GameScene);
#endinitclip
frame 1 {
this.enterConcession = function () {
GameState.setState('exited_griddle', 1);
GameScene.sceneSetup.scene = 'concession_floor';
GameScene.sceneSetup.warp = 'doorwarp';
GameScene.fadeOut();
};
}
instance bg of movieClip 1544 {
onClipEvent (load) {
this.last_frame = 1;
this.iv = setInterval(function () {
var v1 = random(3) + 1;
if (v1 == GameScene.current.bg.last_frame) {
++v1;
if (v1 > 4) {
v1 = 1;
}
}
GameScene.current.bg.last_frame = v1;
GameScene.current.bg.gotoAndStop(v1);
}, 250);
this.stop();
}
onClipEvent (unload) {
clearInterval(this.iv);
}
}
instance of movieClip 1547 {
onClipEvent (load) {
this.stop();
this.fskip = 0;
}
onClipEvent (enterFrame) {
++this.fskip;
if (this.fskip >= 4) {
this.gotoAndStop(random(4) + 1);
this.fskip = 0;
}
}
}
instance of movieClip 1535 TriggerBox_concessiondoor {
onClipEvent (load) {
this.onTriggered = function () {
this._parent.locked = true;
this._parent.player.setDir(1);
this._parent.player.setAnimation('stairhop');
};
}
}
instance to_club_entrance of movieClip 116 WarpAreaUp {
onClipEvent (load) {
this.gotoScene = 'club_entrance';
this.gotoWarp = 'to_concession';
}
}
instance to_fence of movieClip 398 WarpAreaLeft {
onClipEvent (load) {
this.gotoScene = 'fence';
this.gotoWarp = 'to_concession';
}
}
instance to_parking of movieClip 291 WarpAreaRight {
onClipEvent (load) {
this.gotoScene = 'parking';
this.gotoWarp = 'to_concession';
}
}
}
movieClip 1587 item - kernel {
#initclip
Object.registerClass('item - kernel', ItemPickup);
#endinitclip
frame 1 {
this.has_depth = true;
}
}
movieClip 1588 TriggerBox {
#initclip
Object.registerClass('TriggerBox', TriggerBox);
#endinitclip
}
movieClip 1590 item - mousetrap {
#initclip
Object.registerClass('item - mousetrap', ItemPickup);
#endinitclip
}
movieClip 1606 {
frame 1 {
this.inventory_interactive = true;
this.onItemDropped = function (item, point) {
if (this.hitbox.contains(point)) {
if (item === 'kernel') {
GameScene.current.walkTo(null, this.walkto.getPoint(), this);
return true;
}
GameScene.current.stopPlayer();
GameScene.current.player.setAnimation('no');
return true;
}
};
this.onTriggered = function () {
GameScene.current.locked = true;
Inventory.current.useItem('kernel');
GameScene.current.stopPlayer();
GameScene.current.player.setDir(1);
GameScene.current.baby.gotoAndPlay('birth');
};
}
frame 100 {
if (Math.random() > 0.5) {
gotoAndPlay('loop');
} else {
if (Math.random() < 0.5) {
gotoAndPlay('spark2');
}
}
}
frame 101 {
_root._AudioManager.playSound('spark', 100);
}
frame 118 {
gotoAndPlay('loop');
}
frame 119 {
_root._AudioManager.playSound('spark', 80);
}
frame 136 {
gotoAndPlay('loop');
}
}
movieClip 1609 {
frame 1 {
stop();
}
frame 2 {
_root._AudioManager.playSound('door', 100);
}
frame 30 {
GameScene.sceneSetup.scene = 'concession_front';
GameScene.sceneSetup.warp = null;
GameScene.fadeOut();
}
frame 69 {
stop();
}
}
movieClip 1642 {
frame 75 {
gotoAndPlay('loop');
}
}
movieClip 1660 {
frame 1 {
this.has_depth = true;
this.click_interactive = true;
this.inventory_interactive = true;
this.onItemDropped = function (item, point) {
if (this.hitbox.contains(point)) {
if (item === 'mousetrap') {
_root.ngMedal.unlock('Not in Florida');
}
}
};
this.startInteraction = function () {
this.onUserClick = function (point) {
if (this.hitbox.contains(point)) {
GameScene.current.stopPlayer();
if (GameScene.current.player._x <= this._x) {
GameScene.current.player.setDir(1);
GameScene.current.locked = true;
this.gotoAndPlay('mama');
return true;
}
GameScene.current.player.setDir(-1);
GameScene.current.locked = true;
this.gotoAndPlay('mama');
return true;
}
};
};
if (!GameState.getState('baby-popcorn-exists')) {
gotoAndStop('inactive');
} else {
this.startInteraction();
}
stop();
}
frame 3 {
stop();
}
frame 8 {
this.onUserClick = function () {
return false;
};
}
frame 16 {
GameState.setState('baby-popcorn-exists', 1);
_root._AudioManager.playSound('spark_baby', 100);
this.startInteraction();
}
frame 49 {
_root.ngMedal.unlock('Life Giver');
}
frame 93 {
_root._AudioManager.playSound('mama');
}
frame 166 {
GameScene.current.player.setAnimation('no');
}
frame 213 {
if (GameScene.current.locked) {
GameScene.current.locked = false;
}
gotoAndStop('cry');
}
}
movieClip 1664 {
}
movieClip 1666 {
}
movieClip 1667 {
frame 1 {
gotoAndStop('off');
}
frame 62 {
stop();
}
}
movieClip 1668 concessionFloor {
#initclip
Object.registerClass('concessionFloor', GameScene);
#endinitclip
frame 1 {
GameState.setState('exited_concessions', 0);
if (!GameState.getState('exited_griddle')) {
GameState.setState('exited_griddle', 1);
this.locked = true;
this.player.setDir(1);
this.player.setAnimation('fall');
this.playerReady = function () {
if (!GameState.setState('kernel-tip')) {
GameState.setState('kernel-tip', 1);
this.kerneltip.gotoAndPlay(2);
}
this.locked = false;
};
}
}
instance mousetrap of movieClip 1590 item - mousetrap {
onClipEvent (load) {
this.item_name = 'mousetrap';
}
}
instance doorwarp of movieClip 1588 TriggerBox {
onClipEvent (load) {
this.preTrigger = function () {
return false;
};
this.onTriggered = function () {
this._parent.locked = true;
this._parent.stopPlayer();
this._parent.door.play();
};
}
}
instance kernel of movieClip 1587 item - kernel {
onClipEvent (load) {
this.item_name = 'kernel';
}
}
}
movieClip 1674 {
}
movieClip 1699 {
}
movieClip 1702 {
}
movieClip 1710 {
}
button 1714 {
on (release) {
play();
}
}
movieClip 1718 {
}
movieClip 1722 {
}
movieClip 1726 {
}
movieClip 1730 {
}
movieClip 1742 {
frame 1 {
var view = GameState.getState('dream-view', 0);
++view;
if (view > 4) {
view = 1;
}
GameState.setState('dream-view', view);
gotoAndStop(view);
}
}
movieClip 1748 {
}
movieClip 1749 griddleScene {
frame 1 {
stop();
}
instance of movieClip 1699 {
onClipEvent (load) {
gotoAndPlay(22);
}
}
instance cloud of movieClip 1748 {
onClipEvent (load) {
}
}
instance of movieClip 1710 {
onClipEvent (release) {
play();
}
}
frame 13 {
_root._AudioManager.playSound('splat_quiet', 50);
stop();
}
instance of movieClip 1710 {
onClipEvent (release) {
play();
}
}
frame 30 {
_root._AudioManager.playSound('splat_quiet', 100);
}
frame 36 {
_root._AudioManager.playSound('splat_quiet', 20);
stop();
}
frame 62 {
_root._AudioManager.playSound('splat_quiet', 100);
}
frame 71 {
_root._AudioManager.playSound('splat_quiet', 10);
stop();
}
frame 85 {
_root._AudioManager.playSound('splat_quiet', 50);
}
frame 91 {
stop();
}
frame 91 {
_root._AudioManager.playSound('splat_quiet', 10);
}
frame 114 {
_root._AudioManager.playSound('splat_quiet', 100);
}
frame 134 {
GameScene.sceneSetup.scene = 'concession_floor';
GameScene.sceneSetup.warp = null;
GameScene.fadeOut();
stop();
}
}
movieClip 1755 {
frame 89 {
stop();
}
}
movieClip 1760 {
}
movieClip 1761 {
instance of movieClip 1760 {
onClipEvent (load) {
gotoAndPlay('mid');
}
}
}
movieClip 1762 {
frame 17 {
if (!GameState.getState('inventory-first-time')) {
GameState.setState('inventory-first-time', 1);
} else {
gotoAndStop(1);
}
}
frame 116 {
gotoAndStop(1);
}
frame 128 {
_parent.gotoAndStop('hidden');
stop();
}
}
button 1764 {
on (release) {
if (!GameScene.current.locked) {
this.open();
}
}
}
button 1768 {
on (press) {
GameState.setState('drag-tip', 1);
this.icon.gotoAndStop('blank');
this.prevFrame();
Inventory.selectItem(this.item);
_parent.dragtip.gotoAndStop('off');
_parent.gotoAndPlay('close');
}
}
button 1771 {
on (release) {
this.open();
}
}
movieClip 1772 {
frame 7 {
stop();
}
frame 11 {
stop();
}
}
movieClip 1775 {
frame 1 {
if (GameState.getState('drag-tip')) {
gotoAndStop('off');
}
}
frame 16 {
if (GameState.getState('drag-tip')) {
gotoAndStop('off');
}
}
frame 64 {
if (GameState.getState('drag-tip')) {
gotoAndStop('off');
}
}
frame 112 {
if (GameState.getState('drag-tip')) {
gotoAndStop('off');
}
}
frame 160 {
GameState.setState('drag-tip', 1);
}
}
button 1776 {
on (release) {
this.close();
}
}
movieClip 1777 Inventory {
#initclip
Object.registerClass('Inventory', Inventory);
#endinitclip
frame 1 {
stop();
this.icon_point = {'x': icon._x, 'y': icon._y};
this.is_open = false;
this.updateMainButton();
this.onEnterFrame = function () {};
}
instance active of movieClip 1755 {
onClipEvent (enterFrame) {
if (Inventory.selected_item) {
this.gotoAndStop(Inventory.selected_item);
this._x = _root._xmouse;
this._y = _root._ymouse;
} else {
if (this.speed !== undefined && this.speed.steps > 0) {
--this.speed.steps;
this._x += this.speed.x;
this._y += this.speed.y;
} else {
this._y = -9999;
}
}
}
}
frame 8 {
_root._AudioManager.playSound('inv_open', 100);
this.unpdateIcons();
}
frame 15 {
this.onEnterFrame = function () {
if (GameScene.current.locked) {
this.onEnterFrame = function () {};
this.close();
}
};
stop();
}
frame 20 {
_root._AudioManager.playSound('inv_close', 100);
}
frame 26 {
gotoAndStop('closed');
}
}
movieClip 1782 {
}
movieClip 1785 {
frame 1 {
if (GameState.getState('bacon-cheeks-in-elevator')) {
GameState.setState('bacon-cheeks-in-elevator', 0);
gotoAndStop(2);
}
stop();
}
}
movieClip 1786 {
frame 129 {
_root.ngMedal.unlock('Going Up?');
}
frame 250 {
GameScene.sceneSetup.scene = 'counter_top';
GameScene.sceneSetup.warp = null;
GameScene.fadeOut();
}
}
movieClip 1787 {
frame 337 {
GameScene.sceneSetup.scene = 'club';
GameScene.sceneSetup.warp = 'exit_elevator';
GameScene.fadeOut();
stop();
}
}
movieClip 1795 {
frame 300 {
stop();
}
}
movieClip 1804 {
frame 1 {
this.blink_at = 13;
if (this.delay === undefined || this.delay > this.blink_at) {
this.delay = 0;
}
}
frame 14 {
++this.delay;
if (this.delay <= this.blink_at) {
gotoAndPlay(1);
}
}
}
movieClip 1810 {
}
movieClip 1811 {
frame 366 {
stop();
}
}
movieClip 1812 {
}
// unknown tag 88 length 17
// unknown tag 88 length 76
// unknown tag 88 length 49
movieClip 1885 {
}
movieClip 1886 {
frame 1 {
_root._AudioManager.stopAll();
_root._AudioManager.playSound('sunrise', 100);
}
frame 1089 {
_root._AudioManager.playSound('hawk', 100);
}
frame 1193 {
stop();
}
instance of movieClip 1885 {
onClipEvent (load) {
this.fade_delay = 120;
this.fading = false;
_root._AudioManager.stopAll();
_root._AudioManager.playEnd('end_music', 100);
}
onClipEvent (enterFrame) {
if (this.fading) {
if (_root._AudioManager.movie.target_vol > 0) {
_root._AudioManager.movie.target_vol -= 0.5;
}
return undefined;
}
if (this._y + this._height > 320) {
this._y -= 1;
} else {
--this.fade_delay;
if (this.fade_delay < 1) {
this.fading = true;
_parent.play();
}
}
}
}
frame 1194 {
_root.ngMedal.unlock('Thanks for Playing');
}
frame 1436 {
_root.gotoAndStop('title_screen');
}
}
movieClip 1887 MainGame {
#initclip
Object.registerClass('MainGame', MainGame);
#endinitclip
frame 1 {
if (GameState.getState('play-scenes')) {
_root._AudioManager.startMovie(0, GameState.getState('current-set', 0));
} else {
_root._AudioManager.startMovie(GameState.getState('intro-index', 0));
}
_root._AudioManager.setMovieVolume(0, 0, 0, 0);
if (GameScene.continued) {
this.gotoAndStop(GameScene.continued);
}
}
frame 2 {
_root._AudioManager.setMovieVolume(30, 50, 0, 0);
stop();
}
frame 16 {
_root._AudioManager.setMovieVolume(30, 50, 0, 0);
}
frame 31 {
_root._AudioManager.setMovieVolume(80, 20, 0, 0);
if (GameState.getState('boss-state') === 'waiting' && !GameState.getState('scene2')) {
GameState.setState('scene2', 1);
_root._AudioManager.nextScene();
}
if (GameState.getState('murder-scene-complete') && !GameState.getState('scene3')) {
GameState.setState('scene3', 1);
_root._AudioManager.nextScene();
}
if (GameState.getState('inventory-toothpick') && !GameState.getState('scene4')) {
GameState.setState('scene4', 1);
_root._AudioManager.nextScene();
}
}
frame 46 {
_root._AudioManager.setMovieVolume(40, 12, 0, 0);
}
frame 53 {
_root._AudioManager.setMovieVolume(100, 5, 0, 0);
if (GameState.getState('boss-state') === 'waiting' && !GameState.getState('scene2')) {
GameState.setState('scene2', 1);
_root._AudioManager.nextScene();
}
if (GameState.getState('murder-scene-complete') && !GameState.getState('scene3')) {
GameState.setState('scene3', 1);
_root._AudioManager.nextScene();
}
}
frame 61 {
_root._AudioManager.setMovieVolume(15, 5, 5, 0);
}
frame 73 {
_root._AudioManager.setMovieVolume(20, 5, 2, 0);
}
frame 83 {
_root._AudioManager.setMovieVolume(0, 0, 100, 0);
}
frame 90 {
_root._AudioManager.setMovieVolume(0, 0, 15, 0);
}
frame 98 {
_root._AudioManager.setMovieVolume(70, 0, 0, 0);
}
frame 109 {
_root._AudioManager.setMovieVolume(30, 50, 0, 0);
}
frame 121 {
_root._AudioManager.setMovieVolume(100, 0, 0, 0);
}
frame 131 {
_root._AudioManager.setMovieVolume(10, 0, 0, 0);
}
frame 140 {
_root._AudioManager.setMovieVolume(10, 30, 5, 0);
_root._AudioManager.playSound('elevator');
}
frame 151 {
_root._AudioManager.setMovieVolume(10, 30, 5, 0);
_root._AudioManager.playSound('elevator');
}
}
frame 1 {
if (_root.ngLoadedViaRuffle !== undefined) {
getURL('javascript: ngRemoveRuffleLoader()', '');
}
}
frame 1 {
stopAllSounds();
}
frame 1 {
com.newgrounds.API.__set__debugMode(com.newgrounds.API.RELEASE_MODE);
_root.apicreds = {};
_root.apicreds.id = '54152:b2YZY7oj';
_root.apicreds.key = 'rdg5pqDnxE5RrBQNsa3X56Yu7TzKeg9s';
stop();
}
movieClip 1890 {
}
movieClip 1895 {
}
movieClip 1896 {
}
movieClip 1899 {
}
movieClip 1900 {
}
movieClip 1902 {
}
movieClip 1906 {
}
movieClip 1907 {
}
movieClip 1910 {
}
movieClip 1914 {
}
movieClip 1917 {
}
movieClip 1918 {
}
movieClip 1920 {
}
movieClip 1921 {
}
movieClip 1922 {
}
movieClip 1923 {
}
movieClip 1925 {
}
button 1926 {
on (release) {
getURL('http://www.newgrounds.com', '_blank');
}
}
movieClip 1929 {
}
movieClip 1931 {
}
movieClip 1932 {
frame 1 {
bar._xscale = 0;
}
frame 2 {
stop();
if (_root.api_connected === undefined) {
_root.api_connected = 0;
}
if (!_root.api_connected) {
com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.ERROR_NOT_CONNECTED, function () {});
com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, function () {
_root.api_connected = 5;
});
com.newgrounds.API.connect(_root, _root.apicreds.id, _root.apicreds.key);
}
loaderfade._alpha = 0;
loaderfade2._alpha = 0;
var ngfade = 30;
var fakeload = 0;
this.onEnterFrame = function () {
var v2 = (_root.getBytesLoaded() / _root.getBytesTotal()) * 95 + _root.api_connected;
bar._xscale = v2;
if (v2 === 100) {
_root.play();
loadingText._visible = false;
if (loaderfade._alpha < 100) {
loaderfade._alpha += 2;
} else {
if (ngfade > 0) {
--ngfade;
} else {
if (loaderfade2._alpha < 100) {
loaderfade2._alpha += 2;
} else {
_root.play();
}
}
}
}
};
}
}
movieClip 2075 __Packages.GameScene {
#initclip
if (!_global.GameScene) {
var v1 = function () {
super();
if (_root.textInterval !== undefined && _root.textInterval) {
clearInterval(_root.textInterval);
}
if (_root.textTimeout !== undefined && _root.textTimeout) {
clearTimeout(_root.textTimeout);
}
this.locked = false;
};
_global.GameScene = v1;
_global.GameScene extends MovieClip;
var v2 = v1.prototype;
v1.fadeIn = function () {
GameScene.fadeDir = -4;
};
v1.fadeOut = function () {
GameScene.fadeDir = 4;
};
v1.onFadeIn = function () {
if (GameScene.current.onFadeIn !== undefined) {
GameScene.current.onFadeIn();
}
};
v1.onFadeOut = function () {
_root.main.gotoAndStop('reset');
setTimeout(function () {
GameScene.fadeIn();
if (GameScene.sceneSetup.scene) {
_root.main.gotoAndStop(GameScene.sceneSetup.scene);
}
}, 5);
};
v2.onLoad = function () {
if (this._is_loaded === true) {
return undefined;
}
this._is_loaded = true;
GameScene.current = this;
setTimeout(function () {
GameScene.current.initScene();
}, 5);
};
v2.initScene = function () {
function sortDepthObjects(a, b) {
return a._y > b._y;
}
var v2;
var v7;
if (this.screen_size !== undefined) {
this.sceneWidth = this.screen_size._width;
this.sceneHeight = this.screen_size._height;
} else {
this.sceneWidth = this._width;
this.sceneHeight = this._height;
}
this.paths = [];
this.warps = [];
this.pickups = [];
this.inventory_interactive_objects = [];
this.click_interactive_objects = [];
this.objects_with_depth = [];
for (v2 in this) {
if (this[v2].is_path) {
this.paths.push(this[v2]);
if (this[v2].is_warp) {
this.warps.push(this[v2]);
}
}
if (this[v2].is_pickup && this[v2].active) {
this.pickups.push(this[v2]);
}
if (this[v2].inventory_interactive) {
this.inventory_interactive_objects.push(this[v2]);
}
if (this[v2].click_interactive) {
this.click_interactive_objects.push(this[v2]);
}
if (this[v2].has_depth) {
this.objects_with_depth.push(this[v2]);
}
if (this[v2].is_player) {
this.player = this[v2];
}
if (this[v2]._name === 'scale_top') {
this.scale_top = this[v2];
}
if (this[v2]._name === 'scale_bottom') {
this.scale_bottom = this[v2];
}
}
this.objects_with_depth.sort(sortDepthObjects);
var v6;
var v3;
var v5;
var v4;
var v12 = 3;
var v10 = false;
while (v12 > 0) {
v10 = false;
v6 = 0;
while (v6 < this.objects_with_depth.length) {
v5 = this.objects_with_depth[v6];
v3 = 0;
while (v3 < this.objects_with_depth.length) {
v4 = this.objects_with_depth[v3];
if (v5.getDepth() < v4.getDepth() && v5._y > v4._y) {
v5.swapDepths(v4);
v10 = true;
}
++v3;
}
++v6;
}
if (!v10) {
break;
}
}
var v15 = this.scale_top._y;
var v17 = this.scale_bottom._y;
var v18 = v17 - v15;
var v14 = this.scale_top._xscale;
var v16 = this.scale_bottom._xscale;
var v19 = v16 - v14;
this.scale_mod = v19 / v18;
this.scale_anchor = v15;
this.scale_min = v14;
var v9;
var v8;
v2 = 0;
while (v2 < this.paths.length) {
v9 = this.paths[v2];
v7 = 0;
while (v7 < this.paths.length) {
v8 = this.paths[v7];
if (v9 === v8) {
} else {
if (v8.contains(v9)) {
v8.linkTo(v9);
}
}
++v7;
}
++v2;
}
this.maxX = GameScene.gameWidth - this.sceneWidth;
this.maxY = GameScene.gameHeight - this.sceneHeight;
if (GameScene.continued && GameState.getState('saved_player_pos')) {
var v13 = GameState.getState('saved_player_pos');
if (v13) {
this.player._x = v13.x;
this.player._y = v13.y;
this.player.setDir(v13.d);
}
GameScene.continued = false;
} else {
if (GameScene.sceneSetup.warp && this[GameScene.sceneSetup.warp] !== undefined) {
var v11 = this[GameScene.sceneSetup.warp];
if (this[GameScene.sceneSetup.warp].is_path) {
this.player._x = v11._x + v11._width / 2;
this.player._y = v11._y + v11._height / 2;
} else {
this.player._x = v11._x;
this.player._y = v11._y;
}
if (v11.playerDir !== undefined) {
this.player.setDir(v11.playerDir);
} else {
if (this.player._x > this.sceneWidth / 2) {
this.player.setDir(-1);
}
}
}
}
GameState.savePlayerPos();
this.setScale(this.player);
this._y = -(this.player._y - this.player._height / 2) + GameScene.gameCenter.y;
this._x = -this.player._x + GameScene.gameCenter.x;
this.fixPos();
this.checkDepths();
};
v2.getCurrentPath = function () {
var v3 = {'x': this.player._x, 'y': this.player._y};
var v2 = 0;
while (v2 < this.paths.length) {
if (this.paths[v2].contains(v3)) {
this.current_path = this.paths[v2];
break;
}
++v2;
}
return this.current_path;
};
v2.setScale = function (clip) {
var v2 = this.getScale(clip._y);
clip._xscale = v2;
clip._yscale = v2;
};
v2.getScale = function (y) {
var v2 = y - this.scale_anchor;
return this.scale_min + v2 * this.scale_mod;
};
v2.useSelectedItem = function () {
var v5 = {'x': _root._xmouse - this._x, 'y': _root._ymouse - this._y};
var v4;
var v3;
v3 = 0;
while (v3 < this.inventory_interactive_objects.length) {
v4 = this.inventory_interactive_objects[v3];
if (v4.onItemDropped !== undefined && v4.onItemDropped(Inventory.selected_item, v5) === true) {
break;
}
++v3;
}
Inventory.selected_item = null;
};
v2.onRelease = function () {
if (Inventory.selected_item) {
return undefined;
}
if (this.locked && Dialogue.skipText()) {
return undefined;
}
var v3;
var v8;
var v5;
var v10;
if (this.locked) {
return undefined;
}
var v16 = null;
var v6 = 99999;
var v7;
var v4 = {'x': _root._xmouse - this._x, 'y': _root._ymouse - this._y};
var v14 = {'x': this.player._x, 'y': this.player._y};
var v13 = null;
v3 = 0;
while (v3 < this.click_interactive_objects.length) {
v10 = this.click_interactive_objects[v3];
if (v10.onUserClick !== undefined && v10.onUserClick(v4) === true) {
return undefined;
}
++v3;
}
v3 = 0;
while (v3 < this.pickups.length) {
v5 = this.pickups[v3];
if (!v5.active || !v5._visible) {
} else {
if (v5.wasClicked(v4)) {
v4 = v5.getWalktoPoint(v14);
v13 = v5;
break;
}
}
++v3;
}
v3 = 0;
while (v3 < this.paths.length) {
if (!this.paths[v3].active) {
} else {
v7 = this.paths[v3].inOrAbove(v4);
if (v7 === true) {
v8 = this.paths[v3];
v6 = v4.y;
break;
} else {
if (v7 !== false && v7 < v6) {
v8 = this.paths[v3];
v6 = v7;
}
}
}
++v3;
}
v4.y = v6;
if (!v8) {
v4 = {'x': _root._xmouse - this._x, 'y': _root._ymouse - this._y};
v6 = 99999;
var v12;
var v11;
var v15;
var v9;
v3 = 0;
while (v3 < this.paths.length) {
if (!this.paths[v3].active) {
} else {
v12 = v4.x;
v11 = v4.y;
if (v4.x < this.paths[v3].left) {
v12 = this.paths[v3].left + 1;
}
if (v4.x > this.paths[v3].right) {
v12 = this.paths[v3].right - 1;
}
if (v4.y < this.paths[v3].top) {
v11 = this.paths[v3].top + 1;
}
if (v4.y > this.paths[v3].bottom) {
v11 = this.paths[v3].bottom - 1;
}
v9 = Math.sqrt(Math.pow(v4.x - v12, 2) + Math.pow(v4.y - v11, 2));
if (v9 < v6) {
v15 = {'x': v12, 'y': v11};
v6 = v9;
v8 = this.paths[v3];
}
}
++v3;
}
v4 = v15;
}
if (v8.preTrigger !== undefined && v8.preTrigger() === true) {
return undefined;
}
this.walkTo(v8, v4, v13);
};
v2.getPathAt = function (destination_point) {
var v2 = 0;
while (v2 < this.paths.length) {
if (this.paths[v2].contains(destination_point)) {
return this.paths[v2];
}
++v2;
}
return null;
};
v2.walkTo = function (path_tile, destination_point, trigger_object) {
if (Math.sqrt(Math.pow(this.player._x - destination_point.x, 2) + Math.pow(this.player._y - destination_point.y, 2)) < 2) {
if (trigger_object && trigger_object.onTriggered !== undefined) {
trigger_object.onTriggered();
}
return undefined;
}
if (path_tile === null) {
path_tile = this.getPathAt(destination_point);
if (!path_tile) {
return undefined;
}
}
var v6 = {'x': this.player._x, 'y': this.player._y};
var v3 = (this.getCurrentPath()).findPath(path_tile, null, v6, destination_point, null, null, 0);
if (trigger_object) {
v3.map[v3.map.length - 1]._trigger = trigger_object;
}
this.player.setPath(v3.map);
};
v2.updateCamera = function (moved) {
this.checkDepths();
var v6 = {'x': this.player._x + this._x, 'y': this.player._y - this.player._height / 2 + this._y};
var v8 = Math.abs(v6.x - GameScene.gameCenter.x);
var v9 = Math.abs(v6.y - GameScene.gameCenter.y);
var v7 = false;
if (v8 > GameScene.cameraZoneX) {
if (moved.x > 0 && v6.x > GameScene.gameCenter.x || moved.x < 0 && v6.x < GameScene.gameCenter.x) {
this._x -= moved.x;
}
v7 = true;
}
if (!v7 && v9 > GameScene.cameraZoneY) {
if (moved.y > 0 && v6.y > GameScene.gameCenter.y || moved.y < 0 && v6.y < GameScene.gameCenter.y) {
this._y -= moved.y;
}
v7 = true;
}
var v2;
var v5 = {'x': this.player._x, 'y': this.player._y};
var v4 = 0;
while (v4 < this.warps.length) {
v2 = this.warps[v4];
if (v2.contains(v5)) {
if (v2.enterDir === 'up' && moved.y < 0 || v2.enterDir === 'down' && moved.y > 0 || v2.enterDir === 'left' && moved.x < 0 || v2.enterDir === 'right' && moved.x > 0) {
this.doWarp(v2);
}
}
++v4;
}
if (v7) {
this.fixPos();
}
};
v2.fixPos = function () {
if (this._x > 0) {
this._x = 0;
} else {
if (this._x < this.maxX) {
this._x = this.maxX;
}
}
if (this._y > 0) {
this._y = 0;
} else {
if (this._y < this.maxY) {
this._y = this.maxY;
}
}
};
v2.doWarp = function (warp) {
if (warp.gotoScene && warp.gotoWarp) {
GameScene.sceneSetup.scene = warp.gotoScene;
GameScene.sceneSetup.warp = warp.gotoWarp;
this.player.vector = {'x': 0, 'y': 0};
if (this.player.animations.animation !== undefined) {
this.player.animations.animation.stop();
}
this.locked = true;
GameScene.fadeOut();
}
};
v2.stopPlayer = function () {
this.player.stopWalking();
};
v2.checkDepths = function () {
var v2;
var v4;
var v3 = 0;
while (v3 < this.objects_with_depth.length) {
v2 = this.objects_with_depth[v3];
v4 = (v2.depth_at === undefined) ? v2._y : v2.depth_at;
if (v2.getDepth() > this.player.getDepth() && this.player._y > v4 || v2.getDepth() < this.player.getDepth() && this.player._y < v4) {
this.player.swapDepths(v2);
}
++v3;
}
};
v1.gameWidth = 1280;
v1.gameHeight = 720;
v1.gameCenter = {'x': 640, 'y': 360};
v1.cameraZoneX = 100;
v1.cameraZoneY = 10;
v1.sceneSetup = {'warp': null, 'scene': null};
v1.continued = false;
v1.fadeDir = 0;
v2.paths = [];
v2.warps = [];
v2.pickups = [];
v2.inventory_interactive_objects = [];
v2.click_interactive_objects = [];
v2.objects_with_depth = [];
v2.current_path = null;
v2.locked = false;
ASSetPropFlags(_global.GameScene.prototype, null, 1);
}
#endinitclip
}
movieClip 2076 __Packages.GameState {
#initclip
if (!_global.GameState) {
var v1 = function () {};
_global.GameState = v1;
var v2 = v1.prototype;
v1.load = function () {
if (GameState.so === null) {
GameState.so = SharedObject.getLocal('_SausageGameSaveDataV1.01_');
}
if (GameState.so.data.gamestate === undefined || !GameState.so.data.gamestate) {
GameState.so.data.gamestate = {};
}
GameState.data = GameState.so.data.gamestate;
};
v1.reset = function () {
GameState.load();
var v1 = GameState.getState('muted');
GameState.data = {'muted': v1};
GameState.so.data.gamestate = GameState.data;
GameState.so.flush();
};
v1.getState = function (key, default_val) {
if (GameState.data[key] === undefined) {
return (default_val === undefined) ? false : default_val;
}
return GameState.data[key];
};
v1.setState = function (key, val) {
GameState.data[key] = val;
GameState.savePlayerPos();
GameState.so.data.gamestate = GameState.data;
GameState.so.flush();
};
v1.savePlayerPos = function () {
GameState.data.has_save = 1;
if (GameScene.current !== undefined && GameScene.current.player !== undefined && GameScene.current.player) {
GameState.data.saved_player_pos = {'x': GameScene.current.player._x, 'y': GameScene.current.player._y, 'd': GameScene.current.player._xscale > 0 ? 1 : -1, 's': GameScene.current._parent._currentframe};
}
};
v1.hasSave = function () {
GameState.load();
if (GameState.data.has_save === undefined || !GameState.data.has_save) {
return false;
}
return true;
};
v1.loadGame = function () {
GameState.load();
};
v1.data = {};
v1.so = null;
ASSetPropFlags(_global.GameState.prototype, null, 1);
}
#endinitclip
}
movieClip 2077 __Packages.Inventory {
#initclip
if (!_global.Inventory) {
var v1 = function () {
super();
this.is_visible = (Inventory.getInventory()).length > 0;
};
_global.Inventory = v1;
_global.Inventory extends MovieClip;
var v2 = v1.prototype;
v1.getInventory = function (item) {
if (item !== undefined) {
return GameState.getState('inventory-' + item, 0);
}
var v1 = [];
for (var v2 in Inventory.inventory) {
if (GameState.getState('inventory-' + v2, 0) > 0) {
v1.push(v2);
}
}
return v1;
};
v1.setInventory = function (item, ammount) {
GameState.setState('inventory-' + item, ammount);
};
v1.foundItem = function (item) {
return GameState.getState('itempickedup-' + item);
};
v1.selectItem = function (item) {
var v1 = Inventory.getInventory(item);
if (v1) {
Inventory.selected_item = item;
}
};
v1.deselectItem = function () {
Inventory.selected_item = null;
};
v2.onLoad = function () {
Inventory.current = this;
this.active.gotoAndStop('blank');
};
v2.updateMainButton = function () {
var v2 = Inventory.getInventory();
if (this.is_open) {
this.gotoAndPlay('close');
} else {
if (v2.length < 1) {
this.gotoAndStop(2);
if (this.is_visible) {
this.icon.gotoAndPlay('transition_out');
} else {
this.icon.gotoAndStop('empty');
}
this.is_visible = false;
} else {
this.gotoAndStop(2);
if (!this.is_visible) {
this.icon.gotoAndPlay('transition_in');
} else {
this.icon.gotoAndStop(1);
}
this.is_visible = true;
}
}
};
v2.unpdateIcons = function () {
var v3 = Inventory.getInventory();
var v2;
v2 = 0;
while (v2 < Inventory.TOTAL_SLOTS) {
if (v3[v2] === undefined || !v3[v2]) {
this['item_' + v2].item = null;
this['item_' + v2].gotoAndStop('off');
} else {
this['item_' + v2].item = v3[v2];
this['item_' + v2].gotoAndPlay('on');
this['item_' + v2].icon.gotoAndStop(v3[v2]);
}
++v2;
}
};
v2.open = function () {
this.gotoAndPlay('open');
this.is_open = true;
};
v2.close = function () {
this.gotoAndPlay('close');
this.is_open = false;
};
v2.useItem = function (item_name) {
var v2 = Inventory.getInventory(item_name);
--v2;
Inventory.setInventory(item_name, v2);
this.updateMainButton();
};
v2.addItem = function (item, quantity) {
var v2 = item.getItemPoint();
var v4 = Inventory.getInventory(item.item_name);
v4 += quantity;
Inventory.setInventory(item.item_name, v4);
this.updateMainButton();
v2 = item.getItemPoint();
var v7 = 15;
var v5 = (this.icon_point.x - v2.x) / v7;
var v6 = (this.icon_point.y - v2.y) / v7;
this.active.gotoAndStop(item.item_name);
this.active._x = v2.x;
this.active._y = v2.y;
this.active.speed = {'x': v5, 'y': v6, 'steps': v7};
};
v1.TOTAL_SLOTS = 12;
v1.selected_item = null;
v1.inventory = {'kernel': 'Popcorn Kernel', 'mousetrap': 'Mouse Trap', 'nachocheese': 'Nacho Cheese', 'gummybear': 'Greg', 'clubkey': 'Club Key', 'penny': 'Shiny Penny', 'toothpick': 'Fancy Toothpick', 'poster': 'Sexy Poster', 'paperhat': 'Paper Hat', 'bottlecap': 'Bottle Cap'};
ASSetPropFlags(_global.Inventory.prototype, null, 1);
}
#endinitclip
}
movieClip 2078 __Packages.Dialogue {
#initclip
if (!_global.Dialogue) {
var v1 = function () {
super();
};
_global.Dialogue = v1;
_global.Dialogue extends MovieClip;
var v2 = v1.prototype;
v1.skipText = function () {
if (Dialogue.active && Dialogue.dialogue_timeout) {
clearTimeout(Dialogue.dialogue_timeout);
Dialogue.active.onTextComplete();
return true;
}
return false;
};
v2.onLoad = function () {
this.stop();
this._visible = false;
this.banter = {};
};
v2.stopText = function () {
Dialogue.dialogue_callback = null;
Dialogue.dialogue_callback_target = null;
Dialogue.dialogue_delay = null;
Dialogue.cache = null;
Dialogue.active = null;
this._visible = false;
};
v2.setBanter = function (name, labels, memory_key, replace) {
if (this.banter[name] !== undefined && replace !== true) {
return undefined;
}
if (memory_key === undefined) {
memory_key = false;
} else {
if (memory_key === true) {
memory_key = 'banter-' + this._name + '-' + name;
}
}
var v5 = memory_key ? GameState.getState(memory_key, 0) : 0;
if (replace) {
v5 = 0;
}
this.banter[name] = {'labels': labels, 'index': v5, 'memory_key': memory_key};
};
v2.playBanter = function (name, duration, delay, callback, callback_target, clearcache) {
if (this.banter[name] == undefined || this.banter[name].length < 1) {
return undefined;
}
var v3 = this.banter[name].labels[this.banter[name].index];
++this.banter[name].index;
if (this.banter[name].index >= this.banter[name].labels.length) {
this.banter[name].index = 0;
}
if (this.banter[name].memory_key) {
GameState.setState(this.banter[name].memory_key, this.banter[name].index);
}
this.playText(v3, duration, delay, callback, callback_target, clearcache);
return (typeof v3 === 'string') ? v3 : v3[0];
};
v2.playText = function (label, duration, delay, callback, callback_target, clearcache) {
if (this.sound) {
this.sound.audio.stop();
this.sound = null;
}
var v7;
var v9;
var v12 = 100;
if (typeof label === 'string') {
v7 = label;
v9 = null;
} else {
v7 = label[0];
v9 = label[1];
v12 = label.length > 2 ? label[2] : 100;
}
if (this.onTextStarted !== undefined) {
var v11 = (this.onTextStartedObject === undefined) ? this : this.onTextStartedObject;
this.onTextStarted.call(v11, v7);
}
if (typeof duration == 'function') {
clearcache = callback;
callback_target = delay;
callback = duration;
duration = 3000;
delay = 0;
} else {
if (typeof delay == 'function') {
clearcache = callback_target;
callback_target = callback;
callback = delay;
delay = 0;
}
}
if (duration === null || duration === undefined) {
duration = 3000;
}
Dialogue.dialogue_callback = callback;
Dialogue.dialogue_callback_target = callback_target;
Dialogue.dialogue_delay = delay;
if (clearcache !== false) {
Dialogue.cache = null;
}
if (Dialogue.dialogue_timeout) {
clearTimeout(Dialogue.dialogue_timeout);
}
if (Dialogue.active && Dialogue.active._visible !== undefined) {
Dialogue.active._visible = false;
}
Dialogue.active = this;
this.gotoAndStop(v7);
if (v9) {
this.sound = _root._AudioManager.playSound(v9, v12);
} else {
this.sound = null;
}
this._visible = true;
Dialogue.dialogue_timeout = setTimeout(function () {
Dialogue.active._visible = false;
if (Dialogue.active.sound) {
Dialogue.active.sound.audio.stop();
Dialogue.active.sound = null;
}
if (Dialogue.active.preTextComplete !== undefined) {
if (Dialogue.active.preTextCompleteObject !== undefined) {
Dialogue.active.preTextComplete.call(Dialogue.active.preTextCompleteObject);
} else {
Dialogue.active.preTextComplete();
}
}
if (Dialogue.dialogue_delay) {
Dialogue.dialogue_timeout = setTimeout(function () {
Dialogue.active.doCallback();
}, Dialogue.dialogue_delay);
} else {
Dialogue.active.doCallback();
}
}, duration);
};
v2.playTextArray = function (text_array, duration, delay, wait, callback, callback_target) {
if (text_array.length < 1) {
Dialogue.dialogue_callback_target = callback_target;
Dialogue.dialogue_callback = callback;
this.doCallback();
Dialogue.cache = null;
return undefined;
}
if (typeof wait == 'number' && wait > 0) {
if (Dialogue.dialogue_timeout) {
clearTimeout(Dialogue.dialogue_timeout);
}
if (Dialogue.active && Dialogue.active._visible !== undefined) {
Dialogue.active._visible = false;
}
Dialogue.active = this;
Dialogue.cache = {'text_array': text_array, 'duration': duration, 'delay': delay, 'callback': callback, 'callback_target': callback_target};
Dialogue.dialogue_timeout = setTimeout(function () {
Dialogue.active.onTextComplete();
}, wait);
return undefined;
}
var v5 = text_array.shift();
Dialogue.cache = {'text_array': text_array, 'duration': duration, 'delay': delay, 'callback': callback, 'callback_target': callback_target};
this.playText(v5, duration, delay, this.onTextComplete, this, false);
};
v2.onTextComplete = function () {
if (!Dialogue.cache || Dialogue.cache.text_array.length < 1) {
this._visible = false;
if (Dialogue.cache.callback) {
Dialogue.dialogue_callback = Dialogue.cache.callback;
Dialogue.dialogue_callback_target = Dialogue.cache.callback_target;
}
Dialogue.cache = null;
if (Dialogue.dialogue_callback) {
this.doCallback();
}
return undefined;
}
this.playTextArray(Dialogue.cache.text_array, Dialogue.cache.duration, Dialogue.cache.delay, null, Dialogue.cache.callback, Dialogue.cache.callback_target);
};
v2.doCallback = function () {
Dialogue.active = null;
var v1 = Dialogue.dialogue_callback;
var v2 = Dialogue.dialogue_callback_target;
Dialogue.dialogue_callback_target = null;
Dialogue.dialogue_callback = null;
if (v1 && v2) {
v1.call(v2);
} else {
if (v1) {
v1();
}
}
};
v2.onUnload = function () {
Dialogue.dialogue_callback = null;
Dialogue.dialogue_callback_target = null;
Dialogue.dialogue_delay = null;
if (Dialogue.dialogue_timeout) {
clearTimeout(Dialogue.dialogue_timeout);
}
Dialogue.active = null;
Dialogue.cache = null;
};
v1.delay_slow = 2500;
v1.delay_normal = 3000;
ASSetPropFlags(_global.Dialogue.prototype, null, 1);
}
#endinitclip
}
movieClip 2079 __Packages.com.newgrounds.EventDispatcher {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.EventDispatcher) {
var v1 = function () {
this._listeners = {};
};
com.newgrounds.EventDispatcher = v1;
var v2 = v1.prototype;
v2.addEventListener = function (type, listener) {
if (!this._listeners[type]) {
this._listeners[type] = [];
}
if (typeof listener == 'function') {
this._listeners[type].push({'target': null, 'func': listener});
} else {
this._listeners[type].push(listener);
}
};
v2.removeEventListener = function (type, listener) {
var v3 = this._listeners[type];
if (v3) {
var v5 = v3.length;
var v2 = 0;
while (v2 < v5) {
if (v3[v2].func == listener || v3[v2] == listener) {
v3.splice(v2, 1);
return undefined;
}
++v2;
}
}
};
v2.dispatchEvent = function (event) {
var v4 = this._listeners[event.__get__type()];
if (v4) {
var v5 = v4.length;
var v2 = 0;
while (v2 < v5) {
var v3 = v4[v2];
v3.func.call(v3.target, event);
++v2;
}
}
return true;
};
ASSetPropFlags(com.newgrounds.EventDispatcher.prototype, null, 1);
}
#endinitclip
}
movieClip 2080 __Packages.com.newgrounds.Event {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.Event) {
var v1 = function (type) {
this._type = type;
};
com.newgrounds.Event = v1;
var v2 = v1.prototype;
v2.__get__type = function () {
return this._type;
};
v2.addProperty('type', v2.__get__type, function () {});
ASSetPropFlags(com.newgrounds.Event.prototype, null, 1);
}
#endinitclip
}
movieClip 2081 __Packages.com.newgrounds.APIEventDispatcher {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.APIEventDispatcher) {
var v1 = function () {
super();
};
com.newgrounds.APIEventDispatcher = v1;
com.newgrounds.APIEventDispatcher extends com.newgrounds.EventDispatcher;
var v2 = v1.prototype;
v1.__get__globalDispatcher = function () {
return com.newgrounds.APIEventDispatcher._globalDispatcher;
};
v1.__set__globalDispatcher = function (value) {
com.newgrounds.APIEventDispatcher._globalDispatcher = value;
return com.newgrounds.APIEventDispatcher.__get__globalDispatcher();
};
v1.initEventQueue = function () {
setInterval(com.newgrounds.APIEventDispatcher.runEventQueue, 50);
return [];
};
v2.dispatchEvent = function (event) {
com.newgrounds.APIEventDispatcher._eventQueue.push({'dispatcher': this, 'event': event});
return true;
};
v2.actualDispatchEvent = function (event) {
var v3 = super.dispatchEvent(event);
if (com.newgrounds.APIEventDispatcher._globalDispatcher && this != com.newgrounds.APIEventDispatcher._globalDispatcher) {
com.newgrounds.APIEventDispatcher._globalDispatcher.dispatchEvent(event);
}
};
v1.runEventQueue = function (event) {
var v3 = com.newgrounds.APIEventDispatcher._eventQueue.length;
if (v3) {
var v4 = com.newgrounds.APIEventDispatcher._eventQueue;
com.newgrounds.APIEventDispatcher._eventQueue = [];
var v1 = 0;
while (v1 < v3) {
var v2 = v4[v1];
v2.dispatcher.actualDispatchEvent(v2.event);
++v1;
}
}
};
v1._eventQueue = com.newgrounds.APIEventDispatcher.initEventQueue();
v1.addProperty('globalDispatcher', v1.__get__globalDispatcher, v1.__set__globalDispatcher);
ASSetPropFlags(com.newgrounds.APIEventDispatcher.prototype, null, 1);
}
#endinitclip
}
movieClip 2082 __Packages.com.newgrounds.APIConnection {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.APIConnection) {
var v1 = function () {
this.reset();
};
com.newgrounds.APIConnection = v1;
var v2 = v1.prototype;
v2.__get__hostURL = function () {
return this._hostURL;
};
v2.__set__hostURL = function (value) {
this._hostURL = value;
this.hostDomain = null;
if (this._hostURL) {
var v2 = this._hostURL.split('/');
if (v2[0] != 'file:' && this._hostURL != 'localhost') {
this.hostDomain = (v2.splice(0, 3)).join('/');
}
}
if (!this.hostDomain) {
this.hostDomain = 'localhost';
}
return this.__get__hostURL();
};
v2.__get__sandboxType = function () {
return System.security.sandboxType;
};
v2.__get__isNetworkHost = function () {
switch (this.__get__sandboxType()) {
return true;
case 'localWithFile':
case 'localWithNetwork':
case 'localTrusted':
case 'application':
return false;
case 'remote':
}
return true;
};
v2.__get__hasUserSession = function () {
return this.sessionId != null && this.sessionId != '' && this.publisherId != 0;
};
v2.__get__connected = function () {
return this.connectionState == com.newgrounds.APIConnection.CONNECTED;
};
v2.reset = function () {
this.connectionState = com.newgrounds.APIConnection.NOT_CONNECTED;
this.encryptionKey = null;
this.sessionId = null;
this.userEmail = null;
this.username = null;
this.userId = 0;
this.userpageFormat = 0;
};
v2.assertInitialized = function () {
if (!this.initialized) {
com.newgrounds.Logger.logError('You must initialized the API using API.connect() before using this command.');
return false;
}
return true;
};
v2.assertConnected = function () {
if (!this.connectionState == com.newgrounds.APIConnection.CONNECTED) {
com.newgrounds.Logger.logError('You must establish a connection using API.connect() before using this command.');
return false;
}
return true;
};
v2.sendSimpleCommand = function (command, completeHandler, parameters, secureParameters) {
if (parameters == undefined) {
parameters = null;
}
if (secureParameters == undefined) {
secureParameters = null;
}
var v2 = new com.newgrounds.APICommand(command);
v2.__set__parameters(parameters);
v2.__set__secureParameters(secureParameters);
if (completeHandler != null) {
v2.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, completeHandler);
}
v2.send(this);
};
v2.sendCommand = function (command) {
command.send(this);
};
v2.loadInBrowser = function (command, newWindow, parameters) {
if (newWindow == undefined) {
newWindow = true;
}
if (parameters == undefined) {
parameters = null;
}
var v2 = new com.newgrounds.APICommand(command);
v2.__set__parameters(parameters);
v2.loadInBrowser(this, newWindow);
};
v1.NOT_CONNECTED = 'notConnected';
v1.CONNECTING = 'connecting';
v1.CONNECTED = 'connected';
v2.connectionState = com.newgrounds.APIConnection.NOT_CONNECTED;
v2.apiURL = 'http://www.ngads.com/gateway_v2.php';
v2.addProperty('connected', v2.__get__connected, function () {});
v2.addProperty('hasUserSession', v2.__get__hasUserSession, function () {});
v2.addProperty('hostURL', v2.__get__hostURL, v2.__set__hostURL);
v2.addProperty('isNetworkHost', v2.__get__isNetworkHost, function () {});
v2.addProperty('sandboxType', v2.__get__sandboxType, function () {});
ASSetPropFlags(com.newgrounds.APIConnection.prototype, null, 1);
}
#endinitclip
}
movieClip 2083 __Packages.com.newgrounds.Logger {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.Logger) {
var v1 = function () {};
com.newgrounds.Logger = v1;
var v2 = v1.prototype;
v1.logInternal = function () {
var v2 = arguments;
com.newgrounds.Logger.log(com.newgrounds.Logger.PRIORITY_INTERNAL, v2);
};
v1.logMessage = function () {
var v2 = arguments;
com.newgrounds.Logger.log(com.newgrounds.Logger.PRIORITY_MESSAGE, v2);
};
v1.logWarning = function () {
var v2 = arguments;
com.newgrounds.Logger.log(com.newgrounds.Logger.PRIORITY_WARNING, v2);
};
v1.logError = function () {
var v2 = arguments;
com.newgrounds.Logger.log(com.newgrounds.Logger.PRIORITY_ERROR, v2);
};
v1.log = function (priority, messages) {
if (priority == undefined) {
priority = com.newgrounds.Logger.PRIORITY_MESSAGE;
}
if (messages == undefined) {
messages = null;
}
if (priority >= com.newgrounds.Logger._messageLevel) {
var v1 = 0;
while (v1 < messages.length) {
trace(com.newgrounds.Logger.HEADER + messages[v1]);
com.newgrounds.Logger._eventDispatcher.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.LOG, messages[v1]));
++v1;
}
}
if (priority >= com.newgrounds.Logger._throwLevel) {
throw new Error(messages.join('\n'));
}
};
v1.addEventListener = function (event, listener) {
com.newgrounds.Logger._eventDispatcher.addEventListener(event, listener, false, 0, false);
};
v1.PRIORITY_INTERNAL = 0;
v1.PRIORITY_MESSAGE = 1;
v1.PRIORITY_WARNING = 2;
v1.PRIORITY_ERROR = 3;
v1.PRIORITY_MAX = 4;
v1.HEADER = '[Newgrounds API] :: ';
v1._eventDispatcher = new com.newgrounds.EventDispatcher();
v1._messageLevel = com.newgrounds.Logger.PRIORITY_MESSAGE;
v1._throwLevel = com.newgrounds.Logger.PRIORITY_MAX;
ASSetPropFlags(com.newgrounds.Logger.prototype, null, 1);
}
#endinitclip
}
movieClip 2084 __Packages.com.newgrounds.APIEvent {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.APIEvent) {
var v1 = function (type, data, error) {
super(type);
if (data == undefined) {
data = null;
}
if (error == undefined) {
error = null;
}
if (!error || error == '' || error == com.newgrounds.APIEvent.ERROR_NONE) {
this._error = com.newgrounds.APIEvent.ERROR_NONE;
this._success = true;
} else {
this._error = error;
this._success = false;
}
if (data) {
this._data = data;
} else {
this._data = {};
}
};
com.newgrounds.APIEvent = v1;
com.newgrounds.APIEvent extends com.newgrounds.Event;
var v2 = v1.prototype;
v2.clone = function () {
return new com.newgrounds.APIEvent(this.__get__type(), this._data, this._error);
};
v2.__get__success = function () {
return this._success;
};
v2.__get__data = function () {
return this._data;
};
v2.__get__error = function () {
return this._error;
};
v1.COMMAND_COMPLETE = 'commandComplete';
v1.MEDAL_UNLOCK_CONFIRMED = 'medalUnlockConfirmed';
v1.ICON_LOADED = 'iconLoaded';
v1.BRIDGE_EVENT_RECEIVED = 'brdigeEventReceived';
v1.API_CONNECTED = 'movieConnected';
v1.LOG = 'log';
v1.MEDAL_UNLOCKED = 'medalUnlocked';
v1.SCORES_LOADED = 'scoresLoaded';
v1.SCORE_POSTED = 'scorePosted';
v1.QUERY_COMPLETE = 'queryComplete';
v1.FILE_LOADED = 'fileLoaded';
v1.FILE_SAVED = 'fileSaved';
v1.FILE_DELETED = 'fileDeleted';
v1.FILE_REQUESTED = 'fileRequested';
v1.VOTE_COMPLETE = 'voteComplete';
v1.USER_SIGNED_IN = 'userSignedIn';
v1.ERROR_NONE = 'noError';
v1.ERROR_UNKNOWN = 'unknownError';
v1.ERROR_COMMAND_FAILED = 'commandFailed';
v1.ERROR_NOT_CONNECTED = 'notConnected';
v1.ERROR_INVALID_ARGUMENT = 'invalidArgument';
v1.ERROR_TIMED_OUT = 'timedOut';
v1.ERROR_BAD_FILE = 'badFile';
v1.ERROR_BAD_RESPONSE = 'badResponse';
v1.ERROR_SENDING_COMMAND = 'errorSendingCommand';
v1.ERROR_HOST_BLOCKED = 'hostBlocked';
v1.ERROR_ALREADY_VOTED = 'alreadyVoted';
v1.ERROR_NOT_LOGGED_IN = 'notLoggedIn';
v1.ERROR_WRONG_ENCRYPTION_KEY = 'wrongEncryptionKey';
v1.ERROR_SIGN_IN_FAILED = 'signInFailed';
v2.addProperty('data', v2.__get__data, function () {});
v2.addProperty('error', v2.__get__error, function () {});
v2.addProperty('success', v2.__get__success, function () {});
ASSetPropFlags(com.newgrounds.APIEvent.prototype, null, 1);
}
#endinitclip
}
movieClip 2085 __Packages.com.newgrounds.encoders.BaseN {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.encoders) {
_global.com.newgrounds.encoders = new Object();
}
if (!_global.com.newgrounds.encoders.BaseN) {
var v1 = function (hash) {
if (hash) {
this._hash = hash;
} else {
this._hash = com.newgrounds.encoders.BaseN.DEFAULT_HASH;
}
this._base = this._hash.length;
this._reverseHash = new Object();
var v2 = 0;
while (v2 < this._hash.length) {
this._reverseHash[this._hash.charAt(v2)] = v2;
++v2;
}
};
com.newgrounds.encoders.BaseN = v1;
var v2 = v1.prototype;
v2.encodeUint = function (number, minimumChars) {
if (minimumChars == undefined) {
minimumChars = 1;
}
var v2 = '';
var v3 = number;
while (v3 != 0) {
v2 = this._hash.charAt(v3 % this._base) + v2;
v3 /= this._base;
v3 = int(v3);
}
while (v2.length < minimumChars) {
v2 = this._hash.charAt(0) + v2;
}
return v2;
};
v2.decodeUint = function (encodedNumber) {
var v3 = 0;
var v2 = 0;
while (v2 < encodedNumber.length) {
v3 *= this._base;
v3 += this._reverseHash[encodedNumber.charAt(v2)];
++v2;
}
return v3;
};
v1.DEFAULT_HASH = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/';
ASSetPropFlags(com.newgrounds.encoders.BaseN.prototype, null, 1);
}
#endinitclip
}
movieClip 2086 __Packages.com.newgrounds.APICommand {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.APICommand) {
var v1 = function (command) {
super();
this._command = command;
this._parameters = new Object();
this._secureParameters = new Object();
this._hasTimeout = true;
};
com.newgrounds.APICommand = v1;
com.newgrounds.APICommand extends com.newgrounds.APIEventDispatcher;
var v2 = v1.prototype;
v1.stopPendingCommands = function () {
for (var v2 in com.newgrounds.APICommand._pendingCommands) {
var v1 = com.newgrounds.APICommand._pendingCommands[v2];
v1.close();
}
com.newgrounds.APICommand._pendingCommands = [];
};
v1.onThrottleTimer = function (event) {
if (getTimer() - com.newgrounds.APICommand._throttleTimestamp >= com.newgrounds.APICommand.THROTTLE_INTERVAL) {
com.newgrounds.APICommand._throttleCount = 0;
com.newgrounds.APICommand._throttleCount = 0;
for (;;) {
if (!(com.newgrounds.APICommand._commandQueue.length && com.newgrounds.APICommand._throttleCount < com.newgrounds.APICommand.THROTTLE_THRESHOLD)) break;
var v1 = com.newgrounds.APICommand._commandQueue.shift();
v1.command.send(v1.connection);
++com.newgrounds.APICommand._throttleCount;
}
}
};
v1.encryptHex = function (hexValue) {
var v4 = hexValue.length % 6;
var v3 = '';
var v1 = 0;
while (v1 < hexValue.length) {
v3 += com.newgrounds.APICommand._encryptor.encodeUint(int('0x' + hexValue.substr(v1, 6)), 4);
v1 += 6;
}
return v4.toString() + v3;
};
v2.__get__command = function () {
return this._command;
};
v2.__set__command = function (value) {
this._command = value;
return this.__get__command();
};
v2.__get__hasTimeout = function () {
return this._hasTimeout;
};
v2.__set__hasTimeout = function (val) {
this._hasTimeout = val;
return this.__get__hasTimeout();
};
v2.__get__parameters = function () {
return this._parameters;
};
v2.__set__parameters = function (object) {
this._parameters = new Object();
if (object) {
for (var v3 in object) {
this._parameters[v3] = object[v3];
}
}
return this.__get__parameters();
};
v2.__get__preventCache = function () {
return this._preventCache;
};
v2.__set__preventCache = function (value) {
this._preventCache = value;
return this.__get__preventCache();
};
v2.__get__secureParameters = function () {
return this._secureParameters;
};
v2.__set__secureParameters = function (object) {
this._secureParameters = new Object();
if (object) {
for (var v3 in object) {
this._secureParameters[v3] = object[v3];
}
}
return this.__get__secureParameters();
};
v2.__get__hasSecureParameters = function () {
for (var v2 in this._secureParameters) {
return true;
}
return false;
};
v2.addFile = function (filename, data, dataField, contentType) {
if (contentType == undefined) {
contentType = 'application/octet-stream';
}
if (!this._files) {
this._files = new Object();
}
var v3 = {'filename': filename, 'data': data, 'dataField': dataField, 'contentType': contentType};
this._files[filename] = v3;
};
v2.removeFile = function (filename) {
if (this._files) {
delete this._files[filename];
}
};
v2.clearFiles = function () {
this._files = null;
};
v2.close = function () {
if (this._loader) {
clearInterval(this._timeoutTimer);
var v2 = 0;
while (v2 < com.newgrounds.APICommand._pendingCommands.length) {
if (com.newgrounds.APICommand._pendingCommands[v2] == this) {
com.newgrounds.APICommand._pendingCommands.splice(v2, 1);
break;
}
++v2;
}
this._loader = null;
}
};
v2.loadInBrowser = function (connection, newWindow) {
this._parameters.command_id = this._command;
this._parameters.tracker_id = connection.apiId ? connection.apiId : 1;
if (connection.debug) {
this._parameters.debug = 1;
}
var v3 = connection.apiURL + '?host=' + escape(connection.hostDomain);
for (var v4 in this._parameters) {
v3 += '&' + escape(v4) + '=' + escape(this._parameters[v4]);
}
var v6;
if (newWindow) {
v6 = '_blank';
} else {
v6 = '_top';
}
_root.getURL(v3, v6);
};
v2.send = function (connection) {
if (com.newgrounds.APICommand._throttleCount >= com.newgrounds.APICommand.THROTTLE_THRESHOLD) {
com.newgrounds.APICommand._commandQueue.push({'connection': connection, 'command': this});
} else {
this.sendInternal(connection);
}
};
v2.sendInternal = function (connection) {
var v4;
v4 = new LoadVars();
v4.command_id = this._command;
v4.tracker_id = connection.apiId;
if (connection.debug) {
v4.debug = 1;
}
if (this._preventCache) {
v4.seed = Math.random();
}
var v2;
var v3;
var v7;
for (v2 in this._parameters) {
v3 = this._parameters[v2];
if (v3 != null) {
if (typeof v3 == 'boolean') {
v4[v2] = int(v3);
} else {
v4[v2] = v3;
}
}
}
if (this.__get__hasSecureParameters()) {
var v6 = new Object();
for (v2 in this._secureParameters) {
v3 = this._secureParameters[v2];
if (v3 != null) {
if (typeof v3 == 'boolean') {
v6[v2] = int(v3);
} else {
v6[v2] = v3;
}
}
}
var v8 = '';
v7 = 0;
while (v7 < 16) {
v8 += com.newgrounds.APICommand.ENCRYPTOR_RADIX.charAt(int(Math.random() * com.newgrounds.APICommand.ENCRYPTOR_RADIX.length));
++v7;
}
v4.command_id = 'securePacket';
v6.command_id = this._command;
v6.as_version = 3;
v6.session_id = connection.sessionId;
v6.user_email = connection.userEmail;
v6.publisher_id = connection.publisherId;
v6.seed = v8;
var v13 = com.newgrounds.crypto.MD5.hash(v8);
var v11 = com.newgrounds.crypto.RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(v6), connection.encryptionKey);
v4.secure = com.newgrounds.APICommand.encryptHex(v13 + v11);
}
com.newgrounds.Logger.logInternal('Sending packet:', v4);
var v12;
v12 = 'application/x-www-form-urlencoded';
for (v2 in v4) {
if (typeof v4[v2] == 'object') {
v4[v2] = com.newgrounds.encoders.json.JSON.encode(v4[v2]);
}
}
if (this._files) {
for (var v10 in this._files) {
var v5 = this._files[v10];
if (typeof v5.data == 'string') {
v4[v10] = v5.data;
} else {
v4[v10] = com.newgrounds.encoders.json.JSON.encode(v5.data);
}
}
}
com.newgrounds.APICommand._pendingCommands.push(this);
++com.newgrounds.APICommand._throttleCount;
com.newgrounds.APICommand._throttleTimestamp = getTimer();
this.startLoader(connection.apiURL, v4, v12);
};
v2.startLoader = function (url, data, contentType) {
this._loader = LoadVars(data);
this._loader.onData = this.as2CompleteHandler;
this._loader.contentType = contentType;
this._loader.sendAndLoad(url, this._loader, 'POST');
if (this._hasTimeout) {
setInterval(this, this.onTimeout, com.newgrounds.APICommand.TIMEOUT_INTERVAL);
}
};
v2.as2CompleteHandler = function (data) {
var v3;
var v2 = 0;
while (v2 < com.newgrounds.APICommand._pendingCommands.length) {
if (com.newgrounds.APICommand._pendingCommands[v2]._loader == this) {
v3 = com.newgrounds.APICommand._pendingCommands[v2];
break;
}
++v2;
}
v3.onComplete(data);
};
v2.onTimeout = function (event) {
this.close();
com.newgrounds.Logger.logError('Command timed out.');
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_TIMED_OUT));
};
v2.onError = function (error) {
com.newgrounds.Logger.logError('Error when sending command:', error);
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_UNKNOWN));
this.close();
};
v2.onComplete = function (data) {
com.newgrounds.Logger.logInternal('Received packet:', data);
try {
if (!data || data == '') {
throw new Error();
}
var v2 = com.newgrounds.encoders.json.JSON.decode(data);
if (!v2) {
throw new Error();
}
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, v2, (v2 && v2.success) ? com.newgrounds.APIEvent.ERROR_NONE : com.newgrounds.APIEvent.ERROR_COMMAND_FAILED));
if (com.newgrounds.APICommand.bridge) {
com.newgrounds.APICommand.bridge.sendEvent(v2.command_id, v2);
}
}
catch (e) {
com.newgrounds.Logger.logError('Invalid response returned from server: ' + data);
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_BAD_RESPONSE));
}
this.close();
};
v1.TIMEOUT_INTERVAL = 10000;
v1.THROTTLE_INTERVAL = 10050;
v1.THROTTLE_TICK_INTERVAL = 1000;
v1.THROTTLE_THRESHOLD = 24;
v1._throttleCount = 0;
v1._commandQueue = [];
v1._throttleTimer = setInterval(com.newgrounds.APICommand.onThrottleTimer, com.newgrounds.APICommand.THROTTLE_TICK_INTERVAL);
v1.ENCRYPTOR_RADIX = '/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X';
v1._encryptor = new com.newgrounds.encoders.BaseN(com.newgrounds.APICommand.ENCRYPTOR_RADIX);
v1._pendingCommands = [];
v1.CRLF = '\r\n';
v2.addProperty('command', v2.__get__command, v2.__set__command);
v2.addProperty('hasSecureParameters', v2.__get__hasSecureParameters, function () {});
v2.addProperty('hasTimeout', v2.__get__hasTimeout, v2.__set__hasTimeout);
v2.addProperty('parameters', v2.__get__parameters, v2.__set__parameters);
v2.addProperty('preventCache', v2.__get__preventCache, v2.__set__preventCache);
v2.addProperty('secureParameters', v2.__get__secureParameters, v2.__set__secureParameters);
ASSetPropFlags(com.newgrounds.APICommand.prototype, null, 1);
}
#endinitclip
}
movieClip 2087 __Packages.com.newgrounds.Bridge {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.Bridge) {
var v1 = function (id) {
super();
this._widgetId = id;
this._inConnection = new LocalConnection();
this._outConnection = new LocalConnection();
var me = this;
this._inConnection.receiveEvent = function () {
me.receiveEvent.apply(me, arguments);
};
this._inConnection.allowInsecureDomain = function (d) {
return d == 'www.newgrounds.com' || d == 'newgrounds.com' || d == 'uploads.ungrounded.net';
};
this._inConnection.allowDomain = this._inConnection.allowInsecureDomain;
this._inConnection.connect('_rec_' + this._widgetId);
com.newgrounds.Logger.addEventListener(com.newgrounds.APIEvent.LOG, {'target': this, 'func': this.onLogMessage});
};
com.newgrounds.Bridge = v1;
com.newgrounds.Bridge extends com.newgrounds.EventDispatcher;
var v2 = v1.prototype;
v2.__get__widgetId = function () {
return this._widgetId;
};
v2.onLogMessage = function (event) {
try {
this._outConnection.send(this._widgetId, 'sendEvent', 'trace', String(event.__get__data()));
}
};
v2.sendEvent = function (command, parameters) {
if (this._outConnection) {
parameters = {'data': parameters};
try {
this._outConnection.send(this._widgetId, 'sendEvent', command, parameters);
}
}
};
v2.receiveEvent = function (responseData) {
var v2;
try {
v2 = com.newgrounds.encoders.json.JSON.decode(responseData);
}
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.BRIDGE_EVENT_RECEIVED, v2, (v2 == null) ? com.newgrounds.APIEvent.ERROR_UNKNOWN : null));
};
v2.onStatus = function (event) {};
v2.addProperty('widgetId', v2.__get__widgetId, function () {});
ASSetPropFlags(com.newgrounds.Bridge.prototype, null, 1);
}
#endinitclip
}
movieClip 2088 __Packages.com.newgrounds.encoders.json.JSON {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.encoders) {
_global.com.newgrounds.encoders = new Object();
}
if (!_global.com.newgrounds.encoders.json) {
_global.com.newgrounds.encoders.json = new Object();
}
if (!_global.com.newgrounds.encoders.json.JSON) {
var v1 = function () {};
com.newgrounds.encoders.json.JSON = v1;
var v2 = v1.prototype;
v1.encode = function (arg, noquotes) {
var v3;
var v2;
var v6;
var v1 = '';
var v4;
if (arg.isSServerVar()) {
var v8 = 'sservervariable';
} else {
var v8 = typeof arg;
}
switch (v8) {
return 'null';
case 'sservervariable':
return '?' + arg.getEncodedValue();
break;
case 'object':
if (arg) {
if (arg instanceof Array) {
v2 = 0;
while (v2 < arg.length) {
v4 = com.newgrounds.encoders.json.JSON.encode(arg[v2]);
if (v1) {
v1 += ',';
}
v1 += v4;
++v2;
}
return '[' + v1 + ']';
} else {
if (typeof arg.toString != 'undefined') {
for (v2 in arg) {
v4 = arg[v2];
if (typeof v4 != 'undefined' && typeof v4 != 'function') {
v4 = com.newgrounds.encoders.json.JSON.encode(v4);
if (v1) {
v1 += ',';
}
v1 += com.newgrounds.encoders.json.JSON.encode(v2) + ':' + v4;
}
}
return '{' + v1 + '}';
}
}
}
return 'null';
case 'number':
return isFinite(arg) ? String(arg) : 'null';
case 'string':
v6 = arg.length;
if (noquotes) {
var v7 = '';
} else {
var v7 = '"';
}
v1 = v7;
v2 = 0;
while (v2 < v6) {
v3 = arg.charAt(v2);
if (v3 >= ' ') {
if (v3 == '\\' || v3 == '"') {
v1 += '\\';
}
v1 += v3;
} else {
switch (v3) {
case '\b':
v1 += '\\b';
break;
case '\f':
v1 += '\\f';
break;
case '\n':
v1 += '\\n';
break;
case '\r':
v1 += '\\r';
break;
case '\t':
v1 += '\\t';
break;
default:
v3 = v3.charCodeAt();
v1 += '\\u00' + (Math.floor(v3 / 16)).toString(16) + (v3 % 16).toString(16);
}
}
v2 += 1;
}
return v1 + v7;
case 'boolean':
return String(arg);
default:
return 'null';
}
};
v1.background_encode = function (arg, callback) {
if (com.newgrounds.encoders.json.JSON.busy) {
trace('[Newgrounds Encoder] :: Cannot encode a new file until the previous file is completed');
return false;
} else {
if (!callback) {
trace('[Newgrounds Encoder] :: Missing a callback function, skipping encode');
return false;
}
}
com.newgrounds.encoders.json.JSON.busy = true;
var v2 = new Date();
com.newgrounds.encoders.json.JSON.start = v2.getTime();
com.newgrounds.encoders.json.JSON.cache = {'busy': false, 'complete': false, 'arg': arg, 'target': arg, 'parents': [], 'encoded': '', 'callback': callback, 'encode_chunk': function () {
com.newgrounds.encoders.json.JSON.encode_chunk();
}};
if (com.newgrounds.encoders.json.JSON.getType(arg) == 'object') {
com.newgrounds.encoders.json.JSON.cache.encoded = '{';
com.newgrounds.encoders.json.JSON.interval = setInterval(com.newgrounds.encoders.json.JSON.cache, 'encode_chunk', 25);
return true;
}
if (com.newgrounds.encoders.json.JSON.getType(arg) == 'array') {
com.newgrounds.encoders.json.JSON.cache.encoded = '[';
}
com.newgrounds.encoders.json.JSON.interval = setInterval(com.newgrounds.encoders.json.JSON.cache, 'encode_chunk', 25);
return true;
};
v1.background_decode = function (arg, callback) {
if (com.newgrounds.encoders.json.JSON.busy) {
trace('[Newgrounds Encoder] :: Cannot decode a new file until the previous file is completed');
return false;
} else {
if (!callback) {
trace('[Newgrounds Encoder] :: Missing a callback function, skipping decode');
return false;
}
}
com.newgrounds.encoders.json.JSON.busy = true;
var v1 = new Date();
com.newgrounds.encoders.json.JSON.start = v1.getTime();
com.newgrounds.encoders.json.JSON.cache = {'busy': false, 'callback': callback, 'complete': false, 'arg': arg, 'pos': 0, 'parents': ['root'], 'target': null, 'scratch': '', 'decode_chunk': function () {
com.newgrounds.encoders.json.JSON.decode_chunk();
}};
com.newgrounds.encoders.json.JSON.interval = setInterval(com.newgrounds.encoders.json.JSON.cache, 'decode_chunk', 25);
return true;
};
v1.decode = function (text) {
var at = 0;
var ch = ' ';
var _value;
var _error = function (m) {
throw {'name': 'JSONError', 'message': m, 'at': at - 1, 'text': text};
};
var _next = function () {
ch = text.charAt(at);
at += 1;
return ch;
};
var _white = function () {
while (ch) {
if (ch <= ' ') {
_next();
} else {
if (ch == '/') {
switch (_next()) {
case '/':
for (;;) {
if (!(_next() && ch != '\n' && ch != '\r')) break;
}
break;
case '*':
_next();
for (;;) {
if (ch) {
if (ch == '*') {
if (_next() == '/') {
_next();
break;
}
} else {
_next();
}
continue;
}
_error('Unterminated comment');
}
break;
default:
_error('Syntax error');
}
} else {
break;
}
}
}
};
var _string = function () {
var v4;
var v1 = '';
var v3;
var v2;
var v5 = false;
if (ch == '"') {
while (_next()) {
if (ch == '"') {
_next();
return v1;
} else {
if (ch == '\\') {
switch (_next()) {
case 'b':
v1 += '\b';
break;
case 'f':
v1 += '\f';
break;
case 'n':
v1 += '\n';
break;
case 'r':
v1 += '\r';
break;
case 't':
v1 += '\t';
break;
case 'u':
v2 = 0;
v4 = 0;
while (v4 < 4) {
v3 = parseInt(_next(), 16);
if (!isFinite(v3)) {
v5 = true;
break;
}
v2 = v2 * 16 + v3;
v4 += 1;
}
if (v5) {
v5 = false;
} else {
v1 += String.fromCharCode(v2);
break;
default:
v1 += ch;
}
}
} else {
v1 += ch;
}
}
}
}
_error('Bad string');
};
var _array = function () {
var v1 = [];
if (ch == '[') {
_next();
_white();
if (ch == ']') {
_next();
return v1;
}
while (ch) {
v1.push(_value());
_white();
if (ch == ']') {
_next();
return v1;
} else {
if (ch != ',') {
break;
}
}
_next();
_white();
}
}
_error('Bad array');
};
var _object = function () {
var v2;
var v1 = {};
if (ch == '{') {
_next();
_white();
if (ch == '}') {
_next();
return v1;
}
while (ch) {
v2 = _string();
_white();
if (ch != ':') {
break;
}
_next();
v1[v2] = _value();
_white();
if (ch == '}') {
_next();
return v1;
} else {
if (ch != ',') {
break;
}
}
_next();
_white();
}
}
_error('Bad object');
};
var _number = function () {
var v1 = '';
var v2;
if (ch == '-') {
v1 = '-';
_next();
}
for (;;) {
if (!(ch >= '0' && ch <= '9')) break;
v1 += ch;
_next();
}
if (ch == '.') {
v1 += '.';
for (;;) {
if (!(_next() && ch >= '0' && ch <= '9')) break;
v1 += ch;
}
}
v2 = 1 * v1;
if (!isFinite(v2)) {
_error('Bad number');
} else {
return v2;
}
};
var _word = function () {
switch (ch) {
case 't':
if (_next() == 'r' && _next() == 'u' && _next() == 'e') {
_next();
return true;
}
break;
case 'f':
if (_next() == 'a' && _next() == 'l' && _next() == 's' && _next() == 'e') {
_next();
return false;
}
break;
case 'n':
if (_next() == 'u' && _next() == 'l' && _next() == 'l') {
_next();
return null;
}
}
_error('Syntax error');
};
_value = function () {
_white();
switch (ch) {
case '{':
return _object();
case '[':
return _array();
case '"':
return _string();
case '-':
return _number();
}
return (ch >= '0' && ch <= '9') ? _number() : _word();
};
return _value();
};
v1.getType = function (v) {
if (v instanceof Array) {
return 'array';
} else {
return typeof v;
}
};
v1.decode_chunk = function () {
if (!com.newgrounds.encoders.json.JSON.cache.busy && !com.newgrounds.encoders.json.JSON.cache.complete) {
com.newgrounds.encoders.json.JSON.cache.busy = true;
var v1 = 0;
while (v1 < com.newgrounds.encoders.json.JSON.decode_chunks) {
com.newgrounds.encoders.json.JSON.chunk_decoder();
if (com.newgrounds.encoders.json.JSON.cache.complete) {
break;
}
++v1;
}
trace(Math.round((com.newgrounds.encoders.json.JSON.cache.pos / com.newgrounds.encoders.json.JSON.cache.arg.length) * 100) + '% decoded');
com.newgrounds.encoders.json.JSON.cache.busy = false;
}
if (com.newgrounds.encoders.json.JSON.cache.complete) {
var v2 = new Date();
com.newgrounds.encoders.json.JSON.busy = false;
clearInterval(com.newgrounds.encoders.json.JSON.interval);
com.newgrounds.encoders.json.JSON.cache.callback(com.newgrounds.encoders.json.JSON.cache.root, v2.getTime() - com.newgrounds.encoders.json.JSON.start);
com.newgrounds.encoders.json.JSON.cache.arg = '';
}
};
v1.encode_chunk = function () {
if (!com.newgrounds.encoders.json.JSON.cache.busy && !com.newgrounds.encoders.json.JSON.cache.complete) {
com.newgrounds.encoders.json.JSON.cache.busy = true;
var v1 = 0;
while (v1 < com.newgrounds.encoders.json.JSON.encode_chunks) {
com.newgrounds.encoders.json.JSON.chunk_encoder();
if (com.newgrounds.encoders.json.JSON.cache.complete) {
break;
}
++v1;
}
com.newgrounds.encoders.json.JSON.cache.busy = false;
}
if (com.newgrounds.encoders.json.JSON.cache.complete) {
var v3 = new Date();
var v2 = v3.getTime();
com.newgrounds.encoders.json.JSON.busy = false;
clearInterval(com.newgrounds.encoders.json.JSON.interval);
com.newgrounds.encoders.json.JSON.cache.callback(com.newgrounds.encoders.json.JSON.cache.encoded, v2 - com.newgrounds.encoders.json.JSON.start);
com.newgrounds.encoders.json.JSON.cache.encoded = '';
}
};
v1.chunk_decoder = function () {
function _object() {
var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
com.newgrounds.encoders.json.JSON.cache.mode = 'object';
++com.newgrounds.encoders.json.JSON.cache.pos;
v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (v1 != '"') {
throw 'Malformed object key in encoded string. Keys must be wrapped in quotes ("")';
}
com.newgrounds.encoders.json.JSON.cache.scratch = '';
_setTargetValue({});
} else {
if (v1 == ',') {
++com.newgrounds.encoders.json.JSON.cache.pos;
v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (v1 != '"') {
throw 'Malformed object key in encoded string. Keys must be wrapped in quotes ("")';
}
com.newgrounds.encoders.json.JSON.cache.scratch = '';
} else {
if (v1 == '}') {
_useParent();
} else {
if (v1 == '"') {
++com.newgrounds.encoders.json.JSON.cache.pos;
v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (v1 != ':') {
throw 'Malformed object notation. Object keys and values must be separated by colons(:)';
}
_addParent(com.newgrounds.encoders.json.JSON.cache.scratch);
com.newgrounds.encoders.json.JSON.cache.mode = null;
} else {
if (v1 == '\\') {
++com.newgrounds.encoders.json.JSON.cache.pos;
v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
}
com.newgrounds.encoders.json.JSON.cache.scratch += v1;
}
}
}
}
++com.newgrounds.encoders.json.JSON.cache.pos;
}
function _array() {
var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
com.newgrounds.encoders.json.JSON.cache.mode = 'array';
++com.newgrounds.encoders.json.JSON.cache.pos;
v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
_setTargetValue([]);
if (v1 != ']') {
_addArrayKey();
} else {
_useParent();
}
return undefined;
} else {
if (v1 == ',') {
_addArrayKey();
} else {
if (v1 == ']') {
_useParent();
}
}
}
++com.newgrounds.encoders.json.JSON.cache.pos;
}
function _boolean() {
var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (v1 == 't') {
_setTargetValue(true);
com.newgrounds.encoders.json.JSON.cache.pos += 3;
} else {
if (v1 == 'f') {
_setTargetValue(false);
com.newgrounds.encoders.json.JSON.cache.pos += 4;
} else {
throw 'Bool values must be true or false';
}
}
_useParent();
}
function _null() {
var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (v1 == 'n') {
_setTargetValue(null);
com.newgrounds.encoders.json.JSON.cache.pos += 2;
} else {
throw 'Null values must be null';
}
_useParent();
}
function _string() {
var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
if (v1 != '"') {
throw 'Strings must be wrapped in quotes ("")';
}
com.newgrounds.encoders.json.JSON.cache.scratch = '';
com.newgrounds.encoders.json.JSON.cache.mode = 'string';
} else {
if (v1 == '"') {
_setTargetValue(com.newgrounds.encoders.json.JSON.cache.scratch);
_useParent();
} else {
if (v1 == '\\') {
++com.newgrounds.encoders.json.JSON.cache.pos;
v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
switch (v1) {
case 'n':
v1 = '\n';
break;
case 'r':
v1 = '\n';
break;
case 't':
v1 = '\t';
break;
case 'u':
v1 = '\\' + v1;
}
}
com.newgrounds.encoders.json.JSON.cache.scratch += v1;
}
}
++com.newgrounds.encoders.json.JSON.cache.pos;
}
function _number() {
var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
var v2 = '01234567890.-';
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
com.newgrounds.encoders.json.JSON.cache.mode = 'number';
com.newgrounds.encoders.json.JSON.cache.scratch = '';
}
if (v2.indexOf(v1) < 0) {
_setTargetValue(Number(com.newgrounds.encoders.json.JSON.cache.scratch));
_useParent();
} else {
com.newgrounds.encoders.json.JSON.cache.scratch += v1;
++com.newgrounds.encoders.json.JSON.cache.pos;
}
}
function _setTargetValue(newval) {
var v2 = (_getParent()).obj;
var v1 = com.newgrounds.encoders.json.JSON.cache.parents[com.newgrounds.encoders.json.JSON.cache.parents.length - 1];
v2[v1] = newval;
}
function _useParent() {
com.newgrounds.encoders.json.JSON.cache.mode = com.newgrounds.encoders.json.JSON.getType((_getParent()).obj);
com.newgrounds.encoders.json.JSON.cache.parents.pop();
}
function _getParent() {
var v2 = com.newgrounds.encoders.json.JSON.cache;
var v1 = 0;
while (v1 < com.newgrounds.encoders.json.JSON.cache.parents.length - 1) {
v2 = v2[com.newgrounds.encoders.json.JSON.cache.parents[v1]];
++v1;
}
return {'obj': v2, 'name': com.newgrounds.encoders.json.JSON.cache.parents[v1]};
}
function _getCurrent() {
var v2 = com.newgrounds.encoders.json.JSON.cache;
var v1 = 0;
while (v1 < com.newgrounds.encoders.json.JSON.cache.parents.length) {
v2 = v2[com.newgrounds.encoders.json.JSON.cache.parents[v1]];
++v1;
}
return {'obj': v2, 'name': com.newgrounds.encoders.json.JSON.cache.parents[v1]};
}
function _addParent(child) {
com.newgrounds.encoders.json.JSON.cache.parents.push(child);
}
function _addArrayKey() {
var v1 = (_getCurrent()).obj.length;
com.newgrounds.encoders.json.JSON.cache.parents.push(v1);
com.newgrounds.encoders.json.JSON.cache.mode = null;
}
if (com.newgrounds.encoders.json.JSON.cache.pos >= com.newgrounds.encoders.json.JSON.cache.arg.length) {
com.newgrounds.encoders.json.JSON.cache.complete = true;
return undefined;
} else {
if (com.newgrounds.encoders.json.JSON.cache.mode) {
('_' + com.newgrounds.encoders.json.JSON.cache.mode)();
} else {
var char = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
switch (char) {
case '{':
_object();
break;
case '[':
_array();
break;
case '"':
_string();
break;
case 'n':
_null();
break;
case 't':
_boolean();
break;
case 'f':
_boolean();
break;
default:
_number();
}
}
}
};
v1.chunk_encoder = function () {
if (com.newgrounds.encoders.json.JSON.cache.complete) {
return undefined;
}
var v2 = com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target);
switch (v2) {
case 'number':
com.newgrounds.encoders.json.JSON.cache.encoded += com.newgrounds.encoders.json.JSON.cache.target;
com.newgrounds.encoders.json.JSON.getParent();
break;
case 'string':
com.newgrounds.encoders.json.JSON.cache.encoded += '"' + (com.newgrounds.encoders.json.JSON.cache.target.split('"')).join('\\"') + '"';
com.newgrounds.encoders.json.JSON.getParent();
break;
case 'boolean':
com.newgrounds.encoders.json.JSON.cache.encoded += (com.newgrounds.encoders.json.JSON.cache.target == true) ? 'true' : 'false';
com.newgrounds.encoders.json.JSON.getParent();
break;
case 'null':
com.newgrounds.encoders.json.JSON.cache.encoded += 'null';
com.newgrounds.encoders.json.JSON.getParent();
break;
case 'array':
if (com.newgrounds.encoders.json.JSON.cache.target.length < 1) {
com.newgrounds.encoders.json.JSON.cache.encoded += ']';
com.newgrounds.encoders.json.JSON.getParent();
} else {
com.newgrounds.encoders.json.JSON.cache.parents.push(com.newgrounds.encoders.json.JSON.cache.target);
com.newgrounds.encoders.json.JSON.cache.target = com.newgrounds.encoders.json.JSON.cache.target[0];
if (com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target) == 'array') {
com.newgrounds.encoders.json.JSON.cache.encoded += '[';
} else {
if (com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target) == 'object') {
com.newgrounds.encoders.json.JSON.cache.encoded += '{';
}
}
}
break;
case 'object':
for (var v1 in com.newgrounds.encoders.json.JSON.cache.target) {
break;
}
if (v1 === undefined) {
com.newgrounds.encoders.json.JSON.cache.encoded += '}';
com.newgrounds.encoders.json.JSON.getParent();
} else {
com.newgrounds.encoders.json.JSON.cache.parents.push(com.newgrounds.encoders.json.JSON.cache.target);
com.newgrounds.encoders.json.JSON.cache.target = com.newgrounds.encoders.json.JSON.cache.target[v1];
com.newgrounds.encoders.json.JSON.cache.encoded += '"' + (v1.split('"')).join('\\"') + '":';
if (com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target) == 'array') {
com.newgrounds.encoders.json.JSON.cache.encoded += '[';
} else {
if (com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target) == 'object') {
com.newgrounds.encoders.json.JSON.cache.encoded += '{';
}
}
}
break;
default:
com.newgrounds.encoders.json.JSON.cache.encoded += 'null';
com.newgrounds.encoders.json.JSON.getParent();
}
};
v1.getParent = function () {
if (com.newgrounds.encoders.json.JSON.cache.parents.length > 0) {
var v1 = com.newgrounds.encoders.json.JSON.cache.parents.pop();
if (com.newgrounds.encoders.json.JSON.getType(v1) == 'array') {
v1.shift();
} else {
for (var v3 in v1) {
delete v1[v3];
break;
}
}
if (com.newgrounds.encoders.json.JSON.getType(v1) == 'object' or com.newgrounds.encoders.json.JSON.getType(v1) == 'array') {
for (var v2 in v1) {
break;
}
if (v2 !== undefined) {
com.newgrounds.encoders.json.JSON.cache.encoded += ',';
}
}
com.newgrounds.encoders.json.JSON.cache.target = v1;
} else {
com.newgrounds.encoders.json.JSON.cache.complete = true;
}
};
v1.encode_chunks = 20000;
v1.decode_chunks = 20000;
v1.busy = false;
ASSetPropFlags(com.newgrounds.encoders.json.JSON.prototype, null, 1);
}
#endinitclip
}
movieClip 2089 __Packages.com.newgrounds.crypto.MD5 {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.crypto) {
_global.com.newgrounds.crypto = new Object();
}
if (!_global.com.newgrounds.crypto.MD5) {
var v1 = function () {};
com.newgrounds.crypto.MD5 = v1;
var v2 = v1.prototype;
v1.hash = function (src) {
return com.newgrounds.crypto.MD5.hex_md5(src);
};
v1.hex_md5 = function (src) {
return com.newgrounds.crypto.MD5.binl2hex(com.newgrounds.crypto.MD5.core_md5(com.newgrounds.crypto.MD5.str2binl(src), src.length * 8));
};
v1.core_md5 = function (x, len) {
x[len >> 5] |= 128 << len % 32;
x[(len + 64 >>> 9 << 4) + 14] = len;
var v4 = 1732584193;
var v3 = -271733879;
var v2 = -1732584194;
var v1 = 271733878;
var v5 = 0;
while (v5 < x.length) {
var v10 = v4;
var v9 = v3;
var v8 = v2;
var v7 = v1;
v4 = com.newgrounds.crypto.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 0], 7, -680876936);
v1 = com.newgrounds.crypto.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 1], 12, -389564586);
v2 = com.newgrounds.crypto.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 2], 17, 606105819);
v3 = com.newgrounds.crypto.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 3], 22, -1044525330);
v4 = com.newgrounds.crypto.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 4], 7, -176418897);
v1 = com.newgrounds.crypto.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 5], 12, 1200080426);
v2 = com.newgrounds.crypto.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 6], 17, -1473231341);
v3 = com.newgrounds.crypto.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 7], 22, -45705983);
v4 = com.newgrounds.crypto.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 8], 7, 1770035416);
v1 = com.newgrounds.crypto.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 9], 12, -1958414417);
v2 = com.newgrounds.crypto.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 10], 17, -42063);
v3 = com.newgrounds.crypto.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 11], 22, -1990404162);
v4 = com.newgrounds.crypto.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 12], 7, 1804603682);
v1 = com.newgrounds.crypto.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 13], 12, -40341101);
v2 = com.newgrounds.crypto.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 14], 17, -1502002290);
v3 = com.newgrounds.crypto.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 15], 22, 1236535329);
v4 = com.newgrounds.crypto.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 1], 5, -165796510);
v1 = com.newgrounds.crypto.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 6], 9, -1069501632);
v2 = com.newgrounds.crypto.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 11], 14, 643717713);
v3 = com.newgrounds.crypto.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 0], 20, -373897302);
v4 = com.newgrounds.crypto.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 5], 5, -701558691);
v1 = com.newgrounds.crypto.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 10], 9, 38016083);
v2 = com.newgrounds.crypto.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 15], 14, -660478335);
v3 = com.newgrounds.crypto.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 4], 20, -405537848);
v4 = com.newgrounds.crypto.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 9], 5, 568446438);
v1 = com.newgrounds.crypto.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 14], 9, -1019803690);
v2 = com.newgrounds.crypto.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 3], 14, -187363961);
v3 = com.newgrounds.crypto.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 8], 20, 1163531501);
v4 = com.newgrounds.crypto.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 13], 5, -1444681467);
v1 = com.newgrounds.crypto.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 2], 9, -51403784);
v2 = com.newgrounds.crypto.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 7], 14, 1735328473);
v3 = com.newgrounds.crypto.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 12], 20, -1926607734);
v4 = com.newgrounds.crypto.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 5], 4, -378558);
v1 = com.newgrounds.crypto.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 8], 11, -2022574463);
v2 = com.newgrounds.crypto.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 11], 16, 1839030562);
v3 = com.newgrounds.crypto.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 14], 23, -35309556);
v4 = com.newgrounds.crypto.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 1], 4, -1530992060);
v1 = com.newgrounds.crypto.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 4], 11, 1272893353);
v2 = com.newgrounds.crypto.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 7], 16, -155497632);
v3 = com.newgrounds.crypto.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 10], 23, -1094730640);
v4 = com.newgrounds.crypto.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 13], 4, 681279174);
v1 = com.newgrounds.crypto.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 0], 11, -358537222);
v2 = com.newgrounds.crypto.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 3], 16, -722521979);
v3 = com.newgrounds.crypto.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 6], 23, 76029189);
v4 = com.newgrounds.crypto.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 9], 4, -640364487);
v1 = com.newgrounds.crypto.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 12], 11, -421815835);
v2 = com.newgrounds.crypto.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 15], 16, 530742520);
v3 = com.newgrounds.crypto.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 2], 23, -995338651);
v4 = com.newgrounds.crypto.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 0], 6, -198630844);
v1 = com.newgrounds.crypto.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 7], 10, 1126891415);
v2 = com.newgrounds.crypto.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 14], 15, -1416354905);
v3 = com.newgrounds.crypto.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 5], 21, -57434055);
v4 = com.newgrounds.crypto.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 12], 6, 1700485571);
v1 = com.newgrounds.crypto.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 3], 10, -1894986606);
v2 = com.newgrounds.crypto.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 10], 15, -1051523);
v3 = com.newgrounds.crypto.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 1], 21, -2054922799);
v4 = com.newgrounds.crypto.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 8], 6, 1873313359);
v1 = com.newgrounds.crypto.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 15], 10, -30611744);
v2 = com.newgrounds.crypto.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 6], 15, -1560198380);
v3 = com.newgrounds.crypto.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 13], 21, 1309151649);
v4 = com.newgrounds.crypto.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 4], 6, -145523070);
v1 = com.newgrounds.crypto.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 11], 10, -1120210379);
v2 = com.newgrounds.crypto.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 2], 15, 718787259);
v3 = com.newgrounds.crypto.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 9], 21, -343485551);
v4 = com.newgrounds.crypto.MD5.safe_add(v4, v10);
v3 = com.newgrounds.crypto.MD5.safe_add(v3, v9);
v2 = com.newgrounds.crypto.MD5.safe_add(v2, v8);
v1 = com.newgrounds.crypto.MD5.safe_add(v1, v7);
v5 += 16;
}
return new Array(v4, v3, v2, v1);
};
v1.md5_cmn = function (q, a, b, x, s, t) {
return com.newgrounds.crypto.MD5.safe_add(com.newgrounds.crypto.MD5.bit_rol(com.newgrounds.crypto.MD5.safe_add(com.newgrounds.crypto.MD5.safe_add(a, q), com.newgrounds.crypto.MD5.safe_add(x, t)), s), b);
};
v1.md5_ff = function (a, b, c, d, x, s, t) {
return com.newgrounds.crypto.MD5.md5_cmn(b & c | ~b & d, a, b, x, s, t);
};
v1.md5_gg = function (a, b, c, d, x, s, t) {
return com.newgrounds.crypto.MD5.md5_cmn(b & d | c & ~d, a, b, x, s, t);
};
v1.md5_hh = function (a, b, c, d, x, s, t) {
return com.newgrounds.crypto.MD5.md5_cmn(b ^ c ^ d, a, b, x, s, t);
};
v1.md5_ii = function (a, b, c, d, x, s, t) {
return com.newgrounds.crypto.MD5.md5_cmn(c ^ (b | ~d), a, b, x, s, t);
};
v1.bit_rol = function (num, cnt) {
return num << cnt | num >>> 32 - cnt;
};
v1.safe_add = function (x, y) {
var v1 = (x & 65535) + (y & 65535);
var v2 = (x >> 16) + (y >> 16) + (v1 >> 16);
return v2 << 16 | v1 & 65535;
};
v1.str2binl = function (str) {
var v3 = new Array();
var v4 = 255;
var v1 = 0;
while (v1 < str.length * 8) {
v3[v1 >> 5] |= (str.charCodeAt(v1 / 8) & v4) << v1 % 32;
v1 += 8;
}
return v3;
};
v1.binl2hex = function (binarray) {
var v4 = new String('');
var v3 = new String('0123456789abcdef');
var v1 = 0;
while (v1 < binarray.length * 4) {
v4 += v3.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 + 4 & 15) + v3.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 & 15);
++v1;
}
return v4;
};
ASSetPropFlags(com.newgrounds.crypto.MD5.prototype, null, 1);
}
#endinitclip
}
movieClip 2090 __Packages.com.newgrounds.crypto.RC4 {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.crypto) {
_global.com.newgrounds.crypto = new Object();
}
if (!_global.com.newgrounds.crypto.RC4) {
var v1 = function () {};
com.newgrounds.crypto.RC4 = v1;
var v2 = v1.prototype;
v1.encrypt = function (src, key) {
var v3 = com.newgrounds.crypto.RC4.strToChars(src);
var v1 = com.newgrounds.crypto.RC4.strToChars(key);
var v2 = com.newgrounds.crypto.RC4.calculate(v3, v1);
return com.newgrounds.crypto.RC4.charsToHex(v2);
};
v1.encryptbin = function (src, key) {
var v3 = com.newgrounds.crypto.RC4.strToChars(src);
var v1 = com.newgrounds.crypto.RC4.strToChars(key);
var v2 = com.newgrounds.crypto.RC4.calculate(v3, v1);
return v2;
};
v1.decrypt = function (src, key) {
var v3 = com.newgrounds.crypto.RC4.hexToChars(src);
var v1 = com.newgrounds.crypto.RC4.strToChars(key);
var v2 = com.newgrounds.crypto.RC4.calculate(v3, v1);
return com.newgrounds.crypto.RC4.charsToStr(v2);
};
v1.initialize = function (pwd) {
var v2 = 0;
var v3;
var v4 = pwd.length;
var v1 = 0;
while (v1 <= 255) {
com.newgrounds.crypto.RC4.mykey[v1] = pwd[v1 % v4];
com.newgrounds.crypto.RC4.sbox[v1] = v1;
++v1;
}
v1 = 0;
while (v1 <= 255) {
v2 = (v2 + com.newgrounds.crypto.RC4.sbox[v1] + com.newgrounds.crypto.RC4.mykey[v1]) % 256;
v3 = com.newgrounds.crypto.RC4.sbox[v1];
com.newgrounds.crypto.RC4.sbox[v1] = com.newgrounds.crypto.RC4.sbox[v2];
com.newgrounds.crypto.RC4.sbox[v2] = v3;
++v1;
}
};
v1.calculate = function (plaintxt, psw) {
com.newgrounds.crypto.RC4.initialize(psw);
var v1 = 0;
var v2 = 0;
var v9 = new Array();
var v7;
var v5;
var v6;
var v3 = 0;
while (v3 < plaintxt.length) {
v1 = (v1 + 1) % 256;
v2 = (v2 + com.newgrounds.crypto.RC4.sbox[v1]) % 256;
v5 = com.newgrounds.crypto.RC4.sbox[v1];
com.newgrounds.crypto.RC4.sbox[v1] = com.newgrounds.crypto.RC4.sbox[v2];
com.newgrounds.crypto.RC4.sbox[v2] = v5;
var v4 = (com.newgrounds.crypto.RC4.sbox[v1] + com.newgrounds.crypto.RC4.sbox[v2]) % 256;
v7 = com.newgrounds.crypto.RC4.sbox[v4];
v6 = plaintxt[v3] ^ v7;
v9.push(v6);
++v3;
}
return v9;
};
v1.charsToHex = function (chars) {
var v4 = new String('');
var v3 = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
var v1 = 0;
while (v1 < chars.length) {
v4 += v3[chars[v1] >> 4] + v3[chars[v1] & 15];
++v1;
}
return v4;
};
v1.hexToChars = function (hex) {
var v3 = new Array();
var v1 = (hex.substr(0, 2) == '0x') ? 2 : 0;
while (v1 < hex.length) {
v3.push(parseInt(hex.substr(v1, 2), 16));
v1 += 2;
}
return v3;
};
v1.charsToStr = function (chars) {
var v3 = new String('');
var v1 = 0;
while (v1 < chars.length) {
v3 += String.fromCharCode(chars[v1]);
++v1;
}
return v3;
};
v1.strToChars = function (str) {
var v3 = new Array();
var v1 = 0;
while (v1 < str.length) {
v3.push(str.charCodeAt(v1));
++v1;
}
return v3;
};
v1.sbox = new Array(255);
v1.mykey = new Array(255);
ASSetPropFlags(com.newgrounds.crypto.RC4.prototype, null, 1);
}
#endinitclip
}
movieClip 2091 __Packages.com.newgrounds.API {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.API) {
var v1 = function () {};
com.newgrounds.API = v1;
var v2 = v1.prototype;
v1.__get__connected = function () {
return com.newgrounds.API._connection.__get__connected();
};
v1.__get__isNetworkHost = function () {
return com.newgrounds.API._connection.__get__isNetworkHost();
};
v1.__get__apiId = function () {
com.newgrounds.API._connection.assertInitialized();
return com.newgrounds.API._connection.apiId;
};
v1.__get__debugMode = function () {
return com.newgrounds.API._debugMode;
};
v1.__set__debugMode = function (val) {
com.newgrounds.API._debugMode = val;
return com.newgrounds.API.__get__debugMode();
};
v1.__get__publisherId = function () {
com.newgrounds.API._connection.assertInitialized();
return com.newgrounds.API._connection.publisherId;
};
v1.__get__sessionId = function () {
com.newgrounds.API._connection.assertInitialized();
return com.newgrounds.API._connection.sessionId;
};
v1.__get__hostDomain = function () {
com.newgrounds.API._connection.assertInitialized();
return com.newgrounds.API._connection.hostDomain;
};
v1.__get__hostURL = function () {
com.newgrounds.API._connection.assertInitialized();
return com.newgrounds.API._connection.__get__hostURL();
};
v1.__get__isNewgrounds = function () {
return com.newgrounds.API._connection.publisherId == 1;
};
v1.__get__hasUserSession = function () {
com.newgrounds.API._connection.assertInitialized();
return com.newgrounds.API._connection.__get__hasUserSession();
};
v1.__get__username = function () {
com.newgrounds.API._connection.assertInitialized();
return com.newgrounds.API._connection.username;
};
v1.__get__userId = function () {
com.newgrounds.API._connection.assertInitialized();
return com.newgrounds.API._connection.userId;
};
v1.assertConnected = function (eventType) {
if (eventType == undefined) {
eventType = null;
}
if (com.newgrounds.API._connection.assertConnected()) {
return true;
} else {
if (eventType) {
com.newgrounds.API.dispatchEvent(eventType, null, com.newgrounds.APIEvent.ERROR_NOT_CONNECTED);
}
return false;
}
};
v1.__get__serverTime = function () {
return com.newgrounds.API._serverTime;
};
v1.__get__adsApproved = function () {
return com.newgrounds.API._adsApproved;
};
v1.__get__adFeedURL = function () {
return com.newgrounds.API._adFeedURL;
};
v1.__get__medals = function () {
return com.newgrounds.API._medalsArray;
};
v1.__get__scoreBoards = function () {
return com.newgrounds.API._scoreBoardsArray;
};
v1.__get__saveGroups = function () {
return com.newgrounds.API._saveGroupsArray;
};
v1.connect = function (_root, apiId, encryptionKey, movieVersion) {
if (encryptionKey == undefined) {
encryptionKey = null;
}
if (movieVersion == undefined) {
movieVersion = '';
}
com.newgrounds.APIEventDispatcher.__set__globalDispatcher(com.newgrounds.API._dispatcher);
System.security.loadPolicyFile('http://apifiles.ngfiles.com/crossdomain.xml');
if (com.newgrounds.API._connection.initialized) {
com.newgrounds.Logger.logError('Connection already in progress. Please call API.disconnect() before attempting another connection.');
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_NOT_CONNECTED);
return undefined;
}
apiId = com.newgrounds.API.trimWhitespace(apiId);
if (encryptionKey) {
encryptionKey = com.newgrounds.API.trimWhitespace(encryptionKey);
}
if (!apiId || apiId == '') {
com.newgrounds.Logger.logError('No apiId given. Please use the API ID from your API settings page.');
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return undefined;
}
com.newgrounds.Logger.logMessage('====== Newgrounds API v' + com.newgrounds.API.VERSION + ' ======');
com.newgrounds.API._connection.connectionState = com.newgrounds.APIConnection.CONNECTING;
_root = _root;
com.newgrounds.API._movieVersion = movieVersion;
com.newgrounds.API._connection.apiId = apiId;
var v4;
v4 = apiId.indexOf(':');
if (v4 != -1) {
com.newgrounds.API._connection.trackerId = int(apiId.substring(0, v4));
} else {
com.newgrounds.API._connection.trackerId = int(apiId);
}
if (!com.newgrounds.API._connection.trackerId) {
com.newgrounds.Logger.logError('Invalid API ID: ' + apiId);
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return undefined;
}
com.newgrounds.API._connection.encryptionKey = encryptionKey;
com.newgrounds.API._connection.initialized = true;
com.newgrounds.API._connection.__set__hostURL(_root._url);
com.newgrounds.API.doConnect(_root);
};
v1.doConnect = function (flashVars) {
if (com.newgrounds.API.__get__isNetworkHost() && com.newgrounds.API._debugMode != com.newgrounds.API.RELEASE_MODE) {
com.newgrounds.Logger.logMessage('Live file detected, turning off debug mode.');
com.newgrounds.API._debugMode = com.newgrounds.API.RELEASE_MODE;
}
if (flashVars && flashVars.NewgroundsAPI_SandboxID) {
com.newgrounds.API._bridge = new com.newgrounds.Bridge(flashVars.NewgroundsAPI_SandboxID);
com.newgrounds.APICommand.bridge = com.newgrounds.API._bridge;
} else {
com.newgrounds.API._bridge = new com.newgrounds.Bridge(com.newgrounds.crypto.MD5.hash(String(Math.random())));
com.newgrounds.APICommand.bridge = com.newgrounds.API._bridge;
}
if (com.newgrounds.API._debugMode == com.newgrounds.API.RELEASE_MODE) {
if (flashVars) {
if (flashVars.NewgroundsAPI_UserName) {
com.newgrounds.API._connection.username = flashVars.NewgroundsAPI_UserName;
}
if (flashVars.NewgroundsAPI_UserID) {
com.newgrounds.API._connection.userId = flashVars.NewgroundsAPI_UserID;
}
if (flashVars.NewgroundsAPI_PublisherID) {
com.newgrounds.API._connection.publisherId = flashVars.NewgroundsAPI_PublisherID;
}
if (flashVars.NewgroundsAPI_UserpageFormat) {
com.newgrounds.API._connection.userpageFormat = flashVars.NewgroundsAPI_UserpageFormat;
}
if (flashVars.NewgroundsAPI_SessionID) {
com.newgrounds.API._connection.sessionId = flashVars.NewgroundsAPI_SessionID;
}
if (flashVars.NewgroundsAPI_SaveGroupID) {
com.newgrounds.API._requestedSaveGroupId = flashVars.NewgroundsAPI_SaveGroupID;
}
if (flashVars.NewgroundsAPI_SaveFileID) {
com.newgrounds.API._requestedSaveFileId = flashVars.NewgroundsAPI_SaveFileID;
}
}
} else {
com.newgrounds.API._connection.debug = true;
if (com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_LOGGED_IN || com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_LOGGED_OUT) {
com.newgrounds.API._connection.publisherId = 1;
}
if (com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_LOGGED_IN) {
com.newgrounds.API._connection.sessionId = 'D3bu64p1U53R';
com.newgrounds.API._connection.userId = 10;
com.newgrounds.API._connection.username = 'API-Debugger';
}
}
com.newgrounds.API._connection.sendSimpleCommand('connectMovie', com.newgrounds.API.onConnect, {'host': com.newgrounds.API._connection.hostDomain, 'movie_version': com.newgrounds.API._movieVersion, 'publisher_id': com.newgrounds.API._connection.publisherId});
};
v1.onConnect = function (event) {
var v1 = event.__get__data();
if (!event.__get__success()) {
com.newgrounds.Logger.logError('Unable to connect to the API.');
com.newgrounds.API._connection.reset();
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, event.__get__data(), event.__get__error());
return undefined;
}
if (com.newgrounds.API.__get__debugMode() != com.newgrounds.API.RELEASE_MODE) {
com.newgrounds.API._adFeedURL = com.newgrounds.API.TEST_AD_FEED_URL;
} else {
if (v1.ad_url) {
com.newgrounds.API._adFeedURL = unescape(v1.ad_url);
}
}
switch (v1.ad_status) {
case -1:
com.newgrounds.Logger.logWarning('Your movie is not approved to run Flash Ads.');
break;
case 0:
com.newgrounds.Logger.logWarning('Your movie is still awaiting approval to run Flash Ads.');
break;
case 1:
com.newgrounds.Logger.logMessage('Your movie is approved to run Flash Ads!');
}
com.newgrounds.API._adsApproved = v1.ad_status == 1;
if (com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_HOST_BLOCKED || v1.deny_host) {
com.newgrounds.Logger.logWarning(com.newgrounds.API._connection.hostDomain + ' does not have permission to host this movie!', 'Update your API configuration to allow this host.');
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, {'officialURL': unescape(v1.movie_url)}, com.newgrounds.APIEvent.ERROR_HOST_BLOCKED);
com.newgrounds.API._connection.reset();
return undefined;
}
com.newgrounds.API._movieName = v1.movieName ? v1.movieName : '';
com.newgrounds.Logger.logMessage('Connecting to the Newgrounds API Gateway...', '----- ' + v1.movie_name + ' -----');
if (com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_NEW_VERSION) {
v1.movie_version = 'Debug Mode';
}
if (v1.movie_version) {
com.newgrounds.Logger.logMessage('A new version of this movie is available.', 'Current version:\t' + com.newgrounds.API._movieVersion, 'Newest version:\t' + v1.movie_version, 'Use API.loadOfficialVersion() to link to the latest version.');
com.newgrounds.API._newVersion = true;
} else {
com.newgrounds.API._newVersion = false;
}
com.newgrounds.API._serverTime = new Date(int(v1.time) * 1000);
if (v1.request_portal_url) {
com.newgrounds.API._connection.sendSimpleCommand('setPortalID', null, {'portal_url': com.newgrounds.API._connection.__get__hostURL()});
}
com.newgrounds.API._connection.sendSimpleCommand('preloadSettings', com.newgrounds.API.onMetadataLoaded, {'publisher_id': com.newgrounds.API._connection.publisherId, 'user_id': com.newgrounds.API._connection.userId});
};
v1.onMetadataLoaded = function (event) {
var v11 = event.__get__data();
var v4;
var v1;
if (!event.__get__success()) {
com.newgrounds.Logger.logWarning('Unable to load movie metadata.');
com.newgrounds.API.disconnect();
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, null, event.__get__error());
return undefined;
}
var v10 = 0;
if (v11.medals) {
v10 = v11.medals.length;
var v18;
if (com.newgrounds.API.__get__hasUserSession()) {
v18 = com.newgrounds.API.loadLocal('medals_unlocked_' + com.newgrounds.API.__get__username());
} else {
v18 = com.newgrounds.API.loadLocal('medals_unlocked');
}
v4 = 0;
while (v4 < v10) {
var v5 = v11.medals[v4];
var v15 = v5.medal_unlocked;
var v17 = v18 && v18[v5.medal_id];
var v14 = com.newgrounds.API.__get__hasUserSession() ? v15 : v17;
if (com.newgrounds.API.__get__debugMode() != com.newgrounds.API.RELEASE_MODE) {
v14 = false;
}
var v6 = new com.newgrounds.Medal(com.newgrounds.API._connection, v5.medal_id, v5.medal_name, v5.medal_description, Boolean(int(v5.secret)), v14, v5.medal_value, v5.medal_difficulty, v5.medal_icon);
v6.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, com.newgrounds.API.onMedalUnlocked, false, 0, true);
v6.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, com.newgrounds.API.onMedalUnlockConfirmed, false, 0, true);
com.newgrounds.API._medals[v6.__get__name()] = v6;
com.newgrounds.API._medalsArray.push(v6);
com.newgrounds.Logger.logMessage(v6);
if (com.newgrounds.API.__get__hasUserSession() && v17 && !v15) {
com.newgrounds.Logger.logMessage('Server missed the "' + v6.__get__name() + '" unlock. Resending...');
v6.unlock();
}
++v4;
}
}
com.newgrounds.Logger.logMessage(v10 + ' medal' + ((v10 != 1) ? 's' : '') + ' initialized.');
v10 = 0;
if (v11.score_boards) {
v10 = v11.score_boards.length;
v4 = 0;
while (v4 < v10) {
var v16 = v11.score_boards[v4];
var v9 = new com.newgrounds.ScoreBoard(com.newgrounds.API._connection, v16.name, v16.id);
com.newgrounds.API._scoreBoards[v9.__get__name()] = v9;
com.newgrounds.API._scoreBoardsArray.push(v9);
com.newgrounds.Logger.logMessage(v9);
++v4;
}
}
com.newgrounds.Logger.logMessage(v10 + ' scoreboard' + ((v10 != 1) ? 's' : '') + ' initialized.');
v10 = 0;
if (v11.save_groups) {
v10 = v11.save_groups.length;
v4 = 0;
while (v4 < v10) {
var v2 = v11.save_groups[v4];
var v13 = [];
if (v2.keys) {
v1 = 0;
while (v1 < v2.keys.length) {
var v7 = v2.keys[v1];
v13.push(new com.newgrounds.SaveKey(v7.name, v7.id, v7.type));
++v1;
}
}
var v12 = [];
if (v2.ratings) {
v1 = 0;
while (v1 < v2.ratings.length) {
var v3 = v2.ratings[v1];
v12.push(new com.newgrounds.SaveRating(v3.name, v3.id, v3.float, v3.min, v3.max));
++v1;
}
}
var v8 = new com.newgrounds.SaveGroup(com.newgrounds.API._connection, v2.group_name, v2.group_id, v2.group_type, v13, v12);
com.newgrounds.API._saveGroups[v8.__get__name()] = v8;
com.newgrounds.API._saveGroupsArray.push(v8);
com.newgrounds.Logger.logMessage(v8);
++v4;
}
}
com.newgrounds.Logger.logMessage(v10 + ' save group' + ((v10 != 1) ? 's' : '') + ' initialized.');
if (v11.save_file_path) {
com.newgrounds.API._saveFilePath = v11.save_file_path + '/';
com.newgrounds.SaveFile._saveFilePath = com.newgrounds.API._saveFilePath;
com.newgrounds.Logger.logInternal('Save file path: ' + com.newgrounds.API._saveFilePath);
}
if (v11.image_file_path) {
com.newgrounds.API._imageFilePath = v11.image_file_path + '/';
com.newgrounds.SaveFile._imageFilePath = com.newgrounds.API._imageFilePath;
com.newgrounds.Logger.logInternal('Image file path: ' + com.newgrounds.API._imageFilePath);
}
com.newgrounds.Logger.logMessage('Connection complete!');
com.newgrounds.API._connection.connectionState = com.newgrounds.APIConnection.CONNECTED;
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, {'movieName': com.newgrounds.API._movieName, 'newVersion': com.newgrounds.API._newVersion});
if (com.newgrounds.API._requestedSaveFileId && com.newgrounds.API._requestedSaveGroupId) {
com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.FILE_LOADED, com.newgrounds.API.onRequestedFileLoaded);
com.newgrounds.API.loadSaveFile(com.newgrounds.API._requestedSaveFileId, false);
}
};
v1.disconnect = function () {
if (!com.newgrounds.API._connection.__get__connected()) {
com.newgrounds.Logger.logWarning('The Newgrounds API is already disconnected.');
return undefined;
}
com.newgrounds.API._connection.reset();
for (var v2 in com.newgrounds.API._medals) {
var v1 = com.newgrounds.API._medals[v2];
v1.removeEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, com.newgrounds.API.onMedalUnlocked);
v1.removeEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, com.newgrounds.API.onMedalUnlockConfirmed);
}
com.newgrounds.API._newVersion = false;
com.newgrounds.API._medals = new Object();
com.newgrounds.API._medalsArray = [];
com.newgrounds.API._scoreBoards = new Object();
com.newgrounds.API._scoreBoardsArray = [];
com.newgrounds.API._saveGroups = new Object();
com.newgrounds.API._saveGroupsArray = [];
com.newgrounds.API._sharedObjects = new Object();
com.newgrounds.API._imageFilePath = null;
com.newgrounds.API._saveFilePath = null;
com.newgrounds.Logger.logMessage('Disconnected from the Newgrounds API.');
};
v1.loadNewgrounds = function () {
com.newgrounds.API._connection.loadInBrowser('loadNewgrounds');
};
v1.loadOfficialVersion = function () {
if (com.newgrounds.API._connection.assertInitialized()) {
com.newgrounds.API._connection.loadInBrowser('loadOfficialVersion', false);
}
};
v1.promptSignIn = function () {
if (com.newgrounds.API._connection.assertInitialized()) {
getURL(com.newgrounds.API.PASSPORT_URL + com.newgrounds.API._bridge.__get__widgetId(), '_blank');
com.newgrounds.API._bridge.addEventListener(com.newgrounds.APIEvent.BRIDGE_EVENT_RECEIVED, com.newgrounds.API.onUserSignedIn, false, 0, true);
}
};
v1.onUserSignedIn = function (e) {
com.newgrounds.API._bridge.removeEventListener(com.newgrounds.APIEvent.BRIDGE_EVENT_RECEIVED, com.newgrounds.API.onUserSignedIn);
var v1 = e.__get__data();
if (e.__get__success()) {
try {
if (v1.NewgroundsAPI_UserName) {
com.newgrounds.API._connection.username = v1.NewgroundsAPI_UserName;
}
if (v1.NewgroundsAPI_UserID) {
com.newgrounds.API._connection.userId = v1.NewgroundsAPI_UserID;
}
if (v1.NewgroundsAPI_PublisherID) {
com.newgrounds.API._connection.publisherId = v1.NewgroundsAPI_PublisherID;
}
if (v1.NewgroundsAPI_SessionID) {
com.newgrounds.API._connection.sessionId = v1.NewgroundsAPI_SessionID;
}
com.newgrounds.API._connection.sendSimpleCommand('preloadSettings', com.newgrounds.API.onMetadataLoaded, {'publisher_id': com.newgrounds.API._connection.publisherId, 'user_id': com.newgrounds.API._connection.userId});
}
com.newgrounds.Logger.logMessage('User ' + com.newgrounds.API._connection.username + ' signed in.');
}
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.USER_SIGNED_IN, null, e.__get__success() ? null : com.newgrounds.APIEvent.ERROR_SIGN_IN_FAILED);
};
v1.loadMySite = function () {
if (com.newgrounds.API._connection.assertInitialized()) {
com.newgrounds.API._connection.loadInBrowser('loadMySite');
}
};
v1.loadCustomLink = function (linkName) {
if (com.newgrounds.API._connection.assertInitialized()) {
com.newgrounds.API._connection.loadInBrowser('loadCustomLink', true, {'link': linkName});
}
};
v1.getMedal = function (medalName) {
return com.newgrounds.API._medals[medalName];
};
v1.unlockMedal = function (medalName) {
if (!com.newgrounds.API.assertConnected()) {
return false;
}
var v1 = com.newgrounds.API._medals[medalName];
if (!v1) {
com.newgrounds.Logger.logError('No medal named "' + medalName + '" w.');
return false;
}
return v1.unlock();
};
v1.onMedalUnlocked = function (event) {
if (event.__get__success()) {
var v2 = com.newgrounds.Medal(event.__get__data());
var v1;
if (com.newgrounds.API.__get__hasUserSession()) {
v1 = com.newgrounds.API.loadLocal('medals_unlocked_' + com.newgrounds.API.__get__username());
if (!v1) {
v1 = new Object();
}
v1[v2.__get__id()] = true;
com.newgrounds.API.saveLocal('medals_unlocked_' + com.newgrounds.API.__get__username(), v1);
} else {
v1 = com.newgrounds.API.loadLocal('medals_unlocked');
if (!v1) {
v1 = new Object();
}
v1[(com.newgrounds.Medal(event.__get__data())).__get__id()] = true;
com.newgrounds.API.saveLocal('medals_unlocked', v1);
com.newgrounds.Logger.logMessage('User instanceof not logged in. Medal "' + v2.__get__name() + '" unlocked locally.');
}
}
};
v1.onMedalUnlockConfirmed = function (event) {
if (com.newgrounds.API.__get__hasUserSession()) {
var v1 = com.newgrounds.API.loadLocal('medals_unlocked_' + com.newgrounds.API.__get__username());
if (!v1) {
v1 = new Object();
} else {
delete v1[(com.newgrounds.Medal(event.__get__data())).__get__id()];
}
com.newgrounds.API.saveLocal('medals_unlocked_' + com.newgrounds.API.__get__username(), v1);
}
};
v1.clearLocalMedals = function () {
for (var v2 in com.newgrounds.API._medals) {
var v1 = com.newgrounds.API._medals[v2];
v1.setUnlocked(false);
}
if (!com.newgrounds.API.__get__hasUserSession()) {
com.newgrounds.API.saveLocal('medals_unlocked', new Object());
}
};
v1.getScoreBoard = function (scoreBoardName) {
if (!com.newgrounds.API.assertConnected()) {
return null;
}
return com.newgrounds.API._scoreBoards[scoreBoardName];
};
v1.loadScores = function (scoreBoardName, period, firstResult, numResults, showFriendsOnly, tag) {
if (period == undefined) {
period = 'All-Time';
}
if (firstResult == undefined) {
firstResult = 1;
}
if (numResults == undefined) {
numResults = 10;
}
if (showFriendsOnly == undefined) {
showFriendsOnly = false;
}
if (tag == undefined) {
tag = null;
}
if (!com.newgrounds.API.assertConnected()) {
return null;
}
var v1 = com.newgrounds.API._scoreBoards[scoreBoardName];
if (!v1) {
com.newgrounds.Logger.logError('No scoreboard named "' + scoreBoardName + '" w.');
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.SCORES_LOADED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return null;
}
v1.__set__period(period);
v1.__set__firstResult(firstResult);
v1.__set__numResults(numResults);
v1.__set__tag(tag);
if (showFriendsOnly) {
v1.__set__friendsOf(com.newgrounds.API.userId);
}
v1.loadScores();
return v1;
};
v1.postScore = function (scoreBoardName, numericScore, tag) {
if (tag == undefined) {
tag = null;
}
if (!com.newgrounds.API.assertConnected()) {
return undefined;
}
if (!com.newgrounds.API.__get__hasUserSession()) {
com.newgrounds.Logger.logError('The user must be logged-in to post a score.');
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN);
return undefined;
}
var v1 = com.newgrounds.API._scoreBoards[scoreBoardName];
if (!v1) {
com.newgrounds.Logger.logError('No scoreboard named "' + scoreBoardName + '" w.');
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return undefined;
}
v1.postScore(numericScore, tag);
};
v1.getSaveGroup = function (groupName) {
if (!com.newgrounds.API.assertConnected()) {
return null;
}
return com.newgrounds.API._saveGroups[groupName];
};
v1.getSaveGroupById = function (id) {
for (var v3 in com.newgrounds.API._saveGroups) {
var v1 = com.newgrounds.API._saveGroups[v3];
if (v1.__get__id() == id) {
return v1;
}
}
return null;
};
v1.createSaveFile = function (groupName) {
if (!com.newgrounds.API.assertConnected()) {
return null;
}
var v1 = com.newgrounds.API.getSaveGroup(groupName);
if (!v1) {
com.newgrounds.Logger.logError('The save group "' + groupName + '" w found.');
return null;
}
return new com.newgrounds.SaveFile(v1);
};
v1.loadSaveFile = function (saveId, loadContents) {
if (loadContents == undefined) {
loadContents = true;
}
com.newgrounds.API._connection.sendSimpleCommand('loadSaveFile', com.newgrounds.API.onFileLoaded, {'save_id': saveId, 'get_contents': loadContents});
};
v1.onFileLoaded = function (event) {
var v2;
if (event.__get__success()) {
trace('E: ' + (event.__get__data()).get_contents);
v2 = com.newgrounds.SaveFile.fromObject(com.newgrounds.API.getSaveGroupById((event.__get__data()).group_id), (event.__get__data()).file);
if ((event.__get__data()).get_contents) {
v2.load();
} else {
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.FILE_LOADED, v2);
}
} else {
com.newgrounds.Logger.logError('Unable to load file:', event.__get__error());
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.FILE_LOADED, null, event.__get__error());
}
};
v1.createSaveQuery = function (groupName) {
if (!com.newgrounds.API.assertConnected()) {
return null;
}
var v1 = com.newgrounds.API.getSaveGroup(groupName);
if (!v1) {
com.newgrounds.Logger.logError('The save group "' + groupName + '" w found.');
return null;
}
var v2 = new com.newgrounds.SaveQuery(v1);
return v2;
};
v1.createSaveQueryByDate = function (groupName, sortDescending) {
if (sortDescending == undefined) {
sortDescending = true;
}
var v1 = com.newgrounds.API.createSaveQuery(groupName);
if (!v1) {
return null;
}
v1.sortOn(com.newgrounds.SaveQuery.CREATED_ON, sortDescending);
return v1;
};
v1.createSaveQueryByName = function (groupName, filename, exactMatch, sortDescending) {
if (exactMatch == undefined) {
exactMatch = false;
}
if (sortDescending == undefined) {
sortDescending = false;
}
var v1 = com.newgrounds.API.createSaveQuery(groupName);
if (!exactMatch) {
v1.addCondition(com.newgrounds.SaveQuery.FILE_NAME, com.newgrounds.SaveQuery.OPERATOR_CONTAINS, filename);
return v1;
}
v1.addCondition(com.newgrounds.SaveQuery.FILE_NAME, com.newgrounds.SaveQuery.OPERATOR_EQUAL, filename);
return v1;
};
v1.createSaveQueryByRating = function (groupName, ratingName, sortDescending) {
if (sortDescending == undefined) {
sortDescending = true;
}
var v1 = com.newgrounds.API.createSaveQuery(groupName);
v1.sortOn(ratingName, sortDescending);
return v1;
};
v1.onRequestedFileLoaded = function (event) {
com.newgrounds.API.removeEventListener(com.newgrounds.APIEvent.FILE_LOADED, com.newgrounds.API.onRequestedFileLoaded);
if (event.__get__success()) {
var v1 = event.__get__data();
if (v1) {
com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.FILE_REQUESTED, v1);
}
}
};
v1.addEventListener = function (eventType, listener, priority, useWeakReference) {
if (priority == undefined) {
priority = 0;
}
if (useWeakReference == undefined) {
useWeakReference = true;
}
com.newgrounds.API._dispatcher.addEventListener(eventType, listener, false, priority, useWeakReference);
};
v1.removeEventListener = function (eventType, listener) {
com.newgrounds.API._dispatcher.removeEventListener(eventType, listener);
};
v1.dispatchEvent = function (event, data, error) {
if (data == undefined) {
data = null;
}
if (error == undefined) {
error = null;
}
com.newgrounds.API._dispatcher.dispatchEvent(new com.newgrounds.APIEvent(event, data, error));
};
v1.saveLocal = function (saveId, saveData) {
try {
var v3;
var v2 = 'ng_ap_secure_' + com.newgrounds.API._connection.trackerId + '_' + com.newgrounds.crypto.RC4.encrypt(saveId, com.newgrounds.API._connection.encryptionKey);
if (!com.newgrounds.API._sharedObjects[saveId]) {
com.newgrounds.API._sharedObjects[saveId] = SharedObject.getLocal(v2);
}
v3 = com.newgrounds.API._sharedObjects[saveId];
v3.data.data = com.newgrounds.API.encodeData(saveData);
}
catch (v0) {
if (Error(v0) != null) {
var error = Error(v0);
com.newgrounds.Logger.logError('Unable to save local data.', error);
return false;
return true;
}
throw v0;
}
return true;
};
v1.loadLocal = function (saveId) {
try {
var v1;
var v3 = 'ng_ap_secure_' + com.newgrounds.API._connection.trackerId + '_' + com.newgrounds.crypto.RC4.encrypt(saveId, com.newgrounds.API._connection.encryptionKey);
if (!com.newgrounds.API._sharedObjects[saveId]) {
com.newgrounds.API._sharedObjects[saveId] = SharedObject.getLocal(v3);
}
v1 = com.newgrounds.API._sharedObjects[saveId];
if (v1 && v1.data && v1.data.data) {
return com.newgrounds.API.decodeData(v1.data.data);
}
return null;
}
catch (v0) {
if (Error(v0) != null) {
var error = Error(v0);
com.newgrounds.Logger.logError('Unable to load local data.', error);
return null;
}
throw v0;
}
return null;
};
v1.logCustomEvent = function (eventName) {
if (com.newgrounds.API.assertConnected()) {
com.newgrounds.Logger.logMessage('Logged event: ' + eventName);
com.newgrounds.API._connection.sendSimpleCommand('logCustomEvent', null, {'event': eventName});
}
};
v1.encodeData = function (data) {
if (!com.newgrounds.API._connection.assertInitialized()) {
return null;
}
return com.newgrounds.crypto.RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(data), com.newgrounds.API._connection.encryptionKey);
};
v1.decodeData = function (data) {
if (!com.newgrounds.API._connection.assertInitialized()) {
return null;
}
try {
return com.newgrounds.encoders.json.JSON.decode(com.newgrounds.crypto.RC4.decrypt(data, com.newgrounds.API._connection.encryptionKey));
}
catch (v0) {
if (Error(v0) != null) {
var error = Error(v0);
return null;
}
throw v0;
}
return null;
};
v1.stopPendingCommands = function () {
com.newgrounds.APICommand.stopPendingCommands();
com.newgrounds.Logger.logMessage('Pending commands stopped.');
};
v1.trimWhitespace = function (string) {
if (!string) {
return null;
}
var v3 = 0;
while (string.charAt(v3) == ' ') {
++v3;
}
var v1 = string.length - 1;
for (;;) {
if (!(string.charAt(v1) == ' ' && v1 >= 0)) break;
--v1;
}
return string.slice(v3, v1 + 1);
};
v1.VERSION = '3.2 AS2';
v1.RELEASE_MODE = 'releaseMode';
v1.DEBUG_MODE_LOGGED_IN = 'debugModeLoggedIn';
v1.DEBUG_MODE_LOGGED_OUT = 'debugModeLoggedOut';
v1.DEBUG_MODE_NEW_VERSION = 'debugModeNewVersion';
v1.DEBUG_MODE_HOST_BLOCKED = 'debugModeHostBlocked';
v1.TEST_AD_FEED_URL = 'http://www.ngads.com/adtest.php';
v1.PASSPORT_URL = 'https://www.newgrounds.com/login/remote/';
v1._dispatcher = new com.newgrounds.APIEventDispatcher();
v1._connection = new com.newgrounds.APIConnection();
v1._debugMode = com.newgrounds.API.DEBUG_MODE_LOGGED_IN;
v1._adsApproved = false;
v1._medals = new Object();
v1._medalsArray = [];
v1._scoreBoards = new Object();
v1._scoreBoardsArray = [];
v1._saveGroups = new Object();
v1._saveGroupsArray = [];
v1._sharedObjects = new Object();
v1.addProperty('adFeedURL', v1.__get__adFeedURL, function () {});
v1.addProperty('adsApproved', v1.__get__adsApproved, function () {});
v1.addProperty('apiId', v1.__get__apiId, function () {});
v1.addProperty('connected', v1.__get__connected, function () {});
v1.addProperty('debugMode', v1.__get__debugMode, v1.__set__debugMode);
v1.addProperty('hasUserSession', v1.__get__hasUserSession, function () {});
v1.addProperty('hostDomain', v1.__get__hostDomain, function () {});
v1.addProperty('hostURL', v1.__get__hostURL, function () {});
v1.addProperty('isNetworkHost', v1.__get__isNetworkHost, function () {});
v1.addProperty('isNewgrounds', v1.__get__isNewgrounds, function () {});
v1.addProperty('medals', v1.__get__medals, function () {});
v1.addProperty('publisherId', v1.__get__publisherId, function () {});
v1.addProperty('saveGroups', v1.__get__saveGroups, function () {});
v1.addProperty('scoreBoards', v1.__get__scoreBoards, function () {});
v1.addProperty('serverTime', v1.__get__serverTime, function () {});
v1.addProperty('sessionId', v1.__get__sessionId, function () {});
v1.addProperty('userId', v1.__get__userId, function () {});
v1.addProperty('username', v1.__get__username, function () {});
ASSetPropFlags(com.newgrounds.API.prototype, null, 1);
}
#endinitclip
}
movieClip 2092 __Packages.com.newgrounds.Medal {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.Medal) {
var v1 = function (connection, id, name, description, secret, unlocked, value, difficultyId, iconURL) {
super();
this._connection = connection;
this._id = id;
this._name = name;
this._description = description;
this._secret = secret;
this._unlocked = unlocked;
this._value = value;
this._difficulty = com.newgrounds.Medal.DIFFICULTIES[difficultyId];
};
com.newgrounds.Medal = v1;
com.newgrounds.Medal extends com.newgrounds.APIEventDispatcher;
var v2 = v1.prototype;
v2.__get__difficulty = function () {
return this._difficulty;
};
v2.__get__icon = function () {
return this._iconLoader.__get__bitmapData();
};
v2.__get__id = function () {
return this._id;
};
v2.__get__name = function () {
return this._name;
};
v2.__get__description = function () {
return this._description;
};
v2.__get__secret = function () {
return this._secret;
};
v2.__get__unlocked = function () {
return this._unlocked;
};
v2.__get__value = function () {
return this._value;
};
v2.toString = function () {
if (!this._unlocked) {
return 'Medal: ' + this._name + '\t\t(' + 'locked, ' + this._value + 'pts, ' + this._difficulty + ')';
}
return 'Medal: ' + this._name + '\t\t(' + 'unlocked, ' + this._value + 'pts, ' + this._difficulty + ')';
};
v2.attachIcon = function (parent) {
return this._iconLoader.attachBitmap(parent);
};
v2.unlock = function () {
if (this._unlocked) {
com.newgrounds.Logger.logWarning('Medal "' + this._name + '" is already unlocked.');
return false;
}
com.newgrounds.Logger.logMessage('Unlocking medal "' + this.__get__name() + '"...');
this._unlocked = true;
if (this._connection.__get__hasUserSession()) {
this._connection.sendSimpleCommand('unlockMedal', {'target': this, 'func': this.onUnlockConfirmed}, null, {'medal_id': this.__get__id()});
}
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.MEDAL_UNLOCKED, this));
return true;
};
v2.setUnlocked = function (unlocked) {
this._unlocked = unlocked;
};
v2.onUnlockConfirmed = function (event) {
if (event.__get__success()) {
com.newgrounds.Logger.logMessage('Medal "' + this.__get__name() + '" unlocked.');
} else {
com.newgrounds.Logger.logError('Failed to unlock "' + this.__get__name() + '"!');
}
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, this, event.__get__error()));
};
v1.ICON_WIDTH = 50;
v1.ICON_HEIGHT = 50;
v1.DIFFICULTY_EASY = 'Easy';
v1.DIFFICULTY_MODERATE = 'Moderate';
v1.DIFFICULTY_CHALLENGING = 'Challenging';
v1.DIFFICULTY_DIFFICULT = 'Difficult';
v1.DIFFICULTY_BRUTAL = 'Brutal';
v1.DIFFICULTIES = ['Unknown', com.newgrounds.Medal.DIFFICULTY_EASY, com.newgrounds.Medal.DIFFICULTY_MODERATE, com.newgrounds.Medal.DIFFICULTY_CHALLENGING, com.newgrounds.Medal.DIFFICULTY_DIFFICULT, com.newgrounds.Medal.DIFFICULTY_BRUTAL];
v2.addProperty('description', v2.__get__description, function () {});
v2.addProperty('difficulty', v2.__get__difficulty, function () {});
v2.addProperty('icon', v2.__get__icon, function () {});
v2.addProperty('id', v2.__get__id, function () {});
v2.addProperty('name', v2.__get__name, function () {});
v2.addProperty('secret', v2.__get__secret, function () {});
v2.addProperty('unlocked', v2.__get__unlocked, function () {});
v2.addProperty('value', v2.__get__value, function () {});
ASSetPropFlags(com.newgrounds.Medal.prototype, null, 1);
}
#endinitclip
}
movieClip 2093 __Packages.com.newgrounds.BitmapLoader {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.BitmapLoader) {
var v1 = function (defaultBitmap, url) {
super();
this._bitmapData = defaultBitmap;
this._url = url;
};
com.newgrounds.BitmapLoader = v1;
com.newgrounds.BitmapLoader extends com.newgrounds.APIEventDispatcher;
var v2 = v1.prototype;
v2.__get__url = function () {
return this._url;
};
v2.__set__url = function (v) {
this._loaded = false;
this._url = v;
return this.__get__url();
};
v2.__get__bitmapData = function () {
return this._bitmapData;
};
v2.__set__bitmapData = function (v) {
this._bitmapData = v;
this._loaded = true;
return this.__get__bitmapData();
};
v2.__get__loaded = function () {
return this._loaded;
};
v2.disposeLoader = function () {
if (this._loader) {
if (this._loaderClip._parent == _root) {
this._loader.unloadClip(this._loaderClip.bitmap);
this._loaderClip.removeMovieClip();
}
this._loader = null;
this._loaderClip = null;
}
};
v2.load = function () {
if (!this._url || this._url == '') {
this.onLoadComplete();
return undefined;
}
this._loaded = false;
if (this._bitmapData) {
this._bitmapData.dispose();
this._bitmapData = null;
}
this.disposeLoader();
this.attachBitmap(null);
};
v2.attachBitmap = function (parent) {
if (!parent) {
parent = _root;
}
var v5 = parent.getNextHighestDepth();
var v3 = parent.createEmptyMovieClip('__bitmap' + v5, v5);
if (!this._loaded && this._url && this._url != '') {
v3.createEmptyMovieClip('bitmap', 0);
this._loader = new MovieClipLoader();
this._loaderClip = v3;
if (parent == _root) {
this._loaderClip._visible = false;
}
var thisObj = this;
this._loaderClip.onEnterFrame = function () {
thisObj.pollLoad();
};
this._loader.addListener({'onLoadError': function () {
thisObj.onLoadComplete();
}});
this._loader.loadClip(this._url, v3.bitmap);
return v3;
}
v3.attachBitmap(this._bitmapData, 0);
return v3;
};
v2.pollLoad = function () {
if (this._loaderClip._width) {
this.onLoadComplete();
}
};
v2.onLoadComplete = function () {
var v2;
if (this._loader && this._loaderClip && this._loaderClip._width) {
try {
this._loaderClip.onEnterFrame = null;
v2 = new flash.display.BitmapData(this._loaderClip._width, this._loaderClip._height, true, 0);
v2.draw(this._loaderClip);
this._bitmapData = v2;
this._loaded = true;
}
catch (error) {
if (v2) {
v2.dispose();
}
}
}
this.disposeLoader();
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.ICON_LOADED, this, this._loaded ? null : com.newgrounds.APIEvent.ERROR_BAD_FILE));
};
v1._cacheSeed = 0;
v2._loaded = true;
v2.addProperty('bitmapData', v2.__get__bitmapData, v2.__set__bitmapData);
v2.addProperty('loaded', v2.__get__loaded, function () {});
v2.addProperty('url', v2.__get__url, v2.__set__url);
ASSetPropFlags(com.newgrounds.BitmapLoader.prototype, null, 1);
}
#endinitclip
}
movieClip 2094 __Packages.com.newgrounds.ScoreBoard {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.ScoreBoard) {
var v1 = function (connection, name, id) {
super();
this._connection = connection;
this._name = name;
this._id = id;
};
com.newgrounds.ScoreBoard = v1;
com.newgrounds.ScoreBoard extends com.newgrounds.APIEventDispatcher;
var v2 = v1.prototype;
v2.__get__name = function () {
return this._name;
};
v2.__get__scores = function () {
return this._scores;
};
v2.__get__period = function () {
return this._period;
};
v2.__set__period = function (val) {
this._period = val;
return this.__get__period();
};
v2.__get__firstResult = function () {
return this._firstResult;
};
v2.__set__firstResult = function (val) {
this._firstResult = Math.max(1, val);
return this.__get__firstResult();
};
v2.__get__numResults = function () {
return this._numResults;
};
v2.__set__numResults = function (val) {
this._numResults = val;
return this.__get__numResults();
};
v2.__get__friendsOf = function () {
return this._friendsOf;
};
v2.__set__friendsOf = function (val) {
this._friendsOf = val;
return this.__get__friendsOf();
};
v2.__get__tag = function () {
return this._tag;
};
v2.__set__tag = function (val) {
this._tag = val;
return this.__get__tag();
};
v2.__get__page = function () {
return Math.ceil((this._firstResult - 1) / this._numResults) + 1;
};
v2.prevPage = function () {
if (this.__get__firstResult() > this._numResults) {
this.firstResult -= this._numResults;
}
};
v2.nextPage = function () {
this.firstResult += this._numResults;
};
v2.loadScores = function () {
var v2 = {'publisher_id': this._connection.publisherId, 'board': this._id, 'page': (this._firstResult - 1) / this._numResults + 1, 'num_results': this._numResults, 'period': this._period, 'tag': this._tag};
if (this._friendsOf > 0) {
v2.friends_of = this._friendsOf;
}
this._connection.sendSimpleCommand('loadScores', {'target': this, 'func': this.onScoresLoaded}, v2);
};
v2.postScore = function (numericScore, tag) {
if (tag == undefined) {
tag = null;
}
if (isNaN(numericScore)) {
com.newgrounds.Logger.logError('Cannot post invalid score: ' + numericScore);
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT));
return undefined;
}
com.newgrounds.Logger.logMessage('Posting a score of ' + numericScore + ' by ' + this._connection.username + ' to scoreboard "' + this._name + '"...');
this._connection.sendSimpleCommand('postScore', {'target': this, 'func': this.onScorePosted}, null, {'user_name': this._connection.username, 'board': this._id, 'value': numericScore, 'tag': tag});
};
v2.onScoresLoaded = function (event) {
var v4 = event.__get__data();
this._scores = [];
var v5;
if (v4.first_result) {
v5 = v4.first_result;
} else {
v5 = this._firstResult;
}
if (v4.scores) {
var v3 = 0;
while (v3 < v4.scores.length) {
var v2 = v4.scores[v3];
if (v2) {
this._scores[v3] = new com.newgrounds.Score(v5, v2.username, v2.value, v2.numeric_value, v2.tag);
}
v3++;
v5++;
}
}
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORES_LOADED, this));
};
v2.onScorePosted = function (event) {
if (event.__get__success()) {
com.newgrounds.Logger.logMessage('Score posted!');
var v4 = event.__get__data();
var v2 = {};
v2.score = v4.value;
v2.scoreBoard = this;
} else {
com.newgrounds.Logger.logError('Error posting score: ' + event.__get__error());
}
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORE_POSTED, storedv2, event.__get__error()));
};
v2.toString = function () {
return 'Scoreboard: ' + this._name;
};
v1.TODAY = 'Today';
v1.THIS_WEEK = 'This Week';
v1.THIS_MONTH = 'This Month';
v1.THIS_YEAR = 'This Year';
v1.ALL_TIME = 'All-Time';
v2._period = com.newgrounds.ScoreBoard.ALL_TIME;
v2._firstResult = 1;
v2._numResults = 10;
v2.addProperty('firstResult', v2.__get__firstResult, v2.__set__firstResult);
v2.addProperty('friendsOf', v2.__get__friendsOf, v2.__set__friendsOf);
v2.addProperty('name', v2.__get__name, function () {});
v2.addProperty('numResults', v2.__get__numResults, v2.__set__numResults);
v2.addProperty('page', v2.__get__page, function () {});
v2.addProperty('period', v2.__get__period, v2.__set__period);
v2.addProperty('scores', v2.__get__scores, function () {});
v2.addProperty('tag', v2.__get__tag, v2.__set__tag);
ASSetPropFlags(com.newgrounds.ScoreBoard.prototype, null, 1);
}
#endinitclip
}
movieClip 2095 __Packages.com.newgrounds.Score {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.Score) {
var v1 = function (rank, username, score, numericValue, tag) {
this._rank = rank;
this._username = username;
this._score = score;
this._numericValue = numericValue;
this._tag = tag;
};
com.newgrounds.Score = v1;
var v2 = v1.prototype;
v2.__get__numericValue = function () {
return this._numericValue;
};
v2.__get__rank = function () {
return this._rank;
};
v2.__get__scorez = function () {
return this._score;
};
v2.__get__tag = function () {
return this._tag;
};
v2.__get__username = function () {
return this._username;
};
v2.toString = function () {
return this._rank + '.\t' + this._username + '\t' + this._score;
};
v2.addProperty('numericValue', v2.__get__numericValue, function () {});
v2.addProperty('rank', v2.__get__rank, function () {});
v2.addProperty('scorez', v2.__get__scorez, function () {});
v2.addProperty('tag', v2.__get__tag, function () {});
v2.addProperty('username', v2.__get__username, function () {});
ASSetPropFlags(com.newgrounds.Score.prototype, null, 1);
}
#endinitclip
}
movieClip 2096 __Packages.com.newgrounds.SaveKey {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.SaveKey) {
var v1 = function (name, id, type) {
this._name = name;
this._id = id;
this._type = type;
};
com.newgrounds.SaveKey = v1;
var v2 = v1.prototype;
v2.__get__name = function () {
return this._name;
};
v2.__get__id = function () {
return this._id;
};
v2.__get__type = function () {
return this._type;
};
v2.validateValue = function (value) {
switch (this._type) {
return null;
case com.newgrounds.SaveKey.TYPE_INTEGER:
value = Number(value);
if (!isNaN(value)) {
var v3 = int(value);
if (v3 != value) {
com.newgrounds.Logger.logWarning('Float value ' + value + ' given for integer key "' + this._name + '". Clamping to ' + v3 + '.');
}
return v3;
}
return null;
case com.newgrounds.SaveKey.TYPE_FLOAT:
value = Number(value);
if (!isNaN(value)) {
return isNaN(Number(value));
}
return null;
case com.newgrounds.SaveKey.TYPE_BOOLEAN:
return Boolean(value) && int(value) != 0;
return null;
case com.newgrounds.SaveKey.TYPE_STRING:
return value ? value.toString() : '';
return null;
}
return null;
};
v2.toString = function () {
return this._name;
};
v1.TYPE_FLOAT = 1;
v1.TYPE_INTEGER = 2;
v1.TYPE_STRING = 3;
v1.TYPE_BOOLEAN = 4;
v2.addProperty('id', v2.__get__id, function () {});
v2.addProperty('name', v2.__get__name, function () {});
v2.addProperty('type', v2.__get__type, function () {});
ASSetPropFlags(com.newgrounds.SaveKey.prototype, null, 1);
}
#endinitclip
}
movieClip 2097 __Packages.com.newgrounds.SaveRating {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.SaveRating) {
var v1 = function (name, id, isFloat, minimum, maximum) {
this._name = name;
this._id = id;
this._isFloat = isFloat;
this._minimum = minimum;
this._maximum = maximum;
};
com.newgrounds.SaveRating = v1;
var v2 = v1.prototype;
v2.__get__name = function () {
return this._name;
};
v2.__get__id = function () {
return this._id;
};
v2.__get__isFloat = function () {
return this._isFloat;
};
v2.__get__minimum = function () {
return this._minimum;
};
v2.__get__maximum = function () {
return this._maximum;
};
v2.validateValue = function (value) {
var v2 = (value === null || value === 'null') ? 0 : Number(value);
if (isNaN(v2)) {
com.newgrounds.Logger.logError('Invalid value for rating "' + this._name + '". ' + value);
return NaN;
}
if (v2 < this._minimum) {
com.newgrounds.Logger.logWarning(v2 + ' is out of acceptable range for rating "' + this._name + '". Clamping to ' + this._minimum + '.');
return this._minimum;
}
if (v2 > this._maximum) {
com.newgrounds.Logger.logWarning(v2 + ' is out of acceptable range for rating "' + this._name + '". Clamping to ' + this._maximum + '.');
return this._maximum;
}
if (!this.__get__isFloat()) {
var v3 = int(v2);
if (v3 != v2) {
com.newgrounds.Logger.logWarning('Float value ' + v2 + ' given for integer rating "' + this._name + '". Clamping to ' + v3 + '.');
}
return v3;
}
return v2;
};
v2.toString = function () {
return this._name;
};
v2.addProperty('id', v2.__get__id, function () {});
v2.addProperty('isFloat', v2.__get__isFloat, function () {});
v2.addProperty('maximum', v2.__get__maximum, function () {});
v2.addProperty('minimum', v2.__get__minimum, function () {});
v2.addProperty('name', v2.__get__name, function () {});
ASSetPropFlags(com.newgrounds.SaveRating.prototype, null, 1);
}
#endinitclip
}
movieClip 2098 __Packages.com.newgrounds.SaveGroup {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.SaveGroup) {
var v1 = function (connection, name, id, type, keys, ratings) {
this._connection = connection;
this._id = id;
this._name = name;
this._type = type;
this._keysArray = keys;
this._ratingsArray = ratings;
this._keys = new Object();
this._ratings = new Object();
var v11;
for (var v7 in keys) {
var v2 = keys[v7];
this._keys[v2.__get__name()] = v2;
}
for (var v6 in ratings) {
var v3 = ratings[v6];
this._ratings[v3.__get__name()] = v3;
}
};
com.newgrounds.SaveGroup = v1;
var v2 = v1.prototype;
v2.__get__connection = function () {
return this._connection;
};
v2.__get__name = function () {
return this._name;
};
v2.__get__type = function () {
return this._type;
};
v2.__get__id = function () {
return this._id;
};
v2.__get__keys = function () {
return this._keysArray;
};
v2.__get__ratings = function () {
return this._ratingsArray;
};
v2.getKey = function (name) {
return this._keys[name];
};
v2.getRating = function (name) {
return this._ratings[name];
};
v2.getKeyById = function (id) {
for (var v4 in this._keys) {
var v2 = this._keys[v4];
if (v2.__get__id() == id) {
return v2;
}
}
return null;
};
v2.getRatingById = function (id) {
for (var v4 in this._ratings) {
var v2 = this._ratings[v4];
if (v2.__get__id() == id) {
return v2;
}
}
return null;
};
v2.toString = function () {
return 'SaveGroup: ' + this.__get__name() + ' Keys: ' + this._keysArray + ' Ratings: ' + this._ratingsArray;
};
v1.TYPE_SYSTEM = 0;
v1.TYPE_PRIVATE = 1;
v1.TYPE_PUBLIC = 2;
v1.TYPE_MODERATED = 3;
v2.addProperty('connection', v2.__get__connection, function () {});
v2.addProperty('id', v2.__get__id, function () {});
v2.addProperty('keys', v2.__get__keys, function () {});
v2.addProperty('name', v2.__get__name, function () {});
v2.addProperty('ratings', v2.__get__ratings, function () {});
v2.addProperty('type', v2.__get__type, function () {});
ASSetPropFlags(com.newgrounds.SaveGroup.prototype, null, 1);
}
#endinitclip
}
movieClip 2099 __Packages.com.newgrounds.encoders.ImageScanner {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.encoders) {
_global.com.newgrounds.encoders = new Object();
}
if (!_global.com.newgrounds.encoders.ImageScanner) {
var v1 = function (hashLength, charsPerPixel) {
if (hashLength) {
this._hash = com.newgrounds.encoders.ImageScanner.DEFAULT_HASH.substr(0, hashLength);
}
this._baseN = new com.newgrounds.encoders.BaseN(this._hash);
if (charsPerPixel) {
this._charsPerPixel = charsPerPixel;
}
this.__set__encodeAlpha(false);
};
com.newgrounds.encoders.ImageScanner = v1;
var v2 = v1.prototype;
v2.__get__encodeAlpha = function () {
return this._encodeAlpha;
};
v2.__set__encodeAlpha = function (v) {
this._encodeAlpha = v;
this._maxPerChannel = int(Math.pow(this._hash.length, this._charsPerPixel / (this._encodeAlpha ? 4 : 3)));
if (this._maxPerChannel > 256) {
this._maxPerChannel = 256;
}
return this.__get__encodeAlpha();
};
v2.encode = function (source, callbackFunction, callbackObject) {
var v4 = {'callbackFunction': callbackFunction, 'callbackObject': callbackObject, 'source': source, 'x': 0, 'y': 0, 'output': null};
var v2 = source.width.toString();
var v3 = source.height.toString();
while (v2.length < 3) {
v2 = '0' + v2;
}
while (v3.length < 3) {
v3 = '0' + v3;
}
v4.output = v2 + v3;
var v6 = setInterval(this, 'doEncode', com.newgrounds.encoders.ImageScanner.WORK_INTERVAL, v4);
v4.interval = v6;
};
v2.decode = function (source, callbackFunction, callbackObject) {
var v4 = {'callbackFunction': callbackFunction, 'callbackObject': callbackObject, 'source': source, 'i': 6, 'x': 0, 'y': 0, 'output': null};
var v3 = source.substr(0, 3);
var v2 = source.substr(3, 3);
while (v3.charAt(0) == '0') {
v3 = v3.substr(1);
}
while (v2.charAt(0) == '0') {
v2 = v2.substr(1);
}
var v7 = int(v3);
var v8 = int(v2);
v4.output = new flash.display.BitmapData(v7, v8, this._encodeAlpha);
var v6 = setInterval(this, 'doDecode', com.newgrounds.encoders.ImageScanner.WORK_INTERVAL, v4);
v4.interval = v6;
};
v2.doEncode = function (state) {
var v3 = getTimer();
for (;;) {
if (!(state.y < state.source.height && getTimer() - v3 < com.newgrounds.encoders.ImageScanner.WORK_INTERVAL)) break;
state.output += this.encodePixel(state.source.getPixel32(state.x, state.y));
++state.x;
if (state.x == state.source.width) {
state.x = 0;
++state.y;
}
}
if (state.y == state.source.height) {
clearInterval(state.interval);
state.callbackFunction.call(state.callbackObject, state.output);
}
};
v2.doDecode = function (state) {
var v4 = getTimer();
for (;;) {
if (!(state.y < state.output.height && getTimer() - v4 < com.newgrounds.encoders.ImageScanner.WORK_INTERVAL)) break;
var v3 = this.decodePixel(state.source.substr(state.i, this._charsPerPixel));
state.output.setPixel32(state.x, state.y, v3);
state.i += this._charsPerPixel;
++state.x;
if (state.x == state.output.width) {
state.x = 0;
++state.y;
}
}
if (state.y == state.output.height) {
clearInterval(state.interval);
state.callbackFunction.call(state.callbackObject, state.output);
}
};
v2.encodePixel = function (pixel) {
var v3 = pixel >> 24 & 255;
var v4 = pixel >> 16 & 255;
var v5 = pixel >> 8 & 255;
var v2 = pixel & 255;
v3 = int((v3 / 256) * this._maxPerChannel);
v4 = int((v4 / 256) * this._maxPerChannel);
v5 = int((v5 / 256) * this._maxPerChannel);
v2 = int((v2 / 256) * this._maxPerChannel);
var v7 = v4 * this._maxPerChannel * this._maxPerChannel + v5 * this._maxPerChannel + v2;
if (this._encodeAlpha) {
v7 += v3 * this._maxPerChannel * this._maxPerChannel * this._maxPerChannel;
}
return this._baseN.encodeUint(v7, this._charsPerPixel);
};
v2.decodePixel = function (encodedPixel) {
var v3 = 255;
var v5;
var v6;
var v4;
var v7 = 0;
var v2 = this._baseN.decodeUint(encodedPixel);
v4 = v2 % this._maxPerChannel;
v2 /= int(this._maxPerChannel);
v6 = v2 % this._maxPerChannel;
v2 /= int(this._maxPerChannel);
v5 = v2 % this._maxPerChannel;
v2 /= int(this._maxPerChannel);
if (this._encodeAlpha) {
v3 = v2 % this._maxPerChannel;
v2 /= int(this._maxPerChannel);
}
return v3 << 24 | v5 << 16 | v6 << 8 | v4;
};
v1.DEFAULT_HASH = '0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&';
v2._hash = com.newgrounds.encoders.ImageScanner.DEFAULT_HASH;
v2._charsPerPixel = 2;
v1.WORK_INTERVAL = 33.33333333333334;
v2.addProperty('encodeAlpha', v2.__get__encodeAlpha, v2.__set__encodeAlpha);
ASSetPropFlags(com.newgrounds.encoders.ImageScanner.prototype, null, 1);
}
#endinitclip
}
movieClip 2100 __Packages.com.newgrounds.SaveFile {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.SaveFile) {
var v1 = function (group) {
super();
this._iconLoader = new com.newgrounds.BitmapLoader(com.newgrounds.SaveFile.DEFAULT_ICON, null);
this._group = group;
this._keys = {};
this._ratings = {};
this._numVotes = {};
};
com.newgrounds.SaveFile = v1;
com.newgrounds.SaveFile extends com.newgrounds.APIEventDispatcher;
var v2 = v1.prototype;
v1.__get__currentFile = function () {
return com.newgrounds.SaveFile._currentFile;
};
v1.fromObject = function (group, fileData) {
var v3 = new com.newgrounds.SaveFile(group);
v3._name = fileData.filename;
v3._description = fileData.description;
v3._id = fileData.save_id;
v3._authorId = fileData.user_id;
v3._authorName = fileData.user_name;
v3._createdDate = fileData.created;
v3._modifiedDate = fileData.last_update;
v3._views = fileData.views;
if (fileData.thumb && fileData.thumb != '') {
v3._iconLoader.__set__url(com.newgrounds.SaveFile._imageFilePath + fileData.thumb + '?' + Math.random());
}
v3._dataURL = com.newgrounds.SaveFile._saveFilePath + fileData.file;
v3._fileSize = fileData.file_size;
v3._approved = fileData.status != com.newgrounds.SaveFile.STATUS_UNAPPROVED;
v3._readOnly = false;
v3._public = fileData.status != com.newgrounds.SaveFile.STATUS_PRIVATE && fileData.status != com.newgrounds.SaveFile.STATUS_UNAPPROVED;
for (var v8 in fileData.keys) {
var v6 = fileData.keys[v8];
var v4 = group.getKeyById(v6.id);
if (v4) {
v3._keys[v4.__get__name()] = v4.validateValue(v6.value);
}
}
for (var v9 in fileData.ratings) {
var v5 = fileData.ratings[v9];
var v2 = group.getRatingById(v5.id);
if (v2) {
v3._ratings[v2.__get__name()] = v2.validateValue(v5.score);
v3._numVotes[v2.__get__name()] = int(v5.votes);
}
}
return v3;
};
v2.__get__group = function () {
return this._group;
};
v2.__get__name = function () {
return this._name;
};
v2.__set__name = function (val) {
this._name = val;
return this.__get__name();
};
v2.__get__description = function () {
return this._description;
};
v2.__set__description = function (val) {
this._description = val;
return this.__get__description();
};
v2.__get__id = function () {
return this._id;
};
v2.__get__data = function () {
return this._data;
};
v2.__set__data = function (val) {
this._data = val;
return this.__get__data();
};
v2.__get__bytesLoaded = function () {
if (this._data) {
return this.__get__bytesTotal();
} else {
if (!this._dataLoader) {
return 0;
} else {
return this._dataLoader.getBytesLoaded();
}
}
};
v2.__get__bytesTotal = function () {
return this._fileSize;
};
v2.__get__readOnly = function () {
return this._readOnly;
};
v2.__get__draft = function () {
return this._draft;
};
v2.__set__draft = function (v) {
this._draft = v;
return this.__get__draft();
};
v2.__get__authorId = function () {
return this._authorId;
};
v2.__get__authorName = function () {
return this._authorName;
};
v2.__get__keys = function () {
return this._keys;
};
v2.__get__ratings = function () {
return this._ratings;
};
v2.__get__numVotes = function () {
return this._numVotes;
};
v2.__get__views = function () {
return this._views;
};
v2.__get__createdDate = function () {
return this._createdDate;
};
v2.__get__updatedDate = function () {
return this._modifiedDate;
};
v2.toString = function () {
return 'Save File: ' + this._name;
};
v2.__get__icon = function () {
return this._iconLoader.__get__bitmapData();
};
v2.__set__icon = function (v) {
this.createIcon(v);
return this.__get__icon();
};
v2.__get__iconLoaded = function () {
return this._iconLoader.__get__loaded();
};
v2.createIcon = function (source) {
var v9 = new flash.display.BitmapData(com.newgrounds.SaveFile.ICON_WIDTH, com.newgrounds.SaveFile.ICON_HEIGHT, false, 0);
var v7;
var v6;
var v10 = 0;
var v8 = 0;
if (source instanceof flash.display.BitmapData) {
v7 = source.width;
v6 = source.height;
} else {
if (source instanceof MovieClip) {
var v2 = (MovieClip(source)).getBounds(source);
v7 = v2.xMax - v2.xMin;
v6 = v2.yMax - v2.yMin;
v10 = v2.xMin;
v8 = v2.yMin;
}
}
var v4 = new flash.geom.Matrix();
var v5;
v5 = Math.min(com.newgrounds.SaveFile.ICON_WIDTH / v7, com.newgrounds.SaveFile.ICON_HEIGHT / v6);
v4.translate(-v10, -v8);
v4.scale(v5, v5);
v4.translate((com.newgrounds.SaveFile.ICON_WIDTH - v7 * v5) / 2, (com.newgrounds.SaveFile.ICON_HEIGHT - v6 * v5) / 2);
v9.draw(source, v4);
this._iconLoader.__set__bitmapData(v9);
};
v2.attachIcon = function (parent) {
if (this._iconLoader) {
return this._iconLoader.attachBitmap(parent);
}
com.newgrounds.Logger.logError('No icon available for this sumbission.');
return null;
};
v2.deleteFile = function () {
if (!(this._group.__get__connection()).__get__hasUserSession()) {
com.newgrounds.Logger.logError('The user must be logged-in to delete a file.');
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN));
return undefined;
}
if (!this._id) {
com.newgrounds.Logger.logError('The file does not exist.');
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN));
return undefined;
}
var v2 = new com.newgrounds.APICommand('deleteSaveFile');
(v2.__get__secureParameters()).save_id = this._id;
v2.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, {'target': this, 'func': this.onFileDeleted});
(this._group.__get__connection()).sendCommand(v2);
};
v2.save = function () {
if (!(this._group.__get__connection()).__get__hasUserSession()) {
com.newgrounds.Logger.logError('The user must be logged-in to save a file.');
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN));
return undefined;
}
++com.newgrounds.BitmapLoader._cacheSeed;
com.newgrounds.SaveFile._currentFile = this;
if (this.__get__iconLoaded()) {
com.newgrounds.SaveFile.ICON_IMAGE_SCANNER.encode(this.__get__icon(), this.onIconEncoded, this);
} else {
this.encodeData(true);
}
};
v2.onIconEncoded = function (encodedIcon) {
this._encodedIcon = encodedIcon;
this.encodeData(true);
};
v2.doSave = function () {
var v4 = new com.newgrounds.APICommand('saveFile');
(v4.__get__secureParameters()).group = this._group.id;
(v4.__get__secureParameters()).user_name = (this._group.__get__connection()).username;
(v4.__get__secureParameters()).filename = this._name;
(v4.__get__secureParameters()).description = this._description;
if (this._draft) {
(v4.__get__secureParameters()).draft = true;
}
if (this._id && !this._readOnly) {
(v4.__get__secureParameters()).overwrite = 1;
(v4.__get__secureParameters()).save_id = this._id;
}
var v8 = [];
for (var v9 in this._keys) {
var v2 = this._group.getKey(v9);
if (v2) {
v8.push({'id': v2.__get__id(), 'value': v2.validateValue(this._keys[v9])});
} else {
com.newgrounds.Logger.logError('No key named "' + v9 + '" in save group "' + this._group.__get__name() + '".');
}
}
(v4.__get__secureParameters()).keys = v8;
var v7 = [];
for (var v10 in this._ratings) {
var v3 = this._group.getRating(v10);
if (v3) {
v7.push({'id': v3.__get__id(), 'value': v3.validateValue(this._ratings[v10])});
} else {
com.newgrounds.Logger.logError('No rating named "' + v10 + '" in save group "' + this._group.__get__name() + '".');
}
}
(v4.__get__secureParameters()).ratings = v7;
if (typeof this._encodedData == 'string') {
v4.addFile('file', this._encodedData, 'file');
} else {
v4.addFile('file', com.newgrounds.encoders.json.JSON.encode(this._encodedData), 'file');
}
if (this.__get__iconLoaded()) {
v4.addFile('thumbnail', this._encodedIcon, 'thumbnail');
}
v4.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, {'target': this, 'func': this.onSaveComplete});
(this._group.__get__connection()).sendCommand(v4);
};
v2.encodeData = function (encode) {
this._encoderQueue = [];
this._encoding = encode;
if (encode) {
this._encodedData = this._data;
this.preEncodeObject(this, '_encodedData');
} else {
this.preEncodeObject(this, '_data');
}
this.encodeObject();
};
v2.preEncodeObject = function (parent, property) {
var v3 = parent[property];
var v5;
try {
if (this._encoding) {
v5 = v3 instanceof flash.display.BitmapData;
} else {
v5 = v3.type == '__bitmap';
}
}
var v2 = v3;
var v8;
if (v5) {
this._encoderQueue.push({'parent': parent, 'property': property});
} else {
if (typeof v3 == 'object' && !v8) {
if (this._encoding) {
if (v3 instanceof Array) {
v2 = [];
} else {
v2 = {};
}
for (var v4 in v3) {
v2[v4] = v3[v4];
}
parent[property] = v2;
}
for (v4 in v2) {
this.preEncodeObject(v2, v4);
}
}
}
};
v2.encodeObject = function () {
if (!this._encoderQueue.length) {
if (this._encoding) {
this.doSave();
} else {
this._dataLoaded = true;
this.checkLoadComplete();
}
return undefined;
}
var v6 = this._encoderQueue.pop();
var v4 = v6.parent;
var v3 = v6.property;
var v2 = v4[v3];
var v5;
if (this._encoding) {
v5 = {'type': '__bitmap', 'width': v2.width, 'height': v2.height, 'transparent': v2.transparent};
v4[v3] = v5;
this._encodingParent = v5;
this._encodingProperty = 'data';
com.newgrounds.SaveFile.DATA_IMAGE_SCANNER.__set__encodeAlpha(v2.transparent);
com.newgrounds.SaveFile.DATA_IMAGE_SCANNER.encode(flash.display.BitmapData(v2), this.encodeBitmapComplete, this);
} else {
this._encodingParent = v4;
this._encodingProperty = v3;
com.newgrounds.SaveFile.DATA_IMAGE_SCANNER.__set__encodeAlpha(v2.transparent);
com.newgrounds.SaveFile.DATA_IMAGE_SCANNER.decode(String(v2.data), this.encodeBitmapComplete, this);
}
};
v2.encodeBitmapComplete = function (data) {
this._encodingParent[this._encodingProperty] = data;
this.encodeObject();
};
v2.load = function () {
com.newgrounds.SaveFile._currentFile = this;
this._dataLoaded = false;
this._data = null;
if (!this.__get__iconLoaded()) {
this._iconLoader.addEventListener(com.newgrounds.APIEvent.ICON_LOADED, {'target': this, 'func': this.onIconLoaded});
this._iconLoader.load();
}
this._dataLoader = new LoadVars();
var file = this;
this._dataLoader.onData = function (data) {
file.onDataLoaded(data);
};
this._dataLoader.load(this._dataURL + '&random=' + Math.random());
};
v2.onIconLoaded = function (event) {
if (!event.__get__success() && this._iconLoader.__get__url()) {
com.newgrounds.Logger.logWarning('Unable to load the icon for this save file.');
}
this._iconLoader.removeEventListener(com.newgrounds.APIEvent.ICON_LOADED, this.onIconLoaded);
this.checkLoadComplete();
};
v2.checkLoadComplete = function () {
if (this._dataLoaded && this.__get__iconLoaded()) {
this._iconLoader.removeEventListener(com.newgrounds.APIEvent.ICON_LOADED, this.onIconLoaded);
com.newgrounds.Logger.logMessage('Data loaded.');
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this));
}
};
v2.onDataLoaded = function (data) {
try {
if (data) {
if (data.charAt(0) == '{') {
this._data = com.newgrounds.encoders.json.JSON.decode(String(data));
} else {
this._data = String(data);
}
this.encodeData(false);
}
}
catch (v0) {
if (Error(v0) != null) {
var error = Error(v0);
com.newgrounds.Logger.logError('Error while loading data:', error);
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this, com.newgrounds.APIEvent.ERROR_BAD_FILE));
} else {
throw v0;
}
}
};
v2.onDataError = function (error) {
com.newgrounds.Logger.logError('Unable to load data:', error);
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this, com.newgrounds.APIEvent.ERROR_BAD_FILE));
};
v2.onSaveComplete = function (event) {
if (event.__get__success()) {
com.newgrounds.Logger.logMessage('File "' + this._name + '" saved!');
if (event.__get__data()) {
this._id = (event.__get__data()).save_id;
this._dataURL = unescape((event.__get__data()).file_url);
}
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, this));
} else {
com.newgrounds.Logger.logError('Error saving file "' + this._name + '":', event.__get__error());
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, this, event.__get__error()));
}
};
v2.sendVote = function (ratingName, vote) {
var v2 = this._group.getRating(ratingName);
if (!v2) {
com.newgrounds.Logger.logError('No save rating named "' + ratingName + '" exists for this save group.');
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, {}, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT));
return undefined;
}
vote = v2.validateValue(vote);
if (isNaN(vote)) {
com.newgrounds.Logger.logError('Invalid vote (' + vote + '). ' + ratingName + ' allows a range of ' + v2.__get__minimum() + '-' + v2.__get__maximum() + '.');
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, {}, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT));
return undefined;
}
com.newgrounds.Logger.logMessage('Voting ' + vote + ' for ' + ratingName + ' on ' + this._name + '...');
(this._group.__get__connection()).sendSimpleCommand('rateSaveFile', {'target': this, 'func': this.onVoteComplete}, null, {'group': this._group.__get__id(), 'save_id': this._id, 'rating_id': v2.__get__id(), 'vote': vote});
};
v2.onVoteComplete = function (event) {
var v2 = event.__get__error();
if ((event.__get__data()).already_voted) {
com.newgrounds.Logger.logError('Vote failed. You\'ve already voted on this rating today.');
v2 = com.newgrounds.APIEvent.ERROR_ALREADY_VOTED;
}
if (v2 == com.newgrounds.APIEvent.ERROR_NONE) {
var v3 = this._group.getRatingById((event.__get__data()).rating_id);
if (v3) {
this._ratings[v3.__get__name()] = v3.validateValue((event.__get__data()).score);
}
com.newgrounds.Logger.logMessage('Vote complete!');
}
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, this, v2));
};
v2.onFileDeleted = function (event) {
if (event.__get__success()) {
this._id = 0;
}
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, this, event.__get__error()));
};
v2.clone = function () {
var v3 = new com.newgrounds.SaveFile(this._group);
v3._data = this._data;
v3._description = this._description;
v3._draft = this._draft;
v3._fileSize = this._fileSize;
v3._iconLoader.__set__bitmapData(this._iconLoader.bitmapData);
var v2;
for (v2 in this._keys) {
v3._keys[v2] = this._keys[v2];
}
for (v2 in this._ratings) {
v3._ratings[v2] = this._ratings[v2];
}
for (v2 in this._numVotes) {
v3._numVotes[v2] = this._numVotes[v2];
}
v3._name = this._name;
return v3;
};
v1.ICON_WIDTH = 90;
v1.ICON_HEIGHT = 90;
v1.DEFAULT_ICON = new flash.display.BitmapData(com.newgrounds.SaveFile.ICON_WIDTH, com.newgrounds.SaveFile.ICON_HEIGHT, false, 0);
v1.STATUS_PRIVATE = 0;
v1.STATUS_SHARED = 1;
v1.STATUS_UNAPPROVED = 2;
v1.STATUS_APPROVED = 3;
v1._imageFilePath = '';
v1._saveFilePath = '';
v1.ICON_IMAGE_SCANNER = new com.newgrounds.encoders.ImageScanner();
v1.DATA_IMAGE_SCANNER = new com.newgrounds.encoders.ImageScanner(64, 6);
v2.addProperty('authorId', v2.__get__authorId, function () {});
v2.addProperty('authorName', v2.__get__authorName, function () {});
v2.addProperty('bytesLoaded', v2.__get__bytesLoaded, function () {});
v2.addProperty('bytesTotal', v2.__get__bytesTotal, function () {});
v2.addProperty('createdDate', v2.__get__createdDate, function () {});
v1.addProperty('currentFile', v1.__get__currentFile, function () {});
v2.addProperty('data', v2.__get__data, v2.__set__data);
v2.addProperty('description', v2.__get__description, v2.__set__description);
v2.addProperty('draft', v2.__get__draft, v2.__set__draft);
v2.addProperty('group', v2.__get__group, function () {});
v2.addProperty('icon', v2.__get__icon, v2.__set__icon);
v2.addProperty('iconLoaded', v2.__get__iconLoaded, function () {});
v2.addProperty('id', v2.__get__id, function () {});
v2.addProperty('keys', v2.__get__keys, function () {});
v2.addProperty('name', v2.__get__name, v2.__set__name);
v2.addProperty('numVotes', v2.__get__numVotes, function () {});
v2.addProperty('ratings', v2.__get__ratings, function () {});
v2.addProperty('readOnly', v2.__get__readOnly, function () {});
v2.addProperty('updatedDate', v2.__get__updatedDate, function () {});
v2.addProperty('views', v2.__get__views, function () {});
ASSetPropFlags(com.newgrounds.SaveFile.prototype, null, 1);
}
#endinitclip
}
movieClip 2101 __Packages.com.newgrounds.SaveQuery {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.newgrounds) {
_global.com.newgrounds = new Object();
}
if (!_global.com.newgrounds.SaveQuery) {
var v1 = function (group) {
super();
this._group = group;
this._connection = group.connection;
this.reset();
};
com.newgrounds.SaveQuery = v1;
com.newgrounds.SaveQuery extends com.newgrounds.APIEventDispatcher;
var v2 = v1.prototype;
v2.__get__group = function () {
return this._group;
};
v2.__get__resultsPerPage = function () {
return this._resultsPerPage;
};
v2.__set__resultsPerPage = function (val) {
this._resultsPerPage = Math.min(Math.max(val, 1), 100);
return this.__get__resultsPerPage();
};
v2.__get__page = function () {
return this._page;
};
v2.__set__page = function (val) {
this._page = Math.max(val, 1);
return this.__get__page();
};
v2.prevPage = function () {
this.__set__page(this.__get__page() - 1);
};
v2.nextPage = function () {
this.__set__page(this.__get__page() + 1);
};
v2.__get__isRandomized = function () {
return this._isRandomized;
};
v2.__set__isRandomized = function (val) {
this._isRandomized = val;
return this.__get__isRandomized();
};
v2.__get__files = function () {
return this._files;
};
v2.reset = function () {
this._page = 1;
this._resultsPerPage = 10;
this._isRandomized = false;
this._lookupKeys = [];
this._lookupRatings = [];
this._fileConditions = [];
this._keyConditions = [];
this._ratingConditions = [];
this._sortFields = [];
this._files = [];
this.includeAllFields();
};
v2.clone = function () {
var v2 = new com.newgrounds.SaveQuery(this._group);
v2._page = this._page;
v2._resultsPerPage = this._resultsPerPage;
v2._isRandomized = this._isRandomized;
v2._lookupKeys = this._lookupKeys.concat();
v2._lookupRatings = this._lookupRatings.concat();
v2._fileConditions = this._fileConditions.concat();
v2._keyConditions = this._keyConditions.concat();
v2._ratingConditions = this._ratingConditions.concat();
return v2;
};
v2.includeAllFields = function () {
for (var v5 in this._group.__get__keys()) {
var v2 = (this._group.__get__keys())[v5];
this._lookupKeys.push(v2.__get__id());
}
for (var v4 in this._group.__get__ratings()) {
var v3 = (this._group.__get__ratings())[v4];
this._lookupRatings.push(v3.__get__id());
}
};
v2.addCondition = function (field, operator, value) {
var v2;
v2 = 0;
while (v2 < com.newgrounds.SaveQuery.FILE_FIELDS.length) {
if (com.newgrounds.SaveQuery.FILE_FIELDS[v2] == field) {
break;
}
++v2;
}
if (v2 == com.newgrounds.SaveQuery.FILE_FIELDS.length) {
v2 = -1;
}
if (v2 >= 0) {
this._fileConditions.push({'field': v2, 'operator': operator, 'value': value});
} else {
var v4 = this._group.getKey(field);
if (v4) {
value = v4.validateValue(value);
this._keyConditions.push({'key_id': v4.__get__id(), 'operator': operator, 'value': value});
return undefined;
}
var v3 = field.split('.');
var v6 = this._group.getRating(v3[0]);
if (v6) {
if (v3[1] != 'votes') {
value = v6.validateValue(value);
}
this._ratingConditions.push({'rating_id': v6.__get__id(), 'operator': operator, 'value': value, 'column': v3[1] ? v3[1] : 'score'});
return undefined;
}
com.newgrounds.Logger.logError('The save group "' + this._group.__get__name() + '" does not have a field named "' + field + '".');
}
};
v2.sortOn = function (field, sortDescending) {
if (sortDescending == undefined) {
sortDescending = false;
}
var v2;
v2 = 0;
while (v2 < com.newgrounds.SaveQuery.FILE_FIELDS.length) {
if (com.newgrounds.SaveQuery.FILE_FIELDS[v2] == field) {
break;
}
++v2;
}
if (v2 == com.newgrounds.SaveQuery.FILE_FIELDS.length) {
v2 = -1;
}
if (v2 >= 0) {
this._sortFields.push({'table': com.newgrounds.SaveQuery.TABLE_FILES, 'field': v2, 'desc': sortDescending});
} else {
var v5 = this._group.getKey(field);
if (v5) {
this._sortFields.push({'table': com.newgrounds.SaveQuery.TABLE_KEYS, 'field': v5.__get__id(), 'desc': sortDescending});
return undefined;
}
var v3 = field.split('.');
var v6 = this._group.getRating(v3[0]);
if (v6) {
this._sortFields.push({'table': com.newgrounds.SaveQuery.TABLE_RATINGS, 'field': v6.__get__id(), 'desc': sortDescending, 'extra': v3[1] ? v3[1] : 'score'});
return undefined;
}
com.newgrounds.Logger.logError('The save group "' + this._group.__get__name() + '" does not have a field named "' + field + '".');
}
};
v2.execute = function () {
var v5 = {};
v5.page = this._page;
v5.num_results = this._resultsPerPage;
if (this._isRandomized) {
v5.randomize = 1;
}
if (this._lookupKeys && this._lookupKeys.length) {
v5.lookup_keys = this._lookupKeys;
}
if (this._lookupRatings && this._lookupRatings.length) {
v5.lookup_ratings = this._lookupRatings;
}
if (this._fileConditions && this._fileConditions.length) {
v5.file_conditions = this._fileConditions;
}
if (this._keyConditions && this._keyConditions.length) {
v5.key_conditions = this._keyConditions;
}
if (this._ratingConditions && this._ratingConditions.length) {
v5.rating_conditions = this._ratingConditions;
}
if (this._sortFields && this._sortFields.length) {
v5.sort_conditions = this._sortFields;
}
this._connection.sendSimpleCommand('lookupSaveFiles', {'target': this, 'func': this.onQueryComplete}, {'publisher_id': this._connection.publisherId, 'group_id': this._group.__get__id(), 'query': v5});
};
v2.onQueryComplete = function (event) {
if (event.__get__success()) {
var v4 = event.__get__data();
this._files = [];
if (v4.files) {
var v2 = 0;
while (v2 < v4.files.length) {
var v3 = com.newgrounds.SaveFile.fromObject(this._group, v4.files[v2]);
if (v3) {
this._files.push(v3);
}
++v2;
}
}
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.QUERY_COMPLETE, this));
} else {
com.newgrounds.Logger.logError('Query failed: ' + event.__get__error());
this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.QUERY_COMPLETE, this, event.__get__error()));
}
};
v1.FILE_ID = 'fileId';
v1.AUTHOR_ID = 'authorId';
v1.AUTHOR_NAME = 'authorName';
v1.FILE_NAME = 'fileName';
v1.CREATED_ON = 'createdOn';
v1.UPDATED_ON = 'updatedOn';
v1.FILE_VIEWS = 'fileViews';
v1.FILE_STATUS = 'fileStatus';
v1.FILE_FIELDS = [com.newgrounds.SaveQuery.FILE_ID, com.newgrounds.SaveQuery.AUTHOR_ID, com.newgrounds.SaveQuery.AUTHOR_NAME, com.newgrounds.SaveQuery.FILE_NAME, com.newgrounds.SaveQuery.CREATED_ON, com.newgrounds.SaveQuery.UPDATED_ON, com.newgrounds.SaveQuery.FILE_VIEWS, com.newgrounds.SaveQuery.FILE_STATUS];
v1.OPERATOR_EQUAL = '=';
v1.OPERATOR_LESS_THAN = '<';
v1.OPERATOR_GREATER_THAN = '>';
v1.OPERATOR_NOT_EQUAL = '!=';
v1.OPERATOR_LESS_OR_EQUAL = '<=';
v1.OPERATOR_GREATER_OR_EQUAL = '>=';
v1.OPERATOR_CONTAINS = '*';
v1.OPERATOR_NOT_CONTAINS = '!*';
v1.OPERATOR_NOT_BEGINS_WITH = '!*=';
v1.OPERATOR_NOT_ENDS_WITH = '!=*';
v1.OPERATOR_BEGINS_WITH = '*=';
v1.OPERATOR_ENDS_WITH = '=*';
v1.TABLE_FILES = 1;
v1.TABLE_KEYS = 2;
v1.TABLE_RATINGS = 3;
v2._page = 1;
v2._resultsPerPage = 10;
v2._isRandomized = false;
v2.addProperty('files', v2.__get__files, function () {});
v2.addProperty('group', v2.__get__group, function () {});
v2.addProperty('isRandomized', v2.__get__isRandomized, v2.__set__isRandomized);
v2.addProperty('page', v2.__get__page, v2.__set__page);
v2.addProperty('resultsPerPage', v2.__get__resultsPerPage, v2.__set__resultsPerPage);
ASSetPropFlags(com.newgrounds.SaveQuery.prototype, null, 1);
}
#endinitclip
}
movieClip 2102 __Packages.PathBox {
#initclip
if (!_global.PathBox) {
var v1 = function () {
super();
this.active = true;
this.top = this._y;
this.left = this._x;
this.right = this._x + this._width;
this.bottom = this._y + this._height;
this.top_left = {'x': this.left, 'y': this.top};
this.top_right = {'x': this.right, 'y': this.top};
this.bottom_left = {'x': this.left, 'y': this.bottom};
this.bottom_right = {'x': this.right, 'y': this.bottom};
this.center = {'x': this.left + this._width / 2, 'y': this.top + this._height / 2};
this.connections = [];
this._visible = false;
};
_global.PathBox = v1;
_global.PathBox extends MovieClip;
var v2 = v1.prototype;
v2.removeMe = function () {
this.active = false;
};
v2.contains = function (point) {
if (!this.active) {
return false;
}
if (point.is_path) {
return point.right > this.left && point.left < this.right && point.top < this.bottom && point.bottom > this.top;
}
return point.x >= this.left && point.x <= this.right && point.y >= this.top && point.y <= this.bottom;
};
v2.inOrAbove = function (point) {
if (this.left <= point.x && this.right >= point.x && this.bottom >= point.y) {
if (this.top <= point.y) {
return true;
}
return this.top;
}
return false;
};
v2.linkTo = function (path, distance) {
if (this.connections[path._name] === undefined) {
if (!distance) {
distance = Math.sqrt(Math.pow(this.center.x - path.center.x, 2) + Math.pow(this.center.y - path.center.y, 2));
}
this.connections[path._name] = {'path': path, 'distance': distance};
path.linkTo(this, distance);
}
};
v2.getConnectRectangle = function (connection) {
var v8 = this.left > connection.left ? this.left : connection.left;
var v4 = this.right < connection.right ? this.right : connection.right;
var v6 = this.top > connection.top ? this.top : connection.top;
if (this.bottom >= connection.bottom) {
var v3 = connection.bottom;
var v5 = v4 - v8;
var v7 = v3 - v6;
var v10 = v8 + v5 / 2;
var v9 = v6 + v7 / 2;
return {'left': v8, 'right': v4, 'top': v6, 'bottom': v3, 'x': v10, 'y': v9, 'width': v5, 'height': v7};
}
var v3 = this.bottom;
var v5 = v4 - v8;
var v7 = v3 - v6;
var v10 = v8 + v5 / 2;
var v9 = v6 + v7 / 2;
return {'left': v8, 'right': v4, 'top': v6, 'bottom': v3, 'x': v10, 'y': v9, 'width': v5, 'height': v7};
};
v2.getConnectPoint = function (connection) {
var v2 = this.getConnectRectangle(connection);
var v3 = {'x': v2.x, 'y': v2.y};
return v3;
};
v2.findPath = function (path, previous, from, destination, map, mapped, distance) {
if (!this.active) {
return null;
}
var v2;
var v16 = distance === 0;
var v4 = {};
var v7 = [];
if (mapped !== null) {
for (v2 in mapped) {
v4[v2] = mapped[v2];
}
} else {
v4[this._name] = 1;
}
if (map !== null) {
v2 = 0;
while (v2 < map.length) {
v7[v2] = map[v2];
++v2;
}
}
if (this.contains(destination)) {
if (previous !== null) {
var v11 = this.getConnectRectangle(previous);
if (destination.x < v11.left || destination.x > v11.right || destination.y < v11.top || destination.y > v11.bottom) {
var v15 = {'x': v11.x, 'y': v11.y};
if (destination.x >= v11.left && destination.x <= v11.right) {
v15.x = destination.x;
}
if (destination.y >= v11.top && destination.y <= v11.bottom) {
v15.y = destination.y;
}
v7.push(v15);
}
}
if (this.is_trigger) {
v7.push(this.getTriggerPoint());
} else {
v7.push({'x': destination.x, 'y': destination.y});
}
return {'distance': distance, 'map': v7, 'final': path, 'destination': destination};
}
if (!v16) {
v7.push({'x': from.x, 'y': from.y});
}
var v6 = null;
var v5;
var v9 = null;
for (v2 in this.connections) {
if (v4[v2] != undefined || this.connections[v2].path.active !== true || this.connections[v2].path.is_path !== true) {
continue;
}
v4[v2] = 1;
var v3 = this.getConnectPoint(this.connections[v2].path);
v9 = distance + Math.sqrt(Math.pow(from.x - v3.x, 2), Math.pow(from.y - v3.y, 2));
v5 = this.connections[v2].path.findPath(path, this, v3, destination, v7, v4, v9);
if (!v5) {
continue;
}
if (!v6 || v5.distance < v6.distance) {
v6 = v5;
}
}
return v6;
};
v2.getTriggerPoint = function () {};
v2.is_path = true;
v2.is_warp = false;
v2.is_trigger = false;
v2.connections = [];
ASSetPropFlags(_global.PathBox.prototype, null, 1);
}
#endinitclip
}
movieClip 2103 __Packages.WarpArea {
#initclip
if (!_global.WarpArea) {
var v1 = function () {
super();
this.is_warp = true;
};
_global.WarpArea = v1;
_global.WarpArea extends PathBox;
var v2 = v1.prototype;
v2.is_warp = true;
v2.is_trigger = false;
v2.enterDir = null;
v2.gotoScene = null;
v2.gotoWarp = null;
ASSetPropFlags(_global.WarpArea.prototype, null, 1);
}
#endinitclip
}
movieClip 2104 __Packages.PlayerSprite {
#initclip
if (!_global.PlayerSprite) {
var v1 = function () {
super();
this.last_point = {'x': this._x, 'y': this._y};
this._dir = 1;
};
_global.PlayerSprite = v1;
_global.PlayerSprite extends MovieClip;
var v2 = v1.prototype;
v2.getSpeedVector = function () {
var v2 = Math.ceil(this.speed * (this._xscale / 100) * 100) / 100;
return {'x': this.vector.x * v2, 'y': this.vector.y * v2};
};
v2.setPath = function (path) {
this.path = path;
this.travelToNextPoint();
};
v2.travelToNextPoint = function () {
this.last_point = {'x': this._x, 'y': this._y};
if (this.path && this.path.length > 0) {
this.setAnimation('walk');
this.dest_point = this.path.shift();
var v2 = this.dest_point.x - this.last_point.x;
var v3 = this.dest_point.y - this.last_point.y;
this.vector = Utils.GetVector(v2, v3);
} else {
this.setAnimation('idle');
this.vector = {'x': 0, 'y': 0};
if (this.dest_point._trigger !== undefined) {
this.dest_point._trigger.onTriggered();
}
}
};
v2.setColor = function (color) {
if (!color) {
color = 'off';
}
this.gotoAndStop(color);
};
v2.setAnimation = function (frame) {
this.sprite.animations.gotoAndStop(frame);
};
v2.setDir = function (dir) {
this._dir = dir;
this.sprite.gotoAndStop((this._dir == 1) ? 'right' : 'left');
};
v2.stopWalking = function () {
this.setAnimation('idle');
this.path = [];
this.vector = {'x': 0, 'y': 0};
};
v2.onEnterFrame = function () {
var v2 = {'x': 0, 'y': 0};
if (this.vector.x || this.vector.y) {
var v4 = this.getSpeedVector();
var v3;
if (this.vector.x) {
v3 = this._x;
this._x += v4.x;
this.setDir(this.vector.x < 0 ? -1 : 1);
if (this.vector.x > 0 && this._x >= this.dest_point.x || this.vector.x < 0 && this._x <= this.dest_point.x) {
this._x = this.dest_point.x;
this.vector.x = 0;
}
v2.x = this._x - v3;
}
if (this.vector.y) {
v3 = this._y;
this._y += v4.y;
if (this.vector.y > 0 && this._y >= this.dest_point.y || this.vector.y < 0 && this._y <= this.dest_point.y) {
this._y = this.dest_point.y;
this.vector.y = 0;
}
GameScene.current.setScale(this);
v2.y = this._y - v3;
}
if (this.vector.x === 0 && this.vector.y === 0 || v2.x === 0 && v2.y === 0) {
this.travelToNextPoint();
}
} else {
if (this.path.length > 0) {
this.travelToNextPoint();
}
}
if (v2.x || v2.y) {
GameScene.current.updateCamera(v2);
}
};
v2.is_player = true;
v2.speed = 8;
v2._dir = 1;
v2.dest_point = null;
v2.last_point = null;
v2.path = [];
v2.vector = {'x': 0, 'y': 0};
ASSetPropFlags(_global.PlayerSprite.prototype, null, 1);
}
#endinitclip
}
movieClip 2105 __Packages.Utils {
#initclip
if (!_global.Utils) {
var v1 = function () {};
_global.Utils = v1;
var v2 = v1.prototype;
v1.formatDate = function (serverdate) {
var v1 = serverdate.split(' ');
var v3 = v1[1].split(':');
v1 = v1[0].split('-');
var v7 = [null, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
var v9 = v1[0];
var v6 = v7[Number(v1[1])];
var v5 = Number(v1[2]);
var v2 = Number(v3[0]);
var v8 = v3[1];
var v4 = 'am';
if (v2 > 12) {
v2 -= 12;
v4 = 'pm';
return v6 + ' ' + v5 + ' ' + v2 + ':' + v8 + v4;
}
if (v2 == 0) {
v2 = 12;
}
return v6 + ' ' + v5 + ' ' + v2 + ':' + v8 + v4;
};
v1.GetVector = function (xd, yd) {
var v1 = Utils.GetAngle(xd, yd);
return Utils.GetXY(v1);
};
v1.GetXY = function (angle, width) {
if (!width) {
width = 1;
}
angle = angle * -1 + 90;
if (angle < 0) {
angle += 360;
} else {
if (angle > 360) {
angle -= 360;
}
}
var v7 = angle * Math.PI / 180;
var v6 = 100000 * Math.sin(v7);
var v2 = v6;
if (v2 < 0) {
v2 *= -1;
}
var v4 = Math.sqrt(10000000000.0 - v2 * v2);
if (Math.round(angle) < 270 and Math.round(angle) >= 90) {
v4 *= -1;
}
var v3 = new flash.geom.Point();
v3.x = (Math.round(v6) / 100000) * width;
v3.y = (Math.round(v4) / 100000) * width;
return v3;
};
v1.GetAngle = function (i1, i2) {
var v9;
var v8;
if (typeof i1 == 'number' and typeof i2 == 'number') {
v9 = i1;
v8 = i2;
} else {
var v7;
var v5;
var v6;
var v4;
if (typeof i1 == 'movieclip') {
v7 = i1._x;
v6 = i1._y;
} else {
if (i1.x != undefined and i1.y != undefined) {
v7 = i1.x;
v6 = i1.y;
}
}
if (typeof i2 == 'movieclip') {
v5 = i2._x;
v4 = i2._y;
} else {
if (i2.x != undefined and i2.y != undefined) {
v5 = i2.x;
v4 = i2.y;
}
}
if (v7 != undefined and v5 != undefined) {
v9 = v5 - v7;
}
if (v6 != undefined and v4 != undefined) {
v8 = v4 - v6;
}
}
if (typeof v9 != 'number' or typeof v8 != 'number') {
trace('Error in call to Utils.GetAngle() :: Incompatable datatype in arguments.');
trace('Compatable types are Number, Point and MovieClip');
return null;
}
var v10 = Math.atan2(v8, v9);
var v1 = v10 * 180 / Math.PI;
while (v1 > 180) {
v1 -= 360;
}
while (v1 < -180) {
v1 += 360;
}
return v1;
};
v1.GetDist = function (i1, i2) {
var v4;
var v3;
if (typeof i1 == 'number' and typeof i2 == 'number') {
v4 = i1;
v3 = i2;
} else {
var v8;
var v6;
var v7;
var v5;
if (typeof i1 == 'movieclip') {
v8 = i1._x;
v7 = i1._y;
} else {
if (i1.x != undefined and i1.y != undefined) {
v8 = i1.x;
v7 = i1.y;
}
}
if (typeof i2 == 'movieclip') {
v6 = i2._x;
v5 = i2._y;
} else {
if (i2.x != undefined and i2.y != undefined) {
v6 = i2.x;
v5 = i2.y;
}
}
if (v8 != undefined and v6 != undefined) {
v4 = v6 - v8;
}
if (v7 != undefined and v5 != undefined) {
v3 = v5 - v7;
}
}
if (typeof v4 != 'number' or typeof v3 != 'number') {
trace('Error in call to Utils.GetDist() :: Incompatable datatype in arguments.');
trace('Compatable types are Number, Point and MovieClip');
return null;
}
return Math.sqrt(v4 * v4 + v3 * v3);
};
v1.CopyObject = function (obj) {
var v4 = typeof obj;
if (v4 == 'object') {
if (obj.length != undefined) {
v4 = 'array';
}
}
switch (v4) {
case 'array':
var v2 = new Array();
var v3 = 0;
while (v3 < obj.length) {
v2[v3] = Utils.CopyObject(obj[v3]);
++v3;
}
return v2;
break;
case 'object':
var v2 = new Object();
for (var v3 in obj) {
v2[v3] = Utils.CopyObject(obj[v3]);
}
return v2;
break;
default:
return obj;
}
};
v1.traceObject = function (obj, tab, label) {
if (tab === undefined) {
tab = '';
}
if (label === undefined) {
label = '';
}
if (typeof obj !== 'object') {
trace(tab + label + obj);
} else {
trace(tab + label + ' {');
var v2 = tab + ' ';
for (var v4 in obj) {
Utils.traceObject(obj[v4], v2, v4 + ': ');
}
trace(tab + '}');
}
};
ASSetPropFlags(_global.Utils.prototype, null, 1);
}
#endinitclip
}
movieClip 2106 __Packages.NPC {
#initclip
if (!_global.NPC) {
var v1 = function () {
super();
};
_global.NPC = v1;
_global.NPC extends MovieClip;
var v2 = v1.prototype;
v2.setTalking = function (is_talking) {
if (this.mouth !== undefined && this.mouth) {
this.mouth.gotoAndStop(is_talking ? 'talking' : 1);
}
};
ASSetPropFlags(_global.NPC.prototype, null, 1);
}
#endinitclip
}
movieClip 2107 __Packages.TriggerBox {
#initclip
if (!_global.TriggerBox) {
var v1 = function () {
super();
this.is_trigger = true;
this.trigger_point = null;
};
_global.TriggerBox = v1;
_global.TriggerBox extends PathBox;
var v2 = v1.prototype;
v2.getTriggerPoint = function () {
if (!this.trigger_point) {
this.trigger_point = {'_trigger': this, 'x': this.destination._x * (this._xscale / 100) + this._x, 'y': this.destination._y * (this._yscale / 100) + this._y};
this._parent.debug_x._x = this.trigger_point.x;
this._parent.debug_x._y = this.trigger_point.y;
}
return this.trigger_point;
};
v2.is_trigger = true;
v2.is_warp = false;
v2.enterDir = null;
v2.gotoScene = null;
v2.gotoWarp = null;
ASSetPropFlags(_global.TriggerBox.prototype, null, 1);
}
#endinitclip
}
movieClip 2108 __Packages.PointMarker {
#initclip
if (!_global.PointMarker) {
var v1 = function () {
super();
this._visible = false;
};
_global.PointMarker = v1;
_global.PointMarker extends MovieClip;
var v2 = v1.prototype;
v2.getPoint = function () {
var v5 = this._x;
var v4 = this._y;
var v3 = this._parent;
for (;;) {
if (!(v3 !== _root && v3 !== GameScene.current)) break;
v5 += v3._x;
v4 += v3._y;
v3 = v3._parent;
}
return {'x': v5, 'y': v4};
};
ASSetPropFlags(_global.PointMarker.prototype, null, 1);
}
#endinitclip
}
movieClip 2109 __Packages.HitBox {
#initclip
if (!_global.HitBox) {
var v1 = function () {
super();
this._visible = false;
};
_global.HitBox = v1;
_global.HitBox extends MovieClip;
var v2 = v1.prototype;
v2.contains = function (point) {
var v7 = this._x;
var v5 = this._x + this._width;
var v6 = this._y;
var v4 = this._y + this._height;
var v3 = this._parent;
for (;;) {
if (!(v3 !== _root && v3 !== GameScene.current)) break;
v7 += v3._x;
v5 += v3._x;
v6 += v3._y;
v4 += v3._y;
v3 = v3._parent;
}
return point.x >= v7 && point.x <= v5 && point.y >= v6 && point.y <= v4;
};
ASSetPropFlags(_global.HitBox.prototype, null, 1);
}
#endinitclip
}
movieClip 2110 __Packages.ItemPickup {
#initclip
if (!_global.ItemPickup) {
var v1 = function () {
super();
this.is_pickup = true;
};
_global.ItemPickup = v1;
_global.ItemPickup extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
if (this.item_name === undefined || !this.item_name) {
this.item_name = this._name;
}
if (Inventory.foundItem(this.item_name)) {
this.hide();
return undefined;
} else {
this.active = true;
}
this.walkbox = {'top': this._y, 'bottom': this._y, 'left': this._x, 'right': this._x};
this.clickbox = {'top': this._y, 'bottom': this._y, 'left': this._x, 'right': this._x};
if (this.walkpoint) {
this.walkbox.top += this.walkpoint._y;
this.walkbox.bottom += this.walkbox.top;
this.walkbox.left += this.walkpoint._x;
this.walkbox.right += this.walkbox.left;
this.walkpoint._visible = false;
} else {
if (this.walkarea) {
this.walkbox.top += this.walkarea._y;
this.walkbox.left += this.walkarea._x;
this.walkbox.bottom = this.walkbox.top + this.walkarea._height;
this.walkbox.right = this.walkbox.left + this.walkarea._width;
this.walkarea._visible = false;
}
}
this.clickbox.top += this.clickarea._y;
this.clickbox.left += this.clickarea._x;
this.clickbox.bottom = this.clickbox.top + this.clickarea._height;
this.clickbox.right = this.clickbox.left + this.clickarea._width;
this.clickarea._visible = false;
};
v2.show = function () {
this.active = true;
this._visible = true;
};
v2.hide = function () {
this.active = false;
this._visible = false;
};
v2.onTriggered = function () {
if (this.preTrigger !== undefined) {
this.preTrigger();
}
_root._AudioManager.playSound('pickup_item', 100);
GameState.setState('itempickedup-' + this.item_name, 1);
Inventory.current.addItem(this, 1);
this.hide();
};
v2.getWalktoPoint = function (from_point) {
var v2 = {'x': 0, 'y': 0};
var v4 = from_point.x;
var v3 = from_point.y;
if (v4 >= this.walkbox.left && v4 <= this.walkbox.right) {
v2.x = v4;
} else {
if (v4 > this.walkbox.left) {
v2.x = this.walkbox.right;
} else {
v2.x = this.walkbox.left;
}
}
if (v3 >= this.walkbox.top && v3 <= this.walkbox.bottom) {
v2.y = v3;
return v2;
}
if (v3 > this.walkbox.top) {
v2.y = this.walkbox.bottom;
return v2;
}
v2.y = this.walkbox.top;
return v2;
};
v2.wasClicked = function (destination_point) {
var v3 = destination_point.x;
var v2 = destination_point.y;
return v3 >= this.clickbox.left && v3 <= this.clickbox.right && v2 >= this.clickbox.top && v2 <= this.clickbox.bottom;
};
v2.getItemPoint = function () {
return {'x': this._x + this._parent._x, 'y': this._y + this._parent._y};
};
v2.is_pickup = true;
ASSetPropFlags(_global.ItemPickup.prototype, null, 1);
}
#endinitclip
}
movieClip 2111 __Packages.MainGame {
#initclip
if (!_global.MainGame) {
var v1 = function () {
super();
};
_global.MainGame = v1;
_global.MainGame extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.onMouseUp = function () {
if (Inventory.selected_item) {
GameScene.current.useSelectedItem();
}
};
};
ASSetPropFlags(_global.MainGame.prototype, null, 1);
}
#endinitclip
}
movieClip 2112 __Packages.AudioManager {
#initclip
if (!_global.AudioManager) {
var v1 = function () {
super();
this.muted = false;
this.target_scene = 0;
this.sfx_total = 5;
this.sfx_index = 1;
this.intro_playlist = ['lobby', 'trailer1', 'feature'];
this.setlist = ['notafinger', 'karate', 'tiptoe', 'tomas', 'ohmytoes', 'intermission'];
this.loop_segments = {};
this.special_segments = {'fakeset3': true};
this.monitored = [this.movie, this.projector, this.club_music, this.boss_music, this.title_music];
_root._AudioManager = this;
this.fadespeed = this.default_fadespeed;
this.played_special = {};
this.title_music.audio = new Sound(this.title_music);
this.club_music.audio = new Sound(this.club_music);
this.boss_music.audio = new Sound(this.boss_music);
this.movie.audio = new Sound(this.movie);
this.projector.audio = new Sound(this.projector);
this.sfx1.audio = new Sound(this.sfx1);
this.sfx2.audio = new Sound(this.sfx2);
this.sfx3.audio = new Sound(this.sfx3);
this.sfx4.audio = new Sound(this.sfx4);
this.sfx5.audio = new Sound(this.sfx5);
this.title_music.target_vol = 100;
this.title_music.vol = 100;
this.movie.target_vol = 0;
this.movie.vol = 0;
this.club_music.target_vol = 0;
this.club_music.vol = 0;
this.projector.target_vol = 0;
this.projector.vol = 0;
this.boss_music.target_vol = 0;
this.boss_music.vol = 0;
var v4;
v4 = 0;
while (v4 < this.all_sounds.length) {
this[this.all_sounds[v4]].vol = 100;
this[this.all_sounds[v4]].audio.setVolume(this.muted ? 0 : 100);
++v4;
}
v4 = 0;
while (v4 < this.monitored.length) {
this.monitored[v4].audio.setVolume(this.muted ? 0 : this.monitored[v4].vol);
++v4;
}
this.intro_index = 0;
this.setlist_index = 0;
this.movie_started = false;
this.current_set = -1;
this.set_part = 'intro';
};
_global.AudioManager = v1;
_global.AudioManager extends MovieClip;
var v2 = v1.prototype;
v2.setMuted = function (muted) {
this.muted = muted;
var v2;
v2 = 0;
while (v2 < this.all_sounds.length) {
if (muted) {
this[this.all_sounds[v2]].audio.setVolume(0);
} else {
this[this.all_sounds[v2]].audio.setVolume(this[this.all_sounds[v2]].vol);
}
++v2;
}
};
v2.setMovieVolume = function (movie_vol, projector_vol, club_vol, boss_vol, force) {
if (movie_vol === undefined) {
movie_vol = 0;
}
if (projector_vol === undefined) {
projector_vol = 0;
}
if (club_vol === undefined) {
club_vol = 0;
}
if (boss_vol === undefined) {
boss_vol = 0;
}
if (!this.movie_started || force === true) {
this.movie.audio.setVolume(this.muted ? 0 : movie_vol);
this.projector.audio.setVolume(this.muted ? 0 : projector_vol);
this.club_music.audio.setVolume(this.muted ? 0 : club_vol);
this.boss_music.audio.setVolume(this.muted ? 0 : boss_vol);
this.movie.vol = movie_vol;
this.projector.vol = projector_vol;
this.club_music.vol = club_vol;
this.boss_music.vol = boss_vol;
this.movie_started = true;
}
this.movie.target_vol = movie_vol;
this.projector.target_vol = projector_vol;
this.club_music.target_vol = club_vol;
this.boss_music.target_vol = boss_vol;
};
v2.startMovie = function (intro_index, setlist_index) {
if (intro_index !== undefined) {
this.intro_index = intro_index;
}
if (setlist_index !== undefined) {
this.intro_index = this.intro_playlist.length;
this.setlist_index = setlist_index;
}
this.title_music.target_vol = 0;
this.playProjector();
this.playMovieTrack();
this.playClub();
this.playBoss();
};
v2.updateVolume = function () {
var v3 = 0;
while (v3 < this.monitored.length) {
var v2 = this.monitored[v3];
if (v2.target_vol == v2.vol) {
} else {
if (v2.target_vol > v2.vol) {
v2.vol += this.fadespeed;
if (v2.vol >= 100) {
v2.vol = 100;
}
} else {
if (v2.target_vol < v2.vol) {
v2.vol -= this.fadespeed;
if (v2.vol <= 0) {
v2.vol = 0;
}
}
}
v2.audio.setVolume(this.muted ? 0 : Math.round(v2.vol));
}
++v3;
}
};
v2.playTitle = function () {
this.stopAll();
this.title_music.vol = 100;
this.title_music.target_vol = 100;
this.title_music.audio.setVolume(this.muted ? 0 : 100);
this.title_music.audio.stop();
this.title_music.audio.attachSound('title_song');
this.title_music.audio.start(0, 999);
this.title_music.audio.onSoundComplete = function () {
_root._AudioManager.playTitle();
};
};
v2.stopAll = function () {
var v2 = 0;
while (v2 < this.all_sounds.length) {
this[this.all_sounds[v2]].audio.stop();
++v2;
}
};
v2.playProjector = function () {
this.projector.audio.stop();
this.projector.audio.attachSound('projector');
this.projector.audio.start(0, 999);
this.projector.audio.onSoundComplete = function () {
_root._AudioManager.playProjector();
};
};
v2.playClub = function () {
this.club_music.audio.stop();
this.club_music.audio.attachSound('club_music');
this.club_music.audio.start(0, 999);
this.club_music.audio.onSoundComplete = function () {
_root._AudioManager.playClub();
};
};
v2.playEnd = function () {
this.movie.audio.stop();
this.movie.target_vol = 100;
this.movie.vol = 100;
this.movie.audio.setVolume(this.muted ? 0 : 100);
this.movie.audio.attachSound('end_music');
this.movie.audio.start(0, 999);
};
v2.playBoss = function () {
this.boss_music.audio.stop();
this.boss_music.audio.attachSound('boss_music');
this.boss_music.audio.start(0, 999);
this.boss_music.audio.onSoundComplete = function () {
_root._AudioManager.playBoss();
};
};
v2.playMovieTrack = function () {
if (this.intro_index < this.intro_playlist.length) {
return this.playIntroTrack();
}
this.playSetTrack();
};
v2.playIntroTrack = function () {
this.movie.audio.stop();
trace(this.intro_playlist[this.intro_index]);
this.movie.audio.attachSound(this.intro_playlist[this.intro_index]);
this.movie.audio.start(0, 1);
this.movie.audio.onSoundComplete = function () {
_root._AudioManager.playMovieTrack();
};
GameState.setState('intro-index', this.intro_index);
++this.intro_index;
if (this.audioUpdated !== undefined) {
if (this.audioUpdatedObject !== undefined) {
this.audioUpdated.call(this.audioUpdatedObject, this.intro_index, this.setlist_index);
}
}
};
v2.playSetTrack = function () {
if (this.set_part == 'loop' && this.current_set === this.setlist_index && this.target_scene > 0) {
--this.target_scene;
this.nextSet();
}
if (this.set_part == 'loop' && this.current_set !== this.setlist_index) {
this.set_part = 'outro';
}
this.movie.audio.stop();
if (this.set_part == 'intro') {
this.current_set = this.setlist_index;
GameState.setState('play-scenes', 1);
GameState.setState('current-set', this.current_set);
trace(this.setlist[this.current_set] + '_' + this.set_part);
this.movie.audio.attachSound(this.setlist[this.current_set] + '_' + this.set_part);
this.set_part = 'loop';
this.loop_segment = 0;
this.loop_repeat = 1;
} else {
if (this.set_part == 'loop') {
var v3 = 'loop';
if (this.movie.audio.getVolume() === 100 && this.special_segments[this.setlist[this.current_set]] !== undefined && this.played_special[this.setlist[this.current_set]] === undefined) {
this.played_special[this.setlist[this.current_set]] = true;
v3 = 'special';
this.loop_repeat = 1;
this.loop_segment = 0;
} else {
if (this.loop_segments[this.setlist[this.current_set]] !== undefined) {
v3 = this.loop_segments[this.setlist[this.current_set]][this.loop_segment].sound;
++this.loop_repeat;
if (this.loop_repeat > this.loop_segments[this.setlist[this.current_set]][this.loop_segment].repeat) {
this.loop_repeat = 1;
++this.loop_segment;
if (this.loop_segment >= this.loop_segments[this.setlist[this.current_set]].length) {
this.loop_segment = 0;
}
}
}
}
trace(this.setlist[this.current_set] + '_' + v3);
this.movie.audio.attachSound(this.setlist[this.current_set] + '_' + v3);
} else {
trace(this.setlist[this.current_set] + '_' + this.set_part);
this.movie.audio.attachSound(this.setlist[this.current_set] + '_' + this.set_part);
this.set_part = 'intro';
}
}
this.movie.audio.start();
this.movie.audio.onSoundComplete = function () {
_root._AudioManager.playSetTrack();
};
};
v2.nextScene = function () {
++this.target_scene;
};
v2.nextSet = function () {
if (this.intro_index < this.intro_playlist.length) {
this.intro_index = this.intro_playlist.length - 1;
return undefined;
}
++this.setlist_index;
if (this.setlist_index >= this.setlist.length) {
this.setlist_index = 0;
}
};
v2.playSound = function (sound, volume, callback, thisarg) {
if (volume === undefined) {
volume = 100;
}
sound = (((sound.split('\n')).join('')).split('\r')).join('');
var v2 = this.getSoundPlayer();
if (callback === undefined) {
thisarg = null;
callback = thisarg;
} else {
if (thisarg === undefined) {
thisarg = null;
}
}
v2.audio._callback = callback;
v2.audio._thisarg = thisarg;
v2.audio.stop();
v2.audio.setVolume(this.muted ? 0 : Math.round(volume));
v2.audio.attachSound(sound);
v2.audio.start();
v2.audio.onSoundComplete = function () {
if (this._callback && this._thisarg) {
this._callback.call(this._thisarg, this);
} else {
if (this._callback) {
this._callback(this);
}
}
this._callback = null;
this._thisarg = null;
};
return v2;
};
v2.getSoundPlayer = function () {
var v2 = this['sfx' + this.sfx_index];
++this.sfx_index;
if (this.sfx_index > this.sfx_total) {
this.sfx_index = 1;
}
return v2;
};
v2.onEnterFrame = function () {
this.updateVolume();
};
v2.sfx_total = 5;
v2.sfx_index = 1;
v2.all_sounds = ['title_music', 'club_music', 'boss_music', 'movie', 'projector', 'sfx1', 'sfx2', 'sfx3', 'sfx4', 'sfx5'];
v2.default_fadespeed = 2;
v2.target_scene = 0;
ASSetPropFlags(_global.AudioManager.prototype, null, 1);
}
#endinitclip
}
frame 2 {
this.gotoAndStop('title_screen');
}
movieClip 1936 {
}
movieClip 1940 {
}
movieClip 1965 {
}
movieClip 1966 {
frame 1 {
this.unlock = function (name) {
if (com.newgrounds.API.unlockMedal(name)) {
this.popup.gotoAndStop(name);
this.gotoAndPlay('unlock');
}
};
gotoAndStop('blank');
}
frame 2 {
_root._AudioManager.playSound('medal_get');
}
frame 76 {
_root._AudioManager.playSound('medal_got');
}
frame 91 {
stop();
}
}
movieClip 1968 {
}
movieClip 2042 _SG_AudioManager {
#initclip
Object.registerClass('_SG_AudioManager', AudioManager);
#endinitclip
frame 1 {
this._visible = false;
stop();
}
}
instance of movieClip 2042 _SG_AudioManager {
onClipEvent (unload) {
_root._AudioManager.stopAll();
}
}
frame 31 {
if (!GameState.hasSave()) {
continue_btn._y += 9999;
}
_root._AudioManager.setMuted(GameState.getState('muted', false));
_root._AudioManager.stopAll();
_root._AudioManager.playTitle();
stop();
}
movieClip 2049 {
}
button 2052 {
on (release) {
var pos = GameState.getState('saved_player_pos');
GameScene.continued = pos.s;
_root.gotoAndStop('main_game');
}
}
movieClip 2056 {
}
button 2059 {
on (release) {
GameScene.continued = false;
GameState.reset();
GameState.loadGame();
_root.gotoAndStop('main_game');
}
}
movieClip 2068 {
}
movieClip 2073 {
frame 1 {
if (GameState.getState('muted')) {
gotoAndStop('muted');
}
stop();
}
}
instance mutebtn of movieClip 2073 {
onClipEvent (rollOver) {
this._alpha = 100;
if (this.to) {
clearTimeout(this.to);
}
}
onClipEvent (releaseOutside, rollOut, dragOut) {
this._alpha = 30;
if (this.to) {
clearTimeout(this.to);
}
}
onClipEvent (release) {
var muted = GameState.getState('muted') ? false : true;
GameState.setState('muted', muted);
_root._AudioManager.setMuted(muted);
_root.mutebtn.gotoAndStop(muted ? 'muted' : 1);
setTimeout(function () {
_root.mutebtn._alpha = 30;
}, 1000);
}
onClipEvent (load) {
this._alpha = 30;
this.to = 0;
}
}
frame 36 {
stop();
}
movieClip 2074 {
}
instance fade of movieClip 2074 {
onClipEvent (load) {
GameScene.fadeDir = -4;
}
onClipEvent (enterFrame) {
if (GameScene.fadeDir) {
this._alpha += GameScene.fadeDir;
if (this._alpha <= 0) {
this._alpha = 0;
GameScene.fadeDir = 0;
GameScene.onFadeIn();
} else {
if (this._alpha >= 100) {
this._alpha = 100;
GameScene.fadeDir = 0;
GameScene.onFadeOut();
}
}
}
}
}