Symbol 17 MovieClip Frame 1
stop();
Symbol 64 MovieClip Frame 1
function updateMe() {
m1.guts.stop();
m2.guts.stop();
m3.guts.stop();
m4.guts.stop();
m5.guts.stop();
i = 0;
while (i < 9) {
hid = eval ("m" + i);
hid._visible = false;
i++;
}
sho = eval ("m" + realroot.curmag);
sho._visible = true;
sho2 = eval ("m" + realroot2.curmag);
sho2._visible = true;
sho3 = eval ("m" + realroot3.curmag);
sho3._visible = true;
sho4 = eval ("m" + realroot4.curmag);
sho4._visible = true;
sho5 = eval ("m" + realroot5.curmag);
sho5._visible = true;
}
var realroot = this._parent;
var realroot2 = this._parent._parent;
var realroot3 = this._parent._parent._parent;
var realroot4 = this._parent._parent._parent._parent;
var realroot5 = this._parent._parent._parent._parent._parent;
updateMe();
Symbol 84 MovieClip [platweaponholder] Frame 1
var realroot = this._parent;
var realroot2 = this._parent._parent;
var realroot3 = this._parent._parent._parent._parent;
realroot.showSword(this);
realroot2.showSword(this);
realroot3.showSword(this);
Symbol 110 MovieClip [pausesign_guts] Frame 1
function switchQual(n) {
var _local2 = 0;
while (_local2 < 3) {
var _local3 = this["a" + _local2];
_local3.gotoAndStop(1);
_local3.nam.text = nams[_local2];
_local2++;
}
var _local5 = this["a" + n];
_local5.gotoAndStop(2);
_local5.nam.text = nams[n];
realroot._quality = sett[n];
realroot.qualset = sett[n];
}
function updateMe() {
if (realroot.museoff) {
mchk.chk._visible = false;
}
if (realroot.sfxoff) {
schk.chk._visible = false;
}
var _local1 = new Color(masker);
_local1.setRGB(realroot.armorarray[realroot.curarmor]);
arm.text = "-" + realroot.curarmor;
mag.text = "-" + realroot.curmag;
sword.text = "-" + realroot.cursword;
deaths.text = "-" + realroot.numdeaths;
showSword(swordthing);
magthing.updateMe();
}
var realroot = this._parent;
updateMe();
var nams = new Array("H", "M", "L");
var sett = new Array("High", "Medium", "Low");
if (realroot.qualset == "High") {
switchQual(0);
}
if (realroot.qualset == "Medium") {
switchQual(1);
}
if (realroot.qualset == "Low") {
switchQual(2);
}
var i = 0;
while (i < 3) {
var tar = this["a" + i];
tar.id = i;
tar.onPress = function () {
switchQual(this.id);
};
i++;
}
but_walk.onPress = function () {
getURL ("http://armorgames.com/guide/chibi-knight-video-guide", "_blank");
};
but_ag.onPress = function () {
getURL ("http://www.armorgames.com", "_blank");
};
mchk.onPress = function () {
if (this.chk._visible) {
this.chk._visible = false;
muse.text = "Off";
realroot.museoff = true;
} else {
this.chk._visible = true;
muse.text = "On";
realroot.museoff = false;
}
};
schk.onPress = function () {
if (this.chk._visible) {
this.chk._visible = false;
sfx.text = "Off";
realroot.sfxoff = true;
} else {
this.chk._visible = true;
sfx.text = "On";
realroot.sfxoff = false;
}
};
Symbol 123 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 1
stop();
Symbol 134 MovieClip [Preloader] Frame 1
function enterFrameHandler() {
var _local2 = 0;
_local2 = _root.getBytesLoaded() / _root.getBytesTotal();
if (loadingBar) {
loadingBar.gotoAndStop(int(_local2 * (loadingBar._totalframes - 1)) + 1);
}
if ((_local2 >= 1) && (haltComplete != true)) {
onEnterFrame = null;
gotoAndStop ("loaded");
}
}
stop();
var autoPlay;
var className;
var haltComplete;
onEnterFrame = enterFrameHandler;
Symbol 134 MovieClip [Preloader] Frame 10
function _onPlayClick() {
_root.nextFrame();
_root.play();
_parent._onLoaded();
}
if (playButton) {
playButton.onRelease = _onPlayClick;
playButton.stop();
}
if (autoPlay) {
_onPlayClick(null);
}
Symbol 136 MovieClip [Newgrounds API Classes] Frame 1
#initclip 26
Object.registerClass("Newgrounds API Classes", com.newgrounds.shims.APIShim);
#endinitclip
Symbol 191 MovieClip [FlashAd] Frame 1
#initclip 27
Object.registerClass("FlashAd", com.newgrounds.components.FlashAdBase);
#endinitclip
function initPlayButton() {
if (this.playButton) {
this.playButton.onRelease = onPlayClick;
if (!this.showPlayButton) {
this.playButton._visible = false;
}
}
}
function onPlayClick() {
removeAd();
_visible = false;
}
stop();
Symbol 191 MovieClip [FlashAd] Frame 2
initPlayButton();
Symbol 191 MovieClip [FlashAd] Frame 10
initPlayButton();
Symbol 191 MovieClip [FlashAd] Frame 20
initPlayButton();
Symbol 192 MovieClip [APIConnector] Frame 1
function _onLoaded() {
gotoAndStop ("invisible");
if (_redirect) {
com.newgrounds.API.loadOfficialVersion();
return(undefined);
}
}
function _apiConnect() {
var _local2 = com.newgrounds.API;
if (_local2 && (!_local2.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 :
_local2.debugMode = _local2.RELEASE_MODE;
break;
case "Simulate Logged-in User" :
_local2.debugMode = _local2.DEBUG_MODE_LOGGED_IN;
break;
case "Simulate Logged-out User" :
_local2.debugMode = _local2.DEBUG_MODE_LOGGED_OUT;
break;
case "Simulate New Version" :
_local2.debugMode = _local2.DEBUG_MODE_NEW_VERSION;
break;
case "Simulate Host Blocked" :
_local2.debugMode = _local2.DEBUG_MODE_HOST_BLOCKED;
}
if (loader) {
loader.haltComplete = true;
}
_local2.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, _onConnected);
_local2.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 _local2 = getNextHighestDepth();
swapDepths(_local2);
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 of Symbol 191 MovieClip [FlashAd] "ad" in Symbol 192 MovieClip [APIConnector] Frame 1
//component parameters
onClipEvent (construct) {
apiId = "";
showBorder = true;
adType = "Video";
}
Instance of Symbol 134 MovieClip [Preloader] "loader" in Symbol 192 MovieClip [APIConnector] Frame 1
//component parameters
onClipEvent (construct) {
autoPlay = false;
mainClass = "";
}
Symbol 201 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 1
function freshMe() {
cul = new Color(col);
cul.setRGB(realroot.armorarray[realroot.curarmor]);
col.cacheAsBitmap = true;
col.setMask(masker);
col._alpha = 100;
}
var realroot = this._parent._parent._parent;
if (!this.inited) {
freshMe();
this.inited = true;
}
Symbol 245 MovieClip Frame 16
gotoAndPlay ("rest");
Symbol 245 MovieClip Frame 32
gotoAndPlay ("walk");
Symbol 245 MovieClip Frame 36
stop();
Symbol 245 MovieClip Frame 41
realroot.jumpRecover(this._parent);
Symbol 245 MovieClip Frame 44
realroot.chkSlash(this.hitarea);
Symbol 245 MovieClip Frame 45
realroot.chkSlash(this.hitarea);
Symbol 245 MovieClip Frame 47
realroot.endAttack(this._parent);
stop();
Symbol 245 MovieClip Frame 50
realroot.chkSlash(this.hitarea);
Symbol 245 MovieClip Frame 51
realroot.chkSlash(this.hitarea);
Symbol 245 MovieClip Frame 53
realroot.endAttack(this._parent);
stop();
Symbol 245 MovieClip Frame 55
realroot.chkSlash(this.hitarea);
Symbol 245 MovieClip Frame 56
realroot.chkSlash(this.hitarea);
Symbol 245 MovieClip Frame 59
realroot.endAttack(this._parent);
stop();
Symbol 245 MovieClip Frame 63
stop();
Symbol 245 MovieClip Frame 70
realroot.screenShake(10);
Symbol 245 MovieClip Frame 83
realroot.endMagic(this._parent);
gotoAndPlay ("rest");
Symbol 245 MovieClip Frame 91
stop();
Symbol 245 MovieClip Frame 96
stop();
Symbol 245 MovieClip Frame 97
trace("1");
trace("currentframe: " + _currentframe);
gotoAndPlay (97);
Symbol 245 MovieClip Frame 98
trace("2");
trace("currentframe: " + _currentframe);
gotoAndPlay (98);
Symbol 245 MovieClip Frame 99
trace("3");
trace("currentframe: " + _currentframe);
gotoAndPlay (99);
Symbol 245 MovieClip Frame 111
realroot.flashIt();
Symbol 245 MovieClip Frame 125
stop();
realroot.runMap();
Symbol 245 MovieClip Frame 140
stop();
Symbol 246 MovieClip [platdude] Frame 1
stop();
Symbol 246 MovieClip [platdude] Frame 2
gotoAndPlay(_currentframe);
Symbol 246 MovieClip [platdude] Frame 3
gotoAndPlay(_currentframe);
Symbol 246 MovieClip [platdude] Frame 4
gotoAndPlay(_currentframe);
Symbol 246 MovieClip [platdude] Frame 5
gotoAndPlay(_currentframe);
Symbol 246 MovieClip [platdude] Frame 6
gotoAndPlay(_currentframe);
Symbol 255 MovieClip [clack] Frame 5
this.removeMovieClip();
this.unloadMovie();
stop();
Symbol 261 MovieClip [combonums] Frame 2
var realroot = this._parent;
trace("xp root: " + realroot);
realroot.addxp(this.num.txt);
Symbol 261 MovieClip [combonums] Frame 24
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 263 MovieClip [fader] Frame 13
stop();
var realroot = this._parent;
realroot.fadedIn();
Symbol 267 MovieClip [points] Frame 6
stop();
Symbol 268 MovieClip [spark] Frame 1
this.cacheAsBitmap = true;
Symbol 270 MovieClip [spark2] Frame 1
this.cacheAsBitmap = true;
Symbol 286 MovieClip [splode] Frame 1
var realroot = this._parent._parent;
realroot.chkSlash(this.hitarea, true);
Symbol 286 MovieClip [splode] Frame 23
stop();
this.removeMovieClip();
this.unloadMovie();
Symbol 298 MovieClip [splode2] Frame 1
this.dam = 50;
var realroot = this._parent._parent;
trace("splode2 root: " + realroot);
realroot.dudeHit(this, this.hitarea);
Symbol 298 MovieClip [splode2] Frame 23
stop();
this.removeMovieClip();
this.unloadMovie();
Symbol 337 MovieClip Frame 1
var realroot = this._parent._parent._parent;
if (!this.inited) {
this._parent.xp = 3;
this._parent.hp = 10;
this._parent.typ = 0;
this._parent.dam = 20;
realroot.addEnem(this._parent);
this.inited = true;
this.cols = new Array("0x0099FF", "0x00CC00", "0xFF9900", "0xFFFF00");
var mycol = cols[random(cols.length)];
var dacol = new Color(bgcol);
dacol.setRGB(mycol);
bgcol.setMask(msk);
bgcol.cacheAsBitmap = true;
eye.gotoAndPlay(random(30));
}
Symbol 337 MovieClip Frame 11
gotoAndPlay ("rest");
Symbol 337 MovieClip Frame 24
stop();
realroot.removeBad(this._parent);
Symbol 354 MovieClip Frame 1
var realroot = this._parent._parent._parent;
if (!this.inited) {
this._parent.xp = 6;
this._parent.hp = 14;
this._parent.typ = 1;
this._parent.dam = 35;
realroot.addEnem(this._parent);
this.inited = true;
this.cols = new Array("0x0099FF", "0x00CC00", "0xFF9900", "0xFFFF00");
var mycol = cols[random(cols.length)];
var dacol = new Color(bgcol);
dacol.setRGB(mycol);
bgcol.setMask(msk);
bgcol.cacheAsBitmap = true;
}
Symbol 354 MovieClip Frame 9
if ((!this._parent.dead) && (this._parent.hp > 0)) {
gotoAndPlay ("rest");
}
Symbol 354 MovieClip Frame 40
stop();
realroot.removeBad(this._parent);
Symbol 371 MovieClip Frame 1
stop();
var realroot = this._parent._parent._parent;
if (!this.inited) {
this._parent.xp = 8;
this._parent.hp = 5;
this._parent.typ = 2;
this._parent.dam = 35;
this._parent.groundimmune = true;
realroot.addEnem(this._parent);
this.inited = true;
this.cols = new Array("0x0099FF", "0x00CC00", "0xFF9900", "0xFFFF00");
var mycol = cols[random(cols.length)];
var dacol = new Color(bgcol);
dacol.setRGB(mycol);
bgcol.setMask(msk);
bgcol.cacheAsBitmap = true;
}
Symbol 371 MovieClip Frame 27
stop();
realroot.removeBad(this._parent);
Symbol 421 MovieClip Frame 1
var realroot = this._parent._parent._parent;
if (!this.inited) {
this._parent.xp = 25;
this._parent.hp = 35;
this._parent.typ = 3;
this._parent.dam = 55;
realroot.addEnem(this._parent);
this.inited = true;
this._parent.independent = true;
}
Symbol 421 MovieClip Frame 9
if ((!this._parent.dead) && (this._parent.hp > 0)) {
gotoAndPlay ("rest");
}
Symbol 421 MovieClip Frame 14
realroot.dudeHit(this._parent, box);
Symbol 421 MovieClip Frame 15
realroot.dudeHit(this._parent, box);
Symbol 421 MovieClip Frame 16
realroot.dudeHit(this._parent, box);
Symbol 421 MovieClip Frame 25
this._parent.attacking = false;
this._parent.walking = false;
this._parent.resting = false;
this._parent.aicv = random(25);
if ((!this._parent.dead) && (this._parent.hp > 0)) {
gotoAndPlay ("rest");
}
Symbol 421 MovieClip Frame 36
if ((!this._parent.dead) && (this._parent.hp > 0)) {
gotoAndPlay ("walk");
}
Symbol 421 MovieClip Frame 71
stop();
realroot.removeBad(this._parent);
Symbol 470 MovieClip [plat_hud] Frame 1
var realroot = this._parent;
if (!this.inited) {
reminder._visible = false;
this.inited = true;
msg._visible = false;
cul = new Color(col);
cul.setRGB(realroot.armorarray[realroot.curarmor]);
col.cacheAsBitmap = true;
col.setMask(masker);
col._alpha = 100;
this.arm = "LEVEL - " + realroot.curarmor;
this.mag = "LEVEL - " + realroot.curmag;
this.att = "LEVEL - " + realroot.cursword;
}
Symbol 473 MovieClip [knight0_axe] Frame 1
this.dam = 130;
Symbol 480 MovieClip [rock] Frame 1
stop();
this.dam = 75;
Symbol 480 MovieClip [rock] Frame 12
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 491 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 499 MovieClip [platlev0_0] Frame 1
this.lef = 0;
this.rig = 1200;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("owbattle");
Symbol 500 MovieClip [platlev0_1] Frame 1
this.lef = -300;
this.rig = 1200;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("owbattle");
Symbol 501 MovieClip [platlev0_2] Frame 1
this.lef = -300;
this.rig = 1200;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("owbattle");
Symbol 524 MovieClip Frame 1
stop();
Symbol 525 MovieClip Frame 1
stop();
if (!this.inited) {
this.inited = true;
this.pointer = 1;
this.maxx = 14;
this.hitcv = 0;
}
Symbol 525 MovieClip Frame 2
gotoAndPlay(_currentframe);
Symbol 525 MovieClip Frame 3
gotoAndPlay(_currentframe);
Symbol 525 MovieClip Frame 4
gotoAndPlay(_currentframe);
Symbol 525 MovieClip Frame 5
gotoAndPlay(_currentframe);
Symbol 525 MovieClip Frame 6
gotoAndPlay(_currentframe);
Symbol 525 MovieClip Frame 7
gotoAndPlay(_currentframe);
Symbol 538 MovieClip Frame 1
stop();
Symbol 544 MovieClip Frame 1
stop();
Symbol 554 MovieClip Frame 1
var realroot = this._parent._parent._parent;
if (!this.inited) {
this._parent.fireballcv = 0;
this.shield._visible = false;
this.shield.cv = 0;
this._parent.nam = "Demon Beast";
this._parent.aicv = 0;
this._parent.mod = 0;
this._parent.xp = 650;
this._parent.hp = 750;
this._parent.maxhp = this._parent.hp;
this._parent.weak = true;
this._parent.independent = true;
this._parent.groundimmune = true;
this._parent.typ = 97;
this._parent.dir = -1;
this._parent.ydir = -1;
this._parent.shielded = true;
this._parent.speed = 15;
this._parent.dam = 130;
this._parent.nomove = true;
this._parent.boss = true;
realroot.addEnem(this._parent);
this.inited = true;
realroot.updateHUD();
}
Symbol 554 MovieClip Frame 30
if (!this._parent.dead) {
gotoAndPlay ("rest");
}
Symbol 554 MovieClip Frame 31
realroot.playSound("splosion1");
realroot.flashIt();
realroot.setNoise(0);
Symbol 554 MovieClip Frame 32
realroot.playLoudSound("raaar");
Symbol 554 MovieClip Frame 35
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 39
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 42
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 45
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 48
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 51
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 55
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 58
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 61
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 64
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 67
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 73
realroot.reviveDemon();
this._parent._parent.inv = true;
Symbol 554 MovieClip Frame 85
stop();
this.lastframe = true;
this._parent.lastframe = true;
this._parent._parent.inv = false;
Symbol 554 MovieClip Frame 86
this._parent._parent.inv = true;
trace("MADE HIM INV!");
Symbol 554 MovieClip Frame 87
realroot.setNoise(0);
Symbol 554 MovieClip Frame 89
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 91
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 554 MovieClip Frame 93
realroot.playSound("splosion1");
realroot.defeatBoss();
realroot.flashIt();
Symbol 554 MovieClip Frame 120
stop();
var b = realroot.attachMovie("blackout", "blacky", 9911102201);
b._alpha = 0;
b.onEnterFrame = function () {
if ((!realroot.platpause) && (!realroot.freeze)) {
this._alpha = this._alpha + 2;
if (this._alpha >= 100) {
delete this.onEnterFrame;
realroot.runEnd();
this.unloadMovie();
this.removeMovieClip();
}
}
};
Symbol 554 MovieClip Frame 121
stop();
Symbol 555 MovieClip Frame 1
stop();
Symbol 558 MovieClip [platlev0_97] Frame 1
this.lef = -250;
this.rig = 900;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("finalboss");
Symbol 564 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 565 MovieClip [platlev1_0] Frame 1
this.lef = -400;
this.rig = 1500;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("owbattle");
Symbol 566 MovieClip [platlev1_1] Frame 1
this.lef = -400;
this.rig = 1500;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("owbattle");
Symbol 571 MovieClip Frame 1
if (!this.inited) {
this.inited = true;
var ran = random(8);
this.gotoAndPlay(ran);
}
Symbol 609 MovieClip Frame 1
stop();
Symbol 609 MovieClip Frame 2
var realroot = this._parent._parent._parent;
trace("fairy root: " + realroot);
realroot.giveSpell(4);
Symbol 610 MovieClip Frame 1
this.fairy = true;
var realroot = this._parent._parent;
if (realroot.gotfairy) {
this._visible = false;
}
Symbol 615 MovieClip [platlev0_194] Frame 1
this.lef = 0;
this.rig = 1300;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("ssmellow");
Symbol 645 MovieClip Frame 23
var realroot = this._parent._parent._parent._parent;
realroot.giveSpell(3);
Symbol 645 MovieClip Frame 51
this._parent.gotoAndStop("rest");
stop();
Symbol 646 MovieClip Frame 1
stop();
Symbol 649 MovieClip Frame 1
stop();
Symbol 653 MovieClip [platlev1_195] Frame 1
this.lef = -400;
this.rig = 1200;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("dungeonrelaxed");
Symbol 663 MovieClip Frame 23
var realroot = this._parent._parent._parent._parent;
realroot.giveSpell(2);
Symbol 663 MovieClip Frame 51
this._parent.gotoAndStop("rest");
stop();
Symbol 664 MovieClip Frame 1
stop();
Symbol 665 MovieClip Frame 1
stop();
Symbol 666 MovieClip [platlev1_196] Frame 1
this.lef = -400;
this.rig = 1200;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("ssmellow");
Symbol 696 MovieClip Frame 2
var realroot = this._parent._parent._parent._parent;
realroot.giveSpell(1);
Symbol 696 MovieClip Frame 12
this._parent.gotoAndStop("rest");
Symbol 702 MovieClip Frame 1
stop();
var realroot = this._parent._parent._parent;
trace("crybaby root: " + realroot);
if (realroot.deliveredwood) {
gotoAndStop ("happy");
}
Symbol 703 MovieClip Frame 1
stop();
Symbol 709 MovieClip Frame 13
var realroot = this._parent._parent._parent._parent;
realroot.giveSpell(1, true);
Symbol 709 MovieClip Frame 41
this._parent.gotoAndStop("rest");
stop();
Symbol 710 MovieClip Frame 1
stop();
Symbol 711 MovieClip Frame 1
stop();
Symbol 712 MovieClip [platlev2_197] Frame 1
this.lef = 0;
this.rig = 1000;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("ssmellow");
Symbol 732 MovieClip Frame 20
stop();
var realroot = this._parent._parent._parent._parent;
realroot.blacksmithGive();
Symbol 733 MovieClip Frame 18
this._parent.gotoAndStop("rest2");
Symbol 735 MovieClip Frame 1
stop();
var realroot = this._parent._parent._parent;
if (realroot.gotaxe) {
gotoAndStop ("rest2");
}
Symbol 738 MovieClip [platlev0_198] Frame 1
var realroot = this._parent;
this.lef = 0;
this.rig = 1100;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
if (!realroot.gotfairy) {
fair._visible = false;
}
realroot.runMusic("ssmellow");
Symbol 739 MovieClip [platlev1_2] Frame 1
this.lef = -400;
this.rig = 1500;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("owbattle");
Symbol 741 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 742 MovieClip [platlev1_3] Frame 1
this.lef = -400;
this.rig = 1500;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("dungeonbattle");
Symbol 748 MovieClip Frame 11
gotoAndPlay(this._currentframe + random(30));
Symbol 767 MovieClip Frame 20
stop();
Symbol 769 MovieClip Frame 1
stop();
var realroot = this._parent._parent._parent;
if (!this._parent.inited) {
this._parent.web = this._parent._parent.createEmptyMovieClip("web" + realroot.effcv, realroot.effcv + 67781);
realroot.effcv++;
realroot.game.fg.swapDepths(realroot.effcv + 67781);
realroot.effcv++;
this._parent.xhome = this._parent._x;
this._parent.upamt = 20 + random(40);
this._parent.downamt = 20 + random(40);
if (realroot.indungeon) {
this._parent.hp = 40;
this._parent.xp = 35;
} else {
this._parent.xp = 10;
this._parent.hp = 8;
}
this._parent.typ = 4;
this._parent.dam = 65;
realroot.addEnem(this._parent);
this._parent.inited = true;
this._parent.nomove = true;
this._parent.home = this._parent._y;
this._parent.independent = true;
this._parent.groundimmune = true;
}
Symbol 769 MovieClip Frame 19
stop();
realroot.removeBad(this._parent);
Symbol 770 MovieClip Frame 1
stop();
Symbol 771 MovieClip [platlev1_4] Frame 1
this.lef = -400;
this.rig = 1500;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("dungeonbattle");
Symbol 776 MovieClip Frame 1
stop();
Symbol 813 MovieClip Frame 1
var realroot = this._parent._parent._parent;
if (!this._parent.inited) {
this._parent.troll = true;
this._parent.xp = 75;
this._parent.hp = 150;
this._parent.typ = 5;
this._parent.dam = 65;
realroot.addEnem(this._parent);
this._parent.inited = true;
this._parent.nomove = true;
this._parent.independent = true;
this._parent.groundimmune = true;
}
Symbol 813 MovieClip Frame 21
if ((!this._parent.dead) && (this._parent.hp > 0)) {
gotoAndPlay ("rest");
}
Symbol 813 MovieClip Frame 41
realroot.dudeHit(this._parent, box);
Symbol 813 MovieClip Frame 42
realroot.dudeHit(this._parent, box);
Symbol 813 MovieClip Frame 43
realroot.dudeHit(this._parent, box);
Symbol 813 MovieClip Frame 61
if ((!this._parent.dead) && (this._parent.hp > 0)) {
gotoAndPlay ("rest");
}
Symbol 813 MovieClip Frame 62
if ((!this._parent.dead) && (this._parent.hp > 0)) {
gotoAndPlay ("rest");
}
Symbol 813 MovieClip Frame 63
if ((!this._parent.dead) && (this._parent.hp > 0)) {
gotoAndPlay ("rest");
}
Symbol 813 MovieClip Frame 64
if ((!this._parent.dead) && (this._parent.hp > 0)) {
gotoAndPlay ("rest");
}
Symbol 813 MovieClip Frame 65
if ((!this._parent.dead) && (this._parent.hp > 0)) {
gotoAndPlay ("rest");
}
Symbol 813 MovieClip Frame 66
if ((!this._parent.dead) && (this._parent.hp > 0)) {
gotoAndPlay ("rest");
}
Symbol 813 MovieClip Frame 67
if ((!this._parent.dead) && (this._parent.hp > 0)) {
gotoAndPlay ("rest");
}
Symbol 813 MovieClip Frame 91
stop();
realroot.removeBad(this._parent);
Symbol 814 MovieClip Frame 1
stop();
Symbol 815 MovieClip [platlev1_5] Frame 1
this.lef = -400;
this.rig = 1500;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("dungeonbattle");
Symbol 817 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 833 MovieClip Frame 9
stop();
Symbol 834 MovieClip Frame 1
if (!this._parent._parent.comp.stuck) {
eyes._visible = false;
} else if (!eyes._visible) {
eyes._visible = true;
eyes.gotoAndPlay(1);
}
Symbol 845 MovieClip Frame 2
var realroot = this._parent._parent._parent._parent;
realroot.playSound("splosion1");
Symbol 845 MovieClip Frame 4
realroot.playSound("splosion1");
Symbol 845 MovieClip Frame 7
realroot.playSound("splosion1");
Symbol 845 MovieClip Frame 10
realroot.playSound("splosion1");
Symbol 845 MovieClip Frame 13
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 845 MovieClip Frame 15
realroot.playSound("splosion1");
Symbol 845 MovieClip Frame 17
realroot.playSound("splosion1");
Symbol 845 MovieClip Frame 24
stop();
this.lastframe = true;
this.onEnterFrame = function () {
if (!realroot.platpause) {
delete this.onEnterFrame;
realroot.defeatBoss();
}
};
Symbol 845 MovieClip Frame 26
stop();
Symbol 845 MovieClip Frame 27
stop();
Symbol 845 MovieClip Frame 28
stop();
Symbol 845 MovieClip Frame 29
stop();
Symbol 845 MovieClip Frame 30
stop();
Symbol 845 MovieClip Frame 31
stop();
Symbol 845 MovieClip Frame 32
stop();
Symbol 845 MovieClip Frame 33
stop();
Symbol 845 MovieClip Frame 34
stop();
Symbol 845 MovieClip Frame 35
stop();
Symbol 851 MovieClip Frame 2
var realroot = this._parent._parent._parent._parent;
realroot.playSound("gleam");
Symbol 851 MovieClip Frame 25
this.hitarea.onEnterFrame = function () {
realroot.chkAwardGet(this);
};
Symbol 851 MovieClip Frame 32
stop();
Symbol 852 MovieClip Frame 1
var realroot = this._parent._parent._parent;
if (!this.inited) {
this._parent.nam = "Red Knight";
this._parent.aicv = 0;
this._parent.mod = 0;
this._parent.xp = 400;
this._parent.gotaxe = true;
this._parent.hp = 850;
this._parent.maxhp = this._parent.hp;
this._parent.typ = 500;
this._parent.dam = 130;
this._parent.nomove = true;
this._parent.boss = true;
realroot.addEnem(this._parent);
this.inited = true;
realroot.updateHUD();
}
Symbol 852 MovieClip Frame 20
if (!this._parent.dead) {
gotoAndPlay ("rest");
}
Symbol 852 MovieClip Frame 30
if (!this._parent.dead) {
realroot.dudeHit(this._parent, axe.hitarea);
realroot.dudeHit(this._parent, axe.hitarea1);
realroot.dudeHit(this._parent, axe.hitarea2);
realroot.dudeHit(this._parent, axe.hitarea3);
realroot.screenShake(10);
realroot.playSound("hit2");
}
Symbol 852 MovieClip Frame 47
if (!this._parent.dead) {
realroot.knight0AtkEnd(this._parent);
gotoAndPlay ("rest");
}
Symbol 852 MovieClip Frame 55
if (!this._parent.dead) {
realroot.tossAxe(this._parent);
}
Symbol 852 MovieClip Frame 84
if (!this._parent.dead) {
gotoAndPlay ("rest2");
}
Symbol 852 MovieClip Frame 97
if (!this._parent.dead) {
gotoAndPlay ("walk");
}
Symbol 852 MovieClip Frame 110
if (!this._parent.dead) {
realroot.retrieveAxe(this._parent);
gotoAndPlay ("rest");
}
Symbol 852 MovieClip Frame 112
realroot.setNoise(0);
this._parent.gotaxe = false;
realroot.updateHUD();
Symbol 852 MovieClip Frame 113
Symbol 852 MovieClip Frame 114
stop();
Symbol 852 MovieClip Frame 115
stop();
Symbol 852 MovieClip Frame 116
stop();
Symbol 852 MovieClip Frame 117
stop();
Symbol 852 MovieClip Frame 118
stop();
Symbol 852 MovieClip Frame 119
stop();
Symbol 852 MovieClip Frame 120
stop();
Symbol 852 MovieClip Frame 121
stop();
Symbol 853 MovieClip Frame 1
stop();
Symbol 855 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 857 MovieClip [platlev1_500] Frame 1
this.lef = -200;
this.rig = 1000;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("dungeonboss");
Symbol 883 MovieClip Frame 19
stop();
Symbol 887 MovieClip Frame 2
var realroot = this._parent._parent._parent._parent;
realroot.playSound("splosion1");
Symbol 887 MovieClip Frame 4
realroot.playSound("splosion1");
Symbol 887 MovieClip Frame 7
realroot.playSound("splosion1");
Symbol 887 MovieClip Frame 10
realroot.playSound("splosion1");
Symbol 887 MovieClip Frame 16
realroot.playSound("splosion1");
Symbol 887 MovieClip Frame 18
realroot.playSound("splosion1");
Symbol 887 MovieClip Frame 20
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 887 MovieClip Frame 25
stop();
this.lastframe = true;
this.onEnterFrame = function () {
if (!realroot.platpause) {
delete this.onEnterFrame;
realroot.defeatBoss();
}
};
Symbol 887 MovieClip Frame 26
stop();
Symbol 887 MovieClip Frame 27
stop();
Symbol 887 MovieClip Frame 28
stop();
Symbol 887 MovieClip Frame 29
stop();
Symbol 887 MovieClip Frame 30
stop();
Symbol 887 MovieClip Frame 31
stop();
Symbol 887 MovieClip Frame 32
stop();
Symbol 887 MovieClip Frame 33
stop();
Symbol 887 MovieClip Frame 34
stop();
Symbol 887 MovieClip Frame 35
stop();
Symbol 888 MovieClip Frame 2
var realroot = this._parent._parent._parent._parent;
realroot.playSound("gleam");
Symbol 888 MovieClip Frame 25
this.hitarea.onEnterFrame = function () {
realroot.chkAwardGet(this);
};
Symbol 888 MovieClip Frame 32
stop();
Symbol 889 MovieClip Frame 1
var realroot = this._parent._parent._parent;
if (!this.inited) {
this._parent.spindist = 42;
this._parent.gox = 0;
this._parent.nam = "Purple Knight";
this._parent.aicv = 0;
this._parent.mod = 0;
this._parent.xp = 400;
this._parent.hp = 725;
this._parent.maxhp = this._parent.hp;
this._parent.topdir = -1;
this._parent.typ = 501;
this._parent.dam = 130;
this._parent.nomove = true;
this._parent.boss = true;
realroot.addEnem(this._parent);
this.inited = true;
realroot.updateHUD();
}
Symbol 889 MovieClip Frame 20
if (!this._parent.dead) {
gotoAndPlay ("rest");
} else {
stop();
}
Symbol 889 MovieClip Frame 21
if (this._parent.dead) {
gotoAndPlay ("rest");
}
Symbol 889 MovieClip Frame 22
if (this._parent.dead) {
gotoAndPlay ("rest");
}
Symbol 889 MovieClip Frame 31
this._parent.ready = true;
Symbol 889 MovieClip Frame 32
stop();
Symbol 889 MovieClip Frame 60
if (!this._parent.dead) {
gotoAndPlay ("dizzy");
}
Symbol 889 MovieClip Frame 61
if ((!realroot.platpause) && (!this._parent.dead)) {
gotoAndPlay ("dizzy");
}
Symbol 889 MovieClip Frame 62
if ((!realroot.platpause) && (!this._parent.dead)) {
gotoAndPlay ("dizzy");
}
Symbol 889 MovieClip Frame 71
realroot.dudeHit(this._parent, box);
Symbol 889 MovieClip Frame 72
realroot.dudeHit(this._parent, box);
Symbol 889 MovieClip Frame 73
realroot.dudeHit(this._parent, box);
Symbol 889 MovieClip Frame 76
if (this._parent.dead) {
gotoAndPlay ("rest");
}
Symbol 889 MovieClip Frame 77
if (this._parent.dead) {
gotoAndPlay ("rest");
}
Symbol 889 MovieClip Frame 78
if (this._parent.dead) {
gotoAndPlay ("rest");
}
Symbol 889 MovieClip Frame 80
realroot.setNoise(0);
realroot.updateHUD();
Symbol 890 MovieClip Frame 1
stop();
Symbol 906 MovieClip Frame 4
var realroot = this._parent._parent._parent._parent;
realroot.dudeHit(this._parent._parent, box);
Symbol 906 MovieClip Frame 5
realroot.dudeHit(this._parent._parent, box);
Symbol 906 MovieClip Frame 7
realroot.dudeHit(this._parent._parent, box);
Symbol 906 MovieClip Frame 9
realroot.dudeHit(this._parent._parent, box);
Symbol 906 MovieClip Frame 11
realroot.dudeHit(this._parent._parent, box);
Symbol 906 MovieClip Frame 13
realroot.dudeHit(this._parent._parent, box);
Symbol 906 MovieClip Frame 15
realroot.dudeHit(this._parent._parent, box);
Symbol 906 MovieClip Frame 17
realroot.dudeHit(this._parent._parent, box);
Symbol 906 MovieClip Frame 19
realroot.dudeHit(this._parent._parent, box);
Symbol 906 MovieClip Frame 31
realroot.endSpurt(this._parent._parent);
Symbol 907 MovieClip Frame 1
stop();
Symbol 908 MovieClip Frame 1
stop();
var realroot = this._parent._parent;
if (!this.inited) {
this.inited = true;
realroot.addFireSpurt(this);
this.dam = 70;
}
Symbol 908 MovieClip Frame 9
realroot.shootSpurt(this);
Symbol 909 MovieClip [platlev1_501] Frame 1
this.lef = -265;
this.rig = 910;
this.fric = 0.6;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("dungeonboss");
Symbol 914 MovieClip Frame 1
this.cv = 0;
this.dir = random(2);
if (this.dir == 0) {
this.dir = -1;
}
Symbol 933 MovieClip Frame 2
var realroot = this._parent._parent._parent._parent;
realroot.playSound("splosion1");
Symbol 933 MovieClip Frame 4
realroot.playSound("splosion1");
Symbol 933 MovieClip Frame 7
realroot.playSound("splosion1");
Symbol 933 MovieClip Frame 10
realroot.playSound("splosion1");
Symbol 933 MovieClip Frame 16
realroot.playSound("splosion1");
Symbol 933 MovieClip Frame 18
realroot.playSound("splosion1");
Symbol 933 MovieClip Frame 20
realroot.playSound("splosion1");
realroot.flashIt();
Symbol 933 MovieClip Frame 25
stop();
this.lastframe = true;
this.onEnterFrame = function () {
if (!realroot.platpause) {
delete this.onEnterFrame;
realroot.defeatBoss();
}
};
Symbol 933 MovieClip Frame 26
stop();
Symbol 933 MovieClip Frame 27
stop();
Symbol 933 MovieClip Frame 28
stop();
Symbol 933 MovieClip Frame 29
stop();
Symbol 933 MovieClip Frame 30
stop();
Symbol 933 MovieClip Frame 31
stop();
Symbol 933 MovieClip Frame 32
stop();
Symbol 933 MovieClip Frame 33
stop();
Symbol 933 MovieClip Frame 34
stop();
Symbol 933 MovieClip Frame 35
stop();
Symbol 934 MovieClip Frame 2
var realroot = this._parent._parent._parent._parent;
realroot.playSound("gleam");
Symbol 934 MovieClip Frame 25
this.hitarea.onEnterFrame = function () {
realroot.chkAwardGet(this);
};
Symbol 934 MovieClip Frame 32
stop();
Symbol 935 MovieClip Frame 1
var realroot = this._parent._parent._parent;
if (!this.inited) {
this._parent.dir = -1;
this._parent.nam = "Green Knight";
this._parent.aicv = 0;
this._parent.mod = 0;
this._parent.xp = 400;
this._parent.hp = 1100;
this._parent.maxhp = this._parent.hp;
this._parent.typ = 502;
this._parent.dam = 130;
this._parent.nomove = true;
this._parent.boss = true;
realroot.addEnem(this._parent);
this.inited = true;
realroot.updateHUD();
}
Symbol 935 MovieClip Frame 20
if (!this._parent.dead) {
gotoAndPlay ("rest");
}
Symbol 935 MovieClip Frame 35
if (!this._parent.dead) {
gotoAndPlay ("walk");
}
Symbol 935 MovieClip Frame 41
realroot.dudeHit(this._parent, box);
Symbol 935 MovieClip Frame 42
realroot.dudeHit(this._parent, box);
Symbol 935 MovieClip Frame 43
realroot.dudeHit(this._parent, box);
Symbol 935 MovieClip Frame 47
if (!this._parent.dead) {
this._parent.attacking = false;
gotoAndPlay ("rest");
}
Symbol 935 MovieClip Frame 75
realroot.setNoise(0);
realroot.updateHUD();
Symbol 936 MovieClip Frame 1
stop();
Symbol 937 MovieClip [platlev1_502] Frame 1
this.lef = -400;
this.rig = 1500;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("dungeonboss");
Symbol 939 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 940 MovieClip [platlev2_0] Frame 1
this.lef = -200;
this.rig = 1200;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("owbattle");
Symbol 941 MovieClip [platlev2_1] Frame 1
this.lef = -200;
this.rig = 1200;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("owbattle");
Symbol 942 MovieClip [platlev2_2] Frame 1
this.lef = -200;
this.rig = 1200;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("owbattle");
Symbol 946 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 986 MovieClip Frame 40
var realroot = this._parent._parent._parent._parent;
realroot.addBossBall();
Symbol 1004 MovieClip Frame 1
var realroot = this._parent._parent._parent._parent;
realroot.grabBall();
Symbol 1004 MovieClip Frame 4
realroot.playSound("swing" + random(3));
Symbol 1004 MovieClip Frame 7
realroot.ballBomb();
realroot.dudeHit(this._parent._parent, block1);
realroot.dudeHit(this._parent._parent, block2);
Symbol 1017 MovieClip Frame 1
var realroot = this._parent._parent._parent._parent;
Symbol 1017 MovieClip Frame 3
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 4
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 6
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 8
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 10
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 12
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 18
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 20
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 21
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 23
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 25
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 27
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 29
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 35
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 37
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 38
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 40
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 42
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 44
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 46
realroot.playSound("splosion1");
Symbol 1017 MovieClip Frame 52
realroot.playSound("lasersplode");
realroot.flashIt();
Symbol 1017 MovieClip Frame 70
stop();
this.lastframe = true;
this.onEnterFrame = function () {
if (!realrootroot.platpause) {
delete this.onEnterFrame;
realroot.defeatBoss();
}
};
Symbol 1017 MovieClip Frame 71
stop();
Symbol 1017 MovieClip Frame 72
stop();
Symbol 1017 MovieClip Frame 73
stop();
Symbol 1017 MovieClip Frame 74
stop();
Symbol 1017 MovieClip Frame 75
stop();
Symbol 1017 MovieClip Frame 76
stop();
Symbol 1017 MovieClip Frame 77
stop();
Symbol 1017 MovieClip Frame 78
stop();
Symbol 1017 MovieClip Frame 79
stop();
Symbol 1017 MovieClip Frame 80
stop();
Symbol 1017 MovieClip Frame 81
stop();
Symbol 1017 MovieClip Frame 82
stop();
Symbol 1017 MovieClip Frame 83
stop();
Symbol 1017 MovieClip Frame 84
stop();
Symbol 1017 MovieClip Frame 85
stop();
Symbol 1017 MovieClip Frame 86
stop();
Symbol 1017 MovieClip Frame 87
stop();
Symbol 1017 MovieClip Frame 88
stop();
Symbol 1017 MovieClip Frame 89
stop();
Symbol 1017 MovieClip Frame 90
stop();
Symbol 1017 MovieClip Frame 91
stop();
Symbol 1017 MovieClip Frame 92
stop();
Symbol 1017 MovieClip Frame 93
stop();
Symbol 1017 MovieClip Frame 94
stop();
Symbol 1017 MovieClip Frame 95
stop();
Symbol 1017 MovieClip Frame 96
stop();
Symbol 1017 MovieClip Frame 97
stop();
Symbol 1017 MovieClip Frame 98
stop();
Symbol 1017 MovieClip Frame 99
stop();
Symbol 1017 MovieClip Frame 100
stop();
Symbol 1017 MovieClip Frame 101
stop();
Symbol 1017 MovieClip Frame 102
stop();
Symbol 1017 MovieClip Frame 103
stop();
Symbol 1017 MovieClip Frame 104
stop();
Symbol 1017 MovieClip Frame 105
stop();
Symbol 1017 MovieClip Frame 106
stop();
Symbol 1017 MovieClip Frame 107
stop();
Symbol 1017 MovieClip Frame 108
stop();
Symbol 1017 MovieClip Frame 109
stop();
Symbol 1017 MovieClip Frame 110
stop();
Symbol 1017 MovieClip Frame 111
stop();
Symbol 1017 MovieClip Frame 112
stop();
Symbol 1017 MovieClip Frame 113
stop();
Symbol 1017 MovieClip Frame 114
stop();
Symbol 1017 MovieClip Frame 115
stop();
Symbol 1017 MovieClip Frame 116
stop();
Symbol 1017 MovieClip Frame 117
stop();
Symbol 1017 MovieClip Frame 118
stop();
Symbol 1017 MovieClip Frame 119
stop();
Symbol 1017 MovieClip Frame 120
stop();
Symbol 1017 MovieClip Frame 121
stop();
Symbol 1017 MovieClip Frame 122
stop();
Symbol 1017 MovieClip Frame 123
stop();
Symbol 1017 MovieClip Frame 124
stop();
Symbol 1017 MovieClip Frame 125
stop();
Symbol 1017 MovieClip Frame 126
stop();
Symbol 1017 MovieClip Frame 127
stop();
Symbol 1017 MovieClip Frame 128
stop();
Symbol 1021 MovieClip Frame 2
var realroot = this._parent._parent._parent._parent;
realroot.playSound("gleam");
Symbol 1021 MovieClip Frame 37
stop();
this.hitarea.onEnterFrame = function () {
trace("running hitarea enterframe");
realroot.chkAwardGet(this);
};
Symbol 1022 MovieClip Frame 1
stop();
var realroot = this._parent._parent._parent;
trace("beast root: " + realroot);
if (!this.inited) {
this.lastframe = true;
this._parent.nam = "CANYON BEAST";
this._parent.aicv = 0;
this._parent.mod = 0;
this._parent.numballs = 0;
this._parent.xp = 200;
this._parent.hp = 150;
this._parent.maxhp = this._parent.hp;
this._parent.typ = 99;
this._parent.dam = 50;
this._parent.nomove = true;
this._parent.boss = true;
realroot.addEnem(this._parent);
this.inited = true;
realroot.updateHUD();
}
Symbol 1022 MovieClip Frame 4
stop();
realroot.playLoudSound("raaar");
realroot.setNoise(0);
Symbol 1023 MovieClip Frame 1
stop();
Symbol 1024 MovieClip [platlev2_99] Frame 1
this.lef = -600;
this.rig = 1300;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var i = 0;
while (i < 3) {
var tar = eval ("boss.ball" + i);
tar._visible = false;
i++;
}
var realroot = this._parent;
realroot.runMusic("otherbosses");
Symbol 1026 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1036 MovieClip Frame 1
this.lastframe = false;
Symbol 1036 MovieClip Frame 10
var realroot = this._parent._parent._parent._parent._parent;
realroot.dragonBall(aimer);
Symbol 1036 MovieClip Frame 18
realroot.dragonBall(aimer);
Symbol 1036 MovieClip Frame 25
realroot.dragonBall(aimer);
Symbol 1036 MovieClip Frame 110
stop();
this.lastframe = true;
realroot.dragonBallStop();
Symbol 1037 MovieClip Frame 1
stop();
Symbol 1040 MovieClip Frame 1
var realroot = this._parent._parent._parent._parent;
Symbol 1040 MovieClip Frame 4
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 5
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 7
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 9
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 11
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 13
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 21
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 22
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 24
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 26
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 28
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 30
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 38
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 39
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 41
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 43
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 45
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 47
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 54
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 56
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 58
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 60
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 62
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 64
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 66
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 68
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 70
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 72
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 74
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 76
realroot.playSound("splosion1");
Symbol 1040 MovieClip Frame 83
stop();
this.lastframe = true;
this.onEnterFrame = function () {
if (!realroot.platpause) {
delete this.onEnterFrame;
realroot.defeatBoss();
}
};
Symbol 1040 MovieClip Frame 84
stop();
Symbol 1040 MovieClip Frame 85
stop();
Symbol 1040 MovieClip Frame 86
stop();
Symbol 1040 MovieClip Frame 87
stop();
Symbol 1040 MovieClip Frame 88
stop();
Symbol 1040 MovieClip Frame 89
stop();
Symbol 1040 MovieClip Frame 90
stop();
Symbol 1040 MovieClip Frame 91
stop();
Symbol 1040 MovieClip Frame 92
stop();
Symbol 1040 MovieClip Frame 93
stop();
Symbol 1040 MovieClip Frame 94
stop();
Symbol 1040 MovieClip Frame 95
stop();
Symbol 1040 MovieClip Frame 96
stop();
Symbol 1040 MovieClip Frame 97
stop();
Symbol 1040 MovieClip Frame 98
stop();
Symbol 1040 MovieClip Frame 99
stop();
Symbol 1040 MovieClip Frame 100
stop();
Symbol 1040 MovieClip Frame 101
stop();
Symbol 1040 MovieClip Frame 102
stop();
Symbol 1040 MovieClip Frame 103
stop();
Symbol 1040 MovieClip Frame 104
stop();
Symbol 1040 MovieClip Frame 105
stop();
Symbol 1040 MovieClip Frame 106
stop();
Symbol 1040 MovieClip Frame 107
stop();
Symbol 1040 MovieClip Frame 108
stop();
Symbol 1040 MovieClip Frame 109
stop();
Symbol 1040 MovieClip Frame 110
stop();
Symbol 1040 MovieClip Frame 111
stop();
Symbol 1040 MovieClip Frame 112
stop();
Symbol 1043 MovieClip Frame 2
var realroot = this._parent._parent._parent._parent;
realroot.playSound("gleam");
Symbol 1043 MovieClip Frame 37
stop();
this.hitarea.onEnterFrame = function () {
realroot.chkAwardGet(this);
};
Symbol 1043 MovieClip Frame 38
stop();
Symbol 1043 MovieClip Frame 39
stop();
Symbol 1043 MovieClip Frame 40
stop();
Symbol 1043 MovieClip Frame 41
stop();
Symbol 1043 MovieClip Frame 42
stop();
Symbol 1043 MovieClip Frame 43
stop();
Symbol 1043 MovieClip Frame 44
stop();
Symbol 1043 MovieClip Frame 45
stop();
Symbol 1043 MovieClip Frame 46
stop();
Symbol 1043 MovieClip Frame 47
stop();
Symbol 1043 MovieClip Frame 48
stop();
Symbol 1043 MovieClip Frame 49
stop();
Symbol 1043 MovieClip Frame 50
stop();
Symbol 1043 MovieClip Frame 51
stop();
Symbol 1043 MovieClip Frame 52
stop();
Symbol 1043 MovieClip Frame 53
stop();
Symbol 1043 MovieClip Frame 54
stop();
Symbol 1043 MovieClip Frame 55
stop();
Symbol 1043 MovieClip Frame 56
stop();
Symbol 1043 MovieClip Frame 57
stop();
Symbol 1043 MovieClip Frame 58
stop();
Symbol 1043 MovieClip Frame 59
stop();
Symbol 1043 MovieClip Frame 60
stop();
Symbol 1043 MovieClip Frame 61
stop();
Symbol 1043 MovieClip Frame 62
stop();
Symbol 1043 MovieClip Frame 63
stop();
Symbol 1043 MovieClip Frame 64
stop();
Symbol 1043 MovieClip Frame 65
stop();
Symbol 1044 MovieClip Frame 1
this.lastframe = false;
var realroot = this._parent._parent._parent;
if (!this.inited) {
this._parent._x = 110;
this._parent.nam = "ISLAND BEAST";
this._parent.aicv = 0;
this._parent.xp = 200;
this._parent.hp = 350;
this._parent.maxhp = this._parent.hp;
this._parent.typ = 98;
this._parent.dam = 70;
this._parent.boss = true;
realroot.addEnem(this._parent);
this.inited = true;
this._parent.groundimmune = true;
this._parent.nomove = true;
realroot.updateHUD();
}
Symbol 1044 MovieClip Frame 15
stop();
this.lastframe = true;
realroot.dragonUp();
Symbol 1044 MovieClip Frame 16
this.lastframe = false;
Symbol 1044 MovieClip Frame 40
realroot.dragonDown();
this.lastframe = true;
stop();
Symbol 1044 MovieClip Frame 41
this.lastframe = true;
realroot.playLoudSound("raaar");
realroot.setNoise(0);
Symbol 1044 MovieClip Frame 42
this.lastframe = true;
stop();
Symbol 1044 MovieClip Frame 43
stop();
Symbol 1045 MovieClip Frame 1
stop();
Symbol 1047 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1048 MovieClip [platlev2_98] Frame 1
this.lef = -600;
this.rig = 1300;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var i = 0;
while (i < 3) {
var tar = eval ("boss.ball" + i);
tar._visible = false;
i++;
}
var realroot = this._parent;
realroot.runMusic("otherbosses");
Symbol 1049 MovieClip [platlev3_0] Frame 1
this.lef = -200;
this.rig = 1200;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("owbattle");
Symbol 1052 MovieClip [platlev3_1] Frame 1
this.lef = -200;
this.rig = 1200;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("owbattle");
Symbol 1053 MovieClip [platlev3_2] Frame 1
this.lef = -200;
this.rig = 1200;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("owbattle");
Symbol 1062 MovieClip [platlev3_3] Frame 1
var realroot = this._parent;
this.lef = -200;
this.rig = 2100;
this.fric = 0.7;
this.grav = 3.5;
flasher._alpha = 0;
if (realroot.rightbridge) {
dude._x = 2050;
}
this._x = (-dude._x) + 320;
realroot.runMusic("owbattle");
Symbol 1082 MovieClip Frame 1
function freshMe() {
realroot.showSword(swordholder);
magholder.updateMe();
this.curxp = "XP: " + realroot.xp;
this.atk = realroot.attackprogression[realroot.cursword];
this.mg = realroot.magicprogression[realroot.curmag];
this.am = realroot.armorprogression[realroot.curarmor];
this.tim = 0;
vals = new Array();
vals[3] = this.atk;
vals[2] = this.mg;
vals[1] = this.am;
var _local2 = 0;
n = 0;
while (n < vals.length) {
if (vals[n] > _local2) {
_local2 = vals[n];
}
n++;
}
if (realroot.xp < _local2) {
vals[0] = 0;
} else {
vals[0] = 99999 /* 0x01869F */;
}
this.locs = new Array(385, 308, 229, 151);
j = 0;
while (j < vals.length) {
danum = vals[j];
if (danum <= realroot.nextxp) {
this.curloc = j;
this.exempt = j;
}
j++;
}
this.upup = false;
this.dup = false;
this.aup = false;
switchBar(this.curloc);
cul = new Color(col);
cul.setRGB(realroot.armorarray[realroot.curarmor]);
col.cacheAsBitmap = true;
col.setMask(masker);
col._alpha = 100;
this.arm = "LEVEL - " + realroot.curarmor;
this.mag = "LEVEL - " + realroot.curmag;
this.att = "LEVEL - " + realroot.cursword;
}
function switchBar(num) {
arr._y = this.locs[num];
}
function runSelect() {
if (curloc == 1) {
if (realroot.curarmor < 8) {
realroot.curhp = realroot.maxhp;
var _local2 = realroot.armorprogression;
realroot.xp = realroot.xp - _local2[realroot.curarmor];
realroot.curarmor++;
}
}
if (curloc == 2) {
if (realroot.curmag < 8) {
realroot.magamt = realroot.maxmag;
var _local2 = realroot.magicprogression;
realroot.xp = realroot.xp - _local2[realroot.curmag];
realroot.curmag++;
}
}
if (curloc == 3) {
if (realroot.cursword < 8) {
var _local2 = realroot.attackprogression;
realroot.xp = realroot.xp - _local2[realroot.cursword];
realroot.cursword++;
}
}
if (curloc == 0) {
realroot.nextpointer++;
if (realroot.nextpointer == 0) {
if (realroot.armorprogression[realroot.curarmor] == 99999) {
realroot.nextpointer = 1;
if (realroot.magicprogression[realroot.curmag] == 99999) {
realroot.nextpointer = 2;
}
}
}
if (realroot.nextpointer == 1) {
if (realroot.magicprogression[realroot.curmag] == 99999) {
realroot.nextpointer = 2;
if (realroot.attackprogression[realroot.cursword] == 99999) {
realroot.nextpointer = 0;
}
}
}
if (realroot.nextpointer == 2) {
if (realroot.attackprogression[realroot.cursword] == 99999) {
realroot.nextpointer = 0;
if (realroot.armorprogression[realroot.curarmor] == 99999) {
realroot.nextpointer = 1;
}
}
}
if (realroot.nextpointer > 2) {
realroot.nextpointer = 0;
}
} else {
var _local1 = 99999 /* 0x01869F */;
if (realroot.attackprogression[realroot.cursword] < _local1) {
realroot.nextpointer = 2;
_local1 = realroot.attackprogression[realroot.cursword];
}
if (realroot.magicprogression[realroot.curmag] < _local1) {
realroot.nextpointer = 1;
_local1 = realroot.magicprogression[realroot.curmag];
}
if (realroot.armorprogression[realroot.curarmor] < _local1) {
realroot.nextpointer = 0;
_local1 = realroot.armorprogression[realroot.curarmor];
}
}
realroot.getNextThing();
realroot.game.dude.guts.freshMe();
var _local1 = 999999 /* 0x0F423F */;
if (realroot.attackprogression[realroot.cursword] < _local1) {
_local1 = realroot.attackprogression[realroot.cursword];
}
if (realroot.magicprogression[realroot.curmag] < _local1) {
_local1 = realroot.magicprogression[realroot.curmag];
}
if (realroot.armorprogression[realroot.curarmor] < _local1) {
_local1 = realroot.armorprogression[realroot.curarmor];
}
if ((realroot.xp < _local1) || (curloc == 0)) {
if (curloc == 0) {
realroot.playLoudSound("nevermind");
} else {
var _local3 = random(10);
realroot.playLoudSound("exclaim" + _local3);
}
realroot.endLevelup();
} else {
var _local3 = random(10);
realroot.playLoudSound("exclaim" + _local3);
freshMe();
}
}
var realroot = this._parent._parent;
if (!this.inited) {
freshMe();
this.inited = true;
}
this.onEnterFrame = function () {
if (this.tim > 8) {
if (!Key.isDown(38)) {
this.upup = true;
}
if (Key.isDown(38) && (this.upup)) {
this.upup = false;
foundit = false;
while (!foundit) {
this.curloc++;
if (this.curloc >= this.locs.length) {
this.curloc = 0;
}
if (vals[curloc] <= realroot.xp) {
foundit = true;
}
}
switchBar(this.curloc);
}
if (!Key.isDown(40)) {
this.dup = true;
}
if (Key.isDown(40) && (this.dup)) {
this.dup = false;
foundit = false;
while (!foundit) {
this.curloc--;
if (this.curloc < 0) {
this.curloc = this.locs.length - 1;
}
if (vals[curloc] <= realroot.xp) {
foundit = true;
}
}
switchBar(this.curloc);
}
if (!Key.isDown(65)) {
this.aup = true;
}
if (Key.isDown(65) && (this.aup)) {
this.aup = false;
runSelect();
}
} else {
this.tim++;
}
};
Symbol 1083 MovieClip [levelup] Frame 2
var realroot = this._parent;
realroot.setNoise(10);
Symbol 1083 MovieClip [levelup] Frame 6
realroot.playLoudSound("levelup1");
Symbol 1083 MovieClip [levelup] Frame 23
stop();
Symbol 1089 MovieClip [fireballburst] Frame 6
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 1098 MovieClip [magchooser] Frame 12
stop();
this.rdy = true;
Symbol 1121 MovieClip [boss0] Frame 40
gotoAndPlay (1);
Symbol 1127 MovieClip [boss1] Frame 40
gotoAndPlay (1);
Symbol 1131 MovieClip [boss2] Frame 1
if (!this.inited) {
this.inited = true;
this._xscale = 85;
this._yscale = this._xscale;
}
Symbol 1131 MovieClip [boss2] Frame 40
gotoAndPlay (1);
Symbol 1139 MovieClip [dungeon0] Frame 1
this._xscale = 70;
this._yscale = this._xscale;
Symbol 1142 MovieClip [footprint] Frame 25
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 1151 MovieClip [groundpoof] Frame 17
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 1163 MovieClip Frame 1
Symbol 1169 MovieClip Frame 1
var realroot = this._parent._parent._parent._parent._parent;
realroot.colorMe(this);
Symbol 1176 MovieClip Frame 1
Symbol 1184 MovieClip Frame 1
var realroot = this._parent._parent._parent._parent._parent;
realroot.colorMe(this);
Symbol 1192 MovieClip Frame 1
var realroot = this._parent._parent._parent._parent._parent;
realroot.colorMe(this);
Symbol 1196 MovieClip Frame 3
var realroot = this._parent._parent._parent._parent;
realroot.mappy.checkAxeHit(hitarea);
Symbol 1196 MovieClip Frame 7
realroot.mappy.endMapAtk();
Symbol 1197 MovieClip Frame 3
var realroot = this._parent._parent._parent._parent;
realroot.mappy.checkAxeHit(hitarea);
Symbol 1197 MovieClip Frame 7
realroot.mappy.endMapAtk();
Symbol 1198 MovieClip Frame 3
var realroot = this._parent._parent._parent._parent;
realroot.mappy.checkAxeHit(hitarea);
Symbol 1198 MovieClip Frame 7
realroot.mappy.endMapAtk();
Symbol 1199 MovieClip Frame 1
stop();
Symbol 1207 MovieClip [map_enemy0] Frame 1
this.temp = 0;
Symbol 1214 MovieClip [map_enemy1] Frame 1
this.temp = 1;
Symbol 1221 MovieClip [map_enemy2] Frame 1
this.temp = 2;
Symbol 1223 MovieClip [map_enemy3] Frame 1
this.temp = 1;
Symbol 1225 MovieClip [map_enemy4] Frame 1
this.temp = 1;
Symbol 1227 MovieClip [map_enemy5] Frame 1
this.temp = 1;
Symbol 1248 MovieClip [treesplode] Frame 24
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 1253 MovieClip [watersplash] Frame 9
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 1292 MovieClip [plat_heart] Frame 7
stop();
Symbol 1303 MovieClip Frame 17
var realroot = this._parent._parent._parent._parent;
realroot.giveSpell(0);
Symbol 1303 MovieClip Frame 45
this._parent.gotoAndStop("rest");
stop();
Symbol 1304 MovieClip Frame 1
stop();
Symbol 1305 MovieClip Frame 1
stop();
Symbol 1306 MovieClip [platlev0_199] Frame 1
this.lef = 0;
this.rig = 1200;
this.fric = 0.7;
this.grav = 4;
flasher._alpha = 0;
var realroot = this._parent;
realroot.runMusic("ssmellow");
Symbol 1365 MovieClip Frame 1
stop();
Symbol 1378 Button
on (press) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 1381 MovieClip Frame 1
var realroot = this._parent._parent;
realroot.stop();
gotoAndPlay (2);
Symbol 1381 MovieClip Frame 185
var realroot = this._parent._parent;
realroot.gotoAndStop("main");
Symbol 1420 MovieClip Frame 1
stop();
Symbol 1441 MovieClip Frame 1
this.onPress = function () {
};
Symbol 1450 MovieClip Frame 1
this._visible = false;
var realroot = this._parent._parent;
but_yes.onPress = function () {
realroot.clearDat();
this._parent._visible = false;
};
but_no.onPress = function () {
this._parent._visible = false;
};
Symbol 1459 MovieClip Frame 1
var realroot = this._parent._parent;
trace("menumain_scroller root: " + realroot);
but_start.onPress = function () {
realroot.goTime();
};
Symbol 1464 MovieClip Frame 1
hi._visible = false;
but_high.onPress = function () {
hi._visible = true;
hi.bg.onPress = function () {
this._parent._visible = false;
};
};
but_walk.onPress = function () {
getURL ("http://armorgames.com/guide/chibi-knight-video-guide", "_blank");
};
but_ag.onPress = function () {
getURL ("http://www.armorgames.com", "_blank");
};
but_moregames.onPress = function () {
getURL ("http://www.armorgames.com", "_blank");
};
but_bomtoons.onPress = function () {
getURL ("http://www.bomtoons.com", "_blank");
};
but_music.onPress = function () {
getURL ("http://www.reverbnation.com/brianholmes", "_blank");
};
duo.gotoAndPlay(1200);
Symbol 1464 MovieClip Frame 1334
gotoAndPlay ("repeat");
Symbol 1466 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1469 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1471 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1473 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1475 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1477 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1479 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1481 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1483 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1485 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1487 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1489 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1494 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1498 MovieClip Frame 1
this._parent.addMe(this);
this.tree = true;
this.woodvalue = 5;
stop();
this.cacheAsBitmap = true;
Symbol 1501 MovieClip Frame 1
stop();
this.woodvalue = 1;
this._parent.addMe(this);
this.tree = true;
this.cacheAsBitmap = true;
Symbol 1509 MovieClip Frame 50
stop();
this._parent.revealed = true;
Symbol 1511 MovieClip Frame 1
this._parent.addMe(this);
this.tree = true;
this.secret = true;
this.woodvalue = 0;
stop();
this.cacheAsBitmap = true;
Symbol 1528 MovieClip Frame 1
stop();
Symbol 1530 MovieClip Frame 1
stop();
Symbol 1532 MovieClip Frame 1
stop();
Symbol 1534 MovieClip Frame 1
stop();
Symbol 1536 MovieClip Frame 1
stop();
Symbol 1548 MovieClip Frame 1
stop();
var realroot = this._parent._parent;
if (realroot.dooropen) {
gotoAndStop ("opened");
}
Symbol 1548 MovieClip Frame 2
realroot.setNoise(0);
Symbol 1548 MovieClip Frame 3
realroot.playSound("swing0");
Symbol 1548 MovieClip Frame 17
realroot.playSound("splosion1");
Symbol 1548 MovieClip Frame 19
realroot.playSound("splosion1");
Symbol 1548 MovieClip Frame 21
realroot.playSound("splosion1");
Symbol 1548 MovieClip Frame 23
realroot.playSound("splosion1");
Symbol 1548 MovieClip Frame 28
realroot.playSound("ding");
realroot.playSound("lasersplode");
Symbol 1548 MovieClip Frame 29
realroot.hudd.flasher.gotoAndPlay(2);
realroot.dooropen = true;
realroot.hudd.updateMe();
realroot.freshSave();
Symbol 1548 MovieClip Frame 64
stop();
realroot.setNoise(realroot.bgnoise);
this._parent.endMapAtk();
this._parent.cutscene = false;
Symbol 1554 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1558 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1560 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1562 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1567 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1569 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1571 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1576 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1578 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1581 MovieClip Frame 1
stop();
this.cacheAsBitmap = true;
Symbol 1593 MovieClip Frame 1
stop();
Symbol 1596 MovieClip Frame 1
stop();
Symbol 1600 MovieClip Frame 1
stop();
Symbol 1602 MovieClip Frame 1
Symbol 1607 MovieClip Frame 15
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 1608 MovieClip Frame 1
stop();
Symbol 1608 MovieClip Frame 2
stop();
Symbol 1627 MovieClip Frame 1
this._alpha = 0;
Symbol 1630 MovieClip Frame 1
function addEnem2() {
var _local1 = new Array();
var _local2 = random(3);
_local1.k = "map_enemy" + _local2;
_local1.typ = _local2;
realroot.enarray2.push(_local1);
}
function outsideEnems() {
var _local4 = 0;
while (_local4 < realroot.enarray.length) {
var _local3 = realroot.enarray[_local4];
if (_local3.typ > 199) {
_local3.dead = false;
}
if ((!_local3.dead) || (_local3.typ > 10)) {
var _local2 = this.attachMovie(_local3.link, "e" + _local4, _local4);
if (_local3.typ <= 10) {
var _local8 = dude._x - _local3.x;
var _local7 = dude._y - _local3.y;
var _local12 = Math.sqrt((_local8 * _local8) + (_local7 * _local7));
moveit = false;
if (_local12 < 250) {
var moveit = true;
}
}
_local2._x = _local3.x;
_local2._y = _local3.y;
if (moveit) {
var _local5 = random(2);
if (_local5 == 0) {
_local5 = -1;
}
_local2._x = dude._x + (150 * _local5);
_local2._y = dude._y + (150 * _local5);
}
var _local6 = new Array("0xFF4B5A", "0xFF7C18", "0xFDD73E", "0x79A439", "0x4498BB", "0x8858B8");
var _local11 = new Array("0x76010D", "0x8F3901", "0x765F01", "0x384B1B", "0x204757", "0x472C65");
var _local9 = random(_local6.length);
var _local13 = new Color(_local2.fill);
_local13.setRGB(_local6[_local9]);
var _local10 = new Color(_local2.stroke);
_local10.setRGB(_local11[_local9]);
_local2.typ = _local3.typ;
_local2.id = _local4;
_local2.aicv = random(30);
_local2.dir = random(4);
_local2.sp = 4;
enemies.push(_local2);
swaps.push(_local2);
if (((_local3.typ > 10) && (_local3.dead)) && (_local3.typ != 97)) {
_local2.gotoAndStop("dead");
_local2.dead = true;
}
}
_local4++;
}
}
function clearStuff() {
var _local3 = 0;
while (_local3 < enemies.length) {
var _local1 = enemies[_local3];
if (_local1 != dude) {
_local1.unloadMovie();
_local1.removeMovieClip();
}
_local3++;
}
_local3 = 0;
while (_local3 < swaps.length) {
var _local2 = swaps[_local3];
if (_local2 != dude) {
_local2.unloadMovie();
_local2.removeMovieClip();
}
_local3++;
}
}
function tranIt() {
realroot.pausy = false;
clearStuff();
if (realroot.indungeon && (dungeon)) {
realroot.runMusic("oworld");
if (realroot.gotfairy && (!realroot.fairyaccomplished)) {
fairy._visible = true;
}
dungeon = false;
realroot.indungeon = false;
dude._visible = true;
dude.attacking = false;
dude.guts.gotoAndStop("rest_" + dude.dir);
gotoAndStop (1);
trace("tranIt: _root.indungeon=true");
} else {
realroot.runMusic("dungeonow");
trace("tranIt: _root.indungeon=false");
dude._visible = true;
dude.attacking = false;
fairy._visible = false;
realroot.pastdungeon = false;
runDungeon(realroot.dest);
}
}
function runDungeon(dest) {
dude._visible = true;
delete this.onEnterFrame;
realroot.hudd.flasher.gotoAndPlay(2);
startDung(dest);
}
function startDung(dest) {
clearStuff();
dungeon = true;
realroot.pausy = false;
cutscene = false;
enemies = new Array();
swaps = new Array();
swaps.push(doors);
var _local4 = 0;
while (_local4 < 4) {
var _local3 = this["key" + _local4];
swaps.push(_local3);
_local4++;
}
_local4 = 0;
while (_local4 < 3) {
var _local3 = this["g" + _local4];
swaps.push(_local3);
_local4++;
}
dude.attacking = false;
dude.moving = false;
atkup = false;
dude.guts.gotoAndStop("rest_" + dude.dir);
controltar = dude;
var _local12 = true;
var _local2 = 0;
while (_local2 < 3) {
var _local8 = this.doors.bigdoor["g" + _local2];
if (realroot.gems[_local2]) {
_local8._visible = true;
this["g" + _local2].gotoAndStop(2);
} else {
_local8._visible = false;
_local12 = false;
}
_local2++;
}
if (_local12) {
block3.unloadMovie();
block3.removeMovieClip();
doors.bigdoor._visible = false;
}
realroot.enarray2 = new Array();
_local2 = 0;
while (_local2 < 24) {
addEnem2();
_local2++;
}
_local2 = 0;
while (_local2 < 4) {
if (realroot.dungeonkeys[_local2]) {
this["key" + _local2]._visible = false;
}
if (realroot.dungeondoors[_local2]) {
var _local6 = this.doors["door" + _local2];
var _local9 = this["block" + _local2];
_local9.unloadMovie();
_local9.removeMovieClip();
_local6.opened = true;
_local6.gotoAndStop(2);
}
_local2++;
}
_local2 = 0;
while (_local2 < 24) {
var _local3 = this["s" + _local2];
realroot.spawns[_local2][0] = _local3._x;
realroot.spawns[_local2][1] = _local3._y;
_local3._visible = false;
_local2++;
}
_local2 = 0;
while (_local2 < realroot.spawns.length) {
var _local7 = realroot.spawns[_local2][0] - dude._x;
var _local5 = realroot.spawns[_local2][1] - dude._y;
var _local11 = Math.sqrt((_local7 * _local7) + (_local5 * _local5));
if (!realroot.spawns[_local2][2]) {
if ((_local11 > 350) || (!realroot.indungeon)) {
var _local10 = random(3) + 3;
var _local13 = this.attachMovie("map_enemy" + _local10, "dungen" + _local2, effcv + 99111);
effcv++;
_local13._x = realroot.spawns[_local2][0];
_local13._y = realroot.spawns[_local2][1];
_local13.typ = _local10;
_local13.id = _local2;
_local13.aicv = random(30);
_local13.dir = random(4);
_local13.sp = 4;
_local13.comp = realroot.spawns[_local2];
enemies.push(_local13);
swaps.push(_local13);
}
}
_local2++;
}
var _local13 = this.attachMovie("wizard3", "wiz", effcv);
effcv++;
_local13._x = 1221;
_local13._y = 1600;
_local13.typ = 195;
enemies.push(_local13);
swaps.push(_local13);
swaps.push(dude);
realroot.indungeon = true;
this.onEnterFrame = function () {
enterF();
if (!realroot.pausy) {
chkKeys();
if ((dude._y < -1800) && (!realroot.pastdungeon)) {
trace("EXIT DUNGEON!");
dude.guts.gotoAndStop("rest_" + dude.dir);
dude.attacking = false;
realroot.hudd.mapfade.gotoAndPlay(2);
realroot.pastdungeon = true;
realroot.pausy = true;
dude._x = -1440;
dude._y = 240;
realroot.mapp = new Array(-1440, 240);
}
}
};
}
function chkKeys() {
var _local2 = 0;
while (_local2 < 4) {
var _local3 = this["key" + _local2];
if (realroot.dungeonkeys[_local2]) {
this["key" + _local2]._visible = false;
}
if (_local3._visible) {
if (_local3.hitarea.hitTest(dude)) {
realroot.playLoudSound("ding");
realroot.dungeonkeys[_local2] = true;
_local3._visible = false;
realroot.keycount++;
realroot.hudd.updateMe();
realroot.freshSave();
}
}
var _local5 = this.doors["door" + _local2];
if ((_local5.hitTest(dude) && (!_local5.opened)) && (realroot.keycount > 0)) {
realroot.playLoudSound("lasersplode");
realroot.playLoudSound("gethit");
var _local4 = this["block" + _local2];
realroot.dungeondoors[_local2] = true;
_local4.unloadMovie();
_local4.removeMovieClip();
_local5.opened = true;
_local5.gotoAndStop(2);
realroot.keycount--;
realroot.hudd.updateMe();
realroot.freshSave();
if (_local4 == this.block2) {
realroot.hudd.savemessage.gotoAndPlay(2);
}
}
_local2++;
}
_local2 = 0;
while (_local2 < 3) {
var _local5 = this["g" + _local2];
if (_local5.hitarea.hitTest(dude)) {
if (_local2 == 0) {
var _local6 = 500;
}
if (_local2 == 1) {
var _local6 = 501;
}
if (_local2 == 2) {
var _local6 = 502;
}
realroot.mapp[0] = 1620;
realroot.mapp[1] = -700;
daterrain = 1;
realroot.startPlat(daterrain, _local6, _local5);
}
_local2++;
}
}
function swapEm() {
var _local1 = 0;
while (_local1 < swaps.length) {
var _local2 = swaps[_local1];
if ((_local2._x == undefined) && (_local2 != dude)) {
swaps.splice(_local1, 1);
}
if (_local2.secret) {
if (_local2.hitarea.hitTest(dude) && (_local2.revealed)) {
realroot.startPlat(1, 196, _local2);
}
}
_local1++;
}
var _local3 = new Array();
_local1 = 0;
while (_local1 < swaps.length) {
var _local2 = swaps[_local1];
_local3.push({nam:_local2, yval:_local2._y});
_local1++;
}
var _local6 = _local3.sortOn("yval", Array.NUMERIC);
_local1 = 0;
while (_local1 < _local6.length) {
_local3[_local1].nam.swapDepths(_local1);
_local1++;
}
bigdoor.swapDepths(_local6.length + 1);
}
function checkAxeHit(hitarea) {
var _local9 = 0;
while (_local9 < swaps.length) {
var _local3 = swaps[_local9];
if (_local3.tree && (!_local3.chopped)) {
if (_local3.hitTest(hitarea)) {
var _local6 = 0;
while (_local6 < 7) {
var _local2 = this.attachMovie("leaf", "leaf" + effcv, effcv + 9911);
effcv++;
_local2.dir = random(2);
_local2._xscale = 50;
if (_local2.dir == 0) {
_local2._xscale = -50;
}
_local2._yscale = 50;
_local2.maxtime = random(20) + 40;
_local2.cv = 0;
_local2._x = (_local3._x + random(100)) - 50;
_local2._y = _local3._y - random(100);
_local2.gotoAndPlay(random(15));
_local2.onEnterFrame = function () {
this.cv++;
this._y = this._y + 1;
if (this.cv >= this.maxtime) {
delete this.onEnterFrame;
this.unloadMovie();
this.removeMovieClip();
}
};
_local6++;
}
realroot.woodcount = realroot.woodcount + _local3.woodvalue;
realroot.hudd.updateMe();
realroot.treechops[_local3.num] = true;
_local3.chopped = true;
_local3.gotoAndStop(2);
var _local5 = this.attachMovie("treesplode", "ts" + effcv, effcv + 9211);
effcv++;
_local5.s = random(20) + 60;
var _local10 = random(2);
if (_local10 == 0) {
_local10 = -1;
}
_local5._xscale = _local5.s * _local10;
_local5._yscale = _local5.s;
_local5._x = _local3._x;
_local5._y = _local3._y;
var _local8 = true;
var _local4 = 0;
while (_local4 < swaps.length) {
var _local7 = swaps[_local4];
if (_local7.tree && (!_local7.chopped)) {
_local8 = false;
}
_local4++;
}
if (_local8) {
realroot.runMedal("Slash-n'-burn");
}
}
}
_local9++;
}
realroot.freshSave();
}
function addMe(who) {
swaps.push(who);
who.num = curtree;
curtree++;
if (realroot.treechops[who.num]) {
who.chopped = true;
who.gotoAndStop(2);
}
}
function centerOn(who) {
if (!realroot.pausy) {
goalx = 320 - who._x;
goaly = 240 - who._y;
distx = goalx - this._x;
disty = goaly - this._y;
this._x = this._x + (distx / 1);
this._y = this._y + (disty / 1);
}
}
function moveEnem(who) {
if (who.dir == 0) {
who._y = who._y - who.sp;
}
if (who.dir == 1) {
who._x = who._x + who.sp;
}
if (who.dir == 2) {
who._y = who._y + who.sp;
}
if (who.dir == 3) {
who._x = who._x - who.sp;
}
who.aicv++;
if (who.aicv >= 30) {
who.aicv = random(15);
who.dir = random(4);
}
restrain(who);
}
function showMsg(msg) {
if (!msgup) {
msgup = true;
realroot.playLoudSound("get");
}
var _local2 = this._parent.attachMovie("msgbox", "msgbox", 433998);
_local2.msg.text = msg;
}
function endMapAtk() {
dude.attacking = false;
dude.guts.gotoAndStop("rest_" + dude.dir);
}
function controls(who) {
var needmsg = false;
var i = 0;
while (i < 5) {
var tim = eval ("helper" + i);
if (tim.hitTest(who)) {
if (this._parent.msgbox._x == undefined) {
showMsg(tim.msg);
tim.gotoAndStop("talk");
}
needmsg = true;
} else {
tim.gotoAndStop(1);
}
i++;
}
var i = 0;
while (i < reads.length) {
var tim = eval ("r" + i);
if (tim.hitTest(who)) {
if (this._parent.msgbox._x == undefined) {
var m = reads[i];
showMsg(m);
}
needmsg = true;
}
i++;
}
if (!needmsg) {
msgup = false;
this._parent.msgbox.unloadMovie();
this._parent.msgbox.removeMovieClip();
}
if (!who.attacking) {
if (who.hitTest(bridge.hitarea)) {
realroot.onbridge = true;
realroot.runTran();
realroot.startPlat(3, 3, bridge);
}
var i = 0;
while (i < enemies.length) {
tin = enemies[i];
if ((((realroot.enarray[tin.id].link == "wizard0") || (realroot.enarray[tin.id].link == "wizard1")) || (realroot.enarray[tin.id].link == "wizard2")) || (realroot.enarray[tin.id].link == "wizard4")) {
tin.dead = false;
realroot.enarray[tin.id].dead = false;
}
if (who.hitarea.hitTest(tin.hitarea)) {
if (!tin.dead) {
if (tin.typ < 10) {
if ((((realroot.enarray[tin.id].link != "wizard0") && (realroot.enarray[tin.id].link != "wizard1")) && (realroot.enarray[tin.id].link != "wizard2")) && (realroot.enarray[tin.id].link != "wizard4")) {
realroot.enarray[tin.id].dead = true;
} else {
realroot.enarray[tin.id].dead = false;
tin.dead = false;
}
tin.comp[2] = true;
} else {
if ((tin.typ == 99) || (tin.typ == 98)) {
realroot.whichboss = realroot.enarray[tin.id];
if (tin.typ == 99) {
who._x = 1000;
who._y = 1090;
}
if (tin.typ == 98) {
trace("adjusting");
who._x = 15;
who._y = -1435;
}
}
if (tin.typ == 97) {
who._x = -1450;
who._y = -180;
}
}
realroot.mapp[0] = who._x;
realroot.mapp[1] = who._y;
realroot.runTran();
var daterrain = 0;
if (realroot.indungeon) {
daterrain = 1;
}
if (terr1.hitTest(who.virtx, who.virty, true)) {
daterrain = 1;
}
if (terr2.hitTest(who.virtx, who.virty, true)) {
daterrain = 2;
}
if (terr3.hitTest(who.virtx, who.virty, true)) {
daterrain = 3;
}
realroot.startPlat(daterrain, tin.typ, tin);
} else {
trace("I'm DEAD");
}
}
if (tin.typ < 10) {
moveEnem(tin);
}
i++;
}
}
if (realroot.gotaxe) {
if (!Key.isDown(realroot.atk)) {
atkup = true;
}
if (Key.isDown(realroot.atk) && (atkup)) {
atkup = false;
realroot.playLoudSound("gethit");
if (!who.attacking) {
who.attacking = true;
who.guts.gotoAndStop("axe_" + who.dir);
trace("attacking dir: " + who.dir);
}
}
}
who.moving = false;
if (!who.attacking) {
if (((Key.isDown(U) && (!Key.isDown(R))) && (!Key.isDown(L))) && (!Key.isDown(D))) {
who.moving = true;
who._y = who._y - speed;
who.dir = 0;
}
if (((Key.isDown(D) && (!Key.isDown(R))) && (!Key.isDown(L))) && (!Key.isDown(U))) {
who.moving = true;
who._y = who._y + speed;
who.dir = 2;
}
if (((Key.isDown(R) && (!Key.isDown(U))) && (!Key.isDown(D))) && (!Key.isDown(L))) {
who.moving = true;
who._x = who._x + speed;
who.dir = 1;
who._xscale = 100;
}
if (((Key.isDown(L) && (!Key.isDown(U))) && (!Key.isDown(D))) && (!Key.isDown(R))) {
who.moving = true;
who._x = who._x - speed;
who.dir = 1;
who._xscale = -100;
}
if ((Key.isDown(L) && (Key.isDown(D))) && (!Key.isDown(R))) {
who.dir = 2;
who._x = who._x - speed;
who._y = who._y + speed;
who.moving = true;
}
if ((Key.isDown(R) && (Key.isDown(D))) && (!Key.isDown(L))) {
who.dir = 2;
who._x = who._x + speed;
who._y = who._y + speed;
who.moving = true;
}
if ((Key.isDown(L) && (Key.isDown(U))) && (!Key.isDown(R))) {
who.dir = 0;
who._x = who._x - speed;
who._y = who._y - speed;
who.moving = true;
}
if ((Key.isDown(R) && (Key.isDown(U))) && (!Key.isDown(L))) {
who.dir = 0;
who._x = who._x + speed;
who._y = who._y - speed;
who.moving = true;
}
}
if ((!who.moving) && (!who.attacking)) {
who.guts.gotoAndStop("rest_" + who.dir);
} else {
if (!who.attacking) {
who.guts.gotoAndStop("move_" + who.dir);
makePrint(who);
}
if ((dungeon && (realroot.indungeon)) && (!realroot.pastdungeon)) {
if (exit.hitTest(dude)) {
dude.guts.gotoAndStop("rest_" + dude.dir);
dude.attacking = false;
realroot.hudd.mapfade.gotoAndPlay(2);
realroot.pausy = true;
}
}
}
restrain(who);
}
function makePrint(who) {
who.printcv++;
if (who.printcv >= 5) {
if (!bg.hitTest(who.virtx, who.virty, true)) {
if ((who._x > -950) || (dungeon)) {
var _local4 = this.attachMovie("groundpoof", "gp" + effcv, effcv + 999911122);
_local4._x = who._x;
_local4._y = who._y;
_local4._xscale = 70;
_local4._yscale = _local4._xscale;
effcv++;
swaps.push(_local4);
}
who.printcv = 0;
var _local3 = farbg.attachMovie("footprint", "print" + effcv, effcv);
effcv++;
_local3._x = who._x;
_local3._y = who._y - 2;
_local3.cacheAsBitmap = true;
if (who.dir == 1) {
if (who.foot == 0) {
_local3._y = _local3._y - 2;
} else {
_local3._y = _local3._y + 7;
}
_local3._xscale = who._xscale;
}
if (who.dir == 0) {
_local3._rotation = -90;
if (who.foot == 0) {
_local3._x = _local3._x - 15;
} else {
_local3._x = _local3._x + 15;
}
}
if (who.dir == 2) {
_local3._rotation = 90;
if (who.foot == 0) {
_local3._x = _local3._x - 15;
} else {
_local3._x = _local3._x + 15;
}
}
who.foot++;
if (who.foot == 2) {
who.foot = 0;
}
} else if (bridge1.hitTest(who.virtx, who.virty, true)) {
var _local4 = farbg.attachMovie("watersplash", "gp" + effcv, effcv + 999911122);
_local4._x = who._x;
_local4._y = who._y - 10;
_local4._xscale = 100;
_local4._yscale = _local4._xscale;
effcv++;
swaps.push(_local4);
who.printcv = 0;
}
}
}
function restrain(who) {
who.virtx = this._x + who._x;
who.virty = this._y + who._y;
who.lef = who.virtx - (who._width / 2);
who.rig = who.virtx + (who._width / 2);
who.topp = who.virty - (who._height / 2);
who.bott = who.virty + (who._height / 2);
var _local3 = false;
if (bridge1.hitTest(who.virtx, who.topp, true) && (realroot.gotboots)) {
_local3 = true;
}
if (bridge2.hitTest(who.virtx, who.topp, true) && (realroot.dooropen)) {
_local3 = true;
}
while (((((bg.hitTest(who.virtx, who.topp, true) && (!_local3)) || (block0.hitTest(who.virtx, who.topp, true))) || (block1.hitTest(who.virtx, who.topp, true))) || (block2.hitTest(who.virtx, who.topp, true))) || (block3.hitTest(who.virtx, who.topp, true))) {
who._y = who._y + 1;
who.virty = who.virty + 1;
who.topp = who.topp + 1;
who.bott = who.bott - 1;
if (bridge1.hitTest(who.virtx, who.topp, true) && (realroot.gotboots)) {
_local3 = true;
}
if (bridge2.hitTest(who.virtx, who.topp, true) && (realroot.dooropen)) {
_local3 = true;
}
}
_local3 = false;
if (bridge1.hitTest(who.virtx, who.bott, true) && (realroot.gotboots)) {
_local3 = true;
}
if (bridge2.hitTest(who.virtx, who.bott, true) && (realroot.dooropen)) {
_local3 = true;
}
while (((((bg.hitTest(who.virtx, who.bott, true) && (!_local3)) || (block0.hitTest(who.virtx, who.bott, true))) || (block1.hitTest(who.virtx, who.bott, true))) || (block2.hitTest(who.virtx, who.bott, true))) || (block3.hitTest(who.virtx, who.bott, true))) {
who._y = who._y - 1;
who.virty = who.virty - 1;
who.topp = who.topp - 1;
who.bott = who.bott - 1;
if (bridge1.hitTest(who.virtx, who.bott, true) && (realroot.gotboots)) {
_local3 = true;
}
if (bridge2.hitTest(who.virtx, who.bott, true) && (realroot.dooropen)) {
_local3 = true;
}
}
_local3 = false;
if (bridge1.hitTest(who.lef, who.virty, true) && (realroot.gotboots)) {
_local3 = true;
}
if (bridge2.hitTest(who.lef, who.virty, true) && (realroot.dooropen)) {
_local3 = true;
}
while (((((bg.hitTest(who.lef, who.virty, true) && (!_local3)) || (block0.hitTest(who.lef, who.virty, true))) || (block1.hitTest(who.lef, who.virty, true))) || (block2.hitTest(who.lef, who.virty, true))) || (block3.hitTest(who.lef, who.virty, true))) {
who._x = who._x + 1;
who.virtx = who.virtx + 1;
who.lef = who.lef + 1;
who.rig = who.rig + 1;
if (bridge1.hitTest(who.lef, who.virty, true) && (realroot.gotboots)) {
_local3 = true;
}
if (bridge2.hitTest(who.lef, who.virty, true) && (realroot.dooropen)) {
_local3 = true;
}
}
_local3 = false;
if (bridge1.hitTest(who.rig, who.virty, true) && (realroot.gotboots)) {
_local3 = true;
}
if (bridge2.hitTest(who.rig, who.virty, true) && (realroot.dooropen)) {
_local3 = true;
}
while (((((bg.hitTest(who.rig, who.virty, true) && (!_local3)) || (block0.hitTest(who.rig, who.virty, true))) || (block1.hitTest(who.rig, who.virty, true))) || (block2.hitTest(who.rig, who.virty, true))) || (block3.hitTest(who.rig, who.virty, true))) {
who._x = who._x - 1;
who.virtx = who.virtx - 1;
who.lef = who.lef - 1;
who.rig = who.rig - 1;
if (bridge1.hitTest(who.rig, who.virty, true) && (realroot.gotboots)) {
_local3 = true;
}
if (bridge2.hitTest(who.rig, who.virty, true) && (realroot.dooropen)) {
_local3 = true;
}
}
}
function chkDoorHit() {
if (bigdoor.hitarea.hitTest(dude)) {
who = dude;
who.guts.gotoAndStop("rest_" + who.dir);
cutscene = true;
realroot.dooropen = true;
bigdoor.gotoAndPlay(2);
}
}
function fairyEmitter(who) {
fem++;
if (fem >= 5) {
fem = 0;
var _local3 = 0;
while (_local3 < 10) {
var _local2 = this.attachMovie("sparkle", "sparkle" + effcv, effcv + 77781818);
effcv++;
_local2._xscale = 400 + random(200);
_local2._yscale = _local2._xscale;
_local2._x = (who._x + random(40)) - 20;
_local2._y = (who._y + random(40)) - 20;
_local2._rotation = random(360);
_local2.xvel = random(10) - 5;
_local2.yvel = random(10) - 5;
_local2.cv = 0;
_local2.onEnterFrame = function () {
if (!realroot.pausy) {
this._x = this._x + this.xvel;
this.xvel = this.xvel * 0.9;
this._y = this._y + this.yvel;
this.yvel = this.yvel * 0.9;
this.cv++;
this._rotation = this._rotation + 45;
if (this.cv >= 2) {
this._alpha = this._alpha - 1;
if (this._alpha <= 0) {
delete this.onEnterFrame;
this.unloadMovie();
this.removeMovieClip();
}
}
}
};
_local3++;
}
}
}
function enterF() {
realroot.chkPause();
if ((!realroot.pausy) && (!cutscene)) {
if (realroot.gemtranny < 0) {
controls(controltar);
centerOn(dude);
} else {
if (!gemvisible) {
this.doors.bigdoor._visible = true;
var _local8 = this.doors.bigdoor["g" + realroot.gemtranny];
_local8._visible = false;
gemvisible = true;
this.g = this.attachMovie("gem" + realroot.gemtranny, "gem", 666881 + effcv);
effcv++;
g.cv = 0;
g._xscale = 20;
g._yscale = g._xscale;
var _local7 = this["g" + realroot.gemtranny];
g._x = _local7._x - 15;
g._y = _local7._y - 50;
g.tar = this["gemtarget" + realroot.gemtranny];
var _local11 = g.tar._x - g._x;
var _local10 = g.tar._y - g._y;
g.angle = Math.atan2(_local10, _local11);
g.speed = 0;
g.comp = _local8;
}
if (g.tar.hitTest(g)) {
if (!g.comp._visible) {
g.speed = 0;
realroot.playLoudSound("ding");
realroot.playLoudSound("gethit");
g.comp._visible = true;
var _local4 = true;
var _local2 = 0;
while (_local2 < realroot.gems.length) {
if (!realroot.gems[_local2]) {
_local4 = false;
}
_local2++;
}
if (_local4) {
this.doors.bigdoor._visible = false;
realroot.playLoudSound("lasersplode");
realroot.playLoudSound("gethit");
}
var _local5 = this.attachMovie("treesplode", "tsplode" + effcv, effcv + 88111);
effcv++;
_local5._xscale = 50;
_local5._yscale = _local5._xscale;
_local5._x = g.tar._x;
_local5._y = g.tar._y + 30;
}
g._alpha = 0;
g.cv++;
if (g.cv >= 35) {
g.comp._visible = true;
goalx = 320 - dude._x;
goaly = 240 - dude._y;
distx = goalx - this._x;
disty = goaly - this._y;
var _local9 = Math.sqrt((distx * distx) + (disty * disty));
if (_local9 > 0.5) {
this._x = this._x + (distx / 8);
this._y = this._y + (disty / 8);
} else {
centerOn(dude);
}
}
if (g.cv >= 64) {
realroot.gemtranny = -1;
g.unloadMovie();
g.removeMovieClip();
}
} else {
g.comp._visible = false;
centerOn(g);
g._x = g._x + (g.speed * Math.cos(g.angle));
g._y = g._y + (g.speed * Math.sin(g.angle));
g.speed = g.speed + 0.4;
}
}
if (realroot.gotkey && (!realroot.dooropen)) {
chkDoorHit();
}
if ((realroot.gotfairy && (!realroot.fairyaccomplished)) && (!realroot.indungeon)) {
fairyEmitter(fairy);
if (fairydir == 0) {
var _local7 = dude;
} else {
var _local7 = fairytar;
}
var distx = (_local7._x - fairy._x);
var disty = (_local7._y - fairy._y);
var _local3 = 40;
var _local6 = 8.5;
if (distx > (-_local3)) {
fairy._x = fairy._x + _local6;
}
if (distx < _local3) {
fairy._x = fairy._x - _local6;
}
if (disty > (-_local3)) {
fairy._y = fairy._y + _local6;
}
if (disty < _local3) {
fairy._y = fairy._y - _local6;
}
if (((((disty > (-_local3)) && (disty < _local3)) && (distx > (-_local3))) && (distx < _local3)) && (!fairy.stick)) {
fairy.stick = true;
fairy.cv = 0;
}
if (fairy.stick) {
fairy.cv++;
if (fairy.cv >= 30) {
fairy.stick = false;
fairy.cv = 0;
if (fairydir == 0) {
fairydir = 1;
} else {
fairydir = 0;
}
}
}
}
}
swapEm();
}
var realroot = this._parent;
realroot.runMusic("oworld");
stop();
U = realroot.U;
D = realroot.D;
L = realroot.L;
R = realroot.R;
this._quality = realroot.qualset;
dude.moving = false;
gemtarget._alpha = 0;
framecount = 0;
enemies = new Array();
swaps = new Array();
delete this.onEnterFrame;
controltar = dude;
if ((!realroot.gotfairy) || (realroot.fairyaccomplished)) {
fairy._visible = false;
} else {
fairy._x = dude._x;
fairy._y = dude._y - 300;
fairydir = 0;
fem = 0;
fairy.swapDepths(99911111);
}
var reads = new Array();
reads[0] = "ISN'T THIS A LONG HALLWAY?";
reads[1] = "THREE GUARDIANS PROTECT THE WAY TO THE LAVA BEAST. THEIR QUEST IS TO TEST AND PROVE THE CHOSEN ONE.";
reads[2] = "SECOND FLOOR: ARE YOU SURE YOU GOT ALL THE KEYS ON FLOOR ONE?";
reads[3] = "DUNGEON OF THE THREE KNIGHTS: ABANDON ALL HOPE ALL YE WHO ENTER HERE.";
reads[4] = "ONLY A WORTHY KNIGHT WILL DEFEAT ALL THREE DUNGEON GUARDIANS.";
reads[5] = "THE FINAL DOOR CANNOT BE OPENED WITH KEYS...";
reads[6] = "EACH DUNGEON FLOOR HAS A LOCKED DOOR. FIND KEYS TO PASS THEM.";
reads[7] = "A POWERFUL WIZARD HIDES IN THIS DUNGEON.";
reads[8] = "FLOOR THREE: PREPARE FOR THE ULTIMATE SHOWDOWN OF ULTIMATE DESTINY.";
reads[9] = "3 KNIGHT DUNGEON: TO PASS THE PROTECTORS, PATTERN-PERCEPTION PROVES PURPOSEFUL";
reads[10] = "DOORS REMAIN UNLOCKED EVEN AFTER YOUR DEATH.";
reads[11] = "DIZZINESS IS THE PURPLE KNIGHT'S WEAKNESS";
reads[12] = "DEFEAT EACH GUARDIAN TO ADD A GEM TO THE FINAL GATE.";
reads[13] = "THE AXE IS THE RED KNIGHT'S SOURCE OF POWER. DODGE HIS AXE THROW, ATTACK HIM WHILE HE IS WEAK.";
reads[14] = "THE GREEN KNIGHT IS INVULNERABLE TO ANYTHING EXCEPT ROCK. AIM WELL YOUR STRIKES!";
reads[15] = "THIS IS ONE OF THOSE DECOY MAZE HALLWAYS...SORRY EVERY GAME HAS ONE.";
speed = 10;
effcv = 0;
curtree = 0;
this.swaps = new Array();
swaps.push(dude);
swaps.push(coverer);
dude.printcv = 0;
dude.foot = 0;
dude.dir = 2;
this.enemies = new Array();
terr1._alpha = 0;
terr2._alpha = 0;
terr3._alpha = 0;
terr4._alpha = 0;
var msgs = new Array();
if (!realroot.gotboots) {
msgs[0] = "The ship has sailed for safer port. It's rumored that MAGIC BOOTS can walk on water.";
}
if (realroot.gotboots) {
msgs[0] = "Those boots will help you cross, but the ISLAND BEAST will destroy you!";
}
if (realroot.gotkey) {
msgs[0] = "The town blacksmith built a ship to escape the beasts. Sometimes I see it pass North of the island.";
}
if (!realroot.gotboots) {
msgs[1] = "Danger is ahead! The CANYON BEAST devours all who enter its lair!";
}
if (realroot.gotboots) {
msgs[1] = "Hooray, the canyon beast is dead!";
}
if (!realroot.gotkey) {
msgs[2] = "The SKULL KEY opens this path. Legend says the KEY is guarded by the ISLAND BEAST.";
}
if (realroot.gotkey) {
msgs[2] = "Pass three knight tower before facing the DEMON BEAST. Only one worthy and prepared may pass.";
}
msgs[3] = "Save our land from the 3 giant beasts! You're our only hope!";
msgs[4] = "A powerful wizard went into hiding somewhere in this forest ...";
var i = 0;
while (i < 5) {
var tar = eval ("helper" + i);
swaps.push(tar);
tar.msg = msgs[i];
i++;
}
outsideEnems();
realroot.whichboss = 0;
gemvisible = false;
gemtarget0._alpha = 0;
gemtarget1._alpha = 0;
gemtarget2._alpha = 0;
this.onEnterFrame = function () {
enterF();
if (!realroot.pausy) {
realroot.datime++;
}
};
Symbol 1630 MovieClip Frame 2
tranIt();
realroot.pastdungeon = false;
Symbol 1646 MovieClip Frame 1
stop();
Symbol 1650 MovieClip Frame 1
stop();
Symbol 1650 MovieClip Frame 2
var realroot = this._parent._parent;
trace(realroot);
realroot.mappy.dude.guts.gotoAndStop("rest_" + realroot.mappy.dude.dir);
Symbol 1650 MovieClip Frame 3
realroot.mappy.dude.guts.gotoAndStop("rest_" + realroot.mappy.dude.dir);
Symbol 1650 MovieClip Frame 4
realroot.mappy.dude.guts.gotoAndStop("rest_" + realroot.mappy.dude.dir);
Symbol 1650 MovieClip Frame 25
function centerIt() {
who = realroot.mappy.dude;
goalx = 320 - who._x;
goaly = 240 - who._y;
distx = goalx - realroot.mappy._x;
disty = goaly - realroot.mappy._y;
realroot.mappy._x = realroot.mappy._x + (distx / 1);
realroot.mappy._y = realroot.mappy._y + (disty / 1);
}
who = realroot.mappy.dude;
goalx = 320 - who._x;
goaly = 240 - who._y;
distx = goalx - realroot.mappy._x;
disty = goaly - realroot.mappy._y;
realroot.mappy._x = realroot.mappy._x + (distx / 1);
realroot.mappy._y = realroot.mappy._y + (disty / 1);
if (!realroot.pastdungeon) {
if (!realroot.indungeon) {
realroot.mappy.gotoAndStop(2);
} else {
realroot.mappy.dude.swapDepths(240);
realroot.mappy.tranIt();
}
} else if (realroot.indungeon) {
realroot.mappy.gotoAndStop(1);
realroot.mappy.dude.dir = 0;
realroot.pausy = false;
realroot.pastdungeon = true;
realroot.indungeon = false;
realroot.mappy.dungeon = false;
realroot.mappy.dude._visible = true;
realroot.mappy.dude.attacking = false;
realroot.mappy.dude.guts.gotoAndStop("rest_" + realroot.mappy.dude.dir);
realroot.mappy.clearStuff();
realroot.mappy.dude._x = -1440;
realroot.mappy.dude._y = 240;
realroot.mapp = new Array(-1440, 240);
realroot.mappy.dude.swapDepths(240);
trace("dungeon victory");
} else {
trace("entering dungeon from top");
realroot.pastdungeon = false;
realroot.mapp = new Array(1650, -1500);
realroot.mappy.dude._x = 1650;
realroot.mappy.dude._y = -1500;
realroot.mappy.dude._visible = true;
realroot.mappy.dude.attacking = false;
realroot.mappy.dude.dir = 2;
realroot.mappy.dude.guts.gotoAndStop("rest_" + dude.dir);
centerIt();
realroot.mappy.gotoAndStop(2);
}
Symbol 1654 MovieClip Frame 1
stop();
Symbol 1655 MovieClip Frame 1
function updateMe() {
bg._visible = false;
if (!realroot.deliveredwood) {
this.wood.text = "= " + realroot.woodcount;
if (realroot.woodcount > 0) {
bg._visible = true;
}
} else {
this.wood.text = "";
this.woodike._visible = false;
}
if (realroot.keycount <= 0) {
keyicon._visible = false;
keys.text = "";
} else {
keyicon._visible = true;
bg._visible = true;
keys.text = "=" + realroot.keycount;
}
if (!realroot.gotboots) {
boots._visible = false;
key._visible = false;
} else {
bg._visible = true;
}
if ((!realroot.gotkey) || (realroot.dooropen)) {
key._visible = false;
} else {
bg._visible = true;
key._visible = true;
trace((("still on here: " + key._visible) + " bg visible: ") + bg._visible);
}
if (!realroot.gotaxe) {
woodike._visible = false;
axe._visible = false;
this.wood.text = "";
} else {
if (!realroot.deliveredwood) {
this.wood.text = "= " + realroot.woodcount;
woodike._visible = true;
} else {
woodike._visible = false;
this.wood.text = "";
}
axe._visible = true;
bg._visible = true;
}
}
var realroot = this._parent;
updateMe();
Symbol 1785 MovieClip Frame 1
function moveStuff() {
fg0._x = fg0._x - (rate * 1.5);
fg1._x = fg1._x - (rate * 1.5);
if (fg0._x < (-fg0._width)) {
fg0._x = fg1._x + fg1._width;
}
if (fg1._x < (-fg1._width)) {
fg1._x = fg0._x + fg0._width;
}
ground0._x = ground0._x - rate;
ground1._x = ground1._x - rate;
if (ground0._x < (-ground0._width)) {
ground0._x = (ground1._x + ground1._width) - 1;
}
if (ground1._x < (-ground1._width)) {
ground1._x = (ground0._x + ground0._width) - 1;
}
bg0._x = bg0._x - (rate * 0.3);
bg1._x = bg1._x - (rate * 0.3);
if (bg0._x < (-bg0._width)) {
bg0._x = (bg1._x + bg1._width) - 1;
}
if (bg1._x < (-bg1._width)) {
bg1._x = (bg0._x + bg0._width) - 1;
}
bd0._x = bd0._x - rate;
bd1._x = bd1._x - rate;
if (bd0._x < (-bd0._width)) {
bd0._x = (bd1._x + bd1._width) - 1;
}
if (bd1._x < (-bd1._width)) {
bd1._x = (bd0._x + bd0._width) - 1;
}
p0._x = p0._x - rate;
p1._x = p1._x - rate;
if (p0._x < (-p0._width)) {
p0._x = (p1._x + p1._width) - 1;
}
if (p1._x < (-p1._width)) {
p1._x = (p0._x + p0._width) - 1;
}
}
function setCol(who, fil, str) {
var _local2 = new Color(who.fill);
var _local1 = new Color(who.str);
_local2.setRGB(fil);
_local1.setRGB(str);
}
function makeConfetti() {
var _local3 = 0;
while (_local3 < 15) {
var _local2 = this.attachMovie("confetti", "piece" + count, count);
count++;
_local2._x = random(640);
_local2._y = -5 - random(120);
_local2.yvel = 0;
_local2._rotation = random(360);
_local2.xvel = random(10) - 5;
_local2.spin = random(2);
if (_local2.spin == 0) {
_local2.spin = -1;
}
_local2._xscale = 115 + random(50);
setCol(_local2, cols[random(cols.length)], cols[random(cols.length)]);
_local2.onEnterFrame = function () {
this._x = this._x + this.xvel;
this._y = this._y + this.yvel;
this.yvel = this.yvel + 0.2;
this._xscale = this._xscale + (this.spin * 3);
if (this._y > 560) {
delete this.onEnterFrame;
this.unloadMovie();
this.removeMovieClip();
}
};
_local3++;
}
}
rate = 4;
var realroot = this._parent;
dude.guts.gotoAndPlay("walk");
showSword(dude.guts.sword);
var cols = new Array("0xFF0000", "0xFFFF00", "0xFF00FF", "0x00FF00", "0xFFFFFF", "0x00FFFF");
count = 0;
cv = 0;
this.onEnterFrame = function () {
moveStuff();
cv++;
if ((cv >= 10) && (!this.noconfetti)) {
cv = 0;
makeConfetti();
}
};
Symbol 1785 MovieClip Frame 1757
noconfetti = true;
Symbol 1785 MovieClip Frame 1808
if (!realroot.nospeed) {
tim.text = realroot.datime;
} else {
tim.text = "[ Must be completed in one run (without quitting) for highscores! ]";
but_submit._visible = false;
}
arm.text = realroot.curarmor;
mag.text = realroot.curmag;
sword.text = realroot.cursword;
deaths.text = realroot.so.data.numdeaths;
var swords = new Array("Peasant", "Sword Training Wheels", "Sword Apprentice", "Quick Sword", "Lightning Sword", "Mega-Sword", "Ultra-Sword", "Sword Expert", "Master Swordsman");
var mags = new Array("Peasant", "Tome Reader", "Magician's Apprentice", "Magic Seeker", "Magic Man", "Low Wizard", "Mid-Wizard", "High Wizard", "Master Magician");
var arms = new Array("Peasant", "Defenseless", "Tin Man", "Copper Plated", "Chain-Mail Man", "Plate-Mail Man", "Defense Apprentice", "Defense Journeyman", "Master Defender");
var highest = 0;
var hipoint = arms;
if (realroot.curarmor > highest) {
highest = realroot.curarmor;
hipoint = arms;
}
if (realroot.curmag > highest) {
highest = realroot.curmag;
hipoint = mags;
}
if (realroot.cursword > highest) {
highest = realroot.cursword;
hipoint = swords;
}
rank.text = hipoint[highest];
if (((realroot.curarmor == 8) && (realroot.curmag == 8)) && (realroot.cursword == 8)) {
rank.text = "Ultimate Master of Ultimate Destiny";
}
but_main.onPress = function () {
realroot.gotoAndStop("main");
};
but_submit.onPress = function () {
var _local1 = "Chibi Knight Speedruns";
var _local2 = realroot.datime;
gotoAndStop ("submitted");
};
Symbol 1785 MovieClip Frame 1868
stop();
Symbol 1785 MovieClip Frame 1869
tim.text = realroot.datime;
Symbol 1786 MovieClip Frame 1
function runIt() {
delete this.onEnterFrame;
gotoAndStop ("intro");
}
but_start._visible = false;
aup = false;
this.onEnterFrame = function () {
var _local4 = this.getBytesTotal();
var _local3 = this.getBytesLoaded();
var _local2 = Math.round((_local3 / _local4) * 100);
loader.gotoAndStop(_local2);
if (_local2 >= 100) {
but_start._visible = true;
but_start.onPress = function () {
runIt();
};
this.onEnterFrame = function () {
if (!Key.isDown(65)) {
aup = true;
}
if (aup && (Key.isDown(65))) {
aup = false;
runIt();
}
};
}
};
Stage.showMenu = false;
stop();
var CPMStarPoolID = 1052;
var CPMStarSubPoolID = 42;
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie((("http://server.cpmstar.com/adviewas2.swf?poolid=" + CPMStarPoolID) + "&subpoolid=") + CPMStarSubPoolID);
Instance of Symbol 192 MovieClip [APIConnector] in Symbol 1786 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
apiId = "10886";
encryptionKey = "ZlIciHDj96vYaWsqYox29OYMl9ebcLuh";
debugMode = "Simulate Logged-in User";
movieVersion = "";
connectorType = "Invisible";
redirectOnNewVersion = true;
redirectOnHostBlocked = true;
adType = "Video";
}
Symbol 1786 MovieClip Frame 3
stop();
Symbol 1786 MovieClip Frame 4
function runMedal(nam) {
var _local1 = nam;
com.newgrounds.API.unlockMedal(_local1);
}
function clearDat() {
realroot.so.clear();
realroot.updateProg();
}
function showSword(who) {
i = 0;
while (i < 9) {
var hid = eval ("who.s" + i);
hid._visible = false;
i++;
}
sho = eval ("who.s" + cursword);
sho._visible = true;
}
function updateProg() {
realroot.curmag = 0;
realroot.curarmor = 0;
realroot.cursword = 0;
realroot.numdeaths = 0;
if (realroot.so.data.numdeaths != undefined) {
realroot.curmag = so.data.curmag;
realroot.curarmor = so.data.curarmor;
realroot.cursword = so.data.cursword;
realroot.numdeaths = so.data.numdeaths;
}
var _local1 = new Color(men.prog.masker);
_local1.setRGB(armorarray[realroot.curarmor]);
men.prog.arm.text = "-" + realroot.curarmor;
men.prog.mag.text = "-" + realroot.curmag;
men.prog.sword.text = "-" + realroot.cursword;
men.prog.deaths.text = "-" + realroot.numdeaths;
showSword(men.prog.swordthing);
men.prog.magthing.updateMe();
}
function goTime() {
delete this.onEnterFrame;
realroot.gotoAndStop("map");
}
stop();
var realroot = this;
realroot.gameending = false;
realroot._quality = "High";
realroot.qualset = "High";
realroot.so = SharedObject.getLocal("oukoku");
armorarray = new Array("0xB56A39", "0x69E2B1", "0x4C4C4C", "0xBFBFBF", "0x6FA637", "0x4665A0", "0xE6001E", "0xF7F7F7", "0xFFC219");
armorstrokearray = new Array("0x3A2212", "0x187851", "0x1E1E1E", "0x515151", "0x334D1A", "0x253752", "0x7E011B", "0x6A6A6A", "0x765301");
updateProg();
this.onEnterFrame = function () {
if (!Key.isDown(65)) {
aup = true;
}
if (Key.isDown(65) && (aup)) {
aup = false;
goTime();
}
};
men.but_cleardata.onPress = function () {
men.sure._visible = true;
};
men.but_cleardata.onRollOver = function () {
this.gotoAndStop(2);
};
men.but_cleardata.onRollOut = function () {
this.gotoAndStop(1);
};
men.but_cleardata.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 1786 MovieClip Frame 5
function setNoise(v) {
if (!realroot.museoff) {
this.bgmusic.trak.setVolume(v);
}
}
function playLoudSound(m) {
if (!realroot.sfxoff) {
s = new Sound(this.loud);
s.attachSound(m);
s.start();
}
}
function playSound(m) {
if (!realroot.sfxoff) {
s = new Sound(this.sfx);
s.attachSound(m);
s.setVolume(sfnoise);
s.start();
}
}
function runMusic(m) {
stopAllSounds();
bgmusic.trak = new Sound(this.bgmusic);
bgmusic.trak.attachSound(m);
this.bgmusic.trak.setVolume(bgnoise);
bgmusic.trak.start(0, 999);
if (realroot.museoff) {
bgmusic.trak.setVolume(0);
}
}
function freshSave() {
trace("SAVING");
realroot.so.data.datime = realroot.datime;
realroot.so.data.xp = realroot.xp;
realroot.so.data.fairyaccomplished = realroot.fairyaccomplished;
realroot.so.data.numdeaths = realroot.numdeaths;
realroot.so.data.keycount = realroot.keycount;
realroot.so.data.woodcount = realroot.woodcount;
realroot.so.data.deliveredwood = realroot.deliveredwood;
realroot.so.data.gotfairy = realroot.gotfairy;
realroot.so.data.gotboots = realroot.gotboots;
realroot.so.data.gotkey = realroot.gotkey;
realroot.so.data.dooropen = realroot.dooropen;
realroot.so.data.gotaxe = realroot.gotaxe;
realroot.so.data.nextpointer = realroot.nextpointer;
realroot.so.data.curarmor = realroot.curarmor;
realroot.so.data.curmag = realroot.curmag;
realroot.so.data.cursword = realroot.cursword;
realroot.so.data.treechops = new Array();
realroot.so.data.spells = new Array();
realroot.so.data.dungeondoors = new Array();
realroot.so.data.dungeonkeys = new Array();
realroot.so.data.gems = new Array();
realroot.so.data.enarray = new Array();
realroot.so.data.spawns = new Array();
var _local1 = 0;
while (_local1 < realroot.treechops.length) {
realroot.so.data.treechops[_local1] = realroot.treechops[_local1];
_local1++;
}
_local1 = 0;
while (_local1 < realroot.spells.length) {
realroot.so.data.spells[_local1] = realroot.spells[_local1];
_local1++;
}
_local1 = 0;
while (_local1 < realroot.dungeondoors.length) {
realroot.so.data.dungeondoors[_local1] = realroot.dungeondoors[_local1];
_local1++;
}
_local1 = 0;
while (_local1 < realroot.dungeonkeys.length) {
realroot.so.data.dungeonkeys[_local1] = realroot.dungeonkeys[_local1];
_local1++;
}
_local1 = 0;
while (_local1 < realroot.gems.length) {
realroot.so.data.gems[_local1] = realroot.gems[_local1];
_local1++;
}
_local1 = 0;
while (_local1 < realroot.enarray.length) {
realroot.so.data.enarray[_local1] = realroot.enarray[_local1];
_local1++;
}
_local1 = 0;
while (_local1 < realroot.spawns.length) {
realroot.so.data.spawns[_local1] = realroot.spawns[_local1];
_local1++;
}
realroot.so.flush();
}
function addSpawn() {
var _local1 = new Array("", "", false);
spawns.push(_local1);
}
function colorMe(who) {
var _local2 = new Color(who.fill);
var _local1 = new Color(who.stroke);
_local2.setRGB(armorarray[curarmor]);
_local1.setRGB(armorstrokearray[curarmor]);
}
function getShot() {
btm.dispose();
trace(mappy.dude._alpha);
btm = new flash.display.BitmapData(640, 480, true, 16777215);
realroot.psign.attachBitmap(btm, 0);
o = realroot;
var _local1 = new flash.geom.Matrix();
_local1.tx = 0;
_local1.ty = 0;
_local1.a = 1;
alf = 1;
var _local2 = new flash.geom.ColorTransform(1, 1, 1, alf, 0, 0, 0, 0);
btm.draw(o, _local1, _local2);
psign.filters = [];
psign.filters = new Array(filter);
}
function chkPause() {
if (!Key.isDown(P)) {
pup = true;
}
if (Key.isDown(P) && (pup)) {
pup = false;
if (game._x != undefined) {
if (!platpause) {
pauseIt();
platpause = true;
} else {
platpause = false;
unPause();
}
}
if (mappy._x != undefined) {
if (!pausy) {
pauseIt();
pausy = true;
} else {
unPause();
pausy = false;
}
}
}
}
function pauseIt() {
pguts._visible = true;
pguts.updateMe();
playSound("pausesound");
setNoise(0);
getShot();
game.boss.guts.guts2.stop();
game.boss.guts.stop();
game.boss.guts.head.guts.stop();
var _local1 = 0;
while (_local1 < baddies.length) {
var _local2 = baddies[_local1];
if (_local2.troll) {
_local2.guts.stop();
}
_local1++;
}
}
function unPause() {
playSound("pausesound");
pguts._visible = false;
if (!game.boss.guts.lastframe) {
game.boss.guts.play();
}
if (!game.boss.guts.head.guts.lastframe) {
game.boss.guts.head.guts.play();
}
var _local1 = 0;
while (_local1 < baddies.length) {
var _local2 = baddies[_local1];
if (_local2.troll) {
_local2.guts.play();
}
_local1++;
}
game.boss.guts.guts2.play();
btm.dispose();
psign.filters = [];
setNoise(bgnoise);
}
function addEnem() {
var _local1 = new Array();
var _local2 = random(3);
_local1.link = "map_enemy" + _local2;
_local1.x = random(900) - 450;
_local1.y = random(900) - 450;
_local1.typ = _local2;
enarray.push(_local1);
}
function getNextThing() {
if (nextpointer == 0) {
this.nextxp = armorprogression[curarmor];
if (realroot.armorprogression[realroot.curarmor] == 99999) {
realroot.nextpointer = 1;
this.nextxp = magicprogression[curmag];
if (realroot.magicprogression[realroot.curmag] == 99999) {
realroot.nextpointer = 2;
this.nextxp = attackprogression[cursword];
}
}
}
if (nextpointer == 1) {
this.nextxp = magicprogression[curmag];
if (realroot.magicprogression[realroot.curmag] == 99999) {
realroot.nextpointer = 2;
this.nextxp = attackprogression[cursword];
if (realroot.attackprogression[cursword] == 99999) {
realroot.nextpointer = 0;
this.nextxp = armorprogression[curarmor];
}
}
}
if (nextpointer == 2) {
this.nextxp = attackprogression[cursword];
if (realroot.attackprogression[cursword] == 99999) {
realroot.nextpointer = 0;
this.nextxp = armorprogression[curarmor];
if (realroot.armorprogression[realroot.curarmor] == 99999) {
realroot.nextpointer = 1;
this.nextxp = magicprogression[curmag];
}
}
}
if (((magicprogression[curmag] == 99999) && (armorprogression[curarmor] == 99999)) && (attackprogression[cursword] == 99999)) {
if (this.nextxp != "MAX") {
realroot.runMedal("Grinder");
}
this.nextxp = "MAX";
}
}
function runFade() {
this.attachMovie("fader", "fader", 99999);
who = realroot.mappy.dude;
goalx = 320 - who._x;
goaly = 240 - who._y;
distx = goalx - realroot.mappy._x;
disty = goaly - realroot.mappy._y;
realroot.mappy._x = realroot.mappy._x + (distx / 1);
realroot.mappy._y = realroot.mappy._y + (disty / 1);
}
function runTran() {
fader.gotoAndPlay(1);
pausy = true;
who = realroot.mappy.dude;
goalx = 320 - who._x;
goaly = 240 - who._y;
distx = goalx - realroot.mappy._x;
disty = goaly - realroot.mappy._y;
realroot.mappy._x = realroot.mappy._x + (distx / 1);
realroot.mappy._y = realroot.mappy._y + (disty / 1);
}
function fadedIn() {
fader.unloadMovie();
fader.removeMovieClip();
pausy = false;
}
function startPlat(terr, lev, hitthing) {
if (this._currentframe == 5) {
if (lev < 500) {
if (lev < 200) {
trace((terr + "_") + lev);
this.platlev = (("platlev" + terr) + "_") + lev;
realroot.hitloc = new Array(hitthing._x, hitthing._y);
this.gotoAndStop("plat");
} else {
realroot.pausy = true;
hudd.mapfade.gotoAndPlay(2);
dest = hitthing.typ;
mappy.dude.guts.gotoAndStop("rest_" + mappy.dude.dir);
trace("entering dungeon");
}
} else {
this.platlev = (("platlev" + terr) + "_") + lev;
realroot.hitloc = new Array(1620, -750);
this.gotoAndStop("plat");
}
}
}
stop();
realroot._quality = realroot.qualset;
bgnoise = 40;
sfnoise = 40;
this.loud = this.createEmptyMovieClip("loud", 4885122);
this.bgmusic = this.createEmptyMovieClip("bgmusic", 4885120);
this.sfx = this.createEmptyMovieClip("sfx", 4885121);
this.U = 38;
this.R = 39;
this.L = 37;
this.D = 40;
this.atk = 65;
delete game.onEnterFrame;
delete this.onEnterFrame;
game.unloadMovie();
game.removeMovieClip();
who = realroot.mappy.dude;
goalx = 320 - who._x;
goaly = 240 - who._y;
distx = goalx - realroot.mappy._x;
disty = goaly - realroot.mappy._y;
realroot.mappy._x = realroot.mappy._x + (distx / 1);
realroot.mappy._y = realroot.mappy._y + (disty / 1);
this.attachMovie("pausesign", "psign", 9991111);
pguts = this.attachMovie("pausesign_guts", "pguts", 9991112);
pguts._visible = false;
this.P = 80;
var matrix = new Array();
matrix = matrix.concat([0.308600038290024, 0.609399974346161, 0.0820000022649765, 0, 0]);
matrix = matrix.concat([0.308600008487701, 0.609399974346161, 0.0820000022649765, 0, 0]);
matrix = matrix.concat([0.308600008487701, 0.609399974346161, 0.0820000246167183, 0, 0]);
matrix = matrix.concat([0, 0, 0, 1, 0]);
var filter = (new flash.filters.ColorMatrixFilter(matrix));
if (!inited) {
inited = true;
realroot.rightbridge = true;
realroot.gemtranny = -1;
mapp = new Array(320, 240);
this.maxhp = 100;
this.curhp = this.maxhp;
this.maxmag = 100;
this.magamt = this.maxmag;
this.xp = 0;
this.datime = 0;
armorprogression = new Array(25, 50, 100, 180, 280, 400, 550, 800, 99999);
magicprogression = new Array(45, 90, 150, 250, 380, 530, 750, 950, 99999);
attackprogression = new Array(120, 185, 270, 450, 650, 1100, 1500, 1950, 99999);
powarray = new Array(1, 1.5, 4, 8, 13, 20, 35, 45, 65);
magpowarray = new Array(10, 20, 30, 45, 65, 80, 120, 150, 200);
usemagarray = new Array(1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2);
armstrength = new Array(1, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1);
fairyaccomplished = false;
indungeon = false;
pastdungeon = false;
keycount = 0;
woodcount = 0;
deliveredwood = false;
gotfairy = false;
gotaxe = false;
numdeaths = 0;
gotboots = false;
gotkey = false;
dooropen = false;
nextpointer = 0;
curarmor = 0;
curmag = 0;
cursword = 0;
realroot.nospeed = false;
treechops = new Array();
spells = new Array(false, false, false, false, true);
dungeondoors = new Array(false, false, false);
dungeonkeys = new Array(false, false, false, false);
gems = new Array(false, false, false);
getNextThing();
curcat = 1;
enarray = new Array();
enarray[0] = new Array();
enarray[0].link = "boss0";
enarray[0].x = 1200;
enarray[0].y = 1020;
enarray[0].typ = 99;
enarray[1] = new Array();
enarray[1].link = "boss1";
enarray[1].x = 15;
enarray[1].y = -1525;
enarray[1].typ = 98;
enarray[2] = new Array();
enarray[2].link = "wizard0";
enarray[2].x = 500;
enarray[2].y = 300;
enarray[2].typ = 199;
enarray[3] = new Array();
enarray[3].link = "wizard1";
enarray[3].x = 7;
enarray[3].y = -1805;
enarray[3].typ = 198;
enarray[4] = new Array();
enarray[4].link = "wizard2";
enarray[4].x = 535;
enarray[4].y = -960;
enarray[4].typ = 197;
enarray[5] = new Array();
enarray[5].link = "dungeon0";
enarray[5].x = -1440;
enarray[5].y = 375;
enarray[5].typ = 200;
enarray[6] = new Array();
enarray[6].link = "wizard4";
enarray[6].x = 130;
enarray[6].y = 290;
enarray[6].typ = 194;
enarray[7] = new Array();
enarray[7].link = "boss2";
enarray[7].x = -1440;
enarray[7].y = -295;
enarray[7].typ = 97;
spawns = new Array();
if (realroot.so.data.numdeaths == undefined) {
trace("NEW GAME");
var i = 0;
while (i < 7) {
addEnem();
i++;
}
var i = 0;
while (i < 24) {
addSpawn();
i++;
}
realroot.freshSave();
} else {
trace("loading old game");
var test = isNaN(so.data.xp);
if ((so.data.xp == undefined) || (test)) {
so.data.xp = 0;
}
so.data.datime = 9999999 /* 0x98967F */;
realroot.nospeed = true;
realroot.datime = so.data.datime;
realroot.xp = so.data.xp;
fairyaccomplished = so.data.fairyaccomplished;
keycount = so.data.keycount;
woodcount = so.data.woodcount;
deliveredwood = so.data.deliveredwood;
gotfairy = so.data.gotfairy;
gotaxe = so.data.gotaxe;
gotboots = so.data.gotboots;
gotkey = so.data.gotkey;
dooropen = so.data.dooropen;
nextpointer = so.data.nextpointer;
curarmor = so.data.curarmor;
curmag = so.data.curmag;
cursword = so.data.cursword;
numdeaths = so.data.numdeaths;
dungeondoors = new Array();
dungeonkeys = new Array();
gems = new Array();
treechops = new Array();
spells = new Array();
enarray = new Array();
spawns = new Array();
var i = 0;
while (i < realroot.so.data.spawns.length) {
realroot.spawns[i] = realroot.so.data.spawns[i];
i++;
}
var i = 0;
while (i < realroot.so.data.enarray.length) {
realroot.enarray[i] = realroot.so.data.enarray[i];
i++;
}
var i = 0;
while (i < realroot.so.data.treechops.length) {
realroot.treechops[i] = realroot.so.data.treechops[i];
i++;
}
var i = 0;
while (i < realroot.so.data.spells.length) {
realroot.spells[i] = realroot.so.data.spells[i];
i++;
}
var i = 0;
while (i < realroot.so.data.dungeondoors.length) {
realroot.dungeondoors[i] = realroot.so.data.dungeondoors[i];
i++;
}
var i = 0;
while (i < realroot.so.data.dungeonkeys.length) {
realroot.dungeonkeys[i] = realroot.so.data.dungeonkeys[i];
i++;
}
var i = 0;
while (i < realroot.so.data.gems.length) {
realroot.gems[i] = realroot.so.data.gems[i];
i++;
}
getNextThing();
}
var saver = true;
var i = 0;
while (i < realroot.dungeondoors.length) {
if (!realroot.dungeondoors[i]) {
saver = false;
}
i++;
}
if (saver) {
mapp = new Array(1620, -600);
mappy.dude._x = mapp[0];
mappy.dude._y = mapp[1];
mappy.gotoAndStop(2);
}
}
msgbox.unloadMovie();
msgbox.removeMovieClip();
hud.unloadMovie();
hud.removeMovieClip();
mappy.dude._x = mapp[0];
mappy.dude._y = mapp[1];
pausy = true;
runFade();
var numenems = 0;
var i = 0;
while (i < enarray.length) {
if (!enarray[i].dead) {
if (enarray[i].typ <= 10) {
numenems++;
}
}
i++;
}
if (numenems < 7) {
addEnem();
trace("adding enemy");
}
Symbol 1786 MovieClip Frame 6
function runEnd() {
gotoAndStop ("end");
}
function addFireSpurt(who) {
spurts.push(who);
who.cv = 0;
who.maxcv = 30;
}
function runSpurts() {
var _local2 = 0;
while (_local2 < spurts.length) {
var _local1 = spurts[_local2];
if (!_local1.shooting) {
_local1.cv++;
if (_local1.cv >= _local1.maxcv) {
_local1.cv = 0;
_local1.shooting = true;
_local1.gotoAndPlay("warn");
}
}
_local2++;
}
}
function shootSpurt(who) {
who.guts.gotoAndStop("spurt");
}
function endSpurt(who) {
who.guts.gotoAndStop("norm");
who.shooting = false;
}
function endLevelup() {
realroot.setNoise(realroot.bgnoise);
this.attachMovie("plat_hud", "hud", 983);
updateHUD();
hud._visible = true;
if ((!game.bossbattle) || (game.boss.dead)) {
hud.bosslife._visible = false;
}
platpause = false;
flashIt();
if (!game.boss.guts.guts2.lastframe) {
game.boss.guts.guts2.play();
}
levelup.removeMovieClip();
levelup.unloadMovie();
realroot.freshSave();
}
function runUp() {
if ((!realroot.gameending) && (nextxp != "MAX")) {
flashIt();
hud._visible = false;
platpause = true;
game.boss.guts.guts2.stop();
this.attachMovie("levelup", "levelup", 999989);
}
}
function addxp(num, full) {
if (nextxp != "MAX") {
if (!full) {
xp = xp + Math.round(num / 10);
} else {
xp = xp + num;
}
hud.showxp = (xp + "/") + nextxp;
if (xp >= nextxp) {
runUp();
}
} else {
hud.showxp = "MAXED!";
}
}
function updateHUD(hit, use) {
showSword(game.dude.guts.sword);
if (((!game.bossbattle) || (game.boss.dead)) || ((game.boss.typ == 97) && (game.boss.shielded))) {
hud.bosslife._visible = false;
} else {
hud.bosslife.nam.text = game.boss.nam;
var _local2 = game.boss;
hud.bosslife.bar._xscale = (_local2.hp / _local2.maxhp) * 100;
if (hud.bosslife.bar._xscale <= 0) {
hud.bosslife.bar._xscale = 0;
}
}
addxp(0);
if (curhp < 0) {
curhp = 0;
}
if (curhp > maxhp) {
curhp = maxhp;
}
hud.lifebar2._xscale = hud.lifebar._xscale;
hud.lifebar._xscale = (curhp / maxhp) * 100;
hud.lifebar2.goalsc = hud.lifebar._xscale;
hud.lifebar2.tim = 0;
if (hit) {
hud.lifebar2.onEnterFrame = function () {
this.tim++;
if (this.tim >= 1) {
if (this._xscale > this.goalsc) {
var _local2 = this.goalsc - this._xscale;
this._xscale = this._xscale + (_local2 / 5);
} else {
delete this.onEnterFrame;
}
}
};
} else {
hud.lifebar2._xscale = hud.lifebar._xscale;
}
hud.pointer._x = hud.magbar._x + (145.3 * usemagarray[curmag]);
if (magamt < 0) {
magamt = 0;
}
if (magamt > maxmag) {
magamt = maxmag;
}
hud.magbar2._xscale = hud.magbar._xscale;
hud.magbar._xscale = (magamt / maxmag) * 100;
hud.magbar2.goalsc = hud.magbar._xscale;
hud.magbar2.tim = 0;
if (use) {
hud.magbar2.onEnterFrame = function () {
this.tim++;
if (this.tim >= 1) {
if (this._xscale > this.goalsc) {
var _local2 = this.goalsc - this._xscale;
this._xscale = this._xscale + (_local2 / 5);
} else {
delete this.onEnterFrame;
}
}
};
} else {
hud.magbar2._xscale = hud.magbar._xscale;
}
}
function addEnem(who) {
if (baddies == undefined) {
baddies = new Array();
}
baddies.push(who);
who.xvel = 0;
who.hitcv = 0;
who.yvel = 0;
who.aicv = 0;
who.storedhits = 0;
who.origscale = who._xscale;
}
function flashIt() {
game.flasher._alpha = 100;
game.flasher.onEnterFrame = function () {
this._alpha = this._alpha - 25;
if (this._alpha <= 0) {
delete this.onEnterFrame;
}
};
}
function moveBads() {
var _local10 = 0;
while (_local10 < 3) {
var _local8 = game["dais" + _local10];
if (_local8.hit) {
_local8.hitcv++;
if (_local8.hitcv >= 5) {
_local8.hitcv = 0;
_local8.hit = false;
}
}
_local10++;
}
_local10 = 0;
while (_local10 < baddies.length) {
b = baddies[_local10];
if ((b._x < -2500) || (b._x > 2500)) {
removeBad(b);
}
if (!b.groundimmune) {
b.xvel = b.xvel * game.fric;
b.yvel = b.yvel + game.grav;
}
b._x = b._x + b.xvel;
b._y = b._y + b.yvel;
b.virtx = b._x + game._x;
b.virty = b._y + game._y;
if (((!b.spearing) && (!b.boss)) && (!b.independent)) {
if (game.dude._x > b._x) {
b._xscale = -b.origscale;
} else {
b._xscale = b.origscale;
}
}
if ((((!b.dead) && (b.hp > 0)) && (!b.groundimmune)) || (b.boss && (!b.groundimmune))) {
while (game.bg.hitTest(b.virtx, b.virty, true)) {
b.onground = true;
b._y = b._y - 1;
b.virty = b.virty - 1;
b.yvel = 0;
b.numhits = 0;
}
}
dudeHit(b, b.guts.hitarea);
if (b.typ == 0) {
if (!game.dude.dead) {
if (b.hit) {
b.hitcv++;
b.guts.gotoAndStop("hit");
if (b.hitcv >= 5) {
b.hit = false;
b.guts.gotoAndPlay("rest");
}
}
b.aicv++;
if (b.aicv >= 25) {
b.dec = random(3);
if ((b.dec == 0) && (b.onground)) {
if (game.dude._x < b._x) {
b.xvel = -25;
} else {
b.xvel = 25;
}
b.yvel = -20;
b.onground = false;
}
b.aicv = random(20);
}
}
}
if (b.typ == 1) {
if (!game.dude.dead) {
if (b.hit) {
b.hitcv++;
b.guts.gotoAndStop("hit");
if (b.hitcv >= 5) {
b.hit = false;
b.guts.gotoAndPlay("rest");
}
b.groundimmune = false;
}
if (b.onground) {
aicv++;
if (aicv >= 15) {
aicv = 0;
if (game.dude._x < b._x) {
b.xvel = -35;
} else {
b.xvel = 35;
}
b.yvel = -30 - random(15);
b.onground = false;
}
}
}
}
if (b.typ == 98) {
b.xvel = 0;
b.yvel = 0;
if (!game.dude.dead) {
if (!game.boss.dead) {
if (game.dude._x < b._x) {
b._xscale = -100;
} else {
b._xscale = 100;
}
if (b.upp) {
b.aicv++;
if (b.aicv >= 15) {
b.upp = false;
b.dec = 1;
b.aicv = 0;
}
}
if (b.dec == 1) {
b.guts.head.gotoAndStop("fire");
}
if (b.dec == 3) {
b.aicv++;
if (b.aicv >= 5) {
game.boss.guts.gotoAndPlay("down1");
game.boss.head.gotoAndStop("rest");
b.dec = 0;
}
}
if (b.dec == 2) {
b.aicv++;
if (b.aicv >= 50) {
if (b._x == 110) {
b._x = 850;
} else {
b._x = 110;
}
b.aicv = 0;
b.dec = 0;
b.guts.gotoAndPlay("up1");
b.guts.head.gotoAndStop("rest");
}
}
if (b.hit) {
b.hit = false;
b.gotoAndPlay("hit");
}
} else if (!b.dead) {
realroot.game.boss.ball0._visible = false;
realroot.game.boss.ball1._visible = false;
realroot.game.boss.ball2._visible = false;
b.dead = true;
b.guts.gotoAndStop("die");
}
}
}
if (b.typ == 97) {
if (!game.dude.dead) {
if (b.form2) {
b.shielded = false;
if (b._x < (game.lef - 100)) {
b._x = game.lef - 100;
}
if (b._x > (game.rig - 100)) {
b._x = game.rig - 100;
}
}
if (!game.boss.dead) {
if (b.shielded) {
var _local12 = true;
if (((!game.dais0.dead) || (!game.dais1.dead)) || (!game.dais2.dead)) {
_local12 = false;
}
if (_local12) {
b.shielded = false;
hud.bosslife._visible = true;
updateHUD();
b.speed = 10;
}
}
if (b.hit) {
if (b.hitcv == 0) {
if (!b.form2) {
b.gotoAndPlay("hit");
b.guts.hitarea.gotoAndPlay("hit");
} else {
b.guts.hitarea.gotoAndPlay("hit");
}
}
b.hitcv++;
if (b.hitcv >= 5) {
b.hit = false;
b.hitcv = 0;
}
}
if (!b.form2) {
if (b.shielded) {
if (b.dir == -1) {
b._x = b._x - b.speed;
} else {
b._x = b._x + b.speed;
}
if (b._x < -300) {
b.dir = 1;
}
if (b._x > 850) {
b.dir = -1;
}
b.fireballcv++;
if (b.fireballcv >= 5) {
b.guts.mouth.gotoAndStop("open");
if (!b.mouthopen) {
playSound("fball1");
b.mouthopen = true;
dragonBall();
}
if (b.fireballcv >= 10) {
b.mouthopen = false;
b.guts.mouth.gotoAndStop(1);
b.fireballcv = 0;
}
}
} else {
if (b.dir == -1) {
b._x = b._x - b.speed;
} else {
b._x = b._x + b.speed;
}
if (b._x < -245) {
b.dir = 1;
}
if (b._x > 850) {
b.dir = -1;
}
if (b.ydir == -1) {
b._y = b._y - b.speed;
} else {
b._y = b._y + b.speed;
}
if (b._y < -800) {
b.ydir = 1;
}
if (b._y > 150) {
b.ydir = -1;
}
b.fireballcv++;
if (b.fireballcv >= 15) {
b.guts.mouth.gotoAndStop("open");
if (!b.mouthopen) {
playSound("fball1");
b.mouthopen = true;
dragonBall();
}
if (b.fireballcv >= 20) {
b.mouthopen = false;
b.guts.mouth.gotoAndStop(1);
b.fireballcv = 0;
}
}
}
}
}
}
}
if (b.typ == 502) {
if (!game.dude.dead) {
if (!game.boss.dead) {
if (b.hit) {
if (b.hitcv == 0) {
b.gotoAndPlay("hit");
}
b.hitcv++;
if (b.hitcv >= 5) {
b.hit = false;
b.hitcv = 0;
}
}
if (b.dir == -1) {
b.goal = -300;
} else {
b.goal = 1250;
}
var _local17 = Math.abs(game.dude._x - b._x);
var _local13 = Math.abs(b.goal - b._x);
if (_local13 < 50) {
b.dir = b.dir * -1;
}
if (b.goal < b._x) {
b._x = b._x - 5;
b._xscale = 100;
} else {
b._x = b._x + 5;
b._xscale = -100;
}
if (_local17 > 180) {
if (!b.walking) {
b.walking = true;
b.attacking = false;
b.guts.gotoAndPlay("walk");
}
} else {
b.walking = false;
if (!b.attacking) {
b.attacking = true;
b.guts.gotoAndPlay("atk0");
}
}
var _local6 = game.fish0;
var _local9 = game.fish1;
_local6.cv++;
if (_local6.cv >= 50) {
rocks = new Array();
_local6.dir = _local6.dir * -1;
_local9.dir = _local9.dir * -1;
_local6.cv = 0;
var _local4 = game.attachMovie("rock", "rock" + effcv, effcv + 55441);
effcv++;
_local4._x = _local6._x;
_local4._y = _local6._y;
var _local11 = random(2);
if (_local11 == 0) {
_local11 = -1;
}
_local4._xscale = _local4._xscale * _local11;
_local4.xvel = 7 * _local6.dir;
_local4.yvel = -10;
_local4._xscale = 70;
_local4._yscale = _local4._xscale;
rocks.push(_local4);
_local4 = game.attachMovie("rock", "rock" + effcv, effcv + 55441);
effcv++;
_local11 = random(2);
if (_local11 == 0) {
_local11 = -1;
}
_local4._xscale = _local4._xscale * _local11;
_local4._x = _local9._x;
_local4._y = _local9._y;
_local4.xvel = 7 * _local9.dir;
_local4.yvel = -10;
_local4._xscale = 70;
_local4._yscale = _local4._xscale;
rocks.push(_local4);
}
var _local5 = 0;
while (_local5 < rocks.length) {
var _local3 = rocks[_local5];
if (!_local3.smacked) {
_local3._x = _local3._x + _local3.xvel;
_local3._y = _local3._y + _local3.yvel;
_local3.yvel = _local3.yvel + (game.grav * 0.7);
if (!_local3.stuck) {
dudeHit(_local3, _local3);
if (game.bg.hitTest(_local3._x + game._x, _local3._y + game._y, true)) {
_local3.stuck = true;
playSound("hit2");
_local3.gotoAndPlay("break");
_local3.yvel = 0;
while (game.bg.hitTest(_local3._x + game._x, _local3._y + game._y, true)) {
_local3._y--;
}
}
}
}
_local5++;
}
_local5 = 0;
while (_local5 < moverocks.length) {
var _local3 = moverocks[_local5];
_local3._x = _local3._x + (_local3.godir * 25);
if (_local3.hitTest(b.guts.zone) && (!_local3.stuck)) {
b.gotoAndPlay("hit");
playSound("hit" + random(3));
_local3.stuck = true;
_local3.gotoAndPlay("break");
var _local2 = b;
_local2.hp = _local2.hp - 150;
hud.bosslife.bar._xscale = (_local2.hp / _local2.maxhp) * 100;
if (hud.bosslife.bar._xscale <= 0) {
hud.bosslife.bar._xscale = 0;
}
if ((_local2.hp <= 0) && (!_local2.dead)) {
nogo = false;
if (_local2 == game.boss) {
nogo = true;
}
_local2.dead = true;
if (!_local2.boss) {
showXP(_local2, nogo);
addxp(_local2.xp, true);
_local2.guts.gotoAndPlay("die");
} else {
if (realroot.gems[1] && realroot.gems[0]) {
realroot.runMedal("Worthy-chibi");
}
_local2.guts.gotoAndStop("die");
}
} else {
_local2.hit = true;
_local2.hitcv = 0;
}
}
_local5++;
}
}
}
}
if (b.typ == 501) {
if (!game.dude.dead) {
if (!game.boss.dead) {
if (b.hit) {
if (b.hitcv == 0) {
b.gotoAndPlay("hit");
}
b.hitcv++;
if (b.hitcv >= 5) {
b.hit = false;
b.hitcv = 0;
}
}
b.aicv++;
if (((b.aicv >= 100) && (!b.spinning)) && (!b.dizzy)) {
b.spinning = true;
b.guts.gotoAndPlay("atk0");
b.aicv = 0;
b.gox = 0;
}
if (b.dizzy) {
if (b.aicv >= 70) {
b.dizzy = false;
b.weak = false;
}
}
if (b.spinning) {
if (b.ready) {
if (b.dir == -1) {
b.gox = b.gox - 0.8;
} else {
b.gox = b.gox + 0.8;
}
b._x = b._x - b.gox;
if (b.aicv >= b.spindist) {
b.spindist = 56;
b.aicv = 0;
b.spinning = false;
if (b.dir == -1) {
b.dir = 1;
b._xscale = 100;
} else {
b.dir = -1;
b._xscale = -100;
}
b.ready = false;
b.guts.gotoAndPlay("dizzy");
b.dizzy = true;
}
}
}
}
}
}
if (b.typ == 500) {
if (!game.dude.dead) {
if (game.boss.dead) {
clearInterval(this.intr);
}
if (!game.boss.dead) {
if (b.gotaxe) {
if (b._x < game.dude._x) {
b._xscale = -100;
} else {
b._xscale = 100;
}
}
if (b.hit) {
if (b.hitcv == 0) {
b.gotoAndPlay("hit");
}
b.hitcv++;
if (b.hitcv >= 5) {
b.hit = false;
b.hitcv = 0;
}
}
if (b.gotaxe) {
var _local17 = Math.abs(b._x - game.dude._x);
if (!b.attacking) {
if (_local17 < 210) {
b.guts.gotoAndPlay("atk0");
b.attacking = true;
} else if (_local17 < 850) {
b.guts.gotoAndPlay("toss");
b.attacking = true;
}
}
} else if (b.comp.stuck) {
b.weak = true;
var _local17 = b.comp._x - b._x;
if (!b.comp.hitTest(b.guts.hitarea)) {
if (!b.walking) {
b.walking = true;
b.guts.gotoAndPlay("walk");
clearInterval(this.intr);
this.intr = setInterval(moveKnight, 30);
}
} else {
clearInterval(this.intr);
b.walking = false;
if (!b.gettingaxe) {
b.comp.unloadMovie();
b.comp.removeMovieClip();
b.gettingaxe = true;
b.guts.gotoAndPlay("retrieve");
}
}
}
}
}
}
if (b.typ == 99) {
if (!game.dude.dead) {
if (!game.boss.dead) {
if (b.hit) {
b.hit = false;
b.gotoAndPlay("hit");
}
if (b.mod == 0) {
b.aicv++;
if (b.aicv >= 50) {
b.mod = 1;
b.aicv = 0;
b.guts.gotoAndStop("charge");
}
}
if (b.mod == 2) {
b.guts.gotoAndStop("throw");
}
} else if (!b.dead) {
b.dead = true;
realroot.game.boss.ball0._visible = false;
realroot.game.boss.ball1._visible = false;
realroot.game.boss.ball2._visible = false;
b.guts.gotoAndStop("die");
}
} else {
b.guts.gotoAndStop("rest");
}
}
if (b.typ == 3) {
if (!game.dude.dead) {
if (b.hit) {
b.hitcv++;
b.guts.gotoAndStop("hit");
if (b.hitcv >= 5) {
b.hit = false;
b.aicv = 0;
b.walking = false;
b.resting = true;
b.attacking = false;
b.guts.gotoAndPlay("rest");
}
} else if (b.onground) {
if (!b.attacking) {
b.aicv++;
if (b.aicv >= 100) {
b.dec = random(5);
b.aicv = random(25);
b.walking = false;
b.resting = false;
}
var _local7 = game.dude;
if (b.dec >= 2) {
if (b._x < _local7._x) {
b._x = b._x + 3;
b._xscale = -100;
if (!b.walking) {
b.guts.gotoAndPlay("walk");
b.resting = false;
b.walking = true;
}
}
if (b._x > _local7._x) {
b._x = b._x - 3;
b._xscale = 100;
if (!b.walking) {
b.guts.gotoAndPlay("walk");
b.resting = false;
b.walking = true;
}
}
}
if (b.dec == 1) {
if (!b.resting) {
b.resting = true;
b.walking = false;
b.guts.gotoAndPlay("rest");
}
}
if (b.dec == 0) {
if (b._x < _local7._x) {
b._x = b._x - 3;
b._xscale = 100;
if (!b.walking) {
b.guts.gotoAndPlay("walk");
b.resting = false;
b.walking = true;
}
}
if (b._x > _local7._x) {
b._x = b._x + 3;
b._xscale = -100;
if (!b.walking) {
b.guts.gotoAndPlay("walk");
b.resting = false;
b.walking = true;
}
}
}
var _local16 = Math.abs(b._x - _local7._x);
if (_local16 < 96) {
b.attacking = true;
b.resting = false;
b.walking = false;
if (b._x > _local7._x) {
b._xscale = 100;
} else {
b._xscale = -100;
}
b.guts.gotoAndPlay("atk");
}
}
}
}
}
if (b.typ == 5) {
if ((!game.dude.dead) && (!b.dead)) {
if (b.hit) {
if (!b.runninghit) {
b.runninghit = true;
b.gotoAndPlay("hit");
}
b.hitcv++;
if (b.hitcv >= 5) {
b.runninghit = false;
b.hit = false;
b.hitcv = 0;
b.guts.head.gotoAndStop(1);
} else {
b.guts.head.gotoAndPlay(2);
}
}
b.aicv++;
if (b.aicv >= 50) {
b.guts.gotoAndPlay("atk");
b.aicv = 0;
}
}
}
if (b.typ == 4) {
if (!game.dude.dead) {
if (b.hit) {
b.hitcv++;
if (b.hitcv >= 5) {
b.hit = false;
}
if (b._currentframe == 1) {
b.gotoAndPlay("hit");
}
}
b.web.clear();
b.web.lineStyle(8, 16777215);
b.web.moveTo(b.xhome, b.home - 300);
b.web.lineTo(b.xhome, b._y - 130);
b.aicv++;
var _local14 = b.home + 265;
if (b.aicv >= b.upamt) {
if ((b._y < _local14) && (!b.arrived)) {
b._y = b._y + 16;
b.wait = 0;
} else {
b.wait++;
b.arrived = true;
if (b.wait > b.downamt) {
if (b._y > b.home) {
b._y = b._y - 10;
} else {
b.arrived = false;
b.aicv = 0;
b.wait = 0;
}
}
}
}
}
}
if (b.typ == 2) {
if (!game.dude.dead) {
if (b.hit) {
b._yscale = -100;
b.guts._y = 2;
b.hitcv++;
b.guts.gotoAndStop("hit");
b.dewinged = true;
b.groundimmune = false;
if (b.hitcv >= 5) {
b.hit = false;
b.guts.gotoAndStop("rest");
}
}
if (!b.dewinged) {
if (!b.activated) {
var _local15 = Math.abs(b._x - game.dude._x);
if (_local15 < 320) {
b.activated = true;
b.vertdist = 100;
b.maxwait = random(5);
b.wait = 0;
}
}
if (b.activated) {
if (b.vertdist > 1) {
b.vertdist = Math.abs(game.dude._y - b._y);
b.vdist = game.dude._y - b._y;
b._y = b._y + (b.vdist / 4);
} else if (!b.spearing) {
if (b.wait < b.maxwait) {
b.wait++;
} else {
if (game.dude._x < b._x) {
b.dir = -1;
} else {
b.dir = 1;
}
b.spearing = true;
}
} else {
b.absvel = Math.abs(b.xvel);
if (b.absvel < 30) {
b.xvel = b.xvel + (1.5 * b.dir);
}
}
}
}
}
}
_local10++;
}
}
function reviveDemon() {
game.boss.groundimmune = false;
game.boss.independent = false;
game.boss.nomove = false;
game.boss.gotoAndPlay("hit");
game.boss.dead = false;
game.boss.hp = game.boss.maxhp;
game.boss.nam = "Demon Eye";
updateHUD();
}
function moveKnight() {
if ((!realroot.platpause) && (!realroot.freeze)) {
if (realroot.game.boss._x > realroot.game.boss.comp._x) {
realroot.game.boss._x = realroot.game.boss._x - 2;
} else {
realroot.game.boss._x = realroot.game.boss._x + 2;
}
}
}
function chkAwardGet(who) {
if ((who.hitTest(game.dude.guts.hitarea1) && (!realroot.platpause)) && (!realroot.freeze)) {
platpause = true;
flashIt();
playSound("gleam");
trace("award gotten");
game.dude.nootheranims = true;
game.dude.guts.gotoAndPlay("itemget");
if (game.boss.typ == 99) {
game.dude.guts.item.attachMovie("boots2", "guts", 0);
realroot.gotboots = true;
}
if (game.boss.typ == 98) {
game.dude.guts.item.attachMovie("key", "guts", 0);
realroot.gotkey = true;
}
if (game.boss.typ == 500) {
var _local1 = game.dude.guts.item.attachMovie("gem0", "guts", 0);
_local1._x = -63;
_local1._y = -155;
realroot.gems[0] = true;
realroot.gemtranny = 0;
}
if (game.boss.typ == 501) {
var _local1 = game.dude.guts.item.attachMovie("gem1", "guts", 0);
_local1._x = -63;
_local1._y = -155;
realroot.gems[1] = true;
realroot.gemtranny = 1;
}
if (game.boss.typ == 502) {
var _local1 = game.dude.guts.item.attachMovie("gem2", "guts", 0);
_local1._x = -63;
_local1._y = -155;
realroot.gems[2] = true;
realroot.gemtranny = 2;
}
delete who.onEnterFrame;
game.boss._visible = false;
realroot.freshSave();
}
}
function tossAxe(who) {
var _local2 = game.attachMovie("knight0_axe", "axe", 71100 + effcv);
who.gotaxe = false;
who.comp = _local2;
_local2._xscale = who._xscale;
_local2.comp = who;
effcv++;
_local2.dir = who._xscale / -100;
_local2._x = who._x + (50 * _local2.dir);
_local2._y = who._y - 80;
var _local4 = Math.abs(game.dude._x - who._x);
if (_local4 < 350) {
trace("dist0");
_local2.xvel = 16 * _local2.dir;
_local2.yvel = -27;
}
if ((_local4 >= 350) && (_local4 < 500)) {
trace("dist1");
_local2.xvel = 23 * _local2.dir;
_local2.yvel = -30;
}
if (_local4 >= 500) {
trace("dist2");
_local2.xvel = 25 * _local2.dir;
_local2.yvel = -37;
}
_local2.realroot = realroot;
_local2.onEnterFrame = function () {
if ((!this.realroot.platpause) && (!this.realroot.freeze)) {
if (!this.stuck) {
if (!this.comp.dead) {
this.realroot.dudeHit(this, this.hitarea, true);
this.realroot.dudeHit(this, this.hitarea1, true);
this.realroot.dudeHit(this, this.hitarea2, true);
}
this._x = this._x + this.xvel;
this._y = this._y + this.yvel;
this.yvel = this.yvel + this.realroot.game.grav;
this._rotation = this._rotation + (25 * this.dir);
if (this.realroot.game.bg.hitTest(this._x + game._x, (this._y + 70) + game._y, true) || (this._y > 380)) {
this.cv = 0;
this.realroot.playSound("hit2");
this._rotation = -200 * this.dir;
this.realroot.screenShake(15);
this.stuck = true;
}
} else if (this.cv < 5) {
this.cv++;
this.realroot.dudeHit(this, this.hitarea, true);
this.realroot.dudeHit(this, this.hitarea1, true);
this.realroot.dudeHit(this, this.hitarea2, true);
}
}
};
}
function retrieveAxe(who) {
who.weak = false;
who.comp = undefined;
who.gotaxe = true;
who.attacking = false;
who.walking = false;
who.gettingaxe = false;
}
function knight0AtkEnd(who) {
who.attacking = false;
}
function defeatBoss() {
trace("DEFEAT BOSS");
noleave = true;
realroot.game.boss.ball0._visible = false;
realroot.game.boss.ball1._visible = false;
realroot.game.boss.ball2._visible = false;
trace("WHICHBOSS: " + whichboss);
trace("WHICHBOSS LINK: " + whichboss.link);
trace("BEFORE whichboss.dead: " + whichboss.dead);
whichboss.dead = true;
trace("AFTER whichboss.dead: " + whichboss.dead);
showXP(game.boss, nogo);
addxp(game.boss.xp, true);
game.boss.guts.gotoAndStop("award");
whichboss = 0;
trace("gotoaward");
}
function dudeHit(b, box) {
if ((((box.hitTest(game.dude.guts.hitarea1) && (!b.dead)) && (!realroot.platpause)) && (!realroot.freeze)) && (!b.weak)) {
if (((!game.dude.hit) && (!game.dude.flashing)) && (!game.dude.magicking)) {
playLoudSound("gethit");
playLoudSound("ah");
flashIt();
var _local1 = b.dam * realroot.armstrength[realroot.curarmor];
if (game.dude.shielded) {
_local1 = _local1 * 0.6;
}
curhp = curhp - _local1;
updateHUD(true);
chunks(game.dude._x, game.dude._y - 50);
if (curhp <= 0) {
runDeath();
} else {
game.dude.hit = true;
}
game.dude.jumping = true;
if (b._x < game.dude._x) {
game.dude.xvel = 35;
game.dude._xscale = -1 * game.dude.sc;
} else {
game.dude.xvel = -35;
game.dude._xscale = 1 * game.dude.sc;
}
game.dude.yvel = -30;
}
}
}
function addBossBall() {
var tar = eval ("game.boss.ball" + game.boss.numballs);
tar._visible = true;
game.boss.numballs++;
if (game.boss.numballs == 3) {
game.boss.mod = 2;
game.boss.numballs = 0;
}
}
function grabBall() {
var tar = eval ("game.boss.ball" + game.boss.numballs);
tar._visible = false;
game.boss.numballs++;
}
function ballBomb() {
var _local2 = game.attachMovie("boss1_hairball", "hball" + effcv, effcv + 999981);
effcv++;
_local2._x = locs[ballpointer];
ballpointer++;
if (ballpointer >= locs.length) {
ballpointer = 0;
}
_local2._y = -1200;
_local2.yvel = 0;
if ((game.boss.numballs == 3) && (!game.boss.dead)) {
game.boss.numballs = 0;
game.boss.mod = 0;
game.boss.guts.gotoAndStop("rest");
}
_local2.onEnterFrame = function () {
if ((!realroot.platpause) && (!freeze)) {
this.virtx = this._x + game._x;
this.virty = this._y + game._y;
this.yvel = this.yvel + (realroot.game.grav * 0.2);
this._y = this._y + this.yvel;
if (realroot.game.bg.hitTest(this.virtx, this.virty, true)) {
realroot.makeBSplode(this._x, (this._y - this.yvel) - 10);
this.unloadMovie();
this.removeMovieClip();
}
}
};
}
function removeBad(who) {
who.unloadMovie();
who.removeMovieClip();
}
function runDeath() {
if (!game.dude.dead) {
realroot.onbridge = false;
realroot.rightbridge = false;
realroot.playSound("death");
realroot.playLoudSound("ohno");
realroot.setNoise(0);
realroot.numdeaths++;
realroot.freshSave();
game.dude.shielded = false;
w = game.attachMovie("platweaponholder", "weap" + spcv, 7382 + spcv);
w._visible = false;
w._x = game.dude._x;
w._y = game.dude._y - 100;
w._xscale = game.dude.sc * 0.55;
w._yscale = w._xscale;
w._rotation = -90;
if (game.dude._xscale == (1 * game.dude.sc)) {
w.xvel = 5 + random(3);
} else {
w.xvel = -5 - random(3);
}
w.yvel = -20 - random(5);
w.createEmptyMovieClip("dum", 0);
w.dum.onEnterFrame = function () {
yib = this._parent;
if (!yib._visible) {
yib._visible = !yib._visible;
}
yib._x = yib._x + yib.xvel;
yib.xvel = yib.xvel * 0.9;
yib._y = yib._y + yib.yvel;
yib.yvel = yib.yvel + yib._parent.grav;
yib.ang = Math.atan2(yib.yvel, yib.xvel);
yib.degs = Math.round((yib.ang * 180) / Math.PI);
yib._rotation = yib.degs;
ground = yib._parent;
yib.virtx = ground._x + yib._x;
yib.virty = (ground._y + yib._y) + 6;
if (ground.bg.hitTest(yib.virtx, yib.virty, true)) {
chunks(yib._x, yib._y);
yib.swapDepths(ground.bg.getDepth() - 1);
delete this.onEnterFrame;
}
};
spcv++;
game.dude.dead = true;
game.dude.guts.gotoAndPlay("die");
}
}
function runCircle() {
c = this.attachMovie("circ", "circ", 9890);
d = this.attachMovie("circ", "circ2", 9889);
c._visible = false;
d._visible = false;
c._xscale = 200;
c._yscale = c._xscale;
c._x = random(640);
c._y = random(480);
c.comp = d;
c.tim = 0;
c.off = 4;
game.dude.virtx = game._x + game.dude._x;
game.dude.virty = game._y + game.dude._y;
c.onEnterFrame = function () {
this.tim++;
if (this.tim >= 30) {
if (!this._visible) {
this._visible = !this._visible;
this.comp._visible = this._visible;
}
if (this._parent.game.dude._xscale == (-1 * game.dude.sc)) {
this.correct = 10;
} else {
this.correct = -10;
}
this.goalx = this._parent.game.dude.virtx + this.correct;
this.goaly = this._parent.game.dude.virty - 10;
this.distx = this.goalx - this._x;
this.disty = this.goaly - this._y;
this._x = this._x + (this.distx / 10);
this._y = this._y + (this.disty / 10);
this.distsc = -this._xscale;
this.comp._xscale = this._xscale * 5;
this.comp._yscale = this.comp._xscale;
this.comp._x = this._x;
this.comp._y = this._y;
if ((this._xscale > 15) && (!this.goup)) {
this._xscale = this._xscale + (this.distsc / 10);
if (this._xscale <= 15) {
this.goup = true;
}
}
if (this.goup) {
if (!this.bounced) {
this._xscale = this._xscale + this.off;
this.off--;
if (this.off <= 1) {
this.bounced = true;
}
} else if (this._xscale > 5) {
this._xscale = this._xscale - 4;
}
}
this._yscale = this._xscale;
if (this._xscale <= 5) {
this.comp.unloadMovie();
this.comp.removeMovieClip();
var _local3 = true;
var _local2 = 0;
while (_local2 < realroot.dungeondoors.length) {
if (!realroot.dungeondoors[_local2]) {
_local3 = false;
}
_local2++;
}
if (!_local3) {
realroot.indungeon = false;
}
this._parent.endPlat();
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
}
function endPlat() {
realroot.pausy = true;
this.attachMovie("blackout", "blackout", 9891);
goBack();
}
function goBack() {
var saver = true;
var _local2 = 0;
while (_local2 < realroot.dungeondoors.length) {
if (!realroot.dungeondoors[_local2]) {
saver = false;
}
_local2++;
}
curhp = maxhp;
magamt = maxmag;
realroot.rightbridge = true;
trace("LOSE LIFE");
blackout.tim = 0;
blackout.onEnterFrame = function () {
this.tim++;
if (this.tim >= 20) {
var _local2 = false;
if (!saver) {
mapp = new Array(320, 240);
} else {
mapp = new Array(1620, -600);
if (!realroot.pastdungeon) {
_local2 = true;
}
}
this._parent.runMap(_local2);
this.unloadMovie();
this.removeMovieClip();
}
};
hud.unloadMovie();
hud.removeMovieClip();
realroot.freshSave();
}
function chunks(x, y) {
r = 0;
while (r < 10) {
p = game.attachMovie("spark2", "sp" + r, (25 + r) + spcv);
spcv++;
p._x = x;
p._y = y;
p.xvel = random(10) * ((game.dude._xscale / game.dude.sc) * 5);
p.yvel = random(30) * -1;
p.onEnterFrame = function () {
this._x = this._x + this.xvel;
this.xvel = this.xvel * 0.8;
this._y = this._y + this.yvel;
this.yvel = this.yvel + game.grav;
if (this._y > 500) {
delete this.onEnterFrame;
this.removeMovieClip();
this.unloadMovie();
}
};
r++;
}
}
function makeSpark(x, y, who) {
cl = game.attachMovie("clack", "clack" + spcv, 25 + spcv);
cl._x = game.dude._x + ((game.dude._xscale / game.dude.sc) * 70);
cl._y = game.dude._y - 50;
cl._xscale = (game.dude._xscale / game.dude.sc) * 100;
spcv++;
r = 0;
while (r < 6) {
p = game.attachMovie("spark", "sp" + r, (25 + r) + spcv);
spcv++;
p._x = x;
p._y = y;
p.xvel = random(20) * ((game.dude._xscale / game.dude.sc) * 10);
p.yvel = random(30) * -1;
p.onEnterFrame = function () {
this._x = this._x + this.xvel;
this.xvel = this.xvel * 0.8;
this._y = this._y + this.yvel;
this.yvel = this.yvel + game.grav;
if (this._y > 500) {
delete this.onEnterFrame;
this.removeMovieClip();
this.unloadMovie();
}
};
r++;
}
}
function chkSlash(box, magic, fireball, who) {
if (box.hitTest(game.wizard) && (!game.wizard.fairy)) {
playLoudSound("wahm");
if ((!fireball) && (!magic)) {
flashIt();
game.wizard.gotoAndPlay("shielded");
var _local11 = 5 * realroot.armstrength[realroot.curarmor];
if (game.dude.shielded) {
_local11 = _local11 * 0.6;
}
curhp = curhp - _local11;
updateHUD();
chunks(game.dude._x, game.dude._y - 50);
if (curhp <= 0) {
runDeath();
} else {
game.dude.hit = true;
}
game.dude.jumping = true;
if (game.wizard._x < game.dude._x) {
game.dude.xvel = 35;
game.dude._xscale = -1 * game.dude.sc;
} else {
game.dude.xvel = -35;
game.dude._xscale = game.dude.sc;
}
game.dude.yvel = -30;
} else {
game.wizard.gotoAndPlay("shielded");
if (fireball) {
removeDBall(who);
}
}
}
if (box.hitTest(game.wizardo)) {
if ((!fireball) && (!magic)) {
flashIt();
game.wizardo.gotoAndPlay("shielded");
var _local11 = 5 * realroot.armstrength[realroot.curarmor];
if (game.dude.shielded) {
_local11 = _local11 * 0.6;
}
curhp = curhp - _local11;
updateHUD();
chunks(game.dude._x, game.dude._y - 50);
if (curhp <= 0) {
runDeath();
} else {
game.dude.hit = true;
}
game.dude.jumping = true;
if (game.wizardo._x < game.dude._x) {
game.dude.xvel = 35;
game.dude._xscale = -1 * game.dude.sc;
} else {
game.dude.xvel = -35;
game.dude._xscale = 1 * game.dude.sc;
}
game.dude.yvel = -30;
} else {
game.wizardo.gotoAndPlay("shielded");
if (fireball) {
removeDBall(who);
}
}
}
var _local4 = 0;
while (_local4 < 3) {
var _local2 = game["dais" + _local4];
if (box.hitTest(_local2.guts.hitarea) && (!_local2.dead)) {
if (!_local2.hit) {
playSound("hit" + random(3));
_local2.hit = true;
_local2.gotoAndPlay("hit");
_local2.pointer++;
var _local9 = Math.floor(_local2.pointer / 2);
_local2.guts.gotoAndStop(_local9);
if (_local2.pointer >= _local2.maxx) {
_local2.dead = true;
}
if (_local2._x > game.dude._x) {
_local2.godir = 1;
} else {
_local2.godir = -1;
}
_local2.xp = 5;
showXP(_local2, true);
addxp(_local2.xp, true);
makeSpark(_local2._x - (_local2.godir * 20), _local2._y - 150, _local2);
}
}
_local4++;
}
_local4 = 0;
while (_local4 < rocks.length) {
var _local2 = rocks[_local4];
if ((box.hitTest(_local2) && (!_local2.stuck)) && (!fireball)) {
playSound("hit" + random(3));
_local2.smacked = true;
moverocks.push(_local2);
if (_local2._x > game.dude._x) {
_local2.godir = 1;
} else {
_local2.godir = -1;
}
makeSpark(_local2._x - (_local2.godir * 20), _local2._y - 50, _local2);
}
_local4++;
}
_local4 = 0;
while (_local4 < baddies.length) {
tin = baddies[_local4];
if (((box.hitTest(tin.guts.hitarea) && (!tin.hit)) && (!tin.dead)) && (!tin.inv)) {
if (tin.typ == 97) {
if (tin.shielded) {
playLoudSound("wahm");
tin.guts.shield._visible = true;
tin.guts.shield.onEnterFrame = function () {
if ((!realroot.platpause) && (!realroot.freeze)) {
this.cv++;
if (this.cv >= 10) {
this._alpha = this._alpha - 10;
if (this._alpha <= 0) {
this.cv = 0;
this._alpha = 100;
this._visible = false;
delete this.onEnterFrame;
}
}
}
};
}
}
if (!tin.shielded) {
playSound("hit" + random(3));
if (!magic) {
if (!fireball) {
tin.hp = tin.hp - powarray[cursword];
} else {
tin.hp = tin.hp - (0.5 * powarray[cursword]);
}
} else {
tin.hp = tin.hp - magpowarray[curmag];
}
if (tin.boss) {
hud.bosslife.bar._xscale = (tin.hp / tin.maxhp) * 100;
if (hud.bosslife.bar._xscale <= 0) {
hud.bosslife.bar._xscale = 0;
}
}
if (atktimer < 13) {
combos++;
if (combos >= 1) {
showcombo = combos + 1;
j = this.attachMovie("combonums", "combonums", 87390);
j.num.txt = showcombo;
}
} else {
combos = 0;
}
atktimer = 0;
if (!fireball) {
var _local5 = game.dude._xscale / game.dude.sc;
} else {
var _local8 = Math.abs(who._xscale);
var _local5 = who._xscale / _local8;
}
if (!tin.nomove) {
tin.yvel = -24;
tin.onground = false;
tin.xvel = 10 * _local5;
}
tin.numhits++;
if (!fireball) {
makeSpark(tin._x - (_local5 * 20), tin._y - 50, tin);
}
if (fireball) {
removeDBall(who);
}
if ((tin.hp <= 0) && (!tin.dead)) {
nogo = false;
if (tin == game.boss) {
nogo = true;
}
tin.dead = true;
realroot.game.boss.ball0._visible = false;
realroot.game.boss.ball1._visible = false;
realroot.game.boss.ball2._visible = false;
if (!tin.boss) {
showXP(tin, nogo);
addxp(tin.xp, true);
tin.guts.gotoAndPlay("die");
} else if (tin.typ != 97) {
tin.guts.gotoAndStop("die");
if (tin.typ == 99) {
realroot.runMedal("Furball-slayer");
}
if (tin.typ == 98) {
realroot.runMedal("Dragon-slayer");
}
if (tin.typ == 500) {
if (realroot.gems[1] && (realroot.gems[2])) {
realroot.runMedal("Worthy-chibi");
}
}
if (tin.typ == 501) {
if (realroot.gems[0] && (realroot.gems[2])) {
realroot.runMedal("Worthy-chibi");
}
}
if (tin.typ == 502) {
if (realroot.gems[1] && (realroot.gems[0])) {
realroot.runMedal("Worthy-chibi");
}
}
} else if (!tin.form2) {
tin.guts.hitarea.gotoAndPlay("hit");
tin.guts.gotoAndPlay("die");
tin.form2 = true;
} else {
trace("before triggering play, frame is: " + tin.guts._currentframe);
realroot.runMedal("Demon-slayer");
tin.guts.gotoAndPlay("die2");
trace("after triggering play, frame is: " + tin.gut._currentframe);
}
} else {
tin.hit = true;
tin.hitcv = 0;
}
}
}
_local4++;
}
}
function dragonUp() {
if (!game.boss.dead) {
game.boss.upp = true;
}
}
function dragonBallStop() {
if (!game.boss.dead) {
game.boss.upp = false;
game.boss.dec = 3;
game.boss.aicv = 0;
}
}
function dragonDown() {
if (!game.boss.dead) {
game.boss.aicv = 0;
game.boss.dec = 2;
game.boss.down = true;
}
}
function dragonBall(who) {
var _local2 = game.attachMovie("fireball", "fireball" + effcv, 200119 + effcv);
effcv++;
if (game.boss.typ != 97) {
_local2._x = (((who._x + who._parent._x) + who._parent._parent._x) + who._parent._parent._parent._x) + who._parent._parent._parent._parent._x;
_local2._y = (((who._y + who._parent._y) + who._parent._parent._y) + who._parent._parent._parent._y) + who._parent._parent._parent._parent._y;
_local2.dir = 1;
if (game.boss._xscale == -100) {
var _local5 = _local2._x - game.boss._x;
_local2._x = game.boss._x - _local5;
_local2.dir = -1;
}
_local2.xvel = (random(5) + 1) * _local2.dir;
_local2.yvel = -(random(15) + 10);
_local2.dam = 30;
} else {
_local2._x = game.boss._x + 100;
_local2._y = game.boss._y + 165;
_local2.xvel = 0;
_local2.yvel = 1;
_local2.dam = 115;
}
var _local6 = Math.atan2(_local2.yvel, _local2.xvel);
var _local4 = Math.round((_local6 * 180) / Math.PI);
_local2._rotation = _local4;
_local2.onEnterFrame = function () {
if ((!platpause) && (!freeze)) {
dudeHit(this, this.hitarea);
var _local3 = Math.atan2(this.yvel, this.xvel);
var _local2 = Math.round((_local3 * 180) / Math.PI);
this._rotation = _local2;
this._x = this._x + this.xvel;
this.xvel = this.xvel * 0.99;
this.virtx = this._x + game._x;
this.virty = this._y + game._y;
if (this.dam == 30) {
this.yvel = this.yvel + (realroot.game.grav * 0.2);
} else {
this.yvel = this.yvel + (realroot.game.grav * 0.4);
}
this._y = this._y + this.yvel;
if (realroot.game.bg.hitTest(this.virtx, this.virty, true)) {
realroot.makeBSplode(this._x, (this._y - this.yvel) - 10);
this.unloadMovie();
this.removeMovieClip();
}
if ((this._y > 600) || (realroot.game.boss.dead)) {
this.unloadMovie();
this.removeMovieClip();
}
}
};
}
function showXP(who, nogo) {
var _local3 = random(10);
if (nogo) {
_local3 = 8;
}
if ((_local3 <= 7) && (_local3 > 4)) {
hr = game.attachMovie("plat_heart", "heart" + spcv, 25 + spcv);
spcv++;
var _local4 = fg.getDepth();
if (_local4 < (25 + spcv)) {
fg.swapDepths(25 + spcv);
spcv++;
}
hr._x = who._x;
hr._y = who._y;
hr.onEnterFrame = function () {
if ((!realroot.platpause) && (!freeze)) {
this._y = this._y - 2;
this.virty = this._parent._y + this._y;
if (this.hitTest(this._parent.dude.guts.hitarea1)) {
playLoudSound("exclaim" + random(10));
playLoudSound("get");
realroot.curhp = realroot.curhp + 15;
updateHUD();
this._parent.dude.gotoAndPlay("flash");
this._parent.dude.glow = true;
delete this.onEnterFrame;
this.unloadMovie();
this.removeMovieClip();
}
if (this.virty < 0) {
delete this.onEnterFrame;
this.unloadMovie();
this.removeMovieClip();
}
}
};
}
if (_local3 <= 4) {
mb = game.attachMovie("plat_magic", "magbot" + spcv, 25 + spcv);
mb._x = who._x;
mb._y = who._y;
mb.yvel = -10;
mb.tim = 0;
mb.onEnterFrame = function () {
this.tim++;
this._y = this._y + this.yvel;
this.yvel = this.yvel + game.grav;
this.virtx = game._x + this._x;
this.virty = game._y + this._y;
while (game.bg.hitTest(this.virtx, this.virty, true)) {
this._y--;
this.virty--;
this.yvel = 0;
}
if (this.hitTest(game.dude.guts.hitarea1) && (this.tim > 10)) {
playLoudSound("exclaim" + random(4));
playLoudSound("get");
realroot.magamt = realroot.magamt + 15;
realroot.updateHUD();
realroot.game.dude.gotoAndPlay("flash");
realroot.game.dude.glow = true;
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
};
spcv++;
var _local4 = fg.getDepth();
if (_local4 < (25 + spcv)) {
fg.swapDepths(25 + spcv);
spcv++;
}
}
bl = game.attachMovie("points", "points" + spcv, 25 + spcv);
bl._x = who._x;
bl._y = who._y;
bl.timer = 0;
bl.msg = "XP: " + who.xp;
spcv++;
bl.onEnterFrame = function () {
this._y = this._y - 3;
this.timer++;
if (this.timer > 20) {
this._alpha = this._alpha - 10;
}
if (this.timer > 35) {
delete this.onEnterFrame;
this.unloadMovie();
this.removeMovieClip();
}
};
}
function runMap(godungeon) {
trace("go back to map");
realroot.freshSave();
if (((game.wizard != undefined) || (game.blacksmith != undefined)) || (game.boss.typ == 97)) {
mapp = new Array(hitloc[0], hitloc[1] + 100);
}
game.unloadMovie();
game.removeMovieClip();
gotoAndStop ("map");
if (realroot.indungeon || (godungeon)) {
realroot.mappy.gotoAndStop(2);
realroot.pausy = true;
dest = hitthing.typ;
mappy.dude.guts.gotoAndStop("rest_" + mappy.dude.dir);
mappy.tranIt();
trace("returning to dungeon");
}
who = realroot.mappy.dude;
goalx = 320 - who._x;
goaly = 240 - who._y;
distx = goalx - realroot.mappy._x;
disty = goaly - realroot.mappy._y;
realroot.mappy._x = realroot.mappy._x + (distx / 1);
realroot.mappy._y = realroot.mappy._y + (disty / 1);
}
function blacksmithGive() {
if (!realroot.gotaxe) {
if (realroot.gotfairy) {
playLoudSound("get");
showWords("I am 'GLITCH' the blacksmith. Thanks for rescuing my pixie pet, take this axe in exchange. Press 'A' on the map screen to use it. It's strong enough for trees, but won't hurt enemies.");
blacky = true;
realroot.fairyaccomplished = true;
} else {
playLoudSound("get");
showWords("I had to flee the beasts in the middle of the night. I left my pet pixie behind. Return her to me and I'll give you my axe.");
}
} else {
playLoudSound("get");
showWords("The axe I gave you is perfect for cutting down trees, but won't hurt enemies. Press 'A' on the map to use it.");
}
}
function giveSpell(num, sec) {
autoexit = false;
if (num == 0) {
flashIt();
if (!spells[num]) {
spells[num] = true;
playLoudSound("spell");
showWords("The other wizards have gone into hiding...they asked me to give you this spell. May it rain pain upon your enemies. Press 'S' for your spell list. Find the other wizards for more spells!");
} else {
playLoudSound("spell");
showWords("You have my spell. Seek the other wizards' hiding places for more spells!");
}
magamt = maxmag;
updateHUD();
}
if (num == 1) {
if (!spells[num]) {
if (!sec) {
if (woodcount < 100) {
playLoudSound("get");
showWords("The beasts destroyed our house! We need 100 cords of wood to re-build. My grandpa would be so grateful for your help!");
autoexit = true;
} else if (!deliveredwood) {
playLoudSound("get");
showWords("Thank you so much for the wood. My grandpa wants to speak with you...");
deliveredwood = true;
game.wizard.guts.gotoAndStop("happy");
}
} else {
flashIt();
playLoudSound("spell");
showWords("May this spell shield you from enemy attacks.");
spells[num] = true;
magamt = maxmag;
updateHUD();
}
} else if (!sec) {
playLoudSound("get");
showWords("Come back to see grandpa again? Go on ahead!");
} else {
playLoudSound("spell");
flashIt();
showWords("You have my spell. Find the other wizards to gain their powers!");
magamt = maxmag;
updateHUD();
}
}
if (num == 2) {
curhp = maxhp;
updateHUD();
flashIt();
if (!spells[num]) {
spells[num] = true;
playLoudSound("spell");
showWords("You dissolved the spell concealing my house. You must be the hero legend foretold. Use this spell when your health is low.");
} else {
playLoudSound("spell");
showWords("You already have my spell. Use it to re-gain lost health!");
}
}
if (num == 3) {
flashIt();
magamt = maxmag;
updateHUD();
if (!spells[num]) {
spells[num] = true;
playLoudSound("spell");
showWords("You have discovered my secret dungeon lair. Use this spell to toggle fireball shooting. The spell costs no manna, but each fireball depletes manna based on your magic level. May your flaming sword protect your path!");
} else {
playLoudSound("spell");
showWords("I detect that you are already carrying my spell. Use it to shoot fireballs better than Italian plumbers!");
}
}
if (num == 4) {
if (!realroot.gotboots) {
flashIt();
playLoudSound("spell");
showWords("My master, 'GLITCH,' the blacksmith, was chased away by the beasts! Free me and I'll lead you to him! Magic footwear will let you walk on water!");
} else if (!game.fairygo) {
game.fairygo = true;
platpause = false;
wizardgot = false;
}
}
realroot.freshSave();
if (((realroot.spells[0] && (realroot.spells[1])) && (realroot.spells[2])) && (realroot.spells[3])) {
realroot.runMedal("Chibi-mage");
}
}
function showWords(txt) {
hud.msg._visible = true;
hud.msg.guts.text = txt;
wordsup = true;
aup = false;
game.dude.aup = false;
game.dude.attacking = false;
game.dude.xvel = 0;
}
function chkContinue() {
if (!Key.isDown(atk)) {
aup = true;
}
if (aup && (Key.isDown(atk))) {
aup = false;
hud.msg._visible = false;
wordsup = false;
game.dude.aup = false;
if (!blacky) {
platpause = false;
game.dude.guts.gotoAndPlay("rest");
if (Key.isDown(L) || (Key.isDown(R))) {
if (!game.boss.dead) {
trace("override walk0");
game.dude.guts.gotoAndPlay("walk");
}
}
game.blacksmith.guts.gotoAndStop("rest");
} else {
flashIt();
realroot.playLoudSound("spell");
blacky = false;
game.dude.guts.gotoAndPlay("itemget");
game.dude.guts.item.attachMovie("axe", "guts", 0);
realroot.gotaxe = true;
game.blacksmith.guts.gotoAndStop("retract");
}
if (autoexit) {
runMap();
}
}
}
function phys(who) {
if ((game.wizard._x != undefined) && (!wizardgot)) {
if (!game.fairygo) {
var _local4 = game.wizard._x - who._x;
var _local3 = game.wizard._y - who._y;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 < 160) {
wizardgot = true;
platpause = true;
who.guts.gotoAndStop("rest");
game.wizard.guts.gotoAndStop("cast");
}
} else if (game.wizard.guts.hitzone.hitTest(game.dude) && (!realroot.gotfairy)) {
flashIt();
wizardgot = true;
platpause = true;
who.guts.gotoAndStop("rest");
game.wizard.guts.gotoAndStop("freed");
playLoudSound("spell");
showWords("Thank you ever so much! Follow me on the map to find my master!");
realroot.gotfairy = true;
realroot.freshSave();
}
}
if ((game.wizardo._x != undefined) && (!wizardogot)) {
var _local5 = Math.abs(game.wizardo._x - who._x);
if (_local5 < 150) {
wizardogot = true;
platpause = true;
who.guts.gotoAndStop("rest");
game.wizardo.guts.gotoAndStop("cast");
}
}
if ((game.blacksmith._x != undefined) && (!blacksmithgot)) {
var _local5 = Math.abs(game.blacksmith._x - who._x);
if (_local5 < 180) {
blacksmithgot = true;
platpause = true;
who.guts.gotoAndStop("rest");
if (!realroot.gotaxe) {
game.blacksmith.guts.gotoAndStop("give");
} else {
blacksmithGive();
}
}
}
if (who.glow) {
h = 0;
while (h < 2) {
sp = game.attachMovie("spark", "sp" + spcv, 25 + spcv);
spcv++;
sp.xvel = game.dude.xvel;
sp._x = (game.dude._x + random(50)) - 25;
sp._y = game.dude._y - random(50);
sp.yvel = -3;
sp.onEnterFrame = function () {
this._x = this._x + this.xvel;
this.xvel = this.xvel * 0.9;
this._y = this._y + this.yvel;
this.yvel = this.yvel - 0.4;
this._xscale = this._xscale - 5;
this._yscale = this._xscale;
if (this._xscale <= 0) {
delete this.onEnterFrame;
this.unloadMovie();
this.removeMovieClip();
}
};
h++;
}
who.glowcv++;
if (who.glowcv >= 15) {
who.glowcv = 0;
who.glow = false;
}
}
atktimer++;
who.yvel = who.yvel + game.grav;
who.xvel = who.xvel * game.fric;
if (who.yvel > 25) {
who.yvel = 25;
}
who._y = who._y + who.yvel;
who._x = who._x + who.xvel;
who.virtx = who._x + game._x;
who.virty = who._y + game._y;
who.absxvel = Math.abs(who.xvel);
if (who.absxvel > 0) {
if ((who.virtx < 0) || (who.virtx > 640)) {
if (!noleave) {
if (realroot.onbridge) {
realroot.onbridge = false;
if (realroot.rightbridge) {
if (who.virtx < 0) {
realroot.rightbridge = false;
}
} else if (who.virtx > 640) {
realroot.rightbridge = true;
}
if (realroot.rightbridge) {
mapp[0] = 1100;
mapp[1] = 700;
} else {
mapp[0] = 850;
mapp[1] = 900;
}
}
pausy = true;
runMap();
} else {
realroot.hud._visible = true;
realroot.hud.reminder._visible = true;
realroot.hud.reminder.cv = 0;
}
}
}
if (who._x < game.lef) {
who._x = game.lef;
}
if (who._x > game.rig) {
who._x = game.rig;
}
if (realroot.hud.reminder._visible) {
realroot.hud.reminder.cv++;
if (realroot.hud.reminder.cv >= 100) {
realroot.hud.reminder.cv = 0;
realroot.hud.reminder._visible = false;
}
}
if (who.yvel > 0) {
while (game.bg.hitTest(who.virtx, who.virty, true)) {
who._y = who._y - 1;
who.virty = who.virty - 1;
who.yvel = 0;
if (who.jumping) {
if (who.dead) {
who.guts.gotoAndPlay("bounce");
runCircle();
who.xvel = 0;
}
who.jumping = false;
if (!who.attacking) {
who.anim = 3;
}
}
}
if (realroot.gotboots) {
while (game.waterwalk.hitTest(who.virtx, who.virty, true)) {
who._y = who._y - 1;
who.virty = who.virty - 1;
who.yvel = 0;
if (who.jumping) {
if (who.dead) {
who.guts.gotoAndPlay("bounce");
runCircle();
who.xvel = 0;
}
who.jumping = false;
if (!who.attacking) {
who.anim = 3;
}
}
}
}
}
if (who.shielded) {
game.shield._x = who._x;
game.shield._y = who._y;
game.shield._xscale = who._xscale;
game.shield._yscale = who._yscale;
} else {
game.shield.unloadMovie();
game.shield.removeMovieClip();
}
}
function screenShake(amt) {
g = game.createEmptyMovieClip("shaker", 745);
g.rightt = true;
g.amt = amt;
g.onEnterFrame = function () {
if (this.rightt) {
this._parent.startoff = this.amt;
} else {
this._parent.startoff = -this.amt;
}
this.rightt = !this.rightt;
this.amt--;
if (this.amt == 0) {
this.startoff = 0;
delete this.onEnterFrame;
}
};
}
function centerOn(who) {
var _local1 = -1;
if (who._xscale == who.sc) {
_local1 = -1;
} else {
_local1 = 1;
}
game.goalx = (320 - who._x) + (100 * _local1);
game.fg._x = game._x * 0.7;
var _local3 = game.goalx - game._x;
game._x = game._x + ((_local3 / 8) + game.startoff);
game._y = 390 - who._y;
if (game._x > (-game.lef)) {
game._x = -game.lef;
}
if (game._x < ((-game.rig) + 640)) {
game._x = (-game.rig) + 640;
}
if (game._y < 0) {
game._y = 0;
}
game.farbg._x = -game._x;
game.farbg._y = -game._y;
game.flasher._x = -game._x;
game.flasher._y = -game._y;
if ((game.dude._y > 1000) && (!platended)) {
game.dude.dead = true;
realroot.playLoudSound("ohno");
mapp = new Array(320, 240);
realroot.onbridge = false;
realroot.rightbridge = false;
platended = true;
numdeaths++;
endPlat();
}
}
function magAtk(who) {
var _local2 = maxmag * usemagarray[curmag];
if (_local2 <= magamt) {
magamt = magamt - _local2;
updateHUD(false, true);
who.magicking = true;
who.attacking = false;
flashIt();
goob = game.createEmptyMovieClip("goober", 32937);
goob.tim = 0;
goob.cv = 0;
goob.lim = 8;
goob.realroot = realroot;
goob.onEnterFrame = function () {
if ((!realroot.platpause) && (!freeze)) {
this.tim++;
if ((this.tim > 8) && (this.tim < (10 + this.lim))) {
g = game.attachMovie("mball" + curmag, "ball" + this.cv, 88829 + this.cv);
this.cv++;
g._rotation = -90;
g.realroot = this.realroot;
g._x = game.dude._x + ((game.dude._xscale / game.dude.sc) * -28);
g._y = game.dude._y - 100;
g._xscale = 50;
g._yscale = g._xscale;
g.xvel = random(80) - 40;
g.yvel = (random(5) + 5) * -5;
g.onEnterFrame = function () {
if ((!this.realroot.platpause) && (!freeze)) {
this.xvel = this.xvel * 0.9;
this.yvel = this.yvel + this._parent.grav;
this._x = this._x + this.xvel;
if (this.yvel > 0) {
this.nexty = this._y + this.yvel;
while ((this._y < this.nexty) && (!this.hit)) {
this._y++;
this.virty++;
h = 0;
while (h < baddies.length) {
yin = baddies[h];
if (yin.hitTest(this.virtx, this.virty, true)) {
makeSplode(this._x, this._y);
this.hit = true;
this.removeMovieClip();
this.unloadMovie();
}
h++;
}
if (game.bg.hitTest(this.virtx, this.virty, true) || (this.virty > 480)) {
makeSplode(this._x, this._y);
this.hit = true;
this.removeMovieClip();
this.unloadMovie();
}
}
} else {
this._y = this._y + this.yvel;
}
}
this.ang = Math.atan2(this.yvel, this.xvel);
this.degs = Math.round((this.ang * 180) / Math.PI);
this._rotation = this.degs;
this.virtx = game._x + this._x;
this.virty = game._y + this._y;
};
}
if (this.tim >= (10 + this.lim)) {
delete this.onEnterFrame;
}
}
};
}
}
function magControls() {
magchooser = game.magchooser;
if (!Key.isDown(R)) {
rup = true;
}
if (Key.isDown(R) && (rup)) {
rup = false;
if (magchooser.rdy) {
magchooser.sel++;
if (magchooser.sel > (magchooser.nams.length - 1)) {
magchooser.sel = 0;
}
var _local1 = magchooser["c" + magchooser.sel];
magchooser.light._x = _local1._x;
magchooser.light._y = _local1._y;
if (spells[magchooser.sel]) {
magchooser.holder.msg.text = magchooser.nams[magchooser.sel];
} else {
magchooser.holder.msg.text = "NEED TO LEARN SPELL";
}
}
}
if (!Key.isDown(L)) {
lup = true;
}
if (Key.isDown(L) && (lup)) {
lup = false;
if (magchooser.rdy) {
magchooser.sel--;
if (magchooser.sel < 0) {
magchooser.sel = magchooser.nams.length - 1;
}
var _local1 = magchooser["c" + magchooser.sel];
magchooser.light._x = _local1._x;
magchooser.light._y = _local1._y;
if (spells[magchooser.sel]) {
magchooser.holder.msg.text = magchooser.nams[magchooser.sel];
} else {
magchooser.holder.msg.text = "NEED TO LEARN SPELL";
}
}
}
if (!Key.isDown(magbut)) {
game.dude.sup = true;
}
if (Key.isDown(magbut) && (game.dude.sup)) {
game.dude.sup = false;
exitMagThing();
}
if (!Key.isDown(atk)) {
aup = true;
}
if (Key.isDown(atk) && (aup)) {
aup = false;
game.dude.aup = false;
if (magchooser.rdy) {
cancelled = false;
if (magchooser.sel == 4) {
trace("cancel");
playLoudSound("nevermind");
var cancelled = true;
exitMagThing();
}
if (magchooser.sel == 3) {
if (realroot.spells[3]) {
flashIt();
cancelled = true;
playLoudSound("fire");
playLoudSound("spell");
magFire(game.dude);
exitMagThing();
}
}
var _local2 = maxmag * usemagarray[curmag];
if ((_local2 <= magamt) && (spells[magchooser.sel])) {
if (magchooser.sel == 0) {
game.dude.anim = 8;
playLoudSound("attack");
magAtk(game.dude);
}
if (magchooser.sel == 2) {
game.dude.anim = 8;
playLoudSound("life");
magHeal(game.dude);
}
if (magchooser.sel == 1) {
game.dude.anim = 8;
playLoudSound("shield");
magShield(game.dude);
}
playLoudSound("spell");
exitMagThing();
} else if (!cancelled) {
playLoudSound("notenoughmagic");
trace("NOT ENOUGH! OR UNAVAILABLE!");
}
}
}
}
function magHeal(who) {
flashIt();
var _local2 = maxmag * usemagarray[curmag];
magamt = magamt - _local2;
realroot.curhp = realroot.curhp + 35;
this._parent.dude.gotoAndPlay("flash");
this._parent.dude.glow = true;
updateHUD(false, true);
game.dude.aup = false;
}
function magFire(who) {
flashIt();
if (fireballson) {
var _local2 = 0;
while (_local2 < dfireballs.length) {
var _local3 = dfireballs[_local2];
_local3.unloadMovie();
_local3.removeMovieClip();
_local2++;
}
}
fireballson = !fireballson;
this._parent.dude.gotoAndPlay("flash");
this._parent.dude.glow = true;
updateHUD(false, true);
game.dude.aup = false;
}
function removeDBall(who) {
var _local1 = 0;
while (_local1 < dfireballs.length) {
var _local2 = dfireballs[_local1];
if (who == _local2) {
makeFireBallBurst(_local2._x, _local2._y);
dfireballs.splice(_local1, 1);
who.unloadMovie();
who.removeMovieClip();
}
_local1++;
}
}
function makeFireBallBurst(x, y) {
var _local1 = game.attachMovie("fireballburst", "fburst" + effcv, effcv + 7711);
effcv++;
_local1._x = x;
_local1._y = y;
_local1._xscale = 70;
_local1._yscale = _local1._xscale;
}
function moveDudeFireballs() {
var _local2 = 0;
while (_local2 < dfireballs.length) {
var _local1 = dfireballs[_local2];
_local1._x = _local1._x + _local1.xvel;
_local1.virtx = _local1._x + game._x;
_local1.virty = _local1._y + game._y;
chkSlash(_local1, false, true, _local1);
if ((_local1.virtx > 750) || (game.bg.hitTest(_local1.virtx, _local1.virty, true))) {
removeDBall(_local1);
}
_local2++;
}
}
function dudeFireball(who) {
var _local4 = 5 * usemagarray[curmag];
var _local5 = magamt - _local4;
if (_local5 > 0) {
playSound("fball0");
magamt = magamt - _local4;
updateHUD();
var _local1 = game.attachMovie("magfirewrap", "dball" + effcv, effcv + 778);
effcv++;
dfireballs.push(_local1);
var _local3 = who._xscale / who.sc;
_local1._x = who._x + (35 * _local3);
_local1._y = who._y - 25;
_local1._xscale = who.sc * 0.5;
_local1._yscale = _local1._xscale;
_local1._xscale = _local1._xscale * _local3;
_local1.xvel = 15 * _local3;
_local1.cacheAsBitmap = true;
_local1.guts.nam.text = "";
}
}
function magShield(who) {
flashIt();
var _local4 = maxmag * usemagarray[curmag];
magamt = magamt - _local4;
this._parent.dude.gotoAndPlay("flash");
this._parent.dude.glow = true;
var _local2 = this.game.attachMovie("shieldcover", "shield", 9911);
var _local3 = game.fg.getDepth();
if (_local3 <= 9911) {
game.fg.swapDepths(9912);
}
_local2._x = game.dude._x;
_local2._y = game.dude._y;
game.fg.swapDepths(9912);
_local2._xscale = game.dude._xscale;
_local2._yscale = game.dude._yscale;
game.dude.shielded = true;
updateHUD(false, true);
game.dude.aup = false;
}
function exitMagThing() {
var _local1 = 0;
while (_local1 < baddies.length) {
var _local2 = baddies[_local1];
if (_local2.troll) {
_local2.guts.play();
}
_local1++;
}
freeze = false;
var _local3 = game.dude;
_local3.xvel = 0;
_local3.attacking = false;
_local3.guts.gotoAndStop("rest");
if (Key.isDown(R) || (Key.isDown(L))) {
trace("override walk1");
if (!game.boss.dead) {
_local3.guts.gotoAndPlay("walk");
}
}
game.magchooser.unloadMovie();
game.magchooser.removeMovieClip();
}
function runMagic(who) {
realroot.playSound("gleam");
realroot.playLoudSound("spelltime");
var _local1 = 0;
while (_local1 < baddies.length) {
var _local4 = baddies[_local1];
if (_local4.troll) {
_local4.guts.stop();
}
_local1++;
}
who.attacking = false;
freeze = true;
aup = true;
sup = true;
flashIt();
var _local3 = game.attachMovie("magchooser", "magchooser", 8872111);
_local3.rdy = false;
_local3._x = who._x;
_local3._y = who._y;
_local3.sel = 0;
_local3.ikes = new Array("magwrapping", "magshield", "maglife", "magfire", "magexit");
_local3.nams = new Array("MAGIC ATTACK", "MAGIC SHIELD", "RESTORE LIFE", "MAGIC FIREBALLS", "CANCEL & EXIT");
_local1 = 0;
while (_local1 < _local3.ikes.length) {
var _local2 = _local3["c" + _local1];
trace("spells are up! " + _local2);
if (spells[_local1]) {
var _local5 = _local2.attachMovie(_local3.ikes[_local1], "guts", 0);
if (_local1 == 3) {
if (realroot.fireballson) {
_local5.nam.text = "ON";
} else {
_local5.nam.text = "OFF";
}
}
} else {
_local2.attachMovie("magquestion", "guts", 0);
}
_local1++;
}
}
function makeSplode(x, y) {
playSound("splosion1");
spl = game.attachMovie("splode", "splosion" + spcv, 63726 + spcv);
spcv++;
spl._x = x;
spl._y = y;
spl.which = random(2);
if (spl.which == 0) {
spl._xscale = 100;
} else {
spl._xscale = -100;
}
}
function makeBSplode(x, y) {
playSound("splosion1");
spl = game.attachMovie("splode2", "splosion" + spcv, 63726 + spcv);
spcv++;
screenShake(10);
spl._x = x;
spl._y = y;
spl.which = random(2);
if (spl.which == 0) {
spl._xscale = 100;
} else {
spl._xscale = -100;
}
}
function endMagic(who) {
who.magicking = false;
if (!who.jumping) {
who.xvel = 0;
}
restAtk();
}
function controls(who) {
if (!who.dead) {
if ((!who.hit) && (!who.magicking)) {
if (Key.isDown(R)) {
if (!who.attacking) {
who.xvel = who.xvel + who.speed;
who._xscale = 1 * who.sc;
if ((!who.jumping) && (who.anim != 3)) {
who.anim = 1;
}
}
}
if (Key.isDown(L)) {
if (!who.attacking) {
who.xvel = who.xvel - who.speed;
who._xscale = -1 * who.sc;
if ((!who.jumping) && (who.anim != 3)) {
who.anim = 1;
}
}
}
if (!Key.isDown(U)) {
who.uup = true;
}
if (Key.isDown(U) && (who.uup)) {
who.uup = false;
if (((!who.jumping) && (who.anim != 3)) && (who.yvel < 15)) {
who.jumping = true;
if (!who.attacking) {
who.anim = 2;
}
who.yvel = -who.jumpht;
}
}
if ((Key.isDown(atk) && (!who.attacking)) && (who.aup)) {
if (fireballson) {
dudeFireball(who);
}
who.attacking = true;
who.anim = 3 + curatk;
var _local2 = curatk - 1;
playSound("swing" + _local2);
playSound("yell" + random(5));
curatk++;
if (curatk > 3) {
curatk = 1;
}
who.aup = false;
}
if (Key.isDown(atk)) {
who.aup = false;
} else {
who.aup = true;
}
if (((((!Key.isDown(R)) && (!Key.isDown(L))) && (!who.jumping)) && (who.anim != 3)) && (!who.attacking)) {
who.anim = 0;
}
if (!Key.isDown(magbut)) {
who.sup = true;
}
if (Key.isDown(magbut) && (who.sup)) {
who.sup = false;
runMagic(who);
who.anim = 9;
}
if (Key.isDown(magbut)) {
who.sup = false;
}
}
if (who.flashing) {
who.flashcv++;
who._visible = !who._visible;
if (who.flashcv >= 20) {
who.flashing = false;
who.flashcv = 0;
}
}
if (who.hit) {
who.anim = 7;
who.hitcv++;
if (who.hitcv >= 15) {
who.flashing = true;
resetAtk(who);
who.hit = false;
who.hitcv = 0;
}
}
if ((prevanim != who.anim) && (!who.nootheranims)) {
prevanim = who.anim;
switch (who.anim) {
case 0 :
who.guts.gotoAndPlay("rest");
break;
case 1 :
trace("override walk2");
who.guts.gotoAndPlay("walk");
break;
case 2 :
who.guts.gotoAndPlay("jump");
break;
case 3 :
who.guts.gotoAndPlay("land");
break;
case 4 :
who.guts.gotoAndPlay("atk1");
break;
case 5 :
who.guts.gotoAndPlay("atk2");
break;
case 6 :
who.guts.gotoAndPlay("atk3");
break;
case 7 :
who.guts.gotoAndPlay("hit");
break;
case 8 :
who.guts.gotoAndPlay("magic");
break;
case 9 :
who.guts.gotoAndPlay("magchoose");
}
if (who.anim == 3) {
who.anim = 0;
prevanim = 0;
if (Key.isDown(R) || (Key.isDown(L))) {
prevanim = 1;
}
}
}
}
}
function resetAtk(who) {
who.attacking = false;
who.anim = 0;
prevanim = -1;
}
function endAttack(who) {
resetAtk(who);
who.guts.gotoAndPlay("rest");
}
function jumpRecover(who) {
if ((!realroot.platpause) && (!freeze)) {
if (Key.isDown(R) || (Key.isDown(L))) {
trace("walk override3");
who.guts.gotoAndPlay("walk");
} else {
who.guts.gotoAndPlay("rest");
}
}
}
runFade();
realroot._quality = realroot.qualset;
rocks = new Array();
moverocks = new Array();
noleave = false;
blacky = false;
wizardogot = false;
blacksmithgot = false;
wizardgot = false;
wordsup = false;
fireballson = false;
dfireballs = new Array();
freeze = false;
platended = false;
game.unloadMovie();
game.removeMovieClip();
baddies = new Array();
this.attachMovie(platlev, "game", 0);
game.dude.sc = game.dude._xscale;
game.fric = 0.6;
this.attachMovie("plat_hud", "hud", 983);
game.bg.cacheAsBitmap = true;
game.bg2.cacheAsBitmap = true;
game.farbg.cacheAsBitmap = true;
msgbox.unloadMovie();
msgbox.removeMovieClip();
effcv = 0;
platpause = false;
this.magbut = 83;
spcv = 0;
if (game.boss._x != undefined) {
game.bossbattle = true;
}
updateHUD();
spurts = new Array();
ballpointer = 0;
var locs = new Array();
locs[0] = -350;
locs[1] = -185;
locs[2] = 40;
locs[3] = 530;
locs[4] = 730;
locs[5] = 870;
locs[6] = 40;
locs[7] = 530;
locs[8] = 40;
locs[9] = 530;
locs[10] = 40;
locs[11] = 530;
atktimer = 100;
prevanim = 0;
curatk = 1;
game.startoff = 0;
game.dude.flashcv = 0;
game.dude.hitcv = 0;
game.dude.xvel = 0;
game.dude.yvel = 0;
game.dude.speed = 8;
game.dude.jumpht = 35;
game.dude.glowcv = 0;
game.dude.jumping = true;
game._x = 320 - game.dude._x;
game._y = 390 - game.dude._y;
if (game._x > (-game.lef)) {
game._x = -game.lef;
}
if (game._x < ((-game.rig) + 640)) {
game._x = (-game.rig) + 640;
}
if (game._y < 0) {
game._y = 0;
}
game.farbg._x = -game._x;
game.farbg._y = -game._y;
game.flasher._x = -game._x;
game.flasher._y = -game._y;
delete game.onEnterFrame;
delete this.onEnterFrame;
game.onEnterFrame = function () {
if (game.fric > 0.6) {
game.fric = 0.6;
}
if (!freeze) {
chkPause();
}
if ((!platpause) && (!freeze)) {
realroot.datime++;
if (!game.dude.magicking) {
if (fireballson) {
moveDudeFireballs();
}
runSpurts();
phys(game.dude);
moveBads();
centerOn(game.dude);
}
controls(game.dude);
}
if (wordsup) {
chkContinue();
}
if (freeze) {
magControls();
}
};
Symbol 1786 MovieClip Frame 7
stop();
if (((((!realroot.spells[0]) && (!realroot.spells[1])) && (!realroot.spells[2])) && (!realroot.spells[3])) && (!realroot.gotaxe)) {
realroot.runMedal("Speed-runner");
}
realroot.freshSave();
realroot.gameending = true;
delete this.onEnterFrame;
realroot._quality = "High";
realroot.qualset = "High";
inited = false;
realroot.pastdungeon = false;
mapp = new Array(1620, -600);
stopAllSounds();
delete game.onEnterFrame;
delete this.onEnterFrame;
game.unloadMovie();
game.removeMovieClip();
hud.unloadMovie();
hud.removeMovieClip();
levelup.removeMovieClip();
levelup.unloadMovie();
Symbol 145 MovieClip [__Packages.com.newgrounds.APIConnection] Frame 0
class com.newgrounds.APIConnection
{
var _hostURL, hostDomain, sessionId, publisherId, encryptionKey, userEmail, username, userId, userpageFormat, initialized;
function APIConnection () {
reset();
}
function get hostURL() {
return(_hostURL);
}
function set hostURL(value) {
_hostURL = value;
hostDomain = null;
if (_hostURL) {
var _local2 = _hostURL.split("/");
if ((_local2[0] != "file:") && (_hostURL != "localhost")) {
hostDomain = _local2.splice(0, 3).join("/");
}
}
if (!hostDomain) {
hostDomain = "localhost";
}
//return(hostURL);
}
function get sandboxType() {
return(System.security.sandboxType);
}
function get isNetworkHost() {
switch (sandboxType) {
case "localWithFile" :
case "localWithNetwork" :
case "localTrusted" :
case "application" :
return(false);
case "remote" :
}
return(true);
}
function get hasUserSession() {
return(((sessionId != null) && (sessionId != "")) && (publisherId != 0));
}
function get connected() {
return(connectionState == CONNECTED);
}
function reset() {
connectionState = NOT_CONNECTED;
encryptionKey = null;
sessionId = null;
userEmail = null;
username = null;
userId = 0;
userpageFormat = 0;
}
function assertInitialized() {
if (!initialized) {
com.newgrounds.Logger.logError("You must initialized the API using API.connect() before using this command.");
return(false);
}
return(true);
}
function assertConnected() {
if ((!connectionState) == CONNECTED) {
com.newgrounds.Logger.logError("You must establish a connection using API.connect() before using this command.");
return(false);
}
return(true);
}
function sendSimpleCommand(command, completeHandler, parameters, secureParameters) {
if (parameters == undefined) {
parameters = null;
}
if (secureParameters == undefined) {
secureParameters = null;
}
var _local2 = new com.newgrounds.APICommand(command);
_local2.__set__parameters(parameters);
_local2.__set__secureParameters(secureParameters);
if (completeHandler != null) {
_local2.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, completeHandler);
}
_local2.send(this);
}
function sendCommand(command) {
command.send(this);
}
function loadInBrowser(command, newWindow, parameters) {
if (newWindow == undefined) {
newWindow = true;
}
if (parameters == undefined) {
parameters = null;
}
var _local2 = new com.newgrounds.APICommand(command);
_local2.__set__parameters(parameters);
_local2.loadInBrowser(this, newWindow);
}
static var NOT_CONNECTED = "notConnected";
static var CONNECTING = "connecting";
static var CONNECTED = "connected";
var connectionState = NOT_CONNECTED;
var apiURL = "http://www.ngads.com/gateway_v2.php";
}
Symbol 138 MovieClip [__Packages.com.newgrounds.EventDispatcher] Frame 0
class com.newgrounds.EventDispatcher
{
var _listeners;
function EventDispatcher () {
_listeners = {};
}
function addEventListener(type, listener) {
if (!_listeners[type]) {
_listeners[type] = [];
}
if (typeof(listener) == "function") {
_listeners[type].push({target:null, func:listener});
} else {
_listeners[type].push(listener);
}
}
function removeEventListener(type, listener) {
var _local3 = _listeners[type];
if (_local3) {
var _local5 = _local3.length;
var _local2 = 0;
while (_local2 < _local5) {
if ((_local3[_local2].func == listener) || (_local3[_local2] == listener)) {
_local3.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
}
function dispatchEvent(event) {
var _local4 = _listeners[event.__get__type()];
if (_local4) {
var _local5 = _local4.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local3 = _local4[_local2];
_local3.func.call(_local3.target, event);
_local2++;
}
}
return(true);
}
}
Symbol 137 MovieClip [__Packages.com.newgrounds.Event] Frame 0
class com.newgrounds.Event
{
var _type;
function Event (type) {
_type = type;
}
function get type() {
return(_type);
}
}
Symbol 139 MovieClip [__Packages.com.newgrounds.APIEventDispatcher] Frame 0
class com.newgrounds.APIEventDispatcher extends com.newgrounds.EventDispatcher
{
static var _globalDispatcher;
function APIEventDispatcher () {
super();
}
static function get globalDispatcher() {
return(_globalDispatcher);
}
static function set globalDispatcher(value) {
_globalDispatcher = value;
//return(globalDispatcher);
}
static function initEventQueue() {
setInterval(runEventQueue, 50);
return([]);
}
function dispatchEvent(event) {
_eventQueue.push({dispatcher:this, event:event});
return(true);
}
function actualDispatchEvent(event) {
var _local3 = super.dispatchEvent(event);
if (_globalDispatcher && (this != _globalDispatcher)) {
_globalDispatcher.dispatchEvent(event);
}
}
static function runEventQueue(event) {
var _local3 = _eventQueue.length;
if (_local3) {
var _local4 = _eventQueue;
_eventQueue = [];
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = _local4[_local1];
_local2.dispatcher.actualDispatchEvent(_local2.event);
_local1++;
}
}
}
static var _eventQueue = initEventQueue();
}
Symbol 142 MovieClip [__Packages.com.newgrounds.encoders.BaseN] Frame 0
class com.newgrounds.encoders.BaseN
{
var _hash, _base, _reverseHash;
function BaseN (hash) {
if (hash) {
_hash = hash;
} else {
_hash = DEFAULT_HASH;
}
_base = _hash.length;
_reverseHash = new Object();
var _local2 = 0;
while (_local2 < _hash.length) {
_reverseHash[_hash.charAt(_local2)] = _local2;
_local2++;
}
}
function encodeUint(number, minimumChars) {
if (minimumChars == undefined) {
minimumChars = 1;
}
var _local2 = "";
var _local3 = number;
while (_local3 != 0) {
_local2 = _hash.charAt(_local3 % _base) + _local2;
_local3 = _local3 / _base;
_local3 = int(_local3);
}
while (_local2.length < minimumChars) {
_local2 = _hash.charAt(0) + _local2;
}
return(_local2);
}
function decodeUint(encodedNumber) {
var _local3 = 0;
var _local2 = 0;
while (_local2 < encodedNumber.length) {
_local3 = _local3 * _base;
_local3 = _local3 + _reverseHash[encodedNumber.charAt(_local2)];
_local2++;
}
return(_local3);
}
static var DEFAULT_HASH = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
}
Symbol 148 MovieClip [__Packages.com.newgrounds.APICommand] Frame 0
class com.newgrounds.APICommand extends com.newgrounds.APIEventDispatcher
{
static var _throttleTimestamp, bridge;
var _command, _parameters, _secureParameters, _hasTimeout, _preventCache, _files, _loader, _timeoutTimer, dispatchEvent;
function APICommand (command) {
super();
_command = command;
_parameters = new Object();
_secureParameters = new Object();
_hasTimeout = true;
}
static function stopPendingCommands() {
for (var _local2 in _pendingCommands) {
var _local1 = _pendingCommands[_local2];
_local1.close();
}
_pendingCommands = [];
}
static function onThrottleTimer(event) {
if ((getTimer() - _throttleTimestamp) >= THROTTLE_INTERVAL) {
_throttleCount = 0;
_throttleCount = 0;
while (_commandQueue.length && (_throttleCount < THROTTLE_THRESHOLD)) {
var _local1 = _commandQueue.shift();
_local1.command.send(_local1.connection);
_throttleCount++;
}
}
}
static function encryptHex(hexValue) {
var _local4 = hexValue.length % 6;
var _local3 = "";
var _local1 = 0;
while (_local1 < hexValue.length) {
_local3 = _local3 + _encryptor.encodeUint(int("0x" + hexValue.substr(_local1, 6)), 4);
_local1 = _local1 + 6;
}
return(_local4.toString() + _local3);
}
function get command() {
return(_command);
}
function set command(value) {
_command = value;
//return(command);
}
function get hasTimeout() {
return(_hasTimeout);
}
function set hasTimeout(val) {
_hasTimeout = val;
//return(hasTimeout);
}
function get parameters() {
return(_parameters);
}
function set parameters(object) {
_parameters = new Object();
if (object) {
for (var _local3 in object) {
_parameters[_local3] = object[_local3];
}
}
//return(parameters);
}
function get preventCache() {
return(_preventCache);
}
function set preventCache(value) {
_preventCache = value;
//return(preventCache);
}
function get secureParameters() {
return(_secureParameters);
}
function set secureParameters(object) {
_secureParameters = new Object();
if (object) {
for (var _local3 in object) {
_secureParameters[_local3] = object[_local3];
}
}
//return(secureParameters);
}
function get hasSecureParameters() {
for (var _local2 in _secureParameters) {
return(true);
}
return(false);
}
function addFile(filename, data, dataField, contentType) {
if (contentType == undefined) {
contentType = "application/octet-stream";
}
if (!_files) {
_files = new Object();
}
var _local3 = {filename:filename, data:data, dataField:dataField, contentType:contentType};
_files[filename] = _local3;
}
function removeFile(filename) {
if (_files) {
delete _files[filename];
}
}
function clearFiles() {
_files = null;
}
function close() {
if (_loader) {
clearInterval(_timeoutTimer);
var _local2 = 0;
while (_local2 < _pendingCommands.length) {
if (_pendingCommands[_local2] == this) {
_pendingCommands.splice(_local2, 1);
break;
}
_local2++;
}
_loader = null;
}
}
function loadInBrowser(connection, newWindow) {
_parameters.command_id = _command;
_parameters.tracker_id = (connection.apiId ? (connection.apiId) : 1);
if (connection.debug) {
_parameters.debug = 1;
}
var _local3 = (connection.apiURL + "?host=") + escape(connection.hostDomain);
for (var _local4 in _parameters) {
_local3 = _local3 + ((("&" + escape(_local4)) + "=") + escape(_parameters[_local4]));
}
var _local6;
if (newWindow) {
_local6 = "_blank";
} else {
_local6 = "_top";
}
_root.getURL(_local3, _local6);
}
function send(connection) {
if (_throttleCount >= THROTTLE_THRESHOLD) {
_commandQueue.push({connection:connection, command:this});
} else {
sendInternal(connection);
}
}
function sendInternal(connection) {
var _local4;
_local4 = new LoadVars();
_local4.command_id = _command;
_local4.tracker_id = connection.apiId;
if (connection.debug) {
_local4.debug = 1;
}
if (_preventCache) {
_local4.seed = Math.random();
}
var _local2;
var _local3;
var _local7;
for (_local2 in _parameters) {
_local3 = _parameters[_local2];
if (_local3 != null) {
if (typeof(_local3) == "boolean") {
_local4[_local2] = int(_local3);
} else {
_local4[_local2] = _local3;
}
}
}
if (hasSecureParameters) {
var _local6 = new Object();
for (_local2 in _secureParameters) {
_local3 = _secureParameters[_local2];
if (_local3 != null) {
if (typeof(_local3) == "boolean") {
_local6[_local2] = int(_local3);
} else {
_local6[_local2] = _local3;
}
}
}
var _local8 = "";
_local7 = 0;
while (_local7 < 16) {
_local8 = _local8 + ENCRYPTOR_RADIX.charAt(int(Math.random() * ENCRYPTOR_RADIX.length));
_local7++;
}
_local4.command_id = "securePacket";
_local6.command_id = _command;
_local6.as_version = 3;
_local6.session_id = connection.sessionId;
_local6.user_email = connection.userEmail;
_local6.publisher_id = connection.publisherId;
_local6.seed = _local8;
var _local13 = com.newgrounds.crypto.MD5.hash(_local8);
var _local11 = com.newgrounds.crypto.RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(_local6), connection.encryptionKey);
_local4.secure = encryptHex(_local13 + _local11);
}
com.newgrounds.Logger.logInternal("Sending packet:", _local4);
var _local12;
_local12 = "application/x-www-form-urlencoded";
for (_local2 in _local4) {
if (typeof(_local4[_local2]) == "object") {
_local4[_local2] = com.newgrounds.encoders.json.JSON.encode(_local4[_local2]);
}
}
if (_files) {
for (var _local10 in _files) {
var _local5 = _files[_local10];
if (typeof(_local5.data) == "string") {
_local4[_local10] = _local5.data;
} else {
_local4[_local10] = com.newgrounds.encoders.json.JSON.encode(_local5.data);
}
}
}
_pendingCommands.push(this);
_throttleCount++;
_throttleTimestamp = getTimer();
startLoader(connection.apiURL, _local4, _local12);
}
function startLoader(url, data, contentType) {
_loader = LoadVars(data);
_loader.onData = as2CompleteHandler;
_loader.contentType = contentType;
_loader.sendAndLoad(url, _loader, "POST");
if (_hasTimeout) {
setInterval(this, onTimeout, TIMEOUT_INTERVAL);
}
}
function as2CompleteHandler(data) {
var _local3;
var _local2 = 0;
while (_local2 < _pendingCommands.length) {
if (_pendingCommands[_local2]._loader == this) {
_local3 = _pendingCommands[_local2];
break;
}
_local2++;
}
_local3.onComplete(data);
}
function onTimeout(event) {
close();
com.newgrounds.Logger.logError("Command timed out.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_TIMED_OUT));
}
function onError(error) {
com.newgrounds.Logger.logError("Error when sending command:", error);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_UNKNOWN));
close();
}
function onComplete(data) {
com.newgrounds.Logger.logInternal("Received packet:", data);
try {
if ((!data) || (data == "")) {
throw new Error();
}
var _local2 = com.newgrounds.encoders.json.JSON.decode(data);
if (!_local2) {
throw new Error();
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, _local2, ((_local2 && (_local2.success)) ? (com.newgrounds.APIEvent.ERROR_NONE) : (com.newgrounds.APIEvent.ERROR_COMMAND_FAILED))));
if (bridge) {
bridge.sendEvent(_local2.command_id, _local2);
}
} catch(e) {
com.newgrounds.Logger.logError("Invalid response returned from server: " + data);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_BAD_RESPONSE));
}
close();
}
static var TIMEOUT_INTERVAL = 10000;
static var THROTTLE_INTERVAL = 10050;
static var THROTTLE_TICK_INTERVAL = 1000;
static var THROTTLE_THRESHOLD = 24;
static var _throttleCount = 0;
static var _commandQueue = [];
static var _throttleTimer = setInterval(onThrottleTimer, THROTTLE_TICK_INTERVAL);
static var ENCRYPTOR_RADIX = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
static var _encryptor = new com.newgrounds.encoders.BaseN(ENCRYPTOR_RADIX);
static var _pendingCommands = [];
static var CRLF = "\r\n";
}
Symbol 144 MovieClip [__Packages.com.newgrounds.Bridge] Frame 0
class com.newgrounds.Bridge extends com.newgrounds.EventDispatcher
{
var _widgetId, _inConnection, _outConnection, dispatchEvent;
function Bridge (id) {
super();
_widgetId = id;
_inConnection = new LocalConnection();
_outConnection = new LocalConnection();
var me = this;
_inConnection.receiveEvent = function () {
me.receiveEvent.apply(me, arguments);
};
_inConnection.allowDomain = (_inConnection.allowInsecureDomain = function (d) {
return(((d == "www.newgrounds.com") || (d == "newgrounds.com")) || (d == "uploads.ungrounded.net"));
});
_inConnection.connect("_rec_" + _widgetId);
com.newgrounds.Logger.addEventListener(com.newgrounds.APIEvent.LOG, {target:this, func:onLogMessage});
}
function get widgetId() {
return(_widgetId);
}
function onLogMessage(event) {
try {
_outConnection.send(_widgetId, "sendEvent", "trace", String(event.__get__data()));
} catch(error) {
}
}
function sendEvent(command, parameters) {
if (_outConnection) {
parameters = {data:parameters};
try {
_outConnection.send(_widgetId, "sendEvent", command, parameters);
} catch(error) {
}
}
}
function receiveEvent(responseData) {
var _local2;
try {
_local2 = com.newgrounds.encoders.json.JSON.decode(responseData);
} catch(error) {
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.BRIDGE_EVENT_RECEIVED, _local2, ((_local2 == null) ? (com.newgrounds.APIEvent.ERROR_UNKNOWN) : null)));
}
function onStatus(event) {
}
}
Symbol 140 MovieClip [__Packages.com.newgrounds.APIEvent] Frame 0
class com.newgrounds.APIEvent extends com.newgrounds.Event
{
var _error, _success, _data, __get__type;
function APIEvent (type, data, error) {
super(type);
if (data == undefined) {
data = null;
}
if (error == undefined) {
error = null;
}
if (((!error) || (error == "")) || (error == ERROR_NONE)) {
_error = ERROR_NONE;
_success = true;
} else {
_error = error;
_success = false;
}
if (data) {
_data = data;
} else {
_data = {};
}
}
function clone() {
return(new com.newgrounds.APIEvent(__get__type(), _data, _error));
}
function get success() {
return(_success);
}
function get data() {
return(_data);
}
function get error() {
return(_error);
}
static var COMMAND_COMPLETE = "commandComplete";
static var MEDAL_UNLOCK_CONFIRMED = "medalUnlockConfirmed";
static var ICON_LOADED = "iconLoaded";
static var BRIDGE_EVENT_RECEIVED = "brdigeEventReceived";
static var API_CONNECTED = "movieConnected";
static var LOG = "log";
static var MEDAL_UNLOCKED = "medalUnlocked";
static var SCORES_LOADED = "scoresLoaded";
static var SCORE_POSTED = "scorePosted";
static var QUERY_COMPLETE = "queryComplete";
static var FILE_LOADED = "fileLoaded";
static var FILE_SAVED = "fileSaved";
static var FILE_DELETED = "fileDeleted";
static var FILE_REQUESTED = "fileRequested";
static var VOTE_COMPLETE = "voteComplete";
static var USER_SIGNED_IN = "userSignedIn";
static var ERROR_NONE = "noError";
static var ERROR_UNKNOWN = "unknownError";
static var ERROR_COMMAND_FAILED = "commandFailed";
static var ERROR_NOT_CONNECTED = "notConnected";
static var ERROR_INVALID_ARGUMENT = "invalidArgument";
static var ERROR_TIMED_OUT = "timedOut";
static var ERROR_BAD_FILE = "badFile";
static var ERROR_BAD_RESPONSE = "badResponse";
static var ERROR_SENDING_COMMAND = "errorSendingCommand";
static var ERROR_HOST_BLOCKED = "hostBlocked";
static var ERROR_ALREADY_VOTED = "alreadyVoted";
static var ERROR_NOT_LOGGED_IN = "notLoggedIn";
static var ERROR_WRONG_ENCRYPTION_KEY = "wrongEncryptionKey";
static var ERROR_SIGN_IN_FAILED = "signInFailed";
}
Symbol 159 MovieClip [__Packages.com.newgrounds.API] Frame 0
class com.newgrounds.API
{
static var _serverTime, _adFeedURL, _movieVersion, _bridge, _requestedSaveGroupId, _requestedSaveFileId, _movieName, _newVersion, _saveFilePath, _imageFilePath;
function API () {
}
static function get connected() {
return(_connection.__get__connected());
}
static function get isNetworkHost() {
return(_connection.__get__isNetworkHost());
}
static function get apiId() {
_connection.assertInitialized();
return(_connection.apiId);
}
static function get debugMode() {
return(_debugMode);
}
static function set debugMode(val) {
_debugMode = val;
//return(debugMode);
}
static function get publisherId() {
_connection.assertInitialized();
return(_connection.publisherId);
}
static function get sessionId() {
_connection.assertInitialized();
return(_connection.sessionId);
}
static function get hostDomain() {
_connection.assertInitialized();
return(_connection.hostDomain);
}
static function get hostURL() {
_connection.assertInitialized();
return(_connection.__get__hostURL());
}
static function get isNewgrounds() {
return(_connection.publisherId == 1);
}
static function get hasUserSession() {
_connection.assertInitialized();
return(_connection.__get__hasUserSession());
}
static function get username() {
_connection.assertInitialized();
return(_connection.username);
}
static function get userId() {
_connection.assertInitialized();
return(_connection.userId);
}
static function assertConnected(eventType) {
if (eventType == undefined) {
eventType = null;
}
if (_connection.assertConnected()) {
return(true);
}
if (eventType) {
dispatchEvent(eventType, null, com.newgrounds.APIEvent.ERROR_NOT_CONNECTED);
}
return(false);
}
static function get serverTime() {
return(_serverTime);
}
static function get adsApproved() {
return(_adsApproved);
}
static function get adFeedURL() {
return(_adFeedURL);
}
static function get medals() {
return(_medalsArray);
}
static function get scoreBoards() {
return(_scoreBoardsArray);
}
static function get saveGroups() {
return(_saveGroupsArray);
}
static function connect(_root, apiId, encryptionKey, movieVersion) {
if (encryptionKey == undefined) {
encryptionKey = null;
}
if (movieVersion == undefined) {
movieVersion = "";
}
com.newgrounds.APIEventDispatcher.__set__globalDispatcher(_dispatcher);
System.security.loadPolicyFile("http://apifiles.ngfiles.com/crossdomain.xml");
if (_connection.initialized) {
com.newgrounds.Logger.logError("Connection already in progress. Please call API.disconnect() before attempting another connection.");
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_NOT_CONNECTED);
return(undefined);
}
apiId = trimWhitespace(apiId);
if (encryptionKey) {
encryptionKey = trimWhitespace(encryptionKey);
}
if ((!apiId) || (apiId == "")) {
com.newgrounds.Logger.logError("No apiId given. Please use the API ID from your API settings page.");
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return(undefined);
}
com.newgrounds.Logger.logMessage(("====== Newgrounds API v" + VERSION) + " ======");
_connection.connectionState = com.newgrounds.APIConnection.CONNECTING;
_root=_root;//parameter overwritten
_movieVersion = movieVersion;
_connection.apiId = apiId;
var _local4;
_local4 = apiId.indexOf(":");
if (_local4 != -1) {
_connection.trackerId = int(apiId.substring(0, _local4));
} else {
_connection.trackerId = int(apiId);
}
if (!_connection.trackerId) {
com.newgrounds.Logger.logError("Invalid API ID: " + apiId);
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return(undefined);
}
_connection.encryptionKey = encryptionKey;
_connection.initialized = true;
_connection.__set__hostURL(_root._url);
doConnect(_root);
}
static function doConnect(flashVars) {
if (isNetworkHost && (_debugMode != RELEASE_MODE)) {
com.newgrounds.Logger.logMessage("Live file detected, turning off debug mode.");
_debugMode = RELEASE_MODE;
}
if (flashVars && (flashVars.NewgroundsAPI_SandboxID)) {
_bridge = new com.newgrounds.Bridge(flashVars.NewgroundsAPI_SandboxID);
com.newgrounds.APICommand.bridge = _bridge;
} else {
_bridge = new com.newgrounds.Bridge(com.newgrounds.crypto.MD5.hash(String(Math.random())));
com.newgrounds.APICommand.bridge = _bridge;
}
if (_debugMode == RELEASE_MODE) {
if (flashVars) {
if (flashVars.NewgroundsAPI_UserName) {
_connection.username = flashVars.NewgroundsAPI_UserName;
}
if (flashVars.NewgroundsAPI_UserID) {
_connection.userId = flashVars.NewgroundsAPI_UserID;
}
if (flashVars.NewgroundsAPI_PublisherID) {
_connection.publisherId = flashVars.NewgroundsAPI_PublisherID;
}
if (flashVars.NewgroundsAPI_UserpageFormat) {
_connection.userpageFormat = flashVars.NewgroundsAPI_UserpageFormat;
}
if (flashVars.NewgroundsAPI_SessionID) {
_connection.sessionId = flashVars.NewgroundsAPI_SessionID;
}
if (flashVars.NewgroundsAPI_SaveGroupID) {
_requestedSaveGroupId = flashVars.NewgroundsAPI_SaveGroupID;
}
if (flashVars.NewgroundsAPI_SaveFileID) {
_requestedSaveFileId = flashVars.NewgroundsAPI_SaveFileID;
}
}
} else {
_connection.debug = true;
if ((_debugMode == DEBUG_MODE_LOGGED_IN) || (_debugMode == DEBUG_MODE_LOGGED_OUT)) {
_connection.publisherId = 1;
}
if (_debugMode == DEBUG_MODE_LOGGED_IN) {
_connection.sessionId = "D3bu64p1U53R";
_connection.userId = 10;
_connection.username = "API-Debugger";
}
}
_connection.sendSimpleCommand("connectMovie", onConnect, {host:_connection.hostDomain, movie_version:_movieVersion, publisher_id:_connection.publisherId});
}
static function onConnect(event) {
var _local1 = event.__get__data();
if (!event.__get__success()) {
com.newgrounds.Logger.logError("Unable to connect to the API.");
_connection.reset();
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, event.__get__data(), event.__get__error());
return(undefined);
}
if (debugMode != RELEASE_MODE) {
_adFeedURL = TEST_AD_FEED_URL;
} else if (_local1.ad_url) {
_adFeedURL = unescape(_local1.ad_url);
}
switch (_local1.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!");
}
_adsApproved = _local1.ad_status == 1;
if ((_debugMode == DEBUG_MODE_HOST_BLOCKED) || (_local1.deny_host)) {
com.newgrounds.Logger.logWarning(_connection.hostDomain + " does not have permission to host this movie!", "Update your API configuration to allow this host.");
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, {officialURL:unescape(_local1.movie_url)}, com.newgrounds.APIEvent.ERROR_HOST_BLOCKED);
_connection.reset();
return(undefined);
}
_movieName = (_local1.movieName ? (_local1.movieName) : "");
com.newgrounds.Logger.logMessage("Connecting to the Newgrounds API Gateway...", ("----- " + _local1.movie_name) + " -----");
if (_debugMode == DEBUG_MODE_NEW_VERSION) {
_local1.movie_version = "Debug Mode";
}
if (_local1.movie_version) {
com.newgrounds.Logger.logMessage("A new version of this movie is available.", "Current version:\t" + _movieVersion, "Newest version:\t" + _local1.movie_version, "Use API.loadOfficialVersion() to link to the latest version.");
_newVersion = true;
} else {
_newVersion = false;
}
_serverTime = new Date(int(_local1.time) * 1000);
if (_local1.request_portal_url) {
_connection.sendSimpleCommand("setPortalID", null, {portal_url:_connection.__get__hostURL()});
}
_connection.sendSimpleCommand("preloadSettings", onMetadataLoaded, {publisher_id:_connection.publisherId, user_id:_connection.userId});
}
static function onMetadataLoaded(event) {
var _local11 = event.__get__data();
var _local4;
var _local1;
if (!event.__get__success()) {
com.newgrounds.Logger.logWarning("Unable to load movie metadata.");
disconnect();
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, null, event.__get__error());
return(undefined);
}
var _local10 = 0;
if (_local11.medals) {
_local10 = _local11.medals.length;
var _local18;
if (hasUserSession) {
_local18 = loadLocal("medals_unlocked_" + username);
} else {
_local18 = loadLocal("medals_unlocked");
}
_local4 = 0;
while (_local4 < _local10) {
var _local5 = _local11.medals[_local4];
var _local15 = _local5.medal_unlocked;
var _local17 = _local18 && (_local18[_local5.medal_id]);
var _local14 = (hasUserSession ? (_local15) : (_local17));
if (debugMode != RELEASE_MODE) {
_local14 = false;
}
var _local6 = new com.newgrounds.Medal(_connection, _local5.medal_id, _local5.medal_name, _local5.medal_description, Boolean(int(_local5.secret)), _local14, _local5.medal_value, _local5.medal_difficulty, _local5.medal_icon);
_local6.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, onMedalUnlocked, false, 0, true);
_local6.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, onMedalUnlockConfirmed, false, 0, true);
_medals[_local6.__get__name()] = _local6;
_medalsArray.push(_local6);
com.newgrounds.Logger.logMessage(_local6);
if ((hasUserSession && (_local17)) && (!_local15)) {
com.newgrounds.Logger.logMessage(("Server missed the \"" + _local6.__get__name()) + "\" unlock. Resending...");
_local6.unlock();
}
_local4++;
}
}
com.newgrounds.Logger.logMessage(((_local10 + " medal") + ((_local10 != 1) ? "s" : "")) + " initialized.");
_local10 = 0;
if (_local11.score_boards) {
_local10 = _local11.score_boards.length;
_local4 = 0;
while (_local4 < _local10) {
var _local16 = _local11.score_boards[_local4];
var _local9 = new com.newgrounds.ScoreBoard(_connection, _local16.name, _local16.id);
_scoreBoards[_local9.__get__name()] = _local9;
_scoreBoardsArray.push(_local9);
com.newgrounds.Logger.logMessage(_local9);
_local4++;
}
}
com.newgrounds.Logger.logMessage(((_local10 + " scoreboard") + ((_local10 != 1) ? "s" : "")) + " initialized.");
_local10 = 0;
if (_local11.save_groups) {
_local10 = _local11.save_groups.length;
_local4 = 0;
while (_local4 < _local10) {
var _local2 = _local11.save_groups[_local4];
var _local13 = [];
if (_local2.keys) {
_local1 = 0;
while (_local1 < _local2.keys.length) {
var _local7 = _local2.keys[_local1];
_local13.push(new com.newgrounds.SaveKey(_local7.name, _local7.id, _local7.type));
_local1++;
}
}
var _local12 = [];
if (_local2.ratings) {
_local1 = 0;
while (_local1 < _local2.ratings.length) {
var _local3 = _local2.ratings[_local1];
_local12.push(new com.newgrounds.SaveRating(_local3.name, _local3.id, _local3.float, _local3.min, _local3.max));
_local1++;
}
}
var _local8 = new com.newgrounds.SaveGroup(_connection, _local2.group_name, _local2.group_id, _local2.group_type, _local13, _local12);
_saveGroups[_local8.__get__name()] = _local8;
_saveGroupsArray.push(_local8);
com.newgrounds.Logger.logMessage(_local8);
_local4++;
}
}
com.newgrounds.Logger.logMessage(((_local10 + " save group") + ((_local10 != 1) ? "s" : "")) + " initialized.");
if (_local11.save_file_path) {
_saveFilePath = _local11.save_file_path + "/";
com.newgrounds.SaveFile._saveFilePath = _saveFilePath;
com.newgrounds.Logger.logInternal("Save file path: " + _saveFilePath);
}
if (_local11.image_file_path) {
_imageFilePath = _local11.image_file_path + "/";
com.newgrounds.SaveFile._imageFilePath = _imageFilePath;
com.newgrounds.Logger.logInternal("Image file path: " + _imageFilePath);
}
com.newgrounds.Logger.logMessage("Connection complete!");
_connection.connectionState = com.newgrounds.APIConnection.CONNECTED;
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, {movieName:_movieName, newVersion:_newVersion});
if (_requestedSaveFileId && (_requestedSaveGroupId)) {
addEventListener(com.newgrounds.APIEvent.FILE_LOADED, onRequestedFileLoaded);
loadSaveFile(_requestedSaveFileId, false);
}
}
static function disconnect() {
if (!_connection.__get__connected()) {
com.newgrounds.Logger.logWarning("The Newgrounds API is already disconnected.");
return(undefined);
}
_connection.reset();
for (var _local2 in _medals) {
var _local1 = _medals[_local2];
_local1.removeEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, onMedalUnlocked);
_local1.removeEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, onMedalUnlockConfirmed);
}
_newVersion = false;
_medals = new Object();
_medalsArray = [];
_scoreBoards = new Object();
_scoreBoardsArray = [];
_saveGroups = new Object();
_saveGroupsArray = [];
_sharedObjects = new Object();
_imageFilePath = null;
_saveFilePath = null;
com.newgrounds.Logger.logMessage("Disconnected from the Newgrounds API.");
}
static function loadNewgrounds() {
_connection.loadInBrowser("loadNewgrounds");
}
static function loadOfficialVersion() {
if (_connection.assertInitialized()) {
_connection.loadInBrowser("loadOfficialVersion", false);
}
}
static function promptSignIn() {
if (_connection.assertInitialized()) {
getURL (PASSPORT_URL + _bridge.__get__widgetId(), "_blank");
_bridge.addEventListener(com.newgrounds.APIEvent.BRIDGE_EVENT_RECEIVED, onUserSignedIn, false, 0, true);
}
}
static function onUserSignedIn(e) {
_bridge.removeEventListener(com.newgrounds.APIEvent.BRIDGE_EVENT_RECEIVED, onUserSignedIn);
var _local1 = e.__get__data();
if (e.__get__success()) {
try {
if (_local1.NewgroundsAPI_UserName) {
_connection.username = _local1.NewgroundsAPI_UserName;
}
if (_local1.NewgroundsAPI_UserID) {
_connection.userId = _local1.NewgroundsAPI_UserID;
}
if (_local1.NewgroundsAPI_PublisherID) {
_connection.publisherId = _local1.NewgroundsAPI_PublisherID;
}
if (_local1.NewgroundsAPI_SessionID) {
_connection.sessionId = _local1.NewgroundsAPI_SessionID;
}
_connection.sendSimpleCommand("preloadSettings", onMetadataLoaded, {publisher_id:_connection.publisherId, user_id:_connection.userId});
} catch(error) {
}
com.newgrounds.Logger.logMessage(("User " + _connection.username) + " signed in.");
}
dispatchEvent(com.newgrounds.APIEvent.USER_SIGNED_IN, null, (e.__get__success() ? null : (com.newgrounds.APIEvent.ERROR_SIGN_IN_FAILED)));
}
static function loadMySite() {
if (_connection.assertInitialized()) {
_connection.loadInBrowser("loadMySite");
}
}
static function loadCustomLink(linkName) {
if (_connection.assertInitialized()) {
_connection.loadInBrowser("loadCustomLink", true, {link:linkName});
}
}
static function getMedal(medalName) {
return(_medals[medalName]);
}
static function unlockMedal(medalName) {
if (!assertConnected()) {
return(undefined);
}
var _local1 = _medals[medalName];
if (!_local1) {
com.newgrounds.Logger.logError(("No medal named \"" + medalName) + "\" w.");
return(undefined);
}
_local1.unlock();
}
static function onMedalUnlocked(event) {
if (event.__get__success()) {
var _local2 = com.newgrounds.Medal(event.__get__data());
var _local1;
if (hasUserSession) {
_local1 = loadLocal("medals_unlocked_" + username);
if (!_local1) {
_local1 = new Object();
}
_local1[_local2.__get__id()] = true;
saveLocal("medals_unlocked_" + username, _local1);
} else {
_local1 = loadLocal("medals_unlocked");
if (!_local1) {
_local1 = new Object();
}
_local1[com.newgrounds.Medal(event.__get__data()).__get__id()] = true;
saveLocal("medals_unlocked", _local1);
com.newgrounds.Logger.logMessage(("User instanceof not logged in. Medal \"" + _local2.__get__name()) + "\" unlocked locally.");
}
}
}
static function onMedalUnlockConfirmed(event) {
if (hasUserSession) {
var _local1 = loadLocal("medals_unlocked_" + username);
if (!_local1) {
_local1 = new Object();
} else {
delete _local1[com.newgrounds.Medal(event.__get__data()).__get__id()];
}
saveLocal("medals_unlocked_" + username, _local1);
}
}
static function clearLocalMedals() {
for (var _local2 in _medals) {
var _local1 = _medals[_local2];
_local1.setUnlocked(false);
}
if (!hasUserSession) {
saveLocal("medals_unlocked", new Object());
}
}
static function getScoreBoard(scoreBoardName) {
if (!assertConnected()) {
return(null);
}
return(_scoreBoards[scoreBoardName]);
}
static function loadScores(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 (!assertConnected()) {
return(null);
}
var _local1 = _scoreBoards[scoreBoardName];
if (!_local1) {
com.newgrounds.Logger.logError(("No scoreboard named \"" + scoreBoardName) + "\" w.");
dispatchEvent(com.newgrounds.APIEvent.SCORES_LOADED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return(null);
}
_local1.__set__period(period);
_local1.__set__firstResult(firstResult);
_local1.__set__numResults(numResults);
_local1.__set__tag(tag);
_local1.loadScores();
return(_local1);
}
static function postScore(scoreBoardName, numericScore, tag) {
if (tag == undefined) {
tag = null;
}
if (!assertConnected()) {
return(undefined);
}
if (!hasUserSession) {
com.newgrounds.Logger.logError("The user must be logged-in to post a score.");
dispatchEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN);
return(undefined);
}
var _local1 = _scoreBoards[scoreBoardName];
if (!_local1) {
com.newgrounds.Logger.logError(("No scoreboard named \"" + scoreBoardName) + "\" w.");
dispatchEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return(undefined);
}
_local1.postScore(numericScore, tag);
}
static function getSaveGroup(groupName) {
if (!assertConnected()) {
return(null);
}
return(_saveGroups[groupName]);
}
static function getSaveGroupById(id) {
for (var _local3 in _saveGroups) {
var _local1 = _saveGroups[_local3];
if (_local1.__get__id() == id) {
return(_local1);
}
}
return(null);
}
static function createSaveFile(groupName) {
if (!assertConnected()) {
return(null);
}
var _local1 = getSaveGroup(groupName);
if (!_local1) {
com.newgrounds.Logger.logError(("The save group \"" + groupName) + "\" w found.");
return(null);
}
return(new com.newgrounds.SaveFile(_local1));
}
static function loadSaveFile(saveId, loadContents) {
if (loadContents == undefined) {
loadContents = true;
}
_connection.sendSimpleCommand("loadSaveFile", onFileLoaded, {save_id:saveId, get_contents:loadContents});
}
static function onFileLoaded(event) {
var _local2;
if (event.__get__success()) {
_local2 = com.newgrounds.SaveFile.fromObject(getSaveGroupById(event.__get__data().group_id), event.__get__data().file);
if (event.__get__data().get_contents) {
_local2.load();
} else {
dispatchEvent(com.newgrounds.APIEvent.FILE_LOADED, _local2);
}
} else {
com.newgrounds.Logger.logError("Unable to load file:", event.__get__error());
dispatchEvent(com.newgrounds.APIEvent.FILE_LOADED, null, event.__get__error());
}
}
static function createSaveQuery(groupName) {
if (!assertConnected()) {
return(null);
}
var _local1 = getSaveGroup(groupName);
if (!_local1) {
com.newgrounds.Logger.logError(("The save group \"" + groupName) + "\" w found.");
return(null);
}
var _local2 = new com.newgrounds.SaveQuery(_local1);
return(_local2);
}
static function createSaveQueryByDate(groupName, sortDescending) {
if (sortDescending == undefined) {
sortDescending = true;
}
var _local1 = createSaveQuery(groupName);
if (!_local1) {
return(null);
}
_local1.sortOn(com.newgrounds.SaveQuery.CREATED_ON, sortDescending);
return(_local1);
}
static function createSaveQueryByName(groupName, filename, exactMatch, sortDescending) {
if (exactMatch == undefined) {
exactMatch = false;
}
if (sortDescending == undefined) {
sortDescending = false;
}
var _local1 = createSaveQuery(groupName);
_local1.addCondition(com.newgrounds.SaveQuery.FILE_NAME, (exactMatch ? (com.newgrounds.SaveQuery.OPERATOR_EQUAL) : (com.newgrounds.SaveQuery.OPERATOR_CONTAINS)), filename);
return(_local1);
}
static function createSaveQueryByRating(groupName, ratingName, sortDescending) {
if (sortDescending == undefined) {
sortDescending = true;
}
var _local1 = createSaveQuery(groupName);
_local1.sortOn(ratingName, sortDescending);
return(_local1);
}
static function onRequestedFileLoaded(event) {
removeEventListener(com.newgrounds.APIEvent.FILE_LOADED, onRequestedFileLoaded);
if (event.__get__success()) {
var _local1 = event.__get__data();
if (_local1) {
dispatchEvent(com.newgrounds.APIEvent.FILE_REQUESTED, _local1);
}
}
}
static function addEventListener(eventType, listener, priority, useWeakReference) {
if (priority == undefined) {
priority = 0;
}
if (useWeakReference == undefined) {
useWeakReference = true;
}
_dispatcher.addEventListener(eventType, listener, false, priority, useWeakReference);
}
static function removeEventListener(eventType, listener) {
_dispatcher.removeEventListener(eventType, listener);
}
static function dispatchEvent(event, data, error) {
if (data == undefined) {
data = null;
}
if (error == undefined) {
error = null;
}
_dispatcher.dispatchEvent(new com.newgrounds.APIEvent(event, data, error));
}
static function saveLocal(saveId, saveData) {
try {
var _local3;
var _local2 = (("ng_ap_secure_" + _connection.trackerId) + "_") + com.newgrounds.crypto.RC4.encrypt(saveId, _connection.encryptionKey);
if (!_sharedObjects[saveId]) {
_sharedObjects[saveId] = SharedObject.getLocal(_local2);
}
_local3 = _sharedObjects[saveId];
_local3.data.data = encodeData(saveData);
} catch(_local) {
if (Error( /* Error999 */
) != null) {
var error = Error( /* Error999 */
);
com.newgrounds.Logger.logError("Unable to save local data.", error);
return(false);
}
Error( /* Error999 */
);
throw /* Error999 */
;
}
return(true);
}
static function loadLocal(saveId) {
try {
var _local1;
var _local3 = (("ng_ap_secure_" + _connection.trackerId) + "_") + com.newgrounds.crypto.RC4.encrypt(saveId, _connection.encryptionKey);
if (!_sharedObjects[saveId]) {
_sharedObjects[saveId] = SharedObject.getLocal(_local3);
}
_local1 = _sharedObjects[saveId];
if ((_local1 && (_local1.data)) && (_local1.data.data)) {
return(decodeData(_local1.data.data));
}
return(null);
} catch(error:Error) {
com.newgrounds.Logger.logError("Unable to load local data.", error);
}
return(null);
}
static function logCustomEvent(eventName) {
if (assertConnected()) {
com.newgrounds.Logger.logMessage("Logged event: " + eventName);
_connection.sendSimpleCommand("logCustomEvent", null, {event:eventName});
}
}
static function encodeData(data) {
if (!_connection.assertInitialized()) {
return(null);
}
return(com.newgrounds.crypto.RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(data), _connection.encryptionKey));
}
static function decodeData(data) {
if (!_connection.assertInitialized()) {
return(null);
}
try {
return(com.newgrounds.encoders.json.JSON.decode(com.newgrounds.crypto.RC4.decrypt(data, _connection.encryptionKey)));
} catch(error:Error) {
}
return(null);
}
static function stopPendingCommands() {
com.newgrounds.APICommand.stopPendingCommands();
com.newgrounds.Logger.logMessage("Pending commands stopped.");
}
static function trimWhitespace(string) {
if (!string) {
return(null);
}
var _local3 = 0;
while (string.charAt(_local3) == " ") {
_local3++;
}
var _local1 = string.length - 1;
while ((string.charAt(_local1) == " ") && (_local1 >= 0)) {
_local1--;
}
return(string.slice(_local3, _local1 + 1));
}
static var VERSION = "3.2 AS2";
static var RELEASE_MODE = "releaseMode";
static var DEBUG_MODE_LOGGED_IN = "debugModeLoggedIn";
static var DEBUG_MODE_LOGGED_OUT = "debugModeLoggedOut";
static var DEBUG_MODE_NEW_VERSION = "debugModeNewVersion";
static var DEBUG_MODE_HOST_BLOCKED = "debugModeHostBlocked";
static var TEST_AD_FEED_URL = "http://www.ngads.com/adtest.php";
static var PASSPORT_URL = "https://www.newgrounds.com/login/remote/";
static var _dispatcher = new com.newgrounds.APIEventDispatcher();
static var _connection = new com.newgrounds.APIConnection();
static var _debugMode = DEBUG_MODE_LOGGED_IN;
static var _adsApproved = false;
static var _medals = new Object();
static var _medalsArray = [];
static var _scoreBoards = new Object();
static var _scoreBoardsArray = [];
static var _saveGroups = new Object();
static var _saveGroupsArray = [];
static var _sharedObjects = new Object();
}
Symbol 156 MovieClip [__Packages.com.newgrounds.encoders.ImageScanner] Frame 0
class com.newgrounds.encoders.ImageScanner
{
var _baseN, _encodeAlpha, _maxPerChannel;
function ImageScanner (hashLength, charsPerPixel) {
if (hashLength) {
_hash = DEFAULT_HASH.substr(0, hashLength);
}
_baseN = new com.newgrounds.encoders.BaseN(_hash);
if (charsPerPixel) {
_charsPerPixel = charsPerPixel;
}
encodeAlpha = (false);
}
function get encodeAlpha() {
return(_encodeAlpha);
}
function set encodeAlpha(v) {
_encodeAlpha = v;
_maxPerChannel = int(Math.pow(_hash.length, _charsPerPixel / (_encodeAlpha ? 4 : 3)));
if (_maxPerChannel > 256) {
_maxPerChannel = 256;
}
//return(encodeAlpha);
}
function encode(source, callbackFunction, callbackObject) {
var _local4 = {callbackFunction:callbackFunction, callbackObject:callbackObject, source:source, x:0, y:0, output:null};
var _local2 = source.width.toString();
var _local3 = source.height.toString();
while (_local2.length < 3) {
_local2 = "0" + _local2;
}
while (_local3.length < 3) {
_local3 = "0" + _local3;
}
_local4.output = _local2 + _local3;
var _local6 = setInterval(this, "doEncode", WORK_INTERVAL, _local4);
_local4.interval = _local6;
}
function decode(source, callbackFunction, callbackObject) {
var _local4 = {callbackFunction:callbackFunction, callbackObject:callbackObject, source:source, i:6, x:0, y:0, output:null};
var _local3 = source.substr(0, 3);
var _local2 = source.substr(3, 3);
while (_local3.charAt(0) == "0") {
_local3 = _local3.substr(1);
}
while (_local2.charAt(0) == "0") {
_local2 = _local2.substr(1);
}
var _local7 = int(_local3);
var _local8 = int(_local2);
_local4.output = new flash.display.BitmapData(_local7, _local8, _encodeAlpha);
var _local6 = setInterval(this, "doDecode", WORK_INTERVAL, _local4);
_local4.interval = _local6;
}
function doEncode(state) {
var _local3 = getTimer();
while ((state.y < state.source.height) && ((getTimer() - _local3) < WORK_INTERVAL)) {
state.output = state.output + 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);
}
}
function doDecode(state) {
var _local4 = getTimer();
while ((state.y < state.output.height) && ((getTimer() - _local4) < WORK_INTERVAL)) {
var _local3 = decodePixel(state.source.substr(state.i, _charsPerPixel));
state.output.setPixel32(state.x, state.y, _local3);
state.i = state.i + _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);
}
}
function encodePixel(pixel) {
var _local3 = (pixel >> 24) & 255;
var _local4 = (pixel >> 16) & 255;
var _local5 = (pixel >> 8) & 255;
var _local2 = pixel & 255;
_local3 = int((_local3 / 256) * _maxPerChannel);
_local4 = int((_local4 / 256) * _maxPerChannel);
_local5 = int((_local5 / 256) * _maxPerChannel);
_local2 = int((_local2 / 256) * _maxPerChannel);
var _local7 = (((_local4 * _maxPerChannel) * _maxPerChannel) + (_local5 * _maxPerChannel)) + _local2;
if (_encodeAlpha) {
_local7 = _local7 + (((_local3 * _maxPerChannel) * _maxPerChannel) * _maxPerChannel);
}
return(_baseN.encodeUint(_local7, _charsPerPixel));
}
function decodePixel(encodedPixel) {
var _local3 = 255;
var _local5;
var _local6;
var _local4;
var _local7 = 0;
var _local2 = _baseN.decodeUint(encodedPixel);
_local4 = _local2 % _maxPerChannel;
_local2 = _local2 / int(_maxPerChannel);
_local6 = _local2 % _maxPerChannel;
_local2 = _local2 / int(_maxPerChannel);
_local5 = _local2 % _maxPerChannel;
_local2 = _local2 / int(_maxPerChannel);
if (_encodeAlpha) {
_local3 = _local2 % _maxPerChannel;
_local2 = _local2 / int(_maxPerChannel);
}
return((((_local3 << 24) | (_local5 << 16)) | (_local6 << 8)) | _local4);
}
static var DEFAULT_HASH = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&";
var _hash = DEFAULT_HASH;
var _charsPerPixel = 2;
static var WORK_INTERVAL = 33.3333333333333;
}
Symbol 157 MovieClip [__Packages.com.newgrounds.SaveFile] Frame 0
class com.newgrounds.SaveFile extends com.newgrounds.APIEventDispatcher
{
static var _currentFile;
var _iconLoader, _group, _keys, _ratings, _numVotes, _name, _description, _id, _data, _dataLoader, _fileSize, _readOnly, _draft, _authorId, _authorName, _views, _createdDate, _modifiedDate, dispatchEvent, _encodedIcon, _encodedData, _encoderQueue, _encoding, _dataLoaded, _encodingParent, _encodingProperty, _dataURL;
function SaveFile (group) {
super();
_iconLoader = new com.newgrounds.BitmapLoader(DEFAULT_ICON, null);
_group = group;
_keys = {};
_ratings = {};
_numVotes = {};
}
static function get currentFile() {
return(_currentFile);
}
static function fromObject(group, fileData) {
var _local3 = new com.newgrounds.SaveFile(group);
_local3._name = fileData.filename;
_local3._description = fileData.description;
_local3._id = fileData.save_id;
_local3._authorId = fileData.user_id;
_local3._authorName = fileData.user_name;
_local3._createdDate = fileData.created;
_local3._modifiedDate = fileData.last_update;
_local3._views = fileData.views;
if (fileData.thumb && (fileData.thumb != "")) {
_local3._iconLoader.__set__url(_imageFilePath + fileData.thumb);
}
_local3._dataURL = _saveFilePath + fileData.file;
_local3._fileSize = fileData.file_size;
_local3._approved = fileData.status != STATUS_UNAPPROVED;
_local3._readOnly = false;
_local3._public = (fileData.status != STATUS_PRIVATE) && (fileData.status != STATUS_UNAPPROVED);
for (var _local8 in fileData.keys) {
var _local6 = fileData.keys[_local8];
var _local4 = group.getKeyById(_local6.id);
if (_local4) {
_local3._keys[_local4.__get__name()] = _local4.validateValue(_local6.value);
}
}
for (var _local9 in fileData.ratings) {
var _local5 = fileData.ratings[_local9];
var _local2 = group.getRatingById(_local5.id);
if (_local2) {
_local3._ratings[_local2.__get__name()] = _local2.validateValue(_local5.score);
_local3._numVotes[_local2.__get__name()] = int(_local5.votes);
}
}
return(_local3);
}
function get group() {
return(_group);
}
function get name() {
return(_name);
}
function set name(val) {
_name = val;
//return(name);
}
function get description() {
return(_description);
}
function set description(val) {
_description = val;
//return(description);
}
function get id() {
return(_id);
}
function get data() {
return(_data);
}
function set data(val) {
_data = val;
//return(data);
}
function get bytesLoaded() {
if (_data) {
return(bytesTotal);
}
if (!_dataLoader) {
return(0);
}
return(_dataLoader.getBytesLoaded());
}
function get bytesTotal() {
return(_fileSize);
}
function get readOnly() {
return(_readOnly);
}
function get draft() {
return(_draft);
}
function set draft(v) {
_draft = v;
//return(draft);
}
function get authorId() {
return(_authorId);
}
function get authorName() {
return(_authorName);
}
function get keys() {
return(_keys);
}
function get ratings() {
return(_ratings);
}
function get numVotes() {
return(_numVotes);
}
function get views() {
return(_views);
}
function get createdDate() {
return(_createdDate);
}
function get updatedDate() {
return(_modifiedDate);
}
function toString() {
return("Save File: " + _name);
}
function get icon() {
return(_iconLoader.__get__bitmapData());
}
function set icon(v) {
createIcon(v);
//return(icon);
}
function get iconLoaded() {
return(_iconLoader.__get__loaded());
}
function createIcon(source) {
var _local9 = new flash.display.BitmapData(ICON_WIDTH, ICON_HEIGHT, false, 0);
var _local7;
var _local6;
var _local10 = 0;
var _local8 = 0;
if (source instanceof flash.display.BitmapData) {
_local7 = source.width;
_local6 = source.height;
} else if (source instanceof MovieClip) {
var _local2 = MovieClip(source).getBounds(source);
_local7 = _local2.xMax - _local2.xMin;
_local6 = _local2.yMax - _local2.yMin;
_local10 = _local2.xMin;
_local8 = _local2.yMin;
}
var _local4 = new flash.geom.Matrix();
var _local5;
_local5 = Math.min(ICON_WIDTH / _local7, ICON_HEIGHT / _local6);
_local4.translate(-_local10, -_local8);
_local4.scale(_local5, _local5);
_local4.translate((ICON_WIDTH - (_local7 * _local5)) / 2, (ICON_HEIGHT - (_local6 * _local5)) / 2);
_local9.draw(source, _local4);
_iconLoader.__set__bitmapData(_local9);
}
function attachIcon(parent) {
if (_iconLoader) {
return(_iconLoader.attachBitmap(parent));
}
com.newgrounds.Logger.logError("No icon available for this sumbission.");
return(null);
}
function deleteFile() {
if (!_group.__get__connection().__get__hasUserSession()) {
com.newgrounds.Logger.logError("The user must be logged-in to delete a file.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN));
return(undefined);
}
if (!_id) {
com.newgrounds.Logger.logError("The file does not exist.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN));
return(undefined);
}
var _local2 = new com.newgrounds.APICommand("deleteSaveFile");
_local2.__get__secureParameters().save_id = _id;
_local2.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, {target:this, func:onFileDeleted});
_group.__get__connection().sendCommand(_local2);
}
function save() {
if (!_group.__get__connection().__get__hasUserSession()) {
com.newgrounds.Logger.logError("The user must be logged-in to save a file.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN));
return(undefined);
}
com.newgrounds.BitmapLoader._cacheSeed++;
_currentFile = this;
if (iconLoaded) {
ICON_IMAGE_SCANNER.encode(icon, onIconEncoded, this);
} else {
encodeData(true);
}
}
function onIconEncoded(encodedIcon) {
_encodedIcon = encodedIcon;
encodeData(true);
}
function doSave() {
var _local4 = new com.newgrounds.APICommand("saveFile");
_local4.__get__secureParameters().group = _group.id;
_local4.__get__secureParameters().user_name = _group.__get__connection().username;
_local4.__get__secureParameters().filename = _name;
_local4.__get__secureParameters().description = _description;
if (_draft) {
_local4.__get__secureParameters().draft = true;
}
if (_id && (!_readOnly)) {
_local4.__get__secureParameters().overwrite = 1;
_local4.__get__secureParameters().save_id = _id;
}
var _local8 = [];
for (var _local9 in _keys) {
var _local2 = _group.getKey(_local9);
if (_local2) {
_local8.push({id:_local2.__get__id(), value:_local2.validateValue(_keys[_local9])});
} else {
com.newgrounds.Logger.logError(((("No key named \"" + _local9) + "\" in save group \"") + _group.__get__name()) + "\".");
}
}
_local4.__get__secureParameters().keys = _local8;
var _local7 = [];
for (var _local10 in _ratings) {
var _local3 = _group.getRating(_local10);
if (_local3) {
_local7.push({id:_local3.__get__id(), value:_local3.validateValue(_ratings[_local10])});
} else {
com.newgrounds.Logger.logError(((("No rating named \"" + _local10) + "\" in save group \"") + _group.__get__name()) + "\".");
}
}
_local4.__get__secureParameters().ratings = _local7;
if (typeof(_encodedData) == "string") {
_local4.addFile("file", _encodedData, "file");
} else {
_local4.addFile("file", com.newgrounds.encoders.json.JSON.encode(_encodedData), "file");
}
if (iconLoaded) {
_local4.addFile("thumbnail", _encodedIcon, "thumbnail");
}
_local4.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, {target:this, func:onSaveComplete});
_group.__get__connection().sendCommand(_local4);
}
function encodeData(encode) {
_encoderQueue = [];
_encoding = encode;
if (encode) {
_encodedData = _data;
preEncodeObject(this, "_encodedData");
} else {
preEncodeObject(this, "_data");
}
encodeObject();
}
function preEncodeObject(parent, property) {
var _local3 = parent[property];
var _local5;
try {
if (_encoding) {
_local5 = _local3 instanceof flash.display.BitmapData;
} else {
_local5 = _local3.type == "__bitmap";
}
} catch(error) {
}
var _local2 = _local3;
var _local8;
if (_local5) {
_encoderQueue.push({parent:parent, property:property});
} else if ((typeof(_local3) == "object") && (!_local8)) {
if (_encoding) {
if (_local3 instanceof Array) {
_local2 = [];
} else {
_local2 = {};
}
for (var _local4 in _local3) {
_local2[_local4] = _local3[_local4];
}
parent[property] = _local2;
}
for (var _local4 in _local2) {
preEncodeObject(_local2, _local4);
}
}
}
function encodeObject() {
if (!_encoderQueue.length) {
if (_encoding) {
doSave();
} else {
_dataLoaded = true;
checkLoadComplete();
}
return(undefined);
}
var _local6 = _encoderQueue.pop();
var _local4 = _local6.parent;
var _local3 = _local6.property;
var _local2 = _local4[_local3];
var _local5;
if (_encoding) {
_local5 = {type:"__bitmap", width:_local2.width, height:_local2.height, transparent:_local2.transparent};
_local4[_local3] = _local5;
_encodingParent = _local5;
_encodingProperty = "data";
DATA_IMAGE_SCANNER.__set__encodeAlpha(_local2.transparent);
DATA_IMAGE_SCANNER.encode(flash.display.BitmapData(_local2), encodeBitmapComplete, this);
} else {
_encodingParent = _local4;
_encodingProperty = _local3;
DATA_IMAGE_SCANNER.__set__encodeAlpha(_local2.transparent);
DATA_IMAGE_SCANNER.decode(String(_local2.data), encodeBitmapComplete, this);
}
}
function encodeBitmapComplete(data) {
_encodingParent[_encodingProperty] = data;
encodeObject();
}
function load() {
_currentFile = this;
_dataLoaded = false;
_data = null;
if (!iconLoaded) {
_iconLoader.addEventListener(com.newgrounds.APIEvent.ICON_LOADED, {target:this, func:onIconLoaded});
_iconLoader.load();
}
_dataLoader = new LoadVars();
var file = this;
_dataLoader.onData = function (data) {
file.onDataLoaded(data);
};
_dataLoader.load((_dataURL + "&random=") + Math.random());
}
function onIconLoaded(event) {
if ((!event.__get__success()) && (_iconLoader.__get__url())) {
com.newgrounds.Logger.logWarning("Unable to load the icon for this save file.");
}
_iconLoader.removeEventListener(com.newgrounds.APIEvent.ICON_LOADED, onIconLoaded);
checkLoadComplete();
}
function checkLoadComplete() {
if (_dataLoaded && (iconLoaded)) {
com.newgrounds.Logger.logMessage("Data loaded.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this));
}
}
function onDataLoaded(data) {
try {
if (data) {
if (data.charAt(0) == "{") {
_data = com.newgrounds.encoders.json.JSON.decode(String(data));
} else {
_data = String(data);
}
encodeData(false);
}
} catch(error:Error) {
com.newgrounds.Logger.logError("Error while loading data:", error);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this, com.newgrounds.APIEvent.ERROR_BAD_FILE));
}
}
function onDataError(error) {
com.newgrounds.Logger.logError("Unable to load data:", error);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this, com.newgrounds.APIEvent.ERROR_BAD_FILE));
}
function onSaveComplete(event) {
if (event.__get__success()) {
com.newgrounds.Logger.logMessage(("File \"" + _name) + "\" saved!");
if (event.__get__data()) {
_id = event.__get__data().save_id;
_dataURL = unescape(event.__get__data().file_url);
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, this));
} else {
com.newgrounds.Logger.logError(("Error saving file \"" + _name) + "\":", event.__get__error());
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, this, event.__get__error()));
}
}
function sendVote(ratingName, vote) {
var _local2 = _group.getRating(ratingName);
if (!_local2) {
com.newgrounds.Logger.logError(("No save rating named \"" + ratingName) + "\" exists for this save group.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, {}, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT));
return(undefined);
}
vote = _local2.validateValue(vote);
if (isNaN(vote)) {
com.newgrounds.Logger.logError(((((((("Invalid vote (" + vote) + "). ") + ratingName) + " allows a range of ") + _local2.__get__minimum()) + "-") + _local2.__get__maximum()) + ".");
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 ") + _name) + "...");
_group.__get__connection().sendSimpleCommand("rateSaveFile", {target:this, func:onVoteComplete}, null, {group:_group.__get__id(), save_id:_id, rating_id:_local2.__get__id(), vote:vote});
}
function onVoteComplete(event) {
var _local2 = event.__get__error();
if (event.__get__data().already_voted) {
com.newgrounds.Logger.logError("Vote failed. You've already voted on this rating today.");
_local2 = com.newgrounds.APIEvent.ERROR_ALREADY_VOTED;
}
if (_local2 == com.newgrounds.APIEvent.ERROR_NONE) {
var _local3 = _group.getRatingById(event.__get__data().rating_id);
if (_local3) {
_ratings[_local3.__get__name()] = _local3.validateValue(event.__get__data().score);
}
com.newgrounds.Logger.logMessage("Vote complete!");
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, this, _local2));
}
function onFileDeleted(event) {
if (event.__get__success()) {
_id = 0;
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, this, event.__get__error()));
}
function clone() {
var _local3 = new com.newgrounds.SaveFile(_group);
_local3._data = _data;
_local3._description = _description;
_local3._draft = _draft;
_local3._fileSize = _fileSize;
_local3._iconLoader.__set__bitmapData(_iconLoader.bitmapData);
var _local2;
for (_local2 in _keys) {
_local3._keys[_local2] = _keys[_local2];
}
for (_local2 in _ratings) {
_local3._ratings[_local2] = _ratings[_local2];
}
for (_local2 in _numVotes) {
_local3._numVotes[_local2] = _numVotes[_local2];
}
_local3._name = _name;
return(_local3);
}
static var ICON_WIDTH = 90;
static var ICON_HEIGHT = 90;
static var DEFAULT_ICON = new flash.display.BitmapData(ICON_WIDTH, ICON_HEIGHT, false, 0);
static var STATUS_PRIVATE = 0;
static var STATUS_SHARED = 1;
static var STATUS_UNAPPROVED = 2;
static var STATUS_APPROVED = 3;
static var _imageFilePath = "";
static var _saveFilePath = "";
static var ICON_IMAGE_SCANNER = new com.newgrounds.encoders.ImageScanner();
static var DATA_IMAGE_SCANNER = new com.newgrounds.encoders.ImageScanner(64, 6);
}
Symbol 155 MovieClip [__Packages.com.newgrounds.SaveGroup] Frame 0
class com.newgrounds.SaveGroup
{
var _connection, _id, _name, _type, _keysArray, _ratingsArray, _keys, _ratings;
function SaveGroup (connection, name, id, type, keys, ratings) {
_connection = connection;
_id = id;
_name = name;
_type = type;
_keysArray = keys;
_ratingsArray = ratings;
_keys = new Object();
_ratings = new Object();
var _local11;
for (var _local7 in keys) {
var _local2 = keys[_local7];
_keys[_local2.__get__name()] = _local2;
}
for (var _local6 in ratings) {
var _local3 = ratings[_local6];
_ratings[_local3.__get__name()] = _local3;
}
}
function get connection() {
return(_connection);
}
function get name() {
return(_name);
}
function get type() {
return(_type);
}
function get id() {
return(_id);
}
function get keys() {
return(_keysArray);
}
function get ratings() {
return(_ratingsArray);
}
function getKey(name) {
return(_keys[name]);
}
function getRating(name) {
return(_ratings[name]);
}
function getKeyById(id) {
for (var _local4 in _keys) {
var _local2 = _keys[_local4];
if (_local2.__get__id() == id) {
return(_local2);
}
}
return(null);
}
function getRatingById(id) {
for (var _local4 in _ratings) {
var _local2 = _ratings[_local4];
if (_local2.__get__id() == id) {
return(_local2);
}
}
return(null);
}
function toString() {
return((((("SaveGroup: " + name) + " Keys: ") + _keysArray) + " Ratings: ") + _ratingsArray);
}
static var TYPE_SYSTEM = 0;
static var TYPE_PRIVATE = 1;
static var TYPE_PUBLIC = 2;
static var TYPE_MODERATED = 3;
}
Symbol 153 MovieClip [__Packages.com.newgrounds.SaveKey] Frame 0
class com.newgrounds.SaveKey
{
var _name, _id, _type;
function SaveKey (name, id, type) {
_name = name;
_id = id;
_type = type;
}
function get name() {
return(_name);
}
function get id() {
return(_id);
}
function get type() {
return(_type);
}
function validateValue(value) {
switch (_type) {
case TYPE_INTEGER :
value = Number(value);
if (!isNaN(value)) {
var _local3 = int(value);
if (_local3 != value) {
com.newgrounds.Logger.logWarning(((((("Float value " + value) + " given for integer key \"") + _name) + "\". Clamping to ") + _local3) + ".");
}
return(_local3);
}
break;
case TYPE_FLOAT :
value = Number(value);
if (!isNaN(value)) {
return(isNaN(Number(value)));
}
break;
case TYPE_BOOLEAN :
return(Boolean(value) && (int(value) != 0));
case TYPE_STRING :
return((value ? (value.toString()) : ""));
}
return(null);
}
function toString() {
return(_name);
}
static var TYPE_FLOAT = 1;
static var TYPE_INTEGER = 2;
static var TYPE_STRING = 3;
static var TYPE_BOOLEAN = 4;
}
Symbol 154 MovieClip [__Packages.com.newgrounds.SaveRating] Frame 0
class com.newgrounds.SaveRating
{
var _name, _id, _isFloat, _minimum, _maximum;
function SaveRating (name, id, isFloat, minimum, maximum) {
_name = name;
_id = id;
_isFloat = isFloat;
_minimum = minimum;
_maximum = maximum;
}
function get name() {
return(_name);
}
function get id() {
return(_id);
}
function get isFloat() {
return(_isFloat);
}
function get minimum() {
return(_minimum);
}
function get maximum() {
return(_maximum);
}
function validateValue(value) {
var _local2 = Number(value);
if (isNaN(_local2)) {
com.newgrounds.Logger.logError(("Invalid value for rating \"" + _name) + "\".");
return(NaN);
}
if (_local2 < _minimum) {
com.newgrounds.Logger.logWarning(((((_local2 + " is out of acceptable range for rating \"") + _name) + "\". Clamping to ") + _minimum) + ".");
return(_minimum);
}
if (_local2 > _maximum) {
com.newgrounds.Logger.logWarning(((((_local2 + " is out of acceptable range for rating \"") + _name) + "\". Clamping to ") + _maximum) + ".");
return(_maximum);
}
if (!isFloat) {
var _local3 = int(_local2);
if (_local3 != _local2) {
com.newgrounds.Logger.logWarning(((((("Float value " + _local2) + " given for integer rating \"") + _name) + "\". Clamping to ") + _local3) + ".");
}
return(_local3);
}
return(_local2);
}
function toString() {
return(_name);
}
}
Symbol 149 MovieClip [__Packages.com.newgrounds.BitmapLoader] Frame 0
class com.newgrounds.BitmapLoader extends com.newgrounds.APIEventDispatcher
{
var _bitmapData, _url, _loader, _loaderClip, dispatchEvent;
function BitmapLoader (defaultBitmap, url) {
super();
_bitmapData = defaultBitmap;
_url = url;
}
function get url() {
return(_url);
}
function set url(v) {
_loaded = false;
_url = v;
//return(url);
}
function get bitmapData() {
return(_bitmapData);
}
function set bitmapData(v) {
_bitmapData = v;
_loaded = true;
//return(bitmapData);
}
function get loaded() {
return(_loaded);
}
function disposeLoader() {
if (_loader) {
if (_loaderClip._parent == _root) {
_loader.unloadClip(_loaderClip.bitmap);
_loaderClip.removeMovieClip();
}
_loader = null;
_loaderClip = null;
}
}
function load() {
if ((!_url) || (_url == "")) {
onLoadComplete();
return(undefined);
}
_loaded = false;
if (_bitmapData) {
_bitmapData.dispose();
_bitmapData = null;
}
disposeLoader();
attachBitmap(null);
}
function attachBitmap(parent) {
if (!parent) {
parent = _root;
}
var _local5 = parent.getNextHighestDepth();
var _local3 = parent.createEmptyMovieClip("__bitmap" + _local5, _local5);
if (((!_loaded) && (_url)) && (_url != "")) {
_local3.createEmptyMovieClip("bitmap", 0);
_loader = new MovieClipLoader();
_loaderClip = _local3;
if (parent == _root) {
_loaderClip._visible = false;
}
var thisObj = this;
_loaderClip.onEnterFrame = function () {
thisObj.pollLoad();
};
_loader.addListener({onLoadError:function () {
thisObj.onLoadComplete();
}});
_loader.loadClip(_url, _local3.bitmap);
} else {
_local3.attachBitmap(_bitmapData, 0);
}
return(_local3);
}
function pollLoad() {
if (_loaderClip._width) {
onLoadComplete();
}
}
function onLoadComplete() {
var _local2;
if ((_loader && (_loaderClip)) && (_loaderClip._width)) {
try {
_loaderClip.onEnterFrame = null;
_local2 = new flash.display.BitmapData(_loaderClip._width, _loaderClip._height, true, 0);
_local2.draw(_loaderClip);
_bitmapData = _local2;
_loaded = true;
} catch(error) {
if (_local2) {
_local2.dispose();
}
}
}
disposeLoader();
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.ICON_LOADED, this, (_loaded ? null : (com.newgrounds.APIEvent.ERROR_BAD_FILE))));
}
static var _cacheSeed = 0;
var _loaded = true;
}
Symbol 158 MovieClip [__Packages.com.newgrounds.SaveQuery] Frame 0
class com.newgrounds.SaveQuery extends com.newgrounds.APIEventDispatcher
{
var _group, _connection, _files, _lookupKeys, _lookupRatings, _fileConditions, _keyConditions, _ratingConditions, _sortFields, dispatchEvent;
function SaveQuery (group) {
super();
_group = group;
_connection = group.connection;
reset();
}
function get group() {
return(_group);
}
function get resultsPerPage() {
return(_resultsPerPage);
}
function set resultsPerPage(val) {
_resultsPerPage = Math.min(Math.max(val, 1), 100);
//return(resultsPerPage);
}
function get page() {
return(_page);
}
function set page(val) {
_page = Math.max(val, 1);
//return(page);
}
function prevPage() {
page = ((page-1));
}
function nextPage() {
page = ((page+1));
}
function get isRandomized() {
return(_isRandomized);
}
function set isRandomized(val) {
_isRandomized = val;
//return(isRandomized);
}
function get files() {
return(_files);
}
function reset() {
_page = 1;
_resultsPerPage = 10;
_isRandomized = false;
_lookupKeys = [];
_lookupRatings = [];
_fileConditions = [];
_keyConditions = [];
_ratingConditions = [];
_sortFields = [];
_files = [];
includeAllFields();
}
function clone() {
var _local2 = new com.newgrounds.SaveQuery(_group);
_local2._page = _page;
_local2._resultsPerPage = _resultsPerPage;
_local2._isRandomized = _isRandomized;
_local2._lookupKeys = _lookupKeys.concat();
_local2._lookupRatings = _lookupRatings.concat();
_local2._fileConditions = _fileConditions.concat();
_local2._keyConditions = _keyConditions.concat();
_local2._ratingConditions = _ratingConditions.concat();
return(_local2);
}
function includeAllFields() {
for (var _local5 in _group.__get__keys()) {
var _local2 = _group.__get__keys()[_local5];
_lookupKeys.push(_local2.__get__id());
}
for (var _local4 in _group.__get__ratings()) {
var _local3 = _group.__get__ratings()[_local4];
_lookupRatings.push(_local3.__get__id());
}
}
function addCondition(field, operator, value) {
var _local2;
_local2 = 0;
while (_local2 < FILE_FIELDS.length) {
if (FILE_FIELDS[_local2] == field) {
break;
}
_local2++;
}
if (_local2 == FILE_FIELDS.length) {
_local2 = -1;
}
if (_local2 >= 0) {
_fileConditions.push({field:_local2, operator:operator, value:value});
} else {
var _local4 = _group.getKey(field);
if (_local4) {
value = _local4.validateValue(value);
_keyConditions.push({key_id:_local4.__get__id(), operator:operator, value:value});
return(undefined);
}
var _local3 = field.split(".");
var _local6 = _group.getRating(_local3[0]);
if (_local6) {
if (_local3[1] != "votes") {
value = _local6.validateValue(value);
}
_ratingConditions.push({rating_id:_local6.__get__id(), operator:operator, value:value, column:(_local3[1] ? (_local3[1]) : "score")});
return(undefined);
}
com.newgrounds.Logger.logError(((("The save group \"" + _group.__get__name()) + "\" does not have a field named \"") + field) + "\".");
}
}
function sortOn(field, sortDescending) {
if (sortDescending == undefined) {
sortDescending = false;
}
var _local2;
_local2 = 0;
while (_local2 < FILE_FIELDS.length) {
if (FILE_FIELDS[_local2] == field) {
break;
}
_local2++;
}
if (_local2 == FILE_FIELDS.length) {
_local2 = -1;
}
if (_local2 >= 0) {
_sortFields.push({table:TABLE_FILES, field:_local2, desc:sortDescending});
} else {
var _local5 = _group.getKey(field);
if (_local5) {
_sortFields.push({table:TABLE_KEYS, field:_local5.__get__id(), desc:sortDescending});
return(undefined);
}
var _local3 = field.split(".");
var _local6 = _group.getRating(_local3[0]);
if (_local6) {
_sortFields.push({table:TABLE_RATINGS, field:_local6.__get__id(), desc:sortDescending, extra:(_local3[1] ? (_local3[1]) : "score")});
return(undefined);
}
com.newgrounds.Logger.logError(((("The save group \"" + _group.__get__name()) + "\" does not have a field named \"") + field) + "\".");
}
}
function execute() {
var _local5 = {};
_local5.page = _page;
_local5.num_results = _resultsPerPage;
if (_isRandomized) {
_local5.randomize = 1;
}
if (_lookupKeys && (_lookupKeys.length)) {
_local5.lookup_keys = _lookupKeys;
}
if (_lookupRatings && (_lookupRatings.length)) {
_local5.lookup_ratings = _lookupRatings;
}
if (_fileConditions && (_fileConditions.length)) {
_local5.file_conditions = _fileConditions;
}
if (_keyConditions && (_keyConditions.length)) {
_local5.key_conditions = _keyConditions;
}
if (_ratingConditions && (_ratingConditions.length)) {
_local5.rating_conditions = _ratingConditions;
}
if (_sortFields && (_sortFields.length)) {
_local5.sort_conditions = _sortFields;
}
_connection.sendSimpleCommand("lookupSaveFiles", {target:this, func:onQueryComplete}, {publisher_id:_connection.publisherId, group_id:_group.__get__id(), query:_local5});
}
function onQueryComplete(event) {
if (event.__get__success()) {
var _local4 = event.__get__data();
_files = [];
if (_local4.files) {
var _local2 = 0;
while (_local2 < _local4.files.length) {
var _local3 = com.newgrounds.SaveFile.fromObject(_group, _local4.files[_local2]);
if (_local3) {
_files.push(_local3);
}
_local2++;
}
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.QUERY_COMPLETE, this));
} else {
com.newgrounds.Logger.logError("Query failed: " + event.__get__error());
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.QUERY_COMPLETE, this, event.__get__error()));
}
}
static var FILE_ID = "fileId";
static var AUTHOR_ID = "authorId";
static var AUTHOR_NAME = "authorName";
static var FILE_NAME = "fileName";
static var CREATED_ON = "createdOn";
static var UPDATED_ON = "updatedOn";
static var FILE_VIEWS = "fileViews";
static var FILE_STATUS = "fileStatus";
static var FILE_FIELDS = [FILE_ID, AUTHOR_ID, AUTHOR_NAME, FILE_NAME, CREATED_ON, UPDATED_ON, FILE_VIEWS, FILE_STATUS];
static var OPERATOR_EQUAL = "=";
static var OPERATOR_LESS_THAN = "<";
static var OPERATOR_GREATER_THAN = ">";
static var OPERATOR_NOT_EQUAL = "!=";
static var OPERATOR_LESS_OR_EQUAL = "<=";
static var OPERATOR_GREATER_OR_EQUAL = ">=";
static var OPERATOR_CONTAINS = "*";
static var OPERATOR_NOT_CONTAINS = "!*";
static var OPERATOR_NOT_BEGINS_WITH = "!*=";
static var OPERATOR_NOT_ENDS_WITH = "!=*";
static var OPERATOR_BEGINS_WITH = "*=";
static var OPERATOR_ENDS_WITH = "=*";
static var TABLE_FILES = 1;
static var TABLE_KEYS = 2;
static var TABLE_RATINGS = 3;
var _page = 1;
var _resultsPerPage = 10;
var _isRandomized = false;
}
Symbol 150 MovieClip [__Packages.com.newgrounds.Medal] Frame 0
class com.newgrounds.Medal extends com.newgrounds.APIEventDispatcher
{
var _connection, _id, _name, _description, _secret, _unlocked, _value, _difficulty, _iconLoader, dispatchEvent;
function Medal (connection, id, name, description, secret, unlocked, value, difficultyId, iconURL) {
super();
_connection = connection;
_id = id;
_name = name;
_description = description;
_secret = secret;
_unlocked = unlocked;
_value = value;
_difficulty = DIFFICULTIES[difficultyId];
_iconLoader = new com.newgrounds.BitmapLoader(DEFAULT_ICON, iconURL);
_iconLoader.load();
}
function get difficulty() {
return(_difficulty);
}
function get icon() {
return(_iconLoader.__get__bitmapData());
}
function get id() {
return(_id);
}
function get name() {
return(_name);
}
function get description() {
return(_description);
}
function get secret() {
return(_secret);
}
function get unlocked() {
return(_unlocked);
}
function get value() {
return(_value);
}
function toString() {
return((((((("Medal: " + _name) + "\t\t(") + (_unlocked ? "unlocked, " : "locked, ")) + _value) + "pts, ") + _difficulty) + ")");
}
function attachIcon(parent) {
return(_iconLoader.attachBitmap(parent));
}
function unlock() {
if (_unlocked) {
com.newgrounds.Logger.logWarning(("Medal \"" + _name) + "\" is already unlocked.");
return(undefined);
}
com.newgrounds.Logger.logMessage(("Unlocking medal \"" + name) + "\"...");
_unlocked = true;
if (_connection.__get__hasUserSession()) {
_connection.sendSimpleCommand("unlockMedal", {target:this, func:onUnlockConfirmed}, null, {medal_id:id});
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.MEDAL_UNLOCKED, this));
}
function setUnlocked(unlocked) {
_unlocked = unlocked;
}
function onUnlockConfirmed(event) {
if (event.__get__success()) {
com.newgrounds.Logger.logMessage(("Medal \"" + name) + "\" unlocked.");
} else {
com.newgrounds.Logger.logError(("Failed to unlock \"" + name) + "\"!");
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, this, event.__get__error()));
}
static var ICON_WIDTH = 50;
static var ICON_HEIGHT = 50;
static var DEFAULT_ICON = flash.display.BitmapData.loadBitmap("DefaultMedalIcon");
static var DIFFICULTY_EASY = "Easy";
static var DIFFICULTY_MODERATE = "Moderate";
static var DIFFICULTY_CHALLENGING = "Challenging";
static var DIFFICULTY_DIFFICULT = "Difficult";
static var DIFFICULTY_BRUTAL = "Brutal";
static var DIFFICULTIES = ["Unknown", DIFFICULTY_EASY, DIFFICULTY_MODERATE, DIFFICULTY_CHALLENGING, DIFFICULTY_DIFFICULT, DIFFICULTY_BRUTAL];
}
Symbol 152 MovieClip [__Packages.com.newgrounds.ScoreBoard] Frame 0
class com.newgrounds.ScoreBoard extends com.newgrounds.APIEventDispatcher
{
var _connection, _name, _id, _scores, _tag, dispatchEvent;
function ScoreBoard (connection, name, id) {
super();
_connection = connection;
_name = name;
_id = id;
}
function get name() {
return(_name);
}
function get scores() {
return(_scores);
}
function get period() {
return(_period);
}
function set period(val) {
_period = val;
//return(period);
}
function get firstResult() {
return(_firstResult);
}
function set firstResult(val) {
_firstResult = Math.max(1, val);
//return(firstResult);
}
function get numResults() {
return(_numResults);
}
function set numResults(val) {
_numResults = val;
//return(numResults);
}
function get tag() {
return(_tag);
}
function set tag(val) {
_tag = val;
//return(tag);
}
function get page() {
return(Math.ceil((_firstResult - 1) / _numResults) + 1);
}
function prevPage() {
if (firstResult > _numResults) {
firstResult = firstResult - _numResults;
}
}
function nextPage() {
firstResult = firstResult + _numResults;
}
function loadScores() {
_connection.sendSimpleCommand("loadScores", {target:this, func:onScoresLoaded}, {publisher_id:_connection.publisherId, board:_id, page:((_firstResult - 1) / _numResults) + 1, num_results:_numResults, period:_period, tag:_tag});
}
function postScore(numericScore, tag) {
if (tag == undefined) {
tag = null;
}
if (isNaN(numericScore)) {
com.newgrounds.Logger.logError("Cannot post invalid score: " + numericScore);
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 ") + _connection.username) + " to scoreboard \"") + _name) + "\"...");
_connection.sendSimpleCommand("postScore", {target:this, func:onScorePosted}, null, {user_name:_connection.username, board:_id, value:numericScore, tag:tag});
}
function onScoresLoaded(event) {
var _local4 = event.__get__data();
_scores = [];
var _local5;
if (_local4.first_result) {
_local5 = _local4.first_result;
} else {
_local5 = _firstResult;
}
if (_local4.scores) {
var _local3 = 0;
while (_local3 < _local4.scores.length) {
var _local2 = _local4.scores[_local3];
if (_local2) {
_scores[_local3] = new com.newgrounds.Score(_local5, _local2.username, _local2.value, _local2.numeric_value, _local2.tag);
}
_local3++;
_local5++;
}
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORES_LOADED, this));
}
function onScorePosted(event) {
if (event.__get__success()) {
com.newgrounds.Logger.logMessage("Score posted!");
var _local4 = event.__get__data();
var _local2 = {};
_local2.score = _local4.value;
_local2.scoreBoard = this;
} else {
com.newgrounds.Logger.logError("Error posting score: " + event.__get__error());
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORE_POSTED, _local2, event.__get__error()));
}
function toString() {
return("Scoreboard: " + _name);
}
static var TODAY = "Today";
static var THIS_WEEK = "This Week";
static var THIS_MONTH = "This Month";
static var THIS_YEAR = "This Year";
static var ALL_TIME = "All-Time";
var _period = ALL_TIME;
var _firstResult = 1;
var _numResults = 10;
}
Symbol 141 MovieClip [__Packages.com.newgrounds.Logger] Frame 0
class com.newgrounds.Logger
{
function Logger () {
}
static function logInternal() {
var _local2 = arguments;
log(PRIORITY_INTERNAL, _local2);
}
static function logMessage() {
var _local2 = arguments;
log(PRIORITY_MESSAGE, _local2);
}
static function logWarning() {
var _local2 = arguments;
log(PRIORITY_WARNING, _local2);
}
static function logError() {
var _local2 = arguments;
log(PRIORITY_ERROR, _local2);
}
static function log(priority, messages) {
if (priority == undefined) {
priority = PRIORITY_MESSAGE;
}
if (messages == undefined) {
messages = null;
}
if (priority >= _messageLevel) {
var _local1 = 0;
while (_local1 < messages.length) {
trace(HEADER + messages[_local1]);
_eventDispatcher.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.LOG, messages[_local1]));
_local1++;
}
}
if (priority >= _throwLevel) {
throw new Error(messages.join(newline));
}
}
static function addEventListener(event, listener) {
_eventDispatcher.addEventListener(event, listener, false, 0, false);
}
static var PRIORITY_INTERNAL = 0;
static var PRIORITY_MESSAGE = 1;
static var PRIORITY_WARNING = 2;
static var PRIORITY_ERROR = 3;
static var PRIORITY_MAX = 4;
static var HEADER = "[Newgrounds API] :: ";
static var _eventDispatcher = new com.newgrounds.EventDispatcher();
static var _messageLevel = PRIORITY_MESSAGE;
static var _throwLevel = PRIORITY_MAX;
}
Symbol 160 MovieClip [__Packages.com.newgrounds.components.FlashAdBase] Frame 0
class com.newgrounds.components.FlashAdBase extends MovieClip
{
var gotoAndStop, _x, _y, stop, onUnload, _adListener, adContainer, newgroundsButton, _fullScreen, clear, _ad, _adFeedLoader, _width, _height, beginFill, moveTo, lineTo, endFill;
function FlashAdBase () {
super();
try {
System.security.allowDomain("server.cpmstar.com");
System.security.allowInsecureDomain("server.cpmstar.com");
} catch(error) {
}
gotoAndStop("idle");
_x = int(_x);
_y = int(_y);
stop();
if (_newgroundsButton) {
_newgroundsButton.onRelease = onNGClick;
}
onUnload = removeAd;
var _local4 = this;
_adListener = {onLoadError:function (target, error, httpStatus) {
target._parent.onAdError(target, error, httpStatus);
}};
if (fullScreen) {
drawFullScreenRect();
}
if (com.newgrounds.API.__get__adFeedURL()) {
loadAdFeed();
} else {
com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, {target:this, func:loadAdFeed});
}
}
function get _adContainer() {
return(adContainer);
}
function get _newgroundsButton() {
return(newgroundsButton);
}
function get fullScreen() {
return(_fullScreen);
}
function set fullScreen(v) {
_fullScreen = v;
if (v) {
drawFullScreenRect();
} else {
clear();
}
//return(fullScreen);
}
function get showBorder() {
return(_showBorder);
}
function set showBorder(value) {
_showBorder = value;
if (_showBorder) {
if (_ad) {
var _local2 = _ad.getProgress(_adContainer);
if (_local2.bytesLoaded >= _local2.bytesTotal) {
gotoAndStop("loaded");
} else {
gotoAndStop("loading");
}
} else {
gotoAndStop("idle");
}
} else {
gotoAndStop("noBorder");
}
//return(showBorder);
}
function loadAdFeed(event) {
if (event == undefined) {
event = null;
}
_adFeedLoader = new LoadVars();
var target = this;
_adFeedLoader.onData = function (data) {
target.onAdFeedLoaded(data);
};
_adFeedLoader.load(com.newgrounds.API.__get__adFeedURL(), _adFeedLoader);
}
function onAdFeedLoaded(data) {
if (data && (data != "")) {
loadAd(data);
} else {
onAdError();
}
}
function loadAd(adURL) {
if (adType != VIDEO_ADS) {
if (adURL.indexOf("?") >= 0) {
adURL = adURL + "&";
} else {
adURL = adURL + "?";
}
adURL = adURL + "blockoverlays=1";
}
_ad = new MovieClipLoader();
_ad.addListener(_adListener);
_adContainer._lockroot = true;
_ad.loadClip(adURL, _adContainer);
}
function removeAd() {
_adFeedLoader.onData = null;
_adFeedLoader = null;
_ad.removeListener(_adListener);
if (_adContainer) {
_ad.unloadClip(_adContainer);
}
_ad = null;
}
function onAdError(target, error, httpStatus) {
com.newgrounds.Logger.logError("Unable to load ad.");
removeAd();
}
function onNGClick() {
com.newgrounds.API.loadNewgrounds();
}
function drawFullScreenRect() {
_x = (Stage.width - _width) / 2;
_y = (Stage.height - _height) / 2;
beginFill(0);
moveTo(-Stage.width, -Stage.height);
lineTo(Stage.width, -Stage.height);
lineTo(Stage.width, Stage.height);
lineTo(-Stage.width, Stage.height);
lineTo(-Stage.width, -Stage.height);
endFill();
}
var _showBorder = true;
var adType = com.newgrounds.components.FlashAdBase.prototype.VIDEO_ADS;
var VIDEO_ADS = "Video";
var SIMPLE_ADS = "Simple";
}
Symbol 135 MovieClip [__Packages.com.newgrounds.shims.APIShim] Frame 0
class com.newgrounds.shims.APIShim extends MovieClip
{
function APIShim () {
super();
}
}
Symbol 143 MovieClip [__Packages.com.newgrounds.encoders.json.JSON] Frame 0
class com.newgrounds.encoders.json.JSON
{
static var start, cache, interval;
function JSON () {
}
static function encode(arg, noquotes) {
var _local3;
var _local2;
var _local6;
var _local1 = "";
var _local4;
if (arg.isSServerVar()) {
var _local8 = "sservervariable";
} else {
var _local8 = typeof(arg);
}
switch (_local8) {
case "sservervariable" :
return("?" + arg.getEncodedValue());
case "object" :
if (arg) {
if (arg instanceof Array) {
_local2 = 0;
while (_local2 < arg.length) {
_local4 = encode(arg[_local2]);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + _local4;
_local2++;
}
return(("[" + _local1) + "]");
}
if (typeof(arg.toString) != "undefined") {
for (_local2 in arg) {
_local4 = arg[_local2];
if ((typeof(_local4) != "undefined") && (typeof(_local4) != "function")) {
_local4 = encode(_local4);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + ((encode(_local2) + ":") + _local4);
}
}
return(("{" + _local1) + "}");
}
}
return("null");
case "number" :
return((isFinite(arg) ? (String(arg)) : "null"));
case "string" :
_local6 = arg.length;
if (noquotes) {
var _local7 = "";
} else {
var _local7 = "\"";
}
_local1 = _local7;
_local2 = 0;
while (_local2 < _local6) {
_local3 = arg.charAt(_local2);
if (_local3 >= " ") {
if ((_local3 == "\\") || (_local3 == "\"")) {
_local1 = _local1 + "\\";
}
_local1 = _local1 + _local3;
} else {
switch (_local3) {
case "\b" :
_local1 = _local1 + "\\b";
break;
case "\f" :
_local1 = _local1 + "\\f";
break;
case newline :
_local1 = _local1 + "\\n";
break;
case "\r" :
_local1 = _local1 + "\\r";
break;
case "\t" :
_local1 = _local1 + "\\t";
break;
default :
_local3 = _local3.charCodeAt();
_local1 = _local1 + (("\\u00" + Math.floor(_local3 / 16).toString(16)) + (_local3 % 16).toString(16));
}
}
_local2 = _local2 + 1;
}
return(_local1 + _local7);
case "boolean" :
return(String(arg));
}
return("null");
}
static function background_encode(arg, callback) {
if (busy) {
trace("[Newgrounds Encoder] :: Cannot encode a new file until the previous file is completed");
return(false);
}
if (!callback) {
trace("[Newgrounds Encoder] :: Missing a callback function, skipping encode");
return(false);
}
busy = true;
var _local2 = new Date();
start = _local2.getTime();
cache = {busy:false, complete:false, arg:arg, target:arg, parents:[], encoded:"", callback:callback, encode_chunk:function () {
com.newgrounds.encoders.json.JSON.encode_chunk();
}};
if (getType(arg) == "object") {
cache.encoded = "{";
} else if (getType(arg) == "array") {
cache.encoded = "[";
}
interval = setInterval(cache, "encode_chunk", 25);
return(true);
}
static function background_decode(arg, callback) {
if (busy) {
trace("[Newgrounds Encoder] :: Cannot decode a new file until the previous file is completed");
return(false);
}
if (!callback) {
trace("[Newgrounds Encoder] :: Missing a callback function, skipping decode");
return(false);
}
busy = true;
var _local1 = new Date();
start = _local1.getTime();
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();
}};
interval = setInterval(cache, "decode_chunk", 25);
return(true);
}
static function decode(text) {
var at = 0;
var ch = " ";
var _value;
var _error = function (m) {
throw {name:"JSONError", message:m, at:at - 1, text:text};
};
var _next = function () {
ch = text.charAt(at);
at = at + 1;
return(ch);
};
var _white = function () {
while (ch) {
if (ch <= " ") {
_next();
} else if (ch == "/") {
switch (_next()) {
case "/" :
while ((_next() && (ch != newline)) && (ch != "\r")) {
}
break;
case "*" :
_next();
for(;;){
if (ch) {
if (ch == "*") {
if (_next() == "/") {
_next();
// unexpected jump
}
} else {
_next();
}
} else {
_error("Unterminated comment");
}
};
break;
default :
_error("Syntax error");
}
} else {
return;
}
}
};
var _string = function () {
var _local4;
var _local1 = "";
var _local3;
var _local2;
var _local5 = false;
if (ch == "\"") {
while (_next()) {
if (ch == "\"") {
_next();
return(_local1);
}
if (ch == "\\") {
switch (_next()) {
case "b" :
_local1 = _local1 + "\b";
break;
case "f" :
_local1 = _local1 + "\f";
break;
case "n" :
_local1 = _local1 + newline;
break;
case "r" :
_local1 = _local1 + "\r";
break;
case "t" :
_local1 = _local1 + "\t";
break;
case "u" :
_local2 = 0;
_local4 = 0;
while (_local4 < 4) {
_local3 = parseInt(_next(), 16);
if (!isFinite(_local3)) {
_local5 = true;
break;
}
_local2 = (_local2 * 16) + _local3;
_local4 = _local4 + 1;
}
if (_local5) {
_local5 = false;
break;
}
_local1 = _local1 + String.fromCharCode(_local2);
break;
default :
_local1 = _local1 + ch;
}
} else {
_local1 = _local1 + ch;
}
}
}
_error("Bad string");
};
var _array = function () {
var _local1 = [];
if (ch == "[") {
_next();
_white();
if (ch == "]") {
_next();
return(_local1);
}
while (ch) {
_local1.push(_value());
_white();
if (ch == "]") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad array");
};
var _object = function () {
var _local2;
var _local1 = {};
if (ch == "{") {
_next();
_white();
if (ch == "}") {
_next();
return(_local1);
}
while (ch) {
_local2 = _string();
_white();
if (ch != ":") {
break;
}
_next();
_local1[_local2] = _value();
_white();
if (ch == "}") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad object");
};
var _number = function () {
var _local1 = "";
var _local2;
if (ch == "-") {
_local1 = "-";
_next();
}
while ((ch >= "0") && (ch <= "9")) {
_local1 = _local1 + ch;
_next();
}
if (ch == ".") {
_local1 = _local1 + ".";
while ((_next() && (ch >= "0")) && (ch <= "9")) {
_local1 = _local1 + ch;
}
}
_local2 = 1 * _local1;
if (!isFinite(_local2)) {
_error("Bad number");
} else {
return(_local2);
}
};
var _word = function () {
switch (ch) {
case "t" :
if (((_next() == "r") && (_next() == "u")) && (_next() == "e")) {
_next();
return(true);
}
break;
case "f" :
if ((((_next() == "a") && (_next() == "l")) && (_next() == "s")) && (_next() == "e")) {
_next();
return(false);
}
break;
case "n" :
if (!(((_next() == "u") && (_next() == "l")) && (_next() == "l"))) {
break;
}
_next();
return(null);
}
_error("Syntax error");
};
_value = function () {
_white();
switch (ch) {
case "{" :
return(_object());
case "[" :
return(_array());
case "\"" :
return(_string());
case "-" :
return(_number());
}
return((((ch >= "0") && (ch <= "9")) ? (_number()) : (_word())));
};
return(_value());
}
static function getType(v) {
if (v instanceof Array) {
return("array");
}
return(typeof(v));
}
static function decode_chunk() {
if ((!cache.busy) && (!cache.complete)) {
cache.busy = true;
var _local1 = 0;
while (_local1 < decode_chunks) {
chunk_decoder();
if (cache.complete) {
break;
}
_local1++;
}
trace(Math.round((cache.pos / cache.arg.length) * 100) + "% decoded");
cache.busy = false;
}
if (cache.complete) {
var _local2 = new Date();
busy = false;
clearInterval(interval);
cache.callback(cache.root, _local2.getTime() - start);
cache.arg = "";
}
}
static function encode_chunk() {
if ((!cache.busy) && (!cache.complete)) {
cache.busy = true;
var _local1 = 0;
while (_local1 < encode_chunks) {
chunk_encoder();
if (cache.complete) {
break;
}
_local1++;
}
cache.busy = false;
}
if (cache.complete) {
var _local3 = new Date();
var _local2 = _local3.getTime();
busy = false;
clearInterval(interval);
cache.callback(cache.encoded, _local2 - start);
cache.encoded = "";
}
}
static function chunk_decoder() {
function _object() {
var _local1 = 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++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 != "\"") {
throw "Malformed object key in encoded string. Keys must be wrapped in quotes (\"\")";
}
com.newgrounds.encoders.json.JSON.cache.scratch = "";
_setTargetValue({});
} else if (_local1 == ",") {
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 != "\"") {
throw "Malformed object key in encoded string. Keys must be wrapped in quotes (\"\")";
}
com.newgrounds.encoders.json.JSON.cache.scratch = "";
} else if (_local1 == "}") {
_useParent();
} else if (_local1 == "\"") {
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 != ":") {
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 (_local1 == "\\") {
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
}
com.newgrounds.encoders.json.JSON.cache.scratch = com.newgrounds.encoders.json.JSON.cache.scratch + _local1;
}
com.newgrounds.encoders.json.JSON.cache.pos++;
}
function _array() {
var _local1 = 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++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
_setTargetValue([]);
if (_local1 != "]") {
_addArrayKey();
} else {
_useParent();
}
return(undefined);
}
if (_local1 == ",") {
_addArrayKey();
} else if (_local1 == "]") {
_useParent();
}
com.newgrounds.encoders.json.JSON.cache.pos++;
}
function _boolean() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 == "t") {
_setTargetValue(true);
com.newgrounds.encoders.json.JSON.cache.pos = com.newgrounds.encoders.json.JSON.cache.pos + 3;
} else if (_local1 == "f") {
_setTargetValue(false);
com.newgrounds.encoders.json.JSON.cache.pos = com.newgrounds.encoders.json.JSON.cache.pos + 4;
} else {
throw "Bool values must be true or false";
}
_useParent();
}
function _null() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 == "n") {
_setTargetValue(null);
com.newgrounds.encoders.json.JSON.cache.pos = com.newgrounds.encoders.json.JSON.cache.pos + 2;
} else {
throw "Null values must be null";
}
_useParent();
}
function _string() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
if (_local1 != "\"") {
throw "Strings must be wrapped in quotes (\"\")";
}
com.newgrounds.encoders.json.JSON.cache.scratch = "";
com.newgrounds.encoders.json.JSON.cache.mode = "string";
} else if (_local1 == "\"") {
_setTargetValue(com.newgrounds.encoders.json.JSON.cache.scratch);
_useParent();
} else {
if (_local1 == "\\") {
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
switch (_local1) {
case "n" :
_local1 = newline;
break;
case "r" :
_local1 = newline;
break;
case "t" :
_local1 = "\t";
break;
case "u" :
_local1 = "\\" + _local1;
}
}
com.newgrounds.encoders.json.JSON.cache.scratch = com.newgrounds.encoders.json.JSON.cache.scratch + _local1;
}
com.newgrounds.encoders.json.JSON.cache.pos++;
}
function _number() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
var _local2 = "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 (_local2.indexOf(_local1) < 0) {
_setTargetValue(Number(com.newgrounds.encoders.json.JSON.cache.scratch));
_useParent();
} else {
com.newgrounds.encoders.json.JSON.cache.scratch = com.newgrounds.encoders.json.JSON.cache.scratch + _local1;
com.newgrounds.encoders.json.JSON.cache.pos++;
}
}
function _setTargetValue(newval) {
var _local2 = _getParent().obj;
var _local1 = com.newgrounds.encoders.json.JSON.cache.parents[com.newgrounds.encoders.json.JSON.cache.parents.length - 1];
_local2[_local1] = 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 _local2 = com.newgrounds.encoders.json.JSON.cache;
var _local1 = 0;
while (_local1 < (com.newgrounds.encoders.json.JSON.cache.parents.length - 1)) {
_local2 = _local2[com.newgrounds.encoders.json.JSON.cache.parents[_local1]];
_local1++;
}
return({obj:_local2, name:com.newgrounds.encoders.json.JSON.cache.parents[_local1]});
}
function _getCurrent() {
var _local2 = com.newgrounds.encoders.json.JSON.cache;
var _local1 = 0;
while (_local1 < com.newgrounds.encoders.json.JSON.cache.parents.length) {
_local2 = _local2[com.newgrounds.encoders.json.JSON.cache.parents[_local1]];
_local1++;
}
return({obj:_local2, name:com.newgrounds.encoders.json.JSON.cache.parents[_local1]});
}
function _addParent(child) {
com.newgrounds.encoders.json.JSON.cache.parents.push(child);
}
function _addArrayKey() {
var _local1 = _getCurrent().obj.length;
com.newgrounds.encoders.json.JSON.cache.parents.push(_local1);
com.newgrounds.encoders.json.JSON.cache.mode = null;
}
if (cache.pos >= cache.arg.length) {
cache.complete = true;
return(undefined);
}
if (cache.mode) {
eval ("_" + cache.mode)();
} else {
var char = cache.arg.charAt(cache.pos);
switch (char) {
case "{" :
_object();
return;
case "[" :
_array();
return;
case "\"" :
_string();
return;
case "n" :
_null();
return;
case "t" :
_boolean();
return;
case "f" :
_boolean();
return;
default :
_number();
}
}
}
static function chunk_encoder() {
if (cache.complete) {
return(undefined);
}
var _local2 = getType(cache.target);
switch (_local2) {
case "number" :
cache.encoded = cache.encoded + cache.target;
getParent();
break;
case "string" :
cache.encoded = cache.encoded + (("\"" + cache.target.split("\"").join("\\\"")) + "\"");
getParent();
break;
case "boolean" :
cache.encoded = cache.encoded + ((cache.target == true) ? "true" : "false");
getParent();
break;
case "null" :
cache.encoded = cache.encoded + "null";
getParent();
break;
case "array" :
if (cache.target.length < 1) {
cache.encoded = cache.encoded + "]";
getParent();
} else {
cache.parents.push(cache.target);
cache.target = cache.target[0];
if (getType(cache.target) == "array") {
cache.encoded = cache.encoded + "[";
} else if (getType(cache.target) == "object") {
cache.encoded = cache.encoded + "{";
}
}
break;
case "object" :
for (var _local1 in cache.target) {
break;
}
if (_local1 === undefined) {
cache.encoded = cache.encoded + "}";
getParent();
} else {
cache.parents.push(cache.target);
cache.target = cache.target[_local1];
cache.encoded = cache.encoded + (("\"" + _local1.split("\"").join("\\\"")) + "\":");
if (getType(cache.target) == "array") {
cache.encoded = cache.encoded + "[";
} else if (getType(cache.target) == "object") {
cache.encoded = cache.encoded + "{";
}
}
break;
default :
cache.encoded = cache.encoded + "null";
getParent();
}
}
static function getParent() {
if (cache.parents.length > 0) {
var _local1 = cache.parents.pop();
if (getType(_local1) == "array") {
_local1.shift();
} else {
for (var _local3 in _local1) {
delete _local1[_local3];
break;
}
}
if ((getType(_local1) == "object") or (getType(_local1) == "array")) {
for (var _local2 in _local1) {
break;
}
if (!(_local2 === undefined)) {
cache.encoded = cache.encoded + ",";
}
}
cache.target = _local1;
} else {
cache.complete = true;
}
}
static var encode_chunks = 20000;
static var decode_chunks = 20000;
static var busy = false;
}
Symbol 146 MovieClip [__Packages.com.newgrounds.crypto.MD5] Frame 0
class com.newgrounds.crypto.MD5
{
function MD5 () {
}
static function hash(src) {
return(hex_md5(src));
}
static function hex_md5(src) {
return(binl2hex(core_md5(str2binl(src), src.length * 8)));
}
static function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var _local4 = 1732584193 /* 0x67452301 */;
var _local3 = -271733879;
var _local2 = -1732584194;
var _local1 = 271733878 /* 0x10325476 */;
var _local5 = 0;
while (_local5 < x.length) {
var _local10 = _local4;
var _local9 = _local3;
var _local8 = _local2;
var _local7 = _local1;
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 0], 7, -680876936);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 1], 12, -389564586);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 2], 17, 606105819);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 3], 22, -1044525330);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 4], 7, -176418897);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 5], 12, 1200080426);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 6], 17, -1473231341);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 7], 22, -45705983);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 8], 7, 1770035416);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 9], 12, -1958414417);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 10], 17, -42063);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 11], 22, -1990404162);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 12], 7, 1804603682);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 13], 12, -40341101);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 14], 17, -1502002290);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 15], 22, 1236535329);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 1], 5, -165796510);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 6], 9, -1069501632);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 11], 14, 643717713);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 0], 20, -373897302);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 5], 5, -701558691);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 10], 9, 38016083);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 15], 14, -660478335);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 4], 20, -405537848);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 9], 5, 568446438);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 14], 9, -1019803690);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 3], 14, -187363961);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 8], 20, 1163531501);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 13], 5, -1444681467);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 2], 9, -51403784);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 7], 14, 1735328473);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 12], 20, -1926607734);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 5], 4, -378558);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 8], 11, -2022574463);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 11], 16, 1839030562);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 14], 23, -35309556);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 1], 4, -1530992060);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 4], 11, 1272893353);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 7], 16, -155497632);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 10], 23, -1094730640);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 13], 4, 681279174);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 0], 11, -358537222);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 3], 16, -722521979);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 6], 23, 76029189);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 9], 4, -640364487);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 12], 11, -421815835);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 15], 16, 530742520);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 2], 23, -995338651);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 0], 6, -198630844);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 7], 10, 1126891415);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 14], 15, -1416354905);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 5], 21, -57434055);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 12], 6, 1700485571);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 3], 10, -1894986606);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 10], 15, -1051523);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 1], 21, -2054922799);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 8], 6, 1873313359);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 15], 10, -30611744);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 6], 15, -1560198380);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 13], 21, 1309151649);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 4], 6, -145523070);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 11], 10, -1120210379);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 2], 15, 718787259);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 9], 21, -343485551);
_local4 = safe_add(_local4, _local10);
_local3 = safe_add(_local3, _local9);
_local2 = safe_add(_local2, _local8);
_local1 = safe_add(_local1, _local7);
_local5 = _local5 + 16;
}
return(new Array(_local4, _local3, _local2, _local1));
}
static function md5_cmn(q, a, b, x, s, t) {
return(safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b));
}
static function md5_ff(a, b, c, d, x, s, t) {
return(md5_cmn((b & c) | ((~b) & d), a, b, x, s, t));
}
static function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
static function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
static function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
static function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
static function safe_add(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
static function str2binl(str) {
var _local3 = new Array();
var _local4 = 255;
var _local1 = 0;
while (_local1 < (str.length * 8)) {
_local3[_local1 >> 5] = _local3[_local1 >> 5] | ((str.charCodeAt(_local1 / 8) & _local4) << (_local1 % 32));
_local1 = _local1 + 8;
}
return(_local3);
}
static function binl2hex(binarray) {
var _local4 = new String("");
var _local3 = new String("0123456789abcdef");
var _local1 = 0;
while (_local1 < (binarray.length * 4)) {
_local4 = _local4 + (_local3.charAt((binarray[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((binarray[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(_local4);
}
}
Symbol 147 MovieClip [__Packages.com.newgrounds.crypto.RC4] Frame 0
class com.newgrounds.crypto.RC4
{
function RC4 () {
}
static function encrypt(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToHex(_local2));
}
static function encryptbin(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(_local2);
}
static function decrypt(src, key) {
var _local3 = hexToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToStr(_local2));
}
static function initialize(pwd) {
var _local2 = 0;
var _local3;
var _local4 = pwd.length;
var _local1 = 0;
while (_local1 <= 255) {
mykey[_local1] = pwd[_local1 % _local4];
sbox[_local1] = _local1;
_local1++;
}
_local1 = 0;
while (_local1 <= 255) {
_local2 = ((_local2 + sbox[_local1]) + mykey[_local1]) % 256;
_local3 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local3;
_local1++;
}
}
static function calculate(plaintxt, psw) {
initialize(psw);
var _local1 = 0;
var _local2 = 0;
var _local9 = new Array();
var _local7;
var _local5;
var _local6;
var _local3 = 0;
while (_local3 < plaintxt.length) {
_local1 = (_local1 + 1) % 256;
_local2 = (_local2 + sbox[_local1]) % 256;
_local5 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local5;
var _local4 = (sbox[_local1] + sbox[_local2]) % 256;
_local7 = sbox[_local4];
_local6 = plaintxt[_local3] ^ _local7;
_local9.push(_local6);
_local3++;
}
return(_local9);
}
static function charsToHex(chars) {
var _local4 = new String("");
var _local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local1 = 0;
while (_local1 < chars.length) {
_local4 = _local4 + (_local3[chars[_local1] >> 4] + _local3[chars[_local1] & 15]);
_local1++;
}
return(_local4);
}
static function hexToChars(hex) {
var _local3 = new Array();
var _local1 = ((hex.substr(0, 2) == "0x") ? 2 : 0);
while (_local1 < hex.length) {
_local3.push(parseInt(hex.substr(_local1, 2), 16));
_local1 = _local1 + 2;
}
return(_local3);
}
static function charsToStr(chars) {
var _local3 = new String("");
var _local1 = 0;
while (_local1 < chars.length) {
_local3 = _local3 + String.fromCharCode(chars[_local1]);
_local1++;
}
return(_local3);
}
static function strToChars(str) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < str.length) {
_local3.push(str.charCodeAt(_local1));
_local1++;
}
return(_local3);
}
static var sbox = new Array(255);
static var mykey = new Array(255);
}
Symbol 151 MovieClip [__Packages.com.newgrounds.Score] Frame 0
class com.newgrounds.Score
{
var _rank, _username, _score, _numericValue, _tag;
function Score (rank, username, score, numericValue, tag) {
(_rank = rank);
(_username = username);
_score = score;
_numericValue = numericValue;
_tag = tag;
}
function get numericValue() {
return(_numericValue);
}
function get rank() {
return(_rank);
}
function get score() {
return(_score);
}
function get tag() {
return(_tag);
}
function get username() {
return(_username);
}
function toString() {
return((((_rank + ".\t") + _username) + "\t") + _score);
}
}