Frame 1
saveFile = SharedObject.getLocal("ballSave");
_root.API_Settings = {movie_id:8413, enc_key:"Vynfa6nwGuVsIofKn1TsNYnRWF7OFZkA", debug_mode:false, movie_version:""};
function qq1() {
_quality = "LOW";
}
function qq2() {
_quality = "MEDIUM";
}
function qq3() {
_quality = "HIGH";
}
function uu0() {
getURL ("http://www.newgrounds.com/", "_blank");
}
function uu1() {
getURL ("http://gonzossm.newgrounds.com/", "_blank");
}
function uu2() {
getURL ("http://foreverkul.newgrounds.com/", "_blank");
}
function uu3() {
getURL ("http://maestrorage.newgrounds.com/", "_blank");
}
function dd() {
}
stop();
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var copyr = new ContextMenuItem("\u00A9Copyright 2009 Toss the Turtle", dd);
var credArt = new ContextMenuItem("Art drawn by Gonzo", uu1);
var credProg = new ContextMenuItem("Programed by Foreverkul", uu2);
var sponsor = new ContextMenuItem("Newgrounds.com", uu0);
var credMu = new ContextMenuItem("Music MaestroRage", uu3);
var q1 = new ContextMenuItem("Quality Low", qq1);
var q2 = new ContextMenuItem("Quality Medium", qq2);
var q3 = new ContextMenuItem("Quality High", qq3);
myMenu.customItems.push(credArt, credProg, sponsor, credMu, q1, q2, q3, copyr);
_root.menu = myMenu;
Frame 2
stop();
_root.CPMStarMaskClip.removeMovieClip();
_root.setMask(null);
Frame 3
stop();
_quality = "MEDIUM";
rad = 57.2957795130823;
go = 0;
dis = 0;
MUSIC = true;
totalDis = ((saveFile.data.totalDis != undefined) ? (saveFile.data.totalDis) : 0);
totalTries = ((saveFile.data.totalTries != undefined) ? (saveFile.data.totalTries) : 0);
totalCash = ((saveFile.data.totalCash != undefined) ? (saveFile.data.totalCash) : 0);
allCash = ((saveFile.data.allCash != undefined) ? (saveFile.data.allCash) : 0);
backing = 1 + random(3);
fallLine = 450;
bloodNum = 0;
allLand = 3;
debree = 0;
hasMine = ((saveFile.data.hasMine != undefined) ? (saveFile.data.hasMine) : 0);
nuclear = 0;
allNukes = ((saveFile.data.allNukes != undefined) ? (saveFile.data.allNukes) : 0);
jetPack = ((saveFile.data.jetPack != undefined) ? (saveFile.data.jetPack) : 0);
packTime = 90;
jetSpeed = [[-0.1, 2], [-0.6, 5], [-0.1, 8]];
jjsound = ["rocker", "rocker", "missile"];
jetting = 0;
jet._visible = false;
jeepy = 0;
setUp = 0;
bestDis = ((saveFile.data.bestDis != undefined) ? (saveFile.data.bestDis) : 0);
sign._x = bestDis * 10;
sign.go = bestDis * 10;
sign.bes = bestDis;
awarded = 0;
outter = 300;
aaa.swapDepths(90000);
cannon.swapDepths(10000);
ball.swapDepths(11000);
flame.swapDepths(11001);
shotit.swapDepths(11002);
pointer.swapDepths(12000);
hud.swapDepths(13000);
board.swapDepths(14000);
jet.swapDepths(11100);
mined.swapDepths(9900);
sign.swapDepths(3800);
shop.swapDepths(18100);
medchart.swapDepths(18200);
gunRack.swapDepths(18500);
crosshair.swapDepths(18000);
farBack._x = -20;
farBack._y = -20;
farBack.gotoAndStop(backing);
nuker.swapDepths(3990);
nukeBack.swapDepths(3995);
www.swapDepths(15000);
www._visible = false;
www._x = -20;
www._y = -20;
www._width = 840;
www._height = 540;
farBack.setMask(masky);
masky._width = 800;
masky._height = 500;
masky._x = 0;
masky._y = 0;
stag = 0;
speed = 5;
mspeed = [250, 500, 1500, 3000, 8000];
canLen = [175, 188, 220, 325, 240];
canSound = ["oldCannon", "bigCannon", "superCannon", "goldCannon", "superCannon"];
canNum = ((saveFile.data.canNum != undefined) ? (saveFile.data.canNum) : 1);
cannon.base.gotoAndStop(canNum);
cannon.cc.gotoAndStop(canNum);
cannon.base.b.b._y = 70 - ((speed / mspeed[canNum - 1]) * 70);
goods = 0;
maxGoods = 40;
xnew = 0;
bads = 0;
maxBads = 30;
xnew2 = 0;
newD = 850 + random(400);
newD2 = 850 + random(400);
bloodyEnd = 0;
boringLife = 0;
unlucky = 0;
flyHigh = 0;
reachStars = 0;
jumpy = 0;
bombBounces = 0;
function resetAll() {
go = 0;
_x = -1;
_y = 0;
speed = 5;
ball._x = -100;
ball.gotoAndStop(1);
backing = random(3) + 1;
curAmmo = ammos[equipped];
groundmove();
powpointer();
i = 0;
while (i < bloodNum) {
this["bb" + i].removeMovieClip();
i++;
}
i = 0;
while (i < maxGoods) {
this["gg" + i].removeMovieClip();
i++;
}
i = 0;
while (i < maxBads) {
this["bd" + i].removeMovieClip();
i++;
}
i = 0;
while (i <= 20) {
this["dd" + i].removeMovieClip();
i++;
}
i = 0;
while (i < allLand) {
this["bgfar" + i].num = i;
this["bgstar" + i].num = i;
i++;
}
j = 0;
while (j < spaces) {
this["pp" + j].xx = j * 1000;
j++;
}
j = 0;
while (j < clouders) {
this["cds" + j].xx = j * 1000;
this["cds" + j].gotoAndStop(backing);
j++;
}
lastX = 0;
lastXC = 0;
bloodNum = 0;
goods = 0;
bads = 0;
xnew = 0;
xnew2 = 0;
newD = 850 + random(400);
newD2 = 850 + random(400);
jetting = 0;
jeepy = 0;
board._y = (-topper) - 2000;
board._x = -2000;
setUp = 0;
inShop = 0;
awarded = 0;
www._visible = false;
bloodyEnd = 0;
birdie = 0;
unlucky = 0;
flyHigh = 0;
reachStars = 0;
jumpy = 0;
bombBounces = 0;
goodBall = 0;
goodTime = 10;
badBall = 0;
badTime = 10;
groundmove();
saveSave();
}
function showBoard() {
if (setUp == 0) {
board.dis = dis;
if (dis > bestDis) {
sign.go = ball._x;
sign.bes = dis;
bestDis = dis;
}
board._y = (-topper) - 1000;
board.hint = "Hints and Tips: " + hinter[random(hinter.length)];
setUp = 1;
} else {
board._x = -_x;
board._y = board._y + (((lockY + 100) - board._y) / 15);
}
}
function displayHUD() {
if (player._currentframe == 1) {
hud._x = -_x;
hud._y = (-_y) + 460;
}
hud.a._alpha = (80 * hasMine) + 20;
hud.b.gotoAndStop(jetPack);
hud.b._alpha = (80 * ((jetPack > 0) && (jetting == 0))) + 20;
hud.c._alpha = (80 * (allNukes >= 1)) + 20;
hud.d._alpha = 100 * (allNukes > 1);
((allNukes > 2) ? ((hud.nn = "x" + allNukes)) : ((hud.nn = "")));
}
function medalStats() {
if (qz.nov && (dis > 5280)) {
updateMedals("Novice");
qz.nov = 0;
}
if (qz.am && (dis > 26400)) {
updateMedals("Amateur");
qz.am = 0;
}
if (qz.prof && (dis > 52800)) {
updateMedals("Professional");
qz.prof = 0;
}
if (qz.mas && (dis > 132000)) {
updateMedals("Master");
qz.mas = 0;
}
if (qz.wor && (dis > 264000)) {
updateMedals("WorldsEdge");
qz.wor = 0;
}
if (((qz.gol && (allGuns)) && (canNum == 5)) && (jetPack == 3)) {
updateMedals("Golden Shell");
qz.gol = 0;
}
if (qz.trav && (totalDis > 1000000)) {
updateMedals("Traveler");
qz.trav = 0;
}
if (qz.ad && (Math.floor(allTime / 30) > 7200)) {
updateMedals("Addicted");
qz.ad = 0;
}
if (qz.per && (Math.floor(allTime / 30) > 3600)) {
updateMedals("Persistent");
qz.per = 0;
}
if (qz.spa && (ball._y < -8000)) {
updateMedals("in Space");
qz.spa = 0;
}
}
function NGmedals() {
qz = new Object();
qz.nov = 1;
qz.am = 1;
qz.prof = 1;
qz.mas = 1;
qz.wor = 1;
qz.gol = 1;
qz.trav = 1;
qz.ad = 1;
qz.per = 1;
qz.spa = 1;
qz.nuk = 1;
qz.star = 1;
}
function updateMedals(n) {
checkMedal(n);
medal_list = com.Newgrounds.NewgroundsAPI.getMedals();
}
function checkMedal(n) {
var _local1 = 0;
while (_local1 < medal_list.length) {
var _local2 = medal_list[_local1];
if ((_local2.medal_name == n) && (!_local2.medal_unlocked)) {
getMedal(n);
}
_local1++;
}
}
function getMedal(n) {
_root.medal_popup.unlockMedal(n);
}
function playSound(id) {
if (SFX) {
this.createEmptyMovieClip("sss" + soundNum, 10500 + soundNum);
var _local2 = new Sound(this["sss" + soundNum]);
_local2.attachSound(id);
_local2.setVolume(120);
_local2.start();
((soundNum < 30) ? (soundNum++) : ((soundNum = 0)));
}
}
function saveSave() {
saveFile.data.exists = true;
saveFile.data.allTime = allTime;
saveFile.data.owned = owned;
saveFile.data.totalDis = totalDis;
saveFile.data.totalTries = totalTries;
saveFile.data.totalCash = totalCash;
saveFile.data.allCash = allCash;
saveFile.data.hasMine = hasMine;
saveFile.data.allNukes = allNukes;
saveFile.data.jetPack = jetPack;
saveFile.data.bestDis = bestDis;
saveFile.data.canNum = canNum;
saveFile.data.equipped = equipped;
saveFile.data.qz = qz;
saveFile.data.stats = statob;
saveFile.flush();
}
function clearSave() {
saveFile.clear();
dis = 0;
totalDis = 0;
totalTries = 0;
totalCash = 0;
allCash = 0;
hasMine = 0;
allNukes = 0;
jetPack = 0;
bestDis = 0;
allTime = 0;
canNum = 1;
equipped = 1;
owned = [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0];
qz = undefined;
stato = undefined;
statObject();
}
allTime = ((saveFile.data.allTime != undefined) ? (saveFile.data.allTime) : 0);
topper = 10000;
medal_popup.swapDepths(20000);
mdis.swapDepths(20001);
onEnterFrame = function () {
if (_root.CPMStarMaskClip) {
_root.CPMStarMaskClip.removeMovieClip();
}
allTime++;
if (go == 0) {
board.adder.gotoAndStop(1);
holdTime = 0;
tens = 0;
usedBullets = 0;
thisHits = 0;
aim();
xs = 0;
((newStart != 1) ? ((newStart = 1)totalTries++) : null);
} else if ((go == 1) || (go == 2)) {
aim();
powpointer();
} else if (go == 3) {
holdTime++;
((firstMusic != 0) ? ((firstMusic = 1)) : null);
getShot();
flying();
jetPacking();
dis = (Math.round(Math.round(ball._x) * 10) / 100) + (tens * 10000000);
dis = Math.max(0, dis);
if ((dis - (tens * 10000000)) > 10000000) {
backing = random(3) + 1;
groundmove();
i = 0;
while (i < bloodNum) {
this["bb" + i].removeMovieClip();
i++;
}
i = 0;
while (i < maxGoods) {
this["gg" + i].removeMovieClip();
i++;
}
i = 0;
while (i < maxBads) {
this["bd" + i].removeMovieClip();
i++;
}
i = 0;
while (i <= 20) {
this["dd" + i].removeMovieClip();
i++;
}
i = 0;
while (i < allLand) {
this["bgfar" + i].num = i;
this["bgstar" + i].num = i;
i++;
}
j = 0;
while (j < spaces) {
this["pp" + j].xx = j * 1000;
j++;
}
j = 0;
while (j < clouders) {
this["cds" + j].xx = j * 1000;
this["cds" + j].gotoAndStop(backing);
j++;
}
lastX = 0;
lastXC = 0;
bloodNum = 0;
goods = 0;
bads = 0;
xnew = 0;
xnew2 = 0;
newD = 850 + random(400);
newD2 = 850 + random(400);
ball._x = 0;
groundmove();
tens++;
}
} else if (go == 4) {
if (getUpTimer >= 1) {
(getUpTimer--);// not popped
} else {
(ball._rotation = 0);
(ball.gotoAndStop(2));// not popped
}
}
_x = (_x + ((((-ball._x) + 200) - _x) / 1.33));
_x = Math.min((-ball._x) + 700, Math.max((-ball._x) + 200, _x));
_x = Math.min(0, _x);
if (player._currentframe == 1) {
if (go > 3) {
if (inShop > 1) {
_y = (_y + ((((-lockY) + 560) - _y) / 10));
} else {
_y = (_y + ((((-ball._y) + 200) - _y) / 10));
}
}
if (go == 3) {
_y = (_y + ((((-ball._y) + 200) - _y) / 1.66));
_y = Math.min((-ball._y) + 350, Math.max((-ball._y) + 80, _y));
}
_y = Math.max(0, Math.min(topper, _y));
}
goodies();
baddies();
displayHUD();
bonusCombo();
nukeItAll();
shopping();
gunRacking();
hite = Math.floor((fallLine - ball._y) / 10);
hud.fsec = Math.max(0, Math.floor(dis)) + " feet";
hud.fsek = Math.max(0, Math.floor(hite)) + " feet high";
sign._x = sign._x + ((sign.go - sign._x) / 15);
if (go > 3) {
showBoard();
if (newStart != 1) {
} else {
saveSave();
(newStart = 0);
(onFire = 0);
(flame._alpha = 0);
(xs = 0);
_y = Math.max(0, Math.min(topper, (-ball._y) + 200));
Math.max(0, Math.min(topper, (-ball._y) + 200));
(lockY = -_y);
(board.adder.gotoAndStop(2));// not popped
}
}
groundmove();
if (firstMusic == 1) {
mm0.start();
firstMusic = 0;
}
(MUSIC ? (mm0.setVolume(40)) : (mm0.setVolume(0)));
crosshair._x = _xmouse;
crosshair._y = _ymouse;
if (go == 3) {
Mouse.hide();
crosshair._visible = true;
} else {
Mouse.show();
crosshair._visible = false;
}
aaa._x = lastX + (((-_x) - outter) * 0.9);
aaa._y = ball._y;
medalStats();
medal_popup._y = (-_y) + 20;
medal_popup._x = (-_x) + 290;
mdis._x = (-_x) + 730;
mdis._y = (-_y) + 70;
awardCheck();
};
groundmove();
_x = -1;
board.retry.onRelease = function () {
resetAll();
};
board.shop.onRelease = function () {
inShop = 1;
};
sign._y = fallLine;
hinter = new Array();
hinter[0] = "There is a secret button in the main shop menu";
hinter[1] = "Remember to use the WASD keys to move while flying";
hinter[2] = "Buy the next level as soon as possible";
hinter[3] = "The Chest bomb can save you from most hazards once";
hinter[4] = "Use your gun to shoot the turtle away from hazards";
hinter[5] = "Its most effective to shoot the turtle on the way down";
hinter[6] = "Use WASD to grab cash bags, farther bags hold more";
hinter[7] = "You can get extra ammunition, use it wisely";
hinter[8] = "You can buy multiple nukes";
hud.a._alpha = 20;
hud.b._alpha = 20;
hud.c._alpha = 20;
hud.d._alpha = 0;
NGmedals();
var medal_list = com.Newgrounds.NewgroundsAPI.getMedals();
soundNum = 0;
SFX = true;
shop.clearAll.onRelease = function () {
if (shop.clearAll._currentframe == 1) {
shop.clearAll.play();
} else {
clearSave();
shop.clearAll.gotoAndStop(1);
}
};
player._y = (-topper) - 2000;
shop.kwest.onRelease = function () {
savx = _x;
savy = _y;
player._x = ball._x + 200;
_y = (topper + 2250);
player.gotoAndPlay(2);
updateMedals("Question Mark");
};
this.createEmptyMovieClip("m0", 100);
mm0 = new Sound(m0);
mm0.attachSound("bg0");
mm0.onSoundComplete = function () {
mm0.start();
};
function aim() {
xx = _xmouse - cannon._x;
yy = _ymouse - cannon._y;
cannon.cc._rotation = Math.atan2(yy, xx) * rad;
cannon.cc._rotation = Math.max(Math.min(cannon.cc._rotation, 0), -80);
cannon.base.b.b._y = 70 - ((speed / mspeed[canNum - 1]) * 70);
cannon.cc._x = cannon.base.piv._x + cannon.base._x;
cannon.cc._y = cannon.base.piv._y + cannon.base._y;
cannon.base.gotoAndStop(canNum);
cannon.cc.gotoAndStop(canNum);
}
function getShot() {
if (shooted == 0) {
if (curAmmo > 0) {
xmx = ball._x - _xmouse;
ymy = ball._y - _ymouse;
mouseD = Math.sqrt((xmx * xmx) + (ymy * ymy));
switch (equipped) {
case 1 :
((mouseD < 40) ? ((ys = (-Math.abs(ys)) - 1)shotitDone()) : null);
playSound("slingshot");
shooted = 1;
break;
case 2 :
((mouseD < 60) ? ((xs = xs + (powers[equipped] * 2))(ys = (-Math.abs(ys)) - powers[equipped])shotitDone()) : null);
playSound("handgun");
shooted = 1;
break;
case 3 :
((mouseD < 40) ? ((xs = xs + (powers[equipped] * 2))(ys = (-Math.abs(ys)) - powers[equipped])shotitDone()) : null);
playSound("handgun");
shooted = 1;
break;
case 4 :
((mouseD < 100) ? ((xs = xs + ((powers[equipped] * 2) * Math.random()))(ys = (-Math.abs(ys)) - (powers[equipped] * Math.random()))shotitDone()) : null);
playSound("uzi");
shooted = 2;
break;
case 5 :
((mouseD < 90) ? ((xs = xs + ((powers[equipped] * 2) * Math.random()))(ys = (-Math.abs(ys)) - (powers[equipped] * Math.random()))shotitDone()) : null);
playSound("akk");
shooted = 2;
break;
case 6 :
((mouseD < 120) ? ((xs = xs + (powers[equipped] * 2))(ys = (-Math.abs(ys)) - powers[equipped])shotitDone()) : null);
playSound("shotty");
playSound("pump");
shooted = 1;
break;
case 7 :
((mouseD < 100) ? ((xs = xs + ((powers[equipped] * 2) * Math.random()))(ys = (-Math.abs(ys)) - (powers[equipped] * Math.random()))shotitDone()) : null);
playSound("shotty");
shooted = 2;
break;
case 8 :
((mouseD < 70) ? ((xs = xs + (powers[equipped] * 2))(ys = (-Math.abs(ys)) - powers[equipped])shotitDone()) : null);
playSound("sniper");
shooted = 1;
break;
case 9 :
((mouseD < 250) ? ((xs = xs + ((powers[equipped] * 2) / ((mouseD / 25) + 1)))(ys = (-Math.abs(ys)) - (powers[equipped] / ((mouseD / 25) + 1)))) : null);
playSound("bomb");
mined._x = _xmouse;
mined._y = _ymouse;
mined.gotoAndPlay(1);
shooted = 1;
break;
case 10 :
((mouseD < 80) ? ((xs = xs + (powers[equipped] * 2))(ys = (-Math.abs(ys)) - powers[equipped])shotitDone()) : null);
playSound("goldCannon");
shooted = 1;
break;
}
crosshair.play();
curAmmo--;
} else {
shooted = 1;
playSound("oops");
}
} else if (shooted == 2) {
shooted = 0;
}
}
function shotitDone() {
if ((ball._currentframe == ball._totalframes) || (ball._currentframe == 1)) {
ball.gotoAndStop(4);
} else {
ball.nextFrame();
}
shotit.gotoAndPlay(1);
}
function powpointer() {
if (speed >= mspeed[canNum - 1]) {
stag = 1;
} else if (speed <= 5) {
stag = 0;
}
if (stag == 0) {
speed = speed * 1.2;
speed = Math.min(speed, mspeed[canNum - 1]);
} else {
speed = speed * 0.9;
speed = Math.max(speed, 1);
}
if (go == 2) {
cannon.cc.c.play();
playSound(canSound[canNum - 1]);
((canNum == 5) ? (playSound("KABOMBB")playSound("jeep")playSound("sniper")) : null);
ball._x = (cannon._x + cannon.cc._x) + (Math.cos(cannon.cc._rotation / rad) * canLen[canNum - 1]);
ball._y = (cannon._y + cannon.cc._y) + (Math.sin(cannon.cc._rotation / rad) * canLen[canNum - 1]);
exSpeed = ((speed + (statob.m39 * speed)) + ((statob.m38 * 0.5) * speed)) + ((statob.m37 * 0.5) * speed);
(isNaN(exSpeed) ? ((exSpeed = speed)) : null);
xs = Math.cos(cannon.cc._rotation / rad) * exSpeed;
ys = Math.sin(cannon.cc._rotation / rad) * exSpeed;
go = 3;
}
}
function flying() {
((Key.isDown(87) && ((ys * 0.8) > 10)) ? ((ball._y = ball._y - Math.min(30, Math.abs(ys) * 0.2))) : null);
((Key.isDown(83) && ((ys * 0.8) < -10)) ? ((ball._y = ball._y + Math.min(30, Math.abs(ys) * 0.2))) : null);
(Key.isDown(68) ? ((ball._x = ball._x + 8)) : null);
((Key.isDown(65) && ((xs * 0.5) > 10)) ? ((ball._x = ball._x - 8)) : null);
(isNaN(xs) ? ((xs = 3000)) : null);
(isNaN(ys) ? ((ys = 1000)) : null);
xs = Math.max(0, xs);
ball._x = ball._x + Math.min(4000, xs * 0.5);
ball._y = ball._y + Math.max(-400, Math.min(400, ys * 0.6));
ys = Math.max(-3000, Math.min(3000, ys));
if (ball._y > fallLine) {
if ((Math.abs(xs) > 8) || (Math.abs(ys) > 10)) {
if (Math.abs(xs) < 10) {
closeCall++;
}
ball._y = fallLine;
bld.duplicateMovieClip("bb" + bloodNum, 4500 + bloodNum, {_x:ball._x, _y:fallLine});
bloodNum++;
ys = ys * -0.7;
xs = (xs + Math.abs(ys * 0.1)) * 0.7;
playSound("hit" + random(5));
if (Math.abs(ys) > 6) {
if ((ball._currentframe == ball._totalframes) || (ball._currentframe == 1)) {
ball.gotoAndStop(4);
} else {
ball.nextFrame();
}
spurt.duplicateMovieClip("bb" + bloodNum, 15000 + bloodNum, {_x:ball._x, _y:fallLine});
bloodNum++;
bounce++;
if (bombBounces >= maxBombs) {
maxBombs = bombBounces;
}
bombBounces = 0;
}
} else if (hasMine == 1) {
blowMine();
} else if (nuclear < 2) {
getUpTimer = 30;
go = 4;
}
} else if (jetting != 3) {
ys = ys + (1 + Math.abs(ys * 0.05));
ys = ys * 0.999;
xs = xs * 0.9999;
}
ball._rotation = ball._rotation + Math.max(0, Math.log(xs));
pointer._y = -topper;
pointer._x = ball._x;
pointer.hh = Math.round(hite - 1000);
pointer._visible = ball._y < ((-topper) - 50);
ball._y = Math.min(fallLine, ball._y);
flame._x = ball._x;
flame._y = ball._y;
flame._rotation = Math.atan2(ys, xs) * rad;
if (onFire > 0) {
flame._alpha = 100;
onFire--;
} else {
flame._alpha = flame._alpha - 4;
((flame._alpha < 5) ? ((flame._alpha = 0)) : null);
}
(((onFire == undefined) || (isNaN(onFire))) ? ((onFire = 0)) : null);
shotit._x = ball._x;
shotit._y = ball._y;
}
function blowMine() {
playSound("bomb");
mined._x = ball._x;
mined._y = ball._y;
mined.gotoAndPlay(1);
xs = xs + (Math.cos(-66 / rad) * 200);
ys = ys + (Math.sin(-66 / rad) * 200);
ball.gotoAndStop(1);
hasMine = 0;
}
function jetPacking() {
if (jetting == 1) {
playSound(jjsound[jetPack - 1]);
jet.gotoAndStop(jetPack);
jetting = 3;
jet._x = ball._x;
jet._y = ball._y;
ys = 0;
jtime = packTime;
} else if (jetting == 2) {
jetting = 3;
} else if (jetting == 3) {
jet._visible = true;
if (jetPack < 3) {
jet.swapDepths(11100);
ball.gotoAndStop(1);
ball._rotation = 0;
jet._x = ball._x;
jet._y = ball._y;
ys = ys + jetSpeed[jetPack - 1][0];
xs = xs + jetSpeed[jetPack - 1][1];
((jtime > 1) ? (jtime--) : ((jetting = 4)));
} else {
ball.gotoAndStop(4);
jet.swapDepths(10900);
ball._rotation = 90;
jet._x = ball._x;
jet._y = ball._y;
ys = ys + jetSpeed[jetPack - 1][0];
xs = xs + jetSpeed[jetPack - 1][1];
if (jtime < 1) {
playSound("bomb");
xs = xs + (Math.cos(-66 / rad) * 80);
ys = ys + (Math.sin(-66 / rad) * 120);
jetting = 4;
} else {
jtime--;
}
}
}
}
function nukeItAll() {
if (nuclear == 2) {
nuker._x = (-_x) + 400;
nuker._y = nuker._y + 25;
((nuker._y > fallLine) ? ((nuclear = 3)) : null);
} else if (nuclear == 3) {
updateMedals("Radioactive");
qz.nuk = 0;
playSound("nuked");
www._x = (-_x) - 20;
www._visible = true;
www.gotoAndPlay(1);
dland.duplicateMovieClip("nukeGround", 4100, {_x:-_x, _y:fallLine});
nukeGround.gotoAndStop(4);
nukeBack._x = (-_x) - 5;
nukeBack._y = 0;
nukeBack._alpha = 100;
tempAngle = -25 - random(40);
xs = xs + (Math.cos(tempAngle / rad) * 1000);
ys = ys + (Math.sin(tempAngle / rad) * 1000);
nuclear = 4;
} else if (nuclear == 4) {
_y = 0;
_x = (_x - random(10));
_y = (_y + random(10));
masky._x = -_x;
masky._y = -_y;
nukeBack._x = (-_x) - 5;
nukeBack._y = nukeBack._y - 2;
nukeBack._alpha = nukeBack._alpha - 0.4;
nukeGround._x = -_x;
nukeGround._alpha = nukeGround._alpha - 0.6;
if (nukeBack._alpha < 1) {
_y = 0;
masky._y = 0;
allNukes--;
nuclear = 0;
nukeGround.removeMovieClip();
}
}
www._x = (-_x) - 20;
}
shooted = 1;
onMouseDown = function () {
(((go == 0) && (_ymouse < 470)) ? ((go = 1)) : null);
if ((go == 3) && (_ymouse < (hud._y - 20))) {
shooted = 0;
}
_root.CPMStarMaskClip.removeMovieClip();
_root.setMask(null);
};
onMouseUp = function () {
((go == 1) ? ((go = 2)(qz.star ? (updateMedals("Gold Star")(qz.star = 0)) : null)) : null);
shooted = 1;
};
flame._alpha = 0;
hud.b.onRelease = function () {
(((jetting == 0) && (jetPack > 0)) ? ((jetting = 1)) : null);
};
hud.c.onRelease = function () {
if (((nuclear == 0) && (go == 3)) && (allNukes >= 1)) {
nuker._x = ball._x + 200;
nuker._y = -500;
nuclear = 2;
}
};
function goodies() {
if (((goodTime < 1) && (ball._x > (goodBall + 150))) || (ball._x > (goodBall + 1500))) {
spawnedAll = (4 + (statob.m9 * 1)) + (statob.m8 * 1);
trace(spawnedAll);
xnew = ball._x + 800;
if (((ball._y > -1000) && (random(20) == 0)) && (spawnedAll > 0)) {
xnew = xnew + (150 + random(300));
boomer.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:fallLine, p:80, hite:20, typ:0});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
spawnedAll--;
}
if (((random(20) == 0) && (ball._x > 25000)) && (spawnedAll > 0)) {
i = 0;
while (i < 3) {
xnew = xnew + (150 + random(300));
flot.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:Math.min((ball._y + random(1000)) - random(1000), fallLine - 500), p:50, hite:10, typ:1});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
i++;
}
spawnedAll--;
}
if ((((ball._y > -1000) && (random(30) == 0)) && (ball._x > 100000)) && (spawnedAll > 0)) {
xnew = xnew + (150 + random(300));
bomber.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:fallLine, p:150, hite:80, typ:5});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
spawnedAll--;
}
if (((ball._y > -1000) && (random(10) == 0)) && (spawnedAll > 0)) {
xnew = xnew + (150 + random(300));
goob.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:fallLine, p:20, hite:20, typ:2});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
spawnedAll--;
}
if ((((ball._y > -1000) && (random(35) == 0)) && (xs < 30)) && (spawnedAll > 0)) {
xnew = xnew + (150 + random(300));
bana.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:fallLine, p:250, hite:0, typ:3});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
spawnedAll--;
}
if (((ball._y > -1000) && (random(30) == 0)) && (spawnedAll > 0)) {
xnew = xnew + (150 + random(300));
dad.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:fallLine, p:150, hite:0, typ:12});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
spawnedAll--;
}
if (((ball._y > -1000) && (random(25) == 0)) && (spawnedAll > 0)) {
xnew = xnew + (150 + random(300));
dog.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:fallLine, p:0, hite:0, typ:4});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
spawnedAll--;
}
if ((((ball._y > -1000) && (random(25) == 0)) && (ball._x > 200000)) && (spawnedAll > 0)) {
xnew = xnew + (150 + random(300));
dug.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:fallLine, p:50, hite:80, typ:6});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
spawnedAll--;
}
if (((random(20) == 0) && (ball._x > 350000)) && (spawnedAll > 0)) {
xnew = xnew + (150 + random(300));
burd.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:Math.min((ball._y + random(1000)) - random(1000), fallLine - 1000), p:50, typ:7});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
spawnedAll--;
}
if (((random(20) == 0) && (ball._x > 300000)) && (spawnedAll > 0)) {
i = 0;
while (i < 2) {
xnew = xnew + (150 + random(300));
temph = Math.min((ball._y + random(1000)) - random(1000), fallLine - 600);
blon.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:temph, p:0, typ:8});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
tempr = random(16);
if ((tempr < 5) && (ball._x > 350000)) {
boomer.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:temph, p:150, hite:20, typ:0});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
} else if (tempr < 10) {
goob.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:temph, p:25, hite:20, typ:2});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
} else {
sbal.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:xnew, _y:temph, p:0, typ:9});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
}
i++;
}
spawnedAll--;
}
if ((((ball._y > -1000) && (random(30) == 0)) && (go == 3)) && (jeepy != 1)) {
jeep.duplicateMovieClip("jj", 6020, {_x:ball._x - 400, _y:fallLine, d:20, hite:20, t:0});
jeepy = 1;
}
if (random(5) == 0) {
if (random(8) == 0) {
ammoBag.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:ball._x + 1000, _y:Math.min((ball._y + random(1000)) - random(1000), fallLine - 200), typ:10});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
} else {
moneyBag.duplicateMovieClip("gg" + goods, 6000 + goods, {_x:ball._x + 1000, _y:Math.min((ball._y + random(1000)) - random(1000), fallLine - 200), typ:11});
((goods < maxGoods) ? (goods++) : ((goods = 0)));
}
}
goodBall = ball._x;
goodTime = (30 - (statob.m9 * 5)) - (statob.m8 * 5);
}
goodTime--;
i = 0;
while (i < maxGoods) {
gq = this["gg" + i];
((gq._x < ((-_x) - 100)) ? (gq.removeMovieClip()) : null);
gq.hit._height = gq.hite + Math.round(Math.abs(ys));
horiTest = (((-_x) - 100) < gq._x) && (gq._x < ((-_x) + 900));
vertTest = (((-_y) - 300) < gq._y) && (gq._y < ((-_y) + 800));
if (horiTest && (vertTest)) {
if (gq._currentframe == gq._totalframes) {
gq.gotoAndStop(1);
}
if (((gq.typ == 0) || (gq.typ == 1)) || (gq.typ == 5)) {
if (gq.hit.hitTest(ball)) {
ys = -Math.abs(ys);
tx = (ball._x - gq._x) - 200;
ty = ball._y - gq._y;
ang = Math.atan(ty, tx);
tmpow = ((gq.p + ((gq.p * statob.m13) * 0.1)) + ((gq.p * statob.m14) * 0.3)) + ((gq.p * statob.m15) * 0.6);
xs = xs + (Math.cos(ang) * tmpow);
ys = ys - Math.abs(Math.sin(ang) * tmpow);
gq.gotoAndStop(2);
playSound("bomb");
if (gq.typ == 5) {
playSound("jeep");
}
bombBounce++;
bombs++;
statob.bombs++;
((gq.typ == 0) ? ((statob.land = 1)) : null);
((gq.typ == 1) ? ((statob.float = 1)) : null);
((gq.typ == 5) ? ((statob.bigbomb = 1)) : null);
}
} else if (gq.typ == 2) {
if (gq.hit.hitTest(ball)) {
updateMedals("Jump Man");
qz.jmp = 0;
playSound("goomba");
ys = -Math.abs(ys);
ang = -20 - random(50);
ds = Math.sqrt((xs * xs) + (ys * ys));
tmpow = (((gq.p + ((gq.p * statob.m1) * 0.1)) + ((gq.p * statob.m2) * 0.2)) + ((gq.p * statob.m3) * 0.3)) + ((gq.p * statob.m4) * 0.4);
xs = Math.cos(ang / rad) * (ds + tmpow);
ys = Math.sin(ang / rad) * (ds + tmpow);
gq.gotoAndStop(2);
stomper++;
statob.jumper++;
}
} else if (gq.typ == 3) {
if (go < 4) {
gq._x = gq._x - 8;
} else {
gq.gotoAndStop(3);
(((Math.abs(gq._x - ball.x) < 1000) && (banned != 1)) ? ((banned = 1)playSound("oops")) : null);
}
if (gq.hitTest(ball) && (!gq.done)) {
updateMedals("Strong Armed");
qz.arm = 0;
playSound("banana");
playSound("show");
ys = (((-Math.abs(ys)) - gq.p) - ((gq.p * statob.m28) * 0.5)) - ((gq.p * statob.m29) * 0.5);
xs = xs + (gq.p / 2);
gq.done = true;
gq.gotoAndStop(2);
statob.banana = 1;
}
} else if (gq.typ == 4) {
if (((ball._x - 100) < gq._x) && (ball._x > gq._x)) {
((ball._y > 10) ? (playSound("dogGun")) : null);
ys = ys - (1 + (1000 / (1 + Math.abs((fallLine + 100) - ball._y))));
statob.dogger = 1;
}
} else if (gq.typ == 6) {
if (gq.hit.hitTest(ball)) {
updateMedals("Harrasment");
qz.har = 0;
playSound("duglet");
ys = (-Math.abs(ys)) - gq.p;
ang = -10 - random(70);
ds = Math.sqrt((xs * xs) + (ys * ys)) + (statob.m19 * gq.p);
xs = Math.cos(ang / rad) * ds;
ys = Math.sin(ang / rad) * ds;
gq.gotoAndStop(2);
statob.dug = 1;
}
} else if (gq.typ == 7) {
gq._x = gq._x + 5;
if (gq.hitTest(ball) && (gq.h != 1)) {
ang = ((gq._y > ball._y) ? -45 : 45);
ds = (Math.sqrt((xs * xs) + (ys * ys)) + ((gq.p * statob.m28) * 0.5)) + ((gq.p * statob.m29) * 0.5);
xs = (Math.cos(ang / rad) * ds) * 0.8;
ys = (Math.sin(ang / rad) * ds) * 1.5;
playSound("scree");
playSound("banana");
statob.bigbird = 1;
gq.nextFrame();
gq.h = 1;
}
} else if (gq.typ == 9) {
if (gq.hitTest(ball) && (go == 3)) {
if (hasMine == 1) {
blowMine();
} else {
playSound("spiked");
spurt.duplicateMovieClip("bb" + bloodNum, 15000 + bloodNum, {_x:ball._x, _y:ball._y});
bloodNum++;
gq.gotoAndStop(2);
spy = ball._y - gq._y;
spx = ball._x - gq._x;
ang = Math.atan2(spy, spx);
ball._rotation = (ang * rad) + 90;
ball._y = (gq._y - 12) + (Math.sin(ang) * 15);
ball._x = gq._x + (Math.cos(ang) * 15);
ball.gotoAndStop(3);
xs = 0;
ys = 0;
go = 5;
bloodyEnd = 1;
statob.spikes++;
statob.mace = 1;
}
}
} else if (gq.typ == 10) {
if (gq.hitTest(ball) && (go == 3)) {
playSound("pump");
curAmmo = curAmmo + (2 + Math.ceil(ammos[equipped] * 0.2));
curAmmo = Math.min(ammos[equipped], curAmmo);
gq.removeMovieClip();
}
} else if (gq.typ == 11) {
if (gq.hitTest(ball) && (go == 3)) {
playSound("cash");
cashBags = cashBags + (50 + random(Math.round(dis / 25)));
gq.removeMovieClip();
}
} else if (gq.typ == 12) {
if (go < 4) {
gq._x = gq._x - 5;
} else {
gq.done = true;
}
if (gq.hit.hitTest(ball) && (!gq.done)) {
playSound("chainsaw");
statob.chain = 1;
ang = -15;
ds = Math.sqrt((xs * xs) + (ys * ys)) * 1.5;
xs = (((Math.cos(ang / rad) * ds) + gq.p) + ((gq.p * statob.m28) * 0.5)) + ((gq.p * statob.m29) * 0.5);
ys = Math.sin(ang / rad) * ds;
gq.done = true;
}
}
} else {
gq.gotoAndStop(gq._totalframes);
}
i++;
}
if (jeepy == 1) {
if ((jj.hit.hitTest(ball) && (jeepy == 1)) && (go == 3)) {
updateMedals("Drunk Driver");
qz.drl = 0;
playSound("jeep");
ang = -30 - random(30);
xs = xs + (Math.cos(ang / rad) * ((220 + ((220 * statob.m28) * 0.5)) + ((220 * statob.m29) * 0.5)));
ys = -Math.abs(ys);
ys = ys + (Math.sin(ang / rad) * ((220 + ((220 * statob.m28) * 0.5)) + ((220 * statob.m29) * 0.5)));
jj.gotoAndStop(2);
jeepy = 2;
statob.drive = 1;
}
((jj._x < (ball._x - 400)) ? (jj.t++) : ((jj.t = 0)));
((jj.t > 30) ? (jj.removeMovieClip()) : null);
jj._x = Math.max(ball._x - 400, jj._x + jj.d);
}
((jeepy == 2) ? ((jj._x = ball._x - 50)) : null);
}
function baddies() {
if ((badTime < 1) && (ball._x > (badBall + 50))) {
spawnedAll = (3 + (statob.m9 * 1)) + (statob.m8 * 1);
xnew2 = ball._x + 800;
if (((ball._y > -1000) && (random(15) == 0)) && (spawnedAll > 0)) {
xnew2 = xnew2 + (150 + random(300));
spikes.duplicateMovieClip("bd" + bads, 5000 + bads, {_x:xnew2, _y:fallLine, typ:0});
((bads < maxBads) ? (bads++) : ((bads = 0)));
spawnedAll--;
}
if (((random(20) == 0) && (ball._x > 25000)) && (spawnedAll > 0)) {
i = 0;
while (i < 3) {
xnew2 = xnew2 + (150 + random(300));
bird.duplicateMovieClip("bd" + bads, 5000 + bads, {_x:xnew2, _y:Math.min((ball._y + random(1000)) - random(1000), fallLine - 400), typ:1});
((bads < maxBads) ? (bads++) : ((bads = 0)));
i++;
}
spawnedAll--;
}
if ((((ball._y > -1000) && (random(25) == 0)) && (ball._x > 100000)) && (spawnedAll > 0)) {
xnew2 = xnew2 + (150 + random(300));
wall.duplicateMovieClip("bd" + bads, 5000 + bads, {_x:xnew2, _y:fallLine, typ:2});
((bads < maxBads) ? (bads++) : ((bads = 0)));
spawnedAll--;
}
if (((random(25) == 0) && (ball._x > 200000)) && (spawnedAll > 0)) {
xnew2 = xnew2 + (150 + random(300));
firey.duplicateMovieClip("bd" + bads, 5000 + bads, {_x:xnew2, _y:fallLine, typ:3, d:2, dd:0});
((bads < maxBads) ? (bads++) : ((bads = 0)));
spawnedAll--;
}
if (((random(20) == 0) && (ball._x > 250000)) && (spawnedAll > 0)) {
xnew2 = xnew2 + (150 + random(300));
sun.duplicateMovieClip("bd" + bads, 5000 + bads, {_x:xnew2, _y:Math.min((ball._y + random(1000)) - random(1000), fallLine - 2000), typ:4, dd:0});
((bads < maxBads) ? (bads++) : ((bads = 0)));
spawnedAll--;
}
if (((random(20) == 0) && (ball._x > 350000)) && (spawnedAll > 0)) {
xnew2 = xnew2 + (150 + random(300));
ufo.duplicateMovieClip("bd" + bads, 5000 + bads, {_x:xnew2, _y:Math.min((ball._y + random(1000)) - random(1000), fallLine - 3000), typ:5, dd:0});
((bads < maxBads) ? (bads++) : ((bads = 0)));
spawnedAll--;
}
badBall = ball._x;
badTime = (22 - (statob.m9 * 1)) - (statob.m8 * 1);
}
badTime--;
j = 0;
while (j < maxBads) {
bq = this["bd" + j];
((bq._x < ((-_x) - 100)) ? (bq.removeMovieClip()) : null);
((bq._x > ((-_x) + 1600)) ? (bq.removeMovieClip()) : null);
if ((jetting == 0) || (jetting == 4)) {
if (go == 3) {
if (((bq.typ == 0) && (nuclear < 2)) && ((jetting == 0) || (jetting == 4))) {
if (bq.hit.hitTest(ball) && (bq.ww != 0)) {
if (hasMine == 1) {
blowMine();
bq.w = 0;
} else {
updateMedals("Acupuncture");
qz.acu = 0;
playSound("spiked");
ball._rotation = 0;
ball._x = bq._x;
ball._y = fallLine - 10;
ball.gotoAndStop(3);
spurt.duplicateMovieClip("bb" + bloodNum, 15000 + bloodNum, {_x:ball._x, _y:fallLine - 10});
bloodNum++;
spurt.duplicateMovieClip("bb" + bloodNum, 15000 + bloodNum, {_x:ball._x - 15, _y:fallLine});
bloodNum++;
spurt.duplicateMovieClip("bb" + bloodNum, 15000 + bloodNum, {_x:ball._x + 15, _y:fallLine});
bloodNum++;
bld.duplicateMovieClip("bb" + bloodNum, 4500 + bloodNum, {_x:ball._x - 25, _y:fallLine});
bloodNum++;
bld.duplicateMovieClip("bb" + bloodNum, 4500 + bloodNum, {_x:ball._x, _y:fallLine});
bloodNum++;
bld.duplicateMovieClip("bb" + bloodNum, 4500 + bloodNum, {_x:ball._x + 25, _y:fallLine});
bloodNum++;
bq.gotoAndStop(2);
xs = 0;
ys = 0;
go = 5;
bloodyEnd = 1;
statob.spikes++;
statob.spiked = 1;
}
}
} else if ((bq.typ == 2) && (nuclear < 2)) {
if (bq.hit.hitTest(ball) && (bq.ww != 0)) {
if (hasMine == 1) {
blowMine();
bq.ww = 0;
} else {
updateMedals("Acupuncture");
playSound("spiked");
ball._rotation = -90;
ball._x = bq._x;
ball.gotoAndStop(3);
spurt.duplicateMovieClip("bb" + bloodNum, 15000 + bloodNum, {_x:ball._x, _y:ball._y + 30});
bloodNum++;
spurt.duplicateMovieClip("bb" + bloodNum, 15000 + bloodNum, {_x:ball._x, _y:ball._y});
bloodNum++;
spurt.duplicateMovieClip("bb" + bloodNum, 15000 + bloodNum, {_x:ball._x, _y:ball._y - 30});
bloodNum++;
bld.duplicateMovieClip("bb" + bloodNum, 4500 + bloodNum, {_x:ball._x, _y:fallLine});
bloodNum++;
bld.duplicateMovieClip("bb" + bloodNum, 4500 + bloodNum, {_x:ball._x - 20, _y:fallLine});
bloodNum++;
bld.duplicateMovieClip("bb" + bloodNum, 4500 + bloodNum, {_x:ball._x - 40, _y:fallLine});
bloodNum++;
bq.gotoAndStop(2);
xs = 0;
ys = 0;
go = 5;
bloodyEnd = 1;
statob.spikes++;
statob.wallspike = 1;
}
}
}
}
if (bq.typ == 1) {
((bq.d != 0) ? ((bq._x = bq._x + 2)) : ((bq._x = bq._x - 2)));
if (bq.hit.hitTest(ball) && (bq.d != 0)) {
playSound("squawk");
xs = xs * 0.8;
ys = ys * 0.8;
bq.d = 0;
bq.nextFrame();
birdie++;
statob.smallbird = 1;
}
} else if (bq.typ == 3) {
if (bq.d != 0) {
bq.jj = 0;
bq.jd = 0;
bq.d = 0;
}
if (((ball._y < 0) && (random(15) == 0)) && (bq.jd == 0)) {
bq.jj = -25 - random(26);
bq.jd = 1;
}
bq._y = bq._y + bq.jj;
bq.jj++;
if (bq._y > fallLine) {
bq.jd = 0;
bq._y = fallLine;
}
if (bq.hitTest(ball) && (bq.dd != 1)) {
playSound("flamed");
ang = -66;
ds = Math.sqrt((xs * xs) + (ys * ys)) * 0.9;
xs = Math.cos(ang / rad) * ds;
ys = Math.sin(ang / rad) * ds;
onFire = 90;
bq.dd = 1;
fired++;
statob.flame = 1;
statob.burn++;
}
} else if (bq.typ == 4) {
if (bq.hitTest(ball) && (bq.dd != 2)) {
updateMedals("Icarus");
qz.sun = 0;
playSound("flamed");
ang = -80 + random(160);
ds = Math.sqrt((xs * xs) + (ys * ys)) * 0.9;
xs = Math.cos(ang / rad) * ds;
ys = Math.sin(ang / rad) * ds;
onFire = 120;
bq.dd = 2;
fired++;
statob.sun = 1;
statob.burn++;
}
} else if (bq.typ == 5) {
((go == 3) ? ((bq._x = bq._x + 20)) : null);
if (bq.dd != 1) {
if (bq.hitTest(ball)) {
if (ball._y < (bq._y - 70)) {
ys = (-Math.abs(ys)) - 1;
playSound("zap");
warworld++;
} else if (bq.hit.hitTest(ball)) {
updateMedals("Abducted");
qz.ufo = 0;
playSound("caught");
ball._x = bq._x;
ball._y = bq._y;
ball.gotoAndStop(1);
ball._rotation = 0;
bq.gotoAndStop(2);
bq.dd = 1;
xs = 0;
ys = 0;
go = 5;
abducted = 1;
statob.ufo = 1;
}
}
}
}
}
j++;
}
}
tippytop = topper * 0.75;
goodBall = 0;
goodTime = 20;
newGoodTime = (30 - (statob.m9 * 5)) - (statob.m8 * 5);
badBall = 0;
badTime = 20;
newBadTime = (22 - (statob.m9 * 1)) - (statob.m8 * 1);
function groundmove() {
farBack._x = -_x;
masky._x = -_x;
i = 0;
while (i < allLand) {
this["bgland" + i]._x = getPosition(this["bgland" + i], i, 0);
this["bgstar" + i]._x = ((this["bgstar" + i]._width - 10) * this["bgstar" + i].num) + (((-_x) - outter) * 0.97);
this["bgfar" + i]._x = ((this["bgfar" + i]._width - 10) * this["bgfar" + i].num) + (((-_x) - outter) * 0.75);
if ((-_x) > ((this["bgfar" + i]._x + this["bgfar" + i]._width) + 500)) {
this["bgfar" + i].num = this["bgfar" + i].num + allLand;
}
if ((-_x) > ((this["bgstar" + i]._x + this["bgstar" + i]._width) + 500)) {
this["bgstar" + i].num = this["bgstar" + i].num + allLand;
}
if (this["bgfar" + i]._x > ((-_x) + 1600)) {
this["bgfar" + i].l.gotoAndStop(1 + random(this["bgfar" + i].l._totalframes));
}
if (this["bgstar" + i]._x > ((-_x) + 1600)) {
this["bgstar" + i].gotoAndStop(1 + random(starz._totalframes));
}
if (oldBack != backing) {
this["bgland" + i].gotoAndStop(backing);
this["bgfar" + i].gotoAndStop(backing);
}
i++;
}
if ((random(5) == 0) && (ball._x > newD)) {
junk.duplicateMovieClip("dd" + debree, 3400 + debree, {_x:(ball._x + 850) + random(400), _y:fallLine, _xscale:junk._xscale * ((random(2) == 0) ? 1 : -1), cacheAsBitmap:true});
this["dd" + debree].gotoAndStop(backing);
((debree < 20) ? (debree++) : ((debree = 0)));
newD = (ball._x + 850) + random(400);
}
j = 0;
while (j < spaces) {
if ((-_x) > (this["pp" + j]._x + 3000)) {
this["pp" + j]._y = ((-topper) * 0.8) - random(topper * 0.2);
this["pp" + j]._xscale = ((random(2) == 0) ? (40 + random(100)) : (-40 - random(100)));
this["pp" + j]._yscale = this["pp" + j]._xscale * ((random(2) == 0) ? 1 : -1);
this["pp" + j].l.gotoAndStop(1 + random(planets._totalframes));
this["pp" + j].xx = (((-_x) + 2000) + random(1000)) - (((-_x) - outter) * 0.9);
}
this["pp" + j]._x = this["pp" + j].xx + (((-_x) - outter) * 0.9);
j++;
}
j = 0;
while (j < clouders) {
if ((-_x) > (this["cds" + j]._x + 3000)) {
this["cds" + j]._xscale = ((random(2) == 0) ? (80 + random(200)) : (-80 - random(200)));
this["cds" + j]._yscale = Math.abs(this["cds" + j]._xscale);
this["cds" + j].gf = 1 + random(this["cds" + j].l._totalframes);
this["cds" + j].l.gotoAndStop(this["cds" + j].gf);
this["cds" + j]._y = ((-topper) * 0.7) + random(topper * 0.7);
this["cds" + j].xx = (((-_x) + 3000) + random(1000)) - (((-_x) - outter) * 0.8);
}
horiTest = (((-_x) - 800) < this["cds" + j]._x) && (this["cds" + j]._x < ((-_x) + 1800));
vertTest = (((-_y) - 800) < this["cds" + j]._y) && (this["cds" + j]._y < ((-_y) + 1800));
if ((horiTest && (vertTest)) && (this["cds" + j]._currentframe != backing)) {
this["cds" + j].gotoAndStop(backing);
this["cds" + j].l.gotoAndStop(this["cds" + j].gf);
} else if ((!horiTest) || (!vertTest)) {
this["cds" + j].gotoAndStop(cluds._totalframes);
}
this["cds" + j]._x = this["cds" + j].xx + (((-_x) - outter) * 0.8);
j++;
}
oldBack = backing;
farBack.gotoAndStop(backing);
masky._x = -_x;
masky._y = -_y;
}
function getPosition(mc, i, per) {
if (go != 0) {
len = mc._width - 10;
maxLen = (mc._width - 10) * allLand;
ballPer = (ball._x - outter) * per;
newPos = (ballPer + (Math.floor((ball._x - ballPer) / len) * len)) - (len * (i - 1));
return(newPos);
}
return((-mc._width) * i);
}
i = 0;
while (i < allLand) {
dland.duplicateMovieClip("bgland" + i, 4000 + i, {_x:(-dland._width) * i, _y:fallLine, cacheAsBitmap:true});
dfar.duplicateMovieClip("bgfar" + i, 2000 + i, {_x:(-dfar._width) * i, _y:fallLine - 250, num:i});
starz.duplicateMovieClip("bgstar" + i, 2200 + i, {_x:(-starz._width) * i, _y:-topper, num:i, cacheAsBitmap:true});
i++;
}
spaces = 5;
j = 0;
while (j < spaces) {
planets.duplicateMovieClip("pp" + j, 3600 + j, {_x:j * 1000, _y:((-topper) * 0.8) - random(topper * 0.2), xx:j * 1000, cacheAsBitmap:true});
this["pp" + j].gotoAndStop(1 + random(planets._totalframes));
j++;
}
clouders = 35;
j = 0;
while (j < clouders) {
asdf = random(3000);
cluds.duplicateMovieClip("cds" + j, 3650 + j, {_x:asdf, _y:((-topper) * 0.7) + random(topper * 0.7), xx:asdf, gf:1 + random(cluds.l._totalframes), cacheAsBitmap:true});
this["cds" + j].gotoAndStop(backing);
j++;
}
farBack._xscale = (farBack._yscale = 100);
groundmove();
lastX = 0;
lastXC = 0;
function shopping() {
if (inShop == 0) {
shop._x = -1000;
shop._visible = false;
gunRack._visible = false;
} else if (inShop > 0) {
shop._x = shop._x + (((-_x) - shop._x) / 10);
shop._x = Math.max(ball._x - 5000, shop._x);
shop._visible = true;
gunRack._visible = true;
if (shop._x <= ((-_x) - 100)) {
} else {
(board.adder.gotoAndStop(1));// not popped
}
}
shop._y = lockY - 30;
if (onClear == 0) {
if ((showInfo == 0) && (insuf < 30)) {
shop.info = "Welcome to Blast Co.!";
if (switchClock > 0) {
shop.info = shop.info + (((((((((("\nTotal Distance: " + totalDis) + " Best: ") + bestDis) + "\nTotal Cash Earned: ") + totalCash) + "\nTotal Tries: ") + totalTries) + " Time Played: ") + Math.floor(allTime / 30)) + " seconds");
} else if (switchClock > -300) {
shop.info = shop.info + "\nProgramming by Foreverkul \nArt drawn by Gonzo \nSponsored by Newgrounds.com";
} else {
shop.info = shop.info + "\nMusic provided by Maestro Rage \nSFX by respecitve owners";
}
} else if ((showInfo > 0) && (insuf < 30)) {
shop.info = (((titles[showInfo - 1] + " - $") + costs[showInfo - 1]) + newline) + desc[showInfo - 1];
}
} else {
shop.info = "\nDOUBLE CLICK TO CLEAR ALL DATA";
}
((switchClock < -450) ? ((switchClock = 300)) : (switchClock--));
if (insuf > 0) {
shop.info = cant;
insuf--;
}
shop.allcash = allCash;
}
showInfo = 0;
shop._y = 0;
shop.retry.onRelease = function () {
resetAll();
};
insuf = 0;
intim = 60;
switchClock = 150;
onClear = 0;
shop.clearAll.onRollOver = function () {
onClear = 1;
};
shop.clearAll.onRollOut = function () {
onClear = 0;
};
titles = ["Chest Bomb", "Rock Pack", "Jet Pack", "Missile", "Big Cannon", "Super Cannon", "Gold Cannon", "Nuclear Thingy", "Tank"];
costs = [2000, 1000, 25000, 60000, 10000, 40000, 100000, 10000, 200000];
aa = "Strap this bomb to you chest and it will automatically explode if you stop moving! Only one use.";
bb = "This primitive jet pack is heavy and slow, but it will get the job done. Free fuel refills. Click it to activate.";
cc = "The newest in jet pack technology. Smooth flight and can go very high. Must purchase a Rock Pack first. Click it to activate.";
dd = "Everyone knows missiles are faster than any jet pack, so why not use this instead? Must trade in Jet Pack. Click it to activate.";
ee = "A strong durable cannon. Good for private use of launching yourself.";
ff = "This cannon comes with flashy buttons, and a stronger blast. Need to trade in previous cannon first.";
gg = "The Gold Cannon is of superior design, utilizing maximum comfort to distance ratio! Will only trade for good quality cannons.";
hh = "Nuclear bombs are dangerous, but who cares? They make a huge explosion! You can buy more than one. Click the nuke to use one.";
ii = "The Tank is not only an awesome weapon of war, but can provide hours of fun! It's the most powerful cannon in this shop!";
desc = [aa, bb, cc, dd, ee, ff, gg, hh, ii];
shop.a.onRollOver = function () {
showInfo = 1;
};
shop.b.onRollOver = function () {
showInfo = 2;
};
shop.c.onRollOver = function () {
showInfo = 3;
};
shop.d.onRollOver = function () {
showInfo = 4;
};
shop.e.onRollOver = function () {
showInfo = 5;
};
shop.f.onRollOver = function () {
showInfo = 6;
};
shop.g.onRollOver = function () {
showInfo = 7;
};
shop.h.onRollOver = function () {
showInfo = 8;
};
shop.ii.onRollOver = function () {
showInfo = 9;
};
shop.a.onPress = function () {
if (allCash >= costs[0]) {
if (hasMine == 0) {
allCash = allCash - costs[0];
hasMine = 1;
playSound("cash");
} else {
cant = "You already have a Chest Bomb!";
insuf = intim;
}
} else {
cant = "You don't have enough money to buy the Chest Bomb.";
insuf = intim;
}
};
shop.b.onRelease = function () {
if (allCash >= costs[1]) {
if (jetPack == 0) {
allCash = allCash - costs[1];
jetPack = 1;
playSound("cash");
} else {
cant = "You already got a Rock Pack!";
insuf = intim;
}
} else {
cant = "You need more money for a Rock Pack.";
insuf = intim;
}
};
shop.c.onRelease = function () {
if (allCash >= costs[2]) {
if (jetPack == 0) {
cant = "You need a Rock Pack first.";
insuf = intim;
} else if (jetPack == 1) {
allCash = allCash - costs[2];
jetPack = 2;
playSound("cash");
} else {
cant = "You already got a Jet Pack!";
insuf = intim;
}
} else {
cant = "You need more money for a Jet Pack.";
insuf = intim;
}
};
shop.d.onRelease = function () {
if (allCash >= costs[3]) {
if (jetPack < 2) {
cant = "You need a Jet Pack first.";
insuf = intim;
} else if (jetPack == 2) {
allCash = allCash - costs[3];
jetPack = 3;
playSound("cash");
} else {
cant = "You already have the Missile!";
insuf = intim;
}
} else {
cant = "You need more money for a Missile.";
insuf = intim;
}
};
shop.e.onRelease = function () {
if (allCash >= costs[4]) {
if (canNum == 1) {
allCash = allCash - costs[4];
canNum = 2;
playSound("cash");
} else {
cant = "You already have a Big Cannon.";
insuf = intim;
}
} else {
cant = "You can't afford the Big Cannon.";
insuf = intim;
}
};
shop.f.onRelease = function () {
if (allCash >= costs[5]) {
if (canNum == 1) {
cant = "You need to trade in a Big Cannon first.";
insuf = intim;
} else if (canNum == 2) {
allCash = allCash - costs[5];
canNum = 3;
playSound("cash");
} else {
cant = "You already have a Super Cannon.";
insuf = intim;
}
} else {
cant = "You can't afford the Super Cannon.";
insuf = intim;
}
};
shop.g.onRelease = function () {
if (allCash >= costs[6]) {
if (canNum < 3) {
cant = "You need to trade in a Super Cannon first.";
insuf = intim;
} else if (canNum == 3) {
allCash = allCash - costs[6];
canNum = 4;
playSound("cash");
} else {
cant = "You already have a Gold Cannon.";
insuf = intim;
}
} else {
cant = "You can't afford the Gold Cannon.";
insuf = intim;
}
};
shop.h.onRelease = function () {
if (allCash >= costs[7]) {
allNukes++;
allCash = allCash - costs[7];
playSound("cash");
} else {
cant = "You need more money to afford a nuke!";
insuf = intim;
}
};
shop.ii.onRelease = function () {
if (allCash >= costs[8]) {
if (canNum < 4) {
cant = "You need to trade in a Gold Cannon first.";
insuf = intim;
} else if (canNum == 4) {
allCash = allCash - costs[8];
canNum = 5;
playSound("cash");
} else {
cant = "You already have a Tank!";
insuf = intim;
}
} else {
cant = "You can't afford the Tank.";
insuf = intim;
}
};
shop.a.onRollOut = function () {
showInfo = 0;
};
shop.b.onRollOut = function () {
showInfo = 0;
};
shop.c.onRollOut = function () {
showInfo = 0;
};
shop.d.onRollOut = function () {
showInfo = 0;
};
shop.e.onRollOut = function () {
showInfo = 0;
};
shop.f.onRollOut = function () {
showInfo = 0;
};
shop.g.onRollOut = function () {
showInfo = 0;
};
shop.h.onRollOut = function () {
showInfo = 0;
};
shop.ii.onRollOut = function () {
showInfo = 0;
};
function gunRacking() {
gunRack._x = shop._x + 4;
gunRack._y = (shop._y - 540) + 30;
gunRack.allcash = allCash;
gunRack.disGun.gotoAndStop(selectd);
gunRack.disAmmo.gotoAndStop(selectd);
gunRack.gunName = catalog[selectd][0];
gunRack.gunInfo = catalog[selectd][1];
if (selectd == equipped) {
gunRack.stat = "Equipped";
} else if (owned[selectd] == 1) {
gunRack.stat = "Owned";
} else if (bestDis > disTest[selectd]) {
gunRack.stat = "Available";
} else {
gunRack.stat = "Locked";
}
hud.disGun.gotoAndStop(equipped);
z = 0;
while (z < 31) {
qd = hud["q" + z];
qd._visible = z < ammos[equipped];
qd._alpha = 25 + (75 * (curAmmo >= (z + 1)));
qd.gotoAndStop(equipped);
qd._y = -380 + (qd._height * z);
z++;
}
}
equipped = ((saveFile.data.equipped != undefined) ? (saveFile.data.equipped) : 1);
setGun = 0;
z = 1;
while (z < 31) {
hud.q0.duplicateMovieClip("q" + z, 100 + z, {_x:hud.q0._x, _y:hud.q0._y + (hud.q0._height * z), _visible:false, cacheAsBitmap:true});
z++;
}
gunRack.bb.onRelease = function () {
if (((allCash >= costGuns[selectd]) && (owned[selectd] == 0)) && (bestDis > disTest[selectd])) {
allCash = allCash - costGuns[selectd];
owned[selectd] = 1;
equipped = selectd;
playSound("cash");
}
allGuns = true;
i = 1;
while (i < owned.length) {
allGuns = allGuns && (owned[i]);
i++;
}
};
gunRack.ee.onRelease = function () {
if (owned[selectd] == 1) {
equipped = selectd;
setGun = 0;
playSound("oops");
}
};
shop.gunz.onRelease = function () {
inShop = 2;
};
gunRack.rr.onRelease = function () {
inShop = 1;
};
disTest = [0, 0, 0, 0, 0, 25000, 25000, 25000, 100000, 100000, 0];
costGuns = [0, 0, 6000, 8000, 10000, 40000, 40000, 50000, 75000, 80000, 400000];
owned = ((saveFile.data.owned != undefined) ? (saveFile.data.owned) : ([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]));
if (owned.length == 10) {
owned[10] = 0;
}
ammos = [0, 3, 6, 8, 20, 30, 8, 12, 10, 5, 10];
powers = [0, 1, 5, 10, 15, 20, 50, 50, 100, 200, 5000];
curAmmo = ammos[equipped];
slgs = "Default weapon \nCost: $0 \nPower: 1 Ammo: 3 \nAccuracy: Low \nA primitive weapon.";
slg = ["Sling Shot", slgs];
regs = "First Tier \nCost: $6000 \nPower: 5 Ammo: 6 \nAccuracy: Medium \nWell rounded small weapon.";
reg = ["Revolver", regs];
begs = "First Tier \nCost: $8000 \nPower: 10 Ammo: 8 \nAccuracy: Low \nStrong small weapon.";
beg = ["Desert Eagle", begs];
uzgs = "First Tier \nCost: $10000 \nPower: 15 Ammo: 20 \nAccuracy: Low \nWeak but lots of ammo.";
uzg = ["Uzi", uzgs];
akgs = "Second Tier (reach 25,000ft+) \nCost: $40,000 \nPower: 20 Ammo: 30 \nAccuracy: Low \nStrong but hard to aim.";
akg = ["AK-47", akgs];
pugs = "Second Tier (reach 25,000ft+) \nCost: $40,000 \nPower: 50 Ammo: 8 \nAccuracy: Medium \nArea effect allows easy hits.";
pug = ["Pump Shotgun", pugs];
augs = "Second Tier (reach 25,000ft+) \nCost: $50,000 \nPower: 50 Ammo: 12 \nAccuracy: Low \nArea effect allows easy hits.";
aug = ["Automatic Shotgun", augs];
sngs = "Third Tier (reach 100,000ft+) \nCost: $75,000 \nPower: 100 Ammo: 10 \nAccuracy: High \nHigh power and accuracy.";
sng = ["Sniper Rifle", sngs];
bags = "Third Tier (reach 100,000ft+) \nCost: $80,000 \nPower: 200 Ammo: 5 \nAccuracy: Medium \nPowerful explosion.";
bag = ["Bazooka", bags];
gggs = "Ultimate Weapon (reach 200,000ft+) \nCost $400,000 \nPower: 5000 Ammo: 10 \nAccuracy: High \nThe Golden Gun of Ultimate power.";
ggg = ["Golden Gun", gggs];
catalog = [0, slg, reg, beg, uzg, akg, pug, aug, sng, bag, ggg];
selectd = 1;
gunRack.a.onRelease = function () {
selectd = 1;
};
gunRack.b.onRelease = function () {
selectd = 2;
};
gunRack.c.onRelease = function () {
selectd = 3;
};
gunRack.d.onRelease = function () {
selectd = 4;
};
gunRack.e.onRelease = function () {
selectd = 5;
};
gunRack.f.onRelease = function () {
selectd = 6;
};
gunRack.g.onRelease = function () {
selectd = 7;
};
gunRack.h.onRelease = function () {
selectd = 8;
};
gunRack.i.onRelease = function () {
selectd = 9;
};
gunRack.j.onRelease = function () {
selectd = 10;
};
function setXY(m0, m1) {
m0._x = m1._x;
m0._y = m1._y;
}
function statObject() {
if (saveFile.data.stats == undefined) {
statob = new Object();
statob.bombs = 0;
statob.land = 0;
statob.float = 0;
statob.bigbomb = 0;
statob.jumper = 0;
statob.banana = 0;
statob.dogger = 0;
statob.dug = 0;
statob.bigbird = 0;
statob.smallbird = 0;
statob.drive = 0;
statob.chain = 0;
statob.ufo = 0;
statob.spikes = 0;
statob.spiked = 0;
statob.mace = 0;
statob.wallspike = 0;
statob.burn = 0;
statob.flame = 0;
statob.sun = 0;
i = 0;
while (i < 40) {
medchart["ll" + i]._visible = true;
statob["m" + i] = 0;
trace(statob["m" + i]);
i++;
}
} else {
statob = saveFile.data.stats;
i = 0;
while (i < 40) {
if (statob["m" + i] == 1) {
medchart["ll" + i]._visible = false;
} else {
statob["m" + i] = 0;
trace(statob["m" + i]);
}
i++;
}
}
}
function awardCheck() {
if ((!statob.m0) && (statob.jumper > 0)) {
unlockAward(0);
statob.m0 = 1;
}
if ((!statob.m1) && (statob.jumper >= 10)) {
unlockAward(1);
statob.m1 = 1;
}
if ((!statob.m2) && (statob.jumper >= 25)) {
unlockAward(2);
statob.m2 = 1;
}
if ((!statob.m3) && (statob.jumper >= 50)) {
unlockAward(3);
statob.m3 = 1;
}
if ((!statob.m4) && (statob.jumper >= 100)) {
unlockAward(4);
statob.m4 = 1;
}
if ((!statob.m5) && (statob.flame)) {
unlockAward(5);
statob.m5 = 1;
}
if ((!statob.m6) && (statob.sun)) {
unlockAward(6);
statob.m6 = 1;
}
if ((!statob.m7) && (statob.burn >= 10)) {
unlockAward(7);
statob.m7 = 1;
}
if ((!statob.m8) && (statob.burn >= 20)) {
unlockAward(8);
statob.m8 = 1;
}
if ((!statob.m9) && (statob.burn >= 50)) {
unlockAward(9);
statob.m9 = 1;
}
if ((!statob.m10) && (statob.land)) {
unlockAward(10);
statob.m10 = 1;
}
if ((!statob.m11) && (statob.float)) {
unlockAward(11);
statob.m11 = 1;
}
if ((!statob.m12) && (statob.bigbomb)) {
unlockAward(12);
statob.m12 = 1;
}
if ((!statob.m13) && (statob.bombs >= 20)) {
unlockAward(13);
statob.m13 = 1;
}
if ((!statob.m14) && (statob.bombs > 50)) {
unlockAward(14);
statob.m14 = 1;
}
if ((!statob.m15) && (statob.bombs >= 100)) {
unlockAward(15);
statob.m15 = 1;
}
if ((!statob.m16) && (statob.spiked)) {
unlockAward(16);
statob.m16 = 1;
}
if ((!statob.m17) && (statob.wallspike)) {
unlockAward(17);
statob.m17 = 1;
}
if ((!statob.m18) && (statob.mace)) {
unlockAward(18);
statob.m18 = 1;
}
if ((!statob.m19) && (statob.spikes >= 20)) {
unlockAward(19);
statob.m19 = 1;
}
if ((!statob.m20) && (statob.dogger)) {
unlockAward(20);
statob.m20 = 1;
}
if ((!statob.m21) && (hite >= 400)) {
unlockAward(21);
statob.m21 = 1;
}
if ((!statob.m22) && (hite >= 800)) {
unlockAward(22);
statob.m22 = 1;
}
if ((!statob.m23) && (hite >= 1200)) {
unlockAward(23);
statob.m23 = 1;
}
if ((!statob.m24) && (dis >= 5280)) {
unlockAward(24);
statob.m24 = 1;
}
if ((!statob.m25) && (dis >= 26400)) {
unlockAward(25);
statob.m25 = 1;
}
if ((!statob.m26) && (dis >= 52800)) {
unlockAward(26);
statob.m26 = 1;
}
if ((!statob.m27) && (dis >= 132000)) {
unlockAward(27);
statob.m27 = 1;
}
if ((!statob.m28) && (dis >= 264000)) {
unlockAward(28);
statob.m28 = 1;
}
if ((!statob.m29) && (dis >= 528000)) {
unlockAward(29);
statob.m29 = 1;
}
if ((!statob.m30) && (statob.smallbird)) {
unlockAward(30);
statob.m30 = 1;
}
if ((!statob.m31) && (statob.bigbird)) {
unlockAward(31);
statob.m31 = 1;
}
if ((!statob.m32) && (statob.dug)) {
unlockAward(32);
statob.m32 = 1;
}
if ((!statob.m33) && (statob.banana)) {
unlockAward(33);
statob.m33 = 1;
}
if ((!statob.m34) && (statob.chain)) {
unlockAward(34);
statob.m34 = 1;
}
if ((!statob.m35) && (statob.drive)) {
unlockAward(35);
statob.m35 = 1;
}
if ((!statob.m36) && (statob.ufo)) {
unlockAward(36);
statob.m36 = 1;
}
if ((!statob.m37) && (Math.floor(allTime / 30) > 3600)) {
unlockAward(37);
statob.m37 = 1;
}
if ((!statob.m38) && (Math.floor(allTime / 30) > 7200)) {
unlockAward(38);
statob.m38 = 1;
}
if ((!statob.m39) && (Math.floor(allTime / 30) > 18000)) {
unlockAward(39);
statob.m39 = 1;
}
}
function unlockAward(num) {
mdis.mas.mdl._x = mdis.mas.mmm._x - mdis.mas.mdl["a" + num]._x;
mdis.mas.mdl._y = mdis.mas.mmm._y - mdis.mas.mdl["a" + num]._y;
mdis.gotoAndPlay(1);
medchart["ll" + num]._visible = false;
}
if (saveFile.data.medalz == undefined) {
medalz = new Array(40);
i = 0;
while (i < 40) {
medalz[i] = 0;
i++;
}
} else {
medalz = saveFile.data.medalz;
}
medDesc = new Array(40);
medDesc[0] = "Goomba Card: Stomp 1 goomba";
medDesc[1] = "Bronze Goomba: Stomp 10 goombas (Bonus:+10% goomba bounce)";
medDesc[2] = "Silver Goomba: Stomp 25 goombas (Bonus:+20% goomba bounce)";
medDesc[3] = "Golden Goomba: Stomp 50 goombas (Bonus:+30% goomba bounce)";
medDesc[4] = "Diamond Goomba: Stomp 100 goombas (Bonus:+40% goomba bounce)";
medDesc[5] = "Flame: Hit a fire guy";
medDesc[6] = "Sun Card: Hit a sun";
medDesc[7] = "Singed: Burn 10 times";
medDesc[8] = "Burnt: Burn 20 times (Bonus:+more things)";
medDesc[9] = "Crispy: Burn 50 times (Bonus:+even more things)";
medDesc[10] = "Bomb Card: Hit a land bomb";
medDesc[11] = "Helibomb: Hit a floating bomb";
medDesc[12] = "Fatman: Hit a giant bomb";
medDesc[13] = "Book of Bombs: Hit 20 bombs (Bonus:+10% bomb power)";
medDesc[14] = "B-29 Bomber: Hit 50 bombs (Bonus:+30% bomb power)";
medDesc[15] = "Bomberman: Hit 100 bombs (Bonus:+60% bomb power)";
medDesc[16] = "Spike Card: Hit spikes";
medDesc[17] = "Toothed Wall: Hit wall spikes";
medDesc[18] = "Mace: Hit floating spikes";
medDesc[19] = "Masochist: Hit 20 spikes (Bonus:+100% anger for ground creature)";
medDesc[20] = "Gang Hound: Get shot up";
medDesc[21] = "Helicopter: Reach 400 ft vertically";
medDesc[22] = "Jet Plane: Reach 800 ft vertically";
medDesc[23] = "Rocket Ship: Reach 1200 ft vertically";
medDesc[24] = "Reach 1 Mile (5,280 ft)";
medDesc[25] = "Reach 5 Miles (26,400 ft)";
medDesc[26] = "Reach 10 Miles (52,800 ft)";
medDesc[27] = "Reach 25 Miles (132,000 ft)";
medDesc[28] = "Reach 50 Miles (264,000 ft) (Bonus:+50% power to specials)";
medDesc[29] = "Reach 100 Miles (528,000 ft) (Bonus:+50% power to specials)";
medDesc[30] = "Bird Seed: Hit a small bird";
medDesc[31] = "Bird Speed: Hit a big bird";
medDesc[32] = "Doink: Hit an angry ground creature";
medDesc[33] = "Slap Stick: Hit a Banana";
medDesc[34] = "Chainsaw: Hit Dad";
medDesc[35] = "Driver's License: Hit a jeep";
medDesc[36] = "Contact: Hit a UFO";
medDesc[37] = "Effort: Play an hour (Bonus:+50% cannon power)";
medDesc[38] = "Commitment: Play 2 hours (Bonus:+50% cannon power)";
medDesc[39] = "Obsession: Play 5 hours (Bonus:+100% cannon power)";
showAwards = 0;
setXY(medchart.ll0, medchart.a0);
i = 1;
while (i < 40) {
medchart.ll0.duplicateMovieClip("ll" + i, i);
setXY(medchart["ll" + i], medchart["a" + i]);
i++;
}
statObject();
shop.meds.onRelease = function () {
medchart._x = -_x;
medchart._y = -_y;
medchart._visible = true;
};
medchart.back.onRelease = function () {
med.chart._y = 800;
medchart._visible = false;
};
i = 0;
while (i < 40) {
medchart["a" + i].ti = i;
medchart["a" + i].onRollOver = function () {
medchart.aws = medDesc[this.ti];
};
i++;
}
function bonusCombo() {
newcash = 0;
if ((go > 3) && (awarded == 0)) {
discash = Math.round(dis / 10);
board.combo = ("+$" + discash) + " for Distance";
newcash = newcash + discash;
((cashBags > 0) ? ((newcash = newcash + cashBags)(board.combo = board.combo + (("\n+$" + cashBags) + " from Cash Bags"))) : null);
cashBags = 0;
((((((bloodyEnd == 0) && (bombs == 0)) && (birdie == 0)) && (stomper == 0)) && (dis > 1000)) ? ((newcash = newcash + 300)(board.combo = board.combo + "\n+$300 Boring Life (Didn't hit normal objects)")) : null);
((bloodyEnd == 1) ? ((newcash = newcash + 50)(board.combo = board.combo + "\n+$50 Bloody End")) : null);
bloodyEnd = 0;
((birdie >= 5) ? ((newcash = newcash + 300)(board.combo = board.combo + "\n+$300 Engine Failure (Hit 5 Birds)")) : null);
birdie = 0;
((bombs >= 5) ? ((newcash = newcash + 100)(board.combo = board.combo + "\n+$100 Bomber Man (Hit 5 Bombs)")) : null);
bombs = 0;
((maxBombs >= 3) ? ((newcash = newcash + 600)(board.combo = board.combo + "\n+$600 Trifecta (Hit 3 bombs in a row)")) : null);
((maxBombs >= 4) ? ((newcash = newcash + 1000)(board.combo = board.combo + "\n+$1000 Superfecta (Hit 4 bombs in a row)")) : null);
maxBombs = 0;
((stomper >= 5) ? ((newcash = newcash + 250)(board.combo = board.combo + "\n+$250 Mario Man (Kill 5 Goombas)")) : null);
((stomper >= 10) ? ((newcash = newcash + 500)(board.combo = board.combo + "\n+$500 Super Luigi (Kill 10 Goombas)")) : null);
((stomper == 1) ? ((newcash = newcash + 100)(board.combo = board.combo + "\n+$100 Weegee (Kill exactly 1 Goomba)")) : null);
stomper = 0;
((bounce == 0) ? ((newcash = newcash + 1000)(board.combo = board.combo + "\n+$500 Rupophobia (Didn't touch the ground)")) : null);
((bounce >= 30) ? ((newcash = newcash + 500)(board.combo = board.combo + "\n+$500 Jumpy (Bounce 30+ times)")) : null);
bounce = 0;
((fired == 1) ? ((newcash = newcash + 50)(board.combo = board.combo + "\n+$50 Burnt Out (Burn only once)")) : null);
((fired >= 2) ? ((newcash = newcash + 100)(board.combo = board.combo + "\n+$100 First Degree Burn (Burn 2 times)")) : null);
((fired >= 5) ? ((newcash = newcash + 200)(board.combo = board.combo + "\n+$200 Second Degree Burn (Burn 5 times)")) : null);
((fired >= 8) ? ((newcash = newcash + 300)(board.combo = board.combo + "\n+$300 Third Degree Burn (Burn 8 times)")) : null);
((fired >= 12) ? ((newcash = newcash + 400)(board.combo = board.combo + "\n+$400 Fourth Degree Burn (Burn 10 times)")) : null);
fired = 0;
((abducted == 1) ? ((newcash = newcash + 500)(board.combo = board.combo + "\n+$500 Abducted (Caught by a UFO)")) : null);
abducted = 0;
((warworld >= 5) ? ((newcash = newcash + 555)(board.combo = board.combo + "\n+$555 War of the Worlds (Bounce on 5 UFO's)")) : null);
warworld = 0;
((banned == 1) ? ((newcash = newcash + 222)(board.combo = board.combo + "\n+$222 Bananed (Banana Explodes)")) : null);
banned = 0;
((closeCall >= 10) ? ((newcash = newcash + 111)(board.combo = board.combo + "\n+$111 Close Save (Barely continue moving)")) : null);
closeCall = 0;
((random(1000) == 0) ? ((newcash = newcash + 1000)(board.combo = board.combo + "\n+$1000 Lottery Ticket (1/1000 win chance)")) : null);
(((dis > 1000) && (dis < 3000)) ? ((newcash = newcash + 50)(board.combo = board.combo + "\n+$50 For the Effort")) : null);
board.newCash = "Earned $" + newcash;
allCash = allCash + newcash;
totalCash = totalCash + newcash;
board.allCash = allCash;
totalDis = totalDis + dis;
awarded = 1;
}
}
bloodyEnd = 0;
birdie = 0;
bombs = 0;
bombBounces = 0;
maxBombs = 0;
stomper = 0;
bounce = 0;
banned = 0;
closeCall = 0;
fired = 0;
warworld = 0;
cashBags = 0;
_root.CPMStarMaskClip.removeMovieClip();
_root.setMask(null);
Symbol 35 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 48 MovieClip Frame 1
stop();
Symbol 52 Button
on (release) {
_parent.play();
}
Symbol 53 MovieClip Frame 1
stop();
Symbol 58 Button
on (release) {
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 86 MovieClip Frame 6
stop();
Symbol 90 MovieClip Frame 4
stop();
Symbol 100 MovieClip Frame 179
_parent.nextFrame();
Symbol 101 MovieClip Frame 1
stop();
onEnterFrame = function () {
ll.bar.gotoAndStop(Math.ceil((_root.getBytesLoaded() / _root.getBytesTotal()) * 100));
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
ll.gotoAndStop(2);
}
};
Symbol 101 MovieClip Frame 2
stop();
_root.CPMStarMaskClip.removeMovieClip();
_root.setMask(null);
Symbol 101 MovieClip Frame 3
_parent.nextFrame();
Symbol 104 Button
on (release) {
this._visible = false;
}
Symbol 113 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 1043 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) {
trace((((((((("BaseN failed on " + n) + "%") + bitSize) + " = ") + _local3) + " ") + int(n)) + " ") + int(bitSize));
}
_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 1044 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 1045 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) {
trace((((((("[NewgroundsAPI ERROR] :: " + getCommandName(c.command_id)) + "() - ") + e.name) + ":") + newline) + "\t\t\t\t") + e.message);
}
static function sendWarning(m, c) {
if (c) {
m = m + ((("\r[NewgroundsAPI WARNING] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
trace("[NewgroundsAPI WARNING] :: " + m);
}
static function sendNotice(m, c) {
if (c) {
m = m + ((("\r[NewgroundsAPI NOTICE] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
trace("[NewgroundsAPI NOTICE] :: " + m);
}
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.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);
}
trace(_local1);
}
static function echo(m) {
if (do_echo) {
trace(m);
}
}
static var do_echo = false;
static var GATEWAY_URL = "http://www.ngads.com/gateway_v2.php";
static var AD_TERMS_URL = "http://www.newgrounds.com/wiki/flashads/terms/";
static var COMMANDS_WIKI_URL = "http://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 1046 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) {
trace("[NewgroundsAPISaveFile ERROR] :: " + msg);
}
function onCancel(msg) {
trace("[NewgroundsAPISaveFile] :: " + 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) {
trace("FINISHED");
com.Newgrounds.NewgroundsAPI.finishFileSave(folder, filename, description, share, com.Newgrounds.JSON.encode(contents), img);
}
var can_write = false;
var share = true;
}
Symbol 1047 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);
trace("MAX COLORS: " + _local3);
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) {
trace("bad pixel " + _local6);
}
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++;
trace((((((("BAD PIXEL " + debug.bad_pixels) + ") ") + _local12) + " != ") + _local18) + " ") + _local6);
trace(basen.debug.lastencode);
}
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);
trace(_local1);
}
var image_width = 100;
var image_height = 100;
var crop = true;
var debug = new Object();
}
Symbol 1048 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 1049 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 1050 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 156 MovieClip Frame 1
_root.CPMStarMaskClip.removeMovieClip();
_root.setMask(null);
aa.onRelease = function () {
gotoAndPlay (68);
_root.CPMStarMaskClip.removeMovieClip();
_root.setMask(null);
};
Symbol 156 MovieClip Frame 68
aa.onRelease = function () {
gotoAndStop (83);
_root.CPMStarMaskClip.removeMovieClip();
_root.setMask(null);
};
Symbol 156 MovieClip Frame 82
stop();
if (_root.API_Settings == undefined) {
_root.API_Settings = {movie_id:8413, enc_key:"Vynfa6nwGuVsIofKn1TsNYnRWF7OFZkA", debug_mode:false, movie_version:""};
}
Symbol 156 MovieClip Frame 83
kk.onRelease = function () {
nextFrame();
_root.CPMStarMaskClip.removeMovieClip();
_root.setMask(null);
};
Symbol 156 MovieClip Frame 84
kk.onRelease = function () {
nextFrame();
_root.CPMStarMaskClip.removeMovieClip();
_root.setMask(null);
};
Symbol 156 MovieClip Frame 85
kk.onRelease = function () {
nextFrame();
_root.CPMStarMaskClip.removeMovieClip();
_root.setMask(null);
};
Symbol 156 MovieClip Frame 86
_parent.nextFrame();
Symbol 194 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 2
stop();
Symbol 213 MovieClip Frame 3
stop();
Symbol 222 MovieClip Frame 1
gotoAndStop(1 + random(_totalframes));
Symbol 229 MovieClip Frame 13
stop();
Symbol 237 MovieClip Frame 8
stop();
Symbol 238 MovieClip Frame 1
gotoAndStop(random(2) + 1);
Symbol 243 MovieClip Frame 1
_visible = false;
Symbol 251 MovieClip Frame 8
stop();
Symbol 252 MovieClip Frame 1
stop();
Symbol 256 MovieClip Frame 160
stop();
Symbol 264 MovieClip Frame 1
stop();
Symbol 267 MovieClip Frame 1
stop();
Symbol 276 MovieClip Frame 6
stop();
Symbol 277 MovieClip Frame 1
stop();
Symbol 283 MovieClip Frame 1
stop();
Symbol 289 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 1
stop();
Symbol 314 MovieClip Frame 1
stop();
Symbol 321 MovieClip Frame 1
stop();
Symbol 341 MovieClip Frame 1
stop();
Symbol 366 MovieClip Frame 200
gotoAndPlay (36);
Symbol 391 MovieClip Frame 1
stop();
Symbol 409 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 1
stop();
Symbol 438 MovieClip Frame 1
stop();
Symbol 451 MovieClip Frame 1
stop();
Symbol 463 MovieClip Frame 1
stop();
Symbol 464 MovieClip Frame 1
stop();
Symbol 464 MovieClip Frame 2
stop();
Symbol 467 MovieClip Frame 1
_visible = false;
Symbol 496 MovieClip Frame 1
stop();
Symbol 496 MovieClip Frame 2
stop();
Symbol 502 MovieClip Frame 1
stop();
Symbol 510 MovieClip Frame 1
stop();
Symbol 517 MovieClip Frame 1
stop();
Symbol 518 MovieClip Frame 1
stop();
Symbol 518 MovieClip Frame 2
stop();
Symbol 518 MovieClip Frame 3
stop();
Symbol 523 MovieClip Frame 1
stop();
Symbol 533 MovieClip Frame 1
qq.onRelease = function () {
_root.SFX = false;
nextFrame();
};
stop();
Symbol 533 MovieClip Frame 2
qq.onRelease = function () {
_root.SFX = true;
prevFrame();
};
Symbol 537 MovieClip Frame 1
qq.onRelease = function () {
_root.MUSIC = false;
nextFrame();
};
stop();
Symbol 537 MovieClip Frame 2
qq.onRelease = function () {
_root.MUSIC = true;
prevFrame();
};
Symbol 541 Button
on (release) {
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 554 MovieClip Frame 1
stop();
Symbol 578 MovieClip Frame 1
stop();
Symbol 595 MovieClip Frame 1
stop();
Symbol 611 MovieClip Frame 1
stop();
Symbol 612 MovieClip Frame 1
stop();
Symbol 633 MovieClip Frame 1
_root.CPMStarMaskClip.removeMovieClip();
_root.setMask(null);
Symbol 633 MovieClip Frame 2
stop();
Symbol 685 MovieClip Frame 1
stop();
Symbol 689 Button
on (release) {
nextFrame();
}
Symbol 722 MovieClip Frame 1
gotoAndStop(1 + random(5));
Symbol 731 MovieClip Frame 1
gotoAndStop(1 + random(4));
Symbol 742 MovieClip Frame 1
gotoAndStop(1 + random(5));
Symbol 743 MovieClip Frame 1
stop();
Symbol 772 MovieClip Frame 7
stop();
Symbol 773 MovieClip Frame 1
stop();
Symbol 778 MovieClip Frame 1
stop();
Symbol 786 MovieClip Frame 4
stop();
Symbol 787 MovieClip Frame 1
stop();
Symbol 797 MovieClip Frame 1
stop();
Symbol 798 MovieClip Frame 1
stop();
Symbol 802 MovieClip Frame 1
stop();
Symbol 825 MovieClip Frame 24
stop();
Symbol 826 MovieClip Frame 1
stop();
Symbol 841 MovieClip Frame 1
sx = _parent._x;
sy = _parent._y;
onEnterFrame = function () {
_parent._x = (sx + 5) - random(10);
_parent._y = (sy + 5) - random(10);
};
Symbol 843 MovieClip Frame 1
stop();
Symbol 843 MovieClip Frame 2
sx = _x;
sy = _y;
Symbol 843 MovieClip Frame 207
_x = sx;
_y = sy;
Symbol 843 MovieClip Frame 273
_parent._x = _parent.savx;
_parent._y = _parent.savy;
Symbol 871 MovieClip Frame 1
Symbol 880 MovieClip Frame 1
stop();
Symbol 886 MovieClip Frame 6
stop();
Symbol 895 MovieClip Frame 1
stop();
Symbol 904 MovieClip Frame 1
stop();
Symbol 913 MovieClip Frame 1
stop();
Symbol 914 MovieClip Frame 4
stop();
Symbol 930 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";
com.Newgrounds.NewgroundsAPI.unlockMedal(medal_name);
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 930 MovieClip Frame 10
var myBitmapData = flash.display.BitmapData.loadBitmap(medal_name + ".gif");
medal_icon.attachBitmap(myBitmapData, 111);
stop();
Symbol 1035 MovieClip Frame 1
mdl.setMask(mmm);
Symbol 1037 MovieClip Frame 1
_visible = false;
Symbol 1042 MovieClip Frame 1
mas._visible = false;
stop();
Symbol 1042 MovieClip Frame 11
mas._visible = true;
Symbol 1042 MovieClip Frame 70
mas._visible = false;