STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228060
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2560 · P5120

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/73054195?noj=FRM73054195-26DC" width="1" height="1"></div>

Cyber Chaser.swf

This is the info page for
Flash #215947

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS1/AS2]
Combined Code
movieClip 5 { } movieClip 6 bulletionobj { frame 1 { w = 30; h = 500; dam = 2; hitdie = false; xx = 400 + random(300); _x = 400; _y = 500; timer == 30; onEnterFrame = function () { if (_root.ispause == false) { if (timer) { --timer; } else { xx = 400 + random(300); timer = 30; } dist = xx - _x; if (dist != 0) { _x = _x + dist / 20; } _root.bulletHit(this); if (_root.powerion < 3) { if (_root.msec % 2 == 0) { _alpha = 10; } else { _alpha = 60; } if (_root.powerion == 0) { this.removeMovieClip(); } } else { _alpha = 100; } } }; } } movieClip 8 { } movieClip 13 { } movieClip 14 bulletxobj { frame 1 { w = 100; h = 120; dam = 2; hitdie = false; _x = _root.player._x; _y = _root.player._y; onEnterFrame = function () { if (_root.ispause == false) { _x = _root.player._x; _y = _root.player._y + _root.player.hspeed; _root.bulletHit(this); if (_root.powerdam < 3) { if (_root.msec % 2 == 0) { _alpha = 10; } else { _alpha = 60; } if (_root.powerdam == 0) { this.removeMovieClip(); } } else { _alpha = 100; } } }; } } movieClip 17 { } movieClip 18 powermagnetpart { frame 1 { _x = _root.player._x; _y = _root.player._y; onEnterFrame = function () { if (_root.ispause == false) { _x = _root.player._x; _y = _root.player._y + _root.player.hspeed; if (!_root.unlimmagnet) { if (_root.powermagnet < 3) { if (_root.msec % 2 == 0) { _alpha = 10; } else { _alpha = 60; } if (_root.powermagnet == 0) { this.removeMovieClip(); } } else { _alpha = 100; } } } }; } } movieClip 31 { } movieClip 44 { } movieClip 57 { } movieClip 70 { } movieClip 81 { } movieClip 94 { } movieClip 107 { } movieClip 120 { } movieClip 133 { } movieClip 146 { } movieClip 147 { frame 1 { stop(); } } movieClip 149 { } movieClip 150 { } movieClip 151 powerammopart { frame 1 { xx = _root.player.weapon._x; yy = _root.player.weapon._y; _x = _root.player._x + xx; _y = _root.player._y + yy; onEnterFrame = function () { if (_root.ispause == false) { if (img._currentframe != _root.player.weap + 1) { img.gotoAndStop(_root.player.weap + 1); } _x = _root.player._x + xx + _root.player.weapon.img._x; _y = _root.player._y + yy + _root.player.hspeed; if (!_root.doubledamage) { if (_root.powerammo < 3) { if (_root.msec % 2 == 0) { _alpha = 10; } else { _alpha = 60; } if (_root.powerammo == 0) { this.removeMovieClip(); } } else { _alpha = 100; } } } }; } } movieClip 170 smokepart2 { frame 1 { _xscale = choose(100, -100); _yscale = choose(100, -100); onEnterFrame = function () { _x = _x - 20; }; } frame 10 { this.removeMovieClip(); } } movieClip 171 smokepart { frame 1 { _xscale = choose(100, -100); _yscale = choose(100, -100); } frame 10 { this.removeMovieClip(); } } movieClip 181 playerdiepart { frame 1 { hspeed = 0; onEnterFrame = function () { if (_root.ispause == false) { _x = _x - _root.lvlspeed; if (_currentframe > 3) { ++hspeed; _y = _y + hspeed; _rotation = _rotation - 5; } if (_y > _root.lvlh + 50) { this.removeMovieClip(); } } }; } frame 6 { stop(); } } movieClip 183 { } movieClip 184 { frame 1 { stop(); } frame 2 { play(); } frame 40 { stop(); } } movieClip 201 { } movieClip 202 parapart { frame 1 { img.img.gotoAndPlay(2); hspeed = 0; onEnterFrame = function () { if (_root.ispause == false) { ++hspeed; _y = _y - hspeed; if (_y < -90) { this.removeMovieClip(); } } }; } } movieClip 204 { } movieClip 205 jumppart { frame 1 { onEnterFrame = function () { if (_root.ispause == false) { _x = _x - _root.lvlspeed; _y = _y + 1; } }; } frame 9 { this.removeMovieClip(); } } movieClip 211 dampart2 { frame 6 { this.removeMovieClip(); } } movieClip 217 dampart1 { frame 6 { this.removeMovieClip(); } } movieClip 229 { frame 1 { gotoAndStop(random(7) + 1); } } movieClip 230 contkeypart { frame 1 { gotoAndStop(type); hspeed = -10 - random(30); speed = -10 + random(20); rot = -20 + random(40); onEnterFrame = function () { _y = _y + hspeed; _x = _x + speed; ++hspeed; _rotation = _rotation + rot; if (_x < 0 || _x > _root.lvlw) { this.removeMovieClip(); } if (_y > _root.lvlh) { this.removeMovieClip(); } }; } } movieClip 233 { frame 1 { stop(); } } movieClip 234 contdoorpart { frame 1 { gotoAndStop(type); hspeed = -6 - random(6); speed = 15 + random(8); rot = choose(-1, 1); onEnterFrame = function () { _y = _y + hspeed; _x = _x + speed * rot; ++hspeed; if (speed > 0) { --speed; } _rotation = _rotation + rot; if (_x < 0 || _x > _root.lvlw) { this.removeMovieClip(); } if (_y > _root.lvlh) { this.removeMovieClip(); } }; } } movieClip 237 { frame 4 { stop(); } } movieClip 238 coinpart { frame 1 { gotoAndStop(type); hspeed = -10 - random(10); gravy = 2; rot = 20 - random(40); yspeed = random(10); dir = choose(1, -1); onEnterFrame = function () { _x = _x - (_root.lvlspeed + 5); if (yspeed > 0) { _y = _y + yspeed * dir; --yspeed; } hspeed += gravy; img._rotation += rot; if (_alpha > 0) { _yscale = _yscale - 5; _xscale = _yscale - 5; _alpha = _yscale - 5; } else { this.removeMovieClip(); } }; } } movieClip 243 clippart { frame 1 { gotoAndStop(type); dir = 60 + random(10); vspeed = 0; speed = 7 + random(3); rot = 20 + random(10); timer = speed * 4; _rotation = -30; onEnterFrame = function () { if (_root.ispause == false) { _rotation = _rotation + rot; _x = _x - lengthdir_x(speed, dir); _y = _y + (lengthdir_y(speed, dir) + vspeed); vspeed += 0.5; if (timer > 0) { --timer; if (timer < 10) { _alpha = _alpha - 10; } } else { this.removeMovieClip(); } } }; } } movieClip 268 boxhpart { frame 1 { gotoAndStop((type - 1) * 3 + random(3) + 1); hspeed = -8 - random(20); speed = 10 + random(40); rot = -30 + random(60); onEnterFrame = function () { if (_root.ispause == false) { _y = _y + hspeed; _x = _x - (_root.lvlspeed - speed); ++hspeed; if (speed > 0) { --speed; } _rotation = _rotation + rot; if (_x < 0) { this.removeMovieClip(); } if (_y > _root.lvlh) { this.removeMovieClip(); } } }; } } movieClip 270 { } movieClip 295 { } movieClip 296 bossdiepart { frame 1 { h = 10; timer = 120; x = _x; y = _y; xx = 500; yy = 250; speed = 10; onEnterFrame = function () { if (_root.ispause == false) { dir = point_direction(x, y, xx, yy); dist = point_distance(x, y, xx, yy); if (dist > speed) { spd = Math.min(speed, dist / 10); x += Math.round(lengthdir_x(spd, dir)); y -= Math.round(lengthdir_y(spd, dir)); } _x = x + 4 - random(9); _y = y + 4 - random(9); --timer; if (timer < 0) { y += timer; if (_y < -50) { this.removeMovieClip(); } } else { if (timer % 2 == 0) { _root.createCoin(this, 1, type, 1); } if (timer % 12 / type == 0) { _root.createCoin(this, 1, 4, 1); } } if (timer % 8 == 0) { playSound('explo11', 'explo12'); _root.quake = 6; _root.createPart(_x - 60 + random(120) + _root.lvlspeed * 4, _y - 40 + random(80), 'explopart', 1); } } }; } frame 7 { gotoAndPlay(2); } } movieClip 299 boss2diepart { frame 1 { hspeed = -8 - random(10); speed = 10 + random(20); rot = -5 + random(10); onEnterFrame = function () { if (_root.ispause == false) { _y = _y + hspeed; _x = _x - (_root.lvlspeed - speed); ++hspeed; if (speed > 0) { --speed; } _rotation = _rotation + rot; if (_x < 0) { this.removeMovieClip(); } if (_y > _root.lvlh) { this.removeMovieClip(); } } }; } } movieClip 324 { } movieClip 325 boss1part { frame 1 { onEnterFrame = function () { if (_root.ispause == false) { if (type.isBoss) { if (type.act > 1) { _visible = true; } else { _visible = false; } gotoAndPlay(type._currentframe); img.gotoAndPlay(type.img._currentframe - 10); _x = type._x - _root.lvlspeed; _y = type._y; } else { this.removeMovieClip(); } } }; } frame 2 { stop(); } frame 10 { gotoAndStop(2); } } movieClip 332 blockpart { frame 1 { gotoAndStop(_root.lvldiz); onEnterFrame = function () { if (_root.ispause == false) { _x = _x - _root.lvlspeed; if (_x < -180) { this.removeMovieClip(); } } }; } } movieClip 337 pikeobj { frame 1 { w = 60; h = 10; if (num == 1) { _x = _x + ((300 - w) / 2 + w); } z = _root.player; onEnterFrame = function () { if (_root.ispause == false) { _x = _x - _root.lvlspeed; if (z.dam == 0) { if (z._y > _y - h) { if (z._y - z.h < _y - h) { if (z._x > _x - w) { if (z._x - z.w < _x) { tutorok = true; _root.playerDamage(0, 1); } } } } } if (_x < 0) { this.removeMovieClip(); } if (_root.tutortask == 1) { if (tutorok != true) { if (_root.player._x - _root.player.w > _x + w) { _root.tutorInit(); tutorok = true; } } } } }; } frame 2 { w = 140; _x = _x + ((300 - w) / 2 + w); } frame 3 { w = 220; _x = _x + ((300 - w) / 2 + w); } } movieClip 340 { } movieClip 341 { } movieClip 343 { } movieClip 345 { frame 1 { stop(); } } movieClip 348 { } movieClip 349 { } movieClip 352 { } movieClip 355 { frame 1 { stop(); } } movieClip 356 Preloader { frame 1 { function enterFrameHandler() { var v2 = 0; v2 = _root.getBytesLoaded() / _root.getBytesTotal(); if (loadingBar) { loadingBar.gotoAndStop(int(v2 * (loadingBar._totalframes - 1)) + 1); } if (v2 >= 1 && haltComplete != true) { onEnterFrame = null; gotoAndStop('loaded'); } } stop(); var autoPlay; var className; var haltComplete; onEnterFrame = enterFrameHandler; } frame 10 { function _onPlayClick() { _root.nextFrame(); _root.play(); _parent._onLoaded(); } if (playButton) { playButton.onRelease = _onPlayClick; playButton.stop(); } if (autoPlay) { _onPlayClick(null); } } } movieClip 358 Newgrounds API Classes { #initclip Object.registerClass('Newgrounds API Classes', com.newgrounds.shims.APIShim); #endinitclip } movieClip 398 { } movieClip 401 { } movieClip 406 { } movieClip 410 { } movieClip 411 { } movieClip 412 { } movieClip 413 FlashAd { #initclip Object.registerClass('FlashAd', com.newgrounds.components.FlashAdBase); #endinitclip frame 1 { function initPlayButton() { if (this.playButton) { this.playButton.onRelease = onPlayClick; if (!this.showPlayButton) { this.playButton._visible = false; } } } function onPlayClick() { removeAd(); _visible = false; } stop(); } frame 2 { initPlayButton(); } frame 10 { initPlayButton(); } frame 20 { initPlayButton(); } } movieClip 414 APIConnector { frame 1 { function _onLoaded() { gotoAndStop('invisible'); if (_redirect) { com.newgrounds.API.loadOfficialVersion(); return undefined; } } function _apiConnect() { var v2 = com.newgrounds.API; if (v2 && !v2.connected) { if (!apiId) { com.newgrounds.Logger.logError('No API ID entered in the API Connector component.', 'You can create an API ID for this submission at http://newgrounds.com/account/flashapi', 'Enter your API ID into the API Connector using the Component Inspector (Window -> Component Inspector).'); return undefined; } switch (debugMode) { case 'Off': default: v2.debugMode = v2.RELEASE_MODE; goto 1319; case 'Simulate Logged-in User': //Invalid switch } v2.debugMode = v2.DEBUG_MODE_LOGGED_IN; goto 1319; case 'Off': v2.debugMode = v2.DEBUG_MODE_LOGGED_OUT; goto 1319; case 'Simulate Logged-in User': v2.debugMode = v2.DEBUG_MODE_NEW_VERSION; goto 1319; case 'Simulate Logged-out User': v2.debugMode = v2.DEBUG_MODE_HOST_BLOCKED; label 1319: if (loader) { loader.haltComplete = true; } v2.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, _onConnected); v2.connect(_root, apiId, encryptionKey, movieVersion); } } function _onConnected(event) { if (loader) { loader.haltComplete = false; } if (redirectOnNewVersion && event.__get__success() && (event.__get__data()).newVersion) { _redirect = true; } if (redirectOnHostBlocked && !event.__get__success() && event.__get__error() == com.newgrounds.APIEvent.ERROR_HOST_BLOCKED) { _redirect = true; } if (_redirect) { gotoAndStop('adPreloader'); forceAlwaysOnTop(); } } function forceAlwaysOnTop() { var v2 = getNextHighestDepth(); swapDepths(v2); if (Stage) { _x = (Stage.width - _width) / 2; _y = (Stage.height - _height) / 2; _visible = true; } if (_root && _root instanceof MovieClip) { (MovieClip(_root)).stop(); } } stop(); if (_root && _root instanceof MovieClip) { (MovieClip(_root)).stop(); } var apiId; var encryptionKey; var movieVersion; var debugMode; var connectorType; var redirectOnHostBlocked; var redirectOnNewVersion; var adType; var className; var _redirect; _x = int(_x); _y = int(_y); if (!debugMode) { debugMode = 'Simulate Logged-in User'; } if (!connectorType) { connectorType = 'Flash Ad + Preloader'; } if (!adType) { adType = 'Video'; } if (ad) { ad.adType = adType; } switch (connectorType) { case 'Flash Ad + Preloader': gotoAndStop('adPreloader'); break; case 'Flash Ad Only': gotoAndStop('ad'); break; case 'Invisible': gotoAndStop('invisible'); } _apiConnect(); } instance ad of movieClip 413 FlashAd { onClipEvent (construct) { apiId = ''; showBorder = true; adType = 'Video'; } } instance loader of movieClip 356 Preloader { onClipEvent (construct) { autoPlay = false; mainClass = ''; } } } movieClip 419 { } movieClip 420 ebullet7obj { frame 1 { w = 10; h = 70; _y = _y + 60; _x = _x + 45; life = 40; hitdie = false; speed = 20; if (num == 0) { dir = -1; } else { dir = 1; } _xscale = 100 * dir; onEnterFrame = function () { if (_root.ispause == false) { _x = _x - (_root.lvlspeed + speed * dir); if (speed > 5) { --speed; } --life; if (life < 10) { _alpha = life * 10; _yscale = 50 + life * 5; } else { _root.ebulletHit(this); } if (life < 1) { this.removeMovieClip(); } } }; } } movieClip 422 { } movieClip 423 ebullet6obj { frame 1 { w = 16; h = 16; speed = 8; hspeed = num - 1; hitdie = true; onEnterFrame = function () { if (_root.ispause == false) { if (speed < 20) { ++speed; } _x = _x - speed; _y = _y + hspeed; _root.ebulletHit(this); if (_x < 0) { this.removeMovieClip(); } } }; } } movieClip 428 { } movieClip 429 ebullet5obj { frame 1 { w = 18; h = 18; speed = 8; hspeed = num - 1; hitdie = true; onEnterFrame = function () { if (_root.ispause == false) { if (speed < 20) { ++speed; } _x = _x - speed; _y = _y + hspeed; _root.ebulletHit(this); if (_x < 0) { this.removeMovieClip(); } } }; } } movieClip 432 { } movieClip 434 { } movieClip 437 { } movieClip 438 { } movieClip 439 ebullet4obj { frame 1 { w = 550; h = 6; _yscale = 10; fx._visible = false; hitdie = false; switch (num.isBoss) { case 2: life = 20; yy = 21; timer = 12; break; case 3: life = 40; yy = 105; timer = 25; break; default: life = 20; yy = 65; timer = 12; } _y = num._y - yy; onEnterFrame = function () { if (_root.ispause == false) { if (num.isBoss == 3) { _x = num._x - 180; } else { _x = _x - _root.lvlspeed; } _y = num._y - yy; if (timer > 0) { --timer; if (timer == 0) { playSound('weap71', 'weap72'); } } else { fx._visible = true; _yscale = 100; _root.ebulletHit(this); } --life; if (life < 4) { _alpha = life * 30; if (life < 1) { this.removeMovieClip(); } } if (num._x == undefined) { this.removeMovieClip(); } } }; } } movieClip 440 ebullet3obj { frame 1 { w = 10; h = 70; _y = _y + 55; _root.quake += 4; life = 30; hitdie = false; if (num == 0) { speed = -10; _xscale = -100; } else { speed = 10; _xscale = 100; } onEnterFrame = function () { if (_root.ispause == false) { _x = _x - (_root.lvlspeed + speed); _root.ebulletHit(this); --life; if (life < 5) { _alpha = life * 20; } if (life < 1) { this.removeMovieClip(); } } }; } } movieClip 444 { } movieClip 445 ebullet2obj { frame 1 { w = 20; h = 10; speed = 20; hitdie = true; timer = num * 2; _visible = false; onEnterFrame = function () { if (_root.ispause == false) { if (_visible == false) { if (timer > 0) { --timer; } else { _visible = true; } } else { _x = _x - speed; _root.ebulletHit(this); if (_x < 0) { this.removeMovieClip(); } } } }; } } movieClip 446 ebullet1obj { frame 1 { w = 18; h = 10; speed = 18; hitdie = true; timer = num * 2; _visible = false; onEnterFrame = function () { if (_root.ispause == false) { if (_visible == false) { if (timer > 0) { --timer; } else { _visible = true; } } else { _x = _x - speed; _root.ebulletHit(this); if (_x < 0) { this.removeMovieClip(); } } } }; } } movieClip 450 { } movieClip 453 { } movieClip 454 bullet9obj { frame 1 { gotoAndStop(random(4) + 1); life = 5; dam = 5 + _root.teslaupgr; if (_root.doubledamage || _root.powerammo) { dam *= 2; } range = 450 + _root.teslaupgr * 100; hitdie = false; target = _root.findTarget(this); _x = _x - 10; _y = _root.player._y - 45 + _root.player.hspeed; if (target._x != undefined) { img._width = point_distance(_x, _y, target._x - target.w / 2, target._y - target.h / 2); _rotation = point_direction(_x, _y, target._x - target.w / 2, target._y - target.h / 2); } else { img._width = range; _rotation = 0; } onEnterFrame = function () { if (_root.ispause == false) { _y = _root.player._y - 45 + _root.player.hspeed; dist = point_distance(_x, _y, target._x - target.w / 2, target._y - target.h / 2); if (target._x == undefined || dist > range) { target = _root.findTarget(this); img._width = range; _rotation = 0; } else { playSoundLim('enemyd1', 'enemyd2', 'enemyd3'); _rotation = point_direction(_x, _y, target._x - target.w / 2, target._y - target.h / 2); img._width = dist; target.life -= dam; if (target.life < 1) { if (target.isEnemy) { if (!target.isBoss) { _root.createDie(target); _root.createPrize(target, 'enemy', 1); _root.dieEnemy(target); } } else { if (target.isWall) { _root.createDie(target); _root.dieEnemy(target); } else { _root.createPrize(target, 'cargo', 1); _root.dieCargo(target); } } } else { target.gotoAndPlay(3); } } --life; if (life < 1) { this.removeMovieClip(); } } }; } } movieClip 473 { } movieClip 474 { } movieClip 475 bullet8obj { frame 1 { w = 8; h = 8; dir = 5 - random(10); speed = 3 + _root.rocketupgr * 10; maxspeed = 20 + _root.rocketupgr * 10; life = 45; dam = 15; if (_root.doubledamage || _root.powerammo) { dam *= 2; } hitdie = true; dampart = 2; target = _root.findTarget(this); timer = 3; onEnterFrame = function () { if (_root.ispause == false) { if (_root.rocketupgr) { _root.createPart(_x - 13, _y - 5, 'smokepart', 1); } else { if (timer > 0) { --timer; } else { _root.createPart(_x - 13, _y - 5, 'smokepart', 1); timer = 1; } } if (speed < maxspeed) { ++speed; } if (target._x != undefined) { dir = point_direction(_x, _y, target._x - target.w / 2, target._y - target.h / 2); } else { target = _root.findTarget(this); dir = 5 - random(10); } img._rotation = dir; _x = _x + lengthdir_x(speed, dir); _y = _y - lengthdir_y(speed, dir); _root.bulletHit(this); --life; if (life < 1) { _root.createPart(_x, _y, 'dampart' + dampart, 1); this.removeMovieClip(); } if (_x > _root.lvlw + 5) { this.removeMovieClip(); } } }; } } movieClip 476 bullet7obj { frame 1 { w = _root.lvlw - _root.player._x; h = 10; life = 3; dam = 2 + _root.laserupgr; if (_root.doubledamage || _root.powerammo) { dam *= 2; } hitdie = false; switch (_root.laserupgr) { case 0: yy = 37; gotoAndStop(1); break; case 1: yy = 32; gotoAndStop(2); break; case 2: yy = 27; gotoAndStop(3); } _x = _root.lvlw; _y = _root.player._y - yy + _root.player.hspeed; onEnterFrame = function () { if (_root.ispause == false) { _y = _root.player._y - yy + _root.player.hspeed; _root.bulletHit(this); --life; if (life < 1) { this.removeMovieClip(); } } }; } frame 2 { h = 25; } frame 3 { h = 40; } } movieClip 480 { } movieClip 481 { } movieClip 482 bullet6obj { frame 1 { w = 50; h = 50; _xscale = 30; _yscale = 30; speed = 15 + random(8) + _root.flameupgr / 2; hspeed = (5 - random(10)) / 5; life = 50 + _root.flameupgr; dam = 10; if (_root.doubledamage || _root.powerammo) { dam *= 2; } hitdie = true; dampart = 2; onEnterFrame = function () { if (_root.ispause == false) { _x = _x + speed; _y = _y + hspeed; if (speed > 3) { --speed; } if (_xscale < 100) { _xscale = _xscale + 5; _yscale = _yscale + 5; } --life; if (life < 5) { _alpha = life * 20; } else { _root.bulletHit(this); } if (life < 1) { this.removeMovieClip(); } if (_x > _root.lvlw + 5) { this.removeMovieClip(); } } }; } } movieClip 484 { } movieClip 485 bullet5obj { frame 1 { w = 20; h = 8; speed = 20; dir = num; _rotation = dir; dam = 5; if (_root.doubledamage || _root.powerammo) { dam *= 2; } dampart = 1; hitdie = true; if (_root.spreadupgr > 0) { if (random(10) < _root.spreadupgr) { dam *= 2; dampart = 2; } } onEnterFrame = function () { if (_root.ispause == false) { _x = _x + lengthdir_x(speed, dir); _y = _y + lengthdir_y(speed, dir); _root.bulletHit(this); if (_x > _root.lvlw + 10) { this.removeMovieClip(); } } }; } } movieClip 488 bullet4obj { frame 1 { w = 8; h = 8; speed = 35; hspeed = (10 - random(20)) / 5; life = 17; dam = 6; if (_root.doubledamage || _root.powerammo) { dam *= 2; } dampart = 1; hitdie = true; if (num == 'heli') { _rotation = 12; hspeed += 8; _y = _y + 15; } onEnterFrame = function () { if (_root.ispause == false) { _x = _x + speed; _y = _y + hspeed; _root.bulletHit(this); --life; if (life < 1) { this.removeMovieClip(); } if (_x > _root.lvlw + 5) { this.removeMovieClip(); } } }; } } movieClip 491 { } movieClip 492 bullet3obj { frame 1 { w = 8; h = 8; speed = 20; dir = 10 * (num + 1) - 19; life = 16 + _root.pulseupgr; dam = 7; if (_root.doubledamage || _root.powerammo) { dam *= 2; } hitdie = true; dampart = 1; onEnterFrame = function () { if (_root.ispause == false) { _x = _x + lengthdir_x(speed, dir); _y = _y + lengthdir_y(speed, dir); _root.bulletHit(this); --life; if (life < 1) { _root.createPart(_x, _y, 'dampart' + dampart, 1); this.removeMovieClip(); } if (_x > _root.lvlw + 5) { this.removeMovieClip(); } } }; } } movieClip 495 bullet2obj { frame 1 { w = 8; h = 8; speed = 25; hspeed = (5 - random(10)) / 5; life = 12 + random(5); dam = 5; if (_root.doubledamage || _root.powerammo) { dam *= 2; } hitdie = true; dampart = 1; onEnterFrame = function () { if (_root.ispause == false) { if (_visible == false) { if (timer > 0) { --timer; } else { _visible = true; } } else { _x = _x + speed; _y = _y + hspeed; _root.bulletHit(this); --life; if (life < 1) { _root.createPart(_x, _y, 'dampart' + dampart, 1); this.removeMovieClip(); } if (_x > _root.lvlw + 5) { this.removeMovieClip(); } } } }; } } movieClip 498 bullet1obj { frame 1 { w = 8; h = 8; speed = 25 + random(5); dir = 8 * (num + 1) - 20; life = 8 + random(3); dam = 4; if (_root.doubledamage || _root.powerammo) { dam *= 2; } hitdie = true; dampart = 1; _rotation = -dir; onEnterFrame = function () { if (_root.ispause == false) { _x = _x + lengthdir_x(speed, dir); _y = _y + lengthdir_y(speed, dir); _root.bulletHit(this); --life; if (life < 1) { _root.createPart(_x, _y, 'dampart' + dampart, 1); this.removeMovieClip(); } if (_x > _root.lvlw + 5) { this.removeMovieClip(); } } }; } } movieClip 501 bullet0obj { frame 1 { w = 8; h = 8; speed = 16; hspeed = (3 - random(6)) / 5; life = 12 - num + _root.pistolupgr; dam = 4; if (_root.doubledamage || _root.powerammo) { dam *= 2; } hitdie = true; dampart = 1; timer = num * 2; _y = _y + num * 10 - 10; _visible = false; onEnterFrame = function () { if (_root.ispause == false) { if (_visible == false) { if (timer > 0) { --timer; } else { _visible = true; } } else { _x = _x + speed; _y = _y + hspeed; _root.bulletHit(this); --life; if (life < 1) { _root.createPart(_x, _y, 'dampart' + dampart, 1); this.removeMovieClip(); } if (_x > _root.lvlw + 5) { this.removeMovieClip(); } } } }; } } frame 1 { function goTo1() { getURL(sponsorurl, '_blank'); } function goTo2() { getURL(devurl, '_blank'); } function __com_mochibot__(swfid, mc, lv, trk) { var x; var g; var s; var fv; var sb; var u; var res; var mb; var mbc; var pv; mb = '__mochibot__'; mbc = 'mochibot.com'; g = _global ? _global : _level0._root; if (g[mb + swfid]) { return g[mb + swfid]; } s = System.security; x = mc._root.getSWFVersion; fv = x ? mc.getSWFVersion() : (_global ? 6 : 5); if (!s) { s = {}; } sb = s.sandboxType; if (sb == 'localWithFile') { return null; } x = s.allowDomain; if (x) { s.allowDomain(mbc); } x = s.allowInsecureDomain; if (x) { s.allowInsecureDomain(mbc); } pv = (fv == 5) ? /:$version : System.capabilities.version; u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : ''); lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv); g[mb + 'level'] = lv; if (fv == 5) { res = '_level' + lv; if (!eval(res)) { loadMovieNum(u, lv); } return res; } res = mc.createEmptyMovieClip(mb + swfid, lv); res.loadMovie(u); return res; } _global.sponsorurl = 'http://www.notdoppler.com/?ref=cyberchaser'; _global.devurl = 'http://www.silengames.com'; noads = false; urlStart = _url.indexOf('://') + 3; urlEnd = _url.indexOf('/', urlStart); domain = _url.substring(urlStart, urlEnd); LastDot = domain.lastIndexOf('.') - 1; domEnd = domain.lastIndexOf('.', LastDot) + 1; domain = domain.substring(domEnd, domain.length); if (domain == 'notdoppler.com' || domain == 'box10.com' || domain == 'flashgames247.com' || domain == 'gamezhero.com' || domain == 'kongregate.com' || domain == 'yepi.com' || domain == 'bgames.com' || domain == 'flashgamelicense.com') { noads = true; } if (domain == 'kongregate.com') { kongapi = true; var kongregate = _global.kongregate; kongregate.services.connect(); } kongsend = function (kng1, kng2) { trace(kng1 + '=' + kng2); if (kongapi == true) { kongregate.stats.submit(kng1, kng2); } }; ngsend = function () {}; ngmedal = function () { if (ngapi == true) { switch (plrlvl) { if (plrlvl !== 40) { } else { case 3: case 6: case 10: case 14: case 18: case 22: case 26: case 30: case 35: API.unlockMedal('Level ' + plrlvl); } } } }; var newMenu = new ContextMenu(); newMenu.hideBuiltInItems(); newMenu.customItems.push(new ContextMenuItem('Play More Games', goTo1)); newMenu.customItems.push(new ContextMenuItem('Developer Site', goTo2, true)); this.menu = newMenu; __com_mochibot__('fb57ab72', this, 10301, true); } // unknown tag 88 length 76 movieClip 367 __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 360 __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 359 __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 361 __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 364 __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 370 __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 366 __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 362 __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 381 __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 undefined; } var v1 = com.newgrounds.API._medals[medalName]; if (!v1) { com.newgrounds.Logger.logError('No medal named "' + medalName + '" w.'); return undefined; } 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, tag) { if (period == undefined) { period = 'All-Time'; } if (firstResult == undefined) { firstResult = 1; } if (numResults == undefined) { numResults = 10; } 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); 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()) { 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 378 __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 379 __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); } 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()) { 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 377 __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 375 __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 376 __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 = Number(value); if (isNaN(v2)) { com.newgrounds.Logger.logError('Invalid value for rating "' + this._name + '".'); 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 371 __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 380 __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 372 __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]; this._iconLoader = new com.newgrounds.BitmapLoader(com.newgrounds.Medal.DEFAULT_ICON, iconURL); this._iconLoader.load(); }; 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 undefined; } 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)); }; 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.DEFAULT_ICON = flash.display.BitmapData.loadBitmap('DefaultMedalIcon'); 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 374 __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__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 () { this._connection.sendSimpleCommand('loadScores', {'target': this, 'func': this.onScoresLoaded}, {'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}); }; 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('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 363 __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 382 __Packages.com.newgrounds.components.FlashAdBase { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.components) { _global.com.newgrounds.components = new Object(); } if (!_global.com.newgrounds.components.FlashAdBase) { var v1 = function () { super(); try { System.security.allowDomain('server.cpmstar.com'); System.security.allowInsecureDomain('server.cpmstar.com'); } this.gotoAndStop('idle'); this._x = int(this._x); this._y = int(this._y); this.stop(); if (this.__get___newgroundsButton()) { (this.__get___newgroundsButton()).onRelease = this.onNGClick; } this.onUnload = this.removeAd; var v4 = this; this._adListener = {'onLoadError': function (target, error, httpStatus) { target._parent.onAdError(target, error, httpStatus); }}; if (this.__get__fullScreen()) { this.drawFullScreenRect(); } if (com.newgrounds.API.__get__adFeedURL()) { this.loadAdFeed(); } else { com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, {'target': this, 'func': this.loadAdFeed}); } }; com.newgrounds.components.FlashAdBase = v1; com.newgrounds.components.FlashAdBase extends MovieClip; var v2 = v1.prototype; v2.__get___adContainer = function () { return this.adContainer; }; v2.__get___newgroundsButton = function () { return this.newgroundsButton; }; v2.__get__fullScreen = function () { return this._fullScreen; }; v2.__set__fullScreen = function (v) { this._fullScreen = v; if (v) { this.drawFullScreenRect(); } else { this.clear(); } return this.__get__fullScreen(); }; v2.__get__showBorder = function () { return this._showBorder; }; v2.__set__showBorder = function (value) { this._showBorder = value; if (this._showBorder) { if (this._ad) { var v2 = this._ad.getProgress(this.__get___adContainer()); if (v2.bytesLoaded >= v2.bytesTotal) { this.gotoAndStop('loaded'); } else { this.gotoAndStop('loading'); } } else { this.gotoAndStop('idle'); } } else { this.gotoAndStop('noBorder'); } return this.__get__showBorder(); }; v2.loadAdFeed = function (event) { if (event == undefined) { event = null; } this._adFeedLoader = new LoadVars(); var target = this; this._adFeedLoader.onData = function (data) { target.onAdFeedLoaded(data); }; this._adFeedLoader.load(com.newgrounds.API.__get__adFeedURL(), this._adFeedLoader); }; v2.onAdFeedLoaded = function (data) { if (data && data != '') { this.loadAd(data); } else { this.onAdError(); } }; v2.loadAd = function (adURL) { if (this.adType != this.VIDEO_ADS) { if (adURL.indexOf('?') >= 0) { adURL += '&'; } else { adURL += '?'; } adURL += 'blockoverlays=1'; } this._ad = new MovieClipLoader(); this._ad.addListener(this._adListener); (this.__get___adContainer())._lockroot = true; this._ad.loadClip(adURL, this.__get___adContainer()); }; v2.removeAd = function () { this._adFeedLoader.onData = null; this._adFeedLoader = null; this._ad.removeListener(this._adListener); if (this.__get___adContainer()) { this._ad.unloadClip(this.__get___adContainer()); } this._ad = null; }; v2.onAdError = function (target, error, httpStatus) { com.newgrounds.Logger.logError('Unable to load ad.'); this.removeAd(); }; v2.onNGClick = function () { com.newgrounds.API.loadNewgrounds(); }; v2.drawFullScreenRect = function () { this._x = (Stage.width - this._width) / 2; this._y = (Stage.height - this._height) / 2; this.beginFill(0); this.moveTo(-Stage.width, -Stage.height); this.lineTo(Stage.width, -Stage.height); this.lineTo(Stage.width, Stage.height); this.lineTo(-Stage.width, Stage.height); this.lineTo(-Stage.width, -Stage.height); this.endFill(); }; v2._showBorder = true; v2.adType = com.newgrounds.components.FlashAdBase.prototype.VIDEO_ADS; v2.VIDEO_ADS = 'Video'; v2.SIMPLE_ADS = 'Simple'; v2.addProperty('_adContainer', v2.__get___adContainer, function () {}); v2.addProperty('_newgroundsButton', v2.__get___newgroundsButton, function () {}); v2.addProperty('fullScreen', v2.__get__fullScreen, v2.__set__fullScreen); v2.addProperty('showBorder', v2.__get__showBorder, v2.__set__showBorder); ASSetPropFlags(com.newgrounds.components.FlashAdBase.prototype, null, 1); } #endinitclip } movieClip 357 __Packages.com.newgrounds.shims.APIShim { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.shims) { _global.com.newgrounds.shims = new Object(); } if (!_global.com.newgrounds.shims.APIShim) { var v1 = function () { super(); }; com.newgrounds.shims.APIShim = v1; com.newgrounds.shims.APIShim extends MovieClip; var v2 = v1.prototype; ASSetPropFlags(com.newgrounds.shims.APIShim.prototype, null, 1); } #endinitclip } movieClip 365 __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 368 __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 369 __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 373 __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__score = 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('score', v2.__get__score, function () {}); v2.addProperty('tag', v2.__get__tag, function () {}); v2.addProperty('username', v2.__get__username, function () {}); ASSetPropFlags(com.newgrounds.Score.prototype, null, 1); } #endinitclip } frame 2 { stop(); adBack.swapDepths(_root.getNextHighestDepth()); adBox.swapDepths(_root.getNextHighestDepth()); var CPMStarContentSpotID = '9394Q4FA5161E'; System.security.allowDomain('server.cpmstar.com'); if (noads) { removeMovieClip(adBox); adBox.removeMovieClip(); adBack.removeMovieClip(); gameLogo._xscale = 120; gameLogo._yscale = 120; gameLogo._y = 200; } else { adBox.loadMovie('http://server.cpmstar.com/adviewas2.swf?contentspotid=' + CPMStarContentSpotID); } percent = 0; butload.title = 'START GAME'; butload._visible = false; percentDone = 0; butload.but.onRelease = function () { onEnterFrame = null; removeMovieClip(adBox); adBox.removeMovieClip(); adBack.removeMovieClip(); gotoAndStop(3); }; onEnterFrame = function () { totalBytes = _root.getBytesTotal(); loadedBytes = _root.getBytesLoaded(); var v2 = Math.floor((loadedBytes / totalBytes) * 100); if (percent < v2) { percent += 1; loadtxt.text = percent + '%'; meter.img._xscale = percent; } if (percent >= 100) { if (butload._visible == false) { butload._visible = true; butload._alpha = 0; } else { if (butload._alpha < 100) { butload._alpha += 10; loadtxt._alpha -= 10; loadtxt2._alpha -= 10; meter._alpha -= 10; } } } }; } movieClip 535 { } movieClip 538 { } movieClip 541 { } movieClip 546 { } movieClip 548 { } movieClip 550 { } movieClip 555 { } movieClip 556 { frame 1 { stop(); } } movieClip 560 { } movieClip 563 { } movieClip 564 { frame 1 { stop(); timer = 30 + random(30); onEnterFrame = function () { if (timer) { --timer; } else { gotoAndPlay(2); onEnterFrame = null; } }; } } button 566 { on (rollOver) { playSound('over'); gotoAndPlay('on'); } on (dragOver) { playSound('over'); gotoAndPlay('on'); } on (rollOut) { gotoAndPlay('off'); } on (dragOut) { gotoAndPlay('off'); } on (press) { playSound('click'); gotoAndPlay('on'); } } movieClip 569 { } movieClip 572 { } movieClip 573 { } movieClip 575 { } movieClip 577 { frame 1 { stop(); } frame 7 { stop(); } frame 13 { gotoAndStop(1); } } movieClip 580 { } movieClip 583 { } movieClip 585 { } button 587 { on (release) { getURL(sponsorurl, '_blank'); } } movieClip 589 { } frame 3 { stop(); } movieClip 595 { frame 6 { stop(); } } button 596 { on (release) { getURL(sponsorurl, '_blank'); } } // unknown tag 88 length 68 movieClip 606 { } movieClip 609 { frame 190 { stop(); _root.gotoAndStop(4); } } frame 4 { stop(); } movieClip 611 { } movieClip 613 { } movieClip 615 { } movieClip 617 { } movieClip 619 { } movieClip 620 { instance of movieClip 611 { onClipEvent (release) { getURL(devurl, '_blank'); } } frame 86 { _root.gotoAndStop(5); } } instance of movieClip 620 { onClipEvent (release) { getURL(devurl, '_blank'); } } frame 5 { gotoAndStop(6); } movieClip 627 { frame 1 { gotoAndStop(random(3) + 1); } } movieClip 628 { frame 1 { gotoAndStop(_root.lvldizcol); } } movieClip 630 { frame 1 { if (random(10) > _root.lvlwind) { _visible = false; } } } movieClip 637 { frame 1 { gotoAndStop(random(3) + 1); } } movieClip 638 { frame 1 { gotoAndStop(_root.lvldizcol); } } movieClip 640 { frame 1 { if (random(10) > _root.lvlwind) { _visible = false; } } } movieClip 647 { frame 1 { gotoAndStop(random(3) + 1); } } movieClip 648 { frame 1 { gotoAndStop(_root.lvldizcol); } } movieClip 649 { frame 1 { gotoAndStop(_root.lvldiz); } } movieClip 656 { frame 1 { gotoAndStop(random(3) + 1); } } movieClip 657 { frame 1 { gotoAndStop(_root.lvldizcol); } } movieClip 664 { frame 1 { gotoAndStop(random(3) + 1); } } movieClip 665 { frame 1 { gotoAndStop(_root.lvldizcol); } } movieClip 672 { frame 1 { gotoAndStop(random(3) + 1); } } movieClip 673 { frame 1 { gotoAndStop(_root.lvldizcol); } } movieClip 674 { frame 1 { gotoAndStop(_root.lvldiz); } } movieClip 681 { frame 1 { gotoAndStop(random(3) + 1); } } movieClip 682 { frame 1 { gotoAndStop(_root.lvldizcol); } } movieClip 689 { frame 1 { gotoAndStop(random(3) + 1); } } movieClip 690 { frame 1 { gotoAndStop(_root.lvldizcol); } } movieClip 697 { frame 1 { gotoAndStop(random(3) + 1); } } movieClip 698 { frame 1 { gotoAndStop(_root.lvldizcol); } } movieClip 699 { frame 1 { gotoAndStop(_root.lvldiz); } } movieClip 701 { } movieClip 706 { } movieClip 707 { frame 1 { } } movieClip 710 { } movieClip 711 { frame 1 { } } movieClip 712 { frame 1 { gotoAndStop(_root.lvldiz); } } movieClip 713 blockobj { frame 1 { stop(); h = _root.lvlh - _y; slideunder = 0; onEnterFrame = function () { if (_root.ispause == false) { _x = _x - _root.lvlspeed; if (_x < -w - 40) { _root.dieBlock(this); } if (_currentframe == 4) { if (_root.player._y > _y + h) { switch (slideunder) { case 0: if (_root.player._x > _x) { if (_root.player._x < _x + w) { slideunder = 1; trace('slide start'); } } break; case 1: if (_root.player._x - _root.player.w > _x + w) { slideunder = 2; trace('slide finish'); _root.addStat(32, 1); if (_root.tutortask == 3) { _root.tutorInit(); } } } } else { if (slideunder == 1) { slideunder = 2; } } } } }; } frame 4 { _y = _y - 210; h = 150; _root.createPart(_x, _y, 'blockpart', 1); } } movieClip 714 { frame 1 { stop(); } } movieClip 715 boss1obj { frame 1 { _root.enemyBank.push(this); leg1 = _root.levelmap.attachMovie('boss2part', 'part', 0); leg1.boss = this; leg1.xstep = -50; leg1.ystep = -50; leg1.xmove = 200; leg1.gotoAndStop(1); leg2 = _root.levelmap.attachMovie('boss2part', 'part', 1); leg2.boss = this; leg2.xstep = 150; leg2.ystep = -50; leg2.xmove = 50; leg2.gotoAndStop(2); leg3 = _root.levelmap2.attachMovie('boss2part', 'part', _root.levelmap2.getNextHighestDepth()); leg3.boss = this; leg3.xstep = -50; leg3.ystep = 50; leg3.xmove = 0; leg3.gotoAndStop(3); leg4 = _root.levelmap2.attachMovie('boss2part', 'part', _root.levelmap2.getNextHighestDepth()); leg4.boss = this; leg4.xstep = 150; leg4.ystep = 50; leg4.xmove = 150; leg4.gotoAndStop(4); w = 70; h = 95; hh = 35; xx = 500; yy = 200; _x = -250; _y = 200; isEnemy = true; isBoss = 1; damx = 3; maxlife = _root.bosslife[isBoss]; life = maxlife; act = 0; _visible = true; timer = random(60) + 60; delay = 0; attack = 3; shell = 5 - damx; onEnterFrame = function () { if (_root.ispause == false) { if (life > 0) { if (life < (maxlife / 4) * damx) { playSound('explo31', 'explo32'); playSound('bossdie'); _root.createPrize(this, 'boss', 2); _root.createPart(_x - w / 2, _y - h / 2, 'explopart', 1, 'boss'); if (_root.minigame != 6) { ++_root.maxlvlspeed; } --damx; } } else { playSound('bossdie'); _root.flashobj.gotoAndPlay(2); _root.setStat(21, 1); _root.addStat(17, 1); _root.createPart(_x - 30, _y - 45, 'bossdiepart', 1, 1); _root.dieEnemy(this); } switch (act) { case 0: if (Math.abs(distx) < 30) { act = 1; } break; case 1: z = _root.blockBank[_root.blockBank.length - 2]; if (z.type != 4) { yy = z._y; } if (attack) { if (timer > 0) { --timer; } else { if (delay) { --delay; } else { --shell; delay = 2; playSound('weap31', 'weap32'); _root.createEbullet(this, 1, 1); if (shell == 0) { shell = 5 - damx; xx = random(300) + 300; timer = random(60) + 60; --attack; } } } } else { attack = 3; act = 2; xx = 500; } break; case 2: z = _root.blockBank[_root.blockBank.length - 1]; if (z.type != 4) { yy = z._y; } if (Math.abs(distx) < 30) { act = 3; xx = -250; } break; case 3: z = _root.blockBank[_root.blockBank.length - 3]; if (z.type != 4) { yy = z._y; } if (_x < xx) { act = 0; _y = 200; xx = 500; yy = 200; } } if (act != 3) { distx = xx - _x; _x = _x + Math.round(distx / 40); disty = yy - _y - hh; _y = _y + Math.round(disty / 20); } else { _x = _x - _root.lvlspeed; } } }; } frame 2 { stop(); } frame 3 { play(); } frame 10 { gotoAndStop(2); } } movieClip 718 { } movieClip 761 { frame 1 { stop(); } frame 23 { gotoAndPlay(11); } } movieClip 762 boss2obj { frame 1 { _root.enemyBank.push(this); _root.createPart(_x, _y, 'boss1part', 1, this); w = 80; h = 70; hh = 40; xx = 750; yy = -hh; _x = xx; _y = yy; isEnemy = true; isBoss = 2; damx = 3; maxlife = _root.bosslife[isBoss]; life = maxlife; hspeed = 30; act = 0; _visible = false; timer = 0; shell = 5 - damx; onEnterFrame = function () { if (_root.ispause == false) { if (life > 0) { if (life < (maxlife / 4) * damx) { playSound('explo31', 'explo32'); playSound('bossdie'); _root.createPrize(this, 'boss', 1); _root.createPart(_x - w / 2, _y - h / 2, 'explopart', 1, 'big'); if (_root.minigame != 6) { ++_root.maxlvlspeed; } --damx; } } else { playSound('bossdie'); _root.flashobj.gotoAndPlay(2); _root.setStat(22, 1); _root.addStat(17, 1); _root.createPart(_x - 70, _y - 5, 'boss2diepart', 1); _root.createPart(_x - 30, _y - 45, 'bossdiepart', 1, 2); _root.createPart(_x - 28, _y + 10, 'boss2diepart', 1); _root.dieEnemy(this); } switch (act) { case 0: z = _root.blockBank[_root.blockBank.length - 1]; if (z.type == 3 || z.type == 2 && z.create == undefined) { if (z._x > 600) { act = 1; _visible = true; img.gotoAndStop(1); } } break; case 1: _x = z._x + w; if (z._y > _y + hh) { _y = _y + hspeed; } else { playSound('enemyland'); _y = z._y - hh; act = 2; img.gotoAndPlay(2); _root.quake += 6; _root.createPart(_x - 50, _y + hh, 'dustpart', 1, 'drop'); if (damx == 0) { i = 2; while (i--) { _root.createEbullet(this, 7, i); } } _root.createEbullet(this, 4, this); } break; case 2: _x = _x - _root.lvlspeed; if (_x < 0) { act = 0; _visible = false; _x = xx; _y = yy; } } } }; } frame 2 { stop(); } frame 3 { play(); } frame 10 { gotoAndStop(2); } } movieClip 795 { } movieClip 828 { } movieClip 861 { } movieClip 862 { frame 2 { _parent.life = 10; } frame 3 { _parent.life = 15; } frame 4 { _parent.life = 20; } } movieClip 863 cargoobj { frame 1 { w = 80; h = 70; if (fly == true) { act = 0; y = _y; _y = -h; hspeed = 0; } else { drop = false; speed = 25; hspeed = -5; para._visible = false; img.img.gotoAndStop(1); } life = 5; onEnterFrame = function () { if (_root.ispause == false) { if (fly == true) { _x = _x - Math.round(_root.lvlspeed / 3); if (act == 0) { dist = y - _y; if (dist > 2) { _y = _y + dist / 5; } else { _y = y; act = 1; } } else { if (_x < 100) { hspeed += 3; _y = _y - hspeed; } if (_y < 0) { _root.dieCargo(this); } } } else { _x = _x - _root.lvlspeed; if (drop == true) { --speed; ++hspeed; _x = _x + speed; _y = _y + hspeed; _rotation = _rotation + 2; } if (_x < 0 || _y > _root.lvlh + h) { _root.setChall(2, false); _root.dieCargo(this); } } } }; } frame 2 { stop(); } frame 3 { play(); } frame 9 { gotoAndStop(2); } } movieClip 894 { } movieClip 925 { } movieClip 956 { } movieClip 987 { } movieClip 1020 { } movieClip 1021 coinobj { frame 1 { w = 30; h = 40; dir = -random(60); gravy = 2; speed = 15 + random(10); back = false; maxhspeed = 20; hspeed = -(maxhspeed + random(maxhspeed)); take = false; notake = 8 + random(6); img.gotoAndPlay(random(img._totalframes) + 1); if (type == 'win') { hspeed = -5; notake = 25; } if (_root.unlimmagnet || _root.powermagnet) { magnet = 1000; notake = 5 + random(15); } else { magnet = _root.magnet; } collFoot = function () { if (maxhspeed <= 0) { maxhspeed = 0; } else { maxhspeed -= 5; } hspeed = -maxhspeed; _y = z._y; }; onEnterFrame = function () { if (_root.ispause == false) { dist = point_distance(_x, _y, _root.player._x, _root.player._y); if (take == false) { hspeed += gravy; if (notake > 0) { --notake; } if (speed > 0) { speed -= 0.5; } if (back) { _x = _x + (-speed - _root.lvlspeed); } else { _x = _x + (speed - _root.lvlspeed); } _y = _y + hspeed; i = 0; while (i < _root.blockBank.length) { z = _root.blockBank[i]; if (_y - 10 >= z._y) { if (_y - h < z._y + z.h) { if (_x > z._x) { if (_x - w < z._x + z.w) { back = true; } } } } if (hspeed >= 0) { if (_y + hspeed >= z._y) { if (_y - h < z._y + z.h) { if (_x > z._x) { if (_x - w < z._x + z.w) { collFoot(); break; } } } } } ++i; } if (_x < 0) { this.removeMovieClip(); } if (_x > _root.lvlw + 150) { this.removeMovieClip(); } if (_y > _root.lvlh + h) { this.removeMovieClip(); } if (notake == 0) { if (_root.player._visible) { if (dist < magnet) { switch (_currentframe) { case 1: if (_root.doubleincome) { _root.coins += 2; _root.addStat(3, 2); } else { ++_root.coins; _root.addStat(3, 1); } break; case 2: if (_root.doubleincome) { _root.coins += 4; _root.addStat(3, 4); } else { _root.coins += 2; _root.addStat(3, 2); } break; case 3: if (_root.doubleincome) { _root.coins += 10; _root.addStat(3, 10); } else { _root.coins += 5; _root.addStat(3, 5); } break; case 4: _root.coins2 += 1; _root.addStat(30, 1); _root.addStat(37, 1); break; case 5: _root.fuel += 1; _root.addStat(31, 1); } take = true; } } } } else { if (dist > 50) { dir = point_direction(_x, _y, _root.player._x, _root.player._y); _x = _x + lengthdir_x(dist / 5, dir); _y = _y - lengthdir_y(dist / 5, dir); } else { playSoundLim('coin1', 'coin2', 'coin3'); _root.createPart(_x - w / 2, _y - h / 2, 'coinpart', 1, _currentframe); this.removeMovieClip(); } } } }; } frame 2 { w = 40; h = 50; } frame 3 { w = 50; h = 60; } frame 4 { w = 50; h = 48; } frame 5 { w = 48; h = 48; } } movieClip 1023 { } movieClip 1064 { } movieClip 1085 { } movieClip 1106 { } movieClip 1108 { } movieClip 1153 { } movieClip 1200 { } movieClip 1201 { } movieClip 1250 { } movieClip 1291 { } movieClip 1292 { frame 5 { _parent.w = 80; _parent.h = 110; _parent.prew = _parent.w; } frame 6 { _parent.w = 80; _parent.h = 110; _parent.prew = _parent.w; } } movieClip 1294 { } movieClip 1295 { } movieClip 1296 enemyobj { frame 1 { w = 50; h = 80; y = _y; prew = w; die = false; fire = false; life = _root.enemylife[img._currentframe]; act = 0; wait = 0; imgind = 1; huntdist = _root.hunt[img._currentframe][4] * _root.maxlvlspeed; if (img._currentframe == 3 || img._currentframe == 4) { isfly = true; dist = 0; flytimer = 10; flyy = random(600); img.shad._visible = false; } onEnterFrame = function () { if (_root.ispause == false) { _x = _x - _root.lvlspeed; if (!_root.poweremp) { if (isfly) { _x = _x + Math.round(_root.lvlspeed / 2); if (act == 0) { if (flytimer > 0) { --flytimer; } else { flytimer = 20 + random(20); flyy = 150 + random(250); } } else { flytimer = 2; flyy = _root.player._y; } dist = flyy - _y; if (dist != 0) { _y = _y + dist / 10; } } ++imgind; if (imgind == _root.hunt[img._currentframe][act]) { switch (act) { case 0: if (fire == false & _x < huntdist) { ++act; fire = true; } else { imgind = 1; } break; case 1: ++act; if (img._currentframe == 1 || img._currentframe == 3 || img._currentframe == 5) { playSound('enemyatt'); } break; case 2: ++act; switch (img._currentframe) { case 1: case 3: w = 100; break; case 2: _root.createEbullet(this, 4, this); break; case 4: playSound('weap31', 'weap32'); i = 2; while (i--) { _root.createEbullet(this, 2, i); } break; case 5: w = 140; break; case 6: playSound('enemyland'); i = 2; while (i--) { _root.createEbullet(this, 3, i); } break; case 7: i = 3; while (i--) { _root.createEbullet(this, 5, i); } } break; case 3: act = 0; imgind = 1; w = prew; } } } else { if (_root.poweremp == 1) { if (_currentframe == 11) { gotoAndPlay(3); } } else { gotoAndStop(11); } } img.img.gotoAndStop(imgind); if (_x < 0) { _root.setChall(1, false); _root.dieEnemy(this); } } }; } frame 2 { stop(); } frame 3 { play(); } frame 10 { gotoAndStop(2); } frame 11 { stop(); } } movieClip 1328 { } movieClip 1360 { } movieClip 1392 { } movieClip 1424 { } movieClip 1456 { } movieClip 1488 { } movieClip 1520 { } movieClip 1552 { } movieClip 1584 { } movieClip 1616 { } movieClip 1617 { frame 1 { stop(); } } movieClip 1618 { frame 1 { stop(); } } movieClip 1641 { } movieClip 1660 { } movieClip 1683 { } movieClip 1706 { } movieClip 1729 { } movieClip 1731 { } movieClip 1754 { } movieClip 1755 { frame 1 { stop(); } } movieClip 1757 { } movieClip 1758 weapprizeobj { frame 1 { w = 50; h = 60; act = 0; y = _y; _y = -h; hspeed = 0; if (_root.minigame == 3) { kind = 3; } if (kind == 1) { img.gotoAndStop(type); img.weap.gotoAndStop(type + 1); } onEnterFrame = function () { if (_root.ispause == false) { _x = _x - Math.round(_root.lvlspeed / 3); if (act == 0) { dist = y - _y; if (dist > 2) { _y = _y + dist / 5; } else { _y = y; act = 1; } } else { if (_x < 100) { hspeed += 3; _y = _y - hspeed; } if (_y < 0) { _root.setChall(3, false); this.removeMovieClip(); } } if (_root.player._visible) { if (_y > _root.player._y - _root.player.h) { if (_y - h < _root.player._y) { if (_x > _root.player._x - _root.player.w) { if (_x - w < _root.player._x) { _root.createPart(_x - 70, _y - 137, 'parapart', 1); switch (kind) { case 1: playSound('pickup'); _root.addStat(4, 1); _root.player.weap = type; if (_root.unlimammo) { trace('UNLIM AMMO'); _root.ammo = -1; } else { trace('NO UNLIM ' + _root.maxammo); _root.ammo = _root.maxammo; _root.player.ammopip._visible = true; } _root.player.weapon.img.gotoAndStop(type + 1); _root.player.weapon.gotoAndPlay('take'); break; case 2: _root.addStat(5, 1); switch (img._currentframe - 1) { case 0: playSound('powheal'); _root.life = Math.min(_root.maxlife, _root.life + _root.heartamount); break; case 1: playSound('powemp'); if (_root.powerempobj._currentframe == 1) { _root.powerempobj.gotoAndPlay(2); } break; case 2: playSound('powmagnet'); if (_root.powermagnet == 0) { _root.createPart(_root.player._x, _root.player._y, 'powermagnetpart', 1); } _root.powermagnet = _root.powermagnettime; break; case 3: playSound('pickup'); if (_root.powerheliobj._currentframe == 1) { _root.powerheliobj.gotoAndStop(2); } _root.powerheli = _root.powerhelitime; break; case 4: playSound('powunlim'); if (_root.powerammo == 0) { _root.createPart(_root.player._x, _root.player._y, 'powerammopart', 1); } _root.powerammo = _root.powerammotime; break; case 5: playSound('powion'); if (_root.powerion == 0) { _root.createBullet(_root.player, 'ion'); } _root.powerion = _root.poweriontime; break; case 6: playSound('powshield'); if (_root.powerdam == 0) { _root.createBullet(_root.player, 'x'); } _root.powerdam = _root.powerdamtime; break; case 7: playSound('pickup'); if (_root.powerplaneobj._currentframe == 1) { _root.powerplaneobj.gotoAndStop(2); } _root.powerplane = _root.powerplanetime; } break; case 3: playSound('star1', 'star2'); ++_root.coins; _root.addStat(3, 1); _root.createPart(_x - w / 2, _y - h / 2, 'coinpart', 1, 6); } _root.createPart(_x - w / 2, _y - h / 2, 'coinpart', 1, 5); this.removeMovieClip(); } } } } } } }; gotoAndStop(kind); } frame 2 { if (_root.unlimmagnet) { if (type == 3) { type = 1; } } if (_root.doubledamage) { if (type == 5) { type = 1; } } img.gotoAndStop(type); } } movieClip 1762 { } movieClip 1763 { } movieClip 1770 boss2part { frame 1 { _x = -150; act = 0; ymove = 0; if (_currentframe % 2 == 0) { diedir = -1; } else { diedir = 1; } dietimer = 50; onEnterFrame = function () { if (_root.ispause == false) { if (boss._x) { if (boss.act != 3) { if (act == 0) { if (xmove < 200) { xmove += _root.lvlspeed; } else { act = 1; } } else { if (xmove > 0) { xmove -= _root.lvlspeed; if (xmove >= 100) { ymove = 200 - xmove; } else { ymove = xmove; } } else { act = 0; } } _x = boss._x + xstep - xmove; _y = boss._y + ystep - ymove; dir = point_direction(_x, _y, boss._x, boss._y - 25); dist = point_distance(_x, _y, boss._x, boss._y - 25); img._rotation = dir; img._xscale = dist; img.gotoAndStop(Math.round((dist - 40) / 5)); } else { _x = boss._x + xstep - xmove - _root.lvlspeed; } } else { _x = _x - _root.lvlspeed; _y = _y + 8; if (dietimer > 0) { --dietimer; _rotation = _rotation + diedir; } if (_y > _root.lvlh + 50) { this.removeMovieClip(); } } } }; } } movieClip 1773 boss3diepart { frame 1 { if (type == 1) { _xscale = -100; speed = 5 + random(10); } else { speed = -5; } hspeed = -6 - random(4); rot = -2 + random(5); onEnterFrame = function () { if (_root.ispause == false) { _y = _y + hspeed; _x = _x - (_root.lvlspeed - speed); ++hspeed; if (speed > 0) { --speed; } _rotation = _rotation + rot; if (_x < 0) { this.removeMovieClip(); } if (_y > _root.lvlh) { this.removeMovieClip(); } } }; } } movieClip 1794 { } movieClip 1811 { } movieClip 1836 { } movieClip 1837 { frame 1 { stop(); } } movieClip 1838 die1part { frame 1 { gotoAndStop(type); num = random(3) + 1; img.gotoAndStop(num); dir = random(2) + 1; hspeed = -random(15); speed = random(15) + 10; onEnterFrame = function () { if (_root.ispause == false) { ++hspeed; --speed; _x = _x + speed; _y = _y + hspeed; if (num != 3) { _rotation = _rotation + dir; } if (_y > _root.lvlh + 50) { this.removeMovieClip(); } } }; stop(); } } movieClip 1863 { } movieClip 1864 boss3obj { frame 1 { _root.enemyBank.push(this); w = 170; h = 150; xx = 750; yy = 350; _x = -200; _y = 0; isEnemy = true; isBoss = 3; damx = 3; maxlife = _root.bosslife[isBoss]; life = maxlife; _visible = false; act = 0; setact = 0; timer = 60; speed = 10; onEnterFrame = function () { if (_root.ispause == false) { if (life > 0) { if (life < (maxlife / 4) * damx) { playSound('explo31', 'explo32'); playSound('bossdie'); _root.createPrize(this, 'boss', 3); _root.createPart(_x - w / 2, _y - h / 2, 'explopart', 1, 'boss'); if (_root.minigame != 6) { ++_root.maxlvlspeed; } --damx; } } else { playSound('bossdie'); _root.flashobj.gotoAndPlay(2); _root.setStat(23, 1); _root.addStat(17, 1); _root.createPart(_x - 90, _y - 70, 'boss3diepart', 1, 1); _root.createPart(_x - 100, _y - 70, 'boss3diepart', 1, 2); _root.createPart(_x - 100, _y - 100, 'bossdiepart', 1, 3); _root.dieEnemy(this); } settimer = 30 + damx * 10; speed = 18 - damx * 3; if (timer > 0) { --timer; } switch (act) { case 0: if (timer < 1) { _visible = true; timer = settimer; act = 1; setact = choose(2, 3, 4); if (setact == 2) { _x = 300; _y = 650; xx = 750; yy = 200; delay = 15; } if (setact == 3) { _x = 300; _y = -50; xx = 750; yy = 450; delay = 25; } if (setact == 4) { _x = 0; _y = 0; xx = 750; yy = 325; delay = 0; attack = 3; shell = 3; } } break; case 1: if (timer < 1) { act = setact; timer = settimer; } break; case 2: if (timer > 0) { yy = _root.player._y; } else { if (delay > 0) { --delay; xx = 850; } else { xx = -800; if (_x < -50) { act = 0; _visible = false; timer = settimer; } } } break; case 3: if (delay > 0) { if (delay == 25) { playSound('weap71', 'weap72'); _root.createEbullet(this, 4, this); } --delay; } else { yy = -500; if (_y < 0) { act = 0; _visible = false; timer = settimer; } } break; case 4: if (attack) { if (delay) { --delay; } else { --shell; delay = 2; playSound('weap31', 'weap32'); _root.createEbullet(this, 1, 1); if (shell == 0) { shell = 3; xx = random(350) + 400; yy = random(250) + 200; --attack; delay = settimer / 2; } } } else { yy = 1200; if (_y > 650) { act = 0; _visible = false; timer = settimer; } } } dir = point_direction(_x, _y, xx, yy); dist = point_distance(_x, _y, xx, yy); if (dist > speed) { spd = Math.max(speed, dist / 40); _x = _x + Math.round(lengthdir_x(spd, dir)); _y = _y - Math.round(lengthdir_y(spd, dir)); } } }; } frame 2 { stop(); } frame 3 { play(); } frame 10 { gotoAndStop(2); } } movieClip 1897 { } movieClip 1930 { } movieClip 1931 starobj { frame 1 { stop(); if (_root.minigame == 3) { gotoAndStop(2); } w = 50; h = 50; onEnterFrame = function () { if (_root.ispause == false) { _x = _x - _root.lvlspeed; if (_y > _root.player._y - _root.player.h) { if (_y - h < _root.player._y) { if (_x > _root.player._x - _root.player.w) { if (_x - w < _root.player._x) { switch (_currentframe) { case 1: playSound('key'); ++_root.stars; _root.addStat(14, 1); break; case 2: playSoundLim('coin1', 'coin2', 'coin3'); _root.coins += 5; _root.addStat(3, 5); break; case 3: playSoundLim('star1', 'star2'); } _root.createPart(_x - w / 2, _y - h / 2, 'coinpart', 1, 6); this.removeMovieClip(); } } } } if (_x < 0) { _root.setChall(3, false); this.removeMovieClip(); } } }; } } movieClip 1933 { } movieClip 1940 { frame 1 { stop(); _parent.w = 35; _parent.h = 130; } frame 2 { _parent.w = 40; _parent.h = 140; } frame 3 { _parent.w = 45; _parent.h = 150; } } movieClip 1941 wallobj { frame 1 { w = 35; h = 130; life = 20; onEnterFrame = function () { if (_root.ispause == false) { _x = _x - _root.lvlspeed; if (_x < 0) { _root.dieEnemy(this); } if (_root.tutortask == 2) { if (tutorok != true) { if (_root.player._x - _root.player.w > _x + w) { _root.tutorInit(); tutorok = true; } } } } }; } frame 2 { stop(); } frame 3 { play(); } frame 9 { gotoAndStop(2); } } movieClip 1960 dustpart { frame 1 { if (type == 'wall') { _rotation = 90; _yscale = 150; _xscale = 150; } if (type == 'drop') { _yscale = 150; _xscale = 150; } onEnterFrame = function () { if (_root.ispause == false) { _x = _x - _root.lvlspeed; } }; } frame 10 { this.removeMovieClip(); } } movieClip 1994 explopart { frame 1 { if (type == 'wall') { _rotation = 90; _root.quake += 2; } if (type == 'small') { _rotation = 90; _root.quake += 4; } if (type == 'big') { _yscale = 150; _xscale = 150; _rotation = 90; _root.quake += 6; } if (type == 'boss') { _yscale = 150; _xscale = 150; _root.quake += 8; } onEnterFrame = function () { if (_root.ispause == false) { if (type != 'boss') { _x = _x - _root.lvlspeed; } } }; } frame 19 { this.removeMovieClip(); } } movieClip 1995 { } frame 6 { onEnterFrame = null; back.gotoAndStop(3); savenow = false; sound = true; music = true; money = 0; money2 = 0; money3 = 0; plrlvl = 1; plrstar = 0; firstlaunch = true; muznum = 3; tocongrat = 0; blockBank = new Array(); enemyBank = new Array(); cargoBank = new Array(); lvlw = 800; lvlh = 500; lvlday = 3; lvldiz = 1; lvldizcol = 1; loadLevel = false; ispause = true; player._visible = false; inter._visible = false; inter2._visible = false; inter2.show = false; ispausedobj._visible = false; hunt = new Array(); hunt[1] = [2, 12, 17, 20, 33]; hunt[2] = [2, 10, 11, 30, 54]; hunt[3] = [4, 13, 18, 22, 27]; hunt[4] = [4, 12, 13, 23, 48]; hunt[5] = [2, 11, 17, 23, 33]; hunt[6] = [2, 14, 15, 20, 57]; msec = 0; sec = 0; quake = 0; coins = 0; coins2 = 0; fuel = 0; stars = 0; dampike = 30; damenemy = 30; dambullet = 30; dampit = 40; empdamage = 50; enemylife = new Array(); enemylife[1] = 8; enemylife[2] = 12; enemylife[3] = 18; enemylife[4] = 22; enemylife[5] = 40; enemylife[6] = 50; bosslife = new Array(); bosslife[1] = 750; bosslife[2] = 1500; bosslife[3] = 3000; ammo - 1; reloadtime = new Array(); reloadtime[0] = 9; reloadtime[1] = 15; reloadtime[2] = 6; reloadtime[3] = 10; reloadtime[4] = 5; reloadtime[5] = 4; reloadtime[6] = 7; reloadtime[7] = 4; reloadtime[8] = 15; reloadtime[9] = 6; weapsign = new Array(); weapsign[0] = 'Z'; weapsign[1] = 'S'; weapsign[2] = 'M'; weapsign[3] = 'P'; weapsign[4] = 'G'; weapsign[5] = 'A'; weapsign[6] = 'F'; weapsign[7] = 'L'; weapsign[8] = 'R'; weapsign[9] = 'T'; powersign = new Array(); powersign[1] = 'LIFE'; powersign[2] = 'EMP'; powersign[3] = 'MGNT'; powersign[4] = 'HELI'; powersign[5] = 'AMMO'; powersign[6] = 'ION'; powersign[7] = 'DAM'; powersign[8] = 'AIR'; powbonus = [0, 0, 0, 0, 0]; upgr = new Array(); upgr[1] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; upgr[2] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; upgr[3] = [0, 0, 0, 0, 0, 0, 0, 0]; upgr[4] = [0, 0, 0, 0, 0]; upgrmax = new Array(); upgrmax[1] = [5, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; upgrmax[2] = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2]; upgrmax[3] = [5, 3, 3, 3, 3, 3, 3, 3]; upgrin = new Array(); upgrin[1] = [1, 1, 1, 1, 1, 1, 9, 38, 17, 34, 24, 30]; upgrin[2] = [1, 1, 2, 7, 14, 19, 26, 31, 36, 40]; upgrin[3] = [1, 1, 4, 12, 22, 28, 33, 37]; upgrin[4] = [1, 5, 10, 15, 20]; upgrin[5] = [3, 16, 27]; upgrin[6] = [6, 18, 29]; upgrin[7] = [8, 21, 32]; upgrin[8] = [11, 23, 35]; upgrin[9] = [13, 25, 39]; episodenew = 1; levelnew = [0, 0]; lvlquest = [0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 9, 0]; maxlevels = lvlquest.length - 1; trace('Max levels: ' + maxlevels); tempstarsneed = 0; levelin = new Array(); i = 0; while (i < lvlquest.length) { levelin[i] = [0, 0]; j = 1; while (j < upgrin.length) { k = 0; while (k < upgrin[j].length) { if (i == upgrin[j][k]) { levelin[i] = [j, k]; } ++k; } ++j; } tempstarsneed += lvlquest[i]; trace(i + ' LVL ' + levelin[i]); ++i; } trace('Max Stars: ' + tempstarsneed); changecost = 200; upgrtext = new Array(); upgrtext[1] = new Array(); upgrtext[1][0] = [250, 'Health', 'Increases maximum health']; upgrtext[1][1] = [200, 'Double Jump', 'Allows an additional jump. Jump several times whilst in the air']; upgrtext[1][2] = [80, 'More Crates', 'Crates will appear more frequently']; upgrtext[1][3] = [50, 'Coin Magnet', 'Increases the distance at which coins, gems and fuel cans are attracted']; upgrtext[1][4] = [150, 'Weapon Damage', 'Increases damage of all your weapons']; upgrtext[1][5] = [120, 'More Weapons', 'Weapons will be paradropped more often']; upgrtext[1][6] = [250, 'Armed Pants', 'Improves protection against collisions']; upgrtext[1][7] = [1500, 'Armed Shirt', 'Improves protection against bullets and lasers']; upgrtext[1][8] = [300, 'More Support Items', 'Support items will be paradropped more often']; upgrtext[1][9] = [700, 'Regeneration', 'Improves health regeneration']; upgrtext[1][10] = [350, 'Stomp Damage', 'Stomping inflicts more damage']; upgrtext[1][11] = [450, 'Ammo Capacity', 'Increases ammo capacity for all weapons']; upgrtext[2] = new Array(); upgrtext[2][0] = [50, 'Pistols', 'Increases attack range of the pistols']; upgrtext[2][1] = [150, 'Shotgun', 'Increases the number of shotgun pellets']; upgrtext[2][2] = [300, 'Machine Gun', 'Increases rate of fire for the machine gun']; upgrtext[2][3] = [500, 'Pulse Gun', 'Increases attack range']; upgrtext[2][4] = [700, 'Gatling Gun', 'Increases rate of fire for the Gatling gun']; upgrtext[2][5] = [1000, 'Acid Gun', 'All shells have a chance to inflict double damage']; upgrtext[2][6] = [1300, 'Flame Gun', 'Fireballs become more stable and remain longer']; upgrtext[2][7] = [1600, 'Laser Gun', 'Increases laser beam power and thickness']; upgrtext[2][8] = [2000, 'Rocket Launcher', 'Increases rate of fire and rocket speed']; upgrtext[2][9] = [5000, 'Tesla Gun', 'Increases Tesla attack range']; upgrtext[3] = new Array(); upgrtext[3][0] = [100, 'Medical Kit', 'Restores health']; upgrtext[3][1] = [200, 'emp Strike', 'Destroys all enemies. All new enemies will be temporarily shut down']; upgrtext[3][2] = [300, 'Big Magnet', 'Attracts all items on the screen, except keys']; upgrtext[3][3] = [400, 'Helicopter', 'Attacks enemies using a huge machine gun']; upgrtext[3][4] = [600, 'Weapon Booster', 'Doubles damage of your weapons']; upgrtext[3][5] = [900, 'Ion Strike', 'Attacks enemies using a huge satellite-based energy cannon']; upgrtext[3][6] = [1200, 'Mega Shield', 'Blocks all damage (except spikes and fall damage)']; upgrtext[3][7] = [1500, 'Airplane', 'Attacks enemies with a deadly barrage of missiles']; powuptext = new Array(); powuptext[0] = [50, 'Big Magnet', 'Attracts all items on the screen, except keys']; powuptext[1] = [150, 'Double Coins', 'Each coin gives twice as much value']; powuptext[2] = [200, 'Double Damage', 'Doubles damage of your weapons']; powuptext[3] = [250, 'More Health', 'Increases maximum health']; powuptext[4] = [300, 'Unlimited Jumps', 'Unlimited number of jumps. You become able to fly']; powuptext[5] = [0, 'Jet Pack', 'Skip the distance for this stage']; fueltext = new Array(); fueltext[1] = [30, '1/4', 'Skip 25% of the distance for this stage', '1K', 'Skip 1000 meters of the distance for this stage']; fueltext[2] = [60, '2/4', 'Skip 50% of the distance for this stage', '2K', 'Skip 2000 meters of the distance for this stage']; fueltext[3] = [90, '3/4', 'Skip 75% of the distance for this stage', '3K', 'Skip 3000 meters of the distance for this stage']; fueltext[4] = [120, 'Full', 'Skip 100% the distance for this stage', '4K', 'Skip 4000 meters of the distance for this stage']; startweap = 0; upgrInit = function (x) { i = 0; while (i < upgrin[2].length) { if (upgrin[2][i] <= plrlvl) { newweap = i; } ++i; } i = 0; while (i < upgrin[3].length) { if (upgrin[3][i] <= plrlvl) { newpower = i; } ++i; } doubleincome = 0; doubledamage = 0; unlimmagnet = 0; unlimjump = 0; morehealth = 0; unlimammo = 0; jetpack = 0; morecry = 1 + lvlsave[1][1] + lvlsave[1][2] + lvlsave[1][3] / 2; morecargo = 1 + lvlsave[2][1] + lvlsave[2][2] + lvlsave[2][3]; morecoin = 1 + lvlsave[3][1] + lvlsave[3][2] + lvlsave[3][3] / 3; morefuel = 1 + lvlsave[4][1] + lvlsave[4][2] + lvlsave[4][3] / 2; morestar = 1 + lvlsave[5][1] + lvlsave[5][2] + lvlsave[5][3]; xlife = upgr[1][0]; xregen = upgr[1][9]; xvspike = upgr[1][6]; xvsenemy = upgr[1][6]; xvsbullet = upgr[1][7]; xdjump = upgr[1][1]; xammo = upgr[1][11]; xbootdamage = upgr[1][10]; xdamage = upgr[1][4]; xmagnet = upgr[1][3]; xweappoint = upgr[1][5]; xpowerpoint = upgr[1][8]; xcargopoint = upgr[1][2]; xshieldtime = 0; life = 100 + 20 * xlife; maxlife = life; vspike = 3 * xvspike; vsenemy = 3 * xvsenemy; vsbullet = 3 * xvsbullet; magnet = 100 + 30 * xmagnet; shieldmaxtime = 30 + 20 * xshieldtime; regenamount = xregen; maxammo = 8 + xammo * 2; damagemult = 1 + xdamage / 5; bootdamage = 10 + 5 * xbootdamage; djump = 1 + xdjump; maxweappoint = 16 - xweappoint; maxpowerpoint = 12 - xpowerpoint; maxcargopoint = 7 - xcargopoint; pistolupgr = 5 * upgr[2][0]; shotupgr = 2 * upgr[2][1]; gunupgr = 1 * upgr[2][2]; pulseupgr = 6 * upgr[2][3]; gaussupgr = 1 * upgr[2][4]; spreadupgr = 3 * upgr[2][5]; flameupgr = 10 * upgr[2][6]; laserupgr = 1 * upgr[2][7]; rocketupgr = 1 * upgr[2][8]; teslaupgr = 1 * upgr[2][9]; heartamount = 50 + 25 * upgr[3][0]; poweremptime = 10 + 3 * upgr[3][1]; powermagnettime = 6 + 3 * upgr[3][2]; powerhelitime = 6 + 3 * upgr[3][3]; powerammotime = 6 + 3 * upgr[3][4]; poweriontime = 6 + 3 * upgr[3][5]; powerdamtime = 6 + 3 * upgr[3][6]; powerplanetime = 6 + 3 * upgr[3][7]; if (minigame == 0 || minigame == 6) { i = 0; while (i < upgr[4].length) { if (upgr[4][i] > 0 || powbonus[i] > 0) { setPowup(i, false); } ++i; } } }; modetxt = new Array(); modetxt[0] = ['Episode', 'Complete the full distance and defeat the boss at the end']; modetxt[1] = ['Hunt', 'Destroy all enemies']; modetxt[2] = ['Crates', 'Destroy all crates']; modetxt[3] = ['Coins', 'Collect all coins']; modetxt[4] = ['Jumps', 'No losing health']; modetxt[5] = ['Boss', 'Destroy the big boss']; modetxt[6] = ['Survival', 'Infinite stage. Hold out as long as possible']; modetxt[7] = ['Madness', 'Defeat bosses as many as possible!']; unlocktxt = new Array(); unlocktxt[0] = 'NEW CHALLENGE UNLOCKED'; unlocktxt[1] = 'NEW UPGRADE UNLOCKED'; unlocktxt[2] = 'NEW WEAPON UNLOCKED'; unlocktxt[3] = 'NEW SUPPORT ITEM UNLOCKED'; unlocktxt[4] = 'NEW POWER-UP UNLOCKED'; rewardtxt = new Array(); rewardtxt[0] = ['New episode unlocked']; rewardtxt[1] = ['Enemies drop more gems']; rewardtxt[2] = ['New cargo crate available']; rewardtxt[3] = ['Enemies and crates drop more coins']; rewardtxt[4] = ['Crates contain more fuel cans']; rewardtxt[5] = ['More keys in the stage']; newrewardnum = new Array(); newrewardtxt = new Array(); j = 0; while (j <= 6) { newrewardnum[j] = new Array(); newrewardtxt[j] = new Array(); i = 1; while (i <= 3) { if (j == 0) { newrewardnum[j][i] = i * i * 500 + 500; newrewardtxt[j][i] = newrewardnum[j][i] + ' Coins'; } else { newrewardnum[j][i] = j + i; newrewardtxt[j][i] = newrewardnum[j][i] + ' Keys'; } ++i; } ++j; } modeweap = new Array(); modeweap[1] = [8, 5, 2]; modeweap[2] = [6, 3, 1]; modeweap[3] = [-1, -1, -1]; modeweap[4] = [-1, -1, -1]; modeweap[5] = [7, 4, 0]; lvlsave = new Array(); lvlsave[0] = [undefined, 0, 0, 0]; lvlsave[1] = [undefined, 0, 0, 0]; lvlsave[2] = [undefined, 0, 0, 0]; lvlsave[3] = [undefined, 0, 0, 0]; lvlsave[4] = [undefined, 0, 0, 0]; lvlsave[5] = [undefined, 0, 0, 0]; lvl = 1; minigame = 0; maxlvlspeed = 0; lvlspeed = 0; oldlvlspeed = 0; prelvlcomp = false; tutortask == 0; istutor = true; ishelp = [true, true, true, true, true, true, true]; survpoint = new Array(); survchange = new Array(); survchange[2] = [100, 150, 200]; survchange[3] = [2, 4, 6]; survchange[4] = [5, 3, 1]; survchange[5] = [3, 2, 1]; survchange[6] = [[1, 2, 3], [2, 3], [3]]; survchange[7] = [3, 2, 1]; survchange[8] = [[1, 2, 3], [3, 4, 5], [3, 4, 5, 6]]; survchange[9] = [3, 2, 1]; survchange[10] = [[1, 2, 3], [2, 3], [3]]; survchange[11] = [6, 4, 2]; survboss = new Array(); survboss[2] = [1]; survboss[4] = [2]; survboss[6] = [3]; survboss[8] = [1, 2]; survboss[11] = [1, 3]; survboss[14] = [2, 3]; survboss[18] = [3, 3]; survboss[23] = [1, 2, 3]; survboss[29] = [1, 2, 3, 3]; survivalChange = function () { trace('survivalChange'); if (survmaxpoint > 0) { var v2 = new Array(); i = 2; while (i <= 11) { if (survpoint[i] < survchange[i].length - 1) { v2.push(i); } ++i; } --survmaxpoint; trace('survmaxpoint=' + survmaxpoint); var v3 = v2[random(v2.length)]; trace('currchange=' + v3); ++survpoint[v3]; lvlmap611[v3] = survchange[v3][survpoint[v3]]; trace(lvlmap611); if (random(2 + morestar) > 0) { ++starready; } stardiff = random(6); } trace('checkpoint=' + checkpoint); if (checkpoint > jetpack) { var v1; if (checkpoint > 29) { if ((checkpoint + 1) % 6 == 0) { v1 = 29; } } else { v1 = checkpoint; } if (survboss[v1] != undefined) { i = 0; while (i < survboss[v1].length) { ++enemyCount; levelmap.attachMovie('boss' + survboss[v1][i] + 'obj', 'enemy' + enemyCount, levelmap.getNextHighestDepth()); ++i; } } } }; lvlmap010 = [10000, 12, 100, 0, -1, -1, [1], -1, [1], -1, [3], -1, 0]; lvlmap011 = [30000, 10, 100, 0, 8, 5, [1], 3, [1], -1, [1], -1, 0]; lvlmap012 = [30000, 11, 120, 1, 6, 5, [1], 3, [2], 4, [1], -1, 1]; lvlmap013 = [30000, 12, 140, 2, 5, 4, [1, 2], 2, [1, 3], -1, [1], 5, 2]; lvlmap014 = [30000, 13, 160, 3, 4, 4, [1, 2], 2, [2, 3], 3, [1], 8, 3]; lvlmap015 = [30000, 12, 120, 2, 3, 8, [1, 2], -1, [1], 6, [1], -1, 1]; lvlmap021 = [60000, 11, 160, 2, 3, -1, [1], 3, [3], 3, [1, 2], 5, 1]; lvlmap022 = [60000, 12, 180, 3, 4, 5, [1, 2], 2, [3, 4], -1, [1], 3, 2]; lvlmap023 = [60000, 13, 200, 3, 3, 3, [1, 2], 2, [2, 4], 3, [2], 5, 3]; lvlmap024 = [60000, 14, 200, 4, 4, 7, [2], 1, [1, 3, 5], 5, [2], 2, 2]; lvlmap025 = [60000, 12, 200, 4, 5, 3, [1, 2], -1, [1], -1, [2], 6, 5]; lvlmap031 = [90000, 12, 100, 0, 2, 4, [1, 2, 3], 3, [4, 5], -1, [1], -1, 3]; lvlmap032 = [90000, 13, 150, 3, 5, 3, [2, 3], 2, [5, 6], 3, [1, 2, 3], -1, 5]; lvlmap033 = [90000, 14, 200, 0, 2, 3, [2, 3], 1, [2, 4, 5, 6], 3, [2, 3], 4, 2]; lvlmap034 = [90000, 15, 150, 4, 5, 2, [3], 1, [5, 6], 2, [3], 3, 4]; lvlmap035 = [90000, 12, 200, 5, 2, 2, [1, 2, 3], -1, [1], 2, [1, 2], 5, 4]; lvlmap111 = [10000, 10, 100, 1, 4, -1, [1], 1, [1, 2], 0, [1], -1, 0]; lvlmap121 = [20000, 12, 150, 1, 4, -1, [1], 1, [3, 4], 0, [1], -1, 0]; lvlmap131 = [30000, 14, 200, 1, 4, -1, [1], 1, [5, 6], 0, [1], -1, 0]; lvlmap211 = [10000, 10, 100, 1, 4, -1, [1], -1, [1], 0, [1], -1, 0]; lvlmap221 = [20000, 12, 150, 1, 4, -1, [1], -1, [1], 0, [1], 6, 0]; lvlmap231 = [30000, 14, 200, 1, 4, -1, [1], -1, [1], 0, [1], 3, 0]; lvlmap311 = [5000, 10, 150, 1, 4, -1, [1], -1, [1], 0, [1], -1, 1]; lvlmap321 = [10000, 12, 180, 2, 3, -1, [1], -1, [1], 0, [1], -1, 5]; lvlmap331 = [15000, 14, 200, 3, 2, -1, [1], -1, [1], 0, [1], -1, 5]; lvlmap411 = [5000, 10, 200, 2, 4, 4, [1], -1, [1], 5, [1], 6, 0]; lvlmap421 = [10000, 12, 200, 3, 3, 3, [2], -1, [1], 4, [2], 4, 0]; lvlmap431 = [15000, 14, 200, 4, 2, 2, [3], -1, [1], 3, [3], 2, 0]; lvlmap511 = [50, 10, 200, 2, 3, 5, [1], 4, [1, 2], 6, [1], -1, 5]; lvlmap521 = [50, 12, 200, 3, 3, 4, [1, 2], 3, [3, 4], 4, [1, 2], 4, 5]; lvlmap531 = [50, 14, 200, 4, 3, 3, [1, 2, 3], 2, [5, 6], 2, [1, 2, 3], 3, 5]; createLevel = function () { tocongrat = 0; prelvlcomp = false; playMusic('game'); musicVol.setVolume(20); clearLevel(); upgrInit(); if (minigame == 0 && lvl == 1 && istutor == true) { ispause = false; checkpoint = 0; nodanger = true; tutortask = 0; interInit(); intertutor.gotoAndPlay('new'); } levelInit(1); inter.life.msk.gotoAndStop(maxlife / 20 - 4); inter.life.bord.gotoAndStop(maxlife / 20 - 4); setBack(0); coins = 0; coins2 = 0; fuel = 0; stars = 0; killnodam = 0; runnodam = 0; act = 1; seg = 0; step = 100; hig = maxlvlhigh + 250; createBlock(2, 0); createBlock(2, 300); createBlock(2, 600); lvlend = false; lvlendcount = lvlw + 200; if (muznum == 3) { muznum = 1; } else { ++muznum; } }; interInit = function () { inter._visible = true; inter.life.oldlife = 0; inter.life.newlife = 0; inter2.show = true; if (minigame == 6) { inter2.gotoAndStop(2); } else { inter2.gotoAndStop(1); inter2.meter.gotoAndStop(1); } }; launchRound = function (type) { if (minigame == 6) { jetpack *= 3; } trace('JETPACK=' + jetpack); if (type != 1) { speedInit(); } if (ispausedobj._visible == false) { ispause = false; } musicVol.setVolume(muzvol); gogoeff.gotoAndPlay(2); if (minigame == 6) { gogoeff.acttxt.text = modetxt[minigame][0]; } else { gogoeff.acttxt.text = modetxt[minigame][0] + ' ' + lvl; } openMenu('exit'); }; initChall = function (num) { chalcomp = true; interchal.gotoAndStop(2); interchal.img.gotoAndStop(1); interchal.img.desc.text = modetxt[minigame][1]; interchal.img.img.gotoAndStop(minigame); }; setChall = function (num, type) { if (num == minigame) { if (type) { interchal.img.gotoAndStop(2); } else { if (chalcomp) { if (!win) { interchal.img.gotoAndStop(3); chalcomp = false; playSound('failed'); } } } } }; getChalComp = function () { var v1 = 0; i = 1; while (i <= 5) { j = 1; while (j <= 3) { v1 += lvlsave[i][j]; ++j; } ++i; } return v1; }; clearLevel = function () { mouseclick = false; comixobj.gotoAndStop(1); comixobj._visible = false; helpobj.gotoAndStop(1); helpobj._visible = false; chalnew.gotoAndStop(1); chalnew._visible = false; intertutor.gotoAndStop(1); intertutor._visible = false; interchal.gotoAndStop(1); interchal._visible = false; inter._visible = false; inter.life.oldlife = 0; inter.life.newlife = 0; inter2.show = false; ispausedobj._visible = false; ispausedobj.gotoAndStop(1); ispause = true; maxlvlspeed = 0; lvlspeed = 0; chalcomp = true; nodanger = false; win = false; wintimer = 0; winlogo.gotoAndStop(1); checkpoint = 1; diedelay = 0; bossobj = undefined; player._visible = false; player.die = false; player.dam = 0; player._y = -50; respawneff.gotoAndStop(1); respawneff._visible = false; tutortask = 0; j = 0; while (j < blockBank.length) { blockBank[j].removeMovieClip(); ++j; } j = 0; while (j < enemyBank.length) { enemyBank[j].removeMovieClip(); ++j; } j = 0; while (j < cargoBank.length) { cargoBank[j].removeMovieClip(); ++j; } blockBank.length = 0; enemyBank.length = 0; cargoBank.length = 0; blockCount = 0; enemyCount = 0; cargoCount = 0; powerplaneobj.gotoAndStop(1); powerheliobj.gotoAndStop(1); jetpackobj.gotoAndStop(1); while (levelmap.part != undefined) { levelmap.part.removeMovieClip(); } while (levelmap2.part != undefined) { levelmap2.part.removeMovieClip(); } while (levelmap2.bullet != undefined) { levelmap2.bullet.removeMovieClip(); } while (levelmap2.ebullet != undefined) { levelmap2.ebullet.removeMovieClip(); } while (levelmap.pike != undefined) { levelmap.pike.removeMovieClip(); } while (levelmap3.part != undefined) { levelmap3.part.removeMovieClip(); } j = 0; while (j < 3) { if (curquest[j][3] == 1) { stat[curquest[j][1]] = 0; } ++j; } survmaxpoint = 0; i = 2; while (i <= 11) { survpoint[i] = 0; survmaxpoint += survchange[i].length - 1; ++i; } lvlmap611 = [10000, 12, 100, 1, 5, 3, [1, 2, 3], 3, [1, 2, 3], 3, [1, 2, 3], 6, 0]; }; setBack = function (type) { if (type == 0) { lvldiz = lvl; if (lvlday <= 1) { lvlday = 4; } else { --lvlday; } back.gotoAndStop(1); back.img1.gotoAndStop(lvlday); back.img2.gotoAndStop(lvlday); back.img3.gotoAndStop(lvlday); back.img1.img.gotoAndStop(lvldiz); back.img2.img.gotoAndStop(lvldiz); switch (lvlday) { case 1: lvlwind = 10; break; case 2: case 4: lvlwind = 5; break; case 3: lvlwind = 0; } } else { back.gotoAndStop(type); } }; tutorInit = function () { trace(tutortask + 'tutortask'); if (tutortask == 0) { intertutor.img.gotoAndStop(1); intertutor.gotoAndPlay('new'); } else { intertutor.img.gotoAndStop(2); intertutor.gotoAndPlay('done'); playSound('holy'); } tutortask += 1; pikepoint = 0; maxpikepoint = 0; wallpoint = 0; maxwallpoint = 0; barrierpoint = 0; maxbarrierpoint = 0; cargopoint = 0; maxcargopoint = 0; switch (tutortask) { case 1: pikepoint = 3; maxpikepoint = 3; break; case 2: wallpoint = 3; maxwallpoint = 3; break; case 3: barrierpoint = 3; maxbarrierpoint = 3; break; case 4: cargopoint = 3; maxcargopoint = 3; } }; tutortxt = new Array(); tutortxt[1] = ['JUMP', 'Jump over the spikes']; tutortxt[2] = ['DOUBLE JUMP', 'Jump over the wall']; tutortxt[3] = ['SLIDE', 'Slide under the barrier']; tutortxt[4] = ['JUMP AND STOMP', 'Stomp the box']; setTutor = function () { intertutor.tutortxt.text = 'Tutorial ' + tutortask + '/4'; intertutor.img.gotoAndStop(1); intertutor.img.title.text = tutortxt[tutortask][0]; intertutor.img.desc.text = tutortxt[tutortask][1]; intertutor.img.img.gotoAndStop(tutortask); intertutor.img.hint.gotoAndStop(tutortask); }; tutorFinish = function () { playSound('holy'); intertutor.img.gotoAndStop(2); intertutor.gotoAndPlay('done'); tutortask = 0; nodanger = false; istutor = false; checkpoint = 1; levelInit(1); launchRound(1); player.attack = true; }; initHelp = function (type) { if (helpobj._currentframe == 1) { if (ishelp[type]) { switch (type) { case 0: setHelp(type); break; case 1: if (money2 >= opt.p0.cost) { setHelp(type); } break; case 2: if (money3 >= opt.j1.cost) { setHelp(type); } break; case 3: if (money >= opt.upgr.b3.cost) { setHelp(type); } break; case 4: if (money >= setWeapCost(startweap + 1)) { initUpgr(2, true); setHelp(type); } break; case 5: if (opt.s11._currentframe == 1) { setHelp(type); } break; case 6: setHelp(type); } } } }; setHelp = function (type) { helpobj.num = type; helpobj.gotoAndPlay(2); ishelp[type] = false; }; levelInit = function (type) { var v2 = checkpoint; if (minigame == 6) { v2 = 1; } if (checkpoint < 2) { initweap = startweap; if (minigame == 0 && checkpoint != 0) { maxstars = lvl * morestar + 4; bossready = 1; } else { maxstars = 0; bossready = 0; } poweremp = 0; powermagnet = 0; powerheli = 0; powerammo = 0; powerion = 0; powerdam = 0; powerplane = 0; lvllength = 0; pikeready = 0; wallready = 0; enemyready = 0; weapready = 0; powerready = 0; cargoready = 0; barrierready = 0; starready = 0; maxlvllength = _root['lvlmap' + minigame + '' + lvl + '' + v2][0]; maxstarpoint = Math.round(maxlvllength / maxstars * 30 * 12); starpoint = Math.round(maxstarpoint / 1.5); } pikeready = 0; wallready = 0; enemyready = 0; barrierready = 0; maxlvlhigh = _root['lvlmap' + minigame + '' + lvl + '' + v2][2]; maxlvlpit = _root['lvlmap' + minigame + '' + lvl + '' + v2][3]; maxlvlseg = 1 + _root['lvlmap' + minigame + '' + lvl + '' + v2][4]; maxpikepoint = _root['lvlmap' + minigame + '' + lvl + '' + v2][5]; pikearray = _root['lvlmap' + minigame + '' + lvl + '' + v2][6]; maxenemypoint = _root['lvlmap' + minigame + '' + lvl + '' + v2][7]; enemyarray = _root['lvlmap' + minigame + '' + lvl + '' + v2][8]; maxwallpoint = _root['lvlmap' + minigame + '' + lvl + '' + v2][9]; wallarray = _root['lvlmap' + minigame + '' + lvl + '' + v2][10]; maxbarrierpoint = _root['lvlmap' + minigame + '' + lvl + '' + v2][11]; stardiff = _root['lvlmap' + minigame + '' + lvl + '' + v2][12]; pikepoint = maxpikepoint; wallpoint = maxwallpoint; enemypoint = maxenemypoint; weappoint = 3 + random(maxweappoint); if (startweap == newweap) { weappoint = 0; } powerpoint = maxpowerpoint + random(maxpowerpoint); cargopoint = maxcargopoint + random(maxcargopoint); barrierpoint = maxbarrierpoint; if (minigame != 0 && minigame != 6) { initChall(); cargopoint = 0; weappoint = 0; powerpoint = 0; if (minigame == 2) { cargoready = 9999; } if (minigame == 3) { weapready = 9999; starready = 9999; } if (minigame == 5) { bossready = 1; } } if (type != 1) { speedInit(); } if (checkpoint == 0) { weappoint = 0; powerpoint = 0; tutorInit(); speedInit(); } }; speedInit = function () { if (jetpack > 0) { if (checkpoint == 1) { addStat(29, 1); jetpackobj.gotoAndStop(2); playSound('jetpack'); if (minigame == 6) { jetpackobj.maxdist = Math.round(maxlvllength * jetpack - 5000); } else { jetpackobj.maxdist = Math.round((maxlvllength / 4) * jetpack - 5000); } } } if (checkpoint == 0 || checkpoint > jetpack) { if (minigame == 6) { maxlvlspeed = 12 + Math.floor(checkpoint / 2); } else { maxlvlspeed = _root['lvlmap' + minigame + '' + lvl + '' + checkpoint][1]; } } else { maxlvlspeed = 200; lvlspeed = 200; } if (checkpoint == 0) { playerInit(1); } else { if (jetpack == checkpoint - 1) { if (checkpoint == 1) { playerInit(1); } else { playerInit(2); } } } }; questtxt = new Array(); questtxt[0] = ['Destroy', 'enemies']; questtxt[1] = ['Stomp enemies', 'times']; questtxt[2] = ['Destroy', 'crates']; questtxt[3] = ['Collect', 'coins']; questtxt[4] = ['Change', 'weapons']; questtxt[5] = ['Collect', 'support items']; questtxt[6] = ['Run', 'meters']; questtxt[7] = ['Perform', 'jumps']; questtxt[8] = ['Shoot', 'times']; questtxt[9] = ['Perform', 'slides']; questtxt[10] = ['Perform', 'stomps']; questtxt[11] = ['Stomp a boss', 'times']; questtxt[12] = ['Stomp crates', 'times']; questtxt[13] = ['Perform', 'double jumps']; questtxt[14] = ['Collect', 'keys']; questtxt[15] = ['Destroy', 'walls']; questtxt[16] = ['Run', 'meters in Survival']; questtxt[17] = ['Defeat', 'any bosses']; questtxt[18] = ['Buy', 'ability upgrades']; questtxt[19] = ['Buy', 'weapon upgrades']; questtxt[20] = ['Buy', 'support upgrades']; questtxt[21] = ['Defeat the first boss', '']; questtxt[22] = ['Defeat the second boss', '']; questtxt[23] = ['Defeat the third boss', '']; questtxt[24] = ['Change your weapon in the shop', 'times']; questtxt[25] = ['Complete', 'challenges']; questtxt[26] = ['Kill', 'enemies without taking damage']; questtxt[27] = ['Run', 'seconds without taking damage']; questtxt[28] = ['Buy', 'power-ups']; questtxt[29] = ['Use the jetpack', 'times']; questtxt[30] = ['Collect', 'gems']; questtxt[31] = ['Collect', 'fuel cans']; questtxt[32] = ['Slide under', 'barriers']; questtxt[33] = ['Open', 'containers']; questtxt[34] = ['Open gold container', '']; questtxt[35] = ['Complete', 'any stages']; questtxt[36] = ['Slide', 'seconds']; questtxt[37] = ['Collect', 'gems without taking damage']; stat = new Array(); j = 0; while (j < questtxt.length) { stat[j] = 0; ++j; } curquest = new Array(); curquest = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]; quests = new Array(); quests[0] = new Array(); quests[1] = new Array(); quests[2] = new Array(); quests[1][0] = [30, 5, 0, 2]; quests[1][1] = [4, 3, 0, 2]; quests[1][2] = [6, 500, 0, 2]; quests[1][3] = [1, 5, 0, 2]; quests[1][4] = [31, 10, 0, 2]; quests[1][5] = [5, 5, 0, 2]; quests[1][6] = [12, 3, 0, 2]; quests[1][7] = [32, 5, 0, 2]; quests[1][8] = [33, 5, 0, 2]; quests[1][9] = [11, 3, 0, 2]; quests[1][10] = [17, 2, 0, 2]; quests[1][11] = [30, 250, 0, 2]; quests[1][12] = [4, 15, 0, 2]; quests[1][13] = [6, 2500, 0, 2]; quests[1][14] = [35, 3, 0, 2]; quests[1][15] = [31, 100, 0, 2]; quests[1][16] = [5, 15, 0, 2]; quests[1][17] = [11, 8, 0, 2]; quests[1][18] = [32, 10, 0, 2]; quests[1][19] = [17, 3, 0, 2]; quests[1][20] = [33, 10, 0, 2]; quests[1][21] = [36, 15, 0, 2]; quests[1][22] = [30, 800, 0, 2]; quests[1][23] = [4, 30, 0, 2]; quests[1][24] = [6, 10000, 0, 2]; quests[1][25] = [35, 6, 0, 2]; quests[1][26] = [31, 500, 0, 2]; quests[1][27] = [5, 30, 0, 2]; quests[1][28] = [11, 15, 0, 2]; quests[1][29] = [32, 15, 0, 2]; quests[1][30] = [17, 6, 0, 2]; quests[1][31] = [33, 20, 0, 2]; quests[1][32] = [11, 30, 0, 2]; quests[0][0] = [0, 2, 1, 3]; quests[0][1] = [7, 10, 1, 3]; quests[0][2] = [15, 3, 1, 3]; quests[0][3] = [37, 5, 1, 3]; quests[0][4] = [14, 2, 1, 3]; quests[0][5] = [13, 15, 1, 3]; quests[0][6] = [3, 250, 1, 3]; quests[0][7] = [9, 10, 1, 3]; quests[0][8] = [27, 10, 1, 3]; quests[0][9] = [2, 10, 1, 3]; quests[0][10] = [26, 5, 1, 3]; quests[0][11] = [0, 25, 1, 3]; quests[0][12] = [37, 50, 1, 3]; quests[0][13] = [15, 10, 1, 3]; quests[0][14] = [8, 300, 1, 3]; quests[0][15] = [14, 5, 1, 3]; quests[0][16] = [0, 50, 1, 3]; quests[0][17] = [3, 2000, 1, 3]; quests[0][18] = [10, 10, 1, 3]; quests[0][19] = [27, 30, 1, 3]; quests[0][20] = [2, 30, 1, 3]; quests[0][21] = [26, 15, 1, 3]; quests[0][22] = [0, 75, 1, 3]; quests[0][23] = [37, 100, 1, 3]; quests[0][24] = [15, 20, 1, 3]; quests[0][25] = [13, 100, 1, 3]; quests[0][26] = [14, 9, 1, 3]; quests[0][27] = [0, 100, 1, 3]; quests[0][28] = [3, 10000, 1, 3]; quests[0][29] = [10, 50, 1, 3]; quests[0][30] = [27, 60, 1, 3]; quests[0][31] = [8, 999, 1, 3]; quests[0][32] = [26, 50, 1, 3]; quests[2][0] = [18, 2, 2, 1]; quests[2][1] = [28, 2, 2, 1]; quests[2][2] = [19, 2, 2, 1]; quests[2][3] = [25, 2, 2, 1]; quests[2][4] = [20, 3, 2, 1]; quests[2][5] = [29, 2, 2, 1]; quests[2][6] = [24, 1, 2, 1]; quests[2][7] = [21, 1, 2, 1]; quests[2][8] = [18, 10, 2, 1]; quests[2][9] = [28, 5, 2, 1]; quests[2][10] = [19, 6, 2, 1]; quests[2][11] = [25, 5, 2, 1]; quests[2][12] = [20, 8, 2, 1]; quests[2][13] = [29, 6, 2, 1]; quests[2][14] = [24, 3, 2, 1]; quests[2][15] = [22, 1, 2, 1]; quests[2][16] = [34, 1, 2, 1]; quests[2][17] = [18, 25, 2, 1]; quests[2][18] = [28, 15, 2, 1]; quests[2][19] = [19, 10, 2, 1]; quests[2][20] = [25, 10, 2, 1]; quests[2][21] = [20, 15, 2, 1]; quests[2][22] = [29, 10, 2, 1]; quests[2][23] = [24, 4, 2, 1]; quests[2][24] = [23, 1, 2, 1]; quests[2][25] = [16, 2000, 2, 1]; quests[2][26] = [18, 40, 2, 1]; quests[2][27] = [28, 25, 2, 1]; quests[2][28] = [16, 4000, 2, 1]; quests[2][29] = [29, 15, 2, 1]; quests[2][30] = [24, 7, 2, 1]; quests[2][31] = [25, 15, 2, 1]; quests[2][32] = [16, 6000, 2, 1]; maxquest = new Array(); maxquest[0] = quests[0].length; maxquest[1] = quests[1].length; maxquest[2] = quests[2].length; maxquests = maxquest[0] + maxquest[1] + maxquest[2]; getQuestCount = function () { return curquest[0][0] + curquest[1][0] + curquest[2][0]; }; setQuest = function (num, init) { trace('SET QUEST ' + num); var v2; if (init) { v2 = curquest[num][0]; } else { v2 = curquest[num][0] + 1; } if (v2 < maxquest[num]) { curquest[num][0] = v2; curquest[num][1] = quests[num][v2][0]; curquest[num][2] = quests[num][v2][1]; curquest[num][3] = quests[num][v2][2]; curquest[num][4] = quests[num][v2][3]; curquest[num][5] = 0; setQuestTxt(num); if (curquest[num][3] == 0 && init != true) { stat[curquest[num][1]] = 0; } if (curquest[num][3] == 2) { if (stat[curquest[num][1]] >= curquest[num][2]) { curquest[num][5] = 1; } } } else { curquest[num][0] = v2; curquest[num][5] = 1; } }; curquesttxt = new Array(); setQuestTxt = function (num, type) { var v2 = curquest[num][1]; if (questtxt[v2][1] == '') { curquesttxt[num] = questtxt[v2][0]; } else { curquesttxt[num] = questtxt[v2][0] + ' ' + curquest[num][2] + ' ' + questtxt[v2][1]; } switch (curquest[num][3]) { case 0: curquesttxt[num] += '. '; break; case 1: curquesttxt[num] += ' during a stage. '; break; case 2: curquesttxt[num] += '. '; } if (curquest[num][5] == 0) { if (type == 1 || type != 0 && curquest[num][3] != 1) { curquesttxt[num] += Math.max(0, curquest[num][2] - stat[v2]) + ' left.'; } } }; addStat = function (num, amount) { stat[num] += amount; testQuest(num); }; setStat = function (num, amount) { if (amount > stat[num]) { stat[num] = amount; } testQuest(num); }; testQuest = function (num) { j = 0; while (j < 3) { if (curquest[j][1] == num) { if (curquest[j][5] == 0) { if (stat[num] >= curquest[j][2]) { curquest[j][5] = 1; setQuestTxt(j, 0); gachilogo.desc = curquesttxt[j]; gachilogo.img.gotoAndStop(j + 1); gachilogo.img.img.gotoAndStop(num + 1); gachilogo.gotoAndPlay(2); } } } ++j; } }; getQuestBonus = function (type) { var v1 = type * 100; return v1; }; initQuest = function (obj, type) { if (levelin[plrlvl + 1][0] < 5) { obj.reward.text = 'REWARDS: ' + _root.getQuestBonus(plrlvl + 1) + '$\n' + unlocktxt[levelin[plrlvl + 1][0]]; } else { obj.reward.text = 'REWARDS: ' + _root.getQuestBonus(plrlvl + 1) + '$\n' + unlocktxt[0]; } obj.starneed.text = lvlquest[plrlvl] - plrstar; j = 0; while (j < 3) { if (maxquest[j] <= curquest[j][0]) { obj['q' + j].gotoAndStop(4); } else { setQuestTxt(j, type); z = obj['q' + j]; z.gotoAndStop(1); z.desc.text = curquesttxt[j]; z.img.gotoAndStop(j + 1); z.img.img.gotoAndStop(curquest[j][1] + 1); z.stars = curquest[j][4]; z.star.gotoAndStop(z.stars); z.star.s1.gotoAndStop(1); z.star.s2.gotoAndStop(1); z.star.s3.gotoAndStop(1); if (curquest[j][5]) { z.comp._visible = true; } else { z.comp._visible = false; } trace(j + 'quest=' + stat[curquest[j][1]]); } ++j; } }; initLvlQuest = function (obj, type) { if (plrlvl == maxlevels) { obj.starneed = 0; obj.gotoAndStop(9); obj.backimg.gotoAndStop(9); } else { obj.starneed = lvlquest[plrlvl]; obj.gotoAndStop(obj.starneed - 2); obj.backimg.gotoAndStop(obj.starneed - 2); j = 1; while (j <= obj.starneed) { if (plrstar >= j) { obj['s' + j].gotoAndStop(2); } else { obj['s' + j].gotoAndStop(1); } ++j; } } obj.desc.text = 'Level ' + plrlvl; if (type == 'init') { obj.timer = 30; obj.curq = undefined; obj.stars = 0; obj.levelup = false; obj.exit = false; } }; testCompQuest = function () { j = 0; while (j < 3) { if (curquest[j][0] < maxquest[j]) { if (curquest[j][5] == 1) { return true; } } ++j; } }; playerInit = function (x) { trace('playerInit x=' + x); if (x == 2) { player.die = true; diedelay = 0; } else { lvlspeed = 0; player._visible = true; player.gotoAndStop('drop'); player.hspeed = player.dropspeed; player.jump = true; player.drop = true; player.die = false; player.shieldtime = 0; player._y = 0; } if (x == undefined) { player.dam += player.maxdam; } else { ammo = -1; player.die = true; if (minigame == 3 || minigame == 4) { player.weap = 0; player.weapon.img.gotoAndStop(1); player.attack = false; } else { player.weap = initweap; player.weapon.img.gotoAndStop(initweap + 1); if (checkpoint == 0) { player.attack = false; } else { player.attack = true; } } player.ammopip._visible = false; } }; sound_delay = 0; _global.playSoundLim = function () { if (sound_delay == 0) { if (sound == true) { soundmap.gotoAndStop(arguments[random(arguments.length)]); sound_delay = 3; } } }; _global.playSound = function () { if (sound == true) { soundmap.gotoAndStop(arguments[random(arguments.length)]); } }; var musicVol = new Sound(musicmap); muzcur = 'game'; playMusic = function (z, type) { trace(z); muzfade = 0; muzvol = 50; musicVol.setVolume(muzvol); if (muzcur != z || type == true) { musicmap.gotoAndStop('stop'); if (music == true) { switch (z) { case 'boss': case 'menu': case 'bonus': musicmap.gotoAndStop(z); break; case 'game': musicmap.gotoAndStop('muz' + muznum); } } muzcur = z; } }; setUpgrCost = function (type, numb) { return Math.round(upgrtext[type][numb][0] * ((upgr[type][numb] + 1) * (upgr[[type]][numb] + 1) + (upgr[[type]][numb] + 1))); }; setWeapCost = function (type) { return Math.round(changecost * ((type + 1) * (type + 1) + (type + 1))); }; initUpgr = function (numb, type) { _root.money += 0; i = 1; while (i <= 3) { opt['canico' + i]._visible = false; if (levelnew[0] == i) { opt['newico' + i]._visible = true; } else { opt['newico' + i]._visible = false; if (i != numb) { if (getCanUpgr(i)) { opt['canico' + i]._visible = true; } } } ++i; } if (opt.select != numb) { opt.select = numb; opt.upgr.gotoAndStop(numb); type = true; } else { type = false; } opt.upgr.selsymb.gotoAndPlay(2); i = 0; while (i < 12) { z = opt.upgr['b' + i]; z.id = i; z.cost = setUpgrCost(numb, i); if (upgrin[numb][i] > plrlvl) { z.gotoAndStop(1); z.img.gotoAndStop(4); z.img.needtxt.text = 'Reach level ' + upgrin[numb][i] + ' to unlock'; } else { if (upgr[numb][i] >= upgrmax[numb][i]) { z.gotoAndStop(1); z.img.gotoAndStop(2); } else { if (money < z.cost) { z.gotoAndStop(1); z.img.gotoAndStop(3); } else { z.img.gotoAndStop(1); } } } z.img.costtxt.text = '$' + z.cost; z.img.titletxt.text = upgrtext[numb][i][1].toUpperCase(); z.img.icon.gotoAndStop(numb); z.img.icon.img.gotoAndStop(i + 1); z.img.lvl.gotoAndStop(upgrmax[numb][i]); z.img.lvl.img.gotoAndStop(upgr[numb][i] + 1); if (type == true) { z.img.timer = Math.round((z._x + z._y + 400) / 60); z.img._visible = false; } if (levelnew[0] == numb && levelnew[1] == i) { z.newico._visible = true; levelnew = [0, 0]; } else { z.newico._visible = false; } ++i; } if (numb == 2) { z = opt.upgr.weap; if (startweap >= 7) { z.gotoAndStop(4); } else { if (upgrin[2][startweap + 2] > plrlvl) { z.gotoAndStop(3); z.needtxt.text = 'Reach level ' + upgrin[2][startweap + 2] + ' to unlock'; } else { z.cost = setWeapCost(startweap + 1); if (money < z.cost) { z.gotoAndStop(2); } else { z.gotoAndStop(1); } z.costtxt.text = '$' + z.cost; } z.weap1.gotoAndStop(startweap + 1); z.weap2.gotoAndStop(startweap + 2); } } }; doUpgr = function (z) { playSound('shop'); z.img.eff.gotoAndPlay(2); money = Math.round(money - z.cost); ++upgr[opt.select][z.id]; setStat(17 + opt.select, getUpgrDone(opt.select)); savenow = true; my_so.data.money = money; kongsend('upgrade', stat[18] + stat[19] + stat[20] + stat[24]); initUpgr(opt.select, false); trace(money); }; doChange = function (z) { playSound('shop'); money = Math.round(money - z.cost); ++startweap; setStat(24, startweap); savenow = true; my_so.data.money = money; kongsend('upgrade', stat[18] + stat[19] + stat[20] + stat[24]); initUpgr(opt.select, false); }; getUpgrDone = function (type) { var v2 = 0; i = 0; while (i < upgr[type].length) { v2 += upgr[type][i]; ++i; } trace('upgr' + type + ' = ' + v2); return v2; }; getCanUpgr = function (type) { if (type == 2) { if (startweap < 7) { if (upgrin[2][startweap + 2] <= plrlvl) { if (setWeapCost(startweap + 1) <= money) { trace('setWeapCost ' + type + ' ' + ii); return true; } } } } ii = 0; while (ii < upgr[type].length) { if (upgrin[type][ii] <= plrlvl) { if (upgr[type][ii] < upgrmax[type][ii]) { if (setUpgrCost(type, ii) <= money) { trace('setUpgrCost ' + type + ' ' + ii); return true; } } } ++ii; } return false; }; initFuel = function () { _root.money3 += 0; i = 1; while (i <= 4) { z = opt['j' + i]; z.id = i; z.cost = 0; if (jetpack >= i) { z.gotoAndStop(1); z.img.gotoAndStop(2); } else { if (minigame == 6) { z.cost = fueltext[i - jetpack][0] * 10; } else { z.cost = fueltext[i - jetpack][0] * lvl; } if (money3 < z.cost) { z.gotoAndStop(1); z.img.gotoAndStop(3); } else { z.img.gotoAndStop(1); } } if (minigame == 6) { z.desc = fueltext[i][4]; z.img.titletxt.text = fueltext[i][3]; } else { z.desc = fueltext[i][2]; z.img.titletxt.text = fueltext[i][1]; } z.img.costtxt.text = z.cost + ' Fuel'; ++i; } }; initPowup = function () { _root.money2 += 0; i = 0; while (i <= 4) { z = opt['p' + i]; z.id = i; if (minigame == 6) { z.cost = powuptext[i][0] * 5; } else { z.cost = powuptext[i][0] * lvl; } if (powbonus[i] > 0) { z.gotoAndStop(1); z.img.gotoAndStop(2); } else { if (upgrin[4][i] > plrlvl) { z.gotoAndStop(1); z.img.gotoAndStop(4); z.img.needtxt.text = 'Reach level ' + upgrin[4][i] + ' to unlock'; } else { if (money2 < z.cost) { z.gotoAndStop(1); z.img.gotoAndStop(3); } else { z.img.gotoAndStop(1); } } } z.desc = powuptext[i][2]; z.img.titletxt.text = powuptext[i][1].toUpperCase(); z.img.costtxt.text = z.cost + ' Gems'; z.img.icon.gotoAndStop(i + 1); if (levelnew[0] == 4 && levelnew[1] == i) { z.newico._visible = true; levelnew = [0, 0]; } else { z.newico._visible = false; } ++i; } }; doFuel = function (z) { playSound('shop'); z.img.eff.gotoAndPlay(2); money3 = Math.round(money3 - z.cost); jetpack = z.id; initFuel(); }; doPowup = function (z) { playSound('shop'); z.img.eff.gotoAndPlay(2); money2 = Math.round(money2 - z.cost); setPowup(z.id, true); addStat(28, 1); initPowup(); }; setPowup = function (numb, type) { trace('set pow' + numb); powbonus[numb] = 1; switch (numb) { case 0: if (type) { playSound('powmagnet'); } unlimmagnet = 1; createPart(player._x, player._y, 'powermagnetpart', 1); break; case 1: if (type) { playSound('key'); } doubleincome = 1; break; case 2: if (type) { playSound('powunlim'); } doubledamage = 1; createPart(player._x, player._y, 'powerammopart', 1); break; case 3: if (type) { playSound('powheal'); } morehealth = 1; life += 60; maxlife = life; inter.life.msk.gotoAndStop(maxlife / 20 - 4); inter.life.bord.gotoAndStop(maxlife / 20 - 4); break; case 4: if (type) { playSound('jumpd'); } unlimjump = 1; } }; arrayShuffle = function (arr) { var v1 = new Array(); var v2 = new Array(); v1 = arr.slice(); while (v1.length > 0) { v2.push((v1.splice(Math.round(Math.random() * (v1.length - 1)), 1))[0]); } return v2; }; prizeTxt = new Array(); prizeTxt[0] = 'EMPTY'; prizeTxt[1] = 'Big Magnet in next stage'; prizeTxt[2] = 'Double Coins in next stage'; prizeTxt[3] = 'Double Damage in next stage'; prizeTxt[4] = 'More Health in next stage'; prizeTxt[5] = 'Unlimited Jumps in next stage'; prizeTxt[6] = 'All Power-ups in next stage'; prizeTxt[7] = 'Revive with 25% health'; prizeTxt[8] = 'Revive with 50% health'; prizeTxt[9] = 'Revive with full health'; prizeTxt[10] = '+200 Coins'; prizeTxt[11] = '+500 Coins'; prizeTxt[12] = '+1000 Coins'; prizeTxt[13] = '+2500 Coins'; prizeTxt[14] = '+30 Gems'; prizeTxt[15] = '+75 Gems'; prizeTxt[16] = '+150 Gems'; prizeTxt[17] = '+300 Gems'; prizeTxt[18] = '+10 Fuel'; prizeTxt[19] = '+25 Fuel'; prizeTxt[20] = '+50 Fuel'; prizeTxt[21] = '+100 Fuel'; prizeTxt[22] = '+2 Keys'; prizeTxt[23] = '+4 Keys'; prizeTxt[24] = '+6 Keys'; prizeTxt[25] = '+10 Keys'; bonusBank = new Array(); bonusBank[1] = [0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 14, 18, 22, 1, 2, 3]; bonusBank[2] = [0, 0, 0, 11, 11, 11, 15, 19, 23, 7, 7, 7, 2, 3, 4]; bonusBank[3] = [0, 0, 12, 12, 16, 20, 24, 8, 8, 3, 4, 5]; bonusBank[4] = [0]; bonusBank[5] = [0, 13, 17, 21, 25, 9, 9, 6]; safearr = [0, 4, 3, 2, 0, 1]; initBonus = function (type) { var v3 = new Array(); var v1 = 5; var v2 = false; j = 1; while (j <= 5) { if (type == 1) { v3 = arrayShuffle(bonusBank[j]); } i = 1; while (i <= safearr[j]) { zz = ispausedobj['s' + j + i]; z = ispausedobj['s' + j + i].img; z.keys = j; z.keytxt.text = ''; if (type == 1) { v2 = true; z.prize = v3[i]; if (win == true) { if (z.prize >= 7 && z.prize <= 9) { z.prize += 4; } } z.prizeimg.txt.text = prizeTxt[z.prize]; z.prizeimg._visible = false; z.open = false; v1 = 1; z.keytxt._visible = false; z.door._visible = true; z.keyimg._visible = true; if (zz._x == 400) { z.cont.gotoAndStop(3); } else { if (zz._x < 400) { if (zz._x < 250) { z.cont.gotoAndStop(1); } else { z.cont.gotoAndStop(2); } } else { if (zz._x > 550) { z.cont.gotoAndStop(5); } else { z.cont.gotoAndStop(4); } } } } else { if (z.open == false) { v2 = true; if (j < v1) { v1 = j; } } } if (stars >= j && isRespawn != true) { zz.gotoAndStop(1); if (z.open == false) { z.canopen = true; z.keytxt.text = 'Open Container?'; } else { z.canopen = false; } } else { z.canopen = false; if (z.open == false) { zz.gotoAndStop(3); z.keytxt.text = 'Not Enough Keys'; } } z.gotoAndStop(j); z.keyimg.gotoAndStop(j); ++i; } ++j; } if (stars < v1 || v2 == false) { if (isRespawn != true) { setTimeout(gotoUpgrQuest, 1500); } } }; setRespawn = function (type, txt) { isRespawn = true; respawneff.gotoAndPlay(2); respawneff.perctxt.text = txt + ' HEALTH'; setTimeout(playerRespawn, 1200); life = Math.round(type); playSound('respawn'); }; playerRespawn = function () { playMusic('game'); player.die = true; player.dam = player.maxdam; diedelay = 30; maxlvlspeed = oldlvlspeed; isRespawn = false; ispausedobj.gotoAndStop(1); ispause = false; ispausedobj._visible = false; flashobj.gotoAndPlay(2); }; getBonus = function (type) { switch (type) { case 1: case 2: case 3: case 4: case 5: powbonus[type - 1] = 1; break; case 6: powbonus[0] = 1; powbonus[1] = 1; powbonus[2] = 1; powbonus[3] = 1; powbonus[4] = 1; break; case 7: setRespawn(maxlife / 4, '25%'); break; case 8: setRespawn(maxlife / 2, '50%'); break; case 9: setRespawn(maxlife, 'FULL'); break; case 10: money += 200; break; case 11: money += 500; break; case 12: money += 1000; break; case 13: money += 2500; break; case 14: money2 += 30; break; case 15: money2 += 75; break; case 16: money2 += 150; break; case 17: money2 += 300; break; case 18: money3 += 10; break; case 19: money3 += 25; break; case 20: money3 += 50; break; case 21: money3 += 100; break; case 22: stars += 2; break; case 23: stars += 4; break; case 24: stars += 6; break; case 25: stars += 10; } initBonus(); }; gotoUpgrQuest = function () { muzfade = 5; if (tocongrat == 1) { openScreen('congrat1'); } else { if (testCompQuest()) { opt.nexttar = 'upgr'; openScreen('quest'); } else { savenow = true; openScreen('upgr'); } } }; gotoSelectQuest = function () { muzfade = 5; if (testCompQuest()) { opt.nexttar = 'select'; openScreen('quest'); } else { savenow = true; openScreen('select'); } }; menuanim1 = new Array(); menuanim1[0] = [70, 70, 30]; menuanim1[1] = [90, 80, 70]; menuanim1[2] = [105, 85, 100]; menuanim1[3] = [110, 90, 100]; menuanim1[4] = [105, 95, 100]; menuanim1[5] = [100, 100, 100]; menuanim1[6] = [97, 103, 100]; menuanim1[7] = [94, 106, 100]; menuanim1[8] = [97, 103, 100]; menuanim1[9] = [100, 100, 100]; menuanim1[10] = [103, 97, 100]; menuanim1[11] = [100, 100, 100]; menuanim2 = new Array(); menuanim2[0] = [90, 90, 80]; menuanim2[1] = [80, 80, 50]; menuanim2[2] = [70, 70, 20]; closeMenu = function () { opt.timerx1 = 0; opt.timerx2 = 0; opt.anim = true; opt.backtar = opt.tar; opt.tar = 'exit'; opt.gotoAndStop('exit'); loadLevel = true; _root.trans.gotoAndPlay(2); }; openMenu = function (info) { opt.timerx1 = 0; opt.timerx2 = 0; opt.backtar = opt.tar; opt.tar = info; opt.close = true; opt.anim = true; }; openScreen = function (info) { if (trans._currentframe == 1) { opt.timerx1 = _root.menuanim1.length - 1; opt.timerx2 = _root.menuanim2.length - 1; opt.backtar = opt.tar; opt.tar = info; opt.close = true; opt.anim = false; _root.trans.gotoAndPlay(2); } }; getMoreText = function () { return choose('Epic Games', 'Action Games', 'Extra Games', 'More Games', 'Fun Games', 'Great Games', 'Free Games', 'Play More', 'Other Games'); }; var my_so = SharedObject.getLocal('cyberchasersave', '/'); saveStat = function () { trace('SAVE STAT...'); i = 0; while (i < lvlsave.length) { my_so.data['lvlsave' + i] = lvlsave[i]; ++i; } i = 0; while (i < upgr.length) { my_so.data['upgr' + i] = upgr[i]; ++i; } i = 0; while (i < curquest.length) { my_so.data['curquest' + i] = curquest[i]; ++i; } my_so.data.stat = stat; trace('save stat ' + my_so.data.stat); my_so.data.sound = sound; my_so.data.music = music; my_so.data.startweap = startweap; my_so.data.plrlvl = plrlvl; my_so.data.plrstar = plrstar; my_so.data.money = money; my_so.data.money2 = money2; my_so.data.money3 = money3; my_so.data.episodenew = episodenew; my_so.data.levelnew = levelnew; my_so.data.powbonus = powbonus; my_so.data.firstlaunch = firstlaunch; my_so.data.istutor = istutor; my_so.data.ishelp = ishelp; my_so.flush(); if (kongapi == true) { kongsend('level', plrlvl); kongsend('quest', getQuestCount()); kongsend('challenge', stat[25]); kongsend('upgrade', stat[18] + stat[19] + stat[20] + stat[24]); kongsend('survival', stat[16]); } }; loadStat = function () { i = 0; while (i < lvlsave.length) { lvlsave[i] = my_so.data['lvlsave' + i]; ++i; } i = 0; while (i < upgr.length) { upgr[i] = my_so.data['upgr' + i]; ++i; } i = 0; while (i < curquest.length) { curquest[i] = my_so.data['curquest' + i]; ++i; } stat = my_so.data.stat; trace('load stat ' + stat); sound = my_so.data.sound; music = my_so.data.music; startweap = my_so.data.startweap; plrlvl = my_so.data.plrlvl; plrstar = my_so.data.plrstar; money = my_so.data.money; money2 = my_so.data.money2; money3 = my_so.data.money3; episodenew = my_so.data.episodenew; levelnew = my_so.data.levelnew; powbonus = my_so.data.powbonus; firstlaunch = my_so.data.firstlaunch; istutor = my_so.data.istutor; ishelp = my_so.data.ishelp; }; resetStat = function () { lvlsave[0] = [undefined, 0, 0, 0]; lvlsave[1] = [undefined, 0, 0, 0]; lvlsave[2] = [undefined, 0, 0, 0]; lvlsave[3] = [undefined, 0, 0, 0]; lvlsave[4] = [undefined, 0, 0, 0]; lvlsave[5] = [undefined, 0, 0, 0]; upgr[1] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; upgr[2] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; upgr[3] = [0, 0, 0, 0, 0, 0, 0, 0]; upgr[4] = [0, 0, 0, 0, 0]; curquest = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]; i = 0; while (i < questtxt.length) { stat[i] = 0; trace(stat[i]); ++i; } trace('reset stat ' + stat); setQuest(0, true); setQuest(1, true); setQuest(2, true); startweap = 0; plrlvl = 1; plrstar = 0; money = 0; money2 = 0; money3 = 0; episodenew = 1; levelnew = [0, 0]; powbonus = [0, 0, 0, 0, 0]; firstlaunch = true; istutor = true; ishelp = [true, true, true, true, true, true, true]; saveStat(); }; trace('before load ' + stat); if (my_so.data.firstlaunch == undefined) { saveStat(); } else { loadStat(); } trace('powbonus ' + powbonus); trace('ishelp ' + ishelp); setQuest(0, true); setQuest(1, true); setQuest(2, true); gotoAndStop('function'); } movieClip 1997 { } movieClip 1999 { } movieClip 2001 { } movieClip 2003 { } movieClip 2005 { } movieClip 2006 { frame 1 { stop(); } } movieClip 2010 { frame 1 { stop(); } } movieClip 2011 { frame 1 { stop(); } } movieClip 2015 { frame 1 { stop(); } } movieClip 2016 { frame 1 { stop(); } } movieClip 2019 { } movieClip 2024 { frame 1 { stop(); onEnterFrame = function () { if (_root.ispause == false) { img1._x -= Math.round(_root.lvlspeed / 4); img2._x -= Math.round(_root.lvlspeed / 8); if (img1._x < -_root.lvlw) { img1._x += _root.lvlw; } if (img2._x < -_root.lvlw) { img2._x += _root.lvlw; } } }; } } movieClip 2101 { frame 1 { stop(); } frame 2 { gotoAndStop(1); } frame 3 { gotoAndStop(1); } frame 4 { gotoAndStop(1); } frame 5 { gotoAndStop(1); } frame 6 { gotoAndStop(1); } frame 7 { gotoAndStop(1); } frame 8 { gotoAndStop(1); } frame 9 { gotoAndStop(1); } frame 10 { gotoAndStop(1); } frame 11 { gotoAndStop(1); } frame 12 { gotoAndStop(1); } frame 13 { gotoAndStop(1); } frame 14 { gotoAndStop(1); } frame 15 { gotoAndStop(1); } frame 16 { gotoAndStop(1); } frame 17 { gotoAndStop(1); } frame 18 { gotoAndStop(1); } frame 19 { gotoAndStop(1); } frame 20 { gotoAndStop(1); } frame 21 { gotoAndStop(1); } frame 22 { gotoAndStop(1); } frame 23 { gotoAndStop(1); } frame 24 { gotoAndStop(1); } frame 25 { gotoAndStop(1); } frame 26 { gotoAndStop(1); } frame 27 { gotoAndStop(1); } frame 28 { gotoAndStop(1); } frame 29 { gotoAndStop(1); } frame 30 { gotoAndStop(1); } frame 31 { gotoAndStop(1); } frame 32 { gotoAndStop(1); } frame 33 { gotoAndStop(1); } frame 34 { gotoAndStop(1); } frame 35 { gotoAndStop(1); } frame 36 { gotoAndStop(1); } frame 37 { gotoAndStop(1); } frame 38 { gotoAndStop(1); } frame 39 { gotoAndStop(1); } frame 40 { gotoAndStop(1); } frame 41 { gotoAndStop(1); } frame 42 { gotoAndStop(1); } frame 43 { gotoAndStop(1); } frame 44 { gotoAndStop(1); } frame 45 { gotoAndStop(1); } frame 46 { gotoAndStop(1); } frame 47 { gotoAndStop(1); } frame 48 { gotoAndStop(1); } frame 49 { gotoAndStop(1); } frame 50 { gotoAndStop(1); } frame 51 { gotoAndStop(1); } frame 52 { gotoAndStop(1); } frame 53 { gotoAndStop(1); } frame 54 { gotoAndStop(1); } frame 55 { gotoAndStop(1); } frame 56 { gotoAndStop(1); } frame 57 { gotoAndStop(1); } frame 58 { gotoAndStop(1); } frame 59 { gotoAndStop(1); } frame 60 { gotoAndStop(1); } frame 61 { gotoAndStop(1); } frame 62 { gotoAndStop(1); } frame 63 { gotoAndStop(1); } frame 64 { gotoAndStop(1); } frame 65 { gotoAndStop(1); } frame 66 { gotoAndStop(1); } frame 67 { gotoAndStop(1); } frame 68 { gotoAndStop(1); } frame 69 { gotoAndStop(1); } frame 70 { gotoAndStop(1); } frame 71 { gotoAndStop(1); } frame 72 { gotoAndStop(1); } frame 73 { gotoAndStop(1); } frame 74 { gotoAndStop(1); } frame 75 { gotoAndStop(1); } frame 76 { gotoAndStop(1); } frame 77 { gotoAndStop(1); } } movieClip 2108 { frame 1 { stop(); } frame 2 { gotoAndStop(1); } frame 7 { gotoAndStop(1); } } movieClip 2111 { } movieClip 2112 { } movieClip 2114 { } movieClip 2115 { frame 1 { stop(); } frame 23 { playSound('explo31', 'explo32'); } frame 28 { _root.doEmp(); } } movieClip 2138 { } movieClip 2141 { } movieClip 2142 { frame 1 { stop(); } } movieClip 2143 { frame 1 { stop(); onEnterFrame = null; } frame 2 { stop(); _x = -100; _y = 100; reload = 15; timer = 0; attack = reload; speed = 1; onEnterFrame = function () { if (_root.ispause == false) { if (_root.powerplane) { if (timer) { --timer; } else { xx = random(100) + 100; yy = random(100) + 100; timer = 30; } if (attack) { --attack; } else { if (_root.enemyBank.length || _root.cargoBank.length) { playSound('weap81', 'weap82'); _root.createPowerBullet(this, 8, fx1); _root.createPowerBullet(this, 8, fx2); fx1.gotoAndPlay(2); fx2.gotoAndPlay(2); attack = reload; } } } else { xx = -200; if (_x < -100) { gotoAndStop(1); } } dir = point_direction(_x, _y, xx, yy); dist = point_distance(_x, _y, xx, yy); if (dist > 5) { spd = Math.max(speed, dist / 40); _x = _x + Math.round(lengthdir_x(spd, dir)); _y = _y - Math.round(lengthdir_y(spd, dir)); } } }; } } movieClip 2168 { } movieClip 2171 { } movieClip 2172 { frame 1 { stop(); } } movieClip 2173 { frame 1 { stop(); onEnterFrame = null; } frame 2 { stop(); _x = -100; _y = 100; ammo = 3; reload = 40; timer = 0; attack = reload; speed = 1; delay = 0; shell = ammo; onEnterFrame = function () { if (_root.ispause == false) { if (_root.powerheli) { if (timer) { --timer; } else { xx = random(100) + 150; yy = random(100) + 150; timer = 30; } if (attack) { --attack; } else { if (shell) { if (delay) { --delay; } else { playSound('weap41', 'weap42'); delay = 3; --shell; _root.createPowerBullet(this, 4, fx1, 'heli'); _root.createPowerBullet(this, 4, fx2, 'heli'); fx1.gotoAndPlay(2); fx2.gotoAndPlay(2); } } else { attack = reload; shell = ammo; } } } else { xx = -200; if (_x < -100) { gotoAndStop(1); } } dir = point_direction(_x, _y, xx, yy); dist = point_distance(_x, _y, xx, yy); if (dist > 5) { spd = Math.max(speed, dist / 40); _x = _x + Math.round(lengthdir_x(spd, dir)); _y = _y - Math.round(lengthdir_y(spd, dir)); } } }; } } movieClip 2174 { } movieClip 2176 { } movieClip 2178 { frame 1 { stop(); } } movieClip 2179 { frame 1 { stop(); } } movieClip 2182 { } movieClip 2183 { frame 1 { stop(); } } movieClip 2186 { } movieClip 2187 { frame 1 { stop(); } } movieClip 2190 { } movieClip 2191 { frame 1 { stop(); } } movieClip 2192 { frame 1 { stop(); } } movieClip 2193 { frame 1 { stop(); } frame 5 { gotoAndStop(1); } frame 6 { play(); img.fx.gotoAndStop(1); } } movieClip 2197 { } movieClip 2199 { } movieClip 2280 { } movieClip 2303 { frame 16 { gotoAndPlay(6); } } movieClip 2322 { frame 13 { gotoAndPlay(5); } } movieClip 2339 { frame 12 { gotoAndPlay(4); } } movieClip 2342 { } movieClip 2343 { frame 6 { _parent.gotoAndStop(2); } } movieClip 2355 { frame 7 { _parent.gotoAndStop(2); } } movieClip 2380 { frame 13 { if (_parent.slide == true) { _parent.gotoAndStop('slide'); } else { _parent.gotoAndStop(2); } } } movieClip 2390 { } movieClip 2405 { frame 12 { gotoAndPlay(4); } } movieClip 2406 { frame 1 { w = 50; h = 80; obj = this; dam = 0; maxdam = 50; attack = false; candrop = true; canjump = true; shield._visible = false; shieldtime = 0; hspeed = 0; maxhspeed = 25; gravy = 3; jspeed = -30; jump = false; dropspeed = 50; drop = false; djump = _root.djump; slide = false; slideon = false; reload = 0; idle = 0; die = false; weap = 0; imgind = 1; spreaddir = 0; spreadang = 0; collFoot = function () { _y = z._y; if (_currentframe == 5 || _currentframe == 6 || _currentframe == 10) { gotoAndStop('stand'); playSound('land', 'land2'); if (drop == false) { _root.createPart(_x - 25, _y, 'dustpart', 1); } else { _root.createPart(_x - 25, _y, 'dustpart', 1, 'drop'); _root.quake += 5; } } drop = false; jump = false; djump = _root.djump; hspeed = 0; }; collFree = function () { jump = true; if (hspeed > 3) { gotoAndStop('fall'); } }; collBody = function () { if (!die) { _root.playerDamage(1); } }; collPit = function () { if (!die) { _root.playerDamage(2); } }; onEnterFrame = function () { if (_root.ispause == false) { if (_currentframe == 2) { imgind = Math.round(imgind + _root.lvlspeed / 5); if (imgind >= img._totalframes) { imgind -= 39; } img.gotoAndStop(imgind); } else { imgind = 1; } if (_root.xregen > 0) { if (_root.life < _root.maxlife) { if (_root.msec == 0) { if (_root.sec % 2 == 0) { _root.life = Math.min(_root.maxlife, _root.life + _root.regenamount); } } } } if (reload > 0) { --reload; } if (shieldtime > 0) { --shieldtime; } else { shield._visible = false; } if (dam > 0) { --dam; if (dam % 2 == 0) { _alpha = 10; } else { _alpha = 60; } } else { _alpha = 100; } if (_visible) { if (attack) { if (reload < 1) { playSound('weap' + weap + '1', 'weap' + weap + '2'); _root.addStat(8, 1); if (weapon._currentframe < 6) { weapon.gotoAndPlay(2); } weapon.img.fx.gotoAndPlay(2); reload = _root.reloadtime[weap]; if (weap == 0) { _root.createPart(_x - 20, _y - 50, 'clippart', 2, 1); i = 2; while (i--) { _root.createBullet(obj, weap, i); } } else { switch (weap) { case 1: i = 4 + _root.shotupgr; _root.createPart(_x - 20, _y - 50, 'clippart', 1, 2); while (i--) { _root.createBullet(obj, weap, i); } break; case 2: _root.createPart(_x - 20, _y - 50, 'clippart', 1, 1); _root.createBullet(obj, weap, i); reload -= _root.gunupgr; break; case 3: i = 3; while (i--) { _root.createBullet(obj, weap, i); } break; case 4: _root.createPart(_x - 20, _y - 50, 'clippart', 1, 1); _root.createBullet(obj, weap); reload -= _root.gaussupgr; break; case 5: if (spreadang == 0) { if (spreaddir < 15) { spreaddir += 5; } else { spreadang = 1; } } else { if (spreaddir > -5) { spreaddir -= 5; } else { spreadang = 0; } } _root.createBullet(obj, weap, spreaddir); break; case 8: _root.createBullet(obj, weap); reload -= _root.rocketupgr * 3; break; default: _root.createBullet(obj, weap); } if (_root.ammo == 0) { ammopip._visible = false; ammopip._alpha = 100; weap = _root.startweap; _root.ammo = -1; weapon.gotoAndPlay(6); weapon.img.gotoAndStop(_root.startweap + 1); weapon.img.fx.gotoAndPlay(2); } } } } else { spreaddir = 0; spreadang = 0; } i = 0; while (i < _root.blockBank.length) { z = _root.blockBank[i]; if (die == false) { if (_y - 10 >= z._y) { if (_y - h < z._y + z.h) { if (_x > z._x) { if (_x - w < z._x + z.w) { collBody(); } } } } if (hspeed >= 0) { if (_y + hspeed >= z._y) { if (_y - h < z._y + z.h) { if (_x > z._x) { if (_x - w < z._x + z.w) { collFoot(); break; } else { collFree(); } } } } } } ++i; } if (_y > _root.lvlh + 50) { collPit(); } i = 0; while (i < _root.enemyBank.length) { z = _root.enemyBank[i]; if (_x > z._x - z.w) { if (_x - w < z._x) { if (hspeed > 0) { if (_y + hspeed > z._y - z.h) { if (_y - hspeed < z._y - z.h) { if (z.isBoss) { _root.addStat(11, 1); } else { if (z.isEnemy) { _root.addStat(1, 1); } } _root.enemyDamage(z, _root.bootdamage); hspeed = -20; djump = _root.djump; drop = false; gotoAndStop('jump'); _root.createPart(_x - 25, _y - 10, 'jumppart', 1); break; } } } if (_y > z._y - z.h) { if (_y - h < z._y) { if (z.isWall) { _root.enemyDamage(z, 999); } if (dam == 0) { if (_root.powerdam == 0) { _root.playerDamage(0, 2); } } } } } } ++i; } i = 0; while (i < _root.cargoBank.length) { z = _root.cargoBank[i]; if (_x > z._x - z.w) { if (_x - w < z._x) { if (hspeed > 0) { if (_y + hspeed > z._y - z.h) { if (_y - hspeed < z._y - z.h) { if (_root.tutortask == 4) { if (drop == true) { _root.tutorFinish(); } _root.cargoDamage(z, 0); } else { _root.cargoDamage(z, _root.bootdamage); } _root.addStat(12, 1); hspeed = -20; djump = _root.djump; drop = false; gotoAndStop('jump'); _root.createPart(_x - 25, _y - 10, 'jumppart', 1); } } } if (z.fly != true) { if (z.drop == false) { if (_y > z._y - z.h) { if (_y - h < z._y) { _root.cargoDamage(z, 0); z.drop = true; playSound('boxf1', 'boxf2'); } } } } } } ++i; } if (jump) { if (hspeed > -3) { if (_currentframe == 4) { gotoAndStop('fall'); } } if (hspeed < maxhspeed) { hspeed += gravy; } _y = _y + hspeed; if (_y < -50) { _y = -45; hspeed = 0; } } if (slideon) { if (!jump) { if (!slide) { _root.addStat(9, 1); slide = true; h = 30; gotoAndStop('slide'); } } else { slide = false; h = 80; } } else { if (slide) { slide = false; h = 80; gotoAndStop('stand'); } } } } }; stop(); } } movieClip 2409 { } movieClip 2412 { } movieClip 2413 { } movieClip 2416 { } movieClip 2419 { } movieClip 2420 { } movieClip 2423 { } movieClip 2426 { } movieClip 2427 { frame 1 { onEnterFrame = null; _visible = false; stop(); } frame 2 { speed = 50; _root.playMusic('game', true); _visible = true; onEnterFrame = function () { back._x -= speed; if (back._x < -900) { back._x = 0; } }; } frame 61 { playSound('d2'); } frame 70 { playSound('enemyland'); _root.muzfade = 1; } frame 76 { speed = 0; playSound('explo32'); playSound('die'); playSound('iron2'); _root.flashobj.gotoAndPlay(2); } frame 79 { _root.createPart(530, 390, 'explopart', 1, 'boss'); } frame 102 { speed = 50; } frame 119 { speed = 40; playSound('d3'); playSound('land2'); } frame 120 { speed = 45; } frame 121 { speed = 40; } frame 122 { speed = 35; } frame 123 { speed = 30; } frame 124 { speed = 25; } frame 125 { speed = 20; } frame 126 { speed = 15; } frame 127 { speed = 10; } frame 128 { speed = 5; } frame 129 { speed = 3; } frame 130 { speed = 2; } frame 131 { speed = 1; } frame 132 { speed = 0; playSound('jetpack'); } frame 149 { _root.createPart(460, 380, 'explopart', 1); } frame 158 { stop(); _root.openScreen('main'); } } movieClip 2442 { } movieClip 2443 { frame 1 { stop(); onEnterFrame = null; } frame 2 { stop(); _x = -100; _y = 100; timer = 0; speed = 5; fly = true; onEnterFrame = function () { if (_root.ispause == false) { _root.createPart(_x - 30, _y - 8, 'smokepart2', 1); ++timer; if (timer % 4 == 0) { _root.quake = 4; } if (maxdist > _root.lvllength) { xx = _root._xmouse; yy = _root._ymouse; } else { if (fly) { xx = 100; yy = -200; fly = false; playSound('jetpackoff'); } if (_y < -50) { gotoAndStop(1); } } dir = point_direction(_x, _y, xx, yy); dist = point_distance(_x, _y, xx, yy); if (dist > 5) { spd = Math.max(speed, dist / 10); _x = _x + Math.round(lengthdir_x(spd, dir)); _y = _y - Math.round(lengthdir_y(spd, dir)); } } }; } } movieClip 2445 { } movieClip 2447 { } movieClip 2454 { frame 1 { stop(); } } movieClip 2459 { } movieClip 2462 { } movieClip 2463 { frame 1 { stop(); } } movieClip 2465 { frame 1 { stop(); _visible = false; } frame 2 { _visible = true; if (_root.lvlsave[_root.minigame][_root.lvl] == 1) { reward.text = 'REWARD: ' + _root.newrewardtxt[_root.minigame][_root.lvl]; } else { reward.text = 'REWARD: ' + _root.rewardtxt[_root.minigame]; } } frame 9 { stop(); } frame 18 { if (_root.chalcomp) { playSound('win'); img.gotoAndStop(2); } else { playSound('failed'); } } frame 23 { stop(); } } movieClip 2466 { frame 1 { stop(); } } movieClip 2467 { frame 1 { stop(); } } movieClip 2471 { } movieClip 2472 { frame 1 { stop(); _visible = false; } frame 2 { _visible = true; } frame 15 { stop(); } } movieClip 2475 { } button 2476 { on (rollOver) { playSound('over'); gotoAndPlay('on'); } on (dragOver) { playSound('over'); gotoAndPlay('on'); } on (rollOut) { gotoAndPlay('off'); } on (dragOut) { gotoAndPlay('off'); } on (press) { playSound('click'); gotoAndPlay('on'); } } movieClip 2478 { } movieClip 2479 { frame 1 { stop(); } frame 7 { stop(); } } button 2480 { on (rollOver) { playSound('over'); gotoAndPlay('on'); } on (dragOver) { playSound('over'); gotoAndPlay('on'); } on (rollOut) { gotoAndPlay('off'); } on (dragOut) { gotoAndPlay('off'); } on (press) { playSound('click'); gotoAndPlay('on'); } } movieClip 2481 { frame 1 { stop(); } frame 7 { stop(); } } button 2482 { on (rollOver) { playSound('over'); gotoAndPlay('on'); } on (dragOver) { playSound('over'); gotoAndPlay('on'); } on (rollOut) { gotoAndPlay('off'); } on (dragOut) { gotoAndPlay('off'); } on (press) { playSound('click'); gotoAndPlay('on'); } } movieClip 2483 { frame 1 { stop(); } frame 7 { stop(); } } button 2484 { on (release) { playSound('click'); getURL(sponsorurl, '_blank'); } } movieClip 2487 { } button 2488 { on (release) { playSound('click'); getURL(devurl, '_blank'); } } movieClip 2490 { } movieClip 2494 { frame 1 { stop(); } frame 2 { play(); } frame 12 { stop(); } } button 2495 { on (rollOver) { if (img._currentframe == 1) { playSound('over'); gotoAndPlay('on'); } _parent.mess.text = _root.upgrtext[_parent._parent.select][id][2]; } on (dragOver) { if (img._currentframe == 1) { playSound('over'); gotoAndPlay('on'); } _parent.mess.text = _root.upgrtext[_parent._parent.select][id][2]; } on (rollOut) { if (img._currentframe == 1) { gotoAndPlay('off'); } _parent.mess.text = ''; } on (dragOut) { if (img._currentframe == 1) { gotoAndPlay('off'); } _parent.mess.text = ''; } on (press) { if (img._currentframe == 1) { gotoAndPlay('on'); _root.doUpgr(this); } } } movieClip 2497 { } movieClip 2518 { frame 1 { stop(); } } movieClip 2520 { frame 1 { stop(); } } movieClip 2521 { frame 1 { stop(); } } movieClip 2522 { } movieClip 2532 { } movieClip 2539 { } movieClip 2545 { } movieClip 2552 { } movieClip 2553 { frame 1 { stop(); } } movieClip 2556 { frame 1 { stop(); } } movieClip 2562 { frame 1 { onEnterFrame = function () { if (_visible == false) { if (timer > 0) { --timer; } else { _visible = true; _parent.gotoAndPlay('crea'); } } else { if (_xscale < 100) { } } }; } } movieClip 2564 { } // unknown tag 88 length 64 movieClip 2567 { } movieClip 2568 { frame 1 { stop(); } frame 7 { stop(); } frame 13 { gotoAndStop(1); } } movieClip 2570 { } movieClip 2573 { } movieClip 2575 { } movieClip 2580 { frame 1 { stop(); isthis = this; bchange.title = 'Change Weapon'; bchange.but.onRelease = function () { _root.doChange(isthis); }; } frame 2 { title = 'Change Weapon'; } frame 3 { title = 'Change Weapon'; } } movieClip 2582 { } movieClip 2583 { frame 1 { stop(); } } movieClip 2585 { } movieClip 2588 { } movieClip 2590 { } button 2591 { on (rollOver) { if (_root.plrlvl < _root.maxlevels) { playSound('over'); gotoAndPlay('on'); } } on (dragOver) { if (_root.plrlvl < _root.maxlevels) { playSound('over'); gotoAndPlay('on'); } } on (rollOut) { if (_root.plrlvl < _root.maxlevels) { gotoAndPlay('off'); } } on (dragOut) { if (_root.plrlvl < _root.maxlevels) { gotoAndPlay('off'); } } } movieClip 2595 { } movieClip 2622 { frame 1 { stop(); } } movieClip 2623 { frame 1 { stop(); } } movieClip 2627 { } movieClip 2628 { frame 1 { stop(); } frame 7 { stop(); } } movieClip 2629 { frame 1 { stop(); } } movieClip 2632 { frame 1 { stop(); } } movieClip 2636 { frame 1 { stop(); } } movieClip 2638 { frame 1 { stop(); } } movieClip 2641 { } movieClip 2646 { } movieClip 2647 { frame 1 { stop(); quests._visible = false; img.title.text = 'QUESTS ' + _root.getQuestCount() + '/' + _root.maxquests; if (_root.plrlvl == _root.maxlevels) { gotoAndStop('locked'); } } frame 2 { quests._visible = true; if (_parent._name == 'ispausedobj') { _root.initQuest(quests, 1); } else { _root.initQuest(quests); } } frame 7 { stop(); } frame 13 { gotoAndStop(1); } frame 14 { quests._visible = false; } } movieClip 2650 { } movieClip 2652 { } button 2653 { on (rollOver) { playSound('over'); gotoAndPlay('on'); _parent.mess.text = desc; _parent.reward.text = reward; } on (dragOver) { playSound('over'); gotoAndPlay('on'); _parent.mess.text = desc; _parent.reward.text = reward; } on (rollOut) { gotoAndPlay('off'); _parent.mess.text = ''; _parent.reward.text = ''; } on (dragOut) { gotoAndPlay('off'); _parent.mess.text = ''; _parent.reward.text = ''; } on (press) { playSound('click'); gotoAndPlay('on'); _parent.mess.text = ''; _parent.reward.text = ''; } } movieClip 2660 { frame 1 { stop(); } } movieClip 2661 { } movieClip 2662 { } movieClip 2665 { } movieClip 2672 { frame 1 { stop(); } } movieClip 2675 { frame 1 { stop(); } } movieClip 2677 { frame 1 { stop(); } frame 7 { stop(); } frame 13 { gotoAndStop(1); } } button 2678 { on (rollOver) { playSound('over'); gotoAndPlay('on'); _parent.mess.text = desc; _parent.reward.text = reward; } on (dragOver) { playSound('over'); gotoAndPlay('on'); _parent.mess.text = desc; _parent.reward.text = reward; } on (rollOut) { gotoAndPlay('off'); _parent.mess.text = ''; _parent.reward.text = ''; } on (dragOut) { gotoAndPlay('off'); _parent.mess.text = ''; _parent.reward.text = ''; } on (press) { playSound('click'); gotoAndPlay('on'); _parent.mess.text = ''; _parent.reward.text = ''; } } movieClip 2680 { } movieClip 2683 { } movieClip 2694 { frame 1 { stop(); } } movieClip 2697 { frame 1 { stop(); } } movieClip 2699 { frame 1 { stop(); } frame 7 { stop(); } frame 13 { gotoAndStop(1); } } button 2703 { on (release) { playSound('click'); getURL(sponsorurl, '_blank'); } } movieClip 2705 { } movieClip 2714 { frame 1 { stop(); } } movieClip 2717 { } movieClip 2718 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { play(); } frame 14 { gotoAndStop(2); } } movieClip 2721 { frame 1 { stop(); onLoad = function () { timer = 0; }; onEnterFrame = function () { if (timer > 0) { --timer; if (timer == 0) { if (exit == true) { _root.savenow = true; if (_root.plrlvl == _root.maxlevels) { _root.tocongrat = 2; _root.openScreen('congrat2'); } else { if (_root.opt.nexttar == 'select') { _root.openScreen('select'); } else { _root.openScreen('upgr'); } } } else { if (levelup == true) { trace('NEW LEVEL'); ++_root.plrlvl; _root.ngmedal(); _root.plrstar = 0; _root.initLvlQuest(this); levelup = false; timer = 70; playSound('quest'); _root.money += _root.getQuestBonus(_root.plrlvl); _parent.levelupeff.lvltxt.text = 'Level ' + _root.plrlvl; _parent.levelupeff.bonustxt.text = '+' + _root.getQuestBonus(_root.plrlvl) + '$'; _parent.levelupeff.gotoAndPlay(2); if (_root.levelin[_root.plrlvl][0] > 0) { new0 = _root.levelin[_root.plrlvl][0]; new1 = _root.levelin[_root.plrlvl][1]; _root.levelnew[0] = new0; _root.levelnew[1] = new1; _parent.levelnew.img.icon.gotoAndStop(new0 + 1); _parent.levelnew.img.icon.img.gotoAndStop(new1 + 1); _parent.levelnew.img.unlocktxt.text = _root.unlocktxt[new0]; switch (new0) { case 1: case 2: case 3: _parent.levelnew.img.title.text = _root.upgrtext[new0][new1][1]; break; case 4: _parent.levelnew.img.title.text = _root.powuptext[new1][1]; break; case 5: case 6: case 7: case 8: case 9: _parent.levelnew.img.icon.gotoAndStop(1); _parent.levelnew.img.icon.img.gotoAndStop(new0 - 4); _parent.levelnew.img.unlocktxt.text = _root.unlocktxt[0]; _parent.levelnew.img.title.text = _root.modetxt[new0 - 4][0] + ' ' + (new1 + 1); } _parent.levelnew.gotoAndPlay(2); } } else { if (stars > 0) { trace('CUR STARS ' + stars); ++_root.plrstar; this['s' + _root.plrstar].gotoAndPlay(3); _parent['q' + curq].star['s' + stars].gotoAndPlay(2); --stars; timer = 15; playSound('key'); if (_root.plrstar == starneed) { trace('GO TO LEVEL UP'); levelup = true; } } else { if (curq != undefined) { trace('QUEST DISSAPEAR'); _parent['q' + curq].gotoAndStop(3); _parent['q' + curq].eff1.gotoAndPlay(2); curq = undefined; timer = 30; } else { trace('TEST COMP QUEST'); i = 0; while (i < 3) { if (_root.curquest[i][0] < _root.maxquest[i]) { if (_root.curquest[i][5] == 1) { _root.curquest[i][5] = 0; curq = i; stars = _root.curquest[i][4]; timer = 30; _parent['q' + curq].gotoAndStop(2); _parent['q' + curq].img.gotoAndStop(4); _parent['q' + curq].eff1.gotoAndPlay(2); _parent['q' + curq].eff2.gotoAndPlay(2); playSound('holy'); trace('COMP QUEST: ' + i); break; } } ++i; } if (stars == 0) { trace('NO STARS EXIT'); exit = true; i = 0; while (i < 3) { if (_parent['q' + i]._currentframe == 3) { _root.setQuest(i); if (_root.curquest[i][5] == 1) { exit = false; timer = 30; } _parent['q' + i].gotoAndStop(1); _parent['q' + i].eff1.gotoAndPlay(2); _parent['q' + i].eff2.gotoAndPlay(2); } ++i; } playSound('coin1', 'coin2'); _root.initQuest(_parent); if (exit == true) { timer = 60; } } } } } } } } }; } } movieClip 2723 { } movieClip 2726 { } movieClip 2729 { } movieClip 2731 { } movieClip 2732 { frame 1 { _visible = false; stop(); } frame 2 { _visible = true; } } movieClip 2733 { frame 1 { stop(); } } movieClip 2735 { frame 1 { stop(); } } movieClip 2736 { frame 1 { stop(); } } movieClip 2739 { } movieClip 2742 { } movieClip 2743 { frame 1 { stop(); _visible = false; } frame 2 { _visible = false; } frame 25 { _visible = true; } frame 38 { stop(); } } button 2747 { on (rollOver) { playSound('click'); } on (release) { getURL('http://www.silengames.com', '_blank'); playSound('click'); } } button 2761 { on (release) { playSound('click'); getURL('http://www.facebook.com/silengames', '_blank'); } } button 2764 { on (release) { playSound('click'); getURL('http://www.twitter.com/silengames', '_blank'); } } movieClip 2766 { } movieClip 2768 { } button 2769 { on (rollOver) { if (img._currentframe == 1) { playSound('over'); gotoAndPlay('on'); } _parent.mess.text = desc; } on (dragOver) { if (img._currentframe == 1) { playSound('over'); gotoAndPlay('on'); } _parent.mess.text = desc; } on (rollOut) { if (img._currentframe == 1) { gotoAndPlay('off'); } _parent.mess.text = ''; } on (dragOut) { if (img._currentframe == 1) { gotoAndPlay('off'); } _parent.mess.text = ''; } on (press) { if (img._currentframe == 1) { gotoAndPlay('on'); _root.doPowup(this); } } } movieClip 2778 { } movieClip 2779 { frame 1 { stop(); } frame 7 { stop(); } frame 13 { gotoAndStop(1); } } movieClip 2783 { } button 2784 { on (rollOver) { if (img._currentframe == 1) { playSound('over'); gotoAndPlay('on'); } _parent.mess.text = desc; } on (dragOver) { if (img._currentframe == 1) { playSound('over'); gotoAndPlay('on'); } _parent.mess.text = desc; } on (rollOut) { if (img._currentframe == 1) { gotoAndPlay('off'); } _parent.mess.text = ''; } on (dragOut) { if (img._currentframe == 1) { gotoAndPlay('off'); } _parent.mess.text = ''; } on (press) { if (img._currentframe == 1) { gotoAndPlay('on'); _root.doFuel(this); } } } movieClip 2790 { } movieClip 2795 { frame 1 { stop(); } } movieClip 2800 { frame 3 { imgb.gotoAndStop(1); } } movieClip 2801 { frame 1 { stop(); } frame 7 { stop(); } frame 13 { gotoAndStop(1); } } button 2809 { on (press) { playSound('over'); _root.gotoUpgrQuest(); } } movieClip 2811 { } movieClip 2812 { } button 2813 { on (press) { playSound('over'); _root.openScreen('upgr'); } } movieClip 2814 { frame 1 { stop(); timerx1 = 0; timerx2 = 0; timer1 = _root.menuanim1.length; timer2 = _root.menuanim2.length; timer = 0; close = true; anim = true; tar = 'exit'; gotoAndStop('exit'); onEnterFrame = function () { if (close == false) { if (anim == true) { if (timerx1 < timer1) { trace(timerx1 + '--' + timer1); _yscale = _root.menuanim1[timerx1][0]; _xscale = _root.menuanim1[timerx1][1]; _alpha = _root.menuanim1[timerx1][2]; ++timerx1; } } } else { if (anim == true) { if (timerx2 < timer2) { trace(timerx2 + '--' + timer2); _yscale = _root.menuanim2[timerx2][0]; _xscale = _root.menuanim2[timerx2][1]; _alpha = _root.menuanim2[timerx2][2]; ++timerx2; } else { if (_currentframe != tar) { close = false; gotoAndStop(tar); } } } else { if (_root.trans._currentframe == 18) { if (_currentframe != tar) { close = false; gotoAndStop(tar); } } } } }; } frame 2 { _root.playMusic('boss'); bmore.title = _root.getMoreText(); bmore.but.onRelease = function () { getURL(sponsorurl, '_blank'); }; b1.title = 'START GAME'; b2.title = 'Credits'; b3.title = 'Reset Game'; b4.title = 'View Intro'; b1.but.onRelease = function () { _root.muzfade = 5; _root.openScreen('select'); }; b2.but.onRelease = function () { _root.openScreen('credit'); }; b3.but.onRelease = function () { _root.openScreen('reset'); }; b4.but.onRelease = function () { _root.openScreen('comix'); }; } frame 10 { _root.playMusic('menu'); bmore.title = _root.getMoreText(); bmore.but.onRelease = function () { getURL(sponsorurl, '_blank'); }; if (_root.levelnew[0] > 4 || _root.episodenew > 1) { newicochal1._visible = true; newicochal2._visible = true; } else { newicochal1._visible = false; newicochal2._visible = false; } upgr.mess.text = ''; if (backtar == 'select') { _root.prelvlcomp = false; btry._visible = false; ttry._visible = false; } else { btry._visible = true; ttry._visible = true; } if (_root.prelvlcomp) { btry.title = 'CONTINUE'; b2.title = 'Restart Stage'; newicochal2._visible = false; } else { btry.title = 'TRY AGAIN'; b2.title = 'Select Stage'; newicochal1._visible = false; } btry.but.onRelease = function () { if (_root.prelvlcomp) { _root.openScreen('select'); } else { _root.closeMenu(); } }; b2.but.onRelease = function () { if (_root.prelvlcomp) { _root.closeMenu(); } else { _root.openScreen('select'); } }; s1.title = 'Abilities'; s2.title = 'Weapons'; s3.title = 'Support'; select = 1; _root.initUpgr(select, false); s1.but.onRelease = function () { _root.initUpgr(1, true); }; s2.but.onRelease = function () { _root.initUpgr(2, true); }; s3.but.onRelease = function () { _root.initUpgr(3, true); }; _root.initHelp(3); _root.initHelp(4); } frame 20 { _root.playMusic('menu'); if (_root.getCanUpgr(1) || _root.getCanUpgr(2) || _root.getCanUpgr(3)) { canicoupgr._visible = true; } else { canicoupgr._visible = false; } mess.text = ''; reward.text = ''; b1.title = 'Upgrades'; b2.title = 'Main Menu'; b3.title = 'PLAY GAME'; b1.but.onRelease = function () { _root.openScreen('upgr'); }; b2.but.onRelease = function () { _root.openScreen('main'); }; b3.but.onRelease = function () { _root.closeMenu(); }; j = 0; while (j <= 6) { i = 1; while (i <= 3) { z = this['s' + j + i]; z.lvl = i; z.minigame = j; z.desc = _root.modetxt[j][1]; if (_root.lvlsave[j][i] == 0) { z.reward = 'REWARD: ' + _root.rewardtxt[j]; } else { z.reward = 'REWARD: ' + _root.newrewardtxt[j][i]; } z.img.back.img.img.gotoAndStop(i); z.but.onRelease = function () { _root.muzfade = 5; _root.minigame = this._parent.minigame; _root.lvl = this._parent.lvl; _root.closeMenu(); }; if (_root.lvlsave[j][i] == 1) { z.img.gotoAndStop(2); z.img.back.img.gotoAndStop(1); } else { z.img.gotoAndStop(1); } switch (j) { case 0: z.img.icon.gotoAndStop(i); z.title = _root.modetxt[j][0] + ' ' + i; if (i > 1) { if (_root.lvlsave[j][i - 1] == 0) { z.gotoAndStop('locked'); z.needtxt.text = 'Complete ' + _root.modetxt[j][0] + ' ' + (i - 1) + ' to unlock'; z.img.back.img.gotoAndStop(1); } } if (_root.episodenew == i) { z.newico._visible = true; _root.episodenew = 0; } else { z.newico._visible = false; } break; case 1: case 2: case 3: case 4: case 5: z.img.icon.gotoAndStop(j); z.title = _root.modetxt[j][0] + ' ' + i; if (_root.upgrin[j + 4][i - 1] > _root.plrlvl) { z.gotoAndStop('locked'); z.needtxt.text = 'Reach level ' + _root.upgrin[j + 4][i - 1] + ' to unlock'; z.img.back.img.gotoAndStop(1); } if (_root.levelnew[0] == j + 4 && _root.levelnew[1] == i - 1) { z.newico._visible = true; _root.levelnew = [0, 0]; } else { z.newico._visible = false; } break; case 6: if (i == 1) { z.title = _root.modetxt[j][0]; if (_root.lvlsave[0][3] == 0) { z.gotoAndStop('locked'); z.needtxt.text = 'Complete ' + _root.modetxt[0][0] + ' 3 to unlock'; survrec.text = ''; } else { survrec.text = 'Record: ' + _root.stat[16] + ' m'; } if (_root.episodenew == 4) { newicosurv._visible = true; _root.episodenew = 0; } else { newicosurv._visible = false; } } } ++i; } ++j; } _root.initHelp(5); } frame 30 { _root.playMusic('menu'); _root.initQuest(this); _root.initLvlQuest(lvl, 'init'); } frame 40 { b1.title = 'Back to Menu'; b1.but.onRelease = function () { _root.openScreen('main'); }; } frame 50 { mess.text = ''; bmore.title = _root.getMoreText(); bmore.but.onRelease = function () { getURL(sponsorurl, '_blank'); }; b1.title = 'START!'; b1.but.onRelease = function () { _root.powbonus = [0, 0, 0, 0, 0]; _root.interInit(); _root.launchRound(); }; b2.title = 'Select Stage'; b2.but.onRelease = function () { _root.gotoSelectQuest(); }; _root.initPowup(); _root.initFuel(); _root.initHelp(0); _root.initHelp(1); _root.initHelp(2); } frame 60 { bmore.title = _root.getMoreText(); bmore.but.onRelease = function () { getURL(sponsorurl, '_blank'); }; b1.title = 'START!'; b1.but.onRelease = function () { _root.interchal.gotoAndPlay('up'); _root.interInit(); _root.launchRound(); }; b2.title = 'Select Stage'; b2.but.onRelease = function () { _root.gotoSelectQuest(); }; } frame 70 { b1.title = 'CLEAR DATA!'; b2.title = 'Cancel'; b1.but.onRelease = function () { _root.resetStat(); _root.openScreen('main'); }; b2.but.onRelease = function () { _root.openScreen('main'); }; } frame 80 { _root.comixobj.gotoAndPlay(2); b1.title = 'Skip Intro'; b1.but.onRelease = function () { _root.openScreen('main'); }; } frame 90 { _root.playMusic('boss'); } frame 100 { _root.playMusic('boss'); } } movieClip 2820 { frame 1 { stop(); } } movieClip 2826 { } movieClip 2829 { } movieClip 2833 { } movieClip 2837 { } movieClip 2839 { frame 1 { stop(); } } movieClip 2841 { frame 1 { stop(); } } movieClip 2843 { frame 1 { stop(); _visible = false; skipbut._visible = true; skipbut.title = 'SKIP TUTORIAL'; skipbut.but.onRelease = function () { _root.tutorFinish(); skipbut._visible = false; }; } frame 2 { stop(); _visible = true; } frame 3 { _visible = true; play(); } frame 7 { if (comp == false) { gotoAndStop(2); } } frame 21 { if (_root.istutor) { _root.setTutor(); play(); } else { _visible = false; gotoAndStop(1); } } frame 28 { gotoAndStop(2); } } movieClip 2846 { frame 1 { stop(); onEnterFrame = function () { if (show == true) { if (_visible == false) { _visible = true; _alpha = 0; img._xscale = 0; } else { if (_alpha < 100) { _alpha = _alpha + 10; } } } else { if (_visible == true) { if (_alpha > 0) { _alpha = _alpha - 10; } else { _visible = false; _alpha = 0; img._xscale = 0; } } } }; } } movieClip 2849 { } movieClip 2850 { } movieClip 2859 { } movieClip 2869 { } movieClip 2870 { frame 1 { stop(); oldlife = 0; newlife = 0; onEnterFrame = function () { if (_visible) { if (oldlife > _root.life) { --oldlife; } else { oldlife = _root.life; } if (newlife < _root.life) { newlife += 2; } else { newlife = _root.life; } msk.img._xscale = newlife; msk.img2._xscale = _root.life; msk.img3._xscale = oldlife; msk.back._xscale = _root.maxlife; } }; } } movieClip 2876 { } button 2877 { on (rollOver) { playSound('over'); gotoAndPlay('on'); desc._visible = true; _root.mouseclick = true; } on (dragOver) { playSound('over'); gotoAndPlay('on'); desc._visible = true; _root.mouseclick = true; } on (rollOut) { gotoAndPlay('off'); desc._visible = false; _root.mouseclick = false; } on (dragOut) { gotoAndPlay('off'); desc._visible = false; _root.mouseclick = false; } on (release) { _root.mouseclick = true; } on (press) { playSound('click'); gotoAndPlay('on'); desc._visible = false; _root.mouseclick = true; } } movieClip 2883 { } movieClip 2885 { } movieClip 2886 { } movieClip 2887 { frame 1 { stop(); } frame 7 { stop(); } } button 2888 { on (release) { playSound('click'); getURL(sponsorurl, '_blank'); if (_root.ispause == false) { _root.getPause(); } } } movieClip 2889 { frame 1 { ib3.img.ico.gotoAndStop(3); ib3.desc.text = 'PAUSE'; ib3.desc._visible = false; ib3.img.krest._visible = false; ib3.but.onPress = function () { _root.getPause(); }; } } movieClip 2891 { } movieClip 2893 { frame 1 { stop(); } frame 12 { playSound('win'); } frame 36 { stop(); } } movieClip 2906 { frame 1 { stop(); } } movieClip 2930 { frame 1 { stop(); } } movieClip 2935 { frame 1 { stop(); } } button 2937 { on (rollOver) { keytxt._visible = true; if (canopen) { _parent.gotoAndStop(2); playSound('over'); } } on (rollOut) { keytxt._visible = false; if (canopen) { _parent.gotoAndStop(1); } } on (press) { if (canopen) { _root.addStat(33, 1); if (keys == 5) { _root.addStat(34, 1); } _root.stars -= keys; open = true; playSound('unlock'); prizeimg._visible = true; prizeimg.gotoAndStop(prize + 1); door._visible = false; keyimg._visible = false; keytxt._visible = false; _root.getBonus(prize); _root.createInterPart(_parent._x, _parent._y, 'explopart', 1, 'cargo'); _root.createInterPart(_parent._x, _parent._y, 'contdoorpart', 1, keys); _root.createInterPart(_parent._x, _parent._y, 'contkeypart', keys, keys); _parent.gotoAndStop(1); } else { playSound('lock'); } } } movieClip 2938 { frame 1 { stop(); } } movieClip 2939 { frame 1 { stop(); } } movieClip 2941 { } movieClip 2944 { } movieClip 2952 { frame 1 { stop(); } frame 2 { stop(); bmore.title = _root.getMoreText(); bmore.but.onRelease = function () { getURL(sponsorurl, '_blank'); }; b1.title = 'Resume Game'; b2.title = 'Restart Stage'; b3.title = 'Help'; b4.title = 'Upgrade Shop'; b5.title = 'Select Stage'; b1.but.onRelease = function () { _root.getPause(); }; b2.but.onRelease = function () { _root.money += _root.coins; _root.money2 += _root.coins2; _root.money3 += _root.fuel; _root.closeMenu(); }; b3.but.onRelease = function () { gotoAndStop(4); }; b4.but.onRelease = function () { _root.money += _root.coins; _root.money2 += _root.coins2; _root.money3 += _root.fuel; _root.gotoUpgrQuest(); }; b5.but.onRelease = function () { _root.money += _root.coins; _root.money2 += _root.coins2; _root.money3 += _root.fuel; _root.gotoSelectQuest(); }; } frame 3 { _root.playMusic('bonus'); _root.initBonus(1); _root.initHelp(6); bmore.title = _root.getMoreText(); bmore.but.onRelease = function () { getURL(sponsorurl, '_blank'); }; } frame 4 { stop(); h1.gotoAndStop(1); h2.gotoAndStop(2); h3.gotoAndStop(3); h4.gotoAndStop(4); b1.title = 'Continue'; b1.but.onRelease = function () { gotoAndStop(2); }; } } button 2953 { on (press) { if (_currentframe != 20) { gotoAndStop(20); } else { playSound('over'); gotoAndPlay('off'); if (num == 0) { _root.opt.questbut.gotoAndPlay('off'); } } } } movieClip 2961 { } movieClip 2974 { frame 1 { stop(); } } movieClip 2975 { frame 1 { stop(); _visible = false; num = 0; } frame 2 { _visible = true; } frame 11 { if (num == 0) { _root.opt.questbut.gotoAndPlay('on'); } img.gotoAndStop(num + 1); } frame 20 { stop(); } } movieClip 2978 { } movieClip 2979 { frame 1 { stop(); } } movieClip 2981 { frame 1 { stop(); } } movieClip 2983 { } movieClip 2986 { } movieClip 2987 { frame 1 { _visible = false; stop(); } frame 2 { _visible = true; } } movieClip 2989 { } movieClip 2991 { } movieClip 2992 { frame 1 { stop(); } frame 18 { if (_root.savenow) { _root.savenow = false; _root.saveStat(); } if (_root.opt.tar == 'exit') { _root.createLevel(); if (_root.minigame == 0 || _root.minigame == 6) { if (_root.checkpoint != 0) { _root.opt.tar = 'power'; _root.opt.gotoAndStop('power'); } } else { _root.opt.tar = 'chall'; _root.opt.gotoAndStop('chall'); } } else { _root.clearLevel(); switch (_root.opt.tar) { case 'quest': _root.back.gotoAndStop(2); break; case 'main': _root.back.gotoAndStop(4); break; case 'congrat1': _root.back.gotoAndStop(5); _root.tocongrat = 0; break; case 'congrat2': _root.back.gotoAndStop(6); _root.tocongrat = 0; break; default: _root.back.gotoAndStop(3); } } } } movieClip 2995 { } movieClip 2996 { frame 1 { _visible = false; stop(); } frame 2 { _visible = true; } } movieClip 2999 { frame 1 { stop(); _visible = false; } frame 2 { _visible = true; playSound('yeah1'); } frame 11 { playSound('holy'); } frame 31 { desctxt.text = desc; } } frame 11 { playerDamage = function (type, num) { killnodam = 0; runnoshot = 0; stat[37] = 0; setChall(4, false); playSound('d1', 'd2', 'd3'); switch (type) { case 0: _root.quake += 6; if (nodanger == false) { if (num == 1) { life -= dampike - vspike; } else { if (num == 2) { life -= damenemy - vsenemy; } else { life -= dambullet - vsbullet; } } } lvlspeed = Math.round(maxlvlspeed / 2); player.dam = player.maxdam; if (player.slide == false) { player.gotoAndStop('dam'); } break; case 1: _root.quake += 12; if (nodanger == false) { life -= dampit; } player.die = true; diedelay = 30; player._visible = false; createPart(player._x, player._y, 'playerdiepart', 1); createPart(player._x, player._y - 40, 'dustpart', 1, 'wall'); player._y = -100; player.hspeed = 0; break; case 2: _root.quake += 6; if (nodanger == false) { life -= dampit; } player.die = true; diedelay = 30; player._visible = false; player.hspeed = 0; player._y = -100; } dameff.gotoAndPlay('on'); if (life <= 0) { trace('GAMEOVER'); quake = 14; muzfade = 1; playSound('die'); wintimer = 70; player.dam = 999; diedelay = 999; oldlvlspeed = maxlvlspeed; maxlvlspeed = 0; lvlspeed = 0; if (type == 0) { createPart(player._x, player._y, 'playerdiepart', 1); player._visible = false; player._y = -100; } } inter.life.init = true; }; bulletHit = function (bo) { i = 0; while (i < enemyBank.length) { z = enemyBank[i]; if (bo._y > z._y - z.h) { if (bo._y - bo.h < z._y) { if (bo._x > z._x - z.w) { if (bo._x - bo.w < z._x) { enemyDamage(z, bo.dam * damagemult); if (bo.hitdie == true) { if (bo.type == 8) { playSound('explo11', 'explo12'); } createPart(bo._x, bo._y, 'dampart' + bo.dampart, 1); bo.removeMovieClip(); } } } } } ++i; } i = 0; while (i < cargoBank.length) { z = cargoBank[i]; if (bo._y > z._y - z.h) { if (bo._y - bo.h < z._y) { if (bo._x > z._x - z.w) { if (bo._x - bo.w < z._x) { cargoDamage(z, bo.dam * damagemult); if (bo.hitdie == true) { createPart(bo._x, bo._y, 'dampart' + bo.dampart, 1); bo.removeMovieClip(); } } } } } ++i; } }; enemyDamage = function (eobj, bodam) { eobj.life -= bodam; if (eobj.isWall) { playSoundLim('boxd1', 'boxd2'); } else { playSoundLim('enemyd1', 'enemyd2', 'enemyd3'); } if (eobj.life < 1) { if (!eobj.isBoss) { if (eobj.isEnemy) { playSound('enemydie1', 'enemydie2'); addStat(0, 1); ++killnodam; setStat(26, killnodam); createPrize(eobj, 'enemy', 1); } else { playSound('wood1', 'wood2'); addStat(15, 1); } createDie(eobj); dieEnemy(eobj); } } else { eobj.gotoAndPlay(3); } }; cargoDamage = function (bobj, bodam) { playSoundLim('boxd1', 'boxd2'); bobj.life -= bodam; if (bobj.life < 1) { if (bobj.img._currentframe < 3) { playSound('wood1', 'wood2'); } else { playSound('iron1', 'iron2'); } addStat(2, 1); createPrize(bobj, 'cargo', 1); if (bobj.fly == true) { createPart(bobj._x - 85, bobj._y - 144, 'parapart', 1); } ii = 5; createPart(bobj._x - bobj.w / 2, bobj._y - bobj.h / 2, 'boxhpart', 5, bobj.img._currentframe); createPart(bobj._x - bobj.w / 2, bobj._y - bobj.h / 2, 'explopart', 1); dieCargo(bobj); } else { bobj.gotoAndPlay(3); } }; ebulletHit = function (bo) { if (player.dam == 0) { if (powerdam == 0) { if (player._visible) { if (bo._y > player._y - player.h) { if (bo._y - bo.h < player._y) { if (bo._x > player._x - player.w) { if (bo._x - bo.w < player._x) { if (player.shield._visible == false) { playerDamage(0); } if (bo.hitdie == true) { bo.removeMovieClip(); } } } } } } } } }; findTarget = function () { if (random(10) < 3) { if (cargoBank[0] != undefined) { return cargoBank[0]; } } if (enemyBank[0] != undefined) { if (enemyBank.length > 1) { if (enemyBank[0]._x < enemyBank[1]._x) { return enemyBank[0]; } else { return enemyBank[1]; } } else { if (enemyBank[0]._visible == true) { return enemyBank[0]; } else { if (cargoBank[0] != undefined) { return cargoBank[0]; } } } } else { if (cargoBank[0] != undefined) { return cargoBank[0]; } } }; createDie = function (ob) { if (ob.isWall) { var v2 = 10; while (v2--) { createPart(ob._x - ob.w / 2, ob._y - (ob.h / 10) * v2, 'boxhpart', 1, ob.img._currentframe); } createPart(ob._x - ob.w / 2, ob._y - ob.h / 2, 'explopart', 1, 'wall'); } else { createPart(ob._x - 20, ob._y - 65, 'die' + (random(1) + 1) + 'part', 1, ob.img._currentframe); if (ob.img._currentframe == 5 || ob.img._currentframe == 6) { playSound('explo31', 'explo32'); createPart(ob._x - ob.w / 2, ob._y - ob.h / 2, 'explopart', 1, 'big'); } else { playSound('explo21', 'explo22'); createPart(ob._x - ob.w / 2, ob._y - ob.h / 2, 'explopart', 1, 'small'); } } }; createPrize = function (ob, type, num) { switch (type) { case 'enemy': switch (ob.img._currentframe) { case 1: _root.createCoin(ob, 4, 1, 1); _root.createCoin(ob, 2, 4, 1); break; case 2: _root.createCoin(ob, 6, 1, 1); _root.createCoin(ob, 2, 4, 1); break; case 3: _root.createCoin(ob, 4, 2, 1); _root.createCoin(ob, 3, 4, 1); break; case 4: _root.createCoin(ob, 6, 2, 1); _root.createCoin(ob, 3, 4, 1); break; case 5: _root.createCoin(ob, 4, 3, 1); _root.createCoin(ob, 4, 4, 1); break; case 6: _root.createCoin(ob, 6, 3, 1); _root.createCoin(ob, 4, 4, 1); } break; case 'cargo': switch (ob.img._currentframe) { case 1: _root.createCoin(ob, 8, 1, 1); _root.createCoin(ob, 2, 5, 1); break; case 2: _root.createCoin(ob, 4, 1, 1); _root.createCoin(ob, 4, 2, 1); _root.createCoin(ob, 2, 5, 1); break; case 3: _root.createCoin(ob, 4, 2, 1); _root.createCoin(ob, 4, 3, 1); _root.createCoin(ob, 3, 5, 1); break; case 4: _root.createCoin(ob, 8, 3, 1); _root.createCoin(ob, 4, 5, 1); } break; case 'boss': switch (ob.isBoss) { case 1: _root.createCoin(ob, 6, 1, 1); _root.createCoin(ob, 2, 4, 1); break; case 2: _root.createCoin(ob, 6, 2, 1); _root.createCoin(ob, 2, 4, 1); break; case 3: _root.createCoin(ob, 6, 3, 1); _root.createCoin(ob, 2, 4, 1); } } }; constructBlock = function () { switch (act) { case 0: if (pitw != 10) { lvldizcol = random(5) + 1; } createBlock(1); if (lvlend == true || maxlvlseg == 0) { seg = 2; } else { seg = random(maxlvlseg); } if (seg == 0) { act = 2; } else { act = 1; } step += 150; break; case 1: if (lvlend == true || maxlvlseg == 0) { seg = 2; } createBlock(2); if (seg > 1) { --seg; } else { act = 2; } step += 300; break; case 2: createBlock(3); act = 0; prehig = hig; hig = random(maxlvlhigh) + 250; pitw = 15 * choose(0, random(maxlvlpit + 1) * 10); if (pitw == 0) { if (Math.abs(prehig - hig) < 50) { pitw = 150; } else { pitw = 10; } } step += 150 + pitw; if (pitw > 10) { if (starready) { if (stardiff == 4) { --starready; createPart(pitw / 2 + lvlw + 165, (prehig - hig) / 2 + hig, 'starobj', 1); } if (stardiff == 5) { --starready; createPart(pitw / 2 + lvlw + 165, Math.min(prehig, hig) - 180, 'starobj', 1); } } } } }; constructObject = function (ob, num) { if (num == 2) { if (starready) { if (stardiff == 0 || minigame == 3) { --starready; createPart(lvlw + 150, hig - 150, 'starobj', 1); return undefined; } } } else { if (starready) { if (stardiff == 1) { --starready; createPart(lvlw + 75, hig - 150, 'starobj', 1); } } } if (weapready) { createWeapon(1, 1 + startweap + random(newweap - startweap)); --weapready; } else { if (powerready) { if (Math.random() > life / maxlife) { createWeapon(2, 1); } else { createWeapon(2, 1 + random(1 + newpower)); } --powerready; } } if (barrierready) { if (num == 2) { if (ob._y > 330) { createBarrier(); --barrierready; ob.create = 3; if (starready) { if (stardiff == 2) { --starready; createPart(lvlw + 170, hig - 220, 'starobj', 1); return undefined; } } } } } if (wallready) { createWall(wallarray[random(enemyarray.length)], obj2); if (ob.create == 3) { obj._y -= 205; } --wallready; ob.create = 1; return undefined; } if (enemyready) { var v2 = enemyarray[random(enemyarray.length)]; if (v2 == 3 || v2 == 4) { createEnemy(v2, obj2); --enemyready; } } if (num > 1) { if (enemyready) { createEnemy(enemyarray[random(enemyarray.length)], obj2); if (ob.create == 3) { obj._y -= 205; } --enemyready; ob.create = 1; return undefined; } if (num == 2) { if (pikeready) { if (ob.create == 3) { var v4 = pikearray[random(pikearray.length)]; if (v4 != 3) { createPike(v4, obj2); obj._y -= 210; --pikeready; ob.create = 2; return undefined; } } else { createPike(pikearray[random(pikearray.length)], obj2); --pikeready; ob.create = 2; if (starready) { if (stardiff == 3) { --starready; createPart(lvlw + 160, hig - 75, 'starobj', 1); } } return undefined; } } } } if (cargoready) { if (minigame == 2) { createCargo(1 + lvl, choose(obj2, 'fly')); } else { createCargo(1 + random(morecargo), obj2); } if (ob.create == 3) { if (!obj.fly) { obj._y -= 205; } } --cargoready; ob.create = 4; } }; blockCount = 0; createBlock = function (num, x) { ++blockCount; obj2 = levelmap.attachMovie('blockobj', 'block' + blockCount, 10000 - blockCount); obj2.type = num; if (x != undefined) { obj2._x = x; } else { obj2._x = lvlw + step; } obj2._y = hig; if (num == 2) { obj2.w = 300; if (x == undefined) { if (!lvlend) { constructObject(obj2, num); } } } else { obj2.w = 150; if (x == undefined) { if (!lvlend) { constructObject(obj2, num); } } } obj2.gotoAndStop(num); blockBank.push(obj2); }; createBarrier = function () { ++blockCount; obj3 = levelmap.attachMovie('blockobj', 'block' + blockCount, 10000 - blockCount); obj3.type = 4; obj3._x = lvlw + step + 75; obj3._y = hig; obj3.w = 150; obj3.gotoAndStop(4); blockBank.push(obj3); }; dieBlock = function (ob) { i = 0; while (i < blockBank.length) { if (blockBank[i] == ob) { blockBank.splice(i, 1); break; } ++i; } ob.removeMovieClip(); }; enemyCount = 0; createEnemy = function (num, ob) { ++enemyCount; obj = levelmap.attachMovie('enemyobj', 'enemy' + enemyCount, levelmap.getNextHighestDepth()); obj.target = ob; obj._x = ob._x + ob.w / 2 + 30; obj._y = ob._y; obj.isEnemy = true; obj.img.gotoAndStop(num); enemyBank.push(obj); }; createWall = function (num, ob) { ++enemyCount; obj = levelmap.attachMovie('wallobj', 'enemy' + enemyCount, levelmap.getNextHighestDepth()); obj.target = ob; obj._x = ob._x + ob.w - 10; obj._y = ob._y; obj.isWall = true; obj.img.gotoAndStop(num); enemyBank.push(obj); }; dieEnemy = function (ob) { i = 0; while (i < enemyBank.length) { if (enemyBank[i] == ob) { enemyBank.splice(i, 1); break; } ++i; } ob.removeMovieClip(); }; createWeapon = function (kind, type) { obj = levelmap2.attachMovie('weapprizeobj', 'part', levelmap2.getNextHighestDepth()); obj._x = 600; obj._y = 150 + random(100); obj.type = type; obj.kind = kind; }; cargoCount = 0; createCargo = function (num, ob) { ++cargoCount; obj = levelmap2.attachMovie('cargoobj', 'cargo' + cargoCount, levelmap2.getNextHighestDepth()); if (ob == 'fly') { obj.fly = true; obj._x = 600; obj._y = 150 + random(100); } else { obj._x = (ob.w - 90) / 2 + ob._x + 90; obj._y = ob._y; } obj.img.gotoAndStop(num); cargoBank.push(obj); }; dieCargo = function (ob) { i = 0; while (i < cargoBank.length) { if (cargoBank[i] == ob) { cargoBank.splice(i, 1); break; } ++i; } ob.removeMovieClip(); }; createCoin = function (objc, count, num, type) { if (minigame == 1) { if (num > 3) { count = 1; } } else { if (minigame == 2) { count = 1; } else { switch (num) { case 1: case 2: case 3: count = Math.round(count * (1 + random(morecoin))); break; case 4: count = Math.round(count * (1 + random(morecry))); break; case 5: count = Math.round(count * (1 + random(morefuel))); } } } while (count--) { obj = levelmap2.attachMovie('coinobj', 'part', levelmap2.getNextHighestDepth()); obj._x = objc._x; obj._y = objc._y - objc.h / 2; obj.type = type; obj.gotoAndStop(num); } }; createPart = function (x, y, ob, count, type) { while (count--) { obj = levelmap2.attachMovie(ob, 'part', levelmap2.getNextHighestDepth()); obj._x = x; obj._y = y; obj.type = type; } }; createInterPart = function (x, y, ob, count, type) { while (count--) { obj = levelmap3.attachMovie(ob, 'part', levelmap3.getNextHighestDepth()); obj._x = x; obj._y = y; obj.type = type; } }; createBullet = function (ob, num, x) { obj = levelmap2.attachMovie('bullet' + num + 'obj', 'bullet', levelmap2.getNextHighestDepth()); obj._x = ob._x + 10 + ob.weapon.img.fx._x; obj._y = ob._y - 45 + ob.weapon.img.fx._y; obj.num = x; obj.type = num; }; createPowerBullet = function (ob, num, type, x) { obj = levelmap2.attachMovie('bullet' + num + 'obj', 'bullet', levelmap2.getNextHighestDepth()); obj._x = ob._x + type._x + 40; obj._y = ob._y + type._y; obj.num = x; obj.type = num; }; createEbullet = function (ob, num, x) { obj = levelmap2.attachMovie('ebullet' + num + 'obj', 'ebullet', levelmap2.getNextHighestDepth()); if (ob.isBoss) { obj._x = ob._x + ob.fx._x; obj._y = ob._y + ob.fx._y; ob.fx.gotoAndPlay(2); } else { obj._x = ob._x - ob.w; obj._y = ob._y - 55; } obj.num = x; }; createPike = function (num, ob) { obj = levelmap.attachMovie('pikeobj', 'pike', levelmap.getNextHighestDepth()); obj._x = ob._x + 10; obj._y = ob._y; obj.num = num; obj.gotoAndStop(num); }; doEmp = function () { playSound('powemp'); poweremp = poweremptime; if (_root.flashobj._currentframe == 1) { _root.flashobj.gotoAndPlay(2); } k = enemyBank.length - 1; while (k >= 0) { z = enemyBank[k]; enemyDamage(z, empdamage); --k; } }; getPause = function () { if (opt.tar == 'exit') { if (ispausedobj._currentframe != 3) { flashobj.gotoAndPlay(2); if (ispause == false) { ispause = true; ispausedobj._visible = true; ispausedobj.gotoAndStop(2); } else { ispause = false; ispausedobj._visible = false; } } } }; _global.bounce_angel = function (ang1, ang2) { return ang2 + (ang2 + 180 - (ang1 + 180)); }; _global.lengthdir_x = function (len, dir) { return Math.cos(dir * Math.PI / 180) * len; }; _global.lengthdir_y = function (len, dir) { return -Math.sin(dir * Math.PI / 180) * len; }; _global.point_distance = function (x1, y1, x2, y2) { return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2)); }; _global.point_direction = function (x1, y1, x2, y2) { return (Math.atan2(y2 - y1, x2 - x1) / Math.PI) * 180; }; _global.choose = function () { return arguments[random(arguments.length)]; }; gotoAndStop('controller'); } frame 16 { mouseclick = false; var keyListener = new Object(); Key.addListener(keyListener); keyListener.onKeyDown = function () { if (_root.ispause == false) { if (player._visible == true) { switch (Key.getCode()) { case 38: case 87: if (player.canjump) { if (!player.jump) { playSound('jump2'); addStat(7, 1); player.djump = djump; player.jump = true; player.canjump = false; player.hspeed = player.jspeed; createPart(player._x - 25, player._y, 'jumppart', 1); player._y += player.hspeed; player.gotoAndStop('jump'); } else { if (player.djump > 0) { addStat(13, 1); if (!unlimjump) { --player.djump; } player.jump = true; player.canjump = false; player.drop = false; player.hspeed = player.jspeed; createPart(player._x - 25, player._y - 10, 'jumppart', 1); if (player.djump == 0) { playSound('jumpd'); player.gotoAndStop('djump'); } else { playSound('jump2'); player.gotoAndStop('jump'); } } } } break; case 40: case 83: case 32: if (player.jump) { if (!player.drop && !player.slideon) { playSound('jump'); addStat(10, 1); player.drop = true; player.hspeed = player.dropspeed; player.gotoAndStop('drop'); } } player.slideon = true; } } } }; keyListener.onKeyUp = function () { switch (Key.getCode()) { case 82: if (opt.tar == 'exit') { money += coins; money2 += coins2; money3 += fuel; closeMenu(); } break; case 27: case 80: _root.getPause(); break; case 38: case 87: player.canjump = true; break; case 40: case 83: player.slideon = false; break; case 32: player.slideon = false; if (helpobj._visible == false) { if (opt.tar == 'power') { powbonus = [0, 0, 0, 0, 0]; interInit(); launchRound(); } if (opt.tar == 'chall') { interchal.gotoAndPlay('up'); interInit(); launchRound(); } if (opt.tar == 'upgr') { if (opt.btry._visible) { if (prelvlcomp) { openScreen('select'); } else { closeMenu(); } } } } } }; onMouseDown = function () { if (ispause == false) { if (mouseclick == false) { mouseclick = true; if (player._visible == true) { if (!player.jump) { playSound('jump2'); addStat(7, 1); player.djump = djump; player.jump = true; player.hspeed = player.jspeed; createPart(player._x - 25, player._y, 'jumppart', 1); player._y += player.hspeed; player.gotoAndStop('jump'); } else { if (player.djump > 0) { addStat(13, 1); if (!unlimjump) { --player.djump; } player.jump = true; player.drop = false; player.hspeed = player.jspeed; createPart(player._x - 25, player._y - 10, 'jumppart', 1); if (player.djump == 0) { playSound('jumpd'); player.gotoAndStop('djump'); } else { playSound('jump2'); player.gotoAndStop('jump'); } } } } } } }; onMouseUp = function () { mouseclick = false; }; onEnterFrame = function () { if (muzfade > 0) { if (muzvol > 0) { muzvol -= muzfade; musicVol.setVolume(muzvol); } } if (sound_delay > 0) { --sound_delay; } if (quake > 0) { if (quake > 10) { quake = 10; } if (quake % 1 == 0) { _root._y = quake; } else { _root._y = -quake; } quake -= 0.5; } if (ispause == false) { if (bossobj.isBoss == undefined) { inter2.meter.img._xscale = (lvllength / maxlvllength) * 100; } else { inter2.meter.img._xscale = (bossobj.life / bossobj.maxlife) * 100; } if (nodanger == false) { if (lvllength < maxlvllength) { lvllength += lvlspeed; if (minigame == 6) { inter2.title.text = Math.round(lvllength / 30); } if (minigame == 0) { if (lvllength >= (maxlvllength / 4) * checkpoint) { ++checkpoint; levelInit(); } } } else { if (minigame == 6) { maxlvllength += 10000; ++checkpoint; survivalChange(); levelInit(); } else { if (bossready > 0) { lvlspeed = 14; maxlvlspeed = 14; playMusic('boss'); --bossready; ++enemyCount; bossobj = levelmap.attachMovie('boss' + lvl + 'obj', 'enemy' + enemyCount, levelmap.getNextHighestDepth()); inter2.meter.gotoAndStop(2); } else { if (player.die == false) { if (bossobj.isBoss == undefined) { if (lvlend == false) { lvlend = true; inter2.show = false; } else { if (lvlendcount > 0) { lvlendcount -= lvlspeed; } else { if (nodanger == false) { muzfade = 1; nodanger = true; player.attack = false; win = true; if (minigame != 0 && minigame != 6) { interchal.gotoAndPlay('down'); if (minigame == 5) { wintimer = 150; } else { wintimer = 120; } if (chalcomp) { prelvlcomp = true; if (lvlsave[minigame][lvl] == 0) { chalnew.img.title.text = rewardtxt[minigame] + ' now!'; chalnew.img.icon.gotoAndStop(minigame); if (minigame == 2) { chalnew.img.icon.img.gotoAndStop(1); } chalnew.gotoAndPlay(2); } else { stars += newrewardnum[minigame][lvl]; chalnew.img.title.text = newrewardtxt[minigame][lvl]; chalnew.img.icon.gotoAndStop(5); chalnew.gotoAndPlay(2); } lvlsave[minigame][lvl] = 1; setStat(25, getChalComp()); } } else { if (minigame == 0) { prelvlcomp = true; if (lvlsave[0][lvl] == 0) { episodenew = lvl + 1; chalnew.img.title.text = rewardtxt[0] + ' now!'; chalnew.img.icon.gotoAndStop(6); chalnew.gotoAndPlay(2); } else { money += newrewardnum[minigame][lvl]; chalnew.img.title.text = newrewardtxt[minigame][lvl]; chalnew.img.icon.gotoAndStop(3); chalnew.gotoAndPlay(2); } if (lvl == 3) { tocongrat = 1; } lvlsave[minigame][lvl] = 1; } winlogo.gotoAndPlay(2); wintimer = 150; } } } } } } } } } } if (wintimer > 0) { --wintimer; if (!win) { if (wintimer == 30) { playSound('failed'); } } if (wintimer == 1) { addStat(35, 1); _root.money += _root.coins; _root.money2 += _root.coins2; _root.money3 += _root.fuel; if (stars > 0) { ispause = true; ispausedobj._visible = true; ispausedobj.gotoAndStop(3); flashobj.gotoAndPlay(2); } else { if (tocongrat == 1) { openScreen('congrat1'); } else { gotoUpgrQuest(); } } } } if (lvlspeed < maxlvlspeed) { if (msec % 3 == 0) { ++lvlspeed; } } if (msec < 30) { ++msec; } else { msec = 0; ++sec; if (checkpoint > 0) { addStat(6, maxlvlspeed); if (minigame == 6) { setStat(16, Math.round(lvllength / 30)); ngsend(); } ++runnodam; setStat(27, runnodam); if (player.slide) { addStat(36, 1); } } if (ammo > 0) { --ammo; } --pikepoint; --wallpoint; --enemypoint; --weappoint; --powerpoint; --cargopoint; --barrierpoint; if (pikepoint == 0) { pikepoint = maxpikepoint; ++pikeready; } if (wallpoint == 0) { wallpoint = maxwallpoint; ++wallready; } if (enemypoint == 0) { enemypoint = maxenemypoint; ++enemyready; } if (weappoint == 0) { weappoint = maxweappoint + random(maxweappoint); ++weapready; } if (powerpoint == 0) { powerpoint = maxpowerpoint + random(maxpowerpoint); ++powerready; } if (cargopoint == 0) { cargopoint = maxcargopoint + random(maxcargopoint); ++cargoready; } if (barrierpoint == 0) { barrierpoint = maxbarrierpoint; ++barrierready; } if (maxstars) { --starpoint; if (starpoint == 0) { starpoint = maxstarpoint; ++starready; --maxstars; } } if (poweremp) { --poweremp; } if (powermagnet) { --powermagnet; } if (powerplane) { --powerplane; } if (powerammo) { --powerammo; } if (powerion) { --powerion; } if (powerdam) { --powerdam; } if (powerheli) { --powerheli; } } if (player.die == true) { if (diedelay > 0) { --diedelay; } else { if (blockBank[0].type != 3 || blockBank[0].create > 2) { if (blockBank[0]._x < 150) { playerInit(); } } } } if (step <= 0) { constructBlock(); } step -= lvlspeed; } }; gotoAndStop('game'); } frame 21 { stop(); ib1.img.ico.gotoAndStop(1); ib2.img.ico.gotoAndStop(2); ib1.desc.text = 'SOUND'; ib2.desc.text = 'MUSIC'; ib1.desc._visible = false; ib2.desc._visible = false; if (sound == true) { ib1.img.krest._visible = false; } else { ib1.img.krest._visible = true; } if (music == true) { ib2.img.krest._visible = false; } else { ib2.img.krest._visible = true; } ib1.but.onPress = function () { changeSound(); }; ib2.but.onPress = function () { changeMusic(); }; changeSound = function () { if (sound == true) { sound = false; ib1.img.krest._visible = true; } else { sound = true; ib1.img.krest._visible = false; } }; changeMusic = function () { if (music == true) { music = false; musicmap.gotoAndStop('stop'); ib2.img.krest._visible = true; } else { music = true; playMusic(muzcur, true); ib2.img.krest._visible = false; } }; openScreen('comix'); trans.gotoAndPlay('start'); }




http://swfchan.com/44/215947/info.shtml
Created: 26/12 -2018 18:54:13 Last modified: 26/12 -2018 18:54:13 Server time: 26/04 -2024 13:18:45