Frame 1
function runAchieve(num) {
if (!_root.achs[num].gotten) {
var _local5 = _root.achs[num].nam;
_root.medal_popup.unlockMedal(_local5);
var _local4 = "?????";
var _local6 = "???";
var _local2 = com.Newgrounds.NewgroundsAPI.getMedals();
var _local3 = null;
for (i in _local2) {
if (_local2[i].medal_name == _local5) {
_local3 = _local2[i];
_local4 = _local3.medal_name;
_local6 = _local3.medal_value + "pts";
com.Newgrounds.NewgroundsAPI.unlockMedal(_local4);
break;
}
}
_root.achs[num].gotten = true;
}
}
this.achs = new Array();
achs[0] = new Array();
achs[0].nam = "Whiskered Away";
achs[0].gotten = false;
achs[1] = new Array();
achs[1].nam = "Fabulous!";
achs[1].gotten = false;
achs[2] = new Array();
achs[2].nam = "The Fast and the Furriest";
achs[2].gotten = false;
achs[3] = new Array();
achs[3].nam = "Beat to a Fulp";
achs[3].gotten = false;
achs[4] = new Array();
achs[4].nam = "Graven Image";
achs[4].gotten = false;
achs[5] = new Array();
achs[5].nam = "Power Razor";
achs[5].gotten = false;
_root.API_Settings = {movie_id:51, enc_key:"d7018ab2a6e72d1fd8f463dbf6c04a2e", debug_mode:false, movie_version:""};
stop();
Frame 2
function goAhead() {
if (this.rdy) {
stopAllSounds();
coming._visible = true;
bgmusic.start(0, 999);
coming.gotoAndPlay(1);
coming.onPress = function () {
this.gotoAndPlay(100);
delete this.onPress;
};
delete this.onEnterFrame;
this.onEnterFrame = function () {
if (!Key.isDown(65)) {
aup = true;
}
if (Key.isDown(65) && (aup)) {
coming.gotoAndPlay(100);
delete this.onEnterFrame;
}
};
}
}
bgmusic = new Sound(this);
bgmusic.attachSound("bgmusic");
delete this.onEnterFrame;
stop();
coming._visible = false;
coming.stop();
aup = false;
this.onEnterFrame = function () {
if (!Key.isDown(65)) {
aup = true;
}
if (Key.isDown(65) && (aup)) {
goAhead();
aup = false;
}
};
Frame 3
stop();
swin0 = new Sound(this);
swin0.attachSound("swing0");
swin1 = new Sound(this);
swin1.attachSound("swing2");
swin2 = new Sound(this);
swin2.attachSound("swing1");
groan0 = new Sound(this);
groan1 = new Sound(this);
groan2 = new Sound(this);
groan3 = new Sound(this);
groan0.attachSound("groan0");
groan1.attachSound("groan1");
groan2.attachSound("groan2");
groan3.attachSound("groan3");
hit0 = new Sound(this);
hit1 = new Sound(this);
hit2 = new Sound(this);
hit0.attachSound("hit0");
hit1.attachSound("hit1");
hit2.attachSound("hit2");
groundhit = new Sound(this);
groundhit.attachSound("groundhit");
laugh = new Sound(this);
laugh.attachSound("laugh");
cannot = new Sound(this);
cannot.attachSound("cannot");
nochance = new Sound(this);
nochance.attachSound("nochance");
resistance = new Sound(this);
resistance.attachSound("resistance");
nothing = new Sound(this);
nothing.attachSound("nothing");
death = new Sound(this);
death.attachSound("death");
fireballsound = new Sound(this);
fireballsound.attachSound("firebally");
discharge = new Sound(this);
discharge.attachSound("discharge");
bgmusic2 = new Sound(this);
bgmusic2.attachSound("bgmusic2");
pausesound = new Sound(this);
pausesound.attachSound("pausesound");
function updateHUD() {
if ((d.powa >= 100) && (!hud.pbar.cycle)) {
hud.pbar.gotoAndPlay(2);
hud.pbar.cycle = true;
} else {
hud.pbar.cycle = false;
hud.pbar.gotoAndStop(1);
}
hud.numlives = ": " + this.lives;
hud.score = "XP:" + this.score;
if (this.nex != undefined) {
hud.nex = "NEXT: " + this.nex;
} else {
hud.nex = "MAXED OUT";
}
hud.lbar._xscale = (d.life / d.maxlife) * 100;
hud.pbar._xscale = d.powa;
hud.bbar._xscale = (b.life / b.maxlife) * 100;
if (hud.bbar._xscale < 0) {
hud.bbar._xscale = 0;
}
if (((this.score >= this.nex) && (!summoning)) && (this.nex != undefined)) {
flashIt();
blackOut();
summoning = true;
this.pausy = true;
if (this.lev <= 2) {
lut = this.attachMovie("leveluptext", "lup", 789);
} else {
lut = this.attachMovie("fabuloustext", "lup", 789);
}
lut._y = 20;
g = wrap.attachMovie("summon", "summon", 777);
g._xscale = 87;
g._yscale = g._xscale;
g._x = d._x - 30;
g._y = d._y + 20;
}
}
function blackOut() {
bgmusic.stop();
if (this.lev <= 2) {
wrap.blackout.gotoAndPlay(2);
} else {
wrap.blackout2.gotoAndPlay(2);
}
i = 0;
while (i < stones.length) {
yib = stones[i];
yib._visible = false;
i++;
}
}
function switchGuy() {
this.lev = this.lev + 1;
d.attachMovie("k" + dudes[this.lev], "guts", 0);
d.id = dudes[this.lev];
}
function endSummon() {
stopAllSounds();
if (!this.mute) {
bgmusic.start(0, 99);
}
hud.holder.guts.attachMovie("levicon" + this.lev, "guts", 0);
this.nex = levreqs[this.lev];
hud.holder.gotoAndPlay(2);
wrap.blackout.gotoAndStop(1);
flashIt();
this.pausy = false;
summoning = false;
i = 0;
while (i < stones.length) {
yib = stones[i];
yib._visible = true;
i++;
}
d.xvel = 0;
d.anum = 0;
if (this.lev >= 0) {
_root.runAchieve(0);
}
if (this.lev >= 4) {
nomorelevelup = true;
_root.runAchieve(1);
}
if (!nomorelevelup) {
}
}
function phys(who) {
if (who.blinking) {
if (wrap.you._x == undefined) {
yo = wrap.attachMovie("you", "you", 788766679);
yo._xscale = 80;
yo._yscale = yo._xscale;
yo.onEnterFrame = function () {
this._x = _root.d._x + 5;
this._y = _root.d._y;
if (!_root.d.blinking) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
};
}
who._visible = !who._visible;
who.blinkcv++;
if (who.blinkcv >= 70) {
who.blinking = false;
who._visible = true;
}
}
if (who.inv) {
who.invcv++;
if (who.invcv >= 15) {
who.invcv = 0;
who.inv = false;
}
}
if (!who.dead) {
who.powa = who.powa + who.regen;
if (who.powa > 100) {
who.powa = 100;
}
} else {
who.life = 0;
}
updateHUD();
if (!who.stoned) {
who.xvel = who.xvel * fric;
who.yvel = who.yvel + grav;
who._x = who._x + who.xvel;
who._y = who._y + who.yvel;
}
who.virtx = wrap._x + who._x;
who.virty = wrap._y + who._y;
who.rig = who.virtx + 15;
who.lef = who.virtx - 15;
who.topp = who.virty - 70;
while (wrap.bg.hitTest(who.virtx, who.topp, true)) {
who._y = who._y + 1;
who.virty = who.virty + 1;
who.topp = who.topp + 1;
if (who.yvel < 0) {
who.yvel = who.yvel * -1;
}
}
while (wrap.bg.hitTest(who.virtx, who.virty, true)) {
who._y = who._y - 1;
who.virty = who.virty - 1;
who.topp = who.topp - 1;
if (!who.squashed) {
who.hurt = false;
}
if (!who.jlo) {
who.yvel = 0;
who.jlo = false;
if (who.jumping && (who.life > 0)) {
if (!who.attacking) {
who.guts.gotoAndStop("landit");
} else {
jumpRecover(who);
}
}
}
if (who.life <= 0) {
if (!d.carrot) {
if (d.soundcount != 1) {
cannot.start();
d.soundcount = 1;
} else {
d.soundcount = 0;
resistance.start();
}
d.carrot = true;
}
d.hurt = false;
d.squashed = false;
who.guts.gotoAndStop("ground");
}
}
while (wrap.bg.hitTest(who.rig, who.virty - 25, true)) {
who.virtx = who.virtx - 1;
who._x = who._x - 1;
who.rig = who.rig - 1;
who.xvel = 0;
}
while (wrap.bg.hitTest(who.lef, who.virty - 25, true)) {
who.virtx = who.virtx + 1;
who._x = who._x + 1;
who.lef = who.lef + 1;
who.xvel = 0;
}
if (!wrap.bg.hitTest(who.virtx, who.virty + 20, true)) {
who.jumping = true;
}
}
function squashrecover(who) {
who.attacking = false;
who.squashed = false;
who.hurt = false;
who.guts.gotoAndStop("rest");
}
function controls(who) {
if (!who.attacking) {
if (Key.isDown(39)) {
who.xvel = who.xvel + who.speed;
who._xscale = 100;
if (!who.jumping) {
who.guts.gotoAndStop("run");
}
}
if (Key.isDown(37)) {
who.xvel = who.xvel - who.speed;
who._xscale = -100;
if (!who.jumping) {
who.guts.gotoAndStop("run");
}
}
if (((!Key.isDown(39)) && (!Key.isDown(37))) && (!who.jumping)) {
who.guts.gotoAndStop("rest");
}
if (Key.isDown(65)) {
if (who.powa > 3) {
who.charge = who.charge + 3;
if (who.charge > 9) {
who.powa = who.powa - 1;
}
}
if (who.charge > 400) {
who.charge = 400;
}
if (who.charge > 9) {
i = 0;
while (i < (who.charge / 25)) {
t = wrap.attachMovie("twinkle", "star" + starcv, starcv);
starcv++;
t._xscale = who.charge * 1.5;
if (t._xscale > 200) {
t._xscale = 200;
}
t.gotoAndPlay(random(3) + 1);
t._yscale = t._xscale;
t._x = who._x + (random(70) - 35);
t._y = who._y - random(100);
t.yvel = random(4);
t.xvel = random(6) - 3;
t.onEnterFrame = function () {
this._y = this._y - this.yvel;
if (!this.esc) {
this.yvel = this.yvel * 0.9;
this._alpha = this._alpha - 10;
} else {
this._alpha = this._alpha - 3;
this.yvel = this.yvel - 3;
}
this._x = this._x + this.xvel;
this.xvel = this.xvel * 0.9;
if ((_root.d.charge == 0) && (!this.esc)) {
this.xvel = this.xvel * 10;
this.yvel = this.yvel * random(20);
if (_root.d._xscale == 100) {
this._x = this._x + 90;
} else {
this._x = this._x - 90;
}
this.esc = true;
}
if (this._alpha <= 10) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
};
i++;
}
}
}
if (Key.isDown(65) && (who.aup)) {
who.attacking = true;
who.aup = false;
who.guts.gotoAndStop("attack" + who.anum);
who.anum = who.anum + 1;
if (who.anum == 3) {
who.anum = 0;
}
if (who.jumping) {
who.guts.gotoAndStop("airslash");
}
var sou = eval ("swin" + who.anum);
sou.start();
}
}
if (!Key.isDown(65)) {
if (who.charge > 9) {
who.guts.gotoAndStop("chargerelease");
who.attacking = true;
} else {
who.charge = 0;
}
who.aup = true;
}
if (!Key.isDown(83)) {
who.sup = true;
}
if (!Key.isDown(JUMPBUT)) {
who.jup = true;
}
if (Key.isDown(JUMPBUT)) {
if ((!who.jumping) && (who.jup)) {
who.jumping = true;
if (!who.attacking) {
who.guts.gotoAndStop("jumpload");
} else {
runJump(who);
}
who.jup = false;
who.jlo = true;
}
}
}
function makeFireball(who) {
flashIt();
who.biggun = false;
if (!who.biggun) {
f = wrap.attachMovie("special" + who.id, "fireball", 899);
discharge.start();
amt = who.charge * 0.5;
f._xscale = amt;
f._yscale = f._xscale;
if (who._xscale == 100) {
f.dir = 1;
f._x = who._x + 150;
} else {
f.dir = -1;
f._xscale = -amt;
f._x = who._x - 150;
}
f._y = who._y - 30;
f.onEnterFrame = function () {
this._x = this._x + (6 * this.dir);
testHit(this.hitzone, Math.abs(this._xscale / 90), this, true);
};
}
if (who.powa < 0) {
who.powa = 0;
}
who.charge = 0;
}
function flashIt() {
wrap.flasher.gotoAndPlay(2);
}
function testHit(box, amt, who, cl) {
if ((!summoning) && (!d.dead)) {
i = 0;
while (i < stones.length) {
var bh = stones[i];
if (bh.hitTest(box)) {
hit2.start();
bh.inair = true;
r = wrap.attachMovie("hitpoof", "poof" + starcv, starcv + 999999);
r._xscale = 70;
r._yscale = r._xscale;
if (who._xscale > 0) {
bh.xvel = bh.xvel + (7 + random(5));
} else {
bh.xvel = bh.xvel - (7 - random(5));
}
if (who._xscale > 0) {
var pg = 10;
bh._xscale = -100;
} else {
bh._xscale = 100;
pg = -10;
r._xscale = -70;
}
if (!cl) {
r._x = bh._x + pg;
var ix = r._x;
} else {
r._x = bh._x;
var ix = r._x;
}
r._y = bh._y - 55;
var iy = r._y;
bh.yvel = -13;
bh.juggle = bh.juggle + 1;
s = wrap.attachMovie("ptcounter", "pcount" + i, 8888888 + i);
s._x = ix;
s._y = iy;
s.pt = "+ " + bh.juggle;
s.cv = 0;
s.onEnterFrame = function () {
this._y = this._y - 2;
this.cv++;
if (this.cv >= 30) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
};
this.hitagravestone = true;
this.score = this.score + bh.juggle;
if ((bh.juggle >= 20) && (!juggler)) {
juggler = true;
}
}
i++;
}
if ((wrap.bad.hitarea.hitTest(box) && (!b.inv)) && (!b.finaldead)) {
var ra = random(3);
var plain = eval ("hit" + ra);
plain.start();
var rak = random(10);
if (rak > 7) {
rak = 1;
}
var gil = eval ("groan" + rak);
gil.start();
if ((wrap.bad.expirecv <= 0) || (wrap.bad.expirecv == undefined)) {
wrap.bad.pax = 1;
} else if (!cl) {
wrap.bad.pax = wrap.bad.pax + 1;
}
wrap.bad.expirecv = wrap.bad.maxexpire;
wrap.bad.gotoAndPlay("hit");
if ((!b.attacking) && (!b.nohit)) {
wrap.bad.guts.gotoAndStop("hit");
}
wrap.bad.life = wrap.bad.life - amt;
var dist = Math.abs(wrap.bad._x - who._x);
if (who._xscale > 0) {
wrap.bad.xvel = 7;
} else {
wrap.bad.xvel = -7;
}
if (!cl) {
if (who._xscale > 0) {
var ix = (who._x + 90);
} else {
var ix = (who._x - 90);
}
} else {
var ix = who._x;
}
iy = who._y - 40;
if (!b.predead) {
i = 0;
while (i < 4) {
j = wrap.attachMovie("bits" + i, "bit" + i, starcv);
starcv++;
j._x = ix + (random(20) - 10);
j._y = iy - (random(20) - 10);
j.xvel = random(20) - 10;
j.yvel = random(20) * -1;
j.onEnterFrame = function () {
this._x = this._x + this.xvel;
this._y = this._y + this.yvel;
this.xvel = this.xvel * 0.9;
this.yvel = this.yvel + grav;
if (this._y > 500) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
};
i++;
}
}
var num = (ncv - 1);
var turd = eval ("wrap.pcount" + num);
if (cl) {
var mult = Math.round(amt);
} else {
var mult = 0;
}
wrap.bad.pax = wrap.bad.pax + mult;
if (turd._x == undefined) {
s = wrap.attachMovie("ptcounter", "pcount" + ncv, 8888888 + ncv);
s._x = ix;
s._y = iy;
s.pt = "+ " + wrap.bad.pax;
s.prev = wrap.bad.pax;
s.cv = 0;
s.onEnterFrame = function () {
this._y = this._y - 2;
this.cv++;
if (this.cv >= 30) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
};
ncv++;
} else {
turd.pt = "+ " + wrap.bad.pax;
}
this.score = this.score + wrap.bad.pax;
if ((wrap.bad.pax >= 20) && (!juggler)) {
juggler = true;
}
}
}
}
function runSpecial(x, y, id, dir) {
flashIt();
sp = wrap.attachMovie("special" + id, "special", 999);
sp._x = x;
sp._y = y;
sp._xscale = 100 * dir;
sp.dir = dir;
sp.onEnterFrame = function () {
this._x = this._x + (dir * 3);
};
}
function hitRecover(who) {
if (!who.attacking) {
who.guts.gotoAndStop("rest");
}
}
function jumpRecover(who) {
who.jumping = false;
if (!who.attacking) {
who.guts.gotoAndStop("rest");
}
}
function runJump(who) {
who.yvel = -23;
who.jlo = false;
if (!who.attacking) {
who.guts.gotoAndStop("inair");
}
}
function momentum(who, amt) {
if (who._xscale == 100) {
who.xvel = who.xvel + amt;
} else {
who.xvel = who.xvel - amt;
}
}
function endAttack(who) {
who.attacking = false;
who.guts.gotoAndStop("rest");
who.jlo = false;
if (who.jumping) {
who.guts.gotoAndStop("inair");
}
if (Key.isDown(65) && (who.aup)) {
who.attacking = true;
who.aup = false;
if (who.jumping) {
who.anum = 1;
}
who.guts.gotoAndStop("attack" + who.anum);
who.anum = who.anum + 1;
if (who.anum == 3) {
who.anum = 0;
}
var sou = eval ("swin" + who.anum);
sou.start();
}
}
function centerOn(who) {
goalx = 320 - who._x;
distx = goalx - wrap._x;
wrap._x = wrap._x + (distx / 4);
}
function restrainBG() {
if (wrap._x > -25) {
wrap._x = -25;
}
var _local1 = (-screenw) + 650;
if (wrap._x < _local1) {
wrap._x = _local1;
}
}
function restrainDude(who) {
if (who._x < 70) {
who._x = 70;
who.xvel = 0;
}
if (who._x > (wrap.bg._width - 60)) {
who._x = wrap.bg._width - 60;
who.xvel = 0;
}
if (who._y < 60) {
who._y = 60;
}
}
function endBossAttack(who) {
who.attacking = false;
who.guts.gotoAndStop("rest");
who.inv = false;
who.overr = false;
}
function runEndEffects() {
d.dead = true;
}
function checkBossHit(box, fire, flame) {
if (!summoning) {
i = 0;
while (i < stones.length) {
var yi = stones[i];
if (box.hitTest(yi) && (!yi.hurt)) {
hit2.start();
r = wrap.attachMovie("hitpoof", "poof" + starcv, starcv + 999999);
starcv++;
r._xscale = 70;
r._x = yi._x;
r._y = yi._y - 30;
if (b._x > r._x) {
r._xscale = -70;
} else {
r._xscale = 70;
}
r._yscale = r._xscale;
yi.yvel = -20;
yi.hurt = true;
if (yi._x > b._x) {
yi.xvel = yi.xvel + 10;
yi._xscale = -100;
} else {
yi.xvel = yi.xvel - 10;
yi._xscale = 100;
}
}
i++;
}
if (((box.hitTest(d.guts.box) && (!d.hurt)) && (!d.dead)) && (!d.blinking)) {
d.inv = true;
var ra = random(3);
var plain = eval ("hit" + ra);
plain.start();
flashIt();
d.hurt = true;
if (!fire) {
d.guts.gotoAndStop("airhit");
d.yvel = -20;
}
if (fire) {
d.guts.gotoAndStop("burned");
d.yvel = -20;
}
if (flame) {
d.guts.gotoAndStop("burn");
d.yvel = -20;
}
d.life = d.life - 20;
if (!nox) {
if (d._x > b._x) {
d.xvel = 30;
d._xscale = -100;
} else {
d.xvel = -30;
d._xscale = 100;
}
if (b._xscale == -100) {
d.xvel = -35;
d._xscale = 100;
}
}
d.attacking = false;
d.jlo = false;
if (d.life <= 0) {
d.life = 0;
runEndEffects();
}
}
}
}
function makeInv() {
b.inv = true;
}
function bossMove() {
if (b.ploy == 1) {
if (!b.doneit) {
b.pattern = 2;
b.doneit = true;
} else if (!b.dunn) {
b.pattern = 4;
if (!b.laffed) {
laugh.start();
b.laffed = true;
} else {
b.laffed = false;
nochance.start();
}
b.dunn = true;
} else {
b.pattern = 4;
}
b.aicv = 0;
b._xscale = 100;
}
if (b.ploy == 0) {
b.ploy = 1;
}
}
function switchBoss() {
flashIt();
bgmusic.stop();
if (!this.mute) {
bgmusic2.start(0, 999);
}
this.bgmuse2 = true;
kl = wrap.attachMovie("bigsplode", "sploder", 569648999);
kl._x = b._x;
kl._y = b._y;
b.nohit = true;
b.guts.gotoAndStop("skull");
b.skullit = true;
}
function skullChange() {
b.guts.gotoAndStop("skull");
}
function makeFireballzRight() {
fireballsound.start();
fireballsound.start();
flashIt();
f = wrap.attachMovie("fireball", "mball" + starcv, starcv);
starcv++;
f._x = b._x + 20;
f._y = b._y + 45;
f.onEnterFrame = function () {
if (!_root.pausy) {
this._x = this._x + 10;
checkBossHit(this.box, false, true);
if (this._x > 2800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y > 800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y < -300) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
f = wrap.attachMovie("fireball", "mball" + starcv, starcv);
starcv++;
f._x = b._x - 20;
f._y = b._y + 45;
f._xscale = -100;
f.onEnterFrame = function () {
if (!_root.pausy) {
this._x = this._x - 10;
checkBossHit(this.box, false, true);
if (this._x > 2800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y > 800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y < -300) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
f = wrap.attachMovie("fireball", "fball" + starcv, starcv);
starcv++;
f._x = b._x + 20;
f._y = b._y + 25;
f._rotation = -45;
f.onEnterFrame = function () {
if (!_root.pausy) {
checkBossHit(this.box, false, true);
this._x = this._x + 10;
this._y = this._y - 10;
if ((this._x > 2800) || (this._x < 0)) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y > 800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y < -300) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
f = wrap.attachMovie("fireball", "fball" + starcv, starcv);
starcv++;
f._x = b._x - 20;
f._y = b._y + 25;
f._rotation = 45;
f._xscale = -100;
f.onEnterFrame = function () {
if (!_root.pausy) {
checkBossHit(this.box, false, true);
this._x = this._x - 10;
this._y = this._y - 10;
if ((this._x > 2800) || (this._x < 0)) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y > 800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y < -300) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
f = wrap.attachMovie("fireball", "fball" + starcv, starcv);
starcv++;
f._x = b._x + 20;
f._y = b._y + 65;
f._rotation = 45;
f.onEnterFrame = function () {
if (!_root.pausy) {
checkBossHit(this.box, false, true);
this._x = this._x + 10;
this._y = this._y + 10;
if ((this._x > 2800) || (this._x < 0)) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y > 800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y < -300) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
f = wrap.attachMovie("fireball", "fball" + starcv, starcv);
starcv++;
f._x = b._x - 20;
f._y = b._y + 65;
f._rotation = -45;
f._xscale = -100;
f.onEnterFrame = function () {
if (!_root.pausy) {
checkBossHit(this.box, false, true);
this._x = this._x - 10;
this._y = this._y + 10;
if ((this._x > 2800) || (this._x < 0)) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y > 800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y < -300) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
f = wrap.attachMovie("fireball", "fball" + starcv, starcv);
starcv++;
f._x = b._x;
f._y = b._y + 65;
f._rotation = 90;
f._xscale = 100;
f.onEnterFrame = function () {
if (!_root.pausy) {
checkBossHit(this.box, false, true);
this._y = this._y + 10;
if (this._y > 800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
if (this._y < -300) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
}
function winIt() {
nomorelevelup = true;
_root.runAchieve(3);
if (kongtime < 8160) {
_root.runAchieve(2);
}
if (!hitagravestone) {
_root.runAchieve(4);
}
if (!lostalife) {
_root.runAchieve(5);
}
if (!d.jumping) {
d.guts.gotoAndStop("rest");
}
go = this.attachMovie("winscreen", "winner", 998799);
go.aup = false;
pausy = true;
won = true;
}
function winPresses() {
go = this.winner;
go.onEnterFrame = function () {
if (!Key.isDown(65)) {
this.aup = true;
}
if (Key.isDown(65) && (this.aup)) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
delete this.onPress;
_root.gotoAndStop(2);
}
};
}
function ai() {
if (!b.finaldead) {
if ((wrap.flasher._currentframe != 1) && (!pausy)) {
wrap.flasher.play();
}
if ((b.life <= 0) && (!b.predead)) {
b.home = b._x;
b.predead = true;
b.inv = true;
b.tranny = true;
b.guts.gotoAndStop("die0");
}
if (((b.life < 0) && (b.predead)) && (!b.tranny)) {
stopAllSounds();
b.guts.gotoAndStop("die1");
death.start();
b.finaldead = true;
}
if ((b.predead && (b.inv)) && (!b.skullit)) {
if (b.rig) {
b.rig = false;
b._x = b.home + 5;
} else {
b.rig = true;
b._x = b.home - 5;
}
}
if (b.skullit) {
if (b.life < 60) {
b.maxlife = 60;
b.life = b.life + 2;
} else if (!b.boogah) {
b.tranny = false;
b.inv = false;
b.endbattle = true;
b.boogah = true;
b.skullit = false;
b.aicv = 0;
}
}
if (b.endbattle) {
b.chasex = false;
b.chasey = false;
if (((!b.goright) && (!b.gocenter)) || (b.goleft)) {
goalx = 190;
goaly = 200;
b.goleft = true;
}
if (b.goright) {
goalx = 1220;
goaly = 200;
}
if (b.gocenter) {
goalx = 600;
goaly = 100;
}
distx = goalx - b._x;
disty = goaly - b._y;
b.xvel = b.xvel + (distx / 105);
b.yvel = b.yvel + (disty / 105);
tax = Math.abs(distx);
tay = Math.abs(disty);
if ((tax < 70) && (tay < 70)) {
b.aicv++;
if ((b.aicv > 15) && (!b.finaldead)) {
b.guts.gotoAndStop("fireballz");
}
if ((b.aicv >= 30) && (!b.finaldead)) {
b.endbattle = false;
b.waiting = true;
b.aicv = 0;
if (b._x < 400) {
makeFireballzRight();
}
if ((b._x > 400) && (b._x < 1000)) {
makeFireballzRight();
}
if (b._x > 1000) {
makeFireballzRight();
}
}
}
}
if (b.waiting) {
b.aicv++;
if (b.aicv > 50) {
b.waiting = false;
b.endbattle = true;
b.inv = false;
if (b.goright) {
b.goleft = false;
b.gocenter = true;
b.goright = false;
return(undefined);
}
if (b.goleft) {
b.goleft = false;
b.gocenter = false;
b.goright = true;
return(undefined);
}
if (b.gocenter) {
b.goleft = true;
b.gocenter = false;
b.goright = false;
return(undefined);
}
}
}
if (!b.predead) {
if (b.pattern == 6) {
b.aicv++;
if (b.aicv >= 70) {
b.doneit = false;
b.dunn = false;
b.pattern = 0;
b.aicv = 0;
}
}
if (b.pattern == 5) {
h = wrap.attachMovie("hairball0", "ball1", 889987666);
h.box.heavy = true;
h._x = 200 + (random(200) - 100);
h._y = -100;
h.yvel = 0;
h.hitit = false;
h.onEnterFrame = function () {
if (!_root.pausy) {
if (!this.gothim) {
_root.checkBossHit(this.box);
}
if (this.box.hitTest(d.guts.box)) {
this.gothim = true;
}
this._y = this._y + this.yvel;
this.yvel = this.yvel + (grav * 0.7);
this.virtx = this._x + wrap._x;
this.virty = this._y + wrap._y;
if (!this.hitit) {
while (wrap.bg.hitTest(this.virtx, this.virty, true)) {
this._y = this._y - 1;
this.virty = this.virty - 1;
this.yvel = -10;
this.hitit = true;
}
if (this.hitit) {
groundhit.start();
}
}
if (this.virty > 800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
h = wrap.attachMovie("hairball0", "ball0", 889987665);
h.box.heavy = true;
h._x = 400 + (random(200) - 100);
h._y = -150;
h.yvel = 0;
h.hitit = false;
h.onEnterFrame = function () {
if (!_root.pausy) {
if (!this.gothim) {
_root.checkBossHit(this.box);
}
if (this.box.hitTest(d.guts.box)) {
this.gothim = true;
}
this._y = this._y + this.yvel;
this.yvel = this.yvel + (grav * 0.7);
this.virtx = this._x + wrap._x;
this.virty = this._y + wrap._y;
if (!this.hitit) {
while (wrap.bg.hitTest(this.virtx, this.virty, true)) {
this._y = this._y - 1;
this.virty = this.virty - 1;
this.yvel = -10;
this.hitit = true;
}
if (this.hitit) {
groundhit.start();
}
}
if (this.virty > 800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
h = wrap.attachMovie("hairball0", "ball3", 889987667);
h.box.heavy = true;
h._x = 650 + (random(200) - 100);
h._y = -190;
h.yvel = 0;
h.hitit = false;
h.onEnterFrame = function () {
if (!_root.pausy) {
if (!this.gothim) {
_root.checkBossHit(this.box);
}
if (this.box.hitTest(d.guts.box)) {
this.gothim = true;
}
this._y = this._y + this.yvel;
this.yvel = this.yvel + (grav * 0.7);
this.virtx = this._x + wrap._x;
this.virty = this._y + wrap._y;
if (!this.hitit) {
while (wrap.bg.hitTest(this.virtx, this.virty, true)) {
this._y = this._y - 1;
this.virty = this.virty - 1;
this.yvel = -10;
this.hitit = true;
}
if (this.hitit) {
groundhit.start();
}
}
if (this.virty > 800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
h = wrap.attachMovie("hairball0", "ball4", 889987669);
h.box.heavy = true;
h._x = 1000 + (random(200) - 100);
h._y = -100;
h.yvel = 0;
h.hitit = false;
h.onEnterFrame = function () {
if (!_root.pausy) {
if (!this.gothim) {
_root.checkBossHit(this.box);
}
if (this.box.hitTest(d.guts.box)) {
this.gothim = true;
}
this._y = this._y + this.yvel;
this.yvel = this.yvel + (grav * 0.7);
this.virtx = this._x + wrap._x;
this.virty = this._y + wrap._y;
if (!this.hitit) {
while (wrap.bg.hitTest(this.virtx, this.virty, true)) {
this._y = this._y - 1;
this.virty = this.virty - 1;
this.yvel = -10;
this.hitit = true;
}
if (this.hitit) {
groundhit.start();
}
}
if (this.virty > 800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
h = wrap.attachMovie("hairball0", "ball5", 889987670);
h.box.heavy = true;
h._x = 1290 + (random(200) - 100);
h._y = -150;
h.yvel = 0;
h.hitit = false;
h.onEnterFrame = function () {
if (!_root.pausy) {
if (!this.gothim) {
_root.checkBossHit(this.box);
}
if (this.box.hitTest(d.guts.box)) {
this.gothim = true;
}
this._y = this._y + this.yvel;
this.yvel = this.yvel + (grav * 0.7);
this.virtx = this._x + wrap._x;
this.virty = this._y + wrap._y;
if (!this.hitit) {
while (wrap.bg.hitTest(this.virtx, this.virty, true)) {
this._y = this._y - 1;
this.virty = this.virty - 1;
this.yvel = -10;
this.hitit = true;
}
if (this.hitit) {
groundhit.start();
}
}
if (this.virty > 800) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
}
}
};
b.aicv = 0;
b.pattern = 6;
}
if (b.pattern == 4) {
b.above = true;
goalx = 660;
goaly = -300;
distx = goalx - b._x;
disty = goaly - b._y;
b.xvel = b.xvel + (distx / 75);
b.yvel = b.yvel + (disty / 295);
tay = Math.abs(disty);
if (tay < 80) {
b.pattern = 5;
b.aicv = 0;
}
}
if (b.pattern == 1) {
b.chasex = false;
b.chasey = false;
if (b.side == 0) {
if (b.ploy == 0) {
goalx = 150;
goaly = 150;
}
if (b.ploy == 1) {
goalx = 150;
goaly = 400;
}
}
if (b.side == 1) {
if (b.ploy == 0) {
goalx = 1300;
goaly = 150;
}
if (b.ploy == 1) {
goalx = 1300;
goaly = 400;
}
}
if (!b.attacking) {
distx = goalx - b._x;
disty = goaly - b._y;
b.xvel = b.xvel + (distx / 95);
b.yvel = b.yvel + (disty / 95);
tax = Math.abs(distx);
tay = Math.abs(disty);
if ((tax < 90) && (tay < 90)) {
b.attacking = true;
b.guts.gotoAndStop("attack2");
if (b.side == 1) {
b._xscale = -100;
}
}
}
}
if (((b.pattern == 0) || (b.pattern == 2)) || (b.pattern == 3)) {
b.aicv++;
if (b.aicv >= 230) {
b.aicv = 0;
b.chasex = false;
b.chasey = false;
b.ploy = 0;
if (b.pattern == 0) {
b.side = 0;
} else if (b.side == 0) {
b.side = 1;
} else {
b.side = 0;
}
b.pattern = 1;
}
b.distx = d._x - b._x;
b.disty = d._y - (b._y + 150);
b.dist = Math.sqrt((b.distx * b.distx) + (b.disty * b.disty));
if (!d.hurt) {
if (!b.attacking) {
if (b.dist > 220) {
b.chasex = true;
b.chasey = true;
} else {
b.chasex = false;
b.deccount = b.deccount + 1;
if (b.deccount >= 50) {
b.deccount = 0;
b.attacking = true;
var _local5 = Math.abs(b.distx);
if ((_local5 > 120) || (b.disty > 70)) {
b.guts.gotoAndStop("attack0");
} else {
b.guts.gotoAndStop("attack1");
b.overr = true;
}
}
}
}
if (b.overr) {
b.xvel = b.xvel + (b.distx / 72);
}
} else {
var _local4 = 650 - b._x;
var _local3 = 80 - b._y;
b.xvel = b.xvel + (_local4 / 50);
b.yvel = b.yvel + (_local3 / 50);
}
}
}
}
}
function loseLife() {
this.lives--;
this.lostalife = true;
if (this.lives > 0) {
d.carrot = false;
gs = this.wrap.attachMovie("gstone", ("gstone" + stones.length) + 1, (99555 + stones.length) + 1);
gs._x = d._x;
gs._y = d._y;
gs._xscale = d._xscale;
gs.gotoAndStop(37);
gs.xvel = 0;
gs.yvel = 0;
stones.push(gs);
d.guts.gotoAndStop("rest");
d.hurt = false;
d.dead = false;
d.stoned = false;
d.xvel = 0;
d.yvel = 0;
d._x = 220;
d._y = 120;
d._xscale = 100;
d.blinking = true;
d.life = 100;
d.powa = 0;
d.attacking = false;
d.jumping = false;
d.jlo = false;
d.charge = 0;
d.blinkcv = 0;
} else {
stones.push(d);
stopAllSounds();
if (!this.grover) {
nothing.start();
this.grover = true;
}
go = this.attachMovie("gameover", "gameover", 99);
go.aup = false;
}
}
function showOver() {
nomorelevelup = true;
pausy = true;
go = this.gameover;
go.onPress = function () {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
delete this.onPress;
_root.gotoAndStop(2);
};
go.onEnterFrame = function () {
if (!Key.isDown(65)) {
this.aup = true;
}
if (Key.isDown(65) && (this.aup)) {
this.unloadMovie();
this.removeMovieClip();
delete this.onEnterFrame;
delete this.onPress;
_root.gotoAndStop(2);
}
};
}
function gameOver() {
}
function aifuncs() {
b._y = b._y + b.yvel;
b.yvel = b.yvel * 0.8;
b.xvel = b.xvel * 0.8;
if (b.expirecv > 0) {
b.expirecv = b.expirecv - 1;
}
var _local3 = b.guts.e0;
var _local2 = b.guts.e1;
if (b._xscale < 0) {
mult = -1;
} else {
mult = 1;
}
_local3.distx = d._x - ((b._x + b.guts._x) + _local3._x);
_local3.disty = d._y - ((b._y + b.guts._y) + _local3._y);
_local3.rads = Math.atan2(_local3.disty, _local3.distx * mult);
_local3._rotation = (_local3.rads * 180) / Math.PI;
_local2.distx = d._x - ((b._x + b.guts._x) + _local2._x);
_local2.disty = d._y - ((b._y + b.guts._y) + _local2._y);
_local2.rads = Math.atan2(_local2.disty, _local2.distx * mult);
_local2._rotation = (_local2.rads * 180) / Math.PI;
if (b.chasex) {
var _local7 = d._x - b._x;
b.xvel = b.xvel + (_local7 / 155);
}
var _local5 = b._x + b.xvel;
if (b.chasey) {
var _local6 = d._y - (b._y + 150);
b.yvel = b.yvel + (_local6 / 155);
}
if ((b._y < 100) && (!b.above)) {
b._y = 100;
}
var _local4 = _local5 - b._x;
b._x = _local5;
i = 0;
while (i < stones.length) {
var _local1 = stones[i];
if (p.hitTest(_local1)) {
_local1._x = _local1._x + _local4;
}
i++;
}
if (p.hitTest(d)) {
d._x = d._x + _local4;
}
p._x = b._x - 320;
p._y = b._y - 20;
}
function stonePhys() {
i = 0;
while (i < stones.length) {
var _local1 = stones[i];
_local1.virtx = wrap._x + _local1._x;
_local1.virty = wrap._y + _local1._y;
_local1._y = _local1._y + _local1.yvel;
_local1._x = _local1._x + _local1.xvel;
var _local2 = Math.abs(_local1.xvel);
if (_local2 < 1) {
_local1.xvel = 0;
}
_local1.xvel = _local1.xvel * 0.8;
_local1.yvel = _local1.yvel + grav;
_local1.virty = _local1.virty + _local1.yvel;
_local1.topp = _local1.virty - _local1._height;
while (wrap.bg.hitTest(_local1.virtx, _local1.topp, true)) {
_local1._y = _local1._y + 1;
_local1.virty = _local1.virty + 1;
_local1.topp = _local1.topp + 1;
_local1.yvel = 5;
}
while (wrap.bg.hitTest(_local1.virtx, _local1.virty, true)) {
_local1._y = _local1._y - 1;
_local1.virty = _local1.virty - 1;
_local1.yvel = 0;
_local1.inair = false;
_local1.juggle = 0;
_local1.hurt = false;
}
i++;
}
}
JUMPBUT = 38;
this.kongtime = 0;
this.hitagravestone = false;
this.juggler = false;
this.breadhit = false;
this.lostalife = false;
this.mute = false;
this.bgmuse2 = false;
this.pdiddy._visible = false;
this.pausy = false;
this.summoning = false;
this.grover = false;
wrap.bg.plat.unloadMovie();
wrap.bg.plat.removeMovieClip();
nomorelevelup = false;
slowmult = 1;
this.lives = 3;
grav = 2;
fric = 0.75;
this.ncv = 0;
screenw = wrap.bg._width - 50;
this.score = 0;
this.lev = 0;
this.levreqs = new Array(100, 250, 650, 950);
this.nex = levreqs[0];
this.starcv = 0;
hud.holder.guts.attachMovie("levicon" + this.lev, "guts", 0);
stones = new Array();
i = 0;
while (i < 4) {
gs = this.wrap.attachMovie("gstone", "gstone" + i, 99555 + i);
gs._x = random(1250) + 70;
while ((!wrap.bg.hitTest(gs._x, gs._y, true)) || (gs.hitTest(wrap.bg.plat))) {
gs._y = gs._y + 1;
}
var sc = random(2);
if (sc == 0) {
gs._xscale = 100;
} else {
gs._xscale = -100;
}
gs.gotoAndStop(37);
gs.xvel = 0;
gs.yvel = 0;
stones.push(gs);
i++;
}
d = wrap.dude;
d.invcv = 0;
d.blinkcv = 0;
d.blinking = true;
d.anum = 0;
d.regen = 0.1;
d.charge = 0;
d.chargelim = 20;
dudes = new Array(3, 1, 2, 0, 4);
d.attachMovie("k" + dudes[this.lev], "guts", 0);
d.id = dudes[this.lev];
d.speed = 4;
d.life = 100;
d.maxlife = 100;
d.powa = 0;
d.xvel = 0;
d.yvel = 0;
d.hurtcv = 0;
b = wrap.bad;
b.life = 130;
b.maxlife = b.life;
b.maxexpire = 20;
b.xvel = 0;
b.yvel = 0;
b.deccount = 0;
b.pattern = 0;
b.aicv = 0;
b.inv = false;
b.finaldead = false;
b.predead = false;
b.pattern = 0;
b.dunn = false;
b.aicv = 0;
b.skullit = false;
b.home = undefined;
b.boogah = false;
b.endbattle = false;
b.chasex = false;
b.chasey = false;
b.gocenter = false;
b.goleft = true;
b.goright = false;
b.waiting = false;
b.above = false;
b.side = 0;
b.attacking = false;
b.overr = false;
b.nohit = false;
won = false;
p = wrap.bg.plat;
updateHUD();
eyesc = b.guts.e0._xscale;
this.onEnterFrame = function () {
if (!this.pausy) {
this.kongtime++;
ai();
aifuncs();
if ((!d.hurt) && (!d.dead)) {
controls(d);
}
phys(d);
stonePhys();
if (!b.finaldead) {
centerOn(d);
} else {
centerOn(b);
}
restrainBG();
restrainDude(d);
}
if (!Key.isDown(77)) {
this.mib = true;
}
if (Key.isDown(77) && (this.mib)) {
this.mib = false;
if (!this.mute) {
this.mute = true;
if (this.bgmuse2) {
bgmusic2.stop();
} else {
bgmusic.stop();
}
} else {
this.mute = false;
if (this.bgmuse2) {
bgmusic2.start(0, 999);
} else {
bgmusic.start(0, 999);
}
}
}
if (!Key.isDown(80)) {
this.pawup = true;
}
if ((((Key.isDown(80) && (this.pawup)) && (!d.dead)) && (!won)) && (this.gameover._x == undefined)) {
if (this.paws) {
this.pdiddy._visible = false;
this.paws = false;
this.pausy = false;
pausesound.start();
b.guts.innards.play();
} else if (!this.pausy) {
pausesound.start();
this.pdiddy._visible = true;
this.paws = true;
this.pausy = true;
b.guts.innards.stop();
wrap.flasher.stop();
d.attacking = false;
if (!d.jumping) {
d.guts.gotoAndStop("rest");
}
}
this.pawup = false;
}
if (!Key.isDown(82)) {
this.rup = true;
}
if (((Key.isDown(82) && (this.rup)) && (!won)) && (this.gameover._x == undefined)) {
lup.unloadMovie();
lup.removeMovieClip();
_root.gotoAndStop(2);
}
};
Symbol 29 MovieClip [special2] Frame 23
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 112 MovieClip [summon] Frame 52
_root.switchGuy();
Symbol 112 MovieClip [summon] Frame 77
this.unloadMovie();
this.removeMovieClip();
stop();
Symbol 124 MovieClip Frame 1
stop();
Symbol 151 MovieClip Frame 1
stop();
Symbol 151 MovieClip Frame 100
stop();
Symbol 159 MovieClip Frame 1
stop();
Symbol 159 MovieClip Frame 8
stop();
Symbol 172 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 180 MovieClip Frame 1
com.Newgrounds.NewgroundsAPI.attachFlashAd(_parent[_name]);
var attachAd = function () {
com.Newgrounds.NewgroundsAPI.attachFlashAd(_parent[_name]);
};
com.Newgrounds.NewgroundsAPI.addEventListener(com.Newgrounds.NewgroundsAPI.events.ADS_APPROVED, attachAd);
background._visible = false;
Symbol 181 MovieClip Frame 1
Symbol 184 MovieClip Frame 1
eyes._visible = false;
cv = 0;
this.onEnterFrame = function () {
bt = _root.getBytesTotal();
bl = _root.getBytesLoaded();
perc = Math.floor((bl / bt) * 100);
beams._alpha = (bl / bt) * 100;
head.gotoAndStop(perc);
this.sho = perc + "%";
if (perc == 100) {
if (!this.dunn) {
flashit.gotoAndPlay(2);
this.dunn = true;
}
sho = "PRESS A";
cv++;
if (cv >= 20) {
eyes._visible = true;
soundit.gotoAndPlay(1);
delete this.onEnterFrame;
dabut.onPress = function () {
thebeard.start();
delete this._parent.onEnterFrame;
delete this.onEnterFrame;
_root.gotoAndStop(2);
};
this.onEnterFrame = function () {
if (Key.isDown(65)) {
thebeard.start();
delete this.onEnterFrame;
_root.gotoAndStop(2);
}
};
}
}
};
Symbol 198 MovieClip Frame 1
function unlockMedal(m_name) {
clearInterval(pop_delay);
var _local1 = com.Newgrounds.NewgroundsAPI.getMedals();
var _local2 = null;
for (i in _local1) {
if (_local1[i].medal_name == m_name) {
_local2 = _local1[i];
medal_name = _local2.medal_name;
medal_value = _local2.medal_value + "pts";
pop_delay = setInterval(endDelay, 3000);
_visible = true;
gotoAndPlay (2);
break;
}
}
}
function endDelay(params) {
gotoAndPlay (10);
clearInterval(pop_delay);
}
var pop_delay;
var medal_name = "?????";
var medal_value = "???";
_visible = false;
Symbol 198 MovieClip Frame 10
var myBitmapData = flash.display.BitmapData.loadBitmap(medal_name + ".gif");
medal_icon.attachBitmap(myBitmapData, 111);
stop();
Symbol 201 Button
on (release) {
this._visible = false;
}
Symbol 208 MovieClip Frame 1
_visible = false;
var checkConnection = function (event) {
if (!event.success) {
_visible = true;
gotoAndStop (3);
}
};
if (com.Newgrounds.NewgroundsAPI.isNewgrounds() || (_root.API_Settings.debug_mode)) {
com.Newgrounds.NewgroundsAPI.addEventListener(com.Newgrounds.NewgroundsAPI.events.MOVIE_CONNECTED, checkConnection);
if ((!com.Newgrounds.NewgroundsAPI.hasUserSession()) && (!_root.API_Settings.debug_mode)) {
_visible = true;
gotoAndStop (2);
}
}
com.Newgrounds.NewgroundsAPI.setMovieVersion(_root.API_Settings.movie_version);
com.Newgrounds.NewgroundsAPI.connectMovie(_root.API_Settings.movie_id, _root.API_Settings.enc_key, _root.API_Settings.debug_mode);
com.Newgrounds.NewgroundsAPI.loadMedals();
stop();
Symbol 1477 MovieClip [__Packages.com.Newgrounds.BaseN] Frame 0
class com.Newgrounds.BaseN
{
var ceiling, hashIndex, bitSize, hashVal, i;
function BaseN (hash) {
ceiling = 100000000000000;
if (hash) {
hashIndex = hash;
} else {
hashIndex = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
}
bitSize = hashIndex.length;
hashVal = new Object();
i = 0;
while (i < bitSize) {
hashVal[hashIndex.charAt(i)] = i;
i++;
}
}
function verify(s) {
if (hashVal[s] != undefined) {
return(true);
}
return(false);
}
function encode(n, minchars) {
debug.lastencode = "";
if (typeof(i) != "string") {
n = n.toString();
}
if (n.charAt(0) == "-") {
var _local3 = "-";
n = n.substring(1);
} else {
var _local3 = "";
}
if (String(n).indexOf(".") > -1) {
var _local4 = String(n).split(".", 2);
return(((_local3 + baseNEncoder(_local4[0], minchars)) + ".") + baseNEncoder(_local4[1]));
}
debug.lastencode = debug.lastencode + "\tNo decimal\r";
return(_local3 + baseNEncoder(n, minchars));
}
function decode(s) {
var _local4 = 1;
if (s.charAt(0) == "-") {
_local4 = -1;
s = s.substring(1, s.length);
}
var _local3 = s.indexOf(".");
if (_local3 > -1) {
var _local5 = Math.pow(10, baseNDecoder(s.substring(_local3 + 1, s.length)));
return((baseNDecoder(s.substring(0, _local3)) / _local5) * _local4);
}
return(baseNDecoder(s) * _local4);
}
function baseNEncoder(n, minchars) {
if (!minchars) {
minchars = 1;
}
var _local4 = "";
while (n != 0) {
n = Math.round(n);
var _local3 = n % bitSize;
if (Math.round(_local3) != _local3) {
}
_local4 = hashIndex.charAt(_local3) + _local4;
debug.lastencode = debug.lastencode + (((((((("\t-> n:" + n) + " % bitSize:") + bitSize) + " = ") + _local3) + ", final char=") + _local4) + newline);
n = n - _local3;
n = n / bitSize;
}
if (minchars) {
while (_local4.length < minchars) {
_local4 = hashIndex.charAt(0) + _local4;
}
}
return(_local4);
}
function baseNDecoder(s) {
var _local2 = 0;
var _local6 = 0;
i = 0;
while (i < s.length) {
var _local3 = s.charAt((s.length - i) - 1);
if (_local3 == hashIndex.charAt(0)) {
var _local5 = 0;
} else {
var _local5 = hashVal[_local3] * Math.pow(bitSize, i);
}
_local2 = _local2 + _local5;
if (_local2 >= ceiling) {
_local6 = _local6 + ((_local2 - (_local2 % ceiling)) / ceiling);
_local2 = _local2 % ceiling;
}
i++;
}
if (_local6 > 0) {
_local2 = "" + _local2;
while (_local2.length < (ceiling.toString().length - 1)) {
_local2 = "0" + _local2;
}
_local2 = ("" + _local6) + _local2;
}
return(_local2);
}
var debug = new Object();
}
Symbol 1478 MovieClip [__Packages.com.Newgrounds.NewgroundsAPIError] Frame 0
class com.Newgrounds.NewgroundsAPIError
{
var message, name, alias;
function NewgroundsAPIError (error, msg) {
if (Number(error).toString() == String(error)) {
error = Number(error);
} else if (error_codes[String(error)]) {
error = error_codes[String(error)];
} else {
error = 0;
}
code = error;
message = msg;
name = error_names[error];
alias = aliases[error];
}
static function init_codes() {
var _local2 = new Object();
var _local1 = 0;
while (_local1 < aliases.length) {
_local2[aliases[_local1]] = _local1;
_local1++;
}
return(_local2);
}
static function init_names() {
var _local5 = new Array();
var _local3 = 0;
while (_local3 < aliases.length) {
var _local2 = aliases[_local3].toLowerCase().split("_");
var _local1 = 0;
while (_local1 < _local2.length) {
_local2[_local1] = _local2[_local1].substr(0, 1).toUpperCase() + _local2[_local1].substr(1, _local2[_local1].length);
for (var _local4 in always_caps) {
if (_local2[_local1].toUpperCase() == always_caps[_local4]) {
_local2[_local1] = _local2[_local1].toUpperCase();
}
}
_local1++;
}
_local5[_local3] = _local2.join(" ");
_local3++;
}
return(_local5);
}
function isError() {
return(true);
}
static var aliases = new Array("UNKNOWN_ERROR", "INVALID_API_ID", "MISSING_PARAM", "INVALID_STAT_ID", "INVALID_COMMAND_ID", "FLASH_ADS_NOT_APPROVED", "PERMISSION_DENIED", "IDENTIFICATION_REQUIRED", "INVALID_EMAIL_ADDRESS", "BANNED_USER", "SESSION_EXPIRED", "INVALID_SCORE", "INVALID_MEDAL", "INVALID_FOLDER", "FILE_NOT_FOUND", "SITE_ID_REQUIRED", "UPLOAD_IN_PROGRESS", "USER_CANCELLED", "CONFIRM_REQUEST", "CONNECTION_FAILED");
static var always_caps = new Array("API", "URL", "ID");
static var error_codes = init_codes();
static var error_names = init_names();
var code = 0;
}
Symbol 1479 MovieClip [__Packages.com.Newgrounds.NewgroundsAPI] Frame 0
class com.Newgrounds.NewgroundsAPI
{
static var version, user_email, movie_id, debug, session_id, publisher_id, timeout, connected, tracker_id, encryption_key, user_id, user_name, host, error_format, normal_format, link_format, header_format, ad_url, ad_swf_url;
function NewgroundsAPI () {
}
static function setMovieVersion(v) {
if (v) {
version = String(v);
}
}
static function setUserEmail(e) {
user_email = e;
}
static function getOfficialVersionURL() {
var _local1 = (((((GATEWAY_URL + "?tracker_id=") + movie_id) + "&command_id=") + getCommandID("loadOfficalVersion")) + "&seed=") + Math.random();
if (debug) {
_local1 = _local1 + "&debug=1";
}
return(_local1);
}
static function hasUserSession() {
if (session_id && (publisher_id)) {
return(true);
}
if (_root.NewgroundsAPI_PublisherID && (_root.NewgroundsAPI_SessionID)) {
return(true);
}
return(false);
}
static function isNewgrounds() {
return(((publisher_id == 1) || (_root.NewgroundsAPI_PublisherID == 1)) || (getHost().toLowerCase().indexOf("ungrounded.net") > -1));
}
static function hasPublisher() {
return(publisher_id || (_root.NewgroundsAPI_PublisherID));
}
static function hasUserEmail() {
if (user_email) {
return(true);
}
return(false);
}
static function connectionTimeOut() {
clearInterval(timeout);
callListener(events.MOVIE_CONNECTED, false, new com.Newgrounds.NewgroundsAPIError("CONNECTION_FAILED", "Connection to NewgroundsAPI gateway timed out."));
}
static function connectMovie(m_id, encrypt_key, debug_mode) {
if (connected) {
return(undefined);
}
var _local2 = function () {
com.Newgrounds.NewgroundsAPI.connectionTimeOut();
};
timeout = setInterval(_local2, 8000, null);
if (!m_id) {
fatalError("NewgroundsAPI.connectMovie() - missing required movie_id parameter", "connectMovie");
}
movie_id = String(m_id);
tracker_id = Number(movie_id.substring(0, movie_id.indexOf(":")));
encryption_key = encrypt_key;
debug = debug_mode;
if (_root.NewgroundsAPI_PublisherID) {
publisher_id = _root.NewgroundsAPI_PublisherID;
if (_root.NewgroundsAPI_SessionID) {
session_id = _root.NewgroundsAPI_SessionID;
}
} else {
publisher_id = 1;
session_id = null;
user_id = 0;
user_name = "Guest";
}
if (_root.NewgroundsAPI_UserName) {
user_name = _root.NewgroundsAPI_UserName;
}
if (_root.NewgroundsAPI_UserID) {
user_id = _root.NewgroundsAPI_UserID;
}
connected = true;
sendCommand("connectMovie", {host:getHost(), movie_version:version});
}
static function getHost() {
if (!host) {
var _local1 = _url;
if ((_local1.indexOf("http://") > -1) or (_local1.indexOf("https://") > -1)) {
host = _local1.split("/")[2].toLowerCase();
} else {
host = "localhost";
}
}
return(host);
}
static function loadNewgrounds() {
sendCommand("loadNewgrounds", {host:getHost()}, true);
}
static function loadMySite() {
sendCommand("loadMySite", {host:getHost()});
}
static function loadCustomLink(link) {
sendCommand("loadCustomLink", {host:getHost(), link:link}, true);
}
static function logCustomEvent(event) {
sendCommand("logCustomEvent", {host:getHost(), event:event});
}
static function postScore(score, value, get_best) {
if ((!score) or (value == undefined)) {
sendError({command_id:getCommandID("postScore")}, new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", "missing required parameter(s)"));
return(undefined);
}
sendSecureCommand("postScore", {score:score, value:value, get_best:get_best});
}
static function getTodaysScores(score, params) {
getScores(score, "t", params, "getTodaysScores");
}
static function getYesterdaysScores(score, params) {
getScores(score, "y", params, "getYesterdaysScores");
}
static function getThisWeeksScores(score, params) {
getScores(score, "w", params, "getThisWeeksScores");
}
static function getThisMonthsScores(score, params) {
getScores(score, "m", params, "getThisMonthsScores");
}
static function getThisYearsScores(score, params) {
getScores(score, "y", params, "getThisYearsScores");
}
static function getAlltimeScores(score, params) {
getScores(score, "a", params, "getAlltimeScores");
}
static function getScores(score, period, params, command_name) {
if (!score) {
sendError({command_id:getCommandID(command_name)}, new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", "missing required score name"));
return(undefined);
}
if (!params) {
params = new Object();
}
if (!hasUserSession()) {
callListener(events.SCORES_LOADED, false, new com.Newgrounds.NewgroundsAPIError("SITE_ID_REQUIRED", ("Host '" + getHost()) + "' does not have high scores enabled"));
return(undefined);
}
params.publisher_id = publisher_id;
params.period = period;
params.score = score;
if (params.user_id) {
var _local3 = period;
} else {
var _local3 = period + "-u";
}
if (score_page_counts[_local3] == undefined) {
params.request_page_count = true;
}
sendCommand("getScores", params);
}
static function unlockMedal(medal, get_score) {
if (!medal) {
sendError({command_id:getCommandID("unlockMedal")}, new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", "missing required medal name"));
return(undefined);
}
var _local1 = new Object();
_local1.medal = medal;
if (get_score) {
_local1.get_score = get_score;
}
sendSecureCommand("unlockMedal", _local1);
}
static function loadMedals() {
if (medals) {
callListener(events.MEDALS_LOADED, true, {medals:medals});
return(undefined);
}
var _local1 = new Object();
if (hasUserSession()) {
_local1.publisher_id = publisher_id;
_local1.user_id = user_id;
}
sendCommand("getMedals", _local1);
}
static function getMedals() {
return(medals);
}
static function saveLocal(save_id, save_data, size_allocation) {
if (!sharedObjects[save_id]) {
sharedObjects[save_id] = SharedObject.getLocal((("ng_ap_secure_" + movie_id) + "_") + save_id);
}
sharedObjects[save_id].data[save_id] = encodeData(save_data);
sharedObjects[save_id].flush();
}
static function loadLocal(save_id) {
if (!sharedObjects[save_id]) {
sharedObjects[save_id] = SharedObject.getLocal((("ng_ap_secure_" + movie_id) + "_") + save_id);
}
sharedObjects[save_id].flush();
if (sharedObjects[save_id].data[save_id]) {
return(decodeData(sharedObjects[save_id].data[save_id]));
}
return(null);
}
static function encodeData(data) {
return(compressHex(com.Newgrounds.RC4.encrypt(com.Newgrounds.JSON.encode(data), encryption_key)));
}
static function decodeData(base) {
return(com.Newgrounds.JSON.decode(com.Newgrounds.RC4.decrypt(uncompressHex(base), encryption_key)));
}
static function compressHex(hex_value) {
var _local5 = hex_value.length % 6;
var _local4 = "";
var _local1 = 0;
while (_local1 < hex_value.length) {
var _local2 = Number("0x" + hex_value.substr(_local1, 6));
_local4 = _local4 + compressor.encode(_local2, 4);
_local1 = _local1 + 6;
}
return(_local5 + _local4);
}
static function uncompressHex(base_value) {
var _local8 = Number(base_value.charAt(0));
var _local7 = "";
var _local3;
var _local2 = 1;
while (_local2 < base_value.length) {
var _local6 = base_value.substr(_local2, 4);
var _local5 = compressor.decode(_local6);
var _local1 = dec2hex(_local5);
if ((_local2 + 4) < base_value.length) {
_local3 = 6;
} else {
_local3 = _local8;
}
while (_local1.length < _local3) {
_local1 = "0" + _local1;
}
_local7 = _local7 + _local1;
_local2 = _local2 + 4;
}
return(_local7);
}
static function dec2hex(dec) {
var _local4 = "0123456789ABCDEF";
var _local3 = "";
while (dec > 0) {
var _local2 = dec % 16;
_local3 = _local4.charAt(_local2) + _local3;
dec = (dec - _local2) / 16;
}
return(_local3);
}
static function saveFile(folder, filename, contents, thumbnail_source) {
if (!save_file) {
save_file = new com.Newgrounds.NewgroundsAPISaveFile(movie_id, folder, filename);
save_file.setContents(contents);
if (thumbnail_source) {
save_file.setThumbnail(thumbnail_source);
}
save_file.onError = function (msg) {
var _local1 = new com.Newgrounds.NewgroundsAPIError("PERMISSION_DENIED", msg);
com.Newgrounds.NewgroundsAPI.sendError({command_id:com.Newgrounds.NewgroundsAPI.getCommandID("saveFile")}, _local1);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, false, _local1);
};
save_file.onCancel = function (msg) {
var _local1 = new com.Newgrounds.NewgroundsAPIError("USER_CANCELLED", msg);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, false, _local1);
};
save_file.submit();
} else {
var _local1 = new com.Newgrounds.NewgroundsAPIError("UPLOAD_IN_PROGRESS", "Please wait for the previous file to finish uploading");
sendError({command_id:getCommandID("saveFile")}, _local1);
callListener(events.FILE_SAVED, false, _local1);
}
}
static function checkFilePrivs(folder, filename) {
if (user_id) {
var _local1 = user_id;
} else {
var _local1 = 0;
}
var _local2 = {folder:folder, filename:filename, user_id:_local1, publisher_id:publisher_id};
sendCommand("checkFilePrivs", _local2);
}
static function finishFileSave(folder, filename, description, share, file, thumbnail) {
var _local2;
_local2 = {folder:folder, filename:filename, description:description, share:share};
var _local1;
_local1 = {file:file, thumbnail:thumbnail};
sendSecureCommand("saveFile", _local2, null, _local1);
}
static function getFiles(folder, options) {
var _local7 = {name:1, date:2, score:3};
var _local2 = {user_only:false, sort_on:"date", page:1, results_per_page:20, sort_descending:true};
var _local6 = new Array();
for (var _local10 in _local7) {
_local6.push(("'" + _local10) + "'");
}
var _local4 = new Array();
for (var _local9 in _local2) {
_local4.push(("'" + _local9) + "'");
}
if (options.sort_descending && (!_local7[options.sort_descending])) {
var _local3 = new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", (("'" + options.sort_descending) + "' is not a valid sort_on value. Valid values are: ") + _local6.join(", "));
sendError({command_id:getCommandID("getFiles")}, _local3);
delete options.sort_descending;
}
var _local8;
if (options) {
for (var _local10 in options) {
if (_local2[_local10] == undefined) {
var _local3 = new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", (("'" + _local10) + "' is not a valid option. Valid options are: ") + _local4.join(", "));
sendError({command_id:getCommandID("getFiles")}, _local3);
delete options[_local10];
} else if (typeof(options[_local10]) != typeof(_local2[_local10])) {
var _local3 = new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", (("option '" + _local10) + "' should be the following type: ") + typeof(_local2[_local10]));
sendError({command_id:getCommandID("getFiles")}, _local3);
delete options[_local10];
}
}
_local8 = options;
} else {
_local8 = new Object();
}
if (hasUserSession()) {
_local8.publisher_id = publisher_id;
_local8.user_id = user_id;
}
_local8.folder = folder;
sendCommand("getFiles", _local8);
}
static function getConfirmation(command_name, event, msg, target, confirm, cancel) {
var _local1 = new com.Newgrounds.NewgroundsAPIError("CONFIRM_REQUEST", msg);
_local1.confirm = function () {
target[confirm]();
};
_local1.cancel = function () {
target[cancel]();
};
_local1.command = getCommandID(command_name);
callListener(event, false, _local1);
}
static function doBlockHost(event) {
_root.stop();
initTextFormats();
_root.createEmptyMovieClip("NGAPI_deny_host_overlay", _root.getNextHighestDepth());
_root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100);
_root.NGAPI_deny_host_overlay.beginFill(6684672);
_root.NGAPI_deny_host_overlay.moveTo(0, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, 0);
_root.NGAPI_deny_host_overlay.endFill();
var _local2 = ("This movie has not been approved for use on " + getHost()) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var _local4 = _local2.length;
_local2 = _local2 + event.data.movie_url;
var _local3 = _local2.length;
_root.NGAPI_deny_host_overlay.createTextField("mousekill", 100, 0, 0, Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.createTextField("error", 101, (Stage.width - 400) / 2, (Stage.height / 2) - 100, 400, 200);
_root.NGAPI_deny_host_overlay.error.text = "ERROR!";
_root.NGAPI_deny_host_overlay.error.setTextFormat(error_format);
_root.NGAPI_deny_host_overlay.createTextField("message", 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200);
_root.NGAPI_deny_host_overlay.message.text = _local2;
_root.NGAPI_deny_host_overlay.message.multiline = true;
_root.NGAPI_deny_host_overlay.message.wordWrap = true;
_root.NGAPI_deny_host_overlay.message.html = true;
_root.NGAPI_deny_host_overlay.message.setTextFormat(normal_format);
link_format.url = event.data.redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format);
}
static function onNewVersionAvailable(event) {
_root.stop();
initTextFormats();
var _local2 = new Object();
_local2.x = Stage.width / 2;
_local2.y = Stage.height / 2;
_root.createEmptyMovieClip("NGAPI_new_version_overlay", _root.getNextHighestDepth());
_root.NGAPI_new_version_overlay.lineStyle(1, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(0, 70);
_root.NGAPI_new_version_overlay.moveTo(-10, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, -10);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(51);
_root.NGAPI_new_version_overlay.moveTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.createEmptyMovieClip("exit", 1000);
_root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100);
_root.NGAPI_new_version_overlay.exit.beginFill(0, 50);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 214, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 226, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 226, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 214, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.onMouseUp = function () {
if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) {
_root.NGAPI_new_version_overlay.removeMovieClip();
}
};
var _local3 = (("Version " + event.data.movie_version) + " is now available at:") + newline;
var _local6 = _local3.length;
_local3 = _local3 + event.data.movie_url;
var _local4 = _local3.length;
_root.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000);
_root.NGAPI_new_version_overlay.createTextField("newversion", 100, _local2.x - 210, _local2.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = "New Version Available!";
_root.NGAPI_new_version_overlay.newversion.setTextFormat(header_format);
_root.NGAPI_new_version_overlay.createTextField("message", 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40);
_root.NGAPI_new_version_overlay.message.text = _local3;
_root.NGAPI_new_version_overlay.message.multiline = true;
_root.NGAPI_new_version_overlay.message.wordWrap = true;
_root.NGAPI_new_version_overlay.message.html = true;
_root.NGAPI_new_version_overlay.message.setTextFormat(normal_format);
link_format.url = event.data.redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(_local6, _local4, link_format);
}
static function initTextFormats() {
if (!error_format) {
error_format = new TextFormat();
error_format.font = "Arial Black";
error_format.size = 48;
error_format.color = 16711680 /* 0xFF0000 */;
}
if (!header_format) {
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.size = 24;
header_format.color = 16777215 /* 0xFFFFFF */;
}
if (!normal_format) {
normal_format = new TextFormat();
normal_format.font = "Arial";
normal_format.bold = true;
normal_format.size = 12;
normal_format.color = 16777215 /* 0xFFFFFF */;
}
if (!link_format) {
link_format = new TextFormat();
link_format.color = 16776960 /* 0xFFFF00 */;
link_format.underline = true;
}
}
static function doEvent(e) {
switch (getCommandName(e.command_id)) {
case "connectMovie" :
clearInterval(timeout);
sendMessage("You have successfully connected to the Newgrounds API Gateway");
sendMessage(("Movie identified as \"" + e.movie_name) + "\"");
callListener(events.MOVIE_CONNECTED, e.success, {movie_name:e.movie_name});
var _local4 = false;
if (e.ad_status === -1) {
var _local6 = "This movie was not approved to run Flash Ads.";
sendWarning(_local6);
sendWarning(("visit " + AD_TERMS_URL) + " to view our approval guidelines");
if (!e.ad_url) {
callListener(events.ADS_APPROVED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", _local6));
} else {
_local4 = true;
}
} else if (e.ad_status === 0) {
var _local6 = "Flash Ads are currently awaiting approval.";
sendNotice(_local6);
if (!e.ad_url) {
callListener(events.ADS_APPROVED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", _local6));
} else {
_local4 = true;
}
}
if (e.ad_url) {
ad_url = unescape(e.ad_url);
if (!_local4) {
sendMessage("This movie has been approved to run Flash Ads!");
}
callListener(events.ADS_APPROVED, true);
}
if (e.deny_host) {
var _local6 = getHost() + " does not have permission to run this movie!";
sendWarning(_local6);
sendWarning("\tUpdate your API configuration to unblock " + getHost());
callListener(events.HOST_BLOCKED, true, {movie_url:unescape(e.movie_url), redirect_url:getOfficialVersionURL()});
}
if (e.movie_version) {
sendWarning("According to your API Configuration, this version is out of date.");
if (version) {
sendWarning("\tThe this movie is version " + version);
}
sendWarning("\tThe most current version is " + e.movie_version);
callListener(events.NEW_VERSION_AVAILABLE, true, {movie_version:e.movie_version, movie_url:unescape(e.movie_url), redirect_url:getOfficialVersionURL()});
}
if (e.request_portal_url) {
sendCommand("setPortalID", {portal_url:_url});
}
break;
case "logCustomEvent" :
if (e.success) {
sendMessage(("Event '" + e.event) + "' was logged.");
}
callListener(events.EVENT_LOGGED, e.success, {event:e.event});
break;
case "postScore" :
var _local7;
if (e.success) {
var _local3 = "User";
if (user_email) {
_local3 = user_email;
} else if (user_name) {
_local3 = user_name;
}
sendMessage(((((_local3 + " posted ") + e.value) + " to '") + e.score) + "'");
_local7 = {score:e.score, value:e.value, username:_local3};
}
callListener(events.SCORE_POSTED, e.success, _local7);
break;
case "getScores" :
_local7 = new Object();
if (e.user_id) {
var _local5 = e.period;
} else {
var _local5 = e.period + "-u";
}
if (e.total_pages) {
score_page_counts[_local5] = e.total_pages;
}
_local7.user_id = e.user_id;
_local7.current_page = e.current_page;
_local7.total_pages = score_page_counts[_local5];
_local7.scores = e.scores;
_local7.period = getPeriodName(e.period);
callListener(events.SCORES_LOADED, e.success, _local7);
break;
case "unlockMedal" :
if (medals) {
var _local2 = 0;
while (_local2 < medals.length) {
if (medals[_local2].medal_name === e.medal_name) {
medals[_local2].medal_unlocked = true;
break;
}
_local2++;
}
}
_local7 = {medal_name:e.medal_name, medal_value:e.medal_value, medal_difficulty:e.medal_difficulty};
callListener(events.MEDAL_UNLOCKED, e.success, _local7);
break;
case "getMedals" :
medals = e.medals;
_local7 = {medals:e.medals};
callListener(events.MEDALS_LOADED, e.success, _local7);
break;
case "getFiles" :
break;
case "getSystemFiles" :
break;
case "saveFile" :
save_file = null;
_local7 = {file_id:e.file_id, filename:e.filename, file_url:e.file_url, thumbnail:e.thumbnail, icon:e.icon};
callListener(events.FILE_SAVED, e.success, _local7);
break;
case "checkFilePrivs" :
if (save_file) {
save_file.checkPrivs(e);
} else {
_local7 = {filename:e.filename, folder:e.folder, can_read:e.can_read, can_write:e.can_write};
callListener(events.FILE_PRIVS_LOADED, e.success, _local7);
}
}
}
static function setDefaultListeners() {
var _local1 = new Array();
_local1[events.HOST_BLOCKED] = {listener:doBlockHost};
_local1[events.NEW_VERSION_AVAILABLE] = {listener:onNewVersionAvailable};
return(_local1);
}
static function addEventListener(event, listener, params) {
listeners[event] = {listener:listener, params:params};
}
static function removeEventListener(event) {
delete listeners[event];
}
static function getEventName(event) {
for (var _local2 in events) {
if (events[_local2] == event) {
return(_local2);
}
}
return(undefined);
}
static function callListener(event, success, data, target) {
echo("Fired Event: " + getEventName(event));
if (listeners[event]) {
if (data.isError()) {
listeners[event].listener({event:event, success:success, error:data, target:target}, listeners[event].params);
} else {
listeners[event].listener({event:event, success:success, data:data, target:target}, listeners[event].params);
}
}
}
static function getCommandName(id) {
return(id);
}
static function getCommandID(name) {
return(name);
}
static function getPeriodAliases() {
var _local1 = new Object();
for (var _local2 in period_aliases) {
_local1[period_aliases[_local2].alias] = _local2;
}
return(_local1);
}
static function getPeriodName(p) {
for (var _local2 in period_aliases) {
if (_local2 == p) {
return(period_aliases[_local2].name);
}
}
return(null);
}
static function getPeriodAlias(p) {
for (var _local2 in period_aliases) {
if (_local2 == p) {
return(period_aliases[_local2].alias);
}
}
return(null);
}
static function sendError(c, e) {
}
static function sendWarning(m, c) {
if (c) {
m = m + ((("\r[NewgroundsAPI WARNING] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
}
static function sendNotice(m, c) {
if (c) {
m = m + ((("\r[NewgroundsAPI NOTICE] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
}
static function fatalError(m, c) {
if (c) {
m = m + ((("\r\tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
throw (((("***ERROR*** frame=" + _root._currentframe) + ", class=NewgroundsAPI") + newline) + newline) + m;
}
static function sendSecureCommand(command, secure_params, unsecure_params, files) {
if (((!debug) && (!hasUserSession())) && (!hasUserEmail())) {
sendError({command_id:getCommandID(command)}, new com.Newgrounds.NewgroundsAPIError("IDENTIFICATION_REQUIRED", ("You must be logged in or provide an e-mail address ( using NewgroundsAPI.setUserEmail(\"name@domain.com\"); ) to use " + command) + "()."));
return(undefined);
}
if (!command) {
fatalError("Missing command", "sendSecureCommand");
}
if (!secure_params) {
fatalError("Missing secure_params", "sendSecureCommand");
}
if (!unsecure_params) {
unsecure_params = new Object();
}
var _local2 = "";
var _local1 = 0;
while (_local1 < 16) {
_local2 = _local2 + compression_radix.charAt(Math.floor(Math.random() * compression_radix.length));
_local1++;
}
if (debug) {
secure_params.session_id = "";
} else {
secure_params.session_id = session_id;
}
secure_params.as_version = 2;
secure_params.user_email = user_email;
secure_params.publisher_id = publisher_id;
secure_params.seed = _local2;
secure_params.command_id = getCommandID(command);
var _local8 = com.Newgrounds.MD5.calculate(_local2);
var _local6 = com.Newgrounds.RC4.encrypt(com.Newgrounds.JSON.encode(secure_params), encryption_key);
var _local7 = _local8 + _local6;
unsecure_params.secure = compressHex(_local7);
sendCommand("securePacket", unsecure_params, false, files);
}
static function sendCommand(command, params, open_browser, files) {
if ((!connected) and (command != "connectMovie")) {
var _local11 = (("NewgroundsAPI." + command) + "() - NewgroundsAPI.connectMovie() must be called before this command can be called") + newline;
fatalError(_local11, "connectMovie");
}
if (open_browser) {
var _local1 = new Object();
} else {
var _local1 = new LoadVars();
}
_local1.command_id = getCommandID(command);
_local1.tracker_id = movie_id;
if (debug) {
_local1.debug = debug;
}
if (params) {
for (var _local8 in params) {
_local1[_local8] = params[_local8];
}
}
if (files) {
for (var _local8 in files) {
_local1[_local8] = files[_local8];
}
}
echo(("OUTPUT: \r" + com.Newgrounds.JSON.encode(_local1)) + newline);
if (open_browser) {
var _local5 = (GATEWAY_URL + "?seed=") + Math.random();
for (var _local8 in _local1) {
_local5 = _local5 + ((("&" + escape(_local8)) + "=") + escape(_local1[_local8]));
}
getURL (_local5, "_blank");
_local1.removeMovieClip();
} else {
var _local9 = new LoadVars();
_local9.onData = function (data) {
com.Newgrounds.NewgroundsAPI.echo(("INPUT: \r" + data) + newline);
if (data) {
var _local1 = com.Newgrounds.JSON.decode(data);
} else {
var _local1 = {success:false};
}
if (!_local1.success) {
var _local3 = new com.Newgrounds.NewgroundsAPIError(_local1.error_code, _local1.error_msg);
com.Newgrounds.NewgroundsAPI.sendError(_local1, _local3);
} else {
com.Newgrounds.NewgroundsAPI.doEvent(_local1);
}
};
var _local4 = new Array();
for (var _local7 in _local1) {
_local4.push((_local7 + "=") + escape(_local1[_local7]));
}
echo((("POST " + GATEWAY_URL) + "?") + _local4.join("&"));
_local1.sendAndLoad((GATEWAY_URL + "?seed=") + Math.random(), _local9, "POST");
}
}
static function renderAd(target) {
if (ad_swf_url) {
target.background = target.createEmptyMovieClip("background", 100);
target.background.beginFill(0);
target.background.moveTo(0, 0);
target.background.lineTo(300, 0);
target.background.lineTo(300, 250);
target.background.lineTo(0, 250);
target.background.lineTo(0, 0);
target.background.endFill();
target.mask = target.createEmptyMovieClip("mask", 101);
target.mask.beginFill(0);
target.mask.moveTo(0, 0);
target.mask.lineTo(300, 0);
target.mask.lineTo(300, 250);
target.mask.lineTo(0, 250);
target.mask.lineTo(0, 0);
target.mask.endFill();
target.clip = target.createEmptyMovieClip("clip", 102);
target.clip.ad = target.clip.createEmptyMovieClip("ad", 100);
target.clip.setMask(target.mask);
loadMovie (ad_swf_url, target.clip.ad);
callListener(events.AD_ATTACHED, true, null, target);
} else {
callListener(events.AD_ATTACHED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad"));
}
}
static function attachFlashAd(target) {
System.security.allowDomain("http://server.cpmstar.com");
System.security.allowDomain("http://www.cpmstar.com");
System.security.allowDomain("https://server.cpmstar.com");
System.security.allowDomain("https://www.cpmstar.com");
System.security.allowInsecureDomain("http://server.cpmstar.com");
System.security.allowInsecureDomain("http://www.cpmstar.com");
System.security.allowInsecureDomain("https://server.cpmstar.com");
System.security.allowInsecureDomain("https://www.cpmstar.com");
sendMessage("You may get a security sandbox violation from this ad. This is nothing to worry about!");
if (resetAdTimer()) {
if (ad_url) {
var _local1 = new LoadVars();
_local1.onData = function (data) {
if (data) {
com.Newgrounds.NewgroundsAPI.ad_swf_url = data;
} else {
com.Newgrounds.NewgroundsAPI.ad_swf_url = null;
}
com.Newgrounds.NewgroundsAPI.renderAd(target);
};
if (ad_url.indexOf("?") > -1) {
_local1.load((ad_url + "&random=") + Math.random());
} else {
_local1.load((ad_url + "?random=") + Math.random());
}
}
} else {
renderAd(target);
}
}
static function resetAdTimer() {
if (!ad_url) {
return(false);
}
var _local1 = new Date();
if (_local1.getTime() >= ad_reset) {
ad_reset = _local1.getTime() + 300000;
return(true);
}
return(false);
}
static function sendMessage(m, r) {
var _local1 = "[NewgroundsAPI] :: " + m;
if (r) {
return(_local1);
}
}
static function echo(m) {
if (do_echo) {
}
}
static var do_echo = false;
static var GATEWAY_URL = "https://www.ngads.com/gateway_v2.php";
static var AD_TERMS_URL = "https://www.newgrounds.com/wiki/flashads/terms/";
static var COMMANDS_WIKI_URL = "https://www.newgrounds.com/wiki/flashapi/commands/";
static var ad_reset = 0;
static var save_file = null;
static var medals = null;
static var score_page_counts = new Object();
static var compression_radix = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
static var compressor = new com.Newgrounds.BaseN(compression_radix);
static var errors = com.Newgrounds.NewgroundsAPIError.init_codes();
static var sharedObjects = new Object();
static var events = {MOVIE_CONNECTED:1, ADS_APPROVED:2, AD_ATTACHED:3, HOST_BLOCKED:4, NEW_VERSION_AVAILABLE:5, EVENT_LOGGED:6, SCORE_POSTED:7, SCORES_LOADED:8, MEDAL_UNLOCKED:9, MEDALS_LOADED:10, FILE_PRIVS_LOADED:11, FILE_SAVED:12};
static var listeners = setDefaultListeners();
static var periods = getPeriodAliases();
static var period_aliases = {t:{name:"Today", alias:"TODAY"}, p:{name:"Yesterday", alias:"YESTERDAY"}, w:{name:"This Week", alias:"THIS_WEEK"}, m:{name:"This Month", alias:"THIS_MONTH"}, y:{name:"This Year", alias:"THIS_YEAR"}, a:{name:"All-Time", alias:"ALL_TIME"}};
}
Symbol 1480 MovieClip [__Packages.com.Newgrounds.NewgroundsAPISaveFile] Frame 0
class com.Newgrounds.NewgroundsAPISaveFile
{
var tracker_id, folder, filename, contents, thumbnail, icon_url, thumbnail_url, description, scan, scanner;
function NewgroundsAPISaveFile (tracker_id, folder, filename) {
this.tracker_id = tracker_id;
this.folder = folder;
this.filename = filename;
contents = null;
thumbnail = null;
icon_url = null;
thumbnail_url = null;
}
function setDescription(description) {
this.description = description;
}
function setShared(share) {
this.share = share;
}
function setContents(contents) {
this.contents = contents;
}
function setThumbnail(thumb) {
if (thumb) {
thumbnail = thumb;
} else {
thumbnail = null;
}
}
function onError(msg) {
}
function onCancel(msg) {
}
function submit() {
scan = null;
com.Newgrounds.NewgroundsAPI.checkFilePrivs(folder, filename);
}
function checkPrivs(p) {
if (p.success) {
if (p.can_write) {
can_write = p.can_write;
if (p.exists) {
com.Newgrounds.NewgroundsAPI.getConfirmation("saveFile", com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, ("File '" + filename) + "' exists, overwrite?", this, "startFile", "cancelFile");
} else {
startFile();
}
} else {
onError("This filename is owned by another user.");
}
} else {
onError("There was a problem looking up your file's details");
}
}
function cancelFile() {
onCancel("Overwrite was cancelled");
}
function startFile() {
if (can_write) {
if (thumbnail) {
scanner = new com.Newgrounds.ImageScanner(thumbnail);
scanner.setCallback(this, "writeFile");
scanner.startScan(100, 100, true);
} else {
writeFile();
}
} else {
onError(("You cannot write to filename \"" + filename) + "\"");
}
}
function writeFile(img) {
com.Newgrounds.NewgroundsAPI.finishFileSave(folder, filename, description, share, com.Newgrounds.JSON.encode(contents), img);
}
var can_write = false;
var share = true;
}
Symbol 1481 MovieClip [__Packages.com.Newgrounds.ImageScanner] Frame 0
class com.Newgrounds.ImageScanner
{
var image_source, source_width, source_height, sourceBitmap, callback_target, callback_function, hash, cube, basen, xpos, ypos, pixels, busy, canvas_width, canvas_height, resizedBitmap, copyBitmap, output, draw_interval, callback_interval;
function ImageScanner (the_source) {
if (the_source) {
image_source = the_source;
} else {
image_source = _root;
}
reset();
if (typeof(image_source) == "movieclip") {
if (image_source == _root) {
source_width = Stage.width;
source_height = Stage.height;
} else {
source_width = Math.floor(image_source._width);
source_height = Math.floor(image_source._height);
}
sourceBitmap = new flash.display.BitmapData(source_width, source_height, false, 4294967295);
sourceBitmap.draw(_root);
} else if (image_source.width) {
source_width = image_source.width;
source_height = image_source.height;
sourceBitmap = image_source;
} else {
error("You can only use BitMaptData and MovieClip objects to create images");
}
}
function setCallback(target, funct) {
if (target && (funct)) {
callback_target = target;
callback_function = funct;
}
}
function reset() {
callback_target = null;
callback_function = null;
debug.bad_pixels = 0;
hash = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&";
var _local3 = Math.pow(hash.length, 2);
var _local2 = Math.floor(Math.pow(_local3, 0.333333333333333)) - 1;
var _local4 = Math.pow(_local2, 3);
cube = _local2;
basen = new com.Newgrounds.BaseN(hash);
xpos = 0;
ypos = 0;
pixels = 0;
busy = false;
}
function startScan(w, h, s) {
if (w) {
image_width = w;
}
if (h) {
image_height = h;
}
if (s != undefined) {
crop = s;
}
var _local7 = _root.getNextHighestDepth();
var _local6 = _root.createEmptyMovieClip("API_image_container_" + _local7, _local7);
var _local5 = _local6.createEmptyMovieClip("canvas", 100);
_local5.attachBitmap(sourceBitmap, 100);
if (crop) {
if ((image_width / source_width) > (image_height / source_height)) {
canvas_width = image_width;
canvas_height = Math.ceil(source_height * (image_width / source_width));
} else {
canvas_height = image_height;
canvas_width = Math.ceil(source_width * (image_height / source_height));
}
} else {
canvas_width = image_width;
canvas_height = image_height;
}
_local5._x = Math.round((image_width - canvas_width) / 2);
_local5._width = canvas_width;
_local5._height = canvas_height;
resizedBitmap = new flash.display.BitmapData(image_width, image_height, false, 4294967295);
resizedBitmap.draw(_local6);
_local6.removeMovieClip();
copyBitmap = new flash.display.BitmapData(image_width, image_height, false, 4294967295);
var _local3 = "" + image_width;
while (_local3.length < 3) {
_local3 = "0" + _local3;
}
var _local4 = "" + image_height;
while (_local4.length < 3) {
_local4 = "0" + _local4;
}
output = _local3 + _local4;
draw_interval = setInterval(this, "drawChunk", 10);
busy = false;
return(resizedBitmap);
}
function getBitmapData() {
return(copyBitmap);
}
function getBytesTotal() {
return((image_width * image_height) * 2);
}
function getBytesScanned() {
return(pixels * 2);
}
function drawChunk() {
if (!busy) {
busy = true;
var _local2 = 0;
while (_local2 < 250) {
if (!nextPixel()) {
clearInterval(draw_interval);
callback_interval = setInterval(this, "doCallback", 25);
busy = true;
break;
}
_local2++;
}
busy = false;
}
}
function doCallback() {
busy = false;
clearInterval(callback_interval);
if (callback_target and callback_function) {
callback_target[callback_function](output);
} else {
onScanComplete(output);
}
}
function onScanComplete(packet) {
sendMessage(("packet size: " + output.length) + " bytes", "onScanComplete");
}
function nextPixel() {
var _local15 = xpos;
var _local14 = ypos;
var _local7 = resizedBitmap.getPixel(_local15, _local14);
var _local17 = (_local7 >> 16) & 255;
var _local20 = (_local7 >> 8) & 255;
var _local16 = (_local7 >> 0) & 255;
var _local11 = Math.round(((_local17 + 1) / 256) * cube);
var _local10 = Math.round(((_local20 + 1) / 256) * cube);
var _local13 = Math.round(((_local16 + 1) / 256) * cube);
var _local12 = (((_local11 * (cube + 1)) * (cube + 1)) + (_local10 * (cube + 1))) + _local13;
var _local6 = basen.encode(_local12, 2);
output = output + _local6;
if (_local6.length != 2) {
}
var _local5 = basen.decode(_local6);
var _local18 = _local5;
var _local8 = _local5 % (cube + 1);
_local5 = (_local5 - _local8) / (cube + 1);
var _local9 = _local5 % (cube + 1);
var _local19 = (_local5 - _local9) / (cube + 1);
if (((_local13 != _local8) and (_local10 != _local9)) and (_local11 != _local10)) {
debug.bad_pixels++;
}
var _local2 = Math.round((_local19 / cube) * 255).toString(16);
var _local4 = Math.round((_local9 / cube) * 255).toString(16);
var _local3 = Math.round((_local8 / cube) * 255).toString(16);
while (_local2.length < 2) {
_local2 = "0" + _local2;
}
while (_local4.length < 2) {
_local4 = "0" + _local4;
}
while (_local3.length < 2) {
_local3 = "0" + _local3;
}
copyBitmap.setPixel(_local15, _local14, Number((("0x" + _local2) + _local4) + _local3));
pixels++;
if (pixels >= (image_width * image_height)) {
return(false);
}
xpos++;
if (xpos >= image_width) {
xpos = 0;
ypos++;
}
return(true);
}
function error(e, f) {
sendMessage(e, f, "ERROR");
}
function sendMessage(msg, func, type) {
var _local1 = "ImageScanner";
if (func) {
_local1 = _local1 + (("." + func) + "()");
}
if (type) {
_local1 = (type + " in ") + _local1;
}
_local1 = _local1 + (" :: " + msg);
}
var image_width = 100;
var image_height = 100;
var crop = true;
var debug = new Object();
}
Symbol 1482 MovieClip [__Packages.com.Newgrounds.JSON] Frame 0
class com.Newgrounds.JSON
{
function JSON () {
}
static function encode(arg, noquotes) {
var _local3;
var _local2;
var _local6;
var _local1 = "";
var _local4;
if (arg.isSServerVar()) {
var _local8 = "sservervariable";
} else {
var _local8 = typeof(arg);
}
switch (_local8) {
case "sservervariable" :
return("?" + arg.getEncodedValue());
case "object" :
if (arg) {
if (arg instanceof Array) {
_local2 = 0;
while (_local2 < arg.length) {
_local4 = encode(arg[_local2]);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + _local4;
_local2++;
}
return(("[" + _local1) + "]");
}
if (typeof(arg.toString) != "undefined") {
for (_local2 in arg) {
_local4 = arg[_local2];
if ((typeof(_local4) != "undefined") && (typeof(_local4) != "function")) {
_local4 = encode(_local4);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + ((encode(_local2) + ":") + _local4);
}
}
return(("{" + _local1) + "}");
}
}
return("null");
case "number" :
return((isFinite(arg) ? (String(arg)) : "null"));
case "string" :
_local6 = arg.length;
if (noquotes) {
var _local7 = "";
} else {
var _local7 = "\"";
}
_local1 = _local7;
_local2 = 0;
while (_local2 < _local6) {
_local3 = arg.charAt(_local2);
if (_local3 >= " ") {
if ((_local3 == "\\") || (_local3 == "\"")) {
_local1 = _local1 + "\\";
}
_local1 = _local1 + _local3;
} else {
switch (_local3) {
case "\b" :
_local1 = _local1 + "\\b";
break;
case "\f" :
_local1 = _local1 + "\\f";
break;
case newline :
_local1 = _local1 + "\\n";
break;
case "\r" :
_local1 = _local1 + "\\r";
break;
case "\t" :
_local1 = _local1 + "\\t";
break;
default :
_local3 = _local3.charCodeAt();
_local1 = _local1 + (("\\u00" + Math.floor(_local3 / 16).toString(16)) + (_local3 % 16).toString(16));
}
}
_local2 = _local2 + 1;
}
return(_local1 + _local7);
case "boolean" :
return(String(arg));
}
return("null");
}
static function decode(text) {
var at = 0;
var ch = " ";
var _value;
var _error = function (m) {
throw {name:"JSONError", message:m, at:at - 1, text:text};
};
var _next = function () {
ch = text.charAt(at);
at = at + 1;
return(ch);
};
var _white = function () {
while (ch) {
if (ch <= " ") {
_next();
} else if (ch == "/") {
switch (_next()) {
case "/" :
while ((_next() && (ch != newline)) && (ch != "\r")) {
}
break;
case "*" :
_next();
for(;;){
if (ch) {
if (ch == "*") {
if (_next() == "/") {
_next();
// unexpected jump
}
} else {
_next();
}
} else {
_error("Unterminated comment");
}
};
break;
default :
_error("Syntax error");
}
} else {
return;
}
}
};
var _string = function () {
var _local4;
var _local1 = "";
var _local3;
var _local2;
var _local5 = false;
if (ch == "\"") {
while (_next()) {
if (ch == "\"") {
_next();
return(_local1);
}
if (ch == "\\") {
switch (_next()) {
case "b" :
_local1 = _local1 + "\b";
break;
case "f" :
_local1 = _local1 + "\f";
break;
case "n" :
_local1 = _local1 + newline;
break;
case "r" :
_local1 = _local1 + "\r";
break;
case "t" :
_local1 = _local1 + "\t";
break;
case "u" :
_local2 = 0;
_local4 = 0;
while (_local4 < 4) {
_local3 = parseInt(_next(), 16);
if (!isFinite(_local3)) {
_local5 = true;
break;
}
_local2 = (_local2 * 16) + _local3;
_local4 = _local4 + 1;
}
if (_local5) {
_local5 = false;
break;
}
_local1 = _local1 + String.fromCharCode(_local2);
break;
default :
_local1 = _local1 + ch;
}
} else {
_local1 = _local1 + ch;
}
}
}
_error("Bad string");
};
var _array = function () {
var _local1 = [];
if (ch == "[") {
_next();
_white();
if (ch == "]") {
_next();
return(_local1);
}
while (ch) {
_local1.push(_value());
_white();
if (ch == "]") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad array");
};
var _object = function () {
var _local2;
var _local1 = {};
if (ch == "{") {
_next();
_white();
if (ch == "}") {
_next();
return(_local1);
}
while (ch) {
_local2 = _string();
_white();
if (ch != ":") {
break;
}
_next();
_local1[_local2] = _value();
_white();
if (ch == "}") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad object");
};
var _number = function () {
var _local1 = "";
var _local2;
if (ch == "-") {
_local1 = "-";
_next();
}
while ((ch >= "0") && (ch <= "9")) {
_local1 = _local1 + ch;
_next();
}
if (ch == ".") {
_local1 = _local1 + ".";
while ((_next() && (ch >= "0")) && (ch <= "9")) {
_local1 = _local1 + ch;
}
}
_local2 = 1 * _local1;
if (!isFinite(_local2)) {
_error("Bad number");
} else {
return(_local2);
}
};
var _word = function () {
switch (ch) {
case "t" :
if (((_next() == "r") && (_next() == "u")) && (_next() == "e")) {
_next();
return(true);
}
break;
case "f" :
if ((((_next() == "a") && (_next() == "l")) && (_next() == "s")) && (_next() == "e")) {
_next();
return(false);
}
break;
case "n" :
if (!(((_next() == "u") && (_next() == "l")) && (_next() == "l"))) {
break;
}
_next();
return(null);
}
_error("Syntax error");
};
_value = function () {
_white();
switch (ch) {
case "{" :
return(_object());
case "[" :
return(_array());
case "\"" :
return(_string());
case "-" :
return(_number());
}
return((((ch >= "0") && (ch <= "9")) ? (_number()) : (_word())));
};
return(_value());
}
}
Symbol 1483 MovieClip [__Packages.com.Newgrounds.RC4] Frame 0
class com.Newgrounds.RC4
{
function RC4 () {
}
static function encrypt(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToHex(_local2));
}
static function encryptbin(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(_local2);
}
static function decrypt(src, key) {
var _local3 = hexToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToStr(_local2));
}
static function initialize(pwd) {
var _local2 = 0;
var _local3;
var _local4 = pwd.length;
var _local1 = 0;
while (_local1 <= 255) {
mykey[_local1] = pwd[_local1 % _local4];
sbox[_local1] = _local1;
_local1++;
}
_local1 = 0;
while (_local1 <= 255) {
_local2 = ((_local2 + sbox[_local1]) + mykey[_local1]) % 256;
_local3 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local3;
_local1++;
}
}
static function calculate(plaintxt, psw) {
initialize(psw);
var _local1 = 0;
var _local2 = 0;
var _local9 = new Array();
var _local7;
var _local5;
var _local6;
var _local3 = 0;
while (_local3 < plaintxt.length) {
_local1 = (_local1 + 1) % 256;
_local2 = (_local2 + sbox[_local1]) % 256;
_local5 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local5;
var _local4 = (sbox[_local1] + sbox[_local2]) % 256;
_local7 = sbox[_local4];
_local6 = plaintxt[_local3] ^ _local7;
_local9.push(_local6);
_local3++;
}
return(_local9);
}
static function charsToHex(chars) {
var _local4 = new String("");
var _local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local1 = 0;
while (_local1 < chars.length) {
_local4 = _local4 + (_local3[chars[_local1] >> 4] + _local3[chars[_local1] & 15]);
_local1++;
}
return(_local4);
}
static function hexToChars(hex) {
var _local3 = new Array();
var _local1 = ((hex.substr(0, 2) == "0x") ? 2 : 0);
while (_local1 < hex.length) {
_local3.push(parseInt(hex.substr(_local1, 2), 16));
_local1 = _local1 + 2;
}
return(_local3);
}
static function charsToStr(chars) {
var _local3 = new String("");
var _local1 = 0;
while (_local1 < chars.length) {
_local3 = _local3 + String.fromCharCode(chars[_local1]);
_local1++;
}
return(_local3);
}
static function strToChars(str) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < str.length) {
_local3.push(str.charCodeAt(_local1));
_local1++;
}
return(_local3);
}
static var sbox = new Array(255);
static var mykey = new Array(255);
}
Symbol 1484 MovieClip [__Packages.com.Newgrounds.MD5] Frame 0
class com.Newgrounds.MD5
{
function MD5 () {
}
static function calculate(src) {
return(hex_md5(src));
}
static function hex_md5(src) {
return(binl2hex(core_md5(str2binl(src), src.length * 8)));
}
static function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var _local4 = 1732584193 /* 0x67452301 */;
var _local3 = -271733879;
var _local2 = -1732584194;
var _local1 = 271733878 /* 0x10325476 */;
var _local5 = 0;
while (_local5 < x.length) {
var _local10 = _local4;
var _local9 = _local3;
var _local8 = _local2;
var _local7 = _local1;
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 0], 7, -680876936);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 1], 12, -389564586);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 2], 17, 606105819);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 3], 22, -1044525330);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 4], 7, -176418897);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 5], 12, 1200080426);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 6], 17, -1473231341);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 7], 22, -45705983);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 8], 7, 1770035416);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 9], 12, -1958414417);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 10], 17, -42063);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 11], 22, -1990404162);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 12], 7, 1804603682);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 13], 12, -40341101);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 14], 17, -1502002290);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 15], 22, 1236535329);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 1], 5, -165796510);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 6], 9, -1069501632);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 11], 14, 643717713);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 0], 20, -373897302);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 5], 5, -701558691);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 10], 9, 38016083);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 15], 14, -660478335);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 4], 20, -405537848);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 9], 5, 568446438);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 14], 9, -1019803690);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 3], 14, -187363961);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 8], 20, 1163531501);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 13], 5, -1444681467);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 2], 9, -51403784);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 7], 14, 1735328473);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 12], 20, -1926607734);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 5], 4, -378558);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 8], 11, -2022574463);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 11], 16, 1839030562);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 14], 23, -35309556);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 1], 4, -1530992060);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 4], 11, 1272893353);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 7], 16, -155497632);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 10], 23, -1094730640);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 13], 4, 681279174);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 0], 11, -358537222);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 3], 16, -722521979);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 6], 23, 76029189);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 9], 4, -640364487);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 12], 11, -421815835);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 15], 16, 530742520);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 2], 23, -995338651);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 0], 6, -198630844);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 7], 10, 1126891415);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 14], 15, -1416354905);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 5], 21, -57434055);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 12], 6, 1700485571);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 3], 10, -1894986606);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 10], 15, -1051523);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 1], 21, -2054922799);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 8], 6, 1873313359);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 15], 10, -30611744);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 6], 15, -1560198380);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 13], 21, 1309151649);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 4], 6, -145523070);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 11], 10, -1120210379);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 2], 15, 718787259);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 9], 21, -343485551);
_local4 = safe_add(_local4, _local10);
_local3 = safe_add(_local3, _local9);
_local2 = safe_add(_local2, _local8);
_local1 = safe_add(_local1, _local7);
_local5 = _local5 + 16;
}
return(new Array(_local4, _local3, _local2, _local1));
}
static function md5_cmn(q, a, b, x, s, t) {
return(safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b));
}
static function md5_ff(a, b, c, d, x, s, t) {
return(md5_cmn((b & c) | ((~b) & d), a, b, x, s, t));
}
static function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
static function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
static function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
static function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
static function safe_add(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
static function str2binl(str) {
var _local3 = new Array();
var _local4 = 255;
var _local1 = 0;
while (_local1 < (str.length * 8)) {
_local3[_local1 >> 5] = _local3[_local1 >> 5] | ((str.charCodeAt(_local1 / 8) & _local4) << (_local1 % 32));
_local1 = _local1 + 8;
}
return(_local3);
}
static function binl2hex(binarray) {
var _local4 = new String("");
var _local3 = new String("0123456789abcdef");
var _local1 = 0;
while (_local1 < (binarray.length * 4)) {
_local4 = _local4 + (_local3.charAt((binarray[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((binarray[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(_local4);
}
}
Symbol 251 Button
on (release) {
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 256 Button
on (release) {
getURL ("http://castlecrashers.com/welcome.html", "_blank");
}
Symbol 274 MovieClip Frame 1
tom.onPress = function () {
getURL ("https://tomfulp.newgrounds.com", "_blank");
};
bom.onPress = function () {
getURL ("http://www.bomtoons.com", "_blank");
};
luis.onPress = function () {
getURL ("http://www.luiscastanon.com", "_blank");
};
coals.onPress = function () {
getURL ("https://coaly.newgrounds.com", "_blank");
};
Symbol 280 MovieClip Frame 1
if (!this.beenhere) {
this.onPress = function () {
this._parent._parent.goAhead();
delete this.onPress;
};
this.beenhere = true;
}
Symbol 281 MovieClip Frame 1
stopAllSounds();
Symbol 281 MovieClip Frame 80
_root.rdy = true;
Symbol 281 MovieClip Frame 105
stop();
Symbol 336 MovieClip Frame 1
stop();
Symbol 336 MovieClip Frame 120
stop();
_root.gotoAndStop(3);
Symbol 352 MovieClip [special1] Frame 27
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 360 MovieClip [special3] Frame 17
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 387 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 391 MovieClip Frame 1941
_root.kongregateStats.submit("watchCredits", 1);
Symbol 391 MovieClip Frame 2405
stop();
Symbol 392 MovieClip [winscreen] Frame 3
_root.winPresses();
Symbol 392 MovieClip [winscreen] Frame 90
stop();
Symbol 425 MovieClip [leveluptext] Frame 78
this.unloadMovie();
this.removeMovieClip();
stop();
Symbol 478 MovieClip Frame 4
_root.testHit(this.box, 3, this._parent._parent);
_root.momentum(this._parent._parent, 3);
Symbol 478 MovieClip Frame 9
_root.endAttack(this._parent._parent);
stop();
Symbol 494 MovieClip Frame 5
_root.testHit(this.box, 3, this._parent._parent);
_root.momentum(this._parent._parent, 3);
Symbol 494 MovieClip Frame 10
_root.endAttack(this._parent._parent);
stop();
Symbol 498 MovieClip Frame 4
_root.runJump(this._parent._parent);
Symbol 504 MovieClip Frame 4
_root.jumpRecover(this._parent._parent);
Symbol 521 MovieClip Frame 3
_root.makeFireball(this._parent._parent);
Symbol 521 MovieClip Frame 8
_root.endAttack(this._parent._parent, 3);
Symbol 542 MovieClip Frame 5
_root.momentum(this._parent._parent, 3);
Symbol 542 MovieClip Frame 6
_root.testHit(this.box, 1, this._parent._parent);
Symbol 542 MovieClip Frame 11
_root.endAttack(this._parent._parent);
stop();
Symbol 571 MovieClip Frame 25
this._parent._parent.stoned = true;
Symbol 571 MovieClip Frame 61
_root.loseLife();
stop();
Symbol 591 MovieClip Frame 24
_root.squashrecover(this._parent._parent);
Symbol 597 MovieClip [k4] Frame 1
stop();
Symbol 647 MovieClip Frame 4
_root.testHit(this.box, 1, this._parent._parent);
_root.momentum(this._parent._parent, 3);
Symbol 647 MovieClip Frame 11
_root.endAttack(this._parent._parent);
stop();
Symbol 662 MovieClip Frame 4
_root.momentum(this._parent._parent, 3);
Symbol 662 MovieClip Frame 6
_root.testHit(this.box, 1, this._parent._parent);
Symbol 662 MovieClip Frame 12
_root.endAttack(this._parent._parent);
stop();
Symbol 665 MovieClip Frame 4
_root.runJump(this._parent._parent);
Symbol 672 MovieClip Frame 4
_root.jumpRecover(this._parent._parent);
Symbol 691 MovieClip Frame 10
if (this._parent._parent._xscale == 100) {
_root.runSpecial(this._parent._parent._x + 105, this._parent._parent._y - 32, 3, 1);
} else {
_root.runSpecial(this._parent._parent._x - 105, this._parent._parent._y - 32, 3, -1);
}
Symbol 691 MovieClip Frame 14
_root.endAttack(this._parent._parent, 3);
Symbol 696 MovieClip Frame 4
_root.makeFireball(this._parent._parent);
Symbol 696 MovieClip Frame 9
_root.endAttack(this._parent._parent, 3);
Symbol 713 MovieClip Frame 5
_root.testHit(this.box, 1, this._parent._parent);
Symbol 713 MovieClip Frame 6
_root.momentum(this._parent._parent, -3);
Symbol 713 MovieClip Frame 10
_root.endAttack(this._parent._parent);
stop();
Symbol 731 MovieClip Frame 4
_root.momentum(this._parent._parent, 3);
Symbol 731 MovieClip Frame 5
_root.testHit(this.box, 1, this._parent._parent);
Symbol 731 MovieClip Frame 10
_root.endAttack(this._parent._parent);
stop();
Symbol 744 MovieClip Frame 25
this._parent._parent.stoned = true;
Symbol 744 MovieClip Frame 61
_root.loseLife();
stop();
Symbol 745 MovieClip Frame 1
loc = this._parent._parent;
loc.xvel = 0;
loc.yvel = 0;
if (loc._xscale > 0) {
loc._x = loc._x - 5;
} else {
loc._x = loc._x + 5;
}
Symbol 745 MovieClip Frame 8
loc = this._parent._parent;
if (loc._xscale > 0) {
loc._x = loc._x - 5;
} else {
loc._x = loc._x + 5;
}
Symbol 745 MovieClip Frame 16
loc = this._parent._parent;
if (loc._xscale > 0) {
loc._x = loc._x - 5;
} else {
loc._x = loc._x + 5;
}
Symbol 745 MovieClip Frame 24
loc = this._parent._parent;
if (loc._xscale > 0) {
loc._x = loc._x - 5;
} else {
loc._x = loc._x + 5;
}
Symbol 745 MovieClip Frame 32
loc = this._parent._parent;
if (loc._xscale > 0) {
loc._x = loc._x - 5;
} else {
loc._x = loc._x + 5;
}
Symbol 745 MovieClip Frame 41
loc = this._parent._parent;
if (loc._xscale > 0) {
loc._x = loc._x - 5;
} else {
loc._x = loc._x + 5;
}
Symbol 745 MovieClip Frame 49
loc = this._parent._parent;
if (loc._xscale > 0) {
loc._x = loc._x - 5;
} else {
loc._x = loc._x + 5;
}
Symbol 745 MovieClip Frame 58
loc = this._parent._parent;
if (loc._xscale > 0) {
loc._x = loc._x - 5;
} else {
loc._x = loc._x + 5;
}
Symbol 745 MovieClip Frame 66
loc = this._parent._parent;
while (!_root.wrap.bg.hitTest(loc._x, loc._y, true)) {
loc._y = loc._y + 1;
}
this._parent.gotoAndStop("ground");
Symbol 758 MovieClip Frame 24
_root.squashrecover(this._parent._parent);
Symbol 759 MovieClip [k3] Frame 1
stop();
Symbol 786 MovieClip Frame 4
_root.testHit(this.box, 1, this._parent._parent);
_root.momentum(this._parent._parent, 3);
Symbol 786 MovieClip Frame 5
_root.momentum(this._parent._parent, 3);
Symbol 786 MovieClip Frame 9
_root.endAttack(this._parent._parent);
stop();
Symbol 797 MovieClip Frame 6
_root.testHit(this.box, 1, this._parent._parent);
_root.momentum(this._parent._parent, 3);
Symbol 797 MovieClip Frame 13
_root.endAttack(this._parent._parent);
stop();
Symbol 799 MovieClip Frame 4
_root.runJump(this._parent._parent);
Symbol 805 MovieClip Frame 4
_root.jumpRecover(this._parent._parent);
Symbol 810 MovieClip Frame 6
_root.makeFireball(this._parent._parent);
Symbol 810 MovieClip Frame 11
_root.endAttack(this._parent._parent, 3);
Symbol 828 MovieClip Frame 3
_root.momentum(this._parent._parent, 4);
_root.testHit(this.box, 1, this._parent._parent);
Symbol 828 MovieClip Frame 5
_root.testHit(this.box, 1, this._parent._parent);
Symbol 828 MovieClip Frame 7
_root.testHit(this.box, 1, this._parent._parent);
Symbol 828 MovieClip Frame 16
_root.endAttack(this._parent._parent);
stop();
Symbol 841 MovieClip Frame 3
_root.momentum(this._parent._parent, 3);
Symbol 841 MovieClip Frame 4
_root.testHit(this.box, 1, this._parent._parent);
Symbol 841 MovieClip Frame 10
_root.endAttack(this._parent._parent);
stop();
Symbol 849 MovieClip Frame 25
this._parent._parent.stoned = true;
Symbol 849 MovieClip Frame 61
_root.loseLife();
stop();
Symbol 862 MovieClip Frame 24
_root.squashrecover(this._parent._parent);
Symbol 863 MovieClip [k2] Frame 1
stop();
Symbol 889 MovieClip Frame 5
_root.testHit(this.box, 1, this._parent._parent);
_root.momentum(this._parent._parent, 3);
Symbol 889 MovieClip Frame 10
_root.endAttack(this._parent._parent);
stop();
Symbol 902 MovieClip Frame 4
_root.momentum(this._parent._parent, 3);
_root.testHit(this.box, 1, this._parent._parent);
Symbol 902 MovieClip Frame 11
_root.endAttack(this._parent._parent);
stop();
Symbol 905 MovieClip Frame 4
_root.runJump(this._parent._parent);
Symbol 912 MovieClip Frame 4
_root.jumpRecover(this._parent._parent);
Symbol 920 MovieClip Frame 3
_root.makeFireball(this._parent._parent);
Symbol 920 MovieClip Frame 9
_root.endAttack(this._parent._parent, 3);
Symbol 937 MovieClip Frame 5
_root.momentum(this._parent._parent, 2);
_root.testHit(this.box, 1, this._parent._parent);
Symbol 937 MovieClip Frame 9
_root.momentum(this._parent._parent, -3);
Symbol 937 MovieClip Frame 13
_root.endAttack(this._parent._parent);
stop();
Symbol 951 MovieClip Frame 3
_root.momentum(this._parent._parent, 3);
Symbol 951 MovieClip Frame 4
_root.testHit(this.box, 1, this._parent._parent);
Symbol 951 MovieClip Frame 9
_root.endAttack(this._parent._parent);
stop();
Symbol 959 MovieClip Frame 25
this._parent._parent.stoned = true;
Symbol 959 MovieClip Frame 61
_root.loseLife();
stop();
Symbol 972 MovieClip Frame 24
_root.squashrecover(this._parent._parent);
Symbol 973 MovieClip [k1] Frame 1
stop();
Symbol 1004 MovieClip Frame 4
_root.testHit(this.box, 2, this._parent._parent);
_root.momentum(this._parent._parent, 3);
Symbol 1004 MovieClip Frame 11
_root.endAttack(this._parent._parent);
stop();
Symbol 1025 MovieClip Frame 6
_root.testHit(this.box, 2, this._parent._parent);
_root.momentum(this._parent._parent, 3);
Symbol 1025 MovieClip Frame 13
_root.endAttack(this._parent._parent);
stop();
Symbol 1030 MovieClip Frame 4
_root.runJump(this._parent._parent);
Symbol 1036 MovieClip Frame 4
_root.jumpRecover(this._parent._parent);
Symbol 1045 MovieClip Frame 3
_root.makeFireball(this._parent._parent);
Symbol 1045 MovieClip Frame 20
_root.endAttack(this._parent._parent, 3);
Symbol 1071 MovieClip Frame 7
_root.testHit(this.box, 3, this._parent._parent);
Symbol 1071 MovieClip Frame 8
_root.momentum(this._parent._parent, 4);
Symbol 1071 MovieClip Frame 13
_root.endAttack(this._parent._parent);
stop();
Symbol 1087 MovieClip Frame 4
_root.momentum(this._parent._parent, 3);
Symbol 1087 MovieClip Frame 5
_root.testHit(this.box, 2, this._parent._parent);
Symbol 1087 MovieClip Frame 11
_root.endAttack(this._parent._parent);
stop();
Symbol 1095 MovieClip Frame 25
this._parent._parent.stoned = true;
Symbol 1095 MovieClip Frame 61
_root.loseLife();
stop();
Symbol 1108 MovieClip Frame 24
_root.squashrecover(this._parent._parent);
Symbol 1109 MovieClip [k0] Frame 1
stop();
Symbol 1114 MovieClip [hitpoof] Frame 6
this.unloadMovie();
this.removeMovieClip();
stop();
Symbol 1115 MovieClip [gstone] Frame 37
this.cacheAsBitmap = true;
stop();
Symbol 1128 MovieClip [gameover] Frame 116
_root.showOver();
Symbol 1128 MovieClip [gameover] Frame 184
stop();
Symbol 1146 MovieClip [bigsplode] Frame 10
this.unloadMovie();
this.removeMovieClip();
stop();
Symbol 1165 MovieClip [fabuloustext] Frame 78
this.unloadMovie();
this.removeMovieClip();
stop();
Symbol 1211 MovieClip [special0] Frame 37
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 1221 MovieClip [special4] Frame 37
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 1237 MovieClip Frame 1
stop();
Symbol 1239 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1241 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1269 MovieClip Frame 1
stop();
Symbol 1279 MovieClip Frame 5
_root.hitRecover(this._parent._parent);
Symbol 1298 MovieClip Frame 23
_root.makeInv();
_root.checkBossHit(this.box);
Symbol 1298 MovieClip Frame 24
_root.checkBossHit(this.box);
Symbol 1298 MovieClip Frame 25
_root.checkBossHit(this.box);
Symbol 1298 MovieClip Frame 26
_root.checkBossHit(this.box);
Symbol 1298 MovieClip Frame 27
_root.checkBossHit(this.box);
Symbol 1298 MovieClip Frame 28
_root.checkBossHit(this.box);
Symbol 1298 MovieClip Frame 34
_root.endBossAttack(this._parent._parent);
Symbol 1337 MovieClip Frame 21
_root.checkBossHit(this.box);
_root.makeInv();
Symbol 1337 MovieClip Frame 22
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 23
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 24
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 25
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 26
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 27
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 28
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 29
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 30
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 31
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 32
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 33
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 34
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 35
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 36
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 37
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 38
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 39
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 40
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 41
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 42
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 43
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 44
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 45
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 46
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 47
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 48
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 49
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 50
_root.checkBossHit(this.box);
Symbol 1337 MovieClip Frame 53
_root.endBossAttack(this._parent._parent);
Symbol 1374 MovieClip Frame 23
_root.flashIt();
Symbol 1374 MovieClip Frame 24
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 25
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 26
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 27
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 28
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 29
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 30
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 31
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 32
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 33
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 34
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 35
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 36
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 37
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 38
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 39
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 40
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 41
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 42
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 43
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 44
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 45
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 46
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 47
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 48
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 49
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 50
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 51
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 52
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 53
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 54
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 55
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 56
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 57
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 58
_root.checkBossHit(this.box, true);
Symbol 1374 MovieClip Frame 67
_root.bossMove(this._parent._parent);
_root.endBossAttack(this._parent._parent);
Symbol 1377 MovieClip Frame 19
stop();
Symbol 1378 MovieClip Frame 9
_root.flashIt();
Symbol 1378 MovieClip Frame 21
_root.flashIt();
Symbol 1378 MovieClip Frame 33
_root.flashIt();
Symbol 1378 MovieClip Frame 48
_root.flashIt();
Symbol 1378 MovieClip Frame 52
_root.flashIt();
Symbol 1378 MovieClip Frame 62
_root.flashIt();
Symbol 1378 MovieClip Frame 77
_root.flashIt();
Symbol 1378 MovieClip Frame 87
_root.flashIt();
Symbol 1378 MovieClip Frame 94
_root.flashIt();
Symbol 1378 MovieClip Frame 99
_root.flashIt();
Symbol 1378 MovieClip Frame 107
_root.flashIt();
Symbol 1378 MovieClip Frame 113
_root.flashIt();
Symbol 1378 MovieClip Frame 128
_root.flashIt();
Symbol 1378 MovieClip Frame 137
_root.flashIt();
Symbol 1378 MovieClip Frame 148
_root.flashIt();
Symbol 1378 MovieClip Frame 156
_root.flashIt();
Symbol 1378 MovieClip Frame 165
_root.flashIt();
Symbol 1378 MovieClip Frame 179
_root.switchBoss();
Symbol 1386 MovieClip Frame 30
_root.skullChange();
Symbol 1405 MovieClip Frame 17
_root.pausy = true;
dude = _root.wrap.d;
if (!dude.jumping) {
dude.guts.gotoAndStop("rest");
}
Symbol 1405 MovieClip Frame 43
_root.flashIt();
Symbol 1405 MovieClip Frame 80
_root.winIt();
stop();
Symbol 1406 MovieClip Frame 1
stop();
Symbol 1408 MovieClip Frame 5
gotoAndStop ("rest");
Symbol 1412 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1427 MovieClip Frame 1
stop();
Symbol 1427 MovieClip Frame 95
_root.endSummon();
Symbol 1427 MovieClip Frame 96
stop();
Symbol 1446 MovieClip Frame 1
stop();
Symbol 1446 MovieClip Frame 95
_root.endSummon();
Symbol 1446 MovieClip Frame 96
stop();
Symbol 1456 MovieClip Frame 1
stop();
Symbol 1456 MovieClip Frame 4
this.gotoAndPlay(2);
Symbol 1465 MovieClip Frame 18
stop();
Symbol 1472 MovieClip Frame 7
stop();